@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
@@ -0,0 +1,112 @@
1
+ // Written by `pnpm icons` from packages/console/icons, one SVG file a glyph. Do not edit it:
2
+ // change the glyph's file, or groups.json beside it, and run `pnpm icons` again.
3
+ // `pnpm check:icons` holds this module to that folder.
4
+ // biome-ignore-all format: written by a script, a glyph a line
5
+
6
+ /** The elements a glyph is made of. */
7
+ export type GlyphTag = "path" | "circle" | "ellipse" | "rect" | "line" | "polyline" | "polygon";
8
+
9
+ /** One shape of a glyph: an element by its name, with its measures on the grid. */
10
+ export type GlyphShape = readonly [tag: GlyphTag, measures: Readonly<Record<string, string>>];
11
+
12
+ /** The side of the grid every glyph is drawn on. */
13
+ export const ICON_GRID = 20;
14
+
15
+ /** Every glyph of the pack by its name: its shapes in the order they are drawn. */
16
+ export const GLYPHS = {
17
+ "admin": [["path", { d: "M10 2.75l6 2.25v4.5c0 3.75-2.5 6.5-6 7.75-3.5-1.25-6-4-6-7.75V5z" }], ["path", { d: "M7.5 10l1.75 1.75 3.25-3.5" }]],
18
+ "agent": [["rect", { x: "4", y: "6.5", width: "12", height: "10", rx: "2.5" }], ["path", { d: "M10 6.5v-3" }], ["path", { d: "M7.75 10.5v2M12.25 10.5v2" }]],
19
+ "approval": [["path", { d: "M8 3.5h4l-.75 6.5h3.25a1.5 1.5 0 0 1 1.5 1.5v2H4v-2A1.5 1.5 0 0 1 5.5 10h3.25z" }], ["path", { d: "M4 16.5h12" }]],
20
+ "arrow-down": [["path", { d: "M10 4v12M5 11l5 5 5-5" }]],
21
+ "arrow-left": [["path", { d: "M16 10H4M9 5l-5 5 5 5" }]],
22
+ "arrow-right": [["path", { d: "M4 10h12M11 5l5 5-5 5" }]],
23
+ "arrow-up": [["path", { d: "M10 16V4M5 9l5-5 5 5" }]],
24
+ "attachment": [["path", { d: "M15.5 9.5l-5.6 5.6a3.25 3.25 0 0 1-4.6-4.6l6-6a2.25 2.25 0 0 1 3.2 3.2l-5.9 5.9a1.1 1.1 0 0 1-1.6-1.6l5.3-5.3" }]],
25
+ "bell": [["path", { d: "M10 3.5A4.5 4.5 0 0 0 5.5 8v3.5L4 14.5h12l-1.5-3V8A4.5 4.5 0 0 0 10 3.5z" }], ["path", { d: "M8.25 16.75a1.9 1.9 0 0 0 3.5 0" }]],
26
+ "board": [["rect", { x: "3.5", y: "3.5", width: "3.5", height: "10", rx: "1" }], ["rect", { x: "8.25", y: "3.5", width: "3.5", height: "13", rx: "1" }], ["rect", { x: "13", y: "3.5", width: "3.5", height: "7", rx: "1" }]],
27
+ "bookmark": [["path", { d: "M5.5 3.5h9a1 1 0 0 1 1 1V17L10 13.25 4.5 17V4.5a1 1 0 0 1 1-1z" }]],
28
+ "calendar": [["rect", { x: "3.5", y: "4.5", width: "13", height: "12", rx: "2" }], ["path", { d: "M3.5 8.5h13M7 3v3M13 3v3" }]],
29
+ "chart": [["path", { d: "M3.5 16.5h13" }], ["path", { d: "M6 16.5V11M10 16.5V5M14 16.5V8.5" }]],
30
+ "check": [["path", { d: "M4 10.5l4 4 8-9" }]],
31
+ "chevron-down": [["path", { d: "M5 7.5l5 5 5-5" }]],
32
+ "chevron-left": [["path", { d: "M12.5 5l-5 5 5 5" }]],
33
+ "chevron-right": [["path", { d: "M7.5 5l5 5-5 5" }]],
34
+ "chevron-up": [["path", { d: "M5 12.5l5-5 5 5" }]],
35
+ "clock": [["circle", { cx: "10", cy: "10", r: "7" }], ["path", { d: "M10 6v4l2.75 1.75" }]],
36
+ "close": [["path", { d: "M5 5l10 10M15 5L5 15" }]],
37
+ "code": [["path", { d: "M7 6l-4 4 4 4M13 6l4 4-4 4" }], ["path", { d: "M11.5 4.5l-3 11" }]],
38
+ "collapse": [["path", { d: "M6 3.5l4 4 4-4M6 16.5l4-4 4 4" }]],
39
+ "comment": [["path", { d: "M4.5 4h11A1.5 1.5 0 0 1 17 5.5v7a1.5 1.5 0 0 1-1.5 1.5H9l-3.5 3v-3h-1A1.5 1.5 0 0 1 3 12.5v-7A1.5 1.5 0 0 1 4.5 4z" }]],
40
+ "copy": [["rect", { x: "3.5", y: "7", width: "9.5", height: "9.5", rx: "1.5" }], ["path", { d: "M7 7V5a1.5 1.5 0 0 1 1.5-1.5H15A1.5 1.5 0 0 1 16.5 5v6.5A1.5 1.5 0 0 1 15 13h-2" }]],
41
+ "customer": [["rect", { x: "2.75", y: "4.5", width: "14.5", height: "11", rx: "2" }], ["circle", { cx: "7.5", cy: "9", r: "1.75" }], ["path", { d: "M4.75 13.25a2.9 2.9 0 0 1 5.5 0" }], ["path", { d: "M12.5 8.5H15M12.5 11.5H15" }]],
42
+ "decision": [["path", { d: "M10 17v-5.5M10 11.5L4.5 6M10 11.5L15.5 6" }], ["path", { d: "M4.5 9.5V6H8M15.5 9.5V6H12" }]],
43
+ "desktop": [["rect", { x: "2.5", y: "3.5", width: "15", height: "10", rx: "1.5" }], ["path", { d: "M7 16.5h6M10 13.5v3" }]],
44
+ "document": [["path", { d: "M6 2.75h5.5l4 4v9a1.5 1.5 0 0 1-1.5 1.5H6a1.5 1.5 0 0 1-1.5-1.5V4.25A1.5 1.5 0 0 1 6 2.75z" }], ["path", { d: "M11.5 2.75v4h4" }], ["path", { d: "M7.5 10.5h5M7.5 13.5h5" }]],
45
+ "download": [["path", { d: "M10 3.5v9M6 8.5l4 4 4-4" }], ["path", { d: "M4 16.5h12" }]],
46
+ "edit": [["path", { d: "M13.5 3.5l3 3L7 16H4v-3z" }], ["path", { d: "M11.5 5.5l3 3" }]],
47
+ "error": [["circle", { cx: "10", cy: "10", r: "7" }], ["path", { d: "M7.5 7.5l5 5M12.5 7.5l-5 5" }]],
48
+ "expand": [["path", { d: "M6 7.5l4-4 4 4M6 12.5l4 4 4-4" }]],
49
+ "external-link": [["path", { d: "M8.5 4.5h-3A1.5 1.5 0 0 0 4 6v8.5A1.5 1.5 0 0 0 5.5 16H14a1.5 1.5 0 0 0 1.5-1.5v-3" }], ["path", { d: "M11.5 3.5h5v5M16.5 3.5l-7 7" }]],
50
+ "eye": [["path", { d: "M2.75 10c1.6-3.3 4.2-5.25 7.25-5.25S15.65 6.7 17.25 10c-1.6 3.3-4.2 5.25-7.25 5.25S4.35 13.3 2.75 10z" }], ["circle", { cx: "10", cy: "10", r: "2.25" }]],
51
+ "eye-off": [["path", { d: "M2.75 10c1.6-3.3 4.2-5.25 7.25-5.25S15.65 6.7 17.25 10c-1.6 3.3-4.2 5.25-7.25 5.25S4.35 13.3 2.75 10z" }], ["circle", { cx: "10", cy: "10", r: "2.25" }], ["path", { d: "M3.5 3.5l13 13" }]],
52
+ "file": [["path", { d: "M6 2.75h5.5l4 4v9a1.5 1.5 0 0 1-1.5 1.5H6a1.5 1.5 0 0 1-1.5-1.5V4.25A1.5 1.5 0 0 1 6 2.75z" }], ["path", { d: "M11.5 2.75v4h4" }]],
53
+ "filter": [["path", { d: "M3.5 4.5h13l-5 6v5l-3 1.5v-6.5z" }]],
54
+ "finance": [["rect", { x: "2.75", y: "5.5", width: "14.5", height: "9", rx: "1.5" }], ["circle", { cx: "10", cy: "10", r: "2.25" }], ["path", { d: "M5.5 10h.01M14.5 10h.01" }]],
55
+ "flag": [["path", { d: "M5 17V3.5M5 4.5h9.5l-2 3.25 2 3.25H5" }]],
56
+ "folder": [["path", { d: "M3 6a1.5 1.5 0 0 1 1.5-1.5h3.25l1.75 2h6A1.5 1.5 0 0 1 17 8v6.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 3 14.5z" }]],
57
+ "globe": [["circle", { cx: "10", cy: "10", r: "7" }], ["path", { d: "M3 10h14" }], ["path", { d: "M10 3c2 2 3 4.4 3 7s-1 5-3 7c-2-2-3-4.4-3-7s1-5 3-7z" }]],
58
+ "goal": [["circle", { cx: "10", cy: "10", r: "7" }], ["circle", { cx: "10", cy: "10", r: "3.5" }], ["circle", { cx: "10", cy: "10", r: "0.5" }]],
59
+ "handheld": [["rect", { x: "5.5", y: "2.5", width: "9", height: "15", rx: "2" }], ["path", { d: "M9 14.75h2" }]],
60
+ "home": [["path", { d: "M3.5 9.25L10 3.5l6.5 5.75v6.25A1.5 1.5 0 0 1 15 17H5a1.5 1.5 0 0 1-1.5-1.5z" }], ["path", { d: "M8 17v-4.5h4V17" }]],
61
+ "image": [["rect", { x: "3", y: "4", width: "14", height: "12", rx: "2" }], ["circle", { cx: "7.25", cy: "8", r: "1.25" }], ["path", { d: "M3.5 14l3.75-3.5 2.75 2.5 2.5-2.25 4 3.75" }]],
62
+ "info": [["circle", { cx: "10", cy: "10", r: "7" }], ["path", { d: "M10 9.25v4.25" }], ["path", { d: "M10 6.5h.01" }]],
63
+ "key": [["circle", { cx: "6.5", cy: "13.5", r: "3.25" }], ["path", { d: "M8.8 11.2l7.7-7.7M14.5 5.5l2 2M12 8l1.75 1.75" }]],
64
+ "leave": [["circle", { cx: "10", cy: "10", r: "3.25" }], ["path", { d: "M10 3v1.5M10 15.5V17M3 10h1.5M15.5 10H17" }], ["path", { d: "M5.05 5.05l1.06 1.06M13.89 13.89l1.06 1.06M5.05 14.95l1.06-1.06M13.89 6.11l1.06-1.06" }]],
65
+ "link": [["path", { d: "M8.5 11.5a3.25 3.25 0 0 0 4.6 0l2.5-2.5A3.25 3.25 0 0 0 11 4.4l-1 1" }], ["path", { d: "M11.5 8.5a3.25 3.25 0 0 0-4.6 0L4.4 11A3.25 3.25 0 0 0 9 15.6l1-1" }]],
66
+ "list": [["path", { d: "M7.5 5.5h9M7.5 10h9M7.5 14.5h9" }], ["path", { d: "M3.75 5.5h.01M3.75 10h.01M3.75 14.5h.01" }]],
67
+ "lock": [["rect", { x: "4.5", y: "9", width: "11", height: "8", rx: "2" }], ["path", { d: "M7 9V6.5a3 3 0 0 1 6 0V9" }]],
68
+ "mail": [["rect", { x: "2.75", y: "4.5", width: "14.5", height: "11", rx: "2" }], ["path", { d: "M3.25 6l6.75 5 6.75-5" }]],
69
+ "messenger": [["path", { d: "M3 5.5A1.5 1.5 0 0 1 4.5 4h7A1.5 1.5 0 0 1 13 5.5v4a1.5 1.5 0 0 1-1.5 1.5H7l-2.5 2.25V11A1.5 1.5 0 0 1 3 9.5z" }], ["path", { d: "M15.5 8A1.5 1.5 0 0 1 17 9.5v4a1.5 1.5 0 0 1-1.5 1.5v2.25L13 15H9.5" }]],
70
+ "minus": [["path", { d: "M4 10h12" }]],
71
+ "more": [["circle", { cx: "4.5", cy: "10", r: "0.75" }], ["circle", { cx: "10", cy: "10", r: "0.75" }], ["circle", { cx: "15.5", cy: "10", r: "0.75" }]],
72
+ "more-vertical": [["circle", { cx: "10", cy: "4.5", r: "0.75" }], ["circle", { cx: "10", cy: "10", r: "0.75" }], ["circle", { cx: "10", cy: "15.5", r: "0.75" }]],
73
+ "notice": [["path", { d: "M3 8.5v3a1 1 0 0 0 1 1h2.5l6.5 3.25V4.25L6.5 7.5H4a1 1 0 0 0-1 1z" }], ["path", { d: "M6.5 12.5l.75 4h2l-.75-3" }], ["path", { d: "M15.75 8.25a2.5 2.5 0 0 1 0 3.5" }]],
74
+ "pack": [["path", { d: "M10 2.75l6.5 3.5v7.5L10 17.25l-6.5-3.5v-7.5z" }], ["path", { d: "M3.5 6.25l6.5 3.5 6.5-3.5M10 9.75v7.5" }]],
75
+ "people": [["circle", { cx: "7.25", cy: "7", r: "2.75" }], ["path", { d: "M2.5 16.5a4.75 4.75 0 0 1 9.5 0" }], ["circle", { cx: "13.75", cy: "7.75", r: "2.25" }], ["path", { d: "M13.75 12.5a4 4 0 0 1 3.75 4" }]],
76
+ "person": [["circle", { cx: "10", cy: "6.5", r: "3" }], ["path", { d: "M4 17a6 5.25 0 0 1 12 0" }]],
77
+ "plugin": [["path", { d: "M7 2.75v4M13 2.75v4" }], ["path", { d: "M5 6.75h10v3a5 5 0 0 1-10 0z" }], ["path", { d: "M10 14.75v2.5" }]],
78
+ "plus": [["path", { d: "M10 4v12M4 10h12" }]],
79
+ "project": [["rect", { x: "3", y: "6.5", width: "14", height: "10", rx: "2" }], ["path", { d: "M7.5 6.5V5A1.5 1.5 0 0 1 9 3.5h2A1.5 1.5 0 0 1 12.5 5v1.5" }], ["path", { d: "M3 11h14" }]],
80
+ "refresh": [["path", { d: "M4 10a6 6 0 0 1 10.5-4" }], ["path", { d: "M14.75 2.75v3.5h-3.5" }], ["path", { d: "M16 10a6 6 0 0 1-10.5 4" }], ["path", { d: "M5.25 17.25v-3.5h3.5" }]],
81
+ "run": [["circle", { cx: "10", cy: "10", r: "7" }], ["path", { d: "M8.5 7.25l4.25 2.75-4.25 2.75z" }]],
82
+ "search": [["circle", { cx: "9", cy: "9", r: "5.25" }], ["path", { d: "M12.75 12.75l4 4" }]],
83
+ "send": [["path", { d: "M17 3l-5.25 14-3-5.75L3 8.25z" }], ["path", { d: "M17 3l-8.25 8.25" }]],
84
+ "server": [["rect", { x: "3", y: "3.5", width: "14", height: "5.5", rx: "1.5" }], ["rect", { x: "3", y: "11", width: "14", height: "5.5", rx: "1.5" }], ["path", { d: "M6 6.25h.01M6 13.75h.01" }]],
85
+ "settings": [["path", { d: "M8.72 4.65L9.03 2.81L10.97 2.81L11.28 4.65L12.87 5.31L14.4 4.24L15.76 5.6L14.69 7.13L15.35 8.72L17.19 9.03L17.19 10.97L15.35 11.28L14.69 12.87L15.76 14.4L14.4 15.76L12.87 14.69L11.28 15.35L10.97 17.19L9.03 17.19L8.72 15.35L7.13 14.69L5.6 15.76L4.24 14.4L5.31 12.87L4.65 11.28L2.81 10.97L2.81 9.03L4.65 8.72L5.31 7.13L4.24 5.6L5.6 4.24L7.13 5.31z" }], ["circle", { cx: "10", cy: "10", r: "2.25" }]],
86
+ "skill": [["path", { d: "M10 5.5C8.5 4.25 6.5 3.75 3.5 3.75v11c3 0 5 .5 6.5 1.75 1.5-1.25 3.5-1.75 6.5-1.75v-11c-3 0-5 .5-6.5 1.75z" }], ["path", { d: "M10 5.5v11" }]],
87
+ "sort": [["path", { d: "M6.5 16V4M3.5 7l3-3 3 3" }], ["path", { d: "M13.5 4v12M10.5 13l3 3 3-3" }]],
88
+ "spark": [["path", { d: "M10 3.5q.75 5.25 6 6-5.25.75-6 6-.75-5.25-6-6 5.25-.75 6-6z" }]],
89
+ "star": [["path", { d: "M10 3.25L11.88 7.91L16.9 8.26L13.04 11.49L14.26 16.37L10 13.7L5.74 16.37L6.96 11.49L3.1 8.26L8.12 7.91z" }]],
90
+ "success": [["circle", { cx: "10", cy: "10", r: "7" }], ["path", { d: "M6.75 10.25L9 12.5l4.25-4.75" }]],
91
+ "task": [["rect", { x: "3.5", y: "3.5", width: "13", height: "13", rx: "2.5" }], ["path", { d: "M7 10.25l2.25 2.25 4-4.5" }]],
92
+ "team": [["rect", { x: "7.5", y: "3", width: "5", height: "4", rx: "1" }], ["rect", { x: "3", y: "13", width: "5", height: "4", rx: "1" }], ["rect", { x: "12", y: "13", width: "5", height: "4", rx: "1" }], ["path", { d: "M10 7v3M5.5 13v-1.5A1.5 1.5 0 0 1 7 10h6a1.5 1.5 0 0 1 1.5 1.5V13" }]],
93
+ "token": [["rect", { x: "2.75", y: "6.5", width: "14.5", height: "7", rx: "3.5" }], ["path", { d: "M6.5 10h.01M10 10h.01M13.5 10h.01" }]],
94
+ "trash": [["path", { d: "M3.5 5.5h13" }], ["path", { d: "M8 5.5V4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1.5" }], ["path", { d: "M5 5.5l.75 10a1.5 1.5 0 0 0 1.5 1.5h5.5a1.5 1.5 0 0 0 1.5-1.5l.75-10" }], ["path", { d: "M8.5 9v5M11.5 9v5" }]],
95
+ "unlock": [["rect", { x: "4.5", y: "9", width: "11", height: "8", rx: "2" }], ["path", { d: "M7 9V6.5A3 3 0 0 1 12.6 5" }]],
96
+ "upload": [["path", { d: "M10 12.5v-9M6 7.5l4-4 4 4" }], ["path", { d: "M4 16.5h12" }]],
97
+ "video": [["rect", { x: "2.75", y: "5", width: "10.5", height: "10", rx: "2" }], ["path", { d: "M13.25 8.75l4-2.25v7l-4-2.25" }]],
98
+ "warning": [["path", { d: "M10 3.5L17.25 16H2.75z" }], ["path", { d: "M10 8.5v3.5" }], ["path", { d: "M10 14h.01" }]],
99
+ } as const satisfies Readonly<Record<string, readonly GlyphShape[]>>;
100
+
101
+ /** The groups the glyphs stand in, in the order a picker and the catalogue show them. */
102
+ export const ICON_GROUPS = [
103
+ { key: "actions", icons: ["plus", "minus", "close", "check", "edit", "trash", "copy", "search", "filter", "sort", "refresh", "download", "upload", "external-link", "send", "more", "more-vertical"] },
104
+ { key: "directions", icons: ["arrow-up", "arrow-down", "arrow-left", "arrow-right", "chevron-up", "chevron-down", "chevron-left", "chevron-right", "collapse", "expand"] },
105
+ { key: "people", icons: ["person", "people", "agent", "team", "admin"] },
106
+ { key: "work", icons: ["task", "decision", "run", "goal", "calendar", "clock", "flag", "board", "list", "chart"] },
107
+ { key: "files", icons: ["document", "file", "folder", "image", "video", "attachment", "link", "comment", "code", "mail", "bookmark"] },
108
+ { key: "states", icons: ["info", "warning", "error", "success", "lock", "unlock", "eye", "eye-off", "bell", "star", "spark"] },
109
+ { key: "tools", icons: ["settings", "plugin", "key", "token", "skill", "pack", "home", "project", "globe"] },
110
+ { key: "devices", icons: ["desktop", "handheld", "server"] },
111
+ { key: "plugins", icons: ["leave", "notice", "approval", "messenger", "finance", "customer"] },
112
+ ] as const;
@@ -0,0 +1,195 @@
1
+ import { GLYPHS, type GlyphShape, ICON_GRID, ICON_GROUPS } from "./glyphs.js";
2
+
3
+ // The icon pack (ADR-0142): the glyphs the console's pages, a plugin's pages and a prototype
4
+ // draw by name, so that an icon is not chosen or drawn anew wherever one is needed. A glyph is a
5
+ // file under `packages/console/icons`, drawn on one grid with one stroke, and `glyphs.ts` beside
6
+ // this module is what `pnpm icons` writes from that folder: shapes as data, which `Icon` draws as
7
+ // elements. Nothing here reads a glyph from anywhere else, and a name is checked against the
8
+ // pack wherever one arrives from outside.
9
+
10
+ export { GLYPHS, type GlyphShape, type GlyphTag, ICON_GRID, ICON_GROUPS } from "./glyphs.js";
11
+
12
+ /** The name of a glyph of the pack. */
13
+ export type IconName = keyof typeof GLYPHS;
14
+
15
+ /** Every glyph of the pack by name, in the order of the names. */
16
+ export const ICON_NAMES = Object.keys(GLYPHS) as readonly IconName[];
17
+
18
+ /** Whether a value names a glyph of the pack. */
19
+ export function isIconName(value: unknown): value is IconName {
20
+ return typeof value === "string" && Object.hasOwn(GLYPHS, value);
21
+ }
22
+
23
+ /** A group of the pack: its key, and its glyphs in the order they are shown. */
24
+ export interface IconGroup {
25
+ readonly key: string;
26
+ readonly icons: readonly IconName[];
27
+ }
28
+
29
+ /** The groups the glyphs stand in, in the order a picker and the catalogue show them. */
30
+ export const ICON_GROUP_LIST: readonly IconGroup[] = ICON_GROUPS;
31
+
32
+ /**
33
+ * The glyphs a person's words find, in the order the pack shows them, those whose name begins
34
+ * with the words first. Every word typed has to be in a glyph's name or among the words a
35
+ * language pack gives it (`icons.words`), whatever its case. Words that are empty find every
36
+ * glyph.
37
+ */
38
+ export function findIcons(
39
+ query: string,
40
+ words: Readonly<Record<string, string>> = {},
41
+ ): readonly IconName[] {
42
+ const all = ICON_GROUP_LIST.flatMap((group) => group.icons);
43
+ const terms = query.toLowerCase().split(/\s+/).filter(Boolean);
44
+ if (terms.length === 0) {
45
+ return all;
46
+ }
47
+ const whole = terms.join(" ");
48
+ const found = all.filter((name) => {
49
+ const spoken = Object.hasOwn(words, name) ? (words[name] ?? "") : "";
50
+ const hay = `${name} ${name.replaceAll("-", " ")} ${spoken}`.toLowerCase();
51
+ return terms.every((term) => hay.includes(term));
52
+ });
53
+ const begins = (name: string): boolean =>
54
+ name.startsWith(whole) || name.replaceAll("-", " ").startsWith(whole);
55
+ return [...found.filter(begins), ...found.filter((name) => !begins(name))];
56
+ }
57
+
58
+ /**
59
+ * Where a choice stands among a picker's choices while nothing is searched: none first, then
60
+ * the glyphs in the order the pack shows them. A picker opens with the choice in hand there.
61
+ */
62
+ export function iconPlace(value: IconName | null): number {
63
+ return value === null ? 0 : 1 + ICON_GROUP_LIST.flatMap((group) => group.icons).indexOf(value);
64
+ }
65
+
66
+ /** One section of a picker's choices: how many it holds, and how many stand on a row. */
67
+ export interface IconSection {
68
+ readonly size: number;
69
+ readonly columns: number;
70
+ }
71
+
72
+ /**
73
+ * Where a key moves among a picker's choices, which stand in sections one under the other, each
74
+ * a grid of its own: the place of the choice the key leads to, counted through the sections;
75
+ * `-1` for a key that leads up out of the first row, back to the field the words are typed in;
76
+ * nothing for a key that moves nowhere. `at` is where the choice in hand stands, `-1` in the
77
+ * field. Left and right go through the choices in order; up and down keep the column, into the
78
+ * section above or below where a section ends, and to its last choice where a row is short.
79
+ */
80
+ export function iconStep(
81
+ sections: readonly IconSection[],
82
+ at: number,
83
+ key: string,
84
+ ): number | undefined {
85
+ const filled = sections.filter((section) => section.size > 0);
86
+ const total = filled.reduce((sum, section) => sum + section.size, 0);
87
+ if (total === 0) {
88
+ return undefined;
89
+ }
90
+ if (key === "Home") {
91
+ return 0;
92
+ }
93
+ if (key === "End") {
94
+ return total - 1;
95
+ }
96
+ if (at < 0) {
97
+ return key === "ArrowDown" ? 0 : undefined;
98
+ }
99
+ if (key === "ArrowRight") {
100
+ return at + 1 < total ? at + 1 : undefined;
101
+ }
102
+ if (key === "ArrowLeft") {
103
+ return at > 0 ? at - 1 : undefined;
104
+ }
105
+ if (key !== "ArrowDown" && key !== "ArrowUp") {
106
+ return undefined;
107
+ }
108
+ let first = 0;
109
+ for (const [index, section] of filled.entries()) {
110
+ if (at >= first + section.size) {
111
+ first += section.size;
112
+ continue;
113
+ }
114
+ const columns = Math.max(1, section.columns);
115
+ const place = at - first;
116
+ const column = place % columns;
117
+ if (key === "ArrowDown") {
118
+ const lastRow = Math.floor((section.size - 1) / columns);
119
+ if (Math.floor(place / columns) < lastRow) {
120
+ return first + Math.min(place + columns, section.size - 1);
121
+ }
122
+ const below = filled[index + 1];
123
+ return below === undefined
124
+ ? undefined
125
+ : first + section.size + Math.min(column, below.size - 1, Math.max(1, below.columns) - 1);
126
+ }
127
+ if (place >= columns) {
128
+ return at - columns;
129
+ }
130
+ const above = filled[index - 1];
131
+ if (above === undefined) {
132
+ return -1;
133
+ }
134
+ const aboveColumns = Math.max(1, above.columns);
135
+ const lastRowStart = Math.floor((above.size - 1) / aboveColumns) * aboveColumns;
136
+ return first - above.size + Math.min(lastRowStart + column, above.size - 1);
137
+ }
138
+ return undefined;
139
+ }
140
+
141
+ /** The sides a glyph is drawn at, by the name of its size, as the stylesheet has them. */
142
+ const SIZE_CLASSES = {
143
+ xs: "sc-icon-xs",
144
+ sm: "sc-icon-sm",
145
+ md: "sc-icon-md",
146
+ lg: "sc-icon-lg",
147
+ } as const;
148
+
149
+ /**
150
+ * A glyph as an element, for a page that is not React's: what a plugin's bundle or a prototype
151
+ * puts where it wants an icon (`node.append(iconElement("calendar"))`). Drawn as `Icon` draws
152
+ * it, from the pack's data and never from markup, in the colour of the text around it; hidden
153
+ * from a screen reader unless it is given a label. `doc` is the page's document.
154
+ */
155
+ export function iconElement(
156
+ name: IconName,
157
+ options: {
158
+ readonly size?: keyof typeof SIZE_CLASSES | undefined;
159
+ readonly label?: string | undefined;
160
+ } = {},
161
+ doc: Document = document,
162
+ ): SVGSVGElement {
163
+ const space = "http://www.w3.org/2000/svg";
164
+ const svg = doc.createElementNS(space, "svg");
165
+ const says: Readonly<Record<string, string>> = {
166
+ class: `sc-icon ${SIZE_CLASSES[options.size ?? "md"]}`,
167
+ viewBox: `0 0 ${ICON_GRID} ${ICON_GRID}`,
168
+ width: String(ICON_GRID),
169
+ height: String(ICON_GRID),
170
+ fill: "none",
171
+ stroke: "currentColor",
172
+ "stroke-width": "1.5",
173
+ "stroke-linecap": "round",
174
+ "stroke-linejoin": "round",
175
+ focusable: "false",
176
+ };
177
+ for (const [attribute, value] of Object.entries(says)) {
178
+ svg.setAttribute(attribute, value);
179
+ }
180
+ if (options.label !== undefined && options.label.length > 0) {
181
+ svg.setAttribute("role", "img");
182
+ svg.setAttribute("aria-label", options.label);
183
+ } else {
184
+ svg.setAttribute("aria-hidden", "true");
185
+ }
186
+ const shapes: readonly GlyphShape[] = isIconName(name) ? GLYPHS[name] : [];
187
+ for (const [tag, measures] of shapes) {
188
+ const shape = doc.createElementNS(space, tag);
189
+ for (const [attribute, value] of Object.entries(measures)) {
190
+ shape.setAttribute(attribute, value);
191
+ }
192
+ svg.append(shape);
193
+ }
194
+ return svg;
195
+ }
package/src/index.ts CHANGED
@@ -153,6 +153,13 @@ export {
153
153
  ProjectTile,
154
154
  type ProjectTileProps,
155
155
  } from "./components/home.js";
156
+ export {
157
+ Icon,
158
+ IconPicker,
159
+ type IconPickerProps,
160
+ type IconProps,
161
+ type IconSize,
162
+ } from "./components/icon.js";
156
163
  export { Markdown, type MarkdownProps } from "./components/markdown.js";
157
164
  export { MyDecisions, type MyDecisionsProps } from "./components/my-decisions.js";
158
165
  export {
package/src/limits.ts CHANGED
@@ -68,6 +68,13 @@ export const MAX_SIGNAL_KEY_LENGTH = 200;
68
68
  /** A line a runner says of its machine, its product, a model or a level of effort; and how many of those a product offers. */
69
69
  export const MAX_RUNNER_LINE_LENGTH = 120;
70
70
  export const MAX_RUNNER_OFFERS = 50;
71
+ /** How many wake sources a runner says it keeps beside the console's own. */
72
+ export const MAX_RUNNER_SOURCES = 10;
73
+ /** How many wakes an agent account keeps for itself for later at a time, and how far ahead one may be (ADR-0145). */
74
+ export const MAX_OWN_WAKES = 20;
75
+ export const MAX_OWN_WAKE_DAYS = 31;
76
+ /** What a wake to come is called where the account names none. */
77
+ export const OWN_WAKE_KEY = "wake";
71
78
  /** How many signals one page of an account's record carries when none is asked for, and the most it may. */
72
79
  /** How many files a supervisor sends with one tell, pictures among them, together within `MAX_FILE_BYTES`. */
73
80
  export const MAX_SIGNAL_ATTACHMENTS = 8;
@@ -96,6 +103,8 @@ export const MAX_TRANSCRIPT_FILES_PER_MINUTE = 60;
96
103
  export const MAX_TRANSCRIPT_EVENTS_PER_HOUR = 60_000;
97
104
  export const MAX_AGENT_SESSIONS_PER_HOUR = 60;
98
105
  export const MAX_RUNNER_WAKES_PER_HOUR = 600;
106
+ /** How many wakes an agent account raises for itself within an hour, those kept for later among them when they are raised (ADR-0145). */
107
+ export const MAX_OWN_WAKES_PER_HOUR = 30;
99
108
  export const MAX_AGENT_STATE_CHANGES_PER_HOUR = 20;
100
109
  /** How many events one page of a session carries when none is asked for, and the most it may. */
101
110
  export const TRANSCRIPT_PAGE_LIMIT = 100;
package/src/marks.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type IconName, isIconName } from "./icons/index.js";
1
2
  import { COLOR_NAMES, type ColorName } from "./vocabulary.js";
2
3
 
3
4
  // A project's mark: a symbol on a colour, so that projects tell apart at a glance. A project
@@ -38,3 +39,14 @@ export function projectSymbolOf(project: {
38
39
  const first = [...project.name.trim()][0];
39
40
  return first === undefined ? "?" : first.toUpperCase();
40
41
  }
42
+
43
+ /**
44
+ * The icon of the pack a project's mark shows in its symbol's place (ADR-0142), or nothing: a
45
+ * project that names none, a console older than the field, and a name this pack does not hold,
46
+ * as one a newer console's pack gave, all leave the mark its symbol.
47
+ */
48
+ export function projectGlyphOf(project: {
49
+ readonly glyph?: string | null | undefined;
50
+ }): IconName | undefined {
51
+ return isIconName(project.glyph) ? project.glyph : undefined;
52
+ }
package/src/onboarding.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { RestWorkspace } from "./schemas.js";
2
- import { guideServicesOf } from "./setup-guide.js";
2
+ import { BROWSER_TOOL_OF_A_PRODUCT, guideServicesOf } from "./setup-guide.js";
3
3
 
4
4
  // The onboarding of an agent account (ADR-0088, points 4 to 6): its first task, which the
5
5
  // console makes when the account is made, with the agent as its worker. The agent works it as
@@ -42,7 +42,7 @@ export function onboardingOf(input: OnboardingInput): {
42
42
  ...services.flatMap((one) => one.onboarding.map((step) => item(step.title, step.body))),
43
43
  item(
44
44
  "Sign in at a page in the machine's own browser",
45
- "Use a browser tool of your product that attaches to the ordinary browser of your OS account: a sign-in stays there from one session to the next. Where a sign-in wants a person, a code sent to a phone or a picture to solve, ask for a person to sign in inside your session, over a remote desktop or at the machine, and say which service and which account; nothing you sign in with goes into a message, a task or a comment.",
45
+ `Use a browser tool of your product that attaches to the ordinary browser of your OS account: a sign-in stays there from one session to the next. ${BROWSER_TOOL_OF_A_PRODUCT} Where a sign-in wants a person, a code sent to a phone or a picture to solve, ask for a person to sign in inside your session, over a remote desktop or at the machine, and say which service and which account; nothing you sign in with goes into a message, a task or a comment.`,
46
46
  ),
47
47
  item(
48
48
  "Put your picture on your profiles",
@@ -77,7 +77,7 @@ export function onboardingOf(input: OnboardingInput): {
77
77
  "",
78
78
  "## When you are done",
79
79
  "",
80
- "You are done when nothing of this task waits on anyone: every item above is set up, or was answered as not to be done now, and every decision you raised is answered and acted on. Until then the run stays open and waits, since a decision is asked on a run and a run that is finished asks none. Then report what is set up and, item by item, what is not done and who said so, and finish the task.",
80
+ "When nothing of this task waits on anyone, every item set up or answered as not to be done now, report what is set up and, item by item, what is not done and who said so, and finish the task.",
81
81
  "",
82
82
  ].join("\n");
83
83
  return { title: onboardingTitle(handle), body };
@@ -489,8 +489,9 @@ const pluginWidgetSchema = z
489
489
  z.array(z.enum(PLUGIN_WIDGET_SIZE_NAMES)).check(z.minLength(1), z.maxLength(5)),
490
490
  ),
491
491
  /**
492
- * The size it would rather start at, one of `sizes`; the first of them when left out. A page
493
- * nobody arranged may tell it another of `sizes`, the nearest the box it has (ADR-0082).
492
+ * The size it starts at, one of `sizes`; the first of them when left out. A page nobody
493
+ * arranged shows it at this size, or at the largest of `sizes` that fits a narrower grid
494
+ * (ADR-0147); a larger one is for the person to choose.
494
495
  */
495
496
  defaultSize: z.optional(z.enum(PLUGIN_WIDGET_SIZE_NAMES)),
496
497
  roles: z.optional(roleList),
package/src/plugin/web.ts CHANGED
@@ -67,7 +67,10 @@ export interface FrameDocument {
67
67
  readonly style: { setProperty(name: string, value: string): void };
68
68
  lang: string;
69
69
  };
70
- readonly body: { readonly scrollHeight: number } | null;
70
+ readonly body: {
71
+ readonly scrollHeight: number;
72
+ getBoundingClientRect?(): { readonly height: number };
73
+ } | null;
71
74
  title: string;
72
75
  }
73
76
 
@@ -203,7 +206,11 @@ function startHeightWatch(document: FrameDocument, post: (height: number) => voi
203
206
  }
204
207
  let last = -1;
205
208
  const say = () => {
206
- const height = Math.ceil(body.scrollHeight);
209
+ // The body as drawn, its fraction of a pixel rounded up: scrollHeight is rounded to the
210
+ // nearest pixel, and a frame a fraction shorter than its page leaves its document that
211
+ // fraction to scroll. scrollHeight still counts what reaches past the body.
212
+ const drawn = body.getBoundingClientRect?.().height ?? 0;
213
+ const height = Math.ceil(Math.max(body.scrollHeight, drawn));
207
214
  if (height !== last) {
208
215
  last = height;
209
216
  post(height);
package/src/runner/acp.ts CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  type DriverSession,
11
11
  errorsShown,
12
12
  type Fact,
13
+ notStarted,
13
14
  type Picture,
14
15
  type Probe,
15
16
  plainCut,
@@ -1111,7 +1112,7 @@ function sessionOf(
1111
1112
  kind: "error",
1112
1113
  text:
1113
1114
  exit.error !== undefined
1114
- ? `The product could not be started: ${exit.error}`
1115
+ ? notStarted(exit.error)
1115
1116
  : `The product's process ended${exit.signal === null ? ` with code ${exit.code}` : ` on ${exit.signal}`}.${shown.length === 0 ? "" : `\n${shown}`}`,
1116
1117
  },
1117
1118
  {
@@ -0,0 +1,135 @@
1
+ import { spawn } from "node:child_process";
2
+
3
+ // Keeping the machine awake while a runner runs (ADR-0140): an agent account's machine that goes
4
+ // to sleep when nobody touches it is an agent not heard from. The runner holds the system's own
5
+ // request not to sleep for as long as its process is there, through a helper the system ships,
6
+ // which needs no administrator and changes no setting of the machine: what it holds ends with
7
+ // the runner. A sleep someone asks for, a lid that is closed and a machine that is switched off
8
+ // are not held off; those are for whoever keeps the machine.
9
+
10
+ /** What holds a machine awake for as long as one process runs: the program, its words, and what it is called. */
11
+ export interface AwakePlan {
12
+ readonly command: string;
13
+ readonly args: readonly string[];
14
+ /** What the helper is, for a line of the runner's own. */
15
+ readonly by: string;
16
+ }
17
+
18
+ /**
19
+ * The words of the helper on Windows: the system's own request that it stay awake, held by the
20
+ * thread that asked for it until that thread ends, which is when the process watched is gone.
21
+ * `2147483649` is the request that goes on (`0x80000000`) for the system to be needed
22
+ * (`0x00000001`).
23
+ */
24
+ const windowsScript = (pid: number): string =>
25
+ [
26
+ "$t = Add-Type -PassThru -Name Awake -Namespace ConsoleRunner -MemberDefinition '[DllImport(\"kernel32.dll\")] public static extern uint SetThreadExecutionState(uint flags);'",
27
+ "[void]$t::SetThreadExecutionState([uint32]2147483649)",
28
+ `try { Wait-Process -Id ${pid} -ErrorAction Stop } catch {}`,
29
+ ].join("; ");
30
+
31
+ /**
32
+ * What holds this kind of machine awake while the process `pid` runs, or nothing where the
33
+ * package knows no way that needs no administrator.
34
+ */
35
+ export function awakePlanOf(platform: string, pid: number): AwakePlan | undefined {
36
+ if (!Number.isSafeInteger(pid) || pid <= 0) {
37
+ return undefined;
38
+ }
39
+ switch (platform) {
40
+ case "darwin":
41
+ // Idle sleep held off, and any sleep while on mains power, until the process is gone.
42
+ return {
43
+ command: "/usr/bin/caffeinate",
44
+ args: ["-i", "-s", "-w", String(pid)],
45
+ by: "caffeinate",
46
+ };
47
+ case "win32":
48
+ return {
49
+ command: "powershell.exe",
50
+ args: [
51
+ "-NoProfile",
52
+ "-NonInteractive",
53
+ "-EncodedCommand",
54
+ Buffer.from(windowsScript(pid), "utf16le").toString("base64"),
55
+ ],
56
+ by: "a request to the system held by powershell",
57
+ };
58
+ case "linux":
59
+ return {
60
+ command: "systemd-inhibit",
61
+ args: [
62
+ "--what=idle:sleep",
63
+ "--who=console runner",
64
+ "--why=an agent account is at work",
65
+ "--mode=block",
66
+ "tail",
67
+ `--pid=${pid}`,
68
+ "-f",
69
+ "/dev/null",
70
+ ],
71
+ by: "systemd-inhibit",
72
+ };
73
+ default:
74
+ return undefined;
75
+ }
76
+ }
77
+
78
+ /** How holding the machine awake went: what holds it, or why nothing does. */
79
+ export type Awake = { readonly by: string } | { readonly problem: string };
80
+
81
+ /** A helper as it is started: what it says of itself once, and that the runner does not wait for it. */
82
+ export interface AwakeHelper {
83
+ once(event: "error", listener: () => void): unknown;
84
+ once(event: "exit", listener: (code: number | null) => void): unknown;
85
+ unref(): void;
86
+ }
87
+
88
+ /** Starts a helper on this machine, with nothing of it read or written. */
89
+ const startHelper = (
90
+ plan: AwakePlan,
91
+ env: Readonly<Record<string, string | undefined>>,
92
+ ): AwakeHelper =>
93
+ spawn(plan.command, [...plan.args], { env: { ...env }, stdio: "ignore", windowsHide: true });
94
+
95
+ /**
96
+ * Starts what holds the machine awake while this process runs, and answers how it went once the
97
+ * helper is seen to stay: one that ends at once, or is not there to start, holds nothing, and
98
+ * the runner says so. The helper ends by itself when the process it watches is gone. `start`
99
+ * is what starts it, for a test to hand in one that touches no machine.
100
+ */
101
+ export function holdAwake(
102
+ platform: string,
103
+ pid: number,
104
+ env: Readonly<Record<string, string | undefined>>,
105
+ settleMs = 4000,
106
+ start: typeof startHelper = startHelper,
107
+ ): Promise<Awake> {
108
+ const plan = awakePlanOf(platform, pid);
109
+ if (plan === undefined) {
110
+ return Promise.resolve({ problem: `nothing holds a machine of the kind ${platform} awake` });
111
+ }
112
+ return new Promise<Awake>((done) => {
113
+ let settled = false;
114
+ const settle = (how: Awake): void => {
115
+ if (!settled) {
116
+ settled = true;
117
+ done(how);
118
+ }
119
+ };
120
+ try {
121
+ const helper = start(plan, env);
122
+ helper.once("error", () => settle({ problem: `${plan.command} could not be started` }));
123
+ helper.once("exit", (code) =>
124
+ settle({
125
+ problem: `${plan.command} ended at once${code === null ? "" : ` with code ${code}`}`,
126
+ }),
127
+ );
128
+ // The runner does not wait for it to end, and ends without it.
129
+ helper.unref();
130
+ setTimeout(() => settle({ by: plan.by }), settleMs).unref();
131
+ } catch {
132
+ settle({ problem: `${plan.command} could not be started` });
133
+ }
134
+ });
135
+ }