erosolar-cli 1.7.194 → 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/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 -304
- 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 -124
- 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 -44
- package/dist/core/schemaValidator.d.ts.map +0 -1
- package/dist/core/schemaValidator.js +0 -155
- 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/testUtils.d.ts +0 -121
- package/dist/core/testUtils.d.ts.map +0 -1
- package/dist/core/testUtils.js +0 -235
- package/dist/core/testUtils.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 -319
- 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 -375
- package/dist/core/toolRuntime.js.map +0 -1
- package/dist/core/types.d.ts +0 -306
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -76
- 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 -468
- 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 -312
- package/dist/shell/interactiveShell.d.ts.map +0 -1
- package/dist/shell/interactiveShell.js +0 -3271
- 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 -364
- 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 -221
- package/dist/shell/terminalInput.d.ts.map +0 -1
- package/dist/shell/terminalInput.js +0 -1082
- package/dist/shell/terminalInput.js.map +0 -1
- package/dist/shell/terminalInputAdapter.d.ts +0 -117
- package/dist/shell/terminalInputAdapter.d.ts.map +0 -1
- package/dist/shell/terminalInputAdapter.js +0 -217
- 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 -295
- package/dist/ui/display.d.ts.map +0 -1
- package/dist/ui/display.js +0 -1469
- 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
|
@@ -1,1082 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TerminalInput - Clean, unified terminal input handling
|
|
3
|
-
*
|
|
4
|
-
* Design principles:
|
|
5
|
-
* - Single source of truth for input state
|
|
6
|
-
* - Native bracketed paste support (no heuristics)
|
|
7
|
-
* - Clean cursor model with render-time wrapping
|
|
8
|
-
* - State machine for different input modes
|
|
9
|
-
* - No readline dependency for display
|
|
10
|
-
*/
|
|
11
|
-
import { EventEmitter } from 'node:events';
|
|
12
|
-
import { isMultilinePaste } from '../core/multilinePasteHandler.js';
|
|
13
|
-
// ANSI escape codes
|
|
14
|
-
const ESC = {
|
|
15
|
-
// Cursor control
|
|
16
|
-
SAVE: '\x1b7',
|
|
17
|
-
RESTORE: '\x1b8',
|
|
18
|
-
HIDE: '\x1b[?25l',
|
|
19
|
-
SHOW: '\x1b[?25h',
|
|
20
|
-
TO: (row, col) => `\x1b[${row};${col}H`,
|
|
21
|
-
TO_COL: (col) => `\x1b[${col}G`,
|
|
22
|
-
// Line control
|
|
23
|
-
CLEAR_LINE: '\x1b[2K',
|
|
24
|
-
CLEAR_TO_END: '\x1b[0J',
|
|
25
|
-
// Scroll region
|
|
26
|
-
SET_SCROLL: (top, bottom) => `\x1b[${top};${bottom}r`,
|
|
27
|
-
RESET_SCROLL: '\x1b[r',
|
|
28
|
-
// Style
|
|
29
|
-
RESET: '\x1b[0m',
|
|
30
|
-
DIM: '\x1b[2m',
|
|
31
|
-
REVERSE: '\x1b[7m',
|
|
32
|
-
BOLD: '\x1b[1m',
|
|
33
|
-
BG_DARK: '\x1b[48;5;236m', // Dark gray background
|
|
34
|
-
// Bracketed paste mode
|
|
35
|
-
PASTE_ENABLE: '\x1b[?2004h',
|
|
36
|
-
PASTE_DISABLE: '\x1b[?2004l',
|
|
37
|
-
PASTE_START: '\x1b[200~',
|
|
38
|
-
PASTE_END: '\x1b[201~',
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Unified terminal input handler
|
|
42
|
-
*/
|
|
43
|
-
export class TerminalInput extends EventEmitter {
|
|
44
|
-
out;
|
|
45
|
-
config;
|
|
46
|
-
// Core state
|
|
47
|
-
buffer = '';
|
|
48
|
-
cursor = 0;
|
|
49
|
-
mode = 'idle';
|
|
50
|
-
// Paste accumulation
|
|
51
|
-
pasteBuffer = '';
|
|
52
|
-
isPasting = false;
|
|
53
|
-
pastePlaceholders = [];
|
|
54
|
-
pasteCounter = 0;
|
|
55
|
-
// History
|
|
56
|
-
history = [];
|
|
57
|
-
historyIndex = -1;
|
|
58
|
-
tempInput = '';
|
|
59
|
-
maxHistory = 100;
|
|
60
|
-
// Queue for streaming mode
|
|
61
|
-
queue = [];
|
|
62
|
-
queueIdCounter = 0;
|
|
63
|
-
// Display state
|
|
64
|
-
reservedLines = 2;
|
|
65
|
-
scrollRegionActive = false;
|
|
66
|
-
lastRenderContent = '';
|
|
67
|
-
lastRenderCursor = -1;
|
|
68
|
-
isRendering = false;
|
|
69
|
-
// Lifecycle
|
|
70
|
-
disposed = false;
|
|
71
|
-
enabled = true;
|
|
72
|
-
contextUsage = null;
|
|
73
|
-
editMode = 'display-edits';
|
|
74
|
-
// Output interceptor cleanup
|
|
75
|
-
outputInterceptorCleanup;
|
|
76
|
-
constructor(writeStream = process.stdout, config = {}) {
|
|
77
|
-
super();
|
|
78
|
-
this.out = writeStream;
|
|
79
|
-
this.config = {
|
|
80
|
-
maxLines: config.maxLines ?? 1000,
|
|
81
|
-
maxLength: config.maxLength ?? 10000,
|
|
82
|
-
maxQueueSize: config.maxQueueSize ?? 100,
|
|
83
|
-
promptChar: config.promptChar ?? '> ',
|
|
84
|
-
continuationChar: config.continuationChar ?? '│ ',
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
// ===========================================================================
|
|
88
|
-
// PUBLIC API
|
|
89
|
-
// ===========================================================================
|
|
90
|
-
/**
|
|
91
|
-
* Enable bracketed paste mode in terminal
|
|
92
|
-
*/
|
|
93
|
-
enableBracketedPaste() {
|
|
94
|
-
if (this.isTTY()) {
|
|
95
|
-
this.write(ESC.PASTE_ENABLE);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Disable bracketed paste mode
|
|
100
|
-
*/
|
|
101
|
-
disableBracketedPaste() {
|
|
102
|
-
if (this.isTTY()) {
|
|
103
|
-
this.write(ESC.PASTE_DISABLE);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Process raw terminal data (handles bracketed paste sequences)
|
|
108
|
-
* Returns true if the data was consumed (paste sequence)
|
|
109
|
-
*/
|
|
110
|
-
processRawData(data) {
|
|
111
|
-
// Check for paste start
|
|
112
|
-
if (data.includes(ESC.PASTE_START)) {
|
|
113
|
-
this.isPasting = true;
|
|
114
|
-
this.pasteBuffer = '';
|
|
115
|
-
// Extract content after paste start
|
|
116
|
-
const startIdx = data.indexOf(ESC.PASTE_START) + ESC.PASTE_START.length;
|
|
117
|
-
const remaining = data.slice(startIdx);
|
|
118
|
-
// Check if paste end is also in this chunk
|
|
119
|
-
if (remaining.includes(ESC.PASTE_END)) {
|
|
120
|
-
const endIdx = remaining.indexOf(ESC.PASTE_END);
|
|
121
|
-
this.pasteBuffer = remaining.slice(0, endIdx);
|
|
122
|
-
this.finishPaste();
|
|
123
|
-
return { consumed: true, passthrough: remaining.slice(endIdx + ESC.PASTE_END.length) };
|
|
124
|
-
}
|
|
125
|
-
this.pasteBuffer = remaining;
|
|
126
|
-
return { consumed: true, passthrough: '' };
|
|
127
|
-
}
|
|
128
|
-
// Accumulating paste
|
|
129
|
-
if (this.isPasting) {
|
|
130
|
-
if (data.includes(ESC.PASTE_END)) {
|
|
131
|
-
const endIdx = data.indexOf(ESC.PASTE_END);
|
|
132
|
-
this.pasteBuffer += data.slice(0, endIdx);
|
|
133
|
-
this.finishPaste();
|
|
134
|
-
return { consumed: true, passthrough: data.slice(endIdx + ESC.PASTE_END.length) };
|
|
135
|
-
}
|
|
136
|
-
this.pasteBuffer += data;
|
|
137
|
-
return { consumed: true, passthrough: '' };
|
|
138
|
-
}
|
|
139
|
-
return { consumed: false, passthrough: data };
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Handle a keypress event
|
|
143
|
-
*/
|
|
144
|
-
handleKeypress(str, key) {
|
|
145
|
-
if (this.disposed || !this.enabled)
|
|
146
|
-
return;
|
|
147
|
-
// Handle control keys
|
|
148
|
-
if (key?.ctrl) {
|
|
149
|
-
this.handleCtrlKey(key);
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
// Handle meta/alt keys
|
|
153
|
-
if (key?.meta) {
|
|
154
|
-
this.handleMetaKey(key);
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
// Handle special keys
|
|
158
|
-
if (key?.name) {
|
|
159
|
-
const handled = this.handleSpecialKey(str, key);
|
|
160
|
-
if (handled)
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
// Insert printable characters
|
|
164
|
-
if (str && !key?.ctrl && !key?.meta) {
|
|
165
|
-
this.insertText(str);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Set the input mode
|
|
170
|
-
*/
|
|
171
|
-
setMode(mode) {
|
|
172
|
-
const prevMode = this.mode;
|
|
173
|
-
this.mode = mode;
|
|
174
|
-
if (mode === 'streaming' && prevMode !== 'streaming') {
|
|
175
|
-
this.enableScrollRegion();
|
|
176
|
-
}
|
|
177
|
-
else if (mode !== 'streaming' && prevMode === 'streaming') {
|
|
178
|
-
this.disableScrollRegion();
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Get current mode
|
|
183
|
-
*/
|
|
184
|
-
getMode() {
|
|
185
|
-
return this.mode;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Get the current buffer content (may contain placeholders for pasted text)
|
|
189
|
-
*/
|
|
190
|
-
getBuffer() {
|
|
191
|
-
return this.buffer;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Get the actual text with paste placeholders expanded
|
|
195
|
-
*/
|
|
196
|
-
getText() {
|
|
197
|
-
return this.assembleText();
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Set buffer content
|
|
201
|
-
*/
|
|
202
|
-
setBuffer(text, cursorPos) {
|
|
203
|
-
this.pastePlaceholders = [];
|
|
204
|
-
const clean = this.sanitize(text).slice(0, this.config.maxLength);
|
|
205
|
-
this.buffer = clean;
|
|
206
|
-
this.cursor = cursorPos ?? this.buffer.length;
|
|
207
|
-
this.clampCursor();
|
|
208
|
-
this.scheduleRender();
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Clear the buffer
|
|
212
|
-
*/
|
|
213
|
-
clear() {
|
|
214
|
-
this.buffer = '';
|
|
215
|
-
this.cursor = 0;
|
|
216
|
-
this.historyIndex = -1;
|
|
217
|
-
this.tempInput = '';
|
|
218
|
-
this.pastePlaceholders = [];
|
|
219
|
-
this.scheduleRender();
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Get queued inputs
|
|
223
|
-
*/
|
|
224
|
-
getQueue() {
|
|
225
|
-
return [...this.queue];
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Dequeue next input
|
|
229
|
-
*/
|
|
230
|
-
dequeue() {
|
|
231
|
-
const item = this.queue.shift();
|
|
232
|
-
this.scheduleRender();
|
|
233
|
-
return item;
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Clear the queue
|
|
237
|
-
*/
|
|
238
|
-
clearQueue() {
|
|
239
|
-
this.queue = [];
|
|
240
|
-
this.scheduleRender();
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Render the input area
|
|
244
|
-
*/
|
|
245
|
-
render() {
|
|
246
|
-
if (!this.canRender())
|
|
247
|
-
return;
|
|
248
|
-
if (this.isRendering)
|
|
249
|
-
return;
|
|
250
|
-
// Skip if nothing changed
|
|
251
|
-
if (this.buffer === this.lastRenderContent && this.cursor === this.lastRenderCursor) {
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
this.isRendering = true;
|
|
255
|
-
try {
|
|
256
|
-
const { rows, cols } = this.getSize();
|
|
257
|
-
const maxWidth = Math.max(8, cols - 4);
|
|
258
|
-
// Wrap buffer into display lines
|
|
259
|
-
const { lines, cursorLine, cursorCol } = this.wrapBuffer(maxWidth);
|
|
260
|
-
const maxVisible = Math.max(1, Math.min(this.config.maxLines, rows - 1));
|
|
261
|
-
const displayLines = Math.min(lines.length, maxVisible);
|
|
262
|
-
// Update reserved lines if needed
|
|
263
|
-
this.updateReservedLines(displayLines);
|
|
264
|
-
// Calculate display window (keep cursor visible)
|
|
265
|
-
let startLine = 0;
|
|
266
|
-
if (lines.length > displayLines) {
|
|
267
|
-
startLine = Math.max(0, cursorLine - displayLines + 1);
|
|
268
|
-
startLine = Math.min(startLine, lines.length - displayLines);
|
|
269
|
-
}
|
|
270
|
-
const visibleLines = lines.slice(startLine, startLine + displayLines);
|
|
271
|
-
const adjustedCursorLine = cursorLine - startLine;
|
|
272
|
-
// Render
|
|
273
|
-
this.write(ESC.HIDE);
|
|
274
|
-
this.write(ESC.RESET);
|
|
275
|
-
const startRow = rows - this.reservedLines + 1;
|
|
276
|
-
this.write(ESC.TO(startRow, 1));
|
|
277
|
-
this.write(ESC.CLEAR_LINE);
|
|
278
|
-
// Separator line
|
|
279
|
-
const sepWidth = Math.min(cols - 2, 55);
|
|
280
|
-
this.write(ESC.DIM);
|
|
281
|
-
this.write('─'.repeat(sepWidth));
|
|
282
|
-
// Status hints
|
|
283
|
-
const hints = [];
|
|
284
|
-
if (this.contextUsage !== null) {
|
|
285
|
-
const remaining = Math.max(0, 100 - this.contextUsage);
|
|
286
|
-
hints.push(`context ${remaining}% left`);
|
|
287
|
-
}
|
|
288
|
-
hints.push(this.editMode === 'display-edits' ? 'mode: display edits' : 'mode: ask permission');
|
|
289
|
-
if (this.pastePlaceholders.length > 0) {
|
|
290
|
-
const count = this.pastePlaceholders.length;
|
|
291
|
-
hints.push(`${count} paste block${count === 1 ? '' : 's'}`);
|
|
292
|
-
}
|
|
293
|
-
if (lines.length > 1)
|
|
294
|
-
hints.push(`${lines.length} lines`);
|
|
295
|
-
if (this.mode === 'streaming' && this.queue.length > 0) {
|
|
296
|
-
hints.push(`${this.queue.length} queued`);
|
|
297
|
-
}
|
|
298
|
-
if (hints.length > 0) {
|
|
299
|
-
this.write(' ' + hints.join(' • '));
|
|
300
|
-
}
|
|
301
|
-
this.write(ESC.RESET);
|
|
302
|
-
// Render input lines
|
|
303
|
-
let finalRow = startRow + 1;
|
|
304
|
-
let finalCol = 3;
|
|
305
|
-
for (let i = 0; i < visibleLines.length; i++) {
|
|
306
|
-
this.write('\n');
|
|
307
|
-
this.write(ESC.CLEAR_LINE);
|
|
308
|
-
const line = visibleLines[i] ?? '';
|
|
309
|
-
const absoluteLineIdx = startLine + i;
|
|
310
|
-
const isFirstLine = absoluteLineIdx === 0;
|
|
311
|
-
const isCursorLine = i === adjustedCursorLine;
|
|
312
|
-
// Background
|
|
313
|
-
this.write(ESC.BG_DARK);
|
|
314
|
-
// Prompt prefix
|
|
315
|
-
this.write(ESC.DIM);
|
|
316
|
-
this.write(isFirstLine ? this.config.promptChar : this.config.continuationChar);
|
|
317
|
-
this.write(ESC.RESET);
|
|
318
|
-
this.write(ESC.BG_DARK);
|
|
319
|
-
if (isCursorLine) {
|
|
320
|
-
// Render with block cursor
|
|
321
|
-
const col = Math.min(cursorCol, line.length);
|
|
322
|
-
const before = line.slice(0, col);
|
|
323
|
-
const at = col < line.length ? line[col] : ' ';
|
|
324
|
-
const after = col < line.length ? line.slice(col + 1) : '';
|
|
325
|
-
this.write(before);
|
|
326
|
-
this.write(ESC.REVERSE + ESC.BOLD);
|
|
327
|
-
this.write(at);
|
|
328
|
-
this.write(ESC.RESET + ESC.BG_DARK);
|
|
329
|
-
this.write(after);
|
|
330
|
-
finalRow = startRow + 1 + i;
|
|
331
|
-
finalCol = this.config.promptChar.length + col + 1;
|
|
332
|
-
}
|
|
333
|
-
else {
|
|
334
|
-
this.write(line);
|
|
335
|
-
}
|
|
336
|
-
// Pad to edge
|
|
337
|
-
const lineLen = this.config.promptChar.length + line.length + (isCursorLine && cursorCol >= line.length ? 1 : 0);
|
|
338
|
-
const padding = Math.max(0, cols - lineLen - 1);
|
|
339
|
-
if (padding > 0)
|
|
340
|
-
this.write(' '.repeat(padding));
|
|
341
|
-
this.write(ESC.RESET);
|
|
342
|
-
}
|
|
343
|
-
// Position cursor
|
|
344
|
-
this.write(ESC.TO(finalRow, Math.min(finalCol, cols)));
|
|
345
|
-
this.write(ESC.SHOW);
|
|
346
|
-
// Update state
|
|
347
|
-
this.lastRenderContent = this.buffer;
|
|
348
|
-
this.lastRenderCursor = this.cursor;
|
|
349
|
-
}
|
|
350
|
-
finally {
|
|
351
|
-
this.isRendering = false;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* Force a re-render
|
|
356
|
-
*/
|
|
357
|
-
forceRender() {
|
|
358
|
-
this.lastRenderContent = '';
|
|
359
|
-
this.lastRenderCursor = -1;
|
|
360
|
-
this.render();
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Enable/disable input
|
|
364
|
-
*/
|
|
365
|
-
setEnabled(enabled) {
|
|
366
|
-
this.enabled = enabled;
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Handle terminal resize
|
|
370
|
-
*/
|
|
371
|
-
handleResize() {
|
|
372
|
-
this.lastRenderContent = '';
|
|
373
|
-
this.lastRenderCursor = -1;
|
|
374
|
-
if (this.scrollRegionActive) {
|
|
375
|
-
this.disableScrollRegion();
|
|
376
|
-
this.enableScrollRegion();
|
|
377
|
-
}
|
|
378
|
-
this.scheduleRender();
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
* Register with display's output interceptor to position cursor correctly.
|
|
382
|
-
* When scroll region is active, output needs to go to the scroll region,
|
|
383
|
-
* not the protected bottom area where the input is rendered.
|
|
384
|
-
*/
|
|
385
|
-
registerOutputInterceptor(display) {
|
|
386
|
-
if (this.outputInterceptorCleanup) {
|
|
387
|
-
this.outputInterceptorCleanup();
|
|
388
|
-
}
|
|
389
|
-
this.outputInterceptorCleanup = display.registerOutputInterceptor({
|
|
390
|
-
beforeWrite: () => {
|
|
391
|
-
// When scroll region is active, move cursor to scroll area before output
|
|
392
|
-
if (this.scrollRegionActive) {
|
|
393
|
-
const { rows } = this.getSize();
|
|
394
|
-
const scrollBottom = Math.max(1, rows - this.reservedLines);
|
|
395
|
-
this.write(ESC.SAVE);
|
|
396
|
-
this.write(ESC.TO(scrollBottom, 1));
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
afterWrite: () => {
|
|
400
|
-
// Restore cursor position after output
|
|
401
|
-
if (this.scrollRegionActive) {
|
|
402
|
-
this.write(ESC.RESTORE);
|
|
403
|
-
}
|
|
404
|
-
},
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
/**
|
|
408
|
-
* Dispose and clean up
|
|
409
|
-
*/
|
|
410
|
-
dispose() {
|
|
411
|
-
if (this.disposed)
|
|
412
|
-
return;
|
|
413
|
-
// Clean up output interceptor
|
|
414
|
-
if (this.outputInterceptorCleanup) {
|
|
415
|
-
this.outputInterceptorCleanup();
|
|
416
|
-
this.outputInterceptorCleanup = undefined;
|
|
417
|
-
}
|
|
418
|
-
this.disposed = true;
|
|
419
|
-
this.enabled = false;
|
|
420
|
-
this.disableScrollRegion();
|
|
421
|
-
this.disableBracketedPaste();
|
|
422
|
-
this.buffer = '';
|
|
423
|
-
this.queue = [];
|
|
424
|
-
this.removeAllListeners();
|
|
425
|
-
}
|
|
426
|
-
// ===========================================================================
|
|
427
|
-
// INPUT HANDLING
|
|
428
|
-
// ===========================================================================
|
|
429
|
-
handleCtrlKey(key) {
|
|
430
|
-
switch (key.name) {
|
|
431
|
-
case 'c':
|
|
432
|
-
if (this.buffer.length > 0) {
|
|
433
|
-
this.clear();
|
|
434
|
-
}
|
|
435
|
-
else {
|
|
436
|
-
this.emit('interrupt');
|
|
437
|
-
}
|
|
438
|
-
break;
|
|
439
|
-
case 'a': // Home
|
|
440
|
-
this.moveCursorToLineStart();
|
|
441
|
-
break;
|
|
442
|
-
case 'e': // End
|
|
443
|
-
this.moveCursorToLineEnd();
|
|
444
|
-
break;
|
|
445
|
-
case 'u': // Delete to start
|
|
446
|
-
this.deleteToStart();
|
|
447
|
-
break;
|
|
448
|
-
case 'k': // Delete to end
|
|
449
|
-
this.deleteToEnd();
|
|
450
|
-
break;
|
|
451
|
-
case 'w': // Delete word
|
|
452
|
-
this.deleteWord();
|
|
453
|
-
break;
|
|
454
|
-
case 'left': // Word left
|
|
455
|
-
this.moveCursorWordLeft();
|
|
456
|
-
break;
|
|
457
|
-
case 'right': // Word right
|
|
458
|
-
this.moveCursorWordRight();
|
|
459
|
-
break;
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
handleMetaKey(key) {
|
|
463
|
-
switch (key.name) {
|
|
464
|
-
case 'left':
|
|
465
|
-
case 'b':
|
|
466
|
-
this.moveCursorWordLeft();
|
|
467
|
-
break;
|
|
468
|
-
case 'right':
|
|
469
|
-
case 'f':
|
|
470
|
-
this.moveCursorWordRight();
|
|
471
|
-
break;
|
|
472
|
-
case 'backspace':
|
|
473
|
-
this.deleteWord();
|
|
474
|
-
break;
|
|
475
|
-
case 'return':
|
|
476
|
-
this.insertNewline();
|
|
477
|
-
break;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
handleSpecialKey(_str, key) {
|
|
481
|
-
switch (key.name) {
|
|
482
|
-
case 'return':
|
|
483
|
-
if (key.shift || key.meta) {
|
|
484
|
-
this.insertNewline();
|
|
485
|
-
}
|
|
486
|
-
else {
|
|
487
|
-
this.submit();
|
|
488
|
-
}
|
|
489
|
-
return true;
|
|
490
|
-
case 'backspace':
|
|
491
|
-
this.deleteBackward();
|
|
492
|
-
return true;
|
|
493
|
-
case 'delete':
|
|
494
|
-
this.deleteForward();
|
|
495
|
-
return true;
|
|
496
|
-
case 'left':
|
|
497
|
-
this.moveCursorLeft();
|
|
498
|
-
return true;
|
|
499
|
-
case 'right':
|
|
500
|
-
this.moveCursorRight();
|
|
501
|
-
return true;
|
|
502
|
-
case 'up':
|
|
503
|
-
this.handleUp();
|
|
504
|
-
return true;
|
|
505
|
-
case 'down':
|
|
506
|
-
this.handleDown();
|
|
507
|
-
return true;
|
|
508
|
-
case 'home':
|
|
509
|
-
this.moveCursorToLineStart();
|
|
510
|
-
return true;
|
|
511
|
-
case 'end':
|
|
512
|
-
this.moveCursorToLineEnd();
|
|
513
|
-
return true;
|
|
514
|
-
case 'tab':
|
|
515
|
-
if (key.shift) {
|
|
516
|
-
this.toggleEditMode();
|
|
517
|
-
return true;
|
|
518
|
-
}
|
|
519
|
-
this.insertText(' ');
|
|
520
|
-
return true;
|
|
521
|
-
}
|
|
522
|
-
return false;
|
|
523
|
-
}
|
|
524
|
-
insertText(text) {
|
|
525
|
-
const clean = this.sanitize(text);
|
|
526
|
-
if (!clean)
|
|
527
|
-
return;
|
|
528
|
-
const available = this.config.maxLength - this.getComposedLength();
|
|
529
|
-
if (available <= 0)
|
|
530
|
-
return;
|
|
531
|
-
const chunk = clean.slice(0, available);
|
|
532
|
-
const placeholder = this.findPlaceholderAt(this.cursor);
|
|
533
|
-
const insertPos = placeholder && this.cursor > placeholder.start ? placeholder.end : this.cursor;
|
|
534
|
-
this.insertPlainText(chunk, insertPos);
|
|
535
|
-
this.cursor = insertPos + chunk.length;
|
|
536
|
-
this.emit('change', this.buffer);
|
|
537
|
-
this.scheduleRender();
|
|
538
|
-
}
|
|
539
|
-
insertNewline() {
|
|
540
|
-
if (this.getComposedLength() >= this.config.maxLength)
|
|
541
|
-
return;
|
|
542
|
-
const placeholder = this.findPlaceholderAt(this.cursor);
|
|
543
|
-
const insertPos = placeholder && this.cursor > placeholder.start ? placeholder.end : this.cursor;
|
|
544
|
-
this.insertPlainText('\n', insertPos);
|
|
545
|
-
this.cursor = insertPos + 1;
|
|
546
|
-
this.emit('change', this.buffer);
|
|
547
|
-
this.scheduleRender();
|
|
548
|
-
}
|
|
549
|
-
deleteBackward() {
|
|
550
|
-
if (this.cursor === 0)
|
|
551
|
-
return;
|
|
552
|
-
const placeholder = this.findPlaceholderAt(this.cursor - 1);
|
|
553
|
-
if (placeholder) {
|
|
554
|
-
this.deletePlaceholder(placeholder);
|
|
555
|
-
}
|
|
556
|
-
else {
|
|
557
|
-
this.removeRange(this.cursor - 1, this.cursor);
|
|
558
|
-
this.cursor = Math.max(0, this.cursor - 1);
|
|
559
|
-
}
|
|
560
|
-
this.emit('change', this.buffer);
|
|
561
|
-
this.scheduleRender();
|
|
562
|
-
}
|
|
563
|
-
deleteForward() {
|
|
564
|
-
if (this.cursor >= this.buffer.length)
|
|
565
|
-
return;
|
|
566
|
-
const placeholder = this.findPlaceholderAt(this.cursor);
|
|
567
|
-
if (placeholder) {
|
|
568
|
-
this.deletePlaceholder(placeholder);
|
|
569
|
-
}
|
|
570
|
-
else {
|
|
571
|
-
this.removeRange(this.cursor, this.cursor + 1);
|
|
572
|
-
}
|
|
573
|
-
this.emit('change', this.buffer);
|
|
574
|
-
this.scheduleRender();
|
|
575
|
-
}
|
|
576
|
-
deleteToStart() {
|
|
577
|
-
if (this.cursor === 0)
|
|
578
|
-
return;
|
|
579
|
-
this.removeRange(0, this.cursor);
|
|
580
|
-
this.cursor = 0;
|
|
581
|
-
this.emit('change', this.buffer);
|
|
582
|
-
this.scheduleRender();
|
|
583
|
-
}
|
|
584
|
-
deleteToEnd() {
|
|
585
|
-
if (this.cursor >= this.buffer.length)
|
|
586
|
-
return;
|
|
587
|
-
this.removeRange(this.cursor, this.buffer.length);
|
|
588
|
-
this.emit('change', this.buffer);
|
|
589
|
-
this.scheduleRender();
|
|
590
|
-
}
|
|
591
|
-
deleteWord() {
|
|
592
|
-
if (this.cursor === 0)
|
|
593
|
-
return;
|
|
594
|
-
const placeholder = this.findPlaceholderAt(this.cursor - 1);
|
|
595
|
-
if (placeholder) {
|
|
596
|
-
this.deletePlaceholder(placeholder);
|
|
597
|
-
this.emit('change', this.buffer);
|
|
598
|
-
this.scheduleRender();
|
|
599
|
-
return;
|
|
600
|
-
}
|
|
601
|
-
let pos = this.cursor;
|
|
602
|
-
// Skip whitespace
|
|
603
|
-
while (pos > 0 && this.isWhitespace(this.buffer[pos - 1]))
|
|
604
|
-
pos--;
|
|
605
|
-
// Skip word
|
|
606
|
-
while (pos > 0 && !this.isWhitespace(this.buffer[pos - 1]))
|
|
607
|
-
pos--;
|
|
608
|
-
this.buffer = this.buffer.slice(0, pos) + this.buffer.slice(this.cursor);
|
|
609
|
-
this.cursor = pos;
|
|
610
|
-
this.emit('change', this.buffer);
|
|
611
|
-
this.scheduleRender();
|
|
612
|
-
}
|
|
613
|
-
moveCursorLeft() {
|
|
614
|
-
if (this.cursor > 0) {
|
|
615
|
-
this.cursor--;
|
|
616
|
-
this.scheduleRender();
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
moveCursorRight() {
|
|
620
|
-
if (this.cursor < this.buffer.length) {
|
|
621
|
-
this.cursor++;
|
|
622
|
-
this.scheduleRender();
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
moveCursorWordLeft() {
|
|
626
|
-
let pos = this.cursor;
|
|
627
|
-
while (pos > 0 && this.isWhitespace(this.buffer[pos - 1]))
|
|
628
|
-
pos--;
|
|
629
|
-
while (pos > 0 && !this.isWhitespace(this.buffer[pos - 1]))
|
|
630
|
-
pos--;
|
|
631
|
-
this.cursor = pos;
|
|
632
|
-
this.scheduleRender();
|
|
633
|
-
}
|
|
634
|
-
moveCursorWordRight() {
|
|
635
|
-
let pos = this.cursor;
|
|
636
|
-
while (pos < this.buffer.length && !this.isWhitespace(this.buffer[pos]))
|
|
637
|
-
pos++;
|
|
638
|
-
while (pos < this.buffer.length && this.isWhitespace(this.buffer[pos]))
|
|
639
|
-
pos++;
|
|
640
|
-
this.cursor = pos;
|
|
641
|
-
this.scheduleRender();
|
|
642
|
-
}
|
|
643
|
-
moveCursorToLineStart() {
|
|
644
|
-
// Find start of current line
|
|
645
|
-
let pos = this.cursor;
|
|
646
|
-
while (pos > 0 && this.buffer[pos - 1] !== '\n')
|
|
647
|
-
pos--;
|
|
648
|
-
this.cursor = pos;
|
|
649
|
-
this.scheduleRender();
|
|
650
|
-
}
|
|
651
|
-
moveCursorToLineEnd() {
|
|
652
|
-
// Find end of current line
|
|
653
|
-
let pos = this.cursor;
|
|
654
|
-
while (pos < this.buffer.length && this.buffer[pos] !== '\n')
|
|
655
|
-
pos++;
|
|
656
|
-
this.cursor = pos;
|
|
657
|
-
this.scheduleRender();
|
|
658
|
-
}
|
|
659
|
-
handleUp() {
|
|
660
|
-
// Check if we can move up within buffer (multi-line)
|
|
661
|
-
const { cursorLine } = this.getCursorPosition();
|
|
662
|
-
if (cursorLine > 0) {
|
|
663
|
-
this.moveCursorUp();
|
|
664
|
-
return;
|
|
665
|
-
}
|
|
666
|
-
// Otherwise navigate history
|
|
667
|
-
if (this.history.length === 0)
|
|
668
|
-
return;
|
|
669
|
-
if (this.historyIndex === -1) {
|
|
670
|
-
this.tempInput = this.buffer;
|
|
671
|
-
}
|
|
672
|
-
if (this.historyIndex < this.history.length - 1) {
|
|
673
|
-
this.historyIndex++;
|
|
674
|
-
this.buffer = this.history[this.history.length - 1 - this.historyIndex] ?? '';
|
|
675
|
-
this.cursor = this.buffer.length;
|
|
676
|
-
this.scheduleRender();
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
handleDown() {
|
|
680
|
-
// Check if we can move down within buffer
|
|
681
|
-
const { cursorLine, totalLines } = this.getCursorPosition();
|
|
682
|
-
if (cursorLine < totalLines - 1) {
|
|
683
|
-
this.moveCursorDown();
|
|
684
|
-
return;
|
|
685
|
-
}
|
|
686
|
-
// Otherwise navigate history
|
|
687
|
-
if (this.historyIndex > 0) {
|
|
688
|
-
this.historyIndex--;
|
|
689
|
-
this.buffer = this.history[this.history.length - 1 - this.historyIndex] ?? '';
|
|
690
|
-
this.cursor = this.buffer.length;
|
|
691
|
-
this.scheduleRender();
|
|
692
|
-
}
|
|
693
|
-
else if (this.historyIndex === 0) {
|
|
694
|
-
this.historyIndex = -1;
|
|
695
|
-
this.buffer = this.tempInput;
|
|
696
|
-
this.cursor = this.buffer.length;
|
|
697
|
-
this.scheduleRender();
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
moveCursorUp() {
|
|
701
|
-
const lines = this.buffer.split('\n');
|
|
702
|
-
let lineStart = 0;
|
|
703
|
-
let lineIdx = 0;
|
|
704
|
-
// Find current line
|
|
705
|
-
for (let i = 0; i < lines.length; i++) {
|
|
706
|
-
const lineEnd = lineStart + (lines[i]?.length ?? 0);
|
|
707
|
-
if (this.cursor <= lineEnd) {
|
|
708
|
-
lineIdx = i;
|
|
709
|
-
break;
|
|
710
|
-
}
|
|
711
|
-
lineStart = lineEnd + 1; // +1 for newline
|
|
712
|
-
}
|
|
713
|
-
if (lineIdx === 0)
|
|
714
|
-
return;
|
|
715
|
-
// Calculate column in current line
|
|
716
|
-
const colInLine = this.cursor - lineStart;
|
|
717
|
-
// Move to previous line
|
|
718
|
-
const prevLineStart = lineStart - 1 - (lines[lineIdx - 1]?.length ?? 0);
|
|
719
|
-
const prevLineLen = lines[lineIdx - 1]?.length ?? 0;
|
|
720
|
-
this.cursor = prevLineStart + Math.min(colInLine, prevLineLen);
|
|
721
|
-
this.scheduleRender();
|
|
722
|
-
}
|
|
723
|
-
moveCursorDown() {
|
|
724
|
-
const lines = this.buffer.split('\n');
|
|
725
|
-
let lineStart = 0;
|
|
726
|
-
let lineIdx = 0;
|
|
727
|
-
// Find current line
|
|
728
|
-
for (let i = 0; i < lines.length; i++) {
|
|
729
|
-
const lineEnd = lineStart + (lines[i]?.length ?? 0);
|
|
730
|
-
if (this.cursor <= lineEnd) {
|
|
731
|
-
lineIdx = i;
|
|
732
|
-
break;
|
|
733
|
-
}
|
|
734
|
-
lineStart = lineEnd + 1;
|
|
735
|
-
}
|
|
736
|
-
if (lineIdx >= lines.length - 1)
|
|
737
|
-
return;
|
|
738
|
-
const colInLine = this.cursor - lineStart;
|
|
739
|
-
const nextLineStart = lineStart + (lines[lineIdx]?.length ?? 0) + 1;
|
|
740
|
-
const nextLineLen = lines[lineIdx + 1]?.length ?? 0;
|
|
741
|
-
this.cursor = nextLineStart + Math.min(colInLine, nextLineLen);
|
|
742
|
-
this.scheduleRender();
|
|
743
|
-
}
|
|
744
|
-
getCursorPosition() {
|
|
745
|
-
const lines = this.buffer.split('\n');
|
|
746
|
-
let pos = 0;
|
|
747
|
-
for (let i = 0; i < lines.length; i++) {
|
|
748
|
-
const lineLen = lines[i]?.length ?? 0;
|
|
749
|
-
if (this.cursor <= pos + lineLen) {
|
|
750
|
-
return {
|
|
751
|
-
cursorLine: i,
|
|
752
|
-
cursorCol: this.cursor - pos,
|
|
753
|
-
totalLines: lines.length,
|
|
754
|
-
};
|
|
755
|
-
}
|
|
756
|
-
pos += lineLen + 1;
|
|
757
|
-
}
|
|
758
|
-
return {
|
|
759
|
-
cursorLine: lines.length - 1,
|
|
760
|
-
cursorCol: lines[lines.length - 1]?.length ?? 0,
|
|
761
|
-
totalLines: lines.length,
|
|
762
|
-
};
|
|
763
|
-
}
|
|
764
|
-
submit() {
|
|
765
|
-
const text = this.assembleText().trim();
|
|
766
|
-
if (!text)
|
|
767
|
-
return;
|
|
768
|
-
// Add to history
|
|
769
|
-
if (this.history[this.history.length - 1] !== text) {
|
|
770
|
-
this.history.push(text);
|
|
771
|
-
if (this.history.length > this.maxHistory) {
|
|
772
|
-
this.history.shift();
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
this.historyIndex = -1;
|
|
776
|
-
this.tempInput = '';
|
|
777
|
-
// Queue or submit based on mode
|
|
778
|
-
if (this.mode === 'streaming') {
|
|
779
|
-
if (this.queue.length >= this.config.maxQueueSize) {
|
|
780
|
-
return; // Queue full
|
|
781
|
-
}
|
|
782
|
-
this.queue.push({
|
|
783
|
-
id: ++this.queueIdCounter,
|
|
784
|
-
text,
|
|
785
|
-
timestamp: Date.now(),
|
|
786
|
-
});
|
|
787
|
-
this.emit('queue', text);
|
|
788
|
-
this.clear();
|
|
789
|
-
}
|
|
790
|
-
else {
|
|
791
|
-
this.emit('submit', text);
|
|
792
|
-
this.clear();
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
finishPaste() {
|
|
796
|
-
const content = this.pasteBuffer;
|
|
797
|
-
this.pasteBuffer = '';
|
|
798
|
-
this.isPasting = false;
|
|
799
|
-
if (!content)
|
|
800
|
-
return;
|
|
801
|
-
const clean = this.sanitize(content);
|
|
802
|
-
if (!clean)
|
|
803
|
-
return;
|
|
804
|
-
const available = this.config.maxLength - this.getComposedLength();
|
|
805
|
-
if (available <= 0)
|
|
806
|
-
return;
|
|
807
|
-
const chunk = clean.slice(0, available);
|
|
808
|
-
if (isMultilinePaste(chunk)) {
|
|
809
|
-
this.insertPastePlaceholder(chunk);
|
|
810
|
-
}
|
|
811
|
-
else {
|
|
812
|
-
const placeholder = this.findPlaceholderAt(this.cursor);
|
|
813
|
-
const insertPos = placeholder && this.cursor > placeholder.start ? placeholder.end : this.cursor;
|
|
814
|
-
this.insertPlainText(chunk, insertPos);
|
|
815
|
-
this.cursor = insertPos + chunk.length;
|
|
816
|
-
}
|
|
817
|
-
this.emit('change', this.buffer);
|
|
818
|
-
this.scheduleRender();
|
|
819
|
-
}
|
|
820
|
-
// ===========================================================================
|
|
821
|
-
// SCROLL REGION
|
|
822
|
-
// ===========================================================================
|
|
823
|
-
enableScrollRegion() {
|
|
824
|
-
if (this.scrollRegionActive || !this.isTTY())
|
|
825
|
-
return;
|
|
826
|
-
const { rows } = this.getSize();
|
|
827
|
-
const scrollBottom = Math.max(1, rows - this.reservedLines);
|
|
828
|
-
this.write(ESC.SET_SCROLL(1, scrollBottom));
|
|
829
|
-
this.scrollRegionActive = true;
|
|
830
|
-
this.forceRender();
|
|
831
|
-
}
|
|
832
|
-
disableScrollRegion() {
|
|
833
|
-
if (!this.scrollRegionActive)
|
|
834
|
-
return;
|
|
835
|
-
this.write(ESC.RESET_SCROLL);
|
|
836
|
-
this.scrollRegionActive = false;
|
|
837
|
-
}
|
|
838
|
-
updateReservedLines(contentLines) {
|
|
839
|
-
const { rows } = this.getSize();
|
|
840
|
-
const needed = 1 + contentLines; // separator + content
|
|
841
|
-
const maxAllowed = Math.max(1, rows - 1);
|
|
842
|
-
const newReserved = Math.min(Math.max(2, needed), maxAllowed);
|
|
843
|
-
if (newReserved !== this.reservedLines) {
|
|
844
|
-
this.reservedLines = newReserved;
|
|
845
|
-
if (this.scrollRegionActive) {
|
|
846
|
-
const scrollBottom = Math.max(1, rows - this.reservedLines);
|
|
847
|
-
this.write(ESC.SET_SCROLL(1, scrollBottom));
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
// ===========================================================================
|
|
852
|
-
// BUFFER WRAPPING
|
|
853
|
-
// ===========================================================================
|
|
854
|
-
wrapBuffer(maxWidth) {
|
|
855
|
-
const width = Math.max(1, maxWidth);
|
|
856
|
-
const lines = [];
|
|
857
|
-
let cursorLine = 0;
|
|
858
|
-
let cursorCol = 0;
|
|
859
|
-
let charIndex = 0;
|
|
860
|
-
if (this.buffer.length === 0) {
|
|
861
|
-
return { lines: [''], cursorLine: 0, cursorCol: 0 };
|
|
862
|
-
}
|
|
863
|
-
const rawLines = this.buffer.split('\n');
|
|
864
|
-
for (let i = 0; i < rawLines.length; i++) {
|
|
865
|
-
const raw = rawLines[i] ?? '';
|
|
866
|
-
if (raw.length === 0) {
|
|
867
|
-
// Empty line from newline
|
|
868
|
-
if (this.cursor === charIndex) {
|
|
869
|
-
cursorLine = lines.length;
|
|
870
|
-
cursorCol = 0;
|
|
871
|
-
}
|
|
872
|
-
lines.push('');
|
|
873
|
-
}
|
|
874
|
-
else {
|
|
875
|
-
// Wrap long lines
|
|
876
|
-
for (let start = 0; start < raw.length; start += width) {
|
|
877
|
-
const segment = raw.slice(start, start + width);
|
|
878
|
-
const segmentStart = charIndex + start;
|
|
879
|
-
const segmentEnd = segmentStart + segment.length;
|
|
880
|
-
if (this.cursor >= segmentStart && this.cursor <= segmentEnd) {
|
|
881
|
-
cursorLine = lines.length;
|
|
882
|
-
cursorCol = this.cursor - segmentStart;
|
|
883
|
-
}
|
|
884
|
-
lines.push(segment);
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
charIndex += raw.length;
|
|
888
|
-
// Account for newline between raw lines
|
|
889
|
-
if (i < rawLines.length - 1) {
|
|
890
|
-
if (this.cursor === charIndex) {
|
|
891
|
-
cursorLine = lines.length;
|
|
892
|
-
cursorCol = 0;
|
|
893
|
-
}
|
|
894
|
-
charIndex++;
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
// Safety: clamp values
|
|
898
|
-
cursorLine = Math.max(0, Math.min(cursorLine, lines.length - 1));
|
|
899
|
-
cursorCol = Math.max(0, Math.min(cursorCol, lines[cursorLine]?.length ?? 0));
|
|
900
|
-
return { lines, cursorLine, cursorCol };
|
|
901
|
-
}
|
|
902
|
-
// ===========================================================================
|
|
903
|
-
// UTILITIES
|
|
904
|
-
// ===========================================================================
|
|
905
|
-
getComposedLength() {
|
|
906
|
-
if (this.pastePlaceholders.length === 0) {
|
|
907
|
-
return this.buffer.length;
|
|
908
|
-
}
|
|
909
|
-
const sorted = [...this.pastePlaceholders].sort((a, b) => a.start - b.start);
|
|
910
|
-
let composed = 0;
|
|
911
|
-
let cursor = 0;
|
|
912
|
-
for (const placeholder of sorted) {
|
|
913
|
-
composed += Math.max(0, placeholder.start - cursor);
|
|
914
|
-
composed += placeholder.content.length;
|
|
915
|
-
cursor = placeholder.end;
|
|
916
|
-
}
|
|
917
|
-
composed += Math.max(0, this.buffer.length - cursor);
|
|
918
|
-
return composed;
|
|
919
|
-
}
|
|
920
|
-
assembleText() {
|
|
921
|
-
if (this.pastePlaceholders.length === 0) {
|
|
922
|
-
return this.buffer;
|
|
923
|
-
}
|
|
924
|
-
const sorted = [...this.pastePlaceholders].sort((a, b) => a.start - b.start);
|
|
925
|
-
let result = '';
|
|
926
|
-
let cursor = 0;
|
|
927
|
-
for (const placeholder of sorted) {
|
|
928
|
-
result += this.buffer.slice(cursor, placeholder.start);
|
|
929
|
-
result += placeholder.content;
|
|
930
|
-
cursor = placeholder.end;
|
|
931
|
-
}
|
|
932
|
-
result += this.buffer.slice(cursor);
|
|
933
|
-
return result;
|
|
934
|
-
}
|
|
935
|
-
shiftPlaceholders(start, delta, excludeId) {
|
|
936
|
-
if (delta === 0)
|
|
937
|
-
return;
|
|
938
|
-
for (const placeholder of this.pastePlaceholders) {
|
|
939
|
-
if (excludeId && placeholder.id === excludeId)
|
|
940
|
-
continue;
|
|
941
|
-
if (placeholder.start >= start) {
|
|
942
|
-
placeholder.start += delta;
|
|
943
|
-
placeholder.end += delta;
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
removeRange(start, end) {
|
|
948
|
-
// Expand deletion to cover any placeholder that overlaps the range
|
|
949
|
-
let adjustedStart = start;
|
|
950
|
-
let adjustedEnd = end;
|
|
951
|
-
for (const ph of this.pastePlaceholders) {
|
|
952
|
-
if (ph.start < adjustedEnd && ph.end > adjustedStart) {
|
|
953
|
-
adjustedStart = Math.min(adjustedStart, ph.start);
|
|
954
|
-
adjustedEnd = Math.max(adjustedEnd, ph.end);
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
const length = Math.max(0, adjustedEnd - adjustedStart);
|
|
958
|
-
if (length === 0)
|
|
959
|
-
return;
|
|
960
|
-
this.buffer = this.buffer.slice(0, adjustedStart) + this.buffer.slice(adjustedEnd);
|
|
961
|
-
// Remove any placeholders that were within the deleted range
|
|
962
|
-
this.pastePlaceholders = this.pastePlaceholders.filter((ph) => {
|
|
963
|
-
return ph.end <= adjustedStart || ph.start >= adjustedEnd;
|
|
964
|
-
});
|
|
965
|
-
// Shift remaining placeholders that were after the deleted range
|
|
966
|
-
this.shiftPlaceholders(adjustedEnd, -length);
|
|
967
|
-
this.clampCursor();
|
|
968
|
-
}
|
|
969
|
-
insertPlainText(text, position) {
|
|
970
|
-
if (!text)
|
|
971
|
-
return;
|
|
972
|
-
this.shiftPlaceholders(position, text.length);
|
|
973
|
-
this.buffer = this.buffer.slice(0, position) + text + this.buffer.slice(position);
|
|
974
|
-
}
|
|
975
|
-
findPlaceholderAt(position) {
|
|
976
|
-
return this.pastePlaceholders.find((ph) => position >= ph.start && position < ph.end) ?? null;
|
|
977
|
-
}
|
|
978
|
-
buildPlaceholder(lineCount) {
|
|
979
|
-
const id = ++this.pasteCounter;
|
|
980
|
-
const plural = lineCount === 1 ? '' : 's';
|
|
981
|
-
const placeholder = `[Pasted text #${id} +${lineCount} line${plural}]`;
|
|
982
|
-
return { id, placeholder };
|
|
983
|
-
}
|
|
984
|
-
insertPastePlaceholder(content) {
|
|
985
|
-
const available = this.config.maxLength - this.getComposedLength();
|
|
986
|
-
if (available <= 0)
|
|
987
|
-
return;
|
|
988
|
-
const cleanContent = content.slice(0, available);
|
|
989
|
-
const lineCount = cleanContent.split('\n').length;
|
|
990
|
-
const { id, placeholder } = this.buildPlaceholder(lineCount);
|
|
991
|
-
const insertPos = this.cursor;
|
|
992
|
-
this.shiftPlaceholders(insertPos, placeholder.length);
|
|
993
|
-
this.pastePlaceholders.push({
|
|
994
|
-
id,
|
|
995
|
-
content: cleanContent,
|
|
996
|
-
lineCount,
|
|
997
|
-
placeholder,
|
|
998
|
-
start: insertPos,
|
|
999
|
-
end: insertPos + placeholder.length,
|
|
1000
|
-
});
|
|
1001
|
-
this.buffer = this.buffer.slice(0, insertPos) + placeholder + this.buffer.slice(insertPos);
|
|
1002
|
-
this.cursor = insertPos + placeholder.length;
|
|
1003
|
-
}
|
|
1004
|
-
deletePlaceholder(placeholder) {
|
|
1005
|
-
const length = placeholder.end - placeholder.start;
|
|
1006
|
-
this.buffer = this.buffer.slice(0, placeholder.start) + this.buffer.slice(placeholder.end);
|
|
1007
|
-
this.pastePlaceholders = this.pastePlaceholders.filter((ph) => ph.id !== placeholder.id);
|
|
1008
|
-
this.shiftPlaceholders(placeholder.end, -length, placeholder.id);
|
|
1009
|
-
this.cursor = placeholder.start;
|
|
1010
|
-
}
|
|
1011
|
-
updateContextUsage(value) {
|
|
1012
|
-
if (value === null || !Number.isFinite(value)) {
|
|
1013
|
-
this.contextUsage = null;
|
|
1014
|
-
}
|
|
1015
|
-
else {
|
|
1016
|
-
const bounded = Math.max(0, Math.min(100, Math.round(value)));
|
|
1017
|
-
this.contextUsage = bounded;
|
|
1018
|
-
}
|
|
1019
|
-
this.scheduleRender();
|
|
1020
|
-
}
|
|
1021
|
-
getEditMode() {
|
|
1022
|
-
return this.editMode;
|
|
1023
|
-
}
|
|
1024
|
-
applyEditMode(mode) {
|
|
1025
|
-
this.setEditMode(mode);
|
|
1026
|
-
}
|
|
1027
|
-
setEditMode(mode) {
|
|
1028
|
-
if (this.editMode === mode)
|
|
1029
|
-
return;
|
|
1030
|
-
this.editMode = mode;
|
|
1031
|
-
this.emit('mode-change', this.editMode);
|
|
1032
|
-
this.scheduleRender();
|
|
1033
|
-
}
|
|
1034
|
-
toggleEditMode() {
|
|
1035
|
-
const next = this.editMode === 'display-edits' ? 'ask-permission' : 'display-edits';
|
|
1036
|
-
this.setEditMode(next);
|
|
1037
|
-
}
|
|
1038
|
-
scheduleRender() {
|
|
1039
|
-
if (!this.canRender())
|
|
1040
|
-
return;
|
|
1041
|
-
queueMicrotask(() => this.render());
|
|
1042
|
-
}
|
|
1043
|
-
canRender() {
|
|
1044
|
-
return !this.disposed && this.enabled && this.isTTY();
|
|
1045
|
-
}
|
|
1046
|
-
isTTY() {
|
|
1047
|
-
return !!this.out.isTTY && this.out.writable !== false;
|
|
1048
|
-
}
|
|
1049
|
-
getSize() {
|
|
1050
|
-
return {
|
|
1051
|
-
rows: this.out.rows ?? 24,
|
|
1052
|
-
cols: this.out.columns ?? 80,
|
|
1053
|
-
};
|
|
1054
|
-
}
|
|
1055
|
-
write(data) {
|
|
1056
|
-
try {
|
|
1057
|
-
if (this.out.writable) {
|
|
1058
|
-
this.out.write(data);
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
catch {
|
|
1062
|
-
// Ignore write errors
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
sanitize(text) {
|
|
1066
|
-
if (!text)
|
|
1067
|
-
return '';
|
|
1068
|
-
// Remove ANSI codes and control chars (except newlines)
|
|
1069
|
-
return text
|
|
1070
|
-
.replace(/\x1b\][^\x07]*(?:\x07|\x1b\\)/g, '') // OSC sequences
|
|
1071
|
-
.replace(/\x1b\[[0-9;]*[A-Za-z]/g, '') // CSI sequences
|
|
1072
|
-
.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, '') // Control chars except \n and \r
|
|
1073
|
-
.replace(/\r\n?/g, '\n'); // Normalize line endings
|
|
1074
|
-
}
|
|
1075
|
-
isWhitespace(char) {
|
|
1076
|
-
return char === ' ' || char === '\t' || char === '\n';
|
|
1077
|
-
}
|
|
1078
|
-
clampCursor() {
|
|
1079
|
-
this.cursor = Math.max(0, Math.min(this.cursor, this.buffer.length));
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
//# sourceMappingURL=terminalInput.js.map
|