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
  // `{ shipkit: <verb> }` messages on its origin; alone at its own url, it keeps the keys in its own address, so the
4
4
  // page works the same either way
5
5
  import type { ObjectThread } from '../review/cells.ts'
6
- import { pageKey, pageLetterKey, sectionKey } from '../serve/hub-app/keys.ts'
6
+ import { inField, keepsArrows, pageKey, pageLetterKey, sectionKey } from '../serve/hub-app/keys.ts'
7
7
 
8
8
  export type FrameTheme = 'dark' | 'light'
9
9
  export type FrameBadge = { count: number; tone?: 'red' | 'warn' | null; title?: string }
@@ -62,8 +62,16 @@ interface ControlRec {
62
62
 
63
63
  type KeyLike = Pick<KeyboardEvent, 'key' | 'code' | 'altKey' | 'shiftKey' | 'metaKey' | 'ctrlKey'>
64
64
 
65
- /** a key the hub owns: its ⌥ sections, a page's ⌥⇧ letter, the home's ⌘ keys */
66
- export const hubOwns = (e: KeyLike): boolean => sectionKey(e) != null || pageLetterKey(e) != null || pageKey(e) != null
65
+ /** a key the hub owns: its ⌥ sections, a page's ⌥⇧ letter, the home's ⌘ keys, the step keys of its two columns
66
+ * (⌘↑ ⌘↓ ⇧↑ ⇧↓), which a field of several lines keeps while it has the focus (keys.ts keepsArrows), and ⌘← ⌘→, which
67
+ * any text field keeps */
68
+ export const hubOwns = (e: KeyLike, target: Parameters<typeof keepsArrows>[0] = null): boolean => {
69
+ const pk = pageKey(e)
70
+ if (pk?.t === 'step') return !keepsArrows(target)
71
+ // ⌘← ⌘→ stay the caret's in a text field of the page
72
+ if (pk?.t === 'fold-here') return !inField(target)
73
+ return sectionKey(e) != null || pageLetterKey(e) != null || pk != null
74
+ }
67
75
 
68
76
  export function frameClient(o: FrameOpts): PageFrame {
69
77
  const framed = typeof window !== 'undefined' && window.parent !== window
@@ -71,14 +79,28 @@ export function frameClient(o: FrameOpts): PageFrame {
71
79
  const up = (m: Record<string, unknown>): void => { if (framed) window.parent.postMessage({ ...m }, origin) }
72
80
  let last = framed ? '' : location.search.replace(/^\?/, '')
73
81
  let live: EventSource | null = null
82
+ /** the hub reads the channel for the page (its `hello` said `live`): the page asks its parent and opens no
83
+ * connection. `relaying`: the parent was asked, and says each event */
84
+ let relayed = false
85
+ let relaying = false
86
+ /** the page shows, so its channel is wanted */
87
+ let shown = !framed
74
88
  const openLive = (): void => {
75
- if (o.live == null || live != null) return
89
+ shown = true
90
+ if (o.live == null || live != null || relaying) return
76
91
  const build = document.querySelector('script[type="module"][src]')?.getAttribute('src') ?? ''
92
+ if (framed && relayed) {
93
+ relaying = true
94
+ return up({ shipkit: 'live', path: o.live, build })
95
+ }
77
96
  live = new EventSource(`${o.live}?build=${encodeURIComponent(build)}`)
78
97
  live.addEventListener('reload', () => location.reload())
79
98
  if (o.onLive != null) live.onmessage = (e: MessageEvent<string>) => o.onLive?.(e.data)
80
99
  }
81
100
  const closeLive = (): void => {
101
+ shown = false
102
+ if (relaying) up({ shipkit: 'live', path: null })
103
+ relaying = false
82
104
  live?.close()
83
105
  live = null
84
106
  }
@@ -221,12 +243,28 @@ export function frameClient(o: FrameOpts): PageFrame {
221
243
 
222
244
  const onMessage = (e: MessageEvent): void => {
223
245
  if (e.source !== window.parent || e.origin !== origin) return
224
- const m = (e.data ?? {}) as { shipkit?: unknown; keys?: unknown; theme?: unknown; identity?: unknown; on?: unknown; id?: unknown; objects?: unknown }
246
+ const m = (e.data ?? {}) as { shipkit?: unknown; keys?: unknown; theme?: unknown; identity?: unknown; on?: unknown; id?: unknown; objects?: unknown; live?: unknown; event?: unknown; data?: unknown }
225
247
  if (m.shipkit === 'threads-of' && typeof m.id === 'number') {
226
248
  asked.get(m.id)?.(Array.isArray(m.objects) ? (m.objects as FrameObjectThreads[]) : [])
227
249
  asked.delete(m.id)
228
250
  return
229
251
  }
252
+ // an event of the channel the hub reads for the page, as its own EventSource would say it
253
+ if (m.shipkit === 'live-event' && typeof m.data === 'string') {
254
+ if (!relaying) return
255
+ if (m.event === 'reload') return location.reload()
256
+ if (m.event === 'message') o.onLive?.(m.data)
257
+ return
258
+ }
259
+ // the hub cannot read the channel after all: the page reads it itself, while it shows
260
+ if (m.shipkit === 'live-own') {
261
+ relayed = false
262
+ relaying = false
263
+ if (shown) openLive()
264
+ return
265
+ }
266
+ // before the `on` of the same hello opens the channel
267
+ if (m.shipkit === 'hello') relayed = m.live === true
230
268
  if ((m.shipkit === 'hello' || m.shipkit === 'keys') && typeof m.keys === 'string') {
231
269
  last = m.keys
232
270
  o.onKeys(m.keys)
@@ -252,7 +290,7 @@ export function frameClient(o: FrameOpts): PageFrame {
252
290
  }
253
291
  // after the page's own handlers: a key it took stays its own
254
292
  const onKey = (e: KeyboardEvent): void => {
255
- if (e.defaultPrevented || !hubOwns(e)) return
293
+ if (e.defaultPrevented || !hubOwns(e, e.target as HTMLElement | null)) return
256
294
  e.preventDefault()
257
295
  up({ shipkit: 'key', key: e.key, code: e.code, altKey: e.altKey, shiftKey: e.shiftKey, metaKey: e.metaKey, ctrlKey: e.ctrlKey })
258
296
  }
@@ -0,0 +1,80 @@
1
+ // the reason a failure gives where the owner reads it (a hub tooltip, a global process's note): one short line from the
2
+ // error, or from what the command printed, never a pointer to a log. Every line is masked first: a token in an error
3
+ // message or a log line never reaches a page
4
+ import { closeSync, existsSync, openSync, readSync, statSync } from 'fs'
5
+ import { homedir } from 'os'
6
+ import { basename, dirname, join, relative } from 'path'
7
+ import { maskSecrets } from '../agent-time/mask.ts'
8
+
9
+ /** the longest reason a tooltip carries */
10
+ const MAX = 240
11
+
12
+ const short = (text: string): string => {
13
+ const t = maskSecrets(text).text.trim()
14
+ return t.length <= MAX ? t : `${t.slice(0, MAX - 1)}…`
15
+ }
16
+
17
+ /** importFresh's and loadRepoConfig's cache stamp, a noise in any path a reader sees */
18
+ const unstamp = (s: string): string => s.replace(/(\.[a-z]+)\?v=[A-Za-z0-9._-]+/g, '$1')
19
+
20
+ /** the house repo a file belongs to (the nearest folder with a repo.config.ts) and the file inside it */
21
+ function ownerOf(file: string): { repo: string; rel: string } | null {
22
+ for (let d = dirname(file); d !== dirname(d); d = dirname(d))
23
+ if (existsSync(join(d, 'repo.config.ts'))) return { repo: basename(d), rel: relative(d, file) }
24
+ return null
25
+ }
26
+
27
+ const shown = (path: string, home: string): string => (path.startsWith(`${home}/`) ? `~${path.slice(home.length)}` : path)
28
+
29
+ /** what a failed request answers: the error's first line in words a tooltip carries. A module a repo file imports and
30
+ * cannot find names that file, its repo and the package */
31
+ export function requestFailure(e: unknown, home: string = homedir()): string {
32
+ const first = unstamp(String(e instanceof Error ? e.message : e).split('\n').find((l) => l.trim() !== '') ?? '')
33
+ const missing = /^Cannot find (?:package|module) ['"]([^'"]+)['"] (?:imported )?from ['"]?([^'"]+?)['"]?$/.exec(first.trim())
34
+ if (missing != null) {
35
+ const [, pkg, from] = missing as unknown as [string, string, string]
36
+ const name = pkg.startsWith('.') || pkg.startsWith('/') ? pkg : pkg.split('/').slice(0, pkg.startsWith('@') ? 2 : 1).join('/')
37
+ const o = ownerOf(from)
38
+ const what = o == null ? shown(from, home) : `${o.repo}'s ${o.rel}`
39
+ return short(`${what} cannot load: it imports ${name}, which this repo does not have`)
40
+ }
41
+ return short(first === '' ? 'the daemon failed this request and its error says nothing' : first.split(home).join('~'))
42
+ }
43
+
44
+ /** the last line a command wrote to its log after `from` (the log's size before it ran), masked and short; null when
45
+ * it wrote nothing */
46
+ export function lastWords(file: string, from = 0): string | null {
47
+ if (!existsSync(file)) return null
48
+ try {
49
+ const size = statSync(file).size
50
+ const start = Math.max(from > size ? 0 : from, size - 16 * 1024)
51
+ if (size <= start) return null
52
+ const fd = openSync(file, 'r')
53
+ try {
54
+ const buf = Buffer.alloc(size - start)
55
+ readSync(fd, buf, 0, buf.length, start)
56
+ // a long running role stamps its lines with the time (core/log-stamp.ts): the reason is what follows
57
+ const line = buf.toString('utf8').split('\n').map((l) => l.replace(/^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d(?:\.\d+)? /, '').trim()).filter((l) => l !== '').at(-1)
58
+ return line == null ? null : short(line)
59
+ } finally {
60
+ closeSync(fd)
61
+ }
62
+ } catch {
63
+ return null
64
+ }
65
+ }
66
+
67
+ /** `<what> exited <code>` with the last line it printed, or that it printed nothing */
68
+ export function exitWords(what: string, code: number, log: string, from: number): string {
69
+ const said = lastWords(log, from)
70
+ return said == null ? `${what} exited ${code} and printed nothing` : `${what} exited ${code}: ${said}`
71
+ }
72
+
73
+ /** a log's size now, the `from` of a run about to write to it */
74
+ export const logSize = (file: string): number => {
75
+ try {
76
+ return statSync(file).size
77
+ } catch {
78
+ return 0
79
+ }
80
+ }
@@ -40,7 +40,7 @@ import { unitBlockers } from './unit-gate.ts'
40
40
  import { publicCleanBlockers } from './public-clean.ts'
41
41
  import { releaseScope } from './release-scope.ts'
42
42
  import { formatUnitError, releaseOrder, renderTag, resolveUnits, unitById, unitPrepublishScripts, unknownUnit, type ReleaseUnit } from './units.ts'
43
- import { environmentBlockers, gateStop, runReleaseGate, releaseUnit } from './run-release.ts'
43
+ import { environmentBlockers, foreignRelease, gateStop, releaseCommand, runReleaseGate, releaseUnit, type ReleaseOpts } from './run-release.ts'
44
44
  import type { RepoConfig } from '../repo-config.ts'
45
45
  import { nestedIn, nestedRefusal } from '../core/nesting.ts'
46
46
  import { LAYOUT } from '../core/layout.ts'
@@ -79,6 +79,21 @@ export type BumpOpts = {
79
79
  print?: (line: string) => void
80
80
  }
81
81
 
82
+ /** every option bump and its release step both take, and what reaches the release step. A new shared option
83
+ * fails to compile here until it is placed: a bump flag the release step never hears halts a release after the
84
+ * version commit, on the very thing the flag lifted */
85
+ const SHARED_WITH_RELEASE: Record<Exclude<Extract<keyof BumpOpts, keyof ReleaseOpts>, 'print'>, 'forwarded' | 'bump owns it'> = {
86
+ allowDirty: 'forwarded',
87
+ // a dry run returns before the version commit, so no release step runs
88
+ dryRun: 'bump owns it',
89
+ // each release step is handed its own unit
90
+ unit: 'bump owns it',
91
+ }
92
+
93
+ /** the options a bump hands each release step it runs */
94
+ const releaseFlags = (o: BumpOpts): Pick<ReleaseOpts, 'allowDirty'> =>
95
+ SHARED_WITH_RELEASE.allowDirty === 'forwarded' ? { allowDirty: o.allowDirty } : {}
96
+
82
97
  type Git = (args: string[]) => { code: number; out: string }
83
98
 
84
99
  /** bring a feature branch onto the release branch with a merge commit, and
@@ -255,6 +270,8 @@ const today = (): string => dayStamp()
255
270
  export async function runBump(root: string, config: RepoConfig, kind: BumpKind | null, o: BumpOpts = {}): Promise<number> {
256
271
  const print = o.print ?? ((l: string) => console.log(l))
257
272
  if (o.all === true && o.unit != null) { print('FAIL: pass a unit or --all, never both'); return 1 }
273
+ const foreign = foreignRelease(config)
274
+ if (foreign != null) { print(`FAIL: ${foreign}`); return 1 }
258
275
  const nested = nestedIn(root)
259
276
  if (nested != null) { print(`FAIL: ${nestedRefusal(nested)}`); return 1 }
260
277
 
@@ -614,17 +631,21 @@ export async function runBump(root: string, config: RepoConfig, kind: BumpKind |
614
631
  const fresh = resolveUnits(root, config)
615
632
  if (fresh.errors.length > 0) { for (const e of fresh.errors) print(`FAIL: ${formatUnitError(e)}`); return 1 }
616
633
  const order = selected.map((s) => unitById(fresh.units, s.unit.id)).filter((u): u is ReleaseUnit => u != null)
634
+ const flags = releaseFlags(o)
617
635
  for (let i = 0; i < order.length; i++) {
618
636
  const u = order[i]!
619
- const code = await releaseUnit(root, config, u, {
637
+ const r = await releaseUnit(root, config, u, {
638
+ ...flags,
620
639
  skipGate: true,
621
640
  skipGateReason: 'already green on this tree (bump ran it)',
622
641
  skipUnitGate: true,
623
642
  print,
624
643
  })
625
- if (code !== 0) {
626
- print(`FAIL: ${u.id} did not finish — the version commit is already in, so nothing needs re-bumping`)
627
- for (const rest of order.slice(i)) print(` fix: shipkit release ${rest.id}`)
644
+ if (!r.ok) {
645
+ // the last lines a tail shows: a release half done is never a quiet end
646
+ print(`FAIL: ${u.id} did not finish, its release stopped at the ${r.step} step. ${label} is committed, so nothing needs re-bumping`)
647
+ print(` fix: ${r.resume}`)
648
+ for (const rest of order.slice(i + 1)) print(` then: ${releaseCommand(rest.id, flags)}`)
628
649
  return 1
629
650
  }
630
651
  }
@@ -20,6 +20,7 @@ import { formatUnitError, resolveUnits, unitById, unknownUnit, type ReleaseUnit
20
20
  import { loadRepoConfig, type RepoConfig } from '../repo-config.ts'
21
21
  import { nestedIn, nestedRefusal } from '../core/nesting.ts'
22
22
  import { declaredTestUnits, testCheckId } from '../suite/test-units.ts'
23
+ import { FOREIGN_WHY } from '../core/foreign.ts'
23
24
 
24
25
  // adding a FOURTH knob here is the signal that this shape wants rethinking
25
26
  // rather than another key (meta/gaps/index.md, release-path config keys accreting)
@@ -80,6 +81,10 @@ export type ReleaseConfig = {
80
81
  /** the parts of the release preflight that do not depend on the new version
81
82
  * existing yet: branch, remote, gh. bump runs this BEFORE it writes anything,
82
83
  * or a refusal here lands after the version commit. */
84
+ /** why a release never runs in this repo, or null: a foreign tree ships through its team's own process, never sk bump
85
+ * or sk release (core/foreign.ts) */
86
+ export const foreignRelease = (config: RepoConfig): string | null => (config.foreign === true ? `never released by shipkit: ${FOREIGN_WHY}` : null)
87
+
83
88
  export function environmentBlockers(root: string, config: RepoConfig, o: { skipBranch?: boolean; wantGh?: boolean } = {}): string[] {
84
89
  const branch = config.release?.branch ?? 'main'
85
90
  const out: string[] = []
@@ -206,6 +211,8 @@ export function otherUnitTests(config: RepoConfig, shipping: ReleaseUnit[] | und
206
211
  /** `shipkit release [unit]` — resolve the unit, then ship it. */
207
212
  export async function runRelease(root: string, config: RepoConfig, o: ReleaseOpts = {}): Promise<number> {
208
213
  const print = o.print ?? ((l: string) => console.log(l))
214
+ const refused = foreignRelease(config)
215
+ if (refused != null) { print(`FAIL: ${refused}`); return 1 }
209
216
  const nested = nestedIn(root)
210
217
  if (nested != null) { print(`FAIL: ${nestedRefusal(nested)}`); return 1 }
211
218
  const resolution = resolveUnits(root, config)
@@ -221,13 +228,26 @@ export async function runRelease(root: string, config: RepoConfig, o: ReleaseOpt
221
228
  print(' fix: shipkit releases')
222
229
  return 1
223
230
  }
224
- return await releaseUnit(root, config, unit, o)
231
+ return (await releaseUnit(root, config, unit, o)).ok ? 0 : 1
225
232
  }
226
233
 
234
+ /** the step a release of one unit stopped at */
235
+ export type ReleaseStep = 'preflight' | 'gate' | 'npm publish' | 'git tag' | 'git push' | 'tag push' | 'gh release' | 'post-release'
236
+
237
+ /** a stopped release says where, and the one command that resumes it */
238
+ export type ReleaseOutcome = { ok: true } | { ok: false; step: ReleaseStep; resume: string }
239
+
240
+ /** the release command that resumes a unit, with every flag the stopped run was given: without them it refuses
241
+ * on the very thing they lifted */
242
+ export const releaseCommand = (unitId: string, o: Pick<ReleaseOpts, 'allowDirty'>): string =>
243
+ `shipkit release ${unitId}${o.allowDirty === true ? ' --allow-dirty' : ''}`
244
+
227
245
  /** ship ONE resolved unit. Every gate above it has already run when bump
228
246
  * calls this; a bare `shipkit release` runs them here. */
229
- export async function releaseUnit(root: string, config: RepoConfig, unit: ReleaseUnit, o: ReleaseOpts = {}): Promise<number> {
247
+ export async function releaseUnit(root: string, config: RepoConfig, unit: ReleaseUnit, o: ReleaseOpts = {}): Promise<ReleaseOutcome> {
230
248
  const print = o.print ?? ((l: string) => console.log(l))
249
+ const again = releaseCommand(unit.id, o)
250
+ const stop = (step: ReleaseStep, resume = again): ReleaseOutcome => ({ ok: false, step, resume })
231
251
  const rc = config.release ?? {}
232
252
  const branch = rc.branch ?? 'main'
233
253
  const { name, version, tag } = unit
@@ -308,7 +328,7 @@ export async function releaseUnit(root: string, config: RepoConfig, unit: Releas
308
328
 
309
329
  if (blockers.length > 0) {
310
330
  for (const b of blockers) print(`FAIL: ${b}`)
311
- return 1
331
+ return stop('preflight')
312
332
  }
313
333
 
314
334
  // the gate runs BEFORE anything leaves the machine. A release that skips
@@ -319,11 +339,11 @@ export async function releaseUnit(root: string, config: RepoConfig, unit: Releas
319
339
  print(o.skipGateReason != null ? `ok: ci gate ${o.skipGateReason}` : 'WARN ci gate SKIPPED by --skip-gate — publishing unverified')
320
340
  else {
321
341
  const gate = await runReleaseGate(root, print, { units: [unit], allowDirty: o.allowDirty })
322
- if (gate !== 0) { print(`FAIL: ${gateStop(gate, 'release')}`); return 1 }
342
+ if (gate !== 0) { print(`FAIL: ${gateStop(gate, 'release')}`); return stop('gate') }
323
343
  print('ok: ci gate green')
324
344
  }
325
345
 
326
- if (o.dryRun === true) { print(`ok: dry run clean — nothing was touched`); return 0 }
346
+ if (o.dryRun === true) { print(`ok: dry run clean — nothing was touched`); return { ok: true } }
327
347
 
328
348
  const remoteName = (remote as { remote: string }).remote
329
349
  const work = mkdtempSync(join(tmpdir(), 'shipkit-release-'))
@@ -337,7 +357,7 @@ export async function releaseUnit(root: string, config: RepoConfig, unit: Releas
337
357
  if (argv != null && argv[0] != null) {
338
358
  const t = Bun.spawnSync(argv)
339
359
  token = t.exitCode === 0 ? t.stdout.toString().trim() : ''
340
- if (token === '') { print(`FAIL: release.npmTokenCommand produced no token (exit ${t.exitCode})`); return 1 }
360
+ if (token === '') { print(`FAIL: release.npmTokenCommand produced no token (exit ${t.exitCode})`); return stop('npm publish') }
341
361
  // token via a throwaway userconfig (npm) or the env (bun),
342
362
  // never argv, never a committed .npmrc, never a line in a log
343
363
  if (publisher === 'npm') {
@@ -347,22 +367,22 @@ export async function releaseUnit(root: string, config: RepoConfig, unit: Releas
347
367
  }
348
368
  const cmd = publishCommand({ publisher, npmrc, token })
349
369
  const p = Bun.spawnSync(cmd.argv, { cwd: unit.dir, env: { ...env, ...cmd.env }, stdout: 'inherit', stderr: 'inherit' })
350
- if (p.exitCode !== 0) { print(`FAIL: ${publisher} publish failed for ${unit.id} (exit ${p.exitCode})`); return 1 }
370
+ if (p.exitCode !== 0) { print(`FAIL: ${publisher} publish failed for ${unit.id} (exit ${p.exitCode})`); return stop('npm publish') }
351
371
  recordPublished(name, version)
352
372
  print(`ok: published ${name}@${version}`)
353
373
  }
354
374
 
355
375
  // every step below is recoverable by re-running: the failure message
356
376
  // says so, because a half-released package is the scariest state
357
- const resume = ` fix: shipkit release ${unit.id}`
377
+ const resume = ` fix: ${again}`
358
378
  if (!tagExists()) {
359
379
  const t = git(root, ['tag', '-a', tag, '-m', `${name} ${version}`])
360
- if (t.code !== 0) { print(`FAIL: git tag ${tag} failed — ${t.out}`); print(resume); return 1 }
380
+ if (t.code !== 0) { print(`FAIL: git tag ${tag} failed — ${t.out}`); print(resume); return stop('git tag') }
361
381
  }
362
382
  const push = git(root, ['push', remoteName])
363
- if (push.code !== 0) { print(`FAIL: git push failed — ${push.out}`); print(resume); return 1 }
383
+ if (push.code !== 0) { print(`FAIL: git push failed — ${push.out}`); print(resume); return stop('git push') }
364
384
  const pushTag = git(root, ['push', remoteName, tag])
365
- if (pushTag.code !== 0) { print(`FAIL: pushing ${tag} failed — ${pushTag.out}`); print(resume); return 1 }
385
+ if (pushTag.code !== 0) { print(`FAIL: pushing ${tag} failed — ${pushTag.out}`); print(resume); return stop('tag push') }
366
386
  print(`ok: tagged ${tag} and pushed to ${remoteName}`)
367
387
 
368
388
  if (wantGh) {
@@ -370,7 +390,7 @@ export async function releaseUnit(root: string, config: RepoConfig, unit: Releas
370
390
  writeFileSync(notesFile, notes)
371
391
  const args = ['gh', 'release', 'create', tag, '--verify-tag', '--title', `${name} ${version}`, '--notes-file', notesFile]
372
392
  const g = Bun.spawnSync(args, { cwd: root, stdout: 'inherit', stderr: 'inherit' })
373
- if (g.exitCode !== 0) { print(`FAIL: gh release create failed (exit ${g.exitCode})`); print(`${resume} — the tag is already pushed`); return 1 }
393
+ if (g.exitCode !== 0) { print(`FAIL: gh release create failed (exit ${g.exitCode})`); print(`${resume} — the tag is already pushed`); return stop('gh release') }
374
394
  print(`ok: GitHub release ${tag} live`)
375
395
  }
376
396
  print(`ok: ${name}@${version} released${wantNpm ? ' (npm + tag' : ' (tag'}${wantGh ? ' + github release)' : ')'}`)
@@ -397,11 +417,11 @@ export async function releaseUnit(root: string, config: RepoConfig, unit: Releas
397
417
  if (a.exitCode !== 0) {
398
418
  print(`FAIL: post-release step failed (exit ${a.exitCode}) — ${name}@${version} IS released, it is not live`)
399
419
  print(` fix: ${after.join(' ')}`)
400
- return 1
420
+ return stop('post-release', after.join(' '))
401
421
  }
402
422
  print(`ok: post-release step done — ${name}@${version} is live`)
403
423
  }
404
- return 0
424
+ return { ok: true }
405
425
  } finally {
406
426
  rmSync(work, { recursive: true, force: true })
407
427
  }
@@ -21,6 +21,7 @@ import { builtinCheckIds } from './gate/discover-checks.ts'
21
21
  import { RETIRED_CHECK_IDS } from './core/retired-checks.ts'
22
22
  import { parseWhen } from './core/when.ts'
23
23
  import { normalizeVendored, vendoredOfText, vendoredProblem } from './core/vendored.ts'
24
+ import { foreignOfText } from './core/foreign.ts'
24
25
  import { budgetValueProblem } from './core/budget.ts'
25
26
  import { browsersProblem } from './core/slots.ts'
26
27
  import type { Rule } from './check.ts'
@@ -72,7 +73,7 @@ export type ServeConfig = {
72
73
  * more than one Mac checks out */
73
74
  publicHost?: string
74
75
  /** the ids of the global processes this repo needs (any house repo's
75
- * `globalProcess` unit files). The home rail marks the repo while one is off */
76
+ * `globalProcess` unit files). The project bar marks the repo's tile while one is off */
76
77
  uses?: string[]
77
78
  /** the house's private S3 bucket that keeps every file of the machine's
78
79
  * media store (items, trailer cuts...), read only in the house
@@ -107,10 +108,6 @@ export type ServeConfig = {
107
108
  /** only in the house config: the hub theme every shot of the machine draws a page in (`sk shot`, `shotUrl`, the
108
109
  * browser checks), unless it asks its own (`--theme`); absent, each browser's own scheme */
109
110
  shotTheme?: import('./core/hub-theme.ts').Theme
110
- /** only in the house config: every shot of the machine draws the hub's project list folded to its rail (true) or
111
- * open (false), unless it asks its own (`--rail`, `--no-rail`); the browser checks start folded too, a case that
112
- * measures the open list asks it; absent, the page's own pick */
113
- shotRail?: boolean
114
111
  }
115
112
 
116
113
  export type RepoBackup = {
@@ -294,12 +291,24 @@ export type RepoConfig = {
294
291
  * an unknown id or a blank reason */
295
292
  ruleExempt?: Record<string, string>
296
293
  /** the repo is done for now: nothing processes it. The house discovery
297
- * leaves it out, so it has no rail row, no hub (no file watch, no plan
294
+ * leaves it out, so it has no tile on the project bar, no hub (no file watch, no plan
298
295
  * rows, no automatic gates), no processes or widgets, no identity fill,
299
296
  * no activity row, and fleet skips it. Only the archived page lists it.
300
297
  * The button in the repo header and the page's unarchive toggle it, and
301
298
  * only this key moves (core/archived.ts) */
302
299
  archived?: boolean
300
+ /** the tree is not the owner's to publish: a company's or a client's repo, where others commit. Nothing of it
301
+ * leaves this Mac through shipkit: fleet push, the activity page's push, a desk's push, `sk bump` and `sk
302
+ * release` refuse it; the backup, the media store, a media put and the thread store's copies leave it out; the
303
+ * hq never hears of it (report, threads, history). Its hub, processes, urls, threads and orchestrator stay, all
304
+ * local. Its tree stays the team's: no shipkit git hook, `core.hooksPath` untouched; a check writes only where
305
+ * its git never looks, and one whose subject is a team file is n/a; the daemon runs none of its floor suites
306
+ * on a save (`onSave`). Read as text (core/foreign.ts), so a linked worktree with no config of its own reads
307
+ * its main's */
308
+ foreign?: boolean
309
+ /** only with `foreign: true`: a floor suite (`lint`, `typecheck`, `test:<unit>` …) the daemon still runs on a
310
+ * save there, with why. A repo that is not foreign runs every one on a save already */
311
+ onSave?: Record<string, string>
303
312
  /** only in the house config: what of the owner's history the daemon never sends to the hq (wiki
304
313
  * tools/shipkit/hq.md) */
305
314
  history?: {
@@ -436,7 +445,7 @@ export type RepoConfig = {
436
445
  recorder?: import('./recordings/presets.ts').RecorderConfig
437
446
  /** the repo's own colours, one #rrggbb hex each: colorLight reads on a
438
447
  * light background, colorDark on a dark one. Every page that shows the
439
- * repo draws its name and its rail tile in them. Rule SK024 warns when
448
+ * repo draws its name and its project bar tile in them. Rule SK024 warns when
440
449
  * they are missing, and its fix derives them from the repo icon */
441
450
  identity?: {
442
451
  /** #rrggbb that reads on a light background */
@@ -444,13 +453,22 @@ export type RepoConfig = {
444
453
  /** #rrggbb that reads on a dark background: the home page draws this one */
445
454
  colorDark: string
446
455
  }
456
+ /** the repo's window colour, #rrggbb, as Peacock tints its VSCode window: its macOS app's title and tab bar, its
457
+ * project bar tile, its letter icon's plate. Absent: `.vscode/settings.json` `peacock.color`, else a dark tone hashed from
458
+ * the repo's name (core/repo-gui-color.ts). A value that is no colour fails the build of the repo's app */
459
+ guiColor?: string
460
+ /** the repo's app icon (wiki tools/shipkit/home-pages.md, Identity colours) */
461
+ appIcon?: {
462
+ /** false: the mark carries its own frame, and the app icon adds no rim */
463
+ frame?: boolean
464
+ }
447
465
  /** where a gate run writes its per task logs, repo-relative (default
448
466
  * '.shipkit/tmp/shipkit-ci'). Each run owns a subdir of it, so several agents in
449
467
  * one checkout never overwrite each other. Keep it gitignored. */
450
468
  logDir?: string
451
469
  }
452
470
 
453
- const KNOWN_KEYS = new Set(['name', 'id', 'venues', 'social', 'speaksAs', 'backup', 'annex','docsBase', 'defaults', 'tasks', 'asks', 'creds', 'credsCommand', 'credsReadCommand', 'retired', 'notifyCommand', 'contracts', 'gitignore', 'ignoredInputs', 'untrackGenerated', 'nested', 'off', 'when', 'budgets', 'instantHooks', 'ruleExempt', 'visibility', 'archived', 'history', 'reviewer', 'oneWayIn', 'rules', 'release', 'units', 'notReleasable', 'vendored', 'hooks', 'checkDefaults', 'tui', 'serve', 'recorder', 'identity', 'logDir', 'smoke', 'tests', 'browsers', 'start'])
471
+ const KNOWN_KEYS = new Set(['name', 'id', 'venues', 'social', 'speaksAs', 'backup', 'annex','docsBase', 'defaults', 'tasks', 'asks', 'creds', 'credsCommand', 'credsReadCommand', 'retired', 'notifyCommand', 'contracts', 'gitignore', 'ignoredInputs', 'untrackGenerated', 'nested', 'off', 'when', 'budgets', 'instantHooks', 'ruleExempt', 'visibility', 'archived', 'foreign', 'onSave', 'history', 'reviewer', 'oneWayIn', 'rules', 'release', 'units', 'notReleasable', 'vendored', 'hooks', 'checkDefaults', 'tui', 'serve', 'recorder', 'identity', 'guiColor', 'appIcon', 'logDir', 'smoke', 'tests', 'browsers', 'start'])
454
472
 
455
473
  export function defineRepo(c: RepoConfig): RepoConfig {
456
474
  if (typeof c.name !== 'string' || c.name === '') throw new Error('defineRepo: name is required')
@@ -462,6 +480,13 @@ export function defineRepo(c: RepoConfig): RepoConfig {
462
480
  // a half-declared reviewer would lint a path like `.claude/agents/.md`
463
481
  if (c.reviewer != null && (!/^[a-z0-9][a-z0-9-]*$/.test(c.reviewer.name ?? '') || (c.reviewer.brief ?? '') === ''))
464
482
  throw new Error(`defineRepo: reviewer needs { name: kebab-case, brief: path to the standing brief }`)
483
+ // read as text by every pass that leaves the Mac (core/foreign.ts): only a literal the text reader sees counts
484
+ if (c.foreign != null && typeof c.foreign !== 'boolean') throw new Error('defineRepo: foreign is a literal true or false')
485
+ if (c.onSave != null) {
486
+ if (c.foreign !== true) throw new Error('defineRepo: onSave turns a suite back on in a foreign repo; this one is not foreign, so every suite runs on a save already')
487
+ if (typeof c.onSave !== 'object' || Array.isArray(c.onSave) || Object.values(c.onSave).some((v) => typeof v !== 'string' || v.trim() === ''))
488
+ throw new Error("defineRepo: onSave is { <floor suite id>: '<why the daemon runs it on a save here>' }")
489
+ }
465
490
  const names = (v: unknown): boolean => v == null || (Array.isArray(v) && v.every((x) => typeof x === 'string' && x !== ''))
466
491
  if (c.history != null && (typeof c.history !== 'object' || !names(c.history.skip) || !names(c.history.also)))
467
492
  throw new Error('defineRepo: history is { skip: [folder names], also: [folders] }')
@@ -612,8 +637,11 @@ export async function loadRepoConfig(root: string, o: { fresh?: boolean } = {}):
612
637
  // a value the text cannot show would omit one set of dirs here and
613
638
  // another there
614
639
  const loaded = (mod.default.vendored ?? []).map(normalizeVendored)
615
- const read = vendoredOfText(readFileSync(path, 'utf8'))
640
+ const text = readFileSync(path, 'utf8')
641
+ const read = vendoredOfText(text)
616
642
  if (loaded.join('\0') !== read.join('\0'))
617
643
  throw new Error(`${path}: \`vendored\` must be a literal array of strings, the tools that never load the config read it as text (they read [${read.join(', ')}], the config says [${loaded.join(', ')}])`)
644
+ if ((mod.default.foreign === true) !== foreignOfText(text))
645
+ throw new Error(`${path}: \`foreign\` must be a literal \`foreign: true\` at the top of defineRepo({…}), the passes that leave the Mac read it as text (they read ${foreignOfText(text)}, the config says ${mod.default.foreign === true})`)
618
646
  return mod.default
619
647
  }
@@ -0,0 +1,19 @@
1
+ // the moment a « set aside » word names: read by the store (snooze.ts) and by the hub's page, which shows each
2
+ // choice's time before he picks it. No store, no disk: the page bundles it
3
+
4
+ /** the moment a « set aside » word names, from `now`, local time: 2h, tomorrow (9:00), next-week (Monday 9:00), a date
5
+ * (9:00) or a date and time; null for a word it does not read */
6
+ export function asideAt(word: string, now = new Date()): Date | null {
7
+ const w = word.trim().toLowerCase()
8
+ const hours = /^(\d+)\s*h$/.exec(w)
9
+ if (hours) return new Date(now.getTime() + Number(hours[1]) * 3_600_000)
10
+ const at9 = (d: Date): Date => new Date(d.getFullYear(), d.getMonth(), d.getDate(), 9, 0, 0, 0)
11
+ if (w === 'tomorrow') return at9(new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1))
12
+ if (w === 'next-week' || w === 'next week') return at9(new Date(now.getFullYear(), now.getMonth(), now.getDate() + (((8 - now.getDay()) % 7) || 7)))
13
+ const day = /^(\d{4})-(\d{2})-(\d{2})(?:[t ](\d{2}):(\d{2}))?$/.exec(w)
14
+ if (day) {
15
+ const d = new Date(Number(day[1]), Number(day[2]) - 1, Number(day[3]), day[4] ? Number(day[4]) : 9, day[5] ? Number(day[5]) : 0)
16
+ return Number.isNaN(d.getTime()) ? null : d
17
+ }
18
+ return null
19
+ }
@@ -126,9 +126,9 @@ export function worksNow(f: Omit<BandFacts, 'turn'>, p: Parties): boolean {
126
126
  const l = laneOf(p, h.lane, h.session)
127
127
  return l !== undefined && (l.live || l.watch)
128
128
  }
129
- // a session the thread was passed to works it once it acts in it, never by the hand-over alone
130
- // an orchestrator's watch never lapses: it works a thread only by its `working` mark (above)
131
- return h.session !== undefined && h.handed !== true && p.sessions.some((s) => s.id === h.session && s.live && s.watch && s.orchestrator === undefined)
129
+ // a session the thread was passed to works it once it acts in it, never by the hand-over alone; the orchestrator
130
+ // role's holder is an ordinary session, its watch read like any other
131
+ return h.session !== undefined && h.handed !== true && p.sessions.some((s) => s.id === h.session && s.live && s.watch)
132
132
  }
133
133
 
134
134
  /** the band: the turn, an agent's move split by whether a live agent works it now */
@@ -32,7 +32,7 @@ export async function openDoc(doc: DocHome, key: string): Promise<{ text: string
32
32
  * does not read; else written with its repairs alone. What the home held before, and what it holds now */
33
33
  export async function writeDoc(doc: DocHome, key: string, text: string, o: { base?: string; by?: string } = {}): Promise<{ before: string; text: string }> {
34
34
  const before = await doc.load(key)
35
- const lines = await doc.check(key, text)
35
+ const lines = await doc.check(key, text, o.by ?? 'owner')
36
36
  if (o.base !== undefined && docStamp(before) !== o.base) throw new Error(`${doc.file?.(key) ?? doc.title(key)} changed since the editor opened it (an approval or another hand wrote it): copy your text, Cancel, then Edit again`)
37
37
  const bad = lines.filter((l) => l.kind === 'fail' && !l.repaired)
38
38
  if (bad.length > 0) throw new Error(bad.map((l) => l.text).join('\n'))
@@ -51,10 +51,16 @@ const HIS_SHOWN = 5
51
51
  * once, whatever the number of repos (inbox-read.ts watchedBy counts it for each). `lanes`: the watches the session
52
52
  * runs under SK_AGENT (watchers.ts laneWatchesOf): each hears its lane's threads only, so the session's own runs
53
53
  * with no SK_AGENT, and the line says so rather than ask for the command already running */
54
+ /** the one watch a session runs to hear its threads, in every line that names it: one burst, then exit 0, so a
55
+ * background command hears it with no 30 minute cap (the Monitor tool stops at 30 minutes, with no word) */
56
+ export const WATCH = (bin: string): string => `${bin} thread watch --mine --house --once`
57
+ /** how every line asks for it */
58
+ export const IN_BACKGROUND = 'as a background command (the Bash tool with run_in_background), and again after each burst it prints'
59
+
54
60
  const ARM = (bin: string, lanes: readonly string[] = []): string =>
55
61
  lanes.length === 0
56
- ? `\`${bin} thread watch --mine --house\` under a monitor (the Monitor tool), one watch for every repo where you hold threads`
57
- : `\`${bin} thread watch --mine --house\` with no SK_AGENT under a monitor (the Monitor tool), one watch for every repo where you hold threads: ${lanes.map((l) => `your watch as ${l} hears that lane's threads only`).join('; ')}, and these are your session's`
62
+ ? `\`${WATCH(bin)}\` ${IN_BACKGROUND}, one watch for every repo where you hold threads`
63
+ : `\`${WATCH(bin)}\` with no SK_AGENT ${IN_BACKGROUND}, one watch for every repo where you hold threads: ${lanes.map((l) => `your watch as ${l} hears that lane's threads only`).join('; ')}, and these are your session's`
58
64
 
59
65
  /** a prompt's one line for every store the session holds open threads in and no watch of it hears */
60
66
  const unheard = (us: readonly Unwatched[], bin: string, lanes: readonly string[]): string =>
@@ -67,9 +73,9 @@ const unheard = (us: readonly Unwatched[], bin: string, lanes: readonly string[]
67
73
  * threads passed to this session now (review/hand-over.ts); `unwatched`: per store, what it holds where no watch of it
68
74
  * runs, a line on a prompt, and a stop held once while one waits on his answer; `laneWatches`: the session's watches
69
75
  * run as a lane, named in that line */
70
- export function hookAnswer(input: HookInput, unseen: string, owed: readonly string[], bin = 'sk', nobody = '', lanes = '', o: { handed?: string; unwatched?: readonly Unwatched[]; laneWatches?: readonly string[] } = {}): string | null {
76
+ export function hookAnswer(input: HookInput, unseen: string, owed: readonly string[], bin = 'sk', nobody = '', lanes = '', o: { handed?: string; unwatched?: readonly Unwatched[]; laneWatches?: readonly string[]; role?: string } = {}): string | null {
71
77
  if (hookPasses(input) || input.hook_event_name === 'SubagentStop') return null
72
- const laneText = lanes === '' ? '' : `The owner asks for a lane on a thread. You are the orchestrator: nothing starts a process for you, so give it one now:\n${lanes}`
78
+ const laneText = lanes === '' ? '' : `The owner asks for a lane on a thread. Nothing starts a process for you, so give it one now:\n${lanes}`
73
79
  const handed = !o.handed ? '' : `Threads passed to you now, their holder gone (a lane of yours is resumed with its thread, else act on it as yourself):\n${o.handed}`
74
80
  const us = o.unwatched ?? []
75
81
  if (input.hook_event_name === 'Stop') {
@@ -89,6 +95,8 @@ export function hookAnswer(input: HookInput, unseen: string, owed: readonly stri
89
95
  owed.length === 0 ? '' : `Answers read but not closed (done or wontfix): ${owed.join(', ')}`,
90
96
  nobody === '' ? '' : `Threads of this repo nobody hears now (no agent holds it, or the session that held it ended): take one when your task allows, else name it in your report. To act on one, \`${bin} thread take <address>\` makes it yours, then act and \`${bin} thread seen <id>\`:\n${nobody}`,
91
97
  unheard(us.filter((u) => u.open > 0), bin, o.laneWatches ?? []),
98
+ // the project's orchestrator role (orchestrator/role.ts rolePromptLine): nobody hears it, or this session holds it deaf
99
+ o.role ?? '',
92
100
  ].filter((p) => p !== '')
93
101
  return parts.length === 0 ? null : JSON.stringify({ hookSpecificOutput: { hookEventName: 'UserPromptSubmit', additionalContext: parts.join('\n\n') } })
94
102
  }