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
@@ -1,18 +1,19 @@
1
- // the cells of a thread, one framed card each (wiki tools/shipkit/review.md, The review page): a header bar (who, when,
1
+ // the cells of a thread, one framed card each (wiki tools/shipkit/threads.md, The review page): a header bar (who, when,
2
2
  // the kind, `v2`, fold, copy the id), then the body, or one line of summary when folded. A folded cell draws no media.
3
3
  // A version holds its words and its views, a verdict points back at the version it judged and lists his notes (a
4
4
  // click shows the view they sit on), a reply and a note are words; a run of state changes is one thin line
5
5
  import { observer } from 'mobx-react-lite'
6
6
  import type { EventCell, NoteCell, ReplyCell, VerdictCell, VersionCell } from '../../../review/cells.ts'
7
- import { isGallery, isTrailerCard, STATUS_LABEL, UPDATE_WORDS, viewName, viewTag, type Item, type Rect, type TrailerCard } from '../../../review/model.ts'
7
+ import { isDraftCard, isGallery, isTrailerCard, postLabel, STATUS_LABEL, thumbFileOf, UPDATE_WORDS, viewName, viewTag, type Item, type Rect, type TrailerCard } from '../../../review/model.ts'
8
8
  import { Caret, Icon, ICON } from '../icons.tsx'
9
9
  import { renderMd } from '../md.ts'
10
10
  import { ageWords, stampWords } from '../time-ago.tsx'
11
11
  import { KindView, AnimPanel } from './kind-view.tsx'
12
- import { keepFocus, laneColor, REACTIONS, secs, SIDE_LABEL, toneOf } from './kit.tsx'
12
+ import { keepFocus, laneColor, PreviewImg, REACTIONS, secs, SIDE_LABEL, toneOf, VERDICTS } from './kit.tsx'
13
13
  import type { ReviewSt } from './review-st.ts'
14
14
  import { VersionViews, ViewCell } from './review-views.tsx'
15
- import { cellDom, type Framed, type ThreadSt } from './thread-st.ts'
15
+ import { cellDom, viewKind, type Framed, type ThreadSt } from './thread-st.ts'
16
+ import { DraftCardBody } from './draft-card.tsx'
16
17
  import { NoteMeta, NoteStill, TrailerCardBody } from './trailer-card.tsx'
17
18
 
18
19
  /** who a cell is from, as its header says it: you, a player, or the agent's lane */
@@ -45,77 +46,85 @@ export const When = observer(({ rv, at }: { rv: ReviewSt; at: string }) => {
45
46
 
46
47
  const KIND_LABEL: Record<Framed['kind'], string> = { version: 'version', verdict: 'verdict', reply: 'reply', note: 'note' }
47
48
 
48
- /** one framed cell: its header bar, then its body, or its summary when folded */
49
- export const CellFrame = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c: Framed }) => {
49
+ /** one message of the discussion: who speaks as a round mark beside it (the agents on the left, the owner's words
50
+ * on the right), a light line with the name, the kind and the time, then the bubble, or its one line when folded. `cont`: the
51
+ * same speaker as the message above, so its mark and name are not drawn again */
52
+ export const CellFrame = observer(({ rv, card, c, cont }: { rv: ReviewSt; card: ThreadSt; c: Framed; cont?: boolean }) => {
50
53
  const open = card.isOpen(c)
51
54
  const head = card.head?.id === c.id
52
55
  const unread = (c.kind === 'reply' || c.kind === 'note') && c.party === 'agent' && !c.read
53
- const tone = c.kind === 'version' ? toneOf(c.status) : c.kind === 'verdict' ? toneOf(c.verdict) : ''
56
+ const tone = c.kind === 'version' ? toneOf(c.status) : c.kind === 'verdict' ? toneOf(c.verdict) : c.kind === 'reply' && c.update ? `upd up-${c.update.state}` : ''
54
57
  return (
55
- <article id={cellDom(c.id)} data-unread={unread ? c.id : undefined} className={`rv-c k-${c.kind} p-${c.party}${open ? '' : ' folded'}${head ? ' head' : ''} ${tone}`}>
56
- <header className="rv-chead" onClick={() => card.toggleCell(c)}>
57
- <button className="rv-foldbtn" aria-label={open ? 'fold' : 'unfold'} aria-expanded={open} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.toggleCell(c) }}><Caret open={open} /></button>
58
- <Avatar who={c.who} />
59
- {avatarText(c.who) === whoWords(c.who) ? null : <b className="rv-cwho">{whoWords(c.who)}</b>}
60
- <span className="rv-ckind">{c.kind === 'version' ? `v${c.n}` : c.kind === 'reply' && c.op ? (c.op === 'ask' ? 'question' : 'answer') : c.kind === 'reply' && c.update ? `update ${c.update.k}` : c.kind === 'reply' && c.re ? `hint on update ${c.re.k}` : KIND_LABEL[c.kind]}</span>
61
- {c.kind === 'version' ? <span className="rv-badge">{STATUS_LABEL[c.status]}</span> : null}
62
- {c.kind === 'reply' && c.update ? <span className={`rv-badge rv-up up-${c.update.state}`}>{UPDATE_WORDS[c.update.state]}</span> : null}
63
- {c.kind === 'verdict' ? <span className="rv-badge">{STATUS_LABEL[c.verdict]}</span> : null}
64
- {c.kind === 'verdict' ? (
65
- <button className="rv-on ghost" title={c.n > 0 ? `the version this answers: v${c.n}` : 'the note this answers'} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.reveal(c.on) }}>↑ on {c.n > 0 ? `v${c.n}` : 'the note'}</button>
66
- ) : c.kind !== 'version' && c.on !== c.id && c.on !== card.data?.head ? (
67
- <button className="rv-on ghost" title="the item this was said on" onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.reveal(c.on) }}>↑ on {onWords(card, c.on)}</button>
68
- ) : null}
69
- {head ? <span className="rv-headtag" title="your verdict and your reply go to this one">answer here</span> : null}
70
- {unread ? <span className="rv-unread" title="not read yet" /> : null}
71
- <span className="sp" />
72
- <When rv={rv} at={c.at} />
73
- <button className="rv-copyid ghost" title={`copy the id: ${c.id}`} aria-label="copy the id" onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); void rv.copyId(c.id) }}>
74
- <Icon d={ICON.copy} />
75
- </button>
76
- </header>
77
- {open ? (
78
- <div className="rv-cbody">
79
- {c.kind === 'version' ? <VersionBody rv={rv} card={card} c={c} /> : c.kind === 'verdict' ? <VerdictBody card={card} c={c} /> : c.kind === 'reply' ? <ReplyBody rv={rv} card={card} c={c} /> : <NoteBody rv={rv} c={c} />}
80
- </div>
81
- ) : (
82
- <div className="rv-csum" onClick={() => card.toggleCell(c)}>{c.summary || '·'}</div>
83
- )}
58
+ <article id={cellDom(c.id)} data-unread={unread ? c.id : undefined} className={`rv-c k-${c.kind} p-${c.party}${open ? '' : ' folded'}${head ? ' head' : ''}${cont ? ' cont' : ''} ${tone}`}>
59
+ <Avatar who={c.who} />
60
+ <div className="rv-msg">
61
+ <header className="rv-chead" onClick={() => card.toggleCell(c)}>
62
+ {cont ? null : <b className="rv-cwho">{whoWords(c.who)}</b>}
63
+ <span className="rv-ckind">{c.kind === 'version' ? `v${c.n}` : c.kind === 'reply' && c.ask ? 'question' : c.kind === 'reply' && c.propose ? 'proposed change' : c.kind === 'reply' && c.answers ? 'answer' : c.kind === 'reply' && c.op ? (c.op === 'ask' ? 'question' : 'answer') : c.kind === 'reply' && c.update ? `update ${c.update.k}` : c.kind === 'reply' && c.re ? `hint on update ${c.re.k}` : KIND_LABEL[c.kind]}</span>
64
+ {c.kind === 'version' ? <span className="rv-badge">{STATUS_LABEL[c.status]}</span> : null}
65
+ {c.kind === 'reply' && c.update ? <span className={`rv-badge rv-up up-${c.update.state}`}>{UPDATE_WORDS[c.update.state]}</span> : null}
66
+ {c.kind === 'verdict' ? (
67
+ <button className="rv-on ghost" title={c.n > 0 ? `the version this answers: v${c.n}` : 'the note this answers'} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.reveal(c.on) }}>↑ on {c.n > 0 ? `v${c.n}` : 'the note'}</button>
68
+ ) : c.kind !== 'version' && c.on !== c.id && c.on !== card.data?.head ? (
69
+ <button className="rv-on ghost" title="the item this was said on" onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.reveal(c.on) }}>↑ on {onWords(card, c.on)}</button>
70
+ ) : null}
71
+ {head ? <span className="rv-headtag" title="your verdict and your reply go to this one">answer here</span> : null}
72
+ {unread ? <span className="rv-unread" title="not read yet" /> : null}
73
+ <When rv={rv} at={c.at} />
74
+ <span className="rv-ctools">
75
+ <button className="rv-foldbtn" title={open ? 'fold' : 'unfold'} aria-label={open ? 'fold' : 'unfold'} aria-expanded={open} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.toggleCell(c) }}><Caret open={open} /></button>
76
+ <button className="rv-copyid ghost" title={`copy the id: ${c.id}`} aria-label="copy the id" onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); void rv.copyId(c.id) }}>
77
+ <Icon d={ICON.copy} />
78
+ </button>
79
+ </span>
80
+ </header>
81
+ {open ? (
82
+ <div className="rv-bubble rv-cbody">
83
+ {c.kind === 'version' ? <VersionMain rv={rv} card={card} c={c} /> : c.kind === 'verdict' ? <VerdictBody card={card} c={c} /> : c.kind === 'reply' ? <ReplyBody rv={rv} card={card} c={c} /> : <NoteBody rv={rv} c={c} />}
84
+ </div>
85
+ ) : (
86
+ c.kind === 'version' && c.item.views.length > 0 ? (
87
+ <div className="rv-bubble rv-vfold">
88
+ <div className="rv-csum" onClick={() => card.toggleCell(c)}>{c.summary || '·'}</div>
89
+ <ViewStrip rv={rv} card={card} c={c} />
90
+ </div>
91
+ ) : (
92
+ <div className="rv-bubble rv-csum" onClick={() => card.toggleCell(c)}>{c.summary || '·'}</div>
93
+ )
94
+ )}
95
+ </div>
84
96
  </article>
85
97
  )
86
98
  })
87
99
 
88
- /** what an item a word sits on is called: its version, or the note it answers */
89
- const onWords = (card: ThreadSt, on: string): string => {
90
- const v = card.versionOf(on)
91
- return v ? `v${v.n}` : 'the note'
92
- }
93
-
94
- /** a long text folded to its first lines, a « more » that unfolds it in place */
95
- const LONG_WHAT = 480
100
+ /** a folded version's views as small previews, a chat's attachments: a click opens the version on that view */
101
+ const STRIP_MAX = 8
96
102
 
97
- const Clamp = observer(({ card, id, md }: { card: ThreadSt; id: string; md: string }) => {
98
- const long = md.length > LONG_WHAT || md.split('\n').length > 8
99
- const key = `${id}#what`
100
- const open = !long || card.folds[key] === true
103
+ const ViewStrip = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c: VersionCell }) => {
104
+ const views = c.item.views
101
105
  return (
102
- <div className={`rv-clamp${open ? '' : ' shut'}`}>
103
- <div className="md rv-what" dangerouslySetInnerHTML={{ __html: renderMd(md) }} />
104
- {long ? (
105
- <button className="rv-more ghost" aria-expanded={open} onMouseDown={keepFocus} onClick={() => card.toggle(key, open)}>{open ? 'less' : 'more'} <Caret v open={open} /></button>
106
- ) : null}
106
+ <div className="rv-vtiles">
107
+ {views.slice(0, STRIP_MAX).map((v, i) => {
108
+ const file = thumbFileOf(v)
109
+ return (
110
+ <button key={i} className="rv-vtile" title={`${viewTag(c.n, i)} ${viewName(v, i)}: open it`} onMouseDown={keepFocus} onClick={() => card.reveal(c.id, i)}>
111
+ {/\.(png|jpe?g|webp)$/i.test(file) ? <img src={rv.thumbUrl(c.item.id, file)} alt="" loading="lazy" decoding="async" /> : <span className="rv-vtilenone">{viewKind(v, false)}</span>}
112
+ <span className="rv-vtiletag">{viewTag(c.n, i)}</span>
113
+ </button>
114
+ )
115
+ })}
116
+ {views.length > STRIP_MAX ? <button className="rv-vtile more" onMouseDown={keepFocus} onClick={() => card.reveal(c.id)}>+{views.length - STRIP_MAX}</button> : null}
107
117
  </div>
108
118
  )
109
119
  })
110
120
 
111
- /** a version: its gutter (its big `v3`, sticky while it scrolls), what the agent says, the repo's facts on it, its views */
112
- const VersionBody = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c: VersionCell }) => (
113
- <div className="rv-vgrid">
114
- <div className="rv-gut" aria-hidden="true"><span className="rv-gutlabel">v{c.n}</span></div>
115
- <div className="rv-vmain"><VersionMain rv={rv} card={card} c={c} /></div>
116
- </div>
117
- ))
121
+ /** what an item a word sits on is called: its version, or the note it answers */
122
+ const onWords = (card: ThreadSt, on: string): string => {
123
+ const v = card.versionOf(on)
124
+ return v ? `v${v.n}` : 'the note'
125
+ }
118
126
 
127
+ /** a version: what the agent says, the facts of the repo on it, its views */
119
128
  const VersionMain = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c: VersionCell }) => {
120
129
  const r = c.item
121
130
  const live = c.id === card.head?.id && card.takesVerdict
@@ -123,7 +132,7 @@ const VersionMain = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c
123
132
  const stamp = card.cells.findLast((x) => x.on === c.id)?.id ?? c.id
124
133
  return (
125
134
  <>
126
- {r.what ? <Clamp card={card} id={c.id} md={r.what} /> : null}
135
+ {r.what ? <div className="md rv-what" dangerouslySetInnerHTML={{ __html: renderMd(r.what) }} /> : null}
127
136
  {r.keeps ? <div className="rv-keeps"><b>keeps:</b> {r.keeps}</div> : null}
128
137
  {r.why ? <div className="rv-pre rv-why">another subject: {r.why}</div> : null}
129
138
  <div className="rv-cfacts">
@@ -134,6 +143,8 @@ const VersionMain = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c
134
143
  <AnimPanel app={rv} item={r} />
135
144
  {/* every version of a trailer card plays its own pinned render in the trailer entry's player */}
136
145
  {isTrailerCard(r) ? <TrailerCardBody ver={{ rv, card, cell: c, live, claim }} item={r} /> : r.views.length > 0 ? <VersionViews ver={{ rv, card, cell: c, live, claim }} /> : null}
146
+ {/* a draft card holds no view: its body is the post draft itself, read live */}
147
+ {isDraftCard(r) ? <DraftCardBody ver={{ rv, card, cell: c, live, claim }} item={r} /> : null}
137
148
  </>
138
149
  )
139
150
  })
@@ -152,7 +163,8 @@ const VerdictBody = observer(({ card, c }: { card: ThreadSt; c: VerdictCell }) =
152
163
  return (
153
164
  <>
154
165
  <div className="rv-verdictline">
155
- <span className={`rv-bigpill ${toneOf(c.verdict)}`}>{STATUS_LABEL[c.verdict]}</span>
166
+ <span className="rv-vdisc" aria-hidden="true">{VERDICTS.find((x) => x.status === c.verdict)?.glyph ?? '•'}</span>
167
+ <b className="rv-vwords">{STATUS_LABEL[c.verdict]}{v ? ` · v${v.n}` : ''}</b>
156
168
  {c.current ? null : <span className="rv-dim">an earlier answer, before a reopen or a newer one</span>}
157
169
  <span className="rv-dim">{c.read ? 'read by the agent' : 'not read yet'}</span>
158
170
  </div>
@@ -175,7 +187,7 @@ const VerdictBody = observer(({ card, c }: { card: ThreadSt; c: VerdictCell }) =
175
187
  return (
176
188
  <button key={`q${k}`} className={`rv-noteline${q.status ? ` re-${q.status}` : ''}`} onClick={() => card.reveal(c.on, q.view)}>
177
189
  <span className="rv-notemark">{o?.glyph ?? ''}{q.stars ? ` ★${q.stars}` : ''}</span>
178
- <span className="rv-noteplace">{v ? `${viewTag(v.n, q.view)} ` : ''}{view?.label || (v ? '' : viewName(view, q.view))}{tile}</span>
190
+ <span className="rv-noteplace">{q.post !== undefined ? postLabel(v?.item.draft, q.post) : <>{v ? `${viewTag(v.n, q.view)} ` : ''}{view?.label || (v ? '' : viewName(view, q.view))}{tile}</>}</span>
179
191
  <span className="rv-notetext">{q.comment || (o ? o.label : '')}</span>
180
192
  </button>
181
193
  )
@@ -216,7 +228,7 @@ const ReplyBody = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c:
216
228
  ) : null}
217
229
  <div className="rv-pre rv-words">{c.text}</div>
218
230
  {c.image ? (
219
- <a href={rv.threadImageUrl(c.on, c.image)} target="_blank" rel="noreferrer"><img className="rv-msgimg" src={rv.threadImageUrl(c.on, c.image)} alt="" loading="lazy" /></a>
231
+ <PreviewImg src={rv.threadImageUrl(c.on, c.image)} />
220
232
  ) : null}
221
233
  {version && view && c.update?.view !== undefined ? (
222
234
  <ViewCell
@@ -227,10 +239,78 @@ const ReplyBody = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c:
227
239
  />
228
240
  ) : null}
229
241
  {c.update && c.party === 'agent' ? <HintBox card={card} c={c} /> : null}
242
+ {c.ask ? <AskBody card={card} c={c} ask={c.ask} /> : null}
243
+ {c.propose ? <ProposeBody card={card} c={c} p={c.propose} /> : null}
244
+ {c.about ? <div className="rv-dim">links {c.about.join(' · ')}</div> : null}
230
245
  </>
231
246
  )
232
247
  })
233
248
 
249
+ /** an agent's question: one button per option, its pick marked; one click answers, the words box goes with it */
250
+ const AskBody = observer(({ card, c, ask }: { card: ThreadSt; c: ReplyCell; ask: NonNullable<ReplyCell['ask']> }) => {
251
+ const done = ask.answered
252
+ return (
253
+ <div className="rv-ask">
254
+ <div className="rv-askopts">
255
+ {ask.options.map((o, i) => (
256
+ <button
257
+ key={i}
258
+ className={`rv-askopt${done?.option === i ? ' picked' : ''}${ask.pick === i ? ' pick' : ''}`}
259
+ disabled={done !== undefined || card.busy}
260
+ onMouseDown={keepFocus}
261
+ onClick={() => void card.answer(c, { option: i })}
262
+ title={ask.pick === i ? "the agent's pick" : undefined}
263
+ >
264
+ <span className="rv-askn">{i + 1}</span> {o}
265
+ {ask.pick === i ? <span className="rv-mypick">my pick</span> : null}
266
+ {done?.option === i ? <span className="rv-badge">✓ yours</span> : null}
267
+ </button>
268
+ ))}
269
+ </div>
270
+ {done ? null : <AnswerWords card={card} c={c} placeholder="a word with your answer (optional), then click an option" />}
271
+ </div>
272
+ )
273
+ })
274
+
275
+ /** an agent's proposed change of an object's text: the before and the after; « apply » lands it as it is, « apply my
276
+ * edit » lands the words box */
277
+ const ProposeBody = observer(({ card, c, p }: { card: ThreadSt; c: ReplyCell; p: NonNullable<ReplyCell['propose']> }) => {
278
+ const edited = (card.hints[c.id] ?? '').trim() !== ''
279
+ return (
280
+ <div className="rv-propose">
281
+ <div className="rv-dim">on {p.on}</div>
282
+ {p.before !== undefined ? <div className="rv-pre rv-before">{p.before}</div> : null}
283
+ <div className="rv-pre rv-after">{p.applied ? p.applied.text : p.after}</div>
284
+ {p.applied ? (
285
+ <span className="rv-badge">✓ applied</span>
286
+ ) : (
287
+ <>
288
+ <AnswerWords card={card} c={c} placeholder="edit it here before you apply (optional)" initial={p.after} />
289
+ <div className="rv-askopts">
290
+ <button className="rv-askopt pick" disabled={card.busy} onMouseDown={keepFocus} onClick={() => void card.answer(c, { apply: true })}>
291
+ {edited ? 'apply my edit' : 'apply'}
292
+ </button>
293
+ </div>
294
+ </>
295
+ )}
296
+ </div>
297
+ )
298
+ })
299
+
300
+ /** the words that go with an answer: the hint box of the cell, kept per cell until sent */
301
+ const AnswerWords = observer(({ card, c, placeholder, initial }: { card: ThreadSt; c: ReplyCell; placeholder: string; initial?: string }) => (
302
+ <textarea
303
+ className="rv-answerwords"
304
+ rows={initial ? Math.min(6, initial.split('\n').length + 1) : 1}
305
+ placeholder={placeholder}
306
+ value={card.hints[c.id] ?? ''}
307
+ onFocus={() => {
308
+ if (initial !== undefined && (card.hints[c.id] ?? '') === '') card.setHint(c.id, initial)
309
+ }}
310
+ onChange={(e) => card.setHint(c.id, e.target.value)}
311
+ />
312
+ ))
313
+
234
314
  /** his few words on one update: a hint the agent reads, the card left as it is */
235
315
  const HintBox = observer(({ card, c }: { card: ThreadSt; c: ReplyCell }) => {
236
316
  const text = card.hints[c.id] ?? ''
@@ -274,7 +354,7 @@ const NoteBody = ({ rv, c }: { rv: ReviewSt; c: NoteCell }) => {
274
354
  </div>
275
355
  ) : null}
276
356
  {c.rects.some((q) => q.comment) ? c.rects.map((q, k) => (q.comment ? <div key={k} className="rv-noteline rect still"><span className="rv-notemark">⬚ {k + 1}</span><span className="rv-notetext">{q.comment}</span></div> : null)) : null}
277
- {c.image && c.item ? <img className="rv-msgimg" src={rv.threadImageUrl(c.item.id, c.image)} alt="" loading="lazy" /> : null}
357
+ {c.image && c.item ? <PreviewImg src={rv.threadImageUrl(c.item.id, c.image)} /> : null}
278
358
  </>
279
359
  )
280
360
  }
@@ -3,9 +3,21 @@
3
3
  import { reach } from '../reach.ts'
4
4
 
5
5
  /** the zoom of a view: fit the column (and the window's height), or a share of the image's own pixels */
6
- export const ZOOMS = ['fit', '1', '1.5', '2'] as const
6
+ /** `preview`: a view as a chat shows an image, at most PREVIEW_H tall; `fit`: the column's height; then the full file */
7
+ export const ZOOMS = ['preview', 'fit', '1', '1.5', '2'] as const
8
+ export const PREVIEW_H = 360
7
9
  export type Zoom = (typeof ZOOMS)[number]
8
10
 
11
+ /** the size of the view in the lightbox: whole on the screen, as wide as the box (it scrolls), or a share of the
12
+ * image's own pixels, any share: the wheel and the keys move it by steps */
13
+ export type BoxZoom = 'fit' | 'width' | number
14
+ export const BOX_ZOOM = { min: 0.1, max: 8, step: 1.25, picks: [1, 2] } as const
15
+ export const isBoxZoom = (v: unknown): v is BoxZoom => v === 'fit' || v === 'width' || (typeof v === 'number' && Number.isFinite(v) && v >= BOX_ZOOM.min && v <= BOX_ZOOM.max)
16
+ /** a share of the image's pixels inside the range, to the percent */
17
+ export const boxScale = (s: number): number => Math.round(Math.max(BOX_ZOOM.min, Math.min(BOX_ZOOM.max, s)) * 100) / 100
18
+ /** the next size from a share: one step in or out (`by` 1 or -1, a wheel gives a fraction) */
19
+ export const boxStep = (from: number, by: number): number => boxScale(from * BOX_ZOOM.step ** by)
20
+
9
21
  /** how a gallery draws: a side list of its images with the picked one large, one image a row at full width, or the
10
22
  * wrapping grid of tiles at the slider's height */
11
23
  export const GALLERY_MODES = ['tabs', 'list', 'grid'] as const
@@ -50,6 +62,16 @@ const KEPT_URLS = 4
50
62
 
51
63
  /** `keep`: the browser keeps the last answer of its last few urls under this key, so a page opened again (a reload,
52
64
  * a daemon restarting, a filter switched back) draws it in the first frame, and its first request sends the kept tag */
65
+ /** the cards' store refused for a while (a fold or a way back of the daemon's file): its line and the wait it names */
66
+ export class StoreWait extends Error {
67
+ constructor(
68
+ readonly line: string,
69
+ readonly retryS: number,
70
+ ) {
71
+ super(line)
72
+ }
73
+ }
74
+
53
75
  export function etagLoader<T>(url: () => string, o: { keep?: string } = {}): EtagLoader<T> {
54
76
  type Last = { url: string; tag: string; value: T }
55
77
  const key = o.keep == null ? null : `shipkit.answer.${o.keep}`
@@ -68,6 +90,10 @@ export function etagLoader<T>(url: () => string, o: { keep?: string } = {}): Eta
68
90
  const last = of(u)
69
91
  const res = await reach(u, { cache: 'no-store', headers: last ? { 'If-None-Match': last.tag } : {} })
70
92
  if (res.status === 304 && last) return last.value
93
+ if (res.status === 503) {
94
+ const b = (await res.json().catch(() => null)) as { refused?: unknown; retryS?: unknown } | null
95
+ if (typeof b?.refused === 'string') throw new StoreWait(b.refused, typeof b.retryS === 'number' ? b.retryS : 2)
96
+ }
71
97
  if (!res.ok) throw new Error(`${u}: HTTP ${res.status} ${await res.text().catch(() => '')}`.trim())
72
98
  const value = (await res.json()) as T
73
99
  const tag = res.headers.get('ETag')
@@ -1,49 +1,71 @@
1
1
  // the review page's left column: the search and the filters (asked of the server), one row per thread, a page more
2
2
  // when the list's end scrolls into view
3
3
  import { observer } from 'mobx-react-lite'
4
- import { useEffect, useRef } from 'react'
4
+ import { Fragment, useEffect, useRef } from 'react'
5
5
  import type { ThreadRow } from '../../../review/cells.ts'
6
6
  import { MOVE_LABEL, STATUS_LABEL, subjectLabel, UPDATE_WORDS, type Move, type ShownStatus } from '../../../review/model.ts'
7
7
  import { AutoTag, LaneTag, laneColor, Listeners, Rework, ThumbOf, toneOf } from './kit.tsx'
8
8
  import { ReviewBoard } from './review-board.tsx'
9
9
  import type { ReviewSt } from './review-st.ts'
10
+ import { ListFilter } from '../list-filter.tsx'
11
+ import { Pop, Tip } from '../floating.tsx'
12
+ import { Icon, ICON } from '../icons.tsx'
10
13
 
11
14
  const ALL = ''
12
15
 
13
16
  export const ReviewList = observer(({ rv }: { rv: ReviewSt }) => (
14
17
  <div className="rv-listcol">
15
18
  <div className="rv-filters">
16
- <input className="rv-search" placeholder="search every version and message" aria-label="search the cards" value={rv.query} onChange={(e) => rv.setQuery(e.currentTarget.value)}
17
- onKeyDown={(e) => { if (e.key === 'Escape') { rv.setQuery(''); e.currentTarget.blur() } }} />
18
- <div className="rv-selects">
19
- <select aria-label="subject" value={rv.subject ?? ALL} onChange={(e) => rv.setFilter({ subject: e.currentTarget.value === ALL ? null : e.currentTarget.value })}>
20
- <option value={ALL}>every subject</option>
21
- {rv.subjects.map((k) => <option key={k} value={k}>{subjectLabel(k, rv.spec ?? undefined)}</option>)}
22
- </select>
23
- <select aria-label="state" value={rv.status ?? ALL} onChange={(e) => rv.setFilter({ status: e.currentTarget.value === ALL ? null : (e.currentTarget.value as ShownStatus) })}>
24
- <option value={ALL}>every state</option>
25
- {(Object.keys(STATUS_LABEL) as ShownStatus[]).map((s) => <option key={s} value={s}>{STATUS_LABEL[s]}</option>)}
26
- </select>
27
- </div>
28
- <span className="seg rv-whose" aria-label="whose move">
29
- <button className={rv.whose === null ? 'on' : ''} onClick={() => rv.setFilter({ whose: null })}>all</button>
30
- {(['owner', 'agents', 'none'] as const).map((m: Move) => (
31
- <button key={m} className={rv.whose === m ? 'on' : ''} onClick={() => rv.setFilter({ whose: m })}>{MOVE_LABEL[m]}</button>
32
- ))}
33
- </span>
34
- <div className="rv-switches">
35
- <label className="rv-switch"><input type="checkbox" checked={rv.hideHandled} onChange={(e) => rv.setHideHandled(e.currentTarget.checked)} />hide handled</label>
36
- <label className="rv-switch"><input type="checkbox" checked={rv.byLane} onChange={(e) => rv.setByLane(e.currentTarget.checked)} />by lane</label>
37
- {rv.spec?.dispatcher ? <label className="rv-switch"><input type="checkbox" checked={rv.board} onChange={(e) => rv.setBoard(e.currentTarget.checked)} />board</label> : null}
38
- </div>
39
- <div className="rv-count">
40
- {rv.activeCount} active · {rv.pendingCount} waiting{rv.page ? ` · ${rv.page.total} shown of ${rv.page.counts.threads} threads` : ''}
41
- </div>
19
+ <ListFilter side={rv.side} value={rv.query} set={(v) => rv.setQuery(v)} keep={(el) => { rv.searchEl = el }} placeholder="search every version and message" label="search every version and message" />
20
+ <ListToggle on={rv.hideHandled} set={(v) => rv.setHideHandled(v)} icon={ICON.hideHandled} label="hide handled" says={rv.hideHandled ? 'hide handled: on, the threads you answered are hidden' : 'hide handled: off, every thread shows'} />
21
+ <ListToggle on={rv.byLane} set={(v) => rv.setByLane(v)} icon={ICON.byLane} label="by lane" says={rv.byLane ? 'by lane: on, the threads are grouped by the lane that sent them' : 'by lane: off, one list, newest first'} />
22
+ <Pop className={`rv-filterbtn${changed(rv) > 0 ? ' on' : ''}`} popClass="fpop rv-filterpop" placement="bottom-end" aria-label="the filters" title={`filters: ${rv.activeCount} active, ${rv.pendingCount} waiting`}
23
+ label={<><Icon d={ICON.filter} />{changed(rv) > 0 ? <b>{changed(rv)}</b> : null}</>}>
24
+ {() => <Filters rv={rv} />}
25
+ </Pop>
42
26
  </div>
43
27
  {rv.board && rv.spec?.dispatcher ? <ReviewBoard rv={rv} /> : <Rows rv={rv} />}
44
28
  </div>
45
29
  ))
46
30
 
31
+ /** a switch of the list in its top row: an icon that reads pressed while on, its words at once on hover */
32
+ const ListToggle = ({ on, set, icon, label, says }: { on: boolean; set: (v: boolean) => void; icon: string; label: string; says: string }) => (
33
+ <Tip instant content={says} placement="bottom">
34
+ <button type="button" role="switch" aria-checked={on} aria-label={label} className={`rv-filterbtn rv-listtoggle${on ? ' on' : ''}`} onClick={() => set(!on)}><Icon d={icon} /></button>
35
+ </Tip>
36
+ )
37
+
38
+ /** how many filters behind the button differ from the list as it opens: a subject, a state, whose move, the board */
39
+ const changed = (rv: ReviewSt): number =>
40
+ [rv.subject != null, rv.status != null, rv.whose != null, rv.board].filter(Boolean).length
41
+
42
+ /** the filters behind the button beside the search: they are rarely touched, so the list keeps its height. The two
43
+ * switches he flips often (hide handled, by lane) sit in the row itself */
44
+ const Filters = observer(({ rv }: { rv: ReviewSt }) => (
45
+ <div className="rv-filterbox">
46
+ <div className="rv-count">{rv.activeCount} active · {rv.pendingCount} waiting{rv.page ? ` · ${rv.page.total} shown of ${rv.page.counts.threads} threads` : ''}</div>
47
+ <select aria-label="subject" className={rv.subject ? 'set' : ''} value={rv.subject ?? ALL} onChange={(e) => rv.setFilter({ subject: e.currentTarget.value === ALL ? null : e.currentTarget.value })}>
48
+ <option value={ALL}>every subject</option>
49
+ {rv.subjects.map((k) => <option key={k} value={k}>{subjectLabel(k, rv.spec ?? undefined)}</option>)}
50
+ </select>
51
+ <select aria-label="state" className={rv.status ? 'set' : ''} value={rv.status ?? ALL} onChange={(e) => rv.setFilter({ status: e.currentTarget.value === ALL ? null : (e.currentTarget.value as ShownStatus) })}>
52
+ <option value={ALL}>every state</option>
53
+ {(Object.keys(STATUS_LABEL) as ShownStatus[]).map((s) => <option key={s} value={s}>{STATUS_LABEL[s]}</option>)}
54
+ </select>
55
+ <span className="seg" aria-label="whose move">
56
+ <button className={rv.whose === null ? 'on' : ''} onClick={() => rv.setFilter({ whose: null })}>all</button>
57
+ {(['owner', 'agents', 'none'] as const).map((m: Move) => (
58
+ <button key={m} className={rv.whose === m ? 'on' : ''} onClick={() => rv.setFilter({ whose: m })}>{MOVE_LABEL[m]}</button>
59
+ ))}
60
+ </span>
61
+ {rv.spec?.dispatcher ? <label className="rv-switch"><input type="checkbox" checked={rv.board} onChange={(e) => rv.setBoard(e.currentTarget.checked)} />board</label> : null}
62
+ {changed(rv) > 0 ? <button className="ghost" onClick={() => {
63
+ rv.setFilter({ subject: null, status: null, whose: null })
64
+ rv.setBoard(false)
65
+ }}>reset the filters</button> : null}
66
+ </div>
67
+ ))
68
+
47
69
  const Rows = observer(({ rv }: { rv: ReviewSt }) => {
48
70
  const open = rv.openRow
49
71
  return (
@@ -55,12 +77,18 @@ const Rows = observer(({ rv }: { rv: ReviewSt }) => {
55
77
  {g.rows.map((r) => <Row key={r.head} rv={rv} r={r} on={r === open} />)}
56
78
  </div>
57
79
  ))
58
- : rv.rows.map((r) => <Row key={r.head} rv={rv} r={r} on={r === open} />)}
80
+ : rv.rows.map((r, i) => (
81
+ <Fragment key={r.head}>
82
+ {i === 0 || rv.rows[i - 1]?.turn !== r.turn ? <TurnHeader turn={r.turn} n={rv.rows.filter((x) => x.turn === r.turn).length} /> : null}
83
+ <Row rv={rv} r={r} on={r === open} />
84
+ </Fragment>
85
+ ))}
59
86
  {rv.page && rv.rows.length === 0 ? (
60
- <div className="rv-empty">{rv.page.counts.threads === 0 ? 'No card yet. An agent sends one with sk review add.' : rv.hideHandled && !rv.q ? 'Nothing active: « hide handled » hides the handled threads.' : 'No card matches.'}</div>
87
+ <div className="rv-empty">{rv.page.counts.threads === 0 ? 'No thread yet. An agent starts one with sk thread post <address>.' : rv.hideHandled && !rv.q ? 'Nothing active: « hide handled » hides the handled threads.' : 'No thread matches.'}</div>
61
88
  ) : null}
62
89
  {rv.more > 0 ? <More rv={rv} /> : null}
63
- {rv.page === null && rv.listError === null ? <div className="rv-empty"><span className="spin" /> reading the cards…</div> : null}
90
+ {rv.listWait !== null ? <div className="rv-empty"><span className="spin" /> {rv.listWait}</div> : null}
91
+ {rv.page === null && rv.listError === null && rv.listWait === null ? <div className="rv-empty"><span className="spin" /> reading the threads…</div> : null}
64
92
  {rv.listError !== null ? <div className="rv-err">{rv.listError}</div> : null}
65
93
  {rv.broken.map((b) => <div key={b.id} className="rv-err">unreadable: {b.id} ({b.error})</div>)}
66
94
  </div>
@@ -80,6 +108,16 @@ const More = observer(({ rv }: { rv: ReviewSt }) => {
80
108
  return <button ref={el} className="ghost rv-more" onClick={() => rv.showMore()}>{rv.more} more</button>
81
109
  })
82
110
 
111
+ const TURN_WORDS: Record<ThreadRow['turn'], string> = { yours: 'your turn', working: 'an agent works on it', done: 'done' }
112
+
113
+ /** who acts now on the threads under it: his turn first, then the agents' work, then what is done */
114
+ const TurnHeader = ({ turn, n }: { turn: ThreadRow['turn']; n: number }) => (
115
+ <div className={`rv-turnhead turn-${turn}`}>
116
+ <b>{TURN_WORDS[turn]}</b>
117
+ <span className="rv-dim">{n}</span>
118
+ </div>
119
+ )
120
+
83
121
  const LaneHeader = observer(({ rv, lane, rows }: { rv: ReviewSt; lane: string | null; rows: readonly ThreadRow[] }) => (
84
122
  <div className="rv-lanehead" style={lane ? { ['--lane' as string]: laneColor(lane) } : undefined}>
85
123
  <b>{lane ?? 'no lane'}</b>
@@ -1,10 +1,10 @@
1
- // a repo's review page (`#page:review`, wiki tools/shipkit/review.md, The review page): the cards on the left, the open
1
+ // a repo's review page (`#page:review`, wiki tools/shipkit/threads.md, The review page): the cards on the left, the open
2
2
  // one as a chat on the right (review-thread.tsx). On a phone one pane at a time: the cards, or the card with its answer
3
3
  // box and the verdicts under the thumb. Everything is read while the page shows
4
4
  import { observer } from 'mobx-react-lite'
5
5
  import { useEffect } from 'react'
6
6
  import { Panel, Separator } from 'react-resizable-panels'
7
- import { KeptCols } from '../kept-cols.tsx'
7
+ import { KeptCols, LIST_COL, PANEL } from '../kept-cols.tsx'
8
8
  import type { RepoSt } from '../repo-st.ts'
9
9
  import { ReviewList } from './review-list.tsx'
10
10
  import type { ReviewSt } from './review-st.ts'
@@ -34,7 +34,7 @@ export const ReviewPage = observer(({ app }: { app: RepoSt }) => {
34
34
  <>
35
35
  <Toast rv={rv} />
36
36
  <KeptCols id="review" folds={{ left: 'review-list' }} layout={app.home.layout}>
37
- <Panel id="review-list" defaultSize="24%" minSize={180} className="rv-pane" style={PANEL}>
37
+ <Panel id="review-list" {...LIST_COL} className="rv-pane" style={PANEL}>
38
38
  <ReviewList rv={rv} />
39
39
  </Panel>
40
40
  <Separator className="rsep" />
@@ -47,17 +47,16 @@ export const ReviewPage = observer(({ app }: { app: RepoSt }) => {
47
47
  })
48
48
 
49
49
  /** the phone's top line over the cards: the way back to the hub (none in another tool's frame), the repo, the count
50
- * that waits on him. On a phone the page covers the hub's panes, which leave it no room */
51
- export const PhoneTop = observer(({ app }: { app: RepoSt }) => (
50
+ * that waits on him (`what`: a page that says its own). On a phone the page covers the hub's panes, which leave it no room */
51
+ export const PhoneTop = observer(({ app, what }: { app: RepoSt; what?: string }) => (
52
52
  <div className="rv-phonetop">
53
53
  {app.home.embedded ? null : <button className="ghost" onClick={() => app.showReadme()}>◂ hub</button>}
54
54
  <b>{app.name}</b>
55
- <span className="rv-dim">{app.sel?.t === 'trailer' ? 'trailer' : app.sel?.t === 'stores' ? 'stores' : app.sel?.t === 'veille' ? 'veille' : app.sel?.t === 'comms' ? 'communications' : app.sel?.t === 'social' ? 'social' : `review${app.review.pendingCount > 0 ? ` · ${app.review.pendingCount} waiting` : ''}`}</span>
55
+ <span className="rv-dim">{what ?? (app.sel?.t === 'trailer' ? 'trailer' : app.sel?.t === 'stores' ? 'stores' : app.sel?.t === 'veille' ? 'veille' : app.sel?.t === 'comms' ? 'communications' : app.sel?.t === 'social' ? 'social' : `review${app.review.pendingCount > 0 ? ` · ${app.review.pendingCount} waiting` : ''}`)}</span>
56
56
  </div>
57
57
  ))
58
58
 
59
59
  /** what the last copy put on the clipboard, a moment over the page */
60
60
  const Toast = observer(({ rv }: { rv: ReviewSt }) => (rv.toast ? <div className="rv-toast" role="status">{rv.toast}</div> : null))
61
61
 
62
- /** a panel never scrolls itself: the column inside it does (hub-app.tsx, PANEL) */
63
- export const PANEL = { overflow: 'hidden' } as const
62
+ export { PANEL } from '../kept-cols.tsx'