@skillcdn/console 0.5.0 → 0.5.2

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 (490) hide show
  1. package/README.md +87 -12
  2. package/SKILLCDN.md +3 -3
  3. package/dist/agent-page.d.ts.map +1 -1
  4. package/dist/agent-page.js +7 -6
  5. package/dist/agent-page.js.map +1 -1
  6. package/dist/api.d.ts +9 -7
  7. package/dist/api.d.ts.map +1 -1
  8. package/dist/api.js +8 -6
  9. package/dist/api.js.map +1 -1
  10. package/dist/charts.d.ts +103 -0
  11. package/dist/charts.d.ts.map +1 -0
  12. package/dist/charts.js +182 -0
  13. package/dist/charts.js.map +1 -0
  14. package/dist/cli/cli.d.ts +58 -2
  15. package/dist/cli/cli.d.ts.map +1 -1
  16. package/dist/cli/cli.js +1742 -472
  17. package/dist/cli/cli.js.map +1 -1
  18. package/dist/cli/command-words.d.ts +20 -0
  19. package/dist/cli/command-words.d.ts.map +1 -0
  20. package/dist/cli/command-words.js +51 -0
  21. package/dist/cli/command-words.js.map +1 -0
  22. package/dist/cli/credentials.d.ts +54 -5
  23. package/dist/cli/credentials.d.ts.map +1 -1
  24. package/dist/cli/credentials.js +126 -20
  25. package/dist/cli/credentials.js.map +1 -1
  26. package/dist/cli/directory.d.ts +19 -4
  27. package/dist/cli/directory.d.ts.map +1 -1
  28. package/dist/cli/directory.js +16 -8
  29. package/dist/cli/directory.js.map +1 -1
  30. package/dist/cli/format.d.ts +70 -9
  31. package/dist/cli/format.d.ts.map +1 -1
  32. package/dist/cli/format.js +267 -40
  33. package/dist/cli/format.js.map +1 -1
  34. package/dist/cli/help.d.ts +13 -4
  35. package/dist/cli/help.d.ts.map +1 -1
  36. package/dist/cli/help.js +101 -58
  37. package/dist/cli/help.js.map +1 -1
  38. package/dist/cli/machine-check.d.ts +36 -0
  39. package/dist/cli/machine-check.d.ts.map +1 -0
  40. package/dist/cli/machine-check.js +151 -0
  41. package/dist/cli/machine-check.js.map +1 -0
  42. package/dist/cli/main.js +76 -2
  43. package/dist/cli/main.js.map +1 -1
  44. package/dist/cli/pack.d.ts +69 -60
  45. package/dist/cli/pack.d.ts.map +1 -1
  46. package/dist/cli/pack.js +241 -270
  47. package/dist/cli/pack.js.map +1 -1
  48. package/dist/cli/plugin-check.d.ts +42 -0
  49. package/dist/cli/plugin-check.d.ts.map +1 -1
  50. package/dist/cli/plugin-check.js +221 -36
  51. package/dist/cli/plugin-check.js.map +1 -1
  52. package/dist/cli/plugin-cli.d.ts +6 -1
  53. package/dist/cli/plugin-cli.d.ts.map +1 -1
  54. package/dist/cli/plugin-cli.js +21 -4
  55. package/dist/cli/plugin-cli.js.map +1 -1
  56. package/dist/cli/plugin-main.js +1 -0
  57. package/dist/cli/plugin-main.js.map +1 -1
  58. package/dist/cli/runner-host.d.ts +7 -0
  59. package/dist/cli/runner-host.d.ts.map +1 -1
  60. package/dist/cli/runner-host.js +2 -0
  61. package/dist/cli/runner-host.js.map +1 -1
  62. package/dist/cli/secret-notes.d.ts +8 -0
  63. package/dist/cli/secret-notes.d.ts.map +1 -0
  64. package/dist/cli/secret-notes.js +48 -0
  65. package/dist/cli/secret-notes.js.map +1 -0
  66. package/dist/cli/serve.d.ts +33 -1
  67. package/dist/cli/serve.d.ts.map +1 -1
  68. package/dist/cli/serve.js +252 -3
  69. package/dist/cli/serve.js.map +1 -1
  70. package/dist/client.d.ts +54 -9
  71. package/dist/client.d.ts.map +1 -1
  72. package/dist/client.js +77 -80
  73. package/dist/client.js.map +1 -1
  74. package/dist/components/agent-page.d.ts +164 -8
  75. package/dist/components/agent-page.d.ts.map +1 -1
  76. package/dist/components/agent-page.js +588 -151
  77. package/dist/components/agent-page.js.map +1 -1
  78. package/dist/components/agents.d.ts.map +1 -1
  79. package/dist/components/agents.js +1 -1
  80. package/dist/components/agents.js.map +1 -1
  81. package/dist/components/board.d.ts.map +1 -1
  82. package/dist/components/board.js +3 -2
  83. package/dist/components/board.js.map +1 -1
  84. package/dist/components/categories.js +1 -1
  85. package/dist/components/categories.js.map +1 -1
  86. package/dist/components/charts.d.ts +157 -0
  87. package/dist/components/charts.d.ts.map +1 -0
  88. package/dist/components/charts.js +182 -0
  89. package/dist/components/charts.js.map +1 -0
  90. package/dist/components/decision-list.d.ts.map +1 -1
  91. package/dist/components/decision-list.js +1 -1
  92. package/dist/components/decision-list.js.map +1 -1
  93. package/dist/components/desk-records.d.ts +102 -0
  94. package/dist/components/desk-records.d.ts.map +1 -0
  95. package/dist/components/desk-records.js +221 -0
  96. package/dist/components/desk-records.js.map +1 -0
  97. package/dist/components/desk.d.ts +85 -0
  98. package/dist/components/desk.d.ts.map +1 -0
  99. package/dist/components/desk.js +135 -0
  100. package/dist/components/desk.js.map +1 -0
  101. package/dist/components/event-feed.d.ts.map +1 -1
  102. package/dist/components/event-feed.js +7 -3
  103. package/dist/components/event-feed.js.map +1 -1
  104. package/dist/components/goals.d.ts +2 -0
  105. package/dist/components/goals.d.ts.map +1 -1
  106. package/dist/components/goals.js +1 -1
  107. package/dist/components/goals.js.map +1 -1
  108. package/dist/components/home.d.ts.map +1 -1
  109. package/dist/components/home.js +14 -6
  110. package/dist/components/home.js.map +1 -1
  111. package/dist/components/icon.d.ts +31 -0
  112. package/dist/components/icon.d.ts.map +1 -0
  113. package/dist/components/icon.js +169 -0
  114. package/dist/components/icon.js.map +1 -0
  115. package/dist/components/markdown.d.ts +6 -0
  116. package/dist/components/markdown.d.ts.map +1 -1
  117. package/dist/components/markdown.js +10 -2
  118. package/dist/components/markdown.js.map +1 -1
  119. package/dist/components/people.js +1 -1
  120. package/dist/components/people.js.map +1 -1
  121. package/dist/components/plugin-frame.d.ts.map +1 -1
  122. package/dist/components/plugin-frame.js +7 -0
  123. package/dist/components/plugin-frame.js.map +1 -1
  124. package/dist/components/plugin-settings.d.ts.map +1 -1
  125. package/dist/components/plugin-settings.js +54 -3
  126. package/dist/components/plugin-settings.js.map +1 -1
  127. package/dist/components/projects.d.ts +17 -4
  128. package/dist/components/projects.d.ts.map +1 -1
  129. package/dist/components/projects.js +51 -12
  130. package/dist/components/projects.js.map +1 -1
  131. package/dist/components/rules.d.ts +8 -10
  132. package/dist/components/rules.d.ts.map +1 -1
  133. package/dist/components/rules.js +35 -13
  134. package/dist/components/rules.js.map +1 -1
  135. package/dist/components/sessions.d.ts.map +1 -1
  136. package/dist/components/sessions.js +3 -2
  137. package/dist/components/sessions.js.map +1 -1
  138. package/dist/components/setup.d.ts +9 -3
  139. package/dist/components/setup.d.ts.map +1 -1
  140. package/dist/components/setup.js +12 -6
  141. package/dist/components/setup.js.map +1 -1
  142. package/dist/components/shell.d.ts.map +1 -1
  143. package/dist/components/shell.js +3 -2
  144. package/dist/components/shell.js.map +1 -1
  145. package/dist/components/tokens.js +1 -1
  146. package/dist/components/tokens.js.map +1 -1
  147. package/dist/components/ui.d.ts +5 -2
  148. package/dist/components/ui.d.ts.map +1 -1
  149. package/dist/components/ui.js +10 -7
  150. package/dist/components/ui.js.map +1 -1
  151. package/dist/connect-page.js +1 -1
  152. package/dist/connect-page.js.map +1 -1
  153. package/dist/console.css +1172 -106
  154. package/dist/console.d.ts +5 -0
  155. package/dist/console.d.ts.map +1 -1
  156. package/dist/console.js +52 -39
  157. package/dist/console.js.map +1 -1
  158. package/dist/data.d.ts.map +1 -1
  159. package/dist/data.js +32 -33
  160. package/dist/data.js.map +1 -1
  161. package/dist/desk-page.d.ts +38 -0
  162. package/dist/desk-page.d.ts.map +1 -0
  163. package/dist/desk-page.js +184 -0
  164. package/dist/desk-page.js.map +1 -0
  165. package/dist/desk-records-page.d.ts +18 -0
  166. package/dist/desk-records-page.d.ts.map +1 -0
  167. package/dist/desk-records-page.js +130 -0
  168. package/dist/desk-records-page.js.map +1 -0
  169. package/dist/desk-records.d.ts +247 -0
  170. package/dist/desk-records.d.ts.map +1 -0
  171. package/dist/desk-records.js +543 -0
  172. package/dist/desk-records.js.map +1 -0
  173. package/dist/desk.d.ts +122 -0
  174. package/dist/desk.d.ts.map +1 -0
  175. package/dist/desk.js +211 -0
  176. package/dist/desk.js.map +1 -0
  177. package/dist/feed-stream.d.ts +39 -0
  178. package/dist/feed-stream.d.ts.map +1 -0
  179. package/dist/feed-stream.js +117 -0
  180. package/dist/feed-stream.js.map +1 -0
  181. package/dist/home-tiles.d.ts +19 -3
  182. package/dist/home-tiles.d.ts.map +1 -1
  183. package/dist/home-tiles.js +147 -42
  184. package/dist/home-tiles.js.map +1 -1
  185. package/dist/i18n/en.d.ts +228 -6
  186. package/dist/i18n/en.d.ts.map +1 -1
  187. package/dist/i18n/en.js +309 -9
  188. package/dist/i18n/en.js.map +1 -1
  189. package/dist/i18n/ko.d.ts.map +1 -1
  190. package/dist/i18n/ko.js +366 -85
  191. package/dist/i18n/ko.js.map +1 -1
  192. package/dist/i18n/particles.d.ts +7 -0
  193. package/dist/i18n/particles.d.ts.map +1 -0
  194. package/dist/i18n/particles.js +72 -0
  195. package/dist/i18n/particles.js.map +1 -0
  196. package/dist/icons/glyphs.d.ts +605 -0
  197. package/dist/icons/glyphs.d.ts.map +1 -0
  198. package/dist/icons/glyphs.js +104 -0
  199. package/dist/icons/glyphs.js.map +1 -0
  200. package/dist/icons/index.d.ts +59 -0
  201. package/dist/icons/index.d.ts.map +1 -0
  202. package/dist/icons/index.js +157 -0
  203. package/dist/icons/index.js.map +1 -0
  204. package/dist/index.d.ts +9 -0
  205. package/dist/index.d.ts.map +1 -1
  206. package/dist/index.js +9 -0
  207. package/dist/index.js.map +1 -1
  208. package/dist/limits.d.ts +20 -0
  209. package/dist/limits.d.ts.map +1 -1
  210. package/dist/limits.js +20 -0
  211. package/dist/limits.js.map +1 -1
  212. package/dist/marks.d.ts +9 -0
  213. package/dist/marks.d.ts.map +1 -1
  214. package/dist/marks.js +9 -0
  215. package/dist/marks.js.map +1 -1
  216. package/dist/onboarding.d.ts +6 -0
  217. package/dist/onboarding.d.ts.map +1 -1
  218. package/dist/onboarding.js +5 -5
  219. package/dist/onboarding.js.map +1 -1
  220. package/dist/plugin/context.d.ts +42 -11
  221. package/dist/plugin/context.d.ts.map +1 -1
  222. package/dist/plugin/limits.d.ts +2 -0
  223. package/dist/plugin/limits.d.ts.map +1 -1
  224. package/dist/plugin/limits.js +2 -0
  225. package/dist/plugin/limits.js.map +1 -1
  226. package/dist/plugin/manifest.d.ts +13 -0
  227. package/dist/plugin/manifest.d.ts.map +1 -1
  228. package/dist/plugin/manifest.js +30 -3
  229. package/dist/plugin/manifest.js.map +1 -1
  230. package/dist/plugin/rest-schemas.d.ts +55 -0
  231. package/dist/plugin/rest-schemas.d.ts.map +1 -1
  232. package/dist/plugin/rest-schemas.js +37 -0
  233. package/dist/plugin/rest-schemas.js.map +1 -1
  234. package/dist/plugin/sandbox.d.ts.map +1 -1
  235. package/dist/plugin/sandbox.js +4 -1
  236. package/dist/plugin/sandbox.js.map +1 -1
  237. package/dist/plugin/testing.d.ts +6 -2
  238. package/dist/plugin/testing.d.ts.map +1 -1
  239. package/dist/plugin/testing.js +52 -10
  240. package/dist/plugin/testing.js.map +1 -1
  241. package/dist/plugin/web.d.ts +3 -0
  242. package/dist/plugin/web.d.ts.map +1 -1
  243. package/dist/plugin/web.js +5 -1
  244. package/dist/plugin/web.js.map +1 -1
  245. package/dist/plugin.d.ts +1 -1
  246. package/dist/plugin.d.ts.map +1 -1
  247. package/dist/plugin.js +1 -1
  248. package/dist/plugin.js.map +1 -1
  249. package/dist/records.d.ts +283 -0
  250. package/dist/records.d.ts.map +1 -0
  251. package/dist/records.js +543 -0
  252. package/dist/records.js.map +1 -0
  253. package/dist/routes.d.ts +3 -1
  254. package/dist/routes.d.ts.map +1 -1
  255. package/dist/routes.js +3 -1
  256. package/dist/routes.js.map +1 -1
  257. package/dist/rules.d.ts +30 -11
  258. package/dist/rules.d.ts.map +1 -1
  259. package/dist/rules.js +98 -45
  260. package/dist/rules.js.map +1 -1
  261. package/dist/runner/acp.d.ts +1 -1
  262. package/dist/runner/acp.d.ts.map +1 -1
  263. package/dist/runner/acp.js +32 -21
  264. package/dist/runner/acp.js.map +1 -1
  265. package/dist/runner/awake.d.ts +35 -0
  266. package/dist/runner/awake.d.ts.map +1 -0
  267. package/dist/runner/awake.js +95 -0
  268. package/dist/runner/awake.js.map +1 -0
  269. package/dist/runner/claude.d.ts +1 -1
  270. package/dist/runner/claude.d.ts.map +1 -1
  271. package/dist/runner/claude.js +100 -18
  272. package/dist/runner/claude.js.map +1 -1
  273. package/dist/runner/codex.d.ts +1 -1
  274. package/dist/runner/codex.d.ts.map +1 -1
  275. package/dist/runner/codex.js +20 -17
  276. package/dist/runner/codex.js.map +1 -1
  277. package/dist/runner/config.d.ts +5 -0
  278. package/dist/runner/config.d.ts.map +1 -1
  279. package/dist/runner/config.js +9 -0
  280. package/dist/runner/config.js.map +1 -1
  281. package/dist/runner/desk.d.ts +43 -2
  282. package/dist/runner/desk.d.ts.map +1 -1
  283. package/dist/runner/desk.js +168 -13
  284. package/dist/runner/desk.js.map +1 -1
  285. package/dist/runner/process.d.ts.map +1 -1
  286. package/dist/runner/process.js +11 -4
  287. package/dist/runner/process.js.map +1 -1
  288. package/dist/runner/redact.d.ts +39 -4
  289. package/dist/runner/redact.d.ts.map +1 -1
  290. package/dist/runner/redact.js +81 -5
  291. package/dist/runner/redact.js.map +1 -1
  292. package/dist/runner/runner.d.ts +28 -3
  293. package/dist/runner/runner.d.ts.map +1 -1
  294. package/dist/runner/runner.js +371 -54
  295. package/dist/runner/runner.js.map +1 -1
  296. package/dist/runner/slack.d.ts.map +1 -1
  297. package/dist/runner/slack.js +10 -4
  298. package/dist/runner/slack.js.map +1 -1
  299. package/dist/runner/task-scheduler.d.ts +20 -0
  300. package/dist/runner/task-scheduler.d.ts.map +1 -1
  301. package/dist/runner/task-scheduler.js +34 -4
  302. package/dist/runner/task-scheduler.js.map +1 -1
  303. package/dist/runner/types.d.ts +51 -1
  304. package/dist/runner/types.d.ts.map +1 -1
  305. package/dist/runner/types.js +26 -0
  306. package/dist/runner/types.js.map +1 -1
  307. package/dist/runner.d.ts +6 -6
  308. package/dist/runner.d.ts.map +1 -1
  309. package/dist/runner.js +5 -5
  310. package/dist/runner.js.map +1 -1
  311. package/dist/schemas.d.ts +603 -6
  312. package/dist/schemas.d.ts.map +1 -1
  313. package/dist/schemas.js +156 -20
  314. package/dist/schemas.js.map +1 -1
  315. package/dist/services.d.ts +22 -5
  316. package/dist/services.d.ts.map +1 -1
  317. package/dist/services.js +41 -17
  318. package/dist/services.js.map +1 -1
  319. package/dist/setup-guide.d.ts +17 -4
  320. package/dist/setup-guide.d.ts.map +1 -1
  321. package/dist/setup-guide.js +48 -41
  322. package/dist/setup-guide.js.map +1 -1
  323. package/dist/tokens.d.ts.map +1 -1
  324. package/dist/tokens.js +5 -1
  325. package/dist/tokens.js.map +1 -1
  326. package/dist/vocabulary.d.ts +21 -3
  327. package/dist/vocabulary.d.ts.map +1 -1
  328. package/dist/vocabulary.js +19 -3
  329. package/dist/vocabulary.js.map +1 -1
  330. package/docs/specs/cli.md +73 -44
  331. package/docs/specs/plugins.md +40 -22
  332. package/docs/specs/records.md +113 -0
  333. package/docs/specs/rest.md +30 -21
  334. package/docs/specs/runner.md +46 -22
  335. package/package.json +11 -2
  336. package/skills/building-a-console/SKILL.md +4 -4
  337. package/skills/building-a-plugin/SKILL.md +6 -6
  338. package/skills/deploying-a-console/SKILL.md +4 -4
  339. package/skills/deploying-a-console/references/resources.md +41 -4
  340. package/skills/deploying-a-console/references/running-it-again.md +3 -2
  341. package/skills/keeping-a-desk/SKILL.md +133 -0
  342. package/skills/keeping-a-desk/collections.md +96 -0
  343. package/skills/planning-the-board/SKILL.md +14 -18
  344. package/skills/planning-the-board/references/a-task.md +2 -2
  345. package/skills/planning-the-board/references/project-rules.md +13 -14
  346. package/skills/planning-the-board/references/setting-up.md +15 -13
  347. package/skills/running-an-agent/SKILL.md +47 -56
  348. package/skills/working-the-board/SKILL.md +63 -44
  349. package/skills/working-the-board/references/terms.md +9 -5
  350. package/skills/working-the-board/references/the-pack.md +12 -10
  351. package/skills/working-the-board/references/the-sentence.md +2 -2
  352. package/src/agent-page.tsx +16 -2
  353. package/src/api.ts +109 -3
  354. package/src/charts.ts +250 -0
  355. package/src/cli/cli.ts +2226 -580
  356. package/src/cli/command-words.ts +56 -0
  357. package/src/cli/credentials.ts +181 -20
  358. package/src/cli/directory.ts +28 -10
  359. package/src/cli/format.ts +332 -49
  360. package/src/cli/help.ts +113 -57
  361. package/src/cli/machine-check.ts +223 -0
  362. package/src/cli/main.ts +72 -2
  363. package/src/cli/pack.ts +333 -372
  364. package/src/cli/plugin-check.ts +275 -34
  365. package/src/cli/plugin-cli.ts +28 -4
  366. package/src/cli/plugin-main.ts +1 -0
  367. package/src/cli/runner-host.ts +8 -0
  368. package/src/cli/secret-notes.ts +63 -0
  369. package/src/cli/serve.ts +295 -2
  370. package/src/client.ts +215 -177
  371. package/src/components/agent-page.tsx +1044 -281
  372. package/src/components/agents.tsx +9 -5
  373. package/src/components/board.tsx +3 -15
  374. package/src/components/categories.tsx +2 -2
  375. package/src/components/charts.tsx +680 -0
  376. package/src/components/decision-list.tsx +11 -7
  377. package/src/components/desk-records.tsx +724 -0
  378. package/src/components/desk.tsx +471 -0
  379. package/src/components/event-feed.tsx +12 -3
  380. package/src/components/goals.tsx +33 -25
  381. package/src/components/home.tsx +42 -6
  382. package/src/components/icon.tsx +337 -0
  383. package/src/components/markdown.tsx +22 -2
  384. package/src/components/people.tsx +1 -1
  385. package/src/components/plugin-frame.tsx +7 -0
  386. package/src/components/plugin-settings.tsx +171 -12
  387. package/src/components/projects.tsx +68 -17
  388. package/src/components/rules.tsx +94 -34
  389. package/src/components/sessions.tsx +2 -13
  390. package/src/components/setup.tsx +20 -5
  391. package/src/components/shell.tsx +3 -20
  392. package/src/components/tokens.tsx +1 -1
  393. package/src/components/ui.tsx +16 -8
  394. package/src/connect-page.tsx +1 -1
  395. package/src/console.tsx +104 -62
  396. package/src/data.ts +37 -34
  397. package/src/desk-page.tsx +332 -0
  398. package/src/desk-records-page.tsx +256 -0
  399. package/src/desk-records.ts +808 -0
  400. package/src/desk.ts +329 -0
  401. package/src/feed-stream.ts +144 -0
  402. package/src/home-tiles.ts +170 -46
  403. package/src/i18n/en.ts +323 -11
  404. package/src/i18n/ko.ts +378 -87
  405. package/src/i18n/particles.ts +79 -0
  406. package/src/icons/glyphs.ts +112 -0
  407. package/src/icons/index.ts +195 -0
  408. package/src/index.ts +125 -0
  409. package/src/limits.ts +20 -0
  410. package/src/marks.ts +12 -0
  411. package/src/onboarding.ts +14 -6
  412. package/src/plugin/context.ts +55 -12
  413. package/src/plugin/limits.ts +2 -0
  414. package/src/plugin/manifest.ts +38 -2
  415. package/src/plugin/rest-schemas.ts +41 -0
  416. package/src/plugin/sandbox.ts +4 -1
  417. package/src/plugin/testing.ts +63 -12
  418. package/src/plugin/web.ts +9 -2
  419. package/src/plugin.ts +2 -0
  420. package/src/records.ts +702 -0
  421. package/src/routes.ts +3 -1
  422. package/src/rules.ts +108 -47
  423. package/src/runner/acp.ts +49 -30
  424. package/src/runner/awake.ts +135 -0
  425. package/src/runner/claude.ts +131 -26
  426. package/src/runner/codex.ts +37 -26
  427. package/src/runner/config.ts +9 -0
  428. package/src/runner/desk.ts +200 -15
  429. package/src/runner/process.ts +11 -4
  430. package/src/runner/redact.ts +92 -6
  431. package/src/runner/runner.ts +457 -56
  432. package/src/runner/slack.ts +10 -4
  433. package/src/runner/task-scheduler.ts +36 -4
  434. package/src/runner/types.ts +67 -1
  435. package/src/runner.ts +27 -2
  436. package/src/schemas.ts +177 -18
  437. package/src/services.ts +55 -16
  438. package/src/setup-guide.ts +49 -40
  439. package/src/styles/README.md +16 -5
  440. package/src/styles/base.css +17 -0
  441. package/src/styles/console.css +10 -0
  442. package/src/styles/drawn-by-pages.json +1 -1
  443. package/src/styles/pages/agents.css +103 -1
  444. package/src/styles/pages/board.css +0 -10
  445. package/src/styles/pages/calendar.css +1 -1
  446. package/src/styles/pages/connect.css +0 -10
  447. package/src/styles/pages/decisions.css +3 -1
  448. package/src/styles/pages/desk.css +126 -0
  449. package/src/styles/pages/documents.css +5 -0
  450. package/src/styles/pages/feed.css +5 -2
  451. package/src/styles/pages/home.css +5 -0
  452. package/src/styles/pages/roadmap.css +2 -2
  453. package/src/styles/pages/settings.css +11 -0
  454. package/src/styles/pages/task.css +0 -20
  455. package/src/styles/pages/thread.css +1 -1
  456. package/src/styles/parts/bars.css +80 -0
  457. package/src/styles/parts/calendar.css +1 -1
  458. package/src/styles/parts/callout.css +1 -0
  459. package/src/styles/parts/chart.css +173 -0
  460. package/src/styles/parts/detail.css +22 -0
  461. package/src/styles/parts/empty.css +2 -0
  462. package/src/styles/parts/eyebrow.css +1 -1
  463. package/src/styles/parts/facts.css +1 -1
  464. package/src/styles/parts/figures.css +65 -0
  465. package/src/styles/parts/form.css +2 -1
  466. package/src/styles/parts/icon.css +191 -0
  467. package/src/styles/parts/input.css +14 -4
  468. package/src/styles/parts/legend.css +48 -0
  469. package/src/styles/parts/mark.css +36 -0
  470. package/src/styles/parts/menu.css +1 -7
  471. package/src/styles/parts/page.css +1 -1
  472. package/src/styles/parts/panel.css +10 -0
  473. package/src/styles/parts/person.css +5 -2
  474. package/src/styles/parts/progress.css +5 -2
  475. package/src/styles/parts/rows.css +1 -0
  476. package/src/styles/parts/series.css +32 -0
  477. package/src/styles/parts/settings.css +5 -0
  478. package/src/styles/parts/share.css +25 -0
  479. package/src/styles/parts/spark.css +23 -0
  480. package/src/styles/parts/stat.css +69 -0
  481. package/src/styles/tokens.css +31 -10
  482. package/src/tokens.ts +5 -1
  483. package/src/vocabulary.ts +25 -3
  484. package/template/desk-web/README.md +8 -0
  485. package/template/desk-web/index.html +13 -0
  486. package/template/desk-web/package.json +25 -0
  487. package/template/desk-web/src/main.tsx +24 -0
  488. package/template/desk-web/src/page.tsx +51 -0
  489. package/template/desk-web/tsconfig.json +16 -0
  490. package/template/desk-web/vite.config.ts +15 -0
@@ -0,0 +1,332 @@
1
+ import { useEffect, useMemo, useState } from "react";
2
+ import type { RestWorkBrief } from "./api.js";
3
+ import type { ConsoleClient } from "./client.js";
4
+ import {
5
+ DESK_VIEWS,
6
+ DeskArchive,
7
+ DeskFiguresView,
8
+ DeskStanding,
9
+ type DeskView,
10
+ DeskViews,
11
+ } from "./components/desk.js";
12
+ import { Callout, EmptyState, Spinner } from "./components/ui.js";
13
+ import type { CustomPage } from "./console.js";
14
+ import type { ConsoleData } from "./data.js";
15
+ import { deviceLanguage, firstDayOfWeek, today as todayOf } from "./dates.js";
16
+ import {
17
+ DESK_RUNS,
18
+ DESK_TASKS,
19
+ type DeskHistory,
20
+ type DeskProject,
21
+ type DeskRun,
22
+ figuresOf,
23
+ readHistory,
24
+ readOpenRuns,
25
+ withHistory,
26
+ } from "./desk.js";
27
+ import type { RecordsReader } from "./desk-records.js";
28
+ import { DeskRecords } from "./desk-records-page.js";
29
+ import { DEFAULT_LANGUAGES, useLanguage, useWords } from "./i18n/index.js";
30
+ import { customPageHref, decisionHref, type Navigation, taskHref } from "./router.js";
31
+ import { errorWords } from "./use-action.js";
32
+
33
+ // The page of a desk (ADR-0116, ADR-0117): one page of a console of a member's own, the
34
+ // member's own extension of the console's pages. It comes with the records' view, what the
35
+ // member made and what became of it, read from the desk's own files; beside it stand three
36
+ // views of the member's work on the board, read through the client when one is looked at: what
37
+ // stands now from the plate and the open runs, the figures and the archive from a bounded page
38
+ // of each project's closed tasks and ended runs. The address says which view, and what it
39
+ // shows (ADR-0010).
40
+
41
+ /** What the address of a desk's page says: its view, the records' where it names none, and the words the board's archive is found by. */
42
+ export function deskViewOf(search: string): { readonly view: DeskView; readonly words: string } {
43
+ const params = new URLSearchParams(search);
44
+ const named = params.get("view");
45
+ return {
46
+ view: DESK_VIEWS.find((view) => view === named) ?? "records",
47
+ words: (params.get("q") ?? "").trim(),
48
+ };
49
+ }
50
+
51
+ /** Where a view of a desk's page is, from the page's own address; the board's archive with the words it is found by. */
52
+ export function deskHref(base: string, view: DeskView, words = ""): string {
53
+ const params = new URLSearchParams();
54
+ if (view !== "records") {
55
+ params.set("view", view);
56
+ }
57
+ if (view === "archive" && words.length > 0) {
58
+ params.set("q", words);
59
+ }
60
+ const query = params.toString();
61
+ return query.length === 0 ? base : `${base}?${query}`;
62
+ }
63
+
64
+ export interface DeskPageProps {
65
+ readonly client: ConsoleClient;
66
+ /** The workspace as the console keeps it current: who looks, and the projects they may see. */
67
+ readonly data: Pick<ConsoleData, "me" | "projects">;
68
+ /** The query of the address the page is at. */
69
+ readonly search: string;
70
+ /** The page's own address, without a query. */
71
+ readonly href: string;
72
+ readonly navigation: Navigation;
73
+ /** What reads the desk's records; the page's own `fetch` at `/records` where left out. */
74
+ readonly records?: RecordsReader | undefined;
75
+ }
76
+
77
+ /** What stands now, as one visit read it. */
78
+ interface Standing {
79
+ readonly work: RestWorkBrief;
80
+ readonly runs: readonly DeskRun[];
81
+ }
82
+
83
+ /** The closed work read so far for some words: the pages of it as one. */
84
+ interface Read {
85
+ readonly words: string;
86
+ readonly pages: number;
87
+ readonly history: DeskHistory;
88
+ }
89
+
90
+ export function DeskPage(props: DeskPageProps) {
91
+ const pack = useWords();
92
+ const words = pack.desk;
93
+ const { tag } = useLanguage();
94
+ const { client, data, search, href, navigation } = props;
95
+ const { view, words: query } = deskViewOf(search);
96
+ const personId = data.me?.person?.id;
97
+ const weekStart = data.me?.workspace.weekStart;
98
+ // The projects by what a row says of each: a list read again that says the same is the same
99
+ // list here, so that nothing is read from the console a second time for it.
100
+ const listed = JSON.stringify(
101
+ data.projects.map((project) => [
102
+ project.key,
103
+ project.name,
104
+ project.color,
105
+ project.symbol,
106
+ project.icon ?? null,
107
+ ]),
108
+ );
109
+ // biome-ignore lint/correctness/useExhaustiveDependencies: the list is held by what it says, not by the array that holds it
110
+ const projects = useMemo<readonly DeskProject[]>(
111
+ () =>
112
+ data.projects.map((project) => ({
113
+ key: project.key,
114
+ name: project.name,
115
+ color: project.color,
116
+ symbol: project.symbol,
117
+ icon: project.icon ?? null,
118
+ })),
119
+ [listed],
120
+ );
121
+ const [standing, setStanding] = useState<Standing | undefined>(undefined);
122
+ // Everything closed, which the figures count and the archive lists; and what words found.
123
+ const [whole, setWhole] = useState<Read | undefined>(undefined);
124
+ const [found, setFound] = useState<Read | undefined>(undefined);
125
+ const [busy, setBusy] = useState(false);
126
+ const [problem, setProblem] = useState<string | undefined>(undefined);
127
+ const couldNotLoad = words.couldNotLoad;
128
+
129
+ // What stands now is read each time the view is come to: the plate, then the open runs of
130
+ // the projects where a task of the plate says one is.
131
+ useEffect(() => {
132
+ if (view !== "now" || personId === undefined) {
133
+ return;
134
+ }
135
+ const controller = new AbortController();
136
+ setProblem(undefined);
137
+ client
138
+ .plate(controller.signal)
139
+ .then(async (work) => ({
140
+ work,
141
+ runs: await readOpenRuns(client, { tasks: work.tasks, personId }, controller.signal),
142
+ }))
143
+ .then((read) => {
144
+ if (!controller.signal.aborted) {
145
+ setStanding(read);
146
+ }
147
+ })
148
+ .catch((failure: unknown) => {
149
+ if (!controller.signal.aborted) {
150
+ setProblem(errorWords(failure, couldNotLoad));
151
+ }
152
+ });
153
+ return () => controller.abort();
154
+ }, [client, view, personId, couldNotLoad]);
155
+
156
+ // The closed work is read each time a view that shows it is come to, or its words change:
157
+ // the first page of each project, for the figures everything, for the archive what the
158
+ // words find.
159
+ const wanted = view === "archive" ? query : "";
160
+ const reads = view === "figures" || view === "archive";
161
+ useEffect(() => {
162
+ if (!reads || personId === undefined) {
163
+ return;
164
+ }
165
+ const controller = new AbortController();
166
+ setProblem(undefined);
167
+ setBusy(true);
168
+ readHistory(client, { projects, personId, words: wanted }, controller.signal)
169
+ .then((history) => {
170
+ if (!controller.signal.aborted) {
171
+ (wanted.length === 0 ? setWhole : setFound)({ words: wanted, pages: 1, history });
172
+ }
173
+ })
174
+ .catch((failure: unknown) => {
175
+ if (!controller.signal.aborted) {
176
+ setProblem(errorWords(failure, couldNotLoad));
177
+ }
178
+ })
179
+ .finally(() => {
180
+ if (!controller.signal.aborted) {
181
+ setBusy(false);
182
+ }
183
+ });
184
+ return () => controller.abort();
185
+ }, [client, reads, wanted, personId, projects, couldNotLoad]);
186
+
187
+ if (personId === undefined) {
188
+ return null;
189
+ }
190
+ const shown = wanted.length === 0 ? whole : found?.words === wanted ? found : undefined;
191
+ /** The next page of what is shown, joined to what was read. */
192
+ const onMore = () => {
193
+ if (shown === undefined || busy) {
194
+ return;
195
+ }
196
+ setBusy(true);
197
+ readHistory(client, { projects, personId, words: shown.words, page: shown.pages })
198
+ .then((history) => {
199
+ const next = {
200
+ words: shown.words,
201
+ pages: shown.pages + 1,
202
+ history: withHistory(shown.history, history),
203
+ };
204
+ (shown.words.length === 0 ? setWhole : setFound)(next);
205
+ })
206
+ .catch((failure: unknown) => setProblem(errorWords(failure, couldNotLoad)))
207
+ .finally(() => setBusy(false));
208
+ };
209
+ // A run that ended on a task still open has its title on the plate, where the plate was read.
210
+ const open = new Map((standing?.work.tasks ?? []).map(({ task }) => [task.id, task.title]));
211
+ const named = (runs: readonly DeskRun[]): readonly DeskRun[] =>
212
+ runs.map((run) =>
213
+ run.title === undefined ? { ...run, title: open.get(run.run.taskId) } : run,
214
+ );
215
+ const now = todayOf();
216
+ const loading = (
217
+ <div className="sc-loading">
218
+ <Spinner label={words.loading} />
219
+ </div>
220
+ );
221
+ const narrowed =
222
+ shown !== undefined && shown.history.of > shown.history.read ? (
223
+ <p className="sc-muted">{words.projectsRead(shown.history.read, shown.history.of)}</p>
224
+ ) : null;
225
+ return (
226
+ <>
227
+ <div className="sc-page-head">
228
+ <h1 className="sc-page-title">{words.title}</h1>
229
+ <p className="sc-page-lead">{words.lead}</p>
230
+ </div>
231
+ <DeskViews view={view} viewHref={(one) => deskHref(href, one)} />
232
+ {problem !== undefined && view !== "records" && <Callout tone="danger">{problem}</Callout>}
233
+ {view === "records" ? (
234
+ <DeskRecords
235
+ search={search}
236
+ href={href}
237
+ navigation={navigation}
238
+ reader={props.records}
239
+ weekStart={weekStart}
240
+ taskHref={taskHref}
241
+ />
242
+ ) : view === "now" ? (
243
+ standing === undefined ? (
244
+ problem === undefined && loading
245
+ ) : standing.work.tasks.length === 0 &&
246
+ standing.work.decisions.length === 0 &&
247
+ standing.runs.length === 0 ? (
248
+ <EmptyState title={words.now.empty.title} body={words.now.empty.body} />
249
+ ) : (
250
+ <DeskStanding
251
+ tasks={standing.work.tasks}
252
+ decisions={standing.work.decisions}
253
+ runs={standing.runs}
254
+ today={now}
255
+ taskHref={taskHref}
256
+ decisionHref={decisionHref}
257
+ />
258
+ )
259
+ ) : view === "figures" ? (
260
+ shown === undefined ? (
261
+ problem === undefined && loading
262
+ ) : (
263
+ <>
264
+ <DeskFiguresView
265
+ figures={figuresOf({
266
+ tasks: shown.history.tasks,
267
+ runs: shown.history.runs,
268
+ today: now,
269
+ firstDay: firstDayOfWeek(deviceLanguage(tag), weekStart),
270
+ })}
271
+ partial={
272
+ shown.history.more
273
+ ? { tasks: shown.pages * DESK_TASKS, runs: shown.pages * DESK_RUNS }
274
+ : undefined
275
+ }
276
+ />
277
+ {narrowed}
278
+ </>
279
+ )
280
+ ) : shown === undefined ? (
281
+ problem === undefined && loading
282
+ ) : (
283
+ <>
284
+ <DeskArchive
285
+ // Keyed by the words, so that the field says the words the address does.
286
+ key={shown.words}
287
+ tasks={shown.history.tasks}
288
+ runs={named(shown.history.runs)}
289
+ query={shown.words}
290
+ busy={busy}
291
+ onSearch={(next) => navigation.go(deskHref(href, "archive", next))}
292
+ more={shown.history.more}
293
+ onMore={onMore}
294
+ taskHref={taskHref}
295
+ />
296
+ {narrowed}
297
+ </>
298
+ )}
299
+ </>
300
+ );
301
+ }
302
+
303
+ /** The key a desk's page has unless a console names another: its address is `/pages/desk`. */
304
+ export const DESK_PAGE_KEY = "desk";
305
+
306
+ /**
307
+ * A desk's page for a console of one's own: `createConsole({ pages: [deskPage()] })` adds it as
308
+ * a tab among the workspace's, at `/pages/<key>`. `records` says what reads the desk's records,
309
+ * where that is not the page's own `fetch` at `/records`.
310
+ */
311
+ export function deskPage(
312
+ options: { readonly key?: string | undefined; readonly records?: RecordsReader | undefined } = {},
313
+ ): CustomPage {
314
+ const key = options.key ?? DESK_PAGE_KEY;
315
+ return {
316
+ key,
317
+ label: Object.fromEntries(
318
+ DEFAULT_LANGUAGES.map((language) => [language.tag, language.messages.desk.tab]),
319
+ ),
320
+ level: "workspace",
321
+ render: (context) => (
322
+ <DeskPage
323
+ client={context.client}
324
+ data={context.data}
325
+ search={context.search}
326
+ href={customPageHref(key)}
327
+ navigation={context.navigation}
328
+ records={options.records}
329
+ />
330
+ ),
331
+ };
332
+ }
@@ -0,0 +1,256 @@
1
+ import { useEffect, useMemo, useState } from "react";
2
+ import type { WeekStart } from "./api.js";
3
+ import {
4
+ DeskCollectionResults,
5
+ DeskCollections,
6
+ DeskCollectionView,
7
+ type DeskFile,
8
+ DeskItemView,
9
+ DeskNoRecords,
10
+ DeskRecordCrumbs,
11
+ DeskRecordProblems,
12
+ } from "./components/desk-records.js";
13
+ import { EmptyState, LinkButton, Spinner } from "./components/ui.js";
14
+ import { deviceLanguage, firstDayOfWeek, today as todayOf } from "./dates.js";
15
+ import {
16
+ bestItems,
17
+ type CollectionRecords,
18
+ fileSrc,
19
+ itemResults,
20
+ probeFile,
21
+ RECORDS_BASE,
22
+ type RecordFileState,
23
+ type RecordsAddress,
24
+ type RecordsOverview,
25
+ type RecordsReader,
26
+ readCollection,
27
+ readDeskRecords,
28
+ recordsAddressOf,
29
+ recordsQuery,
30
+ resultsOf,
31
+ } from "./desk-records.js";
32
+ import { useLanguage, useWords } from "./i18n/index.js";
33
+ import type { Navigation } from "./router.js";
34
+
35
+ // The records' view of a desk's page (ADR-0117): what the desk's member made and what became
36
+ // of it, read from the files the desk keeps under `records/`, which the server that serves the
37
+ // pages serves beside them. The address says what is shown (ADR-0010): the collections, one
38
+ // collection with its items narrowed by status, one item, or a collection's results. Every
39
+ // file is read again each time its view is come to, so that what an agent just wrote is there.
40
+
41
+ /** The reader of a page in a browser: the page's own `fetch`, at the place the records are served. */
42
+ function ownReader(): RecordsReader {
43
+ return { fetch: (path, init) => globalThis.fetch(path, init) };
44
+ }
45
+
46
+ export interface DeskRecordsProps {
47
+ /** The query of the address the page is at. */
48
+ readonly search: string;
49
+ /** The page's own address, without a query. */
50
+ readonly href: string;
51
+ readonly navigation: Navigation;
52
+ /** What reads the records; the page's own `fetch` at `/records` where left out. */
53
+ readonly reader?: RecordsReader | undefined;
54
+ /** The day the week begins on, as the workspace says. */
55
+ readonly weekStart?: WeekStart | undefined;
56
+ /** Where a task of the board is, for an item that names one. */
57
+ readonly taskHref: (projectKey: string, taskNumber: number) => string;
58
+ }
59
+
60
+ export function DeskRecords(props: DeskRecordsProps) {
61
+ const words = useWords().desk.records;
62
+ const { tag } = useLanguage();
63
+ const { search, href, navigation } = props;
64
+ const address = recordsAddressOf(search);
65
+ const key = address.collection;
66
+ const given = props.reader;
67
+ const reader = useMemo(() => given ?? ownReader(), [given]);
68
+ const base = reader.base ?? RECORDS_BASE;
69
+ const at = (next: RecordsAddress): string => {
70
+ const query = recordsQuery(next);
71
+ return query.length === 0 ? href : `${href}?${query}`;
72
+ };
73
+
74
+ const [overview, setOverview] = useState<RecordsOverview | undefined>(undefined);
75
+ const [records, setRecords] = useState<CollectionRecords | undefined>(undefined);
76
+ const [probed, setProbed] = useState<
77
+ { readonly of: string; readonly states: readonly RecordFileState[] } | undefined
78
+ >(undefined);
79
+
80
+ // The collections, read each time the list is come to.
81
+ useEffect(() => {
82
+ if (key !== undefined) {
83
+ return;
84
+ }
85
+ const controller = new AbortController();
86
+ readDeskRecords(reader, controller.signal)
87
+ .then((read) => {
88
+ if (!controller.signal.aborted) {
89
+ setOverview(read);
90
+ }
91
+ })
92
+ .catch(() => undefined);
93
+ return () => controller.abort();
94
+ }, [reader, key]);
95
+
96
+ // One collection, read each time it is come to: its items, its uses and its metrics.
97
+ useEffect(() => {
98
+ if (key === undefined) {
99
+ return;
100
+ }
101
+ const controller = new AbortController();
102
+ setRecords((held) => (held?.key === key ? held : undefined));
103
+ readCollection(reader, key, controller.signal)
104
+ .then((read) => {
105
+ if (!controller.signal.aborted) {
106
+ setRecords(read);
107
+ }
108
+ })
109
+ .catch(() => undefined);
110
+ return () => controller.abort();
111
+ }, [reader, key]);
112
+
113
+ const held = records?.key === key ? records : undefined;
114
+ const item =
115
+ address.item === undefined ? undefined : held?.items.find((one) => one.id === address.item);
116
+ const named = item?.files;
117
+ const itemId = item?.id;
118
+
119
+ // The files of the item shown: each asked of the server for what it is, by its first bytes.
120
+ useEffect(() => {
121
+ if (key === undefined || itemId === undefined || named === undefined || named.length === 0) {
122
+ return;
123
+ }
124
+ const of = `${key}/${itemId}`;
125
+ const controller = new AbortController();
126
+ Promise.all(named.map((file) => probeFile(reader, key, file.path, controller.signal)))
127
+ .then((states) => {
128
+ if (!controller.signal.aborted) {
129
+ setProbed({ of, states });
130
+ }
131
+ })
132
+ .catch(() => undefined);
133
+ return () => controller.abort();
134
+ }, [reader, key, itemId, named]);
135
+
136
+ const loading = (
137
+ <div className="sc-loading">
138
+ <Spinner label={words.loading} />
139
+ </div>
140
+ );
141
+
142
+ if (key === undefined) {
143
+ if (overview === undefined) {
144
+ return loading;
145
+ }
146
+ if (overview.kind === "none") {
147
+ return <DeskNoRecords />;
148
+ }
149
+ return (
150
+ <div className="sc-desk-records">
151
+ <DeskRecordProblems problems={overview.problems} />
152
+ <DeskCollections
153
+ collections={overview.collections}
154
+ collectionHref={(collection) => at({ collection })}
155
+ />
156
+ </div>
157
+ );
158
+ }
159
+
160
+ if (held === undefined) {
161
+ return loading;
162
+ }
163
+ const title = held.collection?.title ?? key;
164
+ if (!held.found) {
165
+ return (
166
+ <div className="sc-desk-records">
167
+ <DeskRecordCrumbs steps={[{ label: words.crumb, href: at({}) }, { label: key }]} />
168
+ <EmptyState title={words.noSuchCollection.title} body={words.noSuchCollection.body} />
169
+ </div>
170
+ );
171
+ }
172
+ if (address.item !== undefined) {
173
+ const states = probed?.of === `${key}/${address.item}` ? probed.states : undefined;
174
+ const files: readonly DeskFile[] = (item?.files ?? []).map((file, index) => ({
175
+ label: file.label,
176
+ src: fileSrc(key, file.path, base),
177
+ state: states?.[index] ?? { kind: "reading" },
178
+ }));
179
+ return (
180
+ <div className="sc-desk-records">
181
+ <DeskRecordCrumbs
182
+ steps={[
183
+ { label: words.crumb, href: at({}) },
184
+ { label: title, href: at({ collection: key }) },
185
+ { label: item?.title ?? address.item },
186
+ ]}
187
+ />
188
+ <DeskRecordProblems problems={held.problems} />
189
+ {item === undefined ? (
190
+ <EmptyState title={words.noSuchItem.title} body={words.noSuchItem.body} />
191
+ ) : (
192
+ <DeskItemView
193
+ collectionKey={key}
194
+ collection={held.collection}
195
+ item={item}
196
+ uses={held.uses.filter((use) => use.item === item.id)}
197
+ results={itemResults(held.collection, held.metrics, item.id)}
198
+ files={files}
199
+ taskHref={props.taskHref}
200
+ base={base}
201
+ />
202
+ )}
203
+ </div>
204
+ );
205
+ }
206
+ const results = address.results === true;
207
+ const figured = (held.collection?.metrics ?? []).length > 0;
208
+ return (
209
+ <div className="sc-desk-records">
210
+ <DeskRecordCrumbs steps={[{ label: words.crumb, href: at({}) }, { label: title }]} />
211
+ <div className="sc-section-head">
212
+ <h2 className="sc-section-title">{title}</h2>
213
+ {figured && (
214
+ <LinkButton href={at(results ? { collection: key } : { collection: key, results: true })}>
215
+ {results ? words.showItems : words.showResults}
216
+ </LinkButton>
217
+ )}
218
+ </div>
219
+ {held.collection?.description !== undefined && held.collection.description.length > 0 && (
220
+ <p className="sc-lead">{held.collection.description}</p>
221
+ )}
222
+ <DeskRecordProblems problems={held.problems} />
223
+ {results ? (
224
+ <DeskCollectionResults
225
+ collection={held.collection}
226
+ results={resultsOf({
227
+ collection: held.collection,
228
+ rows: held.metrics,
229
+ today: todayOf(),
230
+ firstDay: firstDayOfWeek(deviceLanguage(tag), props.weekStart),
231
+ })}
232
+ best={bestItems({
233
+ collection: held.collection,
234
+ items: held.items,
235
+ rows: held.metrics,
236
+ by: address.by,
237
+ })}
238
+ onBy={(by) => navigation.go(at({ collection: key, results: true, by }))}
239
+ itemHref={(id) => at({ collection: key, item: id })}
240
+ />
241
+ ) : (
242
+ <DeskCollectionView
243
+ // Keyed by how the items are narrowed, so that a list narrowed anew starts at its first page.
244
+ key={address.status ?? ""}
245
+ collectionKey={key}
246
+ collection={held.collection}
247
+ items={held.items}
248
+ status={address.status}
249
+ onStatus={(status) => navigation.go(at({ collection: key, status }))}
250
+ itemHref={(id) => at({ collection: key, item: id })}
251
+ base={base}
252
+ />
253
+ )}
254
+ </div>
255
+ );
256
+ }