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.
Files changed (417) hide show
  1. package/README.md +140 -0
  2. package/README.zh-CN.md +140 -0
  3. package/dist/patches/@strands-agents+sdk+1.16.0.patch +1443 -0
  4. package/dist/src/agent/background-delegation.d.ts +67 -0
  5. package/dist/src/agent/background-delegation.js +159 -0
  6. package/dist/src/agent/background-delegation.js.map +1 -0
  7. package/dist/src/agent/call-stats.d.ts +118 -0
  8. package/dist/src/agent/call-stats.js +128 -0
  9. package/dist/src/agent/call-stats.js.map +1 -0
  10. package/dist/src/agent/compact.d.ts +108 -0
  11. package/dist/src/agent/compact.js +192 -0
  12. package/dist/src/agent/compact.js.map +1 -0
  13. package/dist/src/agent/context-anchor.d.ts +64 -0
  14. package/dist/src/agent/context-anchor.js +43 -0
  15. package/dist/src/agent/context-anchor.js.map +1 -0
  16. package/dist/src/agent/cost.d.ts +56 -0
  17. package/dist/src/agent/cost.js +44 -0
  18. package/dist/src/agent/cost.js.map +1 -0
  19. package/dist/src/agent/diagnostics.d.ts +212 -0
  20. package/dist/src/agent/diagnostics.js +374 -0
  21. package/dist/src/agent/diagnostics.js.map +1 -0
  22. package/dist/src/agent/instructions.d.ts +54 -0
  23. package/dist/src/agent/instructions.js +118 -0
  24. package/dist/src/agent/instructions.js.map +1 -0
  25. package/dist/src/agent/max-tokens-recovery.d.ts +17 -0
  26. package/dist/src/agent/max-tokens-recovery.js +65 -0
  27. package/dist/src/agent/max-tokens-recovery.js.map +1 -0
  28. package/dist/src/agent/model-call-budget.d.ts +8 -0
  29. package/dist/src/agent/model-call-budget.js +24 -0
  30. package/dist/src/agent/model-call-budget.js.map +1 -0
  31. package/dist/src/agent/model-retry.d.ts +134 -0
  32. package/dist/src/agent/model-retry.js +256 -0
  33. package/dist/src/agent/model-retry.js.map +1 -0
  34. package/dist/src/agent/permission-rules.d.ts +47 -0
  35. package/dist/src/agent/permission-rules.js +260 -0
  36. package/dist/src/agent/permission-rules.js.map +1 -0
  37. package/dist/src/agent/permission.d.ts +361 -0
  38. package/dist/src/agent/permission.js +797 -0
  39. package/dist/src/agent/permission.js.map +1 -0
  40. package/dist/src/agent/prompt-cache.d.ts +66 -0
  41. package/dist/src/agent/prompt-cache.js +194 -0
  42. package/dist/src/agent/prompt-cache.js.map +1 -0
  43. package/dist/src/agent/refusal.d.ts +20 -0
  44. package/dist/src/agent/refusal.js +23 -0
  45. package/dist/src/agent/refusal.js.map +1 -0
  46. package/dist/src/agent/retry-guard.d.ts +26 -0
  47. package/dist/src/agent/retry-guard.js +193 -0
  48. package/dist/src/agent/retry-guard.js.map +1 -0
  49. package/dist/src/agent/rewind.d.ts +29 -0
  50. package/dist/src/agent/rewind.js +118 -0
  51. package/dist/src/agent/rewind.js.map +1 -0
  52. package/dist/src/agent/runtime.d.ts +814 -0
  53. package/dist/src/agent/runtime.js +1596 -0
  54. package/dist/src/agent/runtime.js.map +1 -0
  55. package/dist/src/agent/safety-classifier.d.ts +11 -0
  56. package/dist/src/agent/safety-classifier.js +0 -0
  57. package/dist/src/agent/safety-classifier.js.map +1 -0
  58. package/dist/src/agent/sdk-logging.d.ts +49 -0
  59. package/dist/src/agent/sdk-logging.js +110 -0
  60. package/dist/src/agent/sdk-logging.js.map +1 -0
  61. package/dist/src/agent/session.d.ts +102 -0
  62. package/dist/src/agent/session.js +244 -0
  63. package/dist/src/agent/session.js.map +1 -0
  64. package/dist/src/agent/stream-resumption.d.ts +16 -0
  65. package/dist/src/agent/stream-resumption.js +33 -0
  66. package/dist/src/agent/stream-resumption.js.map +1 -0
  67. package/dist/src/agent/system-prompt.d.ts +50 -0
  68. package/dist/src/agent/system-prompt.js +161 -0
  69. package/dist/src/agent/system-prompt.js.map +1 -0
  70. package/dist/src/agent/thinking.d.ts +99 -0
  71. package/dist/src/agent/thinking.js +145 -0
  72. package/dist/src/agent/thinking.js.map +1 -0
  73. package/dist/src/agent/usage.d.ts +132 -0
  74. package/dist/src/agent/usage.js +233 -0
  75. package/dist/src/agent/usage.js.map +1 -0
  76. package/dist/src/agent/working-context.d.ts +51 -0
  77. package/dist/src/agent/working-context.js +160 -0
  78. package/dist/src/agent/working-context.js.map +1 -0
  79. package/dist/src/agents/child-recipe.d.ts +33 -0
  80. package/dist/src/agents/child-recipe.js +98 -0
  81. package/dist/src/agents/child-recipe.js.map +1 -0
  82. package/dist/src/agents/concurrency-limit.d.ts +25 -0
  83. package/dist/src/agents/concurrency-limit.js +43 -0
  84. package/dist/src/agents/concurrency-limit.js.map +1 -0
  85. package/dist/src/agents/dispatch-registry.d.ts +180 -0
  86. package/dist/src/agents/dispatch-registry.js +289 -0
  87. package/dist/src/agents/dispatch-registry.js.map +1 -0
  88. package/dist/src/agents/failed-child-text.d.ts +44 -0
  89. package/dist/src/agents/failed-child-text.js +69 -0
  90. package/dist/src/agents/failed-child-text.js.map +1 -0
  91. package/dist/src/agents/loader.d.ts +26 -0
  92. package/dist/src/agents/loader.js +134 -0
  93. package/dist/src/agents/loader.js.map +1 -0
  94. package/dist/src/agents/report-projection.d.ts +31 -0
  95. package/dist/src/agents/report-projection.js +125 -0
  96. package/dist/src/agents/report-projection.js.map +1 -0
  97. package/dist/src/agents/subagent-tool.d.ts +61 -0
  98. package/dist/src/agents/subagent-tool.js +180 -0
  99. package/dist/src/agents/subagent-tool.js.map +1 -0
  100. package/dist/src/agents/workflow-tool.d.ts +85 -0
  101. package/dist/src/agents/workflow-tool.js +530 -0
  102. package/dist/src/agents/workflow-tool.js.map +1 -0
  103. package/dist/src/cli-args.d.ts +39 -0
  104. package/dist/src/cli-args.js +198 -0
  105. package/dist/src/cli-args.js.map +1 -0
  106. package/dist/src/cli-doctor.d.ts +26 -0
  107. package/dist/src/cli-doctor.js +398 -0
  108. package/dist/src/cli-doctor.js.map +1 -0
  109. package/dist/src/cli-main.d.ts +1 -0
  110. package/dist/src/cli-main.js +279 -0
  111. package/dist/src/cli-main.js.map +1 -0
  112. package/dist/src/cli-sessions.d.ts +17 -0
  113. package/dist/src/cli-sessions.js +136 -0
  114. package/dist/src/cli-sessions.js.map +1 -0
  115. package/dist/src/cli-trajectory.d.ts +37 -0
  116. package/dist/src/cli-trajectory.js +303 -0
  117. package/dist/src/cli-trajectory.js.map +1 -0
  118. package/dist/src/cli-usage.d.ts +18 -0
  119. package/dist/src/cli-usage.js +53 -0
  120. package/dist/src/cli-usage.js.map +1 -0
  121. package/dist/src/cli.d.ts +2 -0
  122. package/dist/src/cli.js +29 -0
  123. package/dist/src/cli.js.map +1 -0
  124. package/dist/src/commands/custom-commands.d.ts +43 -0
  125. package/dist/src/commands/custom-commands.js +155 -0
  126. package/dist/src/commands/custom-commands.js.map +1 -0
  127. package/dist/src/commands/workflow-command.d.ts +26 -0
  128. package/dist/src/commands/workflow-command.js +56 -0
  129. package/dist/src/commands/workflow-command.js.map +1 -0
  130. package/dist/src/config.d.ts +463 -0
  131. package/dist/src/config.js +1457 -0
  132. package/dist/src/config.js.map +1 -0
  133. package/dist/src/context-overflow-error.d.ts +7 -0
  134. package/dist/src/context-overflow-error.js +26 -0
  135. package/dist/src/context-overflow-error.js.map +1 -0
  136. package/dist/src/dev-repl.d.ts +1 -0
  137. package/dist/src/dev-repl.js +365 -0
  138. package/dist/src/dev-repl.js.map +1 -0
  139. package/dist/src/headless-protocol.d.ts +147 -0
  140. package/dist/src/headless-protocol.js +359 -0
  141. package/dist/src/headless-protocol.js.map +1 -0
  142. package/dist/src/headless-runner.d.ts +30 -0
  143. package/dist/src/headless-runner.js +405 -0
  144. package/dist/src/headless-runner.js.map +1 -0
  145. package/dist/src/headless-stdin.d.ts +28 -0
  146. package/dist/src/headless-stdin.js +78 -0
  147. package/dist/src/headless-stdin.js.map +1 -0
  148. package/dist/src/headless.d.ts +106 -0
  149. package/dist/src/headless.js +229 -0
  150. package/dist/src/headless.js.map +1 -0
  151. package/dist/src/hooks/codex-hook-runner.d.ts +92 -0
  152. package/dist/src/hooks/codex-hook-runner.js +446 -0
  153. package/dist/src/hooks/codex-hook-runner.js.map +1 -0
  154. package/dist/src/hooks/codex-hooks.d.ts +23 -0
  155. package/dist/src/hooks/codex-hooks.js +152 -0
  156. package/dist/src/hooks/codex-hooks.js.map +1 -0
  157. package/dist/src/hooks/hook-process.d.ts +23 -0
  158. package/dist/src/hooks/hook-process.js +241 -0
  159. package/dist/src/hooks/hook-process.js.map +1 -0
  160. package/dist/src/hooks/lifecycle-hooks.d.ts +37 -0
  161. package/dist/src/hooks/lifecycle-hooks.js +153 -0
  162. package/dist/src/hooks/lifecycle-hooks.js.map +1 -0
  163. package/dist/src/hooks/tool-hooks.d.ts +63 -0
  164. package/dist/src/hooks/tool-hooks.js +350 -0
  165. package/dist/src/hooks/tool-hooks.js.map +1 -0
  166. package/dist/src/mcp/codegraph-preflight.d.ts +29 -0
  167. package/dist/src/mcp/codegraph-preflight.js +232 -0
  168. package/dist/src/mcp/codegraph-preflight.js.map +1 -0
  169. package/dist/src/mcp/registry.d.ts +133 -0
  170. package/dist/src/mcp/registry.js +209 -0
  171. package/dist/src/mcp/registry.js.map +1 -0
  172. package/dist/src/mcp/web-search-empty-results.d.ts +14 -0
  173. package/dist/src/mcp/web-search-empty-results.js +94 -0
  174. package/dist/src/mcp/web-search-empty-results.js.map +1 -0
  175. package/dist/src/memory/command.d.ts +11 -0
  176. package/dist/src/memory/command.js +253 -0
  177. package/dist/src/memory/command.js.map +1 -0
  178. package/dist/src/memory/controller.d.ts +51 -0
  179. package/dist/src/memory/controller.js +316 -0
  180. package/dist/src/memory/controller.js.map +1 -0
  181. package/dist/src/memory/prompt.d.ts +4 -0
  182. package/dist/src/memory/prompt.js +22 -0
  183. package/dist/src/memory/prompt.js.map +1 -0
  184. package/dist/src/memory/scheduler.d.ts +33 -0
  185. package/dist/src/memory/scheduler.js +134 -0
  186. package/dist/src/memory/scheduler.js.map +1 -0
  187. package/dist/src/memory/state.d.ts +112 -0
  188. package/dist/src/memory/state.js +355 -0
  189. package/dist/src/memory/state.js.map +1 -0
  190. package/dist/src/memory/store.d.ts +19 -0
  191. package/dist/src/memory/store.js +130 -0
  192. package/dist/src/memory/store.js.map +1 -0
  193. package/dist/src/memory/tools.d.ts +29 -0
  194. package/dist/src/memory/tools.js +22 -0
  195. package/dist/src/memory/tools.js.map +1 -0
  196. package/dist/src/memory/validation.d.ts +33 -0
  197. package/dist/src/memory/validation.js +159 -0
  198. package/dist/src/memory/validation.js.map +1 -0
  199. package/dist/src/npm-package/generate-patch.d.ts +23 -0
  200. package/dist/src/npm-package/generate-patch.js +88 -0
  201. package/dist/src/npm-package/generate-patch.js.map +1 -0
  202. package/dist/src/npm-package/patch-package-format.d.ts +43 -0
  203. package/dist/src/npm-package/patch-package-format.js +66 -0
  204. package/dist/src/npm-package/patch-package-format.js.map +1 -0
  205. package/dist/src/paths.d.ts +39 -0
  206. package/dist/src/paths.js +105 -0
  207. package/dist/src/paths.js.map +1 -0
  208. package/dist/src/pricing/cost.d.ts +182 -0
  209. package/dist/src/pricing/cost.js +215 -0
  210. package/dist/src/pricing/cost.js.map +1 -0
  211. package/dist/src/pricing/model-prices.d.ts +112 -0
  212. package/dist/src/pricing/model-prices.js +320 -0
  213. package/dist/src/pricing/model-prices.js.map +1 -0
  214. package/dist/src/sdk-patch-preflight.d.ts +23 -0
  215. package/dist/src/sdk-patch-preflight.js +71 -0
  216. package/dist/src/sdk-patch-preflight.js.map +1 -0
  217. package/dist/src/skills/builtin/commit-message/SKILL.md +45 -0
  218. package/dist/src/skills/builtin/commit-message/references/types.md +8 -0
  219. package/dist/src/skills/builtin/developer/SKILL.md +107 -0
  220. package/dist/src/skills/builtin/self-evolution-research/SKILL.md +150 -0
  221. package/dist/src/skills/builtin/self-evolution-research/scripts/roll-research-path.mjs +208 -0
  222. package/dist/src/skills/builtin/self-reflection/SKILL.md +172 -0
  223. package/dist/src/skills/builtin/self-reflection/references/reflection-template.md +90 -0
  224. package/dist/src/skills/builtin/self-reflection/scripts/locate-trajectory.mjs +175 -0
  225. package/dist/src/skills/loader.d.ts +26 -0
  226. package/dist/src/skills/loader.js +186 -0
  227. package/dist/src/skills/loader.js.map +1 -0
  228. package/dist/src/skills/plugin.d.ts +34 -0
  229. package/dist/src/skills/plugin.js +137 -0
  230. package/dist/src/skills/plugin.js.map +1 -0
  231. package/dist/src/skills/prompt.d.ts +8 -0
  232. package/dist/src/skills/prompt.js +214 -0
  233. package/dist/src/skills/prompt.js.map +1 -0
  234. package/dist/src/skills/resource-safety.d.ts +15 -0
  235. package/dist/src/skills/resource-safety.js +149 -0
  236. package/dist/src/skills/resource-safety.js.map +1 -0
  237. package/dist/src/tools/background-bash.d.ts +95 -0
  238. package/dist/src/tools/background-bash.js +639 -0
  239. package/dist/src/tools/background-bash.js.map +1 -0
  240. package/dist/src/tools/background-tail.d.ts +28 -0
  241. package/dist/src/tools/background-tail.js +75 -0
  242. package/dist/src/tools/background-tail.js.map +1 -0
  243. package/dist/src/tools/background-wait-contract.d.ts +4 -0
  244. package/dist/src/tools/background-wait-contract.js +7 -0
  245. package/dist/src/tools/background-wait-contract.js.map +1 -0
  246. package/dist/src/tools/file-editor-serial.d.ts +24 -0
  247. package/dist/src/tools/file-editor-serial.js +99 -0
  248. package/dist/src/tools/file-editor-serial.js.map +1 -0
  249. package/dist/src/tools/image-viewer.d.ts +43 -0
  250. package/dist/src/tools/image-viewer.js +256 -0
  251. package/dist/src/tools/image-viewer.js.map +1 -0
  252. package/dist/src/tools/update-plan.d.ts +30 -0
  253. package/dist/src/tools/update-plan.js +65 -0
  254. package/dist/src/tools/update-plan.js.map +1 -0
  255. package/dist/src/tools/web-fetch.d.ts +70 -0
  256. package/dist/src/tools/web-fetch.js +667 -0
  257. package/dist/src/tools/web-fetch.js.map +1 -0
  258. package/dist/src/trajectory/export.d.ts +31 -0
  259. package/dist/src/trajectory/export.js +116 -0
  260. package/dist/src/trajectory/export.js.map +1 -0
  261. package/dist/src/trajectory/fork.d.ts +19 -0
  262. package/dist/src/trajectory/fork.js +110 -0
  263. package/dist/src/trajectory/fork.js.map +1 -0
  264. package/dist/src/trajectory/memory-tool.d.ts +20 -0
  265. package/dist/src/trajectory/memory-tool.js +98 -0
  266. package/dist/src/trajectory/memory-tool.js.map +1 -0
  267. package/dist/src/trajectory/prompt-history.d.ts +62 -0
  268. package/dist/src/trajectory/prompt-history.js +256 -0
  269. package/dist/src/trajectory/prompt-history.js.map +1 -0
  270. package/dist/src/trajectory/reader.d.ts +21 -0
  271. package/dist/src/trajectory/reader.js +62 -0
  272. package/dist/src/trajectory/reader.js.map +1 -0
  273. package/dist/src/trajectory/record.d.ts +417 -0
  274. package/dist/src/trajectory/record.js +394 -0
  275. package/dist/src/trajectory/record.js.map +1 -0
  276. package/dist/src/trajectory/replay.d.ts +74 -0
  277. package/dist/src/trajectory/replay.js +285 -0
  278. package/dist/src/trajectory/replay.js.map +1 -0
  279. package/dist/src/trajectory/resume-recap.d.ts +43 -0
  280. package/dist/src/trajectory/resume-recap.js +68 -0
  281. package/dist/src/trajectory/resume-recap.js.map +1 -0
  282. package/dist/src/trajectory/search.d.ts +40 -0
  283. package/dist/src/trajectory/search.js +127 -0
  284. package/dist/src/trajectory/search.js.map +1 -0
  285. package/dist/src/trajectory/spend.d.ts +157 -0
  286. package/dist/src/trajectory/spend.js +264 -0
  287. package/dist/src/trajectory/spend.js.map +1 -0
  288. package/dist/src/trajectory/stream.d.ts +30 -0
  289. package/dist/src/trajectory/stream.js +30 -0
  290. package/dist/src/trajectory/stream.js.map +1 -0
  291. package/dist/src/trajectory/writer.d.ts +310 -0
  292. package/dist/src/trajectory/writer.js +636 -0
  293. package/dist/src/trajectory/writer.js.map +1 -0
  294. package/dist/src/tui/App.d.ts +109 -0
  295. package/dist/src/tui/App.js +2660 -0
  296. package/dist/src/tui/App.js.map +1 -0
  297. package/dist/src/tui/InputBox.d.ts +90 -0
  298. package/dist/src/tui/InputBox.js +129 -0
  299. package/dist/src/tui/InputBox.js.map +1 -0
  300. package/dist/src/tui/MarkdownText.d.ts +16 -0
  301. package/dist/src/tui/MarkdownText.js +117 -0
  302. package/dist/src/tui/MarkdownText.js.map +1 -0
  303. package/dist/src/tui/MessageList.d.ts +27 -0
  304. package/dist/src/tui/MessageList.js +61 -0
  305. package/dist/src/tui/MessageList.js.map +1 -0
  306. package/dist/src/tui/PermissionPrompt.d.ts +18 -0
  307. package/dist/src/tui/PermissionPrompt.js +114 -0
  308. package/dist/src/tui/PermissionPrompt.js.map +1 -0
  309. package/dist/src/tui/PlanChecklist.d.ts +7 -0
  310. package/dist/src/tui/PlanChecklist.js +12 -0
  311. package/dist/src/tui/PlanChecklist.js.map +1 -0
  312. package/dist/src/tui/QueuedMessages.d.ts +8 -0
  313. package/dist/src/tui/QueuedMessages.js +24 -0
  314. package/dist/src/tui/QueuedMessages.js.map +1 -0
  315. package/dist/src/tui/StartupScreen.d.ts +25 -0
  316. package/dist/src/tui/StartupScreen.js +51 -0
  317. package/dist/src/tui/StartupScreen.js.map +1 -0
  318. package/dist/src/tui/ToolCallPanel.d.ts +33 -0
  319. package/dist/src/tui/ToolCallPanel.js +112 -0
  320. package/dist/src/tui/ToolCallPanel.js.map +1 -0
  321. package/dist/src/tui/WelcomeHeader.d.ts +30 -0
  322. package/dist/src/tui/WelcomeHeader.js +69 -0
  323. package/dist/src/tui/WelcomeHeader.js.map +1 -0
  324. package/dist/src/tui/background-tool-presentation.d.ts +22 -0
  325. package/dist/src/tui/background-tool-presentation.js +209 -0
  326. package/dist/src/tui/background-tool-presentation.js.map +1 -0
  327. package/dist/src/tui/busy-suffix.d.ts +37 -0
  328. package/dist/src/tui/busy-suffix.js +39 -0
  329. package/dist/src/tui/busy-suffix.js.map +1 -0
  330. package/dist/src/tui/clipboard-image.d.ts +18 -0
  331. package/dist/src/tui/clipboard-image.js +109 -0
  332. package/dist/src/tui/clipboard-image.js.map +1 -0
  333. package/dist/src/tui/context-format.d.ts +43 -0
  334. package/dist/src/tui/context-format.js +71 -0
  335. package/dist/src/tui/context-format.js.map +1 -0
  336. package/dist/src/tui/copy-command.d.ts +68 -0
  337. package/dist/src/tui/copy-command.js +182 -0
  338. package/dist/src/tui/copy-command.js.map +1 -0
  339. package/dist/src/tui/edit-diff.d.ts +135 -0
  340. package/dist/src/tui/edit-diff.js +356 -0
  341. package/dist/src/tui/edit-diff.js.map +1 -0
  342. package/dist/src/tui/frame-budget.d.ts +351 -0
  343. package/dist/src/tui/frame-budget.js +446 -0
  344. package/dist/src/tui/frame-budget.js.map +1 -0
  345. package/dist/src/tui/help-format.d.ts +17 -0
  346. package/dist/src/tui/help-format.js +38 -0
  347. package/dist/src/tui/help-format.js.map +1 -0
  348. package/dist/src/tui/live-text.d.ts +51 -0
  349. package/dist/src/tui/live-text.js +154 -0
  350. package/dist/src/tui/live-text.js.map +1 -0
  351. package/dist/src/tui/markdown.d.ts +62 -0
  352. package/dist/src/tui/markdown.js +244 -0
  353. package/dist/src/tui/markdown.js.map +1 -0
  354. package/dist/src/tui/mcp-format.d.ts +28 -0
  355. package/dist/src/tui/mcp-format.js +67 -0
  356. package/dist/src/tui/mcp-format.js.map +1 -0
  357. package/dist/src/tui/path-completion.d.ts +119 -0
  358. package/dist/src/tui/path-completion.js +305 -0
  359. package/dist/src/tui/path-completion.js.map +1 -0
  360. package/dist/src/tui/permission-queue.d.ts +61 -0
  361. package/dist/src/tui/permission-queue.js +129 -0
  362. package/dist/src/tui/permission-queue.js.map +1 -0
  363. package/dist/src/tui/plan-format.d.ts +9 -0
  364. package/dist/src/tui/plan-format.js +30 -0
  365. package/dist/src/tui/plan-format.js.map +1 -0
  366. package/dist/src/tui/prompt-completion.d.ts +22 -0
  367. package/dist/src/tui/prompt-completion.js +46 -0
  368. package/dist/src/tui/prompt-completion.js.map +1 -0
  369. package/dist/src/tui/prompt-editor.d.ts +102 -0
  370. package/dist/src/tui/prompt-editor.js +379 -0
  371. package/dist/src/tui/prompt-editor.js.map +1 -0
  372. package/dist/src/tui/prompt-history-search.d.ts +53 -0
  373. package/dist/src/tui/prompt-history-search.js +123 -0
  374. package/dist/src/tui/prompt-history-search.js.map +1 -0
  375. package/dist/src/tui/prompt-queue.d.ts +58 -0
  376. package/dist/src/tui/prompt-queue.js +74 -0
  377. package/dist/src/tui/prompt-queue.js.map +1 -0
  378. package/dist/src/tui/prompt-recall.d.ts +74 -0
  379. package/dist/src/tui/prompt-recall.js +90 -0
  380. package/dist/src/tui/prompt-recall.js.map +1 -0
  381. package/dist/src/tui/react-environment.d.ts +11 -0
  382. package/dist/src/tui/react-environment.js +24 -0
  383. package/dist/src/tui/react-environment.js.map +1 -0
  384. package/dist/src/tui/rewind-search.d.ts +34 -0
  385. package/dist/src/tui/rewind-search.js +68 -0
  386. package/dist/src/tui/rewind-search.js.map +1 -0
  387. package/dist/src/tui/shell-command.d.ts +114 -0
  388. package/dist/src/tui/shell-command.js +310 -0
  389. package/dist/src/tui/shell-command.js.map +1 -0
  390. package/dist/src/tui/spend-advisory.d.ts +52 -0
  391. package/dist/src/tui/spend-advisory.js +64 -0
  392. package/dist/src/tui/spend-advisory.js.map +1 -0
  393. package/dist/src/tui/status-format.d.ts +120 -0
  394. package/dist/src/tui/status-format.js +192 -0
  395. package/dist/src/tui/status-format.js.map +1 -0
  396. package/dist/src/tui/subagent-format.d.ts +49 -0
  397. package/dist/src/tui/subagent-format.js +146 -0
  398. package/dist/src/tui/subagent-format.js.map +1 -0
  399. package/dist/src/tui/task-format.d.ts +29 -0
  400. package/dist/src/tui/task-format.js +87 -0
  401. package/dist/src/tui/task-format.js.map +1 -0
  402. package/dist/src/tui/terminal-bell.d.ts +20 -0
  403. package/dist/src/tui/terminal-bell.js +33 -0
  404. package/dist/src/tui/terminal-bell.js.map +1 -0
  405. package/dist/src/tui/tool-detail-presentation.d.ts +60 -0
  406. package/dist/src/tui/tool-detail-presentation.js +206 -0
  407. package/dist/src/tui/tool-detail-presentation.js.map +1 -0
  408. package/dist/src/tui/turn-state.d.ts +195 -0
  409. package/dist/src/tui/turn-state.js +548 -0
  410. package/dist/src/tui/turn-state.js.map +1 -0
  411. package/dist/src/tui/visual-language.d.ts +45 -0
  412. package/dist/src/tui/visual-language.js +57 -0
  413. package/dist/src/tui/visual-language.js.map +1 -0
  414. package/dist/src/version.d.ts +7 -0
  415. package/dist/src/version.js +38 -0
  416. package/dist/src/version.js.map +1 -0
  417. 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 {};