rvlib-shipkit 2.31.0 → 2.33.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 (408) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/package.json +1 -1
  3. package/src/advisors/acts.ts +16 -15
  4. package/src/advisors/advice.ts +56 -102
  5. package/src/advisors/advisor-view.ts +122 -76
  6. package/src/advisors/app-graph.ts +1 -1
  7. package/src/advisors/app.ts +3 -11
  8. package/src/advisors/cf-api.ts +1 -1
  9. package/src/advisors/dir-bucket.ts +4 -3
  10. package/src/advisors/edge/api.ts +20 -221
  11. package/src/advisors/edge/bucket.ts +2 -2
  12. package/src/advisors/edge/handler.ts +13 -155
  13. package/src/advisors/edge/here.ts +5 -5
  14. package/src/advisors/edge/pages.ts +12 -9
  15. package/src/advisors/edge/shell.ts +6 -5
  16. package/src/advisors/edge/sign-in.ts +101 -36
  17. package/src/advisors/edge/status.ts +19 -6
  18. package/src/advisors/edge/types.ts +36 -60
  19. package/src/advisors/expose.ts +29 -29
  20. package/src/advisors/here.ts +12 -12
  21. package/src/advisors/invite-send.ts +79 -35
  22. package/src/advisors/invite.ts +31 -8
  23. package/src/advisors/job.ts +24 -16
  24. package/src/advisors/login.ts +40 -15
  25. package/src/advisors/owner-store.ts +46 -22
  26. package/src/advisors/photos.ts +3 -3
  27. package/src/advisors/project.ts +27 -25
  28. package/src/advisors/reach.ts +89 -0
  29. package/src/advisors/rights.ts +1 -1
  30. package/src/advisors/routes.ts +55 -74
  31. package/src/advisors/scan.ts +0 -4
  32. package/src/advisors/setup-run.ts +14 -14
  33. package/src/advisors/share-trace.ts +3 -3
  34. package/src/advisors/{door-probe.ts → sign-in-probe.ts} +7 -6
  35. package/src/advisors/speaks.ts +29 -0
  36. package/src/advisors/sync.ts +97 -183
  37. package/src/advisors/tunnel.ts +6 -5
  38. package/src/advisors/users-listen.ts +92 -0
  39. package/src/advisors/users-router.ts +261 -87
  40. package/src/advisors/users-store.ts +81 -0
  41. package/src/agent-time/blocked-scan.ts +181 -0
  42. package/src/agent-time/registry.ts +12 -5
  43. package/src/agent-time/store.ts +9 -109
  44. package/src/asks/ask-bar-fold.ts +2 -1
  45. package/src/asks/ask-close.ts +2 -1
  46. package/src/asks/ask-doc.ts +2 -1
  47. package/src/asks/ask-migrate.ts +3 -2
  48. package/src/asks/ask-steps-fold.ts +2 -1
  49. package/src/asks/ask-store.ts +4 -3
  50. package/src/check.ts +3 -43
  51. package/src/checks/SK001-package-json-shape.check.ts +4 -55
  52. package/src/checks/SK004-gitignore-policy.check.ts +24 -69
  53. package/src/checks/SK013-one-way-in-policy.check.ts +3 -7
  54. package/src/checks/SK017-vscode-hub-task.check.ts +4 -4
  55. package/src/checks/SK019-tests-run-in-units.check.ts +3 -14
  56. package/src/checks/SK020-self-spawning-check.check.ts +5 -7
  57. package/src/checks/SK035-public-clean.check.ts +1 -1
  58. package/src/checks/SK039-vscode-watch-generated.check.ts +1 -1
  59. package/src/checks/SK042-post-kinds.check.ts +5 -14
  60. package/src/checks/SK054-agent-allow-list.check.ts +5 -74
  61. package/src/checks/SK055-retired-config-keys.check.ts +45 -0
  62. package/src/cli/cmd_Advisors.ts +11 -45
  63. package/src/cli/cmd_Asks.ts +3 -10
  64. package/src/cli/cmd_Backup.ts +25 -127
  65. package/src/cli/cmd_BackupTargets.ts +1 -1
  66. package/src/cli/cmd_Capacity.ts +6 -2
  67. package/src/cli/cmd_Checks.ts +0 -14
  68. package/src/cli/cmd_Ci.ts +2 -1
  69. package/src/cli/cmd_Db.ts +3 -82
  70. package/src/cli/cmd_Home.ts +4 -32
  71. package/src/cli/cmd_Hq.ts +0 -17
  72. package/src/cli/cmd_Releases.ts +57 -4
  73. package/src/cli/cmd_Review.ts +333 -354
  74. package/src/cli/cmd_Shot.ts +26 -4
  75. package/src/cli/cmd_SocialDrafts.ts +6 -13
  76. package/src/cli/cmd_ThreadSyncNeeds.ts +6 -2
  77. package/src/cli/cmd_Time.ts +1 -1
  78. package/src/cli/cmd_Trailer.ts +1 -1
  79. package/src/cli/inbox-hook-run.ts +5 -23
  80. package/src/cli/registry-heads.ts +5 -55
  81. package/src/cli/registry.ts +1 -5
  82. package/src/cli/review-here.ts +1 -1
  83. package/src/cli.ts +15 -4
  84. package/src/collections/collection-types.ts +1 -1
  85. package/src/collections/review.ts +5 -4
  86. package/src/core/admission.ts +268 -0
  87. package/src/core/agent-allow-policy.ts +32 -2
  88. package/src/core/agent-env.ts +8 -0
  89. package/src/core/allow-rows.ts +74 -0
  90. package/src/core/check-file-names.ts +19 -106
  91. package/src/core/code-lines.ts +36 -21
  92. package/src/core/footprint.ts +17 -13
  93. package/src/core/identities-root.ts +1 -4
  94. package/src/core/layout.ts +1 -2
  95. package/src/core/machine-db.ts +33 -208
  96. package/src/core/machine-layout.ts +14 -127
  97. package/src/core/machine-read.ts +5 -2
  98. package/src/core/mask-source.ts +60 -0
  99. package/src/core/memory-watch.ts +17 -14
  100. package/src/core/motherhome.ts +8 -35
  101. package/src/core/one-way-in-policy.ts +0 -3
  102. package/src/core/peer-sk.ts +8 -0
  103. package/src/core/repo-walk.ts +0 -9
  104. package/src/core/retention.ts +1 -9
  105. package/src/core/retired-checks.ts +2 -0
  106. package/src/core/tmux-policy.ts +1 -1
  107. package/src/core/tree-watch.ts +2 -2
  108. package/src/core/when.ts +7 -45
  109. package/src/gate/admit-heavy.ts +150 -0
  110. package/src/gate/check-runner.ts +6 -0
  111. package/src/gate/discover-checks.ts +42 -32
  112. package/src/gate/gate-checks.ts +21 -131
  113. package/src/gate/head-gate.ts +1 -1
  114. package/src/gate/job-run.ts +2 -1
  115. package/src/gate/pre-commit-discovery.ts +22 -28
  116. package/src/gate/run-check.ts +3 -4
  117. package/src/gate/run-ci.ts +4 -0
  118. package/src/gate/run-fix.ts +5 -17
  119. package/src/gate/run-fixers.ts +6 -42
  120. package/src/home/app-sign.ts +2 -2
  121. package/src/home/backup-status.ts +52 -92
  122. package/src/home/backup-verdict.ts +2 -2
  123. package/src/home/daemon-jobs.ts +51 -95
  124. package/src/home/database-words.ts +1 -2
  125. package/src/home/databases.ts +9 -25
  126. package/src/home/home-launchd.ts +0 -6
  127. package/src/home/home-paths.ts +8 -4
  128. package/src/home/home-routes.ts +3 -10
  129. package/src/home/home-state.ts +2 -14
  130. package/src/home/inbox-shape.ts +14 -15
  131. package/src/home/inbox.ts +1 -1
  132. package/src/home/machine-repair.ts +102 -103
  133. package/src/home/resume.ts +1 -15
  134. package/src/home/run-daemon.ts +7 -12
  135. package/src/home/space-page.ts +3 -2
  136. package/src/home/supervise.ts +3 -7
  137. package/src/hooks/commit-msg-run.ts +61 -0
  138. package/src/hooks/commit-run.ts +16 -166
  139. package/src/hooks/gate-outcome.ts +108 -0
  140. package/src/hooks/git-hook.ts +9 -9
  141. package/src/hooks/hook-config.ts +8 -8
  142. package/src/hooks/leak-guard.ts +1 -1
  143. package/src/hooks/pre-commit-checks.ts +1 -1
  144. package/src/hooks/run-hooks.ts +2 -6
  145. package/src/hooks/shared-file.ts +3 -2
  146. package/src/hq/daemon-db.ts +8 -8
  147. package/src/hq/door.ts +3 -16
  148. package/src/hq/hq-db.ts +4 -3
  149. package/src/hq/hq-local.ts +1 -2
  150. package/src/hq/hq-store.ts +0 -15
  151. package/src/hq/item-direct.ts +8 -10
  152. package/src/hq/item-fill.ts +37 -0
  153. package/src/hq/kinds/item-gone.ts +7 -10
  154. package/src/hq/kinds/item-msg.ts +12 -18
  155. package/src/hq/kinds/item.ts +13 -19
  156. package/src/hq/kinds/report.ts +3 -4
  157. package/src/hq/owner-switch.ts +3 -3
  158. package/src/hq/report.ts +5 -9
  159. package/src/hq/switch.ts +2 -11
  160. package/src/hq/thread-sync.ts +5 -17
  161. package/src/hq/{shapes-words.ts → threads-words.ts} +2 -12
  162. package/src/http/owner-word.ts +1 -1
  163. package/src/identities/machine.ts +16 -0
  164. package/src/init-repo.ts +0 -1
  165. package/src/ledger/check-stats.ts +6 -5
  166. package/src/ledger/db.ts +2 -4
  167. package/src/ledger/record-kept.ts +117 -48
  168. package/src/ledger/run-log.ts +21 -2
  169. package/src/ledger/slow-tests.ts +96 -0
  170. package/src/ledger/store.ts +3 -86
  171. package/src/ledger/suite-log.ts +8 -2
  172. package/src/media-store/backup/facts.ts +3 -37
  173. package/src/media-store/backup/keys.ts +1 -8
  174. package/src/media-store/backup/manifest.ts +6 -67
  175. package/src/media-store/backup/restore.ts +4 -13
  176. package/src/media-store/backup/retention.ts +13 -1
  177. package/src/media-store/backup/run.ts +6 -267
  178. package/src/media-store/backup/snapshot.ts +2 -38
  179. package/src/media-store/backup/sources.ts +3 -113
  180. package/src/media-store/backup/target-send.ts +5 -29
  181. package/src/media-store/db.ts +8 -7
  182. package/src/media-store/forget-one.ts +1 -1
  183. package/src/media-store/forget.ts +1 -80
  184. package/src/orchestrator/guards.ts +0 -1
  185. package/src/orchestrator/presence.ts +2 -2
  186. package/src/orchestrator/routes.ts +1 -1
  187. package/src/orchestrator/started.ts +0 -9
  188. package/src/orchestrator/talk-key.ts +3 -4
  189. package/src/orchestrator/unheard.ts +1 -1
  190. package/src/plan/planner.ts +3 -2
  191. package/src/recordings/edit.ts +3 -3
  192. package/src/recordings/marks-draw.ts +17 -6
  193. package/src/recordings/marks.ts +120 -9
  194. package/src/reflections/reflections-queue.ts +3 -10
  195. package/src/release/notes.ts +1 -1
  196. package/src/release/public-clean.ts +66 -6
  197. package/src/release/run-bump.ts +11 -0
  198. package/src/release/run-release.ts +4 -0
  199. package/src/releases/from-thread.ts +3 -3
  200. package/src/releases/model.ts +186 -36
  201. package/src/releases/store.ts +13 -3
  202. package/src/releases/validate.ts +83 -0
  203. package/src/repo-config.ts +36 -64
  204. package/src/review/answer-kinds.ts +63 -4
  205. package/src/review/blocked-guard.ts +11 -0
  206. package/src/review/blocked-object.ts +298 -0
  207. package/src/review/cells.ts +144 -230
  208. package/src/review/close.ts +39 -1
  209. package/src/review/doc-save.ts +3 -2
  210. package/src/review/draft-item.ts +1 -1
  211. package/src/review/events.ts +3 -7
  212. package/src/review/expect.ts +23 -39
  213. package/src/review/format.ts +79 -46
  214. package/src/review/glyphs.ts +1 -0
  215. package/src/review/hand-over.ts +3 -3
  216. package/src/review/heard.ts +1 -1
  217. package/src/review/holds-sync.ts +2 -1
  218. package/src/review/inbox-hook.ts +2 -2
  219. package/src/review/inbox-read.ts +39 -33
  220. package/src/review/instruction-guards.ts +12 -0
  221. package/src/review/instructions.ts +0 -1
  222. package/src/review/item-db.ts +13 -43
  223. package/src/review/item-hq.ts +2 -2
  224. package/src/review/item-rows.ts +3 -14
  225. package/src/review/kind-catalog.ts +3 -1
  226. package/src/review/kinds.ts +18 -8
  227. package/src/review/live-view.ts +3 -0
  228. package/src/review/media-kind.ts +1 -1
  229. package/src/review/mentions.ts +1 -2
  230. package/src/review/model.ts +158 -114
  231. package/src/review/move.ts +149 -0
  232. package/src/review/need-threads.ts +3 -2
  233. package/src/review/object-card.ts +11 -0
  234. package/src/review/object-read.ts +6 -1
  235. package/src/review/one-block.ts +1 -1
  236. package/src/review/owner-read.ts +1 -1
  237. package/src/review/phone-push.ts +10 -9
  238. package/src/review/previews.ts +32 -4
  239. package/src/review/push.ts +2 -2
  240. package/src/review/recap.ts +129 -0
  241. package/src/review/referring.ts +6 -3
  242. package/src/review/reflection-object.ts +4 -3
  243. package/src/review/routes.ts +51 -47
  244. package/src/review/secret-route.ts +3 -2
  245. package/src/review/settle.ts +0 -6
  246. package/src/review/snooze.ts +5 -3
  247. package/src/review/speaker.ts +68 -0
  248. package/src/review/start-title.ts +19 -0
  249. package/src/review/store-parties.ts +28 -0
  250. package/src/review/store.ts +94 -59
  251. package/src/review/{wakes.ts → thread-events.ts} +92 -7
  252. package/src/review/thread-md.ts +35 -14
  253. package/src/review/thread-state.ts +804 -0
  254. package/src/review/threads.ts +29 -347
  255. package/src/review/traces.ts +104 -7
  256. package/src/review/trailer-item.ts +1 -1
  257. package/src/review/unit.ts +7 -9
  258. package/src/review/verdict-items.ts +12 -10
  259. package/src/review/view-layout.ts +25 -1
  260. package/src/review/watch-feed.ts +1 -2
  261. package/src/review/working-guards.ts +2 -3
  262. package/src/rules/untrack-generated.ts +1 -15
  263. package/src/secrets/copy.ts +4 -4
  264. package/src/secrets/lapse.ts +2 -1
  265. package/src/serve/hub-app/advisor-app.tsx +4 -4
  266. package/src/serve/hub-app/advisor-face.tsx +9 -3
  267. package/src/serve/hub-app/advisor-host.ts +27 -27
  268. package/src/serve/hub-app/advisors-model.ts +17 -8
  269. package/src/serve/hub-app/advisors-rights.tsx +1 -1
  270. package/src/serve/hub-app/advisors-st.ts +15 -14
  271. package/src/serve/hub-app/advisors-view.tsx +13 -11
  272. package/src/serve/hub-app/app-bridge.ts +23 -3
  273. package/src/serve/hub-app/asks-page.tsx +1 -1
  274. package/src/serve/hub-app/auto-text.tsx +71 -16
  275. package/src/serve/hub-app/check-view.tsx +0 -8
  276. package/src/serve/hub-app/controls.css +14 -3
  277. package/src/serve/hub-app/database-view.tsx +1 -2
  278. package/src/serve/hub-app/dock-st.ts +1 -1
  279. package/src/serve/hub-app/git-view.tsx +3 -1
  280. package/src/serve/hub-app/hub.css +12 -5
  281. package/src/serve/hub-app/icons.tsx +1 -1
  282. package/src/serve/hub-app/inbox-view.tsx +1 -2
  283. package/src/serve/hub-app/live-sources.ts +2 -2
  284. package/src/serve/hub-app/main-panel.tsx +2 -1
  285. package/src/serve/hub-app/panel-repo.ts +0 -9
  286. package/src/serve/hub-app/pic.tsx +29 -12
  287. package/src/serve/hub-app/polled.ts +16 -2
  288. package/src/serve/hub-app/recordings-st.ts +23 -2
  289. package/src/serve/hub-app/recordings-view.tsx +68 -10
  290. package/src/serve/hub-app/ref-pill.ts +1 -1
  291. package/src/serve/hub-app/repo-st.ts +1 -2
  292. package/src/serve/hub-app/review/advisor-add.tsx +1 -1
  293. package/src/serve/hub-app/review/advisor-invite.tsx +1 -1
  294. package/src/serve/hub-app/review/draft-body.tsx +2 -2
  295. package/src/serve/hub-app/review/heard-line.tsx +1 -1
  296. package/src/serve/hub-app/review/instructions-view.tsx +1 -8
  297. package/src/serve/hub-app/review/kind-states.tsx +14 -9
  298. package/src/serve/hub-app/review/kit.tsx +4 -11
  299. package/src/serve/hub-app/review/lane-bar.tsx +3 -3
  300. package/src/serve/hub-app/review/lightbox.tsx +15 -11
  301. package/src/serve/hub-app/review/line-window.ts +4 -1
  302. package/src/serve/hub-app/review/live-bar-st.ts +2 -2
  303. package/src/serve/hub-app/review/live-view.tsx +57 -1
  304. package/src/serve/hub-app/review/object-panel.tsx +20 -8
  305. package/src/serve/hub-app/review/question-views.tsx +191 -53
  306. package/src/serve/hub-app/review/recap-bar.tsx +40 -0
  307. package/src/serve/hub-app/review/request-cell.tsx +48 -0
  308. package/src/serve/hub-app/review/review-cells.tsx +154 -96
  309. package/src/serve/hub-app/review/review-host.ts +8 -4
  310. package/src/serve/hub-app/review/review-kit.ts +17 -11
  311. package/src/serve/hub-app/review/review-list.tsx +30 -35
  312. package/src/serve/hub-app/review/review-st.ts +32 -42
  313. package/src/serve/hub-app/review/review-thread.tsx +139 -85
  314. package/src/serve/hub-app/review/review-views.tsx +127 -68
  315. package/src/serve/hub-app/review/share-lines.tsx +4 -4
  316. package/src/serve/hub-app/review/start-st.ts +2 -5
  317. package/src/serve/hub-app/review/superseded-runs.ts +4 -3
  318. package/src/serve/hub-app/review/thread-close.tsx +10 -7
  319. package/src/serve/hub-app/review/thread-st.ts +381 -202
  320. package/src/serve/hub-app/review/tone-bar.tsx +129 -0
  321. package/src/serve/hub-app/review/tones.ts +53 -0
  322. package/src/serve/hub-app/review/trailer-body.tsx +2 -2
  323. package/src/serve/hub-app/review/trailer-st.ts +3 -2
  324. package/src/serve/hub-app/review/trailer-voices-st.ts +3 -2
  325. package/src/serve/hub-app/review.css +189 -106
  326. package/src/serve/hub-app/search-view.tsx +1 -1
  327. package/src/serve/hub-app/social/social-model.ts +0 -4
  328. package/src/serve/hub-app/source-acts.ts +2 -1
  329. package/src/serve/hub-app/stores/stores-page.tsx +2 -2
  330. package/src/serve/hub-app/terminal-sources.tsx +2 -1
  331. package/src/serve/hub-app/thread-row.tsx +3 -4
  332. package/src/serve/hub-app/tree-build.ts +0 -4
  333. package/src/serve/hub-app/urls-view.tsx +2 -1
  334. package/src/serve/hub-app/view-layout.css +13 -3
  335. package/src/serve/hub-app/wikis-view.tsx +5 -2
  336. package/src/serve/hub-runtime.ts +7 -37
  337. package/src/serve/project-gutter-route.ts +6 -2
  338. package/src/serve/read-thread.ts +20 -2
  339. package/src/serve/read-worker.ts +9 -1
  340. package/src/serve/record-pages.ts +46 -0
  341. package/src/serve/serve-hub.ts +2 -2
  342. package/src/serve/terminal-host.ts +1 -1
  343. package/src/serve/terminal-route.ts +1 -3
  344. package/src/serve/tracked-watch.ts +1 -3
  345. package/src/setup-house.ts +2 -2
  346. package/src/shipkit-files.ts +1 -1
  347. package/src/shipkit.ts +1 -6
  348. package/src/shot/client.ts +2 -1
  349. package/src/shot/film-box.ts +0 -20
  350. package/src/shot/on-place.ts +141 -0
  351. package/src/social/drafts.ts +1 -1
  352. package/src/social/kinds.ts +6 -29
  353. package/src/social/load.ts +2 -2
  354. package/src/social/post-object.ts +3 -2
  355. package/src/social/release-stage.ts +1 -1
  356. package/src/social/stage.ts +2 -2
  357. package/src/stores/model.ts +4 -0
  358. package/src/stores/routes.ts +11 -3
  359. package/src/suite/judge-suites.ts +58 -0
  360. package/src/suite/red-alone.ts +54 -18
  361. package/src/suite/runner-shapes.ts +2 -2
  362. package/src/suite/suite-cli.ts +67 -14
  363. package/src/suite/test-units.ts +2 -1
  364. package/src/urls/fill.ts +1 -1
  365. package/src/urls/places.ts +1 -2
  366. package/src/vault/vault-config.ts +2 -2
  367. package/src/vault/vault-init.ts +1 -5
  368. package/src/wiki/graph-page.ts +14 -2
  369. package/src/advisors/copy-truth.ts +0 -49
  370. package/src/advisors/door-child.ts +0 -112
  371. package/src/advisors/door-serve.ts +0 -52
  372. package/src/advisors/door.ts +0 -118
  373. package/src/checks/SK016-legacy-check-shapes.check.ts +0 -189
  374. package/src/checks/SK029-explicit-check-files.check.ts +0 -112
  375. package/src/checks/SK048-one-local-file.check.ts +0 -36
  376. package/src/core/config-rewrite.ts +0 -111
  377. package/src/core/daemon-port.ts +0 -10
  378. package/src/core/legacy-shapes.ts +0 -263
  379. package/src/core/migrate-layout.ts +0 -638
  380. package/src/core/port-check-cli.ts +0 -52
  381. package/src/core/port-check-file.ts +0 -295
  382. package/src/core/port-check-files.ts +0 -31
  383. package/src/gate/discover-legacy-checks.ts +0 -26
  384. package/src/home/home-move.ts +0 -527
  385. package/src/home/machine-fold.ts +0 -810
  386. package/src/hq/item-shapes.ts +0 -54
  387. package/src/hq/kinds/items-read.ts +0 -4
  388. package/src/media-store/backup/daemon.ts +0 -220
  389. package/src/media-store/backup/kept.ts +0 -241
  390. package/src/media-store/backup/prune.ts +0 -359
  391. package/src/media-store/backup/secret.ts +0 -88
  392. package/src/media-store/backup/ssh-space.ts +0 -202
  393. package/src/media-store/backup/watch.ts +0 -117
  394. package/src/review/band.ts +0 -182
  395. package/src/review/folders.ts +0 -216
  396. package/src/review/hook-ask.ts +0 -58
  397. package/src/review/role.ts +0 -48
  398. package/src/review/thread-fold.ts +0 -64
  399. package/src/review/wait.ts +0 -91
  400. package/src/rules/rule.ts +0 -43
  401. package/src/serve/hook-thread.ts +0 -37
  402. package/src/serve/hook-work.ts +0 -92
  403. package/src/serve/hook-worker.ts +0 -57
  404. package/src/serve/hub-app/review/dock.tsx +0 -147
  405. package/src/serve/hub-app/review/faces.tsx +0 -18
  406. package/src/serve/hub-app/review/item-verdict.tsx +0 -112
  407. package/src/serve/hub-app/review/review-board.tsx +0 -48
  408. /package/src/{scaffold → core}/jsonc-spans.ts +0 -0
@@ -1,8 +1,8 @@
1
- // the review page's host at the advisors' door (wiki tools/shipkit/advisors.md, The advisor's app): the same page and
2
- // thread components as the owner's hub, over the read only copy of the review api the door serves. Every request is
3
- // one of that api's paths under `base` ('' at the door, the hub's preview prefix in his preview)
1
+ // the review page's host on the advisors page (wiki tools/shipkit/advisors.md, The advisor's app): the same page and
2
+ // thread components as the owner's hub, over the few review api paths the users' port serves. Every request is one of
3
+ // those paths under `base` ('' on the users' port, the hub's preview prefix in the owner's preview)
4
4
  // the one constraint a reader breaks first: this module and what it imports never reach the home, the terminal, the
5
- // vault or a secret (tests/advisor-app.test.ts walks the graph); the door's route list is the wall, this is hygiene
5
+ // vault or a secret (tests/advisor-app.test.ts walks the graph); the users' port's route list is the wall, this is hygiene
6
6
  import { makeAutoObservable, reaction, runInAction } from 'mobx'
7
7
  import { ClockSvc } from './clock-svc.ts'
8
8
  import { FrameCache } from './frames-st.ts'
@@ -11,34 +11,33 @@ import { canOf, type ReviewAct, type ReviewHome, type ReviewHost } from './revie
11
11
  import { ReviewSt } from './review/review-st.ts'
12
12
  import { reach } from './reach.ts'
13
13
 
14
- /** the header a write carries, its value the page's meta `advisor-csrf`: the door refuses a write without it */
14
+ /** the header a write carries, its value the page's meta `advisor-csrf`: the users' port refuses a write without it */
15
15
  export const CSRF_HEADER = 'x-advisor-csrf'
16
- /** the header of the door's api answers: the sha of the script its shell names now (advisors/edge/handler.ts) */
16
+ /** the header of the users' port's api answers: the sha of the script its shell names now (advisors/edge/handler.ts) */
17
17
  export const APP_HEADER = 'x-advisor-app'
18
18
  /** an advisor's page reads again this often, and not at all while its tab is hidden */
19
19
  export const ADVISOR_POLL_MS = 30_000
20
- /** after an act of theirs: a read this often, for this long, so their own words, pick or verdict show within a pass of
21
- * the Mac's job (advisors/job.ts, 10 s) */
20
+ /** after an act of theirs: a read this often, for this long, so what the act changed shows before the next poll */
22
21
  export const AFTER_ACT_MS = 2_000
23
22
  export const AFTER_ACT_FOR_MS = 25_000
24
23
 
25
24
  export interface AdvisorMeta {
26
- /** the prefix every api path goes under: '' at the door */
25
+ /** the prefix every api path goes under: '' on the users' port */
27
26
  base: string
28
27
  csrf: string
29
- /** the name the door knows the advisor by, the page's title */
28
+ /** the name the users' port knows the advisor by, the page's title */
30
29
  name: string
31
30
  /** the owner's name: the owner's words go under it */
32
31
  owner: string
33
- /** the advisor's own name for the page's head, '' when the door knows none */
32
+ /** the advisor's own name for the page's head, '' when the port knows none */
34
33
  me: string
35
- /** the start of their own photo's hash when the door serves one, '' for none: their face is their initials */
34
+ /** the start of their own photo's hash when the port serves one, '' for none: their face is their initials */
36
35
  photo: string
37
36
  /** the sha of this page's own script, from its address; '' when it has none (his preview) */
38
37
  app: string
39
38
  }
40
39
 
41
- /** the page's facts, from its meta tags: the door writes them in the shell, nothing else does */
40
+ /** the page's facts, from its meta tags: the users' port writes them in the shell, and the owner's preview in its own */
42
41
  export function advisorMeta(doc: Pick<Document, 'querySelector'>): AdvisorMeta {
43
42
  const meta = (n: string): string => doc.querySelector(`meta[name="${n}"]`)?.getAttribute('content') ?? ''
44
43
  const base = meta('advisor-base')
@@ -54,9 +53,9 @@ export class AdvisorHost implements ReviewHost {
54
53
  readonly clock = new ClockSvc()
55
54
  readonly home: ReviewHome = { embedded: false, layout: new LayoutSt(), frames: new FrameCache() }
56
55
  readonly review: ReviewSt
57
- /** the door's session ended (its 401): the page says so, with the way back */
56
+ /** the session ended (the users' port's 401): the page says so, with the way back */
58
57
  signedOut = false
59
- /** the door serves a newer page than this one: it says « reload », and reloads itself when nothing is typed */
58
+ /** the users' port serves a newer page than this one: it says « reload », and reloads itself when nothing is typed */
60
59
  stale = false
61
60
  /** the projects they may start a thread on, read once at the start */
62
61
  starts: { id: string; project: string }[] = []
@@ -72,7 +71,7 @@ export class AdvisorHost implements ReviewHost {
72
71
  const ok = Array.isArray(v) ? v.filter((x): x is { id: string; project: string } => typeof x?.id === 'string' && typeof x?.project === 'string') : []
73
72
  runInAction(() => (this.starts = ok))
74
73
  } catch {
75
- // a door that does not answer offers no project: the threads still read
74
+ // a port that does not answer offers no project: the threads still read
76
75
  }
77
76
  }
78
77
  async start(project: string, o: { title: string; text: string; files: readonly { token: string }[] }): Promise<void> {
@@ -107,8 +106,8 @@ export class AdvisorHost implements ReviewHost {
107
106
  }
108
107
  private brisk: ReturnType<typeof setInterval> | null = null
109
108
  private briskUntil = 0
110
- /** an act of theirs went out: the door draws it once the Mac's next pass wrote their copy (every 10 s), so the page
111
- * reads again every AFTER_ACT_MS for AFTER_ACT_FOR_MS, never waiting for its next poll. His preview takes no act */
109
+ /** an act of theirs went out: the users' port answers it from the store at the next read, so the page reads again
110
+ * every AFTER_ACT_MS for AFTER_ACT_FOR_MS, never waiting for its next poll. The owner's preview takes no act */
112
111
  moved(): void {
113
112
  if (this.meta.csrf === '' || this.signedOut) return
114
113
  this.briskUntil = Date.now() + AFTER_ACT_FOR_MS
@@ -134,15 +133,15 @@ export class AdvisorHost implements ReviewHost {
134
133
  this.signedOut = true
135
134
  this.review.stop()
136
135
  }
137
- /** at the door alone: his preview has no session to end */
136
+ /** on the users' port alone: the owner's preview has no session to end */
138
137
  get canSignOut(): boolean {
139
138
  return this.meta.csrf !== '' && this.meta.base === ''
140
139
  }
141
- /** « sign out »: the door ends this session, then the sign in page */
140
+ /** « sign out »: the users' port ends this session, then the sign in page */
142
141
  async signOut(go: (url: string) => void = (u) => location.assign(u)): Promise<void> {
143
142
  await reach(this.url('/api/advisor/out'), { method: 'POST', headers: { 'content-type': 'application/json' }, body: '{}' }).catch(() => null)
144
143
  this.setSignedOut()
145
- // the next person on this browser starts with nothing of theirs: the door's origin holds this page's state alone
144
+ // the next person on this browser starts with nothing of theirs: the advisors page's origin holds this page's state alone
146
145
  try {
147
146
  localStorage.clear()
148
147
  } catch {
@@ -152,11 +151,11 @@ export class AdvisorHost implements ReviewHost {
152
151
  }
153
152
  }
154
153
 
155
- /** the page beats this often while its tab shows: well inside the door's HERE_FRESH_MS (advisors/edge/here.ts) */
154
+ /** the page beats this often while its tab shows: well inside the port's HERE_FRESH_MS (advisors/edge/here.ts) */
156
155
  export const HERE_BEAT_MS = 10_000
157
156
 
158
- /** the page's beat at the door (advisors/edge/here.ts): the thread it has open, every HERE_BEAT_MS while its tab shows
159
- * and at once when it changes; « none » as the tab hides or the page leaves. Its answer carries nothing. His preview
157
+ /** the page's beat on the users' port (advisors/edge/here.ts): the thread it has open, every HERE_BEAT_MS while its tab shows
158
+ * and at once when it changes; « none » as the tab hides or the page leaves. Its answer carries nothing. The owner's preview
160
159
  * (no token) never beats */
161
160
  export class HereBeat {
162
161
  private timer: ReturnType<typeof setInterval> | null = null
@@ -187,14 +186,15 @@ export class HereBeat {
187
186
  }
188
187
  }
189
188
 
190
- /** the one answer that means the session ended: the door's 401 (a new code was sent, or nothing is shared any more),
191
- * or a redirect (opaque under `redirect: 'manual'`), which the door never answers its own page. A 304 is the door saying the list or view the page holds is current; any other refusal is that request's own,
189
+ /** the one answer that means the session ended: the users' port's 401 (a new code was sent, or nothing is shared any
190
+ * more), or a redirect (opaque under `redirect: 'manual'`), which the port never answers its own page. A 304 is the
191
+ * port saying the list or view the page holds is current; any other refusal is that request's own,
192
192
  * shown where it was asked */
193
193
  export const signInEnded = (r: Pick<Response, 'type' | 'status'>): boolean =>
194
194
  r.type === 'opaqueredirect' || r.status === 401 || [301, 302, 303, 307, 308].includes(r.status)
195
195
 
196
196
  /** every request of the page: its own origin only, a write with the token, a redirect never followed. An ended session
197
- * stops the page, which says « sign in again », linking the door's sign in */
197
+ * stops the page, which says « sign in again », linking the advisors page's sign in */
198
198
  export function advisorFetch(host: Pick<AdvisorHost, 'meta' | 'setSignedOut'> & Partial<Pick<AdvisorHost, 'setStale'>>, inner: typeof fetch): typeof fetch {
199
199
  const wrapped = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {
200
200
  const url = new URL(input instanceof Request ? input.url : String(input), location.href)
@@ -51,11 +51,20 @@ const since = (at: string, now: number): string => {
51
51
  return m < 1 ? 'just now' : m < 60 ? `${m} min ago` : m < 48 * 60 ? `${Math.round(m / 60)} h ago` : `${Math.round(m / 1440)} days ago`
52
52
  }
53
53
 
54
- /** a person on one thread at the door: on it now, or when they were last; null when never */
54
+ /** a person on one thread on the advisors page: on it now, or when they were last; null when never */
55
55
  export const hereWords = (name: string, h: { on: boolean; at: string } | null, now: number): string | null =>
56
56
  h === null ? null : h.on ? `${name} is on this thread now` : `${name} was here ${since(h.at, now)}`
57
57
 
58
- /** where a person is at the door, on their line of the advisors page */
58
+ /** a password reset a person asked at the sign in, on their line for a week: « Ada asked for a password reset 5 min
59
+ * ago », and why the mail did not go; null for none. Nothing for him to do */
60
+ export function resetWords(name: string, resets: readonly { at: string; sent?: string; why?: string }[] | undefined, now: number): string | null {
61
+ const r = resets?.at(-1)
62
+ if (r === undefined || now - Date.parse(r.at) > 7 * 86_400_000) return null
63
+ const asked = `${name} asked for a password reset ${since(r.at, now)}`
64
+ return r.why !== undefined ? `${asked}: the mail did not go (${r.why})` : asked
65
+ }
66
+
67
+ /** where a person is on the advisors page, on their line of the hub's advisors page */
59
68
  export const whereWords = (h: { on: boolean; at: string; title: string } | null, now: number): string => (h === null ? 'not seen on the advisors page yet' : h.on ? `on ${h.title}` : `last seen ${since(h.at, now)}`)
60
69
 
61
70
  /** a row's faces in one tip: who can open the thread, then where each one is */
@@ -120,15 +129,15 @@ export interface RedAct {
120
129
  lines: string[]
121
130
  note: string
122
131
  act: string
123
- run: { all: true } | { ids: string[] } | { door: true }
132
+ run: { all: true } | { ids: string[] } | { setup: true }
124
133
  }
125
134
 
126
- /** his « set the door up now »: each step it takes at Cloudflare and on this Mac, the deletes named, who gets mail */
127
- export function setupDoorAct(d: Pick<AdvisorsPage, 'shares' | 'advisors' | 'access' | 'door'>): RedAct {
128
- const host = d.door?.want ?? d.door?.host ?? null
135
+ /** the owner's « set the advisors page up now »: each step it takes at Cloudflare and on this Mac, the deletes named, who gets mail */
136
+ export function setupAct(d: Pick<AdvisorsPage, 'shares' | 'advisors' | 'access' | 'reach'>): RedAct {
137
+ const host = d.reach?.want ?? d.reach?.host ?? null
129
138
  const people = new Set([...d.shares.filter((s) => s.live).map((s) => s.advisor), ...(d.access ?? []).filter((a) => a.live).map((a) => a.advisor)]).size
130
139
  return {
131
- key: 'door',
140
+ key: 'setup',
132
141
  question: 'Set the advisors page up now?',
133
142
  lines: [
134
143
  'makes the Cloudflare tunnel to this Mac, or finds it, and stores its token',
@@ -139,7 +148,7 @@ export function setupDoorAct(d: Pick<AdvisorsPage, 'shares' | 'advisors' | 'acce
139
148
  ],
140
149
  note: 'It uses the setup token you stored in the ask that opens the advisors page. Each step\'s line shows here as it ends.',
141
150
  act: 'set it up',
142
- run: { door: true },
151
+ run: { setup: true },
143
152
  }
144
153
  }
145
154
 
@@ -1,4 +1,4 @@
1
- // the rights grid (wiki tools/shipkit/advisors.md, Rights): at one layer, each right as it resolves there, the layer it
1
+ // the rights grid (wiki tools/shipkit/advisors.md, The model: people, grants, rights): at one layer, each right as it resolves there, the layer it
2
2
  // comes from, and his click that sets it at that layer (« ↺ » clears it there, the layer below decides). Drawn on a
3
3
  // person's line, the page's defaults, and a face of a thread's head. Every write is his: the owner word gate holds it
4
4
  import { observer } from 'mobx-react-lite'
@@ -2,9 +2,10 @@
2
2
  // to an advisor for the rows, each thread's bar cached by its head, his acts, and the preview of what a person reads.
3
3
  // The daemon's /api/home/advisors answers all of it
4
4
  import { makeAutoObservable, observableRef, runInAction } from 'mobx'
5
- import type { DoorFacts } from '../../advisors/door.ts'
5
+ import type { ReachFacts } from '../../advisors/reach.ts'
6
6
  import type { AccessRow, AdviceRow, KnownRow, MailFacts, ProposalRow, ShareRow, ThreadPerson } from '../../advisors/routes.ts'
7
7
  import type { InviteSent } from '../../advisors/invite-send.ts'
8
+ import type { ResetAsked } from '../../advisors/owner-store.ts'
8
9
  import type { Rights, RightsLayer } from '../../advisors/rights.ts'
9
10
  import type { Cursor } from '../../review/traces.ts'
10
11
  import type { ShareEvent } from '../../advisors/share-trace.ts'
@@ -15,7 +16,7 @@ import { KeptFolds } from './kept-folds.ts'
15
16
  import { postJson } from './review/review-kit.ts'
16
17
  import { PollGate } from './push-svc.ts'
17
18
 
18
- /** a person on a thread at the door (advisors/routes.ts `/here`): on it now, or their last beat there */
19
+ /** a person on a thread on the advisors page (advisors/routes.ts `/here`): on it now, or their last beat there */
19
20
  export interface HereSeen {
20
21
  advisor: string
21
22
  repo: string
@@ -30,7 +31,7 @@ export interface AdvisorsPage {
30
31
  owner: string
31
32
  host: string | null
32
33
  /** the people: his profiles and the ones an agent prepared (`preparedBy`), each with their own rights' default */
33
- advisors: { id: string; name: string; email: string; created: string; preparedBy?: string; source?: string; photo?: { sha: string; at: string; seen?: true }; rights?: Rights }[]
34
+ advisors: { id: string; name: string; email: string; created: string; preparedBy?: string; source?: string; photo?: { sha: string; at: string; seen?: true }; rights?: Rights; resets?: ResetAsked[] }[]
34
35
  /** the live accesses to a project; absent from a daemon older than the people */
35
36
  access?: AccessRow[]
36
37
  /** the rights' layers as he wrote them, over the house's defaults; absent from a daemon older than the people */
@@ -43,8 +44,8 @@ export interface AdvisorsPage {
43
44
  /** his name for advisors (advisors/owner-name.ts): the house identity's id, his layers, each project's name and
44
45
  * identity as they resolve; absent from a daemon older than the setting */
45
46
  names?: AdvisorNames
46
- /** the door in one line, and the ask it needs while it does not work */
47
- door?: DoorFacts
47
+ /** the advisors page's reach in one line, and the ask it needs while it does not work */
48
+ reach?: ReachFacts
48
49
  }
49
50
 
50
51
  export interface AdvisorNames {
@@ -86,8 +87,8 @@ export interface ThreadBar {
86
87
  known?: KnownAdvisor[]
87
88
  /** who has this thread now, for the faces on it; absent from a daemon older than the people */
88
89
  people?: ThreadPerson[]
89
- /** the door is set up */
90
- doorOpen?: boolean
90
+ /** the advisors page is set up */
91
+ setUp?: boolean
91
92
  /** whether a share mails the invite by itself; absent from a daemon older than the sent invite */
92
93
  mail?: MailFacts
93
94
  shares: ShareRow[]
@@ -95,8 +96,8 @@ export interface ThreadBar {
95
96
  deferredTo: string | null
96
97
  /** the thread's shares as lines of its timeline (advisors/share-trace.ts); absent from a daemon older than the trace */
97
98
  trace?: ShareEvent[]
98
- /** the door's facts, as the page's foot reads them */
99
- door?: DoorFacts
99
+ /** the advisors page's facts, as the page's foot reads them */
100
+ reach?: ReachFacts
100
101
  }
101
102
 
102
103
  /** a line of the « add advisor » list: a person with a grant on this project, another he knows, or the typed words as
@@ -340,7 +341,7 @@ export class AdvisorsSt {
340
341
  seen = new Map<string, { name: string; at: string }[]>()
341
342
  /** every person by id, for the faces a list draws from ids (a row's « who can open it ») */
342
343
  people = new Map<string, { name: string; photo: string | null }>()
343
- /** where each person is at the door: the thread their page has open now, or when they were last on each */
344
+ /** where each person is on the advisors page: the thread their page has open now, or when they were last on each */
344
345
  here: HereSeen[] = []
345
346
  /** the share whose preview is open */
346
347
  preview: ShareRow | null = null
@@ -363,7 +364,7 @@ export class AdvisorsSt {
363
364
  defaultsAt = ''
364
365
  /** the layer his name for advisors writes */
365
366
  namesAt: NameAt = ''
366
- /** what a red button asked to do (shares to end, the door's setup), its confirm open; nothing runs until he
367
+ /** what a red button asked to do (shares to end, the advisors page's setup), its confirm open; nothing runs until the owner
367
368
  * confirms */
368
369
  asking: RedAct | null = null
369
370
  /** the photos an agent set, their faces shown, and the ones he skips in this OK */
@@ -387,14 +388,14 @@ export class AdvisorsSt {
387
388
  }
388
389
 
389
390
  /** his confirm: exactly what the popup named, through the acts his page has (every share, each share's
390
- * « unshare », the door's setup), then the page reads again */
391
+ * « unshare », the advisors page's setup), then the page reads again */
391
392
  async confirmAsked(): Promise<void> {
392
393
  const e = this.asking
393
394
  if (e === null) return
394
395
  this.asking = null
395
396
  const run = e.run
396
397
  if ('all' in run) return this.post('/revoke', { all: true })
397
- if ('door' in run) return this.post('/door/setup')
398
+ if ('setup' in run) return this.post('/setup')
398
399
  await this.act(async () => {
399
400
  for (const id of run.ids) await postJson(`${API}/share/${encodeURIComponent(id)}/unshare`, {})
400
401
  })
@@ -409,7 +410,7 @@ export class AdvisorsSt {
409
410
  this.skipped = v ? [...this.skipped, id] : this.skipped.filter((x) => x !== id)
410
411
  }
411
412
 
412
- /** his OK on the photos an agent set: each leaves for that person's own page at the door */
413
+ /** the owner's OK on the photos an agent set: each leaves for that person's own page on the advisors page */
413
414
  async sendPhotos(ids: readonly string[]): Promise<void> {
414
415
  await this.act(async () => {
415
416
  for (const id of ids) await postJson(`${API}/advisor/${encodeURIComponent(id)}/photo/send`, {})
@@ -1,16 +1,16 @@
1
1
  // `/advisors` (wiki tools/shipkit/advisors.md, What he does): the people he shares threads with, one line each (their
2
2
  // face, what they read now, the projects they have, what waits for his confirm as one line that opens a compact list,
3
3
  // their rights as a grid), the advice and threads they sent, the defaults for everyone, and at the foot the photos an
4
- // agent set in one line and the door in one line, the ask it needs while it does not work. The preview
4
+ // agent set in one line and the advisors page's reach in one line, the ask it needs while it does not work. The preview
5
5
  // dialog opens over any page: the person's own page as it reads.
6
6
  // The constraint a reader breaks first: a person's words are drawn as plain text, never markup or a link (they come
7
7
  // from outside the house)
8
8
  import { observer } from 'mobx-react-lite'
9
9
  import { useEffect, useRef, useState } from 'react'
10
- import type { DoorFacts } from '../../advisors/door.ts'
10
+ import type { ReachFacts } from '../../advisors/reach.ts'
11
11
  import type { ShareRow } from '../../advisors/routes.ts'
12
12
  import { nameAt, nameBelow, type AdvisorNames, type AdvisorsPage, type AdvisorsSt } from './advisors-st.ts'
13
- import { closedWords, DEFAULTS_TIP, whereWords, defaultsWords, endAll, endClosed, peopleOf, setupDoorAct, sharedWords, shareWords, waitWords, type RedAct, type Person, type PersonLine } from './advisors-model.ts'
13
+ import { closedWords, DEFAULTS_TIP, whereWords, defaultsWords, endAll, endClosed, peopleOf, resetWords, setupAct, sharedWords, shareWords, waitWords, type RedAct, type Person, type PersonLine } from './advisors-model.ts'
14
14
  import { LayerTabs, RightsGrid } from './advisors-rights.tsx'
15
15
  import type { HomeSt } from './home-st.ts'
16
16
  import { AskLink, InviteCopy } from './review/share-lines.tsx'
@@ -39,7 +39,7 @@ export const PreviewDialog = observer(({ adv }: { adv: AdvisorsSt }) => {
39
39
  <button className="ghost" {...tip('close the preview')} aria-label="close" onClick={() => adv.closePreview()}>✕</button>
40
40
  </div>
41
41
  {adv.copied !== null ? <div className="adv-dim">the thread's address on the advisors page is copied: {adv.copied}</div> : <div className="adv-dim">the advisors page is not set up yet: nothing leaves until it is (sk asks)</div>}
42
- {/* the advisors' app itself, with no origin of its own: it reads the copy as it would leave, and takes no answer */}
42
+ {/* the advisors' app itself, with no origin of its own: every read answered as theirs, and it takes no answer */}
43
43
  {adv.previewPath !== null ? <iframe key={stamp} className="adv-frame" title={`the page ${s.name} reads`} sandbox="allow-scripts" src={adv.previewPath} /> : null}
44
44
  </div>
45
45
  </div>
@@ -83,7 +83,7 @@ const LiveList = observer(({ adv, shares }: { adv: AdvisorsSt; shares: ShareRow[
83
83
  {s.reach !== null && !s.reach.ok ? <span className="adv-dim" {...tip(s.reach.why)}>not reached</span> : null}
84
84
  <span className="adv-dim adv-until" {...tip(`until ${day(s.expires)}`)}>until {until(s.expires)}</span>
85
85
  {s.copy != null ? <InviteCopy name={s.name} invite={s.copy} /> : null}
86
- <button className="ghost" {...tip('opens their page as they read this thread now')} onClick={() => adv.openPreview(s)}>preview</button>
86
+ <button className="ghost" {...tip('their page, read as they read this thread now: the same filter, nothing sent')} onClick={() => adv.openPreview(s)}>view as {s.name}</button>
87
87
  <button className="ghost" {...tip('the share lasts their days again, counted from now')} onClick={() => void adv.post(`/share/${s.id}/renew`)}>renew</button>
88
88
  <button className="ghost danger" {...tip('they stop reading this thread at their next request')} onClick={() => void adv.post(`/share/${s.id}/unshare`)}>unshare</button>
89
89
  </div>
@@ -163,7 +163,7 @@ const RowMore = observer(({ adv, c, repos }: { adv: AdvisorsSt; c: PersonLine; r
163
163
  )
164
164
  })
165
165
 
166
- /** where a person is at the door: the thread their page has open now, a link there with a live dot, else when they
166
+ /** where a person is on the advisors page: the thread their page has open now, a link there with a live dot, else when they
167
167
  * were last seen; nothing for someone never seen */
168
168
  const WhereIs = observer(({ adv, id, name }: { adv: AdvisorsSt; id: string; name: string }) => {
169
169
  const h = adv.whereIs(id)
@@ -186,6 +186,7 @@ const Row = observer(({ adv, c, d }: { adv: AdvisorsSt; c: PersonLine; d: Adviso
186
186
  const layer = adv.layer[c.id] ?? ''
187
187
  const projects = [...new Set([...c.projects.map((p) => p.repo), ...c.live.map((s) => s.repo), ...c.waiting.map((s) => s.repo)])]
188
188
  const alarm = c.waiting.some((s) => sensitivePart(s.address) !== null)
189
+ const reset = resetWords(c.name, c.person.resets, Date.now())
189
190
  return (
190
191
  <article className="adv-person" data-person={c.name} data-state={c.state} data-open={panel ?? undefined}>
191
192
  <div className="adv-prow">
@@ -195,6 +196,7 @@ const Row = observer(({ adv, c, d }: { adv: AdvisorsSt; c: PersonLine; d: Adviso
195
196
  <span className="adv-dim adv-email">{c.person.email}</span>
196
197
  {c.prepared !== null ? <span className="adv-note">{c.prepared}</span> : null}
197
198
  <WhereIs adv={adv} id={c.id} name={c.name} />
199
+ {reset !== null ? <span className="adv-note" data-check="advisor-reset">{reset}</span> : null}
198
200
  </span>
199
201
  <span className="adv-sees">
200
202
  {c.projects.map((p) => (
@@ -307,7 +309,7 @@ const NamesPanel = observer(({ adv, n }: { adv: AdvisorsSt; n: AdvisorNames }) =
307
309
  })
308
310
 
309
311
  /** the setup the daemon runs once his token landed: each step's line as it ends, then done or the failure in words */
310
- const SetupLines = ({ run }: { run: NonNullable<DoorFacts['run']> }) => (
312
+ const SetupLines = ({ run }: { run: NonNullable<ReachFacts['run']> }) => (
311
313
  <section className="adv-setup" data-check="setup-run" data-state={run.state} aria-live="polite">
312
314
  {run.lines.map((l, i) => (
313
315
  <div key={i} className={l.text.startsWith('WARN ') ? 'adv-warn' : 'adv-dim'}>{l.text.startsWith('WARN ') ? '!' : '✓'} {l.text.replace(/^WARN /, '')}</div>
@@ -317,11 +319,11 @@ const SetupLines = ({ run }: { run: NonNullable<DoorFacts['run']> }) => (
317
319
  </section>
318
320
  )
319
321
 
320
- /** the door in one quiet line (whether advisors reach this Mac, else what it needs, its ask linked), the red acts
322
+ /** the advisors page's reach in one quiet line (whether advisors reach this Mac, else what it needs, its ask linked), the red acts
321
323
  * that end shares, then his name and the default rights, each a box that folds */
322
324
  const Foot = observer(({ app, d }: { app: HomeSt; d: AdvisorsPage }) => {
323
325
  const st = app.advisors
324
- const f = d.door
326
+ const f = d.reach
325
327
  const live = d.shares.some((s) => s.live || s.state === 'pending')
326
328
  const closed = d.shares.filter((s) => s.live && s.closed === true).length
327
329
  return (
@@ -329,13 +331,13 @@ const Foot = observer(({ app, d }: { app: HomeSt; d: AdvisorsPage }) => {
329
331
  <PhotosLine adv={st} d={d} />
330
332
  <footer className="adv-foot">
331
333
  {f !== undefined ? (
332
- <span className={f.ok ? 'adv-dim' : 'adv-warn'} data-check="door-line">
334
+ <span className={f.ok ? 'adv-dim' : 'adv-warn'} data-check="reach-line">
333
335
  {f.ok ? f.words : <AskLink adv={st} ask={f.ask} says="opens the ask that sets the advisors page up">{f.words}</AskLink>}
334
336
  </span>
335
337
  ) : null}
336
338
  {f?.run != null ? <SetupLines run={f.run} /> : null}
337
339
  <span className="sp" />
338
- {f !== undefined && !f.ok && f.run?.state !== 'running' ? <RedButton adv={st} check="door-setup" act={() => setupDoorAct(d)} label="set the advisors page up now" tipText="runs the advisors page's setup now, with the setup token stored in its ask: it asks first, naming each step" /> : null}
340
+ {f !== undefined && !f.ok && f.run?.state !== 'running' ? <RedButton adv={st} check="setup-now" act={() => setupAct(d)} label="set the advisors page up now" tipText="runs the advisors page's setup now, with the setup token stored in its ask: it asks first, naming each step" /> : null}
339
341
  {closed > 0 ? <RedButton adv={st} check="end-closed-all" act={() => endClosed(d, null)} label={closedWords(closed)} tipText="each person stops reading the threads that are closed; the active ones stay. It asks first" /> : null}
340
342
  {live ? <RedButton adv={st} check="end-all" act={() => endAll(d)} label="end every share" tipText={`ends ${shareWords(d)}: each person reads nothing from their next request. It asks first`} /> : null}
341
343
  </footer>
@@ -37,6 +37,14 @@ export function appPost(w: unknown = globalThis): Post | null {
37
37
  return h == null ? null : (note) => h.postMessage(note)
38
38
  }
39
39
 
40
+ /** an entry in a new tab: the app turns a new window into a tab of its own. `name`: the tab's title in the app, for a
41
+ * tab that is no page of the hub (a url's site), said to the app before the window is asked; `chips`: a url's
42
+ * logins, which that tab wears in its title bar */
43
+ export const openTab = (href: string, name?: string, chips?: TabChips): void => {
44
+ if (name != null) appPost()?.({ tabName: name, url: new URL(href, globalThis.location?.href).href, ...chips })
45
+ void globalThis.open?.(href, '_blank')
46
+ }
47
+
40
48
  /** the app's side panel, or null: a browser tab, a process's app, an app built before the panel. The app marks each
41
49
  * page it gives its bridge (`__skSidePanel`, ShipkitGui.swift webConfig) */
42
50
  export function appSide(w: unknown = globalThis): ((url: string, identity?: SideIdentity | null) => void) | null {
@@ -95,12 +103,25 @@ export function openLink(e: MouseEvent, w: unknown = globalThis, frame: LinkFram
95
103
  let url: URL
96
104
  try { url = new URL(a.getAttribute('href') ?? '', here?.href) } catch { return false }
97
105
  if ((url.protocol !== 'http:' && url.protocol !== 'https:') || url.origin === here?.origin) return false
106
+ return openBeside(url, w, frame, identity, () => e.preventDefault())
107
+ }
108
+
109
+ /** whether this page opens a link beside itself: the app's side panel, else the page's side frame */
110
+ export const besideKind = (w: unknown = globalThis, frame: { live: boolean } | null = null): 'app' | 'frame' | null =>
111
+ appSide(w) != null ? 'app' : frame?.live === true ? 'frame' : null
112
+
113
+ /** `url` beside the page, where `sideChoice` says; false when its way is a tab (the frame said why) or the page has
114
+ * neither the app nor a side frame. `taken` runs before it opens */
115
+ export function openBeside(url: URL, w: unknown = globalThis, frame: LinkFrame | null = null, identity: SideIdentity | null = null, taken: () => void = () => {}): boolean {
116
+ const side = appSide(w)
117
+ if (side == null && frame?.live !== true) return false
118
+ const here = (w as { location?: { protocol: string; hostname: string } }).location
98
119
  const c = sideChoice(url, { app: side != null, page: { protocol: here?.protocol ?? 'http:', hostname: here?.hostname ?? 'localhost' }, probe: frame?.probe(url) })
99
120
  if (c.to === 'tab') {
100
121
  frame?.refused(url.href, c.why)
101
122
  return false
102
123
  }
103
- e.preventDefault()
124
+ taken()
104
125
  if (c.to === 'app') side!(url.href, identity)
105
126
  else frame!.open(url.href)
106
127
  return true
@@ -184,7 +205,6 @@ export function startAppBridge(o: { projects: { fresh: boolean; list: Project[]
184
205
  const post = o.post === undefined ? appPost(w) : o.post
185
206
  if (post == null) return () => {}
186
207
  const bridge = new AppBridge(post, o.threadUrl)
187
- // openCard: the name an app built from an older source calls, for one release
188
- ;(w as { shipkitApp?: AppHooks & { openCard: AppHooks['openThread'] } }).shipkitApp = { openChrome: (repo, id, at) => openInChrome(repo, id, at), ...o.hooks, openCard: o.hooks.openThread }
208
+ ;(w as { shipkitApp?: AppHooks }).shipkitApp = { openChrome: (repo, id, at) => openInChrome(repo, id, at), ...o.hooks }
189
209
  return reaction(() => (o.projects.fresh ? o.projects.list : null), (list) => { if (list != null) bridge.update(list) }, { fireImmediately: true })
190
210
  }
@@ -3,7 +3,6 @@
3
3
  import { listRow } from './list-row.ts'
4
4
  import { observer } from 'mobx-react-lite'
5
5
  import { afterWords } from '../../asks/ask-after.ts'
6
- import { BAND_WORDS } from '../../review/band.ts'
7
6
  import { stepsWords } from './ask-steps.tsx'
8
7
  import { askAt, askFactWords, isClosedAsk, isLaterAsk, type AskGroupKey } from './col-tables.ts'
9
8
  import { ColListPage, type ColListWords } from './col-list-page.tsx'
@@ -14,6 +13,7 @@ import type { RepoSt } from './repo-st.ts'
14
13
  import { Age, stampWords } from './time-ago.tsx'
15
14
  import { useInSight } from './in-sight.ts'
16
15
  import { tip } from './tips.ts'
16
+ import { BAND_WORDS } from '../../review/thread-state.ts'
17
17
 
18
18
  /** a row of the list, the app's list row: its title, at its end an open ask's steps done (`3/8`, the next step on
19
19
  * hover), else its age in short (`70d`, the full stamp on hover); a later ask the day it waits for; a closed ask dimmed */
@@ -86,40 +86,54 @@ export const AutoText = observer(function AutoText({ value, onText, rows = 2, el
86
86
  }
87
87
  onKeyDown?.(e)
88
88
  }
89
+ const twin = useRef<Twin | null>(null)
89
90
  const size = useCallback((): void => {
90
91
  const t = ref.current
91
92
  if (t == null) return
92
- t.style.height = 'auto'
93
- const edge = t.offsetHeight - t.clientHeight
93
+ const tw = (twin.current ??= new Twin(t))
94
+ if (tw.rows !== rows) tw.fit(t, rows)
94
95
  // an empty box is as tall as its placeholder: the hint reads whole, never cut by a scrollbar
95
96
  const hint = !hintLine && t.value === '' && t.placeholder !== ''
96
- if (hint) t.value = t.placeholder
97
- const h = t.scrollHeight
98
- if (hint) t.value = ''
99
- t.style.height = `${h + edge}px`
97
+ const h = tw.measure(hint ? t.placeholder : t.value) + tw.edge
98
+ const px = `${h}px`
99
+ if (t.style.height !== px) t.style.height = px
100
100
  // a sheet's max-height stops it: only then may it scroll
101
- t.style.overflowY = t.scrollHeight > t.clientHeight + 1 ? 'auto' : 'hidden'
102
- }, [hintLine])
101
+ const oy = h > tw.max + 1 ? 'auto' : 'hidden'
102
+ if (t.style.overflowY !== oy) t.style.overflowY = oy
103
+ }, [hintLine, rows])
103
104
  useLayoutEffect(size, [value, size])
104
105
  useLayoutEffect(() => {
105
106
  const t = ref.current
106
107
  if (t == null || typeof ResizeObserver === 'undefined') return
107
- let w = t.clientWidth
108
+ let w = -1
109
+ let hgt = -1
108
110
  let raf = 0
109
- // the new height lands on the next frame: sized inside the callback, its scrollbar moves its width and the
110
- // observer fires again in the same frame (the loop notice Bun's dev overlay paints over the page)
111
- const ro = new ResizeObserver(() => {
112
- if (t.clientWidth === w) return
113
- w = t.clientWidth
111
+ // a new width wraps the words again, a new height may be a new cap (a vh max-height, a sheet): the twin takes
112
+ // the box's measures again and sizes it on the next frame; sized inside the callback, its scrollbar moves its
113
+ // width and the observer fires again in the same frame (the loop notice Bun's dev overlay paints over the page)
114
+ const ro = new ResizeObserver(([e]) => {
115
+ const r = e!.contentRect
116
+ if (r.width === w && r.height === hgt) return
117
+ const first = w === -1
118
+ w = r.width
119
+ hgt = r.height
120
+ if (first) return
114
121
  cancelAnimationFrame(raf)
115
- raf = requestAnimationFrame(size)
122
+ raf = requestAnimationFrame(() => {
123
+ twin.current?.fit(t, rows)
124
+ size()
125
+ })
116
126
  })
117
127
  ro.observe(t)
118
128
  return () => {
119
129
  cancelAnimationFrame(raf)
120
130
  ro.disconnect()
121
131
  }
122
- }, [size])
132
+ }, [size, rows])
133
+ useLayoutEffect(() => () => {
134
+ twin.current?.el.remove()
135
+ twin.current = null
136
+ }, [])
123
137
  return (
124
138
  <>
125
139
  <textarea
@@ -166,6 +180,47 @@ export const AutoText = observer(function AutoText({ value, onText, rows = 2, el
166
180
  )
167
181
  })
168
182
 
183
+ /** what wraps the words the same way in the twin as in the box */
184
+ const TWIN_COPIES = ['font-family', 'font-size', 'font-weight', 'font-style', 'font-stretch', 'font-variant', 'font-feature-settings', 'font-variation-settings', 'line-height', 'letter-spacing', 'word-spacing', 'text-transform', 'text-indent', 'tab-size', 'white-space', 'word-break', 'overflow-wrap', 'direction', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left']
185
+
186
+ /** the box's words measured in a hidden twin, never in the box: the box at height 'auto' to read its scrollHeight
187
+ * shrank, so the composer shrank and the thread's column grew, then both came back, two layouts of the whole page a
188
+ * key (WebKit lays out each in full, a thread of picture galleries took 50 ms a key). The twin is out of the flow at a
189
+ * fixed size, its own layout root: a key lays out the twin alone and reads one height. Its measures (width, padding,
190
+ * font, the cap, `rows`) are taken again when the box's size or `rows` changes, never per key */
191
+ class Twin {
192
+ readonly el: HTMLTextAreaElement
193
+ rows = -1
194
+ /** the box's border and scrollbar height; its words' height at `rows` lines; its max-height in px */
195
+ edge = 0
196
+ min = 0
197
+ max = Infinity
198
+ constructor(t: HTMLTextAreaElement) {
199
+ const d = t.ownerDocument
200
+ this.el = d.createElement('textarea')
201
+ this.el.setAttribute('aria-hidden', 'true')
202
+ this.el.tabIndex = -1
203
+ this.el.style.cssText = 'position:fixed;left:-10000px;top:0;height:0;min-height:0;max-height:none;border:0;margin:0;overflow:hidden;visibility:hidden;pointer-events:none;resize:none;box-sizing:border-box;contain:layout paint style'
204
+ d.body.append(this.el)
205
+ }
206
+ fit(t: HTMLTextAreaElement, rows: number): void {
207
+ const cs = t.ownerDocument.defaultView?.getComputedStyle?.(t)
208
+ if (cs) for (const p of TWIN_COPIES) this.el.style.setProperty(p, cs.getPropertyValue(p))
209
+ this.el.style.width = `${t.clientWidth}px`
210
+ this.edge = t.offsetHeight - t.clientHeight
211
+ const max = parseFloat(cs?.maxHeight ?? '')
212
+ this.max = Number.isFinite(max) ? max : Infinity
213
+ this.rows = rows
214
+ this.el.value = '\n'.repeat(Math.max(0, rows - 1))
215
+ this.min = this.el.scrollHeight
216
+ }
217
+ /** the words' height, padding in, never under `rows` lines */
218
+ measure(text: string): number {
219
+ this.el.value = text
220
+ return Math.max(this.min, this.el.scrollHeight)
221
+ }
222
+ }
223
+
169
224
  /** the emojis that match, hugging the caret: the list's top on the bottom of the caret's line, from the caret's x (its
170
225
  * bottom on the line's top when the window has no room under it), each row its character and its name in plain words,
171
226
  * the letters he typed marked; the focus stays in the box */
@@ -22,21 +22,13 @@ import { tip } from './tips.ts'
22
22
  * something it did not. The CHIP is the short one, its help is the sentence */
23
23
  const SOURCE_CHIP: Record<CheckFacts['whenSource'], string> = {
24
24
  off: 'repo.config.ts',
25
- when: 'when (retired)',
26
- ruleExempt: 'ruleExempt (retired)',
27
- 'hooks.disable': 'hooks.disable (retired)',
28
25
  'check-file': 'the check file',
29
- defaults: 'defaults (retired)',
30
26
  default: 'derived',
31
27
  }
32
28
 
33
29
  const SOURCE_WORD: Record<CheckFacts['whenSource'], string> = {
34
30
  off: 'turned off in the `off` block of `repo.config.ts`, which this switch writes',
35
- when: 'turned off by the retired `when` key, which `shipkit ci` ports to `off` (SK029)',
36
- ruleExempt: 'turned off by the retired `ruleExempt` key, which `shipkit ci` ports to `off` (SK029)',
37
31
  'check-file': 'declared by the check file itself: every context it runs in, no default',
38
- 'hooks.disable': 'turned off by the retired `hooks.disable` key, which `shipkit ci` ports to `off` (SK029)',
39
- defaults: 'turned off by the retired `defaults: { <slot>: false }`, which `shipkit ci` ports to `off` (SK029)',
40
32
  default: 'a row with no file of its own: the code that derives it writes every context',
41
33
  }
42
34