strands-darwin 0.0.3
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/README.md +140 -0
- package/README.zh-CN.md +140 -0
- package/dist/patches/@strands-agents+sdk+1.16.0.patch +1443 -0
- package/dist/src/agent/background-delegation.d.ts +67 -0
- package/dist/src/agent/background-delegation.js +159 -0
- package/dist/src/agent/background-delegation.js.map +1 -0
- package/dist/src/agent/call-stats.d.ts +118 -0
- package/dist/src/agent/call-stats.js +128 -0
- package/dist/src/agent/call-stats.js.map +1 -0
- package/dist/src/agent/compact.d.ts +108 -0
- package/dist/src/agent/compact.js +192 -0
- package/dist/src/agent/compact.js.map +1 -0
- package/dist/src/agent/context-anchor.d.ts +64 -0
- package/dist/src/agent/context-anchor.js +43 -0
- package/dist/src/agent/context-anchor.js.map +1 -0
- package/dist/src/agent/cost.d.ts +56 -0
- package/dist/src/agent/cost.js +44 -0
- package/dist/src/agent/cost.js.map +1 -0
- package/dist/src/agent/diagnostics.d.ts +212 -0
- package/dist/src/agent/diagnostics.js +374 -0
- package/dist/src/agent/diagnostics.js.map +1 -0
- package/dist/src/agent/instructions.d.ts +54 -0
- package/dist/src/agent/instructions.js +118 -0
- package/dist/src/agent/instructions.js.map +1 -0
- package/dist/src/agent/max-tokens-recovery.d.ts +17 -0
- package/dist/src/agent/max-tokens-recovery.js +65 -0
- package/dist/src/agent/max-tokens-recovery.js.map +1 -0
- package/dist/src/agent/model-call-budget.d.ts +8 -0
- package/dist/src/agent/model-call-budget.js +24 -0
- package/dist/src/agent/model-call-budget.js.map +1 -0
- package/dist/src/agent/model-retry.d.ts +134 -0
- package/dist/src/agent/model-retry.js +256 -0
- package/dist/src/agent/model-retry.js.map +1 -0
- package/dist/src/agent/permission-rules.d.ts +47 -0
- package/dist/src/agent/permission-rules.js +260 -0
- package/dist/src/agent/permission-rules.js.map +1 -0
- package/dist/src/agent/permission.d.ts +361 -0
- package/dist/src/agent/permission.js +797 -0
- package/dist/src/agent/permission.js.map +1 -0
- package/dist/src/agent/prompt-cache.d.ts +66 -0
- package/dist/src/agent/prompt-cache.js +194 -0
- package/dist/src/agent/prompt-cache.js.map +1 -0
- package/dist/src/agent/refusal.d.ts +20 -0
- package/dist/src/agent/refusal.js +23 -0
- package/dist/src/agent/refusal.js.map +1 -0
- package/dist/src/agent/retry-guard.d.ts +26 -0
- package/dist/src/agent/retry-guard.js +193 -0
- package/dist/src/agent/retry-guard.js.map +1 -0
- package/dist/src/agent/rewind.d.ts +29 -0
- package/dist/src/agent/rewind.js +118 -0
- package/dist/src/agent/rewind.js.map +1 -0
- package/dist/src/agent/runtime.d.ts +814 -0
- package/dist/src/agent/runtime.js +1596 -0
- package/dist/src/agent/runtime.js.map +1 -0
- package/dist/src/agent/safety-classifier.d.ts +11 -0
- package/dist/src/agent/safety-classifier.js +0 -0
- package/dist/src/agent/safety-classifier.js.map +1 -0
- package/dist/src/agent/sdk-logging.d.ts +49 -0
- package/dist/src/agent/sdk-logging.js +110 -0
- package/dist/src/agent/sdk-logging.js.map +1 -0
- package/dist/src/agent/session.d.ts +102 -0
- package/dist/src/agent/session.js +244 -0
- package/dist/src/agent/session.js.map +1 -0
- package/dist/src/agent/stream-resumption.d.ts +16 -0
- package/dist/src/agent/stream-resumption.js +33 -0
- package/dist/src/agent/stream-resumption.js.map +1 -0
- package/dist/src/agent/system-prompt.d.ts +50 -0
- package/dist/src/agent/system-prompt.js +161 -0
- package/dist/src/agent/system-prompt.js.map +1 -0
- package/dist/src/agent/thinking.d.ts +99 -0
- package/dist/src/agent/thinking.js +145 -0
- package/dist/src/agent/thinking.js.map +1 -0
- package/dist/src/agent/usage.d.ts +132 -0
- package/dist/src/agent/usage.js +233 -0
- package/dist/src/agent/usage.js.map +1 -0
- package/dist/src/agent/working-context.d.ts +51 -0
- package/dist/src/agent/working-context.js +160 -0
- package/dist/src/agent/working-context.js.map +1 -0
- package/dist/src/agents/child-recipe.d.ts +33 -0
- package/dist/src/agents/child-recipe.js +98 -0
- package/dist/src/agents/child-recipe.js.map +1 -0
- package/dist/src/agents/concurrency-limit.d.ts +25 -0
- package/dist/src/agents/concurrency-limit.js +43 -0
- package/dist/src/agents/concurrency-limit.js.map +1 -0
- package/dist/src/agents/dispatch-registry.d.ts +180 -0
- package/dist/src/agents/dispatch-registry.js +289 -0
- package/dist/src/agents/dispatch-registry.js.map +1 -0
- package/dist/src/agents/failed-child-text.d.ts +44 -0
- package/dist/src/agents/failed-child-text.js +69 -0
- package/dist/src/agents/failed-child-text.js.map +1 -0
- package/dist/src/agents/loader.d.ts +26 -0
- package/dist/src/agents/loader.js +134 -0
- package/dist/src/agents/loader.js.map +1 -0
- package/dist/src/agents/report-projection.d.ts +31 -0
- package/dist/src/agents/report-projection.js +125 -0
- package/dist/src/agents/report-projection.js.map +1 -0
- package/dist/src/agents/subagent-tool.d.ts +61 -0
- package/dist/src/agents/subagent-tool.js +180 -0
- package/dist/src/agents/subagent-tool.js.map +1 -0
- package/dist/src/agents/workflow-tool.d.ts +85 -0
- package/dist/src/agents/workflow-tool.js +530 -0
- package/dist/src/agents/workflow-tool.js.map +1 -0
- package/dist/src/cli-args.d.ts +39 -0
- package/dist/src/cli-args.js +198 -0
- package/dist/src/cli-args.js.map +1 -0
- package/dist/src/cli-doctor.d.ts +26 -0
- package/dist/src/cli-doctor.js +398 -0
- package/dist/src/cli-doctor.js.map +1 -0
- package/dist/src/cli-main.d.ts +1 -0
- package/dist/src/cli-main.js +279 -0
- package/dist/src/cli-main.js.map +1 -0
- package/dist/src/cli-sessions.d.ts +17 -0
- package/dist/src/cli-sessions.js +136 -0
- package/dist/src/cli-sessions.js.map +1 -0
- package/dist/src/cli-trajectory.d.ts +37 -0
- package/dist/src/cli-trajectory.js +303 -0
- package/dist/src/cli-trajectory.js.map +1 -0
- package/dist/src/cli-usage.d.ts +18 -0
- package/dist/src/cli-usage.js +53 -0
- package/dist/src/cli-usage.js.map +1 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +29 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/commands/custom-commands.d.ts +43 -0
- package/dist/src/commands/custom-commands.js +155 -0
- package/dist/src/commands/custom-commands.js.map +1 -0
- package/dist/src/commands/workflow-command.d.ts +26 -0
- package/dist/src/commands/workflow-command.js +56 -0
- package/dist/src/commands/workflow-command.js.map +1 -0
- package/dist/src/config.d.ts +463 -0
- package/dist/src/config.js +1457 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/context-overflow-error.d.ts +7 -0
- package/dist/src/context-overflow-error.js +26 -0
- package/dist/src/context-overflow-error.js.map +1 -0
- package/dist/src/dev-repl.d.ts +1 -0
- package/dist/src/dev-repl.js +365 -0
- package/dist/src/dev-repl.js.map +1 -0
- package/dist/src/headless-protocol.d.ts +147 -0
- package/dist/src/headless-protocol.js +359 -0
- package/dist/src/headless-protocol.js.map +1 -0
- package/dist/src/headless-runner.d.ts +30 -0
- package/dist/src/headless-runner.js +405 -0
- package/dist/src/headless-runner.js.map +1 -0
- package/dist/src/headless-stdin.d.ts +28 -0
- package/dist/src/headless-stdin.js +78 -0
- package/dist/src/headless-stdin.js.map +1 -0
- package/dist/src/headless.d.ts +106 -0
- package/dist/src/headless.js +229 -0
- package/dist/src/headless.js.map +1 -0
- package/dist/src/hooks/codex-hook-runner.d.ts +92 -0
- package/dist/src/hooks/codex-hook-runner.js +446 -0
- package/dist/src/hooks/codex-hook-runner.js.map +1 -0
- package/dist/src/hooks/codex-hooks.d.ts +23 -0
- package/dist/src/hooks/codex-hooks.js +152 -0
- package/dist/src/hooks/codex-hooks.js.map +1 -0
- package/dist/src/hooks/hook-process.d.ts +23 -0
- package/dist/src/hooks/hook-process.js +241 -0
- package/dist/src/hooks/hook-process.js.map +1 -0
- package/dist/src/hooks/lifecycle-hooks.d.ts +37 -0
- package/dist/src/hooks/lifecycle-hooks.js +153 -0
- package/dist/src/hooks/lifecycle-hooks.js.map +1 -0
- package/dist/src/hooks/tool-hooks.d.ts +63 -0
- package/dist/src/hooks/tool-hooks.js +350 -0
- package/dist/src/hooks/tool-hooks.js.map +1 -0
- package/dist/src/mcp/codegraph-preflight.d.ts +29 -0
- package/dist/src/mcp/codegraph-preflight.js +232 -0
- package/dist/src/mcp/codegraph-preflight.js.map +1 -0
- package/dist/src/mcp/registry.d.ts +133 -0
- package/dist/src/mcp/registry.js +209 -0
- package/dist/src/mcp/registry.js.map +1 -0
- package/dist/src/mcp/web-search-empty-results.d.ts +14 -0
- package/dist/src/mcp/web-search-empty-results.js +94 -0
- package/dist/src/mcp/web-search-empty-results.js.map +1 -0
- package/dist/src/memory/command.d.ts +11 -0
- package/dist/src/memory/command.js +253 -0
- package/dist/src/memory/command.js.map +1 -0
- package/dist/src/memory/controller.d.ts +51 -0
- package/dist/src/memory/controller.js +316 -0
- package/dist/src/memory/controller.js.map +1 -0
- package/dist/src/memory/prompt.d.ts +4 -0
- package/dist/src/memory/prompt.js +22 -0
- package/dist/src/memory/prompt.js.map +1 -0
- package/dist/src/memory/scheduler.d.ts +33 -0
- package/dist/src/memory/scheduler.js +134 -0
- package/dist/src/memory/scheduler.js.map +1 -0
- package/dist/src/memory/state.d.ts +112 -0
- package/dist/src/memory/state.js +355 -0
- package/dist/src/memory/state.js.map +1 -0
- package/dist/src/memory/store.d.ts +19 -0
- package/dist/src/memory/store.js +130 -0
- package/dist/src/memory/store.js.map +1 -0
- package/dist/src/memory/tools.d.ts +29 -0
- package/dist/src/memory/tools.js +22 -0
- package/dist/src/memory/tools.js.map +1 -0
- package/dist/src/memory/validation.d.ts +33 -0
- package/dist/src/memory/validation.js +159 -0
- package/dist/src/memory/validation.js.map +1 -0
- package/dist/src/npm-package/generate-patch.d.ts +23 -0
- package/dist/src/npm-package/generate-patch.js +88 -0
- package/dist/src/npm-package/generate-patch.js.map +1 -0
- package/dist/src/npm-package/patch-package-format.d.ts +43 -0
- package/dist/src/npm-package/patch-package-format.js +66 -0
- package/dist/src/npm-package/patch-package-format.js.map +1 -0
- package/dist/src/paths.d.ts +39 -0
- package/dist/src/paths.js +105 -0
- package/dist/src/paths.js.map +1 -0
- package/dist/src/pricing/cost.d.ts +182 -0
- package/dist/src/pricing/cost.js +215 -0
- package/dist/src/pricing/cost.js.map +1 -0
- package/dist/src/pricing/model-prices.d.ts +112 -0
- package/dist/src/pricing/model-prices.js +320 -0
- package/dist/src/pricing/model-prices.js.map +1 -0
- package/dist/src/sdk-patch-preflight.d.ts +23 -0
- package/dist/src/sdk-patch-preflight.js +71 -0
- package/dist/src/sdk-patch-preflight.js.map +1 -0
- package/dist/src/skills/builtin/commit-message/SKILL.md +45 -0
- package/dist/src/skills/builtin/commit-message/references/types.md +8 -0
- package/dist/src/skills/builtin/developer/SKILL.md +107 -0
- package/dist/src/skills/builtin/self-evolution-research/SKILL.md +150 -0
- package/dist/src/skills/builtin/self-evolution-research/scripts/roll-research-path.mjs +208 -0
- package/dist/src/skills/builtin/self-reflection/SKILL.md +172 -0
- package/dist/src/skills/builtin/self-reflection/references/reflection-template.md +90 -0
- package/dist/src/skills/builtin/self-reflection/scripts/locate-trajectory.mjs +175 -0
- package/dist/src/skills/loader.d.ts +26 -0
- package/dist/src/skills/loader.js +186 -0
- package/dist/src/skills/loader.js.map +1 -0
- package/dist/src/skills/plugin.d.ts +34 -0
- package/dist/src/skills/plugin.js +137 -0
- package/dist/src/skills/plugin.js.map +1 -0
- package/dist/src/skills/prompt.d.ts +8 -0
- package/dist/src/skills/prompt.js +214 -0
- package/dist/src/skills/prompt.js.map +1 -0
- package/dist/src/skills/resource-safety.d.ts +15 -0
- package/dist/src/skills/resource-safety.js +149 -0
- package/dist/src/skills/resource-safety.js.map +1 -0
- package/dist/src/tools/background-bash.d.ts +95 -0
- package/dist/src/tools/background-bash.js +639 -0
- package/dist/src/tools/background-bash.js.map +1 -0
- package/dist/src/tools/background-tail.d.ts +28 -0
- package/dist/src/tools/background-tail.js +75 -0
- package/dist/src/tools/background-tail.js.map +1 -0
- package/dist/src/tools/background-wait-contract.d.ts +4 -0
- package/dist/src/tools/background-wait-contract.js +7 -0
- package/dist/src/tools/background-wait-contract.js.map +1 -0
- package/dist/src/tools/file-editor-serial.d.ts +24 -0
- package/dist/src/tools/file-editor-serial.js +99 -0
- package/dist/src/tools/file-editor-serial.js.map +1 -0
- package/dist/src/tools/image-viewer.d.ts +43 -0
- package/dist/src/tools/image-viewer.js +256 -0
- package/dist/src/tools/image-viewer.js.map +1 -0
- package/dist/src/tools/update-plan.d.ts +30 -0
- package/dist/src/tools/update-plan.js +65 -0
- package/dist/src/tools/update-plan.js.map +1 -0
- package/dist/src/tools/web-fetch.d.ts +70 -0
- package/dist/src/tools/web-fetch.js +667 -0
- package/dist/src/tools/web-fetch.js.map +1 -0
- package/dist/src/trajectory/export.d.ts +31 -0
- package/dist/src/trajectory/export.js +116 -0
- package/dist/src/trajectory/export.js.map +1 -0
- package/dist/src/trajectory/fork.d.ts +19 -0
- package/dist/src/trajectory/fork.js +110 -0
- package/dist/src/trajectory/fork.js.map +1 -0
- package/dist/src/trajectory/memory-tool.d.ts +20 -0
- package/dist/src/trajectory/memory-tool.js +98 -0
- package/dist/src/trajectory/memory-tool.js.map +1 -0
- package/dist/src/trajectory/prompt-history.d.ts +62 -0
- package/dist/src/trajectory/prompt-history.js +256 -0
- package/dist/src/trajectory/prompt-history.js.map +1 -0
- package/dist/src/trajectory/reader.d.ts +21 -0
- package/dist/src/trajectory/reader.js +62 -0
- package/dist/src/trajectory/reader.js.map +1 -0
- package/dist/src/trajectory/record.d.ts +417 -0
- package/dist/src/trajectory/record.js +394 -0
- package/dist/src/trajectory/record.js.map +1 -0
- package/dist/src/trajectory/replay.d.ts +74 -0
- package/dist/src/trajectory/replay.js +285 -0
- package/dist/src/trajectory/replay.js.map +1 -0
- package/dist/src/trajectory/resume-recap.d.ts +43 -0
- package/dist/src/trajectory/resume-recap.js +68 -0
- package/dist/src/trajectory/resume-recap.js.map +1 -0
- package/dist/src/trajectory/search.d.ts +40 -0
- package/dist/src/trajectory/search.js +127 -0
- package/dist/src/trajectory/search.js.map +1 -0
- package/dist/src/trajectory/spend.d.ts +157 -0
- package/dist/src/trajectory/spend.js +264 -0
- package/dist/src/trajectory/spend.js.map +1 -0
- package/dist/src/trajectory/stream.d.ts +30 -0
- package/dist/src/trajectory/stream.js +30 -0
- package/dist/src/trajectory/stream.js.map +1 -0
- package/dist/src/trajectory/writer.d.ts +310 -0
- package/dist/src/trajectory/writer.js +636 -0
- package/dist/src/trajectory/writer.js.map +1 -0
- package/dist/src/tui/App.d.ts +109 -0
- package/dist/src/tui/App.js +2660 -0
- package/dist/src/tui/App.js.map +1 -0
- package/dist/src/tui/InputBox.d.ts +90 -0
- package/dist/src/tui/InputBox.js +129 -0
- package/dist/src/tui/InputBox.js.map +1 -0
- package/dist/src/tui/MarkdownText.d.ts +16 -0
- package/dist/src/tui/MarkdownText.js +117 -0
- package/dist/src/tui/MarkdownText.js.map +1 -0
- package/dist/src/tui/MessageList.d.ts +27 -0
- package/dist/src/tui/MessageList.js +61 -0
- package/dist/src/tui/MessageList.js.map +1 -0
- package/dist/src/tui/PermissionPrompt.d.ts +18 -0
- package/dist/src/tui/PermissionPrompt.js +114 -0
- package/dist/src/tui/PermissionPrompt.js.map +1 -0
- package/dist/src/tui/PlanChecklist.d.ts +7 -0
- package/dist/src/tui/PlanChecklist.js +12 -0
- package/dist/src/tui/PlanChecklist.js.map +1 -0
- package/dist/src/tui/QueuedMessages.d.ts +8 -0
- package/dist/src/tui/QueuedMessages.js +24 -0
- package/dist/src/tui/QueuedMessages.js.map +1 -0
- package/dist/src/tui/StartupScreen.d.ts +25 -0
- package/dist/src/tui/StartupScreen.js +51 -0
- package/dist/src/tui/StartupScreen.js.map +1 -0
- package/dist/src/tui/ToolCallPanel.d.ts +33 -0
- package/dist/src/tui/ToolCallPanel.js +112 -0
- package/dist/src/tui/ToolCallPanel.js.map +1 -0
- package/dist/src/tui/WelcomeHeader.d.ts +30 -0
- package/dist/src/tui/WelcomeHeader.js +69 -0
- package/dist/src/tui/WelcomeHeader.js.map +1 -0
- package/dist/src/tui/background-tool-presentation.d.ts +22 -0
- package/dist/src/tui/background-tool-presentation.js +209 -0
- package/dist/src/tui/background-tool-presentation.js.map +1 -0
- package/dist/src/tui/busy-suffix.d.ts +37 -0
- package/dist/src/tui/busy-suffix.js +39 -0
- package/dist/src/tui/busy-suffix.js.map +1 -0
- package/dist/src/tui/clipboard-image.d.ts +18 -0
- package/dist/src/tui/clipboard-image.js +109 -0
- package/dist/src/tui/clipboard-image.js.map +1 -0
- package/dist/src/tui/context-format.d.ts +43 -0
- package/dist/src/tui/context-format.js +71 -0
- package/dist/src/tui/context-format.js.map +1 -0
- package/dist/src/tui/copy-command.d.ts +68 -0
- package/dist/src/tui/copy-command.js +182 -0
- package/dist/src/tui/copy-command.js.map +1 -0
- package/dist/src/tui/edit-diff.d.ts +135 -0
- package/dist/src/tui/edit-diff.js +356 -0
- package/dist/src/tui/edit-diff.js.map +1 -0
- package/dist/src/tui/frame-budget.d.ts +351 -0
- package/dist/src/tui/frame-budget.js +446 -0
- package/dist/src/tui/frame-budget.js.map +1 -0
- package/dist/src/tui/help-format.d.ts +17 -0
- package/dist/src/tui/help-format.js +38 -0
- package/dist/src/tui/help-format.js.map +1 -0
- package/dist/src/tui/live-text.d.ts +51 -0
- package/dist/src/tui/live-text.js +154 -0
- package/dist/src/tui/live-text.js.map +1 -0
- package/dist/src/tui/markdown.d.ts +62 -0
- package/dist/src/tui/markdown.js +244 -0
- package/dist/src/tui/markdown.js.map +1 -0
- package/dist/src/tui/mcp-format.d.ts +28 -0
- package/dist/src/tui/mcp-format.js +67 -0
- package/dist/src/tui/mcp-format.js.map +1 -0
- package/dist/src/tui/path-completion.d.ts +119 -0
- package/dist/src/tui/path-completion.js +305 -0
- package/dist/src/tui/path-completion.js.map +1 -0
- package/dist/src/tui/permission-queue.d.ts +61 -0
- package/dist/src/tui/permission-queue.js +129 -0
- package/dist/src/tui/permission-queue.js.map +1 -0
- package/dist/src/tui/plan-format.d.ts +9 -0
- package/dist/src/tui/plan-format.js +30 -0
- package/dist/src/tui/plan-format.js.map +1 -0
- package/dist/src/tui/prompt-completion.d.ts +22 -0
- package/dist/src/tui/prompt-completion.js +46 -0
- package/dist/src/tui/prompt-completion.js.map +1 -0
- package/dist/src/tui/prompt-editor.d.ts +102 -0
- package/dist/src/tui/prompt-editor.js +379 -0
- package/dist/src/tui/prompt-editor.js.map +1 -0
- package/dist/src/tui/prompt-history-search.d.ts +53 -0
- package/dist/src/tui/prompt-history-search.js +123 -0
- package/dist/src/tui/prompt-history-search.js.map +1 -0
- package/dist/src/tui/prompt-queue.d.ts +58 -0
- package/dist/src/tui/prompt-queue.js +74 -0
- package/dist/src/tui/prompt-queue.js.map +1 -0
- package/dist/src/tui/prompt-recall.d.ts +74 -0
- package/dist/src/tui/prompt-recall.js +90 -0
- package/dist/src/tui/prompt-recall.js.map +1 -0
- package/dist/src/tui/react-environment.d.ts +11 -0
- package/dist/src/tui/react-environment.js +24 -0
- package/dist/src/tui/react-environment.js.map +1 -0
- package/dist/src/tui/rewind-search.d.ts +34 -0
- package/dist/src/tui/rewind-search.js +68 -0
- package/dist/src/tui/rewind-search.js.map +1 -0
- package/dist/src/tui/shell-command.d.ts +114 -0
- package/dist/src/tui/shell-command.js +310 -0
- package/dist/src/tui/shell-command.js.map +1 -0
- package/dist/src/tui/spend-advisory.d.ts +52 -0
- package/dist/src/tui/spend-advisory.js +64 -0
- package/dist/src/tui/spend-advisory.js.map +1 -0
- package/dist/src/tui/status-format.d.ts +120 -0
- package/dist/src/tui/status-format.js +192 -0
- package/dist/src/tui/status-format.js.map +1 -0
- package/dist/src/tui/subagent-format.d.ts +49 -0
- package/dist/src/tui/subagent-format.js +146 -0
- package/dist/src/tui/subagent-format.js.map +1 -0
- package/dist/src/tui/task-format.d.ts +29 -0
- package/dist/src/tui/task-format.js +87 -0
- package/dist/src/tui/task-format.js.map +1 -0
- package/dist/src/tui/terminal-bell.d.ts +20 -0
- package/dist/src/tui/terminal-bell.js +33 -0
- package/dist/src/tui/terminal-bell.js.map +1 -0
- package/dist/src/tui/tool-detail-presentation.d.ts +60 -0
- package/dist/src/tui/tool-detail-presentation.js +206 -0
- package/dist/src/tui/tool-detail-presentation.js.map +1 -0
- package/dist/src/tui/turn-state.d.ts +195 -0
- package/dist/src/tui/turn-state.js +548 -0
- package/dist/src/tui/turn-state.js.map +1 -0
- package/dist/src/tui/visual-language.d.ts +45 -0
- package/dist/src/tui/visual-language.js +57 -0
- package/dist/src/tui/visual-language.js.map +1 -0
- package/dist/src/version.d.ts +7 -0
- package/dist/src/version.js +38 -0
- package/dist/src/version.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { McpClient } from '@strands-agents/sdk';
|
|
2
|
+
import type { McpConnectionState, McpServerConfig } from '@strands-agents/sdk';
|
|
3
|
+
/** Preferred location, alongside the rest of darwin's project state. */
|
|
4
|
+
export declare const MCP_CONFIG_FILENAME = "mcp.json";
|
|
5
|
+
/**
|
|
6
|
+
* Fallback in the project root: Claude Code's own file, in the same format, so an
|
|
7
|
+
* existing one works without being copied or moved.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ROOT_MCP_CONFIG_FILENAME = ".mcp.json";
|
|
10
|
+
export interface McpLoadResult {
|
|
11
|
+
clients: McpClient[];
|
|
12
|
+
/** Every contributing config path, global first and project second. */
|
|
13
|
+
configPaths: string[];
|
|
14
|
+
/** Server names whose global entry was replaced by the project layer. */
|
|
15
|
+
overriddenServerNames: string[];
|
|
16
|
+
/** Preferred display path, retained for compatibility. */
|
|
17
|
+
configPath: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* A root `.mcp.json` that exists but was not read because `.darwin/mcp.json`
|
|
20
|
+
* took precedence. Surfaced so the header can say the fallback is inert rather
|
|
21
|
+
* than leaving the user to wonder which file is in effect.
|
|
22
|
+
*/
|
|
23
|
+
ignoredConfigPath: string | undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* One configured server as `/mcp` reports it: name, state, and registered tool
|
|
27
|
+
* names — never tool results, server output, or anything else that could turn the
|
|
28
|
+
* report into a second path for server content into the conversation.
|
|
29
|
+
*/
|
|
30
|
+
export interface McpServerStatus {
|
|
31
|
+
/** The config entry's server name (the SDK's `clientName` / `applicationName`). */
|
|
32
|
+
name: string;
|
|
33
|
+
state: McpConnectionState;
|
|
34
|
+
/**
|
|
35
|
+
* Agent-facing names of the tools the SDK registered from this server, sorted,
|
|
36
|
+
* or undefined when they cannot be read (see {@link mcpServerStatuses}). Empty
|
|
37
|
+
* for a server that failed to connect or exposed nothing.
|
|
38
|
+
*/
|
|
39
|
+
toolNames: readonly string[] | undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A read-only projection of the live clients for the `/mcp` report.
|
|
43
|
+
*
|
|
44
|
+
* Reading state must not mutate state, and `listTools()` connects lazily — so it
|
|
45
|
+
* is never called here. Tool names come from the client's `_registeredToolNames`,
|
|
46
|
+
* the set the SDK itself populated when `agent.initialize()` listed and registered
|
|
47
|
+
* this server's tools. That is a private field, read on the same narrow terms as
|
|
48
|
+
* `_transport._serverParams` in {@link loadServersQuietly}: guarded so an SDK that
|
|
49
|
+
* stops exposing it degrades to `toolNames: undefined` (stated as unavailable by
|
|
50
|
+
* the formatter), never to a crash — and never to a connection attempt.
|
|
51
|
+
*/
|
|
52
|
+
export declare function mcpServerStatuses(clients: readonly McpClient[]): McpServerStatus[];
|
|
53
|
+
/**
|
|
54
|
+
* Every file `loadMcpClients` considers, in read order: the global config, the
|
|
55
|
+
* preferred project config, and the project-root fallback. Exported so the `/mcp`
|
|
56
|
+
* report can name where darwin looked when nothing is configured, from the same
|
|
57
|
+
* derivation the loader uses rather than a second copy of it.
|
|
58
|
+
*/
|
|
59
|
+
export declare function mcpConfigCandidates(projectRoot: string): {
|
|
60
|
+
global: string;
|
|
61
|
+
preferred: string;
|
|
62
|
+
fallback: string;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Loads every enabled MCP server declared in `<projectRoot>/.darwin/mcp.json`,
|
|
66
|
+
* falling back to `<projectRoot>/.mcp.json` when the first does not exist.
|
|
67
|
+
*
|
|
68
|
+
* Only one of the two is ever read: merging them would make the effective server
|
|
69
|
+
* list depend on two files at once, and a user who wrote `.darwin/mcp.json`
|
|
70
|
+
* expects that to be the answer.
|
|
71
|
+
*
|
|
72
|
+
* Returns an empty list when neither file is present — running without MCP is a
|
|
73
|
+
* normal configuration, not an error.
|
|
74
|
+
*
|
|
75
|
+
* `continueOnError` is set for every server so one broken entry cannot stop the
|
|
76
|
+
* agent from starting: a server that fails to spawn or connect is logged by the
|
|
77
|
+
* SDK and its `listTools()` yields an empty list, leaving the rest working.
|
|
78
|
+
*
|
|
79
|
+
* An unreadable or malformed file is different from a server that will not start,
|
|
80
|
+
* and is raised as a {@link ConfigError}: the user wrote a config that cannot be
|
|
81
|
+
* understood at all, and silently continuing without their MCP servers would hide
|
|
82
|
+
* a typo behind missing tools.
|
|
83
|
+
*/
|
|
84
|
+
export declare function loadMcpClients(projectRoot: string, options?: {
|
|
85
|
+
quietStdioStderr?: boolean;
|
|
86
|
+
}): Promise<McpLoadResult>;
|
|
87
|
+
/** The declarative half of {@link loadMcpClients}: which files were read, and what they declare. */
|
|
88
|
+
export interface McpServerConfigs extends Omit<McpLoadResult, 'clients'> {
|
|
89
|
+
/**
|
|
90
|
+
* Every declared server, project layer over global, exactly as written (no default
|
|
91
|
+
* prefix, no `${VAR}` interpolation — the SDK does both at connect time). `undefined`
|
|
92
|
+
* when no config file exists at all, which is the ordinary "no MCP" answer.
|
|
93
|
+
*/
|
|
94
|
+
servers: Record<string, McpServerConfig> | undefined;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Reads and merges the MCP config files without constructing a single client:
|
|
98
|
+
* nothing is spawned and nothing connects. `darwin doctor` reports from this;
|
|
99
|
+
* {@link loadMcpClients} builds on it. An unreadable or malformed file is the same
|
|
100
|
+
* {@link ConfigError} startup raises.
|
|
101
|
+
*/
|
|
102
|
+
export declare function readMcpServerConfigs(projectRoot: string): Promise<McpServerConfigs>;
|
|
103
|
+
/**
|
|
104
|
+
* The MCP stdio transport inherits child stderr by default. In headless mode
|
|
105
|
+
* that would let arbitrary server banners violate the bounded progress protocol.
|
|
106
|
+
* The declarative SDK loader has no stderr option, but its transport has not
|
|
107
|
+
* spawned yet here, so switch only that spawn parameter to `ignore`.
|
|
108
|
+
*/
|
|
109
|
+
export declare function loadServersQuietly(servers: Record<string, McpServerConfig>): Promise<McpClient[]>;
|
|
110
|
+
/**
|
|
111
|
+
* Gives every server whose entry has no `prefix` key a `<name>_` tool-name prefix.
|
|
112
|
+
*
|
|
113
|
+
* Two MCP servers are free to expose identically named tools (`browser_close`
|
|
114
|
+
* exists in more than one published server), and a server may even use a name our
|
|
115
|
+
* built-ins hold (`bash`). The SDK's tool registry treats any duplicate as a fatal
|
|
116
|
+
* `ToolValidationError` during `agent.initialize()`, taking the whole TUI down with
|
|
117
|
+
* it — so uniqueness has to be manufactured before registration, which is exactly
|
|
118
|
+
* what Claude Code's `mcp__<server>__` convention does.
|
|
119
|
+
*
|
|
120
|
+
* An explicit `prefix` is always respected, including `""` for a user who wants
|
|
121
|
+
* bare names back (e.g. to keep them short for a model's tool-name length limit)
|
|
122
|
+
* and accepts the collision risk for their particular set of servers.
|
|
123
|
+
*/
|
|
124
|
+
export declare function withDefaultPrefixes(servers: Record<string, McpServerConfig>): Record<string, McpServerConfig>;
|
|
125
|
+
/**
|
|
126
|
+
* Disconnects every client, tolerating individual failures.
|
|
127
|
+
*
|
|
128
|
+
* Called on shutdown, where the useful outcome is "release every child process
|
|
129
|
+
* we can" — one uncooperative server must not leave the others running.
|
|
130
|
+
*/
|
|
131
|
+
export declare function disconnectAll(clients: readonly McpClient[], options?: {
|
|
132
|
+
throwOnError?: boolean;
|
|
133
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP server discovery from `.darwin/mcp.json`, or a project-root `.mcp.json`.
|
|
3
|
+
*
|
|
4
|
+
* This module is deliberately thin. The design anticipated hand-rolling transport
|
|
5
|
+
* construction, but the SDK already covers all of it via
|
|
6
|
+
* `McpClient.loadServers()`:
|
|
7
|
+
*
|
|
8
|
+
* - reads Claude Code's `.mcp.json` shape directly — its loader does
|
|
9
|
+
* `parsed.mcpServers ?? parsed`, so both the wrapped and bare forms work
|
|
10
|
+
* - picks the transport from the fields present (`command` → stdio,
|
|
11
|
+
* `url` → streamable-http) and honours an explicit `transport`, including `sse`
|
|
12
|
+
* - interpolates `${VAR}` / `${env:VAR}` in commands, args, env, urls and headers
|
|
13
|
+
* - supports `disabled`, `prefix` and `toolFilters` per server
|
|
14
|
+
*
|
|
15
|
+
* So the things left for us are: treating a missing file as "no MCP", turning
|
|
16
|
+
* per-server failures into warnings instead of a failed startup, and defaulting
|
|
17
|
+
* each server's `prefix` to `<name>_` so tool names stay unique across servers
|
|
18
|
+
* (see {@link withDefaultPrefixes}).
|
|
19
|
+
*/
|
|
20
|
+
import { access, readFile } from 'node:fs/promises';
|
|
21
|
+
import path from 'node:path';
|
|
22
|
+
import { McpClient } from '@strands-agents/sdk';
|
|
23
|
+
import { ConfigError } from '../config.js';
|
|
24
|
+
import { darwinDir, userDarwinDir } from '../paths.js';
|
|
25
|
+
/** Preferred location, alongside the rest of darwin's project state. */
|
|
26
|
+
export const MCP_CONFIG_FILENAME = 'mcp.json';
|
|
27
|
+
/**
|
|
28
|
+
* Fallback in the project root: Claude Code's own file, in the same format, so an
|
|
29
|
+
* existing one works without being copied or moved.
|
|
30
|
+
*/
|
|
31
|
+
export const ROOT_MCP_CONFIG_FILENAME = '.mcp.json';
|
|
32
|
+
/**
|
|
33
|
+
* A read-only projection of the live clients for the `/mcp` report.
|
|
34
|
+
*
|
|
35
|
+
* Reading state must not mutate state, and `listTools()` connects lazily — so it
|
|
36
|
+
* is never called here. Tool names come from the client's `_registeredToolNames`,
|
|
37
|
+
* the set the SDK itself populated when `agent.initialize()` listed and registered
|
|
38
|
+
* this server's tools. That is a private field, read on the same narrow terms as
|
|
39
|
+
* `_transport._serverParams` in {@link loadServersQuietly}: guarded so an SDK that
|
|
40
|
+
* stops exposing it degrades to `toolNames: undefined` (stated as unavailable by
|
|
41
|
+
* the formatter), never to a crash — and never to a connection attempt.
|
|
42
|
+
*/
|
|
43
|
+
export function mcpServerStatuses(clients) {
|
|
44
|
+
return clients.map((client) => {
|
|
45
|
+
const registered = client._registeredToolNames;
|
|
46
|
+
const toolNames = registered instanceof Set && [...registered].every((name) => typeof name === 'string')
|
|
47
|
+
? [...registered].sort((a, b) => a.localeCompare(b))
|
|
48
|
+
: undefined;
|
|
49
|
+
return { name: client.clientName, state: client.connectionState, toolNames };
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Every file `loadMcpClients` considers, in read order: the global config, the
|
|
54
|
+
* preferred project config, and the project-root fallback. Exported so the `/mcp`
|
|
55
|
+
* report can name where darwin looked when nothing is configured, from the same
|
|
56
|
+
* derivation the loader uses rather than a second copy of it.
|
|
57
|
+
*/
|
|
58
|
+
export function mcpConfigCandidates(projectRoot) {
|
|
59
|
+
return {
|
|
60
|
+
global: path.join(userDarwinDir(), MCP_CONFIG_FILENAME),
|
|
61
|
+
preferred: path.join(darwinDir(projectRoot), MCP_CONFIG_FILENAME),
|
|
62
|
+
fallback: path.join(projectRoot, ROOT_MCP_CONFIG_FILENAME),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Loads every enabled MCP server declared in `<projectRoot>/.darwin/mcp.json`,
|
|
67
|
+
* falling back to `<projectRoot>/.mcp.json` when the first does not exist.
|
|
68
|
+
*
|
|
69
|
+
* Only one of the two is ever read: merging them would make the effective server
|
|
70
|
+
* list depend on two files at once, and a user who wrote `.darwin/mcp.json`
|
|
71
|
+
* expects that to be the answer.
|
|
72
|
+
*
|
|
73
|
+
* Returns an empty list when neither file is present — running without MCP is a
|
|
74
|
+
* normal configuration, not an error.
|
|
75
|
+
*
|
|
76
|
+
* `continueOnError` is set for every server so one broken entry cannot stop the
|
|
77
|
+
* agent from starting: a server that fails to spawn or connect is logged by the
|
|
78
|
+
* SDK and its `listTools()` yields an empty list, leaving the rest working.
|
|
79
|
+
*
|
|
80
|
+
* An unreadable or malformed file is different from a server that will not start,
|
|
81
|
+
* and is raised as a {@link ConfigError}: the user wrote a config that cannot be
|
|
82
|
+
* understood at all, and silently continuing without their MCP servers would hide
|
|
83
|
+
* a typo behind missing tools.
|
|
84
|
+
*/
|
|
85
|
+
export async function loadMcpClients(projectRoot, options = {}) {
|
|
86
|
+
const { servers, ...sources } = await readMcpServerConfigs(projectRoot);
|
|
87
|
+
if (servers === undefined)
|
|
88
|
+
return { clients: [], ...sources };
|
|
89
|
+
const prefixed = withDefaultPrefixes(servers);
|
|
90
|
+
const clients = options.quietStdioStderr === true
|
|
91
|
+
? await loadServersQuietly(prefixed)
|
|
92
|
+
: await McpClient.loadServers(prefixed, { continueOnError: true });
|
|
93
|
+
return { clients, ...sources };
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Reads and merges the MCP config files without constructing a single client:
|
|
97
|
+
* nothing is spawned and nothing connects. `darwin doctor` reports from this;
|
|
98
|
+
* {@link loadMcpClients} builds on it. An unreadable or malformed file is the same
|
|
99
|
+
* {@link ConfigError} startup raises.
|
|
100
|
+
*/
|
|
101
|
+
export async function readMcpServerConfigs(projectRoot) {
|
|
102
|
+
const { global, preferred, fallback } = mcpConfigCandidates(projectRoot);
|
|
103
|
+
const [hasGlobal, hasPreferred, hasFallback] = await Promise.all([
|
|
104
|
+
exists(global), exists(preferred), exists(fallback),
|
|
105
|
+
]);
|
|
106
|
+
const projectConfig = hasPreferred ? preferred : hasFallback ? fallback : undefined;
|
|
107
|
+
const ignoredConfigPath = hasPreferred && hasFallback ? fallback : undefined;
|
|
108
|
+
if (!hasGlobal && projectConfig === undefined) {
|
|
109
|
+
return { servers: undefined, configPaths: [], overriddenServerNames: [], configPath: undefined, ignoredConfigPath };
|
|
110
|
+
}
|
|
111
|
+
const sources = [...new Set([hasGlobal ? global : undefined, projectConfig].filter((source) => source !== undefined))];
|
|
112
|
+
let servers = {};
|
|
113
|
+
const overriddenServerNames = [];
|
|
114
|
+
for (const source of sources) {
|
|
115
|
+
try {
|
|
116
|
+
const raw = JSON.parse(await readFile(source, 'utf8'));
|
|
117
|
+
const layer = unwrapServers(raw);
|
|
118
|
+
if (source === projectConfig) {
|
|
119
|
+
overriddenServerNames.push(...Object.keys(layer).filter((name) => name in servers));
|
|
120
|
+
}
|
|
121
|
+
servers = { ...servers, ...layer };
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
throw new ConfigError(`${source} could not be loaded: ${error instanceof Error ? error.message : String(error)}\n` +
|
|
125
|
+
`Expected Claude Code's format: { "mcpServers": { "<name>": { "command": ..., "args": [...] } } }`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
servers,
|
|
130
|
+
configPaths: sources,
|
|
131
|
+
overriddenServerNames,
|
|
132
|
+
configPath: projectConfig ?? (hasGlobal ? global : undefined),
|
|
133
|
+
ignoredConfigPath,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* The MCP stdio transport inherits child stderr by default. In headless mode
|
|
138
|
+
* that would let arbitrary server banners violate the bounded progress protocol.
|
|
139
|
+
* The declarative SDK loader has no stderr option, but its transport has not
|
|
140
|
+
* spawned yet here, so switch only that spawn parameter to `ignore`.
|
|
141
|
+
*/
|
|
142
|
+
export async function loadServersQuietly(servers) {
|
|
143
|
+
const clients = await McpClient.loadServers(servers, { continueOnError: true });
|
|
144
|
+
for (const client of clients) {
|
|
145
|
+
const transport = client._transport;
|
|
146
|
+
if (transport?._serverParams !== undefined)
|
|
147
|
+
transport._serverParams.stderr = 'ignore';
|
|
148
|
+
}
|
|
149
|
+
return clients;
|
|
150
|
+
}
|
|
151
|
+
/** Mirrors the SDK loader's own unwrapping: both the wrapped and bare forms work. */
|
|
152
|
+
function unwrapServers(parsed) {
|
|
153
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
154
|
+
throw new Error('top-level value must be an object');
|
|
155
|
+
}
|
|
156
|
+
const record = parsed;
|
|
157
|
+
const inner = 'mcpServers' in record ? record['mcpServers'] : record;
|
|
158
|
+
if (typeof inner !== 'object' || inner === null || Array.isArray(inner)) {
|
|
159
|
+
throw new Error('"mcpServers" must be an object mapping server names to entries');
|
|
160
|
+
}
|
|
161
|
+
return inner;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Gives every server whose entry has no `prefix` key a `<name>_` tool-name prefix.
|
|
165
|
+
*
|
|
166
|
+
* Two MCP servers are free to expose identically named tools (`browser_close`
|
|
167
|
+
* exists in more than one published server), and a server may even use a name our
|
|
168
|
+
* built-ins hold (`bash`). The SDK's tool registry treats any duplicate as a fatal
|
|
169
|
+
* `ToolValidationError` during `agent.initialize()`, taking the whole TUI down with
|
|
170
|
+
* it — so uniqueness has to be manufactured before registration, which is exactly
|
|
171
|
+
* what Claude Code's `mcp__<server>__` convention does.
|
|
172
|
+
*
|
|
173
|
+
* An explicit `prefix` is always respected, including `""` for a user who wants
|
|
174
|
+
* bare names back (e.g. to keep them short for a model's tool-name length limit)
|
|
175
|
+
* and accepts the collision risk for their particular set of servers.
|
|
176
|
+
*/
|
|
177
|
+
export function withDefaultPrefixes(servers) {
|
|
178
|
+
return Object.fromEntries(Object.entries(servers).map(([name, entry]) => [
|
|
179
|
+
name,
|
|
180
|
+
// The SDK renders agent-facing names as `<prefix>_<toolName>`, so the
|
|
181
|
+
// default prefix is the bare server name: everything → everything_get-sum.
|
|
182
|
+
typeof entry === 'object' && entry !== null && !('prefix' in entry)
|
|
183
|
+
? { ...entry, prefix: name }
|
|
184
|
+
: entry,
|
|
185
|
+
]));
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Disconnects every client, tolerating individual failures.
|
|
189
|
+
*
|
|
190
|
+
* Called on shutdown, where the useful outcome is "release every child process
|
|
191
|
+
* we can" — one uncooperative server must not leave the others running.
|
|
192
|
+
*/
|
|
193
|
+
export async function disconnectAll(clients, options = {}) {
|
|
194
|
+
const results = await Promise.allSettled(clients.map((client) => client.disconnect()));
|
|
195
|
+
const failures = results.flatMap((result) => result.status === 'rejected' ? [result.reason] : []);
|
|
196
|
+
if (options.throwOnError === true && failures.length > 0) {
|
|
197
|
+
throw new AggregateError(failures, `${failures.length} MCP disconnect operation(s) failed`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
async function exists(filePath) {
|
|
201
|
+
try {
|
|
202
|
+
await access(filePath);
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
catch {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/mcp/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEvD,wEAAwE;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC;AAmCpD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA6B;IAC7D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AI,KAAK,CAAC;YACjE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;YAC5B,CAAC,CAAC,KAAK;KACV,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAA6B,EAC7B,OAAO,GAA+B,EAAE;IAExC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACvF,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAClG,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,cAAc,CAAC,QAAQ,EAAE,GAAG,QAAQ,CAAC,MAAM,qCAAqC,CAAC,CAAC;IAC9F,CAAC;AACH,CAAC;AAED,KAAK,UAAU,MAAM,CAAC,QAAgB;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Agent, McpClient } from '@strands-agents/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Compatibility policy for the configured web-search MCP provider.
|
|
4
|
+
*
|
|
5
|
+
* Its upstream service reports an ordinary zero-hit search as an MCP error. At
|
|
6
|
+
* the registered-tool seam Darwin can distinguish that one verified signature
|
|
7
|
+
* without weakening transport, malformed-input, or other provider failures.
|
|
8
|
+
*/
|
|
9
|
+
export declare class WebSearchEmptyResults {
|
|
10
|
+
/** Replaces only `web-search`'s server-side `search` tool. */
|
|
11
|
+
apply(agent: Agent, clients: readonly McpClient[]): number;
|
|
12
|
+
private wrap;
|
|
13
|
+
private wrapRefreshCallback;
|
|
14
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { TextBlock, Tool, ToolResultBlock } from '@strands-agents/sdk';
|
|
2
|
+
const WEB_SEARCH_CLIENT_NAME = 'web-search';
|
|
3
|
+
const WEB_SEARCH_TOOL_NAME = 'search';
|
|
4
|
+
const EMPTY_RESULTS_ERROR = "Error calling tool 'search': Upstream error: {'code': -32602, 'message': 'Tool returned no results'}";
|
|
5
|
+
/**
|
|
6
|
+
* Compatibility policy for the configured web-search MCP provider.
|
|
7
|
+
*
|
|
8
|
+
* Its upstream service reports an ordinary zero-hit search as an MCP error. At
|
|
9
|
+
* the registered-tool seam Darwin can distinguish that one verified signature
|
|
10
|
+
* without weakening transport, malformed-input, or other provider failures.
|
|
11
|
+
*/
|
|
12
|
+
export class WebSearchEmptyResults {
|
|
13
|
+
/** Replaces only `web-search`'s server-side `search` tool. */
|
|
14
|
+
apply(agent, clients) {
|
|
15
|
+
const searchClients = clients.filter((client) => client.clientName === WEB_SEARCH_CLIENT_NAME);
|
|
16
|
+
if (searchClients.length === 0)
|
|
17
|
+
return 0;
|
|
18
|
+
const replacements = agent.tools.flatMap((candidate) => {
|
|
19
|
+
const wrapped = this.wrap(candidate, searchClients);
|
|
20
|
+
return wrapped === candidate ? [] : [wrapped];
|
|
21
|
+
});
|
|
22
|
+
if (replacements.length > 0)
|
|
23
|
+
agent.toolRegistry.addOrReplace(replacements);
|
|
24
|
+
// Preserve the SDK callback's remove/add lifecycle while ensuring a later
|
|
25
|
+
// tools/list_changed refresh cannot restore the provider's raw search tool.
|
|
26
|
+
for (const client of searchClients)
|
|
27
|
+
this.wrapRefreshCallback(client);
|
|
28
|
+
return replacements.length;
|
|
29
|
+
}
|
|
30
|
+
wrap(candidate, clients) {
|
|
31
|
+
const owner = mcpOwner(candidate);
|
|
32
|
+
if (owner === undefined || !clients.includes(owner))
|
|
33
|
+
return candidate;
|
|
34
|
+
return mcpServerToolName(owner, candidate) === WEB_SEARCH_TOOL_NAME
|
|
35
|
+
? new EmptyResultSearchTool(candidate)
|
|
36
|
+
: candidate;
|
|
37
|
+
}
|
|
38
|
+
wrapRefreshCallback(client) {
|
|
39
|
+
const internal = client;
|
|
40
|
+
const previous = internal._onToolsChanged;
|
|
41
|
+
if (previous === undefined)
|
|
42
|
+
return;
|
|
43
|
+
internal.onToolsChanged = (oldTools, newTools) => {
|
|
44
|
+
previous(oldTools, newTools.map((candidate) => this.wrap(candidate, [client])));
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
class EmptyResultSearchTool extends Tool {
|
|
49
|
+
original;
|
|
50
|
+
name;
|
|
51
|
+
description;
|
|
52
|
+
toolSpec;
|
|
53
|
+
constructor(original) {
|
|
54
|
+
super();
|
|
55
|
+
this.original = original;
|
|
56
|
+
this.name = original.name;
|
|
57
|
+
this.description = original.description;
|
|
58
|
+
this.toolSpec = original.toolSpec;
|
|
59
|
+
}
|
|
60
|
+
async *stream(context) {
|
|
61
|
+
const result = yield* this.original.stream(context);
|
|
62
|
+
const query = searchQuery(context.toolUse.input);
|
|
63
|
+
if (query === undefined || !isEmptyResultsError(result))
|
|
64
|
+
return result;
|
|
65
|
+
return new ToolResultBlock({
|
|
66
|
+
toolUseId: result.toolUseId,
|
|
67
|
+
status: 'success',
|
|
68
|
+
content: [new TextBlock(JSON.stringify({ query, results: [], totalResults: 0 }))],
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function searchQuery(input) {
|
|
73
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
74
|
+
return undefined;
|
|
75
|
+
const query = input['query'];
|
|
76
|
+
return typeof query === 'string' ? query : undefined;
|
|
77
|
+
}
|
|
78
|
+
function isEmptyResultsError(result) {
|
|
79
|
+
return result.status === 'error' &&
|
|
80
|
+
result.error === undefined &&
|
|
81
|
+
result.content.length === 1 &&
|
|
82
|
+
result.content[0]?.type === 'textBlock' &&
|
|
83
|
+
result.content[0].text === EMPTY_RESULTS_ERROR;
|
|
84
|
+
}
|
|
85
|
+
function mcpOwner(tool) {
|
|
86
|
+
const owner = tool.mcpClient;
|
|
87
|
+
return owner !== null && typeof owner === 'object' ? owner : undefined;
|
|
88
|
+
}
|
|
89
|
+
function mcpServerToolName(client, tool) {
|
|
90
|
+
const names = client._serverToolNames;
|
|
91
|
+
const name = names?.get(tool);
|
|
92
|
+
return typeof name === 'string' ? name : undefined;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=web-search-empty-results.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-search-empty-results.js","sourceRoot":"","sources":["../../../src/mcp/web-search-empty-results.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AASvE,MAAM,sBAAsB,GAAG,YAAY,CAAC;AAC5C,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AACtC,MAAM,mBAAmB,GACvB,sGAAsG,CAAC;AAEzG;;;;;;GAMG;AACH,MAAM,OAAO,qBAAqB;IAChC,8DAA8D;IAC9D,KAAK,CAAC,KAAY,EAAE,OAA6B;QAC/C,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,KAAK,sBAAsB,CAAC,CAAC;QAC/F,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,CAAC,CAAC;QAEzC,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YACrD,MAAM,OAAO,GAAG,IAAI,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D,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAuB;IAClD,OAAO,MAAM,CAAC,MAAM,KAAK,OAAO;QAC9B,MAAM,CAAC,KAAK,KAAK,SAAS;QAC1B,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;QAC3B,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,WAAW;QACvC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,mBAAmB,CAAC;AACnD,CAAC;AAED,SAAS,QAAQ,CAAC,IAAU;IAC1B,MAAM,KAAK,GAAI,IAA2C,CAAC,SAAS,CAAC;IACrE,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAkB,CAAC,CAAC,CAAC,SAAS,CAAC;AACtF,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAiB,EAAE,IAAU;IACtD,MAAM,KAAK,GAAI,MAEb,CAAC,gBAAgB,CAAC;IACpB,MAAM,IAAI,GAAG,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type MemoryValidationOptions } from './validation.js';
|
|
2
|
+
export declare const MEMORY_REPORT_MAX_LINES = 48;
|
|
3
|
+
export declare const MEMORY_REPORT_MAX_LINE_CODE_POINTS = 180;
|
|
4
|
+
export declare const MEMORY_REPORT_MAX_ENTRIES = 32;
|
|
5
|
+
export declare const MEMORY_USAGE = "usage: /memory [list] \u00B7 /memory show <id|number> \u00B7 /memory forget <id|number|all> \u00B7 /memory remember <note>";
|
|
6
|
+
export type MemoryCommandResult = {
|
|
7
|
+
readonly changed: boolean;
|
|
8
|
+
readonly text: string;
|
|
9
|
+
readonly index?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function runMemoryCommand(projectRoot: string, input: string, options?: MemoryValidationOptions): Promise<MemoryCommandResult>;
|