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
@@ -3,7 +3,7 @@
3
3
  // this script, in the page's head, puts ONE quiet line at the bottom of it: « a change in <file> does not build;
4
4
  // showing the last good ». A click on the line opens the error above it: the bundler's message, the file and line,
5
5
  // the code around it with the line marked (the web reads it, heldSource), « copy error ». A page loaded while the
6
- // build fails names the errors in its head; an open page is told them on the push stream (push-svc.ts calls the hook),
6
+ // build fails names the errors in its head; an open page is told them on its socket (push-svc.ts calls the hook),
7
7
  // and reloads once a build heals.
8
8
  //
9
9
  // the one constraint a reader breaks first: `heldBuild` ships as its own source text (heldBuildScript), so it
@@ -39,14 +39,6 @@ if (import.meta.main) {
39
39
  const u = await scanGlobalUnits(repos.map((r) => ({ name: r.name, path: r.path })), { files: (r) => files.get(r) ?? [] })
40
40
  out.processes = u.processes
41
41
  out.errors = u.errors
42
- // the orchestrators he turned on: one keeper a repo (orchestrator/switch.ts), read with the units
43
- const { orchestratorDecls, switchFile } = await import('../orchestrator/switch.ts')
44
- out.inputs.push(switchFile())
45
- out.stamp = stampOf(out.inputs)
46
- for (const d of orchestratorDecls(repos.map((r) => ({ name: r.name, path: r.path })), join(import.meta.dir, '..', 'cli.ts'))) {
47
- if (out.processes.some((p) => p.id === d.id)) out.errors.push(`the orchestrator of ${d.repo}: a global process '${d.id}' is already declared`)
48
- else out.processes.push(d)
49
- }
50
42
  }
51
43
  process.stdout.write(JSON.stringify(out))
52
44
  }
package/src/home/pm.ts CHANGED
@@ -15,6 +15,8 @@ import { iconImageType } from '../core/icon-type.ts'
15
15
  import { sameOrigin } from '../http/same-origin.ts'
16
16
  import { readBeat } from './beat.ts'
17
17
  import { childBeat, childLog, childPid, daemonPort, homePort, pmLog, pmPort } from './home-paths.ts'
18
+ import { followLog } from './log-follow.ts'
19
+ import { placedOn } from '../orchestrator/places-file.ts'
18
20
  import type { Resources, ResourceView } from './resources.ts'
19
21
  import { capLog, Proc, realDeps, tailLines, type ProcView, type SuperviseDeps } from './supervise.ts'
20
22
 
@@ -69,6 +71,9 @@ export type PmDeps = {
69
71
  later?: (f: () => void) => void
70
72
  /** where pm says what it did on its own, a hung child killed */
71
73
  say?: (line: string) => void
74
+ /** the places a repo is placed on when this place is not one of them, null when it runs here (default: the places
75
+ * view, orchestrator/places.ts placedOn) */
76
+ placedOn?: (repo: string) => { name: string }[] | null
72
77
  }
73
78
 
74
79
  const WEB_ANSWER_MS = 200
@@ -102,11 +107,37 @@ export class Pm {
102
107
 
103
108
  /** every child up: adopted from its pid record, else started, unless
104
109
  * something else already answers its port. A cold pm (no child to
105
- * adopt: a login, a reboot) also starts each process declared atLogin */
110
+ * adopt: a login, a reboot) also starts each process declared atLogin,
111
+ * except one whose repo the owner placed on other places only */
106
112
  async boot(): Promise<void> {
107
113
  await Promise.all([...this.children.values()].map((p) => p.ensure()))
108
114
  if ([...this.children.values()].some((p) => p.adopted)) return
109
- await Promise.all(this.d.resources.list.filter((r) => r.decl.atLogin).map((r) => r.set('up')))
115
+ const start = this.d.resources.list.filter((r) => {
116
+ if (!r.decl.atLogin) return false
117
+ const on = this.placed(r.decl.repo)
118
+ if (on !== null) this.d.say?.(`${r.decl.id} not started: ${r.decl.repo} is placed on ${on.join(', ')} (sk place ${r.decl.repo})`)
119
+ return on === null
120
+ })
121
+ await Promise.all(start.map((r) => r.set('up')))
122
+ }
123
+
124
+ /** the names of the places `repo` is placed on when this place is not one of them; null when it runs here, and when
125
+ * the view cannot be read: a placement never read starts what it always started */
126
+ private placed(repo: string): string[] | null {
127
+ try {
128
+ const on = (this.d.placedOn ?? placedOn)(repo)
129
+ return on === null || on.length === 0 ? null : on.map((p) => p.name)
130
+ } catch {
131
+ return null
132
+ }
133
+ }
134
+
135
+ /** the processes as the page shows them, each worn with the places its repo is placed on */
136
+ private views(): ResourceView[] {
137
+ return this.d.resources.views().map((v) => {
138
+ const on = this.placed(v.repo)
139
+ return on === null ? v : { ...v, placedOn: on }
140
+ })
110
141
  }
111
142
 
112
143
  async tick(): Promise<void> {
@@ -121,7 +152,7 @@ export class Pm {
121
152
  const v = p.view()
122
153
  return `${v.id}:${v.status}:${v.pid}:${v.restarts}:${v.want}:${v.note ?? ''}`
123
154
  })
124
- const res = this.d.resources.list.map((r) => `${r.decl.id}:${r.status}:${r.want}:${r.note ?? ''}:${r.canStop}:${JSON.stringify(r.takeOverView ?? null)}`)
155
+ const res = this.d.resources.list.map((r) => `${r.decl.id}:${r.status}:${r.want}:${r.note ?? ''}:${r.canStop}:${JSON.stringify(r.takeOverView ?? null)}:${this.placed(r.decl.repo)?.join(',') ?? ''}`)
125
156
  return Bun.hash([...kids, ...res, this.d.resources.errors.join('\n')].join('|')).toString(36)
126
157
  }
127
158
 
@@ -155,7 +186,7 @@ export class Pm {
155
186
  return { ...v, since: (v.status === 'up' ? p.startedAt() : null) ?? v.since, tail: tailLines(p.spec.log, CORE_TAIL) }
156
187
  })
157
188
  const ports = { pm: this.d.port ?? pmPort(), daemon: daemonPort(), web: homePort() }
158
- return { pm: 'shipkit-pm', pid: process.pid, since: this.startedAt, version: LIB_VERSION, ports, tail: tailLines(pmLog(this.d.dir), CORE_TAIL), children, resources: this.d.resources.views(), unitErrors: this.d.resources.errors }
189
+ return { pm: 'shipkit-pm', pid: process.pid, since: this.startedAt, version: LIB_VERSION, ports, tail: tailLines(pmLog(this.d.dir), CORE_TAIL), children, resources: this.views(), unitErrors: this.d.resources.errors }
159
190
  }
160
191
 
161
192
  /** the image a global process declares as its icon, and no other file */
@@ -168,7 +199,33 @@ export class Pm {
168
199
  return new Response(Bun.file(file), { headers: { 'content-type': type, 'cache-control': 'no-cache' } })
169
200
  }
170
201
 
171
- async handle(req: Request): Promise<Response> {
202
+ /** the log of one process, of pm's own or of a child, null for an id pm runs nothing under */
203
+ logOf(id: string): string | null {
204
+ if (id === 'pm') return pmLog(this.d.dir)
205
+ if ((ROLES as string[]).includes(id)) return childLog(this.d.dir, id)
206
+ return this.d.resources.get(id)?.log ?? null
207
+ }
208
+
209
+ /** a process's log as a stream for one viewer: its last lines, then each write as it lands, until the viewer goes
210
+ * (log-follow.ts). `quiet`: the server never cuts it for its silence */
211
+ private log(u: URL, quiet: () => void): Response {
212
+ const id = u.searchParams.get('id') ?? ''
213
+ const file = this.logOf(id)
214
+ if (file == null) return new Response(`no process '${id}': pm runs ${ROLES.join(', ')}, itself and the global processes of the house repos`, { status: 404 })
215
+ const n = Number(u.searchParams.get('lines'))
216
+ quiet()
217
+ return new Response(followLog(file, Number.isInteger(n) && n > 0 ? { lines: n } : {}), { headers: { 'content-type': 'text/plain; charset=utf-8', 'cache-control': 'no-store' } })
218
+ }
219
+
220
+ /** `srv`: the server that took the request, so a stream that stays silent is not cut */
221
+ async handle(req: Request, srv?: { timeout(r: Request, s: number): void }): Promise<Response> {
222
+ const u = new URL(req.url)
223
+ if (u.pathname === '/api/pm/log' && req.method === 'GET') {
224
+ // a stream is a standing cost (a file watched for as long as it is read): a page of another site opens none
225
+ const site = req.headers.get('sec-fetch-site')
226
+ if (site != null && site !== 'same-origin' && site !== 'none') return new Response('refused: a log is read from the home page', { status: 403 })
227
+ return this.log(u, () => srv?.timeout(req, 0))
228
+ }
172
229
  const r = await this.route(req)
173
230
  if (req.method === 'POST') this.publish()
174
231
  return r
@@ -1,8 +1,10 @@
1
- // every global process with a url as its own macOS app in ~/Applications,
2
- // named by its `app` (else its label), where Spotlight and Launchpad find it.
3
- // The daemon's `apps` job (home/daemon-jobs.ts) builds what is missing or
4
- // stale through home/gui-app.ts, and removes the apps of a process renamed or
5
- // gone. A repo's `.shipkit/wrapper/` holds no app: any shipkit bundle there is removed too.
1
+ // every house repo and every global process with a url as its own macOS app
2
+ // in ~/Applications, where Spotlight, Launchpad and cmd-tab find it: a project
3
+ // app named after its repo, a process app by its `app` (else its label). The
4
+ // daemon's `apps` job (home/daemon-jobs.ts) builds what is missing or stale
5
+ // through home/gui-app.ts, and removes the apps of a process renamed or gone
6
+ // and of a repo that left the house. A repo's `.shipkit/wrapper/` holds no app:
7
+ // any shipkit bundle there is removed too.
6
8
  //
7
9
  // the one constraint a reader breaks first: the sweep removes only a bundle
8
10
  // shipkit built (shipkitBundleOf), never another app of the folder, and
@@ -12,6 +14,7 @@ import { existsSync, readdirSync, readFileSync, rmdirSync, rmSync, statSync } fr
12
14
  import { homedir } from 'os'
13
15
  import { join } from 'path'
14
16
  import { fileURLToPath } from 'url'
17
+ import { ICON_DRAWING } from '../core/app-icon-frame.ts'
15
18
  import { repoUnitFiles } from '../core/repo-walk.ts'
16
19
  import { LAYOUT } from '../core/layout.ts'
17
20
  import { yieldLoop } from '../core/loop-watch.ts'
@@ -24,36 +27,59 @@ export const GUI_SOURCE = fileURLToPath(new URL('./gui-app/ShipkitGui.swift', im
24
27
  /** where every app shipkit builds lands: Spotlight indexes it, and skips a dot folder or a symlink */
25
28
  export const appsDir = (home = homedir()): string => join(home, 'Applications')
26
29
 
27
- /** every process app's bundle id starts so: the sweep removes nothing else */
30
+ /** every process app's bundle id starts so */
28
31
  export const WRAPPER_PREFIX = 'dev.shipkit.app.'
29
- export const wrapperBundleId = (id: string): string => `${WRAPPER_PREFIX}${id.replace(/[^A-Za-z0-9-]+/g, '-')}`
32
+ /** every project app's: its own, since a process id can be a repo's name */
33
+ export const PROJECT_PREFIX = 'dev.shipkit.project.'
34
+ const idPart = (id: string): string => id.replace(/[^A-Za-z0-9-]+/g, '-')
35
+ export const wrapperBundleId = (id: string): string => `${WRAPPER_PREFIX}${idPart(id)}`
36
+ export const projectBundleId = (repo: string): string => `${PROJECT_PREFIX}${idPart(repo)}`
30
37
 
31
38
  type Named = { label: string; app?: string | null }
32
39
  export const appNameOf = (d: Named): string => d.app ?? d.label
33
40
  export const wrapperPath = (d: Named, dir = appsDir()): string => join(dir, `${appNameOf(d).replace(/[/:]+/g, '-')}.app`)
34
41
 
35
- /** the bundle id of a process app shipkit built (its id under WRAPPER_PREFIX
36
- * and its build stamp), or null for any other app */
42
+ /** the bundle id of a process or project app shipkit built (its id under
43
+ * WRAPPER_PREFIX or PROJECT_PREFIX, and its build stamp), or null for any other app: the sweep removes nothing else */
37
44
  export function shipkitBundleOf(app: string): string | null {
38
45
  const plist = join(app, 'Contents', 'Info.plist')
39
46
  if (!existsSync(plist) || !existsSync(join(app, 'Contents', 'Resources', 'stamp'))) return null
40
47
  let text: string
41
48
  try { text = readFileSync(plist, 'utf8') } catch { return null }
42
49
  const id = /<key>CFBundleIdentifier<\/key>\s*<string>([^<]*)<\/string>/.exec(text)?.[1] ?? null
43
- return id?.startsWith(WRAPPER_PREFIX) ? id : null
50
+ return id != null && (id.startsWith(WRAPPER_PREFIX) || id.startsWith(PROJECT_PREFIX)) ? id : null
44
51
  }
45
52
 
46
53
  /** a process as its app needs it (WrapperOf in gui-app.ts) */
47
54
  export type AppOf = Named & { id: string; url: string | null; icon: string | null; root: string }
48
55
 
49
- /** the apps the processes want, one a name. The folder is case blind, so
50
- * two names that differ by case are one: the second process gets no app */
51
- export function plannedApps<T extends AppOf>(processes: T[], dir: string, reserved: string[] = []): { want: { d: T; path: string }[]; errors: string[] } {
56
+ /** a house repo as its app needs it (ProjectOf in gui-app.ts): its folder name, the hub's name for it */
57
+ export type ProjectOf = { name: string; root: string }
58
+ export const projectPath = (r: { name: string }, dir = appsDir()): string => join(dir, `${r.name.replace(/[/:]+/g, '-')}.app`)
59
+
60
+ /** the apps the repos and the processes want, one a name. A project app is
61
+ * named after its repo and planned first; a process whose name a project
62
+ * takes is `<name> app`. The folder is case blind, so two names that differ
63
+ * by case are one: the second gets no app */
64
+ export function plannedApps<T extends AppOf>(processes: T[], dir: string, reserved: string[] = [], repos: ProjectOf[] = []): { want: { d: T; path: string }[]; projects: { r: ProjectOf; path: string }[]; errors: string[] } {
52
65
  const taken = new Map<string, string>(reserved.map((p) => [p.toLowerCase(), 'another app']))
66
+ const projects: { r: ProjectOf; path: string }[] = []
53
67
  const want: { d: T; path: string }[] = []
54
68
  const errors: string[] = []
55
- for (const d of processes) {
56
- if (d.url == null) continue
69
+ for (const r of repos) {
70
+ const path = projectPath(r, dir)
71
+ const by = taken.get(path.toLowerCase())
72
+ if (by != null) {
73
+ errors.push(`repo ${r.name}: its app name is ${by}'s too, so it gets no app`)
74
+ continue
75
+ }
76
+ taken.set(path.toLowerCase(), `repo ${r.name}`)
77
+ projects.push({ r, path })
78
+ }
79
+ const project = new Set(projects.map((p) => p.path.toLowerCase()))
80
+ for (const p of processes) {
81
+ if (p.url == null) continue
82
+ const d = project.has(wrapperPath(p, dir).toLowerCase()) ? { ...p, app: `${appNameOf(p)} app` } : p
57
83
  const path = wrapperPath(d, dir)
58
84
  const by = taken.get(path.toLowerCase())
59
85
  if (by != null) {
@@ -63,10 +89,10 @@ export function plannedApps<T extends AppOf>(processes: T[], dir: string, reserv
63
89
  taken.set(path.toLowerCase(), d.id)
64
90
  want.push({ d, path })
65
91
  }
66
- return { want, errors }
92
+ return { want, projects, errors }
67
93
  }
68
94
 
69
- /** the bundles shipkit built in these folders that no process wants */
95
+ /** the bundles shipkit built in these folders that no process or repo wants */
70
96
  export function staleApps(dirs: string[], keep: string[]): string[] {
71
97
  const kept = new Set(keep.map((p) => p.toLowerCase()))
72
98
  const out: string[] = []
@@ -81,6 +107,9 @@ export function staleApps(dirs: string[], keep: string[]): string[] {
81
107
  return out
82
108
  }
83
109
 
110
+ /** where WebKit keeps an app's cookies, storage and cache: the sweep names it and never deletes it */
111
+ export const webkitDataOf = (bundleId: string, home = homedir()): string => join(home, 'Library', 'WebKit', bundleId)
112
+
84
113
  const LSREGISTER = '/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister'
85
114
 
86
115
  /** removes a bundle, and tells launch services it is gone, so Launchpad drops it */
@@ -91,6 +120,9 @@ const removeReal = (app: string): void => {
91
120
 
92
121
  export type AppsTickIo = {
93
122
  processes: AppOf[]
123
+ /** the house repos that get a project app. Empty: the walk failed (the house repo is always in it), so no
124
+ * project app is removed */
125
+ projects?: ProjectOf[]
94
126
  /** the scan's errors: a unit file that did not load stops the sweep */
95
127
  scanErrors: string[]
96
128
  /** the house repos: each one's `.shipkit/wrapper/` is swept */
@@ -98,20 +130,32 @@ export type AppsTickIo = {
98
130
  dir: string
99
131
  /** builds one app (gui-app.ts ensureWrapperApp); null: none can be built here */
100
132
  build: ((d: AppOf, dir: string) => Promise<{ app: string; rebuilt: boolean }>) | null
133
+ /** builds one project app (gui-app.ts ensureProjectApp); null: none can be built here */
134
+ buildProject?: ((r: ProjectOf, dir: string) => Promise<{ app: string; rebuilt: boolean }>) | null
101
135
  /** paths in `dir` no process may take (the shipkit app) */
102
136
  reserved?: string[]
103
137
  remove?: (app: string) => void
138
+ /** the user's home, where each app's WebKit data lives */
139
+ home?: string
104
140
  print: (l: string) => void
105
141
  printErr: (l: string) => void
106
142
  }
107
143
 
108
144
  /** one pass: build what is missing or stale, then remove the stale */
109
145
  export async function appsTick(o: AppsTickIo): Promise<{ built: string[]; removed: string[] }> {
110
- const { want, errors } = plannedApps(o.processes, o.dir, o.reserved)
146
+ const { want, projects, errors } = plannedApps(o.processes, o.dir, o.reserved, o.projects)
111
147
  for (const e of errors) o.printErr(`WARN ${e}`)
112
148
  const built: string[] = []
113
149
  if (o.build == null) o.printErr('WARN no app built: this machine has no swiftc and iconutil, or is not macOS')
114
150
  else {
151
+ for (const { r } of o.buildProject == null ? [] : projects) {
152
+ try {
153
+ const b = await o.buildProject!(r, o.dir)
154
+ if (b.rebuilt) built.push(b.app)
155
+ } catch (e) {
156
+ o.printErr(`WARN the app of repo ${r.name} was not built: ${(e as Error).message}`)
157
+ }
158
+ }
115
159
  for (const { d } of want) {
116
160
  try {
117
161
  const r = await o.build(d, o.dir)
@@ -127,10 +171,13 @@ export async function appsTick(o: AppsTickIo): Promise<{ built: string[]; remove
127
171
  return { built, removed: [] }
128
172
  }
129
173
  const homes = o.repos.map((r) => join(r, LAYOUT.wrapper))
130
- const removed = staleApps([o.dir, ...homes], want.map((w) => w.path))
174
+ const noRepos = (o.projects ?? []).length === 0
175
+ if (noRepos) o.printErr('WARN no project app removed: the house lists no repo, so its walk failed')
176
+ const removed = staleApps([o.dir, ...homes], [...projects, ...want].map((w) => w.path)).filter((p) => !noRepos || !shipkitBundleOf(p)!.startsWith(PROJECT_PREFIX))
131
177
  for (const app of removed) {
178
+ const data = webkitDataOf(shipkitBundleOf(app)!, o.home)
132
179
  ;(o.remove ?? removeReal)(app)
133
- o.print(`ok: removed ${app}, no process has it`)
180
+ o.print(`ok: removed ${app}, no process or repo has it${existsSync(data) ? `; its WebKit data stays at ${data} (the owner deletes it)` : ''}`)
134
181
  }
135
182
  for (const home of homes) {
136
183
  try { if (readdirSync(home).length === 0) rmdirSync(home) } catch { /* absent */ }
@@ -156,7 +203,7 @@ const statOf = (f: string | null): string => {
156
203
  }
157
204
 
158
205
  /** the outside of what the apps are made of, a stat each: every repo's unit
159
- * files and wrapper folder, the window's source, the names in the apps
206
+ * files, wrapper folder and mark, the window's source, the icon's drawing, the names in the apps
160
207
  * folder (an app deleted by hand comes back). Null off macOS or with no house */
161
208
  export async function appsSourcesStamp(root: string, home: string = homedir(), platform = process.platform): Promise<string | null> {
162
209
  if (platform !== 'darwin') return null
@@ -164,10 +211,10 @@ export async function appsSourcesStamp(root: string, home: string = homedir(), p
164
211
  if (h.index == null) return null
165
212
  let names: string[] = []
166
213
  try { names = readdirSync(appsDir(home)).filter((n) => n.endsWith('.app')).sort() } catch { /* no folder yet */ }
167
- const parts = [statOf(GUI_SOURCE), names.join('|')]
214
+ const parts = [statOf(GUI_SOURCE), ICON_DRAWING, names.join('|')]
168
215
  for (const r of h.repos) {
169
216
  await yieldLoop()
170
- parts.push(r.path, String(existsSync(join(r.path, LAYOUT.wrapper))))
217
+ parts.push(r.path, String(existsSync(join(r.path, LAYOUT.wrapper))), statOf(r.icon == null ? null : join(r.path, r.icon)))
171
218
  for (const f of repoUnitFiles(r.path)) parts.push(f, statOf(f))
172
219
  }
173
220
  return createHash('sha256').update(parts.join('\n')).digest('hex').slice(0, 16)
@@ -4,6 +4,7 @@
4
4
  // The page's table and the command's text and json are all drawn from these
5
5
  // rows, so the two can never disagree. A row carries no clock: ages are words
6
6
  // computed at render time from `since`.
7
+ import { unitIconWords } from '../core/unit-icon.ts'
7
8
  import type { GlobalProcessDecl } from './global-units.ts'
8
9
  import type { CorePorts, PmAnswer } from './pm.ts'
9
10
  import type { ProcessIcon, ResourceView } from './resources.ts'
@@ -49,6 +50,8 @@ export type ProcessRow = {
49
50
  icon: ProcessIcon | null
50
51
  /** its own app is being built or opened */
51
52
  appBusy: boolean
53
+ /** its repo is placed on these other places, not here: pm starts it there, never here at its next start */
54
+ placedOn?: string[]
52
55
  }
53
56
 
54
57
  /** a repo's processes, or shipkit's own (`core`, always the first group) */
@@ -89,6 +92,7 @@ export function rowOf(r: ResourceView): ProcessRow {
89
92
  running: r.running,
90
93
  icon: r.icon,
91
94
  appBusy: r.appBusy === true,
95
+ ...(r.placedOn != null && r.placedOn.length > 0 ? { placedOn: r.placedOn } : {}),
92
96
  }
93
97
  }
94
98
 
@@ -119,7 +123,7 @@ export function declaredRow(d: GlobalProcessDecl): ProcessRow {
119
123
  running: null,
120
124
  appBusy: false,
121
125
  // an image is pm's to serve, and pm does not answer
122
- icon: d.icon == null || /\.[a-z0-9]+$/i.test(d.icon) ? null : { text: d.icon },
126
+ icon: d.icon == null || /\.[a-z0-9]+$/i.test(d.icon) ? null : unitIconWords(d.icon),
123
127
  }
124
128
  }
125
129
 
@@ -210,6 +214,17 @@ export function spanWords(ms: number): string {
210
214
  return `${Math.floor(s / 86400)}d`
211
215
  }
212
216
 
217
+ /** how long a row has been up, or crashed, the age alone (`2h`): the table's « since » column. '' for a state with no
218
+ * age to say (stopped, starting, unknown, silent) and where pm never said */
219
+ export function sinceWords(r: Pick<ProcessRow, 'status' | 'since'>, now: number): string {
220
+ return r.since != null && (r.status === 'up' || r.status === 'crashed') ? spanWords(now - r.since) : ''
221
+ }
222
+
223
+ /** the short word a row keeps beside its state square: none for plain up or down, which the square's colour says */
224
+ export function oddWord(r: Pick<ProcessRow, 'status'>): string {
225
+ return r.status === 'up' || r.status === 'down' ? '' : r.status === 'silent' ? 'no answer' : r.status
226
+ }
227
+
213
228
  /** the state in words: `up 2h`, `crashed 3m ago`, `stopped`, `starting` */
214
229
  export function stateWords(r: Pick<ProcessRow, 'status' | 'since'>, now: number): string {
215
230
  const age = r.since == null ? null : spanWords(now - r.since)
@@ -2,14 +2,16 @@
2
2
  // sign of a write, never the answer itself. Read every 500 ms while a page listens, so each one costs microseconds:
3
3
  // a stat, a counter, a few small files. What has no cheap sign (a lane's transcript, appended every turn) is followed by
4
4
  // a stat of the files written lately alone, the whole listing taken again every 30 s.
5
- // the one constraint a reader breaks first: a stamp holds no clock and no beat (a keeper's pass, a duration), or every
5
+ // the one constraint a reader breaks first: a stamp holds no clock and no beat (a watch's pass, a duration), or every
6
6
  // read says it moved and the page reads again four times a second
7
7
  import { readdirSync, statSync } from 'fs'
8
- import { join } from 'path'
8
+ import { dirname, join } from 'path'
9
9
  import { readSessionRecords } from '../agent-time/registry.ts'
10
10
  import { listTranscripts } from '../agent-time/store.ts'
11
- import { orchestratorLive, readKeepers } from '../orchestrator/state.ts'
12
- import { switchFile } from '../orchestrator/switch.ts'
11
+ import { channelsDir, roleDir } from '../orchestrator/role.ts'
12
+ import { readStarts, startsFile } from '../orchestrator/started.ts'
13
+ import { discoverConfigRoots } from '../reflect/prompt-corpus.ts'
14
+ import { storeDir } from '../review/store.ts'
13
15
  import { BEAT_STALE_MS, pidAlive } from '../review/watchers.ts'
14
16
 
15
17
  /** a file's mtime and size, '-' when it is gone */
@@ -45,13 +47,16 @@ export function held<T = string>(ms: number, f: () => T, now: () => number = Dat
45
47
  }
46
48
  }
47
49
 
48
- const keepers = held(1_000, () => readKeepers())
49
50
  const records = held(1_000, () => readSessionRecords())
50
51
 
51
- /** the keepers as the page shows them: each one's beat aside, its liveness in, and the switch that turns them on */
52
- export const keepersStamp = held(1_000, () => {
53
- const now = Date.now()
54
- return `${keepers().map((k) => JSON.stringify({ ...k, beat: null, live: orchestratorLive(k, now) })).join('\n')}|${fileStamp(switchFile())}`
52
+ /** what moves an orchestrator's line (orchestrator/now.ts reads the rest when asked): his starts, the role records and
53
+ * the channels (orchestrator/role.ts), the watches of each project he started one in, and Claude Code's own file of
54
+ * each process (one a process, its state busy or idle) */
55
+ export const orchestratorsStamp = held(1_000, () => {
56
+ const starts = readStarts()
57
+ const watches = Object.values(starts).map((s) => watchersStamp(storeDir(s.root))).join(';')
58
+ const claudes = discoverConfigRoots().map((r) => dirStamp(join(dirname(r.projects), 'sessions'))).join(';')
59
+ return `${fileStamp(startsFile())}|${dirStamp(roleDir())}|${dirStamp(channelsDir())}|${watches}|${claudes}`
55
60
  })
56
61
 
57
62
  /** the sessions the registry holds, and whether each one's process lives */
@@ -121,12 +126,12 @@ export function watchersStamp(store: string, now = Date.now()): string {
121
126
  }
122
127
  }
123
128
 
124
- /** the sessions that acted in a store (the registry's records) and the live keepers: whose transcripts its parties read */
125
- const storeSessions = (store: string): Set<string> => new Set([...records().filter((r) => r.stores.includes(store)).map((r) => r.session), ...keepers().map((k) => k.session)])
129
+ /** the sessions that acted in a store (the registry's records): whose transcripts its parties read */
130
+ const storeSessions = (store: string): Set<string> => new Set(records().filter((r) => r.stores.includes(store)).map((r) => r.session))
126
131
 
127
132
  /** a repo's parties as the page shows them (review/routes.ts partiesOfStore): its watchers, its sessions and whether each
128
- * lives, the keepers, their transcripts */
133
+ * lives, their transcripts */
129
134
  export function partiesStamp(store: string): string {
130
135
  const own = storeSessions(store)
131
- return `${watchersStamp(store)}|${sessionsStamp()}|${keepersStamp()}|${transcriptPulse.stamp(own)}`
136
+ return `${watchersStamp(store)}|${sessionsStamp()}|${transcriptPulse.stamp(own)}`
132
137
  }
@@ -14,8 +14,10 @@ import { dirname, join } from 'path'
14
14
  import { fileURLToPath } from 'url'
15
15
  import type { GlobalProcessDecl } from './global-units.ts'
16
16
  import { iconImageType } from '../core/icon-type.ts'
17
+ import { unitIconWords, type UnitIconWords } from '../core/unit-icon.ts'
17
18
  import { Proc, realDeps, tailLines, type ProcStatus, type SuperviseDeps } from './supervise.ts'
18
19
  import { resourceLog, resourcePid } from './home-paths.ts'
20
+ import { exitWords, logSize } from '../problems/failure-words.ts'
19
21
  import { groupOf, localPort, portHolders } from '../core/port-holders.ts'
20
22
 
21
23
  export type ResourceView = {
@@ -51,17 +53,21 @@ export type ResourceView = {
51
53
  /** its own app is being built or opened: the page shows a spinner on
52
54
  * that button. Absent from an older pm */
53
55
  appBusy?: boolean
56
+ /** its repo is placed on other places, not this one (wiki tools/shipkit/sessions.md, Placement): their names.
57
+ * pm does not start it at its next start; one that runs keeps running. Absent: it runs here */
58
+ placedOn?: string[]
54
59
  }
55
60
 
56
61
  /** where a url opens: the default browser, Chrome, or the process's own app */
57
62
  export type OpenHow = 'browser' | 'chrome' | 'app'
58
63
 
59
- /** an emoji, or the url pm serves a declared image file at */
60
- export type ProcessIcon = { text: string } | { src: string }
64
+ /** the url pm serves a declared image file at, else the declared icon in words: the hub icon it stands for (`svg`)
65
+ * and the emoji a surface with no svg prints (core/unit-icon.ts) */
66
+ export type ProcessIcon = UnitIconWords | { src: string }
61
67
 
62
- /** the page's url for a process's declared icon */
68
+ /** a process's declared icon as a page reads it */
63
69
  export const processIconOf = (d: GlobalProcessDecl): ProcessIcon | null =>
64
- d.icon == null ? null : iconImageType(d.icon) != null ? { src: `/api/pm/icon/${encodeURIComponent(d.id)}` } : { text: d.icon }
70
+ d.icon == null ? null : iconImageType(d.icon) != null ? { src: `/api/pm/icon/${encodeURIComponent(d.id)}` } : unitIconWords(d.icon)
65
71
 
66
72
  export type HttpProbe = (url: string) => Promise<boolean>
67
73
 
@@ -255,11 +261,12 @@ export class Resource {
255
261
  this.status = want === 'up' ? 'starting' : 'stopping'
256
262
  this.note = null
257
263
  this.failed = false
264
+ const from = logSize(this.log)
258
265
  try {
259
266
  const code = await (this.o.run ?? runOnce)(cmd, this.decl.cwd, this.log)
260
267
  if (code !== 0) {
261
268
  this.failed = true
262
- this.note = `\`${cmd.join(' ')}\` exited ${code}: see the log`
269
+ this.note = exitWords(`\`${cmd.join(' ')}\``, code, this.log, from)
263
270
  }
264
271
  } catch (e) {
265
272
  this.failed = true
@@ -307,9 +314,10 @@ export class Resource {
307
314
  private async showApp(): Promise<void> {
308
315
  this.appBusy = true
309
316
  let failed: string | null = null
317
+ const from = logSize(this.log)
310
318
  try {
311
319
  const code = await (this.o.open ?? openApp)(this.decl, this.log)
312
- if (code !== 0) failed = `opening ${this.decl.label} as an app exited ${code}: see the log`
320
+ if (code !== 0) failed = exitWords(`opening ${this.decl.label} as an app`, code, this.log, from)
313
321
  } catch (e) {
314
322
  failed = `opening ${this.decl.label} as an app: ${(e as Error).message}`
315
323
  } finally {
@@ -328,9 +336,10 @@ export class Resource {
328
336
  const cmd = a.cmd ?? [process.execPath, ACTION_RUNNER, join(this.decl.root, this.decl.file), id]
329
337
  this.running = id
330
338
  this.actionNote = null
339
+ const from = logSize(this.log)
331
340
  try {
332
341
  const code = await (this.o.run ?? runOnce)(cmd, this.decl.root, this.log)
333
- this.actionNote = code === 0 ? `${a.label}: done` : `${a.label} exited ${code}: see the log`
342
+ this.actionNote = code === 0 ? `${a.label}: done` : exitWords(a.label, code, this.log, from)
334
343
  } catch (e) {
335
344
  this.actionNote = `${a.label}: ${(e as Error).message}`
336
345
  } finally {
@@ -108,7 +108,9 @@ export async function runDaemon(root: string, io: HomeIo, o: { port?: number } =
108
108
  // Its catch up window lives in the machine db, so a restart in place keeps it
109
109
  const plan = new Planner({ catchUp: machineCatchUp, onError: (repo, e) => io.printErr(`WARN the plan of ${repo} broke: ${e.message}`) })
110
110
  // a repo's colour counts only the checks its plan holds today
111
- const gutter = projectGutter({ root, warn: (l) => io.printErr(l), declared: (name) => plan.declared(name) })
111
+ // a page asked of a repo's own app: said on the pages' stream, which exists once the daemon serves
112
+ let askedPage: (repo: string) => void = () => {}
113
+ const gutter = projectGutter({ root, warn: (l) => io.printErr(l), declared: (name) => plan.declared(name), asked: (repo) => askedPage(repo) })
112
114
  const readThread = new ReadThread()
113
115
  // every store's parties too: the page and the inbox read them, a lane transcript each
114
116
  readPartiesWith((dir) => readThread.parties(dir))
@@ -168,6 +170,7 @@ export async function runDaemon(root: string, io: HomeIo, o: { port?: number } =
168
170
  otherMacs: () => otherMacs.get(),
169
171
  accountsUsage: () => readAccountsUsage(),
170
172
  })
173
+ askedPage = (repo) => home.routes.push.moved('asked-page', repo)
171
174
  io.print(`daemon → http://127.0.0.1:${home.server.port} (the page: http://localhost:${port})`)
172
175
  if (succession != null) {
173
176
  succession.serves()
@@ -127,7 +127,7 @@ export async function runPm(root: string, io: HomeIo, o: { port?: number } = {})
127
127
  })
128
128
  let server: Bun.Server<unknown>
129
129
  try {
130
- server = loopbackServe({ port, fetch: (req) => pm.handle(req) })
130
+ server = loopbackServe({ port, fetch: (req, srv) => pm.handle(req, srv) })
131
131
  } catch (e) {
132
132
  if (e instanceof Error && /in use|EADDRINUSE/.test(e.message)) {
133
133
  io.printErr(`FAIL: port ${port} is taken by another process. Set SHIPKIT_PM_PORT to a free one`)
@@ -7,7 +7,10 @@ import { LeaseHeld, neverWaitOnLoop } from '../core/on-loop.ts'
7
7
  import { loopWatch } from '../core/loop-watch.ts'
8
8
  import { carriedHqRoute } from '../hq/hq-local.ts'
9
9
  import { loopbackServe } from '../http/loopback-serve.ts'
10
+ import { type Live, LIVE_PATH, liveSockets } from '../serve/page-live.ts'
10
11
  import { DAEMON_GUARD } from './daemon-guard.ts'
12
+ import { requestFailure } from '../problems/failure-words.ts'
13
+ import { hopOfSocket } from '../hq/terminal-hop.ts'
11
14
  import { homeRoutes, TICK_MS, type HomeDeps } from './home-routes.ts'
12
15
 
13
16
  /** `ticks`: the next image of a daemon (home/handover.ts) serves at once and runs its ticks only once the image it
@@ -16,10 +19,14 @@ export function serveDaemon(d: HomeDeps & { daemonPort: number; ticks?: Promise<
16
19
  const routes = homeRoutes(d)
17
20
  // the web and the terminal clients call the daemon by a loopback name (loopbackServe refuses any other); the hq
18
21
  // this daemon carries answers its own paths behind its own token (hq/hq-routes.ts), before the home's routes
19
- const handle = async (req: Request, srv: Bun.Server<undefined>): Promise<Response> => (await carriedHqRoute(req, new URL(req.url).pathname)) ?? (await routes.handle(req, srv)) ?? new Response('not found', { status: 404 })
22
+ const handle = async (req: Request, srv: Bun.Server<Live>): Promise<Response> => (await carriedHqRoute(req, new URL(req.url).pathname)) ?? (await routes.handle(req, srv)) ?? new Response('not found', { status: 404 })
20
23
  // a lock another process holds is never waited on here: the request runs again off the loop (neverWaitOnLoop),
21
24
  // from a copy of its body kept aside, since the first run read it
22
- const fetch = (req: Request, srv: Bun.Server<undefined>): Promise<Response> => {
25
+ // a hub page's one socket: the lines of its terminals and the notices of the stores (serve/page-live.ts); a hop of
26
+ // the hq Mac's page to this machine's terminals is one too, bound to one repo (hq/terminal-hop.ts)
27
+ const live = liveSockets({ push: () => routes.push, hop: (req) => hopOfSocket(req) })
28
+ const fetch = (req: Request, srv: Bun.Server<Live>): Response | undefined | Promise<Response> => {
29
+ if (new URL(req.url).pathname === LIVE_PATH) return live.upgrade(req, srv)
23
30
  const spare = req.body != null ? req.clone() : null
24
31
  let runs = 0
25
32
  return loopWatch.spanned(`${req.method} ${new URL(req.url).pathname}`, () =>
@@ -34,10 +41,12 @@ export function serveDaemon(d: HomeDeps & { daemonPort: number; ticks?: Promise<
34
41
  // its next image binds beside it: home/handover.ts
35
42
  reusePort: true,
36
43
  fetch,
37
- // a throw is said in the log and never to the caller: with no handler Bun answers a page with the source
44
+ websocket: live.websocket,
45
+ // a throw answers its reason in one masked line (failure-words.ts), the whole message in the log: with no
46
+ // handler Bun answers a page with the source
38
47
  error: (e) => {
39
48
  console.error(`WARN the daemon failed a request: ${e.message}`)
40
- return new Response('the daemon failed this request: its log says why', { status: 500 })
49
+ return new Response(requestFailure(e), { status: 500, headers: { 'Content-Type': 'text/plain; charset=utf-8', 'Cache-Control': 'no-store' } })
41
50
  },
42
51
  }, DAEMON_GUARD)
43
52
  let stopped = false