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,443 @@
|
|
|
1
|
+
import { icons, theme } from './theme.js';
|
|
2
|
+
import { getContentWidth, measure, normalizePanelWidth, renderPanel, wrapParagraph, wrapPreformatted, } from './layout.js';
|
|
3
|
+
import { highlightAndWrapCode } from './codeHighlighter.js';
|
|
4
|
+
import { isPlainOutputMode } from './outputMode.js';
|
|
5
|
+
export function formatRichContent(content, width) {
|
|
6
|
+
const blocks = parseBlocks(content);
|
|
7
|
+
const lines = [];
|
|
8
|
+
for (const block of blocks) {
|
|
9
|
+
let blockLines = [];
|
|
10
|
+
switch (block.type) {
|
|
11
|
+
case 'paragraph': {
|
|
12
|
+
const formatted = formatInlineText(block.text);
|
|
13
|
+
blockLines = wrapParagraph(formatted, width);
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
case 'list':
|
|
17
|
+
blockLines = formatList(block.items, width);
|
|
18
|
+
break;
|
|
19
|
+
case 'code':
|
|
20
|
+
blockLines = formatCodeBlock(block.content, width, block.language);
|
|
21
|
+
break;
|
|
22
|
+
case 'diff':
|
|
23
|
+
blockLines = formatDiffBlock(block.content, width);
|
|
24
|
+
break;
|
|
25
|
+
case 'heading':
|
|
26
|
+
blockLines = formatHeadingBlock(block, width);
|
|
27
|
+
break;
|
|
28
|
+
case 'quote':
|
|
29
|
+
blockLines = formatQuoteBlock(block.lines, width);
|
|
30
|
+
break;
|
|
31
|
+
case 'divider':
|
|
32
|
+
blockLines = [formatDivider(width)];
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
blockLines = [];
|
|
36
|
+
}
|
|
37
|
+
if (!blockLines.length) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (lines.length) {
|
|
41
|
+
const lastLine = lines[lines.length - 1];
|
|
42
|
+
if (lastLine?.trim()) {
|
|
43
|
+
lines.push('');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
lines.push(...blockLines);
|
|
47
|
+
}
|
|
48
|
+
while (lines.length) {
|
|
49
|
+
const lastLine = lines[lines.length - 1];
|
|
50
|
+
if (lastLine?.trim()) {
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
lines.pop();
|
|
54
|
+
}
|
|
55
|
+
return lines;
|
|
56
|
+
}
|
|
57
|
+
export function renderMessagePanel(content, options) {
|
|
58
|
+
const width = normalizePanelWidth(options.width ?? getContentWidth());
|
|
59
|
+
const lines = formatRichContent(content, width);
|
|
60
|
+
return renderPanel(lines, { ...options, width });
|
|
61
|
+
}
|
|
62
|
+
export function renderMessageBody(content, width) {
|
|
63
|
+
const normalizedWidth = normalizePanelWidth(width ?? getContentWidth());
|
|
64
|
+
const lines = formatRichContent(content, normalizedWidth);
|
|
65
|
+
return lines.join('\n');
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Format text to make URLs clickable in the terminal.
|
|
69
|
+
* Handles both bare URLs (https://...) and markdown links [text](url).
|
|
70
|
+
* Uses OSC 8 escape sequences for terminal hyperlinks.
|
|
71
|
+
*/
|
|
72
|
+
export function formatClickableLinks(text) {
|
|
73
|
+
if (!text) {
|
|
74
|
+
return '';
|
|
75
|
+
}
|
|
76
|
+
// Use placeholders to avoid double-processing URLs inside markdown links
|
|
77
|
+
const processedLinks = [];
|
|
78
|
+
const PLACEHOLDER = '\u0002LINK';
|
|
79
|
+
// First pass: handle markdown links [label](url)
|
|
80
|
+
let result = text.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (_match, label, url) => {
|
|
81
|
+
processedLinks.push(formatMarkdownLink(label, url));
|
|
82
|
+
return `${PLACEHOLDER}${processedLinks.length - 1}${PLACEHOLDER}`;
|
|
83
|
+
});
|
|
84
|
+
// Second pass: handle bare URLs (not inside markdown links)
|
|
85
|
+
// Match URLs but stop at trailing punctuation that's likely sentence-ending
|
|
86
|
+
// eslint-disable-next-line no-control-regex
|
|
87
|
+
result = result.replace(/(\bhttps?:\/\/[^\s\u0002<>]+?)([)\]}>,.;:!?"']*(?=\s|$))/g, (_match, url, trailing = '') => {
|
|
88
|
+
// Clean up any trailing colons that might be part of "URL:" patterns
|
|
89
|
+
const cleanUrl = url.replace(/:$/, '');
|
|
90
|
+
const actualTrailing = url.endsWith(':') ? ':' + trailing : trailing;
|
|
91
|
+
processedLinks.push(`${formatBareLink(cleanUrl)}${actualTrailing}`);
|
|
92
|
+
return `${PLACEHOLDER}${processedLinks.length - 1}${PLACEHOLDER}`;
|
|
93
|
+
});
|
|
94
|
+
// Final pass: restore placeholders
|
|
95
|
+
result = result.replace(new RegExp(`${PLACEHOLDER}(\\d+)${PLACEHOLDER}`, 'g'), (_match, index) => processedLinks[Number.parseInt(index, 10)] ?? '');
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
export function formatDiffBlock(diff, width) {
|
|
99
|
+
const lines = diff.replace(/\t/g, ' ').split('\n');
|
|
100
|
+
const result = [];
|
|
101
|
+
for (const line of lines) {
|
|
102
|
+
if (!line.trim()) {
|
|
103
|
+
result.push('');
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const color = pickDiffColor(line);
|
|
107
|
+
const chunks = wrapPreformatted(line, width);
|
|
108
|
+
chunks.forEach((chunk) => result.push(color(chunk)));
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
function parseBlocks(content) {
|
|
113
|
+
const blocks = [];
|
|
114
|
+
const lines = content.split('\n');
|
|
115
|
+
let fence = null;
|
|
116
|
+
let paragraph = [];
|
|
117
|
+
let blockquote = null;
|
|
118
|
+
const flushParagraph = () => {
|
|
119
|
+
if (!paragraph.length) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const merged = paragraph.join('\n');
|
|
123
|
+
const trimmedLines = merged
|
|
124
|
+
.split('\n')
|
|
125
|
+
.map((line) => line.trim())
|
|
126
|
+
.filter(Boolean);
|
|
127
|
+
if (!trimmedLines.length) {
|
|
128
|
+
paragraph = [];
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const isList = trimmedLines.every((line) => /^(\*|-|•|\d+\.)\s+/.test(line));
|
|
132
|
+
if (isList) {
|
|
133
|
+
blocks.push({
|
|
134
|
+
type: 'list',
|
|
135
|
+
items: trimmedLines.map((line) => line.replace(/^(\*|-|•|\d+\.)\s+/, '')),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
blocks.push({ type: 'paragraph', text: trimmedLines.join(' ') });
|
|
140
|
+
}
|
|
141
|
+
paragraph = [];
|
|
142
|
+
};
|
|
143
|
+
const flushBlockquote = () => {
|
|
144
|
+
if (!blockquote?.length) {
|
|
145
|
+
blockquote = null;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
blocks.push({ type: 'quote', lines: blockquote });
|
|
149
|
+
blockquote = null;
|
|
150
|
+
};
|
|
151
|
+
for (const line of lines) {
|
|
152
|
+
if (line.trimStart().startsWith('```')) {
|
|
153
|
+
const raw = line.trim();
|
|
154
|
+
if (fence) {
|
|
155
|
+
blocks.push(fence.language.includes('diff')
|
|
156
|
+
? { type: 'diff', content: fence.buffer.join('\n') }
|
|
157
|
+
: { type: 'code', content: fence.buffer.join('\n'), language: fence.language });
|
|
158
|
+
fence = null;
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
flushParagraph();
|
|
162
|
+
flushBlockquote();
|
|
163
|
+
const language = raw.slice(3).trim().toLowerCase();
|
|
164
|
+
fence = { language, buffer: [] };
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
if (fence) {
|
|
168
|
+
fence.buffer.push(line);
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
const trimmed = line.trim();
|
|
172
|
+
if (!trimmed) {
|
|
173
|
+
flushParagraph();
|
|
174
|
+
flushBlockquote();
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
const quoteMatch = line.match(/^\s*>\s?(.*)$/);
|
|
178
|
+
if (quoteMatch) {
|
|
179
|
+
flushParagraph();
|
|
180
|
+
blockquote = blockquote ?? [];
|
|
181
|
+
blockquote.push(quoteMatch[1] ?? '');
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
flushBlockquote();
|
|
185
|
+
const headingMatch = trimmed.match(/^(#{1,6})\s+(.*)$/);
|
|
186
|
+
if (headingMatch) {
|
|
187
|
+
flushParagraph();
|
|
188
|
+
const hashes = headingMatch[1] ?? '';
|
|
189
|
+
const text = headingMatch[2] ?? '';
|
|
190
|
+
blocks.push({ type: 'heading', level: hashes.length, text: text.trim() });
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
if (/^(-{3,}|_{3,}|\*{3,})$/.test(trimmed)) {
|
|
194
|
+
flushParagraph();
|
|
195
|
+
blocks.push({ type: 'divider' });
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
paragraph.push(line);
|
|
199
|
+
}
|
|
200
|
+
flushParagraph();
|
|
201
|
+
flushBlockquote();
|
|
202
|
+
return blocks;
|
|
203
|
+
}
|
|
204
|
+
function formatList(items, width) {
|
|
205
|
+
const lines = [];
|
|
206
|
+
const bulletWidth = 4; // " • " or " ✓ "
|
|
207
|
+
const contentWidth = Math.max(10, width - bulletWidth);
|
|
208
|
+
for (const item of items) {
|
|
209
|
+
const formatted = formatInlineText(item);
|
|
210
|
+
// Detect status indicators in list items
|
|
211
|
+
let bulletChar = icons.bullet;
|
|
212
|
+
let bulletColor = theme.secondary;
|
|
213
|
+
let textColor = (s) => s; // identity function
|
|
214
|
+
// Check for status patterns like "✅", "🔄", "✓", etc.
|
|
215
|
+
if (/^[✅✓]/u.test(item) || item.toLowerCase().startsWith('done') || item.toLowerCase().startsWith('completed')) {
|
|
216
|
+
bulletChar = '✓';
|
|
217
|
+
bulletColor = theme.success;
|
|
218
|
+
}
|
|
219
|
+
else if (/^[🔄⏳]/u.test(item) || item.toLowerCase().startsWith('in progress') || item.toLowerCase().startsWith('pending')) {
|
|
220
|
+
bulletChar = '◐';
|
|
221
|
+
bulletColor = theme.warning;
|
|
222
|
+
}
|
|
223
|
+
else if (/^[❌✗]/u.test(item) || item.toLowerCase().startsWith('failed') || item.toLowerCase().startsWith('error')) {
|
|
224
|
+
bulletChar = '✗';
|
|
225
|
+
bulletColor = theme.error;
|
|
226
|
+
}
|
|
227
|
+
else if (
|
|
228
|
+
// eslint-disable-next-line no-misleading-character-class
|
|
229
|
+
/^[ℹ️💡]/u.test(item) ||
|
|
230
|
+
item.toLowerCase().startsWith('note:') ||
|
|
231
|
+
item.toLowerCase().startsWith('tip:')) {
|
|
232
|
+
bulletChar = '◇';
|
|
233
|
+
bulletColor = theme.info;
|
|
234
|
+
textColor = theme.dim;
|
|
235
|
+
}
|
|
236
|
+
const bullet = bulletColor(` ${bulletChar} `);
|
|
237
|
+
const wrapped = wrapParagraph(formatted, contentWidth);
|
|
238
|
+
wrapped.forEach((segment, index) => {
|
|
239
|
+
if (index === 0) {
|
|
240
|
+
lines.push(`${bullet}${textColor(segment)}`);
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
lines.push(`${' '.repeat(bulletWidth)}${textColor(segment)}`);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
return lines;
|
|
248
|
+
}
|
|
249
|
+
function formatCodeBlock(code, width, language) {
|
|
250
|
+
const gutterRaw = isPlainOutputMode() ? '' : '│ ';
|
|
251
|
+
const gutter = theme.ui.muted(gutterRaw);
|
|
252
|
+
const available = Math.max(16, width - measure(gutterRaw));
|
|
253
|
+
const { lines, languageLabel } = highlightAndWrapCode(code, language, available);
|
|
254
|
+
const headerLabel = (languageLabel ?? 'CODE').toUpperCase();
|
|
255
|
+
const result = [];
|
|
256
|
+
if (isPlainOutputMode()) {
|
|
257
|
+
result.push(theme.ui.muted(`[${headerLabel}]`));
|
|
258
|
+
for (const line of lines) {
|
|
259
|
+
result.push(line);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
result.push(`${gutter}${theme.ui.muted(buildCodeDivider(headerLabel, available))}`);
|
|
264
|
+
for (const line of lines) {
|
|
265
|
+
result.push(`${gutter}${line}`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return result;
|
|
269
|
+
}
|
|
270
|
+
function formatHeadingBlock(block, width) {
|
|
271
|
+
const wrapped = wrapParagraph(formatInlineText(block.text), width);
|
|
272
|
+
if (!wrapped.length) {
|
|
273
|
+
return [];
|
|
274
|
+
}
|
|
275
|
+
const accent = pickHeadingAccent(block.level);
|
|
276
|
+
const content = [];
|
|
277
|
+
if (isPlainOutputMode()) {
|
|
278
|
+
content.push(...wrapped.map((line) => accent(theme.bold(line))));
|
|
279
|
+
return content;
|
|
280
|
+
}
|
|
281
|
+
// Enhanced heading styling based on level
|
|
282
|
+
switch (block.level) {
|
|
283
|
+
case 1: {
|
|
284
|
+
// H1: Bold with decorative box
|
|
285
|
+
const headingIcon = '◆';
|
|
286
|
+
const headerText = wrapped.join(' ');
|
|
287
|
+
const decorWidth = Math.max(0, width - headerText.length - 4);
|
|
288
|
+
const leftDecor = '═'.repeat(Math.floor(decorWidth / 2));
|
|
289
|
+
const rightDecor = '═'.repeat(decorWidth - leftDecor.length);
|
|
290
|
+
content.push(accent(`${leftDecor} ${headingIcon} ${theme.bold(headerText)} ${headingIcon} ${rightDecor}`));
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
case 2: {
|
|
294
|
+
// H2: Bold with underline
|
|
295
|
+
const headerText = wrapped.join(' ');
|
|
296
|
+
content.push(accent(`▸ ${theme.bold(headerText)}`));
|
|
297
|
+
content.push(accent('─'.repeat(Math.min(width, headerText.length + 2))));
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
case 3: {
|
|
301
|
+
// H3: Bold with bullet prefix
|
|
302
|
+
content.push(...wrapped.map((line) => accent(` ${theme.bold(line)}`)));
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
default: {
|
|
306
|
+
// H4+: Regular bold
|
|
307
|
+
content.push(...wrapped.map((line) => accent(theme.bold(line))));
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return content;
|
|
311
|
+
}
|
|
312
|
+
function formatQuoteBlock(lines, width) {
|
|
313
|
+
if (!lines.length) {
|
|
314
|
+
return [];
|
|
315
|
+
}
|
|
316
|
+
const gutterText = isPlainOutputMode() ? '> ' : '│ ';
|
|
317
|
+
const gutter = theme.ui.muted(gutterText);
|
|
318
|
+
const available = Math.max(12, width - measure(gutterText));
|
|
319
|
+
const result = [];
|
|
320
|
+
for (const line of lines) {
|
|
321
|
+
if (!line.trim()) {
|
|
322
|
+
result.push(gutter);
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
const wrapped = wrapParagraph(formatInlineText(line), available);
|
|
326
|
+
wrapped.forEach((segment) => {
|
|
327
|
+
result.push(`${gutter}${segment}`);
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
return result;
|
|
331
|
+
}
|
|
332
|
+
function formatDivider(width) {
|
|
333
|
+
if (isPlainOutputMode()) {
|
|
334
|
+
return theme.ui.muted('---');
|
|
335
|
+
}
|
|
336
|
+
return theme.ui.muted('─'.repeat(width));
|
|
337
|
+
}
|
|
338
|
+
function buildCodeDivider(label, width) {
|
|
339
|
+
const normalized = label.trim() || 'CODE';
|
|
340
|
+
const targetWidth = Math.max(8, width);
|
|
341
|
+
const title = ` ${normalized} `;
|
|
342
|
+
if (title.length >= targetWidth) {
|
|
343
|
+
return title.slice(0, targetWidth);
|
|
344
|
+
}
|
|
345
|
+
const remaining = targetWidth - title.length;
|
|
346
|
+
const left = '─'.repeat(Math.floor(remaining / 2));
|
|
347
|
+
const right = '─'.repeat(remaining - left.length);
|
|
348
|
+
return `${left}${title}${right}`;
|
|
349
|
+
}
|
|
350
|
+
function pickDiffColor(line) {
|
|
351
|
+
if (line.startsWith('+++') || line.startsWith('---')) {
|
|
352
|
+
return theme.diff.header;
|
|
353
|
+
}
|
|
354
|
+
if (line.startsWith('@@')) {
|
|
355
|
+
return theme.diff.hunk;
|
|
356
|
+
}
|
|
357
|
+
if (line.startsWith('+')) {
|
|
358
|
+
return theme.diff.added;
|
|
359
|
+
}
|
|
360
|
+
if (line.startsWith('-')) {
|
|
361
|
+
return theme.diff.removed;
|
|
362
|
+
}
|
|
363
|
+
if (line.startsWith('diff')) {
|
|
364
|
+
return theme.diff.meta;
|
|
365
|
+
}
|
|
366
|
+
return theme.ui.text;
|
|
367
|
+
}
|
|
368
|
+
export function formatInlineText(text) {
|
|
369
|
+
if (!text) {
|
|
370
|
+
return '';
|
|
371
|
+
}
|
|
372
|
+
const codeSpans = [];
|
|
373
|
+
const linkSpans = [];
|
|
374
|
+
const LINK_PLACEHOLDER = '\u0001';
|
|
375
|
+
let result = text.replace(/`([^`]+)`/g, (_, inner) => {
|
|
376
|
+
codeSpans.push(inner);
|
|
377
|
+
return `\u0000${codeSpans.length - 1}\u0000`;
|
|
378
|
+
});
|
|
379
|
+
const formatBold = (_match, value) => theme.bold(value);
|
|
380
|
+
result = result.replace(/\*\*(.+?)\*\*/g, formatBold);
|
|
381
|
+
result = result.replace(/__(.+?)__/g, formatBold);
|
|
382
|
+
const formatItalics = (_match, value) => theme.italic(value);
|
|
383
|
+
result = result.replace(/(?<!\*)\*(?!\*)([^*]+?)(?<!\*)\*(?!\*)/g, formatItalics);
|
|
384
|
+
result = result.replace(/(?<!_)_(?!_)([^_]+?)(?<!_)_(?!_)/g, formatItalics);
|
|
385
|
+
result = result.replace(/~~(.+?)~~/g, (_match, value) => theme.dim(value));
|
|
386
|
+
result = result.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (_match, label, url) => {
|
|
387
|
+
linkSpans.push(formatMarkdownLink(label, url));
|
|
388
|
+
return `${LINK_PLACEHOLDER}${linkSpans.length - 1}${LINK_PLACEHOLDER}`;
|
|
389
|
+
});
|
|
390
|
+
result = result.replace(/(\bhttps?:\/\/[^\s)]+)([)\]}>,.;:!?"]*)/g, (_match, url, trailing = '') => {
|
|
391
|
+
linkSpans.push(`${formatBareLink(url)}${trailing}`);
|
|
392
|
+
return `${LINK_PLACEHOLDER}${linkSpans.length - 1}${LINK_PLACEHOLDER}`;
|
|
393
|
+
});
|
|
394
|
+
result = result.replace(new RegExp(`${LINK_PLACEHOLDER}(\\d+)${LINK_PLACEHOLDER}`, 'g'), (_match, index) => linkSpans[Number.parseInt(index, 10)] ?? '');
|
|
395
|
+
// eslint-disable-next-line no-control-regex
|
|
396
|
+
result = result.replace(/\u0000(\d+)\u0000/g, (_match, index) => formatInlineCode(codeSpans[Number.parseInt(index, 10)] ?? ''));
|
|
397
|
+
return result;
|
|
398
|
+
}
|
|
399
|
+
function formatInlineCode(value) {
|
|
400
|
+
const normalized = value.length ? value.trim() : value;
|
|
401
|
+
const display = normalized.length ? normalized : value;
|
|
402
|
+
const snippet = display.replace(/\s+/g, ' ');
|
|
403
|
+
return theme.ui.background(theme.ui.text(` ${snippet} `));
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Wrap text in an OSC 8 hyperlink escape sequence for terminal clickable links.
|
|
407
|
+
* Format: \x1b]8;;URL\x1b\\TEXT\x1b]8;;\x1b\\
|
|
408
|
+
* Supported by: iTerm2, Kitty, Hyper, Windows Terminal, GNOME Terminal 3.26+, etc.
|
|
409
|
+
*/
|
|
410
|
+
function makeClickableLink(url, displayText) {
|
|
411
|
+
// OSC 8 hyperlink: ESC ] 8 ; ; URL ST text ESC ] 8 ; ; ST
|
|
412
|
+
// ST (String Terminator) can be ESC \ or BEL (\x07)
|
|
413
|
+
const OSC = '\x1b]';
|
|
414
|
+
const ST = '\x1b\\';
|
|
415
|
+
return `${OSC}8;;${url}${ST}${displayText}${OSC}8;;${ST}`;
|
|
416
|
+
}
|
|
417
|
+
function formatMarkdownLink(label, url) {
|
|
418
|
+
const cleanUrl = url.trim();
|
|
419
|
+
const cleanLabel = label.trim() || cleanUrl;
|
|
420
|
+
const labelColor = theme.link?.label ?? theme.secondary;
|
|
421
|
+
const urlColor = theme.link?.url ?? theme.info;
|
|
422
|
+
// Make the label clickable, then show URL in parentheses (also clickable)
|
|
423
|
+
const styledLabel = labelColor(cleanLabel);
|
|
424
|
+
const styledUrl = urlColor(`(${cleanUrl})`);
|
|
425
|
+
const clickableLabel = makeClickableLink(cleanUrl, styledLabel);
|
|
426
|
+
const clickableUrl = makeClickableLink(cleanUrl, styledUrl);
|
|
427
|
+
return `${clickableLabel} ${clickableUrl}`;
|
|
428
|
+
}
|
|
429
|
+
function formatBareLink(url) {
|
|
430
|
+
const colorize = theme.link?.url ?? theme.info;
|
|
431
|
+
const styledUrl = colorize(url.trim());
|
|
432
|
+
return makeClickableLink(url.trim(), styledUrl);
|
|
433
|
+
}
|
|
434
|
+
function pickHeadingAccent(level) {
|
|
435
|
+
if (level <= 1) {
|
|
436
|
+
return theme.primary;
|
|
437
|
+
}
|
|
438
|
+
if (level === 2) {
|
|
439
|
+
return theme.secondary;
|
|
440
|
+
}
|
|
441
|
+
return theme.assistant;
|
|
442
|
+
}
|
|
443
|
+
//# sourceMappingURL=richText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"richText.js","sourceRoot":"","sources":["../../src/ui/richText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EACL,eAAe,EACf,OAAO,EACP,mBAAmB,EACnB,WAAW,EAEX,aAAa,EACb,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAWpD,MAAM,UAAU,iBAAiB,CAAC,OAAe,EAAE,KAAa;IAC9D,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,UAAU,GAAa,EAAE,CAAC;QAE9B,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;YACnB,KAAK,WAAW,CAAC,CAAC,CAAC;gBACjB,MAAM,SAAS,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC/C,UAAU,GAAG,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;gBAC7C,MAAM;YACR,CAAC;YACD,KAAK,MAAM;gBACT,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,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BAAiB,CAAC,KAAa;IACtC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACf,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IACD,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC,SAAS,CAAC;IACzB,CAAC;IACD,OAAO,KAAK,CAAC,SAAS,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { UITelemetry } from './UITelemetry.js';
|
|
2
|
+
export interface AssistantResponseMetadata {
|
|
3
|
+
thought?: string | null;
|
|
4
|
+
responseId?: number;
|
|
5
|
+
usage?: unknown;
|
|
6
|
+
source?: 'final' | 'stream' | 'narrative';
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Tracks assistant thought/response pairs as single events.
|
|
10
|
+
* Ensures multi-line messages are counted once per response.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ResponseTracker {
|
|
13
|
+
private readonly telemetry;
|
|
14
|
+
private nextId;
|
|
15
|
+
private activeId;
|
|
16
|
+
private pendingThought;
|
|
17
|
+
constructor(telemetry: UITelemetry);
|
|
18
|
+
recordThought(thought: string): number | null;
|
|
19
|
+
recordResponse(response: string, metadata?: AssistantResponseMetadata): number | null;
|
|
20
|
+
private truncate;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ResponseTracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResponseTracker.d.ts","sourceRoot":"","sources":["../../../src/ui/telemetry/ResponseTracker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;CAC3C;AAED;;;GAGG;AACH,qBAAa,eAAe;IAKd,OAAO,CAAC,QAAQ,CAAC,SAAS;IAJtC,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,cAAc,CAAuB;gBAEhB,SAAS,EAAE,WAAW;IAEnD,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAuB7C,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,yBAA8B,GAAG,MAAM,GAAG,IAAI;IA0BzF,OAAO,CAAC,QAAQ;CAIjB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks assistant thought/response pairs as single events.
|
|
3
|
+
* Ensures multi-line messages are counted once per response.
|
|
4
|
+
*/
|
|
5
|
+
export class ResponseTracker {
|
|
6
|
+
telemetry;
|
|
7
|
+
nextId = 0;
|
|
8
|
+
activeId = null;
|
|
9
|
+
pendingThought = null;
|
|
10
|
+
constructor(telemetry) {
|
|
11
|
+
this.telemetry = telemetry;
|
|
12
|
+
}
|
|
13
|
+
recordThought(thought) {
|
|
14
|
+
const normalized = thought.trim();
|
|
15
|
+
if (!normalized)
|
|
16
|
+
return null;
|
|
17
|
+
if (!this.activeId) {
|
|
18
|
+
this.activeId = this.nextId + 1;
|
|
19
|
+
this.nextId = this.activeId;
|
|
20
|
+
}
|
|
21
|
+
this.pendingThought = this.pendingThought
|
|
22
|
+
? `${this.pendingThought}\n${normalized}`
|
|
23
|
+
: normalized;
|
|
24
|
+
this.telemetry.recordEvent('assistant.thought', {
|
|
25
|
+
id: this.activeId,
|
|
26
|
+
phase: 'thought',
|
|
27
|
+
summary: this.truncate(normalized),
|
|
28
|
+
length: normalized.length,
|
|
29
|
+
});
|
|
30
|
+
return this.activeId;
|
|
31
|
+
}
|
|
32
|
+
recordResponse(response, metadata = {}) {
|
|
33
|
+
const normalized = response.trim();
|
|
34
|
+
if (!normalized)
|
|
35
|
+
return null;
|
|
36
|
+
const id = metadata.responseId ?? this.activeId ?? this.nextId + 1;
|
|
37
|
+
if (id > this.nextId) {
|
|
38
|
+
this.nextId = id;
|
|
39
|
+
}
|
|
40
|
+
const thought = metadata.thought?.trim() || this.pendingThought || null;
|
|
41
|
+
this.telemetry.recordEvent('assistant.response', {
|
|
42
|
+
id,
|
|
43
|
+
phase: 'response',
|
|
44
|
+
summary: this.truncate(normalized),
|
|
45
|
+
length: normalized.length,
|
|
46
|
+
thoughtSummary: thought ? this.truncate(thought) : undefined,
|
|
47
|
+
source: metadata.source ?? 'final',
|
|
48
|
+
usage: metadata.usage ?? null,
|
|
49
|
+
});
|
|
50
|
+
this.pendingThought = null;
|
|
51
|
+
this.activeId = null;
|
|
52
|
+
return id;
|
|
53
|
+
}
|
|
54
|
+
truncate(value, max = 240) {
|
|
55
|
+
if (value.length <= max)
|
|
56
|
+
return value;
|
|
57
|
+
return `${value.slice(0, max - 3).trimEnd()}...`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=ResponseTracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResponseTracker.js","sourceRoot":"","sources":["../../../src/ui/telemetry/ResponseTracker.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,OAAO,eAAe;IAKG;IAJrB,MAAM,GAAG,CAAC,CAAC;IACX,QAAQ,GAAkB,IAAI,CAAC;IAC/B,cAAc,GAAkB,IAAI,CAAC;IAE7C,YAA6B,SAAsB;QAAtB,cAAS,GAAT,SAAS,CAAa;IAAG,CAAC;IAEvD,aAAa,CAAC,OAAe;QAC3B,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAClC,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAE7B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GA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