@skillcdn/console 0.4.0 → 0.4.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 (308) hide show
  1. package/README.md +20 -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 +579 -45
  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 +277 -6
  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 +60 -7
  16. package/dist/cli/help.js.map +1 -1
  17. package/dist/cli/plugin-check.d.ts +21 -0
  18. package/dist/cli/plugin-check.d.ts.map +1 -0
  19. package/dist/cli/plugin-check.js +374 -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 +123 -0
  24. package/dist/cli/plugin-cli.js.map +1 -0
  25. package/dist/cli/plugin-init.d.ts +20 -0
  26. package/dist/cli/plugin-init.d.ts.map +1 -0
  27. package/dist/cli/plugin-init.js +74 -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 +109 -2
  34. package/dist/client.d.ts.map +1 -1
  35. package/dist/client.js +67 -2
  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/event-feed.d.ts +1 -1
  44. package/dist/components/event-feed.d.ts.map +1 -1
  45. package/dist/components/event-feed.js +33 -1
  46. package/dist/components/event-feed.js.map +1 -1
  47. package/dist/components/markdown.d.ts.map +1 -1
  48. package/dist/components/markdown.js +6 -3
  49. package/dist/components/markdown.js.map +1 -1
  50. package/dist/components/pack-connect.d.ts +3 -1
  51. package/dist/components/pack-connect.d.ts.map +1 -1
  52. package/dist/components/pack-connect.js +4 -4
  53. package/dist/components/pack-connect.js.map +1 -1
  54. package/dist/components/pack-token.d.ts +3 -1
  55. package/dist/components/pack-token.d.ts.map +1 -1
  56. package/dist/components/pack-token.js +1 -1
  57. package/dist/components/pack-token.js.map +1 -1
  58. package/dist/components/people.d.ts.map +1 -1
  59. package/dist/components/people.js +14 -3
  60. package/dist/components/people.js.map +1 -1
  61. package/dist/components/plugin-frame.d.ts +52 -0
  62. package/dist/components/plugin-frame.d.ts.map +1 -0
  63. package/dist/components/plugin-frame.js +314 -0
  64. package/dist/components/plugin-frame.js.map +1 -0
  65. package/dist/components/plugin-settings.d.ts +38 -0
  66. package/dist/components/plugin-settings.d.ts.map +1 -0
  67. package/dist/components/plugin-settings.js +348 -0
  68. package/dist/components/plugin-settings.js.map +1 -0
  69. package/dist/components/remote-pictures.d.ts +6 -0
  70. package/dist/components/remote-pictures.d.ts.map +1 -0
  71. package/dist/components/remote-pictures.js +8 -0
  72. package/dist/components/remote-pictures.js.map +1 -0
  73. package/dist/components/shell.d.ts +2 -0
  74. package/dist/components/shell.d.ts.map +1 -1
  75. package/dist/components/shell.js +26 -1
  76. package/dist/components/shell.js.map +1 -1
  77. package/dist/components/sign-in.d.ts.map +1 -1
  78. package/dist/components/sign-in.js +49 -2
  79. package/dist/components/sign-in.js.map +1 -1
  80. package/dist/components/ui.d.ts +3 -2
  81. package/dist/components/ui.d.ts.map +1 -1
  82. package/dist/components/ui.js +6 -3
  83. package/dist/components/ui.js.map +1 -1
  84. package/dist/components/workspace.d.ts +7 -1
  85. package/dist/components/workspace.d.ts.map +1 -1
  86. package/dist/components/workspace.js +1 -1
  87. package/dist/components/workspace.js.map +1 -1
  88. package/dist/console.css +384 -5
  89. package/dist/console.d.ts.map +1 -1
  90. package/dist/console.js +146 -29
  91. package/dist/console.js.map +1 -1
  92. package/dist/data.d.ts +11 -2
  93. package/dist/data.d.ts.map +1 -1
  94. package/dist/data.js +35 -21
  95. package/dist/data.js.map +1 -1
  96. package/dist/i18n/en.d.ts +163 -1
  97. package/dist/i18n/en.d.ts.map +1 -1
  98. package/dist/i18n/en.js +174 -1
  99. package/dist/i18n/en.js.map +1 -1
  100. package/dist/i18n/ko.d.ts.map +1 -1
  101. package/dist/i18n/ko.js +154 -1
  102. package/dist/i18n/ko.js.map +1 -1
  103. package/dist/index.d.ts +3 -1
  104. package/dist/index.d.ts.map +1 -1
  105. package/dist/index.js +3 -1
  106. package/dist/index.js.map +1 -1
  107. package/dist/limits.d.ts +14 -0
  108. package/dist/limits.d.ts.map +1 -1
  109. package/dist/limits.js +14 -0
  110. package/dist/limits.js.map +1 -1
  111. package/dist/plugin/args.d.ts +148 -0
  112. package/dist/plugin/args.d.ts.map +1 -0
  113. package/dist/plugin/args.js +369 -0
  114. package/dist/plugin/args.js.map +1 -0
  115. package/dist/plugin/bridge.d.ts +146 -0
  116. package/dist/plugin/bridge.d.ts.map +1 -0
  117. package/dist/plugin/bridge.js +125 -0
  118. package/dist/plugin/bridge.js.map +1 -0
  119. package/dist/plugin/capabilities.d.ts +20 -0
  120. package/dist/plugin/capabilities.d.ts.map +1 -0
  121. package/dist/plugin/capabilities.js +133 -0
  122. package/dist/plugin/capabilities.js.map +1 -0
  123. package/dist/plugin/context.d.ts +374 -0
  124. package/dist/plugin/context.d.ts.map +1 -0
  125. package/dist/plugin/context.js +2 -0
  126. package/dist/plugin/context.js.map +1 -0
  127. package/dist/plugin/define.d.ts +208 -0
  128. package/dist/plugin/define.d.ts.map +1 -0
  129. package/dist/plugin/define.js +482 -0
  130. package/dist/plugin/define.js.map +1 -0
  131. package/dist/plugin/definition-error.d.ts +11 -0
  132. package/dist/plugin/definition-error.d.ts.map +1 -0
  133. package/dist/plugin/definition-error.js +17 -0
  134. package/dist/plugin/definition-error.js.map +1 -0
  135. package/dist/plugin/limits.d.ts +67 -0
  136. package/dist/plugin/limits.d.ts.map +1 -0
  137. package/dist/plugin/limits.js +70 -0
  138. package/dist/plugin/limits.js.map +1 -0
  139. package/dist/plugin/load-worker.d.ts +7 -0
  140. package/dist/plugin/load-worker.d.ts.map +1 -0
  141. package/dist/plugin/load-worker.js +41 -0
  142. package/dist/plugin/load-worker.js.map +1 -0
  143. package/dist/plugin/load.d.ts +18 -0
  144. package/dist/plugin/load.d.ts.map +1 -0
  145. package/dist/plugin/load.js +62 -0
  146. package/dist/plugin/load.js.map +1 -0
  147. package/dist/plugin/manifest.d.ts +237 -0
  148. package/dist/plugin/manifest.d.ts.map +1 -0
  149. package/dist/plugin/manifest.js +411 -0
  150. package/dist/plugin/manifest.js.map +1 -0
  151. package/dist/plugin/refusals.d.ts +49 -0
  152. package/dist/plugin/refusals.d.ts.map +1 -0
  153. package/dist/plugin/refusals.js +79 -0
  154. package/dist/plugin/refusals.js.map +1 -0
  155. package/dist/plugin/rest-schemas.d.ts +556 -0
  156. package/dist/plugin/rest-schemas.d.ts.map +1 -0
  157. package/dist/plugin/rest-schemas.js +262 -0
  158. package/dist/plugin/rest-schemas.js.map +1 -0
  159. package/dist/plugin/sandbox.d.ts +23 -0
  160. package/dist/plugin/sandbox.d.ts.map +1 -0
  161. package/dist/plugin/sandbox.js +99 -0
  162. package/dist/plugin/sandbox.js.map +1 -0
  163. package/dist/plugin/testing.d.ts +45 -0
  164. package/dist/plugin/testing.d.ts.map +1 -0
  165. package/dist/plugin/testing.js +420 -0
  166. package/dist/plugin/testing.js.map +1 -0
  167. package/dist/plugin/web-react.d.ts +11 -0
  168. package/dist/plugin/web-react.d.ts.map +1 -0
  169. package/dist/plugin/web-react.js +34 -0
  170. package/dist/plugin/web-react.js.map +1 -0
  171. package/dist/plugin/web.d.ts +95 -0
  172. package/dist/plugin/web.d.ts.map +1 -0
  173. package/dist/plugin/web.js +245 -0
  174. package/dist/plugin/web.js.map +1 -0
  175. package/dist/plugin-nav.d.ts +29 -0
  176. package/dist/plugin-nav.d.ts.map +1 -0
  177. package/dist/plugin-nav.js +92 -0
  178. package/dist/plugin-nav.js.map +1 -0
  179. package/dist/plugin-testing.d.ts +2 -0
  180. package/dist/plugin-testing.d.ts.map +1 -0
  181. package/dist/plugin-testing.js +4 -0
  182. package/dist/plugin-testing.js.map +1 -0
  183. package/dist/plugin-web-react.d.ts +3 -0
  184. package/dist/plugin-web-react.d.ts.map +1 -0
  185. package/dist/plugin-web-react.js +3 -0
  186. package/dist/plugin-web-react.js.map +1 -0
  187. package/dist/plugin-web.d.ts +4 -0
  188. package/dist/plugin-web.d.ts.map +1 -0
  189. package/dist/plugin-web.js +5 -0
  190. package/dist/plugin-web.js.map +1 -0
  191. package/dist/plugin.d.ts +11 -0
  192. package/dist/plugin.d.ts.map +1 -0
  193. package/dist/plugin.js +15 -0
  194. package/dist/plugin.js.map +1 -0
  195. package/dist/router.d.ts +28 -0
  196. package/dist/router.d.ts.map +1 -1
  197. package/dist/router.js +47 -0
  198. package/dist/router.js.map +1 -1
  199. package/dist/routes.d.ts +6 -0
  200. package/dist/routes.d.ts.map +1 -1
  201. package/dist/routes.js +8 -0
  202. package/dist/routes.js.map +1 -1
  203. package/dist/schemas.d.ts +147 -1
  204. package/dist/schemas.d.ts.map +1 -1
  205. package/dist/schemas.js +55 -5
  206. package/dist/schemas.js.map +1 -1
  207. package/dist/tokens.d.ts +2 -0
  208. package/dist/tokens.d.ts.map +1 -0
  209. package/dist/tokens.js +101 -0
  210. package/dist/tokens.js.map +1 -0
  211. package/dist/vocabulary.d.ts +11 -1
  212. package/dist/vocabulary.d.ts.map +1 -1
  213. package/dist/vocabulary.js +24 -0
  214. package/dist/vocabulary.js.map +1 -1
  215. package/dist/web.d.ts.map +1 -1
  216. package/dist/web.js +5 -2
  217. package/dist/web.js.map +1 -1
  218. package/docs/specs/cli.md +16 -9
  219. package/docs/specs/plugins.md +487 -0
  220. package/docs/specs/rest.md +25 -13
  221. package/package.json +21 -3
  222. package/skills/building-a-console/SKILL.md +25 -26
  223. package/skills/building-a-console/references/configuring.md +40 -0
  224. package/skills/building-a-console/references/the-default-console.md +1 -1
  225. package/skills/building-a-console/references/the-look-from-a-website.md +5 -5
  226. package/skills/building-a-plugin/SKILL.md +137 -0
  227. package/skills/deploying-a-console/SKILL.md +24 -26
  228. package/skills/deploying-a-console/references/access.md +13 -9
  229. package/skills/deploying-a-console/references/resources.md +25 -10
  230. package/skills/deploying-a-console/references/running-it-again.md +15 -0
  231. package/skills/deploying-a-console/references/sizing.md +2 -0
  232. package/skills/planning-the-board/SKILL.md +96 -0
  233. package/skills/planning-the-board/references/a-task.md +36 -0
  234. package/skills/planning-the-board/references/setting-up.md +44 -0
  235. package/skills/working-the-board/SKILL.md +43 -34
  236. package/skills/working-the-board/references/the-pack.md +19 -0
  237. package/src/api.ts +16 -0
  238. package/src/cli/cli.ts +736 -45
  239. package/src/cli/format.ts +356 -9
  240. package/src/cli/help.ts +71 -6
  241. package/src/cli/plugin-check.ts +470 -0
  242. package/src/cli/plugin-cli.ts +148 -0
  243. package/src/cli/plugin-init.ts +90 -0
  244. package/src/cli/plugin-main.ts +30 -0
  245. package/src/client.ts +324 -1
  246. package/src/compat.ts +2 -2
  247. package/src/components/board.tsx +62 -14
  248. package/src/components/event-feed.tsx +42 -1
  249. package/src/components/markdown.tsx +6 -3
  250. package/src/components/pack-connect.tsx +10 -7
  251. package/src/components/pack-token.tsx +4 -1
  252. package/src/components/people.tsx +17 -7
  253. package/src/components/plugin-frame.tsx +437 -0
  254. package/src/components/plugin-settings.tsx +1111 -0
  255. package/src/components/remote-pictures.ts +19 -0
  256. package/src/components/shell.tsx +82 -14
  257. package/src/components/sign-in.tsx +114 -13
  258. package/src/components/ui.tsx +6 -3
  259. package/src/components/workspace.tsx +18 -0
  260. package/src/console.tsx +309 -23
  261. package/src/data.ts +47 -22
  262. package/src/i18n/en.ts +183 -1
  263. package/src/i18n/ko.ts +159 -1
  264. package/src/index.ts +12 -0
  265. package/src/limits.ts +14 -0
  266. package/src/plugin/args.ts +526 -0
  267. package/src/plugin/bridge.ts +314 -0
  268. package/src/plugin/capabilities.ts +150 -0
  269. package/src/plugin/context.ts +416 -0
  270. package/src/plugin/define.ts +792 -0
  271. package/src/plugin/definition-error.ts +19 -0
  272. package/src/plugin/limits.ts +70 -0
  273. package/src/plugin/load-worker.ts +50 -0
  274. package/src/plugin/load.ts +82 -0
  275. package/src/plugin/manifest.ts +561 -0
  276. package/src/plugin/refusals.ts +94 -0
  277. package/src/plugin/rest-schemas.ts +354 -0
  278. package/src/plugin/sandbox.ts +123 -0
  279. package/src/plugin/testing.ts +612 -0
  280. package/src/plugin/web-react.ts +45 -0
  281. package/src/plugin/web.ts +403 -0
  282. package/src/plugin-nav.ts +132 -0
  283. package/src/plugin-testing.ts +10 -0
  284. package/src/plugin-web-react.ts +4 -0
  285. package/src/plugin-web.ts +35 -0
  286. package/src/plugin.ts +126 -0
  287. package/src/router.ts +73 -0
  288. package/src/routes.ts +9 -0
  289. package/src/schemas.ts +60 -4
  290. package/src/styles/console.css +384 -5
  291. package/src/tokens.ts +101 -0
  292. package/src/vocabulary.ts +30 -0
  293. package/src/web.ts +5 -2
  294. package/template/plugin/.gitignore +2 -0
  295. package/template/plugin/README.md +26 -0
  296. package/template/plugin/SKILLCDN.md +13 -0
  297. package/template/plugin/build.mjs +40 -0
  298. package/template/plugin/console-plugin.json +50 -0
  299. package/template/plugin/package.json +27 -0
  300. package/template/plugin/skills/__key__/SKILL.md +23 -0
  301. package/template/plugin/src/check.test.ts +34 -0
  302. package/template/plugin/src/server/index.test.ts +41 -0
  303. package/template/plugin/src/server/index.ts +72 -0
  304. package/template/plugin/src/web/index.css +51 -0
  305. package/template/plugin/src/web/index.ts +115 -0
  306. package/template/plugin/tsconfig.json +17 -0
  307. package/skills/working-the-board/references/setting-up.md +0 -3
  308. /package/skills/{working-the-board → planning-the-board}/references/project-rules.md +0 -0
package/dist/cli/help.js CHANGED
@@ -1,8 +1,9 @@
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_DOCUMENT_LENGTH, MAX_DOCUMENT_PATH_LENGTH, MAX_FILE_BYTES, MAX_FILES_PER_COMMENT, MAX_FILES_PER_DOCUMENT, 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_QUESTION_LENGTH, MAX_REPORTS_PER_RUN, MAX_RULES_LENGTH, MAX_SEARCH_LENGTH, MAX_SUMMARY_LENGTH, 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_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 = [
5
5
  "auth.required: the token is not one the console knows, any more or at all; a person signs the command in again",
6
+ "auth.deactivated, auth.not_admitted: the person this token acts as is out, deactivated or no longer let in; the console keeps the token, and it works again when they are back in",
6
7
  "request.invalid: what was sent is over a limit or malformed; the message names the field",
7
8
  "network: the console could not be reached at its address",
8
9
  ];
@@ -93,8 +94,13 @@ export const COMMAND_HELP = {
93
94
  `title: one line, up to ${MAX_TITLE_LENGTH} characters, saying what is to be done on its own; what it refers to goes in the body`,
94
95
  `body: ${MARKDOWN}`,
95
96
  ...TASK_FIELD_LIMITS,
97
+ `at most ${MAX_TASKS_PER_PROJECT} tasks in one project, those put away counted`,
98
+ ],
99
+ refusals: [
100
+ "task.not_found: no task has that number or id",
101
+ ...TASK_FIELD_REFUSALS,
102
+ "task.too_many: the project holds as many tasks as one may; the work goes on in another project",
96
103
  ],
97
- refusals: ["task.not_found: no task has that number or id", ...TASK_FIELD_REFUSALS],
98
104
  },
99
105
  goals: {
100
106
  usage: "goals [--category <key>] [--state <state>] [--search <words>] [--limit <n>] [--offset <n>]",
@@ -111,11 +117,13 @@ export const COMMAND_HELP = {
111
117
  `title: one line, up to ${MAX_TITLE_LENGTH} characters`,
112
118
  `body: ${MARKDOWN}`,
113
119
  `starts, due: ${DAY}`,
120
+ `at most ${MAX_GOALS_PER_PROJECT} goals in one project`,
114
121
  ],
115
122
  refusals: [
116
123
  "goal.not_found: no goal of this project has that id",
117
124
  "goal.invalid_category: no category of the workspace has that key",
118
125
  "goal.invalid_dates: the target day is before the start",
126
+ "goal.too_many: the project holds as many goals as one may",
119
127
  "auth.forbidden: only an owner of the project sets its roadmap",
120
128
  ],
121
129
  },
@@ -164,11 +172,13 @@ export const COMMAND_HELP = {
164
172
  `name: one line, up to ${MAX_PROJECT_NAME_LENGTH} characters; description: up to ${MAX_PROJECT_DESCRIPTION_LENGTH}`,
165
173
  `color: ${COLORS}; symbol: up to ${MAX_PROJECT_SYMBOL_LENGTH} characters without spaces, shown on the colour; left out, the pages choose both from the key and the name`,
166
174
  `image: a PNG, a JPEG, a GIF or a WebP of at most ${MAX_PROJECT_ICON_BYTES} bytes`,
175
+ `at most ${MAX_PROJECTS_PER_WORKSPACE} projects in the workspace`,
167
176
  ],
168
177
  refusals: [
169
178
  "project.not_found: no project has that key, or it is not yours to see",
170
- "auth.forbidden: only an owner of the project changes it",
179
+ "auth.forbidden: only an administrator makes a project, and only an owner changes it",
171
180
  "project.key_taken: a project has that key already",
181
+ "project.too_many: the workspace holds as many projects as one may",
172
182
  "project.invalid_address: the skills address is not one as SkillCDN spells it",
173
183
  "project.invalid_icon: the file is not an image of those kinds, by its bytes",
174
184
  "request.too_large: the image is over the limit",
@@ -235,7 +245,7 @@ export const COMMAND_HELP = {
235
245
  rules: {
236
246
  usage: "rules | rules write --body <markdown>|--file <path>|-|none [--workspace] [--base <version>]",
237
247
  synopsis: "What this organization and this project ask of agents; rules write writes them, for an owner or an administrator.",
238
- 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>.",
239
249
  limits: [
240
250
  `body: Markdown, up to ${MAX_RULES_LENGTH} characters; the console's own rules, written as they are, write nothing`,
241
251
  ],
@@ -244,14 +254,47 @@ export const COMMAND_HELP = {
244
254
  "document.conflict: the rules have moved on since --base; read them again",
245
255
  ],
246
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
+ },
247
286
  take: {
248
287
  usage: "take <number|id> [--agent <name>]",
249
288
  synopsis: "Takes a task: a run begins, and the task is in progress and the person's.",
250
- 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.",
251
- limits: [`agent: one line, up to ${MAX_AGENT_LENGTH} characters`],
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.",
290
+ limits: [
291
+ `agent: one line, up to ${MAX_AGENT_LENGTH} characters`,
292
+ `at most ${MAX_RUNS_PER_TASK} runs on one task`,
293
+ ],
252
294
  refusals: [
253
295
  "task.not_found: no task has that number or id",
254
296
  "run.task_closed: the task is done or dropped",
297
+ "run.too_many: the task has been taken as many times as one may; write a new task for what is left",
255
298
  ],
256
299
  },
257
300
  report: {
@@ -280,6 +323,7 @@ export const COMMAND_HELP = {
280
323
  ...RUN_REFUSALS,
281
324
  "run.too_many_artifacts: the run carries as many as one may",
282
325
  "request.too_large: the file is over the limit",
326
+ "project.too_many_bytes: the project's files hold as many bytes together as this console allows; hand in a link instead",
283
327
  ],
284
328
  },
285
329
  ask: {
@@ -292,11 +336,13 @@ export const COMMAND_HELP = {
292
336
  `options: ${MIN_OPTIONS} to ${MAX_OPTIONS}, each one line up to ${MAX_OPTION_LABEL_LENGTH} characters`,
293
337
  `body: ${MARKDOWN}`,
294
338
  "to: a login of the project, or me",
339
+ `at most ${MAX_DECISIONS_PER_PROJECT} decisions in one project`,
295
340
  ],
296
341
  refusals: [
297
342
  ...RUN_CHOICE,
298
343
  "decision.invalid_run: the run is not yours, or is over",
299
344
  "decision.invalid_decider: the person named may not work in the project",
345
+ "decision.too_many: the project holds as many decisions as one may",
300
346
  ],
301
347
  },
302
348
  answer: {
@@ -374,6 +420,7 @@ export const COMMAND_HELP = {
374
420
  "comment.too_many: the task carries as many comments as one may",
375
421
  "comment.too_many_files: more files than one comment may carry",
376
422
  "request.too_large: the files are over the limit together",
423
+ "project.too_many_bytes: the project's files hold as many bytes together as this console allows; say where the file is instead",
377
424
  ],
378
425
  },
379
426
  file: {
@@ -401,13 +448,14 @@ export const COMMAND_HELP = {
401
448
  `path: ${DOCUMENT_PATH}`,
402
449
  `title: one line, up to ${MAX_TITLE_LENGTH} characters`,
403
450
  `body: Markdown, up to ${MAX_DOCUMENT_LENGTH} characters`,
404
- `at most ${MAX_VERSIONS_PER_DOCUMENT} versions of one page`,
451
+ `at most ${MAX_VERSIONS_PER_DOCUMENT} versions of one page, and ${MAX_DOCUMENTS_PER_PROJECT} pages in one project`,
405
452
  ],
406
453
  refusals: [
407
454
  "document.invalid_path: the path is not one",
408
455
  "document.conflict: the page has moved on since --base; read it again",
409
456
  "document.archived: the page is archived; restore it first",
410
457
  "document.too_many_versions: the page carries as many versions as one may; write a new page",
458
+ "document.too_many: the project holds as many pages as one may; write on a page there is",
411
459
  ],
412
460
  },
413
461
  attach: {
@@ -423,6 +471,7 @@ export const COMMAND_HELP = {
423
471
  "document.archived: the page is archived; restore it first",
424
472
  "document.too_many_files: the page carries as many files as one may",
425
473
  "request.too_large: the file is over the limit",
474
+ "project.too_many_bytes: the project's files hold as many bytes together as this console allows; link to where the file is instead",
426
475
  ],
427
476
  },
428
477
  archive: {
@@ -508,6 +557,10 @@ const SECTIONS = [
508
557
  "rules",
509
558
  ],
510
559
  },
560
+ {
561
+ title: "The plugins of this console, if it has any: a feature added to the board, worked through one command",
562
+ commands: ["plugins", "plugin"],
563
+ },
511
564
  {
512
565
  title: "Working",
513
566
  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,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,yBAAyB,EACzB,WAAW,EACX,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAyB/C,oE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Load } 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
+ /** Reads the plugin at `root` as a console would, and says what it would refuse. */
20
+ export declare function checkPlugin(root: string, loadServer: (file: string) => Promise<ServerLoad>): Promise<CheckReport>;
21
+ //# 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;AASpD,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,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,CA2JtB"}
@@ -0,0 +1,374 @@
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
+ /** SPDX identifiers under which a plugin may ship into an image: permissive only. */
11
+ export const PERMISSIVE_LICENSES = [
12
+ "MIT",
13
+ "MIT-0",
14
+ "ISC",
15
+ "0BSD",
16
+ "BSD-2-Clause",
17
+ "BSD-3-Clause",
18
+ "Apache-2.0",
19
+ "BlueOak-1.0.0",
20
+ "CC0-1.0",
21
+ "Unlicense",
22
+ "Zlib",
23
+ ];
24
+ /** `(MIT OR Apache-2.0)` is fine when one side is; `MIT AND X` only when both are. */
25
+ export function isPermissiveLicense(expression) {
26
+ const trimmed = expression.trim().replace(/^\(|\)$/g, "");
27
+ if (/\bOR\b/i.test(trimmed)) {
28
+ return trimmed.split(/\s+OR\s+/i).some(isPermissiveLicense);
29
+ }
30
+ if (/\bAND\b/i.test(trimmed)) {
31
+ return trimmed.split(/\s+AND\s+/i).every(isPermissiveLicense);
32
+ }
33
+ return PERMISSIVE_LICENSES.includes(trimmed);
34
+ }
35
+ /** True when npm's `files` list ships the path: named, under a named directory, or matched by a simple glob. */
36
+ export function coveredByFiles(files, path) {
37
+ const target = posix.normalize(path).replace(/^\.\//, "");
38
+ return files.some((entry) => {
39
+ const pattern = posix.normalize(entry).replace(/^\.\//, "").replace(/\/$/, "");
40
+ if (pattern.startsWith("!")) {
41
+ return false;
42
+ }
43
+ if (pattern === target || target.startsWith(`${pattern}/`)) {
44
+ return true;
45
+ }
46
+ if (!/[*?]/.test(pattern)) {
47
+ return false;
48
+ }
49
+ const regex = new RegExp(`^${pattern
50
+ .split("**")
51
+ .map((part) => part
52
+ .replace(/[.+^${}()|[\]\\]/g, "\\$&")
53
+ .replace(/\*/g, "[^/]*")
54
+ .replace(/\?/g, "[^/]"))
55
+ .join(".*")}(?:/.*)?$`);
56
+ return regex.test(target);
57
+ });
58
+ }
59
+ /** A class selector: a dot not after a digit or another dot (0.5em is a number), then a name. */
60
+ const CLASS_SELECTOR = /(?<![\d.])\.(-?[A-Za-z_][\w-]*)/g;
61
+ /** The classes a stylesheet styles, each once; comments and quoted strings are not read. */
62
+ export function classesIn(css) {
63
+ const withoutComments = css.replace(/\/\*[\s\S]*?\*\//g, "").replace(/"[^"]*"|'[^']*'/g, '""');
64
+ const found = new Set();
65
+ for (const match of withoutComments.matchAll(CLASS_SELECTOR)) {
66
+ if (match[1] !== undefined && !/^\d/.test(match[1])) {
67
+ found.add(match[1]);
68
+ }
69
+ }
70
+ return [...found];
71
+ }
72
+ const WEB_IMPORT = /(?:\bfrom\s*|\bimport\s*\(?\s*|\bexport\s+\*\s+from\s*)["'`]([^"'`]+)["'`]/g;
73
+ const WEB_FORBIDDEN = /\b(fetch|XMLHttpRequest|WebSocket|EventSource|importScripts|sendBeacon)\s*\(|document\.cookie|\bnavigator\.serviceWorker\b/g;
74
+ /** What a web bundle reaches for that a frame has no business with, or imports from elsewhere. */
75
+ export function webBundleProblems(source) {
76
+ const problems = new Set();
77
+ for (const match of source.matchAll(WEB_IMPORT)) {
78
+ const specifier = match[1] ?? "";
79
+ if (!specifier.startsWith("./") &&
80
+ !specifier.startsWith("../") &&
81
+ !specifier.startsWith("data:")) {
82
+ problems.add(`imports ${specifier} from elsewhere: a bundle is self-contained`);
83
+ }
84
+ }
85
+ for (const match of source.matchAll(WEB_FORBIDDEN)) {
86
+ problems.add(`uses ${match[1] ?? match[0]}: a frame speaks to the console through the bridge alone`);
87
+ }
88
+ return [...problems];
89
+ }
90
+ async function exists(path) {
91
+ try {
92
+ const found = await stat(path);
93
+ return found.isDirectory() ? "directory" : "file";
94
+ }
95
+ catch {
96
+ return null;
97
+ }
98
+ }
99
+ async function readJson(path) {
100
+ let text;
101
+ try {
102
+ text = await readFile(path, "utf8");
103
+ }
104
+ catch {
105
+ return { problem: `${posix.basename(path)} is missing` };
106
+ }
107
+ try {
108
+ return { value: JSON.parse(text) };
109
+ }
110
+ catch (error) {
111
+ return {
112
+ problem: `${posix.basename(path)} is not JSON: ${error instanceof Error ? error.message : String(error)}`,
113
+ };
114
+ }
115
+ }
116
+ function frontMatter(text) {
117
+ const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/.exec(text);
118
+ if (match === null) {
119
+ return null;
120
+ }
121
+ const scalars = {};
122
+ for (const line of (match[1] ?? "").split(/\r?\n/)) {
123
+ const key = /^([a-z][a-zA-Z]*):(?: (.*))?$/.exec(line);
124
+ if (key?.[1] !== undefined && key[2] !== undefined) {
125
+ scalars[key[1]] = key[2].replace(/^"(.*)"$/, "$1");
126
+ }
127
+ }
128
+ return { scalars, body: match[2] ?? "" };
129
+ }
130
+ async function checkSkills(root, skillsDir, errors, warnings) {
131
+ const manifestPath = join(root, "SKILLCDN.md");
132
+ const manifestText = await readFile(manifestPath, "utf8").catch(() => null);
133
+ if (manifestText === null) {
134
+ errors.push("SKILLCDN.md is missing at the package root: a plugin with skills has their manifest there");
135
+ }
136
+ else {
137
+ const matter = frontMatter(manifestText);
138
+ if (matter === null || !matter.scalars.name || !matter.scalars.description) {
139
+ errors.push("SKILLCDN.md has no front-matter with name and description");
140
+ }
141
+ }
142
+ const dir = join(root, skillsDir);
143
+ if ((await exists(dir)) !== "directory") {
144
+ errors.push(`skills names ${skillsDir}, which is not a directory`);
145
+ return 0;
146
+ }
147
+ let count = 0;
148
+ for (const entry of await readdir(dir, { withFileTypes: true })) {
149
+ if (!entry.isDirectory()) {
150
+ continue;
151
+ }
152
+ const file = posix.join(skillsDir, entry.name, "SKILL.md");
153
+ const text = await readFile(join(root, file), "utf8").catch(() => null);
154
+ if (text === null) {
155
+ errors.push(`${file} is missing: a skill directory holds a SKILL.md`);
156
+ continue;
157
+ }
158
+ count += 1;
159
+ const matter = frontMatter(text);
160
+ if (matter === null) {
161
+ errors.push(`${file} has no front-matter`);
162
+ continue;
163
+ }
164
+ if (matter.scalars.name !== entry.name) {
165
+ errors.push(`${file} is named ${matter.scalars.name ?? "(nothing)"}, not ${entry.name} as its directory is`);
166
+ }
167
+ const description = matter.scalars.description ?? "";
168
+ if (description.length === 0 || description.length > 1024) {
169
+ errors.push(`${file} has a description of ${description.length} characters; 1 to 1024 are allowed`);
170
+ }
171
+ if (!/^\s*# /.test(matter.body)) {
172
+ errors.push(`${file} does not start its body with a level-one heading`);
173
+ }
174
+ if (matter.scalars.license === undefined) {
175
+ warnings.push(`${file} names no license`);
176
+ }
177
+ }
178
+ if (count === 0) {
179
+ warnings.push(`${skillsDir} holds no skill`);
180
+ }
181
+ return count;
182
+ }
183
+ async function checkMigrations(root, migrationsDir, errors) {
184
+ const dir = join(root, migrationsDir);
185
+ if ((await exists(dir)) !== "directory") {
186
+ errors.push(`migrations names ${migrationsDir}, which is not a directory`);
187
+ return;
188
+ }
189
+ const names = (await readdir(dir)).filter((name) => name.endsWith(".sql")).sort();
190
+ if (names.length === 0) {
191
+ errors.push(`${migrationsDir} holds no .sql file`);
192
+ }
193
+ for (const name of names) {
194
+ if (!/^\d{4}-[a-z0-9-]+\.sql$/.test(name)) {
195
+ errors.push(`${migrationsDir}/${name} is not named NNNN-<words>.sql`);
196
+ }
197
+ }
198
+ }
199
+ async function checkWeb(root, manifest, webDir, errors, warnings) {
200
+ const dir = join(root, webDir);
201
+ if ((await exists(dir)) !== "directory") {
202
+ errors.push(`web names ${webDir}, which is not a directory: build the bundle first`);
203
+ return;
204
+ }
205
+ const script = await readFile(join(dir, "index.js"), "utf8").catch(() => null);
206
+ if (script === null) {
207
+ errors.push(`${webDir}/index.js is missing: the frame loads the bundle from there`);
208
+ }
209
+ else {
210
+ for (const problem of webBundleProblems(script)) {
211
+ errors.push(`${webDir}/index.js ${problem}`);
212
+ }
213
+ }
214
+ const css = await readFile(join(dir, "index.css"), "utf8").catch(() => null);
215
+ if (css !== null) {
216
+ if (/@import\s+(?:url\()?["']?(?:https?:)?\/\//.test(css) ||
217
+ /url\(\s*["']?(?:https?:)?\/\//.test(css)) {
218
+ errors.push(`${webDir}/index.css loads from elsewhere: a bundle is self-contained`);
219
+ }
220
+ const prefix = `pl-${manifest.key}-`;
221
+ const strangers = classesIn(css).filter((name) => !name.startsWith(prefix) && !name.startsWith("sc-"));
222
+ if (strangers.length > 0) {
223
+ warnings.push(`${webDir}/index.css styles ${strangers.slice(0, 5).join(", ")}${strangers.length > 5 ? ", ..." : ""}: a plugin's classes begin with ${prefix}`);
224
+ }
225
+ }
226
+ }
227
+ function describeCounts(manifest, description) {
228
+ const counts = [
229
+ `${manifest.pages.length} pages`,
230
+ `${manifest.widgets.length} widgets`,
231
+ `${manifest.settings.length} settings`,
232
+ `${Object.keys(manifest.roles).length} roles`,
233
+ ];
234
+ if (description !== null) {
235
+ 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`);
236
+ }
237
+ return counts.join(", ");
238
+ }
239
+ /** Reads the plugin at `root` as a console would, and says what it would refuse. */
240
+ export async function checkPlugin(root, loadServer) {
241
+ const errors = [];
242
+ const warnings = [];
243
+ if ((await exists(root)) !== "directory") {
244
+ return { ok: false, errors: [`${root} is not a directory`], warnings, summary: null };
245
+ }
246
+ const manifestRead = await readJson(join(root, "console-plugin.json"));
247
+ if ("problem" in manifestRead) {
248
+ return { ok: false, errors: [manifestRead.problem], warnings, summary: null };
249
+ }
250
+ const parsed = parsePluginManifest(manifestRead.value);
251
+ if (!parsed.ok) {
252
+ return {
253
+ ok: false,
254
+ errors: parsed.problems.map((problem) => `console-plugin.json: ${problem}`),
255
+ warnings,
256
+ summary: null,
257
+ };
258
+ }
259
+ const manifest = parsed.manifest;
260
+ if (!PLUGIN_API_MAJORS.includes(manifest.pluginApi)) {
261
+ errors.push(`console-plugin.json: pluginApi ${manifest.pluginApi} is not one this command knows (${PLUGIN_API_MAJORS.join(", ")}); write against ${CURRENT_PLUGIN_API}`);
262
+ }
263
+ const packageRead = await readJson(join(root, "package.json"));
264
+ let version = "0.0.0";
265
+ if ("problem" in packageRead) {
266
+ errors.push(packageRead.problem);
267
+ }
268
+ else {
269
+ const pkg = (typeof packageRead.value === "object" && packageRead.value !== null ? packageRead.value : {});
270
+ if (typeof pkg.name !== "string" || pkg.name.length === 0) {
271
+ errors.push("package.json: name is missing");
272
+ }
273
+ if (typeof pkg.version !== "string" ||
274
+ !/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(pkg.version)) {
275
+ errors.push("package.json: version is not a semver version");
276
+ }
277
+ else {
278
+ version = pkg.version;
279
+ }
280
+ if (typeof pkg.license !== "string" || !isPermissiveLicense(pkg.license)) {
281
+ errors.push(`package.json: license ${typeof pkg.license === "string" ? pkg.license : "(none)"} is not a permissive license (${PERMISSIVE_LICENSES.join(", ")})`);
282
+ }
283
+ if (pkg.type !== "module") {
284
+ errors.push('package.json: type is not "module"; the server module is ESM');
285
+ }
286
+ const scripts = (typeof pkg.scripts === "object" && pkg.scripts !== null ? pkg.scripts : {});
287
+ for (const hook of ["preinstall", "install", "postinstall"]) {
288
+ if (hook in scripts) {
289
+ errors.push(`package.json: has a ${hook} script; a plugin is installed with no install scripts`);
290
+ }
291
+ }
292
+ if (Array.isArray(pkg.files)) {
293
+ const files = pkg.files.filter((entry) => typeof entry === "string");
294
+ const shipped = [
295
+ "console-plugin.json",
296
+ manifest.server,
297
+ ...(manifest.web === undefined ? [] : [manifest.web]),
298
+ ...(manifest.skills === undefined ? [] : [manifest.skills, "SKILLCDN.md"]),
299
+ ...(manifest.migrations === undefined ? [] : [manifest.migrations]),
300
+ ];
301
+ for (const path of shipped) {
302
+ if (!coveredByFiles(files, path)) {
303
+ errors.push(`package.json: files leaves out ${path}, which the console reads`);
304
+ }
305
+ }
306
+ }
307
+ else {
308
+ warnings.push("package.json: has no files list; everything in the directory is published");
309
+ }
310
+ if (typeof pkg.private === "boolean" && pkg.private) {
311
+ warnings.push("package.json: is private; take that out to publish");
312
+ }
313
+ }
314
+ let description = null;
315
+ const serverPath = join(root, manifest.server);
316
+ if ((await exists(serverPath)) !== "file") {
317
+ errors.push(`server names ${manifest.server}, which is missing: build the server module first`);
318
+ }
319
+ else {
320
+ const source = await readFile(serverPath, "utf8");
321
+ for (const specifier of forbiddenImportsIn(source)) {
322
+ errors.push(`${manifest.server} imports ${specifier}, which the host refuses`);
323
+ }
324
+ for (const name of removedGlobalsIn(source)) {
325
+ errors.push(`${manifest.server} calls ${name}, which the host removes; the console is reached through ctx`);
326
+ }
327
+ const load = await loadServer(serverPath);
328
+ if (!load.ok) {
329
+ errors.push(`${manifest.server} does not load under the host's hardening: ${load.error}`);
330
+ for (const problem of load.problems) {
331
+ errors.push(`${manifest.server}: ${problem}`);
332
+ }
333
+ }
334
+ else {
335
+ description = load.description;
336
+ if (description.pluginApi !== manifest.pluginApi) {
337
+ errors.push(`${manifest.server} was built against plugin API ${description.pluginApi}; the manifest says ${manifest.pluginApi}`);
338
+ }
339
+ for (const problem of descriptionProblems(description, manifest)) {
340
+ errors.push(`${manifest.server}: ${problem}`);
341
+ }
342
+ if (manifest.capabilities.includes("endpoints") &&
343
+ Object.keys(description.endpoints).length === 0) {
344
+ warnings.push("console-plugin.json: asks the capability endpoints and the server module defines no endpoint");
345
+ }
346
+ if (manifest.capabilities.includes("jobs") && Object.keys(description.jobs).length === 0) {
347
+ warnings.push("console-plugin.json: asks the capability jobs and the server module defines no job");
348
+ }
349
+ }
350
+ }
351
+ if (manifest.web !== undefined) {
352
+ await checkWeb(root, manifest, manifest.web, errors, warnings);
353
+ }
354
+ let skills = 0;
355
+ if (manifest.skills !== undefined) {
356
+ skills = await checkSkills(root, manifest.skills, errors, warnings);
357
+ }
358
+ else {
359
+ warnings.push("console-plugin.json: names no skills; an agent learns the plugin from its command's help alone");
360
+ }
361
+ if (manifest.migrations !== undefined) {
362
+ await checkMigrations(root, manifest.migrations, errors);
363
+ }
364
+ else if (manifest.capabilities.includes("storage:sql")) {
365
+ warnings.push("console-plugin.json: asks storage:sql and names no migrations");
366
+ }
367
+ return {
368
+ ok: errors.length === 0,
369
+ errors,
370
+ warnings,
371
+ summary: `${manifest.key} ${version}: ${describeCounts(manifest, description)}, ${skills} skills`,
372
+ };
373
+ }
374
+ //# sourceMappingURL=plugin-check.js.map