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,310 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The append-only writer.
|
|
3
|
+
*
|
|
4
|
+
* Three properties are load-bearing and easy to lose:
|
|
5
|
+
*
|
|
6
|
+
* 1. **It cannot affect a turn.** `record()` is synchronous, catches everything,
|
|
7
|
+
* and performs no I/O; a turn's records are formatted as events arrive and
|
|
8
|
+
* flushed as one append when the turn ends. No await ever enters the streaming
|
|
9
|
+
* path, and no failure can reach the caller of `AgentRuntime.send`.
|
|
10
|
+
* 2. **It only ever appends.** Bytes already on disk are never rewritten,
|
|
11
|
+
* truncated or reordered. The one thing it reads is the tail, once, to continue
|
|
12
|
+
* the sequence numbering; and if the file does not end in a newline it prefixes
|
|
13
|
+
* one, so an interrupted write stays a single broken line instead of being glued
|
|
14
|
+
* onto the next valid record.
|
|
15
|
+
* 3. **It is bounded.** Payload caps live in `record.ts`; this file owns the
|
|
16
|
+
* per-file budget and stops recording when it is reached.
|
|
17
|
+
*
|
|
18
|
+
* See `docs/architecture/load-bearing-decisions.md` § Session trajectory.
|
|
19
|
+
*/
|
|
20
|
+
import { open } from 'node:fs/promises';
|
|
21
|
+
import type { AgentStreamEvent } from '@strands-agents/sdk';
|
|
22
|
+
import { type CallSpendProjector, type TrajectoryRecord, type Truncation, type TurnSpendMeter } from './record.js';
|
|
23
|
+
/**
|
|
24
|
+
* Everything about a record except the file-scoped fields the writer assigns.
|
|
25
|
+
*
|
|
26
|
+
* Distributed over the union on purpose: a plain `Omit` over a union collapses to
|
|
27
|
+
* the envelope's shared keys, which would silently accept a `userInput` record
|
|
28
|
+
* carrying a `stopReason`.
|
|
29
|
+
*/
|
|
30
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
31
|
+
type PendingRecord = DistributiveOmit<TrajectoryRecord, 'v' | 'seq' | 't'>;
|
|
32
|
+
export interface RecorderRunInfo {
|
|
33
|
+
session: string;
|
|
34
|
+
agentId: string;
|
|
35
|
+
darwinVersion: string;
|
|
36
|
+
provider: string;
|
|
37
|
+
model: string;
|
|
38
|
+
permissionMode: string;
|
|
39
|
+
thinkingEffort: string | undefined;
|
|
40
|
+
resumed: boolean;
|
|
41
|
+
restoredMessages: number;
|
|
42
|
+
}
|
|
43
|
+
export declare const INPUT_DURABILITY_TIMEOUT_MS = 2000;
|
|
44
|
+
export type TurnSettlement = {
|
|
45
|
+
readonly durable: true;
|
|
46
|
+
readonly session: string;
|
|
47
|
+
readonly turn: number;
|
|
48
|
+
readonly seq: number;
|
|
49
|
+
readonly at: string;
|
|
50
|
+
readonly stopReason: string | undefined;
|
|
51
|
+
readonly failure: boolean;
|
|
52
|
+
readonly partial: boolean;
|
|
53
|
+
} | {
|
|
54
|
+
readonly durable: false;
|
|
55
|
+
readonly turn: number;
|
|
56
|
+
readonly reason: string;
|
|
57
|
+
};
|
|
58
|
+
export interface RecorderOptions {
|
|
59
|
+
file: string;
|
|
60
|
+
/** Written into the `runStarted` record this process appends first. */
|
|
61
|
+
run: RecorderRunInfo;
|
|
62
|
+
/** Injected for tests that need a failing filesystem; production uses `fs.open`. */
|
|
63
|
+
openFile?: typeof open;
|
|
64
|
+
/** Injectable so the bounded timeout path can be proved without a slow suite. */
|
|
65
|
+
inputDurabilityTimeoutMs?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Per-file byte budget; defaults to {@link MAX_FILE_BYTES}.
|
|
68
|
+
*
|
|
69
|
+
* Injectable for the same reason `openFile` is: the budget path latches recording
|
|
70
|
+
* off for the rest of a session, and a behaviour that only appears after 64 MiB of
|
|
71
|
+
* real writes is a behaviour nothing tests.
|
|
72
|
+
*/
|
|
73
|
+
maxBytes?: number;
|
|
74
|
+
/** Detached observer runs exactly once after the closing append settles. */
|
|
75
|
+
onTurnSettled?: (settlement: TurnSettlement) => void;
|
|
76
|
+
}
|
|
77
|
+
/** What `/trajectory` and the headless diagnostic report about this run. */
|
|
78
|
+
export interface TrajectoryStatus {
|
|
79
|
+
file: string;
|
|
80
|
+
/** Records appended by this process. */
|
|
81
|
+
recordsThisRun: number;
|
|
82
|
+
/** Truncations recorded by this process. */
|
|
83
|
+
truncationsThisRun: number;
|
|
84
|
+
/** Bytes appended by this process. */
|
|
85
|
+
bytesThisRun: number;
|
|
86
|
+
/** Set once, on the first failure or when the budget stops recording. */
|
|
87
|
+
problem: string | undefined;
|
|
88
|
+
/** False once a problem or the budget has stopped it. */
|
|
89
|
+
active: boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* One turn's observer. The opening `userInput` is appended before invocation; later
|
|
93
|
+
* records accumulate during the stream and append together at the end, so nothing
|
|
94
|
+
* between two events touches the disk.
|
|
95
|
+
*/
|
|
96
|
+
export declare class TurnRecording {
|
|
97
|
+
private readonly recorder;
|
|
98
|
+
readonly turn: number;
|
|
99
|
+
/**
|
|
100
|
+
* Reads the turn's spend when the turn closes. Undefined when nothing is metering —
|
|
101
|
+
* which the record says by omitting the field, never by writing zeros.
|
|
102
|
+
*/
|
|
103
|
+
private readonly spend?;
|
|
104
|
+
/**
|
|
105
|
+
* Projects one completed call's own counters for its `modelCall` record.
|
|
106
|
+
* Undefined when nothing is projecting, and the records then simply carry no
|
|
107
|
+
* `spend` — the call lines still exist, priced unknown rather than zero.
|
|
108
|
+
*/
|
|
109
|
+
private readonly callSpend?;
|
|
110
|
+
private readonly recorded;
|
|
111
|
+
private readonly dropped;
|
|
112
|
+
private readonly startedAt;
|
|
113
|
+
private partialText;
|
|
114
|
+
private stopReason;
|
|
115
|
+
private failure;
|
|
116
|
+
private ended;
|
|
117
|
+
/** The agent loop's latest request-size estimate this turn; absent until reported. */
|
|
118
|
+
private lastProjectedInputTokens;
|
|
119
|
+
constructor(recorder: TrajectoryRecorder, turn: number, input: string,
|
|
120
|
+
/**
|
|
121
|
+
* Reads the turn's spend when the turn closes. Undefined when nothing is metering —
|
|
122
|
+
* which the record says by omitting the field, never by writing zeros.
|
|
123
|
+
*/
|
|
124
|
+
spend?: TurnSpendMeter | undefined,
|
|
125
|
+
/**
|
|
126
|
+
* Projects one completed call's own counters for its `modelCall` record.
|
|
127
|
+
* Undefined when nothing is projecting, and the records then simply carry no
|
|
128
|
+
* `spend` — the call lines still exist, priced unknown rather than zero.
|
|
129
|
+
*/
|
|
130
|
+
callSpend?: CallSpendProjector | undefined);
|
|
131
|
+
/**
|
|
132
|
+
* Makes the already-observed input readable before the Agent can invoke anything.
|
|
133
|
+
* This is the only recorder operation the runtime awaits; it is bounded and
|
|
134
|
+
* resolves after recorder failure so observation can never kill the turn.
|
|
135
|
+
*/
|
|
136
|
+
inputDurable(): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Observes one stream event. Synchronous, and swallows its own failures on
|
|
139
|
+
* purpose: an observer that could throw here would become a second way for a
|
|
140
|
+
* turn to die, which is the whole thing this design exists to prevent.
|
|
141
|
+
*/
|
|
142
|
+
record(event: AgentStreamEvent): void;
|
|
143
|
+
/**
|
|
144
|
+
* Buffers one bounded `modelCall` record per **completed** model call (issue #8
|
|
145
|
+
* follow-up A). Synchronous and I/O-free like every other observation — it rides
|
|
146
|
+
* the turn's ordinary closing append.
|
|
147
|
+
*
|
|
148
|
+
* The raw events stay dropped by the allowlist and stay *counted* as dropped;
|
|
149
|
+
* this is a derived projection like `partialText` and `spend`, not a fifth
|
|
150
|
+
* recorded event type. A failed attempt (`stopData` absent) writes nothing —
|
|
151
|
+
* the failure is `turnEnded.failure`'s story, and inventing a call line for a
|
|
152
|
+
* request no provider answered would price something that never completed.
|
|
153
|
+
*/
|
|
154
|
+
private observeModelCall;
|
|
155
|
+
/**
|
|
156
|
+
* One call's spend, or `undefined` when it could not be projected — the same
|
|
157
|
+
* belt-to-braces {@link readSpend} wears: the injected projector is documented as
|
|
158
|
+
* non-throwing, and a broken one must cost the price tag only.
|
|
159
|
+
*/
|
|
160
|
+
private projectCallSpend;
|
|
161
|
+
/**
|
|
162
|
+
* Notes that the turn's stream threw, before {@link end} closes the turn.
|
|
163
|
+
*
|
|
164
|
+
* Same rules as {@link record}: synchronous, no I/O, and it swallows its own
|
|
165
|
+
* failures. The error itself is not touched — the caller of `AgentRuntime.send`
|
|
166
|
+
* receives the identical object, and this only reads its class and message.
|
|
167
|
+
*/
|
|
168
|
+
failed(error: unknown): void;
|
|
169
|
+
/** Closes the turn and schedules the append. Never awaited by the stream. */
|
|
170
|
+
end(): void;
|
|
171
|
+
/**
|
|
172
|
+
* The turn's spend, or `undefined` when it could not be read.
|
|
173
|
+
*
|
|
174
|
+
* The injected meter is documented as non-throwing, and this catch is the belt to that
|
|
175
|
+
* braces: an observer reading a number must not be able to end a turn or stop a
|
|
176
|
+
* session's recording, so a broken meter degrades to a record that says nothing about
|
|
177
|
+
* price rather than to a record that is not written.
|
|
178
|
+
*/
|
|
179
|
+
private readSpend;
|
|
180
|
+
/**
|
|
181
|
+
* Tallies the event and keeps the two things the allowlist would otherwise lose:
|
|
182
|
+
* the stop reason, and unassembled assistant text.
|
|
183
|
+
*
|
|
184
|
+
* Text deltas are counted and dropped like any other `modelStreamUpdateEvent`,
|
|
185
|
+
* but their text is accumulated here so a cancelled turn's unfinished answer
|
|
186
|
+
* still lands in `turnEnded.partialText` — the same text `flushLiveText` puts
|
|
187
|
+
* into live history. An assembled `contentBlockEvent` clears it, because that
|
|
188
|
+
* block is recorded in full and is authoritative.
|
|
189
|
+
*
|
|
190
|
+
* `agentResultEvent` is the only source of `stopReason`, and a thrown turn never
|
|
191
|
+
* emits one — that turn is described by `failure` instead (see {@link failed}), not
|
|
192
|
+
* by a stop reason this code invented.
|
|
193
|
+
*/
|
|
194
|
+
private tally;
|
|
195
|
+
}
|
|
196
|
+
export declare class TrajectoryRecorder {
|
|
197
|
+
private readonly file;
|
|
198
|
+
private readonly openFile;
|
|
199
|
+
private readonly run;
|
|
200
|
+
private readonly maxBytes;
|
|
201
|
+
private readonly inputDurabilityTimeoutMs;
|
|
202
|
+
/**
|
|
203
|
+
* When this process started recording.
|
|
204
|
+
*
|
|
205
|
+
* Used for the `runStarted` record rather than the moment of the first flush: the
|
|
206
|
+
* header is written ahead of the first turn's records, so stamping it later would
|
|
207
|
+
* put a timestamp from *after* those events on the line that precedes them.
|
|
208
|
+
*/
|
|
209
|
+
private readonly startedAt;
|
|
210
|
+
/** Buffered-but-unwritten records, in observation order (input or turn remainder). */
|
|
211
|
+
private pending;
|
|
212
|
+
/** The serialized append chain: every write waits for the previous one. */
|
|
213
|
+
private chain;
|
|
214
|
+
/** Next sequence number to assign; recovered from the file's tail on first append. */
|
|
215
|
+
private seq;
|
|
216
|
+
private turns;
|
|
217
|
+
private opened;
|
|
218
|
+
private headerPending;
|
|
219
|
+
private active;
|
|
220
|
+
private problem;
|
|
221
|
+
private recordsThisRun;
|
|
222
|
+
private truncationsThisRun;
|
|
223
|
+
private bytesThisRun;
|
|
224
|
+
private fileBytes;
|
|
225
|
+
private readonly onTurnSettled;
|
|
226
|
+
constructor(options: RecorderOptions);
|
|
227
|
+
/**
|
|
228
|
+
* Opens a turn. Returns `undefined` once recording has stopped.
|
|
229
|
+
*
|
|
230
|
+
* The spend meter is passed in per turn rather than held by the recorder, because it
|
|
231
|
+
* measures one turn: `AgentRuntime.send` creates it before the stream and the same
|
|
232
|
+
* object answers the record here, so the record and the live last-turn report cannot
|
|
233
|
+
* be two different readings of one turn.
|
|
234
|
+
*/
|
|
235
|
+
beginTurn(input: string, spend?: TurnSpendMeter, callSpend?: CallSpendProjector): TurnRecording | undefined;
|
|
236
|
+
/** The next turn identity without opening or writing a turn. */
|
|
237
|
+
get nextTurn(): number | undefined;
|
|
238
|
+
/**
|
|
239
|
+
* Records one user-typed `!` command (SER-024). Between turns by nature — the
|
|
240
|
+
* TUI refuses to run one while a turn streams — so this is never on the
|
|
241
|
+
* streaming path: composing and buffering are synchronous and non-throwing like
|
|
242
|
+
* every other record, and the flush is the same fire-and-forget append chain a
|
|
243
|
+
* closing turn uses. `output` arrives already bounded (the SER-009 projection
|
|
244
|
+
* the screen showed); the field caps here are a backstop, not the bound.
|
|
245
|
+
*/
|
|
246
|
+
recordShellCommand(entry: {
|
|
247
|
+
command: string;
|
|
248
|
+
exitCode: number | null;
|
|
249
|
+
signal: string | null;
|
|
250
|
+
timedOut: boolean;
|
|
251
|
+
durationMs: number;
|
|
252
|
+
output: string;
|
|
253
|
+
}): void;
|
|
254
|
+
get status(): TrajectoryStatus;
|
|
255
|
+
/**
|
|
256
|
+
* Flushes the turn-opening `userInput` and waits only for this bounded barrier.
|
|
257
|
+
*
|
|
258
|
+
* Unlike stream-event observation, the runtime deliberately awaits this before it
|
|
259
|
+
* calls `Agent.stream()`. Both failure paths still resolve: a recorder can explain
|
|
260
|
+
* that it stopped, but it can never become a second reason the Agent turn stops.
|
|
261
|
+
* Detaching a timed-out chain also keeps shutdown from waiting forever on the same
|
|
262
|
+
* stuck filesystem operation.
|
|
263
|
+
*/
|
|
264
|
+
inputDurable(): Promise<void>;
|
|
265
|
+
/**
|
|
266
|
+
* Buffers one record, stamping the time it was observed.
|
|
267
|
+
*
|
|
268
|
+
* The timestamp is taken here and the sequence number at append time, and both
|
|
269
|
+
* choices are deliberate. A whole turn is appended in one write, so stamping at
|
|
270
|
+
* write time would give every event in a turn the same instant — a record that
|
|
271
|
+
* looks like it carries timing but does not. The sequence number cannot be
|
|
272
|
+
* assigned here, because the file's starting number is only known once its tail
|
|
273
|
+
* has been read, and that read must not happen on the streaming path. Array order
|
|
274
|
+
* is observation order, so the file's order is the order events happened.
|
|
275
|
+
*/
|
|
276
|
+
buffer(record: PendingRecord, trunc?: readonly Truncation[]): void;
|
|
277
|
+
/** Latches the first failure and stops recording; never rethrows. */
|
|
278
|
+
fail(error: unknown): void;
|
|
279
|
+
/**
|
|
280
|
+
* Appends everything buffered so far, chained behind any previous append.
|
|
281
|
+
*
|
|
282
|
+
* Returns nothing on purpose: event/turn-end callers cannot await this.
|
|
283
|
+
* `inputDurable()` waits through the private chain before invocation; `close()`
|
|
284
|
+
* waits through it during cleanup.
|
|
285
|
+
*/
|
|
286
|
+
flush(closesTurn?: boolean): void;
|
|
287
|
+
private publishSettlement;
|
|
288
|
+
/** Flushes and waits, so a turn's records are durable before the process exits. */
|
|
289
|
+
close(): Promise<void>;
|
|
290
|
+
private append;
|
|
291
|
+
private encode;
|
|
292
|
+
/** The `runStarted` record, emitted exactly once, ahead of this process's first batch. */
|
|
293
|
+
private header;
|
|
294
|
+
/**
|
|
295
|
+
* One-time setup for the first append of this process: creates the directory,
|
|
296
|
+
* recovers the sequence number, and decides whether a newline guard is needed.
|
|
297
|
+
* Returns the newline to prefix, if any. Nothing here modifies existing bytes.
|
|
298
|
+
*/
|
|
299
|
+
private prepare;
|
|
300
|
+
/**
|
|
301
|
+
* Reads at most the last {@link TAIL_READ_BYTES} to find the last complete
|
|
302
|
+
* record's sequence number, so numbering continues across runs and a gap really
|
|
303
|
+
* does mean loss. A tail holding no complete record restarts at zero: inventing a
|
|
304
|
+
* number would be worse than a visible restart.
|
|
305
|
+
*/
|
|
306
|
+
private readTail;
|
|
307
|
+
/** Appends the final record and latches recording off for this session. */
|
|
308
|
+
private stopForBudget;
|
|
309
|
+
}
|
|
310
|
+
export {};
|