@skillcdn/console 0.5.1 → 0.5.3

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 (292) hide show
  1. package/README.md +20 -2
  2. package/dist/agent-page.d.ts.map +1 -1
  3. package/dist/agent-page.js +4 -4
  4. package/dist/agent-page.js.map +1 -1
  5. package/dist/api.d.ts +5 -4
  6. package/dist/api.d.ts.map +1 -1
  7. package/dist/api.js +5 -4
  8. package/dist/api.js.map +1 -1
  9. package/dist/cli/cli.d.ts +32 -0
  10. package/dist/cli/cli.d.ts.map +1 -1
  11. package/dist/cli/cli.js +442 -93
  12. package/dist/cli/cli.js.map +1 -1
  13. package/dist/cli/format.d.ts +6 -2
  14. package/dist/cli/format.d.ts.map +1 -1
  15. package/dist/cli/format.js +25 -3
  16. package/dist/cli/format.js.map +1 -1
  17. package/dist/cli/help.d.ts.map +1 -1
  18. package/dist/cli/help.js +10 -5
  19. package/dist/cli/help.js.map +1 -1
  20. package/dist/cli/machine-check.d.ts +36 -0
  21. package/dist/cli/machine-check.d.ts.map +1 -0
  22. package/dist/cli/machine-check.js +151 -0
  23. package/dist/cli/machine-check.js.map +1 -0
  24. package/dist/cli/runner-host.d.ts +7 -0
  25. package/dist/cli/runner-host.d.ts.map +1 -1
  26. package/dist/cli/runner-host.js +2 -0
  27. package/dist/cli/runner-host.js.map +1 -1
  28. package/dist/cli/secret-notes.d.ts +8 -0
  29. package/dist/cli/secret-notes.d.ts.map +1 -0
  30. package/dist/cli/secret-notes.js +48 -0
  31. package/dist/cli/secret-notes.js.map +1 -0
  32. package/dist/client.d.ts +7 -1
  33. package/dist/client.d.ts.map +1 -1
  34. package/dist/client.js +6 -1
  35. package/dist/client.js.map +1 -1
  36. package/dist/components/agent-page.d.ts +106 -13
  37. package/dist/components/agent-page.d.ts.map +1 -1
  38. package/dist/components/agent-page.js +391 -102
  39. package/dist/components/agent-page.js.map +1 -1
  40. package/dist/components/agents.d.ts.map +1 -1
  41. package/dist/components/agents.js +1 -1
  42. package/dist/components/agents.js.map +1 -1
  43. package/dist/components/board.d.ts.map +1 -1
  44. package/dist/components/board.js +3 -2
  45. package/dist/components/board.js.map +1 -1
  46. package/dist/components/categories.js +1 -1
  47. package/dist/components/categories.js.map +1 -1
  48. package/dist/components/decision-list.d.ts.map +1 -1
  49. package/dist/components/decision-list.js +1 -1
  50. package/dist/components/decision-list.js.map +1 -1
  51. package/dist/components/event-feed.d.ts.map +1 -1
  52. package/dist/components/event-feed.js +3 -2
  53. package/dist/components/event-feed.js.map +1 -1
  54. package/dist/components/goals.d.ts +2 -0
  55. package/dist/components/goals.d.ts.map +1 -1
  56. package/dist/components/goals.js +1 -1
  57. package/dist/components/goals.js.map +1 -1
  58. package/dist/components/home.d.ts.map +1 -1
  59. package/dist/components/home.js +13 -15
  60. package/dist/components/home.js.map +1 -1
  61. package/dist/components/icon.d.ts +31 -0
  62. package/dist/components/icon.d.ts.map +1 -0
  63. package/dist/components/icon.js +169 -0
  64. package/dist/components/icon.js.map +1 -0
  65. package/dist/components/markdown.d.ts +6 -0
  66. package/dist/components/markdown.d.ts.map +1 -1
  67. package/dist/components/markdown.js +10 -2
  68. package/dist/components/markdown.js.map +1 -1
  69. package/dist/components/people.js +1 -1
  70. package/dist/components/people.js.map +1 -1
  71. package/dist/components/plugin-frame.d.ts.map +1 -1
  72. package/dist/components/plugin-frame.js +7 -0
  73. package/dist/components/plugin-frame.js.map +1 -1
  74. package/dist/components/projects.d.ts +17 -4
  75. package/dist/components/projects.d.ts.map +1 -1
  76. package/dist/components/projects.js +25 -6
  77. package/dist/components/projects.js.map +1 -1
  78. package/dist/components/sessions.d.ts.map +1 -1
  79. package/dist/components/sessions.js +3 -2
  80. package/dist/components/sessions.js.map +1 -1
  81. package/dist/components/setup.d.ts.map +1 -1
  82. package/dist/components/setup.js +2 -2
  83. package/dist/components/setup.js.map +1 -1
  84. package/dist/components/shell.d.ts.map +1 -1
  85. package/dist/components/shell.js +3 -2
  86. package/dist/components/shell.js.map +1 -1
  87. package/dist/components/tokens.js +1 -1
  88. package/dist/components/tokens.js.map +1 -1
  89. package/dist/components/ui.d.ts +5 -2
  90. package/dist/components/ui.d.ts.map +1 -1
  91. package/dist/components/ui.js +10 -7
  92. package/dist/components/ui.js.map +1 -1
  93. package/dist/connect-page.js +1 -1
  94. package/dist/connect-page.js.map +1 -1
  95. package/dist/console.css +473 -77
  96. package/dist/console.d.ts.map +1 -1
  97. package/dist/console.js +38 -31
  98. package/dist/console.js.map +1 -1
  99. package/dist/home-tiles.d.ts +24 -33
  100. package/dist/home-tiles.d.ts.map +1 -1
  101. package/dist/home-tiles.js +65 -259
  102. package/dist/home-tiles.js.map +1 -1
  103. package/dist/i18n/en.d.ts +49 -2
  104. package/dist/i18n/en.d.ts.map +1 -1
  105. package/dist/i18n/en.js +126 -3
  106. package/dist/i18n/en.js.map +1 -1
  107. package/dist/i18n/ko.d.ts.map +1 -1
  108. package/dist/i18n/ko.js +197 -79
  109. package/dist/i18n/ko.js.map +1 -1
  110. package/dist/i18n/particles.d.ts +7 -0
  111. package/dist/i18n/particles.d.ts.map +1 -0
  112. package/dist/i18n/particles.js +72 -0
  113. package/dist/i18n/particles.js.map +1 -0
  114. package/dist/icons/glyphs.d.ts +605 -0
  115. package/dist/icons/glyphs.d.ts.map +1 -0
  116. package/dist/icons/glyphs.js +104 -0
  117. package/dist/icons/glyphs.js.map +1 -0
  118. package/dist/icons/index.d.ts +59 -0
  119. package/dist/icons/index.d.ts.map +1 -0
  120. package/dist/icons/index.js +157 -0
  121. package/dist/icons/index.js.map +1 -0
  122. package/dist/index.d.ts +1 -0
  123. package/dist/index.d.ts.map +1 -1
  124. package/dist/index.js +1 -0
  125. package/dist/index.js.map +1 -1
  126. package/dist/limits.d.ts +9 -0
  127. package/dist/limits.d.ts.map +1 -1
  128. package/dist/limits.js +9 -0
  129. package/dist/limits.js.map +1 -1
  130. package/dist/marks.d.ts +9 -0
  131. package/dist/marks.d.ts.map +1 -1
  132. package/dist/marks.js +9 -0
  133. package/dist/marks.js.map +1 -1
  134. package/dist/onboarding.js +3 -3
  135. package/dist/onboarding.js.map +1 -1
  136. package/dist/plugin/manifest.d.ts.map +1 -1
  137. package/dist/plugin/manifest.js +3 -2
  138. package/dist/plugin/manifest.js.map +1 -1
  139. package/dist/plugin/web.d.ts +3 -0
  140. package/dist/plugin/web.d.ts.map +1 -1
  141. package/dist/plugin/web.js +5 -1
  142. package/dist/plugin/web.js.map +1 -1
  143. package/dist/runner/acp.d.ts.map +1 -1
  144. package/dist/runner/acp.js +2 -2
  145. package/dist/runner/acp.js.map +1 -1
  146. package/dist/runner/awake.d.ts +35 -0
  147. package/dist/runner/awake.d.ts.map +1 -0
  148. package/dist/runner/awake.js +95 -0
  149. package/dist/runner/awake.js.map +1 -0
  150. package/dist/runner/claude.d.ts.map +1 -1
  151. package/dist/runner/claude.js +19 -7
  152. package/dist/runner/claude.js.map +1 -1
  153. package/dist/runner/codex.d.ts.map +1 -1
  154. package/dist/runner/codex.js +2 -2
  155. package/dist/runner/codex.js.map +1 -1
  156. package/dist/runner/config.d.ts +5 -0
  157. package/dist/runner/config.d.ts.map +1 -1
  158. package/dist/runner/config.js +9 -0
  159. package/dist/runner/config.js.map +1 -1
  160. package/dist/runner/desk.d.ts.map +1 -1
  161. package/dist/runner/desk.js +5 -6
  162. package/dist/runner/desk.js.map +1 -1
  163. package/dist/runner/runner.d.ts +13 -2
  164. package/dist/runner/runner.d.ts.map +1 -1
  165. package/dist/runner/runner.js +141 -22
  166. package/dist/runner/runner.js.map +1 -1
  167. package/dist/runner/slack.d.ts.map +1 -1
  168. package/dist/runner/slack.js +10 -4
  169. package/dist/runner/slack.js.map +1 -1
  170. package/dist/runner/types.d.ts +15 -0
  171. package/dist/runner/types.d.ts.map +1 -1
  172. package/dist/runner/types.js +9 -0
  173. package/dist/runner/types.js.map +1 -1
  174. package/dist/schemas.d.ts +94 -1
  175. package/dist/schemas.d.ts.map +1 -1
  176. package/dist/schemas.js +81 -5
  177. package/dist/schemas.js.map +1 -1
  178. package/dist/services.d.ts.map +1 -1
  179. package/dist/services.js +9 -5
  180. package/dist/services.js.map +1 -1
  181. package/dist/setup-guide.d.ts +14 -3
  182. package/dist/setup-guide.d.ts.map +1 -1
  183. package/dist/setup-guide.js +41 -37
  184. package/dist/setup-guide.js.map +1 -1
  185. package/dist/tokens.d.ts.map +1 -1
  186. package/dist/tokens.js +5 -1
  187. package/dist/tokens.js.map +1 -1
  188. package/dist/vocabulary.d.ts +7 -0
  189. package/dist/vocabulary.d.ts.map +1 -1
  190. package/dist/vocabulary.js +6 -0
  191. package/dist/vocabulary.js.map +1 -1
  192. package/docs/specs/cli.md +10 -7
  193. package/docs/specs/plugins.md +18 -7
  194. package/docs/specs/rest.md +10 -8
  195. package/docs/specs/runner.md +26 -8
  196. package/package.json +7 -3
  197. package/skills/building-a-console/SKILL.md +2 -2
  198. package/skills/building-a-plugin/SKILL.md +3 -3
  199. package/skills/keeping-a-desk/SKILL.md +2 -2
  200. package/skills/running-an-agent/SKILL.md +47 -57
  201. package/skills/working-the-board/SKILL.md +5 -4
  202. package/skills/working-the-board/references/the-pack.md +1 -1
  203. package/src/agent-page.tsx +13 -1
  204. package/src/api.ts +32 -1
  205. package/src/cli/cli.ts +530 -106
  206. package/src/cli/format.ts +31 -3
  207. package/src/cli/help.ts +12 -4
  208. package/src/cli/machine-check.ts +223 -0
  209. package/src/cli/runner-host.ts +8 -0
  210. package/src/cli/secret-notes.ts +63 -0
  211. package/src/client.ts +23 -0
  212. package/src/components/agent-page.tsx +629 -112
  213. package/src/components/agents.tsx +9 -5
  214. package/src/components/board.tsx +3 -15
  215. package/src/components/categories.tsx +2 -2
  216. package/src/components/decision-list.tsx +11 -7
  217. package/src/components/event-feed.tsx +7 -2
  218. package/src/components/goals.tsx +33 -25
  219. package/src/components/home.tsx +29 -26
  220. package/src/components/icon.tsx +337 -0
  221. package/src/components/markdown.tsx +22 -2
  222. package/src/components/people.tsx +1 -1
  223. package/src/components/plugin-frame.tsx +7 -0
  224. package/src/components/projects.tsx +39 -5
  225. package/src/components/sessions.tsx +2 -13
  226. package/src/components/setup.tsx +2 -2
  227. package/src/components/shell.tsx +3 -20
  228. package/src/components/tokens.tsx +1 -1
  229. package/src/components/ui.tsx +16 -8
  230. package/src/connect-page.tsx +1 -1
  231. package/src/console.tsx +87 -53
  232. package/src/home-tiles.ts +76 -291
  233. package/src/i18n/en.ts +128 -3
  234. package/src/i18n/ko.ts +200 -79
  235. package/src/i18n/particles.ts +79 -0
  236. package/src/icons/glyphs.ts +112 -0
  237. package/src/icons/index.ts +195 -0
  238. package/src/index.ts +7 -0
  239. package/src/limits.ts +9 -0
  240. package/src/marks.ts +12 -0
  241. package/src/onboarding.ts +3 -3
  242. package/src/plugin/manifest.ts +3 -2
  243. package/src/plugin/web.ts +9 -2
  244. package/src/runner/acp.ts +2 -1
  245. package/src/runner/awake.ts +135 -0
  246. package/src/runner/claude.ts +19 -4
  247. package/src/runner/codex.ts +2 -1
  248. package/src/runner/config.ts +9 -0
  249. package/src/runner/desk.ts +5 -6
  250. package/src/runner/runner.ts +183 -23
  251. package/src/runner/slack.ts +10 -4
  252. package/src/runner/types.ts +20 -0
  253. package/src/schemas.ts +94 -3
  254. package/src/services.ts +9 -5
  255. package/src/setup-guide.ts +43 -38
  256. package/src/styles/README.md +5 -4
  257. package/src/styles/base.css +17 -0
  258. package/src/styles/console.css +1 -0
  259. package/src/styles/drawn-by-pages.json +1 -1
  260. package/src/styles/pages/agents.css +103 -1
  261. package/src/styles/pages/board.css +0 -10
  262. package/src/styles/pages/calendar.css +1 -1
  263. package/src/styles/pages/connect.css +0 -10
  264. package/src/styles/pages/decisions.css +3 -1
  265. package/src/styles/pages/feed.css +5 -2
  266. package/src/styles/pages/home.css +5 -0
  267. package/src/styles/pages/roadmap.css +2 -2
  268. package/src/styles/pages/settings.css +11 -0
  269. package/src/styles/pages/task.css +0 -20
  270. package/src/styles/pages/thread.css +1 -1
  271. package/src/styles/parts/calendar.css +1 -1
  272. package/src/styles/parts/callout.css +1 -0
  273. package/src/styles/parts/detail.css +22 -0
  274. package/src/styles/parts/empty.css +2 -0
  275. package/src/styles/parts/eyebrow.css +1 -1
  276. package/src/styles/parts/facts.css +1 -1
  277. package/src/styles/parts/figures.css +1 -1
  278. package/src/styles/parts/form.css +2 -1
  279. package/src/styles/parts/icon.css +191 -0
  280. package/src/styles/parts/input.css +14 -4
  281. package/src/styles/parts/mark.css +36 -0
  282. package/src/styles/parts/menu.css +1 -7
  283. package/src/styles/parts/page.css +1 -1
  284. package/src/styles/parts/panel.css +10 -0
  285. package/src/styles/parts/person.css +5 -2
  286. package/src/styles/parts/progress.css +5 -2
  287. package/src/styles/parts/rows.css +1 -0
  288. package/src/styles/parts/settings.css +5 -0
  289. package/src/styles/parts/stat.css +1 -1
  290. package/src/styles/tokens.css +22 -7
  291. package/src/tokens.ts +5 -1
  292. package/src/vocabulary.ts +9 -0
@@ -7,11 +7,14 @@ import { useRemotePictureSrc } from "./remote-pictures.js";
7
7
  // What people and agents write is untrusted. It is rendered as React elements, never as HTML:
8
8
  // raw HTML in the source stays text, links are limited to a few schemes and open elsewhere,
9
9
  // and a picture from elsewhere, named over https, is read through the console (ADR-0048),
10
- // lazily and without a referrer. A link whose destination is a document's path (ADR-0009)
11
- // leads to the document's page, when the page knows where.
10
+ // lazily and without a referrer, or, where the page says so, not read at all and left a link
11
+ // (ADR-0141). A link whose destination is a document's path (ADR-0009) leads to the document's
12
+ // page, when the page knows where.
12
13
 
13
14
  const SAFE_LINK = /^(https?:|mailto:)/i;
14
15
  const SAFE_IMAGE = /^https:\/\//i;
16
+ /** Where a picture left unread may lead whoever opens it: a page, over the web. */
17
+ const SAFE_PICTURE_LINK = /^https?:\/\//i;
15
18
 
16
19
  export interface MarkdownProps {
17
20
  readonly source: string;
@@ -28,6 +31,12 @@ export interface MarkdownProps {
28
31
  * left out, such a picture is only seen where it is.
29
32
  */
30
33
  readonly onOpenPicture?: ((picture: Picture, opener: HTMLElement) => void) | undefined;
34
+ /**
35
+ * Whether a picture named in the text is left unread: shown as its words, a link to where it
36
+ * is for whoever chooses to open it, and nothing fetched by the page showing the text. For
37
+ * what an agent's session wrote, which nobody looked at before it is shown (ADR-0141).
38
+ */
39
+ readonly picturesAsLinks?: boolean | undefined;
31
40
  }
32
41
 
33
42
  export function Markdown(props: MarkdownProps) {
@@ -63,6 +72,17 @@ export function Markdown(props: MarkdownProps) {
63
72
  return <span>{children}</span>;
64
73
  },
65
74
  img({ src, alt, title }) {
75
+ if (props.picturesAsLinks === true) {
76
+ const where = typeof src === "string" ? src : "";
77
+ const words = alt === undefined || alt.length === 0 ? where : alt;
78
+ return SAFE_PICTURE_LINK.test(where) ? (
79
+ <a href={where} target="_blank" rel="noopener noreferrer nofollow ugc">
80
+ {words}
81
+ </a>
82
+ ) : (
83
+ <span className="sc-prose-image-text">{words}</span>
84
+ );
85
+ }
66
86
  const named = typeof src === "string" ? props.fileSrc?.(src) : undefined;
67
87
  const url =
68
88
  named ?? (typeof src === "string" && SAFE_IMAGE.test(src) ? remote(src) : undefined);
@@ -245,7 +245,7 @@ export function PeopleList(props: PeopleListProps) {
245
245
  <span className="sc-person-you">{words.common.you}</span>
246
246
  )}
247
247
  </span>
248
- {title !== "" && <span className="sc-person-card-title">{title}</span>}
248
+ {title !== "" && !writesTitle && <span className="sc-person-card-title">{title}</span>}
249
249
  <span className="sc-person-card-note">
250
250
  {typeof person.handle === "string" && <>@{person.handle} · </>}
251
251
  {person.name !== null && <>{person.login} · </>}
@@ -490,6 +490,13 @@ export function PluginFrame(props: PluginFrameProps) {
490
490
  // sandbox so that the page it shows is a page as any.
491
491
  sandbox="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox"
492
492
  referrerPolicy="origin"
493
+ // A page's frame is as tall as its page, and the console's page is what scrolls: the frame
494
+ // never scrolls itself, whatever its document's overflow, as the HTML standard renders
495
+ // `scrolling="no"`. A frame shorter than its page, by the fraction of a pixel a rounding
496
+ // leaves or while its height catches up with a page that grew, would otherwise take the
497
+ // wheel over it, and Firefox holds the wheel to what it scrolled first. A page at the most
498
+ // a frame grows to scrolls the rest of itself inside.
499
+ scrolling={isWidget || height >= MAX_PAGE_HEIGHT ? undefined : "no"}
493
500
  // Loaded, with its scripts run: a page that never says it is ready is shown as it is.
494
501
  onLoad={drawnSoon}
495
502
  />
@@ -2,6 +2,7 @@ import { type FormEvent, type ReactNode, useEffect, useState } from "react";
2
2
  import {
3
3
  COLOR_NAMES,
4
4
  type ColorName,
5
+ type IconName,
5
6
  MAX_PROJECT_DESCRIPTION_LENGTH,
6
7
  MAX_PROJECT_ICON_BYTES,
7
8
  MAX_PROJECT_KEY_LENGTH,
@@ -14,6 +15,7 @@ import {
14
15
  type ProjectRole,
15
16
  type ProjectVisibility,
16
17
  projectColorOf,
18
+ projectGlyphOf,
17
19
  projectIconPath,
18
20
  projectSymbolOf,
19
21
  type RestMember,
@@ -24,13 +26,15 @@ import {
24
26
  type RestProjectPatch,
25
27
  } from "../api.js";
26
28
  import { useWords } from "../i18n/index.js";
29
+ import { Icon, IconPicker } from "./icon.js";
27
30
  import { Picker } from "./picker.js";
28
31
  import { peopleSearch } from "./searches.js";
29
32
  import { Badge, Button, cx, PersonChip, PersonOption, personName, Time } from "./ui.js";
30
33
 
31
34
  /**
32
- * A project's mark: its symbol on its colour, so that projects tell apart at a glance; its own
33
- * image over the symbol where it has one, so that the mark is never empty while the image loads.
35
+ * A project's mark: its symbol on its colour, so that projects tell apart at a glance, or an
36
+ * icon of the pack in the symbol's place where it names one (ADR-0142); its own image over
37
+ * either where it has one, so that the mark is never empty while the image loads.
34
38
  */
35
39
  export function ProjectMark(props: {
36
40
  readonly project: {
@@ -38,7 +42,9 @@ export function ProjectMark(props: {
38
42
  readonly name: string;
39
43
  readonly color: ColorName | null;
40
44
  readonly symbol: string | null;
41
- /** The project's own image, when it has one; the symbol on the colour otherwise. */
45
+ /** The icon of the pack shown in the symbol's place, by its name, where the project names one. */
46
+ readonly glyph?: string | null | undefined;
47
+ /** The project's own image, when it has one; the symbol or the icon on the colour otherwise. */
42
48
  readonly icon?: { readonly sha256: string } | null | undefined;
43
49
  };
44
50
  readonly size?: "sm" | "md" | "lg";
@@ -54,6 +60,7 @@ export function ProjectMark(props: {
54
60
  const [shown, setShown] = useState<string | undefined>(undefined);
55
61
  const [failed, setFailed] = useState<string | undefined>(undefined);
56
62
  const pictured = src !== undefined && failed !== src;
63
+ const glyph = projectGlyphOf(props.project);
57
64
  return (
58
65
  <span
59
66
  className={cx(
@@ -64,7 +71,8 @@ export function ProjectMark(props: {
64
71
  )}
65
72
  aria-hidden="true"
66
73
  >
67
- {(!pictured || shown !== src) && projectSymbolOf(props.project)}
74
+ {(!pictured || shown !== src) &&
75
+ (glyph === undefined ? projectSymbolOf(props.project) : <Icon name={glyph} />)}
68
76
  {pictured && (
69
77
  <img
70
78
  className="sc-mark-image"
@@ -128,6 +136,20 @@ export function keyOf(name: string): string {
128
136
  .slice(0, MAX_PROJECT_KEY_LENGTH);
129
137
  }
130
138
 
139
+ /**
140
+ * What a save says of a project's icon: the one chosen where the form changed it, and nothing
141
+ * where it did not. A console older than the field refuses nothing it was not sent, a project
142
+ * that never had an icon is sent none, and an icon this page's pack does not have, one of a
143
+ * newer console's, which the form shows as none, stays the project's when something else is
144
+ * saved.
145
+ */
146
+ export function glyphChange(
147
+ before: IconName | null,
148
+ chosen: IconName | null,
149
+ ): { readonly glyph?: IconName | null } {
150
+ return chosen === before ? {} : { glyph: chosen };
151
+ }
152
+
131
153
  export function ProjectForm(props: ProjectFormProps) {
132
154
  const words = useWords();
133
155
  const form = words.projects.form;
@@ -140,6 +162,10 @@ export function ProjectForm(props: ProjectFormProps) {
140
162
  const [skillsAddress, setSkillsAddress] = useState(project?.skillsAddress ?? "");
141
163
  const [color, setColor] = useState<ColorName | "">(project?.color ?? "");
142
164
  const [symbol, setSymbol] = useState(project?.symbol ?? "");
165
+ /** The icon the project has, where this page's pack has it: what the form begins with, and what a save is held against. */
166
+ const glyphBefore: IconName | null =
167
+ project === undefined ? null : (projectGlyphOf(project) ?? null);
168
+ const [glyph, setGlyph] = useState<IconName | null>(glyphBefore);
143
169
  /** The image for the mark: a file chosen, `null` for none any more, nothing to keep the project's. */
144
170
  const [icon, setIcon] = useState<File | null | undefined>(undefined);
145
171
  // The image chosen, as an address the mark can show before it is saved: the file's own bytes,
@@ -177,6 +203,7 @@ export function ProjectForm(props: ProjectFormProps) {
177
203
  name: name.trim() === "" ? "?" : name.trim(),
178
204
  color: color === "" ? null : color,
179
205
  symbol: symbol.trim() === "" ? null : symbol.trim(),
206
+ glyph,
180
207
  icon: icon instanceof File ? { sha256: "chosen" } : kept,
181
208
  };
182
209
 
@@ -189,6 +216,7 @@ export function ProjectForm(props: ProjectFormProps) {
189
216
  skillsAddress: skillsAddress.trim() === "" ? null : skillsAddress.trim(),
190
217
  color: preview.color,
191
218
  symbol: preview.symbol,
219
+ ...glyphChange(glyphBefore, glyph),
192
220
  };
193
221
  props.onSubmit(
194
222
  project === undefined ? { key: key.trim(), ...settings, name: name.trim() } : settings,
@@ -278,6 +306,10 @@ export function ProjectForm(props: ProjectFormProps) {
278
306
  </div>
279
307
  <div className="sc-field-row sc-mark-row">
280
308
  <ProjectMark project={preview} size="lg" iconSrc={chosenSrc} />
309
+ <div className="sc-field">
310
+ <span className="sc-field-label">{form.icon}</span>
311
+ <IconPicker value={glyph} label={form.icon} onChange={setGlyph} />
312
+ </div>
281
313
  <label className="sc-field">
282
314
  <span className="sc-field-label">{form.symbol}</span>
283
315
  <input
@@ -417,7 +449,9 @@ export function MemberList(props: MemberListProps) {
417
449
  {member.person.name ?? ""}
418
450
  <span className="sc-muted">
419
451
  {" "}
420
- {members.since} <Time iso={member.addedAt} />
452
+ {members.since.before}
453
+ <Time iso={member.addedAt} />
454
+ {members.since.after}
421
455
  </span>
422
456
  </span>
423
457
  {props.onChangeRole === undefined || member.person.role === "admin" ? (
@@ -1,6 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { RestSession } from "../api.js";
3
3
  import { useWords } from "../i18n/index.js";
4
+ import { Icon } from "./icon.js";
4
5
  import { Badge, Button, cx, Time } from "./ui.js";
5
6
 
6
7
  // The browsers a person is signed in on (board #309), on a page of the settings of their own: each
@@ -26,19 +27,7 @@ const HANDHELD: ReadonlySet<string> = new Set(["iOS", "Android"]);
26
27
  function DeviceIcon(props: { readonly handheld: boolean }) {
27
28
  return (
28
29
  <span className="sc-session-icon">
29
- <svg viewBox="0 0 20 20" aria-hidden="true">
30
- {props.handheld ? (
31
- <>
32
- <rect x="5.5" y="2.5" width="9" height="15" rx="2" />
33
- <path d="M9 14.75h2" />
34
- </>
35
- ) : (
36
- <>
37
- <rect x="2.5" y="3.5" width="15" height="10" rx="1.5" />
38
- <path d="M7 16.5h6M10 13.5v3" />
39
- </>
40
- )}
41
- </svg>
30
+ <Icon name={props.handheld ? "handheld" : "desktop"} />
42
31
  </span>
43
32
  );
44
33
  }
@@ -7,7 +7,7 @@ import {
7
7
  type RestAgentSetup,
8
8
  } from "../api.js";
9
9
  import { useWords } from "../i18n/index.js";
10
- import { type SetupGuide, setupSentenceOf } from "../setup-guide.js";
10
+ import { SETUP_INSTALL, type SetupGuide } from "../setup-guide.js";
11
11
  import { AvatarPicture, Badge, Button, Callout, CopyButton, cx, personName, Time } from "./ui.js";
12
12
 
13
13
  // The way a machine is led to an agent account (ADR-0088): the invitation as a supervisor sees
@@ -107,7 +107,7 @@ export function AgentInvitationPanel(props: AgentInvitationPanelProps) {
107
107
  {made !== undefined ? (
108
108
  <Callout tone="warning" title={words.made.title}>
109
109
  <p>{words.made.say}</p>
110
- <Line text={setupSentenceOf(made.command)} />
110
+ <Line text={words.made.line(made.command, SETUP_INSTALL)} />
111
111
  <p>{words.made.orRun}</p>
112
112
  <Line text={made.command} />
113
113
  <p>
@@ -1,6 +1,7 @@
1
1
  import { Fragment, type ReactNode, useEffect, useId, useRef, useState } from "react";
2
2
  import type { RestPerson } from "../api.js";
3
3
  import { useWords } from "../i18n/index.js";
4
+ import { Icon } from "./icon.js";
4
5
  import { Avatar, cx, personName } from "./ui.js";
5
6
 
6
7
  // The frame every page sits in (ADR-0010): a header that names the workspace and the project the
@@ -299,16 +300,7 @@ function TabGroup(props: { readonly item: NavItem; readonly onNavigate: (href: s
299
300
  }}
300
301
  >
301
302
  <span className="sc-tab-label">{item.label}</span>
302
- <svg className="sc-menu-caret" viewBox="0 0 16 16" aria-hidden="true">
303
- <path
304
- d="M4 6l4 4 4-4"
305
- fill="none"
306
- stroke="currentColor"
307
- strokeWidth="1.5"
308
- strokeLinecap="round"
309
- strokeLinejoin="round"
310
- />
311
- </svg>
303
+ <Icon name="chevron-down" size="xs" className="sc-menu-caret" />
312
304
  </button>
313
305
  <div
314
306
  id={id}
@@ -392,16 +384,7 @@ function PersonMenu(props: {
392
384
  <summary className="sc-menu-summary" aria-label={words.shell.menu(personName(person))}>
393
385
  <Avatar person={person} size="sm" />
394
386
  <span className="sc-person-login">{personName(person)}</span>
395
- <svg className="sc-menu-caret" viewBox="0 0 16 16" aria-hidden="true">
396
- <path
397
- d="M4 6l4 4 4-4"
398
- fill="none"
399
- stroke="currentColor"
400
- strokeWidth="1.5"
401
- strokeLinecap="round"
402
- strokeLinejoin="round"
403
- />
404
- </svg>
387
+ <Icon name="chevron-down" size="xs" className="sc-menu-caret" />
405
388
  </summary>
406
389
  <div className="sc-menu-panel">
407
390
  <p className="sc-menu-who">
@@ -112,7 +112,7 @@ export function TokenList(props: TokenListProps) {
112
112
  </div>
113
113
  {props.onRevoke !== undefined && (
114
114
  <Button
115
- variant="danger"
115
+ variant="ghost"
116
116
  size="sm"
117
117
  disabled={props.busy === true}
118
118
  onClick={() => props.onRevoke?.(token)}
@@ -510,8 +510,13 @@ export function ProgressBar(props: {
510
510
  return (
511
511
  <div className="sc-progress">
512
512
  <div className="sc-progress-bar" {...said}>
513
- <span className="sc-progress-done" style={{ width: `${share(counts.done)}%` }} />
514
- <span className="sc-progress-working" style={{ width: `${share(working)}%` }} />
513
+ {/* A part of nothing is not drawn: it would leave its gap at the bar's edge. */}
514
+ {counts.done > 0 && (
515
+ <span className="sc-progress-done" style={{ width: `${share(counts.done)}%` }} />
516
+ )}
517
+ {working > 0 && (
518
+ <span className="sc-progress-working" style={{ width: `${share(working)}%` }} />
519
+ )}
515
520
  </div>
516
521
  {props.words !== false && (
517
522
  <span className="sc-progress-words">
@@ -557,17 +562,20 @@ export function EmptyState(props: {
557
562
  );
558
563
  }
559
564
 
560
- /** An instant as people read one in a language: the date, and the time of day. */
561
- export function formatInstant(iso: string, language?: string): string {
565
+ /**
566
+ * An instant as people read one in a language: the day and the time of day, with the year
567
+ * where it is another than this one's, as a day alone is written (formatDay).
568
+ */
569
+ export function formatInstant(iso: string, language?: string, now: Date = new Date()): string {
562
570
  const date = new Date(iso);
563
571
  if (Number.isNaN(date.getTime())) {
564
572
  return iso;
565
573
  }
566
574
  return date.toLocaleString(language, {
567
- year: "numeric",
575
+ ...(date.getFullYear() === now.getFullYear() ? {} : { year: "numeric" }),
568
576
  month: "short",
569
577
  day: "numeric",
570
- hour: "2-digit",
578
+ hour: "numeric",
571
579
  minute: "2-digit",
572
580
  });
573
581
  }
@@ -606,8 +614,8 @@ export function Time(props: {
606
614
  const shown = date.toLocaleString(
607
615
  tag,
608
616
  dayOf(date) === dayOf(props.against === undefined ? new Date() : new Date(props.against))
609
- ? { hour: "2-digit", minute: "2-digit" }
610
- : { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" },
617
+ ? { hour: "numeric", minute: "2-digit" }
618
+ : { month: "short", day: "numeric", hour: "numeric", minute: "2-digit" },
611
619
  );
612
620
  return (
613
621
  <time className="sc-time" dateTime={props.iso} title={full}>
@@ -69,7 +69,7 @@ export function ConnectPage(props: ConnectPageProps) {
69
69
  );
70
70
  const ask = (
71
71
  <>
72
- <section className="sc-panel" aria-label={words.aria}>
72
+ <section className="sc-panel sc-panel-form" aria-label={words.aria}>
73
73
  <ConnectCodeForm busy={busy} onSubmit={(typed) => navigation.go(connectHref(typed))} />
74
74
  </section>
75
75
  </>
package/src/console.tsx CHANGED
@@ -591,7 +591,7 @@ function ProjectsPage(props: {
591
591
  </div>
592
592
  {error !== undefined && <Callout tone="danger">{error}</Callout>}
593
593
  {making && (
594
- <section className="sc-panel sc-panel-form" aria-label={words.form.aria}>
594
+ <section className="sc-panel sc-panel-form sc-panel-form-lead" aria-label={words.form.aria}>
595
595
  <ProjectForm
596
596
  busy={busy}
597
597
  skillsSource={data.me?.workspace.skills.source}
@@ -1406,13 +1406,10 @@ function ProjectPage(props: {
1406
1406
  const viewHref = (view: GoalTaskView) => goalHref(key, goal.id, { view });
1407
1407
  return (
1408
1408
  <>
1409
- <div className="sc-page-head">
1410
- <h1 className="sc-page-title">{roadmap.one}</h1>
1411
- <LinkButton href={projectHref(key, "roadmap")}>{roadmap.all}</LinkButton>
1412
- </div>
1413
1409
  {error !== undefined && <Callout tone="danger">{error}</Callout>}
1414
1410
  <GoalView
1415
1411
  goal={goal}
1412
+ allHref={projectHref(key, "roadmap")}
1416
1413
  tasks={data.tasks}
1417
1414
  taskHref={href}
1418
1415
  docHref={toDoc}
@@ -1579,27 +1576,30 @@ function ProjectPage(props: {
1579
1576
  <div className="sc-page-head">
1580
1577
  <h1 className="sc-page-title">{words.feed.title}</h1>
1581
1578
  </div>
1582
- <components.EventFeed
1583
- events={data.events}
1584
- href={(event) => {
1585
- const task = event.taskId === null ? undefined : tasksById.get(event.taskId);
1586
- if (task !== undefined) {
1587
- return href(task);
1588
- }
1589
- if (event.decisionId !== null) {
1590
- return decisionHref(key, event.decisionId);
1591
- }
1592
- if (event.goalId !== null) {
1593
- return goalHref(key, event.goalId);
1594
- }
1595
- // The rules are a page shown on the settings, not among the documents (ADR-0023).
1596
- if (event.data.path === RULES_PATH) {
1597
- return projectSettingsHref(key);
1598
- }
1599
- return event.data.path === undefined ? undefined : toDoc(event.data.path);
1600
- }}
1601
- empty={<EmptyState title={words.feed.empty} />}
1602
- />
1579
+ {/* The feed names its own region; the pane it stands on is no second one of that name. */}
1580
+ <div className="sc-panel">
1581
+ <components.EventFeed
1582
+ events={data.events}
1583
+ href={(event) => {
1584
+ const task = event.taskId === null ? undefined : tasksById.get(event.taskId);
1585
+ if (task !== undefined) {
1586
+ return href(task);
1587
+ }
1588
+ if (event.decisionId !== null) {
1589
+ return decisionHref(key, event.decisionId);
1590
+ }
1591
+ if (event.goalId !== null) {
1592
+ return goalHref(key, event.goalId);
1593
+ }
1594
+ // The rules are a page shown on the settings, not among the documents (ADR-0023).
1595
+ if (event.data.path === RULES_PATH) {
1596
+ return projectSettingsHref(key);
1597
+ }
1598
+ return event.data.path === undefined ? undefined : toDoc(event.data.path);
1599
+ }}
1600
+ empty={<EmptyState title={words.feed.empty} />}
1601
+ />
1602
+ </div>
1603
1603
  </>
1604
1604
  );
1605
1605
  }
@@ -1728,9 +1728,6 @@ function ProjectSettingsPage(props: {
1728
1728
  const head = (
1729
1729
  <div className="sc-page-head">
1730
1730
  <h1 className="sc-page-title">{settings.title}</h1>
1731
- {owner && route.form === undefined && (
1732
- <LinkButton href={projectSettingsHref(key, "edit")}>{words.common.edit}</LinkButton>
1733
- )}
1734
1731
  </div>
1735
1732
  );
1736
1733
  if (route.form === "edit") {
@@ -1842,6 +1839,17 @@ function ProjectSettingsPage(props: {
1842
1839
  {head}
1843
1840
  {error !== undefined && <Callout tone="danger">{error}</Callout>}
1844
1841
  <section className="sc-panel" aria-label={settings.aria}>
1842
+ <div className="sc-section-head">
1843
+ <h2 className="sc-section-title">{words.nav.projects}</h2>
1844
+ {owner && (
1845
+ <a
1846
+ className="sc-button sc-button-secondary sc-button-sm"
1847
+ href={projectSettingsHref(key, "edit")}
1848
+ >
1849
+ {words.common.edit}
1850
+ </a>
1851
+ )}
1852
+ </div>
1845
1853
  <dl className="sc-facts sc-facts-plain">
1846
1854
  <div>
1847
1855
  <dt>{form.name}</dt>
@@ -1947,8 +1955,9 @@ function ProjectSettingsPage(props: {
1947
1955
  * signed in on (board #309), which a console that holds a token does not offer, and so does not
1948
1956
  * name.
1949
1957
  */
1950
- function SettingsViews(props: { readonly on: "workspace" | "sessions" }) {
1951
- const views = useWords().settings.views;
1958
+ function SettingsViews(props: { readonly on: "workspace" | "sessions" | "categories" }) {
1959
+ const settings = useWords().settings;
1960
+ const views = settings.views;
1952
1961
  return (
1953
1962
  <nav className="sc-subtabs sc-settings-views" aria-label={views.aria}>
1954
1963
  <a
@@ -1965,6 +1974,13 @@ function SettingsViews(props: { readonly on: "workspace" | "sessions" }) {
1965
1974
  >
1966
1975
  {views.sessions}
1967
1976
  </a>
1977
+ <a
1978
+ className={cx("sc-tab", props.on === "categories" && "sc-tab-current")}
1979
+ href={PATHS.categories}
1980
+ aria-current={props.on === "categories" ? "page" : undefined}
1981
+ >
1982
+ {settings.categories}
1983
+ </a>
1968
1984
  </nav>
1969
1985
  );
1970
1986
  }
@@ -2502,6 +2518,8 @@ function PlatePage(props: {
2502
2518
  readonly lead?: string | undefined;
2503
2519
  /** What stands beside the title: the way back, on another person's plate. */
2504
2520
  readonly aside?: ReactNode;
2521
+ /** What stands under the head and over the plate: the agents that need the person, on their own. */
2522
+ readonly under?: ReactNode;
2505
2523
  /** A day of the week shown at the top, from the address; today's week when it names none. */
2506
2524
  readonly week: string | undefined;
2507
2525
  readonly weekHref: (day: string) => string;
@@ -2557,6 +2575,7 @@ function PlatePage(props: {
2557
2575
  {props.aside}
2558
2576
  </div>
2559
2577
  )}
2578
+ {props.under}
2560
2579
  {problem !== undefined && <Callout tone="danger">{problem}</Callout>}
2561
2580
  {forbidden && refused !== undefined ? (
2562
2581
  <EmptyState
@@ -2833,22 +2852,20 @@ function WorkPage(props: {
2833
2852
  const words = useWords();
2834
2853
  const { plate } = props.data.actions;
2835
2854
  return (
2836
- <>
2837
- <AgentsNeedingYou agents={props.data.agents} me={props.data.me?.person?.id} />
2838
- <PlatePage
2839
- components={props.components}
2840
- load={plate}
2841
- remember={`work:${props.data.me?.person?.id ?? ""}`}
2842
- early="work"
2843
- title={words.work.title}
2844
- week={props.week}
2845
- weekStart={weekStartOf(props.data.me?.workspace)}
2846
- weekHref={workHref}
2847
- loading={words.work.loading}
2848
- couldNotLoad={words.work.couldNotLoad}
2849
- empty={words.work.empty}
2850
- />
2851
- </>
2855
+ <PlatePage
2856
+ components={props.components}
2857
+ under={<AgentsNeedingYou agents={props.data.agents} me={props.data.me?.person?.id} />}
2858
+ load={plate}
2859
+ remember={`work:${props.data.me?.person?.id ?? ""}`}
2860
+ early="work"
2861
+ title={words.work.title}
2862
+ week={props.week}
2863
+ weekStart={weekStartOf(props.data.me?.workspace)}
2864
+ weekHref={workHref}
2865
+ loading={words.work.loading}
2866
+ couldNotLoad={words.work.couldNotLoad}
2867
+ empty={words.work.empty}
2868
+ />
2852
2869
  );
2853
2870
  }
2854
2871
 
@@ -3094,8 +3111,9 @@ function WorkspacePage(props: {
3094
3111
  return (
3095
3112
  <>
3096
3113
  <div className="sc-page-head">
3097
- <h1 className="sc-page-title">{categories.title}</h1>
3114
+ <h1 className="sc-page-title">{words.settings.title}</h1>
3098
3115
  </div>
3116
+ {!holdsToken(data) && <SettingsViews on="categories" />}
3099
3117
  {error !== undefined && <Callout tone="danger">{error}</Callout>}
3100
3118
  <components.CategoryList
3101
3119
  categories={data.categories}
@@ -3176,7 +3194,10 @@ function WorkspacePage(props: {
3176
3194
  {narrowed && <p className="sc-lead">{words.people.narrowed}</p>}
3177
3195
  {error !== undefined && <Callout tone="danger">{error}</Callout>}
3178
3196
  {makingTeam && (
3179
- <section className="sc-panel sc-panel-form" aria-label={words.teams.newAria}>
3197
+ <section
3198
+ className="sc-panel sc-panel-form sc-panel-form-lead"
3199
+ aria-label={words.teams.newAria}
3200
+ >
3180
3201
  <TeamForm
3181
3202
  busy={busy}
3182
3203
  onSubmit={(input) =>
@@ -3223,7 +3244,10 @@ function WorkspacePage(props: {
3223
3244
  />
3224
3245
  )}
3225
3246
  {making && (
3226
- <section className="sc-panel sc-panel-form" aria-label={words.people.letInAria}>
3247
+ <section
3248
+ className="sc-panel sc-panel-form sc-panel-form-lead"
3249
+ aria-label={words.people.letInAria}
3250
+ >
3227
3251
  <ListingForm
3228
3252
  providers={data.me?.signIn ?? []}
3229
3253
  busy={busy}
@@ -3445,7 +3469,10 @@ function WorkspacePage(props: {
3445
3469
  />
3446
3470
  )}
3447
3471
  {making && (
3448
- <section className="sc-panel sc-panel-form" aria-label={agents.makeAria}>
3472
+ <section
3473
+ className="sc-panel sc-panel-form sc-panel-form-lead"
3474
+ aria-label={agents.makeAria}
3475
+ >
3449
3476
  <TokenForm
3450
3477
  daysAtMost={data.me?.workspace.tokenDaysAtMost}
3451
3478
  busy={busy}
@@ -3559,7 +3586,11 @@ export function createConsole(config: ConsoleConfig = {}): ConsoleApp {
3559
3586
  /** The tab the page shown is under, once the tabs are known. */
3560
3587
  let here: string | undefined;
3561
3588
  let content: React.ReactNode;
3562
- if (data.me === undefined) {
3589
+ // The shell waits for the workspace's lists as it waits for who is asking: its tabs name the
3590
+ // plugins, and tabs drawn before those are known move under the pointer when they arrive.
3591
+ const listsToCome =
3592
+ data.me !== undefined && data.me.person !== null && !data.loaded && data.error === undefined;
3593
+ if (data.me === undefined || listsToCome) {
3563
3594
  content = (
3564
3595
  <Ground>
3565
3596
  <div className="sc-loading">
@@ -3674,7 +3705,10 @@ export function createConsole(config: ConsoleConfig = {}): ConsoleApp {
3674
3705
  href: projectHref(projectKey),
3675
3706
  label: words.nav.board,
3676
3707
  current:
3677
- route.name === "board" || route.name === "task" || route.name === "new-task",
3708
+ route.name === "board" ||
3709
+ route.name === "task" ||
3710
+ route.name === "new-task" ||
3711
+ route.name === "archive",
3678
3712
  },
3679
3713
  {
3680
3714
  href: projectHref(projectKey, "roadmap"),