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
@@ -9,7 +9,9 @@ import { relative } from 'path'
9
9
  import { houseRootOf } from '../home/home-start.ts'
10
10
  import { presence, secretsFor } from '../secrets/list.ts'
11
11
  import { scopeHouse } from '../secrets/who-reads.ts'
12
- import { managerTemplate as template, NoManager, REFUSED_EXIT, secretsWhere as where, storeArgv, type SecretsWhere } from '../secrets/manager.ts'
12
+ import { houseRowOf, managerTemplate as template, NoManager, REFUSED_EXIT, secretsWhere as where, storeArgv, type SecretsWhere } from '../secrets/manager.ts'
13
+ import { bindsPart, isTemplate, matchTemplate, templateNameLine } from '../secrets/name-template.ts'
14
+ import { inScope } from '../core/scope.ts'
13
15
  import { archivedLine } from '../secrets/archive-mark.ts'
14
16
  import { archivedIn, envVarOf, masterOnly, readSecretHere, storeSecretHere, type Read } from '../secrets/read.ts'
15
17
  import { HOUSE_LAYOUT } from '../core/house-layout.ts'
@@ -29,16 +31,32 @@ async function heldNames(w: SecretsWhere): Promise<string[]> {
29
31
  } catch {
30
32
  // a Mac with no keychain, or a scratch home: the vault's names alone
31
33
  }
32
- const creds = [...(w.house?.creds ?? []), ...(w.own?.creds ?? [])].filter((c) => !c.name.includes('<') && c.archived == null)
34
+ const creds = [...(w.house?.creds ?? []), ...(w.own?.creds ?? [])].filter((c) => !isTemplate(c.name) && c.archived == null)
33
35
  await Promise.all(creds.map(async (c) => {
34
36
  if ('value' in (await readSecretHere({ name: c.name, cwd: process.cwd(), w, say: () => {} }))) names.add(c.name)
35
37
  }))
36
38
  return [...names].sort()
37
39
  }
38
40
 
39
- /** a registry name matches a held one: `<x>` in a row stands for any one segment */
40
- const matchesRow = (row: string, name: string): boolean =>
41
- new RegExp(`^${row.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').replace(/<[^>]*>/g, '[^/]+')}$`).test(name)
41
+ /** the names under each template row: those the repo's urls declare and those this Mac's keychain holds, each in the
42
+ * repo's scope once its row is bound (secrets/name-template.ts) */
43
+ async function templateNames(w: SecretsWhere, templates: string[]): Promise<Map<string, string[]>> {
44
+ const out = new Map<string, string[]>()
45
+ if (templates.length === 0) return out
46
+ const { urlLogins } = await import('../urls/rows.ts')
47
+ let kept: string[] = []
48
+ try {
49
+ kept = (await import('../secrets/keychain.ts')).keychainReader().names()
50
+ } catch {
51
+ // a Mac with no keychain, or a scratch home: the urls' names alone
52
+ }
53
+ const names = [...new Set([...(await urlLogins(process.cwd())), ...kept])].sort()
54
+ for (const t of templates) out.set(t, names.filter((n) => matchTemplate(t, n) != null && w.house?.creds?.some((c) => c.name === n) !== true && inScope(houseRowOf(w, n)?.for, w)))
55
+ return out
56
+ }
57
+
58
+ /** a registry name matches a held one: itself, or a row with parts it is of the shape of (secrets/name-template.ts) */
59
+ const matchesRow = (row: string, name: string): boolean => row === name || matchTemplate(row, name) != null
42
60
 
43
61
  /** runs a verb, printing a refusal as its one line */
44
62
  async function refusing(stderr: NodeJS.WritableStream, run: () => Promise<number>): Promise<number> {
@@ -93,7 +111,10 @@ export class SecretListCommand extends Command {
93
111
  this.context.stdout.write(rows.length === 0 ? 'no archived secret in scope\n' : rows.map((r) => `${r.name} archived ${r.archived!.at}: ${r.archived!.why} (sk secret unarchive ${r.name})\n`).join(''))
94
112
  return 0
95
113
  }
96
- const has = await presence(rows.filter((r) => r.inScope).map((r) => r.name))
114
+ // under a template row in scope: the names of it this repo's urls declare (urls/rows.ts) and this Mac's keychain holds
115
+ const binding = new Set([...(w.house?.creds ?? []), ...(w.own?.creds ?? [])].filter((c) => bindsPart(c)).map((c) => c.name))
116
+ const under = await templateNames(w, rows.filter((r) => r.inScope && binding.has(r.name)).map((r) => r.name))
117
+ const has = await presence([...rows.filter((r) => r.inScope && !isTemplate(r.name)).map((r) => r.name), ...[...under.values()].flat()])
97
118
  const masks = new Map<string, string>()
98
119
  if (this.tail) {
99
120
  const { maskOf, maskText } = await import('../secrets/tail.ts')
@@ -112,14 +133,19 @@ export class SecretListCommand extends Command {
112
133
  if (rows.length > 0) say(line(' ', 'name', 'level', 'service', 'who can read it'))
113
134
  for (const r of rows) {
114
135
  const p = has.get(r.name)
115
- const mark = !r.inScope ? 'out ' : p === 'ok' ? 'ok ' : p === 'locked' ? 'LOCK' : 'MISS'
116
- const fix = p === 'missing' ? ` → sk secret set ${r.name}` : ''
136
+ // a row with parts is a shape, never a name to store: its names, if any, follow it
137
+ const mark = !r.inScope ? 'out ' : isTemplate(r.name) ? '<x> ' : p === 'ok' ? 'ok ' : p === 'locked' ? 'LOCK' : 'MISS'
138
+ const fix = p === 'missing' && !isTemplate(r.name) ? ` → sk secret set ${r.name}` : ''
117
139
  const tail = masks.has(r.name) ? ` ${masks.get(r.name)}` : ''
118
140
  say(`${line(mark, r.name, r.level, r.service ?? '', r.who)}${tail}${fix}`)
141
+ for (const n of under.get(r.name) ?? []) {
142
+ const q = has.get(n)
143
+ say(`${q === 'ok' ? 'ok ' : q === 'locked' ? 'LOCK' : 'MISS'} ${n}${q === 'missing' ? ` → sk secret set ${n} <account>` : ''}`)
144
+ }
119
145
  }
120
146
  if (rows.some((r) => /\?(,|$)/.test(r.who))) say('a repo with ? is one this machine does not have; --json gives each scope in a sentence')
121
147
  if (!this.check) return 0
122
- const missing = rows.filter((r) => r.inScope && !r.name.includes('<') && has.get(r.name) === 'missing').length
148
+ const missing = [...rows.filter((r) => r.inScope && !isTemplate(r.name)).map((r) => r.name), ...[...under.values()].flat()].filter((n) => has.get(n) === 'missing').length
123
149
  const known = [...(w.house?.creds ?? []), ...(w.own?.creds ?? [])].map((c) => c.name)
124
150
  const strays = (await heldNames(w)).filter((n) => !known.some((k) => matchesRow(k, n)))
125
151
  for (const n of strays) say(`UNREGISTERED ${n} → add its row to ${HOUSE_LAYOUT.secretRegistry}`)
@@ -135,7 +161,7 @@ export class SecretReadCommand extends Command {
135
161
  static override usage = Command.Usage({
136
162
  category: 'Secrets',
137
163
  description: 'print a secret (get) or the account stored with it (account), through the house secret manager',
138
- examples: [['a token', 'sk secret get rv/cloudflare/api-token'], ['the login stored with it', 'sk secret account rv/pockethost/account']],
164
+ examples: [['a token', 'sk secret get rv/demo/api-token'], ['the login stored with it', 'sk secret account rv/demo/login']],
139
165
  })
140
166
 
141
167
  name = Option.String()
@@ -164,7 +190,7 @@ export class SecretTailCommand extends Command {
164
190
  category: 'Secrets',
165
191
  description: "the end of a secret a dashboard shows (••••c23e), never the value: match a key with its dashboard",
166
192
  details: 'Each value is read in this process, through the scope and archive gates, and only its last 4 characters and its length leave it. A value under 20 characters prints its length alone.',
167
- examples: [['which ElevenLabs key the house holds', 'sk secret tail rv/elevenlabs/api-key'], ["this Mac's keychain copy, to compare with the vault's", 'sk secret tail rv/npm/token --keychain']],
193
+ examples: [['which key the house holds', 'sk secret tail rv/demo/api-key'], ["this Mac's keychain copy, to compare with the vault's", 'sk secret tail rv/demo/token --keychain']],
168
194
  })
169
195
 
170
196
  names = Option.Rest({ required: 1 })
@@ -205,7 +231,7 @@ export class SecretSetCommand extends Command {
205
231
  category: 'Secrets',
206
232
  description: 'store a secret and its account, in the vault where this machine runs one; prompts, or reads stdin',
207
233
  details: 'On the machine that runs the vault, the value goes into the vault and is read back; the keychain is never written, and a vault that is down or sealed fails the command. On a Mac that reads the vault from afar it is refused, naming the Mac that runs it. On a Mac with no vault it goes into the login keychain: the items of the name under another account are removed, and the value is read back. A repo that declares its own `credsCommand` stores through it. The value is asked at a prompt with no echo, or read whole from stdin, its trailing line breaks dropped; an empty one is refused.',
208
- examples: [['store a token', 'sk secret set rv/npm/token'], ['with its login', 'sk secret set rv/pockethost/account me@example.com']],
234
+ examples: [['store a token', 'sk secret set rv/demo/token'], ['with its login', 'sk secret set rv/demo/login me@example.com']],
209
235
  })
210
236
 
211
237
  name = Option.String()
@@ -213,6 +239,10 @@ export class SecretSetCommand extends Command {
213
239
 
214
240
  async execute(): Promise<number> {
215
241
  return refusing(this.context.stderr, async () => {
242
+ if (isTemplate(this.name)) {
243
+ this.context.stderr.write(`FAIL: nothing was stored: ${templateNameLine(this.name)}\n`)
244
+ return 1
245
+ }
216
246
  const w = await where(process.cwd())
217
247
  const archived = archivedIn(w, this.name)
218
248
  if (archived != null) {
@@ -311,7 +341,7 @@ export class SecretEnvCommand extends Command {
311
341
  category: 'Secrets',
312
342
  description: "export lines for an eval: `export RV_SECRET_<NAME>='<value>'`, all of them or none",
313
343
  details: 'Every name is read before a line prints: a refused or missing name prints no export at all (exit 3, 44 or 36), never the half an eval would take quietly.',
314
- examples: [['two secrets into this shell', 'eval "$(sk secret env rv/cloudflare/api-token rv/npm/token)"']],
344
+ examples: [['two secrets into this shell', 'eval "$(sk secret env rv/demo/api-token rv/demo/token)"']],
315
345
  })
316
346
 
317
347
  names = Option.Rest({ required: 1 })
@@ -387,7 +417,7 @@ export class SecretCopyCommand extends Command {
387
417
  category: 'Secrets',
388
418
  description: "this Mac's secrets into another Mac's keychain over ssh, each on ssh's stdin; what it holds stays",
389
419
  details: "With no name: every secret of this repo's list that this Mac holds. The other Mac runs its own `sk secret set` from the house checkout at the same place under its home. A secret it already answers is left as it is. A keychain locked to ssh stops the copy and says how to unlock it.",
390
- examples: [['every secret the other Mac lacks', 'sk secret copy --to other-mac'], ['one secret', 'sk secret copy rv/shipkit/spaces --to other-mac'], ['a Mac whose keychain ssh sees locked, from your terminal', 'sk secret copy --to other-mac --unlock']],
420
+ examples: [['every secret the other Mac lacks', 'sk secret copy --to other-mac'], ['one secret', 'sk secret copy rv/demo/access-key-id rv/demo/secret-access-key --to other-mac'], ['a Mac whose keychain ssh sees locked, from your terminal', 'sk secret copy --to other-mac --unlock']],
391
421
  })
392
422
 
393
423
  names = Option.Rest()
@@ -38,7 +38,7 @@ export class ShotCommand extends Command {
38
38
  category: 'Serve',
39
39
  description: 'a webp of any url through the warm browser (a png with --out x.png), or an mp4 clip with --video',
40
40
  details:
41
- 'one warm headless chromium for the whole machine (the `shot` global process, started when down). A still reuses the warm page when it already shows the url, so a warm shot answers in about 0.1 s. A page with `<meta name="shot-ready" content="wait">` is shot once it sets content="ready"; any other page --wait ms after its load; a page that navigates while it loads (a sign in that redirects) gets its wait again where it lands. --full shoots the whole page at the width of the viewport: one file while the page fits the tallest side of its format (webp 16383 px, jpg and png 65535), else tiles in that format, <name>-1, <name>-2… top to bottom, every one printed, so nothing of the page is lost and the format stays the one asked (a jpg instead of a webp would change what the caller asked for, a cut would drop the end of the page); a whole page stops at 131072 px, the cut said in the note. A file of this machine is a url too (its path, or file://). --video films a page that is a canvas through its WebCodecs encoder (H.264 muxed with no second encode), and any other page as chromium paints it (its screencast, encoded by ffmpeg as the frames arrive); --dom films the page even when a canvas fills it. --step <hook> films frame by frame: before each frame the page draws its time t (seconds) in `await window[hook](t)`, then its ready mark, so a slow page films smooth at its fps; a canvas page is encoded by its own WebCodecs at the exact time n / fps, any other page a screenshot a frame. A still with --step is the page drawn at --at s. A session: cookies follow every shot (one jar in memory for the whole machine), the local storage of a page does not: a shot at another viewport, a clip and the idle close (60 s) each start with an empty one, as two browser contexts do. So when an app keeps its session in local storage, open its sign in at the viewport you shoot at; a request the page sees answered 401 or 403 prints its own WARN line. A theme: --theme <hub theme> draws the page with that prefers-color-scheme and the hub reads its `hub:theme` as that theme, written nowhere, so the next shot keeps none; with no flag every shot of the machine takes serve.shotTheme of the house config. A fold: --rail draws the project list of the hub folded to its rail, --no-rail open, read the same way and written nowhere; with neither every shot takes serve.shotRail of the house config',
41
+ 'one warm headless chromium for the whole machine (the `shot` global process, started when down). A still reuses the warm page when it already shows the url, so a warm shot answers in about 0.1 s. A page with `<meta name="shot-ready" content="wait">` is shot once it sets content="ready"; any other page --wait ms after its load; a page that navigates while it loads (a sign in that redirects) gets its wait again where it lands. --full shoots the whole page at the width of the viewport: one file while the page fits the tallest side of its format (webp 16383 px, jpg and png 65535), else tiles in that format, <name>-1, <name>-2… top to bottom, every one printed, so nothing of the page is lost and the format stays the one asked (a jpg instead of a webp would change what the caller asked for, a cut would drop the end of the page); a whole page stops at 131072 px, the cut said in the note. A file of this machine is a url too (its path, or file://). --video films a page that is a canvas through its WebCodecs encoder (H.264 muxed with no second encode), and any other page as chromium paints it (its screencast, encoded by ffmpeg as the frames arrive); --dom films the page even when a canvas fills it. --step <hook> films frame by frame: before each frame the page draws its time t (seconds) in `await window[hook](t)`, then its ready mark, so a slow page films smooth at its fps; a canvas page is encoded by its own WebCodecs at the exact time n / fps, any other page a screenshot a frame. A still with --step is the page drawn at --at s. A session: cookies follow every shot (one jar in memory for the whole machine), the local storage of a page does not: a shot at another viewport, a clip and the idle close (60 s) each start with an empty one, as two browser contexts do. So when an app keeps its session in local storage, open its sign in at the viewport you shoot at; a request the page sees answered 401 or 403 prints its own WARN line. A theme: --theme <hub theme> draws the page with that prefers-color-scheme and the hub reads its `hub:theme` as that theme, written nowhere, so the next shot keeps none; with no flag every shot of the machine takes serve.shotTheme of the house config.',
42
42
  examples: [
43
43
  ['a still of a running dev server', 'sk shot localhost:5173/'],
44
44
  ['a whole tall page at a phone width', 'sk shot :5173/guest --viewport 390,844 --full --out shots/guest.png'],
@@ -46,7 +46,6 @@ export class ShotCommand extends Command {
46
46
  ['a 3 s clip', 'sk shot :4808/ --video 3 --out clips/walk.mp4'],
47
47
  ['a clip of a whole web app page, canvas or not', 'sk shot :5173/settings --video 3 --dom'],
48
48
  ['the hub in its dark theme, whatever the default', 'sk shot :4804/ --theme dark'],
49
- ['the hub with its project list open, whatever the default', 'sk shot :4799/ --no-rail'],
50
49
  ['a slow 3D page stepped frame by frame through window.__trailerStep(t)', 'sk shot :4808/ --video 3 --step __trailerStep --out clips/walk.mp4'],
51
50
  ],
52
51
  })
@@ -65,14 +64,13 @@ export class ShotCommand extends Command {
65
64
  step = Option.String('--step', { description: 'a window function the page draws time t (s) in: a clip steps it frame by frame, a still draws --at' })
66
65
  at = Option.String('--at', { description: 'with --step, the time a still is drawn at (default 0)' })
67
66
  theme = Option.String('--theme', { description: 'dark, dim, grey or light: the page drawn in that hub theme, this shot only (default the house config serve.shotTheme)' })
68
- rail = Option.Boolean('--rail', { description: "the hub's project list folded to its rail; --no-rail open; this shot only (default the house config serve.shotRail)" })
69
67
  json = Option.Boolean('--json', false, { description: 'one json line: out, ms, phases, errors, note, via, and tiles when a whole page is tiled' })
70
68
 
71
69
  async execute(): Promise<number> {
72
70
  const cwd = process.cwd()
73
71
  const err = (l: string) => this.context.stderr.write(`${l}\n`)
74
72
  try {
75
- const a = askOf({ url: fileUrlOf(this.url, cwd), full: this.full, viewport: this.viewport, dpr: this.dpr, out: this.out, reload: this.reload, wait: this.wait, video: this.video, fps: this.fps, long: this.long, dom: this.dom, step: this.step, at: this.at, theme: this.theme, rail: this.rail }, cwd)
73
+ const a = askOf({ url: fileUrlOf(this.url, cwd), full: this.full, viewport: this.viewport, dpr: this.dpr, out: this.out, reload: this.reload, wait: this.wait, video: this.video, fps: this.fps, long: this.long, dom: this.dom, step: this.step, at: this.at, theme: this.theme }, cwd)
76
74
  const r = isClip(a) ? await clipUrl(a, err) : await shotUrl(a, err)
77
75
  if (this.json) this.context.stdout.write(`${JSON.stringify(r)}\n`)
78
76
  else for (const l of renderShot(r, cwd)) this.context.stdout.write(`${l}\n`)
@@ -224,6 +224,7 @@ export class SoundCreditsCommand extends Command {
224
224
  static override usage = Command.Usage({
225
225
  category: 'Sound',
226
226
  description: 'the ElevenLabs characters left this period, or why the key is refused: free',
227
+ // sk-disable-next-line RV045 -- the help names the default ELEVEN_SECRET reads, without importing it at the cli's load
227
228
  details: `one GET /v1/user/subscription. The key: ELEVENLABS_API_KEY, else the brand's trailer.elevenKey, else the house secret rv/elevenlabs/api-key, read in the process and never printed. A key without the « User: Access » permission is refused, and the line names it. ${PAGE}`,
228
229
  examples: [['what is left', 'sk sound credits']],
229
230
  })
@@ -1,4 +1,4 @@
1
- // sk urls: every url of the repo you stand in, dev and prod, with the hub address that frames each one and the
1
+ // sk urls: every url of the repo you stand in, dev, prod and ext, with the hub address that frames each one and the
2
2
  // logins it carries (wiki tools/shipkit/urls.md). It never prints a value: the hub's chips copy one
3
3
  import { existsSync } from 'fs'
4
4
  import { join } from 'path'
@@ -26,8 +26,8 @@ export class UrlsCommand extends Command {
26
26
 
27
27
  static override usage = Command.Usage({
28
28
  category: 'Serve',
29
- description: 'every url of this repo, dev and prod, its logins and the hub address that frames it',
30
- details: 'the lines come from what the repo declares: a global process with a url (dev), a urls([...]) unit in a <name>.shipkit.ts file, and smoke.base with smoke.login (prod). A report that sends the owner to a url he logs into gives the hub address of its line. No value is ever printed.',
29
+ description: 'every url of this repo, dev, prod and ext, its logins and the hub address that frames it',
30
+ details: 'the lines come from what the repo declares: a global process with a url (dev), a urls([...]) unit in a <name>.shipkit.ts file, and smoke.base with smoke.login (prod); a console of a third party is env ext. A report that sends the owner to a url he logs into gives the hub address of its line. No value is ever printed.',
31
31
  examples: [
32
32
  ['the urls of this repo', 'sk urls'],
33
33
  ['machine readable', 'sk urls --json'],
@@ -0,0 +1,109 @@
1
+ // `sk thread inbox --hook` as it runs (review/inbox-hook.ts owns what it answers): the command (cmd_Review.ts) runs
2
+ // inboxHook, and so does the hook's own boot (cli.ts, inboxHookBoot), which makes the steps every `sk` call makes
3
+ // and never loads the registry: its 80 command files cost each prompt of each session 0.1 s.
4
+ // the one constraint a reader breaks first: every module loads inside its function. A static import here is paid at
5
+ // every prompt of every agent in every house repo (tests/inbox-hook-boot.test.ts counts what the boot loads)
6
+ import type { HookInput } from '../review/inbox-hook.ts'
7
+ import type { Here } from './review-here.ts'
8
+
9
+ /** the hook's input, one small json on stdin; a terminal has none */
10
+ export async function readHookInput(): Promise<HookInput> {
11
+ const { parseHookInput } = await import('../review/inbox-hook.ts')
12
+ return parseHookInput(process.stdin.isTTY === true ? '' : await new Response(Bun.stdin.stream()).text().catch(() => ''))
13
+ }
14
+
15
+ /** the hook's answer to one event on the store `h` stands in, printed; its exit code */
16
+ export async function inboxHook(h: Here, input: HookInput): Promise<number> {
17
+ const { endedAgentOf, hookSession } = await import('../review/inbox-hook.ts')
18
+ const { hereStore, partiesFor, pull, storesOf } = await import('./review-here.ts')
19
+ if (input.hook_event_name === 'SessionStart') {
20
+ // a session's start: three lines of facts at most; no sync, no registry write, no hand over. An
21
+ // orchestrator's own session reads none
22
+ const { orphansOf } = await import('../review/inbox-read.ts')
23
+ const { isOrchestrator, startFacts, startNotice, wantsView } = await import('../orchestrator/start-notice.ts')
24
+ const session = hookSession(input)
25
+ if (isOrchestrator()) return 0
26
+ const store = await hereStore(h)
27
+ const parties = await partiesFor([store], session)
28
+ const orphan = session === null ? { threads: [], read: [] } : orphansOf(store, { lane: null, session }, parties)
29
+ const unheard = [...new Set([...orphan.threads, ...orphan.read].map((x) => x.address))]
30
+ // its orchestrator's terminal is read only when he started one and nobody hears (one tmux command, one ps)
31
+ let view = null
32
+ if (wantsView(store.repo, parties)) {
33
+ const { orchestratorsNow } = await import('../orchestrator/now.ts')
34
+ const { machineOrchestratorHost } = await import('../serve/orchestrator-host.ts')
35
+ const { liveWatchers } = await import('../review/watchers.ts')
36
+ const { roleHolders } = await import('../orchestrator/role.ts')
37
+ view = orchestratorsNow([{ name: store.repo, path: store.root }], { host: machineOrchestratorHost(), watchers: () => liveWatchers(store.dir), holders: () => roleHolders() })[0] ?? null
38
+ }
39
+ h.out(JSON.stringify({ hookSpecificOutput: { hookEventName: 'SessionStart', additionalContext: startNotice(startFacts(store.repo, session, parties, unheard, { view })) } }))
40
+ return 0
41
+ }
42
+ await pull(h)
43
+ const here = await hereStore(h)
44
+ for (const b of here.broken) h.err(`review: FAIL ${b.id}: ${b.error}`)
45
+ // what this session hears, in its own repo and in every store it or its lanes wrote in
46
+ const session = hookSession(input)
47
+ const { noteHanded, noteSession } = await import('../agent-time/registry.ts')
48
+ if (session !== null) noteSession(h.dir)
49
+ let stores = [here, ...(session === null ? [] : await storesOf(session, h.dir))]
50
+ // a SubagentStop fires at every turn a lane ends, one that waits on its background work too: the
51
+ // registry reads which (agent-time/registry.ts readParties, stopped)
52
+ const parties = await partiesFor(stores, session, endedAgentOf(input))
53
+ // rule 2 as a write: a thread whose holder is gone passes on now (review/hand-over.ts)
54
+ const { handOver, handedLines } = await import('../review/hand-over.ts')
55
+ const handed = session === null ? [] : stores.flatMap((s) => handOver(s.dir, s.say.spec, parties, s.repo, { onHanded: noteHanded }))
56
+ if (input.hook_event_name === 'SubagentStop') return 0
57
+ if (handed.length > 0) stores = [await hereStore(h), ...(session === null ? [] : await storesOf(session, h.dir))]
58
+ const me = { lane: null, session }
59
+ // the session's own watch in a store, or its one house watch for all of them, registered in a store's canonical
60
+ // folder too (a hook run in a worktree); on a prompt, a --once watch that just printed its burst counts: that
61
+ // burst woke this turn, which arms it again. A stop counts live watches only
62
+ const { laneWatchesOf, watchedBy } = await import('../review/watchers.ts')
63
+ const { canonicalStore } = await import('../review/item-db.ts')
64
+ const dirs = [...new Set(stores.flatMap((s) => [s.dir, canonicalStore(s.dir)]))]
65
+ const watched = watchedBy(session, dirs, undefined, { rearm: input.hook_event_name === 'UserPromptSubmit' })
66
+ const watchedIn = (dir: string): boolean => watched(dir) || watched(canonicalStore(dir))
67
+ const laneWatches = session === null ? [] : laneWatchesOf(session, dirs)
68
+ // the project's orchestrator role, on a prompt: a line that never fails the hook
69
+ let role = ''
70
+ if (input.hook_event_name === 'UserPromptSubmit' && session !== null) {
71
+ try {
72
+ role = (await import('../orchestrator/role.ts')).rolePromptLine(here.repo, session)
73
+ } catch {}
74
+ }
75
+ const { hookReply } = await import('../review/inbox-read.ts')
76
+ const answer = hookReply({ input, me, stores, parties, onHanded: noteHanded, handed: handedLines(handed.filter((x) => x.to === session)), watchedIn, laneWatches, role })
77
+ if (answer != null) h.out(answer)
78
+ return 0
79
+ }
80
+
81
+ /** the hook as the whole process, `t0` its start: the steps of every `sk` call (cli.ts: one copy of the lib, the
82
+ * machine's link, the call logged, pm started when it is down, a resumed lane's threads taken back), then the hook,
83
+ * as the command runs it under its `run`: a refusal is one FAIL line and its exit code. One step is not in the
84
+ * cli's order: pm is asked while the hook works and awaited at its end, since the hook never needs its answer */
85
+ export async function inboxHookBoot(argv: string[], t0: number, io: { out: (l: string) => void; err: (l: string) => void } = { out: (l) => void process.stdout.write(`${l}\n`), err: (l) => void process.stderr.write(`${l}\n`) }): Promise<number> {
86
+ ;(await import('../core/one-lib.ts')).installOneLib()
87
+ await (await import('../core/machine-link.ts')).linkMachineCopy()
88
+ const { callsFile, logCall } = await import('./kit/calls.ts')
89
+ const call = logCall(callsFile((await import('node:os')).homedir(), 'sk'), 'sk', argv)
90
+ call.matched('thread inbox', performance.now() - t0)
91
+ const { autostart } = await import('../home/autostart.ts')
92
+ const pm = autostart(argv).catch((e: unknown) => void io.err(`WARN pm was not asked: ${e instanceof Error ? e.message : String(e)}`))
93
+ try {
94
+ await (await import('../review/take-back.ts')).takeBackAtBoot()
95
+ const input = await readHookInput()
96
+ const { hookPasses } = await import('../review/inbox-hook.ts')
97
+ if (hookPasses(input)) return 0
98
+ const { noRepo, openHere, refused, reviewRoot } = await import('./review-here.ts')
99
+ try {
100
+ const root = await reviewRoot(process.cwd())
101
+ if (root == null) throw new Error(noRepo(process.cwd()))
102
+ return await inboxHook(await openHere(root, io.out, io.err), input)
103
+ } catch (e) {
104
+ return refused(e, io.err)
105
+ }
106
+ } finally {
107
+ await pm
108
+ }
109
+ }
@@ -12,7 +12,7 @@ import { TimeCommand, TimeDietCommand } from './cmd_Time.ts'
12
12
  import { DrillCalibrateCommand, DrillCleanCommand, DrillCloneCommand, DrillCompareCommand, DrillFinishCommand, DrillReportCommand, DrillVerdictCommand } from './cmd_Drill.ts'
13
13
  import { CheckCommand } from './cmd_Check.ts'
14
14
  import { CapacityCommand } from './cmd_Capacity.ts'
15
- import { HqThreadsCommand, HqCardsAliasCommand, HqCloseCommand, HqDrillCommand, HqEndCommand, HqForgetCommand, HqInviteCommand, HqJoinCommand, HqLeaveCommand, HqOpenCommand, HqDoorCommand, HqProxyCommand, HqReflectionsCommand, HqReflectionsForgetCommand, HqReplicateCommand, HqSwitchCommand } from './cmd_Hq.ts'
15
+ import { HqThreadsCommand, HqCardsAliasCommand, HqCloseCommand, HqDrillCommand, HqEndCommand, HqForgetCommand, HqInviteCommand, HqJoinCommand, HqLeaveCommand, HqOpenCommand, HqDoorCommand, HqTerminalsCommand, HqProxyCommand, HqReflectionsCommand, HqReflectionsForgetCommand, HqReplicateCommand, HqSwitchCommand } from './cmd_Hq.ts'
16
16
  import { HistoryCheckCommand, HistoryForgetCommand, HistorySendCommand } from './cmd_History.ts'
17
17
  import { VaultCompareCommand, VaultImportCommand, VaultInitCommand, VaultKeyCommand, VaultNarrowCommand, VaultDestroyCommand, VaultRestoreCommand, VaultRevokeRootsCommand, VaultServeCommand, VaultSnapshotCommand, VaultStatusCommand } from './cmd_Vault.ts'
18
18
  import { LanesCommand } from './cmd_Lanes.ts'
@@ -58,6 +58,8 @@ import { ThreadSyncNeedsCommand } from './cmd_ThreadSyncNeeds.ts'
58
58
  import { ADVISORS_COMMANDS } from './cmd_Advisors.ts'
59
59
  import { ThreadHoldsCommand } from './cmd_ThreadHolds.ts'
60
60
  import { ORCHESTRATOR_COMMANDS } from './cmd_Orchestrator.ts'
61
+ import { ORCHESTRATOR_ROLE_COMMANDS } from './cmd_OrchestratorRole.ts'
62
+ import { CHANNEL_COMMANDS } from './cmd_Channel.ts'
61
63
  import { ThreadFoldReflectionsCommand, ThreadReflectCommand } from './cmd_ThreadReflect.ts'
62
64
  import { SOCIAL_COMMANDS } from './cmd_Social.ts'
63
65
  import { SOCIAL_DRAFT_COMMANDS } from './cmd_SocialDrafts.ts'
@@ -159,6 +161,8 @@ export function buildCli(): Cli {
159
161
  for (const c of ADVISORS_COMMANDS) cli.register(c)
160
162
  cli.register(ThreadHoldsCommand)
161
163
  for (const c of ORCHESTRATOR_COMMANDS) cli.register(c)
164
+ for (const c of ORCHESTRATOR_ROLE_COMMANDS) cli.register(c)
165
+ for (const c of CHANNEL_COMMANDS) cli.register(c)
162
166
  cli.register(ThreadReflectCommand)
163
167
  cli.register(ThreadFoldReflectionsCommand)
164
168
  for (const c of SOCIAL_COMMANDS) cli.register(c)
@@ -246,7 +250,7 @@ export function buildCli(): Cli {
246
250
  cli.register(DbDropCommand)
247
251
  cli.register(DbRepairCommand)
248
252
  cli.register(DbRebuildCommand)
249
- for (const c of [HqOpenCommand, HqCloseCommand, HqInviteCommand, HqEndCommand, HqForgetCommand, HqJoinCommand, HqLeaveCommand, HqReplicateCommand, HqDrillCommand, HqThreadsCommand, HqSwitchCommand, HqReflectionsCommand, HqReflectionsForgetCommand, HqProxyCommand, HqDoorCommand]) cli.register(c)
253
+ for (const c of [HqOpenCommand, HqCloseCommand, HqInviteCommand, HqEndCommand, HqForgetCommand, HqJoinCommand, HqLeaveCommand, HqReplicateCommand, HqDrillCommand, HqThreadsCommand, HqSwitchCommand, HqReflectionsCommand, HqReflectionsForgetCommand, HqProxyCommand, HqDoorCommand, HqTerminalsCommand]) cli.register(c)
250
254
  for (const c of [HistorySendCommand, HistoryCheckCommand, HistoryForgetCommand]) cli.register(c)
251
255
  for (const c of [VaultServeCommand, VaultStatusCommand, VaultInitCommand, VaultKeyCommand, VaultNarrowCommand, VaultImportCommand, VaultCompareCommand, VaultSnapshotCommand, VaultRestoreCommand, VaultDestroyCommand, VaultRevokeRootsCommand]) cli.register(c)
252
256
  cli.register(CallsCommand)
@@ -0,0 +1,136 @@
1
+ // what the thread verbs (cmd_Review.ts) and the inbox hook (inbox-hook-run.ts) share before they act: the repo the cwd
2
+ // stands in, its store opened with its unit, the stores a session wrote in, the parties those stores name.
3
+ // the one constraint a reader breaks first: every module loads inside its function, never at the top. The hook's own
4
+ // boot (cli.ts) loads this file at every prompt of every session, and the registry on every `sk` call
5
+
6
+ type Unit = import('../review/unit.ts').ReviewUnit
7
+ type Say = import('../review/format.ts').Say
8
+ type StoreRead = import('../review/inbox-read.ts').StoreRead
9
+
10
+ /** what a verb works on: the store, its repo's unit (null when the verb reads no unit, or the repo has none), and how the unit's lines print */
11
+ export interface Here {
12
+ dir: string
13
+ unit: Unit | null
14
+ say: Say
15
+ out: (l: string) => void
16
+ err: (l: string) => void
17
+ }
18
+
19
+ /** the shipkit repo the cwd stands in: only its store reaches a hub, so anywhere else an item is refused before a
20
+ * stray .shipkit/review/ is made where nobody looks */
21
+ export async function reviewRoot(cwd: string): Promise<string | null> {
22
+ const { findRepoRoot } = await import('../ts/config.ts')
23
+ const { existsSync } = await import('node:fs')
24
+ const { join } = await import('node:path')
25
+ const root = findRepoRoot(cwd)
26
+ return existsSync(join(root, 'repo.config.ts')) ? root : null
27
+ }
28
+
29
+ /** why a verb run outside a shipkit repo is refused */
30
+ export const noRepo = (cwd: string): string => `${cwd} is in no shipkit repo (no repo.config.ts at its git root), so no hub would ever show what is stored here: run it from inside the repo the thread is for`
31
+
32
+ /** the store of the repo at `root` with its unit read and its spec bound */
33
+ export async function openHere(root: string, out: (l: string) => void, err: (l: string) => void): Promise<Here> {
34
+ const { openReview, factLines } = await import('../review/project.ts')
35
+ const { specOf } = await import('../review/store.ts')
36
+ const { dir, unit } = await openReview(root)
37
+ return { dir, unit, say: { spec: specOf(dir), more: (x) => factLines(unit, x) }, out, err }
38
+ }
39
+
40
+ /** a verb's refusal: one FAIL line with its reason, and its exit code */
41
+ export async function refused(e: unknown, err: (l: string) => void): Promise<number> {
42
+ err(`FAIL: review: ${e instanceof Error ? e.message : String(e)}`)
43
+ // a walk of the items' database runs: run it again once it ends
44
+ const { isStoreRefused, WAIT_EXIT } = await import('../core/machine-db.ts')
45
+ return isStoreRefused(e) && e.wait ? WAIT_EXIT : 1
46
+ }
47
+
48
+ /** the sources pulled before a read: a line per source down, said once a process and a store */
49
+ const downSaid = new Map<string, Set<string>>()
50
+ export async function pull(h: Here): Promise<void> {
51
+ if (!h.unit?.sources?.length) return
52
+ const { pullSources } = await import('../review/project.ts')
53
+ const now = new Set<string>()
54
+ const said = downSaid.get(h.dir)
55
+ const got = await pullSources(h.dir, h.unit, (l) => {
56
+ now.add(l)
57
+ if (!said?.has(l)) h.err(l)
58
+ })
59
+ downSaid.set(h.dir, now)
60
+ if (got.length > 0) h.err(`review: ${got.length} new items pulled`)
61
+ }
62
+
63
+ /** the store the verb stands in, read for the inbox */
64
+ export async function hereStore(h: Here): Promise<StoreRead> {
65
+ const { readAll } = await import('../review/store.ts')
66
+ const { repoNameOf } = await import('../agent-time/registry.ts')
67
+ const { dirname } = await import('node:path')
68
+ const root = dirname(dirname(h.dir))
69
+ return { repo: repoNameOf(root), root, dir: h.dir, here: true, ...readAll(h.dir), say: h.say }
70
+ }
71
+
72
+ /** every other store this session or its lanes wrote in (agent-time/registry.ts), each with its repo's unit bound */
73
+ export async function storesOf(session: string, hereDir: string): Promise<StoreRead[]> {
74
+ const { repoNameOf } = await import('../agent-time/registry.ts')
75
+ const { readAll } = await import('../review/store.ts')
76
+ const { canonicalStore } = await import('../review/item-db.ts')
77
+ const { dirname } = await import('node:path')
78
+ const here = canonicalStore(hereDir)
79
+ const out: StoreRead[] = []
80
+ for (const dir of await recordedStores(session, (d) => d === here)) {
81
+ const root = dirname(dirname(dir))
82
+ try {
83
+ const { say } = await hereAt(dir, () => {}, () => {})
84
+ out.push({ repo: repoNameOf(root), root, dir, here: false, ...readAll(dir), say })
85
+ } catch {
86
+ // a store that does not read now: its own repo's hook and inbox say why
87
+ }
88
+ }
89
+ return out
90
+ }
91
+
92
+ /** the stores the session's record names, each once by its canonical folder (review/item-db.ts canonicalStore: a
93
+ * worktree's store is its checkout's), but those `skip` keeps out, asked with that folder; only a store its commands
94
+ * run in (`sk thread seen` there refuses a folder that is no shipkit repo), the others leave its record */
95
+ export async function recordedStores(session: string, skip: (dir: string) => boolean): Promise<string[]> {
96
+ const { forgetStores, readSessionRecord, scratchStore } = await import('../agent-time/registry.ts')
97
+ const { canonicalStore } = await import('../review/item-db.ts')
98
+ const { existsSync } = await import('node:fs')
99
+ const { dirname } = await import('node:path')
100
+ const dirs: string[] = []
101
+ const gone: string[] = []
102
+ for (const d of readSessionRecord(session)?.stores ?? []) {
103
+ if (scratchStore(d) || !existsSync(d) || (await reviewRoot(dirname(dirname(d)))) === null) {
104
+ gone.push(d)
105
+ continue
106
+ }
107
+ const c = canonicalStore(d)
108
+ if (!dirs.includes(c) && !skip(c)) dirs.push(c)
109
+ }
110
+ forgetStores(session, gone)
111
+ return dirs
112
+ }
113
+
114
+ /** the store at `dir` of another repo as a verb works on it, its repo's unit bound */
115
+ export async function hereAt(dir: string, out: (l: string) => void, err: (l: string) => void): Promise<Here> {
116
+ const { openReview, factLines } = await import('../review/project.ts')
117
+ const { specOf } = await import('../review/store.ts')
118
+ const { dirname } = await import('node:path')
119
+ const { unit } = await openReview(dirname(dirname(dir)))
120
+ return { dir, unit, say: { spec: specOf(dir), more: (x) => factLines(unit, x) }, out, err }
121
+ }
122
+
123
+ /** the parties these stores' threads name: their holders' sessions and the caller's, with each store's live watches */
124
+ export async function partiesFor(stores: readonly StoreRead[], self: string | null, stopped: string | null = null): Promise<import('../review/parties.ts').Parties> {
125
+ const { readParties } = await import('../agent-time/registry.ts')
126
+ const { holderOf, threadsOf } = await import('../review/threads.ts')
127
+ const { liveWatchers } = await import('../review/watchers.ts')
128
+ const ids = new Set<string>()
129
+ for (const s of stores) for (const t of threadsOf(s.items, s.say.spec)) {
130
+ const hs = holderOf(t)?.session
131
+ if (hs) ids.add(hs)
132
+ }
133
+ const { hearingHolders } = await import('../orchestrator/role.ts')
134
+ const { placeParties } = await import('../orchestrator/places.ts')
135
+ return readParties({ sessions: [...ids], watchers: stores.flatMap((s) => liveWatchers(s.dir)), self, stopped, roles: hearingHolders, places: placeParties })
136
+ }
package/src/cli.ts CHANGED
@@ -54,23 +54,54 @@ async function headGate(raw: string[]): Promise<number | null> {
54
54
  return o === null ? null : await m.runHeadGate(process.cwd(), { ...o, print: (l) => process.stdout.write(`${l}\n`) })
55
55
  }
56
56
 
57
+ /** true for the one line the inbox hook is wired as, `sk thread inbox --hook` (or its older name), nothing else on it */
58
+ export const isInboxHookLine = (raw: readonly string[]): boolean => raw.length === 3 && (raw[0] === 'thread' || raw[0] === 'review') && raw[1] === 'inbox' && raw[2] === '--hook'
59
+
60
+ /** the inbox hook, which every session of every house repo runs at each prompt and each turn's end, run by its own
61
+ * small module before the registry loads: the 80 command files cost it 0.1 s each time (cli/inbox-hook-run.ts makes
62
+ * the boot's steps itself). null: the full cli runs, for any other line, for an installed copy (handoff.ts hands
63
+ * it to the house's), and when that module fails to load, so the boot below catches the broken file */
64
+ async function inboxHook(raw: string[], t0: number): Promise<number | null> {
65
+ if (!isInboxHookLine(raw) || import.meta.path.split(/[\\/]/).includes('node_modules')) return null
66
+ let m
67
+ try { m = await import('./cli/inbox-hook-run.ts') } catch { return null }
68
+ bootLoaded()
69
+ return m.inboxHookBoot(raw, t0)
70
+ }
71
+
72
+ /** `sk channel`, alone on its line, as Claude Code spawns it in each session: its own small module, never the
73
+ * registry (cli/channel-run.ts). null: the full cli runs (`--declare`, `--help`, an installed copy, a module that
74
+ * fails to load) */
75
+ async function channel(raw: string[]): Promise<number | null> {
76
+ if (raw.length !== 1 || raw[0] !== 'channel' || import.meta.path.split(/[\\/]/).includes('node_modules')) return null
77
+ let m
78
+ try { m = await import('./cli/channel-run.ts') } catch { return null }
79
+ return m.channelBoot()
80
+ }
81
+
57
82
  if (import.meta.main) {
58
83
  const raw = process.argv.slice(2)
59
84
  const gated = await headGate(raw)
60
85
  if (gated !== null) process.exit(gated)
86
+ const served = await channel(raw)
87
+ if (served !== null) process.exit(served)
61
88
  const t0 = performance.now()
62
- const m = await loadBoot(raw[0]).catch((e: unknown) => bootFailed(e, process.argv.slice(1)))
63
- bootLoaded()
64
- const [{ buildCli }, { aliasArgs }, { handoff }, { installOneLib }, { callsFile, commandPath, helpArgv, logCall }, { autostart }, { linkMachineCopy }, { takeBackAtBoot }] = m
65
- const argv = aliasArgs(raw)
66
- handoff(argv)
67
- installOneLib()
68
- await linkMachineCopy()
69
- const call = logCall(callsFile((await import('os')).homedir(), 'sk'), 'sk', argv)
70
- const cli = buildCli()
71
- const run = helpArgv(argv, (a) => cli.process(a))
72
- call.matched(commandPath(() => cli.process(run)), performance.now() - t0)
73
- await autostart(run)
74
- await takeBackAtBoot()
75
- void cli.runExit(run)
89
+ const hooked = await inboxHook(raw, t0)
90
+ if (hooked !== null) process.exitCode = hooked
91
+ else {
92
+ const m = await loadBoot(raw[0]).catch((e: unknown) => bootFailed(e, process.argv.slice(1)))
93
+ bootLoaded()
94
+ const [{ buildCli }, { aliasArgs }, { handoff }, { installOneLib }, { callsFile, commandPath, helpArgv, logCall }, { autostart }, { linkMachineCopy }, { takeBackAtBoot }] = m
95
+ const argv = aliasArgs(raw)
96
+ handoff(argv)
97
+ installOneLib()
98
+ await linkMachineCopy()
99
+ const call = logCall(callsFile((await import('os')).homedir(), 'sk'), 'sk', argv)
100
+ const cli = buildCli()
101
+ const run = helpArgv(argv, (a) => cli.process(a))
102
+ call.matched(commandPath(() => cli.process(run)), performance.now() - t0)
103
+ await autostart(run)
104
+ await takeBackAtBoot()
105
+ void cli.runExit(run)
106
+ }
76
107
  }
@@ -51,10 +51,11 @@ export function accountProblem(account: string): string | null {
51
51
  }
52
52
 
53
53
  /** one value stored under a name, as an ask's field and a setup step's field both store it: trimmed, an empty one refused,
54
- * the store's refusal said with the value hidden, what the hub remembered of the stores forgotten */
55
- export async function storeValue(o: { root: string; name: string; value: string; account?: string | undefined; store: SecretStore }): Promise<void> {
56
- const value = o.value.trim()
57
- if (value === '') throw new Error(`${o.name}: an empty value is not stored`)
54
+ * the store's refusal said with the value hidden, what the hub remembered of the stores forgotten. `exact`: stored as
55
+ * typed, its spaces kept (a password), never trimmed */
56
+ export async function storeValue(o: { root: string; name: string; value: string; account?: string | undefined; store: SecretStore; exact?: boolean }): Promise<void> {
57
+ const value = o.exact === true ? o.value : o.value.trim()
58
+ if (value.trim() === '') throw new Error(`${o.name}: an empty value is not stored`)
58
59
  let r: Awaited<ReturnType<SecretStore>>
59
60
  try {
60
61
  r = await o.store(o.name, value, o.account)
@@ -223,9 +223,13 @@ function feedLine(row: CheckRow, f: CheckFacts): string {
223
223
 
224
224
  export const fmtMs = (ms: number): string => (ms >= 1000 ? `${(ms / 1000).toFixed(1)}s` : `${Math.round(ms)}ms`)
225
225
 
226
+ /** off in this repo (when off, or it runs nowhere): n/a, whatever its last run said before it was turned off */
227
+ const isOff = (f: CheckFacts): boolean => f.when === 'off' || f.runs.off != null
228
+
226
229
  /** green is MEASURED passing and nothing else may claim it, so a replay is
227
230
  * quiet: it is the last verdict, not this tree's evidence. */
228
231
  function stateOf(f: CheckFacts): ResourceState {
232
+ if (isOff(f)) return 'quiet'
229
233
  if (f.status === 'fail') return f.advisory ? 'warn' : 'red'
230
234
  if (f.status === 'warn') return 'warn'
231
235
  if (f.status === 'skip') return 'quiet'
@@ -237,6 +241,7 @@ function stateOf(f: CheckFacts): ResourceState {
237
241
  * the world rather than this change, so it is taste debt, never a phone
238
242
  * notification at night. */
239
243
  function severityOf(f: CheckFacts): NeedSeverity | undefined {
244
+ if (isOff(f)) return undefined
240
245
  if (f.status === 'fail') return f.advisory ? 'yellow' : 'red'
241
246
  // a check that only ran over its time budget is work for whoever makes it
242
247
  // faster, never a line asking for his hands: yellow on the tree, no feed
@@ -180,9 +180,10 @@ export type TestRun = {
180
180
 
181
181
  /** where a test file stands with the checks: a check runs it, a bunfig
182
182
  * ignore keeps it out on purpose, no check reaches it (what SK018 fails),
183
- * its check's script is not a plain `bun test` so nothing can say, or a slow
184
- * declaration names a file that is not on disk */
185
- export type TestStanding = 'runs' | 'ignored' | 'orphan' | 'opaque' | 'missing'
183
+ * its check's script is not a plain `bun test` so nothing can say, a slow
184
+ * declaration names a file that is not on disk, or the repo turns its test
185
+ * check off on purpose (n/a, never red) */
186
+ export type TestStanding = 'runs' | 'ignored' | 'orphan' | 'opaque' | 'missing' | 'off'
186
187
 
187
188
  /** who reads a secret, as the hub shows it: its chips, and the sentence behind them (secrets/who-reads.ts) */
188
189
  export type Readers = { long: string; chips: ScopeChip[] }