rvlib-shipkit 2.27.0 → 2.28.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 (338) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/src/agent-time/hooks.ts +10 -3
  4. package/src/agent-time/live.ts +11 -5
  5. package/src/agent-time/registry.ts +289 -0
  6. package/src/agent-time/store.ts +2 -2
  7. package/src/annex/born.ts +2 -2
  8. package/src/annex/offload.ts +12 -11
  9. package/src/asks/ask-after.ts +6 -2
  10. package/src/asks/ask-bar-fold.ts +57 -0
  11. package/src/asks/ask-migrate.ts +280 -0
  12. package/src/asks/ask-steps-fold.ts +166 -0
  13. package/src/asks/ask-store.ts +586 -0
  14. package/src/assets/kits/identity-kit.ts +106 -38
  15. package/src/assets/kits/poster-thumbnail.ts +282 -0
  16. package/src/checks/SK003-claude-md-shape.check.ts +92 -25
  17. package/src/checks/SK004-gitignore-policy.check.ts +8 -4
  18. package/src/checks/SK013-one-way-in-policy.check.ts +10 -0
  19. package/src/checks/SK026-asks-autoclose.check.ts +9 -23
  20. package/src/checks/SK038-speaks-as.check.ts +3 -3
  21. package/src/checks/SK042-post-kinds.check.ts +26 -24
  22. package/src/checks/SK049-thread-answers-hook.check.ts +81 -0
  23. package/src/checks/SK050-retired-commands.check.ts +127 -0
  24. package/src/cli/cmd_Asks.ts +204 -53
  25. package/src/cli/cmd_Backup.ts +151 -8
  26. package/src/cli/cmd_Calls.ts +1 -0
  27. package/src/cli/cmd_Commands.ts +140 -34
  28. package/src/cli/cmd_Contracts.ts +1 -0
  29. package/src/cli/cmd_Keys.ts +1 -0
  30. package/src/cli/cmd_Lanes.ts +15 -4
  31. package/src/cli/cmd_Messages.ts +152 -1
  32. package/src/cli/cmd_Needs.ts +1 -0
  33. package/src/cli/cmd_Review.ts +931 -229
  34. package/src/cli/cmd_Secret.ts +255 -34
  35. package/src/cli/cmd_Social.ts +36 -33
  36. package/src/cli/cmd_SocialDrafts.ts +235 -0
  37. package/src/cli/cmd_Sound.ts +22 -1
  38. package/src/cli/cmd_Start.ts +3 -2
  39. package/src/cli/cmd_ThreadHolds.ts +34 -0
  40. package/src/cli/cmd_ThreadKinds.ts +146 -0
  41. package/src/cli/cmd_ThreadReflect.ts +83 -0
  42. package/src/cli/cmd_ThreadSyncNeeds.ts +62 -0
  43. package/src/cli/cmd_Vault.ts +1 -1
  44. package/src/cli/cmd_When.ts +1 -0
  45. package/src/cli/family-help.ts +2 -2
  46. package/src/cli/family-pages.ts +1 -1
  47. package/src/cli/kit/builtins.ts +1 -0
  48. package/src/cli/kit/verb.ts +6 -2
  49. package/src/cli/registry.ts +21 -2
  50. package/src/cli.ts +5 -2
  51. package/src/collections/actions.ts +25 -74
  52. package/src/collections/collection-types.ts +9 -5
  53. package/src/collections/md-body.ts +5 -3
  54. package/src/collections/pings.ts +13 -6
  55. package/src/collections/providers.ts +53 -61
  56. package/src/collections/reflections.ts +9 -4
  57. package/src/core/discover-checks.ts +18 -3
  58. package/src/core/git.ts +31 -0
  59. package/src/core/house-layout.ts +17 -0
  60. package/src/core/layout.ts +10 -5
  61. package/src/core/locked-write.ts +4 -1
  62. package/src/core/machine-db.ts +5 -3
  63. package/src/core/migrate-layout.ts +8 -10
  64. package/src/home/activity.ts +8 -15
  65. package/src/home/daemon-jobs.ts +13 -1
  66. package/src/home/home-paths.ts +6 -3
  67. package/src/home/home-routes.ts +8 -0
  68. package/src/home/inbox-shape.ts +233 -100
  69. package/src/home/inbox.ts +26 -71
  70. package/src/home/machine-fold.ts +10 -15
  71. package/src/home/machine-host.ts +19 -1
  72. package/src/home/other-macs.ts +2 -2
  73. package/src/home/serve-web.ts +6 -5
  74. package/src/home/space-page.ts +1 -1
  75. package/src/home/vault-page.ts +51 -17
  76. package/src/home/vault-words.ts +2 -2
  77. package/src/hooks/one-way-in-guard.ts +24 -2
  78. package/src/hq/files-send.ts +27 -28
  79. package/src/hq/hq-db.ts +4 -1
  80. package/src/hq/hq-local.ts +37 -4
  81. package/src/hq/hq-routes.ts +10 -2
  82. package/src/hq/hq-store.ts +6 -2
  83. package/src/hq/kinds/ask.ts +6 -6
  84. package/src/hq/outbox.ts +5 -3
  85. package/src/hq/replica.ts +1 -2
  86. package/src/hq/vault-route.ts +112 -0
  87. package/src/identities/collection.ts +2 -2
  88. package/src/identities/identities.ts +9 -8
  89. package/src/identities/machine-route.ts +8 -3
  90. package/src/ledger/db.ts +8 -1
  91. package/src/media-store/backup/daemon.ts +48 -8
  92. package/src/media-store/backup/keys.ts +1 -1
  93. package/src/media-store/backup/manifest.ts +20 -2
  94. package/src/media-store/backup/prune.ts +365 -0
  95. package/src/media-store/backup/retention.ts +122 -0
  96. package/src/media-store/backup/run.ts +14 -8
  97. package/src/media-store/backup/sources.ts +18 -17
  98. package/src/media-store/backup/thread-copy.ts +340 -0
  99. package/src/media-store/copy/config.ts +3 -4
  100. package/src/media-store/copy/store.ts +2 -2
  101. package/src/media-store/db.ts +2 -2
  102. package/src/media-store/forget.ts +118 -0
  103. package/src/media-store/purge.ts +3 -2
  104. package/src/media-store/space-listing.ts +20 -4
  105. package/src/media-store/space.ts +6 -5
  106. package/src/messages/guard.ts +49 -0
  107. package/src/messages/model.ts +1 -1
  108. package/src/messages/objects.ts +201 -0
  109. package/src/messages/routes.ts +2 -2
  110. package/src/messages/score.ts +1 -1
  111. package/src/messages/write.ts +285 -0
  112. package/src/pages/frame-client.ts +181 -4
  113. package/src/reflections/reflections-queue.ts +1 -1
  114. package/src/release/gate-checkout.ts +2 -1
  115. package/src/release/git-facts.ts +3 -2
  116. package/src/release/public-clean.ts +3 -2
  117. package/src/repo-config.ts +40 -18
  118. package/src/review/anim.ts +1 -1
  119. package/src/review/answer-kinds.ts +131 -0
  120. package/src/review/band.ts +53 -0
  121. package/src/review/branch-hold.ts +84 -0
  122. package/src/review/card-db.ts +16 -6
  123. package/src/review/card-rows.ts +4 -3
  124. package/src/review/cells.ts +297 -65
  125. package/src/review/close.ts +92 -0
  126. package/src/review/draft-card.ts +8 -16
  127. package/src/review/draft-model.ts +2 -2
  128. package/src/review/events.ts +171 -0
  129. package/src/review/format.ts +128 -14
  130. package/src/review/glyphs.ts +63 -0
  131. package/src/review/gone.ts +1 -1
  132. package/src/review/holds-sync.ts +62 -0
  133. package/src/review/holds.ts +85 -0
  134. package/src/review/house-kind-defs.ts +41 -0
  135. package/src/review/inbox-hook.ts +22 -9
  136. package/src/review/inbox-read.ts +201 -0
  137. package/src/review/instructions.ts +199 -0
  138. package/src/review/kind-apply.ts +61 -0
  139. package/src/review/kind-catalog.ts +96 -0
  140. package/src/review/kinds.ts +278 -0
  141. package/src/review/lane-ask.ts +109 -0
  142. package/src/review/model.ts +396 -86
  143. package/src/review/move.ts +3 -3
  144. package/src/review/need-address.ts +15 -0
  145. package/src/review/need-threads.ts +93 -0
  146. package/src/review/object-card.ts +48 -0
  147. package/src/review/object-read.ts +31 -0
  148. package/src/review/owner-verdict.ts +36 -0
  149. package/src/review/parties.ts +182 -0
  150. package/src/review/previews.ts +3 -1
  151. package/src/review/projections.ts +235 -0
  152. package/src/review/referring.ts +54 -0
  153. package/src/review/reflection-object.ts +195 -0
  154. package/src/review/routes.ts +137 -32
  155. package/src/review/secret-route.ts +80 -0
  156. package/src/review/snooze.ts +38 -0
  157. package/src/review/stage-card.ts +4 -4
  158. package/src/review/store.ts +366 -85
  159. package/src/review/supersede.ts +116 -0
  160. package/src/review/take-back.ts +52 -0
  161. package/src/review/thread-fold.ts +20 -7
  162. package/src/review/threads.ts +236 -39
  163. package/src/review/traces.ts +218 -0
  164. package/src/review/trailer-card.ts +2 -2
  165. package/src/review/unit.ts +71 -5
  166. package/src/review/verdict-items.ts +73 -0
  167. package/src/review/verdict-write.ts +15 -0
  168. package/src/review/wait.ts +85 -0
  169. package/src/review/watchers.ts +22 -9
  170. package/src/scaffold/files/claude-settings-local.json +2 -0
  171. package/src/secrets/archive-mark.ts +52 -0
  172. package/src/secrets/archive.ts +83 -0
  173. package/src/secrets/copy.ts +14 -14
  174. package/src/secrets/keychain-write.ts +48 -0
  175. package/src/secrets/keychain.ts +8 -5
  176. package/src/secrets/lapse-mark.ts +33 -0
  177. package/src/secrets/lapse.ts +60 -0
  178. package/src/secrets/list.ts +16 -22
  179. package/src/secrets/manager.ts +31 -16
  180. package/src/secrets/read.ts +161 -33
  181. package/src/secrets/tail.ts +31 -0
  182. package/src/serve/hub-app/asks-page.tsx +2 -1
  183. package/src/serve/hub-app/auto-text.tsx +14 -6
  184. package/src/serve/hub-app/benign-errors.ts +15 -1
  185. package/src/serve/hub-app/card-head.tsx +49 -0
  186. package/src/serve/hub-app/check-view.tsx +3 -2
  187. package/src/serve/hub-app/code-copy.ts +35 -0
  188. package/src/serve/hub-app/col-card.tsx +31 -40
  189. package/src/serve/hub-app/col-list-page.tsx +5 -2
  190. package/src/serve/hub-app/col-tables-view.tsx +7 -4
  191. package/src/serve/hub-app/col-tables.ts +5 -5
  192. package/src/serve/hub-app/cols-svc.ts +4 -79
  193. package/src/serve/hub-app/commands/commands-page.tsx +2 -1
  194. package/src/serve/hub-app/controls.css +83 -0
  195. package/src/serve/hub-app/frames-st.ts +17 -1
  196. package/src/serve/hub-app/git-view.tsx +3 -2
  197. package/src/serve/hub-app/home-st.ts +57 -6
  198. package/src/serve/hub-app/home-strip.css +1 -6
  199. package/src/serve/hub-app/home-strip.tsx +2 -1
  200. package/src/serve/hub-app/home.html +3 -0
  201. package/src/serve/hub-app/house-wiki-view.tsx +20 -0
  202. package/src/serve/hub-app/hub-app.tsx +48 -32
  203. package/src/serve/hub-app/hub-types.ts +2 -0
  204. package/src/serve/hub-app/hub.css +50 -61
  205. package/src/serve/hub-app/icons.tsx +14 -4
  206. package/src/serve/hub-app/identities-view.tsx +4 -3
  207. package/src/serve/hub-app/inbox-st.ts +203 -42
  208. package/src/serve/hub-app/inbox-view.tsx +189 -101
  209. package/src/serve/hub-app/inbox.css +47 -44
  210. package/src/serve/hub-app/index.html +3 -0
  211. package/src/serve/hub-app/instructions.css +30 -0
  212. package/src/serve/hub-app/keys.ts +5 -3
  213. package/src/serve/hub-app/machine-st.ts +2 -2
  214. package/src/serve/hub-app/machines-view.tsx +4 -11
  215. package/src/serve/hub-app/machines.css +0 -9
  216. package/src/serve/hub-app/markdown.css +51 -0
  217. package/src/serve/hub-app/md-copy.tsx +18 -40
  218. package/src/serve/hub-app/md.ts +25 -9
  219. package/src/serve/hub-app/media-view.tsx +2 -2
  220. package/src/serve/hub-app/messages/messages-page.tsx +2 -1
  221. package/src/serve/hub-app/messages/messages-st.ts +1 -1
  222. package/src/serve/hub-app/messages.css +0 -1
  223. package/src/serve/hub-app/objects.css +51 -0
  224. package/src/serve/hub-app/page-keys.ts +1 -1
  225. package/src/serve/hub-app/pages-frames.tsx +11 -1
  226. package/src/serve/hub-app/palette-st.ts +4 -4
  227. package/src/serve/hub-app/pane-boundary.tsx +72 -0
  228. package/src/serve/hub-app/pane-errors.ts +54 -0
  229. package/src/serve/hub-app/plan-view.tsx +3 -2
  230. package/src/serve/hub-app/planned-view.tsx +3 -3
  231. package/src/serve/hub-app/planned.css +0 -4
  232. package/src/serve/hub-app/processes-view.tsx +3 -2
  233. package/src/serve/hub-app/project-list.css +5 -13
  234. package/src/serve/hub-app/project-list.tsx +3 -6
  235. package/src/serve/hub-app/projects-svc.ts +6 -2
  236. package/src/serve/hub-app/readme.css +9 -15
  237. package/src/serve/hub-app/reflections-page.tsx +54 -1
  238. package/src/serve/hub-app/releases/releases-page.tsx +3 -2
  239. package/src/serve/hub-app/releases.css +0 -1
  240. package/src/serve/hub-app/review/code-colors.ts +30 -0
  241. package/src/serve/hub-app/review/diff-view.tsx +75 -0
  242. package/src/serve/hub-app/review/dock.tsx +104 -0
  243. package/src/serve/hub-app/review/draft-card.tsx +2 -2
  244. package/src/serve/hub-app/review/group-block.tsx +209 -0
  245. package/src/serve/hub-app/review/instructions-view.tsx +116 -0
  246. package/src/serve/hub-app/review/item-verdict.tsx +38 -0
  247. package/src/serve/hub-app/review/kind-states.tsx +193 -0
  248. package/src/serve/hub-app/review/kind-view.tsx +1 -37
  249. package/src/serve/hub-app/review/kit.tsx +57 -54
  250. package/src/serve/hub-app/review/lane-bar.tsx +64 -0
  251. package/src/serve/hub-app/review/object-card.tsx +62 -0
  252. package/src/serve/hub-app/review/object-panel.tsx +179 -0
  253. package/src/serve/hub-app/review/question-views.tsx +385 -0
  254. package/src/serve/hub-app/review/review-cells.tsx +86 -105
  255. package/src/serve/hub-app/review/review-list.tsx +104 -47
  256. package/src/serve/hub-app/review/review-page.tsx +5 -4
  257. package/src/serve/hub-app/review/review-st.ts +68 -28
  258. package/src/serve/hub-app/review/review-thread.tsx +171 -40
  259. package/src/serve/hub-app/review/review-views.tsx +35 -31
  260. package/src/serve/hub-app/review/thread-close.tsx +124 -0
  261. package/src/serve/hub-app/review/thread-control.tsx +4 -4
  262. package/src/serve/hub-app/review/thread-st.ts +222 -22
  263. package/src/serve/hub-app/review/trailer-card.tsx +1 -1
  264. package/src/serve/hub-app/review/trailer-timeline.tsx +2 -2
  265. package/src/serve/hub-app/review.css +216 -57
  266. package/src/serve/hub-app/section-head.tsx +51 -0
  267. package/src/serve/hub-app/social/calendar.tsx +5 -11
  268. package/src/serve/hub-app/social/comms-page.tsx +23 -10
  269. package/src/serve/hub-app/social/kit.tsx +8 -15
  270. package/src/serve/hub-app/social/next-release.tsx +3 -5
  271. package/src/serve/hub-app/social/post-card.tsx +3 -0
  272. package/src/serve/hub-app/social/post-page.tsx +80 -0
  273. package/src/serve/hub-app/social/problems.tsx +5 -9
  274. package/src/serve/hub-app/social/social-model.ts +13 -5
  275. package/src/serve/hub-app/social/social-page.tsx +1 -1
  276. package/src/serve/hub-app/social/social-st.ts +42 -5
  277. package/src/serve/hub-app/social.css +7 -17
  278. package/src/serve/hub-app/space.css +1 -1
  279. package/src/serve/hub-app/stores/stores-page.tsx +6 -2
  280. package/src/serve/hub-app/thread-row.tsx +101 -0
  281. package/src/serve/hub-app/time-ago.tsx +3 -2
  282. package/src/serve/hub-app/time-view.tsx +2 -1
  283. package/src/serve/hub-app/time.css +2 -5
  284. package/src/serve/hub-app/tree-row.tsx +1 -9
  285. package/src/serve/hub-app/vault-view.tsx +4 -4
  286. package/src/serve/hub-app/veille/veille-page.tsx +2 -11
  287. package/src/serve/hub-app/veille.css +0 -1
  288. package/src/serve/hub-app/waiting-svc.ts +4 -4
  289. package/src/serve/hub-app/when-view.tsx +6 -3
  290. package/src/serve/hub-app/wiki-st.ts +30 -4
  291. package/src/serve/hub-app/wikis-view.tsx +4 -3
  292. package/src/serve/hub-runtime.ts +20 -6
  293. package/src/serve/project-gutter-route.ts +16 -6
  294. package/src/serve/project-gutter.ts +6 -53
  295. package/src/serve/same-origin.ts +3 -0
  296. package/src/serve/secret-gate.ts +21 -0
  297. package/src/serve/serve-hub.ts +29 -20
  298. package/src/serve/tailnet-caller.ts +117 -0
  299. package/src/shipkit.ts +2 -2
  300. package/src/site/desk.ts +2 -2
  301. package/src/smoke/run-smoke.ts +3 -4
  302. package/src/social/brands.ts +4 -0
  303. package/src/social/card-drafts.ts +11 -19
  304. package/src/social/desk-index.ts +34 -13
  305. package/src/social/drafts.ts +4 -4
  306. package/src/social/import-drafts.ts +244 -0
  307. package/src/social/kind-pages.ts +3 -3
  308. package/src/social/kinds.ts +1 -1
  309. package/src/social/load.ts +89 -64
  310. package/src/social/media-kind.ts +68 -161
  311. package/src/social/media-of.ts +5 -4
  312. package/src/social/open.ts +3 -2
  313. package/src/social/post-object.ts +120 -0
  314. package/src/social/post-sources.ts +136 -0
  315. package/src/social/post-text.ts +103 -0
  316. package/src/social/posts.ts +378 -0
  317. package/src/social/presence.ts +7 -5
  318. package/src/social/publish/index.ts +17 -5
  319. package/src/social/publish/secret.ts +2 -2
  320. package/src/social/release-stage.ts +58 -57
  321. package/src/social/routes.ts +64 -24
  322. package/src/social/stage.ts +42 -57
  323. package/src/social/text.ts +4 -3
  324. package/src/social/thumbnail.ts +135 -43
  325. package/src/social/tracker.ts +1 -1
  326. package/src/social/writes.ts +12 -29
  327. package/src/stores/desk.ts +16 -11
  328. package/src/stores/unit.ts +2 -2
  329. package/src/trailer/sound/eleven.ts +33 -3
  330. package/src/urls/rows.ts +1 -1
  331. package/src/vault/vault-http.ts +11 -3
  332. package/src/vault/vault-import.ts +6 -1
  333. package/src/veille/identity.ts +2 -2
  334. package/src/wiki/graph-pages.ts +13 -1
  335. package/src/wiki/scan-md.ts +1 -1
  336. package/src/asks/asks-queue.ts +0 -424
  337. package/src/messages/suggest.ts +0 -96
  338. package/src/social/migrate.ts +0 -123
@@ -15,13 +15,6 @@
15
15
 
16
16
  /* a machine */
17
17
  .mcmachine{margin-top:var(--s3);border:1px solid var(--line);border-radius:6px;background:var(--panel);overflow:hidden}
18
- .mchead{all:unset;box-sizing:border-box;display:flex;align-items:center;gap:var(--s2);width:100%;padding:var(--s2) var(--s3);cursor:pointer}
19
- div.mchead{cursor:default}
20
- .mchead b{font-size:15px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
21
- .mchead:hover b{color:var(--accent)}
22
- div.mchead:hover b{color:inherit}
23
- .mchead:focus-visible{outline:1px solid var(--accent);outline-offset:-1px}
24
- .mchead .caret{flex:none;color:var(--dim)}
25
18
  .mcmine{flex:none;padding:0 var(--s2);border:1px solid var(--line);border-radius:999px;color:var(--dim);font-size:11.5px;line-height:18px}
26
19
  .mcmachine.gone{opacity:.6}
27
20
 
@@ -37,8 +30,6 @@ div.mchead:hover b{color:inherit}
37
30
  .mcdisk .tvspark{width:56px}
38
31
  .mcrepos{color:var(--dim)}
39
32
  .mcasks{margin-top:var(--s4);border:1px solid var(--line);border-radius:6px;background:var(--panel)}
40
- .mcasks .mchead{display:flex;flex-wrap:wrap;gap:0 var(--s3);align-items:baseline;cursor:default}
41
- .mcasks .mchead b{white-space:normal}
42
33
  .mcask{display:grid;grid-template-columns:140px minmax(0,1fr) auto;column-gap:var(--s3);padding:var(--s1) var(--s3);border-top:1px solid var(--hi3)}
43
34
  .mcask > span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
44
35
  @media (max-width:720px){.mcask{display:flex;flex-wrap:wrap;gap:0 var(--s3)}.mcask > span{white-space:normal}}
@@ -0,0 +1,51 @@
1
+ /* every markdown the hub draws (md.ts), one look on every page: a container `.md`, inline markdown `.mdi`.
2
+ A title sits apart from what is above it and close to its own section, a table and a code block take air above
3
+ them, a table's rows are striped under a distinct header, inline code is amber (--code, AA on each theme), every
4
+ code block copies from its button (code-copy.ts). Sizes are in em, so the look follows the text around it */
5
+ .md{font-size:12px;line-height:1.5;color:var(--ink)}
6
+ /* markdown that takes the type of the text around it (a post, a store text, a release line) */
7
+ .md.mdflow{font-size:inherit;line-height:inherit}
8
+ .md>:first-child{margin-top:0}
9
+ .md>:last-child{margin-bottom:0}
10
+
11
+ .md h1,.md h2,.md h3,.md h4,.md h5,.md h6{color:var(--accent);letter-spacing:.02em;line-height:1.3}
12
+ .md h1{font-size:1.12em}
13
+ .md h2{font-size:1.05em}
14
+ .md h3,.md h4,.md h5,.md h6{font-size:1em}
15
+ .md h1,.md h2{margin:calc(var(--s4) + var(--s2)) 0 var(--s2)}
16
+ .md h3,.md h4,.md h5,.md h6{margin:var(--s4) 0 var(--s1)}
17
+ .md p{margin:var(--s1) 0}
18
+ .md ul,.md ol{margin:var(--s1) 0;padding-left:var(--s4)}
19
+ .md li{margin:var(--s0) 0}
20
+ .md blockquote{margin:var(--s2) 0;padding:var(--s0) var(--s2);border-left:2px solid var(--line);color:var(--dim)}
21
+ .md hr{border:0;border-top:1px solid var(--line);margin:var(--s3) 0}
22
+ .md a{color:var(--accent)}
23
+
24
+ /* a table: air above it, odd rows striped, its header row tinted */
25
+ .md table{border-collapse:collapse;margin:var(--s3) 0 var(--s2);font-size:.95em;max-width:100%}
26
+ .md th,.md td{border:1px solid var(--line);padding:var(--s0) var(--s2);text-align:left;vertical-align:top}
27
+ /* a table's header row, every table of the app: the markdown's and the shared Table's (time-charts.tsx) */
28
+ .md th,.tvtable th{color:var(--accent);font-weight:650;letter-spacing:.05em;text-transform:uppercase;background:var(--panel2)}
29
+ .tvtable th{font-size:10.5px}
30
+ .md th{font-size:.88em;background:color-mix(in srgb,var(--accent) 14%,var(--panel2));border-bottom-color:color-mix(in srgb,var(--accent) 40%,var(--line))}
31
+ .md tbody tr:nth-child(odd)>td{background:color-mix(in srgb,var(--ink) 7%,transparent)}
32
+
33
+ /* inline code: amber on a faint amber wash */
34
+ .md code,.mdi code{display:inline;max-height:none;margin:0;padding:0 var(--s1);border-radius:4px;
35
+ font:.9em/1.4 ui-monospace,Menlo,monospace;color:var(--code);background:var(--codebg);
36
+ border:1px solid color-mix(in srgb,var(--code) 28%,transparent);white-space:pre-wrap;overflow-wrap:anywhere}
37
+
38
+ /* a code block, in its box with its « copy » button: shown on hover and on focus, always on a touch screen */
39
+ .mdpre{position:relative;margin:var(--s3) 0 var(--s2)}
40
+ .md>.mdpre:first-child{margin-top:0}
41
+ .md pre{margin:0;padding:var(--s2);background:var(--bg);border:1px solid var(--line);border-radius:4px;
42
+ overflow-x:auto;font:.92em/1.5 ui-monospace,Menlo,monospace;white-space:pre;transition:border-color .1s}
43
+ .md pre code{padding:0;border:0;background:none;color:var(--ink);font:inherit;white-space:inherit}
44
+ .mdcopy{position:absolute;top:var(--s1);right:var(--s1);height:22px;padding:0 var(--s2);font:11.5px system-ui,sans-serif;
45
+ color:var(--ink);background:var(--panel2);border:1px solid var(--line);border-radius:4px;cursor:pointer;opacity:0;transition:opacity .12s}
46
+ .mdpre:hover .mdcopy,.mdpre:focus-within .mdcopy{opacity:1}
47
+ .mdcopy:hover{border-color:var(--accent)}
48
+ .mdcopy.copied{opacity:1;color:var(--ok);border-color:var(--ok)}
49
+ .mdcopy.refused{opacity:1;color:var(--red);border-color:var(--red)}
50
+ .mdpre.copied pre{border-color:var(--ok)}
51
+ @media (hover:none){.mdcopy{opacity:1}}
@@ -1,7 +1,8 @@
1
1
  // markdown a human copies values out of (an ask): the readme's type scale, every inline code span a chip that a
2
- // click copies whole, every code block a « copy » button at its corner. A copy says so in a toast at the foot of the
3
- // page and tints what was copied, never with added text, so nothing moves. The html is md.ts renderMd's, so sanitized
4
- import { memo, useCallback, useEffect, useRef, useState } from 'react'
2
+ // click copies whole (a code block copies from its own button, as everywhere: code-copy.ts). A copy says so in a toast
3
+ // at the foot of the page and tints what was copied, never with added text, so nothing moves. The html is md.ts
4
+ // renderMd's, so sanitized
5
+ import { memo, useCallback, useEffect, useState } from 'react'
5
6
  import { createPortal } from 'react-dom'
6
7
  import { renderMd } from './md.ts'
7
8
 
@@ -40,40 +41,17 @@ export function CopyMd({ md, className = '' }: { md: string; className?: string
40
41
  )
41
42
  }
42
43
 
43
- /** the markdown itself, drawn again only when its html changes: a render rewrites the html and would drop the copy
44
- * buttons and the tint of what was just copied */
45
- const MdBox = memo(({ html, className, copy }: { html: string; className: string; copy: (text: string, el: Element) => void }) => {
46
- const box = useRef<HTMLDivElement | null>(null)
47
- // a code block takes its button after each render of the html: the sanitizer keeps no button in the markup
48
- useEffect(() => {
49
- for (const pre of box.current?.querySelectorAll('pre') ?? []) {
50
- if (pre.querySelector(':scope > .mdcopy')) continue
51
- const b = document.createElement('button')
52
- b.type = 'button'
53
- b.className = 'mdcopy ghost'
54
- b.textContent = 'copy'
55
- b.title = 'copy the whole block'
56
- pre.prepend(b)
57
- }
58
- }, [html])
59
- return (
60
- <div
61
- ref={box}
62
- className={`md readme-body mdcopyable ${className}`}
63
- dangerouslySetInnerHTML={{ __html: html }}
64
- onClick={(e) => {
65
- const t = e.target as Element
66
- const btn = t.closest('.mdcopy')
67
- const pre = btn?.parentElement
68
- if (btn && pre) {
69
- copy(pre.querySelector('code')?.textContent ?? '', pre)
70
- return
71
- }
72
- const code = t.closest('code')
73
- // a selection being made is never overwritten by a click's copy
74
- if (!code || code.closest('pre') || String(globalThis.getSelection?.() ?? '') !== '') return
75
- copy(code.textContent ?? '', code)
76
- }}
77
- />
78
- )
79
- })
44
+ /** the markdown itself, drawn again only when its html changes: a render rewrites the html and would drop the tint
45
+ * of what was just copied */
46
+ const MdBox = memo(({ html, className, copy }: { html: string; className: string; copy: (text: string, el: Element) => void }) => (
47
+ <div
48
+ className={`md readme-body mdcopyable ${className}`}
49
+ dangerouslySetInnerHTML={{ __html: html }}
50
+ onClick={(e) => {
51
+ const code = (e.target as Element).closest('code')
52
+ // a selection being made is never overwritten by a click's copy
53
+ if (!code || code.closest('pre') || String(globalThis.getSelection?.() ?? '') !== '') return
54
+ copy(code.textContent ?? '', code)
55
+ }}
56
+ />
57
+ ))
@@ -14,16 +14,23 @@ const CARD_TAGS = [
14
14
  'code', 'pre', 'strong', 'em', 'b', 'i', 'a', 'br', 'blockquote', 'hr',
15
15
  ]
16
16
 
17
+ /** every code block in a box with its « copy » button (code-copy.ts answers its click): added after the sanitizer,
18
+ * which keeps no button, and outside the block, so the button stays put while the block scrolls sideways */
19
+ const withCopy = (html: string): string =>
20
+ html.replaceAll('<pre>', '<div class="mdpre"><pre>').replaceAll('</pre>', '</pre><button type="button" class="mdcopy" title="copy the whole block">copy</button></div>')
21
+
17
22
  export const renderMd = (src: string): string =>
18
- sanitizeHtml(marked.parse(src) as string, {
23
+ withCopy(sanitizeHtml(marked.parse(src) as string, {
19
24
  allowedTags: CARD_TAGS,
20
25
  allowedAttributes: { a: ['href', 'target', 'rel'] },
21
26
  allowedSchemes: ['http', 'https'],
22
27
  allowProtocolRelative: false,
28
+ // a placeholder an agent writes (`<address>`) shows as written, never vanishes as an unknown tag
29
+ disallowedTagsMode: 'escape',
23
30
  transformTags: {
24
31
  a: (tagName, attribs) => ({ tagName, attribs: { ...attribs, target: '_blank', rel: 'noreferrer' } }),
25
32
  },
26
- })
33
+ }))
27
34
 
28
35
  /** ONE LINE of markdown, for text that already carries a line structure of
29
36
  * its own. A wire line keeps its prefix and its place in the log, and the
@@ -35,6 +42,8 @@ export const renderMdInline = (src: string): string =>
35
42
  allowedAttributes: { a: ['href', 'target', 'rel'] },
36
43
  allowedSchemes: ['http', 'https'],
37
44
  allowProtocolRelative: false,
45
+ // a placeholder an agent writes (`<address>`) shows as written, never vanishes as an unknown tag
46
+ disallowedTagsMode: 'escape',
38
47
  transformTags: {
39
48
  a: (tagName, attribs) => ({ tagName, attribs: { ...attribs, target: '_blank', rel: 'noreferrer' } }),
40
49
  },
@@ -55,7 +64,7 @@ export const readmeImageSrc = (src: string, fileUrl: (rel: string) => string): s
55
64
  * lean on. A relative image is rewritten to the repo's file route, an image
56
65
  * with no loadable source is dropped */
57
66
  export const renderReadme = (src: string, fileUrl: (rel: string) => string): string =>
58
- sanitizeHtml(marked.parse(src) as string, {
67
+ withCopy(sanitizeHtml(marked.parse(src) as string, {
59
68
  allowedTags: [...CARD_TAGS, 'h5', 'h6', 'img', 'details', 'summary', 'kbd', 'sup', 'sub', 'del'],
60
69
  allowedAttributes: { a: ['href', 'target', 'rel'], img: ['src', 'alt', 'title', 'width', 'height'] },
61
70
  allowedSchemes: ['http', 'https'],
@@ -69,7 +78,7 @@ export const renderReadme = (src: string, fileUrl: (rel: string) => string): str
69
78
  },
70
79
  },
71
80
  exclusiveFilter: (frame) => frame.tag === 'img' && (frame.attribs.src ?? '') === '',
72
- })
81
+ }))
73
82
 
74
83
  /** a wiki page in the wikis page's preview: the card allowlist, and every ref
75
84
  * the server resolved (`links`, token → node, graph-pages.ts) as an anchor
@@ -77,7 +86,7 @@ export const renderReadme = (src: string, fileUrl: (rel: string) => string): str
77
86
  * the sheet tells them apart: `@` loads with the page (eager), `→`, a link or
78
87
  * a path in a code span is read on demand (lazy, written `→ path` here
79
88
  * whatever the page wrote) */
80
- export const renderWikiPage = (src: string, links: Record<string, string>): string => {
89
+ export const renderWikiPage = (src: string, links: Record<string, string>, image?: (rel: string) => string | null): string => {
81
90
  const to = (t: string, eager = false): string | null => (links[t] == null ? null : `#wiki${eager ? '-eager' : ''}:${encodeURIComponent(links[t]!)}`)
82
91
  // fences stay as written: a ref in a code block is an example, not a link
83
92
  const linked = src.split(/(^```[\s\S]*?^```\s*$)/m).map((part, i) => i % 2 === 1 ? part : part
@@ -87,12 +96,19 @@ export const renderWikiPage = (src: string, links: Record<string, string>): stri
87
96
  // a code span that is exactly a page's path: a lazy ref, its arrow added unless the page wrote one
88
97
  .replace(/(→\s*)?(?<!\[)`([\w.][\w./-]*\.md)`/g, (m, arrow: string | undefined, t: string) => (to(t) == null ? m : `${arrow ?? '→ '}[\`${t}\`](${to(t)})`)),
89
98
  ).join('')
90
- return sanitizeHtml(marked.parse(linked) as string, {
91
- allowedTags: [...CARD_TAGS, 'h5', 'h6', 'del'],
92
- allowedAttributes: { a: ['href', 'target', 'rel', 'data-wiki', 'data-ref'] },
99
+ return withCopy(sanitizeHtml(marked.parse(linked) as string, {
100
+ // a picture only through `image`: a file of the wiki itself (a generated page's icons), never a remote url
101
+ allowedTags: [...CARD_TAGS, 'h5', 'h6', 'del', ...(image ? ['img'] : [])],
102
+ allowedAttributes: { a: ['href', 'target', 'rel', 'data-wiki', 'data-ref'], img: ['src', 'alt', 'title', 'width', 'height'] },
93
103
  allowedSchemes: ['http', 'https'],
94
104
  allowProtocolRelative: false,
105
+ exclusiveFilter: (frame) => frame.tag === 'img' && (frame.attribs.src ?? '') === '',
95
106
  transformTags: {
107
+ img: (tagName, attribs): sanitizeHtml.Tag => {
108
+ const { src: raw, ...rest } = attribs
109
+ const src = image?.(raw ?? '') ?? null
110
+ return { tagName, attribs: src == null ? rest : { ...rest, src } }
111
+ },
96
112
  a: (tagName, attribs): sanitizeHtml.Tag => {
97
113
  const href = attribs.href ?? ''
98
114
  const ref = /^#wiki(-eager)?:(.*)$/.exec(href)
@@ -100,5 +116,5 @@ export const renderWikiPage = (src: string, links: Record<string, string>): stri
100
116
  return { tagName, attribs: { ...attribs, target: '_blank', rel: 'noreferrer' } }
101
117
  },
102
118
  },
103
- })
119
+ }))
104
120
  }
@@ -164,7 +164,7 @@ export const ToolsBar = observer(({ app }: { app: RepoSt }) => {
164
164
  ) : null}
165
165
  <span className="sp" />
166
166
  <button className="ghost" onClick={() => m.toggleVariants()}>
167
- {m.variantsOpen ? 'variants ▸' : `variants (${d.rolls.length}) ◂`}
167
+ <Caret side open={m.variantsOpen} /> {m.variantsOpen ? 'variants' : `variants (${d.rolls.length})`}
168
168
  </button>
169
169
  </div>
170
170
  )
@@ -181,7 +181,7 @@ export const VariantsBar = observer(({ app }: { app: RepoSt }) => {
181
181
  if (m.curId == null) return null
182
182
  if (!m.variantsOpen) return (
183
183
  <div className="vbar closed" title="open the variants bar" onClick={() => m.toggleVariants()}>
184
- <span className="vcount">{rolls.length}</span>◂
184
+ <span className="vcount">{rolls.length}</span><Caret side open={false} />
185
185
  </div>
186
186
  )
187
187
  return (
@@ -9,6 +9,7 @@ import { MESSAGES_TABS } from '../../../messages/tabs.ts'
9
9
  import type { RepoSt } from '../repo-st.ts'
10
10
  import { NEW_FAMILY, type MessagesSt, type RunView, type StoreView } from './messages-st.ts'
11
11
  import { ThreadControl } from '../review/thread-control.tsx'
12
+ import { SectionHead } from '../section-head.tsx'
12
13
 
13
14
  type Msg = StoreView['messages'][number]
14
15
 
@@ -169,7 +170,7 @@ const Messages = observer(({ ms }: { ms: MessagesSt }) => {
169
170
  <Note ms={ms} at="" />
170
171
  {[...families].map(([f, list]) => (
171
172
  <div key={f} className="msg-family">
172
- <h2>{f}</h2>
173
+ <SectionHead label={f} n={list.length} />
173
174
  {list.map((m) => (
174
175
  <MessageCard key={m.id} ms={ms} m={m} />
175
176
  ))}
@@ -3,7 +3,7 @@
3
3
  // Its one write is the owner's suggestion (a message, a phrasing), sent with the hash of the file it read
4
4
  import { makeAutoObservable, runInAction } from 'mobx'
5
5
  import type { RunView, StoreView } from '../../../messages/score.ts'
6
- import type { MessageSuggestion, Suggestion } from '../../../messages/suggest.ts'
6
+ import type { MessageSuggestion, Suggestion } from '../../../messages/write.ts'
7
7
  import type { MessagesTab } from '../../../messages/tabs.ts'
8
8
  import { reach } from '../reach.ts'
9
9
  import type { RepoSt } from '../repo-st.ts'
@@ -8,7 +8,6 @@
8
8
  .msg-page nav button,.msg-page select{font:inherit;padding:var(--s1) var(--s3);border-radius:7px;border:1px solid var(--line);background:var(--panel);color:var(--ink);cursor:pointer}
9
9
  .msg-page nav button.on{background:var(--accent);border-color:var(--accent);color:var(--panel)}
10
10
  .msg-family{display:grid;gap:var(--s3)}
11
- .msg-family h2{font-size:13px;text-transform:uppercase;letter-spacing:.08em;color:var(--dim);margin:var(--s3) 0 0}
12
11
  .msg-card{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:var(--s3) var(--s4);display:grid;gap:var(--s2);min-width:0}
13
12
  .msg-card h3{margin:0;font-size:15px}
14
13
  .msg-card h3 small{color:var(--dim);font-weight:400;margin-left:var(--s2)}
@@ -0,0 +1,51 @@
1
+ /* a post group where a thread refers to it (review/group-block.tsx), and a post's own page in Communications (social/post-page.tsx) */
2
+ .ob-error{color:var(--red);padding:var(--s2) var(--s3);white-space:pre-wrap}
3
+ .ob-draft{margin:var(--s3) var(--s2);padding:var(--s3);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:8px;background:var(--panel2);display:flex;flex-direction:column;gap:var(--s2)}
4
+ .ob-head{display:flex;align-items:baseline;gap:var(--s2);flex-wrap:wrap}
5
+ .ob-kind{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--dim)}
6
+ .ob-places{display:flex;flex-direction:column;gap:var(--s1)}
7
+ .ob-place{display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap;padding:var(--s1) 0;border-bottom:1px dashed var(--line)}
8
+ .ob-place:last-child{border-bottom:0}
9
+ .ob-place a{color:var(--ok);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
10
+ .ob-place input{flex:1;min-width:160px}
11
+ .ob-account{min-width:140px;font-weight:600}
12
+ .ob-s-dropped .ob-account{color:var(--dim);text-decoration:line-through}
13
+ .ob-refused{font-size:12px;color:var(--warn)}
14
+ .ob-words{flex-basis:100%;font-size:12px}
15
+ .ob-words summary{cursor:pointer}
16
+ .ob-words .rv-pre{white-space:pre-wrap;padding:var(--s2);background:var(--bg);border-radius:6px}
17
+ .ob-acts{display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap}
18
+ .ob-versions summary{cursor:pointer;color:var(--dim);font-size:12px}
19
+ .so-postpage .so-text{white-space:pre-wrap}
20
+ .so-threadrefs{display:flex;flex-direction:column;gap:var(--s1)}
21
+ .so-threadref{display:flex;align-items:center;gap:var(--s2);color:var(--ink);text-decoration:none;padding:var(--s1) var(--s2);border-radius:6px}
22
+ .so-threadref:hover{background:var(--panel2)}
23
+ .so-threadref.open{font-weight:600}
24
+ .so-cmd{display:inline-flex;align-items:center;gap:var(--s1)}
25
+ .so-cmd code{font-size:12px}
26
+ @media (max-width:640px){.ob-account{min-width:0}.ob-draft{margin:var(--s2) 0}}
27
+ /* four states in a narrow filter column: two by two, never past its width */
28
+ .seg.so-stateseg{display:grid;grid-template-columns:1fr 1fr;width:100%;height:auto;border-radius:8px}
29
+ .seg.so-stateseg button{min-width:0;height:22px}
30
+ /* an object's card where a thread shows it (review/object-card.tsx): a persona, a value proposition, a page top */
31
+ .oc-card{padding:var(--s3);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:8px;background:var(--panel2);display:flex;flex-direction:column;gap:var(--s2);min-width:0}
32
+ .oc-title{font-weight:600}
33
+ .oc-chip{font-size:11px;padding:0 var(--s1);border:1px solid var(--line);border-radius:3px;color:var(--dim)}
34
+ .oc-fields{display:flex;flex-direction:column;gap:var(--s1)}
35
+ .oc-field{display:grid;grid-template-columns:minmax(56px,84px) minmax(0,1fr);gap:var(--s2);align-items:baseline}
36
+ .oc-field.fill .oc-text{color:var(--warn);font-style:italic}
37
+ .oc-label{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--dim)}
38
+ .oc-lines{display:flex;flex-direction:column;border-top:1px solid var(--line)}
39
+ .oc-line{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:var(--s2);align-items:start;padding:var(--s1) 0;border-bottom:1px solid var(--line)}
40
+ .oc-id{font-family:var(--mono,monospace);font-size:11px;color:var(--dim);padding-top:var(--s0)}
41
+ .oc-words{display:flex;flex-direction:column;gap:var(--s0);min-width:0}
42
+ .oc-second{color:var(--dim)}
43
+ .oc-note{font-size:11px;color:var(--dim)}
44
+ .oc-scores{display:flex;flex-wrap:wrap;gap:var(--s1)}
45
+ .oc-score{font-size:11px;padding:0 var(--s1);border-radius:3px;border:1px solid var(--line);font-variant-numeric:tabular-nums}
46
+ .oc-who{color:var(--dim);margin-right:var(--s1)}
47
+ .oc-best{font-weight:700;font-variant-numeric:tabular-nums;min-width:2.2em;text-align:right}
48
+ .oc-score.hi,.oc-best.hi{color:var(--ok)}
49
+ .oc-score.mid,.oc-best.mid{color:var(--warn)}
50
+ .oc-score.lo,.oc-best.lo,.oc-score.veto{color:var(--red)}
51
+ .oc-run{font-size:11px;color:var(--dim)}
@@ -80,7 +80,7 @@ export const pageKeys = (home: HomeSt, embed: string | null) => (e: KeyboardEven
80
80
  if (pk.t === 'picker' || pk.t === 'search') home.palette.toggle()
81
81
  else if (pk.t === 'dock') home.dock.cycle()
82
82
  else if (pk.t === 'rail') home.layout.toggleRail()
83
- else if (pk.t === 'home' || pk.t === 'inbox' || pk.t === 'planned' || pk.t === 'activity' || pk.t === 'insights') {
83
+ else if (pk.t === 'home' || pk.t === 'wiki' || pk.t === 'inbox' || pk.t === 'planned' || pk.t === 'activity' || pk.t === 'insights') {
84
84
  home.palette.close()
85
85
  if (home.machine != null) home.navigate(PLACE_PATH[pk.t === 'home' ? 'overview' : pk.t])
86
86
  } else if (pk.t === 'step') {
@@ -8,7 +8,7 @@ import { useEffect, useRef, useState } from 'react'
8
8
  import type { RepoSt } from './repo-st.ts'
9
9
  import { postJson } from './review/review-kit.ts'
10
10
 
11
- type Msg = { shipkit?: unknown; keys?: unknown; title?: unknown; badge?: unknown; hash?: unknown; key?: unknown; code?: unknown; altKey?: unknown; shiftKey?: unknown; metaKey?: unknown; ctrlKey?: unknown; address?: unknown; name?: unknown; text?: unknown }
11
+ type Msg = { shipkit?: unknown; keys?: unknown; title?: unknown; badge?: unknown; hash?: unknown; key?: unknown; code?: unknown; altKey?: unknown; shiftKey?: unknown; metaKey?: unknown; ctrlKey?: unknown; address?: unknown; name?: unknown; text?: unknown; id?: unknown; addresses?: unknown }
12
12
 
13
13
  /** the keys a frame passes up as typed on the hub: ⌥ letters, ⌥⇧ letters, the home's ⌘ keys */
14
14
  function replayKey(m: Msg): void {
@@ -85,6 +85,16 @@ const PageFrame = observer(({ app, id, on }: { app: RepoSt; id: string; on: bool
85
85
  if (typeof m.address === 'string' && typeof m.text === 'string')
86
86
  void postJson<{ id: string }>(app.url('/api/review/note'), { address: m.address, name: typeof m.name === 'string' ? m.name : m.address, text: m.text, from: id }).then((r) => app.showReview(r.id))
87
87
  return
88
+ case 'threads-of': {
89
+ const asked = Array.isArray(m.addresses) ? m.addresses.filter((a): a is string => typeof a === 'string') : []
90
+ if (typeof m.id !== 'number' || asked.length === 0) return
91
+ const answer = (objects: unknown[]): void => post({ shipkit: 'threads-of', id: m.id, objects })
92
+ fetch(app.url(`/api/review/of?${asked.map((a) => `address=${encodeURIComponent(a)}`).join('&')}`))
93
+ .then((r) => (r.ok ? (r.json() as Promise<{ objects: unknown[] }>) : { objects: [] }))
94
+ .then((r) => answer(r.objects))
95
+ .catch(() => answer([]))
96
+ return
97
+ }
88
98
  case 'key': return replayKey(m)
89
99
  }
90
100
  }
@@ -85,14 +85,14 @@ export class PaletteSt {
85
85
  return st.projects.list.filter((p) => p.name !== on).flatMap((p) => ANY_REPO_PAGES.map((id) => ({ id: `page:${p.name}/${id}`, label: sectionLabel(id), section: 'page', repo: p.name, face: { repo: p.name }, run: () => st.openPage(p.name, id) })))
86
86
  }
87
87
 
88
- /** what waits for the owner in every repo, the shown one too: an ask under its number, a card under its title,
89
- * opened on the inbox. They come once the inbox answers */
88
+ /** every thread that waits for the owner in every repo, the shown one too, under its title (an ask with no thread
89
+ * yet under its number too) and what it waits on, opened on the inbox. They come once the inbox answers */
90
90
  get waiting(): Jump[] {
91
91
  const st = this.st
92
92
  if (st.machine == null) return []
93
93
  return st.waiting.rows.map((r) => {
94
- const n = r.kind === 'ask' ? /^ask:(\d+)-/.exec(r.id)?.[1] : null
95
- return { id: `waiting:${r.repo}/${r.id}`, label: n != null ? `${n} · ${r.title}` : r.title, section: r.kind, repo: r.repo, face: { repo: r.repo }, run: () => st.navigate(r.open) }
94
+ const n = /^ask:(\d+)-/.exec(r.id)?.[1]
95
+ return { id: `waiting:${r.repo}/${r.id}`, label: n != null ? `${n} · ${r.title}` : r.title, section: r.wait, repo: r.repo, face: { repo: r.repo }, run: () => st.navigate(r.open) }
96
96
  })
97
97
  }
98
98
 
@@ -0,0 +1,72 @@
1
+ // one pane of the hub that fails to draw shows a small card in its own place, and every other pane keeps working: a
2
+ // lane's half edit served by the hot reload, a bad value in one message. The card names what failed, gives the error's
3
+ // first line, « reload this pane » (a remount) and « copy error » (the whole text, for an agent). React reports what a
4
+ // boundary caught through the console, never as a window error, so bun's dev overlay never covers the hub for it
5
+ import { observer } from 'mobx-react-lite'
6
+ import { Component, Fragment, useState, type ErrorInfo, type ReactNode } from 'react'
7
+ import { errorText, panes, type PaneError } from './pane-errors.ts'
8
+ import { copyText } from './review/review-kit.ts'
9
+
10
+ type Props = {
11
+ /** what the pane is ('sidebar', 'thread cell'): the card's words, and what a trip names */
12
+ pane: string
13
+ /** whose pane it is (a repo, a message id), shown before the kind */
14
+ at?: string
15
+ /** a failed pane draws again once this moves (the page it shows): a healthy one never remounts for it */
16
+ resetKey?: string
17
+ children: ReactNode
18
+ }
19
+ type State = { failed: PaneError | null; thrown: unknown; gen: number }
20
+
21
+ export class PaneBoundary extends Component<Props, State> {
22
+ override state: State = { failed: null, thrown: null, gen: 0 }
23
+
24
+ static getDerivedStateFromError(thrown: unknown): Partial<State> {
25
+ return { thrown }
26
+ }
27
+
28
+ override componentDidCatch(err: unknown, info: ErrorInfo): void {
29
+ this.setState({ failed: panes.report(this.path, err, info.componentStack ?? '') })
30
+ }
31
+
32
+ override componentDidUpdate(prev: Props): void {
33
+ if (prev.resetKey !== this.props.resetKey && (this.state.thrown != null || this.state.failed != null)) this.reload()
34
+ }
35
+
36
+ get path(): string {
37
+ return this.props.at == null || this.props.at === '' ? this.props.pane : `${this.props.at} › ${this.props.pane}`
38
+ }
39
+
40
+ private readonly reload = (): void => this.setState((s) => ({ failed: null, thrown: null, gen: s.gen + 1 }))
41
+
42
+ override render(): ReactNode {
43
+ if (this.state.thrown != null || this.state.failed != null) return <PaneCard path={this.path} failed={this.state.failed} thrown={this.state.thrown} reload={this.reload} />
44
+ return (
45
+ <Fragment key={this.state.gen}>
46
+ <Trip kind={this.props.pane} path={this.path} />
47
+ {this.props.children}
48
+ </Fragment>
49
+ )
50
+ }
51
+ }
52
+
53
+ /** throws while the pane is tripped (pane-errors.ts) */
54
+ const Trip = observer(({ kind, path }: { kind: string; path: string }) => {
55
+ if (panes.isTripped(kind, path)) throw new Error(`the ${path} pane was tripped on purpose (app.panes.untrip to clear it)`)
56
+ return null
57
+ })
58
+
59
+ const PaneCard = ({ path, failed, thrown, reload }: { path: string; failed: PaneError | null; thrown: unknown; reload: () => void }) => {
60
+ const [copied, setCopied] = useState(false)
61
+ const line = failed?.message ?? (thrown instanceof Error ? `${thrown.name}: ${thrown.message}` : String(thrown)).split('\n')[0]
62
+ return (
63
+ <div className="pane-err" role="alert" data-pane={path}>
64
+ <b>the {path} pane failed to draw</b>
65
+ <code>{line}</code>
66
+ <span className="pane-errrow">
67
+ <button onClick={reload}>reload this pane</button>
68
+ <button className="ghost" disabled={failed == null} onClick={() => failed != null && void copyText(errorText(failed)).then(setCopied)}>{copied ? 'copied' : 'copy error'}</button>
69
+ </span>
70
+ </div>
71
+ )
72
+ }
@@ -0,0 +1,54 @@
1
+ // what failed to draw in the hub, pane by pane (pane-boundary.tsx). A caught error is loud where agents look: the
2
+ // page console, which `sk shot` and the browser checks read, and the daemon's log on the home, one line each
3
+ // (home-routes.ts, /api/home/page-error). `trip` makes a pane throw on its next draw: the browser check's trigger, and a
4
+ // console probe (`app.panes.trip('sidebar')`)
5
+ import { makeAutoObservable, observable } from 'mobx'
6
+
7
+ export type PaneError = { pane: string; message: string; stack: string; components: string; at: number; url: string }
8
+
9
+ /** the first line of what was thrown, the line the card shows */
10
+ export const firstLine = (e: unknown): string => {
11
+ const s = e instanceof Error ? `${e.name}: ${e.message}` : String(e)
12
+ return s.split('\n')[0] ?? s
13
+ }
14
+
15
+ /** everything an agent needs to find the cause, as one text */
16
+ export const errorText = (e: PaneError): string =>
17
+ [`the hub's ${e.pane} pane failed to draw: ${e.message}`, `at ${e.url}`, e.stack, e.components === '' ? '' : `components:${e.components}`].filter((l) => l !== '').join('\n')
18
+
19
+ /** how many caught errors the page keeps for the console */
20
+ const KEPT = 50
21
+
22
+ export class PaneErrors {
23
+ list: PaneError[] = []
24
+ readonly tripped = observable.set<string>()
25
+
26
+ constructor() {
27
+ makeAutoObservable(this, { tripped: false })
28
+ }
29
+
30
+ report(pane: string, err: unknown, components: string): PaneError {
31
+ const e: PaneError = { pane, message: firstLine(err), stack: err instanceof Error ? (err.stack ?? '') : '', components, at: Date.now(), url: location.href }
32
+ this.list = [...this.list.slice(-(KEPT - 1)), e]
33
+ console.error(errorText(e))
34
+ if (document.body.dataset.home != null)
35
+ void fetch('/api/home/page-error', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ pane, message: e.message, url: e.url }) }).catch(() => {})
36
+ return e
37
+ }
38
+
39
+ trip(pane: string): void {
40
+ this.tripped.add(pane)
41
+ }
42
+
43
+ untrip(pane: string): void {
44
+ this.tripped.delete(pane)
45
+ }
46
+
47
+ /** a pane trips by its kind ('sidebar') or its whole path ('app › sidebar') */
48
+ isTripped(kind: string, path: string): boolean {
49
+ return this.tripped.has(kind) || this.tripped.has(path)
50
+ }
51
+ }
52
+
53
+ /** the one log of the page, under the root as `app.panes` */
54
+ export const panes = new PaneErrors()
@@ -3,6 +3,7 @@
3
3
  // the machine's plan, already carried by /api/resources.json, so the page
4
4
  // reads nothing of its own. The home's planned page is the same plan for
5
5
  // every repo at once.
6
+ import { CardHead } from './card-head.tsx'
6
7
  import { observer } from 'mobx-react-lite'
7
8
  import type { PlanRow } from '../../plan/planner.ts'
8
9
  import { LAST_TONE, markOf, reasonWords, whenWords } from './planned-st.ts'
@@ -44,8 +45,8 @@ export const PlanPage = observer(({ app }: { app: RepoSt }) => {
44
45
  </div>
45
46
  <div className="usays">what the machine runs here on its own time, soonest first. Every repo at once: the planned page (⌘')</div>
46
47
  {app.cols.planned == null ? <div className="dim">no plan covers this repo</div> : null}
47
- {timed.length > 0 ? <section className="csec"><div className="cstitle">next</div><PlanTable app={app} rows={timed} /></section> : null}
48
- {onSave.length > 0 ? <section className="csec"><div className="cstitle">on a save only</div><PlanTable app={app} rows={onSave} /></section> : null}
48
+ {timed.length > 0 ? <section className="csec"><CardHead title="next" n={timed.length} /><PlanTable app={app} rows={timed} /></section> : null}
49
+ {onSave.length > 0 ? <section className="csec"><CardHead title="on a save only" n={onSave.length} /><PlanTable app={app} rows={onSave} /></section> : null}
49
50
  </div>
50
51
  )
51
52
  })
@@ -15,7 +15,7 @@ import type { HomeSt } from './home-st.ts'
15
15
  import { checkAddress, plainClick, repoPage } from './home-st.ts'
16
16
  import { LAST_TONE, markOf, reasonWords, whenWords, type Section } from './planned-st.ts'
17
17
  import { ageWords, stampWords } from './time-ago.tsx'
18
- import { Caret } from './icons.tsx'
18
+ import { SectionHead } from './section-head.tsx'
19
19
 
20
20
  /** a link that works as one (a new tab on cmd+click) and moves in place on a plain click */
21
21
  const InPlace = ({ href, className, go, children }: { href: string; className: string; go: () => void; children: ReactNode }) => (
@@ -100,13 +100,13 @@ export const PlannedView = observer(({ app }: { app: HomeSt }) => {
100
100
  const item = <Row key={`${row.repo}\0${row.check}`} app={app} r={row} now={now} />
101
101
  if (section === prev) return [item]
102
102
  prev = section
103
- return [<div key={`s:${section}`} className="plsec">{section}</div>, item]
103
+ return [<SectionHead key={`s:${section}`} label={section} />, item]
104
104
  })}
105
105
  {d == null ? <div className="pldim">loading…</div> : st.rows.length === 0 ? <div className="pldim">{st.timed === 0 ? 'nothing is planned' : 'nothing matches'}</div> : null}
106
106
  </div>
107
107
  {st.waitingLine !== '' ? (
108
108
  <div className="plwait">
109
- <button className="plwaitline" aria-expanded={st.waitingOpen} onClick={() => st.toggleWaiting()}><Caret open={st.waitingOpen} /> {st.waitingLine}</button>
109
+ <SectionHead label={st.waitingLine} open={st.waitingOpen} onFold={() => st.toggleWaiting()} />
110
110
  {st.waitingOpen ? <div className="pllist">{st.waiting.map((r) => <Row key={`${r.repo}\0${r.check}`} app={app} r={r} now={now} />)}</div> : null}
111
111
  </div>
112
112
  ) : null}
@@ -6,8 +6,6 @@
6
6
  .plfind{display:block;width:240px;max-width:100%;box-sizing:border-box;margin-bottom:var(--s3);background:var(--bg);color:var(--ink);border:1px solid var(--line);border-radius:4px;padding:var(--s1) var(--s2);font:inherit}
7
7
  .plfind:focus{outline:none;border-color:var(--accent)}
8
8
  .pllist{max-width:560px}
9
- .plsec{margin-top:var(--s3);padding:var(--s1) var(--s2);color:var(--dim);text-transform:lowercase}
10
- .plsec:first-child{margin-top:0}
11
9
  .plr{display:grid;grid-template-columns:64px minmax(0,1fr) auto;align-items:center;column-gap:var(--s3);padding:var(--s0) var(--s2);border-radius:3px;white-space:nowrap}
12
10
  .plr:hover{background:var(--panel)}
13
11
  .plwhen{color:var(--dim);font-variant-numeric:tabular-nums}
@@ -25,8 +23,6 @@
25
23
  .s-due{background:var(--ink)}
26
24
  .s-waiting{border:1px dashed var(--dim)}
27
25
  .plwait{margin-top:var(--s3)}
28
- .plwaitline{all:unset;cursor:pointer;color:var(--dim);font-size:12px}
29
- .plwaitline:hover{color:var(--ink)}
30
26
  .s-failed{width:auto;height:auto;border-radius:0;font-style:normal;color:var(--red)}
31
27
  .s-failed::before{content:'✕'}
32
28
  .m-failed .plmark{color:var(--red)}
@@ -2,6 +2,7 @@
2
2
  // lines alone, never a card per process. The process a tree row opened gets
3
3
  // its description and its log under the table. pm runs them, so the page
4
4
  // reads the machine, never the hub.
5
+ import { CardHead } from './card-head.tsx'
5
6
  import { observer } from 'mobx-react-lite'
6
7
  import { useEffect, useRef } from 'react'
7
8
  import { Log, ProcessMenu, ProcessTable } from './home-strip.tsx'
@@ -18,9 +19,9 @@ const ProcessDetail = observer(({ app, r }: { app: RepoSt; r: ProcessRow }) => {
18
19
  if (m == null) return null
19
20
  return (
20
21
  <section ref={el} className="csec pdetail" id={`process-${r.id}`}>
21
- <div className="cstitle">{r.label}</div>
22
+ <CardHead title={r.label} />
22
23
  <ProcessMenu m={m} r={r} close={noop} lastLog={r.tail.length === 0} />
23
- {r.tail.length === 0 ? null : <><div className="cstitle">log</div><Log lines={r.tail} /></>}
24
+ {r.tail.length === 0 ? null : <><CardHead title="log" /><Log lines={r.tail} /></>}
24
25
  </section>
25
26
  )
26
27
  })