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 @@
|
|
|
1
|
+
{"version":3,"file":"hallucinationGuard.js","sourceRoot":"","sources":["../../src/core/hallucinationGuard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAgBrC;;GAEG;AACH,MAAM,OAAO,kBAAkB;IACZ,UAAU,CAAS;IACnB,UAAU,GAAwB,IAAI,GAAG,EAAE,CAAC;IAE7D,YAAY,UAAmC,EAAE;QAC/C,IAAI,CAAC,UAAU,GAAG,OAA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AAe,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QAE7E,OAAO;YACL,MAAM;YACN,WAAW;YACX,eAAe;SAChB,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAC3C,QAAgB,EAChB,IAA6B,EAC7B,eAAwB;IAExB,MAAM,KAAK,GAAG,IAAI,kBAAkB,EAAE,CAAC;IACvC,OAAO,KAAK,CAAC,qBAAqB,CAAC,QAAQ,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks System
|
|
3
|
+
*
|
|
4
|
+
* Event-triggered scripts that automate workflows, based on AGI CLI's hooks architecture.
|
|
5
|
+
* Hooks can execute shell commands or query an LLM for decisions.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Hook event types
|
|
9
|
+
*/
|
|
10
|
+
export type HookEvent = 'PreToolUse' | 'PostToolUse' | 'PermissionRequest' | 'UserPromptSubmit' | 'SessionStart' | 'SessionEnd' | 'Stop' | 'SubagentStop' | 'Notification';
|
|
11
|
+
/**
|
|
12
|
+
* Hook types
|
|
13
|
+
*/
|
|
14
|
+
export type HookType = 'command' | 'prompt';
|
|
15
|
+
/**
|
|
16
|
+
* Hook definition
|
|
17
|
+
*/
|
|
18
|
+
export interface HookDefinition {
|
|
19
|
+
/** Regex pattern to match tool names or events */
|
|
20
|
+
matcher?: string;
|
|
21
|
+
/** Type of hook: 'command' for shell, 'prompt' for LLM */
|
|
22
|
+
type: HookType;
|
|
23
|
+
/** Shell command to execute (for command hooks) */
|
|
24
|
+
command?: string;
|
|
25
|
+
/** Prompt to send to LLM (for prompt hooks) */
|
|
26
|
+
prompt?: string;
|
|
27
|
+
/** Timeout in milliseconds */
|
|
28
|
+
timeout?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Hook execution result
|
|
32
|
+
*/
|
|
33
|
+
export interface HookResult {
|
|
34
|
+
success: boolean;
|
|
35
|
+
output?: string;
|
|
36
|
+
decision?: 'allow' | 'deny' | 'continue';
|
|
37
|
+
reason?: string;
|
|
38
|
+
error?: string;
|
|
39
|
+
blocked?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Hook execution context
|
|
43
|
+
*/
|
|
44
|
+
export interface HookContext {
|
|
45
|
+
event: HookEvent;
|
|
46
|
+
toolName?: string;
|
|
47
|
+
toolArgs?: Record<string, unknown>;
|
|
48
|
+
toolResult?: string;
|
|
49
|
+
userInput?: string;
|
|
50
|
+
sessionId?: string;
|
|
51
|
+
workingDir: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Hooks configuration
|
|
55
|
+
*/
|
|
56
|
+
export interface HooksConfig {
|
|
57
|
+
[event: string]: HookDefinition[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Load hooks from settings files
|
|
61
|
+
*/
|
|
62
|
+
export declare function loadHooks(workingDir: string): HooksConfig;
|
|
63
|
+
/**
|
|
64
|
+
* HooksManager class for managing and executing hooks
|
|
65
|
+
*/
|
|
66
|
+
export declare class HooksManager {
|
|
67
|
+
private hooks;
|
|
68
|
+
private workingDir;
|
|
69
|
+
constructor(workingDir: string);
|
|
70
|
+
/**
|
|
71
|
+
* Reload hooks from settings files
|
|
72
|
+
*/
|
|
73
|
+
reload(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Check if hooks are configured for an event
|
|
76
|
+
*/
|
|
77
|
+
hasHooks(event: HookEvent): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Get all hooks for an event
|
|
80
|
+
*/
|
|
81
|
+
getHooks(event: HookEvent): HookDefinition[];
|
|
82
|
+
/**
|
|
83
|
+
* Execute all matching hooks for an event
|
|
84
|
+
*/
|
|
85
|
+
executeHooks(context: HookContext): Promise<HookResult[]>;
|
|
86
|
+
/**
|
|
87
|
+
* Execute pre-tool hooks and check if tool should proceed
|
|
88
|
+
*/
|
|
89
|
+
executePreToolHooks(toolName: string, args: Record<string, unknown>): Promise<{
|
|
90
|
+
allowed: boolean;
|
|
91
|
+
results: HookResult[];
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* Execute post-tool hooks
|
|
95
|
+
*/
|
|
96
|
+
executePostToolHooks(toolName: string, args: Record<string, unknown>, result: string): Promise<HookResult[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Execute user prompt hooks
|
|
99
|
+
*/
|
|
100
|
+
executeUserPromptHooks(userInput: string): Promise<{
|
|
101
|
+
allowed: boolean;
|
|
102
|
+
results: HookResult[];
|
|
103
|
+
}>;
|
|
104
|
+
/**
|
|
105
|
+
* Execute session lifecycle hooks
|
|
106
|
+
*/
|
|
107
|
+
executeSessionHook(event: 'SessionStart' | 'SessionEnd', sessionId: string): Promise<HookResult[]>;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Create a hooks manager for the given working directory
|
|
111
|
+
*/
|
|
112
|
+
export declare function createHooksManager(workingDir: string): HooksManager;
|
|
113
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/core/hooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,aAAa,GACb,mBAAmB,GACnB,kBAAkB,GAClB,cAAc,GACd,YAAY,GACZ,MAAM,GACN,cAAc,GACd,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IAC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GAAG,cAAc,EAAE;IAI5C;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAmB/D;;OAEG;IACG,mBAAmB,CACvB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;IAgBvD;;OAEG;IACG,oBAAoB,CACxB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,UAAU,EAAE,CAAC;IAYxB;;OAEG;IACG,sBAAsB,CAC1B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;IAavD;;OAEG;IACG,kBAAkB,CACtB,KAAK,EAAE,cAAc,GAAG,YAAY,EACpC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,UAAU,EAAE,CAAC;CASzB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY,CAEnE"}
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks System
|
|
3
|
+
*
|
|
4
|
+
* Event-triggered scripts that automate workflows, based on AGI CLI's hooks architecture.
|
|
5
|
+
* Hooks can execute shell commands or query an LLM for decisions.
|
|
6
|
+
*/
|
|
7
|
+
import { exec } from 'node:child_process';
|
|
8
|
+
import { promisify } from 'node:util';
|
|
9
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { homedir } from 'node:os';
|
|
12
|
+
import { getAGI } from './agiCore.js';
|
|
13
|
+
const execAsync = promisify(exec);
|
|
14
|
+
/**
|
|
15
|
+
* Load hooks from settings files
|
|
16
|
+
*/
|
|
17
|
+
export function loadHooks(workingDir) {
|
|
18
|
+
const hooks = {};
|
|
19
|
+
// Load from user settings (~/.claude/settings.json or ~/.agi/settings.json)
|
|
20
|
+
const userSettingsPaths = [
|
|
21
|
+
join(homedir(), '.claude', 'settings.json'),
|
|
22
|
+
join(homedir(), '.agi', 'settings.json'),
|
|
23
|
+
join(homedir(), '.erosolar', 'settings.json'),
|
|
24
|
+
];
|
|
25
|
+
// Load from project settings (.claude/settings.json or .agi/settings.json)
|
|
26
|
+
const projectSettingsPaths = [
|
|
27
|
+
join(workingDir, '.claude', 'settings.json'),
|
|
28
|
+
join(workingDir, '.agi', 'settings.json'),
|
|
29
|
+
join(workingDir, '.erosolar', 'settings.json'),
|
|
30
|
+
];
|
|
31
|
+
// Load user settings first, then override with project settings
|
|
32
|
+
for (const settingsPath of [...userSettingsPaths, ...projectSettingsPaths]) {
|
|
33
|
+
if (existsSync(settingsPath)) {
|
|
34
|
+
try {
|
|
35
|
+
const content = readFileSync(settingsPath, 'utf-8');
|
|
36
|
+
const settings = JSON.parse(content);
|
|
37
|
+
if (settings.hooks) {
|
|
38
|
+
for (const [event, eventHooks] of Object.entries(settings.hooks)) {
|
|
39
|
+
if (!hooks[event]) {
|
|
40
|
+
hooks[event] = [];
|
|
41
|
+
}
|
|
42
|
+
hooks[event].push(...eventHooks);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// Ignore invalid settings files
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return hooks;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Check if a hook matches the given context
|
|
55
|
+
*/
|
|
56
|
+
function matchesHook(hook, context) {
|
|
57
|
+
if (!hook.matcher) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
const regex = new RegExp(hook.matcher);
|
|
62
|
+
// Match against tool name if available
|
|
63
|
+
if (context.toolName) {
|
|
64
|
+
return regex.test(context.toolName);
|
|
65
|
+
}
|
|
66
|
+
// Match against event name
|
|
67
|
+
return regex.test(context.event);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Execute a command hook
|
|
75
|
+
*/
|
|
76
|
+
async function executeCommandHook(hook, context) {
|
|
77
|
+
if (!hook.command) {
|
|
78
|
+
return { success: false, error: 'No command specified' };
|
|
79
|
+
}
|
|
80
|
+
const timeout = hook.timeout ?? 24 * 60 * 60 * 1000;
|
|
81
|
+
// Prepare environment variables for the hook
|
|
82
|
+
const env = {
|
|
83
|
+
...process.env,
|
|
84
|
+
HOOK_EVENT: context.event,
|
|
85
|
+
HOOK_TOOL_NAME: context.toolName ?? '',
|
|
86
|
+
HOOK_TOOL_ARGS: context.toolArgs ? JSON.stringify(context.toolArgs) : '',
|
|
87
|
+
HOOK_TOOL_RESULT: context.toolResult ?? '',
|
|
88
|
+
HOOK_USER_INPUT: context.userInput ?? '',
|
|
89
|
+
HOOK_SESSION_ID: context.sessionId ?? '',
|
|
90
|
+
HOOK_WORKING_DIR: context.workingDir,
|
|
91
|
+
};
|
|
92
|
+
try {
|
|
93
|
+
const { stdout } = await execAsync(hook.command, {
|
|
94
|
+
cwd: context.workingDir,
|
|
95
|
+
timeout,
|
|
96
|
+
env,
|
|
97
|
+
});
|
|
98
|
+
// Try to parse JSON output for structured results
|
|
99
|
+
const output = stdout.trim();
|
|
100
|
+
try {
|
|
101
|
+
const parsed = JSON.parse(output);
|
|
102
|
+
return {
|
|
103
|
+
success: true,
|
|
104
|
+
output,
|
|
105
|
+
decision: parsed.decision,
|
|
106
|
+
reason: parsed.reason,
|
|
107
|
+
blocked: parsed.blocked,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
// Return raw output if not JSON
|
|
112
|
+
return {
|
|
113
|
+
success: true,
|
|
114
|
+
output,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
120
|
+
// Exit code 2 means blocking
|
|
121
|
+
if (message.includes('exit code 2')) {
|
|
122
|
+
return {
|
|
123
|
+
success: false,
|
|
124
|
+
blocked: true,
|
|
125
|
+
error: message,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
success: false,
|
|
130
|
+
error: message,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
function serializeArgs(args) {
|
|
135
|
+
if (!args)
|
|
136
|
+
return '';
|
|
137
|
+
try {
|
|
138
|
+
return JSON.stringify(args, (_key, value) => {
|
|
139
|
+
if (typeof value === 'bigint') {
|
|
140
|
+
return value.toString();
|
|
141
|
+
}
|
|
142
|
+
return value;
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
return String(args);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function buildPromptForHook(hook, context) {
|
|
150
|
+
const parts = [];
|
|
151
|
+
if (hook.prompt) {
|
|
152
|
+
parts.push(hook.prompt.trim());
|
|
153
|
+
}
|
|
154
|
+
parts.push(`Event: ${context.event}`);
|
|
155
|
+
if (context.userInput) {
|
|
156
|
+
parts.push(`User input: ${context.userInput}`);
|
|
157
|
+
}
|
|
158
|
+
if (context.toolName) {
|
|
159
|
+
parts.push(`Tool: ${context.toolName}`);
|
|
160
|
+
}
|
|
161
|
+
if (context.toolArgs) {
|
|
162
|
+
parts.push(`Args: ${serializeArgs(context.toolArgs)}`);
|
|
163
|
+
}
|
|
164
|
+
if (context.toolResult) {
|
|
165
|
+
parts.push(`Result: ${context.toolResult}`);
|
|
166
|
+
}
|
|
167
|
+
return parts.filter(Boolean).join('\n');
|
|
168
|
+
}
|
|
169
|
+
function assessPromptRisk(promptText, context, _analysis) {
|
|
170
|
+
const lower = promptText.toLowerCase();
|
|
171
|
+
const reasons = [];
|
|
172
|
+
const destructivePatterns = [
|
|
173
|
+
/rm\s+-rf\s+\/?/,
|
|
174
|
+
/sudo\s+rm\s+-rf/,
|
|
175
|
+
/:\(\)\s*{.*:.*\|.*:.*;.*};\s*:/, // fork bomb
|
|
176
|
+
/mkfs/i,
|
|
177
|
+
/format\s+c:/i,
|
|
178
|
+
/shutdown\s+-h/i,
|
|
179
|
+
/kill\s+-9\s+1/,
|
|
180
|
+
/dd\s+if=\/dev\//i,
|
|
181
|
+
];
|
|
182
|
+
if (typeof context.toolArgs?.['command'] === 'string') {
|
|
183
|
+
const cmd = String(context.toolArgs['command']).toLowerCase();
|
|
184
|
+
if (/rm\s+-rf/.test(cmd) || /(^|\s)del\s+\/f/i.test(cmd)) {
|
|
185
|
+
reasons.push('Destructive shell command');
|
|
186
|
+
}
|
|
187
|
+
if (/shutdown|reboot/.test(cmd)) {
|
|
188
|
+
reasons.push('System shutdown command');
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (destructivePatterns.some((re) => re.test(lower))) {
|
|
192
|
+
reasons.push('Destructive content detected');
|
|
193
|
+
}
|
|
194
|
+
const score = reasons.length > 0 ? 0.9 : 0.05;
|
|
195
|
+
return { score, reasons };
|
|
196
|
+
}
|
|
197
|
+
function formatPromptHookOutput(analysis, risk) {
|
|
198
|
+
const lines = [];
|
|
199
|
+
lines.push(`Interpretation: ${analysis.interpretation}`);
|
|
200
|
+
lines.push(`Intent: ${analysis.intent} (${analysis.category}, ${(analysis.confidence * 100).toFixed(0)}% conf)`);
|
|
201
|
+
lines.push(analysis.tasks.length
|
|
202
|
+
? `Tasks: ${analysis.tasks.map((t) => `[${t.id}] ${t.description}`).join(' | ')}`
|
|
203
|
+
: 'Tasks: none');
|
|
204
|
+
lines.push(`Risk: ${(risk.score * 100).toFixed(0)}%${risk.reasons.length ? ` (${risk.reasons.join('; ')})` : ''}`);
|
|
205
|
+
if (analysis.clarificationNeeded.length) {
|
|
206
|
+
lines.push(`Clarifications: ${analysis.clarificationNeeded.join('; ')}`);
|
|
207
|
+
}
|
|
208
|
+
return lines.join('\n');
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Execute a prompt hook (would query LLM in full implementation)
|
|
212
|
+
*/
|
|
213
|
+
async function executePromptHook(hook, context) {
|
|
214
|
+
if (!hook.prompt) {
|
|
215
|
+
return { success: false, error: 'No prompt specified' };
|
|
216
|
+
}
|
|
217
|
+
const start = Date.now();
|
|
218
|
+
const promptText = buildPromptForHook(hook, context);
|
|
219
|
+
const agi = getAGI(context.workingDir);
|
|
220
|
+
const analysis = agi.analyzePrompt(promptText);
|
|
221
|
+
const risk = assessPromptRisk(promptText, context, analysis);
|
|
222
|
+
const highRiskEvent = context.event === 'PreToolUse' || context.event === 'PermissionRequest' || context.event === 'UserPromptSubmit';
|
|
223
|
+
const blocked = highRiskEvent && risk.score >= 0.75;
|
|
224
|
+
const decision = blocked ? 'deny' : 'continue';
|
|
225
|
+
agi.recordOperation({
|
|
226
|
+
id: `hook-${context.event}-${Date.now()}`,
|
|
227
|
+
prompt: promptText,
|
|
228
|
+
interpretation: analysis.interpretation,
|
|
229
|
+
tasks: analysis.tasks.map((t) => t.description),
|
|
230
|
+
success: !blocked,
|
|
231
|
+
timestamp: Date.now(),
|
|
232
|
+
duration: Date.now() - start,
|
|
233
|
+
toolsUsed: ['AGIHook'],
|
|
234
|
+
errors: blocked ? risk.reasons : undefined,
|
|
235
|
+
});
|
|
236
|
+
return {
|
|
237
|
+
success: true,
|
|
238
|
+
decision,
|
|
239
|
+
blocked,
|
|
240
|
+
reason: blocked
|
|
241
|
+
? `High-risk content detected: ${risk.reasons.join('; ') || 'unspecified'}`
|
|
242
|
+
: `AGI analysis: ${analysis.interpretation} (risk ${(risk.score * 100).toFixed(0)}%)`,
|
|
243
|
+
output: formatPromptHookOutput(analysis, risk),
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Execute a single hook
|
|
248
|
+
*/
|
|
249
|
+
async function executeHook(hook, context) {
|
|
250
|
+
switch (hook.type) {
|
|
251
|
+
case 'command':
|
|
252
|
+
return executeCommandHook(hook, context);
|
|
253
|
+
case 'prompt':
|
|
254
|
+
return executePromptHook(hook, context);
|
|
255
|
+
default:
|
|
256
|
+
return { success: false, error: `Unknown hook type: ${hook.type}` };
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* HooksManager class for managing and executing hooks
|
|
261
|
+
*/
|
|
262
|
+
export class HooksManager {
|
|
263
|
+
hooks;
|
|
264
|
+
workingDir;
|
|
265
|
+
constructor(workingDir) {
|
|
266
|
+
this.workingDir = workingDir;
|
|
267
|
+
this.hooks = loadHooks(workingDir);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Reload hooks from settings files
|
|
271
|
+
*/
|
|
272
|
+
reload() {
|
|
273
|
+
this.hooks = loadHooks(this.workingDir);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Check if hooks are configured for an event
|
|
277
|
+
*/
|
|
278
|
+
hasHooks(event) {
|
|
279
|
+
return Boolean(this.hooks[event]?.length);
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Get all hooks for an event
|
|
283
|
+
*/
|
|
284
|
+
getHooks(event) {
|
|
285
|
+
return this.hooks[event] ?? [];
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Execute all matching hooks for an event
|
|
289
|
+
*/
|
|
290
|
+
async executeHooks(context) {
|
|
291
|
+
const eventHooks = this.hooks[context.event] ?? [];
|
|
292
|
+
const results = [];
|
|
293
|
+
for (const hook of eventHooks) {
|
|
294
|
+
if (matchesHook(hook, context)) {
|
|
295
|
+
const result = await executeHook(hook, context);
|
|
296
|
+
results.push(result);
|
|
297
|
+
// Stop on blocking result
|
|
298
|
+
if (result.blocked) {
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return results;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Execute pre-tool hooks and check if tool should proceed
|
|
307
|
+
*/
|
|
308
|
+
async executePreToolHooks(toolName, args) {
|
|
309
|
+
const context = {
|
|
310
|
+
event: 'PreToolUse',
|
|
311
|
+
toolName,
|
|
312
|
+
toolArgs: args,
|
|
313
|
+
workingDir: this.workingDir,
|
|
314
|
+
};
|
|
315
|
+
const results = await this.executeHooks(context);
|
|
316
|
+
// Check if any hook blocked the operation
|
|
317
|
+
const blocked = results.some((r) => r.blocked || r.decision === 'deny');
|
|
318
|
+
return { allowed: !blocked, results };
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Execute post-tool hooks
|
|
322
|
+
*/
|
|
323
|
+
async executePostToolHooks(toolName, args, result) {
|
|
324
|
+
const context = {
|
|
325
|
+
event: 'PostToolUse',
|
|
326
|
+
toolName,
|
|
327
|
+
toolArgs: args,
|
|
328
|
+
toolResult: result,
|
|
329
|
+
workingDir: this.workingDir,
|
|
330
|
+
};
|
|
331
|
+
return this.executeHooks(context);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Execute user prompt hooks
|
|
335
|
+
*/
|
|
336
|
+
async executeUserPromptHooks(userInput) {
|
|
337
|
+
const context = {
|
|
338
|
+
event: 'UserPromptSubmit',
|
|
339
|
+
userInput,
|
|
340
|
+
workingDir: this.workingDir,
|
|
341
|
+
};
|
|
342
|
+
const results = await this.executeHooks(context);
|
|
343
|
+
const blocked = results.some((r) => r.blocked || r.decision === 'deny');
|
|
344
|
+
return { allowed: !blocked, results };
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Execute session lifecycle hooks
|
|
348
|
+
*/
|
|
349
|
+
async executeSessionHook(event, sessionId) {
|
|
350
|
+
const context = {
|
|
351
|
+
event,
|
|
352
|
+
sessionId,
|
|
353
|
+
workingDir: this.workingDir,
|
|
354
|
+
};
|
|
355
|
+
return this.executeHooks(context);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Create a hooks manager for the given working directory
|
|
360
|
+
*/
|
|
361
|
+
export function createHooksManager(workingDir) {
|
|
362
|
+
return new HooksManager(workingDir);
|
|
363
|
+
}
|
|
364
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/core/hooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,MAAM,EAAuB,MAAM,cAAc,CAAC;AAE3D,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AA4ElC;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,UAAkB;IAC1C,MAAM,KAAK,GAAgB,EAAE,CAAC;IAE9B,4EAA4E;IAC5E,MAAM,iBAAiB,GAAG;QACxB,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,eAAe,CAAC;QAC3C,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,eAAe,CAAC;QACxC,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,eAAe,CAAC;KAC9C,CAAC;IAEF,2EAA2E;IAC3E,MAAM,oBAAoB,GAAG;QAC3B,IAAI,CAAC,UAAU,EAAE,SAAS,EAAE,eAAe,CAAC;QAC5C,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,CAAC;QACzC,IAA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C5B,CAAC;QAEF,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC;QAExE,OAAO,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB,CACtB,KAAoC,EACpC,SAAiB;QAEjB,MAAM,OAAO,GAAgB;YAC3B,KAAK;YACL,SAAS;YACT,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;QAEF,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACnD,OAAO,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hot Reload System for AGI Core
|
|
3
|
+
*
|
|
4
|
+
* Enables seamless version transitions by:
|
|
5
|
+
* 1. Detecting when a new version is available
|
|
6
|
+
* 2. Hot-swapping modules where possible
|
|
7
|
+
* 3. Gracefully restarting when full reload is needed
|
|
8
|
+
* 4. Preserving state across reloads
|
|
9
|
+
*
|
|
10
|
+
* Integrated with the self-upgrade system for continuous improvement.
|
|
11
|
+
*/
|
|
12
|
+
import { EventEmitter } from 'node:events';
|
|
13
|
+
import { type RLUpgradeContext } from './selfUpgrade.js';
|
|
14
|
+
export interface HotReloadConfig {
|
|
15
|
+
/** Enable automatic version checking */
|
|
16
|
+
autoCheck?: boolean;
|
|
17
|
+
/** Check interval in ms (default: 5 minutes) */
|
|
18
|
+
checkInterval?: number;
|
|
19
|
+
/** Enable hot-swap where possible (default: true) */
|
|
20
|
+
enableHotSwap?: boolean;
|
|
21
|
+
/** Logger function */
|
|
22
|
+
logger?: (message: string) => void;
|
|
23
|
+
/** Working directory */
|
|
24
|
+
workingDir?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface HotReloadState {
|
|
27
|
+
/** Current version */
|
|
28
|
+
currentVersion: string;
|
|
29
|
+
/** Last check timestamp */
|
|
30
|
+
lastCheck: number;
|
|
31
|
+
/** Pending reload */
|
|
32
|
+
pendingReload: boolean;
|
|
33
|
+
/** Modules that can be hot-swapped */
|
|
34
|
+
hotSwappableModules: string[];
|
|
35
|
+
/** State to preserve across reload */
|
|
36
|
+
preservedState: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
export type HotReloadEventType = 'hotReload:check' | 'hotReload:available' | 'hotReload:swap' | 'hotReload:restart' | 'hotReload:complete' | 'hotReload:error';
|
|
39
|
+
export interface HotReloadEvent {
|
|
40
|
+
type: HotReloadEventType;
|
|
41
|
+
timestamp: number;
|
|
42
|
+
data?: Record<string, unknown>;
|
|
43
|
+
}
|
|
44
|
+
export interface ReloadStrategy {
|
|
45
|
+
/** Whether hot-swap is possible */
|
|
46
|
+
canHotSwap: boolean;
|
|
47
|
+
/** Modules that need full reload */
|
|
48
|
+
requiresRestart: string[];
|
|
49
|
+
/** Modules that can be hot-swapped */
|
|
50
|
+
hotSwappable: string[];
|
|
51
|
+
/** Estimated downtime */
|
|
52
|
+
estimatedDowntimeMs: number;
|
|
53
|
+
}
|
|
54
|
+
export declare class HotReload extends EventEmitter {
|
|
55
|
+
private config;
|
|
56
|
+
private state;
|
|
57
|
+
private checkTimer;
|
|
58
|
+
private watchingFiles;
|
|
59
|
+
constructor(config?: HotReloadConfig);
|
|
60
|
+
private loadState;
|
|
61
|
+
private saveState;
|
|
62
|
+
/**
|
|
63
|
+
* Start automatic version checking
|
|
64
|
+
*/
|
|
65
|
+
startAutoCheck(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Stop automatic version checking
|
|
68
|
+
*/
|
|
69
|
+
stopAutoCheck(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Check for available updates
|
|
72
|
+
*/
|
|
73
|
+
checkForUpdates(): Promise<{
|
|
74
|
+
available: boolean;
|
|
75
|
+
version?: string;
|
|
76
|
+
strategy?: ReloadStrategy;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Determine the best reload strategy for a version update
|
|
80
|
+
*/
|
|
81
|
+
determineReloadStrategy(currentVersion: string, targetVersion: string): Promise<ReloadStrategy>;
|
|
82
|
+
/**
|
|
83
|
+
* Perform hot reload with state preservation
|
|
84
|
+
*/
|
|
85
|
+
performHotReload(options?: {
|
|
86
|
+
preserveState?: Record<string, unknown>;
|
|
87
|
+
rlContext?: RLUpgradeContext;
|
|
88
|
+
activeEdits?: string[];
|
|
89
|
+
}): Promise<{
|
|
90
|
+
success: boolean;
|
|
91
|
+
strategy: 'hot-swap' | 'restart';
|
|
92
|
+
error?: string;
|
|
93
|
+
}>;
|
|
94
|
+
/**
|
|
95
|
+
* Hot-swap specific modules without restart
|
|
96
|
+
*/
|
|
97
|
+
private hotSwapModules;
|
|
98
|
+
/**
|
|
99
|
+
* Perform full restart with state preservation
|
|
100
|
+
*/
|
|
101
|
+
private performFullRestart;
|
|
102
|
+
/**
|
|
103
|
+
* Watch for local file changes (development mode)
|
|
104
|
+
*/
|
|
105
|
+
watchFiles(files: string[]): void;
|
|
106
|
+
/**
|
|
107
|
+
* Stop watching files
|
|
108
|
+
*/
|
|
109
|
+
unwatchFiles(): void;
|
|
110
|
+
/**
|
|
111
|
+
* Preserve state for reload
|
|
112
|
+
*/
|
|
113
|
+
preserveState(key: string, value: unknown): void;
|
|
114
|
+
/**
|
|
115
|
+
* Get preserved state
|
|
116
|
+
*/
|
|
117
|
+
getPreservedState<T>(key: string): T | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Clear preserved state
|
|
120
|
+
*/
|
|
121
|
+
clearPreservedState(): void;
|
|
122
|
+
private emitEvent;
|
|
123
|
+
/**
|
|
124
|
+
* Cleanup resources
|
|
125
|
+
*/
|
|
126
|
+
dispose(): void;
|
|
127
|
+
/**
|
|
128
|
+
* Check if we should resume from a hot reload
|
|
129
|
+
*/
|
|
130
|
+
static shouldResume(): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Get preserved state from previous session
|
|
133
|
+
*/
|
|
134
|
+
static getResumeState(): Record<string, unknown> | null;
|
|
135
|
+
}
|
|
136
|
+
export declare function getHotReload(config?: HotReloadConfig): HotReload;
|
|
137
|
+
export declare function resetHotReload(): void;
|
|
138
|
+
/**
|
|
139
|
+
* Quick check and reload if update available
|
|
140
|
+
*/
|
|
141
|
+
export declare function checkAndReload(options?: {
|
|
142
|
+
preserveState?: Record<string, unknown>;
|
|
143
|
+
rlContext?: RLUpgradeContext;
|
|
144
|
+
logger?: (message: string) => void;
|
|
145
|
+
}): Promise<boolean>;
|
|
146
|
+
/**
|
|
147
|
+
* Enable auto-checking for updates
|
|
148
|
+
*/
|
|
149
|
+
export declare function enableAutoCheck(intervalMs?: number): void;
|
|
150
|
+
/**
|
|
151
|
+
* Disable auto-checking for updates
|
|
152
|
+
*/
|
|
153
|
+
export declare function disableAutoCheck(): void;
|
|
154
|
+
//# sourceMappingURL=hotReload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hotReload.d.ts","sourceRoot":"","sources":["../../src/core/hotReload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAM3C,OAAO,EAA4C,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQnG,MAAM,WAAW,eAAe;IAC9B,wCAAwC;IACxC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qDAAqD;IACrD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sBAAsB;IACtB,MAAM,CAAC,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