rvlib-shipkit 2.25.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 (456) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/package.json +2 -2
  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 +331 -0
  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 +130 -17
  11. package/src/agent-time/report-cache.ts +57 -0
  12. package/src/agent-time/report.ts +349 -23
  13. package/src/agent-time/shape.ts +50 -3
  14. package/src/agent-time/store.ts +370 -95
  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/SK045-slow-hooks.check.ts +47 -0
  34. package/src/checks/SK046-hook-records.check.ts +76 -0
  35. package/src/checks/SK047-login-in-description.check.ts +36 -0
  36. package/src/checks/SK048-one-local-file.check.ts +36 -0
  37. package/src/cli/cmd_Asks.ts +71 -5
  38. package/src/cli/cmd_Backup.ts +5 -3
  39. package/src/cli/cmd_Capacity.ts +2 -2
  40. package/src/cli/cmd_CrossRepoActivity.ts +5 -4
  41. package/src/cli/cmd_Db.ts +253 -0
  42. package/src/cli/cmd_History.ts +212 -0
  43. package/src/cli/cmd_Home.ts +31 -3
  44. package/src/cli/cmd_Hq.ts +516 -0
  45. package/src/cli/cmd_Machines.ts +36 -0
  46. package/src/cli/cmd_Media.ts +38 -6
  47. package/src/cli/cmd_Mv.ts +1 -1
  48. package/src/cli/cmd_Reflect.ts +23 -2
  49. package/src/cli/cmd_Releases.ts +30 -0
  50. package/src/cli/cmd_Review.ts +569 -118
  51. package/src/cli/cmd_Secret.ts +62 -12
  52. package/src/cli/cmd_Social.ts +83 -1
  53. package/src/cli/cmd_Space.ts +324 -0
  54. package/src/cli/cmd_Time.ts +82 -5
  55. package/src/cli/cmd_Tmp.ts +28 -4
  56. package/src/cli/cmd_Trailer.ts +14 -10
  57. package/src/cli/cmd_Urls.ts +56 -0
  58. package/src/cli/cmd_Vault.ts +583 -0
  59. package/src/cli/family-help.ts +4 -2
  60. package/src/cli/family-pages.ts +1 -1
  61. package/src/cli/registry.ts +26 -4
  62. package/src/collections/actions.ts +63 -13
  63. package/src/collections/collection-types.ts +23 -1
  64. package/src/collections/providers.ts +117 -23
  65. package/src/collections/review.ts +4 -4
  66. package/src/commands/runner.ts +5 -1
  67. package/src/contracts/contract-manifests.ts +6 -5
  68. package/src/contracts/contract-types.ts +6 -4
  69. package/src/contracts/contracts-engine.ts +11 -0
  70. package/src/contracts/manifests/chrome-web-store.contract.ts +31 -0
  71. package/src/core/budget.ts +12 -17
  72. package/src/core/capacity.ts +27 -18
  73. package/src/core/check-runner.ts +7 -4
  74. package/src/core/history-files.ts +9 -5
  75. package/src/core/layout.ts +3 -0
  76. package/src/core/machine-busy.ts +127 -0
  77. package/src/core/machine-commit.ts +6 -1
  78. package/src/core/machine-db.ts +368 -20
  79. package/src/core/machine-layout.ts +137 -0
  80. package/src/core/machine-read.ts +81 -0
  81. package/src/core/migrate-layout.ts +1 -1
  82. package/src/core/one-way-in-policy.ts +64 -7
  83. package/src/core/polling-policy.ts +27 -0
  84. package/src/core/retention.ts +16 -2
  85. package/src/core/scope.ts +107 -14
  86. package/src/core/signal-name.ts +6 -0
  87. package/src/core/slots.ts +5 -4
  88. package/src/core/trace-audit.ts +6 -1
  89. package/src/core/transient.ts +6 -0
  90. package/src/drill/clean.ts +25 -1
  91. package/src/drill/run.ts +2 -2
  92. package/src/drill/seal.ts +27 -4
  93. package/src/home/activity-shape.ts +2 -0
  94. package/src/home/activity.ts +66 -3
  95. package/src/home/app-sign.ts +15 -4
  96. package/src/home/daemon-jobs.ts +149 -7
  97. package/src/home/database-projects.ts +111 -0
  98. package/src/home/database-words.ts +203 -0
  99. package/src/home/databases.ts +460 -0
  100. package/src/home/global-units.ts +6 -0
  101. package/src/home/gui-app/ShipkitGui.swift +122 -1
  102. package/src/home/gui-app.ts +6 -3
  103. package/src/home/home-move.ts +514 -0
  104. package/src/home/home-paths.ts +12 -3
  105. package/src/home/home-routes.ts +68 -0
  106. package/src/home/inbox-shape.ts +24 -14
  107. package/src/home/machine-fold.ts +820 -0
  108. package/src/home/machine-host.ts +20 -5
  109. package/src/home/machine-repair.ts +503 -0
  110. package/src/home/machine-stores.ts +66 -15
  111. package/src/home/machine-temp.ts +547 -86
  112. package/src/home/resume.ts +79 -0
  113. package/src/home/run-daemon.ts +25 -4
  114. package/src/home/run-pm.ts +18 -5
  115. package/src/home/serve-daemon.ts +18 -3
  116. package/src/home/serve-web.ts +175 -7
  117. package/src/home/space-job.ts +115 -0
  118. package/src/home/space-page.ts +257 -0
  119. package/src/home/space-route.ts +167 -0
  120. package/src/home/space-words.ts +103 -0
  121. package/src/home/time-page-shape.ts +202 -0
  122. package/src/home/time-page.ts +64 -0
  123. package/src/home/vault-page.ts +482 -0
  124. package/src/home/vault-words.ts +132 -0
  125. package/src/hooks/leak-guard.ts +40 -13
  126. package/src/hooks/one-way-in-guard.ts +17 -4
  127. package/src/hq/cards.ts +581 -0
  128. package/src/hq/door-route.ts +43 -0
  129. package/src/hq/door.ts +163 -0
  130. package/src/hq/files-send.ts +348 -0
  131. package/src/hq/forgotten-log.ts +35 -0
  132. package/src/hq/history-check.ts +255 -0
  133. package/src/hq/history-place.ts +146 -0
  134. package/src/hq/history-send.ts +487 -0
  135. package/src/hq/hq-db.ts +99 -0
  136. package/src/hq/hq-local.ts +469 -0
  137. package/src/hq/hq-routes.ts +196 -0
  138. package/src/hq/hq-store.ts +599 -0
  139. package/src/hq/kinds/ask.ts +147 -0
  140. package/src/hq/kinds/card-gone.ts +83 -0
  141. package/src/hq/kinds/card-msg.ts +66 -0
  142. package/src/hq/kinds/card.ts +99 -0
  143. package/src/hq/kinds/index.ts +21 -0
  144. package/src/hq/kinds/kind.ts +126 -0
  145. package/src/hq/kinds/media.ts +125 -0
  146. package/src/hq/kinds/prompt.ts +219 -0
  147. package/src/hq/kinds/reflection.ts +128 -0
  148. package/src/hq/kinds/report.ts +55 -0
  149. package/src/hq/kinds/time-day.ts +236 -0
  150. package/src/hq/ledger.ts +473 -0
  151. package/src/hq/machine-key.ts +44 -0
  152. package/src/hq/machine-notes.ts +131 -0
  153. package/src/hq/outbox.ts +372 -0
  154. package/src/hq/replica.ts +168 -0
  155. package/src/hq/repo-id.ts +4 -0
  156. package/src/hq/report-facts.ts +117 -0
  157. package/src/hq/report.ts +274 -0
  158. package/src/hq/switch.ts +151 -0
  159. package/src/hq/vault-grant.ts +92 -0
  160. package/src/identities/identities.ts +15 -3
  161. package/src/identities/steps.ts +31 -0
  162. package/src/ledger/db.ts +73 -26
  163. package/src/ledger/gate-checks.ts +29 -4
  164. package/src/ledger/git-key.ts +3 -3
  165. package/src/ledger/git-scan.ts +49 -7
  166. package/src/ledger/run-log.ts +11 -3
  167. package/src/ledger/store.ts +26 -4
  168. package/src/media-store/backup/daemon.ts +36 -17
  169. package/src/media-store/backup/kept.ts +241 -0
  170. package/src/media-store/backup/restore.ts +14 -4
  171. package/src/media-store/backup/run.ts +11 -11
  172. package/src/media-store/backup/secret.ts +6 -4
  173. package/src/media-store/backup/snapshot.ts +4 -2
  174. package/src/media-store/backup/sources.ts +68 -20
  175. package/src/media-store/copy/config.ts +77 -0
  176. package/src/media-store/copy/copy.ts +194 -0
  177. package/src/media-store/copy/lifecycle.ts +43 -0
  178. package/src/media-store/copy/night.ts +90 -0
  179. package/src/media-store/copy/proof.ts +151 -0
  180. package/src/media-store/copy/snapshot.ts +152 -0
  181. package/src/media-store/copy/store.ts +62 -0
  182. package/src/media-store/copy/stream.ts +176 -0
  183. package/src/media-store/daemon.ts +66 -16
  184. package/src/media-store/db.ts +22 -11
  185. package/src/media-store/forget.ts +23 -3
  186. package/src/media-store/hand.ts +4 -3
  187. package/src/media-store/hq-find.ts +75 -0
  188. package/src/media-store/hq-send.ts +277 -0
  189. package/src/media-store/kind.ts +2 -0
  190. package/src/media-store/purge.ts +18 -15
  191. package/src/media-store/put.ts +24 -8
  192. package/src/media-store/remote.ts +16 -7
  193. package/src/media-store/space-listing.ts +240 -0
  194. package/src/media-store/space.ts +40 -21
  195. package/src/media-store/sync.ts +5 -5
  196. package/src/media-store/tidy.ts +98 -0
  197. package/src/media-store/upload.ts +3 -3
  198. package/src/media-store/webp.ts +66 -0
  199. package/src/messages/model.ts +16 -7
  200. package/src/messages/routes.ts +14 -4
  201. package/src/messages/score.ts +2 -2
  202. package/src/messages/suggest.ts +96 -0
  203. package/src/pages/frame-client.ts +10 -0
  204. package/src/plan/planner.ts +28 -17
  205. package/src/recordings/media-kind.ts +1 -0
  206. package/src/recordings/model.ts +1 -1
  207. package/src/recordings/recorder-app/Capture.swift +9 -7
  208. package/src/reflect/hq-corpus.ts +56 -0
  209. package/src/reflect/prompt-corpus.ts +3 -1
  210. package/src/reflect/transcript.ts +146 -36
  211. package/src/release/machine-words.ts +67 -0
  212. package/src/release/public-clean.ts +8 -3
  213. package/src/releases/from-card.ts +1 -1
  214. package/src/releases/model.ts +18 -0
  215. package/src/releases/routes.ts +10 -5
  216. package/src/releases/store.ts +23 -2
  217. package/src/repo-config.ts +42 -2
  218. package/src/review/anim.ts +2 -2
  219. package/src/review/auto.ts +2 -2
  220. package/src/review/card-db.ts +244 -0
  221. package/src/review/card-rows.ts +266 -0
  222. package/src/review/cells.ts +76 -5
  223. package/src/review/draft-card.ts +41 -0
  224. package/src/review/draft-model.ts +78 -0
  225. package/src/review/format.ts +29 -10
  226. package/src/review/gone.ts +98 -0
  227. package/src/review/inbox-hook.ts +35 -0
  228. package/src/review/marks.ts +1 -1
  229. package/src/review/media-kind.ts +7 -5
  230. package/src/review/media-read.ts +9 -7
  231. package/src/review/media.ts +32 -5
  232. package/src/review/model.ts +214 -45
  233. package/src/review/move.ts +491 -0
  234. package/src/review/notes.ts +12 -20
  235. package/src/review/previews.ts +15 -19
  236. package/src/review/project.ts +1 -1
  237. package/src/review/rev.ts +8 -0
  238. package/src/review/role.ts +1 -1
  239. package/src/review/routes.ts +64 -13
  240. package/src/review/stage-card.ts +8 -4
  241. package/src/review/stage-routes.ts +1 -1
  242. package/src/review/store.ts +529 -83
  243. package/src/review/thread-fold.ts +51 -0
  244. package/src/review/threads.ts +147 -9
  245. package/src/review/trailer-auto-mock.ts +63 -0
  246. package/src/review/trailer-card.ts +4 -4
  247. package/src/review/trailer-desk.ts +41 -7
  248. package/src/review/trailer-media.ts +1 -0
  249. package/src/review/trailer-model.ts +8 -0
  250. package/src/review/trailer-notes.ts +1 -1
  251. package/src/review/trailer-routes.ts +9 -1
  252. package/src/review/unit.ts +6 -6
  253. package/src/review/watchers.ts +1 -1
  254. package/src/rules/untrack-generated.ts +92 -8
  255. package/src/secrets/held.ts +16 -0
  256. package/src/secrets/keychain.ts +113 -0
  257. package/src/secrets/list.ts +16 -6
  258. package/src/secrets/manager.ts +24 -10
  259. package/src/secrets/read.ts +257 -0
  260. package/src/secrets/who-reads.ts +49 -0
  261. package/src/serve/door-forward.ts +268 -0
  262. package/src/serve/door-names.ts +47 -0
  263. package/src/serve/embed.ts +1 -1
  264. package/src/serve/hub-app/activity-view.tsx +56 -32
  265. package/src/serve/hub-app/activity.css +7 -1
  266. package/src/serve/hub-app/asks-page.tsx +48 -0
  267. package/src/serve/hub-app/asks-st.ts +25 -0
  268. package/src/serve/hub-app/clock-svc.ts +1 -2
  269. package/src/serve/hub-app/col-card.tsx +64 -13
  270. package/src/serve/hub-app/col-list-page.tsx +122 -0
  271. package/src/serve/hub-app/col-list-st.ts +103 -0
  272. package/src/serve/hub-app/col-tables-view.tsx +10 -41
  273. package/src/serve/hub-app/col-tables.ts +76 -8
  274. package/src/serve/hub-app/cols-svc.ts +70 -16
  275. package/src/serve/hub-app/database-st.ts +260 -0
  276. package/src/serve/hub-app/database-view.tsx +289 -0
  277. package/src/serve/hub-app/database.css +32 -0
  278. package/src/serve/hub-app/entry-bar.css +14 -0
  279. package/src/serve/hub-app/entry-bar.tsx +33 -0
  280. package/src/serve/hub-app/entry-pick.ts +31 -0
  281. package/src/serve/hub-app/floating.tsx +1 -0
  282. package/src/serve/hub-app/hash-route.ts +11 -1
  283. package/src/serve/hub-app/header-bar.tsx +14 -18
  284. package/src/serve/hub-app/home-st.ts +89 -9
  285. package/src/serve/hub-app/home-strip.css +5 -19
  286. package/src/serve/hub-app/home-strip.tsx +58 -92
  287. package/src/serve/hub-app/home.html +7 -0
  288. package/src/serve/hub-app/hub-app.tsx +31 -142
  289. package/src/serve/hub-app/hub-types.ts +3 -1
  290. package/src/serve/hub-app/hub.css +109 -23
  291. package/src/serve/hub-app/icons.tsx +18 -1
  292. package/src/serve/hub-app/identities-st.ts +56 -6
  293. package/src/serve/hub-app/identities-view.tsx +100 -58
  294. package/src/serve/hub-app/identities.css +17 -15
  295. package/src/serve/hub-app/identity-address.ts +5 -0
  296. package/src/serve/hub-app/inbox-st.ts +41 -24
  297. package/src/serve/hub-app/inbox-view.tsx +37 -41
  298. package/src/serve/hub-app/inbox.css +2 -5
  299. package/src/serve/hub-app/index.html +7 -0
  300. package/src/serve/hub-app/kept-cols.tsx +7 -0
  301. package/src/serve/hub-app/keys.ts +28 -15
  302. package/src/serve/hub-app/later.tsx +26 -0
  303. package/src/serve/hub-app/list-filter.tsx +14 -0
  304. package/src/serve/hub-app/list-walk.ts +72 -3
  305. package/src/serve/hub-app/machines-st.ts +251 -0
  306. package/src/serve/hub-app/machines-view.tsx +224 -0
  307. package/src/serve/hub-app/machines.css +76 -0
  308. package/src/serve/hub-app/md-copy.tsx +79 -0
  309. package/src/serve/hub-app/media-view.tsx +2 -0
  310. package/src/serve/hub-app/messages/messages-page.tsx +79 -7
  311. package/src/serve/hub-app/messages/messages-st.ts +99 -3
  312. package/src/serve/hub-app/messages.css +14 -0
  313. package/src/serve/hub-app/page-keys.ts +175 -0
  314. package/src/serve/hub-app/pages-frames.tsx +11 -3
  315. package/src/serve/hub-app/palette-st.ts +58 -11
  316. package/src/serve/hub-app/palette-view.tsx +3 -1
  317. package/src/serve/hub-app/project-list.css +54 -8
  318. package/src/serve/hub-app/project-list.tsx +128 -59
  319. package/src/serve/hub-app/projects-svc.ts +78 -7
  320. package/src/serve/hub-app/reader-chips.tsx +13 -0
  321. package/src/serve/hub-app/readme-view.tsx +2 -3
  322. package/src/serve/hub-app/readme.css +27 -5
  323. package/src/serve/hub-app/reflections-page.tsx +42 -0
  324. package/src/serve/hub-app/reflections-st.ts +17 -0
  325. package/src/serve/hub-app/releases/releases-page.tsx +25 -2
  326. package/src/serve/hub-app/releases/releases-st.ts +1 -1
  327. package/src/serve/hub-app/repo-sections.ts +9 -5
  328. package/src/serve/hub-app/repo-st.ts +35 -8
  329. package/src/serve/hub-app/review/draft-card.tsx +163 -0
  330. package/src/serve/hub-app/review/kit.tsx +50 -7
  331. package/src/serve/hub-app/review/note-place.ts +1 -1
  332. package/src/serve/hub-app/review/review-board.tsx +2 -2
  333. package/src/serve/hub-app/review/review-cells.tsx +145 -65
  334. package/src/serve/hub-app/review/review-kit.ts +27 -1
  335. package/src/serve/hub-app/review/review-list.tsx +68 -30
  336. package/src/serve/hub-app/review/review-page.tsx +7 -8
  337. package/src/serve/hub-app/review/review-st.ts +111 -24
  338. package/src/serve/hub-app/review/review-thread.tsx +49 -19
  339. package/src/serve/hub-app/review/review-views.tsx +475 -144
  340. package/src/serve/hub-app/review/thread-control-st.ts +115 -0
  341. package/src/serve/hub-app/review/thread-control.tsx +74 -0
  342. package/src/serve/hub-app/review/thread-st.ts +73 -26
  343. package/src/serve/hub-app/review/trailer-card.tsx +1 -1
  344. package/src/serve/hub-app/review/trailer-page.tsx +37 -16
  345. package/src/serve/hub-app/review/trailer-st.ts +41 -7
  346. package/src/serve/hub-app/review.css +267 -61
  347. package/src/serve/hub-app/side-lists.ts +72 -0
  348. package/src/serve/hub-app/sidebar.tsx +6 -3
  349. package/src/serve/hub-app/site/site-part.tsx +2 -8
  350. package/src/serve/hub-app/site/site-st.ts +4 -4
  351. package/src/serve/hub-app/social/comms-page.tsx +20 -5
  352. package/src/serve/hub-app/social/kit.tsx +30 -4
  353. package/src/serve/hub-app/social/post-card.tsx +139 -49
  354. package/src/serve/hub-app/social/serial-writes.ts +13 -0
  355. package/src/serve/hub-app/social/social-model.ts +11 -0
  356. package/src/serve/hub-app/social/social-page.tsx +94 -35
  357. package/src/serve/hub-app/social/social-st.ts +120 -36
  358. package/src/serve/hub-app/social/stage-popup.tsx +1 -1
  359. package/src/serve/hub-app/social/stage-st.ts +1 -1
  360. package/src/serve/hub-app/social/step-layout.ts +1 -1
  361. package/src/serve/hub-app/social.css +3 -0
  362. package/src/serve/hub-app/space-st.ts +209 -0
  363. package/src/serve/hub-app/space-view.tsx +196 -0
  364. package/src/serve/hub-app/space.css +27 -0
  365. package/src/serve/hub-app/stores/stores-page.tsx +91 -23
  366. package/src/serve/hub-app/stores/stores-st.ts +44 -19
  367. package/src/serve/hub-app/stores.css +6 -1
  368. package/src/serve/hub-app/theme-st.ts +22 -9
  369. package/src/serve/hub-app/time-charts.tsx +291 -0
  370. package/src/serve/hub-app/time-pages.tsx +749 -0
  371. package/src/serve/hub-app/time-st.ts +162 -0
  372. package/src/serve/hub-app/time-view.tsx +76 -0
  373. package/src/serve/hub-app/time.css +138 -0
  374. package/src/serve/hub-app/tree-build.ts +52 -42
  375. package/src/serve/hub-app/tree-row.tsx +4 -4
  376. package/src/serve/hub-app/tree-svc.ts +18 -9
  377. package/src/serve/hub-app/urls-svc.ts +154 -0
  378. package/src/serve/hub-app/urls-view.tsx +117 -0
  379. package/src/serve/hub-app/urls.css +30 -0
  380. package/src/serve/hub-app/vault-st.ts +127 -0
  381. package/src/serve/hub-app/vault-view.tsx +154 -0
  382. package/src/serve/hub-app/vault.css +38 -0
  383. package/src/serve/hub-app/veille/veille-st.ts +12 -10
  384. package/src/serve/hub-app/waiting-svc.ts +29 -0
  385. package/src/serve/hub-app/wikis-view.tsx +2 -2
  386. package/src/serve/hub-runtime.ts +15 -2
  387. package/src/serve/project-gutter-route.ts +27 -14
  388. package/src/serve/project-gutter.ts +25 -12
  389. package/src/serve/same-origin.ts +10 -0
  390. package/src/serve/serve-hub.ts +13 -4
  391. package/src/shipkit-files.ts +16 -2
  392. package/src/shipkit.ts +1 -1
  393. package/src/shot/shooter.ts +616 -420
  394. package/src/shot/shot-ask.ts +246 -155
  395. package/src/site/desk.ts +2 -2
  396. package/src/smoke/run-smoke.ts +3 -2
  397. package/src/social/cover.ts +202 -0
  398. package/src/social/discord-layout.ts +37 -13
  399. package/src/social/drafts.ts +3 -0
  400. package/src/social/load.ts +23 -2
  401. package/src/social/media-kind.ts +2 -1
  402. package/src/social/publish/discord.ts +5 -2
  403. package/src/social/publish/secret.ts +2 -2
  404. package/src/social/release-stage.ts +28 -13
  405. package/src/social/routes.ts +26 -1
  406. package/src/social/stage.ts +1 -1
  407. package/src/social/stats.ts +12 -9
  408. package/src/social/strip.ts +4 -1
  409. package/src/social/thumbnail.ts +255 -0
  410. package/src/stores/collection.ts +15 -11
  411. package/src/stores/desk.ts +236 -42
  412. package/src/stores/model.ts +72 -6
  413. package/src/stores/routes.ts +37 -12
  414. package/src/stores/unit.ts +14 -8
  415. package/src/suite/judge-suites.ts +113 -16
  416. package/src/suite/select.ts +45 -3
  417. package/src/suite/suite-cli.ts +81 -34
  418. package/src/trailer/bed.ts +1 -1
  419. package/src/trailer/build.ts +134 -21
  420. package/src/trailer/ffmpeg.ts +7 -0
  421. package/src/trailer/fonts.ts +3 -2
  422. package/src/trailer/grammar.ts +201 -2
  423. package/src/trailer/graph.ts +42 -5
  424. package/src/trailer/look.ts +21 -0
  425. package/src/trailer/mock.ts +154 -0
  426. package/src/trailer/passage.ts +65 -26
  427. package/src/trailer/score/heard.ts +89 -0
  428. package/src/trailer/score/sound.ts +14 -8
  429. package/src/trailer/sound/run.ts +16 -6
  430. package/src/trailer/stitch.ts +26 -5
  431. package/src/trailer/titles.ts +82 -19
  432. package/src/trailer/versions.ts +1 -3
  433. package/src/trailer/vertical.ts +3 -1
  434. package/src/urls/frame.ts +195 -0
  435. package/src/urls/routes.ts +43 -0
  436. package/src/urls/rows.ts +171 -0
  437. package/src/urls/unit.ts +73 -0
  438. package/src/vault/house-keys.ts +42 -0
  439. package/src/vault/layout.ts +50 -0
  440. package/src/vault/policy.ts +165 -0
  441. package/src/vault/vault-audit.ts +276 -0
  442. package/src/vault/vault-client.ts +40 -0
  443. package/src/vault/vault-config.ts +159 -0
  444. package/src/vault/vault-destroy.ts +78 -0
  445. package/src/vault/vault-handover.ts +305 -0
  446. package/src/vault/vault-http.ts +352 -0
  447. package/src/vault/vault-import.ts +208 -0
  448. package/src/vault/vault-init.ts +328 -0
  449. package/src/vault/vault-minter.ts +271 -0
  450. package/src/vault/vault-restore.ts +333 -0
  451. package/src/vault/vault-serve.ts +342 -0
  452. package/src/vault/vault-snapshot.ts +281 -0
  453. package/src/veille/asks.ts +1 -1
  454. package/src/veille/desk.ts +2 -2
  455. package/src/wiki/run-wiki.ts +2 -1
  456. package/src/wiki/scan-md.ts +42 -2
@@ -65,26 +65,32 @@ export const Commit = ({ c, now, old }: { c: ActivityCommit; now: number; old: b
65
65
  </>
66
66
  )
67
67
 
68
- /** the checks behind a red or orange dot, failing first. An answer from
69
- * a daemon that sends no `failing` still names them, by id */
68
+ /** the checks behind a dot, failing first, then agent work, then what waits
69
+ * on the owner. An answer from a daemon that sends no `failing` still names
70
+ * them, by id, and one that sends no `hands` has none */
70
71
  export const failingOf = (r: ActivityRow): StatusCheck[] => {
71
72
  if (r.failing != null) return r.failing
72
73
  const c = r.status
73
74
  if (c == null) return []
74
- const one = (id: string, status: 'fail' | 'warn'): StatusCheck => ({ id, title: id, status, at: c.since[id] ?? null, line: '', lines: [] })
75
- return [...c.reds.map((id) => one(id, 'fail')), ...c.warns.map((id) => one(id, 'warn'))]
75
+ const one = (id: string, status: 'fail' | 'warn', held = false): StatusCheck => ({ id, title: id, status, ...(held ? { held: true as const } : {}), at: c.since[id] ?? null, line: '', lines: [] })
76
+ return [...c.reds.map((id) => one(id, 'fail')), ...c.warns.map((id) => one(id, 'warn')), ...(c.hands ?? []).map((id) => one(id, 'warn', true))]
76
77
  }
77
78
 
78
- /** each failing and warning check: its id (a link to its page), its title,
79
- * how old that outcome is, and every line it printed about it */
80
- export const CheckList = observer(({ app, r }: { app: HomeSt; r: ActivityRow }) => {
79
+ /** the mark of one listed check: failed, agent work, or the inbox icon for what waits on the owner */
80
+ const markOf = (c: StatusCheck): ReactNode => (c.status === 'fail' ? '✗' : c.held === true ? <Icon d={ICON.inbox} /> : '!')
81
+
82
+ /** each listed check: its id (a link to its page), its title, how old that
83
+ * outcome is, and every line it printed about it. `which` keeps the checks
84
+ * an agent can act on, or the ones that wait on the owner; without it, all */
85
+ export const CheckList = observer(({ app, r, which }: { app: HomeSt; r: ActivityRow; which?: 'checks' | 'you' }) => {
81
86
  const now = app.activity.now
87
+ const listed = failingOf(r).filter((c) => which == null || (which === 'you') === (c.held === true))
82
88
  return (
83
89
  <ul className="acchecks">
84
- {failingOf(r).map((c) => (
85
- <li key={c.id} className={c.status === 'fail' ? 'fail' : 'warn'}>
90
+ {listed.map((c) => (
91
+ <li key={c.id} className={c.status === 'fail' ? 'fail' : c.held === true ? 'held' : 'warn'}>
86
92
  <span className="acchkhead">
87
- <span className="acchkmark">{c.status === 'fail' ? '✗' : '!'}</span>
93
+ <span className="acchkmark">{markOf(c)}</span>
88
94
  <a className="acchkid" href={checkAddress(r.name, c.id)} onClick={(e) => {
89
95
  if (!plainClick(e)) return
90
96
  e.preventDefault()
@@ -101,33 +107,51 @@ export const CheckList = observer(({ app, r }: { app: HomeSt; r: ActivityRow })
101
107
  })
102
108
 
103
109
  /** the repo's checks as its own run record last saw them, only the ids it
104
- * declares today: one dot, red, orange or green, with the count behind it.
105
- * Hovering it floats the failing and warning checks; a click lists them
106
- * under the row, so they read without hover too */
110
+ * declares today, in two cells. The first: one dot, red, orange or green,
111
+ * with the count of what failed or of what an agent can clear. The second:
112
+ * the inbox icon and the count of warnings that wait on the owner, which
113
+ * never colour the dot. Each floats its checks at once on hover; a click
114
+ * lists every check under the row, so they read without hover too */
107
115
  const Status = observer(({ app, r, span }: { app: HomeSt; r: ActivityRow; span: number }) => {
108
116
  const c = r.status
109
117
  if (c == null) return (
110
- <td rowSpan={span} className="acstatus acdim">
111
- <Tip content="no shipkit run recorded in this repo yet" placement="right">·</Tip>
112
- </td>
118
+ <>
119
+ <td rowSpan={span} className="acstatus acdim">
120
+ <Tip instant content="no shipkit run recorded in this repo yet" placement="right">·</Tip>
121
+ </td>
122
+ <td rowSpan={span} className="acyou" />
123
+ </>
113
124
  )
114
125
  const n = c.state === 'red' ? c.reds.length : c.state === 'orange' ? c.warns.length : 0
115
126
  const tone = c.state === 'red' ? 'red' : c.state === 'orange' ? 'warn' : 'ok'
116
- if (c.reds.length + c.warns.length === 0) return (
117
- <td rowSpan={span} className={`acstatus t-${tone}`}>
118
- <Tip content="every check passed on its last run" placement="right">●</Tip>
119
- </td>
120
- )
127
+ const hands = c.hands?.length ?? 0
121
128
  const open = app.activity.checksOpen.has(r.name)
129
+ const toggle = (): void => app.activity.toggleChecks(r.name)
122
130
  return (
123
- <td rowSpan={span} className={`acstatus t-${tone}`}>
124
- <Tip content={<CheckList app={app} r={r} />} tipClass="acchktip" interactive placement="right-start" fallbacks={['bottom-start', 'left-start']}>
125
- <button type="button" className={`acdot t-${tone}`} aria-expanded={open} aria-label={`${r.name}: ${c.reds.length} failing, ${c.warns.length} warning, click to ${open ? 'hide' : 'list'} them`}
126
- onClick={() => app.activity.toggleChecks(r.name)}>
127
- ●{n > 0 ? ` ${n}` : ''}
128
- </button>
129
- </Tip>
130
- </td>
131
+ <>
132
+ {c.reds.length + c.warns.length === 0 ? (
133
+ <td rowSpan={span} className={`acstatus t-${tone}`}>
134
+ <Tip instant content={hands > 0 ? 'nothing here for an agent: every check passed, or waits on you' : 'every check passed on its last run'} placement="right">●</Tip>
135
+ </td>
136
+ ) : (
137
+ <td rowSpan={span} className={`acstatus t-${tone}`}>
138
+ <Tip instant content={<CheckList app={app} r={r} which="checks" />} tipClass="acchktip" interactive placement="right-start" fallbacks={['bottom-start', 'left-start']}>
139
+ <button type="button" className={`acdot t-${tone}`} aria-expanded={open} aria-label={`${r.name}: ${c.reds.length} failing, ${c.warns.length} warning, click to ${open ? 'hide' : 'list'} them`} onClick={toggle}>
140
+ ●{n > 0 ? ` ${n}` : ''}
141
+ </button>
142
+ </Tip>
143
+ </td>
144
+ )}
145
+ {hands === 0 ? <td rowSpan={span} className="acyou" /> : (
146
+ <td rowSpan={span} className="acyou">
147
+ <Tip instant content={<><div className="actiphead">waits on you: an ask of this repo holds each line</div><CheckList app={app} r={r} which="you" /></>} tipClass="acchktip" interactive placement="right-start" fallbacks={['bottom-start', 'left-start']}>
148
+ <button type="button" className="acdot" aria-expanded={open} aria-label={`${r.name}: ${hands} waiting on you, click to ${open ? 'hide' : 'list'} them`} onClick={toggle}>
149
+ <Icon d={ICON.inbox} /> {hands}
150
+ </button>
151
+ </Tip>
152
+ </td>
153
+ )}
154
+ </>
131
155
  )
132
156
  })
133
157
 
@@ -167,7 +191,7 @@ const Group = observer(({ app, r, now }: { app: HomeSt; r: ActivityRow; now: num
167
191
  return (
168
192
  <tbody className={`acgrp${idleRow(r) ? ' quiet' : ''}`}>
169
193
  {rows.map((cells, i) => <tr key={i}>{i === 0 ? head : null}{cells}</tr>)}
170
- {st.checksOpen.has(r.name) && failingOf(r).length > 0 ? <tr className="acchkrow"><td colSpan={8}><CheckList app={app} r={r} /></td></tr> : null}
194
+ {st.checksOpen.has(r.name) && failingOf(r).length > 0 ? <tr className="acchkrow"><td colSpan={9}><CheckList app={app} r={r} /></td></tr> : null}
171
195
  </tbody>
172
196
  )
173
197
  })
@@ -211,11 +235,11 @@ export const ActivityView = observer(({ app }: { app: HomeSt }) => {
211
235
  {busy.length + idle.length === 0 ? null : (
212
236
  <table className={`actable${st.stale ? ' stale' : ''}`}>
213
237
  <colgroup>
214
- <col className="c-name" /><col className="c-status" /><col className="c-branch" />
238
+ <col className="c-name" /><col className="c-status" /><col className="c-you" /><col className="c-branch" />
215
239
  <col className="c-fork" /><col className="c-sha" /><col className="c-when" /><col /><col className="c-who" />
216
240
  </colgroup>
217
241
  <thead>
218
- <tr><th>repo</th><th>status</th><th>branch</th><th colSpan={5}>commits, newest first</th></tr>
242
+ <tr><th>repo</th><th>status</th><th>on you</th><th>branch</th><th colSpan={5}>commits, newest first</th></tr>
219
243
  </thead>
220
244
  {busy.map((r) => <Group key={r.name} app={app} r={r} now={now} />)}
221
245
  {idle.map((r) => <Group key={r.name} app={app} r={r} now={now} />)}
@@ -25,7 +25,7 @@ button.acpill:disabled{cursor:default}
25
25
  .acgrp tr:first-child td{padding-top:var(--s1)}
26
26
  .acgrp tr:last-child td{padding-bottom:var(--s1)}
27
27
  .acgrp:hover{background:var(--panel)}
28
- .actable{--acname-w:170px}.actable,.acchktip{--acmark-w:10px}.c-name{width:var(--acname-w)}.c-status{width:52px}.c-branch{width:150px}
28
+ .actable{--acname-w:170px}.actable,.acchktip{--acmark-w:14px}.c-name{width:var(--acname-w)}.c-status{width:52px}.c-you{width:56px}.c-branch{width:150px}
29
29
  .c-sha{width:72px}.c-when{width:56px}.c-who{width:90px}
30
30
  .acrepo{display:inline-flex;align-items:center;gap:var(--s1);max-width:100%;color:var(--ink);text-decoration:none}
31
31
  .acrepo span{overflow:hidden;text-overflow:ellipsis}
@@ -36,6 +36,10 @@ button.acpill:disabled{cursor:default}
36
36
  /* the status dot is a button: hover floats its checks, a click lists them under the row */
37
37
  .acdot{border:0;background:none;padding:0 var(--s1);margin:0 calc(-1 * var(--s1));font:inherit;font-variant-numeric:tabular-nums;color:inherit;cursor:pointer;border-radius:3px}
38
38
  .acdot:hover,.acdot[aria-expanded="true"]{background:var(--panel2)}
39
+ /* what waits on the owner: its own column, the inbox icon and a count, never the dot's colour */
40
+ .acyou{white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--dim)}
41
+ .acyou .hico{width:14px;height:14px;vertical-align:-2px}
42
+ .actiphead{color:var(--dim);margin-bottom:var(--s1)}
39
43
  .acchktip{z-index:40;max-width:560px;max-height:60vh;overflow:auto;background:var(--panel2);border:1px solid var(--line);border-radius:3px;box-shadow:0 2px 10px var(--shadow);padding:var(--s1) var(--s2);color:var(--ink);font-size:12px}
40
44
  .acchecks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--s1);white-space:normal}
41
45
  .acchecks li{display:flex;flex-direction:column;min-width:0}
@@ -43,6 +47,8 @@ button.acpill:disabled{cursor:default}
43
47
  .acchkmark{flex:none;width:var(--acmark-w)}
44
48
  .acchecks .fail .acchkmark,.acchecks .fail .acchkid{color:var(--red)}
45
49
  .acchecks .warn .acchkmark,.acchecks .warn .acchkid{color:var(--warn)}
50
+ .acchecks .held .acchkid{color:var(--dim)}
51
+ .acchkmark .hico{width:12px;height:12px;vertical-align:-2px}
46
52
  .acchkid{flex:none;font:11.5px ui-monospace,Menlo,monospace;text-decoration:none}
47
53
  .acchkid:hover{text-decoration:underline}
48
54
  .acchktitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@@ -0,0 +1,48 @@
1
+ // a repo's asks page: its asks on the left, the one picked on the right, whole (col-list-page.tsx draws both). This
2
+ // file holds what is the asks' own: the row, the bands' names and the page's words
3
+ import { observer } from 'mobx-react-lite'
4
+ import { afterWords } from '../../asks/ask-after.ts'
5
+ import { askAt, askFactWords, isClosedAsk, isLaterAsk, type AskGroupKey } from './col-tables.ts'
6
+ import { ColListPage, type ColListWords } from './col-list-page.tsx'
7
+ import { openAsks } from './asks-st.ts'
8
+ import type { Resource } from './hub-types.ts'
9
+ import { Icon, ICON } from './icons.tsx'
10
+ import type { RepoSt } from './repo-st.ts'
11
+ import { ageWords, stampWords } from './time-ago.tsx'
12
+ import { useInSight } from './tree-row.tsx'
13
+
14
+ /** a row of the list, the app's list row: its title, its age at its end in short (`70d`, the full stamp on hover), a
15
+ * later ask the day it waits for instead; a closed ask dimmed */
16
+ const AskRow = observer(({ app, r, on }: { app: RepoSt; r: Resource; on: boolean }) => {
17
+ const el = useInSight<HTMLButtonElement>(on)
18
+ const at = askAt(r)
19
+ const after = isLaterAsk(r) && r.ask?.after != null ? afterWords(r.ask.after) : null
20
+ return (
21
+ <button ref={el} type="button" className={`lrow${on ? ' on' : ''}${isClosedAsk(r) ? ' off' : ''}`} data-k={r.id} aria-current={on ? 'page' : undefined}
22
+ title={[r.title, ...askFactWords(r), r.file ?? ''].filter((x) => x !== '').join('\n')} onClick={() => app.asks.open(r.id)}>
23
+ <Icon d={ICON.asks} />
24
+ <span className="lgrow">{r.title}</span>
25
+ {after != null ? <span className="ldim lnum" title={after}>{after.replace(/^after /, '')}</span>
26
+ : at == null ? null : <span className="ldim lnum" title={stampWords(at)}>{ageWords(at, app.clock.now).replace(/ ago$/, '')}</span>}
27
+ </button>
28
+ )
29
+ })
30
+
31
+ const openWords = (n: number): string => (n === 0 ? 'asks · none open' : `asks · ${n} open`)
32
+
33
+ const WORDS: ColListWords<AskGroupKey> = {
34
+ search: 'search the asks',
35
+ nav: 'the asks of this repo',
36
+ band: { open: 'open', later: 'later', done: 'done', declined: 'declined by you' },
37
+ none: 'No ask yet.',
38
+ noMatch: 'No ask matches.',
39
+ reading: 'reading the asks…',
40
+ nothingShown: (total) => (total === 0 ? 'No ask yet: nothing has ever waited on a human here. An agent writes one with sk ask.' : 'No open ask: nothing waits on a human here.'),
41
+ phoneTop: (st) => openWords(openAsks(st.all)),
42
+ back: '◂ asks',
43
+ }
44
+ const PANELS = { cols: 'asks', list: 'asks-list', shown: 'asks-ask' }
45
+
46
+ export const AsksPage = observer(({ app }: { app: RepoSt }) => (
47
+ <ColListPage app={app} st={app.asks} words={WORDS} panels={PANELS} row={(r, on) => <AskRow app={app} r={r} on={on} />} />
48
+ ))
@@ -0,0 +1,25 @@
1
+ // the asks page's list (col-list-st.ts): every ask of the repo under its band (open by what it blocks, the oldest
2
+ // first; done after, folded by default), searched by its title, text, file and facts. The bare page shows the first
3
+ // open ask
4
+ import { askFactWords, askGroups, type AskGroupKey } from './col-tables.ts'
5
+ import { bandOf, onList, type ColList } from './col-list-st.ts'
6
+ import type { HashSel } from './hash-route.ts'
7
+ import type { Resource } from './hub-types.ts'
8
+
9
+ export const ASKS = 'asks'
10
+
11
+ /** the address shows the asks page: the page itself, or one ask of it */
12
+ export const onAsks = (sel: HashSel | null): boolean => onList(sel, ASKS)
13
+
14
+ /** a band's fold, under the key the viewer's choice was kept by before: `asks:done` open stays open */
15
+ export const bandKey = (g: AskGroupKey): string => bandOf(ASKS, g)
16
+
17
+ export const ASK_LIST: ColList<AskGroupKey> = {
18
+ col: ASKS,
19
+ groups: askGroups,
20
+ words: (r) => [r.title, r.text, r.file ?? '', ...askFactWords(r)],
21
+ first: 'open',
22
+ }
23
+
24
+ /** how many asks wait on a human now */
25
+ export const openAsks = (all: readonly Resource[]): number => askGroups(all).find((g) => g.key === 'open')?.rows.length ?? 0
@@ -8,8 +8,7 @@ import { makeAutoObservable, runInAction } from 'mobx'
8
8
 
9
9
  export class ClockSvc {
10
10
  now = Date.now()
11
- /** the live interval, or null. A second start is a no-op rather than a
12
- * second timer, because boot runs under StrictMode twice in dev */
11
+ /** the live interval, or null. A second start is a no-op rather than a second timer */
13
12
  running: ReturnType<typeof setInterval> | null = null
14
13
 
15
14
  constructor() {
@@ -1,4 +1,4 @@
1
- // Collection views: the item card (asks · creds), and the health/status card with the streaming
1
+ // Collection views: the item card (an ask, a cred), and the health/status card with the streaming
2
2
  // check runner. Every verb posts to /api/act/* and lands in a git-tracked
3
3
  // truth file; the truth chip names the file the item IS (on disagreement
4
4
  // the file wins).
@@ -6,7 +6,12 @@ import { runInAction } from 'mobx'
6
6
  import { observer } from 'mobx-react-lite'
7
7
  import type { RepoSt } from './repo-st.ts'
8
8
  import type { Resource } from './hub-types.ts'
9
- import { renderMd } from './md.ts'
9
+ import { CopyMd } from './md-copy.tsx'
10
+ import { askAt, askFactWords, heldWords, isDeclinedAsk, isDoneAsk } from './col-tables.ts'
11
+ import { TimeAgo } from './time-ago.tsx'
12
+ import { ReaderChips } from './reader-chips.tsx'
13
+ import type { Readers } from '../../collections/collection-types.ts'
14
+ import { ThreadControl } from './review/thread-control.tsx'
10
15
 
11
16
  // creds carry no truth file: the name is the id, the words after it are the
12
17
  // service and what its probe last said, and the slot says present or missing
@@ -23,6 +28,27 @@ const CredHead = ({ cred }: { cred: ReturnType<typeof credOf> }) => (
23
28
  </>
24
29
  )
25
30
 
31
+ /** an ask's facts under its title: its kind, what it blocks, how it closes, since when */
32
+ const AskFacts = observer(({ app, i }: { app: RepoSt; i: Resource }) => {
33
+ const at = askAt(i)
34
+ return (
35
+ <div className="creddesc">
36
+ {askFactWords(i).join(' · ')}
37
+ {at == null ? null : <>{' · '}{isDoneAsk(i) ? 'done' : isDeclinedAsk(i) ? 'declined by you' : 'asked'} <TimeAgo clock={app.clock} at={at} /></>}
38
+ </div>
39
+ )
40
+ })
41
+
42
+ /** the secrets an ask stores with a command of its body, each with who will read it */
43
+ const StoredBy = ({ names, readers }: { names: string[]; readers: Record<string, Readers> | undefined }) =>
44
+ names.length === 0 ? null : (
45
+ <div className="creds">{names.map((name) => (
46
+ <div className="credrow" key={name}>
47
+ <div className="credhead"><span className="credname">{name}</span><ReaderChips who={readers?.[name]} lead="who will read it" /></div>
48
+ </div>
49
+ ))}</div>
50
+ )
51
+
26
52
  export const ColCard = observer(({ app, col, id }: { app: RepoSt; col: string; id: string }) => {
27
53
  const c = app.cols
28
54
  const i = c.find(col, id)
@@ -36,12 +62,13 @@ export const ColCard = observer(({ app, col, id }: { app: RepoSt; col: string; i
36
62
  <div className="colcard">
37
63
  <h3>
38
64
  <CredHead cred={cred} />
65
+ <ReaderChips who={i.who} lead="who can read it" />
39
66
  {i.artifact?.url != null ? <a className="mint" href={i.artifact.url} target="_blank" rel="noreferrer">mint ↗</a> : null}
40
67
  </h3>
41
68
  {cred.service != null ? <div className="creddesc">{cred.service}</div> : null}
42
69
  {/* probe FAIL + fix: pointers ride the instance md — for an
43
70
  ask-covered cred (no verbs, no artifact) it is the ONLY detail */}
44
- {i.md != null ? <div className="md" dangerouslySetInnerHTML={{ __html: renderMd(i.md) }} /> : null}
71
+ {i.md != null ? <CopyMd md={i.md} /> : null}
45
72
  {cred.missing && i.artifact?.copy != null ? (
46
73
  <>
47
74
  <code>{i.artifact.copy}</code>
@@ -57,8 +84,10 @@ export const ColCard = observer(({ app, col, id }: { app: RepoSt; col: string; i
57
84
  <h3>
58
85
  <span className={`tl ${i.state}`}>{i.text}</span>
59
86
  {i.file != null ? <span className="truth">{i.file}</span> : null}
87
+ {askFile != null ? <ThreadControl st={app} address={`ask:${askFile}`} name={i.text} /> : null}
60
88
  </h3>
61
- {i.md != null ? <div className="md" dangerouslySetInnerHTML={{ __html: renderMd(i.md) }} /> : null}
89
+ {askFile != null ? <AskFacts app={app} i={i} /> : null}
90
+ {i.md != null ? <CopyMd md={i.md} /> : null}
62
91
  {i.remarks != null && i.remarks.length > 0 ? <div className="rem">{i.remarks.join('\n')}</div> : null}
63
92
  {i.artifact?.copy != null ? (
64
93
  <>
@@ -68,20 +97,42 @@ export const ColCard = observer(({ app, col, id }: { app: RepoSt; col: string; i
68
97
  ) : null}
69
98
  {i.artifact?.url != null ? <div className="row"><a href={i.artifact.url} target="_blank" rel="noreferrer">mint ↗</a></div> : null}
70
99
  {i.artifact?.steps != null ? <div className="row"><div>{i.artifact.steps.map((s, n) => <span key={n}>{n + 1}. {s}<br /></span>)}</div></div> : null}
71
- {/* a credential ask takes its value here: a password field per secret it names, sent once, never shown */}
72
- {askFile != null && i.severity != null ? (i.ask?.secrets ?? []).map((name) => (
73
- <div className="row" key={name}>
74
- <input type="password" autoComplete="off" spellCheck={false} placeholder={`paste the token for ${name}`} value={c.secretDrafts.get(name) ?? ''}
75
- onChange={(e) => c.setSecretDraft(name, e.target.value)}
76
- onKeyDown={(e) => { if (e.key === 'Enter') void c.storeSecret(askFile, name) }} />
77
- <button onClick={() => void c.storeSecret(askFile, name)}>store</button>
78
- </div>
79
- )) : null}
100
+ {/* a credential ask takes its value here: a row per secret it names, its state in the store, a password field sent once, never shown */}
101
+ {askFile != null && i.severity != null && (i.ask?.secrets ?? []).length > 0 ? <div className="creds">{i.ask!.secrets.map((name) => {
102
+ const h = heldWords(c.secretHeld.get(name) ?? i.ask?.held?.[name], i.ask?.created, app.clock.now)
103
+ const err = c.secretErrs.get(name)
104
+ const login = (i.ask?.logins ?? []).includes(name)
105
+ const account = c.secretAccounts.get(name) ?? i.ask?.accounts?.[name]
106
+ return (
107
+ <div className="credrow" key={name}>
108
+ <div className="credhead">
109
+ <span className="credname">{name}</span>
110
+ <ReaderChips who={i.ask?.readers?.[name]} lead="who will read it" />
111
+ {login && account != null ? <span className="credaccount">account: {account}</span> : null}
112
+ <span className={`credheld ${h.tone}`}>{h.words}</span>
113
+ </div>
114
+ <div className="row">
115
+ {login ? <input className="credacct" type="text" autoComplete="off" spellCheck={false} placeholder="account (the email or user name you sign in with)" value={c.accountDrafts.get(name) ?? ''}
116
+ onChange={(e) => c.setAccountDraft(name, e.target.value)}
117
+ onKeyDown={(e) => { if (e.key === 'Enter') void c.storeSecret(askFile, name, true) }} /> : null}
118
+ <input type="password" autoComplete="off" spellCheck={false} placeholder={login ? 'password' : h.tone === 'red' ? `paste the value of ${name}` : 'paste a new value'} value={c.secretDrafts.get(name) ?? ''}
119
+ onChange={(e) => c.setSecretDraft(name, e.target.value)}
120
+ onKeyDown={(e) => { if (e.key === 'Enter') void c.storeSecret(askFile, name, login) }} />
121
+ <button onClick={() => void c.storeSecret(askFile, name, login)}>store</button>
122
+ </div>
123
+ {err != null ? <div className="err">✗ {err}</div> : null}
124
+ </div>
125
+ )
126
+ })}</div> : null}
127
+ {/* a secret its body stores with a command line (an older ask): who will read it, said before he runs it */}
128
+ {askFile != null && i.severity != null ? <StoredBy names={(i.ask?.stores ?? []).filter((n) => !(i.ask?.secrets ?? []).includes(n))} readers={i.ask?.readers} /> : null}
80
129
  {c.secretNote !== '' ? <div className="said">✓ {c.secretNote}</div> : null}
81
130
  {askFile != null && i.severity != null ? (
82
131
  <div className="row">
83
132
  <input placeholder="proof URL (optional)" value={c.proofDraft} onChange={(e) => runInAction(() => { c.proofDraft = e.target.value })} />
84
133
  <button onClick={() => void c.askDone(askFile)}>done ✓</button>
134
+ <button className="ghost" title="close it as declined: nothing asks it again, nothing waits on you for it. A remark below is kept as your reason. To undo, set its status back to open in the file"
135
+ onClick={() => void c.askDecline(askFile)}>I will not do this</button>
85
136
  </div>
86
137
  ) : null}
87
138
  {askFile != null ? (
@@ -0,0 +1,122 @@
1
+ // a collection's own list page (asks, reflections): its rows on the left under their bands, the one picked on the
2
+ // right, whole, as its card draws it (col-card.tsx). On a phone one pane at a time: the list, or the row with the way
3
+ // back to it.
4
+ //
5
+ // The constraint a reader breaks first: nothing here is drawn its own way. The rows and bands are the app's list rows
6
+ // (hub.css .lrow, .lband through social/kit.tsx KeptBand), the column and its filter the review's (review.css
7
+ // .rv-listcol, list-filter.tsx), and tests/asks-page.test.tsx fails a sheet rule that gives them a look of their own
8
+ import { observer } from 'mobx-react-lite'
9
+ import { Fragment, type ReactNode } from 'react'
10
+ import { Panel, Separator } from 'react-resizable-panels'
11
+ import { ColCard } from './col-card.tsx'
12
+ import type { ColListSt } from './col-list-st.ts'
13
+ import type { Resource } from './hub-types.ts'
14
+ import { KeptCols, LIST_COL } from './kept-cols.tsx'
15
+ import { ListFilter } from './list-filter.tsx'
16
+ import type { RepoSt } from './repo-st.ts'
17
+ import { PANEL, PhoneTop } from './review/review-page.tsx'
18
+ import { KeptBand } from './social/kit.tsx'
19
+
20
+ export type ColListWords<K extends string> = {
21
+ /** the filter's placeholder and label */
22
+ search: string
23
+ /** the list's name for a screen reader */
24
+ nav: string
25
+ band: Record<K, string>
26
+ /** the list with no row at all, and with none the filter keeps */
27
+ none: string
28
+ noMatch: string
29
+ reading: string
30
+ /** the right side with no row shown: `total` rows exist */
31
+ nothingShown: (total: number) => string
32
+ /** a phone: the line above the list, and the way back to it */
33
+ phoneTop: (st: ColListSt<K>) => string
34
+ back: string
35
+ }
36
+
37
+ type Props<K extends string> = {
38
+ app: RepoSt
39
+ st: ColListSt<K>
40
+ words: ColListWords<K>
41
+ /** one row of the list: the app's list row (`.lrow`), `on` for the one shown */
42
+ row: (r: Resource, on: boolean) => ReactNode
43
+ /** the ids its column widths are kept by */
44
+ panels: { cols: string; list: string; shown: string }
45
+ }
46
+
47
+ const List = observer(<K extends string>({ app, st, words, row }: Props<K>) => {
48
+ const cur = st.currentId
49
+ const groups = st.groups
50
+ return (
51
+ <div className="rv-listcol">
52
+ <div className="rv-filters">
53
+ <ListFilter side={st.side} value={st.query} set={(v) => st.setQuery(v)} keep={(el) => { st.searchEl = el }} placeholder={words.search} label={words.search} />
54
+ </div>
55
+ <nav className="rv-listscroll" aria-label={words.nav}>
56
+ {groups.map((g) => {
57
+ // a folded band still shows the row shown
58
+ const open = st.isOpen(st.band(g.key), !g.foldedByDefault)
59
+ const rows = (open ? g.rows : g.rows.filter((r) => r.id === cur)).map((r) => <Fragment key={r.id}>{row(r, r.id === cur)}</Fragment>)
60
+ return (
61
+ <Fragment key={g.key}>
62
+ <KeptBand so={st} card={st.band(g.key)} title={words.band[g.key]} n={g.rows.length} open={!g.foldedByDefault}>
63
+ <div className="lrows">{rows}</div>
64
+ </KeptBand>
65
+ {open || rows.length === 0 ? null : <div className="lrows">{rows}</div>}
66
+ </Fragment>
67
+ )
68
+ })}
69
+ {groups.length > 0 || !app.cols.loaded ? null : <div className="rv-empty">{st.all.length === 0 ? words.none : words.noMatch}</div>}
70
+ </nav>
71
+ </div>
72
+ )
73
+ })
74
+
75
+ /** the row shown, whole; a plain line when none is open */
76
+ const Shown = observer(<K extends string>({ app, st, words }: Props<K>) => {
77
+ const id = st.currentId
78
+ if (!app.cols.loaded && !app.cols.cached) return <div className="rv-empty"><span className="spin" /> {words.reading}</div>
79
+ if (id != null) return <div className="stagewrap"><ColCard app={app} col={st.list.col} id={id} /></div>
80
+ return (
81
+ <div className="stagewrap">
82
+ <div className="ph">{words.nothingShown(st.all.length)}</div>
83
+ </div>
84
+ )
85
+ })
86
+
87
+ export const ColListPage = observer(<K extends string>(p: Props<K>) => {
88
+ const { app, st, words, panels } = p
89
+ if (app.home.layout.narrow) {
90
+ const sel = app.sel
91
+ const one = sel?.t === 'item' && sel.col === st.list.col ? sel.id : null
92
+ return (
93
+ <div className="rv-phone">
94
+ {one == null ? (
95
+ <>
96
+ <PhoneTop app={app} what={words.phoneTop(st)} />
97
+ <div className="rv-phonepane"><List {...p} /></div>
98
+ </>
99
+ ) : (
100
+ <>
101
+ <div className="rv-phonetop">
102
+ <button className="ghost" onClick={() => app.showCol(st.list.col)}>{words.back}</button>
103
+ <b>{app.name}</b>
104
+ </div>
105
+ <div className="rv-phonepane"><Shown {...p} /></div>
106
+ </>
107
+ )}
108
+ </div>
109
+ )
110
+ }
111
+ return (
112
+ <KeptCols id={panels.cols} folds={{ left: panels.list }} layout={app.home.layout}>
113
+ <Panel id={panels.list} {...LIST_COL} className="rv-pane" style={PANEL}>
114
+ <List {...p} />
115
+ </Panel>
116
+ <Separator className="rsep" />
117
+ <Panel id={panels.shown} defaultSize="72%" minSize={340} className="rv-pane" style={PANEL}>
118
+ <Shown {...p} />
119
+ </Panel>
120
+ </KeptCols>
121
+ )
122
+ })
@@ -0,0 +1,103 @@
1
+ // a collection's own list page (asks, reflections): every row of the collection under its band, its filter, and the
2
+ // row shown. The address names the row (`item:<col>:<id>`); the bare page (`col:<col>`) shows the first row of the
3
+ // list's first band. What differs between two such pages is a ColList, never a second state class
4
+ import { makeAutoObservable } from 'mobx'
5
+ import type { TableGroup } from './col-tables.ts'
6
+ import type { HashSel } from './hash-route.ts'
7
+ import type { Resource } from './hub-types.ts'
8
+ import { sideOf, type SideList } from './list-walk.ts'
9
+ import type { RepoSt } from './repo-st.ts'
10
+ import type { Folds } from './social/kit.tsx'
11
+
12
+ export type ColList<K extends string> = {
13
+ /** the collection listed, its id in the address */
14
+ col: string
15
+ /** the bands in the order drawn, each with its rows in order; a band with no row is left out */
16
+ groups: (rows: readonly Resource[]) => TableGroup<K>[]
17
+ /** the words the filter reads of a row */
18
+ words: (r: Resource) => string[]
19
+ /** the band whose first row the bare page shows; without it, the first band drawn */
20
+ first?: K
21
+ }
22
+
23
+ /** the address shows the list page of a collection: the page itself, or one row of it */
24
+ export const onList = (sel: HashSel | null, col: string): boolean => (sel?.t === 'col' && sel.id === col) || (sel?.t === 'item' && sel.col === col)
25
+
26
+ /** a band's fold, under the key the viewer's choice is kept by: `asks:done` */
27
+ export const bandOf = (col: string, g: string): string => `${col}:${g}`
28
+
29
+ export class ColListSt<K extends string> implements Folds {
30
+ /** the list's filter, typed in its field */
31
+ query = ''
32
+ /** the filter field, `/` focuses it */
33
+ searchEl: HTMLInputElement | null = null
34
+
35
+ constructor(private st: RepoSt, readonly list: ColList<K>) {
36
+ makeAutoObservable<this, 'st'>(this, { st: false, searchEl: false, list: false })
37
+ }
38
+
39
+ /** the page shows: the list page itself, or one row of it */
40
+ get shown(): boolean {
41
+ return onList(this.st.sel, this.list.col)
42
+ }
43
+
44
+ /** every row of the collection */
45
+ get all(): Resource[] {
46
+ return this.st.cols.resources.filter((r) => r.collection === this.list.col)
47
+ }
48
+
49
+ /** the bands as drawn, the filter applied */
50
+ get groups(): TableGroup<K>[] {
51
+ const q = this.query.trim().toLowerCase()
52
+ return this.list.groups(q === '' ? this.all : this.all.filter((r) => this.list.words(r).some((x) => x.toLowerCase().includes(q))))
53
+ }
54
+
55
+ /** the row the address names, else the first of the list's first band; null with none there */
56
+ get currentId(): string | null {
57
+ const s = this.st.sel
58
+ if (s?.t === 'item' && s.col === this.list.col) return s.id
59
+ const all = this.list.groups(this.all)
60
+ return (this.list.first == null ? all[0] : all.find((g) => g.key === this.list.first))?.rows[0]?.id ?? null
61
+ }
62
+
63
+ band(g: K): string {
64
+ return bandOf(this.list.col, g)
65
+ }
66
+
67
+ /** the rows the arrows walk, in the order drawn: a folded band hides its own, never the one shown */
68
+ get visible(): Resource[] {
69
+ const cur = this.currentId
70
+ return this.groups.flatMap((g) => g.rows.filter((r) => r.id === cur || this.isOpen(this.band(g.key), !g.foldedByDefault)))
71
+ }
72
+
73
+ /** a band shows its rows: a filter shows every match, else as the viewer left it, `init` before */
74
+ isOpen(card: string, init: boolean): boolean {
75
+ if (this.query.trim() !== '') return true
76
+ const folded = this.st.cols.tableFolds.get(card)
77
+ return folded == null ? init : !folded
78
+ }
79
+
80
+ flipFold(card: string, init: boolean): void {
81
+ if (this.query.trim() !== '') return
82
+ this.st.cols.setGroupFolded(card, this.isOpen(card, init))
83
+ }
84
+
85
+ setQuery(v: string): void {
86
+ this.query = v
87
+ }
88
+
89
+ /** a click on a row: it shows on the right, and the address names it */
90
+ open(id: string): void {
91
+ this.st.cols.select(this.list.col, id)
92
+ }
93
+
94
+ /** the list as its keys walk it (list-walk.ts): a walk of the arrows is one history entry */
95
+ get side(): SideList {
96
+ return sideOf({
97
+ ids: () => this.visible.map((r) => r.id),
98
+ current: () => this.currentId,
99
+ open: (id) => this.st.walk(() => this.open(id)),
100
+ filter: () => this.searchEl,
101
+ })
102
+ }
103
+ }