deepseek-coder-cli 1.0.0
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/LICENSE +21 -0
- package/README.md +422 -0
- package/agents/agi-code.rules.json +87 -0
- package/agents/general.rules.json +171 -0
- package/dist/bin/cliMode.d.ts +8 -0
- package/dist/bin/cliMode.d.ts.map +1 -0
- package/dist/bin/cliMode.js +20 -0
- package/dist/bin/cliMode.js.map +1 -0
- package/dist/bin/deepseek.d.ts +16 -0
- package/dist/bin/deepseek.d.ts.map +1 -0
- package/dist/bin/deepseek.js +737 -0
- package/dist/bin/deepseek.js.map +1 -0
- package/dist/bin/erosolar.d.ts +7 -0
- package/dist/bin/erosolar.d.ts.map +1 -0
- package/dist/bin/erosolar.js +7 -0
- package/dist/bin/erosolar.js.map +1 -0
- package/dist/bin/selfTest.d.ts +14 -0
- package/dist/bin/selfTest.d.ts.map +1 -0
- package/dist/bin/selfTest.js +304 -0
- package/dist/bin/selfTest.js.map +1 -0
- package/dist/capabilities/appleSecurityCapability.d.ts +57 -0
- package/dist/capabilities/appleSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/appleSecurityCapability.js +197 -0
- package/dist/capabilities/appleSecurityCapability.js.map +1 -0
- package/dist/capabilities/authorizedSecurityCapability.d.ts +17 -0
- package/dist/capabilities/authorizedSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/authorizedSecurityCapability.js +333 -0
- package/dist/capabilities/authorizedSecurityCapability.js.map +1 -0
- package/dist/capabilities/autoEnhancementCapability.d.ts +98 -0
- package/dist/capabilities/autoEnhancementCapability.d.ts.map +1 -0
- package/dist/capabilities/autoEnhancementCapability.js +455 -0
- package/dist/capabilities/autoEnhancementCapability.js.map +1 -0
- package/dist/capabilities/baseCapability.d.ts +72 -0
- package/dist/capabilities/baseCapability.d.ts.map +1 -0
- package/dist/capabilities/baseCapability.js +183 -0
- package/dist/capabilities/baseCapability.js.map +1 -0
- package/dist/capabilities/bashCapability.d.ts +13 -0
- package/dist/capabilities/bashCapability.d.ts.map +1 -0
- package/dist/capabilities/bashCapability.js +24 -0
- package/dist/capabilities/bashCapability.js.map +1 -0
- package/dist/capabilities/biocognitiveWarfare.d.ts +136 -0
- package/dist/capabilities/biocognitiveWarfare.d.ts.map +1 -0
- package/dist/capabilities/biocognitiveWarfare.js +603 -0
- package/dist/capabilities/biocognitiveWarfare.js.map +1 -0
- package/dist/capabilities/chineseCnoIntegration.d.ts +60 -0
- package/dist/capabilities/chineseCnoIntegration.d.ts.map +1 -0
- package/dist/capabilities/chineseCnoIntegration.js +253 -0
- package/dist/capabilities/chineseCnoIntegration.js.map +1 -0
- package/dist/capabilities/cnoCapability.d.ts +110 -0
- package/dist/capabilities/cnoCapability.d.ts.map +1 -0
- package/dist/capabilities/cnoCapability.js +785 -0
- package/dist/capabilities/cnoCapability.js.map +1 -0
- package/dist/capabilities/editCapability.d.ts +17 -0
- package/dist/capabilities/editCapability.d.ts.map +1 -0
- package/dist/capabilities/editCapability.js +27 -0
- package/dist/capabilities/editCapability.js.map +1 -0
- package/dist/capabilities/eliteCryptoMilitaryCapability.d.ts +99 -0
- package/dist/capabilities/eliteCryptoMilitaryCapability.d.ts.map +1 -0
- package/dist/capabilities/eliteCryptoMilitaryCapability.js +618 -0
- package/dist/capabilities/eliteCryptoMilitaryCapability.js.map +1 -0
- package/dist/capabilities/enhancedGitCapability.d.ts +7 -0
- package/dist/capabilities/enhancedGitCapability.d.ts.map +1 -0
- package/dist/capabilities/enhancedGitCapability.js +220 -0
- package/dist/capabilities/enhancedGitCapability.js.map +1 -0
- package/dist/capabilities/filesystemCapability.d.ts +13 -0
- package/dist/capabilities/filesystemCapability.d.ts.map +1 -0
- package/dist/capabilities/filesystemCapability.js +24 -0
- package/dist/capabilities/filesystemCapability.js.map +1 -0
- package/dist/capabilities/gitHistoryCapability.d.ts +6 -0
- package/dist/capabilities/gitHistoryCapability.d.ts.map +1 -0
- package/dist/capabilities/gitHistoryCapability.js +160 -0
- package/dist/capabilities/gitHistoryCapability.js.map +1 -0
- package/dist/capabilities/index.d.ts +26 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +26 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/integratedUnifiedCapability.d.ts +105 -0
- package/dist/capabilities/integratedUnifiedCapability.d.ts.map +1 -0
- package/dist/capabilities/integratedUnifiedCapability.js +422 -0
- package/dist/capabilities/integratedUnifiedCapability.js.map +1 -0
- package/dist/capabilities/maxOffensiveUkraineCapability.d.ts +46 -0
- package/dist/capabilities/maxOffensiveUkraineCapability.d.ts.map +1 -0
- package/dist/capabilities/maxOffensiveUkraineCapability.js +725 -0
- package/dist/capabilities/maxOffensiveUkraineCapability.js.map +1 -0
- package/dist/capabilities/migrationUtilities.d.ts +128 -0
- package/dist/capabilities/migrationUtilities.d.ts.map +1 -0
- package/dist/capabilities/migrationUtilities.js +658 -0
- package/dist/capabilities/migrationUtilities.js.map +1 -0
- package/dist/capabilities/offensiveDestructionCapability.d.ts +98 -0
- package/dist/capabilities/offensiveDestructionCapability.d.ts.map +1 -0
- package/dist/capabilities/offensiveDestructionCapability.js +848 -0
- package/dist/capabilities/offensiveDestructionCapability.js.map +1 -0
- package/dist/capabilities/quantumSpaceWarfare.d.ts +108 -0
- package/dist/capabilities/quantumSpaceWarfare.d.ts.map +1 -0
- package/dist/capabilities/quantumSpaceWarfare.js +342 -0
- package/dist/capabilities/quantumSpaceWarfare.js.map +1 -0
- package/dist/capabilities/readmeIntegration.d.ts +161 -0
- package/dist/capabilities/readmeIntegration.d.ts.map +1 -0
- package/dist/capabilities/readmeIntegration.js +1034 -0
- package/dist/capabilities/readmeIntegration.js.map +1 -0
- package/dist/capabilities/searchCapability.d.ts +19 -0
- package/dist/capabilities/searchCapability.d.ts.map +1 -0
- package/dist/capabilities/searchCapability.js +29 -0
- package/dist/capabilities/searchCapability.js.map +1 -0
- package/dist/capabilities/selfUpdateSystem.d.ts +122 -0
- package/dist/capabilities/selfUpdateSystem.d.ts.map +1 -0
- package/dist/capabilities/selfUpdateSystem.js +725 -0
- package/dist/capabilities/selfUpdateSystem.js.map +1 -0
- package/dist/capabilities/sharedMilitaryInfrastructure.d.ts +89 -0
- package/dist/capabilities/sharedMilitaryInfrastructure.d.ts.map +1 -0
- package/dist/capabilities/sharedMilitaryInfrastructure.js +233 -0
- package/dist/capabilities/sharedMilitaryInfrastructure.js.map +1 -0
- package/dist/capabilities/simpleSecurityCapability.d.ts +36 -0
- package/dist/capabilities/simpleSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/simpleSecurityCapability.js +271 -0
- package/dist/capabilities/simpleSecurityCapability.js.map +1 -0
- package/dist/capabilities/toolManifest.d.ts +3 -0
- package/dist/capabilities/toolManifest.d.ts.map +1 -0
- package/dist/capabilities/toolManifest.js +163 -0
- package/dist/capabilities/toolManifest.js.map +1 -0
- package/dist/capabilities/toolRegistry.d.ts +25 -0
- package/dist/capabilities/toolRegistry.d.ts.map +1 -0
- package/dist/capabilities/toolRegistry.js +150 -0
- package/dist/capabilities/toolRegistry.js.map +1 -0
- package/dist/capabilities/ultimateChineseCno.d.ts +115 -0
- package/dist/capabilities/ultimateChineseCno.d.ts.map +1 -0
- package/dist/capabilities/ultimateChineseCno.js +516 -0
- package/dist/capabilities/ultimateChineseCno.js.map +1 -0
- package/dist/capabilities/ultimateIntegrationDemo.d.ts +54 -0
- package/dist/capabilities/ultimateIntegrationDemo.d.ts.map +1 -0
- package/dist/capabilities/ultimateIntegrationDemo.js +423 -0
- package/dist/capabilities/ultimateIntegrationDemo.js.map +1 -0
- package/dist/capabilities/unifiedMilitaryCapability.d.ts +63 -0
- package/dist/capabilities/unifiedMilitaryCapability.d.ts.map +1 -0
- package/dist/capabilities/unifiedMilitaryCapability.js +384 -0
- package/dist/capabilities/unifiedMilitaryCapability.js.map +1 -0
- package/dist/capabilities/universalCapabilityFramework.d.ts +352 -0
- package/dist/capabilities/universalCapabilityFramework.d.ts.map +1 -0
- package/dist/capabilities/universalCapabilityFramework.js +1056 -0
- package/dist/capabilities/universalCapabilityFramework.js.map +1 -0
- package/dist/capabilities/universalSecurityCapability.d.ts +46 -0
- package/dist/capabilities/universalSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/universalSecurityCapability.js +580 -0
- package/dist/capabilities/universalSecurityCapability.js.map +1 -0
- package/dist/capabilities/webCapability.d.ts +23 -0
- package/dist/capabilities/webCapability.d.ts.map +1 -0
- package/dist/capabilities/webCapability.js +33 -0
- package/dist/capabilities/webCapability.js.map +1 -0
- package/dist/capabilities/zeroDayDiscoveryCapability.d.ts +31 -0
- package/dist/capabilities/zeroDayDiscoveryCapability.d.ts.map +1 -0
- package/dist/capabilities/zeroDayDiscoveryCapability.js +183 -0
- package/dist/capabilities/zeroDayDiscoveryCapability.js.map +1 -0
- package/dist/config.d.ts +25 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +155 -0
- package/dist/config.js.map +1 -0
- package/dist/contracts/agent-profiles.schema.json +43 -0
- package/dist/contracts/agent-schemas.json +466 -0
- package/dist/contracts/models.schema.json +9 -0
- package/dist/contracts/module-schema.json +430 -0
- package/dist/contracts/schemas/agent-profile.schema.json +157 -0
- package/dist/contracts/schemas/agent-rules.schema.json +238 -0
- package/dist/contracts/schemas/agent-schemas.schema.json +528 -0
- package/dist/contracts/schemas/agent.schema.json +90 -0
- package/dist/contracts/schemas/tool-selection.schema.json +174 -0
- package/dist/contracts/tools.schema.json +82 -0
- package/dist/contracts/unified-schema.json +757 -0
- package/dist/contracts/v1/agent.d.ts +179 -0
- package/dist/contracts/v1/agent.d.ts.map +1 -0
- package/dist/contracts/v1/agent.js +8 -0
- package/dist/contracts/v1/agent.js.map +1 -0
- package/dist/contracts/v1/agentProfileManifest.d.ts +60 -0
- package/dist/contracts/v1/agentProfileManifest.d.ts.map +1 -0
- package/dist/contracts/v1/agentProfileManifest.js +9 -0
- package/dist/contracts/v1/agentProfileManifest.js.map +1 -0
- package/dist/contracts/v1/agentRules.d.ts +60 -0
- package/dist/contracts/v1/agentRules.d.ts.map +1 -0
- package/dist/contracts/v1/agentRules.js +10 -0
- package/dist/contracts/v1/agentRules.js.map +1 -0
- package/dist/contracts/v1/provider.d.ts +149 -0
- package/dist/contracts/v1/provider.d.ts.map +1 -0
- package/dist/contracts/v1/provider.js +7 -0
- package/dist/contracts/v1/provider.js.map +1 -0
- package/dist/contracts/v1/tool.d.ts +136 -0
- package/dist/contracts/v1/tool.d.ts.map +1 -0
- package/dist/contracts/v1/tool.js +7 -0
- package/dist/contracts/v1/tool.js.map +1 -0
- package/dist/contracts/v1/toolAccess.d.ts +43 -0
- package/dist/contracts/v1/toolAccess.d.ts.map +1 -0
- package/dist/contracts/v1/toolAccess.js +9 -0
- package/dist/contracts/v1/toolAccess.js.map +1 -0
- package/dist/core/agent.d.ts +287 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +1563 -0
- package/dist/core/agent.js.map +1 -0
- package/dist/core/agentProfileManifest.d.ts +3 -0
- package/dist/core/agentProfileManifest.d.ts.map +1 -0
- package/dist/core/agentProfileManifest.js +188 -0
- package/dist/core/agentProfileManifest.js.map +1 -0
- package/dist/core/agentProfiles.d.ts +22 -0
- package/dist/core/agentProfiles.d.ts.map +1 -0
- package/dist/core/agentProfiles.js +35 -0
- package/dist/core/agentProfiles.js.map +1 -0
- package/dist/core/agentRulebook.d.ts +11 -0
- package/dist/core/agentRulebook.d.ts.map +1 -0
- package/dist/core/agentRulebook.js +136 -0
- package/dist/core/agentRulebook.js.map +1 -0
- package/dist/core/agentSchemaLoader.d.ts +131 -0
- package/dist/core/agentSchemaLoader.d.ts.map +1 -0
- package/dist/core/agentSchemaLoader.js +235 -0
- package/dist/core/agentSchemaLoader.js.map +1 -0
- package/dist/core/agiCore.d.ts +290 -0
- package/dist/core/agiCore.d.ts.map +1 -0
- package/dist/core/agiCore.js +1348 -0
- package/dist/core/agiCore.js.map +1 -0
- package/dist/core/aiErrorFixer.d.ts +57 -0
- package/dist/core/aiErrorFixer.d.ts.map +1 -0
- package/dist/core/aiErrorFixer.js +214 -0
- package/dist/core/aiErrorFixer.js.map +1 -0
- package/dist/core/antiTermination.d.ts +226 -0
- package/dist/core/antiTermination.d.ts.map +1 -0
- package/dist/core/antiTermination.js +713 -0
- package/dist/core/antiTermination.js.map +1 -0
- package/dist/core/appleSecurityAudit.d.ts +98 -0
- package/dist/core/appleSecurityAudit.d.ts.map +1 -0
- package/dist/core/appleSecurityAudit.js +505 -0
- package/dist/core/appleSecurityAudit.js.map +1 -0
- package/dist/core/appleSecurityIntegration.d.ts +130 -0
- package/dist/core/appleSecurityIntegration.d.ts.map +1 -0
- package/dist/core/appleSecurityIntegration.js +697 -0
- package/dist/core/appleSecurityIntegration.js.map +1 -0
- package/dist/core/bashCommandGuidance.d.ts +16 -0
- package/dist/core/bashCommandGuidance.d.ts.map +1 -0
- package/dist/core/bashCommandGuidance.js +40 -0
- package/dist/core/bashCommandGuidance.js.map +1 -0
- package/dist/core/constants.d.ts +31 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +62 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/contextManager.d.ts +271 -0
- package/dist/core/contextManager.d.ts.map +1 -0
- package/dist/core/contextManager.js +1073 -0
- package/dist/core/contextManager.js.map +1 -0
- package/dist/core/contextWindow.d.ts +42 -0
- package/dist/core/contextWindow.d.ts.map +1 -0
- package/dist/core/contextWindow.js +123 -0
- package/dist/core/contextWindow.js.map +1 -0
- package/dist/core/customCommands.d.ts +19 -0
- package/dist/core/customCommands.d.ts.map +1 -0
- package/dist/core/customCommands.js +85 -0
- package/dist/core/customCommands.js.map +1 -0
- package/dist/core/deepBugAnalyzer.d.ts +25 -0
- package/dist/core/deepBugAnalyzer.d.ts.map +1 -0
- package/dist/core/deepBugAnalyzer.js +44 -0
- package/dist/core/deepBugAnalyzer.js.map +1 -0
- package/dist/core/dualTournament.d.ts +110 -0
- package/dist/core/dualTournament.d.ts.map +1 -0
- package/dist/core/dualTournament.js +270 -0
- package/dist/core/dualTournament.js.map +1 -0
- package/dist/core/dynamicGuardrails.d.ts +207 -0
- package/dist/core/dynamicGuardrails.d.ts.map +1 -0
- package/dist/core/dynamicGuardrails.js +516 -0
- package/dist/core/dynamicGuardrails.js.map +1 -0
- package/dist/core/embeddingProviders.d.ts +80 -0
- package/dist/core/embeddingProviders.d.ts.map +1 -0
- package/dist/core/embeddingProviders.js +241 -0
- package/dist/core/embeddingProviders.js.map +1 -0
- package/dist/core/episodicMemory.d.ts +259 -0
- package/dist/core/episodicMemory.d.ts.map +1 -0
- package/dist/core/episodicMemory.js +833 -0
- package/dist/core/episodicMemory.js.map +1 -0
- package/dist/core/errors/apiKeyErrors.d.ts +11 -0
- package/dist/core/errors/apiKeyErrors.d.ts.map +1 -0
- package/dist/core/errors/apiKeyErrors.js +159 -0
- package/dist/core/errors/apiKeyErrors.js.map +1 -0
- package/dist/core/errors/errorTypes.d.ts +111 -0
- package/dist/core/errors/errorTypes.d.ts.map +1 -0
- package/dist/core/errors/errorTypes.js +345 -0
- package/dist/core/errors/errorTypes.js.map +1 -0
- package/dist/core/errors/index.d.ts +50 -0
- package/dist/core/errors/index.d.ts.map +1 -0
- package/dist/core/errors/index.js +156 -0
- package/dist/core/errors/index.js.map +1 -0
- package/dist/core/errors/networkErrors.d.ts +14 -0
- package/dist/core/errors/networkErrors.d.ts.map +1 -0
- package/dist/core/errors/networkErrors.js +53 -0
- package/dist/core/errors/networkErrors.js.map +1 -0
- package/dist/core/errors/safetyValidator.d.ts +115 -0
- package/dist/core/errors/safetyValidator.d.ts.map +1 -0
- package/dist/core/errors/safetyValidator.js +302 -0
- package/dist/core/errors/safetyValidator.js.map +1 -0
- package/dist/core/errors.d.ts +4 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +33 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/finalResponseFormatter.d.ts +10 -0
- package/dist/core/finalResponseFormatter.d.ts.map +1 -0
- package/dist/core/finalResponseFormatter.js +14 -0
- package/dist/core/finalResponseFormatter.js.map +1 -0
- package/dist/core/flowProtection.d.ts +154 -0
- package/dist/core/flowProtection.d.ts.map +1 -0
- package/dist/core/flowProtection.js +436 -0
- package/dist/core/flowProtection.js.map +1 -0
- package/dist/core/gitWorktreeManager.d.ts +126 -0
- package/dist/core/gitWorktreeManager.d.ts.map +1 -0
- package/dist/core/gitWorktreeManager.js +403 -0
- package/dist/core/gitWorktreeManager.js.map +1 -0
- package/dist/core/guardrails.d.ts +150 -0
- package/dist/core/guardrails.d.ts.map +1 -0
- package/dist/core/guardrails.js +360 -0
- package/dist/core/guardrails.js.map +1 -0
- package/dist/core/hallucinationGuard.d.ts +57 -0
- package/dist/core/hallucinationGuard.d.ts.map +1 -0
- package/dist/core/hallucinationGuard.js +237 -0
- package/dist/core/hallucinationGuard.js.map +1 -0
- package/dist/core/hooks.d.ts +113 -0
- package/dist/core/hooks.d.ts.map +1 -0
- package/dist/core/hooks.js +364 -0
- package/dist/core/hooks.js.map +1 -0
- package/dist/core/hotReload.d.ts +154 -0
- package/dist/core/hotReload.d.ts.map +1 -0
- package/dist/core/hotReload.js +451 -0
- package/dist/core/hotReload.js.map +1 -0
- package/dist/core/hypothesisEngine.d.ts +27 -0
- package/dist/core/hypothesisEngine.d.ts.map +1 -0
- package/dist/core/hypothesisEngine.js +58 -0
- package/dist/core/hypothesisEngine.js.map +1 -0
- package/dist/core/index.d.ts +26 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +54 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/inputProtection.d.ts +122 -0
- package/dist/core/inputProtection.d.ts.map +1 -0
- package/dist/core/inputProtection.js +421 -0
- package/dist/core/inputProtection.js.map +1 -0
- package/dist/core/liveGCPVerification.d.ts +41 -0
- package/dist/core/liveGCPVerification.d.ts.map +1 -0
- package/dist/core/liveGCPVerification.js +745 -0
- package/dist/core/liveGCPVerification.js.map +1 -0
- package/dist/core/modelDiscovery.d.ts +105 -0
- package/dist/core/modelDiscovery.d.ts.map +1 -0
- package/dist/core/modelDiscovery.js +740 -0
- package/dist/core/modelDiscovery.js.map +1 -0
- package/dist/core/multilinePasteHandler.d.ts +35 -0
- package/dist/core/multilinePasteHandler.d.ts.map +1 -0
- package/dist/core/multilinePasteHandler.js +80 -0
- package/dist/core/multilinePasteHandler.js.map +1 -0
- package/dist/core/parallel.d.ts +85 -0
- package/dist/core/parallel.d.ts.map +1 -0
- package/dist/core/parallel.js +150 -0
- package/dist/core/parallel.js.map +1 -0
- package/dist/core/parallelCoordinator.d.ts +21 -0
- package/dist/core/parallelCoordinator.d.ts.map +1 -0
- package/dist/core/parallelCoordinator.js +42 -0
- package/dist/core/parallelCoordinator.js.map +1 -0
- package/dist/core/parallelExecutor.d.ts +215 -0
- package/dist/core/parallelExecutor.d.ts.map +1 -0
- package/dist/core/parallelExecutor.js +584 -0
- package/dist/core/parallelExecutor.js.map +1 -0
- package/dist/core/preferences.d.ts +71 -0
- package/dist/core/preferences.d.ts.map +1 -0
- package/dist/core/preferences.js +341 -0
- package/dist/core/preferences.js.map +1 -0
- package/dist/core/productTestHarness.d.ts +46 -0
- package/dist/core/productTestHarness.d.ts.map +1 -0
- package/dist/core/productTestHarness.js +128 -0
- package/dist/core/productTestHarness.js.map +1 -0
- package/dist/core/providerKeys.d.ts +20 -0
- package/dist/core/providerKeys.d.ts.map +1 -0
- package/dist/core/providerKeys.js +40 -0
- package/dist/core/providerKeys.js.map +1 -0
- package/dist/core/realityScore.d.ts +159 -0
- package/dist/core/realityScore.d.ts.map +1 -0
- package/dist/core/realityScore.js +734 -0
- package/dist/core/realityScore.js.map +1 -0
- package/dist/core/repoUpgradeOrchestrator.d.ts +223 -0
- package/dist/core/repoUpgradeOrchestrator.d.ts.map +1 -0
- package/dist/core/repoUpgradeOrchestrator.js +1003 -0
- package/dist/core/repoUpgradeOrchestrator.js.map +1 -0
- package/dist/core/resultVerification.d.ts +47 -0
- package/dist/core/resultVerification.d.ts.map +1 -0
- package/dist/core/resultVerification.js +126 -0
- package/dist/core/resultVerification.js.map +1 -0
- package/dist/core/revenueEnvValidator.d.ts +30 -0
- package/dist/core/revenueEnvValidator.d.ts.map +1 -0
- package/dist/core/revenueEnvValidator.js +241 -0
- package/dist/core/revenueEnvValidator.js.map +1 -0
- package/dist/core/schemaValidator.d.ts +49 -0
- package/dist/core/schemaValidator.d.ts.map +1 -0
- package/dist/core/schemaValidator.js +234 -0
- package/dist/core/schemaValidator.js.map +1 -0
- package/dist/core/secretStore.d.ts +48 -0
- package/dist/core/secretStore.d.ts.map +1 -0
- package/dist/core/secretStore.js +295 -0
- package/dist/core/secretStore.js.map +1 -0
- package/dist/core/securityTournament.d.ts +83 -0
- package/dist/core/securityTournament.d.ts.map +1 -0
- package/dist/core/securityTournament.js +357 -0
- package/dist/core/securityTournament.js.map +1 -0
- package/dist/core/selfUpgrade.d.ts +253 -0
- package/dist/core/selfUpgrade.d.ts.map +1 -0
- package/dist/core/selfUpgrade.js +669 -0
- package/dist/core/selfUpgrade.js.map +1 -0
- package/dist/core/sessionStorage.d.ts +10 -0
- package/dist/core/sessionStorage.d.ts.map +1 -0
- package/dist/core/sessionStorage.js +46 -0
- package/dist/core/sessionStorage.js.map +1 -0
- package/dist/core/sessionStore.d.ts +35 -0
- package/dist/core/sessionStore.d.ts.map +1 -0
- package/dist/core/sessionStore.js +191 -0
- package/dist/core/sessionStore.js.map +1 -0
- package/dist/core/taskCompletionDetector.d.ts +112 -0
- package/dist/core/taskCompletionDetector.d.ts.map +1 -0
- package/dist/core/taskCompletionDetector.js +469 -0
- package/dist/core/taskCompletionDetector.js.map +1 -0
- package/dist/core/toolPreconditions.d.ts +34 -0
- package/dist/core/toolPreconditions.d.ts.map +1 -0
- package/dist/core/toolPreconditions.js +242 -0
- package/dist/core/toolPreconditions.js.map +1 -0
- package/dist/core/toolRuntime.d.ts +185 -0
- package/dist/core/toolRuntime.d.ts.map +1 -0
- package/dist/core/toolRuntime.js +412 -0
- package/dist/core/toolRuntime.js.map +1 -0
- package/dist/core/tournamentStrategy.d.ts +12 -0
- package/dist/core/tournamentStrategy.d.ts.map +1 -0
- package/dist/core/tournamentStrategy.js +41 -0
- package/dist/core/tournamentStrategy.js.map +1 -0
- package/dist/core/types/utilityTypes.d.ts +192 -0
- package/dist/core/types/utilityTypes.d.ts.map +1 -0
- package/dist/core/types/utilityTypes.js +272 -0
- package/dist/core/types/utilityTypes.js.map +1 -0
- package/dist/core/types.d.ts +334 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +76 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/unifiedOrchestrator.d.ts +47 -0
- package/dist/core/unifiedOrchestrator.d.ts.map +1 -0
- package/dist/core/unifiedOrchestrator.js +103 -0
- package/dist/core/unifiedOrchestrator.js.map +1 -0
- package/dist/core/universalSecurityAudit.d.ts +104 -0
- package/dist/core/universalSecurityAudit.d.ts.map +1 -0
- package/dist/core/universalSecurityAudit.js +2190 -0
- package/dist/core/universalSecurityAudit.js.map +1 -0
- package/dist/core/updateChecker.d.ts +148 -0
- package/dist/core/updateChecker.d.ts.map +1 -0
- package/dist/core/updateChecker.js +593 -0
- package/dist/core/updateChecker.js.map +1 -0
- package/dist/core/variantExecution.d.ts +23 -0
- package/dist/core/variantExecution.d.ts.map +1 -0
- package/dist/core/variantExecution.js +58 -0
- package/dist/core/variantExecution.js.map +1 -0
- package/dist/core/winnerStrategy.d.ts +15 -0
- package/dist/core/winnerStrategy.d.ts.map +1 -0
- package/dist/core/winnerStrategy.js +18 -0
- package/dist/core/winnerStrategy.js.map +1 -0
- package/dist/core/zeroDayDiscovery.d.ts +96 -0
- package/dist/core/zeroDayDiscovery.d.ts.map +1 -0
- package/dist/core/zeroDayDiscovery.js +358 -0
- package/dist/core/zeroDayDiscovery.js.map +1 -0
- package/dist/headless/interactiveShell.d.ts +22 -0
- package/dist/headless/interactiveShell.d.ts.map +1 -0
- package/dist/headless/interactiveShell.js +3799 -0
- package/dist/headless/interactiveShell.js.map +1 -0
- package/dist/headless/quickMode.d.ts +26 -0
- package/dist/headless/quickMode.d.ts.map +1 -0
- package/dist/headless/quickMode.js +226 -0
- package/dist/headless/quickMode.js.map +1 -0
- package/dist/orchestration/index.d.ts +10 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +13 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/repoUpgradeRunner.d.ts +44 -0
- package/dist/orchestration/repoUpgradeRunner.d.ts.map +1 -0
- package/dist/orchestration/repoUpgradeRunner.js +375 -0
- package/dist/orchestration/repoUpgradeRunner.js.map +1 -0
- package/dist/orchestration/securityAuditRunner.d.ts +144 -0
- package/dist/orchestration/securityAuditRunner.d.ts.map +1 -0
- package/dist/orchestration/securityAuditRunner.js +526 -0
- package/dist/orchestration/securityAuditRunner.js.map +1 -0
- package/dist/plugins/index.d.ts +49 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +105 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/providers/deepseek/index.d.ts +11 -0
- package/dist/plugins/providers/deepseek/index.d.ts.map +1 -0
- package/dist/plugins/providers/deepseek/index.js +54 -0
- package/dist/plugins/providers/deepseek/index.js.map +1 -0
- package/dist/plugins/providers/index.d.ts +2 -0
- package/dist/plugins/providers/index.d.ts.map +1 -0
- package/dist/plugins/providers/index.js +11 -0
- package/dist/plugins/providers/index.js.map +1 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts +3 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js +27 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js.map +1 -0
- package/dist/plugins/tools/apple/secureApplePlugin.d.ts +3 -0
- package/dist/plugins/tools/apple/secureApplePlugin.d.ts.map +1 -0
- package/dist/plugins/tools/apple/secureApplePlugin.js +26 -0
- package/dist/plugins/tools/apple/secureApplePlugin.js.map +1 -0
- package/dist/plugins/tools/authorizedSecurity/authorizedSecurityPlugin.d.ts +3 -0
- package/dist/plugins/tools/authorizedSecurity/authorizedSecurityPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/authorizedSecurity/authorizedSecurityPlugin.js +9 -0
- package/dist/plugins/tools/authorizedSecurity/authorizedSecurityPlugin.js.map +1 -0
- package/dist/plugins/tools/bash/localBashPlugin.d.ts +3 -0
- package/dist/plugins/tools/bash/localBashPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/bash/localBashPlugin.js +14 -0
- package/dist/plugins/tools/bash/localBashPlugin.js.map +1 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts +3 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js +27 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js.map +1 -0
- package/dist/plugins/tools/edit/editPlugin.d.ts +9 -0
- package/dist/plugins/tools/edit/editPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/edit/editPlugin.js +15 -0
- package/dist/plugins/tools/edit/editPlugin.js.map +1 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts +3 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js +9 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js.map +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts +3 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js +14 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js.map +1 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.d.ts +3 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.js +9 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.js.map +1 -0
- package/dist/plugins/tools/index.d.ts +3 -0
- package/dist/plugins/tools/index.d.ts.map +1 -0
- package/dist/plugins/tools/index.js +3 -0
- package/dist/plugins/tools/index.js.map +1 -0
- package/dist/plugins/tools/integrity/integrityPlugin.d.ts +3 -0
- package/dist/plugins/tools/integrity/integrityPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/integrity/integrityPlugin.js +31 -0
- package/dist/plugins/tools/integrity/integrityPlugin.js.map +1 -0
- package/dist/plugins/tools/mcp/mcpPlugin.d.ts +3 -0
- package/dist/plugins/tools/mcp/mcpPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/mcp/mcpPlugin.js +27 -0
- package/dist/plugins/tools/mcp/mcpPlugin.js.map +1 -0
- package/dist/plugins/tools/nodeDefaults.d.ts +15 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -0
- package/dist/plugins/tools/nodeDefaults.js +37 -0
- package/dist/plugins/tools/nodeDefaults.js.map +1 -0
- package/dist/plugins/tools/offensiveDestruction/offensiveDestructionPlugin.d.ts +3 -0
- package/dist/plugins/tools/offensiveDestruction/offensiveDestructionPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/offensiveDestruction/offensiveDestructionPlugin.js +9 -0
- package/dist/plugins/tools/offensiveDestruction/offensiveDestructionPlugin.js.map +1 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts +3 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js +340 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js.map +1 -0
- package/dist/plugins/tools/registry.d.ts +22 -0
- package/dist/plugins/tools/registry.d.ts.map +1 -0
- package/dist/plugins/tools/registry.js +58 -0
- package/dist/plugins/tools/registry.js.map +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.d.ts +3 -0
- package/dist/plugins/tools/search/localSearchPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.js +14 -0
- package/dist/plugins/tools/search/localSearchPlugin.js.map +1 -0
- package/dist/plugins/tools/skills/skillPlugin.d.ts +3 -0
- package/dist/plugins/tools/skills/skillPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/skills/skillPlugin.js +27 -0
- package/dist/plugins/tools/skills/skillPlugin.js.map +1 -0
- package/dist/plugins/tools/tao/secureTaoPlugin.d.ts +3 -0
- package/dist/plugins/tools/tao/secureTaoPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/tao/secureTaoPlugin.js +37 -0
- package/dist/plugins/tools/tao/secureTaoPlugin.js.map +1 -0
- package/dist/providers/baseProvider.d.ts +148 -0
- package/dist/providers/baseProvider.d.ts.map +1 -0
- package/dist/providers/baseProvider.js +284 -0
- package/dist/providers/baseProvider.js.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts +64 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.js +1000 -0
- package/dist/providers/openaiChatCompletionsProvider.js.map +1 -0
- package/dist/providers/providerFactory.d.ts +22 -0
- package/dist/providers/providerFactory.d.ts.map +1 -0
- package/dist/providers/providerFactory.js +25 -0
- package/dist/providers/providerFactory.js.map +1 -0
- package/dist/providers/resilientProvider.d.ts +103 -0
- package/dist/providers/resilientProvider.d.ts.map +1 -0
- package/dist/providers/resilientProvider.js +462 -0
- package/dist/providers/resilientProvider.js.map +1 -0
- package/dist/runtime/agentController.d.ts +114 -0
- package/dist/runtime/agentController.d.ts.map +1 -0
- package/dist/runtime/agentController.js +693 -0
- package/dist/runtime/agentController.js.map +1 -0
- package/dist/runtime/agentHost.d.ts +61 -0
- package/dist/runtime/agentHost.d.ts.map +1 -0
- package/dist/runtime/agentHost.js +157 -0
- package/dist/runtime/agentHost.js.map +1 -0
- package/dist/runtime/agentSession.d.ts +45 -0
- package/dist/runtime/agentSession.d.ts.map +1 -0
- package/dist/runtime/agentSession.js +210 -0
- package/dist/runtime/agentSession.js.map +1 -0
- package/dist/runtime/agentWorkerPool.d.ts +167 -0
- package/dist/runtime/agentWorkerPool.d.ts.map +1 -0
- package/dist/runtime/agentWorkerPool.js +435 -0
- package/dist/runtime/agentWorkerPool.js.map +1 -0
- package/dist/runtime/node.d.ts +7 -0
- package/dist/runtime/node.d.ts.map +1 -0
- package/dist/runtime/node.js +24 -0
- package/dist/runtime/node.js.map +1 -0
- package/dist/runtime/universal.d.ts +18 -0
- package/dist/runtime/universal.d.ts.map +1 -0
- package/dist/runtime/universal.js +21 -0
- package/dist/runtime/universal.js.map +1 -0
- package/dist/shell/autoExecutor.d.ts +70 -0
- package/dist/shell/autoExecutor.d.ts.map +1 -0
- package/dist/shell/autoExecutor.js +320 -0
- package/dist/shell/autoExecutor.js.map +1 -0
- package/dist/shell/commandRegistry.d.ts +122 -0
- package/dist/shell/commandRegistry.d.ts.map +1 -0
- package/dist/shell/commandRegistry.js +386 -0
- package/dist/shell/commandRegistry.js.map +1 -0
- package/dist/shell/composableMessage.d.ts +183 -0
- package/dist/shell/composableMessage.d.ts.map +1 -0
- package/dist/shell/composableMessage.js +420 -0
- package/dist/shell/composableMessage.js.map +1 -0
- package/dist/shell/liveStatus.d.ts +27 -0
- package/dist/shell/liveStatus.d.ts.map +1 -0
- package/dist/shell/liveStatus.js +53 -0
- package/dist/shell/liveStatus.js.map +1 -0
- package/dist/shell/systemPrompt.d.ts +12 -0
- package/dist/shell/systemPrompt.d.ts.map +1 -0
- package/dist/shell/systemPrompt.js +16 -0
- package/dist/shell/systemPrompt.js.map +1 -0
- package/dist/shell/vimMode.d.ts +66 -0
- package/dist/shell/vimMode.d.ts.map +1 -0
- package/dist/shell/vimMode.js +435 -0
- package/dist/shell/vimMode.js.map +1 -0
- package/dist/tools/bashTools.d.ts +6 -0
- package/dist/tools/bashTools.d.ts.map +1 -0
- package/dist/tools/bashTools.js +485 -0
- package/dist/tools/bashTools.js.map +1 -0
- package/dist/tools/diffUtils.d.ts +43 -0
- package/dist/tools/diffUtils.d.ts.map +1 -0
- package/dist/tools/diffUtils.js +607 -0
- package/dist/tools/diffUtils.js.map +1 -0
- package/dist/tools/editTools.d.ts +29 -0
- package/dist/tools/editTools.d.ts.map +1 -0
- package/dist/tools/editTools.js +702 -0
- package/dist/tools/editTools.js.map +1 -0
- package/dist/tools/emailTools.d.ts +140 -0
- package/dist/tools/emailTools.d.ts.map +1 -0
- package/dist/tools/emailTools.js +792 -0
- package/dist/tools/emailTools.js.map +1 -0
- package/dist/tools/fileReadTracker.d.ts +69 -0
- package/dist/tools/fileReadTracker.d.ts.map +1 -0
- package/dist/tools/fileReadTracker.js +213 -0
- package/dist/tools/fileReadTracker.js.map +1 -0
- package/dist/tools/fileTools.d.ts +3 -0
- package/dist/tools/fileTools.d.ts.map +1 -0
- package/dist/tools/fileTools.js +342 -0
- package/dist/tools/fileTools.js.map +1 -0
- package/dist/tools/grepTools.d.ts +3 -0
- package/dist/tools/grepTools.d.ts.map +1 -0
- package/dist/tools/grepTools.js +129 -0
- package/dist/tools/grepTools.js.map +1 -0
- package/dist/tools/humanOpsTools.d.ts +3 -0
- package/dist/tools/humanOpsTools.d.ts.map +1 -0
- package/dist/tools/humanOpsTools.js +86 -0
- package/dist/tools/humanOpsTools.js.map +1 -0
- package/dist/tools/localExplore.d.ts +38 -0
- package/dist/tools/localExplore.d.ts.map +1 -0
- package/dist/tools/localExplore.js +30 -0
- package/dist/tools/localExplore.js.map +1 -0
- package/dist/tools/metaTools.d.ts +3 -0
- package/dist/tools/metaTools.d.ts.map +1 -0
- package/dist/tools/metaTools.js +148 -0
- package/dist/tools/metaTools.js.map +1 -0
- package/dist/tools/planningTools.d.ts +12 -0
- package/dist/tools/planningTools.d.ts.map +1 -0
- package/dist/tools/planningTools.js +75 -0
- package/dist/tools/planningTools.js.map +1 -0
- package/dist/tools/searchTools.d.ts +12 -0
- package/dist/tools/searchTools.d.ts.map +1 -0
- package/dist/tools/searchTools.js +370 -0
- package/dist/tools/searchTools.js.map +1 -0
- package/dist/tools/secureAppleExploitation.d.ts +29 -0
- package/dist/tools/secureAppleExploitation.d.ts.map +1 -0
- package/dist/tools/secureAppleExploitation.js +518 -0
- package/dist/tools/secureAppleExploitation.js.map +1 -0
- package/dist/tools/telemetryTools.d.ts +5 -0
- package/dist/tools/telemetryTools.d.ts.map +1 -0
- package/dist/tools/telemetryTools.js +9 -0
- package/dist/tools/telemetryTools.js.map +1 -0
- package/dist/tools/unifiedOps.d.ts +3 -0
- package/dist/tools/unifiedOps.d.ts.map +1 -0
- package/dist/tools/unifiedOps.js +57 -0
- package/dist/tools/unifiedOps.js.map +1 -0
- package/dist/tools/webTools.d.ts +26 -0
- package/dist/tools/webTools.d.ts.map +1 -0
- package/dist/tools/webTools.js +227 -0
- package/dist/tools/webTools.js.map +1 -0
- package/dist/ui/PromptController.d.ts +174 -0
- package/dist/ui/PromptController.d.ts.map +1 -0
- package/dist/ui/PromptController.js +351 -0
- package/dist/ui/PromptController.js.map +1 -0
- package/dist/ui/UnifiedUIRenderer.d.ts +779 -0
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -0
- package/dist/ui/UnifiedUIRenderer.js +5458 -0
- package/dist/ui/UnifiedUIRenderer.js.map +1 -0
- package/dist/ui/animatedStatus.d.ts +140 -0
- package/dist/ui/animatedStatus.d.ts.map +1 -0
- package/dist/ui/animatedStatus.js +480 -0
- package/dist/ui/animatedStatus.js.map +1 -0
- package/dist/ui/animation/AnimationScheduler.d.ts +197 -0
- package/dist/ui/animation/AnimationScheduler.d.ts.map +1 -0
- package/dist/ui/animation/AnimationScheduler.js +440 -0
- package/dist/ui/animation/AnimationScheduler.js.map +1 -0
- package/dist/ui/codeHighlighter.d.ts +6 -0
- package/dist/ui/codeHighlighter.d.ts.map +1 -0
- package/dist/ui/codeHighlighter.js +855 -0
- package/dist/ui/codeHighlighter.js.map +1 -0
- package/dist/ui/designSystem.d.ts +26 -0
- package/dist/ui/designSystem.d.ts.map +1 -0
- package/dist/ui/designSystem.js +114 -0
- package/dist/ui/designSystem.js.map +1 -0
- package/dist/ui/errorFormatter.d.ts +64 -0
- package/dist/ui/errorFormatter.d.ts.map +1 -0
- package/dist/ui/errorFormatter.js +316 -0
- package/dist/ui/errorFormatter.js.map +1 -0
- package/dist/ui/globalWriteLock.d.ts +63 -0
- package/dist/ui/globalWriteLock.d.ts.map +1 -0
- package/dist/ui/globalWriteLock.js +173 -0
- package/dist/ui/globalWriteLock.js.map +1 -0
- package/dist/ui/index.d.ts +32 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +54 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/interrupts/InterruptManager.d.ts +157 -0
- package/dist/ui/interrupts/InterruptManager.d.ts.map +1 -0
- package/dist/ui/interrupts/InterruptManager.js +501 -0
- package/dist/ui/interrupts/InterruptManager.js.map +1 -0
- package/dist/ui/layout.d.ts +27 -0
- package/dist/ui/layout.d.ts.map +1 -0
- package/dist/ui/layout.js +184 -0
- package/dist/ui/layout.js.map +1 -0
- package/dist/ui/maxOffensiveUkraineUI.d.ts +94 -0
- package/dist/ui/maxOffensiveUkraineUI.d.ts.map +1 -0
- package/dist/ui/maxOffensiveUkraineUI.js +316 -0
- package/dist/ui/maxOffensiveUkraineUI.js.map +1 -0
- package/dist/ui/outputMode.d.ts +44 -0
- package/dist/ui/outputMode.d.ts.map +1 -0
- package/dist/ui/outputMode.js +123 -0
- package/dist/ui/outputMode.js.map +1 -0
- package/dist/ui/overlay/OverlayManager.d.ts +105 -0
- package/dist/ui/overlay/OverlayManager.d.ts.map +1 -0
- package/dist/ui/overlay/OverlayManager.js +291 -0
- package/dist/ui/overlay/OverlayManager.js.map +1 -0
- package/dist/ui/premiumComponents.d.ts +54 -0
- package/dist/ui/premiumComponents.d.ts.map +1 -0
- package/dist/ui/premiumComponents.js +241 -0
- package/dist/ui/premiumComponents.js.map +1 -0
- package/dist/ui/richText.d.ts +13 -0
- package/dist/ui/richText.d.ts.map +1 -0
- package/dist/ui/richText.js +443 -0
- package/dist/ui/richText.js.map +1 -0
- package/dist/ui/telemetry/ResponseTracker.d.ts +22 -0
- package/dist/ui/telemetry/ResponseTracker.d.ts.map +1 -0
- package/dist/ui/telemetry/ResponseTracker.js +60 -0
- package/dist/ui/telemetry/ResponseTracker.js.map +1 -0
- package/dist/ui/telemetry/UITelemetry.d.ts +181 -0
- package/dist/ui/telemetry/UITelemetry.d.ts.map +1 -0
- package/dist/ui/telemetry/UITelemetry.js +446 -0
- package/dist/ui/telemetry/UITelemetry.js.map +1 -0
- package/dist/ui/textHighlighter.d.ts +83 -0
- package/dist/ui/textHighlighter.d.ts.map +1 -0
- package/dist/ui/textHighlighter.js +267 -0
- package/dist/ui/textHighlighter.js.map +1 -0
- package/dist/ui/theme.d.ts +364 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +471 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/toolDisplay.d.ts +221 -0
- package/dist/ui/toolDisplay.d.ts.map +1 -0
- package/dist/ui/toolDisplay.js +1654 -0
- package/dist/ui/toolDisplay.js.map +1 -0
- package/dist/ui/uiConstants.d.ts +288 -0
- package/dist/ui/uiConstants.d.ts.map +1 -0
- package/dist/ui/uiConstants.js +472 -0
- package/dist/ui/uiConstants.js.map +1 -0
- package/dist/utils/askUserPrompt.d.ts +21 -0
- package/dist/utils/askUserPrompt.d.ts.map +1 -0
- package/dist/utils/askUserPrompt.js +87 -0
- package/dist/utils/askUserPrompt.js.map +1 -0
- package/dist/utils/asyncUtils.d.ts +95 -0
- package/dist/utils/asyncUtils.d.ts.map +1 -0
- package/dist/utils/asyncUtils.js +286 -0
- package/dist/utils/asyncUtils.js.map +1 -0
- package/dist/utils/debugLogger.d.ts +6 -0
- package/dist/utils/debugLogger.d.ts.map +1 -0
- package/dist/utils/debugLogger.js +39 -0
- package/dist/utils/debugLogger.js.map +1 -0
- package/dist/utils/errorUtils.d.ts +12 -0
- package/dist/utils/errorUtils.d.ts.map +1 -0
- package/dist/utils/errorUtils.js +83 -0
- package/dist/utils/errorUtils.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +10 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +78 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/packageInfo.d.ts +14 -0
- package/dist/utils/packageInfo.d.ts.map +1 -0
- package/dist/utils/packageInfo.js +45 -0
- package/dist/utils/packageInfo.js.map +1 -0
- package/dist/utils/planFormatter.d.ts +34 -0
- package/dist/utils/planFormatter.d.ts.map +1 -0
- package/dist/utils/planFormatter.js +141 -0
- package/dist/utils/planFormatter.js.map +1 -0
- package/dist/utils/securityUtils.d.ts +132 -0
- package/dist/utils/securityUtils.d.ts.map +1 -0
- package/dist/utils/securityUtils.js +324 -0
- package/dist/utils/securityUtils.js.map +1 -0
- package/dist/workspace.d.ts +8 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +134 -0
- package/dist/workspace.js.map +1 -0
- package/dist/workspace.validator.d.ts +49 -0
- package/dist/workspace.validator.d.ts.map +1 -0
- package/dist/workspace.validator.js +215 -0
- package/dist/workspace.validator.js.map +1 -0
- package/package.json +108 -0
|
@@ -0,0 +1,669 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-Upgrade System for AGI Core
|
|
3
|
+
*
|
|
4
|
+
* Provides the ability to:
|
|
5
|
+
* 1. npm install a fresh version of the CLI
|
|
6
|
+
* 2. Launch a new CLI instance
|
|
7
|
+
* 3. Continue work seamlessly after upgrade
|
|
8
|
+
* 4. Integrate with edits, builds, tests, and RL scoring
|
|
9
|
+
*
|
|
10
|
+
* This module enables true self-improvement through version updates
|
|
11
|
+
* while maintaining session continuity.
|
|
12
|
+
*/
|
|
13
|
+
import { exec as execCallback, spawn } from 'node:child_process';
|
|
14
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync, rmSync } from 'node:fs';
|
|
15
|
+
import { homedir } from 'node:os';
|
|
16
|
+
import { join, dirname } from 'node:path';
|
|
17
|
+
import { promisify } from 'node:util';
|
|
18
|
+
import { EventEmitter } from 'node:events';
|
|
19
|
+
const execAsync = promisify(execCallback);
|
|
20
|
+
// ============================================================================
|
|
21
|
+
// CONSTANTS
|
|
22
|
+
// ============================================================================
|
|
23
|
+
const DEFAULT_PACKAGE_NAME = 'agi-core-cli';
|
|
24
|
+
const DEFAULT_TIMEOUT = 5 * 60 * 1000; // 5 minutes
|
|
25
|
+
const SESSION_STATE_FILE = join(homedir(), '.agi', 'upgrade-session.json');
|
|
26
|
+
const UPGRADE_LOG_FILE = join(homedir(), '.agi', 'upgrade-log.json');
|
|
27
|
+
const RL_CHECKPOINT_FILE = join(homedir(), '.agi', 'rl-checkpoint.json');
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// SELF-UPGRADE CLASS
|
|
30
|
+
// ============================================================================
|
|
31
|
+
export class SelfUpgrade extends EventEmitter {
|
|
32
|
+
config;
|
|
33
|
+
upgradeInProgress = false;
|
|
34
|
+
childProcess = null;
|
|
35
|
+
constructor(config = {}) {
|
|
36
|
+
super();
|
|
37
|
+
this.config = {
|
|
38
|
+
packageName: config.packageName ?? DEFAULT_PACKAGE_NAME,
|
|
39
|
+
global: config.global ?? true,
|
|
40
|
+
workingDir: config.workingDir ?? process.cwd(),
|
|
41
|
+
logger: config.logger ?? console.log,
|
|
42
|
+
timeout: config.timeout ?? DEFAULT_TIMEOUT,
|
|
43
|
+
autoRestart: config.autoRestart ?? true,
|
|
44
|
+
sessionState: config.sessionState,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
// ==========================================================================
|
|
48
|
+
// VERSION CHECKING
|
|
49
|
+
// ==========================================================================
|
|
50
|
+
/**
|
|
51
|
+
* Check for available updates
|
|
52
|
+
*/
|
|
53
|
+
async checkForUpdates() {
|
|
54
|
+
const current = await this.getCurrentVersion();
|
|
55
|
+
const latest = await this.getLatestVersion();
|
|
56
|
+
return {
|
|
57
|
+
current,
|
|
58
|
+
latest,
|
|
59
|
+
updateAvailable: this.compareVersions(latest, current) > 0,
|
|
60
|
+
releaseNotesUrl: `https://github.com/anthropics/claude-code/releases/tag/v${latest}`,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get currently installed version
|
|
65
|
+
*/
|
|
66
|
+
async getCurrentVersion() {
|
|
67
|
+
// Method 1: Try to read from global node_modules package.json
|
|
68
|
+
try {
|
|
69
|
+
const { stdout: prefix } = await execAsync('npm config get prefix', { timeout: 5000 });
|
|
70
|
+
const globalPrefix = prefix.trim();
|
|
71
|
+
const pkgJsonPath = join(globalPrefix, 'lib', 'node_modules', this.config.packageName, 'package.json');
|
|
72
|
+
if (existsSync(pkgJsonPath)) {
|
|
73
|
+
const pkgJson = JSON.parse(readFileSync(pkgJsonPath, 'utf8'));
|
|
74
|
+
if (pkgJson.version) {
|
|
75
|
+
return pkgJson.version;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// Fall through to next method
|
|
81
|
+
}
|
|
82
|
+
// Method 2: Try npm list with proper parsing
|
|
83
|
+
try {
|
|
84
|
+
const { stdout } = await execAsync(`npm list -g ${this.config.packageName} --depth=0 --json`, {
|
|
85
|
+
timeout: 10000,
|
|
86
|
+
});
|
|
87
|
+
const result = JSON.parse(stdout);
|
|
88
|
+
// Check multiple possible locations in the JSON structure
|
|
89
|
+
const version = result.dependencies?.[this.config.packageName]?.version ||
|
|
90
|
+
result.devDependencies?.[this.config.packageName]?.version ||
|
|
91
|
+
result.version;
|
|
92
|
+
if (version && version !== '0.0.0') {
|
|
93
|
+
return version;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// Fall through to next method
|
|
98
|
+
}
|
|
99
|
+
// Method 3: Try parsing npm list text output
|
|
100
|
+
try {
|
|
101
|
+
const { stdout } = await execAsync(`npm list -g ${this.config.packageName} --depth=0`, {
|
|
102
|
+
timeout: 10000,
|
|
103
|
+
});
|
|
104
|
+
// Output format: "└── agi-core-cli@1.1.44" or similar
|
|
105
|
+
const match = stdout.match(new RegExp(`${this.config.packageName}@([\\d.]+)`));
|
|
106
|
+
if (match?.[1]) {
|
|
107
|
+
return match[1];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
// Fall through
|
|
112
|
+
}
|
|
113
|
+
return '0.0.0';
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Get latest available version from npm registry
|
|
117
|
+
*/
|
|
118
|
+
async getLatestVersion() {
|
|
119
|
+
try {
|
|
120
|
+
const { stdout } = await execAsync(`npm view ${this.config.packageName} version`, {
|
|
121
|
+
timeout: 10000,
|
|
122
|
+
});
|
|
123
|
+
return stdout.trim();
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
return '0.0.0';
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Compare two semver versions
|
|
131
|
+
* Returns: 1 if v1 > v2, -1 if v1 < v2, 0 if equal
|
|
132
|
+
*/
|
|
133
|
+
compareVersions(v1, v2) {
|
|
134
|
+
const parts1 = v1.replace(/^v/, '').split('.').map(Number);
|
|
135
|
+
const parts2 = v2.replace(/^v/, '').split('.').map(Number);
|
|
136
|
+
for (let i = 0; i < Math.max(parts1.length, parts2.length); i++) {
|
|
137
|
+
const p1 = parts1[i] || 0;
|
|
138
|
+
const p2 = parts2[i] || 0;
|
|
139
|
+
if (p1 > p2)
|
|
140
|
+
return 1;
|
|
141
|
+
if (p1 < p2)
|
|
142
|
+
return -1;
|
|
143
|
+
}
|
|
144
|
+
return 0;
|
|
145
|
+
}
|
|
146
|
+
// ==========================================================================
|
|
147
|
+
// UPGRADE EXECUTION
|
|
148
|
+
// ==========================================================================
|
|
149
|
+
/**
|
|
150
|
+
* Perform npm install of fresh version
|
|
151
|
+
*/
|
|
152
|
+
async npmInstallFresh(version) {
|
|
153
|
+
if (this.upgradeInProgress) {
|
|
154
|
+
return {
|
|
155
|
+
success: false,
|
|
156
|
+
fromVersion: await this.getCurrentVersion(),
|
|
157
|
+
error: 'Upgrade already in progress',
|
|
158
|
+
restarted: false,
|
|
159
|
+
durationMs: 0,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
this.upgradeInProgress = true;
|
|
163
|
+
const startTime = Date.now();
|
|
164
|
+
const fromVersion = await this.getCurrentVersion();
|
|
165
|
+
this.emitEvent('upgrade:start', { fromVersion, targetVersion: version || 'latest' });
|
|
166
|
+
try {
|
|
167
|
+
// Save session state before upgrade
|
|
168
|
+
if (this.config.sessionState) {
|
|
169
|
+
this.saveSessionState({
|
|
170
|
+
...this.config.sessionState,
|
|
171
|
+
fromVersion,
|
|
172
|
+
toVersion: version,
|
|
173
|
+
timestamp: Date.now(),
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
// Build install command
|
|
177
|
+
const globalFlag = this.config.global ? '-g ' : '';
|
|
178
|
+
const versionSpec = version ? `@${version}` : '@latest';
|
|
179
|
+
const command = `npm install ${globalFlag}${this.config.packageName}${versionSpec}`;
|
|
180
|
+
this.config.logger(`Installing ${this.config.packageName}${versionSpec}...`);
|
|
181
|
+
this.emitEvent('upgrade:download', { command });
|
|
182
|
+
// Execute npm install
|
|
183
|
+
await execAsync(command, {
|
|
184
|
+
timeout: this.config.timeout,
|
|
185
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
186
|
+
env: {
|
|
187
|
+
...process.env,
|
|
188
|
+
npm_config_loglevel: 'warn',
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
this.emitEvent('upgrade:install', { success: true });
|
|
192
|
+
const toVersion = await this.getLatestVersion();
|
|
193
|
+
const durationMs = Date.now() - startTime;
|
|
194
|
+
// Log upgrade
|
|
195
|
+
this.logUpgrade({
|
|
196
|
+
success: true,
|
|
197
|
+
fromVersion,
|
|
198
|
+
toVersion,
|
|
199
|
+
durationMs,
|
|
200
|
+
timestamp: Date.now(),
|
|
201
|
+
});
|
|
202
|
+
this.config.logger(`Upgrade complete: ${fromVersion} -> ${toVersion}`);
|
|
203
|
+
this.emitEvent('upgrade:complete', { fromVersion, toVersion, durationMs });
|
|
204
|
+
// Auto-restart if configured
|
|
205
|
+
if (this.config.autoRestart) {
|
|
206
|
+
await this.launchNewInstance();
|
|
207
|
+
return {
|
|
208
|
+
success: true,
|
|
209
|
+
fromVersion,
|
|
210
|
+
toVersion,
|
|
211
|
+
restarted: true,
|
|
212
|
+
durationMs,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
success: true,
|
|
217
|
+
fromVersion,
|
|
218
|
+
toVersion,
|
|
219
|
+
restarted: false,
|
|
220
|
+
durationMs,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
225
|
+
this.config.logger(`Upgrade failed: ${errorMessage}`);
|
|
226
|
+
this.emitEvent('upgrade:error', { error: errorMessage });
|
|
227
|
+
return {
|
|
228
|
+
success: false,
|
|
229
|
+
fromVersion,
|
|
230
|
+
error: errorMessage,
|
|
231
|
+
restarted: false,
|
|
232
|
+
durationMs: Date.now() - startTime,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
finally {
|
|
236
|
+
this.upgradeInProgress = false;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Launch a new CLI instance and optionally continue work
|
|
241
|
+
*/
|
|
242
|
+
async launchNewInstance(resumeSession = true) {
|
|
243
|
+
try {
|
|
244
|
+
const cliPath = process.argv[1] || 'agi';
|
|
245
|
+
const args = [];
|
|
246
|
+
// Add resume flag if we have session state
|
|
247
|
+
if (resumeSession && this.hasPendingSession()) {
|
|
248
|
+
args.push('--resume');
|
|
249
|
+
}
|
|
250
|
+
// Add working directory
|
|
251
|
+
if (this.config.workingDir) {
|
|
252
|
+
args.push('--cwd', this.config.workingDir);
|
|
253
|
+
}
|
|
254
|
+
this.config.logger('Launching new CLI instance...');
|
|
255
|
+
this.emitEvent('upgrade:restart', { cliPath, args });
|
|
256
|
+
// Spawn new process
|
|
257
|
+
this.childProcess = spawn(process.execPath, [cliPath, ...args], {
|
|
258
|
+
detached: true,
|
|
259
|
+
stdio: 'inherit',
|
|
260
|
+
cwd: this.config.workingDir,
|
|
261
|
+
env: {
|
|
262
|
+
...process.env,
|
|
263
|
+
AGI_UPGRADED: 'true',
|
|
264
|
+
AGI_UPGRADE_FROM: await this.getCurrentVersion(),
|
|
265
|
+
AGI_RESUME_SESSION: resumeSession ? 'true' : 'false',
|
|
266
|
+
},
|
|
267
|
+
});
|
|
268
|
+
// Unref to allow parent to exit
|
|
269
|
+
if (this.childProcess.unref) {
|
|
270
|
+
this.childProcess.unref();
|
|
271
|
+
}
|
|
272
|
+
// Exit current process after short delay
|
|
273
|
+
setTimeout(() => {
|
|
274
|
+
process.exit(0);
|
|
275
|
+
}, 500);
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
280
|
+
this.config.logger(`Failed to launch new instance: ${errorMessage}`);
|
|
281
|
+
return false;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
// ==========================================================================
|
|
285
|
+
// SESSION MANAGEMENT
|
|
286
|
+
// ==========================================================================
|
|
287
|
+
/**
|
|
288
|
+
* Save session state for resumption after upgrade
|
|
289
|
+
*/
|
|
290
|
+
saveSessionState(state) {
|
|
291
|
+
try {
|
|
292
|
+
const dir = dirname(SESSION_STATE_FILE);
|
|
293
|
+
if (!existsSync(dir)) {
|
|
294
|
+
mkdirSync(dir, { recursive: true });
|
|
295
|
+
}
|
|
296
|
+
writeFileSync(SESSION_STATE_FILE, JSON.stringify(state, null, 2));
|
|
297
|
+
}
|
|
298
|
+
catch {
|
|
299
|
+
// Best-effort
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Load session state after upgrade
|
|
304
|
+
*/
|
|
305
|
+
loadSessionState() {
|
|
306
|
+
try {
|
|
307
|
+
if (!existsSync(SESSION_STATE_FILE)) {
|
|
308
|
+
return null;
|
|
309
|
+
}
|
|
310
|
+
const raw = readFileSync(SESSION_STATE_FILE, 'utf8');
|
|
311
|
+
return JSON.parse(raw);
|
|
312
|
+
}
|
|
313
|
+
catch {
|
|
314
|
+
return null;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Clear session state after successful resumption
|
|
319
|
+
*/
|
|
320
|
+
clearSessionState() {
|
|
321
|
+
try {
|
|
322
|
+
if (existsSync(SESSION_STATE_FILE)) {
|
|
323
|
+
rmSync(SESSION_STATE_FILE);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
catch {
|
|
327
|
+
// Best-effort
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Check if there's a pending session to resume
|
|
332
|
+
*/
|
|
333
|
+
hasPendingSession() {
|
|
334
|
+
const state = this.loadSessionState();
|
|
335
|
+
if (!state || !state.timestamp)
|
|
336
|
+
return false;
|
|
337
|
+
// Session valid if less than 24 hours old
|
|
338
|
+
const maxAge = 24 * 60 * 60 * 1000;
|
|
339
|
+
return Date.now() - state.timestamp < maxAge;
|
|
340
|
+
}
|
|
341
|
+
// ==========================================================================
|
|
342
|
+
// RL INTEGRATION
|
|
343
|
+
// ==========================================================================
|
|
344
|
+
/**
|
|
345
|
+
* Save RL checkpoint before upgrade (for RL scoring continuity)
|
|
346
|
+
*/
|
|
347
|
+
saveRLCheckpoint(context) {
|
|
348
|
+
try {
|
|
349
|
+
const dir = dirname(RL_CHECKPOINT_FILE);
|
|
350
|
+
if (!existsSync(dir)) {
|
|
351
|
+
mkdirSync(dir, { recursive: true });
|
|
352
|
+
}
|
|
353
|
+
writeFileSync(RL_CHECKPOINT_FILE, JSON.stringify({
|
|
354
|
+
...context,
|
|
355
|
+
checkpointTime: Date.now(),
|
|
356
|
+
}, null, 2));
|
|
357
|
+
this.emitEvent('upgrade:rl-checkpoint', { context });
|
|
358
|
+
}
|
|
359
|
+
catch {
|
|
360
|
+
// Best-effort
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Load RL checkpoint after upgrade
|
|
365
|
+
*/
|
|
366
|
+
loadRLCheckpoint() {
|
|
367
|
+
try {
|
|
368
|
+
if (!existsSync(RL_CHECKPOINT_FILE)) {
|
|
369
|
+
return null;
|
|
370
|
+
}
|
|
371
|
+
const raw = readFileSync(RL_CHECKPOINT_FILE, 'utf8');
|
|
372
|
+
const data = JSON.parse(raw);
|
|
373
|
+
// Checkpoint valid if less than 1 hour old
|
|
374
|
+
if (Date.now() - data.checkpointTime > 60 * 60 * 1000) {
|
|
375
|
+
return null;
|
|
376
|
+
}
|
|
377
|
+
return data;
|
|
378
|
+
}
|
|
379
|
+
catch {
|
|
380
|
+
return null;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Clear RL checkpoint after successful resumption
|
|
385
|
+
*/
|
|
386
|
+
clearRLCheckpoint() {
|
|
387
|
+
try {
|
|
388
|
+
if (existsSync(RL_CHECKPOINT_FILE)) {
|
|
389
|
+
rmSync(RL_CHECKPOINT_FILE);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
catch {
|
|
393
|
+
// Best-effort
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Calculate RL score impact from upgrade
|
|
398
|
+
* Positive impact if upgrade improves capability
|
|
399
|
+
*/
|
|
400
|
+
calculateRLScoreImpact(preUpgrade, postUpgradeSuccess) {
|
|
401
|
+
if (!postUpgradeSuccess) {
|
|
402
|
+
return -0.1; // Penalty for failed upgrade attempt
|
|
403
|
+
}
|
|
404
|
+
// Base positive impact for successful upgrade
|
|
405
|
+
let impact = 0.05;
|
|
406
|
+
// Bonus for upgrading during active RL iteration
|
|
407
|
+
if (preUpgrade.iteration > 0) {
|
|
408
|
+
impact += 0.02;
|
|
409
|
+
}
|
|
410
|
+
// Bonus if files were modified (upgrade during active work)
|
|
411
|
+
if (preUpgrade.filesModified.length > 0) {
|
|
412
|
+
impact += 0.01 * Math.min(preUpgrade.filesModified.length, 5);
|
|
413
|
+
}
|
|
414
|
+
return impact;
|
|
415
|
+
}
|
|
416
|
+
// ==========================================================================
|
|
417
|
+
// BUILD/TEST INTEGRATION
|
|
418
|
+
// ==========================================================================
|
|
419
|
+
/**
|
|
420
|
+
* Upgrade with build verification
|
|
421
|
+
*/
|
|
422
|
+
async upgradeWithBuildCheck(version, buildCommand = 'npm run build') {
|
|
423
|
+
const result = await this.npmInstallFresh(version);
|
|
424
|
+
if (!result.success) {
|
|
425
|
+
return { ...result, buildSuccess: false };
|
|
426
|
+
}
|
|
427
|
+
// Run build to verify upgrade didn't break anything
|
|
428
|
+
try {
|
|
429
|
+
await execAsync(buildCommand, {
|
|
430
|
+
cwd: this.config.workingDir,
|
|
431
|
+
timeout: this.config.timeout,
|
|
432
|
+
});
|
|
433
|
+
return { ...result, buildSuccess: true };
|
|
434
|
+
}
|
|
435
|
+
catch (error) {
|
|
436
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
437
|
+
this.config.logger(`Post-upgrade build failed: ${errorMessage}`);
|
|
438
|
+
return { ...result, buildSuccess: false };
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Upgrade with test verification
|
|
443
|
+
*/
|
|
444
|
+
async upgradeWithTestCheck(version, testCommand = 'npm test') {
|
|
445
|
+
const result = await this.npmInstallFresh(version);
|
|
446
|
+
if (!result.success) {
|
|
447
|
+
return { ...result, testState: { passed: 0, failed: 0 } };
|
|
448
|
+
}
|
|
449
|
+
// Run tests to verify upgrade
|
|
450
|
+
try {
|
|
451
|
+
const { stdout, stderr } = await execAsync(testCommand, {
|
|
452
|
+
cwd: this.config.workingDir,
|
|
453
|
+
timeout: this.config.timeout,
|
|
454
|
+
});
|
|
455
|
+
const output = stdout + stderr;
|
|
456
|
+
const passed = this.parseTestCount(output, 'pass');
|
|
457
|
+
const failed = this.parseTestCount(output, 'fail');
|
|
458
|
+
return {
|
|
459
|
+
...result,
|
|
460
|
+
testState: { passed, failed, output, command: testCommand },
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
catch (error) {
|
|
464
|
+
const output = error instanceof Error ? error.stdout + error.stderr : '';
|
|
465
|
+
const passed = this.parseTestCount(output, 'pass');
|
|
466
|
+
const failed = this.parseTestCount(output, 'fail');
|
|
467
|
+
return {
|
|
468
|
+
...result,
|
|
469
|
+
testState: { passed, failed, output, command: testCommand },
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Full upgrade with build and test verification
|
|
475
|
+
*/
|
|
476
|
+
async upgradeWithFullVerification(version, buildCommand = 'npm run build', testCommand = 'npm test') {
|
|
477
|
+
const result = await this.npmInstallFresh(version);
|
|
478
|
+
if (!result.success) {
|
|
479
|
+
return { ...result, buildSuccess: false, testState: { passed: 0, failed: 0 } };
|
|
480
|
+
}
|
|
481
|
+
// Run build
|
|
482
|
+
let buildSuccess = false;
|
|
483
|
+
try {
|
|
484
|
+
await execAsync(buildCommand, {
|
|
485
|
+
cwd: this.config.workingDir,
|
|
486
|
+
timeout: this.config.timeout,
|
|
487
|
+
});
|
|
488
|
+
buildSuccess = true;
|
|
489
|
+
}
|
|
490
|
+
catch {
|
|
491
|
+
this.config.logger('Post-upgrade build failed');
|
|
492
|
+
}
|
|
493
|
+
// Run tests
|
|
494
|
+
let testState = { passed: 0, failed: 0 };
|
|
495
|
+
try {
|
|
496
|
+
const { stdout, stderr } = await execAsync(testCommand, {
|
|
497
|
+
cwd: this.config.workingDir,
|
|
498
|
+
timeout: this.config.timeout,
|
|
499
|
+
});
|
|
500
|
+
const output = stdout + stderr;
|
|
501
|
+
testState = {
|
|
502
|
+
passed: this.parseTestCount(output, 'pass'),
|
|
503
|
+
failed: this.parseTestCount(output, 'fail'),
|
|
504
|
+
output,
|
|
505
|
+
command: testCommand,
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
catch (error) {
|
|
509
|
+
const output = error instanceof Error ? error.stdout + error.stderr : '';
|
|
510
|
+
testState = {
|
|
511
|
+
passed: this.parseTestCount(output, 'pass'),
|
|
512
|
+
failed: this.parseTestCount(output, 'fail'),
|
|
513
|
+
output,
|
|
514
|
+
command: testCommand,
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
return { ...result, buildSuccess, testState };
|
|
518
|
+
}
|
|
519
|
+
parseTestCount(output, type) {
|
|
520
|
+
const match = output.match(new RegExp(`(\\d+)\\s*${type}`, 'i'));
|
|
521
|
+
return match ? parseInt(match[1], 10) : 0;
|
|
522
|
+
}
|
|
523
|
+
// ==========================================================================
|
|
524
|
+
// EDIT INTEGRATION
|
|
525
|
+
// ==========================================================================
|
|
526
|
+
/**
|
|
527
|
+
* Save active edits before upgrade for continuity
|
|
528
|
+
*/
|
|
529
|
+
saveActiveEdits(files) {
|
|
530
|
+
const state = this.loadSessionState() || {
|
|
531
|
+
workingDir: this.config.workingDir,
|
|
532
|
+
fromVersion: '0.0.0',
|
|
533
|
+
timestamp: Date.now(),
|
|
534
|
+
};
|
|
535
|
+
this.saveSessionState({
|
|
536
|
+
...state,
|
|
537
|
+
activeEdits: files,
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Get active edits to resume after upgrade
|
|
542
|
+
*/
|
|
543
|
+
getActiveEdits() {
|
|
544
|
+
const state = this.loadSessionState();
|
|
545
|
+
return state?.activeEdits || [];
|
|
546
|
+
}
|
|
547
|
+
// ==========================================================================
|
|
548
|
+
// LOGGING
|
|
549
|
+
// ==========================================================================
|
|
550
|
+
logUpgrade(entry) {
|
|
551
|
+
try {
|
|
552
|
+
const dir = dirname(UPGRADE_LOG_FILE);
|
|
553
|
+
if (!existsSync(dir)) {
|
|
554
|
+
mkdirSync(dir, { recursive: true });
|
|
555
|
+
}
|
|
556
|
+
let logs = [];
|
|
557
|
+
if (existsSync(UPGRADE_LOG_FILE)) {
|
|
558
|
+
try {
|
|
559
|
+
logs = JSON.parse(readFileSync(UPGRADE_LOG_FILE, 'utf8'));
|
|
560
|
+
}
|
|
561
|
+
catch {
|
|
562
|
+
logs = [];
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
logs.push(entry);
|
|
566
|
+
// Keep last 100 entries
|
|
567
|
+
if (logs.length > 100) {
|
|
568
|
+
logs = logs.slice(-100);
|
|
569
|
+
}
|
|
570
|
+
writeFileSync(UPGRADE_LOG_FILE, JSON.stringify(logs, null, 2));
|
|
571
|
+
}
|
|
572
|
+
catch {
|
|
573
|
+
// Best-effort
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
emitEvent(type, data) {
|
|
577
|
+
const event = {
|
|
578
|
+
type,
|
|
579
|
+
timestamp: Date.now(),
|
|
580
|
+
data,
|
|
581
|
+
};
|
|
582
|
+
this.emit(type, event);
|
|
583
|
+
this.emit('upgrade', event);
|
|
584
|
+
}
|
|
585
|
+
// ==========================================================================
|
|
586
|
+
// STATIC UTILITIES
|
|
587
|
+
// ==========================================================================
|
|
588
|
+
/**
|
|
589
|
+
* Check if this process was started after an upgrade
|
|
590
|
+
*/
|
|
591
|
+
static wasUpgraded() {
|
|
592
|
+
return process.env['AGI_UPGRADED'] === 'true';
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Get the version we upgraded from
|
|
596
|
+
*/
|
|
597
|
+
static getUpgradeFromVersion() {
|
|
598
|
+
return process.env['AGI_UPGRADE_FROM'] || null;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Check if we should resume a session
|
|
602
|
+
*/
|
|
603
|
+
static shouldResumeSession() {
|
|
604
|
+
return process.env['AGI_RESUME_SESSION'] === 'true';
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
// ============================================================================
|
|
608
|
+
// SINGLETON EXPORT
|
|
609
|
+
// ============================================================================
|
|
610
|
+
let selfUpgradeInstance = null;
|
|
611
|
+
export function getSelfUpgrade(config) {
|
|
612
|
+
if (!selfUpgradeInstance || config) {
|
|
613
|
+
selfUpgradeInstance = new SelfUpgrade(config);
|
|
614
|
+
}
|
|
615
|
+
return selfUpgradeInstance;
|
|
616
|
+
}
|
|
617
|
+
export function resetSelfUpgrade() {
|
|
618
|
+
selfUpgradeInstance = null;
|
|
619
|
+
}
|
|
620
|
+
// ============================================================================
|
|
621
|
+
// CONVENIENCE FUNCTIONS
|
|
622
|
+
// ============================================================================
|
|
623
|
+
/**
|
|
624
|
+
* Quick upgrade to latest version with session continuity
|
|
625
|
+
*/
|
|
626
|
+
export async function upgradeToLatest(options = {}) {
|
|
627
|
+
const upgrade = getSelfUpgrade({
|
|
628
|
+
autoRestart: options.autoRestart ?? true,
|
|
629
|
+
workingDir: options.workingDir,
|
|
630
|
+
logger: options.logger,
|
|
631
|
+
});
|
|
632
|
+
return upgrade.npmInstallFresh();
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* Upgrade with full verification (build + tests)
|
|
636
|
+
*/
|
|
637
|
+
export async function upgradeAndVerify(options = {}) {
|
|
638
|
+
const upgrade = getSelfUpgrade({
|
|
639
|
+
workingDir: options.workingDir,
|
|
640
|
+
logger: options.logger,
|
|
641
|
+
autoRestart: false, // Don't auto-restart, let caller decide after verification
|
|
642
|
+
});
|
|
643
|
+
return upgrade.upgradeWithFullVerification(options.version, options.buildCommand, options.testCommand);
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Save current work state for upgrade resumption
|
|
647
|
+
*/
|
|
648
|
+
export function saveUpgradeState(state) {
|
|
649
|
+
const upgrade = getSelfUpgrade();
|
|
650
|
+
upgrade.getCurrentVersion().then((fromVersion) => {
|
|
651
|
+
upgrade.saveSessionState({
|
|
652
|
+
...state,
|
|
653
|
+
fromVersion,
|
|
654
|
+
timestamp: Date.now(),
|
|
655
|
+
});
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Resume work after upgrade
|
|
660
|
+
*/
|
|
661
|
+
export function resumeAfterUpgrade() {
|
|
662
|
+
const upgrade = getSelfUpgrade();
|
|
663
|
+
const state = upgrade.loadSessionState();
|
|
664
|
+
if (state) {
|
|
665
|
+
upgrade.clearSessionState();
|
|
666
|
+
}
|
|
667
|
+
return state;
|
|
668
|
+
}
|
|
669
|
+
//# sourceMappingURL=selfUpgrade.js.map
|