@nexus-cortex/executors 4.26.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 +202 -0
- package/NOTICE +2 -0
- package/README.md +13 -0
- package/dist/ExecutorRegistry.d.ts +89 -0
- package/dist/ExecutorRegistry.d.ts.map +1 -0
- package/dist/ExecutorRegistry.js +219 -0
- package/dist/ExecutorRegistry.js.map +1 -0
- package/dist/base/BaseTool.d.ts +108 -0
- package/dist/base/BaseTool.d.ts.map +1 -0
- package/dist/base/BaseTool.js +111 -0
- package/dist/base/BaseTool.js.map +1 -0
- package/dist/base/ToolRegistry.d.ts +141 -0
- package/dist/base/ToolRegistry.d.ts.map +1 -0
- package/dist/base/ToolRegistry.js +241 -0
- package/dist/base/ToolRegistry.js.map +1 -0
- package/dist/base/ToolResult.d.ts +63 -0
- package/dist/base/ToolResult.d.ts.map +1 -0
- package/dist/base/ToolResult.js +8 -0
- package/dist/base/ToolResult.js.map +1 -0
- package/dist/base/index.d.ts +10 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.js +8 -0
- package/dist/base/index.js.map +1 -0
- package/dist/implementations/addon/CreateArtifactTool.d.ts +221 -0
- package/dist/implementations/addon/CreateArtifactTool.d.ts.map +1 -0
- package/dist/implementations/addon/CreateArtifactTool.js +1042 -0
- package/dist/implementations/addon/CreateArtifactTool.js.map +1 -0
- package/dist/implementations/addon/FrameDiffCache.d.ts +166 -0
- package/dist/implementations/addon/FrameDiffCache.d.ts.map +1 -0
- package/dist/implementations/addon/FrameDiffCache.js +395 -0
- package/dist/implementations/addon/FrameDiffCache.js.map +1 -0
- package/dist/implementations/addon/H264StreamEncoder.d.ts +84 -0
- package/dist/implementations/addon/H264StreamEncoder.d.ts.map +1 -0
- package/dist/implementations/addon/H264StreamEncoder.js +203 -0
- package/dist/implementations/addon/H264StreamEncoder.js.map +1 -0
- package/dist/implementations/addon/HybridScreenshotManager.d.ts +197 -0
- package/dist/implementations/addon/HybridScreenshotManager.d.ts.map +1 -0
- package/dist/implementations/addon/HybridScreenshotManager.js +415 -0
- package/dist/implementations/addon/HybridScreenshotManager.js.map +1 -0
- package/dist/implementations/addon/InspectSandboxTool.d.ts +54 -0
- package/dist/implementations/addon/InspectSandboxTool.d.ts.map +1 -0
- package/dist/implementations/addon/InspectSandboxTool.js +226 -0
- package/dist/implementations/addon/InspectSandboxTool.js.map +1 -0
- package/dist/implementations/addon/InteractWithSandboxTool.d.ts +90 -0
- package/dist/implementations/addon/InteractWithSandboxTool.d.ts.map +1 -0
- package/dist/implementations/addon/InteractWithSandboxTool.js +367 -0
- package/dist/implementations/addon/InteractWithSandboxTool.js.map +1 -0
- package/dist/implementations/addon/KeyframeDetector.d.ts +140 -0
- package/dist/implementations/addon/KeyframeDetector.d.ts.map +1 -0
- package/dist/implementations/addon/KeyframeDetector.js +390 -0
- package/dist/implementations/addon/KeyframeDetector.js.map +1 -0
- package/dist/implementations/addon/ModifySandboxTool.d.ts +62 -0
- package/dist/implementations/addon/ModifySandboxTool.d.ts.map +1 -0
- package/dist/implementations/addon/ModifySandboxTool.js +266 -0
- package/dist/implementations/addon/ModifySandboxTool.js.map +1 -0
- package/dist/implementations/addon/ReactArtifactBuilder.d.ts +27 -0
- package/dist/implementations/addon/ReactArtifactBuilder.d.ts.map +1 -0
- package/dist/implementations/addon/ReactArtifactBuilder.js +198 -0
- package/dist/implementations/addon/ReactArtifactBuilder.js.map +1 -0
- package/dist/implementations/addon/SandboxEventBroadcaster.d.ts +143 -0
- package/dist/implementations/addon/SandboxEventBroadcaster.d.ts.map +1 -0
- package/dist/implementations/addon/SandboxEventBroadcaster.js +258 -0
- package/dist/implementations/addon/SandboxEventBroadcaster.js.map +1 -0
- package/dist/implementations/addon/SandboxIntrospectionTools.d.ts +77 -0
- package/dist/implementations/addon/SandboxIntrospectionTools.d.ts.map +1 -0
- package/dist/implementations/addon/SandboxIntrospectionTools.js +292 -0
- package/dist/implementations/addon/SandboxIntrospectionTools.js.map +1 -0
- package/dist/implementations/addon/SandboxViewServer.d.ts +127 -0
- package/dist/implementations/addon/SandboxViewServer.d.ts.map +1 -0
- package/dist/implementations/addon/SandboxViewServer.js +775 -0
- package/dist/implementations/addon/SandboxViewServer.js.map +1 -0
- package/dist/implementations/addon/ScreenStream.d.ts +149 -0
- package/dist/implementations/addon/ScreenStream.d.ts.map +1 -0
- package/dist/implementations/addon/ScreenStream.js +306 -0
- package/dist/implementations/addon/ScreenStream.js.map +1 -0
- package/dist/implementations/addon/StopSandboxTool.d.ts +61 -0
- package/dist/implementations/addon/StopSandboxTool.d.ts.map +1 -0
- package/dist/implementations/addon/StopSandboxTool.js +252 -0
- package/dist/implementations/addon/StopSandboxTool.js.map +1 -0
- package/dist/implementations/addon/TerminalSandbox.d.ts +111 -0
- package/dist/implementations/addon/TerminalSandbox.d.ts.map +1 -0
- package/dist/implementations/addon/TerminalSandbox.js +345 -0
- package/dist/implementations/addon/TerminalSandbox.js.map +1 -0
- package/dist/implementations/addon/VisualFeedbackBridge.d.ts +367 -0
- package/dist/implementations/addon/VisualFeedbackBridge.d.ts.map +1 -0
- package/dist/implementations/addon/VisualFeedbackBridge.js +888 -0
- package/dist/implementations/addon/VisualFeedbackBridge.js.map +1 -0
- package/dist/implementations/addon/WindowManager.d.ts +138 -0
- package/dist/implementations/addon/WindowManager.d.ts.map +1 -0
- package/dist/implementations/addon/WindowManager.js +276 -0
- package/dist/implementations/addon/WindowManager.js.map +1 -0
- package/dist/implementations/addon/index.d.ts +29 -0
- package/dist/implementations/addon/index.d.ts.map +1 -0
- package/dist/implementations/addon/index.js +29 -0
- package/dist/implementations/addon/index.js.map +1 -0
- package/dist/implementations/addon/injectables/reactIntrospection.d.ts +57 -0
- package/dist/implementations/addon/injectables/reactIntrospection.d.ts.map +1 -0
- package/dist/implementations/addon/injectables/reactIntrospection.js +480 -0
- package/dist/implementations/addon/injectables/reactIntrospection.js.map +1 -0
- package/dist/implementations/addon/terminal-client.html +253 -0
- package/dist/implementations/agent/PRAgentTool.d.ts +37 -0
- package/dist/implementations/agent/PRAgentTool.d.ts.map +1 -0
- package/dist/implementations/agent/PRAgentTool.js +257 -0
- package/dist/implementations/agent/PRAgentTool.js.map +1 -0
- package/dist/implementations/agent/TaskTool.d.ts +76 -0
- package/dist/implementations/agent/TaskTool.d.ts.map +1 -0
- package/dist/implementations/agent/TaskTool.js +424 -0
- package/dist/implementations/agent/TaskTool.js.map +1 -0
- package/dist/implementations/agent/index.d.ts +5 -0
- package/dist/implementations/agent/index.d.ts.map +1 -0
- package/dist/implementations/agent/index.js +3 -0
- package/dist/implementations/agent/index.js.map +1 -0
- package/dist/implementations/execution/BackgroundProcessRegistry.d.ts +68 -0
- package/dist/implementations/execution/BackgroundProcessRegistry.d.ts.map +1 -0
- package/dist/implementations/execution/BackgroundProcessRegistry.js +146 -0
- package/dist/implementations/execution/BackgroundProcessRegistry.js.map +1 -0
- package/dist/implementations/execution/BashOutputTool.d.ts +42 -0
- package/dist/implementations/execution/BashOutputTool.d.ts.map +1 -0
- package/dist/implementations/execution/BashOutputTool.js +168 -0
- package/dist/implementations/execution/BashOutputTool.js.map +1 -0
- package/dist/implementations/execution/CodeExecuteTool.d.ts +31 -0
- package/dist/implementations/execution/CodeExecuteTool.d.ts.map +1 -0
- package/dist/implementations/execution/CodeExecuteTool.js +127 -0
- package/dist/implementations/execution/CodeExecuteTool.js.map +1 -0
- package/dist/implementations/execution/KillShellTool.d.ts +37 -0
- package/dist/implementations/execution/KillShellTool.d.ts.map +1 -0
- package/dist/implementations/execution/KillShellTool.js +144 -0
- package/dist/implementations/execution/KillShellTool.js.map +1 -0
- package/dist/implementations/execution/SearchToolsTool.d.ts +32 -0
- package/dist/implementations/execution/SearchToolsTool.d.ts.map +1 -0
- package/dist/implementations/execution/SearchToolsTool.js +109 -0
- package/dist/implementations/execution/SearchToolsTool.js.map +1 -0
- package/dist/implementations/execution/ShellTool.d.ts +108 -0
- package/dist/implementations/execution/ShellTool.d.ts.map +1 -0
- package/dist/implementations/execution/ShellTool.js +546 -0
- package/dist/implementations/execution/ShellTool.js.map +1 -0
- package/dist/implementations/execution/WorkspaceManagerTool.d.ts +40 -0
- package/dist/implementations/execution/WorkspaceManagerTool.d.ts.map +1 -0
- package/dist/implementations/execution/WorkspaceManagerTool.js +370 -0
- package/dist/implementations/execution/WorkspaceManagerTool.js.map +1 -0
- package/dist/implementations/execution/index.d.ts +13 -0
- package/dist/implementations/execution/index.d.ts.map +1 -0
- package/dist/implementations/execution/index.js +13 -0
- package/dist/implementations/execution/index.js.map +1 -0
- package/dist/implementations/extensions/EndTurnTool.d.ts +62 -0
- package/dist/implementations/extensions/EndTurnTool.d.ts.map +1 -0
- package/dist/implementations/extensions/EndTurnTool.js +172 -0
- package/dist/implementations/extensions/EndTurnTool.js.map +1 -0
- package/dist/implementations/extensions/ResearchBacklogTool.d.ts +37 -0
- package/dist/implementations/extensions/ResearchBacklogTool.d.ts.map +1 -0
- package/dist/implementations/extensions/ResearchBacklogTool.js +102 -0
- package/dist/implementations/extensions/ResearchBacklogTool.js.map +1 -0
- package/dist/implementations/extensions/SkillTool.d.ts +108 -0
- package/dist/implementations/extensions/SkillTool.d.ts.map +1 -0
- package/dist/implementations/extensions/SkillTool.js +351 -0
- package/dist/implementations/extensions/SkillTool.js.map +1 -0
- package/dist/implementations/extensions/SlashCommandTool.d.ts +112 -0
- package/dist/implementations/extensions/SlashCommandTool.d.ts.map +1 -0
- package/dist/implementations/extensions/SlashCommandTool.js +315 -0
- package/dist/implementations/extensions/SlashCommandTool.js.map +1 -0
- package/dist/implementations/extensions/index.d.ts +14 -0
- package/dist/implementations/extensions/index.d.ts.map +1 -0
- package/dist/implementations/extensions/index.js +10 -0
- package/dist/implementations/extensions/index.js.map +1 -0
- package/dist/implementations/file/EditTool.d.ts +232 -0
- package/dist/implementations/file/EditTool.d.ts.map +1 -0
- package/dist/implementations/file/EditTool.js +707 -0
- package/dist/implementations/file/EditTool.js.map +1 -0
- package/dist/implementations/file/ReadFileTool.d.ts +49 -0
- package/dist/implementations/file/ReadFileTool.d.ts.map +1 -0
- package/dist/implementations/file/ReadFileTool.js +225 -0
- package/dist/implementations/file/ReadFileTool.js.map +1 -0
- package/dist/implementations/file/WriteBinaryTool.d.ts +21 -0
- package/dist/implementations/file/WriteBinaryTool.d.ts.map +1 -0
- package/dist/implementations/file/WriteBinaryTool.js +153 -0
- package/dist/implementations/file/WriteBinaryTool.js.map +1 -0
- package/dist/implementations/file/WriteFileTool.d.ts +41 -0
- package/dist/implementations/file/WriteFileTool.d.ts.map +1 -0
- package/dist/implementations/file/WriteFileTool.js +220 -0
- package/dist/implementations/file/WriteFileTool.js.map +1 -0
- package/dist/implementations/file/index.d.ts +8 -0
- package/dist/implementations/file/index.d.ts.map +1 -0
- package/dist/implementations/file/index.js +8 -0
- package/dist/implementations/file/index.js.map +1 -0
- package/dist/implementations/historical/GetConversationSegmentTool.d.ts +44 -0
- package/dist/implementations/historical/GetConversationSegmentTool.d.ts.map +1 -0
- package/dist/implementations/historical/GetConversationSegmentTool.js +220 -0
- package/dist/implementations/historical/GetConversationSegmentTool.js.map +1 -0
- package/dist/implementations/historical/ListCompactionBoundariesTool.d.ts +36 -0
- package/dist/implementations/historical/ListCompactionBoundariesTool.d.ts.map +1 -0
- package/dist/implementations/historical/ListCompactionBoundariesTool.js +174 -0
- package/dist/implementations/historical/ListCompactionBoundariesTool.js.map +1 -0
- package/dist/implementations/historical/ListSessionsTool.d.ts +38 -0
- package/dist/implementations/historical/ListSessionsTool.d.ts.map +1 -0
- package/dist/implementations/historical/ListSessionsTool.js +140 -0
- package/dist/implementations/historical/ListSessionsTool.js.map +1 -0
- package/dist/implementations/historical/LoadSessionTool.d.ts +39 -0
- package/dist/implementations/historical/LoadSessionTool.d.ts.map +1 -0
- package/dist/implementations/historical/LoadSessionTool.js +171 -0
- package/dist/implementations/historical/LoadSessionTool.js.map +1 -0
- package/dist/implementations/historical/RequestHistoricalContextTool.d.ts +46 -0
- package/dist/implementations/historical/RequestHistoricalContextTool.d.ts.map +1 -0
- package/dist/implementations/historical/RequestHistoricalContextTool.js +224 -0
- package/dist/implementations/historical/RequestHistoricalContextTool.js.map +1 -0
- package/dist/implementations/historical/SearchConversationHistoryTool.d.ts +51 -0
- package/dist/implementations/historical/SearchConversationHistoryTool.d.ts.map +1 -0
- package/dist/implementations/historical/SearchConversationHistoryTool.js +306 -0
- package/dist/implementations/historical/SearchConversationHistoryTool.js.map +1 -0
- package/dist/implementations/historical/index.d.ts +12 -0
- package/dist/implementations/historical/index.d.ts.map +1 -0
- package/dist/implementations/historical/index.js +12 -0
- package/dist/implementations/historical/index.js.map +1 -0
- package/dist/implementations/index.d.ts +16 -0
- package/dist/implementations/index.d.ts.map +1 -0
- package/dist/implementations/index.js +28 -0
- package/dist/implementations/index.js.map +1 -0
- package/dist/implementations/mcp/DiscoveredMcpTool.d.ts +58 -0
- package/dist/implementations/mcp/DiscoveredMcpTool.d.ts.map +1 -0
- package/dist/implementations/mcp/DiscoveredMcpTool.js +269 -0
- package/dist/implementations/mcp/DiscoveredMcpTool.js.map +1 -0
- package/dist/implementations/mcp/index.d.ts +9 -0
- package/dist/implementations/mcp/index.d.ts.map +1 -0
- package/dist/implementations/mcp/index.js +8 -0
- package/dist/implementations/mcp/index.js.map +1 -0
- package/dist/implementations/notebook/NotebookEditTool.d.ts +96 -0
- package/dist/implementations/notebook/NotebookEditTool.d.ts.map +1 -0
- package/dist/implementations/notebook/NotebookEditTool.js +390 -0
- package/dist/implementations/notebook/NotebookEditTool.js.map +1 -0
- package/dist/implementations/notebook/index.d.ts +7 -0
- package/dist/implementations/notebook/index.d.ts.map +1 -0
- package/dist/implementations/notebook/index.js +7 -0
- package/dist/implementations/notebook/index.js.map +1 -0
- package/dist/implementations/search/GlobTool.d.ts +73 -0
- package/dist/implementations/search/GlobTool.d.ts.map +1 -0
- package/dist/implementations/search/GlobTool.js +213 -0
- package/dist/implementations/search/GlobTool.js.map +1 -0
- package/dist/implementations/search/GrepTool.d.ts +102 -0
- package/dist/implementations/search/GrepTool.d.ts.map +1 -0
- package/dist/implementations/search/GrepTool.js +754 -0
- package/dist/implementations/search/GrepTool.js.map +1 -0
- package/dist/implementations/search/index.d.ts +6 -0
- package/dist/implementations/search/index.d.ts.map +1 -0
- package/dist/implementations/search/index.js +6 -0
- package/dist/implementations/search/index.js.map +1 -0
- package/dist/implementations/tmux/TmuxSessionTool.d.ts +82 -0
- package/dist/implementations/tmux/TmuxSessionTool.d.ts.map +1 -0
- package/dist/implementations/tmux/TmuxSessionTool.js +371 -0
- package/dist/implementations/tmux/TmuxSessionTool.js.map +1 -0
- package/dist/implementations/tmux/TmuxViewServer.d.ts +86 -0
- package/dist/implementations/tmux/TmuxViewServer.d.ts.map +1 -0
- package/dist/implementations/tmux/TmuxViewServer.js +480 -0
- package/dist/implementations/tmux/TmuxViewServer.js.map +1 -0
- package/dist/implementations/tmux/index.d.ts +6 -0
- package/dist/implementations/tmux/index.d.ts.map +1 -0
- package/dist/implementations/tmux/index.js +6 -0
- package/dist/implementations/tmux/index.js.map +1 -0
- package/dist/implementations/ui/AskUserQuestionTool.d.ts +77 -0
- package/dist/implementations/ui/AskUserQuestionTool.d.ts.map +1 -0
- package/dist/implementations/ui/AskUserQuestionTool.js +241 -0
- package/dist/implementations/ui/AskUserQuestionTool.js.map +1 -0
- package/dist/implementations/ui/ExitPlanModeTool.d.ts +44 -0
- package/dist/implementations/ui/ExitPlanModeTool.d.ts.map +1 -0
- package/dist/implementations/ui/ExitPlanModeTool.js +150 -0
- package/dist/implementations/ui/ExitPlanModeTool.js.map +1 -0
- package/dist/implementations/ui/TodoWriteTool.d.ts +59 -0
- package/dist/implementations/ui/TodoWriteTool.d.ts.map +1 -0
- package/dist/implementations/ui/TodoWriteTool.js +315 -0
- package/dist/implementations/ui/TodoWriteTool.js.map +1 -0
- package/dist/implementations/ui/index.d.ts +9 -0
- package/dist/implementations/ui/index.d.ts.map +1 -0
- package/dist/implementations/ui/index.js +9 -0
- package/dist/implementations/ui/index.js.map +1 -0
- package/dist/implementations/web/BrowseTool.d.ts +43 -0
- package/dist/implementations/web/BrowseTool.d.ts.map +1 -0
- package/dist/implementations/web/BrowseTool.js +181 -0
- package/dist/implementations/web/BrowseTool.js.map +1 -0
- package/dist/implementations/web/SandboxTransferTool.d.ts +30 -0
- package/dist/implementations/web/SandboxTransferTool.d.ts.map +1 -0
- package/dist/implementations/web/SandboxTransferTool.js +261 -0
- package/dist/implementations/web/SandboxTransferTool.js.map +1 -0
- package/dist/implementations/web/WebFetchTool.d.ts +93 -0
- package/dist/implementations/web/WebFetchTool.d.ts.map +1 -0
- package/dist/implementations/web/WebFetchTool.js +484 -0
- package/dist/implementations/web/WebFetchTool.js.map +1 -0
- package/dist/implementations/web/WebSearchTool.d.ts +53 -0
- package/dist/implementations/web/WebSearchTool.d.ts.map +1 -0
- package/dist/implementations/web/WebSearchTool.js +227 -0
- package/dist/implementations/web/WebSearchTool.js.map +1 -0
- package/dist/implementations/web/escalateDirective.d.ts +11 -0
- package/dist/implementations/web/escalateDirective.d.ts.map +1 -0
- package/dist/implementations/web/escalateDirective.js +20 -0
- package/dist/implementations/web/escalateDirective.js.map +1 -0
- package/dist/implementations/web/index.d.ts +10 -0
- package/dist/implementations/web/index.d.ts.map +1 -0
- package/dist/implementations/web/index.js +10 -0
- package/dist/implementations/web/index.js.map +1 -0
- package/dist/implementations/web/webBackends.d.ts +65 -0
- package/dist/implementations/web/webBackends.d.ts.map +1 -0
- package/dist/implementations/web/webBackends.js +430 -0
- package/dist/implementations/web/webBackends.js.map +1 -0
- package/dist/implementations/web/webFetchRequestInit.d.ts +9 -0
- package/dist/implementations/web/webFetchRequestInit.d.ts.map +1 -0
- package/dist/implementations/web/webFetchRequestInit.js +21 -0
- package/dist/implementations/web/webFetchRequestInit.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/ArtifactRegistry.d.ts +138 -0
- package/dist/utils/ArtifactRegistry.d.ts.map +1 -0
- package/dist/utils/ArtifactRegistry.js +259 -0
- package/dist/utils/ArtifactRegistry.js.map +1 -0
- package/dist/utils/ChromiumBrowserManager.d.ts +56 -0
- package/dist/utils/ChromiumBrowserManager.d.ts.map +1 -0
- package/dist/utils/ChromiumBrowserManager.js +243 -0
- package/dist/utils/ChromiumBrowserManager.js.map +1 -0
- package/dist/utils/FileUtils.d.ts +81 -0
- package/dist/utils/FileUtils.d.ts.map +1 -0
- package/dist/utils/FileUtils.js +148 -0
- package/dist/utils/FileUtils.js.map +1 -0
- package/dist/utils/GitPolicy.d.ts +70 -0
- package/dist/utils/GitPolicy.d.ts.map +1 -0
- package/dist/utils/GitPolicy.js +166 -0
- package/dist/utils/GitPolicy.js.map +1 -0
- package/dist/utils/GitUtils.d.ts +18 -0
- package/dist/utils/GitUtils.d.ts.map +1 -0
- package/dist/utils/GitUtils.js +62 -0
- package/dist/utils/GitUtils.js.map +1 -0
- package/dist/utils/SandboxRegistry.d.ts +110 -0
- package/dist/utils/SandboxRegistry.d.ts.map +1 -0
- package/dist/utils/SandboxRegistry.js +220 -0
- package/dist/utils/SandboxRegistry.js.map +1 -0
- package/dist/utils/SchemaValidator.d.ts +21 -0
- package/dist/utils/SchemaValidator.d.ts.map +1 -0
- package/dist/utils/SchemaValidator.js +67 -0
- package/dist/utils/SchemaValidator.js.map +1 -0
- package/dist/utils/SessionLock.d.ts +96 -0
- package/dist/utils/SessionLock.d.ts.map +1 -0
- package/dist/utils/SessionLock.js +276 -0
- package/dist/utils/SessionLock.js.map +1 -0
- package/dist/utils/SessionPersistence.d.ts +89 -0
- package/dist/utils/SessionPersistence.d.ts.map +1 -0
- package/dist/utils/SessionPersistence.js +244 -0
- package/dist/utils/SessionPersistence.js.map +1 -0
- package/dist/utils/TextUtils.d.ts +77 -0
- package/dist/utils/TextUtils.d.ts.map +1 -0
- package/dist/utils/TextUtils.js +112 -0
- package/dist/utils/TextUtils.js.map +1 -0
- package/dist/utils/TmuxCapture.d.ts +94 -0
- package/dist/utils/TmuxCapture.d.ts.map +1 -0
- package/dist/utils/TmuxCapture.js +131 -0
- package/dist/utils/TmuxCapture.js.map +1 -0
- package/dist/utils/TmuxManager.d.ts +65 -0
- package/dist/utils/TmuxManager.d.ts.map +1 -0
- package/dist/utils/TmuxManager.js +304 -0
- package/dist/utils/TmuxManager.js.map +1 -0
- package/dist/utils/autoResearchPlanGate.d.ts +10 -0
- package/dist/utils/autoResearchPlanGate.d.ts.map +1 -0
- package/dist/utils/autoResearchPlanGate.js +57 -0
- package/dist/utils/autoResearchPlanGate.js.map +1 -0
- package/dist/utils/index.d.ts +19 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +13 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KillShell Tool Executor
|
|
3
|
+
*
|
|
4
|
+
* Terminates background shell processes started by ShellTool.
|
|
5
|
+
* Uses BackgroundProcessRegistry to track and kill processes.
|
|
6
|
+
*
|
|
7
|
+
* Ported from Gemini CLI kill-shell functionality
|
|
8
|
+
*/
|
|
9
|
+
import { BaseTool } from '../../base/index.js';
|
|
10
|
+
import { SchemaValidator } from '../../utils/SchemaValidator.js';
|
|
11
|
+
import { BackgroundProcessRegistry } from './BackgroundProcessRegistry.js';
|
|
12
|
+
/**
|
|
13
|
+
* KillShell Tool Executor
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - Terminates background shell processes by shell ID
|
|
17
|
+
* - Sends SIGTERM signal to process
|
|
18
|
+
* - Returns success/failure status
|
|
19
|
+
* - Removes terminated process from registry
|
|
20
|
+
*/
|
|
21
|
+
export class KillShellTool extends BaseTool {
|
|
22
|
+
config;
|
|
23
|
+
registry;
|
|
24
|
+
constructor(config) {
|
|
25
|
+
super('KillShell', 'KillShell', `Kills a running background bash shell by its ID. Sends SIGTERM signal to the process. Returns a success or failure status.`, {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
shell_id: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'The ID of the background shell to kill',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
required: ['shell_id'],
|
|
34
|
+
});
|
|
35
|
+
this.config = config;
|
|
36
|
+
this.registry = BackgroundProcessRegistry.getInstance();
|
|
37
|
+
}
|
|
38
|
+
validateToolParams(params) {
|
|
39
|
+
// Schema validation
|
|
40
|
+
const schemaError = SchemaValidator.validate(this.parameterSchema, params);
|
|
41
|
+
if (schemaError) {
|
|
42
|
+
return schemaError;
|
|
43
|
+
}
|
|
44
|
+
// Validate shell_id is not empty
|
|
45
|
+
if (!params.shell_id || !params.shell_id.trim()) {
|
|
46
|
+
return "The 'shell_id' parameter cannot be empty.";
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
getDescription(params) {
|
|
51
|
+
return `Killing background shell: ${params.shell_id}`;
|
|
52
|
+
}
|
|
53
|
+
async execute(params, signal, updateOutput) {
|
|
54
|
+
const startTime = Date.now();
|
|
55
|
+
try {
|
|
56
|
+
// Validate parameters
|
|
57
|
+
const validationError = this.validateToolParams(params);
|
|
58
|
+
if (validationError) {
|
|
59
|
+
return {
|
|
60
|
+
...this.createErrorResult(validationError),
|
|
61
|
+
metadata: {
|
|
62
|
+
executionTime: Date.now() - startTime,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
// Check if process exists
|
|
67
|
+
const process = this.registry.getProcess(params.shell_id);
|
|
68
|
+
if (!process) {
|
|
69
|
+
return {
|
|
70
|
+
...this.createErrorResult(`Background shell '${params.shell_id}' not found. It may have already exited or been removed from the registry.`),
|
|
71
|
+
metadata: {
|
|
72
|
+
executionTime: Date.now() - startTime,
|
|
73
|
+
shell_id: params.shell_id,
|
|
74
|
+
found: false,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
// Check if already not running
|
|
79
|
+
if (!process.isRunning) {
|
|
80
|
+
return {
|
|
81
|
+
...this.createSuccessResult(`Shell '${params.shell_id}' (PID: ${process.pid}) was already not running (exit code: ${process.exitCode}). Removed from registry.`),
|
|
82
|
+
metadata: {
|
|
83
|
+
executionTime: Date.now() - startTime,
|
|
84
|
+
shell_id: params.shell_id,
|
|
85
|
+
pid: process.pid,
|
|
86
|
+
wasRunning: false,
|
|
87
|
+
exitCode: process.exitCode,
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
// Attempt to kill the process
|
|
92
|
+
const killed = this.registry.killProcess(params.shell_id);
|
|
93
|
+
if (killed) {
|
|
94
|
+
// Wait a moment to see if process exits
|
|
95
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
96
|
+
// Remove from registry
|
|
97
|
+
this.registry.removeProcess(params.shell_id);
|
|
98
|
+
return {
|
|
99
|
+
...this.createSuccessResult(`Successfully killed shell '${params.shell_id}' (PID: ${process.pid}) and removed from registry.`),
|
|
100
|
+
metadata: {
|
|
101
|
+
executionTime: Date.now() - startTime,
|
|
102
|
+
shell_id: params.shell_id,
|
|
103
|
+
pid: process.pid,
|
|
104
|
+
killed: true,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
return {
|
|
110
|
+
...this.createErrorResult(`Failed to kill shell '${params.shell_id}' (PID: ${process.pid}). Process may have already exited or permission denied.`),
|
|
111
|
+
metadata: {
|
|
112
|
+
executionTime: Date.now() - startTime,
|
|
113
|
+
shell_id: params.shell_id,
|
|
114
|
+
pid: process.pid,
|
|
115
|
+
killed: false,
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
// Check for abort
|
|
122
|
+
if (signal.aborted) {
|
|
123
|
+
return {
|
|
124
|
+
...this.createErrorResult('Kill operation was cancelled'),
|
|
125
|
+
metadata: {
|
|
126
|
+
executionTime: Date.now() - startTime,
|
|
127
|
+
shell_id: params.shell_id,
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
// Handle errors
|
|
132
|
+
const errorMessage = error.message || String(error);
|
|
133
|
+
return {
|
|
134
|
+
...this.createErrorResult(`Error killing shell: ${errorMessage}`),
|
|
135
|
+
metadata: {
|
|
136
|
+
executionTime: Date.now() - startTime,
|
|
137
|
+
shell_id: params.shell_id,
|
|
138
|
+
error: errorMessage,
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=KillShellTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KillShellTool.js","sourceRoot":"","sources":["../../../src/implementations/execution/KillShellTool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAmB,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAY3E;;;;;;;;GAQG;AACH,MAAM,OAAO,aAAc,SAAQ,QAAyC;IAGtD;IAFZ,QAAQ,CAA4B;IAE5C,YAAoB,MAAsB;QACxC,KAAK,CACH,WAAW,EACX,WAAW,EACX,4HAA4H,EAC5H;YACE,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,wCAAwC;iBACtD;aACF;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACvB,CACF,CAAC;QAfgB,WAAM,GAAN,MAAM,CAAgB;QAiBxC,IAAI,CAAC,QAAQ,GAAG,yBAAyB,CAAC,WAAW,EAAE,CAAC;IAC1D,CAAC;IAED,kBAAkB,CAAC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BAAiB,CACvB,yBAAyB,MAAM,CAAC,QAAQ,WAAW,OAAO,CAAC,GAAG,0DAA0D,CACzH;oBACD,QAAQ,EAAE;wBACR,aAAa,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;wBACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ;wBACzB,GAAG,EAAE,OAAO,CAAC,GAAG;wBAChB,MAAM,EAAE,KAAK;qBACd;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,kBAAkB;YAClB,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,OAAO;oBACL,GAAG,IAAI,CAAC,iBAAiB,CAAC,8BAA8B,CAAC;oBACzD,QAAQ,EAAE;wBACR,aAAa,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;wBACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ;qBAC1B;iBACF,CAAC;YACJ,CAAC;YAED,gBAAgB;YAChB,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;YACpD,OAAO;gBACL,GAAG,IAAI,CAAC,iBAAiB,CAAC,wBAAwB,YAAY,EAAE,CAAC;gBACjE,QAAQ,EAAE;oBACR,aAAa,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;oBACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ;oBACzB,KAAK,EAAE,YAAY;iBACpB;aACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search Tools Tool
|
|
3
|
+
*
|
|
4
|
+
* Client-side tool discovery for non-PTC providers with deferred tool loading.
|
|
5
|
+
* Searches the tool registry by name, description, or category and returns
|
|
6
|
+
* matching tool schemas. Discovered tools are recorded in the progressive
|
|
7
|
+
* loading filter so they're included in subsequent requests.
|
|
8
|
+
*/
|
|
9
|
+
import { BaseTool, type ToolResult } from '../../base/index.js';
|
|
10
|
+
export interface SearchToolsParams {
|
|
11
|
+
/** Search query to match tool names and descriptions */
|
|
12
|
+
query?: string;
|
|
13
|
+
/** Filter by tool category (e.g., "execution", "search", "file") */
|
|
14
|
+
category?: string;
|
|
15
|
+
}
|
|
16
|
+
interface ToolEntry {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
category?: string;
|
|
20
|
+
schema: unknown;
|
|
21
|
+
}
|
|
22
|
+
export declare class SearchToolsTool extends BaseTool<SearchToolsParams> {
|
|
23
|
+
private toolProvider?;
|
|
24
|
+
constructor();
|
|
25
|
+
setToolProvider(provider: () => ToolEntry[]): void;
|
|
26
|
+
validateToolParams(params: SearchToolsParams): string | null;
|
|
27
|
+
execute(params: SearchToolsParams, _signal: AbortSignal): Promise<ToolResult>;
|
|
28
|
+
private scoreMatch;
|
|
29
|
+
private toResults;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=SearchToolsTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchToolsTool.d.ts","sourceRoot":"","sources":["../../../src/implementations/execution/SearchToolsTool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGhE,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACjB;AASD,qBAAa,eAAgB,SAAQ,QAAQ,CAAC,iBAAiB,CAAC;IAC9D,OAAO,CAAC,YAAY,CAAC,CAAoB;;IAuBzC,eAAe,CAAC,QAAQ,EAAE,MAAM,SAAS,EAAE,GAAG,IAAI;IAIlD,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI;IAStD,OAAO,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAwCnF,OAAO,CAAC,UAAU;IA0BlB,OAAO,CAAC,SAAS;CAQlB"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search Tools Tool
|
|
3
|
+
*
|
|
4
|
+
* Client-side tool discovery for non-PTC providers with deferred tool loading.
|
|
5
|
+
* Searches the tool registry by name, description, or category and returns
|
|
6
|
+
* matching tool schemas. Discovered tools are recorded in the progressive
|
|
7
|
+
* loading filter so they're included in subsequent requests.
|
|
8
|
+
*/
|
|
9
|
+
import { BaseTool } from '../../base/index.js';
|
|
10
|
+
import { SchemaValidator } from '../../utils/SchemaValidator.js';
|
|
11
|
+
export class SearchToolsTool extends BaseTool {
|
|
12
|
+
toolProvider;
|
|
13
|
+
constructor() {
|
|
14
|
+
super('SearchTools', 'Search Tools', 'Search the tool registry to discover available tools by name, description, or category.', {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
query: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'Search query — keywords matched against tool names and descriptions. Use "select:Name1,Name2" to fetch exact tools by name.',
|
|
20
|
+
},
|
|
21
|
+
category: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Filter by tool category',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
setToolProvider(provider) {
|
|
29
|
+
this.toolProvider = provider;
|
|
30
|
+
}
|
|
31
|
+
validateToolParams(params) {
|
|
32
|
+
const error = SchemaValidator.validate(this.parameterSchema, params);
|
|
33
|
+
if (error)
|
|
34
|
+
return error;
|
|
35
|
+
if (!params.query && !params.category) {
|
|
36
|
+
return 'At least one of "query" or "category" is required';
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
async execute(params, _signal) {
|
|
41
|
+
if (!this.toolProvider) {
|
|
42
|
+
return {
|
|
43
|
+
llmContent: JSON.stringify({ matches: 0, tools: [], error: 'Tool provider not configured' }),
|
|
44
|
+
success: false,
|
|
45
|
+
error: 'Tool provider not configured',
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const allTools = this.toolProvider();
|
|
49
|
+
// "select:Name1,Name2" — exact name lookup (like CC's ToolSearch)
|
|
50
|
+
if (params.query?.startsWith('select:')) {
|
|
51
|
+
const names = params.query.slice(7).split(',').map((n) => n.trim());
|
|
52
|
+
const nameSet = new Set(names.map((n) => n.toLowerCase()));
|
|
53
|
+
const exact = allTools.filter((t) => nameSet.has(t.name.toLowerCase()));
|
|
54
|
+
return {
|
|
55
|
+
llmContent: JSON.stringify({ matches: exact.length, tools: this.toResults(exact) }),
|
|
56
|
+
success: true,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
// Score-based keyword search
|
|
60
|
+
const scored = allTools.map((t) => ({
|
|
61
|
+
tool: t,
|
|
62
|
+
score: this.scoreMatch(t, params.query, params.category),
|
|
63
|
+
}));
|
|
64
|
+
const matches = scored
|
|
65
|
+
.filter((s) => s.score > 0)
|
|
66
|
+
.sort((a, b) => b.score - a.score)
|
|
67
|
+
.slice(0, 10)
|
|
68
|
+
.map((s) => s.tool);
|
|
69
|
+
return {
|
|
70
|
+
llmContent: JSON.stringify({ matches: matches.length, tools: this.toResults(matches) }),
|
|
71
|
+
success: true,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
scoreMatch(tool, query, category) {
|
|
75
|
+
let score = 0;
|
|
76
|
+
const nameLower = tool.name.toLowerCase();
|
|
77
|
+
const descLower = tool.description.toLowerCase();
|
|
78
|
+
if (category) {
|
|
79
|
+
const catLower = category.toLowerCase();
|
|
80
|
+
if (tool.category?.toLowerCase() === catLower) {
|
|
81
|
+
score += 5;
|
|
82
|
+
}
|
|
83
|
+
else if (nameLower.includes(catLower) || descLower.includes(catLower)) {
|
|
84
|
+
score += 2;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (query) {
|
|
88
|
+
const words = query.toLowerCase().split(/\s+/).filter((w) => w.length > 1);
|
|
89
|
+
for (const word of words) {
|
|
90
|
+
if (nameLower === word)
|
|
91
|
+
score += 10;
|
|
92
|
+
else if (nameLower.includes(word))
|
|
93
|
+
score += 5;
|
|
94
|
+
if (descLower.includes(word))
|
|
95
|
+
score += 1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return score;
|
|
99
|
+
}
|
|
100
|
+
toResults(tools) {
|
|
101
|
+
return tools.map((t) => ({
|
|
102
|
+
name: t.name,
|
|
103
|
+
category: t.category,
|
|
104
|
+
description: t.description,
|
|
105
|
+
schema: t.schema,
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=SearchToolsTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchToolsTool.js","sourceRoot":"","sources":["../../../src/implementations/execution/SearchToolsTool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAmB,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAuBjE,MAAM,OAAO,eAAgB,SAAQ,QAA2B;IACtD,YAAY,CAAqB;IAEzC;QACE,KAAK,CACH,aAAa,EACb,cAAc,EACd,yFAAyF,EACzF;YACE,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6HAA6H;iBAC3I;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,yBAAyB;iBACvC;aACF;SACF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AAM,EAAE,CAAC,CAAC,MAAM;SACjB,CAAC,CAAC,CAAC;IACN,CAAC;CACF"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell Tool Executor
|
|
3
|
+
*
|
|
4
|
+
* Executes shell commands via bash/cmd and captures output.
|
|
5
|
+
* Supports background processes, timeouts, and abort handling.
|
|
6
|
+
*
|
|
7
|
+
* Adapted and simplified from Gemini CLI patterns
|
|
8
|
+
* - Removed: Complex allow/block lists, summarization
|
|
9
|
+
* - Kept: Core execution, background process detection, timeout enforcement
|
|
10
|
+
* - Simplified: Security model (path-based only)
|
|
11
|
+
*/
|
|
12
|
+
import { BaseTool, type ToolResult } from '../../base/index.js';
|
|
13
|
+
import type { ExecutorConfig } from '../../base/ToolRegistry.js';
|
|
14
|
+
/**
|
|
15
|
+
* Parameters for the Shell tool
|
|
16
|
+
*/
|
|
17
|
+
export interface ShellToolParams {
|
|
18
|
+
/**
|
|
19
|
+
* The bash command to execute
|
|
20
|
+
*/
|
|
21
|
+
command: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional directory to run the command in (relative to working directory)
|
|
24
|
+
*/
|
|
25
|
+
directory?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Optional timeout in milliseconds (default: 120000ms = 2 minutes)
|
|
28
|
+
*/
|
|
29
|
+
timeout?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Run command in background and return immediately with a bash_id.
|
|
32
|
+
* Use BashOutput to poll output, KillShell to stop.
|
|
33
|
+
*/
|
|
34
|
+
run_in_background?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Run command in persistent tmux session (requires tmux)
|
|
37
|
+
*/
|
|
38
|
+
persistentSession?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* ID of persistent session (auto-generated if not provided)
|
|
41
|
+
*/
|
|
42
|
+
sessionId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Capture entire scrollback history (for persistent sessions)
|
|
45
|
+
*/
|
|
46
|
+
captureHistory?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Shell Tool Executor
|
|
50
|
+
*
|
|
51
|
+
* Features:
|
|
52
|
+
* - Executes commands via bash -c (or cmd.exe on Windows)
|
|
53
|
+
* - Captures stdout, stderr, exit code
|
|
54
|
+
* - Background process detection (Unix only)
|
|
55
|
+
* - Timeout enforcement
|
|
56
|
+
* - Abort signal support
|
|
57
|
+
* - Streaming output updates
|
|
58
|
+
*
|
|
59
|
+
* Security:
|
|
60
|
+
* - Commands run in specified working directory
|
|
61
|
+
* - Path traversal prevention for directory parameter
|
|
62
|
+
* - Blocks command substitution with $()
|
|
63
|
+
*/
|
|
64
|
+
export declare class ShellTool extends BaseTool<ShellToolParams, ToolResult> {
|
|
65
|
+
private config;
|
|
66
|
+
private static readonly DEFAULT_TIMEOUT_MS;
|
|
67
|
+
private static readonly OUTPUT_UPDATE_INTERVAL_MS;
|
|
68
|
+
private static readonly MAX_OUTPUT_LENGTH;
|
|
69
|
+
private tmux;
|
|
70
|
+
private persistence;
|
|
71
|
+
constructor(config: ExecutorConfig);
|
|
72
|
+
validateToolParams(params: ShellToolParams): string | null;
|
|
73
|
+
getDescription(params: ShellToolParams): string;
|
|
74
|
+
execute(params: ShellToolParams, signal: AbortSignal, updateOutput?: (output: string) => void): Promise<ToolResult>;
|
|
75
|
+
/**
|
|
76
|
+
* Executes the shell command and captures output
|
|
77
|
+
* @private
|
|
78
|
+
*/
|
|
79
|
+
private executeCommand;
|
|
80
|
+
/**
|
|
81
|
+
* Kills a process and its children
|
|
82
|
+
* @private
|
|
83
|
+
*/
|
|
84
|
+
private killProcess;
|
|
85
|
+
/**
|
|
86
|
+
* Execute command in persistent tmux session
|
|
87
|
+
* @private
|
|
88
|
+
*/
|
|
89
|
+
private executeInPersistentSession;
|
|
90
|
+
/**
|
|
91
|
+
* Checks if a command should be routed to a dedicated tool instead of Bash.
|
|
92
|
+
* Returns an error message with guidance if redirected, or null if allowed.
|
|
93
|
+
* @private
|
|
94
|
+
*/
|
|
95
|
+
private checkToolRedirect;
|
|
96
|
+
/**
|
|
97
|
+
* Execute command in background — returns immediately with bash_id.
|
|
98
|
+
* The process is registered in BackgroundProcessRegistry for polling via BashOutput.
|
|
99
|
+
* @private
|
|
100
|
+
*/
|
|
101
|
+
private executeInBackground;
|
|
102
|
+
/**
|
|
103
|
+
* Removes ANSI escape codes from string
|
|
104
|
+
* @private
|
|
105
|
+
*/
|
|
106
|
+
private stripAnsi;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=ShellTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShellTool.d.ts","sourceRoot":"","sources":["../../../src/implementations/execution/ShellTool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,SAAU,SAAQ,QAAQ,CAAC,eAAe,EAAE,UAAU,CAAC;IAQtD,OAAO,CAAC,MAAM;IAP1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAU;IACpD,OAAO,CAAC,MAAM,CAAC,QAAQ,C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