@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,390 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NotebookEdit Tool Executor
|
|
3
|
+
*
|
|
4
|
+
* Edit Jupyter notebook cells - supports replace, insert, and delete operations.
|
|
5
|
+
* Works with .ipynb files (JSON format).
|
|
6
|
+
*/
|
|
7
|
+
import { BaseTool } from '../../base/index.js';
|
|
8
|
+
import { SchemaValidator } from '../../utils/SchemaValidator.js';
|
|
9
|
+
import fs from 'fs/promises';
|
|
10
|
+
import path from 'path';
|
|
11
|
+
/**
|
|
12
|
+
* NotebookEdit Tool Executor
|
|
13
|
+
*
|
|
14
|
+
* Features:
|
|
15
|
+
* - Read and parse .ipynb JSON files
|
|
16
|
+
* - Replace cell content by cell_id
|
|
17
|
+
* - Insert new cells at specific positions
|
|
18
|
+
* - Delete cells by cell_id
|
|
19
|
+
* - Preserve notebook metadata and structure
|
|
20
|
+
*/
|
|
21
|
+
export class NotebookEditTool extends BaseTool {
|
|
22
|
+
config;
|
|
23
|
+
constructor(config) {
|
|
24
|
+
super('NotebookEdit', 'NotebookEdit', `Completely replaces the contents of a specific cell in a Jupyter notebook (.ipynb file) with new source. Jupyter notebooks are interactive documents that combine code, text, and visualizations, commonly used for data analysis and scientific computing. The notebook_path parameter must be an absolute path, not a relative path. The cell_number is 0-indexed. Use edit_mode=insert to add a new cell at the index specified by cell_number. Use edit_mode=delete to delete the cell at the index specified by cell_number.`, {
|
|
25
|
+
type: 'object',
|
|
26
|
+
properties: {
|
|
27
|
+
notebook_path: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'The absolute path to the Jupyter notebook file to edit (must be absolute, not relative)',
|
|
30
|
+
},
|
|
31
|
+
cell_id: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
description: 'The ID of the cell to edit. When inserting a new cell, the new cell will be inserted after the cell with this ID, or at the beginning if not specified.',
|
|
34
|
+
},
|
|
35
|
+
cell_type: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
enum: ['code', 'markdown'],
|
|
38
|
+
description: 'The type of the cell (code or markdown). If not specified, it defaults to the current cell type. If using edit_mode=insert, this is required.',
|
|
39
|
+
},
|
|
40
|
+
edit_mode: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
enum: ['replace', 'insert', 'delete'],
|
|
43
|
+
description: 'The type of edit to make (replace, insert, delete). Defaults to replace.',
|
|
44
|
+
},
|
|
45
|
+
new_source: {
|
|
46
|
+
type: 'string',
|
|
47
|
+
description: 'The new source for the cell',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
required: ['notebook_path', 'new_source'],
|
|
51
|
+
});
|
|
52
|
+
this.config = config;
|
|
53
|
+
}
|
|
54
|
+
validateToolParams(params) {
|
|
55
|
+
// Schema validation
|
|
56
|
+
const schemaError = SchemaValidator.validate(this.parameterSchema, params);
|
|
57
|
+
if (schemaError) {
|
|
58
|
+
return schemaError;
|
|
59
|
+
}
|
|
60
|
+
// Validate notebook path
|
|
61
|
+
if (!params.notebook_path || !params.notebook_path.trim()) {
|
|
62
|
+
return 'Notebook path cannot be empty.';
|
|
63
|
+
}
|
|
64
|
+
// Ensure absolute path
|
|
65
|
+
if (!path.isAbsolute(params.notebook_path)) {
|
|
66
|
+
return 'Notebook path must be absolute, not relative.';
|
|
67
|
+
}
|
|
68
|
+
// Validate file extension
|
|
69
|
+
if (!params.notebook_path.endsWith('.ipynb')) {
|
|
70
|
+
return 'Notebook path must end with .ipynb extension.';
|
|
71
|
+
}
|
|
72
|
+
// Validate edit_mode
|
|
73
|
+
const editMode = params.edit_mode || 'replace';
|
|
74
|
+
if (!['replace', 'insert', 'delete'].includes(editMode)) {
|
|
75
|
+
return `Invalid edit_mode: ${editMode}. Must be 'replace', 'insert', or 'delete'.`;
|
|
76
|
+
}
|
|
77
|
+
// Validate cell_type
|
|
78
|
+
if (params.cell_type && !['code', 'markdown'].includes(params.cell_type)) {
|
|
79
|
+
return `Invalid cell_type: ${params.cell_type}. Must be 'code' or 'markdown'.`;
|
|
80
|
+
}
|
|
81
|
+
// For insert mode, cell_type is required
|
|
82
|
+
if (editMode === 'insert' && !params.cell_type) {
|
|
83
|
+
return 'cell_type is required when edit_mode is "insert".';
|
|
84
|
+
}
|
|
85
|
+
// For delete mode, new_source should be empty or ignored
|
|
86
|
+
if (editMode === 'delete' && params.new_source.trim().length > 0) {
|
|
87
|
+
return 'new_source should be empty when edit_mode is "delete".';
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
getDescription(params) {
|
|
92
|
+
const mode = params.edit_mode || 'replace';
|
|
93
|
+
const cellId = params.cell_id || 'new cell';
|
|
94
|
+
return `${mode} cell ${cellId} in ${path.basename(params.notebook_path)}`;
|
|
95
|
+
}
|
|
96
|
+
async execute(params, signal, updateOutput) {
|
|
97
|
+
const startTime = Date.now();
|
|
98
|
+
try {
|
|
99
|
+
// Check for abort
|
|
100
|
+
if (signal.aborted) {
|
|
101
|
+
return {
|
|
102
|
+
...this.createErrorResult('Notebook edit was cancelled'),
|
|
103
|
+
metadata: {
|
|
104
|
+
executionTime: Date.now() - startTime,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
// Validate parameters
|
|
109
|
+
const validationError = this.validateToolParams(params);
|
|
110
|
+
if (validationError) {
|
|
111
|
+
return {
|
|
112
|
+
...this.createErrorResult(validationError),
|
|
113
|
+
metadata: {
|
|
114
|
+
executionTime: Date.now() - startTime,
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
// Resolve absolute path
|
|
119
|
+
const notebookPath = path.resolve(params.notebook_path);
|
|
120
|
+
// Check if file exists
|
|
121
|
+
let notebookExists = false;
|
|
122
|
+
try {
|
|
123
|
+
await fs.access(notebookPath);
|
|
124
|
+
notebookExists = true;
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
notebookExists = false;
|
|
128
|
+
}
|
|
129
|
+
if (!notebookExists) {
|
|
130
|
+
return {
|
|
131
|
+
...this.createErrorResult(`Notebook file not found: ${notebookPath}`),
|
|
132
|
+
metadata: {
|
|
133
|
+
executionTime: Date.now() - startTime,
|
|
134
|
+
notebookPath,
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
// Read and parse notebook
|
|
139
|
+
const notebookContent = await fs.readFile(notebookPath, 'utf-8');
|
|
140
|
+
let notebook;
|
|
141
|
+
try {
|
|
142
|
+
notebook = JSON.parse(notebookContent);
|
|
143
|
+
}
|
|
144
|
+
catch (parseError) {
|
|
145
|
+
return {
|
|
146
|
+
...this.createErrorResult(`Failed to parse notebook JSON: ${parseError.message}`),
|
|
147
|
+
metadata: {
|
|
148
|
+
executionTime: Date.now() - startTime,
|
|
149
|
+
notebookPath,
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
// Validate notebook structure
|
|
154
|
+
if (!notebook.cells || !Array.isArray(notebook.cells)) {
|
|
155
|
+
return {
|
|
156
|
+
...this.createErrorResult('Invalid notebook structure: missing or invalid cells array'),
|
|
157
|
+
metadata: {
|
|
158
|
+
executionTime: Date.now() - startTime,
|
|
159
|
+
notebookPath,
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
// Perform edit operation
|
|
164
|
+
const editMode = params.edit_mode || 'replace';
|
|
165
|
+
const editResult = await this.performEdit(notebook, params, editMode, signal);
|
|
166
|
+
if (!editResult.success) {
|
|
167
|
+
return {
|
|
168
|
+
...this.createErrorResult(editResult.error || 'Edit operation failed'),
|
|
169
|
+
metadata: {
|
|
170
|
+
executionTime: Date.now() - startTime,
|
|
171
|
+
notebookPath,
|
|
172
|
+
cellCount: notebook.cells.length,
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
// Write modified notebook back to file
|
|
177
|
+
const modifiedContent = JSON.stringify(notebook, null, 2);
|
|
178
|
+
await fs.writeFile(notebookPath, modifiedContent, 'utf-8');
|
|
179
|
+
// Format success message
|
|
180
|
+
const message = this.formatSuccessMessage(params, editMode, notebook);
|
|
181
|
+
return {
|
|
182
|
+
...this.createSuccessResult(message),
|
|
183
|
+
metadata: {
|
|
184
|
+
executionTime: Date.now() - startTime,
|
|
185
|
+
notebookPath,
|
|
186
|
+
editMode,
|
|
187
|
+
cellId: params.cell_id,
|
|
188
|
+
cellType: params.cell_type,
|
|
189
|
+
cellCount: notebook.cells.length,
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
// Check for abort
|
|
195
|
+
if (signal.aborted) {
|
|
196
|
+
return {
|
|
197
|
+
...this.createErrorResult('Notebook edit was cancelled'),
|
|
198
|
+
metadata: {
|
|
199
|
+
executionTime: Date.now() - startTime,
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
const errorMessage = error.message || String(error);
|
|
204
|
+
return {
|
|
205
|
+
...this.createErrorResult(`Error editing notebook: ${errorMessage}`),
|
|
206
|
+
metadata: {
|
|
207
|
+
executionTime: Date.now() - startTime,
|
|
208
|
+
error: errorMessage,
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Perform the edit operation on the notebook
|
|
215
|
+
*/
|
|
216
|
+
async performEdit(notebook, params, editMode, signal) {
|
|
217
|
+
if (signal.aborted) {
|
|
218
|
+
return { success: false, error: 'Operation cancelled' };
|
|
219
|
+
}
|
|
220
|
+
switch (editMode) {
|
|
221
|
+
case 'replace':
|
|
222
|
+
return this.replaceCell(notebook, params);
|
|
223
|
+
case 'insert':
|
|
224
|
+
return this.insertCell(notebook, params);
|
|
225
|
+
case 'delete':
|
|
226
|
+
return this.deleteCell(notebook, params);
|
|
227
|
+
default:
|
|
228
|
+
return { success: false, error: `Unknown edit mode: ${editMode}` };
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Get the cell ID from a cell (checks both cell.id and cell.metadata.id)
|
|
233
|
+
* Jupyter notebooks may store cell IDs in either location
|
|
234
|
+
*/
|
|
235
|
+
getCellId(cell) {
|
|
236
|
+
return cell.id || cell.metadata?.id;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Find a cell by ID (checks both cell.id and cell.metadata.id)
|
|
240
|
+
*/
|
|
241
|
+
findCellIndex(notebook, cellId) {
|
|
242
|
+
return notebook.cells.findIndex((c) => this.getCellId(c) === cellId);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Replace an existing cell's content
|
|
246
|
+
*/
|
|
247
|
+
replaceCell(notebook, params) {
|
|
248
|
+
if (!params.cell_id) {
|
|
249
|
+
return {
|
|
250
|
+
success: false,
|
|
251
|
+
error: 'cell_id is required for replace mode',
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
const cellIndex = this.findCellIndex(notebook, params.cell_id);
|
|
255
|
+
if (cellIndex === -1) {
|
|
256
|
+
// Provide helpful error with available cell IDs
|
|
257
|
+
const availableIds = notebook.cells
|
|
258
|
+
.map((c, i) => this.getCellId(c) || `[index ${i}]`)
|
|
259
|
+
.join(', ');
|
|
260
|
+
return {
|
|
261
|
+
success: false,
|
|
262
|
+
error: `Cell with id "${params.cell_id}" not found. Available cell IDs: ${availableIds}`,
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
const cell = notebook.cells[cellIndex];
|
|
266
|
+
if (!cell) {
|
|
267
|
+
return { success: false, error: 'Cell is undefined' };
|
|
268
|
+
}
|
|
269
|
+
// Update cell content
|
|
270
|
+
cell.source = this.normalizeSource(params.new_source);
|
|
271
|
+
// Update cell type if provided
|
|
272
|
+
if (params.cell_type) {
|
|
273
|
+
cell.cell_type = params.cell_type;
|
|
274
|
+
}
|
|
275
|
+
// Clear outputs for code cells
|
|
276
|
+
if (cell.cell_type === 'code') {
|
|
277
|
+
cell.outputs = [];
|
|
278
|
+
cell.execution_count = null;
|
|
279
|
+
}
|
|
280
|
+
return { success: true };
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Insert a new cell
|
|
284
|
+
*/
|
|
285
|
+
insertCell(notebook, params) {
|
|
286
|
+
if (!params.cell_type) {
|
|
287
|
+
return {
|
|
288
|
+
success: false,
|
|
289
|
+
error: 'cell_type is required for insert mode',
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
// Create new cell
|
|
293
|
+
const newCell = {
|
|
294
|
+
cell_type: params.cell_type,
|
|
295
|
+
id: this.generateCellId(),
|
|
296
|
+
metadata: {},
|
|
297
|
+
source: this.normalizeSource(params.new_source),
|
|
298
|
+
};
|
|
299
|
+
// Add code cell specific fields
|
|
300
|
+
if (params.cell_type === 'code') {
|
|
301
|
+
newCell.outputs = [];
|
|
302
|
+
newCell.execution_count = null;
|
|
303
|
+
}
|
|
304
|
+
// Find insertion position
|
|
305
|
+
let insertIndex = notebook.cells.length; // Default: append to end
|
|
306
|
+
if (params.cell_id) {
|
|
307
|
+
const refIndex = this.findCellIndex(notebook, params.cell_id);
|
|
308
|
+
if (refIndex === -1) {
|
|
309
|
+
// Provide helpful error with available cell IDs
|
|
310
|
+
const availableIds = notebook.cells
|
|
311
|
+
.map((c, i) => this.getCellId(c) || `[index ${i}]`)
|
|
312
|
+
.join(', ');
|
|
313
|
+
return {
|
|
314
|
+
success: false,
|
|
315
|
+
error: `Reference cell with id "${params.cell_id}" not found. Available cell IDs: ${availableIds}`,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
insertIndex = refIndex + 1; // Insert after reference cell
|
|
319
|
+
}
|
|
320
|
+
// Insert the new cell
|
|
321
|
+
notebook.cells.splice(insertIndex, 0, newCell);
|
|
322
|
+
return { success: true };
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Delete a cell
|
|
326
|
+
*/
|
|
327
|
+
deleteCell(notebook, params) {
|
|
328
|
+
if (!params.cell_id) {
|
|
329
|
+
return { success: false, error: 'cell_id is required for delete mode' };
|
|
330
|
+
}
|
|
331
|
+
const cellIndex = this.findCellIndex(notebook, params.cell_id);
|
|
332
|
+
if (cellIndex === -1) {
|
|
333
|
+
// Provide helpful error with available cell IDs
|
|
334
|
+
const availableIds = notebook.cells
|
|
335
|
+
.map((c, i) => this.getCellId(c) || `[index ${i}]`)
|
|
336
|
+
.join(', ');
|
|
337
|
+
return {
|
|
338
|
+
success: false,
|
|
339
|
+
error: `Cell with id "${params.cell_id}" not found. Available cell IDs: ${availableIds}`,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
// Remove the cell
|
|
343
|
+
notebook.cells.splice(cellIndex, 1);
|
|
344
|
+
return { success: true };
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Normalize source content to array of lines
|
|
348
|
+
*/
|
|
349
|
+
normalizeSource(source) {
|
|
350
|
+
// Split into lines, preserving newlines
|
|
351
|
+
const lines = source.split('\n');
|
|
352
|
+
return lines.map((line, i) => i < lines.length - 1 ? line + '\n' : line);
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Generate a unique cell ID
|
|
356
|
+
*/
|
|
357
|
+
generateCellId() {
|
|
358
|
+
// Generate a simple unique ID (8 random hex characters)
|
|
359
|
+
return Math.random().toString(16).substring(2, 10);
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Format success message
|
|
363
|
+
*/
|
|
364
|
+
formatSuccessMessage(params, editMode, notebook) {
|
|
365
|
+
const lines = [];
|
|
366
|
+
const filename = path.basename(params.notebook_path);
|
|
367
|
+
lines.push('=== Notebook Edit Successful ===\n\n');
|
|
368
|
+
switch (editMode) {
|
|
369
|
+
case 'replace':
|
|
370
|
+
lines.push(`Replaced cell "${params.cell_id}" in ${filename}\n`);
|
|
371
|
+
lines.push(`Cell type: ${params.cell_type || 'unchanged'}\n`);
|
|
372
|
+
break;
|
|
373
|
+
case 'insert':
|
|
374
|
+
lines.push(`Inserted new ${params.cell_type} cell in ${filename}\n`);
|
|
375
|
+
if (params.cell_id) {
|
|
376
|
+
lines.push(`Position: after cell "${params.cell_id}"\n`);
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
lines.push(`Position: at the end\n`);
|
|
380
|
+
}
|
|
381
|
+
break;
|
|
382
|
+
case 'delete':
|
|
383
|
+
lines.push(`Deleted cell "${params.cell_id}" from ${filename}\n`);
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
386
|
+
lines.push(`\nTotal cells: ${notebook.cells.length}\n`);
|
|
387
|
+
return lines.join('');
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
//# sourceMappingURL=NotebookEditTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotebookEditTool.js","sourceRoot":"","sources":["../../../src/implementations/notebook/NotebookEditTool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAmB,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAg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BAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/implementations/notebook/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Glob Tool Executor
|
|
3
|
+
*
|
|
4
|
+
* Finds files matching glob patterns with modification time sorting.
|
|
5
|
+
* Fast pattern-based file discovery for large codebases.
|
|
6
|
+
*
|
|
7
|
+
* Adapted and simplified from Gemini CLI patterns
|
|
8
|
+
* - Removed: FileDiscovery service, git-ignore filtering
|
|
9
|
+
* - Kept: Core glob matching, modification time sorting, security
|
|
10
|
+
*/
|
|
11
|
+
import { BaseTool, type ToolResult } from '../../base/index.js';
|
|
12
|
+
import type { ExecutorConfig } from '../../base/ToolRegistry.js';
|
|
13
|
+
/**
|
|
14
|
+
* Subset of 'Path' interface provided by 'glob' that we use
|
|
15
|
+
*/
|
|
16
|
+
export interface GlobPath {
|
|
17
|
+
fullpath(): string;
|
|
18
|
+
mtimeMs?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Parameters for the Glob tool
|
|
22
|
+
*/
|
|
23
|
+
export interface GlobToolParams {
|
|
24
|
+
/**
|
|
25
|
+
* The glob pattern to match files against
|
|
26
|
+
*/
|
|
27
|
+
pattern: string;
|
|
28
|
+
/**
|
|
29
|
+
* The directory to search in (optional, defaults to working directory)
|
|
30
|
+
*/
|
|
31
|
+
path?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the search should be case-sensitive (optional, defaults to false)
|
|
34
|
+
*/
|
|
35
|
+
case_sensitive?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Maximum number of files to return (optional, defaults to 100)
|
|
38
|
+
* Set to -1 for unlimited (not recommended for large codebases)
|
|
39
|
+
*/
|
|
40
|
+
limit?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Number of files to skip (for pagination)
|
|
43
|
+
* Use with limit to page through large result sets
|
|
44
|
+
*/
|
|
45
|
+
offset?: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Glob Tool Executor
|
|
49
|
+
*
|
|
50
|
+
* Features:
|
|
51
|
+
* - Fast pattern matching (e.g., star-star-slash-star.ts, src-star-star-slash-star.js)
|
|
52
|
+
* - Sorts results by modification time (newest first)
|
|
53
|
+
* - Then alphabetically for older files
|
|
54
|
+
* - Excludes node_modules and .git by default
|
|
55
|
+
* - Path normalization and security
|
|
56
|
+
*/
|
|
57
|
+
export declare class GlobTool extends BaseTool<GlobToolParams, ToolResult> {
|
|
58
|
+
private config;
|
|
59
|
+
private readonly RECENCY_THRESHOLD_MS;
|
|
60
|
+
private static readonly DEFAULT_MAX_RESULTS;
|
|
61
|
+
constructor(config: ExecutorConfig);
|
|
62
|
+
validateToolParams(params: GlobToolParams): string | null;
|
|
63
|
+
getDescription(params: GlobToolParams): string;
|
|
64
|
+
execute(params: GlobToolParams, signal: AbortSignal, updateOutput?: (output: string) => void): Promise<ToolResult>;
|
|
65
|
+
/**
|
|
66
|
+
* Sorts file entries based on recency and then alphabetically.
|
|
67
|
+
* Recent files (modified within 24 hours) are listed first, newest to oldest.
|
|
68
|
+
* Older files are listed after recent ones, sorted alphabetically by path.
|
|
69
|
+
* @private
|
|
70
|
+
*/
|
|
71
|
+
private sortFilesByRecency;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=GlobTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobTool.d.ts","sourceRoot":"","sources":["../../../src/implementations/search/GlobTool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAMhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,QA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