@deepseekdev/coder 1.0.74
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/agents/agi-code.rules.json +159 -0
- package/agents/general.rules.json +181 -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 +3 -0
- package/dist/bin/deepseek.d.ts.map +1 -0
- package/dist/bin/deepseek.js +137 -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/lean.d.ts +9 -0
- package/dist/bin/lean.d.ts.map +1 -0
- package/dist/bin/lean.js +333 -0
- package/dist/bin/lean.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 +298 -0
- package/dist/bin/selfTest.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/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/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/hitlCapability.d.ts +18 -0
- package/dist/capabilities/hitlCapability.d.ts.map +1 -0
- package/dist/capabilities/hitlCapability.js +29 -0
- package/dist/capabilities/hitlCapability.js.map +1 -0
- package/dist/capabilities/index.d.ts +11 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +13 -0
- package/dist/capabilities/index.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/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/unifiedCodingCapability.d.ts +48 -0
- package/dist/capabilities/unifiedCodingCapability.d.ts.map +1 -0
- package/dist/capabilities/unifiedCodingCapability.js +631 -0
- package/dist/capabilities/unifiedCodingCapability.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/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 +480 -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 +187 -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 +320 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +1627 -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 +312 -0
- package/dist/core/agiCore.d.ts.map +1 -0
- package/dist/core/agiCore.js +1585 -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/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/dynamicGuardrails.d.ts +207 -0
- package/dist/core/dynamicGuardrails.d.ts.map +1 -0
- package/dist/core/dynamicGuardrails.js +455 -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 +834 -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 +109 -0
- package/dist/core/errors/safetyValidator.d.ts.map +1 -0
- package/dist/core/errors/safetyValidator.js +271 -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 +439 -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/global-macbook-access.d.ts +59 -0
- package/dist/core/global-macbook-access.d.ts.map +1 -0
- package/dist/core/global-macbook-access.js +101 -0
- package/dist/core/global-macbook-access.js.map +1 -0
- package/dist/core/guardrails.d.ts +146 -0
- package/dist/core/guardrails.d.ts.map +1 -0
- package/dist/core/guardrails.js +361 -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/hitl.d.ts +109 -0
- package/dist/core/hitl.d.ts.map +1 -0
- package/dist/core/hitl.js +371 -0
- package/dist/core/hitl.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 +18 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +40 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/initialExplorer.d.ts +53 -0
- package/dist/core/initialExplorer.d.ts.map +1 -0
- package/dist/core/initialExplorer.js +423 -0
- package/dist/core/initialExplorer.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 +422 -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 +768 -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 +81 -0
- package/dist/core/multilinePasteHandler.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/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 +244 -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/selfUpgrade.d.ts +79 -0
- package/dist/core/selfUpgrade.d.ts.map +1 -0
- package/dist/core/selfUpgrade.js +92 -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/shutdown.d.ts +34 -0
- package/dist/core/shutdown.d.ts.map +1 -0
- package/dist/core/shutdown.js +173 -0
- package/dist/core/shutdown.js.map +1 -0
- package/dist/core/sudoPasswordManager.d.ts +52 -0
- package/dist/core/sudoPasswordManager.d.ts.map +1 -0
- package/dist/core/sudoPasswordManager.js +115 -0
- package/dist/core/sudoPasswordManager.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/testFailureMonitor.d.ts +67 -0
- package/dist/core/testFailureMonitor.d.ts.map +1 -0
- package/dist/core/testFailureMonitor.js +262 -0
- package/dist/core/testFailureMonitor.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/types/utilityTypes.d.ts +183 -0
- package/dist/core/types/utilityTypes.d.ts.map +1 -0
- package/dist/core/types/utilityTypes.js +273 -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/unrestricted-mode.d.ts +42 -0
- package/dist/core/unrestricted-mode.d.ts.map +1 -0
- package/dist/core/unrestricted-mode.js +88 -0
- package/dist/core/unrestricted-mode.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/headless/interactiveShell.d.ts +22 -0
- package/dist/headless/interactiveShell.d.ts.map +1 -0
- package/dist/headless/interactiveShell.js +4045 -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 +236 -0
- package/dist/headless/quickMode.js.map +1 -0
- package/dist/leanAgent.d.ts +73 -0
- package/dist/leanAgent.d.ts.map +1 -0
- package/dist/leanAgent.js +175 -0
- package/dist/leanAgent.js.map +1 -0
- package/dist/orchestration/index.d.ts +14 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +12 -0
- package/dist/orchestration/index.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 +104 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/providers/anthropic/index.d.ts +9 -0
- package/dist/plugins/providers/anthropic/index.d.ts.map +1 -0
- package/dist/plugins/providers/anthropic/index.js +48 -0
- package/dist/plugins/providers/anthropic/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 +17 -0
- package/dist/plugins/providers/index.js.map +1 -0
- package/dist/plugins/providers/openai/index.d.ts +10 -0
- package/dist/plugins/providers/openai/index.d.ts.map +1 -0
- package/dist/plugins/providers/openai/index.js +47 -0
- package/dist/plugins/providers/openai/index.js.map +1 -0
- package/dist/plugins/providers/xai/index.d.ts +10 -0
- package/dist/plugins/providers/xai/index.d.ts.map +1 -0
- package/dist/plugins/providers/xai/index.js +47 -0
- package/dist/plugins/providers/xai/index.js.map +1 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts +10 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js +110 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.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/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 +13 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -0
- package/dist/plugins/tools/nodeDefaults.js +31 -0
- package/dist/plugins/tools/nodeDefaults.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/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 +1003 -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 +707 -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 +25 -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 +398 -0
- package/dist/shell/commandRegistry.js.map +1 -0
- package/dist/shell/composableMessage.d.ts +178 -0
- package/dist/shell/composableMessage.d.ts.map +1 -0
- package/dist/shell/composableMessage.js +384 -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 +7 -0
- package/dist/tools/bashTools.d.ts.map +1 -0
- package/dist/tools/bashTools.js +773 -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 +673 -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 +793 -0
- package/dist/tools/emailTools.js.map +1 -0
- package/dist/tools/fileChangeTracker.d.ts +47 -0
- package/dist/tools/fileChangeTracker.d.ts.map +1 -0
- package/dist/tools/fileChangeTracker.js +154 -0
- package/dist/tools/fileChangeTracker.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 +333 -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 +128 -0
- package/dist/tools/grepTools.js.map +1 -0
- package/dist/tools/hitlTools.d.ts +7 -0
- package/dist/tools/hitlTools.d.ts.map +1 -0
- package/dist/tools/hitlTools.js +189 -0
- package/dist/tools/hitlTools.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 +81 -0
- package/dist/tools/planningTools.d.ts.map +1 -0
- package/dist/tools/planningTools.js +370 -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 +363 -0
- package/dist/tools/searchTools.js.map +1 -0
- package/dist/tools/telemetryTools.d.ts +10 -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 +193 -0
- package/dist/ui/PromptController.d.ts.map +1 -0
- package/dist/ui/PromptController.js +394 -0
- package/dist/ui/PromptController.js.map +1 -0
- package/dist/ui/UnifiedUIRenderer.d.ts +843 -0
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -0
- package/dist/ui/UnifiedUIRenderer.js +5711 -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/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 +304 -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 +444 -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/utils/statusReporter.d.ts +6 -0
- package/dist/utils/statusReporter.d.ts.map +1 -0
- package/dist/utils/statusReporter.js +26 -0
- package/dist/utils/statusReporter.js.map +1 -0
- package/dist/workspace.d.ts +8 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +135 -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 +121 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { type JSONSchemaObject, type ProviderId, type ProviderToolDefinition, type ToolCallRequest } from './types.js';
|
|
2
|
+
import { ContextManager } from './contextManager.js';
|
|
3
|
+
import { type PreflightWarning } from './toolPreconditions.js';
|
|
4
|
+
/**
|
|
5
|
+
* Execution context for tool operations with strict TypeScript typing
|
|
6
|
+
*/
|
|
7
|
+
export interface ToolExecutionContext {
|
|
8
|
+
readonly profileName: string;
|
|
9
|
+
readonly provider: ProviderId;
|
|
10
|
+
readonly model: string;
|
|
11
|
+
readonly workspaceContext?: string | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Type-safe tool observer with generic parameter inference for AI flow monitoring
|
|
15
|
+
*/
|
|
16
|
+
export interface ToolRuntimeObserver<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
17
|
+
/** Called when tool execution begins */
|
|
18
|
+
onToolStart?(call: ToolCallRequest & {
|
|
19
|
+
args: T;
|
|
20
|
+
}): void;
|
|
21
|
+
/** Called when tool execution completes successfully */
|
|
22
|
+
onToolResult?(call: ToolCallRequest & {
|
|
23
|
+
args: T;
|
|
24
|
+
}, output: string): void;
|
|
25
|
+
/** Called when tool execution fails */
|
|
26
|
+
onToolError?(call: ToolCallRequest & {
|
|
27
|
+
args: T;
|
|
28
|
+
}, error: string): void;
|
|
29
|
+
/** Called when cached result is used instead of execution */
|
|
30
|
+
onCacheHit?(call: ToolCallRequest & {
|
|
31
|
+
args: T;
|
|
32
|
+
}): void;
|
|
33
|
+
/** Called for progress updates during long-running operations */
|
|
34
|
+
onToolProgress?(call: ToolCallRequest & {
|
|
35
|
+
args: T;
|
|
36
|
+
}, progress: ToolProgressUpdate): void;
|
|
37
|
+
/** Called for pre-flight warnings before tool execution */
|
|
38
|
+
onToolWarning?(call: ToolCallRequest & {
|
|
39
|
+
args: T;
|
|
40
|
+
}, warning: PreflightWarning | string): void;
|
|
41
|
+
}
|
|
42
|
+
interface ToolRuntimeOptions {
|
|
43
|
+
readonly observer?: ToolRuntimeObserver;
|
|
44
|
+
readonly contextManager?: ContextManager;
|
|
45
|
+
readonly enableCache?: boolean;
|
|
46
|
+
readonly cacheTTLMs?: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Generic tool handler with parameter type inference for AI flow execution
|
|
50
|
+
*/
|
|
51
|
+
type ToolHandler<T extends Record<string, unknown> = Record<string, unknown>> = (args: T) => Promise<string> | string;
|
|
52
|
+
/**
|
|
53
|
+
* Enhanced tool definition with parameter type safety for AI software engineering
|
|
54
|
+
*/
|
|
55
|
+
export interface ToolDefinition<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
56
|
+
/** Unique identifier for the tool */
|
|
57
|
+
readonly name: string;
|
|
58
|
+
/** Human-readable description for AI understanding */
|
|
59
|
+
readonly description: string;
|
|
60
|
+
/** JSON Schema defining the tool's parameter structure */
|
|
61
|
+
readonly parameters?: JSONSchemaObject;
|
|
62
|
+
/** Function that implements the tool's behavior */
|
|
63
|
+
readonly handler: ToolHandler<T>;
|
|
64
|
+
/** Whether results can be cached for performance optimization */
|
|
65
|
+
readonly cacheable?: boolean;
|
|
66
|
+
/** Optional per-tool cache TTL in milliseconds (falls back to runtime default) */
|
|
67
|
+
readonly cacheTtlMs?: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Collection of related tools grouped by functionality
|
|
71
|
+
*/
|
|
72
|
+
export interface ToolSuite {
|
|
73
|
+
/** Unique identifier for the tool suite */
|
|
74
|
+
readonly id: string;
|
|
75
|
+
/** Human-readable description of the suite's purpose */
|
|
76
|
+
readonly description?: string;
|
|
77
|
+
/** Array of tool definitions in this suite */
|
|
78
|
+
readonly tools: readonly ToolDefinition[];
|
|
79
|
+
}
|
|
80
|
+
export interface ToolHistoryEntry {
|
|
81
|
+
toolName: string;
|
|
82
|
+
args: Record<string, unknown>;
|
|
83
|
+
timestamp: number;
|
|
84
|
+
success: boolean;
|
|
85
|
+
hasOutput: boolean;
|
|
86
|
+
error?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface DiffSnapshotRecord {
|
|
89
|
+
command: string;
|
|
90
|
+
output: string;
|
|
91
|
+
timestamp: number;
|
|
92
|
+
}
|
|
93
|
+
export interface ToolProgressUpdate {
|
|
94
|
+
current: number;
|
|
95
|
+
total?: number;
|
|
96
|
+
message?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Report incremental progress for the currently executing tool.
|
|
100
|
+
* Tools can call this to surface live status updates (e.g., indexing files).
|
|
101
|
+
*/
|
|
102
|
+
export declare function reportToolProgress(progress: ToolProgressUpdate): void;
|
|
103
|
+
/**
|
|
104
|
+
* Type-safe utility functions for tool runtime operations
|
|
105
|
+
*/
|
|
106
|
+
export declare namespace ToolRuntimeUtils {
|
|
107
|
+
/**
|
|
108
|
+
* Creates a type-safe tool definition with inferred parameter types
|
|
109
|
+
*/
|
|
110
|
+
function createToolDefinition<T extends Record<string, unknown>>(definition: ToolDefinition<T>): ToolDefinition<T>;
|
|
111
|
+
/**
|
|
112
|
+
* Creates a type-safe tool suite with inferred tool types
|
|
113
|
+
*/
|
|
114
|
+
function createToolSuite(suite: ToolSuite): ToolSuite;
|
|
115
|
+
/**
|
|
116
|
+
* Type guard to check if a tool definition matches expected parameter schema
|
|
117
|
+
*/
|
|
118
|
+
function isToolDefinition(__tool: ToolDefinition, expectedSchema?: JSONSchemaObject): boolean;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Interface describing the public API of ToolRuntime.
|
|
122
|
+
* Used by wrapper implementations like RestrictedToolRuntime.
|
|
123
|
+
*/
|
|
124
|
+
export interface IToolRuntime {
|
|
125
|
+
listProviderTools(): ProviderToolDefinition[];
|
|
126
|
+
execute(call: ToolCallRequest, context?: {
|
|
127
|
+
profileName?: string;
|
|
128
|
+
provider?: string;
|
|
129
|
+
model?: string;
|
|
130
|
+
}): Promise<string>;
|
|
131
|
+
registerSuite(suite: ToolSuite): void;
|
|
132
|
+
unregisterSuite(id: string): void;
|
|
133
|
+
clearCache(): void;
|
|
134
|
+
getCacheStats(): {
|
|
135
|
+
size: number;
|
|
136
|
+
entries: number;
|
|
137
|
+
};
|
|
138
|
+
clearToolHistory(): void;
|
|
139
|
+
getToolHistory(): readonly ToolHistoryEntry[];
|
|
140
|
+
clearDiffSnapshots(): void;
|
|
141
|
+
getDiffSnapshots(): readonly DiffSnapshotRecord[];
|
|
142
|
+
}
|
|
143
|
+
export declare class ToolRuntime implements IToolRuntime {
|
|
144
|
+
private readonly registry;
|
|
145
|
+
private readonly registrationOrder;
|
|
146
|
+
private readonly observer;
|
|
147
|
+
private readonly contextManager;
|
|
148
|
+
private readonly cache;
|
|
149
|
+
private readonly enableCache;
|
|
150
|
+
private readonly cacheTTLMs;
|
|
151
|
+
private readonly toolHistory;
|
|
152
|
+
private readonly maxHistorySize;
|
|
153
|
+
private readonly diffSnapshots;
|
|
154
|
+
private readonly maxDiffSnapshots;
|
|
155
|
+
private readonly maxDiffSnapshotLength;
|
|
156
|
+
constructor(baseTools?: ToolDefinition[], options?: ToolRuntimeOptions);
|
|
157
|
+
registerSuite(suite: ToolSuite): void;
|
|
158
|
+
unregisterSuite(id: string): void;
|
|
159
|
+
listProviderTools(): ProviderToolDefinition[];
|
|
160
|
+
execute(call: ToolCallRequest, _context?: {
|
|
161
|
+
profileName?: string;
|
|
162
|
+
provider?: string;
|
|
163
|
+
model?: string;
|
|
164
|
+
}): Promise<string>;
|
|
165
|
+
private getCacheKey;
|
|
166
|
+
clearCache(): void;
|
|
167
|
+
getCacheStats(): {
|
|
168
|
+
size: number;
|
|
169
|
+
entries: number;
|
|
170
|
+
};
|
|
171
|
+
clearToolHistory(): void;
|
|
172
|
+
getToolHistory(): readonly ToolHistoryEntry[];
|
|
173
|
+
private recordToolHistory;
|
|
174
|
+
clearDiffSnapshots(): void;
|
|
175
|
+
getDiffSnapshots(): readonly DiffSnapshotRecord[];
|
|
176
|
+
private addTool;
|
|
177
|
+
private removeFromOrder;
|
|
178
|
+
private recordDiffSnapshot;
|
|
179
|
+
private findGitDiffCommand;
|
|
180
|
+
private extractCommands;
|
|
181
|
+
private isGitDiffCommand;
|
|
182
|
+
}
|
|
183
|
+
export declare function createDefaultToolRuntime(context: ToolExecutionContext, toolSuites?: ToolSuite[], options?: ToolRuntimeOptions): ToolRuntime;
|
|
184
|
+
export {};
|
|
185
|
+
//# sourceMappingURL=toolRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolRuntime.d.ts","sourceRoot":"","sources":["../../src/core/toolRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAwE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAIrI;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9F,wCAAwC;IACxC,WAAW,CAAC,CAAC,IAAI,EAAE,eAAe,GAAG;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC;IAExD,wDAAwD;IACxD,YAAY,CAAC,CAAC,IAAI,EAAE,eAAe,GAAG;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzE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,EAC7B,UAAU,GAAE,SAAS,EAAO,EAC5B,OAAO,GAAE,kBAAuB,GAC/B,WAAW,CAUb"}
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
2
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
3
|
+
import { ToolArgumentValidationError, coerceToolArguments, validateToolArguments, } from './schemaValidator.js';
|
|
4
|
+
import { validateToolPreconditions, validateAIFlowPatterns, EDIT_WITHOUT_READ } from './toolPreconditions.js';
|
|
5
|
+
import { safeTruncate } from './resultVerification.js';
|
|
6
|
+
import { logDebug } from '../utils/debugLogger.js';
|
|
7
|
+
const toolExecutionContext = new AsyncLocalStorage();
|
|
8
|
+
/**
|
|
9
|
+
* Report incremental progress for the currently executing tool.
|
|
10
|
+
* Tools can call this to surface live status updates (e.g., indexing files).
|
|
11
|
+
*/
|
|
12
|
+
export function reportToolProgress(progress) {
|
|
13
|
+
const context = toolExecutionContext.getStore();
|
|
14
|
+
if (!context?.observer?.onToolProgress) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const current = Number.isFinite(progress.current) ? Math.max(0, progress.current) : 0;
|
|
18
|
+
const total = progress.total !== undefined ? Math.max(current, progress.total) : current;
|
|
19
|
+
try {
|
|
20
|
+
context.observer.onToolProgress(context.call, {
|
|
21
|
+
current,
|
|
22
|
+
total,
|
|
23
|
+
message: progress.message,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
// Swallow observer errors so they don't break tool execution
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// Idempotent tools that can be safely cached
|
|
31
|
+
const CACHEABLE_TOOLS = new Set([
|
|
32
|
+
'Read',
|
|
33
|
+
'read_file',
|
|
34
|
+
'Glob',
|
|
35
|
+
'glob_search',
|
|
36
|
+
'Grep',
|
|
37
|
+
'grep_search',
|
|
38
|
+
'find_definition',
|
|
39
|
+
'analyze_code_quality',
|
|
40
|
+
'extract_exports',
|
|
41
|
+
]);
|
|
42
|
+
function buildOptimizationHint(warning) {
|
|
43
|
+
const code = warning.code;
|
|
44
|
+
const suggestion = warning.suggestion || warning.message;
|
|
45
|
+
switch (code) {
|
|
46
|
+
case 'SEARCH_BROAD_PATTERN':
|
|
47
|
+
case 'SEARCH_CONTEXT_OVERFLOW_RISK':
|
|
48
|
+
return (`\n\n<optimization-hint>\n` +
|
|
49
|
+
`⚡ SEARCH: ${suggestion}\n` +
|
|
50
|
+
`</optimization-hint>`);
|
|
51
|
+
case EDIT_WITHOUT_READ:
|
|
52
|
+
case 'EDIT_PLACEHOLDER':
|
|
53
|
+
return (`\n\n<optimization-hint>\n` +
|
|
54
|
+
`⚡ EDIT: Read the file first to copy exact whitespace. ${suggestion}\n` +
|
|
55
|
+
`</optimization-hint>`);
|
|
56
|
+
case 'NPM_INCOMPLETE_WORKFLOW':
|
|
57
|
+
return (`\n\n<optimization-hint>\n` +
|
|
58
|
+
`⚡ PUBLISH: ${suggestion}\n` +
|
|
59
|
+
`</optimization-hint>`);
|
|
60
|
+
default:
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Type-safe utility functions for tool runtime operations
|
|
66
|
+
*/
|
|
67
|
+
export var ToolRuntimeUtils;
|
|
68
|
+
(function (ToolRuntimeUtils) {
|
|
69
|
+
/**
|
|
70
|
+
* Creates a type-safe tool definition with inferred parameter types
|
|
71
|
+
*/
|
|
72
|
+
function createToolDefinition(definition) {
|
|
73
|
+
return definition;
|
|
74
|
+
}
|
|
75
|
+
ToolRuntimeUtils.createToolDefinition = createToolDefinition;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a type-safe tool suite with inferred tool types
|
|
78
|
+
*/
|
|
79
|
+
function createToolSuite(suite) {
|
|
80
|
+
return suite;
|
|
81
|
+
}
|
|
82
|
+
ToolRuntimeUtils.createToolSuite = createToolSuite;
|
|
83
|
+
/**
|
|
84
|
+
* Type guard to check if a tool definition matches expected parameter schema
|
|
85
|
+
*/
|
|
86
|
+
function isToolDefinition(__tool, expectedSchema) {
|
|
87
|
+
if (!expectedSchema)
|
|
88
|
+
return true;
|
|
89
|
+
// In a real implementation, this would validate against the schema
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
ToolRuntimeUtils.isToolDefinition = isToolDefinition;
|
|
93
|
+
})(ToolRuntimeUtils || (ToolRuntimeUtils = {}));
|
|
94
|
+
export class ToolRuntime {
|
|
95
|
+
registry = new Map();
|
|
96
|
+
registrationOrder = [];
|
|
97
|
+
observer;
|
|
98
|
+
contextManager;
|
|
99
|
+
cache = new Map();
|
|
100
|
+
enableCache;
|
|
101
|
+
cacheTTLMs;
|
|
102
|
+
toolHistory = [];
|
|
103
|
+
maxHistorySize = 50; // Keep last 50 tool calls for AI flow pattern detection
|
|
104
|
+
diffSnapshots = [];
|
|
105
|
+
maxDiffSnapshots = 5; // Keep only the most recent git diff outputs
|
|
106
|
+
maxDiffSnapshotLength = 4000;
|
|
107
|
+
constructor(baseTools = [], options = {}) {
|
|
108
|
+
this.observer = options.observer ?? null;
|
|
109
|
+
this.contextManager = options.contextManager ?? null;
|
|
110
|
+
this.enableCache = options.enableCache ?? true;
|
|
111
|
+
this.cacheTTLMs = options.cacheTTLMs ?? 5 * 60 * 1000; // 5 minutes default
|
|
112
|
+
if (baseTools.length) {
|
|
113
|
+
this.registerSuite({
|
|
114
|
+
id: 'runtime.core',
|
|
115
|
+
description: 'Core runtime metadata tools',
|
|
116
|
+
tools: baseTools,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
registerSuite(suite) {
|
|
121
|
+
if (!suite?.id?.trim()) {
|
|
122
|
+
throw new Error('Tool suite id cannot be blank.');
|
|
123
|
+
}
|
|
124
|
+
this.unregisterSuite(suite.id);
|
|
125
|
+
for (const definition of suite.tools ?? []) {
|
|
126
|
+
this.addTool(definition, suite.id);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
unregisterSuite(id) {
|
|
130
|
+
if (!id?.trim()) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
for (const [name, record] of this.registry.entries()) {
|
|
134
|
+
if (record.suiteId === id) {
|
|
135
|
+
this.registry.delete(name);
|
|
136
|
+
this.removeFromOrder(name);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
listProviderTools() {
|
|
141
|
+
return this.registrationOrder
|
|
142
|
+
.map((name) => this.registry.get(name))
|
|
143
|
+
.filter((record) => Boolean(record))
|
|
144
|
+
.map(({ definition }) => ({
|
|
145
|
+
name: definition.name,
|
|
146
|
+
description: definition.description,
|
|
147
|
+
...(definition.parameters && { parameters: definition.parameters }),
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
async execute(call, _context) {
|
|
151
|
+
const record = this.registry.get(call.name);
|
|
152
|
+
const rawArgs = normalizeToolArguments(call.arguments);
|
|
153
|
+
const args = coerceToolArguments(record?.definition.parameters, rawArgs);
|
|
154
|
+
const augmentedCall = { ...call, args };
|
|
155
|
+
if (!record) {
|
|
156
|
+
const message = `Tool "${call.name}" is not available.`;
|
|
157
|
+
this.observer?.onToolError?.(augmentedCall, message);
|
|
158
|
+
// Performance monitoring removed - no legacy components
|
|
159
|
+
return message;
|
|
160
|
+
}
|
|
161
|
+
// Check if tool is cacheable
|
|
162
|
+
const isCacheable = record.definition.cacheable ?? CACHEABLE_TOOLS.has(call.name);
|
|
163
|
+
const cacheTtl = typeof record.definition.cacheTtlMs === 'number' && Number.isFinite(record.definition.cacheTtlMs)
|
|
164
|
+
? Math.max(0, Math.floor(record.definition.cacheTtlMs))
|
|
165
|
+
: this.cacheTTLMs;
|
|
166
|
+
const canUseCache = this.enableCache && isCacheable && cacheTtl > 0;
|
|
167
|
+
// Try to get from cache
|
|
168
|
+
if (canUseCache) {
|
|
169
|
+
const cacheKey = this.getCacheKey({ ...call, arguments: args });
|
|
170
|
+
const cached = this.cache.get(cacheKey);
|
|
171
|
+
if (cached && Date.now() - cached.timestamp < cacheTtl) {
|
|
172
|
+
this.observer?.onCacheHit?.(augmentedCall);
|
|
173
|
+
this.observer?.onToolResult?.(augmentedCall, cached.result);
|
|
174
|
+
// Record cache hit as successful execution with 0ms time
|
|
175
|
+
// Performance monitoring removed - no legacy components
|
|
176
|
+
this.recordToolHistory({
|
|
177
|
+
toolName: call.name,
|
|
178
|
+
args,
|
|
179
|
+
timestamp: Date.now(),
|
|
180
|
+
success: true,
|
|
181
|
+
hasOutput: hasNonEmptyOutput(cached.result),
|
|
182
|
+
});
|
|
183
|
+
return cached.result;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
this.observer?.onToolStart?.(augmentedCall);
|
|
187
|
+
// Performance monitoring removed - no legacy components
|
|
188
|
+
try {
|
|
189
|
+
validateToolArguments(record.definition.name, record.definition.parameters, args);
|
|
190
|
+
// Pre-flight AI flow validation - catch common tool usage failures
|
|
191
|
+
const preflightWarnings = validateToolPreconditions(call.name, args);
|
|
192
|
+
for (const warning of preflightWarnings) {
|
|
193
|
+
this.observer?.onToolWarning?.(augmentedCall, warning);
|
|
194
|
+
}
|
|
195
|
+
// Advanced AI flow pattern validation using tool history
|
|
196
|
+
const aiFlowWarnings = validateAIFlowPatterns(call.name, args, this.toolHistory);
|
|
197
|
+
for (const warning of aiFlowWarnings) {
|
|
198
|
+
this.observer?.onToolWarning?.(augmentedCall, warning);
|
|
199
|
+
}
|
|
200
|
+
// Collect optimization hints to inject into result
|
|
201
|
+
const optimizationHints = [];
|
|
202
|
+
const seenOptimizationCodes = new Set();
|
|
203
|
+
for (const warning of [...preflightWarnings, ...aiFlowWarnings]) {
|
|
204
|
+
if (warning.code && seenOptimizationCodes.has(warning.code)) {
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
const hint = buildOptimizationHint(warning);
|
|
208
|
+
if (hint) {
|
|
209
|
+
if (warning.code) {
|
|
210
|
+
seenOptimizationCodes.add(warning.code);
|
|
211
|
+
}
|
|
212
|
+
optimizationHints.push(hint);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const result = await toolExecutionContext.run({ call: augmentedCall, observer: this.observer ?? undefined }, async () => record.definition.handler(args));
|
|
216
|
+
let output = typeof result === 'string' ? result : JSON.stringify(result, null, 2);
|
|
217
|
+
let snapshotCandidate = output;
|
|
218
|
+
// Truncate output if context manager is available
|
|
219
|
+
if (this.contextManager) {
|
|
220
|
+
const truncated = this.contextManager.truncateToolOutput(output, call.name);
|
|
221
|
+
if (truncated.wasTruncated) {
|
|
222
|
+
output = truncated.content;
|
|
223
|
+
// Log truncation for debugging
|
|
224
|
+
if (process.env['DEBUG_CONTEXT']) {
|
|
225
|
+
logDebug(`[Context Manager] Truncated ${call.name} output: ${truncated.originalLength} -> ${truncated.truncatedLength} chars`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
snapshotCandidate = output;
|
|
229
|
+
}
|
|
230
|
+
this.recordDiffSnapshot(args, snapshotCandidate);
|
|
231
|
+
// Cache the result if cacheable
|
|
232
|
+
if (canUseCache) {
|
|
233
|
+
const cacheKey = this.getCacheKey({ ...call, arguments: args });
|
|
234
|
+
this.cache.set(cacheKey, {
|
|
235
|
+
result: output,
|
|
236
|
+
timestamp: Date.now(),
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
// Append optimization hints to guide future LLM behavior
|
|
240
|
+
if (optimizationHints.length > 0) {
|
|
241
|
+
output = output + optimizationHints.join('');
|
|
242
|
+
}
|
|
243
|
+
this.observer?.onToolResult?.(augmentedCall, output);
|
|
244
|
+
this.recordToolHistory({
|
|
245
|
+
toolName: call.name,
|
|
246
|
+
args,
|
|
247
|
+
timestamp: Date.now(),
|
|
248
|
+
success: true,
|
|
249
|
+
hasOutput: hasNonEmptyOutput(output),
|
|
250
|
+
});
|
|
251
|
+
// Record successful execution
|
|
252
|
+
// Performance monitoring removed - no legacy components
|
|
253
|
+
return output;
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
let formatted;
|
|
257
|
+
if (error instanceof ToolArgumentValidationError) {
|
|
258
|
+
formatted = error.message;
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
262
|
+
formatted = `Failed to run "${call.name}": ${message}`;
|
|
263
|
+
}
|
|
264
|
+
this.observer?.onToolError?.(augmentedCall, formatted);
|
|
265
|
+
this.recordToolHistory({
|
|
266
|
+
toolName: call.name,
|
|
267
|
+
args,
|
|
268
|
+
timestamp: Date.now(),
|
|
269
|
+
success: false,
|
|
270
|
+
hasOutput: hasNonEmptyOutput(formatted),
|
|
271
|
+
error: formatted,
|
|
272
|
+
});
|
|
273
|
+
// Record failed execution - no legacy performance monitoring
|
|
274
|
+
return formatted;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
getCacheKey(call) {
|
|
278
|
+
return `${call.name}:${JSON.stringify(call.arguments)}`;
|
|
279
|
+
}
|
|
280
|
+
clearCache() {
|
|
281
|
+
this.cache.clear();
|
|
282
|
+
}
|
|
283
|
+
getCacheStats() {
|
|
284
|
+
let totalSize = 0;
|
|
285
|
+
for (const entry of this.cache.values()) {
|
|
286
|
+
totalSize += entry.result.length;
|
|
287
|
+
}
|
|
288
|
+
return {
|
|
289
|
+
size: totalSize,
|
|
290
|
+
entries: this.cache.size,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
clearToolHistory() {
|
|
294
|
+
this.toolHistory.length = 0;
|
|
295
|
+
}
|
|
296
|
+
getToolHistory() {
|
|
297
|
+
return this.toolHistory;
|
|
298
|
+
}
|
|
299
|
+
recordToolHistory(entry) {
|
|
300
|
+
this.toolHistory.push(entry);
|
|
301
|
+
if (this.toolHistory.length > this.maxHistorySize) {
|
|
302
|
+
this.toolHistory.shift();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
clearDiffSnapshots() {
|
|
306
|
+
this.diffSnapshots.length = 0;
|
|
307
|
+
}
|
|
308
|
+
getDiffSnapshots() {
|
|
309
|
+
return this.diffSnapshots;
|
|
310
|
+
}
|
|
311
|
+
addTool(definition, suiteId) {
|
|
312
|
+
if (!definition?.name?.trim()) {
|
|
313
|
+
throw new Error(`Tool names cannot be blank (suite "${suiteId}").`);
|
|
314
|
+
}
|
|
315
|
+
if (this.registry.has(definition.name)) {
|
|
316
|
+
const owner = this.registry.get(definition.name)?.suiteId ?? 'unknown';
|
|
317
|
+
throw new Error(`Tool "${definition.name}" already registered by suite "${owner}".`);
|
|
318
|
+
}
|
|
319
|
+
this.registry.set(definition.name, {
|
|
320
|
+
suiteId,
|
|
321
|
+
definition,
|
|
322
|
+
});
|
|
323
|
+
this.registrationOrder.push(definition.name);
|
|
324
|
+
}
|
|
325
|
+
removeFromOrder(name) {
|
|
326
|
+
const index = this.registrationOrder.indexOf(name);
|
|
327
|
+
if (index >= 0) {
|
|
328
|
+
this.registrationOrder.splice(index, 1);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
recordDiffSnapshot(args, output) {
|
|
332
|
+
const command = this.findGitDiffCommand(args);
|
|
333
|
+
if (!command || !output) {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
this.diffSnapshots.push({
|
|
337
|
+
command,
|
|
338
|
+
output: safeTruncate(output, this.maxDiffSnapshotLength, 'git-diff'),
|
|
339
|
+
timestamp: Date.now(),
|
|
340
|
+
});
|
|
341
|
+
if (this.diffSnapshots.length > this.maxDiffSnapshots) {
|
|
342
|
+
this.diffSnapshots.shift();
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
findGitDiffCommand(args) {
|
|
346
|
+
for (const command of this.extractCommands(args)) {
|
|
347
|
+
if (this.isGitDiffCommand(command)) {
|
|
348
|
+
return command;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
extractCommands(args) {
|
|
354
|
+
const commands = [];
|
|
355
|
+
const command = args['command'];
|
|
356
|
+
if (typeof command === 'string' && command.trim()) {
|
|
357
|
+
commands.push(command.trim());
|
|
358
|
+
}
|
|
359
|
+
const commandList = args['commands'];
|
|
360
|
+
if (Array.isArray(commandList)) {
|
|
361
|
+
for (const value of commandList) {
|
|
362
|
+
if (typeof value === 'string' && value.trim()) {
|
|
363
|
+
commands.push(value.trim());
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return commands;
|
|
368
|
+
}
|
|
369
|
+
isGitDiffCommand(command) {
|
|
370
|
+
return /\bgit\s+(?:--no-pager\s+)?(?:diff|show)\b/i.test(command);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
export function createDefaultToolRuntime(context, toolSuites = [], options = {}) {
|
|
374
|
+
// Start with no default introspection tools - they waste tokens
|
|
375
|
+
// Model knows its capabilities from tool definitions
|
|
376
|
+
const runtime = new ToolRuntime([], options);
|
|
377
|
+
for (const suite of toolSuites) {
|
|
378
|
+
runtime.registerSuite(suite);
|
|
379
|
+
}
|
|
380
|
+
return runtime;
|
|
381
|
+
}
|
|
382
|
+
// Removed unused introspection tools (context_snapshot, capabilities_overview, profile_details)
|
|
383
|
+
// Model already knows capabilities from tool definitions; these just wasted tokens
|
|
384
|
+
function hasNonEmptyOutput(output) {
|
|
385
|
+
return typeof output === 'string' && output.trim().length > 0;
|
|
386
|
+
}
|
|
387
|
+
function normalizeToolArguments(value) {
|
|
388
|
+
if (value instanceof Map) {
|
|
389
|
+
return Object.fromEntries(value.entries());
|
|
390
|
+
}
|
|
391
|
+
if (isRecord(value)) {
|
|
392
|
+
return value;
|
|
393
|
+
}
|
|
394
|
+
if (typeof value === 'string') {
|
|
395
|
+
const trimmed = value.trim();
|
|
396
|
+
if (!trimmed) {
|
|
397
|
+
return {};
|
|
398
|
+
}
|
|
399
|
+
try {
|
|
400
|
+
const parsed = JSON.parse(trimmed);
|
|
401
|
+
return isRecord(parsed) ? parsed : {};
|
|
402
|
+
}
|
|
403
|
+
catch {
|
|
404
|
+
return {};
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return {};
|
|
408
|
+
}
|
|
409
|
+
function isRecord(value) {
|
|
410
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
411
|
+
}
|
|
412
|
+
//# sourceMappingURL=toolRuntime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolRuntime.js","sourceRoot":"","sources":["../../src/core/toolRuntime.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAOrD,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,iBAAiB,EAAyB,MAAM,wBAAwB,CAAC;AACrI,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AA0HnD,MAAM,oBAAoB,GAAG,IAAI,iBAAiB,EAAsB,CAAC;AAEzE;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAA4B;IAC7D,MAAM,OAAO,GAAG,oBAAoB,CAAC,QAAQ,EAAE,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;QACvC,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtF,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,C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