@cluesmith/codev 3.2.4 → 3.3.1

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 (394) hide show
  1. package/dashboard-dist/assets/index-BZRTEMtH.css +32 -0
  2. package/dashboard-dist/assets/{index-BZ1x7x1X.js → index-D3XaKpZW.js} +46 -44
  3. package/dashboard-dist/assets/index-D3XaKpZW.js.map +1 -0
  4. package/dashboard-dist/index.html +2 -2
  5. package/dist/agent-farm/cli.d.ts.map +1 -1
  6. package/dist/agent-farm/cli.js +154 -0
  7. package/dist/agent-farm/cli.js.map +1 -1
  8. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  9. package/dist/agent-farm/commands/cleanup.js +16 -0
  10. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  11. package/dist/agent-farm/commands/inbox.d.ts +42 -0
  12. package/dist/agent-farm/commands/inbox.d.ts.map +1 -0
  13. package/dist/agent-farm/commands/inbox.js +129 -0
  14. package/dist/agent-farm/commands/inbox.js.map +1 -0
  15. package/dist/agent-farm/commands/interrupt.d.ts +20 -0
  16. package/dist/agent-farm/commands/interrupt.d.ts.map +1 -0
  17. package/dist/agent-farm/commands/interrupt.js +65 -0
  18. package/dist/agent-farm/commands/interrupt.js.map +1 -0
  19. package/dist/agent-farm/commands/reset/constants.d.ts +52 -0
  20. package/dist/agent-farm/commands/reset/constants.d.ts.map +1 -0
  21. package/dist/agent-farm/commands/reset/constants.js +52 -0
  22. package/dist/agent-farm/commands/reset/constants.js.map +1 -0
  23. package/dist/agent-farm/commands/reset/context.d.ts +230 -0
  24. package/dist/agent-farm/commands/reset/context.d.ts.map +1 -0
  25. package/dist/agent-farm/commands/reset/context.js +428 -0
  26. package/dist/agent-farm/commands/reset/context.js.map +1 -0
  27. package/dist/agent-farm/commands/reset/index.d.ts +192 -0
  28. package/dist/agent-farm/commands/reset/index.d.ts.map +1 -0
  29. package/dist/agent-farm/commands/reset/index.js +488 -0
  30. package/dist/agent-farm/commands/reset/index.js.map +1 -0
  31. package/dist/agent-farm/commands/reset/receipt.d.ts +97 -0
  32. package/dist/agent-farm/commands/reset/receipt.d.ts.map +1 -0
  33. package/dist/agent-farm/commands/reset/receipt.js +149 -0
  34. package/dist/agent-farm/commands/reset/receipt.js.map +1 -0
  35. package/dist/agent-farm/commands/reset/reorient.d.ts +117 -0
  36. package/dist/agent-farm/commands/reset/reorient.d.ts.map +1 -0
  37. package/dist/agent-farm/commands/reset/reorient.js +313 -0
  38. package/dist/agent-farm/commands/reset/reorient.js.map +1 -0
  39. package/dist/agent-farm/commands/reset.d.ts +34 -0
  40. package/dist/agent-farm/commands/reset.d.ts.map +1 -0
  41. package/dist/agent-farm/commands/reset.js +309 -0
  42. package/dist/agent-farm/commands/reset.js.map +1 -0
  43. package/dist/agent-farm/commands/send.d.ts.map +1 -1
  44. package/dist/agent-farm/commands/send.js +49 -8
  45. package/dist/agent-farm/commands/send.js.map +1 -1
  46. package/dist/agent-farm/commands/spawn-worktree.d.ts +105 -6
  47. package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
  48. package/dist/agent-farm/commands/spawn-worktree.js +289 -66
  49. package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
  50. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  51. package/dist/agent-farm/commands/spawn.js +13 -1
  52. package/dist/agent-farm/commands/spawn.js.map +1 -1
  53. package/dist/agent-farm/commands/status.d.ts.map +1 -1
  54. package/dist/agent-farm/commands/status.js +80 -8
  55. package/dist/agent-farm/commands/status.js.map +1 -1
  56. package/dist/agent-farm/commands/tower.d.ts.map +1 -1
  57. package/dist/agent-farm/commands/tower.js +13 -0
  58. package/dist/agent-farm/commands/tower.js.map +1 -1
  59. package/dist/agent-farm/db/index.d.ts +1 -1
  60. package/dist/agent-farm/db/index.d.ts.map +1 -1
  61. package/dist/agent-farm/db/index.js +80 -1
  62. package/dist/agent-farm/db/index.js.map +1 -1
  63. package/dist/agent-farm/db/mailbox.d.ts +222 -0
  64. package/dist/agent-farm/db/mailbox.d.ts.map +1 -0
  65. package/dist/agent-farm/db/mailbox.js +304 -0
  66. package/dist/agent-farm/db/mailbox.js.map +1 -0
  67. package/dist/agent-farm/db/schema.d.ts +1 -1
  68. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  69. package/dist/agent-farm/db/schema.js +35 -0
  70. package/dist/agent-farm/db/schema.js.map +1 -1
  71. package/dist/agent-farm/db/types.d.ts +45 -0
  72. package/dist/agent-farm/db/types.d.ts.map +1 -1
  73. package/dist/agent-farm/db/types.js.map +1 -1
  74. package/dist/agent-farm/lib/builder-lookup.d.ts +1 -1
  75. package/dist/agent-farm/lib/builder-lookup.js +2 -2
  76. package/dist/agent-farm/lib/builder-lookup.js.map +1 -1
  77. package/dist/agent-farm/lib/reconnect-backoff.d.ts +64 -0
  78. package/dist/agent-farm/lib/reconnect-backoff.d.ts.map +1 -0
  79. package/dist/agent-farm/lib/reconnect-backoff.js +57 -0
  80. package/dist/agent-farm/lib/reconnect-backoff.js.map +1 -0
  81. package/dist/agent-farm/lib/tower-client.d.ts +16 -6
  82. package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
  83. package/dist/agent-farm/lib/tower-client.js +37 -6
  84. package/dist/agent-farm/lib/tower-client.js.map +1 -1
  85. package/dist/agent-farm/lib/tunnel-client.d.ts +69 -1
  86. package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -1
  87. package/dist/agent-farm/lib/tunnel-client.js +225 -30
  88. package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
  89. package/dist/agent-farm/servers/canvas-relay.d.ts +60 -0
  90. package/dist/agent-farm/servers/canvas-relay.d.ts.map +1 -0
  91. package/dist/agent-farm/servers/canvas-relay.js +376 -0
  92. package/dist/agent-farm/servers/canvas-relay.js.map +1 -0
  93. package/dist/agent-farm/servers/cron-delivery.d.ts +72 -0
  94. package/dist/agent-farm/servers/cron-delivery.d.ts.map +1 -0
  95. package/dist/agent-farm/servers/cron-delivery.js +80 -0
  96. package/dist/agent-farm/servers/cron-delivery.js.map +1 -0
  97. package/dist/agent-farm/servers/delayed-send.d.ts +85 -0
  98. package/dist/agent-farm/servers/delayed-send.d.ts.map +1 -0
  99. package/dist/agent-farm/servers/delayed-send.js +165 -0
  100. package/dist/agent-farm/servers/delayed-send.js.map +1 -0
  101. package/dist/agent-farm/servers/gate-profiles.d.ts +67 -0
  102. package/dist/agent-farm/servers/gate-profiles.d.ts.map +1 -0
  103. package/dist/agent-farm/servers/gate-profiles.js +113 -0
  104. package/dist/agent-farm/servers/gate-profiles.js.map +1 -0
  105. package/dist/agent-farm/servers/mailbox-delivery.d.ts +370 -0
  106. package/dist/agent-farm/servers/mailbox-delivery.d.ts.map +1 -0
  107. package/dist/agent-farm/servers/mailbox-delivery.js +617 -0
  108. package/dist/agent-farm/servers/mailbox-delivery.js.map +1 -0
  109. package/dist/agent-farm/servers/mailbox-wiring.d.ts +125 -0
  110. package/dist/agent-farm/servers/mailbox-wiring.d.ts.map +1 -0
  111. package/dist/agent-farm/servers/mailbox-wiring.js +425 -0
  112. package/dist/agent-farm/servers/mailbox-wiring.js.map +1 -0
  113. package/dist/agent-farm/servers/message-write.d.ts +53 -1
  114. package/dist/agent-farm/servers/message-write.d.ts.map +1 -1
  115. package/dist/agent-farm/servers/message-write.js +63 -0
  116. package/dist/agent-farm/servers/message-write.js.map +1 -1
  117. package/dist/agent-farm/servers/overview.d.ts +19 -0
  118. package/dist/agent-farm/servers/overview.d.ts.map +1 -1
  119. package/dist/agent-farm/servers/overview.js +100 -4
  120. package/dist/agent-farm/servers/overview.js.map +1 -1
  121. package/dist/agent-farm/servers/render-gate.d.ts +141 -0
  122. package/dist/agent-farm/servers/render-gate.d.ts.map +1 -0
  123. package/dist/agent-farm/servers/render-gate.js +251 -0
  124. package/dist/agent-farm/servers/render-gate.js.map +1 -0
  125. package/dist/agent-farm/servers/session-submit.d.ts +90 -0
  126. package/dist/agent-farm/servers/session-submit.d.ts.map +1 -0
  127. package/dist/agent-farm/servers/session-submit.js +127 -0
  128. package/dist/agent-farm/servers/session-submit.js.map +1 -0
  129. package/dist/agent-farm/servers/tower-cron.d.ts +10 -7
  130. package/dist/agent-farm/servers/tower-cron.d.ts.map +1 -1
  131. package/dist/agent-farm/servers/tower-cron.js +58 -53
  132. package/dist/agent-farm/servers/tower-cron.js.map +1 -1
  133. package/dist/agent-farm/servers/tower-instances.d.ts +14 -2
  134. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
  135. package/dist/agent-farm/servers/tower-instances.js +78 -16
  136. package/dist/agent-farm/servers/tower-instances.js.map +1 -1
  137. package/dist/agent-farm/servers/tower-messages.d.ts +38 -1
  138. package/dist/agent-farm/servers/tower-messages.d.ts.map +1 -1
  139. package/dist/agent-farm/servers/tower-messages.js +106 -1
  140. package/dist/agent-farm/servers/tower-messages.js.map +1 -1
  141. package/dist/agent-farm/servers/tower-routes.d.ts +16 -4
  142. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  143. package/dist/agent-farm/servers/tower-routes.js +826 -145
  144. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  145. package/dist/agent-farm/servers/tower-server.js +188 -34
  146. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  147. package/dist/agent-farm/servers/tower-terminals.d.ts +23 -2
  148. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
  149. package/dist/agent-farm/servers/tower-terminals.js +134 -127
  150. package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
  151. package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -1
  152. package/dist/agent-farm/servers/tower-tunnel.js +63 -4
  153. package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
  154. package/dist/agent-farm/servers/tower-types.d.ts +2 -1
  155. package/dist/agent-farm/servers/tower-types.d.ts.map +1 -1
  156. package/dist/agent-farm/servers/tower-utils.d.ts +64 -1
  157. package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
  158. package/dist/agent-farm/servers/tower-utils.js +168 -1
  159. package/dist/agent-farm/servers/tower-utils.js.map +1 -1
  160. package/dist/agent-farm/servers/tower-websocket.d.ts +6 -1
  161. package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
  162. package/dist/agent-farm/servers/tower-websocket.js +95 -57
  163. package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
  164. package/dist/agent-farm/servers/write-queue.d.ts +35 -0
  165. package/dist/agent-farm/servers/write-queue.d.ts.map +1 -0
  166. package/dist/agent-farm/servers/write-queue.js +56 -0
  167. package/dist/agent-farm/servers/write-queue.js.map +1 -0
  168. package/dist/agent-farm/types.d.ts +39 -0
  169. package/dist/agent-farm/types.d.ts.map +1 -1
  170. package/dist/agent-farm/utils/agent-names.d.ts +2 -2
  171. package/dist/agent-farm/utils/agent-names.d.ts.map +1 -1
  172. package/dist/agent-farm/utils/agent-names.js +3 -3
  173. package/dist/agent-farm/utils/agent-names.js.map +1 -1
  174. package/dist/agent-farm/utils/architect-name.d.ts +2 -2
  175. package/dist/agent-farm/utils/architect-name.d.ts.map +1 -1
  176. package/dist/agent-farm/utils/architect-name.js +3 -3
  177. package/dist/agent-farm/utils/architect-name.js.map +1 -1
  178. package/dist/agent-farm/utils/config.d.ts +13 -0
  179. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  180. package/dist/agent-farm/utils/config.js +33 -1
  181. package/dist/agent-farm/utils/config.js.map +1 -1
  182. package/dist/agent-farm/utils/harness.d.ts +103 -7
  183. package/dist/agent-farm/utils/harness.d.ts.map +1 -1
  184. package/dist/agent-farm/utils/harness.js +126 -19
  185. package/dist/agent-farm/utils/harness.js.map +1 -1
  186. package/dist/agent-farm/utils/message-format.d.ts +8 -0
  187. package/dist/agent-farm/utils/message-format.d.ts.map +1 -1
  188. package/dist/agent-farm/utils/message-format.js +20 -0
  189. package/dist/agent-farm/utils/message-format.js.map +1 -1
  190. package/dist/agent-farm/utils/server-utils.d.ts +80 -4
  191. package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
  192. package/dist/agent-farm/utils/server-utils.js +286 -5
  193. package/dist/agent-farm/utils/server-utils.js.map +1 -1
  194. package/dist/cli.d.ts.map +1 -1
  195. package/dist/cli.js +6 -32
  196. package/dist/cli.js.map +1 -1
  197. package/dist/commands/consult/cli-options.d.ts +34 -0
  198. package/dist/commands/consult/cli-options.d.ts.map +1 -0
  199. package/dist/commands/consult/cli-options.js +67 -0
  200. package/dist/commands/consult/cli-options.js.map +1 -0
  201. package/dist/commands/consult/index.d.ts +56 -2
  202. package/dist/commands/consult/index.d.ts.map +1 -1
  203. package/dist/commands/consult/index.js +272 -28
  204. package/dist/commands/consult/index.js.map +1 -1
  205. package/dist/commands/consult/metrics.d.ts +42 -0
  206. package/dist/commands/consult/metrics.d.ts.map +1 -1
  207. package/dist/commands/consult/metrics.js +129 -9
  208. package/dist/commands/consult/metrics.js.map +1 -1
  209. package/dist/commands/doctor.d.ts.map +1 -1
  210. package/dist/commands/doctor.js +71 -19
  211. package/dist/commands/doctor.js.map +1 -1
  212. package/dist/commands/porch/checks.d.ts +23 -0
  213. package/dist/commands/porch/checks.d.ts.map +1 -1
  214. package/dist/commands/porch/checks.js +60 -0
  215. package/dist/commands/porch/checks.js.map +1 -1
  216. package/dist/commands/porch/config.d.ts +20 -0
  217. package/dist/commands/porch/config.d.ts.map +1 -1
  218. package/dist/commands/porch/config.js +20 -0
  219. package/dist/commands/porch/config.js.map +1 -1
  220. package/dist/commands/porch/index.js +21 -28
  221. package/dist/commands/porch/index.js.map +1 -1
  222. package/dist/commands/porch/next.d.ts.map +1 -1
  223. package/dist/commands/porch/next.js +2 -41
  224. package/dist/commands/porch/next.js.map +1 -1
  225. package/dist/lib/config.d.ts +69 -3
  226. package/dist/lib/config.d.ts.map +1 -1
  227. package/dist/lib/config.js +67 -3
  228. package/dist/lib/config.js.map +1 -1
  229. package/dist/lib/consult-lanes.d.ts +149 -0
  230. package/dist/lib/consult-lanes.d.ts.map +1 -0
  231. package/dist/lib/consult-lanes.js +360 -0
  232. package/dist/lib/consult-lanes.js.map +1 -0
  233. package/dist/lib/forge-contracts.d.ts +9 -0
  234. package/dist/lib/forge-contracts.d.ts.map +1 -1
  235. package/dist/lib/forge-contracts.js.map +1 -1
  236. package/dist/lib/github.d.ts +15 -1
  237. package/dist/lib/github.d.ts.map +1 -1
  238. package/dist/lib/github.js +18 -1
  239. package/dist/lib/github.js.map +1 -1
  240. package/dist/lib/prompt-behavior-metrics.d.ts +67 -0
  241. package/dist/lib/prompt-behavior-metrics.d.ts.map +1 -0
  242. package/dist/lib/prompt-behavior-metrics.js +290 -0
  243. package/dist/lib/prompt-behavior-metrics.js.map +1 -0
  244. package/dist/lib/skeleton.d.ts +22 -1
  245. package/dist/lib/skeleton.d.ts.map +1 -1
  246. package/dist/lib/skeleton.js +120 -0
  247. package/dist/lib/skeleton.js.map +1 -1
  248. package/dist/lib/test-env.d.ts +74 -0
  249. package/dist/lib/test-env.d.ts.map +1 -0
  250. package/dist/lib/test-env.js +92 -0
  251. package/dist/lib/test-env.js.map +1 -0
  252. package/dist/terminal/attach-replay.d.ts +39 -0
  253. package/dist/terminal/attach-replay.d.ts.map +1 -0
  254. package/dist/terminal/attach-replay.js +76 -0
  255. package/dist/terminal/attach-replay.js.map +1 -0
  256. package/dist/terminal/pty-manager.d.ts +2 -0
  257. package/dist/terminal/pty-manager.d.ts.map +1 -1
  258. package/dist/terminal/pty-manager.js +51 -23
  259. package/dist/terminal/pty-manager.js.map +1 -1
  260. package/dist/terminal/pty-session.d.ts +201 -1
  261. package/dist/terminal/pty-session.d.ts.map +1 -1
  262. package/dist/terminal/pty-session.js +327 -46
  263. package/dist/terminal/pty-session.js.map +1 -1
  264. package/dist/terminal/ring-buffer.d.ts +39 -6
  265. package/dist/terminal/ring-buffer.d.ts.map +1 -1
  266. package/dist/terminal/ring-buffer.js +74 -6
  267. package/dist/terminal/ring-buffer.js.map +1 -1
  268. package/dist/terminal/session-manager.d.ts +53 -0
  269. package/dist/terminal/session-manager.d.ts.map +1 -1
  270. package/dist/terminal/session-manager.js +94 -9
  271. package/dist/terminal/session-manager.js.map +1 -1
  272. package/dist/terminal/session-screen.d.ts +116 -0
  273. package/dist/terminal/session-screen.d.ts.map +1 -0
  274. package/dist/terminal/session-screen.js +180 -0
  275. package/dist/terminal/session-screen.js.map +1 -0
  276. package/dist/terminal/shellper-main.js +2 -1
  277. package/dist/terminal/shellper-main.js.map +1 -1
  278. package/dist/terminal/shellper-process.d.ts +1 -1
  279. package/dist/terminal/shellper-process.d.ts.map +1 -1
  280. package/dist/terminal/shellper-process.js +17 -8
  281. package/dist/terminal/shellper-process.js.map +1 -1
  282. package/dist/terminal/shellper-replay-buffer.d.ts +69 -7
  283. package/dist/terminal/shellper-replay-buffer.d.ts.map +1 -1
  284. package/dist/terminal/shellper-replay-buffer.js +167 -31
  285. package/dist/terminal/shellper-replay-buffer.js.map +1 -1
  286. package/package.json +13 -8
  287. package/scripts/forge/gitea/pr-view.sh +4 -1
  288. package/scripts/forge/github/pr-view.sh +1 -1
  289. package/scripts/forge/gitlab/pr-view.sh +4 -1
  290. package/skeleton/.claude/skills/afx/SKILL.md +68 -1
  291. package/skeleton/.claude/skills/arch-init/SKILL.md +22 -9
  292. package/skeleton/.claude/skills/arch-save/SKILL.md +183 -0
  293. package/skeleton/.claude/skills/codev/SKILL.md +31 -0
  294. package/skeleton/.claude/skills/runnable-worktrees/SKILL.md +119 -0
  295. package/skeleton/.codex/skills/afx/SKILL.md +68 -1
  296. package/skeleton/.codex/skills/arch-init/SKILL.md +22 -9
  297. package/skeleton/.codex/skills/arch-save/SKILL.md +183 -0
  298. package/skeleton/.codex/skills/codev/SKILL.md +31 -0
  299. package/skeleton/.codex/skills/runnable-worktrees/SKILL.md +119 -0
  300. package/skeleton/protocols/air/builder-prompt.md +28 -47
  301. package/skeleton/protocols/air/consult-types/impl-review.md +17 -34
  302. package/skeleton/protocols/air/consult-types/pr-review.md +14 -37
  303. package/skeleton/protocols/air/prompts/implement.md +20 -73
  304. package/skeleton/protocols/air/prompts/pr.md +22 -54
  305. package/skeleton/protocols/air/protocol.md +40 -71
  306. package/skeleton/protocols/aspir/builder-prompt.md +29 -66
  307. package/skeleton/protocols/aspir/consult-types/impl-review.md +17 -44
  308. package/skeleton/protocols/aspir/consult-types/phase-review.md +17 -44
  309. package/skeleton/protocols/aspir/consult-types/plan-review.md +14 -38
  310. package/skeleton/protocols/aspir/consult-types/pr-review.md +13 -39
  311. package/skeleton/protocols/aspir/consult-types/spec-review.md +13 -33
  312. package/skeleton/protocols/aspir/prompts/implement.md +27 -196
  313. package/skeleton/protocols/aspir/prompts/plan.md +21 -85
  314. package/skeleton/protocols/aspir/prompts/review.md +29 -228
  315. package/skeleton/protocols/aspir/prompts/specify.md +25 -111
  316. package/skeleton/protocols/aspir/protocol.json +10 -0
  317. package/skeleton/protocols/aspir/protocol.md +36 -82
  318. package/skeleton/protocols/bugfix/builder-prompt.md +23 -45
  319. package/skeleton/protocols/bugfix/consult-types/impl-review.md +21 -45
  320. package/skeleton/protocols/bugfix/consult-types/pr-review.md +18 -52
  321. package/skeleton/protocols/bugfix/prompts/fix.md +16 -61
  322. package/skeleton/protocols/bugfix/prompts/investigate.md +18 -62
  323. package/skeleton/protocols/bugfix/prompts/pr.md +22 -57
  324. package/skeleton/protocols/bugfix/protocol.md +44 -50
  325. package/skeleton/protocols/experiment/builder-prompt.md +25 -58
  326. package/skeleton/protocols/experiment/protocol.md +22 -188
  327. package/skeleton/protocols/experiment/templates/notes.md +11 -71
  328. package/skeleton/protocols/maintain/builder-prompt.md +24 -45
  329. package/skeleton/protocols/maintain/consult-types/impl-review.md +17 -44
  330. package/skeleton/protocols/maintain/consult-types/pr-review.md +13 -39
  331. package/skeleton/protocols/maintain/prompts/maintain.md +1 -1
  332. package/skeleton/protocols/maintain/protocol.md +32 -266
  333. package/skeleton/protocols/maintain/templates/maintenance-run.md +11 -0
  334. package/skeleton/protocols/pir/builder-prompt.md +31 -64
  335. package/skeleton/protocols/pir/consult-types/impl-review.md +17 -50
  336. package/skeleton/protocols/pir/consult-types/pr-review.md +11 -40
  337. package/skeleton/protocols/pir/prompts/implement.md +2 -3
  338. package/skeleton/protocols/pir/prompts/plan.md +1 -4
  339. package/skeleton/protocols/pir/prompts/review.md +2 -2
  340. package/skeleton/protocols/pir/protocol.md +54 -177
  341. package/skeleton/protocols/research/builder-prompt.md +27 -58
  342. package/skeleton/protocols/research/protocol.md +28 -153
  343. package/skeleton/protocols/spike/builder-prompt.md +30 -48
  344. package/skeleton/protocols/spike/protocol.md +24 -107
  345. package/skeleton/protocols/spike/templates/findings.md +9 -39
  346. package/skeleton/protocols/spir/builder-prompt.md +33 -62
  347. package/skeleton/protocols/spir/consult-types/impl-review.md +17 -44
  348. package/skeleton/protocols/spir/consult-types/phase-review.md +17 -44
  349. package/skeleton/protocols/spir/consult-types/plan-review.md +14 -38
  350. package/skeleton/protocols/spir/consult-types/pr-review.md +13 -39
  351. package/skeleton/protocols/spir/consult-types/spec-review.md +13 -33
  352. package/skeleton/protocols/spir/prompts/implement.md +26 -195
  353. package/skeleton/protocols/spir/prompts/plan.md +20 -84
  354. package/skeleton/protocols/spir/prompts/review.md +28 -227
  355. package/skeleton/protocols/spir/prompts/specify.md +24 -110
  356. package/skeleton/protocols/spir/protocol.json +10 -0
  357. package/skeleton/protocols/spir/protocol.md +84 -633
  358. package/skeleton/protocols/spir/templates/plan.md +28 -147
  359. package/skeleton/protocols/spir/templates/review.md +21 -80
  360. package/skeleton/protocols/spir/templates/spec.md +24 -118
  361. package/skeleton/resources/commands/agent-farm.md +262 -0
  362. package/skeleton/resources/commands/consult.md +236 -8
  363. package/skeleton/resources/commands/overview.md +1 -0
  364. package/skeleton/roles/architect.md +67 -317
  365. package/skeleton/roles/builder.md +76 -191
  366. package/skeleton/templates/AGENTS.md +2 -0
  367. package/skeleton/templates/CLAUDE.md +2 -0
  368. package/templates/3d-viewer.html +32 -4
  369. package/templates/open.html +58 -12
  370. package/templates/tower.html +65 -9
  371. package/templates/vendor/three-3MFLoader.js +1478 -0
  372. package/templates/vendor/three-STLLoader.js +410 -0
  373. package/templates/vendor/three-TrackballControls.js +828 -0
  374. package/templates/vendor/three-fflate.module.js +2474 -0
  375. package/templates/vendor/three.module.js +53044 -0
  376. package/dashboard-dist/assets/index-BZ1x7x1X.js.map +0 -1
  377. package/dashboard-dist/assets/index-DB1KBSNE.css +0 -32
  378. package/dist/agent-farm/servers/send-buffer.d.ts +0 -59
  379. package/dist/agent-farm/servers/send-buffer.d.ts.map +0 -1
  380. package/dist/agent-farm/servers/send-buffer.js +0 -116
  381. package/dist/agent-farm/servers/send-buffer.js.map +0 -1
  382. package/skeleton/porch/prompts/defend.md +0 -108
  383. package/skeleton/porch/prompts/diagnose.md +0 -70
  384. package/skeleton/porch/prompts/evaluate.md +0 -132
  385. package/skeleton/porch/prompts/fix.md +0 -59
  386. package/skeleton/porch/prompts/implement.md +0 -88
  387. package/skeleton/porch/prompts/plan.md +0 -74
  388. package/skeleton/porch/prompts/pr.md +0 -84
  389. package/skeleton/porch/prompts/review.md +0 -249
  390. package/skeleton/porch/prompts/specify.md +0 -53
  391. package/skeleton/porch/prompts/test.md +0 -63
  392. package/skeleton/protocols/aspir/templates/plan.md +0 -184
  393. package/skeleton/protocols/aspir/templates/review.md +0 -120
  394. package/skeleton/protocols/aspir/templates/spec.md +0 -154
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Persistent bounded headless screen (Spec 1313 render-gate round 2).
3
+ *
4
+ * The render gate answers "is this session's composer a clean, empty prompt?" by
5
+ * inspecting a rendered terminal screen. It originally rebuilt that screen on every
6
+ * check by replaying the WHOLE output ring (`ringBuffer.getAll().join('\n')`) through
7
+ * a throwaway `@xterm/headless` Terminal. That worked only while the ring held the
8
+ * whole cumulative stream — but #1205 capped the ring's incomplete-line `partial` at
9
+ * 2 MiB (`trimPartial` halves it to ~1 MiB), and a claude/codex alt-screen frame is
10
+ * exactly one giant newline-free partial. So once a busy long-lived agent's frame
11
+ * crossed the cap, the gate received a TORN front (missing the alt-screen-enter and the
12
+ * composer marker/rule) and classified `no-region-end`/`no-composer-marker` → held the
13
+ * mail PERMANENTLY. That is the over-ceiling delivery outage, resurrected one layer down.
14
+ *
15
+ * The fix is to stop reconstructing the screen from the (now-capped) ring and instead
16
+ * mirror the session's output into ONE long-lived headless Terminal, fed the same bytes
17
+ * the PTY emits, incrementally, from session birth. A terminal emulator is already a
18
+ * BOUNDED screen model (rows × cols + a little scrollback), so:
19
+ * - the ring's partial cap is irrelevant — the screen never needs the whole stream,
20
+ * only the live byte sequence, which it folds into a fixed-size grid;
21
+ * - the LIVE-path tear is gone — a session mirrored from its first byte always shows the
22
+ * real current screen (the adopt/reconnect *seed* is a separate bounded case — see below);
23
+ * - the #1047 unbounded-`partial` OOM risk the old whole-ring render carried is closed
24
+ * (no multi-hundred-MB string is ever allocated to classify);
25
+ * - each classify is O(viewport), not O(ring size) — no per-check whole-render cost,
26
+ * so the cost-aware backstop backoff the whole-render era needed is retired.
27
+ *
28
+ * This wrapper is deliberately gate-agnostic: it only feeds/resizes/reads a screen. The
29
+ * classifier (marker + region + cell scan) lives in `render-gate.ts` and reads the live
30
+ * buffer this hands back via {@link read}. `PtySession` owns one of these and feeds it at
31
+ * its single output chokepoint (`onPtyData`), so on the LIVE path the mirror captures every byte
32
+ * from its first frame. On adopt/reconnect after a Tower restart it is instead seeded from the
33
+ * bounded replay tail (`capRingSeed`, 1 MiB, in `tower-terminals.ts`), so a long-lived alt-screen
34
+ * frame whose coherent start predates that tail can be **born torn** — that classifies not-clean, so
35
+ * the gate HOLDS (fail-safe: mail is delayed, never fused onto a non-empty screen) and self-heals on
36
+ * the agent's next full repaint or a viewer's post-connect resize nudge. This is pre-existing (before
37
+ * round 2 the whole-ring gate classified that same 1 MiB seed) and tracked as a fast-follow, #1361.
38
+ */
39
+ import type { Terminal as HeadlessTerminal } from '@xterm/headless';
40
+ /** The live-buffer read handle the gate classifies (see {@link SessionScreen.read}). */
41
+ export interface ScreenView {
42
+ term: HeadlessTerminal;
43
+ cols: number;
44
+ rows: number;
45
+ }
46
+ export declare class SessionScreen {
47
+ private readonly term;
48
+ private readonly serializer;
49
+ private _cols;
50
+ private _rows;
51
+ private pending;
52
+ private disposed;
53
+ constructor(cols: number, rows: number);
54
+ /**
55
+ * Fold one chunk of PTY output into the screen. Called at the session's single output
56
+ * chokepoint for EVERY byte (live output and the reconnect-replay seed alike), so the
57
+ * mirror stays a faithful copy of what the real terminal shows. Cheap: a terminal
58
+ * emulator parse of the delta, not a whole-history re-render. A no-op after
59
+ * {@link dispose} — a late PTY frame arriving during teardown must not touch a freed term.
60
+ */
61
+ feed(data: string): void;
62
+ /**
63
+ * Resize the mirror to match the live session (Spec 1313: the gate renders at the
64
+ * session's geometry so wrapping reconstructs identically). Kept in lockstep with
65
+ * `PtySession.resize`. A no-op after {@link dispose}.
66
+ */
67
+ resize(cols: number, rows: number): void;
68
+ /**
69
+ * Flush the parser and hand back the live buffer for the gate to read SYNCHRONOUSLY.
70
+ *
71
+ * `await this.pending` drains every byte fed up to this call into the grid, so the returned
72
+ * buffer reflects AT LEAST the output counted by `ringBuffer.bytesWritten` at the moment the
73
+ * caller sampled its change-token (xterm parses writes FIFO but may run ahead into later queued
74
+ * writes, so the buffer can reflect *more* — never less). That lower bound is the property the
75
+ * delivery path's token-before/after TOCTOU relies on: the caller MUST read the returned buffer
76
+ * with no intervening `await` (the classifier is synchronous), so no `feed` can interleave the
77
+ * read; any output that landed during THIS flush already advanced `bytesWritten`, so the caller's
78
+ * post-classify token re-check trips (→ hold) and nothing is delivered onto it.
79
+ *
80
+ * After {@link dispose} the term is freed and its parse callback may never fire, so this returns
81
+ * the current view WITHOUT awaiting `pending` — a disposed screen has no coherent frame, the
82
+ * classifier finds no marker → fail-safe hold, and `PtySession.cleanup` nulls `gateScreen` so the
83
+ * wiring already holds before a read() can reach a disposed mirror in practice.
84
+ */
85
+ read(): Promise<ScreenView>;
86
+ /**
87
+ * Serialize the current screen state (both buffers, colors/attrs, cursor, alt-screen
88
+ * mode, plus up to {@link SCREEN_SCROLLBACK} lines of history) back into a terminal
89
+ * byte stream a client can replay — the O(screen) viewer-attach payload (PIR #1354).
90
+ *
91
+ * SYNCHRONOUS by design: it reads whatever is parsed into the grid right now.
92
+ * Callers wanting a coherent frame must flush first ({@link read}) and must call this
93
+ * with no intervening `await` afterward — the same no-interleave discipline the render
94
+ * gate's classifier relies on. `PtySession.replaySnapshot` owns that protocol.
95
+ *
96
+ * Throws whatever the addon throws; the caller maps failures to the raw-replay
97
+ * fallback. After {@link dispose} the term is freed — return '' rather than touching it
98
+ * (callers treat an empty snapshot for a non-empty session as a fallback signal).
99
+ */
100
+ serialize(): string;
101
+ /**
102
+ * Which buffer the emulated app is currently in. 'alternate' identifies the
103
+ * full-screen-TUI case whose delta resume is unservable from the line-based ring
104
+ * (`RingBuffer.getSince` returns [] for a caught-up client), so the attach path
105
+ * routes it to {@link serialize} instead. Read without flushing: worst case the
106
+ * routing decision lags the last few unparsed bytes, and both routes remain correct
107
+ * (the raw path keeps its client-nudge recovery).
108
+ */
109
+ get bufferType(): 'normal' | 'alternate';
110
+ /** Current mirror geometry (matches the live session). */
111
+ get cols(): number;
112
+ get rows(): number;
113
+ /** Release the headless Terminal. Idempotent; feeds/resizes/reads after it are no-ops. */
114
+ dispose(): void;
115
+ }
116
+ //# sourceMappingURL=session-screen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-screen.d.ts","sourceRoot":"","sources":["../../src/terminal/session-screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAQH,OAAO,KAAK,EAAE,QAAQ,IAAI,gBAAgB,EAAkB,MAAM,iBAAiB,CAAC;AAsBpF,wFAAwF;AACxF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsC;IACjE,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,KAAK,CAAS;IAItB,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,QAAQ,CAAS;gBAEb,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAWtC;;;;;;OAMG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxB;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAOxC;;;;;;;;;;;;;;;;OAgBG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAMjC;;;;;;;;;;;;;OAaG;IACH,SAAS,IAAI,MAAM;IAKnB;;;;;;;OAOG;IACH,IAAI,UAAU,IAAI,QAAQ,GAAG,WAAW,CAEvC;IAED,0DAA0D;IAC1D,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,0FAA0F;IAC1F,OAAO,IAAI,IAAI;CAUhB"}
@@ -0,0 +1,180 @@
1
+ /**
2
+ * Persistent bounded headless screen (Spec 1313 render-gate round 2).
3
+ *
4
+ * The render gate answers "is this session's composer a clean, empty prompt?" by
5
+ * inspecting a rendered terminal screen. It originally rebuilt that screen on every
6
+ * check by replaying the WHOLE output ring (`ringBuffer.getAll().join('\n')`) through
7
+ * a throwaway `@xterm/headless` Terminal. That worked only while the ring held the
8
+ * whole cumulative stream — but #1205 capped the ring's incomplete-line `partial` at
9
+ * 2 MiB (`trimPartial` halves it to ~1 MiB), and a claude/codex alt-screen frame is
10
+ * exactly one giant newline-free partial. So once a busy long-lived agent's frame
11
+ * crossed the cap, the gate received a TORN front (missing the alt-screen-enter and the
12
+ * composer marker/rule) and classified `no-region-end`/`no-composer-marker` → held the
13
+ * mail PERMANENTLY. That is the over-ceiling delivery outage, resurrected one layer down.
14
+ *
15
+ * The fix is to stop reconstructing the screen from the (now-capped) ring and instead
16
+ * mirror the session's output into ONE long-lived headless Terminal, fed the same bytes
17
+ * the PTY emits, incrementally, from session birth. A terminal emulator is already a
18
+ * BOUNDED screen model (rows × cols + a little scrollback), so:
19
+ * - the ring's partial cap is irrelevant — the screen never needs the whole stream,
20
+ * only the live byte sequence, which it folds into a fixed-size grid;
21
+ * - the LIVE-path tear is gone — a session mirrored from its first byte always shows the
22
+ * real current screen (the adopt/reconnect *seed* is a separate bounded case — see below);
23
+ * - the #1047 unbounded-`partial` OOM risk the old whole-ring render carried is closed
24
+ * (no multi-hundred-MB string is ever allocated to classify);
25
+ * - each classify is O(viewport), not O(ring size) — no per-check whole-render cost,
26
+ * so the cost-aware backstop backoff the whole-render era needed is retired.
27
+ *
28
+ * This wrapper is deliberately gate-agnostic: it only feeds/resizes/reads a screen. The
29
+ * classifier (marker + region + cell scan) lives in `render-gate.ts` and reads the live
30
+ * buffer this hands back via {@link read}. `PtySession` owns one of these and feeds it at
31
+ * its single output chokepoint (`onPtyData`), so on the LIVE path the mirror captures every byte
32
+ * from its first frame. On adopt/reconnect after a Tower restart it is instead seeded from the
33
+ * bounded replay tail (`capRingSeed`, 1 MiB, in `tower-terminals.ts`), so a long-lived alt-screen
34
+ * frame whose coherent start predates that tail can be **born torn** — that classifies not-clean, so
35
+ * the gate HOLDS (fail-safe: mail is delayed, never fused onto a non-empty screen) and self-heals on
36
+ * the agent's next full repaint or a viewer's post-connect resize nudge. This is pre-existing (before
37
+ * round 2 the whole-ring gate classified that same 1 MiB seed) and tracked as a fast-follow, #1361.
38
+ */
39
+ // `@xterm/headless` resolves to its CommonJS entry (no `exports` map / `type: module`),
40
+ // and its named exports are not statically analyzable, so a native-node ESM
41
+ // `import { Terminal }` throws "Named export 'Terminal' not found" under the compiled
42
+ // dist (see the identical note in render-gate.ts). Default-import the module object.
43
+ // `@xterm/addon-serialize` ships the same way (same repo and release train).
44
+ import xtermHeadless from '@xterm/headless';
45
+ import xtermSerialize from '@xterm/addon-serialize';
46
+ const { Terminal } = xtermHeadless;
47
+ const { SerializeAddon } = xtermSerialize;
48
+ /**
49
+ * Scrollback retained by the mirror, now serving two consumers (PIR #1354):
50
+ *
51
+ * - The render gate reads ONLY the current viewport (`viewportY … viewportY + rows`),
52
+ * never scrollback, and its verdict is identical for any scrollback ≥ rows (asserted
53
+ * by the production-path tests) — so for the gate this value is a free variable.
54
+ * - {@link SessionScreen.serialize} is the viewer-attach replay payload, and its
55
+ * scrollback IS the history a reconnecting viewer gets back. 1000 matches the ring
56
+ * buffer's default line capacity (`ringBufferLines`), so snapshot replay does not
57
+ * regress history depth versus the raw-ring replay it replaces.
58
+ *
59
+ * Memory: measured ~509 KB per fully-scrolled 200x50 terminal at 1000 lines (~215 KB
60
+ * at the previous 200) — the bounded per-session budget the plan commits to.
61
+ */
62
+ const SCREEN_SCROLLBACK = 1000;
63
+ export class SessionScreen {
64
+ term;
65
+ serializer;
66
+ _cols;
67
+ _rows;
68
+ // Promise of the most recently issued write's parse completion. `@xterm/headless`
69
+ // parses asynchronously and processes writes FIFO, so awaiting the LATEST write's
70
+ // callback guarantees every earlier write is parsed too — the flush {@link read} needs.
71
+ pending = Promise.resolve();
72
+ disposed = false;
73
+ constructor(cols, rows) {
74
+ this._cols = cols;
75
+ this._rows = rows;
76
+ this.term = new Terminal({ cols, rows, allowProposedApi: true, scrollback: SCREEN_SCROLLBACK });
77
+ this.serializer = new SerializeAddon();
78
+ // The addon's typings bind to the full `@xterm/xterm` Terminal; its runtime touches
79
+ // only the buffer/parser surface the headless build shares (proven by the round-trip
80
+ // suite), so the declared-type gap is bridged explicitly here.
81
+ this.term.loadAddon(this.serializer);
82
+ }
83
+ /**
84
+ * Fold one chunk of PTY output into the screen. Called at the session's single output
85
+ * chokepoint for EVERY byte (live output and the reconnect-replay seed alike), so the
86
+ * mirror stays a faithful copy of what the real terminal shows. Cheap: a terminal
87
+ * emulator parse of the delta, not a whole-history re-render. A no-op after
88
+ * {@link dispose} — a late PTY frame arriving during teardown must not touch a freed term.
89
+ */
90
+ feed(data) {
91
+ if (this.disposed)
92
+ return;
93
+ this.pending = new Promise((resolve) => this.term.write(data, () => resolve()));
94
+ }
95
+ /**
96
+ * Resize the mirror to match the live session (Spec 1313: the gate renders at the
97
+ * session's geometry so wrapping reconstructs identically). Kept in lockstep with
98
+ * `PtySession.resize`. A no-op after {@link dispose}.
99
+ */
100
+ resize(cols, rows) {
101
+ if (this.disposed)
102
+ return;
103
+ this._cols = cols;
104
+ this._rows = rows;
105
+ this.term.resize(cols, rows);
106
+ }
107
+ /**
108
+ * Flush the parser and hand back the live buffer for the gate to read SYNCHRONOUSLY.
109
+ *
110
+ * `await this.pending` drains every byte fed up to this call into the grid, so the returned
111
+ * buffer reflects AT LEAST the output counted by `ringBuffer.bytesWritten` at the moment the
112
+ * caller sampled its change-token (xterm parses writes FIFO but may run ahead into later queued
113
+ * writes, so the buffer can reflect *more* — never less). That lower bound is the property the
114
+ * delivery path's token-before/after TOCTOU relies on: the caller MUST read the returned buffer
115
+ * with no intervening `await` (the classifier is synchronous), so no `feed` can interleave the
116
+ * read; any output that landed during THIS flush already advanced `bytesWritten`, so the caller's
117
+ * post-classify token re-check trips (→ hold) and nothing is delivered onto it.
118
+ *
119
+ * After {@link dispose} the term is freed and its parse callback may never fire, so this returns
120
+ * the current view WITHOUT awaiting `pending` — a disposed screen has no coherent frame, the
121
+ * classifier finds no marker → fail-safe hold, and `PtySession.cleanup` nulls `gateScreen` so the
122
+ * wiring already holds before a read() can reach a disposed mirror in practice.
123
+ */
124
+ async read() {
125
+ if (this.disposed)
126
+ return { term: this.term, cols: this._cols, rows: this._rows };
127
+ await this.pending;
128
+ return { term: this.term, cols: this._cols, rows: this._rows };
129
+ }
130
+ /**
131
+ * Serialize the current screen state (both buffers, colors/attrs, cursor, alt-screen
132
+ * mode, plus up to {@link SCREEN_SCROLLBACK} lines of history) back into a terminal
133
+ * byte stream a client can replay — the O(screen) viewer-attach payload (PIR #1354).
134
+ *
135
+ * SYNCHRONOUS by design: it reads whatever is parsed into the grid right now.
136
+ * Callers wanting a coherent frame must flush first ({@link read}) and must call this
137
+ * with no intervening `await` afterward — the same no-interleave discipline the render
138
+ * gate's classifier relies on. `PtySession.replaySnapshot` owns that protocol.
139
+ *
140
+ * Throws whatever the addon throws; the caller maps failures to the raw-replay
141
+ * fallback. After {@link dispose} the term is freed — return '' rather than touching it
142
+ * (callers treat an empty snapshot for a non-empty session as a fallback signal).
143
+ */
144
+ serialize() {
145
+ if (this.disposed)
146
+ return '';
147
+ return this.serializer.serialize({ scrollback: SCREEN_SCROLLBACK });
148
+ }
149
+ /**
150
+ * Which buffer the emulated app is currently in. 'alternate' identifies the
151
+ * full-screen-TUI case whose delta resume is unservable from the line-based ring
152
+ * (`RingBuffer.getSince` returns [] for a caught-up client), so the attach path
153
+ * routes it to {@link serialize} instead. Read without flushing: worst case the
154
+ * routing decision lags the last few unparsed bytes, and both routes remain correct
155
+ * (the raw path keeps its client-nudge recovery).
156
+ */
157
+ get bufferType() {
158
+ return this.term.buffer.active.type;
159
+ }
160
+ /** Current mirror geometry (matches the live session). */
161
+ get cols() {
162
+ return this._cols;
163
+ }
164
+ get rows() {
165
+ return this._rows;
166
+ }
167
+ /** Release the headless Terminal. Idempotent; feeds/resizes/reads after it are no-ops. */
168
+ dispose() {
169
+ if (this.disposed)
170
+ return;
171
+ this.disposed = true;
172
+ this.term.dispose();
173
+ // Settle `pending` so a read() that samples it after dispose resolves immediately rather than
174
+ // awaiting a parse callback the freed term may never fire — otherwise an in-flight classify (and,
175
+ // via the drainer's `ticking` flag, the backstop) could wedge (Claude round-2 CMAP). Belt-and-
176
+ // suspenders with read()'s disposed early-return; not reachable on the pinned @xterm/headless.
177
+ this.pending = Promise.resolve();
178
+ }
179
+ }
180
+ //# sourceMappingURL=session-screen.js.map
@@ -0,0 +1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,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,0FAA0F;IAC1F,OAAO;QACL,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACpB,8FAA8F;QAC9F,kGAAkG;QAClG,+FAA+F;QAC/F,+FAA+F;QAC/F,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;CACF"}
@@ -19,6 +19,7 @@ import fs from 'node:fs';
19
19
  import path from 'node:path';
20
20
  import { createRequire } from 'node:module';
21
21
  import { ShellperProcess } from './shellper-process.js';
22
+ import { REPLAY_BUFFER_MAX_BYTES } from './shellper-replay-buffer.js';
22
23
  // createRequire enables importing native/CJS modules (like node-pty) from ESM.
23
24
  // The package uses "type": "module", so bare `require()` is not available.
24
25
  const require = createRequire(import.meta.url);
@@ -130,7 +131,7 @@ async function main() {
130
131
  catch {
131
132
  // File doesn't exist — fine
132
133
  }
133
- const shellper = new ShellperProcess(createRealPty, config.socketPath, config.replayBufferLines ?? 10_000, logStderr);
134
+ const shellper = new ShellperProcess(createRealPty, config.socketPath, config.replayBufferLines ?? 10_000, logStderr, config.replayBufferBytes ?? REPLAY_BUFFER_MAX_BYTES);
134
135
  logStderr(`Shellper started: pid=${process.pid}, command=${config.command}, socket=${config.socketPath}`);
135
136
  // Start the shellper (spawns PTY and listens on socket)
136
137
  await shellper.start(config.command, config.args, config.cwd, config.env, config.cols, config.rows);
@@ -1 +1 @@
1
- {"version":3,"file":"shellper-main.js","sourceRoot":"","sources":["../../src/terminal/shellper-main.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAA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,EAAE,CAAC,GAAG,EAAE,EAAE;QAC3B,SAAS,CAAC,mBAAmB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,SAAS,CAAC,mBAAmB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -50,7 +50,7 @@ export declare class ShellperProcess extends EventEmitter {
50
50
  private lastDataAt;
51
51
  private exited;
52
52
  private exitInfo;
53
- constructor(ptyFactory: () => IShellperPty, socketPath: string, replayBufferLines?: number, log?: (msg: string) => void);
53
+ constructor(ptyFactory: () => IShellperPty, socketPath: string, replayBufferLines?: number, log?: (msg: string) => void, replayBufferBytes?: number);
54
54
  /**
55
55
  * Start the shellper: spawn the PTY and begin listening on the Unix socket.
56
56
  */
@@ -1 +1 @@
1
- {"version":3,"file":"shellper-process.d.ts","sourceRoot":"","sources":["../../src/terminal/shellper-process.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA0B3C,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IAClE,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;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MAAM,EACX,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC;IAShB,OAAO,CAAC,QAAQ;IAoDhB;;;OAGG;IACH,OAAO,CAAC,SAAS;IA2BjB,OAAO,CAAC,MAAM;IAwBd;;;;OAIG;IACH,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI;IAqD1C,OAAO,CAAC,WAAW;IA0CnB;;;OAGG;IACH,OAAO,CAAC,WAAW;IAqFnB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,YAAY;IAkBpB,OAAO,CAAC,WAAW;IAwBnB,0CAA0C;IAC1C,aAAa,IAAI,MAAM;IAIvB,6CAA6C;IAC7C,YAAY,IAAI,MAAM;IAItB,+BAA+B;IAC/B,MAAM,IAAI,MAAM;IAIhB,4CAA4C;IAC5C,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI;CA4BjB"}
@@ -17,7 +17,7 @@ import fs from 'node:fs';
17
17
  import net from 'node:net';
18
18
  import { EventEmitter } from 'node:events';
19
19
  import { FrameType, PROTOCOL_VERSION, ALLOWED_SIGNALS, REPLAY_PAYLOAD_MAX, createFrameParser, encodeData, encodeWelcome, encodeExit, encodeReplay, encodePong, parseJsonPayload, isKnownFrameType, } from './shellper-protocol.js';
20
- import { ShellperReplayBuffer } from './shellper-replay-buffer.js';
20
+ import { ShellperReplayBuffer, REPLAY_BUFFER_MAX_BYTES } from './shellper-replay-buffer.js';
21
21
  import { DEFAULT_COLS, DEFAULT_ROWS } from './index.js';
22
22
  // --- ShellperProcess ---
23
23
  export class ShellperProcess extends EventEmitter {
@@ -46,12 +46,12 @@ export class ShellperProcess extends EventEmitter {
46
46
  // EXIT broadcast reaches nobody, and the client hangs forever waiting for an
47
47
  // EXIT frame that already went out (Bugfix #905).
48
48
  exitInfo = null;
49
- constructor(ptyFactory, socketPath, replayBufferLines = 10_000, log = () => { }) {
49
+ constructor(ptyFactory, socketPath, replayBufferLines = 10_000, log = () => { }, replayBufferBytes = REPLAY_BUFFER_MAX_BYTES) {
50
50
  super();
51
51
  this.ptyFactory = ptyFactory;
52
52
  this.socketPath = socketPath;
53
53
  this.log = log;
54
- this.replayBuffer = new ShellperReplayBuffer(replayBufferLines);
54
+ this.replayBuffer = new ShellperReplayBuffer(replayBufferLines, replayBufferBytes);
55
55
  }
56
56
  /**
57
57
  * Start the shellper: spawn the PTY and begin listening on the Unix socket.
@@ -295,11 +295,20 @@ export class ShellperProcess extends EventEmitter {
295
295
  // that fit; a tail-trimmed replay can render imperfectly for alt-screen
296
296
  // TUIs (#1047), but the client's post-connect resize nudge repaints,
297
297
  // and a truncated replay beats a dead connection.
298
- let replayData = this.replayBuffer.getReplayData();
299
- if (replayData.length > REPLAY_PAYLOAD_MAX) {
300
- this.log(`Replay ${replayData.length} bytes exceeds cap; sending last ${REPLAY_PAYLOAD_MAX}`);
301
- replayData = replayData.subarray(replayData.length - REPLAY_PAYLOAD_MAX);
302
- }
298
+ //
299
+ // #1205: the cap is passed *into* the buffer rather than applied to its
300
+ // result. This path runs on every connect, so capping afterwards meant
301
+ // allocating a copy of the entire session history first — the multi-GB
302
+ // open-time spike.
303
+ //
304
+ // There is deliberately no post-hoc `length > REPLAY_PAYLOAD_MAX` guard
305
+ // here. Passing the cap in makes one unreachable: getReplayData never
306
+ // returns more than its argument. An earlier revision kept such a guard as
307
+ // "defense in depth" and claimed a test covered it; neither was true, and
308
+ // an unreachable branch that looks load-bearing is worse than none. The
309
+ // invariant is enforced by getReplayData's contract and pinned by the
310
+ // oversized-retention test, which fails if this argument is ever dropped.
311
+ const replayData = this.replayBuffer.getReplayData(REPLAY_PAYLOAD_MAX);
303
312
  // #1198: send REPLAY even when empty, so a client awaiting the frame
304
313
  // resolves immediately instead of burning its timeout. Creation-time
305
314
  // attach awaits the frame to avoid racing early child output into a
@@ -1 +1 @@
1
- {"version":3,"file":"shellper-process.js","sourceRoot":"","sources":["../../src/terminal/shellper-process.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,UAAU,EACV,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GAOjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA8BxD,0BAA0B;AAE1B,MAAM,OAAO,eAAgB,SAAQ,YAAY;IAyB5B;IACA;IAEA;IA3BX,GAAG,GAAwB,IAAI,CAAC;IAChC,MAAM,GAAsB,IAAI,CAAC;IACjC,WAAW,GAAiC,IAAI,GAAG,EAAE,CAAC;IACtD,cAAc,GAAoB,IAAI,GAAG,EAAE,CAAC;IAC5C,gBAAgB,GAAG,CAAC,CAAC;IACrB,YAAY,CAAuB;IACnC,IAAI,GAAG,YAAY,CAAC;IACpB,IAAI,GAAG,YAAY,CAAC;IACpB,SAAS,GAAW,IAAI,CAAC,GAAG,EAAE,CAAC;IACvC,qEAAqE;IACrE,sEAAsE;IACtE,sEAAsE;IACtE,uEAAuE;IACvE,oEAAoE;IAC5D,UAAU,GAAW,IAAI,CAAC,GAAG,EAAE,CAAC;IAChC,MAAM,GAAG,KAAK,CAAC;IACvB,yEAAyE;IACzE,2EAA2E;IAC3E,yEAAyE;IACzE,6EAA6E;IAC7E,kDAAkD;IAC1C,QAAQ,GAAmD,IAAI,CAAC;IAExE,YACmB,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
  * Unlike RingBuffer (which stores lines), this stores raw byte chunks
5
- * to preserve exact terminal output including escape sequences. It tracks
6
- * the total bytes stored and evicts oldest chunks when the limit is exceeded.
5
+ * to preserve exact terminal output including escape sequences. It evicts
6
+ * the oldest chunks when either the line or the byte ceiling is exceeded;
7
+ * both ceilings are needed, because a full-screen TUI emits almost no
8
+ * newlines and so is bounded only by the byte one (#1205).
7
9
  *
8
10
  * This module has NO dependencies beyond Node.js built-ins so the shellper
9
11
  * process doesn't need to pull in the full package dependency tree.
12
+ * (shellper-protocol.ts is a sibling module under the same constraint.)
10
13
  */
14
+ /**
15
+ * Byte ceiling on what this buffer retains (#1205). Until it existed the buffer
16
+ * was bounded only by line count, and a full-screen TUI (which redraws in place
17
+ * and emits almost no newlines) grew it without limit for the life of the
18
+ * session — multi-GB in the field.
19
+ *
20
+ * Derived from REPLAY_PAYLOAD_MAX rather than written as its own literal, and
21
+ * that derivation is the point: every send is capped at REPLAY_PAYLOAD_MAX and
22
+ * ShellperProcess.getReplayData() has no production callers, so it is provably
23
+ * the most that can ever leave the process. Bytes retained above it are
24
+ * unreadable by any consumer and are pure resident cost. Tying the two together
25
+ * keeps that true if the send cap ever moves — retaining more than can be sent
26
+ * would be waste, retaining less would make the send cap unreachable.
27
+ *
28
+ * This is a retention policy, not a wire constraint, which is why it lives here
29
+ * next to the buffer rather than in shellper-protocol.ts.
30
+ */
31
+ export declare const REPLAY_BUFFER_MAX_BYTES: number;
11
32
  export declare class ShellperReplayBuffer {
12
33
  private chunks;
13
34
  private totalBytes;
14
35
  private readonly maxLines;
36
+ private readonly maxBytes;
15
37
  private lineCount;
16
38
  /**
17
39
  * @param maxLines Maximum number of lines to retain. Lines are delimited
18
40
  * by newline characters in the raw data stream.
41
+ * @param maxBytes Maximum bytes to retain. Required because `maxLines` alone
42
+ * does not bound anything for a full-screen TUI: such an app redraws in
43
+ * place via cursor addressing and emits almost no newlines, so the line
44
+ * ceiling never fires and the buffer grows for the life of the session
45
+ * (#1205). Defaults to REPLAY_BUFFER_MAX_BYTES.
19
46
  */
20
- constructor(maxLines?: number);
47
+ constructor(maxLines?: number, maxBytes?: number);
21
48
  /**
22
49
  * Append raw PTY output data to the buffer.
23
- * Evicts oldest chunks if the line count exceeds maxLines.
50
+ * Evicts oldest chunks if either the line or the byte ceiling is exceeded.
24
51
  */
25
52
  append(data: Buffer | string): void;
26
53
  /**
27
- * Get all buffered data as a single concatenated Buffer.
28
- * Used for the REPLAY frame on reconnection.
54
+ * Drop the oldest data until both ceilings are satisfied.
55
+ *
56
+ * Trimming from the front can cut mid-escape-sequence or discard an
57
+ * alt-screen-enter, which is why it was rejected in #1047. It is accepted
58
+ * here because every layer above already does exactly this (the send cap,
59
+ * the ring seed, the frame-skip path) and relies on the client's
60
+ * post-connect repaint nudge; an unbounded buffer, by contrast, killed
61
+ * sessions. Byte-driven cuts are ESC-aligned to narrow the window in which
62
+ * a client renders a truncated sequence as literal text.
63
+ */
64
+ private evict;
65
+ /**
66
+ * Replace the only chunk with a trimmed version of itself.
67
+ *
68
+ * Copies rather than retaining the `subarray` view: a view keeps the entire
69
+ * original allocation alive, so trimming an oversized chunk down to the
70
+ * ceiling would free none of the memory this class exists to bound. The copy
71
+ * is at most `maxBytes` and only happens on the rare path where a single
72
+ * append exceeded a ceiling by itself.
73
+ */
74
+ private replaceSoleChunk;
75
+ /**
76
+ * Get buffered data as a single Buffer, for the REPLAY frame on reconnection.
77
+ *
78
+ * @param maxBytes When given, return at most this many bytes (the most recent
79
+ * ones). The tail is collected by walking `chunks` backwards and slicing
80
+ * only the boundary chunk, so the allocation is O(maxBytes) rather than
81
+ * O(history).
82
+ *
83
+ * That distinction is the whole point (#1205). This runs on *every* client
84
+ * connect, and the caller's cap used to be applied to the result — meaning a
85
+ * multi-GB buffer allocated a multi-GB copy on top of itself at exactly the
86
+ * moment a user opened the terminal, then threw almost all of it away. Peak
87
+ * footprint doubled, and sessions were killed for it. Capping here bounds the
88
+ * spike regardless of how large the buffer has already grown, which also
89
+ * makes this correct for a buffer that accumulated before any byte ceiling
90
+ * existed.
29
91
  */
30
- getReplayData(): Buffer;
92
+ getReplayData(maxBytes?: number): Buffer;
31
93
  /** Current number of bytes stored. */
32
94
  get size(): number;
33
95
  /** Approximate number of lines stored. */
@@ -1 +1 @@
1
- {"version":3,"file":"shellper-replay-buffer.d.ts","sourceRoot":"","sources":["../../src/terminal/shellper-replay-buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,SAAS,CAAK;IAEtB;;;OAGG;gBACS,QAAQ,GAAE,MAAe;IAIrC;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IA0CnC;;;OAGG;IACH,aAAa,IAAI,MAAM;IAMvB,sCAAsC;IACtC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,0CAA0C;IAC1C,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,+BAA+B;IAC/B,KAAK,IAAI,IAAI;CAKd"}
1
+ {"version":3,"file":"shellper-replay-buffer.d.ts","sourceRoot":"","sources":["../../src/terminal/shellper-replay-buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,uBAAuB,QAAqB,CAAC;AAqC1D,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,SAAS,CAAK;IAEtB;;;;;;;;OAQG;gBACS,QAAQ,GAAE,MAAe,EAAE,QAAQ,GAAE,MAAgC;IAKjF;;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