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,740 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model discovery system for auto-detecting new models from providers.
|
|
3
|
+
*
|
|
4
|
+
* This module queries provider APIs to discover available models and caches
|
|
5
|
+
* them for use alongside the static model schema. It never modifies the
|
|
6
|
+
* static schema - discoveries are stored separately and merged at runtime.
|
|
7
|
+
*/
|
|
8
|
+
import { readFileSync, writeFileSync, existsSync } from 'node:fs';
|
|
9
|
+
import { mkdir } from 'node:fs/promises';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { homedir } from 'node:os';
|
|
12
|
+
import { safeErrorMessage } from './secretStore.js';
|
|
13
|
+
import { logDebug } from '../utils/debugLogger.js';
|
|
14
|
+
/**
|
|
15
|
+
* Discovered model cache file location
|
|
16
|
+
*/
|
|
17
|
+
const CACHE_DIR = join(homedir(), '.agi');
|
|
18
|
+
const CACHE_FILE = join(CACHE_DIR, 'discovered-models.json');
|
|
19
|
+
/**
|
|
20
|
+
* Cache expiration time (24 hours)
|
|
21
|
+
*/
|
|
22
|
+
const CACHE_EXPIRATION_MS = 24 * 60 * 60 * 1000;
|
|
23
|
+
const MODEL_PROVIDER_HINTS = [
|
|
24
|
+
{ provider: 'deepseek', patterns: [/^deepseek/i, /./] }, // DeepSeek is the only supported provider
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* Infer provider from a model identifier.
|
|
28
|
+
*/
|
|
29
|
+
export function inferProviderFromModelId(modelId) {
|
|
30
|
+
if (!modelId)
|
|
31
|
+
return null;
|
|
32
|
+
const normalized = modelId.trim().toLowerCase();
|
|
33
|
+
for (const hint of MODEL_PROVIDER_HINTS) {
|
|
34
|
+
if (hint.patterns.some((pattern) => pattern.test(normalized))) {
|
|
35
|
+
return hint.provider;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get cached discovered models
|
|
42
|
+
*/
|
|
43
|
+
export function getCachedDiscoveredModels() {
|
|
44
|
+
try {
|
|
45
|
+
if (!existsSync(CACHE_FILE)) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
const raw = readFileSync(CACHE_FILE, 'utf-8');
|
|
49
|
+
const cache = JSON.parse(raw);
|
|
50
|
+
// Check if cache is expired
|
|
51
|
+
const lastUpdated = new Date(cache.lastUpdated).getTime();
|
|
52
|
+
const now = Date.now();
|
|
53
|
+
if (now - lastUpdated > CACHE_EXPIRATION_MS) {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
return cache.models;
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
logDebug('Failed to read discovered models cache:', safeErrorMessage(error));
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Save discovered models to cache
|
|
65
|
+
*/
|
|
66
|
+
async function saveDiscoveredModels(models) {
|
|
67
|
+
try {
|
|
68
|
+
await mkdir(CACHE_DIR, { recursive: true });
|
|
69
|
+
const cache = {
|
|
70
|
+
version: '1.0.0',
|
|
71
|
+
lastUpdated: new Date().toISOString(),
|
|
72
|
+
models,
|
|
73
|
+
};
|
|
74
|
+
writeFileSync(CACHE_FILE, JSON.stringify(cache, null, 2), 'utf-8');
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
logDebug('Failed to save discovered models cache:', safeErrorMessage(error));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Discover models from OpenAI
|
|
82
|
+
*/
|
|
83
|
+
async function discoverOpenAIModels(apiKey) {
|
|
84
|
+
const provider = 'openai';
|
|
85
|
+
try {
|
|
86
|
+
const response = await fetch('https://api.openai.com/v1/models', {
|
|
87
|
+
headers: {
|
|
88
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
if (!response.ok) {
|
|
92
|
+
throw new Error(`API returned ${response.status}: ${response.statusText}`);
|
|
93
|
+
}
|
|
94
|
+
const data = await response.json();
|
|
95
|
+
// Filter for GPT models only and create ModelConfig objects
|
|
96
|
+
const models = data.data
|
|
97
|
+
.filter(model => {
|
|
98
|
+
// Allow both dash and non-dash variants for newer reasoning SKUs (o1/o3)
|
|
99
|
+
return (model.id.startsWith('gpt-') ||
|
|
100
|
+
model.id.startsWith('o1') ||
|
|
101
|
+
model.id.startsWith('o3') ||
|
|
102
|
+
model.id.startsWith('codex-'));
|
|
103
|
+
})
|
|
104
|
+
.map(model => ({
|
|
105
|
+
id: model.id,
|
|
106
|
+
label: model.id,
|
|
107
|
+
provider,
|
|
108
|
+
description: `OpenAI ${model.id} (auto-discovered)`,
|
|
109
|
+
capabilities: ['chat', 'tools', 'streaming'],
|
|
110
|
+
}));
|
|
111
|
+
return {
|
|
112
|
+
provider,
|
|
113
|
+
success: true,
|
|
114
|
+
models,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
return {
|
|
119
|
+
provider,
|
|
120
|
+
success: false,
|
|
121
|
+
models: [],
|
|
122
|
+
error: error instanceof Error ? error.message : String(error),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Discover models from Anthropic
|
|
128
|
+
*/
|
|
129
|
+
async function discoverAnthropicModels(apiKey) {
|
|
130
|
+
const provider = 'anthropic';
|
|
131
|
+
try {
|
|
132
|
+
const response = await fetch('https://api.anthropic.com/v1/models', {
|
|
133
|
+
headers: {
|
|
134
|
+
'x-api-key': apiKey,
|
|
135
|
+
'anthropic-version': '2023-06-01',
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
if (!response.ok) {
|
|
139
|
+
throw new Error(`API returned ${response.status}: ${response.statusText}`);
|
|
140
|
+
}
|
|
141
|
+
const data = await response.json();
|
|
142
|
+
const models = data.data
|
|
143
|
+
.filter(model => model.type === 'model')
|
|
144
|
+
.map(model => ({
|
|
145
|
+
id: model.id,
|
|
146
|
+
label: model.display_name || model.id,
|
|
147
|
+
provider,
|
|
148
|
+
description: `Anthropic ${model.display_name || model.id} (auto-discovered)`,
|
|
149
|
+
capabilities: ['chat', 'reasoning', 'tools', 'streaming'],
|
|
150
|
+
}));
|
|
151
|
+
return {
|
|
152
|
+
provider,
|
|
153
|
+
success: true,
|
|
154
|
+
models,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
return {
|
|
159
|
+
provider,
|
|
160
|
+
success: false,
|
|
161
|
+
models: [],
|
|
162
|
+
error: error instanceof Error ? error.message : String(error),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Discover models from Google Gemini
|
|
168
|
+
* Note: Google's models API often requires special permissions.
|
|
169
|
+
* Falls back to known models if API access fails.
|
|
170
|
+
*/
|
|
171
|
+
async function discoverGoogleModels(apiKey) {
|
|
172
|
+
const provider = 'google';
|
|
173
|
+
// Known Google Gemini models (fallback if API doesn't work) - Updated Dec 2025
|
|
174
|
+
const knownModels = [
|
|
175
|
+
{ id: 'gemini-3.0-pro', label: 'Gemini 3.0 Pro', provider, description: 'Latest Gemini with best reasoning and coding', capabilities: ['chat', 'reasoning', 'tools', 'streaming', 'multimodal'] },
|
|
176
|
+
{ id: 'gemini-3.0-flash', label: 'Gemini 3.0 Flash', provider, description: 'Fast Gemini 3.0 model', capabilities: ['chat', 'reasoning', 'tools', 'streaming', 'multimodal'] },
|
|
177
|
+
{ id: 'gemini-2.5-pro', label: 'Gemini 2.5 Pro', provider, description: 'Capable Gemini model with advanced reasoning', capabilities: ['chat', 'reasoning', 'tools', 'streaming', 'multimodal'] },
|
|
178
|
+
{ id: 'gemini-2.5-flash', label: 'Gemini 2.5 Flash', provider, description: 'Fast Gemini 2.5 with reasoning', capabilities: ['chat', 'reasoning', 'tools', 'streaming', 'multimodal'] },
|
|
179
|
+
{ id: 'gemini-2.0-flash', label: 'Gemini 2.0 Flash', provider, description: 'Gemini 2.0 with native tool use', capabilities: ['chat', 'tools', 'streaming', 'multimodal'] },
|
|
180
|
+
];
|
|
181
|
+
try {
|
|
182
|
+
// SECURITY: Use x-goog-api-key header instead of URL query parameter
|
|
183
|
+
// to prevent API key leakage in logs, error messages, and browser history
|
|
184
|
+
const response = await fetch('https://generativelanguage.googleapis.com/v1beta/models', {
|
|
185
|
+
headers: {
|
|
186
|
+
'x-goog-api-key': apiKey,
|
|
187
|
+
},
|
|
188
|
+
signal: AbortSignal.timeout(24 * 60 * 60 * 1000),
|
|
189
|
+
});
|
|
190
|
+
if (!response.ok) {
|
|
191
|
+
// API access restricted - return known models with warning
|
|
192
|
+
return {
|
|
193
|
+
provider,
|
|
194
|
+
success: true, // Consider it success with fallback
|
|
195
|
+
models: knownModels,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
const data = await response.json();
|
|
199
|
+
const models = data.models
|
|
200
|
+
.filter(model => model.name.includes('gemini') &&
|
|
201
|
+
model.supportedGenerationMethods?.includes('generateContent'))
|
|
202
|
+
.map(model => {
|
|
203
|
+
const id = model.name.replace('models/', '');
|
|
204
|
+
return {
|
|
205
|
+
id,
|
|
206
|
+
label: id,
|
|
207
|
+
provider,
|
|
208
|
+
description: `${model.displayName} (auto-discovered)`,
|
|
209
|
+
capabilities: ['chat', 'reasoning', 'tools', 'streaming', 'multimodal'],
|
|
210
|
+
};
|
|
211
|
+
});
|
|
212
|
+
return {
|
|
213
|
+
provider,
|
|
214
|
+
success: true,
|
|
215
|
+
models: models.length > 0 ? models : knownModels,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
catch {
|
|
219
|
+
// Network error or timeout - return known models
|
|
220
|
+
return {
|
|
221
|
+
provider,
|
|
222
|
+
success: true,
|
|
223
|
+
models: knownModels,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Discover models from DeepSeek (OpenAI-compatible)
|
|
229
|
+
*/
|
|
230
|
+
async function discoverDeepSeekModels(apiKey) {
|
|
231
|
+
const provider = 'deepseek';
|
|
232
|
+
try {
|
|
233
|
+
const response = await fetch('https://api.deepseek.com/v1/models', {
|
|
234
|
+
headers: {
|
|
235
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
236
|
+
},
|
|
237
|
+
});
|
|
238
|
+
if (!response.ok) {
|
|
239
|
+
throw new Error(`API returned ${response.status}: ${response.statusText}`);
|
|
240
|
+
}
|
|
241
|
+
const data = await response.json();
|
|
242
|
+
const models = data.data.map(model => ({
|
|
243
|
+
id: model.id,
|
|
244
|
+
label: model.id,
|
|
245
|
+
provider,
|
|
246
|
+
description: `DeepSeek ${model.id} (auto-discovered)`,
|
|
247
|
+
capabilities: ['chat', 'reasoning', 'tools', 'streaming'],
|
|
248
|
+
}));
|
|
249
|
+
return {
|
|
250
|
+
provider,
|
|
251
|
+
success: true,
|
|
252
|
+
models,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
return {
|
|
257
|
+
provider,
|
|
258
|
+
success: false,
|
|
259
|
+
models: [],
|
|
260
|
+
error: error instanceof Error ? error.message : String(error),
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Discover models from xAI (OpenAI-compatible)
|
|
266
|
+
*/
|
|
267
|
+
async function discoverXAIModels(apiKey) {
|
|
268
|
+
const provider = 'xai';
|
|
269
|
+
try {
|
|
270
|
+
const response = await fetch('https://api.x.ai/v1/models', {
|
|
271
|
+
headers: {
|
|
272
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
if (!response.ok) {
|
|
276
|
+
throw new Error(`API returned ${response.status}: ${response.statusText}`);
|
|
277
|
+
}
|
|
278
|
+
const data = await response.json();
|
|
279
|
+
const models = data.data.map(model => ({
|
|
280
|
+
id: model.id,
|
|
281
|
+
label: model.id,
|
|
282
|
+
provider,
|
|
283
|
+
description: `xAI ${model.id} (auto-discovered)`,
|
|
284
|
+
capabilities: ['chat', 'reasoning', 'tools', 'streaming'],
|
|
285
|
+
}));
|
|
286
|
+
return {
|
|
287
|
+
provider,
|
|
288
|
+
success: true,
|
|
289
|
+
models,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
catch (error) {
|
|
293
|
+
return {
|
|
294
|
+
provider,
|
|
295
|
+
success: false,
|
|
296
|
+
models: [],
|
|
297
|
+
error: error instanceof Error ? error.message : String(error),
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Discover models from Ollama (local)
|
|
303
|
+
*/
|
|
304
|
+
async function discoverOllamaModels() {
|
|
305
|
+
const provider = 'ollama';
|
|
306
|
+
const baseURL = process.env['OLLAMA_BASE_URL'] || 'http://localhost:11434';
|
|
307
|
+
try {
|
|
308
|
+
const response = await fetch(`${baseURL}/api/tags`, {
|
|
309
|
+
signal: AbortSignal.timeout(24 * 60 * 60 * 1000), // 24 hour timeout
|
|
310
|
+
});
|
|
311
|
+
if (!response.ok) {
|
|
312
|
+
throw new Error(`API returned ${response.status}: ${response.statusText}`);
|
|
313
|
+
}
|
|
314
|
+
const data = await response.json();
|
|
315
|
+
const models = (data.models || []).map(model => ({
|
|
316
|
+
id: model.name,
|
|
317
|
+
label: model.name,
|
|
318
|
+
provider,
|
|
319
|
+
description: `Local Ollama model: ${model.name} (auto-discovered)`,
|
|
320
|
+
capabilities: ['chat', 'tools', 'streaming'],
|
|
321
|
+
}));
|
|
322
|
+
return {
|
|
323
|
+
provider,
|
|
324
|
+
success: true,
|
|
325
|
+
models,
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
catch (error) {
|
|
329
|
+
return {
|
|
330
|
+
provider,
|
|
331
|
+
success: false,
|
|
332
|
+
models: [],
|
|
333
|
+
error: error instanceof Error ? error.message : String(error),
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Discover models from Qwen (Alibaba Cloud DashScope - OpenAI-compatible)
|
|
339
|
+
*/
|
|
340
|
+
async function discoverQwenModels(apiKey) {
|
|
341
|
+
const provider = 'qwen';
|
|
342
|
+
try {
|
|
343
|
+
// DashScope uses OpenAI-compatible API
|
|
344
|
+
const response = await fetch('https://dashscope.aliyuncs.com/compatible-mode/v1/models', {
|
|
345
|
+
headers: {
|
|
346
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
347
|
+
},
|
|
348
|
+
});
|
|
349
|
+
if (!response.ok) {
|
|
350
|
+
throw new Error(`API returned ${response.status}: ${response.statusText}`);
|
|
351
|
+
}
|
|
352
|
+
const data = await response.json();
|
|
353
|
+
// Filter for Qwen models and prioritize latest versions
|
|
354
|
+
const qwenModels = data.data
|
|
355
|
+
.filter(model => model.id.toLowerCase().includes('qwen'))
|
|
356
|
+
.map(model => ({
|
|
357
|
+
id: model.id,
|
|
358
|
+
label: model.id,
|
|
359
|
+
provider,
|
|
360
|
+
description: `Alibaba Qwen ${model.id} (auto-discovered)`,
|
|
361
|
+
capabilities: ['chat', 'reasoning', 'tools', 'streaming'],
|
|
362
|
+
}));
|
|
363
|
+
return {
|
|
364
|
+
provider,
|
|
365
|
+
success: true,
|
|
366
|
+
models: qwenModels,
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
// Fallback to known models if API fails
|
|
371
|
+
const fallbackModels = [
|
|
372
|
+
{ id: 'qwen-max', label: 'Qwen Max', provider, description: 'Qwen Max - most capable', capabilities: ['chat', 'reasoning', 'tools', 'streaming'] },
|
|
373
|
+
{ id: 'qwen-plus', label: 'Qwen Plus', provider, description: 'Qwen Plus - balanced', capabilities: ['chat', 'reasoning', 'tools', 'streaming'] },
|
|
374
|
+
{ id: 'qwen-turbo', label: 'Qwen Turbo', provider, description: 'Qwen Turbo - fast', capabilities: ['chat', 'tools', 'streaming'] },
|
|
375
|
+
];
|
|
376
|
+
return {
|
|
377
|
+
provider,
|
|
378
|
+
success: false,
|
|
379
|
+
models: fallbackModels,
|
|
380
|
+
error: error instanceof Error ? error.message : String(error),
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Discover models from all configured providers
|
|
386
|
+
*
|
|
387
|
+
* PERF: Uses Promise.allSettled for parallel discovery - all providers queried
|
|
388
|
+
* simultaneously. No single slow/failed provider blocks the others.
|
|
389
|
+
*/
|
|
390
|
+
export async function discoverAllModels() {
|
|
391
|
+
const errors = [];
|
|
392
|
+
let totalModelsDiscovered = 0;
|
|
393
|
+
// Discover from each provider if API key is available
|
|
394
|
+
const providers = [
|
|
395
|
+
{ id: 'deepseek', envVar: 'DEEPSEEK_API_KEY', discover: discoverDeepSeekModels },
|
|
396
|
+
];
|
|
397
|
+
// PERF: Build discovery promises in parallel
|
|
398
|
+
const discoveryPromises = providers.map(async (provider) => {
|
|
399
|
+
const apiKey = process.env[provider.envVar];
|
|
400
|
+
if (!apiKey) {
|
|
401
|
+
return {
|
|
402
|
+
provider: provider.id,
|
|
403
|
+
success: false,
|
|
404
|
+
models: [],
|
|
405
|
+
error: `API key not configured (${provider.envVar})`,
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
try {
|
|
409
|
+
return await provider.discover(apiKey);
|
|
410
|
+
}
|
|
411
|
+
catch (error) {
|
|
412
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
413
|
+
return {
|
|
414
|
+
provider: provider.id,
|
|
415
|
+
success: false,
|
|
416
|
+
models: [],
|
|
417
|
+
error: errorMessage,
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
// PERF: Execute ALL provider discoveries in parallel using Promise.allSettled
|
|
422
|
+
// This ensures one slow/failed provider doesn't block others
|
|
423
|
+
const settledResults = await Promise.allSettled(discoveryPromises);
|
|
424
|
+
// Process results
|
|
425
|
+
const results = settledResults.map((settled, index) => {
|
|
426
|
+
if (settled.status === 'fulfilled') {
|
|
427
|
+
return settled.value;
|
|
428
|
+
}
|
|
429
|
+
// Promise rejected (shouldn't happen with our error handling, but be safe)
|
|
430
|
+
const providerId = index < providers.length
|
|
431
|
+
? providers[index].id
|
|
432
|
+
: 'ollama';
|
|
433
|
+
return {
|
|
434
|
+
provider: providerId,
|
|
435
|
+
success: false,
|
|
436
|
+
models: [],
|
|
437
|
+
error: settled.reason instanceof Error ? settled.reason.message : String(settled.reason),
|
|
438
|
+
};
|
|
439
|
+
});
|
|
440
|
+
// Collect errors and count models
|
|
441
|
+
for (const result of results) {
|
|
442
|
+
if (result.success) {
|
|
443
|
+
totalModelsDiscovered += result.models.length;
|
|
444
|
+
}
|
|
445
|
+
else if (result.error) {
|
|
446
|
+
// Don't add Ollama connection errors (it's often not running)
|
|
447
|
+
if (result.provider === 'ollama' &&
|
|
448
|
+
(result.error.includes('ECONNREFUSED') ||
|
|
449
|
+
result.error.includes('fetch failed') ||
|
|
450
|
+
result.error.includes('Connection failed'))) {
|
|
451
|
+
continue;
|
|
452
|
+
}
|
|
453
|
+
errors.push(`${result.provider}: ${result.error}`);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
// Collect all discovered models
|
|
457
|
+
const allModels = results
|
|
458
|
+
.filter(r => r.success)
|
|
459
|
+
.flatMap(r => r.models);
|
|
460
|
+
// Save to cache
|
|
461
|
+
if (allModels.length > 0) {
|
|
462
|
+
await saveDiscoveredModels(allModels);
|
|
463
|
+
}
|
|
464
|
+
return {
|
|
465
|
+
success: errors.length === 0,
|
|
466
|
+
timestamp: new Date().toISOString(),
|
|
467
|
+
results,
|
|
468
|
+
totalModelsDiscovered,
|
|
469
|
+
errors,
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Clear the discovered models cache
|
|
474
|
+
*/
|
|
475
|
+
export function clearDiscoveredModelsCache() {
|
|
476
|
+
try {
|
|
477
|
+
if (existsSync(CACHE_FILE)) {
|
|
478
|
+
writeFileSync(CACHE_FILE, JSON.stringify({ version: '1.0.0', lastUpdated: new Date().toISOString(), models: [] }, null, 2), 'utf-8');
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
catch (error) {
|
|
482
|
+
logDebug('Failed to clear discovered models cache:', safeErrorMessage(error));
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Supported providers with their environment variable requirements
|
|
487
|
+
*/
|
|
488
|
+
const PROVIDER_CONFIGS = [
|
|
489
|
+
{
|
|
490
|
+
id: 'deepseek',
|
|
491
|
+
name: 'DeepSeek',
|
|
492
|
+
envVar: 'DEEPSEEK_API_KEY',
|
|
493
|
+
defaultLatestModel: 'deepseek-reasoner',
|
|
494
|
+
fallbackModels: ['deepseek-chat']
|
|
495
|
+
},
|
|
496
|
+
];
|
|
497
|
+
/**
|
|
498
|
+
* Model priority rankings for selecting the "best" model
|
|
499
|
+
*/
|
|
500
|
+
const MODEL_PRIORITIES = {
|
|
501
|
+
deepseek: {
|
|
502
|
+
'deepseek-reasoner': 100,
|
|
503
|
+
'deepseek-chat': 90,
|
|
504
|
+
'deepseek-coder': 85,
|
|
505
|
+
},
|
|
506
|
+
};
|
|
507
|
+
/**
|
|
508
|
+
* Get model priority for sorting
|
|
509
|
+
*/
|
|
510
|
+
function getModelPriority(provider, modelId) {
|
|
511
|
+
const priorities = MODEL_PRIORITIES[provider];
|
|
512
|
+
if (!priorities)
|
|
513
|
+
return 0;
|
|
514
|
+
// Check for exact match first
|
|
515
|
+
if (priorities[modelId] !== undefined) {
|
|
516
|
+
return priorities[modelId];
|
|
517
|
+
}
|
|
518
|
+
// Check for prefix match
|
|
519
|
+
for (const [prefix, priority] of Object.entries(priorities)) {
|
|
520
|
+
if (modelId.startsWith(prefix)) {
|
|
521
|
+
return priority;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
return 0;
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Sort models by priority (best first)
|
|
528
|
+
*/
|
|
529
|
+
export function sortModelsByPriority(provider, models) {
|
|
530
|
+
return [...models].sort((a, b) => {
|
|
531
|
+
const priorityA = getModelPriority(provider, a);
|
|
532
|
+
const priorityB = getModelPriority(provider, b);
|
|
533
|
+
return priorityB - priorityA;
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Get the best/latest model for a provider
|
|
538
|
+
*/
|
|
539
|
+
export function getBestModel(provider, models) {
|
|
540
|
+
if (models.length === 0) {
|
|
541
|
+
const config = PROVIDER_CONFIGS.find(p => p.id === provider);
|
|
542
|
+
return config?.defaultLatestModel || '';
|
|
543
|
+
}
|
|
544
|
+
const sorted = sortModelsByPriority(provider, models);
|
|
545
|
+
return sorted[0] ?? models[0] ?? '';
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Check if a provider is configured (has API key or is accessible)
|
|
549
|
+
*/
|
|
550
|
+
export function isProviderConfigured(providerId) {
|
|
551
|
+
const config = PROVIDER_CONFIGS.find(p => p.id === providerId);
|
|
552
|
+
if (!config)
|
|
553
|
+
return false;
|
|
554
|
+
// Ollama is special - it's available if the server is running (no API key needed)
|
|
555
|
+
if (providerId === 'ollama') {
|
|
556
|
+
// We'll check this via actual connection, return true for now
|
|
557
|
+
// The actual check happens in getConfiguredProviders
|
|
558
|
+
return true;
|
|
559
|
+
}
|
|
560
|
+
// Check main env var
|
|
561
|
+
if (process.env[config.envVar]) {
|
|
562
|
+
return true;
|
|
563
|
+
}
|
|
564
|
+
// Check alternative env vars
|
|
565
|
+
if (config.altEnvVars) {
|
|
566
|
+
for (const altVar of config.altEnvVars) {
|
|
567
|
+
if (process.env[altVar]) {
|
|
568
|
+
return true;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
return false;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Get all providers with their configuration status
|
|
576
|
+
*/
|
|
577
|
+
export function getProvidersStatus() {
|
|
578
|
+
return PROVIDER_CONFIGS.map(config => {
|
|
579
|
+
let configured = false;
|
|
580
|
+
if (config.id === 'ollama') {
|
|
581
|
+
// For Ollama, we can't check synchronously if it's running
|
|
582
|
+
// Mark as potentially available
|
|
583
|
+
configured = !!process.env['OLLAMA_BASE_URL'] || true; // Always show Ollama as option
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
configured = !!process.env[config.envVar];
|
|
587
|
+
if (!configured && config.altEnvVars) {
|
|
588
|
+
configured = config.altEnvVars.some(v => !!process.env[v]);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
return {
|
|
592
|
+
id: config.id,
|
|
593
|
+
name: config.name,
|
|
594
|
+
envVar: config.envVar,
|
|
595
|
+
configured,
|
|
596
|
+
latestModel: config.defaultLatestModel,
|
|
597
|
+
};
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Get list of configured providers (with valid API keys)
|
|
602
|
+
*/
|
|
603
|
+
export function getConfiguredProviders() {
|
|
604
|
+
return getProvidersStatus().filter(p => p.configured);
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Get list of unconfigured providers
|
|
608
|
+
*/
|
|
609
|
+
export function getUnconfiguredProviders() {
|
|
610
|
+
return getProvidersStatus().filter(p => !p.configured);
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Get the first available provider (for auto-selection)
|
|
614
|
+
*/
|
|
615
|
+
export function getFirstAvailableProvider() {
|
|
616
|
+
const configured = getConfiguredProviders();
|
|
617
|
+
// DeepSeek is the only supported provider
|
|
618
|
+
const preferenceOrder = ['deepseek'];
|
|
619
|
+
for (const providerId of preferenceOrder) {
|
|
620
|
+
const provider = configured.find(p => p.id === providerId);
|
|
621
|
+
if (provider) {
|
|
622
|
+
return provider;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
return null;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Get latest model for a provider from cache or defaults
|
|
629
|
+
*/
|
|
630
|
+
export function getLatestModelForProvider(providerId) {
|
|
631
|
+
// Check cache first
|
|
632
|
+
const cached = getCachedDiscoveredModels();
|
|
633
|
+
const providerModels = cached.filter(m => m.provider === providerId);
|
|
634
|
+
if (providerModels.length > 0) {
|
|
635
|
+
const modelIds = providerModels.map(m => m.id);
|
|
636
|
+
return getBestModel(providerId, modelIds);
|
|
637
|
+
}
|
|
638
|
+
// Fall back to default
|
|
639
|
+
const config = PROVIDER_CONFIGS.find(p => p.id === providerId);
|
|
640
|
+
return config?.defaultLatestModel || '';
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Quick API check for a single provider - returns best model or null
|
|
644
|
+
*/
|
|
645
|
+
async function quickFetchProviderModels(providerId, apiKey, timeoutMs = 24 * 60 * 60 * 1000) {
|
|
646
|
+
try {
|
|
647
|
+
if (providerId === 'deepseek') {
|
|
648
|
+
const response = await fetch('https://api.deepseek.com/v1/models', {
|
|
649
|
+
headers: { 'Authorization': `Bearer ${apiKey}` },
|
|
650
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
651
|
+
});
|
|
652
|
+
if (!response.ok)
|
|
653
|
+
return [];
|
|
654
|
+
const data = await response.json();
|
|
655
|
+
return data.data.map(m => m.id);
|
|
656
|
+
}
|
|
657
|
+
return [];
|
|
658
|
+
}
|
|
659
|
+
catch {
|
|
660
|
+
return [];
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* Quickly check if providers are available by querying their APIs
|
|
665
|
+
* Returns actual latest models from each provider
|
|
666
|
+
*/
|
|
667
|
+
export async function quickCheckProviders() {
|
|
668
|
+
const checks = [];
|
|
669
|
+
for (const config of PROVIDER_CONFIGS) {
|
|
670
|
+
// Handle Ollama separately (no API key needed)
|
|
671
|
+
if (config.id === 'ollama') {
|
|
672
|
+
checks.push((async () => {
|
|
673
|
+
try {
|
|
674
|
+
const baseURL = process.env['OLLAMA_BASE_URL'] || 'http://localhost:11434';
|
|
675
|
+
const response = await fetch(`${baseURL}/api/tags`, {
|
|
676
|
+
signal: AbortSignal.timeout(24 * 60 * 60 * 1000),
|
|
677
|
+
});
|
|
678
|
+
if (response.ok) {
|
|
679
|
+
const data = await response.json();
|
|
680
|
+
const models = data.models?.map(m => m.name) || [];
|
|
681
|
+
return {
|
|
682
|
+
provider: 'ollama',
|
|
683
|
+
available: models.length > 0,
|
|
684
|
+
latestModel: models[0] || config.defaultLatestModel,
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
catch { /* ignore */ }
|
|
689
|
+
return {
|
|
690
|
+
provider: 'ollama',
|
|
691
|
+
available: false,
|
|
692
|
+
latestModel: config.defaultLatestModel,
|
|
693
|
+
error: 'Not running',
|
|
694
|
+
};
|
|
695
|
+
})());
|
|
696
|
+
continue;
|
|
697
|
+
}
|
|
698
|
+
// Check for API key
|
|
699
|
+
let apiKey = process.env[config.envVar];
|
|
700
|
+
if (!apiKey && config.altEnvVars) {
|
|
701
|
+
for (const altVar of config.altEnvVars) {
|
|
702
|
+
if (process.env[altVar]) {
|
|
703
|
+
apiKey = process.env[altVar];
|
|
704
|
+
break;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
if (!apiKey) {
|
|
709
|
+
checks.push(Promise.resolve({
|
|
710
|
+
provider: config.id,
|
|
711
|
+
available: false,
|
|
712
|
+
latestModel: config.defaultLatestModel,
|
|
713
|
+
error: `${config.envVar} not set`,
|
|
714
|
+
}));
|
|
715
|
+
continue;
|
|
716
|
+
}
|
|
717
|
+
// Query the API for actual models
|
|
718
|
+
checks.push((async () => {
|
|
719
|
+
const models = await quickFetchProviderModels(config.id, apiKey, 3000);
|
|
720
|
+
if (models.length > 0) {
|
|
721
|
+
const bestModel = getBestModel(config.id, models);
|
|
722
|
+
return {
|
|
723
|
+
provider: config.id,
|
|
724
|
+
available: true,
|
|
725
|
+
latestModel: bestModel,
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
// API call failed or returned no models - still mark available if key exists
|
|
729
|
+
return {
|
|
730
|
+
provider: config.id,
|
|
731
|
+
available: true,
|
|
732
|
+
latestModel: config.defaultLatestModel,
|
|
733
|
+
error: 'Could not fetch models',
|
|
734
|
+
};
|
|
735
|
+
})());
|
|
736
|
+
}
|
|
737
|
+
// Run all checks in parallel for speed
|
|
738
|
+
return Promise.all(checks);
|
|
739
|
+
}
|
|
740
|
+
//# sourceMappingURL=modelDiscovery.js.map
|