@with-logic/elwood 0.2.0 → 0.2.2

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 (878) hide show
  1. package/CHANGELOG.md +571 -1
  2. package/CONTRIBUTING.md +3 -0
  3. package/README.md +6 -2
  4. package/dist/bridge/socket-release.d.ts +15 -0
  5. package/dist/bridge/socket-release.d.ts.map +1 -0
  6. package/dist/bridge/socket-release.js +22 -0
  7. package/dist/bridge/socket-release.js.map +1 -0
  8. package/dist/claude/composer/border.d.ts +12 -0
  9. package/dist/claude/composer/border.d.ts.map +1 -0
  10. package/dist/claude/composer/border.js +12 -0
  11. package/dist/claude/composer/border.js.map +1 -0
  12. package/dist/claude/composer/empty-input.d.ts +15 -0
  13. package/dist/claude/composer/empty-input.d.ts.map +1 -1
  14. package/dist/claude/composer/empty-input.js +30 -11
  15. package/dist/claude/composer/empty-input.js.map +1 -1
  16. package/dist/claude/composer/footer.d.ts +26 -2
  17. package/dist/claude/composer/footer.d.ts.map +1 -1
  18. package/dist/claude/composer/footer.js +29 -2
  19. package/dist/claude/composer/footer.js.map +1 -1
  20. package/dist/claude/composer/idle.d.ts +14 -0
  21. package/dist/claude/composer/idle.d.ts.map +1 -0
  22. package/dist/claude/composer/idle.js +17 -0
  23. package/dist/claude/composer/idle.js.map +1 -0
  24. package/dist/claude/composer/last.d.ts +2 -0
  25. package/dist/claude/composer/last.d.ts.map +1 -0
  26. package/dist/claude/composer/last.js +15 -0
  27. package/dist/claude/composer/last.js.map +1 -0
  28. package/dist/claude/composer/staged-input.d.ts.map +1 -1
  29. package/dist/claude/composer/staged-input.js +2 -1
  30. package/dist/claude/composer/staged-input.js.map +1 -1
  31. package/dist/claude/hooks/stop-failure.d.ts +15 -2
  32. package/dist/claude/hooks/stop-failure.d.ts.map +1 -1
  33. package/dist/claude/hooks/stop-failure.js +32 -9
  34. package/dist/claude/hooks/stop-failure.js.map +1 -1
  35. package/dist/claude/login/stages.d.ts.map +1 -1
  36. package/dist/claude/login/stages.js +2 -2
  37. package/dist/claude/login/stages.js.map +1 -1
  38. package/dist/claude/model-picker.d.ts +1 -1
  39. package/dist/claude/model-picker.d.ts.map +1 -1
  40. package/dist/claude/model-picker.js +27 -10
  41. package/dist/claude/model-picker.js.map +1 -1
  42. package/dist/claude/preflight.d.ts +1 -1
  43. package/dist/claude/preflight.d.ts.map +1 -1
  44. package/dist/claude/preflight.js +18 -12
  45. package/dist/claude/preflight.js.map +1 -1
  46. package/dist/claude/questions/navigation.d.ts.map +1 -1
  47. package/dist/claude/questions/navigation.js +1 -2
  48. package/dist/claude/questions/navigation.js.map +1 -1
  49. package/dist/claude/questions/screen.d.ts.map +1 -1
  50. package/dist/claude/questions/screen.js +10 -2
  51. package/dist/claude/questions/screen.js.map +1 -1
  52. package/dist/claude/screen-table.d.ts +8 -5
  53. package/dist/claude/screen-table.d.ts.map +1 -1
  54. package/dist/claude/screen-table.js +20 -12
  55. package/dist/claude/screen-table.js.map +1 -1
  56. package/dist/claude/session/bridge.d.ts +2 -1
  57. package/dist/claude/session/bridge.d.ts.map +1 -1
  58. package/dist/claude/session/bridge.js +3 -1
  59. package/dist/claude/session/bridge.js.map +1 -1
  60. package/dist/claude/session/build.d.ts.map +1 -1
  61. package/dist/claude/session/build.js +13 -11
  62. package/dist/claude/session/build.js.map +1 -1
  63. package/dist/claude/session/cleanup.d.ts +18 -0
  64. package/dist/claude/session/cleanup.d.ts.map +1 -0
  65. package/dist/claude/session/cleanup.js +10 -0
  66. package/dist/claude/session/cleanup.js.map +1 -0
  67. package/dist/claude/session/index.d.ts.map +1 -1
  68. package/dist/claude/session/index.js +27 -13
  69. package/dist/claude/session/index.js.map +1 -1
  70. package/dist/claude/session/instance.d.ts +7 -8
  71. package/dist/claude/session/instance.d.ts.map +1 -1
  72. package/dist/claude/session/instance.js +9 -13
  73. package/dist/claude/session/instance.js.map +1 -1
  74. package/dist/claude/session/resume.d.ts.map +1 -1
  75. package/dist/claude/session/resume.js +14 -5
  76. package/dist/claude/session/resume.js.map +1 -1
  77. package/dist/claude/session/transcript.js +2 -2
  78. package/dist/claude/session/transcript.js.map +1 -1
  79. package/dist/claude/simple.d.ts +1 -1
  80. package/dist/claude/simple.d.ts.map +1 -1
  81. package/dist/claude/simple.js +3 -3
  82. package/dist/claude/simple.js.map +1 -1
  83. package/dist/claude/startup-prompts.d.ts +2 -0
  84. package/dist/claude/startup-prompts.d.ts.map +1 -1
  85. package/dist/claude/startup-prompts.js +5 -1
  86. package/dist/claude/startup-prompts.js.map +1 -1
  87. package/dist/claude/transcript/cursor-io.d.ts +1 -1
  88. package/dist/claude/transcript/cursor-io.d.ts.map +1 -1
  89. package/dist/claude/transcript/cursor-io.js +1 -1
  90. package/dist/claude/transcript/cursor-io.js.map +1 -1
  91. package/dist/claude/transcript/cursor.d.ts +5 -3
  92. package/dist/claude/transcript/cursor.d.ts.map +1 -1
  93. package/dist/claude/transcript/cursor.js +18 -8
  94. package/dist/claude/transcript/cursor.js.map +1 -1
  95. package/dist/claude/transcript/drain-context.d.ts +4 -3
  96. package/dist/claude/transcript/drain-context.d.ts.map +1 -1
  97. package/dist/claude/transcript/drain-context.js.map +1 -1
  98. package/dist/claude/transcript/emit.d.ts +2 -1
  99. package/dist/claude/transcript/emit.d.ts.map +1 -1
  100. package/dist/claude/transcript/emit.js +1 -0
  101. package/dist/claude/transcript/emit.js.map +1 -1
  102. package/dist/claude/transcript/index.d.ts.map +1 -1
  103. package/dist/claude/transcript/index.js +2 -2
  104. package/dist/claude/transcript/index.js.map +1 -1
  105. package/dist/claude/transcript/warnings.d.ts +2 -1
  106. package/dist/claude/transcript/warnings.d.ts.map +1 -1
  107. package/dist/claude/transcript/warnings.js +3 -2
  108. package/dist/claude/transcript/warnings.js.map +1 -1
  109. package/dist/cli/config/effective.d.ts +2 -2
  110. package/dist/cli/config/effective.d.ts.map +1 -1
  111. package/dist/cli/config/effective.js +0 -2
  112. package/dist/cli/config/effective.js.map +1 -1
  113. package/dist/cli/interactive/spawn.d.ts +0 -2
  114. package/dist/cli/interactive/spawn.d.ts.map +1 -1
  115. package/dist/cli/interactive/spawn.js +27 -24
  116. package/dist/cli/interactive/spawn.js.map +1 -1
  117. package/dist/cli/lifecycle/index.d.ts.map +1 -1
  118. package/dist/cli/lifecycle/index.js +5 -3
  119. package/dist/cli/lifecycle/index.js.map +1 -1
  120. package/dist/cli/main-failure.d.ts.map +1 -1
  121. package/dist/cli/main-failure.js +5 -2
  122. package/dist/cli/main-failure.js.map +1 -1
  123. package/dist/cli/models/combined.d.ts.map +1 -1
  124. package/dist/cli/models/combined.js +3 -2
  125. package/dist/cli/models/combined.js.map +1 -1
  126. package/dist/cli/models/render.d.ts.map +1 -1
  127. package/dist/cli/models/render.js +2 -1
  128. package/dist/cli/models/render.js.map +1 -1
  129. package/dist/cli/output/cleanup-error.d.ts +22 -0
  130. package/dist/cli/output/cleanup-error.d.ts.map +1 -0
  131. package/dist/cli/output/cleanup-error.js +67 -0
  132. package/dist/cli/output/cleanup-error.js.map +1 -0
  133. package/dist/cli/output/types.d.ts +6 -2
  134. package/dist/cli/output/types.d.ts.map +1 -1
  135. package/dist/cli/request/agent-detect.d.ts +6 -2
  136. package/dist/cli/request/agent-detect.d.ts.map +1 -1
  137. package/dist/cli/request/agent-detect.js +14 -6
  138. package/dist/cli/request/agent-detect.js.map +1 -1
  139. package/dist/cli/request/finalize.d.ts +1 -1
  140. package/dist/cli/request/finalize.d.ts.map +1 -1
  141. package/dist/cli/request/finalize.js +4 -25
  142. package/dist/cli/request/finalize.js.map +1 -1
  143. package/dist/cli/request/index.d.ts.map +1 -1
  144. package/dist/cli/request/index.js +11 -5
  145. package/dist/cli/request/index.js.map +1 -1
  146. package/dist/cli/request/path-replacement.d.ts +27 -0
  147. package/dist/cli/request/path-replacement.d.ts.map +1 -0
  148. package/dist/cli/request/path-replacement.js +79 -0
  149. package/dist/cli/request/path-replacement.js.map +1 -0
  150. package/dist/cli/request/workspace.d.ts +8 -0
  151. package/dist/cli/request/workspace.d.ts.map +1 -0
  152. package/dist/cli/request/workspace.js +50 -0
  153. package/dist/cli/request/workspace.js.map +1 -0
  154. package/dist/cli/run/output.d.ts.map +1 -1
  155. package/dist/cli/run/output.js +2 -1
  156. package/dist/cli/run/output.js.map +1 -1
  157. package/dist/cli/run/subscribe.d.ts.map +1 -1
  158. package/dist/cli/run/subscribe.js +1 -1
  159. package/dist/cli/run/subscribe.js.map +1 -1
  160. package/dist/cli/session/index.d.ts +4 -4
  161. package/dist/cli/session/index.d.ts.map +1 -1
  162. package/dist/cli/session/index.js +5 -5
  163. package/dist/cli/session/index.js.map +1 -1
  164. package/dist/cli/session/launch.d.ts +2 -2
  165. package/dist/cli/session/launch.d.ts.map +1 -1
  166. package/dist/cli/session/launch.js +12 -3
  167. package/dist/cli/session/launch.js.map +1 -1
  168. package/dist/cli/session/turn-readers.d.ts +14 -0
  169. package/dist/cli/session/turn-readers.d.ts.map +1 -0
  170. package/dist/cli/session/turn-readers.js +13 -0
  171. package/dist/cli/session/turn-readers.js.map +1 -0
  172. package/dist/codex/config/default-model.d.ts +24 -0
  173. package/dist/codex/config/default-model.d.ts.map +1 -0
  174. package/dist/codex/config/default-model.js +133 -0
  175. package/dist/codex/config/default-model.js.map +1 -0
  176. package/dist/codex/config/home.d.ts +35 -0
  177. package/dist/codex/config/home.d.ts.map +1 -0
  178. package/dist/codex/config/home.js +122 -0
  179. package/dist/codex/config/home.js.map +1 -0
  180. package/dist/codex/config/lock.d.ts +17 -11
  181. package/dist/codex/config/lock.d.ts.map +1 -1
  182. package/dist/codex/config/lock.js +102 -11
  183. package/dist/codex/config/lock.js.map +1 -1
  184. package/dist/codex/config/read.d.ts +16 -0
  185. package/dist/codex/config/read.d.ts.map +1 -0
  186. package/dist/codex/config/read.js +75 -0
  187. package/dist/codex/config/read.js.map +1 -0
  188. package/dist/codex/config/restore.d.ts +17 -7
  189. package/dist/codex/config/restore.d.ts.map +1 -1
  190. package/dist/codex/config/restore.js +33 -20
  191. package/dist/codex/config/restore.js.map +1 -1
  192. package/dist/codex/config/transaction.d.ts +6 -4
  193. package/dist/codex/config/transaction.d.ts.map +1 -1
  194. package/dist/codex/config/transaction.js +4 -3
  195. package/dist/codex/config/transaction.js.map +1 -1
  196. package/dist/codex/images/clipboard-copies.d.ts +39 -0
  197. package/dist/codex/images/clipboard-copies.d.ts.map +1 -0
  198. package/dist/codex/images/clipboard-copies.js +91 -0
  199. package/dist/codex/images/clipboard-copies.js.map +1 -0
  200. package/dist/codex/model-picker.d.ts +1 -1
  201. package/dist/codex/model-picker.d.ts.map +1 -1
  202. package/dist/codex/model-picker.js +16 -6
  203. package/dist/codex/model-picker.js.map +1 -1
  204. package/dist/codex/preflight.d.ts +2 -2
  205. package/dist/codex/preflight.d.ts.map +1 -1
  206. package/dist/codex/preflight.js +28 -21
  207. package/dist/codex/preflight.js.map +1 -1
  208. package/dist/codex/pty.d.ts +25 -3
  209. package/dist/codex/pty.d.ts.map +1 -1
  210. package/dist/codex/pty.js +53 -7
  211. package/dist/codex/pty.js.map +1 -1
  212. package/dist/codex/questions/candidates.d.ts.map +1 -1
  213. package/dist/codex/questions/candidates.js +4 -5
  214. package/dist/codex/questions/candidates.js.map +1 -1
  215. package/dist/codex/questions/driver.js +2 -2
  216. package/dist/codex/questions/driver.js.map +1 -1
  217. package/dist/codex/questions/records.d.ts +1 -1
  218. package/dist/codex/questions/records.d.ts.map +1 -1
  219. package/dist/codex/questions/records.js +1 -3
  220. package/dist/codex/questions/records.js.map +1 -1
  221. package/dist/codex/screen/clearance.d.ts +6 -0
  222. package/dist/codex/screen/clearance.d.ts.map +1 -1
  223. package/dist/codex/screen/clearance.js +10 -0
  224. package/dist/codex/screen/clearance.js.map +1 -1
  225. package/dist/codex/screen-table.d.ts.map +1 -1
  226. package/dist/codex/screen-table.js +6 -2
  227. package/dist/codex/screen-table.js.map +1 -1
  228. package/dist/codex/session/bridge.d.ts +1 -0
  229. package/dist/codex/session/bridge.d.ts.map +1 -1
  230. package/dist/codex/session/bridge.js +3 -1
  231. package/dist/codex/session/bridge.js.map +1 -1
  232. package/dist/codex/session/build.d.ts.map +1 -1
  233. package/dist/codex/session/build.js +14 -12
  234. package/dist/codex/session/build.js.map +1 -1
  235. package/dist/codex/session/cleanup.d.ts +2 -2
  236. package/dist/codex/session/cleanup.d.ts.map +1 -1
  237. package/dist/codex/session/cleanup.js +8 -11
  238. package/dist/codex/session/cleanup.js.map +1 -1
  239. package/dist/codex/session/config-switch.d.ts +20 -0
  240. package/dist/codex/session/config-switch.d.ts.map +1 -0
  241. package/dist/codex/session/config-switch.js +42 -0
  242. package/dist/codex/session/config-switch.js.map +1 -0
  243. package/dist/codex/session/hooks.d.ts.map +1 -1
  244. package/dist/codex/session/hooks.js +7 -0
  245. package/dist/codex/session/hooks.js.map +1 -1
  246. package/dist/codex/session/index.d.ts.map +1 -1
  247. package/dist/codex/session/index.js +34 -16
  248. package/dist/codex/session/index.js.map +1 -1
  249. package/dist/codex/session/instance.d.ts +10 -12
  250. package/dist/codex/session/instance.d.ts.map +1 -1
  251. package/dist/codex/session/instance.js +42 -37
  252. package/dist/codex/session/instance.js.map +1 -1
  253. package/dist/codex/session/readiness.d.ts +11 -0
  254. package/dist/codex/session/readiness.d.ts.map +1 -0
  255. package/dist/codex/session/readiness.js +22 -0
  256. package/dist/codex/session/readiness.js.map +1 -0
  257. package/dist/codex/session/resume.d.ts.map +1 -1
  258. package/dist/codex/session/resume.js +9 -4
  259. package/dist/codex/session/resume.js.map +1 -1
  260. package/dist/codex/session/transcript.d.ts.map +1 -1
  261. package/dist/codex/session/transcript.js +12 -1
  262. package/dist/codex/session/transcript.js.map +1 -1
  263. package/dist/codex/session/turn-commit.d.ts +58 -0
  264. package/dist/codex/session/turn-commit.d.ts.map +1 -0
  265. package/dist/codex/session/turn-commit.js +97 -0
  266. package/dist/codex/session/turn-commit.js.map +1 -0
  267. package/dist/codex/session/warnings.d.ts +13 -6
  268. package/dist/codex/session/warnings.d.ts.map +1 -1
  269. package/dist/codex/session/warnings.js +36 -9
  270. package/dist/codex/session/warnings.js.map +1 -1
  271. package/dist/codex/startup-prompts.d.ts +3 -0
  272. package/dist/codex/startup-prompts.d.ts.map +1 -1
  273. package/dist/codex/startup-prompts.js +20 -13
  274. package/dist/codex/startup-prompts.js.map +1 -1
  275. package/dist/codex/startup-warnings.d.ts +2 -0
  276. package/dist/codex/startup-warnings.d.ts.map +1 -1
  277. package/dist/codex/startup-warnings.js +6 -0
  278. package/dist/codex/startup-warnings.js.map +1 -1
  279. package/dist/codex/transcript/payload.d.ts +8 -0
  280. package/dist/codex/transcript/payload.d.ts.map +1 -0
  281. package/dist/codex/transcript/payload.js +11 -0
  282. package/dist/codex/transcript/payload.js.map +1 -0
  283. package/dist/codex/transcript/rejection.d.ts +15 -0
  284. package/dist/codex/transcript/rejection.d.ts.map +1 -0
  285. package/dist/codex/transcript/rejection.js +44 -0
  286. package/dist/codex/transcript/rejection.js.map +1 -0
  287. package/dist/codex/transcript/turn-end.d.ts +8 -0
  288. package/dist/codex/transcript/turn-end.d.ts.map +1 -0
  289. package/dist/codex/transcript/turn-end.js +17 -0
  290. package/dist/codex/transcript/turn-end.js.map +1 -0
  291. package/dist/codex/transcript/watcher.d.ts +5 -2
  292. package/dist/codex/transcript/watcher.d.ts.map +1 -1
  293. package/dist/codex/transcript/watcher.js +11 -6
  294. package/dist/codex/transcript/watcher.js.map +1 -1
  295. package/dist/codex/trust-retry.d.ts +12 -0
  296. package/dist/codex/trust-retry.d.ts.map +1 -0
  297. package/dist/codex/trust-retry.js +12 -0
  298. package/dist/codex/trust-retry.js.map +1 -0
  299. package/dist/codex/update/skip-attempt.d.ts +2 -0
  300. package/dist/codex/update/skip-attempt.d.ts.map +1 -1
  301. package/dist/codex/update/skip-attempt.js +4 -0
  302. package/dist/codex/update/skip-attempt.js.map +1 -1
  303. package/dist/codex/update/tracker.d.ts +2 -0
  304. package/dist/codex/update/tracker.d.ts.map +1 -1
  305. package/dist/codex/update/tracker.js +4 -0
  306. package/dist/codex/update/tracker.js.map +1 -1
  307. package/dist/core/delay.d.ts +3 -2
  308. package/dist/core/delay.d.ts.map +1 -1
  309. package/dist/core/delay.js +3 -2
  310. package/dist/core/delay.js.map +1 -1
  311. package/dist/core/errors.d.ts +33 -4
  312. package/dist/core/errors.d.ts.map +1 -1
  313. package/dist/core/errors.js +51 -7
  314. package/dist/core/errors.js.map +1 -1
  315. package/dist/core/images/materialize.d.ts +13 -4
  316. package/dist/core/images/materialize.d.ts.map +1 -1
  317. package/dist/core/images/materialize.js +48 -11
  318. package/dist/core/images/materialize.js.map +1 -1
  319. package/dist/core/input/abort.d.ts +15 -0
  320. package/dist/core/input/abort.d.ts.map +1 -1
  321. package/dist/core/input/abort.js +18 -2
  322. package/dist/core/input/abort.js.map +1 -1
  323. package/dist/core/input/constants.d.ts +4 -1
  324. package/dist/core/input/constants.d.ts.map +1 -1
  325. package/dist/core/input/constants.js +4 -1
  326. package/dist/core/input/constants.js.map +1 -1
  327. package/dist/core/input/index.d.ts +1 -1
  328. package/dist/core/input/index.d.ts.map +1 -1
  329. package/dist/core/input/index.js +1 -1
  330. package/dist/core/input/index.js.map +1 -1
  331. package/dist/core/models/clearance.d.ts +38 -0
  332. package/dist/core/models/clearance.d.ts.map +1 -0
  333. package/dist/core/models/clearance.js +38 -0
  334. package/dist/core/models/clearance.js.map +1 -0
  335. package/dist/core/models/close-wait.d.ts +17 -0
  336. package/dist/core/models/close-wait.d.ts.map +1 -0
  337. package/dist/core/models/close-wait.js +44 -0
  338. package/dist/core/models/close-wait.js.map +1 -0
  339. package/dist/core/models/dialog-region.d.ts +18 -3
  340. package/dist/core/models/dialog-region.d.ts.map +1 -1
  341. package/dist/core/models/dialog-region.js +29 -40
  342. package/dist/core/models/dialog-region.js.map +1 -1
  343. package/dist/core/models/input.d.ts +10 -1
  344. package/dist/core/models/input.d.ts.map +1 -1
  345. package/dist/core/models/input.js +15 -2
  346. package/dist/core/models/input.js.map +1 -1
  347. package/dist/core/models/intervention.d.ts +2 -2
  348. package/dist/core/models/intervention.d.ts.map +1 -1
  349. package/dist/core/models/intervention.js +6 -3
  350. package/dist/core/models/intervention.js.map +1 -1
  351. package/dist/core/models/own-picker.d.ts +21 -0
  352. package/dist/core/models/own-picker.d.ts.map +1 -0
  353. package/dist/core/models/own-picker.js +21 -0
  354. package/dist/core/models/own-picker.js.map +1 -0
  355. package/dist/core/models/picker.d.ts +34 -4
  356. package/dist/core/models/picker.d.ts.map +1 -1
  357. package/dist/core/models/picker.js +50 -44
  358. package/dist/core/models/picker.js.map +1 -1
  359. package/dist/core/models/row-block.d.ts +66 -0
  360. package/dist/core/models/row-block.d.ts.map +1 -0
  361. package/dist/core/models/row-block.js +87 -0
  362. package/dist/core/models/row-block.js.map +1 -0
  363. package/dist/core/models/rows.d.ts +32 -3
  364. package/dist/core/models/rows.d.ts.map +1 -1
  365. package/dist/core/models/rows.js +48 -20
  366. package/dist/core/models/rows.js.map +1 -1
  367. package/dist/core/models/tui-screen.d.ts +6 -1
  368. package/dist/core/models/tui-screen.d.ts.map +1 -1
  369. package/dist/core/models/tui-screen.js +25 -10
  370. package/dist/core/models/tui-screen.js.map +1 -1
  371. package/dist/core/models/window.d.ts +49 -0
  372. package/dist/core/models/window.d.ts.map +1 -0
  373. package/dist/core/models/window.js +105 -0
  374. package/dist/core/models/window.js.map +1 -0
  375. package/dist/core/path-trust.d.ts +11 -0
  376. package/dist/core/path-trust.d.ts.map +1 -0
  377. package/dist/core/path-trust.js +21 -0
  378. package/dist/core/path-trust.js.map +1 -0
  379. package/dist/core/screen-facts.d.ts +3 -1
  380. package/dist/core/screen-facts.d.ts.map +1 -1
  381. package/dist/core/screen-facts.js +1 -0
  382. package/dist/core/screen-facts.js.map +1 -1
  383. package/dist/core/simple/boundary-signal.d.ts +41 -6
  384. package/dist/core/simple/boundary-signal.d.ts.map +1 -1
  385. package/dist/core/simple/boundary-signal.js +43 -3
  386. package/dist/core/simple/boundary-signal.js.map +1 -1
  387. package/dist/core/simple/close.d.ts +2 -1
  388. package/dist/core/simple/close.d.ts.map +1 -1
  389. package/dist/core/simple/close.js +10 -2
  390. package/dist/core/simple/close.js.map +1 -1
  391. package/dist/core/simple/turn-boundary.d.ts +2 -0
  392. package/dist/core/simple/turn-boundary.d.ts.map +1 -1
  393. package/dist/core/simple/turn-boundary.js +1 -1
  394. package/dist/core/simple/turn-boundary.js.map +1 -1
  395. package/dist/core/simple/turn-types.d.ts +9 -3
  396. package/dist/core/simple/turn-types.d.ts.map +1 -1
  397. package/dist/core/simple/turn-types.js +10 -2
  398. package/dist/core/simple/turn-types.js.map +1 -1
  399. package/dist/core/simple/turn.d.ts +2 -0
  400. package/dist/core/simple/turn.d.ts.map +1 -1
  401. package/dist/core/simple/turn.js +11 -5
  402. package/dist/core/simple/turn.js.map +1 -1
  403. package/dist/core/terminal-options.d.ts +17 -1
  404. package/dist/core/terminal-options.d.ts.map +1 -1
  405. package/dist/core/terminal-options.js +20 -8
  406. package/dist/core/terminal-options.js.map +1 -1
  407. package/dist/core/transcript/cursor-io.d.ts +8 -0
  408. package/dist/core/transcript/cursor-io.d.ts.map +1 -1
  409. package/dist/core/transcript/cursor-io.js +11 -5
  410. package/dist/core/transcript/cursor-io.js.map +1 -1
  411. package/dist/core/transcript/cursor.d.ts +28 -4
  412. package/dist/core/transcript/cursor.d.ts.map +1 -1
  413. package/dist/core/transcript/cursor.js +53 -7
  414. package/dist/core/transcript/cursor.js.map +1 -1
  415. package/dist/core/transcript/drain.d.ts +43 -0
  416. package/dist/core/transcript/drain.d.ts.map +1 -0
  417. package/dist/core/transcript/drain.js +67 -0
  418. package/dist/core/transcript/drain.js.map +1 -0
  419. package/dist/core/trust/abortable.d.ts +12 -0
  420. package/dist/core/trust/abortable.d.ts.map +1 -0
  421. package/dist/core/trust/abortable.js +48 -0
  422. package/dist/core/trust/abortable.js.map +1 -0
  423. package/dist/core/trust/allowlist.d.ts +2 -0
  424. package/dist/core/trust/allowlist.d.ts.map +1 -1
  425. package/dist/core/trust/allowlist.js +4 -1
  426. package/dist/core/trust/allowlist.js.map +1 -1
  427. package/dist/core/trust/blocking.d.ts +11 -0
  428. package/dist/core/trust/blocking.d.ts.map +1 -1
  429. package/dist/core/trust/blocking.js +5 -4
  430. package/dist/core/trust/blocking.js.map +1 -1
  431. package/dist/core/trust/copy.d.ts.map +1 -1
  432. package/dist/core/trust/copy.js +7 -1
  433. package/dist/core/trust/copy.js.map +1 -1
  434. package/dist/core/trust/deadline.d.ts +24 -0
  435. package/dist/core/trust/deadline.d.ts.map +1 -0
  436. package/dist/core/trust/deadline.js +56 -0
  437. package/dist/core/trust/deadline.js.map +1 -0
  438. package/dist/core/trust/dialog.d.ts +11 -2
  439. package/dist/core/trust/dialog.d.ts.map +1 -1
  440. package/dist/core/trust/dialog.js +12 -3
  441. package/dist/core/trust/dialog.js.map +1 -1
  442. package/dist/core/trust/options.d.ts +5 -1
  443. package/dist/core/trust/options.d.ts.map +1 -1
  444. package/dist/core/trust/options.js +8 -2
  445. package/dist/core/trust/options.js.map +1 -1
  446. package/dist/core/trust/prompts.d.ts +3 -0
  447. package/dist/core/trust/prompts.d.ts.map +1 -1
  448. package/dist/core/trust/prompts.js +2 -1
  449. package/dist/core/trust/prompts.js.map +1 -1
  450. package/dist/core/trust/responder.d.ts +10 -5
  451. package/dist/core/trust/responder.d.ts.map +1 -1
  452. package/dist/core/trust/responder.js +37 -33
  453. package/dist/core/trust/responder.js.map +1 -1
  454. package/dist/core/trust/step.d.ts +67 -0
  455. package/dist/core/trust/step.d.ts.map +1 -0
  456. package/dist/core/trust/step.js +45 -0
  457. package/dist/core/trust/step.js.map +1 -0
  458. package/dist/core/trust/types.d.ts +21 -1
  459. package/dist/core/trust/types.d.ts.map +1 -1
  460. package/dist/core/trust/types.js +25 -1
  461. package/dist/core/trust/types.js.map +1 -1
  462. package/dist/core/trust/view.d.ts +2 -0
  463. package/dist/core/trust/view.d.ts.map +1 -1
  464. package/dist/core/trust/view.js +3 -0
  465. package/dist/core/trust/view.js.map +1 -1
  466. package/dist/core/trust/write.d.ts +31 -6
  467. package/dist/core/trust/write.d.ts.map +1 -1
  468. package/dist/core/trust/write.js +95 -80
  469. package/dist/core/trust/write.js.map +1 -1
  470. package/dist/core/turn-state.d.ts +18 -4
  471. package/dist/core/turn-state.d.ts.map +1 -1
  472. package/dist/core/turn-state.js +47 -25
  473. package/dist/core/turn-state.js.map +1 -1
  474. package/dist/core/warnings/images.d.ts +22 -0
  475. package/dist/core/warnings/images.d.ts.map +1 -0
  476. package/dist/core/warnings/images.js +3 -0
  477. package/dist/core/warnings/images.js.map +1 -0
  478. package/dist/core/warnings/index.d.ts +3 -2
  479. package/dist/core/warnings/index.d.ts.map +1 -1
  480. package/dist/core/warnings/lifecycle.d.ts +35 -4
  481. package/dist/core/warnings/lifecycle.d.ts.map +1 -1
  482. package/dist/core/warnings/lifecycle.js +1 -1
  483. package/dist/core/warnings/update.d.ts +8 -4
  484. package/dist/core/warnings/update.d.ts.map +1 -1
  485. package/dist/core/warnings/update.js +21 -6
  486. package/dist/core/warnings/update.js.map +1 -1
  487. package/dist/pty/exit-latch.d.ts +28 -0
  488. package/dist/pty/exit-latch.d.ts.map +1 -0
  489. package/dist/pty/exit-latch.js +50 -0
  490. package/dist/pty/exit-latch.js.map +1 -0
  491. package/dist/runtime/exit-status.d.ts +7 -0
  492. package/dist/runtime/exit-status.d.ts.map +1 -0
  493. package/dist/runtime/exit-status.js +13 -0
  494. package/dist/runtime/exit-status.js.map +1 -0
  495. package/dist/runtime/home-guard/index.d.ts +45 -0
  496. package/dist/runtime/home-guard/index.d.ts.map +1 -0
  497. package/dist/runtime/home-guard/index.js +69 -0
  498. package/dist/runtime/home-guard/index.js.map +1 -0
  499. package/dist/runtime/loop-restore.d.ts +9 -9
  500. package/dist/runtime/loop-restore.d.ts.map +1 -1
  501. package/dist/runtime/loop-restore.js +10 -10
  502. package/dist/runtime/loop-restore.js.map +1 -1
  503. package/dist/runtime/probe/capped-buffer.d.ts +16 -0
  504. package/dist/runtime/probe/capped-buffer.d.ts.map +1 -0
  505. package/dist/runtime/probe/capped-buffer.js +38 -0
  506. package/dist/runtime/probe/capped-buffer.js.map +1 -0
  507. package/dist/runtime/probe/capture.d.ts +55 -0
  508. package/dist/runtime/probe/capture.d.ts.map +1 -0
  509. package/dist/runtime/probe/capture.js +71 -0
  510. package/dist/runtime/probe/capture.js.map +1 -0
  511. package/dist/runtime/{probe-cleanup.d.ts → probe/cleanup.d.ts} +2 -2
  512. package/dist/runtime/probe/cleanup.d.ts.map +1 -0
  513. package/dist/runtime/{probe-cleanup.js → probe/cleanup.js} +3 -3
  514. package/dist/runtime/probe/cleanup.js.map +1 -0
  515. package/dist/runtime/probe/directory-key.d.ts +26 -0
  516. package/dist/runtime/probe/directory-key.d.ts.map +1 -0
  517. package/dist/runtime/probe/directory-key.js +46 -0
  518. package/dist/runtime/probe/directory-key.js.map +1 -0
  519. package/dist/runtime/probe/index.d.ts +25 -0
  520. package/dist/runtime/probe/index.d.ts.map +1 -0
  521. package/dist/runtime/probe/index.js +153 -0
  522. package/dist/runtime/probe/index.js.map +1 -0
  523. package/dist/runtime/probe/lookup.d.ts +12 -0
  524. package/dist/runtime/probe/lookup.d.ts.map +1 -0
  525. package/dist/runtime/probe/lookup.js +29 -0
  526. package/dist/runtime/probe/lookup.js.map +1 -0
  527. package/dist/runtime/probe/named-pipes.d.ts +35 -0
  528. package/dist/runtime/probe/named-pipes.d.ts.map +1 -0
  529. package/dist/runtime/probe/named-pipes.js +167 -0
  530. package/dist/runtime/probe/named-pipes.js.map +1 -0
  531. package/dist/runtime/probe/private-directory.d.ts +14 -0
  532. package/dist/runtime/probe/private-directory.d.ts.map +1 -0
  533. package/dist/runtime/probe/private-directory.js +50 -0
  534. package/dist/runtime/probe/private-directory.js.map +1 -0
  535. package/dist/runtime/probe/results.d.ts +14 -0
  536. package/dist/runtime/probe/results.d.ts.map +1 -0
  537. package/dist/runtime/probe/results.js +38 -0
  538. package/dist/runtime/probe/results.js.map +1 -0
  539. package/dist/runtime/probe/slots.d.ts +17 -0
  540. package/dist/runtime/probe/slots.d.ts.map +1 -0
  541. package/dist/runtime/probe/slots.js +35 -0
  542. package/dist/runtime/probe/slots.js.map +1 -0
  543. package/dist/runtime/probe/start.d.ts +64 -0
  544. package/dist/runtime/probe/start.d.ts.map +1 -0
  545. package/dist/runtime/probe/start.js +80 -0
  546. package/dist/runtime/probe/start.js.map +1 -0
  547. package/dist/runtime/probe-cache.d.ts +19 -0
  548. package/dist/runtime/probe-cache.d.ts.map +1 -0
  549. package/dist/runtime/probe-cache.js +56 -0
  550. package/dist/runtime/probe-cache.js.map +1 -0
  551. package/dist/runtime/readiness/initial-ready.d.ts +31 -5
  552. package/dist/runtime/readiness/initial-ready.d.ts.map +1 -1
  553. package/dist/runtime/readiness/initial-ready.js +64 -18
  554. package/dist/runtime/readiness/initial-ready.js.map +1 -1
  555. package/dist/runtime/seams.d.ts +14 -2
  556. package/dist/runtime/seams.d.ts.map +1 -1
  557. package/dist/runtime/seams.js +2 -2
  558. package/dist/runtime/seams.js.map +1 -1
  559. package/dist/runtime/session/base.d.ts.map +1 -1
  560. package/dist/runtime/session/base.js +9 -6
  561. package/dist/runtime/session/base.js.map +1 -1
  562. package/dist/runtime/session/commands.d.ts +6 -4
  563. package/dist/runtime/session/commands.d.ts.map +1 -1
  564. package/dist/runtime/session/commands.js +5 -2
  565. package/dist/runtime/session/commands.js.map +1 -1
  566. package/dist/runtime/session/frames.d.ts +12 -2
  567. package/dist/runtime/session/frames.d.ts.map +1 -1
  568. package/dist/runtime/session/frames.js +10 -3
  569. package/dist/runtime/session/frames.js.map +1 -1
  570. package/dist/runtime/session/image-attach.js +7 -2
  571. package/dist/runtime/session/image-attach.js.map +1 -1
  572. package/dist/runtime/session/launch-directory.d.ts +33 -0
  573. package/dist/runtime/session/launch-directory.d.ts.map +1 -0
  574. package/dist/runtime/session/launch-directory.js +84 -0
  575. package/dist/runtime/session/launch-directory.js.map +1 -0
  576. package/dist/runtime/session/lifecycle.d.ts +3 -3
  577. package/dist/runtime/session/lifecycle.d.ts.map +1 -1
  578. package/dist/runtime/session/lifecycle.js +1 -5
  579. package/dist/runtime/session/lifecycle.js.map +1 -1
  580. package/dist/runtime/session/loops.d.ts +1 -1
  581. package/dist/runtime/session/loops.d.ts.map +1 -1
  582. package/dist/runtime/session/loops.js +6 -3
  583. package/dist/runtime/session/loops.js.map +1 -1
  584. package/dist/runtime/session/picker-cleanup.d.ts +6 -21
  585. package/dist/runtime/session/picker-cleanup.d.ts.map +1 -1
  586. package/dist/runtime/session/picker-cleanup.js +19 -31
  587. package/dist/runtime/session/picker-cleanup.js.map +1 -1
  588. package/dist/runtime/session/picker-hold.d.ts +24 -0
  589. package/dist/runtime/session/picker-hold.d.ts.map +1 -0
  590. package/dist/runtime/session/picker-hold.js +42 -0
  591. package/dist/runtime/session/picker-hold.js.map +1 -0
  592. package/dist/runtime/session/picker.d.ts +15 -13
  593. package/dist/runtime/session/picker.d.ts.map +1 -1
  594. package/dist/runtime/session/picker.js +49 -27
  595. package/dist/runtime/session/picker.js.map +1 -1
  596. package/dist/runtime/session/prepare-state.d.ts +6 -0
  597. package/dist/runtime/session/prepare-state.d.ts.map +1 -0
  598. package/dist/runtime/session/prepare-state.js +14 -0
  599. package/dist/runtime/session/prepare-state.js.map +1 -0
  600. package/dist/runtime/session/questions.d.ts +2 -2
  601. package/dist/runtime/session/questions.d.ts.map +1 -1
  602. package/dist/runtime/session/questions.js.map +1 -1
  603. package/dist/runtime/session/readiness.d.ts +14 -5
  604. package/dist/runtime/session/readiness.d.ts.map +1 -1
  605. package/dist/runtime/session/readiness.js +22 -6
  606. package/dist/runtime/session/readiness.js.map +1 -1
  607. package/dist/runtime/session/reap.d.ts +11 -7
  608. package/dist/runtime/session/reap.d.ts.map +1 -1
  609. package/dist/runtime/session/reap.js +16 -10
  610. package/dist/runtime/session/reap.js.map +1 -1
  611. package/dist/runtime/session/runtime-cleanup.d.ts +18 -0
  612. package/dist/runtime/session/runtime-cleanup.d.ts.map +1 -0
  613. package/dist/runtime/session/runtime-cleanup.js +18 -0
  614. package/dist/runtime/session/runtime-cleanup.js.map +1 -0
  615. package/dist/runtime/session/session-input.d.ts +32 -0
  616. package/dist/runtime/session/session-input.d.ts.map +1 -0
  617. package/dist/runtime/session/{picker-input.js → session-input.js} +35 -7
  618. package/dist/runtime/session/session-input.js.map +1 -0
  619. package/dist/runtime/session/shutdown-binding.d.ts +12 -1
  620. package/dist/runtime/session/shutdown-binding.d.ts.map +1 -1
  621. package/dist/runtime/session/shutdown-binding.js +33 -1
  622. package/dist/runtime/session/shutdown-binding.js.map +1 -1
  623. package/dist/runtime/session/shutdown-cleanup.d.ts +17 -0
  624. package/dist/runtime/session/shutdown-cleanup.d.ts.map +1 -0
  625. package/dist/runtime/session/shutdown-cleanup.js +49 -0
  626. package/dist/runtime/session/shutdown-cleanup.js.map +1 -0
  627. package/dist/runtime/session/shutdown.d.ts +3 -2
  628. package/dist/runtime/session/shutdown.d.ts.map +1 -1
  629. package/dist/runtime/session/shutdown.js +13 -24
  630. package/dist/runtime/session/shutdown.js.map +1 -1
  631. package/dist/runtime/shell-quote.d.ts +8 -0
  632. package/dist/runtime/shell-quote.d.ts.map +1 -0
  633. package/dist/runtime/shell-quote.js +10 -0
  634. package/dist/runtime/shell-quote.js.map +1 -0
  635. package/dist/runtime/shell.d.ts +36 -12
  636. package/dist/runtime/shell.d.ts.map +1 -1
  637. package/dist/runtime/shell.js +90 -14
  638. package/dist/runtime/shell.js.map +1 -1
  639. package/dist/runtime/shutdown/coalesce.d.ts +15 -0
  640. package/dist/runtime/shutdown/coalesce.d.ts.map +1 -0
  641. package/dist/runtime/shutdown/coalesce.js +42 -0
  642. package/dist/runtime/shutdown/coalesce.js.map +1 -0
  643. package/dist/runtime/shutdown/detached-sweep/failures.d.ts +24 -0
  644. package/dist/runtime/shutdown/detached-sweep/failures.d.ts.map +1 -0
  645. package/dist/runtime/shutdown/detached-sweep/failures.js +32 -0
  646. package/dist/runtime/shutdown/detached-sweep/failures.js.map +1 -0
  647. package/dist/runtime/shutdown/detached-sweep/index.d.ts +55 -0
  648. package/dist/runtime/shutdown/detached-sweep/index.d.ts.map +1 -0
  649. package/dist/runtime/shutdown/detached-sweep/index.js +129 -0
  650. package/dist/runtime/shutdown/detached-sweep/index.js.map +1 -0
  651. package/dist/runtime/shutdown/detached-sweep/kill.d.ts +37 -0
  652. package/dist/runtime/shutdown/detached-sweep/kill.d.ts.map +1 -0
  653. package/dist/runtime/shutdown/detached-sweep/kill.js +87 -0
  654. package/dist/runtime/shutdown/detached-sweep/kill.js.map +1 -0
  655. package/dist/runtime/shutdown/detached-sweep/record.d.ts +67 -0
  656. package/dist/runtime/shutdown/detached-sweep/record.d.ts.map +1 -0
  657. package/dist/runtime/shutdown/detached-sweep/record.js +111 -0
  658. package/dist/runtime/shutdown/detached-sweep/record.js.map +1 -0
  659. package/dist/runtime/shutdown/detached-sweep/rounds.d.ts +78 -0
  660. package/dist/runtime/shutdown/detached-sweep/rounds.d.ts.map +1 -0
  661. package/dist/runtime/shutdown/detached-sweep/rounds.js +116 -0
  662. package/dist/runtime/shutdown/detached-sweep/rounds.js.map +1 -0
  663. package/dist/runtime/shutdown/detached-sweep/survivors.d.ts +40 -0
  664. package/dist/runtime/shutdown/detached-sweep/survivors.d.ts.map +1 -0
  665. package/dist/runtime/shutdown/detached-sweep/survivors.js +112 -0
  666. package/dist/runtime/shutdown/detached-sweep/survivors.js.map +1 -0
  667. package/dist/runtime/shutdown/leader-group.d.ts +29 -0
  668. package/dist/runtime/shutdown/leader-group.d.ts.map +1 -0
  669. package/dist/runtime/shutdown/leader-group.js +35 -0
  670. package/dist/runtime/shutdown/leader-group.js.map +1 -0
  671. package/dist/runtime/shutdown/native-read-admission.d.ts +13 -0
  672. package/dist/runtime/shutdown/native-read-admission.d.ts.map +1 -0
  673. package/dist/runtime/shutdown/native-read-admission.js +64 -0
  674. package/dist/runtime/shutdown/native-read-admission.js.map +1 -0
  675. package/dist/runtime/shutdown/process-table.d.ts +80 -0
  676. package/dist/runtime/shutdown/process-table.d.ts.map +1 -0
  677. package/dist/runtime/shutdown/process-table.js +147 -0
  678. package/dist/runtime/shutdown/process-table.js.map +1 -0
  679. package/dist/runtime/shutdown/process-tree-ops.d.ts +39 -0
  680. package/dist/runtime/shutdown/process-tree-ops.d.ts.map +1 -0
  681. package/dist/runtime/shutdown/process-tree-ops.js +73 -0
  682. package/dist/runtime/shutdown/process-tree-ops.js.map +1 -0
  683. package/dist/runtime/shutdown/read-timeout.d.ts +4 -0
  684. package/dist/runtime/shutdown/read-timeout.d.ts.map +1 -0
  685. package/dist/runtime/shutdown/read-timeout.js +6 -0
  686. package/dist/runtime/shutdown/read-timeout.js.map +1 -0
  687. package/dist/runtime/shutdown/reap-queue.d.ts +10 -0
  688. package/dist/runtime/shutdown/reap-queue.d.ts.map +1 -0
  689. package/dist/runtime/shutdown/reap-queue.js +29 -0
  690. package/dist/runtime/shutdown/reap-queue.js.map +1 -0
  691. package/dist/runtime/shutdown/reap-tree.d.ts +42 -32
  692. package/dist/runtime/shutdown/reap-tree.d.ts.map +1 -1
  693. package/dist/runtime/shutdown/reap-tree.js +78 -71
  694. package/dist/runtime/shutdown/reap-tree.js.map +1 -1
  695. package/dist/runtime/shutdown/shared-daemon.d.ts +59 -0
  696. package/dist/runtime/shutdown/shared-daemon.d.ts.map +1 -0
  697. package/dist/runtime/shutdown/shared-daemon.js +139 -0
  698. package/dist/runtime/shutdown/shared-daemon.js.map +1 -0
  699. package/dist/runtime/shutdown/teardown.d.ts +15 -0
  700. package/dist/runtime/shutdown/teardown.d.ts.map +1 -1
  701. package/dist/runtime/shutdown/teardown.js +19 -6
  702. package/dist/runtime/shutdown/teardown.js.map +1 -1
  703. package/dist/runtime/shutdown/terminate.d.ts +21 -1
  704. package/dist/runtime/shutdown/terminate.d.ts.map +1 -1
  705. package/dist/runtime/shutdown/terminate.js +83 -56
  706. package/dist/runtime/shutdown/terminate.js.map +1 -1
  707. package/dist/runtime/startup/buffer.d.ts +26 -7
  708. package/dist/runtime/startup/buffer.d.ts.map +1 -1
  709. package/dist/runtime/startup/buffer.js +42 -19
  710. package/dist/runtime/startup/buffer.js.map +1 -1
  711. package/dist/runtime/startup/cleanup.d.ts +37 -11
  712. package/dist/runtime/startup/cleanup.d.ts.map +1 -1
  713. package/dist/runtime/startup/cleanup.js +55 -25
  714. package/dist/runtime/startup/cleanup.js.map +1 -1
  715. package/dist/runtime/startup/index.d.ts +13 -1
  716. package/dist/runtime/startup/index.d.ts.map +1 -1
  717. package/dist/runtime/startup/index.js +38 -6
  718. package/dist/runtime/startup/index.js.map +1 -1
  719. package/dist/runtime/stream-marker.d.ts +17 -0
  720. package/dist/runtime/stream-marker.d.ts.map +1 -0
  721. package/dist/runtime/stream-marker.js +35 -0
  722. package/dist/runtime/stream-marker.js.map +1 -0
  723. package/dist/runtime/update/acquire.d.ts +16 -0
  724. package/dist/runtime/update/acquire.d.ts.map +1 -0
  725. package/dist/runtime/update/acquire.js +62 -0
  726. package/dist/runtime/update/acquire.js.map +1 -0
  727. package/dist/runtime/update/completion.d.ts +12 -0
  728. package/dist/runtime/update/completion.d.ts.map +1 -0
  729. package/dist/runtime/update/completion.js +50 -0
  730. package/dist/runtime/update/completion.js.map +1 -0
  731. package/dist/runtime/update/lock.d.ts +1 -1
  732. package/dist/runtime/update/lock.d.ts.map +1 -1
  733. package/dist/runtime/update/lock.js +21 -38
  734. package/dist/runtime/update/lock.js.map +1 -1
  735. package/dist/runtime/update/once.d.ts +16 -13
  736. package/dist/runtime/update/once.d.ts.map +1 -1
  737. package/dist/runtime/update/once.js +41 -31
  738. package/dist/runtime/update/once.js.map +1 -1
  739. package/dist/runtime/update/owner.js +1 -1
  740. package/dist/runtime/update/retained-lease.js +1 -1
  741. package/dist/runtime/update/waiting.d.ts +14 -1
  742. package/dist/runtime/update/waiting.d.ts.map +1 -1
  743. package/dist/runtime/update/waiting.js +20 -12
  744. package/dist/runtime/update/waiting.js.map +1 -1
  745. package/dist/state/canonical-path.d.ts +5 -0
  746. package/dist/state/canonical-path.d.ts.map +1 -1
  747. package/dist/state/canonical-path.js +11 -5
  748. package/dist/state/canonical-path.js.map +1 -1
  749. package/dist/state/directories.d.ts +31 -1
  750. package/dist/state/directories.d.ts.map +1 -1
  751. package/dist/state/directories.js +75 -13
  752. package/dist/state/directories.js.map +1 -1
  753. package/dist/state/files.d.ts +3 -3
  754. package/dist/state/files.d.ts.map +1 -1
  755. package/dist/state/files.js +4 -10
  756. package/dist/state/files.js.map +1 -1
  757. package/dist/state/launch-ownership.d.ts +4 -2
  758. package/dist/state/launch-ownership.d.ts.map +1 -1
  759. package/dist/state/launch-ownership.js +18 -10
  760. package/dist/state/launch-ownership.js.map +1 -1
  761. package/dist/state/launch-publication.d.ts +7 -1
  762. package/dist/state/launch-publication.d.ts.map +1 -1
  763. package/dist/state/launch-publication.js +14 -2
  764. package/dist/state/launch-publication.js.map +1 -1
  765. package/dist/state/loop-store.d.ts +15 -4
  766. package/dist/state/loop-store.d.ts.map +1 -1
  767. package/dist/state/loop-store.js +13 -7
  768. package/dist/state/loop-store.js.map +1 -1
  769. package/dist/state/preparation/created-directories.d.ts +13 -0
  770. package/dist/state/preparation/created-directories.d.ts.map +1 -0
  771. package/dist/state/preparation/created-directories.js +45 -0
  772. package/dist/state/preparation/created-directories.js.map +1 -0
  773. package/dist/state/preparation/ignore-sync.d.ts +9 -0
  774. package/dist/state/preparation/ignore-sync.d.ts.map +1 -0
  775. package/dist/state/preparation/ignore-sync.js +47 -0
  776. package/dist/state/preparation/ignore-sync.js.map +1 -0
  777. package/dist/state/preparation/index.d.ts +25 -0
  778. package/dist/state/preparation/index.d.ts.map +1 -0
  779. package/dist/state/preparation/index.js +31 -0
  780. package/dist/state/preparation/index.js.map +1 -0
  781. package/dist/state/preparation/install-ignore.d.ts +6 -0
  782. package/dist/state/preparation/install-ignore.d.ts.map +1 -0
  783. package/dist/state/preparation/install-ignore.js +87 -0
  784. package/dist/state/preparation/install-ignore.js.map +1 -0
  785. package/dist/state/preparation/rollback-parent.d.ts +3 -0
  786. package/dist/state/preparation/rollback-parent.d.ts.map +1 -0
  787. package/dist/state/preparation/rollback-parent.js +18 -0
  788. package/dist/state/preparation/rollback-parent.js.map +1 -0
  789. package/dist/state/preparation/root-trust.d.ts +3 -0
  790. package/dist/state/preparation/root-trust.d.ts.map +1 -0
  791. package/dist/state/preparation/root-trust.js +70 -0
  792. package/dist/state/preparation/root-trust.js.map +1 -0
  793. package/dist/state/private-session.d.ts +5 -2
  794. package/dist/state/private-session.d.ts.map +1 -1
  795. package/dist/state/private-session.js +21 -9
  796. package/dist/state/private-session.js.map +1 -1
  797. package/dist/state/root.d.ts +25 -0
  798. package/dist/state/root.d.ts.map +1 -0
  799. package/dist/state/root.js +84 -0
  800. package/dist/state/root.js.map +1 -0
  801. package/dist/state/runtime-paths.d.ts +5 -4
  802. package/dist/state/runtime-paths.d.ts.map +1 -1
  803. package/dist/state/runtime-paths.js +5 -4
  804. package/dist/state/runtime-paths.js.map +1 -1
  805. package/dist/state/setup-failure.d.ts +3 -0
  806. package/dist/state/setup-failure.d.ts.map +1 -0
  807. package/dist/state/setup-failure.js +13 -0
  808. package/dist/state/setup-failure.js.map +1 -0
  809. package/dist/state/socket-home.d.ts +17 -12
  810. package/dist/state/socket-home.d.ts.map +1 -1
  811. package/dist/state/socket-home.js +31 -14
  812. package/dist/state/socket-home.js.map +1 -1
  813. package/dist/state/store.d.ts +1 -3
  814. package/dist/state/store.d.ts.map +1 -1
  815. package/dist/state/store.js +3 -18
  816. package/dist/state/store.js.map +1 -1
  817. package/dist/terminal/cursor.d.ts +1 -1
  818. package/dist/terminal/cursor.d.ts.map +1 -1
  819. package/dist/terminal/cursor.js +36 -1
  820. package/dist/terminal/cursor.js.map +1 -1
  821. package/dist/terminal/headless.d.ts +1 -1
  822. package/dist/terminal/headless.d.ts.map +1 -1
  823. package/dist/terminal/headless.js +1 -3
  824. package/dist/terminal/headless.js.map +1 -1
  825. package/docs/cli-behavior.md +1218 -28
  826. package/docs/cli.md +2 -0
  827. package/docs/codex/cli.md +4 -2
  828. package/docs/embedding.md +7 -0
  829. package/docs/performance/terminal-engines.md +88 -0
  830. package/docs/performance.md +120 -0
  831. package/package.json +4 -4
  832. package/prd/04-architecture.md +32 -0
  833. package/prd/05-api/5.1-starting-claude.md +17 -1
  834. package/prd/05-api/5.2-resuming-claude.md +5 -0
  835. package/prd/05-api/5.3-claude-session-api.md +267 -40
  836. package/prd/05-api/5.4-events.md +77 -10
  837. package/prd/05-api/5.5-starting-codex.md +3 -1
  838. package/prd/05-api/5.6-resuming-codex.md +4 -1
  839. package/prd/05-api/5.7-codex-session-api.md +87 -5
  840. package/prd/05-api/5.8-session-api.md +32 -1
  841. package/prd/06-claude-hook-bridge.md +2 -0
  842. package/prd/07a-codex-hook-bridge.md +5 -0
  843. package/prd/08-state.md +63 -7
  844. package/prd/09-lifecycle.md +126 -35
  845. package/prd/10-errors.md +11 -4
  846. package/prd/12-e2e.md +81 -0
  847. package/prd/12a-cli.md +63 -9
  848. package/prd/14-conformance.md +52 -35
  849. package/prd/16-maintainer-review.md +11 -0
  850. package/dist/claude/model-composer.d.ts +0 -2
  851. package/dist/claude/model-composer.d.ts.map +0 -1
  852. package/dist/claude/model-composer.js +0 -12
  853. package/dist/claude/model-composer.js.map +0 -1
  854. package/dist/claude/transcript/drain.d.ts +0 -33
  855. package/dist/claude/transcript/drain.d.ts.map +0 -1
  856. package/dist/claude/transcript/drain.js +0 -56
  857. package/dist/claude/transcript/drain.js.map +0 -1
  858. package/dist/codex/session/cli-exit.d.ts +0 -24
  859. package/dist/codex/session/cli-exit.d.ts.map +0 -1
  860. package/dist/codex/session/cli-exit.js +0 -43
  861. package/dist/codex/session/cli-exit.js.map +0 -1
  862. package/dist/codex/transcript/drain.d.ts +0 -30
  863. package/dist/codex/transcript/drain.d.ts.map +0 -1
  864. package/dist/codex/transcript/drain.js +0 -48
  865. package/dist/codex/transcript/drain.js.map +0 -1
  866. package/dist/runtime/probe-cleanup.d.ts.map +0 -1
  867. package/dist/runtime/probe-cleanup.js.map +0 -1
  868. package/dist/runtime/probe.d.ts +0 -11
  869. package/dist/runtime/probe.d.ts.map +0 -1
  870. package/dist/runtime/probe.js +0 -113
  871. package/dist/runtime/probe.js.map +0 -1
  872. package/dist/runtime/session/foreign-picker.d.ts +0 -8
  873. package/dist/runtime/session/foreign-picker.d.ts.map +0 -1
  874. package/dist/runtime/session/foreign-picker.js +0 -18
  875. package/dist/runtime/session/foreign-picker.js.map +0 -1
  876. package/dist/runtime/session/picker-input.d.ts +0 -17
  877. package/dist/runtime/session/picker-input.d.ts.map +0 -1
  878. package/dist/runtime/session/picker-input.js.map +0 -1
@@ -53,10 +53,14 @@ type ElwoodWarningEvent =
53
53
  // timeout/`errno`); never terminal transcripts, prompts, tokens, or secrets.
54
54
  // `errorCode: "update_active"` means no local update command ran: another
55
55
  // updater still held the adapter's lease after the bounded wait, or its
56
- // surviving process group still does (§9.2).
56
+ // surviving process group still does (§9.2). `errorCode: "login_shell_failed"`
57
+ // means the user's login shell failed before the update command ran (§9.2).
57
58
  readonly installedVersion: string;
58
59
  readonly errorCode: string;
59
60
  readonly raw: string;
61
+ // The update command's exit status, 128+n if a signal killed it; absent when
62
+ // it reported none (a timeout, an overflow, a login-shell failure, contention).
63
+ readonly exitStatus?: number;
60
64
  }
61
65
  | {
62
66
  readonly elwoodSessionId: string;
@@ -238,6 +242,32 @@ type ElwoodWarningEvent =
238
242
  readonly message: string;
239
243
  readonly raw: string;
240
244
  }
245
+ | {
246
+ // Codex-only: once the CLI exited, Elwood could not remove a copy Codex saved of
247
+ // an image pasted into it (§5.3), so the copy is left for the OS to reap. At most
248
+ // one per session, before `terminal:exit`. Content-free: the first failure's errno
249
+ // token (such as `EPERM`), else `UnknownError`; never a path or image data.
250
+ readonly elwoodSessionId: string;
251
+ readonly agent: "codex";
252
+ readonly source: "lifecycle";
253
+ readonly code: "image_copy_removal_failed";
254
+ readonly severity: "warning";
255
+ readonly message: string;
256
+ readonly errorCode: string;
257
+ readonly raw: string;
258
+ }
259
+ | {
260
+ // Codex-only: `stop()`/`teardown()` saw no record of the turn its `Stop` hook
261
+ // ended within the full 2 seconds, and shutdown proceeds, so that turn may be
262
+ // lost. Emitted before the signal. A fixed, content-free message and raw token only.
263
+ readonly elwoodSessionId: string;
264
+ readonly agent: "codex";
265
+ readonly source: "lifecycle";
266
+ readonly code: "turn_commit_wait_expired";
267
+ readonly severity: "warning";
268
+ readonly message: string;
269
+ readonly raw: string;
270
+ }
241
271
  | {
242
272
  readonly elwoodSessionId: string;
243
273
  readonly agent: "claude" | "codex";
@@ -289,6 +319,18 @@ type ElwoodWarningEvent =
289
319
  readonly message: string;
290
320
  readonly raw: string;
291
321
  }
322
+ | {
323
+ // The initial-readiness backstop released readiness while the latest
324
+ // frame showed no configured composer (the model footer), for example after
325
+ // a footer layout change (§5.3, C-API-28). Content-free.
326
+ readonly elwoodSessionId: string;
327
+ readonly agent: "codex";
328
+ readonly source: "lifecycle";
329
+ readonly code: "initial_ready_backstop";
330
+ readonly severity: "warning";
331
+ readonly message: string;
332
+ readonly raw: string;
333
+ }
292
334
  };
293
335
  ```
294
336
 
@@ -321,6 +363,14 @@ away cannot regain authority. Every assistant-marker row ends recognition,
321
363
  including one that resembles a status spinner: recognition fails toward fewer
322
364
  warnings, never forged ones.
323
365
 
366
+ Codex 0.154 and later collapse these failures to a count: `⚠ 1 MCP startup issue ·
367
+ ctrl + t for details` in 0.154, and a `⚠ N warning(s) · f2 to view` badge at the end
368
+ of the composer footer in 0.164. A count names no server and no recovery command, so
369
+ it is not a warning source, and Elwood never opens the CLI's detail view (in 0.164, a
370
+ transcript overlay that also renders the conversation). On these versions a session
371
+ therefore emits no MCP startup warning, and the 0.164 badge reads as part of the
372
+ idle composer.
373
+
324
374
  A startup prompt Elwood auto-answers is marked settled and emits its
325
375
  `startup_prompt` activity ONLY after its PTY `sendInput` write actually fulfills.
326
376
  For trust prompts, live revalidation additionally confirms the native dialog has
@@ -369,8 +419,13 @@ budget — so aggregate terminal read work is watcher-bounded, not per-retire.
369
419
  Second, each individual drain call stops at a small wall-clock slice, so it
370
420
  returns to the event loop promptly instead of monopolizing it grinding a
371
421
  hundreds-of-MiB backlog; whatever is still unread when the shared budget or the
372
- slice is spent is accounted as a content-free drop. Termination and retirement
373
- therefore always complete in bounded-latency work — capped by both the shared
422
+ slice is spent is accounted as a content-free drop. The slice can stop a call's
423
+ read of a transcript only after its first unread chunk, for up to 16 transcripts a
424
+ call (what one live scan reads): a host too loaded to begin the drain within its
425
+ slice still reads what each of them committed since the last poll, up to one chunk,
426
+ and any bytes past that chunk may still be dropped as `"unread_backlog"`. A record
427
+ the bound cuts off is part of that drop, never reported as `"unparseable"`.
428
+ Termination and retirement therefore always complete in bounded-latency work — capped by both the shared
374
429
  budget and the per-call slice — rather than an unbounded synchronous drain.
375
430
 
376
431
  When the first hook to carry a transcript path is a turn-boundary hook, Elwood
@@ -388,7 +443,14 @@ than the recovery bound therefore never silently loses all of its committed
388
443
  activity. The `transcript_read_error`
389
444
  warning is emitted when a transcript filesystem read is contained (a
390
445
  rotation/removal/permission race): the watcher never crashes the host, but also
391
- does not swallow it silently. The `transcript_poll_stopped` warning is emitted
446
+ does not swallow it silently. A transcript that has not been created yet is not
447
+ a read race: Claude names its transcript in `SessionStart` before its first turn
448
+ writes the file, so until Elwood has seen the file exist, a missing file is
449
+ waited on silently. Once the file has existed, its removal still warns, and any
450
+ other read failure warns whether or not the file was ever seen. Both adapters'
451
+ transcripts follow these rules. A removed Codex transcript is therefore not read
452
+ as a truncated, empty one: each poll warns while it is missing, as does the final
453
+ flush if it is still missing. The `transcript_poll_stopped` warning is emitted
392
454
  when a programming error escapes the periodic transcript poll OR the final flush
393
455
  at PTY exit: the watcher stops itself and surfaces a bounded reason rather than
394
456
  letting the failure become an unhandled rejection or abort the exit path. A
@@ -504,7 +566,8 @@ that exceeds it is discarded through its next newline (so a pathological no-newl
504
566
  line can neither exhaust memory nor cause quadratic re-concatenation) and its bytes
505
567
  are accounted as an `"oversized"` drop. At teardown — the final flush at PTY exit —
506
568
  the reader drains to end only within a bounded chunk budget and a small wall-clock
507
- slice; whatever is still unread when that bound is spent is accounted as an
569
+ slice, which can end the drain only after its first unread chunk; whatever is still
570
+ unread when that bound is spent, including a record it cuts off, is accounted as an
508
571
  `"unread_backlog"` drop rather than read in a single unbounded synchronous loop, so
509
572
  the flush returns to the event loop promptly. Codex data loss is surfaced through
510
573
  the SAME content-free `transcript_records_dropped` warning as Claude's (now
@@ -560,4 +623,23 @@ status. Parent applications should not receive delayed transcript activity after
560
623
  the session has already emitted `terminal:exit`, `exited`, `stopped`, or
561
624
  `killed`.
562
625
 
626
+ Codex runs the `Stop` hook before it records the turn's completion
627
+ (`task_complete`) in its transcript, and Elwood reports `ready` from that hook. If
628
+ Codex is signaled after the hook returns but before it writes that record, it exits
629
+ without the record, and the resumed conversation then ends as interrupted. So once a
630
+ `Stop` hook with a `transcript_path` arrives, `stop()` and `teardown()` give Codex a
631
+ bounded time to record the turn before signaling the process, including when a hook
632
+ observer, hook handler, or `ready` listener calls them. The wait ends at the first of:
633
+ a transcript record of that turn's end (`task_complete`, `turn_complete`,
634
+ `turn_aborted`, or `turn_failed` carrying the hook's `turn_id`); a hook result that
635
+ blocks the stop, since the turn then continues; the CLI's exit; or 2 seconds. After 2
636
+ seconds shutdown proceeds, and a turn Codex has still not recorded can be lost; it is
637
+ not waited for again. The session first emits one `turn_commit_wait_expired` warning
638
+ (with its `activity`), even when `stop()` and `teardown()` overlap, so a host can tell
639
+ that stop from an ordinary one. The warning states only that Elwood saw no record in
640
+ time. Both calls still reject queued input and pause loops at once.
641
+ `kill()` never waits. With no such turn pending, shutdown starts in the same tick as
642
+ the call. A CLI that exits on its own during the wait reports `exited`, because Elwood
643
+ did not signal it (C-LIFE-13).
644
+
563
645
  Native question snapshots and answering are shared controls; see [§5.10](5.10-questions.md).
@@ -65,7 +65,7 @@ after `Stop` never clears an installed signal — so the adapter-neutral turn ru
65
65
  reads the normalized signal, never raw provider hook field names. Once `ready` is
66
66
  observed, the turn ends the instant the transcript-collected assistant text CONTAINS
67
67
  that expected text, so it waits exactly as long as the transcript needs. When no completeness signal is available for a turn — a pure-tool
68
- turn, or an empty/null `last_assistant_message` (e.g. `StopFailure`) — the turn falls
68
+ turn, or an empty/null `last_assistant_message` — the turn falls
69
69
  back to a bounded quiet-window settle after `ready` (no new content for a short
70
70
  window). When a NON-EMPTY expected text IS present but never appears in the
71
71
  transcript within `catchUpMs` of `ready`, the turn does NOT fall back to the quiet
@@ -133,6 +133,37 @@ collection. They refine causal serialization rather than authenticate caller-own
133
133
  configuration or unrelated host processes; Claude transcript activity carries no `turnId`, so for Claude the
134
134
  serialized-slot boundary is the sole isolation guarantee (which is why releasing the
135
135
  slot on the real agent boundary, not on consumer cancellation, is load-bearing).
136
+
137
+ **Rejected turn.** When Claude rejects a turn, the turn fails with `turn_failed` (§10):
138
+ `send` rejects and `stream` throws after yielding any events it already collected. The
139
+ evidence is a `StopFailure` hook (§6.1), which Claude fires instead of `Stop` when, for
140
+ example, the selected model does not exist. The hook counts only for the turn whose
141
+ own submission it rejects: the turn must already have observed its own
142
+ `UserPromptSubmit`, whose prompt is the submitted text as pasted, without the control
143
+ characters §5.3 removes, and when both hooks carry `prompt_id` the two must match. A
144
+ `StopFailure` that arrives before the turn's own submission hook, or that names
145
+ another `prompt_id`, belongs to an earlier turn whose hook arrived late and is
146
+ ignored. The error message is the bounded diagnostic of §6.1, never assistant text,
147
+ and `details.agentError` carries the hook's `error` name when one is present. When Codex
148
+ rejects a turn, it fires no `Stop` hook at all. Its evidence is the committed transcript's
149
+ `event_msg` `task_complete` record whose `error` is an object (§7A), and that record ends
150
+ the turn instead of `Stop`. The record counts only when its `turn_id` is the one the
151
+ turn's own `UserPromptSubmit` reported, so a record from another turn is ignored, and a
152
+ `task_complete` whose `error` is absent or `null` is not a rejection. The error message is
153
+ the record's `error.message`, bounded like the §6.1 diagnostic (2,000 characters). When that
154
+ message is absent or blank, the error message is a generic rejection, which names the
155
+ error kind when one is usable (`Codex rejected the turn: <kind>`) and otherwise is
156
+ `Codex rejected the turn.`
157
+ `details.agentError` is the `error.codex_error_info` kind: its string value (for example
158
+ `other`), or the single key of its object form (for example `http_connection_failed`).
159
+ A rejection is a consumer failure like any other: the serialized slot is still held
160
+ until the real `ready` or terminal boundary and its transcript drain, and acceptance
161
+ recovery never replays a rejected prompt. Only adapter failure evidence fails a turn;
162
+ an empty reply, a `Stop` with an empty `last_assistant_message`, and a pure-tool
163
+ turn still succeed. Rejection evidence that arrives after the turn has already
164
+ settled does not reopen it. The raw session API does not interpret rejection: it
165
+ emits the `StopFailure` `hook` event and its hook `activity`, or the Codex
166
+ `task_complete` `codex:transcript` event and its transcript `activity`, as before.
136
167
  Because a turn has no default timeout, its buffered state is BOUNDED: the oracle
137
168
  matches against a rolling window of recent assistant text (not the whole turn, and
138
169
  capped even when the Stop hook's expected text is itself huge), and a turn whose
@@ -40,6 +40,8 @@ input and fail open until first-class types are added. Elwood should add an
40
40
  unknown-but-safe event path before promising forward-compatible hook handling.
41
41
 
42
42
  `StopFailure` identifies a rejected Claude turn even when diagnostic fields drift.
43
+ Ergonomic `send`/`stream` turns and headless CLI runs fail such a turn with
44
+ `turn_failed` (§5.8, §12A.2).
43
45
  After validating the common hook envelope, ingress MUST admit missing or arbitrarily
44
46
  shaped `error`, `error_details`, and `last_assistant_message` fields. Their public
45
47
  TypeScript types are optional `unknown`; consumers must narrow them before use.
@@ -89,6 +89,11 @@ should read the committed live transcript data with one bounded per-pass scan
89
89
  reserved for PTY exit) so parent applications receive transcript-derived turn
90
90
  activity before the ready transition whenever Codex has already written it.
91
91
 
92
+ A turn Codex rejects (for example an unknown model) fires no `Stop`. Its only
93
+ evidence is the committed transcript's `event_msg` `task_complete` record whose
94
+ `error` is an object, tagged with the turn's `turn_id`. For ergonomic turns that
95
+ record is the turn's boundary instead of `Stop` (§5.8).
96
+
92
97
  ### 7A.4 Non-Hook Transcript Activity
93
98
 
94
99
  Current Codex hooks do not cover every TUI-visible activity. Reasoning/status
package/prd/08-state.md CHANGED
@@ -14,10 +14,52 @@ spellings address the same session store. When Elwood initializes the default
14
14
  project-local state directory, it should create `.elwood/.gitignore` when that
15
15
  file does not already exist. Elwood MUST NOT overwrite an existing gitignore
16
16
  file and MUST NOT create gitignore files in caller-provided custom state
17
- directories unless a future explicit option asks it to.
17
+ directories unless a future explicit option asks it to. The default ignore file is
18
+ fully written before installation, which must preserve a concurrently created
19
+ file. Failed installation must not leave an empty or partial default ignore. A complete
20
+ published ignore is retained if later installation cleanup or directory syncing
21
+ fails, since another start may already rely on it. Existing entries must be
22
+ regular files, never symlinks, and their directory is synced before setup accepts them. Successful syncs
23
+ may be reused for up to 32 unchanged file/parent observations per process; changed
24
+ observations and failed syncs are never retained. This does not cache safety checks.
25
+ The default ignore’s parent path must also pass the owner, mode-bit, sticky-bit,
26
+ and private-primary-group lookup checks used for CLI workspaces (§12A.5), including
27
+ link targets. These checks prevent replacement by other users; they do not inspect
28
+ ACLs or isolate another process running as the same user or root.
18
29
  The default `.elwood/` directory and generated `.elwood/.gitignore` should be
19
30
  readable by normal local tooling, while session-specific subdirectories remain
20
31
  private.
32
+ A state directory is made only while the session's `cwd` exists, and `cwd`
33
+ itself is never made. One at or under `cwd`, the default `.elwood/` or a
34
+ caller-provided `stateDir`, is made only below it, one directory at a time,
35
+ however either path is spelled (in another letter case on a case-insensitive
36
+ volume, or through a symlink). A caller-provided `stateDir` elsewhere is
37
+ created with its missing parents, and `cwd` is checked again once it, its
38
+ `sessions` directory, and the new session's directory are made: if `cwd` was
39
+ removed meanwhile, every directory that setup made is removed again, except one
40
+ another start has put its session directory in, and the start fails, with the
41
+ `cleanupErrorCode` of any directory that could not be removed. A start that
42
+ finds a directory removed under it by such a start makes it again while its own
43
+ `cwd` exists. The `sessions` directory, each session
44
+ directory, and every state file are made only inside their existing parent: a
45
+ missing parent fails the write with `ENOENT`. So a removed worktree, or a
46
+ removed state directory, is never recreated by a start, a resume, or a running
47
+ session's later writes. A start fails instead, before its agent is spawned, and
48
+ so does a write whose state directory is gone, as when it was in the removed
49
+ worktree; a running session whose state directory is elsewhere keeps writing
50
+ there (C-STATE-14). If state preparation fails, its empty owned scaffolding is removed.
51
+ The default shared state root and `sessions` directory are retained: another setup,
52
+ including one without a session ID yet, may already rely on them. Only the failed
53
+ attempt's empty named session directory is removed there. A complete published
54
+ default ignore is shared configuration and is never rolled back by that attempt.
55
+ Custom-state empty scaffolding remains eligible for removal. Cleanup attempts every
56
+ eligible directory and preserves the primary setup failure with its first cleanup
57
+ code, including inside typed error details.
58
+
59
+ Custom rollback preserves entries whose parent lookup crosses a foreign-owned or
60
+ non-sticky shared writable ancestor, using the existing mode-bit, private-group and
61
+ sticky-directory policy. Root-owned sticky `/tmp` remains eligible. These bounded
62
+ observations provide no same-user/root isolation or ACL audit.
21
63
 
22
64
  Before creating or changing state, Elwood MUST reject a symlink at the state
23
65
  root, sessions directory, or session directory, and reject user-owned symlink
@@ -43,12 +85,22 @@ reused; the socket path is a per-launch runtime value, embedded only in the gene
43
85
  private bridge script and never in the session record, so a
44
86
  recorded socket path can never be trusted. `teardown` removes the whole socket
45
87
  home (every launch's socket) along with the session directory, so no per-launch
46
- socket can leak undiscoverably across restart/resume cycles. Across separate Elwood
88
+ socket can leak undiscoverably across restart/resume cycles. Each Codex launch also
89
+ writes its `CODEX_HOME` report (§4.2) into the socket home, named after that
90
+ launch's socket file, so a failed first start leaves nothing in the session
91
+ directory. The report is removed when its launch's PTY exits, a failed start
92
+ included, and teardown removes any that remain with the home. A launch that ends
93
+ without teardown — `stop`, `kill`, the agent exiting, or a failed start — removes
94
+ its own socket file and then the socket home if that left it empty, so a session
95
+ that is never torn down leaves nothing in the OS temp dir; a home that still holds
96
+ another launch's socket is kept, and the session's next start or resume
97
+ recreates the home. Across separate Elwood
47
98
  processes, running two live sessions with the same full identity (`stateDir`,
48
99
  adapter, and session id) is unsupported: the processes share files and socket
49
100
  homes without a cross-process ownership protocol. Within one process, overlapping
50
101
  resume and cleanup follow the successor protocol below. A failed start removes
51
- only its own socket file, preserving any overlapping launch. `stateDir`
102
+ only its own socket file (and the home only once it is empty), preserving any
103
+ overlapping launch. `stateDir`
52
104
  length MUST NOT constrain whether a session can start.
53
105
 
54
106
  Within one Elwood process, a validated resume attempt revokes the prior launch's
@@ -64,8 +116,10 @@ committed successor keeps its state, while a failed successor permits the predec
64
116
  to finish the requested cleanup before its shutdown promise resolves. A pending
65
117
  successor does not activate loop timers. Successful activation rereads the latest
66
118
  durable loop definitions and revokes prior scheduling in the same synchronous commit,
67
- so a successful predecessor cancellation or creation is preserved. An activation
68
- read failure stops the built launch before ownership rolls back. If resume fails,
119
+ so a successful predecessor cancellation or creation is preserved. Activation prunes
120
+ loops that expired since the launch read them as part of the startup publication. An
121
+ activation read or prune failure stops the built launch before ownership rolls back,
122
+ and rollback restores that prune. If resume fails,
69
123
  ownership returns to the prior
70
124
  viable launch only when no newer reservation or launch has replaced that attempt.
71
125
  A failed overlapping launch therefore preserves the original live launch's cleanup
@@ -78,7 +132,8 @@ settings instead use fresh per-launch filenames permanently bound to that launch
78
132
  PTY. Pending or committed successors never redirect a predecessor's hook policy. A failed
79
133
  attempt restores each prior file only while it still owns the reservation and the
80
134
  file still contains that attempt's exact published bytes. A newer predecessor
81
- record update or newer generation is preserved. If a predecessor updates a file
135
+ record or loop update, even one whose bytes match the attempt's, or a newer
136
+ generation is preserved. If a predecessor updates a file
82
137
  between two pending-launch writes, that external version becomes the rollback
83
138
  baseline for the later write. Pending-launch hook record writes participate in the
84
139
  same transaction. Superseded or failed generations cannot publish metadata.
@@ -155,7 +210,8 @@ core state must not become a transcript store.
155
210
 
156
211
  ### 8.4 Cleanup
157
212
 
158
- Runtime files needed for resume/debugging are kept by default after `stop`.
213
+ Runtime files needed for resume/debugging are kept by default after `stop`. The
214
+ socket home is not among them: `stop` removes it once it is empty (§8.1).
159
215
  Loop definitions are likewise kept after `stop`, unexpected exit, or process
160
216
  failure. `kill` permanently removes all loop definitions while preserving the
161
217
  ordinary session record; a later resume has no loops.
@@ -75,24 +75,39 @@ an inherited `SHELL` environment override from the parent process.
75
75
 
76
76
  These probes MUST run asynchronously and MUST NOT block the host process's
77
77
  event loop: a parent that spawns a roster of sessions must not serialize their
78
- preflights on a single thread. Elwood reads each adapter's `--version` at most
79
- once per parent process — concurrent first reads share a single subprocess, and
80
- later reads reuse the cached result — mirroring the once-per-process autoupdate
81
- dedupe (C-LIFE-09). The cached version and adapter-capability reads are invalidated
82
- after every coordinated update attempt, including a failed or peer-owned attempt,
83
- because a failed installer may still have partially changed the binary. When
84
- `autoupdate` is set, concurrent callers share one update and all validate the same
85
- post-attempt version, so no caller proceeds on a stale pre-update version or races
86
- a second update. This mutual exclusion also applies across separate Elwood parent
78
+ preflights on a single thread. Version, Codex capability, update and verification
79
+ probes start in the validated launch directory. Version and capability answers are
80
+ cached per adapter, directory path and observed device/inode (C-PERF-02). Concurrent
81
+ reads for one key share a subprocess. Each cache keeps the 32 most recently used
82
+ successful settled answers; in-flight reads are shared without counting toward
83
+ that bound. Version results are retained only when both stdout and stderr contain
84
+ at most 65,536 UTF-16 code units; larger results are returned unchanged but not
85
+ retained. Capability caching retains only the derived boolean, not the help text.
86
+ A result is retained only if directory identities observed before and after its
87
+ read match. These bounded snapshots can miss a replacement restored between checks;
88
+ they do not track executable changes or PATH changes within the same directory.
89
+ The cached version and adapter-capability reads are invalidated after every
90
+ coordinated update attempt, including a failed or peer-owned attempt, because a
91
+ failed installer may still have partially changed the binary. Update coordination
92
+ remains once per parent process and adapter across workspaces (C-LIFE-09): its
93
+ owner verifies and updates from that caller's captured directory, and each caller
94
+ validates its own workspace's post-attempt version without racing a second update. This mutual exclusion also applies across separate Elwood parent
87
95
  processes for the same macOS user and adapter: an atomic lease names the adapter in
88
96
  a stable per-account cache independent of `TMPDIR`; contenders wait without
89
97
  blocking the event loop, then invalidate their local caches and continue without
90
- running a duplicate update. Contender waiting is bounded to 60 seconds; an owner
91
- that has not finished by then causes the contender to skip its update and warn,
92
- without deleting the owner's lease. This warning uses `errorCode: "update_active"`
98
+ running a duplicate update. Contender waiting is bounded to 165 seconds: the owner
99
+ runs two probes under the lease, a `--version` read confirming the CLI exists and then
100
+ the update, each allowed 75 seconds by its launch and command bounds (§9.2), and the
101
+ rest covers their abort cleanup. An owner that has not finished by then causes the
102
+ contender to skip its update and warn, without deleting the owner's lease. This warning uses `errorCode: "update_active"`
93
103
  and a canonical message explaining that the update was skipped because another
94
104
  updater is still active; no local update command ran, so it carries no exit status
95
- or stderr. The lease records the owner's process id and a unique
105
+ or stderr. Completion publication atomically replaces the marker's token file. A contender
106
+ pins its baseline file before observing the owner, then compares the pinned token
107
+ with the current pathname after acquisition; recovered owner generations remain
108
+ completion evidence. Concurrent older Elwood writers that modify a marker inode
109
+ in place retain the earlier snapshot race; its token payload remains compatible.
110
+ The lease records the owner's process id and a unique
96
111
  generation. Cleanup removes only the generation it owns, a live owner is never
97
112
  evicted solely because the stale bound elapsed, and recovery of a dead owner's
98
113
  lease is itself serialized before removal, so neither cleanup nor concurrent stale
@@ -140,9 +155,48 @@ rejected result: a later caller re-attempts rather than inheriting the prior
140
155
  failure.
141
156
 
142
157
  Each probe is bounded so a broken or hostile CLI on PATH cannot hang or flood
143
- the host: a probe that does not exit within a default timeout (15 seconds) or
144
- whose captured output exceeds a per-stream byte cap (1,000,000 bytes) is
145
- killed, and its captured output is truncated to the cap. Abort cleanup has an
158
+ the host. A probe runs through the user's interactive login shell (§4.2), and
159
+ loading that shell's startup files is the user's profile, not the CLI: under
160
+ concurrent launches on a loaded machine the profile alone can outlast the CLI's
161
+ bound while the CLI itself answers in milliseconds. The two phases are therefore
162
+ bounded separately. After the startup files load, and before the probe
163
+ command runs, the probe shell writes a start line of Elwood's own, ending in a random
164
+ token chosen once per parent process so that no startup file's output can pass for it,
165
+ on a private channel that is neither stdout nor stderr, so a startup file that
166
+ redirects either cannot hide the line. A shell that closed that channel at startup (macOS's bash 3.2,
167
+ started as an interactive login shell, closes every inherited descriptor above
168
+ stderr) writes the line on stdout instead. Not stderr, which a startup file may
169
+ discard or merge into stdout: a startup file that hid stdout would also hide the
170
+ command's own output. Elwood removes the line from captured stdout, so on either
171
+ channel the probe's captured output is exactly the shell's and the command's.
172
+ The private channel stays open past the start line, for the e2e home guard's stop
173
+ line (§12), and closes before the command, which never inherits it.
174
+ After the start line and before the command, the probe script removes the user's
175
+ not-found handlers, zsh's `command_not_found_handler` and bash's
176
+ `command_not_found_handle`, under the command's bound, which starts at the line. A
177
+ Version probes explicitly check command lookup after removing those handlers. A
178
+ failed lookup emits a private random marker over the existing control channel
179
+ (or stdout fallback) and exits 127. Only that conclusive lookup signal or native
180
+ `ENOENT` reports a CLI as not found; numeric status 127 alone is insufficient. A
181
+ resolved CLI exiting 127 reports `*_start_failed` with its stderr and exit status.
182
+ Lookup markers are removed from captured output, and no handler output is captured.
183
+ The shell has 60 seconds from spawn to write that line (the launch bound),
184
+ and the probe command then has a default timeout of 15 seconds from that line until
185
+ it exits. A probe that
186
+ exceeds either bound, or whose captured output exceeds a per-stream byte cap
187
+ (1,000,000 bytes), is killed, and its captured output is truncated to the cap.
188
+ Either timeout reports `ETIMEDOUT`. Once the probe command has started, a probe whose
189
+ process dies of a signal Elwood did not send reports the status a shell would, 128 plus
190
+ the signal's number; a login shell that dies before then is a login-shell failure, as
191
+ follows. A login shell that misses the launch bound, or
192
+ exits without writing the start line (a startup file that `exec`s another program,
193
+ say), never ran the probe command, so the probe fails as a login-shell failure
194
+ rather than reporting the shell's exit status as the command's: its cause names the
195
+ login shell, and its typed error details carry `phase: "login_shell"`. Its captured
196
+ stderr is only the user's startup output, which can hold expanded secrets, so it is
197
+ withheld: `details.stderr` is empty. A best-effort update probe that fails this way
198
+ surfaces the `agent_update_failed` warning with `errorCode: "login_shell_failed"` and
199
+ an empty `raw`. Abort cleanup has an
146
200
  additional one-second bound: an aborted probe retries process-group termination,
147
201
  falls back to terminating the direct child once group signals have kept failing,
148
202
  and awaits exit within that window. A process-group id is signaled only while the
@@ -169,14 +223,21 @@ non-PTY probe — `--version`, `--help` capability detection, and
169
223
  otherwise) surfaces through that probe's existing public error name —
170
224
  `claude_start_failed` / `codex_start_failed` — with the underlying reason
171
225
  preserved in the error `details` as `cause` (and `errno`, e.g. `ETIMEDOUT` on
172
- timeout or `E2BIG` on overflow) alongside any `stderr`. An UPDATE failure
226
+ timeout or `E2BIG` on overflow) alongside any `stderr`, and the status the probe
227
+ reported, if any, as `exitStatus`. An UPDATE failure
173
228
  (`claude update` / `codex update`), being best-effort maintenance, does NOT
174
229
  surface as a start-blocking error; it is contained and surfaces as the live
175
- `agent_update_failed` warning carrying the same bounded diagnostics (exit status,
230
+ `agent_update_failed` warning carrying the same bounded diagnostics (`exitStatus`,
176
231
  `errno`, `stderr`), while startup continues through the compatibility gate. A
177
232
  killed probe is signaled only because Elwood aborted it; a probe that exits or
178
233
  fails to spawn on its own is not signaled.
179
234
 
235
+ At most 8 non-PTY probes run at once in a parent process, because each starts an
236
+ interactive login shell and a heavy profile slows every shell that runs beside it.
237
+ Further probes wait their turn in arrival order. A waiting probe has not started:
238
+ its launch bound begins when it runs, and a probe that fails frees its turn like
239
+ one that succeeds.
240
+
180
241
  After spawning the PTY, Elwood waits briefly for immediate process exits or
181
242
  known authentication/startup failure banners before reporting the session as
182
243
  running. The default wait must be long enough to catch typical local CLI startup
@@ -194,16 +255,32 @@ flush of any transcript diagnostics buffered before the session sink existed
194
255
  (emitted as live warnings), PTY-exit registration, the readiness/authentication
195
256
  assertion, and the startup-usable evidence. If ANY of them fails, Elwood tears
196
257
  down the now-live PTY, hook bridge, terminal, and transcript watcher before
197
- rejecting, so a failed `startClaude`/`startCodex` never leaks a live process, IPC
198
- endpoint, or file watcher. (The one-shot version/preflight warning is NOT part of
199
- this boundary — it is scheduled for delivery AFTER start resolves, per C-API-14.) Tearing down the PTY routes through the SAME one-shot
200
- process-group reap the normal exit path uses (§9.4, C-LIFE-10): the PTY is
201
- signaled, its exit is awaited within a bounded window, and the leader's process
202
- group is SIGKILLed on every path — even if the PTY signal throws — so a
203
- CLI-spawned descendant such as a hook-bridge grandchild (which POSIX reparents to
204
- PID 1 the instant the leader exits) cannot survive or reparent past a failed
205
- startup. The original startup error is preserved; a cleanup or reap failure is
206
- secondary and never replaces it.
258
+ rejecting. This teardown is best-effort: it stops the hook bridge and the transcript
259
+ watcher and disposes the terminal on every path, but a CLI process it could not confirm
260
+ reaped may remain (see below). (The one-shot version/preflight warning is NOT part of
261
+ this boundary — it is scheduled for delivery AFTER start resolves, per C-API-14.)
262
+ The session ends the PTY with the same one-shot process-group reaper its exit path
263
+ uses (§9.4, C-LIFE-10), so any successful group SIGKILL occurs at most once across paths.
264
+ If the session has already seen the PTY exit (for example, the CLI exited during
265
+ startup), the PTY is not signaled again: the leader's pid may already belong to an
266
+ unrelated process, so only that shared reaper runs. That reaper does nothing if the
267
+ exit's reap succeeded and retries it if it failed. Otherwise the PTY is signaled, its
268
+ exit is awaited within a bounded window, and the leader's process-group reap is attempted
269
+ on every path, even if the PTY signal throws. If the detached sweep confirms the entire
270
+ group gone, the final group SIGKILL is skipped, avoiding a signal to a possibly reused
271
+ numeric id; an earlier unresolved descendant-sweep failure still rejects. An eligible
272
+ group kill stops a CLI-spawned
273
+ descendant such as a hook-bridge grandchild, which POSIX reparents to PID 1 the instant
274
+ the leader exits. A leader that ignores the SIGTERM has its detached descendants
275
+ reaped before the escalating SIGKILL, as §5.3 specifies. The original startup error is
276
+ preserved; a cleanup or reap failure is secondary and never replaces it. When that PTY termination or group reap cannot be
277
+ confirmed, part of the CLI's process tree may still be running, and a typed startup
278
+ error keeps its code and message and gains two details. `cleanupErrorCode` is
279
+ content-free: the failed group reap's errno if there is one, else the termination's,
280
+ when that errno is on the reap allowlist; otherwise `UnknownError`.
281
+ `cleanupProcessGroupId` is the leader's group id, for diagnosis only: it may already
282
+ have been reissued to an unrelated group, so it must never be signaled. A startup error
283
+ that is not one of Elwood's typed errors is rethrown unchanged.
207
284
 
208
285
  ### 9.3 Resume
209
286
 
@@ -241,9 +318,12 @@ intentionally not persisted yet.
241
318
  For either adapter, resume validates the loop sidecar before starting the agent,
242
319
  silently removes definitions whose seven-day wall-clock expiry passed during
243
320
  downtime, and restores surviving definitions with the same IDs and persisted
244
- jitter. It restores no timer or due state: every surviving cadence starts fresh
245
- from the resumed session's first readiness, using that launch's current
246
- permissions and blocking-dialog posture, and no missed run is replayed.
321
+ jitter. That removal, and any at activation (§8.1), is part of the launch's startup
322
+ publication, so a resume that then fails restores the sidecar it found unless the
323
+ earlier launch has written it since. It restores no timer or due state: every
324
+ surviving cadence starts fresh from the resumed session's first readiness, using
325
+ that launch's current permissions and blocking-dialog posture, and no missed run is
326
+ replayed.
247
327
 
248
328
  ### 9.4 Exit
249
329
 
@@ -265,7 +345,12 @@ not delay the native process-exit notification, terminal status, or unconditiona
265
345
  process-group reap; the final `terminal:data` tail may therefore arrive after
266
346
  `terminal:exit`. A stalled renderer, or a PTY that never goes quiet, is disposed
267
347
  when the budget expires. Explicit direct `terminal.dispose()` does not wait for
268
- pending output.
348
+ pending output. Runtime cleanup also stops the hook bridge and finishes the
349
+ transcript watcher: one bounded final flush of what the transcript already holds,
350
+ then no more polling. So a PTY that outlives a failed shutdown produces no later
351
+ transcript activity, and its hook commands reach no handler: the stopped bridge
352
+ accepts no new request. A host hook handler already running when cleanup starts may
353
+ still finish and report its result.
269
354
 
270
355
  Reaping the leader's process group is unconditional on every exit path
271
356
  (C-LIFE-10). On an unsolicited PTY exit the terminal status is submitted first,
@@ -276,7 +361,11 @@ a live `reap_failed` warning rather than aborting the exit callback. An explicit
276
361
  survivor reap (it does not re-signal the dead PTY — node-pty does not replay the
277
362
  exit event, and the pid may already be recycled) and rejects with a typed
278
363
  `termination_failed` error if that reap fails, leaving the reap retryable by a
279
- later `teardown()`.
364
+ later `teardown()`. Every `stop()`/`kill()` attempt runs runtime cleanup after its
365
+ termination or survivor reap, even when that failed: the PTY could not be signaled,
366
+ did not exit, or its group could not be reaped. The call still rejects with that
367
+ failure, and a cleanup failure alongside it is kept as its message in
368
+ `details.cleanupError`.
280
369
 
281
370
  Overlapping `stop()`, `kill()`, and `teardown()` calls on one session are
282
371
  serialized so the PTY is signaled at most once. The first caller owns the in-flight
@@ -294,5 +383,7 @@ and (for teardown) remove files. A settled shutdown failure is not permanently
294
383
  sticky: because signal ownership is separate from the in-flight promise, a later
295
384
  `stop()`/`kill()`/`teardown()` after a failed one runs a fresh attempt that RETRIES
296
385
  the reap, runtime cleanup, and file removal — without re-signaling the PTY — rather
297
- than returning the earlier rejection forever (C-LIFE-10 retry posture). Each caller
298
- still observes its own operation's success or typed failure.
386
+ than returning the earlier rejection forever (C-LIFE-10 retry posture). The one
387
+ exception is a detached-descendant walk that could not complete (§5.3): with the
388
+ leader gone it cannot be retried, so every later call keeps rejecting for it. Each
389
+ caller still observes its own operation's success or typed failure.
package/prd/10-errors.md CHANGED
@@ -9,14 +9,14 @@ Initial required error names:
9
9
  |---|---|
10
10
  | `unsupported_platform` | The current OS is not supported by the implementation. |
11
11
  | `claude_not_found` | `claude` could not be resolved or spawned. |
12
- | `claude_start_failed` | Claude started but exited or failed before the session was usable. |
12
+ | `claude_start_failed` | Claude started but exited or failed before the session was usable, or the session's `cwd` is not an existing directory (C-API-61). |
13
13
  | `claude_update_failed` | `claude update` failed. Best-effort: contained by the autoupdate preflight and surfaced as the `agent_update_failed` warning (never thrown out of `startClaude` when the installed CLI meets the minimum). |
14
14
  | `claude_not_authenticated` | Startup output or status indicates Claude is not authenticated. |
15
15
  | `claude_version_unsupported` | Installed Claude version lacks required features. |
16
16
  | `claude_invalid_reasoning_effort` | `reasoningEffort` was not one of the valid `ClaudeReasoningEffort` values; rejected before spawn. |
17
17
  | `claude_high_trust_conflict` | `highTrust: true` was combined with an explicit `permissionMode`; rejected before spawn. |
18
18
  | `codex_not_found` | `codex` could not be resolved or spawned. |
19
- | `codex_start_failed` | Codex started but exited or failed before the session was usable. |
19
+ | `codex_start_failed` | Codex started but exited or failed before the session was usable, or the session's `cwd` is not an existing directory (C-API-61). |
20
20
  | `codex_update_failed` | `codex update` failed. Best-effort: contained by the autoupdate preflight and surfaced as the `agent_update_failed` warning (never thrown out of `startCodex` when the installed CLI meets the minimum). |
21
21
  | `codex_not_authenticated` | Startup output or status indicates Codex is not authenticated. |
22
22
  | `codex_version_unsupported` | Installed Codex version lacks required features. |
@@ -30,8 +30,8 @@ Initial required error names:
30
30
  | `hook_bridge_failed` | The hook bridge or IPC endpoint could not be initialized. |
31
31
  | `input_queue_full` | A live session control queue would exceed 1,024 outstanding operations or 8 MiB aggregate UTF-8 input text; no input or attachment is performed for the rejected operation. |
32
32
  | `session_not_running` | Operation requires a running process but the session is stopped. |
33
- | `termination_failed` | A stop/kill request did not observe process exit after escalation, or the PTY exited but its process group could not be confirmed reaped. |
34
- | `teardown_failed` | Elwood could not remove all owned session files. |
33
+ | `termination_failed` | A stop/kill request could not signal the PTY, did not observe process exit after escalation, or the PTY exited but its process group or its detached descendants could not be confirmed reaped. A PTY signaling failure keeps the underlying message as `cause` and any `errno`/`syscall`/`path` in `details`. When the PTY was not confirmed terminated and its group reap failed too, `details.reapError` keeps the reap's message and `details.reapErrno` its errno when it has one. A failed reap retry, in a `stop()`/`kill()` of an already-signaled or exited session or in `teardown()`, keeps the leader's process-group id as `details.processGroupId`. A retained detached-sweep failure after the leader group is confirmed gone is still reported as a detached-sweep failure. When the detached-descendant walk could not complete, its reason is the `cause` (or `details.sweepError` alongside another termination failure), and `details.unconfirmedProcessGroupIds` lists up to 16 ids of the process groups it could not confirm reaped, the leader's own included when its group was not confirmed stopped; like `processGroupId`, they are diagnostic only and may already belong to another group. Runtime cleanup runs after a failed termination too: a cleanup failure on its own is `termination_failed` with its message as `cause`, and one alongside another termination failure is kept as its message in `details.cleanupError`. When `close()` (§5.8) fails both its stop and its kill, it keeps each one's cleanup message too, as `details.cleanupError` and `details.killCleanupError`. |
34
+ | `teardown_failed` | A `teardown()` step failed: the PTY could not be terminated or its process tree, including detached descendants, confirmed reaped, runtime cleanup failed, or Elwood could not remove all owned session files. Every step still runs. `details.causes` lists each failed step's message, and `details.failures` lists each failed step as `{ message }`, adding `code` and `details` when the step failed with a typed Elwood error, so a `termination_failed`'s errno, its reap's, its `processGroupId`, and its `unconfirmedProcessGroupIds` survive teardown. |
35
35
  | `compact_failed` | A requested conversation compaction did not report completion in time. |
36
36
  | `interrupt_failed` | A requested turn interrupt did not return the session to ready in time. |
37
37
  | `model_automation_failed` | The adapter's model picker could not be recognized or driven to completion. |
@@ -40,12 +40,19 @@ Initial required error names:
40
40
  | `invalid_image` | An `images` input is not attachable: an unsupported/absent byte format, empty bytes, a path that is not a readable file, or a total image count/size beyond the documented limits (C-API-44). Raised before any partial input reaches the composer. |
41
41
  | `image_attach_failed` | An image could not be confirmed attached: the CLI's `[Image #N]` chip did not appear before the confirmation timeout, the OS clipboard could not be read/written, or terminal rendering permanently failed. No text is submitted afterward. (A session that TERMINATES mid-attach rejects with `session_not_running`, like any queued op.) (C-API-44/45/46) |
42
42
  | `wait_timeout` | A `waitForStatus`/`waitForActivity` call did not observe its condition before the timeout, the PTY rejected a staged-draft cleanup write before successor input, or raw input replaced an initial/replay ergonomic submission awaiting empty-input confirmation (§5.3). The same code rejects queue-backed input admitted from an expired Stop callback/observer context (§6.3), before terminal-state checks even after teardown. Cleanup failures retain the pending draft and use a bounded message without raw PTY diagnostics. |
43
+ | `turn_failed` | The agent itself rejected an ergonomic `send`/`stream` turn and reported it through its own failure evidence: a Claude `StopFailure` hook that rejects the turn's own submission (§5.8, §6.1), or a Codex transcript `task_complete` whose `error` names the turn's own `turn_id` (§5.8), such as an unknown model or an API error. The message is the bounded rejection diagnostic of §6.1, or Codex's bounded `error.message`; `details.agentError`, when present, is Claude's `error` name (e.g. `model_not_found`) or Codex's `codex_error_info` kind (e.g. `other`) and is diagnostic only. An empty or absent reply is never this error (§5.8). |
43
44
  | `invalid_loop` | A loop request or recognized `/loop` command violates the documented shape, interval, or UTF-8 message bounds. |
44
45
  | `loop_limit_reached` | Creating a loop would exceed 50 unexpired definitions; existing loops are unchanged. |
45
46
  | `loop_not_found` | Cancellation targeted an unknown or already-finished loop ID. |
46
47
  | `loop_persistence_failed` | A loop-sidecar write required by creation, cancellation, kill, expiry, or teardown did not complete safely. |
47
48
  | `loop_submission_failed` | Live loop scheduling or readiness-safe prompt submission failed; details identify only the loop ID. |
48
49
 
50
+ A confirmed command lookup failure reports `*_not_found` with `exitStatus: 127`,
51
+ the fixed cause ``The login shell found no `<command>` (status 127).``, and no
52
+ `stderr` field. Native `ENOENT` retains its native cause and diagnostic fields. A
53
+ resolved CLI returning 127 is `*_start_failed`, preserving its stderr and status;
54
+ a numeric exit status alone is never proof of failed command lookup.
55
+
49
56
  Hook handler failures are normally surfaced as `hookError` events, not thrown
50
57
  from the hook bridge path.
51
58