rvlib-shipkit 2.29.0 → 2.30.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 (512) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/package.json +2 -1
  3. package/src/advisors/app-graph.ts +1 -1
  4. package/src/advisors/expose.ts +5 -1
  5. package/src/advisors/r2.ts +7 -9
  6. package/src/advisors/routes.ts +29 -2
  7. package/src/advisors/scan.ts +11 -0
  8. package/src/agent-time/accounts-usage.ts +8 -0
  9. package/src/agent-time/claude-sessions.ts +32 -0
  10. package/src/agent-time/hooks.ts +1 -1
  11. package/src/agent-time/live.ts +5 -2
  12. package/src/agent-time/registry.ts +186 -89
  13. package/src/agent-time/store.ts +6 -4
  14. package/src/asks/ask-doc.ts +2 -2
  15. package/src/asks/ask-store.ts +22 -7
  16. package/src/check.ts +9 -1
  17. package/src/checks/SK001-package-json-shape.check.ts +1 -0
  18. package/src/checks/SK003-claude-md-shape.check.ts +1 -0
  19. package/src/checks/SK004-gitignore-policy.check.ts +12 -6
  20. package/src/checks/SK008-reviewer-agent.check.ts +4 -7
  21. package/src/checks/SK013-one-way-in-policy.check.ts +1 -0
  22. package/src/checks/SK017-vscode-hub-task.check.ts +1 -0
  23. package/src/checks/SK024-identity-colors.check.ts +1 -1
  24. package/src/checks/SK027-agent-wiki-links.check.ts +2 -1
  25. package/src/checks/SK033-global-contribution.check.ts +1 -0
  26. package/src/checks/SK034-commit-gates-armed.check.ts +1 -0
  27. package/src/checks/SK039-vscode-watch-generated.check.ts +1 -0
  28. package/src/checks/SK049-thread-answers-hook.check.ts +9 -5
  29. package/src/checks/SK050-retired-commands.check.ts +1 -0
  30. package/src/checks/SK051-no-formatter.check.ts +1 -0
  31. package/src/cli/channel-run.ts +17 -0
  32. package/src/cli/cmd_Advisors.ts +28 -7
  33. package/src/cli/cmd_Asks.ts +2 -2
  34. package/src/cli/cmd_Backup.ts +5 -1
  35. package/src/cli/cmd_CacheAudit.ts +1 -1
  36. package/src/cli/cmd_Channel.ts +43 -0
  37. package/src/cli/cmd_GlobalProcesses.ts +1 -0
  38. package/src/cli/cmd_Home.ts +12 -5
  39. package/src/cli/cmd_Hooks.ts +1 -1
  40. package/src/cli/cmd_Hq.ts +43 -0
  41. package/src/cli/cmd_Lanes.ts +15 -3
  42. package/src/cli/cmd_Media.ts +8 -3
  43. package/src/cli/cmd_Orchestrator.ts +253 -84
  44. package/src/cli/cmd_OrchestratorRole.ts +163 -0
  45. package/src/cli/cmd_Review.ts +142 -165
  46. package/src/cli/cmd_Secret.ts +44 -14
  47. package/src/cli/cmd_Shot.ts +2 -4
  48. package/src/cli/cmd_Sound.ts +1 -0
  49. package/src/cli/cmd_Urls.ts +3 -3
  50. package/src/cli/inbox-hook-run.ts +109 -0
  51. package/src/cli/registry.ts +6 -2
  52. package/src/cli/review-here.ts +136 -0
  53. package/src/cli.ts +45 -14
  54. package/src/collections/actions.ts +5 -4
  55. package/src/collections/checks.ts +5 -0
  56. package/src/collections/collection-types.ts +4 -3
  57. package/src/collections/pings.ts +4 -1
  58. package/src/collections/providers.ts +6 -4
  59. package/src/collections/tests.ts +7 -4
  60. package/src/core/app-icon-frame.ts +62 -0
  61. package/src/core/app-icon.ts +179 -17
  62. package/src/core/archived.ts +10 -7
  63. package/src/core/check-ctx.ts +38 -4
  64. package/src/core/check-pass.ts +7 -0
  65. package/src/core/foreign.ts +87 -0
  66. package/src/core/gui-color.ts +75 -0
  67. package/src/core/hub-theme.ts +1 -3
  68. package/src/core/layout.ts +3 -0
  69. package/src/core/machine-commit.ts +9 -1
  70. package/src/core/one-lib.ts +2 -1
  71. package/src/core/one-way-in-policy.ts +17 -12
  72. package/src/core/owner-word-policy.ts +123 -0
  73. package/src/core/panel-shades.ts +140 -0
  74. package/src/core/repo-gui-color.ts +16 -0
  75. package/src/core/role-policy.ts +17 -0
  76. package/src/core/scope.ts +6 -3
  77. package/src/core/tmux-policy.ts +264 -0
  78. package/src/core/unit-icon.ts +43 -0
  79. package/src/fleet/push-fleet.ts +2 -0
  80. package/src/fleet/scan-fleet.ts +3 -0
  81. package/src/gate/cache-audit.ts +7 -1
  82. package/src/gate/gate-checks.ts +14 -9
  83. package/src/gate/run-fix.ts +30 -5
  84. package/src/gate/run-fixers.ts +8 -3
  85. package/src/home/activity-shape.ts +2 -0
  86. package/src/home/activity.ts +2 -1
  87. package/src/home/daemon-guard.ts +20 -2
  88. package/src/home/daemon-jobs.ts +26 -18
  89. package/src/home/gui-app/ShipkitGui.swift +2012 -144
  90. package/src/home/gui-app/icon.svg +8 -0
  91. package/src/home/gui-app.ts +94 -30
  92. package/src/home/home-routes.ts +53 -9
  93. package/src/home/home-start.ts +27 -3
  94. package/src/home/inbox-shape.ts +7 -3
  95. package/src/home/log-follow.ts +117 -0
  96. package/src/home/machine-fold.ts +1 -1
  97. package/src/home/open-app.ts +9 -3
  98. package/src/home/page-build.ts +5 -1
  99. package/src/home/page-held.ts +1 -1
  100. package/src/home/pm-config.ts +0 -8
  101. package/src/home/pm.ts +62 -5
  102. package/src/home/process-apps.ts +70 -23
  103. package/src/home/process-rows.ts +16 -1
  104. package/src/home/push-sources.ts +18 -13
  105. package/src/home/resources.ts +16 -7
  106. package/src/home/run-daemon.ts +4 -1
  107. package/src/home/run-pm.ts +1 -1
  108. package/src/home/serve-daemon.ts +13 -4
  109. package/src/home/serve-web.ts +141 -17
  110. package/src/home/space-page.ts +3 -3
  111. package/src/home/space-route.ts +2 -2
  112. package/src/home/supervise.ts +2 -1
  113. package/src/home/vault-page.ts +2 -1
  114. package/src/home/web-places.ts +239 -0
  115. package/src/home/widgets.ts +16 -2
  116. package/src/hooks/commit-message.ts +11 -9
  117. package/src/hooks/one-way-in-guard.ts +145 -68
  118. package/src/hooks/run-hooks.ts +15 -5
  119. package/src/hooks/shared-file.ts +273 -83
  120. package/src/hooks/shell-writes.ts +620 -0
  121. package/src/hooks/write-log.ts +149 -0
  122. package/src/hq/door-route.ts +63 -7
  123. package/src/hq/door.ts +45 -12
  124. package/src/hq/history-send.ts +3 -1
  125. package/src/hq/hq-db.ts +10 -3
  126. package/src/hq/hq-local.ts +24 -5
  127. package/src/hq/hq-routes.ts +3 -1
  128. package/src/hq/hq-store.ts +9 -3
  129. package/src/hq/kinds/index.ts +2 -1
  130. package/src/hq/kinds/kind.ts +9 -4
  131. package/src/hq/kinds/presence-rule.ts +56 -0
  132. package/src/hq/kinds/presence.ts +210 -0
  133. package/src/hq/kinds/report.ts +8 -5
  134. package/src/hq/lead-order.ts +68 -0
  135. package/src/hq/outbox.ts +7 -0
  136. package/src/hq/replica.ts +5 -7
  137. package/src/hq/report-facts.ts +14 -7
  138. package/src/hq/report.ts +47 -2
  139. package/src/hq/switch.ts +1 -0
  140. package/src/hq/terminal-hop.ts +64 -0
  141. package/src/hq/thread-sync.ts +13 -6
  142. package/src/http/door-forward.ts +10 -12
  143. package/src/http/door-names.ts +9 -0
  144. package/src/http/hop-caller.ts +23 -0
  145. package/src/http/hop-names.ts +14 -0
  146. package/src/http/loopback-serve.ts +28 -6
  147. package/src/http/owner-word.ts +128 -0
  148. package/src/http/same-origin.ts +12 -0
  149. package/src/{serve → http}/secret-gate.ts +3 -3
  150. package/src/ledger/run-log.ts +25 -1
  151. package/src/media-store/backup/sources.ts +53 -6
  152. package/src/media-store/backup/thread-copy.ts +9 -5
  153. package/src/media-store/copy/config.ts +10 -9
  154. package/src/media-store/daemon.ts +5 -2
  155. package/src/media-store/put.ts +3 -0
  156. package/src/media-store/space.ts +14 -16
  157. package/src/media-store/upload.ts +4 -0
  158. package/src/messages/collection.ts +2 -2
  159. package/src/messages/model.ts +6 -1
  160. package/src/messages/routes.ts +3 -0
  161. package/src/orchestrator/brief.md +8 -6
  162. package/src/orchestrator/channel-declare.ts +58 -0
  163. package/src/orchestrator/channel.ts +226 -0
  164. package/src/orchestrator/guards.ts +12 -3
  165. package/src/orchestrator/host.ts +35 -0
  166. package/src/orchestrator/lead-shape.ts +86 -0
  167. package/src/orchestrator/now.ts +88 -0
  168. package/src/orchestrator/phone.ts +4 -1
  169. package/src/orchestrator/places-file.ts +38 -0
  170. package/src/orchestrator/places-look.ts +180 -0
  171. package/src/orchestrator/places-shape.ts +151 -0
  172. package/src/orchestrator/places.ts +50 -0
  173. package/src/orchestrator/presence-shape.ts +13 -2
  174. package/src/orchestrator/presence.ts +26 -15
  175. package/src/orchestrator/push.ts +5 -10
  176. package/src/orchestrator/role-shape.ts +270 -0
  177. package/src/orchestrator/role.ts +242 -0
  178. package/src/orchestrator/routes.ts +136 -31
  179. package/src/orchestrator/sessions-shape.ts +78 -0
  180. package/src/orchestrator/sessions.ts +86 -0
  181. package/src/orchestrator/share.ts +71 -0
  182. package/src/orchestrator/start-notice.ts +61 -0
  183. package/src/orchestrator/start.ts +137 -0
  184. package/src/orchestrator/started.ts +55 -0
  185. package/src/orchestrator/stuck.ts +196 -0
  186. package/src/orchestrator/unheard.ts +18 -7
  187. package/src/pages/frame-client.ts +44 -6
  188. package/src/problems/failure-words.ts +80 -0
  189. package/src/release/run-bump.ts +26 -5
  190. package/src/release/run-release.ts +34 -14
  191. package/src/repo-config.ts +37 -9
  192. package/src/review/aside-at.ts +19 -0
  193. package/src/review/band.ts +3 -3
  194. package/src/review/doc-save.ts +1 -1
  195. package/src/review/inbox-hook.ts +12 -4
  196. package/src/review/inbox-read.ts +20 -7
  197. package/src/review/instruction-guards.ts +137 -0
  198. package/src/review/instructions.ts +14 -2
  199. package/src/review/item-db.ts +52 -2
  200. package/src/review/mentions.ts +6 -4
  201. package/src/review/model.ts +3 -2
  202. package/src/review/parties.ts +88 -19
  203. package/src/review/push.ts +32 -15
  204. package/src/review/routes.ts +12 -4
  205. package/src/review/secret-route.ts +5 -5
  206. package/src/review/snooze.ts +1 -16
  207. package/src/review/store-parties.ts +4 -2
  208. package/src/review/take-back.ts +2 -1
  209. package/src/review/threads.ts +13 -2
  210. package/src/review/unit.ts +3 -2
  211. package/src/review/view-layout.ts +8 -1
  212. package/src/review/watchers.ts +25 -4
  213. package/src/secrets/key-pair.ts +14 -0
  214. package/src/secrets/lapse.ts +3 -3
  215. package/src/secrets/manager.ts +5 -1
  216. package/src/secrets/name-template.ts +83 -0
  217. package/src/secrets/name.ts +3 -0
  218. package/src/secrets/read.ts +10 -6
  219. package/src/secrets/secrets-view.ts +299 -0
  220. package/src/secrets/who-reads.ts +2 -1
  221. package/src/serve/frame-part.ts +49 -0
  222. package/src/serve/hub-app/accounts-line.tsx +33 -45
  223. package/src/serve/hub-app/activity-st.ts +6 -5
  224. package/src/serve/hub-app/activity-view.tsx +10 -9
  225. package/src/serve/hub-app/advice-box.tsx +6 -5
  226. package/src/serve/hub-app/advisor-app.tsx +2 -0
  227. package/src/serve/hub-app/advisor-face.tsx +3 -2
  228. package/src/serve/hub-app/advisor.html +1 -0
  229. package/src/serve/hub-app/advisors-view.tsx +52 -10
  230. package/src/serve/hub-app/advisors.css +4 -0
  231. package/src/serve/hub-app/app-bridge.ts +31 -5
  232. package/src/serve/hub-app/asked-page.ts +24 -0
  233. package/src/serve/hub-app/asks-page.tsx +10 -6
  234. package/src/serve/hub-app/auto-text.tsx +7 -5
  235. package/src/serve/hub-app/card-head.tsx +3 -2
  236. package/src/serve/hub-app/check-view.tsx +10 -9
  237. package/src/serve/hub-app/checks-svc.ts +96 -32
  238. package/src/serve/hub-app/clock-svc.ts +24 -8
  239. package/src/serve/hub-app/code-copy.ts +1 -1
  240. package/src/serve/hub-app/col-card.tsx +2 -1
  241. package/src/serve/hub-app/col-list-page.tsx +12 -6
  242. package/src/serve/hub-app/col-list-st.ts +12 -2
  243. package/src/serve/hub-app/col-tables-view.tsx +8 -44
  244. package/src/serve/hub-app/col-tables.ts +0 -14
  245. package/src/serve/hub-app/cols-svc.ts +6 -12
  246. package/src/serve/hub-app/columns.ts +94 -0
  247. package/src/serve/hub-app/comfy-view.tsx +8 -7
  248. package/src/serve/hub-app/commands/commands-page.tsx +4 -3
  249. package/src/serve/hub-app/commands/commands-st.ts +2 -2
  250. package/src/serve/hub-app/controls.css +69 -23
  251. package/src/serve/hub-app/cycle-button.tsx +2 -1
  252. package/src/serve/hub-app/database-st.ts +1 -1
  253. package/src/serve/hub-app/database-view.tsx +4 -2
  254. package/src/serve/hub-app/deaf.tsx +27 -0
  255. package/src/serve/hub-app/dock-st.ts +21 -16
  256. package/src/serve/hub-app/dock-view.tsx +19 -12
  257. package/src/serve/hub-app/empty-section.tsx +30 -0
  258. package/src/serve/hub-app/entry-bar.css +1 -1
  259. package/src/serve/hub-app/entry-bar.tsx +11 -6
  260. package/src/serve/hub-app/entry-list.css +32 -0
  261. package/src/serve/hub-app/entry-list.tsx +123 -0
  262. package/src/serve/hub-app/entry-pick.ts +1 -1
  263. package/src/serve/hub-app/entry-sections.ts +140 -0
  264. package/src/serve/hub-app/event-stream-reader.ts +56 -0
  265. package/src/serve/hub-app/floating.tsx +68 -14
  266. package/src/serve/hub-app/geometry-view.tsx +3 -2
  267. package/src/serve/hub-app/git-view.tsx +3 -2
  268. package/src/serve/hub-app/hash-route.ts +14 -2
  269. package/src/serve/hub-app/header-bar.tsx +53 -36
  270. package/src/serve/hub-app/home-st.ts +131 -14
  271. package/src/serve/hub-app/home-strip.css +24 -13
  272. package/src/serve/hub-app/home-strip.tsx +131 -66
  273. package/src/serve/hub-app/home.html +5 -0
  274. package/src/serve/hub-app/hub-app.tsx +94 -102
  275. package/src/serve/hub-app/hub.css +61 -94
  276. package/src/serve/hub-app/icons.tsx +16 -0
  277. package/src/serve/hub-app/identities-st.ts +19 -54
  278. package/src/serve/hub-app/identities-view.tsx +25 -24
  279. package/src/serve/hub-app/identity-address.ts +2 -2
  280. package/src/serve/hub-app/in-sight.ts +10 -0
  281. package/src/serve/hub-app/inbox-st.ts +20 -2
  282. package/src/serve/hub-app/inbox-view.tsx +16 -9
  283. package/src/serve/hub-app/inbox.css +1 -0
  284. package/src/serve/hub-app/index.html +5 -0
  285. package/src/serve/hub-app/insights-view.tsx +6 -5
  286. package/src/serve/hub-app/instructions.css +4 -1
  287. package/src/serve/hub-app/kept-cols.tsx +83 -20
  288. package/src/serve/hub-app/kept-width.tsx +76 -0
  289. package/src/serve/hub-app/keys.ts +116 -38
  290. package/src/serve/hub-app/layout-st.ts +109 -99
  291. package/src/serve/hub-app/lightbox-zoom.css +36 -0
  292. package/src/serve/hub-app/list-filter.tsx +15 -6
  293. package/src/serve/hub-app/list-head.tsx +29 -0
  294. package/src/serve/hub-app/list-row.ts +8 -0
  295. package/src/serve/hub-app/list-walk.ts +26 -105
  296. package/src/serve/hub-app/live-socket.ts +274 -0
  297. package/src/serve/hub-app/live-sources.ts +189 -0
  298. package/src/serve/hub-app/live-svc.ts +2 -2
  299. package/src/serve/hub-app/machine-st.ts +75 -14
  300. package/src/serve/hub-app/main-panel.css +211 -0
  301. package/src/serve/hub-app/main-panel.tsx +259 -0
  302. package/src/serve/hub-app/md.ts +4 -4
  303. package/src/serve/hub-app/media-svc.ts +5 -5
  304. package/src/serve/hub-app/media-view.tsx +13 -12
  305. package/src/serve/hub-app/messages/messages-page.tsx +8 -7
  306. package/src/serve/hub-app/messages/messages-st.ts +5 -2
  307. package/src/serve/hub-app/new-thread-st.ts +170 -0
  308. package/src/serve/hub-app/new-thread.tsx +133 -107
  309. package/src/serve/hub-app/orchestrator-line.tsx +115 -45
  310. package/src/serve/hub-app/orchestrator-places.tsx +86 -0
  311. package/src/serve/hub-app/orchestrator.css +57 -5
  312. package/src/serve/hub-app/page-keys.ts +107 -68
  313. package/src/serve/hub-app/page-reload.ts +46 -6
  314. package/src/serve/hub-app/pages-frames.tsx +40 -3
  315. package/src/serve/hub-app/pages-svc.ts +3 -1
  316. package/src/serve/hub-app/palette-st.ts +198 -43
  317. package/src/serve/hub-app/palette-view.tsx +32 -8
  318. package/src/serve/hub-app/panel-head-action.tsx +39 -0
  319. package/src/serve/hub-app/panel-head.tsx +70 -0
  320. package/src/serve/hub-app/panel-repo.ts +42 -0
  321. package/src/serve/hub-app/panel-source.ts +195 -0
  322. package/src/serve/hub-app/panel-tint.css +6 -0
  323. package/src/serve/hub-app/panel-tint.ts +23 -0
  324. package/src/serve/hub-app/panel-walk.ts +107 -0
  325. package/src/serve/hub-app/pill-row.tsx +2 -1
  326. package/src/serve/hub-app/place-path.ts +4 -0
  327. package/src/serve/hub-app/places-svc.ts +75 -0
  328. package/src/serve/hub-app/plan-view.tsx +3 -2
  329. package/src/serve/hub-app/polled.ts +11 -1
  330. package/src/serve/hub-app/presence-st.ts +66 -32
  331. package/src/serve/hub-app/processes-view.tsx +2 -2
  332. package/src/serve/hub-app/project-bar.tsx +116 -0
  333. package/src/serve/hub-app/project-list.css +20 -173
  334. package/src/serve/hub-app/project-list.tsx +30 -298
  335. package/src/serve/hub-app/projects-svc.ts +59 -32
  336. package/src/serve/hub-app/push-sign.tsx +2 -1
  337. package/src/serve/hub-app/push-svc.ts +86 -69
  338. package/src/serve/hub-app/quiet-st.ts +5 -3
  339. package/src/serve/hub-app/rail-groups.ts +144 -0
  340. package/src/serve/hub-app/reader-chips.tsx +2 -1
  341. package/src/serve/hub-app/recordings-st.ts +2 -1
  342. package/src/serve/hub-app/recordings-view.tsx +19 -47
  343. package/src/serve/hub-app/recordings.css +0 -2
  344. package/src/serve/hub-app/reflections-page.tsx +10 -6
  345. package/src/serve/hub-app/releases/releases-page.tsx +6 -5
  346. package/src/serve/hub-app/repo-sections.ts +127 -38
  347. package/src/serve/hub-app/repo-st.ts +57 -36
  348. package/src/serve/hub-app/review/advisor-bar.tsx +3 -2
  349. package/src/serve/hub-app/review/ask-proof.tsx +79 -0
  350. package/src/serve/hub-app/review/attach-view.tsx +11 -10
  351. package/src/serve/hub-app/review/box-view.ts +479 -0
  352. package/src/serve/hub-app/review/box-zoom.tsx +70 -0
  353. package/src/serve/hub-app/review/diff-view.tsx +3 -2
  354. package/src/serve/hub-app/review/doc-body.tsx +2 -1
  355. package/src/serve/hub-app/review/dock.tsx +3 -2
  356. package/src/serve/hub-app/review/draft-body.tsx +4 -3
  357. package/src/serve/hub-app/review/faces.tsx +0 -8
  358. package/src/serve/hub-app/review/group-block.tsx +8 -7
  359. package/src/serve/hub-app/review/heard-line.tsx +4 -3
  360. package/src/serve/hub-app/review/instructions-view.tsx +3 -2
  361. package/src/serve/hub-app/review/item-verdict.tsx +40 -40
  362. package/src/serve/hub-app/review/kind-states.tsx +5 -4
  363. package/src/serve/hub-app/review/kit.tsx +24 -4
  364. package/src/serve/hub-app/review/lane-bar.tsx +30 -28
  365. package/src/serve/hub-app/review/lightbox.tsx +6 -4
  366. package/src/serve/hub-app/review/live-bar.tsx +7 -6
  367. package/src/serve/hub-app/review/live-view.tsx +6 -5
  368. package/src/serve/hub-app/review/object-card.tsx +2 -1
  369. package/src/serve/hub-app/review/object-panel.tsx +11 -10
  370. package/src/serve/hub-app/review/pano-view.tsx +3 -2
  371. package/src/serve/hub-app/review/question-views.tsx +6 -5
  372. package/src/serve/hub-app/review/review-cells.tsx +21 -20
  373. package/src/serve/hub-app/review/review-host.ts +3 -0
  374. package/src/serve/hub-app/review/review-kit.ts +7 -5
  375. package/src/serve/hub-app/review/review-list.tsx +98 -52
  376. package/src/serve/hub-app/review/review-page.tsx +3 -3
  377. package/src/serve/hub-app/review/review-st.ts +70 -14
  378. package/src/serve/hub-app/review/review-thread.tsx +234 -138
  379. package/src/serve/hub-app/review/review-views.tsx +166 -191
  380. package/src/serve/hub-app/review/space3d.tsx +17 -9
  381. package/src/serve/hub-app/review/thread-close.tsx +24 -32
  382. package/src/serve/hub-app/review/thread-st.ts +39 -25
  383. package/src/serve/hub-app/review/trailer-body.tsx +5 -4
  384. package/src/serve/hub-app/review/trailer-page.tsx +18 -16
  385. package/src/serve/hub-app/review/trailer-st.ts +3 -2
  386. package/src/serve/hub-app/review/trailer-timeline.tsx +10 -9
  387. package/src/serve/hub-app/review/trailer-voices.tsx +29 -28
  388. package/src/serve/hub-app/review.css +159 -42
  389. package/src/serve/hub-app/row-acts.tsx +126 -0
  390. package/src/serve/hub-app/row-face.tsx +29 -0
  391. package/src/serve/hub-app/running-rows.tsx +142 -0
  392. package/src/serve/hub-app/running-st.ts +110 -0
  393. package/src/serve/hub-app/search-view.tsx +3 -2
  394. package/src/serve/hub-app/secrets-page.tsx +290 -0
  395. package/src/serve/hub-app/secrets-st.ts +181 -0
  396. package/src/serve/hub-app/secrets.css +65 -0
  397. package/src/serve/hub-app/section-head.tsx +3 -2
  398. package/src/serve/hub-app/session-chips.tsx +55 -0
  399. package/src/serve/hub-app/shell.ts +56 -0
  400. package/src/serve/hub-app/site/site-part.tsx +6 -5
  401. package/src/serve/hub-app/site/site-st.ts +0 -6
  402. package/src/serve/hub-app/site.css +0 -1
  403. package/src/serve/hub-app/social/calendar.tsx +7 -6
  404. package/src/serve/hub-app/social/comms-page.tsx +29 -26
  405. package/src/serve/hub-app/social/group-editor.tsx +2 -1
  406. package/src/serve/hub-app/social/kit.tsx +12 -11
  407. package/src/serve/hub-app/social/next-release.tsx +3 -2
  408. package/src/serve/hub-app/social/post-card.tsx +21 -20
  409. package/src/serve/hub-app/social/post-page.tsx +2 -1
  410. package/src/serve/hub-app/social/problems.tsx +3 -2
  411. package/src/serve/hub-app/social/social-page.tsx +29 -27
  412. package/src/serve/hub-app/social/social-st.ts +4 -2
  413. package/src/serve/hub-app/social/stage-popup.tsx +11 -10
  414. package/src/serve/hub-app/social.css +7 -5
  415. package/src/serve/hub-app/source-acts.ts +79 -0
  416. package/src/serve/hub-app/source-page.tsx +17 -0
  417. package/src/serve/hub-app/space-view.tsx +5 -4
  418. package/src/serve/hub-app/stores/stores-page.tsx +21 -19
  419. package/src/serve/hub-app/stores/stores-st.ts +1 -1
  420. package/src/serve/hub-app/stores.css +1 -1
  421. package/src/serve/hub-app/terminal-history-st.ts +112 -0
  422. package/src/serve/hub-app/terminal-keys.ts +79 -0
  423. package/src/serve/hub-app/terminal-lib.ts +110 -0
  424. package/src/serve/hub-app/terminal-links.ts +55 -0
  425. package/src/serve/hub-app/terminal-list-st.ts +304 -0
  426. package/src/serve/hub-app/terminal-log-st.ts +242 -0
  427. package/src/serve/hub-app/terminal-out.ts +135 -0
  428. package/src/serve/hub-app/terminal-pages.tsx +115 -0
  429. package/src/serve/hub-app/terminal-panel.tsx +60 -9
  430. package/src/serve/hub-app/terminal-sources.tsx +335 -0
  431. package/src/serve/hub-app/terminal-st.ts +447 -167
  432. package/src/serve/hub-app/terminal-stream.ts +233 -0
  433. package/src/serve/hub-app/terminal-tab.tsx +64 -0
  434. package/src/serve/hub-app/terminal-widths.ts +30 -0
  435. package/src/serve/hub-app/terminal.css +50 -4
  436. package/src/serve/hub-app/test-view.tsx +5 -3
  437. package/src/serve/hub-app/tests-view.tsx +16 -15
  438. package/src/serve/hub-app/theme-st.ts +5 -0
  439. package/src/serve/hub-app/thread-row.tsx +39 -31
  440. package/src/serve/hub-app/time-ago.tsx +3 -2
  441. package/src/serve/hub-app/time-view.tsx +2 -1
  442. package/src/serve/hub-app/time.css +1 -1
  443. package/src/serve/hub-app/timeline-chart.tsx +5 -4
  444. package/src/serve/hub-app/timeline-view.tsx +10 -9
  445. package/src/serve/hub-app/tips.ts +247 -0
  446. package/src/serve/hub-app/tree-build.ts +40 -8
  447. package/src/serve/hub-app/tree-svc.ts +167 -134
  448. package/src/serve/hub-app/unit-icons.ts +26 -0
  449. package/src/serve/hub-app/url-address.ts +154 -0
  450. package/src/serve/hub-app/url-faces.ts +88 -0
  451. package/src/serve/hub-app/url-forms.tsx +183 -0
  452. package/src/serve/hub-app/urls-svc.ts +167 -5
  453. package/src/serve/hub-app/urls-view.tsx +56 -20
  454. package/src/serve/hub-app/urls.css +26 -0
  455. package/src/serve/hub-app/vault-view.tsx +5 -4
  456. package/src/serve/hub-app/veille/veille-page.tsx +34 -33
  457. package/src/serve/hub-app/veille/veille-st.ts +6 -3
  458. package/src/serve/hub-app/view-layout.css +3 -3
  459. package/src/serve/hub-app/when-view.tsx +5 -4
  460. package/src/serve/hub-app/wikis-view.tsx +6 -5
  461. package/src/serve/hub-app/words.tsx +9 -2
  462. package/src/serve/hub-runtime.ts +3 -2
  463. package/src/serve/orchestrator-host.ts +58 -0
  464. package/src/serve/page-live.ts +147 -0
  465. package/src/serve/project-gutter-route.ts +63 -2
  466. package/src/serve/read-worker.ts +7 -2
  467. package/src/serve/runs-stamp.ts +33 -0
  468. package/src/serve/secrets-read.ts +156 -0
  469. package/src/serve/serve-hub.ts +71 -22
  470. package/src/serve/terminal-claudes.ts +185 -0
  471. package/src/serve/terminal-guard.ts +10 -5
  472. package/src/serve/terminal-host.ts +517 -0
  473. package/src/serve/terminal-record.ts +104 -0
  474. package/src/serve/terminal-route.ts +466 -103
  475. package/src/serve/terminal-shells.ts +3 -0
  476. package/src/serve/terminal-watch.ts +102 -0
  477. package/src/shipkit-files.ts +9 -4
  478. package/src/shot/client.ts +4 -9
  479. package/src/shot/shooter.ts +2 -4
  480. package/src/shot/shot-ask.ts +2 -7
  481. package/src/shot/shot-theme.ts +6 -17
  482. package/src/social/routes.ts +2 -2
  483. package/src/social/writes.ts +3 -0
  484. package/src/suite/test-units.ts +6 -2
  485. package/src/trailer/sound/eleven.ts +1 -0
  486. package/src/urls/added.ts +111 -0
  487. package/src/urls/icons.ts +294 -0
  488. package/src/urls/places.ts +139 -0
  489. package/src/urls/routes.ts +17 -7
  490. package/src/urls/rows.ts +48 -15
  491. package/src/urls/unit.ts +57 -3
  492. package/src/urls/write-routes.ts +207 -0
  493. package/src/vault/vault-destroy.ts +2 -1
  494. package/src/vault/vault-import.ts +4 -11
  495. package/src/vault/vault-restore.ts +3 -2
  496. package/src/veille/chrome.ts +18 -3
  497. package/src/veille/identity.ts +6 -0
  498. package/src/view3d/cam.ts +30 -46
  499. package/src/view3d/lib.ts +20 -2
  500. package/src/view3d/viewer.ts +62 -88
  501. package/src/wiki/agent-paths.ts +2 -1
  502. package/src/orchestrator/deliver.ts +0 -81
  503. package/src/orchestrator/drill.ts +0 -129
  504. package/src/orchestrator/keeper.ts +0 -332
  505. package/src/orchestrator/pm.ts +0 -20
  506. package/src/orchestrator/state.ts +0 -92
  507. package/src/orchestrator/switch.ts +0 -86
  508. package/src/orchestrator/tmux.ts +0 -82
  509. package/src/serve/hub-app/rail-fly.tsx +0 -95
  510. package/src/serve/hub-app/side-lists.ts +0 -72
  511. package/src/serve/hub-app/sidebar.tsx +0 -62
  512. package/src/serve/hub-app/tree-row.tsx +0 -125
@@ -0,0 +1,233 @@
1
+ // everything of the terminals a page reads, on the page's ONE socket (live-socket.ts; the server's half:
2
+ // terminal-route.ts): each thing (a terminal's view, a project's list, every project's lists) is a PART, asked by a
3
+ // short POST that names the socket's id and a key of the page's own, ended by another, and its lines come on the
4
+ // socket under that key. What he types into a terminal goes on the socket too (`send`), so a key never waits for one
5
+ // of the browser's six HTTP connections.
6
+ // When the socket ends by itself each part is told it is down; once it is back each part is asked again and starts
7
+ // again from its `hello`.
8
+ // The one constraint a reader breaks first: the POSTs that ask and end parts go one at a time, in order: an end that
9
+ // overtook its ask would leave a terminal's client on the hub that no page reads
10
+ import type { LiveFrame } from '../page-live.ts'
11
+ import type { PageSend, TermLine } from '../terminal-route.ts'
12
+ import type { HomeSt } from './home-st.ts'
13
+ import type { LiveSocket } from './live-socket.ts'
14
+ import { panes } from './pane-errors.ts'
15
+ import { reach } from './reach.ts'
16
+
17
+ const ASK_MS = 250
18
+ /** a PART the hub answered no to (no terminal can start now) is asked again twice as late each time, a minute apart
19
+ * at most: the hub is up, and each ask may start a program there */
20
+ const ASK_MAX_MS = 60_000
21
+ /** how long before a part the hub did not take is asked again */
22
+ export const askIn = (fails: number): number => Math.min(ASK_MS * 2 ** fails, ASK_MAX_MS)
23
+ const POST = { method: 'POST', headers: { 'content-type': 'application/json' } } as const
24
+
25
+ /** one thing the page reads on its socket */
26
+ export type Part = {
27
+ /** the hub it is asked of: a repo's base, '' for the machine's own */
28
+ base: string
29
+ /** the route under `/api/terminal/` that starts it */
30
+ route: 'open' | 'watch' | 'machine' | 'log' | 'frame'
31
+ /** what its ask says beside the socket and the key, read each time it is asked: a size, the terminal wanted */
32
+ body?: () => Record<string, unknown>
33
+ /** a line of it, with its repo where the part is every project's lists; `hello` each time it starts */
34
+ line: (l: TermLine, repo: string | undefined) => void
35
+ /** it is not read now, and why (the socket is down, the hub ended it or did not take it): it is asked again by
36
+ * itself, and its next line is a `hello`. `status`: the hub's answer to the ask, where the ask is what failed */
37
+ down: (why: string, status?: number) => void
38
+ /** the hub refuses it for good (another machine, the tailnet): it is not asked again */
39
+ refused: (why: string) => void
40
+ }
41
+ /** `sent`: the hub was asked for it on the socket that is open now, so its end is said there too. `asks`: what this
42
+ * reader asks the hub for it, null where its owner asks, once (`hold`) */
43
+ type Held = { part: Pick<Part, 'base' | 'line' | 'down'>; asks: Part | null; fails: number; again: ReturnType<typeof setTimeout> | null; sent: boolean }
44
+
45
+ export class TermStream {
46
+ private parts = new Map<string, Held>()
47
+ private keys = 0
48
+ /** the socket's id once its server said hello: what each ask names. null while it is down */
49
+ private id: string | null = null
50
+ /** the asks and the ends, one at a time */
51
+ private line: Promise<void> = Promise.resolve()
52
+ private said = new Set<string>()
53
+
54
+ /** `o`: the waits and where a failure is said, for a test */
55
+ constructor(private sock: LiveSocket, private o: { askIn?: (fails: number) => number; fault?: (e: unknown) => void } = {}) {
56
+ sock.listen({ frame: (f) => this.take(f), down: (why) => this.lost(why) })
57
+ }
58
+
59
+ /** the socket is open and said its id */
60
+ get live(): boolean {
61
+ return this.id != null
62
+ }
63
+
64
+ /** how many parts the page wants now */
65
+ get wanted(): number {
66
+ return this.parts.size
67
+ }
68
+
69
+ /** a part wanted from now until the returned end. It is asked as soon as the socket is open, and again each time
70
+ * the socket opened anew */
71
+ open(part: Part): () => void {
72
+ const key = String(++this.keys)
73
+ const held: Held = { part, asks: part, fails: 0, again: null, sent: false }
74
+ this.parts.set(key, held)
75
+ if (this.id != null) this.ask(key, held)
76
+ return () => {
77
+ if (this.parts.get(key) !== held) return
78
+ this.forget(key, held)
79
+ if (this.id != null && held.sent) this.end(this.id, key, part.base)
80
+ }
81
+ }
82
+
83
+ /** a part whose ask is an ACT (a check's run: asked twice, it would run twice): the caller asks the hub itself,
84
+ * once, and names in that ask the socket's id and the key given here; the part's lines come from then on. It is
85
+ * never asked again: the socket going down tells it `down`, and its owner ends it. null: the socket is down */
86
+ hold(part: Pick<Part, 'base' | 'line' | 'down'>): { page: string; key: string; end: () => void } | null {
87
+ const id = this.id
88
+ if (id == null) return null
89
+ const key = String(++this.keys)
90
+ const held: Held = { part, asks: null, fails: 0, again: null, sent: true }
91
+ this.parts.set(key, held)
92
+ return {
93
+ page: id,
94
+ key,
95
+ end: () => {
96
+ if (this.parts.get(key) !== held) return
97
+ this.forget(key, held)
98
+ if (this.id === id) this.end(id, key, part.base)
99
+ },
100
+ }
101
+ }
102
+
103
+ /** what the page says to one of its terminals, by the part's id: keys, a size, hidden or shown. False: the socket
104
+ * is down, and nothing left the page */
105
+ send(b: PageSend): boolean {
106
+ return this.id != null && this.sock.send(b)
107
+ }
108
+
109
+ /** he waits for the terminals (a key typed into one that is down): the socket is tried now */
110
+ nudge(): void {
111
+ this.sock.nudge()
112
+ }
113
+
114
+ private forget(key: string, held: Held): void {
115
+ this.parts.delete(key)
116
+ if (held.again != null) clearTimeout(held.again)
117
+ held.again = null
118
+ }
119
+
120
+ /** a part of the page that threw: said once where an agent looks, never to the socket's read */
121
+ private fault = (e: unknown): void => {
122
+ const first = (e instanceof Error ? `${e.name}: ${e.message}` : String(e)).split('\n')[0] ?? ''
123
+ if (this.said.has(first) || this.said.size >= 20) return
124
+ this.said.add(first)
125
+ if (this.o.fault != null) this.o.fault(e)
126
+ else panes.report('terminal stream', e, '')
127
+ }
128
+
129
+ /** a part is told something, and what it throws stays its own */
130
+ private tell(say: () => void): void {
131
+ try {
132
+ say()
133
+ } catch (e) {
134
+ this.fault(e)
135
+ }
136
+ }
137
+
138
+ private inLine(job: () => Promise<void>): void {
139
+ this.line = this.line.then(job).catch(() => {})
140
+ }
141
+
142
+ /** the hub is asked for a part on the socket that is open now */
143
+ private ask(key: string, h: Held): void {
144
+ const id = this.id
145
+ const part = h.asks
146
+ if (id == null || part == null) return
147
+ const mine = (): boolean => this.id === id && this.parts.get(key) === h
148
+ this.inLine(async () => {
149
+ if (!mine()) return
150
+ h.sent = true
151
+ let r: Response
152
+ try {
153
+ r = await reach(`${part.base}/api/terminal/${part.route}`, { ...POST, body: JSON.stringify({ ...part.body?.(), page: id, key }) })
154
+ } catch {
155
+ return void (this.id === id && this.sock.drop('the hub does not answer'))
156
+ }
157
+ if (r.ok) return
158
+ const why = await r.text().catch(() => '')
159
+ if (!mine()) return
160
+ // the hub holds no such socket (it restarted between the socket's hello and this ask)
161
+ if (r.status === 410) return this.sock.drop('the hub restarted')
162
+ if (r.status === 403) {
163
+ this.forget(key, h)
164
+ return this.tell(() => part.refused(why))
165
+ }
166
+ this.tell(() => h.part.down(why, r.status))
167
+ // a part that ended itself on that word is not asked again
168
+ if (mine()) this.later(key, h)
169
+ })
170
+ }
171
+
172
+ /** a part the hub ended or did not take is asked again, twice as late each time until it says hello */
173
+ private later(key: string, h: Held): void {
174
+ if (h.again != null) clearTimeout(h.again)
175
+ h.again = setTimeout(() => {
176
+ h.again = null
177
+ if (this.parts.get(key) === h) this.ask(key, h)
178
+ }, (this.o.askIn ?? askIn)(h.fails++))
179
+ }
180
+
181
+ /** the hub is told a part is no longer read. An end it did not take would leave the part alive there (a
182
+ * terminal's client, with its say on the size): the socket ends then, which ends every part for sure */
183
+ private end(id: string, key: string, base: string): void {
184
+ this.inLine(async () => {
185
+ if (this.id !== id) return
186
+ try {
187
+ if ((await reach(`${base}/api/terminal/close`, { ...POST, body: JSON.stringify({ page: id, key }) })).ok) return
188
+ } catch { /* said below */ }
189
+ if (this.id === id) this.sock.drop('the hub does not answer')
190
+ })
191
+ }
192
+
193
+ private take(f: LiveFrame): void {
194
+ if ('k' in f) {
195
+ // a part the page ended: its last lines
196
+ const h = this.parts.get(f.k)
197
+ if (h == null) return
198
+ if (f.l.t === 'gone') {
199
+ this.tell(() => h.part.down('the hub restarted'))
200
+ return this.later(f.k, h)
201
+ }
202
+ if (f.l.t === 'hello') h.fails = 0
203
+ return this.tell(() => h.part.line(f.l, f.repo))
204
+ }
205
+ if (!('t' in f) || f.t !== 'hello') return
206
+ // no id: this socket may not reach a terminal (another machine, the tailnet). Each ask is then refused in words
207
+ this.id = f.id
208
+ for (const [key, h] of this.parts) this.ask(key, h)
209
+ }
210
+
211
+ /** the socket is down: every part is told, and is asked again at the socket's next hello */
212
+ private lost(why: string): void {
213
+ this.id = null
214
+ for (const h of this.parts.values()) {
215
+ if (h.again != null) clearTimeout(h.again)
216
+ h.again = null
217
+ h.sent = false
218
+ }
219
+ for (const [key, h] of [...this.parts]) {
220
+ // a part its owner asked is over with its socket: nothing asks it again
221
+ if (h.asks == null && this.parts.get(key) === h) this.parts.delete(key)
222
+ this.tell(() => h.part.down(why))
223
+ }
224
+ }
225
+ }
226
+
227
+ const streams = new WeakMap<HomeSt, TermStream>()
228
+ /** the terminals' reader of the page's socket: every terminal and every list of the page is a part of it */
229
+ export function termStream(home: HomeSt): TermStream {
230
+ let s = streams.get(home)
231
+ if (s == null) streams.set(home, (s = new TermStream(home.live)))
232
+ return s
233
+ }
@@ -0,0 +1,64 @@
1
+ // a terminal shell's whole page (`/r/<repo>/?shell=terminal`, shell.ts): the repo's terminal as its view last showed
2
+ // it, or what a row's own tab holds (panel-source.ts, tab): ONE terminal (`&w=<terminal>`) or one process's log
3
+ // (`&p=<process>`), edge to edge, nothing of the hub around it. The terminal and the log are the hub's own
4
+ // (terminal-panel.tsx, terminal-pages.tsx), mounted as they are.
5
+ // The one constraint a reader breaks first: a tab on one terminal is that terminal's for its whole life. When the
6
+ // terminal is gone the page says so and offers to close the tab: it never shows another terminal in its place
7
+ import { observer } from 'mobx-react-lite'
8
+ import { useEffect, useRef, useState } from 'react'
9
+ import { appPost } from './app-bridge.ts'
10
+ import type { HomeSt } from './home-st.ts'
11
+ import { TerminalPanel } from './terminal-panel.tsx'
12
+ import { ProcessPage } from './terminal-pages.tsx'
13
+
14
+ /** how long the page waits for the list of terminals before it lets the terminal say why none came */
15
+ const LIST_WAIT_MS = 3_000
16
+
17
+ /** the tab leaves: a project's app closes it on the page's word, a browser closes a tab a script opened */
18
+ const closeTab = (): void => {
19
+ appPost()?.({ closeTab: true })
20
+ window.close()
21
+ }
22
+
23
+ /** what was here is gone: said plainly, with the one act left */
24
+ const Ended = ({ name, why }: { name: string; why: string }) => (
25
+ <div className="stagewrap termaway" data-alone-ended="">
26
+ <h2>{name} <small>ended</small></h2>
27
+ <p>{why}</p>
28
+ <p><button type="button" className="ghost" data-act="close-tab" autoFocus onClick={closeTab}>close tab</button></p>
29
+ </div>
30
+ )
31
+
32
+ const WindowAlone = observer(({ home, id }: { home: HomeSt; id: string }) => {
33
+ const l = home.terminal.list
34
+ useEffect(() => l.use(), [l])
35
+ const [waited, setWaited] = useState(false)
36
+ useEffect(() => {
37
+ const t = setTimeout(() => setWaited(true), LIST_WAIT_MS)
38
+ return () => clearTimeout(t)
39
+ }, [])
40
+ const w = l.windows.find((x) => x.id === id)
41
+ // its name as last listed, for the line that says it ended
42
+ const name = useRef<string | null>(null)
43
+ if (w != null) name.current = w.name
44
+ if (!l.listed) return waited ? <TerminalPanel st={home.terminal} mode="alone" /> : null
45
+ if (w == null) return <Ended name={name.current ?? 'This terminal'} why="This terminal was closed: its program ended and its screen is gone." />
46
+ if (w.gone) return <Ended name={w.name} why={`This terminal ended when the Mac, or what keeps the terminals running, restarted${w.dir === '' ? '' : `. It was in ${w.dir}`}. Its row in the hub opens a new shell there.`} />
47
+ return <TerminalPanel st={home.terminal} mode="alone" />
48
+ })
49
+
50
+ const ProcessAlone = observer(({ home, id }: { home: HomeSt; id: string }) => {
51
+ const m = home.machine
52
+ // the states with their log aside, as the processes section reads them: a log line draws nothing again
53
+ const p = home.shellRepo?.processStates.find((x) => x.id === id) ?? null
54
+ // before pm's first answer nothing is known of it
55
+ if (m == null || m.pm == null) return null
56
+ return p == null ? <Ended name={id} why="No process of this name runs here now: its unit file was removed or renamed." /> : <ProcessPage home={home} p={p} />
57
+ })
58
+
59
+ export const TerminalTab = observer(({ home }: { home: HomeSt }) => {
60
+ const a = home.alone
61
+ if (a != null && 'process' in a) return <ProcessAlone home={home} id={a.process} />
62
+ if (!home.terminal.available) return <div className="ph">the terminal answers on this Mac only: open it at localhost</div>
63
+ return a == null ? <TerminalPanel st={home.terminal} mode="alone" /> : <WindowAlone home={home} id={a.window} />
64
+ })
@@ -0,0 +1,30 @@
1
+ // how many cells a sign takes in the terminal page (terminal-st.ts): the table of xterm's graphemes addon, which
2
+ // clusters a skin tone, a family or a flag into one sign as tmux does, with the emoji it does not know yet. Its table
3
+ // stops at Unicode 13: a later emoji would take one cell where tmux gives it two, and every sign after it on the row
4
+ // would sit one cell off (wiki tools/shipkit/hub.md, The terminal panel)
5
+
6
+ /** a width table as xterm takes one: `charProperties` packs a state, the width (bits 1 and 2) and whether the sign joins the one before (bit 0) */
7
+ export type WidthTable = { readonly version: string; wcwidth(codepoint: number): 0 | 1 | 2; charProperties(codepoint: number, preceding: number): number }
8
+
9
+ /** the emoji Unicode 14 to 17 added, each one wide (EastAsianWidth W), as first and last code point */
10
+ const LATE_EMOJI: [number, number][] = [
11
+ [0x1f6d8, 0x1f6d8], [0x1f6dc, 0x1f6df], [0x1f7f0, 0x1f7f0], [0x1f979, 0x1f979], [0x1f9cc, 0x1f9cc],
12
+ [0x1fa75, 0x1fa77], [0x1fa7b, 0x1fa7c], [0x1fa87, 0x1fa8a], [0x1fa8e, 0x1fa8f], [0x1faa9, 0x1faaf], [0x1fab7, 0x1fabf],
13
+ [0x1fac3, 0x1fac8], [0x1facd, 0x1facf], [0x1fad7, 0x1fadc], [0x1fadf, 0x1fadf], [0x1fae0, 0x1faea], [0x1faef, 0x1faf8],
14
+ ]
15
+ export const lateEmoji = (cp: number): boolean => cp >= 0x1f6d8 && cp <= 0x1faf8 && LATE_EMOJI.some(([a, b]) => cp >= a && cp <= b)
16
+
17
+ export const WIDTHS = 'shipkit'
18
+
19
+ /** `table` with each later emoji two cells wide */
20
+ export function withLateEmoji(table: WidthTable): WidthTable {
21
+ return {
22
+ version: WIDTHS,
23
+ wcwidth: (cp) => (lateEmoji(cp) ? 2 : table.wcwidth(cp)),
24
+ charProperties(cp, preceding) {
25
+ const v = table.charProperties(cp, preceding)
26
+ // one cell and no join: the table took it for a plain sign
27
+ return lateEmoji(cp) && (v & 7) === 2 ? (v & ~6) | 4 : v
28
+ },
29
+ }
30
+ }
@@ -1,15 +1,61 @@
1
- /* the terminal panel at the far right (terminal-panel.tsx) */
2
- .termpanel{display:flex;flex-direction:column;height:100%;min-width:0;background:var(--bg);border-left:1px solid var(--line)}
1
+ /* the terminal panel at the far right (terminal-panel.tsx). A terminal is dark on a page of any theme: hub.css
2
+ declares the dark tokens on .termpanel, so its head line, its surround and its screen read them, and the browser's
3
+ own parts (a scrollbar, the rename field) follow by the scheme */
4
+ .termpanel{display:flex;flex-direction:column;height:100%;min-width:0;background:var(--bg);color:var(--ink);color-scheme:dark;border-left:1px solid var(--line)}
3
5
  .termhead{display:flex;align-items:center;gap:var(--s2);height:28px;padding:0 var(--s2);border-bottom:1px solid var(--line);background:var(--bg-top);font:12px system-ui,sans-serif;color:var(--dim)}
4
6
  .termname{color:var(--ink);font-weight:600;white-space:nowrap}
5
7
  .termnote{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
6
- .termpanel.refused .termnote,.termpanel.ended .termnote{color:var(--warn)}
8
+ .termpanel.refused .termnote,.termpanel.ended .termnote,.termpanel.connecting .termnote,.termpanel.keyslost .termnote{color:var(--warn)}
9
+ /* a terminal that is not read now (the page's stream is down, the hub restarts): its last screen is no live one, and
10
+ looks it. After a moment only, so a view asked anew in passing never blinks */
11
+ .termpanel.connecting .termscreen{opacity:.45;transition:opacity .2s .4s}
7
12
  .termx{height:22px;padding:0 var(--s2);background:none;border:0;color:var(--dim);font-size:16px;cursor:pointer}
8
13
  .termx:hover{color:var(--ink)}
9
- .termhost{flex:1 1 auto;min-height:0;padding:var(--s1) 0 0 var(--s2);overflow:hidden}
14
+ .termbody{flex:1 1 auto;display:flex;min-height:0;min-width:0}
15
+ .termhost{position:relative;flex:1 1 auto;min-width:0;min-height:0;padding:var(--s1) 0 0 var(--s2);overflow:hidden}
16
+ /* the page's own history of the terminal, over the live one while he reads back (terminal-history-st.ts): the same
17
+ box, the same padding, so a line sits where the live terminal drew it */
18
+ .termhist{position:absolute;inset:0;z-index:2;padding:var(--s1) 0 0 var(--s2);background:var(--bg)}
19
+ .termhistback{position:absolute;top:var(--s1);right:var(--s3);z-index:3;height:20px;padding:0 var(--s2);background:var(--panel);border:1px solid var(--line);border-radius:10px;color:var(--dim);font:11px system-ui,sans-serif;cursor:pointer}
20
+ .termhistback:hover{color:var(--ink)}
10
21
  .termscreen{height:100%}
11
22
  .termmenu{z-index:60;display:flex;flex-direction:column;min-width:140px;padding:var(--s1) 0;background:var(--panel);border:1px solid var(--line);border-radius:4px;box-shadow:0 6px 20px var(--shadow);font:12px system-ui,sans-serif}
12
23
  .termmenu button{display:flex;align-items:center;height:24px;padding:0 var(--s2);background:none;border:0;border-radius:0;text-align:left;color:var(--ink);cursor:pointer}
13
24
  .termmenu button:hover:not(:disabled){background:var(--panel2)}
14
25
  .termmenu button:disabled{color:var(--dim);cursor:default}
15
26
  .termmenu small{margin-left:auto;color:var(--dim);font-size:10px}
27
+ /* the terminal alone, a window or a tab of its own (`?shell=terminal`, hub-app.tsx TermPage): the whole tab is the
28
+ terminal, dark edge to edge on a page of any theme, its « ended » words and the push sign in it too (hub.css
29
+ declares the dark tokens on .termfull) */
30
+ .termfull{position:fixed;inset:0;display:flex;flex-direction:column;background:var(--bg);color:var(--ink);color-scheme:dark}
31
+ .termfull .termpanel{flex:1;border-left:0}
32
+ /* a terminal's own page in the main tab, and a process's log (terminal-pages.tsx): the page is the terminal */
33
+ .termpage{display:flex;flex-direction:column;height:100%;min-width:0;min-height:0}
34
+ .termpage .termpanel{flex:1;min-height:0;border-left:0}
35
+ /* the head line of a terminal's page: its name, what runs in it, the title its program set, its acts */
36
+ .termruns{flex:none;white-space:nowrap}
37
+ .termruns.ended{color:var(--warn)}
38
+ /* a terminal of another place: the place it runs on, after its name */
39
+ .termplace{flex:none;white-space:nowrap;padding:0 var(--s1);border:1px solid var(--line);border-radius:3px;color:var(--k2);font-size:11px}
40
+ .termhead .ghost{flex:none;height:20px;padding:0 var(--s1);font-size:11.5px;white-space:nowrap}
41
+ .termlink{display:inline-flex;align-items:center;text-decoration:none}
42
+ .termrename{flex:none;width:160px;height:20px;padding:0 var(--s1);background:var(--bg);border:1px solid var(--accent);border-radius:3px;color:var(--ink);font:inherit}
43
+ .termsure{flex:none;display:flex;align-items:center;gap:var(--s1);color:var(--warn);white-space:nowrap}
44
+ .termdot{flex:none;width:7px;height:7px;border-radius:50%;background:var(--dim)}
45
+ .termdot.up{background:var(--ok)}
46
+ .termdot.starting{background:var(--accent)}
47
+ .termdot.crashed{background:var(--red)}
48
+ /* a log is read, never typed in: no cursor, the text's own pointer */
49
+ .termlog .xterm-cursor-layer,.termlog .xterm-helper-textarea{display:none}
50
+ /* a Claude Code session that runs in no terminal of this hub: words, at the reading width */
51
+ .termaway{display:block;max-width:640px;padding:var(--s4)}
52
+ .termaway h2{margin:0 0 var(--s2)}
53
+ .termaway h2 small{margin-left:var(--s2);color:var(--dim);font-weight:400;font-size:12px}
54
+ .termaway p{margin:var(--s2) 0;line-height:1.5}
55
+ /* the accounts under « + claude » of the panel's terminals head: each row is the main panel's usage row, its columns
56
+ held so the rows line up */
57
+ .termmenu .termacc{height:auto;min-height:24px;gap:var(--s2)}
58
+ /* an account at its usage limit: greyed, its reset said, never picked */
59
+ .termmenu .termacc:disabled .pjuse{opacity:.45}
60
+ .termmenu .termacc .pl-limit{white-space:nowrap}
61
+ .termmenu .pjuse{flex:1;grid-template-columns:28px 92px 1fr;padding:0;border-bottom:0;overflow:visible}
@@ -11,12 +11,14 @@ import type { Resource, SuiteFacts, TestFacts, TestRun } from './hub-types.ts'
11
11
  import { copy, PathCode, Row, Section } from './check-view.tsx'
12
12
  import { editorHref, repoPath } from './check-words.ts'
13
13
  import { stampWords, TimeAgo } from './time-ago.tsx'
14
+ import { tip } from './tips.ts'
14
15
 
15
16
  /** what a file's standing means, in one line under its title */
16
17
  export function standingWords(t: TestFacts): string {
17
18
  if (t.standing === 'runs') return t.tier === 'full' ? `runs in ${t.checkId} on the release path only: it is declared slow` : `runs in ${t.checkId} on every gate`
18
19
  if (t.standing === 'ignored') return `ignored on purpose: the ignore pattern ${t.why} keeps it out of ${t.checkId}`
19
20
  if (t.standing === 'orphan') return `runs in no check: ${t.why}`
21
+ if (t.standing === 'off') return `off in this repo: ${t.why}`
20
22
  if (t.standing === 'opaque') return t.why ?? 'which check runs it cannot be read'
21
23
  return `declared slow in ${t.suite?.configPath ?? 'repo.config.ts'}, but no such file is on disk`
22
24
  }
@@ -36,7 +38,7 @@ const overBudget = (r: TestRun, slow: boolean): boolean => !slow && r.tier === '
36
38
  const dot = (r: TestRun, slow: boolean): string => (r.status === 'fail' ? 'red' : overBudget(r, slow) ? 'warn' : 'ok')
37
39
 
38
40
  const RunLine = ({ app, r, slow }: { app: RepoSt; r: TestRun; slow: boolean }) => (
39
- <div className={`rline rtrun${r.status === 'fail' ? ' red' : ''}`} title={stampWords(r.at)}>
41
+ <div className={`rline rtrun${r.status === 'fail' ? ' red' : ''}`} {...tip(stampWords(r.at))}>
40
42
  <TimeAgo clock={app.clock} at={r.at} />
41
43
  <span className="rid"><i className={`rdot ${dot(r, slow)}`} />{r.status === 'fail' ? 'failed' : 'passed'}</span>
42
44
  <span className={`rnum ${overBudget(r, slow) ? 'bad' : durationTone(r.ms) ?? ''}`}>{fmtMs(r.ms)}</span>
@@ -89,8 +91,8 @@ export const TestCard = observer(({ app, id }: { app: RepoSt; id: string }) => {
89
91
  <div className="usays">{standingWords(t)}{fix == null ? null : <span className={t.toFix?.red === true ? 'tl red' : 'tl warn'}>, to fix: {fix}</span>}</div>
90
92
  <div className="ccmd">
91
93
  <Row k="command" help="runs this file alone, from its unit's dir, with the unit's own preload and bunfig" wide>
92
- <code className="cargv" title={cmd}>{cmd}</code>
93
- <button className="ccopy" title="copy the command" onClick={() => copy(cmd)}>copy</button>
94
+ <code className="cargv" {...tip(cmd)}>{cmd}</code>
95
+ <button className="ccopy" {...tip('copy the command')} onClick={() => copy(cmd)}>copy</button>
94
96
  </Row>
95
97
  </div>
96
98
  <div className="cfacts">
@@ -11,6 +11,7 @@ import { CommandLine, LastRunValue, Row, Says, Section, Timings } from './check-
11
11
  import { durationTone, fmtMs } from './dur.ts'
12
12
  import type { RepoSt } from './repo-st.ts'
13
13
  import { TimeAgo } from './time-ago.tsx'
14
+ import { tip } from './tips.ts'
14
15
 
15
16
  const pct = (n: number | null): string => (n == null ? '' : `${Math.round(n * 100)}%`)
16
17
 
@@ -24,7 +25,7 @@ const TREND_TONE = { up: 'bad', down: 'fast', flat: 'dim' } as const
24
25
  export const SHAPE_WORD: Record<Shape, string> = { tail: 'long tail', volume: 'volume', overhead: 'overhead' }
25
26
 
26
27
  const FileLink = ({ app, file, name }: { app: RepoSt; file: string; name: string }) => (
27
- <a href="#" title={`${file}: its own page`} onClick={(e) => { e.preventDefault(); e.stopPropagation(); app.tests.openFile(file) }}>{name}</a>
28
+ <a href="#" {...tip(`${file}: its own page`)} onClick={(e) => { e.preventDefault(); e.stopPropagation(); app.tests.openFile(file) }}>{name}</a>
28
29
  )
29
30
 
30
31
  // ── failing now ─────────────────────────────────────────────────────────
@@ -37,8 +38,8 @@ const Failing = observer(({ app, rows, showCheck }: { app: RepoSt; rows: Failing
37
38
  {rows.map((r) => (
38
39
  <div key={r.file} className="tfail" onClick={() => app.tests.openFile(r.file)}>
39
40
  <div className={`rline tfline red${showCheck ? ' wc' : ''}`}>
40
- {showCheck ? <span className="rtag" title="the check that runs it">{r.check ?? 'no check'}</span> : null}
41
- <span className="rwhat" title={r.file}>{r.inUnit}</span>
41
+ {showCheck ? <span className="rtag" {...tip('the check that runs it')}>{r.check ?? 'no check'}</span> : null}
42
+ <span className="rwhat" {...tip(r.file)}>{r.inUnit}</span>
42
43
  <span className="rnum">{fmtMs(r.ms)}</span>
43
44
  {r.at == null ? <span /> : <TimeAgo clock={app.clock} at={r.at} />}
44
45
  </div>
@@ -56,11 +57,11 @@ const Summary = observer(({ app, l }: { app: RepoSt; l: LastRun }) => (
56
57
  <div className="tsline">
57
58
  <span><b>{l.files}</b> files</span>
58
59
  <span>sum <b className="dnum">{fmtMs(l.sumMs)}</b></span>
59
- <span title={l.wallFrom === 'runner' ? 'the check run is not on record, so this is the suite runner alone' : 'the check, start to end'}>
60
+ <span {...tip(l.wallFrom === 'runner' ? 'the check run is not on record, so this is the suite runner alone' : 'the check, start to end')}>
60
61
  wall <b className="dnum">{l.wallMs == null ? 'not recorded' : fmtMs(l.wallMs)}</b>{l.wallFrom === 'runner' ? <span className="dim"> (runner)</span> : null}
61
62
  </span>
62
63
  <span>{l.workers == null ? <span className="dim">workers not recorded</span> : l.workers === 0 ? 'one file at a time' : <><b>{l.workers}</b> workers</>}</span>
63
- {l.ratio == null ? null : <span title="the sum of file times over the wall: how many files ran at once, on average">sum/wall <b className="dnum">{l.ratio.toFixed(1)}×</b></span>}
64
+ {l.ratio == null ? null : <span {...tip('the sum of file times over the wall: how many files ran at once, on average')}>sum/wall <b className="dnum">{l.ratio.toFixed(1)}×</b></span>}
64
65
  <span className="dim"><TimeAgo clock={app.clock} at={l.at} /></span>
65
66
  </div>
66
67
  <div className={`tshape ${l.shape ?? ''}`}>{l.shape == null ? null : <b>{SHAPE_WORD[l.shape]}: </b>}{l.shapeWords}</div>
@@ -88,7 +89,7 @@ const PhaseBar = ({ p, wallMs }: { p: Phases; wallMs: number | null }) => {
88
89
  const total = Math.max(1, wallMs ?? parts.reduce((n, x) => n + x.ms, 0))
89
90
  return (
90
91
  <div className="tpbar">
91
- {parts.map((x) => <i key={x.k} className={x.cls} style={{ width: `${Math.max(0.5, (x.ms / total) * 100)}%` }} title={`${x.word}: ${fmtMs(x.ms)}`} />)}
92
+ {parts.map((x) => <i key={x.k} className={x.cls} style={{ width: `${Math.max(0.5, (x.ms / total) * 100)}%` }} {...tip(`${x.word}: ${fmtMs(x.ms)}`)} />)}
92
93
  </div>
93
94
  )
94
95
  }
@@ -127,24 +128,24 @@ const FileRows = observer(({ app, files }: { app: RepoSt; files: FileTime[] }) =
127
128
  <div className="rhead rtime">
128
129
  <span className="tleft">file</span>
129
130
  <span>duration</span>
130
- <span title="CPU the file burned alone, known only where a process ran it alone">cpu</span>
131
+ <span {...tip('CPU the file burned alone, known only where a process ran it alone')}>cpu</span>
131
132
  <span className="tleft">share</span>
132
133
  <span>budget</span>
133
- <span title="the last run against the mean of its earlier ones">trend</span>
134
+ <span {...tip('the last run against the mean of its earlier ones')}>trend</span>
134
135
  <span>tier</span>
135
136
  </div>
136
137
  {files.map((f) => (
137
- <div key={f.file} className={`rline rtime${f.status === 'fail' ? ' red' : ''}`} title={f.file} onClick={() => app.tests.openFile(f.file)}>
138
+ <div key={f.file} className={`rline rtime${f.status === 'fail' ? ' red' : ''}`} {...tip(f.file)} onClick={() => app.tests.openFile(f.file)}>
138
139
  <span className="rwhat">{f.inUnit}</span>
139
- <span className={`rnum ${fileTone(f)}`} title={f.judgedMs == null ? undefined : `its wall in the shared run. Run again alone, the budget judged ${fmtMs(f.judgedMs)}`}>
140
+ <span className={`rnum ${fileTone(f)}`} {...tip(f.judgedMs == null ? undefined : `its wall in the shared run. Run again alone, the budget judged ${fmtMs(f.judgedMs)}`)}>
140
141
  {f.ms == null ? <span className="dim">never ran</span> : fmtMs(f.ms)}
141
142
  </span>
142
143
  <span className="rnum dim">{fmtMs(f.cpuMs)}</span>
143
- <span className="tshare" title={f.inLastRun ? `${pct(f.share)} of the sum of the last run` : 'not in the last run'}>
144
+ <span className="tshare" {...tip(f.inLastRun ? `${pct(f.share)} of the sum of the last run` : 'not in the last run')}>
144
145
  {f.share == null ? <span className="dim">{f.ms == null ? '' : 'older run'}</span> : <><span className="ttrack"><i style={{ width: `${Math.max(1, f.share * 100)}%` }} /></span><span className="rnum">{pct(f.share)}</span></>}
145
146
  </span>
146
147
  <span className="rnum dim">{fmtMs(f.budgetMs)}</span>
147
- <span className={`rnum ${f.trend == null ? '' : TREND_TONE[f.trend]}`} title={f.avgMs == null ? 'no earlier run to compare' : `mean of its earlier runs: ${fmtMs(f.avgMs)}`}>{f.trend == null ? '' : TREND_GLYPH[f.trend]}</span>
148
+ <span className={`rnum ${f.trend == null ? '' : TREND_TONE[f.trend]}`} {...tip(f.avgMs == null ? 'no earlier run to compare' : `mean of its earlier runs: ${fmtMs(f.avgMs)}`)}>{f.trend == null ? '' : TREND_GLYPH[f.trend]}</span>
148
149
  <span className="rtag dim">{f.tier === 'full' ? 'release' : 'quick'}{f.phase === 'serial' ? ', serial' : ''}</span>
149
150
  </div>
150
151
  ))}
@@ -169,7 +170,7 @@ export const TestCheckPage = observer(({ app, check }: { app: RepoSt; check: str
169
170
  <div className="chead">
170
171
  <span className="tid">test check</span>
171
172
  <h3 className={`ctitle tl ${i?.state ?? 'idle'}`}>{check}</h3>
172
- <a href="#" className="dim" title="its check page: when it runs, what it printed" onClick={(e) => { e.preventDefault(); app.timeline.openCheck(check) }}>check page</a>
173
+ <a href="#" className="dim" {...tip('its check page: when it runs, what it printed')} onClick={(e) => { e.preventDefault(); app.timeline.openCheck(check) }}>check page</a>
173
174
  <span className="sp" />
174
175
  <button className="primary urun" disabled={app.checks.busy} onClick={() => void app.checks.run([check])}>
175
176
  {live ? <><span className="spin" />running</> : 'run it now'}
@@ -232,9 +233,9 @@ const AllFiles = observer(({ app, rows }: { app: RepoSt; rows: TestFileRow[] })
232
233
  <span>when</span>
233
234
  </div>
234
235
  {rows.map((f) => (
235
- <div key={f.file} className={`rline rall${f.status === 'fail' ? ' red' : ''}`} title={f.file} onClick={() => app.tests.openFile(f.file)}>
236
+ <div key={f.file} className={`rline rall${f.status === 'fail' ? ' red' : ''}`} {...tip(f.file)} onClick={() => app.tests.openFile(f.file)}>
236
237
  <span className="rwhat">{f.inUnit}</span>
237
- <span className="rtag" title="the check that runs it">{f.check}</span>
238
+ <span className="rtag" {...tip('the check that runs it')}>{f.check}</span>
238
239
  <span className={`rnum ${fileTone(f)}`}>{f.ms == null ? <span className="dim">never ran</span> : fmtMs(f.ms)}</span>
239
240
  <span className={`rnum ${f.status === 'fail' ? 'bad' : 'dim'}`}>{f.status == null ? '' : STATUS_WORD[f.status]}</span>
240
241
  {f.at == null ? <span /> : <TimeAgo clock={app.clock} at={f.at} />}
@@ -52,6 +52,11 @@ export class ThemeSt {
52
52
  } catch { /* private window or blocked site data: the pick lasts the tab */ }
53
53
  }
54
54
 
55
+ /** the theme under the one picked in the button's list, round to the first: what its key picks (keys.ts THEME_KEY) */
56
+ next(): void {
57
+ this.set(THEMES[(THEMES.indexOf(this.pick) + 1) % THEMES.length]!)
58
+ }
59
+
55
60
  toggleMenu(): void {
56
61
  this.menuOpen = !this.menuOpen
57
62
  }