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,303 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `darwin trajectory <verb>` — reading the append-only record.
|
|
3
|
+
*
|
|
4
|
+
* Deliberately a separate parser from {@link parseCliArgs} rather than another
|
|
5
|
+
* branch inside it: an agent run and a record inspection have nothing in common
|
|
6
|
+
* except the executable name, and `CliOptions` describes exactly one of them.
|
|
7
|
+
* Keeping them apart also keeps this path free of any model, agent or Ink import,
|
|
8
|
+
* which is what makes "replay never calls a model" a structural property instead of
|
|
9
|
+
* a promise.
|
|
10
|
+
*
|
|
11
|
+
* Exit codes follow the headless convention: 0 for a completed operation
|
|
12
|
+
* (including a search that legitimately found nothing), 1 when a named session or
|
|
13
|
+
* record is missing or unreadable, 2 for a usage error.
|
|
14
|
+
*/
|
|
15
|
+
import { hasSnapshot, listSessionIds, trajectoryPath } from './agent/session.js';
|
|
16
|
+
import { CliUsageError } from './cli-args.js';
|
|
17
|
+
import { isValidSessionId } from './agent/session.js';
|
|
18
|
+
import { forkSession } from './trajectory/fork.js';
|
|
19
|
+
import { readTrajectory, TrajectoryMissingError, describeDamage } from './trajectory/reader.js';
|
|
20
|
+
import { formatTurnFailure, turnFailureOf, } from './trajectory/record.js';
|
|
21
|
+
import { formatReplay, replayRead } from './trajectory/replay.js';
|
|
22
|
+
import { formatSpendCost, formatSpendSummary, priceSpend, summarizeSpend } from './trajectory/spend.js';
|
|
23
|
+
import { searchTrajectories, UnknownSessionError } from './trajectory/search.js';
|
|
24
|
+
import { readModelPriceCache } from './pricing/model-prices.js';
|
|
25
|
+
import { userModelPricesFile } from './paths.js';
|
|
26
|
+
/** Must match `AGENT_ID` in `src/agent/runtime.ts`: snapshots are keyed by it. */
|
|
27
|
+
const AGENT_ID = 'darwin';
|
|
28
|
+
export const TRAJECTORY_COMMAND = 'trajectory';
|
|
29
|
+
export const TRAJECTORY_USAGE = `Usage: darwin ${TRAJECTORY_COMMAND} <command>
|
|
30
|
+
|
|
31
|
+
list recorded sessions in this project, newest first
|
|
32
|
+
search <text> [--session <id>] [--type <t>] [--limit <n>]
|
|
33
|
+
case-insensitive substring search over records
|
|
34
|
+
replay <id> [--turn <n>] [--json] rebuild a recorded session's history; no model calls
|
|
35
|
+
fork <id> copy a session into a new one, leaving the source untouched`;
|
|
36
|
+
/** True when argv asks for this subcommand at all, so `cli.ts` can route before anything else. */
|
|
37
|
+
export function isTrajectoryInvocation(argv) {
|
|
38
|
+
return argv[0] === TRAJECTORY_COMMAND;
|
|
39
|
+
}
|
|
40
|
+
/** Parses argv *after* the `trajectory` token. No I/O. */
|
|
41
|
+
export function parseTrajectoryArgs(argv) {
|
|
42
|
+
const verb = argv[0];
|
|
43
|
+
const rest = argv.slice(1);
|
|
44
|
+
switch (verb) {
|
|
45
|
+
case 'list': {
|
|
46
|
+
if (rest.length > 0)
|
|
47
|
+
throw new CliUsageError(`${TRAJECTORY_COMMAND} list takes no arguments.`);
|
|
48
|
+
return { verb: 'list' };
|
|
49
|
+
}
|
|
50
|
+
case 'search': {
|
|
51
|
+
const query = rest[0];
|
|
52
|
+
if (query === undefined || query.startsWith('--') || query.trim() === '') {
|
|
53
|
+
throw new CliUsageError(`${TRAJECTORY_COMMAND} search expects a non-empty search text.`);
|
|
54
|
+
}
|
|
55
|
+
const flags = parseFlags(rest.slice(1), ['session', 'type', 'limit']);
|
|
56
|
+
const command = { verb: 'search', query };
|
|
57
|
+
if (flags.session !== undefined)
|
|
58
|
+
command.sessionId = requireSessionId(flags.session);
|
|
59
|
+
if (flags.type !== undefined)
|
|
60
|
+
command.type = flags.type;
|
|
61
|
+
if (flags.limit !== undefined)
|
|
62
|
+
command.limit = requireCount(flags.limit, '--limit');
|
|
63
|
+
return command;
|
|
64
|
+
}
|
|
65
|
+
case 'replay': {
|
|
66
|
+
const sessionId = requireSessionId(rest[0]);
|
|
67
|
+
const flags = parseFlags(rest.slice(1), ['turn'], ['json']);
|
|
68
|
+
const command = { verb: 'replay', sessionId, json: flags.json === '' };
|
|
69
|
+
if (flags.turn !== undefined)
|
|
70
|
+
command.turn = requireCount(flags.turn, '--turn');
|
|
71
|
+
return command;
|
|
72
|
+
}
|
|
73
|
+
case 'fork': {
|
|
74
|
+
const sessionId = requireSessionId(rest[0]);
|
|
75
|
+
if (rest.length > 1)
|
|
76
|
+
throw new CliUsageError(`${TRAJECTORY_COMMAND} fork takes one session id.`);
|
|
77
|
+
return { verb: 'fork', sessionId };
|
|
78
|
+
}
|
|
79
|
+
default:
|
|
80
|
+
throw new CliUsageError(verb === undefined
|
|
81
|
+
? `${TRAJECTORY_COMMAND} expects a command.\n${TRAJECTORY_USAGE}`
|
|
82
|
+
: `Unknown ${TRAJECTORY_COMMAND} command ${JSON.stringify(verb)}.\n${TRAJECTORY_USAGE}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function requireSessionId(value) {
|
|
86
|
+
if (value === undefined || value.startsWith('--') || value === '') {
|
|
87
|
+
throw new CliUsageError(`${TRAJECTORY_COMMAND} expects a session id.`);
|
|
88
|
+
}
|
|
89
|
+
if (!isValidSessionId(value)) {
|
|
90
|
+
throw new CliUsageError(`Invalid session id ${JSON.stringify(value)}; use lowercase letters, numbers, hyphens, and underscores.`);
|
|
91
|
+
}
|
|
92
|
+
return value;
|
|
93
|
+
}
|
|
94
|
+
function requireCount(value, flag) {
|
|
95
|
+
if (!/^\d+$/.test(value) || Number(value) < 1) {
|
|
96
|
+
throw new CliUsageError(`${flag} expects a positive whole number, got ${JSON.stringify(value)}.`);
|
|
97
|
+
}
|
|
98
|
+
return Number(value);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Minimal `--name value` / `--name` parser over one verb's remaining arguments.
|
|
102
|
+
*
|
|
103
|
+
* A boolean flag records the empty string, so presence is `!== undefined` for both
|
|
104
|
+
* kinds and an unknown flag is a usage error rather than being silently ignored —
|
|
105
|
+
* a mistyped `--sesion` must not turn into a project-wide scan.
|
|
106
|
+
*/
|
|
107
|
+
function parseFlags(argv, valued, booleans = []) {
|
|
108
|
+
const flags = {};
|
|
109
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
110
|
+
const token = argv[index];
|
|
111
|
+
if (!token.startsWith('--'))
|
|
112
|
+
throw new CliUsageError(`Unexpected argument ${JSON.stringify(token)}.`);
|
|
113
|
+
const name = token.slice(2);
|
|
114
|
+
if (booleans.includes(name)) {
|
|
115
|
+
flags[name] = '';
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (!valued.includes(name))
|
|
119
|
+
throw new CliUsageError(`Unknown argument ${JSON.stringify(token)}.`);
|
|
120
|
+
const value = argv[index + 1];
|
|
121
|
+
if (value === undefined || value.startsWith('--')) {
|
|
122
|
+
throw new CliUsageError(`${token} expects a value.`);
|
|
123
|
+
}
|
|
124
|
+
if (flags[name] !== undefined)
|
|
125
|
+
throw new CliUsageError(`${token} may be specified only once.`);
|
|
126
|
+
flags[name] = value;
|
|
127
|
+
index += 1;
|
|
128
|
+
}
|
|
129
|
+
return flags;
|
|
130
|
+
}
|
|
131
|
+
/** One tolerant read of the price cache; a missing or damaged file prices nothing. */
|
|
132
|
+
function readPrices(io) {
|
|
133
|
+
return readModelPriceCache(io.pricesFile ?? userModelPricesFile());
|
|
134
|
+
}
|
|
135
|
+
/** Runs one parsed command and returns the process exit code. */
|
|
136
|
+
export async function runTrajectoryCommand(command, io) {
|
|
137
|
+
switch (command.verb) {
|
|
138
|
+
case 'list':
|
|
139
|
+
return listSessions(io);
|
|
140
|
+
case 'search':
|
|
141
|
+
return search(command, io);
|
|
142
|
+
case 'replay':
|
|
143
|
+
return replay(command, io);
|
|
144
|
+
case 'fork':
|
|
145
|
+
return fork(command, io);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
async function listSessions(io) {
|
|
149
|
+
const ids = await listSessionIds(io.projectRoot);
|
|
150
|
+
if (ids.length === 0) {
|
|
151
|
+
io.out('no sessions recorded for this project\n');
|
|
152
|
+
return 0;
|
|
153
|
+
}
|
|
154
|
+
const prices = readPrices(io);
|
|
155
|
+
for (const id of ids) {
|
|
156
|
+
const file = trajectoryPath(io.projectRoot, id);
|
|
157
|
+
let summary;
|
|
158
|
+
try {
|
|
159
|
+
const read = await readTrajectory(file);
|
|
160
|
+
const damage = describeDamage(read);
|
|
161
|
+
const turns = new Set(read.records.filter((r) => r.turn > 0).map((r) => r.turn)).size;
|
|
162
|
+
const spend = summarizeSpend(read.records);
|
|
163
|
+
summary =
|
|
164
|
+
`${read.records.length} record(s), ${turns} turn(s), ${read.bytes} bytes` +
|
|
165
|
+
// One bounded clause, so a whole session still fits one row: the four fixed
|
|
166
|
+
// buckets, the models that incurred them, and how many turns nothing measured.
|
|
167
|
+
// A session recorded before spend existed reads `unknown`, never zero.
|
|
168
|
+
`, ${formatSpendSummary(spend)}` +
|
|
169
|
+
// And what they cost, each model at its own cached rates — one more bounded
|
|
170
|
+
// clause, present exactly when there is a spend to price; an unpriced model
|
|
171
|
+
// makes it a floor that names the model, never a smaller exact-looking figure.
|
|
172
|
+
(spend.turnsWithSpend === 0 ? '' : `, ${formatSpendCost(priceSpend(spend, prices))}`) +
|
|
173
|
+
(damage === undefined ? '' : ` — ${damage}`) +
|
|
174
|
+
(describeFailedTurns(read.records) ?? '');
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
// A snapshot without a record is the ordinary case for sessions that predate
|
|
178
|
+
// recording or ran with it off; say which, rather than implying an empty run.
|
|
179
|
+
summary = (await hasSnapshot(io.projectRoot, id, AGENT_ID))
|
|
180
|
+
? 'no trajectory recorded (snapshot only)'
|
|
181
|
+
: 'no trajectory recorded';
|
|
182
|
+
}
|
|
183
|
+
io.out(`${id} ${summary}\n`);
|
|
184
|
+
}
|
|
185
|
+
return 0;
|
|
186
|
+
}
|
|
187
|
+
/** Failed turns named on a `list` row before the rest are only counted. */
|
|
188
|
+
const LISTED_FAILURES = 3;
|
|
189
|
+
/**
|
|
190
|
+
* The failed turns of one session, or `undefined` when it has none.
|
|
191
|
+
*
|
|
192
|
+
* Every part of this is bounded, because `list` is one line per session and the
|
|
193
|
+
* material is provider-controlled: each failure is rendered through
|
|
194
|
+
* `formatTurnFailure` (class + message, whitespace collapsed, capped), and only the
|
|
195
|
+
* first {@link LISTED_FAILURES} are named, the rest counted. A message sitting at the
|
|
196
|
+
* 8,000 code-point field cap therefore cannot widen the row.
|
|
197
|
+
*/
|
|
198
|
+
function describeFailedTurns(records) {
|
|
199
|
+
const failed = records
|
|
200
|
+
.filter((record) => record.type === 'turnEnded')
|
|
201
|
+
.flatMap((record) => {
|
|
202
|
+
const failure = turnFailureOf(record);
|
|
203
|
+
return failure === undefined ? [] : [{ turn: record.turn, failure }];
|
|
204
|
+
});
|
|
205
|
+
if (failed.length === 0)
|
|
206
|
+
return undefined;
|
|
207
|
+
const named = failed
|
|
208
|
+
.slice(0, LISTED_FAILURES)
|
|
209
|
+
.map(({ turn, failure }) => `turn ${turn} ${formatTurnFailure(failure)}`)
|
|
210
|
+
.join('; ');
|
|
211
|
+
const rest = failed.length - Math.min(failed.length, LISTED_FAILURES);
|
|
212
|
+
return ` — ${failed.length} failed turn(s): ${named}${rest > 0 ? ` +${rest} more` : ''}`;
|
|
213
|
+
}
|
|
214
|
+
async function search(command, io) {
|
|
215
|
+
const options = {};
|
|
216
|
+
if (command.sessionId !== undefined)
|
|
217
|
+
options.sessionId = command.sessionId;
|
|
218
|
+
if (command.type !== undefined)
|
|
219
|
+
options.type = command.type;
|
|
220
|
+
if (command.limit !== undefined)
|
|
221
|
+
options.limit = command.limit;
|
|
222
|
+
let outcome;
|
|
223
|
+
try {
|
|
224
|
+
outcome = await searchTrajectories(io.projectRoot, command.query, AGENT_ID, options);
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
if (error instanceof UnknownSessionError) {
|
|
228
|
+
io.err(`error: ${error.message}\n`);
|
|
229
|
+
return 1;
|
|
230
|
+
}
|
|
231
|
+
throw error;
|
|
232
|
+
}
|
|
233
|
+
// An explicitly named session with no record is a different answer from "no
|
|
234
|
+
// matches", and gets its own exit code: the search never ran over anything.
|
|
235
|
+
if (command.sessionId !== undefined && outcome.withoutRecord.includes(command.sessionId)) {
|
|
236
|
+
io.err(`error: no trajectory recorded for session ${command.sessionId}\n`);
|
|
237
|
+
return 1;
|
|
238
|
+
}
|
|
239
|
+
for (const session of outcome.sessions) {
|
|
240
|
+
if (session.damage !== undefined)
|
|
241
|
+
io.err(`${session.sessionId}: ${session.damage}\n`);
|
|
242
|
+
for (const hit of session.hits) {
|
|
243
|
+
io.out(`${hit.sessionId} seq=${hit.seq} turn=${hit.turn} ${hit.type} — ${hit.excerpt}\n`);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (outcome.hitCount === 0) {
|
|
247
|
+
// Exit 0: the search itself succeeded. Only a record that could not be read is
|
|
248
|
+
// a failure, and that was reported above.
|
|
249
|
+
io.out(`no matches for ${JSON.stringify(command.query)}\n`);
|
|
250
|
+
if (outcome.withoutRecord.length > 0) {
|
|
251
|
+
io.err(`${outcome.withoutRecord.length} session(s) have no trajectory record\n`);
|
|
252
|
+
}
|
|
253
|
+
return 0;
|
|
254
|
+
}
|
|
255
|
+
io.out(`${outcome.hitCount} match(es)${outcome.limited ? ' (limit reached)' : ''}\n`);
|
|
256
|
+
return 0;
|
|
257
|
+
}
|
|
258
|
+
async function replay(command, io) {
|
|
259
|
+
let read;
|
|
260
|
+
try {
|
|
261
|
+
read = await readTrajectory(trajectoryPath(io.projectRoot, command.sessionId));
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
if (error instanceof TrajectoryMissingError) {
|
|
265
|
+
const known = await hasSnapshot(io.projectRoot, command.sessionId, AGENT_ID);
|
|
266
|
+
io.err(`error: no trajectory recorded for session ${command.sessionId}` +
|
|
267
|
+
`${known ? ' (the session exists but predates recording, or ran with trajectory: false)' : ''}\n`);
|
|
268
|
+
return 1;
|
|
269
|
+
}
|
|
270
|
+
throw error;
|
|
271
|
+
}
|
|
272
|
+
const result = replayRead(read, { ...(command.turn !== undefined && { turn: command.turn }), prices: readPrices(io) });
|
|
273
|
+
if (result.damage !== undefined)
|
|
274
|
+
io.err(`${command.sessionId}: ${result.damage}\n`);
|
|
275
|
+
if (command.turn !== undefined && !result.turns.includes(command.turn)) {
|
|
276
|
+
io.err(`error: session ${command.sessionId} has no turn ${command.turn}` +
|
|
277
|
+
` (recorded turns: ${result.turns.join(', ') || 'none'})\n`);
|
|
278
|
+
return 1;
|
|
279
|
+
}
|
|
280
|
+
io.out(command.json ? `${JSON.stringify(result.history, null, 2)}\n` : `${formatReplay(result)}\n`);
|
|
281
|
+
return 0;
|
|
282
|
+
}
|
|
283
|
+
async function fork(command, io) {
|
|
284
|
+
let result;
|
|
285
|
+
try {
|
|
286
|
+
result = await forkSession(io.projectRoot, command.sessionId, AGENT_ID);
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
io.err(`error: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
290
|
+
return 1;
|
|
291
|
+
}
|
|
292
|
+
// The id goes to stdout alone, so `$(darwin trajectory fork <id>)` is usable;
|
|
293
|
+
// everything explanatory is a stderr diagnostic, as in headless mode.
|
|
294
|
+
io.out(`${result.sessionId}\n`);
|
|
295
|
+
io.err(`forked ${result.sourceId} → ${result.sessionId}\n`);
|
|
296
|
+
for (const copied of result.copied)
|
|
297
|
+
io.err(` copied ${copied}\n`);
|
|
298
|
+
if (!result.trajectoryCopied)
|
|
299
|
+
io.err(' source had no trajectory record to carry over\n');
|
|
300
|
+
io.err(` open it with: darwin --session ${result.sessionId}\n`);
|
|
301
|
+
return 0;
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=cli-trajectory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-trajectory.js","sourceRoot":"","sources":["../../src/cli-trajectory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,EACL,iBAAiB,EACjB,aAAa,GAGd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAwB,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,kFAAkF;AAClF,MAAM,QAAQ,GAAG,QAAQ,CAAC;AAE1B,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,kBAAkB;;;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CAAC,CAAC;IAC1F,EAAE,CAAC,GAAG,CAAC,oCAAoC,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC;IACjE,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const HELP_FLAGS: readonly ['--help', '-h'];
|
|
2
|
+
export declare const VERSION_FLAGS: readonly ['--version', '-V'];
|
|
3
|
+
/** The complete grammar, exactly as `darwin --help` prints it (trailing newline included). */
|
|
4
|
+
export declare const CLI_USAGE = "Usage: darwin [--resume [<id>]|--session <id>] [--permission-mode <default|auto|plan|yolo>] [--yolo]\n darwin -p <message> [--output-format text|json|stream-json]\n [--continue|--resume [<id>]|--session <id>] [permission flags]\n [--max-model-calls <n>] [--context-offload] [--compact-before]\n darwin sessions\n darwin doctor\n darwin trajectory <list|search|replay|fork> \u2026\n darwin --help | -h\n darwin --version | -V\n\n--context-offload force-enables the default-on offloader for this process; it never persists.\nPrint-only flags: --output-format, --max-model-calls, --context-offload, --compact-before, --continue.\nWith -p, piped (non-TTY) stdin is read to EOF and appended to <message> as one delimited block (256 KiB cap).\n";
|
|
5
|
+
/** The one hint every usage error appends after its `error:` line. */
|
|
6
|
+
export declare const CLI_HELP_HINT = "Run `darwin --help` for usage.";
|
|
7
|
+
/**
|
|
8
|
+
* The one shape every usage error takes on stderr: the exact parser message (tests pin
|
|
9
|
+
* those strings) on the `error:` line, then the single `--help` hint. Callers set exit 2.
|
|
10
|
+
*/
|
|
11
|
+
export declare function usageErrorText(message: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* The stdout text for a `--help`/`--version` invocation, or `undefined` when argv asks
|
|
14
|
+
* for neither. Either flag anywhere in argv wins over everything else — subcommands,
|
|
15
|
+
* `-p`, unknown flags — and help wins over version, so the answer is decided before
|
|
16
|
+
* any other parser sees the arguments.
|
|
17
|
+
*/
|
|
18
|
+
export declare function localCliAnswer(argv: readonly string[]): string | undefined;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `darwin` command-line grammar and the two local answers derived from it:
|
|
3
|
+
* `--help`/`-h` and `--version`/`-V`.
|
|
4
|
+
*
|
|
5
|
+
* This module is the single source of the usage text. `cli.ts` prints it, its header
|
|
6
|
+
* comment points here instead of repeating it, and `docs/user-guide/reference.md`
|
|
7
|
+
* quotes it verbatim (pinned by `spike/verify-cli-args.ts`), so the three cannot drift.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately imports nothing beyond `version.ts`: answering `--help` or `--version`
|
|
10
|
+
* must stay a local, write-free operation that reaches no runtime, config, model, SDK
|
|
11
|
+
* or Ink module. `spike/verify-cli-args.ts` asserts that over the import graph.
|
|
12
|
+
*/
|
|
13
|
+
import { DARWIN_VERSION } from './version.js';
|
|
14
|
+
export const HELP_FLAGS = ['--help', '-h'];
|
|
15
|
+
export const VERSION_FLAGS = ['--version', '-V'];
|
|
16
|
+
/** The complete grammar, exactly as `darwin --help` prints it (trailing newline included). */
|
|
17
|
+
export const CLI_USAGE = `Usage: darwin [--resume [<id>]|--session <id>] [--permission-mode <default|auto|plan|yolo>] [--yolo]
|
|
18
|
+
darwin -p <message> [--output-format text|json|stream-json]
|
|
19
|
+
[--continue|--resume [<id>]|--session <id>] [permission flags]
|
|
20
|
+
[--max-model-calls <n>] [--context-offload] [--compact-before]
|
|
21
|
+
darwin sessions
|
|
22
|
+
darwin doctor
|
|
23
|
+
darwin trajectory <list|search|replay|fork> …
|
|
24
|
+
darwin --help | -h
|
|
25
|
+
darwin --version | -V
|
|
26
|
+
|
|
27
|
+
--context-offload force-enables the default-on offloader for this process; it never persists.
|
|
28
|
+
Print-only flags: --output-format, --max-model-calls, --context-offload, --compact-before, --continue.
|
|
29
|
+
With -p, piped (non-TTY) stdin is read to EOF and appended to <message> as one delimited block (256 KiB cap).
|
|
30
|
+
`;
|
|
31
|
+
/** The one hint every usage error appends after its `error:` line. */
|
|
32
|
+
export const CLI_HELP_HINT = 'Run `darwin --help` for usage.';
|
|
33
|
+
/**
|
|
34
|
+
* The one shape every usage error takes on stderr: the exact parser message (tests pin
|
|
35
|
+
* those strings) on the `error:` line, then the single `--help` hint. Callers set exit 2.
|
|
36
|
+
*/
|
|
37
|
+
export function usageErrorText(message) {
|
|
38
|
+
return `error: ${message}\n${CLI_HELP_HINT}\n`;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The stdout text for a `--help`/`--version` invocation, or `undefined` when argv asks
|
|
42
|
+
* for neither. Either flag anywhere in argv wins over everything else — subcommands,
|
|
43
|
+
* `-p`, unknown flags — and help wins over version, so the answer is decided before
|
|
44
|
+
* any other parser sees the arguments.
|
|
45
|
+
*/
|
|
46
|
+
export function localCliAnswer(argv) {
|
|
47
|
+
if (HELP_FLAGS.some((flag) => argv.includes(flag)))
|
|
48
|
+
return CLI_USAGE;
|
|
49
|
+
if (VERSION_FLAGS.some((flag) => argv.includes(flag)))
|
|
50
|
+
return `darwin ${DARWIN_VERSION}\n`;
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=cli-usage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-usage.js","sourceRoot":"","sources":["../../src/cli-usage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAU,CAAC;AACpD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,WAAW,EAAE,IAAI,CAAU,CAAC;AAE1D,8FAA8F;AAC9F,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;CAaxB,CAAC;AAEF,sEAAsE;AACtE,MAAM,CAAC,MAAM,aAAa,GAAG,gCAAgC,CAAC;AAE9D;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,OAAO,UAAU,OAAO,KAAK,aAAa,IAAI,CAAC;AACjD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,IAAuB;IACpD,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACrE,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,UAAU,cAAc,IAAI,CAAC;IAC3F,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/src/cli.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `darwin` entry point: one preflight, then the program.
|
|
4
|
+
*
|
|
5
|
+
* This module's static imports must never reach `@strands-agents/sdk`. ESM links the
|
|
6
|
+
* whole static import graph before it runs a single statement of the entry module, so
|
|
7
|
+
* on an SDK without darwin's pinned patch a static import of `./cli-main.js` would die
|
|
8
|
+
* at link time with the raw `does not provide an export named
|
|
9
|
+
* 'DEFAULT_SUMMARIZATION_PROMPT'` — no code of ours would get to explain it. Hence the
|
|
10
|
+
* shape here: check the installed SDK's marker files (`sdk-patch-preflight.ts`, node
|
|
11
|
+
* built-ins plus `version.ts` only), print one bounded refusal and exit nonzero if
|
|
12
|
+
* they are unpatched, and only then `import()` the rest. `spike/verify-npm-patch-format.ts`
|
|
13
|
+
* pins the import graph; `spike/verify-npm-package.ts` runs the real `--ignore-scripts`
|
|
14
|
+
* install against it.
|
|
15
|
+
*
|
|
16
|
+
* Routing, every command and the usage grammar live in `cli-main.ts` / `cli-usage.ts`.
|
|
17
|
+
*/
|
|
18
|
+
import process from 'node:process';
|
|
19
|
+
import { SDK_PATCH_PREFLIGHT_EXIT_CODE, sdkPatchPreflight } from './sdk-patch-preflight.js';
|
|
20
|
+
const refusal = sdkPatchPreflight();
|
|
21
|
+
if (refusal !== undefined) {
|
|
22
|
+
process.stderr.write(refusal);
|
|
23
|
+
process.exitCode = SDK_PATCH_PREFLIGHT_EXIT_CODE;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
const { main } = await import('./cli-main.js');
|
|
27
|
+
await main();
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE5F,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;AACpC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;IAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,QAAQ,GAAG,6BAA6B,CAAC;AACnD,CAAC;KAAM,CAAC;IACN,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;IAC/C,MAAM,IAAI,EAAE,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const COMMANDS_DIRNAME = "commands";
|
|
2
|
+
export declare const ARGUMENTS_PLACEHOLDER = "$ARGUMENTS";
|
|
3
|
+
/** Commands shown in completion, in their stable display order. */
|
|
4
|
+
export declare const BUILTIN_COMMAND_NAMES: readonly ['agents', 'clear', 'compact', 'context', 'copy', 'effort', 'exit', 'export', 'help', 'mcp', 'memory', 'mode', 'model', 'permissions', 'rewind', 'status', 'tasks', 'trajectory', 'usage', 'workflow'];
|
|
5
|
+
/**
|
|
6
|
+
* One-phrase completion-row descriptions, total over {@link BUILTIN_COMMAND_NAMES}
|
|
7
|
+
* by construction: the `Record` over the name union makes a missing or extra
|
|
8
|
+
* entry a compile error.
|
|
9
|
+
*/
|
|
10
|
+
export declare const BUILTIN_COMMAND_DESCRIPTIONS: Readonly<Record<(typeof BUILTIN_COMMAND_NAMES)[number], string>>;
|
|
11
|
+
/**
|
|
12
|
+
* The description for a completion row, or nothing for custom commands and
|
|
13
|
+
* skills. `Object.hasOwn` rather than indexing: a custom command may be named
|
|
14
|
+
* `constructor`, and prototype pollution is not a description.
|
|
15
|
+
*/
|
|
16
|
+
export declare function builtinCommandDescription(name: string): string | undefined;
|
|
17
|
+
export interface CustomCommand {
|
|
18
|
+
name: string;
|
|
19
|
+
/** Absolute path to the Markdown source. */
|
|
20
|
+
file: string;
|
|
21
|
+
content: string;
|
|
22
|
+
}
|
|
23
|
+
export interface CustomCommandProblem {
|
|
24
|
+
file: string;
|
|
25
|
+
reason: string;
|
|
26
|
+
}
|
|
27
|
+
export interface CustomCommandRegistry {
|
|
28
|
+
commands: CustomCommand[];
|
|
29
|
+
problems: CustomCommandProblem[];
|
|
30
|
+
}
|
|
31
|
+
export interface ExpandedCustomCommand {
|
|
32
|
+
command: CustomCommand;
|
|
33
|
+
message: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Loads direct `.md` children of `<root>/.darwin/commands/`.
|
|
37
|
+
*
|
|
38
|
+
* Built-ins and skills own their slash names first. Bad entries are isolated and
|
|
39
|
+
* reported so one typo cannot hide otherwise valid project commands.
|
|
40
|
+
*/
|
|
41
|
+
export declare function loadCustomCommands(root: string, skillNames: readonly string[]): Promise<CustomCommandRegistry>;
|
|
42
|
+
/** Expands a known custom slash command, leaving all other input untouched. */
|
|
43
|
+
export declare function expandCustomCommand(registry: CustomCommandRegistry, input: string): ExpandedCustomCommand | null;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { lstat, readFile, readdir, realpath } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { extensionRoots } from '../paths.js';
|
|
4
|
+
export const COMMANDS_DIRNAME = 'commands';
|
|
5
|
+
export const ARGUMENTS_PLACEHOLDER = '$ARGUMENTS';
|
|
6
|
+
/** Commands shown in completion, in their stable display order. */
|
|
7
|
+
export const BUILTIN_COMMAND_NAMES = ['agents', 'clear', 'compact', 'context', 'copy', 'effort', 'exit', 'export', 'help', 'mcp', 'memory', 'mode', 'model', 'permissions', 'rewind', 'status', 'tasks', 'trajectory', 'usage', 'workflow'];
|
|
8
|
+
/**
|
|
9
|
+
* One-phrase completion-row descriptions, total over {@link BUILTIN_COMMAND_NAMES}
|
|
10
|
+
* by construction: the `Record` over the name union makes a missing or extra
|
|
11
|
+
* entry a compile error.
|
|
12
|
+
*/
|
|
13
|
+
export const BUILTIN_COMMAND_DESCRIPTIONS = {
|
|
14
|
+
// Dispatch *runs*, not the catalogue of definitions the header lists.
|
|
15
|
+
agents: 'list or cancel subagent dispatches',
|
|
16
|
+
// Starts a new session; the one being left stays on disk and resumable.
|
|
17
|
+
clear: 'start a new session',
|
|
18
|
+
// `/compact <focus>` steers one summary; bare `/compact` is the SDK default prompt.
|
|
19
|
+
compact: 'summarize older conversation, optionally around a focus',
|
|
20
|
+
context: 'estimated context size',
|
|
21
|
+
// The last *completed* answer's transcript text, over OSC 52 — so it works over SSH.
|
|
22
|
+
copy: 'copy the last answer to the clipboard',
|
|
23
|
+
effort: 'set thinking depth',
|
|
24
|
+
exit: 'quit darwin',
|
|
25
|
+
// Writes a file at the named path, nothing else: no clipboard, no $EDITOR. The
|
|
26
|
+
// transcript is the trajectory record's replay projection, so /export and
|
|
27
|
+
// `darwin trajectory replay` cannot disagree.
|
|
28
|
+
export: 'write this session\u2019s transcript to a file',
|
|
29
|
+
help: 'commands, prompt syntax, and keys',
|
|
30
|
+
// Configured servers with their connection state — a failed one is named as
|
|
31
|
+
// failed here instead of silently contributing zero tools.
|
|
32
|
+
mcp: 'MCP servers and their tools',
|
|
33
|
+
// Local inspection and explicit user management of enabled project memory.
|
|
34
|
+
memory: 'list, show, remember, or forget project memory',
|
|
35
|
+
// Session-scoped enforcement policy, not the model: /mode sits next to /model in
|
|
36
|
+
// the menu, so both descriptions have to say which is which.
|
|
37
|
+
mode: 'set the permission mode',
|
|
38
|
+
model: 'list or switch models',
|
|
39
|
+
// Allow-rules, not the mode: /permissions lists and revokes what runs silently,
|
|
40
|
+
// /mode moves how much everything else asks.
|
|
41
|
+
permissions: 'list or revoke allow-rules',
|
|
42
|
+
// Conversation only: branches from an SDK checkpoint and never rolls back files.
|
|
43
|
+
rewind: 'branch from an earlier completed prompt',
|
|
44
|
+
// The consolidated read-only session report — configuration and live state in
|
|
45
|
+
// one transcript block, for when the header has scrolled away.
|
|
46
|
+
status: 'session configuration and state',
|
|
47
|
+
tasks: 'list background jobs',
|
|
48
|
+
// The record this session is writing, not the CLI's search/fork/replay verbs.
|
|
49
|
+
trajectory: 'this session\u2019s recorded trajectory',
|
|
50
|
+
usage: 'token counts this run',
|
|
51
|
+
// A prompt expansion, not an executor: the model still decomposes the DAG.
|
|
52
|
+
workflow: 'orchestrate a task with the workflow tool',
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* The description for a completion row, or nothing for custom commands and
|
|
56
|
+
* skills. `Object.hasOwn` rather than indexing: a custom command may be named
|
|
57
|
+
* `constructor`, and prototype pollution is not a description.
|
|
58
|
+
*/
|
|
59
|
+
export function builtinCommandDescription(name) {
|
|
60
|
+
return Object.hasOwn(BUILTIN_COMMAND_DESCRIPTIONS, name)
|
|
61
|
+
? BUILTIN_COMMAND_DESCRIPTIONS[name]
|
|
62
|
+
: undefined;
|
|
63
|
+
}
|
|
64
|
+
/** `/quit` works as an alias but deliberately does not consume a completion row. */
|
|
65
|
+
const RESERVED_COMMAND_NAMES = [...BUILTIN_COMMAND_NAMES, 'quit'];
|
|
66
|
+
/**
|
|
67
|
+
* Loads direct `.md` children of `<root>/.darwin/commands/`.
|
|
68
|
+
*
|
|
69
|
+
* Built-ins and skills own their slash names first. Bad entries are isolated and
|
|
70
|
+
* reported so one typo cannot hide otherwise valid project commands.
|
|
71
|
+
*/
|
|
72
|
+
export async function loadCustomCommands(root, skillNames) {
|
|
73
|
+
const commandDirs = extensionRoots(root).map(({ root: extensionRoot }) => path.join(extensionRoot, COMMANDS_DIRNAME));
|
|
74
|
+
const commands = [];
|
|
75
|
+
const problems = [];
|
|
76
|
+
const claimed = new Map();
|
|
77
|
+
for (const name of RESERVED_COMMAND_NAMES)
|
|
78
|
+
claimed.set(name.toLowerCase(), `built-in command /${name}`);
|
|
79
|
+
for (const name of skillNames)
|
|
80
|
+
claimed.set(name.toLowerCase(), `skill /${name}`);
|
|
81
|
+
for (const commandsDir of [...new Set(commandDirs)]) {
|
|
82
|
+
let entries;
|
|
83
|
+
try {
|
|
84
|
+
entries = await readdir(commandsDir, { withFileTypes: true });
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
entries.sort((a, b) => a.name.localeCompare(b.name));
|
|
90
|
+
for (const entry of entries) {
|
|
91
|
+
if ((!entry.isFile() && !entry.isSymbolicLink()) || path.extname(entry.name).toLowerCase() !== '.md')
|
|
92
|
+
continue;
|
|
93
|
+
const file = path.join(commandsDir, entry.name);
|
|
94
|
+
const name = entry.name.slice(0, -path.extname(entry.name).length);
|
|
95
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(name)) {
|
|
96
|
+
problems.push({
|
|
97
|
+
file,
|
|
98
|
+
reason: 'command name must contain only letters, numbers, hyphens and underscores',
|
|
99
|
+
});
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const normalized = name.toLowerCase();
|
|
103
|
+
const owner = claimed.get(normalized);
|
|
104
|
+
if (owner !== undefined) {
|
|
105
|
+
problems.push({ file, reason: `command name "${name}" conflicts with ${owner}` });
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
let content;
|
|
109
|
+
try {
|
|
110
|
+
if (entry.isSymbolicLink()) {
|
|
111
|
+
const target = await realpath(file);
|
|
112
|
+
if (!(await lstat(target)).isFile())
|
|
113
|
+
throw new Error(`symlink target is not a regular file: ${target}`);
|
|
114
|
+
}
|
|
115
|
+
// Read through the discovered path after validation. This preserves the
|
|
116
|
+
// configured source identity and does not pin execution to a stale target
|
|
117
|
+
// if the direct symlink is replaced during startup.
|
|
118
|
+
content = await readFile(file, 'utf8');
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
problems.push({
|
|
122
|
+
file,
|
|
123
|
+
reason: `could not read file: ${error instanceof Error ? error.message : String(error)}`,
|
|
124
|
+
});
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (content.trim() === '') {
|
|
128
|
+
problems.push({ file, reason: 'command file is empty' });
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
claimed.set(normalized, file);
|
|
132
|
+
commands.push({ name, file, content });
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
commands.sort((a, b) => a.name.localeCompare(b.name));
|
|
136
|
+
return { commands, problems };
|
|
137
|
+
}
|
|
138
|
+
/** Expands a known custom slash command, leaving all other input untouched. */
|
|
139
|
+
export function expandCustomCommand(registry, input) {
|
|
140
|
+
const trimmed = input.trim();
|
|
141
|
+
if (!trimmed.startsWith('/'))
|
|
142
|
+
return null;
|
|
143
|
+
const withoutSlash = trimmed.slice(1);
|
|
144
|
+
const separator = withoutSlash.search(/\s/);
|
|
145
|
+
const name = separator === -1 ? withoutSlash : withoutSlash.slice(0, separator);
|
|
146
|
+
const args = separator === -1 ? '' : withoutSlash.slice(separator).trim();
|
|
147
|
+
const command = registry.commands.find((candidate) => candidate.name.toLowerCase() === name.toLowerCase());
|
|
148
|
+
if (command === undefined)
|
|
149
|
+
return null;
|
|
150
|
+
return {
|
|
151
|
+
command,
|
|
152
|
+
message: command.content.replaceAll(ARGUMENTS_PLACEHOLDER, args),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=custom-commands.js.map
|
|
@@ -0,0 +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