rvlib-shipkit 2.26.0 → 2.27.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 (442) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/package.json +1 -1
  3. package/src/agent-time/diet.ts +77 -0
  4. package/src/agent-time/family.ts +72 -0
  5. package/src/agent-time/hooks.ts +6 -4
  6. package/src/agent-time/limits.ts +44 -0
  7. package/src/agent-time/live.ts +1 -3
  8. package/src/agent-time/mask.ts +96 -18
  9. package/src/agent-time/refused.ts +45 -0
  10. package/src/agent-time/render.ts +122 -21
  11. package/src/agent-time/report-cache.ts +57 -0
  12. package/src/agent-time/report.ts +314 -40
  13. package/src/agent-time/shape.ts +50 -3
  14. package/src/agent-time/store.ts +320 -99
  15. package/src/agent-time/timeline.ts +140 -21
  16. package/src/agent-time/turns.ts +18 -8
  17. package/src/annex/offload.ts +17 -6
  18. package/src/annex/tidy.ts +70 -10
  19. package/src/asks/ask-after.ts +40 -0
  20. package/src/asks/asks-queue.ts +205 -47
  21. package/src/assets/kit-config.ts +7 -3
  22. package/src/assets/kits/identity-kit.ts +289 -10
  23. package/src/check.ts +3 -1
  24. package/src/checks/SK004-gitignore-policy.check.ts +12 -5
  25. package/src/checks/SK013-one-way-in-policy.check.ts +8 -3
  26. package/src/checks/SK026-asks-autoclose.check.ts +5 -5
  27. package/src/checks/SK028-readme.check.ts +7 -66
  28. package/src/checks/SK030-cache-audit.check.ts +6 -1
  29. package/src/checks/SK031-trace-audit.check.ts +2 -0
  30. package/src/checks/SK033-global-contribution.check.ts +3 -1
  31. package/src/checks/SK035-public-clean.check.ts +2 -2
  32. package/src/checks/SK043-scratch-on-the-mac.check.ts +59 -4
  33. package/src/checks/SK047-login-in-description.check.ts +36 -0
  34. package/src/checks/SK048-one-local-file.check.ts +36 -0
  35. package/src/cli/cmd_Asks.ts +71 -5
  36. package/src/cli/cmd_Backup.ts +2 -2
  37. package/src/cli/cmd_Capacity.ts +2 -2
  38. package/src/cli/cmd_CrossRepoActivity.ts +5 -4
  39. package/src/cli/cmd_Db.ts +253 -0
  40. package/src/cli/cmd_History.ts +212 -0
  41. package/src/cli/cmd_Home.ts +31 -3
  42. package/src/cli/cmd_Hq.ts +516 -0
  43. package/src/cli/cmd_Machines.ts +36 -0
  44. package/src/cli/cmd_Media.ts +38 -6
  45. package/src/cli/cmd_Reflect.ts +23 -2
  46. package/src/cli/cmd_Review.ts +548 -116
  47. package/src/cli/cmd_Secret.ts +62 -12
  48. package/src/cli/cmd_Social.ts +83 -1
  49. package/src/cli/cmd_Space.ts +324 -0
  50. package/src/cli/cmd_Time.ts +76 -5
  51. package/src/cli/cmd_Tmp.ts +28 -4
  52. package/src/cli/cmd_Trailer.ts +14 -10
  53. package/src/cli/cmd_Urls.ts +56 -0
  54. package/src/cli/cmd_Vault.ts +583 -0
  55. package/src/cli/family-help.ts +4 -2
  56. package/src/cli/family-pages.ts +1 -1
  57. package/src/cli/registry.ts +24 -3
  58. package/src/collections/actions.ts +63 -13
  59. package/src/collections/collection-types.ts +23 -1
  60. package/src/collections/providers.ts +117 -23
  61. package/src/collections/review.ts +4 -4
  62. package/src/contracts/contract-manifests.ts +6 -5
  63. package/src/contracts/contract-types.ts +6 -4
  64. package/src/contracts/contracts-engine.ts +11 -0
  65. package/src/contracts/manifests/chrome-web-store.contract.ts +31 -0
  66. package/src/core/budget.ts +12 -17
  67. package/src/core/capacity.ts +27 -18
  68. package/src/core/check-runner.ts +7 -4
  69. package/src/core/layout.ts +3 -0
  70. package/src/core/machine-busy.ts +127 -0
  71. package/src/core/machine-commit.ts +6 -1
  72. package/src/core/machine-db.ts +368 -20
  73. package/src/core/machine-layout.ts +137 -0
  74. package/src/core/machine-read.ts +81 -0
  75. package/src/core/migrate-layout.ts +1 -1
  76. package/src/core/one-way-in-policy.ts +64 -7
  77. package/src/core/polling-policy.ts +27 -0
  78. package/src/core/retention.ts +16 -2
  79. package/src/core/scope.ts +107 -14
  80. package/src/core/slots.ts +5 -4
  81. package/src/drill/clean.ts +25 -1
  82. package/src/drill/run.ts +1 -1
  83. package/src/drill/seal.ts +27 -4
  84. package/src/home/activity-shape.ts +2 -0
  85. package/src/home/activity.ts +66 -3
  86. package/src/home/app-sign.ts +15 -4
  87. package/src/home/daemon-jobs.ts +149 -7
  88. package/src/home/database-projects.ts +111 -0
  89. package/src/home/database-words.ts +203 -0
  90. package/src/home/databases.ts +460 -0
  91. package/src/home/global-units.ts +6 -0
  92. package/src/home/gui-app/ShipkitGui.swift +122 -1
  93. package/src/home/gui-app.ts +6 -3
  94. package/src/home/home-move.ts +514 -0
  95. package/src/home/home-paths.ts +12 -3
  96. package/src/home/home-routes.ts +68 -0
  97. package/src/home/inbox-shape.ts +24 -14
  98. package/src/home/machine-fold.ts +820 -0
  99. package/src/home/machine-host.ts +20 -5
  100. package/src/home/machine-repair.ts +503 -0
  101. package/src/home/machine-stores.ts +66 -15
  102. package/src/home/machine-temp.ts +547 -86
  103. package/src/home/resume.ts +79 -0
  104. package/src/home/run-daemon.ts +25 -4
  105. package/src/home/run-pm.ts +18 -5
  106. package/src/home/serve-daemon.ts +18 -3
  107. package/src/home/serve-web.ts +175 -7
  108. package/src/home/space-job.ts +115 -0
  109. package/src/home/space-page.ts +257 -0
  110. package/src/home/space-route.ts +167 -0
  111. package/src/home/space-words.ts +103 -0
  112. package/src/home/time-page-shape.ts +202 -0
  113. package/src/home/time-page.ts +64 -0
  114. package/src/home/vault-page.ts +482 -0
  115. package/src/home/vault-words.ts +132 -0
  116. package/src/hooks/leak-guard.ts +40 -13
  117. package/src/hooks/one-way-in-guard.ts +17 -4
  118. package/src/hq/cards.ts +581 -0
  119. package/src/hq/door-route.ts +43 -0
  120. package/src/hq/door.ts +163 -0
  121. package/src/hq/files-send.ts +348 -0
  122. package/src/hq/forgotten-log.ts +35 -0
  123. package/src/hq/history-check.ts +255 -0
  124. package/src/hq/history-place.ts +146 -0
  125. package/src/hq/history-send.ts +487 -0
  126. package/src/hq/hq-db.ts +99 -0
  127. package/src/hq/hq-local.ts +469 -0
  128. package/src/hq/hq-routes.ts +196 -0
  129. package/src/hq/hq-store.ts +599 -0
  130. package/src/hq/kinds/ask.ts +147 -0
  131. package/src/hq/kinds/card-gone.ts +83 -0
  132. package/src/hq/kinds/card-msg.ts +66 -0
  133. package/src/hq/kinds/card.ts +99 -0
  134. package/src/hq/kinds/index.ts +21 -0
  135. package/src/hq/kinds/kind.ts +126 -0
  136. package/src/hq/kinds/media.ts +125 -0
  137. package/src/hq/kinds/prompt.ts +219 -0
  138. package/src/hq/kinds/reflection.ts +128 -0
  139. package/src/hq/kinds/report.ts +55 -0
  140. package/src/hq/kinds/time-day.ts +236 -0
  141. package/src/hq/ledger.ts +473 -0
  142. package/src/hq/machine-key.ts +44 -0
  143. package/src/hq/machine-notes.ts +131 -0
  144. package/src/hq/outbox.ts +372 -0
  145. package/src/hq/replica.ts +168 -0
  146. package/src/hq/repo-id.ts +4 -0
  147. package/src/hq/report-facts.ts +117 -0
  148. package/src/hq/report.ts +274 -0
  149. package/src/hq/switch.ts +151 -0
  150. package/src/hq/vault-grant.ts +92 -0
  151. package/src/identities/identities.ts +15 -3
  152. package/src/identities/steps.ts +31 -0
  153. package/src/ledger/db.ts +73 -26
  154. package/src/ledger/gate-checks.ts +6 -2
  155. package/src/ledger/run-log.ts +11 -3
  156. package/src/ledger/store.ts +26 -4
  157. package/src/media-store/backup/daemon.ts +25 -17
  158. package/src/media-store/backup/kept.ts +241 -0
  159. package/src/media-store/backup/restore.ts +14 -4
  160. package/src/media-store/backup/run.ts +11 -11
  161. package/src/media-store/backup/secret.ts +6 -4
  162. package/src/media-store/backup/snapshot.ts +4 -2
  163. package/src/media-store/backup/sources.ts +67 -16
  164. package/src/media-store/copy/config.ts +77 -0
  165. package/src/media-store/copy/copy.ts +194 -0
  166. package/src/media-store/copy/lifecycle.ts +43 -0
  167. package/src/media-store/copy/night.ts +90 -0
  168. package/src/media-store/copy/proof.ts +151 -0
  169. package/src/media-store/copy/snapshot.ts +152 -0
  170. package/src/media-store/copy/store.ts +62 -0
  171. package/src/media-store/copy/stream.ts +176 -0
  172. package/src/media-store/daemon.ts +66 -16
  173. package/src/media-store/db.ts +22 -11
  174. package/src/media-store/forget.ts +23 -3
  175. package/src/media-store/hand.ts +4 -3
  176. package/src/media-store/hq-find.ts +75 -0
  177. package/src/media-store/hq-send.ts +277 -0
  178. package/src/media-store/kind.ts +2 -0
  179. package/src/media-store/purge.ts +18 -15
  180. package/src/media-store/put.ts +24 -8
  181. package/src/media-store/remote.ts +16 -7
  182. package/src/media-store/space-listing.ts +240 -0
  183. package/src/media-store/space.ts +40 -21
  184. package/src/media-store/sync.ts +5 -5
  185. package/src/media-store/tidy.ts +98 -0
  186. package/src/media-store/upload.ts +3 -3
  187. package/src/media-store/webp.ts +66 -0
  188. package/src/messages/model.ts +16 -7
  189. package/src/messages/routes.ts +14 -4
  190. package/src/messages/score.ts +2 -2
  191. package/src/messages/suggest.ts +96 -0
  192. package/src/pages/frame-client.ts +10 -0
  193. package/src/plan/planner.ts +28 -17
  194. package/src/recordings/media-kind.ts +1 -0
  195. package/src/recordings/model.ts +1 -1
  196. package/src/recordings/recorder-app/Capture.swift +9 -7
  197. package/src/reflect/hq-corpus.ts +56 -0
  198. package/src/reflect/prompt-corpus.ts +3 -1
  199. package/src/reflect/transcript.ts +129 -37
  200. package/src/release/machine-words.ts +67 -0
  201. package/src/release/public-clean.ts +8 -3
  202. package/src/releases/from-card.ts +1 -1
  203. package/src/releases/routes.ts +10 -5
  204. package/src/releases/store.ts +10 -1
  205. package/src/repo-config.ts +32 -2
  206. package/src/review/anim.ts +2 -2
  207. package/src/review/auto.ts +2 -2
  208. package/src/review/card-db.ts +244 -0
  209. package/src/review/card-rows.ts +266 -0
  210. package/src/review/cells.ts +76 -5
  211. package/src/review/draft-card.ts +41 -0
  212. package/src/review/draft-model.ts +78 -0
  213. package/src/review/format.ts +29 -10
  214. package/src/review/gone.ts +98 -0
  215. package/src/review/inbox-hook.ts +4 -4
  216. package/src/review/marks.ts +1 -1
  217. package/src/review/media-kind.ts +7 -5
  218. package/src/review/media-read.ts +9 -7
  219. package/src/review/media.ts +32 -5
  220. package/src/review/model.ts +202 -39
  221. package/src/review/move.ts +491 -0
  222. package/src/review/notes.ts +12 -20
  223. package/src/review/previews.ts +15 -19
  224. package/src/review/project.ts +1 -1
  225. package/src/review/rev.ts +8 -0
  226. package/src/review/role.ts +1 -1
  227. package/src/review/routes.ts +64 -13
  228. package/src/review/stage-card.ts +8 -4
  229. package/src/review/stage-routes.ts +1 -1
  230. package/src/review/store.ts +529 -83
  231. package/src/review/thread-fold.ts +51 -0
  232. package/src/review/threads.ts +147 -9
  233. package/src/review/trailer-auto-mock.ts +63 -0
  234. package/src/review/trailer-card.ts +4 -4
  235. package/src/review/trailer-desk.ts +41 -7
  236. package/src/review/trailer-media.ts +1 -0
  237. package/src/review/trailer-model.ts +8 -0
  238. package/src/review/trailer-notes.ts +1 -1
  239. package/src/review/trailer-routes.ts +9 -1
  240. package/src/review/unit.ts +6 -6
  241. package/src/review/watchers.ts +1 -1
  242. package/src/rules/untrack-generated.ts +92 -8
  243. package/src/secrets/held.ts +16 -0
  244. package/src/secrets/keychain.ts +113 -0
  245. package/src/secrets/list.ts +16 -6
  246. package/src/secrets/manager.ts +24 -10
  247. package/src/secrets/read.ts +257 -0
  248. package/src/secrets/who-reads.ts +49 -0
  249. package/src/serve/door-forward.ts +268 -0
  250. package/src/serve/door-names.ts +47 -0
  251. package/src/serve/embed.ts +1 -1
  252. package/src/serve/hub-app/activity-view.tsx +56 -32
  253. package/src/serve/hub-app/activity.css +7 -1
  254. package/src/serve/hub-app/asks-page.tsx +48 -0
  255. package/src/serve/hub-app/asks-st.ts +25 -0
  256. package/src/serve/hub-app/clock-svc.ts +1 -2
  257. package/src/serve/hub-app/col-card.tsx +64 -13
  258. package/src/serve/hub-app/col-list-page.tsx +122 -0
  259. package/src/serve/hub-app/col-list-st.ts +103 -0
  260. package/src/serve/hub-app/col-tables-view.tsx +10 -41
  261. package/src/serve/hub-app/col-tables.ts +76 -8
  262. package/src/serve/hub-app/cols-svc.ts +70 -16
  263. package/src/serve/hub-app/database-st.ts +260 -0
  264. package/src/serve/hub-app/database-view.tsx +289 -0
  265. package/src/serve/hub-app/database.css +32 -0
  266. package/src/serve/hub-app/entry-bar.css +14 -0
  267. package/src/serve/hub-app/entry-bar.tsx +33 -0
  268. package/src/serve/hub-app/entry-pick.ts +31 -0
  269. package/src/serve/hub-app/floating.tsx +1 -0
  270. package/src/serve/hub-app/hash-route.ts +11 -1
  271. package/src/serve/hub-app/header-bar.tsx +14 -18
  272. package/src/serve/hub-app/home-st.ts +89 -9
  273. package/src/serve/hub-app/home-strip.css +5 -19
  274. package/src/serve/hub-app/home-strip.tsx +58 -92
  275. package/src/serve/hub-app/home.html +7 -0
  276. package/src/serve/hub-app/hub-app.tsx +31 -142
  277. package/src/serve/hub-app/hub-types.ts +3 -1
  278. package/src/serve/hub-app/hub.css +109 -23
  279. package/src/serve/hub-app/icons.tsx +18 -1
  280. package/src/serve/hub-app/identities-st.ts +56 -6
  281. package/src/serve/hub-app/identities-view.tsx +100 -58
  282. package/src/serve/hub-app/identities.css +17 -15
  283. package/src/serve/hub-app/identity-address.ts +5 -0
  284. package/src/serve/hub-app/inbox-st.ts +41 -24
  285. package/src/serve/hub-app/inbox-view.tsx +37 -41
  286. package/src/serve/hub-app/inbox.css +2 -5
  287. package/src/serve/hub-app/index.html +7 -0
  288. package/src/serve/hub-app/kept-cols.tsx +7 -0
  289. package/src/serve/hub-app/keys.ts +28 -15
  290. package/src/serve/hub-app/later.tsx +26 -0
  291. package/src/serve/hub-app/list-filter.tsx +14 -0
  292. package/src/serve/hub-app/list-walk.ts +72 -3
  293. package/src/serve/hub-app/machines-st.ts +251 -0
  294. package/src/serve/hub-app/machines-view.tsx +224 -0
  295. package/src/serve/hub-app/machines.css +76 -0
  296. package/src/serve/hub-app/md-copy.tsx +79 -0
  297. package/src/serve/hub-app/media-view.tsx +2 -0
  298. package/src/serve/hub-app/messages/messages-page.tsx +79 -7
  299. package/src/serve/hub-app/messages/messages-st.ts +99 -3
  300. package/src/serve/hub-app/messages.css +14 -0
  301. package/src/serve/hub-app/page-keys.ts +175 -0
  302. package/src/serve/hub-app/pages-frames.tsx +11 -3
  303. package/src/serve/hub-app/palette-st.ts +58 -11
  304. package/src/serve/hub-app/palette-view.tsx +3 -1
  305. package/src/serve/hub-app/project-list.css +54 -8
  306. package/src/serve/hub-app/project-list.tsx +128 -59
  307. package/src/serve/hub-app/projects-svc.ts +78 -7
  308. package/src/serve/hub-app/reader-chips.tsx +13 -0
  309. package/src/serve/hub-app/readme-view.tsx +2 -3
  310. package/src/serve/hub-app/readme.css +27 -5
  311. package/src/serve/hub-app/reflections-page.tsx +42 -0
  312. package/src/serve/hub-app/reflections-st.ts +17 -0
  313. package/src/serve/hub-app/releases/releases-page.tsx +25 -2
  314. package/src/serve/hub-app/releases/releases-st.ts +1 -1
  315. package/src/serve/hub-app/repo-sections.ts +9 -5
  316. package/src/serve/hub-app/repo-st.ts +35 -8
  317. package/src/serve/hub-app/review/draft-card.tsx +163 -0
  318. package/src/serve/hub-app/review/kit.tsx +50 -7
  319. package/src/serve/hub-app/review/note-place.ts +1 -1
  320. package/src/serve/hub-app/review/review-board.tsx +2 -2
  321. package/src/serve/hub-app/review/review-cells.tsx +145 -65
  322. package/src/serve/hub-app/review/review-kit.ts +27 -1
  323. package/src/serve/hub-app/review/review-list.tsx +68 -30
  324. package/src/serve/hub-app/review/review-page.tsx +7 -8
  325. package/src/serve/hub-app/review/review-st.ts +111 -24
  326. package/src/serve/hub-app/review/review-thread.tsx +49 -19
  327. package/src/serve/hub-app/review/review-views.tsx +475 -144
  328. package/src/serve/hub-app/review/thread-control-st.ts +115 -0
  329. package/src/serve/hub-app/review/thread-control.tsx +74 -0
  330. package/src/serve/hub-app/review/thread-st.ts +73 -26
  331. package/src/serve/hub-app/review/trailer-card.tsx +1 -1
  332. package/src/serve/hub-app/review/trailer-page.tsx +37 -16
  333. package/src/serve/hub-app/review/trailer-st.ts +41 -7
  334. package/src/serve/hub-app/review.css +267 -61
  335. package/src/serve/hub-app/side-lists.ts +72 -0
  336. package/src/serve/hub-app/sidebar.tsx +6 -3
  337. package/src/serve/hub-app/site/site-part.tsx +2 -8
  338. package/src/serve/hub-app/site/site-st.ts +4 -4
  339. package/src/serve/hub-app/social/comms-page.tsx +20 -5
  340. package/src/serve/hub-app/social/kit.tsx +30 -4
  341. package/src/serve/hub-app/social/post-card.tsx +139 -49
  342. package/src/serve/hub-app/social/serial-writes.ts +13 -0
  343. package/src/serve/hub-app/social/social-model.ts +11 -0
  344. package/src/serve/hub-app/social/social-page.tsx +94 -35
  345. package/src/serve/hub-app/social/social-st.ts +120 -36
  346. package/src/serve/hub-app/social/stage-popup.tsx +1 -1
  347. package/src/serve/hub-app/social/stage-st.ts +1 -1
  348. package/src/serve/hub-app/social/step-layout.ts +1 -1
  349. package/src/serve/hub-app/social.css +3 -0
  350. package/src/serve/hub-app/space-st.ts +209 -0
  351. package/src/serve/hub-app/space-view.tsx +196 -0
  352. package/src/serve/hub-app/space.css +27 -0
  353. package/src/serve/hub-app/stores/stores-page.tsx +91 -23
  354. package/src/serve/hub-app/stores/stores-st.ts +44 -19
  355. package/src/serve/hub-app/stores.css +6 -1
  356. package/src/serve/hub-app/theme-st.ts +22 -9
  357. package/src/serve/hub-app/time-charts.tsx +291 -0
  358. package/src/serve/hub-app/time-pages.tsx +749 -0
  359. package/src/serve/hub-app/time-st.ts +162 -0
  360. package/src/serve/hub-app/time-view.tsx +76 -0
  361. package/src/serve/hub-app/time.css +138 -0
  362. package/src/serve/hub-app/tree-build.ts +52 -42
  363. package/src/serve/hub-app/tree-row.tsx +4 -4
  364. package/src/serve/hub-app/tree-svc.ts +18 -9
  365. package/src/serve/hub-app/urls-svc.ts +154 -0
  366. package/src/serve/hub-app/urls-view.tsx +117 -0
  367. package/src/serve/hub-app/urls.css +30 -0
  368. package/src/serve/hub-app/vault-st.ts +127 -0
  369. package/src/serve/hub-app/vault-view.tsx +154 -0
  370. package/src/serve/hub-app/vault.css +38 -0
  371. package/src/serve/hub-app/veille/veille-st.ts +12 -10
  372. package/src/serve/hub-app/waiting-svc.ts +29 -0
  373. package/src/serve/hub-app/wikis-view.tsx +2 -2
  374. package/src/serve/hub-runtime.ts +15 -2
  375. package/src/serve/project-gutter-route.ts +27 -14
  376. package/src/serve/project-gutter.ts +25 -12
  377. package/src/serve/same-origin.ts +10 -0
  378. package/src/serve/serve-hub.ts +13 -4
  379. package/src/shipkit-files.ts +16 -2
  380. package/src/shipkit.ts +1 -1
  381. package/src/shot/shooter.ts +616 -420
  382. package/src/shot/shot-ask.ts +246 -155
  383. package/src/site/desk.ts +2 -2
  384. package/src/smoke/run-smoke.ts +3 -2
  385. package/src/social/cover.ts +202 -0
  386. package/src/social/discord-layout.ts +37 -13
  387. package/src/social/drafts.ts +3 -0
  388. package/src/social/load.ts +23 -2
  389. package/src/social/media-kind.ts +2 -1
  390. package/src/social/publish/discord.ts +5 -2
  391. package/src/social/publish/secret.ts +2 -2
  392. package/src/social/release-stage.ts +28 -13
  393. package/src/social/routes.ts +26 -1
  394. package/src/social/stage.ts +1 -1
  395. package/src/social/stats.ts +12 -9
  396. package/src/social/strip.ts +4 -1
  397. package/src/social/thumbnail.ts +255 -0
  398. package/src/stores/collection.ts +15 -11
  399. package/src/stores/desk.ts +236 -42
  400. package/src/stores/model.ts +72 -6
  401. package/src/stores/routes.ts +37 -12
  402. package/src/stores/unit.ts +14 -8
  403. package/src/suite/judge-suites.ts +41 -11
  404. package/src/suite/select.ts +45 -3
  405. package/src/suite/suite-cli.ts +16 -10
  406. package/src/trailer/bed.ts +1 -1
  407. package/src/trailer/build.ts +134 -21
  408. package/src/trailer/ffmpeg.ts +7 -0
  409. package/src/trailer/fonts.ts +3 -2
  410. package/src/trailer/grammar.ts +201 -2
  411. package/src/trailer/graph.ts +42 -5
  412. package/src/trailer/look.ts +21 -0
  413. package/src/trailer/mock.ts +154 -0
  414. package/src/trailer/passage.ts +65 -26
  415. package/src/trailer/score/heard.ts +89 -0
  416. package/src/trailer/score/sound.ts +14 -8
  417. package/src/trailer/sound/run.ts +16 -6
  418. package/src/trailer/stitch.ts +26 -5
  419. package/src/trailer/titles.ts +82 -19
  420. package/src/trailer/versions.ts +1 -3
  421. package/src/trailer/vertical.ts +3 -1
  422. package/src/urls/frame.ts +195 -0
  423. package/src/urls/routes.ts +43 -0
  424. package/src/urls/rows.ts +171 -0
  425. package/src/urls/unit.ts +73 -0
  426. package/src/vault/house-keys.ts +42 -0
  427. package/src/vault/layout.ts +50 -0
  428. package/src/vault/policy.ts +165 -0
  429. package/src/vault/vault-audit.ts +276 -0
  430. package/src/vault/vault-client.ts +40 -0
  431. package/src/vault/vault-config.ts +159 -0
  432. package/src/vault/vault-destroy.ts +78 -0
  433. package/src/vault/vault-handover.ts +305 -0
  434. package/src/vault/vault-http.ts +352 -0
  435. package/src/vault/vault-import.ts +208 -0
  436. package/src/vault/vault-init.ts +328 -0
  437. package/src/vault/vault-minter.ts +271 -0
  438. package/src/vault/vault-restore.ts +333 -0
  439. package/src/vault/vault-serve.ts +342 -0
  440. package/src/vault/vault-snapshot.ts +281 -0
  441. package/src/veille/asks.ts +1 -1
  442. package/src/veille/desk.ts +2 -2
@@ -4,15 +4,20 @@
4
4
  // caught there. A new command registers here.
5
5
  import { LIB_VERSION } from '../core/lib-version.ts'
6
6
  import { Builtins, Cli, Command } from 'clipanion'
7
- import { AskNewCommand, AsksCheckCommand, AsksCommand } from './cmd_Asks.ts'
7
+ import { AskNewCommand, AsksCheckCommand, AsksCommand, AsksDeclineCommand } from './cmd_Asks.ts'
8
8
  import { AssetsAddCommand, AssetsCheckCommand, AssetsFillCommand, AssetsGenCommand, AssetsIdentityCommand } from './cmd_Assets.ts'
9
9
  import { BumpCommand } from './cmd_Bump.ts'
10
10
  import { CallsCommand } from './cmd_Calls.ts'
11
- import { TimeCommand } from './cmd_Time.ts'
11
+ 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 { HqCardsCommand, HqCloseCommand, HqDrillCommand, HqEndCommand, HqForgetCommand, HqInviteCommand, HqJoinCommand, HqLeaveCommand, HqOpenCommand, HqDoorCommand, HqProxyCommand, HqReflectionsCommand, HqReflectionsForgetCommand, HqReplicateCommand, HqSwitchCommand } from './cmd_Hq.ts'
16
+ import { HistoryCheckCommand, HistoryForgetCommand, HistorySendCommand } from './cmd_History.ts'
17
+ import { VaultCompareCommand, VaultImportCommand, VaultInitCommand, VaultKeyCommand, VaultNarrowCommand, VaultDestroyCommand, VaultRestoreCommand, VaultRevokeRootsCommand, VaultServeCommand, VaultSnapshotCommand, VaultStatusCommand } from './cmd_Vault.ts'
15
18
  import { LanesCommand } from './cmd_Lanes.ts'
19
+ import { MachinesCommand } from './cmd_Machines.ts'
20
+ import { DbCommand, DbDropCommand, DbFoldCommand, DbRebuildCommand, DbRepairCommand } from './cmd_Db.ts'
16
21
  import { type CommandRow, commandRows, CommandsCommand, type Definition } from './cmd_Commands.ts'
17
22
  import { type Candidate, familyList, type Said, unknownCommand } from './family-help.ts'
18
23
  import { CrossRepoActivityCommand } from './cmd_CrossRepoActivity.ts'
@@ -26,7 +31,7 @@ import { CiCommand } from './cmd_Ci.ts'
26
31
  import { ContractsCommand } from './cmd_Contracts.ts'
27
32
  import { FleetCommand } from './cmd_Fleet.ts'
28
33
  import { FleetPushCommand } from './cmd_FleetPush.ts'
29
- import { DaemonCommand, DaemonJobCommand, GuiCommand, PmCommand, PmInstallCommand, PmRestartCommand, PmUninstallCommand, WebCommand } from './cmd_Home.ts'
34
+ import { DaemonCommand, DaemonJobCommand, GuiCommand, HomeMoveCommand, PmCommand, PmInstallCommand, PmRestartCommand, PmUninstallCommand, WebCommand } from './cmd_Home.ts'
30
35
  import { HooksCommitMsgCommand, HooksInstallCommand, HooksListCommand, HooksPreCommitCommand } from './cmd_Hooks.ts'
31
36
  import { InitCommand } from './cmd_Init.ts'
32
37
  import { KeysCommand } from './cmd_Keys.ts'
@@ -54,10 +59,12 @@ import { REC_COMMANDS } from './cmd_Rec.ts'
54
59
  import { SignSetupCommand } from './cmd_Sign.ts'
55
60
  import { ANNEX_COMMANDS } from './cmd_Annex.ts'
56
61
  import { TMP_COMMANDS } from './cmd_Tmp.ts'
62
+ import { SPACE_COMMANDS } from './cmd_Space.ts'
57
63
  import { BACKUP_COMMANDS } from './cmd_Backup.ts'
58
64
  import { VEILLE_COMMANDS } from './cmd_Veille.ts'
59
65
  import { MESSAGES_COMMANDS } from './cmd_Messages.ts'
60
66
  import { TuiCommand } from './cmd_Tui.ts'
67
+ import { UrlsCommand } from './cmd_Urls.ts'
61
68
  import { SecretListCommand, SecretReadCommand, SecretSetCommand, SecretCopyCommand } from './cmd_Secret.ts'
62
69
  import { WikiLintCommand, WikiServeCommand } from './cmd_Wiki.ts'
63
70
 
@@ -144,6 +151,7 @@ export function buildCli(): Cli {
144
151
  cli.register(SignSetupCommand)
145
152
  for (const c of ANNEX_COMMANDS) cli.register(c)
146
153
  for (const c of TMP_COMMANDS) cli.register(c)
154
+ for (const c of SPACE_COMMANDS) cli.register(c)
147
155
  for (const c of BACKUP_COMMANDS) cli.register(c)
148
156
  for (const c of VEILLE_COMMANDS) cli.register(c)
149
157
  for (const c of MESSAGES_COMMANDS) cli.register(c)
@@ -155,10 +163,12 @@ export function buildCli(): Cli {
155
163
  cli.register(PmInstallCommand)
156
164
  cli.register(PmUninstallCommand)
157
165
  cli.register(PmRestartCommand)
166
+ cli.register(HomeMoveCommand)
158
167
  cli.register(GuiCommand)
159
168
  cli.register(ContractsCommand)
160
169
  cli.register(AsksCommand)
161
170
  cli.register(AsksCheckCommand)
171
+ cli.register(AsksDeclineCommand)
162
172
  cli.register(AskNewCommand)
163
173
  cli.register(WikiServeCommand)
164
174
  cli.register(WikiLintCommand)
@@ -186,6 +196,7 @@ export function buildCli(): Cli {
186
196
  cli.register(GlobalProcessStopCommand)
187
197
  cli.register(GlobalProcessRestartCommand)
188
198
  cli.register(GlobalProcessOpenCommand)
199
+ cli.register(UrlsCommand)
189
200
  cli.register(CrossRepoActivityCommand)
190
201
  cli.register(PlannedCommand)
191
202
  cli.register(InsightsCommand)
@@ -199,8 +210,18 @@ export function buildCli(): Cli {
199
210
  cli.register(CommandsCommand)
200
211
  cli.register(CapacityCommand)
201
212
  cli.register(LanesCommand)
213
+ cli.register(MachinesCommand)
214
+ cli.register(DbCommand)
215
+ cli.register(DbFoldCommand)
216
+ cli.register(DbDropCommand)
217
+ cli.register(DbRepairCommand)
218
+ cli.register(DbRebuildCommand)
219
+ for (const c of [HqOpenCommand, HqCloseCommand, HqInviteCommand, HqEndCommand, HqForgetCommand, HqJoinCommand, HqLeaveCommand, HqReplicateCommand, HqDrillCommand, HqCardsCommand, HqSwitchCommand, HqReflectionsCommand, HqReflectionsForgetCommand, HqProxyCommand, HqDoorCommand]) cli.register(c)
220
+ for (const c of [HistorySendCommand, HistoryCheckCommand, HistoryForgetCommand]) cli.register(c)
221
+ for (const c of [VaultServeCommand, VaultStatusCommand, VaultInitCommand, VaultKeyCommand, VaultNarrowCommand, VaultImportCommand, VaultCompareCommand, VaultSnapshotCommand, VaultRestoreCommand, VaultDestroyCommand, VaultRevokeRootsCommand]) cli.register(c)
202
222
  cli.register(CallsCommand)
203
223
  cli.register(TimeCommand)
224
+ cli.register(TimeDietCommand)
204
225
  cli.register(DrillReportCommand)
205
226
  cli.register(DrillVerdictCommand)
206
227
  cli.register(DrillCompareCommand)
@@ -3,9 +3,12 @@
3
3
  // repo's diff shows it; Feedback appends are append-only, never destructive).
4
4
  import { existsSync, readFileSync, writeFileSync } from 'fs'
5
5
  import { join } from 'path'
6
- import { archiveAsk, checkAsk, openAsks, proofAsk, type OneCheck } from '../asks/asks-queue.ts'
6
+ import { archiveAsk, checkAsk, declineAsk, openAsks, proofAsk, type OneCheck } from '../asks/asks-queue.ts'
7
+ import type { Held, HeldOf } from '../secrets/held.ts'
7
8
  import { redact, type SecretStore } from '../secrets/manager.ts'
9
+ import { forgetHeld, heldOfAsks } from './providers.ts'
8
10
  import { SECRET_NAME } from '../secrets/name.ts'
11
+ import { urlLogins } from '../urls/rows.ts'
9
12
 
10
13
  const today = (): string => new Date().toISOString().slice(0, 10)
11
14
 
@@ -19,10 +22,10 @@ export function appendAssetNote(root: string, assetId: string, text: string): vo
19
22
  }
20
23
 
21
24
  /** a remark on an ask → appended to the ask file, dated, non-destructive.
22
- * Accepts exactly one optional `done/` prefix (archived asks stay
25
+ * Accepts exactly one optional `done/` or `declined/` prefix (archived asks stay
23
26
  * annotatable); any other slash or traversal is a bad path. */
24
27
  export function appendAskRemark(root: string, asksDir: string, file: string, text: string): void {
25
- if (!/^(done\/)?[A-Za-z0-9][A-Za-z0-9._-]*$/.test(file) || file.includes('..')) throw new Error('bad path')
28
+ if (!/^((done|declined)\/)?[A-Za-z0-9][A-Za-z0-9._-]*$/.test(file) || file.includes('..')) throw new Error('bad path')
26
29
  const p = join(root, asksDir, file)
27
30
  if (!existsSync(p)) throw new Error(`no such ask: ${file}`)
28
31
  writeFileSync(p, `${readFileSync(p, 'utf8').trimEnd()}\n- ${today()}: ${text.replace(/\n+/g, ' ').trim()}\n`)
@@ -33,18 +36,55 @@ export function askDone(root: string, asksDir: string, file: string): void {
33
36
  archiveAsk(join(root, asksDir), file)
34
37
  }
35
38
 
39
+ /** the owner's « I will not do this » from the hub, his reason optional */
40
+ export function askDecline(root: string, asksDir: string, file: string, why?: string): void {
41
+ if (file.includes('/') || file.includes('..')) throw new Error('bad path')
42
+ declineAsk(join(root, asksDir), file, why)
43
+ }
44
+
36
45
  export function askProof(root: string, asksDir: string, file: string, url: string): void {
37
46
  if (file.includes('/') || file.includes('..')) throw new Error('bad path')
38
47
  proofAsk(join(root, asksDir), file, url)
39
48
  }
40
49
 
41
- export type SecretAnswer = { stored: string } & OneCheck
50
+ /** `held`: the store's state of that name read again after the store, so its row shows it at once; `account`: a
51
+ * login's account as stored, which is no secret */
52
+ export type SecretAnswer = { stored: string; held: Held; account?: string } & OneCheck
53
+
42
54
 
43
55
  /** a value pasted under a credential ask: stored under a name that open ask
44
- * declares, then that ask's check alone. Its truth is the keychain, never a
45
- * file: the value is not written, logged or answered, and a failure line has
46
- * it replaced by ‹value› */
47
- export async function askSecret(o: { root: string; asksDir: string; file: string; name: string; value: string; store: SecretStore }): Promise<SecretAnswer> {
56
+ * declares, then the ask closes once every value is in, else its check alone.
57
+ * Its truth is the store, never a file: the value is not written, logged or
58
+ * answered, and a failure line has it replaced by ‹value› */
59
+ /** the longest account a login takes: an email address is at most 254 characters */
60
+ export const ACCOUNT_MAX = 254
61
+
62
+ /** why an account cannot go to the store's command as its last argument, in words that never quote it: a store
63
+ * command reads a leading dash as a flag and a line break as a second line. Null when it can */
64
+ export function accountProblem(account: string): string | null {
65
+ if (account.length > ACCOUNT_MAX) return `is longer than ${ACCOUNT_MAX} characters`
66
+ if (/[\u0000-\u001f\u007f]/.test(account)) return 'holds a line break or another control character'
67
+ if (account.startsWith('-')) return 'starts with a dash, which a store command reads as a flag'
68
+ return null
69
+ }
70
+
71
+ /** 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,
72
+ * the store's refusal said with the value hidden, what the hub remembered of the stores forgotten */
73
+ export async function storeValue(o: { root: string; name: string; value: string; account?: string | undefined; store: SecretStore }): Promise<void> {
74
+ const value = o.value.trim()
75
+ if (value === '') throw new Error(`${o.name}: an empty value is not stored`)
76
+ try {
77
+ const r = await o.store(o.name, value, o.account)
78
+ if (!r.ok) throw new Error(`${o.name} not stored: ${r.why}`)
79
+ forgetHeld(o.root)
80
+ } catch (e) {
81
+ throw new Error(redact(redact((e as Error).message, value), o.account ?? ''))
82
+ }
83
+ }
84
+
85
+ /** `account`: a login's account, stored with its value; `logins` the repo's url logins (urls/rows.ts urlLogins), a test
86
+ * passes its own */
87
+ export async function askSecret(o: { root: string; asksDir: string; file: string; name: string; value: string; account?: string; store: SecretStore; held?: HeldOf; logins?: string[] }): Promise<SecretAnswer> {
48
88
  if (!/^[A-Za-z0-9][A-Za-z0-9._-]*\.md$/.test(o.file)) throw new Error('bad path')
49
89
  const dir = join(o.root, o.asksDir)
50
90
  const ask = openAsks(dir).find((a) => a.file === o.file)
@@ -53,13 +93,23 @@ export async function askSecret(o: { root: string; asksDir: string; file: string
53
93
  if (!SECRET_NAME.test(o.name) || !ask.secrets.includes(o.name)) throw new Error(`${o.file} declares no secret named ${o.name}`)
54
94
  const value = o.value.trim()
55
95
  if (value === '') throw new Error('empty value: nothing stored')
96
+ const account = o.account?.trim() ?? ''
97
+ const login = ask.logins.includes(o.name) || (o.logins ?? (await urlLogins(o.root))).includes(o.name)
98
+ if (login && account === '') throw new Error(`${o.name} is a login: its account too (the email or user name you sign in with), nothing stored`)
99
+ if (!login && account !== '') throw new Error(`${o.name} is no login: it takes a value alone, nothing stored`)
100
+ const bad = login ? accountProblem(account) : null
101
+ if (bad != null) throw new Error(`${o.name}: the account ${bad}, nothing stored`)
102
+ const hide = (t: string): string => redact(redact(t, value), account)
56
103
  let c: OneCheck
104
+ let held: Held
105
+ const heldOf = o.held ?? heldOfAsks
57
106
  try {
58
- const r = await o.store(o.name, value)
59
- if (!r.ok) throw new Error(`${o.name} not stored: ${r.why}`)
60
- c = await checkAsk(o.root, dir, o.file)
107
+ await storeValue({ root: o.root, name: o.name, value, account: login ? account : undefined, store: o.store })
108
+ held = (await heldOf([o.name], o.root))[o.name] ?? { held: 'unknown', why: 'the store did not answer for it' }
109
+ c = await checkAsk(o.root, dir, o.file, { held: heldOf })
61
110
  } catch (e) {
62
- throw new Error(redact((e as Error).message, value))
111
+ throw new Error(hide((e as Error).message))
63
112
  }
64
- return c.check === 'failed' ? { stored: o.name, check: 'failed', why: redact(c.why, value) } : { stored: o.name, ...c }
113
+ const mine = login ? { account } : {}
114
+ return c.check === 'failed' ? { stored: o.name, held, ...mine, check: 'failed', why: hide(c.why) } : { stored: o.name, held, ...mine, ...c }
65
115
  }
@@ -6,7 +6,9 @@
6
6
  // default, or a paste-from-elsewhere. Doctrine page: tools/shipkit/collections in
7
7
  // the docs wiki this lib ships beside.
8
8
 
9
+ import type { ScopeChip } from '../core/scope.ts'
9
10
  import { yieldLoop } from '../core/loop-watch.ts'
11
+ import type { Held } from '../secrets/held.ts'
10
12
  import type { WhenAt, WhenSource } from '../core/when.ts'
11
13
  import type { RunsCells } from '../core/runs-matrix.ts'
12
14
  import type { CheckFrom } from '../ledger/gate-checks.ts'
@@ -32,7 +34,7 @@ export const NO_CHECK = 'in no check'
32
34
  * section a row lives under (hub-app/tree-build.ts KIND_SECTION). There is no
33
35
  * catch all kind: a row belongs to an owner, and what belongs to the hub
34
36
  * itself is its status (serve/hub-problems.ts), never a row */
35
- export const RESOURCE_TYPES = ['ask', 'secret', 'asset', 'post', 'workflow', 'wiki', 'contract', 'check', 'test', 'reflection', 'process', 'command', 'card', 'cut', 'voice', 'store', 'release', 'veille', 'message'] as const
37
+ export const RESOURCE_TYPES = ['ask', 'secret', 'asset', 'post', 'workflow', 'wiki', 'contract', 'check', 'test', 'reflection', 'process', 'url', 'command', 'card', 'cut', 'voice', 'store', 'release', 'veille', 'message'] as const
36
38
 
37
39
  /** the collection of the review cards that wait on him (collections/review.ts) */
38
40
  export const REVIEW_COL = 'review'
@@ -180,6 +182,9 @@ export type TestRun = {
180
182
  * declaration names a file that is not on disk */
181
183
  export type TestStanding = 'runs' | 'ignored' | 'orphan' | 'opaque' | 'missing'
182
184
 
185
+ /** who reads a secret, as the hub shows it: its chips, and the sentence behind them (secrets/who-reads.ts) */
186
+ export type Readers = { long: string; chips: ScopeChip[] }
187
+
183
188
  /** an ask as its line on the asks page reads it: the frontmatter of its file */
184
189
  export type AskFacts = {
185
190
  kind: string
@@ -193,6 +198,21 @@ export type AskFacts = {
193
198
  probe: string | null
194
199
  /** the secret names a credential ask stores: its page takes each pasted value */
195
200
  secrets: string[]
201
+ /** the `after:` value as written, null for none */
202
+ after: string | null
203
+ /** its `after:` moment is still ahead: out of the open count and the ping until then */
204
+ later: boolean
205
+ /** an open credential ask: whether the store holds each name it declares and since when, never a value */
206
+ held?: Record<string, Held>
207
+ /** an open ask: every secret name it asks to store, its body's store lines included */
208
+ stores?: string[]
209
+ /** an open ask: who will be able to read each name it stores (secrets/who-reads.ts) */
210
+ readers?: Record<string, Readers>
211
+ /** an open credential ask: the names that are logins (its `login:` line, or a url login of the repo with no
212
+ * account of its own), each stored with its account */
213
+ logins?: string[]
214
+ /** a stored login's account as the store gives it: an account is no secret */
215
+ accounts?: Record<string, string>
196
216
  }
197
217
 
198
218
  /** one test file, as its row and its page read it */
@@ -285,6 +305,8 @@ export type Instance = {
285
305
  test?: TestFacts
286
306
  /** asks only: what its frontmatter says */
287
307
  ask?: AskFacts
308
+ /** secrets only: who is able to read it (secrets/who-reads.ts) */
309
+ who?: Readers
288
310
  /** an open ask owns the action (dedup = acted-on once, never hidden):
289
311
  * the instance stays red HERE but verbs and pings live with the ask */
290
312
  askOwned?: boolean
@@ -17,12 +17,15 @@ import { assetDir, listRolls, readPick } from '../assets/roll-workspace.ts'
17
17
  // runtime and the canvas binding, ~400ms of module load, and the hub's
18
18
  // collection list is built on every request by callers that mostly never heal
19
19
  import type { healIdentity } from '../assets/run-assets.ts'
20
- import { doneAsks, openAsks, type Ask } from '../asks/asks-queue.ts'
20
+ import { afterWords } from '../asks/ask-after.ts'
21
+ import { urlLogins } from '../urls/rows.ts'
22
+ import { archivedAsks, CLOSED, declinedNow, isLater, openAsks, type Ask } from '../asks/asks-queue.ts'
23
+ import type { Held, HeldOf } from '../secrets/held.ts'
21
24
  import { evaluateContracts } from '../contracts/contracts-engine.ts'
22
25
  import { CheckCtx } from '../core/check-ctx.ts'
23
26
  import type { RepoConfig } from '../repo-config.ts'
24
27
  import { activeContracts, contractsConfigFrom } from '../contracts/apply-contracts.ts'
25
- import type { AskFacts, CheckFacts, Collection, Instance } from './collection-types.ts'
28
+ import type { AskFacts, CheckFacts, Collection, Instance, Readers } from './collection-types.ts'
26
29
  import { mdBody } from './md-body.ts'
27
30
  import { assetState, secretState, type SecretLevel, type SecretProbe } from './state-rules.ts'
28
31
  import { reflectionsCollection } from './reflections.ts'
@@ -124,9 +127,65 @@ const slug = (t: string): string => t.toLowerCase().replace(/[^a-z0-9]+/g, '-').
124
127
  /** wire lines re-rendered as a fenced block for an instance's md */
125
128
  const wireMd = (lines: string[]): string => `\`\`\`\n${lines.join('\n')}\n\`\`\``
126
129
 
127
- const askFacts = (a: Ask): AskFacts => ({ kind: a.kind, created: a.created, closed: a.closed, blocks: a.blocks, probe: a.check, secrets: a.kind === 'credential' ? a.secrets : [] })
130
+ const askFacts = (a: Ask, later = false, held?: Record<string, Held>, readers?: Record<string, Readers>, login?: { logins: string[]; accounts: Record<string, string> }): AskFacts => ({ kind: a.kind, created: a.created, closed: a.closed, blocks: a.blocks, probe: a.check, secrets: a.kind === 'credential' ? a.secrets : [], after: a.after, later, ...(held != null ? { held } : {}), ...(readers != null ? { stores: a.stores, readers } : {}), ...(login != null && login.logins.length > 0 ? login : {}) })
128
131
 
129
- export function asksCollection(root: string, c: RepoConfig): Collection {
132
+ /** the store's read of a repo's names, kept this long: the hub lists its asks on every poll, and a read off the vault
133
+ * machine runs the secret manager once a name */
134
+ const HELD_KEEP_MS = 20_000
135
+ const heldKept = new Map<string, { at: number; held: Record<string, Held> }>()
136
+
137
+ /** the store's state of these names for the repo at `root` (secrets/read.ts heldHere), kept HELD_KEEP_MS */
138
+ export const heldOfAsks: HeldOf = async (names, root) => {
139
+ const key = `${root}\0${[...names].sort().join(' ')}`
140
+ const kept = heldKept.get(key)
141
+ if (kept != null && Date.now() - kept.at < HELD_KEEP_MS) return kept.held
142
+ const { heldHere } = await import('../secrets/read.ts')
143
+ const held = await heldHere({ names, cwd: root })
144
+ heldKept.set(key, { at: Date.now(), held })
145
+ return held
146
+ }
147
+
148
+ /** who reads each name: the house's registry row of it (secrets/who-reads.ts) */
149
+ export type WhoOf = (names: string[], root: string) => Promise<Record<string, Readers>>
150
+ const whoOfHouse: WhoOf = async (names, root) =>
151
+ Object.fromEntries(Object.entries(await (await import('../secrets/who-reads.ts')).whoReads(names, root)).map(([n, w]) => [n, { long: w.words, chips: w.chips }]))
152
+ /** the readers of these names, or none when the house cannot be read: a scope is never guessed */
153
+ const wordsOf = (who: WhoOf | undefined, names: string[], root: string): Promise<Record<string, Readers>> =>
154
+ names.length === 0 ? Promise.resolve({}) : (who ?? whoOfHouse)(names, root).catch(() => ({}))
155
+
156
+ /** a stored login's account, by name, as the store gives it (an account is no secret); none it cannot read */
157
+ export type AccountsOf = (names: string[], root: string) => Promise<Record<string, string>>
158
+ const accountsKept = new Map<string, { at: number; accounts: Record<string, string> }>()
159
+ const accountsOfStore: AccountsOf = async (names, root) => {
160
+ const key = `${root}\0${[...names].sort().join(' ')}`
161
+ const kept = accountsKept.get(key)
162
+ if (kept != null && Date.now() - kept.at < HELD_KEEP_MS) return kept.accounts
163
+ const { readSecretHere } = await import('../secrets/read.ts')
164
+ const read = await Promise.all(names.map(async (name) => [name, await readSecretHere({ name, field: 'account', cwd: root, say: () => {} }).catch(() => null)] as const))
165
+ const accounts = Object.fromEntries(read.flatMap(([n, r]) => (r != null && 'value' in r && r.value !== '' ? [[n, r.value]] : [])))
166
+ accountsKept.set(key, { at: Date.now(), accounts })
167
+ return accounts
168
+ }
169
+
170
+ /** the repo's url logins (urls/rows.ts urlLogins), kept like the store's read: they import the repo's url units */
171
+ const loginsKept = new Map<string, { at: number; names: Promise<string[]> }>()
172
+ const urlLoginsKept = (root: string): Promise<string[]> => {
173
+ const kept = loginsKept.get(root)
174
+ if (kept != null && Date.now() - kept.at < HELD_KEEP_MS) return kept.names
175
+ const names = urlLogins(root)
176
+ loginsKept.set(root, { at: Date.now(), names })
177
+ return names
178
+ }
179
+
180
+ /** a store moved a value of this repo: its next read asks the store again */
181
+ export const forgetHeld = (root: string): void => {
182
+ for (const k of heldKept.keys()) if (k.startsWith(`${root}\0`)) heldKept.delete(k)
183
+ for (const k of accountsKept.keys()) if (k.startsWith(`${root}\0`)) accountsKept.delete(k)
184
+ }
185
+
186
+ /** a later ask (its `after:` moment ahead) is yellow, so it never pings, and quiet in the tree: out of the way until
187
+ * then, red from then on with no edit of its file. `now` is the clock a test passes */
188
+ export function asksCollection(root: string, c: RepoConfig, o: { now?: () => number; held?: HeldOf; who?: WhoOf; urlLogins?: (root: string) => Promise<string[]>; accounts?: AccountsOf } = {}): Collection {
130
189
  return {
131
190
  id: 'asks',
132
191
  title: 'asks',
@@ -134,38 +193,56 @@ export function asksCollection(root: string, c: RepoConfig): Collection {
134
193
  media: 'text',
135
194
  list: async () => {
136
195
  const rel = c.asks?.dir ?? LAYOUT.asks
137
- const open = openAsksSafe(root, c).map((a): Instance => ({
196
+ const now = (o.now ?? Date.now)()
197
+ const asks = openAsksSafe(root, c)
198
+ // each credential ask's names, read once for all of them: names and dates, never a value
199
+ const names = [...new Set(asks.filter((a) => a.kind === 'credential').flatMap((a) => a.secrets))]
200
+ const held = names.length === 0 ? {} : await (o.held ?? heldOfAsks)(names, root).catch((e: Error): Record<string, Held> => Object.fromEntries(names.map((n) => [n, { held: 'unknown', why: e.message }])))
201
+ // who will read each name an open ask stores: said before the value is pasted
202
+ const who = await wordsOf(o.who, [...new Set(asks.flatMap((a) => a.stores))], root)
203
+ // a login: its own line, or a url login of the repo; its account read once stored
204
+ const fromUrls = names.length === 0 ? [] : await (o.urlLogins ?? urlLoginsKept)(root).catch(() => [])
205
+ const loginsOf = (a: Ask): string[] => (a.kind === 'credential' ? a.secrets.filter((n) => a.logins.includes(n) || fromUrls.includes(n)) : [])
206
+ const stored = [...new Set(asks.flatMap(loginsOf))].filter((n) => held[n]?.held === 'stored')
207
+ const accounts = stored.length === 0 ? {} : await (o.accounts ?? accountsOfStore)(stored, root).catch(() => ({}))
208
+ const open = asks.map((a): Instance => {
209
+ const later = isLater(a, now)
210
+ const mine = a.kind === 'credential' && a.secrets.length > 0 ? Object.fromEntries(a.secrets.map((n) => [n, held[n] ?? { held: 'unknown' as const, why: 'not read' }])) : undefined
211
+ return {
138
212
  id: `ask:${a.file}`,
139
- text: `${a.title}${a.kind !== '' ? ` (${a.kind})` : ''}`,
213
+ text: `${a.title}${a.kind !== '' ? ` (${a.kind})` : ''}${later ? `, ${afterWords(a.after!)}` : ''}`,
140
214
  // the tree carries the title and puts the kind in its own
141
215
  // slot, so a column of asks reads as a column of kinds
142
216
  label: a.title,
143
217
  slot: a.kind !== '' ? a.kind : undefined,
144
218
  type: 'ask' as const,
145
219
  path: `${rel}/${a.file}`,
146
- severity: 'red' as const,
220
+ severity: later ? ('yellow' as const) : ('red' as const),
221
+ ...(later ? { state: 'quiet' as const } : {}),
147
222
  verbs: ['done' as const, 'paste-proof' as const],
148
223
  file: `${rel}/${a.file}`,
149
224
  md: mdBody(join(root, rel, a.file)),
150
225
  remarks: lastRemarks(join(root, rel, a.file)),
151
- ask: askFacts(a),
152
- }))
153
- // the done/ archive rides along QUIET (no severity) — past answers
226
+ ask: askFacts(a, later, mine, a.stores.length > 0 ? Object.fromEntries(a.stores.flatMap((n) => (who[n] != null ? [[n, who[n]!]] : []))) : undefined,
227
+ { logins: loginsOf(a), accounts: Object.fromEntries(loginsOf(a).flatMap((n) => (accounts[n] != null ? [[n, accounts[n]!]] : []))) }),
228
+ }
229
+ })
230
+ // the done/ and declined/ archives ride along QUIET (no severity): past answers
154
231
  // stay consultable and remarkable; newest first, after every open ask
155
- const done = doneAsks(askDirOf(root, c)).map((a): Instance => ({
156
- id: `ask:done/${a.file}`,
232
+ const closed = CLOSED.flatMap((status) => archivedAsks(askDirOf(root, c), status).map((a): Instance => ({
233
+ id: `ask:${status}/${a.file}`,
157
234
  text: `${a.title}${a.kind !== '' ? ` (${a.kind})` : ''}`,
158
235
  label: a.title,
159
- slot: 'done',
236
+ slot: status,
160
237
  type: 'ask' as const,
161
- path: `${rel}/done/${a.file}`,
238
+ path: `${rel}/${status}/${a.file}`,
162
239
  state: 'quiet' as const,
163
- file: `${rel}/done/${a.file}`,
164
- md: mdBody(join(root, rel, 'done', a.file)),
165
- remarks: lastRemarks(join(root, rel, 'done', a.file)),
240
+ file: `${rel}/${status}/${a.file}`,
241
+ md: mdBody(join(root, rel, status, a.file)),
242
+ remarks: lastRemarks(join(root, rel, status, a.file)),
166
243
  ask: askFacts(a),
167
- }))
168
- return [...open, ...done]
244
+ })))
245
+ return [...open, ...closed]
169
246
  },
170
247
  }
171
248
  }
@@ -182,6 +259,7 @@ export type CredsOpts = {
182
259
  * the run record every gate run and health pass writes */
183
260
  verdicts?: () => Promise<CheckVerdict[]>
184
261
  now?: () => number
262
+ who?: WhoOf
185
263
  }
186
264
 
187
265
  /** the verdicts a secret row reads, off the checks collection's own rows, so
@@ -210,8 +288,11 @@ export function credsCollection(root: string, c: RepoConfig, o: CredsOpts = {}):
210
288
  list: async () => {
211
289
  const rel = c.asks?.dir ?? LAYOUT.asks
212
290
  const asks = openAsksSafe(root, c)
213
- const coveringAsk = (name: string): { file: string } | undefined =>
214
- asks.find((a) => a.title.toLowerCase().includes(name.split('/')[1] ?? name))
291
+ // the ask that stores this name, else the older match by its title
292
+ const coveringAsk = (name: string): Ask | undefined =>
293
+ asks.find((a) => a.stores.includes(name)) ?? asks.find((a) => a.title.toLowerCase().includes(name.split('/')[1] ?? name))
294
+ const declined = existsSync(askDirOf(root, c)) ? declinedNow(askDirOf(root, c)) : []
295
+ const declinedFor = (name: string): { rel: string; ask: Ask } | undefined => declined.find((d) => d.ask.stores.includes(name))
215
296
  const verdicts = await (o.verdicts ?? (() => verdictsOf(checksCollection(root, c))))()
216
297
  const now = (o.now ?? Date.now)()
217
298
  const missing = missingFrom(verdicts)
@@ -229,7 +310,18 @@ export function credsCollection(root: string, c: RepoConfig, o: CredsOpts = {}):
229
310
  const decl = declared.find((d) => d.name === name)
230
311
  const md = wireMd([`FAIL: ${line.text}`, ...line.fixes.map((f) => `fix: ${f}`)])
231
312
  const ask = coveringAsk(name)
232
- if (ask != null)
313
+ const no = ask == null ? declinedFor(name) : undefined
314
+ if (no != null)
315
+ // the owner declined the ask for it: listed, never red, never pinged, and never asked again
316
+ out.push({
317
+ id: `cred:${name}`,
318
+ text: `${named(name, decl?.service)} missing, the owner declined it on ${no.ask.closed ?? '?'} (ask ${rel}/${no.rel})${minorWord(decl?.level)}`,
319
+ ...credPlace(name, true, decl?.level),
320
+ state: 'quiet',
321
+ md,
322
+ askOwned: true,
323
+ })
324
+ else if (ask != null)
233
325
  // dedup = acted-on once, never hidden: the ask keeps the
234
326
  // verbs and the ping; the cred still shows here
235
327
  out.push({
@@ -257,7 +349,9 @@ export function credsCollection(root: string, c: RepoConfig, o: CredsOpts = {}):
257
349
  artifact: d.mintUrl != null ? { url: d.mintUrl } : undefined,
258
350
  })
259
351
  }
260
- return out
352
+ const nameOf = (i: Instance): string => i.id.replace(/^cred:/, '')
353
+ const who = await wordsOf(o.who, out.map(nameOf), root)
354
+ return out.map((i) => (who[nameOf(i)] != null ? { ...i, who: who[nameOf(i)] } : i))
261
355
  },
262
356
  }
263
357
  }
@@ -1,11 +1,11 @@
1
- // the review store and the trailer cuts as tree rows (wiki tools/shipkit/review.md). Under the review section, one row a
1
+ // the review store and the trailer cuts as tree rows (wiki tools/shipkit/threads.md). Under the review section, one row a
2
2
  // card that waits on HIM (the owner's verdict, his answer to a question): yellow, so `sk needs` lists it too. Under the trailer
3
3
  // section, one row a cut, its open frame notes in the slot: they wait on agents, never on him, so a cut is never yellow;
4
4
  // and one yellow row a line of his own voice he has not recorded yet (the page's Voices). Each collection exists only where the repo has its folder, so a repo with none draws the section greyed
5
5
  import { existsSync } from 'node:fs'
6
6
  import { join } from 'node:path'
7
7
  import { STATUS_LABEL, isFrame, stateOf, type ReviewItem } from '../review/model.ts'
8
- import { readAllCached, storeDir, storeStamp, warmStore } from '../review/store.ts'
8
+ import { hasStore, readAllCached, storeDir, storeStamp, warmStore } from '../review/store.ts'
9
9
  import { statusOf, waitingOnOwner, type Thread } from '../review/threads.ts'
10
10
  import { cutsOf, trailerIds } from '../review/trailer-desk.ts'
11
11
  import { voicesDesk } from '../review/trailer-voices.ts'
@@ -30,7 +30,7 @@ export function waitingCards(root: string): { threads: Thread[]; items: ReviewIt
30
30
 
31
31
  export function reviewCollection(root: string): Collection | null {
32
32
  const dir = storeDir(root)
33
- if (!existsSync(dir)) return null
33
+ if (!hasStore(dir)) return null
34
34
  return {
35
35
  id: REVIEW_COL,
36
36
  title: 'review',
@@ -63,7 +63,7 @@ export function trailersCollection(root: string): Collection | null {
63
63
  media: 'image',
64
64
  list: async () => {
65
65
  const dir = storeDir(root)
66
- const items = existsSync(dir) ? readAllCached(dir).items : []
66
+ const items = hasStore(dir) ? readAllCached(dir).items : []
67
67
  const open = new Map<string, number>()
68
68
  for (const x of items) {
69
69
  const s = x.item.subject
@@ -1,9 +1,10 @@
1
1
  // GENERATED by contracts:sync — do not edit; sources are the co-located
2
2
  // wiki manifests. Parity is lint-enforced.
3
3
  import type { ContractManifest } from './contract-types.ts'
4
- import c0 from './manifests/discord.contract.ts'
5
- import c1 from './manifests/identity.contract.ts'
6
- import c2 from './manifests/itch.contract.ts'
7
- import c3 from './manifests/steam.contract.ts'
4
+ import c0 from './manifests/chrome-web-store.contract.ts'
5
+ import c1 from './manifests/discord.contract.ts'
6
+ import c2 from './manifests/identity.contract.ts'
7
+ import c3 from './manifests/itch.contract.ts'
8
+ import c4 from './manifests/steam.contract.ts'
8
9
 
9
- export const allContracts: ContractManifest[] = [c0, c1, c2, c3]
10
+ export const allContracts: ContractManifest[] = [c0, c1, c2, c3, c4]
@@ -10,8 +10,10 @@ export type FileRule = RuleOpts & { kind: 'file'; path: string; nonEmpty: boolea
10
10
  /** `atLeast`: the venue's numbers are a MINIMUM at a fixed aspect ratio (itch
11
11
  * displays a 630x500 cover but accepts larger, and a 2x asset is better) —
12
12
  * without it an exact-size rule blocks the release over a better file */
13
- export type PngRule = RuleOpts & { kind: 'png'; path: string; width: number; height: number; atLeast?: boolean }
14
- export type GlobRule = RuleOpts & { kind: 'glob'; pattern: string; min: number; width?: number; height?: number }
13
+ export type PngRule = RuleOpts & { kind: 'png'; path: string; width: number; height: number; atLeast?: boolean; opaque?: boolean }
14
+ /** `opaque` (png and glob): the venue refuses an alpha channel (the Chrome Web
15
+ * Store's tiles and screenshots are 24-bit png), so an RGBA file fails */
16
+ export type GlobRule = RuleOpts & { kind: 'glob'; pattern: string; min: number; width?: number; height?: number; opaque?: boolean }
15
17
  export type MdRule = RuleOpts & { kind: 'md'; path: string; mustContain: string[] }
16
18
  export type DirRule = RuleOpts & { kind: 'dir'; path: string }
17
19
  // probe returns FAIL messages (empty array = pass) — for rules that need the
@@ -60,8 +62,8 @@ export type ContractManifest = {
60
62
  }
61
63
 
62
64
  export const file = (path: string, p?: RuleOpts & { nonEmpty?: boolean }): FileRule => ({ kind: 'file', path, nonEmpty: p?.nonEmpty ?? true, warnOnly: p?.warnOnly })
63
- export const png = (path: string, width: number, height: number, p?: RuleOpts & { atLeast?: boolean }): PngRule => ({ kind: 'png', path, width, height, atLeast: p?.atLeast, warnOnly: p?.warnOnly })
64
- export const glob = (pattern: string, p: RuleOpts & { min: number; width?: number; height?: number }): GlobRule => ({ kind: 'glob', pattern, min: p.min, width: p.width, height: p.height, warnOnly: p.warnOnly })
65
+ export const png = (path: string, width: number, height: number, p?: RuleOpts & { atLeast?: boolean; opaque?: boolean }): PngRule => ({ kind: 'png', path, width, height, atLeast: p?.atLeast, opaque: p?.opaque, warnOnly: p?.warnOnly })
66
+ export const glob = (pattern: string, p: RuleOpts & { min: number; width?: number; height?: number; opaque?: boolean }): GlobRule => ({ kind: 'glob', pattern, min: p.min, width: p.width, height: p.height, opaque: p.opaque, warnOnly: p.warnOnly })
65
67
  export const md = (path: string, p?: RuleOpts & { mustContain?: string[] }): MdRule => ({ kind: 'md', path, mustContain: p?.mustContain ?? [], warnOnly: p?.warnOnly })
66
68
  export const dir = (path: string, p?: RuleOpts): DirRule => ({ kind: 'dir', path, warnOnly: p?.warnOnly })
67
69
  export const custom = (id: string, probe: CustomRule['probe'], p?: RuleOpts): CustomRule => ({ kind: 'custom', id, probe, warnOnly: p?.warnOnly })
@@ -45,6 +45,15 @@ export function pngDims(bytes: Uint8Array | null): { width: number; height: numb
45
45
  return { width: view.getUint32(16), height: view.getUint32(20) }
46
46
  }
47
47
 
48
+ /** the IHDR colour type carries an alpha channel (4 grey and alpha, 6 RGBA);
49
+ * null for no png. A palette's tRNS chunk is not read */
50
+ export function pngAlpha(bytes: Uint8Array | null): boolean | null {
51
+ if (bytes == null || bytes.length < 26 || pngDims(bytes) == null) return null
52
+ return bytes[25] === 4 || bytes[25] === 6
53
+ }
54
+
55
+ const ALPHA = 'has an alpha channel: need a 24-bit png with no alpha'
56
+
48
57
  const WILD = /[*?[{]/
49
58
 
50
59
  /** the files matching a repo-relative glob, walked one dir at a time through
@@ -118,6 +127,7 @@ async function checkRule(rule: ArtifactRule, env: ContractEnv, d: ContractDisk):
118
127
  if (tooSmall || ratioOff)
119
128
  problems.push(`${rule.path} is ${dims.width}x${dims.height} — need ${need}${ratioOff ? ' (the ratio is off; a bigger asset at the same ratio is fine)' : ' (bigger is fine, smaller is not)'}`)
120
129
  }
130
+ if (dims != null && rule.opaque === true && pngAlpha(d.bytes(rule.path)) === true) problems.push(`${rule.path} ${ALPHA}`)
121
131
  break
122
132
  }
123
133
  case 'glob': {
@@ -129,6 +139,7 @@ async function checkRule(rule: ArtifactRule, env: ContractEnv, d: ContractDisk):
129
139
  if (dims == null || dims.width !== rule.width || dims.height !== rule.height)
130
140
  problems.push(`${m} is ${dims == null ? 'not a readable png' : `${dims.width}x${dims.height}`} — need ${rule.width}x${rule.height}`)
131
141
  }
142
+ if (rule.opaque === true) for (const m of matches) if (pngAlpha(d.bytes(m)) === true) problems.push(`${m} ${ALPHA}`)
132
143
  break
133
144
  }
134
145
  case 'md': {
@@ -0,0 +1,31 @@
1
+ // normative WHAT for .shipkit/chrome-web-store/: the WHY and the workflow live in the sibling page
2
+ import { custom, defineContract, dirExists, glob, md, png } from 'rvlib-shipkit/src/contracts/contract-types.ts'
3
+
4
+ const DESCRIPTION_MAX = 16000
5
+
6
+ export default defineContract({
7
+ venue: 'chrome-web-store',
8
+ dir: '.shipkit/chrome-web-store',
9
+ owner: 'guides/chrome-web-store/index.md',
10
+ appliesTo: 'declared',
11
+ detect: [dirExists('.shipkit/chrome-web-store')],
12
+ artifacts: [
13
+ // the review rejects an item with no single purpose, an unjustified permission or no privacy policy
14
+ md('.shipkit/chrome-web-store/listing.md', {
15
+ mustContain: ['## Description', '## Category', '## Language', '## Single purpose description', '## Are you using remote code?', '## Data usage', '## Privacy policy URL'],
16
+ }),
17
+ custom('.shipkit/chrome-web-store/listing.md description length', (env) => {
18
+ const text = env.read('.shipkit/chrome-web-store/listing.md')
19
+ const body = text == null ? null : /^## Description\n([\s\S]*?)(?=^## |(?![\s\S]))/m.exec(text)?.[1]?.trim()
20
+ const n = body == null ? 0 : [...body].length
21
+ return n > DESCRIPTION_MAX ? [`.shipkit/chrome-web-store/listing.md: the Description is ${n} characters, the store takes ${DESCRIPTION_MAX}`] : []
22
+ }),
23
+ png('.shipkit/chrome-web-store/icon-128.png', 128, 128),
24
+ // tiles and screenshots: 24-bit png, an alpha channel is refused at upload
25
+ png('.shipkit/chrome-web-store/promo-440x280.png', 440, 280, { opaque: true }),
26
+ // optional on the store, the one picture it features an item with
27
+ png('.shipkit/chrome-web-store/marquee-1400x560.png', 1400, 560, { opaque: true, warnOnly: true }),
28
+ glob('.shipkit/chrome-web-store/screenshots/*.png', { min: 1, width: 1280, height: 800, opaque: true }),
29
+ glob('.shipkit/chrome-web-store/*.zip', { min: 1 }),
30
+ ],
31
+ })