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,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `/workflow` built-in — a prompt-style trigger for the parent-only
|
|
3
|
+
* `workflow` DAG tool, never a second execution channel.
|
|
4
|
+
*
|
|
5
|
+
* Expansion produces one fixed-template prompt that goes down the ordinary
|
|
6
|
+
* submit path, so the model still owns DAG decomposition and every node still
|
|
7
|
+
* crosses the permission gate. This module therefore stays pure: it never
|
|
8
|
+
* constructs nodes, never imports `WorkflowTool`, and never touches the
|
|
9
|
+
* runtime. The parse grammar deliberately mirrors `expandCustomCommand` (trim,
|
|
10
|
+
* leading `/`, name up to the first whitespace, case-insensitive), so the
|
|
11
|
+
* built-in and the custom commands it is reserved against cannot disagree
|
|
12
|
+
* about what a slash command looks like. A missing task is the *drivers'*
|
|
13
|
+
* local usage notice, never a fabricated turn — the runtime maps
|
|
14
|
+
* `'missing-task'` to null.
|
|
15
|
+
*/
|
|
16
|
+
export declare const WORKFLOW_COMMAND_NAME = "workflow";
|
|
17
|
+
/** The bounded local usage notice, shared by the TUI and dev-repl. */
|
|
18
|
+
export declare const WORKFLOW_COMMAND_USAGE = "/workflow orchestrates a task with the workflow tool: /workflow <task description>";
|
|
19
|
+
/**
|
|
20
|
+
* Recognizes `/workflow`, leaving all other input untouched (`null`). A bare
|
|
21
|
+
* or whitespace-only invocation is `'missing-task'`; otherwise the expanded
|
|
22
|
+
* prompt is returned.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseWorkflowCommand(input: string): {
|
|
25
|
+
message: string;
|
|
26
|
+
} | 'missing-task' | null;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `/workflow` built-in — a prompt-style trigger for the parent-only
|
|
3
|
+
* `workflow` DAG tool, never a second execution channel.
|
|
4
|
+
*
|
|
5
|
+
* Expansion produces one fixed-template prompt that goes down the ordinary
|
|
6
|
+
* submit path, so the model still owns DAG decomposition and every node still
|
|
7
|
+
* crosses the permission gate. This module therefore stays pure: it never
|
|
8
|
+
* constructs nodes, never imports `WorkflowTool`, and never touches the
|
|
9
|
+
* runtime. The parse grammar deliberately mirrors `expandCustomCommand` (trim,
|
|
10
|
+
* leading `/`, name up to the first whitespace, case-insensitive), so the
|
|
11
|
+
* built-in and the custom commands it is reserved against cannot disagree
|
|
12
|
+
* about what a slash command looks like. A missing task is the *drivers'*
|
|
13
|
+
* local usage notice, never a fabricated turn — the runtime maps
|
|
14
|
+
* `'missing-task'` to null.
|
|
15
|
+
*/
|
|
16
|
+
export const WORKFLOW_COMMAND_NAME = 'workflow';
|
|
17
|
+
/** The bounded local usage notice, shared by the TUI and dev-repl. */
|
|
18
|
+
export const WORKFLOW_COMMAND_USAGE = '/workflow orchestrates a task with the workflow tool: /workflow <task description>';
|
|
19
|
+
/**
|
|
20
|
+
* The fixed instruction template. It restates the tool's own contract — the
|
|
21
|
+
* node bound, what an edge means, and the reads-parallel / writes-serialized
|
|
22
|
+
* rule — and embeds the user's description verbatim under a `Task:` marker.
|
|
23
|
+
* The escape hatch is deliberate: the command steers the model toward the
|
|
24
|
+
* tool, it does not force an indivisible task through it.
|
|
25
|
+
*/
|
|
26
|
+
function workflowPrompt(task) {
|
|
27
|
+
return ('Orchestrate this task with the `workflow` tool: decompose it into a bounded DAG of at ' +
|
|
28
|
+
'most 8 subagent nodes, where each [source, target] edge both orders the work and hands ' +
|
|
29
|
+
'the source\u2019s final report to the target as input. Concurrent nodes share one ' +
|
|
30
|
+
'working tree, so parallel branches are for reads only \u2014 serialize writes by edges and ' +
|
|
31
|
+
'declare each writing node\u2019s writeScopes (project-relative path prefixes) so overlapping ' +
|
|
32
|
+
'unordered writers are refused up front. ' +
|
|
33
|
+
'If the task is truly indivisible, handle it directly and say why a workflow does not ' +
|
|
34
|
+
'fit.\n\n' +
|
|
35
|
+
`Task: ${task}`);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Recognizes `/workflow`, leaving all other input untouched (`null`). A bare
|
|
39
|
+
* or whitespace-only invocation is `'missing-task'`; otherwise the expanded
|
|
40
|
+
* prompt is returned.
|
|
41
|
+
*/
|
|
42
|
+
export function parseWorkflowCommand(input) {
|
|
43
|
+
const trimmed = input.trim();
|
|
44
|
+
if (!trimmed.startsWith('/'))
|
|
45
|
+
return null;
|
|
46
|
+
const withoutSlash = trimmed.slice(1);
|
|
47
|
+
const separator = withoutSlash.search(/\s/);
|
|
48
|
+
const name = separator === -1 ? withoutSlash : withoutSlash.slice(0, separator);
|
|
49
|
+
if (name.toLowerCase() !== WORKFLOW_COMMAND_NAME)
|
|
50
|
+
return null;
|
|
51
|
+
const task = separator === -1 ? '' : withoutSlash.slice(separator).trim();
|
|
52
|
+
if (task === '')
|
|
53
|
+
return 'missing-task';
|
|
54
|
+
return { message: workflowPrompt(task) };
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=workflow-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-command.js","sourceRoot":"","sources":["../../../src/commands/workflow-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC;AAEhD,sEAAsE;AACtE,MAAM,CAAC,MAAM,sBAAsB,GACjC,oFAAoF,CAAC;AAEvF;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,CACL,wFAAwF;QACxF,yFAAyF;QACzF,oFAAoF;QACpF,6FAA6F;QAC7F,+FAA+F;QAC/F,0CAA0C;QAC1C,uFAAuF;QACvF,UAAU;QACV,SAAS,IAAI,EAAE,CAChB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAa;IAEb,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAE1C,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAChF,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,qBAAqB;QAAE,OAAO,IAAI,CAAC;IAE9D,MAAM,IAAI,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1E,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,cAAc,CAAC;IACvC,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
import type { Model } from '@strands-agents/sdk';
|
|
2
|
+
import { type ApprovalMode } from './agent/permission.js';
|
|
3
|
+
import { type PromptCacheTtl } from './agent/prompt-cache.js';
|
|
4
|
+
import { type ThinkingEffort, type ThinkingPlan } from './agent/thinking.js';
|
|
5
|
+
import { type CodexHooksConfig } from './hooks/codex-hooks.js';
|
|
6
|
+
import type { ToolHooksConfig } from './hooks/tool-hooks.js';
|
|
7
|
+
/** Raised for malformed or unusable configuration. Always carries a fix hint. */
|
|
8
|
+
export declare class ConfigError extends Error {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
11
|
+
export declare const PROVIDERS: readonly ['bedrock', 'anthropic', 'openai'];
|
|
12
|
+
export type Provider = (typeof PROVIDERS)[number];
|
|
13
|
+
/**
|
|
14
|
+
* Which OpenAI API the `openai` provider speaks. Declared here rather than
|
|
15
|
+
* imported from the SDK's `OpenAIApi`: that module's types pull in the optional
|
|
16
|
+
* `openai` peer dependency, which a Bedrock-only install does not have.
|
|
17
|
+
*/
|
|
18
|
+
export declare const OPENAI_API_MODES: readonly ['chat', 'responses'];
|
|
19
|
+
export type OpenAIApiMode = (typeof OPENAI_API_MODES)[number];
|
|
20
|
+
export interface AppConfig extends ModelFields, SessionFields {
|
|
21
|
+
/**
|
|
22
|
+
* Every model this config offers, in file order, with the enabled one marked —
|
|
23
|
+
* the catalogue `/model` switches between. Always at least one entry: the
|
|
24
|
+
* single-model form describes itself as a lone enabled choice, so the runtime
|
|
25
|
+
* never has to ask which form was used.
|
|
26
|
+
*
|
|
27
|
+
* Neither a model field nor a session field, but derived from the file as a
|
|
28
|
+
* whole, which is why it sits on {@link AppConfig} rather than in either half.
|
|
29
|
+
*/
|
|
30
|
+
modelChoices: readonly ModelChoice[];
|
|
31
|
+
}
|
|
32
|
+
/** One entry of the `models` array, validated and ready to build a model from. */
|
|
33
|
+
export interface ModelChoice {
|
|
34
|
+
/** Position in the `models` array; 0 for the single-model form. */
|
|
35
|
+
index: number;
|
|
36
|
+
/** The entry's `name`, falling back to its model id. Used to address it. */
|
|
37
|
+
name: string;
|
|
38
|
+
/** Whether this is the entry in effect. Exactly one choice is enabled. */
|
|
39
|
+
enabled: boolean;
|
|
40
|
+
/** The entry's own model configuration, fully validated. */
|
|
41
|
+
fields: ModelFields;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The half of {@link AppConfig} that describes one model. In the array form this
|
|
45
|
+
* is exactly what one `models` entry may set; see {@link MODEL_KEYS}.
|
|
46
|
+
*/
|
|
47
|
+
export interface ModelFields {
|
|
48
|
+
provider: Provider;
|
|
49
|
+
/**
|
|
50
|
+
* Short label for this configuration, for `/model` and the header. Optional;
|
|
51
|
+
* the model id is used when it is absent. Names are compared case-insensitively
|
|
52
|
+
* and must be unique within the file.
|
|
53
|
+
*/
|
|
54
|
+
name?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Provider-specific model identifier. For Bedrock this must be a cross-region
|
|
57
|
+
* inference profile (`us.` or `global.` prefix) — a bare `anthropic.*` id is
|
|
58
|
+
* rejected by the service.
|
|
59
|
+
*/
|
|
60
|
+
model: string;
|
|
61
|
+
/**
|
|
62
|
+
* Bedrock, and Bedrock Mantle. Falls back to AWS_REGION, then
|
|
63
|
+
* AWS_DEFAULT_REGION, then us-west-2.
|
|
64
|
+
*/
|
|
65
|
+
region?: string;
|
|
66
|
+
/** Env var holding the API key, for providers that need one. */
|
|
67
|
+
apiKeyEnv?: string;
|
|
68
|
+
/**
|
|
69
|
+
* `anthropic` provider only: base URL of an Anthropic Messages API-compatible
|
|
70
|
+
* endpoint (a gateway, proxy or relay in front of `api.anthropic.com`). Falls
|
|
71
|
+
* back to `ANTHROPIC_BASE_URL`, then the client's own default — see
|
|
72
|
+
* {@link resolveAnthropicBaseUrl}. Must be an `http:` or `https:` URL.
|
|
73
|
+
*/
|
|
74
|
+
baseUrl?: string;
|
|
75
|
+
/**
|
|
76
|
+
* `openai` provider only: route requests through Amazon Bedrock's
|
|
77
|
+
* OpenAI-compatible "Mantle" endpoint instead of `api.openai.com`, reaching
|
|
78
|
+
* `openai.*` / `xai.*` / `google.gemma-*` models with AWS credentials rather
|
|
79
|
+
* than an API key. The SDK derives the base URL from {@link region} and the
|
|
80
|
+
* model id, and mints a bearer token per request from the standard AWS
|
|
81
|
+
* credential chain — so {@link apiKeyEnv} must not be set alongside it.
|
|
82
|
+
*
|
|
83
|
+
* The model catalog is per-region and does not match Bedrock's own: list it
|
|
84
|
+
* with `pnpm tsx spike/probe-mantle-catalog.ts <region>`.
|
|
85
|
+
*/
|
|
86
|
+
bedrockMantle?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* `openai` provider only: which OpenAI API to speak. `chat` (the default) is
|
|
89
|
+
* Chat Completions; `responses` is the Responses API, which the newest models
|
|
90
|
+
* require — `openai.gpt-5.6-*` on Mantle rejects `/v1/chat/completions`
|
|
91
|
+
* outright. Chosen rather than inferred because the two coexist in one
|
|
92
|
+
* catalog: `openai.gpt-oss-*` is Chat Completions, `openai.gpt-5.6-*` is not.
|
|
93
|
+
*
|
|
94
|
+
* Only the stateless form of `responses` is used: darwin always installs a
|
|
95
|
+
* conversation manager, which the SDK forbids combining with server-managed
|
|
96
|
+
* state.
|
|
97
|
+
*/
|
|
98
|
+
openaiApi?: OpenAIApiMode;
|
|
99
|
+
maxTokens: number;
|
|
100
|
+
/**
|
|
101
|
+
* Total context window of the model in tokens, for `/context`, `/status` and the
|
|
102
|
+
* context-pressure advice. Optional: unset, the SDK's built-in per-model table
|
|
103
|
+
* decides (plus darwin's own table for `openai.`-prefixed Mantle ids), and an id
|
|
104
|
+
* neither knows reads `window unknown`. An explicit value always wins over both
|
|
105
|
+
* tables — the SDK never re-resolves a value that was set by hand.
|
|
106
|
+
*/
|
|
107
|
+
contextWindowLimit?: number;
|
|
108
|
+
/**
|
|
109
|
+
* Prompt caching, on by default. darwin re-sends a large unchanging prefix every
|
|
110
|
+
* turn (tool schemas, the assembled system prompt, the conversation so far), so
|
|
111
|
+
* the cache-write premium pays for itself almost immediately. Only Claude models
|
|
112
|
+
* can cache; for anything else this is ignored — see `src/agent/prompt-cache.ts`.
|
|
113
|
+
*/
|
|
114
|
+
promptCache: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Lifetime of every cache point. Optional; unset means the provider's own
|
|
117
|
+
* default (5 minutes on Bedrock). `1h` costs more to write and suits long
|
|
118
|
+
* sessions with gaps between turns.
|
|
119
|
+
*/
|
|
120
|
+
promptCacheTtl?: PromptCacheTtl;
|
|
121
|
+
/**
|
|
122
|
+
* How hard the model thinks before answering: `low`, `medium`, `high` (the
|
|
123
|
+
* default), `xhigh` or `max`. Claude serves this as *adaptive* thinking — the
|
|
124
|
+
* model decides per request whether to think at all — so a low level is a hint
|
|
125
|
+
* to skip it on easy work, not a hard budget. See `src/agent/thinking.ts`.
|
|
126
|
+
*
|
|
127
|
+
* A level the model cannot serve is clamped rather than sent, so raising this is
|
|
128
|
+
* always safe. On the `openai` provider it becomes a reasoning effort, which
|
|
129
|
+
* only reasoning models accept — a non-reasoning OpenAI model will reject every
|
|
130
|
+
* request, so pair that provider with a reasoning model.
|
|
131
|
+
*
|
|
132
|
+
* Model-scoped on purpose: the levels one model accepts are not the levels
|
|
133
|
+
* another does, so `/effort` persists into the enabled `models` entry.
|
|
134
|
+
*/
|
|
135
|
+
thinkingEffort: ThinkingEffort;
|
|
136
|
+
/**
|
|
137
|
+
* Model id for `auto` mode's safety classifier. Optional — each provider has
|
|
138
|
+
* a cheap default. Bedrock ids must be inference profiles, like `model`.
|
|
139
|
+
*/
|
|
140
|
+
classifierModel?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Bedrock only: how long one request may go with *no bytes arriving* before it
|
|
143
|
+
* fails with "Stream timed out because of no activity", in milliseconds. An
|
|
144
|
+
* idle timeout, not a total-duration cap — every streamed delta resets it.
|
|
145
|
+
* Unset means {@link DEFAULT_REQUEST_TIMEOUT_MS} (180s).
|
|
146
|
+
*/
|
|
147
|
+
requestTimeoutMs?: number;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The half of {@link AppConfig} that outlives a model switch. These always live
|
|
151
|
+
* at the config root, never inside a `models` entry; see {@link SESSION_KEYS}.
|
|
152
|
+
*/
|
|
153
|
+
export interface SessionFields {
|
|
154
|
+
/** Fraction of oldest messages summarized on context overflow. */
|
|
155
|
+
summaryRatio: number;
|
|
156
|
+
/** Messages always kept verbatim by the summarizer. */
|
|
157
|
+
preserveRecentMessages: number;
|
|
158
|
+
/**
|
|
159
|
+
* Fraction of the model's context window at which a warning notice fires once.
|
|
160
|
+
* Set to 0 to disable. Default: 0.8.
|
|
161
|
+
*/
|
|
162
|
+
contextWarnRatio: number;
|
|
163
|
+
/**
|
|
164
|
+
* Offload oversized tool results to session-scoped storage, keeping a preview
|
|
165
|
+
* plus a reference in context. On by default; explicit `false` opts out.
|
|
166
|
+
* See `maxResultTokens`.
|
|
167
|
+
*
|
|
168
|
+
* Storage accumulates by design: offloaded files live under the session's own
|
|
169
|
+
* directory (`~/.darwin/sessions/<project-key>/<session-id>/offload/`) and are
|
|
170
|
+
* never evicted, because a reference held by the conversation must keep
|
|
171
|
+
* resolving across `--resume` and `--session` continuations — a dangling
|
|
172
|
+
* reference is worse than the disk it saves. There is no session GC today;
|
|
173
|
+
* reclaim space by deleting a finished session's two directories under
|
|
174
|
+
* `~/.darwin/sessions/<project-key>/`: `<session-id>/` (background logs and
|
|
175
|
+
* offload files) and `session/<session-id>/` (conversation snapshots).
|
|
176
|
+
*/
|
|
177
|
+
contextOffload: boolean;
|
|
178
|
+
/** Token threshold above which a tool result is offloaded. Darwin default: {@link DEFAULT_MAX_RESULT_TOKENS}. */
|
|
179
|
+
maxResultTokens?: number;
|
|
180
|
+
/**
|
|
181
|
+
* Ring the terminal bell (one raw BEL, `\x07`, straight to stdout — never an Ink
|
|
182
|
+
* row) when the interactive TUI publishes a permission prompt and when a turn
|
|
183
|
+
* completes. **Off by default**: an audible/visual signal nobody asked for is an
|
|
184
|
+
* annoyance, and off must stay byte-identical to before the feature existed.
|
|
185
|
+
* Headless drivers and child agents never ring regardless of this value.
|
|
186
|
+
*
|
|
187
|
+
* Optional in the type for hand-built configs; {@link loadConfig} always stores
|
|
188
|
+
* the resolved boolean, so an absent key reads back as `false`.
|
|
189
|
+
*/
|
|
190
|
+
terminalBell?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Record an append-only trajectory of every turn to
|
|
193
|
+
* `~/.darwin/sessions/<project-key>/<session-id>/trajectory.jsonl`, powering
|
|
194
|
+
* `darwin trajectory search|replay|fork` and `/trajectory`. On by default.
|
|
195
|
+
*
|
|
196
|
+
* Like context offload, recording is on unless explicitly switched off.
|
|
197
|
+
* Recording changes nothing the model sees: it is an observer whose failures
|
|
198
|
+
* degrade to a notice. Snapshots and background logs are likewise written
|
|
199
|
+
* unconditionally.
|
|
200
|
+
* Set `false` to write nothing; the caps are in `src/trajectory/record.ts`.
|
|
201
|
+
*/
|
|
202
|
+
trajectory?: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Write this session's SDK `debug`/`info` output and darwin's own notices to
|
|
205
|
+
* `~/.darwin/sessions/<project-key>/<session-id>/diagnostics.log`. **Off by
|
|
206
|
+
* default**, and the only field here whose default is a privacy decision rather
|
|
207
|
+
* than a cost one.
|
|
208
|
+
*
|
|
209
|
+
* The SDK says several things only at `debug` — that a request was throttled, where
|
|
210
|
+
* it placed its cache points, that native token counting fell back to estimation —
|
|
211
|
+
* so without this a session that was slow because the provider throttled it leaves
|
|
212
|
+
* no evidence at all. Those same lines interpolate provider payloads, which is why
|
|
213
|
+
* diagnostics remains an explicit opt-in even though oversized-result offload is
|
|
214
|
+
* default-on.
|
|
215
|
+
*
|
|
216
|
+
* A boolean rather than a level: every fact worth turning this on for is at `debug`,
|
|
217
|
+
* so an `info` setting would produce a file that exists and is silent about the
|
|
218
|
+
* evidence. Volume is bounded in `src/agent/diagnostics.ts` (8,000 code points per
|
|
219
|
+
* line, 8 MiB per session, 1 MiB of pending writes) rather than by asking the user
|
|
220
|
+
* to guess a level, and reaching any bound is written into the file itself.
|
|
221
|
+
*
|
|
222
|
+
* Nothing evicts it, the same as `offload/` above: delete the session directory.
|
|
223
|
+
*/
|
|
224
|
+
diagnostics?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Derive bounded project-scoped Markdown memory from eligible durable turns. On by
|
|
227
|
+
* default while trajectory recording is available; explicit `false`, or omitted
|
|
228
|
+
* alongside `trajectory: false`, disables it.
|
|
229
|
+
*/
|
|
230
|
+
memory?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Generated-memory age limit in days. Default: 28. Set to 0 to deliberately
|
|
233
|
+
* disable age expiry; current-source validation still applies.
|
|
234
|
+
*/
|
|
235
|
+
memoryHorizonDays?: number;
|
|
236
|
+
/**
|
|
237
|
+
* Ceiling on concurrently running child dispatches (`subagent` calls plus
|
|
238
|
+
* `workflow` nodes, counted on the one dispatch registry). A call that would
|
|
239
|
+
* exceed it is refused as a bounded tool error before any model or child
|
|
240
|
+
* exists. Positive integer; default {@link DEFAULT_MAX_CONCURRENT_SUBAGENTS}.
|
|
241
|
+
* Optional on the type like `memoryHorizonDays` (partial fixtures), but
|
|
242
|
+
* `loadConfig` always populates it; readers fall back through `concurrencyCap`.
|
|
243
|
+
*/
|
|
244
|
+
maxConcurrentSubagents?: number;
|
|
245
|
+
/** When the permission gate asks for confirmation. See {@link ApprovalMode}. */
|
|
246
|
+
permissionMode: ApprovalMode;
|
|
247
|
+
/** Deprecated policy fields retained on the type for migration fixtures only. */
|
|
248
|
+
permissionRules?: {
|
|
249
|
+
readonly allow: readonly string[];
|
|
250
|
+
};
|
|
251
|
+
hooks?: ToolHooksConfig;
|
|
252
|
+
/**
|
|
253
|
+
* Replaces darwin's built-in base system prompt. Optional; for prompts too long
|
|
254
|
+
* to be comfortable in JSON, write `.darwin/system-prompt.md` instead (this
|
|
255
|
+
* field wins over that file). AGENTS.md and the skills catalogue are appended
|
|
256
|
+
* either way — see `src/agent/system-prompt.ts`.
|
|
257
|
+
*/
|
|
258
|
+
systemPrompt?: string;
|
|
259
|
+
}
|
|
260
|
+
export declare const CONFIG_FILENAME = "config.json";
|
|
261
|
+
/**
|
|
262
|
+
* Keys that describe *which model to talk to and how*. In the array form these
|
|
263
|
+
* may only appear inside a `models` entry; at the root they are the single-model
|
|
264
|
+
* form. Listed rather than inferred because the two forms are validated by the
|
|
265
|
+
* same function and the error messages name the key that is in the wrong place.
|
|
266
|
+
*
|
|
267
|
+
* Exported (read-only) so `spike/verify-config.ts` can walk the documented key
|
|
268
|
+
* tables against the schema: with unknown keys refused, a key the docs promise
|
|
269
|
+
* but this list lacks would be a documented setting nobody can write.
|
|
270
|
+
*/
|
|
271
|
+
export declare const MODEL_KEYS: readonly ['provider', 'name', 'model', 'region', 'apiKeyEnv', 'baseUrl', 'bedrockMantle', 'openaiApi', 'maxTokens', 'contextWindowLimit', 'thinkingEffort', 'promptCache', 'promptCacheTtl', 'classifierModel', 'requestTimeoutMs'];
|
|
272
|
+
/**
|
|
273
|
+
* Keys that describe *the session*, not the model: they outlive a model switch
|
|
274
|
+
* and so always live at the root, never in a `models` entry. A permission mode
|
|
275
|
+
* that silently applied to one model and not another would be a security
|
|
276
|
+
* surprise, which is why an entry carrying one is rejected rather than ignored.
|
|
277
|
+
*/
|
|
278
|
+
export declare const SESSION_KEYS: readonly ['permissionMode', 'hooks', 'summaryRatio', 'preserveRecentMessages', 'contextWarnRatio', 'contextOffload', 'maxResultTokens', 'terminalBell', 'trajectory', 'diagnostics', 'memory', 'memoryHorizonDays', 'maxConcurrentSubagents', 'systemPrompt'];
|
|
279
|
+
/**
|
|
280
|
+
* `~/.darwin/config.json`, derived and nothing else: no directory is created.
|
|
281
|
+
*
|
|
282
|
+
* The readers (`loadConfig`, the hook-layer loader, `darwin doctor`) resolve the
|
|
283
|
+
* path through this so that *reading* configuration never leaves a `~/.darwin`
|
|
284
|
+
* behind — an offline diagnostic run, or a `--help`-adjacent inspection in a
|
|
285
|
+
* pristine HOME, must be byte-identical before and after.
|
|
286
|
+
*/
|
|
287
|
+
export declare function configFilePath(): string;
|
|
288
|
+
/** `~/.darwin/config.json`, with its parent directory ensured. The optional argument remains for source compatibility. */
|
|
289
|
+
export declare function configPath(_projectRoot?: string): string;
|
|
290
|
+
/**
|
|
291
|
+
* Default ceiling on concurrently running child dispatches. Equal to the
|
|
292
|
+
* `workflow` tool's `MAX_WORKFLOW_NODES` so the largest permitted DAG still fits
|
|
293
|
+
* an idle registry; `maxConcurrentSubagents` in config overrides it.
|
|
294
|
+
*/
|
|
295
|
+
export declare const DEFAULT_MAX_CONCURRENT_SUBAGENTS = 8;
|
|
296
|
+
/**
|
|
297
|
+
* Default idle timeout for one Bedrock streaming request, in milliseconds. The
|
|
298
|
+
* Strands SDK's own default is 120s, which long quiet stretches (deep adaptive
|
|
299
|
+
* thinking, a loaded endpoint) have been seen to exceed — darwin widens it to
|
|
300
|
+
* 180s. Per-model override: `requestTimeoutMs`.
|
|
301
|
+
*/
|
|
302
|
+
export declare const DEFAULT_REQUEST_TIMEOUT_MS = 180000;
|
|
303
|
+
/**
|
|
304
|
+
* The inline preview the context offloader keeps for each offloaded result, in
|
|
305
|
+
* tokens — the SDK's `DEFAULT_PREVIEW_TOKENS`, mirrored here because darwin never
|
|
306
|
+
* overrides it and `maxResultTokens` has to clear it.
|
|
307
|
+
*
|
|
308
|
+
* Measured, not assumed: the plugin throws `previewTokens must be less than
|
|
309
|
+
* maxResultTokens` on `previewTokens >= maxResultTokens`, so a threshold equal to
|
|
310
|
+
* this value is rejected and this + 1 is the smallest usable one. Threading a
|
|
311
|
+
* `previewTokens` config field is deliberately out of scope: one validated
|
|
312
|
+
* threshold covers the need until someone asks for two.
|
|
313
|
+
*/
|
|
314
|
+
export declare const OFFLOAD_PREVIEW_TOKENS = 1000;
|
|
315
|
+
/**
|
|
316
|
+
* Darwin's default offload threshold, above the SDK's own 2500 on purpose.
|
|
317
|
+
*
|
|
318
|
+
* A result between 2500 and this value offloads with poor return: the
|
|
319
|
+
* 1000-token preview stays in context regardless, so offloading saves only the
|
|
320
|
+
* remainder per round, while an agent that needs the content pays one full
|
|
321
|
+
* retrieval round — a complete context replay — to get it back (the issue-#8
|
|
322
|
+
* single-small-tool round pattern). `maxResultTokens` in config still overrides
|
|
323
|
+
* in either direction.
|
|
324
|
+
*/
|
|
325
|
+
export declare const DEFAULT_MAX_RESULT_TOKENS = 5000;
|
|
326
|
+
/** Mantle catalog IDs carry `openai.`; normalize it before the metadata lookup. */
|
|
327
|
+
export declare function openAIContextWindowLimit(modelId: string): number | undefined;
|
|
328
|
+
export declare function resolveRegion(configured?: string): string;
|
|
329
|
+
/**
|
|
330
|
+
* The base URL the `anthropic` provider will talk to: `baseUrl` from the config,
|
|
331
|
+
* else a non-empty `ANTHROPIC_BASE_URL`, else undefined — meaning the Anthropic
|
|
332
|
+
* client's own default (`https://api.anthropic.com`).
|
|
333
|
+
*
|
|
334
|
+
* Resolved here rather than left to the client (which reads the same env var by
|
|
335
|
+
* itself) for the same reason `region` is: one place decides, so a spike can
|
|
336
|
+
* assert the decision without a network and a future status surface can print it.
|
|
337
|
+
*/
|
|
338
|
+
export declare function resolveAnthropicBaseUrl(config: Pick<AppConfig, 'baseUrl'>): string | undefined;
|
|
339
|
+
/**
|
|
340
|
+
* Completes a flat config with the one-entry catalogue it implies.
|
|
341
|
+
*
|
|
342
|
+
* The single-model form and a hand-built config both describe exactly one choice,
|
|
343
|
+
* and deriving it here rather than writing it out keeps the catalogue from ever
|
|
344
|
+
* disagreeing with the fields beside it.
|
|
345
|
+
*/
|
|
346
|
+
export declare function withSoleChoice<T extends ModelFields & SessionFields>(config: T): T & AppConfig;
|
|
347
|
+
/**
|
|
348
|
+
* Rebuilds a config around a different {@link ModelChoice}, keeping the session.
|
|
349
|
+
*
|
|
350
|
+
* Built from the session keys up rather than spread over the old config: spreading
|
|
351
|
+
* would leave the *previous* model's optional fields behind — a switch away from a
|
|
352
|
+
* Mantle entry would keep its `region` and `openaiApi`, silently configuring the
|
|
353
|
+
* new model with the old one's transport. That is the same leak the loader is
|
|
354
|
+
* tested against, so it must not reappear at switch time.
|
|
355
|
+
*
|
|
356
|
+
* The session half is copied through {@link SESSION_KEYS} so this function and the
|
|
357
|
+
* validator cannot disagree about which keys survive a model change.
|
|
358
|
+
*/
|
|
359
|
+
export declare function withModelChoice(config: AppConfig, target: ModelChoice): AppConfig;
|
|
360
|
+
/**
|
|
361
|
+
* Loads `~/.darwin/config.json` from `projectRoot`. A missing file is normal — the
|
|
362
|
+
* defaults are a working Bedrock setup, with the whole {@link DEFAULT_MODELS}
|
|
363
|
+
* catalogue `/model` can switch between. A present but malformed file is an
|
|
364
|
+
* error, since silently ignoring it would hide the user's intent.
|
|
365
|
+
*/
|
|
366
|
+
export declare function loadConfig(projectRoot: string): Promise<AppConfig>;
|
|
367
|
+
export declare const PERMISSION_RULES_FILENAME = "permission-rules.json";
|
|
368
|
+
export declare const HOOKS_FILENAME = "hooks.json";
|
|
369
|
+
export declare function permissionRulesPath(projectRoot: string): string;
|
|
370
|
+
export declare function globalHooksPath(): string;
|
|
371
|
+
export declare function projectHooksPath(projectRoot: string): string;
|
|
372
|
+
export interface HookShadowNotice {
|
|
373
|
+
layer: string;
|
|
374
|
+
directory: string;
|
|
375
|
+
shadowed: string[];
|
|
376
|
+
}
|
|
377
|
+
export type ToolHookPolicyLayer = {
|
|
378
|
+
readonly dialect: 'native';
|
|
379
|
+
readonly file: string;
|
|
380
|
+
readonly hooks: ToolHooksConfig;
|
|
381
|
+
} | {
|
|
382
|
+
readonly dialect: 'codex';
|
|
383
|
+
readonly file: string;
|
|
384
|
+
readonly hooks: CodexHooksConfig;
|
|
385
|
+
};
|
|
386
|
+
export interface ProjectPolicy {
|
|
387
|
+
allowRules: string[];
|
|
388
|
+
hooks: ToolHooksConfig | undefined;
|
|
389
|
+
codexHooks: CodexHooksConfig | undefined;
|
|
390
|
+
toolHookLayers: readonly ToolHookPolicyLayer[];
|
|
391
|
+
hookSources: string[];
|
|
392
|
+
hookShadowNotices: HookShadowNotice[];
|
|
393
|
+
legacyRules: boolean;
|
|
394
|
+
}
|
|
395
|
+
/** Loads project-scoped rules and all executable hook extension layers. */
|
|
396
|
+
export declare function loadProjectPolicy(projectRoot: string): Promise<ProjectPolicy>;
|
|
397
|
+
/** Adds one project-scoped allow rule, promoting legacy rules on first write. */
|
|
398
|
+
export declare function appendAllowRule(projectRoot: string, rule: string): Promise<void>;
|
|
399
|
+
/**
|
|
400
|
+
* Persists a revocation: removes the given rules from the project-scoped file,
|
|
401
|
+
* promoting legacy rules on first write exactly like {@link appendAllowRule}.
|
|
402
|
+
*
|
|
403
|
+
* Filter-only by construction — what is written is the set the loader already
|
|
404
|
+
* reported as in force, minus the revoked rules. There is no path through here
|
|
405
|
+
* that can add or rewrite a rule, so a bug in a caller costs at most an extra
|
|
406
|
+
* prompt, never a silent widening.
|
|
407
|
+
*/
|
|
408
|
+
export declare function removeAllowRules(projectRoot: string, rules: readonly string[]): Promise<void>;
|
|
409
|
+
/**
|
|
410
|
+
* Persists `thinkingEffort` in `~/.darwin/config.json`, so a level chosen with
|
|
411
|
+
* `/effort` is still in effect next session.
|
|
412
|
+
*
|
|
413
|
+
* In the array form the level is written into the *enabled* entry, not the root:
|
|
414
|
+
* `thinkingEffort` is model-scoped, and a root-level copy would be rejected on
|
|
415
|
+
* the next load as a stray model key — turning a convenience into a config that
|
|
416
|
+
* refuses to start.
|
|
417
|
+
*
|
|
418
|
+
* Merged into the raw JSON for the same reason as {@link appendAllowRule}: writing
|
|
419
|
+
* back a loaded {@link AppConfig} would freeze today's defaults into the user's
|
|
420
|
+
* file and drop any key this version does not know about. The caller has already
|
|
421
|
+
* applied the level to the running model, so a failed write costs the memory of
|
|
422
|
+
* the choice and nothing else — which is why this throws rather than swallowing.
|
|
423
|
+
*/
|
|
424
|
+
export declare function saveThinkingEffort(projectRoot: string, effort: ThinkingEffort): Promise<void>;
|
|
425
|
+
/**
|
|
426
|
+
* Moves `enable: true` to the entry at `index`, switching every other entry off,
|
|
427
|
+
* so a `/model` change is still in effect next session.
|
|
428
|
+
*
|
|
429
|
+
* Writes `false` explicitly rather than deleting the key: an entry that visibly
|
|
430
|
+
* says `"enable": false` is the switch this format is built around, and a file
|
|
431
|
+
* where the off entries simply lack the key reads as if they were never
|
|
432
|
+
* considered.
|
|
433
|
+
*
|
|
434
|
+
* With no config file, `/model` is switching the built-in catalogue, so the first
|
|
435
|
+
* switch materializes that catalogue as a `models` array. A present flat or empty
|
|
436
|
+
* file remains explicit user configuration and is never converted implicitly.
|
|
437
|
+
*
|
|
438
|
+
* Raw-JSON merge and throw-don't-swallow for the same reasons as
|
|
439
|
+
* {@link saveThinkingEffort}: the caller has already switched the live model, so a
|
|
440
|
+
* failed write costs only the memory of the choice.
|
|
441
|
+
*/
|
|
442
|
+
export declare function saveEnabledModel(projectRoot: string, index: number): Promise<void>;
|
|
443
|
+
/**
|
|
444
|
+
* Builds the SDK model for the configured provider.
|
|
445
|
+
*
|
|
446
|
+
* Anthropic and OpenAI live behind dynamic imports because their model modules
|
|
447
|
+
* require peer dependencies (`@anthropic-ai/sdk`, `openai`) that a Bedrock-only
|
|
448
|
+
* install does not have. A static import would break the default setup.
|
|
449
|
+
*/
|
|
450
|
+
export declare function createModelFromConfig(config: AppConfig): Promise<Model>;
|
|
451
|
+
/**
|
|
452
|
+
* Reconfigures a live model to think at `effort`, returning what it will actually
|
|
453
|
+
* do (the level may be clamped — see `src/agent/thinking.ts`).
|
|
454
|
+
*
|
|
455
|
+
* Reconfiguration rather than reconstruction, because the point of `/effort` is to
|
|
456
|
+
* change depth *without* losing the conversation: `Model.updateConfig()` merges
|
|
457
|
+
* into the existing config, so the region, cache config and token budget the model
|
|
458
|
+
* was built with all stay as they were.
|
|
459
|
+
*
|
|
460
|
+
* The provider switch lives here because this file is the only one that names a
|
|
461
|
+
* provider; the fields themselves come from `src/agent/thinking.ts`.
|
|
462
|
+
*/
|
|
463
|
+
export declare function applyThinkingEffort(model: Model, config: AppConfig, effort: ThinkingEffort): ThinkingPlan;
|