rvlib-shipkit 2.26.0 → 2.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (442) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/package.json +1 -1
  3. package/src/agent-time/diet.ts +77 -0
  4. package/src/agent-time/family.ts +72 -0
  5. package/src/agent-time/hooks.ts +6 -4
  6. package/src/agent-time/limits.ts +44 -0
  7. package/src/agent-time/live.ts +1 -3
  8. package/src/agent-time/mask.ts +96 -18
  9. package/src/agent-time/refused.ts +45 -0
  10. package/src/agent-time/render.ts +122 -21
  11. package/src/agent-time/report-cache.ts +57 -0
  12. package/src/agent-time/report.ts +314 -40
  13. package/src/agent-time/shape.ts +50 -3
  14. package/src/agent-time/store.ts +320 -99
  15. package/src/agent-time/timeline.ts +140 -21
  16. package/src/agent-time/turns.ts +18 -8
  17. package/src/annex/offload.ts +17 -6
  18. package/src/annex/tidy.ts +70 -10
  19. package/src/asks/ask-after.ts +40 -0
  20. package/src/asks/asks-queue.ts +205 -47
  21. package/src/assets/kit-config.ts +7 -3
  22. package/src/assets/kits/identity-kit.ts +289 -10
  23. package/src/check.ts +3 -1
  24. package/src/checks/SK004-gitignore-policy.check.ts +12 -5
  25. package/src/checks/SK013-one-way-in-policy.check.ts +8 -3
  26. package/src/checks/SK026-asks-autoclose.check.ts +5 -5
  27. package/src/checks/SK028-readme.check.ts +7 -66
  28. package/src/checks/SK030-cache-audit.check.ts +6 -1
  29. package/src/checks/SK031-trace-audit.check.ts +2 -0
  30. package/src/checks/SK033-global-contribution.check.ts +3 -1
  31. package/src/checks/SK035-public-clean.check.ts +2 -2
  32. package/src/checks/SK043-scratch-on-the-mac.check.ts +59 -4
  33. package/src/checks/SK047-login-in-description.check.ts +36 -0
  34. package/src/checks/SK048-one-local-file.check.ts +36 -0
  35. package/src/cli/cmd_Asks.ts +71 -5
  36. package/src/cli/cmd_Backup.ts +2 -2
  37. package/src/cli/cmd_Capacity.ts +2 -2
  38. package/src/cli/cmd_CrossRepoActivity.ts +5 -4
  39. package/src/cli/cmd_Db.ts +253 -0
  40. package/src/cli/cmd_History.ts +212 -0
  41. package/src/cli/cmd_Home.ts +31 -3
  42. package/src/cli/cmd_Hq.ts +516 -0
  43. package/src/cli/cmd_Machines.ts +36 -0
  44. package/src/cli/cmd_Media.ts +38 -6
  45. package/src/cli/cmd_Reflect.ts +23 -2
  46. package/src/cli/cmd_Review.ts +548 -116
  47. package/src/cli/cmd_Secret.ts +62 -12
  48. package/src/cli/cmd_Social.ts +83 -1
  49. package/src/cli/cmd_Space.ts +324 -0
  50. package/src/cli/cmd_Time.ts +76 -5
  51. package/src/cli/cmd_Tmp.ts +28 -4
  52. package/src/cli/cmd_Trailer.ts +14 -10
  53. package/src/cli/cmd_Urls.ts +56 -0
  54. package/src/cli/cmd_Vault.ts +583 -0
  55. package/src/cli/family-help.ts +4 -2
  56. package/src/cli/family-pages.ts +1 -1
  57. package/src/cli/registry.ts +24 -3
  58. package/src/collections/actions.ts +63 -13
  59. package/src/collections/collection-types.ts +23 -1
  60. package/src/collections/providers.ts +117 -23
  61. package/src/collections/review.ts +4 -4
  62. package/src/contracts/contract-manifests.ts +6 -5
  63. package/src/contracts/contract-types.ts +6 -4
  64. package/src/contracts/contracts-engine.ts +11 -0
  65. package/src/contracts/manifests/chrome-web-store.contract.ts +31 -0
  66. package/src/core/budget.ts +12 -17
  67. package/src/core/capacity.ts +27 -18
  68. package/src/core/check-runner.ts +7 -4
  69. package/src/core/layout.ts +3 -0
  70. package/src/core/machine-busy.ts +127 -0
  71. package/src/core/machine-commit.ts +6 -1
  72. package/src/core/machine-db.ts +368 -20
  73. package/src/core/machine-layout.ts +137 -0
  74. package/src/core/machine-read.ts +81 -0
  75. package/src/core/migrate-layout.ts +1 -1
  76. package/src/core/one-way-in-policy.ts +64 -7
  77. package/src/core/polling-policy.ts +27 -0
  78. package/src/core/retention.ts +16 -2
  79. package/src/core/scope.ts +107 -14
  80. package/src/core/slots.ts +5 -4
  81. package/src/drill/clean.ts +25 -1
  82. package/src/drill/run.ts +1 -1
  83. package/src/drill/seal.ts +27 -4
  84. package/src/home/activity-shape.ts +2 -0
  85. package/src/home/activity.ts +66 -3
  86. package/src/home/app-sign.ts +15 -4
  87. package/src/home/daemon-jobs.ts +149 -7
  88. package/src/home/database-projects.ts +111 -0
  89. package/src/home/database-words.ts +203 -0
  90. package/src/home/databases.ts +460 -0
  91. package/src/home/global-units.ts +6 -0
  92. package/src/home/gui-app/ShipkitGui.swift +122 -1
  93. package/src/home/gui-app.ts +6 -3
  94. package/src/home/home-move.ts +514 -0
  95. package/src/home/home-paths.ts +12 -3
  96. package/src/home/home-routes.ts +68 -0
  97. package/src/home/inbox-shape.ts +24 -14
  98. package/src/home/machine-fold.ts +820 -0
  99. package/src/home/machine-host.ts +20 -5
  100. package/src/home/machine-repair.ts +503 -0
  101. package/src/home/machine-stores.ts +66 -15
  102. package/src/home/machine-temp.ts +547 -86
  103. package/src/home/resume.ts +79 -0
  104. package/src/home/run-daemon.ts +25 -4
  105. package/src/home/run-pm.ts +18 -5
  106. package/src/home/serve-daemon.ts +18 -3
  107. package/src/home/serve-web.ts +175 -7
  108. package/src/home/space-job.ts +115 -0
  109. package/src/home/space-page.ts +257 -0
  110. package/src/home/space-route.ts +167 -0
  111. package/src/home/space-words.ts +103 -0
  112. package/src/home/time-page-shape.ts +202 -0
  113. package/src/home/time-page.ts +64 -0
  114. package/src/home/vault-page.ts +482 -0
  115. package/src/home/vault-words.ts +132 -0
  116. package/src/hooks/leak-guard.ts +40 -13
  117. package/src/hooks/one-way-in-guard.ts +17 -4
  118. package/src/hq/cards.ts +581 -0
  119. package/src/hq/door-route.ts +43 -0
  120. package/src/hq/door.ts +163 -0
  121. package/src/hq/files-send.ts +348 -0
  122. package/src/hq/forgotten-log.ts +35 -0
  123. package/src/hq/history-check.ts +255 -0
  124. package/src/hq/history-place.ts +146 -0
  125. package/src/hq/history-send.ts +487 -0
  126. package/src/hq/hq-db.ts +99 -0
  127. package/src/hq/hq-local.ts +469 -0
  128. package/src/hq/hq-routes.ts +196 -0
  129. package/src/hq/hq-store.ts +599 -0
  130. package/src/hq/kinds/ask.ts +147 -0
  131. package/src/hq/kinds/card-gone.ts +83 -0
  132. package/src/hq/kinds/card-msg.ts +66 -0
  133. package/src/hq/kinds/card.ts +99 -0
  134. package/src/hq/kinds/index.ts +21 -0
  135. package/src/hq/kinds/kind.ts +126 -0
  136. package/src/hq/kinds/media.ts +125 -0
  137. package/src/hq/kinds/prompt.ts +219 -0
  138. package/src/hq/kinds/reflection.ts +128 -0
  139. package/src/hq/kinds/report.ts +55 -0
  140. package/src/hq/kinds/time-day.ts +236 -0
  141. package/src/hq/ledger.ts +473 -0
  142. package/src/hq/machine-key.ts +44 -0
  143. package/src/hq/machine-notes.ts +131 -0
  144. package/src/hq/outbox.ts +372 -0
  145. package/src/hq/replica.ts +168 -0
  146. package/src/hq/repo-id.ts +4 -0
  147. package/src/hq/report-facts.ts +117 -0
  148. package/src/hq/report.ts +274 -0
  149. package/src/hq/switch.ts +151 -0
  150. package/src/hq/vault-grant.ts +92 -0
  151. package/src/identities/identities.ts +15 -3
  152. package/src/identities/steps.ts +31 -0
  153. package/src/ledger/db.ts +73 -26
  154. package/src/ledger/gate-checks.ts +6 -2
  155. package/src/ledger/run-log.ts +11 -3
  156. package/src/ledger/store.ts +26 -4
  157. package/src/media-store/backup/daemon.ts +25 -17
  158. package/src/media-store/backup/kept.ts +241 -0
  159. package/src/media-store/backup/restore.ts +14 -4
  160. package/src/media-store/backup/run.ts +11 -11
  161. package/src/media-store/backup/secret.ts +6 -4
  162. package/src/media-store/backup/snapshot.ts +4 -2
  163. package/src/media-store/backup/sources.ts +67 -16
  164. package/src/media-store/copy/config.ts +77 -0
  165. package/src/media-store/copy/copy.ts +194 -0
  166. package/src/media-store/copy/lifecycle.ts +43 -0
  167. package/src/media-store/copy/night.ts +90 -0
  168. package/src/media-store/copy/proof.ts +151 -0
  169. package/src/media-store/copy/snapshot.ts +152 -0
  170. package/src/media-store/copy/store.ts +62 -0
  171. package/src/media-store/copy/stream.ts +176 -0
  172. package/src/media-store/daemon.ts +66 -16
  173. package/src/media-store/db.ts +22 -11
  174. package/src/media-store/forget.ts +23 -3
  175. package/src/media-store/hand.ts +4 -3
  176. package/src/media-store/hq-find.ts +75 -0
  177. package/src/media-store/hq-send.ts +277 -0
  178. package/src/media-store/kind.ts +2 -0
  179. package/src/media-store/purge.ts +18 -15
  180. package/src/media-store/put.ts +24 -8
  181. package/src/media-store/remote.ts +16 -7
  182. package/src/media-store/space-listing.ts +240 -0
  183. package/src/media-store/space.ts +40 -21
  184. package/src/media-store/sync.ts +5 -5
  185. package/src/media-store/tidy.ts +98 -0
  186. package/src/media-store/upload.ts +3 -3
  187. package/src/media-store/webp.ts +66 -0
  188. package/src/messages/model.ts +16 -7
  189. package/src/messages/routes.ts +14 -4
  190. package/src/messages/score.ts +2 -2
  191. package/src/messages/suggest.ts +96 -0
  192. package/src/pages/frame-client.ts +10 -0
  193. package/src/plan/planner.ts +28 -17
  194. package/src/recordings/media-kind.ts +1 -0
  195. package/src/recordings/model.ts +1 -1
  196. package/src/recordings/recorder-app/Capture.swift +9 -7
  197. package/src/reflect/hq-corpus.ts +56 -0
  198. package/src/reflect/prompt-corpus.ts +3 -1
  199. package/src/reflect/transcript.ts +129 -37
  200. package/src/release/machine-words.ts +67 -0
  201. package/src/release/public-clean.ts +8 -3
  202. package/src/releases/from-card.ts +1 -1
  203. package/src/releases/routes.ts +10 -5
  204. package/src/releases/store.ts +10 -1
  205. package/src/repo-config.ts +32 -2
  206. package/src/review/anim.ts +2 -2
  207. package/src/review/auto.ts +2 -2
  208. package/src/review/card-db.ts +244 -0
  209. package/src/review/card-rows.ts +266 -0
  210. package/src/review/cells.ts +76 -5
  211. package/src/review/draft-card.ts +41 -0
  212. package/src/review/draft-model.ts +78 -0
  213. package/src/review/format.ts +29 -10
  214. package/src/review/gone.ts +98 -0
  215. package/src/review/inbox-hook.ts +4 -4
  216. package/src/review/marks.ts +1 -1
  217. package/src/review/media-kind.ts +7 -5
  218. package/src/review/media-read.ts +9 -7
  219. package/src/review/media.ts +32 -5
  220. package/src/review/model.ts +202 -39
  221. package/src/review/move.ts +491 -0
  222. package/src/review/notes.ts +12 -20
  223. package/src/review/previews.ts +15 -19
  224. package/src/review/project.ts +1 -1
  225. package/src/review/rev.ts +8 -0
  226. package/src/review/role.ts +1 -1
  227. package/src/review/routes.ts +64 -13
  228. package/src/review/stage-card.ts +8 -4
  229. package/src/review/stage-routes.ts +1 -1
  230. package/src/review/store.ts +529 -83
  231. package/src/review/thread-fold.ts +51 -0
  232. package/src/review/threads.ts +147 -9
  233. package/src/review/trailer-auto-mock.ts +63 -0
  234. package/src/review/trailer-card.ts +4 -4
  235. package/src/review/trailer-desk.ts +41 -7
  236. package/src/review/trailer-media.ts +1 -0
  237. package/src/review/trailer-model.ts +8 -0
  238. package/src/review/trailer-notes.ts +1 -1
  239. package/src/review/trailer-routes.ts +9 -1
  240. package/src/review/unit.ts +6 -6
  241. package/src/review/watchers.ts +1 -1
  242. package/src/rules/untrack-generated.ts +92 -8
  243. package/src/secrets/held.ts +16 -0
  244. package/src/secrets/keychain.ts +113 -0
  245. package/src/secrets/list.ts +16 -6
  246. package/src/secrets/manager.ts +24 -10
  247. package/src/secrets/read.ts +257 -0
  248. package/src/secrets/who-reads.ts +49 -0
  249. package/src/serve/door-forward.ts +268 -0
  250. package/src/serve/door-names.ts +47 -0
  251. package/src/serve/embed.ts +1 -1
  252. package/src/serve/hub-app/activity-view.tsx +56 -32
  253. package/src/serve/hub-app/activity.css +7 -1
  254. package/src/serve/hub-app/asks-page.tsx +48 -0
  255. package/src/serve/hub-app/asks-st.ts +25 -0
  256. package/src/serve/hub-app/clock-svc.ts +1 -2
  257. package/src/serve/hub-app/col-card.tsx +64 -13
  258. package/src/serve/hub-app/col-list-page.tsx +122 -0
  259. package/src/serve/hub-app/col-list-st.ts +103 -0
  260. package/src/serve/hub-app/col-tables-view.tsx +10 -41
  261. package/src/serve/hub-app/col-tables.ts +76 -8
  262. package/src/serve/hub-app/cols-svc.ts +70 -16
  263. package/src/serve/hub-app/database-st.ts +260 -0
  264. package/src/serve/hub-app/database-view.tsx +289 -0
  265. package/src/serve/hub-app/database.css +32 -0
  266. package/src/serve/hub-app/entry-bar.css +14 -0
  267. package/src/serve/hub-app/entry-bar.tsx +33 -0
  268. package/src/serve/hub-app/entry-pick.ts +31 -0
  269. package/src/serve/hub-app/floating.tsx +1 -0
  270. package/src/serve/hub-app/hash-route.ts +11 -1
  271. package/src/serve/hub-app/header-bar.tsx +14 -18
  272. package/src/serve/hub-app/home-st.ts +89 -9
  273. package/src/serve/hub-app/home-strip.css +5 -19
  274. package/src/serve/hub-app/home-strip.tsx +58 -92
  275. package/src/serve/hub-app/home.html +7 -0
  276. package/src/serve/hub-app/hub-app.tsx +31 -142
  277. package/src/serve/hub-app/hub-types.ts +3 -1
  278. package/src/serve/hub-app/hub.css +109 -23
  279. package/src/serve/hub-app/icons.tsx +18 -1
  280. package/src/serve/hub-app/identities-st.ts +56 -6
  281. package/src/serve/hub-app/identities-view.tsx +100 -58
  282. package/src/serve/hub-app/identities.css +17 -15
  283. package/src/serve/hub-app/identity-address.ts +5 -0
  284. package/src/serve/hub-app/inbox-st.ts +41 -24
  285. package/src/serve/hub-app/inbox-view.tsx +37 -41
  286. package/src/serve/hub-app/inbox.css +2 -5
  287. package/src/serve/hub-app/index.html +7 -0
  288. package/src/serve/hub-app/kept-cols.tsx +7 -0
  289. package/src/serve/hub-app/keys.ts +28 -15
  290. package/src/serve/hub-app/later.tsx +26 -0
  291. package/src/serve/hub-app/list-filter.tsx +14 -0
  292. package/src/serve/hub-app/list-walk.ts +72 -3
  293. package/src/serve/hub-app/machines-st.ts +251 -0
  294. package/src/serve/hub-app/machines-view.tsx +224 -0
  295. package/src/serve/hub-app/machines.css +76 -0
  296. package/src/serve/hub-app/md-copy.tsx +79 -0
  297. package/src/serve/hub-app/media-view.tsx +2 -0
  298. package/src/serve/hub-app/messages/messages-page.tsx +79 -7
  299. package/src/serve/hub-app/messages/messages-st.ts +99 -3
  300. package/src/serve/hub-app/messages.css +14 -0
  301. package/src/serve/hub-app/page-keys.ts +175 -0
  302. package/src/serve/hub-app/pages-frames.tsx +11 -3
  303. package/src/serve/hub-app/palette-st.ts +58 -11
  304. package/src/serve/hub-app/palette-view.tsx +3 -1
  305. package/src/serve/hub-app/project-list.css +54 -8
  306. package/src/serve/hub-app/project-list.tsx +128 -59
  307. package/src/serve/hub-app/projects-svc.ts +78 -7
  308. package/src/serve/hub-app/reader-chips.tsx +13 -0
  309. package/src/serve/hub-app/readme-view.tsx +2 -3
  310. package/src/serve/hub-app/readme.css +27 -5
  311. package/src/serve/hub-app/reflections-page.tsx +42 -0
  312. package/src/serve/hub-app/reflections-st.ts +17 -0
  313. package/src/serve/hub-app/releases/releases-page.tsx +25 -2
  314. package/src/serve/hub-app/releases/releases-st.ts +1 -1
  315. package/src/serve/hub-app/repo-sections.ts +9 -5
  316. package/src/serve/hub-app/repo-st.ts +35 -8
  317. package/src/serve/hub-app/review/draft-card.tsx +163 -0
  318. package/src/serve/hub-app/review/kit.tsx +50 -7
  319. package/src/serve/hub-app/review/note-place.ts +1 -1
  320. package/src/serve/hub-app/review/review-board.tsx +2 -2
  321. package/src/serve/hub-app/review/review-cells.tsx +145 -65
  322. package/src/serve/hub-app/review/review-kit.ts +27 -1
  323. package/src/serve/hub-app/review/review-list.tsx +68 -30
  324. package/src/serve/hub-app/review/review-page.tsx +7 -8
  325. package/src/serve/hub-app/review/review-st.ts +111 -24
  326. package/src/serve/hub-app/review/review-thread.tsx +49 -19
  327. package/src/serve/hub-app/review/review-views.tsx +475 -144
  328. package/src/serve/hub-app/review/thread-control-st.ts +115 -0
  329. package/src/serve/hub-app/review/thread-control.tsx +74 -0
  330. package/src/serve/hub-app/review/thread-st.ts +73 -26
  331. package/src/serve/hub-app/review/trailer-card.tsx +1 -1
  332. package/src/serve/hub-app/review/trailer-page.tsx +37 -16
  333. package/src/serve/hub-app/review/trailer-st.ts +41 -7
  334. package/src/serve/hub-app/review.css +267 -61
  335. package/src/serve/hub-app/side-lists.ts +72 -0
  336. package/src/serve/hub-app/sidebar.tsx +6 -3
  337. package/src/serve/hub-app/site/site-part.tsx +2 -8
  338. package/src/serve/hub-app/site/site-st.ts +4 -4
  339. package/src/serve/hub-app/social/comms-page.tsx +20 -5
  340. package/src/serve/hub-app/social/kit.tsx +30 -4
  341. package/src/serve/hub-app/social/post-card.tsx +139 -49
  342. package/src/serve/hub-app/social/serial-writes.ts +13 -0
  343. package/src/serve/hub-app/social/social-model.ts +11 -0
  344. package/src/serve/hub-app/social/social-page.tsx +94 -35
  345. package/src/serve/hub-app/social/social-st.ts +120 -36
  346. package/src/serve/hub-app/social/stage-popup.tsx +1 -1
  347. package/src/serve/hub-app/social/stage-st.ts +1 -1
  348. package/src/serve/hub-app/social/step-layout.ts +1 -1
  349. package/src/serve/hub-app/social.css +3 -0
  350. package/src/serve/hub-app/space-st.ts +209 -0
  351. package/src/serve/hub-app/space-view.tsx +196 -0
  352. package/src/serve/hub-app/space.css +27 -0
  353. package/src/serve/hub-app/stores/stores-page.tsx +91 -23
  354. package/src/serve/hub-app/stores/stores-st.ts +44 -19
  355. package/src/serve/hub-app/stores.css +6 -1
  356. package/src/serve/hub-app/theme-st.ts +22 -9
  357. package/src/serve/hub-app/time-charts.tsx +291 -0
  358. package/src/serve/hub-app/time-pages.tsx +749 -0
  359. package/src/serve/hub-app/time-st.ts +162 -0
  360. package/src/serve/hub-app/time-view.tsx +76 -0
  361. package/src/serve/hub-app/time.css +138 -0
  362. package/src/serve/hub-app/tree-build.ts +52 -42
  363. package/src/serve/hub-app/tree-row.tsx +4 -4
  364. package/src/serve/hub-app/tree-svc.ts +18 -9
  365. package/src/serve/hub-app/urls-svc.ts +154 -0
  366. package/src/serve/hub-app/urls-view.tsx +117 -0
  367. package/src/serve/hub-app/urls.css +30 -0
  368. package/src/serve/hub-app/vault-st.ts +127 -0
  369. package/src/serve/hub-app/vault-view.tsx +154 -0
  370. package/src/serve/hub-app/vault.css +38 -0
  371. package/src/serve/hub-app/veille/veille-st.ts +12 -10
  372. package/src/serve/hub-app/waiting-svc.ts +29 -0
  373. package/src/serve/hub-app/wikis-view.tsx +2 -2
  374. package/src/serve/hub-runtime.ts +15 -2
  375. package/src/serve/project-gutter-route.ts +27 -14
  376. package/src/serve/project-gutter.ts +25 -12
  377. package/src/serve/same-origin.ts +10 -0
  378. package/src/serve/serve-hub.ts +13 -4
  379. package/src/shipkit-files.ts +16 -2
  380. package/src/shipkit.ts +1 -1
  381. package/src/shot/shooter.ts +616 -420
  382. package/src/shot/shot-ask.ts +246 -155
  383. package/src/site/desk.ts +2 -2
  384. package/src/smoke/run-smoke.ts +3 -2
  385. package/src/social/cover.ts +202 -0
  386. package/src/social/discord-layout.ts +37 -13
  387. package/src/social/drafts.ts +3 -0
  388. package/src/social/load.ts +23 -2
  389. package/src/social/media-kind.ts +2 -1
  390. package/src/social/publish/discord.ts +5 -2
  391. package/src/social/publish/secret.ts +2 -2
  392. package/src/social/release-stage.ts +28 -13
  393. package/src/social/routes.ts +26 -1
  394. package/src/social/stage.ts +1 -1
  395. package/src/social/stats.ts +12 -9
  396. package/src/social/strip.ts +4 -1
  397. package/src/social/thumbnail.ts +255 -0
  398. package/src/stores/collection.ts +15 -11
  399. package/src/stores/desk.ts +236 -42
  400. package/src/stores/model.ts +72 -6
  401. package/src/stores/routes.ts +37 -12
  402. package/src/stores/unit.ts +14 -8
  403. package/src/suite/judge-suites.ts +41 -11
  404. package/src/suite/select.ts +45 -3
  405. package/src/suite/suite-cli.ts +16 -10
  406. package/src/trailer/bed.ts +1 -1
  407. package/src/trailer/build.ts +134 -21
  408. package/src/trailer/ffmpeg.ts +7 -0
  409. package/src/trailer/fonts.ts +3 -2
  410. package/src/trailer/grammar.ts +201 -2
  411. package/src/trailer/graph.ts +42 -5
  412. package/src/trailer/look.ts +21 -0
  413. package/src/trailer/mock.ts +154 -0
  414. package/src/trailer/passage.ts +65 -26
  415. package/src/trailer/score/heard.ts +89 -0
  416. package/src/trailer/score/sound.ts +14 -8
  417. package/src/trailer/sound/run.ts +16 -6
  418. package/src/trailer/stitch.ts +26 -5
  419. package/src/trailer/titles.ts +82 -19
  420. package/src/trailer/versions.ts +1 -3
  421. package/src/trailer/vertical.ts +3 -1
  422. package/src/urls/frame.ts +195 -0
  423. package/src/urls/routes.ts +43 -0
  424. package/src/urls/rows.ts +171 -0
  425. package/src/urls/unit.ts +73 -0
  426. package/src/vault/house-keys.ts +42 -0
  427. package/src/vault/layout.ts +50 -0
  428. package/src/vault/policy.ts +165 -0
  429. package/src/vault/vault-audit.ts +276 -0
  430. package/src/vault/vault-client.ts +40 -0
  431. package/src/vault/vault-config.ts +159 -0
  432. package/src/vault/vault-destroy.ts +78 -0
  433. package/src/vault/vault-handover.ts +305 -0
  434. package/src/vault/vault-http.ts +352 -0
  435. package/src/vault/vault-import.ts +208 -0
  436. package/src/vault/vault-init.ts +328 -0
  437. package/src/vault/vault-minter.ts +271 -0
  438. package/src/vault/vault-restore.ts +333 -0
  439. package/src/vault/vault-serve.ts +342 -0
  440. package/src/vault/vault-snapshot.ts +281 -0
  441. package/src/veille/asks.ts +1 -1
  442. package/src/veille/desk.ts +2 -2
@@ -0,0 +1,291 @@
1
+ // the charts of the time page: a segmented bar for one whole split in parts,
2
+ // stacked columns for a split that moves day by day, ranked bars for a list
3
+ // compared on one baseline, stat tiles for the figures that need no chart, a
4
+ // small line for one measure over time beside its figure (the machines page).
5
+ //
6
+ // The constraint a reader breaks first: a part keeps ONE colour on every
7
+ // chart (`tv-<id>`), and text never wears it: a swatch beside the text does.
8
+ import { observer } from 'mobx-react-lite'
9
+ import type { CSSProperties, ReactNode } from 'react'
10
+ import type { Breakdown } from '../../agent-time/timeline.ts'
11
+ import { THIN } from './dur.ts'
12
+ import { Tip } from './floating.tsx'
13
+ import { Caret } from './icons.tsx'
14
+
15
+ /** what floats over a trigger the moment the pointer arrives: the whole of a name cut short, or what a figure is */
16
+ export const Hint = ({ tip, className, style, children }: { tip: ReactNode; className?: string; style?: CSSProperties; children: ReactNode }) =>
17
+ tip == null || tip === '' ? <span className={className} style={style}>{children}</span> : <Tip instant content={tip} tipClass="ftip tvtip" placement="top-start" className={className} style={style}>{children}</Tip>
18
+
19
+ const NBSP = ' '
20
+ export const group = (n: number): string => `${Math.round(n)}`.replace(/\B(?=(\d{3})+(?!\d))/g, THIN)
21
+
22
+ /** a duration as a person says it: hours from one hour, minutes from one minute, seconds, then ms */
23
+ export function dur(ms: number): string {
24
+ if (ms >= 3_600_000) {
25
+ const h = ms / 3_600_000
26
+ return `${h >= 100 ? group(h) : h.toFixed(1)}${NBSP}h`
27
+ }
28
+ if (ms >= 60_000) return `${Math.round(ms / 60_000)}${NBSP}min`
29
+ if (ms >= 1000) return `${(ms / 1000).toFixed(1)}${NBSP}s`
30
+ if (ms <= 0) return '0'
31
+ return `${Math.round(ms)}${NBSP}ms`
32
+ }
33
+ /** a column of totals: hours, so the rows compare by eye */
34
+ export const hours = (ms: number): string => `${(ms / 3_600_000).toFixed(ms < 36_000_000 ? 2 : 1)}${NBSP}h`
35
+ /** a column of per call figures: seconds */
36
+ export const secs = (ms: number): string => (ms < 100_000 ? `${(ms / 1000).toFixed(1)}${NBSP}s` : `${group(ms / 1000)}${NBSP}s`)
37
+ export const pct = (part: number, whole: number): string => (whole <= 0 ? '0%' : `${Math.round((100 * part) / whole)}%`)
38
+
39
+ /** the parts every wall is split in, in the order they are stacked */
40
+ export const PARTS = ['model', 'tools', 'background', 'human', 'other'] as const
41
+ export type PartId = (typeof PARTS)[number]
42
+ export const PART_WORDS: Record<PartId, { label: string; title: string }> = {
43
+ model: { label: 'the model', title: 'the model at work: reading its context, thinking, writing the next call' },
44
+ tools: { label: 'tools', title: 'a tool call running: a command, an edit, a search' },
45
+ background: { label: 'waiting on background work', title: 'stopped until a background task or a lane it started woke it' },
46
+ human: { label: 'waiting on you', title: 'stopped until your next prompt, up to 30 minutes' },
47
+ other: { label: 'other waits', title: 'a call waiting for you to allow it, a foreground sub-agent, a stop nothing explains' },
48
+ }
49
+ export type Part = { id: PartId; value: number }
50
+
51
+ /** a wall cut in the five parts the page draws */
52
+ export const partsOf = (b: Breakdown): Part[] => [
53
+ { id: 'model', value: b.model },
54
+ { id: 'tools', value: b.tools },
55
+ { id: 'background', value: b.background },
56
+ { id: 'human', value: b.human },
57
+ { id: 'other', value: b.approval + b.subagent + b.unknown },
58
+ ]
59
+ export const wholeOf = (parts: readonly Part[]): number => parts.reduce((n, p) => n + p.value, 0)
60
+
61
+ /** a block narrower than this share prints no figure: it would not fit */
62
+ const LABEL_SHARE = 0.07
63
+
64
+ /** one whole split in its parts: a tall bar, each part a block with its share printed on it where it fits */
65
+ export const SegBar = ({ parts }: { parts: Part[] }) => {
66
+ const whole = wholeOf(parts)
67
+ const shown = parts.filter((p) => p.value > 0)
68
+ return (
69
+ <div className="tvseg" role="img" aria-label={shown.map((p) => `${PART_WORDS[p.id].label} ${pct(p.value, whole)}`).join(', ')}>
70
+ {shown.map((p) => (
71
+ <Hint key={p.id} className={`tvblock tv-${p.id}`} style={{ flexGrow: p.value }} tip={`${PART_WORDS[p.id].label}: ${dur(p.value)}, ${pct(p.value, whole)}`}>
72
+ {p.value / whole >= LABEL_SHARE ? pct(p.value, whole) : ''}
73
+ </Hint>
74
+ ))}
75
+ </div>
76
+ )
77
+ }
78
+
79
+ /** the names of the parts, each with its swatch and its amount */
80
+ export const Legend = ({ parts, amounts = true }: { parts: Part[]; amounts?: boolean }) => (
81
+ <ul className="tvlegend">
82
+ {parts.filter((p) => p.value > 0).map((p) => (
83
+ <li key={p.id}>
84
+ <i className={`tvdot tv-${p.id}`} />
85
+ <Hint tip={PART_WORDS[p.id].title}>{PART_WORDS[p.id].label}</Hint>
86
+ {amounts ? <b>{dur(p.value)}</b> : null}
87
+ </li>
88
+ ))}
89
+ </ul>
90
+ )
91
+
92
+ /** round steps for an axis that ends at or above `max` hours */
93
+ export function ticksOf(maxHours: number): number[] {
94
+ const raw = maxHours / 4
95
+ const pow = 10 ** Math.floor(Math.log10(Math.max(raw, 1e-9)))
96
+ const step = [1, 2, 2.5, 5, 10].map((m) => m * pow).find((s) => s >= raw) ?? raw
97
+ const out: number[] = []
98
+ for (let t = 0; t < maxHours + step - 1e-9; t += step) out.push(Number(t.toFixed(4)))
99
+ return out
100
+ }
101
+
102
+ export type Column = { label: string; parts: Part[] }
103
+
104
+ /** a split that moves along an axis: one stacked column per label, hours on the y axis. `top` (ms) shares one scale between two charts */
105
+ export const Columns = ({ cols, top }: { cols: Column[]; top?: number }) => {
106
+ const max = Math.max(top ?? 0, ...cols.map((c) => wholeOf(c.parts)), 1)
107
+ const ticks = ticksOf(max / 3_600_000)
108
+ const end = (ticks[ticks.length - 1] ?? 1) * 3_600_000
109
+ return (
110
+ <div className="tvcols">
111
+ <div className="tvaxis" aria-hidden="true">
112
+ {ticks.map((t) => <span key={t} style={{ bottom: `${(100 * t * 3_600_000) / end}%` }}>{t}{NBSP}h</span>)}
113
+ </div>
114
+ <div className="tvplot">
115
+ {ticks.map((t) => <i key={t} className="tvgrid" style={{ bottom: `${(100 * t * 3_600_000) / end}%` }} />)}
116
+ {cols.map((c) => {
117
+ const whole = wholeOf(c.parts)
118
+ return (
119
+ <Hint key={c.label} className="tvcol" tip={<><b>{c.label}: {dur(whole)}</b>{c.parts.filter((p) => p.value > 0).map((p) => <div key={p.id}>{PART_WORDS[p.id].label} {dur(p.value)}</div>)}</>}>
120
+ <span className="tvstack" style={{ height: `${(100 * whole) / end}%` }}>
121
+ {c.parts.filter((p) => p.value > 0).map((p) => <i key={p.id} className={`tv-${p.id}`} style={{ flexGrow: p.value }} />)}
122
+ </span>
123
+ <span className="tvx">{c.label}</span>
124
+ </Hint>
125
+ )
126
+ })}
127
+ </div>
128
+ </div>
129
+ )
130
+ }
131
+
132
+ /** `second`: another measure of the same row on the same scale, drawn under the first in the second hue */
133
+ export type Ranked = { key?: string; name: string; value: number; shown: string; note?: string; title?: string; onClick?: () => void; second?: { value: number; shown: string } }
134
+
135
+ /** a list compared on one baseline: a name, a bar in one hue, the figure at the bar's tip. `top` shares one scale
136
+ * between several lists */
137
+ export const RankBars = ({ rows, empty, top }: { rows: Ranked[]; empty: string; top?: number }) => {
138
+ const max = Math.max(top ?? 0, ...rows.map((r) => Math.max(r.value, r.second?.value ?? 0)))
139
+ if (rows.length === 0) return <p className="tvnone">{empty}</p>
140
+ return (
141
+ <div className="tvrank">
142
+ {rows.map((r) => (
143
+ <div key={r.key ?? r.name} className={`tvrrow${r.onClick != null ? ' link' : ''}`} onClick={r.onClick}>
144
+ <Hint className="tvrname" tip={r.title ?? r.name}>{r.name}{r.note == null ? null : <em>{r.note}</em>}</Hint>
145
+ <span className="tvrbars">
146
+ <span className="tvrtrack"><i style={{ width: `calc((100% - 84px) * ${max <= 0 ? 0 : r.value / max})` }} /><b>{r.shown}</b></span>
147
+ {r.second == null ? null : <span className="tvrtrack second"><i style={{ width: `calc((100% - 84px) * ${max <= 0 ? 0 : r.second.value / max})` }} /><b>{r.second.shown}</b></span>}
148
+ </span>
149
+ </div>
150
+ ))}
151
+ </div>
152
+ )
153
+ }
154
+
155
+ /** a small line's points: where its x runs from first to last, its y from zero to the largest */
156
+ export function sparkPath(points: readonly { at: number; v: number }[], w: number, h: number): { d: string; area: string; end: { x: number; y: number } } | null {
157
+ const first = points[0]
158
+ const last = points[points.length - 1]
159
+ if (first == null || last == null) return null
160
+ const top = Math.max(...points.map((p) => p.v))
161
+ const x = (at: number): number => (last.at === first.at ? w : ((at - first.at) / (last.at - first.at)) * w)
162
+ // a point keeps a pixel off each edge, so the line at zero or at its top is never cut by the box
163
+ const y = (v: number): number => (top <= 0 ? h - 1 : h - 1 - (v / top) * (h - 2))
164
+ const f = (n: number): string => n.toFixed(1)
165
+ const d = points.map((p, i) => `${i === 0 ? 'M' : 'L'}${f(x(p.at))} ${f(y(p.v))}`).join('')
166
+ // the area under the line, down to zero: the line reads as one shape beside its figure, never as a rule of the row above
167
+ return { d, area: `${d}L${f(x(last.at))} ${h}L${f(x(first.at))} ${h}Z`, end: { x: x(last.at), y: y(last.v) } }
168
+ }
169
+
170
+ const SPARK_W = 100
171
+ const SPARK_H = 20
172
+
173
+ /** one measure over time beside the figure that says it: a small line from zero to its largest, the last point
174
+ * marked, its words on hover. The figure is the value, the line is only the way it went */
175
+ export const Spark = ({ points, label, tip }: { points: readonly { at: number; v: number }[]; label: string; tip: ReactNode }) => {
176
+ const p = sparkPath(points, SPARK_W, SPARK_H)
177
+ if (p == null) return null
178
+ return (
179
+ <Hint className="tvspark" tip={tip}>
180
+ <svg viewBox={`0 0 ${SPARK_W} ${SPARK_H}`} preserveAspectRatio="none" role="img" aria-label={label}>
181
+ <path className="tvsparkarea" d={p.area} />
182
+ <path className="tvsparkzero" d={`M0 ${SPARK_H - 0.5}H${SPARK_W}`} />
183
+ <path className="tvsparkline" d={p.d} />
184
+ <path className="tvsparkend" d={`M${p.end.x.toFixed(1)} ${p.end.y.toFixed(1)}h0`} />
185
+ </svg>
186
+ </Hint>
187
+ )
188
+ }
189
+
190
+ /** one figure that needs no chart: the value, then what it is in plain words */
191
+ export const Tile = ({ value, label, hint }: { value: string; label: string; hint?: string }) => (
192
+ <Hint className="tvtile" tip={hint}><b>{value}</b><span>{label}</span></Hint>
193
+ )
194
+
195
+ export const Tiles = ({ children }: { children: ReactNode }) => <div className="tvtiles">{children}</div>
196
+
197
+ /** a figure of a table: the number a column is drawn and sorted by, and the text shown */
198
+ export type Num = { v: number; text: string }
199
+ export type Cell = ReactNode | Num
200
+ export const isNum = (c: Cell): c is Num => c != null && typeof c === 'object' && 'v' in c && 'text' in c
201
+ /** the figures a table shows: a total in hours, a per call time in seconds, a count (`n0`: nothing for zero) */
202
+ export const num = {
203
+ h: (ms: number): Num => ({ v: ms, text: hours(ms) }),
204
+ s: (ms: number): Num => ({ v: ms, text: secs(ms) }),
205
+ n: (x: number): Num => ({ v: x, text: group(x) }),
206
+ n0: (x: number): Num => ({ v: x, text: x === 0 ? '' : group(x) }),
207
+ /** a time that runs from seconds to hours down one column: the unit a person would say */
208
+ d: (ms: number): Num => ({ v: ms, text: dur(ms) }),
209
+ pct: (part: number, whole: number): Num => ({ v: whole <= 0 ? 0 : part / whole, text: part <= 0 ? '' : part / whole < 0.005 ? 'under 1%' : pct(part, whole) }),
210
+ }
211
+
212
+ /** `look`: how a column of figures is drawn. `bar`: a bar in the cell, as long as the figure is to the
213
+ * column's largest (a total, a count). `heat`: a tint that deepens with the figure (what is bad when it is large) */
214
+ export type Col = { label: string; num?: boolean; look?: 'bar' | 'heat'; title?: string; /** a column of small print, cut where it does not fit */ more?: boolean }
215
+ /** `children`: the rows a row opens on (the scripts of a `<file>` command), drawn under it when its key is open */
216
+ export type Row = { key: string; cells: Cell[]; title?: string; onClick?: () => void; children?: Row[] }
217
+
218
+ /** the rows in the order a header click asks for: by the column's figure, a text column by its text, else by the row's key */
219
+ export function sortRows(rows: readonly Row[], sort: { col: number; desc: boolean } | null): Row[] {
220
+ if (sort == null) return [...rows]
221
+ const key = (r: Row): number | string => {
222
+ const c = r.cells[sort.col]
223
+ return isNum(c) ? c.v : typeof c === 'string' ? c : r.key
224
+ }
225
+ return [...rows].sort((a, b) => {
226
+ const [x, y] = [key(a), key(b)]
227
+ const d = typeof x === 'number' && typeof y === 'number' ? x - y : `${x}`.localeCompare(`${y}`)
228
+ return sort.desc ? -d : d
229
+ })
230
+ }
231
+
232
+ /** the deepest tint a cell takes, as a share of the hue */
233
+ const HEAT_TOP = 46
234
+
235
+ /** the table under a chart: every figure the chart draws, and the ones it does not. A header sorts
236
+ * by its column; a column with a look draws each figure against the largest of the column; a row
237
+ * with children opens on them at a click; a first cell cut short says its whole on hover. An observer: `open` is
238
+ * a store's own set, read here, so a click must draw without its parent drawing again */
239
+ export const Table = observer(({ head, rows, empty, sort = null, onSort, open, onToggle }: { head: Col[]; rows: Row[]; empty: string; sort?: { col: number; desc: boolean } | null; onSort?: (col: number) => void; open?: ReadonlySet<string>; onToggle?: (key: string) => void }) => {
240
+ if (rows.length === 0) return <p className="tvnone">{empty}</p>
241
+ // a column of figures with nothing in any row is not drawn
242
+ const shown = head.map((_, i) => !rows.every((r) => { const c = r.cells[i]; return isNum(c) && c.text === '' }))
243
+ const top = head.map((h, i) => (h.look == null ? 0 : Math.max(0, ...rows.map((r) => { const c = r.cells[i]; return isNum(c) ? c.v : 0 }))))
244
+ const drawn = (c: Cell, i: number): { className: string; style?: CSSProperties } => {
245
+ const h = head[i]
246
+ const base = h?.num ? 'num' : h?.more ? 'tvmore' : ''
247
+ const max = top[i] ?? 0
248
+ if (h?.look == null || !isNum(c) || max <= 0 || c.v <= 0) return { className: base }
249
+ const share = Math.min(1, c.v / max)
250
+ return h.look === 'bar'
251
+ ? { className: `${base} tvbar`, style: { '--w': `${(100 * share).toFixed(1)}%` } as CSSProperties }
252
+ : { className: `${base} tvheat`, style: { '--heat': `${(HEAT_TOP * Math.sqrt(share)).toFixed(1)}%` } as CSSProperties }
253
+ }
254
+ const cell = (r: Row, c: Cell, i: number): ReactNode => {
255
+ if (!shown[i]) return null
256
+ const text = isNum(c) ? c.text : c
257
+ const tip = i === 0 ? (r.title ?? (typeof c === 'string' ? c : null)) : head[i]?.more && typeof c === 'string' ? c : null
258
+ const fold = i === 0 && r.children != null && r.children.length > 0 ? <i className="tvfold"><Caret open={open?.has(r.key) === true} /></i> : null
259
+ return <td key={i} {...drawn(c, i)}>{fold}{tip == null || tip === '' ? text : <Hint tip={tip}>{text}</Hint>}</td>
260
+ }
261
+ const line = (r: Row, child: boolean): ReactNode => {
262
+ const folds = !child && r.children != null && r.children.length > 0 && onToggle != null
263
+ const act = r.onClick ?? (folds ? () => onToggle(r.key) : undefined)
264
+ return (
265
+ <tr key={r.key} className={`${child ? 'tvchild' : ''}${act != null ? ' link' : ''}`.trim()} onClick={act}>
266
+ {r.cells.map((c, i) => cell(r, c, i))}
267
+ </tr>
268
+ )
269
+ }
270
+ return (
271
+ <div className="tvwide"><table className="tvtable">
272
+ <thead>
273
+ <tr>
274
+ {head.map((h, i) => {
275
+ const on = sort?.col === i
276
+ if (!shown[i]) return null
277
+ const label = <Hint tip={h.title}>{h.label}{on ? (sort.desc ? ' ▾' : ' ▴') : ''}</Hint>
278
+ return (
279
+ <th key={h.label} className={h.num ? 'num' : ''} aria-sort={on ? (sort.desc ? 'descending' : 'ascending') : undefined}>
280
+ {onSort == null ? label : <button type="button" className={`tvsort${on ? ' on' : ''}`} onClick={() => onSort(i)}>{label}</button>}
281
+ </th>
282
+ )
283
+ })}
284
+ </tr>
285
+ </thead>
286
+ <tbody>
287
+ {sortRows(rows, sort).flatMap((r) => [line(r, false), ...(open?.has(r.key) ? (r.children ?? []).map((k) => line(k, true)) : [])])}
288
+ </tbody>
289
+ </table></div>
290
+ )
291
+ })