@skillcdn/console 0.6.0 → 0.6.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 (415) hide show
  1. package/README.md +7 -7
  2. package/dist/agent-page.d.ts.map +1 -1
  3. package/dist/agent-page.js +58 -35
  4. package/dist/agent-page.js.map +1 -1
  5. package/dist/agent-usage.d.ts +51 -0
  6. package/dist/agent-usage.d.ts.map +1 -0
  7. package/dist/agent-usage.js +77 -0
  8. package/dist/agent-usage.js.map +1 -0
  9. package/dist/api.d.ts +4 -2
  10. package/dist/api.d.ts.map +1 -1
  11. package/dist/api.js +4 -2
  12. package/dist/api.js.map +1 -1
  13. package/dist/cli/cli.d.ts +9 -2
  14. package/dist/cli/cli.d.ts.map +1 -1
  15. package/dist/cli/cli.js +491 -125
  16. package/dist/cli/cli.js.map +1 -1
  17. package/dist/cli/format.d.ts +46 -4
  18. package/dist/cli/format.d.ts.map +1 -1
  19. package/dist/cli/format.js +163 -45
  20. package/dist/cli/format.js.map +1 -1
  21. package/dist/cli/help.d.ts.map +1 -1
  22. package/dist/cli/help.js +62 -13
  23. package/dist/cli/help.js.map +1 -1
  24. package/dist/cli/machine-check.d.ts +24 -5
  25. package/dist/cli/machine-check.d.ts.map +1 -1
  26. package/dist/cli/machine-check.js +128 -16
  27. package/dist/cli/machine-check.js.map +1 -1
  28. package/dist/cli/pack.d.ts +11 -8
  29. package/dist/cli/pack.d.ts.map +1 -1
  30. package/dist/cli/pack.js +63 -28
  31. package/dist/cli/pack.js.map +1 -1
  32. package/dist/cli/runner-host.d.ts +2 -0
  33. package/dist/cli/runner-host.d.ts.map +1 -1
  34. package/dist/cli/runner-host.js +1 -0
  35. package/dist/cli/runner-host.js.map +1 -1
  36. package/dist/cli/secret-notes.d.ts.map +1 -1
  37. package/dist/cli/secret-notes.js +9 -1
  38. package/dist/cli/secret-notes.js.map +1 -1
  39. package/dist/cli/terminal.d.ts +10 -2
  40. package/dist/cli/terminal.d.ts.map +1 -1
  41. package/dist/cli/terminal.js +16 -4
  42. package/dist/cli/terminal.js.map +1 -1
  43. package/dist/client.d.ts +30 -7
  44. package/dist/client.d.ts.map +1 -1
  45. package/dist/client.js +13 -1
  46. package/dist/client.js.map +1 -1
  47. package/dist/components/agent-page.d.ts +76 -18
  48. package/dist/components/agent-page.d.ts.map +1 -1
  49. package/dist/components/agent-page.js +183 -53
  50. package/dist/components/agent-page.js.map +1 -1
  51. package/dist/components/agents.d.ts +2 -0
  52. package/dist/components/agents.d.ts.map +1 -1
  53. package/dist/components/agents.js +6 -5
  54. package/dist/components/agents.js.map +1 -1
  55. package/dist/components/calendar.d.ts +24 -4
  56. package/dist/components/calendar.d.ts.map +1 -1
  57. package/dist/components/calendar.js +79 -36
  58. package/dist/components/calendar.js.map +1 -1
  59. package/dist/components/categories.js +2 -2
  60. package/dist/components/categories.js.map +1 -1
  61. package/dist/components/comments.js +2 -2
  62. package/dist/components/comments.js.map +1 -1
  63. package/dist/components/decision-list.d.ts.map +1 -1
  64. package/dist/components/decision-list.js +5 -5
  65. package/dist/components/decision-list.js.map +1 -1
  66. package/dist/components/documents.d.ts.map +1 -1
  67. package/dist/components/documents.js +4 -4
  68. package/dist/components/documents.js.map +1 -1
  69. package/dist/components/event-feed.d.ts +2 -3
  70. package/dist/components/event-feed.d.ts.map +1 -1
  71. package/dist/components/event-feed.js +4 -184
  72. package/dist/components/event-feed.js.map +1 -1
  73. package/dist/components/goals.d.ts.map +1 -1
  74. package/dist/components/goals.js +3 -3
  75. package/dist/components/goals.js.map +1 -1
  76. package/dist/components/home.js +9 -9
  77. package/dist/components/home.js.map +1 -1
  78. package/dist/components/icon.d.ts.map +1 -1
  79. package/dist/components/icon.js +11 -2
  80. package/dist/components/icon.js.map +1 -1
  81. package/dist/components/notifications.d.ts +65 -0
  82. package/dist/components/notifications.d.ts.map +1 -0
  83. package/dist/components/notifications.js +162 -0
  84. package/dist/components/notifications.js.map +1 -0
  85. package/dist/components/pack-connect.js +1 -1
  86. package/dist/components/pack-connect.js.map +1 -1
  87. package/dist/components/pack-token.js +1 -1
  88. package/dist/components/pack-token.js.map +1 -1
  89. package/dist/components/people.js +2 -2
  90. package/dist/components/people.js.map +1 -1
  91. package/dist/components/pictures.js +1 -1
  92. package/dist/components/pictures.js.map +1 -1
  93. package/dist/components/plugin-settings.d.ts +22 -1
  94. package/dist/components/plugin-settings.d.ts.map +1 -1
  95. package/dist/components/plugin-settings.js +63 -11
  96. package/dist/components/plugin-settings.js.map +1 -1
  97. package/dist/components/projects.js +1 -1
  98. package/dist/components/projects.js.map +1 -1
  99. package/dist/components/roadmap.js +2 -2
  100. package/dist/components/roadmap.js.map +1 -1
  101. package/dist/components/rules.js +2 -2
  102. package/dist/components/rules.js.map +1 -1
  103. package/dist/components/runs.d.ts.map +1 -1
  104. package/dist/components/runs.js +1 -1
  105. package/dist/components/runs.js.map +1 -1
  106. package/dist/components/sessions.js +1 -1
  107. package/dist/components/sessions.js.map +1 -1
  108. package/dist/components/shell.d.ts +2 -0
  109. package/dist/components/shell.d.ts.map +1 -1
  110. package/dist/components/shell.js +1 -1
  111. package/dist/components/shell.js.map +1 -1
  112. package/dist/components/sign-in.js +2 -2
  113. package/dist/components/sign-in.js.map +1 -1
  114. package/dist/components/skills.d.ts.map +1 -1
  115. package/dist/components/skills.js +1 -1
  116. package/dist/components/skills.js.map +1 -1
  117. package/dist/components/task-view.d.ts +6 -0
  118. package/dist/components/task-view.d.ts.map +1 -1
  119. package/dist/components/task-view.js +3 -2
  120. package/dist/components/task-view.js.map +1 -1
  121. package/dist/components/tokens.js +1 -1
  122. package/dist/components/tokens.js.map +1 -1
  123. package/dist/components/ui.d.ts +21 -2
  124. package/dist/components/ui.d.ts.map +1 -1
  125. package/dist/components/ui.js +24 -3
  126. package/dist/components/ui.js.map +1 -1
  127. package/dist/components/work.js +1 -1
  128. package/dist/components/work.js.map +1 -1
  129. package/dist/console.css +506 -289
  130. package/dist/console.d.ts.map +1 -1
  131. package/dist/console.js +193 -16
  132. package/dist/console.js.map +1 -1
  133. package/dist/data.d.ts +17 -1
  134. package/dist/data.d.ts.map +1 -1
  135. package/dist/data.js +31 -0
  136. package/dist/data.js.map +1 -1
  137. package/dist/desk-page.js +5 -5
  138. package/dist/desk-page.js.map +1 -1
  139. package/dist/feed-words.d.ts +5 -0
  140. package/dist/feed-words.d.ts.map +1 -0
  141. package/dist/feed-words.js +193 -0
  142. package/dist/feed-words.js.map +1 -0
  143. package/dist/i18n/en.d.ts +93 -1
  144. package/dist/i18n/en.d.ts.map +1 -1
  145. package/dist/i18n/en.js +103 -15
  146. package/dist/i18n/en.js.map +1 -1
  147. package/dist/i18n/ko.d.ts.map +1 -1
  148. package/dist/i18n/ko.js +105 -22
  149. package/dist/i18n/ko.js.map +1 -1
  150. package/dist/icons/glyphs.d.ts +370 -104
  151. package/dist/icons/glyphs.d.ts.map +1 -1
  152. package/dist/icons/glyphs.js +72 -66
  153. package/dist/icons/glyphs.js.map +1 -1
  154. package/dist/icons/index.d.ts.map +1 -1
  155. package/dist/icons/index.js +9 -1
  156. package/dist/icons/index.js.map +1 -1
  157. package/dist/index.d.ts +3 -2
  158. package/dist/index.d.ts.map +1 -1
  159. package/dist/index.js +3 -2
  160. package/dist/index.js.map +1 -1
  161. package/dist/limits.d.ts +7 -0
  162. package/dist/limits.d.ts.map +1 -1
  163. package/dist/limits.js +7 -0
  164. package/dist/limits.js.map +1 -1
  165. package/dist/notifications.d.ts +124 -0
  166. package/dist/notifications.d.ts.map +1 -0
  167. package/dist/notifications.js +147 -0
  168. package/dist/notifications.js.map +1 -0
  169. package/dist/onboarding.d.ts.map +1 -1
  170. package/dist/onboarding.js +7 -12
  171. package/dist/onboarding.js.map +1 -1
  172. package/dist/plugin/capabilities.d.ts +1 -1
  173. package/dist/plugin/capabilities.d.ts.map +1 -1
  174. package/dist/plugin/capabilities.js +10 -0
  175. package/dist/plugin/capabilities.js.map +1 -1
  176. package/dist/plugin/context.d.ts +85 -1
  177. package/dist/plugin/context.d.ts.map +1 -1
  178. package/dist/plugin/limits.d.ts +7 -0
  179. package/dist/plugin/limits.d.ts.map +1 -1
  180. package/dist/plugin/limits.js +7 -0
  181. package/dist/plugin/limits.js.map +1 -1
  182. package/dist/plugin/manifest.d.ts +8 -0
  183. package/dist/plugin/manifest.d.ts.map +1 -1
  184. package/dist/plugin/manifest.js +13 -0
  185. package/dist/plugin/manifest.js.map +1 -1
  186. package/dist/plugin/rest-schemas.d.ts +22 -0
  187. package/dist/plugin/rest-schemas.d.ts.map +1 -1
  188. package/dist/plugin/rest-schemas.js +19 -3
  189. package/dist/plugin/rest-schemas.js.map +1 -1
  190. package/dist/plugin/testing.d.ts +2 -0
  191. package/dist/plugin/testing.d.ts.map +1 -1
  192. package/dist/plugin/testing.js +2 -0
  193. package/dist/plugin/testing.js.map +1 -1
  194. package/dist/plugin.d.ts +1 -1
  195. package/dist/plugin.d.ts.map +1 -1
  196. package/dist/plugin.js +1 -1
  197. package/dist/plugin.js.map +1 -1
  198. package/dist/router.d.ts +6 -0
  199. package/dist/router.d.ts.map +1 -1
  200. package/dist/router.js +5 -0
  201. package/dist/router.js.map +1 -1
  202. package/dist/routes.d.ts +2 -0
  203. package/dist/routes.d.ts.map +1 -1
  204. package/dist/routes.js +2 -0
  205. package/dist/routes.js.map +1 -1
  206. package/dist/rules.js +1 -1
  207. package/dist/rules.js.map +1 -1
  208. package/dist/runner/acp.d.ts.map +1 -1
  209. package/dist/runner/acp.js +12 -97
  210. package/dist/runner/acp.js.map +1 -1
  211. package/dist/runner/browser.d.ts +50 -0
  212. package/dist/runner/browser.d.ts.map +1 -0
  213. package/dist/runner/browser.js +104 -0
  214. package/dist/runner/browser.js.map +1 -0
  215. package/dist/runner/claude.d.ts +1 -2
  216. package/dist/runner/claude.d.ts.map +1 -1
  217. package/dist/runner/claude.js +352 -13
  218. package/dist/runner/claude.js.map +1 -1
  219. package/dist/runner/codex.d.ts +9 -10
  220. package/dist/runner/codex.d.ts.map +1 -1
  221. package/dist/runner/codex.js +809 -346
  222. package/dist/runner/codex.js.map +1 -1
  223. package/dist/runner/config.d.ts +14 -3
  224. package/dist/runner/config.d.ts.map +1 -1
  225. package/dist/runner/config.js +27 -7
  226. package/dist/runner/config.js.map +1 -1
  227. package/dist/runner/desk.d.ts +3 -1
  228. package/dist/runner/desk.d.ts.map +1 -1
  229. package/dist/runner/desk.js +17 -5
  230. package/dist/runner/desk.js.map +1 -1
  231. package/dist/runner/message.d.ts +53 -3
  232. package/dist/runner/message.d.ts.map +1 -1
  233. package/dist/runner/message.js +201 -20
  234. package/dist/runner/message.js.map +1 -1
  235. package/dist/runner/registry.d.ts +6 -0
  236. package/dist/runner/registry.d.ts.map +1 -1
  237. package/dist/runner/registry.js.map +1 -1
  238. package/dist/runner/rpc.d.ts +31 -0
  239. package/dist/runner/rpc.d.ts.map +1 -0
  240. package/dist/runner/rpc.js +102 -0
  241. package/dist/runner/rpc.js.map +1 -0
  242. package/dist/runner/runner.d.ts +41 -1
  243. package/dist/runner/runner.d.ts.map +1 -1
  244. package/dist/runner/runner.js +695 -52
  245. package/dist/runner/runner.js.map +1 -1
  246. package/dist/runner/slack.d.ts +17 -8
  247. package/dist/runner/slack.d.ts.map +1 -1
  248. package/dist/runner/slack.js +1250 -78
  249. package/dist/runner/slack.js.map +1 -1
  250. package/dist/runner/types.d.ts +160 -8
  251. package/dist/runner/types.d.ts.map +1 -1
  252. package/dist/runner/types.js.map +1 -1
  253. package/dist/runner/usage.d.ts +105 -0
  254. package/dist/runner/usage.d.ts.map +1 -0
  255. package/dist/runner/usage.js +218 -0
  256. package/dist/runner/usage.js.map +1 -0
  257. package/dist/runner.d.ts +4 -4
  258. package/dist/runner.d.ts.map +1 -1
  259. package/dist/runner.js +3 -3
  260. package/dist/runner.js.map +1 -1
  261. package/dist/schemas.d.ts +673 -0
  262. package/dist/schemas.d.ts.map +1 -1
  263. package/dist/schemas.js +205 -1
  264. package/dist/schemas.js.map +1 -1
  265. package/dist/services.js +3 -3
  266. package/dist/services.js.map +1 -1
  267. package/dist/setup-guide.d.ts +4 -3
  268. package/dist/setup-guide.d.ts.map +1 -1
  269. package/dist/setup-guide.js +11 -13
  270. package/dist/setup-guide.js.map +1 -1
  271. package/dist/text.d.ts +7 -0
  272. package/dist/text.d.ts.map +1 -1
  273. package/dist/text.js +18 -0
  274. package/dist/text.js.map +1 -1
  275. package/dist/vocabulary.d.ts +4 -2
  276. package/dist/vocabulary.d.ts.map +1 -1
  277. package/dist/vocabulary.js +4 -1
  278. package/dist/vocabulary.js.map +1 -1
  279. package/docs/specs/cli.md +26 -19
  280. package/docs/specs/plugins.md +16 -10
  281. package/docs/specs/rest.md +28 -10
  282. package/docs/specs/runner.md +132 -44
  283. package/package.json +4 -4
  284. package/skills/building-a-console/SKILL.md +2 -2
  285. package/skills/building-a-console/references/configuring.md +1 -1
  286. package/skills/building-a-plugin/SKILL.md +4 -4
  287. package/skills/planning-the-board/SKILL.md +1 -1
  288. package/skills/planning-the-board/references/setting-up.md +2 -2
  289. package/skills/running-an-agent/SKILL.md +15 -64
  290. package/skills/running-an-agent/references/preparing-the-machine.md +17 -0
  291. package/skills/running-an-agent/references/several-tasks.md +37 -0
  292. package/skills/running-an-agent/references/slack-app.md +70 -13
  293. package/skills/running-an-agent/references/the-account-and-the-invitation.md +5 -0
  294. package/skills/running-an-agent/references/what-was-not-seen-run-yet.md +3 -0
  295. package/skills/running-an-agent/references/when-the-agent-could-not-go-on.md +16 -0
  296. package/skills/running-an-agent/references/your-first-task.md +14 -0
  297. package/skills/working-the-board/SKILL.md +9 -12
  298. package/skills/working-the-board/references/a-pack-skills-questions.md +3 -0
  299. package/skills/working-the-board/references/a-plugins-commands.md +3 -0
  300. package/skills/working-the-board/references/a-review.md +3 -0
  301. package/skills/working-the-board/references/an-open-run.md +3 -0
  302. package/skills/working-the-board/references/requirements.md +7 -0
  303. package/skills/working-the-board/references/the-pack.md +2 -2
  304. package/skills/working-the-board/references/what-they-were-told.md +3 -0
  305. package/skills/working-the-board/references/work-given-in-chat.md +5 -0
  306. package/src/agent-page.tsx +76 -47
  307. package/src/agent-usage.ts +113 -0
  308. package/src/api.ts +62 -0
  309. package/src/cli/cli.ts +634 -162
  310. package/src/cli/format.ts +190 -47
  311. package/src/cli/help.ts +77 -12
  312. package/src/cli/machine-check.ts +182 -29
  313. package/src/cli/pack.ts +81 -40
  314. package/src/cli/runner-host.ts +3 -0
  315. package/src/cli/secret-notes.ts +9 -1
  316. package/src/cli/terminal.ts +20 -4
  317. package/src/client.ts +94 -6
  318. package/src/components/agent-page.tsx +280 -63
  319. package/src/components/agents.tsx +23 -3
  320. package/src/components/calendar.tsx +93 -37
  321. package/src/components/categories.tsx +2 -2
  322. package/src/components/comments.tsx +5 -5
  323. package/src/components/decision-list.tsx +13 -10
  324. package/src/components/documents.tsx +13 -8
  325. package/src/components/event-feed.tsx +4 -203
  326. package/src/components/goals.tsx +6 -4
  327. package/src/components/home.tsx +12 -12
  328. package/src/components/icon.tsx +16 -3
  329. package/src/components/notifications.tsx +419 -0
  330. package/src/components/pack-connect.tsx +1 -1
  331. package/src/components/pack-token.tsx +5 -5
  332. package/src/components/people.tsx +3 -3
  333. package/src/components/pictures.tsx +1 -1
  334. package/src/components/plugin-settings.tsx +128 -23
  335. package/src/components/projects.tsx +1 -1
  336. package/src/components/roadmap.tsx +2 -2
  337. package/src/components/rules.tsx +2 -2
  338. package/src/components/runs.tsx +6 -3
  339. package/src/components/sessions.tsx +2 -2
  340. package/src/components/shell.tsx +3 -0
  341. package/src/components/sign-in.tsx +3 -3
  342. package/src/components/skills.tsx +5 -3
  343. package/src/components/task-view.tsx +18 -7
  344. package/src/components/tokens.tsx +2 -2
  345. package/src/components/ui.tsx +70 -5
  346. package/src/components/work.tsx +2 -2
  347. package/src/console.tsx +269 -12
  348. package/src/data.ts +54 -0
  349. package/src/desk-page.tsx +5 -5
  350. package/src/feed-words.ts +214 -0
  351. package/src/i18n/en.ts +114 -15
  352. package/src/i18n/ko.ts +115 -22
  353. package/src/icons/glyphs.ts +74 -68
  354. package/src/icons/index.ts +9 -1
  355. package/src/index.ts +11 -0
  356. package/src/limits.ts +7 -0
  357. package/src/notifications.ts +205 -0
  358. package/src/onboarding.ts +10 -14
  359. package/src/plugin/capabilities.ts +13 -0
  360. package/src/plugin/context.ts +87 -0
  361. package/src/plugin/limits.ts +7 -0
  362. package/src/plugin/manifest.ts +14 -0
  363. package/src/plugin/rest-schemas.ts +27 -3
  364. package/src/plugin/testing.ts +4 -0
  365. package/src/plugin.ts +2 -0
  366. package/src/router.ts +7 -0
  367. package/src/routes.ts +2 -0
  368. package/src/rules.ts +1 -1
  369. package/src/runner/acp.ts +12 -118
  370. package/src/runner/browser.ts +128 -0
  371. package/src/runner/claude.ts +399 -12
  372. package/src/runner/codex.ts +904 -400
  373. package/src/runner/config.ts +30 -7
  374. package/src/runner/desk.ts +22 -6
  375. package/src/runner/message.ts +251 -21
  376. package/src/runner/registry.ts +6 -0
  377. package/src/runner/rpc.ts +140 -0
  378. package/src/runner/runner.ts +863 -53
  379. package/src/runner/slack.ts +1535 -85
  380. package/src/runner/types.ts +150 -5
  381. package/src/runner/usage.ts +299 -0
  382. package/src/runner.ts +16 -1
  383. package/src/schemas.ts +249 -0
  384. package/src/services.ts +3 -3
  385. package/src/setup-guide.ts +12 -14
  386. package/src/styles/README.md +11 -7
  387. package/src/styles/console.css +2 -0
  388. package/src/styles/drawn-by-pages.json +7 -82
  389. package/src/styles/pages/agents.css +46 -35
  390. package/src/styles/pages/calendar.css +0 -1
  391. package/src/styles/pages/connect.css +0 -14
  392. package/src/styles/pages/decisions.css +2 -43
  393. package/src/styles/pages/documents.css +0 -29
  394. package/src/styles/pages/home.css +4 -16
  395. package/src/styles/pages/people.css +2 -17
  396. package/src/styles/pages/plugins.css +9 -12
  397. package/src/styles/pages/roadmap.css +0 -16
  398. package/src/styles/pages/settings.css +0 -28
  399. package/src/styles/pages/sign-in.css +2 -17
  400. package/src/styles/pages/thread.css +4 -50
  401. package/src/styles/pages/work.css +0 -5
  402. package/src/styles/parts/button.css +31 -0
  403. package/src/styles/parts/count.css +10 -0
  404. package/src/styles/parts/divider.css +17 -0
  405. package/src/styles/parts/frame.css +12 -0
  406. package/src/styles/parts/icon.css +39 -0
  407. package/src/styles/parts/menu.css +184 -0
  408. package/src/styles/parts/panel.css +7 -0
  409. package/src/styles/parts/progress.css +63 -0
  410. package/src/styles/parts/settings.css +2 -0
  411. package/src/styles/parts/sheet.css +28 -0
  412. package/src/styles/parts/text.css +34 -0
  413. package/src/text.ts +19 -0
  414. package/src/vocabulary.ts +4 -1
  415. package/template/plugin/package.json +1 -1
package/src/limits.ts CHANGED
@@ -70,6 +70,11 @@ export const MAX_RUNNER_LINE_LENGTH = 120;
70
70
  export const MAX_RUNNER_OFFERS = 50;
71
71
  /** How many wake sources a runner says it keeps beside the console's own. */
72
72
  export const MAX_RUNNER_SOURCES = 10;
73
+ /** How many windows of its product's allowance a runner says, and how long a window's name is (ADR-0156). */
74
+ export const MAX_RUNNER_USAGE_WINDOWS = 8;
75
+ export const MAX_USAGE_WINDOW_NAME_LENGTH = 40;
76
+ /** How long the name of a kind of notification may be, as a request names one (ADR-0157). */
77
+ export const MAX_NOTIFICATION_KIND_LENGTH = 40;
73
78
  /** How many wakes an agent account keeps for itself for later at a time, and how far ahead one may be (ADR-0145). */
74
79
  export const MAX_OWN_WAKES = 20;
75
80
  export const MAX_OWN_WAKE_DAYS = 31;
@@ -105,6 +110,8 @@ export const MAX_AGENT_SESSIONS_PER_HOUR = 60;
105
110
  export const MAX_RUNNER_WAKES_PER_HOUR = 600;
106
111
  /** 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
112
  export const MAX_OWN_WAKES_PER_HOUR = 30;
113
+ /** How many times an agent account begins a new conversation for itself within an hour (ADR-0154). */
114
+ export const MAX_OWN_RESETS_PER_HOUR = 6;
108
115
  export const MAX_AGENT_STATE_CHANGES_PER_HOUR = 20;
109
116
  /** How many events one page of a session carries when none is asked for, and the most it may. */
110
117
  export const TRANSCRIPT_PAGE_LIMIT = 100;
@@ -0,0 +1,205 @@
1
+ // What a member is told of what happens on the board (ADR-0157): the kinds of it, what each
2
+ // member is told where they chose nothing, and how one event becomes at most one notification
3
+ // for one member. The console decides who is told and keeps the record; carrying it out of the
4
+ // console, to a messenger say, is a plugin's, of what the console made and no more: a kind a
5
+ // member turned off is carried by nobody, and which of the kinds they have on a plugin carries
6
+ // is that plugin's to offer and to keep, on a page and in a store of its own; the console
7
+ // keeps no setting of a plugin's. The rules that name whom an event concerns are the worker's
8
+ // (`apps/console`), which reads the board; what is here needs no database, and is read by the
9
+ // pages and the command as the console reads it.
10
+
11
+ /**
12
+ * What a notification is of, as the member reads why they are told:
13
+ *
14
+ * - `assigned`: a task was given to them, as its owner or as someone at work on it;
15
+ * - `ready`: a task they are at work on is ready to begin, and not planned for a later day;
16
+ * - `moved`: a task they own went from one state to another;
17
+ * - `changed`: the title, the body or the days of a task of theirs changed;
18
+ * - `commented`: someone wrote on a task of theirs;
19
+ * - `archived`: a task of theirs was put away;
20
+ * - `decision`: a decision waits for them;
21
+ * - `answered`: a decision they raised was answered;
22
+ * - `agent`: an agent account that reports to them stands otherwise: it stopped, was refused,
23
+ * failed or is not heard from, or runs again after; or it raised a decision for them, which
24
+ * is how an account tells its manager of what it will not do by itself (ADR-0158).
25
+ */
26
+ export const NOTIFICATION_KINDS = [
27
+ "assigned",
28
+ "ready",
29
+ "moved",
30
+ "changed",
31
+ "commented",
32
+ "archived",
33
+ "decision",
34
+ "answered",
35
+ "agent",
36
+ ] as const;
37
+ export type NotificationKind = (typeof NOTIFICATION_KINDS)[number];
38
+
39
+ /**
40
+ * What a member made of one task for themselves, as it is kept: its notifications turned on
41
+ * where their settings would tell them nothing of it (`following`, told of everything on it),
42
+ * or turned off where their settings would tell them (`muted`, told of nothing). A member who
43
+ * left a task as their settings have it keeps nothing: see `taskFollowToKeep`.
44
+ */
45
+ export const TASK_FOLLOW_STATES = ["following", "muted"] as const;
46
+ export type TaskFollowState = (typeof TASK_FOLLOW_STATES)[number];
47
+
48
+ /** Which kinds a member is told of, each on or off. */
49
+ export type NotificationKinds = Readonly<Record<NotificationKind, boolean>>;
50
+
51
+ const kinds = (on: readonly NotificationKind[]): NotificationKinds =>
52
+ Object.fromEntries(NOTIFICATION_KINDS.map((kind) => [kind, on.includes(kind)])) as Record<
53
+ NotificationKind,
54
+ boolean
55
+ >;
56
+
57
+ /**
58
+ * What a member is told of where they chose nothing. A person is told of the agent accounts
59
+ * that report to them, which is what cannot wait, and of nothing else until they turn it on:
60
+ * what happens to their own work is on the board when they look, and a notification they did
61
+ * not ask for is noise. An agent account is told of what asks something of it, a task to
62
+ * begin, a comment, a decision that waits for it, an answer to one it raised: nobody attends
63
+ * an agent account, so that what it is not told of it does not learn of.
64
+ */
65
+ export const NOTIFICATION_DEFAULTS: Readonly<Record<"person" | "agent", NotificationKinds>> = {
66
+ person: kinds(["agent"]),
67
+ agent: kinds(["ready", "commented", "decision", "answered", "agent"]),
68
+ };
69
+
70
+ /** What a member chose, as it is kept: only what they chose, so that what they did not follows the defaults. */
71
+ export interface ChosenNotifications {
72
+ readonly kinds?: Readonly<Partial<Record<NotificationKind, boolean>>> | undefined;
73
+ /** The projects they are told nothing of, by their ids. */
74
+ readonly projectsOff?: readonly string[] | undefined;
75
+ /** Whether they are told of what an agent of their own did as them. */
76
+ readonly ownAgents?: boolean | undefined;
77
+ }
78
+
79
+ /** What a member is told of: their choices over the defaults of what they are. */
80
+ export interface NotificationSettings {
81
+ readonly kinds: NotificationKinds;
82
+ readonly projectsOff: readonly string[];
83
+ readonly ownAgents: boolean;
84
+ }
85
+
86
+ /** A member's settings from what they chose, `null` or nothing for a member who chose nothing. */
87
+ export function notificationSettingsOf(
88
+ member: "person" | "agent",
89
+ chosen: ChosenNotifications | null | undefined,
90
+ ): NotificationSettings {
91
+ const defaults = NOTIFICATION_DEFAULTS[member];
92
+ return {
93
+ kinds: Object.fromEntries(
94
+ NOTIFICATION_KINDS.map((kind) => {
95
+ const said = chosen?.kinds?.[kind];
96
+ return [kind, typeof said === "boolean" ? said : defaults[kind]];
97
+ }),
98
+ ) as Record<NotificationKind, boolean>,
99
+ projectsOff: [...(chosen?.projectsOff ?? [])],
100
+ ownAgents: chosen?.ownAgents === true,
101
+ };
102
+ }
103
+
104
+ /**
105
+ * The kinds a task goes on telling a member under by what they are to it: its owner of where
106
+ * it goes and of what is said and changed on it, whoever is at work on it of its being ready
107
+ * and of the same. Being given a task (`assigned`) is said once, when it is given, and is
108
+ * none of what a task still tells. Held equal to the worker's rules by its test
109
+ * (`apps/console`, `notifications.int.test.ts`).
110
+ */
111
+ export const TASK_KINDS_OF: Readonly<Record<"owner" | "worker", readonly NotificationKind[]>> = {
112
+ owner: ["moved", "changed", "commented", "archived"],
113
+ worker: ["ready", "changed", "commented", "archived"],
114
+ };
115
+
116
+ /**
117
+ * Whether a task tells a member anything where they chose nothing of it: they own it or are at
118
+ * work on it, have one of the kinds on that it tells such a member under, and did not turn its
119
+ * project off. It is what a task's bell shows before anyone touched it.
120
+ */
121
+ export function taskToldByDefault(input: {
122
+ readonly settings: NotificationSettings;
123
+ readonly owner: boolean;
124
+ readonly worker: boolean;
125
+ readonly projectId: string;
126
+ }): boolean {
127
+ const { settings } = input;
128
+ if (settings.projectsOff.includes(input.projectId)) {
129
+ return false;
130
+ }
131
+ const on = (kinds: readonly NotificationKind[]): boolean =>
132
+ kinds.some((kind) => settings.kinds[kind]);
133
+ return (input.owner && on(TASK_KINDS_OF.owner)) || (input.worker && on(TASK_KINDS_OF.worker));
134
+ }
135
+
136
+ /** Whether a task tells a member anything, by what they chose of it over what their settings say. */
137
+ export const taskTold = (chosen: TaskFollowState | undefined, usual: boolean): boolean =>
138
+ chosen === undefined ? usual : chosen === "following";
139
+
140
+ /**
141
+ * What is kept when a member turns a task's notifications on or off: nothing where that is
142
+ * what their settings say already, so that a task turned off and on again is told as before,
143
+ * by their kinds; `following` where they turn on a task their settings would be silent of,
144
+ * which then tells them of everything on it, since no kind of theirs would; `muted` where
145
+ * they turn off one their settings would tell them of.
146
+ */
147
+ export const taskFollowToKeep = (on: boolean, usual: boolean): TaskFollowState | undefined =>
148
+ on === usual ? undefined : on ? "following" : "muted";
149
+
150
+ /**
151
+ * The kind an event is told to one member under, or nothing where they are told nothing of it.
152
+ * `candidates` are the kinds the event is to the member by what they are to the thing, the one
153
+ * that says most first: a task made ready that they are at work on is `ready` before it is
154
+ * `assigned`.
155
+ *
156
+ * - A task whose notifications they turned off (`muted`) tells them nothing, whatever they
157
+ * are to it.
158
+ * - A task whose notifications they turned on themselves (`following`) tells them everything,
159
+ * under the first kind, whatever their settings: it is the member saying so of that one task.
160
+ * - Otherwise they are told under the first kind they have on, and of nothing in a project
161
+ * they turned off.
162
+ *
163
+ * `follow` is theirs of the task the event is of; nothing for an event of no task.
164
+ */
165
+ export function notificationKindFor(input: {
166
+ readonly candidates: readonly NotificationKind[];
167
+ readonly settings: NotificationSettings;
168
+ readonly follow: TaskFollowState | undefined;
169
+ /** The project the event is of, by its id; nothing for an event of the workspace itself. */
170
+ readonly projectId: string | undefined;
171
+ }): NotificationKind | undefined {
172
+ const { candidates, settings, follow } = input;
173
+ if (candidates.length === 0 || follow === "muted") {
174
+ return undefined;
175
+ }
176
+ if (follow === "following") {
177
+ return candidates[0];
178
+ }
179
+ if (input.projectId !== undefined && settings.projectsOff.includes(input.projectId)) {
180
+ return undefined;
181
+ }
182
+ return candidates.find((kind) => settings.kinds[kind]);
183
+ }
184
+
185
+ /**
186
+ * The moment from which a member's list shows what is new, kept from one opening of it to the
187
+ * next until its rows were shown: the moment the first of them read something at. An opening
188
+ * whose answer never arrived, the list closed and opened again before it or the listing
189
+ * failed, read the notifications all the same, so that the next opening reads nothing and
190
+ * would show nothing as new: what it shows as new is what was read at the kept moment on.
191
+ */
192
+ export const unseenSince = (
193
+ kept: string | undefined,
194
+ read: { readonly read: number; readonly at: string },
195
+ ): string | undefined => kept ?? (read.read > 0 ? read.at : undefined);
196
+
197
+ /** How many notifications a listing answers at once, and at most. */
198
+ export const NOTIFICATIONS_PAGE = 50;
199
+ export const MAX_NOTIFICATIONS_PAGE = 200;
200
+ /** How many notifications one request marks as read by their ids. */
201
+ export const MAX_NOTIFICATIONS_READ = 200;
202
+ /** How many projects a member may turn off. */
203
+ export const MAX_NOTIFICATION_PROJECTS_OFF = 200;
204
+ /** For how many days a notification is kept (the record is the feed's; this is the member's list of it). */
205
+ export const NOTIFICATIONS_KEPT_DAYS = 90;
package/src/onboarding.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { RestWorkspace } from "./schemas.js";
2
- import { BROWSER_TOOL_OF_A_PRODUCT, guideServicesOf } from "./setup-guide.js";
2
+ import { BROWSER_OF_AN_AGENT, 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
@@ -9,7 +9,8 @@ import { BROWSER_TOOL_OF_A_PRODUCT, guideServicesOf } from "./setup-guide.js";
9
9
  // the console never ends, and the task is finished when nothing of it waits on anyone: a run
10
10
  // finished with decisions waiting could ask no more. The task's words are made here, for one account and the
11
11
  // services of its workspace, in the words of their modules: English, as a skill is, for the
12
- // agent to read as they are.
12
+ // agent to read as they are. Every task says how help is asked, whatever the services are
13
+ // (ADR-0152): the agent does everything it can itself, and what it cannot is its own to judge.
13
14
 
14
15
  export interface OnboardingInput {
15
16
  /** The account's handle: what the task and its commands name it by. */
@@ -41,8 +42,8 @@ export function onboardingOf(input: OnboardingInput): {
41
42
  const own = [
42
43
  ...services.flatMap((one) => one.onboarding.map((step) => item(step.title, step.body))),
43
44
  item(
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. ${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.`,
45
+ "Sign in at a page in the browser you are started with",
46
+ `Use the browser your runner.json names as "browser": it keeps a profile, so a sign-in stays there from one session to the next. ${BROWSER_OF_AN_AGENT} Nothing you sign in with goes into a message, a task or a comment.`,
46
47
  ),
47
48
  item(
48
49
  "Put your picture on your profiles",
@@ -64,16 +65,11 @@ export function onboardingOf(input: OnboardingInput): {
64
65
  "## What you do yourself",
65
66
  "",
66
67
  ...own,
67
- ...(asked.length === 0
68
- ? []
69
- : [
70
- "",
71
- "## What you ask for",
72
- "",
73
- `What you cannot do yourself. Ask for each as a decision, of whoever can do it, and of your manager where you do not know who. Say the exact values, what to hand back and how, and offer "Done" and "Not now": \`console ask "<question>" --option "Done" --option "Not now"\`. A secret that is handed back is seeded where only you read it, by whoever has it: \`console agent secret ${handle} <name>\`. Go on with the rest meanwhile: the answer wakes you.`,
74
- "",
75
- ...asked,
76
- ]),
68
+ "",
69
+ "## What you ask for",
70
+ "",
71
+ `Do everything you can yourself, and ask for help only with what you cannot do. Ask for that as a decision, of whoever can do it, and of your manager where you do not know who. Say the exact values, what to hand back and how, and offer "Done" and "Not now": \`console ask "<question>" --option "Done" --option "Not now"\`. A secret that is handed back is seeded where only you read it, by whoever has it: \`console agent secret ${handle} <name>\`. Go on with the rest meanwhile: the answer wakes you.`,
72
+ ...(asked.length === 0 ? [] : ["", ...asked]),
77
73
  "",
78
74
  "## When you are done",
79
75
  "",
@@ -9,6 +9,7 @@ export const PLUGIN_CAPABILITIES = [
9
9
  "people:read",
10
10
  "people:read:all",
11
11
  "people:read:email",
12
+ "people:accounts",
12
13
  "people:act",
13
14
  "projects:read",
14
15
  "projects:read:all",
@@ -18,6 +19,7 @@ export const PLUGIN_CAPABILITIES = [
18
19
  "board:documents",
19
20
  "events:console",
20
21
  "events:plugins",
22
+ "notifications:read",
21
23
  "jobs",
22
24
  "endpoints",
23
25
  "storage:sql",
@@ -66,6 +68,12 @@ export const CAPABILITY_WORDS: Readonly<Record<PluginCapability, CapabilityWords
66
68
  opens: "the work email of the people it may read, to match them to accounts elsewhere",
67
69
  reach: "the addresses of the people its role holders may see",
68
70
  },
71
+ "people:accounts": {
72
+ opens:
73
+ "saying which account at a messenger is which member's: an agent account's wake from there says by it who wrote, and whether a supervisor of its own did",
74
+ reach:
75
+ "anyone's account at a messenger said to be a supervisor's, whose word there an agent account then takes as an instruction; every change is an event of the workspace, under the plugin's name",
76
+ },
69
77
  "people:act": {
70
78
  opens:
71
79
  "acting for a person who did something elsewhere: a command run and a decision answered as them, within what they may do, recorded as theirs through the plugin",
@@ -104,6 +112,11 @@ export const CAPABILITY_WORDS: Readonly<Record<PluginCapability, CapabilityWords
104
112
  opens: "hooks on the events other plugins emit",
105
113
  reach: "what they publish",
106
114
  },
115
+ "notifications:read": {
116
+ opens:
117
+ "with a console event it hears, whom the console told of it and under which kind, to carry it to them elsewhere; and of whoever calls it, what they chose to be told of",
118
+ reach: "who is told of what on those boards, and so what each member chose to be told of",
119
+ },
107
120
  jobs: {
108
121
  opens: "runs on a schedule",
109
122
  reach: "time, within the bound",
@@ -9,6 +9,7 @@ import type {
9
9
  RestDocument,
10
10
  RestDocumentSummary,
11
11
  RestMember,
12
+ RestNotificationSettings,
12
13
  RestPerson,
13
14
  RestProject,
14
15
  RestRun,
@@ -345,6 +346,18 @@ export interface DecisionAsk {
345
346
  readonly about: { readonly collection: string; readonly id: string };
346
347
  }
347
348
 
349
+ /** An account at a messenger said to be a member's (ADR-0164): the messenger by its name, the workspace there and the account by the messenger's ids. */
350
+ export interface PluginMessengerAccount {
351
+ /** What `list` reads on from. */
352
+ readonly id: string;
353
+ readonly personId: string;
354
+ readonly messenger: string;
355
+ readonly workspace: string;
356
+ readonly account: string;
357
+ /** When it was said, an instant as text. */
358
+ readonly since: string;
359
+ }
360
+
348
361
  /** The console's board, as a plugin reaches it with the `board:*` capabilities, each read the caller's own. */
349
362
  export interface PluginConsole {
350
363
  workspace(): Promise<PluginWorkspace>;
@@ -359,6 +372,56 @@ export interface PluginConsole {
359
372
  */
360
373
  granted(role: string): Promise<readonly RestPerson[]>;
361
374
  };
375
+ /**
376
+ * Which account at a messenger is a member's (ADR-0164), with `people:accounts`: said by a
377
+ * plugin that matched the member to the account by something the messenger and the console
378
+ * both hold, an address say, and never by a name or by what a message says. An agent account's
379
+ * wake from that messenger says by it who wrote, and whether a supervisor of the account did,
380
+ * whose word there instructs it; so a plugin says an account only as surely as it would let
381
+ * that person instruct, and takes it back when the match no longer holds. What a plugin said
382
+ * is its own to list and to take back, and counts while the plugin is enabled and holds the
383
+ * capability. Left out by a console older than the capability.
384
+ */
385
+ accounts: {
386
+ /** What this plugin said of a workspace of a messenger, in the order it was said: a page, and `after` to read on from where there is more. */
387
+ list(where: {
388
+ readonly messenger: string;
389
+ readonly workspace: string;
390
+ readonly after?: string;
391
+ readonly limit?: number;
392
+ }): Promise<{
393
+ readonly items: readonly PluginMessengerAccount[];
394
+ readonly after: string | null;
395
+ }>;
396
+ /**
397
+ * Says that the account is the person's. What this plugin said before of the account, or of
398
+ * the person in that workspace, gives way; what another plugin said of either stands
399
+ * (`plugin.conflict`). The person is active (`plugin.not_found` otherwise).
400
+ */
401
+ put(account: {
402
+ readonly personId: string;
403
+ readonly messenger: string;
404
+ readonly workspace: string;
405
+ readonly account: string;
406
+ }): Promise<PluginMessengerAccount>;
407
+ /** Takes back what this plugin said of the person's account in that workspace; whether it had said one. */
408
+ remove(account: {
409
+ readonly personId: string;
410
+ readonly messenger: string;
411
+ readonly workspace: string;
412
+ }): Promise<boolean>;
413
+ };
414
+ /**
415
+ * What the caller chose to be told of (ADR-0165), for a plugin that carries notifications
416
+ * elsewhere (`notifications:read`) to show beside its own choice: a kind that is off in the
417
+ * console makes no notification to carry. A member's own call reads their own, a person's,
418
+ * their agent's or an agent account's, and any other caller is `plugin.forbidden`, a hook, a
419
+ * job and a call a plugin makes for someone among them. `projectsOff` names those the plugin is on.
420
+ * Left out by a console older than 0.6.2.
421
+ */
422
+ notifications: {
423
+ settings(): Promise<RestNotificationSettings>;
424
+ };
362
425
  /** The teams of the workspace (ADR-0073): a name and its members, among the people the caller may see. */
363
426
  teams: {
364
427
  list(): Promise<readonly RestTeam[]>;
@@ -634,9 +697,33 @@ export interface PluginHookEvent {
634
697
  /** The plugin that emitted or caused it, or none. */
635
698
  readonly plugin: string | null;
636
699
  readonly project: { readonly id: string; readonly key: string } | null;
700
+ /**
701
+ * What the event carries. Of a console event, with `notifications:read`, `told` is among it
702
+ * (ADR-0157): whom the console told of the event, each `{ personId, kind, woken, followed }`,
703
+ * the kind one of `NOTIFICATION_KINDS`, `woken` where the console told the member itself, by
704
+ * a wake of its agent account, so that whoever carries notifications elsewhere carries that
705
+ * one to nobody, and `followed` where they are told because they turned that task's
706
+ * notifications on themselves, whatever their kinds. The list is the same for every plugin
707
+ * handed it, and the most there is to send: which of it a plugin sends is its own setting.
708
+ */
637
709
  readonly data: unknown;
638
710
  }
639
711
 
712
+ /** One member the console told of an event, as a hook with `notifications:read` is handed them in `data.told`. */
713
+ export interface PluginHookTold {
714
+ readonly personId: string;
715
+ /** Why they were told, one of `NOTIFICATION_KINDS`. */
716
+ readonly kind: string;
717
+ /** Whether the console told the member itself, by a wake of its agent account. */
718
+ readonly woken: boolean;
719
+ /**
720
+ * Whether they are told because they turned the task's notifications on themselves: of
721
+ * everything on it, under a kind they may have off for every other task. A plugin that keeps
722
+ * a member's choice by kind tells by this that the member asked for this one task.
723
+ */
724
+ readonly followed: boolean;
725
+ }
726
+
640
727
  /** What an endpoint receives: the request, bounded, with the headers the definition named. */
641
728
  export interface EndpointRequest {
642
729
  readonly method: string;
@@ -50,6 +50,13 @@ export const PLUGIN_EVENT_DAYS = 90;
50
50
  export const MAX_PLUGIN_RETENTION_DAYS = 3650;
51
51
  /** How many records one page of a list carries at most. */
52
52
  export const PLUGIN_LIST_LIMIT = 200;
53
+ /**
54
+ * How many accounts at a messenger a workspace keeps as its members' (ADR-0164), of every
55
+ * messenger and every plugin together, and the characters of a messenger's id for a workspace or
56
+ * an account there.
57
+ */
58
+ export const MAX_MESSENGER_ACCOUNTS = 20_000;
59
+ export const MAX_MESSENGER_ID_LENGTH = 64;
53
60
  /** How long plugin code may run: a command; a query or an endpoint; a hook; a job; `onEnable`, `onDisable` and an upgrade. */
54
61
  export const PLUGIN_COMMAND_MS = 30_000;
55
62
  export const PLUGIN_QUERY_MS = 10_000;
@@ -25,6 +25,11 @@ import {
25
25
  MAX_PLUGIN_WIDGETS,
26
26
  } from "./limits.js";
27
27
 
28
+ /** How an icon of the console's pack is named: lowercase letters, digits and hyphens (`calendar`, `arrow-right`). */
29
+ export const PLUGIN_GLYPH_PATTERN = /^[a-z][a-z0-9-]{0,39}$/;
30
+ /** How a colour of the console's vocabulary is named: lowercase letters (`green`, `teal`). */
31
+ export const PLUGIN_COLOR_PATTERN = /^[a-z]{1,20}$/;
32
+
28
33
  /** A plugin's key, and every key within a plugin: a role's, a page's, a widget's, a setting's, a collection's, a command's. */
29
34
  export const PLUGIN_KEY_PATTERN = /^[a-z][a-z0-9-]{1,31}$/;
30
35
 
@@ -564,6 +569,15 @@ const pluginBoardSchema = z
564
569
  ),
565
570
  name: localized(MAX_PROJECT_NAME_LENGTH),
566
571
  description: localized(MAX_PROJECT_DESCRIPTION_LENGTH),
572
+ /**
573
+ * The project's mark (ADR-0155): an icon of the console's pack by its name, and a colour
574
+ * by its name, each left out for none. Each is held to how a name is spelled and no
575
+ * further: the pack and the colours are the console's, which grow, so a name the console
576
+ * a plugin is installed in does not have is read as none there, and never refuses the
577
+ * plugin.
578
+ */
579
+ glyph: z.optional(z.string().check(z.regex(PLUGIN_GLYPH_PATTERN, "is an icon's name"))),
580
+ color: z.optional(z.string().check(z.regex(PLUGIN_COLOR_PATTERN, "is a colour's name"))),
567
581
  }),
568
582
  ),
569
583
  })
@@ -3,13 +3,14 @@
3
3
  // the mini build of zod, as every REST schema is, and part of the snapshot the contract is held
4
4
  // to (ADR-0043). What a plugin's own command or query carries is the plugin's, and not here.
5
5
  import * as z from "zod/mini";
6
+ import { isIconName } from "../icons/index.js";
6
7
  import {
7
8
  MAX_PROJECT_DESCRIPTION_LENGTH,
8
9
  MAX_PROJECT_KEY_LENGTH,
9
10
  MAX_PROJECT_NAME_LENGTH,
10
11
  MAX_TEAM_KEY_LENGTH,
11
12
  } from "../limits.js";
12
- import { PLUGIN_STATES } from "../vocabulary.js";
13
+ import { COLOR_NAMES, PLUGIN_STATES } from "../vocabulary.js";
13
14
  import { ARG_TYPES } from "./args.js";
14
15
  import {
15
16
  MAX_PLUGIN_ARGV_WORD_LENGTH,
@@ -252,8 +253,20 @@ export const restPluginDetailSchema = z.extend(restPluginSchema, {
252
253
  operations: z.array(restPluginOperationSchema),
253
254
  /** Where the plugin's skills are read, or `null` for none. */
254
255
  skills: z.nullable(z.string()),
255
- /** The board project the manifest proposes, for an administrator who makes it; `null` where it proposes none. */
256
- boardDefaults: z.nullable(z.object({ key: z.string(), name: localized, description: localized })),
256
+ /**
257
+ * The board project the manifest proposes, for an administrator who makes it; `null` where it
258
+ * proposes none. `color` and `glyph` are its mark (ADR-0155), each `null` for none, the icon
259
+ * one of this console's pack; answered from 0.6.1 and read as optional.
260
+ */
261
+ boardDefaults: z.nullable(
262
+ z.object({
263
+ key: z.string(),
264
+ name: localized,
265
+ description: localized,
266
+ color: z.optional(z.nullable(z.enum(COLOR_NAMES))),
267
+ glyph: z.optional(z.nullable(z.string())),
268
+ }),
269
+ ),
257
270
  settings: z.array(restPluginSettingSchema),
258
271
  /** The groups the settings form is divided into, in the manifest's order; answered from 0.4.4 and read as optional. */
259
272
  settingGroups: z.optional(
@@ -302,6 +315,17 @@ export const restPluginEnableInputSchema = z.object({
302
315
  key: z.string().check(z.minLength(1), z.maxLength(MAX_PROJECT_KEY_LENGTH)),
303
316
  name: z.string().check(z.minLength(1), z.maxLength(MAX_PROJECT_NAME_LENGTH)),
304
317
  description: z.string().check(z.maxLength(MAX_PROJECT_DESCRIPTION_LENGTH)),
318
+ /** The project's mark (ADR-0155): left out or `null`, a colour from its key and its symbol. */
319
+ color: z.optional(z.nullable(z.enum(COLOR_NAMES))),
320
+ glyph: z.optional(
321
+ z.nullable(
322
+ z
323
+ .string()
324
+ .check(
325
+ z.refine((value) => isIconName(value), "must be the name of an icon of the pack"),
326
+ ),
327
+ ),
328
+ ),
305
329
  }),
306
330
  }),
307
331
  z.object({ project: projectKey }),
@@ -38,6 +38,8 @@ import { PluginRefusal } from "./refusals.js";
38
38
  export interface TestConsoleOptions {
39
39
  readonly workspace?: PluginConsole["workspace"];
40
40
  readonly people?: Partial<PluginConsole["people"]>;
41
+ readonly accounts?: Partial<PluginConsole["accounts"]>;
42
+ readonly notifications?: Partial<PluginConsole["notifications"]>;
41
43
  readonly teams?: Partial<PluginConsole["teams"]>;
42
44
  readonly projects?: Partial<PluginConsole["projects"]>;
43
45
  readonly tasks?: Partial<PluginConsole["tasks"]>;
@@ -539,6 +541,8 @@ function refusingConsole(given: TestConsoleOptions | undefined): PluginConsole {
539
541
  workspace:
540
542
  given?.workspace ?? (async () => forbidden("console.workspace", "console.workspace")),
541
543
  people: fill("people", ["list", "get", "granted"], given?.people),
544
+ accounts: fill("accounts", ["list", "put", "remove"], given?.accounts),
545
+ notifications: fill("notifications", ["settings"], given?.notifications),
542
546
  teams: fill("teams", ["list", "get"], given?.teams),
543
547
  projects: fill("projects", ["list", "get", "members"], given?.projects),
544
548
  tasks: fill("tasks", ["list", "get", "create", "update", "comment"], given?.tasks),
package/src/plugin.ts CHANGED
@@ -87,6 +87,8 @@ export {
87
87
  type ManifestParse,
88
88
  PLUGIN_API_MAJORS,
89
89
  PLUGIN_BOARD_NEEDS,
90
+ PLUGIN_COLOR_PATTERN,
91
+ PLUGIN_GLYPH_PATTERN,
90
92
  PLUGIN_KEY_PATTERN,
91
93
  PLUGIN_MENU_GROUPS,
92
94
  PLUGIN_PAGE_LEVELS,
package/src/router.ts CHANGED
@@ -137,6 +137,8 @@ export type Route =
137
137
  | { readonly name: "work"; readonly week: string | undefined }
138
138
  /** The decisions addressed to the person (ADR-0042), across the projects they may see. */
139
139
  | { readonly name: "my-decisions" }
140
+ /** What the person chose to be told of (ADR-0157): the settings' view of their own notifications. */
141
+ | { readonly name: "notification-settings" }
140
142
  /** One decision wherever it is (ADR-0068), for whoever it reaches: in a project they may see or not. */
141
143
  | { readonly name: "my-decision"; readonly id: string }
142
144
  /** The categories tasks are sorted into; an administrator keeps them here. */
@@ -214,6 +216,8 @@ export const PATHS = {
214
216
  categories: "/categories",
215
217
  /** The workspace's settings: the rules, the categories, the skills (ADR-0023). */
216
218
  settings: "/settings",
219
+ /** What whoever is signed in is told of (ADR-0157): the settings' view of their own notifications. */
220
+ notificationSettings: "/settings/notifications",
217
221
  /** The browsers whoever is signed in is signed in on: the settings' view of their own (board #309). */
218
222
  sessions: "/settings/sessions",
219
223
  /** Where the pages a console adds of its own are: `/pages/<key>`, and `/projects/<key>/pages/<page>` on a project. */
@@ -398,6 +402,9 @@ export function matchRoute(pathname: string, search = ""): Route {
398
402
  if (path === PATHS.sessions) {
399
403
  return { name: "sessions" };
400
404
  }
405
+ if (path === PATHS.notificationSettings) {
406
+ return { name: "notification-settings" };
407
+ }
401
408
  if (path === PATHS.pluginSettings) {
402
409
  return { name: "plugins-settings", plugin: undefined };
403
410
  }
package/src/routes.ts CHANGED
@@ -41,6 +41,8 @@ export const REST_ROUTES = {
41
41
  work: "/api/v1/work",
42
42
  /** The decisions addressed to the asker (ADR-0042) across the projects they may see: the waiting first, then the record. */
43
43
  decisions: "/api/v1/decisions",
44
+ /** What the asker is told of what happens on the board (ADR-0157): their notifications, `/read` to mark them, `/settings` for what they are told of. */
45
+ notifications: "/api/v1/notifications",
44
46
  /** The rules of the board (ADR-0120): the console's, and what the organization adds to them. */
45
47
  rules: "/api/v1/rules",
46
48
  /** The plugins (ADR-0049): the ones a member may know of, and under each key the plugin's own routes. */
package/src/rules.ts CHANGED
@@ -55,7 +55,7 @@ export const CONSOLE_RULES = [
55
55
  "",
56
56
  "## An agent account",
57
57
  "",
58
- "Signed in as itself, nobody at its terminal. Only a message under the console's header, with its session's mark, is the console's; a supervisor's tell instructs it, as the task and these rules do. It asks a person's judgment as a decision, of its manager where it knows of no one else.",
58
+ "Signed in as itself, nobody at its terminal. Only a message under the console's header, with its session's mark, is the console's; a supervisor's own word instructs it, as the task and these rules do. It asks a person's judgment as a decision, of its manager where it knows of no one else.",
59
59
  "",
60
60
  "## What never happens",
61
61
  "",