@skillcdn/console 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (490) hide show
  1. package/README.md +87 -12
  2. package/SKILLCDN.md +3 -3
  3. package/dist/agent-page.d.ts.map +1 -1
  4. package/dist/agent-page.js +7 -6
  5. package/dist/agent-page.js.map +1 -1
  6. package/dist/api.d.ts +9 -7
  7. package/dist/api.d.ts.map +1 -1
  8. package/dist/api.js +8 -6
  9. package/dist/api.js.map +1 -1
  10. package/dist/charts.d.ts +103 -0
  11. package/dist/charts.d.ts.map +1 -0
  12. package/dist/charts.js +182 -0
  13. package/dist/charts.js.map +1 -0
  14. package/dist/cli/cli.d.ts +58 -2
  15. package/dist/cli/cli.d.ts.map +1 -1
  16. package/dist/cli/cli.js +1742 -472
  17. package/dist/cli/cli.js.map +1 -1
  18. package/dist/cli/command-words.d.ts +20 -0
  19. package/dist/cli/command-words.d.ts.map +1 -0
  20. package/dist/cli/command-words.js +51 -0
  21. package/dist/cli/command-words.js.map +1 -0
  22. package/dist/cli/credentials.d.ts +54 -5
  23. package/dist/cli/credentials.d.ts.map +1 -1
  24. package/dist/cli/credentials.js +126 -20
  25. package/dist/cli/credentials.js.map +1 -1
  26. package/dist/cli/directory.d.ts +19 -4
  27. package/dist/cli/directory.d.ts.map +1 -1
  28. package/dist/cli/directory.js +16 -8
  29. package/dist/cli/directory.js.map +1 -1
  30. package/dist/cli/format.d.ts +70 -9
  31. package/dist/cli/format.d.ts.map +1 -1
  32. package/dist/cli/format.js +267 -40
  33. package/dist/cli/format.js.map +1 -1
  34. package/dist/cli/help.d.ts +13 -4
  35. package/dist/cli/help.d.ts.map +1 -1
  36. package/dist/cli/help.js +101 -58
  37. package/dist/cli/help.js.map +1 -1
  38. package/dist/cli/machine-check.d.ts +36 -0
  39. package/dist/cli/machine-check.d.ts.map +1 -0
  40. package/dist/cli/machine-check.js +151 -0
  41. package/dist/cli/machine-check.js.map +1 -0
  42. package/dist/cli/main.js +76 -2
  43. package/dist/cli/main.js.map +1 -1
  44. package/dist/cli/pack.d.ts +69 -60
  45. package/dist/cli/pack.d.ts.map +1 -1
  46. package/dist/cli/pack.js +241 -270
  47. package/dist/cli/pack.js.map +1 -1
  48. package/dist/cli/plugin-check.d.ts +42 -0
  49. package/dist/cli/plugin-check.d.ts.map +1 -1
  50. package/dist/cli/plugin-check.js +221 -36
  51. package/dist/cli/plugin-check.js.map +1 -1
  52. package/dist/cli/plugin-cli.d.ts +6 -1
  53. package/dist/cli/plugin-cli.d.ts.map +1 -1
  54. package/dist/cli/plugin-cli.js +21 -4
  55. package/dist/cli/plugin-cli.js.map +1 -1
  56. package/dist/cli/plugin-main.js +1 -0
  57. package/dist/cli/plugin-main.js.map +1 -1
  58. package/dist/cli/runner-host.d.ts +7 -0
  59. package/dist/cli/runner-host.d.ts.map +1 -1
  60. package/dist/cli/runner-host.js +2 -0
  61. package/dist/cli/runner-host.js.map +1 -1
  62. package/dist/cli/secret-notes.d.ts +8 -0
  63. package/dist/cli/secret-notes.d.ts.map +1 -0
  64. package/dist/cli/secret-notes.js +48 -0
  65. package/dist/cli/secret-notes.js.map +1 -0
  66. package/dist/cli/serve.d.ts +33 -1
  67. package/dist/cli/serve.d.ts.map +1 -1
  68. package/dist/cli/serve.js +252 -3
  69. package/dist/cli/serve.js.map +1 -1
  70. package/dist/client.d.ts +54 -9
  71. package/dist/client.d.ts.map +1 -1
  72. package/dist/client.js +77 -80
  73. package/dist/client.js.map +1 -1
  74. package/dist/components/agent-page.d.ts +164 -8
  75. package/dist/components/agent-page.d.ts.map +1 -1
  76. package/dist/components/agent-page.js +588 -151
  77. package/dist/components/agent-page.js.map +1 -1
  78. package/dist/components/agents.d.ts.map +1 -1
  79. package/dist/components/agents.js +1 -1
  80. package/dist/components/agents.js.map +1 -1
  81. package/dist/components/board.d.ts.map +1 -1
  82. package/dist/components/board.js +3 -2
  83. package/dist/components/board.js.map +1 -1
  84. package/dist/components/categories.js +1 -1
  85. package/dist/components/categories.js.map +1 -1
  86. package/dist/components/charts.d.ts +157 -0
  87. package/dist/components/charts.d.ts.map +1 -0
  88. package/dist/components/charts.js +182 -0
  89. package/dist/components/charts.js.map +1 -0
  90. package/dist/components/decision-list.d.ts.map +1 -1
  91. package/dist/components/decision-list.js +1 -1
  92. package/dist/components/decision-list.js.map +1 -1
  93. package/dist/components/desk-records.d.ts +102 -0
  94. package/dist/components/desk-records.d.ts.map +1 -0
  95. package/dist/components/desk-records.js +221 -0
  96. package/dist/components/desk-records.js.map +1 -0
  97. package/dist/components/desk.d.ts +85 -0
  98. package/dist/components/desk.d.ts.map +1 -0
  99. package/dist/components/desk.js +135 -0
  100. package/dist/components/desk.js.map +1 -0
  101. package/dist/components/event-feed.d.ts.map +1 -1
  102. package/dist/components/event-feed.js +7 -3
  103. package/dist/components/event-feed.js.map +1 -1
  104. package/dist/components/goals.d.ts +2 -0
  105. package/dist/components/goals.d.ts.map +1 -1
  106. package/dist/components/goals.js +1 -1
  107. package/dist/components/goals.js.map +1 -1
  108. package/dist/components/home.d.ts.map +1 -1
  109. package/dist/components/home.js +14 -6
  110. package/dist/components/home.js.map +1 -1
  111. package/dist/components/icon.d.ts +31 -0
  112. package/dist/components/icon.d.ts.map +1 -0
  113. package/dist/components/icon.js +169 -0
  114. package/dist/components/icon.js.map +1 -0
  115. package/dist/components/markdown.d.ts +6 -0
  116. package/dist/components/markdown.d.ts.map +1 -1
  117. package/dist/components/markdown.js +10 -2
  118. package/dist/components/markdown.js.map +1 -1
  119. package/dist/components/people.js +1 -1
  120. package/dist/components/people.js.map +1 -1
  121. package/dist/components/plugin-frame.d.ts.map +1 -1
  122. package/dist/components/plugin-frame.js +7 -0
  123. package/dist/components/plugin-frame.js.map +1 -1
  124. package/dist/components/plugin-settings.d.ts.map +1 -1
  125. package/dist/components/plugin-settings.js +54 -3
  126. package/dist/components/plugin-settings.js.map +1 -1
  127. package/dist/components/projects.d.ts +17 -4
  128. package/dist/components/projects.d.ts.map +1 -1
  129. package/dist/components/projects.js +51 -12
  130. package/dist/components/projects.js.map +1 -1
  131. package/dist/components/rules.d.ts +8 -10
  132. package/dist/components/rules.d.ts.map +1 -1
  133. package/dist/components/rules.js +35 -13
  134. package/dist/components/rules.js.map +1 -1
  135. package/dist/components/sessions.d.ts.map +1 -1
  136. package/dist/components/sessions.js +3 -2
  137. package/dist/components/sessions.js.map +1 -1
  138. package/dist/components/setup.d.ts +9 -3
  139. package/dist/components/setup.d.ts.map +1 -1
  140. package/dist/components/setup.js +12 -6
  141. package/dist/components/setup.js.map +1 -1
  142. package/dist/components/shell.d.ts.map +1 -1
  143. package/dist/components/shell.js +3 -2
  144. package/dist/components/shell.js.map +1 -1
  145. package/dist/components/tokens.js +1 -1
  146. package/dist/components/tokens.js.map +1 -1
  147. package/dist/components/ui.d.ts +5 -2
  148. package/dist/components/ui.d.ts.map +1 -1
  149. package/dist/components/ui.js +10 -7
  150. package/dist/components/ui.js.map +1 -1
  151. package/dist/connect-page.js +1 -1
  152. package/dist/connect-page.js.map +1 -1
  153. package/dist/console.css +1172 -106
  154. package/dist/console.d.ts +5 -0
  155. package/dist/console.d.ts.map +1 -1
  156. package/dist/console.js +52 -39
  157. package/dist/console.js.map +1 -1
  158. package/dist/data.d.ts.map +1 -1
  159. package/dist/data.js +32 -33
  160. package/dist/data.js.map +1 -1
  161. package/dist/desk-page.d.ts +38 -0
  162. package/dist/desk-page.d.ts.map +1 -0
  163. package/dist/desk-page.js +184 -0
  164. package/dist/desk-page.js.map +1 -0
  165. package/dist/desk-records-page.d.ts +18 -0
  166. package/dist/desk-records-page.d.ts.map +1 -0
  167. package/dist/desk-records-page.js +130 -0
  168. package/dist/desk-records-page.js.map +1 -0
  169. package/dist/desk-records.d.ts +247 -0
  170. package/dist/desk-records.d.ts.map +1 -0
  171. package/dist/desk-records.js +543 -0
  172. package/dist/desk-records.js.map +1 -0
  173. package/dist/desk.d.ts +122 -0
  174. package/dist/desk.d.ts.map +1 -0
  175. package/dist/desk.js +211 -0
  176. package/dist/desk.js.map +1 -0
  177. package/dist/feed-stream.d.ts +39 -0
  178. package/dist/feed-stream.d.ts.map +1 -0
  179. package/dist/feed-stream.js +117 -0
  180. package/dist/feed-stream.js.map +1 -0
  181. package/dist/home-tiles.d.ts +19 -3
  182. package/dist/home-tiles.d.ts.map +1 -1
  183. package/dist/home-tiles.js +147 -42
  184. package/dist/home-tiles.js.map +1 -1
  185. package/dist/i18n/en.d.ts +228 -6
  186. package/dist/i18n/en.d.ts.map +1 -1
  187. package/dist/i18n/en.js +309 -9
  188. package/dist/i18n/en.js.map +1 -1
  189. package/dist/i18n/ko.d.ts.map +1 -1
  190. package/dist/i18n/ko.js +366 -85
  191. package/dist/i18n/ko.js.map +1 -1
  192. package/dist/i18n/particles.d.ts +7 -0
  193. package/dist/i18n/particles.d.ts.map +1 -0
  194. package/dist/i18n/particles.js +72 -0
  195. package/dist/i18n/particles.js.map +1 -0
  196. package/dist/icons/glyphs.d.ts +605 -0
  197. package/dist/icons/glyphs.d.ts.map +1 -0
  198. package/dist/icons/glyphs.js +104 -0
  199. package/dist/icons/glyphs.js.map +1 -0
  200. package/dist/icons/index.d.ts +59 -0
  201. package/dist/icons/index.d.ts.map +1 -0
  202. package/dist/icons/index.js +157 -0
  203. package/dist/icons/index.js.map +1 -0
  204. package/dist/index.d.ts +9 -0
  205. package/dist/index.d.ts.map +1 -1
  206. package/dist/index.js +9 -0
  207. package/dist/index.js.map +1 -1
  208. package/dist/limits.d.ts +20 -0
  209. package/dist/limits.d.ts.map +1 -1
  210. package/dist/limits.js +20 -0
  211. package/dist/limits.js.map +1 -1
  212. package/dist/marks.d.ts +9 -0
  213. package/dist/marks.d.ts.map +1 -1
  214. package/dist/marks.js +9 -0
  215. package/dist/marks.js.map +1 -1
  216. package/dist/onboarding.d.ts +6 -0
  217. package/dist/onboarding.d.ts.map +1 -1
  218. package/dist/onboarding.js +5 -5
  219. package/dist/onboarding.js.map +1 -1
  220. package/dist/plugin/context.d.ts +42 -11
  221. package/dist/plugin/context.d.ts.map +1 -1
  222. package/dist/plugin/limits.d.ts +2 -0
  223. package/dist/plugin/limits.d.ts.map +1 -1
  224. package/dist/plugin/limits.js +2 -0
  225. package/dist/plugin/limits.js.map +1 -1
  226. package/dist/plugin/manifest.d.ts +13 -0
  227. package/dist/plugin/manifest.d.ts.map +1 -1
  228. package/dist/plugin/manifest.js +30 -3
  229. package/dist/plugin/manifest.js.map +1 -1
  230. package/dist/plugin/rest-schemas.d.ts +55 -0
  231. package/dist/plugin/rest-schemas.d.ts.map +1 -1
  232. package/dist/plugin/rest-schemas.js +37 -0
  233. package/dist/plugin/rest-schemas.js.map +1 -1
  234. package/dist/plugin/sandbox.d.ts.map +1 -1
  235. package/dist/plugin/sandbox.js +4 -1
  236. package/dist/plugin/sandbox.js.map +1 -1
  237. package/dist/plugin/testing.d.ts +6 -2
  238. package/dist/plugin/testing.d.ts.map +1 -1
  239. package/dist/plugin/testing.js +52 -10
  240. package/dist/plugin/testing.js.map +1 -1
  241. package/dist/plugin/web.d.ts +3 -0
  242. package/dist/plugin/web.d.ts.map +1 -1
  243. package/dist/plugin/web.js +5 -1
  244. package/dist/plugin/web.js.map +1 -1
  245. package/dist/plugin.d.ts +1 -1
  246. package/dist/plugin.d.ts.map +1 -1
  247. package/dist/plugin.js +1 -1
  248. package/dist/plugin.js.map +1 -1
  249. package/dist/records.d.ts +283 -0
  250. package/dist/records.d.ts.map +1 -0
  251. package/dist/records.js +543 -0
  252. package/dist/records.js.map +1 -0
  253. package/dist/routes.d.ts +3 -1
  254. package/dist/routes.d.ts.map +1 -1
  255. package/dist/routes.js +3 -1
  256. package/dist/routes.js.map +1 -1
  257. package/dist/rules.d.ts +30 -11
  258. package/dist/rules.d.ts.map +1 -1
  259. package/dist/rules.js +98 -45
  260. package/dist/rules.js.map +1 -1
  261. package/dist/runner/acp.d.ts +1 -1
  262. package/dist/runner/acp.d.ts.map +1 -1
  263. package/dist/runner/acp.js +32 -21
  264. package/dist/runner/acp.js.map +1 -1
  265. package/dist/runner/awake.d.ts +35 -0
  266. package/dist/runner/awake.d.ts.map +1 -0
  267. package/dist/runner/awake.js +95 -0
  268. package/dist/runner/awake.js.map +1 -0
  269. package/dist/runner/claude.d.ts +1 -1
  270. package/dist/runner/claude.d.ts.map +1 -1
  271. package/dist/runner/claude.js +100 -18
  272. package/dist/runner/claude.js.map +1 -1
  273. package/dist/runner/codex.d.ts +1 -1
  274. package/dist/runner/codex.d.ts.map +1 -1
  275. package/dist/runner/codex.js +20 -17
  276. package/dist/runner/codex.js.map +1 -1
  277. package/dist/runner/config.d.ts +5 -0
  278. package/dist/runner/config.d.ts.map +1 -1
  279. package/dist/runner/config.js +9 -0
  280. package/dist/runner/config.js.map +1 -1
  281. package/dist/runner/desk.d.ts +43 -2
  282. package/dist/runner/desk.d.ts.map +1 -1
  283. package/dist/runner/desk.js +168 -13
  284. package/dist/runner/desk.js.map +1 -1
  285. package/dist/runner/process.d.ts.map +1 -1
  286. package/dist/runner/process.js +11 -4
  287. package/dist/runner/process.js.map +1 -1
  288. package/dist/runner/redact.d.ts +39 -4
  289. package/dist/runner/redact.d.ts.map +1 -1
  290. package/dist/runner/redact.js +81 -5
  291. package/dist/runner/redact.js.map +1 -1
  292. package/dist/runner/runner.d.ts +28 -3
  293. package/dist/runner/runner.d.ts.map +1 -1
  294. package/dist/runner/runner.js +371 -54
  295. package/dist/runner/runner.js.map +1 -1
  296. package/dist/runner/slack.d.ts.map +1 -1
  297. package/dist/runner/slack.js +10 -4
  298. package/dist/runner/slack.js.map +1 -1
  299. package/dist/runner/task-scheduler.d.ts +20 -0
  300. package/dist/runner/task-scheduler.d.ts.map +1 -1
  301. package/dist/runner/task-scheduler.js +34 -4
  302. package/dist/runner/task-scheduler.js.map +1 -1
  303. package/dist/runner/types.d.ts +51 -1
  304. package/dist/runner/types.d.ts.map +1 -1
  305. package/dist/runner/types.js +26 -0
  306. package/dist/runner/types.js.map +1 -1
  307. package/dist/runner.d.ts +6 -6
  308. package/dist/runner.d.ts.map +1 -1
  309. package/dist/runner.js +5 -5
  310. package/dist/runner.js.map +1 -1
  311. package/dist/schemas.d.ts +603 -6
  312. package/dist/schemas.d.ts.map +1 -1
  313. package/dist/schemas.js +156 -20
  314. package/dist/schemas.js.map +1 -1
  315. package/dist/services.d.ts +22 -5
  316. package/dist/services.d.ts.map +1 -1
  317. package/dist/services.js +41 -17
  318. package/dist/services.js.map +1 -1
  319. package/dist/setup-guide.d.ts +17 -4
  320. package/dist/setup-guide.d.ts.map +1 -1
  321. package/dist/setup-guide.js +48 -41
  322. package/dist/setup-guide.js.map +1 -1
  323. package/dist/tokens.d.ts.map +1 -1
  324. package/dist/tokens.js +5 -1
  325. package/dist/tokens.js.map +1 -1
  326. package/dist/vocabulary.d.ts +21 -3
  327. package/dist/vocabulary.d.ts.map +1 -1
  328. package/dist/vocabulary.js +19 -3
  329. package/dist/vocabulary.js.map +1 -1
  330. package/docs/specs/cli.md +73 -44
  331. package/docs/specs/plugins.md +40 -22
  332. package/docs/specs/records.md +113 -0
  333. package/docs/specs/rest.md +30 -21
  334. package/docs/specs/runner.md +46 -22
  335. package/package.json +11 -2
  336. package/skills/building-a-console/SKILL.md +4 -4
  337. package/skills/building-a-plugin/SKILL.md +6 -6
  338. package/skills/deploying-a-console/SKILL.md +4 -4
  339. package/skills/deploying-a-console/references/resources.md +41 -4
  340. package/skills/deploying-a-console/references/running-it-again.md +3 -2
  341. package/skills/keeping-a-desk/SKILL.md +133 -0
  342. package/skills/keeping-a-desk/collections.md +96 -0
  343. package/skills/planning-the-board/SKILL.md +14 -18
  344. package/skills/planning-the-board/references/a-task.md +2 -2
  345. package/skills/planning-the-board/references/project-rules.md +13 -14
  346. package/skills/planning-the-board/references/setting-up.md +15 -13
  347. package/skills/running-an-agent/SKILL.md +47 -56
  348. package/skills/working-the-board/SKILL.md +63 -44
  349. package/skills/working-the-board/references/terms.md +9 -5
  350. package/skills/working-the-board/references/the-pack.md +12 -10
  351. package/skills/working-the-board/references/the-sentence.md +2 -2
  352. package/src/agent-page.tsx +16 -2
  353. package/src/api.ts +109 -3
  354. package/src/charts.ts +250 -0
  355. package/src/cli/cli.ts +2226 -580
  356. package/src/cli/command-words.ts +56 -0
  357. package/src/cli/credentials.ts +181 -20
  358. package/src/cli/directory.ts +28 -10
  359. package/src/cli/format.ts +332 -49
  360. package/src/cli/help.ts +113 -57
  361. package/src/cli/machine-check.ts +223 -0
  362. package/src/cli/main.ts +72 -2
  363. package/src/cli/pack.ts +333 -372
  364. package/src/cli/plugin-check.ts +275 -34
  365. package/src/cli/plugin-cli.ts +28 -4
  366. package/src/cli/plugin-main.ts +1 -0
  367. package/src/cli/runner-host.ts +8 -0
  368. package/src/cli/secret-notes.ts +63 -0
  369. package/src/cli/serve.ts +295 -2
  370. package/src/client.ts +215 -177
  371. package/src/components/agent-page.tsx +1044 -281
  372. package/src/components/agents.tsx +9 -5
  373. package/src/components/board.tsx +3 -15
  374. package/src/components/categories.tsx +2 -2
  375. package/src/components/charts.tsx +680 -0
  376. package/src/components/decision-list.tsx +11 -7
  377. package/src/components/desk-records.tsx +724 -0
  378. package/src/components/desk.tsx +471 -0
  379. package/src/components/event-feed.tsx +12 -3
  380. package/src/components/goals.tsx +33 -25
  381. package/src/components/home.tsx +42 -6
  382. package/src/components/icon.tsx +337 -0
  383. package/src/components/markdown.tsx +22 -2
  384. package/src/components/people.tsx +1 -1
  385. package/src/components/plugin-frame.tsx +7 -0
  386. package/src/components/plugin-settings.tsx +171 -12
  387. package/src/components/projects.tsx +68 -17
  388. package/src/components/rules.tsx +94 -34
  389. package/src/components/sessions.tsx +2 -13
  390. package/src/components/setup.tsx +20 -5
  391. package/src/components/shell.tsx +3 -20
  392. package/src/components/tokens.tsx +1 -1
  393. package/src/components/ui.tsx +16 -8
  394. package/src/connect-page.tsx +1 -1
  395. package/src/console.tsx +104 -62
  396. package/src/data.ts +37 -34
  397. package/src/desk-page.tsx +332 -0
  398. package/src/desk-records-page.tsx +256 -0
  399. package/src/desk-records.ts +808 -0
  400. package/src/desk.ts +329 -0
  401. package/src/feed-stream.ts +144 -0
  402. package/src/home-tiles.ts +170 -46
  403. package/src/i18n/en.ts +323 -11
  404. package/src/i18n/ko.ts +378 -87
  405. package/src/i18n/particles.ts +79 -0
  406. package/src/icons/glyphs.ts +112 -0
  407. package/src/icons/index.ts +195 -0
  408. package/src/index.ts +125 -0
  409. package/src/limits.ts +20 -0
  410. package/src/marks.ts +12 -0
  411. package/src/onboarding.ts +14 -6
  412. package/src/plugin/context.ts +55 -12
  413. package/src/plugin/limits.ts +2 -0
  414. package/src/plugin/manifest.ts +38 -2
  415. package/src/plugin/rest-schemas.ts +41 -0
  416. package/src/plugin/sandbox.ts +4 -1
  417. package/src/plugin/testing.ts +63 -12
  418. package/src/plugin/web.ts +9 -2
  419. package/src/plugin.ts +2 -0
  420. package/src/records.ts +702 -0
  421. package/src/routes.ts +3 -1
  422. package/src/rules.ts +108 -47
  423. package/src/runner/acp.ts +49 -30
  424. package/src/runner/awake.ts +135 -0
  425. package/src/runner/claude.ts +131 -26
  426. package/src/runner/codex.ts +37 -26
  427. package/src/runner/config.ts +9 -0
  428. package/src/runner/desk.ts +200 -15
  429. package/src/runner/process.ts +11 -4
  430. package/src/runner/redact.ts +92 -6
  431. package/src/runner/runner.ts +457 -56
  432. package/src/runner/slack.ts +10 -4
  433. package/src/runner/task-scheduler.ts +36 -4
  434. package/src/runner/types.ts +67 -1
  435. package/src/runner.ts +27 -2
  436. package/src/schemas.ts +177 -18
  437. package/src/services.ts +55 -16
  438. package/src/setup-guide.ts +49 -40
  439. package/src/styles/README.md +16 -5
  440. package/src/styles/base.css +17 -0
  441. package/src/styles/console.css +10 -0
  442. package/src/styles/drawn-by-pages.json +1 -1
  443. package/src/styles/pages/agents.css +103 -1
  444. package/src/styles/pages/board.css +0 -10
  445. package/src/styles/pages/calendar.css +1 -1
  446. package/src/styles/pages/connect.css +0 -10
  447. package/src/styles/pages/decisions.css +3 -1
  448. package/src/styles/pages/desk.css +126 -0
  449. package/src/styles/pages/documents.css +5 -0
  450. package/src/styles/pages/feed.css +5 -2
  451. package/src/styles/pages/home.css +5 -0
  452. package/src/styles/pages/roadmap.css +2 -2
  453. package/src/styles/pages/settings.css +11 -0
  454. package/src/styles/pages/task.css +0 -20
  455. package/src/styles/pages/thread.css +1 -1
  456. package/src/styles/parts/bars.css +80 -0
  457. package/src/styles/parts/calendar.css +1 -1
  458. package/src/styles/parts/callout.css +1 -0
  459. package/src/styles/parts/chart.css +173 -0
  460. package/src/styles/parts/detail.css +22 -0
  461. package/src/styles/parts/empty.css +2 -0
  462. package/src/styles/parts/eyebrow.css +1 -1
  463. package/src/styles/parts/facts.css +1 -1
  464. package/src/styles/parts/figures.css +65 -0
  465. package/src/styles/parts/form.css +2 -1
  466. package/src/styles/parts/icon.css +191 -0
  467. package/src/styles/parts/input.css +14 -4
  468. package/src/styles/parts/legend.css +48 -0
  469. package/src/styles/parts/mark.css +36 -0
  470. package/src/styles/parts/menu.css +1 -7
  471. package/src/styles/parts/page.css +1 -1
  472. package/src/styles/parts/panel.css +10 -0
  473. package/src/styles/parts/person.css +5 -2
  474. package/src/styles/parts/progress.css +5 -2
  475. package/src/styles/parts/rows.css +1 -0
  476. package/src/styles/parts/series.css +32 -0
  477. package/src/styles/parts/settings.css +5 -0
  478. package/src/styles/parts/share.css +25 -0
  479. package/src/styles/parts/spark.css +23 -0
  480. package/src/styles/parts/stat.css +69 -0
  481. package/src/styles/tokens.css +31 -10
  482. package/src/tokens.ts +5 -1
  483. package/src/vocabulary.ts +25 -3
  484. package/template/desk-web/README.md +8 -0
  485. package/template/desk-web/index.html +13 -0
  486. package/template/desk-web/package.json +25 -0
  487. package/template/desk-web/src/main.tsx +24 -0
  488. package/template/desk-web/src/page.tsx +51 -0
  489. package/template/desk-web/tsconfig.json +16 -0
  490. package/template/desk-web/vite.config.ts +15 -0
@@ -1,4 +1,4 @@
1
- import type { RestAgent, RestAgentSecret, RestArtifact, RestCategory, RestComment, RestDecision, RestDocument, RestDocumentSummary, RestDocuments, RestGoal, RestListing, RestMember, RestPerson, RestPersonWork, RestPlugin, RestPluginDetail, RestPluginGrant, RestPluginInvocation, RestPluginOperation, RestPluginRecord, RestPluginRecordPage, RestPluginRecordRead, RestPluginRecordVersions, RestPluginSetting, RestPlugins, RestProject, RestProjectRules, RestRules, RestRulesPlugin, RestRun, RestSignal, RestTask, RestTeam, RestVersion, RestVersionSummary, RestWork, RestWorkspace } from "../schemas.js";
1
+ import type { RestAgent, RestAgentRunner, RestAgentSecret, RestArtifact, RestCategory, RestComment, RestDecision, RestDocument, RestDocumentSummary, RestDocuments, RestEvent, RestEvents, RestGoal, RestListing, RestMember, RestOwnWake, RestPerson, RestPersonWork, RestPlugin, RestPluginDetail, RestPluginGrant, RestPluginInvocation, RestPluginJob, RestPluginOperation, RestPluginRecord, RestPluginRecordPage, RestPluginRecordRead, RestPluginRecordVersions, RestPluginSetting, RestPlugins, RestProject, RestProjectRules, RestRules, RestRulesPlugin, RestRun, RestRunBrief, RestSignal, RestTask, RestTaskBrief, RestTeam, RestVersion, RestVersionSummary, RestWork, RestWorkspace } from "../schemas.js";
2
2
  /** Says which time zone the moments printed from now on are in, or none. */
3
3
  export declare function setMomentZone(zone: string | undefined): void;
4
4
  /**
@@ -23,13 +23,17 @@ export declare function formatAgentLine(agent: RestAgent): string;
23
23
  * what was chosen for it, where the asker is answered that, and whether they supervise it.
24
24
  */
25
25
  export declare function formatAgent(agent: RestAgent): string;
26
+ /** A wake source as its runner last said it stands (ADR-0144): listening and since when, or not, and why. */
27
+ export declare function formatWakeSource(source: NonNullable<RestAgentRunner["sources"]>[number]): string;
28
+ /** A wake an agent account keeps for later (ADR-0145): what it is called, when it is raised, and the first words of what it says. */
29
+ export declare function formatOwnWakeLine(wake: RestOwnWake): string;
26
30
  /** How an agent account stands (ADR-0085), in a few words: the state, why, and when its runner was last heard from. */
27
31
  export declare function formatAgentState(agent: RestAgent): string;
28
32
  /**
29
33
  * One signal of an agent account's record (ADR-0085): its number, its kind, who sent it or where
30
34
  * it came from, when, and the first words of what it says.
31
35
  */
32
- export declare function formatSignalLine(signal: RestSignal): string;
36
+ export declare function formatSignalLine(signal: RestSignal, delivered?: number): string;
33
37
  /** One secret of an agent account's store (ADR-0087): its name, when it was set and by which side, and the day it ends on where one is known. Never its value. */
34
38
  export declare function formatSecretLine(secret: RestAgentSecret): string;
35
39
  /** One login let in that nobody has signed in with yet (ADR-0022). */
@@ -46,28 +50,52 @@ export declare function formatMore(more: boolean, limit: number, offset: number)
46
50
  * person; a person by their login.
47
51
  */
48
52
  export declare const calledOf: (person: Pick<RestPerson, "login" | "handle">) => string;
49
- export declare function formatTaskLine(task: RestTask): string;
53
+ export declare function formatTaskLine(task: RestTaskBrief): string;
50
54
  /** One task in full; with the decisions about it and the runs on it, when given. */
51
- export declare function formatTask(task: RestTask, decisions?: readonly RestDecision[], runs?: readonly RestRun[], comments?: readonly RestComment[]): string;
55
+ export declare function formatTask(task: RestTask, decisions?: readonly RestDecision[], runs?: readonly RestRunBrief[], comments?: readonly RestComment[],
56
+ /** The address of the task's page at the console, where the command knows it: what a person is given to open. */
57
+ page?: string): string;
52
58
  /**
53
59
  * One comment of the discussion, indented under the list: who said it, through which agent,
54
60
  * when, the whole word, and each file put in it with the command that reads it.
55
61
  */
56
62
  export declare function formatComment(comment: RestComment): string;
57
- export declare function formatRunLine(run: RestRun): string;
63
+ export declare function formatRunLine(run: RestRunBrief): string;
58
64
  /** One run in full; with where each file handed in is read, when the caller knows. */
59
65
  export declare function formatRun(run: RestRun, fileUrl?: (artifactId: string) => string): string;
60
66
  /** What was handed in: the link, or the file with its size and where its bytes are read. */
61
67
  export declare function formatArtifact(artifact: RestArtifact, fileUrl?: (artifactId: string) => string): string;
62
68
  /**
63
- * The rules that hold: the workspace's, and what the project adds when the command works in one;
64
- * then the plugins the console names after them, a line each, where there are any.
69
+ * The mark of the rules (ADR-0119): the first eight hex characters of a SHA-256 over what they
70
+ * say to whoever reads them: the workspace's text whole, which is the console's rules with
71
+ * what the organization adds (ADR-0120), what the project adds, and the plugins' lines, in the
72
+ * language they are read in. A session that was shown the rules holds their mark, and a later
73
+ * take of that session leaves out the rules the mark stands for; nothing but having been shown
74
+ * them gives it. When they were written and by whom is no part of it: the same rules have the
75
+ * same mark, and a project that adds nothing has the workspace's.
76
+ */
77
+ export declare function rulesMark(rules: RestProjectRules | RestRules, language?: string | null | undefined): string;
78
+ /**
79
+ * The rules that hold, under a first line that says what follows (ADR-0119): the mark, which
80
+ * parts there are and how long each is, and how a later take of the session leaves them out.
81
+ * What differs stands first and what always holds last (ADR-0120): what the project adds with
82
+ * the plugins' lines, then what the organization adds, then the console's rules. An agent that
83
+ * had read the long part once cut every later print at its head, and never saw what stood
84
+ * after it; and where they differ it is the earlier part that holds. Who adds nothing is said
85
+ * in a clause of the line, and has no part.
65
86
  */
66
87
  export declare function formatRules(rules: RestProjectRules | RestRules, language?: string | null | undefined): string;
88
+ /** What a take says, before the task, where it was told the mark the rules have (ADR-0119): they are left out. */
89
+ export declare const formatRulesLeftOut: (mark: string) => string;
90
+ /**
91
+ * What a take says, before the task, where it was told a mark the rules do not have (ADR-0119):
92
+ * the rules then follow the task whole, as they do without a mark.
93
+ */
94
+ export declare const formatRulesChanged: (given: string) => string;
67
95
  /** One goal: its id, its state, its title, its category, its days, and how far it is. */
68
96
  export declare function formatGoalLine(goal: RestGoal): string;
69
97
  /** One goal in full; with the tasks that work towards it, when given. */
70
- export declare function formatGoal(goal: RestGoal, tasks?: readonly RestTask[]): string;
98
+ export declare function formatGoal(goal: RestGoal, tasks?: readonly RestTaskBrief[]): string;
71
99
  /** One category: its key, what people call it, and its colour. */
72
100
  export declare function formatCategoryLine(category: RestCategory): string;
73
101
  /** What is on a person's plate: their open tasks by project, and the decisions waiting. */
@@ -76,11 +104,21 @@ export declare function formatWork(work: RestWork): string;
76
104
  export declare function formatPersonWork(person: RestPerson, work: RestPersonWork): string;
77
105
  /** The logins of everyone a decision is addressed to, with commas between. */
78
106
  export declare const deciderLogins: (decision: RestDecision) => string;
107
+ /**
108
+ * One decision in a line, with when it was asked: a decision that waits holds a run, and whoever
109
+ * is told what is on their plate is told since when each one waits.
110
+ */
79
111
  export declare function formatDecisionLine(decision: RestDecision): string;
80
112
  /** The options, one a line; the person's own answer, when they wrote one, is the last and says so. */
81
113
  export declare function formatOptions(decision: RestDecision): string;
82
114
  /** The answer, with who gave it, and that it is in their own words when it is; or that there is none yet. */
83
115
  export declare function formatAnswer(decision: RestDecision): string;
116
+ /**
117
+ * The address of a task's or a decision's page, on a line of its own: what an agent gives a
118
+ * person to open, in place of the console's front page, or of a number a git host would take
119
+ * for an issue of its own.
120
+ */
121
+ export declare const pageLine: (page: string) => string;
84
122
  /**
85
123
  * One decision in full. A decision reached at its own address (ADR-0068), outside the project the
86
124
  * command works in, names its files with the command that reads them there, by the decision too:
@@ -88,6 +126,8 @@ export declare function formatAnswer(decision: RestDecision): string;
88
126
  */
89
127
  export declare function formatDecision(decision: RestDecision, options?: {
90
128
  readonly atItsAddress?: boolean;
129
+ /** The address of the decision's page at the console, where the command knows it. */
130
+ readonly page?: string | undefined;
91
131
  }): string;
92
132
  /** One document in a list: its path, its title, its version, who wrote it last and when. */
93
133
  export declare function formatDocumentLine(document: RestDocumentSummary): string;
@@ -115,12 +155,33 @@ export declare function formatOperationUsage(key: string, operation: RestPluginO
115
155
  }): string;
116
156
  /** One command or query of a plugin in full, as `console help <command>` prints one; or every one in a line. */
117
157
  export declare function formatPluginHelp(detail: RestPluginDetail, name: string | undefined): string;
118
- /** A setting in a line: its key and type, what it holds or whether it is set, and its name. */
158
+ /**
159
+ * A setting in a line: its key and type, what it holds or whether it is set, and its name; for a
160
+ * secret kept per key (ADR-0111), how many keys of how many, and a line under it for each key.
161
+ */
119
162
  export declare function formatPluginSettingLine(setting: RestPluginSetting, language: string | null | undefined): string;
120
163
  /** A grant in a line: its id, the role, whom it is to, since when. */
121
164
  export declare function formatPluginGrantLine(grant: RestPluginGrant): string;
122
165
  /** A team in a line (ADR-0073): its key (ADR-0074), its name, how many are in it, and their logins. */
123
166
  export declare function formatTeamLine(team: RestTeam, loginOf: ReadonlyMap<string, string>): string;
167
+ /**
168
+ * A job of a plugin in a line (ADR-0128): its name and how often it runs, how its last run went
169
+ * and since when it has failed where it keeps failing, and when it runs next.
170
+ */
171
+ export declare function formatPluginJobLine(job: RestPluginJob): string;
172
+ /** One event of a plugin in a line: its number, when, its kind, who did it and through what, and what it says. */
173
+ export declare function formatPluginEventLine(event: RestEvent): string;
174
+ /**
175
+ * A page of a plugin's events, newest first (ADR-0128), of one kind where one was asked for:
176
+ * what `console plugin <key> events` prints, with how to read on. The console answers what the
177
+ * caller may read and says nothing of the rest, so an empty page is said as that, and never as
178
+ * a plugin that has no events.
179
+ */
180
+ export declare function formatPluginEvents(key: string, page: RestEvents, asked: {
181
+ readonly kind: string | undefined;
182
+ readonly limit: number;
183
+ readonly offset: number;
184
+ }): string;
124
185
  /** One plugin in full: what it is, how it stands, what one may run, its skills and its settings. */
125
186
  export declare function formatPlugin(detail: RestPluginDetail, language: string | null | undefined): string;
126
187
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/cli/format.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,EAEV,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,OAAO,EACP,UAAU,EACV,QAAQ,EACR,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,gBAAgB,EACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAClC,MAAM,EAAE,CAkBV;AAED,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAarE;AAQD,uGAAuG;AACvG,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAEvE;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAStE;AAED,0DAA0D;AAC1D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAqBvE;AAED,2DAA2D;AAC3D,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,wBAAwB,GAAG,MAAM,CAUrF;AAED,uGAAuG;AACvG,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAClC,MAAM,CASR"}
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/cli/format.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,UAAU,EACV,QAAQ,EACR,WAAW,EACX,UAAU,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACd,UAAU,EAEV,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,OAAO,EACP,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,WAAW,EACX,kBAAkB,EA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ED,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAarE;AAQD,uGAAuG;AACvG,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAEvE;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAStE;AAED,0DAA0D;AAC1D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAqBvE;AAED,2DAA2D;AAC3D,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,wBAAwB,GAAG,MAAM,CAUrF;AAED,uGAAuG;AACvG,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAClC,MAAM,CASR"}
@@ -1,4 +1,6 @@
1
+ import { createHash } from "node:crypto";
1
2
  import { argUsage } from "../plugin/args.js";
3
+ import { reportCountOf } from "../schemas.js";
2
4
  // What the command prints: one line per thing in a list, a few lines for one thing in full.
3
5
  // Plain text, for an agent to read and a person to skim; ids are given, since the commands take
4
6
  // them, and the words are the vocabulary's own, since the options take those.
@@ -63,7 +65,7 @@ export function formatProject(project) {
63
65
  const lines = [
64
66
  `project ${project.key}: ${project.name}`,
65
67
  `visibility: ${project.visibility} role: ${project.role} skills: ${project.skillsAddress ?? "the organization's"}`,
66
- `color: ${project.color ?? "none"} symbol: ${project.symbol ?? "none"} image: ${project.icon === null ? "none" : project.icon.contentType}`,
68
+ `color: ${project.color ?? "none"} symbol: ${project.symbol ?? "none"} glyph: ${project.glyph ?? "none"} image: ${project.icon === null ? "none" : project.icon.contentType}`,
67
69
  `pack token: ${project.packToken === null ? "none" : `set ${moment(project.packToken.setAt)}`}`,
68
70
  ];
69
71
  if (project.description.trim().length > 0) {
@@ -101,7 +103,16 @@ export function formatAgentLine(agent) {
101
103
  const standing = [
102
104
  `signs in as ${person.login}`,
103
105
  ...(manager === null ? [] : [`reports to ${calledOf(manager)}`]),
104
- ...(person.invited === true ? ["not signed in yet"] : []),
106
+ ...(person.invited === true
107
+ ? [
108
+ // At a git host, whether the host said which account the login is (ADR-0126).
109
+ agent.firstSignIn === undefined
110
+ ? "not signed in yet"
111
+ : agent.firstSignIn === "account"
112
+ ? "not signed in yet, its account confirmed at the host"
113
+ : "not signed in yet, its account not confirmed",
114
+ ]
115
+ : []),
105
116
  ...(person.status === "active" ? [] : ["deactivated"]),
106
117
  ].join(", ");
107
118
  return `@${person.handle ?? person.login} ${called.join(", ")} (${standing})`;
@@ -137,6 +148,11 @@ export function formatAgent(agent) {
137
148
  `runs with: model ${runner.running.model ?? OWN_CHOICE}, effort ${runner.running.effort ?? OWN_CHOICE}`,
138
149
  ]),
139
150
  `signals: ${runner.delivered} of ${runner.latest} delivered`,
151
+ ...(runner.sources === undefined || runner.sources.length === 0
152
+ ? []
153
+ : [
154
+ `wake sources beside the console: ${runner.sources.map(formatWakeSource).join("; ")}`,
155
+ ]),
140
156
  ]),
141
157
  ...(agent.hours === undefined
142
158
  ? []
@@ -155,6 +171,19 @@ export function formatAgent(agent) {
155
171
  : "You do not supervise it.",
156
172
  ].join("\n");
157
173
  }
174
+ /** A wake source as its runner last said it stands (ADR-0144): listening and since when, or not, and why. */
175
+ export function formatWakeSource(source) {
176
+ const why = source.why === undefined ? "" : ` (${source.why})`;
177
+ return source.state === "connected"
178
+ ? `${source.name} connected since ${moment(source.since)}`
179
+ : `${source.name} ${source.state}${why} since ${moment(source.since)}`;
180
+ }
181
+ /** A wake an agent account keeps for later (ADR-0145): what it is called, when it is raised, and the first words of what it says. */
182
+ export function formatOwnWakeLine(wake) {
183
+ const words = wake.text.replaceAll(/\s+/g, " ").trim();
184
+ const said = words.length === 0 ? "" : ` ${words.length > 120 ? `${words.slice(0, 119)}…` : words}`;
185
+ return `to come ${wake.key} ${moment(wake.at)}${said}`;
186
+ }
158
187
  /** How an agent account stands (ADR-0085), in a few words: the state, why, and when its runner was last heard from. */
159
188
  export function formatAgentState(agent) {
160
189
  const state = agent.state ?? null;
@@ -169,7 +198,7 @@ export function formatAgentState(agent) {
169
198
  * One signal of an agent account's record (ADR-0085): its number, its kind, who sent it or where
170
199
  * it came from, when, and the first words of what it says.
171
200
  */
172
- export function formatSignalLine(signal) {
201
+ export function formatSignalLine(signal, delivered) {
173
202
  const who = signal.by === null
174
203
  ? `${signal.source}${signal.key === null ? "" : `: ${signal.key}`}`
175
204
  : `${calledOf(signal.by)}${signal.agent === null ? "" : ` through ${signal.agent}`}`;
@@ -178,7 +207,11 @@ export function formatSignalLine(signal) {
178
207
  : ` model ${signal.set.model ?? OWN_CHOICE}, effort ${signal.set.effort ?? OWN_CHOICE}`;
179
208
  const words = signal.text.replaceAll(/\s+/g, " ").trim();
180
209
  const said = words.length === 0 ? "" : ` ${words.length > 120 ? `${words.slice(0, 119)}…` : words}`;
181
- return `#${signal.number} ${signal.kind} ${who} ${moment(signal.at)}${set}${said}`;
210
+ // Whether it is delivered, where the record says how far it is (ADR-0131): the product took
211
+ // it or the record says what became of it, or it waits for that. A console that does not
212
+ // say, one before 0.5.2 and the answer to a signal just sent, has nothing said here.
213
+ const state = delivered === undefined ? "" : signal.number <= delivered ? "delivered " : "waiting ";
214
+ return `#${signal.number} ${signal.kind} ${state}${who} ${moment(signal.at)}${set}${said}`;
182
215
  }
183
216
  /** One secret of an agent account's store (ADR-0087): its name, when it was set and by which side, and the day it ends on where one is known. Never its value. */
184
217
  export function formatSecretLine(secret) {
@@ -279,11 +312,14 @@ function scheduleLines(task) {
279
312
  return lines;
280
313
  }
281
314
  /** One task in full; with the decisions about it and the runs on it, when given. */
282
- export function formatTask(task, decisions, runs, comments) {
315
+ export function formatTask(task, decisions, runs, comments,
316
+ /** The address of the task's page at the console, where the command knows it: what a person is given to open. */
317
+ page) {
283
318
  const lines = [
284
319
  `#${task.number} ${task.title}`,
285
320
  `state: ${task.state} priority: ${task.priority} owner: ${calledOf(task.owner)} workers: ${task.workers.length === 0 ? "nobody" : logins(task.workers)}`,
286
321
  `id: ${task.id}${task.parentId === null ? "" : ` part of: ${task.parentId}`}`,
322
+ ...(page === undefined ? [] : [pageLine(page)]),
287
323
  ...(task.agent == null ? [] : [`written through: ${task.agent}`]),
288
324
  ...scheduleLines(task),
289
325
  ];
@@ -334,7 +370,9 @@ export function formatComment(comment) {
334
370
  return lines.join("\n");
335
371
  }
336
372
  export function formatRunLine(run) {
337
- const notes = [plural(run.reports.length, "report"), plural(run.artifacts.length, "artifact")];
373
+ // A run of a listing comes without its reports, counted (`?brief=true`); a run read whole,
374
+ // or from a console from before the brief form, with them.
375
+ const notes = [plural(reportCountOf(run), "report"), plural(run.artifacts.length, "artifact")];
338
376
  if (run.waitingFor !== null) {
339
377
  notes.push(`waiting for decision ${run.waitingFor}`);
340
378
  }
@@ -373,37 +411,151 @@ export function formatArtifact(artifact, fileUrl) {
373
411
  : `${artifact.file.name} (${artifact.file.size} bytes, ${artifact.file.contentType}${fileUrl === undefined ? "" : `; read at ${fileUrl(artifact.id)}`}; console file ${artifact.id})`;
374
412
  return artifact.label === null ? what : `${artifact.label}: ${what}`;
375
413
  }
376
- /** One half of the rules: where it comes from, and the text as it stands. */
377
- function formatRulesHalf(where, rules) {
378
- const page = rules.page;
379
- const facts = page === null
380
- ? undefined
381
- : `v${page.version}, by ${writer(page.updatedBy, page.agent)}; ${moment(page.updatedAt)}`;
382
- if (rules.source === "none" || rules.body === null) {
383
- return `Rules of ${where}: none of its own; the workspace's hold.`;
384
- }
414
+ /** When a part of the rules was written and by whom, where a page says; nothing for the console's own. */
415
+ function rulesFacts(page) {
416
+ return page === null
417
+ ? ""
418
+ : ` (v${page.version}, by ${writer(page.updatedBy, page.agent)}; ${moment(page.updatedAt)})`;
419
+ }
420
+ /** A part of the rules that has a text: what it is, who wrote it where someone did, and the text as it stands. */
421
+ const formatRulesPart = (head, page, body) => `${head}${rulesFacts(page)}:\n\n${body.trimEnd()}`;
422
+ /**
423
+ * The workspace's rules as a console of before the parts answers them (ADR-0120): whole, the
424
+ * console's own until an administrator writes the organization's in their place, which is
425
+ * what holds on such a console. No command is named for writing them: this one writes what an
426
+ * organization adds, and refuses to on a console that would keep it as the whole.
427
+ */
428
+ function formatRulesWhole(rules) {
385
429
  const head = rules.source === "reference"
386
- ? `Rules of ${where}: the console's own, until an administrator writes the organization's (console rules write --workspace).`
387
- : `Rules of ${where} (${facts ?? "written"}):`;
388
- return `${head}\n\n${rules.body.trimEnd()}`;
430
+ ? "Rules of the workspace: the console's own, until an administrator writes the organization's."
431
+ : `Rules of the workspace${rulesFacts(rules.page) || " (written)"}:`;
432
+ return `${head}\n\n${(rules.body ?? "").trimEnd()}`;
389
433
  }
390
434
  /**
391
- * The rules that hold: the workspace's, and what the project adds when the command works in one;
392
- * then the plugins the console names after them, a line each, where there are any.
435
+ * The parts of the rules as they are printed for whoever reads them (ADR-0120): what the
436
+ * project adds where the command works in one and it adds something, the plugins' lines in the
437
+ * language they are read in, what the organization adds where it adds something, and the
438
+ * console's rules, which always hold.
439
+ */
440
+ function rulesParts(rules, language) {
441
+ const named = "workspace" in rules;
442
+ const workspace = named ? rules.workspace : rules;
443
+ const project = named && rules.project.source !== "none" ? rules.project : undefined;
444
+ const count = rules.plugins?.length ?? 0;
445
+ const added = workspace.added ?? null;
446
+ return {
447
+ /** Whether the command works in a project: its rules were asked for, whether it adds any or not. */
448
+ named,
449
+ workspace,
450
+ /** What the project adds, where it adds something. */
451
+ own: project !== undefined && project.body !== null ? project : undefined,
452
+ plugins: rules.plugins === undefined || count === 0
453
+ ? undefined
454
+ : formatRulesPlugins(rules.plugins, language),
455
+ pluginCount: count,
456
+ /** What the organization adds, where it adds something and the console says the parts. */
457
+ added: workspace.own === undefined || added === null ? undefined : added,
458
+ /** The console's rules by themselves; nothing from a console of before, which answers the whole. */
459
+ console: workspace.own,
460
+ };
461
+ }
462
+ /**
463
+ * The mark of the rules (ADR-0119): the first eight hex characters of a SHA-256 over what they
464
+ * say to whoever reads them: the workspace's text whole, which is the console's rules with
465
+ * what the organization adds (ADR-0120), what the project adds, and the plugins' lines, in the
466
+ * language they are read in. A session that was shown the rules holds their mark, and a later
467
+ * take of that session leaves out the rules the mark stands for; nothing but having been shown
468
+ * them gives it. When they were written and by whom is no part of it: the same rules have the
469
+ * same mark, and a project that adds nothing has the workspace's.
470
+ */
471
+ export function rulesMark(rules, language) {
472
+ const parts = rulesParts(rules, language);
473
+ return createHash("sha256")
474
+ .update(JSON.stringify([
475
+ (parts.workspace.body ?? "").trimEnd(),
476
+ parts.own === undefined ? null : (parts.own.body ?? "").trimEnd(),
477
+ parts.plugins ?? null,
478
+ ]))
479
+ .digest("hex")
480
+ .slice(0, 8);
481
+ }
482
+ /** How long a text of the rules is, as its first line says it. */
483
+ const charactersOf = (text) => `${(text ?? "").trimEnd().length} characters`;
484
+ /**
485
+ * The rules that hold, under a first line that says what follows (ADR-0119): the mark, which
486
+ * parts there are and how long each is, and how a later take of the session leaves them out.
487
+ * What differs stands first and what always holds last (ADR-0120): what the project adds with
488
+ * the plugins' lines, then what the organization adds, then the console's rules. An agent that
489
+ * had read the long part once cut every later print at its head, and never saw what stood
490
+ * after it; and where they differ it is the earlier part that holds. Who adds nothing is said
491
+ * in a clause of the line, and has no part.
393
492
  */
394
493
  export function formatRules(rules, language) {
395
- const parts = "workspace" in rules
396
- ? [
397
- formatRulesHalf("the workspace", rules.workspace),
398
- "",
399
- formatRulesHalf("this project", rules.project),
400
- ]
401
- : [formatRulesHalf("the workspace", rules)];
402
- if (rules.plugins !== undefined && rules.plugins.length > 0) {
403
- parts.push("", formatRulesPlugins(rules.plugins, language));
494
+ const parts = rulesParts(rules, language);
495
+ const mark = rulesMark(rules, language);
496
+ // A console of before answers the workspace's rules whole: they are the last part then.
497
+ const whole = parts.console === undefined;
498
+ const last = whole
499
+ ? `the workspace's (${charactersOf(parts.workspace.body)})`
500
+ : `the console's (${charactersOf(parts.console ?? null)})`;
501
+ const lastFollows = whole
502
+ ? `the workspace's follow (${charactersOf(parts.workspace.body)})`
503
+ : `the console's follow (${charactersOf(parts.console ?? null)})`;
504
+ const plugins = `${parts.pluginCount} plugin${parts.pluginCount === 1 ? "" : "s"}`;
505
+ const HOLDS = "the earlier holding where they differ";
506
+ /** The organization's part and the last, after whatever stood before them. */
507
+ const rest = (first) => parts.added === undefined
508
+ ? last
509
+ : `the organization's${first ? " additions first" : ""} (${charactersOf(parts.added.body)}), then ${last}`;
510
+ let follows;
511
+ if (parts.own !== undefined) {
512
+ follows = `this project's additions first (${charactersOf(parts.own.body)})${parts.plugins === undefined ? "" : ` with its ${plugins}`}, then ${rest(false)}, ${HOLDS}${whole || parts.added !== undefined ? "" : "; the organization adds nothing"}.`;
404
513
  }
405
- return parts.join("\n");
514
+ else {
515
+ const nobody = parts.added === undefined && !whole;
516
+ const lead = parts.named
517
+ ? nobody
518
+ ? "this project and the organization add nothing; "
519
+ : "this project adds nothing; "
520
+ : nobody
521
+ ? "the organization adds nothing; "
522
+ : "";
523
+ const theirs = parts.named ? `its ${plugins}` : `the ${plugins} you may use`;
524
+ const body = parts.plugins !== undefined
525
+ ? `${theirs} first, then ${parts.added === undefined ? last : `the organization's additions (${charactersOf(parts.added.body)}), then ${last}, ${HOLDS}`}`
526
+ : parts.added === undefined
527
+ ? parts.named || nobody
528
+ ? lastFollows
529
+ : last
530
+ : `${rest(true)}, ${HOLDS}`;
531
+ follows = `${lead}${body}${parts.named ? "." : "; no project is named here, and a project's additions stand before them where it has some."}`;
532
+ }
533
+ // The mark ends the line bare, so that it is copied as it is.
534
+ const later = parts.named
535
+ ? ` A later take in this session leaves them out: console take <number> --rules ${mark}`
536
+ : "";
537
+ return [
538
+ `Rules ${mark}: ${follows}${later}`,
539
+ ...(parts.own === undefined
540
+ ? []
541
+ : ["", formatRulesPart("What this project adds", parts.own.page, parts.own.body ?? "")]),
542
+ ...(parts.plugins === undefined ? [] : ["", parts.plugins]),
543
+ ...(parts.added === undefined
544
+ ? []
545
+ : ["", formatRulesPart("What this organization adds", parts.added.page, parts.added.body)]),
546
+ "",
547
+ parts.console === undefined
548
+ ? formatRulesWhole(parts.workspace)
549
+ : formatRulesPart("The console's rules, which always hold", null, parts.console),
550
+ ].join("\n");
406
551
  }
552
+ /** What a take says, before the task, where it was told the mark the rules have (ADR-0119): they are left out. */
553
+ export const formatRulesLeftOut = (mark) => `Rules ${mark}: left out, since they stand as this session read them. console rules prints them.`;
554
+ /**
555
+ * What a take says, before the task, where it was told a mark the rules do not have (ADR-0119):
556
+ * the rules then follow the task whole, as they do without a mark.
557
+ */
558
+ export const formatRulesChanged = (given) => `The rules are not the ones marked ${given}: they changed since, or that mark is of another project's. They follow whole after the task, under the mark they have now.`;
407
559
  /** How far a goal is, from its tasks: the done, the at work, and the rest, in one phrase. */
408
560
  function progressOf(goal) {
409
561
  const counts = goal.taskCounts;
@@ -483,9 +635,13 @@ export const deciderLogins = (decision) => decidersOf(decision).map(calledOf).jo
483
635
  const addressed = (decision) => decidersOf(decision).every((person) => person.id === decision.raisedBy.id)
484
636
  ? ""
485
637
  : `, for ${deciderLogins(decision)}`;
638
+ /**
639
+ * One decision in a line, with when it was asked: a decision that waits holds a run, and whoever
640
+ * is told what is on their plate is told since when each one waits.
641
+ */
486
642
  export function formatDecisionLine(decision) {
487
643
  const state = decision.answer === null ? "waiting" : `answered ${decision.answer.option}`;
488
- return `${decision.id} ${state} ${decision.question} (asked by ${asker(decision)}${addressed(decision)})`;
644
+ return `${decision.id} ${state} ${decision.question} (asked by ${asker(decision)}${addressed(decision)}, at ${moment(decision.createdAt)})`;
489
645
  }
490
646
  /** The options, one a line; the person's own answer, when they wrote one, is the last and says so. */
491
647
  export function formatOptions(decision) {
@@ -501,13 +657,19 @@ export function formatAnswer(decision) {
501
657
  }
502
658
  const chosen = decision.options.find((option) => option.id === answer.option);
503
659
  const lines = [
504
- `Answered: ${answer.option}) ${chosen?.label ?? answer.option}${chosen?.own === true ? ", in their own words" : ""}, by ${calledOf(answer.by)}${through(answer.agent)} at ${answer.at}`,
660
+ `Answered: ${answer.option}) ${chosen?.label ?? answer.option}${chosen?.own === true ? ", in their own words" : ""}, by ${calledOf(answer.by)}${through(answer.agent)} at ${moment(answer.at)}`,
505
661
  ];
506
662
  if (answer.note !== null && answer.note.length > 0) {
507
663
  lines.push(`Note: ${answer.note}`);
508
664
  }
509
665
  return lines.join("\n");
510
666
  }
667
+ /**
668
+ * The address of a task's or a decision's page, on a line of its own: what an agent gives a
669
+ * person to open, in place of the console's front page, or of a number a git host would take
670
+ * for an issue of its own.
671
+ */
672
+ export const pageLine = (page) => `page: ${page}`;
511
673
  /**
512
674
  * One decision in full. A decision reached at its own address (ADR-0068), outside the project the
513
675
  * command works in, names its files with the command that reads them there, by the decision too:
@@ -519,7 +681,8 @@ export function formatDecision(decision, options = {}) {
519
681
  : `console file ${fileId}`;
520
682
  const lines = [
521
683
  `decision ${decision.id}: ${decision.question}`,
522
- `asked by ${asker(decision)}${addressed(decision)}${decision.taskNumber === null ? "" : `, about task #${decision.taskNumber}`}`,
684
+ `asked by ${asker(decision)}${addressed(decision)}${decision.taskNumber === null ? "" : `, about task #${decision.taskNumber}`}, at ${moment(decision.createdAt)}`,
685
+ ...(options.page === undefined ? [] : [pageLine(options.page)]),
523
686
  ];
524
687
  if (decision.body.trim().length > 0) {
525
688
  lines.push("", decision.body.trimEnd());
@@ -533,7 +696,7 @@ export function formatDecision(decision, options = {}) {
533
696
  if (decision.outcome !== null && decision.outcome.trim().length > 0) {
534
697
  lines.push("", "what followed:", indent(decision.outcome));
535
698
  if (decision.outcomeBy != null && decision.outcomeAt != null) {
536
- lines.push(indent(`written by ${calledOf(decision.outcomeBy)}${through(decision.outcomeAgent)} at ${decision.outcomeAt}`));
699
+ lines.push(indent(`written by ${calledOf(decision.outcomeBy)}${through(decision.outcomeAgent)} at ${moment(decision.outcomeAt)}`));
537
700
  }
538
701
  }
539
702
  return lines.join("\n");
@@ -731,15 +894,29 @@ export function formatPluginHelp(detail, name) {
731
894
  : "Prints what the command says; --json prints its data. A command that raised a decision prints its id and exits with 3: console decision <id> --wait 100 waits for the answer.", "", "Refusals:", ...PLUGIN_COMMAND_REFUSALS.map((refusal) => ` ${refusal}`));
732
895
  return parts.join("\n");
733
896
  }
734
- /** A setting in a line: its key and type, what it holds or whether it is set, and its name. */
897
+ /** When a secret was set, from where where it was sealed from an answer, and when it expires: never what it holds. */
898
+ function secretStanding(standing) {
899
+ return `set${standing.setAt === null ? "" : ` ${moment(standing.setAt)}`}${standing.source === null || standing.source === undefined || standing.source === "administrator"
900
+ ? ""
901
+ : ` from ${standing.source}`}${standing.expiresAt === null || standing.expiresAt === undefined ? "" : `, expires ${moment(standing.expiresAt)}`}`;
902
+ }
903
+ /**
904
+ * A setting in a line: its key and type, what it holds or whether it is set, and its name; for a
905
+ * secret kept per key (ADR-0111), how many keys of how many, and a line under it for each key.
906
+ */
735
907
  export function formatPluginSettingLine(setting, language) {
908
+ const keys = setting.keys ?? null;
909
+ if (setting.type === "secret" && keys !== null) {
910
+ const max = setting.keyed?.max;
911
+ const count = `${keys.length}${max === undefined ? "" : ` of ${max}`} ${keys.length === 1 && max === undefined ? "key" : "keys"}`;
912
+ return [
913
+ ` ${setting.key} (secret, per key): ${count} ${localized(setting.name, language)}`,
914
+ ...keys.map((kept) => ` ${kept.key}: ${secretStanding(kept)}`),
915
+ ].join("\n");
916
+ }
736
917
  const holds = setting.type === "secret"
737
918
  ? setting.set
738
- ? `set${setting.setAt === null ? "" : ` ${moment(setting.setAt)}`}${setting.source === null ||
739
- setting.source === undefined ||
740
- setting.source === "administrator"
741
- ? ""
742
- : ` from ${setting.source}`}${setting.expiresAt === null || setting.expiresAt === undefined ? "" : `, expires ${moment(setting.expiresAt)}`}`
919
+ ? secretStanding(setting)
743
920
  : "not set"
744
921
  : setting.set
745
922
  ? setting.value === null
@@ -769,6 +946,52 @@ export function formatTeamLine(team, loginOf) {
769
946
  const count = team.memberIds.length === 1 ? "1 member" : `${team.memberIds.length} members`;
770
947
  return `${team.key} ${team.name} ${count}${logins.length === 0 ? "" : `: ${logins.join(", ")}`}`;
771
948
  }
949
+ /**
950
+ * A job of a plugin in a line (ADR-0128): its name and how often it runs, how its last run went
951
+ * and since when it has failed where it keeps failing, and when it runs next.
952
+ */
953
+ export function formatPluginJobLine(job) {
954
+ const schedule = `every ${job.every}${job.at === null ? "" : ` at ${job.at}`}`;
955
+ const last = job.lastRunAt === null || job.lastOutcome === null
956
+ ? "has not run yet"
957
+ : `last run ${moment(job.lastRunAt)}: ${job.lastOutcome}${job.lastOutcome === "failed" && job.failedSince !== null
958
+ ? `, failing since ${moment(job.failedSince)}`
959
+ : ""}`;
960
+ return ` ${job.name} ${schedule} ${last} next: ${job.nextAt === null ? "not scheduled" : moment(job.nextAt)}`;
961
+ }
962
+ /** What an event of a plugin says, after its kind: what failed, which command and how it ended, else what it carries. */
963
+ function pluginEventSays(event) {
964
+ const data = event.data;
965
+ if (event.kind === "plugin.failed") {
966
+ return data.problem ?? "";
967
+ }
968
+ if (event.kind === "plugin.command") {
969
+ return `${data.command ?? "?"} ${data.outcome ?? "?"}${data.code === undefined ? "" : ` (${data.code})`}${data.durationMs === undefined ? "" : `, ${data.durationMs} ms`}`;
970
+ }
971
+ const carried = JSON.stringify(data);
972
+ return carried === "{}" ? "" : carried.length > 300 ? `${carried.slice(0, 300)}...` : carried;
973
+ }
974
+ /** One event of a plugin in a line: its number, when, its kind, who did it and through what, and what it says. */
975
+ export function formatPluginEventLine(event) {
976
+ const who = event.actor === null
977
+ ? "the console"
978
+ : `${calledOf(event.actor)}${event.agent === null ? "" : ` as ${event.agent}`}`;
979
+ const says = pluginEventSays(event);
980
+ return `#${event.id} ${moment(event.createdAt)} ${event.kind} ${who}${says === "" ? "" : ` ${says}`}`;
981
+ }
982
+ /**
983
+ * A page of a plugin's events, newest first (ADR-0128), of one kind where one was asked for:
984
+ * what `console plugin <key> events` prints, with how to read on. The console answers what the
985
+ * caller may read and says nothing of the rest, so an empty page is said as that, and never as
986
+ * a plugin that has no events.
987
+ */
988
+ export function formatPluginEvents(key, page, asked) {
989
+ if (page.items.length === 0) {
990
+ const none = `No ${asked.kind === undefined ? "" : `${asked.kind} `}event of ${key} that you may read${asked.offset > 0 ? ", that far back" : ""}.`;
991
+ return `${none}${formatMore(page.more, asked.limit, asked.offset)}`;
992
+ }
993
+ return `${page.items.map(formatPluginEventLine).join("\n")}${formatMore(page.more, asked.limit, asked.offset)}`;
994
+ }
772
995
  /** One plugin in full: what it is, how it stands, what one may run, its skills and its settings. */
773
996
  export function formatPlugin(detail, language) {
774
997
  const name = localized(detail.name, language);
@@ -810,6 +1033,10 @@ export function formatPlugin(detail, language) {
810
1033
  if (detail.skills !== null) {
811
1034
  lines.push("", `Skills: console plugin ${detail.key} skills lists them; console plugin ${detail.key} skill <path> reads one. Read the one that fits before the first command.`);
812
1035
  }
1036
+ // A console before 0.5.1 names no jobs: nothing is printed of them then, not an empty block.
1037
+ if (detail.jobs !== undefined && detail.jobs.length > 0) {
1038
+ lines.push("", `Jobs (what went wrong in one: console plugin ${detail.key} events --kind plugin.failed):`, ...detail.jobs.map(formatPluginJobLine));
1039
+ }
813
1040
  if (detail.settings.length > 0) {
814
1041
  lines.push("", "Settings:", ...detail.settings.map((setting) => formatPluginSettingLine(setting, language)));
815
1042
  }