aicodeman 1.41.0 → 1.41.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 (287) hide show
  1. package/README.md +58 -8
  2. package/dist/attachment-registry.d.ts +2 -0
  3. package/dist/attachment-registry.d.ts.map +1 -1
  4. package/dist/attachment-registry.js +14 -3
  5. package/dist/attachment-registry.js.map +1 -1
  6. package/dist/cli-agent.d.ts +2 -0
  7. package/dist/cli-agent.d.ts.map +1 -1
  8. package/dist/cli-agent.js +12 -8
  9. package/dist/cli-agent.js.map +1 -1
  10. package/dist/cli.d.ts +25 -1
  11. package/dist/cli.d.ts.map +1 -1
  12. package/dist/cli.js +97 -11
  13. package/dist/cli.js.map +1 -1
  14. package/dist/config/buffer-limits.d.ts +9 -0
  15. package/dist/config/buffer-limits.d.ts.map +1 -1
  16. package/dist/config/buffer-limits.js +9 -0
  17. package/dist/config/buffer-limits.js.map +1 -1
  18. package/dist/config/cli-registry/schema.d.ts +8 -0
  19. package/dist/config/cli-registry/schema.d.ts.map +1 -1
  20. package/dist/config/cli-registry/schema.js +12 -0
  21. package/dist/config/cli-registry/schema.js.map +1 -1
  22. package/dist/config/cli-registry/stock.d.ts.map +1 -1
  23. package/dist/config/cli-registry/stock.js +42 -0
  24. package/dist/config/cli-registry/stock.js.map +1 -1
  25. package/dist/config/cli-registry/types.d.ts +35 -0
  26. package/dist/config/cli-registry/types.d.ts.map +1 -1
  27. package/dist/folder-listing.d.ts +94 -0
  28. package/dist/folder-listing.d.ts.map +1 -0
  29. package/dist/folder-listing.js +241 -0
  30. package/dist/folder-listing.js.map +1 -0
  31. package/dist/hooks-config.d.ts +36 -16
  32. package/dist/hooks-config.d.ts.map +1 -1
  33. package/dist/hooks-config.js +45 -20
  34. package/dist/hooks-config.js.map +1 -1
  35. package/dist/html-view-capabilities.d.ts +54 -0
  36. package/dist/html-view-capabilities.d.ts.map +1 -0
  37. package/dist/html-view-capabilities.js +103 -0
  38. package/dist/html-view-capabilities.js.map +1 -0
  39. package/dist/mcp-server.d.ts +114 -0
  40. package/dist/mcp-server.d.ts.map +1 -0
  41. package/dist/mcp-server.js +917 -0
  42. package/dist/mcp-server.js.map +1 -0
  43. package/dist/mcp-sync.d.ts +5 -0
  44. package/dist/mcp-sync.d.ts.map +1 -1
  45. package/dist/mcp-sync.js +51 -5
  46. package/dist/mcp-sync.js.map +1 -1
  47. package/dist/mux-interface.d.ts +36 -1
  48. package/dist/mux-interface.d.ts.map +1 -1
  49. package/dist/remote-files.d.ts +37 -0
  50. package/dist/remote-files.d.ts.map +1 -1
  51. package/dist/remote-files.js +103 -0
  52. package/dist/remote-files.js.map +1 -1
  53. package/dist/remote-pane-history.d.ts +103 -0
  54. package/dist/remote-pane-history.d.ts.map +1 -0
  55. package/dist/remote-pane-history.js +258 -0
  56. package/dist/remote-pane-history.js.map +1 -0
  57. package/dist/remote-ssh-limiter.d.ts +16 -3
  58. package/dist/remote-ssh-limiter.d.ts.map +1 -1
  59. package/dist/remote-ssh-limiter.js +37 -6
  60. package/dist/remote-ssh-limiter.js.map +1 -1
  61. package/dist/session.d.ts +29 -1
  62. package/dist/session.d.ts.map +1 -1
  63. package/dist/session.js +53 -0
  64. package/dist/session.js.map +1 -1
  65. package/dist/tab-layout-legacy-order.d.ts.map +1 -1
  66. package/dist/tab-layout-legacy-order.js +72 -13
  67. package/dist/tab-layout-legacy-order.js.map +1 -1
  68. package/dist/tab-layout-service.d.ts +33 -2
  69. package/dist/tab-layout-service.d.ts.map +1 -1
  70. package/dist/tab-layout-service.js +102 -7
  71. package/dist/tab-layout-service.js.map +1 -1
  72. package/dist/tab-layout.d.ts +9 -0
  73. package/dist/tab-layout.d.ts.map +1 -1
  74. package/dist/tab-layout.js +15 -2
  75. package/dist/tab-layout.js.map +1 -1
  76. package/dist/tmux-manager.d.ts +71 -2
  77. package/dist/tmux-manager.d.ts.map +1 -1
  78. package/dist/tmux-manager.js +169 -18
  79. package/dist/tmux-manager.js.map +1 -1
  80. package/dist/types/session.d.ts +53 -0
  81. package/dist/types/session.d.ts.map +1 -1
  82. package/dist/types/session.js.map +1 -1
  83. package/dist/usage-telemetry.d.ts +44 -7
  84. package/dist/usage-telemetry.d.ts.map +1 -1
  85. package/dist/usage-telemetry.js +72 -7
  86. package/dist/usage-telemetry.js.map +1 -1
  87. package/dist/web/approval-inbox.d.ts +12 -0
  88. package/dist/web/approval-inbox.d.ts.map +1 -1
  89. package/dist/web/approval-inbox.js +1 -0
  90. package/dist/web/approval-inbox.js.map +1 -1
  91. package/dist/web/middleware/auth.d.ts.map +1 -1
  92. package/dist/web/middleware/auth.js +33 -0
  93. package/dist/web/middleware/auth.js.map +1 -1
  94. package/dist/web/ports/session-port.d.ts +8 -1
  95. package/dist/web/ports/session-port.d.ts.map +1 -1
  96. package/dist/web/public/admin-ui.js.gz +0 -0
  97. package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
  98. package/dist/web/public/app.24689381.js +43 -0
  99. package/dist/web/public/app.24689381.js.br +0 -0
  100. package/dist/web/public/app.24689381.js.gz +0 -0
  101. package/dist/web/public/approvals-ui.js +4 -0
  102. package/dist/web/public/approvals-ui.js.br +0 -0
  103. package/dist/web/public/approvals-ui.js.gz +0 -0
  104. package/dist/web/public/{constants.bc9c1f63.js → constants.17d77b65.js} +395 -7
  105. package/dist/web/public/constants.17d77b65.js.br +0 -0
  106. package/dist/web/public/constants.17d77b65.js.gz +0 -0
  107. package/dist/web/public/cron-ui.js.gz +0 -0
  108. package/dist/web/public/entrance-animations.js.gz +0 -0
  109. package/dist/web/public/gesture/gesture-codeman.js +112 -6
  110. package/dist/web/public/git-status-ui.js.gz +0 -0
  111. package/dist/web/public/home-sessions.js.gz +0 -0
  112. package/dist/web/public/host-wake-ui.js.gz +0 -0
  113. package/dist/web/public/i18n.9afd8e4d.js +2 -0
  114. package/dist/web/public/i18n.9afd8e4d.js.br +0 -0
  115. package/dist/web/public/i18n.9afd8e4d.js.gz +0 -0
  116. package/dist/web/public/{image-input.e00471c6.js → image-input.9ed1d0d2.js} +186 -16
  117. package/dist/web/public/image-input.9ed1d0d2.js.br +0 -0
  118. package/dist/web/public/image-input.9ed1d0d2.js.gz +0 -0
  119. package/dist/web/public/index.html +105 -23
  120. package/dist/web/public/index.html.br +0 -0
  121. package/dist/web/public/index.html.gz +0 -0
  122. package/dist/web/public/input-cjk.8bc46081.js.gz +0 -0
  123. package/dist/web/public/{keyboard-accessory.c1e7c7b7.js → keyboard-accessory.c458eea8.js} +115 -35
  124. package/dist/web/public/keyboard-accessory.c458eea8.js.br +0 -0
  125. package/dist/web/public/keyboard-accessory.c458eea8.js.gz +0 -0
  126. package/dist/web/public/mobile-handlers.0ef9c311.js.gz +0 -0
  127. package/dist/web/public/mobile-ime-preview.2dbaf262.js.gz +0 -0
  128. package/dist/web/public/mobile-overview.js +11 -2
  129. package/dist/web/public/mobile-overview.js.br +0 -0
  130. package/dist/web/public/mobile-overview.js.gz +0 -0
  131. package/dist/web/public/mobile.2dff1580.css +1 -0
  132. package/dist/web/public/mobile.2dff1580.css.br +0 -0
  133. package/dist/web/public/mobile.2dff1580.css.gz +0 -0
  134. package/dist/web/public/notification-manager.feb82c04.js.gz +0 -0
  135. package/dist/web/public/orchestrator-panel.js.gz +0 -0
  136. package/dist/web/public/{panels-ui.71846fcb.js → panels-ui.73ec0137.js} +87 -87
  137. package/dist/web/public/panels-ui.73ec0137.js.br +0 -0
  138. package/dist/web/public/panels-ui.73ec0137.js.gz +0 -0
  139. package/dist/web/public/ralph-panel.b350e2ef.js.gz +0 -0
  140. package/dist/web/public/ralph-wizard.b6c0dd19.js.gz +0 -0
  141. package/dist/web/public/readmymind-ui.js.gz +0 -0
  142. package/dist/web/public/reboot-restore-ui.js.gz +0 -0
  143. package/dist/web/public/respawn-ui.ff0dae4c.js.gz +0 -0
  144. package/dist/web/public/sanitize-html.e7147e76.js.gz +0 -0
  145. package/dist/web/public/session-lineage.js.gz +0 -0
  146. package/dist/web/public/{session-ui.f731602c.js → session-ui.dbc6819b.js} +33 -33
  147. package/dist/web/public/session-ui.dbc6819b.js.br +0 -0
  148. package/dist/web/public/session-ui.dbc6819b.js.gz +0 -0
  149. package/dist/web/public/{settings-ui.4e33390f.js → settings-ui.81ac264e.js} +9 -9
  150. package/dist/web/public/settings-ui.81ac264e.js.br +0 -0
  151. package/dist/web/public/settings-ui.81ac264e.js.gz +0 -0
  152. package/dist/web/public/spreadsheet-preview-worker.js +11 -0
  153. package/dist/web/public/spreadsheet-preview-worker.js.br +0 -0
  154. package/dist/web/public/spreadsheet-preview-worker.js.gz +0 -0
  155. package/dist/web/public/{spreadsheet-preview.af82fa2f.js → spreadsheet-preview.75c751de.js} +1 -1
  156. package/dist/web/public/spreadsheet-preview.75c751de.js.br +0 -0
  157. package/dist/web/public/spreadsheet-preview.75c751de.js.gz +0 -0
  158. package/dist/web/public/spreadsheet-xlsx-core.js +110 -0
  159. package/dist/web/public/spreadsheet-xlsx-core.js.br +0 -0
  160. package/dist/web/public/spreadsheet-xlsx-core.js.gz +0 -0
  161. package/dist/web/public/styles.900a28e4.css +1 -0
  162. package/dist/web/public/styles.900a28e4.css.br +0 -0
  163. package/dist/web/public/styles.900a28e4.css.gz +0 -0
  164. package/dist/web/public/subagent-windows.07277a58.js.gz +0 -0
  165. package/dist/web/public/sw.js +6 -2
  166. package/dist/web/public/sw.js.br +0 -0
  167. package/dist/web/public/sw.js.gz +0 -0
  168. package/dist/web/public/tab-layout-browser.2d6189f7.js +1 -0
  169. package/dist/web/public/tab-layout-browser.2d6189f7.js.br +0 -0
  170. package/dist/web/public/tab-layout-browser.2d6189f7.js.gz +0 -0
  171. package/dist/web/public/{tab-rail-resize.a5867793.js → tab-rail-resize.7157e0bd.js} +1 -1
  172. package/dist/web/public/tab-rail-resize.7157e0bd.js.br +0 -0
  173. package/dist/web/public/tab-rail-resize.7157e0bd.js.gz +0 -0
  174. package/dist/web/public/terminal-keycode229-recovery.af09f99a.js.gz +0 -0
  175. package/dist/web/public/terminal-split.js.gz +0 -0
  176. package/dist/web/public/terminal-tile.js +44 -24
  177. package/dist/web/public/terminal-tile.js.br +0 -0
  178. package/dist/web/public/terminal-tile.js.gz +0 -0
  179. package/dist/web/public/terminal-ui.858f5da5.js +2 -0
  180. package/dist/web/public/terminal-ui.858f5da5.js.br +0 -0
  181. package/dist/web/public/terminal-ui.858f5da5.js.gz +0 -0
  182. package/dist/web/public/tile-grid.js +439 -18
  183. package/dist/web/public/tile-grid.js.br +0 -0
  184. package/dist/web/public/tile-grid.js.gz +0 -0
  185. package/dist/web/public/ultracode-panel.js.gz +0 -0
  186. package/dist/web/public/ultracode-windows.js.gz +0 -0
  187. package/dist/web/public/vendor/dompurify.min.js.gz +0 -0
  188. package/dist/web/public/vendor/exceljs.min.js.gz +0 -0
  189. package/dist/web/public/vendor/fflate.min.js.gz +0 -0
  190. package/dist/web/public/vendor/marked.min.js.gz +0 -0
  191. package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
  192. package/dist/web/public/vendor/xterm-addon-serialize.min.js.gz +0 -0
  193. package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
  194. package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
  195. package/dist/web/public/vendor/xterm-predictive-echo.ae5e3d5d.js.gz +0 -0
  196. package/dist/web/public/vendor/xterm-zerolag-input.0b69623c.js.gz +0 -0
  197. package/dist/web/public/vendor/xterm.css.gz +0 -0
  198. package/dist/web/public/vendor/xterm.min.js.gz +0 -0
  199. package/dist/web/public/voice-input.2342c37b.js.gz +0 -0
  200. package/dist/web/public/voice-pcm-worklet.js.gz +0 -0
  201. package/dist/web/public/webview-tabs.js +12 -0
  202. package/dist/web/public/webview-tabs.js.br +0 -0
  203. package/dist/web/public/webview-tabs.js.gz +0 -0
  204. package/dist/web/route-helpers.d.ts +8 -0
  205. package/dist/web/route-helpers.d.ts.map +1 -1
  206. package/dist/web/route-helpers.js +8 -0
  207. package/dist/web/route-helpers.js.map +1 -1
  208. package/dist/web/routes/admin-routes.d.ts.map +1 -1
  209. package/dist/web/routes/admin-routes.js +4 -1
  210. package/dist/web/routes/admin-routes.js.map +1 -1
  211. package/dist/web/routes/approval-routes.d.ts.map +1 -1
  212. package/dist/web/routes/approval-routes.js +6 -8
  213. package/dist/web/routes/approval-routes.js.map +1 -1
  214. package/dist/web/routes/case-routes.js +1 -1
  215. package/dist/web/routes/case-routes.js.map +1 -1
  216. package/dist/web/routes/file-routes.d.ts +46 -1
  217. package/dist/web/routes/file-routes.d.ts.map +1 -1
  218. package/dist/web/routes/file-routes.js +214 -27
  219. package/dist/web/routes/file-routes.js.map +1 -1
  220. package/dist/web/routes/hook-event-routes.d.ts.map +1 -1
  221. package/dist/web/routes/hook-event-routes.js +8 -1
  222. package/dist/web/routes/hook-event-routes.js.map +1 -1
  223. package/dist/web/routes/html-view-routes.d.ts +60 -0
  224. package/dist/web/routes/html-view-routes.d.ts.map +1 -0
  225. package/dist/web/routes/html-view-routes.js +288 -0
  226. package/dist/web/routes/html-view-routes.js.map +1 -0
  227. package/dist/web/routes/index.d.ts +1 -0
  228. package/dist/web/routes/index.d.ts.map +1 -1
  229. package/dist/web/routes/index.js +1 -0
  230. package/dist/web/routes/index.js.map +1 -1
  231. package/dist/web/routes/reboot-restore-routes.js +2 -2
  232. package/dist/web/routes/reboot-restore-routes.js.map +1 -1
  233. package/dist/web/routes/session-routes.d.ts +1 -0
  234. package/dist/web/routes/session-routes.d.ts.map +1 -1
  235. package/dist/web/routes/session-routes.js +278 -56
  236. package/dist/web/routes/session-routes.js.map +1 -1
  237. package/dist/web/routes/status-telemetry-routes.d.ts.map +1 -1
  238. package/dist/web/routes/status-telemetry-routes.js +16 -2
  239. package/dist/web/routes/status-telemetry-routes.js.map +1 -1
  240. package/dist/web/schemas.d.ts +29 -0
  241. package/dist/web/schemas.d.ts.map +1 -1
  242. package/dist/web/schemas.js +65 -0
  243. package/dist/web/schemas.js.map +1 -1
  244. package/dist/web/server.d.ts +6 -1
  245. package/dist/web/server.d.ts.map +1 -1
  246. package/dist/web/server.js +62 -14
  247. package/dist/web/server.js.map +1 -1
  248. package/dist/web/sse-events.d.ts +5 -2
  249. package/dist/web/sse-events.d.ts.map +1 -1
  250. package/dist/web/sse-events.js +5 -2
  251. package/dist/web/sse-events.js.map +1 -1
  252. package/package.json +2 -1
  253. package/skills/codeman/SKILL.md +29 -12
  254. package/dist/web/public/app.6f8552e1.js +0 -43
  255. package/dist/web/public/app.6f8552e1.js.br +0 -0
  256. package/dist/web/public/app.6f8552e1.js.gz +0 -0
  257. package/dist/web/public/constants.bc9c1f63.js.br +0 -0
  258. package/dist/web/public/constants.bc9c1f63.js.gz +0 -0
  259. package/dist/web/public/i18n.a9840ea2.js +0 -2
  260. package/dist/web/public/i18n.a9840ea2.js.br +0 -0
  261. package/dist/web/public/i18n.a9840ea2.js.gz +0 -0
  262. package/dist/web/public/image-input.e00471c6.js.br +0 -0
  263. package/dist/web/public/image-input.e00471c6.js.gz +0 -0
  264. package/dist/web/public/keyboard-accessory.c1e7c7b7.js.br +0 -0
  265. package/dist/web/public/keyboard-accessory.c1e7c7b7.js.gz +0 -0
  266. package/dist/web/public/mobile.111b187d.css +0 -1
  267. package/dist/web/public/mobile.111b187d.css.br +0 -0
  268. package/dist/web/public/mobile.111b187d.css.gz +0 -0
  269. package/dist/web/public/panels-ui.71846fcb.js.br +0 -0
  270. package/dist/web/public/panels-ui.71846fcb.js.gz +0 -0
  271. package/dist/web/public/session-ui.f731602c.js.br +0 -0
  272. package/dist/web/public/session-ui.f731602c.js.gz +0 -0
  273. package/dist/web/public/settings-ui.4e33390f.js.br +0 -0
  274. package/dist/web/public/settings-ui.4e33390f.js.gz +0 -0
  275. package/dist/web/public/spreadsheet-preview.af82fa2f.js.br +0 -0
  276. package/dist/web/public/spreadsheet-preview.af82fa2f.js.gz +0 -0
  277. package/dist/web/public/styles.81a72906.css +0 -1
  278. package/dist/web/public/styles.81a72906.css.br +0 -0
  279. package/dist/web/public/styles.81a72906.css.gz +0 -0
  280. package/dist/web/public/tab-layout-browser.065fcba4.js +0 -1
  281. package/dist/web/public/tab-layout-browser.065fcba4.js.br +0 -0
  282. package/dist/web/public/tab-layout-browser.065fcba4.js.gz +0 -0
  283. package/dist/web/public/tab-rail-resize.a5867793.js.br +0 -0
  284. package/dist/web/public/tab-rail-resize.a5867793.js.gz +0 -0
  285. package/dist/web/public/terminal-ui.b7267005.js +0 -2
  286. package/dist/web/public/terminal-ui.b7267005.js.br +0 -0
  287. package/dist/web/public/terminal-ui.b7267005.js.gz +0 -0
@@ -140,18 +140,67 @@ export declare function resolveActivePaneTarget(output: string): string | null;
140
140
  * intentional in-line column reset / overwrite) untouched.
141
141
  */
142
142
  export declare function normalizeScrollbackEol(buffer: string): string;
143
+ /**
144
+ * Where a later frame of the same pane begins among the rows of an earlier
145
+ * screen capture, or -1 when that cannot be told.
146
+ *
147
+ * The frame's top rows must equal the screen's rows from that index on, as
148
+ * text. Two rows are left out of the comparison: the screen's trailing blank
149
+ * rows (output after the screen read fills them in the frame) and its last
150
+ * content row (output in flight may have finished it since). Every compared
151
+ * row must match, the overlap must reach FRAME_MATCH_MIN_ROWS rows with
152
+ * FRAME_MATCH_MIN_CONTENT_ROWS of them non-blank, and the SMALLEST index wins,
153
+ * so a block that merely repeats further down is only chosen when nothing
154
+ * above it matches. A row that changed between the two reads (a spinner, a
155
+ * clock) fails the true placement; the minimum keeps a lower one from being
156
+ * taken on a row or two that happen to be equal.
157
+ *
158
+ * An agent TUI mid-turn (Claude Code, codex, opencode) is not placed: it keeps
159
+ * a live region (spinner, composer, footer) pinned to the bottom and inserts new
160
+ * rows above it, so the frame is not a shifted copy of the screen and the
161
+ * comparison down to the screen's last content row fails. The caller then falls
162
+ * back to the plain join. A plain shell places, unless the frame starts on the
163
+ * second half of a wrapped line: -J holds that line as one screen row, so it
164
+ * matches nothing and the plain join applies too.
165
+ */
166
+ export declare function findFrameInScreen(screenRows: string[], frameRows: string[]): number;
167
+ /**
168
+ * Put scrollback rows read elsewhere (`PaneCaptureOptions.scrollbackOverride`)
169
+ * above a visible-frame capture, as one capture in tmux's own shape: rows joined
170
+ * by a bare `\n`. Undefined or empty scrollback leaves the frame as it is.
171
+ *
172
+ * `screen` is that other pane's screen, read right after its scrollback. The
173
+ * frame is captured later, so rows can have scrolled out of it in between, and
174
+ * a frame showing part of a taller screen starts below that screen's top.
175
+ * Either way the screen rows above the frame's first row are in neither the
176
+ * scrollback nor the frame, so they go between the two. When the frame cannot
177
+ * be placed in the screen ({@link findFrameInScreen}), the join is the plain
178
+ * scrollback-over-frame one.
179
+ */
180
+ export declare function joinScrollbackAndFrame(scrollback: string | undefined, frame: string, screen?: string): string;
143
181
  /** Pane geometry and caret position, as `display-message` reports them. */
144
182
  interface PaneCursorGeometry {
145
183
  cols: number;
146
184
  rows: number;
147
185
  cursorX: number;
148
186
  cursorY: number;
187
+ /**
188
+ * `#{history_size}`: rows tmux holds ABOVE the visible frame, i.e. what a
189
+ * full-history capture can add. Absent when the query did not return it.
190
+ * Optional and validated on its own, so a bad value never voids the caret.
191
+ */
192
+ historyLines?: number;
193
+ /** Whether the pane is in the alternate screen (`#{alternate_on}`), when tmux reported it. */
194
+ alternateOn?: boolean;
149
195
  }
150
196
  /**
151
197
  * Read the pane's cursor and size, or null when tmux cannot say.
152
198
  *
153
- * Every field is validated together: a caller that gets a value back can place
154
- * a caret with it, and one that gets null must not try.
199
+ * The four geometry fields are validated together: a caller that gets a value
200
+ * back can place a caret with it, and one that gets null must not try. The
201
+ * optional fifth and sixth fields, the history depth and the alternate-screen
202
+ * flag, are only informational, so a bad one is dropped rather than
203
+ * discarding a good caret.
155
204
  */
156
205
  export declare function queryPaneCursor(run: () => string): PaneCursorGeometry | null;
157
206
  /** Whether a capture holds anything a reader would see, styles discounted. */
@@ -228,6 +277,16 @@ export declare function buildSpawnCommand(options: {
228
277
  * to the dedicated-socket suspenders above).
229
278
  */
230
279
  export declare function remoteTmuxSessionName(sessionId: string): string;
280
+ /**
281
+ * The remote tmux socket and session a remote Codeman session's pane is attached
282
+ * to, matching the command that attached it: an owned session is the one
283
+ * `buildRemoteLaunchCommand` created on the private socket, a non-owned one is the
284
+ * discovered session `buildRemoteAttachCommand` joined on `-L codeman`.
285
+ */
286
+ export declare function remoteTmuxLocation(remote: SessionRemote, sessionId: string): {
287
+ socket: string;
288
+ sessionName: string;
289
+ };
231
290
  /**
232
291
  * COD-104 — build the SSH command that launches (or reattaches) a remote
233
292
  * session INSIDE a tmux server on the remote host, so the remote agent survives
@@ -496,6 +555,16 @@ export declare class TmuxManager extends EventEmitter implements TerminalMultipl
496
555
  * that each had to be remembered at two separate call sites.
497
556
  */
498
557
  private _configureCliEnv;
558
+ /**
559
+ * The statusLine exporter for one claude launch, and why it is missing when it is.
560
+ * Registry-gated (capabilities.statusLineTelemetry, claude only today), local spawns
561
+ * only (remote/docker have their own separate command builders). Resolving still runs
562
+ * with collection off, because it also self-heals: it strips any legacy disk-written
563
+ * exporter from an older Codeman build the first time a session starts in that
564
+ * workspace again. `state` lands on the mux record so the Status row can
565
+ * say why no cache report will come, instead of "not reported yet" forever.
566
+ */
567
+ private _resolveStatusLine;
499
568
  /**
500
569
  * Export the user's own REAL statusLine command (found by
501
570
  * findEffectiveUserStatusLineCommand) via tmux setenv, so the shared
@@ -1 +1 @@
1
- {"version":3,"file":"tmux-manager.d.ts","sourceRoot":"","sources":["../src/tmux-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAiB3C,OAAO,EACL,YAAY,EACZ,sBAAsB,EAGtB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,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C,OAAO,CAAC;IAUtD;;;OAGG;IACG,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAiCrD;;;OAGG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IA+C5E;;;;;;;;;;;;;;;;;;OAkBG;IACH;;;;;;;OAOG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAgBpE,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,MAAM,GAAG,IAAI;IAgHjG;;;;;OAKG;IACH,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,MAAM,GAAG,IAAI;IAoBlF;;;OAGG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IA6B/E;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAyB1D,gBAAgB,IAAI,MAAM;IAI1B,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE;IAIxC,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAkB7C,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO;IAyBlE,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,MAAM,CAAC,eAAe,IAAI,OAAO;CAQlC"}
@@ -534,11 +534,111 @@ function truncatePaneLineByVisibleColumns(line, maxColumns) {
534
534
  export function normalizeScrollbackEol(buffer) {
535
535
  return buffer.replace(/\r?\n/g, '\r\n');
536
536
  }
537
+ /** `capture-pane -p` text as rows: tmux ends it with one `\n`, and '' has none. */
538
+ function captureRows(text) {
539
+ return text === '' ? [] : text.replace(/\n$/, '').split('\n');
540
+ }
541
+ /**
542
+ * Least overlap that places a frame in a screen: rows compared, and how many
543
+ * of them hold text. A placement too LOW repeats the rows between the true one
544
+ * and it, so a short overlap (one `$` or `❯` row, a rule line) is not trusted:
545
+ * past this, the plain join, which can only lose rows, is the safer answer.
546
+ */
547
+ const FRAME_MATCH_MIN_ROWS = 3;
548
+ const FRAME_MATCH_MIN_CONTENT_ROWS = 2;
549
+ /**
550
+ * A captured row as plain text: escape sequences (SGR, OSC 8 links) and
551
+ * trailing blanks dropped. Two tmuxes render the same cell content, but need
552
+ * not encode its attributes the same way.
553
+ */
554
+ function capturedRowText(row) {
555
+ // eslint-disable-next-line no-control-regex
556
+ return row.replace(/\x1b\[[0-?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[@-_]/g, '').trimEnd();
557
+ }
558
+ /**
559
+ * Where a later frame of the same pane begins among the rows of an earlier
560
+ * screen capture, or -1 when that cannot be told.
561
+ *
562
+ * The frame's top rows must equal the screen's rows from that index on, as
563
+ * text. Two rows are left out of the comparison: the screen's trailing blank
564
+ * rows (output after the screen read fills them in the frame) and its last
565
+ * content row (output in flight may have finished it since). Every compared
566
+ * row must match, the overlap must reach FRAME_MATCH_MIN_ROWS rows with
567
+ * FRAME_MATCH_MIN_CONTENT_ROWS of them non-blank, and the SMALLEST index wins,
568
+ * so a block that merely repeats further down is only chosen when nothing
569
+ * above it matches. A row that changed between the two reads (a spinner, a
570
+ * clock) fails the true placement; the minimum keeps a lower one from being
571
+ * taken on a row or two that happen to be equal.
572
+ *
573
+ * An agent TUI mid-turn (Claude Code, codex, opencode) is not placed: it keeps
574
+ * a live region (spinner, composer, footer) pinned to the bottom and inserts new
575
+ * rows above it, so the frame is not a shifted copy of the screen and the
576
+ * comparison down to the screen's last content row fails. The caller then falls
577
+ * back to the plain join. A plain shell places, unless the frame starts on the
578
+ * second half of a wrapped line: -J holds that line as one screen row, so it
579
+ * matches nothing and the plain join applies too.
580
+ */
581
+ export function findFrameInScreen(screenRows, frameRows) {
582
+ const screen = screenRows.map(capturedRowText);
583
+ const frame = frameRows.map(capturedRowText);
584
+ let lastContent = screen.length - 1;
585
+ while (lastContent >= 0 && screen[lastContent] === '')
586
+ lastContent--;
587
+ for (let start = 0; start < lastContent; start++) {
588
+ const overlap = Math.min(lastContent - start, frame.length);
589
+ if (overlap < FRAME_MATCH_MIN_ROWS)
590
+ break; // only shrinks from here on
591
+ let matches = true;
592
+ let contentRows = 0;
593
+ for (let k = 0; k < overlap && matches; k++) {
594
+ if (screen[start + k] !== frame[k])
595
+ matches = false;
596
+ else if (frame[k] !== '')
597
+ contentRows++;
598
+ }
599
+ if (matches && contentRows >= FRAME_MATCH_MIN_CONTENT_ROWS)
600
+ return start;
601
+ }
602
+ return -1;
603
+ }
604
+ /**
605
+ * Put scrollback rows read elsewhere (`PaneCaptureOptions.scrollbackOverride`)
606
+ * above a visible-frame capture, as one capture in tmux's own shape: rows joined
607
+ * by a bare `\n`. Undefined or empty scrollback leaves the frame as it is.
608
+ *
609
+ * `screen` is that other pane's screen, read right after its scrollback. The
610
+ * frame is captured later, so rows can have scrolled out of it in between, and
611
+ * a frame showing part of a taller screen starts below that screen's top.
612
+ * Either way the screen rows above the frame's first row are in neither the
613
+ * scrollback nor the frame, so they go between the two. When the frame cannot
614
+ * be placed in the screen ({@link findFrameInScreen}), the join is the plain
615
+ * scrollback-over-frame one.
616
+ */
617
+ export function joinScrollbackAndFrame(scrollback, frame, screen) {
618
+ let above = scrollback ? captureRows(scrollback) : [];
619
+ if (screen) {
620
+ const screenRows = captureRows(screen);
621
+ const frameStart = findFrameInScreen(screenRows, captureRows(frame));
622
+ if (frameStart > 0) {
623
+ // The remote screen is a capture of its own too, encoded from the default
624
+ // state: the history's last row must not leave its attributes active.
625
+ if (above.length > 0)
626
+ above[above.length - 1] += '\x1b[0m';
627
+ above = above.concat(screenRows.slice(0, frameStart));
628
+ }
629
+ }
630
+ // Separate captures: tmux encodes the frame relative to the DEFAULT state, so
631
+ // the rows above it must not leave their attributes active.
632
+ return above.length > 0 ? `${above.join('\n')}\x1b[0m\n${frame}` : frame;
633
+ }
537
634
  /**
538
635
  * Read the pane's cursor and size, or null when tmux cannot say.
539
636
  *
540
- * Every field is validated together: a caller that gets a value back can place
541
- * a caret with it, and one that gets null must not try.
637
+ * The four geometry fields are validated together: a caller that gets a value
638
+ * back can place a caret with it, and one that gets null must not try. The
639
+ * optional fifth and sixth fields, the history depth and the alternate-screen
640
+ * flag, are only informational, so a bad one is dropped rather than
641
+ * discarding a good caret.
542
642
  */
543
643
  export function queryPaneCursor(run) {
544
644
  let raw;
@@ -549,7 +649,9 @@ export function queryPaneCursor(run) {
549
649
  console.error('[TmuxManager] Failed to query pane cursor after capture:', cursorErr);
550
650
  return null;
551
651
  }
552
- const [cursorX, cursorY, cols, rows] = raw.split(/\s+/).map((value) => parseInt(value, 10));
652
+ const [cursorX, cursorY, cols, rows, historyLines, alternateOn] = raw
653
+ .split(/\s+/)
654
+ .map((value) => parseInt(value, 10));
553
655
  if (!Number.isFinite(cursorX) ||
554
656
  !Number.isFinite(cursorY) ||
555
657
  !Number.isFinite(cols) ||
@@ -560,7 +662,12 @@ export function queryPaneCursor(run) {
560
662
  rows <= 0) {
561
663
  return null;
562
664
  }
563
- return { cols, rows, cursorX, cursorY };
665
+ const geometry = { cols, rows, cursorX, cursorY };
666
+ if (Number.isFinite(historyLines) && historyLines >= 0)
667
+ geometry.historyLines = historyLines;
668
+ if (alternateOn === 0 || alternateOn === 1)
669
+ geometry.alternateOn = alternateOn === 1;
670
+ return geometry;
564
671
  }
565
672
  /** SGR attributes, which is all `capture-pane -e` emits. */
566
673
  // eslint-disable-next-line no-control-regex
@@ -746,6 +853,18 @@ const REMOTE_TMUX_SOCKET = 'codeman-remote';
746
853
  export function remoteTmuxSessionName(sessionId) {
747
854
  return `codeman-ssh-${sessionId.slice(0, 8)}`;
748
855
  }
856
+ /**
857
+ * The remote tmux socket and session a remote Codeman session's pane is attached
858
+ * to, matching the command that attached it: an owned session is the one
859
+ * `buildRemoteLaunchCommand` created on the private socket, a non-owned one is the
860
+ * discovered session `buildRemoteAttachCommand` joined on `-L codeman`.
861
+ */
862
+ export function remoteTmuxLocation(remote, sessionId) {
863
+ if (remote.owned === false) {
864
+ return { socket: 'codeman', sessionName: remote.remoteSessionName || remoteTmuxSessionName(sessionId) };
865
+ }
866
+ return { socket: REMOTE_TMUX_SOCKET, sessionName: remoteTmuxSessionName(sessionId) };
867
+ }
749
868
  /**
750
869
  * COD-104 — build the SSH command that launches (or reattaches) a remote
751
870
  * session INSIDE a tmux server on the remote host, so the remote agent survives
@@ -1733,6 +1852,24 @@ export class TmuxManager extends EventEmitter {
1733
1852
  }
1734
1853
  }
1735
1854
  }
1855
+ /**
1856
+ * The statusLine exporter for one claude launch, and why it is missing when it is.
1857
+ * Registry-gated (capabilities.statusLineTelemetry, claude only today), local spawns
1858
+ * only (remote/docker have their own separate command builders). Resolving still runs
1859
+ * with collection off, because it also self-heals: it strips any legacy disk-written
1860
+ * exporter from an older Codeman build the first time a session starts in that
1861
+ * workspace again. `state` lands on the mux record so the Status row can
1862
+ * say why no cache report will come, instead of "not reported yet" forever.
1863
+ */
1864
+ async _resolveStatusLine(mode, workingDir, remoteOrDocker) {
1865
+ if (!getCli(mode)?.capabilities.statusLineTelemetry)
1866
+ return {};
1867
+ if (remoteOrDocker)
1868
+ return { state: 'remote' };
1869
+ const enabled = await readPlanUsageTelemetryEnabled();
1870
+ const command = await resolveStatusLineCliCommand(workingDir, enabled);
1871
+ return { command, state: command ? 'injected' : enabled ? 'workspace-statusline' : 'collection-off' };
1872
+ }
1736
1873
  /**
1737
1874
  * Export the user's own REAL statusLine command (found by
1738
1875
  * findEffectiveUserStatusLineCommand) via tmux setenv, so the shared
@@ -1820,13 +1957,7 @@ export class TmuxManager extends EventEmitter {
1820
1957
  throw new Error(message);
1821
1958
  }
1822
1959
  const envExportsStr = this.buildEnvExports(sessionId, muxName, mode).join(' && ');
1823
- // Registry-gated (capabilities.statusLineTelemetry — claude only today), local
1824
- // spawns only (remote/docker have their own separate command builders — out of
1825
- // scope here). Also self-heals: strips any legacy disk-written exporter from an
1826
- // older Codeman build the first time a session starts in that workspace again.
1827
- const statusLineCommand = getCli(mode)?.capabilities.statusLineTelemetry && !remote && !docker
1828
- ? await resolveStatusLineCliCommand(workingDir, await readPlanUsageTelemetryEnabled())
1829
- : undefined;
1960
+ const { command: statusLineCommand, state: statusLine } = await this._resolveStatusLine(mode, workingDir, !!(remote || docker));
1830
1961
  // The user's own REAL statusLine, if any (walked via Claude Code's own
1831
1962
  // settings precedence) — exported below so the shared exporter script
1832
1963
  // can wrap it. Only worth discovering when we're actually injecting.
@@ -1966,6 +2097,7 @@ export class TmuxManager extends EventEmitter {
1966
2097
  mode,
1967
2098
  attached: false,
1968
2099
  name,
2100
+ statusLine,
1969
2101
  };
1970
2102
  this.sessions.set(sessionId, session);
1971
2103
  this.saveSessions();
@@ -2063,10 +2195,7 @@ export class TmuxManager extends EventEmitter {
2063
2195
  // Resolve CLI binary directory based on mode
2064
2196
  const { pathExport } = this.buildPathExport(mode);
2065
2197
  const envExportsStr = this.buildEnvExports(sessionId, muxName, mode).join(' && ');
2066
- // See createSession()'s identical resolution for rationale.
2067
- const statusLineCommand = getCli(mode)?.capabilities.statusLineTelemetry && !remote && !docker
2068
- ? await resolveStatusLineCliCommand(workingDir, await readPlanUsageTelemetryEnabled())
2069
- : undefined;
2198
+ const { command: statusLineCommand, state: statusLine } = await this._resolveStatusLine(mode, workingDir, !!(remote || docker));
2070
2199
  const userStatusLineCommand = statusLineCommand ? await findEffectiveUserStatusLineCommand(workingDir) : undefined;
2071
2200
  const baseCmd = buildSpawnCommand({
2072
2201
  mode,
@@ -2118,6 +2247,10 @@ export class TmuxManager extends EventEmitter {
2118
2247
  const pid = this.getPanePid(muxName);
2119
2248
  if (pid)
2120
2249
  session.pid = pid;
2250
+ if (session.statusLine !== statusLine) {
2251
+ session.statusLine = statusLine;
2252
+ this.saveSessions();
2253
+ }
2121
2254
  return pid;
2122
2255
  }
2123
2256
  catch (err) {
@@ -3397,7 +3530,14 @@ export class TmuxManager extends EventEmitter {
3397
3530
  const historyLines = typeof requestedLines === 'number' && Number.isFinite(requestedLines) && requestedLines > 0
3398
3531
  ? Math.trunc(requestedLines)
3399
3532
  : DEFAULT_TMUX_HISTORY_LIMIT;
3400
- const captureFlags = fullHistory ? `capture-pane -p -e -J -S -${historyLines}` : 'capture-pane -p -e';
3533
+ // With a scrollback override this pane's own history is not read at all:
3534
+ // `-S 0` starts at the top of the visible frame.
3535
+ const scrollbackOverride = fullHistory ? opts?.scrollbackOverride : undefined;
3536
+ const captureFlags = !fullHistory
3537
+ ? 'capture-pane -p -e'
3538
+ : scrollbackOverride !== undefined
3539
+ ? 'capture-pane -p -e -J -S 0'
3540
+ : `capture-pane -p -e -J -S -${historyLines}`;
3401
3541
  // execSync's default maxBuffer (1MB) kills multi-MB scrollback dumps
3402
3542
  // (ENOBUFS) and would silently degrade full-history capture to the byte
3403
3543
  // buffer for exactly the long sessions it exists for — size it from the
@@ -3410,12 +3550,12 @@ export class TmuxManager extends EventEmitter {
3410
3550
  execOpts.maxBuffer =
3411
3551
  (opts?.maxCaptureBytes ?? DEFAULT_TERMINAL_BUFFER_MAX_BYTES) + FULL_HISTORY_CAPTURE_SLACK_BYTES;
3412
3552
  }
3413
- const rawCapture = execSync(`${this.tmux()} ${captureFlags} -t ${shellescape(target)}`, execOpts);
3553
+ const rawCapture = joinScrollbackAndFrame(scrollbackOverride, execSync(`${this.tmux()} ${captureFlags} -t ${shellescape(target)}`, execOpts), scrollbackOverride !== undefined ? opts?.scrollbackOverrideScreen : undefined);
3414
3554
  // Query the cursor BEFORE deciding anything else. On the full-history path
3415
3555
  // it settles both how the capture is trimmed and whether a cursor move is
3416
3556
  // appended, and those two have to agree: trailing blank rows are only safe
3417
3557
  // to keep when a move follows to put the caret back above them.
3418
- const geometry = queryPaneCursor(() => execSync(`${this.tmux()} display-message -p -t ${shellescape(target)} '#{cursor_x} #{cursor_y} #{pane_width} #{pane_height}'`, { encoding: 'utf-8', timeout: EXEC_TIMEOUT_MS }));
3558
+ const geometry = queryPaneCursor(() => execSync(`${this.tmux()} display-message -p -t ${shellescape(target)} '#{cursor_x} #{cursor_y} #{pane_width} #{pane_height} #{history_size} #{alternate_on}'`, { encoding: 'utf-8', timeout: EXEC_TIMEOUT_MS }));
3419
3559
  // Report the size the pane was really drawing at. The visible-frame path
3420
3560
  // below addresses every row absolutely, so a consumer whose terminal is
3421
3561
  // shorter than this piles the overflow rows onto its last line and loses
@@ -3425,6 +3565,17 @@ export class TmuxManager extends EventEmitter {
3425
3565
  // the caller can see both sizes, so hand it this one.
3426
3566
  if (opts && geometry)
3427
3567
  opts.capturedGeometry = { cols: geometry.cols, rows: geometry.rows };
3568
+ // Same query, no extra tmux call: how much scrollback a full-history pull
3569
+ // could return. A pane in the alternate screen (fullscreen claude) holds
3570
+ // none, and the partial-history notice must not promise it. A caller that
3571
+ // bounded the capture with `historyLimitLines` also reads it to tell
3572
+ // whether the bound cut anything.
3573
+ if (opts && geometry?.historyLines !== undefined)
3574
+ opts.capturedHistoryLines = geometry.historyLines;
3575
+ // A pane in the alternate screen keeps no history (a nested tmux client
3576
+ // holds it there), so its capture is one screen however deep it reads.
3577
+ if (opts && geometry?.alternateOn !== undefined)
3578
+ opts.capturedAlternateOn = geometry.alternateOn;
3428
3579
  if (fullHistory) {
3429
3580
  // Without geometry there is no cursor move, so fall back to the old trim.
3430
3581
  // Keeping the blank rows here would park the caret at the bottom of the