@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
@@ -0,0 +1,70 @@
1
+ // How much a plugin may ask of a console (docs/specs/plugins.md, "Limits and refusals"): the
2
+ // bounds the manifest's schema, the definers, the host and the pages hold a plugin to. One source,
3
+ // so that `console-plugin check` says before an administrator finds out.
4
+ /** A plugin's name in one language, its description, and the sentence agents read with the rules. */
5
+ export const MAX_PLUGIN_NAME_LENGTH = 40;
6
+ export const MAX_PLUGIN_DESCRIPTION_LENGTH = 200;
7
+ export const MAX_PLUGIN_AGENT_NOTE_LENGTH = 200;
8
+ /** A plugin's key, a role's, a page's, a widget's, a setting's, a collection's, a command's: `^[a-z][a-z0-9-]{1,31}$`. */
9
+ export const MAX_PLUGIN_KEY_LENGTH = 32;
10
+ /** How many roles, settings, pages and widgets one manifest declares. */
11
+ export const MAX_PLUGIN_ROLES = 10;
12
+ export const MAX_PLUGIN_SETTINGS = 50;
13
+ export const MAX_PLUGIN_PAGES = 12;
14
+ export const MAX_PLUGIN_WIDGETS = 4;
15
+ /** How many collections, commands and queries together, endpoints, and indexes of one collection a server module defines. */
16
+ export const MAX_PLUGIN_COLLECTIONS = 50;
17
+ export const MAX_PLUGIN_OPERATIONS = 100;
18
+ export const MAX_PLUGIN_ENDPOINTS = 20;
19
+ export const MAX_PLUGIN_INDEXES = 8;
20
+ /** One line about a command, a query, a job or an argument, as help prints it. */
21
+ export const MAX_PLUGIN_ABOUT_LENGTH = 200;
22
+ /** The options of an `enum` setting or argument. */
23
+ export const MAX_PLUGIN_OPTIONS = 50;
24
+ /** A record, how many a plugin keeps, and how many versions one record keeps. */
25
+ export const MAX_PLUGIN_RECORD_BYTES = 64 * 1024;
26
+ export const MAX_PLUGIN_RECORDS = 100_000;
27
+ export const MAX_PLUGIN_RECORD_VERSIONS = 100;
28
+ /** A message between the host and the parent, a query's answer, an endpoint's answer. */
29
+ export const MAX_PLUGIN_MESSAGE_BYTES = 4 * 1024 * 1024;
30
+ /** What an endpoint takes in. */
31
+ export const MAX_PLUGIN_ENDPOINT_BODY_BYTES = 1024 * 1024;
32
+ /** The words of one command line sent to `invoke`, and the characters of one word. */
33
+ export const MAX_PLUGIN_ARGV_WORDS = 200;
34
+ export const MAX_PLUGIN_ARGV_WORD_LENGTH = 50_000;
35
+ /** The files one command takes at once. */
36
+ export const MAX_PLUGIN_COMMAND_FILES = 20;
37
+ /** An event of the plugin's own, how many are kept, and for how long. */
38
+ export const MAX_PLUGIN_EVENT_BYTES = 16 * 1024;
39
+ export const PLUGIN_EVENTS_KEPT = 100_000;
40
+ export const PLUGIN_EVENT_DAYS = 90;
41
+ /** How many records one page of a list carries at most. */
42
+ export const PLUGIN_LIST_LIMIT = 200;
43
+ /** How long plugin code may run: a command; a query or an endpoint; a hook; a job; `onEnable`, `onDisable` and an upgrade. */
44
+ export const PLUGIN_COMMAND_MS = 30_000;
45
+ export const PLUGIN_QUERY_MS = 10_000;
46
+ export const PLUGIN_ENDPOINT_MS = 10_000;
47
+ export const PLUGIN_HOOK_MS = 30_000;
48
+ export const PLUGIN_JOB_MS = 5 * 60_000;
49
+ export const PLUGIN_LIFECYCLE_MS = 10 * 60_000;
50
+ /** A job runs no more often than this. */
51
+ export const MIN_PLUGIN_JOB_INTERVAL_MS = 5 * 60_000;
52
+ /** Outbound requests a minute per plugin, the bytes of an answer, and its time. */
53
+ export const PLUGIN_OUTBOUND_PER_MINUTE = 60;
54
+ export const MAX_PLUGIN_OUTBOUND_BYTES = 10 * 1024 * 1024;
55
+ export const PLUGIN_OUTBOUND_MS = 10_000;
56
+ /** Webhook requests a minute per plugin. */
57
+ export const PLUGIN_WEBHOOKS_PER_MINUTE = 600;
58
+ /** Lines `ctx.log` writes a minute. */
59
+ export const PLUGIN_LOG_LINES_PER_MINUTE = 100;
60
+ /** SQL, with `storage:sql`: a statement's time, a result's rows, the connections of the plugin's role. */
61
+ export const PLUGIN_SQL_STATEMENT_MS = 10_000;
62
+ export const MAX_PLUGIN_SQL_ROWS = 10_000;
63
+ export const PLUGIN_SQL_CONNECTIONS = 4;
64
+ /** The memory a plugin's thread may hold, in megabytes, where the deployment says nothing. */
65
+ export const DEFAULT_PLUGIN_MEMORY_MB = 256;
66
+ /** How tall a widget's frame may grow, in pixels. */
67
+ export const MAX_PLUGIN_WIDGET_HEIGHT = 480;
68
+ /** How many retries a hook gets before its event is skipped with a `plugin.failed` event. */
69
+ export const PLUGIN_HOOK_RETRIES = 5;
70
+ //# sourceMappingURL=limits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.js","sourceRoot":"","sources":["../../src/plugin/limits.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,mGAAmG;AACnG,yEAAyE;AAEzE,qGAAqG;AACrG,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AACjD,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAChD,0HAA0H;AAC1H,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACxC,yEAAyE;AACzE,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AACpC,6HAA6H;AAC7H,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AACpC,kFAAkF;AAClF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAC3C,oDAAoD;AACpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AACrC,iFAAiF;AACjF,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,IAAI,CAAC;AACjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO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AAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAC9C,uCAAuC;AACvC,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAC/C,0GAA0G;AAC1G,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAC9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAC1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACxC,8FAA8F;AAC9F,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAC5C,qDAAqD;AACrD,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAC5C,6FAA6F;AAC7F,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface LoadOutcome {
2
+ readonly ok: boolean;
3
+ readonly description?: unknown;
4
+ readonly error?: string;
5
+ readonly problems?: readonly string[];
6
+ }
7
+ //# sourceMappingURL=load-worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-worker.d.ts","sourceRoot":"","sources":["../../src/plugin/load-worker.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC"}
@@ -0,0 +1,41 @@
1
+ // The thread a server module is loaded in to be described (docs/specs/plugins.md, "The host" and
2
+ // "Authoring"): hardened first, then the module imported and its default export described as
3
+ // JSON for the parent. `console-plugin check` runs this; the host loads plugins the same way and
4
+ // then keeps the thread. Nothing of the console is reachable from here: no database, no
5
+ // configuration, an empty environment.
6
+ import * as moduleApi from "node:module";
7
+ import { pathToFileURL } from "node:url";
8
+ import { parentPort, workerData } from "node:worker_threads";
9
+ import { describePlugin, isPluginDefinition } from "./define.js";
10
+ import { PluginDefinitionError } from "./definition-error.js";
11
+ import { hardenThread } from "./sandbox.js";
12
+ function errorText(error) {
13
+ if (error instanceof PluginDefinitionError) {
14
+ return { error: "the definition is invalid", problems: error.problems };
15
+ }
16
+ if (error instanceof Error) {
17
+ const code = error.code;
18
+ return { error: typeof code === "string" ? `${code}: ${error.message}` : error.message };
19
+ }
20
+ return { error: String(error) };
21
+ }
22
+ const { file } = workerData;
23
+ let outcome;
24
+ try {
25
+ if (typeof moduleApi.registerHooks !== "function") {
26
+ throw new Error("the host needs Node.js 24 or newer, which has module hooks that run in a thread");
27
+ }
28
+ hardenThread(moduleApi);
29
+ const loaded = (await import(pathToFileURL(file).href));
30
+ if (!isPluginDefinition(loaded.default)) {
31
+ outcome = { ok: false, error: "the default export is not what definePlugin({...}) yields" };
32
+ }
33
+ else {
34
+ outcome = { ok: true, description: describePlugin(loaded.default) };
35
+ }
36
+ }
37
+ catch (error) {
38
+ outcome = { ok: false, ...errorText(error) };
39
+ }
40
+ parentPort?.postMessage(outcome);
41
+ //# sourceMappingURL=load-worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-worker.js","sourceRoot":"","sources":["../../src/plugin/load-worker.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,6FAA6F;AAC7F,iGAAiG;AACjG,wFAAwF;AACxF,uCAAuC;AACvC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,YA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,CAAC;IACf,OAAO,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;AAC/C,CAAC;AACD,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { PluginDescription } from "./define.js";
2
+ export type ServerLoad = {
3
+ readonly ok: true;
4
+ readonly description: PluginDescription;
5
+ } | {
6
+ readonly ok: false;
7
+ readonly error: string;
8
+ readonly problems: readonly string[];
9
+ };
10
+ export interface LoadOptions {
11
+ /** How long the module gets to load; ten seconds unless said. */
12
+ readonly timeoutMs?: number;
13
+ /** The memory the thread may hold, in megabytes. */
14
+ readonly memoryMb?: number;
15
+ }
16
+ /** The description of the server module at `file`, loaded in a thread of its own under the host's hardening. */
17
+ export declare function loadServerModule(file: string, options?: LoadOptions): Promise<ServerLoad>;
18
+ //# sourceMappingURL=load.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/plugin/load.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAA;CAAE,GAC9D;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAEzF,MAAM,WAAW,WAAW;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAID,gHAAgH;AAChH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CA4D7F"}
@@ -0,0 +1,62 @@
1
+ // Loads a plugin's server module in a hardened worker thread and answers its description, or why
2
+ // it did not load. What `console-plugin check` does to a package; the host does the same before
3
+ // keeping the thread. Node only.
4
+ import { Worker } from "node:worker_threads";
5
+ import { DEFAULT_PLUGIN_MEMORY_MB } from "./limits.js";
6
+ const DEFAULT_LOAD_MS = 10_000;
7
+ /** The description of the server module at `file`, loaded in a thread of its own under the host's hardening. */
8
+ export function loadServerModule(file, options = {}) {
9
+ const timeoutMs = options.timeoutMs ?? DEFAULT_LOAD_MS;
10
+ return new Promise((resolve) => {
11
+ let settled = false;
12
+ const settle = (load) => {
13
+ if (!settled) {
14
+ settled = true;
15
+ clearTimeout(timer);
16
+ resolve(load);
17
+ }
18
+ };
19
+ const worker = new Worker(new URL("./load-worker.js", import.meta.url), {
20
+ workerData: { file },
21
+ env: {},
22
+ resourceLimits: { maxOldGenerationSizeMb: options.memoryMb ?? DEFAULT_PLUGIN_MEMORY_MB },
23
+ stdout: true,
24
+ stderr: true,
25
+ });
26
+ // What the module prints while loading goes nowhere: the check speaks for itself.
27
+ worker.stdout.resume();
28
+ worker.stderr.resume();
29
+ const timer = setTimeout(() => {
30
+ settle({
31
+ ok: false,
32
+ error: `the server module did not load within ${timeoutMs} ms`,
33
+ problems: [],
34
+ });
35
+ void worker.terminate();
36
+ }, timeoutMs);
37
+ worker.on("message", (outcome) => {
38
+ if (outcome.ok && outcome.description !== undefined) {
39
+ settle({ ok: true, description: outcome.description });
40
+ }
41
+ else {
42
+ settle({
43
+ ok: false,
44
+ error: outcome.error ?? "the server module did not load",
45
+ problems: outcome.problems ?? [],
46
+ });
47
+ }
48
+ void worker.terminate();
49
+ });
50
+ worker.on("error", (error) => {
51
+ settle({ ok: false, error: error.message, problems: [] });
52
+ });
53
+ worker.on("exit", (code) => {
54
+ settle({
55
+ ok: false,
56
+ error: `the server module's thread ended with ${code} before describing it`,
57
+ problems: [],
58
+ });
59
+ });
60
+ });
61
+ }
62
+ //# sourceMappingURL=load.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/plugin/load.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,gGAAgG;AAChG,iCAAiC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAavD,MAAM,eAAe,GAAG,MAAM,CAAC;AAE/B,gHAAgH;AAChH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,OAAO,GAAgB,EAAE;IACtE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,eAAe,CAAC;IACvD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,MAAM,MAAM,GAAG,CAAC,IAAgB,EAAE,EAAE;YAClC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,GAAG,IAAI,CAAC;gBACf,YAAY,CAAC,KAAK,CAAC,CAAC;gBACpB,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC;QACH,CAAC,CAAC;QACF,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,kBAAkB,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE;YACtE,UAAU,EAAE,EAAE,IAAI,EAAE;YACpB,GAAG,EAAE,EAAE;YACP,cAAc,EAAE,EAAE,sBAAsB,EAAE,OAAO,CAAC,QAAQ,IAAI,wBAAwB,EAAE;YACxF,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,IAAI;SACb,CAAC,CAAC;QACH,kFAAkF;QAClF,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACvB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACvB,MAAM,KAAK,GA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/mini";
2
+ /** A plugin's key, and every key within a plugin: a role's, a page's, a widget's, a setting's, a collection's, a command's. */
3
+ export declare const PLUGIN_KEY_PATTERN: RegExp;
4
+ export declare function isPluginKey(value: string): boolean;
5
+ /** The majors of the plugin API this package speaks, and the one a new plugin is written against. */
6
+ export declare const PLUGIN_API_MAJORS: readonly [1];
7
+ export declare const CURRENT_PLUGIN_API = 1;
8
+ /**
9
+ * Words no plugin's key may be: the console's own paths and the command's own words, so that
10
+ * `/plugins/<key>` and `console plugin <key>` never read as something else.
11
+ */
12
+ export declare const RESERVED_PLUGIN_KEYS: readonly string[];
13
+ /** Words a page's key may not be: the routes beside the pages under a plugin's path. */
14
+ export declare const RESERVED_PAGE_KEYS: readonly string[];
15
+ /** Words an argument may not be named: the flags `console plugin <key> <command>` keeps for itself. */
16
+ export declare const RESERVED_ARG_NAMES: readonly string[];
17
+ /** Words a command's or a query's name may not be: the subcommands of `console plugin <key>`. */
18
+ export declare const RESERVED_COMMAND_NAMES: readonly string[];
19
+ /** The groups of tabs the console knows; a plugin may declare another, with a name. */
20
+ export declare const PLUGIN_MENU_GROUPS: readonly ["people", "customers", "money", "operations", "marketing", "engineering", "reports"];
21
+ export type PluginMenuGroup = (typeof PLUGIN_MENU_GROUPS)[number];
22
+ export declare const PLUGIN_SETTING_TYPES: readonly ["text", "markdown", "number", "boolean", "enum", "day", "person", "project", "secret", "list"];
23
+ export type PluginSettingType = (typeof PLUGIN_SETTING_TYPES)[number];
24
+ export declare const PLUGIN_PAGE_LEVELS: readonly ["workspace", "project"];
25
+ export type PluginPageLevel = (typeof PLUGIN_PAGE_LEVELS)[number];
26
+ export declare const PLUGIN_WIDGET_PLACES: readonly ["home:top", "home:bottom"];
27
+ export type PluginWidgetPlace = (typeof PLUGIN_WIDGET_PLACES)[number];
28
+ export declare const PLUGIN_WIDGET_SIZES: readonly ["third", "half", "full"];
29
+ export type PluginWidgetSize = (typeof PLUGIN_WIDGET_SIZES)[number];
30
+ export declare const PLUGIN_BOARD_NEEDS: readonly ["required", "optional", "none"];
31
+ export type PluginBoardNeeds = (typeof PLUGIN_BOARD_NEEDS)[number];
32
+ /** A text per language, `en` always among them. */
33
+ export type Localized = Readonly<Record<string, string>>;
34
+ /** A setting's key, as code and `--set` name it: a lowercase letter, then letters and digits. */
35
+ export declare const SETTING_KEY_PATTERN: RegExp;
36
+ declare const pluginSettingSchema: z.ZodMiniObject<{
37
+ key: z.ZodMiniString<string>;
38
+ type: z.ZodMiniEnum<{
39
+ boolean: "boolean";
40
+ day: "day";
41
+ enum: "enum";
42
+ list: "list";
43
+ markdown: "markdown";
44
+ number: "number";
45
+ person: "person";
46
+ project: "project";
47
+ secret: "secret";
48
+ text: "text";
49
+ }>;
50
+ name: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
51
+ description: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
52
+ required: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
53
+ default: z.ZodMiniOptional<z.ZodMiniUnknown>;
54
+ min: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
55
+ max: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
56
+ options: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
57
+ value: z.ZodMiniString<string>;
58
+ name: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
59
+ }, z.core.$strict>>>;
60
+ of: z.ZodMiniOptional<z.ZodMiniEnum<{
61
+ boolean: "boolean";
62
+ day: "day";
63
+ enum: "enum";
64
+ markdown: "markdown";
65
+ number: "number";
66
+ person: "person";
67
+ project: "project";
68
+ text: "text";
69
+ }>>;
70
+ }, z.core.$strict>;
71
+ export type PluginSetting = z.infer<typeof pluginSettingSchema>;
72
+ declare const pluginPageSchema: z.ZodMiniObject<{
73
+ key: z.ZodMiniString<string>;
74
+ name: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
75
+ level: z.ZodMiniEnum<{
76
+ project: "project";
77
+ workspace: "workspace";
78
+ }>;
79
+ roles: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
80
+ wide: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
81
+ }, z.core.$strict>;
82
+ export type PluginPage = z.infer<typeof pluginPageSchema>;
83
+ declare const pluginWidgetSchema: z.ZodMiniObject<{
84
+ key: z.ZodMiniString<string>;
85
+ name: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
86
+ place: z.ZodMiniEnum<{
87
+ "home:bottom": "home:bottom";
88
+ "home:top": "home:top";
89
+ }>;
90
+ size: z.ZodMiniEnum<{
91
+ full: "full";
92
+ half: "half";
93
+ third: "third";
94
+ }>;
95
+ roles: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
96
+ }, z.core.$strict>;
97
+ export type PluginWidget = z.infer<typeof pluginWidgetSchema>;
98
+ declare const pluginMenuSchema: z.ZodMiniObject<{
99
+ group: z.ZodMiniString<string>;
100
+ order: z.ZodMiniOptional<z.ZodMiniInt>;
101
+ name: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
102
+ }, z.core.$strict>;
103
+ export type PluginMenu = z.infer<typeof pluginMenuSchema>;
104
+ declare const pluginBoardSchema: z.ZodMiniObject<{
105
+ needs: z.ZodMiniEnum<{
106
+ none: "none";
107
+ optional: "optional";
108
+ required: "required";
109
+ }>;
110
+ defaults: z.ZodMiniOptional<z.ZodMiniObject<{
111
+ key: z.ZodMiniString<string>;
112
+ name: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
113
+ description: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
114
+ }, z.core.$strict>>;
115
+ }, z.core.$strict>;
116
+ export type PluginBoard = z.infer<typeof pluginBoardSchema>;
117
+ declare const pluginRoleSchema: z.ZodMiniObject<{
118
+ name: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
119
+ description: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
120
+ }, z.core.$strict>;
121
+ export type PluginRole = z.infer<typeof pluginRoleSchema>;
122
+ /** The manifest as a plugin writes it; `parsePluginManifest` fills what it leaves out. */
123
+ export declare const pluginManifestSchema: z.ZodMiniObject<{
124
+ key: z.ZodMiniString<string>;
125
+ name: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
126
+ description: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
127
+ agentNote: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
128
+ pluginApi: z.ZodMiniInt;
129
+ server: z.ZodMiniString<string>;
130
+ web: z.ZodMiniOptional<z.ZodMiniString<string>>;
131
+ skills: z.ZodMiniOptional<z.ZodMiniString<string>>;
132
+ migrations: z.ZodMiniOptional<z.ZodMiniString<string>>;
133
+ capabilities: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniString<string>>>;
134
+ roles: z.ZodMiniDefault<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
135
+ name: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
136
+ description: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
137
+ }, z.core.$strict>>>;
138
+ defaultRole: z.ZodMiniOptional<z.ZodMiniString<string>>;
139
+ requires: z.ZodMiniDefault<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
140
+ board: z.ZodMiniDefault<z.ZodMiniObject<{
141
+ needs: z.ZodMiniEnum<{
142
+ none: "none";
143
+ optional: "optional";
144
+ required: "required";
145
+ }>;
146
+ defaults: z.ZodMiniOptional<z.ZodMiniObject<{
147
+ key: z.ZodMiniString<string>;
148
+ name: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
149
+ description: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
150
+ }, z.core.$strict>>;
151
+ }, z.core.$strict>>;
152
+ settings: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniObject<{
153
+ key: z.ZodMiniString<string>;
154
+ type: z.ZodMiniEnum<{
155
+ boolean: "boolean";
156
+ day: "day";
157
+ enum: "enum";
158
+ list: "list";
159
+ markdown: "markdown";
160
+ number: "number";
161
+ person: "person";
162
+ project: "project";
163
+ secret: "secret";
164
+ text: "text";
165
+ }>;
166
+ name: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
167
+ description: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
168
+ required: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
169
+ default: z.ZodMiniOptional<z.ZodMiniUnknown>;
170
+ min: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
171
+ max: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
172
+ options: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
173
+ value: z.ZodMiniString<string>;
174
+ name: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
175
+ }, z.core.$strict>>>;
176
+ of: z.ZodMiniOptional<z.ZodMiniEnum<{
177
+ boolean: "boolean";
178
+ day: "day";
179
+ enum: "enum";
180
+ markdown: "markdown";
181
+ number: "number";
182
+ person: "person";
183
+ project: "project";
184
+ text: "text";
185
+ }>>;
186
+ }, z.core.$strict>>>;
187
+ menu: z.ZodMiniOptional<z.ZodMiniObject<{
188
+ group: z.ZodMiniString<string>;
189
+ order: z.ZodMiniOptional<z.ZodMiniInt>;
190
+ name: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
191
+ }, z.core.$strict>>;
192
+ pages: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniObject<{
193
+ key: z.ZodMiniString<string>;
194
+ name: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
195
+ level: z.ZodMiniEnum<{
196
+ project: "project";
197
+ workspace: "workspace";
198
+ }>;
199
+ roles: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
200
+ wide: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
201
+ }, z.core.$strict>>>;
202
+ widgets: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniObject<{
203
+ key: z.ZodMiniString<string>;
204
+ name: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
205
+ place: z.ZodMiniEnum<{
206
+ "home:bottom": "home:bottom";
207
+ "home:top": "home:top";
208
+ }>;
209
+ size: z.ZodMiniEnum<{
210
+ full: "full";
211
+ half: "half";
212
+ third: "third";
213
+ }>;
214
+ roles: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
215
+ }, z.core.$strict>>>;
216
+ dataVersion: z.ZodMiniDefault<z.ZodMiniInt>;
217
+ store: z.ZodMiniOptional<z.ZodMiniObject<{
218
+ homepage: z.ZodMiniOptional<z.ZodMiniString<string>>;
219
+ repository: z.ZodMiniOptional<z.ZodMiniString<string>>;
220
+ keywords: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
221
+ icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
222
+ }, z.core.$strict>>;
223
+ }, z.core.$strict>;
224
+ export type PluginManifest = z.infer<typeof pluginManifestSchema>;
225
+ export type ManifestParse = {
226
+ readonly ok: true;
227
+ readonly manifest: PluginManifest;
228
+ } | {
229
+ readonly ok: false;
230
+ readonly problems: readonly string[];
231
+ };
232
+ /** The manifest from what `console-plugin.json` held, filled in, or every problem with it in words. */
233
+ export declare function parsePluginManifest(value: unknown): ManifestParse;
234
+ /** The text in the person's language, else in English, else the first there is. */
235
+ export declare function localizedText(texts: Localized, language: string): string;
236
+ export {};
237
+ //# sourceMappingURL=manifest.d.ts.map
@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