@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
package/src/onboarding.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import type { RestWorkspace } from "./schemas.js";
2
- import { guideServicesOf } from "./setup-guide.js";
2
+ import { BROWSER_TOOL_OF_A_PRODUCT, guideServicesOf } from "./setup-guide.js";
3
3
 
4
4
  // The onboarding of an agent account (ADR-0088, points 4 to 6): its first task, which the
5
5
  // console makes when the account is made, with the agent as its worker. The agent works it as
6
6
  // any task, with a run, reports and decisions; what only a person can do it asks for as a
7
7
  // decision, of whoever can do it; the board wakes the agent with it as with any ready task it
8
- // is at work on, which is its first wake. The task's words are made here, for one account and the
8
+ // is at work on, which is its first wake. Its run stays open while a decision of it waits, which
9
+ // the console never ends, and the task is finished when nothing of it waits on anyone: a run
10
+ // finished with decisions waiting could ask no more. The task's words are made here, for one account and the
9
11
  // services of its workspace, in the words of their modules: English, as a skill is, for the
10
12
  // agent to read as they are.
11
13
 
@@ -14,6 +16,12 @@ export interface OnboardingInput {
14
16
  readonly handle: string;
15
17
  /** The workspace's names and services (ADR-0089). */
16
18
  readonly workspace: Pick<RestWorkspace, "handle" | "domain" | "services">;
19
+ /**
20
+ * The login the account signs in to the console with, where whoever makes the task knows it:
21
+ * an address there is the account's own address, which the task then names. Left out, what
22
+ * the workspace's identity service makes of its names.
23
+ */
24
+ readonly login?: string | undefined;
17
25
  }
18
26
 
19
27
  /** What the onboarding task of an account is called. */
@@ -29,12 +37,12 @@ export function onboardingOf(input: OnboardingInput): {
29
37
  readonly body: string;
30
38
  } {
31
39
  const { handle } = input;
32
- const services = guideServicesOf(input.workspace, handle);
40
+ const services = guideServicesOf(input.workspace, handle, input.login);
33
41
  const own = [
34
42
  ...services.flatMap((one) => one.onboarding.map((step) => item(step.title, step.body))),
35
43
  item(
36
44
  "Sign in at a page in the machine's own browser",
37
- "Use a browser tool of your product that attaches to the ordinary browser of your OS account: a sign-in stays there from one session to the next. Where a sign-in wants a person, a code sent to a phone or a picture to solve, ask for a person to sign in inside your session, over a remote desktop or at the machine, and say which service and which account; nothing you sign in with goes into a message, a task or a comment.",
45
+ `Use a browser tool of your product that attaches to the ordinary browser of your OS account: a sign-in stays there from one session to the next. ${BROWSER_TOOL_OF_A_PRODUCT} Where a sign-in wants a person, a code sent to a phone or a picture to solve, ask for a person to sign in inside your session, over a remote desktop or at the machine, and say which service and which account; nothing you sign in with goes into a message, a task or a comment.`,
38
46
  ),
39
47
  item(
40
48
  "Put your picture on your profiles",
@@ -51,7 +59,7 @@ export function onboardingOf(input: OnboardingInput): {
51
59
  ];
52
60
  const asked = services.flatMap((one) => one.asks.map((ask) => item(ask.title, ask.body)));
53
61
  const body = [
54
- `This is your first task, @${handle}: making your account ready to work. Work it as any task: take it, report as you go, and finish it with what is done and what still waits on a person. \`console help\` and the skill \`working-the-board\` say how.`,
62
+ `This is your first task, @${handle}: making your account ready to work. Work it as any task: take it, and report as you go. What waits on a person you ask for as a decision, and a run that waits for a decision stays open: the answer wakes you, and you go on with that run (\`--run <id>\`). The task is finished when nothing of it waits on anyone. \`console help\` and the skill \`working-the-board\` say how.`,
55
63
  "",
56
64
  "## What you do yourself",
57
65
  "",
@@ -69,7 +77,7 @@ export function onboardingOf(input: OnboardingInput): {
69
77
  "",
70
78
  "## When you are done",
71
79
  "",
72
- "Report what is set up and what still waits on a person, and finish the task.",
80
+ "When nothing of this task waits on anyone, every item set up or answered as not to be done now, report what is set up and, item by item, what is not done and who said so, and finish the task.",
73
81
  "",
74
82
  ].join("\n");
75
83
  return { title: onboardingTitle(handle), body };
@@ -441,9 +441,11 @@ export type SecretPlacement =
441
441
  | "basic"
442
442
  | `body:${string}`;
443
443
 
444
- /** One secret setting and where it goes. */
444
+ /** One secret setting and where it goes; for a keyed one (ADR-0111), the key whose value goes. */
445
445
  export interface SecretUse {
446
446
  readonly name: string;
447
+ /** The key of a keyed secret, and of no other. */
448
+ readonly key?: string | undefined;
447
449
  readonly as: SecretPlacement;
448
450
  }
449
451
 
@@ -451,22 +453,40 @@ export interface SecretUse {
451
453
  * A value of the answer to seal as a secret setting (ADR-0070): the path to it in the answer's
452
454
  * JSON (`$.access_token`, `$.credentials.signing_secret`, `$.items.0.token`), and, where it
453
455
  * expires, how long it lasts, in seconds or as a path to the seconds (`$.expires_in`). The
454
- * console seals the value and hands the plugin the answer with `"[sealed]"` in its place.
456
+ * console seals the value and hands the plugin the answer with `"[sealed]"` in its place. A
457
+ * keyed secret (ADR-0111) is sealed under `key`: a path into the same answer (`$.team.id`), or
458
+ * the key itself.
455
459
  */
456
460
  export type SecretSeal =
457
461
  | string
458
- | { readonly path: string; readonly expiresIn?: number | string | undefined };
462
+ | {
463
+ readonly path: string;
464
+ readonly expiresIn?: number | string | undefined;
465
+ /** For a keyed secret, and no other: the key, or the path to it in the answer. */
466
+ readonly key?: string | undefined;
467
+ };
459
468
 
460
469
  /**
461
470
  * What became of a value `seal` named (ADR-0070). `sealed`: sealed as the setting, the answer
462
471
  * saying `"[sealed]"` in its place. `absent`: nothing at the path (no such key, `null` or an
463
472
  * empty string); nothing sealed, nothing taken out. `not_a_string`, `too_long` and `echoed`: a
464
473
  * value that is no string, is over the bound of a secret (4,096 characters), or holds a secret
465
- * the request carried from another setting; never sealed and never handed over, the answer saying
466
- * `"[withheld]"` in its place. `not_json`: an answer that is no JSON object or array, whose body
467
- * is withheld whole. Only `sealed` changed the setting.
474
+ * the request carried from another setting or key; `no_key`, for a keyed secret (ADR-0111), a
475
+ * key the answer does not hold where the seal names a path, or holds not as a key is spelled;
476
+ * `too_many`, a key the secret does not keep yet, where it keeps as many as its `max`: never
477
+ * sealed and never handed over, the answer saying `"[withheld]"` in its place. `not_json`: an
478
+ * answer that is no JSON object or array, whose body is withheld whole. Only `sealed` changed the
479
+ * setting.
468
480
  */
469
- export type SealOutcome = "sealed" | "absent" | "not_a_string" | "too_long" | "echoed" | "not_json";
481
+ export type SealOutcome =
482
+ | "sealed"
483
+ | "absent"
484
+ | "not_a_string"
485
+ | "too_long"
486
+ | "echoed"
487
+ | "no_key"
488
+ | "too_many"
489
+ | "not_json";
470
490
 
471
491
  export interface PluginFetchInit {
472
492
  /** `GET` unless said; `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE` or `OPTIONS`, and no other. */
@@ -507,12 +527,35 @@ export interface SecretStatus {
507
527
  readonly source: string | null;
508
528
  }
509
529
 
530
+ /** How the value of a keyed secret under one key stands (ADR-0111). */
531
+ export interface SecretKeyStatus extends SecretStatus {
532
+ readonly key: string;
533
+ }
534
+
510
535
  export interface PluginSecrets {
511
- /** Whether the secret is set and not past its expiry. */
512
- has(name: string): Promise<boolean>;
513
- /** How the secret stands, for a settings page to say and a job to decide whether to renew it. */
514
- status(name: string): Promise<SecretStatus>;
515
- /** Signs with the secret; refused for a secret declared `use: "verify"`, which signs nothing. */
536
+ /**
537
+ * Whether the secret is set and not past its expiry; for a keyed one, its value under `key`,
538
+ * and without a key the value it kept from before it was keyed, which `move` puts under one.
539
+ */
540
+ has(name: string, key?: string): Promise<boolean>;
541
+ /**
542
+ * How the secret stands, for a settings page to say and a job to decide whether to renew it;
543
+ * for a keyed one, its value under `key`, or without a key the value of before it was keyed.
544
+ */
545
+ status(name: string, key?: string): Promise<SecretStatus>;
546
+ /** The keys a keyed secret keeps a value under, each with how it stands, in the order of the keys. */
547
+ keys(name: string): Promise<readonly SecretKeyStatus[]>;
548
+ /**
549
+ * Forgets the value of a keyed secret under `key`, where what the key stood for is gone: an
550
+ * installation removed at the service, say. Answers whether there was one.
551
+ */
552
+ forget(name: string, key: string): Promise<boolean>;
553
+ /**
554
+ * Puts the value a keyed secret kept from before it was keyed under `key`, in place of what the
555
+ * key held: an upgrade's way to keep a token through the change. Answers whether there was one.
556
+ */
557
+ move(name: string, key: string): Promise<boolean>;
558
+ /** Signs with the secret; refused for a secret declared `use: "verify"`, which signs nothing, and for a keyed one. */
516
559
  sign(name: string, payload: string | Uint8Array, algorithm: "hmac-sha256"): Promise<string>;
517
560
  verify(
518
561
  name: string,
@@ -27,6 +27,8 @@ export const MAX_PLUGIN_INDEXES = 8;
27
27
  export const MAX_PLUGIN_ABOUT_LENGTH = 200;
28
28
  /** The options of an `enum` setting or argument. */
29
29
  export const MAX_PLUGIN_OPTIONS = 50;
30
+ /** The most keys a keyed secret setting may keep a value under, whatever its `max` says (ADR-0111). */
31
+ export const MAX_PLUGIN_SECRET_KEYS = 1000;
30
32
  /** A record, how many a plugin keeps, and how many versions one record keeps. */
31
33
  export const MAX_PLUGIN_RECORD_BYTES = 64 * 1024;
32
34
  export const MAX_PLUGIN_RECORDS = 100_000;
@@ -19,6 +19,7 @@ import {
19
19
  MAX_PLUGIN_OPTIONS,
20
20
  MAX_PLUGIN_PAGES,
21
21
  MAX_PLUGIN_ROLES,
22
+ MAX_PLUGIN_SECRET_KEYS,
22
23
  MAX_PLUGIN_SETTING_GROUPS,
23
24
  MAX_PLUGIN_SETTINGS,
24
25
  MAX_PLUGIN_WIDGETS,
@@ -109,10 +110,12 @@ export const RESERVED_ARG_NAMES: readonly string[] = [
109
110
  export const RESERVED_COMMAND_NAMES: readonly string[] = [
110
111
  "help",
111
112
  "records",
113
+ "events",
112
114
  "skills",
113
115
  "skill",
114
116
  "enable",
115
117
  "disable",
118
+ "capabilities",
116
119
  "settings",
117
120
  "secret",
118
121
  "grant",
@@ -284,6 +287,17 @@ const settingItemType = z.enum(
284
287
  PLUGIN_SETTING_TYPES.filter((type) => type !== "secret" && type !== "list"),
285
288
  );
286
289
 
290
+ /**
291
+ * A key a keyed secret keeps a value under (ADR-0111): letters, digits, `_` and `-`, up to 64, a
292
+ * workspace's id at a service, say. It is no secret, and a path into an answer (`$.team.id`)
293
+ * never reads as one.
294
+ */
295
+ export const PLUGIN_SECRET_KEY_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
296
+
297
+ export function isPluginSecretKey(value: unknown): value is string {
298
+ return typeof value === "string" && PLUGIN_SECRET_KEY_PATTERN.test(value);
299
+ }
300
+
287
301
  /** A setting's key, as code and `--set` name it: a lowercase letter, then letters and digits. */
288
302
  export const SETTING_KEY_PATTERN = /^[a-z][a-zA-Z0-9]{0,31}$/;
289
303
 
@@ -316,6 +330,15 @@ const pluginSettingSchema = z
316
330
  hosts: z.optional(z.array(z.string().check(z.maxLength(300))).check(z.maxLength(20))),
317
331
  /** For a `secret`: `verify`, a secret that verifies signatures and signs nothing, so that a request cannot be forged with it. */
318
332
  use: z.optional(z.literal("verify")),
333
+ /**
334
+ * For a `secret`: one value per key, up to `max` keys (ADR-0111), each key named by the
335
+ * plugin or read from the answer it was sealed from, a workspace's id elsewhere, say.
336
+ */
337
+ keyed: z.optional(
338
+ z.strictObject({
339
+ max: z.int().check(z.minimum(1), z.maximum(MAX_PLUGIN_SECRET_KEYS)),
340
+ }),
341
+ ),
319
342
  })
320
343
  .check(
321
344
  z.superRefine((setting, ctx) => {
@@ -373,10 +396,23 @@ function settingProblems(setting: {
373
396
  of?: Exclude<PluginSettingType, "secret" | "list">;
374
397
  hosts?: readonly string[];
375
398
  use?: "verify";
399
+ keyed?: { max: number };
400
+ required?: boolean;
376
401
  }): string[] {
377
402
  const problems: string[] = [];
378
- if (setting.type !== "secret" && (setting.hosts !== undefined || setting.use !== undefined)) {
379
- problems.push(`only a secret takes hosts or use`);
403
+ if (
404
+ setting.type !== "secret" &&
405
+ (setting.hosts !== undefined || setting.use !== undefined || setting.keyed !== undefined)
406
+ ) {
407
+ problems.push(`only a secret takes hosts, use or keyed`);
408
+ }
409
+ // A keyed secret's values come and go with what each key stands for, so that none is required
410
+ // to enable the plugin; and it goes into requests alone, never verifying a signature.
411
+ if (setting.keyed !== undefined && setting.use !== undefined) {
412
+ problems.push("a keyed secret takes no use");
413
+ }
414
+ if (setting.keyed !== undefined && setting.required === true) {
415
+ problems.push("a keyed secret is not required");
380
416
  }
381
417
  for (const host of setting.hosts ?? []) {
382
418
  if (!isPluginCapability(`outbound:${host}`) || host === "webrtc") {
@@ -160,6 +160,17 @@ export const restPluginsSchema = z.object({
160
160
  });
161
161
  export type RestPlugins = z.infer<typeof restPluginsSchema>;
162
162
 
163
+ /** The value of a keyed secret under one key (ADR-0111), as the pages show it: never the value. */
164
+ export const restPluginSecretKeySchema = z.object({
165
+ key: z.string(),
166
+ setAt: instant,
167
+ /** When it expires, or `null`. */
168
+ expiresAt: z.nullable(instant),
169
+ /** `administrator`, or the host of the answer it was sealed from. */
170
+ source: z.string(),
171
+ });
172
+ export type RestPluginSecretKey = z.infer<typeof restPluginSecretKeySchema>;
173
+
163
174
  /** A setting as the pages draw its form: the manifest's declaration, and whether and what it holds. */
164
175
  export const restPluginSettingSchema = z.object({
165
176
  key: z.string(),
@@ -187,6 +198,13 @@ export const restPluginSettingSchema = z.object({
187
198
  hosts: z.optional(z.nullable(z.array(z.string()))),
188
199
  /** `verify` for a secret that verifies and signs nothing, or `null`. */
189
200
  use: z.optional(z.nullable(z.literal("verify"))),
201
+ /** For a secret that keeps a value per key (ADR-0111), how many keys it may keep; `null` otherwise. Answered from 0.5.1 and read as optional. */
202
+ keyed: z.optional(z.nullable(z.object({ max: z.int() }))),
203
+ /**
204
+ * For a keyed secret, the keys it keeps a value under, each with when and from where it was set
205
+ * and when it expires, never the value; `null` otherwise. Answered from 0.5.1 and read as optional.
206
+ */
207
+ keys: z.optional(z.nullable(z.array(restPluginSecretKeySchema))),
190
208
  });
191
209
  export type RestPluginSetting = z.infer<typeof restPluginSettingSchema>;
192
210
 
@@ -208,6 +226,27 @@ export type RestPluginGrant = z.infer<typeof restPluginGrantSchema>;
208
226
  export const restPluginGrantsSchema = z.object({ items: z.array(restPluginGrantSchema) });
209
227
  export type RestPluginGrants = z.infer<typeof restPluginGrantsSchema>;
210
228
 
229
+ /**
230
+ * A job of a plugin as its scheduler keeps it (ADR-0128): how often it runs, how its last run
231
+ * went, when it runs next, and since when it has failed where it failed run after run.
232
+ */
233
+ export const restPluginJobSchema = z.object({
234
+ name: z.string(),
235
+ /** How often it runs, an ISO 8601 duration. */
236
+ every: z.string(),
237
+ /** The time of day it runs at, `HH:MM` in the workspace's time zone, or `null`. */
238
+ at: z.nullable(z.string()),
239
+ /** When it last ran, or `null` before its first run. */
240
+ lastRunAt: z.nullable(instant),
241
+ /** How its last run went, or `null` before its first run. */
242
+ lastOutcome: z.nullable(z.enum(["ok", "failed"])),
243
+ /** When it runs next; `null` where the plugin is not enabled with its `jobs` capability, or the scheduler has not seen the job yet. */
244
+ nextAt: z.nullable(instant),
245
+ /** Its first failure since it last went well, or `null` while it goes well: a job that failed twice running is among the plugin's `problems`. */
246
+ failedSince: z.nullable(instant),
247
+ });
248
+ export type RestPluginJob = z.infer<typeof restPluginJobSchema>;
249
+
211
250
  /** One plugin whole, for `GET /api/v1/plugins/<key>`: the listing's fields, and what agents and administrators need. */
212
251
  export const restPluginDetailSchema = z.extend(restPluginSchema, {
213
252
  operations: z.array(restPluginOperationSchema),
@@ -246,6 +285,8 @@ export const restPluginDetailSchema = z.extend(restPluginSchema, {
246
285
  }),
247
286
  ),
248
287
  ),
288
+ /** The jobs the plugin's module declares, each as its scheduler keeps it (ADR-0128); answered from 0.5.1 and read as optional. */
289
+ jobs: z.optional(z.array(restPluginJobSchema)),
249
290
  });
250
291
  export type RestPluginDetail = z.infer<typeof restPluginDetailSchema>;
251
292
 
@@ -43,8 +43,11 @@ export function isForbiddenBuiltin(specifier: string): boolean {
43
43
  );
44
44
  }
45
45
 
46
+ // The blanks around an import's bracket are taken in one way only, `\s*(?:\(\s*)?`: written as
47
+ // `\s*\(?\s*`, a run of blanks with no bracket in it is divided between the two in every way
48
+ // before the expression gives up, the square of its length, and a bundle is megabytes.
46
49
  const IMPORT_OR_REQUIRE =
47
- /(?:\bfrom\s*|\bimport\s*\(?\s*|\brequire\s*\(\s*|\bprocess\.getBuiltinModule\s*\(\s*)["'`](node:)?([a-z_/]+)["'`]/g;
50
+ /(?:\bfrom\s*|\bimport\s*(?:\(\s*)?|\brequire\s*\(\s*|\bprocess\.getBuiltinModule\s*\(\s*)["'`](node:)?([a-z_/]+)["'`]/g;
48
51
 
49
52
  /** The built-ins a bundle's text imports or requires that the host refuses, each once, as written. */
50
53
  export function forbiddenImportsIn(source: string): string[] {
@@ -65,8 +65,12 @@ export interface TestContextOptions {
65
65
  readonly console?: TestConsoleOptions;
66
66
  readonly sql?: PluginSql;
67
67
  readonly fetch?: (url: string, init?: PluginFetchInit) => Promise<PluginFetchResponse>;
68
- /** The secrets by name; `sign` and `verify` use them, and never hand them over. */
69
- readonly secrets?: Readonly<Record<string, string>>;
68
+ /**
69
+ * The secrets by name; `sign` and `verify` use them, and never hand them over. A keyed secret
70
+ * (ADR-0111) is given its values by key; one given a single value stands as a keyed secret kept
71
+ * from before it was keyed, which `move` puts under a key.
72
+ */
73
+ readonly secrets?: Readonly<Record<string, string | Readonly<Record<string, string>>>>;
70
74
  readonly plugins?: Readonly<Record<string, TestOtherPlugin>>;
71
75
  /** The console's public origin, from which `ctx.endpoints.url` is answered; left out, it is `plugin.unavailable`. */
72
76
  readonly publicUrl?: string;
@@ -579,7 +583,41 @@ function build(store: Store, options: TestContextOptions, caller: PluginCaller):
579
583
  grants: [],
580
584
  ...options.plugin,
581
585
  };
582
- const secrets = options.secrets ?? {};
586
+ // A copy, so that `forget` and `move` change what the context answers and nothing of the test's.
587
+ const secrets = new Map<string, string | Map<string, string>>(
588
+ Object.entries(options.secrets ?? {}).map(([name, value]) => [
589
+ name,
590
+ typeof value === "string" ? value : new Map(Object.entries(value)),
591
+ ]),
592
+ );
593
+ const secretValue = (name: string, key: string | undefined): string | undefined => {
594
+ const held = secrets.get(name);
595
+ return typeof held === "string"
596
+ ? key === undefined
597
+ ? held
598
+ : undefined
599
+ : key === undefined
600
+ ? undefined
601
+ : held?.get(key);
602
+ };
603
+ const secretStatus = (name: string, key: string | undefined) => {
604
+ const set = secretValue(name, key) !== undefined;
605
+ return {
606
+ set,
607
+ setAt: set ? now().toISOString() : null,
608
+ expiresAt: null,
609
+ source: set ? "administrator" : null,
610
+ };
611
+ };
612
+ const signingSecret = (name: string): string | undefined => {
613
+ if (secrets.get(name) instanceof Map) {
614
+ throw new PluginRefusal(
615
+ "plugin.forbidden",
616
+ `the secret ${name} is kept per key and signs nothing`,
617
+ );
618
+ }
619
+ return secretValue(name, undefined);
620
+ };
583
621
  const records = ((collection: CollectionDefinition | string) => {
584
622
  const name = typeof collection === "string" ? collection : collection.name;
585
623
  const definition = typeof collection === "string" ? collections.get(collection) : collection;
@@ -606,22 +644,35 @@ function build(store: Store, options: TestContextOptions, caller: PluginCaller):
606
644
  },
607
645
  fetch: options.fetch ?? (async () => forbidden("fetch", "fetch")),
608
646
  secrets: {
609
- has: async (name) => name in secrets,
610
- status: async (name) => ({
611
- set: name in secrets,
612
- setAt: name in secrets ? now().toISOString() : null,
613
- expiresAt: null,
614
- source: name in secrets ? "administrator" : null,
615
- }),
647
+ has: async (name, key) => secretValue(name, key) !== undefined,
648
+ status: async (name, key) => secretStatus(name, key),
649
+ keys: async (name) => {
650
+ const held = secrets.get(name);
651
+ return held instanceof Map
652
+ ? [...held.keys()].sort().map((key) => ({ key, ...secretStatus(name, key) }))
653
+ : [];
654
+ },
655
+ forget: async (name, key) => {
656
+ const held = secrets.get(name);
657
+ return held instanceof Map && held.delete(key);
658
+ },
659
+ move: async (name, key) => {
660
+ const held = secrets.get(name);
661
+ if (typeof held !== "string") {
662
+ return false;
663
+ }
664
+ secrets.set(name, new Map([[key, held]]));
665
+ return true;
666
+ },
616
667
  sign: async (name, payload) => {
617
- const secret = secrets[name];
668
+ const secret = signingSecret(name);
618
669
  if (secret === undefined) {
619
670
  throw new PluginRefusal("plugin.forbidden", `the secret ${name} is not set`);
620
671
  }
621
672
  return hmacSha256(secret, payload);
622
673
  },
623
674
  verify: async (name, payload, signature) => {
624
- const secret = secrets[name];
675
+ const secret = signingSecret(name);
625
676
  return (
626
677
  secret !== undefined && (await hmacSha256(secret, payload)) === signature.toLowerCase()
627
678
  );
package/src/plugin/web.ts CHANGED
@@ -67,7 +67,10 @@ export interface FrameDocument {
67
67
  readonly style: { setProperty(name: string, value: string): void };
68
68
  lang: string;
69
69
  };
70
- readonly body: { readonly scrollHeight: number } | null;
70
+ readonly body: {
71
+ readonly scrollHeight: number;
72
+ getBoundingClientRect?(): { readonly height: number };
73
+ } | null;
71
74
  title: string;
72
75
  }
73
76
 
@@ -203,7 +206,11 @@ function startHeightWatch(document: FrameDocument, post: (height: number) => voi
203
206
  }
204
207
  let last = -1;
205
208
  const say = () => {
206
- const height = Math.ceil(body.scrollHeight);
209
+ // The body as drawn, its fraction of a pixel rounded up: scrollHeight is rounded to the
210
+ // nearest pixel, and a frame a fraction shorter than its page leaves its document that
211
+ // fraction to scroll. scrollHeight still counts what reaches past the body.
212
+ const drawn = body.getBoundingClientRect?.().height ?? 0;
213
+ const height = Math.ceil(Math.max(body.scrollHeight, drawn));
207
214
  if (height !== last) {
208
215
  last = height;
209
216
  post(height);
package/src/plugin.ts CHANGED
@@ -76,6 +76,7 @@ export {
76
76
  capabilitiesAsked,
77
77
  isCalendarDay,
78
78
  isPluginKey,
79
+ isPluginSecretKey,
79
80
  type Localized,
80
81
  legacyWidgetSize,
81
82
  localizedText,
@@ -85,6 +86,7 @@ export {
85
86
  PLUGIN_KEY_PATTERN,
86
87
  PLUGIN_MENU_GROUPS,
87
88
  PLUGIN_PAGE_LEVELS,
89
+ PLUGIN_SECRET_KEY_PATTERN,
88
90
  PLUGIN_SETTING_TYPES,
89
91
  PLUGIN_WIDGET_PLACES,
90
92
  PLUGIN_WIDGET_SIZE_CELLS,