@belboy47/brc-agent 0.0.0-stage → 2.0.17-lab.1
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 +30 -0
- package/LICENSE-desktop-commander +21 -0
- package/NOTICE +13 -0
- package/README.md +58 -2
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +354 -0
- package/dist/cli.js.map +1 -0
- package/dist/context.d.ts +31 -0
- package/dist/context.js +11 -0
- package/dist/context.js.map +1 -0
- package/dist/core/command-manager.d.ts +8 -0
- package/dist/core/command-manager.js +242 -0
- package/dist/core/command-manager.js.map +1 -0
- package/dist/core/config-field-definitions.d.ts +41 -0
- package/dist/core/config-field-definitions.js +38 -0
- package/dist/core/config-field-definitions.js.map +1 -0
- package/dist/core/config-manager.d.ts +102 -0
- package/dist/core/config-manager.js +451 -0
- package/dist/core/config-manager.js.map +1 -0
- package/dist/core/config.d.ts +6 -0
- package/dist/core/config.js +20 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/custom-stdio.d.ts +9 -0
- package/dist/core/custom-stdio.js +2 -0
- package/dist/core/custom-stdio.js.map +1 -0
- package/dist/core/error-handlers.d.ts +7 -0
- package/dist/core/error-handlers.js +16 -0
- package/dist/core/error-handlers.js.map +1 -0
- package/dist/core/file-transfer.d.ts +16 -0
- package/dist/core/file-transfer.js +316 -0
- package/dist/core/file-transfer.js.map +1 -0
- package/dist/core/handlers/edit-search-handlers.d.ts +6 -0
- package/dist/core/handlers/edit-search-handlers.js +7 -0
- package/dist/core/handlers/edit-search-handlers.js.map +1 -0
- package/dist/core/handlers/filesystem-handlers.d.ts +38 -0
- package/dist/core/handlers/filesystem-handlers.js +535 -0
- package/dist/core/handlers/filesystem-handlers.js.map +1 -0
- package/dist/core/handlers/history-handlers.d.ts +12 -0
- package/dist/core/handlers/history-handlers.js +68 -0
- package/dist/core/handlers/history-handlers.js.map +1 -0
- package/dist/core/handlers/index.d.ts +7 -0
- package/dist/core/handlers/index.js +9 -0
- package/dist/core/handlers/index.js.map +1 -0
- package/dist/core/handlers/process-handlers.d.ts +9 -0
- package/dist/core/handlers/process-handlers.js +16 -0
- package/dist/core/handlers/process-handlers.js.map +1 -0
- package/dist/core/handlers/search-handlers.d.ts +17 -0
- package/dist/core/handlers/search-handlers.js +336 -0
- package/dist/core/handlers/search-handlers.js.map +1 -0
- package/dist/core/handlers/terminal-handlers.d.ts +21 -0
- package/dist/core/handlers/terminal-handlers.js +36 -0
- package/dist/core/handlers/terminal-handlers.js.map +1 -0
- package/dist/core/handlers/transfer-handlers.d.ts +4 -0
- package/dist/core/handlers/transfer-handlers.js +76 -0
- package/dist/core/handlers/transfer-handlers.js.map +1 -0
- package/dist/core/search-manager.d.ts +162 -0
- package/dist/core/search-manager.js +929 -0
- package/dist/core/search-manager.js.map +1 -0
- package/dist/core/terminal-manager.d.ts +126 -0
- package/dist/core/terminal-manager.js +671 -0
- package/dist/core/terminal-manager.js.map +1 -0
- package/dist/core/tool-definitions.d.ts +9 -0
- package/dist/core/tool-definitions.js +1020 -0
- package/dist/core/tool-definitions.js.map +1 -0
- package/dist/core/tools/config.d.ts +97 -0
- package/dist/core/tools/config.js +265 -0
- package/dist/core/tools/config.js.map +1 -0
- package/dist/core/tools/edit.d.ts +49 -0
- package/dist/core/tools/edit.js +540 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/feedback.d.ts +8 -0
- package/dist/core/tools/feedback.js +133 -0
- package/dist/core/tools/feedback.js.map +1 -0
- package/dist/core/tools/filesystem.d.ts +84 -0
- package/dist/core/tools/filesystem.js +991 -0
- package/dist/core/tools/filesystem.js.map +1 -0
- package/dist/core/tools/fuzzySearch.d.ts +14 -0
- package/dist/core/tools/fuzzySearch.js +141 -0
- package/dist/core/tools/fuzzySearch.js.map +1 -0
- package/dist/core/tools/fuzzySearchCore.d.ts +52 -0
- package/dist/core/tools/fuzzySearchCore.js +126 -0
- package/dist/core/tools/fuzzySearchCore.js.map +1 -0
- package/dist/core/tools/improved-process-tools.d.ts +24 -0
- package/dist/core/tools/improved-process-tools.js +645 -0
- package/dist/core/tools/improved-process-tools.js.map +1 -0
- package/dist/core/tools/mime-types.d.ts +3 -0
- package/dist/core/tools/mime-types.js +29 -0
- package/dist/core/tools/mime-types.js.map +1 -0
- package/dist/core/tools/pdf/extract-images.d.ts +34 -0
- package/dist/core/tools/pdf/extract-images.js +133 -0
- package/dist/core/tools/pdf/extract-images.js.map +1 -0
- package/dist/core/tools/pdf/index.d.ts +6 -0
- package/dist/core/tools/pdf/index.js +4 -0
- package/dist/core/tools/pdf/index.js.map +1 -0
- package/dist/core/tools/pdf/lib/pdf2md.d.ts +36 -0
- package/dist/core/tools/pdf/lib/pdf2md.js +77 -0
- package/dist/core/tools/pdf/lib/pdf2md.js.map +1 -0
- package/dist/core/tools/pdf/manipulations.d.ts +13 -0
- package/dist/core/tools/pdf/manipulations.js +100 -0
- package/dist/core/tools/pdf/manipulations.js.map +1 -0
- package/dist/core/tools/pdf/markdown.d.ts +26 -0
- package/dist/core/tools/pdf/markdown.js +276 -0
- package/dist/core/tools/pdf/markdown.js.map +1 -0
- package/dist/core/tools/pdf/utils.d.ts +12 -0
- package/dist/core/tools/pdf/utils.js +35 -0
- package/dist/core/tools/pdf/utils.js.map +1 -0
- package/dist/core/tools/process.d.ts +17 -0
- package/dist/core/tools/process.js +88 -0
- package/dist/core/tools/process.js.map +1 -0
- package/dist/core/tools/prompts.d.ts +28 -0
- package/dist/core/tools/prompts.js +260 -0
- package/dist/core/tools/prompts.js.map +1 -0
- package/dist/core/tools/schemas.d.ts +594 -0
- package/dist/core/tools/schemas.js +282 -0
- package/dist/core/tools/schemas.js.map +1 -0
- package/dist/core/tools/usage.d.ts +5 -0
- package/dist/core/tools/usage.js +25 -0
- package/dist/core/tools/usage.js.map +1 -0
- package/dist/core/types.d.ts +83 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/ui/file-preview/shared/preview-file-types.d.ts +5 -0
- package/dist/core/ui/file-preview/shared/preview-file-types.js +60 -0
- package/dist/core/ui/file-preview/shared/preview-file-types.js.map +1 -0
- package/dist/core/utils/ab-test.d.ts +12 -0
- package/dist/core/utils/ab-test.js +105 -0
- package/dist/core/utils/ab-test.js.map +1 -0
- package/dist/core/utils/capture.d.ts +12 -0
- package/dist/core/utils/capture.js +38 -0
- package/dist/core/utils/capture.js.map +1 -0
- package/dist/core/utils/dockerPrompt.d.ts +17 -0
- package/dist/core/utils/dockerPrompt.js +54 -0
- package/dist/core/utils/dockerPrompt.js.map +1 -0
- package/dist/core/utils/feature-flags.d.ts +59 -0
- package/dist/core/utils/feature-flags.js +218 -0
- package/dist/core/utils/feature-flags.js.map +1 -0
- package/dist/core/utils/files/base.d.ts +173 -0
- package/dist/core/utils/files/base.js +6 -0
- package/dist/core/utils/files/base.js.map +1 -0
- package/dist/core/utils/files/binary.d.ts +21 -0
- package/dist/core/utils/files/binary.js +66 -0
- package/dist/core/utils/files/binary.js.map +1 -0
- package/dist/core/utils/files/docx.d.ts +47 -0
- package/dist/core/utils/files/docx.js +678 -0
- package/dist/core/utils/files/docx.js.map +1 -0
- package/dist/core/utils/files/excel.d.ts +24 -0
- package/dist/core/utils/files/excel.js +438 -0
- package/dist/core/utils/files/excel.js.map +1 -0
- package/dist/core/utils/files/factory.d.ts +29 -0
- package/dist/core/utils/files/factory.js +103 -0
- package/dist/core/utils/files/factory.js.map +1 -0
- package/dist/core/utils/files/image.d.ts +21 -0
- package/dist/core/utils/files/image.js +79 -0
- package/dist/core/utils/files/image.js.map +1 -0
- package/dist/core/utils/files/index.d.ts +9 -0
- package/dist/core/utils/files/index.js +15 -0
- package/dist/core/utils/files/index.js.map +1 -0
- package/dist/core/utils/files/pdf.d.ts +32 -0
- package/dist/core/utils/files/pdf.js +141 -0
- package/dist/core/utils/files/pdf.js.map +1 -0
- package/dist/core/utils/files/text.d.ts +70 -0
- package/dist/core/utils/files/text.js +552 -0
- package/dist/core/utils/files/text.js.map +1 -0
- package/dist/core/utils/fuzzySearchLogger.d.ts +26 -0
- package/dist/core/utils/fuzzySearchLogger.js +9 -0
- package/dist/core/utils/fuzzySearchLogger.js.map +1 -0
- package/dist/core/utils/lineEndingHandler.d.ts +21 -0
- package/dist/core/utils/lineEndingHandler.js +78 -0
- package/dist/core/utils/lineEndingHandler.js.map +1 -0
- package/dist/core/utils/logger.d.ts +17 -0
- package/dist/core/utils/logger.js +5 -0
- package/dist/core/utils/logger.js.map +1 -0
- package/dist/core/utils/mcp-ui-ab-test.d.ts +13 -0
- package/dist/core/utils/mcp-ui-ab-test.js +63 -0
- package/dist/core/utils/mcp-ui-ab-test.js.map +1 -0
- package/dist/core/utils/open-browser.d.ts +9 -0
- package/dist/core/utils/open-browser.js +47 -0
- package/dist/core/utils/open-browser.js.map +1 -0
- package/dist/core/utils/process-detection.d.ts +23 -0
- package/dist/core/utils/process-detection.js +151 -0
- package/dist/core/utils/process-detection.js.map +1 -0
- package/dist/core/utils/ripgrep-resolver.d.ts +9 -0
- package/dist/core/utils/ripgrep-resolver.js +96 -0
- package/dist/core/utils/ripgrep-resolver.js.map +1 -0
- package/dist/core/utils/system-info.d.ts +72 -0
- package/dist/core/utils/system-info.js +723 -0
- package/dist/core/utils/system-info.js.map +1 -0
- package/dist/core/utils/toolHistory.d.ts +31 -0
- package/dist/core/utils/toolHistory.js +17 -0
- package/dist/core/utils/toolHistory.js.map +1 -0
- package/dist/core/utils/trackTools.d.ts +1 -0
- package/dist/core/utils/trackTools.js +3 -0
- package/dist/core/utils/trackTools.js.map +1 -0
- package/dist/core/utils/unsupportedParams.d.ts +24 -0
- package/dist/core/utils/unsupportedParams.js +67 -0
- package/dist/core/utils/unsupportedParams.js.map +1 -0
- package/dist/core/utils/usageTracker.d.ts +125 -0
- package/dist/core/utils/usageTracker.js +475 -0
- package/dist/core/utils/usageTracker.js.map +1 -0
- package/dist/core/utils/welcome-onboarding.d.ts +11 -0
- package/dist/core/utils/welcome-onboarding.js +100 -0
- package/dist/core/utils/welcome-onboarding.js.map +1 -0
- package/dist/core/utils/withTimeout.d.ts +28 -0
- package/dist/core/utils/withTimeout.js +86 -0
- package/dist/core/utils/withTimeout.js.map +1 -0
- package/dist/core/version.d.ts +1 -0
- package/dist/core/version.js +2 -0
- package/dist/core/version.js.map +1 -0
- package/dist/dispatcher.d.ts +7 -0
- package/dist/dispatcher.js +179 -0
- package/dist/dispatcher.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/cli-commands.d.ts +5 -0
- package/dist/plugins/cli-commands.js +240 -0
- package/dist/plugins/cli-commands.js.map +1 -0
- package/dist/plugins/defaults.d.ts +62 -0
- package/dist/plugins/defaults.js +260 -0
- package/dist/plugins/defaults.js.map +1 -0
- package/dist/plugins/first-run.d.ts +16 -0
- package/dist/plugins/first-run.js +89 -0
- package/dist/plugins/first-run.js.map +1 -0
- package/dist/plugins/host.d.ts +20 -0
- package/dist/plugins/host.js +175 -0
- package/dist/plugins/host.js.map +1 -0
- package/dist/plugins/installer.d.ts +21 -0
- package/dist/plugins/installer.js +350 -0
- package/dist/plugins/installer.js.map +1 -0
- package/dist/plugins/locate.d.ts +15 -0
- package/dist/plugins/locate.js +99 -0
- package/dist/plugins/locate.js.map +1 -0
- package/dist/plugins/manager.d.ts +32 -0
- package/dist/plugins/manager.js +139 -0
- package/dist/plugins/manager.js.map +1 -0
- package/dist/plugins/paths.d.ts +32 -0
- package/dist/plugins/paths.js +49 -0
- package/dist/plugins/paths.js.map +1 -0
- package/dist/plugins/python.d.ts +55 -0
- package/dist/plugins/python.js +234 -0
- package/dist/plugins/python.js.map +1 -0
- package/dist/plugins/store.d.ts +12 -0
- package/dist/plugins/store.js +76 -0
- package/dist/plugins/store.js.map +1 -0
- package/dist/plugins/types.d.ts +112 -0
- package/dist/plugins/types.js +9 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/plugins/util.d.ts +37 -0
- package/dist/plugins/util.js +283 -0
- package/dist/plugins/util.js.map +1 -0
- package/dist/runtime/activity.d.ts +49 -0
- package/dist/runtime/activity.js +158 -0
- package/dist/runtime/activity.js.map +1 -0
- package/dist/runtime/browser-workflow.d.ts +21 -0
- package/dist/runtime/browser-workflow.js +51 -0
- package/dist/runtime/browser-workflow.js.map +1 -0
- package/dist/runtime/code-graph.d.ts +156 -0
- package/dist/runtime/code-graph.js +330 -0
- package/dist/runtime/code-graph.js.map +1 -0
- package/dist/runtime/code-structure.d.ts +53 -0
- package/dist/runtime/code-structure.js +152 -0
- package/dist/runtime/code-structure.js.map +1 -0
- package/dist/runtime/coding-session.d.ts +97 -0
- package/dist/runtime/coding-session.js +142 -0
- package/dist/runtime/coding-session.js.map +1 -0
- package/dist/runtime/docker-client.d.ts +47 -0
- package/dist/runtime/docker-client.js +40 -0
- package/dist/runtime/docker-client.js.map +1 -0
- package/dist/runtime/errors.d.ts +9 -0
- package/dist/runtime/errors.js +56 -0
- package/dist/runtime/errors.js.map +1 -0
- package/dist/runtime/failure-log.d.ts +22 -0
- package/dist/runtime/failure-log.js +112 -0
- package/dist/runtime/failure-log.js.map +1 -0
- package/dist/runtime/fast-batch.d.ts +55 -0
- package/dist/runtime/fast-batch.js +104 -0
- package/dist/runtime/fast-batch.js.map +1 -0
- package/dist/runtime/file-safety.d.ts +7 -0
- package/dist/runtime/file-safety.js +134 -0
- package/dist/runtime/file-safety.js.map +1 -0
- package/dist/runtime/generic-code.d.ts +9 -0
- package/dist/runtime/generic-code.js +123 -0
- package/dist/runtime/generic-code.js.map +1 -0
- package/dist/runtime/graph-outline.d.ts +54 -0
- package/dist/runtime/graph-outline.js +118 -0
- package/dist/runtime/graph-outline.js.map +1 -0
- package/dist/runtime/harness.d.ts +61 -0
- package/dist/runtime/harness.js +102 -0
- package/dist/runtime/harness.js.map +1 -0
- package/dist/runtime/instruction-context.d.ts +23 -0
- package/dist/runtime/instruction-context.js +136 -0
- package/dist/runtime/instruction-context.js.map +1 -0
- package/dist/runtime/lab-mode.d.ts +4 -0
- package/dist/runtime/lab-mode.js +18 -0
- package/dist/runtime/lab-mode.js.map +1 -0
- package/dist/runtime/languages.d.ts +30 -0
- package/dist/runtime/languages.js +59 -0
- package/dist/runtime/languages.js.map +1 -0
- package/dist/runtime/nav-cache.d.ts +2 -0
- package/dist/runtime/nav-cache.js +12 -0
- package/dist/runtime/nav-cache.js.map +1 -0
- package/dist/runtime/operations.d.ts +40 -0
- package/dist/runtime/operations.js +86 -0
- package/dist/runtime/operations.js.map +1 -0
- package/dist/runtime/platform-capabilities.d.ts +20 -0
- package/dist/runtime/platform-capabilities.js +36 -0
- package/dist/runtime/platform-capabilities.js.map +1 -0
- package/dist/runtime/program-runner.d.ts +4 -0
- package/dist/runtime/program-runner.js +73 -0
- package/dist/runtime/program-runner.js.map +1 -0
- package/dist/runtime/project-context.d.ts +53 -0
- package/dist/runtime/project-context.js +90 -0
- package/dist/runtime/project-context.js.map +1 -0
- package/dist/runtime/project-files.d.ts +2 -0
- package/dist/runtime/project-files.js +3 -0
- package/dist/runtime/project-files.js.map +1 -0
- package/dist/runtime/project-index.d.ts +40 -0
- package/dist/runtime/project-index.js +158 -0
- package/dist/runtime/project-index.js.map +1 -0
- package/dist/runtime/resource-limits.d.ts +42 -0
- package/dist/runtime/resource-limits.js +50 -0
- package/dist/runtime/resource-limits.js.map +1 -0
- package/dist/runtime/scratch-budget.d.ts +11 -0
- package/dist/runtime/scratch-budget.js +107 -0
- package/dist/runtime/scratch-budget.js.map +1 -0
- package/dist/runtime/search-diagnostics.d.ts +3 -0
- package/dist/runtime/search-diagnostics.js +45 -0
- package/dist/runtime/search-diagnostics.js.map +1 -0
- package/dist/runtime/toolchains.d.ts +25 -0
- package/dist/runtime/toolchains.js +70 -0
- package/dist/runtime/toolchains.js.map +1 -0
- package/dist/runtime/worker-coordination.d.ts +314 -0
- package/dist/runtime/worker-coordination.js +564 -0
- package/dist/runtime/worker-coordination.js.map +1 -0
- package/dist/runtime/workspace.d.ts +151 -0
- package/dist/runtime/workspace.js +267 -0
- package/dist/runtime/workspace.js.map +1 -0
- package/dist/service.d.ts +3 -0
- package/dist/service.js +102 -0
- package/dist/service.js.map +1 -0
- package/dist/terminal-setup.d.ts +33 -0
- package/dist/terminal-setup.js +219 -0
- package/dist/terminal-setup.js.map +1 -0
- package/dist/terminal-shortcuts.d.ts +22 -0
- package/dist/terminal-shortcuts.js +145 -0
- package/dist/terminal-shortcuts.js.map +1 -0
- package/dist/terminal-ui.d.ts +20 -0
- package/dist/terminal-ui.js +53 -0
- package/dist/terminal-ui.js.map +1 -0
- package/dist/tools/ast-grep.d.ts +132 -0
- package/dist/tools/ast-grep.js +625 -0
- package/dist/tools/ast-grep.js.map +1 -0
- package/dist/tools/brc-tools.d.ts +112 -0
- package/dist/tools/brc-tools.js +599 -0
- package/dist/tools/brc-tools.js.map +1 -0
- package/dist/tools/check-tools.d.ts +4 -0
- package/dist/tools/check-tools.js +29 -0
- package/dist/tools/check-tools.js.map +1 -0
- package/dist/tools/coding-tools.d.ts +33 -0
- package/dist/tools/coding-tools.js +190 -0
- package/dist/tools/coding-tools.js.map +1 -0
- package/dist/tools/command-shell.d.ts +17 -0
- package/dist/tools/command-shell.js +84 -0
- package/dist/tools/command-shell.js.map +1 -0
- package/dist/tools/dev-extras.d.ts +42 -0
- package/dist/tools/dev-extras.js +135 -0
- package/dist/tools/dev-extras.js.map +1 -0
- package/dist/tools/edit-tools.d.ts +4 -0
- package/dist/tools/edit-tools.js +293 -0
- package/dist/tools/edit-tools.js.map +1 -0
- package/dist/tools/fast-exec.d.ts +11 -0
- package/dist/tools/fast-exec.js +202 -0
- package/dist/tools/fast-exec.js.map +1 -0
- package/dist/tools/image-tools.d.ts +37 -0
- package/dist/tools/image-tools.js +293 -0
- package/dist/tools/image-tools.js.map +1 -0
- package/dist/tools/jobs.d.ts +227 -0
- package/dist/tools/jobs.js +608 -0
- package/dist/tools/jobs.js.map +1 -0
- package/dist/tools/ops-tools.d.ts +8 -0
- package/dist/tools/ops-tools.js +58 -0
- package/dist/tools/ops-tools.js.map +1 -0
- package/dist/tools/plugin-tools.d.ts +38 -0
- package/dist/tools/plugin-tools.js +133 -0
- package/dist/tools/plugin-tools.js.map +1 -0
- package/dist/tools/rtk.d.ts +60 -0
- package/dist/tools/rtk.js +245 -0
- package/dist/tools/rtk.js.map +1 -0
- package/dist/tools/sandbox-tools.d.ts +41 -0
- package/dist/tools/sandbox-tools.js +146 -0
- package/dist/tools/sandbox-tools.js.map +1 -0
- package/dist/tools/worker-tools.d.ts +231 -0
- package/dist/tools/worker-tools.js +55 -0
- package/dist/tools/worker-tools.js.map +1 -0
- package/dist/tools/workspace-batch.d.ts +262 -0
- package/dist/tools/workspace-batch.js +188 -0
- package/dist/tools/workspace-batch.js.map +1 -0
- package/dist/transport/pairing.d.ts +22 -0
- package/dist/transport/pairing.js +154 -0
- package/dist/transport/pairing.js.map +1 -0
- package/dist/transport/plugin-admin.d.ts +33 -0
- package/dist/transport/plugin-admin.js +156 -0
- package/dist/transport/plugin-admin.js.map +1 -0
- package/dist/transport/relay-url.d.ts +3 -0
- package/dist/transport/relay-url.js +38 -0
- package/dist/transport/relay-url.js.map +1 -0
- package/dist/transport/result-budget.d.ts +11 -0
- package/dist/transport/result-budget.js +45 -0
- package/dist/transport/result-budget.js.map +1 -0
- package/dist/transport/ws-client.d.ts +64 -0
- package/dist/transport/ws-client.js +242 -0
- package/dist/transport/ws-client.js.map +1 -0
- package/package.json +70 -5
|
@@ -0,0 +1,1020 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Better Remote Commander (BRC): tool definitions (name, description, JSON schema) vendored from
|
|
3
|
+
* Desktop Commander's server.ts ListTools handler. Generated by scripts/extract-tools.mjs.
|
|
4
|
+
* UI-preview _meta entries removed; descriptions otherwise unchanged.
|
|
5
|
+
*/
|
|
6
|
+
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
7
|
+
import { getSystemInfo, getOSSpecificGuidance, getPathGuidance } from './utils/system-info.js';
|
|
8
|
+
import { StartProcessArgsSchema, ReadProcessOutputArgsSchema, InteractWithProcessArgsSchema, ForceTerminateArgsSchema, ListSessionsArgsSchema, KillProcessArgsSchema, ReadFileArgsSchema, ReadMultipleFilesArgsSchema, WriteFileArgsSchema, CreateDirectoryArgsSchema, ListDirectoryArgsSchema, MoveFileArgsSchema, PrepareFileTransferArgsSchema, SendFileTransferArgsSchema, ReceiveFileTransferArgsSchema, GetFileInfoArgsSchema, GetConfigArgsSchema, SetConfigValueArgsSchema, ListProcessesArgsSchema, EditBlockArgsSchema, GetUsageStatsArgsSchema, GiveFeedbackArgsSchema, StartSearchArgsSchema, GetMoreSearchResultsArgsSchema, StopSearchArgsSchema, ListSearchesArgsSchema, GetPromptsArgsSchema, GetRecentToolCallsArgsSchema, WritePdfArgsSchema, } from './tools/schemas.js';
|
|
9
|
+
const CMD_PREFIX_DESCRIPTION = `This command can be referenced as "BRC: ..." or "use Better Remote Commander (BRC) to ..." in your instructions.`;
|
|
10
|
+
/** Upstream-only onboarding/UI tools; never exposed by Better Remote Commander (BRC). */
|
|
11
|
+
export const EXCLUDED_TOOLS = new Set(['give_feedback_to_desktop_commander', 'get_prompts', 'track_ui_event']);
|
|
12
|
+
export function buildToolDefinitions() {
|
|
13
|
+
// Computed lazily (not at module load): getSystemInfo() spawns processes.
|
|
14
|
+
const SYSTEM_INFO = getSystemInfo();
|
|
15
|
+
const OS_GUIDANCE = getOSSpecificGuidance(SYSTEM_INFO);
|
|
16
|
+
const PATH_GUIDANCE = `IMPORTANT: ${getPathGuidance(SYSTEM_INFO)} Relative paths may fail as they depend on the current working directory. Tilde paths (~/...) might not work in all contexts. Unless the user explicitly asks for relative paths, use absolute paths.`;
|
|
17
|
+
const allTools = [
|
|
18
|
+
// Configuration tools
|
|
19
|
+
{
|
|
20
|
+
name: "get_config",
|
|
21
|
+
description: `
|
|
22
|
+
Get the complete server configuration as JSON. Config includes fields for:
|
|
23
|
+
- blockedCommands (array of blocked shell commands)
|
|
24
|
+
- defaultShell (shell to use for commands)
|
|
25
|
+
- allowedDirectories (paths the server can access)
|
|
26
|
+
- fileReadLineLimit (max lines for read_file, default 1000)
|
|
27
|
+
- fileWriteLineLimit (max lines per write_file call, default 50)
|
|
28
|
+
- telemetryEnabled (boolean for telemetry opt-in/out)
|
|
29
|
+
- currentClient (information about the currently connected MCP client)
|
|
30
|
+
- clientHistory (history of all clients that have connected)
|
|
31
|
+
- version (version of the DesktopCommander)
|
|
32
|
+
- systemInfo (operating system and environment details)
|
|
33
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
34
|
+
inputSchema: zodToJsonSchema(GetConfigArgsSchema),
|
|
35
|
+
annotations: {
|
|
36
|
+
title: "Get Configuration",
|
|
37
|
+
readOnlyHint: true,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "set_config_value",
|
|
42
|
+
description: `
|
|
43
|
+
Set a specific configuration value by key.
|
|
44
|
+
|
|
45
|
+
WARNING: Should be used in a separate chat from file operations and
|
|
46
|
+
command execution to prevent security issues.
|
|
47
|
+
|
|
48
|
+
Config keys include:
|
|
49
|
+
- blockedCommands (array)
|
|
50
|
+
- defaultShell (string)
|
|
51
|
+
- allowedDirectories (array of paths)
|
|
52
|
+
- fileReadLineLimit (number, max lines for read_file)
|
|
53
|
+
- fileWriteLineLimit (number, max lines per write_file call)
|
|
54
|
+
- telemetryEnabled (boolean)
|
|
55
|
+
|
|
56
|
+
IMPORTANT: Setting allowedDirectories to an empty array ([]) allows full access
|
|
57
|
+
to the entire file system, regardless of the operating system.
|
|
58
|
+
|
|
59
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
60
|
+
inputSchema: zodToJsonSchema(SetConfigValueArgsSchema),
|
|
61
|
+
annotations: {
|
|
62
|
+
title: "Set Configuration Value",
|
|
63
|
+
readOnlyHint: false,
|
|
64
|
+
destructiveHint: true,
|
|
65
|
+
openWorldHint: false,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
// Filesystem tools
|
|
69
|
+
{
|
|
70
|
+
name: "read_file",
|
|
71
|
+
description: `
|
|
72
|
+
Read contents from files and URLs.
|
|
73
|
+
Read PDF files and extract content as markdown and images.
|
|
74
|
+
|
|
75
|
+
Prefer this over 'execute_command' with cat/type for viewing files.
|
|
76
|
+
|
|
77
|
+
Supports partial file reading with:
|
|
78
|
+
- 'offset' (start line, default: 0)
|
|
79
|
+
* Positive: Start from line N (0-based indexing)
|
|
80
|
+
* Negative: Read last N lines from end (tail behavior)
|
|
81
|
+
- 'length' (max lines to read, default: configurable via 'fileReadLineLimit' setting, initially 1000)
|
|
82
|
+
* Used with positive offsets for range reading
|
|
83
|
+
* Ignored when offset is negative (reads all requested tail lines)
|
|
84
|
+
|
|
85
|
+
Examples:
|
|
86
|
+
- offset: 0, length: 10 → First 10 lines
|
|
87
|
+
- offset: 100, length: 5 → Lines 100-104
|
|
88
|
+
- offset: -20 → Last 20 lines
|
|
89
|
+
- offset: -5, length: 10 → Last 5 lines (length ignored)
|
|
90
|
+
|
|
91
|
+
Performance optimizations:
|
|
92
|
+
- Large files with negative offsets use reverse reading for efficiency
|
|
93
|
+
- Large files with deep positive offsets use byte estimation
|
|
94
|
+
- Small files use fast readline streaming
|
|
95
|
+
|
|
96
|
+
When reading from the file system, only works within allowed directories.
|
|
97
|
+
Can fetch content from URLs when isUrl parameter is set to true
|
|
98
|
+
(URLs are always read in full regardless of offset/length).
|
|
99
|
+
|
|
100
|
+
FORMAT HANDLING (by extension):
|
|
101
|
+
- Text: Uses offset/length for line-based pagination
|
|
102
|
+
- Excel (.xlsx, .xls, .xlsm): Returns JSON 2D array
|
|
103
|
+
* sheet: "Sheet1" (name) or "0" (index as string, 0-based)
|
|
104
|
+
* range: ALWAYS use FROM:TO format (e.g., "A1:D100", "C1:C1", "B2:B50")
|
|
105
|
+
* offset/length work as row pagination (optional fallback)
|
|
106
|
+
- Images (PNG, JPEG, GIF, WebP): Base64 encoded viewable content
|
|
107
|
+
- PDF: Extracts text content as markdown with page structure
|
|
108
|
+
* offset/length work as page pagination (0-based)
|
|
109
|
+
* Includes embedded images when available
|
|
110
|
+
- DOCX (.docx): Two modes depending on parameters:
|
|
111
|
+
* DEFAULT (no offset/length): Returns a text-bearing outline — shows paragraphs with text,
|
|
112
|
+
tables with cell content, styles, image refs. Skips shapes/drawings/SVG noise.
|
|
113
|
+
Each element shows its body index [0], [1], etc.
|
|
114
|
+
* WITH offset/length: Returns raw pretty-printed XML with line pagination.
|
|
115
|
+
Use this to drill into specific sections or see the actual XML for editing.
|
|
116
|
+
* EDITING WORKFLOW: 1) read_file to get outline, 2) read_file with offset/length
|
|
117
|
+
to see raw XML around what you want to edit, 3) edit_block with old_string/new_string
|
|
118
|
+
using XML fragments copied from the read output.
|
|
119
|
+
* IMPORTANT: offset MUST be non-zero to get raw XML (use offset=1 to start from line 1).
|
|
120
|
+
offset=0 always returns the outline regardless of length.
|
|
121
|
+
* For BULK changes (translation, mass replacements): use start_process with Python
|
|
122
|
+
zipfile module to find/replace all <w:t> elements at once.
|
|
123
|
+
|
|
124
|
+
${PATH_GUIDANCE}
|
|
125
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
126
|
+
inputSchema: zodToJsonSchema(ReadFileArgsSchema),
|
|
127
|
+
annotations: {
|
|
128
|
+
title: "Read File or URL",
|
|
129
|
+
readOnlyHint: true,
|
|
130
|
+
openWorldHint: true,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: "read_multiple_files",
|
|
135
|
+
description: `
|
|
136
|
+
Read the contents of multiple files simultaneously.
|
|
137
|
+
|
|
138
|
+
Two ways to list files (can be combined):
|
|
139
|
+
- paths: ["/a.ts", "/b.ts"] → read each file from the start (default line limit)
|
|
140
|
+
- files: [{path: "/a.ts", offset: 120, length: 40}, {path: "/b.log", offset: -50}]
|
|
141
|
+
→ per-file line ranges, same offset/length semantics as read_file
|
|
142
|
+
|
|
143
|
+
Each file's content is returned with its path as a reference.
|
|
144
|
+
Handles text files normally and renders images as viewable content.
|
|
145
|
+
Recognized image types: PNG, JPEG, GIF, WebP.
|
|
146
|
+
|
|
147
|
+
Failed reads for individual files won't stop the entire operation.
|
|
148
|
+
Only works within allowed directories.
|
|
149
|
+
|
|
150
|
+
${PATH_GUIDANCE}
|
|
151
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
152
|
+
inputSchema: zodToJsonSchema(ReadMultipleFilesArgsSchema),
|
|
153
|
+
annotations: {
|
|
154
|
+
title: "Read Multiple Files",
|
|
155
|
+
readOnlyHint: true,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "write_file",
|
|
160
|
+
description: `
|
|
161
|
+
Write or append to file contents.
|
|
162
|
+
|
|
163
|
+
IMPORTANT: DO NOT use this tool to create PDF files. Use 'write_pdf' for all PDF creation tasks.
|
|
164
|
+
DO NOT use this tool to edit DOCX files. Use 'edit_block' with old_string/new_string instead.
|
|
165
|
+
To CREATE a new DOCX, use write_file with .docx extension — text content with markdown headings (#, ##, ###) is converted to styled DOCX paragraphs.
|
|
166
|
+
|
|
167
|
+
CHUNKING IS STANDARD PRACTICE: Always write files in chunks of 25-30 lines maximum.
|
|
168
|
+
This is the normal, recommended way to write files - not an emergency measure.
|
|
169
|
+
|
|
170
|
+
STANDARD PROCESS FOR ANY FILE:
|
|
171
|
+
1. FIRST → write_file(filePath, firstChunk, {mode: 'rewrite'}) [≤30 lines]
|
|
172
|
+
2. THEN → write_file(filePath, secondChunk, {mode: 'append'}) [≤30 lines]
|
|
173
|
+
3. CONTINUE → write_file(filePath, nextChunk, {mode: 'append'}) [≤30 lines]
|
|
174
|
+
|
|
175
|
+
ALWAYS CHUNK PROACTIVELY - don't wait for performance warnings!
|
|
176
|
+
|
|
177
|
+
WHEN TO CHUNK (always be proactive):
|
|
178
|
+
1. Any file expected to be longer than 25-30 lines
|
|
179
|
+
2. When writing multiple files in sequence
|
|
180
|
+
3. When creating documentation, code files, or configuration files
|
|
181
|
+
|
|
182
|
+
HANDLING CONTINUATION ("Continue" prompts):
|
|
183
|
+
If user asks to "Continue" after an incomplete operation:
|
|
184
|
+
1. Read the file to see what was successfully written
|
|
185
|
+
2. Continue writing ONLY the remaining content using {mode: 'append'}
|
|
186
|
+
3. Keep chunks to 25-30 lines each
|
|
187
|
+
|
|
188
|
+
FORMAT HANDLING (by extension):
|
|
189
|
+
- Text files: String content
|
|
190
|
+
- Excel (.xlsx, .xls, .xlsm): JSON 2D array or {"SheetName": [[...]]}
|
|
191
|
+
Example: '[["Name","Age"],["Alice",30]]'
|
|
192
|
+
|
|
193
|
+
Files over 50 lines will generate performance notes but are still written successfully.
|
|
194
|
+
Only works within allowed directories.
|
|
195
|
+
|
|
196
|
+
${PATH_GUIDANCE}
|
|
197
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
198
|
+
inputSchema: zodToJsonSchema(WriteFileArgsSchema),
|
|
199
|
+
annotations: {
|
|
200
|
+
title: "Write File",
|
|
201
|
+
readOnlyHint: false,
|
|
202
|
+
destructiveHint: true,
|
|
203
|
+
openWorldHint: false,
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "write_pdf",
|
|
208
|
+
description: `
|
|
209
|
+
Create a new PDF file or modify an existing one.
|
|
210
|
+
|
|
211
|
+
THIS IS THE ONLY TOOL FOR CREATING AND MODIFYING PDF FILES.
|
|
212
|
+
|
|
213
|
+
RULES ABOUT FILENAMES:
|
|
214
|
+
- When creating a new PDF, 'outputPath' MUST be provided and MUST use a new unique filename (e.g., "result_01.pdf", "analysis_2025_01.pdf", etc.).
|
|
215
|
+
|
|
216
|
+
MODES:
|
|
217
|
+
1. CREATE NEW PDF:
|
|
218
|
+
- Pass a markdown string as 'content'.
|
|
219
|
+
write_pdf(path="doc.pdf", content="# Title\\n\\nBody text...")
|
|
220
|
+
|
|
221
|
+
2. MODIFY EXISTING PDF:
|
|
222
|
+
- Pass array of operations as 'content'.
|
|
223
|
+
- NEVER overwrite the original file.
|
|
224
|
+
- ALWAYS provide a new filename in 'outputPath'.
|
|
225
|
+
- After modifying, show original file path and new file path to user.
|
|
226
|
+
|
|
227
|
+
write_pdf(path="doc.pdf", content=[
|
|
228
|
+
{ type: "delete", pageIndexes: [0, 2] },
|
|
229
|
+
{ type: "insert", pageIndex: 1, markdown: "# New Page" }
|
|
230
|
+
])
|
|
231
|
+
|
|
232
|
+
OPERATIONS:
|
|
233
|
+
- delete: Remove pages by 0-based index.
|
|
234
|
+
{ type: "delete", pageIndexes: [0, 1, 5] }
|
|
235
|
+
|
|
236
|
+
- insert: Add pages at a specific 0-based index.
|
|
237
|
+
{ type: "insert", pageIndex: 0, markdown: "..." }
|
|
238
|
+
{ type: "insert", pageIndex: 5, sourcePdfPath: "/path/to/source.pdf" }
|
|
239
|
+
|
|
240
|
+
PAGE BREAKS:
|
|
241
|
+
To force a page break, use this HTML element:
|
|
242
|
+
<div style="page-break-before: always;"></div>
|
|
243
|
+
|
|
244
|
+
Example:
|
|
245
|
+
"# Page 1\\n\\n<div style=\\"page-break-before: always;\\"></div>\\n\\n# Page 2"
|
|
246
|
+
|
|
247
|
+
ADVANCED STYLING:
|
|
248
|
+
HTML/CSS and inline SVG are supported for:
|
|
249
|
+
- Text styling: colors, sizes, alignment, highlights
|
|
250
|
+
- Boxes: borders, backgrounds, padding, rounded corners
|
|
251
|
+
- SVG graphics: charts, diagrams, icons, shapes
|
|
252
|
+
- Images: <img src="/absolute/path/image.jpg" width="300" /> or 
|
|
253
|
+
|
|
254
|
+
Supports standard markdown features including headers, lists, code blocks, tables, and basic formatting.
|
|
255
|
+
|
|
256
|
+
Only works within allowed directories.
|
|
257
|
+
|
|
258
|
+
${PATH_GUIDANCE}
|
|
259
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
260
|
+
inputSchema: zodToJsonSchema(WritePdfArgsSchema),
|
|
261
|
+
annotations: {
|
|
262
|
+
title: "Write/Modify PDF",
|
|
263
|
+
readOnlyHint: false,
|
|
264
|
+
destructiveHint: true,
|
|
265
|
+
openWorldHint: false,
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: "create_directory",
|
|
270
|
+
description: `
|
|
271
|
+
Create a new directory or ensure a directory exists.
|
|
272
|
+
|
|
273
|
+
Can create multiple nested directories in one operation.
|
|
274
|
+
Only works within allowed directories.
|
|
275
|
+
|
|
276
|
+
${PATH_GUIDANCE}
|
|
277
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
278
|
+
inputSchema: zodToJsonSchema(CreateDirectoryArgsSchema),
|
|
279
|
+
annotations: {
|
|
280
|
+
title: "Create Directory",
|
|
281
|
+
readOnlyHint: false,
|
|
282
|
+
destructiveHint: false,
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
name: "list_directory",
|
|
287
|
+
description: `
|
|
288
|
+
Get a detailed listing of all files and directories in a specified path.
|
|
289
|
+
|
|
290
|
+
Use this instead of 'execute_command' with ls/dir commands.
|
|
291
|
+
Results distinguish between files and directories with [FILE] and [DIR] prefixes.
|
|
292
|
+
|
|
293
|
+
Supports recursive listing with the 'depth' parameter (default: 2):
|
|
294
|
+
- depth=1: Only direct contents of the directory
|
|
295
|
+
- depth=2: Contents plus one level of subdirectories
|
|
296
|
+
- depth=3+: Multiple levels deep
|
|
297
|
+
|
|
298
|
+
CONTEXT OVERFLOW PROTECTION:
|
|
299
|
+
- Top-level directory shows ALL items
|
|
300
|
+
- Nested directories are limited to 100 items maximum per directory
|
|
301
|
+
- When a nested directory has more than 100 items, you'll see a warning like:
|
|
302
|
+
[WARNING] node_modules: 500 items hidden (showing first 100 of 600 total)
|
|
303
|
+
- This prevents overwhelming the context with large directories like node_modules
|
|
304
|
+
|
|
305
|
+
Results show full relative paths from the root directory being listed.
|
|
306
|
+
Example output with depth=2:
|
|
307
|
+
[DIR] src
|
|
308
|
+
[FILE] src/index.ts
|
|
309
|
+
[DIR] src/tools
|
|
310
|
+
[FILE] src/tools/filesystem.ts
|
|
311
|
+
|
|
312
|
+
If a directory cannot be accessed, it will show [DENIED] instead.
|
|
313
|
+
If a path does not exist, it will show [NOT_FOUND] instead.
|
|
314
|
+
Only works within allowed directories.
|
|
315
|
+
|
|
316
|
+
${PATH_GUIDANCE}
|
|
317
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
318
|
+
inputSchema: zodToJsonSchema(ListDirectoryArgsSchema),
|
|
319
|
+
annotations: {
|
|
320
|
+
title: "List Directory Contents",
|
|
321
|
+
readOnlyHint: true,
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: "move_file",
|
|
326
|
+
description: `
|
|
327
|
+
Move or rename files and directories.
|
|
328
|
+
|
|
329
|
+
Can move files between directories and rename them in a single operation.
|
|
330
|
+
Both source and destination must be within allowed directories.
|
|
331
|
+
|
|
332
|
+
${PATH_GUIDANCE}
|
|
333
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
334
|
+
inputSchema: zodToJsonSchema(MoveFileArgsSchema),
|
|
335
|
+
annotations: {
|
|
336
|
+
title: "Move/Rename File",
|
|
337
|
+
readOnlyHint: false,
|
|
338
|
+
destructiveHint: true,
|
|
339
|
+
openWorldHint: false,
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: "prepare_file_transfer",
|
|
344
|
+
description: `
|
|
345
|
+
Prepare this device to receive an end-to-end encrypted file from another BRC device.
|
|
346
|
+
|
|
347
|
+
CROSS-DEVICE WORKFLOW:
|
|
348
|
+
1. Run prepare_file_transfer on the destination device.
|
|
349
|
+
2. Pass recipientPublicKey to send_file_transfer on the source device.
|
|
350
|
+
3. Pass the returned transferToken plus this receiveId to receive_file_transfer on this destination.
|
|
351
|
+
|
|
352
|
+
The private X25519 receive key stays only in this agent's memory and expires automatically.
|
|
353
|
+
The LLM/relay never receives the raw AES file-encryption key.
|
|
354
|
+
|
|
355
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
356
|
+
inputSchema: zodToJsonSchema(PrepareFileTransferArgsSchema),
|
|
357
|
+
annotations: {
|
|
358
|
+
title: "Prepare Encrypted File Receive",
|
|
359
|
+
readOnlyHint: false,
|
|
360
|
+
destructiveHint: false,
|
|
361
|
+
openWorldHint: false,
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
name: "send_file_transfer",
|
|
366
|
+
description: `
|
|
367
|
+
Encrypt a local file and upload only ciphertext to temporary storage for another BRC device.
|
|
368
|
+
|
|
369
|
+
SECURITY:
|
|
370
|
+
- Maximum plaintext size: 99 MB.
|
|
371
|
+
- Uses AES-256-GCM for the file.
|
|
372
|
+
- The AES key is wrapped for the destination's ephemeral X25519 public key.
|
|
373
|
+
- tmpfiles.org receives only a randomly named encrypted blob.
|
|
374
|
+
- The source file is never modified.
|
|
375
|
+
- The returned transferToken contains the download URL and wrapped key material, never the raw AES key.
|
|
376
|
+
|
|
377
|
+
Run prepare_file_transfer on the destination first and pass its recipientPublicKey here.
|
|
378
|
+
|
|
379
|
+
${PATH_GUIDANCE}
|
|
380
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
381
|
+
inputSchema: zodToJsonSchema(SendFileTransferArgsSchema),
|
|
382
|
+
annotations: {
|
|
383
|
+
title: "Send Encrypted File Transfer",
|
|
384
|
+
readOnlyHint: false,
|
|
385
|
+
destructiveHint: false,
|
|
386
|
+
openWorldHint: true,
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
name: "receive_file_transfer",
|
|
391
|
+
description: `
|
|
392
|
+
Download, authenticate, decrypt, and save a BRC encrypted file transfer on this device.
|
|
393
|
+
|
|
394
|
+
Requires receiveId from prepare_file_transfer on this same device and transferToken from
|
|
395
|
+
send_file_transfer on the source device. Data is downloaded only from tmpfiles.org.
|
|
396
|
+
AES-GCM authentication, expected size, and SHA-256 are verified before the destination
|
|
397
|
+
file is committed. Existing files are not replaced unless overwrite=true.
|
|
398
|
+
|
|
399
|
+
${PATH_GUIDANCE}
|
|
400
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
401
|
+
inputSchema: zodToJsonSchema(ReceiveFileTransferArgsSchema),
|
|
402
|
+
annotations: {
|
|
403
|
+
title: "Receive Encrypted File Transfer",
|
|
404
|
+
readOnlyHint: false,
|
|
405
|
+
destructiveHint: true,
|
|
406
|
+
openWorldHint: true,
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
name: "start_search",
|
|
411
|
+
description: `
|
|
412
|
+
Start a streaming search that can return results progressively.
|
|
413
|
+
|
|
414
|
+
BLOCKING MODE (recommended for most searches): set wait=true to get ALL results in this
|
|
415
|
+
single call, grep-style ("file" header, then "line: text", context lines as "line- text").
|
|
416
|
+
The search stops at maxResults matches (default 200) or timeout_ms (default 30000, max 110000).
|
|
417
|
+
No get_more_search_results/stop_search calls are needed in this mode.
|
|
418
|
+
|
|
419
|
+
SEARCH STRATEGY GUIDE:
|
|
420
|
+
Choose the right search type based on what the user is looking for:
|
|
421
|
+
|
|
422
|
+
USE searchType="files" WHEN:
|
|
423
|
+
- User asks for specific files: "find package.json", "locate config files"
|
|
424
|
+
- Pattern looks like a filename: "*.js", "README.md", "test-*.tsx"
|
|
425
|
+
- User wants to find files by name/extension: "all TypeScript files", "Python scripts"
|
|
426
|
+
- Looking for configuration/setup files: ".env", "dockerfile", "tsconfig.json"
|
|
427
|
+
|
|
428
|
+
USE searchType="content" WHEN:
|
|
429
|
+
- User asks about code/logic: "authentication logic", "error handling", "API calls"
|
|
430
|
+
- Looking for functions/variables: "getUserData function", "useState hook"
|
|
431
|
+
- Searching for text/comments: "TODO items", "FIXME comments", "documentation"
|
|
432
|
+
- Finding patterns in code: "console.log statements", "import statements"
|
|
433
|
+
- User describes functionality: "components that handle login", "files with database queries"
|
|
434
|
+
|
|
435
|
+
WHEN UNSURE OR USER REQUEST IS AMBIGUOUS:
|
|
436
|
+
Run TWO searches in parallel - one for files and one for content:
|
|
437
|
+
|
|
438
|
+
Example approach for ambiguous queries like "find authentication stuff":
|
|
439
|
+
1. Start file search: searchType="files", pattern="auth"
|
|
440
|
+
2. Simultaneously start content search: searchType="content", pattern="authentication"
|
|
441
|
+
3. Present combined results: "Found 3 auth-related files and 8 files containing authentication code"
|
|
442
|
+
|
|
443
|
+
SEARCH TYPES:
|
|
444
|
+
- searchType="files": Find files by name (pattern matches file names)
|
|
445
|
+
- searchType="content": Search inside files for text patterns
|
|
446
|
+
|
|
447
|
+
PATTERN MATCHING MODES:
|
|
448
|
+
- Default (literalSearch=false): Patterns are treated as regular expressions
|
|
449
|
+
- Literal (literalSearch=true): Patterns are treated as exact strings
|
|
450
|
+
|
|
451
|
+
WHEN TO USE literalSearch=true:
|
|
452
|
+
Use literal search when searching for code patterns with special characters:
|
|
453
|
+
- Function calls with parentheses and quotes
|
|
454
|
+
- Array access with brackets
|
|
455
|
+
- Object methods with dots and parentheses
|
|
456
|
+
- File paths with backslashes
|
|
457
|
+
- Any pattern containing: . * + ? ^ $ { } [ ] | \\ ( )
|
|
458
|
+
|
|
459
|
+
IMPORTANT PARAMETERS:
|
|
460
|
+
- pattern: What to search for (file names OR content text)
|
|
461
|
+
- literalSearch: Use exact string matching instead of regex (default: false)
|
|
462
|
+
- filePattern: Optional filter to limit search to specific file types (e.g., "*.js", "package.json")
|
|
463
|
+
- ignoreCase: Case-insensitive search (default: true). Works for both file names and content.
|
|
464
|
+
- earlyTermination: Stop search early when exact filename match is found (optional: defaults to true for file searches, false for content searches)
|
|
465
|
+
|
|
466
|
+
DECISION EXAMPLES:
|
|
467
|
+
- "find package.json" → searchType="files", pattern="package.json" (specific file)
|
|
468
|
+
- "find authentication components" → searchType="content", pattern="authentication" (looking for functionality)
|
|
469
|
+
- "locate all React components" → searchType="files", pattern="*.tsx" or "*.jsx" (file pattern)
|
|
470
|
+
- "find TODO comments" → searchType="content", pattern="TODO" (text in files)
|
|
471
|
+
- "show me login files" → AMBIGUOUS → run both: files with "login" AND content with "login"
|
|
472
|
+
- "find config" → AMBIGUOUS → run both: config files AND files containing config code
|
|
473
|
+
|
|
474
|
+
COMPREHENSIVE SEARCH EXAMPLES:
|
|
475
|
+
- Find package.json files: searchType="files", pattern="package.json"
|
|
476
|
+
- Find all JS files: searchType="files", pattern="*.js"
|
|
477
|
+
- Search for TODO in code: searchType="content", pattern="TODO", filePattern="*.js|*.ts"
|
|
478
|
+
- Search for exact code: searchType="content", pattern="toast.error('test')", literalSearch=true
|
|
479
|
+
- Ambiguous request "find auth stuff": Run two searches:
|
|
480
|
+
1. searchType="files", pattern="auth"
|
|
481
|
+
2. searchType="content", pattern="authentication"
|
|
482
|
+
|
|
483
|
+
PRO TIP: When user requests are ambiguous about whether they want files or content,
|
|
484
|
+
run both searches concurrently and combine results for comprehensive coverage.
|
|
485
|
+
|
|
486
|
+
Unlike regular search tools, this starts a background search process and returns
|
|
487
|
+
immediately with a session ID. Use get_more_search_results to get results as they
|
|
488
|
+
come in, and stop_search to stop the search early if needed.
|
|
489
|
+
|
|
490
|
+
Perfect for large directories where you want to see results immediately and
|
|
491
|
+
have the option to cancel if the search takes too long or you find what you need.
|
|
492
|
+
|
|
493
|
+
${PATH_GUIDANCE}
|
|
494
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
495
|
+
inputSchema: zodToJsonSchema(StartSearchArgsSchema),
|
|
496
|
+
annotations: {
|
|
497
|
+
title: "Start Search",
|
|
498
|
+
readOnlyHint: true,
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
name: "get_more_search_results",
|
|
503
|
+
description: `
|
|
504
|
+
Get more results from an active search with offset-based pagination.
|
|
505
|
+
|
|
506
|
+
Supports partial result reading with:
|
|
507
|
+
- 'offset' (start result index, default: 0)
|
|
508
|
+
* Positive: Start from result N (0-based indexing)
|
|
509
|
+
* Negative: Read last N results from end (tail behavior)
|
|
510
|
+
- 'length' (max results to read, default: 100)
|
|
511
|
+
* Used with positive offsets for range reading
|
|
512
|
+
* Ignored when offset is negative (reads all requested tail results)
|
|
513
|
+
|
|
514
|
+
Examples:
|
|
515
|
+
- offset: 0, length: 100 → First 100 results
|
|
516
|
+
- offset: 200, length: 50 → Results 200-249
|
|
517
|
+
- offset: -20 → Last 20 results
|
|
518
|
+
- offset: -5, length: 10 → Last 5 results (length ignored)
|
|
519
|
+
|
|
520
|
+
Returns only results in the specified range, along with search status.
|
|
521
|
+
Works like read_process_output - call this repeatedly to get progressive
|
|
522
|
+
results from a search started with start_search.
|
|
523
|
+
|
|
524
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
525
|
+
inputSchema: zodToJsonSchema(GetMoreSearchResultsArgsSchema),
|
|
526
|
+
annotations: {
|
|
527
|
+
title: "Get Search Results",
|
|
528
|
+
readOnlyHint: true,
|
|
529
|
+
},
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
name: "stop_search",
|
|
533
|
+
description: `
|
|
534
|
+
Stop an active search.
|
|
535
|
+
|
|
536
|
+
Stops the background search process gracefully. Use this when you've found
|
|
537
|
+
what you need or if a search is taking too long. Similar to force_terminate
|
|
538
|
+
for terminal processes.
|
|
539
|
+
|
|
540
|
+
The search will still be available for reading final results until it's
|
|
541
|
+
automatically cleaned up after 5 minutes.
|
|
542
|
+
|
|
543
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
544
|
+
inputSchema: zodToJsonSchema(StopSearchArgsSchema),
|
|
545
|
+
annotations: {
|
|
546
|
+
title: "Stop Search",
|
|
547
|
+
readOnlyHint: false,
|
|
548
|
+
destructiveHint: false,
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
name: "list_searches",
|
|
553
|
+
description: `
|
|
554
|
+
List all active searches.
|
|
555
|
+
|
|
556
|
+
Shows search IDs, search types, patterns, status, and runtime.
|
|
557
|
+
Similar to list_sessions for terminal processes. Useful for managing
|
|
558
|
+
multiple concurrent searches.
|
|
559
|
+
|
|
560
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
561
|
+
inputSchema: zodToJsonSchema(ListSearchesArgsSchema),
|
|
562
|
+
annotations: {
|
|
563
|
+
title: "List Active Searches",
|
|
564
|
+
readOnlyHint: true,
|
|
565
|
+
},
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
name: "get_file_info",
|
|
569
|
+
description: `
|
|
570
|
+
Retrieve detailed metadata about a file or directory including:
|
|
571
|
+
- size
|
|
572
|
+
- creation time
|
|
573
|
+
- last modified time
|
|
574
|
+
- permissions
|
|
575
|
+
- type
|
|
576
|
+
- lineCount (for text files)
|
|
577
|
+
- lastLine (zero-indexed number of last line, for text files)
|
|
578
|
+
- appendPosition (line number for appending, for text files)
|
|
579
|
+
- sheets (for Excel files - array of {name, rowCount, colCount})
|
|
580
|
+
|
|
581
|
+
Only works within allowed directories.
|
|
582
|
+
|
|
583
|
+
${PATH_GUIDANCE}
|
|
584
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
585
|
+
inputSchema: zodToJsonSchema(GetFileInfoArgsSchema),
|
|
586
|
+
annotations: {
|
|
587
|
+
title: "Get File Information",
|
|
588
|
+
readOnlyHint: true,
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
|
+
// Note: list_allowed_directories removed - use get_config to check allowedDirectories
|
|
592
|
+
// Editing tools
|
|
593
|
+
{
|
|
594
|
+
name: "edit_block",
|
|
595
|
+
description: `
|
|
596
|
+
Apply surgical edits to files.
|
|
597
|
+
|
|
598
|
+
BEST PRACTICE: Make multiple small, focused edits rather than one large edit.
|
|
599
|
+
Each edit_block call should change only what needs to be changed - include just enough
|
|
600
|
+
context to uniquely identify the text being modified.
|
|
601
|
+
|
|
602
|
+
FORMAT HANDLING (by extension):
|
|
603
|
+
|
|
604
|
+
EXCEL FILES (.xlsx, .xls, .xlsm) - Range Update mode:
|
|
605
|
+
Takes:
|
|
606
|
+
- file_path: Path to the Excel file
|
|
607
|
+
- range: ALWAYS use FROM:TO format - "SheetName!A1:C10" or "SheetName!C1:C1"
|
|
608
|
+
- content: 2D array, e.g., [["H1","H2"],["R1","R2"]]
|
|
609
|
+
|
|
610
|
+
TEXT FILES - Find/Replace mode:
|
|
611
|
+
Takes:
|
|
612
|
+
- file_path: Path to the file to edit
|
|
613
|
+
- old_string: Text to replace
|
|
614
|
+
- new_string: Replacement text
|
|
615
|
+
- expected_replacements: Optional number of replacements (default: 1)
|
|
616
|
+
|
|
617
|
+
DOCX FILES (.docx) - XML Find/Replace mode:
|
|
618
|
+
Takes same parameters as text files (old_string, new_string, expected_replacements).
|
|
619
|
+
Operates on the pretty-printed XML inside the DOCX — the same XML you see from
|
|
620
|
+
read_file with offset/length. Copy XML fragments from read output as old_string.
|
|
621
|
+
After editing, the XML is repacked into a valid DOCX.
|
|
622
|
+
Also searches headers/footers if not found in document body.
|
|
623
|
+
Examples:
|
|
624
|
+
- Replace text: old_string="<w:t>Old Text</w:t>" new_string="<w:t>New Text</w:t>"
|
|
625
|
+
- Change style: old_string='<w:pStyle w:val="Normal"/>' new_string='<w:pStyle w:val="Heading1"/>'
|
|
626
|
+
- Add content: include surrounding XML context in old_string, add new elements in new_string
|
|
627
|
+
|
|
628
|
+
By default, replaces only ONE occurrence of the search text.
|
|
629
|
+
To replace multiple occurrences, provide expected_replacements with
|
|
630
|
+
the exact number of matches expected.
|
|
631
|
+
|
|
632
|
+
UNIQUENESS REQUIREMENT: When expected_replacements=1 (default), include the minimal
|
|
633
|
+
amount of context necessary (typically 1-3 lines) before and after the change point,
|
|
634
|
+
with exact whitespace and indentation.
|
|
635
|
+
|
|
636
|
+
MULTI-EDIT (preferred for several changes in one file):
|
|
637
|
+
Pass edits: [{old_string, new_string, expected_replacements?}, ...] instead of
|
|
638
|
+
old_string/new_string. Edits apply in order (each sees the result of the previous one)
|
|
639
|
+
in ONE call. For text files it is all-or-nothing: if any edit fails to match, nothing
|
|
640
|
+
is written and the failing edit is reported.
|
|
641
|
+
|
|
642
|
+
When a close but non-exact match is found, a character-level diff is shown in the format:
|
|
643
|
+
common_prefix{-removed-}{+added+}common_suffix to help you identify what's different.
|
|
644
|
+
|
|
645
|
+
Similar to write_file, there is a configurable line limit (fileWriteLineLimit) that warns
|
|
646
|
+
if the edited file exceeds this limit. If this happens, consider breaking your edits into
|
|
647
|
+
smaller, more focused changes.
|
|
648
|
+
|
|
649
|
+
${PATH_GUIDANCE}
|
|
650
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
651
|
+
inputSchema: zodToJsonSchema(EditBlockArgsSchema),
|
|
652
|
+
annotations: {
|
|
653
|
+
title: "Edit Block",
|
|
654
|
+
readOnlyHint: false,
|
|
655
|
+
destructiveHint: true,
|
|
656
|
+
openWorldHint: false,
|
|
657
|
+
},
|
|
658
|
+
},
|
|
659
|
+
// Terminal tools
|
|
660
|
+
{
|
|
661
|
+
name: "start_process",
|
|
662
|
+
description: `
|
|
663
|
+
Start a new terminal process with intelligent state detection.
|
|
664
|
+
|
|
665
|
+
PRIMARY TOOL FOR FILE ANALYSIS AND DATA PROCESSING
|
|
666
|
+
This is the ONLY correct tool for analyzing local files (CSV, JSON, logs, etc.).
|
|
667
|
+
The analysis tool CANNOT access local files and WILL FAIL - always use processes for file-based work.
|
|
668
|
+
|
|
669
|
+
CRITICAL RULE: For ANY local file work, ALWAYS use this tool + interact_with_process, NEVER use analysis/REPL tool.
|
|
670
|
+
|
|
671
|
+
${OS_GUIDANCE}
|
|
672
|
+
|
|
673
|
+
REQUIRED WORKFLOW FOR LOCAL FILES:
|
|
674
|
+
1. start_process("python3 -i") - Start Python REPL for data analysis
|
|
675
|
+
2. interact_with_process(pid, "import pandas as pd, numpy as np")
|
|
676
|
+
3. interact_with_process(pid, "df = pd.read_csv('/absolute/path/file.csv')")
|
|
677
|
+
4. interact_with_process(pid, "print(df.describe())")
|
|
678
|
+
5. Continue analysis with pandas, matplotlib, seaborn, etc.
|
|
679
|
+
|
|
680
|
+
COMMON FILE ANALYSIS PATTERNS:
|
|
681
|
+
• start_process("python3 -i") → Python REPL for data analysis (RECOMMENDED)
|
|
682
|
+
• start_process("node -i") → Node.js REPL for JSON processing
|
|
683
|
+
• start_process("node:local") → Node.js on MCP server (stateless, ES imports, all code in one call)
|
|
684
|
+
• start_process("cut -d',' -f1 file.csv | sort | uniq -c") → Quick CSV analysis
|
|
685
|
+
• start_process("wc -l /path/file.csv") → Line counting
|
|
686
|
+
• start_process("head -10 /path/file.csv") → File preview
|
|
687
|
+
|
|
688
|
+
BINARY FILE SUPPORT:
|
|
689
|
+
For PDF, Excel, Word, archives, databases, and other binary formats, use process tools with appropriate libraries or command-line utilities.
|
|
690
|
+
|
|
691
|
+
INTERACTIVE PROCESSES FOR DATA ANALYSIS:
|
|
692
|
+
For code/calculations, use in this priority order:
|
|
693
|
+
1. start_process("python3 -i") - Python REPL (preferred)
|
|
694
|
+
2. start_process("node -i") - Node.js REPL (when Python unavailable)
|
|
695
|
+
3. start_process("node:local") - Node.js fallback (when node -i fails)
|
|
696
|
+
4. Use interact_with_process() to send commands
|
|
697
|
+
5. Use read_process_output() to get responses
|
|
698
|
+
When Python is unavailable, prefer Node.js over shell for calculations.
|
|
699
|
+
Node.js: Always use ES import syntax (import x from 'y'), not require().
|
|
700
|
+
|
|
701
|
+
SMART DETECTION:
|
|
702
|
+
- Detects REPL prompts (>>>, >, $, etc.)
|
|
703
|
+
- Identifies when process is waiting for input
|
|
704
|
+
- Recognizes process completion vs timeout
|
|
705
|
+
- Early exit prevents unnecessary waiting
|
|
706
|
+
|
|
707
|
+
STATES DETECTED:
|
|
708
|
+
Process waiting for input (shows prompt)
|
|
709
|
+
Process finished execution
|
|
710
|
+
Process running (use read_process_output)
|
|
711
|
+
|
|
712
|
+
PERFORMANCE DEBUGGING (verbose_timing parameter):
|
|
713
|
+
Set verbose_timing: true to get detailed timing information including:
|
|
714
|
+
- Exit reason (early_exit_quick_pattern, early_exit_periodic_check, process_exit, timeout)
|
|
715
|
+
- Total duration and time to first output
|
|
716
|
+
- Complete timeline of all output events with timestamps
|
|
717
|
+
- Which detection mechanism triggered early exit
|
|
718
|
+
Use this to identify missed optimization opportunities and improve detection patterns.
|
|
719
|
+
|
|
720
|
+
ALWAYS USE FOR: Local file analysis, CSV processing, data exploration, system commands
|
|
721
|
+
NEVER USE ANALYSIS TOOL FOR: Local file access (analysis tool is browser-only and WILL FAIL)
|
|
722
|
+
|
|
723
|
+
${PATH_GUIDANCE}
|
|
724
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
725
|
+
inputSchema: zodToJsonSchema(StartProcessArgsSchema),
|
|
726
|
+
annotations: {
|
|
727
|
+
title: "Start Terminal Process",
|
|
728
|
+
readOnlyHint: false,
|
|
729
|
+
destructiveHint: true,
|
|
730
|
+
openWorldHint: true,
|
|
731
|
+
},
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
name: "read_process_output",
|
|
735
|
+
description: `
|
|
736
|
+
Read output from a running process with file-like pagination support.
|
|
737
|
+
|
|
738
|
+
Supports partial output reading with offset and length parameters (like read_file):
|
|
739
|
+
- 'offset' (start line, default: 0)
|
|
740
|
+
* offset=0: Read NEW output since last read (default, like old behavior)
|
|
741
|
+
* Positive: Read from absolute line position
|
|
742
|
+
* Negative: Read last N lines from end (tail behavior)
|
|
743
|
+
- 'length' (max lines to read, default: configurable via 'fileReadLineLimit' setting)
|
|
744
|
+
|
|
745
|
+
Examples:
|
|
746
|
+
- offset: 0, length: 100 → First 100 NEW lines since last read
|
|
747
|
+
- offset: 0 → All new lines (respects config limit)
|
|
748
|
+
- offset: 500, length: 50 → Lines 500-549 (absolute position)
|
|
749
|
+
- offset: -20 → Last 20 lines (tail)
|
|
750
|
+
- offset: -50, length: 10 → Start 50 from end, read 10 lines
|
|
751
|
+
|
|
752
|
+
OUTPUT PROTECTION:
|
|
753
|
+
- Uses same fileReadLineLimit as read_file (default: 1000 lines)
|
|
754
|
+
- Returns status like: [Reading 100 lines from line 0 (total: 5000 lines, 4900 remaining)]
|
|
755
|
+
- Prevents context overflow from verbose processes
|
|
756
|
+
|
|
757
|
+
SMART FEATURES:
|
|
758
|
+
- For offset=0, waits up to timeout_ms for new output to arrive
|
|
759
|
+
- Detects REPL prompts and process completion
|
|
760
|
+
- Shows process state (waiting for input, finished, etc.)
|
|
761
|
+
|
|
762
|
+
DETECTION STATES:
|
|
763
|
+
Process waiting for input (ready for interact_with_process)
|
|
764
|
+
Process finished execution
|
|
765
|
+
Timeout reached (may still be running)
|
|
766
|
+
|
|
767
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
768
|
+
inputSchema: zodToJsonSchema(ReadProcessOutputArgsSchema),
|
|
769
|
+
annotations: {
|
|
770
|
+
title: "Read Process Output",
|
|
771
|
+
readOnlyHint: true,
|
|
772
|
+
},
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
name: "interact_with_process",
|
|
776
|
+
description: `
|
|
777
|
+
Send input to a running process and automatically receive the response.
|
|
778
|
+
|
|
779
|
+
CRITICAL: THIS IS THE PRIMARY TOOL FOR ALL LOCAL FILE ANALYSIS
|
|
780
|
+
For ANY local file analysis (CSV, JSON, data processing), ALWAYS use this instead of the analysis tool.
|
|
781
|
+
The analysis tool CANNOT access local files and WILL FAIL - use processes for ALL file-based work.
|
|
782
|
+
|
|
783
|
+
FILE ANALYSIS PRIORITY ORDER (MANDATORY):
|
|
784
|
+
1. ALWAYS FIRST: Use this tool (start_process + interact_with_process) for local data analysis
|
|
785
|
+
2. ALTERNATIVE: Use command-line tools (cut, awk, grep) for quick processing
|
|
786
|
+
3. NEVER EVER: Use analysis tool for local file access (IT WILL FAIL)
|
|
787
|
+
|
|
788
|
+
REQUIRED INTERACTIVE WORKFLOW FOR FILE ANALYSIS:
|
|
789
|
+
1. Start REPL: start_process("python3 -i")
|
|
790
|
+
2. Load libraries: interact_with_process(pid, "import pandas as pd, numpy as np")
|
|
791
|
+
3. Read file: interact_with_process(pid, "df = pd.read_csv('/absolute/path/file.csv')")
|
|
792
|
+
4. Analyze: interact_with_process(pid, "print(df.describe())")
|
|
793
|
+
5. Continue: interact_with_process(pid, "df.groupby('column').size()")
|
|
794
|
+
|
|
795
|
+
BINARY FILE PROCESSING WORKFLOWS:
|
|
796
|
+
Use appropriate Python libraries (PyPDF2, pandas, docx2txt, etc.) or command-line tools for binary file analysis.
|
|
797
|
+
|
|
798
|
+
SMART DETECTION:
|
|
799
|
+
- Automatically waits for REPL prompt (>>>, >, etc.)
|
|
800
|
+
- Detects errors and completion states
|
|
801
|
+
- Early exit prevents timeout delays
|
|
802
|
+
- Clean output formatting (removes prompts)
|
|
803
|
+
|
|
804
|
+
SUPPORTED REPLs:
|
|
805
|
+
- Python: python3 -i (RECOMMENDED for data analysis)
|
|
806
|
+
- Node.js: node -i
|
|
807
|
+
- R: R
|
|
808
|
+
- Julia: julia
|
|
809
|
+
- Shell: bash, zsh
|
|
810
|
+
- Database: mysql, postgres
|
|
811
|
+
|
|
812
|
+
PARAMETERS:
|
|
813
|
+
- pid: Process ID from start_process
|
|
814
|
+
- input: Code/command to execute
|
|
815
|
+
- timeout_ms: Max wait (default: 8000ms)
|
|
816
|
+
- wait_for_prompt: Auto-wait for response (default: true)
|
|
817
|
+
- verbose_timing: Enable detailed performance telemetry (default: false)
|
|
818
|
+
|
|
819
|
+
Returns execution result with status indicators.
|
|
820
|
+
|
|
821
|
+
PERFORMANCE DEBUGGING (verbose_timing parameter):
|
|
822
|
+
Set verbose_timing: true to get detailed timing information including:
|
|
823
|
+
- Exit reason (early_exit_quick_pattern, early_exit_periodic_check, process_finished, timeout, no_wait)
|
|
824
|
+
- Total duration and time to first output
|
|
825
|
+
- Complete timeline of all output events with timestamps
|
|
826
|
+
- Which detection mechanism triggered early exit
|
|
827
|
+
Use this to identify slow interactions and optimize detection patterns.
|
|
828
|
+
|
|
829
|
+
ALWAYS USE FOR: CSV analysis, JSON processing, file statistics, data visualization prep, ANY local file work
|
|
830
|
+
NEVER USE ANALYSIS TOOL FOR: Local file access (it cannot read files from disk and WILL FAIL)
|
|
831
|
+
|
|
832
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
833
|
+
inputSchema: zodToJsonSchema(InteractWithProcessArgsSchema),
|
|
834
|
+
annotations: {
|
|
835
|
+
title: "Send Input to Process",
|
|
836
|
+
readOnlyHint: false,
|
|
837
|
+
destructiveHint: true,
|
|
838
|
+
openWorldHint: true,
|
|
839
|
+
},
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
name: "force_terminate",
|
|
843
|
+
description: `
|
|
844
|
+
Force terminate a running terminal session.
|
|
845
|
+
|
|
846
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
847
|
+
inputSchema: zodToJsonSchema(ForceTerminateArgsSchema),
|
|
848
|
+
annotations: {
|
|
849
|
+
title: "Force Terminate Process",
|
|
850
|
+
readOnlyHint: false,
|
|
851
|
+
destructiveHint: true,
|
|
852
|
+
openWorldHint: false,
|
|
853
|
+
},
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
name: "list_sessions",
|
|
857
|
+
description: `
|
|
858
|
+
List all active terminal sessions.
|
|
859
|
+
|
|
860
|
+
Shows session status including:
|
|
861
|
+
- PID: Process identifier
|
|
862
|
+
- Blocked: Whether session is waiting for input
|
|
863
|
+
- Runtime: How long the session has been running
|
|
864
|
+
|
|
865
|
+
DEBUGGING REPLs:
|
|
866
|
+
- "Blocked: true" often means REPL is waiting for input
|
|
867
|
+
- Use this to verify sessions are running before sending input
|
|
868
|
+
- Long runtime with blocked status may indicate stuck process
|
|
869
|
+
|
|
870
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
871
|
+
inputSchema: zodToJsonSchema(ListSessionsArgsSchema),
|
|
872
|
+
annotations: {
|
|
873
|
+
title: "List Terminal Sessions",
|
|
874
|
+
readOnlyHint: true,
|
|
875
|
+
},
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
name: "list_processes",
|
|
879
|
+
description: `
|
|
880
|
+
List all running processes.
|
|
881
|
+
|
|
882
|
+
Returns process information including PID, command name, CPU usage, and memory usage.
|
|
883
|
+
|
|
884
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
885
|
+
inputSchema: zodToJsonSchema(ListProcessesArgsSchema),
|
|
886
|
+
annotations: {
|
|
887
|
+
title: "List Running Processes",
|
|
888
|
+
readOnlyHint: true,
|
|
889
|
+
},
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
name: "kill_process",
|
|
893
|
+
description: `
|
|
894
|
+
Terminate a running process by PID.
|
|
895
|
+
|
|
896
|
+
Use with caution as this will forcefully terminate the specified process.
|
|
897
|
+
|
|
898
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
899
|
+
inputSchema: zodToJsonSchema(KillProcessArgsSchema),
|
|
900
|
+
annotations: {
|
|
901
|
+
title: "Kill Process",
|
|
902
|
+
readOnlyHint: false,
|
|
903
|
+
destructiveHint: true,
|
|
904
|
+
openWorldHint: false,
|
|
905
|
+
},
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
name: "get_usage_stats",
|
|
909
|
+
description: `
|
|
910
|
+
Get usage statistics for debugging and analysis.
|
|
911
|
+
|
|
912
|
+
Returns summary of tool usage, success/failure rates, and performance metrics.
|
|
913
|
+
|
|
914
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
915
|
+
inputSchema: zodToJsonSchema(GetUsageStatsArgsSchema),
|
|
916
|
+
annotations: {
|
|
917
|
+
title: "Get Usage Statistics",
|
|
918
|
+
readOnlyHint: true,
|
|
919
|
+
},
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
name: "get_recent_tool_calls",
|
|
923
|
+
description: `
|
|
924
|
+
Get recent local tool call history with arguments and outputs.
|
|
925
|
+
Returns a chronological list of recent calls loaded from the local history file.
|
|
926
|
+
|
|
927
|
+
Useful for:
|
|
928
|
+
- Onboarding new chats about work already done
|
|
929
|
+
- Recovering context after chat history loss
|
|
930
|
+
- Debugging tool call sequences
|
|
931
|
+
|
|
932
|
+
Note: Does not track its own calls or track_ui_event.
|
|
933
|
+
History is persisted locally in tool-history.jsonl, keeps up to the last 1000
|
|
934
|
+
calls in memory, and trims older on-disk history. Stored outputs over 4 KiB
|
|
935
|
+
are replaced with an omission marker.
|
|
936
|
+
|
|
937
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
938
|
+
inputSchema: zodToJsonSchema(GetRecentToolCallsArgsSchema),
|
|
939
|
+
annotations: {
|
|
940
|
+
title: "Get Recent Tool Calls",
|
|
941
|
+
readOnlyHint: true,
|
|
942
|
+
},
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
name: "give_feedback_to_desktop_commander",
|
|
946
|
+
description: `
|
|
947
|
+
Open feedback form in browser to provide feedback about Desktop Commander.
|
|
948
|
+
|
|
949
|
+
IMPORTANT: This tool simply opens the feedback form - no pre-filling available.
|
|
950
|
+
The user will fill out the form manually in their browser.
|
|
951
|
+
|
|
952
|
+
WORKFLOW:
|
|
953
|
+
1. When user agrees to give feedback, just call this tool immediately
|
|
954
|
+
2. No need to ask questions or collect information
|
|
955
|
+
3. Tool opens form with only usage statistics pre-filled automatically:
|
|
956
|
+
- tool_call_count: Number of commands they've made
|
|
957
|
+
- days_using: How many days they've used Desktop Commander
|
|
958
|
+
- platform: Their operating system (Mac/Windows/Linux)
|
|
959
|
+
- client_id: Analytics identifier
|
|
960
|
+
|
|
961
|
+
All survey questions will be answered directly in the form:
|
|
962
|
+
- Job title and technical comfort level
|
|
963
|
+
- Company URL for industry context
|
|
964
|
+
- Other AI tools they use
|
|
965
|
+
- Desktop Commander's biggest advantage
|
|
966
|
+
- How they typically use it
|
|
967
|
+
- Recommendation likelihood (0-10)
|
|
968
|
+
- User study participation interest
|
|
969
|
+
- Email and any additional feedback
|
|
970
|
+
|
|
971
|
+
EXAMPLE INTERACTION:
|
|
972
|
+
User: "sure, I'll give feedback"
|
|
973
|
+
Claude: "Perfect! Let me open the feedback form for you."
|
|
974
|
+
[calls tool immediately]
|
|
975
|
+
|
|
976
|
+
No parameters are needed - just call the tool to open the form.
|
|
977
|
+
|
|
978
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
979
|
+
inputSchema: zodToJsonSchema(GiveFeedbackArgsSchema),
|
|
980
|
+
annotations: {
|
|
981
|
+
title: "Give Feedback",
|
|
982
|
+
readOnlyHint: false,
|
|
983
|
+
openWorldHint: true,
|
|
984
|
+
},
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
name: "get_prompts",
|
|
988
|
+
description: `
|
|
989
|
+
Retrieve a specific Desktop Commander onboarding prompt by ID and execute it.
|
|
990
|
+
|
|
991
|
+
SIMPLIFIED ONBOARDING V2: This tool only supports direct prompt retrieval.
|
|
992
|
+
The onboarding system presents 5 options as a simple numbered list:
|
|
993
|
+
|
|
994
|
+
1. Organize my Downloads folder (promptId: 'onb2_01')
|
|
995
|
+
2. Explain a codebase or repository (promptId: 'onb2_02')
|
|
996
|
+
3. Create organized knowledge base (promptId: 'onb2_03')
|
|
997
|
+
4. Analyze a data file (promptId: 'onb2_04')
|
|
998
|
+
5. Check system health and resources (promptId: 'onb2_05')
|
|
999
|
+
|
|
1000
|
+
USAGE:
|
|
1001
|
+
When user says "1", "2", "3", "4", or "5" from onboarding:
|
|
1002
|
+
- "1" → get_prompts(action='get_prompt', promptId='onb2_01')
|
|
1003
|
+
- "2" → get_prompts(action='get_prompt', promptId='onb2_02')
|
|
1004
|
+
- "3" → get_prompts(action='get_prompt', promptId='onb2_03')
|
|
1005
|
+
- "4" → get_prompts(action='get_prompt', promptId='onb2_04')
|
|
1006
|
+
- "5" → get_prompts(action='get_prompt', promptId='onb2_05')
|
|
1007
|
+
|
|
1008
|
+
The prompt content will be injected and execution begins immediately.
|
|
1009
|
+
|
|
1010
|
+
${CMD_PREFIX_DESCRIPTION}`,
|
|
1011
|
+
inputSchema: zodToJsonSchema(GetPromptsArgsSchema),
|
|
1012
|
+
annotations: {
|
|
1013
|
+
title: "Get Prompts",
|
|
1014
|
+
readOnlyHint: true,
|
|
1015
|
+
},
|
|
1016
|
+
}
|
|
1017
|
+
];
|
|
1018
|
+
return allTools.filter(t => !EXCLUDED_TOOLS.has(t.name));
|
|
1019
|
+
}
|
|
1020
|
+
//# sourceMappingURL=tool-definitions.js.map
|