erosolar-cli 1.7.436 → 1.7.439
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 +2 -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/bin/erosolar.d.ts +0 -9
- package/dist/bin/erosolar.d.ts.map +0 -1
- package/dist/bin/erosolar.js +0 -93
- 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 -168
- 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/buildCapability.d.ts +0 -24
- package/dist/capabilities/buildCapability.d.ts.map +0 -1
- package/dist/capabilities/buildCapability.js +0 -25
- package/dist/capabilities/buildCapability.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 -26
- package/dist/capabilities/index.d.ts.map +0 -1
- package/dist/capabilities/index.js +0 -26
- 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 -22
- package/dist/capabilities/learnCapability.d.ts.map +0 -1
- package/dist/capabilities/learnCapability.js +0 -37
- 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/statusCapability.d.ts +0 -4
- package/dist/capabilities/statusCapability.d.ts.map +0 -1
- package/dist/capabilities/statusCapability.js +0 -92
- package/dist/capabilities/statusCapability.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 -24
- package/dist/capabilities/toolRegistry.d.ts.map +0 -1
- package/dist/capabilities/toolRegistry.js +0 -150
- 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 -153
- package/dist/core/agent.d.ts.map +0 -1
- package/dist/core/agent.js +0 -889
- 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/aiErrorFixer.d.ts +0 -70
- package/dist/core/aiErrorFixer.d.ts.map +0 -1
- package/dist/core/aiErrorFixer.js +0 -402
- package/dist/core/aiErrorFixer.js.map +0 -1
- package/dist/core/alphaZeroEngine.d.ts +0 -269
- package/dist/core/alphaZeroEngine.d.ts.map +0 -1
- package/dist/core/alphaZeroEngine.js +0 -523
- package/dist/core/alphaZeroEngine.js.map +0 -1
- package/dist/core/alphaZeroModular.d.ts +0 -186
- package/dist/core/alphaZeroModular.d.ts.map +0 -1
- package/dist/core/alphaZeroModular.js +0 -755
- package/dist/core/alphaZeroModular.js.map +0 -1
- package/dist/core/alphaZeroOrchestrator.d.ts +0 -140
- package/dist/core/alphaZeroOrchestrator.d.ts.map +0 -1
- package/dist/core/alphaZeroOrchestrator.js +0 -418
- package/dist/core/alphaZeroOrchestrator.js.map +0 -1
- package/dist/core/bashCommandGuidance.d.ts +0 -16
- package/dist/core/bashCommandGuidance.d.ts.map +0 -1
- package/dist/core/bashCommandGuidance.js +0 -40
- package/dist/core/bashCommandGuidance.js.map +0 -1
- package/dist/core/checkpoint.d.ts +0 -76
- package/dist/core/checkpoint.d.ts.map +0 -1
- package/dist/core/checkpoint.js +0 -278
- package/dist/core/checkpoint.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 -265
- package/dist/core/contextManager.d.ts.map +0 -1
- package/dist/core/contextManager.js +0 -1060
- 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/costTracker.d.ts +0 -87
- package/dist/core/costTracker.d.ts.map +0 -1
- package/dist/core/costTracker.js +0 -285
- package/dist/core/costTracker.js.map +0 -1
- package/dist/core/customCommands.d.ts +0 -19
- package/dist/core/customCommands.d.ts.map +0 -1
- package/dist/core/customCommands.js +0 -84
- 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/errorUtils.d.ts +0 -87
- package/dist/core/errors/errorUtils.d.ts.map +0 -1
- package/dist/core/errors/errorUtils.js +0 -158
- package/dist/core/errors/errorUtils.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/failureRecovery.d.ts +0 -122
- package/dist/core/failureRecovery.d.ts.map +0 -1
- package/dist/core/failureRecovery.js +0 -477
- package/dist/core/failureRecovery.js.map +0 -1
- package/dist/core/hooks.d.ts +0 -113
- package/dist/core/hooks.d.ts.map +0 -1
- package/dist/core/hooks.js +0 -267
- package/dist/core/hooks.js.map +0 -1
- package/dist/core/intelligentTestFlows.d.ts +0 -126
- package/dist/core/intelligentTestFlows.d.ts.map +0 -1
- package/dist/core/intelligentTestFlows.js +0 -678
- package/dist/core/intelligentTestFlows.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/learningPersistence.d.ts +0 -145
- package/dist/core/learningPersistence.d.ts.map +0 -1
- package/dist/core/learningPersistence.js +0 -477
- package/dist/core/learningPersistence.js.map +0 -1
- package/dist/core/memorySystem.d.ts +0 -67
- package/dist/core/memorySystem.d.ts.map +0 -1
- package/dist/core/memorySystem.js +0 -334
- package/dist/core/memorySystem.js.map +0 -1
- package/dist/core/metricsTracker.d.ts +0 -157
- package/dist/core/metricsTracker.d.ts.map +0 -1
- package/dist/core/metricsTracker.js +0 -273
- package/dist/core/metricsTracker.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/offsecAlphaZero.d.ts +0 -56
- package/dist/core/offsecAlphaZero.d.ts.map +0 -1
- package/dist/core/offsecAlphaZero.js +0 -395
- package/dist/core/offsecAlphaZero.js.map +0 -1
- package/dist/core/outputStyles.d.ts +0 -48
- package/dist/core/outputStyles.d.ts.map +0 -1
- package/dist/core/outputStyles.js +0 -270
- package/dist/core/outputStyles.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 -192
- package/dist/core/performanceMonitor.js.map +0 -1
- package/dist/core/preferences.d.ts +0 -69
- package/dist/core/preferences.d.ts.map +0 -1
- package/dist/core/preferences.js +0 -316
- 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 -48
- package/dist/core/secretStore.d.ts.map +0 -1
- package/dist/core/secretStore.js +0 -367
- package/dist/core/secretStore.js.map +0 -1
- package/dist/core/securityAssessment.d.ts +0 -91
- package/dist/core/securityAssessment.d.ts.map +0 -1
- package/dist/core/securityAssessment.js +0 -580
- package/dist/core/securityAssessment.js.map +0 -1
- package/dist/core/selfEvolution.d.ts +0 -155
- package/dist/core/selfEvolution.d.ts.map +0 -1
- package/dist/core/selfEvolution.js +0 -1000
- package/dist/core/selfEvolution.js.map +0 -1
- package/dist/core/selfImprovement.d.ts +0 -141
- package/dist/core/selfImprovement.d.ts.map +0 -1
- package/dist/core/selfImprovement.js +0 -700
- package/dist/core/selfImprovement.js.map +0 -1
- package/dist/core/sessionStore.d.ts +0 -35
- package/dist/core/sessionStore.d.ts.map +0 -1
- package/dist/core/sessionStore.js +0 -189
- 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 -42
- package/dist/core/toolPreconditions.d.ts.map +0 -1
- package/dist/core/toolPreconditions.js +0 -347
- package/dist/core/toolPreconditions.js.map +0 -1
- package/dist/core/toolRuntime.d.ts +0 -163
- package/dist/core/toolRuntime.d.ts.map +0 -1
- package/dist/core/toolRuntime.js +0 -439
- package/dist/core/toolRuntime.js.map +0 -1
- package/dist/core/toolValidation.d.ts +0 -116
- package/dist/core/toolValidation.d.ts.map +0 -1
- package/dist/core/toolValidation.js +0 -282
- package/dist/core/toolValidation.js.map +0 -1
- package/dist/core/types/utilityTypes.d.ts +0 -192
- package/dist/core/types/utilityTypes.d.ts.map +0 -1
- package/dist/core/types/utilityTypes.js +0 -272
- package/dist/core/types/utilityTypes.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/validationRunner.d.ts +0 -106
- package/dist/core/validationRunner.d.ts.map +0 -1
- package/dist/core/validationRunner.js +0 -888
- package/dist/core/validationRunner.js.map +0 -1
- package/dist/core/verification.d.ts +0 -137
- package/dist/core/verification.d.ts.map +0 -1
- package/dist/core/verification.js +0 -323
- package/dist/core/verification.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 -210
- package/dist/headless/headlessApp.js.map +0 -1
- package/dist/intelligence/codeIntelligence.d.ts +0 -118
- package/dist/intelligence/codeIntelligence.d.ts.map +0 -1
- package/dist/intelligence/codeIntelligence.js +0 -552
- 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 -327
- 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 -65
- 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 -516
- 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 -205
- 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/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/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/interactiveShell.d.ts +0 -518
- package/dist/shell/interactiveShell.d.ts.map +0 -1
- package/dist/shell/interactiveShell.js +0 -6651
- package/dist/shell/interactiveShell.js.map +0 -1
- package/dist/shell/liveStatus.d.ts +0 -30
- package/dist/shell/liveStatus.d.ts.map +0 -1
- package/dist/shell/liveStatus.js +0 -102
- 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 -411
- package/dist/shell/shellApp.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 -64
- 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/terminalInputAdapter.d.ts +0 -262
- package/dist/shell/terminalInputAdapter.d.ts.map +0 -1
- package/dist/shell/terminalInputAdapter.js +0 -346
- package/dist/shell/terminalInputAdapter.js.map +0 -1
- package/dist/shell/vimMode.d.ts +0 -66
- package/dist/shell/vimMode.d.ts.map +0 -1
- package/dist/shell/vimMode.js +0 -434
- package/dist/shell/vimMode.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/agentConfig.d.ts +0 -27
- package/dist/subagents/agentConfig.d.ts.map +0 -1
- package/dist/subagents/agentConfig.js +0 -89
- package/dist/subagents/agentConfig.js.map +0 -1
- package/dist/subagents/agentRegistry.d.ts +0 -33
- package/dist/subagents/agentRegistry.d.ts.map +0 -1
- package/dist/subagents/agentRegistry.js +0 -162
- package/dist/subagents/agentRegistry.js.map +0 -1
- package/dist/subagents/parallelAgentManager.d.ts +0 -99
- package/dist/subagents/parallelAgentManager.d.ts.map +0 -1
- package/dist/subagents/parallelAgentManager.js +0 -248
- package/dist/subagents/parallelAgentManager.js.map +0 -1
- package/dist/subagents/taskRunner.d.ts +0 -34
- package/dist/subagents/taskRunner.d.ts.map +0 -1
- package/dist/subagents/taskRunner.js +0 -459
- 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 -240
- 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/buildTools.d.ts +0 -9
- package/dist/tools/buildTools.d.ts.map +0 -1
- package/dist/tools/buildTools.js +0 -344
- package/dist/tools/buildTools.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 -2125
- 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 -334
- 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 -358
- 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 -164
- package/dist/tools/learnTools.d.ts.map +0 -1
- package/dist/tools/learnTools.js +0 -2104
- package/dist/tools/learnTools.js.map +0 -1
- package/dist/tools/localExplore.d.ts +0 -225
- package/dist/tools/localExplore.d.ts.map +0 -1
- package/dist/tools/localExplore.js +0 -1365
- package/dist/tools/localExplore.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 -21
- package/dist/tools/planningTools.d.ts.map +0 -1
- package/dist/tools/planningTools.js +0 -185
- 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 -241
- 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 -344
- 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 -502
- package/dist/tools/webTools.js.map +0 -1
- package/dist/ui/DisplayEventQueue.d.ts +0 -99
- package/dist/ui/DisplayEventQueue.d.ts.map +0 -1
- package/dist/ui/DisplayEventQueue.js +0 -167
- package/dist/ui/DisplayEventQueue.js.map +0 -1
- package/dist/ui/PromptController.d.ts +0 -102
- package/dist/ui/PromptController.d.ts.map +0 -1
- package/dist/ui/PromptController.js +0 -168
- package/dist/ui/PromptController.js.map +0 -1
- package/dist/ui/SequentialRenderer.d.ts +0 -69
- package/dist/ui/SequentialRenderer.d.ts.map +0 -1
- package/dist/ui/SequentialRenderer.js +0 -137
- package/dist/ui/SequentialRenderer.js.map +0 -1
- package/dist/ui/ShellUIAdapter.d.ts +0 -207
- package/dist/ui/ShellUIAdapter.d.ts.map +0 -1
- package/dist/ui/ShellUIAdapter.js +0 -1163
- package/dist/ui/ShellUIAdapter.js.map +0 -1
- package/dist/ui/UnifiedUIController.d.ts +0 -82
- package/dist/ui/UnifiedUIController.d.ts.map +0 -1
- package/dist/ui/UnifiedUIController.js +0 -207
- package/dist/ui/UnifiedUIController.js.map +0 -1
- package/dist/ui/UnifiedUIRenderer.d.ts +0 -188
- package/dist/ui/UnifiedUIRenderer.d.ts.map +0 -1
- package/dist/ui/UnifiedUIRenderer.js +0 -579
- package/dist/ui/UnifiedUIRenderer.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/compactRenderer.d.ts +0 -139
- package/dist/ui/compactRenderer.d.ts.map +0 -1
- package/dist/ui/compactRenderer.js +0 -398
- package/dist/ui/compactRenderer.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/display.d.ts +0 -229
- package/dist/ui/display.d.ts.map +0 -1
- package/dist/ui/display.js +0 -756
- 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/globalWriteLock.d.ts +0 -38
- package/dist/ui/globalWriteLock.d.ts.map +0 -1
- package/dist/ui/globalWriteLock.js +0 -54
- package/dist/ui/globalWriteLock.js.map +0 -1
- package/dist/ui/inPlaceUpdater.d.ts +0 -181
- package/dist/ui/inPlaceUpdater.d.ts.map +0 -1
- package/dist/ui/inPlaceUpdater.js +0 -515
- package/dist/ui/inPlaceUpdater.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/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/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/orchestration/UIUpdateCoordinator.d.ts +0 -77
- package/dist/ui/orchestration/UIUpdateCoordinator.d.ts.map +0 -1
- package/dist/ui/orchestration/UIUpdateCoordinator.js +0 -265
- package/dist/ui/orchestration/UIUpdateCoordinator.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/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 -39
- package/dist/ui/shortcutsHelp.d.ts.map +0 -1
- package/dist/ui/shortcutsHelp.js +0 -152
- package/dist/ui/shortcutsHelp.js.map +0 -1
- package/dist/ui/streamingFormatter.d.ts +0 -19
- package/dist/ui/streamingFormatter.d.ts.map +0 -1
- package/dist/ui/streamingFormatter.js +0 -65
- package/dist/ui/streamingFormatter.js.map +0 -1
- package/dist/ui/telemetry/ResponseTracker.d.ts +0 -22
- package/dist/ui/telemetry/ResponseTracker.d.ts.map +0 -1
- package/dist/ui/telemetry/ResponseTracker.js +0 -60
- package/dist/ui/telemetry/ResponseTracker.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 -208
- package/dist/ui/theme.d.ts.map +0 -1
- package/dist/ui/theme.js +0 -249
- package/dist/ui/theme.js.map +0 -1
- package/dist/ui/toolDisplay.d.ts +0 -195
- package/dist/ui/toolDisplay.d.ts.map +0 -1
- package/dist/ui/toolDisplay.js +0 -1526
- package/dist/ui/toolDisplay.js.map +0 -1
- package/dist/ui/unified/index.d.ts +0 -50
- package/dist/ui/unified/index.d.ts.map +0 -1
- package/dist/ui/unified/index.js +0 -77
- package/dist/ui/unified/index.js.map +0 -1
- package/dist/ui/unified/layout.d.ts +0 -12
- package/dist/ui/unified/layout.d.ts.map +0 -1
- package/dist/ui/unified/layout.js +0 -96
- package/dist/ui/unified/layout.js.map +0 -1
- package/dist/ui/writeLock.d.ts +0 -65
- package/dist/ui/writeLock.d.ts.map +0 -1
- package/dist/ui/writeLock.js +0 -114
- package/dist/ui/writeLock.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/utils/frontmatter.d.ts +0 -10
- package/dist/utils/frontmatter.d.ts.map +0 -1
- package/dist/utils/frontmatter.js +0 -78
- package/dist/utils/frontmatter.js.map +0 -1
- package/dist/utils/planFormatter.d.ts +0 -34
- package/dist/utils/planFormatter.d.ts.map +0 -1
- package/dist/utils/planFormatter.js +0 -140
- package/dist/utils/planFormatter.js.map +0 -1
- package/dist/workspace.d.ts +0 -8
- package/dist/workspace.d.ts.map +0 -1
- package/dist/workspace.js +0 -107
- package/dist/workspace.js.map +0 -1
- package/dist/workspace.validator.d.ts +0 -49
- package/dist/workspace.validator.d.ts.map +0 -1
- package/dist/workspace.validator.js +0 -214
- package/dist/workspace.validator.js.map +0 -1
package/dist/core/agent.js
DELETED
|
@@ -1,889 +0,0 @@
|
|
|
1
|
-
import { isMultilinePaste, processPaste } from './multilinePasteHandler.js';
|
|
2
|
-
import { safeErrorMessage } from './secretStore.js';
|
|
3
|
-
/**
|
|
4
|
-
* Maximum number of context overflow recovery attempts
|
|
5
|
-
*/
|
|
6
|
-
const MAX_CONTEXT_RECOVERY_ATTEMPTS = 3;
|
|
7
|
-
/**
|
|
8
|
-
* Maximum number of auto-continuation attempts when model expresses intent but doesn't act
|
|
9
|
-
*/
|
|
10
|
-
const MAX_AUTO_CONTINUE_ATTEMPTS = 3;
|
|
11
|
-
/**
|
|
12
|
-
* Streaming safety timeouts (ms)
|
|
13
|
-
* - First chunk timeout: fail fast if the stream never starts
|
|
14
|
-
* - Inactivity timeout: abort if no chunks arrive for an extended period
|
|
15
|
-
*/
|
|
16
|
-
// Allow more headroom before declaring a streaming stall to avoid premature fallbacks.
|
|
17
|
-
const STREAM_FIRST_CHUNK_TIMEOUT_MS = 25000;
|
|
18
|
-
const STREAM_INACTIVITY_TIMEOUT_MS = 60000;
|
|
19
|
-
/**
|
|
20
|
-
* Patterns that indicate the model intends to take action but hasn't yet
|
|
21
|
-
* These suggest the model should be prompted to continue
|
|
22
|
-
*/
|
|
23
|
-
const INTENT_WITHOUT_ACTION_PATTERNS = [
|
|
24
|
-
// "Let me X" patterns - model is stating what it will do
|
|
25
|
-
/\blet me\s+(create|write|implement|add|update|edit|modify|fix|build|make|refactor|read|check|look|search|find|analyze|examine|review)/i,
|
|
26
|
-
// "I'll X" / "I will X" patterns
|
|
27
|
-
/\bi['']ll\s+(create|write|implement|add|update|edit|modify|fix|build|make|refactor|read|check|look|search|find|analyze|start|begin|now)/i,
|
|
28
|
-
/\bi will\s+(create|write|implement|add|update|edit|modify|fix|build|make|refactor|read|check|look|search|find|analyze|start|begin|now)/i,
|
|
29
|
-
// "I'm going to X" patterns
|
|
30
|
-
/\bi['']m going to\s+(create|write|implement|add|update|edit|modify|fix|build|make|refactor|read|check|look|search|find|analyze)/i,
|
|
31
|
-
// "Now I'll X" / "First, I'll X" patterns
|
|
32
|
-
/\b(now|first|next)\s*(,)?\s*i['']ll\s+/i,
|
|
33
|
-
// Explicit continuation signals
|
|
34
|
-
/\bhere['']s (the|my) (plan|approach|solution|implementation)/i,
|
|
35
|
-
// Numbered steps suggesting action to come
|
|
36
|
-
/^\s*\d+\.\s+(create|write|implement|add|update|edit|modify|fix|show|read|check)/im,
|
|
37
|
-
// Bullet points suggesting planned actions
|
|
38
|
-
/^[\s•\-\*]+\s*(create|write|implement|add|update|edit|modify|fix|shows?|reads?|checks?)\s/im,
|
|
39
|
-
];
|
|
40
|
-
const AUTO_CONTINUE_PROMPTS = [
|
|
41
|
-
'Continue. Use tools now: start with Read/read_file to inspect the target file, then call Edit (or Write if available) with file_path/old_string/new_string to apply changes. Keep using tools until the task is done.',
|
|
42
|
-
'You MUST call tools immediately. Issue Read -> Edit/Write tool calls with explicit parameters; no more explaining or planning.',
|
|
43
|
-
'CRITICAL: Call a tool right now. Use Edit with file_path, old_string, new_string (or Write with file_path and content). Respond with tool calls only.',
|
|
44
|
-
];
|
|
45
|
-
/**
|
|
46
|
-
* Check if response indicates intent to act without actually acting
|
|
47
|
-
* This detects when the model says "let me do X" but doesn't call any tools
|
|
48
|
-
*/
|
|
49
|
-
function shouldAutoContinue(content, hasToolCalls) {
|
|
50
|
-
// If there are tool calls, no need to auto-continue
|
|
51
|
-
if (hasToolCalls) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
// If content is very short, likely not an incomplete intent
|
|
55
|
-
if (content.length < 50) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
// Check for intent patterns
|
|
59
|
-
for (const pattern of INTENT_WITHOUT_ACTION_PATTERNS) {
|
|
60
|
-
if (pattern.test(content)) {
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Check if an error is a context overflow error
|
|
68
|
-
*/
|
|
69
|
-
function isContextOverflowError(error) {
|
|
70
|
-
if (!(error instanceof Error))
|
|
71
|
-
return false;
|
|
72
|
-
const message = error.message.toLowerCase();
|
|
73
|
-
return (message.includes('context length') ||
|
|
74
|
-
message.includes('token') && (message.includes('limit') || message.includes('exceed') || message.includes('maximum')) ||
|
|
75
|
-
message.includes('too long') ||
|
|
76
|
-
message.includes('too many tokens') ||
|
|
77
|
-
message.includes('max_tokens') ||
|
|
78
|
-
message.includes('context window'));
|
|
79
|
-
}
|
|
80
|
-
class StreamInterruptionError extends Error {
|
|
81
|
-
reason;
|
|
82
|
-
partialResponse;
|
|
83
|
-
constructor(reason, message, partialResponse) {
|
|
84
|
-
super(message);
|
|
85
|
-
this.name = 'StreamInterruptionError';
|
|
86
|
-
this.reason = reason;
|
|
87
|
-
this.partialResponse = partialResponse;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
export class AgentRuntime {
|
|
91
|
-
messages = [];
|
|
92
|
-
provider;
|
|
93
|
-
toolRuntime;
|
|
94
|
-
callbacks;
|
|
95
|
-
contextManager;
|
|
96
|
-
activeRun = null;
|
|
97
|
-
baseSystemPrompt;
|
|
98
|
-
providerId;
|
|
99
|
-
modelId;
|
|
100
|
-
workingDirectory;
|
|
101
|
-
cancellationRequested = false;
|
|
102
|
-
_autoContinueEnabled = false;
|
|
103
|
-
constructor(options) {
|
|
104
|
-
this.provider = options.provider;
|
|
105
|
-
this.toolRuntime = options.toolRuntime;
|
|
106
|
-
this.callbacks = options.callbacks ?? {};
|
|
107
|
-
this.contextManager = options.contextManager ?? null;
|
|
108
|
-
this.providerId = options.providerId ?? 'unknown';
|
|
109
|
-
this.modelId = options.modelId ?? 'unknown';
|
|
110
|
-
this.workingDirectory = options.workingDirectory ?? process.cwd();
|
|
111
|
-
this._autoContinueEnabled = options.autoContinue ?? false;
|
|
112
|
-
const trimmedPrompt = options.systemPrompt.trim();
|
|
113
|
-
this.baseSystemPrompt = trimmedPrompt || null;
|
|
114
|
-
if (trimmedPrompt) {
|
|
115
|
-
this.messages.push({ role: 'system', content: trimmedPrompt });
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Request cancellation of the current operation.
|
|
120
|
-
* The agent will stop at the next safe point (after current tool completes).
|
|
121
|
-
*/
|
|
122
|
-
requestCancellation() {
|
|
123
|
-
this.cancellationRequested = true;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Check if cancellation has been requested.
|
|
127
|
-
*/
|
|
128
|
-
isCancellationRequested() {
|
|
129
|
-
return this.cancellationRequested;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Check if the agent is currently processing a request.
|
|
133
|
-
*/
|
|
134
|
-
isRunning() {
|
|
135
|
-
return this.activeRun !== null;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Check if auto-continuation is enabled.
|
|
139
|
-
*/
|
|
140
|
-
isAutoContinueEnabled() {
|
|
141
|
-
return this._autoContinueEnabled;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Enable or disable auto-continuation.
|
|
145
|
-
*/
|
|
146
|
-
setAutoContinue(enabled) {
|
|
147
|
-
this._autoContinueEnabled = enabled;
|
|
148
|
-
}
|
|
149
|
-
async send(text, useStreaming = false) {
|
|
150
|
-
const prompt = text.trim();
|
|
151
|
-
if (!prompt) {
|
|
152
|
-
return '';
|
|
153
|
-
}
|
|
154
|
-
// Reset cancellation flag at start of new request
|
|
155
|
-
this.cancellationRequested = false;
|
|
156
|
-
// Handle multi-line paste: show summary to user, send full content to AI
|
|
157
|
-
if (isMultilinePaste(prompt)) {
|
|
158
|
-
const processed = processPaste(prompt);
|
|
159
|
-
// Notify UI about the paste summary
|
|
160
|
-
this.callbacks.onMultilinePaste?.(processed.displaySummary, processed.metadata);
|
|
161
|
-
// But send the full content to the AI
|
|
162
|
-
this.messages.push({ role: 'user', content: processed.fullContent });
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
// Single-line or short text: send as-is
|
|
166
|
-
this.messages.push({ role: 'user', content: prompt });
|
|
167
|
-
}
|
|
168
|
-
const run = { startedAt: Date.now() };
|
|
169
|
-
this.activeRun = run;
|
|
170
|
-
try {
|
|
171
|
-
if (useStreaming && this.provider.generateStream) {
|
|
172
|
-
try {
|
|
173
|
-
return await this.processConversationStreaming();
|
|
174
|
-
}
|
|
175
|
-
catch (error) {
|
|
176
|
-
const message = safeErrorMessage(error);
|
|
177
|
-
const reason = error instanceof StreamInterruptionError ? error.reason : undefined;
|
|
178
|
-
const partialResponse = error instanceof StreamInterruptionError ? error.partialResponse : undefined;
|
|
179
|
-
console.warn(`[agent] Streaming failed, falling back to non-streaming: ${message}`);
|
|
180
|
-
this.callbacks.onStreamFallback?.({ message, error, reason, partialResponse });
|
|
181
|
-
return await this.processConversation();
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return await this.processConversation();
|
|
185
|
-
}
|
|
186
|
-
finally {
|
|
187
|
-
if (this.activeRun === run) {
|
|
188
|
-
this.activeRun = null;
|
|
189
|
-
}
|
|
190
|
-
// Reset cancellation flag when done
|
|
191
|
-
this.cancellationRequested = false;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
async processConversation() {
|
|
195
|
-
let contextRecoveryAttempts = 0;
|
|
196
|
-
let autoContinueAttempts = 0;
|
|
197
|
-
while (true) {
|
|
198
|
-
// Check for cancellation at start of each iteration
|
|
199
|
-
if (this.cancellationRequested) {
|
|
200
|
-
this.callbacks.onCancelled?.();
|
|
201
|
-
return '[Operation cancelled by user]';
|
|
202
|
-
}
|
|
203
|
-
// Prune messages if approaching context limit (BEFORE generation)
|
|
204
|
-
await this.pruneMessagesIfNeeded();
|
|
205
|
-
try {
|
|
206
|
-
const response = await this.provider.generate(this.messages, this.providerTools);
|
|
207
|
-
const usage = response.usage ?? null;
|
|
208
|
-
const contextStats = this.getContextStats();
|
|
209
|
-
// Reset recovery attempts on successful generation
|
|
210
|
-
contextRecoveryAttempts = 0;
|
|
211
|
-
if (response.type === 'tool_calls') {
|
|
212
|
-
const narration = response.content?.trim();
|
|
213
|
-
if (narration) {
|
|
214
|
-
this.emitAssistantMessage(narration, { isFinal: false, usage, contextStats });
|
|
215
|
-
}
|
|
216
|
-
const assistantMessage = {
|
|
217
|
-
role: 'assistant',
|
|
218
|
-
content: response.content ?? '',
|
|
219
|
-
};
|
|
220
|
-
if (response.toolCalls?.length) {
|
|
221
|
-
assistantMessage.toolCalls = response.toolCalls;
|
|
222
|
-
}
|
|
223
|
-
this.messages.push(assistantMessage);
|
|
224
|
-
await this.resolveToolCalls(response.toolCalls);
|
|
225
|
-
// Reset auto-continue counter since model is actively working
|
|
226
|
-
autoContinueAttempts = 0;
|
|
227
|
-
continue;
|
|
228
|
-
}
|
|
229
|
-
const reply = response.content?.trim() ?? '';
|
|
230
|
-
// Check if model expressed intent to act but didn't call tools
|
|
231
|
-
// This catches "Let me create..." without actual tool calls
|
|
232
|
-
// Only auto-continue if the feature is enabled
|
|
233
|
-
if (this._autoContinueEnabled && shouldAutoContinue(reply, false) && autoContinueAttempts < MAX_AUTO_CONTINUE_ATTEMPTS) {
|
|
234
|
-
autoContinueAttempts++;
|
|
235
|
-
// Emit the planning content but mark as non-final
|
|
236
|
-
if (reply) {
|
|
237
|
-
this.emitAssistantMessage(reply, { isFinal: false, usage, contextStats });
|
|
238
|
-
}
|
|
239
|
-
this.messages.push({ role: 'assistant', content: reply });
|
|
240
|
-
// Auto-prompt with increasingly direct instructions
|
|
241
|
-
const promptIndex = Math.min(autoContinueAttempts - 1, AUTO_CONTINUE_PROMPTS.length - 1);
|
|
242
|
-
this.messages.push({
|
|
243
|
-
role: 'user',
|
|
244
|
-
content: AUTO_CONTINUE_PROMPTS[promptIndex],
|
|
245
|
-
});
|
|
246
|
-
const autoContinueMessage = `Model expressed intent but didn't use tools. Auto-prompting to continue...`;
|
|
247
|
-
this.callbacks.onAutoContinue?.(autoContinueAttempts, MAX_AUTO_CONTINUE_ATTEMPTS, autoContinueMessage);
|
|
248
|
-
continue;
|
|
249
|
-
}
|
|
250
|
-
if (reply) {
|
|
251
|
-
this.emitAssistantMessage(reply, { isFinal: true, usage, contextStats });
|
|
252
|
-
}
|
|
253
|
-
this.messages.push({ role: 'assistant', content: reply });
|
|
254
|
-
// Trigger verification for final responses with verifiable claims
|
|
255
|
-
this.triggerVerificationIfNeeded(reply);
|
|
256
|
-
return reply;
|
|
257
|
-
}
|
|
258
|
-
catch (error) {
|
|
259
|
-
// Auto-recover from context overflow errors
|
|
260
|
-
if (isContextOverflowError(error) && contextRecoveryAttempts < MAX_CONTEXT_RECOVERY_ATTEMPTS) {
|
|
261
|
-
contextRecoveryAttempts++;
|
|
262
|
-
const recovered = await this.recoverFromContextOverflow(contextRecoveryAttempts);
|
|
263
|
-
if (recovered) {
|
|
264
|
-
// Notify UI that we're continuing after recovery
|
|
265
|
-
this.callbacks.onContinueAfterRecovery?.();
|
|
266
|
-
// Retry the generation with reduced context
|
|
267
|
-
continue;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
// Re-throw if not recoverable or recovery failed
|
|
271
|
-
throw error;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
async processConversationStreaming() {
|
|
276
|
-
if (!this.provider.generateStream) {
|
|
277
|
-
return this.processConversation();
|
|
278
|
-
}
|
|
279
|
-
let contextRecoveryAttempts = 0;
|
|
280
|
-
let autoContinueAttempts = 0;
|
|
281
|
-
while (true) {
|
|
282
|
-
// Check for cancellation at start of each iteration
|
|
283
|
-
if (this.cancellationRequested) {
|
|
284
|
-
this.callbacks.onCancelled?.();
|
|
285
|
-
return '[Operation cancelled by user]';
|
|
286
|
-
}
|
|
287
|
-
// Prune messages if approaching context limit (BEFORE generation)
|
|
288
|
-
await this.pruneMessagesIfNeeded();
|
|
289
|
-
try {
|
|
290
|
-
let fullContent = '';
|
|
291
|
-
let reasoningContent = '';
|
|
292
|
-
const toolCalls = [];
|
|
293
|
-
let usage = null;
|
|
294
|
-
const stream = this.provider.generateStream(this.messages, this.providerTools);
|
|
295
|
-
const iterator = stream[Symbol.asyncIterator]();
|
|
296
|
-
let streamClosed = false;
|
|
297
|
-
const closeStream = async () => {
|
|
298
|
-
if (streamClosed) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
streamClosed = true;
|
|
302
|
-
if (typeof iterator.return === 'function') {
|
|
303
|
-
try {
|
|
304
|
-
await iterator.return();
|
|
305
|
-
}
|
|
306
|
-
catch (closeError) {
|
|
307
|
-
console.warn(`[agent] Failed to close stream cleanly: ${safeErrorMessage(closeError)}`);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
};
|
|
311
|
-
const buildTimeoutError = (reason) => {
|
|
312
|
-
const base = reason === 'startup-timeout'
|
|
313
|
-
? 'Streaming stalled before any content arrived.'
|
|
314
|
-
: 'Streaming stalled due to inactivity.';
|
|
315
|
-
return new StreamInterruptionError(reason, `${base} Falling back to non-streaming.`, fullContent || reasoningContent);
|
|
316
|
-
};
|
|
317
|
-
// Timer for first token arrival
|
|
318
|
-
let startupTimer = null;
|
|
319
|
-
const startupTimeoutPromise = new Promise((_, reject) => {
|
|
320
|
-
startupTimer = setTimeout(() => reject(buildTimeoutError('startup-timeout')), STREAM_FIRST_CHUNK_TIMEOUT_MS);
|
|
321
|
-
});
|
|
322
|
-
const createIdleTimeout = () => {
|
|
323
|
-
let idleTimer = null;
|
|
324
|
-
const promise = new Promise((_, reject) => {
|
|
325
|
-
idleTimer = setTimeout(() => reject(buildTimeoutError('idle-timeout')), STREAM_INACTIVITY_TIMEOUT_MS);
|
|
326
|
-
});
|
|
327
|
-
const cancel = () => {
|
|
328
|
-
if (idleTimer) {
|
|
329
|
-
clearTimeout(idleTimer);
|
|
330
|
-
idleTimer = null;
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
return { promise, cancel };
|
|
334
|
-
};
|
|
335
|
-
let idleTimeout = createIdleTimeout();
|
|
336
|
-
let firstChunkSeen = false;
|
|
337
|
-
try {
|
|
338
|
-
while (true) {
|
|
339
|
-
const races = [
|
|
340
|
-
iterator.next(),
|
|
341
|
-
idleTimeout.promise,
|
|
342
|
-
];
|
|
343
|
-
if (!firstChunkSeen) {
|
|
344
|
-
races.push(startupTimeoutPromise);
|
|
345
|
-
}
|
|
346
|
-
const result = (await Promise.race(races));
|
|
347
|
-
// Reset idle timer for the next iteration
|
|
348
|
-
idleTimeout.cancel();
|
|
349
|
-
idleTimeout = createIdleTimeout();
|
|
350
|
-
// Check for cancellation during streaming
|
|
351
|
-
if (this.cancellationRequested) {
|
|
352
|
-
await closeStream();
|
|
353
|
-
this.callbacks.onCancelled?.();
|
|
354
|
-
const partial = (fullContent || reasoningContent).trim();
|
|
355
|
-
if (partial) {
|
|
356
|
-
this.messages.push({ role: 'assistant', content: `${partial}\n\n[Cancelled by user]` });
|
|
357
|
-
}
|
|
358
|
-
return '[Operation cancelled by user]';
|
|
359
|
-
}
|
|
360
|
-
if (result.done) {
|
|
361
|
-
break;
|
|
362
|
-
}
|
|
363
|
-
const chunk = result.value;
|
|
364
|
-
if (!firstChunkSeen) {
|
|
365
|
-
firstChunkSeen = true;
|
|
366
|
-
if (startupTimer) {
|
|
367
|
-
clearTimeout(startupTimer);
|
|
368
|
-
startupTimer = null;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
if (chunk.type === 'reasoning' && chunk.content) {
|
|
372
|
-
reasoningContent += chunk.content;
|
|
373
|
-
this.callbacks.onStreamChunk?.(chunk.content);
|
|
374
|
-
continue;
|
|
375
|
-
}
|
|
376
|
-
if (chunk.type === 'content' && chunk.content) {
|
|
377
|
-
fullContent += chunk.content;
|
|
378
|
-
this.callbacks.onStreamChunk?.(chunk.content);
|
|
379
|
-
}
|
|
380
|
-
else if (chunk.type === 'tool_call' && chunk.toolCall) {
|
|
381
|
-
toolCalls.push(chunk.toolCall);
|
|
382
|
-
}
|
|
383
|
-
else if (chunk.type === 'usage' && chunk.usage) {
|
|
384
|
-
usage = chunk.usage;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
finally {
|
|
389
|
-
idleTimeout.cancel();
|
|
390
|
-
if (startupTimer) {
|
|
391
|
-
clearTimeout(startupTimer);
|
|
392
|
-
}
|
|
393
|
-
await closeStream();
|
|
394
|
-
}
|
|
395
|
-
// Reset recovery attempts on successful generation
|
|
396
|
-
contextRecoveryAttempts = 0;
|
|
397
|
-
const contextStats = this.getContextStats();
|
|
398
|
-
const combinedContent = fullContent || reasoningContent;
|
|
399
|
-
// Check if we got tool calls
|
|
400
|
-
if (toolCalls.length > 0) {
|
|
401
|
-
const narration = combinedContent.trim();
|
|
402
|
-
if (narration) {
|
|
403
|
-
// Mark as wasStreamed since content was already output via onStreamChunk
|
|
404
|
-
this.emitAssistantMessage(narration, { isFinal: false, usage, contextStats, wasStreamed: true });
|
|
405
|
-
}
|
|
406
|
-
const assistantMessage = {
|
|
407
|
-
role: 'assistant',
|
|
408
|
-
content: combinedContent,
|
|
409
|
-
toolCalls,
|
|
410
|
-
};
|
|
411
|
-
this.messages.push(assistantMessage);
|
|
412
|
-
await this.resolveToolCalls(toolCalls);
|
|
413
|
-
// Reset auto-continue counter since model is actively working
|
|
414
|
-
autoContinueAttempts = 0;
|
|
415
|
-
continue;
|
|
416
|
-
}
|
|
417
|
-
// Check if model expressed intent to act but didn't call tools
|
|
418
|
-
// This catches "Let me create..." without actual tool calls
|
|
419
|
-
// Only auto-continue if the feature is enabled
|
|
420
|
-
const reply = combinedContent.trim();
|
|
421
|
-
if (this._autoContinueEnabled && shouldAutoContinue(reply, false) && autoContinueAttempts < MAX_AUTO_CONTINUE_ATTEMPTS) {
|
|
422
|
-
autoContinueAttempts++;
|
|
423
|
-
// Emit the planning content but mark as non-final
|
|
424
|
-
// Mark as wasStreamed since content was already output via onStreamChunk
|
|
425
|
-
if (reply) {
|
|
426
|
-
this.emitAssistantMessage(reply, { isFinal: false, usage, contextStats, wasStreamed: true });
|
|
427
|
-
}
|
|
428
|
-
this.messages.push({ role: 'assistant', content: reply });
|
|
429
|
-
// Auto-prompt with increasingly direct instructions
|
|
430
|
-
const promptIndex = Math.min(autoContinueAttempts - 1, AUTO_CONTINUE_PROMPTS.length - 1);
|
|
431
|
-
this.messages.push({
|
|
432
|
-
role: 'user',
|
|
433
|
-
content: AUTO_CONTINUE_PROMPTS[promptIndex],
|
|
434
|
-
});
|
|
435
|
-
const autoContinueMessage = `Model expressed intent but didn't use tools. Auto-prompting to continue...`;
|
|
436
|
-
this.callbacks.onAutoContinue?.(autoContinueAttempts, MAX_AUTO_CONTINUE_ATTEMPTS, autoContinueMessage);
|
|
437
|
-
continue;
|
|
438
|
-
}
|
|
439
|
-
// Final message - mark as streamed to avoid double-display in UI
|
|
440
|
-
if (reply) {
|
|
441
|
-
this.emitAssistantMessage(reply, { isFinal: true, usage, contextStats, wasStreamed: true });
|
|
442
|
-
}
|
|
443
|
-
this.messages.push({ role: 'assistant', content: reply });
|
|
444
|
-
// Trigger verification for final responses with verifiable claims
|
|
445
|
-
this.triggerVerificationIfNeeded(reply);
|
|
446
|
-
return reply;
|
|
447
|
-
}
|
|
448
|
-
catch (error) {
|
|
449
|
-
// Auto-recover from context overflow errors
|
|
450
|
-
if (isContextOverflowError(error) && contextRecoveryAttempts < MAX_CONTEXT_RECOVERY_ATTEMPTS) {
|
|
451
|
-
contextRecoveryAttempts++;
|
|
452
|
-
const recovered = await this.recoverFromContextOverflow(contextRecoveryAttempts);
|
|
453
|
-
if (recovered) {
|
|
454
|
-
// Notify UI that we're continuing after recovery
|
|
455
|
-
this.callbacks.onContinueAfterRecovery?.();
|
|
456
|
-
// Retry the generation with reduced context
|
|
457
|
-
continue;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
// Re-throw if not recoverable or recovery failed
|
|
461
|
-
throw error;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* Execute tool calls with optimized concurrency
|
|
467
|
-
*
|
|
468
|
-
* PERF: Uses Promise.all for parallel execution with early result handling.
|
|
469
|
-
* Results are collected in order but execution happens concurrently.
|
|
470
|
-
* For very large batches (>10 tools), uses chunked execution to prevent
|
|
471
|
-
* overwhelming system resources.
|
|
472
|
-
*/
|
|
473
|
-
async resolveToolCalls(toolCalls) {
|
|
474
|
-
const numCalls = toolCalls.length;
|
|
475
|
-
// Check for cancellation before starting tool execution
|
|
476
|
-
if (this.cancellationRequested) {
|
|
477
|
-
// Add cancellation message for each pending tool call
|
|
478
|
-
for (const call of toolCalls) {
|
|
479
|
-
this.messages.push({
|
|
480
|
-
role: 'tool',
|
|
481
|
-
name: call.name,
|
|
482
|
-
toolCallId: call.id,
|
|
483
|
-
content: '[Tool execution cancelled by user]',
|
|
484
|
-
});
|
|
485
|
-
}
|
|
486
|
-
return;
|
|
487
|
-
}
|
|
488
|
-
// Fast path: single tool call
|
|
489
|
-
if (numCalls === 1) {
|
|
490
|
-
const call = toolCalls[0];
|
|
491
|
-
const output = await this.toolRuntime.execute(call);
|
|
492
|
-
this.messages.push({
|
|
493
|
-
role: 'tool',
|
|
494
|
-
name: call.name,
|
|
495
|
-
toolCallId: call.id,
|
|
496
|
-
content: output,
|
|
497
|
-
});
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
500
|
-
// PERF: For reasonable batch sizes, execute all in parallel
|
|
501
|
-
if (numCalls <= 10) {
|
|
502
|
-
const results = await Promise.all(toolCalls.map(async (call) => ({
|
|
503
|
-
call,
|
|
504
|
-
output: await this.toolRuntime.execute(call),
|
|
505
|
-
})));
|
|
506
|
-
// Add results to messages in the same order as tool calls
|
|
507
|
-
for (const { call, output } of results) {
|
|
508
|
-
this.messages.push({
|
|
509
|
-
role: 'tool',
|
|
510
|
-
name: call.name,
|
|
511
|
-
toolCallId: call.id,
|
|
512
|
-
content: output,
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
return;
|
|
516
|
-
}
|
|
517
|
-
// PERF: For large batches, use chunked parallel execution
|
|
518
|
-
// This prevents memory pressure from too many concurrent operations
|
|
519
|
-
const CHUNK_SIZE = 8;
|
|
520
|
-
const results = [];
|
|
521
|
-
for (let i = 0; i < numCalls; i += CHUNK_SIZE) {
|
|
522
|
-
const chunk = toolCalls.slice(i, i + CHUNK_SIZE);
|
|
523
|
-
const chunkResults = await Promise.all(chunk.map(async (call) => ({
|
|
524
|
-
call,
|
|
525
|
-
output: await this.toolRuntime.execute(call),
|
|
526
|
-
})));
|
|
527
|
-
results.push(...chunkResults);
|
|
528
|
-
}
|
|
529
|
-
// Add results to messages in order
|
|
530
|
-
for (const { call, output } of results) {
|
|
531
|
-
this.messages.push({
|
|
532
|
-
role: 'tool',
|
|
533
|
-
name: call.name,
|
|
534
|
-
toolCallId: call.id,
|
|
535
|
-
content: output,
|
|
536
|
-
});
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
get providerTools() {
|
|
540
|
-
return this.toolRuntime.listProviderTools();
|
|
541
|
-
}
|
|
542
|
-
emitAssistantMessage(content, metadata) {
|
|
543
|
-
if (!content) {
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
const elapsedMs = this.activeRun ? Date.now() - this.activeRun.startedAt : undefined;
|
|
547
|
-
const payload = { ...metadata };
|
|
548
|
-
if (typeof elapsedMs === 'number') {
|
|
549
|
-
payload.elapsedMs = elapsedMs;
|
|
550
|
-
}
|
|
551
|
-
this.callbacks.onAssistantMessage?.(content, payload);
|
|
552
|
-
}
|
|
553
|
-
/**
|
|
554
|
-
* Trigger verification for a final response if callback is registered
|
|
555
|
-
* and response contains verifiable claims (implementation, build success, etc.)
|
|
556
|
-
*/
|
|
557
|
-
triggerVerificationIfNeeded(response) {
|
|
558
|
-
if (!this.callbacks.onVerificationNeeded) {
|
|
559
|
-
return;
|
|
560
|
-
}
|
|
561
|
-
// Only trigger verification for responses that likely contain verifiable claims
|
|
562
|
-
// These patterns indicate the model is claiming to have completed work
|
|
563
|
-
const verifiablePatterns = [
|
|
564
|
-
/\b(implemented|created|wrote|added|fixed|built|deployed|completed|refactored)\b/i,
|
|
565
|
-
/\b(tests?\s+(are\s+)?pass(ing)?|build\s+succeed)/i,
|
|
566
|
-
/\b(file|function|class|module|component)\s+(has been|is now|was)\s+(created|updated|modified)/i,
|
|
567
|
-
/✅|✓|\[done\]|\[complete\]/i,
|
|
568
|
-
/\bcommit(ted)?\b.*\b(success|done)\b/i,
|
|
569
|
-
];
|
|
570
|
-
const hasVerifiableClaims = verifiablePatterns.some(pattern => pattern.test(response));
|
|
571
|
-
if (!hasVerifiableClaims) {
|
|
572
|
-
return;
|
|
573
|
-
}
|
|
574
|
-
// Build conversation history for context (last 5 user/assistant exchanges)
|
|
575
|
-
const conversationHistory = [];
|
|
576
|
-
const recentMessages = this.messages.slice(-10);
|
|
577
|
-
for (const msg of recentMessages) {
|
|
578
|
-
if (msg.role === 'user' || msg.role === 'assistant') {
|
|
579
|
-
const content = typeof msg.content === 'string' ? msg.content : '';
|
|
580
|
-
if (content.length > 0) {
|
|
581
|
-
conversationHistory.push(`${msg.role}: ${content.slice(0, 500)}`);
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
// Trigger verification callback
|
|
586
|
-
this.callbacks.onVerificationNeeded(response, {
|
|
587
|
-
workingDirectory: this.workingDirectory,
|
|
588
|
-
conversationHistory,
|
|
589
|
-
provider: this.providerId,
|
|
590
|
-
model: this.modelId,
|
|
591
|
-
});
|
|
592
|
-
}
|
|
593
|
-
getHistory() {
|
|
594
|
-
return this.messages.map(cloneMessage);
|
|
595
|
-
}
|
|
596
|
-
loadHistory(history) {
|
|
597
|
-
this.messages.length = 0;
|
|
598
|
-
if (history.length === 0) {
|
|
599
|
-
if (this.baseSystemPrompt) {
|
|
600
|
-
this.messages.push({ role: 'system', content: this.baseSystemPrompt });
|
|
601
|
-
}
|
|
602
|
-
return;
|
|
603
|
-
}
|
|
604
|
-
for (const message of history) {
|
|
605
|
-
this.messages.push(cloneMessage(message));
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
clearHistory() {
|
|
609
|
-
this.messages.length = 0;
|
|
610
|
-
if (this.baseSystemPrompt) {
|
|
611
|
-
this.messages.push({ role: 'system', content: this.baseSystemPrompt });
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
/**
|
|
615
|
-
* Prune messages if approaching context limit
|
|
616
|
-
*
|
|
617
|
-
* This runs BEFORE each generation to ensure we stay within budget.
|
|
618
|
-
* If LLM summarization is available, it will create intelligent summaries
|
|
619
|
-
* instead of just removing old messages.
|
|
620
|
-
*/
|
|
621
|
-
async pruneMessagesIfNeeded() {
|
|
622
|
-
if (!this.contextManager) {
|
|
623
|
-
return;
|
|
624
|
-
}
|
|
625
|
-
if (this.contextManager.isApproachingLimit(this.messages)) {
|
|
626
|
-
// Try LLM-based summarization first (preserves context better)
|
|
627
|
-
const result = await this.contextManager.pruneMessagesWithSummary(this.messages);
|
|
628
|
-
if (result.removed > 0) {
|
|
629
|
-
// Replace messages with pruned/summarized version
|
|
630
|
-
this.messages.length = 0;
|
|
631
|
-
this.messages.push(...result.pruned);
|
|
632
|
-
// Notify callback with enriched stats
|
|
633
|
-
const stats = this.contextManager.getStats(this.messages);
|
|
634
|
-
const enrichedStats = {
|
|
635
|
-
...stats,
|
|
636
|
-
summarized: result.summarized,
|
|
637
|
-
method: result.summarized ? 'llm-summary' : 'simple-prune',
|
|
638
|
-
};
|
|
639
|
-
this.callbacks.onContextPruned?.(result.removed, enrichedStats);
|
|
640
|
-
if (process.env['DEBUG_CONTEXT']) {
|
|
641
|
-
console.warn(`[Context Manager] ${result.summarized ? 'Summarized' : 'Pruned'} ${result.removed} messages. ` +
|
|
642
|
-
`Tokens: ${stats.totalTokens} (${stats.percentage}%)`);
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
/**
|
|
648
|
-
* Get current context statistics
|
|
649
|
-
*/
|
|
650
|
-
getContextStats() {
|
|
651
|
-
if (!this.contextManager) {
|
|
652
|
-
return null;
|
|
653
|
-
}
|
|
654
|
-
return this.contextManager.getStats(this.messages);
|
|
655
|
-
}
|
|
656
|
-
/**
|
|
657
|
-
* Get context manager instance
|
|
658
|
-
*/
|
|
659
|
-
getContextManager() {
|
|
660
|
-
return this.contextManager;
|
|
661
|
-
}
|
|
662
|
-
/**
|
|
663
|
-
* Auto-recover from context overflow errors by aggressively pruning messages.
|
|
664
|
-
*
|
|
665
|
-
* This is called when an API call fails due to context length exceeding limits.
|
|
666
|
-
* It performs increasingly aggressive pruning on each attempt:
|
|
667
|
-
* - Attempt 1: Remove 30% of oldest messages + truncate tool outputs to 5k
|
|
668
|
-
* - Attempt 2: Remove 50% of oldest messages + truncate tool outputs to 2k
|
|
669
|
-
* - Attempt 3: Remove 70% of oldest messages + truncate tool outputs to 500 chars
|
|
670
|
-
*
|
|
671
|
-
* @returns true if recovery was successful (context was reduced)
|
|
672
|
-
*/
|
|
673
|
-
async recoverFromContextOverflow(attempt) {
|
|
674
|
-
// Calculate reduction percentage based on attempt
|
|
675
|
-
const reductionPercentages = [0.3, 0.5, 0.7];
|
|
676
|
-
const reductionPercent = reductionPercentages[attempt - 1] ?? 0.7;
|
|
677
|
-
// Increasingly aggressive tool output truncation limits
|
|
678
|
-
const toolOutputLimits = [5000, 2000, 500];
|
|
679
|
-
const toolOutputLimit = toolOutputLimits[attempt - 1] ?? 500;
|
|
680
|
-
// Notify UI about recovery attempt
|
|
681
|
-
const message = `Context overflow detected. Auto-squishing context (attempt ${attempt}/${MAX_CONTEXT_RECOVERY_ATTEMPTS}, removing ${Math.round(reductionPercent * 100)}% of history)...`;
|
|
682
|
-
this.callbacks.onContextRecovery?.(attempt, MAX_CONTEXT_RECOVERY_ATTEMPTS, message);
|
|
683
|
-
this.callbacks.onContextSquishing?.(message);
|
|
684
|
-
// Separate system messages from conversation
|
|
685
|
-
const systemMessages = [];
|
|
686
|
-
const conversationMessages = [];
|
|
687
|
-
for (const msg of this.messages) {
|
|
688
|
-
if (msg.role === 'system') {
|
|
689
|
-
systemMessages.push(msg);
|
|
690
|
-
}
|
|
691
|
-
else {
|
|
692
|
-
conversationMessages.push(msg);
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
// Calculate how many messages to remove (target)
|
|
696
|
-
const targetRemoveCount = Math.floor(conversationMessages.length * reductionPercent);
|
|
697
|
-
if (targetRemoveCount === 0 || conversationMessages.length <= 2) {
|
|
698
|
-
// Nothing to remove or too few messages - can't recover
|
|
699
|
-
return false;
|
|
700
|
-
}
|
|
701
|
-
// Group messages into conversation "turns" to maintain tool call/result pairing
|
|
702
|
-
// A turn is: [user] or [assistant + tool results] or [assistant without tools]
|
|
703
|
-
const turns = [];
|
|
704
|
-
let currentTurn = [];
|
|
705
|
-
for (let i = 0; i < conversationMessages.length; i++) {
|
|
706
|
-
const msg = conversationMessages[i];
|
|
707
|
-
if (msg.role === 'user') {
|
|
708
|
-
// User messages start a new turn
|
|
709
|
-
if (currentTurn.length > 0) {
|
|
710
|
-
turns.push(currentTurn);
|
|
711
|
-
}
|
|
712
|
-
currentTurn = [msg];
|
|
713
|
-
}
|
|
714
|
-
else if (msg.role === 'assistant') {
|
|
715
|
-
// Assistant messages start a new turn (flush previous)
|
|
716
|
-
if (currentTurn.length > 0) {
|
|
717
|
-
turns.push(currentTurn);
|
|
718
|
-
}
|
|
719
|
-
currentTurn = [msg];
|
|
720
|
-
}
|
|
721
|
-
else if (msg.role === 'tool') {
|
|
722
|
-
// Tool results belong to the current assistant turn
|
|
723
|
-
currentTurn.push(msg);
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
// Don't forget the last turn
|
|
727
|
-
if (currentTurn.length > 0) {
|
|
728
|
-
turns.push(currentTurn);
|
|
729
|
-
}
|
|
730
|
-
// Calculate how many turns to remove
|
|
731
|
-
const targetTurnsToRemove = Math.floor(turns.length * reductionPercent);
|
|
732
|
-
if (targetTurnsToRemove === 0 || turns.length <= 2) {
|
|
733
|
-
return false;
|
|
734
|
-
}
|
|
735
|
-
// Keep recent turns (remove from the beginning)
|
|
736
|
-
const keepTurns = turns.slice(targetTurnsToRemove);
|
|
737
|
-
// IMPORTANT: Ensure we don't start with orphaned tool messages
|
|
738
|
-
// The first kept turn must NOT be a tool-only turn
|
|
739
|
-
let startIndex = 0;
|
|
740
|
-
while (startIndex < keepTurns.length) {
|
|
741
|
-
const firstTurn = keepTurns[startIndex];
|
|
742
|
-
if (firstTurn && firstTurn.length > 0) {
|
|
743
|
-
const firstMsg = firstTurn[0];
|
|
744
|
-
// If first message is a tool result, skip this turn
|
|
745
|
-
if (firstMsg?.role === 'tool') {
|
|
746
|
-
startIndex++;
|
|
747
|
-
continue;
|
|
748
|
-
}
|
|
749
|
-
// If first message is an assistant with tool calls but we're missing results,
|
|
750
|
-
// check if all tool results are present
|
|
751
|
-
if (firstMsg?.role === 'assistant' && firstMsg.toolCalls && firstMsg.toolCalls.length > 0) {
|
|
752
|
-
// PERF: Pre-compute tool call IDs as array, use direct Set lookup
|
|
753
|
-
const toolCallIds = firstMsg.toolCalls.map(tc => tc.id);
|
|
754
|
-
const presentToolResultIds = new Set(firstTurn.filter(m => m.role === 'tool').map(m => m.toolCallId));
|
|
755
|
-
// PERF: Direct has() calls with early exit instead of spread + every()
|
|
756
|
-
let allPresent = true;
|
|
757
|
-
for (const id of toolCallIds) {
|
|
758
|
-
if (!presentToolResultIds.has(id)) {
|
|
759
|
-
allPresent = false;
|
|
760
|
-
break;
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
if (allPresent) {
|
|
764
|
-
break;
|
|
765
|
-
}
|
|
766
|
-
// Otherwise skip this turn
|
|
767
|
-
startIndex++;
|
|
768
|
-
continue;
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
break;
|
|
772
|
-
}
|
|
773
|
-
const validTurns = keepTurns.slice(startIndex);
|
|
774
|
-
if (validTurns.length === 0) {
|
|
775
|
-
return false;
|
|
776
|
-
}
|
|
777
|
-
// Flatten valid turns back to messages
|
|
778
|
-
const keepMessages = validTurns.flat();
|
|
779
|
-
const actualRemoveCount = conversationMessages.length - keepMessages.length;
|
|
780
|
-
// Aggressively truncate tool outputs in remaining messages
|
|
781
|
-
let truncatedCount = 0;
|
|
782
|
-
for (const msg of keepMessages) {
|
|
783
|
-
if (msg.role === 'tool' && msg.content) {
|
|
784
|
-
const content = typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content);
|
|
785
|
-
if (content.length > toolOutputLimit) {
|
|
786
|
-
// Truncate with smart ending
|
|
787
|
-
const truncated = content.slice(0, toolOutputLimit);
|
|
788
|
-
const lastNewline = truncated.lastIndexOf('\n');
|
|
789
|
-
const cutPoint = lastNewline > toolOutputLimit * 0.7 ? lastNewline : toolOutputLimit;
|
|
790
|
-
msg.content = truncated.slice(0, cutPoint) + `\n\n[... truncated ${content.length - cutPoint} chars for context recovery ...]`;
|
|
791
|
-
truncatedCount++;
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
// Also truncate very long assistant messages
|
|
795
|
-
if (msg.role === 'assistant' && msg.content && msg.content.length > toolOutputLimit * 2) {
|
|
796
|
-
const content = msg.content;
|
|
797
|
-
const limit = toolOutputLimit * 2;
|
|
798
|
-
const truncated = content.slice(0, limit);
|
|
799
|
-
const lastNewline = truncated.lastIndexOf('\n');
|
|
800
|
-
const cutPoint = lastNewline > limit * 0.8 ? lastNewline : limit;
|
|
801
|
-
msg.content = truncated.slice(0, cutPoint) + `\n\n[... truncated for context recovery ...]`;
|
|
802
|
-
truncatedCount++;
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
// Also truncate system messages if they're huge (except first system prompt)
|
|
806
|
-
for (let i = 1; i < systemMessages.length; i++) {
|
|
807
|
-
const sys = systemMessages[i];
|
|
808
|
-
if (sys && sys.content && sys.content.length > toolOutputLimit) {
|
|
809
|
-
sys.content = sys.content.slice(0, toolOutputLimit) + '\n[... truncated ...]';
|
|
810
|
-
truncatedCount++;
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
// Rebuild message array
|
|
814
|
-
this.messages.length = 0;
|
|
815
|
-
// Add system messages
|
|
816
|
-
for (const sys of systemMessages) {
|
|
817
|
-
this.messages.push(sys);
|
|
818
|
-
}
|
|
819
|
-
// Add summary notice
|
|
820
|
-
this.messages.push({
|
|
821
|
-
role: 'system',
|
|
822
|
-
content: `[Auto Context Recovery] Removed ${actualRemoveCount} messages and truncated ${truncatedCount} large outputs to stay within token limits.`,
|
|
823
|
-
});
|
|
824
|
-
// Add remaining conversation (maintaining tool call/result pairing)
|
|
825
|
-
for (const msg of keepMessages) {
|
|
826
|
-
this.messages.push(msg);
|
|
827
|
-
}
|
|
828
|
-
// Notify about pruning
|
|
829
|
-
const stats = this.contextManager?.getStats(this.messages) ?? {};
|
|
830
|
-
this.callbacks.onContextPruned?.(actualRemoveCount, {
|
|
831
|
-
...stats,
|
|
832
|
-
method: 'emergency-recovery',
|
|
833
|
-
attempt,
|
|
834
|
-
removedPercent: reductionPercent * 100,
|
|
835
|
-
turnsRemoved: targetTurnsToRemove + startIndex,
|
|
836
|
-
truncatedOutputs: truncatedCount,
|
|
837
|
-
toolOutputLimit,
|
|
838
|
-
});
|
|
839
|
-
// Check if we're still over limit after all reductions
|
|
840
|
-
const newStats = this.contextManager?.getStats(this.messages);
|
|
841
|
-
if (newStats && newStats.percentage > 100) {
|
|
842
|
-
// Still over limit - do one more aggressive pass
|
|
843
|
-
// Truncate ALL tool outputs to absolute minimum
|
|
844
|
-
const minLimit = 200;
|
|
845
|
-
for (const msg of this.messages) {
|
|
846
|
-
if (msg.role === 'tool' && msg.content) {
|
|
847
|
-
const content = typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content);
|
|
848
|
-
if (content.length > minLimit) {
|
|
849
|
-
msg.content = content.slice(0, minLimit) + '\n[... severely truncated ...]';
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
return true;
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
function cloneMessage(message) {
|
|
858
|
-
switch (message.role) {
|
|
859
|
-
case 'assistant':
|
|
860
|
-
const clone = {
|
|
861
|
-
role: 'assistant',
|
|
862
|
-
content: message.content,
|
|
863
|
-
};
|
|
864
|
-
if (message.toolCalls) {
|
|
865
|
-
clone.toolCalls = message.toolCalls.map(cloneToolCall);
|
|
866
|
-
}
|
|
867
|
-
return clone;
|
|
868
|
-
case 'tool':
|
|
869
|
-
return {
|
|
870
|
-
role: 'tool',
|
|
871
|
-
name: message.name,
|
|
872
|
-
content: message.content,
|
|
873
|
-
toolCallId: message.toolCallId,
|
|
874
|
-
};
|
|
875
|
-
case 'system':
|
|
876
|
-
return { role: 'system', content: message.content };
|
|
877
|
-
case 'user':
|
|
878
|
-
default:
|
|
879
|
-
return { role: 'user', content: message.content };
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
function cloneToolCall(call) {
|
|
883
|
-
return {
|
|
884
|
-
id: call.id,
|
|
885
|
-
name: call.name,
|
|
886
|
-
arguments: { ...(call.arguments ?? {}) },
|
|
887
|
-
};
|
|
888
|
-
}
|
|
889
|
-
//# sourceMappingURL=agent.js.map
|