@with-logic/elwood 0.1.0 → 0.1.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 (777) hide show
  1. package/CHANGELOG.md +182 -3
  2. package/CONTRIBUTING.md +104 -0
  3. package/LICENSE +1 -1
  4. package/README.md +295 -26
  5. package/SECURITY.md +42 -0
  6. package/dist/claude/command.d.ts +9 -2
  7. package/dist/claude/command.d.ts.map +1 -1
  8. package/dist/claude/command.js +23 -16
  9. package/dist/claude/command.js.map +1 -1
  10. package/dist/claude/model-picker.d.ts.map +1 -1
  11. package/dist/claude/model-picker.js +4 -3
  12. package/dist/claude/model-picker.js.map +1 -1
  13. package/dist/claude/model-switch-confirmation.js +9 -1
  14. package/dist/claude/model-switch-confirmation.js.map +1 -1
  15. package/dist/claude/screen-table.js +1 -1
  16. package/dist/claude/screen-table.js.map +1 -1
  17. package/dist/claude/session/build.d.ts.map +1 -1
  18. package/dist/claude/session/build.js +3 -0
  19. package/dist/claude/session/build.js.map +1 -1
  20. package/dist/claude/session/index.d.ts.map +1 -1
  21. package/dist/claude/session/index.js +5 -2
  22. package/dist/claude/session/index.js.map +1 -1
  23. package/dist/claude/session/resume.d.ts +1 -1
  24. package/dist/claude/session/resume.d.ts.map +1 -1
  25. package/dist/claude/session/resume.js +5 -1
  26. package/dist/claude/session/resume.js.map +1 -1
  27. package/dist/claude/session/start-or-resume.js +1 -0
  28. package/dist/claude/session/start-or-resume.js.map +1 -1
  29. package/dist/claude/simple.d.ts.map +1 -1
  30. package/dist/claude/simple.js +4 -0
  31. package/dist/claude/simple.js.map +1 -1
  32. package/dist/cli/args/index.d.ts +3 -1
  33. package/dist/cli/args/index.d.ts.map +1 -1
  34. package/dist/cli/args/index.js +10 -2
  35. package/dist/cli/args/index.js.map +1 -1
  36. package/dist/cli/args/options.d.ts.map +1 -1
  37. package/dist/cli/args/options.js +2 -0
  38. package/dist/cli/args/options.js.map +1 -1
  39. package/dist/cli/args-commands.d.ts +10 -0
  40. package/dist/cli/args-commands.d.ts.map +1 -0
  41. package/dist/cli/args-commands.js +113 -0
  42. package/dist/cli/args-commands.js.map +1 -0
  43. package/dist/cli/command-types.d.ts +26 -0
  44. package/dist/cli/command-types.d.ts.map +1 -0
  45. package/dist/cli/command-types.js +9 -0
  46. package/dist/cli/command-types.js.map +1 -0
  47. package/dist/cli/config/codec-primitives.d.ts +20 -0
  48. package/dist/cli/config/codec-primitives.d.ts.map +1 -0
  49. package/dist/cli/config/codec-primitives.js +51 -0
  50. package/dist/cli/config/codec-primitives.js.map +1 -0
  51. package/dist/cli/config/codec.d.ts.map +1 -1
  52. package/dist/cli/config/codec.js +4 -46
  53. package/dist/cli/config/codec.js.map +1 -1
  54. package/dist/cli/config/effective.d.ts.map +1 -1
  55. package/dist/cli/config/effective.js +1 -0
  56. package/dist/cli/config/effective.js.map +1 -1
  57. package/dist/cli/config/keys.d.ts +1 -1
  58. package/dist/cli/config/keys.d.ts.map +1 -1
  59. package/dist/cli/config/keys.js +1 -0
  60. package/dist/cli/config/keys.js.map +1 -1
  61. package/dist/cli/entry.d.ts +4 -2
  62. package/dist/cli/entry.d.ts.map +1 -1
  63. package/dist/cli/entry.js +2 -1
  64. package/dist/cli/entry.js.map +1 -1
  65. package/dist/cli/help.d.ts +2 -2
  66. package/dist/cli/help.d.ts.map +1 -1
  67. package/dist/cli/help.js +40 -1
  68. package/dist/cli/help.js.map +1 -1
  69. package/dist/cli/interactive/index.d.ts +26 -0
  70. package/dist/cli/interactive/index.d.ts.map +1 -0
  71. package/dist/cli/interactive/index.js +33 -0
  72. package/dist/cli/interactive/index.js.map +1 -0
  73. package/dist/cli/interactive/launch.d.ts +14 -0
  74. package/dist/cli/interactive/launch.d.ts.map +1 -0
  75. package/dist/cli/interactive/launch.js +66 -0
  76. package/dist/cli/interactive/launch.js.map +1 -0
  77. package/dist/cli/interactive/spawn.d.ts +18 -0
  78. package/dist/cli/interactive/spawn.d.ts.map +1 -0
  79. package/dist/cli/interactive/spawn.js +53 -0
  80. package/dist/cli/interactive/spawn.js.map +1 -0
  81. package/dist/cli/main-failure.d.ts +28 -0
  82. package/dist/cli/main-failure.d.ts.map +1 -0
  83. package/dist/cli/main-failure.js +78 -0
  84. package/dist/cli/main-failure.js.map +1 -0
  85. package/dist/cli/main.d.ts +12 -4
  86. package/dist/cli/main.d.ts.map +1 -1
  87. package/dist/cli/main.js +27 -73
  88. package/dist/cli/main.js.map +1 -1
  89. package/dist/cli/models/index.d.ts +20 -0
  90. package/dist/cli/models/index.d.ts.map +1 -0
  91. package/dist/cli/models/index.js +63 -0
  92. package/dist/cli/models/index.js.map +1 -0
  93. package/dist/cli/models/render.d.ts +9 -0
  94. package/dist/cli/models/render.d.ts.map +1 -0
  95. package/dist/cli/models/render.js +33 -0
  96. package/dist/cli/models/render.js.map +1 -0
  97. package/dist/cli/request/index.d.ts.map +1 -1
  98. package/dist/cli/request/index.js +8 -2
  99. package/dist/cli/request/index.js.map +1 -1
  100. package/dist/cli/request/layers.d.ts +2 -0
  101. package/dist/cli/request/layers.d.ts.map +1 -1
  102. package/dist/cli/request/layers.js +9 -5
  103. package/dist/cli/request/layers.js.map +1 -1
  104. package/dist/cli/request/posture.d.ts +28 -0
  105. package/dist/cli/request/posture.d.ts.map +1 -0
  106. package/dist/cli/request/posture.js +70 -0
  107. package/dist/cli/request/posture.js.map +1 -0
  108. package/dist/cli/request/resolution-types.d.ts +1 -0
  109. package/dist/cli/request/resolution-types.d.ts.map +1 -1
  110. package/dist/cli/request/settings.d.ts +2 -12
  111. package/dist/cli/request/settings.d.ts.map +1 -1
  112. package/dist/cli/request/settings.js +2 -25
  113. package/dist/cli/request/settings.js.map +1 -1
  114. package/dist/cli/request/validation.d.ts +12 -0
  115. package/dist/cli/request/validation.d.ts.map +1 -1
  116. package/dist/cli/request/validation.js +30 -10
  117. package/dist/cli/request/validation.js.map +1 -1
  118. package/dist/cli/request/values.d.ts +1 -0
  119. package/dist/cli/request/values.d.ts.map +1 -1
  120. package/dist/cli/request/values.js +1 -0
  121. package/dist/cli/request/values.js.map +1 -1
  122. package/dist/cli/run/index.d.ts.map +1 -1
  123. package/dist/cli/run/index.js +5 -41
  124. package/dist/cli/run/index.js.map +1 -1
  125. package/dist/cli/run/subscribe.d.ts +19 -0
  126. package/dist/cli/run/subscribe.d.ts.map +1 -0
  127. package/dist/cli/run/subscribe.js +47 -0
  128. package/dist/cli/run/subscribe.js.map +1 -0
  129. package/dist/cli/session/launch.d.ts +3 -0
  130. package/dist/cli/session/launch.d.ts.map +1 -1
  131. package/dist/cli/session/launch.js +11 -0
  132. package/dist/cli/session/launch.js.map +1 -1
  133. package/dist/cli/sessions/index.d.ts +30 -0
  134. package/dist/cli/sessions/index.d.ts.map +1 -0
  135. package/dist/cli/sessions/index.js +61 -0
  136. package/dist/cli/sessions/index.js.map +1 -0
  137. package/dist/cli/sessions/list.d.ts +28 -0
  138. package/dist/cli/sessions/list.d.ts.map +1 -0
  139. package/dist/cli/sessions/list.js +63 -0
  140. package/dist/cli/sessions/list.js.map +1 -0
  141. package/dist/cli/sessions/settings.d.ts +11 -0
  142. package/dist/cli/sessions/settings.d.ts.map +1 -0
  143. package/dist/cli/sessions/settings.js +26 -0
  144. package/dist/cli/sessions/settings.js.map +1 -0
  145. package/dist/cli/table.d.ts +7 -0
  146. package/dist/cli/table.d.ts.map +1 -0
  147. package/dist/cli/table.js +14 -0
  148. package/dist/cli/table.js.map +1 -0
  149. package/dist/cli/types.d.ts +5 -1
  150. package/dist/cli/types.d.ts.map +1 -1
  151. package/dist/cli/types.js.map +1 -1
  152. package/dist/codex/command.d.ts +18 -2
  153. package/dist/codex/command.d.ts.map +1 -1
  154. package/dist/codex/command.js +39 -24
  155. package/dist/codex/command.js.map +1 -1
  156. package/dist/codex/model-picker.d.ts.map +1 -1
  157. package/dist/codex/model-picker.js +3 -2
  158. package/dist/codex/model-picker.js.map +1 -1
  159. package/dist/codex/session/build.d.ts.map +1 -1
  160. package/dist/codex/session/build.js +5 -7
  161. package/dist/codex/session/build.js.map +1 -1
  162. package/dist/codex/session/index.d.ts.map +1 -1
  163. package/dist/codex/session/index.js +5 -2
  164. package/dist/codex/session/index.js.map +1 -1
  165. package/dist/codex/session/resume.d.ts +1 -1
  166. package/dist/codex/session/resume.d.ts.map +1 -1
  167. package/dist/codex/session/resume.js +5 -1
  168. package/dist/codex/session/resume.js.map +1 -1
  169. package/dist/codex/session/start-or-resume.js +1 -0
  170. package/dist/codex/session/start-or-resume.js.map +1 -1
  171. package/dist/codex/session/types.d.ts +3 -0
  172. package/dist/codex/session/types.d.ts.map +1 -1
  173. package/dist/codex/simple.d.ts.map +1 -1
  174. package/dist/codex/simple.js +4 -0
  175. package/dist/codex/simple.js.map +1 -1
  176. package/dist/core/errors.d.ts +1 -1
  177. package/dist/core/errors.d.ts.map +1 -1
  178. package/dist/core/errors.js.map +1 -1
  179. package/dist/core/high-trust.d.ts +41 -0
  180. package/dist/core/high-trust.d.ts.map +1 -0
  181. package/dist/core/high-trust.js +50 -0
  182. package/dist/core/high-trust.js.map +1 -0
  183. package/dist/core/input/index.d.ts.map +1 -1
  184. package/dist/core/input/index.js +15 -3
  185. package/dist/core/input/index.js.map +1 -1
  186. package/dist/core/models/input.d.ts +3 -0
  187. package/dist/core/models/input.d.ts.map +1 -0
  188. package/dist/core/models/input.js +9 -0
  189. package/dist/core/models/input.js.map +1 -0
  190. package/dist/core/models/picker.d.ts +2 -1
  191. package/dist/core/models/picker.d.ts.map +1 -1
  192. package/dist/core/models/picker.js +6 -5
  193. package/dist/core/models/picker.js.map +1 -1
  194. package/dist/core/models/tui-screen.d.ts +1 -1
  195. package/dist/core/models/tui-screen.d.ts.map +1 -1
  196. package/dist/core/models/tui-screen.js +26 -3
  197. package/dist/core/models/tui-screen.js.map +1 -1
  198. package/dist/core/trust/allowlist.d.ts +56 -0
  199. package/dist/core/trust/allowlist.d.ts.map +1 -0
  200. package/dist/core/{trust-prompts.js → trust/allowlist.js} +21 -38
  201. package/dist/core/trust/allowlist.js.map +1 -0
  202. package/dist/core/trust/prompts.d.ts +4 -46
  203. package/dist/core/trust/prompts.d.ts.map +1 -1
  204. package/dist/core/trust/prompts.js +2 -73
  205. package/dist/core/trust/prompts.js.map +1 -1
  206. package/dist/core/trust/responder.d.ts +2 -0
  207. package/dist/core/trust/responder.d.ts.map +1 -1
  208. package/dist/core/trust/responder.js +4 -0
  209. package/dist/core/trust/responder.js.map +1 -1
  210. package/dist/core/types.d.ts +3 -0
  211. package/dist/core/types.d.ts.map +1 -1
  212. package/dist/runtime/launch-arguments.d.ts +12 -0
  213. package/dist/runtime/launch-arguments.d.ts.map +1 -0
  214. package/dist/runtime/launch-arguments.js +15 -0
  215. package/dist/runtime/launch-arguments.js.map +1 -0
  216. package/dist/runtime/session/base.d.ts.map +1 -1
  217. package/dist/runtime/session/base.js +4 -1
  218. package/dist/runtime/session/base.js.map +1 -1
  219. package/dist/runtime/session/commands.d.ts +2 -1
  220. package/dist/runtime/session/commands.d.ts.map +1 -1
  221. package/dist/runtime/session/commands.js +10 -4
  222. package/dist/runtime/session/commands.js.map +1 -1
  223. package/dist/runtime/session/lifecycle.d.ts +3 -4
  224. package/dist/runtime/session/lifecycle.d.ts.map +1 -1
  225. package/dist/runtime/session/lifecycle.js +6 -5
  226. package/dist/runtime/session/lifecycle.js.map +1 -1
  227. package/dist/state/directories.d.ts +4 -0
  228. package/dist/state/directories.d.ts.map +1 -0
  229. package/dist/state/directories.js +41 -0
  230. package/dist/state/directories.js.map +1 -0
  231. package/dist/state/files.d.ts.map +1 -1
  232. package/dist/state/files.js +25 -11
  233. package/dist/state/files.js.map +1 -1
  234. package/dist/state/private-session.d.ts.map +1 -1
  235. package/dist/state/private-session.js +2 -0
  236. package/dist/state/private-session.js.map +1 -1
  237. package/dist/state/store.d.ts.map +1 -1
  238. package/dist/state/store.js +7 -1
  239. package/dist/state/store.js.map +1 -1
  240. package/docs/cli-behavior.md +89 -1
  241. package/docs/cli-output.md +60 -0
  242. package/docs/cli.md +10 -2
  243. package/docs/codex/cli.md +57 -0
  244. package/docs/codex/config.md +47 -0
  245. package/docs/codex/hooks.md +70 -0
  246. package/examples/README.md +56 -0
  247. package/examples/full.ts +113 -0
  248. package/examples/minimal.ts +15 -0
  249. package/examples/stream.ts +39 -0
  250. package/examples/support.ts +71 -0
  251. package/package.json +17 -10
  252. package/prd/01-overview.md +21 -0
  253. package/prd/02-goals.md +47 -0
  254. package/prd/03-terminology.md +32 -0
  255. package/prd/04-architecture.md +121 -0
  256. package/prd/05-api/5.1-starting-claude.md +108 -0
  257. package/prd/05-api/5.2-resuming-claude.md +86 -0
  258. package/prd/05-api/5.3-claude-session-api.md +658 -0
  259. package/prd/05-api/5.4-events.md +145 -0
  260. package/prd/05-api/5.5-starting-codex.md +106 -0
  261. package/prd/05-api/5.6-resuming-codex.md +48 -0
  262. package/prd/05-api/5.7-codex-session-api.md +425 -0
  263. package/prd/05-api/5.8-session-api.md +122 -0
  264. package/prd/05-api/5.9-loops.md +170 -0
  265. package/prd/05-api/README.md +19 -0
  266. package/prd/06-claude-hook-bridge.md +164 -0
  267. package/prd/07-claude-policy.md +15 -0
  268. package/prd/07a-codex-hook-bridge.md +76 -0
  269. package/prd/08-state.md +127 -0
  270. package/prd/09-lifecycle.md +222 -0
  271. package/prd/10-errors.md +55 -0
  272. package/prd/11-test-app.md +53 -0
  273. package/prd/12-e2e.md +23 -0
  274. package/prd/12a-cli.md +375 -0
  275. package/prd/13-latitude.md +12 -0
  276. package/prd/14-conformance.md +333 -0
  277. package/prd/15-open-notes.md +8 -0
  278. package/prd/README.md +45 -0
  279. package/dist/claude/hook-dispatch.d.ts +0 -9
  280. package/dist/claude/hook-dispatch.d.ts.map +0 -1
  281. package/dist/claude/hook-dispatch.js +0 -12
  282. package/dist/claude/hook-dispatch.js.map +0 -1
  283. package/dist/claude/hook-events-extra.d.ts +0 -81
  284. package/dist/claude/hook-events-extra.d.ts.map +0 -1
  285. package/dist/claude/hook-events-extra.js +0 -6
  286. package/dist/claude/hook-events-extra.js.map +0 -1
  287. package/dist/claude/hook-events.d.ts +0 -101
  288. package/dist/claude/hook-events.d.ts.map +0 -1
  289. package/dist/claude/hook-events.js +0 -6
  290. package/dist/claude/hook-events.js.map +0 -1
  291. package/dist/claude/hook-names.d.ts +0 -24
  292. package/dist/claude/hook-names.d.ts.map +0 -1
  293. package/dist/claude/hook-names.js +0 -45
  294. package/dist/claude/hook-names.js.map +0 -1
  295. package/dist/claude/hooks.d.ts +0 -78
  296. package/dist/claude/hooks.d.ts.map +0 -1
  297. package/dist/claude/hooks.js +0 -6
  298. package/dist/claude/hooks.js.map +0 -1
  299. package/dist/claude/session-bridge.d.ts +0 -11
  300. package/dist/claude/session-bridge.d.ts.map +0 -1
  301. package/dist/claude/session-bridge.js +0 -18
  302. package/dist/claude/session-bridge.js.map +0 -1
  303. package/dist/claude/session-build.d.ts +0 -15
  304. package/dist/claude/session-build.d.ts.map +0 -1
  305. package/dist/claude/session-build.js +0 -147
  306. package/dist/claude/session-build.js.map +0 -1
  307. package/dist/claude/session-hook-handler.d.ts +0 -34
  308. package/dist/claude/session-hook-handler.d.ts.map +0 -1
  309. package/dist/claude/session-hook-handler.js +0 -42
  310. package/dist/claude/session-hook-handler.js.map +0 -1
  311. package/dist/claude/session-instance.d.ts +0 -42
  312. package/dist/claude/session-instance.d.ts.map +0 -1
  313. package/dist/claude/session-instance.js +0 -146
  314. package/dist/claude/session-instance.js.map +0 -1
  315. package/dist/claude/session-interface.d.ts +0 -49
  316. package/dist/claude/session-interface.d.ts.map +0 -1
  317. package/dist/claude/session-interface.js +0 -10
  318. package/dist/claude/session-interface.js.map +0 -1
  319. package/dist/claude/session-resume.d.ts +0 -8
  320. package/dist/claude/session-resume.d.ts.map +0 -1
  321. package/dist/claude/session-resume.js +0 -47
  322. package/dist/claude/session-resume.js.map +0 -1
  323. package/dist/claude/session-runtime.d.ts +0 -43
  324. package/dist/claude/session-runtime.d.ts.map +0 -1
  325. package/dist/claude/session-runtime.js +0 -105
  326. package/dist/claude/session-runtime.js.map +0 -1
  327. package/dist/claude/session-transcript.d.ts +0 -62
  328. package/dist/claude/session-transcript.d.ts.map +0 -1
  329. package/dist/claude/session-transcript.js +0 -88
  330. package/dist/claude/session-transcript.js.map +0 -1
  331. package/dist/claude/session.d.ts +0 -18
  332. package/dist/claude/session.d.ts.map +0 -1
  333. package/dist/claude/session.js +0 -58
  334. package/dist/claude/session.js.map +0 -1
  335. package/dist/claude/start-or-resume.d.ts +0 -12
  336. package/dist/claude/start-or-resume.d.ts.map +0 -1
  337. package/dist/claude/start-or-resume.js +0 -32
  338. package/dist/claude/start-or-resume.js.map +0 -1
  339. package/dist/claude/tool-hook-events.d.ts +0 -10
  340. package/dist/claude/tool-hook-events.d.ts.map +0 -1
  341. package/dist/claude/tool-hook-events.js +0 -18
  342. package/dist/claude/tool-hook-events.js.map +0 -1
  343. package/dist/claude/tool-types.d.ts +0 -158
  344. package/dist/claude/tool-types.d.ts.map +0 -1
  345. package/dist/claude/tool-types.js +0 -6
  346. package/dist/claude/tool-types.js.map +0 -1
  347. package/dist/claude/validate-input.d.ts +0 -8
  348. package/dist/claude/validate-input.d.ts.map +0 -1
  349. package/dist/claude/validate-input.js +0 -137
  350. package/dist/claude/validate-input.js.map +0 -1
  351. package/dist/claude/validate-permission-update.d.ts +0 -10
  352. package/dist/claude/validate-permission-update.d.ts.map +0 -1
  353. package/dist/claude/validate-permission-update.js +0 -72
  354. package/dist/claude/validate-permission-update.js.map +0 -1
  355. package/dist/claude/validate-result.d.ts +0 -7
  356. package/dist/claude/validate-result.d.ts.map +0 -1
  357. package/dist/claude/validate-result.js +0 -118
  358. package/dist/claude/validate-result.js.map +0 -1
  359. package/dist/claude/validate-shapes.d.ts +0 -22
  360. package/dist/claude/validate-shapes.d.ts.map +0 -1
  361. package/dist/claude/validate-shapes.js +0 -15
  362. package/dist/claude/validate-shapes.js.map +0 -1
  363. package/dist/claude/validate-tool-update.d.ts +0 -15
  364. package/dist/claude/validate-tool-update.d.ts.map +0 -1
  365. package/dist/claude/validate-tool-update.js +0 -122
  366. package/dist/claude/validate-tool-update.js.map +0 -1
  367. package/dist/cli/agent-detect.d.ts +0 -44
  368. package/dist/cli/agent-detect.d.ts.map +0 -1
  369. package/dist/cli/agent-detect.js +0 -66
  370. package/dist/cli/agent-detect.js.map +0 -1
  371. package/dist/cli/arg-errors.d.ts +0 -6
  372. package/dist/cli/arg-errors.d.ts.map +0 -1
  373. package/dist/cli/arg-errors.js +0 -44
  374. package/dist/cli/arg-errors.js.map +0 -1
  375. package/dist/cli/arg-options.d.ts +0 -26
  376. package/dist/cli/arg-options.d.ts.map +0 -1
  377. package/dist/cli/arg-options.js +0 -50
  378. package/dist/cli/arg-options.js.map +0 -1
  379. package/dist/cli/args.d.ts +0 -7
  380. package/dist/cli/args.d.ts.map +0 -1
  381. package/dist/cli/args.js +0 -70
  382. package/dist/cli/args.js.map +0 -1
  383. package/dist/cli/lifecycle-outcome.d.ts +0 -13
  384. package/dist/cli/lifecycle-outcome.d.ts.map +0 -1
  385. package/dist/cli/lifecycle-outcome.js +0 -20
  386. package/dist/cli/lifecycle-outcome.js.map +0 -1
  387. package/dist/cli/lifecycle.d.ts +0 -61
  388. package/dist/cli/lifecycle.d.ts.map +0 -1
  389. package/dist/cli/lifecycle.js +0 -152
  390. package/dist/cli/lifecycle.js.map +0 -1
  391. package/dist/cli/request-finalize.d.ts +0 -10
  392. package/dist/cli/request-finalize.d.ts.map +0 -1
  393. package/dist/cli/request-finalize.js +0 -135
  394. package/dist/cli/request-finalize.js.map +0 -1
  395. package/dist/cli/request-layers.d.ts +0 -30
  396. package/dist/cli/request-layers.d.ts.map +0 -1
  397. package/dist/cli/request-layers.js +0 -44
  398. package/dist/cli/request-layers.js.map +0 -1
  399. package/dist/cli/request-settings.d.ts +0 -34
  400. package/dist/cli/request-settings.d.ts.map +0 -1
  401. package/dist/cli/request-settings.js +0 -66
  402. package/dist/cli/request-settings.js.map +0 -1
  403. package/dist/cli/request-sources.d.ts +0 -13
  404. package/dist/cli/request-sources.d.ts.map +0 -1
  405. package/dist/cli/request-sources.js +0 -23
  406. package/dist/cli/request-sources.js.map +0 -1
  407. package/dist/cli/request-validation.d.ts +0 -18
  408. package/dist/cli/request-validation.d.ts.map +0 -1
  409. package/dist/cli/request-validation.js +0 -84
  410. package/dist/cli/request-validation.js.map +0 -1
  411. package/dist/cli/request-values.d.ts +0 -33
  412. package/dist/cli/request-values.d.ts.map +0 -1
  413. package/dist/cli/request-values.js +0 -73
  414. package/dist/cli/request-values.js.map +0 -1
  415. package/dist/cli/request.d.ts +0 -12
  416. package/dist/cli/request.d.ts.map +0 -1
  417. package/dist/cli/request.js +0 -103
  418. package/dist/cli/request.js.map +0 -1
  419. package/dist/cli/resolution-types.d.ts +0 -35
  420. package/dist/cli/resolution-types.d.ts.map +0 -1
  421. package/dist/cli/resolution-types.js +0 -6
  422. package/dist/cli/resolution-types.js.map +0 -1
  423. package/dist/cli/run-output-lines.d.ts +0 -14
  424. package/dist/cli/run-output-lines.d.ts.map +0 -1
  425. package/dist/cli/run-output-lines.js +0 -42
  426. package/dist/cli/run-output-lines.js.map +0 -1
  427. package/dist/cli/run-output.d.ts +0 -48
  428. package/dist/cli/run-output.d.ts.map +0 -1
  429. package/dist/cli/run-output.js +0 -150
  430. package/dist/cli/run-output.js.map +0 -1
  431. package/dist/cli/run.d.ts +0 -20
  432. package/dist/cli/run.d.ts.map +0 -1
  433. package/dist/cli/run.js +0 -126
  434. package/dist/cli/run.js.map +0 -1
  435. package/dist/cli/session-launch.d.ts +0 -23
  436. package/dist/cli/session-launch.d.ts.map +0 -1
  437. package/dist/cli/session-launch.js +0 -57
  438. package/dist/cli/session-launch.js.map +0 -1
  439. package/dist/cli/session.d.ts +0 -68
  440. package/dist/cli/session.d.ts.map +0 -1
  441. package/dist/cli/session.js +0 -124
  442. package/dist/cli/session.js.map +0 -1
  443. package/dist/codex/attach-images.d.ts +0 -20
  444. package/dist/codex/attach-images.d.ts.map +0 -1
  445. package/dist/codex/attach-images.js +0 -66
  446. package/dist/codex/attach-images.js.map +0 -1
  447. package/dist/codex/clipboard-lock.d.ts +0 -15
  448. package/dist/codex/clipboard-lock.d.ts.map +0 -1
  449. package/dist/codex/clipboard-lock.js +0 -16
  450. package/dist/codex/clipboard-lock.js.map +0 -1
  451. package/dist/codex/clipboard.d.ts +0 -32
  452. package/dist/codex/clipboard.d.ts.map +0 -1
  453. package/dist/codex/clipboard.js +0 -92
  454. package/dist/codex/clipboard.js.map +0 -1
  455. package/dist/codex/config-lock.d.ts +0 -21
  456. package/dist/codex/config-lock.d.ts.map +0 -1
  457. package/dist/codex/config-lock.js +0 -22
  458. package/dist/codex/config-lock.js.map +0 -1
  459. package/dist/codex/config-restore.d.ts +0 -33
  460. package/dist/codex/config-restore.d.ts.map +0 -1
  461. package/dist/codex/config-restore.js +0 -90
  462. package/dist/codex/config-restore.js.map +0 -1
  463. package/dist/codex/config-transaction.d.ts +0 -26
  464. package/dist/codex/config-transaction.d.ts.map +0 -1
  465. package/dist/codex/config-transaction.js +0 -47
  466. package/dist/codex/config-transaction.js.map +0 -1
  467. package/dist/codex/hook-dispatch.d.ts +0 -9
  468. package/dist/codex/hook-dispatch.d.ts.map +0 -1
  469. package/dist/codex/hook-dispatch.js +0 -14
  470. package/dist/codex/hook-dispatch.js.map +0 -1
  471. package/dist/codex/hook-names.d.ts +0 -19
  472. package/dist/codex/hook-names.d.ts.map +0 -1
  473. package/dist/codex/hook-names.js +0 -17
  474. package/dist/codex/hook-names.js.map +0 -1
  475. package/dist/codex/hooks.d.ts +0 -99
  476. package/dist/codex/hooks.d.ts.map +0 -1
  477. package/dist/codex/hooks.js +0 -6
  478. package/dist/codex/hooks.js.map +0 -1
  479. package/dist/codex/initial-ready.d.ts +0 -19
  480. package/dist/codex/initial-ready.d.ts.map +0 -1
  481. package/dist/codex/initial-ready.js +0 -19
  482. package/dist/codex/initial-ready.js.map +0 -1
  483. package/dist/codex/serialize.d.ts +0 -8
  484. package/dist/codex/serialize.d.ts.map +0 -1
  485. package/dist/codex/serialize.js +0 -48
  486. package/dist/codex/serialize.js.map +0 -1
  487. package/dist/codex/session-bridge.d.ts +0 -14
  488. package/dist/codex/session-bridge.d.ts.map +0 -1
  489. package/dist/codex/session-bridge.js +0 -20
  490. package/dist/codex/session-bridge.js.map +0 -1
  491. package/dist/codex/session-build.d.ts +0 -15
  492. package/dist/codex/session-build.d.ts.map +0 -1
  493. package/dist/codex/session-build.js +0 -144
  494. package/dist/codex/session-build.js.map +0 -1
  495. package/dist/codex/session-cleanup.d.ts +0 -12
  496. package/dist/codex/session-cleanup.d.ts.map +0 -1
  497. package/dist/codex/session-cleanup.js +0 -15
  498. package/dist/codex/session-cleanup.js.map +0 -1
  499. package/dist/codex/session-hooks.d.ts +0 -13
  500. package/dist/codex/session-hooks.d.ts.map +0 -1
  501. package/dist/codex/session-hooks.js +0 -54
  502. package/dist/codex/session-hooks.js.map +0 -1
  503. package/dist/codex/session-instance.d.ts +0 -50
  504. package/dist/codex/session-instance.d.ts.map +0 -1
  505. package/dist/codex/session-instance.js +0 -117
  506. package/dist/codex/session-instance.js.map +0 -1
  507. package/dist/codex/session-resume.d.ts +0 -7
  508. package/dist/codex/session-resume.d.ts.map +0 -1
  509. package/dist/codex/session-resume.js +0 -44
  510. package/dist/codex/session-resume.js.map +0 -1
  511. package/dist/codex/session-runtime.d.ts +0 -7
  512. package/dist/codex/session-runtime.d.ts.map +0 -1
  513. package/dist/codex/session-runtime.js +0 -10
  514. package/dist/codex/session-runtime.js.map +0 -1
  515. package/dist/codex/session-transcript.d.ts +0 -30
  516. package/dist/codex/session-transcript.d.ts.map +0 -1
  517. package/dist/codex/session-transcript.js +0 -53
  518. package/dist/codex/session-transcript.js.map +0 -1
  519. package/dist/codex/session-types.d.ts +0 -87
  520. package/dist/codex/session-types.d.ts.map +0 -1
  521. package/dist/codex/session-types.js +0 -6
  522. package/dist/codex/session-types.js.map +0 -1
  523. package/dist/codex/session-warnings.d.ts +0 -27
  524. package/dist/codex/session-warnings.d.ts.map +0 -1
  525. package/dist/codex/session-warnings.js +0 -54
  526. package/dist/codex/session-warnings.js.map +0 -1
  527. package/dist/codex/session.d.ts +0 -16
  528. package/dist/codex/session.d.ts.map +0 -1
  529. package/dist/codex/session.js +0 -61
  530. package/dist/codex/session.js.map +0 -1
  531. package/dist/codex/start-or-resume.d.ts +0 -12
  532. package/dist/codex/start-or-resume.d.ts.map +0 -1
  533. package/dist/codex/start-or-resume.js +0 -31
  534. package/dist/codex/start-or-resume.js.map +0 -1
  535. package/dist/codex/transcript/cursor-io.d.ts +0 -7
  536. package/dist/codex/transcript/cursor-io.d.ts.map +0 -1
  537. package/dist/codex/transcript/cursor-io.js +0 -7
  538. package/dist/codex/transcript/cursor-io.js.map +0 -1
  539. package/dist/codex/transcript/cursor.d.ts +0 -8
  540. package/dist/codex/transcript/cursor.d.ts.map +0 -1
  541. package/dist/codex/transcript/cursor.js +0 -8
  542. package/dist/codex/transcript/cursor.js.map +0 -1
  543. package/dist/codex/transcript/drops.d.ts +0 -9
  544. package/dist/codex/transcript/drops.d.ts.map +0 -1
  545. package/dist/codex/transcript/drops.js +0 -9
  546. package/dist/codex/transcript/drops.js.map +0 -1
  547. package/dist/codex/transcript.d.ts +0 -12
  548. package/dist/codex/transcript.d.ts.map +0 -1
  549. package/dist/codex/transcript.js +0 -10
  550. package/dist/codex/transcript.js.map +0 -1
  551. package/dist/codex/validate-result.d.ts +0 -7
  552. package/dist/codex/validate-result.d.ts.map +0 -1
  553. package/dist/codex/validate-result.js +0 -84
  554. package/dist/codex/validate-result.js.map +0 -1
  555. package/dist/codex/validate.d.ts +0 -11
  556. package/dist/codex/validate.d.ts.map +0 -1
  557. package/dist/codex/validate.js +0 -88
  558. package/dist/codex/validate.js.map +0 -1
  559. package/dist/core/activity-lifecycle.d.ts +0 -21
  560. package/dist/core/activity-lifecycle.d.ts.map +0 -1
  561. package/dist/core/activity-lifecycle.js +0 -45
  562. package/dist/core/activity-lifecycle.js.map +0 -1
  563. package/dist/core/activity-meta.d.ts +0 -13
  564. package/dist/core/activity-meta.d.ts.map +0 -1
  565. package/dist/core/activity-meta.js +0 -67
  566. package/dist/core/activity-meta.js.map +0 -1
  567. package/dist/core/activity-transcript.d.ts +0 -19
  568. package/dist/core/activity-transcript.d.ts.map +0 -1
  569. package/dist/core/activity-transcript.js +0 -60
  570. package/dist/core/activity-transcript.js.map +0 -1
  571. package/dist/core/activity.d.ts +0 -51
  572. package/dist/core/activity.d.ts.map +0 -1
  573. package/dist/core/activity.js +0 -81
  574. package/dist/core/activity.js.map +0 -1
  575. package/dist/core/control-queue-state.d.ts +0 -29
  576. package/dist/core/control-queue-state.d.ts.map +0 -1
  577. package/dist/core/control-queue-state.js +0 -95
  578. package/dist/core/control-queue-state.js.map +0 -1
  579. package/dist/core/control-queue-traits.d.ts +0 -54
  580. package/dist/core/control-queue-traits.d.ts.map +0 -1
  581. package/dist/core/control-queue-traits.js +0 -118
  582. package/dist/core/control-queue-traits.js.map +0 -1
  583. package/dist/core/control-queue-types.d.ts +0 -45
  584. package/dist/core/control-queue-types.d.ts.map +0 -1
  585. package/dist/core/control-queue-types.js +0 -7
  586. package/dist/core/control-queue-types.js.map +0 -1
  587. package/dist/core/control-queue.d.ts +0 -21
  588. package/dist/core/control-queue.d.ts.map +0 -1
  589. package/dist/core/control-queue.js +0 -98
  590. package/dist/core/control-queue.js.map +0 -1
  591. package/dist/core/list-models.d.ts +0 -44
  592. package/dist/core/list-models.d.ts.map +0 -1
  593. package/dist/core/list-models.js +0 -73
  594. package/dist/core/list-models.js.map +0 -1
  595. package/dist/core/model-picker.d.ts +0 -22
  596. package/dist/core/model-picker.d.ts.map +0 -1
  597. package/dist/core/model-picker.js +0 -58
  598. package/dist/core/model-picker.js.map +0 -1
  599. package/dist/core/model-rows.d.ts +0 -21
  600. package/dist/core/model-rows.d.ts.map +0 -1
  601. package/dist/core/model-rows.js +0 -57
  602. package/dist/core/model-rows.js.map +0 -1
  603. package/dist/core/probe-state.d.ts +0 -21
  604. package/dist/core/probe-state.d.ts.map +0 -1
  605. package/dist/core/probe-state.js +0 -39
  606. package/dist/core/probe-state.js.map +0 -1
  607. package/dist/core/session-input-abort.d.ts +0 -10
  608. package/dist/core/session-input-abort.d.ts.map +0 -1
  609. package/dist/core/session-input-abort.js +0 -44
  610. package/dist/core/session-input-abort.js.map +0 -1
  611. package/dist/core/session-input.d.ts +0 -37
  612. package/dist/core/session-input.d.ts.map +0 -1
  613. package/dist/core/session-input.js +0 -154
  614. package/dist/core/session-input.js.map +0 -1
  615. package/dist/core/session-warnings.d.ts +0 -20
  616. package/dist/core/session-warnings.d.ts.map +0 -1
  617. package/dist/core/session-warnings.js +0 -32
  618. package/dist/core/session-warnings.js.map +0 -1
  619. package/dist/core/simple/loop-controls.d.ts +0 -7
  620. package/dist/core/simple/loop-controls.d.ts.map +0 -1
  621. package/dist/core/simple/loop-controls.js +0 -7
  622. package/dist/core/simple/loop-controls.js.map +0 -1
  623. package/dist/core/startup-automation.d.ts +0 -54
  624. package/dist/core/startup-automation.d.ts.map +0 -1
  625. package/dist/core/startup-automation.js +0 -40
  626. package/dist/core/startup-automation.js.map +0 -1
  627. package/dist/core/startup-frame.d.ts +0 -39
  628. package/dist/core/startup-frame.d.ts.map +0 -1
  629. package/dist/core/startup-frame.js +0 -60
  630. package/dist/core/startup-frame.js.map +0 -1
  631. package/dist/core/startup-write.d.ts +0 -47
  632. package/dist/core/startup-write.d.ts.map +0 -1
  633. package/dist/core/startup-write.js +0 -73
  634. package/dist/core/startup-write.js.map +0 -1
  635. package/dist/core/trust-blocking.d.ts +0 -22
  636. package/dist/core/trust-blocking.d.ts.map +0 -1
  637. package/dist/core/trust-blocking.js +0 -38
  638. package/dist/core/trust-blocking.js.map +0 -1
  639. package/dist/core/trust-prompts.d.ts +0 -135
  640. package/dist/core/trust-prompts.d.ts.map +0 -1
  641. package/dist/core/trust-prompts.js.map +0 -1
  642. package/dist/core/trust-responder.d.ts +0 -48
  643. package/dist/core/trust-responder.d.ts.map +0 -1
  644. package/dist/core/trust-responder.js +0 -119
  645. package/dist/core/trust-responder.js.map +0 -1
  646. package/dist/core/tui-screen.d.ts +0 -21
  647. package/dist/core/tui-screen.d.ts.map +0 -1
  648. package/dist/core/tui-screen.js +0 -56
  649. package/dist/core/tui-screen.js.map +0 -1
  650. package/dist/core/update-warning.d.ts +0 -25
  651. package/dist/core/update-warning.d.ts.map +0 -1
  652. package/dist/core/update-warning.js +0 -33
  653. package/dist/core/update-warning.js.map +0 -1
  654. package/dist/core/warning-lifecycle.d.ts +0 -23
  655. package/dist/core/warning-lifecycle.d.ts.map +0 -1
  656. package/dist/core/warning-lifecycle.js +0 -6
  657. package/dist/core/warning-lifecycle.js.map +0 -1
  658. package/dist/core/warning-reasons.d.ts +0 -62
  659. package/dist/core/warning-reasons.d.ts.map +0 -1
  660. package/dist/core/warning-reasons.js +0 -121
  661. package/dist/core/warning-reasons.js.map +0 -1
  662. package/dist/core/warnings.d.ts +0 -145
  663. package/dist/core/warnings.d.ts.map +0 -1
  664. package/dist/core/warnings.js +0 -12
  665. package/dist/core/warnings.js.map +0 -1
  666. package/dist/runtime/cleanup-latch.d.ts +0 -27
  667. package/dist/runtime/cleanup-latch.d.ts.map +0 -1
  668. package/dist/runtime/cleanup-latch.js +0 -43
  669. package/dist/runtime/cleanup-latch.js.map +0 -1
  670. package/dist/runtime/initial-ready-advance.d.ts +0 -22
  671. package/dist/runtime/initial-ready-advance.d.ts.map +0 -1
  672. package/dist/runtime/initial-ready-advance.js +0 -39
  673. package/dist/runtime/initial-ready-advance.js.map +0 -1
  674. package/dist/runtime/initial-ready-fallback.d.ts +0 -12
  675. package/dist/runtime/initial-ready-fallback.d.ts.map +0 -1
  676. package/dist/runtime/initial-ready-fallback.js +0 -20
  677. package/dist/runtime/initial-ready-fallback.js.map +0 -1
  678. package/dist/runtime/initial-ready.d.ts +0 -49
  679. package/dist/runtime/initial-ready.d.ts.map +0 -1
  680. package/dist/runtime/initial-ready.js +0 -81
  681. package/dist/runtime/initial-ready.js.map +0 -1
  682. package/dist/runtime/reap-tree.d.ts +0 -62
  683. package/dist/runtime/reap-tree.d.ts.map +0 -1
  684. package/dist/runtime/reap-tree.js +0 -108
  685. package/dist/runtime/reap-tree.js.map +0 -1
  686. package/dist/runtime/session-base-types.d.ts +0 -36
  687. package/dist/runtime/session-base-types.d.ts.map +0 -1
  688. package/dist/runtime/session-base-types.js +0 -14
  689. package/dist/runtime/session-base-types.js.map +0 -1
  690. package/dist/runtime/session-base.d.ts +0 -48
  691. package/dist/runtime/session-base.d.ts.map +0 -1
  692. package/dist/runtime/session-base.js +0 -76
  693. package/dist/runtime/session-base.js.map +0 -1
  694. package/dist/runtime/session-commands.d.ts +0 -43
  695. package/dist/runtime/session-commands.d.ts.map +0 -1
  696. package/dist/runtime/session-commands.js +0 -52
  697. package/dist/runtime/session-commands.js.map +0 -1
  698. package/dist/runtime/session-exit.d.ts +0 -16
  699. package/dist/runtime/session-exit.d.ts.map +0 -1
  700. package/dist/runtime/session-exit.js +0 -32
  701. package/dist/runtime/session-exit.js.map +0 -1
  702. package/dist/runtime/session-image-attach.d.ts +0 -45
  703. package/dist/runtime/session-image-attach.d.ts.map +0 -1
  704. package/dist/runtime/session-image-attach.js +0 -82
  705. package/dist/runtime/session-image-attach.js.map +0 -1
  706. package/dist/runtime/session-lifecycle.d.ts +0 -61
  707. package/dist/runtime/session-lifecycle.d.ts.map +0 -1
  708. package/dist/runtime/session-lifecycle.js +0 -164
  709. package/dist/runtime/session-lifecycle.js.map +0 -1
  710. package/dist/runtime/session-loops.d.ts +0 -32
  711. package/dist/runtime/session-loops.d.ts.map +0 -1
  712. package/dist/runtime/session-loops.js +0 -62
  713. package/dist/runtime/session-loops.js.map +0 -1
  714. package/dist/runtime/session-readiness.d.ts +0 -18
  715. package/dist/runtime/session-readiness.d.ts.map +0 -1
  716. package/dist/runtime/session-readiness.js +0 -22
  717. package/dist/runtime/session-readiness.js.map +0 -1
  718. package/dist/runtime/session-reap.d.ts +0 -28
  719. package/dist/runtime/session-reap.d.ts.map +0 -1
  720. package/dist/runtime/session-reap.js +0 -51
  721. package/dist/runtime/session-reap.js.map +0 -1
  722. package/dist/runtime/session-resize.d.ts +0 -20
  723. package/dist/runtime/session-resize.d.ts.map +0 -1
  724. package/dist/runtime/session-resize.js +0 -26
  725. package/dist/runtime/session-resize.js.map +0 -1
  726. package/dist/runtime/session-shutdown-binding.d.ts +0 -30
  727. package/dist/runtime/session-shutdown-binding.d.ts.map +0 -1
  728. package/dist/runtime/session-shutdown-binding.js +0 -37
  729. package/dist/runtime/session-shutdown-binding.js.map +0 -1
  730. package/dist/runtime/session-shutdown.d.ts +0 -60
  731. package/dist/runtime/session-shutdown.d.ts.map +0 -1
  732. package/dist/runtime/session-shutdown.js +0 -140
  733. package/dist/runtime/session-shutdown.js.map +0 -1
  734. package/dist/runtime/session-status-wiring.d.ts +0 -38
  735. package/dist/runtime/session-status-wiring.d.ts.map +0 -1
  736. package/dist/runtime/session-status-wiring.js +0 -41
  737. package/dist/runtime/session-status-wiring.js.map +0 -1
  738. package/dist/runtime/session-status.d.ts +0 -7
  739. package/dist/runtime/session-status.d.ts.map +0 -1
  740. package/dist/runtime/session-status.js +0 -22
  741. package/dist/runtime/session-status.js.map +0 -1
  742. package/dist/runtime/shutdown-coordinator.d.ts +0 -57
  743. package/dist/runtime/shutdown-coordinator.d.ts.map +0 -1
  744. package/dist/runtime/shutdown-coordinator.js +0 -77
  745. package/dist/runtime/shutdown-coordinator.js.map +0 -1
  746. package/dist/runtime/startup-buffer.d.ts +0 -33
  747. package/dist/runtime/startup-buffer.d.ts.map +0 -1
  748. package/dist/runtime/startup-buffer.js +0 -53
  749. package/dist/runtime/startup-buffer.js.map +0 -1
  750. package/dist/runtime/startup-cleanup.d.ts +0 -43
  751. package/dist/runtime/startup-cleanup.d.ts.map +0 -1
  752. package/dist/runtime/startup-cleanup.js +0 -89
  753. package/dist/runtime/startup-cleanup.js.map +0 -1
  754. package/dist/runtime/startup.d.ts +0 -17
  755. package/dist/runtime/startup.d.ts.map +0 -1
  756. package/dist/runtime/startup.js +0 -47
  757. package/dist/runtime/startup.js.map +0 -1
  758. package/dist/runtime/status-emit.d.ts +0 -14
  759. package/dist/runtime/status-emit.d.ts.map +0 -1
  760. package/dist/runtime/status-emit.js +0 -15
  761. package/dist/runtime/status-emit.js.map +0 -1
  762. package/dist/runtime/teardown.d.ts +0 -15
  763. package/dist/runtime/teardown.d.ts.map +0 -1
  764. package/dist/runtime/teardown.js +0 -40
  765. package/dist/runtime/teardown.js.map +0 -1
  766. package/dist/runtime/terminate.d.ts +0 -22
  767. package/dist/runtime/terminate.d.ts.map +0 -1
  768. package/dist/runtime/terminate.js +0 -129
  769. package/dist/runtime/terminate.js.map +0 -1
  770. package/dist/runtime/update-lock.d.ts +0 -19
  771. package/dist/runtime/update-lock.d.ts.map +0 -1
  772. package/dist/runtime/update-lock.js +0 -183
  773. package/dist/runtime/update-lock.js.map +0 -1
  774. package/dist/runtime/update-once.d.ts +0 -40
  775. package/dist/runtime/update-once.d.ts.map +0 -1
  776. package/dist/runtime/update-once.js +0 -88
  777. package/dist/runtime/update-once.js.map +0 -1
@@ -0,0 +1,222 @@
1
+ ## 9. Process Lifecycle
2
+
3
+ ### 9.1 Startup
4
+
5
+ `startClaude` performs these observable steps:
6
+
7
+ 1. Resolve `cwd` and state directory.
8
+ 2. Preflight platform support.
9
+ 3. Preflight `claude` availability and version.
10
+ 4. Create an Elwood session record.
11
+ 5. Generate session-scoped Claude settings.
12
+ 6. Start the local hook IPC endpoint.
13
+ 7. Spawn the user's shell in a PTY.
14
+ 8. Launch `claude` from that shell with generated settings and session env.
15
+ 9. Return a `ClaudeSessionApi` object once the process and bridge are ready.
16
+
17
+ `startCodex` performs the analogous startup sequence for Codex:
18
+
19
+ 1. Resolve `cwd` and state directory.
20
+ 2. Preflight platform support.
21
+ 3. Preflight `codex` availability and version.
22
+ 4. Create an Elwood session record.
23
+ 5. Generate session-scoped hook bridge runtime files.
24
+ 6. Start the local hook IPC endpoint.
25
+ 7. Spawn the user's shell in a PTY.
26
+ 8. Launch `codex` from that shell with generated `--config` hook overrides and
27
+ session env.
28
+ 9. Return a `CodexSessionApi` object once the process and bridge are ready.
29
+
30
+ ### 9.2 Compatibility checks
31
+
32
+ Elwood MUST check the installed Claude Code version during startup. The minimum
33
+ supported Claude Code version is `2.1.144`.
34
+
35
+ Elwood MUST check the installed Codex CLI version during `startCodex`. The
36
+ minimum supported Codex CLI version is `0.124.0`.
37
+
38
+ If `autoupdate` is true, Elwood first verifies that the CLI exists, then runs
39
+ the adapter's update command, then reads the version again before enforcing the
40
+ minimum version. The update step is BEST-EFFORT maintenance, not a control gate:
41
+ if the update command itself fails (nonzero exit, timeout, or a subprocess
42
+ error), Elwood MUST NOT fail startup on that basis. Instead it re-reads the
43
+ installed version and enforces the minimum as usual — if the installed CLI still
44
+ meets the minimum, Elwood records a typed `agent_update_failed` warning and
45
+ starts the session normally from the installed binary; only if the installed
46
+ version is below the minimum does startup fail (with the same typed
47
+ compatibility error below). A failed update is attempted at most once per parent
48
+ process and MUST NOT be retried per start, nor may one failed shared update
49
+ reject or poison any other otherwise-compatible start in the roster. If the
50
+ installed agent version is below the minimum after that optional update step,
51
+ startup fails with a typed error that names the required version and feature. If
52
+ the version cannot be parsed, Elwood records a typed `version_unparseable`
53
+ warning and continues by default, with an option for callers to make this fatal.
54
+
55
+ The `agent_update_failed` warning carries only safe diagnostics — the adapter,
56
+ the installed version that will be used, the update command's exit status, an
57
+ allowlisted error code (e.g. a timeout/`errno`), and bounded captured stderr —
58
+ never terminal transcripts, prompts, tokens, or environment secrets. Like all
59
+ warnings it is live-only and requires no consumer handling: a caller that does
60
+ not subscribe to the `warning` event is unaffected and the session still reaches
61
+ `ready`.
62
+
63
+ Version checks and optional `claude update` / `codex update` commands must run
64
+ through the user's configured macOS interactive login shell so PATH resolves as
65
+ it would in a normal Terminal.app session (see §4.2). Elwood uses the user's
66
+ configured login shell rather than trusting
67
+ an inherited `SHELL` environment override from the parent process.
68
+
69
+ These probes MUST run asynchronously and MUST NOT block the host process's
70
+ event loop: a parent that spawns a roster of sessions must not serialize their
71
+ preflights on a single thread. Elwood reads each adapter's `--version` at most
72
+ once per parent process — concurrent first reads share a single subprocess, and
73
+ later reads reuse the cached result — mirroring the once-per-process autoupdate
74
+ dedupe (C-LIFE-09). The cached version and adapter-capability reads are invalidated
75
+ after every coordinated update attempt, including a failed or peer-owned attempt,
76
+ because a failed installer may still have partially changed the binary. When
77
+ `autoupdate` is set, concurrent callers share one update and all validate the same
78
+ post-attempt version, so no caller proceeds on a stale pre-update version or races
79
+ a second update. This mutual exclusion also applies across separate Elwood parent
80
+ processes for the same macOS user and adapter: an atomic lease names the adapter in
81
+ a stable per-account cache independent of `TMPDIR`; contenders wait without
82
+ blocking the event loop, then invalidate their local caches and continue without
83
+ running a duplicate update. The lease records the owner's process id and a unique
84
+ generation. Cleanup removes only the generation it owns, a live owner is never
85
+ evicted solely because the stale bound elapsed, and recovery of a dead owner's
86
+ lease is itself serialized before removal, so neither cleanup nor concurrent stale
87
+ recovery can evict a successor. Within one parent process, a FAILED shared update
88
+ is likewise shared once — every concurrent caller observes the same failure,
89
+ re-reads the installed version, and proceeds through the compatibility gate; the
90
+ failure is never cached in a way that rejects those callers or poisons a later
91
+ start. A contender in another parent process does not receive the owner's live
92
+ warning event; after the lease releases it re-reads and validates the installed
93
+ binary without retrying the failed update. More generally, any per-process cached
94
+ probe (version read, capability detection, update) that fails is not retained as a
95
+ rejected result: a later caller re-attempts rather than inheriting the prior
96
+ failure.
97
+
98
+ Each probe is bounded so a broken or hostile CLI on PATH cannot hang or flood
99
+ the host: a probe that does not exit within a default timeout (15 seconds) or
100
+ whose captured output exceeds a per-stream byte cap (1,000,000 bytes) is
101
+ killed, and its captured output is truncated to the cap. Truncation happens on
102
+ a UTF-8 code-point boundary — an incomplete trailing sequence is dropped — so
103
+ the decoded output re-encodes to at most the cap rather than growing via a
104
+ replacement character. This applies to every
105
+ non-PTY probe — `--version`, `--help` capability detection, and
106
+ `claude update` / `codex update`. A `--version`/`--help` failure (bounded or
107
+ otherwise) surfaces through that probe's existing public error name —
108
+ `claude_start_failed` / `codex_start_failed` — with the underlying reason
109
+ preserved in the error `details` as `cause` (and `errno`, e.g. `ETIMEDOUT` on
110
+ timeout or `E2BIG` on overflow) alongside any `stderr`. An UPDATE failure
111
+ (`claude update` / `codex update`), being best-effort maintenance, does NOT
112
+ surface as a start-blocking error; it is contained and surfaces as the live
113
+ `agent_update_failed` warning carrying the same bounded diagnostics (exit status,
114
+ `errno`, `stderr`), while startup continues through the compatibility gate. A
115
+ killed probe is signaled only because Elwood aborted it; a probe that exits or
116
+ fails to spawn on its own is not signaled.
117
+
118
+ After spawning the PTY, Elwood waits briefly for immediate process exits or
119
+ known authentication/startup failure banners before reporting the session as
120
+ running. The default wait must be long enough to catch typical local CLI startup
121
+ failures without turning `startClaude` or `startCodex` into a readiness wait for
122
+ the first agent prompt. Authentication banner matching is best-effort and should
123
+ cover the common `not authenticated`, `login required`, `authentication failed`,
124
+ and non-MCP `not logged in` forms, as well as lapsed-session banners that only
125
+ direct the user to re-run `/login` (`Login expired`, `Session expired`,
126
+ `OAuth token revoked`, or `Not logged in`, each paired with a `run /login`
127
+ recovery hint).
128
+
129
+ Once the live resources exist (hook bridge, PTY, terminal, and transcript
130
+ watcher), every remaining startup step runs behind a single cleanup boundary: the
131
+ flush of any transcript diagnostics buffered before the session sink existed
132
+ (emitted as live warnings), PTY-exit registration, the readiness/authentication
133
+ assertion, and the startup-usable evidence. If ANY of them fails, Elwood tears
134
+ down the now-live PTY, hook bridge, terminal, and transcript watcher before
135
+ rejecting, so a failed `startClaude`/`startCodex` never leaks a live process, IPC
136
+ endpoint, or file watcher. (The one-shot version/preflight warning is NOT part of
137
+ this boundary — it is scheduled for delivery AFTER start resolves, per C-API-14.) Tearing down the PTY routes through the SAME one-shot
138
+ process-group reap the normal exit path uses (§9.4, C-LIFE-10): the PTY is
139
+ signaled, its exit is awaited within a bounded window, and the leader's process
140
+ group is SIGKILLed on every path — even if the PTY signal throws — so a
141
+ CLI-spawned descendant such as a hook-bridge grandchild (which POSIX reparents to
142
+ PID 1 the instant the leader exits) cannot survive or reparent past a failed
143
+ startup. The original startup error is preserved; a cleanup or reap failure is
144
+ secondary and never replaces it.
145
+
146
+ ### 9.3 Resume
147
+
148
+ `resumeClaude` loads the Elwood session record and starts a new wrapper around
149
+ the same logical Claude conversation using Claude Code's resume mechanism.
150
+
151
+ Resume must re-establish hook routing, regenerate settings, and re-establish PTY
152
+ control. It does not restore any persisted terminal size (that
153
+ is not persisted, §8.2): the caller passes `initialSize` on resume to set
154
+ geometry, which otherwise falls back to the default. Resume must not require
155
+ callers to know Claude's internal session ID.
156
+ Resume must reject session records owned by another adapter and must fail
157
+ explicitly when the Claude resume id is not available.
158
+ Resume defaults the launch posture (privilege and tool policy) from the persisted
159
+ session record, as specified in §5.2: a bare `resumeClaude` relaunches with the
160
+ same `permissionMode`, `allowedTools`, `disallowedTools`, and `tools` the session
161
+ started with, so tool restrictions cannot silently loosen across a resume.
162
+ Explicit resume options override the persisted posture field by field, and the
163
+ effective posture is re-persisted. Model and caller config overrides remain
164
+ caller-supplied-per-call and are intentionally not persisted yet.
165
+
166
+ `resumeCodex` loads the Elwood session record and starts a new wrapper around the
167
+ same logical Codex conversation using `codex resume <SESSION_ID>` when Elwood has
168
+ observed and persisted Codex's session id. Resume must reject session records
169
+ owned by another adapter and must fail explicitly when the Codex resume id is not
170
+ available.
171
+ Resume defaults the launch posture (sandbox and approval policy) from the
172
+ persisted session record, as specified in §5.2, so a bare `resumeCodex` relaunches
173
+ with the same `sandbox` and `approvalPolicy` the session started with and
174
+ restrictions cannot silently loosen. Explicit resume options override the
175
+ persisted posture field by field, and the effective posture is re-persisted.
176
+ Model and caller config overrides remain caller-supplied-per-call and are
177
+ intentionally not persisted yet.
178
+
179
+ For either adapter, resume validates the loop sidecar before starting the agent,
180
+ silently removes definitions whose seven-day wall-clock expiry passed during
181
+ downtime, and restores surviving definitions with the same IDs and persisted
182
+ jitter. It restores no timer or due state: every surviving cadence starts fresh
183
+ from the resumed session's first readiness, using that launch's current
184
+ permissions and blocking-dialog posture, and no missed run is replayed.
185
+
186
+ ### 9.4 Exit
187
+
188
+ When the agent process exits, Elwood emits terminal/process exit events and
189
+ updates the live session status. It keeps the persisted session record and
190
+ generated files, including loop definitions, unless kill or teardown is
191
+ requested. Any unsubmitted due state is discarded. (Session status is live-only and is
192
+ not written to the record, §8.2.)
193
+
194
+ Reaping the leader's process group is unconditional on every exit path
195
+ (C-LIFE-10). On an unsolicited PTY exit the terminal status is submitted first,
196
+ then the group is reaped in a `finally`, so transcript-drain, warning-emission, or
197
+ status-listener failures can never skip the reap; a reap failure there surfaces as
198
+ a live `reap_failed` warning rather than aborting the exit callback. An explicit
199
+ `stop()`/`kill()` on an already-terminal session performs only the one-shot
200
+ survivor reap (it does not re-signal the dead PTY — node-pty does not replay the
201
+ exit event, and the pid may already be recycled) and rejects with a typed
202
+ `termination_failed` error if that reap fails, leaving the reap retryable by a
203
+ later `teardown()`.
204
+
205
+ Overlapping `stop()`, `kill()`, and `teardown()` calls on one session are
206
+ serialized so the PTY is signaled at most once. The first caller owns the in-flight
207
+ shutdown; a concurrent caller of the same or a lower urgency joins that same
208
+ in-flight operation rather than snapshotting status independently and re-signaling
209
+ a PID that may already have exited and been recycled. A more urgent call (a
210
+ `kill()` during an in-flight `stop()`, or a `teardown()`) escalates by running after
211
+ the in-flight shutdown settles, then performs only the one-shot survivor reap and
212
+ its own extra work (e.g. teardown's file removal) and never issues a second PTY
213
+ signal. Signal ownership is tracked INDEPENDENTLY of lifecycle status: once any
214
+ shutdown has signaled the PTY, no later caller re-signals it — not even when the
215
+ predecessor signaled and reaped but failed before submitting a terminal status, so
216
+ the session is still non-terminal. Such a later caller may still reap, clean up,
217
+ and (for teardown) remove files. A settled shutdown failure is not permanently
218
+ sticky: because signal ownership is separate from the in-flight promise, a later
219
+ `stop()`/`kill()`/`teardown()` after a failed one runs a fresh attempt that RETRIES
220
+ the reap, runtime cleanup, and file removal — without re-signaling the PTY — rather
221
+ than returning the earlier rejection forever (C-LIFE-10 retry posture). Each caller
222
+ still observes its own operation's success or typed failure.
@@ -0,0 +1,55 @@
1
+ ## 10. Error Model
2
+
3
+ Elwood errors exposed to library callers must be typed and stable. Error names
4
+ should be string-literal discriminants.
5
+
6
+ Initial required error names:
7
+
8
+ | Error name | Meaning |
9
+ |---|---|
10
+ | `unsupported_platform` | The current OS is not supported by the implementation. |
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. |
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
+ | `claude_not_authenticated` | Startup output or status indicates Claude is not authenticated. |
15
+ | `claude_version_unsupported` | Installed Claude version lacks required features. |
16
+ | `claude_invalid_reasoning_effort` | `reasoningEffort` was not one of the valid `ClaudeReasoningEffort` values; rejected before spawn. |
17
+ | `claude_high_trust_conflict` | `highTrust: true` was combined with an explicit `permissionMode`; rejected before spawn. |
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. |
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
+ | `codex_not_authenticated` | Startup output or status indicates Codex is not authenticated. |
22
+ | `codex_version_unsupported` | Installed Codex version lacks required features. |
23
+ | `codex_invalid_reasoning_effort` | `reasoningEffort` was not one of the valid `CodexReasoningEffort` values; rejected before spawn (Codex would otherwise fail server-side at the first turn). |
24
+ | `codex_high_trust_conflict` | `highTrust: true` was combined with an explicit `sandbox` or `approvalPolicy`; rejected before spawn. |
25
+ | `state_not_found` | A requested Elwood session record does not exist. |
26
+ | `state_corrupt` | A session record exists but cannot be parsed or validated. |
27
+ | `adapter_mismatch` | A resume request targeted a session record owned by another adapter. |
28
+ | `resume_unavailable` | A resume request cannot be completed from available session metadata. |
29
+ | `pty_start_failed` | PTY or shell startup failed. |
30
+ | `hook_bridge_failed` | The hook bridge or IPC endpoint could not be initialized. |
31
+ | `session_not_running` | Operation requires a running process but the session is stopped. |
32
+ | `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. |
33
+ | `teardown_failed` | Elwood could not remove all owned session files. |
34
+ | `compact_failed` | A requested conversation compaction did not report completion in time. |
35
+ | `interrupt_failed` | A requested turn interrupt did not return the session to ready in time. |
36
+ | `model_automation_failed` | The adapter's model picker could not be recognized or driven to completion. |
37
+ | `login_failed` | The interactive `/login` re-authentication flow reported an explicit failure or an invalid authorization code. |
38
+ | `login_timeout` | The interactive `/login` re-authentication flow did not report success before the timeout. |
39
+ | `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. |
40
+ | `image_attach_failed` | An image could not be confirmed attached: the CLI's `[Image #N]` chip did not appear before the confirmation timeout, or the OS clipboard could not be read/written. 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) |
41
+ | `wait_timeout` | A `waitForStatus`/`waitForActivity` call did not observe its condition before the timeout. |
42
+ | `invalid_loop` | A loop request or recognized `/loop` command violates the documented shape, interval, or UTF-8 message bounds. |
43
+ | `loop_limit_reached` | Creating a loop would exceed 50 unexpired definitions; existing loops are unchanged. |
44
+ | `loop_not_found` | Cancellation targeted an unknown or already-finished loop ID. |
45
+ | `loop_persistence_failed` | A loop-sidecar write required by creation, cancellation, kill, expiry, or teardown did not complete safely. |
46
+ | `loop_submission_failed` | Live loop scheduling or readiness-safe prompt submission failed; details identify only the loop ID. |
47
+
48
+ Hook handler failures are normally surfaced as `hookError` events, not thrown
49
+ from the hook bridge path.
50
+
51
+ Startup errors MUST NOT swallow their underlying cause: `pty_start_failed`,
52
+ `hook_bridge_failed`, and adapter start failures carry the underlying error
53
+ message in `details.cause`, plus `errno`, `syscall`, and `path` fields when
54
+ the underlying error exposes them, so consumers can diagnose environment
55
+ failures without instrumenting Elwood internals.
@@ -0,0 +1,53 @@
1
+ ## 11. Local Test App
2
+
3
+ The repository should include a small local developer test app. It is not the
4
+ product's primary surface, but it is required for manual acceptance testing.
5
+
6
+ The browser dev app should be launched with `npm run dev:web`, but its
7
+ PTY-owning process SHOULD run under Node when using `node-pty`, because the
8
+ native PTY binding is a Node dependency. npm remains the package script runner,
9
+ and Vitest is the default test runner.
10
+
11
+ The repository should also include runnable examples for the public library API.
12
+ Examples that own real PTYs SHOULD be exposed through package scripts that run a
13
+ small Node supervisor, rather than asking developers to invoke
14
+ `node --experimental-strip-types` directly. Example output should demonstrate
15
+ Elwood as a headless library by logging structured events, not by mirroring the
16
+ wrapped agent's raw terminal stream into the caller's shell.
17
+
18
+ The test app must:
19
+
20
+ - start a Claude or Codex session for a selected `cwd`;
21
+ - resume a saved Elwood session ID;
22
+ - render the live PTY session with xterm.js or an equivalent terminal renderer;
23
+ - send prompts, including multi-line prompts;
24
+ - send raw key/input sequences;
25
+ - resize the terminal;
26
+ - show current session status;
27
+ - show a chronological live hook/event log with event name, timestamp, payload
28
+ summary, handler result summary, and whether Claude received no decision,
29
+ allow, deny, block, context, or another response;
30
+ - show rich structured debugger entries for hooks, unified activity events,
31
+ warnings, hook errors, lifecycle status, terminal exits, and startup/runtime
32
+ errors;
33
+ - provide an inspector for each debugger entry that exposes the raw structured
34
+ payload as formatted JSON so developers can validate typed fields without
35
+ reading terminal escape output;
36
+ - visually delineate debugger entries by event kind and severity with compact
37
+ labels, color, timestamps, and searchable/filterable categories;
38
+ - support a manual smoke test where a developer can have a conversation with
39
+ Claude or Codex and visibly confirm hook coverage;
40
+ - clean up its HTTP server, WebSocket server, active Elwood session, and child
41
+ process tree on SIGTERM/SIGHUP and job-control signals such as SIGTTIN. On
42
+ SIGINT/Ctrl-C, it MUST immediately SIGKILL descendant processes and itself
43
+ without waiting for graceful cleanup. The `dev:web` package script should run
44
+ the web server under a small process supervisor so terminal Ctrl-C can kill the
45
+ entire spawned process group even if the app-level handler or an agent child is
46
+ wedged. The web dev app must not read from stdin for shutdown handling because
47
+ terminal reads can suspend the job instead of killing it. When a browser
48
+ session starts or resumes, the PTY mirror should render only raw replayed and
49
+ live `terminal:data` chunks in its visual xterm.js instance so startup TUI
50
+ bytes remain visible without clearing or rewriting the visual terminal from a
51
+ headless snapshot.
52
+
53
+ The test app must not become required for library consumers.
package/prd/12-e2e.md ADDED
@@ -0,0 +1,23 @@
1
+ ## 12. End-To-End Testing
2
+
3
+ The repository should provide `npm run test:e2e` as a separate, opt-in quality
4
+ gate for slow and potentially paid real-agent testing. The e2e suite MUST run
5
+ the public TypeScript library API against real local CLI processes and real
6
+ PTYs, minimizing mocks and seams. It should verify the critical library flows
7
+ for each installed/authenticated supported adapter: start, terminal output,
8
+ raw input, prompt/message submission, hook observation, activity observation,
9
+ resize, stop, resume when the adapter reports a resume id, kill/teardown, and
10
+ Elwood-owned state cleanup.
11
+
12
+ `test:e2e` may skip an adapter when its CLI is not installed or cannot pass a
13
+ basic version/authentication preflight, but it should not use fake PTYs, fake
14
+ hook bridges, or fake agent processes for the adapter flows it does run. Because
15
+ the suite depends on local auth, network, model availability, and user-installed
16
+ CLIs, it is intentionally separate from `npm run check`. E2E coverage should be
17
+ reported separately and made as high as practical; unit/conformance tests remain
18
+ responsible for hard-to-force error paths and 100% default coverage.
19
+
20
+ The repository should also provide `npm run check:all`, an opt-in convenience
21
+ gate that runs the default `npm run check` gate and then `npm run test:e2e`.
22
+ `check:all` does not change the composition of `npm run check`; the default gate
23
+ remains free of real-agent dependencies.