@namzu/cli 45.1.0 → 45.2.0

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 (264) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +1 -1
  3. package/dist/bin.js +1 -1
  4. package/dist/chunks/{acp-CGGPX6FV.js → acp-TYPW7WFK.js} +14 -12
  5. package/dist/chunks/acp-TYPW7WFK.js.map +6 -0
  6. package/dist/chunks/{add-7F26IYNU.js → add-QEKJGVR4.js} +7 -6
  7. package/dist/chunks/add-QEKJGVR4.js.map +6 -0
  8. package/dist/chunks/{agent-42PYZGA5.js → agent-JWTNZ4PK.js} +10 -8
  9. package/dist/chunks/{agent-session-SYLDVKFJ.js → agent-session-OGPKSSKG.js} +11 -9
  10. package/dist/chunks/{bin-main-NID46PS7.js → bin-main-UI3NYIJE.js} +4 -4
  11. package/dist/chunks/{chat-WBJPS4K6.js → chat-F3WXVEDM.js} +2 -2
  12. package/dist/chunks/chunk-2IPDTDB3.js +80 -0
  13. package/dist/chunks/chunk-2IPDTDB3.js.map +6 -0
  14. package/dist/chunks/{chunk-U4ZP2JN2.js → chunk-4E33SWZU.js} +2 -2
  15. package/dist/chunks/{chunk-GXP5BKCZ.js → chunk-4WHMQBUC.js} +115 -92
  16. package/dist/chunks/{chunk-GXP5BKCZ.js.map → chunk-4WHMQBUC.js.map} +1 -1
  17. package/dist/chunks/{chunk-G742EI3J.js → chunk-4YBTLYYH.js} +82 -53
  18. package/dist/chunks/chunk-4YBTLYYH.js.map +6 -0
  19. package/dist/chunks/{chunk-NCW3WBBI.js → chunk-6NDJLXKW.js} +2 -2
  20. package/dist/chunks/chunk-6ULKBT6P.js +83 -0
  21. package/dist/chunks/chunk-6ULKBT6P.js.map +6 -0
  22. package/dist/chunks/{chunk-F2QERXWD.js → chunk-6WPKPHE2.js} +3 -3
  23. package/dist/chunks/{chunk-RBH2FDM5.js → chunk-6XL5ZMAL.js} +2 -2
  24. package/dist/chunks/{chunk-OYX743QK.js → chunk-7XAUAIGO.js} +586 -440
  25. package/dist/chunks/chunk-7XAUAIGO.js.map +6 -0
  26. package/dist/chunks/{chunk-LQN7NG2F.js → chunk-A72NRUYG.js} +6 -6
  27. package/dist/chunks/{chunk-IFXYNA2K.js → chunk-ADG5OPNS.js} +2 -2
  28. package/dist/chunks/{chunk-OM3EDVLG.js → chunk-CAOGKKB5.js} +2 -2
  29. package/dist/chunks/{chunk-L2WEBN6A.js → chunk-DH4X2E6M.js} +2 -2
  30. package/dist/chunks/{chunk-L2WEBN6A.js.map → chunk-DH4X2E6M.js.map} +1 -1
  31. package/dist/chunks/{chunk-AR2GPJUO.js → chunk-E3OXUQQB.js} +1 -66
  32. package/dist/chunks/chunk-E3OXUQQB.js.map +6 -0
  33. package/dist/chunks/{chunk-XSAEGHPS.js → chunk-EPIIR5CJ.js} +3 -3
  34. package/dist/chunks/{chunk-OXM3GHWE.js → chunk-EVZAGFTY.js} +6 -6
  35. package/dist/chunks/{chunk-OXM3GHWE.js.map → chunk-EVZAGFTY.js.map} +1 -1
  36. package/dist/chunks/{chunk-Q3AB63M5.js → chunk-GSAYGBOR.js} +23 -11
  37. package/dist/chunks/{chunk-Q3AB63M5.js.map → chunk-GSAYGBOR.js.map} +2 -2
  38. package/dist/chunks/{chunk-6LMIJ2YT.js → chunk-H2JLRNYH.js} +2 -2
  39. package/dist/chunks/{chunk-2YKQMUTC.js → chunk-HB4LEJMU.js} +12 -335
  40. package/dist/chunks/chunk-HB4LEJMU.js.map +6 -0
  41. package/dist/chunks/{chunk-P2Y3IUE6.js → chunk-L3XUPXPP.js} +3 -3
  42. package/dist/chunks/{chunk-5VBA5XSC.js → chunk-LOKFLXQL.js} +2 -2
  43. package/dist/chunks/{chunk-FU776PDS.js → chunk-Q6RZ64FS.js} +2 -2
  44. package/dist/chunks/chunk-QLDUL46Z.js +338 -0
  45. package/dist/chunks/chunk-QLDUL46Z.js.map +6 -0
  46. package/dist/chunks/{chunk-S7WRWA25.js → chunk-RI2KAZJO.js} +2 -2
  47. package/dist/chunks/{chunk-S7WRWA25.js.map → chunk-RI2KAZJO.js.map} +1 -1
  48. package/dist/chunks/{chunk-SSE5CXYL.js → chunk-RISNSR62.js} +2 -2
  49. package/dist/chunks/{chunk-SSE5CXYL.js.map → chunk-RISNSR62.js.map} +1 -1
  50. package/dist/chunks/{chunk-BDHXJ7BM.js → chunk-TCRGKEEX.js} +3 -1
  51. package/dist/chunks/chunk-TCRGKEEX.js.map +6 -0
  52. package/dist/chunks/{chunk-W7XKWKEZ.js → chunk-U5BN3L3Y.js} +2 -2
  53. package/dist/chunks/{chunk-2UATEMPS.js → chunk-UQJPNUDU.js} +2 -2
  54. package/dist/chunks/chunk-V45XJDX3.js +176 -0
  55. package/dist/chunks/chunk-V45XJDX3.js.map +6 -0
  56. package/dist/chunks/{chunk-OMRGJSUJ.js → chunk-VZC7FE4F.js} +84 -93
  57. package/dist/chunks/chunk-VZC7FE4F.js.map +6 -0
  58. package/dist/chunks/{chunk-O7H4QZ7I.js → chunk-W6E3PSFH.js} +2 -2
  59. package/dist/chunks/{chunk-K3UL7Z4X.js → chunk-X4TNXFUB.js} +22 -9
  60. package/dist/chunks/chunk-X4TNXFUB.js.map +6 -0
  61. package/dist/chunks/{chunk-PCWQ3ET3.js → chunk-XHR3UCKT.js} +2 -2
  62. package/dist/chunks/{chunk-F4B77QJQ.js → chunk-XOIXLN2Y.js} +3 -3
  63. package/dist/chunks/{cli-runtime-OBTTHZZI.js → cli-runtime-QOMHGRZL.js} +5 -4
  64. package/dist/chunks/cli-runtime-QOMHGRZL.js.map +6 -0
  65. package/dist/chunks/{crash-report-3IE2RFYG.js → crash-report-KHJZ3AKU.js} +3 -3
  66. package/dist/chunks/{doctor-QGFOTR5H.js → doctor-LCRG5FBA.js} +6 -6
  67. package/dist/chunks/{drain-5WSM4MTM.js → drain-47IMDCI5.js} +2 -2
  68. package/dist/chunks/{entry-HLIJKK65.js → entry-P6YPWRQW.js} +26 -20
  69. package/dist/chunks/{entry-HLIJKK65.js.map → entry-P6YPWRQW.js.map} +1 -1
  70. package/dist/chunks/{exec-7YEZ64T4.js → exec-ELIM7XVY.js} +13 -10
  71. package/dist/chunks/exec-ELIM7XVY.js.map +6 -0
  72. package/dist/chunks/{host-663JLCCW.js → host-QE4D3UXC.js} +10 -8
  73. package/dist/chunks/{host-queries-7CSOWEPE.js → host-queries-5H765XNX.js} +2 -2
  74. package/dist/chunks/{learn-NNBHDBLF.js → learn-Y5IBBZDY.js} +2 -2
  75. package/dist/chunks/{learn-builtin-YEDJT6ZP.js → learn-builtin-ND3T6U5L.js} +3 -3
  76. package/dist/chunks/{lifecycle-NDR7R22S.js → lifecycle-FJS7LD7B.js} +9 -8
  77. package/dist/chunks/{list-GIP6KAYZ.js → list-6HQMG7TU.js} +5 -4
  78. package/dist/chunks/list-6HQMG7TU.js.map +6 -0
  79. package/dist/chunks/{live-FJISKPXJ.js → live-CSA2LX3R.js} +5 -5
  80. package/dist/chunks/{mcp-EBVO25Q2.js → mcp-5RQSD6QV.js} +4 -3
  81. package/dist/chunks/mcp-5RQSD6QV.js.map +6 -0
  82. package/dist/chunks/{message-command-YIHQF33L.js → message-command-V3CL4DNT.js} +13 -11
  83. package/dist/chunks/message-command-V3CL4DNT.js.map +6 -0
  84. package/dist/chunks/{mouse-WFSJSLQD.js → mouse-EJQML44I.js} +2 -2
  85. package/dist/chunks/{pal-IOPI5RKZ.js → pal-WXN4O3DD.js} +3 -3
  86. package/dist/chunks/{palette-WDPS7W6Q.js → palette-CL5OOYGK.js} +10 -4
  87. package/dist/chunks/{peers-MZD3KTZK.js → peers-JQOUU3CX.js} +2 -2
  88. package/dist/chunks/{prefix-MLAG4KTK.js → prefix-3ZNPUSUK.js} +2 -2
  89. package/dist/chunks/{resident-DDGJ2IWB.js → resident-NGQORA2W.js} +6 -5
  90. package/dist/chunks/resident-NGQORA2W.js.map +6 -0
  91. package/dist/chunks/{schedule-GSNY74KJ.js → schedule-4L4DTRC5.js} +5 -5
  92. package/dist/chunks/{service-MH57P24N.js → service-EV6VQYJD.js} +8 -7
  93. package/dist/chunks/service-EV6VQYJD.js.map +6 -0
  94. package/dist/chunks/{session-step-D4AT5RZR.js → session-step-ZCZNC52S.js} +3 -3
  95. package/dist/chunks/{start-check-2EP7HZTU.js → start-check-W72K6M5Q.js} +2 -2
  96. package/dist/chunks/{store-IRKBQZNF.js → store-IVVYIPV2.js} +10 -6
  97. package/dist/chunks/{tui-5HAU6RLS.js → tui-CCAGK7BG.js} +380 -119
  98. package/dist/chunks/tui-CCAGK7BG.js.map +6 -0
  99. package/dist/chunks/{upgrade-ARBZZZRK.js → upgrade-LN6TFWDW.js} +3 -3
  100. package/dist/chunks/{spaces-JVPRV4YM.js → workspaces-5ZKKOX4X.js} +68 -42
  101. package/dist/chunks/workspaces-5ZKKOX4X.js.map +6 -0
  102. package/dist/cli.d.ts.map +1 -1
  103. package/dist/commands/manifest.d.ts +1 -1
  104. package/dist/commands/manifest.d.ts.map +1 -1
  105. package/dist/commands/workspaces.d.ts +49 -0
  106. package/dist/commands/workspaces.d.ts.map +1 -0
  107. package/dist/config/load.d.ts.map +1 -1
  108. package/dist/config/schema.d.ts +8 -3
  109. package/dist/config/schema.d.ts.map +1 -1
  110. package/dist/doctor/checks/terminal.d.ts +1 -1
  111. package/dist/doctor/checks/terminal.d.ts.map +1 -1
  112. package/dist/index.js +9 -8
  113. package/dist/integrations/accounts/host-facts.d.ts +1 -1
  114. package/dist/integrations/peers/runtime.d.ts +1 -1
  115. package/dist/integrations/peers/runtime.d.ts.map +1 -1
  116. package/dist/integrations/resident/runner-worker.js +2 -2
  117. package/dist/rounds/types.d.ts +6 -0
  118. package/dist/rounds/types.d.ts.map +1 -1
  119. package/dist/tui/App.d.ts +19 -7
  120. package/dist/tui/App.d.ts.map +1 -1
  121. package/dist/tui/Composer.d.ts +10 -4
  122. package/dist/tui/Composer.d.ts.map +1 -1
  123. package/dist/tui/agent.d.ts +8 -0
  124. package/dist/tui/agent.d.ts.map +1 -1
  125. package/dist/tui/index.d.ts.map +1 -1
  126. package/dist/tui/live-model-step.d.ts +16 -0
  127. package/dist/tui/live-model-step.d.ts.map +1 -0
  128. package/dist/tui/model-refusal.d.ts +2 -0
  129. package/dist/tui/model-refusal.d.ts.map +1 -1
  130. package/dist/tui/slashCommands.d.ts +22 -0
  131. package/dist/tui/slashCommands.d.ts.map +1 -1
  132. package/dist/tui/zoom/entry.d.ts +6 -6
  133. package/dist/tui/zoom/entry.d.ts.map +1 -1
  134. package/dist/tui/zoom/gesture.d.ts +2 -2
  135. package/dist/tui/zoom/gesture.d.ts.map +1 -1
  136. package/dist/tui/zoom/leave.d.ts +2 -2
  137. package/dist/tui/zoom/leave.d.ts.map +1 -1
  138. package/dist/tui/zoom/local.d.ts +3 -3
  139. package/dist/tui/zoom/local.d.ts.map +1 -1
  140. package/dist/{spaces → workspaces}/git.d.ts +1 -1
  141. package/dist/workspaces/git.d.ts.map +1 -0
  142. package/dist/{spaces → workspaces}/goto.d.ts +7 -7
  143. package/dist/workspaces/goto.d.ts.map +1 -0
  144. package/dist/{spaces → workspaces}/host.d.ts +61 -52
  145. package/dist/workspaces/host.d.ts.map +1 -0
  146. package/dist/{spaces → workspaces}/input.d.ts +1 -1
  147. package/dist/workspaces/input.d.ts.map +1 -0
  148. package/dist/{spaces → workspaces}/keymap.d.ts +2 -2
  149. package/dist/workspaces/keymap.d.ts.map +1 -0
  150. package/dist/{spaces → workspaces}/layout.d.ts +6 -4
  151. package/dist/workspaces/layout.d.ts.map +1 -0
  152. package/dist/{spaces → workspaces}/mouse.d.ts +2 -2
  153. package/dist/workspaces/mouse.d.ts.map +1 -0
  154. package/dist/{spaces → workspaces}/overlay.d.ts +0 -1
  155. package/dist/workspaces/overlay.d.ts.map +1 -0
  156. package/dist/workspaces/palette.d.ts +75 -0
  157. package/dist/workspaces/palette.d.ts.map +1 -0
  158. package/dist/workspaces/peers.d.ts.map +1 -0
  159. package/dist/{spaces → workspaces}/prefix.d.ts +1 -1
  160. package/dist/workspaces/prefix.d.ts.map +1 -0
  161. package/dist/{spaces → workspaces}/roster.d.ts +22 -22
  162. package/dist/workspaces/roster.d.ts.map +1 -0
  163. package/dist/workspaces/selection.d.ts.map +1 -0
  164. package/dist/{spaces → workspaces}/session.d.ts +1 -1
  165. package/dist/workspaces/session.d.ts.map +1 -0
  166. package/dist/{spaces → workspaces}/sidebar.d.ts +17 -17
  167. package/dist/workspaces/sidebar.d.ts.map +1 -0
  168. package/dist/{spaces → workspaces}/signal.d.ts +5 -3
  169. package/dist/workspaces/signal.d.ts.map +1 -0
  170. package/dist/{spaces → workspaces}/status.d.ts +2 -2
  171. package/dist/workspaces/status.d.ts.map +1 -0
  172. package/dist/{spaces → workspaces}/store.d.ts +25 -14
  173. package/dist/workspaces/store.d.ts.map +1 -0
  174. package/dist/workspaces/tabbar.d.ts +54 -0
  175. package/dist/workspaces/tabbar.d.ts.map +1 -0
  176. package/dist/{spaces → workspaces}/tiling.d.ts +7 -4
  177. package/dist/workspaces/tiling.d.ts.map +1 -0
  178. package/package.json +4 -4
  179. package/dist/chunks/acp-CGGPX6FV.js.map +0 -6
  180. package/dist/chunks/add-7F26IYNU.js.map +0 -6
  181. package/dist/chunks/chunk-2YKQMUTC.js.map +0 -6
  182. package/dist/chunks/chunk-AR2GPJUO.js.map +0 -6
  183. package/dist/chunks/chunk-BDHXJ7BM.js.map +0 -6
  184. package/dist/chunks/chunk-EXFSMYH4.js +0 -83
  185. package/dist/chunks/chunk-EXFSMYH4.js.map +0 -6
  186. package/dist/chunks/chunk-G742EI3J.js.map +0 -6
  187. package/dist/chunks/chunk-K3UL7Z4X.js.map +0 -6
  188. package/dist/chunks/chunk-OMRGJSUJ.js.map +0 -6
  189. package/dist/chunks/chunk-OYX743QK.js.map +0 -6
  190. package/dist/chunks/cli-runtime-OBTTHZZI.js.map +0 -6
  191. package/dist/chunks/exec-7YEZ64T4.js.map +0 -6
  192. package/dist/chunks/list-GIP6KAYZ.js.map +0 -6
  193. package/dist/chunks/mcp-EBVO25Q2.js.map +0 -6
  194. package/dist/chunks/message-command-YIHQF33L.js.map +0 -6
  195. package/dist/chunks/resident-DDGJ2IWB.js.map +0 -6
  196. package/dist/chunks/service-MH57P24N.js.map +0 -6
  197. package/dist/chunks/spaces-JVPRV4YM.js.map +0 -6
  198. package/dist/chunks/tui-5HAU6RLS.js.map +0 -6
  199. package/dist/commands/spaces.d.ts +0 -46
  200. package/dist/commands/spaces.d.ts.map +0 -1
  201. package/dist/spaces/git.d.ts.map +0 -1
  202. package/dist/spaces/goto.d.ts.map +0 -1
  203. package/dist/spaces/host.d.ts.map +0 -1
  204. package/dist/spaces/input.d.ts.map +0 -1
  205. package/dist/spaces/keymap.d.ts.map +0 -1
  206. package/dist/spaces/layout.d.ts.map +0 -1
  207. package/dist/spaces/mouse.d.ts.map +0 -1
  208. package/dist/spaces/overlay.d.ts.map +0 -1
  209. package/dist/spaces/palette.d.ts +0 -35
  210. package/dist/spaces/palette.d.ts.map +0 -1
  211. package/dist/spaces/peers.d.ts.map +0 -1
  212. package/dist/spaces/prefix.d.ts.map +0 -1
  213. package/dist/spaces/roster.d.ts.map +0 -1
  214. package/dist/spaces/selection.d.ts.map +0 -1
  215. package/dist/spaces/session.d.ts.map +0 -1
  216. package/dist/spaces/sidebar.d.ts.map +0 -1
  217. package/dist/spaces/signal.d.ts.map +0 -1
  218. package/dist/spaces/status.d.ts.map +0 -1
  219. package/dist/spaces/store.d.ts.map +0 -1
  220. package/dist/spaces/tabbar.d.ts +0 -36
  221. package/dist/spaces/tabbar.d.ts.map +0 -1
  222. package/dist/spaces/tiling.d.ts.map +0 -1
  223. /package/dist/chunks/{agent-42PYZGA5.js.map → agent-JWTNZ4PK.js.map} +0 -0
  224. /package/dist/chunks/{agent-session-SYLDVKFJ.js.map → agent-session-OGPKSSKG.js.map} +0 -0
  225. /package/dist/chunks/{bin-main-NID46PS7.js.map → bin-main-UI3NYIJE.js.map} +0 -0
  226. /package/dist/chunks/{chat-WBJPS4K6.js.map → chat-F3WXVEDM.js.map} +0 -0
  227. /package/dist/chunks/{chunk-U4ZP2JN2.js.map → chunk-4E33SWZU.js.map} +0 -0
  228. /package/dist/chunks/{chunk-NCW3WBBI.js.map → chunk-6NDJLXKW.js.map} +0 -0
  229. /package/dist/chunks/{chunk-F2QERXWD.js.map → chunk-6WPKPHE2.js.map} +0 -0
  230. /package/dist/chunks/{chunk-RBH2FDM5.js.map → chunk-6XL5ZMAL.js.map} +0 -0
  231. /package/dist/chunks/{chunk-LQN7NG2F.js.map → chunk-A72NRUYG.js.map} +0 -0
  232. /package/dist/chunks/{chunk-IFXYNA2K.js.map → chunk-ADG5OPNS.js.map} +0 -0
  233. /package/dist/chunks/{chunk-OM3EDVLG.js.map → chunk-CAOGKKB5.js.map} +0 -0
  234. /package/dist/chunks/{chunk-XSAEGHPS.js.map → chunk-EPIIR5CJ.js.map} +0 -0
  235. /package/dist/chunks/{chunk-6LMIJ2YT.js.map → chunk-H2JLRNYH.js.map} +0 -0
  236. /package/dist/chunks/{chunk-P2Y3IUE6.js.map → chunk-L3XUPXPP.js.map} +0 -0
  237. /package/dist/chunks/{chunk-5VBA5XSC.js.map → chunk-LOKFLXQL.js.map} +0 -0
  238. /package/dist/chunks/{chunk-FU776PDS.js.map → chunk-Q6RZ64FS.js.map} +0 -0
  239. /package/dist/chunks/{chunk-W7XKWKEZ.js.map → chunk-U5BN3L3Y.js.map} +0 -0
  240. /package/dist/chunks/{chunk-2UATEMPS.js.map → chunk-UQJPNUDU.js.map} +0 -0
  241. /package/dist/chunks/{chunk-O7H4QZ7I.js.map → chunk-W6E3PSFH.js.map} +0 -0
  242. /package/dist/chunks/{chunk-PCWQ3ET3.js.map → chunk-XHR3UCKT.js.map} +0 -0
  243. /package/dist/chunks/{chunk-F4B77QJQ.js.map → chunk-XOIXLN2Y.js.map} +0 -0
  244. /package/dist/chunks/{crash-report-3IE2RFYG.js.map → crash-report-KHJZ3AKU.js.map} +0 -0
  245. /package/dist/chunks/{doctor-QGFOTR5H.js.map → doctor-LCRG5FBA.js.map} +0 -0
  246. /package/dist/chunks/{drain-5WSM4MTM.js.map → drain-47IMDCI5.js.map} +0 -0
  247. /package/dist/chunks/{host-663JLCCW.js.map → host-QE4D3UXC.js.map} +0 -0
  248. /package/dist/chunks/{host-queries-7CSOWEPE.js.map → host-queries-5H765XNX.js.map} +0 -0
  249. /package/dist/chunks/{learn-NNBHDBLF.js.map → learn-Y5IBBZDY.js.map} +0 -0
  250. /package/dist/chunks/{learn-builtin-YEDJT6ZP.js.map → learn-builtin-ND3T6U5L.js.map} +0 -0
  251. /package/dist/chunks/{lifecycle-NDR7R22S.js.map → lifecycle-FJS7LD7B.js.map} +0 -0
  252. /package/dist/chunks/{live-FJISKPXJ.js.map → live-CSA2LX3R.js.map} +0 -0
  253. /package/dist/chunks/{mouse-WFSJSLQD.js.map → mouse-EJQML44I.js.map} +0 -0
  254. /package/dist/chunks/{pal-IOPI5RKZ.js.map → pal-WXN4O3DD.js.map} +0 -0
  255. /package/dist/chunks/{palette-WDPS7W6Q.js.map → palette-CL5OOYGK.js.map} +0 -0
  256. /package/dist/chunks/{peers-MZD3KTZK.js.map → peers-JQOUU3CX.js.map} +0 -0
  257. /package/dist/chunks/{prefix-MLAG4KTK.js.map → prefix-3ZNPUSUK.js.map} +0 -0
  258. /package/dist/chunks/{schedule-GSNY74KJ.js.map → schedule-4L4DTRC5.js.map} +0 -0
  259. /package/dist/chunks/{session-step-D4AT5RZR.js.map → session-step-ZCZNC52S.js.map} +0 -0
  260. /package/dist/chunks/{start-check-2EP7HZTU.js.map → start-check-W72K6M5Q.js.map} +0 -0
  261. /package/dist/chunks/{store-IRKBQZNF.js.map → store-IVVYIPV2.js.map} +0 -0
  262. /package/dist/chunks/{upgrade-ARBZZZRK.js.map → upgrade-LN6TFWDW.js.map} +0 -0
  263. /package/dist/{spaces → workspaces}/peers.d.ts +0 -0
  264. /package/dist/{spaces → workspaces}/selection.d.ts +0 -0
@@ -6,21 +6,21 @@ import {
6
6
  bypassKey,
7
7
  createClipboardCopier,
8
8
  describeCopy
9
- } from "./chunk-Q3AB63M5.js";
9
+ } from "./chunk-GSAYGBOR.js";
10
10
  import {
11
11
  LEAVE_SCREEN,
12
12
  LEAVE_TO_NATIVE,
13
13
  enterScreen,
14
14
  mouseOn
15
- } from "./chunk-L2WEBN6A.js";
15
+ } from "./chunk-DH4X2E6M.js";
16
16
  import {
17
- advertisesTruecolor,
17
+ colorLevel,
18
18
  paletteFor
19
- } from "./chunk-EXFSMYH4.js";
19
+ } from "./chunk-V45XJDX3.js";
20
20
  import {
21
21
  recordForPid,
22
22
  recordForSlot
23
- } from "./chunk-SSE5CXYL.js";
23
+ } from "./chunk-RISNSR62.js";
24
24
  import {
25
25
  HeadlessScreen
26
26
  } from "./chunk-GWGIAZLZ.js";
@@ -37,6 +37,9 @@ import {
37
37
  import {
38
38
  formatResetTime
39
39
  } from "./chunk-YOWYTBJS.js";
40
+ import {
41
+ activeThemeName
42
+ } from "./chunk-2IPDTDB3.js";
40
43
  import {
41
44
  killProcessTree
42
45
  } from "./chunk-IPVDXTWF.js";
@@ -47,7 +50,7 @@ import {
47
50
  __name
48
51
  } from "./chunk-76FLAFCG.js";
49
52
 
50
- // src/spaces/host.ts
53
+ // src/workspaces/host.ts
51
54
  import { randomUUID } from "node:crypto";
52
55
  import { existsSync, statSync, writeSync } from "node:fs";
53
56
  import { homedir } from "node:os";
@@ -223,7 +226,7 @@ var DiffWriter = class {
223
226
  }
224
227
  };
225
228
 
226
- // src/spaces/git.ts
229
+ // src/workspaces/git.ts
227
230
  import { execFile } from "node:child_process";
228
231
  var GIT_TIMEOUT_MS = 2e3;
229
232
  function run(cwd, args) {
@@ -298,7 +301,7 @@ var GitCache = class {
298
301
  }
299
302
  };
300
303
 
301
- // src/spaces/status.ts
304
+ // src/workspaces/status.ts
302
305
  var PRIORITY = ["blocked", "done", "working", "idle", "none"];
303
306
  function deriveActivity(child, reported) {
304
307
  if (child === "none") return "not-started";
@@ -320,19 +323,19 @@ function aggregateDot(dots) {
320
323
  return "none";
321
324
  }
322
325
  __name(aggregateDot, "aggregateDot");
323
- function spaceNote(dot) {
326
+ function workspaceNote(dot) {
324
327
  if (dot === "blocked") return "needs approval";
325
328
  if (dot === "done") return "finished, not seen";
326
329
  return void 0;
327
330
  }
328
- __name(spaceNote, "spaceNote");
331
+ __name(workspaceNote, "workspaceNote");
329
332
  function limitedNote(until, now) {
330
333
  if (until === void 0) return "may be limited";
331
334
  return `limited until ${formatResetTime(until, now)}`;
332
335
  }
333
336
  __name(limitedNote, "limitedNote");
334
337
 
335
- // src/spaces/tiling.ts
338
+ // src/workspaces/tiling.ts
336
339
  var MIN_RATIO = 0.1;
337
340
  var MAX_RATIO = 0.9;
338
341
  var MIN_PANE_WIDTH = 12;
@@ -409,6 +412,7 @@ function resizeAt(node, entry, axis, forward, step = RESIZE_STEP) {
409
412
  return true;
410
413
  }
411
414
  __name(resizeAt, "resizeAt");
415
+ var SPLIT_GAP = 1;
412
416
  function shrink(rect) {
413
417
  return {
414
418
  x: rect.x + 1,
@@ -438,15 +442,23 @@ function place(root, area) {
438
442
  return;
439
443
  }
440
444
  if (node.dir === "side") {
441
- const first = firstShare(rect.width, node.ratio, MIN_PANE_WIDTH);
445
+ const first = firstShare(rect.width - SPLIT_GAP, node.ratio, MIN_PANE_WIDTH);
442
446
  dividers.push({ split: node, area: rect, at: rect.x + first });
443
- walk(node.a, { ...rect, width: first });
444
- walk(node.b, { ...rect, x: rect.x + first, width: rect.width - first });
447
+ walk(node.a, { ...rect, width: Math.max(1, first) });
448
+ walk(node.b, {
449
+ ...rect,
450
+ x: rect.x + first + SPLIT_GAP,
451
+ width: Math.max(1, rect.width - first - SPLIT_GAP)
452
+ });
445
453
  } else {
446
- const first = firstShare(rect.height, node.ratio, MIN_PANE_HEIGHT);
454
+ const first = firstShare(rect.height - SPLIT_GAP, node.ratio, MIN_PANE_HEIGHT);
447
455
  dividers.push({ split: node, area: rect, at: rect.y + first });
448
- walk(node.a, { ...rect, height: first });
449
- walk(node.b, { ...rect, y: rect.y + first, height: rect.height - first });
456
+ walk(node.a, { ...rect, height: Math.max(1, first) });
457
+ walk(node.b, {
458
+ ...rect,
459
+ y: rect.y + first + SPLIT_GAP,
460
+ height: Math.max(1, rect.height - first - SPLIT_GAP)
461
+ });
450
462
  }
451
463
  }, "walk");
452
464
  walk(root, area);
@@ -454,7 +466,7 @@ function place(root, area) {
454
466
  }
455
467
  __name(place, "place");
456
468
  function ratioFor(divider, at) {
457
- const total = divider.split.dir === "side" ? divider.area.width : divider.area.height;
469
+ const total = (divider.split.dir === "side" ? divider.area.width : divider.area.height) - SPLIT_GAP;
458
470
  const start = divider.split.dir === "side" ? divider.area.x : divider.area.y;
459
471
  return clampRatio((at - start) / total);
460
472
  }
@@ -463,8 +475,8 @@ function dividerAt(dividers, x, y) {
463
475
  return dividers.find((d) => {
464
476
  const { area } = d;
465
477
  if (d.split.dir === "side")
466
- return (x === d.at - 1 || x === d.at) && y >= area.y && y < area.y + area.height;
467
- return (y === d.at - 1 || y === d.at) && x >= area.x && x < area.x + area.width;
478
+ return x >= d.at - 1 && x <= d.at + SPLIT_GAP && y >= area.y && y < area.y + area.height;
479
+ return y >= d.at - 1 && y <= d.at + SPLIT_GAP && x >= area.x && x < area.x + area.width;
468
480
  });
469
481
  }
470
482
  __name(dividerAt, "dividerAt");
@@ -496,7 +508,7 @@ function neighbour(panes, from, direction) {
496
508
  if (across === 0) continue;
497
509
  const start = horizontal ? outer.y : outer.x;
498
510
  const length = horizontal ? outer.height : outer.width;
499
- const covers = middle >= start && middle < start + length;
511
+ const covers = middle >= start - SPLIT_GAP && middle < start + length;
500
512
  if (!best || gap < best.gap || gap === best.gap && (Number(covers) > Number(best.covers) || covers === best.covers && across > best.across))
501
513
  best = { entry, gap, across, covers };
502
514
  }
@@ -514,23 +526,23 @@ function placeTab(tab, area) {
514
526
  }
515
527
  __name(placeTab, "placeTab");
516
528
 
517
- // src/spaces/goto.ts
529
+ // src/workspaces/goto.ts
518
530
  function gotoRows(roster) {
519
531
  const rows = [];
520
- for (const space of roster.spaces) {
532
+ for (const workspace of roster.workspaces) {
521
533
  rows.push({
522
534
  depth: 0,
523
- text: space.name,
524
- dot: roster.spaceDot(space),
525
- target: { kind: "space", space }
535
+ text: workspace.name,
536
+ dot: roster.workspaceDot(workspace),
537
+ target: { kind: "workspace", workspace }
526
538
  });
527
- space.tabs.forEach((tab, i) => {
539
+ workspace.tabs.forEach((tab, i) => {
528
540
  const panes = leaves(tab.root);
529
541
  rows.push({
530
542
  depth: 1,
531
543
  text: tab.name ?? `tab ${i + 1}`,
532
544
  dot: aggregateDot(panes.map((p) => p.dot())),
533
- target: { kind: "tab", space, tab }
545
+ target: { kind: "tab", workspace, tab }
534
546
  });
535
547
  for (const entry of panes)
536
548
  rows.push({
@@ -568,7 +580,7 @@ function currentRow(rows, entry) {
568
580
  }
569
581
  __name(currentRow, "currentRow");
570
582
 
571
- // src/spaces/input.ts
583
+ // src/workspaces/input.ts
572
584
  var ESC = String.fromCharCode(27);
573
585
  var ARROW = new RegExp(`^${ESC}[[O]([ABCD])`, "u");
574
586
  var CSI = new RegExp(`^${ESC}\\[[0-9;?]*[ -/]*[@-~]`, "u");
@@ -758,19 +770,29 @@ function readKey(text) {
758
770
  }
759
771
  __name(readKey, "readKey");
760
772
 
761
- // src/spaces/keymap.ts
773
+ // src/workspaces/keymap.ts
762
774
  var DIGITS = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
763
775
  var BINDINGS = [
764
776
  { keys: ["?"], action: "help", group: "General", label: "keybinds" },
765
- { keys: ["g"], action: "goto", group: "General", label: "go to a space, tab or pane" },
777
+ { keys: ["g"], action: "goto", group: "General", label: "go to a workspace, tab or pane" },
766
778
  { keys: ["s"], action: "menu", group: "General", label: "menu" },
767
779
  { keys: ["q"], action: "quit", group: "General", label: "quit" },
768
- { keys: ["N"], action: "new-space", group: "Spaces", label: "new space" },
769
- { keys: ["O"], action: "open-folder", group: "Spaces", label: "open a folder as a space" },
770
- { keys: ["W"], action: "rename-space", group: "Spaces", label: "rename space" },
771
- { keys: ["D"], action: "close-space", group: "Spaces", label: "close space" },
772
- { keys: ["w"], action: "space-mode", group: "Spaces", label: "move through the spaces" },
773
- { keys: ["b"], action: "sidebar", group: "Spaces", label: "toggle sidebar" },
780
+ { keys: ["N"], action: "new-workspace", group: "Workspaces", label: "new workspace" },
781
+ {
782
+ keys: ["O"],
783
+ action: "open-folder",
784
+ group: "Workspaces",
785
+ label: "open a folder as a workspace"
786
+ },
787
+ { keys: ["W"], action: "rename-workspace", group: "Workspaces", label: "rename workspace" },
788
+ { keys: ["D"], action: "close-workspace", group: "Workspaces", label: "close workspace" },
789
+ {
790
+ keys: ["w"],
791
+ action: "workspace-mode",
792
+ group: "Workspaces",
793
+ label: "move through the workspaces"
794
+ },
795
+ { keys: ["b"], action: "sidebar", group: "Workspaces", label: "toggle sidebar" },
774
796
  { keys: ["c"], action: "new-tab", group: "Tabs", label: "new tab" },
775
797
  { keys: ["T"], action: "rename-tab", group: "Tabs", label: "rename tab" },
776
798
  { keys: ["X"], action: "close-tab", group: "Tabs", label: "close tab" },
@@ -814,7 +836,7 @@ function bindingFor(key) {
814
836
  __name(bindingFor, "bindingFor");
815
837
  function helpRows(prefixName) {
816
838
  const rows = [{ heading: `${prefixName} then a key; twice sends it to the pane` }];
817
- for (const group of ["General", "Spaces", "Tabs", "Panes"]) {
839
+ for (const group of ["General", "Workspaces", "Tabs", "Panes"]) {
818
840
  rows.push({ heading: group });
819
841
  for (const b of BINDINGS)
820
842
  if (b.group === group) rows.push({ keys: keysText(b), label: b.label });
@@ -823,7 +845,8 @@ function helpRows(prefixName) {
823
845
  }
824
846
  __name(helpRows, "helpRows");
825
847
 
826
- // src/spaces/layout.ts
848
+ // src/workspaces/layout.ts
849
+ var TAB_BAR_HEIGHT = 2;
827
850
  var SIDEBAR_MIN = 18;
828
851
  var SIDEBAR_MAX = 36;
829
852
  var SIDEBAR_DEFAULT = 26;
@@ -847,11 +870,11 @@ function computeLayout(cols, rows, sidebar = DEFAULT_SIDEBAR) {
847
870
  }
848
871
  const shown = cols - total >= MAIN_MIN;
849
872
  const main = shown ? { x: total, y: 0, width: cols - total, height: rows } : { x: 0, y: 0, width: cols, height: rows };
850
- const tabBar = { ...main, height: Math.min(1, main.height) };
873
+ const tabBar = { ...main, height: Math.min(TAB_BAR_HEIGHT, main.height) };
851
874
  const panes = {
852
875
  ...main,
853
- y: main.y + 1,
854
- height: Math.max(1, main.height - 1)
876
+ y: main.y + Math.min(TAB_BAR_HEIGHT, Math.max(0, main.height - 1)),
877
+ height: Math.max(1, main.height - TAB_BAR_HEIGHT)
855
878
  };
856
879
  if (!shown)
857
880
  return {
@@ -873,7 +896,7 @@ function computeLayout(cols, rows, sidebar = DEFAULT_SIDEBAR) {
873
896
  }
874
897
  __name(computeLayout, "computeLayout");
875
898
 
876
- // src/spaces/overlay.ts
899
+ // src/workspaces/overlay.ts
877
900
  function within(rect, x, y) {
878
901
  return x >= rect.x && x < rect.x + rect.width && y >= rect.y && y < rect.y + rect.height;
879
902
  }
@@ -885,14 +908,18 @@ function hitSurface(surface, x, y) {
885
908
  return within(surface.rect, x, y) ? { kind: "inside" } : { kind: "outside" };
886
909
  }
887
910
  __name(hitSurface, "hitSurface");
911
+ function caret(palette) {
912
+ return palette.mono ? { attrs: ATTR_INVERSE } : { bg: palette.text };
913
+ }
914
+ __name(caret, "caret");
888
915
  function drawBox(frame, rect, fg, bg) {
889
916
  if (rect.width < 2 || rect.height < 2) return;
890
917
  const style = { fg, ...bg !== void 0 ? { bg } : {} };
891
918
  const right = rect.x + rect.width - 1;
892
919
  const bottom = rect.y + rect.height - 1;
893
920
  const across = "\u2500".repeat(rect.width - 2);
894
- frame.writeText({ ...rect, height: 1 }, 0, `\u250C${across}\u2510`, style);
895
- frame.writeText({ ...rect, y: bottom, height: 1 }, 0, `\u2514${across}\u2518`, style);
921
+ frame.writeText({ ...rect, height: 1 }, 0, `\u256D${across}\u256E`, style);
922
+ frame.writeText({ ...rect, y: bottom, height: 1 }, 0, `\u2570${across}\u256F`, style);
896
923
  for (let y = rect.y + 1; y < bottom; y++) {
897
924
  frame.writeText({ x: rect.x, y, width: 1, height: 1 }, 0, "\u2502", style);
898
925
  frame.writeText({ x: right, y, width: 1, height: 1 }, 0, "\u2502", style);
@@ -969,17 +996,17 @@ function layoutModal(screen, fullSpec) {
969
996
  __name(layoutModal, "layoutModal");
970
997
  function drawModal(frame, layout, spec, palette) {
971
998
  const { rect } = layout;
972
- const tone = spec.danger ? palette.red : palette.accent;
973
- frame.fillRect(rect, { bg: palette.panelBg });
974
- drawBox(frame, rect, tone, palette.panelBg);
999
+ const tone = spec.danger ? palette.danger : palette.focus;
1000
+ frame.fillRect(rect, { bg: palette.base });
1001
+ drawBox(frame, rect, tone, palette.base);
975
1002
  const inner = { x: rect.x + 2, y: rect.y, width: rect.width - 4, height: rect.height };
976
1003
  frame.writeText(inner, 1, spec.title, {
977
- fg: spec.danger ? palette.red : palette.text,
978
- bg: palette.panelBg,
1004
+ fg: spec.danger ? palette.danger : palette.text,
1005
+ bg: palette.base,
979
1006
  attrs: ATTR_BOLD
980
1007
  });
981
1008
  (spec.lines ?? []).forEach(
982
- (line, i) => frame.writeText(inner, 2 + i, line, { fg: palette.subtext, bg: palette.panelBg })
1009
+ (line, i) => frame.writeText(inner, 2 + i, line, { fg: palette.subtext, bg: palette.base })
983
1010
  );
984
1011
  if (layout.inputRect && spec.input) {
985
1012
  const field = layout.inputRect;
@@ -991,25 +1018,19 @@ function drawModal(frame, layout, spec, palette) {
991
1018
  fg: palette.text,
992
1019
  bg: palette.surface
993
1020
  });
994
- frame.writeText({ ...field, x: field.x + 1 + used, width: 1 }, 0, " ", {
995
- bg: palette.text
996
- });
1021
+ frame.writeText({ ...field, x: field.x + 1 + used, width: 1 }, 0, " ", caret(palette));
997
1022
  if (spec.error)
998
1023
  frame.writeText(inner, field.y - rect.y + 1, spec.error, {
999
- fg: palette.red,
1000
- bg: palette.panelBg
1024
+ fg: palette.danger,
1025
+ bg: palette.base
1001
1026
  });
1002
1027
  }
1003
1028
  spec.buttons.forEach((b) => {
1004
1029
  const at = layout.buttons.find((l) => l.action === b.action)?.rect;
1005
1030
  if (!at) return;
1006
- const fill = b.primary ? tone : palette.surface;
1007
- frame.fillRect(at, { bg: fill });
1008
- frame.writeText({ ...at, x: at.x + 1, width: at.width - 1 }, 0, b.label, {
1009
- fg: b.primary ? palette.panelBg : palette.text,
1010
- bg: fill,
1011
- ...b.primary ? { attrs: ATTR_BOLD } : {}
1012
- });
1031
+ const style = !b.primary ? { fg: palette.text, bg: palette.surface } : palette.mono ? { attrs: ATTR_BOLD | ATTR_INVERSE } : { fg: palette.ink, bg: tone, attrs: ATTR_BOLD };
1032
+ frame.fillRect(at, style);
1033
+ frame.writeText({ ...at, x: at.x + 1, width: at.width - 1 }, 0, b.label, style);
1013
1034
  });
1014
1035
  }
1015
1036
  __name(drawModal, "drawModal");
@@ -1043,10 +1064,10 @@ function layoutList(screen, spec) {
1043
1064
  __name(layoutList, "layoutList");
1044
1065
  function drawList(frame, layout, spec, palette) {
1045
1066
  const { rect } = layout;
1046
- frame.fillRect(rect, { bg: palette.panelBg });
1047
- drawBox(frame, rect, palette.accent, palette.panelBg);
1067
+ frame.fillRect(rect, { bg: palette.base });
1068
+ drawBox(frame, rect, palette.focus, palette.base);
1048
1069
  const inner = { x: rect.x + 2, y: rect.y, width: rect.width - 4, height: rect.height };
1049
- frame.writeText(inner, 1, spec.title, { fg: palette.text, bg: palette.panelBg, attrs: ATTR_BOLD });
1070
+ frame.writeText(inner, 1, spec.title, { fg: palette.text, bg: palette.base, attrs: ATTR_BOLD });
1050
1071
  if (layout.inputRect && spec.input) {
1051
1072
  const field = layout.inputRect;
1052
1073
  frame.fillRect(field, { bg: palette.surface });
@@ -1057,7 +1078,7 @@ function drawList(frame, layout, spec, palette) {
1057
1078
  fg: palette.text,
1058
1079
  bg: palette.surface
1059
1080
  });
1060
- frame.writeText({ ...field, x: field.x + 1 + used, width: 1 }, 0, " ", { bg: palette.text });
1081
+ frame.writeText({ ...field, x: field.x + 1 + used, width: 1 }, 0, " ", caret(palette));
1061
1082
  }
1062
1083
  const first = rect.y + (spec.input ? 4 : 3);
1063
1084
  for (let i = 0; i < layout.capacity; i++) {
@@ -1065,8 +1086,9 @@ function drawList(frame, layout, spec, palette) {
1065
1086
  if (!row) break;
1066
1087
  const area = { x: rect.x + 1, y: first + i, width: rect.width - 2, height: 1 };
1067
1088
  const chosen = layout.top + i === spec.index;
1068
- const bg = chosen ? palette.cursorRow : palette.panelBg;
1069
- frame.fillRect(area, { bg });
1089
+ const bg = chosen ? palette.cursorRow : palette.base;
1090
+ const mark = chosen && palette.mono ? ATTR_INVERSE : 0;
1091
+ frame.fillRect(area, { bg, ...mark ? { attrs: mark } : {} });
1070
1092
  let x = 1 + (row.indent ?? 0);
1071
1093
  const put = /* @__PURE__ */ __name((text, style) => {
1072
1094
  x += frame.writeText(
@@ -1075,7 +1097,8 @@ function drawList(frame, layout, spec, palette) {
1075
1097
  text,
1076
1098
  {
1077
1099
  ...style,
1078
- bg
1100
+ bg,
1101
+ attrs: (style.attrs ?? 0) | mark
1079
1102
  }
1080
1103
  );
1081
1104
  }, "put");
@@ -1088,13 +1111,13 @@ function drawList(frame, layout, spec, palette) {
1088
1111
  x += 1;
1089
1112
  }
1090
1113
  put(row.text, {
1091
- fg: row.heading ? palette.dimmer : row.muted ? palette.dim : chosen ? palette.text : palette.subtext,
1114
+ fg: row.heading ? palette.dim : row.muted ? palette.dim : chosen ? palette.text : palette.subtext,
1092
1115
  ...row.heading || chosen ? { attrs: ATTR_BOLD } : {}
1093
1116
  });
1094
1117
  }
1095
1118
  frame.writeText({ ...inner, y: rect.y + rect.height - 2, height: 1 }, 0, spec.footer, {
1096
1119
  fg: palette.dim,
1097
- bg: palette.panelBg
1120
+ bg: palette.base
1098
1121
  });
1099
1122
  }
1100
1123
  __name(drawList, "drawList");
@@ -1118,32 +1141,28 @@ function layoutPopup(screen, at, items, minWidth = 14) {
1118
1141
  }
1119
1142
  __name(layoutPopup, "layoutPopup");
1120
1143
  function drawPopup(frame, surface, items, index, palette) {
1121
- frame.fillRect(surface.rect, { bg: palette.panelBg });
1122
- drawBox(frame, surface.rect, palette.accent, palette.panelBg);
1144
+ frame.fillRect(surface.rect, { bg: palette.base });
1145
+ drawBox(frame, surface.rect, palette.focus, palette.base);
1123
1146
  items.forEach((item, i) => {
1124
1147
  const row = surface.rows[i]?.rect;
1125
1148
  if (!row) return;
1126
1149
  const chosen = i === index;
1127
- const bg = chosen ? palette.accent : palette.panelBg;
1128
- frame.fillRect(row, { bg });
1129
- frame.writeText({ ...row, x: row.x + 1, width: row.width - 1 }, 0, item, {
1130
- fg: chosen ? palette.panelBg : palette.subtext,
1131
- bg,
1132
- ...chosen ? { attrs: ATTR_BOLD } : {}
1133
- });
1150
+ const style = !chosen ? { fg: palette.subtext, bg: palette.base } : palette.mono ? { attrs: ATTR_BOLD | ATTR_INVERSE } : { fg: palette.ink, bg: palette.accent, attrs: ATTR_BOLD };
1151
+ frame.fillRect(row, style);
1152
+ frame.writeText({ ...row, x: row.x + 1, width: row.width - 1 }, 0, item, style);
1134
1153
  });
1135
1154
  }
1136
1155
  __name(drawPopup, "drawPopup");
1137
1156
 
1138
- // src/spaces/roster.ts
1157
+ // src/workspaces/roster.ts
1139
1158
  var Entry = class {
1140
- constructor(slot, spaceId, label) {
1159
+ constructor(slot, workspaceId, label) {
1141
1160
  this.slot = slot;
1142
- this.spaceId = spaceId;
1161
+ this.workspaceId = workspaceId;
1143
1162
  this.label = label;
1144
1163
  }
1145
1164
  slot;
1146
- spaceId;
1165
+ workspaceId;
1147
1166
  label;
1148
1167
  static {
1149
1168
  __name(this, "Entry");
@@ -1195,74 +1214,74 @@ var Roster = class {
1195
1214
  static {
1196
1215
  __name(this, "Roster");
1197
1216
  }
1198
- spaces = [];
1217
+ workspaces = [];
1199
1218
  entries = [];
1200
1219
  current;
1201
1220
  counter = 0;
1202
1221
  ticks = 0;
1203
- /** The session with focus: the focused pane of the shown tab of the shown space. */
1222
+ /** The session with focus: the focused pane of the shown tab of the shown workspace. */
1204
1223
  get selected() {
1205
1224
  return this.current;
1206
1225
  }
1207
- spaceOf(entry) {
1208
- return this.spaces.find((s) => s.id === entry.spaceId);
1226
+ workspaceOf(entry) {
1227
+ return this.workspaces.find((s) => s.id === entry.workspaceId);
1209
1228
  }
1210
- entriesOf(space) {
1211
- return this.entries.filter((e) => e.spaceId === space.id);
1229
+ entriesOf(workspace) {
1230
+ return this.entries.filter((e) => e.workspaceId === workspace.id);
1212
1231
  }
1213
1232
  tabOf(entry) {
1214
- return this.spaceOf(entry)?.tabs.find((t) => contains(t.root, entry));
1233
+ return this.workspaceOf(entry)?.tabs.find((t) => contains(t.root, entry));
1215
1234
  }
1216
1235
  /** The tab being shown. */
1217
1236
  get shownTab() {
1218
1237
  const entry = this.current;
1219
1238
  return entry ? this.tabOf(entry) : void 0;
1220
1239
  }
1221
- addSpace(cwd, name) {
1222
- const space = {
1223
- id: `space-${++this.counter}`,
1240
+ addWorkspace(cwd, name) {
1241
+ const workspace = {
1242
+ id: `workspace-${++this.counter}`,
1224
1243
  name,
1225
1244
  cwd,
1226
1245
  tabs: [],
1227
1246
  activeTab: void 0
1228
1247
  };
1229
- this.spaces.push(space);
1230
- return space;
1248
+ this.workspaces.push(workspace);
1249
+ return workspace;
1231
1250
  }
1232
- /** Moves a space to a place in the list; the others keep their order. False when nothing moved. */
1233
- moveSpace(space, to) {
1234
- const from = this.spaces.indexOf(space);
1235
- const target = Math.max(0, Math.min(this.spaces.length - 1, to));
1251
+ /** Moves a workspace to a place in the list; the others keep their order. False when nothing moved. */
1252
+ moveWorkspace(workspace, to) {
1253
+ const from = this.workspaces.indexOf(workspace);
1254
+ const target = Math.max(0, Math.min(this.workspaces.length - 1, to));
1236
1255
  if (from < 0 || from === target) return false;
1237
- this.spaces.splice(from, 1);
1238
- this.spaces.splice(target, 0, space);
1256
+ this.workspaces.splice(from, 1);
1257
+ this.workspaces.splice(target, 0, workspace);
1239
1258
  return true;
1240
1259
  }
1241
1260
  /** A session that is not in any tab yet; give it a place with `addTab` or `splitBeside`. */
1242
- addSession(space, slot, label) {
1243
- const own = this.entriesOf(space);
1244
- const entry = new Entry(slot, space.id, label ?? this.freeLabel(own));
1261
+ addSession(workspace, slot, label) {
1262
+ const own = this.entriesOf(workspace);
1263
+ const entry = new Entry(slot, workspace.id, label ?? this.freeLabel(own));
1245
1264
  this.entries.push(entry);
1246
1265
  this.current ??= entry;
1247
1266
  return entry;
1248
1267
  }
1249
- /** A tab holding one pane, after the space's others. */
1250
- addTab(space, entry, name) {
1268
+ /** A tab holding one pane, after the workspace's others. */
1269
+ addTab(workspace, entry, name) {
1251
1270
  const tab = {
1252
1271
  root: leaf(entry),
1253
1272
  focus: entry,
1254
1273
  zoomed: false,
1255
1274
  ...name ? { name } : {}
1256
1275
  };
1257
- space.tabs.push(tab);
1258
- space.activeTab ??= tab;
1276
+ workspace.tabs.push(tab);
1277
+ workspace.activeTab ??= tab;
1259
1278
  return tab;
1260
1279
  }
1261
1280
  /** A tab built from a whole tree, as when a layout is restored. */
1262
- addTree(space, root, focus, name, zoomed = false) {
1281
+ addTree(workspace, root, focus, name, zoomed = false) {
1263
1282
  const tab = { root, focus, zoomed, ...name ? { name } : {} };
1264
- space.tabs.push(tab);
1265
- space.activeTab ??= tab;
1283
+ workspace.tabs.push(tab);
1284
+ workspace.activeTab ??= tab;
1266
1285
  return tab;
1267
1286
  }
1268
1287
  /** Splits the pane of `target` and puts `created` in the new half, which takes focus. */
@@ -1278,7 +1297,7 @@ var Roster = class {
1278
1297
  const used = new Set(own.map((e) => e.label));
1279
1298
  for (let n = own.length + 1; ; n++) if (!used.has(`session ${n}`)) return `session ${n}`;
1280
1299
  }
1281
- /** Whether the entry's pane is on screen: in the shown tab of the shown space. */
1300
+ /** Whether the entry's pane is on screen: in the shown tab of the shown workspace. */
1282
1301
  isVisible(entry) {
1283
1302
  const tab = this.shownTab;
1284
1303
  return tab !== void 0 && contains(tab.root, entry);
@@ -1286,11 +1305,11 @@ var Roster = class {
1286
1305
  /** Shows an entry's tab with that pane focused; looking at panes clears their "finished" mark. */
1287
1306
  select(entry) {
1288
1307
  if (!this.entries.includes(entry)) return;
1289
- const space = this.spaceOf(entry);
1308
+ const workspace = this.workspaceOf(entry);
1290
1309
  const tab = this.tabOf(entry);
1291
1310
  if (tab) {
1292
1311
  tab.focus = entry;
1293
- space.activeTab = tab;
1312
+ workspace.activeTab = tab;
1294
1313
  }
1295
1314
  this.current = entry;
1296
1315
  entry.scrollBack = 0;
@@ -1305,21 +1324,21 @@ var Roster = class {
1305
1324
  if (!this.isVisible(entry)) entry.unseen = true;
1306
1325
  }
1307
1326
  }
1308
- spaceDot(space) {
1309
- return aggregateDot(this.entriesOf(space).map((e) => e.dot()));
1327
+ workspaceDot(workspace) {
1328
+ return aggregateDot(this.entriesOf(workspace).map((e) => e.dot()));
1310
1329
  }
1311
1330
  /**
1312
1331
  * Removes a session and its pane: the neighbour takes the room and focus. A tab
1313
- * left empty goes, and so does a space left with no tab.
1332
+ * left empty goes, and so does a workspace left with no tab.
1314
1333
  */
1315
1334
  removeEntry(entry) {
1316
1335
  const index = this.entries.indexOf(entry);
1317
1336
  if (index < 0) return;
1318
- const space = this.spaces.find((s) => s.id === entry.spaceId);
1319
- const tab = space?.tabs.find((t) => contains(t.root, entry));
1337
+ const workspace = this.workspaces.find((s) => s.id === entry.workspaceId);
1338
+ const tab = workspace?.tabs.find((t) => contains(t.root, entry));
1320
1339
  let landing;
1321
1340
  this.entries.splice(index, 1);
1322
- if (space && tab) {
1341
+ if (workspace && tab) {
1323
1342
  const { root, next } = removeLeaf(tab.root, entry);
1324
1343
  if (root) {
1325
1344
  tab.root = root;
@@ -1327,39 +1346,40 @@ var Roster = class {
1327
1346
  if (tab.focus === entry) tab.focus = next ?? leaves(root)[0];
1328
1347
  landing = tab.focus;
1329
1348
  } else {
1330
- const at = space.tabs.indexOf(tab);
1331
- space.tabs.splice(at, 1);
1332
- if (space.activeTab === tab)
1333
- space.activeTab = space.tabs[Math.min(at, space.tabs.length - 1)];
1334
- landing = space.activeTab?.focus;
1349
+ const at = workspace.tabs.indexOf(tab);
1350
+ workspace.tabs.splice(at, 1);
1351
+ if (workspace.activeTab === tab)
1352
+ workspace.activeTab = workspace.tabs[Math.min(at, workspace.tabs.length - 1)];
1353
+ landing = workspace.activeTab?.focus;
1335
1354
  }
1336
1355
  }
1337
- if (space && space.tabs.length === 0) this.spaces.splice(this.spaces.indexOf(space), 1);
1356
+ if (workspace && workspace.tabs.length === 0)
1357
+ this.workspaces.splice(this.workspaces.indexOf(workspace), 1);
1338
1358
  if (this.current === entry) {
1339
1359
  const next = landing ?? this.entries[Math.min(index, this.entries.length - 1)];
1340
1360
  this.current = next;
1341
1361
  if (next) {
1342
- const there = this.spaces.find((s) => s.id === next.spaceId);
1362
+ const there = this.workspaces.find((s) => s.id === next.workspaceId);
1343
1363
  const nextTab = there?.tabs.find((t) => contains(t.root, next));
1344
1364
  if (there && nextTab) there.activeTab = nextTab;
1345
1365
  for (const seen of nextTab ? leaves(nextTab.root) : [next]) seen.unseen = false;
1346
1366
  }
1347
1367
  }
1348
1368
  }
1349
- removeSpace(space) {
1350
- const gone = this.entriesOf(space);
1369
+ removeWorkspace(workspace) {
1370
+ const gone = this.entriesOf(workspace);
1351
1371
  for (const entry of gone) this.removeEntry(entry);
1352
1372
  return gone;
1353
1373
  }
1354
1374
  /** Takes a tab out with its sessions. */
1355
- removeTab(space, tab) {
1375
+ removeTab(workspace, tab) {
1356
1376
  const gone = leaves(tab.root);
1357
1377
  for (const entry of gone) this.removeEntry(entry);
1358
1378
  return gone;
1359
1379
  }
1360
1380
  };
1361
1381
 
1362
- // src/spaces/selection.ts
1382
+ // src/workspaces/selection.ts
1363
1383
  function orderRange(a, b) {
1364
1384
  const forward = a.line < b.line || a.line === b.line && a.col <= b.col;
1365
1385
  return forward ? { start: a, end: b } : { start: b, end: a };
@@ -1464,7 +1484,7 @@ var ClickCounter = class {
1464
1484
  }
1465
1485
  };
1466
1486
 
1467
- // src/spaces/session.ts
1487
+ // src/workspaces/session.ts
1468
1488
  var SCROLLBACK = 2e3;
1469
1489
  var ChildSession = class {
1470
1490
  constructor(label, spec, size, onChange, kill = killProcessTree, onSignal) {
@@ -1564,24 +1584,24 @@ var ChildSession = class {
1564
1584
  }
1565
1585
  };
1566
1586
 
1567
- // src/spaces/sidebar.ts
1587
+ // src/workspaces/sidebar.ts
1568
1588
  var GLYPHS = {
1569
- blocked: "\u25CF",
1570
- done: "\u25CF",
1571
1589
  working: "\u25CF",
1572
1590
  idle: "\u25CB",
1591
+ blocked: "\u25C6",
1592
+ done: "\u2713",
1573
1593
  none: "\xB7"
1574
1594
  };
1575
1595
  function dotColor(dot, palette) {
1576
1596
  switch (dot) {
1577
1597
  case "blocked":
1578
- return palette.red;
1598
+ return palette.blocked;
1579
1599
  case "done":
1580
- return palette.teal;
1600
+ return palette.done;
1581
1601
  case "working":
1582
- return palette.yellow;
1602
+ return palette.working;
1583
1603
  case "idle":
1584
- return palette.green;
1604
+ return palette.idle;
1585
1605
  case "none":
1586
1606
  return palette.dim;
1587
1607
  }
@@ -1610,9 +1630,9 @@ function geometry(height, footLines, split, rail) {
1610
1630
  height,
1611
1631
  ruleY,
1612
1632
  headerY: void 0,
1613
- spaceTop: 0,
1614
- spaceStep: 1,
1615
- spaceCap: Math.max(0, ruleY),
1633
+ workspaceTop: 0,
1634
+ workspaceStep: 1,
1635
+ workspaceCap: Math.max(0, ruleY),
1616
1636
  footerY: void 0,
1617
1637
  agentHeaderY: void 0,
1618
1638
  agentTop: ruleY + 1,
@@ -1627,9 +1647,9 @@ function geometry(height, footLines, split, rail) {
1627
1647
  height,
1628
1648
  ruleY,
1629
1649
  headerY: 0,
1630
- spaceTop: 2,
1631
- spaceStep: 2,
1632
- spaceCap: Math.max(0, Math.floor((footerY - 2) / 2)),
1650
+ workspaceTop: 2,
1651
+ workspaceStep: 2,
1652
+ workspaceCap: Math.max(0, Math.floor((footerY - 2) / 2)),
1633
1653
  footerY,
1634
1654
  agentHeaderY: ruleY + 1,
1635
1655
  agentTop,
@@ -1646,7 +1666,9 @@ var RANK = {
1646
1666
  none: 4
1647
1667
  };
1648
1668
  function agentList(roster, order) {
1649
- const grouped = roster.spaces.flatMap((space) => space.tabs.flatMap((tab) => leaves(tab.root)));
1669
+ const grouped = roster.workspaces.flatMap(
1670
+ (workspace) => workspace.tabs.flatMap((tab) => leaves(tab.root))
1671
+ );
1650
1672
  if (order === "grouped") return grouped;
1651
1673
  return grouped.map((entry, index) => ({ entry, index })).sort(
1652
1674
  (a, b) => RANK[a.entry.dot()] - RANK[b.entry.dot()] || b.entry.changedAt - a.entry.changedAt || a.index - b.index
@@ -1666,14 +1688,14 @@ __name(within2, "within");
1666
1688
  function clampScroll(scroll, model, height, reveal = false) {
1667
1689
  const geo = geometry(height, model.foot.length, model.split, model.rail);
1668
1690
  const selected = model.roster.selected;
1669
- const space = selected ? model.roster.spaceOf(selected) : void 0;
1691
+ const workspace = selected ? model.roster.workspaceOf(selected) : void 0;
1670
1692
  const agents = agentList(model.roster, model.order);
1671
1693
  return {
1672
- spaces: within2(
1673
- scroll.spaces,
1674
- model.roster.spaces.length,
1675
- geo.spaceCap,
1676
- reveal && space ? model.roster.spaces.indexOf(space) : -1
1694
+ workspaces: within2(
1695
+ scroll.workspaces,
1696
+ model.roster.workspaces.length,
1697
+ geo.workspaceCap,
1698
+ reveal && workspace ? model.roster.workspaces.indexOf(workspace) : -1
1677
1699
  ),
1678
1700
  agents: within2(
1679
1701
  scroll.agents,
@@ -1686,7 +1708,7 @@ function clampScroll(scroll, model, height, reveal = false) {
1686
1708
  __name(clampScroll, "clampScroll");
1687
1709
  function regionAt(model, height, y) {
1688
1710
  const geo = geometry(height, model.foot.length, model.split, model.rail);
1689
- if (y < geo.ruleY) return "spaces";
1711
+ if (y < geo.ruleY) return "workspaces";
1690
1712
  if (y > geo.ruleY) return "agents";
1691
1713
  return void 0;
1692
1714
  }
@@ -1707,14 +1729,14 @@ function hitTest(model, width, height, x, y) {
1707
1729
  if (geo.agentHeaderY !== void 0 && y === geo.agentHeaderY) {
1708
1730
  return x >= width - orderLabel(model.order).length - 1 ? { kind: "order" } : void 0;
1709
1731
  }
1710
- const spaceLine = y - geo.spaceTop;
1711
- if (spaceLine >= 0 && spaceLine < geo.spaceCap * geo.spaceStep && y < geo.ruleY) {
1712
- const space = model.roster.spaces[model.scroll.spaces + Math.floor(spaceLine / geo.spaceStep)];
1713
- return space ? { kind: "space", space } : void 0;
1732
+ const workspaceLine = y - geo.workspaceTop;
1733
+ if (workspaceLine >= 0 && workspaceLine < geo.workspaceCap * geo.workspaceStep && y < geo.ruleY) {
1734
+ const workspace = model.roster.workspaces[model.scroll.workspaces + Math.floor(workspaceLine / geo.workspaceStep)];
1735
+ return workspace ? { kind: "workspace", workspace } : void 0;
1714
1736
  }
1715
1737
  const agentLine = y - geo.agentTop;
1716
- if (agentLine >= 0 && agentLine < geo.agentCap * geo.spaceStep) {
1717
- const entry = agentList(model.roster, model.order)[model.scroll.agents + Math.floor(agentLine / geo.spaceStep)];
1738
+ if (agentLine >= 0 && agentLine < geo.agentCap * geo.workspaceStep) {
1739
+ const entry = agentList(model.roster, model.order)[model.scroll.agents + Math.floor(agentLine / geo.workspaceStep)];
1718
1740
  return entry ? { kind: "agent", entry } : void 0;
1719
1741
  }
1720
1742
  return void 0;
@@ -1735,10 +1757,10 @@ function clip(text, max) {
1735
1757
  }
1736
1758
  __name(clip, "clip");
1737
1759
  function agentDetail(roster, entry, width = Number.POSITIVE_INFINITY) {
1738
- const space = roster.spaceOf(entry);
1760
+ const workspace = roster.workspaceOf(entry);
1739
1761
  const tab = roster.tabOf(entry);
1740
- const index = tab ? space.tabs.indexOf(tab) + 1 : 0;
1741
- const many = space.tabs.length > 1 && tab !== void 0;
1762
+ const index = tab ? workspace.tabs.indexOf(tab) + 1 : 0;
1763
+ const many = workspace.tabs.length > 1 && tab !== void 0;
1742
1764
  const join2 = /* @__PURE__ */ __name((parts) => parts.join(" \xB7 "), "join");
1743
1765
  const account = entry.account ? [entry.account] : [];
1744
1766
  const full = join2([...many ? [tab.name ?? `tab ${index}`] : [], entry.label, ...account]);
@@ -1760,8 +1782,8 @@ function agentWarning(entry) {
1760
1782
  __name(agentWarning, "agentWarning");
1761
1783
  function attention(roster) {
1762
1784
  let found;
1763
- for (const space of roster.spaces) {
1764
- const dot = roster.spaceDot(space);
1785
+ for (const workspace of roster.workspaces) {
1786
+ const dot = roster.workspaceDot(workspace);
1765
1787
  if (dot === "blocked") return dot;
1766
1788
  if (dot === "done") found = dot;
1767
1789
  }
@@ -1805,19 +1827,25 @@ function drawSidebar(frame, rect, model) {
1805
1827
  if (!thumb) return;
1806
1828
  for (let i = 0; i < thumb.length; i++) at(x, top2 + thumb.start + i, "\u2503", { fg: palette.dim });
1807
1829
  }, "bar");
1808
- const spaceRoom = rect.width - 3 - (roster.spaces.length > geo.spaceCap ? 1 : 0);
1830
+ const workspaceRoom = rect.width - 3 - (roster.workspaces.length > geo.workspaceCap ? 1 : 0);
1809
1831
  const agentRoom = rect.width - 3 - (agentList(roster, model.order).length > geo.agentCap ? 1 : 0);
1810
- const shown = roster.selected ? roster.spaceOf(roster.selected) : void 0;
1832
+ const shown = roster.selected ? roster.workspaceOf(roster.selected) : void 0;
1811
1833
  const agents = agentList(roster, model.order);
1812
- if (geo.headerY !== void 0) at(1, geo.headerY, "spaces", { fg: palette.dim, attrs: ATTR_BOLD });
1813
- const spaces = roster.spaces.slice(model.scroll.spaces, model.scroll.spaces + geo.spaceCap);
1814
- spaces.forEach((space, i) => {
1815
- const y = geo.spaceTop + i * geo.spaceStep;
1816
- const index = model.scroll.spaces + i;
1817
- const focused = space === shown;
1818
- const dot = roster.spaceDot(space);
1834
+ if (geo.headerY !== void 0)
1835
+ at(1, geo.headerY, "workspaces", { fg: palette.text, attrs: ATTR_BOLD });
1836
+ const reversed = [];
1837
+ const workspaces = roster.workspaces.slice(
1838
+ model.scroll.workspaces,
1839
+ model.scroll.workspaces + geo.workspaceCap
1840
+ );
1841
+ workspaces.forEach((workspace, i) => {
1842
+ const y = geo.workspaceTop + i * geo.workspaceStep;
1843
+ const index = model.scroll.workspaces + i;
1844
+ const focused = workspace === shown;
1845
+ const dot = roster.workspaceDot(workspace);
1819
1846
  const bg = focused ? navigating ? palette.cursorRow : palette.activeRow : -1;
1820
- tint(y, geo.spaceStep, bg);
1847
+ tint(y, geo.workspaceStep, bg);
1848
+ if (palette.mono && focused && navigating) reversed.push([y, geo.workspaceStep]);
1821
1849
  if (geo.rail) {
1822
1850
  at(0, y, railIndex(index), { fg: palette.dim, bg });
1823
1851
  at(2, y, GLYPHS[dot], {
@@ -1828,41 +1856,48 @@ function drawSidebar(frame, rect, model) {
1828
1856
  return;
1829
1857
  }
1830
1858
  at(1, y, GLYPHS[dot], { fg: dotColor(dot, palette), bg });
1831
- at(3, y, clip(space.name, spaceRoom), {
1859
+ at(3, y, clip(workspace.name, workspaceRoom), {
1832
1860
  fg: focused ? palette.text : palette.subtext,
1833
1861
  bg,
1834
1862
  ...focused ? { attrs: ATTR_BOLD } : {}
1835
1863
  });
1836
- const note = spaceNote(dot);
1864
+ const note = workspaceNote(dot);
1837
1865
  if (note) {
1838
- at(3, y + 1, clip(note, spaceRoom), {
1839
- fg: dot === "blocked" ? palette.red : palette.teal,
1866
+ at(3, y + 1, clip(note, workspaceRoom), {
1867
+ fg: dot === "blocked" ? palette.blocked : palette.done,
1840
1868
  bg
1841
1869
  });
1842
1870
  return;
1843
1871
  }
1844
- const git = model.git(space.cwd);
1872
+ const git = model.git(workspace.cwd);
1845
1873
  if (!git) return;
1846
1874
  const counts = [];
1847
- if (git.ahead > 0) counts.push({ text: `\u2191${git.ahead}`, fg: palette.green });
1848
- if (git.behind > 0) counts.push({ text: `\u2193${git.behind}`, fg: palette.red });
1875
+ if (git.ahead > 0) counts.push({ text: `\u2191${git.ahead}`, fg: palette.ahead });
1876
+ if (git.behind > 0) counts.push({ text: `\u2193${git.behind}`, fg: palette.behind });
1849
1877
  const tail = counts.reduce((sum, c) => sum + 1 + c.text.length, 0);
1850
- const branch = clip(git.branch, spaceRoom - tail);
1851
- at(3, y + 1, branch, { fg: focused ? palette.mauve : palette.dim, bg });
1878
+ const branch = clip(git.branch, workspaceRoom - tail);
1879
+ at(3, y + 1, branch, { fg: palette.branch, bg });
1852
1880
  let x = 3 + stringWidth(branch);
1853
1881
  for (const c of counts) {
1854
1882
  at(x + 1, y + 1, c.text, { fg: c.fg, bg });
1855
1883
  x += 1 + c.text.length;
1856
1884
  }
1857
1885
  });
1886
+ for (const [top2, rows] of reversed)
1887
+ for (let row = 0; row < rows; row++)
1888
+ for (let x = 0; x < rect.width; x++) {
1889
+ const cell = frame.cellAt(rect.x + x, rect.y + top2 + row);
1890
+ if (cell)
1891
+ frame.set(rect.x + x, rect.y + top2 + row, { ...cell, attrs: cell.attrs | ATTR_INVERSE });
1892
+ }
1858
1893
  if (!geo.rail)
1859
1894
  bar(
1860
1895
  rect.width - 1,
1861
- geo.spaceTop,
1862
- geo.spaceCap * geo.spaceStep,
1863
- roster.spaces.length,
1864
- geo.spaceCap,
1865
- model.scroll.spaces
1896
+ geo.workspaceTop,
1897
+ geo.workspaceCap * geo.workspaceStep,
1898
+ roster.workspaces.length,
1899
+ geo.workspaceCap,
1900
+ model.scroll.workspaces
1866
1901
  );
1867
1902
  if (geo.footerY !== void 0) {
1868
1903
  at(1, geo.footerY, "new", { fg: palette.dim });
@@ -1882,12 +1917,12 @@ function drawSidebar(frame, rect, model) {
1882
1917
  }
1883
1918
  const visible = agents.slice(model.scroll.agents, model.scroll.agents + geo.agentCap);
1884
1919
  visible.forEach((entry, i) => {
1885
- const y = geo.agentTop + i * geo.spaceStep;
1920
+ const y = geo.agentTop + i * geo.workspaceStep;
1886
1921
  const index = model.scroll.agents + i;
1887
1922
  const focused = entry === roster.selected;
1888
1923
  const dot = entry.dot();
1889
1924
  const bg = focused ? palette.activeRow : -1;
1890
- tint(y, geo.spaceStep, bg);
1925
+ tint(y, geo.workspaceStep, bg);
1891
1926
  if (geo.rail) {
1892
1927
  at(0, y, railIndex(index), { fg: palette.dim, bg });
1893
1928
  at(2, y, GLYPHS[dot], {
@@ -1899,14 +1934,14 @@ function drawSidebar(frame, rect, model) {
1899
1934
  }
1900
1935
  at(1, y, GLYPHS[dot], { fg: dotColor(dot, palette), bg });
1901
1936
  const gone = entry.child?.status === "exited";
1902
- at(3, y, clip(roster.spaceOf(entry).name, agentRoom), {
1937
+ at(3, y, clip(roster.workspaceOf(entry).name, agentRoom), {
1903
1938
  fg: gone ? palette.dim : focused ? palette.text : palette.subtext,
1904
1939
  bg,
1905
1940
  attrs: ATTR_BOLD
1906
1941
  });
1907
1942
  const warning = agentWarning(entry);
1908
1943
  at(3, y + 1, clip(warning ?? agentDetail(roster, entry, agentRoom), agentRoom), {
1909
- fg: warning ? palette.yellow : palette.dim,
1944
+ fg: warning ? palette.warn : palette.dim,
1910
1945
  bg
1911
1946
  });
1912
1947
  });
@@ -1914,7 +1949,7 @@ function drawSidebar(frame, rect, model) {
1914
1949
  bar(
1915
1950
  rect.width - 1,
1916
1951
  geo.agentTop,
1917
- geo.agentCap * geo.spaceStep,
1952
+ geo.agentCap * geo.workspaceStep,
1918
1953
  agents.length,
1919
1954
  geo.agentCap,
1920
1955
  model.scroll.agents
@@ -1941,71 +1976,141 @@ function endedMessage(ending, prefixName) {
1941
1976
  }
1942
1977
  __name(endedMessage, "endedMessage");
1943
1978
 
1944
- // src/spaces/tabbar.ts
1979
+ // src/workspaces/tabbar.ts
1945
1980
  var MIN_TAB_WIDTH = 8;
1946
1981
  var NEW_TAB_WIDTH = 3;
1982
+ var CUE_WIDTH = 2;
1947
1983
  function tabLabel(tab, index) {
1948
1984
  const base = tab.name ?? String(index + 1);
1949
1985
  return tab.zoomed ? `${base} Z` : base;
1950
1986
  }
1951
1987
  __name(tabLabel, "tabLabel");
1952
- function layoutTabBar(space, area) {
1953
- const widths = space.tabs.map(
1954
- (tab, i) => Math.max(MIN_TAB_WIDTH, stringWidth(tabLabel(tab, i)) + 4)
1988
+ function ellipsize(text, max) {
1989
+ if (max <= 0) return "";
1990
+ if (stringWidth(text) <= max) return text;
1991
+ let out = "";
1992
+ let used = 0;
1993
+ for (const ch of text) {
1994
+ const w = stringWidth(ch);
1995
+ if (used + w > max - 1) break;
1996
+ out += ch;
1997
+ used += w;
1998
+ }
1999
+ return `${out}\u2026`;
2000
+ }
2001
+ __name(ellipsize, "ellipsize");
2002
+ function visibleSpan(widths, active, room) {
2003
+ let first = active;
2004
+ let last = active;
2005
+ let used = Math.min(widths[active], room);
2006
+ for (let grew = true; grew; ) {
2007
+ grew = false;
2008
+ const next = widths[last + 1];
2009
+ if (next !== void 0 && used + 1 + next <= room) {
2010
+ last++;
2011
+ used += 1 + next;
2012
+ grew = true;
2013
+ }
2014
+ const before = widths[first - 1];
2015
+ if (before !== void 0 && used + 1 + before <= room) {
2016
+ first--;
2017
+ used += 1 + before;
2018
+ grew = true;
2019
+ }
2020
+ }
2021
+ return { first, last };
2022
+ }
2023
+ __name(visibleSpan, "visibleSpan");
2024
+ function layoutTabBar(workspace, area) {
2025
+ const count = workspace.tabs.length;
2026
+ const widths = workspace.tabs.map(
2027
+ (tab, i) => Math.max(MIN_TAB_WIDTH, stringWidth(tabLabel(tab, i)) + 2)
1955
2028
  );
1956
- const room = Math.max(0, area.width - NEW_TAB_WIDTH);
1957
- const active = space.activeTab ? space.tabs.indexOf(space.activeTab) : -1;
1958
- const span = /* @__PURE__ */ __name((from, to) => widths.slice(from, to + 1).reduce((sum, w) => sum + w + 1, -1), "span");
2029
+ const hasPlus = area.width >= NEW_TAB_WIDTH;
2030
+ const room = Math.max(0, area.width - (hasPlus ? NEW_TAB_WIDTH : 0));
2031
+ const activeIndex = workspace.activeTab ? workspace.tabs.indexOf(workspace.activeTab) : -1;
2032
+ const row = /* @__PURE__ */ __name((x2, width) => ({ x: x2, y: area.y, width, height: 1 }), "row");
2033
+ const whole = widths.reduce((sum, w) => sum + w + 1, -1);
1959
2034
  let first = 0;
1960
- while (first < active && span(first, active) > room) first++;
2035
+ let last = count - 1;
2036
+ let needLeft = false;
2037
+ let needRight = false;
2038
+ let chipRoom = room;
2039
+ if (whole > room && count > 0) {
2040
+ for (let pass = 0; pass < 3; pass++) {
2041
+ chipRoom = Math.max(0, room - (needLeft ? CUE_WIDTH : 0) - (needRight ? CUE_WIDTH : 0));
2042
+ const span = visibleSpan(widths, Math.max(0, activeIndex), chipRoom);
2043
+ first = span.first;
2044
+ last = span.last;
2045
+ const left = first > 0;
2046
+ const right = last < count - 1;
2047
+ if (left === needLeft && right === needRight) break;
2048
+ needLeft = left;
2049
+ needRight = right;
2050
+ }
2051
+ }
1961
2052
  const chips = [];
1962
- let x = area.x;
1963
- for (let i = first; i < space.tabs.length; i++) {
1964
- const width = widths[i];
1965
- if (x + width > area.x + room) break;
1966
- const tab = space.tabs[i];
2053
+ let x = area.x + (needLeft ? CUE_WIDTH : 0);
2054
+ const stop = x + chipRoom;
2055
+ for (let i = first; i <= last && chipRoom > 0; i++) {
2056
+ const tab = workspace.tabs[i];
2057
+ const width = Math.min(widths[i], stop - x);
2058
+ if (width <= 0) break;
1967
2059
  chips.push({
1968
2060
  tab,
1969
- rect: { x, y: area.y, width, height: 1 },
1970
- label: tabLabel(tab, i),
1971
- active: tab === space.activeTab
2061
+ rect: row(x, width),
2062
+ label: ellipsize(tabLabel(tab, i), width - 2),
2063
+ active: tab === workspace.activeTab
1972
2064
  });
1973
2065
  x += width + 1;
1974
2066
  }
1975
- const plusX = Math.min(x, area.x + area.width - NEW_TAB_WIDTH);
1976
- const plus = area.width >= NEW_TAB_WIDTH ? { x: plusX, y: area.y, width: NEW_TAB_WIDTH, height: 1 } : void 0;
1977
- return { chips, plus };
2067
+ const overflowing = needLeft || needRight;
2068
+ const plusX = overflowing ? area.x + area.width - NEW_TAB_WIDTH : Math.min(x, area.x + area.width - NEW_TAB_WIDTH);
2069
+ return {
2070
+ chips,
2071
+ plus: hasPlus ? row(plusX, NEW_TAB_WIDTH) : void 0,
2072
+ left: needLeft ? row(area.x, CUE_WIDTH) : void 0,
2073
+ right: needRight ? row(plusX - CUE_WIDTH, CUE_WIDTH) : void 0
2074
+ };
1978
2075
  }
1979
2076
  __name(layoutTabBar, "layoutTabBar");
1980
- function drawTabBar(frame, area, space, palette) {
1981
- frame.fillRect(area, { bg: palette.panelBg });
1982
- const bar = layoutTabBar(space, area);
2077
+ function drawTabBar(frame, area, workspace, palette) {
2078
+ frame.fillRect(area, { bg: palette.base });
2079
+ const bar = layoutTabBar(workspace, area);
1983
2080
  for (const chip of bar.chips) {
1984
- const style = chip.active ? {
1985
- fg: palette.panelBg,
1986
- bg: palette.accent,
1987
- ...chip.tab.name ? { attrs: ATTR_BOLD } : {}
1988
- } : { fg: palette.tabRest, bg: palette.surface };
2081
+ const style = chip.active ? palette.mono ? { attrs: ATTR_BOLD | ATTR_INVERSE } : { fg: palette.ink, bg: palette.accent, attrs: ATTR_BOLD } : { fg: palette.dim };
1989
2082
  frame.fillRect(chip.rect, style);
1990
2083
  const pad = Math.max(0, chip.rect.width - stringWidth(chip.label));
1991
2084
  frame.writeText(chip.rect, 0, `${" ".repeat(Math.floor(pad / 2))}${chip.label}`, style);
1992
2085
  }
1993
- if (bar.plus)
1994
- frame.writeText(bar.plus, 0, " + ", {
1995
- fg: palette.dimmer,
1996
- bg: palette.panelBg
1997
- });
2086
+ const cue = { fg: palette.accent, attrs: ATTR_BOLD };
2087
+ if (bar.left) frame.writeText(bar.left, 0, "\u2039", cue);
2088
+ if (bar.right) frame.writeText(bar.right, 0, "\u203A", cue);
2089
+ if (bar.plus) frame.writeText(bar.plus, 0, " + ", { fg: palette.dim });
2090
+ if (area.height < TAB_BAR_HEIGHT) return;
2091
+ const rule = { ...area, y: area.y + 1, height: 1 };
2092
+ frame.writeText(rule, 0, "\u2500".repeat(area.width), { fg: palette.border });
2093
+ const active = bar.chips.find((chip) => chip.active);
2094
+ if (active)
2095
+ frame.writeText(
2096
+ { ...rule, x: active.rect.x, width: active.rect.width },
2097
+ 0,
2098
+ "\u2501".repeat(active.rect.width),
2099
+ { fg: palette.accent }
2100
+ );
1998
2101
  }
1999
2102
  __name(drawTabBar, "drawTabBar");
2000
2103
  function tabBarTarget(bar, x, y) {
2001
2104
  const inside = /* @__PURE__ */ __name((r) => y === r.y && x >= r.x && x < r.x + r.width, "inside");
2002
2105
  for (const chip of bar.chips) if (inside(chip.rect)) return { kind: "tab", tab: chip.tab };
2003
2106
  if (bar.plus && inside(bar.plus)) return { kind: "new" };
2107
+ if (bar.left && inside(bar.left)) return { kind: "previous" };
2108
+ if (bar.right && inside(bar.right)) return { kind: "next" };
2004
2109
  return void 0;
2005
2110
  }
2006
2111
  __name(tabBarTarget, "tabBarTarget");
2007
2112
 
2008
- // src/spaces/host.ts
2113
+ // src/workspaces/host.ts
2009
2114
  var ENDING_SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
2010
2115
  var realSignalHooks = {
2011
2116
  on: /* @__PURE__ */ __name((signal, listener) => void process.on(signal, listener), "on"),
@@ -2033,10 +2138,14 @@ var WHEEL_ROWS = 3;
2033
2138
  var MAX_PAINT_FAILURES = 3;
2034
2139
  var MENU_ITEMS = ["accounts", "add account", "sidebar", "keybinds", "quit"];
2035
2140
  var CONTEXT_ITEMS = {
2036
- space: ["Rename", "New tab", "Close"],
2141
+ workspace: ["Rename", "New tab", "Close"],
2037
2142
  tab: ["Rename", "Close"],
2038
2143
  pane: ["Rename", "Split right", "Split down", "Zoom", "Close"]
2039
2144
  };
2145
+ function inRect(rect, x, y) {
2146
+ return x >= rect.x && x < rect.x + rect.width && y >= rect.y && y < rect.y + rect.height;
2147
+ }
2148
+ __name(inRect, "inRect");
2040
2149
  function defaultIsDirectory(path) {
2041
2150
  try {
2042
2151
  return existsSync(path) && statSync(path).isDirectory();
@@ -2045,13 +2154,12 @@ function defaultIsDirectory(path) {
2045
2154
  }
2046
2155
  }
2047
2156
  __name(defaultIsDirectory, "defaultIsDirectory");
2048
- var SpacesHost = class {
2157
+ var WorkspacesHost = class {
2049
2158
  constructor(options) {
2050
2159
  this.options = options;
2051
2160
  this.router = new InputRouter(options.prefix);
2052
2161
  this.schedule = options.schedule ?? realSchedule;
2053
2162
  this.clicks = new ClickCounter(options.now ?? Date.now, DOUBLE_CLICK_MS);
2054
- this.palette = paletteFor(options.truecolor ?? advertisesTruecolor(process.env));
2055
2163
  this.git = new GitCache(
2056
2164
  options.git ?? gitLookup,
2057
2165
  () => this.requestRender(),
@@ -2070,14 +2178,14 @@ var SpacesHost = class {
2070
2178
  }
2071
2179
  options;
2072
2180
  static {
2073
- __name(this, "SpacesHost");
2181
+ __name(this, "WorkspacesHost");
2074
2182
  }
2075
2183
  roster = new Roster();
2076
2184
  sidebar = DEFAULT_SIDEBAR;
2077
2185
  split = 0.5;
2078
2186
  order = "grouped";
2079
2187
  menu;
2080
- sidebarScroll = { spaces: 0, agents: 0 };
2188
+ sidebarScroll = { workspaces: 0, agents: 0 };
2081
2189
  sidebarDrag;
2082
2190
  lastEdgePress;
2083
2191
  git;
@@ -2090,7 +2198,7 @@ var SpacesHost = class {
2090
2198
  goto;
2091
2199
  accountList;
2092
2200
  context;
2093
- /** A space being dragged in the sidebar, and the place it would land. */
2201
+ /** A workspace being dragged in the sidebar, and the place it would land. */
2094
2202
  reorder;
2095
2203
  cancelSave;
2096
2204
  forgetAll = false;
@@ -2109,7 +2217,7 @@ var SpacesHost = class {
2109
2217
  closed = false;
2110
2218
  /** True while the real terminal belongs to the local session and nothing of the host is drawn. */
2111
2219
  hidden = false;
2112
- /** `split` is the spaces screen; `full` draws the selected child alone on the whole terminal. */
2220
+ /** `split` is the workspaces screen; `full` draws the selected child alone on the whole terminal. */
2113
2221
  view = "split";
2114
2222
  localEntry;
2115
2223
  quitting = false;
@@ -2122,7 +2230,7 @@ var SpacesHost = class {
2122
2230
  stopWatching;
2123
2231
  reconciling = false;
2124
2232
  leaving = [];
2125
- palette;
2233
+ paletteCache;
2126
2234
  /** A border being dragged: the split it moves and where on the border it was grabbed. */
2127
2235
  drag;
2128
2236
  router;
@@ -2189,6 +2297,16 @@ var SpacesHost = class {
2189
2297
  }
2190
2298
  }
2191
2299
  }, "onProcessExit");
2300
+ /** The chrome's colours, from the theme showing now: a theme switched in the TUI restyles the screen at its next frame. */
2301
+ get palette() {
2302
+ const level = this.options.colors ?? colorLevel(process.env);
2303
+ const theme = activeThemeName();
2304
+ const cached = this.paletteCache;
2305
+ if (cached && cached.level === level && cached.theme === theme) return cached.palette;
2306
+ const palette = paletteFor(level);
2307
+ this.paletteCache = { level, theme, palette };
2308
+ return palette;
2309
+ }
2192
2310
  start() {
2193
2311
  const { input, output, local } = this.options;
2194
2312
  if (!local) output.write(enterScreen(this.mouseMode));
@@ -2207,20 +2325,20 @@ var SpacesHost = class {
2207
2325
  this.requestRender();
2208
2326
  }
2209
2327
  /**
2210
- * Brings back the saved spaces and makes the running conversation one of the
2328
+ * Brings back the saved workspaces and makes the running conversation one of the
2211
2329
  * panes: the one that carries its conversation id, or else a new tab in the
2212
- * space of its folder. Nothing else is started here.
2330
+ * workspace of its folder. Nothing else is started here.
2213
2331
  */
2214
2332
  seedLocal(local) {
2215
2333
  const layout = this.options.restored;
2216
- if (layout) this.restoreSpaces(layout);
2334
+ if (layout) this.restoreWorkspaces(layout);
2217
2335
  const id = local.conversationId();
2218
2336
  const carried = id ? this.roster.entries.find((e) => (e.conversationId ?? e.resume) === id) : void 0;
2219
2337
  let entry = carried;
2220
2338
  if (!entry) {
2221
2339
  const { cwd, name } = this.options.folder;
2222
- const space = this.roster.spaces.find((s) => s.cwd === cwd) ?? this.roster.addSpace(cwd, name);
2223
- entry = this.newTabIn(space);
2340
+ const workspace = this.roster.workspaces.find((s) => s.cwd === cwd) ?? this.roster.addWorkspace(cwd, name);
2341
+ entry = this.newTabIn(workspace);
2224
2342
  }
2225
2343
  entry.child = local.session;
2226
2344
  this.watchClipboard(local.session.screen);
@@ -2238,12 +2356,12 @@ var SpacesHost = class {
2238
2356
  this.roster.update(entry);
2239
2357
  this.persist();
2240
2358
  }
2241
- /** True while the spaces screen is on the terminal. */
2359
+ /** True while the workspaces screen is on the terminal. */
2242
2360
  get visible() {
2243
2361
  return !this.hidden && !this.closed;
2244
2362
  }
2245
- /** Puts the spaces screen up, with the running conversation selected and the keyboard on the sidebar. */
2246
- openSpaces() {
2363
+ /** Puts the workspaces screen up, with the running conversation selected and the keyboard on the sidebar. */
2364
+ openWorkspaces() {
2247
2365
  const entry = this.localEntry;
2248
2366
  if (this.closed || !entry) return;
2249
2367
  if (this.hidden) {
@@ -2283,7 +2401,7 @@ var SpacesHost = class {
2283
2401
  /**
2284
2402
  * The conversation is about to unmount: gives the main screen back and has the conversation print
2285
2403
  * its whole history there, so Ink's last frame lands on a screen that is already right. True when
2286
- * the spaces screen was up and has been left.
2404
+ * the workspaces screen was up and has been left.
2287
2405
  */
2288
2406
  releaseTerminal() {
2289
2407
  if (this.closed || this.hidden || !this.localEntry || !this.options.local) return false;
@@ -2292,8 +2410,8 @@ var SpacesHost = class {
2292
2410
  }
2293
2411
  /**
2294
2412
  * Runs `run` with the terminal handed back to the real shell (an editor, a pager): the pointer is
2295
- * switched off and the main screen returns first, and the spaces screen is entered again afterwards
2296
- * even if `run` throws. Nothing happens around `run` when the spaces screen is not on the terminal.
2413
+ * switched off and the main screen returns first, and the workspaces screen is entered again afterwards
2414
+ * even if `run` throws. Nothing happens around `run` when the workspaces screen is not on the terminal.
2297
2415
  */
2298
2416
  async withTerminalHandoff(run2) {
2299
2417
  if (this.closed || this.hidden) return await run2();
@@ -2309,7 +2427,7 @@ var SpacesHost = class {
2309
2427
  }
2310
2428
  }
2311
2429
  }
2312
- /** Moves the keyboard from a pane to the sidebar of the spaces screen. */
2430
+ /** Moves the keyboard from a pane to the sidebar of the workspaces screen. */
2313
2431
  focusSidebar() {
2314
2432
  if (this.closed || this.hidden || this.view === "full") return;
2315
2433
  this.router.enterNavigate();
@@ -2333,46 +2451,46 @@ var SpacesHost = class {
2333
2451
  }
2334
2452
  }
2335
2453
  // --- sessions --------------------------------------------------------------
2336
- /** The first run: the current folder as a space with the session the command started. */
2454
+ /** The first run: the current folder as a workspace with the session the command started. */
2337
2455
  fresh() {
2338
- const space = this.roster.addSpace(this.options.folder.cwd, this.options.folder.name);
2339
- const entry = this.newTabIn(space);
2456
+ const workspace = this.roster.addWorkspace(this.options.folder.cwd, this.options.folder.name);
2457
+ const entry = this.newTabIn(workspace);
2340
2458
  entry.first = true;
2341
2459
  for (const listed of this.options.listed ?? []) {
2342
- const other = this.roster.addSpace(listed.cwd, listed.name);
2460
+ const other = this.roster.addWorkspace(listed.cwd, listed.name);
2343
2461
  for (let i = 0; i < listed.sessions; i++) this.newTabIn(other);
2344
2462
  }
2345
2463
  return entry;
2346
2464
  }
2347
2465
  /**
2348
- * Brings back the previous run's spaces, tabs and panes, none of them started.
2466
+ * Brings back the previous run's workspaces, tabs and panes, none of them started.
2349
2467
  * The one shown is where focus was, unless the command carries its own options
2350
2468
  * or its folder is new, which start a fresh session of their own.
2351
2469
  */
2352
2470
  restore(layout) {
2353
- this.restoreSpaces(layout);
2354
- const folder = this.roster.spaces.find((s) => s.cwd === this.options.folder.cwd);
2471
+ this.restoreWorkspaces(layout);
2472
+ const folder = this.roster.workspaces.find((s) => s.cwd === this.options.folder.cwd);
2355
2473
  if (this.options.freshFirst || !folder) {
2356
- const space = folder ?? this.roster.addSpace(this.options.folder.cwd, this.options.folder.name);
2357
- const entry = this.newTabIn(space);
2474
+ const workspace = folder ?? this.roster.addWorkspace(this.options.folder.cwd, this.options.folder.name);
2475
+ const entry = this.newTabIn(workspace);
2358
2476
  entry.first = true;
2359
2477
  return entry;
2360
2478
  }
2361
- const focused = layout.focus !== void 0 ? this.roster.spaces[layout.focus.space]?.activeTab?.focus : void 0;
2479
+ const focused = layout.focus !== void 0 ? this.roster.workspaces[layout.focus.workspace]?.activeTab?.focus : void 0;
2362
2480
  return focused ?? folder.activeTab?.focus ?? this.newTabIn(folder);
2363
2481
  }
2364
- restoreSpaces(layout) {
2482
+ restoreWorkspaces(layout) {
2365
2483
  const isDirectory = this.options.isDirectory ?? defaultIsDirectory;
2366
- for (const saved of layout.spaces) {
2367
- const space = this.roster.addSpace(saved.cwd, saved.name);
2484
+ for (const saved of layout.workspaces) {
2485
+ const workspace = this.roster.addWorkspace(saved.cwd, saved.name);
2368
2486
  const found = isDirectory(saved.cwd);
2369
- if (saved.lastAccount) space.lastAccount = saved.lastAccount;
2370
- for (const savedTab of saved.tabs) this.restoreTab(space, savedTab, found);
2371
- const active = saved.activeTab !== void 0 ? space.tabs[saved.activeTab] : void 0;
2372
- space.activeTab = active ?? space.tabs[0];
2487
+ if (saved.lastAccount) workspace.lastAccount = saved.lastAccount;
2488
+ for (const savedTab of saved.tabs) this.restoreTab(workspace, savedTab, found);
2489
+ const active = saved.activeTab !== void 0 ? workspace.tabs[saved.activeTab] : void 0;
2490
+ workspace.activeTab = active ?? workspace.tabs[0];
2373
2491
  }
2374
2492
  }
2375
- restoreTab(space, saved, found) {
2493
+ restoreTab(workspace, saved, found) {
2376
2494
  const build = /* @__PURE__ */ __name((node) => {
2377
2495
  if (!("session" in node))
2378
2496
  return {
@@ -2383,7 +2501,7 @@ var SpacesHost = class {
2383
2501
  b: build(node.b)
2384
2502
  };
2385
2503
  const item = node.session;
2386
- const entry = this.addEntry(space, item.label);
2504
+ const entry = this.addEntry(workspace, item.label);
2387
2505
  if (item.conversationId) {
2388
2506
  entry.conversationId = item.conversationId;
2389
2507
  entry.resume = item.conversationId;
@@ -2397,22 +2515,22 @@ var SpacesHost = class {
2397
2515
  const root = build(saved.tree);
2398
2516
  const panes = leaves(root);
2399
2517
  this.roster.addTree(
2400
- space,
2518
+ workspace,
2401
2519
  root,
2402
2520
  panes[saved.focus ?? 0] ?? panes[0],
2403
2521
  saved.name,
2404
2522
  saved.zoomed === true
2405
2523
  );
2406
2524
  }
2407
- addEntry(space, label) {
2408
- const entry = this.roster.addSession(space, this.options.newSlot?.() ?? randomUUID(), label);
2525
+ addEntry(workspace, label) {
2526
+ const entry = this.roster.addSession(workspace, this.options.newSlot?.() ?? randomUUID(), label);
2409
2527
  this.persist();
2410
2528
  return entry;
2411
2529
  }
2412
- /** A session in a tab of its own, after the space's other tabs. */
2413
- newTabIn(space) {
2414
- const entry = this.addEntry(space);
2415
- this.roster.addTab(space, entry);
2530
+ /** A session in a tab of its own, after the workspace's other tabs. */
2531
+ newTabIn(workspace) {
2532
+ const entry = this.addEntry(workspace);
2533
+ this.roster.addTab(workspace, entry);
2416
2534
  return entry;
2417
2535
  }
2418
2536
  layout() {
@@ -2424,7 +2542,7 @@ var SpacesHost = class {
2424
2542
  rail: false,
2425
2543
  rule: void 0,
2426
2544
  main: whole,
2427
- tabBar: { ...whole, height: 1 },
2545
+ tabBar: void 0,
2428
2546
  panes: whole
2429
2547
  };
2430
2548
  }
@@ -2473,7 +2591,9 @@ var SpacesHost = class {
2473
2591
  ensureStarted(entry) {
2474
2592
  if (entry.child || this.closed || entry.checking) return;
2475
2593
  if (entry.verifyFolder) {
2476
- const found = (this.options.isDirectory ?? defaultIsDirectory)(this.roster.spaceOf(entry).cwd);
2594
+ const found = (this.options.isDirectory ?? defaultIsDirectory)(
2595
+ this.roster.workspaceOf(entry).cwd
2596
+ );
2477
2597
  if (entry.folderMissing === found) {
2478
2598
  entry.folderMissing = !found;
2479
2599
  this.requestRender();
@@ -2483,8 +2603,8 @@ var SpacesHost = class {
2483
2603
  const guard = this.options.inUseElsewhere;
2484
2604
  if (entry.resume && guard) {
2485
2605
  entry.checking = true;
2486
- const space = this.roster.spaceOf(entry);
2487
- void guard({ cwd: space.cwd, conversationId: entry.resume }).catch(() => false).then((busy) => {
2606
+ const workspace = this.roster.workspaceOf(entry);
2607
+ void guard({ cwd: workspace.cwd, conversationId: entry.resume }).catch(() => false).then((busy) => {
2488
2608
  entry.checking = false;
2489
2609
  if (this.closed || !this.roster.entries.includes(entry)) return;
2490
2610
  entry.openElsewhere = busy;
@@ -2498,9 +2618,9 @@ var SpacesHost = class {
2498
2618
  }
2499
2619
  spawn(entry) {
2500
2620
  if (entry.child || this.closed) return;
2501
- const space = this.roster.spaceOf(entry);
2621
+ const workspace = this.roster.workspaceOf(entry);
2502
2622
  const spec = this.options.spec({
2503
- cwd: space.cwd,
2623
+ cwd: workspace.cwd,
2504
2624
  slot: entry.slot,
2505
2625
  first: entry.first,
2506
2626
  ...entry.pickedAccount ? { account: entry.pickedAccount } : {},
@@ -2534,7 +2654,7 @@ var SpacesHost = class {
2534
2654
  show(entry) {
2535
2655
  if (this.view === "full" && entry.child?.local) this.view = "split";
2536
2656
  this.roster.select(entry);
2537
- if (this.gitStarted) this.git.refresh(this.roster.spaceOf(entry).cwd, GIT_STALE_MS);
2657
+ if (this.gitStarted) this.git.refresh(this.roster.workspaceOf(entry).cwd, GIT_STALE_MS);
2538
2658
  this.fit();
2539
2659
  this.revealSelected();
2540
2660
  this.persist();
@@ -2618,14 +2738,14 @@ var SpacesHost = class {
2618
2738
  this.requestRender();
2619
2739
  }
2620
2740
  }
2621
- /** A session that moved to another account makes that account the one its space offers first. */
2741
+ /** A session that moved to another account makes that account the one its workspace offers first. */
2622
2742
  rememberAccount(entry, label) {
2623
- const space = this.roster.spaceOf(entry);
2743
+ const workspace = this.roster.workspaceOf(entry);
2624
2744
  const matches = (this.options.accounts?.() ?? []).filter((a) => a.label === label);
2625
2745
  const found = label !== void 0 && matches.length === 1 ? matches[0] : void 0;
2626
2746
  entry.pickedAccount = found?.id;
2627
- if (label === void 0) delete space.lastAccount;
2628
- else if (found) space.lastAccount = found.id;
2747
+ if (label === void 0) delete workspace.lastAccount;
2748
+ else if (found) workspace.lastAccount = found.id;
2629
2749
  }
2630
2750
  /** Asks each terminal its state directly, so a change that was never written is still seen. */
2631
2751
  async reconcile() {
@@ -2725,20 +2845,20 @@ var SpacesHost = class {
2725
2845
  case "quit":
2726
2846
  this.askQuit();
2727
2847
  return;
2728
- case "new-space":
2729
- this.prompt = { kind: "new-space", value: this.roster.spaceOf(entry).cwd };
2848
+ case "new-workspace":
2849
+ this.prompt = { kind: "new-workspace", value: this.roster.workspaceOf(entry).cwd };
2730
2850
  return;
2731
2851
  case "open-folder":
2732
2852
  this.askFolder();
2733
2853
  return;
2734
- case "rename-space":
2735
- this.askName("rename-space", this.roster.spaceOf(entry).name);
2854
+ case "rename-workspace":
2855
+ this.askName("rename-workspace", this.roster.workspaceOf(entry).name);
2736
2856
  return;
2737
- case "close-space":
2738
- this.confirm = "close-space";
2857
+ case "close-workspace":
2858
+ this.confirm = "close-workspace";
2739
2859
  return;
2740
2860
  // The router starts these two modes itself; there is nothing more to do.
2741
- case "space-mode":
2861
+ case "workspace-mode":
2742
2862
  case "resize-mode":
2743
2863
  return;
2744
2864
  case "sidebar":
@@ -2819,7 +2939,7 @@ var SpacesHost = class {
2819
2939
  }
2820
2940
  /**
2821
2941
  * The running conversation is about to end (`/exit`, ctrl+c twice). With no other session
2822
- * mid-turn it may go at once; otherwise the spaces screen comes up with the quit question
2942
+ * mid-turn it may go at once; otherwise the workspaces screen comes up with the quit question
2823
2943
  * and the answer decides.
2824
2944
  */
2825
2945
  askLocalExit() {
@@ -2831,7 +2951,7 @@ var SpacesHost = class {
2831
2951
  if (this.closed || this.quitting || !this.localEntry || !busy) return Promise.resolve(true);
2832
2952
  this.exitGate?.(false);
2833
2953
  return new Promise((resolve2) => {
2834
- if (this.hidden) this.openSpaces();
2954
+ if (this.hidden) this.openWorkspaces();
2835
2955
  else this.dismiss();
2836
2956
  this.exitGate = resolve2;
2837
2957
  this.confirm = "quit";
@@ -2848,17 +2968,17 @@ var SpacesHost = class {
2848
2968
  this.relayout();
2849
2969
  this.persist();
2850
2970
  }
2851
- /** A space in the focused pane's folder, started on the same account. */
2852
- newSpaceHere() {
2971
+ /** A workspace in the focused pane's folder, started on the same account. */
2972
+ newWorkspaceHere() {
2853
2973
  const entry = this.roster.selected;
2854
- const cwd = entry ? this.roster.spaceOf(entry).cwd : this.options.folder.cwd;
2855
- this.newSpaceIn(cwd);
2974
+ const cwd = entry ? this.roster.workspaceOf(entry).cwd : this.options.folder.cwd;
2975
+ this.newWorkspaceIn(cwd);
2856
2976
  }
2857
- /** A new space in a folder, its first session on the account the focused pane runs on. */
2858
- newSpaceIn(cwd) {
2977
+ /** A new workspace in a folder, its first session on the account the focused pane runs on. */
2978
+ newWorkspaceIn(cwd) {
2859
2979
  const entry = this.roster.selected;
2860
- const space = this.roster.addSpace(cwd, basename(cwd) || cwd);
2861
- const created = this.newTabIn(space);
2980
+ const workspace = this.roster.addWorkspace(cwd, basename(cwd) || cwd);
2981
+ const created = this.newTabIn(workspace);
2862
2982
  if (entry?.pickedAccount) created.pickedAccount = entry.pickedAccount;
2863
2983
  this.open(created);
2864
2984
  }
@@ -2896,7 +3016,7 @@ var SpacesHost = class {
2896
3016
  addAccount() {
2897
3017
  const entry = this.roster.selected;
2898
3018
  if (!entry) return;
2899
- this.startIn(this.roster.spaceOf(entry), void 0, false);
3019
+ this.startIn(this.roster.workspaceOf(entry), void 0, false);
2900
3020
  this.notice = "Type /auth in this session to add an account.";
2901
3021
  }
2902
3022
  menuKey(key) {
@@ -2963,7 +3083,7 @@ var SpacesHost = class {
2963
3083
  if (target.kind === "pane") this.open(target.entry);
2964
3084
  else if (target.kind === "tab") this.open(target.tab.focus);
2965
3085
  else {
2966
- const entry = target.space.activeTab?.focus ?? this.roster.entriesOf(target.space)[0];
3086
+ const entry = target.workspace.activeTab?.focus ?? this.roster.entriesOf(target.workspace)[0];
2967
3087
  if (entry) this.open(entry);
2968
3088
  }
2969
3089
  }
@@ -3002,20 +3122,20 @@ var SpacesHost = class {
3002
3122
  if (!context) return;
3003
3123
  const item = CONTEXT_ITEMS[context.target.kind][index];
3004
3124
  const { target } = context;
3005
- const entry = target.kind === "pane" ? target.entry : target.kind === "tab" ? target.tab.focus : target.space.activeTab?.focus ?? this.roster.entriesOf(target.space)[0];
3125
+ const entry = target.kind === "pane" ? target.entry : target.kind === "tab" ? target.tab.focus : target.workspace.activeTab?.focus ?? this.roster.entriesOf(target.workspace)[0];
3006
3126
  if (!entry || !item) return;
3007
3127
  this.show(entry);
3008
- const shown = this.roster.spaceOf(entry);
3128
+ const shown = this.roster.workspaceOf(entry);
3009
3129
  if (item === "Rename") {
3010
- if (target.kind === "space") this.askName("rename-space", shown.name);
3130
+ if (target.kind === "workspace") this.askName("rename-workspace", shown.name);
3011
3131
  else if (target.kind === "tab") this.askName("rename-tab", this.shownTabLabel());
3012
3132
  else this.askName("rename-session", entry.label);
3013
3133
  } else if (item === "New tab") this.newTab();
3014
3134
  else if (item === "Split right") this.splitFocused("side");
3015
3135
  else if (item === "Split down") this.splitFocused("stack");
3016
3136
  else if (item === "Zoom") this.toggleZoom();
3017
- else if (target.kind === "space") this.confirm = "close-space";
3018
- else if (target.kind === "tab") this.closeTabOrSpace();
3137
+ else if (target.kind === "workspace") this.confirm = "close-workspace";
3138
+ else if (target.kind === "tab") this.closeTabOrWorkspace();
3019
3139
  else this.closePane();
3020
3140
  this.router.capture(this.captured());
3021
3141
  }
@@ -3044,7 +3164,7 @@ var SpacesHost = class {
3044
3164
  else if (key.kind === "backtab") this.cyclePane(-1);
3045
3165
  else if (c === CLEAR) this.askQuit();
3046
3166
  }
3047
- /** Moves the selection through the sessions in the order the sidebar lists them; the space and its tab follow. */
3167
+ /** Moves the selection through the sessions in the order the sidebar lists them; the workspace and its tab follow. */
3048
3168
  stepSession(delta) {
3049
3169
  const entry = this.roster.selected;
3050
3170
  if (!entry) return;
@@ -3085,11 +3205,11 @@ var SpacesHost = class {
3085
3205
  const outer = this.flatPanes().find((p) => p.entry === entry)?.outer;
3086
3206
  const room = dir === "side" ? outer?.width ?? 0 : outer?.height ?? 0;
3087
3207
  const least = dir === "side" ? MIN_PANE_WIDTH : MIN_PANE_HEIGHT;
3088
- if (room < least * 2) {
3208
+ if (room < least * 2 + SPLIT_GAP) {
3089
3209
  this.notice = "There is not enough room to split this pane.";
3090
3210
  return;
3091
3211
  }
3092
- const created = this.addEntry(this.roster.spaceOf(entry));
3212
+ const created = this.addEntry(this.roster.workspaceOf(entry));
3093
3213
  if (entry.pickedAccount) created.pickedAccount = entry.pickedAccount;
3094
3214
  this.roster.splitBeside(entry, created, dir);
3095
3215
  this.open(created);
@@ -3128,48 +3248,48 @@ var SpacesHost = class {
3128
3248
  stepTab(delta) {
3129
3249
  const entry = this.roster.selected;
3130
3250
  if (!entry) return;
3131
- const space = this.roster.spaceOf(entry);
3132
- const at = space.activeTab ? space.tabs.indexOf(space.activeTab) : 0;
3133
- this.gotoTab((at + delta + space.tabs.length) % space.tabs.length);
3251
+ const workspace = this.roster.workspaceOf(entry);
3252
+ const at = workspace.activeTab ? workspace.tabs.indexOf(workspace.activeTab) : 0;
3253
+ this.gotoTab((at + delta + workspace.tabs.length) % workspace.tabs.length);
3134
3254
  }
3135
3255
  gotoTab(index) {
3136
3256
  const entry = this.roster.selected;
3137
3257
  if (!entry) return;
3138
- const tab = this.roster.spaceOf(entry).tabs[index];
3258
+ const tab = this.roster.workspaceOf(entry).tabs[index];
3139
3259
  if (tab) this.open(tab.focus);
3140
3260
  }
3141
- /** Closes the focused pane; the last pane of a tab closes the tab, and of a space's only tab asks to close the space. */
3261
+ /** Closes the focused pane; the last pane of a tab closes the tab, and of a workspace's only tab asks to close the workspace. */
3142
3262
  closePane() {
3143
3263
  const entry = this.roster.selected;
3144
3264
  const tab = this.roster.shownTab;
3145
3265
  if (!entry || !tab) return;
3146
- if (leaves(tab.root).length > 1 || this.roster.spaceOf(entry).tabs.length > 1) {
3266
+ if (leaves(tab.root).length > 1 || this.roster.workspaceOf(entry).tabs.length > 1) {
3147
3267
  this.closeEntries([entry]);
3148
3268
  return;
3149
3269
  }
3150
- this.confirm = "close-space";
3270
+ this.confirm = "close-workspace";
3151
3271
  }
3152
- /** Closes a tab; a space's only tab closes the space, after asking. */
3153
- closeTabOrSpace() {
3272
+ /** Closes a tab; a workspace's only tab closes the workspace, after asking. */
3273
+ closeTabOrWorkspace() {
3154
3274
  const entry = this.roster.selected;
3155
- if (entry && this.roster.spaceOf(entry).tabs.length > 1) this.closeTab();
3156
- else this.confirm = "close-space";
3275
+ if (entry && this.roster.workspaceOf(entry).tabs.length > 1) this.closeTab();
3276
+ else this.confirm = "close-workspace";
3157
3277
  }
3158
3278
  closeTab() {
3159
3279
  const entry = this.roster.selected;
3160
3280
  const tab = this.roster.shownTab;
3161
3281
  if (!entry || !tab) return;
3162
- if (this.roster.spaceOf(entry).tabs.length <= 1) {
3163
- this.notice = "A space keeps at least one tab.";
3282
+ if (this.roster.workspaceOf(entry).tabs.length <= 1) {
3283
+ this.notice = "A workspace keeps at least one tab.";
3164
3284
  return;
3165
3285
  }
3166
3286
  this.closeEntries(leaves(tab.root));
3167
3287
  }
3168
- /** Starts a session in a new tab of the shown space, asking which account first when there is a choice. */
3288
+ /** Starts a session in a new tab of the shown workspace, asking which account first when there is a choice. */
3169
3289
  newTab() {
3170
3290
  const entry = this.roster.selected;
3171
3291
  if (!entry) return;
3172
- const space = this.roster.spaceOf(entry);
3292
+ const workspace = this.roster.workspaceOf(entry);
3173
3293
  let accounts = [];
3174
3294
  try {
3175
3295
  accounts = (this.options.accounts?.() ?? []).filter((a) => a.label !== "default");
@@ -3177,7 +3297,7 @@ var SpacesHost = class {
3177
3297
  accounts = [];
3178
3298
  }
3179
3299
  if (accounts.length === 0) {
3180
- this.startIn(space, void 0);
3300
+ this.startIn(workspace, void 0);
3181
3301
  return;
3182
3302
  }
3183
3303
  const choices = [
@@ -3187,13 +3307,15 @@ var SpacesHost = class {
3187
3307
  text: `${a.label} ${a.provider}`
3188
3308
  }))
3189
3309
  ];
3190
- const remembered = choices.findIndex((c) => c.id !== void 0 && c.id === space.lastAccount);
3191
- this.picker = { space, choices, index: Math.max(0, remembered) };
3310
+ const remembered = choices.findIndex(
3311
+ (c) => c.id !== void 0 && c.id === workspace.lastAccount
3312
+ );
3313
+ this.picker = { workspace, choices, index: Math.max(0, remembered) };
3192
3314
  }
3193
- startIn(space, account, ask = true) {
3194
- if (account === void 0) delete space.lastAccount;
3195
- else space.lastAccount = account;
3196
- const created = this.newTabIn(space);
3315
+ startIn(workspace, account, ask = true) {
3316
+ if (account === void 0) delete workspace.lastAccount;
3317
+ else workspace.lastAccount = account;
3318
+ const created = this.newTabIn(workspace);
3197
3319
  if (account !== void 0) created.pickedAccount = account;
3198
3320
  this.open(created);
3199
3321
  if (ask) {
@@ -3201,17 +3323,17 @@ var SpacesHost = class {
3201
3323
  this.router.capture(true);
3202
3324
  }
3203
3325
  }
3204
- /** Moves among the spaces, showing each one's tab without starting what it holds. */
3205
- stepSpace(delta) {
3326
+ /** Moves among the workspaces, showing each one's tab without starting what it holds. */
3327
+ stepWorkspace(delta) {
3206
3328
  const entry = this.roster.selected;
3207
3329
  if (!entry) return;
3208
- const index = this.roster.spaces.indexOf(this.roster.spaceOf(entry)) + delta;
3209
- const space = this.roster.spaces[index];
3210
- const target = space?.activeTab?.focus;
3330
+ const index = this.roster.workspaces.indexOf(this.roster.workspaceOf(entry)) + delta;
3331
+ const workspace = this.roster.workspaces[index];
3332
+ const target = workspace?.activeTab?.focus;
3211
3333
  if (target) this.show(target);
3212
3334
  }
3213
- gotoSpace(index) {
3214
- const target = this.roster.spaces[index]?.activeTab?.focus;
3335
+ gotoWorkspace(index) {
3336
+ const target = this.roster.workspaces[index]?.activeTab?.focus;
3215
3337
  if (target) this.show(target);
3216
3338
  }
3217
3339
  pickerKey(key) {
@@ -3226,7 +3348,7 @@ var SpacesHost = class {
3226
3348
  else if (key.kind === "enter") {
3227
3349
  this.picker = void 0;
3228
3350
  this.router.capture(false);
3229
- this.startIn(picker.space, picker.choices[picker.index]?.id);
3351
+ this.startIn(picker.workspace, picker.choices[picker.index]?.id);
3230
3352
  }
3231
3353
  }
3232
3354
  askFolder() {
@@ -3255,7 +3377,7 @@ var SpacesHost = class {
3255
3377
  }
3256
3378
  if (key.kind !== "enter") return;
3257
3379
  const value = prompt.value.trim();
3258
- if (prompt.kind === "folder" || prompt.kind === "new-space") {
3380
+ if (prompt.kind === "folder" || prompt.kind === "new-workspace") {
3259
3381
  if (value === "") {
3260
3382
  this.endPrompt();
3261
3383
  return;
@@ -3266,7 +3388,7 @@ var SpacesHost = class {
3266
3388
  return;
3267
3389
  }
3268
3390
  this.endPrompt();
3269
- if (prompt.kind === "new-space") this.newSpaceIn(path);
3391
+ if (prompt.kind === "new-workspace") this.newWorkspaceIn(path);
3270
3392
  else this.openFolder(path);
3271
3393
  return;
3272
3394
  }
@@ -3274,8 +3396,8 @@ var SpacesHost = class {
3274
3396
  const tab = this.roster.shownTab;
3275
3397
  if (entry) {
3276
3398
  if (prompt.kind === "rename-session" && value !== "") entry.label = value;
3277
- else if (prompt.kind === "rename-space" && value !== "")
3278
- this.roster.spaceOf(entry).name = value;
3399
+ else if (prompt.kind === "rename-workspace" && value !== "")
3400
+ this.roster.workspaceOf(entry).name = value;
3279
3401
  else if (prompt.kind === "rename-tab" && tab) {
3280
3402
  if (value === "") delete tab.name;
3281
3403
  else tab.name = value;
@@ -3291,19 +3413,19 @@ var SpacesHost = class {
3291
3413
  expand(value) {
3292
3414
  const home = this.options.homeDirectory ?? homedir();
3293
3415
  const full = value === "~" ? home : value.startsWith("~/") ? join(home, value.slice(2)) : value;
3294
- const base = this.roster.selected ? this.roster.spaceOf(this.roster.selected).cwd : this.options.folder.cwd;
3416
+ const base = this.roster.selected ? this.roster.workspaceOf(this.roster.selected).cwd : this.options.folder.cwd;
3295
3417
  return isAbsolute(full) ? resolve(full) : resolve(base, full);
3296
3418
  }
3297
- /** Opens a folder as a space, or shows the space it already is. */
3419
+ /** Opens a folder as a workspace, or shows the workspace it already is. */
3298
3420
  openFolder(path) {
3299
- const known = this.roster.spaces.find((s) => s.cwd === path);
3421
+ const known = this.roster.workspaces.find((s) => s.cwd === path);
3300
3422
  if (known) {
3301
3423
  const entry = known.activeTab?.focus ?? this.roster.entriesOf(known)[0];
3302
3424
  if (entry) this.open(entry);
3303
3425
  return;
3304
3426
  }
3305
- const space = this.roster.addSpace(path, basename(path) || path);
3306
- this.open(this.newTabIn(space));
3427
+ const workspace = this.roster.addWorkspace(path, basename(path) || path);
3428
+ this.open(this.newTabIn(workspace));
3307
3429
  }
3308
3430
  perform(what) {
3309
3431
  const entry = this.roster.selected;
@@ -3312,7 +3434,7 @@ var SpacesHost = class {
3312
3434
  return;
3313
3435
  }
3314
3436
  if (!entry) return;
3315
- this.closeEntries(this.roster.entriesOf(this.roster.spaceOf(entry)));
3437
+ this.closeEntries(this.roster.entriesOf(this.roster.workspaceOf(entry)));
3316
3438
  }
3317
3439
  /** Ends the sessions and takes their panes away; closing the last one leaves nothing to bring back and quits. */
3318
3440
  closeEntries(doomed) {
@@ -3393,7 +3515,7 @@ var SpacesHost = class {
3393
3515
  return;
3394
3516
  }
3395
3517
  if (event.kind === "drag") {
3396
- if (this.reorder) this.dragSpace(layout, event);
3518
+ if (this.reorder) this.dragWorkspace(layout, event);
3397
3519
  else if (this.sidebarDrag) this.dragSidebar(event);
3398
3520
  else this.dragBorder(event);
3399
3521
  return;
@@ -3413,7 +3535,7 @@ var SpacesHost = class {
3413
3535
  return;
3414
3536
  }
3415
3537
  if (this.router.current !== "terminal") this.router.focus();
3416
- this.workspacePress(event);
3538
+ this.panePress(event);
3417
3539
  this.requestRender();
3418
3540
  }
3419
3541
  /** A press on the line between the sidebar and the session: a second one soon after resets the width. */
@@ -3447,12 +3569,15 @@ var SpacesHost = class {
3447
3569
  sidebarPress(sidebar, rail, event) {
3448
3570
  const target = hitTest(this.sidebarModel(rail), sidebar.width, sidebar.height, event.x, event.y);
3449
3571
  if (target?.kind === "agent") this.open(target.entry);
3450
- else if (target?.kind === "space") {
3451
- this.reorder = { space: target.space, to: this.roster.spaces.indexOf(target.space) };
3452
- this.gotoSpace(this.roster.spaces.indexOf(target.space));
3572
+ else if (target?.kind === "workspace") {
3573
+ this.reorder = {
3574
+ workspace: target.workspace,
3575
+ to: this.roster.workspaces.indexOf(target.workspace)
3576
+ };
3577
+ this.gotoWorkspace(this.roster.workspaces.indexOf(target.workspace));
3453
3578
  const shown = this.roster.selected;
3454
3579
  if (shown) this.open(shown);
3455
- } else if (target?.kind === "new") this.newSpaceHere();
3580
+ } else if (target?.kind === "new") this.newWorkspaceHere();
3456
3581
  else if (target?.kind === "menu") this.openMenu();
3457
3582
  else if (target?.kind === "collapse") this.toggleSidebar();
3458
3583
  else if (target?.kind === "split") this.sidebarDrag = "split";
@@ -3463,10 +3588,10 @@ var SpacesHost = class {
3463
3588
  }
3464
3589
  this.requestRender();
3465
3590
  }
3466
- /** A pointer button went up: a drag of a border, the sidebar or a space ends, and a moved space lands. */
3591
+ /** A pointer button went up: a drag of a border, the sidebar or a workspace ends, and a moved workspace lands. */
3467
3592
  endDrags() {
3468
3593
  const moved = this.reorder;
3469
- if (moved && this.roster.moveSpace(moved.space, moved.to)) {
3594
+ if (moved && this.roster.moveWorkspace(moved.workspace, moved.to)) {
3470
3595
  this.revealSelected();
3471
3596
  this.persist();
3472
3597
  }
@@ -3476,8 +3601,8 @@ var SpacesHost = class {
3476
3601
  this.sidebarDrag = void 0;
3477
3602
  this.requestRender();
3478
3603
  }
3479
- /** While a space is dragged: the place it would land is the space row under the pointer. */
3480
- dragSpace(layout, event) {
3604
+ /** While a workspace is dragged: the place it would land is the workspace row under the pointer. */
3605
+ dragWorkspace(layout, event) {
3481
3606
  const drag = this.reorder;
3482
3607
  if (!drag || !layout.sidebar) return;
3483
3608
  const target = hitTest(
@@ -3487,7 +3612,7 @@ var SpacesHost = class {
3487
3612
  Math.min(event.x, layout.sidebar.width - 1),
3488
3613
  event.y
3489
3614
  );
3490
- if (target?.kind === "space") drag.to = this.roster.spaces.indexOf(target.space);
3615
+ if (target?.kind === "workspace") drag.to = this.roster.workspaces.indexOf(target.workspace);
3491
3616
  else if (!target) {
3492
3617
  const geo = geometry(
3493
3618
  layout.sidebar.height,
@@ -3495,13 +3620,13 @@ var SpacesHost = class {
3495
3620
  this.split,
3496
3621
  layout.rail
3497
3622
  );
3498
- const shown = this.roster.spaces.length - this.sidebarScroll.spaces;
3499
- if (event.y >= geo.spaceTop + shown * geo.spaceStep && event.y < (geo.footerY ?? geo.ruleY))
3500
- drag.to = this.roster.spaces.length - 1;
3623
+ const shown = this.roster.workspaces.length - this.sidebarScroll.workspaces;
3624
+ if (event.y >= geo.workspaceTop + shown * geo.workspaceStep && event.y < (geo.footerY ?? geo.ruleY))
3625
+ drag.to = this.roster.workspaces.length - 1;
3501
3626
  }
3502
3627
  this.requestRender();
3503
3628
  }
3504
- /** A right-click: a menu for the space, tab or pane under the pointer. */
3629
+ /** A right-click: a menu for the workspace, tab or pane under the pointer. */
3505
3630
  openContext(layout, event) {
3506
3631
  let target;
3507
3632
  if (layout.sidebar && event.x < layout.sidebar.width) {
@@ -3512,11 +3637,15 @@ var SpacesHost = class {
3512
3637
  event.x,
3513
3638
  event.y
3514
3639
  );
3515
- if (hit?.kind === "space") target = { kind: "space", space: hit.space };
3640
+ if (hit?.kind === "workspace") target = { kind: "workspace", workspace: hit.workspace };
3516
3641
  else if (hit?.kind === "agent") target = { kind: "pane", entry: hit.entry };
3517
- } else if (event.y === layout.tabBar.y) {
3642
+ } else if (layout.tabBar && inRect(layout.tabBar, event.x, event.y)) {
3518
3643
  const entry = this.roster.selected;
3519
- const hit = entry ? tabBarTarget(layoutTabBar(this.roster.spaceOf(entry), layout.tabBar), event.x, event.y) : void 0;
3644
+ const hit = entry ? tabBarTarget(
3645
+ layoutTabBar(this.roster.workspaceOf(entry), layout.tabBar),
3646
+ event.x,
3647
+ event.y
3648
+ ) : void 0;
3520
3649
  if (hit?.kind === "tab") target = { kind: "tab", tab: hit.tab };
3521
3650
  } else {
3522
3651
  const placement = this.placement();
@@ -3604,16 +3733,18 @@ var SpacesHost = class {
3604
3733
  else this.dismiss();
3605
3734
  }
3606
3735
  }
3607
- /** A press in the workspace area: a tab, the "+", a border to drag, or a pane to focus. */
3608
- workspacePress(event) {
3736
+ /** A press in the pane area: a tab, the "+", a border to drag, or a pane to focus. */
3737
+ panePress(event) {
3609
3738
  const layout = this.layout();
3610
3739
  const entry = this.roster.selected;
3611
3740
  if (!entry) return;
3612
- if (event.y === layout.tabBar.y) {
3613
- const bar = layoutTabBar(this.roster.spaceOf(entry), layout.tabBar);
3741
+ if (layout.tabBar && inRect(layout.tabBar, event.x, event.y)) {
3742
+ const bar = layoutTabBar(this.roster.workspaceOf(entry), layout.tabBar);
3614
3743
  const target = tabBarTarget(bar, event.x, event.y);
3615
3744
  if (target?.kind === "new") this.newTab();
3616
3745
  else if (target?.kind === "tab") this.open(target.tab.focus);
3746
+ else if (target?.kind === "previous") this.stepTab(-1);
3747
+ else if (target?.kind === "next") this.stepTab(1);
3617
3748
  return;
3618
3749
  }
3619
3750
  const placement = this.placement();
@@ -3828,12 +3959,12 @@ var SpacesHost = class {
3828
3959
  if (prompt) {
3829
3960
  const titles = {
3830
3961
  folder: "open folder",
3831
- "new-space": "new space",
3962
+ "new-workspace": "new workspace",
3832
3963
  "rename-session": "rename pane",
3833
- "rename-space": "rename space",
3964
+ "rename-workspace": "rename workspace",
3834
3965
  "rename-tab": prompt.fresh ? "new tab" : "rename tab"
3835
3966
  };
3836
- const create = prompt.kind === "folder" || prompt.kind === "new-space" || prompt.fresh;
3967
+ const create = prompt.kind === "folder" || prompt.kind === "new-workspace" || prompt.fresh;
3837
3968
  return {
3838
3969
  title: titles[prompt.kind],
3839
3970
  input: { value: prompt.value },
@@ -3856,12 +3987,12 @@ var SpacesHost = class {
3856
3987
  ]
3857
3988
  };
3858
3989
  if (this.confirm && entry) {
3859
- const space = this.roster.spaceOf(entry);
3860
- const count = this.roster.entriesOf(space).length;
3990
+ const workspace = this.roster.workspaceOf(entry);
3991
+ const count = this.roster.entriesOf(workspace).length;
3861
3992
  return {
3862
- title: "Close space?",
3993
+ title: "Close workspace?",
3863
3994
  danger: true,
3864
- lines: [`${space.name} \u2014 ${count} ${count === 1 ? "pane" : "panes"}`],
3995
+ lines: [`${workspace.name} \u2014 ${count} ${count === 1 ? "pane" : "panes"}`],
3865
3996
  buttons: [
3866
3997
  { label: "\u21B2 confirm", action: "confirm", primary: true },
3867
3998
  { label: "esc cancel", action: "cancel" }
@@ -3872,7 +4003,7 @@ var SpacesHost = class {
3872
4003
  }
3873
4004
  pickerSpec(picker) {
3874
4005
  return {
3875
- title: `Start a session in ${picker.space.name} on`,
4006
+ title: `Start a session in ${picker.workspace.name} on`,
3876
4007
  rows: picker.choices.map((c) => ({ text: c.text })),
3877
4008
  index: picker.index,
3878
4009
  scroll: 0,
@@ -3950,7 +4081,7 @@ var SpacesHost = class {
3950
4081
  if (mode === "resize")
3951
4082
  return {
3952
4083
  chip: "RESIZE",
3953
- chipBg: this.palette.mauve,
4084
+ chipBg: this.palette.resize,
3954
4085
  hints: [
3955
4086
  ["esc", "done"],
3956
4087
  ["h/l", "width"],
@@ -3960,7 +4091,7 @@ var SpacesHost = class {
3960
4091
  if (mode === "navigate")
3961
4092
  return {
3962
4093
  chip: "NAVIGATE",
3963
- chipBg: this.palette.accent,
4094
+ chipBg: this.palette.navigate,
3964
4095
  hints: [
3965
4096
  ["\u2191/\u2193", "session"],
3966
4097
  ["\u2192", "open"],
@@ -3974,30 +4105,55 @@ var SpacesHost = class {
3974
4105
  hints: [
3975
4106
  ["esc", "cancel"],
3976
4107
  [prefix, "send prefix"],
3977
- ["w", "space nav"],
4108
+ ["w", "workspace nav"],
3978
4109
  ["?", "keybinds"]
3979
4110
  ]
3980
4111
  };
3981
4112
  }
4113
+ /**
4114
+ * Draws the mode bar at the right end of `area`, a row that holds no pane cells: the tab bar's
4115
+ * rule. Hints that do not fit are left out, the chip never is.
4116
+ */
3982
4117
  drawModeBar(frame, area, mode) {
3983
4118
  const { palette } = this;
3984
4119
  const bar = this.modeBar(mode);
3985
- frame.fillRect(area, { bg: palette.panelBg });
3986
- let x = 0;
3987
- const put = /* @__PURE__ */ __name((text, style) => {
3988
- x += frame.writeText({ ...area, x: area.x + x, width: area.width - x }, 0, text, style);
3989
- }, "put");
3990
- put(` ${bar.chip} `, {
3991
- fg: palette.panelBg,
3992
- bg: bar.chipBg,
3993
- attrs: ATTR_BOLD
3994
- });
3995
- put(" ", { fg: palette.dim, bg: palette.panelBg });
4120
+ const chip = ` ${bar.chip} `;
4121
+ const pieces = [
4122
+ {
4123
+ text: chip,
4124
+ style: palette.mono ? { attrs: ATTR_BOLD | ATTR_INVERSE } : { fg: palette.ink, bg: bar.chipBg, attrs: ATTR_BOLD }
4125
+ },
4126
+ { text: " ", style: { fg: palette.dim } }
4127
+ ];
4128
+ let width = stringWidth(chip) + 1;
3996
4129
  for (const [key, what] of bar.hints) {
3997
- put(key, { fg: palette.accent, bg: palette.panelBg, attrs: ATTR_BOLD });
3998
- put(` ${what} `, { fg: palette.dim, bg: palette.panelBg });
4130
+ const hint = ` ${what} `;
4131
+ if (width + stringWidth(key) + stringWidth(hint) > area.width - 1) break;
4132
+ pieces.push({ text: key, style: { fg: palette.accent, attrs: ATTR_BOLD } });
4133
+ pieces.push({ text: hint, style: { fg: palette.dim } });
4134
+ width += stringWidth(key) + stringWidth(hint);
4135
+ }
4136
+ const used = Math.min(width, area.width);
4137
+ let x = area.x + area.width - used;
4138
+ frame.fillRect({ ...area, x, width: used }, { bg: palette.base });
4139
+ for (const piece of pieces) {
4140
+ if (x >= area.x + area.width) break;
4141
+ x += frame.writeText(
4142
+ { ...area, x, width: area.x + area.width - x },
4143
+ 0,
4144
+ piece.text,
4145
+ piece.style
4146
+ );
3999
4147
  }
4000
4148
  }
4149
+ /** A line of notice at the right end of `area`, in the warning colour. */
4150
+ drawNotice(frame, area, notice) {
4151
+ const text = ellipsize(` ${notice} `, Math.max(0, area.width - 1));
4152
+ const width = stringWidth(text);
4153
+ const rect = { ...area, x: area.x + area.width - width, width };
4154
+ frame.fillRect(rect, { bg: this.palette.base });
4155
+ frame.writeText(rect, 0, text, { fg: this.palette.warn });
4156
+ }
4001
4157
  requestRender() {
4002
4158
  if (this.closed || this.hidden || this.pending) return;
4003
4159
  const cancel = this.schedule(() => {
@@ -4052,27 +4208,17 @@ var SpacesHost = class {
4052
4208
  });
4053
4209
  }
4054
4210
  if (layout.rule) drawRule(frame, layout.rule, this.palette);
4055
- if (entry && this.view === "split")
4056
- drawTabBar(frame, layout.tabBar, this.roster.spaceOf(entry), this.palette);
4211
+ if (entry && this.view === "split" && layout.tabBar)
4212
+ drawTabBar(frame, layout.tabBar, this.roster.workspaceOf(entry), this.palette);
4057
4213
  const ordered = [...panes].sort((a, b) => Number(a.entry === entry) - Number(b.entry === entry));
4058
4214
  for (const pane of ordered)
4059
4215
  this.drawPane(frame, pane, pane.entry === entry, placement?.bordered ?? false);
4060
4216
  if (this.reorder) this.drawDrop(frame, layout);
4061
- const area = {
4062
- ...layout.main,
4063
- y: layout.main.y + layout.main.height - 1,
4064
- height: 1
4065
- };
4217
+ const area = layout.tabBar && layout.tabBar.height >= TAB_BAR_HEIGHT ? { ...layout.main, y: layout.main.y + 1, height: 1 } : { ...layout.main, y: layout.main.y + layout.main.height - 1, height: 1 };
4066
4218
  const mode = this.router.current;
4067
4219
  const asking = this.captured();
4068
4220
  if (mode !== "terminal" && !asking) this.drawModeBar(frame, area, mode);
4069
- else if (this.notice && !asking) {
4070
- frame.fillRect(area, { bg: this.palette.panelBg });
4071
- frame.writeText(area, 0, ` ${this.notice}`, {
4072
- fg: this.palette.yellow,
4073
- bg: this.palette.panelBg
4074
- });
4075
- }
4221
+ else if (this.notice && !asking) this.drawNotice(frame, area, this.notice);
4076
4222
  this.drawOverlay(frame);
4077
4223
  if (mode !== "terminal" || asking)
4078
4224
  frame.setCursor({ x: frame.cursor.x, y: frame.cursor.y, visible: false });
@@ -4089,12 +4235,12 @@ var SpacesHost = class {
4089
4235
  this.armGit(true);
4090
4236
  }
4091
4237
  }
4092
- /** Reads every space's branch now and then again on a timer. */
4238
+ /** Reads every workspace's branch now and then again on a timer. */
4093
4239
  armGit(now = false) {
4094
4240
  if (this.closed) return;
4095
- if (now) this.git.refreshAll(this.roster.spaces.map((s) => s.cwd));
4241
+ if (now) this.git.refreshAll(this.roster.workspaces.map((s) => s.cwd));
4096
4242
  this.cancelGit = this.schedule(() => {
4097
- this.git.refreshAll(this.roster.spaces.map((s) => s.cwd));
4243
+ this.git.refreshAll(this.roster.workspaces.map((s) => s.cwd));
4098
4244
  this.armGit();
4099
4245
  }, GIT_MS);
4100
4246
  }
@@ -4124,18 +4270,18 @@ var SpacesHost = class {
4124
4270
  if (modal) drawModal(frame, layoutModal(screen, modal), modal, palette);
4125
4271
  else if (list) drawList(frame, layoutList(screen, list), list, palette);
4126
4272
  }
4127
- /** The line a dragged space would land at: under the row above the place it would take. */
4273
+ /** The line a dragged workspace would land at: under the row above the place it would take. */
4128
4274
  drawDrop(frame, layout) {
4129
4275
  const drag = this.reorder;
4130
4276
  const sidebar = layout.sidebar;
4131
4277
  if (!drag || !sidebar) return;
4132
- const from = this.roster.spaces.indexOf(drag.space);
4278
+ const from = this.roster.workspaces.indexOf(drag.workspace);
4133
4279
  if (drag.to === from) return;
4134
4280
  const geo = geometry(sidebar.height, 0, this.split, layout.rail);
4135
- const shown = drag.to - this.sidebarScroll.spaces;
4136
- if (shown < 0 || shown >= geo.spaceCap) return;
4137
- const top = geo.spaceTop + shown * geo.spaceStep;
4138
- const y = (drag.to < from ? top : top + geo.spaceStep) - 1;
4281
+ const shown = drag.to - this.sidebarScroll.workspaces;
4282
+ if (shown < 0 || shown >= geo.workspaceCap) return;
4283
+ const top = geo.workspaceTop + shown * geo.workspaceStep;
4284
+ const y = (drag.to < from ? top : top + geo.workspaceStep) - 1;
4139
4285
  for (let x = 0; x < sidebar.width; x++) {
4140
4286
  const cell = frame.cellAt(x, y);
4141
4287
  if (!cell) continue;
@@ -4163,7 +4309,7 @@ var SpacesHost = class {
4163
4309
  /** One pane: its border (the focused one in the accent colour), then its session or what stands in for it. */
4164
4310
  drawPane(frame, pane, focused, bordered) {
4165
4311
  const { entry, outer, inner } = pane;
4166
- if (bordered) drawBox(frame, outer, focused ? this.palette.accent : this.palette.dim);
4312
+ if (bordered) drawBox(frame, outer, focused ? this.palette.focus : this.palette.border);
4167
4313
  const child = entry.child;
4168
4314
  if (child) {
4169
4315
  frame.blit(child.screen.cells(entry.scrollBack), inner);
@@ -4185,23 +4331,23 @@ var SpacesHost = class {
4185
4331
  }
4186
4332
  return;
4187
4333
  }
4188
- const space = this.roster.spaceOf(entry);
4334
+ const workspace = this.roster.workspaceOf(entry);
4189
4335
  const say = /* @__PURE__ */ __name((row, text) => void frame.writeText(inner, row, text), "say");
4190
4336
  if (entry.folderMissing) {
4191
4337
  say(1, ` The folder for "${entry.label}" was not found.`);
4192
- say(2, ` ${space.cwd}`);
4193
- say(3, " Put it back or remove this space, then press enter to try again.");
4338
+ say(2, ` ${workspace.cwd}`);
4339
+ say(3, " Put it back or remove this workspace, then press enter to try again.");
4194
4340
  } else if (entry.openElsewhere) {
4195
4341
  say(1, ` "${entry.label}" is open in another terminal.`);
4196
4342
  say(2, " Close it there, then press enter to open it here.");
4197
4343
  } else if (entry.checking) say(1, ` Opening "${entry.label}"...`);
4198
4344
  else {
4199
- say(1, ` "${entry.label}" in ${space.name} has not started yet.`);
4345
+ say(1, ` "${entry.label}" in ${workspace.name} has not started yet.`);
4200
4346
  say(2, " Press enter or click it to open it.");
4201
4347
  }
4202
4348
  }
4203
4349
  // --- remembering the layout ------------------------------------------------
4204
- /** What is written between runs: spaces with their tabs and pane trees, and where focus is. */
4350
+ /** What is written between runs: workspaces with their tabs and pane trees, and where focus is. */
4205
4351
  snapshot() {
4206
4352
  const selected = this.roster.selected;
4207
4353
  const saveNode = /* @__PURE__ */ __name((node) => {
@@ -4232,17 +4378,17 @@ var SpacesHost = class {
4232
4378
  ...tab.zoomed ? { zoomed: true } : {}
4233
4379
  };
4234
4380
  }, "saveTab");
4235
- const spaces = this.roster.spaces.map((space2) => {
4236
- const active = space2.activeTab ? space2.tabs.indexOf(space2.activeTab) : 0;
4381
+ const workspaces = this.roster.workspaces.map((workspace2) => {
4382
+ const active = workspace2.activeTab ? workspace2.tabs.indexOf(workspace2.activeTab) : 0;
4237
4383
  return {
4238
- name: space2.name,
4239
- cwd: space2.cwd,
4240
- ...space2.lastAccount ? { lastAccount: space2.lastAccount } : {},
4241
- tabs: space2.tabs.map(saveTab),
4384
+ name: workspace2.name,
4385
+ cwd: workspace2.cwd,
4386
+ ...workspace2.lastAccount ? { lastAccount: workspace2.lastAccount } : {},
4387
+ tabs: workspace2.tabs.map(saveTab),
4242
4388
  ...active > 0 ? { activeTab: active } : {}
4243
4389
  };
4244
4390
  });
4245
- const space = selected ? this.roster.spaces.indexOf(this.roster.spaceOf(selected)) : -1;
4391
+ const workspace = selected ? this.roster.workspaces.indexOf(this.roster.workspaceOf(selected)) : -1;
4246
4392
  const sidebar = {
4247
4393
  ...this.sidebar.collapsed ? { collapsed: true } : {},
4248
4394
  ...this.sidebar.width !== SIDEBAR_DEFAULT ? { width: this.sidebar.width } : {},
@@ -4250,9 +4396,9 @@ var SpacesHost = class {
4250
4396
  ...this.order !== "grouped" ? { order: this.order } : {}
4251
4397
  };
4252
4398
  return {
4253
- version: 2,
4254
- spaces,
4255
- ...space >= 0 ? { focus: { space } } : {},
4399
+ version: 3,
4400
+ workspaces,
4401
+ ...workspace >= 0 ? { focus: { workspace } } : {},
4256
4402
  ...Object.keys(sidebar).length > 0 ? { sidebar } : {}
4257
4403
  };
4258
4404
  }
@@ -4268,7 +4414,7 @@ var SpacesHost = class {
4268
4414
  const store = this.options.store;
4269
4415
  if (!store) return;
4270
4416
  try {
4271
- store.save(this.forgetAll ? { version: 2, spaces: [] } : this.snapshot());
4417
+ store.save(this.forgetAll ? { version: 3, workspaces: [] } : this.snapshot());
4272
4418
  } catch {
4273
4419
  }
4274
4420
  }
@@ -4317,6 +4463,6 @@ var SpacesHost = class {
4317
4463
  export {
4318
4464
  realSignalHooks,
4319
4465
  realSchedule,
4320
- SpacesHost
4466
+ WorkspacesHost
4321
4467
  };
4322
- //# sourceMappingURL=chunk-OYX743QK.js.map
4468
+ //# sourceMappingURL=chunk-7XAUAIGO.js.map