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
@@ -1,15 +1,19 @@
1
1
  // the registry of parties (wiki tools/shipkit/threads-how-it-fits.md, The rules): each Claude Code session that acted in
2
2
  // a thread, its process and the stores it and its lanes wrote in, one small file per session; its lanes read from the
3
3
  // transcripts `sk lanes` already reads; the watches from each store's watcher files. Its one reader: readParties
4
- import { closeSync, existsSync, mkdirSync, openSync, readdirSync, readFileSync, readSync, rmSync, statSync } from 'node:fs'
4
+ // the one constraint a reader breaks first: a hook runs readParties in a fresh process at every prompt of every agent,
5
+ // so a read of each lane's files there is 0.6 s of everyone's time: what a lane's head says for good is kept (keptFile)
6
+ import { closeSync, existsSync, fstatSync, mkdirSync, openSync, readdirSync, readFileSync, readSync, rmSync } from 'node:fs'
5
7
  import { basename, dirname, join } from 'node:path'
8
+ import { type ClaudeRecord, sessionRecords } from './claude-sessions.ts'
6
9
  import { laneNameOf } from './lane-name.ts'
7
10
  import { stateOf } from './live.ts'
11
+ import type { TranscriptFile } from './store.ts'
8
12
  import { HAND_BACK } from './timeline.ts'
9
13
  import { pidAlive } from '../review/watchers.ts'
10
14
  import { machinePath } from '../core/machine-layout.ts'
11
15
  import type { Watcher } from '../review/model.ts'
12
- import { NO_PARTIES, type LaneParty, type Parties, type SessionParty } from '../review/parties.ts'
16
+ import { NO_PARTIES, withOtherPlaces, type LaneParty, type Parties, type SessionParty } from '../review/parties.ts'
13
17
  import { withLeaseSync } from '../core/locked-write.ts'
14
18
  import { atomicWriteJson } from '../core/atomic-write.ts'
15
19
 
@@ -39,13 +43,16 @@ function readRecord(file: string): SessionRecord | null {
39
43
  export const scratchStore = (store: string): boolean => /\/\.shipkit\/tmp\//.test(store)
40
44
 
41
45
  /** the session of this process acted on `store`: its record names the store and its process. Silent and cheap: it
42
- * writes only when something changed, and never fails the act that called it */
43
- export function noteSession(store: string, o: { env?: Record<string, string | undefined>; now?: Date } = {}): void {
46
+ * writes only when something changed, and never fails the act that called it. A lane shares its session's ids, so
47
+ * its act in its worktree names the store by its canonical folder (review/item-db.ts canonicalStore), never a second
48
+ * time under the worktree's path */
49
+ export function noteSession(at: string, o: { env?: Record<string, string | undefined>; now?: Date } = {}): void {
44
50
  const env = o.env ?? process.env
45
51
  const session = env.CLAUDE_CODE_SESSION_ID?.trim()
46
52
  const pid = Number(env.CLAUDE_PID)
47
- if (!session || !Number.isInteger(pid) || pid <= 0 || scratchStore(store)) return
53
+ if (!session || !Number.isInteger(pid) || pid <= 0 || scratchStore(at)) return
48
54
  try {
55
+ const store = (require('../review/item-db.ts') as typeof import('../review/item-db.ts')).canonicalStore(at)
49
56
  const file = fileOf(session)
50
57
  const known = readRecord(file)
51
58
  if (known && known.pid === pid && known.stores.includes(store)) return
@@ -69,19 +76,6 @@ function writeRecord(file: string, r: SessionRecord): void {
69
76
  atomicWriteJson(file, r)
70
77
  }
71
78
 
72
- /** a session's record written for it by the process that launched it (the orchestrator's keeper): its claude pid, the
73
- * one its own `CLAUDE_PID` gives, so its own acts never rewrite the record and drop these stores; exactly `stores` */
74
- export function recordSession(session: string, pid: number, stores: readonly string[], now = new Date()): void {
75
- const file = fileOf(session)
76
- const all = [...new Set(stores)]
77
- mkdirSync(sessionsDir(), { recursive: true })
78
- underRecordLock(file, () => {
79
- const was = readRecord(file)
80
- if (was && was.pid === pid && all.length === was.stores.length && all.every((x) => was.stores.includes(x))) return
81
- writeRecord(file, { session, pid, stores: all, at: now.toISOString() })
82
- })
83
- }
84
-
85
79
  /** stores a session's hook can no longer act in (a folder gone, a repo no longer shipkit's) leave its record, so no
86
80
  * hook asks about them again */
87
81
  export function forgetStores(session: string, gone: readonly string[]): void {
@@ -120,6 +114,49 @@ export function laneNamesOf(description: string, brief: string): string[] {
120
114
  return [...out]
121
115
  }
122
116
 
117
+ /** the disk under a read of the parties: the real one, or a test's own */
118
+ export interface PartiesDisk {
119
+ /** every transcript of these sessions (store.ts listTranscripts) */
120
+ transcripts(sessions: ReadonlySet<string>): TranscriptFile[]
121
+ /** a small file whole, null when it does not read */
122
+ text(path: string): string | null
123
+ /** up to `bytes` of a file, from its start or from its end (`tail`), and whether the file holds more; null when
124
+ * it does not open */
125
+ part(path: string, bytes: number, tail?: boolean): { text: string; more: boolean } | null
126
+ /** a kept file written whole, or removed (null) */
127
+ keep(path: string, value: unknown): void
128
+ }
129
+
130
+ const FILES: Omit<PartiesDisk, 'transcripts'> = {
131
+ text: (path) => {
132
+ try {
133
+ return readFileSync(path, 'utf8')
134
+ } catch {
135
+ return null
136
+ }
137
+ },
138
+ part: (path, bytes, tail = false) => {
139
+ try {
140
+ const fd = openSync(path, 'r')
141
+ try {
142
+ const size = tail ? fstatSync(fd).size : 0
143
+ const buf = Buffer.alloc(tail ? Math.min(size, bytes) : bytes)
144
+ const n = readSync(fd, buf, 0, buf.length, tail ? size - buf.length : 0)
145
+ return { text: buf.subarray(0, n).toString('utf8'), more: tail ? size > buf.length : n === bytes }
146
+ } finally {
147
+ closeSync(fd)
148
+ }
149
+ } catch {
150
+ return null
151
+ }
152
+ },
153
+ keep: (path, value) => {
154
+ if (value === null) return void rmSync(path, { force: true })
155
+ mkdirSync(dirname(path), { recursive: true })
156
+ atomicWriteJson(path, value)
157
+ },
158
+ }
159
+
123
160
  /** what a lane's files say of it for good: its description, the names its brief gives it, whether it hands back */
124
161
  type LaneFacts = { what: string; names: string[]; handsBack: boolean }
125
162
  /** each lane transcript's facts, read once its head is whole (the head's 64 KiB are written) or while its file stands
@@ -127,15 +164,81 @@ type LaneFacts = { what: string; names: string[]; handsBack: boolean }
127
164
  const laneFacts = new Map<string, { facts: LaneFacts; mtime: number; whole: boolean }>()
128
165
  const HEAD_BYTES = 64 * 1024
129
166
 
130
- function laneFactsOf(f: { path: string; mtime: number; size: number }): LaneFacts {
167
+ /** the facts of a session's lanes whose head is whole, kept for the next process: one file a session, beside the
168
+ * folder of the records and never in it (the hub stamps that folder to know a record moved) */
169
+ const keptFile = (session: string): string => join(`${sessionsDir()}.lanes`, `${session.replace(/[^\w-]/g, '_')}.json`)
170
+
171
+ /** a kept file as written: the stamp of the code that read the facts, then per `subagents` folder each lane's
172
+ * `[what, names, handsBack]` by its transcript's name */
173
+ type Kept = { stamp: string; lanes: Record<string, Record<string, [string, string[], boolean]>> }
174
+
175
+ /** the lanes each kept file holds, as this process read or wrote it */
176
+ const kept = new Map<string, Set<string>>()
177
+
178
+ /** a session's kept facts join the memo, once a process. Only a whole head is ever kept, and no later write changes
179
+ * one, so a kept fact is wrong only when other code read it: a file of another stamp is not read, and a file that
180
+ * does not parse neither. Each lane is then read from its own files, as with no file at all */
181
+ function readKept(session: string, disk: PartiesDisk): Set<string> {
182
+ const file = keptFile(session)
183
+ const held = kept.get(file)
184
+ if (held !== undefined) return held
185
+ const paths = new Set<string>()
186
+ try {
187
+ const v = JSON.parse(disk.text(file) ?? 'null') as Kept
188
+ if (v.stamp === factsStamp()) {
189
+ for (const [dir, lanes] of Object.entries(v.lanes)) {
190
+ for (const [agent, row] of Object.entries(lanes)) {
191
+ const [what, names, handsBack] = Array.isArray(row) ? row : []
192
+ if (typeof what !== 'string' || !Array.isArray(names) || !names.every((n) => typeof n === 'string') || typeof handsBack !== 'boolean') continue
193
+ const path = join(dir, `${agent}.jsonl`)
194
+ paths.add(path)
195
+ if (!laneFacts.has(path)) laneFacts.set(path, { facts: { what, names, handsBack }, mtime: 0, whole: true })
196
+ }
197
+ }
198
+ }
199
+ } catch {}
200
+ kept.set(file, paths)
201
+ return paths
202
+ }
203
+
204
+ /** a session's kept file follows what was read: written when a lane's head became whole or a kept lane's transcript
205
+ * is gone, so a prompt with no such change writes nothing. Two processes may write at once: each file is whole
206
+ * (atomicWrite), and a lane the last writer missed is read and kept at the next read. Never fails the read */
207
+ function keepFacts(session: string, lanes: readonly TranscriptFile[], disk: PartiesDisk): void {
208
+ const had = readKept(session, disk)
209
+ const whole = lanes.filter((f) => laneFacts.get(f.path)?.whole === true)
210
+ if (whole.length === had.size && whole.every((f) => had.has(f.path))) return
211
+ try {
212
+ const file = keptFile(session)
213
+ const out: Kept = { stamp: factsStamp(), lanes: {} }
214
+ for (const f of whole) {
215
+ const { what, names, handsBack } = laneFacts.get(f.path)!.facts
216
+ ;(out.lanes[dirname(f.path)] ??= {})[f.agent] = [what, names, handsBack]
217
+ }
218
+ disk.keep(file, whole.length === 0 ? null : out)
219
+ kept.set(file, new Set(whole.map((f) => f.path)))
220
+ } catch {}
221
+ }
222
+
223
+ let stamp: string | null = null
224
+ /** the code that reads a lane's facts, as one stamp: a change of any of it makes every kept file read again */
225
+ const factsStamp = (): string => (stamp ??= Bun.hash([laneFactsOf, headOf, laneNamesOf, laneNameOf].map(String).join('\n') + HAND_BACK + HEAD_BYTES).toString(36))
226
+
227
+ /** this process forgets every lane's facts, as a new process starts (a test) */
228
+ export function forgetLaneFacts(): void {
229
+ laneFacts.clear()
230
+ kept.clear()
231
+ }
232
+
233
+ function laneFactsOf(f: { path: string; mtime: number; size: number }, disk: Pick<PartiesDisk, 'text' | 'part'>): LaneFacts {
131
234
  const held = laneFacts.get(f.path)
132
235
  if (held != null && (held.whole || held.mtime === f.mtime)) return held.facts
133
236
  let what = ''
134
237
  try {
135
- const meta = JSON.parse(readFileSync(f.path.replace(/\.jsonl$/, '.meta.json'), 'utf8')) as { description?: unknown }
238
+ const meta = JSON.parse(disk.text(f.path.replace(/\.jsonl$/, '.meta.json')) ?? 'null') as { description?: unknown }
136
239
  what = typeof meta.description === 'string' ? meta.description : ''
137
240
  } catch {}
138
- const head = headOf(f.path)
241
+ const head = headOf(f.path, disk)
139
242
  const facts = { what, names: laneNamesOf(what, head.brief), handsBack: head.handsBack }
140
243
  laneFacts.set(f.path, { facts, mtime: f.mtime, whole: f.size >= HEAD_BYTES && what !== '' })
141
244
  return facts
@@ -143,34 +246,23 @@ function laneFactsOf(f: { path: string; mtime: number; size: number }): LaneFact
143
246
 
144
247
  /** a lane's head: its brief, the text of the first user message of its transcript, and whether a user message of the
145
248
  * head names the hand back tool: such a lane ends only at its hand back call, never at a turn that ended to wait */
146
- function headOf(path: string): { brief: string; handsBack: boolean } {
147
- try {
148
- const fd = openSync(path, 'r')
249
+ function headOf(path: string, disk: Pick<PartiesDisk, 'part'>): { brief: string; handsBack: boolean } {
250
+ let brief: string | null = null
251
+ let handsBack = false
252
+ for (const line of (disk.part(path, HEAD_BYTES)?.text ?? '').split('\n')) {
253
+ let e: { type?: string; message?: { content?: unknown } }
149
254
  try {
150
- const buf = Buffer.alloc(HEAD_BYTES)
151
- const n = readSync(fd, buf, 0, buf.length, 0)
152
- let brief: string | null = null
153
- let handsBack = false
154
- for (const line of buf.subarray(0, n).toString('utf8').split('\n')) {
155
- let e: { type?: string; message?: { content?: unknown } }
156
- try {
157
- e = JSON.parse(line) as typeof e
158
- } catch {
159
- continue
160
- }
161
- if (e.type !== 'user') continue
162
- const c = e.message?.content
163
- const text = typeof c === 'string' ? c : Array.isArray(c) ? c.map((p: { text?: unknown }) => (typeof p?.text === 'string' ? p.text : '')).join('\n') : ''
164
- brief ??= text
165
- handsBack ||= text.includes(HAND_BACK)
166
- }
167
- return { brief: brief ?? '', handsBack }
168
- } finally {
169
- closeSync(fd)
255
+ e = JSON.parse(line) as typeof e
256
+ } catch {
257
+ continue
170
258
  }
171
- } catch {
172
- return { brief: '', handsBack: false }
259
+ if (e.type !== 'user') continue
260
+ const c = e.message?.content
261
+ const text = typeof c === 'string' ? c : Array.isArray(c) ? c.map((p: { text?: unknown }) => (typeof p?.text === 'string' ? p.text : '')).join('\n') : ''
262
+ brief ??= text
263
+ handsBack ||= text.includes(HAND_BACK)
173
264
  }
265
+ return { brief: brief ?? '', handsBack }
174
266
  }
175
267
 
176
268
  /** the processes among `pids` that live and run Claude Code, in one `ps` */
@@ -196,45 +288,68 @@ export const LANE_IDLE_MS = 30 * 60 * 1000
196
288
  * watch from the live watchers given. `self`: the caller's session, live since it asks. `stopped`: the agent id a
197
289
  * SubagentStop names, ended now when it has no hand back tool (its tail may lag); a lane that hands back fires one at
198
290
  * every turn that waits, so its tail decides */
199
- export async function readParties(o: { sessions?: readonly string[]; watchers?: readonly Watcher[]; self?: string | null; now?: number; stopped?: string | null } = {}): Promise<Parties> {
291
+ export async function readParties(o: { sessions?: readonly string[]; watchers?: readonly Watcher[]; self?: string | null; now?: number; stopped?: string | null; /** in place of Claude Code's own session files and of `ps` (a test) */ claudes?: () => readonly Pick<ClaudeRecord, 'pid' | 'sessionId'>[]; alive?: (pids: readonly number[]) => Set<number>; /** in place of the transcripts and the kept facts on the real disk (a test) */ disk?: PartiesDisk; /** each project's orchestrator that hears, its holder's session: the caller hands orchestrator/role.ts hearingHolders (a store reads no feature), none without it */ roles?: () => readonly { repo: string; session: string; since?: string }[]; /** the parties the project's other places say live: the caller hands orchestrator/places.ts placeParties, none without it */ places?: () => Parties } = {}): Promise<Parties> {
292
+ const here = await partiesHere(o)
293
+ return o.places === undefined ? here : withOtherPlaces(here, o.places())
294
+ }
295
+
296
+ async function partiesHere(o: Parameters<typeof readParties>[0] & {}): Promise<Parties> {
200
297
  const now = o.now ?? Date.now()
201
298
  const records = readSessionRecords()
202
299
  const ids = new Set(o.sessions ?? records.map((r) => r.session))
203
300
  if (o.self) ids.add(o.self)
204
- // every live orchestrator of the machine is a party: it hears what no holder hears (parties.ts orchestratorFor)
205
- const { orchestratorLive, readKeepers } = await import('../orchestrator/state.ts')
206
- const keepers = readKeepers().filter((k) => orchestratorLive(k, now))
207
- for (const k of keepers) ids.add(k.session)
301
+ // each project's orchestrator is the holder of its role record while it hears (orchestrator/role.ts): it hears what
302
+ // no holder hears (parties.ts orchestratorFor). The shape of a watch makes nobody the orchestrator
303
+ const holders = new Map((o.roles?.() ?? []).map((h) => [h.session, h]))
304
+ for (const id of holders.keys()) ids.add(id)
208
305
  if (ids.size === 0) return NO_PARTIES
209
- const alive = claudeAlive(records.filter((r) => ids.has(r.session)).map((r) => r.pid))
210
- const { listTranscripts } = await import('./store.ts')
306
+ let disk = o.disk
307
+ if (disk === undefined) {
308
+ const { listTranscripts } = await import('./store.ts')
309
+ disk = { ...FILES, transcripts: (of) => listTranscripts(undefined, undefined, of) }
310
+ }
211
311
  // every lane a session ever started is listed (its name only), so a name none of them has is the session's own
212
312
  // newest first: of two transcripts that carry one lane name, the latest is the one a resume reaches
213
- const files = listTranscripts().filter((f) => ids.has(f.session)).sort((a, b) => b.mtime - a.mtime)
313
+ const files = disk.transcripts(ids).sort((a, b) => b.mtime - a.mtime)
314
+ // a session started again in a new process keeps its id, and its record keeps the old pid until its next act:
315
+ // Claude Code's own file of that process names the session, in the config folder its transcript is under
316
+ const claudes = (o.claudes?.() ?? [...new Set(files.filter((f) => f.agent === '').map((f) => dirname(dirname(dirname(f.path)))))].flatMap(sessionRecords)).filter((c) => ids.has(c.sessionId))
317
+ const alive = (o.alive ?? claudeAlive)([...records.filter((r) => ids.has(r.session)).map((r) => r.pid), ...claudes.map((c) => c.pid)])
214
318
  const ws = o.watchers ?? []
215
319
  const sessions: SessionParty[] = [...ids].map((id) => {
216
320
  const r = records.find((x) => x.session === id)
217
321
  // the session's own transcript first: a lane may start in a sub folder or another repo
218
322
  const own = files.filter((f) => f.session === id).sort((a, b) => Number(a.agent !== '') - Number(b.agent !== ''))
219
- const cwd = own.map((f) => cwdOf(f.path)).find((c) => c !== '')
323
+ let cwd: string | undefined
324
+ for (const f of own) if ((cwd = cwdOf(f.path, disk)) !== '') break
220
325
  const repo = cwd ? repoNameOf(cwd) : r?.stores[0] ? repoNameOf(dirname(dirname(r.stores[0]))) : 'a repo'
221
- const live = id === o.self || (r !== undefined && alive.has(r.pid))
326
+ const live = id === o.self || (r !== undefined && alive.has(r.pid)) || claudes.some((c) => c.sessionId === id && alive.has(c.pid))
222
327
  const active = own.find((f) => f.agent === '')?.mtime
223
- const k = keepers.find((x) => x.session === id)
224
- if (k !== undefined) return { id, repo: k.repo, live: true, watch: true, orchestrator: k.house ? ('house' as const) : ('own' as const), ...(active !== undefined ? { active } : {}) }
328
+ // the role says it hears: its process lives and an ear of it runs, its channel's or its watch
329
+ const holds = holders.get(id)
330
+ if (holds !== undefined) return { id, repo: holds.repo, live: true, watch: true, orchestrator: 'own' as const, ...(holds.since !== undefined ? { since: holds.since } : {}), ...(active !== undefined ? { active } : {}) }
225
331
  return { id, repo, live, watch: ws.some((w) => w.lane === null && (w.session === id || (w.session === null && w.by === id))), ...(!live && r !== undefined ? { gone: true as const } : {}), ...(active !== undefined ? { active } : {}) }
226
332
  })
333
+ const laneFiles = new Map<string, TranscriptFile[]>()
334
+ for (const f of files) {
335
+ if (f.agent === '') continue
336
+ const of = laneFiles.get(f.session)
337
+ if (of === undefined) laneFiles.set(f.session, [f])
338
+ else of.push(f)
339
+ }
340
+ for (const session of laneFiles.keys()) readKept(session, disk)
227
341
  const lanes: LaneParty[] = files.flatMap((f) => {
228
342
  if (f.agent === '') return []
229
- const { what, names, handsBack } = laneFactsOf(f)
343
+ const { what, names, handsBack } = laneFactsOf(f, disk)
230
344
  const head = { handsBack }
231
345
  if (names.length === 0) return []
232
346
  const sessionLive = sessions.find((s) => s.id === f.session)?.live ?? false
233
347
  const id = agentIdOf(f.agent)
234
348
  // a lane silent for its idle time has ended: its file is never read
235
- const live = sessionLive && now - f.mtime < LANE_IDLE_MS && !(id !== null && id === o.stopped && !head.handsBack) && laneRunning(f.path, head.handsBack)
349
+ const live = sessionLive && now - f.mtime < LANE_IDLE_MS && !(id !== null && id === o.stopped && !head.handsBack) && laneRunning(f.path, head.handsBack, disk)
236
350
  return names.map((name) => ({ name, session: f.session, live, watch: ws.some((w) => w.lane === name && (w.session === null || w.session === f.session) && (w.by === undefined || w.by === f.session)), what, ...(id ? { id } : {}) }))
237
351
  })
352
+ for (const [session, of] of laneFiles) keepFacts(session, of, disk)
238
353
  // a lane whose transcript names it no way the registry reads, while its watch lives: live, since a watch ends with its lane
239
354
  for (const w of ws) {
240
355
  const session = w.by ?? w.session
@@ -307,40 +422,22 @@ export function dropHanded(session: string, dir: string, head: string, keep: str
307
422
  export const clearHanded = (session: string, lane: string): void => rmSync(handedFile(session, lane), { force: true })
308
423
 
309
424
  /** the folder a transcript's agent works in, from its first lines */
310
- function cwdOf(path: string): string {
311
- try {
312
- const fd = openSync(path, 'r')
313
- try {
314
- const buf = Buffer.alloc(16 * 1024)
315
- const n = readSync(fd, buf, 0, buf.length, 0)
316
- return /"cwd":"([^"]+)"/.exec(buf.subarray(0, n).toString('utf8'))?.[1] ?? ''
317
- } finally {
318
- closeSync(fd)
319
- }
320
- } catch {
321
- return ''
322
- }
425
+ function cwdOf(path: string, disk: Pick<PartiesDisk, 'part'>): string {
426
+ return /"cwd":"([^"]+)"/.exec(disk.part(path, 16 * 1024)?.text ?? '')?.[1] ?? ''
323
427
  }
324
428
 
325
429
  /** a lane's last entries say it still works (live.ts stateOf over its tail): no hand back call; with `handsBack` false,
326
430
  * no ended turn either. A lane that hands back ends a turn to wait on its background work, and the harness wakes it */
327
- export function laneRunning(path: string, handsBack = headOf(path).handsBack): boolean {
431
+ export function laneRunning(path: string, handsBack?: boolean, disk: Pick<PartiesDisk, 'part'> = FILES): boolean {
328
432
  try {
329
- const size = statSync(path).size
330
- const fd = openSync(path, 'r')
331
- try {
332
- const len = Math.min(size, 32 * 1024)
333
- const buf = Buffer.alloc(len)
334
- readSync(fd, buf, 0, len, size - len)
335
- const lines = buf.toString('utf8').split('\n').filter((l) => l !== '')
336
- const tail = size > len ? lines.slice(1) : lines
337
- if (stateOf(tail).state.kind !== 'ended') return true
338
- // ended means its newest assistant entry is the hand back, or words with no call: only the first ends it
339
- const last = [...tail].reverse().find((l) => l.includes('"type":"assistant"'))
340
- return handsBack && last !== undefined && !last.includes(`"name":"${HAND_BACK}"`)
341
- } finally {
342
- closeSync(fd)
343
- }
433
+ const end = disk.part(path, 32 * 1024, true)
434
+ if (end === null) return false
435
+ const lines = end.text.split('\n').filter((l) => l !== '')
436
+ const tail = end.more ? lines.slice(1) : lines
437
+ if (stateOf(tail).state.kind !== 'ended') return true
438
+ // ended means its newest assistant entry is the hand back, or words with no call: only the first ends it
439
+ const last = [...tail].reverse().find((l) => l.includes('"type":"assistant"'))
440
+ return (handsBack ?? headOf(path, disk).handsBack) && last !== undefined && !last.includes(`"name":"${HAND_BACK}"`)
344
441
  } catch {
345
442
  return false
346
443
  }
@@ -292,8 +292,10 @@ export type ProjectFilter = (project: string) => boolean
292
292
  /** every transcript file under every config root: sessions, and the sub-agent
293
293
  * runs under `<session>/subagents/`. A real folder is listed once: a project
294
294
  * folder that is a link to its neighbour is a second name for the same
295
- * files, never a second repo */
296
- export function listTranscripts(roots: ConfigRoot[] = discoverConfigRoots(), keep: ProjectFilter = () => true): TranscriptFile[] {
295
+ * files, never a second repo. `only`: the files of these sessions alone, no
296
+ * other file read from the disk (the registry of parties asks for a few
297
+ * sessions at each prompt) */
298
+ export function listTranscripts(roots: ConfigRoot[] = discoverConfigRoots(), keep: ProjectFilter = () => true, only?: ReadonlySet<string>): TranscriptFile[] {
297
299
  const out: TranscriptFile[] = []
298
300
  const add = (path: string, account: string, project: string, session: string, agent: string): void => {
299
301
  try {
@@ -319,9 +321,9 @@ export function listTranscripts(roots: ConfigRoot[] = discoverConfigRoots(), kee
319
321
  let entries: string[]
320
322
  try { entries = readdirSync(dir) } catch { continue }
321
323
  const sessions = new Set(entries.filter((e) => e.endsWith('.jsonl')).map((e) => e.slice(0, -6)))
322
- for (const s of sessions) add(join(dir, `${s}.jsonl`), root.account, project, s, '')
324
+ for (const s of sessions) if (only === undefined || only.has(s)) add(join(dir, `${s}.jsonl`), root.account, project, s, '')
323
325
  for (const e of entries) {
324
- if (e.endsWith('.jsonl') || e.includes('.')) continue
326
+ if (e.endsWith('.jsonl') || e.includes('.') || (only !== undefined && !only.has(e))) continue
325
327
  const sub = join(dir, e, 'subagents')
326
328
  let agents: string[]
327
329
  try { agents = readdirSync(sub) } catch { continue }
@@ -20,10 +20,10 @@ export function askDoc(root: string): DocHome<{ text: string; steps: string[] }>
20
20
  blank: () => '## <the act, a verb first>\n',
21
21
  parse: (text) => ({ text, steps: parseInstructions(text).steps.map((s) => s.title) }),
22
22
  print: (o) => o.text,
23
- check: (key, text) => {
23
+ check: (key, text, by) => {
24
24
  const a = findAsk(root, key)
25
25
  if (isClosed(a.status)) throw new Error(`ask:${a.id} is ${a.status}: sk asks reopen ${a.id} first, then edit its instructions`)
26
- const why = text.trim() === '' ? 'an ask says the act in words: its steps, each a `## <verb> <thing>` heading' : instructionsRefusal(text)
26
+ const why = text.trim() === '' ? 'an ask says the act in words: its steps, each a `## <verb> <thing>` heading' : instructionsRefusal(text, { own: by === 'owner' })
27
27
  return why === null ? [] : [{ kind: 'fail', text: `ask:${a.id}: ${why}`, repaired: false }]
28
28
  },
29
29
  repair: async (_key, text) => ({ text, failed: [] }),
@@ -55,6 +55,9 @@ export type Ask = {
55
55
  into: string | null
56
56
  /** the secret it refreshes, a token that lapses by design; null for any other ask */
57
57
  lapses: string | null
58
+ /** its standing words are his own edit in the hub: how he writes a step is his, so no rule of the instructions
59
+ * is said against them */
60
+ ownWords: boolean
58
61
  }
59
62
 
60
63
  export type AskStep = { title: string; done: boolean }
@@ -135,6 +138,7 @@ export function askOfThread(t: Thread, now = new Date()): Ask | null {
135
138
  steps: stepsNowOf(membersOf(t))?.steps ?? null,
136
139
  into: s.status === 'merged' ? s.into : null,
137
140
  lapses: f.lapses ?? null,
141
+ ownWords: newer !== null && membersOf(t).some((x) => x.thread.some((m) => m.edit?.of === newer.id && partyOf(m.who) === 'owner')),
138
142
  }
139
143
  }
140
144
 
@@ -191,7 +195,9 @@ export function optionsOf(body: string): string[] {
191
195
  // the agent fills every {{placeholder}} in a file and gives it with --body
192
196
  const STEPS_BODY = `## {{verb}} {{thing}}
193
197
 
194
- Open **[{{page name}}]({{url, ids filled in}})**, then click **{{button}}**.
198
+ - Open **[{{page name}}]({{url, ids filled in}})**.
199
+ - Click **{{button}}**.
200
+ - Fill in:
195
201
 
196
202
  | field | value |
197
203
  |---|---|
@@ -199,7 +205,8 @@ Open **[{{page name}}]({{url, ids filled in}})**, then click **{{button}}**.
199
205
 
200
206
  ## {{the next act he does}}
201
207
 
202
- Open **[{{page name}}]({{url}})**, then paste:
208
+ - Open **[{{page name}}]({{url}})**.
209
+ - Paste:
203
210
 
204
211
  \`\`\`
205
212
  {{the exact text he pastes}}
@@ -231,6 +238,9 @@ export type CreateOpts = {
231
238
  /** the secret it refreshes, a token that lapses by design (secrets/lapse.ts) */
232
239
  lapses?: string
233
240
  lane?: string
241
+ /** the owner's own words (his save in the hub): how he writes a step is his, the rules of review/instruction-guards.ts
242
+ * never refuse them */
243
+ own?: boolean
234
244
  now?: Date
235
245
  }
236
246
 
@@ -365,7 +375,7 @@ function factsOf(title: string, opts: CreateOpts) {
365
375
  const check = opts.check ?? (secrets.length > 0 ? secrets.map((s) => `sk secret get ${s} >/dev/null`).join(' && ') : null)
366
376
  const why = opts.why?.replace(/\s+/g, ' ').trim() ?? ''
367
377
  const waits = opts.waits != null ? parseWaits(opts.waits, '--waits') : []
368
- const refused = opts.body != null ? instructionsRefusal(opts.body) : null
378
+ const refused = opts.body != null ? instructionsRefusal(opts.body, { own: opts.own === true }) : null
369
379
  if (refused !== null) throw new Error(`--body: ${refused}`)
370
380
  if (askSlug(title) === '') throw new Error('a title with no letter or digit names no ask')
371
381
  const head = (created: string): AskHead => ({
@@ -431,8 +441,8 @@ export async function reinstructAsk(root: string, ref: string, title: string, op
431
441
  const leased = await withMutateLease(mutateLease(root, 'asks'), { label: 'asks', print: () => {}, maxWaitMs: 45_000 }, async () => {
432
442
  const a = findAsk(root, ref)
433
443
  if (isClosed(a.status)) throw new Error(`${a.id} is ${a.status}: sk asks reopen ${a.id} first, then give it new instructions`)
434
- const secrets = [...(opts.secrets ?? []), ...stepSecrets(opts.body ?? '').map((f) => f.name)]
435
- const { kind, logins, why, head } = factsOf(title, { ...opts, kind: opts.kind ?? (secrets.length > 0 ? undefined : a.kind), blocks: opts.blocks ?? a.blocks, ...(a.lapses != null && opts.lapses == null ? { lapses: a.lapses } : {}) })
444
+ const asked = (opts.secrets?.length ?? 0) > 0 || stepSecrets(opts.body ?? '').length > 0
445
+ const { kind, secrets, logins, why, head } = factsOf(title, { ...opts, kind: opts.kind ?? (asked ? undefined : a.kind), blocks: opts.blocks ?? a.blocks, ...(a.lapses != null && opts.lapses == null ? { lapses: a.lapses } : {}) })
436
446
  const { created: _day, ...facts } = { ...head(a.created), ...(opts.waits == null && a.waits.length > 0 ? { waits: a.waits } : {}) }
437
447
  const threadNow = (): Thread => {
438
448
  const t = orderedThreads(readAll(store).items).find((x) => x.head.item.id === a.head)
@@ -484,7 +494,7 @@ export async function saveAskText(root: string, ref: string, text: string, by: s
484
494
  secrets: loose,
485
495
  logins: a.logins.filter((l) => loose.includes(l)),
486
496
  ...(a.check !== null && a.check !== auto ? { check: a.check } : {}),
487
- ...(by !== 'owner' ? { lane: by } : {}),
497
+ ...(by !== 'owner' ? { lane: by } : { own: true }),
488
498
  })
489
499
  }
490
500
 
@@ -662,7 +672,12 @@ export async function checkAsks(root: string, print: (line: string) => void = co
662
672
  if (r.check === 'in' || r.check === 'passed') {
663
673
  print(`closed ${a.id} (${r.check === 'in' ? 'every value is in' : 'its check passes'})`)
664
674
  closed++
665
- } else print(`still open ${a.id}${r.check === 'none' ? ' (no probe)' : ''}`)
675
+ } else {
676
+ print(`still open ${a.id}${r.check === 'none' ? ' (no probe)' : ''}`)
677
+ // words written before a rule of the instructions: said at each check until an agent writes them again
678
+ const words = a.ownWords ? null : instructionsRefusal(a.body)
679
+ if (words !== null) print(`WARN ${a.id}: ${words}; write them again: sk ask "<title>" --replaces ask:${a.id} --body <file>`)
680
+ }
666
681
  }
667
682
  print(`${closed} closed`)
668
683
  return { closed }
package/src/check.ts CHANGED
@@ -47,7 +47,7 @@ export type CheckDef = {
47
47
  /** what MUST BE TRUE, in the present tense: ONE line, at most 90
48
48
  * characters, as in `package.json routes typecheck and test
49
49
  * through the gate`. Never what red means, red is its negation. It
50
- * renders at the top of the check page and as the tree row's tooltip.
50
+ * renders at the top of the check page and as the tooltip of its row in the checks list.
51
51
  * A title names the check, this states the invariant it holds. */
52
52
  description: string
53
53
  /** where the answer is OWNED: a wiki page for a built-in, the file itself
@@ -105,6 +105,10 @@ export type CheckDef = {
105
105
  * pure function of { root, config } returning the reason it does not
106
106
  * (the row is then n/a in every context), or null */
107
107
  applies: Applies
108
+ /** what the check shapes that a foreign repo's team owns (`package.json`, `.claude/settings.json`, `agent/`):
109
+ * there the check is n/a, since the owner never reshapes the team's files (core/foreign.ts). A check whose
110
+ * subject is the owner's own, even in a foreign repo, leaves it out */
111
+ teamOwned?: string
108
112
  /** it REWRITES the repo while it runs (updates a dependency, untracks a
109
113
  * file) unless the run is frozen, so a frozen run asks it a different
110
114
  * question: only a check declaring this carries `frozen` in its cache
@@ -198,6 +202,8 @@ export function check(d: CheckDef): CheckDef {
198
202
  if (cache != null) throw new Error(`check${name}: ${cache}`)
199
203
  if (d.applies !== 'always' && typeof d.applies !== 'function')
200
204
  throw new Error(`check${name}: applies is required: 'always', or a function of { root, config } returning why this repo gives it nothing to do, or null`)
205
+ if (d.teamOwned !== undefined && (typeof d.teamOwned !== 'string' || d.teamOwned.trim() === ''))
206
+ throw new Error(`check${name}: teamOwned names the team's file or folder the check shapes, as \`package.json\``)
201
207
  const whole = combinationProblem({ runs: d.runs, cache: d.cache, fix: d.fix, repair: d.repair, build: d.build === true, body: has('run') ? 'run' : 'cmd', blocking: d.blocking })
202
208
  if (whole != null) throw new Error(`check${name}: ${whole}`)
203
209
  return d
@@ -339,6 +345,8 @@ export async function runCheckBody(
339
345
  } catch (e) {
340
346
  // a 429 is no answer at all, so it warns and nothing remembers it
341
347
  if (e instanceof Error && e.name === 'RateLimited') c.unreachable(`${u.title} not checked this run (${e.message}), retry later`)
348
+ // a foreign repo refused a write the body tried (core/foreign.ts): its tree is the team's, so nothing is broken
349
+ else if (e instanceof Error && e.name === 'ForeignRefused') c.warn(`${u.title} left the team's tree as it is: ${e.message}`, 'turn the check off in repo.config.ts (off:) when its subject is the team\'s')
342
350
  else c.fail(`${u.title} body errored (${String(e).slice(0, 200)}) — network down, or a bug in this check`)
343
351
  }
344
352
  // the pass's config, never `c.config`: the pointer is the runner's line,
@@ -239,6 +239,7 @@ export const packageJsonShape = check({
239
239
  cache: { by: 'reads' },
240
240
  fix: 'ci',
241
241
  applies: 'always',
242
+ teamOwned: 'package.json',
242
243
  run: (c) => evaluatePackageJson(c),
243
244
  // mechanical repairs only: field flips + scripts whose canonical body the
244
245
  // vocabulary page states. A body it does NOT state is named in the
@@ -47,6 +47,7 @@ export const claudeMdShape = check({
47
47
  cache: { by: 'reads' },
48
48
  fix: 'ci',
49
49
  applies: 'always',
50
+ teamOwned: 'CLAUDE.md',
50
51
  run: async (c) => {
51
52
  const claude = c.read('CLAUDE.md')
52
53
  // the folder the last include names (a base wiki host names a folder of its wiki), agent/ otherwise
@@ -31,11 +31,12 @@ const CONTRIB = '# repo-contributed lines (repo.config.ts gitignore:)'
31
31
 
32
32
  const DRAFTS_BACK = '!.comfy-ts/drafts/'
33
33
  const SOCIAL_BACK = `!${LAYOUT.social}/`
34
+ const URLS_BACK = `!${LAYOUT.urls}`
34
35
 
35
36
  /** re-includes a private repo carries and a declared public one drops: a
36
37
  * draft names private loras, a plan or a board quotes the owner, a social
37
- * draft carries his angles and notes */
38
- const PRIVATE_ONLY: ReadonlySet<string> = new Set([DRAFTS_BACK, `!${LAYOUT.plans}/`, SOCIAL_BACK])
38
+ * draft carries his angles and notes, an added url names a machine of his */
39
+ const PRIVATE_ONLY: ReadonlySet<string> = new Set([DRAFTS_BACK, `!${LAYOUT.plans}/`, SOCIAL_BACK, URLS_BACK])
39
40
 
40
41
  export const POLICY_LINES = [
41
42
  // everything shipkit keeps lives under .shipkit/ (core/layout.ts). Local
@@ -49,6 +50,9 @@ export const POLICY_LINES = [
49
50
  // desks date posts from. A rendered trailer is made again by its command
50
51
  SOCIAL_BACK,
51
52
  `${LAYOUT.social}/drafts/**/*-trailer.mp4`,
53
+ // the urls added from the hub: data a form writes, its logins vault names
54
+ // only. A LAN address or a console's url names a machine, so private only
55
+ URLS_BACK,
52
56
  `${LAYOUT.assets}/out/`,
53
57
  // recordings of a person's own voice never go to git, in any repo: covered
54
58
  // by `.shipkit/*` and spelled out so this check asks git about it (the
@@ -175,11 +179,11 @@ async function trackedGenerated(d: Disk): Promise<string[]> {
175
179
  async function trackedPrivate(d: Disk, config: RepoConfig): Promise<Map<string, number>> {
176
180
  const out = new Map<string, number>()
177
181
  if (!d.exists('.git')) return out
178
- const dirs = [...(declaredPublic(config) ? [LAYOUT.plans, LAYOUT.social] : []), LAYOUT.voice]
182
+ const dirs = [...(declaredPublic(config) ? [LAYOUT.plans, LAYOUT.social, LAYOUT.urls] : []), LAYOUT.voice]
179
183
  const r = await d.git.run(d.root, ['ls-files', '-z', '--', ...dirs])
180
184
  if (r.code !== 0) return out
181
185
  for (const f of r.out.split('\0')) {
182
- const dir = dirs.find((x) => f.startsWith(`${x}/`))
186
+ const dir = dirs.find((x) => f === x || f.startsWith(`${x}/`))
183
187
  if (dir) out.set(dir, (out.get(dir) ?? 0) + 1)
184
188
  }
185
189
  return out
@@ -263,6 +267,7 @@ export const gitignorePolicy = check({
263
267
  cache: { by: 'files', inputs: ['.'], key: null },
264
268
  fix: 'ci',
265
269
  applies: 'always',
270
+ teamOwned: '.gitignore',
266
271
  run: async (c) => {
267
272
  // a generated path still in the index is the half-applied state the
268
273
  // managed block cannot fix on its own
@@ -351,8 +356,9 @@ export const gitignorePolicy = check({
351
356
  }
352
357
  c.ok(`.gitignore policy block current, ${claimed.length + backProbes.size} patterns verified against git`)
353
358
  for (const [dir, n] of await trackedPrivate(c, c.config)) {
354
- const files = `${n} file${n === 1 ? '' : 's'} under ${dir}/`
355
- c.warn(dir === LAYOUT.voice ? `this repo still tracks ${files}: recorded voice, and the block keeps only new ones local` : `a public repo still tracks ${files}: strangers read them, and the block keeps only new ones local`)
359
+ const file = dir === LAYOUT.urls
360
+ const files = file ? dir : `${n} file${n === 1 ? '' : 's'} under ${dir}/`
361
+ c.warn(dir === LAYOUT.voice ? `this repo still tracks ${files}: recorded voice, and the block keeps only new ones local` : `a public repo still tracks ${files}: strangers read ${file ? 'it' : 'them'}, and the block keeps only new ones local`)
356
362
  c.lines.push({ kind: 'fix-warn', text: `git rm -r --cached -q ${dir} && git commit -m "untrack ${dir}" -- ${dir} (the files stay on the disk)` })
357
363
  }
358
364
  },