erosolar-cli 1.7.193 → 1.7.195
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/dist/contracts/module-schema.json +1 -1
- package/package.json +1 -1
- package/dist/StringUtils.d.ts +0 -8
- package/dist/StringUtils.d.ts.map +0 -1
- package/dist/StringUtils.js +0 -11
- package/dist/StringUtils.js.map +0 -1
- package/dist/adapters/browser/index.d.ts +0 -12
- package/dist/adapters/browser/index.d.ts.map +0 -1
- package/dist/adapters/browser/index.js +0 -11
- package/dist/adapters/browser/index.js.map +0 -1
- package/dist/adapters/node/index.d.ts +0 -17
- package/dist/adapters/node/index.d.ts.map +0 -1
- package/dist/adapters/node/index.js +0 -35
- package/dist/adapters/node/index.js.map +0 -1
- package/dist/adapters/remote/index.d.ts +0 -13
- package/dist/adapters/remote/index.d.ts.map +0 -1
- package/dist/adapters/remote/index.js +0 -20
- package/dist/adapters/remote/index.js.map +0 -1
- package/dist/adapters/types.d.ts +0 -14
- package/dist/adapters/types.d.ts.map +0 -1
- package/dist/adapters/types.js +0 -2
- package/dist/adapters/types.js.map +0 -1
- package/dist/alpha-zero/agentWrapper.d.ts +0 -84
- package/dist/alpha-zero/agentWrapper.d.ts.map +0 -1
- package/dist/alpha-zero/agentWrapper.js +0 -171
- package/dist/alpha-zero/agentWrapper.js.map +0 -1
- package/dist/alpha-zero/codeEvaluator.d.ts +0 -25
- package/dist/alpha-zero/codeEvaluator.d.ts.map +0 -1
- package/dist/alpha-zero/codeEvaluator.js +0 -273
- package/dist/alpha-zero/codeEvaluator.js.map +0 -1
- package/dist/alpha-zero/competitiveRunner.d.ts +0 -66
- package/dist/alpha-zero/competitiveRunner.d.ts.map +0 -1
- package/dist/alpha-zero/competitiveRunner.js +0 -224
- package/dist/alpha-zero/competitiveRunner.js.map +0 -1
- package/dist/alpha-zero/index.d.ts +0 -67
- package/dist/alpha-zero/index.d.ts.map +0 -1
- package/dist/alpha-zero/index.js +0 -99
- package/dist/alpha-zero/index.js.map +0 -1
- package/dist/alpha-zero/introspection.d.ts +0 -128
- package/dist/alpha-zero/introspection.d.ts.map +0 -1
- package/dist/alpha-zero/introspection.js +0 -300
- package/dist/alpha-zero/introspection.js.map +0 -1
- package/dist/alpha-zero/metricsTracker.d.ts +0 -71
- package/dist/alpha-zero/metricsTracker.d.ts.map +0 -1
- package/dist/alpha-zero/metricsTracker.js +0 -209
- package/dist/alpha-zero/metricsTracker.js.map +0 -1
- package/dist/alpha-zero/security/core.d.ts +0 -125
- package/dist/alpha-zero/security/core.d.ts.map +0 -1
- package/dist/alpha-zero/security/core.js +0 -271
- package/dist/alpha-zero/security/core.js.map +0 -1
- package/dist/alpha-zero/security/google.d.ts +0 -125
- package/dist/alpha-zero/security/google.d.ts.map +0 -1
- package/dist/alpha-zero/security/google.js +0 -311
- package/dist/alpha-zero/security/google.js.map +0 -1
- package/dist/alpha-zero/security/googleLoader.d.ts +0 -17
- package/dist/alpha-zero/security/googleLoader.d.ts.map +0 -1
- package/dist/alpha-zero/security/googleLoader.js +0 -41
- package/dist/alpha-zero/security/googleLoader.js.map +0 -1
- package/dist/alpha-zero/security/index.d.ts +0 -29
- package/dist/alpha-zero/security/index.d.ts.map +0 -1
- package/dist/alpha-zero/security/index.js +0 -32
- package/dist/alpha-zero/security/index.js.map +0 -1
- package/dist/alpha-zero/security/simulation.d.ts +0 -124
- package/dist/alpha-zero/security/simulation.d.ts.map +0 -1
- package/dist/alpha-zero/security/simulation.js +0 -277
- package/dist/alpha-zero/security/simulation.js.map +0 -1
- package/dist/alpha-zero/selfModification.d.ts +0 -109
- package/dist/alpha-zero/selfModification.d.ts.map +0 -1
- package/dist/alpha-zero/selfModification.js +0 -233
- package/dist/alpha-zero/selfModification.js.map +0 -1
- package/dist/alpha-zero/types.d.ts +0 -170
- package/dist/alpha-zero/types.d.ts.map +0 -1
- package/dist/alpha-zero/types.js +0 -31
- package/dist/alpha-zero/types.js.map +0 -1
- package/dist/bin/erosolar.d.ts +0 -9
- package/dist/bin/erosolar.d.ts.map +0 -1
- package/dist/bin/erosolar.js +0 -88
- package/dist/bin/erosolar.js.map +0 -1
- package/dist/bin/selfTest.d.ts +0 -14
- package/dist/bin/selfTest.d.ts.map +0 -1
- package/dist/bin/selfTest.js +0 -406
- package/dist/bin/selfTest.js.map +0 -1
- package/dist/browser/BrowserSessionManager.d.ts +0 -307
- package/dist/browser/BrowserSessionManager.d.ts.map +0 -1
- package/dist/browser/BrowserSessionManager.js +0 -713
- package/dist/browser/BrowserSessionManager.js.map +0 -1
- package/dist/capabilities/advancedTestGenerationCapability.d.ts +0 -17
- package/dist/capabilities/advancedTestGenerationCapability.d.ts.map +0 -1
- package/dist/capabilities/advancedTestGenerationCapability.js +0 -28
- package/dist/capabilities/advancedTestGenerationCapability.js.map +0 -1
- package/dist/capabilities/agentSpawningCapability.d.ts +0 -6
- package/dist/capabilities/agentSpawningCapability.d.ts.map +0 -1
- package/dist/capabilities/agentSpawningCapability.js +0 -115
- package/dist/capabilities/agentSpawningCapability.js.map +0 -1
- package/dist/capabilities/askUserCapability.d.ts +0 -21
- package/dist/capabilities/askUserCapability.d.ts.map +0 -1
- package/dist/capabilities/askUserCapability.js +0 -155
- package/dist/capabilities/askUserCapability.js.map +0 -1
- package/dist/capabilities/bashCapability.d.ts +0 -13
- package/dist/capabilities/bashCapability.d.ts.map +0 -1
- package/dist/capabilities/bashCapability.js +0 -24
- package/dist/capabilities/bashCapability.js.map +0 -1
- package/dist/capabilities/browserAutomationCapability.d.ts +0 -37
- package/dist/capabilities/browserAutomationCapability.d.ts.map +0 -1
- package/dist/capabilities/browserAutomationCapability.js +0 -49
- package/dist/capabilities/browserAutomationCapability.js.map +0 -1
- package/dist/capabilities/cloudCapability.d.ts +0 -13
- package/dist/capabilities/cloudCapability.d.ts.map +0 -1
- package/dist/capabilities/cloudCapability.js +0 -38
- package/dist/capabilities/cloudCapability.js.map +0 -1
- package/dist/capabilities/codeAnalysisCapability.d.ts +0 -13
- package/dist/capabilities/codeAnalysisCapability.d.ts.map +0 -1
- package/dist/capabilities/codeAnalysisCapability.js +0 -24
- package/dist/capabilities/codeAnalysisCapability.js.map +0 -1
- package/dist/capabilities/codeGenerationCapability.d.ts +0 -13
- package/dist/capabilities/codeGenerationCapability.d.ts.map +0 -1
- package/dist/capabilities/codeGenerationCapability.js +0 -25
- package/dist/capabilities/codeGenerationCapability.js.map +0 -1
- package/dist/capabilities/codeQualityCapability.d.ts +0 -13
- package/dist/capabilities/codeQualityCapability.d.ts.map +0 -1
- package/dist/capabilities/codeQualityCapability.js +0 -25
- package/dist/capabilities/codeQualityCapability.js.map +0 -1
- package/dist/capabilities/dependencySecurityCapability.d.ts +0 -13
- package/dist/capabilities/dependencySecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/dependencySecurityCapability.js +0 -24
- package/dist/capabilities/dependencySecurityCapability.js.map +0 -1
- package/dist/capabilities/devCapability.d.ts +0 -13
- package/dist/capabilities/devCapability.d.ts.map +0 -1
- package/dist/capabilities/devCapability.js +0 -24
- package/dist/capabilities/devCapability.js.map +0 -1
- package/dist/capabilities/editCapability.d.ts +0 -17
- package/dist/capabilities/editCapability.d.ts.map +0 -1
- package/dist/capabilities/editCapability.js +0 -27
- package/dist/capabilities/editCapability.js.map +0 -1
- package/dist/capabilities/emailCapability.d.ts +0 -12
- package/dist/capabilities/emailCapability.d.ts.map +0 -1
- package/dist/capabilities/emailCapability.js +0 -22
- package/dist/capabilities/emailCapability.js.map +0 -1
- package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts +0 -17
- package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts.map +0 -1
- package/dist/capabilities/enhancedCodeIntelligenceCapability.js +0 -28
- package/dist/capabilities/enhancedCodeIntelligenceCapability.js.map +0 -1
- package/dist/capabilities/enhancedDevWorkflowCapability.d.ts +0 -17
- package/dist/capabilities/enhancedDevWorkflowCapability.d.ts.map +0 -1
- package/dist/capabilities/enhancedDevWorkflowCapability.js +0 -28
- package/dist/capabilities/enhancedDevWorkflowCapability.js.map +0 -1
- package/dist/capabilities/enhancedGitCapability.d.ts +0 -7
- package/dist/capabilities/enhancedGitCapability.d.ts.map +0 -1
- package/dist/capabilities/enhancedGitCapability.js +0 -220
- package/dist/capabilities/enhancedGitCapability.js.map +0 -1
- package/dist/capabilities/filesystemCapability.d.ts +0 -13
- package/dist/capabilities/filesystemCapability.d.ts.map +0 -1
- package/dist/capabilities/filesystemCapability.js +0 -24
- package/dist/capabilities/filesystemCapability.js.map +0 -1
- package/dist/capabilities/frontendTestingCapability.d.ts +0 -13
- package/dist/capabilities/frontendTestingCapability.d.ts.map +0 -1
- package/dist/capabilities/frontendTestingCapability.js +0 -28
- package/dist/capabilities/frontendTestingCapability.js.map +0 -1
- package/dist/capabilities/globCapability.d.ts +0 -17
- package/dist/capabilities/globCapability.d.ts.map +0 -1
- package/dist/capabilities/globCapability.js +0 -27
- package/dist/capabilities/globCapability.js.map +0 -1
- package/dist/capabilities/index.d.ts +0 -25
- package/dist/capabilities/index.d.ts.map +0 -1
- package/dist/capabilities/index.js +0 -25
- package/dist/capabilities/index.js.map +0 -1
- package/dist/capabilities/interactionCapability.d.ts +0 -12
- package/dist/capabilities/interactionCapability.d.ts.map +0 -1
- package/dist/capabilities/interactionCapability.js +0 -22
- package/dist/capabilities/interactionCapability.js.map +0 -1
- package/dist/capabilities/learnCapability.d.ts +0 -13
- package/dist/capabilities/learnCapability.d.ts.map +0 -1
- package/dist/capabilities/learnCapability.js +0 -24
- package/dist/capabilities/learnCapability.js.map +0 -1
- package/dist/capabilities/mcpCapability.d.ts +0 -6
- package/dist/capabilities/mcpCapability.d.ts.map +0 -1
- package/dist/capabilities/mcpCapability.js +0 -19
- package/dist/capabilities/mcpCapability.js.map +0 -1
- package/dist/capabilities/notebookCapability.d.ts +0 -17
- package/dist/capabilities/notebookCapability.d.ts.map +0 -1
- package/dist/capabilities/notebookCapability.js +0 -27
- package/dist/capabilities/notebookCapability.js.map +0 -1
- package/dist/capabilities/performanceMonitoringCapability.d.ts +0 -108
- package/dist/capabilities/performanceMonitoringCapability.d.ts.map +0 -1
- package/dist/capabilities/performanceMonitoringCapability.js +0 -176
- package/dist/capabilities/performanceMonitoringCapability.js.map +0 -1
- package/dist/capabilities/planningCapability.d.ts +0 -16
- package/dist/capabilities/planningCapability.d.ts.map +0 -1
- package/dist/capabilities/planningCapability.js +0 -26
- package/dist/capabilities/planningCapability.js.map +0 -1
- package/dist/capabilities/refactoringCapability.d.ts +0 -13
- package/dist/capabilities/refactoringCapability.d.ts.map +0 -1
- package/dist/capabilities/refactoringCapability.js +0 -25
- package/dist/capabilities/refactoringCapability.js.map +0 -1
- package/dist/capabilities/repoChecksCapability.d.ts +0 -10
- package/dist/capabilities/repoChecksCapability.d.ts.map +0 -1
- package/dist/capabilities/repoChecksCapability.js +0 -24
- package/dist/capabilities/repoChecksCapability.js.map +0 -1
- package/dist/capabilities/searchCapability.d.ts +0 -13
- package/dist/capabilities/searchCapability.d.ts.map +0 -1
- package/dist/capabilities/searchCapability.js +0 -24
- package/dist/capabilities/searchCapability.js.map +0 -1
- package/dist/capabilities/skillCapability.d.ts +0 -3
- package/dist/capabilities/skillCapability.d.ts.map +0 -1
- package/dist/capabilities/skillCapability.js +0 -77
- package/dist/capabilities/skillCapability.js.map +0 -1
- package/dist/capabilities/taskManagementCapability.d.ts +0 -12
- package/dist/capabilities/taskManagementCapability.d.ts.map +0 -1
- package/dist/capabilities/taskManagementCapability.js +0 -22
- package/dist/capabilities/taskManagementCapability.js.map +0 -1
- package/dist/capabilities/testingCapability.d.ts +0 -13
- package/dist/capabilities/testingCapability.d.ts.map +0 -1
- package/dist/capabilities/testingCapability.js +0 -25
- package/dist/capabilities/testingCapability.js.map +0 -1
- package/dist/capabilities/todoCapability.d.ts +0 -19
- package/dist/capabilities/todoCapability.d.ts.map +0 -1
- package/dist/capabilities/todoCapability.js +0 -169
- package/dist/capabilities/todoCapability.js.map +0 -1
- package/dist/capabilities/toolManifest.d.ts +0 -3
- package/dist/capabilities/toolManifest.d.ts.map +0 -1
- package/dist/capabilities/toolManifest.js +0 -160
- package/dist/capabilities/toolManifest.js.map +0 -1
- package/dist/capabilities/toolRegistry.d.ts +0 -22
- package/dist/capabilities/toolRegistry.d.ts.map +0 -1
- package/dist/capabilities/toolRegistry.js +0 -115
- package/dist/capabilities/toolRegistry.js.map +0 -1
- package/dist/capabilities/validationCapability.d.ts +0 -13
- package/dist/capabilities/validationCapability.d.ts.map +0 -1
- package/dist/capabilities/validationCapability.js +0 -24
- package/dist/capabilities/validationCapability.js.map +0 -1
- package/dist/capabilities/webCapability.d.ts +0 -12
- package/dist/capabilities/webCapability.d.ts.map +0 -1
- package/dist/capabilities/webCapability.js +0 -22
- package/dist/capabilities/webCapability.js.map +0 -1
- package/dist/config.d.ts +0 -25
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -140
- package/dist/config.js.map +0 -1
- package/dist/contracts/v1/agent.d.ts +0 -147
- package/dist/contracts/v1/agent.d.ts.map +0 -1
- package/dist/contracts/v1/agent.js +0 -8
- package/dist/contracts/v1/agent.js.map +0 -1
- package/dist/contracts/v1/agentProfileManifest.d.ts +0 -60
- package/dist/contracts/v1/agentProfileManifest.d.ts.map +0 -1
- package/dist/contracts/v1/agentProfileManifest.js +0 -9
- package/dist/contracts/v1/agentProfileManifest.js.map +0 -1
- package/dist/contracts/v1/agentRules.d.ts +0 -60
- package/dist/contracts/v1/agentRules.d.ts.map +0 -1
- package/dist/contracts/v1/agentRules.js +0 -10
- package/dist/contracts/v1/agentRules.js.map +0 -1
- package/dist/contracts/v1/provider.d.ts +0 -149
- package/dist/contracts/v1/provider.d.ts.map +0 -1
- package/dist/contracts/v1/provider.js +0 -7
- package/dist/contracts/v1/provider.js.map +0 -1
- package/dist/contracts/v1/tool.d.ts +0 -136
- package/dist/contracts/v1/tool.d.ts.map +0 -1
- package/dist/contracts/v1/tool.js +0 -7
- package/dist/contracts/v1/tool.js.map +0 -1
- package/dist/contracts/v1/toolAccess.d.ts +0 -43
- package/dist/contracts/v1/toolAccess.d.ts.map +0 -1
- package/dist/contracts/v1/toolAccess.js +0 -9
- package/dist/contracts/v1/toolAccess.js.map +0 -1
- package/dist/core/LazyLoader.d.ts +0 -129
- package/dist/core/LazyLoader.d.ts.map +0 -1
- package/dist/core/LazyLoader.js +0 -240
- package/dist/core/LazyLoader.js.map +0 -1
- package/dist/core/agent.d.ts +0 -144
- package/dist/core/agent.d.ts.map +0 -1
- package/dist/core/agent.js +0 -780
- package/dist/core/agent.js.map +0 -1
- package/dist/core/agentProfileManifest.d.ts +0 -3
- package/dist/core/agentProfileManifest.d.ts.map +0 -1
- package/dist/core/agentProfileManifest.js +0 -188
- package/dist/core/agentProfileManifest.js.map +0 -1
- package/dist/core/agentProfiles.d.ts +0 -22
- package/dist/core/agentProfiles.d.ts.map +0 -1
- package/dist/core/agentProfiles.js +0 -35
- package/dist/core/agentProfiles.js.map +0 -1
- package/dist/core/agentRulebook.d.ts +0 -11
- package/dist/core/agentRulebook.d.ts.map +0 -1
- package/dist/core/agentRulebook.js +0 -136
- package/dist/core/agentRulebook.js.map +0 -1
- package/dist/core/agentSchemaLoader.d.ts +0 -131
- package/dist/core/agentSchemaLoader.d.ts.map +0 -1
- package/dist/core/agentSchemaLoader.js +0 -234
- package/dist/core/agentSchemaLoader.js.map +0 -1
- package/dist/core/cliTestHarness.d.ts +0 -200
- package/dist/core/cliTestHarness.d.ts.map +0 -1
- package/dist/core/cliTestHarness.js +0 -549
- package/dist/core/cliTestHarness.js.map +0 -1
- package/dist/core/contextManager.d.ts +0 -259
- package/dist/core/contextManager.d.ts.map +0 -1
- package/dist/core/contextManager.js +0 -1057
- package/dist/core/contextManager.js.map +0 -1
- package/dist/core/contextWindow.d.ts +0 -42
- package/dist/core/contextWindow.d.ts.map +0 -1
- package/dist/core/contextWindow.js +0 -123
- package/dist/core/contextWindow.js.map +0 -1
- package/dist/core/customCommands.d.ts +0 -18
- package/dist/core/customCommands.d.ts.map +0 -1
- package/dist/core/customCommands.js +0 -81
- package/dist/core/customCommands.js.map +0 -1
- package/dist/core/errors/apiKeyErrors.d.ts +0 -11
- package/dist/core/errors/apiKeyErrors.d.ts.map +0 -1
- package/dist/core/errors/apiKeyErrors.js +0 -159
- package/dist/core/errors/apiKeyErrors.js.map +0 -1
- package/dist/core/errors/errorTypes.d.ts +0 -111
- package/dist/core/errors/errorTypes.d.ts.map +0 -1
- package/dist/core/errors/errorTypes.js +0 -348
- package/dist/core/errors/errorTypes.js.map +0 -1
- package/dist/core/errors/safetyValidator.d.ts +0 -71
- package/dist/core/errors/safetyValidator.d.ts.map +0 -1
- package/dist/core/errors/safetyValidator.js +0 -302
- package/dist/core/errors/safetyValidator.js.map +0 -1
- package/dist/core/errors.d.ts +0 -4
- package/dist/core/errors.d.ts.map +0 -1
- package/dist/core/errors.js +0 -33
- package/dist/core/errors.js.map +0 -1
- package/dist/core/isolatedVerifier.d.ts +0 -40
- package/dist/core/isolatedVerifier.d.ts.map +0 -1
- package/dist/core/isolatedVerifier.js +0 -129
- package/dist/core/isolatedVerifier.js.map +0 -1
- package/dist/core/modelDiscovery.d.ts +0 -101
- package/dist/core/modelDiscovery.d.ts.map +0 -1
- package/dist/core/modelDiscovery.js +0 -780
- package/dist/core/modelDiscovery.js.map +0 -1
- package/dist/core/multilinePasteHandler.d.ts +0 -35
- package/dist/core/multilinePasteHandler.d.ts.map +0 -1
- package/dist/core/multilinePasteHandler.js +0 -80
- package/dist/core/multilinePasteHandler.js.map +0 -1
- package/dist/core/performanceMonitor.d.ts +0 -106
- package/dist/core/performanceMonitor.d.ts.map +0 -1
- package/dist/core/performanceMonitor.js +0 -195
- package/dist/core/performanceMonitor.js.map +0 -1
- package/dist/core/preferences.d.ts +0 -31
- package/dist/core/preferences.d.ts.map +0 -1
- package/dist/core/preferences.js +0 -232
- package/dist/core/preferences.js.map +0 -1
- package/dist/core/responseVerifier.d.ts +0 -98
- package/dist/core/responseVerifier.d.ts.map +0 -1
- package/dist/core/responseVerifier.js +0 -509
- package/dist/core/responseVerifier.js.map +0 -1
- package/dist/core/resultVerification.d.ts +0 -141
- package/dist/core/resultVerification.d.ts.map +0 -1
- package/dist/core/resultVerification.js +0 -482
- package/dist/core/resultVerification.js.map +0 -1
- package/dist/core/schemaValidator.d.ts +0 -6
- package/dist/core/schemaValidator.d.ts.map +0 -1
- package/dist/core/schemaValidator.js +0 -93
- package/dist/core/schemaValidator.js.map +0 -1
- package/dist/core/secretStore.d.ts +0 -47
- package/dist/core/secretStore.d.ts.map +0 -1
- package/dist/core/secretStore.js +0 -364
- package/dist/core/secretStore.js.map +0 -1
- package/dist/core/sessionStore.d.ts +0 -33
- package/dist/core/sessionStore.d.ts.map +0 -1
- package/dist/core/sessionStore.js +0 -188
- package/dist/core/sessionStore.js.map +0 -1
- package/dist/core/toolPreconditions.d.ts +0 -41
- package/dist/core/toolPreconditions.d.ts.map +0 -1
- package/dist/core/toolPreconditions.js +0 -267
- package/dist/core/toolPreconditions.js.map +0 -1
- package/dist/core/toolRuntime.d.ts +0 -137
- package/dist/core/toolRuntime.d.ts.map +0 -1
- package/dist/core/toolRuntime.js +0 -380
- package/dist/core/toolRuntime.js.map +0 -1
- package/dist/core/types.d.ts +0 -141
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -2
- package/dist/core/types.js.map +0 -1
- package/dist/core/unified/errors.d.ts +0 -189
- package/dist/core/unified/errors.d.ts.map +0 -1
- package/dist/core/unified/errors.js +0 -497
- package/dist/core/unified/errors.js.map +0 -1
- package/dist/core/unified/index.d.ts +0 -19
- package/dist/core/unified/index.d.ts.map +0 -1
- package/dist/core/unified/index.js +0 -68
- package/dist/core/unified/index.js.map +0 -1
- package/dist/core/unified/schema.d.ts +0 -101
- package/dist/core/unified/schema.d.ts.map +0 -1
- package/dist/core/unified/schema.js +0 -350
- package/dist/core/unified/schema.js.map +0 -1
- package/dist/core/unified/toolRuntime.d.ts +0 -179
- package/dist/core/unified/toolRuntime.d.ts.map +0 -1
- package/dist/core/unified/toolRuntime.js +0 -517
- package/dist/core/unified/toolRuntime.js.map +0 -1
- package/dist/core/unified/tools.d.ts +0 -127
- package/dist/core/unified/tools.d.ts.map +0 -1
- package/dist/core/unified/tools.js +0 -1333
- package/dist/core/unified/tools.js.map +0 -1
- package/dist/core/unified/types.d.ts +0 -352
- package/dist/core/unified/types.d.ts.map +0 -1
- package/dist/core/unified/types.js +0 -12
- package/dist/core/unified/types.js.map +0 -1
- package/dist/core/unified/version.d.ts +0 -209
- package/dist/core/unified/version.d.ts.map +0 -1
- package/dist/core/unified/version.js +0 -454
- package/dist/core/unified/version.js.map +0 -1
- package/dist/core/validationRunner.d.ts +0 -93
- package/dist/core/validationRunner.d.ts.map +0 -1
- package/dist/core/validationRunner.js +0 -740
- package/dist/core/validationRunner.js.map +0 -1
- package/dist/headless/headlessApp.d.ts +0 -5
- package/dist/headless/headlessApp.d.ts.map +0 -1
- package/dist/headless/headlessApp.js +0 -189
- package/dist/headless/headlessApp.js.map +0 -1
- package/dist/intelligence/codeIntelligence.d.ts +0 -84
- package/dist/intelligence/codeIntelligence.d.ts.map +0 -1
- package/dist/intelligence/codeIntelligence.js +0 -493
- package/dist/intelligence/codeIntelligence.js.map +0 -1
- package/dist/intelligence/docGenerator.d.ts +0 -86
- package/dist/intelligence/docGenerator.d.ts.map +0 -1
- package/dist/intelligence/docGenerator.js +0 -564
- package/dist/intelligence/docGenerator.js.map +0 -1
- package/dist/intelligence/index.d.ts +0 -51
- package/dist/intelligence/index.d.ts.map +0 -1
- package/dist/intelligence/index.js +0 -253
- package/dist/intelligence/index.js.map +0 -1
- package/dist/intelligence/refactoring.d.ts +0 -50
- package/dist/intelligence/refactoring.d.ts.map +0 -1
- package/dist/intelligence/refactoring.js +0 -354
- package/dist/intelligence/refactoring.js.map +0 -1
- package/dist/intelligence/testGenerator.d.ts +0 -74
- package/dist/intelligence/testGenerator.d.ts.map +0 -1
- package/dist/intelligence/testGenerator.js +0 -483
- package/dist/intelligence/testGenerator.js.map +0 -1
- package/dist/mcp/config.d.ts +0 -8
- package/dist/mcp/config.d.ts.map +0 -1
- package/dist/mcp/config.js +0 -252
- package/dist/mcp/config.js.map +0 -1
- package/dist/mcp/sseClient.d.ts +0 -34
- package/dist/mcp/sseClient.d.ts.map +0 -1
- package/dist/mcp/sseClient.js +0 -299
- package/dist/mcp/sseClient.js.map +0 -1
- package/dist/mcp/stdioClient.d.ts +0 -24
- package/dist/mcp/stdioClient.d.ts.map +0 -1
- package/dist/mcp/stdioClient.js +0 -179
- package/dist/mcp/stdioClient.js.map +0 -1
- package/dist/mcp/toolBridge.d.ts +0 -12
- package/dist/mcp/toolBridge.d.ts.map +0 -1
- package/dist/mcp/toolBridge.js +0 -117
- package/dist/mcp/toolBridge.js.map +0 -1
- package/dist/mcp/types.d.ts +0 -60
- package/dist/mcp/types.d.ts.map +0 -1
- package/dist/mcp/types.js +0 -2
- package/dist/mcp/types.js.map +0 -1
- package/dist/plugins/index.d.ts +0 -49
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -114
- package/dist/plugins/index.js.map +0 -1
- package/dist/plugins/providers/anthropic/index.d.ts +0 -11
- package/dist/plugins/providers/anthropic/index.d.ts.map +0 -1
- package/dist/plugins/providers/anthropic/index.js +0 -38
- package/dist/plugins/providers/anthropic/index.js.map +0 -1
- package/dist/plugins/providers/deepseek/index.d.ts +0 -11
- package/dist/plugins/providers/deepseek/index.d.ts.map +0 -1
- package/dist/plugins/providers/deepseek/index.js +0 -52
- package/dist/plugins/providers/deepseek/index.js.map +0 -1
- package/dist/plugins/providers/google/index.d.ts +0 -11
- package/dist/plugins/providers/google/index.d.ts.map +0 -1
- package/dist/plugins/providers/google/index.js +0 -40
- package/dist/plugins/providers/google/index.js.map +0 -1
- package/dist/plugins/providers/index.d.ts +0 -2
- package/dist/plugins/providers/index.d.ts.map +0 -1
- package/dist/plugins/providers/index.js +0 -20
- package/dist/plugins/providers/index.js.map +0 -1
- package/dist/plugins/providers/ollama/index.d.ts +0 -21
- package/dist/plugins/providers/ollama/index.d.ts.map +0 -1
- package/dist/plugins/providers/ollama/index.js +0 -69
- package/dist/plugins/providers/ollama/index.js.map +0 -1
- package/dist/plugins/providers/openai/index.d.ts +0 -12
- package/dist/plugins/providers/openai/index.d.ts.map +0 -1
- package/dist/plugins/providers/openai/index.js +0 -39
- package/dist/plugins/providers/openai/index.js.map +0 -1
- package/dist/plugins/providers/xai/index.d.ts +0 -11
- package/dist/plugins/providers/xai/index.d.ts.map +0 -1
- package/dist/plugins/providers/xai/index.js +0 -39
- package/dist/plugins/providers/xai/index.js.map +0 -1
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts +0 -3
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js +0 -9
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js.map +0 -1
- package/dist/plugins/tools/bash/localBashPlugin.d.ts +0 -3
- package/dist/plugins/tools/bash/localBashPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/bash/localBashPlugin.js +0 -14
- package/dist/plugins/tools/bash/localBashPlugin.js.map +0 -1
- package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts +0 -14
- package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/browser/browserAutomationPlugin.js +0 -26
- package/dist/plugins/tools/browser/browserAutomationPlugin.js.map +0 -1
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts +0 -3
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js +0 -14
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js.map +0 -1
- package/dist/plugins/tools/cloud/cloudPlugin.d.ts +0 -3
- package/dist/plugins/tools/cloud/cloudPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/cloud/cloudPlugin.js +0 -14
- package/dist/plugins/tools/cloud/cloudPlugin.js.map +0 -1
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts +0 -3
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +0 -14
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js.map +0 -1
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts +0 -3
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js +0 -14
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js.map +0 -1
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts +0 -3
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/dependency/dependencyPlugin.js +0 -12
- package/dist/plugins/tools/dependency/dependencyPlugin.js.map +0 -1
- package/dist/plugins/tools/development/devPlugin.d.ts +0 -3
- package/dist/plugins/tools/development/devPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/development/devPlugin.js +0 -14
- package/dist/plugins/tools/development/devPlugin.js.map +0 -1
- package/dist/plugins/tools/edit/editPlugin.d.ts +0 -9
- package/dist/plugins/tools/edit/editPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/edit/editPlugin.js +0 -15
- package/dist/plugins/tools/edit/editPlugin.js.map +0 -1
- package/dist/plugins/tools/email/emailPlugin.d.ts +0 -3
- package/dist/plugins/tools/email/emailPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/email/emailPlugin.js +0 -12
- package/dist/plugins/tools/email/emailPlugin.js.map +0 -1
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts +0 -3
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js +0 -9
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js.map +0 -1
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts +0 -3
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js +0 -14
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js.map +0 -1
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts +0 -3
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js +0 -14
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js.map +0 -1
- package/dist/plugins/tools/glob/globPlugin.d.ts +0 -9
- package/dist/plugins/tools/glob/globPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/glob/globPlugin.js +0 -15
- package/dist/plugins/tools/glob/globPlugin.js.map +0 -1
- package/dist/plugins/tools/index.d.ts +0 -3
- package/dist/plugins/tools/index.d.ts.map +0 -1
- package/dist/plugins/tools/index.js +0 -3
- package/dist/plugins/tools/index.js.map +0 -1
- package/dist/plugins/tools/interaction/interactionPlugin.d.ts +0 -3
- package/dist/plugins/tools/interaction/interactionPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/interaction/interactionPlugin.js +0 -12
- package/dist/plugins/tools/interaction/interactionPlugin.js.map +0 -1
- package/dist/plugins/tools/learn/learnPlugin.d.ts +0 -3
- package/dist/plugins/tools/learn/learnPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/learn/learnPlugin.js +0 -14
- package/dist/plugins/tools/learn/learnPlugin.js.map +0 -1
- package/dist/plugins/tools/mcp/mcpPlugin.d.ts +0 -3
- package/dist/plugins/tools/mcp/mcpPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/mcp/mcpPlugin.js +0 -9
- package/dist/plugins/tools/mcp/mcpPlugin.js.map +0 -1
- package/dist/plugins/tools/nodeDefaults.d.ts +0 -2
- package/dist/plugins/tools/nodeDefaults.d.ts.map +0 -1
- package/dist/plugins/tools/nodeDefaults.js +0 -63
- package/dist/plugins/tools/nodeDefaults.js.map +0 -1
- package/dist/plugins/tools/notebook/notebookPlugin.d.ts +0 -9
- package/dist/plugins/tools/notebook/notebookPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/notebook/notebookPlugin.js +0 -15
- package/dist/plugins/tools/notebook/notebookPlugin.js.map +0 -1
- package/dist/plugins/tools/planning/planningPlugin.d.ts +0 -9
- package/dist/plugins/tools/planning/planningPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/planning/planningPlugin.js +0 -15
- package/dist/plugins/tools/planning/planningPlugin.js.map +0 -1
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts +0 -3
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/refactoring/refactoringPlugin.js +0 -12
- package/dist/plugins/tools/refactoring/refactoringPlugin.js.map +0 -1
- package/dist/plugins/tools/registry.d.ts +0 -22
- package/dist/plugins/tools/registry.d.ts.map +0 -1
- package/dist/plugins/tools/registry.js +0 -58
- package/dist/plugins/tools/registry.js.map +0 -1
- package/dist/plugins/tools/search/localSearchPlugin.d.ts +0 -3
- package/dist/plugins/tools/search/localSearchPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/search/localSearchPlugin.js +0 -14
- package/dist/plugins/tools/search/localSearchPlugin.js.map +0 -1
- package/dist/plugins/tools/skills/skillPlugin.d.ts +0 -3
- package/dist/plugins/tools/skills/skillPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/skills/skillPlugin.js +0 -9
- package/dist/plugins/tools/skills/skillPlugin.js.map +0 -1
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts +0 -3
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.js +0 -12
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.js.map +0 -1
- package/dist/plugins/tools/testing/testingPlugin.d.ts +0 -3
- package/dist/plugins/tools/testing/testingPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/testing/testingPlugin.js +0 -12
- package/dist/plugins/tools/testing/testingPlugin.js.map +0 -1
- package/dist/plugins/tools/validation/validationPlugin.d.ts +0 -3
- package/dist/plugins/tools/validation/validationPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/validation/validationPlugin.js +0 -14
- package/dist/plugins/tools/validation/validationPlugin.js.map +0 -1
- package/dist/plugins/tools/web/webPlugin.d.ts +0 -3
- package/dist/plugins/tools/web/webPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/web/webPlugin.js +0 -12
- package/dist/plugins/tools/web/webPlugin.js.map +0 -1
- package/dist/providers/anthropicProvider.d.ts +0 -41
- package/dist/providers/anthropicProvider.d.ts.map +0 -1
- package/dist/providers/anthropicProvider.js +0 -446
- package/dist/providers/anthropicProvider.js.map +0 -1
- package/dist/providers/googleProvider.d.ts +0 -36
- package/dist/providers/googleProvider.d.ts.map +0 -1
- package/dist/providers/googleProvider.js +0 -312
- package/dist/providers/googleProvider.js.map +0 -1
- package/dist/providers/openaiChatCompletionsProvider.d.ts +0 -43
- package/dist/providers/openaiChatCompletionsProvider.d.ts.map +0 -1
- package/dist/providers/openaiChatCompletionsProvider.js +0 -469
- package/dist/providers/openaiChatCompletionsProvider.js.map +0 -1
- package/dist/providers/openaiResponsesProvider.d.ts +0 -38
- package/dist/providers/openaiResponsesProvider.d.ts.map +0 -1
- package/dist/providers/openaiResponsesProvider.js +0 -364
- package/dist/providers/openaiResponsesProvider.js.map +0 -1
- package/dist/providers/providerFactory.d.ts +0 -18
- package/dist/providers/providerFactory.d.ts.map +0 -1
- package/dist/providers/providerFactory.js +0 -25
- package/dist/providers/providerFactory.js.map +0 -1
- package/dist/providers/resilientProvider.d.ts +0 -94
- package/dist/providers/resilientProvider.d.ts.map +0 -1
- package/dist/providers/resilientProvider.js +0 -370
- package/dist/providers/resilientProvider.js.map +0 -1
- package/dist/runtime/agentController.d.ts +0 -65
- package/dist/runtime/agentController.d.ts.map +0 -1
- package/dist/runtime/agentController.js +0 -353
- package/dist/runtime/agentController.js.map +0 -1
- package/dist/runtime/agentHost.d.ts +0 -61
- package/dist/runtime/agentHost.d.ts.map +0 -1
- package/dist/runtime/agentHost.js +0 -156
- package/dist/runtime/agentHost.js.map +0 -1
- package/dist/runtime/agentSession.d.ts +0 -40
- package/dist/runtime/agentSession.d.ts.map +0 -1
- package/dist/runtime/agentSession.js +0 -206
- package/dist/runtime/agentSession.js.map +0 -1
- package/dist/runtime/browser.d.ts +0 -7
- package/dist/runtime/browser.d.ts.map +0 -1
- package/dist/runtime/browser.js +0 -10
- package/dist/runtime/browser.js.map +0 -1
- package/dist/runtime/cloud.d.ts +0 -7
- package/dist/runtime/cloud.d.ts.map +0 -1
- package/dist/runtime/cloud.js +0 -10
- package/dist/runtime/cloud.js.map +0 -1
- package/dist/runtime/node.d.ts +0 -8
- package/dist/runtime/node.d.ts.map +0 -1
- package/dist/runtime/node.js +0 -11
- package/dist/runtime/node.js.map +0 -1
- package/dist/runtime/universal.d.ts +0 -21
- package/dist/runtime/universal.d.ts.map +0 -1
- package/dist/runtime/universal.js +0 -29
- package/dist/runtime/universal.js.map +0 -1
- package/dist/security/active-stack-security.d.ts +0 -112
- package/dist/security/active-stack-security.d.ts.map +0 -1
- package/dist/security/active-stack-security.js +0 -296
- package/dist/security/active-stack-security.js.map +0 -1
- package/dist/security/advanced-persistence-research.d.ts +0 -92
- package/dist/security/advanced-persistence-research.d.ts.map +0 -1
- package/dist/security/advanced-persistence-research.js +0 -195
- package/dist/security/advanced-persistence-research.js.map +0 -1
- package/dist/security/advanced-targeting.d.ts +0 -119
- package/dist/security/advanced-targeting.d.ts.map +0 -1
- package/dist/security/advanced-targeting.js +0 -233
- package/dist/security/advanced-targeting.js.map +0 -1
- package/dist/security/assessment/vulnerabilityAssessment.d.ts +0 -104
- package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +0 -1
- package/dist/security/assessment/vulnerabilityAssessment.js +0 -315
- package/dist/security/assessment/vulnerabilityAssessment.js.map +0 -1
- package/dist/security/authorization/securityAuthorization.d.ts +0 -88
- package/dist/security/authorization/securityAuthorization.d.ts.map +0 -1
- package/dist/security/authorization/securityAuthorization.js +0 -172
- package/dist/security/authorization/securityAuthorization.js.map +0 -1
- package/dist/security/comprehensive-targeting.d.ts +0 -85
- package/dist/security/comprehensive-targeting.d.ts.map +0 -1
- package/dist/security/comprehensive-targeting.js +0 -438
- package/dist/security/comprehensive-targeting.js.map +0 -1
- package/dist/security/global-security-integration.d.ts +0 -91
- package/dist/security/global-security-integration.d.ts.map +0 -1
- package/dist/security/global-security-integration.js +0 -218
- package/dist/security/global-security-integration.js.map +0 -1
- package/dist/security/index.d.ts +0 -38
- package/dist/security/index.d.ts.map +0 -1
- package/dist/security/index.js +0 -47
- package/dist/security/index.js.map +0 -1
- package/dist/security/persistence-analyzer.d.ts +0 -56
- package/dist/security/persistence-analyzer.d.ts.map +0 -1
- package/dist/security/persistence-analyzer.js +0 -187
- package/dist/security/persistence-analyzer.js.map +0 -1
- package/dist/security/persistence-cli.d.ts +0 -36
- package/dist/security/persistence-cli.d.ts.map +0 -1
- package/dist/security/persistence-cli.js +0 -160
- package/dist/security/persistence-cli.js.map +0 -1
- package/dist/security/persistence-research.d.ts +0 -92
- package/dist/security/persistence-research.d.ts.map +0 -1
- package/dist/security/persistence-research.js +0 -364
- package/dist/security/persistence-research.js.map +0 -1
- package/dist/security/research/persistenceResearch.d.ts +0 -97
- package/dist/security/research/persistenceResearch.d.ts.map +0 -1
- package/dist/security/research/persistenceResearch.js +0 -282
- package/dist/security/research/persistenceResearch.js.map +0 -1
- package/dist/security/security-integration.d.ts +0 -74
- package/dist/security/security-integration.d.ts.map +0 -1
- package/dist/security/security-integration.js +0 -137
- package/dist/security/security-integration.js.map +0 -1
- package/dist/security/security-testing-framework.d.ts +0 -112
- package/dist/security/security-testing-framework.d.ts.map +0 -1
- package/dist/security/security-testing-framework.js +0 -364
- package/dist/security/security-testing-framework.js.map +0 -1
- package/dist/security/simulation/attackSimulation.d.ts +0 -93
- package/dist/security/simulation/attackSimulation.d.ts.map +0 -1
- package/dist/security/simulation/attackSimulation.js +0 -341
- package/dist/security/simulation/attackSimulation.js.map +0 -1
- package/dist/security/strategic-operations.d.ts +0 -100
- package/dist/security/strategic-operations.d.ts.map +0 -1
- package/dist/security/strategic-operations.js +0 -276
- package/dist/security/strategic-operations.js.map +0 -1
- package/dist/security/tool-security-wrapper.d.ts +0 -58
- package/dist/security/tool-security-wrapper.d.ts.map +0 -1
- package/dist/security/tool-security-wrapper.js +0 -156
- package/dist/security/tool-security-wrapper.js.map +0 -1
- package/dist/shell/autoExecutor.d.ts +0 -70
- package/dist/shell/autoExecutor.d.ts.map +0 -1
- package/dist/shell/autoExecutor.js +0 -288
- package/dist/shell/autoExecutor.js.map +0 -1
- package/dist/shell/bracketedPasteManager.d.ts +0 -128
- package/dist/shell/bracketedPasteManager.d.ts.map +0 -1
- package/dist/shell/bracketedPasteManager.enhanced.d.ts +0 -2
- package/dist/shell/bracketedPasteManager.enhanced.d.ts.map +0 -1
- package/dist/shell/bracketedPasteManager.enhanced.js +0 -4
- package/dist/shell/bracketedPasteManager.enhanced.js.map +0 -1
- package/dist/shell/bracketedPasteManager.js +0 -372
- package/dist/shell/bracketedPasteManager.js.map +0 -1
- package/dist/shell/chatBox.d.ts +0 -228
- package/dist/shell/chatBox.d.ts.map +0 -1
- package/dist/shell/chatBox.js +0 -811
- package/dist/shell/chatBox.js.map +0 -1
- package/dist/shell/claudeCodeStreamHandler.d.ts +0 -145
- package/dist/shell/claudeCodeStreamHandler.d.ts.map +0 -1
- package/dist/shell/claudeCodeStreamHandler.js +0 -312
- package/dist/shell/claudeCodeStreamHandler.js.map +0 -1
- package/dist/shell/composableMessage.d.ts +0 -183
- package/dist/shell/composableMessage.d.ts.map +0 -1
- package/dist/shell/composableMessage.js +0 -420
- package/dist/shell/composableMessage.js.map +0 -1
- package/dist/shell/fileChangeTracker.d.ts +0 -39
- package/dist/shell/fileChangeTracker.d.ts.map +0 -1
- package/dist/shell/fileChangeTracker.js +0 -64
- package/dist/shell/fileChangeTracker.js.map +0 -1
- package/dist/shell/inputQueueManager.d.ts +0 -144
- package/dist/shell/inputQueueManager.d.ts.map +0 -1
- package/dist/shell/inputQueueManager.js +0 -290
- package/dist/shell/inputQueueManager.js.map +0 -1
- package/dist/shell/interactiveShell.d.ts +0 -300
- package/dist/shell/interactiveShell.d.ts.map +0 -1
- package/dist/shell/interactiveShell.js +0 -3189
- package/dist/shell/interactiveShell.js.map +0 -1
- package/dist/shell/liveStatus.d.ts +0 -29
- package/dist/shell/liveStatus.d.ts.map +0 -1
- package/dist/shell/liveStatus.js +0 -77
- package/dist/shell/liveStatus.js.map +0 -1
- package/dist/shell/shellApp.d.ts +0 -19
- package/dist/shell/shellApp.d.ts.map +0 -1
- package/dist/shell/shellApp.js +0 -348
- package/dist/shell/shellApp.js.map +0 -1
- package/dist/shell/streamingOutputManager.d.ts +0 -114
- package/dist/shell/streamingOutputManager.d.ts.map +0 -1
- package/dist/shell/streamingOutputManager.js +0 -213
- package/dist/shell/streamingOutputManager.js.map +0 -1
- package/dist/shell/systemPrompt.d.ts +0 -3
- package/dist/shell/systemPrompt.d.ts.map +0 -1
- package/dist/shell/systemPrompt.js +0 -73
- package/dist/shell/systemPrompt.js.map +0 -1
- package/dist/shell/taskCompletionDetector.d.ts +0 -106
- package/dist/shell/taskCompletionDetector.d.ts.map +0 -1
- package/dist/shell/taskCompletionDetector.js +0 -402
- package/dist/shell/taskCompletionDetector.js.map +0 -1
- package/dist/shell/terminalInput.d.ts +0 -217
- package/dist/shell/terminalInput.d.ts.map +0 -1
- package/dist/shell/terminalInput.js +0 -1066
- package/dist/shell/terminalInput.js.map +0 -1
- package/dist/shell/terminalInputAdapter.d.ts +0 -118
- package/dist/shell/terminalInputAdapter.d.ts.map +0 -1
- package/dist/shell/terminalInputAdapter.js +0 -218
- package/dist/shell/terminalInputAdapter.js.map +0 -1
- package/dist/shell/unifiedChatBox.d.ts +0 -194
- package/dist/shell/unifiedChatBox.d.ts.map +0 -1
- package/dist/shell/unifiedChatBox.js +0 -585
- package/dist/shell/unifiedChatBox.js.map +0 -1
- package/dist/shell/updateManager.d.ts +0 -2
- package/dist/shell/updateManager.d.ts.map +0 -1
- package/dist/shell/updateManager.js +0 -111
- package/dist/shell/updateManager.js.map +0 -1
- package/dist/skills/skillRepository.d.ts +0 -103
- package/dist/skills/skillRepository.d.ts.map +0 -1
- package/dist/skills/skillRepository.js +0 -237
- package/dist/skills/skillRepository.js.map +0 -1
- package/dist/skills/types.d.ts +0 -37
- package/dist/skills/types.d.ts.map +0 -1
- package/dist/skills/types.js +0 -2
- package/dist/skills/types.js.map +0 -1
- package/dist/subagents/taskRunner.d.ts +0 -23
- package/dist/subagents/taskRunner.d.ts.map +0 -1
- package/dist/subagents/taskRunner.js +0 -271
- package/dist/subagents/taskRunner.js.map +0 -1
- package/dist/tools/advancedTestGenerationTools.d.ts +0 -21
- package/dist/tools/advancedTestGenerationTools.d.ts.map +0 -1
- package/dist/tools/advancedTestGenerationTools.js +0 -301
- package/dist/tools/advancedTestGenerationTools.js.map +0 -1
- package/dist/tools/backgroundBashTools.d.ts +0 -21
- package/dist/tools/backgroundBashTools.d.ts.map +0 -1
- package/dist/tools/backgroundBashTools.js +0 -215
- package/dist/tools/backgroundBashTools.js.map +0 -1
- package/dist/tools/bashTools.d.ts +0 -8
- package/dist/tools/bashTools.d.ts.map +0 -1
- package/dist/tools/bashTools.js +0 -227
- package/dist/tools/bashTools.js.map +0 -1
- package/dist/tools/browserAutomationTools.d.ts +0 -23
- package/dist/tools/browserAutomationTools.d.ts.map +0 -1
- package/dist/tools/browserAutomationTools.js +0 -916
- package/dist/tools/browserAutomationTools.js.map +0 -1
- package/dist/tools/cloudTools.d.ts +0 -49
- package/dist/tools/cloudTools.d.ts.map +0 -1
- package/dist/tools/cloudTools.js +0 -1258
- package/dist/tools/cloudTools.js.map +0 -1
- package/dist/tools/code-quality-dashboard.d.ts +0 -57
- package/dist/tools/code-quality-dashboard.d.ts.map +0 -1
- package/dist/tools/code-quality-dashboard.js +0 -218
- package/dist/tools/code-quality-dashboard.js.map +0 -1
- package/dist/tools/codeAnalysisTools.d.ts +0 -74
- package/dist/tools/codeAnalysisTools.d.ts.map +0 -1
- package/dist/tools/codeAnalysisTools.js +0 -664
- package/dist/tools/codeAnalysisTools.js.map +0 -1
- package/dist/tools/codeGenerationTools.d.ts +0 -3
- package/dist/tools/codeGenerationTools.d.ts.map +0 -1
- package/dist/tools/codeGenerationTools.js +0 -439
- package/dist/tools/codeGenerationTools.js.map +0 -1
- package/dist/tools/codeQualityTools.d.ts +0 -3
- package/dist/tools/codeQualityTools.d.ts.map +0 -1
- package/dist/tools/codeQualityTools.js +0 -296
- package/dist/tools/codeQualityTools.js.map +0 -1
- package/dist/tools/dependencyTools.d.ts +0 -3
- package/dist/tools/dependencyTools.d.ts.map +0 -1
- package/dist/tools/dependencyTools.js +0 -283
- package/dist/tools/dependencyTools.js.map +0 -1
- package/dist/tools/devTools.d.ts +0 -10
- package/dist/tools/devTools.d.ts.map +0 -1
- package/dist/tools/devTools.js +0 -2305
- package/dist/tools/devTools.js.map +0 -1
- package/dist/tools/diffUtils.d.ts +0 -36
- package/dist/tools/diffUtils.d.ts.map +0 -1
- package/dist/tools/diffUtils.js +0 -528
- package/dist/tools/diffUtils.js.map +0 -1
- package/dist/tools/editTools.d.ts +0 -29
- package/dist/tools/editTools.d.ts.map +0 -1
- package/dist/tools/editTools.js +0 -419
- package/dist/tools/editTools.js.map +0 -1
- package/dist/tools/emailTools.d.ts +0 -21
- package/dist/tools/emailTools.d.ts.map +0 -1
- package/dist/tools/emailTools.js +0 -449
- package/dist/tools/emailTools.js.map +0 -1
- package/dist/tools/enhancedCodeIntelligenceTools.d.ts +0 -27
- package/dist/tools/enhancedCodeIntelligenceTools.d.ts.map +0 -1
- package/dist/tools/enhancedCodeIntelligenceTools.js +0 -418
- package/dist/tools/enhancedCodeIntelligenceTools.js.map +0 -1
- package/dist/tools/enhancedDevWorkflowTools.d.ts +0 -15
- package/dist/tools/enhancedDevWorkflowTools.d.ts.map +0 -1
- package/dist/tools/enhancedDevWorkflowTools.js +0 -303
- package/dist/tools/enhancedDevWorkflowTools.js.map +0 -1
- package/dist/tools/fileTools.d.ts +0 -3
- package/dist/tools/fileTools.d.ts.map +0 -1
- package/dist/tools/fileTools.js +0 -252
- package/dist/tools/fileTools.js.map +0 -1
- package/dist/tools/frontendTestingTools.d.ts +0 -35
- package/dist/tools/frontendTestingTools.d.ts.map +0 -1
- package/dist/tools/frontendTestingTools.js +0 -1254
- package/dist/tools/frontendTestingTools.js.map +0 -1
- package/dist/tools/globTools.d.ts +0 -15
- package/dist/tools/globTools.d.ts.map +0 -1
- package/dist/tools/globTools.js +0 -174
- package/dist/tools/globTools.js.map +0 -1
- package/dist/tools/grepTools.d.ts +0 -19
- package/dist/tools/grepTools.d.ts.map +0 -1
- package/dist/tools/grepTools.js +0 -339
- package/dist/tools/grepTools.js.map +0 -1
- package/dist/tools/interactionTools.d.ts +0 -13
- package/dist/tools/interactionTools.d.ts.map +0 -1
- package/dist/tools/interactionTools.js +0 -171
- package/dist/tools/interactionTools.js.map +0 -1
- package/dist/tools/learnTools.d.ts +0 -152
- package/dist/tools/learnTools.d.ts.map +0 -1
- package/dist/tools/learnTools.js +0 -1819
- package/dist/tools/learnTools.js.map +0 -1
- package/dist/tools/notebookEditTools.d.ts +0 -15
- package/dist/tools/notebookEditTools.d.ts.map +0 -1
- package/dist/tools/notebookEditTools.js +0 -197
- package/dist/tools/notebookEditTools.js.map +0 -1
- package/dist/tools/planningTools.d.ts +0 -11
- package/dist/tools/planningTools.d.ts.map +0 -1
- package/dist/tools/planningTools.js +0 -47
- package/dist/tools/planningTools.js.map +0 -1
- package/dist/tools/refactoringTools.d.ts +0 -3
- package/dist/tools/refactoringTools.d.ts.map +0 -1
- package/dist/tools/refactoringTools.js +0 -294
- package/dist/tools/refactoringTools.js.map +0 -1
- package/dist/tools/repoChecksTools.d.ts +0 -3
- package/dist/tools/repoChecksTools.d.ts.map +0 -1
- package/dist/tools/repoChecksTools.js +0 -161
- package/dist/tools/repoChecksTools.js.map +0 -1
- package/dist/tools/searchTools.d.ts +0 -3
- package/dist/tools/searchTools.d.ts.map +0 -1
- package/dist/tools/searchTools.js +0 -207
- package/dist/tools/searchTools.js.map +0 -1
- package/dist/tools/skillTools.d.ts +0 -8
- package/dist/tools/skillTools.d.ts.map +0 -1
- package/dist/tools/skillTools.js +0 -178
- package/dist/tools/skillTools.js.map +0 -1
- package/dist/tools/softwareEngineeringTools.d.ts +0 -7
- package/dist/tools/softwareEngineeringTools.d.ts.map +0 -1
- package/dist/tools/softwareEngineeringTools.js +0 -338
- package/dist/tools/softwareEngineeringTools.js.map +0 -1
- package/dist/tools/taskManagementTools.d.ts +0 -10
- package/dist/tools/taskManagementTools.d.ts.map +0 -1
- package/dist/tools/taskManagementTools.js +0 -157
- package/dist/tools/taskManagementTools.js.map +0 -1
- package/dist/tools/testingTools.d.ts +0 -3
- package/dist/tools/testingTools.d.ts.map +0 -1
- package/dist/tools/testingTools.js +0 -233
- package/dist/tools/testingTools.js.map +0 -1
- package/dist/tools/validationTools.d.ts +0 -7
- package/dist/tools/validationTools.d.ts.map +0 -1
- package/dist/tools/validationTools.js +0 -278
- package/dist/tools/validationTools.js.map +0 -1
- package/dist/tools/webTools.d.ts +0 -3
- package/dist/tools/webTools.d.ts.map +0 -1
- package/dist/tools/webTools.js +0 -495
- package/dist/tools/webTools.js.map +0 -1
- package/dist/ui/FixedInputArea.d.ts +0 -108
- package/dist/ui/FixedInputArea.d.ts.map +0 -1
- package/dist/ui/FixedInputArea.js +0 -312
- package/dist/ui/FixedInputArea.js.map +0 -1
- package/dist/ui/ShellUIAdapter.d.ts +0 -141
- package/dist/ui/ShellUIAdapter.d.ts.map +0 -1
- package/dist/ui/ShellUIAdapter.js +0 -680
- package/dist/ui/ShellUIAdapter.js.map +0 -1
- package/dist/ui/UnifiedUIController.d.ts +0 -70
- package/dist/ui/UnifiedUIController.d.ts.map +0 -1
- package/dist/ui/UnifiedUIController.js +0 -190
- package/dist/ui/UnifiedUIController.js.map +0 -1
- package/dist/ui/advancedTheme.d.ts +0 -246
- package/dist/ui/advancedTheme.d.ts.map +0 -1
- package/dist/ui/advancedTheme.js +0 -478
- package/dist/ui/advancedTheme.js.map +0 -1
- package/dist/ui/animation/AnimationScheduler.d.ts +0 -192
- package/dist/ui/animation/AnimationScheduler.d.ts.map +0 -1
- package/dist/ui/animation/AnimationScheduler.js +0 -432
- package/dist/ui/animation/AnimationScheduler.js.map +0 -1
- package/dist/ui/codeHighlighter.d.ts +0 -6
- package/dist/ui/codeHighlighter.d.ts.map +0 -1
- package/dist/ui/codeHighlighter.js +0 -855
- package/dist/ui/codeHighlighter.js.map +0 -1
- package/dist/ui/collapsibleContent.d.ts +0 -57
- package/dist/ui/collapsibleContent.d.ts.map +0 -1
- package/dist/ui/collapsibleContent.js +0 -106
- package/dist/ui/collapsibleContent.js.map +0 -1
- package/dist/ui/designSystem.d.ts +0 -26
- package/dist/ui/designSystem.d.ts.map +0 -1
- package/dist/ui/designSystem.js +0 -122
- package/dist/ui/designSystem.js.map +0 -1
- package/dist/ui/diffViewer.d.ts +0 -42
- package/dist/ui/diffViewer.d.ts.map +0 -1
- package/dist/ui/diffViewer.js +0 -343
- package/dist/ui/diffViewer.js.map +0 -1
- package/dist/ui/display.d.ts +0 -310
- package/dist/ui/display.d.ts.map +0 -1
- package/dist/ui/display.js +0 -1558
- package/dist/ui/display.js.map +0 -1
- package/dist/ui/errorFormatter.d.ts +0 -54
- package/dist/ui/errorFormatter.d.ts.map +0 -1
- package/dist/ui/errorFormatter.js +0 -251
- package/dist/ui/errorFormatter.js.map +0 -1
- package/dist/ui/gitDisplay.d.ts +0 -45
- package/dist/ui/gitDisplay.d.ts.map +0 -1
- package/dist/ui/gitDisplay.js +0 -215
- package/dist/ui/gitDisplay.js.map +0 -1
- package/dist/ui/gitFormatter.d.ts +0 -29
- package/dist/ui/gitFormatter.d.ts.map +0 -1
- package/dist/ui/gitFormatter.js +0 -203
- package/dist/ui/gitFormatter.js.map +0 -1
- package/dist/ui/interrupts/InterruptManager.d.ts +0 -142
- package/dist/ui/interrupts/InterruptManager.d.ts.map +0 -1
- package/dist/ui/interrupts/InterruptManager.js +0 -439
- package/dist/ui/interrupts/InterruptManager.js.map +0 -1
- package/dist/ui/keyboardShortcuts.d.ts +0 -49
- package/dist/ui/keyboardShortcuts.d.ts.map +0 -1
- package/dist/ui/keyboardShortcuts.js +0 -128
- package/dist/ui/keyboardShortcuts.js.map +0 -1
- package/dist/ui/layout.d.ts +0 -17
- package/dist/ui/layout.d.ts.map +0 -1
- package/dist/ui/layout.js +0 -140
- package/dist/ui/layout.js.map +0 -1
- package/dist/ui/logFormatter.d.ts +0 -70
- package/dist/ui/logFormatter.d.ts.map +0 -1
- package/dist/ui/logFormatter.js +0 -323
- package/dist/ui/logFormatter.js.map +0 -1
- package/dist/ui/orchestration/StatusOrchestrator.d.ts +0 -156
- package/dist/ui/orchestration/StatusOrchestrator.d.ts.map +0 -1
- package/dist/ui/orchestration/StatusOrchestrator.js +0 -406
- package/dist/ui/orchestration/StatusOrchestrator.js.map +0 -1
- package/dist/ui/outputMode.d.ts +0 -22
- package/dist/ui/outputMode.d.ts.map +0 -1
- package/dist/ui/outputMode.js +0 -40
- package/dist/ui/outputMode.js.map +0 -1
- package/dist/ui/outputSummarizer.d.ts +0 -52
- package/dist/ui/outputSummarizer.d.ts.map +0 -1
- package/dist/ui/outputSummarizer.js +0 -242
- package/dist/ui/outputSummarizer.js.map +0 -1
- package/dist/ui/persistentPrompt.d.ts +0 -545
- package/dist/ui/persistentPrompt.d.ts.map +0 -1
- package/dist/ui/persistentPrompt.js +0 -1529
- package/dist/ui/persistentPrompt.js.map +0 -1
- package/dist/ui/progressBar.d.ts +0 -51
- package/dist/ui/progressBar.d.ts.map +0 -1
- package/dist/ui/progressBar.js +0 -153
- package/dist/ui/progressBar.js.map +0 -1
- package/dist/ui/progressIndicator.d.ts +0 -69
- package/dist/ui/progressIndicator.d.ts.map +0 -1
- package/dist/ui/progressIndicator.js +0 -145
- package/dist/ui/progressIndicator.js.map +0 -1
- package/dist/ui/richText.d.ts +0 -6
- package/dist/ui/richText.d.ts.map +0 -1
- package/dist/ui/richText.js +0 -391
- package/dist/ui/richText.js.map +0 -1
- package/dist/ui/shortcutsHelp.d.ts +0 -23
- package/dist/ui/shortcutsHelp.d.ts.map +0 -1
- package/dist/ui/shortcutsHelp.js +0 -89
- package/dist/ui/shortcutsHelp.js.map +0 -1
- package/dist/ui/streamingIndicators.d.ts +0 -42
- package/dist/ui/streamingIndicators.d.ts.map +0 -1
- package/dist/ui/streamingIndicators.js +0 -155
- package/dist/ui/streamingIndicators.js.map +0 -1
- package/dist/ui/tableFormatter.d.ts +0 -31
- package/dist/ui/tableFormatter.d.ts.map +0 -1
- package/dist/ui/tableFormatter.js +0 -186
- package/dist/ui/tableFormatter.js.map +0 -1
- package/dist/ui/telemetry/UITelemetry.d.ts +0 -181
- package/dist/ui/telemetry/UITelemetry.d.ts.map +0 -1
- package/dist/ui/telemetry/UITelemetry.js +0 -446
- package/dist/ui/telemetry/UITelemetry.js.map +0 -1
- package/dist/ui/textHighlighter.d.ts +0 -83
- package/dist/ui/textHighlighter.d.ts.map +0 -1
- package/dist/ui/textHighlighter.js +0 -267
- package/dist/ui/textHighlighter.js.map +0 -1
- package/dist/ui/theme.d.ts +0 -103
- package/dist/ui/theme.d.ts.map +0 -1
- package/dist/ui/theme.js +0 -128
- package/dist/ui/theme.js.map +0 -1
- package/dist/ui/thinkingTracker.d.ts +0 -51
- package/dist/ui/thinkingTracker.d.ts.map +0 -1
- package/dist/ui/thinkingTracker.js +0 -115
- package/dist/ui/thinkingTracker.js.map +0 -1
- package/dist/ui/toolDisplay.d.ts +0 -151
- package/dist/ui/toolDisplay.d.ts.map +0 -1
- package/dist/ui/toolDisplay.js +0 -1338
- package/dist/ui/toolDisplay.js.map +0 -1
- package/dist/ui/toolDisplayAdapter.d.ts +0 -66
- package/dist/ui/toolDisplayAdapter.d.ts.map +0 -1
- package/dist/ui/toolDisplayAdapter.js +0 -356
- package/dist/ui/toolDisplayAdapter.js.map +0 -1
- package/dist/ui/treeVisualizer.d.ts +0 -56
- package/dist/ui/treeVisualizer.d.ts.map +0 -1
- package/dist/ui/treeVisualizer.js +0 -247
- package/dist/ui/treeVisualizer.js.map +0 -1
- package/dist/utils/asyncUtils.d.ts +0 -95
- package/dist/utils/asyncUtils.d.ts.map +0 -1
- package/dist/utils/asyncUtils.js +0 -286
- package/dist/utils/asyncUtils.js.map +0 -1
- package/dist/utils/errorUtils.d.ts +0 -16
- package/dist/utils/errorUtils.d.ts.map +0 -1
- package/dist/utils/errorUtils.js +0 -66
- package/dist/utils/errorUtils.js.map +0 -1
- package/dist/workspace.d.ts +0 -8
- package/dist/workspace.d.ts.map +0 -1
- package/dist/workspace.js +0 -107
- package/dist/workspace.js.map +0 -1
- package/dist/workspace.validator.d.ts +0 -49
- package/dist/workspace.validator.d.ts.map +0 -1
- package/dist/workspace.validator.js +0 -214
- package/dist/workspace.validator.js.map +0 -1
package/dist/ui/display.js
DELETED
|
@@ -1,1558 +0,0 @@
|
|
|
1
|
-
import { createSpinner } from 'nanospinner';
|
|
2
|
-
import { clearScreenDown, cursorTo, moveCursor } from 'node:readline';
|
|
3
|
-
import { theme, icons } from './theme.js';
|
|
4
|
-
import { formatRichContent, renderMessagePanel, renderMessageBody } from './richText.js';
|
|
5
|
-
import { getTerminalColumns, wrapPreformatted } from './layout.js';
|
|
6
|
-
import { highlightError } from './textHighlighter.js';
|
|
7
|
-
import { renderCallout, renderSectionHeading } from './designSystem.js';
|
|
8
|
-
import { isPlainOutputMode } from './outputMode.js';
|
|
9
|
-
/**
|
|
10
|
-
* Output lock to prevent race conditions during spinner/stream output.
|
|
11
|
-
* Ensures that spinner frames don't interleave with streamed content.
|
|
12
|
-
* Uses a simple lock mechanism suitable for Node.js single-threaded event loop.
|
|
13
|
-
*/
|
|
14
|
-
class OutputLock {
|
|
15
|
-
static instance = null;
|
|
16
|
-
locked = false;
|
|
17
|
-
pendingCallbacks = [];
|
|
18
|
-
static getInstance() {
|
|
19
|
-
if (!OutputLock.instance) {
|
|
20
|
-
OutputLock.instance = new OutputLock();
|
|
21
|
-
}
|
|
22
|
-
return OutputLock.instance;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Synchronously check if output is locked (spinner is active).
|
|
26
|
-
* Used to prevent stream writes during spinner animation.
|
|
27
|
-
*/
|
|
28
|
-
isLocked() {
|
|
29
|
-
return this.locked;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Lock output during spinner animation.
|
|
33
|
-
*/
|
|
34
|
-
lock() {
|
|
35
|
-
this.locked = true;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Unlock output and process any pending callbacks.
|
|
39
|
-
*/
|
|
40
|
-
unlock() {
|
|
41
|
-
this.locked = false;
|
|
42
|
-
// Process any pending writes
|
|
43
|
-
while (this.pendingCallbacks.length > 0) {
|
|
44
|
-
const callback = this.pendingCallbacks.shift();
|
|
45
|
-
if (callback) {
|
|
46
|
-
callback();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Execute a callback safely, queueing if output is locked.
|
|
52
|
-
*/
|
|
53
|
-
safeWrite(callback) {
|
|
54
|
-
if (this.locked) {
|
|
55
|
-
this.pendingCallbacks.push(callback);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
callback();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Tracks line output to stdout for banner rewriting and cursor positioning.
|
|
63
|
-
* Instances are cached per stream to keep banner calculations consistent.
|
|
64
|
-
*/
|
|
65
|
-
class StdoutLineTracker {
|
|
66
|
-
static instances = new WeakMap();
|
|
67
|
-
static getInstance(stream = process.stdout) {
|
|
68
|
-
const existing = StdoutLineTracker.instances.get(stream);
|
|
69
|
-
if (existing) {
|
|
70
|
-
return existing;
|
|
71
|
-
}
|
|
72
|
-
const tracker = new StdoutLineTracker(stream);
|
|
73
|
-
StdoutLineTracker.instances.set(stream, tracker);
|
|
74
|
-
return tracker;
|
|
75
|
-
}
|
|
76
|
-
linesWritten = 0;
|
|
77
|
-
suspended = false;
|
|
78
|
-
stream;
|
|
79
|
-
originalWrite;
|
|
80
|
-
constructor(stream) {
|
|
81
|
-
this.stream = stream;
|
|
82
|
-
this.originalWrite = stream.write.bind(stream);
|
|
83
|
-
this.patchStream();
|
|
84
|
-
}
|
|
85
|
-
get totalLines() {
|
|
86
|
-
return this.linesWritten;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Temporarily suspends line tracking while executing a function.
|
|
90
|
-
* Useful for rewriting content without incrementing line count.
|
|
91
|
-
*/
|
|
92
|
-
withSuspended(fn) {
|
|
93
|
-
const wasSuspended = this.suspended;
|
|
94
|
-
this.suspended = true;
|
|
95
|
-
try {
|
|
96
|
-
return fn();
|
|
97
|
-
}
|
|
98
|
-
finally {
|
|
99
|
-
this.suspended = wasSuspended;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
reset() {
|
|
103
|
-
this.linesWritten = 0;
|
|
104
|
-
}
|
|
105
|
-
patchStream() {
|
|
106
|
-
const tracker = this;
|
|
107
|
-
this.stream.write = function patched(chunk, encoding, callback) {
|
|
108
|
-
const actualEncoding = typeof encoding === 'function' ? undefined : encoding;
|
|
109
|
-
tracker.recordChunk(chunk, actualEncoding);
|
|
110
|
-
return tracker.originalWrite.call(this, chunk, encoding, callback);
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
recordChunk(chunk, encoding) {
|
|
114
|
-
if (this.suspended) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
const text = this.chunkToString(chunk, encoding);
|
|
118
|
-
if (!text) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
this.countNewlines(text);
|
|
122
|
-
}
|
|
123
|
-
countNewlines(text) {
|
|
124
|
-
for (const char of text) {
|
|
125
|
-
if (char === '\n') {
|
|
126
|
-
this.linesWritten += 1;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
chunkToString(chunk, encoding) {
|
|
131
|
-
if (typeof chunk === 'string') {
|
|
132
|
-
return chunk;
|
|
133
|
-
}
|
|
134
|
-
if (chunk instanceof Uint8Array) {
|
|
135
|
-
const enc = encoding ?? 'utf8';
|
|
136
|
-
return Buffer.from(chunk).toString(enc);
|
|
137
|
-
}
|
|
138
|
-
return null;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
// Display configuration constants
|
|
142
|
-
const DISPLAY_CONSTANTS = {
|
|
143
|
-
MIN_BANNER_WIDTH: 32,
|
|
144
|
-
MAX_BANNER_WIDTH: 120,
|
|
145
|
-
BANNER_PADDING: 4,
|
|
146
|
-
MIN_MESSAGE_WIDTH: 42,
|
|
147
|
-
MAX_MESSAGE_WIDTH: 110,
|
|
148
|
-
MESSAGE_PADDING: 4,
|
|
149
|
-
MIN_ACTION_WIDTH: 40,
|
|
150
|
-
MAX_ACTION_WIDTH: 90,
|
|
151
|
-
MIN_THOUGHT_WIDTH: 48,
|
|
152
|
-
MAX_THOUGHT_WIDTH: 96,
|
|
153
|
-
MIN_CONTENT_WIDTH: 10,
|
|
154
|
-
MIN_WRAP_WIDTH: 12,
|
|
155
|
-
SPINNER_INTERVAL: 80,
|
|
156
|
-
};
|
|
157
|
-
// Enhanced spinner frames with smooth animation
|
|
158
|
-
const SPINNER_FRAMES = ['◐', '◓', '◑', '◒', '⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷'];
|
|
159
|
-
const INDEPENDENT_SECURITY_MANDATE = 'Independent security research CLI for third-party, ethics-reviewed assessments and vulnerability discovery.';
|
|
160
|
-
/**
|
|
161
|
-
* Display class manages all terminal UI output for the application.
|
|
162
|
-
*
|
|
163
|
-
* Architecture:
|
|
164
|
-
* - Per-stream line tracking via StdoutLineTracker for consistent banner updates
|
|
165
|
-
* - Output interceptor pattern for live update integration
|
|
166
|
-
* - Banner state management for in-place updates
|
|
167
|
-
* - Configurable width constraints via DISPLAY_CONSTANTS
|
|
168
|
-
*
|
|
169
|
-
* Claude Code Style Formatting:
|
|
170
|
-
* - ⏺ prefix for tool calls, actions, and thinking/reasoning
|
|
171
|
-
* - ⎿ prefix for results, details, and nested information
|
|
172
|
-
* - ─ horizontal separators for dividing sections (edit diffs, etc.)
|
|
173
|
-
* - > prefix for user prompts (handled in theme.ts formatUserPrompt)
|
|
174
|
-
* - Compact epsilon spinner: ∴, ε, ✻
|
|
175
|
-
*
|
|
176
|
-
* Key responsibilities:
|
|
177
|
-
* - Welcome banners and session information display
|
|
178
|
-
* - Message formatting (assistant, system, errors, warnings)
|
|
179
|
-
* - Spinner/thinking indicators
|
|
180
|
-
* - Action and sub-action formatting with tree-style prefixes
|
|
181
|
-
* - Text wrapping and layout management
|
|
182
|
-
*
|
|
183
|
-
* Error handling:
|
|
184
|
-
* - Graceful degradation for non-TTY environments
|
|
185
|
-
* - Input validation on public methods
|
|
186
|
-
* - Safe cursor manipulation with fallback
|
|
187
|
-
*/
|
|
188
|
-
export class Display {
|
|
189
|
-
stdoutTracker;
|
|
190
|
-
outputStream;
|
|
191
|
-
errorStream;
|
|
192
|
-
activeSpinner = null;
|
|
193
|
-
outputInterceptors = new Set();
|
|
194
|
-
outputLock = OutputLock.getInstance();
|
|
195
|
-
spinnerFrames = [...SPINNER_FRAMES];
|
|
196
|
-
thinkingStartTime = null;
|
|
197
|
-
thinkingElapsedTimer = null;
|
|
198
|
-
thinkingBaseMessage = 'Thinking...';
|
|
199
|
-
// Streaming status line (Claude Code style - single line at bottom)
|
|
200
|
-
streamingStatusVisible = false;
|
|
201
|
-
constructor(stream = process.stdout, errorStream) {
|
|
202
|
-
this.outputStream = stream;
|
|
203
|
-
this.errorStream = errorStream ?? stream;
|
|
204
|
-
this.stdoutTracker = StdoutLineTracker.getInstance(stream);
|
|
205
|
-
}
|
|
206
|
-
registerOutputInterceptor(interceptor) {
|
|
207
|
-
if (!interceptor) {
|
|
208
|
-
return () => { };
|
|
209
|
-
}
|
|
210
|
-
this.outputInterceptors.add(interceptor);
|
|
211
|
-
return () => {
|
|
212
|
-
this.outputInterceptors.delete(interceptor);
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
withOutput(fn) {
|
|
216
|
-
this.notifyBeforeOutput();
|
|
217
|
-
try {
|
|
218
|
-
return fn();
|
|
219
|
-
}
|
|
220
|
-
finally {
|
|
221
|
-
this.notifyAfterOutput();
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
notifyBeforeOutput() {
|
|
225
|
-
for (const interceptor of this.outputInterceptors) {
|
|
226
|
-
interceptor.beforeWrite?.();
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
notifyAfterOutput() {
|
|
230
|
-
const interceptors = Array.from(this.outputInterceptors);
|
|
231
|
-
for (let index = interceptors.length - 1; index >= 0; index -= 1) {
|
|
232
|
-
interceptors[index]?.afterWrite?.();
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
write(value, target = this.outputStream) {
|
|
236
|
-
target.write(value);
|
|
237
|
-
}
|
|
238
|
-
writeLine(value = '', target = this.outputStream) {
|
|
239
|
-
this.write(`${value}\n`, target);
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Write raw content directly to output stream.
|
|
243
|
-
* Goes through interceptors and output lock so overlays refresh safely.
|
|
244
|
-
* Use this for streaming output chunks.
|
|
245
|
-
*/
|
|
246
|
-
writeRaw(content) {
|
|
247
|
-
if (typeof content !== 'string') {
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
this.outputLock.safeWrite(() => {
|
|
251
|
-
this.withOutput(() => {
|
|
252
|
-
this.write(content);
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Stream chunk helper (alias for writeRaw).
|
|
258
|
-
*/
|
|
259
|
-
stream(chunk) {
|
|
260
|
-
this.writeRaw(chunk);
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Backward-compatible alias for stream().
|
|
264
|
-
*/
|
|
265
|
-
writeStreamChunk(chunk) {
|
|
266
|
-
this.stream(chunk);
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Get the output stream for direct access.
|
|
270
|
-
* Prefer writeRaw/writeStreamChunk for interceptor support.
|
|
271
|
-
*/
|
|
272
|
-
getOutputStream() {
|
|
273
|
-
return this.outputStream;
|
|
274
|
-
}
|
|
275
|
-
getColumnWidth() {
|
|
276
|
-
if (typeof this.outputStream.columns === 'number' &&
|
|
277
|
-
Number.isFinite(this.outputStream.columns) &&
|
|
278
|
-
this.outputStream.columns > 0) {
|
|
279
|
-
return this.outputStream.columns;
|
|
280
|
-
}
|
|
281
|
-
return getTerminalColumns();
|
|
282
|
-
}
|
|
283
|
-
bannerState = null;
|
|
284
|
-
/**
|
|
285
|
-
* Displays the welcome banner with session information.
|
|
286
|
-
* Stores banner state for potential in-place updates.
|
|
287
|
-
*/
|
|
288
|
-
showWelcome(profileLabel, profileName, model, provider, workingDir, version) {
|
|
289
|
-
// Validate required inputs
|
|
290
|
-
if (!model?.trim() || !provider?.trim() || !workingDir?.trim()) {
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
const width = this.getBannerWidth();
|
|
294
|
-
const banner = this.buildClaudeStyleBanner(profileLabel ?? '', model, provider, workingDir, width, version);
|
|
295
|
-
if (!banner) {
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
const startLine = this.stdoutTracker.totalLines;
|
|
299
|
-
this.withOutput(() => {
|
|
300
|
-
this.writeLine(banner);
|
|
301
|
-
});
|
|
302
|
-
const nextState = {
|
|
303
|
-
startLine,
|
|
304
|
-
height: this.measureBannerHeight(banner),
|
|
305
|
-
width,
|
|
306
|
-
workingDir,
|
|
307
|
-
model,
|
|
308
|
-
provider,
|
|
309
|
-
profileLabel: profileLabel ?? '',
|
|
310
|
-
profileName: profileName ?? '',
|
|
311
|
-
};
|
|
312
|
-
if (version?.trim()) {
|
|
313
|
-
nextState.version = version.trim();
|
|
314
|
-
}
|
|
315
|
-
this.bannerState = nextState;
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Updates the session information banner with new model/provider.
|
|
319
|
-
* Attempts in-place update if possible, otherwise re-renders.
|
|
320
|
-
*/
|
|
321
|
-
updateSessionInfo(model, provider) {
|
|
322
|
-
const state = this.bannerState;
|
|
323
|
-
if (!state) {
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
// Validate inputs
|
|
327
|
-
if (!model?.trim() || !provider?.trim()) {
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
const lines = this.buildSessionLines(state.profileLabel, state.profileName, model, provider, state.workingDir, state.width);
|
|
331
|
-
const banner = this.buildBanner('Erosolar CLI', state.width, lines, this.buildBannerOptions(state.version));
|
|
332
|
-
const height = this.measureBannerHeight(banner);
|
|
333
|
-
// If height changed or rewrite failed, do full re-render
|
|
334
|
-
if (height !== state.height || !this.tryRewriteBanner(state, banner)) {
|
|
335
|
-
this.renderAndStoreBanner(state, model, provider);
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
// Update succeeded, update state
|
|
339
|
-
state.model = model;
|
|
340
|
-
state.provider = provider;
|
|
341
|
-
}
|
|
342
|
-
showThinking(message = 'Thinking...') {
|
|
343
|
-
// If we already have a spinner, just update its text instead of creating a new one
|
|
344
|
-
if (this.activeSpinner) {
|
|
345
|
-
this.thinkingBaseMessage = message;
|
|
346
|
-
this.activeSpinner.update({ text: message });
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
// Lock output to prevent stream writes from interleaving with spinner frames
|
|
350
|
-
this.outputLock.lock();
|
|
351
|
-
// Track when thinking started for elapsed time display
|
|
352
|
-
this.thinkingStartTime = Date.now();
|
|
353
|
-
this.thinkingBaseMessage = message;
|
|
354
|
-
// Use Claude Code style spinner with epsilon: ∴, ε, and ✻
|
|
355
|
-
this.activeSpinner = createSpinner(message, {
|
|
356
|
-
stream: this.outputStream,
|
|
357
|
-
spinner: {
|
|
358
|
-
interval: DISPLAY_CONSTANTS.SPINNER_INTERVAL,
|
|
359
|
-
frames: this.spinnerFrames,
|
|
360
|
-
},
|
|
361
|
-
}).start();
|
|
362
|
-
// Update spinner with elapsed time every second (Claude Code style)
|
|
363
|
-
this.thinkingElapsedTimer = setInterval(() => {
|
|
364
|
-
if (this.activeSpinner && this.thinkingStartTime) {
|
|
365
|
-
const elapsed = Math.floor((Date.now() - this.thinkingStartTime) / 1000);
|
|
366
|
-
if (elapsed > 0) {
|
|
367
|
-
const elapsedText = this.formatElapsedTime(elapsed);
|
|
368
|
-
this.activeSpinner.update({ text: `${this.thinkingBaseMessage} ${theme.ui.muted(`(${elapsedText})`)}` });
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
}, 1000);
|
|
372
|
-
}
|
|
373
|
-
/**
|
|
374
|
-
* Format elapsed seconds as human-readable time (e.g., "5s", "1m 23s")
|
|
375
|
-
*/
|
|
376
|
-
formatElapsedTime(seconds) {
|
|
377
|
-
if (seconds < 60) {
|
|
378
|
-
return `${seconds}s`;
|
|
379
|
-
}
|
|
380
|
-
const mins = Math.floor(seconds / 60);
|
|
381
|
-
const secs = seconds % 60;
|
|
382
|
-
return secs > 0 ? `${mins}m ${secs}s` : `${mins}m`;
|
|
383
|
-
}
|
|
384
|
-
updateThinking(message) {
|
|
385
|
-
this.thinkingBaseMessage = message;
|
|
386
|
-
if (this.activeSpinner) {
|
|
387
|
-
// If we have elapsed time, include it in the update
|
|
388
|
-
if (this.thinkingStartTime) {
|
|
389
|
-
const elapsed = Math.floor((Date.now() - this.thinkingStartTime) / 1000);
|
|
390
|
-
if (elapsed > 0) {
|
|
391
|
-
const elapsedText = this.formatElapsedTime(elapsed);
|
|
392
|
-
this.activeSpinner.update({ text: `${message} ${theme.ui.muted(`(${elapsedText})`)}` });
|
|
393
|
-
return;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
this.activeSpinner.update({ text: message });
|
|
397
|
-
}
|
|
398
|
-
else {
|
|
399
|
-
this.showThinking(message);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
stopThinking(addNewLine = true) {
|
|
403
|
-
this.clearSpinnerIfActive(addNewLine);
|
|
404
|
-
}
|
|
405
|
-
/**
|
|
406
|
-
* Get current thinking elapsed time in milliseconds, or null if not thinking.
|
|
407
|
-
*/
|
|
408
|
-
getThinkingElapsedMs() {
|
|
409
|
-
if (!this.thinkingStartTime) {
|
|
410
|
-
return null;
|
|
411
|
-
}
|
|
412
|
-
return Date.now() - this.thinkingStartTime;
|
|
413
|
-
}
|
|
414
|
-
isSpinnerActive() {
|
|
415
|
-
return this.activeSpinner !== null;
|
|
416
|
-
}
|
|
417
|
-
/**
|
|
418
|
-
* Check if output is currently locked (e.g., spinner is active).
|
|
419
|
-
* Used by external callers to coordinate output timing.
|
|
420
|
-
*/
|
|
421
|
-
isOutputLocked() {
|
|
422
|
-
return this.outputLock.isLocked();
|
|
423
|
-
}
|
|
424
|
-
/**
|
|
425
|
-
* Execute a write callback safely, ensuring it doesn't interleave with spinner output.
|
|
426
|
-
* If spinner is active, the write will be queued until spinner stops.
|
|
427
|
-
*/
|
|
428
|
-
safeWrite(callback) {
|
|
429
|
-
this.outputLock.safeWrite(callback);
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* Update the streaming status line (Claude Code style).
|
|
433
|
-
* Shows a single muted line at the bottom that updates in-place.
|
|
434
|
-
* Call with null to clear the status line.
|
|
435
|
-
*/
|
|
436
|
-
updateStreamingStatus(status) {
|
|
437
|
-
if (!status) {
|
|
438
|
-
// Clear the status line
|
|
439
|
-
if (this.streamingStatusVisible) {
|
|
440
|
-
// Move to start of line and clear it
|
|
441
|
-
this.outputStream.write('\r\x1b[2K');
|
|
442
|
-
this.streamingStatusVisible = false;
|
|
443
|
-
}
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
446
|
-
// Build the status line (Claude Code style: separator + status)
|
|
447
|
-
const cols = this.getColumnWidth();
|
|
448
|
-
const separatorWidth = Math.min(cols - 2, 72);
|
|
449
|
-
const separator = theme.ui.border('─'.repeat(separatorWidth));
|
|
450
|
-
// Truncate status if needed
|
|
451
|
-
const maxStatusLen = cols - 4;
|
|
452
|
-
const displayStatus = status.length > maxStatusLen
|
|
453
|
-
? `${status.slice(0, maxStatusLen - 3)}...`
|
|
454
|
-
: status;
|
|
455
|
-
// Move to start of line, clear it, write status
|
|
456
|
-
// Use carriage return to overwrite the current line
|
|
457
|
-
if (this.streamingStatusVisible) {
|
|
458
|
-
// Already showing status - move up 2 lines to overwrite
|
|
459
|
-
this.outputStream.write('\x1b[2A\r\x1b[2K');
|
|
460
|
-
this.outputStream.write(`${separator}\n`);
|
|
461
|
-
this.outputStream.write(`\x1b[2K${theme.ui.muted(displayStatus)}\n`);
|
|
462
|
-
}
|
|
463
|
-
else {
|
|
464
|
-
// First time showing - just write on new lines
|
|
465
|
-
this.outputStream.write(`\n${separator}\n`);
|
|
466
|
-
this.outputStream.write(`${theme.ui.muted(displayStatus)}\n`);
|
|
467
|
-
this.streamingStatusVisible = true;
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* Check if streaming status is currently visible.
|
|
472
|
-
*/
|
|
473
|
-
isStreamingStatusVisible() {
|
|
474
|
-
return this.streamingStatusVisible;
|
|
475
|
-
}
|
|
476
|
-
/**
|
|
477
|
-
* Clear streaming status and reset state.
|
|
478
|
-
*/
|
|
479
|
-
clearStreamingStatus() {
|
|
480
|
-
if (this.streamingStatusVisible) {
|
|
481
|
-
// Clear the 2 lines (separator + status)
|
|
482
|
-
this.outputStream.write('\x1b[2A\r\x1b[J');
|
|
483
|
-
this.streamingStatusVisible = false;
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
clearSpinnerIfActive(addNewLine = true) {
|
|
487
|
-
if (!this.activeSpinner) {
|
|
488
|
-
return;
|
|
489
|
-
}
|
|
490
|
-
// Clear the elapsed time update timer
|
|
491
|
-
if (this.thinkingElapsedTimer) {
|
|
492
|
-
clearInterval(this.thinkingElapsedTimer);
|
|
493
|
-
this.thinkingElapsedTimer = null;
|
|
494
|
-
}
|
|
495
|
-
this.thinkingStartTime = null;
|
|
496
|
-
const spinner = this.activeSpinner;
|
|
497
|
-
this.activeSpinner = null;
|
|
498
|
-
// Use stop() instead of clear() so nanospinner removes its SIGINT/SIGTERM listeners.
|
|
499
|
-
// clear() leaves the listeners attached, which triggers MaxListenersExceededWarning over time.
|
|
500
|
-
spinner.stop();
|
|
501
|
-
// Unlock output to process any pending writes
|
|
502
|
-
this.outputLock.unlock();
|
|
503
|
-
if (addNewLine) {
|
|
504
|
-
this.withOutput(() => {
|
|
505
|
-
this.writeLine();
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
showAssistantMessage(content, metadata) {
|
|
510
|
-
if (!content.trim()) {
|
|
511
|
-
return;
|
|
512
|
-
}
|
|
513
|
-
this.clearSpinnerIfActive();
|
|
514
|
-
const isThought = metadata?.isFinal === false;
|
|
515
|
-
const body = isThought ? this.buildClaudeStyleThought(content) : this.buildChatBox(content, metadata);
|
|
516
|
-
if (!body.trim()) {
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
this.withOutput(() => {
|
|
520
|
-
this.writeLine(); // Ensure clean start for the box
|
|
521
|
-
this.writeLine(body);
|
|
522
|
-
this.writeLine();
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
showNarrative(content) {
|
|
526
|
-
if (!content.trim()) {
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
|
-
this.showAssistantMessage(content, { isFinal: false });
|
|
530
|
-
}
|
|
531
|
-
showAction(text, status = 'info') {
|
|
532
|
-
if (!text.trim()) {
|
|
533
|
-
return;
|
|
534
|
-
}
|
|
535
|
-
this.clearSpinnerIfActive();
|
|
536
|
-
// Claude Code style: always use ⏺ prefix for actions
|
|
537
|
-
const icon = this.formatActionIcon(status);
|
|
538
|
-
this.withOutput(() => {
|
|
539
|
-
this.writeLine(this.wrapWithPrefix(text, `${icon} `));
|
|
540
|
-
});
|
|
541
|
-
}
|
|
542
|
-
showSubAction(text, status = 'info') {
|
|
543
|
-
if (!text.trim()) {
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
this.clearSpinnerIfActive();
|
|
547
|
-
const prefersRich = text.includes('```');
|
|
548
|
-
let rendered = prefersRich ? this.buildRichSubActionLines(text, status) : this.buildWrappedSubActionLines(text, status);
|
|
549
|
-
if (!rendered.length && prefersRich) {
|
|
550
|
-
rendered = this.buildWrappedSubActionLines(text, status);
|
|
551
|
-
}
|
|
552
|
-
if (!rendered.length) {
|
|
553
|
-
return;
|
|
554
|
-
}
|
|
555
|
-
this.withOutput(() => {
|
|
556
|
-
this.writeLine(rendered.join('\n'));
|
|
557
|
-
this.writeLine();
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
buildWrappedSubActionLines(text, status) {
|
|
561
|
-
const lines = text.split('\n').map((line) => line.trimEnd());
|
|
562
|
-
while (lines.length && !lines[lines.length - 1]?.trim()) {
|
|
563
|
-
lines.pop();
|
|
564
|
-
}
|
|
565
|
-
if (!lines.length) {
|
|
566
|
-
return [];
|
|
567
|
-
}
|
|
568
|
-
const rendered = [];
|
|
569
|
-
for (let index = 0; index < lines.length; index += 1) {
|
|
570
|
-
const segment = lines[index] ?? '';
|
|
571
|
-
const isLast = index === lines.length - 1;
|
|
572
|
-
const { prefix, continuation } = this.buildSubActionPrefixes(status, isLast);
|
|
573
|
-
rendered.push(this.wrapWithPrefix(segment, prefix, { continuationPrefix: continuation }));
|
|
574
|
-
}
|
|
575
|
-
return rendered;
|
|
576
|
-
}
|
|
577
|
-
buildRichSubActionLines(text, status) {
|
|
578
|
-
const normalized = text.trim();
|
|
579
|
-
if (!normalized) {
|
|
580
|
-
return [];
|
|
581
|
-
}
|
|
582
|
-
const width = Math.max(DISPLAY_CONSTANTS.MIN_ACTION_WIDTH, Math.min(this.getColumnWidth(), DISPLAY_CONSTANTS.MAX_ACTION_WIDTH));
|
|
583
|
-
const samplePrefix = this.buildSubActionPrefixes(status, true).prefix;
|
|
584
|
-
const contentWidth = Math.max(DISPLAY_CONSTANTS.MIN_CONTENT_WIDTH, width - this.visibleLength(samplePrefix));
|
|
585
|
-
const blocks = formatRichContent(normalized, contentWidth);
|
|
586
|
-
if (!blocks.length) {
|
|
587
|
-
return [];
|
|
588
|
-
}
|
|
589
|
-
return blocks.map((line, index) => {
|
|
590
|
-
const isLast = index === blocks.length - 1;
|
|
591
|
-
const { prefix } = this.buildSubActionPrefixes(status, isLast);
|
|
592
|
-
if (!line.trim()) {
|
|
593
|
-
return prefix.trimEnd();
|
|
594
|
-
}
|
|
595
|
-
return `${prefix}${line}`;
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
showMessage(content, role = 'assistant') {
|
|
599
|
-
if (role === 'system') {
|
|
600
|
-
this.showSystemMessage(content);
|
|
601
|
-
}
|
|
602
|
-
else {
|
|
603
|
-
this.showAssistantMessage(content);
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
showSystemMessage(content) {
|
|
607
|
-
this.clearSpinnerIfActive();
|
|
608
|
-
this.withOutput(() => {
|
|
609
|
-
this.writeLine(content.trim());
|
|
610
|
-
this.writeLine();
|
|
611
|
-
});
|
|
612
|
-
}
|
|
613
|
-
showError(message, error) {
|
|
614
|
-
this.clearSpinnerIfActive();
|
|
615
|
-
const callout = renderCallout(message, {
|
|
616
|
-
tone: 'danger',
|
|
617
|
-
icon: icons.error,
|
|
618
|
-
title: 'Error',
|
|
619
|
-
width: this.getBannerWidth(),
|
|
620
|
-
});
|
|
621
|
-
const details = this.formatErrorDetails(error);
|
|
622
|
-
this.withOutput(() => {
|
|
623
|
-
this.writeLine(`\n${callout}`, this.errorStream);
|
|
624
|
-
if (details) {
|
|
625
|
-
this.writeLine(details, this.errorStream);
|
|
626
|
-
}
|
|
627
|
-
this.writeLine('', this.errorStream);
|
|
628
|
-
});
|
|
629
|
-
}
|
|
630
|
-
showWarning(message) {
|
|
631
|
-
this.clearSpinnerIfActive();
|
|
632
|
-
const callout = renderCallout(message, {
|
|
633
|
-
tone: 'warning',
|
|
634
|
-
icon: icons.warning,
|
|
635
|
-
title: 'Warning',
|
|
636
|
-
width: this.getBannerWidth(),
|
|
637
|
-
});
|
|
638
|
-
this.withOutput(() => {
|
|
639
|
-
this.writeLine(`${callout}`, this.errorStream);
|
|
640
|
-
});
|
|
641
|
-
}
|
|
642
|
-
showInfo(message) {
|
|
643
|
-
this.clearSpinnerIfActive();
|
|
644
|
-
const callout = renderCallout(message, {
|
|
645
|
-
tone: 'info',
|
|
646
|
-
icon: icons.info,
|
|
647
|
-
title: 'Info',
|
|
648
|
-
width: this.getBannerWidth(),
|
|
649
|
-
});
|
|
650
|
-
this.withOutput(() => {
|
|
651
|
-
this.writeLine(callout);
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
|
-
/**
|
|
655
|
-
* Show a success message with enhanced styling
|
|
656
|
-
*/
|
|
657
|
-
showSuccess(message) {
|
|
658
|
-
this.clearSpinnerIfActive();
|
|
659
|
-
const box = { tl: '╭', tr: '╮', bl: '╰', br: '╯', h: '─', v: '│' };
|
|
660
|
-
const width = Math.min(this.getColumnWidth() - 4, 60);
|
|
661
|
-
const innerWidth = width - 2;
|
|
662
|
-
const icon = '✓';
|
|
663
|
-
const title = ` ${icon} Success `;
|
|
664
|
-
const headerPad = Math.floor((innerWidth - title.length) / 2);
|
|
665
|
-
this.withOutput(() => {
|
|
666
|
-
this.writeLine(theme.success(`${box.tl}${box.h.repeat(headerPad)}${title}${box.h.repeat(innerWidth - headerPad - title.length)}${box.tr}`));
|
|
667
|
-
const msgLines = this.wrapLine(message, innerWidth - 2);
|
|
668
|
-
for (const line of msgLines) {
|
|
669
|
-
const padding = Math.max(0, innerWidth - line.length - 1);
|
|
670
|
-
this.writeLine(`${theme.success(box.v)} ${line}${' '.repeat(padding)}${theme.success(box.v)}`);
|
|
671
|
-
}
|
|
672
|
-
this.writeLine(theme.success(`${box.bl}${box.h.repeat(innerWidth)}${box.br}`));
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
/**
|
|
676
|
-
* Show a stylish progress indicator for long operations
|
|
677
|
-
*/
|
|
678
|
-
showProgressBadge(label, current, total) {
|
|
679
|
-
const percentage = Math.round((current / total) * 100);
|
|
680
|
-
const barWidth = 20;
|
|
681
|
-
const filled = Math.round((current / total) * barWidth);
|
|
682
|
-
const empty = barWidth - filled;
|
|
683
|
-
const progressBar = `${'█'.repeat(filled)}${'░'.repeat(empty)}`;
|
|
684
|
-
const badge = `[${label}] ${progressBar} ${percentage}%`;
|
|
685
|
-
this.withOutput(() => {
|
|
686
|
-
this.write(`\r${theme.info(badge)}`);
|
|
687
|
-
if (current >= total) {
|
|
688
|
-
this.writeLine();
|
|
689
|
-
}
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
showStatusLine(status, elapsedMs, context) {
|
|
693
|
-
this.clearSpinnerIfActive();
|
|
694
|
-
const normalized = status?.trim();
|
|
695
|
-
if (!normalized) {
|
|
696
|
-
return;
|
|
697
|
-
}
|
|
698
|
-
const parts = [];
|
|
699
|
-
// Show session elapsed time first (Claude Code style: "Session 5m 23s")
|
|
700
|
-
if (context?.sessionElapsedMs && context.sessionElapsedMs > 0) {
|
|
701
|
-
const sessionElapsed = this.formatElapsedTime(Math.floor(context.sessionElapsedMs / 1000));
|
|
702
|
-
parts.push(theme.ui.muted(`Session ${sessionElapsed}`));
|
|
703
|
-
}
|
|
704
|
-
const contextSummary = this.formatContextSummary(context);
|
|
705
|
-
if (contextSummary) {
|
|
706
|
-
parts.push(contextSummary);
|
|
707
|
-
}
|
|
708
|
-
const elapsed = this.formatElapsed(elapsedMs);
|
|
709
|
-
const statusText = elapsed
|
|
710
|
-
? `${theme.success(normalized)} ${theme.ui.muted(`(${elapsed})`)}`
|
|
711
|
-
: theme.success(normalized);
|
|
712
|
-
parts.push(statusText);
|
|
713
|
-
const bulletSep = theme.ui.muted(` ${icons.bullet} `);
|
|
714
|
-
this.withOutput(() => {
|
|
715
|
-
// Claude Code style: show status line then separator
|
|
716
|
-
this.writeLine(parts.join(bulletSep));
|
|
717
|
-
this.writeLine();
|
|
718
|
-
// Add separator line above prompt (Claude Code style)
|
|
719
|
-
const cols = getTerminalColumns();
|
|
720
|
-
const separatorLine = theme.ui.border('─'.repeat(Math.min(cols - 2, 72)));
|
|
721
|
-
this.writeLine(separatorLine);
|
|
722
|
-
});
|
|
723
|
-
}
|
|
724
|
-
showAvailableTools(_tools) {
|
|
725
|
-
// Hidden by default to match Claude Code style
|
|
726
|
-
// Tools are available but not listed verbosely on startup
|
|
727
|
-
// Parameter prefixed with underscore to indicate intentionally unused
|
|
728
|
-
}
|
|
729
|
-
/**
|
|
730
|
-
* Show ready message with keyboard shortcuts hint (compact)
|
|
731
|
-
*/
|
|
732
|
-
showReadyWithHints() {
|
|
733
|
-
const cols = getTerminalColumns();
|
|
734
|
-
const width = Math.min(cols - 4, 55);
|
|
735
|
-
this.withOutput(() => {
|
|
736
|
-
// Simple ready line with hints
|
|
737
|
-
const ready = theme.success('Ready');
|
|
738
|
-
const sep = theme.ui.muted(' • ');
|
|
739
|
-
const hint = theme.ui.muted(`/help${sep}/model`);
|
|
740
|
-
this.writeLine(`${ready}${sep}${hint}`);
|
|
741
|
-
this.writeLine(theme.ui.border('─'.repeat(width)));
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
/**
|
|
745
|
-
* Show available providers and their status on launch (compact inline)
|
|
746
|
-
*/
|
|
747
|
-
showProvidersStatus(providers) {
|
|
748
|
-
const available = providers.filter(p => p.available);
|
|
749
|
-
if (available.length === 0) {
|
|
750
|
-
return;
|
|
751
|
-
}
|
|
752
|
-
this.withOutput(() => {
|
|
753
|
-
// Compact inline format: ● provider (model) | ● provider (model)
|
|
754
|
-
const providerList = available
|
|
755
|
-
.map(p => `${theme.success('●')} ${p.provider} ${theme.ui.muted(`(${this.truncateModel(p.latestModel)})`)}`)
|
|
756
|
-
.join(theme.ui.muted(' │ '));
|
|
757
|
-
this.writeLine(providerList);
|
|
758
|
-
this.writeLine();
|
|
759
|
-
});
|
|
760
|
-
}
|
|
761
|
-
/**
|
|
762
|
-
* Truncate model name for compact display
|
|
763
|
-
*/
|
|
764
|
-
truncateModel(model) {
|
|
765
|
-
if (model.length <= 20)
|
|
766
|
-
return model;
|
|
767
|
-
// Extract the meaningful part of model names
|
|
768
|
-
const parts = model.split('-');
|
|
769
|
-
if (parts.length > 2) {
|
|
770
|
-
return `${parts[0]}-${parts[1]}...`;
|
|
771
|
-
}
|
|
772
|
-
return `${model.slice(0, 17)}...`;
|
|
773
|
-
}
|
|
774
|
-
/**
|
|
775
|
-
* Show unified status bar - Claude Code style
|
|
776
|
-
*
|
|
777
|
-
* Format:
|
|
778
|
-
* ● anthropic (claude-opus...) │ ● openai (gpt-5.1-codex) │ ...
|
|
779
|
-
*
|
|
780
|
-
* Ready • /help • /model
|
|
781
|
-
* ───────────────────────────────────────────────────────
|
|
782
|
-
*
|
|
783
|
-
* Called both at startup and after streaming ends to provide consistent UI.
|
|
784
|
-
*/
|
|
785
|
-
showUnifiedStatusBar(providers) {
|
|
786
|
-
const cols = getTerminalColumns();
|
|
787
|
-
const width = Math.min(cols - 4, 55);
|
|
788
|
-
this.withOutput(() => {
|
|
789
|
-
// Show providers line if available
|
|
790
|
-
if (providers && providers.length > 0) {
|
|
791
|
-
const available = providers.filter(p => p.available);
|
|
792
|
-
if (available.length > 0) {
|
|
793
|
-
const providerList = available
|
|
794
|
-
.map(p => `${theme.success('●')} ${p.provider} ${theme.ui.muted(`(${this.truncateModel(p.latestModel)})`)}`)
|
|
795
|
-
.join(theme.ui.muted(' │ '));
|
|
796
|
-
this.writeLine(providerList);
|
|
797
|
-
this.writeLine();
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
// Ready line with hints
|
|
801
|
-
const ready = theme.success('Ready');
|
|
802
|
-
const sep = theme.ui.muted(' • ');
|
|
803
|
-
const hint = theme.ui.muted(`/help${sep}/model`);
|
|
804
|
-
this.writeLine(`${ready}${sep}${hint}`);
|
|
805
|
-
this.writeLine(theme.ui.border('─'.repeat(width)));
|
|
806
|
-
});
|
|
807
|
-
}
|
|
808
|
-
/**
|
|
809
|
-
* Show streaming header - Claude Code style
|
|
810
|
-
*
|
|
811
|
-
* Displays a unified streaming status bar before AI response starts.
|
|
812
|
-
* This provides visual consistency with the startup Ready bar.
|
|
813
|
-
*
|
|
814
|
-
* Format:
|
|
815
|
-
* ───────────────────────────────────────────────────────
|
|
816
|
-
* ● Responding...
|
|
817
|
-
*/
|
|
818
|
-
showStreamingHeader() {
|
|
819
|
-
const cols = getTerminalColumns();
|
|
820
|
-
const width = Math.min(cols - 4, 55);
|
|
821
|
-
this.withOutput(() => {
|
|
822
|
-
// Separator line (matches Ready bar style)
|
|
823
|
-
this.writeLine(theme.ui.border('─'.repeat(width)));
|
|
824
|
-
// Streaming status line
|
|
825
|
-
const indicator = theme.info('●');
|
|
826
|
-
const status = theme.ui.muted('Responding...');
|
|
827
|
-
this.writeLine(`${indicator} ${status}`);
|
|
828
|
-
});
|
|
829
|
-
}
|
|
830
|
-
/**
|
|
831
|
-
* Show model commands help
|
|
832
|
-
*/
|
|
833
|
-
showModelCommands() {
|
|
834
|
-
this.withOutput(() => {
|
|
835
|
-
this.writeLine(theme.ui.muted(`${icons.info} Model commands:`));
|
|
836
|
-
this.writeLine(theme.ui.muted(' /model <name> - Switch to a specific model'));
|
|
837
|
-
this.writeLine(theme.ui.muted(' /model - Show current model'));
|
|
838
|
-
this.writeLine(theme.ui.muted(' /providers - List all available providers'));
|
|
839
|
-
this.writeLine(theme.ui.muted(' /discover - Discover models from provider APIs'));
|
|
840
|
-
this.writeLine();
|
|
841
|
-
});
|
|
842
|
-
}
|
|
843
|
-
formatErrorDetails(error) {
|
|
844
|
-
if (!error) {
|
|
845
|
-
return null;
|
|
846
|
-
}
|
|
847
|
-
if (error instanceof Error) {
|
|
848
|
-
if (error.stack) {
|
|
849
|
-
return highlightError(error.stack);
|
|
850
|
-
}
|
|
851
|
-
return highlightError(error.message);
|
|
852
|
-
}
|
|
853
|
-
if (typeof error === 'string') {
|
|
854
|
-
return highlightError(error);
|
|
855
|
-
}
|
|
856
|
-
try {
|
|
857
|
-
return highlightError(JSON.stringify(error, null, 2));
|
|
858
|
-
}
|
|
859
|
-
catch {
|
|
860
|
-
return null;
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
showPlanningStep(step, index, total) {
|
|
864
|
-
// Validate inputs
|
|
865
|
-
if (!step?.trim()) {
|
|
866
|
-
return;
|
|
867
|
-
}
|
|
868
|
-
if (index < 1 || total < 1 || index > total) {
|
|
869
|
-
return;
|
|
870
|
-
}
|
|
871
|
-
const width = Math.max(DISPLAY_CONSTANTS.MIN_THOUGHT_WIDTH, Math.min(this.getColumnWidth(), DISPLAY_CONSTANTS.MAX_MESSAGE_WIDTH));
|
|
872
|
-
const heading = renderSectionHeading(`Plan ${index}/${total}`, {
|
|
873
|
-
subtitle: step,
|
|
874
|
-
icon: icons.arrow,
|
|
875
|
-
tone: 'info',
|
|
876
|
-
width,
|
|
877
|
-
});
|
|
878
|
-
this.withOutput(() => {
|
|
879
|
-
this.writeLine(heading);
|
|
880
|
-
});
|
|
881
|
-
}
|
|
882
|
-
clear() {
|
|
883
|
-
this.withOutput(() => {
|
|
884
|
-
try {
|
|
885
|
-
cursorTo(this.outputStream, 0, 0);
|
|
886
|
-
clearScreenDown(this.outputStream);
|
|
887
|
-
}
|
|
888
|
-
catch {
|
|
889
|
-
this.write('\x1Bc');
|
|
890
|
-
}
|
|
891
|
-
});
|
|
892
|
-
this.stdoutTracker.reset();
|
|
893
|
-
if (this.bannerState) {
|
|
894
|
-
this.renderAndStoreBanner(this.bannerState, this.bannerState.model, this.bannerState.provider);
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
newLine() {
|
|
898
|
-
this.withOutput(() => {
|
|
899
|
-
this.writeLine();
|
|
900
|
-
});
|
|
901
|
-
}
|
|
902
|
-
getBannerWidth() {
|
|
903
|
-
const availableColumns = this.getColumnWidth();
|
|
904
|
-
const effectiveWidth = Math.max(DISPLAY_CONSTANTS.MIN_BANNER_WIDTH, availableColumns - DISPLAY_CONSTANTS.BANNER_PADDING);
|
|
905
|
-
return Math.min(Math.max(effectiveWidth, DISPLAY_CONSTANTS.MIN_BANNER_WIDTH), DISPLAY_CONSTANTS.MAX_BANNER_WIDTH);
|
|
906
|
-
}
|
|
907
|
-
buildSessionLines(profileLabel, profileName, model, provider, workingDir, width) {
|
|
908
|
-
const normalizedLabel = profileLabel ? profileLabel.trim() : '';
|
|
909
|
-
const normalizedProfile = profileName ? profileName.trim() : '';
|
|
910
|
-
const agentLabel = normalizedLabel || normalizedProfile || 'Active agent';
|
|
911
|
-
const modelSummary = [this.formatModelLabel(model), provider].join(' • ');
|
|
912
|
-
const lines = [
|
|
913
|
-
...this.formatInfoBlock('Agent', agentLabel, width, this.getInfoFieldStyle('agent')),
|
|
914
|
-
...this.formatInfoBlock('Mandate', INDEPENDENT_SECURITY_MANDATE, width, this.getInfoFieldStyle('agent')),
|
|
915
|
-
];
|
|
916
|
-
if (normalizedProfile) {
|
|
917
|
-
lines.push(...this.formatInfoBlock('Profile', normalizedProfile, width, this.getInfoFieldStyle('profile')));
|
|
918
|
-
}
|
|
919
|
-
lines.push(...this.formatInfoBlock('Model', modelSummary, width, this.getInfoFieldStyle('model')), ...this.formatInfoBlock('Workspace', workingDir, width, this.getInfoFieldStyle('workspace')));
|
|
920
|
-
return lines;
|
|
921
|
-
}
|
|
922
|
-
measureBannerHeight(banner) {
|
|
923
|
-
if (!banner) {
|
|
924
|
-
return 0;
|
|
925
|
-
}
|
|
926
|
-
const lines = banner.split('\n').length;
|
|
927
|
-
return lines;
|
|
928
|
-
}
|
|
929
|
-
/**
|
|
930
|
-
* Attempts to rewrite the banner in place using terminal cursor manipulation.
|
|
931
|
-
* Returns true if successful, false if rewrite is not possible.
|
|
932
|
-
*/
|
|
933
|
-
tryRewriteBanner(state, banner) {
|
|
934
|
-
// Validate TTY availability
|
|
935
|
-
if (!this.outputStream.isTTY) {
|
|
936
|
-
return false;
|
|
937
|
-
}
|
|
938
|
-
// Validate banner state
|
|
939
|
-
if (!banner || state.height <= 0) {
|
|
940
|
-
return false;
|
|
941
|
-
}
|
|
942
|
-
const linesWritten = this.stdoutTracker.totalLines;
|
|
943
|
-
const linesAfterBanner = linesWritten - (state.startLine + state.height);
|
|
944
|
-
// Cannot rewrite if banner position is invalid
|
|
945
|
-
if (linesAfterBanner < 0) {
|
|
946
|
-
return false;
|
|
947
|
-
}
|
|
948
|
-
const totalOffset = linesAfterBanner + state.height;
|
|
949
|
-
const maxRows = this.outputStream.rows;
|
|
950
|
-
// Cannot rewrite if offset exceeds terminal height
|
|
951
|
-
if (typeof maxRows === 'number' && maxRows > 0 && totalOffset > maxRows) {
|
|
952
|
-
return false;
|
|
953
|
-
}
|
|
954
|
-
try {
|
|
955
|
-
this.withOutput(() => {
|
|
956
|
-
// Move cursor up to banner start
|
|
957
|
-
moveCursor(this.outputStream, 0, -totalOffset);
|
|
958
|
-
cursorTo(this.outputStream, 0);
|
|
959
|
-
// Write new banner without tracking
|
|
960
|
-
this.stdoutTracker.withSuspended(() => {
|
|
961
|
-
this.outputStream.write(`${banner}\n`);
|
|
962
|
-
});
|
|
963
|
-
// Restore cursor position
|
|
964
|
-
if (linesAfterBanner > 0) {
|
|
965
|
-
moveCursor(this.outputStream, 0, linesAfterBanner);
|
|
966
|
-
}
|
|
967
|
-
cursorTo(this.outputStream, 0);
|
|
968
|
-
});
|
|
969
|
-
return true;
|
|
970
|
-
}
|
|
971
|
-
catch (error) {
|
|
972
|
-
// Cursor manipulation failed (e.g., terminal doesn't support it)
|
|
973
|
-
if (error instanceof Error) {
|
|
974
|
-
// Could log error in debug mode if needed
|
|
975
|
-
}
|
|
976
|
-
return false;
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
renderAndStoreBanner(state, model, provider) {
|
|
980
|
-
const width = this.getBannerWidth();
|
|
981
|
-
const lines = this.buildSessionLines(state.profileLabel, state.profileName, model, provider, state.workingDir, width);
|
|
982
|
-
const banner = this.buildBanner('Erosolar CLI', width, lines, this.buildBannerOptions(state.version));
|
|
983
|
-
const startLine = this.stdoutTracker.totalLines;
|
|
984
|
-
this.withOutput(() => {
|
|
985
|
-
this.writeLine(banner);
|
|
986
|
-
});
|
|
987
|
-
state.startLine = startLine;
|
|
988
|
-
state.height = this.measureBannerHeight(banner);
|
|
989
|
-
state.width = width;
|
|
990
|
-
state.model = model;
|
|
991
|
-
state.provider = provider;
|
|
992
|
-
}
|
|
993
|
-
formatModelLabel(model) {
|
|
994
|
-
if (/gpt-5\.1-?codex/i.test(model)) {
|
|
995
|
-
return model;
|
|
996
|
-
}
|
|
997
|
-
if (/sonnet-4[-.]?5/i.test(model)) {
|
|
998
|
-
return 'Sonnet 4.5';
|
|
999
|
-
}
|
|
1000
|
-
if (/opus-4[-.]?1/i.test(model)) {
|
|
1001
|
-
return 'Opus 4.1';
|
|
1002
|
-
}
|
|
1003
|
-
if (/haiku-4[-.]?5/i.test(model)) {
|
|
1004
|
-
return 'Haiku 4.5';
|
|
1005
|
-
}
|
|
1006
|
-
if (/gpt-5\.1/i.test(model)) {
|
|
1007
|
-
return 'GPT-5.1';
|
|
1008
|
-
}
|
|
1009
|
-
if (/gpt-5-?pro/i.test(model)) {
|
|
1010
|
-
return 'GPT-5 Pro';
|
|
1011
|
-
}
|
|
1012
|
-
if (/gpt-5-?mini/i.test(model)) {
|
|
1013
|
-
return 'GPT-5 Mini';
|
|
1014
|
-
}
|
|
1015
|
-
if (/gpt-5-?nano/i.test(model)) {
|
|
1016
|
-
return 'GPT-5 Nano';
|
|
1017
|
-
}
|
|
1018
|
-
return model;
|
|
1019
|
-
}
|
|
1020
|
-
buildChatBox(content, metadata) {
|
|
1021
|
-
const normalized = content.trim();
|
|
1022
|
-
if (!normalized) {
|
|
1023
|
-
return '';
|
|
1024
|
-
}
|
|
1025
|
-
if (isPlainOutputMode()) {
|
|
1026
|
-
const body = renderMessageBody(normalized, this.resolveMessageWidth());
|
|
1027
|
-
const telemetry = this.formatTelemetryLine(metadata);
|
|
1028
|
-
return telemetry ? `${body}\n${telemetry}` : body;
|
|
1029
|
-
}
|
|
1030
|
-
const width = this.resolveMessageWidth();
|
|
1031
|
-
const panel = renderMessagePanel(normalized, {
|
|
1032
|
-
width,
|
|
1033
|
-
title: 'Assistant',
|
|
1034
|
-
icon: icons.assistant,
|
|
1035
|
-
accentColor: theme.assistant ?? theme.primary,
|
|
1036
|
-
borderColor: theme.ui.border,
|
|
1037
|
-
});
|
|
1038
|
-
const telemetry = this.formatTelemetryLine(metadata);
|
|
1039
|
-
if (!telemetry) {
|
|
1040
|
-
return panel;
|
|
1041
|
-
}
|
|
1042
|
-
return `${panel}\n${telemetry}`;
|
|
1043
|
-
}
|
|
1044
|
-
resolveMessageWidth() {
|
|
1045
|
-
const columns = this.getColumnWidth();
|
|
1046
|
-
return Math.max(DISPLAY_CONSTANTS.MIN_MESSAGE_WIDTH, Math.min(columns - DISPLAY_CONSTANTS.MESSAGE_PADDING, DISPLAY_CONSTANTS.MAX_MESSAGE_WIDTH));
|
|
1047
|
-
}
|
|
1048
|
-
/**
|
|
1049
|
-
* Legacy method for appending thought blocks with tree-like formatting.
|
|
1050
|
-
* Kept for backwards compatibility but not actively used.
|
|
1051
|
-
* @deprecated Use buildClaudeStyleThought instead
|
|
1052
|
-
*/
|
|
1053
|
-
// @ts-expect-error - Legacy method kept for backwards compatibility
|
|
1054
|
-
_appendThoughtBlock(block, format, output) {
|
|
1055
|
-
const rawLines = block.split('\n');
|
|
1056
|
-
const indices = rawLines
|
|
1057
|
-
.map((line, index) => (line.trim().length ? index : -1))
|
|
1058
|
-
.filter((index) => index >= 0);
|
|
1059
|
-
if (!indices.length) {
|
|
1060
|
-
return;
|
|
1061
|
-
}
|
|
1062
|
-
const lastIndex = indices[indices.length - 1];
|
|
1063
|
-
let usedFirst = false;
|
|
1064
|
-
for (let index = 0; index < rawLines.length; index += 1) {
|
|
1065
|
-
const rawLine = rawLines[index] ?? '';
|
|
1066
|
-
if (!rawLine.trim()) {
|
|
1067
|
-
continue;
|
|
1068
|
-
}
|
|
1069
|
-
const segments = this.wrapThoughtLine(rawLine, format.available);
|
|
1070
|
-
if (!segments.length) {
|
|
1071
|
-
continue;
|
|
1072
|
-
}
|
|
1073
|
-
const isLastLine = index === lastIndex;
|
|
1074
|
-
segments.forEach((segment, segmentIndex) => {
|
|
1075
|
-
const prefix = this.resolveThoughtPrefix({
|
|
1076
|
-
usedFirst,
|
|
1077
|
-
segmentIndex,
|
|
1078
|
-
isLastLine,
|
|
1079
|
-
format,
|
|
1080
|
-
});
|
|
1081
|
-
output.push(`${prefix}${segment}`);
|
|
1082
|
-
});
|
|
1083
|
-
usedFirst = true;
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
resolveThoughtPrefix(options) {
|
|
1087
|
-
if (!options.usedFirst) {
|
|
1088
|
-
return options.segmentIndex === 0 ? options.format.bullet : options.format.spacer;
|
|
1089
|
-
}
|
|
1090
|
-
if (options.segmentIndex === 0) {
|
|
1091
|
-
return options.isLastLine ? options.format.last : options.format.branch;
|
|
1092
|
-
}
|
|
1093
|
-
return options.format.spacer;
|
|
1094
|
-
}
|
|
1095
|
-
/**
|
|
1096
|
-
* Legacy method for generating thought formatting configuration.
|
|
1097
|
-
* Kept for backwards compatibility but not actively used.
|
|
1098
|
-
* @deprecated Use buildClaudeStyleThought instead
|
|
1099
|
-
*/
|
|
1100
|
-
// @ts-expect-error - Legacy method kept for backwards compatibility
|
|
1101
|
-
_getThoughtFormat() {
|
|
1102
|
-
const totalWidth = Math.max(DISPLAY_CONSTANTS.MIN_THOUGHT_WIDTH, Math.min(this.getColumnWidth(), DISPLAY_CONSTANTS.MAX_THOUGHT_WIDTH));
|
|
1103
|
-
const prefixWidth = Math.max(3, this.visibleLength(`${icons.bullet} `));
|
|
1104
|
-
const available = Math.max(DISPLAY_CONSTANTS.MIN_WRAP_WIDTH, totalWidth - prefixWidth);
|
|
1105
|
-
return {
|
|
1106
|
-
totalWidth,
|
|
1107
|
-
prefixWidth,
|
|
1108
|
-
available,
|
|
1109
|
-
bullet: theme.secondary(this.padPrefix(`${icons.bullet} `, prefixWidth)),
|
|
1110
|
-
branch: theme.ui.muted(this.padPrefix('│ ', prefixWidth)),
|
|
1111
|
-
last: theme.ui.muted(this.padPrefix('└ ', prefixWidth)),
|
|
1112
|
-
spacer: ' '.repeat(prefixWidth),
|
|
1113
|
-
};
|
|
1114
|
-
}
|
|
1115
|
-
wrapThoughtLine(line, width) {
|
|
1116
|
-
const preserveIndentation = /^\s/.test(line);
|
|
1117
|
-
const normalized = preserveIndentation ? line.replace(/\s+$/, '') : line.trim();
|
|
1118
|
-
if (!normalized) {
|
|
1119
|
-
return [];
|
|
1120
|
-
}
|
|
1121
|
-
if (preserveIndentation) {
|
|
1122
|
-
return wrapPreformatted(normalized, width);
|
|
1123
|
-
}
|
|
1124
|
-
return this.wrapLine(normalized, width);
|
|
1125
|
-
}
|
|
1126
|
-
formatTelemetryLine(metadata) {
|
|
1127
|
-
if (!metadata) {
|
|
1128
|
-
return '';
|
|
1129
|
-
}
|
|
1130
|
-
const parts = [];
|
|
1131
|
-
const elapsed = this.formatElapsed(metadata.elapsedMs);
|
|
1132
|
-
if (elapsed) {
|
|
1133
|
-
const elapsedLabel = theme.metrics?.elapsedLabel ?? theme.accent;
|
|
1134
|
-
const elapsedValue = theme.metrics?.elapsedValue ?? theme.secondary;
|
|
1135
|
-
parts.push(`${elapsedLabel('elapsed')} ${elapsedValue(elapsed)}`);
|
|
1136
|
-
}
|
|
1137
|
-
if (!parts.length) {
|
|
1138
|
-
return '';
|
|
1139
|
-
}
|
|
1140
|
-
const separator = theme.ui.muted(' • ');
|
|
1141
|
-
return ` ${parts.join(separator)}`;
|
|
1142
|
-
}
|
|
1143
|
-
formatContextSummary(context) {
|
|
1144
|
-
if (!context) {
|
|
1145
|
-
return null;
|
|
1146
|
-
}
|
|
1147
|
-
const hasPercentage = typeof context.percentage === 'number' && Number.isFinite(context.percentage);
|
|
1148
|
-
const hasTokens = typeof context.tokens === 'number' && Number.isFinite(context.tokens);
|
|
1149
|
-
if (!hasPercentage && !hasTokens) {
|
|
1150
|
-
return null;
|
|
1151
|
-
}
|
|
1152
|
-
if (hasPercentage) {
|
|
1153
|
-
const normalizedPercent = Math.max(0, Math.min(100, Math.round(context.percentage)));
|
|
1154
|
-
const tokenDetails = hasTokens ? ` (${context.tokens} tokens)` : '';
|
|
1155
|
-
return `${theme.info('Context')} ${theme.ui.muted(`${normalizedPercent}% used${tokenDetails}`)}`;
|
|
1156
|
-
}
|
|
1157
|
-
return theme.ui.muted(`${context.tokens} tokens`);
|
|
1158
|
-
}
|
|
1159
|
-
formatElapsed(elapsedMs) {
|
|
1160
|
-
if (typeof elapsedMs !== 'number' || !Number.isFinite(elapsedMs) || elapsedMs < 0) {
|
|
1161
|
-
return null;
|
|
1162
|
-
}
|
|
1163
|
-
const totalSeconds = Math.max(0, Math.round(elapsedMs / 1000));
|
|
1164
|
-
const minutes = Math.floor(totalSeconds / 60);
|
|
1165
|
-
const seconds = totalSeconds % 60;
|
|
1166
|
-
if (minutes > 0) {
|
|
1167
|
-
return `${minutes}m ${seconds.toString().padStart(2, '0')}s`;
|
|
1168
|
-
}
|
|
1169
|
-
return `${seconds}s`;
|
|
1170
|
-
}
|
|
1171
|
-
buildClaudeStyleBanner(profileLabel, model, _provider, workingDir, width, version) {
|
|
1172
|
-
const gradientCool = theme.gradient.cool;
|
|
1173
|
-
const dim = theme.ui.muted;
|
|
1174
|
-
const success = theme.success;
|
|
1175
|
-
const info = theme.info;
|
|
1176
|
-
// Compact ASCII art logo (smaller, fits better)
|
|
1177
|
-
const logoLines = [
|
|
1178
|
-
'╔═╗┬─┐┌─┐┌─┐┌─┐┬ ┌─┐┬─┐',
|
|
1179
|
-
'║╣ ├┬┘│ │└─┐│ ││ ├─┤├┬┘',
|
|
1180
|
-
'╚═╝┴└─└─┘└─┘└─┘┴─┘┴ ┴┴└─',
|
|
1181
|
-
];
|
|
1182
|
-
const effectiveWidth = Math.min(Math.max(width, 50), 60);
|
|
1183
|
-
const innerWidth = effectiveWidth - 2;
|
|
1184
|
-
const lines = [];
|
|
1185
|
-
// Top border
|
|
1186
|
-
lines.push(dim(`╭${'─'.repeat(innerWidth)}╮`));
|
|
1187
|
-
// ASCII Logo centered with gradient
|
|
1188
|
-
for (const logoLine of logoLines) {
|
|
1189
|
-
const padding = Math.max(0, innerWidth - logoLine.length);
|
|
1190
|
-
const leftPad = Math.floor(padding / 2);
|
|
1191
|
-
const rightPad = padding - leftPad;
|
|
1192
|
-
const centeredLogo = `${' '.repeat(leftPad)}${logoLine}${' '.repeat(rightPad)}`;
|
|
1193
|
-
lines.push(`${dim('│')}${gradientCool(centeredLogo)}${dim('│')}`);
|
|
1194
|
-
}
|
|
1195
|
-
// Version line
|
|
1196
|
-
const versionText = version ? `v${version}` : '';
|
|
1197
|
-
const versionLine = this.centerText(versionText, innerWidth);
|
|
1198
|
-
lines.push(`${dim('│')}${dim(versionLine)}${dim('│')}`);
|
|
1199
|
-
// Separator
|
|
1200
|
-
lines.push(dim(`├${'─'.repeat(innerWidth)}┤`));
|
|
1201
|
-
// Info section (compact, single line each)
|
|
1202
|
-
const shortPath = this.abbreviatePath(workingDir, innerWidth - 14);
|
|
1203
|
-
const infoLines = [
|
|
1204
|
-
` ${success('●')} ${model}`,
|
|
1205
|
-
` ${info('◆')} ${profileLabel}`,
|
|
1206
|
-
` ${dim('◇')} ${shortPath}`,
|
|
1207
|
-
];
|
|
1208
|
-
for (const infoLine of infoLines) {
|
|
1209
|
-
const padding = Math.max(0, innerWidth - this.visibleLength(infoLine));
|
|
1210
|
-
lines.push(`${dim('│')}${infoLine}${' '.repeat(padding)}${dim('│')}`);
|
|
1211
|
-
}
|
|
1212
|
-
// Bottom border
|
|
1213
|
-
lines.push(dim(`╰${'─'.repeat(innerWidth)}╯`));
|
|
1214
|
-
return lines.join('\n');
|
|
1215
|
-
}
|
|
1216
|
-
/**
|
|
1217
|
-
* Center text within a given width
|
|
1218
|
-
*/
|
|
1219
|
-
centerText(text, width) {
|
|
1220
|
-
const visibleLen = this.visibleLength(text);
|
|
1221
|
-
if (visibleLen >= width)
|
|
1222
|
-
return text;
|
|
1223
|
-
const padding = Math.floor((width - visibleLen) / 2);
|
|
1224
|
-
return `${' '.repeat(padding)}${text}${' '.repeat(width - padding - visibleLen)}`;
|
|
1225
|
-
}
|
|
1226
|
-
abbreviatePath(path, maxLen) {
|
|
1227
|
-
if (path.length <= maxLen)
|
|
1228
|
-
return path;
|
|
1229
|
-
const parts = path.split('/');
|
|
1230
|
-
if (parts.length <= 2)
|
|
1231
|
-
return path;
|
|
1232
|
-
return `${parts[0]}/.../${parts[parts.length - 1]}`;
|
|
1233
|
-
}
|
|
1234
|
-
buildBanner(title, width, lines, options) {
|
|
1235
|
-
if (isPlainOutputMode()) {
|
|
1236
|
-
const badge = options?.badge ? ` (${options.badge})` : '';
|
|
1237
|
-
const header = `${title}${badge}`;
|
|
1238
|
-
return [header, ...lines].join('\n');
|
|
1239
|
-
}
|
|
1240
|
-
const badge = options?.badge ? ` ${options.badge}` : '';
|
|
1241
|
-
const gradient = theme.gradient.cool;
|
|
1242
|
-
const header = gradient(`${title}${badge}`);
|
|
1243
|
-
const body = lines.map((line) => this.buildBannerLine(line, width)).join('\n');
|
|
1244
|
-
return `\n${header}\n${body}\n`;
|
|
1245
|
-
}
|
|
1246
|
-
buildBannerOptions(version) {
|
|
1247
|
-
if (!version?.trim()) {
|
|
1248
|
-
return undefined;
|
|
1249
|
-
}
|
|
1250
|
-
return { badge: `${version.trim()} • support@ero.solar` };
|
|
1251
|
-
}
|
|
1252
|
-
buildBannerLine(text, width) {
|
|
1253
|
-
const padded = this.padLine(text, width);
|
|
1254
|
-
if (isPlainOutputMode()) {
|
|
1255
|
-
return padded;
|
|
1256
|
-
}
|
|
1257
|
-
const tinted = theme.ui.background(theme.ui.text(padded));
|
|
1258
|
-
return tinted;
|
|
1259
|
-
}
|
|
1260
|
-
padLine(text, width) {
|
|
1261
|
-
const visible = this.visibleLength(text);
|
|
1262
|
-
if (visible >= width) {
|
|
1263
|
-
return this.truncateVisible(text, width);
|
|
1264
|
-
}
|
|
1265
|
-
const padding = Math.max(0, width - visible);
|
|
1266
|
-
return `${text}${' '.repeat(padding)}`;
|
|
1267
|
-
}
|
|
1268
|
-
/**
|
|
1269
|
-
* Formats an info block with label and value, wrapping if needed.
|
|
1270
|
-
* First line gets the label prefix, subsequent lines are indented.
|
|
1271
|
-
*/
|
|
1272
|
-
formatInfoBlock(label, value, width, options) {
|
|
1273
|
-
// Validate inputs
|
|
1274
|
-
if (!label?.trim() || !value?.trim()) {
|
|
1275
|
-
return [];
|
|
1276
|
-
}
|
|
1277
|
-
if (width <= 0) {
|
|
1278
|
-
return [value];
|
|
1279
|
-
}
|
|
1280
|
-
const prefix = `${label.toUpperCase()}: `;
|
|
1281
|
-
const prefixLength = prefix.length;
|
|
1282
|
-
const available = Math.max(DISPLAY_CONSTANTS.MIN_CONTENT_WIDTH, width - prefixLength);
|
|
1283
|
-
const wrapped = this.wrapLine(value, available);
|
|
1284
|
-
return wrapped.map((line, index) => {
|
|
1285
|
-
const indent = index === 0 ? prefix : ' '.repeat(prefixLength);
|
|
1286
|
-
const raw = `${indent}${line}`;
|
|
1287
|
-
const padded = this.padLine(raw, width);
|
|
1288
|
-
if (!options) {
|
|
1289
|
-
return padded;
|
|
1290
|
-
}
|
|
1291
|
-
const labelColor = index === 0 ? options.labelColor : undefined;
|
|
1292
|
-
return this.applyInfoLineStyles(padded, prefixLength, line.length, labelColor, options.valueColor);
|
|
1293
|
-
});
|
|
1294
|
-
}
|
|
1295
|
-
applyInfoLineStyles(line, prefixLength, valueLength, labelColor, valueColor) {
|
|
1296
|
-
const prefix = line.slice(0, prefixLength);
|
|
1297
|
-
const remainder = line.slice(prefixLength);
|
|
1298
|
-
const tintedPrefix = labelColor ? labelColor(prefix) : prefix;
|
|
1299
|
-
const safeValueLength = Math.max(0, Math.min(valueLength, remainder.length));
|
|
1300
|
-
if (!valueColor || safeValueLength <= 0) {
|
|
1301
|
-
return `${tintedPrefix}${remainder}`;
|
|
1302
|
-
}
|
|
1303
|
-
const valueSegment = remainder.slice(0, safeValueLength);
|
|
1304
|
-
const trailing = remainder.slice(safeValueLength);
|
|
1305
|
-
const tintedValue = valueColor(valueSegment);
|
|
1306
|
-
return `${tintedPrefix}${tintedValue}${trailing}`;
|
|
1307
|
-
}
|
|
1308
|
-
getInfoFieldStyle(field) {
|
|
1309
|
-
const labelColor = theme.fields?.label ?? ((text) => text);
|
|
1310
|
-
const valueColor = theme.fields?.[field] ?? ((text) => text);
|
|
1311
|
-
return {
|
|
1312
|
-
labelColor,
|
|
1313
|
-
valueColor,
|
|
1314
|
-
};
|
|
1315
|
-
}
|
|
1316
|
-
/**
|
|
1317
|
-
* Wraps text with a prefix on the first line and optional continuation prefix.
|
|
1318
|
-
* Handles multi-line text and word wrapping intelligently.
|
|
1319
|
-
*/
|
|
1320
|
-
wrapWithPrefix(text, prefix, options) {
|
|
1321
|
-
if (!text) {
|
|
1322
|
-
return prefix.trimEnd();
|
|
1323
|
-
}
|
|
1324
|
-
const width = Math.max(DISPLAY_CONSTANTS.MIN_ACTION_WIDTH, Math.min(this.getColumnWidth(), DISPLAY_CONSTANTS.MAX_ACTION_WIDTH));
|
|
1325
|
-
const prefixWidth = this.visibleLength(prefix);
|
|
1326
|
-
const available = Math.max(DISPLAY_CONSTANTS.MIN_CONTENT_WIDTH, width - prefixWidth);
|
|
1327
|
-
const indent = typeof options?.continuationPrefix === 'string'
|
|
1328
|
-
? options.continuationPrefix
|
|
1329
|
-
: ' '.repeat(Math.max(0, prefixWidth));
|
|
1330
|
-
const segments = text.split('\n');
|
|
1331
|
-
const lines = [];
|
|
1332
|
-
let usedPrefix = false;
|
|
1333
|
-
for (const segment of segments) {
|
|
1334
|
-
if (!segment.trim()) {
|
|
1335
|
-
if (usedPrefix) {
|
|
1336
|
-
lines.push(indent);
|
|
1337
|
-
}
|
|
1338
|
-
else {
|
|
1339
|
-
lines.push(prefix.trimEnd());
|
|
1340
|
-
usedPrefix = true;
|
|
1341
|
-
}
|
|
1342
|
-
continue;
|
|
1343
|
-
}
|
|
1344
|
-
const wrapped = this.wrapLine(segment.trim(), available);
|
|
1345
|
-
for (const line of wrapped) {
|
|
1346
|
-
lines.push(!usedPrefix ? `${prefix}${line}` : `${indent}${line}`);
|
|
1347
|
-
usedPrefix = true;
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
return lines.join('\n');
|
|
1351
|
-
}
|
|
1352
|
-
resolveStatusColor(status) {
|
|
1353
|
-
switch (status) {
|
|
1354
|
-
case 'success':
|
|
1355
|
-
return theme.success;
|
|
1356
|
-
case 'error':
|
|
1357
|
-
return theme.error;
|
|
1358
|
-
case 'warning':
|
|
1359
|
-
return theme.warning;
|
|
1360
|
-
case 'pending':
|
|
1361
|
-
return theme.info;
|
|
1362
|
-
default:
|
|
1363
|
-
return theme.secondary;
|
|
1364
|
-
}
|
|
1365
|
-
}
|
|
1366
|
-
formatActionIcon(status) {
|
|
1367
|
-
const colorize = this.resolveStatusColor(status);
|
|
1368
|
-
return colorize(`${icons.action}`);
|
|
1369
|
-
}
|
|
1370
|
-
buildClaudeStyleThought(content) {
|
|
1371
|
-
// Rich thinking block display with box frame
|
|
1372
|
-
const thinkingStyle = theme.thinking || {
|
|
1373
|
-
icon: theme.info,
|
|
1374
|
-
text: theme.ui.muted,
|
|
1375
|
-
border: theme.ui.border,
|
|
1376
|
-
label: theme.info,
|
|
1377
|
-
};
|
|
1378
|
-
const width = Math.min(this.getColumnWidth() - 4, 70);
|
|
1379
|
-
const innerWidth = width - 2;
|
|
1380
|
-
const lines = [];
|
|
1381
|
-
// Header with thinking icon
|
|
1382
|
-
const header = ' 💭 Thinking ';
|
|
1383
|
-
const headerPad = Math.floor((innerWidth - header.length) / 2);
|
|
1384
|
-
lines.push(thinkingStyle.border(`╭${'─'.repeat(headerPad)}${thinkingStyle.label(header)}${'─'.repeat(innerWidth - headerPad - header.length)}╮`));
|
|
1385
|
-
// Parse and format the thinking content
|
|
1386
|
-
const contentLines = content.split('\n').filter(line => line.trim());
|
|
1387
|
-
for (const line of contentLines) {
|
|
1388
|
-
// Wrap each line to fit
|
|
1389
|
-
const wrapped = this.wrapLine(line.trim(), innerWidth - 2);
|
|
1390
|
-
for (const wrappedLine of wrapped) {
|
|
1391
|
-
const padding = Math.max(0, innerWidth - wrappedLine.length - 1);
|
|
1392
|
-
lines.push(`${thinkingStyle.border('│')} ${thinkingStyle.text(wrappedLine)}${' '.repeat(padding)}${thinkingStyle.border('│')}`);
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
// Bottom border
|
|
1396
|
-
lines.push(thinkingStyle.border(`╰${'─'.repeat(innerWidth)}╯`));
|
|
1397
|
-
return lines.join('\n');
|
|
1398
|
-
}
|
|
1399
|
-
/**
|
|
1400
|
-
* Show a thinking block with rich formatting (public method for external use)
|
|
1401
|
-
*/
|
|
1402
|
-
showThinkingBlock(content) {
|
|
1403
|
-
this.clearSpinnerIfActive();
|
|
1404
|
-
const block = this.buildClaudeStyleThought(content);
|
|
1405
|
-
this.withOutput(() => {
|
|
1406
|
-
this.writeLine();
|
|
1407
|
-
this.writeLine(block);
|
|
1408
|
-
this.writeLine();
|
|
1409
|
-
});
|
|
1410
|
-
}
|
|
1411
|
-
// @ts-ignore - Legacy method kept for compatibility
|
|
1412
|
-
// Keep legacy method to avoid breaking changes
|
|
1413
|
-
buildSubActionPrefixes(status, isLast) {
|
|
1414
|
-
if (isLast) {
|
|
1415
|
-
const colorize = this.resolveStatusColor(status);
|
|
1416
|
-
// Claude Code style: use ⎿ for sub-action result/detail prefix
|
|
1417
|
-
return {
|
|
1418
|
-
prefix: ` ${colorize(icons.subaction)} `,
|
|
1419
|
-
continuation: ' ',
|
|
1420
|
-
};
|
|
1421
|
-
}
|
|
1422
|
-
const branch = theme.ui.muted('│');
|
|
1423
|
-
return {
|
|
1424
|
-
prefix: ` ${branch} `,
|
|
1425
|
-
continuation: ` ${branch} `,
|
|
1426
|
-
};
|
|
1427
|
-
}
|
|
1428
|
-
/**
|
|
1429
|
-
* Wraps a single line of text to fit within the specified width.
|
|
1430
|
-
* Intelligently handles word breaking and preserves spaces.
|
|
1431
|
-
*/
|
|
1432
|
-
wrapLine(text, width) {
|
|
1433
|
-
// Handle edge cases
|
|
1434
|
-
if (width <= 0) {
|
|
1435
|
-
return [text];
|
|
1436
|
-
}
|
|
1437
|
-
if (!text) {
|
|
1438
|
-
return [''];
|
|
1439
|
-
}
|
|
1440
|
-
if (text.length <= width) {
|
|
1441
|
-
return [text];
|
|
1442
|
-
}
|
|
1443
|
-
const words = text.split(/\s+/).filter(Boolean);
|
|
1444
|
-
// If no words, chunk the entire text
|
|
1445
|
-
if (!words.length) {
|
|
1446
|
-
return this.chunkWord(text, width);
|
|
1447
|
-
}
|
|
1448
|
-
const lines = [];
|
|
1449
|
-
let current = '';
|
|
1450
|
-
for (const word of words) {
|
|
1451
|
-
const appendResult = this.tryAppendWord(current, word, width);
|
|
1452
|
-
if (appendResult.shouldFlush) {
|
|
1453
|
-
lines.push(current);
|
|
1454
|
-
}
|
|
1455
|
-
if (appendResult.chunks.length > 0) {
|
|
1456
|
-
// Word was too long and was chunked
|
|
1457
|
-
lines.push(...appendResult.chunks.slice(0, -1));
|
|
1458
|
-
current = appendResult.chunks[appendResult.chunks.length - 1] ?? '';
|
|
1459
|
-
}
|
|
1460
|
-
else {
|
|
1461
|
-
current = appendResult.newCurrent;
|
|
1462
|
-
}
|
|
1463
|
-
}
|
|
1464
|
-
if (current) {
|
|
1465
|
-
lines.push(current);
|
|
1466
|
-
}
|
|
1467
|
-
return lines.length ? lines : [''];
|
|
1468
|
-
}
|
|
1469
|
-
/**
|
|
1470
|
-
* Attempts to append a word to the current line.
|
|
1471
|
-
* Returns instructions on how to handle the word.
|
|
1472
|
-
*/
|
|
1473
|
-
tryAppendWord(current, word, width) {
|
|
1474
|
-
if (!word) {
|
|
1475
|
-
return { shouldFlush: false, newCurrent: current, chunks: [] };
|
|
1476
|
-
}
|
|
1477
|
-
// Empty current line - start new line with word
|
|
1478
|
-
if (!current) {
|
|
1479
|
-
if (word.length <= width) {
|
|
1480
|
-
return { shouldFlush: false, newCurrent: word, chunks: [] };
|
|
1481
|
-
}
|
|
1482
|
-
// Word too long, need to chunk it
|
|
1483
|
-
return { shouldFlush: false, newCurrent: '', chunks: this.chunkWord(word, width) };
|
|
1484
|
-
}
|
|
1485
|
-
// Word fits on current line with space
|
|
1486
|
-
if (current.length + 1 + word.length <= width) {
|
|
1487
|
-
return { shouldFlush: false, newCurrent: `${current} ${word}`, chunks: [] };
|
|
1488
|
-
}
|
|
1489
|
-
// Word doesn't fit - flush current and start new line
|
|
1490
|
-
if (word.length <= width) {
|
|
1491
|
-
return { shouldFlush: true, newCurrent: word, chunks: [] };
|
|
1492
|
-
}
|
|
1493
|
-
// Word doesn't fit and is too long - flush current and chunk word
|
|
1494
|
-
return { shouldFlush: true, newCurrent: '', chunks: this.chunkWord(word, width) };
|
|
1495
|
-
}
|
|
1496
|
-
/**
|
|
1497
|
-
* Splits a long word into chunks that fit within the specified width.
|
|
1498
|
-
* Used when a single word is too long to fit on one line.
|
|
1499
|
-
*/
|
|
1500
|
-
chunkWord(word, width) {
|
|
1501
|
-
if (width <= 0 || !word) {
|
|
1502
|
-
return word ? [word] : [''];
|
|
1503
|
-
}
|
|
1504
|
-
const chunks = [];
|
|
1505
|
-
for (let i = 0; i < word.length; i += width) {
|
|
1506
|
-
chunks.push(word.slice(i, i + width));
|
|
1507
|
-
}
|
|
1508
|
-
return chunks.length > 0 ? chunks : [''];
|
|
1509
|
-
}
|
|
1510
|
-
/**
|
|
1511
|
-
* Pads a prefix string to the specified width with spaces.
|
|
1512
|
-
*/
|
|
1513
|
-
padPrefix(value, width) {
|
|
1514
|
-
if (!value || value.length >= width || width <= 0) {
|
|
1515
|
-
return value;
|
|
1516
|
-
}
|
|
1517
|
-
return value.padEnd(width, ' ');
|
|
1518
|
-
}
|
|
1519
|
-
/**
|
|
1520
|
-
* Truncates a string to fit within the specified width,
|
|
1521
|
-
* accounting for ANSI color codes and adding ellipsis.
|
|
1522
|
-
*/
|
|
1523
|
-
truncateVisible(value, width) {
|
|
1524
|
-
if (width <= 0) {
|
|
1525
|
-
return '';
|
|
1526
|
-
}
|
|
1527
|
-
if (!value) {
|
|
1528
|
-
return '';
|
|
1529
|
-
}
|
|
1530
|
-
const plain = this.stripAnsi(value);
|
|
1531
|
-
if (plain.length <= width) {
|
|
1532
|
-
return value;
|
|
1533
|
-
}
|
|
1534
|
-
const slice = plain.slice(0, Math.max(1, width - 1));
|
|
1535
|
-
return `${slice}…`;
|
|
1536
|
-
}
|
|
1537
|
-
/**
|
|
1538
|
-
* Returns the visible length of a string, excluding ANSI escape codes.
|
|
1539
|
-
*/
|
|
1540
|
-
visibleLength(value) {
|
|
1541
|
-
if (!value) {
|
|
1542
|
-
return 0;
|
|
1543
|
-
}
|
|
1544
|
-
return this.stripAnsi(value).length;
|
|
1545
|
-
}
|
|
1546
|
-
/**
|
|
1547
|
-
* Removes ANSI escape codes from a string to get the visible text.
|
|
1548
|
-
* Uses the standard ANSI escape sequence pattern.
|
|
1549
|
-
*/
|
|
1550
|
-
stripAnsi(value) {
|
|
1551
|
-
if (!value) {
|
|
1552
|
-
return '';
|
|
1553
|
-
}
|
|
1554
|
-
return value.replace(/\u001B\[[0-?]*[ -/]*[@-~]/g, '');
|
|
1555
|
-
}
|
|
1556
|
-
}
|
|
1557
|
-
export const display = new Display();
|
|
1558
|
-
//# sourceMappingURL=display.js.map
|