@skillcdn/console 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/README.md +19 -2
  2. package/SKILLCDN.md +7 -5
  3. package/dist/api.d.ts +5 -4
  4. package/dist/api.d.ts.map +1 -1
  5. package/dist/api.js +5 -4
  6. package/dist/api.js.map +1 -1
  7. package/dist/cli/cli.d.ts.map +1 -1
  8. package/dist/cli/cli.js +569 -48
  9. package/dist/cli/cli.js.map +1 -1
  10. package/dist/cli/format.d.ts +34 -3
  11. package/dist/cli/format.d.ts.map +1 -1
  12. package/dist/cli/format.js +283 -7
  13. package/dist/cli/format.js.map +1 -1
  14. package/dist/cli/help.d.ts.map +1 -1
  15. package/dist/cli/help.js +44 -7
  16. package/dist/cli/help.js.map +1 -1
  17. package/dist/cli/plugin-check.d.ts +26 -0
  18. package/dist/cli/plugin-check.d.ts.map +1 -0
  19. package/dist/cli/plugin-check.js +396 -0
  20. package/dist/cli/plugin-check.js.map +1 -0
  21. package/dist/cli/plugin-cli.d.ts +20 -0
  22. package/dist/cli/plugin-cli.d.ts.map +1 -0
  23. package/dist/cli/plugin-cli.js +189 -0
  24. package/dist/cli/plugin-cli.js.map +1 -0
  25. package/dist/cli/plugin-init.d.ts +37 -0
  26. package/dist/cli/plugin-init.d.ts.map +1 -0
  27. package/dist/cli/plugin-init.js +206 -0
  28. package/dist/cli/plugin-init.js.map +1 -0
  29. package/dist/cli/plugin-main.d.ts +3 -0
  30. package/dist/cli/plugin-main.d.ts.map +1 -0
  31. package/dist/cli/plugin-main.js +28 -0
  32. package/dist/cli/plugin-main.js.map +1 -0
  33. package/dist/client.d.ts +100 -3
  34. package/dist/client.d.ts.map +1 -1
  35. package/dist/client.js +79 -7
  36. package/dist/client.js.map +1 -1
  37. package/dist/compat.d.ts +1 -1
  38. package/dist/compat.js +2 -2
  39. package/dist/components/board.d.ts +8 -0
  40. package/dist/components/board.d.ts.map +1 -1
  41. package/dist/components/board.js +59 -15
  42. package/dist/components/board.js.map +1 -1
  43. package/dist/components/comments.d.ts.map +1 -1
  44. package/dist/components/comments.js +1 -1
  45. package/dist/components/comments.js.map +1 -1
  46. package/dist/components/decision-form.d.ts +2 -1
  47. package/dist/components/decision-form.d.ts.map +1 -1
  48. package/dist/components/decision-form.js +36 -4
  49. package/dist/components/decision-form.js.map +1 -1
  50. package/dist/components/decision-list.d.ts +4 -0
  51. package/dist/components/decision-list.d.ts.map +1 -1
  52. package/dist/components/decision-list.js +29 -3
  53. package/dist/components/decision-list.js.map +1 -1
  54. package/dist/components/event-feed.d.ts +1 -1
  55. package/dist/components/event-feed.d.ts.map +1 -1
  56. package/dist/components/event-feed.js +33 -1
  57. package/dist/components/event-feed.js.map +1 -1
  58. package/dist/components/my-decisions.d.ts +2 -0
  59. package/dist/components/my-decisions.d.ts.map +1 -1
  60. package/dist/components/my-decisions.js +2 -2
  61. package/dist/components/my-decisions.js.map +1 -1
  62. package/dist/components/plugin-frame.d.ts +52 -0
  63. package/dist/components/plugin-frame.d.ts.map +1 -0
  64. package/dist/components/plugin-frame.js +314 -0
  65. package/dist/components/plugin-frame.js.map +1 -0
  66. package/dist/components/plugin-settings.d.ts +38 -0
  67. package/dist/components/plugin-settings.d.ts.map +1 -0
  68. package/dist/components/plugin-settings.js +348 -0
  69. package/dist/components/plugin-settings.js.map +1 -0
  70. package/dist/components/shell.d.ts +2 -0
  71. package/dist/components/shell.d.ts.map +1 -1
  72. package/dist/components/shell.js +26 -1
  73. package/dist/components/shell.js.map +1 -1
  74. package/dist/components/task-view.d.ts +2 -1
  75. package/dist/components/task-view.d.ts.map +1 -1
  76. package/dist/components/task-view.js.map +1 -1
  77. package/dist/components/workspace.d.ts +7 -1
  78. package/dist/components/workspace.d.ts.map +1 -1
  79. package/dist/components/workspace.js +1 -1
  80. package/dist/components/workspace.js.map +1 -1
  81. package/dist/console.css +330 -1
  82. package/dist/console.d.ts.map +1 -1
  83. package/dist/console.js +152 -41
  84. package/dist/console.js.map +1 -1
  85. package/dist/data.d.ts +9 -2
  86. package/dist/data.d.ts.map +1 -1
  87. package/dist/data.js +45 -9
  88. package/dist/data.js.map +1 -1
  89. package/dist/i18n/en.d.ts +155 -0
  90. package/dist/i18n/en.d.ts.map +1 -1
  91. package/dist/i18n/en.js +166 -0
  92. package/dist/i18n/en.js.map +1 -1
  93. package/dist/i18n/ko.d.ts.map +1 -1
  94. package/dist/i18n/ko.js +150 -0
  95. package/dist/i18n/ko.js.map +1 -1
  96. package/dist/index.d.ts +3 -1
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +3 -1
  99. package/dist/index.js.map +1 -1
  100. package/dist/limits.d.ts +2 -0
  101. package/dist/limits.d.ts.map +1 -1
  102. package/dist/limits.js +2 -0
  103. package/dist/limits.js.map +1 -1
  104. package/dist/plugin/args.d.ts +148 -0
  105. package/dist/plugin/args.d.ts.map +1 -0
  106. package/dist/plugin/args.js +369 -0
  107. package/dist/plugin/args.js.map +1 -0
  108. package/dist/plugin/bridge.d.ts +146 -0
  109. package/dist/plugin/bridge.d.ts.map +1 -0
  110. package/dist/plugin/bridge.js +125 -0
  111. package/dist/plugin/bridge.js.map +1 -0
  112. package/dist/plugin/capabilities.d.ts +20 -0
  113. package/dist/plugin/capabilities.d.ts.map +1 -0
  114. package/dist/plugin/capabilities.js +133 -0
  115. package/dist/plugin/capabilities.js.map +1 -0
  116. package/dist/plugin/context.d.ts +380 -0
  117. package/dist/plugin/context.d.ts.map +1 -0
  118. package/dist/plugin/context.js +2 -0
  119. package/dist/plugin/context.js.map +1 -0
  120. package/dist/plugin/define.d.ts +208 -0
  121. package/dist/plugin/define.d.ts.map +1 -0
  122. package/dist/plugin/define.js +482 -0
  123. package/dist/plugin/define.js.map +1 -0
  124. package/dist/plugin/definition-error.d.ts +11 -0
  125. package/dist/plugin/definition-error.d.ts.map +1 -0
  126. package/dist/plugin/definition-error.js +17 -0
  127. package/dist/plugin/definition-error.js.map +1 -0
  128. package/dist/plugin/limits.d.ts +67 -0
  129. package/dist/plugin/limits.d.ts.map +1 -0
  130. package/dist/plugin/limits.js +70 -0
  131. package/dist/plugin/limits.js.map +1 -0
  132. package/dist/plugin/load-worker.d.ts +7 -0
  133. package/dist/plugin/load-worker.d.ts.map +1 -0
  134. package/dist/plugin/load-worker.js +41 -0
  135. package/dist/plugin/load-worker.js.map +1 -0
  136. package/dist/plugin/load.d.ts +18 -0
  137. package/dist/plugin/load.d.ts.map +1 -0
  138. package/dist/plugin/load.js +62 -0
  139. package/dist/plugin/load.js.map +1 -0
  140. package/dist/plugin/manifest.d.ts +237 -0
  141. package/dist/plugin/manifest.d.ts.map +1 -0
  142. package/dist/plugin/manifest.js +411 -0
  143. package/dist/plugin/manifest.js.map +1 -0
  144. package/dist/plugin/refusals.d.ts +49 -0
  145. package/dist/plugin/refusals.d.ts.map +1 -0
  146. package/dist/plugin/refusals.js +79 -0
  147. package/dist/plugin/refusals.js.map +1 -0
  148. package/dist/plugin/rest-schemas.d.ts +556 -0
  149. package/dist/plugin/rest-schemas.d.ts.map +1 -0
  150. package/dist/plugin/rest-schemas.js +262 -0
  151. package/dist/plugin/rest-schemas.js.map +1 -0
  152. package/dist/plugin/sandbox.d.ts +23 -0
  153. package/dist/plugin/sandbox.d.ts.map +1 -0
  154. package/dist/plugin/sandbox.js +99 -0
  155. package/dist/plugin/sandbox.js.map +1 -0
  156. package/dist/plugin/testing.d.ts +45 -0
  157. package/dist/plugin/testing.d.ts.map +1 -0
  158. package/dist/plugin/testing.js +420 -0
  159. package/dist/plugin/testing.js.map +1 -0
  160. package/dist/plugin/web-react.d.ts +11 -0
  161. package/dist/plugin/web-react.d.ts.map +1 -0
  162. package/dist/plugin/web-react.js +34 -0
  163. package/dist/plugin/web-react.js.map +1 -0
  164. package/dist/plugin/web.d.ts +95 -0
  165. package/dist/plugin/web.d.ts.map +1 -0
  166. package/dist/plugin/web.js +245 -0
  167. package/dist/plugin/web.js.map +1 -0
  168. package/dist/plugin-nav.d.ts +29 -0
  169. package/dist/plugin-nav.d.ts.map +1 -0
  170. package/dist/plugin-nav.js +92 -0
  171. package/dist/plugin-nav.js.map +1 -0
  172. package/dist/plugin-testing.d.ts +2 -0
  173. package/dist/plugin-testing.d.ts.map +1 -0
  174. package/dist/plugin-testing.js +4 -0
  175. package/dist/plugin-testing.js.map +1 -0
  176. package/dist/plugin-web-react.d.ts +3 -0
  177. package/dist/plugin-web-react.d.ts.map +1 -0
  178. package/dist/plugin-web-react.js +3 -0
  179. package/dist/plugin-web-react.js.map +1 -0
  180. package/dist/plugin-web.d.ts +4 -0
  181. package/dist/plugin-web.d.ts.map +1 -0
  182. package/dist/plugin-web.js +5 -0
  183. package/dist/plugin-web.js.map +1 -0
  184. package/dist/plugin.d.ts +11 -0
  185. package/dist/plugin.d.ts.map +1 -0
  186. package/dist/plugin.js +15 -0
  187. package/dist/plugin.js.map +1 -0
  188. package/dist/router.d.ts +28 -0
  189. package/dist/router.d.ts.map +1 -1
  190. package/dist/router.js +47 -0
  191. package/dist/router.js.map +1 -1
  192. package/dist/routes.d.ts +4 -0
  193. package/dist/routes.d.ts.map +1 -1
  194. package/dist/routes.js +6 -0
  195. package/dist/routes.js.map +1 -1
  196. package/dist/schemas.d.ts +194 -9
  197. package/dist/schemas.d.ts.map +1 -1
  198. package/dist/schemas.js +98 -17
  199. package/dist/schemas.js.map +1 -1
  200. package/dist/tokens.d.ts +2 -0
  201. package/dist/tokens.d.ts.map +1 -0
  202. package/dist/tokens.js +101 -0
  203. package/dist/tokens.js.map +1 -0
  204. package/dist/vocabulary.d.ts +11 -1
  205. package/dist/vocabulary.d.ts.map +1 -1
  206. package/dist/vocabulary.js +24 -0
  207. package/dist/vocabulary.js.map +1 -1
  208. package/dist/web.d.ts.map +1 -1
  209. package/dist/web.js +2 -0
  210. package/dist/web.js.map +1 -1
  211. package/docs/specs/cli.md +12 -5
  212. package/docs/specs/plugins.md +488 -0
  213. package/docs/specs/rest.md +11 -9
  214. package/package.json +26 -8
  215. package/skills/building-a-console/SKILL.md +25 -26
  216. package/skills/building-a-console/references/configuring.md +40 -0
  217. package/skills/building-a-console/references/the-default-console.md +1 -1
  218. package/skills/building-a-console/references/the-look-from-a-website.md +5 -5
  219. package/skills/building-a-plugin/SKILL.md +137 -0
  220. package/skills/deploying-a-console/SKILL.md +24 -26
  221. package/skills/deploying-a-console/references/access.md +13 -9
  222. package/skills/deploying-a-console/references/resources.md +25 -10
  223. package/skills/deploying-a-console/references/running-it-again.md +15 -0
  224. package/skills/deploying-a-console/references/sizing.md +2 -0
  225. package/skills/planning-the-board/SKILL.md +96 -0
  226. package/skills/planning-the-board/references/a-task.md +36 -0
  227. package/skills/planning-the-board/references/setting-up.md +44 -0
  228. package/skills/working-the-board/SKILL.md +43 -34
  229. package/skills/working-the-board/references/the-pack.md +19 -0
  230. package/src/api.ts +12 -0
  231. package/src/cli/cli.ts +737 -55
  232. package/src/cli/format.ts +368 -10
  233. package/src/cli/help.ts +50 -6
  234. package/src/cli/plugin-check.ts +497 -0
  235. package/src/cli/plugin-cli.ts +237 -0
  236. package/src/cli/plugin-init.ts +257 -0
  237. package/src/cli/plugin-main.ts +30 -0
  238. package/src/client.ts +322 -9
  239. package/src/compat.ts +2 -2
  240. package/src/components/board.tsx +62 -14
  241. package/src/components/comments.tsx +1 -0
  242. package/src/components/decision-form.tsx +92 -11
  243. package/src/components/decision-list.tsx +71 -2
  244. package/src/components/event-feed.tsx +42 -1
  245. package/src/components/my-decisions.tsx +4 -1
  246. package/src/components/plugin-frame.tsx +437 -0
  247. package/src/components/plugin-settings.tsx +1111 -0
  248. package/src/components/shell.tsx +82 -14
  249. package/src/components/task-view.tsx +2 -1
  250. package/src/components/workspace.tsx +18 -0
  251. package/src/console.tsx +304 -31
  252. package/src/data.ts +59 -11
  253. package/src/i18n/en.ts +175 -0
  254. package/src/i18n/ko.ts +155 -0
  255. package/src/index.ts +12 -0
  256. package/src/limits.ts +2 -0
  257. package/src/plugin/args.ts +526 -0
  258. package/src/plugin/bridge.ts +314 -0
  259. package/src/plugin/capabilities.ts +150 -0
  260. package/src/plugin/context.ts +421 -0
  261. package/src/plugin/define.ts +792 -0
  262. package/src/plugin/definition-error.ts +19 -0
  263. package/src/plugin/limits.ts +70 -0
  264. package/src/plugin/load-worker.ts +50 -0
  265. package/src/plugin/load.ts +82 -0
  266. package/src/plugin/manifest.ts +561 -0
  267. package/src/plugin/refusals.ts +94 -0
  268. package/src/plugin/rest-schemas.ts +354 -0
  269. package/src/plugin/sandbox.ts +123 -0
  270. package/src/plugin/testing.ts +612 -0
  271. package/src/plugin/web-react.ts +45 -0
  272. package/src/plugin/web.ts +403 -0
  273. package/src/plugin-nav.ts +132 -0
  274. package/src/plugin-testing.ts +10 -0
  275. package/src/plugin-web-react.ts +4 -0
  276. package/src/plugin-web.ts +35 -0
  277. package/src/plugin.ts +126 -0
  278. package/src/router.ts +73 -0
  279. package/src/routes.ts +7 -0
  280. package/src/schemas.ts +115 -18
  281. package/src/styles/console.css +330 -1
  282. package/src/tokens.ts +101 -0
  283. package/src/vocabulary.ts +30 -0
  284. package/src/web.ts +2 -0
  285. package/template/plugin/.gitignore +2 -0
  286. package/template/plugin/README.md +26 -0
  287. package/template/plugin/SKILLCDN.md +13 -0
  288. package/template/plugin/build.mjs +40 -0
  289. package/template/plugin/console-plugin.json +50 -0
  290. package/template/plugin/package.json +27 -0
  291. package/template/plugin/skills/__key__/SKILL.md +23 -0
  292. package/template/plugin/src/check.test.ts +34 -0
  293. package/template/plugin/src/server/index.test.ts +41 -0
  294. package/template/plugin/src/server/index.ts +72 -0
  295. package/template/plugin/src/web/index.css +51 -0
  296. package/template/plugin/src/web/index.ts +115 -0
  297. package/template/plugin/tsconfig.json +17 -0
  298. package/skills/working-the-board/references/setting-up.md +0 -3
  299. /package/skills/{working-the-board → planning-the-board}/references/project-rules.md +0 -0
package/dist/cli/help.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DEFAULT_PAGE_LIMIT, MAX_AGENT_LENGTH, MAX_ARTIFACTS_PER_RUN, MAX_BODY_LENGTH, MAX_CATEGORIES, MAX_CATEGORY_KEY_LENGTH, MAX_CATEGORY_NAME_LENGTH, MAX_COMMENTS_PER_TASK, MAX_DECISIONS_PER_PROJECT, MAX_DOCUMENT_LENGTH, MAX_DOCUMENT_PATH_LENGTH, MAX_DOCUMENTS_PER_PROJECT, MAX_FILE_BYTES, MAX_FILES_PER_COMMENT, MAX_FILES_PER_DOCUMENT, MAX_GOALS_PER_PROJECT, MAX_LINK_LABEL_LENGTH, MAX_NOTE_LENGTH, MAX_OPTION_LABEL_LENGTH, MAX_OPTIONS, MAX_PROJECT_DESCRIPTION_LENGTH, MAX_PROJECT_ICON_BYTES, MAX_PROJECT_KEY_LENGTH, MAX_PROJECT_NAME_LENGTH, MAX_PROJECT_SYMBOL_LENGTH, MAX_PROJECTS_PER_WORKSPACE, MAX_QUESTION_LENGTH, MAX_REPORTS_PER_RUN, MAX_RULES_LENGTH, MAX_RUNS_PER_TASK, MAX_SEARCH_LENGTH, MAX_SUMMARY_LENGTH, MAX_TASKS_PER_PROJECT, MAX_TITLE_LENGTH, MAX_VERSIONS_PER_DOCUMENT, MAX_WORKERS, MIN_OPTIONS, } from "../limits.js";
1
+ import { DEFAULT_PAGE_LIMIT, MAX_AGENT_LENGTH, MAX_ARTIFACTS_PER_RUN, MAX_BODY_LENGTH, MAX_CATEGORIES, MAX_CATEGORY_KEY_LENGTH, MAX_CATEGORY_NAME_LENGTH, MAX_COMMENTS_PER_TASK, MAX_DECISIONS_PER_PROJECT, MAX_DOCUMENT_LENGTH, MAX_DOCUMENT_PATH_LENGTH, MAX_DOCUMENTS_PER_PROJECT, MAX_FILE_BYTES, MAX_FILES_PER_COMMENT, MAX_FILES_PER_DECISION, MAX_FILES_PER_DOCUMENT, MAX_GOALS_PER_PROJECT, MAX_LINK_LABEL_LENGTH, MAX_NOTE_LENGTH, MAX_OPTION_LABEL_LENGTH, MAX_OPTIONS, MAX_PROJECT_DESCRIPTION_LENGTH, MAX_PROJECT_ICON_BYTES, MAX_PROJECT_KEY_LENGTH, MAX_PROJECT_NAME_LENGTH, MAX_PROJECT_SYMBOL_LENGTH, MAX_PROJECTS_PER_WORKSPACE, MAX_QUESTION_LENGTH, MAX_REPORTS_PER_RUN, MAX_RULES_LENGTH, MAX_RUNS_PER_TASK, MAX_SEARCH_LENGTH, MAX_SUMMARY_LENGTH, MAX_TASKS_PER_PROJECT, MAX_TITLE_LENGTH, MAX_VERSIONS_PER_DOCUMENT, MAX_WORKERS, MIN_OPTIONS, } from "../limits.js";
2
2
  import { COLOR_NAMES } from "../vocabulary.js";
3
3
  /** The refusals any command may meet, said once in the overview. */
4
4
  const COMMON_REFUSALS = [
@@ -245,7 +245,7 @@ export const COMMAND_HELP = {
245
245
  rules: {
246
246
  usage: "rules | rules write --body <markdown>|--file <path>|-|none [--workspace] [--base <version>]",
247
247
  synopsis: "What this organization and this project ask of agents; rules write writes them, for an owner or an administrator.",
248
- about: "What this organization asks of agents (ADR-0023): the workspace's rules, the console's own until an administrator writes the organization's, and this project's own when it has them. rules write writes this project's rules, for an owner, or with --workspace the workspace's, for an administrator; none puts the written rules away, so that the console's own hold again, or the project adds none. Without a project named, rules shows the workspace's alone.",
248
+ about: "What this organization asks of agents (ADR-0023): the workspace's rules, the console's own until an administrator writes the organization's, and this project's own when it has them. rules write writes this project's rules, for an owner, or with --workspace the workspace's, for an administrator; none puts the written rules away, so that the console's own hold again, or the project adds none. Without a project named, rules shows the workspace's alone. After the rules, a section Plugins names the plugins bound to the project that you hold a role in, or at the workspace every plugin you may use, a line each with the sentence its manifest gives agents and where to start: console plugin <key>.",
249
249
  limits: [
250
250
  `body: Markdown, up to ${MAX_RULES_LENGTH} characters; the console's own rules, written as they are, write nothing`,
251
251
  ],
@@ -254,10 +254,39 @@ export const COMMAND_HELP = {
254
254
  "document.conflict: the rules have moved on since --base; read them again",
255
255
  ],
256
256
  },
257
+ plugins: {
258
+ usage: "plugins",
259
+ synopsis: "The plugins of this console you may use: key, name, version, state, your roles.",
260
+ about: "The plugins of this console (docs/specs/plugins.md), one a line: the enabled ones a member may use, every one with its state for an administrator; the key, the name, the version, the state, the roles you hold in it. A plugin is worked through console plugin <key>, and the rules of a board name the plugins to use there under Plugins, a sentence each. Needs no project.",
261
+ },
262
+ plugin: {
263
+ usage: "plugin <key> | plugin <key> help [<command>] | plugin <key> <command> [<args>] [--<name> <value>]... [--file <path> | -] [--run <id>] | plugin <key> records <collection> [<id>] [--where <field>=<value>]... [--search <words>] [--project <key>] [--order <field>[:desc]] [--limit <n>] [--after <cursor>] [--archived] [--versions] | plugin <key> skills [<folder>|<file>] [--search <words> [--limit <n>] [--cursor <cursor>]] | plugin <key> skill <path> | plugin <key> skill --file <path> [--offset <n>] [--limit <n>] | plugin <key> enable --consent <capability>,... [--board new|<key>] [--projects all|<key>,...] [--set <key>=<value>]... | plugin <key> disable | plugin <key> settings [--set <key>=<value>]... | plugin <key> secret <name> [--remove] | plugin <key> grant <role> --person <login>|--project <key>|--everyone | plugin <key> revoke <grant id>",
264
+ overview: "plugin <key> [help [<command>] | <command> [<args>] | records <collection> | skills | skill <path> | enable | disable | settings | secret | grant | revoke]",
265
+ synopsis: "One plugin: what it is for and its commands; a command run as you; its records, its skills; its settings, for an administrator.",
266
+ about: "One plugin of this console, by its key. Alone: what it is, the sentence for agents, its state, the roles you hold in it, its board project, then one line per command and query you may run, with its usage, where its skills are, and its settings. help [<command>]: one command or query in full, as console help prints one: its arguments, their types and bounds, and the refusals; every argument is given by its place when positional, else as --<name> <value> or --<name>=<value>; a boolean as --<name> alone; a list as the flag given again, or with commas between; a day as YYYY-MM-DD; a person by login, or me; a project by key; a file by --file <path>, or - for standard input, which the command uploads first, with the plugin's files capability. <command> [<args>]: runs the command or the query as the person whose token you hold; the console parses the words against the definition and refuses the first that does not fit; prints what the command says, or a query's answer as JSON, a file a query answers saved under its name; --json prints the whole answer. A command that raised a decision prints its id and exits with 3: console decision <id> --wait 100 waits for the answer. The event the command leaves names your open run in the plugin's board project, --run <id> saying which when several are open; an argument marked secret is hidden in it. records <collection>: the records you may read, one a line, newest first; --where <field>=<value>, given again for several, narrows by a field the collection indexes (id, owner and project always; a number, true, false and null are read as such); --search <words> by words; --project <key> to those linked to a project; --order <field>, with :desc for the newest first; a page of --limit with --after <cursor> as the last page printed; --archived the ones put away; <id> reads one record whole, --versions its versions. skills and skill: the plugin's own skills, a pack read from its package, exactly as console skills and console skill read a project's pack. enable, disable, settings, secret, grant and revoke are an administrator's. enable prints what each capability the plugin asks opens and what a malicious plugin would reach through it, and refuses unless --consent names every capability again; --board new makes the board project the manifest proposes, --board <key> chooses one, left out where the plugin needs none; --projects all, or the keys of the projects the plugin is on; --set a setting's value, which settings changes afterwards too, an empty value clearing one, a number or true and false read as such. secret <name> reads the value from standard input, seals it and shows it never; --remove takes it away. grant gives a role to a person by login, to the members of a project by key, or to everyone, and revoke takes a grant back by its id, which console plugin <key> lists to an administrator.",
267
+ limits: [
268
+ "a command line: up to 200 words of up to 50,000 characters each; one file, up to the file bound (console help hand-in), with the plugin's files capability",
269
+ "records: a page of up to 200; where: a field the collection indexes",
270
+ "enable: consent names every capability the manifest asks; settings and secrets as the manifest bounds them",
271
+ ],
272
+ refusals: [
273
+ "plugin.not_found: no plugin has that key, or you may not know of it; or the plugin has no such command or query",
274
+ "plugin.disabled: the plugin is installed and not enabled",
275
+ "plugin.unavailable: the plugin failed to load, its host is away, or this deployment lacks what it needs",
276
+ "plugin.forbidden: the command, the record or the file needs a role you do not hold in the plugin, or the plugin lacks the capability",
277
+ "plugin.invalid_args: a word does not fit the definition; the message names the first at fault",
278
+ "plugin.timeout: the plugin's code ran past its time",
279
+ "plugin.too_many: a quota of the plugin is reached",
280
+ "plugin.needs_consent, plugin.requires, plugin.required_by: enabling without consent to every capability; a plugin this one requires is not enabled or not in range; another enabled plugin requires this one",
281
+ "plugin.failed: the plugin's code failed; the console's log says what it said, the answer does not",
282
+ "plugin.<key>.<code>: the plugin's own refusal, in its own words",
283
+ "auth.forbidden: enable, disable, settings, secret, grant and revoke are an administrator's",
284
+ ],
285
+ },
257
286
  take: {
258
287
  usage: "take <number|id> [--agent <name>]",
259
288
  synopsis: "Takes a task: a run begins, and the task is in progress and the person's.",
260
- about: "Takes a task: a run begins, and the task is in progress and the person's; the run's id and the task's id are printed on a line of their own, then the task, then the rules of the board. A run still open on the task is taken over, since the board cannot know whether its agent still runs: it ends as abandoned, the feed says who took over, and that agent is refused on its next command; console task <number> shows the runs on a task, with when each was last heard from, before it is taken. --agent is what people see at work; left out, it is what the person called the token.",
289
+ about: "Takes a task: a run begins, and the task is in progress and the person's; the run's id and the task's id are printed on a line of their own, then the task, then the rules of the board, with a section Plugins after them where plugins are bound to the project: a line per plugin you may use there, which console plugin <key> then says how to use. A run still open on the task is taken over, since the board cannot know whether its agent still runs: it ends as abandoned, the feed says who took over, and that agent is refused on its next command; console task <number> shows the runs on a task, with when each was last heard from, before it is taken. --agent is what people see at work; left out, it is what the person called the token.",
261
290
  limits: [
262
291
  `agent: one line, up to ${MAX_AGENT_LENGTH} characters`,
263
292
  `at most ${MAX_RUNS_PER_TASK} runs on one task`,
@@ -298,14 +327,16 @@ export const COMMAND_HELP = {
298
327
  ],
299
328
  },
300
329
  ask: {
301
- usage: 'ask "<question>" --option "<label>" --option "<label>" [...] [--body <markdown>|--file <path>] [--to <login|me>] [--wait <seconds>] [--run <id>]',
302
- overview: 'ask "<question>" --option "<label>" --option "<label>" [...] [--body <markdown>|--file <path>] [--to <login|me>] [--wait <seconds>]',
330
+ usage: 'ask "<question>" --option "<label>" --option "<label>" [...] [--body <markdown>|--file <path>] [--attach <path>]... [--to <login|me>] [--wait <seconds>] [--run <id>]',
331
+ overview: 'ask "<question>" --option "<label>" --option "<label>" [...] [--body <markdown>|--file <path>] [--attach <path>]... [--to <login|me>] [--wait <seconds>]',
303
332
  synopsis: "Raises a decision a person must make, with options, and waits a while for the answer.",
304
- about: `Raises a decision a person must make: the question, the options to choose from, and what they need to know. It is for the person you work for unless --to names another of the project, who then finds it among their decisions (ADR-0042); anyone of the project may still answer. The run waits for the answer. The command waits 60 seconds for it unless --wait says otherwise, and exits with 3 if it is still to come: keep waiting with \`console decision <id> --wait 100\`, within what your shell gives one command. The decision's id is printed as soon as it is raised. The person chooses one of the options, or answers in their own words: the answer then names one more option, their words, marked own; act on it as given. ${ON_THE_RUN}`,
333
+ about: `Raises a decision a person must make: the question, the options to choose from, and what they need to know. --attach puts a file on the decision, in the one request: a picture of what is to be chosen between, a screenshot of what was made; a picture the body names as ![words](its name) is shown there, the rest after the body, and the person reads each back with \`console file <id>\` (ADR-0055). It is for the person you work for unless --to names another of the project, who then finds it among their decisions (ADR-0042); anyone of the project may still answer. The run waits for the answer. The command waits 60 seconds for it unless --wait says otherwise, and exits with 3 if it is still to come: keep waiting with \`console decision <id> --wait 100\`, within what your shell gives one command. The decision's id is printed as soon as it is raised. The person chooses one of the options, or answers in their own words: the answer then names one more option, their words, marked own; act on it as given. ${ON_THE_RUN}`,
305
334
  limits: [
306
335
  `question: one line, up to ${MAX_QUESTION_LENGTH} characters`,
307
336
  `options: ${MIN_OPTIONS} to ${MAX_OPTIONS}, each one line up to ${MAX_OPTION_LABEL_LENGTH} characters`,
308
337
  `body: ${MARKDOWN}`,
338
+ `attach: a file: up to ${MAX_FILE_BYTES} bytes, not empty; called by its name, without the path; a picture is placed in the body as ![words](its name)`,
339
+ `at most ${MAX_FILES_PER_DECISION} files on one decision, together up to ${MAX_FILE_BYTES} bytes`,
309
340
  "to: a login of the project, or me",
310
341
  `at most ${MAX_DECISIONS_PER_PROJECT} decisions in one project`,
311
342
  ],
@@ -314,6 +345,8 @@ export const COMMAND_HELP = {
314
345
  "decision.invalid_run: the run is not yours, or is over",
315
346
  "decision.invalid_decider: the person named may not work in the project",
316
347
  "decision.too_many: the project holds as many decisions as one may",
348
+ "decision.too_many_files: more files than one decision carries",
349
+ "request.too_large: a file, or the files together, over the bound",
317
350
  ],
318
351
  },
319
352
  answer: {
@@ -397,7 +430,7 @@ export const COMMAND_HELP = {
397
430
  file: {
398
431
  usage: "file <id> [--out <path>]",
399
432
  synopsis: "Reads a file of the project to this machine, by its id.",
400
- about: "Reads a file of the project from the console and writes it on this machine: one a run handed in, one put in a comment, or one attached to a page, by the id the task, the run or the page shows. Written under its own name in the working directory, at --out <path>, or into --out <directory>. Then look at it with your own tools.",
433
+ about: "Reads a file of the project from the console and writes it on this machine: one a run handed in, one put in a comment or on a decision, or one attached to a page, by the id the task, the run, the decision or the page shows. Written under its own name in the working directory, at --out <path>, or into --out <directory>. Then look at it with your own tools.",
401
434
  refusals: ["file.not_found: no file of this project has that id"],
402
435
  },
403
436
  docs: {
@@ -528,6 +561,10 @@ const SECTIONS = [
528
561
  "rules",
529
562
  ],
530
563
  },
564
+ {
565
+ title: "The plugins of this console, if it has any: a feature added to the board, worked through one command",
566
+ commands: ["plugins", "plugin"],
567
+ },
531
568
  {
532
569
  title: "Working",
533
570
  commands: [
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,EACzB,WAAW,EACX,WAAW,GACZ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,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC;IACzE,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { ServerLoad } from "../plugin/load.js";
2
+ export interface CheckReport {
3
+ readonly ok: boolean;
4
+ readonly errors: readonly string[];
5
+ readonly warnings: readonly string[];
6
+ /** One line about what was found, when the package read at all. */
7
+ readonly summary: string | null;
8
+ }
9
+ /** SPDX identifiers under which a plugin may ship into an image: permissive only. */
10
+ export declare const PERMISSIVE_LICENSES: readonly string[];
11
+ /** `(MIT OR Apache-2.0)` is fine when one side is; `MIT AND X` only when both are. */
12
+ export declare function isPermissiveLicense(expression: string): boolean;
13
+ /** True when npm's `files` list ships the path: named, under a named directory, or matched by a simple glob. */
14
+ export declare function coveredByFiles(files: readonly string[], path: string): boolean;
15
+ /** The classes a stylesheet styles, each once; comments and quoted strings are not read. */
16
+ export declare function classesIn(css: string): string[];
17
+ /** What a web bundle reaches for that a frame has no business with, or imports from elsewhere. */
18
+ export declare function webBundleProblems(source: string): string[];
19
+ /**
20
+ * The words of the manifest, as JSON, whose translation repeats the English words (`name.ko`,
21
+ * for one): what `init --languages` copies for the author to translate, and what was left.
22
+ */
23
+ export declare function sameAsEnglish(value: unknown, at?: string): string[];
24
+ /** Reads the plugin at `root` as a console would, and says what it would refuse. */
25
+ export declare function checkPlugin(root: string, loadServer: (file: string) => Promise<ServerLoad>): Promise<CheckReport>;
26
+ //# sourceMappingURL=plugin-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-check.d.ts","sourceRoot":"","sources":["../../src/cli/plugin-check.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAUpD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,qFAAqF;AACrF,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAYhD,CAAC;AAEF,sFAAsF;AACtF,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAS/D;AAED,gHAAgH;AAChH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CA0B9E;AAKD,4FAA4F;AAC5F,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAS/C;AAMD,kGAAkG;AAClG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAkB1D;AAgMD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,SAAK,GAAG,MAAM,EAAE,CAe/D;AAED,oFAAoF;AACpF,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,GAChD,OAAO,CAAC,WAAW,CAAC,CAgKtB"}
@@ -0,0 +1,396 @@
1
+ // `console-plugin check` (docs/specs/plugins.md, "Authoring"): reads a plugin's package as the
2
+ // console would and names everything a console, or a store, would refuse it for: the manifest,
3
+ // the package's own manifest, the server module under the host's hardening and against the
4
+ // manifest, the web bundle's self-containment and its classes, the skills, the migrations.
5
+ import { readdir, readFile, stat } from "node:fs/promises";
6
+ import { join, posix } from "node:path";
7
+ import { descriptionProblems } from "../plugin/define.js";
8
+ import { CURRENT_PLUGIN_API, PLUGIN_API_MAJORS, parsePluginManifest, } from "../plugin/manifest.js";
9
+ import { forbiddenImportsIn, removedGlobalsIn } from "../plugin/sandbox.js";
10
+ import { isLanguageMap } from "./plugin-init.js";
11
+ /** SPDX identifiers under which a plugin may ship into an image: permissive only. */
12
+ export const PERMISSIVE_LICENSES = [
13
+ "MIT",
14
+ "MIT-0",
15
+ "ISC",
16
+ "0BSD",
17
+ "BSD-2-Clause",
18
+ "BSD-3-Clause",
19
+ "Apache-2.0",
20
+ "BlueOak-1.0.0",
21
+ "CC0-1.0",
22
+ "Unlicense",
23
+ "Zlib",
24
+ ];
25
+ /** `(MIT OR Apache-2.0)` is fine when one side is; `MIT AND X` only when both are. */
26
+ export function isPermissiveLicense(expression) {
27
+ const trimmed = expression.trim().replace(/^\(|\)$/g, "");
28
+ if (/\bOR\b/i.test(trimmed)) {
29
+ return trimmed.split(/\s+OR\s+/i).some(isPermissiveLicense);
30
+ }
31
+ if (/\bAND\b/i.test(trimmed)) {
32
+ return trimmed.split(/\s+AND\s+/i).every(isPermissiveLicense);
33
+ }
34
+ return PERMISSIVE_LICENSES.includes(trimmed);
35
+ }
36
+ /** True when npm's `files` list ships the path: named, under a named directory, or matched by a simple glob. */
37
+ export function coveredByFiles(files, path) {
38
+ const target = posix.normalize(path).replace(/^\.\//, "");
39
+ return files.some((entry) => {
40
+ const pattern = posix.normalize(entry).replace(/^\.\//, "").replace(/\/$/, "");
41
+ if (pattern.startsWith("!")) {
42
+ return false;
43
+ }
44
+ if (pattern === target || target.startsWith(`${pattern}/`)) {
45
+ return true;
46
+ }
47
+ if (!/[*?]/.test(pattern)) {
48
+ return false;
49
+ }
50
+ const regex = new RegExp(`^${pattern
51
+ .split("**")
52
+ .map((part) => part
53
+ .replace(/[.+^${}()|[\]\\]/g, "\\$&")
54
+ .replace(/\*/g, "[^/]*")
55
+ .replace(/\?/g, "[^/]"))
56
+ .join(".*")}(?:/.*)?$`);
57
+ return regex.test(target);
58
+ });
59
+ }
60
+ /** A class selector: a dot not after a digit or another dot (0.5em is a number), then a name. */
61
+ const CLASS_SELECTOR = /(?<![\d.])\.(-?[A-Za-z_][\w-]*)/g;
62
+ /** The classes a stylesheet styles, each once; comments and quoted strings are not read. */
63
+ export function classesIn(css) {
64
+ const withoutComments = css.replace(/\/\*[\s\S]*?\*\//g, "").replace(/"[^"]*"|'[^']*'/g, '""');
65
+ const found = new Set();
66
+ for (const match of withoutComments.matchAll(CLASS_SELECTOR)) {
67
+ if (match[1] !== undefined && !/^\d/.test(match[1])) {
68
+ found.add(match[1]);
69
+ }
70
+ }
71
+ return [...found];
72
+ }
73
+ const WEB_IMPORT = /(?:\bfrom\s*|\bimport\s*\(?\s*|\bexport\s+\*\s+from\s*)["'`]([^"'`]+)["'`]/g;
74
+ const WEB_FORBIDDEN = /\b(fetch|XMLHttpRequest|WebSocket|EventSource|importScripts|sendBeacon)\s*\(|document\.cookie|\bnavigator\.serviceWorker\b/g;
75
+ /** What a web bundle reaches for that a frame has no business with, or imports from elsewhere. */
76
+ export function webBundleProblems(source) {
77
+ const problems = new Set();
78
+ for (const match of source.matchAll(WEB_IMPORT)) {
79
+ const specifier = match[1] ?? "";
80
+ if (!specifier.startsWith("./") &&
81
+ !specifier.startsWith("../") &&
82
+ !specifier.startsWith("data:")) {
83
+ problems.add(`imports ${specifier} from elsewhere: a bundle is self-contained`);
84
+ }
85
+ }
86
+ for (const match of source.matchAll(WEB_FORBIDDEN)) {
87
+ problems.add(`uses ${match[1] ?? match[0]}: a frame speaks to the console through the bridge alone`);
88
+ }
89
+ return [...problems];
90
+ }
91
+ async function exists(path) {
92
+ try {
93
+ const found = await stat(path);
94
+ return found.isDirectory() ? "directory" : "file";
95
+ }
96
+ catch {
97
+ return null;
98
+ }
99
+ }
100
+ async function readJson(path) {
101
+ let text;
102
+ try {
103
+ text = await readFile(path, "utf8");
104
+ }
105
+ catch {
106
+ return { problem: `${posix.basename(path)} is missing` };
107
+ }
108
+ try {
109
+ return { value: JSON.parse(text) };
110
+ }
111
+ catch (error) {
112
+ return {
113
+ problem: `${posix.basename(path)} is not JSON: ${error instanceof Error ? error.message : String(error)}`,
114
+ };
115
+ }
116
+ }
117
+ function frontMatter(text) {
118
+ const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/.exec(text);
119
+ if (match === null) {
120
+ return null;
121
+ }
122
+ const scalars = {};
123
+ for (const line of (match[1] ?? "").split(/\r?\n/)) {
124
+ const key = /^([a-z][a-zA-Z]*):(?: (.*))?$/.exec(line);
125
+ if (key?.[1] !== undefined && key[2] !== undefined) {
126
+ scalars[key[1]] = key[2].replace(/^"(.*)"$/, "$1");
127
+ }
128
+ }
129
+ return { scalars, body: match[2] ?? "" };
130
+ }
131
+ async function checkSkills(root, skillsDir, errors, warnings) {
132
+ const manifestPath = join(root, "SKILLCDN.md");
133
+ const manifestText = await readFile(manifestPath, "utf8").catch(() => null);
134
+ if (manifestText === null) {
135
+ errors.push("SKILLCDN.md is missing at the package root: a plugin with skills has their manifest there");
136
+ }
137
+ else {
138
+ const matter = frontMatter(manifestText);
139
+ if (matter === null || !matter.scalars.name || !matter.scalars.description) {
140
+ errors.push("SKILLCDN.md has no front-matter with name and description");
141
+ }
142
+ }
143
+ const dir = join(root, skillsDir);
144
+ if ((await exists(dir)) !== "directory") {
145
+ errors.push(`skills names ${skillsDir}, which is not a directory`);
146
+ return 0;
147
+ }
148
+ let count = 0;
149
+ for (const entry of await readdir(dir, { withFileTypes: true })) {
150
+ if (!entry.isDirectory()) {
151
+ continue;
152
+ }
153
+ const file = posix.join(skillsDir, entry.name, "SKILL.md");
154
+ const text = await readFile(join(root, file), "utf8").catch(() => null);
155
+ if (text === null) {
156
+ errors.push(`${file} is missing: a skill directory holds a SKILL.md`);
157
+ continue;
158
+ }
159
+ count += 1;
160
+ const matter = frontMatter(text);
161
+ if (matter === null) {
162
+ errors.push(`${file} has no front-matter`);
163
+ continue;
164
+ }
165
+ if (matter.scalars.name !== entry.name) {
166
+ errors.push(`${file} is named ${matter.scalars.name ?? "(nothing)"}, not ${entry.name} as its directory is`);
167
+ }
168
+ const description = matter.scalars.description ?? "";
169
+ if (description.length === 0 || description.length > 1024) {
170
+ errors.push(`${file} has a description of ${description.length} characters; 1 to 1024 are allowed`);
171
+ }
172
+ if (!/^\s*# /.test(matter.body)) {
173
+ errors.push(`${file} does not start its body with a level-one heading`);
174
+ }
175
+ if (matter.scalars.license === undefined) {
176
+ warnings.push(`${file} names no license`);
177
+ }
178
+ }
179
+ if (count === 0) {
180
+ warnings.push(`${skillsDir} holds no skill`);
181
+ }
182
+ return count;
183
+ }
184
+ async function checkMigrations(root, migrationsDir, errors) {
185
+ const dir = join(root, migrationsDir);
186
+ if ((await exists(dir)) !== "directory") {
187
+ errors.push(`migrations names ${migrationsDir}, which is not a directory`);
188
+ return;
189
+ }
190
+ const names = (await readdir(dir)).filter((name) => name.endsWith(".sql")).sort();
191
+ if (names.length === 0) {
192
+ errors.push(`${migrationsDir} holds no .sql file`);
193
+ }
194
+ for (const name of names) {
195
+ if (!/^\d{4}-[a-z0-9-]+\.sql$/.test(name)) {
196
+ errors.push(`${migrationsDir}/${name} is not named NNNN-<words>.sql`);
197
+ }
198
+ }
199
+ }
200
+ async function checkWeb(root, manifest, webDir, errors, warnings) {
201
+ const dir = join(root, webDir);
202
+ if ((await exists(dir)) !== "directory") {
203
+ errors.push(`web names ${webDir}, which is not a directory: build the bundle first`);
204
+ return;
205
+ }
206
+ const script = await readFile(join(dir, "index.js"), "utf8").catch(() => null);
207
+ if (script === null) {
208
+ errors.push(`${webDir}/index.js is missing: the frame loads the bundle from there`);
209
+ }
210
+ else {
211
+ for (const problem of webBundleProblems(script)) {
212
+ errors.push(`${webDir}/index.js ${problem}`);
213
+ }
214
+ }
215
+ const css = await readFile(join(dir, "index.css"), "utf8").catch(() => null);
216
+ if (css !== null) {
217
+ if (/@import\s+(?:url\()?["']?(?:https?:)?\/\//.test(css) ||
218
+ /url\(\s*["']?(?:https?:)?\/\//.test(css)) {
219
+ errors.push(`${webDir}/index.css loads from elsewhere: a bundle is self-contained`);
220
+ }
221
+ const prefix = `pl-${manifest.key}-`;
222
+ const strangers = classesIn(css).filter((name) => !name.startsWith(prefix) && !name.startsWith("sc-"));
223
+ if (strangers.length > 0) {
224
+ warnings.push(`${webDir}/index.css styles ${strangers.slice(0, 5).join(", ")}${strangers.length > 5 ? ", ..." : ""}: a plugin's classes begin with ${prefix}`);
225
+ }
226
+ }
227
+ }
228
+ function describeCounts(manifest, description) {
229
+ const counts = [
230
+ `${manifest.pages.length} pages`,
231
+ `${manifest.widgets.length} widgets`,
232
+ `${manifest.settings.length} settings`,
233
+ `${Object.keys(manifest.roles).length} roles`,
234
+ ];
235
+ if (description !== null) {
236
+ counts.unshift(`${description.collections.length} collections`, `${Object.keys(description.commands).length} commands`, `${Object.keys(description.queries).length} queries`, `${Object.keys(description.endpoints).length} endpoints`, `${description.hooks.length} hooks`, `${Object.keys(description.jobs).length} jobs`);
237
+ }
238
+ return counts.join(", ");
239
+ }
240
+ /**
241
+ * The words of the manifest, as JSON, whose translation repeats the English words (`name.ko`,
242
+ * for one): what `init --languages` copies for the author to translate, and what was left.
243
+ */
244
+ export function sameAsEnglish(value, at = "") {
245
+ if (Array.isArray(value)) {
246
+ return value.flatMap((item, index) => sameAsEnglish(item, `${at}[${index}]`));
247
+ }
248
+ if (typeof value !== "object" || value === null) {
249
+ return [];
250
+ }
251
+ if (isLanguageMap(value)) {
252
+ return Object.entries(value)
253
+ .filter(([language, words]) => language !== "en" && words === value.en)
254
+ .map(([language]) => `${at}.${language}`.replace(/^\./, ""));
255
+ }
256
+ return Object.entries(value).flatMap(([key, inner]) => sameAsEnglish(inner, at.length === 0 ? key : `${at}.${key}`));
257
+ }
258
+ /** Reads the plugin at `root` as a console would, and says what it would refuse. */
259
+ export async function checkPlugin(root, loadServer) {
260
+ const errors = [];
261
+ const warnings = [];
262
+ if ((await exists(root)) !== "directory") {
263
+ return { ok: false, errors: [`${root} is not a directory`], warnings, summary: null };
264
+ }
265
+ const manifestRead = await readJson(join(root, "console-plugin.json"));
266
+ if ("problem" in manifestRead) {
267
+ return { ok: false, errors: [manifestRead.problem], warnings, summary: null };
268
+ }
269
+ const parsed = parsePluginManifest(manifestRead.value);
270
+ if (!parsed.ok) {
271
+ return {
272
+ ok: false,
273
+ errors: parsed.problems.map((problem) => `console-plugin.json: ${problem}`),
274
+ warnings,
275
+ summary: null,
276
+ };
277
+ }
278
+ const manifest = parsed.manifest;
279
+ if (!PLUGIN_API_MAJORS.includes(manifest.pluginApi)) {
280
+ errors.push(`console-plugin.json: pluginApi ${manifest.pluginApi} is not one this command knows (${PLUGIN_API_MAJORS.join(", ")}); write against ${CURRENT_PLUGIN_API}`);
281
+ }
282
+ for (const path of sameAsEnglish(manifestRead.value)) {
283
+ warnings.push(`console-plugin.json: ${path} is the same as en: translate it, or leave the language out`);
284
+ }
285
+ const packageRead = await readJson(join(root, "package.json"));
286
+ let version = "0.0.0";
287
+ if ("problem" in packageRead) {
288
+ errors.push(packageRead.problem);
289
+ }
290
+ else {
291
+ const pkg = (typeof packageRead.value === "object" && packageRead.value !== null ? packageRead.value : {});
292
+ if (typeof pkg.name !== "string" || pkg.name.length === 0) {
293
+ errors.push("package.json: name is missing");
294
+ }
295
+ if (typeof pkg.version !== "string" ||
296
+ !/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(pkg.version)) {
297
+ errors.push("package.json: version is not a semver version");
298
+ }
299
+ else {
300
+ version = pkg.version;
301
+ }
302
+ if (typeof pkg.license !== "string" || !isPermissiveLicense(pkg.license)) {
303
+ errors.push(`package.json: license ${typeof pkg.license === "string" ? pkg.license : "(none)"} is not a permissive license (${PERMISSIVE_LICENSES.join(", ")})`);
304
+ }
305
+ if (pkg.type !== "module") {
306
+ errors.push('package.json: type is not "module"; the server module is ESM');
307
+ }
308
+ const scripts = (typeof pkg.scripts === "object" && pkg.scripts !== null ? pkg.scripts : {});
309
+ for (const hook of ["preinstall", "install", "postinstall"]) {
310
+ if (hook in scripts) {
311
+ errors.push(`package.json: has a ${hook} script; a plugin is installed with no install scripts`);
312
+ }
313
+ }
314
+ if (Array.isArray(pkg.files)) {
315
+ const files = pkg.files.filter((entry) => typeof entry === "string");
316
+ const shipped = [
317
+ "console-plugin.json",
318
+ manifest.server,
319
+ ...(manifest.web === undefined ? [] : [manifest.web]),
320
+ ...(manifest.skills === undefined ? [] : [manifest.skills, "SKILLCDN.md"]),
321
+ ...(manifest.migrations === undefined ? [] : [manifest.migrations]),
322
+ ];
323
+ for (const path of shipped) {
324
+ if (!coveredByFiles(files, path)) {
325
+ errors.push(`package.json: files leaves out ${path}, which the console reads`);
326
+ }
327
+ }
328
+ }
329
+ else {
330
+ warnings.push("package.json: has no files list; everything in the directory is published");
331
+ }
332
+ if (typeof pkg.private === "boolean" && pkg.private) {
333
+ warnings.push("package.json: is private; take that out to publish");
334
+ }
335
+ }
336
+ let description = null;
337
+ const serverPath = join(root, manifest.server);
338
+ if ((await exists(serverPath)) !== "file") {
339
+ errors.push(`server names ${manifest.server}, which is missing: build the server module first`);
340
+ }
341
+ else {
342
+ const source = await readFile(serverPath, "utf8");
343
+ for (const specifier of forbiddenImportsIn(source)) {
344
+ errors.push(`${manifest.server} imports ${specifier}, which the host refuses`);
345
+ }
346
+ for (const name of removedGlobalsIn(source)) {
347
+ errors.push(`${manifest.server} calls ${name}, which the host removes; the console is reached through ctx`);
348
+ }
349
+ const load = await loadServer(serverPath);
350
+ if (!load.ok) {
351
+ errors.push(`${manifest.server} does not load under the host's hardening: ${load.error}`);
352
+ for (const problem of load.problems) {
353
+ errors.push(`${manifest.server}: ${problem}`);
354
+ }
355
+ }
356
+ else {
357
+ description = load.description;
358
+ if (description.pluginApi !== manifest.pluginApi) {
359
+ errors.push(`${manifest.server} was built against plugin API ${description.pluginApi}; the manifest says ${manifest.pluginApi}`);
360
+ }
361
+ for (const problem of descriptionProblems(description, manifest)) {
362
+ errors.push(`${manifest.server}: ${problem}`);
363
+ }
364
+ if (manifest.capabilities.includes("endpoints") &&
365
+ Object.keys(description.endpoints).length === 0) {
366
+ warnings.push("console-plugin.json: asks the capability endpoints and the server module defines no endpoint");
367
+ }
368
+ if (manifest.capabilities.includes("jobs") && Object.keys(description.jobs).length === 0) {
369
+ warnings.push("console-plugin.json: asks the capability jobs and the server module defines no job");
370
+ }
371
+ }
372
+ }
373
+ if (manifest.web !== undefined) {
374
+ await checkWeb(root, manifest, manifest.web, errors, warnings);
375
+ }
376
+ let skills = 0;
377
+ if (manifest.skills !== undefined) {
378
+ skills = await checkSkills(root, manifest.skills, errors, warnings);
379
+ }
380
+ else {
381
+ warnings.push("console-plugin.json: names no skills; an agent learns the plugin from its command's help alone");
382
+ }
383
+ if (manifest.migrations !== undefined) {
384
+ await checkMigrations(root, manifest.migrations, errors);
385
+ }
386
+ else if (manifest.capabilities.includes("storage:sql")) {
387
+ warnings.push("console-plugin.json: asks storage:sql and names no migrations");
388
+ }
389
+ return {
390
+ ok: errors.length === 0,
391
+ errors,
392
+ warnings,
393
+ summary: `${manifest.key} ${version}: ${describeCounts(manifest, description)}, ${skills} skills`,
394
+ };
395
+ }
396
+ //# sourceMappingURL=plugin-check.js.map