rvlib-shipkit 2.29.0 → 2.30.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 (512) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/package.json +2 -1
  3. package/src/advisors/app-graph.ts +1 -1
  4. package/src/advisors/expose.ts +5 -1
  5. package/src/advisors/r2.ts +7 -9
  6. package/src/advisors/routes.ts +29 -2
  7. package/src/advisors/scan.ts +11 -0
  8. package/src/agent-time/accounts-usage.ts +8 -0
  9. package/src/agent-time/claude-sessions.ts +32 -0
  10. package/src/agent-time/hooks.ts +1 -1
  11. package/src/agent-time/live.ts +5 -2
  12. package/src/agent-time/registry.ts +186 -89
  13. package/src/agent-time/store.ts +6 -4
  14. package/src/asks/ask-doc.ts +2 -2
  15. package/src/asks/ask-store.ts +22 -7
  16. package/src/check.ts +9 -1
  17. package/src/checks/SK001-package-json-shape.check.ts +1 -0
  18. package/src/checks/SK003-claude-md-shape.check.ts +1 -0
  19. package/src/checks/SK004-gitignore-policy.check.ts +12 -6
  20. package/src/checks/SK008-reviewer-agent.check.ts +4 -7
  21. package/src/checks/SK013-one-way-in-policy.check.ts +1 -0
  22. package/src/checks/SK017-vscode-hub-task.check.ts +1 -0
  23. package/src/checks/SK024-identity-colors.check.ts +1 -1
  24. package/src/checks/SK027-agent-wiki-links.check.ts +2 -1
  25. package/src/checks/SK033-global-contribution.check.ts +1 -0
  26. package/src/checks/SK034-commit-gates-armed.check.ts +1 -0
  27. package/src/checks/SK039-vscode-watch-generated.check.ts +1 -0
  28. package/src/checks/SK049-thread-answers-hook.check.ts +9 -5
  29. package/src/checks/SK050-retired-commands.check.ts +1 -0
  30. package/src/checks/SK051-no-formatter.check.ts +1 -0
  31. package/src/cli/channel-run.ts +17 -0
  32. package/src/cli/cmd_Advisors.ts +28 -7
  33. package/src/cli/cmd_Asks.ts +2 -2
  34. package/src/cli/cmd_Backup.ts +5 -1
  35. package/src/cli/cmd_CacheAudit.ts +1 -1
  36. package/src/cli/cmd_Channel.ts +43 -0
  37. package/src/cli/cmd_GlobalProcesses.ts +1 -0
  38. package/src/cli/cmd_Home.ts +12 -5
  39. package/src/cli/cmd_Hooks.ts +1 -1
  40. package/src/cli/cmd_Hq.ts +43 -0
  41. package/src/cli/cmd_Lanes.ts +15 -3
  42. package/src/cli/cmd_Media.ts +8 -3
  43. package/src/cli/cmd_Orchestrator.ts +253 -84
  44. package/src/cli/cmd_OrchestratorRole.ts +163 -0
  45. package/src/cli/cmd_Review.ts +142 -165
  46. package/src/cli/cmd_Secret.ts +44 -14
  47. package/src/cli/cmd_Shot.ts +2 -4
  48. package/src/cli/cmd_Sound.ts +1 -0
  49. package/src/cli/cmd_Urls.ts +3 -3
  50. package/src/cli/inbox-hook-run.ts +109 -0
  51. package/src/cli/registry.ts +6 -2
  52. package/src/cli/review-here.ts +136 -0
  53. package/src/cli.ts +45 -14
  54. package/src/collections/actions.ts +5 -4
  55. package/src/collections/checks.ts +5 -0
  56. package/src/collections/collection-types.ts +4 -3
  57. package/src/collections/pings.ts +4 -1
  58. package/src/collections/providers.ts +6 -4
  59. package/src/collections/tests.ts +7 -4
  60. package/src/core/app-icon-frame.ts +62 -0
  61. package/src/core/app-icon.ts +179 -17
  62. package/src/core/archived.ts +10 -7
  63. package/src/core/check-ctx.ts +38 -4
  64. package/src/core/check-pass.ts +7 -0
  65. package/src/core/foreign.ts +87 -0
  66. package/src/core/gui-color.ts +75 -0
  67. package/src/core/hub-theme.ts +1 -3
  68. package/src/core/layout.ts +3 -0
  69. package/src/core/machine-commit.ts +9 -1
  70. package/src/core/one-lib.ts +2 -1
  71. package/src/core/one-way-in-policy.ts +17 -12
  72. package/src/core/owner-word-policy.ts +123 -0
  73. package/src/core/panel-shades.ts +140 -0
  74. package/src/core/repo-gui-color.ts +16 -0
  75. package/src/core/role-policy.ts +17 -0
  76. package/src/core/scope.ts +6 -3
  77. package/src/core/tmux-policy.ts +264 -0
  78. package/src/core/unit-icon.ts +43 -0
  79. package/src/fleet/push-fleet.ts +2 -0
  80. package/src/fleet/scan-fleet.ts +3 -0
  81. package/src/gate/cache-audit.ts +7 -1
  82. package/src/gate/gate-checks.ts +14 -9
  83. package/src/gate/run-fix.ts +30 -5
  84. package/src/gate/run-fixers.ts +8 -3
  85. package/src/home/activity-shape.ts +2 -0
  86. package/src/home/activity.ts +2 -1
  87. package/src/home/daemon-guard.ts +20 -2
  88. package/src/home/daemon-jobs.ts +26 -18
  89. package/src/home/gui-app/ShipkitGui.swift +2012 -144
  90. package/src/home/gui-app/icon.svg +8 -0
  91. package/src/home/gui-app.ts +94 -30
  92. package/src/home/home-routes.ts +53 -9
  93. package/src/home/home-start.ts +27 -3
  94. package/src/home/inbox-shape.ts +7 -3
  95. package/src/home/log-follow.ts +117 -0
  96. package/src/home/machine-fold.ts +1 -1
  97. package/src/home/open-app.ts +9 -3
  98. package/src/home/page-build.ts +5 -1
  99. package/src/home/page-held.ts +1 -1
  100. package/src/home/pm-config.ts +0 -8
  101. package/src/home/pm.ts +62 -5
  102. package/src/home/process-apps.ts +70 -23
  103. package/src/home/process-rows.ts +16 -1
  104. package/src/home/push-sources.ts +18 -13
  105. package/src/home/resources.ts +16 -7
  106. package/src/home/run-daemon.ts +4 -1
  107. package/src/home/run-pm.ts +1 -1
  108. package/src/home/serve-daemon.ts +13 -4
  109. package/src/home/serve-web.ts +141 -17
  110. package/src/home/space-page.ts +3 -3
  111. package/src/home/space-route.ts +2 -2
  112. package/src/home/supervise.ts +2 -1
  113. package/src/home/vault-page.ts +2 -1
  114. package/src/home/web-places.ts +239 -0
  115. package/src/home/widgets.ts +16 -2
  116. package/src/hooks/commit-message.ts +11 -9
  117. package/src/hooks/one-way-in-guard.ts +145 -68
  118. package/src/hooks/run-hooks.ts +15 -5
  119. package/src/hooks/shared-file.ts +273 -83
  120. package/src/hooks/shell-writes.ts +620 -0
  121. package/src/hooks/write-log.ts +149 -0
  122. package/src/hq/door-route.ts +63 -7
  123. package/src/hq/door.ts +45 -12
  124. package/src/hq/history-send.ts +3 -1
  125. package/src/hq/hq-db.ts +10 -3
  126. package/src/hq/hq-local.ts +24 -5
  127. package/src/hq/hq-routes.ts +3 -1
  128. package/src/hq/hq-store.ts +9 -3
  129. package/src/hq/kinds/index.ts +2 -1
  130. package/src/hq/kinds/kind.ts +9 -4
  131. package/src/hq/kinds/presence-rule.ts +56 -0
  132. package/src/hq/kinds/presence.ts +210 -0
  133. package/src/hq/kinds/report.ts +8 -5
  134. package/src/hq/lead-order.ts +68 -0
  135. package/src/hq/outbox.ts +7 -0
  136. package/src/hq/replica.ts +5 -7
  137. package/src/hq/report-facts.ts +14 -7
  138. package/src/hq/report.ts +47 -2
  139. package/src/hq/switch.ts +1 -0
  140. package/src/hq/terminal-hop.ts +64 -0
  141. package/src/hq/thread-sync.ts +13 -6
  142. package/src/http/door-forward.ts +10 -12
  143. package/src/http/door-names.ts +9 -0
  144. package/src/http/hop-caller.ts +23 -0
  145. package/src/http/hop-names.ts +14 -0
  146. package/src/http/loopback-serve.ts +28 -6
  147. package/src/http/owner-word.ts +128 -0
  148. package/src/http/same-origin.ts +12 -0
  149. package/src/{serve → http}/secret-gate.ts +3 -3
  150. package/src/ledger/run-log.ts +25 -1
  151. package/src/media-store/backup/sources.ts +53 -6
  152. package/src/media-store/backup/thread-copy.ts +9 -5
  153. package/src/media-store/copy/config.ts +10 -9
  154. package/src/media-store/daemon.ts +5 -2
  155. package/src/media-store/put.ts +3 -0
  156. package/src/media-store/space.ts +14 -16
  157. package/src/media-store/upload.ts +4 -0
  158. package/src/messages/collection.ts +2 -2
  159. package/src/messages/model.ts +6 -1
  160. package/src/messages/routes.ts +3 -0
  161. package/src/orchestrator/brief.md +8 -6
  162. package/src/orchestrator/channel-declare.ts +58 -0
  163. package/src/orchestrator/channel.ts +226 -0
  164. package/src/orchestrator/guards.ts +12 -3
  165. package/src/orchestrator/host.ts +35 -0
  166. package/src/orchestrator/lead-shape.ts +86 -0
  167. package/src/orchestrator/now.ts +88 -0
  168. package/src/orchestrator/phone.ts +4 -1
  169. package/src/orchestrator/places-file.ts +38 -0
  170. package/src/orchestrator/places-look.ts +180 -0
  171. package/src/orchestrator/places-shape.ts +151 -0
  172. package/src/orchestrator/places.ts +50 -0
  173. package/src/orchestrator/presence-shape.ts +13 -2
  174. package/src/orchestrator/presence.ts +26 -15
  175. package/src/orchestrator/push.ts +5 -10
  176. package/src/orchestrator/role-shape.ts +270 -0
  177. package/src/orchestrator/role.ts +242 -0
  178. package/src/orchestrator/routes.ts +136 -31
  179. package/src/orchestrator/sessions-shape.ts +78 -0
  180. package/src/orchestrator/sessions.ts +86 -0
  181. package/src/orchestrator/share.ts +71 -0
  182. package/src/orchestrator/start-notice.ts +61 -0
  183. package/src/orchestrator/start.ts +137 -0
  184. package/src/orchestrator/started.ts +55 -0
  185. package/src/orchestrator/stuck.ts +196 -0
  186. package/src/orchestrator/unheard.ts +18 -7
  187. package/src/pages/frame-client.ts +44 -6
  188. package/src/problems/failure-words.ts +80 -0
  189. package/src/release/run-bump.ts +26 -5
  190. package/src/release/run-release.ts +34 -14
  191. package/src/repo-config.ts +37 -9
  192. package/src/review/aside-at.ts +19 -0
  193. package/src/review/band.ts +3 -3
  194. package/src/review/doc-save.ts +1 -1
  195. package/src/review/inbox-hook.ts +12 -4
  196. package/src/review/inbox-read.ts +20 -7
  197. package/src/review/instruction-guards.ts +137 -0
  198. package/src/review/instructions.ts +14 -2
  199. package/src/review/item-db.ts +52 -2
  200. package/src/review/mentions.ts +6 -4
  201. package/src/review/model.ts +3 -2
  202. package/src/review/parties.ts +88 -19
  203. package/src/review/push.ts +32 -15
  204. package/src/review/routes.ts +12 -4
  205. package/src/review/secret-route.ts +5 -5
  206. package/src/review/snooze.ts +1 -16
  207. package/src/review/store-parties.ts +4 -2
  208. package/src/review/take-back.ts +2 -1
  209. package/src/review/threads.ts +13 -2
  210. package/src/review/unit.ts +3 -2
  211. package/src/review/view-layout.ts +8 -1
  212. package/src/review/watchers.ts +25 -4
  213. package/src/secrets/key-pair.ts +14 -0
  214. package/src/secrets/lapse.ts +3 -3
  215. package/src/secrets/manager.ts +5 -1
  216. package/src/secrets/name-template.ts +83 -0
  217. package/src/secrets/name.ts +3 -0
  218. package/src/secrets/read.ts +10 -6
  219. package/src/secrets/secrets-view.ts +299 -0
  220. package/src/secrets/who-reads.ts +2 -1
  221. package/src/serve/frame-part.ts +49 -0
  222. package/src/serve/hub-app/accounts-line.tsx +33 -45
  223. package/src/serve/hub-app/activity-st.ts +6 -5
  224. package/src/serve/hub-app/activity-view.tsx +10 -9
  225. package/src/serve/hub-app/advice-box.tsx +6 -5
  226. package/src/serve/hub-app/advisor-app.tsx +2 -0
  227. package/src/serve/hub-app/advisor-face.tsx +3 -2
  228. package/src/serve/hub-app/advisor.html +1 -0
  229. package/src/serve/hub-app/advisors-view.tsx +52 -10
  230. package/src/serve/hub-app/advisors.css +4 -0
  231. package/src/serve/hub-app/app-bridge.ts +31 -5
  232. package/src/serve/hub-app/asked-page.ts +24 -0
  233. package/src/serve/hub-app/asks-page.tsx +10 -6
  234. package/src/serve/hub-app/auto-text.tsx +7 -5
  235. package/src/serve/hub-app/card-head.tsx +3 -2
  236. package/src/serve/hub-app/check-view.tsx +10 -9
  237. package/src/serve/hub-app/checks-svc.ts +96 -32
  238. package/src/serve/hub-app/clock-svc.ts +24 -8
  239. package/src/serve/hub-app/code-copy.ts +1 -1
  240. package/src/serve/hub-app/col-card.tsx +2 -1
  241. package/src/serve/hub-app/col-list-page.tsx +12 -6
  242. package/src/serve/hub-app/col-list-st.ts +12 -2
  243. package/src/serve/hub-app/col-tables-view.tsx +8 -44
  244. package/src/serve/hub-app/col-tables.ts +0 -14
  245. package/src/serve/hub-app/cols-svc.ts +6 -12
  246. package/src/serve/hub-app/columns.ts +94 -0
  247. package/src/serve/hub-app/comfy-view.tsx +8 -7
  248. package/src/serve/hub-app/commands/commands-page.tsx +4 -3
  249. package/src/serve/hub-app/commands/commands-st.ts +2 -2
  250. package/src/serve/hub-app/controls.css +69 -23
  251. package/src/serve/hub-app/cycle-button.tsx +2 -1
  252. package/src/serve/hub-app/database-st.ts +1 -1
  253. package/src/serve/hub-app/database-view.tsx +4 -2
  254. package/src/serve/hub-app/deaf.tsx +27 -0
  255. package/src/serve/hub-app/dock-st.ts +21 -16
  256. package/src/serve/hub-app/dock-view.tsx +19 -12
  257. package/src/serve/hub-app/empty-section.tsx +30 -0
  258. package/src/serve/hub-app/entry-bar.css +1 -1
  259. package/src/serve/hub-app/entry-bar.tsx +11 -6
  260. package/src/serve/hub-app/entry-list.css +32 -0
  261. package/src/serve/hub-app/entry-list.tsx +123 -0
  262. package/src/serve/hub-app/entry-pick.ts +1 -1
  263. package/src/serve/hub-app/entry-sections.ts +140 -0
  264. package/src/serve/hub-app/event-stream-reader.ts +56 -0
  265. package/src/serve/hub-app/floating.tsx +68 -14
  266. package/src/serve/hub-app/geometry-view.tsx +3 -2
  267. package/src/serve/hub-app/git-view.tsx +3 -2
  268. package/src/serve/hub-app/hash-route.ts +14 -2
  269. package/src/serve/hub-app/header-bar.tsx +53 -36
  270. package/src/serve/hub-app/home-st.ts +131 -14
  271. package/src/serve/hub-app/home-strip.css +24 -13
  272. package/src/serve/hub-app/home-strip.tsx +131 -66
  273. package/src/serve/hub-app/home.html +5 -0
  274. package/src/serve/hub-app/hub-app.tsx +94 -102
  275. package/src/serve/hub-app/hub.css +61 -94
  276. package/src/serve/hub-app/icons.tsx +16 -0
  277. package/src/serve/hub-app/identities-st.ts +19 -54
  278. package/src/serve/hub-app/identities-view.tsx +25 -24
  279. package/src/serve/hub-app/identity-address.ts +2 -2
  280. package/src/serve/hub-app/in-sight.ts +10 -0
  281. package/src/serve/hub-app/inbox-st.ts +20 -2
  282. package/src/serve/hub-app/inbox-view.tsx +16 -9
  283. package/src/serve/hub-app/inbox.css +1 -0
  284. package/src/serve/hub-app/index.html +5 -0
  285. package/src/serve/hub-app/insights-view.tsx +6 -5
  286. package/src/serve/hub-app/instructions.css +4 -1
  287. package/src/serve/hub-app/kept-cols.tsx +83 -20
  288. package/src/serve/hub-app/kept-width.tsx +76 -0
  289. package/src/serve/hub-app/keys.ts +116 -38
  290. package/src/serve/hub-app/layout-st.ts +109 -99
  291. package/src/serve/hub-app/lightbox-zoom.css +36 -0
  292. package/src/serve/hub-app/list-filter.tsx +15 -6
  293. package/src/serve/hub-app/list-head.tsx +29 -0
  294. package/src/serve/hub-app/list-row.ts +8 -0
  295. package/src/serve/hub-app/list-walk.ts +26 -105
  296. package/src/serve/hub-app/live-socket.ts +274 -0
  297. package/src/serve/hub-app/live-sources.ts +189 -0
  298. package/src/serve/hub-app/live-svc.ts +2 -2
  299. package/src/serve/hub-app/machine-st.ts +75 -14
  300. package/src/serve/hub-app/main-panel.css +211 -0
  301. package/src/serve/hub-app/main-panel.tsx +259 -0
  302. package/src/serve/hub-app/md.ts +4 -4
  303. package/src/serve/hub-app/media-svc.ts +5 -5
  304. package/src/serve/hub-app/media-view.tsx +13 -12
  305. package/src/serve/hub-app/messages/messages-page.tsx +8 -7
  306. package/src/serve/hub-app/messages/messages-st.ts +5 -2
  307. package/src/serve/hub-app/new-thread-st.ts +170 -0
  308. package/src/serve/hub-app/new-thread.tsx +133 -107
  309. package/src/serve/hub-app/orchestrator-line.tsx +115 -45
  310. package/src/serve/hub-app/orchestrator-places.tsx +86 -0
  311. package/src/serve/hub-app/orchestrator.css +57 -5
  312. package/src/serve/hub-app/page-keys.ts +107 -68
  313. package/src/serve/hub-app/page-reload.ts +46 -6
  314. package/src/serve/hub-app/pages-frames.tsx +40 -3
  315. package/src/serve/hub-app/pages-svc.ts +3 -1
  316. package/src/serve/hub-app/palette-st.ts +198 -43
  317. package/src/serve/hub-app/palette-view.tsx +32 -8
  318. package/src/serve/hub-app/panel-head-action.tsx +39 -0
  319. package/src/serve/hub-app/panel-head.tsx +70 -0
  320. package/src/serve/hub-app/panel-repo.ts +42 -0
  321. package/src/serve/hub-app/panel-source.ts +195 -0
  322. package/src/serve/hub-app/panel-tint.css +6 -0
  323. package/src/serve/hub-app/panel-tint.ts +23 -0
  324. package/src/serve/hub-app/panel-walk.ts +107 -0
  325. package/src/serve/hub-app/pill-row.tsx +2 -1
  326. package/src/serve/hub-app/place-path.ts +4 -0
  327. package/src/serve/hub-app/places-svc.ts +75 -0
  328. package/src/serve/hub-app/plan-view.tsx +3 -2
  329. package/src/serve/hub-app/polled.ts +11 -1
  330. package/src/serve/hub-app/presence-st.ts +66 -32
  331. package/src/serve/hub-app/processes-view.tsx +2 -2
  332. package/src/serve/hub-app/project-bar.tsx +116 -0
  333. package/src/serve/hub-app/project-list.css +20 -173
  334. package/src/serve/hub-app/project-list.tsx +30 -298
  335. package/src/serve/hub-app/projects-svc.ts +59 -32
  336. package/src/serve/hub-app/push-sign.tsx +2 -1
  337. package/src/serve/hub-app/push-svc.ts +86 -69
  338. package/src/serve/hub-app/quiet-st.ts +5 -3
  339. package/src/serve/hub-app/rail-groups.ts +144 -0
  340. package/src/serve/hub-app/reader-chips.tsx +2 -1
  341. package/src/serve/hub-app/recordings-st.ts +2 -1
  342. package/src/serve/hub-app/recordings-view.tsx +19 -47
  343. package/src/serve/hub-app/recordings.css +0 -2
  344. package/src/serve/hub-app/reflections-page.tsx +10 -6
  345. package/src/serve/hub-app/releases/releases-page.tsx +6 -5
  346. package/src/serve/hub-app/repo-sections.ts +127 -38
  347. package/src/serve/hub-app/repo-st.ts +57 -36
  348. package/src/serve/hub-app/review/advisor-bar.tsx +3 -2
  349. package/src/serve/hub-app/review/ask-proof.tsx +79 -0
  350. package/src/serve/hub-app/review/attach-view.tsx +11 -10
  351. package/src/serve/hub-app/review/box-view.ts +479 -0
  352. package/src/serve/hub-app/review/box-zoom.tsx +70 -0
  353. package/src/serve/hub-app/review/diff-view.tsx +3 -2
  354. package/src/serve/hub-app/review/doc-body.tsx +2 -1
  355. package/src/serve/hub-app/review/dock.tsx +3 -2
  356. package/src/serve/hub-app/review/draft-body.tsx +4 -3
  357. package/src/serve/hub-app/review/faces.tsx +0 -8
  358. package/src/serve/hub-app/review/group-block.tsx +8 -7
  359. package/src/serve/hub-app/review/heard-line.tsx +4 -3
  360. package/src/serve/hub-app/review/instructions-view.tsx +3 -2
  361. package/src/serve/hub-app/review/item-verdict.tsx +40 -40
  362. package/src/serve/hub-app/review/kind-states.tsx +5 -4
  363. package/src/serve/hub-app/review/kit.tsx +24 -4
  364. package/src/serve/hub-app/review/lane-bar.tsx +30 -28
  365. package/src/serve/hub-app/review/lightbox.tsx +6 -4
  366. package/src/serve/hub-app/review/live-bar.tsx +7 -6
  367. package/src/serve/hub-app/review/live-view.tsx +6 -5
  368. package/src/serve/hub-app/review/object-card.tsx +2 -1
  369. package/src/serve/hub-app/review/object-panel.tsx +11 -10
  370. package/src/serve/hub-app/review/pano-view.tsx +3 -2
  371. package/src/serve/hub-app/review/question-views.tsx +6 -5
  372. package/src/serve/hub-app/review/review-cells.tsx +21 -20
  373. package/src/serve/hub-app/review/review-host.ts +3 -0
  374. package/src/serve/hub-app/review/review-kit.ts +7 -5
  375. package/src/serve/hub-app/review/review-list.tsx +98 -52
  376. package/src/serve/hub-app/review/review-page.tsx +3 -3
  377. package/src/serve/hub-app/review/review-st.ts +70 -14
  378. package/src/serve/hub-app/review/review-thread.tsx +234 -138
  379. package/src/serve/hub-app/review/review-views.tsx +166 -191
  380. package/src/serve/hub-app/review/space3d.tsx +17 -9
  381. package/src/serve/hub-app/review/thread-close.tsx +24 -32
  382. package/src/serve/hub-app/review/thread-st.ts +39 -25
  383. package/src/serve/hub-app/review/trailer-body.tsx +5 -4
  384. package/src/serve/hub-app/review/trailer-page.tsx +18 -16
  385. package/src/serve/hub-app/review/trailer-st.ts +3 -2
  386. package/src/serve/hub-app/review/trailer-timeline.tsx +10 -9
  387. package/src/serve/hub-app/review/trailer-voices.tsx +29 -28
  388. package/src/serve/hub-app/review.css +159 -42
  389. package/src/serve/hub-app/row-acts.tsx +126 -0
  390. package/src/serve/hub-app/row-face.tsx +29 -0
  391. package/src/serve/hub-app/running-rows.tsx +142 -0
  392. package/src/serve/hub-app/running-st.ts +110 -0
  393. package/src/serve/hub-app/search-view.tsx +3 -2
  394. package/src/serve/hub-app/secrets-page.tsx +290 -0
  395. package/src/serve/hub-app/secrets-st.ts +181 -0
  396. package/src/serve/hub-app/secrets.css +65 -0
  397. package/src/serve/hub-app/section-head.tsx +3 -2
  398. package/src/serve/hub-app/session-chips.tsx +55 -0
  399. package/src/serve/hub-app/shell.ts +56 -0
  400. package/src/serve/hub-app/site/site-part.tsx +6 -5
  401. package/src/serve/hub-app/site/site-st.ts +0 -6
  402. package/src/serve/hub-app/site.css +0 -1
  403. package/src/serve/hub-app/social/calendar.tsx +7 -6
  404. package/src/serve/hub-app/social/comms-page.tsx +29 -26
  405. package/src/serve/hub-app/social/group-editor.tsx +2 -1
  406. package/src/serve/hub-app/social/kit.tsx +12 -11
  407. package/src/serve/hub-app/social/next-release.tsx +3 -2
  408. package/src/serve/hub-app/social/post-card.tsx +21 -20
  409. package/src/serve/hub-app/social/post-page.tsx +2 -1
  410. package/src/serve/hub-app/social/problems.tsx +3 -2
  411. package/src/serve/hub-app/social/social-page.tsx +29 -27
  412. package/src/serve/hub-app/social/social-st.ts +4 -2
  413. package/src/serve/hub-app/social/stage-popup.tsx +11 -10
  414. package/src/serve/hub-app/social.css +7 -5
  415. package/src/serve/hub-app/source-acts.ts +79 -0
  416. package/src/serve/hub-app/source-page.tsx +17 -0
  417. package/src/serve/hub-app/space-view.tsx +5 -4
  418. package/src/serve/hub-app/stores/stores-page.tsx +21 -19
  419. package/src/serve/hub-app/stores/stores-st.ts +1 -1
  420. package/src/serve/hub-app/stores.css +1 -1
  421. package/src/serve/hub-app/terminal-history-st.ts +112 -0
  422. package/src/serve/hub-app/terminal-keys.ts +79 -0
  423. package/src/serve/hub-app/terminal-lib.ts +110 -0
  424. package/src/serve/hub-app/terminal-links.ts +55 -0
  425. package/src/serve/hub-app/terminal-list-st.ts +304 -0
  426. package/src/serve/hub-app/terminal-log-st.ts +242 -0
  427. package/src/serve/hub-app/terminal-out.ts +135 -0
  428. package/src/serve/hub-app/terminal-pages.tsx +115 -0
  429. package/src/serve/hub-app/terminal-panel.tsx +60 -9
  430. package/src/serve/hub-app/terminal-sources.tsx +335 -0
  431. package/src/serve/hub-app/terminal-st.ts +447 -167
  432. package/src/serve/hub-app/terminal-stream.ts +233 -0
  433. package/src/serve/hub-app/terminal-tab.tsx +64 -0
  434. package/src/serve/hub-app/terminal-widths.ts +30 -0
  435. package/src/serve/hub-app/terminal.css +50 -4
  436. package/src/serve/hub-app/test-view.tsx +5 -3
  437. package/src/serve/hub-app/tests-view.tsx +16 -15
  438. package/src/serve/hub-app/theme-st.ts +5 -0
  439. package/src/serve/hub-app/thread-row.tsx +39 -31
  440. package/src/serve/hub-app/time-ago.tsx +3 -2
  441. package/src/serve/hub-app/time-view.tsx +2 -1
  442. package/src/serve/hub-app/time.css +1 -1
  443. package/src/serve/hub-app/timeline-chart.tsx +5 -4
  444. package/src/serve/hub-app/timeline-view.tsx +10 -9
  445. package/src/serve/hub-app/tips.ts +247 -0
  446. package/src/serve/hub-app/tree-build.ts +40 -8
  447. package/src/serve/hub-app/tree-svc.ts +167 -134
  448. package/src/serve/hub-app/unit-icons.ts +26 -0
  449. package/src/serve/hub-app/url-address.ts +154 -0
  450. package/src/serve/hub-app/url-faces.ts +88 -0
  451. package/src/serve/hub-app/url-forms.tsx +183 -0
  452. package/src/serve/hub-app/urls-svc.ts +167 -5
  453. package/src/serve/hub-app/urls-view.tsx +56 -20
  454. package/src/serve/hub-app/urls.css +26 -0
  455. package/src/serve/hub-app/vault-view.tsx +5 -4
  456. package/src/serve/hub-app/veille/veille-page.tsx +34 -33
  457. package/src/serve/hub-app/veille/veille-st.ts +6 -3
  458. package/src/serve/hub-app/view-layout.css +3 -3
  459. package/src/serve/hub-app/when-view.tsx +5 -4
  460. package/src/serve/hub-app/wikis-view.tsx +6 -5
  461. package/src/serve/hub-app/words.tsx +9 -2
  462. package/src/serve/hub-runtime.ts +3 -2
  463. package/src/serve/orchestrator-host.ts +58 -0
  464. package/src/serve/page-live.ts +147 -0
  465. package/src/serve/project-gutter-route.ts +63 -2
  466. package/src/serve/read-worker.ts +7 -2
  467. package/src/serve/runs-stamp.ts +33 -0
  468. package/src/serve/secrets-read.ts +156 -0
  469. package/src/serve/serve-hub.ts +71 -22
  470. package/src/serve/terminal-claudes.ts +185 -0
  471. package/src/serve/terminal-guard.ts +10 -5
  472. package/src/serve/terminal-host.ts +517 -0
  473. package/src/serve/terminal-record.ts +104 -0
  474. package/src/serve/terminal-route.ts +466 -103
  475. package/src/serve/terminal-shells.ts +3 -0
  476. package/src/serve/terminal-watch.ts +102 -0
  477. package/src/shipkit-files.ts +9 -4
  478. package/src/shot/client.ts +4 -9
  479. package/src/shot/shooter.ts +2 -4
  480. package/src/shot/shot-ask.ts +2 -7
  481. package/src/shot/shot-theme.ts +6 -17
  482. package/src/social/routes.ts +2 -2
  483. package/src/social/writes.ts +3 -0
  484. package/src/suite/test-units.ts +6 -2
  485. package/src/trailer/sound/eleven.ts +1 -0
  486. package/src/urls/added.ts +111 -0
  487. package/src/urls/icons.ts +294 -0
  488. package/src/urls/places.ts +139 -0
  489. package/src/urls/routes.ts +17 -7
  490. package/src/urls/rows.ts +48 -15
  491. package/src/urls/unit.ts +57 -3
  492. package/src/urls/write-routes.ts +207 -0
  493. package/src/vault/vault-destroy.ts +2 -1
  494. package/src/vault/vault-import.ts +4 -11
  495. package/src/vault/vault-restore.ts +3 -2
  496. package/src/veille/chrome.ts +18 -3
  497. package/src/veille/identity.ts +6 -0
  498. package/src/view3d/cam.ts +30 -46
  499. package/src/view3d/lib.ts +20 -2
  500. package/src/view3d/viewer.ts +62 -88
  501. package/src/wiki/agent-paths.ts +2 -1
  502. package/src/orchestrator/deliver.ts +0 -81
  503. package/src/orchestrator/drill.ts +0 -129
  504. package/src/orchestrator/keeper.ts +0 -332
  505. package/src/orchestrator/pm.ts +0 -20
  506. package/src/orchestrator/state.ts +0 -92
  507. package/src/orchestrator/switch.ts +0 -86
  508. package/src/orchestrator/tmux.ts +0 -82
  509. package/src/serve/hub-app/rail-fly.tsx +0 -95
  510. package/src/serve/hub-app/side-lists.ts +0 -72
  511. package/src/serve/hub-app/sidebar.tsx +0 -62
  512. package/src/serve/hub-app/tree-row.tsx +0 -125
@@ -1,16 +1,22 @@
1
- // the one picker of the page (cmd+j, keys.ts), a node of the root: the
2
- // home's places (inbox, home, activity, planned, insights, archived) first, the identities and each of their
3
- // accounts (their view on the home), then the shown repo's own jump
4
- // targets, then every other house repo as a place to go. A query also
5
- // reaches every url of every repo, the pages any repo opens and what waits
6
- // for the owner in any repo (an ask by its number too), each with
7
- // its repo's name: its words are matched one by one over the label, the
8
- // kind and the repo (« ver url »). Another repo's content (its assets,
9
- // its threads) is one more cmd+j away, in that repo.
1
+ // the one picker of the page, a node of the root, in two scopes (keys.ts): ⌘P this project alone, ⌘⇧P and ⌘/ every
2
+ // project. ⇥ swaps the scope and keeps the words typed.
3
+ // This project is the window's in a project's app, else the repo shown: its sections with their keys, its own pages,
4
+ // its rows (checks, asks, tests, wikis, assets), its threads by title, its commands, its urls, its processes and
5
+ // what waits for the owner in it. On a page of the home it is the house: the home's places, the identities and
6
+ // their accounts. A section another module gives the main panel (panel-source.ts: terminals, Claude sessions,
7
+ // processes, urls, commands) is listed row for row as the panel lists it, in place of the picker's own rows of that
8
+ // kind.
9
+ // Every project is the house's pages first, then this project's targets, then every other house repo as a place to
10
+ // go; a query also reaches every url and process of every repo, the pages any repo opens and what waits for the
11
+ // owner in any repo (an ask by its number too), each row with its repo's name and icon.
12
+ // A query's words are matched one by one over the label, the kind and the repo (« ver url »).
13
+ // A row of another repo opens there: in the main app the project below switches, in a project's app that repo's own
14
+ // app comes forward on the page (HomeSt.show, asked-page.ts).
10
15
  import { makeAutoObservable } from 'mobx'
11
16
  import type { HomeSt } from './home-st.ts'
12
17
  import { sectionLabel, type SectionId } from './keys.ts'
13
- import type { Jump } from './repo-st.ts'
18
+ import { sourceKey, sourceOf, type SourceSection } from './panel-source.ts'
19
+ import type { Jump, RepoSt } from './repo-st.ts'
14
20
 
15
21
  /** the pages every repo opens, whatever it holds */
16
22
  const ANY_REPO_PAGES: SectionId[] = ['readme', 'review', 'trailer', 'comms', 'shipkit', 'when', 'runs', 'plan', 'processes', 'urls', 'git']
@@ -20,8 +26,30 @@ const words = (s: string): string[] => s.toLowerCase().split(/[^a-z0-9]+/).filte
20
26
  /** how many rows the picker shows */
21
27
  export const PAL_ROWS = 12
22
28
 
29
+ /** `project`: this project alone; `all`: every project and the pages of the home */
30
+ export type PaletteScope = 'project' | 'all'
31
+ /** the key that opens the picker on each scope (keys.ts pageKey), as its head prints it */
32
+ export const SCOPE_KEY: Record<PaletteScope, string> = { project: '⌘P', all: '⌘⇧P' }
33
+ /** the key that swaps the scope while the picker is open */
34
+ export const SWAP_KEY = '⇥'
35
+
36
+ /** every section a module may give the main panel (panel-source.ts). A section of the panel's project stands in for
37
+ * the picker's own rows of that kind, told by the start of their id; null: a section that is no repo's */
38
+ const SOURCE_KIND: Record<SourceSection, string | null> = { terminals: null, claude: null, processes: 'process:', urls: 'url:' }
39
+ const SOURCE_SECTIONS = Object.keys(SOURCE_KIND) as SourceSection[]
40
+ const ofProject = (sec: SourceSection): boolean => SOURCE_KIND[sec] != null
41
+ const ofNoRepo = (sec: SourceSection): boolean => SOURCE_KIND[sec] == null
42
+
43
+ /** once the frame of the key that opened the picker is drawn: the rows known come first, what is read comes after.
44
+ * Where nothing paints (a test) it runs at once */
45
+ const afterPaint = (f: () => void): void => (typeof requestAnimationFrame === 'function' ? void requestAnimationFrame(() => setTimeout(f, 0)) : f())
46
+
47
+ /** a target as a query reads it: its label in lower case, its words, and everything a word may match */
48
+ type Entry = { j: Jump; l: string; ws: string[]; hay: string }
49
+
23
50
  export class PaletteSt {
24
51
  open = false
52
+ scope: PaletteScope = 'all'
25
53
  query = ''
26
54
  idx = 0
27
55
 
@@ -29,6 +57,23 @@ export class PaletteSt {
29
57
  makeAutoObservable<this, 'st'>(this, { st: false })
30
58
  }
31
59
 
60
+ /** the project the picker's own scope is about: the window's in a project's app, else the repo shown; null on a
61
+ * page of the home, where it is the house */
62
+ get project(): RepoSt | null {
63
+ const st = this.st
64
+ return st.shell != null ? st.shellRepo : st.shown
65
+ }
66
+
67
+ /** this project's name, as the head says it */
68
+ get projectName(): string {
69
+ return this.project?.name ?? 'the house'
70
+ }
71
+
72
+ /** a hub of its own holds one repo: one scope, no other to reach */
73
+ get scoped(): boolean {
74
+ return this.st.machine != null
75
+ }
76
+
32
77
  /** the home's places, first in the list: a hub of its own has none */
33
78
  get places(): Jump[] {
34
79
  const st = this.st
@@ -36,6 +81,7 @@ export class PaletteSt {
36
81
  return [
37
82
  { id: 'place:inbox', label: 'inbox', section: 'place', face: { place: 'inbox' }, run: () => st.navigate('/inbox') },
38
83
  { id: 'place:home', label: 'home', section: 'place', face: { place: 'home' }, run: () => st.navigate('/') },
84
+ { id: 'place:running', label: 'running', section: 'place', face: { place: 'running' }, run: () => st.navigate('/running') },
39
85
  { id: 'place:machines', label: 'machines', section: 'place', face: { place: 'machines' }, run: () => st.navigate('/machines') },
40
86
  { id: 'place:database', label: 'database', section: 'place', face: { place: 'database' }, run: () => st.navigate('/database') },
41
87
  { id: 'place:vault', label: 'vault', section: 'place', face: { place: 'vault' }, run: () => st.navigate('/vault') },
@@ -62,31 +108,38 @@ export class PaletteSt {
62
108
  ])
63
109
  }
64
110
 
65
- /** every house repo but the one on screen, as a place to go: on a
66
- * global page that is every repo */
111
+ /** every house repo but this project, as a place to go: on a page of the home that is every repo */
67
112
  get others(): Jump[] {
68
113
  const st = this.st
69
114
  if (st.machine == null) return []
70
- const on = st.shown?.key
115
+ const on = this.project?.key
71
116
  return st.projects.list.filter((p) => p.name !== on).map((p) => ({ id: `repo:${p.name}`, label: p.name, section: 'repo', face: { repo: p.name }, run: () => st.select(p.name) }))
72
117
  }
73
118
 
74
- /** every url of every house repo, the shown one too: framed on its repo's urls page. They come once the home answers */
119
+ /** every url of every house repo, this project's too: framed on its repo's urls page. They come once the home answers */
75
120
  get urls(): Jump[] {
76
121
  const st = this.st
77
122
  if (st.machine == null) return []
78
123
  return st.urls.repos.flatMap((r) => r.urls.map((u) => ({ id: `url:${r.repo}/${u.id}`, label: u.label, section: `url ${u.env}`, repo: r.repo, face: { repo: r.repo }, run: () => st.openUrl(r.repo, u.id) })))
79
124
  }
80
125
 
81
- /** the pages of every repo but the one on screen, whose own are its targets */
126
+ /** every global process a house repo declares: shown on that repo's processes page */
127
+ get processes(): Jump[] {
128
+ const st = this.st
129
+ const groups = st.machine?.processGroups
130
+ if (groups == null) return []
131
+ return groups.flatMap((g) => (g.core === true ? [] : g.rows.map((r) => ({ id: `process:${r.repo}/${r.id}`, label: r.label, section: 'process', repo: r.repo, face: { repo: r.repo }, run: () => st.openProcess(r.repo, r.id) }))))
132
+ }
133
+
134
+ /** the pages of every repo but this project, whose own are its targets */
82
135
  get pages(): Jump[] {
83
136
  const st = this.st
84
137
  if (st.machine == null) return []
85
- const on = st.shown?.key
138
+ const on = this.project?.key
86
139
  return st.projects.list.filter((p) => p.name !== on).flatMap((p) => ANY_REPO_PAGES.map((id) => ({ id: `page:${p.name}/${id}`, label: sectionLabel(id), section: 'page', repo: p.name, face: { repo: p.name }, run: () => st.openPage(p.name, id) })))
87
140
  }
88
141
 
89
- /** every thread that waits for the owner in every repo, the shown one too, under its title (an ask with no thread
142
+ /** every thread that waits for the owner in every repo, this project's too, under its title (an ask with no thread
90
143
  * yet under its number too) and what it waits on, opened on the inbox. They come once the inbox answers */
91
144
  get waiting(): Jump[] {
92
145
  const st = this.st
@@ -97,52 +150,154 @@ export class PaletteSt {
97
150
  })
98
151
  }
99
152
 
153
+ /** this project's own targets (RepoSt.jumps); in a project's app they bring the repo back on screen from a page
154
+ * of the home */
155
+ get own(): Jump[] {
156
+ const st = this.st
157
+ const r = this.project
158
+ if (r == null) return []
159
+ if (st.shown === r) return r.jumps
160
+ return r.jumps.map((j) => ({ ...j, run: () => { j.run(); st.bring(r) } }))
161
+ }
162
+
163
+ /** the rows of the sections a module gives the main panel, as the panel lists them: a row opens as its click does */
164
+ private sourceRows(pick: (sec: SourceSection) => boolean): Jump[] {
165
+ const st = this.st
166
+ return SOURCE_SECTIONS.filter(pick).flatMap((sec) => {
167
+ const src = sourceOf(st, sec)
168
+ return src == null ? [] : src.rows.map((row): Jump => ({ id: sourceKey(sec, row), label: row.label, section: src.name, ...(row.key == null ? {} : { key: row.key }), run: () => src.open(row) }))
169
+ })
170
+ }
171
+
172
+ /** a row of the picker's own that a panel section lists already: this project's of a kind a module provides */
173
+ private provided(j: Jump): boolean {
174
+ const r = this.project
175
+ if (r == null || (j.repo != null && j.repo !== r.key)) return false
176
+ return SOURCE_SECTIONS.some((sec) => SOURCE_KIND[sec] != null && j.id.startsWith(SOURCE_KIND[sec]) && sourceOf(this.st, sec) != null)
177
+ }
178
+
179
+ /** everything of this project and nothing of another: its own targets, then its urls, its processes and what waits
180
+ * for the owner in it; the house's are the home's places, the identities and their accounts. Then the panel's
181
+ * provided sections */
182
+ get mine(): Jump[] {
183
+ const r = this.project
184
+ // the house: the panel's project sections are the repo's shown last, never the house's
185
+ if (r == null) return [...this.places, ...this.identities, ...this.sourceRows(ofNoRepo)]
186
+ const here = (j: Jump): boolean => j.repo === r.key
187
+ return [...[...this.own, ...this.urls.filter(here), ...this.processes.filter(here), ...this.waiting.filter(here)].filter((j) => !this.provided(j)), ...this.sourceRows(() => true)]
188
+ }
189
+
190
+ /** this project's own targets among every project's, a provided section in place of the rows it stands in for:
191
+ * each names its repo and wears its icon, as every other row of a repo does. A hub of its own has one repo and
192
+ * names none. Then the provided sections that are no repo's (terminals, Claude sessions), under their own name */
193
+ private get ownNamed(): Jump[] {
194
+ const r = this.project
195
+ const own = r == null ? [] : [...this.own.filter((j) => !this.provided(j)), ...this.sourceRows(ofProject)]
196
+ const named = r == null || this.st.machine == null ? own : own.map((j) => ({ ...j, repo: r.key, face: { repo: r.key } }))
197
+ return [...named, ...this.sourceRows(ofNoRepo)]
198
+ }
199
+
200
+ /** every project and the pages of the home */
100
201
  get jumps(): Jump[] {
101
- return [...this.places, ...this.identities, ...(this.st.shown?.jumps ?? []), ...this.others, ...this.urls, ...this.waiting, ...this.pages]
202
+ const rest = [...this.urls, ...this.processes].filter((j) => !this.provided(j))
203
+ return [...this.places, ...this.identities, ...this.ownNamed, ...this.others, ...rest, ...this.waiting, ...this.pages]
102
204
  }
103
205
 
104
- /** every word of the query is in the label, the kind or the repo. Ranked on the first word: the label starts
105
- * with it, a word of the label does, the label holds it, then the rest. With no query, home,
106
- * activity and planned, then the shown repo's first targets, then every other repo,
206
+ /** the scope's targets as a query reads them, built once while the picker is open and nothing moved */
207
+ get index(): Entry[] {
208
+ return (this.scope === 'project' ? this.mine : this.jumps).map((j) => {
209
+ const l = j.label.toLowerCase()
210
+ return { j, l, ws: words(l), hay: `${l} ${j.section} ${j.repo ?? ''}`.toLowerCase() }
211
+ })
212
+ }
213
+
214
+ /** with no query, this project: its sections and its own pages first, as its panel lists them, then its other
215
+ * targets; the house: its places, then the identities */
216
+ private get firstMine(): Jump[] {
217
+ const all = this.mine
218
+ const entries = all.filter((j) => j.section === 'section' || j.section === 'page')
219
+ return [...entries, ...all.filter((j) => !entries.includes(j))].slice(0, Math.max(PAL_ROWS * 2, entries.length))
220
+ }
221
+
222
+ /** with no query, every project: the places, the identities, this project's first targets, then every other repo,
107
223
  * so a jump elsewhere is always in reach */
224
+ private get firstAll(): Jump[] {
225
+ const own = this.ownNamed
226
+ const places = this.places
227
+ const ids = this.identities.filter((j) => j.section === 'identity')
228
+ const others = this.others
229
+ return [...places, ...ids, ...own.slice(0, Math.max(4, PAL_ROWS - places.length - ids.length - others.length)), ...others]
230
+ }
231
+
232
+ /** every word of the query is in the label, the kind or the repo. Ranked on the first word: the label starts
233
+ * with it, a word of the label does, the label holds it, then the rest. The last row under any query searches the
234
+ * words in the threads: this project's, or every repo's */
108
235
  get results(): Jump[] {
109
236
  const q = this.query.trim().toLowerCase()
110
- if (q === '') {
111
- const own = this.st.shown?.jumps ?? []
112
- const places = this.places
113
- const ids = this.identities.filter((j) => j.section === 'identity')
114
- const others = this.others
115
- return [...places, ...ids, ...own.slice(0, Math.max(4, PAL_ROWS - places.length - ids.length - others.length)), ...others]
116
- }
237
+ if (q === '') return this.scope === 'project' ? this.firstMine : this.firstAll
117
238
  const asked = q.split(/\s+/)
118
239
  const first = asked[0]!
119
240
  const ranks: Jump[][] = [[], [], [], []]
120
- for (const j of this.jumps) {
121
- const l = j.label.toLowerCase()
122
- const hay = `${l} ${j.section} ${j.repo ?? ''}`.toLowerCase()
123
- if (!asked.every((w) => hay.includes(w))) continue
124
- ranks[l.startsWith(first) ? 0 : words(l).some((w) => w.startsWith(first)) ? 1 : l.includes(first) ? 2 : 3]!.push(j)
241
+ for (const e of this.index) {
242
+ if (!asked.every((w) => e.hay.includes(w))) continue
243
+ ranks[e.l.startsWith(first) ? 0 : e.ws.some((w) => w.startsWith(first)) ? 1 : e.l.includes(first) ? 2 : 3]!.push(e.j)
125
244
  }
126
- // the words in every thread of every repo, the last row under any query: the inbox's search (search-st.ts)
245
+ return [...ranks.flat().slice(0, PAL_ROWS * 2), ...this.search(this.query.trim())]
246
+ }
247
+
248
+ /** the words in the threads, the last row under any query: this project's review page on them, or the inbox's
249
+ * search over every repo (search-st.ts) */
250
+ private search(typed: string): Jump[] {
251
+ const st = this.st
252
+ const r = this.project
253
+ if (this.scope === 'project' && r != null) {
254
+ return [{ id: 'search:threads', label: `« ${typed} » in the threads of ${r.name}`, section: 'search', run: () => { r.showReview(null, new URLSearchParams({ q: typed }).toString()); st.bring(r) } }]
255
+ }
256
+ return st.machine == null ? [] : [{ id: 'search:threads', label: `« ${typed} » in every thread`, section: 'search', face: { place: 'inbox' }, run: () => st.inbox.find.go(typed) }]
257
+ }
258
+
259
+ /** what the scope lists is read once: the urls and what waits, every identity's accounts; this project's threads
260
+ * and commands where its pages did not read them yet */
261
+ private warm(): void {
262
+ afterPaint(() => this.read())
263
+ }
264
+
265
+ private read(): void {
127
266
  const st = this.st
128
- const typed = this.query.trim()
129
- const everywhere: Jump[] = st.machine == null ? [] : [{ id: 'search:threads', label: `« ${typed} » in every thread`, section: 'search', face: { place: 'inbox' }, run: () => st.inbox.find.go(typed) }]
130
- return [...ranks.flat().slice(0, PAL_ROWS * 2), ...everywhere]
267
+ st.identities.ensure()
268
+ void st.urls.load()
269
+ void st.waiting.load()
270
+ // every row of a repo wears its icon from the list of the projects: a window that did not read it yet reads it
271
+ if (st.machine != null && st.projects.list.length === 0) void st.projects.load()
272
+ const r = this.scope === 'project' ? this.project : null
273
+ if (r == null) return
274
+ if (r.review.page == null) void r.review.refresh()
275
+ if (r.hasCli && r.commands.view == null) void r.commands.load()
131
276
  }
132
277
 
133
- toggle(): void {
278
+ /** the scope's key: it opens the picker there, closes it when it shows that scope, and from the other scope swaps
279
+ * to it with the words kept */
280
+ toggle(scope: PaletteScope = 'all'): void {
281
+ if (this.open && this.scope !== scope) return this.setScope(scope)
134
282
  this.open = !this.open
135
- if (this.open) {
136
- this.st.identities.ensure()
137
- void this.st.urls.load()
138
- void this.st.waiting.load()
139
- }
283
+ this.scope = scope
284
+ if (this.open) this.warm()
140
285
  this.query = ''
141
286
  this.idx = 0
142
287
  }
143
288
  close(): void {
144
289
  this.open = false
145
290
  }
291
+ /** the other scope, the words kept (⇥) */
292
+ swap(): void {
293
+ this.setScope(this.scope === 'project' ? 'all' : 'project')
294
+ }
295
+ setScope(scope: PaletteScope): void {
296
+ if (!this.scoped || scope === this.scope) return
297
+ this.scope = scope
298
+ this.idx = 0
299
+ this.warm()
300
+ }
146
301
  setQuery(v: string): void {
147
302
  this.query = v
148
303
  this.idx = 0
@@ -1,14 +1,15 @@
1
- // the one picker, cmd+j (palette-st.ts): home, activity, planned and
2
- // archived, the identities and their accounts, the shown repo's targets, then every other repo; under a query,
3
- // every repo's urls and pages too, each with its repo's name. A place wears
4
- // its button's icon, a repo its own icon, as the project list shows them, an identity its avatar, an account its
5
- // platform's logo.
1
+ // the one picker (palette-st.ts) in its two scopes: ⌘P this project alone, ⌘⇧P every project. Its head says which
2
+ // one it lists and the keys that reach the other; ⇥ swaps, the words kept. A place wears its button's icon, a repo
3
+ // its own icon, as the project list shows them, an identity its avatar, an account its platform's logo. Among every
4
+ // project each row of a repo names it; in this project's scope the head names it once.
6
5
  import { observer } from 'mobx-react-lite'
7
6
  import type { HomeSt } from './home-st.ts'
8
7
  import { Icon, ICON } from './icons.tsx'
8
+ import { SCOPE_KEY, SWAP_KEY } from './palette-st.ts'
9
9
  import { Face } from './project-list.tsx'
10
10
  import { Logo } from './social/kit.tsx'
11
11
  import type { JumpFace } from './repo-st.ts'
12
+ import { tip } from './tips.ts'
12
13
 
13
14
  /** the icon a picker entry wears; an empty slot keeps the labels aligned */
14
15
  const PalFace = observer(({ app, face }: { app: HomeSt; face: JumpFace | undefined }) => {
@@ -22,19 +23,42 @@ const PalFace = observer(({ app, face }: { app: HomeSt; face: JumpFace | undefin
22
23
  return <span className="pface">{p == null ? null : <Face p={p} px={16} />}</span>
23
24
  })
24
25
 
26
+ /** which scope the picker lists, and the keys that reach the other; a click swaps as ⇥ does */
27
+ const PalHead = observer(({ app }: { app: HomeSt }) => {
28
+ const p = app.palette
29
+ const mine = p.scope === 'project'
30
+ const r = p.project
31
+ const other = mine ? 'every project' : `${p.projectName} alone`
32
+ return (
33
+ <div className="palhead">
34
+ <span className="palwho">
35
+ {mine ? (r == null ? <PalFace app={app} face={{ place: 'home' }} /> : <PalFace app={app} face={{ repo: r.key }} />) : null}
36
+ <b>{mine ? p.projectName : 'every project'}</b>
37
+ </span>
38
+ {/* the mouse never takes the focus off the input */}
39
+ <button type="button" className="palswap" {...tip(`list ${other}`, `${SWAP_KEY} or ${SCOPE_KEY[mine ? 'all' : 'project']}`)} onMouseDown={(e) => e.preventDefault()} onClick={() => p.swap()}>
40
+ <kbd className="pjkey">{SWAP_KEY}</kbd> or <kbd className="pjkey">{SCOPE_KEY[mine ? 'all' : 'project']}</kbd>: {other}
41
+ </button>
42
+ </div>
43
+ )
44
+ })
45
+
25
46
  export const Palette = observer(({ app }: { app: HomeSt }) => {
26
47
  const p = app.palette
27
48
  if (!p.open) return null
49
+ const mine = p.scope === 'project'
28
50
  return (
29
51
  <div className="palov" onClick={() => p.close()}>
30
- <div className="pal" onClick={(e) => e.stopPropagation()}>
31
- <input autoFocus placeholder="jump to…" value={p.query}
52
+ <div className="pal" data-scope={p.scope} onClick={(e) => e.stopPropagation()}>
53
+ {p.scoped ? <PalHead app={app} /> : null}
54
+ <input autoFocus placeholder={!p.scoped ? 'jump to…' : mine ? `jump to… in ${p.projectName}` : 'jump to… in every project'} value={p.query}
32
55
  onChange={(e) => p.setQuery(e.target.value)}
33
56
  onKeyDown={(e) => {
34
57
  if (e.key === 'ArrowDown') { e.preventDefault(); p.move(1) }
35
58
  else if (e.key === 'ArrowUp') { e.preventDefault(); p.move(-1) }
36
59
  else if (e.key === 'Enter') p.run()
37
60
  else if (e.key === 'Escape') p.close()
61
+ else if (e.key === 'Tab' && !e.shiftKey && !e.metaKey && !e.ctrlKey && !e.altKey) { e.preventDefault(); p.swap() }
38
62
  }} />
39
63
  <div className="prows">
40
64
  {p.results.map((jp, n) => (
@@ -43,7 +67,7 @@ export const Palette = observer(({ app }: { app: HomeSt }) => {
43
67
  onClick={() => p.run(jp)}>
44
68
  <PalFace app={app} face={jp.face} />
45
69
  <span className="plabel">{jp.label}</span>
46
- {jp.repo == null ? null : <span className="prepo">{jp.repo}</span>}
70
+ {jp.repo == null || mine ? null : <span className="prepo">{jp.repo}</span>}
47
71
  <span className="pchip">{jp.section}</span>
48
72
  {jp.key == null ? null : <kbd className="pjkey">{jp.key}</kbd>}
49
73
  </div>
@@ -0,0 +1,39 @@
1
+ // a small button on a section head of the main panel (main-panel.tsx, a source's SourceAction): its act at a click,
2
+ // its choices in a menu under it when it has some, or the form of words he types first (a url to add). A form takes
3
+ // the focus and closes on Escape or its own buttons alone: a press outside never loses what he typed
4
+ import { observer } from 'mobx-react-lite'
5
+ import { useState } from 'react'
6
+ import { Popover } from './floating.tsx'
7
+ import { Icon } from './icons.tsx'
8
+ import type { SourceAction } from './panel-source.ts'
9
+ import { tip } from './tips.ts'
10
+
11
+ export const HeadAction = observer(({ a }: { a: SourceAction }) => {
12
+ const [at, setAt] = useState<HTMLElement | null>(null)
13
+ const close = (): void => setAt(null)
14
+ const form = a.form != null
15
+ const menu = at == null ? null : form ? a.form!(close) : a.menu?.(close)
16
+ const press = (el: HTMLElement): void => {
17
+ if (at != null) return close()
18
+ if (!form && a.menu?.(close) == null) a.run?.()
19
+ else setAt(el)
20
+ }
21
+ return (
22
+ <>
23
+ <span role="button" tabIndex={0} className="mpact" data-act={a.id} {...tip(a.title ?? a.label)} aria-label={a.label} aria-haspopup={form ? 'dialog' : a.menu == null ? undefined : 'menu'} aria-expanded={a.menu == null && !form ? undefined : at != null}
24
+ onClick={(e) => { e.stopPropagation(); press(e.currentTarget) }}
25
+ onKeyDown={(e) => {
26
+ if (e.key !== 'Enter' && e.key !== ' ') return
27
+ e.preventDefault()
28
+ e.stopPropagation()
29
+ press(e.currentTarget)
30
+ }}><Icon d={a.icon} /></span>
31
+ {/* a click in the menu is the menu's: through React it would reach the head and fold the section */}
32
+ {menu == null ? null : (
33
+ <Popover open anchor={at} onClose={close} role={form ? 'dialog' : 'menu'} outside={!form} label={a.label} className={form ? 'fpop mpform' : 'mpmenu'} placement="bottom-start" gap={2}>
34
+ <div onClick={(e) => e.stopPropagation()}>{menu}</div>
35
+ </Popover>
36
+ )}
37
+ </>
38
+ )
39
+ })
@@ -0,0 +1,70 @@
1
+ // THE MAIN PANEL'S HEAD, fixed over its sections so a window says its project at a glance: a band in the repo's window
2
+ // colour (core/repo-gui-color.ts guiColorOf, the colour its app's title bar wears) with its mark (project-list.tsx
3
+ // RepoMark: its app icon, else its letter on a hashed hue), its name and its one line; under it, smaller, the identity
4
+ // it speaks as. On a page of the home the house's own band. A repo the projects answer has not named yet still gets
5
+ // its band: its name's colour and its letter, never an empty head
6
+ import { observer } from 'mobx-react-lite'
7
+ import type { CSSProperties, ReactNode } from 'react'
8
+ import { guiColorOfName } from '../../core/gui-color.ts'
9
+ import type { HomeSt } from './home-st.ts'
10
+ import { Icon, ICON } from './icons.tsx'
11
+ import { panelProfile, panelRepo } from './panel-repo.ts'
12
+ import { tintOf } from './panel-tint.ts'
13
+ import { PROFILE_KEY } from './panel-walk.ts'
14
+ import { RepoMark } from './project-list.tsx'
15
+ import { tip } from './tips.ts'
16
+
17
+ /** the mark's size in px */
18
+ const MARK = 30
19
+
20
+ /** the identity the panel's repo speaks as, its avatar and its name; a click its view */
21
+ const Profile = observer(({ home, repo }: { home: HomeSt; repo: string }) => {
22
+ const s = home.projects
23
+ const i = panelProfile(home)
24
+ if (i == null) return null
25
+ return (
26
+ <button type="button" data-key={PROFILE_KEY} className={`mpline mpprofile${s.identityLit() === i.id ? ' cur' : ''}`} aria-current={s.identityLit() === i.id ? 'page' : undefined} style={i.colour == null ? undefined : ({ '--idc': i.colour } as CSSProperties)}
27
+ {...tip(`${repo} speaks as ${i.name}: its profile, its company, every account`)} onClick={() => s.onIdentity?.(i.id)}>
28
+ {i.mark != null ? <img className="pjav" src={i.mark} alt="" width={16} height={16} draggable={false} /> : <span className="pjav pjavi">{i.name.charAt(0).toUpperCase()}</span>}
29
+ <span className="mpname">{i.name}</span>
30
+ </button>
31
+ )
32
+ })
33
+
34
+ /** the band: a mark, a name, a dim line under it */
35
+ const Band = ({ colour, mark, name, sub, title }: { colour: string | null | undefined; mark: ReactNode; name: string; sub: string | null; title: string }) => (
36
+ <div className="mpband" style={tintOf(colour)} {...tip(title, null, 'right')}>
37
+ <span className="mpbmark">{mark}</span>
38
+ <span className="mpbtext">
39
+ <b className="mpbname">{name}</b>
40
+ {sub == null || sub === '' ? null : <span className="mpbsub">{sub}</span>}
41
+ </span>
42
+ </div>
43
+ )
44
+
45
+ export const PanelHead = observer(({ home }: { home: HomeSt }) => {
46
+ const s = home.projects
47
+ const r = panelRepo(home)
48
+ if (r == null) {
49
+ // the home's own head; a hub of its own before its repo shows draws none
50
+ if (s.onPlace == null) return null
51
+ const h = s.list.find((p) => p.name === s.house)
52
+ const n = s.list.length
53
+ return (
54
+ <header className="mphead" aria-label="the house">
55
+ <Band colour={h?.guiColor} name="the house" sub={n === 0 ? null : `${n} repo${n === 1 ? '' : 's'}`} title="the house: every repo's pages, the inbox, the overview, the machines"
56
+ mark={h?.appIcon != null ? <img src={h.appIcon} alt="" width={MARK} height={MARK} draggable={false} /> : <Icon d={ICON.home} />} />
57
+ </header>
58
+ )
59
+ }
60
+ const p = s.list.find((x) => x.name === r.name)
61
+ const facts = [p?.branch, p?.version == null ? null : `v${p.version.replace(/^v/, '')}`].filter((x) => x != null && x !== '').join(' · ')
62
+ const title = `${r.name}${p?.description == null ? '' : `: ${p.description}`}${facts === '' ? '' : ` (${facts})`}`
63
+ return (
64
+ <header className="mphead" aria-label={`${r.name}, the project of this window`}>
65
+ <Band colour={p?.guiColor ?? guiColorOfName(r.name)} name={r.name} sub={p?.description ?? null} title={title}
66
+ mark={<RepoMark p={p ?? { name: r.name, icon: null, appIcon: null }} px={MARK} />} />
67
+ <Profile home={home} repo={r.name} />
68
+ </header>
69
+ )
70
+ })
@@ -0,0 +1,42 @@
1
+ // the project the main panel is about, and the address of each of its entries: what a new tab opens (⌘ click, a middle
2
+ // click, the row's own button), the page alone with the main panel. A project's app keeps its shell in every address
3
+ import { appPost, type TabChips } from './app-bridge.ts'
4
+ import { hashFor, type HashSel } from './hash-route.ts'
5
+ import type { HomeSt } from './home-st.ts'
6
+ import { PLACE_PATH } from './place-path.ts'
7
+ import type { HouseEntry, ProjectsSvc } from './projects-svc.ts'
8
+ import type { RepoSt } from './repo-st.ts'
9
+ import { withShell } from './shell.ts'
10
+
11
+ /** the project the panel is about: the window's in a project's app, else the repo last shown, kept over a page of the
12
+ * home so a step into the global entries comes back; null before any repo is shown */
13
+ export const panelRepo = (home: HomeSt): RepoSt | null =>
14
+ home.shell?.kind === 'project' ? home.shellRepo : home.machine == null ? home.shown : home.selected == null ? null : (home.repos.get(home.selected) ?? null)
15
+
16
+ /** the identity the panel's repo speaks as (the panel's first row); null with no repo or none known */
17
+ export function panelProfile(home: HomeSt): ProjectsSvc['identities'][number] | null {
18
+ const s = home.projects
19
+ const r = panelRepo(home)
20
+ const p = r == null ? null : s.list.find((x) => x.name === r.name)
21
+ return p == null ? null : (s.identities.find((x) => s.speaksAs(p, x.id)) ?? null)
22
+ }
23
+
24
+ /** a path of this hub, with the window's shell kept */
25
+ const kept = (home: HomeSt, path: string): string => (home.shell == null ? path : withShell(path, globalThis.location?.origin ?? 'http://hub', home.shell))
26
+
27
+ /** a page of a repo */
28
+ export const repoHref = (home: HomeSt, r: RepoSt, sel: HashSel): string => kept(home, `${r.base}/#${hashFor(sel) ?? ''}`)
29
+
30
+ /** a source row's own page (panel-source.ts PanelSource.page), in the panel's project */
31
+ export const sourceHref = (home: HomeSt, r: RepoSt, section: string, id: string): string => repoHref(home, r, { t: 'src', section, id })
32
+
33
+ /** a page of the home; the picker is a dialog, no page */
34
+ export const houseHref = (home: HomeSt, e: HouseEntry): string | null => (e === 'picker' ? null : kept(home, PLACE_PATH[e]))
35
+
36
+ /** 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
37
+ * 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
38
+ * logins, which that tab wears in its title bar */
39
+ export const openTab = (href: string, name?: string, chips?: TabChips): void => {
40
+ if (name != null) appPost()?.({ tabName: name, url: new URL(href, globalThis.location?.href).href, ...chips })
41
+ void globalThis.open?.(href, '_blank')
42
+ }