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,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced validation error with structured error information
|
|
3
|
+
*/
|
|
4
|
+
export class ToolArgumentValidationError extends Error {
|
|
5
|
+
issues;
|
|
6
|
+
toolName;
|
|
7
|
+
constructor(toolName, issues) {
|
|
8
|
+
super(formatMessage(toolName, issues));
|
|
9
|
+
this.name = 'ToolArgumentValidationError';
|
|
10
|
+
this.issues = issues;
|
|
11
|
+
this.toolName = toolName;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Runtime type guards for tool argument validation
|
|
16
|
+
*/
|
|
17
|
+
export var TypeGuards;
|
|
18
|
+
(function (TypeGuards) {
|
|
19
|
+
/**
|
|
20
|
+
* Type guard for string values
|
|
21
|
+
*/
|
|
22
|
+
function isString(value) {
|
|
23
|
+
return typeof value === 'string';
|
|
24
|
+
}
|
|
25
|
+
TypeGuards.isString = isString;
|
|
26
|
+
/**
|
|
27
|
+
* Type guard for number values
|
|
28
|
+
*/
|
|
29
|
+
function isNumber(value) {
|
|
30
|
+
return typeof value === 'number' && !Number.isNaN(value);
|
|
31
|
+
}
|
|
32
|
+
TypeGuards.isNumber = isNumber;
|
|
33
|
+
/**
|
|
34
|
+
* Type guard for boolean values
|
|
35
|
+
*/
|
|
36
|
+
function isBoolean(value) {
|
|
37
|
+
return typeof value === 'boolean';
|
|
38
|
+
}
|
|
39
|
+
TypeGuards.isBoolean = isBoolean;
|
|
40
|
+
/**
|
|
41
|
+
* Type guard for array values
|
|
42
|
+
*/
|
|
43
|
+
function isArray(value) {
|
|
44
|
+
return Array.isArray(value);
|
|
45
|
+
}
|
|
46
|
+
TypeGuards.isArray = isArray;
|
|
47
|
+
/**
|
|
48
|
+
* Type guard for object values
|
|
49
|
+
*/
|
|
50
|
+
function isObject(value) {
|
|
51
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
52
|
+
}
|
|
53
|
+
TypeGuards.isObject = isObject;
|
|
54
|
+
/**
|
|
55
|
+
* Type guard for non-null values
|
|
56
|
+
*/
|
|
57
|
+
function isNotNull(value) {
|
|
58
|
+
return value !== undefined && value !== null;
|
|
59
|
+
}
|
|
60
|
+
TypeGuards.isNotNull = isNotNull;
|
|
61
|
+
/**
|
|
62
|
+
* Type guard for enum values
|
|
63
|
+
*/
|
|
64
|
+
function isEnum(value, enumValues) {
|
|
65
|
+
return TypeGuards.isString(value) && enumValues.includes(value);
|
|
66
|
+
}
|
|
67
|
+
TypeGuards.isEnum = isEnum;
|
|
68
|
+
})(TypeGuards || (TypeGuards = {}));
|
|
69
|
+
/**
|
|
70
|
+
* Coerce loosely-typed tool arguments into their declared schema types.
|
|
71
|
+
* This makes tools resilient to providers that emit boolean/number values as strings.
|
|
72
|
+
*/
|
|
73
|
+
export function coerceToolArguments(schema, args) {
|
|
74
|
+
if (!schema || schema.type !== 'object' || !schema.properties) {
|
|
75
|
+
return args;
|
|
76
|
+
}
|
|
77
|
+
const coerced = { ...args };
|
|
78
|
+
for (const [key, definition] of Object.entries(schema.properties)) {
|
|
79
|
+
if (!Object.hasOwn(args, key)) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const value = args[key];
|
|
83
|
+
if (value === undefined || value === null) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
switch (definition.type) {
|
|
87
|
+
case 'boolean': {
|
|
88
|
+
const normalized = coerceBoolean(value);
|
|
89
|
+
coerced[key] = normalized;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
case 'number': {
|
|
93
|
+
const normalized = coerceNumber(value);
|
|
94
|
+
coerced[key] = normalized;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
default:
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return coerced;
|
|
102
|
+
}
|
|
103
|
+
function coerceBoolean(value) {
|
|
104
|
+
if (typeof value === 'boolean') {
|
|
105
|
+
return value;
|
|
106
|
+
}
|
|
107
|
+
if (typeof value === 'number') {
|
|
108
|
+
if (value === 1)
|
|
109
|
+
return true;
|
|
110
|
+
if (value === 0)
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (typeof value === 'string') {
|
|
114
|
+
const trimmed = value.trim().toLowerCase();
|
|
115
|
+
if (trimmed === 'true' || trimmed === '1')
|
|
116
|
+
return true;
|
|
117
|
+
if (trimmed === 'false' || trimmed === '0')
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
return value;
|
|
121
|
+
}
|
|
122
|
+
function coerceNumber(value) {
|
|
123
|
+
if (typeof value === 'number') {
|
|
124
|
+
// Reject NaN, Infinity, and -Infinity
|
|
125
|
+
if (!Number.isFinite(value)) {
|
|
126
|
+
return value; // Return as-is to fail validation
|
|
127
|
+
}
|
|
128
|
+
return value;
|
|
129
|
+
}
|
|
130
|
+
if (typeof value === 'string' && value.trim().length > 0) {
|
|
131
|
+
const parsed = Number(value);
|
|
132
|
+
// Only accept finite numbers
|
|
133
|
+
if (Number.isFinite(parsed)) {
|
|
134
|
+
return parsed;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return value;
|
|
138
|
+
}
|
|
139
|
+
export function validateToolArguments(toolName, schema, args) {
|
|
140
|
+
if (!schema || schema.type !== 'object') {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const errors = [];
|
|
144
|
+
const properties = schema.properties ?? {};
|
|
145
|
+
const required = Array.isArray(schema.required) ? schema.required : [];
|
|
146
|
+
for (const property of required) {
|
|
147
|
+
if (!hasArgument(args, property)) {
|
|
148
|
+
errors.push(`Missing required property "${property}".`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
for (const [key, value] of Object.entries(args)) {
|
|
152
|
+
const definition = properties[key];
|
|
153
|
+
if (!definition) {
|
|
154
|
+
// Silently ignore unknown properties - models sometimes hallucinate extra params
|
|
155
|
+
// This is more lenient than strict JSON schema validation but prevents errors
|
|
156
|
+
// when models pass extra parameters that don't affect tool behavior
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
validateSchemaProperty(definition, value, key, errors);
|
|
160
|
+
}
|
|
161
|
+
if (errors.length) {
|
|
162
|
+
throw new ToolArgumentValidationError(toolName, errors);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function validateSchemaProperty(definition, value, path, errors) {
|
|
166
|
+
switch (definition.type) {
|
|
167
|
+
case 'string': {
|
|
168
|
+
if (typeof value !== 'string') {
|
|
169
|
+
errors.push(`Argument "${path}" must be a string.`);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (definition.enum && !definition.enum.includes(value)) {
|
|
173
|
+
errors.push(`Argument "${path}" must be one of: ${definition.enum.map((entry) => `"${entry}"`).join(', ')}.`);
|
|
174
|
+
}
|
|
175
|
+
if (typeof definition.minLength === 'number' && value.length < definition.minLength) {
|
|
176
|
+
errors.push(`Argument "${path}" must be at least ${definition.minLength} character${definition.minLength === 1 ? '' : 's'} long.`);
|
|
177
|
+
}
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
case 'number': {
|
|
181
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
182
|
+
errors.push(`Argument "${path}" must be a finite number.`);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
// Validate minimum constraint
|
|
186
|
+
if (typeof definition.minimum === 'number' && value < definition.minimum) {
|
|
187
|
+
errors.push(`Argument "${path}" must be at least ${definition.minimum}.`);
|
|
188
|
+
}
|
|
189
|
+
// Validate maximum constraint
|
|
190
|
+
if (typeof definition.maximum === 'number' && value > definition.maximum) {
|
|
191
|
+
errors.push(`Argument "${path}" must be at most ${definition.maximum}.`);
|
|
192
|
+
}
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
case 'boolean': {
|
|
196
|
+
if (typeof value !== 'boolean') {
|
|
197
|
+
errors.push(`Argument "${path}" must be a boolean.`);
|
|
198
|
+
}
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
case 'array': {
|
|
202
|
+
if (!Array.isArray(value)) {
|
|
203
|
+
errors.push(`Argument "${path}" must be an array.`);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
validateArrayItems(definition, value, path, errors);
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
default:
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function validateArrayItems(definition, value, path, errors) {
|
|
214
|
+
const itemSchema = definition.items;
|
|
215
|
+
if (!itemSchema) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
219
|
+
const entry = value[index];
|
|
220
|
+
validateSchemaProperty(itemSchema, entry, `${path}[${index}]`, errors);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function hasArgument(args, key) {
|
|
224
|
+
if (!Object.hasOwn(args, key)) {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
const value = args[key];
|
|
228
|
+
return value !== undefined && value !== null;
|
|
229
|
+
}
|
|
230
|
+
function formatMessage(toolName, issues) {
|
|
231
|
+
const detail = issues.join(' ');
|
|
232
|
+
return `Invalid arguments for "${toolName}": ${detail}`;
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=schemaValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaValidator.js","sourceRoot":"","sources":["../../src/core/schemaValidator.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IAC3C,MAAM,CAAoB;IAC1B,QAAQ,CAAS;IAE1B,YAAY,QAAgB,EAAE,MAAgB;QAC5C,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,KAAW,UAAU,CAiD1B;AAjDD,WAAiB,UAAU;IACzB;;OAEG;IACH,SAAgB,QAAQ,CAAC,KAAc;QACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;IACnC,CAAC;IAFe,mBAAQ,WAEvB,CAAA;IAED;;OAEG;IACH,SAAgB,QAAQ,CAAC,KAAc;QACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,M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 'SMTP_PROVIDER' | 'SMTP_FROM_NAME' | 'SMTP_HOST' | 'SMTP_PORT';
|
|
3
|
+
export interface SecretDefinition {
|
|
4
|
+
id: SecretName;
|
|
5
|
+
label: string;
|
|
6
|
+
description: string;
|
|
7
|
+
envVar: SecretName;
|
|
8
|
+
providers: ProviderId[];
|
|
9
|
+
}
|
|
10
|
+
export declare class MissingSecretError extends Error {
|
|
11
|
+
readonly secret: SecretDefinition;
|
|
12
|
+
constructor(secret: SecretDefinition);
|
|
13
|
+
}
|
|
14
|
+
export declare function listSecretDefinitions(): SecretDefinition[];
|
|
15
|
+
export declare function getSecretDefinition(id: SecretName): SecretDefinition | null;
|
|
16
|
+
export declare function getSecretValue(id: SecretName): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Load all stored secrets into process.env at startup.
|
|
19
|
+
* This ensures secrets are available before any provider checks.
|
|
20
|
+
*
|
|
21
|
+
* IMPORTANT: Stored secrets always take precedence over environment variables
|
|
22
|
+
* for provider API keys. This ensures keys set via /secrets are used even if
|
|
23
|
+
* the user has old/stale keys exported in their shell environment.
|
|
24
|
+
*/
|
|
25
|
+
export declare function loadAllSecrets(): void;
|
|
26
|
+
export declare function setSecretValue(id: SecretName, rawValue: string): void;
|
|
27
|
+
export declare function maskSecret(value: string): string;
|
|
28
|
+
export declare function ensureSecretForProvider(provider: ProviderId): string;
|
|
29
|
+
export declare function getSecretDefinitionForProvider(provider: ProviderId): SecretDefinition | null;
|
|
30
|
+
/**
|
|
31
|
+
* Sanitize error messages to remove potential API keys and secrets.
|
|
32
|
+
* This prevents accidental token leakage in logs, error reports, and console output.
|
|
33
|
+
*
|
|
34
|
+
* @param message - The error message or string to sanitize
|
|
35
|
+
* @returns The sanitized string with secrets replaced by [REDACTED]
|
|
36
|
+
*/
|
|
37
|
+
export declare function sanitizeErrorMessage(message: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Sanitize an Error object's message and stack trace.
|
|
40
|
+
* Returns a new error message string with secrets removed.
|
|
41
|
+
*/
|
|
42
|
+
export declare function sanitizeError(error: Error): string;
|
|
43
|
+
/**
|
|
44
|
+
* Create a safe error message from an unknown error value.
|
|
45
|
+
* Ensures no secrets are leaked regardless of error type.
|
|
46
|
+
*/
|
|
47
|
+
export declare function safeErrorMessage(error: unknown): string;
|
|
48
|
+
//# sourceMappingURL=secretStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secretStore.d.ts","sourceRoot":"","sources":["../../src/core/secretStore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,MAAM,UAAU,GAClB,kBAAkB,GAClB,gBAAgB,GAChB,WAAW,GACX,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,UAAU,EAAE,CAAC;CACzB;AAqED,qBAAa,kBAAmB,SAAQ,KAAK;aACf,MAAM,EAAE,gBAAgB;gBAAxB,MAAM,EAAE,gBAAgB;CAIrD;AAED,wBAAgB,qBAAqB,IAAI,gBAAgB,EAAE,CAE1D;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,UAAU,GAAG,gBAAgB,GAAG,IAAI,CAE3E;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAc5D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAUrC;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAUrE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUhD;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,CAQpE;AAED,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,UAAU,GAAG,gBAAgB,GAAG,IAAI,CAE5F;AAwED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA4B5D;AAqCD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAQlD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAQvD"}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { dirname, join, resolve } from 'node:path';
|
|
4
|
+
const SECRET_DEFINITIONS = [
|
|
5
|
+
{
|
|
6
|
+
id: 'DEEPSEEK_API_KEY',
|
|
7
|
+
label: 'DeepSeek API Key',
|
|
8
|
+
description: 'Required to run DeepSeek Reasoner or Chat models.',
|
|
9
|
+
envVar: 'DEEPSEEK_API_KEY',
|
|
10
|
+
providers: ['deepseek'],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 'TAVILY_API_KEY',
|
|
14
|
+
label: 'Tavily API Key',
|
|
15
|
+
description: 'Required: WebSearch and WebExtract provider. Get yours at https://tavily.com',
|
|
16
|
+
envVar: 'TAVILY_API_KEY',
|
|
17
|
+
providers: [],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'SMTP_USER',
|
|
21
|
+
label: 'Email Address',
|
|
22
|
+
description: 'Your email address for sending emails (e.g., you@gmail.com).',
|
|
23
|
+
envVar: 'SMTP_USER',
|
|
24
|
+
providers: [],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'SMTP_PASSWORD',
|
|
28
|
+
label: 'Email App Password',
|
|
29
|
+
description: 'App password for your email (NOT your regular password). For Gmail: https://myaccount.google.com/apppasswords',
|
|
30
|
+
envVar: 'SMTP_PASSWORD',
|
|
31
|
+
providers: [],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'SMTP_PROVIDER',
|
|
35
|
+
label: 'Email Provider',
|
|
36
|
+
description: 'Email provider: gmail, outlook, yahoo, icloud, zoho (default: gmail).',
|
|
37
|
+
envVar: 'SMTP_PROVIDER',
|
|
38
|
+
providers: [],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'SMTP_FROM_NAME',
|
|
42
|
+
label: 'Email Display Name',
|
|
43
|
+
description: 'Optional: Display name shown in sent emails (e.g., "John Doe").',
|
|
44
|
+
envVar: 'SMTP_FROM_NAME',
|
|
45
|
+
providers: [],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'SMTP_HOST',
|
|
49
|
+
label: 'Custom SMTP Host',
|
|
50
|
+
description: 'Optional: Custom SMTP server hostname (only for non-standard providers).',
|
|
51
|
+
envVar: 'SMTP_HOST',
|
|
52
|
+
providers: [],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'SMTP_PORT',
|
|
56
|
+
label: 'Custom SMTP Port',
|
|
57
|
+
description: 'Optional: Custom SMTP port (only for non-standard providers, default: 587).',
|
|
58
|
+
envVar: 'SMTP_PORT',
|
|
59
|
+
providers: [],
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
const envAgiHome = process.env['AGI_HOME'];
|
|
63
|
+
const SECRET_DIR = envAgiHome ? resolve(envAgiHome) : join(homedir(), '.agi');
|
|
64
|
+
const SECRET_FILE = join(SECRET_DIR, 'secrets.json');
|
|
65
|
+
export class MissingSecretError extends Error {
|
|
66
|
+
secret;
|
|
67
|
+
constructor(secret) {
|
|
68
|
+
super(`${secret.label} is not configured.`);
|
|
69
|
+
this.secret = secret;
|
|
70
|
+
this.name = 'MissingSecretError';
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export function listSecretDefinitions() {
|
|
74
|
+
return [...SECRET_DEFINITIONS];
|
|
75
|
+
}
|
|
76
|
+
export function getSecretDefinition(id) {
|
|
77
|
+
return SECRET_DEFINITIONS.find((entry) => entry.id === id) ?? null;
|
|
78
|
+
}
|
|
79
|
+
export function getSecretValue(id) {
|
|
80
|
+
const envValue = sanitize(process.env[id]);
|
|
81
|
+
if (envValue) {
|
|
82
|
+
return envValue;
|
|
83
|
+
}
|
|
84
|
+
const store = readSecretStore();
|
|
85
|
+
const storedValue = sanitize(store[id]);
|
|
86
|
+
if (!storedValue) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
process.env[id] = storedValue;
|
|
90
|
+
return storedValue;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Load all stored secrets into process.env at startup.
|
|
94
|
+
* This ensures secrets are available before any provider checks.
|
|
95
|
+
*
|
|
96
|
+
* IMPORTANT: Stored secrets always take precedence over environment variables
|
|
97
|
+
* for provider API keys. This ensures keys set via /secrets are used even if
|
|
98
|
+
* the user has old/stale keys exported in their shell environment.
|
|
99
|
+
*/
|
|
100
|
+
export function loadAllSecrets() {
|
|
101
|
+
const store = readSecretStore();
|
|
102
|
+
for (const definition of SECRET_DEFINITIONS) {
|
|
103
|
+
const storedValue = sanitize(store[definition.id]);
|
|
104
|
+
if (storedValue) {
|
|
105
|
+
// Always use stored value for API keys to ensure /secrets takes precedence
|
|
106
|
+
// over potentially stale environment variables
|
|
107
|
+
process.env[definition.id] = storedValue;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export function setSecretValue(id, rawValue) {
|
|
112
|
+
const value = sanitize(rawValue);
|
|
113
|
+
if (!value) {
|
|
114
|
+
throw new Error('Secret value cannot be blank.');
|
|
115
|
+
}
|
|
116
|
+
const store = readSecretStore();
|
|
117
|
+
store[id] = value;
|
|
118
|
+
writeSecretStore(store);
|
|
119
|
+
process.env[id] = value;
|
|
120
|
+
}
|
|
121
|
+
export function maskSecret(value) {
|
|
122
|
+
if (!value) {
|
|
123
|
+
return '';
|
|
124
|
+
}
|
|
125
|
+
if (value.length <= 4) {
|
|
126
|
+
return '*'.repeat(value.length);
|
|
127
|
+
}
|
|
128
|
+
const suffix = value.slice(-4);
|
|
129
|
+
const prefix = '*'.repeat(Math.max(0, value.length - 4));
|
|
130
|
+
return `${prefix}${suffix}`;
|
|
131
|
+
}
|
|
132
|
+
export function ensureSecretForProvider(provider) {
|
|
133
|
+
const definition = findDefinitionForProvider(provider);
|
|
134
|
+
const value = getSecretValue(definition.id);
|
|
135
|
+
if (!value) {
|
|
136
|
+
throw new MissingSecretError(definition);
|
|
137
|
+
}
|
|
138
|
+
process.env[definition.envVar] = value;
|
|
139
|
+
return value;
|
|
140
|
+
}
|
|
141
|
+
export function getSecretDefinitionForProvider(provider) {
|
|
142
|
+
return SECRET_DEFINITIONS.find((entry) => entry.providers.includes(provider)) ?? null;
|
|
143
|
+
}
|
|
144
|
+
function readSecretStore() {
|
|
145
|
+
if (!existsSync(SECRET_FILE)) {
|
|
146
|
+
return {};
|
|
147
|
+
}
|
|
148
|
+
try {
|
|
149
|
+
const content = readFileSync(SECRET_FILE, 'utf8');
|
|
150
|
+
const parsed = JSON.parse(content);
|
|
151
|
+
if (parsed && typeof parsed === 'object') {
|
|
152
|
+
return parsed;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
return {};
|
|
157
|
+
}
|
|
158
|
+
return {};
|
|
159
|
+
}
|
|
160
|
+
function writeSecretStore(store) {
|
|
161
|
+
const directory = dirname(SECRET_FILE);
|
|
162
|
+
mkdirSync(directory, { recursive: true });
|
|
163
|
+
const payload = JSON.stringify(store, null, 2);
|
|
164
|
+
writeFileSync(SECRET_FILE, `${payload}
|
|
165
|
+
`);
|
|
166
|
+
}
|
|
167
|
+
function findDefinitionForProvider(provider) {
|
|
168
|
+
const definition = getSecretDefinitionForProvider(provider);
|
|
169
|
+
if (!definition) {
|
|
170
|
+
throw new Error(`No secret configuration for provider "${provider}".`);
|
|
171
|
+
}
|
|
172
|
+
return definition;
|
|
173
|
+
}
|
|
174
|
+
function sanitize(value) {
|
|
175
|
+
if (typeof value !== 'string') {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
const trimmed = value.trim();
|
|
179
|
+
return trimmed.length ? trimmed : null;
|
|
180
|
+
}
|
|
181
|
+
// ============================================================================
|
|
182
|
+
// Secret Sanitization for Error Messages
|
|
183
|
+
// ============================================================================
|
|
184
|
+
/**
|
|
185
|
+
* Known API key patterns to detect and sanitize in error messages.
|
|
186
|
+
* These patterns match common API key formats from various providers.
|
|
187
|
+
*/
|
|
188
|
+
const API_KEY_PATTERNS = [
|
|
189
|
+
// Anthropic API keys: sk-ant-api03-...
|
|
190
|
+
/sk-ant-api\d{2}-[A-Za-z0-9_-]{20,}/g,
|
|
191
|
+
// OpenAI API keys: sk-proj-... or sk-...
|
|
192
|
+
/sk-(?:proj-)?[A-Za-z0-9_-]{20,}/g,
|
|
193
|
+
// Generic Bearer tokens in headers
|
|
194
|
+
/Bearer\s+[A-Za-z0-9_.-]{20,}/gi,
|
|
195
|
+
// x-api-key header values
|
|
196
|
+
/x-api-key['":\s]+[A-Za-z0-9_.-]{20,}/gi,
|
|
197
|
+
// API keys in URLs (key=value pattern)
|
|
198
|
+
/[?&](?:key|api_key|apiKey|api-key|token|access_token)=([A-Za-z0-9_.-]{16,})/gi,
|
|
199
|
+
// DeepSeek keys
|
|
200
|
+
/sk-[a-f0-9]{32,}/gi,
|
|
201
|
+
// xAI/Grok keys
|
|
202
|
+
/xai-[A-Za-z0-9_-]{20,}/gi,
|
|
203
|
+
// Google/Gemini API keys (AIza...)
|
|
204
|
+
/AIza[A-Za-z0-9_-]{30,}/g,
|
|
205
|
+
// Generic long alphanumeric tokens that look like API keys
|
|
206
|
+
/(?:api[_-]?key|token|secret|password|credential)['"]?\s*[:=]\s*['"]?([A-Za-z0-9_.-]{20,})['"]?/gi,
|
|
207
|
+
];
|
|
208
|
+
/**
|
|
209
|
+
* Sanitize error messages to remove potential API keys and secrets.
|
|
210
|
+
* This prevents accidental token leakage in logs, error reports, and console output.
|
|
211
|
+
*
|
|
212
|
+
* @param message - The error message or string to sanitize
|
|
213
|
+
* @returns The sanitized string with secrets replaced by [REDACTED]
|
|
214
|
+
*/
|
|
215
|
+
export function sanitizeErrorMessage(message) {
|
|
216
|
+
if (!message || typeof message !== 'string') {
|
|
217
|
+
return message;
|
|
218
|
+
}
|
|
219
|
+
let sanitized = message;
|
|
220
|
+
// Apply all API key patterns
|
|
221
|
+
for (const pattern of API_KEY_PATTERNS) {
|
|
222
|
+
// Reset lastIndex for global patterns
|
|
223
|
+
pattern.lastIndex = 0;
|
|
224
|
+
sanitized = sanitized.replace(pattern, (match) => {
|
|
225
|
+
// For patterns with capture groups, try to preserve context
|
|
226
|
+
if (match.includes('=') || match.includes(':')) {
|
|
227
|
+
const separator = match.includes('=') ? '=' : ':';
|
|
228
|
+
const parts = match.split(separator);
|
|
229
|
+
if (parts.length === 2) {
|
|
230
|
+
return `${parts[0]}${separator}[REDACTED]`;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return '[REDACTED]';
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
// Additionally sanitize any env var values that are currently loaded
|
|
237
|
+
sanitized = sanitizeAgainstLoadedSecrets(sanitized);
|
|
238
|
+
return sanitized;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Sanitize a string against currently loaded secret values.
|
|
242
|
+
* This catches any secrets that might not match the pattern-based detection.
|
|
243
|
+
*/
|
|
244
|
+
function sanitizeAgainstLoadedSecrets(message) {
|
|
245
|
+
const secretNames = [
|
|
246
|
+
'DEEPSEEK_API_KEY',
|
|
247
|
+
'TAVILY_API_KEY',
|
|
248
|
+
'SMTP_PASSWORD',
|
|
249
|
+
];
|
|
250
|
+
let sanitized = message;
|
|
251
|
+
for (const name of secretNames) {
|
|
252
|
+
const value = process.env[name];
|
|
253
|
+
if (value && value.length >= 4) {
|
|
254
|
+
// Only sanitize if the value appears in the message
|
|
255
|
+
// Use a case-sensitive exact match to avoid false positives
|
|
256
|
+
if (sanitized.includes(value)) {
|
|
257
|
+
sanitized = sanitized.split(value).join('[REDACTED]');
|
|
258
|
+
}
|
|
259
|
+
// Also sanitize partial matches (first 8 chars + last 4 chars pattern)
|
|
260
|
+
if (value.length >= 12) {
|
|
261
|
+
const partialPattern = `${value.substring(0, 8)}...${value.substring(value.length - 4)}`;
|
|
262
|
+
if (sanitized.includes(partialPattern)) {
|
|
263
|
+
sanitized = sanitized.split(partialPattern).join('[REDACTED_PARTIAL]');
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return sanitized;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Sanitize an Error object's message and stack trace.
|
|
272
|
+
* Returns a new error message string with secrets removed.
|
|
273
|
+
*/
|
|
274
|
+
export function sanitizeError(error) {
|
|
275
|
+
const message = sanitizeErrorMessage(error.message);
|
|
276
|
+
const stack = error.stack ? sanitizeErrorMessage(error.stack) : '';
|
|
277
|
+
if (stack && stack !== message) {
|
|
278
|
+
return `${message}\n${stack}`;
|
|
279
|
+
}
|
|
280
|
+
return message;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Create a safe error message from an unknown error value.
|
|
284
|
+
* Ensures no secrets are leaked regardless of error type.
|
|
285
|
+
*/
|
|
286
|
+
export function safeErrorMessage(error) {
|
|
287
|
+
if (error instanceof Error) {
|
|
288
|
+
return sanitizeErrorMessage(error.message);
|
|
289
|
+
}
|
|
290
|
+
if (typeof error === 'string') {
|
|
291
|
+
return sanitizeErrorMessage(error);
|
|
292
|
+
}
|
|
293
|
+
return 'Unknown error occurred';
|
|
294
|
+
}
|
|
295
|
+
//# sourceMappingURL=secretStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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