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,394 @@
1
+ /** Bumped only for a change a reader cannot tolerate; readers keep older versions readable. */
2
+ export const SCHEMA_VERSION = 1;
3
+ /**
4
+ * Cap on any single string inside a record, in code points.
5
+ *
6
+ * Sized so a long assistant answer (~2k tokens) survives whole while a
7
+ * whole-file `fileEditor view` result or a 100k-line log does not. Code points
8
+ * rather than bytes, matching `headlessField`: slicing UTF-8 by byte length
9
+ * replaces a trailing multi-byte sequence with U+FFFD (a byte-slice truncation
10
+ * mistake this project made once and must not repeat).
11
+ */
12
+ export const MAX_FIELD_CHARS = 8_000;
13
+ /**
14
+ * Cap on one serialized record, in bytes — the same 64 KiB bound the background
15
+ * `bash output` mode already uses. A record still over it after field capping
16
+ * keeps its envelope and loses its payload, because a line nothing can parse is
17
+ * worse than a line that says it was dropped.
18
+ */
19
+ export const MAX_RECORD_BYTES = 64 * 1024;
20
+ /**
21
+ * Cap on one session's record file, in bytes.
22
+ *
23
+ * Nothing in darwin garbage-collects session state (see `contextOffload` in
24
+ * `src/config.ts`), so a per-conversation hard bound is the only real disk bound.
25
+ * Recording stops at this point rather than rotating: rotation would either
26
+ * rewrite bytes or scatter one conversation over several files, and both cost
27
+ * more than they save for an observational record.
28
+ */
29
+ export const MAX_FILE_BYTES = 64 * 1024 * 1024;
30
+ /** SDK event types the record retains. Everything else is counted, not stored. */
31
+ export const RECORDED_EVENT_TYPES = [
32
+ 'contentBlockEvent',
33
+ 'beforeToolCallEvent',
34
+ 'afterToolCallEvent',
35
+ 'agentResultEvent',
36
+ ];
37
+ export function isRecordedEventType(type) {
38
+ return RECORDED_EVENT_TYPES.includes(type);
39
+ }
40
+ /**
41
+ * A thrown value as the fields the record keeps.
42
+ *
43
+ * The class is read from the prototype rather than from `error.name`, because the
44
+ * two disagree exactly where it matters: every SDK error class sets `name` to its
45
+ * own class name (measured on `@strands-agents/sdk@1.12.0`, `dist/src/errors.js`),
46
+ * but nothing forces a provider or a future subclass to, and then `name` degrades to
47
+ * the useless `'Error'` while the constructor still knows what was thrown. When both
48
+ * are present and differ, the class wins and `name` is appended, because they are
49
+ * two different facts and a record that silently picked one would hide the other.
50
+ *
51
+ * A non-`Error` throw is described by its type rather than pretended to be an error:
52
+ * `String(value)` is the only honest message available.
53
+ */
54
+ export function failureFromError(error) {
55
+ if (!(error instanceof Error)) {
56
+ return { name: `non-error ${error === null ? 'null' : typeof error}`, message: safeString(error) };
57
+ }
58
+ const name = className(error);
59
+ const cause = error.cause instanceof Error ? className(error.cause) : '';
60
+ return {
61
+ name,
62
+ message: typeof error.message === 'string' ? error.message : safeString(error),
63
+ // Only when it adds something: a wrapper of the same class tells a reader nothing.
64
+ ...(cause === '' || cause === name ? {} : { cause }),
65
+ };
66
+ }
67
+ /** An error's class, with its declared `name` kept when the two disagree. */
68
+ function className(error) {
69
+ const constructed = error.constructor?.name;
70
+ const declared = typeof error.name === 'string' ? error.name : '';
71
+ if (typeof constructed !== 'string' || constructed === '')
72
+ return declared === '' ? 'Error' : declared;
73
+ if (constructed === declared || declared === '')
74
+ return constructed;
75
+ return `${constructed} (name: ${declared})`;
76
+ }
77
+ /** `String()` cannot be trusted on an arbitrary throw: a hostile `toString` may throw itself. */
78
+ function safeString(value) {
79
+ try {
80
+ return String(value);
81
+ }
82
+ catch {
83
+ return '(a thrown value that could not be converted to text)';
84
+ }
85
+ }
86
+ /** Collects truncations while a payload is being capped. */
87
+ class Capper {
88
+ truncations = [];
89
+ capString(value, path) {
90
+ const points = [...value];
91
+ if (points.length <= MAX_FIELD_CHARS)
92
+ return value;
93
+ this.truncations.push({ path, chars: points.length, kept: MAX_FIELD_CHARS });
94
+ return points.slice(0, MAX_FIELD_CHARS).join('');
95
+ }
96
+ }
97
+ /**
98
+ * Depth-first copy that caps every string it passes, recording each cut.
99
+ *
100
+ * Cycles cannot occur in an event's `toJSON()` output (it is JSON-serializable by
101
+ * contract) but a depth bound is kept anyway: this runs on provider-shaped data,
102
+ * and an observer must not be the thing that overflows a stack mid-turn.
103
+ */
104
+ function capValue(value, path, capper, depth = 0) {
105
+ if (typeof value === 'string')
106
+ return capper.capString(value, path);
107
+ if (value === null || typeof value !== 'object')
108
+ return value;
109
+ if (depth >= 12)
110
+ return '[depth-limited]';
111
+ if (Array.isArray(value)) {
112
+ return value.map((entry, index) => capValue(entry, `${path}[${index}]`, capper, depth + 1));
113
+ }
114
+ const out = {};
115
+ for (const [key, entry] of Object.entries(value)) {
116
+ out[key] = capValue(entry, path === '' ? key : `${path}.${key}`, capper, depth + 1);
117
+ }
118
+ return out;
119
+ }
120
+ /**
121
+ * The SDK event's own JSON projection, capped.
122
+ *
123
+ * `JSON.stringify` is used deliberately rather than reading fields off the event:
124
+ * every stream event class declares a `toJSON()` that excludes `agent` and
125
+ * `invocationState` (measured on `@strands-agents/sdk@1.12.0`), so this is the one
126
+ * projection that cannot drag the live agent, its whole message list, or arbitrary
127
+ * per-invocation objects into the file. A hand-rolled copy would have to be
128
+ * re-audited on every SDK upgrade.
129
+ *
130
+ * Reasoning is reduced to its presence here, not by the caps: the reply is the
131
+ * record, the model's private deliberation is not.
132
+ */
133
+ export function projectEvent(event) {
134
+ let serialized;
135
+ try {
136
+ serialized = JSON.parse(JSON.stringify(event));
137
+ }
138
+ catch {
139
+ // A payload the SDK could not serialize is still worth a line saying so.
140
+ serialized = { type: event.type, unserializable: true };
141
+ }
142
+ const capper = new Capper();
143
+ const data = capValue(stripReasoningText(serialized), '', capper);
144
+ return { data, trunc: capper.truncations };
145
+ }
146
+ /**
147
+ * Replaces any reasoning block's content with its bare presence, at any depth.
148
+ *
149
+ * Matched on the **serialized** shape, `{ reasoning: … }`, because that is what
150
+ * `toJSON()` produces: a reasoning block loses its `type` discriminator on the way
151
+ * out, so a check for `type === 'reasoningBlock'` would silently never fire and the
152
+ * model's private deliberation — including `redactedContent`, which *is* the
153
+ * reasoning — would land in the file. The in-memory shape is matched too, for any
154
+ * payload that reaches here unserialized.
155
+ *
156
+ * An empty `text` is kept rather than dropping the key, so the record still
157
+ * rehydrates into a real `ReasoningBlock` on replay (measured: `contentBlockFromData`
158
+ * accepts `{ reasoning: { text: '' } }`). Presence is the whole content.
159
+ */
160
+ function stripReasoningText(value) {
161
+ if (Array.isArray(value))
162
+ return value.map(stripReasoningText);
163
+ if (value === null || typeof value !== 'object')
164
+ return value;
165
+ const record = value;
166
+ if (record['type'] === 'reasoningBlock')
167
+ return { type: 'reasoningBlock' };
168
+ if (Object.hasOwn(record, 'reasoning'))
169
+ return { reasoning: { text: '' } };
170
+ const out = {};
171
+ for (const [key, entry] of Object.entries(record))
172
+ out[key] = stripReasoningText(entry);
173
+ return out;
174
+ }
175
+ /** Caps one plain string field (user input, partial assistant text). */
176
+ export function capField(value, path) {
177
+ const capper = new Capper();
178
+ return { value: capper.capString(value, path), trunc: capper.truncations };
179
+ }
180
+ /**
181
+ * One record as the line that will be appended, newline included.
182
+ *
183
+ * A record that is still oversized after field capping keeps its envelope and
184
+ * loses its payload: the alternative is a line no reader can parse, which would
185
+ * also break `seq` continuation for every later run.
186
+ */
187
+ export function encodeRecord(record) {
188
+ const line = `${JSON.stringify(record)}\n`;
189
+ if (Buffer.byteLength(line, 'utf8') <= MAX_RECORD_BYTES)
190
+ return line;
191
+ const reduced = {
192
+ v: record.v,
193
+ seq: record.seq,
194
+ t: record.t,
195
+ turn: record.turn,
196
+ type: record.type,
197
+ dropped: 'record-too-large',
198
+ bytes: Buffer.byteLength(line, 'utf8'),
199
+ };
200
+ return `${JSON.stringify(reduced)}\n`;
201
+ }
202
+ /**
203
+ * Parses one line, or `undefined` when it is not a usable record.
204
+ *
205
+ * Deliberately forgiving about *unknown* types and extra fields (a newer darwin's
206
+ * file must stay readable) and strict about the envelope: without `type` and `seq`
207
+ * a line cannot be ordered or interpreted, so it counts as damage.
208
+ */
209
+ export function parseRecordLine(line) {
210
+ const trimmed = line.trim();
211
+ if (trimmed === '')
212
+ return undefined;
213
+ let parsed;
214
+ try {
215
+ parsed = JSON.parse(trimmed);
216
+ }
217
+ catch {
218
+ return undefined;
219
+ }
220
+ if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed))
221
+ return undefined;
222
+ const candidate = parsed;
223
+ if (typeof candidate.type !== 'string' || typeof candidate.seq !== 'number')
224
+ return undefined;
225
+ return parsed;
226
+ }
227
+ /** The text a record contributes to search, in the order a reader would read it. */
228
+ export function searchableText(record) {
229
+ switch (record.type) {
230
+ case 'userInput':
231
+ return [record.text];
232
+ case 'turnEnded': {
233
+ // The failure joins search for the same reason tool result text is in it: it is
234
+ // content the record already holds, and "which session hit ThrottlingException"
235
+ // is the question a failed overnight run makes people ask first.
236
+ const failure = turnFailureOf(record);
237
+ return [
238
+ ...(record.partialText === undefined ? [] : [record.partialText]),
239
+ ...(failure === undefined ? [] : [failureLine(failure)]),
240
+ ];
241
+ }
242
+ case 'contentBlockEvent':
243
+ case 'beforeToolCallEvent':
244
+ case 'afterToolCallEvent':
245
+ case 'agentResultEvent':
246
+ return collectStrings(record.data, []);
247
+ case 'shellCommand':
248
+ // Content the record already holds: "which session ran that migration"
249
+ // is a question `!` makes real.
250
+ return [record.command, record.output];
251
+ default:
252
+ return [];
253
+ }
254
+ }
255
+ /**
256
+ * The one shared reading of how a turn ended, so `list`, `replay` and the tests
257
+ * cannot drift into three different answers.
258
+ *
259
+ * `abandoned` is the honest name for the pre-existing fourth case: the consumer
260
+ * stopped reading before a result arrived (an early `break`, or a for-await body that
261
+ * threw, which JavaScript delivers to the generator as a `return` completion rather
262
+ * than as the turn failing). It is no longer conflated with a failure.
263
+ */
264
+ export function turnOutcome(record) {
265
+ if (turnFailureOf(record) !== undefined)
266
+ return 'failed';
267
+ if (record.stopReason === 'cancelled')
268
+ return 'cancelled';
269
+ return typeof record.stopReason === 'string' && record.stopReason !== '' ? 'clean' : 'abandoned';
270
+ }
271
+ /**
272
+ * A record's failure as a reader can trust it.
273
+ *
274
+ * Defensive about the payload rather than about the envelope, matching
275
+ * {@link parseRecordLine}: the line may come from an older darwin that never wrote
276
+ * the field, a newer one that writes more, or an interrupted write. A half-present
277
+ * failure is still reported as a failure — dropping it would hide the very thing the
278
+ * field exists to say.
279
+ */
280
+ export function turnFailureOf(record) {
281
+ const failure = record.failure;
282
+ if (failure === null || typeof failure !== 'object')
283
+ return undefined;
284
+ const { name, message, cause } = failure;
285
+ const named = typeof name === 'string' ? name : '';
286
+ const said = typeof message === 'string' ? message : '';
287
+ const from = typeof cause === 'string' ? cause : '';
288
+ if (named === '' && said === '' && from === '')
289
+ return undefined;
290
+ return {
291
+ name: named === '' ? '(unnamed error)' : named,
292
+ message: said,
293
+ ...(from === '' ? {} : { cause: from }),
294
+ };
295
+ }
296
+ /**
297
+ * A turn's spend as a reader can trust it.
298
+ *
299
+ * Defensive about the payload for the same reasons {@link turnFailureOf} is: the line
300
+ * may come from an older darwin that never wrote the field, a newer one that writes
301
+ * more, or an interrupted write. The rule that matters is that a value which is not a
302
+ * finite number is **unknown**, never `0` — a report that turned a missing counter into
303
+ * a zero would claim a session was cheap when nobody measured it. A `spend` with no
304
+ * usable numbers at all is `undefined`, so "unknown" has exactly one representation.
305
+ */
306
+ export function turnSpendOf(record) {
307
+ return spendOf(record.spend);
308
+ }
309
+ /**
310
+ * A spend payload as a reader can trust it — the shared half of {@link turnSpendOf}
311
+ * and {@link modelCallOf}, so a turn's spend and a call's spend cannot become two
312
+ * readings of one shape.
313
+ */
314
+ function spendOf(value) {
315
+ const spend = value;
316
+ if (spend === null || typeof spend !== 'object')
317
+ return undefined;
318
+ const { provider, model, input, output, cacheRead, cacheWrite } = spend;
319
+ const metric = (value) => typeof value === 'number' && Number.isFinite(value) ? value : undefined;
320
+ const counted = metric(output);
321
+ const uncached = metric(input);
322
+ const read = metric(cacheRead);
323
+ const written = metric(cacheWrite);
324
+ if (counted === undefined && uncached === undefined && read === undefined && written === undefined) {
325
+ return undefined;
326
+ }
327
+ return {
328
+ provider: typeof provider === 'string' && provider !== '' ? provider : '(unknown provider)',
329
+ model: typeof model === 'string' && model !== '' ? model : '(unknown model)',
330
+ ...(uncached === undefined ? {} : { input: uncached }),
331
+ ...(counted === undefined ? {} : { output: counted }),
332
+ ...(read === undefined ? {} : { cacheRead: read }),
333
+ ...(written === undefined ? {} : { cacheWrite: written }),
334
+ };
335
+ }
336
+ /**
337
+ * A record's model-call payload as a reader can trust it, defensive on
338
+ * {@link turnSpendOf}'s terms: the line may come from a newer darwin that writes
339
+ * more, or an interrupted write. A value that is not a finite number is **unknown**
340
+ * — `attempt`/`ms` degrade to 0 (an honest "not usable" for ordinals a report only
341
+ * prints), and the optional fields to absence, never to an invented 0.
342
+ */
343
+ export function modelCallOf(record) {
344
+ const number = (value) => typeof value === 'number' && Number.isFinite(value) ? value : undefined;
345
+ const stopReason = record.stopReason;
346
+ const contextTokens = number(record.contextTokens);
347
+ const spend = spendOf(record.spend);
348
+ return {
349
+ turn: record.turn,
350
+ attempt: number(record.attempt) ?? 0,
351
+ ms: number(record.ms) ?? 0,
352
+ ...(typeof stopReason === 'string' && stopReason !== '' ? { stopReason } : {}),
353
+ ...(contextTokens === undefined ? {} : { contextTokens }),
354
+ ...(spend === undefined ? {} : { spend }),
355
+ };
356
+ }
357
+ /**
358
+ * Cap on one rendered failure summary, in code points.
359
+ *
360
+ * Small on purpose: this is the bound for a *summary* line, where a whole session is
361
+ * one line. The full message — itself capped at {@link MAX_FIELD_CHARS} — stays in
362
+ * the record and is what `replay` prints.
363
+ */
364
+ export const MAX_FAILURE_SUMMARY_CHARS = 120;
365
+ /** The failure as one unbounded line: what search matches against. */
366
+ export function failureLine(failure) {
367
+ const named = failure.cause === undefined ? failure.name : `${failure.name} (cause ${failure.cause})`;
368
+ return `${named}: ${failure.message}`;
369
+ }
370
+ /**
371
+ * {@link failureLine} on one line, bounded — for summary rows.
372
+ *
373
+ * The bound covers the whole rendered line, not the message alone, because the class
374
+ * name is provider-controlled too: an 8,000 code-point name would otherwise blow the
375
+ * row just as easily as a long message. Newlines are collapsed because a provider
376
+ * message with embedded newlines would turn one summary row into several.
377
+ */
378
+ export function formatTurnFailure(failure, limit = MAX_FAILURE_SUMMARY_CHARS) {
379
+ const line = failureLine(failure).replace(/\s+/gu, ' ').trim();
380
+ const points = [...line];
381
+ return points.length <= limit ? line : `${points.slice(0, Math.max(0, limit - 1)).join('')}…`;
382
+ }
383
+ function collectStrings(value, into) {
384
+ if (typeof value === 'string') {
385
+ into.push(value);
386
+ return into;
387
+ }
388
+ if (value === null || typeof value !== 'object')
389
+ return into;
390
+ for (const entry of Object.values(value))
391
+ collectStrings(entry, into);
392
+ return into;
393
+ }
394
+ //# sourceMappingURL=record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record.js","sourceRoot":"","sources":["../../../src/trajectory/record.ts"],"names":[],"mappings":"AAWA,+FAA+F;AAC/F,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEhC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AAErC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAC;AAE1C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAY/C,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,mBAAmB;IACnB,qBAAqB;IACrB,oBAAoB;IACpB,kBAAkB;CACV,CAAC;AAIX,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAQ,oBAA0C,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACpE,CAAC;AAkRD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAg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IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/D,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IACzB,OAAO,MAAM,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC;AAChG,CAAC;AAED,SAAS,cAAc,CAAC,KAAc,EAAE,IAAc;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC7D,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAgC,CAAC;QAAE,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACjG,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { type HistoryItem } from '../tui/turn-state.js';
2
+ import { type TrajectoryReadResult } from './reader.js';
3
+ import { type ModelCallReading, type TrajectoryRecord, type TurnFailure } from './record.js';
4
+ import { type SpendCostReport, type SpendSummary, type TurnSpendEntry } from './spend.js';
5
+ import type { ModelPriceCache } from '../pricing/model-prices.js';
6
+ export interface ReplayResult {
7
+ /** The reconstructed history, in order. */
8
+ history: HistoryItem[];
9
+ /** Turn ordinals the record contains. */
10
+ turns: number[];
11
+ /** Runs the record covers — one per process that appended to it. */
12
+ runs: {
13
+ turn: number;
14
+ session: string;
15
+ model: string;
16
+ at: string;
17
+ resumed: boolean;
18
+ }[];
19
+ /** Damage the reader tolerated, ready to report; `undefined` when the file was clean. */
20
+ damage: string | undefined;
21
+ /** Records the replay skipped because a cap had removed their payload. */
22
+ droppedRecords: number;
23
+ /** Turns whose stream threw, in turn order, with what it threw. */
24
+ failures: (TurnFailure & {
25
+ turn: number;
26
+ })[];
27
+ /**
28
+ * What each closed turn cost, in file order, including the turns nothing measured —
29
+ * an unmeasured turn is reported as unknown rather than dropped from the report.
30
+ */
31
+ turnSpend: TurnSpendEntry[];
32
+ /**
33
+ * Every completed model call the record holds, in file order — the call-level
34
+ * reading `modelCall` records exist for. Empty for files that predate the record
35
+ * type, which is what keeps their `formatReplay` (and therefore `/export`)
36
+ * byte-identical.
37
+ */
38
+ modelCalls: ModelCallReading[];
39
+ /** The same numbers aggregated for the whole file, with the models that incurred them. */
40
+ spend: SpendSummary;
41
+ /**
42
+ * {@link spend} priced per model from the price cache handed in through
43
+ * {@link ReplayOptions.prices} — absent when none was, which is how `/export` stays a
44
+ * projection of the record alone: a transcript file must not depend on what
45
+ * `~/.darwin/model-prices.json` happened to hold when it was written. Absent too
46
+ * when no turn carried a spend (there is nothing to price, and `spend` already
47
+ * says so).
48
+ */
49
+ cost?: SpendCostReport;
50
+ }
51
+ export interface ReplayOptions {
52
+ /** Replay only this 1-based turn ordinal. */
53
+ turn?: number;
54
+ /**
55
+ * A price cache already read (`readModelPriceCache`) — replay never reads, fetches
56
+ * or writes one itself. The CLI `replay` passes it; `/export` does not.
57
+ */
58
+ prices?: ModelPriceCache;
59
+ }
60
+ /**
61
+ * Rebuilds history from records.
62
+ *
63
+ * Pure over its input: the same records always produce the same history, which is
64
+ * what makes replay quotable. History item `id`s come from a module counter in
65
+ * `turn-state.ts` and are process-local by construction, so comparisons against a
66
+ * live run must ignore them — see {@link historyWithoutIds}.
67
+ */
68
+ export declare function replayRecords(records: readonly TrajectoryRecord[], options?: ReplayOptions): Omit<ReplayResult, 'damage'>;
69
+ /** Replays a file the reader has already opened, carrying its damage report along. */
70
+ export declare function replayRead(read: TrajectoryReadResult, options?: ReplayOptions): ReplayResult;
71
+ /** History with the process-local ids removed, for comparing a replay to a live run. */
72
+ export declare function historyWithoutIds(history: readonly HistoryItem[]): unknown[];
73
+ /** Plain-text transcript: content, deliberately not an imitation of the Ink frame. */
74
+ export declare function formatReplay(result: ReplayResult): string;