@iksnerd/blazon 0.0.0-stage → 0.1.0

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 (503) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +264 -2
  3. package/THIRD-PARTY-NOTICES.md +60 -0
  4. package/bin/blazon.js +4 -0
  5. package/dist/builder/site-builder.d.ts +10 -0
  6. package/dist/builder/site-builder.d.ts.map +1 -0
  7. package/dist/chunks/site-builder-vpzUWoiA.js +13777 -0
  8. package/dist/cli/commands/approvals.d.ts +8 -0
  9. package/dist/cli/commands/approvals.d.ts.map +1 -0
  10. package/dist/cli/commands/build.d.ts +8 -0
  11. package/dist/cli/commands/build.d.ts.map +1 -0
  12. package/dist/cli/commands/check.d.ts +33 -0
  13. package/dist/cli/commands/check.d.ts.map +1 -0
  14. package/dist/cli/commands/cwd.d.ts +14 -0
  15. package/dist/cli/commands/cwd.d.ts.map +1 -0
  16. package/dist/cli/commands/dev.d.ts +5 -0
  17. package/dist/cli/commands/dev.d.ts.map +1 -0
  18. package/dist/cli/commands/doctor.d.ts +34 -0
  19. package/dist/cli/commands/doctor.d.ts.map +1 -0
  20. package/dist/cli/commands/drift.d.ts +11 -0
  21. package/dist/cli/commands/drift.d.ts.map +1 -0
  22. package/dist/cli/commands/explain.d.ts +5 -0
  23. package/dist/cli/commands/explain.d.ts.map +1 -0
  24. package/dist/cli/commands/init.d.ts +46 -0
  25. package/dist/cli/commands/init.d.ts.map +1 -0
  26. package/dist/cli/commands/mcp-check.d.ts +57 -0
  27. package/dist/cli/commands/mcp-check.d.ts.map +1 -0
  28. package/dist/cli/commands/mcp.d.ts +13 -0
  29. package/dist/cli/commands/mcp.d.ts.map +1 -0
  30. package/dist/cli/commands/pin.d.ts +7 -0
  31. package/dist/cli/commands/pin.d.ts.map +1 -0
  32. package/dist/cli/commands/plugin.d.ts +32 -0
  33. package/dist/cli/commands/plugin.d.ts.map +1 -0
  34. package/dist/cli/commands/preview.d.ts +5 -0
  35. package/dist/cli/commands/preview.d.ts.map +1 -0
  36. package/dist/cli/commands/tokens.d.ts +5 -0
  37. package/dist/cli/commands/tokens.d.ts.map +1 -0
  38. package/dist/cli/errors.d.ts +53 -0
  39. package/dist/cli/errors.d.ts.map +1 -0
  40. package/dist/cli/handlers/brand.d.ts +7 -0
  41. package/dist/cli/handlers/brand.d.ts.map +1 -0
  42. package/dist/cli/handlers/can.d.ts +7 -0
  43. package/dist/cli/handlers/can.d.ts.map +1 -0
  44. package/dist/cli/handlers/fonts.d.ts +4 -0
  45. package/dist/cli/handlers/fonts.d.ts.map +1 -0
  46. package/dist/cli/handlers/get.d.ts +7 -0
  47. package/dist/cli/handlers/get.d.ts.map +1 -0
  48. package/dist/cli/handlers/index.d.ts +8 -0
  49. package/dist/cli/handlers/index.d.ts.map +1 -0
  50. package/dist/cli/handlers/list.d.ts +7 -0
  51. package/dist/cli/handlers/list.d.ts.map +1 -0
  52. package/dist/cli/handlers/logo.d.ts +4 -0
  53. package/dist/cli/handlers/logo.d.ts.map +1 -0
  54. package/dist/cli/handlers/rules.d.ts +10 -0
  55. package/dist/cli/handlers/rules.d.ts.map +1 -0
  56. package/dist/cli/handlers/types.d.ts +17 -0
  57. package/dist/cli/handlers/types.d.ts.map +1 -0
  58. package/dist/cli/help.d.ts +18 -0
  59. package/dist/cli/help.d.ts.map +1 -0
  60. package/dist/cli/index.d.ts +2 -0
  61. package/dist/cli/index.d.ts.map +1 -0
  62. package/dist/cli/index.js +3850 -0
  63. package/dist/cli/init-flow.d.ts +24 -0
  64. package/dist/cli/init-flow.d.ts.map +1 -0
  65. package/dist/cli/init-ui.d.ts +20 -0
  66. package/dist/cli/init-ui.d.ts.map +1 -0
  67. package/dist/cli/json.d.ts +18 -0
  68. package/dist/cli/json.d.ts.map +1 -0
  69. package/dist/cli/operations.d.ts +11 -0
  70. package/dist/cli/operations.d.ts.map +1 -0
  71. package/dist/cli/options.d.ts +8 -0
  72. package/dist/cli/options.d.ts.map +1 -0
  73. package/dist/cli/project.d.ts +8 -0
  74. package/dist/cli/project.d.ts.map +1 -0
  75. package/dist/cli/read.d.ts +13 -0
  76. package/dist/cli/read.d.ts.map +1 -0
  77. package/dist/cli/where.d.ts +10 -0
  78. package/dist/cli/where.d.ts.map +1 -0
  79. package/dist/core/assets/categories.d.ts +47 -0
  80. package/dist/core/assets/categories.d.ts.map +1 -0
  81. package/dist/core/assets/fields.d.ts +12 -0
  82. package/dist/core/assets/fields.d.ts.map +1 -0
  83. package/dist/core/assets/image-size.d.ts +10 -0
  84. package/dist/core/assets/image-size.d.ts.map +1 -0
  85. package/dist/core/assets/measure.d.ts +22 -0
  86. package/dist/core/assets/measure.d.ts.map +1 -0
  87. package/dist/core/assets/scanner.d.ts +26 -0
  88. package/dist/core/assets/scanner.d.ts.map +1 -0
  89. package/dist/core/assets/sidecar.d.ts +22 -0
  90. package/dist/core/assets/sidecar.d.ts.map +1 -0
  91. package/dist/core/blazon-pin.d.ts +36 -0
  92. package/dist/core/blazon-pin.d.ts.map +1 -0
  93. package/dist/core/brand/export.d.ts +128 -0
  94. package/dist/core/brand/export.d.ts.map +1 -0
  95. package/dist/core/brand/schema.d.ts +1000 -0
  96. package/dist/core/brand/schema.d.ts.map +1 -0
  97. package/dist/core/brand-theme.d.ts +16 -0
  98. package/dist/core/brand-theme.d.ts.map +1 -0
  99. package/dist/core/checker/approvals.d.ts +15 -0
  100. package/dist/core/checker/approvals.d.ts.map +1 -0
  101. package/dist/core/checker/cascade.d.ts +8 -0
  102. package/dist/core/checker/cascade.d.ts.map +1 -0
  103. package/dist/core/checker/catalogue.d.ts +593 -0
  104. package/dist/core/checker/catalogue.d.ts.map +1 -0
  105. package/dist/core/checker/contrast.d.ts +30 -0
  106. package/dist/core/checker/contrast.d.ts.map +1 -0
  107. package/dist/core/checker/duplicates.d.ts +3 -0
  108. package/dist/core/checker/duplicates.d.ts.map +1 -0
  109. package/dist/core/checker/fixes.d.ts +6 -0
  110. package/dist/core/checker/fixes.d.ts.map +1 -0
  111. package/dist/core/checker/font-meta.d.ts +8 -0
  112. package/dist/core/checker/font-meta.d.ts.map +1 -0
  113. package/dist/core/checker/index.d.ts +23 -0
  114. package/dist/core/checker/index.d.ts.map +1 -0
  115. package/dist/core/checker/location.d.ts +7 -0
  116. package/dist/core/checker/location.d.ts.map +1 -0
  117. package/dist/core/checker/logo-rules.d.ts +19 -0
  118. package/dist/core/checker/logo-rules.d.ts.map +1 -0
  119. package/dist/core/checker/logo-surfaces.d.ts +7 -0
  120. package/dist/core/checker/logo-surfaces.d.ts.map +1 -0
  121. package/dist/core/checker/page-tokens.d.ts +5 -0
  122. package/dist/core/checker/page-tokens.d.ts.map +1 -0
  123. package/dist/core/checker/print.d.ts +9 -0
  124. package/dist/core/checker/print.d.ts.map +1 -0
  125. package/dist/core/checker/proportion.d.ts +3 -0
  126. package/dist/core/checker/proportion.d.ts.map +1 -0
  127. package/dist/core/checker/review.d.ts +40 -0
  128. package/dist/core/checker/review.d.ts.map +1 -0
  129. package/dist/core/checker/source.d.ts +4 -0
  130. package/dist/core/checker/source.d.ts.map +1 -0
  131. package/dist/core/checker/spdx.d.ts +8 -0
  132. package/dist/core/checker/spdx.d.ts.map +1 -0
  133. package/dist/core/checker/tier.d.ts +3 -0
  134. package/dist/core/checker/tier.d.ts.map +1 -0
  135. package/dist/core/checker/usage.d.ts +4 -0
  136. package/dist/core/checker/usage.d.ts.map +1 -0
  137. package/dist/core/checker/variables.d.ts +8 -0
  138. package/dist/core/checker/variables.d.ts.map +1 -0
  139. package/dist/core/colors.d.ts +10 -0
  140. package/dist/core/colors.d.ts.map +1 -0
  141. package/dist/core/config/defaults.d.ts +3 -0
  142. package/dist/core/config/defaults.d.ts.map +1 -0
  143. package/dist/core/config/index.d.ts +15 -0
  144. package/dist/core/config/index.d.ts.map +1 -0
  145. package/dist/core/config/validate.d.ts +21 -0
  146. package/dist/core/config/validate.d.ts.map +1 -0
  147. package/dist/core/config/vocabulary.d.ts +10 -0
  148. package/dist/core/config/vocabulary.d.ts.map +1 -0
  149. package/dist/core/confine.d.ts +25 -0
  150. package/dist/core/confine.d.ts.map +1 -0
  151. package/dist/core/docs/directives.d.ts +152 -0
  152. package/dist/core/docs/directives.d.ts.map +1 -0
  153. package/dist/core/docs/parser.d.ts +7 -0
  154. package/dist/core/docs/parser.d.ts.map +1 -0
  155. package/dist/core/docs/sections.d.ts +11 -0
  156. package/dist/core/docs/sections.d.ts.map +1 -0
  157. package/dist/core/drift/compare.d.ts +30 -0
  158. package/dist/core/drift/compare.d.ts.map +1 -0
  159. package/dist/core/drift/read.d.ts +22 -0
  160. package/dist/core/drift/read.d.ts.map +1 -0
  161. package/dist/core/email-signature.d.ts +35 -0
  162. package/dist/core/email-signature.d.ts.map +1 -0
  163. package/dist/core/emit.d.ts +22 -0
  164. package/dist/core/emit.d.ts.map +1 -0
  165. package/dist/core/fonts.d.ts +43 -0
  166. package/dist/core/fonts.d.ts.map +1 -0
  167. package/dist/core/icons/icon-sets.d.ts +22 -0
  168. package/dist/core/icons/icon-sets.d.ts.map +1 -0
  169. package/dist/core/index.d.ts +9 -0
  170. package/dist/core/index.d.ts.map +1 -0
  171. package/dist/core/init/answers.d.ts +45 -0
  172. package/dist/core/init/answers.d.ts.map +1 -0
  173. package/dist/core/init/from-site/apply.d.ts +7 -0
  174. package/dist/core/init/from-site/apply.d.ts.map +1 -0
  175. package/dist/core/init/from-site/clean-colors.d.ts +21 -0
  176. package/dist/core/init/from-site/clean-colors.d.ts.map +1 -0
  177. package/dist/core/init/from-site/colors.d.ts +10 -0
  178. package/dist/core/init/from-site/colors.d.ts.map +1 -0
  179. package/dist/core/init/from-site/context.d.ts +24 -0
  180. package/dist/core/init/from-site/context.d.ts.map +1 -0
  181. package/dist/core/init/from-site/fonts.d.ts +10 -0
  182. package/dist/core/init/from-site/fonts.d.ts.map +1 -0
  183. package/dist/core/init/from-site/html.d.ts +10 -0
  184. package/dist/core/init/from-site/html.d.ts.map +1 -0
  185. package/dist/core/init/from-site/index.d.ts +6 -0
  186. package/dist/core/init/from-site/index.d.ts.map +1 -0
  187. package/dist/core/init/from-site/inspect.d.ts +4 -0
  188. package/dist/core/init/from-site/inspect.d.ts.map +1 -0
  189. package/dist/core/init/from-site/logo.d.ts +20 -0
  190. package/dist/core/init/from-site/logo.d.ts.map +1 -0
  191. package/dist/core/init/from-site/sections/colors.d.ts +4 -0
  192. package/dist/core/init/from-site/sections/colors.d.ts.map +1 -0
  193. package/dist/core/init/from-site/sections/config.d.ts +10 -0
  194. package/dist/core/init/from-site/sections/config.d.ts.map +1 -0
  195. package/dist/core/init/from-site/sections/directives.d.ts +3 -0
  196. package/dist/core/init/from-site/sections/directives.d.ts.map +1 -0
  197. package/dist/core/init/from-site/sections/fonts.d.ts +8 -0
  198. package/dist/core/init/from-site/sections/fonts.d.ts.map +1 -0
  199. package/dist/core/init/from-site/sections/intro.d.ts +4 -0
  200. package/dist/core/init/from-site/sections/intro.d.ts.map +1 -0
  201. package/dist/core/init/from-site/sections/logo.d.ts +9 -0
  202. package/dist/core/init/from-site/sections/logo.d.ts.map +1 -0
  203. package/dist/core/init/from-site/sections/placeholder.d.ts +5 -0
  204. package/dist/core/init/from-site/sections/placeholder.d.ts.map +1 -0
  205. package/dist/core/init/from-site/tree.d.ts +14 -0
  206. package/dist/core/init/from-site/tree.d.ts.map +1 -0
  207. package/dist/core/init/from-site/types.d.ts +37 -0
  208. package/dist/core/init/from-site/types.d.ts.map +1 -0
  209. package/dist/core/init/palette.d.ts +34 -0
  210. package/dist/core/init/palette.d.ts.map +1 -0
  211. package/dist/core/init/prompts.d.ts +78 -0
  212. package/dist/core/init/prompts.d.ts.map +1 -0
  213. package/dist/core/init/shared/google-fonts.d.ts +4 -0
  214. package/dist/core/init/shared/google-fonts.d.ts.map +1 -0
  215. package/dist/core/init/shared/hex.d.ts +6 -0
  216. package/dist/core/init/shared/hex.d.ts.map +1 -0
  217. package/dist/core/init/shared/svg.d.ts +3 -0
  218. package/dist/core/init/shared/svg.d.ts.map +1 -0
  219. package/dist/core/init/vocabulary.d.ts +42 -0
  220. package/dist/core/init/vocabulary.d.ts.map +1 -0
  221. package/dist/core/inputs.d.ts +25 -0
  222. package/dist/core/inputs.d.ts.map +1 -0
  223. package/dist/core/logo/lockup.d.ts +54 -0
  224. package/dist/core/logo/lockup.d.ts.map +1 -0
  225. package/dist/core/logo.d.ts +23 -0
  226. package/dist/core/logo.d.ts.map +1 -0
  227. package/dist/core/mcp-config.d.ts +65 -0
  228. package/dist/core/mcp-config.d.ts.map +1 -0
  229. package/dist/core/operations/check.d.ts +8 -0
  230. package/dist/core/operations/check.d.ts.map +1 -0
  231. package/dist/core/operations/index.d.ts +7 -0
  232. package/dist/core/operations/index.d.ts.map +1 -0
  233. package/dist/core/operations/limits.d.ts +6 -0
  234. package/dist/core/operations/limits.d.ts.map +1 -0
  235. package/dist/core/operations/list.d.ts +8 -0
  236. package/dist/core/operations/list.d.ts.map +1 -0
  237. package/dist/core/operations/project.d.ts +10 -0
  238. package/dist/core/operations/project.d.ts.map +1 -0
  239. package/dist/core/operations/types.d.ts +96 -0
  240. package/dist/core/operations/types.d.ts.map +1 -0
  241. package/dist/core/operations/validate.d.ts +4 -0
  242. package/dist/core/operations/validate.d.ts.map +1 -0
  243. package/dist/core/order.d.ts +9 -0
  244. package/dist/core/order.d.ts.map +1 -0
  245. package/dist/core/outputs.d.ts +22 -0
  246. package/dist/core/outputs.d.ts.map +1 -0
  247. package/dist/core/package-name.d.ts +3 -0
  248. package/dist/core/package-name.d.ts.map +1 -0
  249. package/dist/core/package-root.d.ts +3 -0
  250. package/dist/core/package-root.d.ts.map +1 -0
  251. package/dist/core/plugin-name.d.ts +27 -0
  252. package/dist/core/plugin-name.d.ts.map +1 -0
  253. package/dist/core/preflight.d.ts +10 -0
  254. package/dist/core/preflight.d.ts.map +1 -0
  255. package/dist/core/read/can.d.ts +44 -0
  256. package/dist/core/read/can.d.ts.map +1 -0
  257. package/dist/core/read/fonts.d.ts +47 -0
  258. package/dist/core/read/fonts.d.ts.map +1 -0
  259. package/dist/core/read/index.d.ts +8 -0
  260. package/dist/core/read/index.d.ts.map +1 -0
  261. package/dist/core/read/list.d.ts +28 -0
  262. package/dist/core/read/list.d.ts.map +1 -0
  263. package/dist/core/read/logo.d.ts +34 -0
  264. package/dist/core/read/logo.d.ts.map +1 -0
  265. package/dist/core/read/lookup.d.ts +9 -0
  266. package/dist/core/read/lookup.d.ts.map +1 -0
  267. package/dist/core/read/rules.d.ts +80 -0
  268. package/dist/core/read/rules.d.ts.map +1 -0
  269. package/dist/core/read/token.d.ts +46 -0
  270. package/dist/core/read/token.d.ts.map +1 -0
  271. package/dist/core/shipped-names.d.ts +9 -0
  272. package/dist/core/shipped-names.d.ts.map +1 -0
  273. package/dist/core/starter.d.ts +31 -0
  274. package/dist/core/starter.d.ts.map +1 -0
  275. package/dist/core/suggest.d.ts +7 -0
  276. package/dist/core/suggest.d.ts.map +1 -0
  277. package/dist/core/tokens/alias.d.ts +18 -0
  278. package/dist/core/tokens/alias.d.ts.map +1 -0
  279. package/dist/core/tokens/contexts.d.ts +10 -0
  280. package/dist/core/tokens/contexts.d.ts.map +1 -0
  281. package/dist/core/tokens/formatters/css.d.ts +15 -0
  282. package/dist/core/tokens/formatters/css.d.ts.map +1 -0
  283. package/dist/core/tokens/formatters/json.d.ts +4 -0
  284. package/dist/core/tokens/formatters/json.d.ts.map +1 -0
  285. package/dist/core/tokens/formatters/tailwind.d.ts +37 -0
  286. package/dist/core/tokens/formatters/tailwind.d.ts.map +1 -0
  287. package/dist/core/tokens/formatters/ts.d.ts +6 -0
  288. package/dist/core/tokens/formatters/ts.d.ts.map +1 -0
  289. package/dist/core/tokens/groups.d.ts +44 -0
  290. package/dist/core/tokens/groups.d.ts.map +1 -0
  291. package/dist/core/tokens/key-lines.d.ts +8 -0
  292. package/dist/core/tokens/key-lines.d.ts.map +1 -0
  293. package/dist/core/tokens/load.d.ts +12 -0
  294. package/dist/core/tokens/load.d.ts.map +1 -0
  295. package/dist/core/tokens/merge.d.ts +17 -0
  296. package/dist/core/tokens/merge.d.ts.map +1 -0
  297. package/dist/core/tokens/names.d.ts +5 -0
  298. package/dist/core/tokens/names.d.ts.map +1 -0
  299. package/dist/core/tokens/resolve.d.ts +8 -0
  300. package/dist/core/tokens/resolve.d.ts.map +1 -0
  301. package/dist/core/tokens/resolver/compile.d.ts +17 -0
  302. package/dist/core/tokens/resolver/compile.d.ts.map +1 -0
  303. package/dist/core/tokens/resolver/inputs.d.ts +7 -0
  304. package/dist/core/tokens/resolver/inputs.d.ts.map +1 -0
  305. package/dist/core/tokens/resolver/parse.d.ts +34 -0
  306. package/dist/core/tokens/resolver/parse.d.ts.map +1 -0
  307. package/dist/core/tokens/resolver/sources.d.ts +17 -0
  308. package/dist/core/tokens/resolver/sources.d.ts.map +1 -0
  309. package/dist/core/tokens/shadcn.d.ts +43 -0
  310. package/dist/core/tokens/shadcn.d.ts.map +1 -0
  311. package/dist/core/tokens/theme.d.ts +17 -0
  312. package/dist/core/tokens/theme.d.ts.map +1 -0
  313. package/dist/core/tokens/values/color.d.ts +2 -0
  314. package/dist/core/tokens/values/color.d.ts.map +1 -0
  315. package/dist/core/tokens/values/composite.d.ts +7 -0
  316. package/dist/core/tokens/values/composite.d.ts.map +1 -0
  317. package/dist/core/tokens/values/font.d.ts +3 -0
  318. package/dist/core/tokens/values/font.d.ts.map +1 -0
  319. package/dist/core/tokens/values/index.d.ts +9 -0
  320. package/dist/core/tokens/values/index.d.ts.map +1 -0
  321. package/dist/core/tokens/values/shared.d.ts +5 -0
  322. package/dist/core/tokens/values/shared.d.ts.map +1 -0
  323. package/dist/core/tokens/values/simple.d.ts +3 -0
  324. package/dist/core/tokens/values/simple.d.ts.map +1 -0
  325. package/dist/core/tokens/values/units.d.ts +3 -0
  326. package/dist/core/tokens/values/units.d.ts.map +1 -0
  327. package/dist/core/tokens/walk.d.ts +30 -0
  328. package/dist/core/tokens/walk.d.ts.map +1 -0
  329. package/dist/core/version.d.ts +3 -0
  330. package/dist/core/version.d.ts.map +1 -0
  331. package/dist/index.d.ts +27 -0
  332. package/dist/index.d.ts.map +1 -0
  333. package/dist/index.js +40 -0
  334. package/dist/plugins/host/admit.d.ts +35 -0
  335. package/dist/plugins/host/admit.d.ts.map +1 -0
  336. package/dist/plugins/host/call.d.ts +59 -0
  337. package/dist/plugins/host/call.d.ts.map +1 -0
  338. package/dist/plugins/host/check.d.ts +54 -0
  339. package/dist/plugins/host/check.d.ts.map +1 -0
  340. package/dist/plugins/host/scrub.d.ts +17 -0
  341. package/dist/plugins/host/scrub.d.ts.map +1 -0
  342. package/dist/plugins/index.d.ts +14 -0
  343. package/dist/plugins/index.d.ts.map +1 -0
  344. package/dist/plugins/pins/interpreter.d.ts +49 -0
  345. package/dist/plugins/pins/interpreter.d.ts.map +1 -0
  346. package/dist/plugins/pins/lock.d.ts +47 -0
  347. package/dist/plugins/pins/lock.d.ts.map +1 -0
  348. package/dist/plugins/pins/pin.d.ts +65 -0
  349. package/dist/plugins/pins/pin.d.ts.map +1 -0
  350. package/dist/plugins/pins/shipped.d.ts +40 -0
  351. package/dist/plugins/pins/shipped.d.ts.map +1 -0
  352. package/dist/plugins/roles/breaker.d.ts +18 -0
  353. package/dist/plugins/roles/breaker.d.ts.map +1 -0
  354. package/dist/plugins/roles/check-cases.d.ts +4 -0
  355. package/dist/plugins/roles/check-cases.d.ts.map +1 -0
  356. package/dist/plugins/roles/dev.d.ts +35 -0
  357. package/dist/plugins/roles/dev.d.ts.map +1 -0
  358. package/dist/plugins/roles/fixes.d.ts +24 -0
  359. package/dist/plugins/roles/fixes.d.ts.map +1 -0
  360. package/dist/plugins/roles/gate.d.ts +26 -0
  361. package/dist/plugins/roles/gate.d.ts.map +1 -0
  362. package/dist/plugins/roles/integrate.d.ts +12 -0
  363. package/dist/plugins/roles/integrate.d.ts.map +1 -0
  364. package/dist/plugins/roles/roles.d.ts +69 -0
  365. package/dist/plugins/roles/roles.d.ts.map +1 -0
  366. package/dist/plugins/wire/environment.d.ts +9 -0
  367. package/dist/plugins/wire/environment.d.ts.map +1 -0
  368. package/dist/plugins/wire/forms.d.ts +13 -0
  369. package/dist/plugins/wire/forms.d.ts.map +1 -0
  370. package/dist/plugins/wire/limits.d.ts +11 -0
  371. package/dist/plugins/wire/limits.d.ts.map +1 -0
  372. package/dist/plugins/wire/manifest.d.ts +31 -0
  373. package/dist/plugins/wire/manifest.d.ts.map +1 -0
  374. package/dist/plugins/wire/profile.d.ts +36 -0
  375. package/dist/plugins/wire/profile.d.ts.map +1 -0
  376. package/dist/plugins/wire/text.d.ts +14 -0
  377. package/dist/plugins/wire/text.d.ts.map +1 -0
  378. package/dist/server/assets.d.ts +13 -0
  379. package/dist/server/assets.d.ts.map +1 -0
  380. package/dist/server/coalesce.d.ts +12 -0
  381. package/dist/server/coalesce.d.ts.map +1 -0
  382. package/dist/server/data-script.d.ts +8 -0
  383. package/dist/server/data-script.d.ts.map +1 -0
  384. package/dist/server/dev-server.d.ts +34 -0
  385. package/dist/server/dev-server.d.ts.map +1 -0
  386. package/dist/server/editor-guard.d.ts +13 -0
  387. package/dist/server/editor-guard.d.ts.map +1 -0
  388. package/dist/server/error-reporter.d.ts +11 -0
  389. package/dist/server/error-reporter.d.ts.map +1 -0
  390. package/dist/server/icon-sets.d.ts +9 -0
  391. package/dist/server/icon-sets.d.ts.map +1 -0
  392. package/dist/server/plugin.d.ts +4 -0
  393. package/dist/server/plugin.d.ts.map +1 -0
  394. package/dist/server/preview-guard.d.ts +11 -0
  395. package/dist/server/preview-guard.d.ts.map +1 -0
  396. package/dist/types/assets.d.ts +130 -0
  397. package/dist/types/assets.d.ts.map +1 -0
  398. package/dist/types/catalog.d.ts +95 -0
  399. package/dist/types/catalog.d.ts.map +1 -0
  400. package/dist/types/config.d.ts +97 -0
  401. package/dist/types/config.d.ts.map +1 -0
  402. package/dist/types/data.d.ts +38 -0
  403. package/dist/types/data.d.ts.map +1 -0
  404. package/dist/types/docs.d.ts +47 -0
  405. package/dist/types/docs.d.ts.map +1 -0
  406. package/dist/types/findings.d.ts +18 -0
  407. package/dist/types/findings.d.ts.map +1 -0
  408. package/dist/types/index.d.ts +13 -0
  409. package/dist/types/index.d.ts.map +1 -0
  410. package/dist/types/parsed.d.ts +86 -0
  411. package/dist/types/parsed.d.ts.map +1 -0
  412. package/dist/types/theme.d.ts +19 -0
  413. package/dist/types/theme.d.ts.map +1 -0
  414. package/dist/types/tokens.d.ts +101 -0
  415. package/dist/types/tokens.d.ts.map +1 -0
  416. package/dist/ui/assets/geist-OFL.txt +93 -0
  417. package/dist/ui/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  418. package/dist/ui/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  419. package/dist/ui/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  420. package/dist/ui/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  421. package/dist/ui/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  422. package/dist/ui/assets/index-BdbihVvH.js +77 -0
  423. package/dist/ui/assets/index-DluSqfla.css +2 -0
  424. package/dist/ui/index.html +14 -0
  425. package/package.json +151 -4
  426. package/plugins/blazon.brand-deck/README.md +38 -0
  427. package/plugins/blazon.brand-deck/bin/blazon-blazon.brand-deck./360/237/224/214 +2695 -0
  428. package/plugins/blazon.brand-deck/package.json +3 -0
  429. package/plugins/blazon.copy/README.md +29 -0
  430. package/plugins/blazon.copy/bin/blazon-blazon.copy./360/237/224/214 +438 -0
  431. package/plugins/blazon.copy/package.json +3 -0
  432. package/plugins/blazon.favicons/README.md +13 -0
  433. package/plugins/blazon.favicons/bin/blazon-blazon.favicons./360/237/224/214 +8816 -0
  434. package/plugins/blazon.favicons/package.json +3 -0
  435. package/plugins/blazon.logo-geometry/README.md +5 -0
  436. package/plugins/blazon.logo-geometry/bin/blazon-blazon.logo-geometry./360/237/224/214 +1522 -0
  437. package/plugins/blazon.logo-geometry/package.json +3 -0
  438. package/plugins/blazon.logo-kit/README.md +5 -0
  439. package/plugins/blazon.logo-kit/bin/blazon-blazon.logo-kit./360/237/224/214 +617 -0
  440. package/plugins/blazon.logo-kit/package.json +3 -0
  441. package/plugins/blazon.office-template/README.md +29 -0
  442. package/plugins/blazon.office-template/bin/blazon-blazon.office-template./360/237/224/214 +1788 -0
  443. package/plugins/blazon.office-template/package.json +3 -0
  444. package/plugins/blazon.platform-tokens/README.md +22 -0
  445. package/plugins/blazon.platform-tokens/bin/blazon-blazon.platform-tokens./360/237/224/214 +8418 -0
  446. package/plugins/blazon.platform-tokens/package.json +3 -0
  447. package/plugins/blazon.press-kit/README.md +17 -0
  448. package/plugins/blazon.press-kit/bin/blazon-blazon.press-kit./360/237/224/214 +897 -0
  449. package/plugins/blazon.press-kit/package.json +3 -0
  450. package/plugins/blazon.print-book/README.md +38 -0
  451. package/plugins/blazon.print-book/bin/blazon-blazon.print-book./360/237/224/214 +9262 -0
  452. package/plugins/blazon.print-book/package.json +3 -0
  453. package/plugins/blazon.social-cards/README.md +5 -0
  454. package/plugins/blazon.social-cards/bin/blazon-blazon.social-cards./360/237/224/214 +1165 -0
  455. package/plugins/blazon.social-cards/package.json +3 -0
  456. package/plugins/shipped.lock +75 -0
  457. package/template/AGENTS.md +55 -0
  458. package/template/CLAUDE.md +1 -0
  459. package/template/assets/backgrounds/aurora.json +5 -0
  460. package/template/assets/backgrounds/aurora.svg +39 -0
  461. package/template/assets/construction/blazon-mark.json +9 -0
  462. package/template/assets/construction/blazon-mark.svg +54 -0
  463. package/template/assets/icons/arrow-right.json +5 -0
  464. package/template/assets/icons/arrow-right.svg +1 -0
  465. package/template/assets/icons/check.json +5 -0
  466. package/template/assets/icons/check.svg +1 -0
  467. package/template/assets/icons/download.json +5 -0
  468. package/template/assets/icons/download.svg +1 -0
  469. package/template/assets/icons/file.json +5 -0
  470. package/template/assets/icons/file.svg +1 -0
  471. package/template/assets/icons/token.json +5 -0
  472. package/template/assets/icons/token.svg +1 -0
  473. package/template/assets/icons/warning.json +5 -0
  474. package/template/assets/icons/warning.svg +1 -0
  475. package/template/assets/logos/blazon-bone.json +6 -0
  476. package/template/assets/logos/blazon-bone.svg +1 -0
  477. package/template/assets/logos/blazon-graphite.json +6 -0
  478. package/template/assets/logos/blazon-graphite.svg +1 -0
  479. package/template/assets/logos/blazon-mark.json +6 -0
  480. package/template/assets/logos/blazon-mark.svg +1 -0
  481. package/template/blazon.json +104 -0
  482. package/template/blazon.resolver.json +46 -0
  483. package/template/docs/01-principles.md +47 -0
  484. package/template/docs/02-logo.md +43 -0
  485. package/template/docs/03-color.md +79 -0
  486. package/template/docs/04-type.md +36 -0
  487. package/template/docs/05-form.md +80 -0
  488. package/template/docs/06-layout.md +28 -0
  489. package/template/docs/07-icons.md +22 -0
  490. package/template/docs/08-diagrams.md +20 -0
  491. package/template/docs/09-social.md +21 -0
  492. package/template/docs/10-applications.md +20 -0
  493. package/template/docs/11-voice.md +74 -0
  494. package/template/docs/12-web.md +167 -0
  495. package/template/fonts/IBMPlexMono-Regular-latin.woff2 +0 -0
  496. package/template/fonts/IBMPlexMono-SemiBold-latin.woff2 +0 -0
  497. package/template/fonts/OFL.txt +93 -0
  498. package/template/tokens/colors.json +257 -0
  499. package/template/tokens/form.json +199 -0
  500. package/template/tokens/social.json +26 -0
  501. package/template/tokens/spacing.json +65 -0
  502. package/template/tokens/theme/dark.json +121 -0
  503. package/template/tokens/typography.json +233 -0
@@ -0,0 +1,54 @@
1
+ import { Result } from './call.js';
2
+ import { Profile } from '../wire/manifest.js';
3
+ /** How to check one plugin program. A host's own check command is this with its profile filled in. */
4
+ export interface CheckConfig {
5
+ /** Names the manifest flag, `--<host>-manifest` */
6
+ host: string;
7
+ profile: Profile;
8
+ program: string;
9
+ /** True when the plugin's roles have a validation (`--validate`), so case 5 applies */
10
+ validate?: boolean;
11
+ /** Values for the variables the manifest lists, besides the secret ones, which get a random value of their own */
12
+ env?: Readonly<Record<string, string>>;
13
+ /**
14
+ * What the project's config approves for this plugin, one item for each of its entries (`key` names it, such as `plugins[0].env`). Absent when
15
+ * there is no project to ask. Case 10 fails for a name the manifest lists that an entry does not approve, since blazon would not start the plugin
16
+ */
17
+ approvals?: readonly {
18
+ key: string;
19
+ approved: readonly string[];
20
+ }[];
21
+ /** A valid request for each role. Case 4 sends it with the canary set; without one it sends only the inputs that fail */
22
+ requests?: Readonly<Record<string, Uint8Array | string>>;
23
+ /**
24
+ * For a role with no secret: a request for it with `$canary` where the request carries data. Case 4 sends it with a
25
+ * random value in that place and looks for the value in everything the plugin prints. Leave a role out when its
26
+ * answer repeats request data by design: it has no case 4.
27
+ */
28
+ dataRequests?: Readonly<Record<string, string>>;
29
+ /** Returns a role's answer without the one field the role defines for the secret, which is the only place the canary may appear. Absent exempts nothing */
30
+ exempt?: (role: string, stdout: Buffer) => Buffer;
31
+ /** The host's own cases for a role the manifest declares, run after the core cases and numbered after them. Absent runs none */
32
+ roleCases?: RoleCases;
33
+ }
34
+ /** Calls the plugin with a request, as the check does: the manifest's variables and timeout, at most `stdoutLimit` bytes of stdout (the core's when absent). */
35
+ export type RoleCall = (stdin: Uint8Array, stdoutLimit?: number) => Promise<Result>;
36
+ /** The cases a host adds for one of its roles. */
37
+ export type RoleCases = (role: string, call: RoleCall) => Promise<CheckResult[]>;
38
+ /** One case. `skipped` means it did not apply or could not run, and is neither a pass nor a failure. */
39
+ export interface CheckResult {
40
+ case: number;
41
+ name: string;
42
+ role: string;
43
+ passed: boolean;
44
+ skipped: boolean;
45
+ detail: string;
46
+ /** A passed case with something the plugin's author should know: it does not fail the check */
47
+ warning?: boolean;
48
+ }
49
+ export declare const result: (caseNumber: number, name: string, role: string, state?: Partial<Pick<CheckResult, "passed" | "skipped" | "detail" | "warning">>) => CheckResult;
50
+ /** Start the plugin the way a host does and run the core cases of section 9. */
51
+ export declare function check(cfg: CheckConfig): Promise<CheckResult[]>;
52
+ /** The JSON document `raw` with `value` at the JSON Pointer `pointer` (RFC 6901). A key an object lacks is added, and so is an object on the way; an array element must exist, and a value that is neither an object nor an array has no place. Throws an Error saying why. Written back compact. */
53
+ export declare function setPointer(raw: Uint8Array | undefined, pointer: string, value: string): Buffer;
54
+ //# sourceMappingURL=check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/plugins/host/check.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAG7C,OAAO,EAAiE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAYlH,sGAAsG;AACtG,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,uFAAuF;IACvF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kHAAkH;IAClH,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACvC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IACpE,yHAAyH;IACzH,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC;IACzD;;;;OAIG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAChD,2JAA2J;IAC3J,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,gIAAgI;IAChI,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,gKAAgK;AAChK,MAAM,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AACpF,kDAAkD;AAClD,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AAEjF,wGAAwG;AACxG,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,+FAA+F;IAC/F,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,MAAM,GAAI,YAAY,MAAM,EAAE,MAAM,MAAM,EAAE,MAAM,MAAM,EAAE,QAAO,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC,CAAM,KAAG,WAQ3J,CAAC;AAgBH,gFAAgF;AAChF,wBAAsB,KAAK,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAqCpE;AA0DD,qSAAqS;AACrS,wBAAgB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CA2B9F"}
@@ -0,0 +1,17 @@
1
+ export declare const REDACTED = "[REDACTED]";
2
+ /**
3
+ * Remove every labelled value from `text`, and the forms of it that section 3.5 has the host scrub. Each place one
4
+ * was found becomes REDACTED, and the text around it is kept. It looks for every form at every position, overlaps
5
+ * included, and replaces the union of the places once, so two secrets that overlap leave no tail of either behind.
6
+ * A value is text, never a pattern, and an empty secret matches nothing. A string comes back a string, a Buffer a Buffer.
7
+ */
8
+ export declare function scrub<T extends string | Buffer>(text: T, secrets: Iterable<string>): T;
9
+ /**
10
+ * `text` with its control (Cc) and format (Cf) characters taken out, and then every labelled value scrubbed from it. The
11
+ * order matters: a value split by a zero-width character or a bare ESC is whole only once those are gone, and a strip
12
+ * that came after the scrub would join it back together past the scrubber. A value that holds such a character itself
13
+ * is looked for in its stripped form too. `keepBreaks` leaves line breaks for a caller that splits lines afterwards, so
14
+ * a value that spans lines is still found.
15
+ */
16
+ export declare function scrubPlain(text: string, secrets: readonly string[], keepBreaks?: boolean): string;
17
+ //# sourceMappingURL=scrub.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrub.d.ts","sourceRoot":"","sources":["../../../src/plugins/host/scrub.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,eAAe,CAAC;AAErC;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CA+BtF;AAKD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,UAAQ,GAAG,MAAM,CAI/F"}
@@ -0,0 +1,14 @@
1
+ export { STDOUT_LIMIT, STDERR_KEEP, DEFAULT_TIMEOUT, TIMEOUT_CAP, MANIFEST_TIMEOUT } from './wire/limits.js';
2
+ export { isPluginName } from '../core/plugin-name.js';
3
+ export { ManifestError, decodeManifest, manifestTimeout, profileTimeoutCap, type Manifest, type Profile } from './wire/manifest.js';
4
+ export { message, graphemeCount, truncateGraphemes } from './wire/text.js';
5
+ export { BASE_ENV, environment } from './wire/environment.js';
6
+ export { run, requestFile, type Call, type Result } from './host/call.js';
7
+ export { Breaker, DEFAULT_THRESHOLD } from './roles/breaker.js';
8
+ export { encodings } from './wire/forms.js';
9
+ export { scrub, REDACTED } from './host/scrub.js';
10
+ export { admit, type Admission, type Flows, type Labels } from './host/admit.js';
11
+ export { Pin, PinMismatch, Refused, fileDigest, treeDigest, MAX_BYTES, MAX_ENTRIES } from './pins/pin.js';
12
+ export { check, setPointer, type CheckConfig, type CheckResult } from './host/check.js';
13
+ export { BLAZON_PROFILE, BLAZON_CORE_PROFILE, blazonRequests } from './wire/profile.js';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACpI,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,49 @@
1
+ /** Where a pinned plugin's interpreter may be found, before the operator's own directories (BLAZON_PLUGIN_PATH) are put in front. */
2
+ export declare const DEFAULT_PLUGIN_PATH: readonly string[];
3
+ /** The interpreter of a pinned plugin cannot be trusted, with the reason and what to change. */
4
+ export declare class InterpreterRefused extends Error {
5
+ constructor(reason: string);
6
+ }
7
+ export interface Shebang {
8
+ /** An absolute path, or with `viaEnv` a name to find in the trusted directories */
9
+ interpreter: string;
10
+ arg?: string;
11
+ viaEnv: boolean;
12
+ }
13
+ /** The `#!` line of a file: undefined when the file is not a script, a refusal when the line breaks the rules. */
14
+ export declare function readShebang(file: string): Shebang | undefined;
15
+ export interface ChainOptions {
16
+ /** What the end of the chain must be. A file by default */
17
+ final?: 'file' | 'dir';
18
+ /** The user the host runs as; only a test changes it */
19
+ uid?: number;
20
+ }
21
+ /**
22
+ * Why `file` cannot be trusted as a program, or undefined. Every link on the way is followed, and every directory
23
+ * visited and the file itself must belong to the host's user or to root and must not be writable by group or others,
24
+ * because whoever can write there can put another program where this one is.
25
+ */
26
+ export declare function chainProblem(file: string, options?: ChainOptions): string | undefined;
27
+ export interface TrustedPath {
28
+ dirs: string[];
29
+ /** The operator's directories that were left out, and why */
30
+ dropped: {
31
+ dir: string;
32
+ why: string;
33
+ }[];
34
+ }
35
+ /** The operator's directories (BLAZON_PLUGIN_PATH) first, then the defaults, each only if it exists and its chain is clean. */
36
+ export declare function pluginPath(env: Readonly<Record<string, string | undefined>>): TrustedPath;
37
+ export interface Launch {
38
+ program: string;
39
+ /** Before the call's own arguments; the last one is the copy when it is a script */
40
+ args: string[];
41
+ /** The PATH the plugin starts with: the trusted directories and nothing else */
42
+ path: string;
43
+ }
44
+ /**
45
+ * How to start `file`, a verified copy: a script goes through its interpreter, found and checked here as
46
+ * `<interpreter> [arg] <file>`; anything else runs as it is. Throws InterpreterRefused with what to change.
47
+ */
48
+ export declare function launchFor(file: string, env: Readonly<Record<string, string | undefined>>): Launch;
49
+ //# sourceMappingURL=interpreter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpreter.d.ts","sourceRoot":"","sources":["../../../src/plugins/pins/interpreter.ts"],"names":[],"mappings":"AASA,qIAAqI;AACrI,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAA2C,CAAC;AAO7F,gGAAgG;AAChG,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,MAAM,EAAE,MAAM;CAI3B;AAED,MAAM,WAAW,OAAO;IACtB,mFAAmF;IACnF,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,kHAAkH;AAClH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CA+B7D;AAED,MAAM,WAAW,YAAY;IAC3B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACvB,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM,GAAG,SAAS,CA+CzF;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,6DAA6D;IAC7D,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACzC;AAED,+HAA+H;AAC/H,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,WAAW,CAYzF;AAED,MAAM,WAAW,MAAM;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,MAAM,CAyBjG"}
@@ -0,0 +1,47 @@
1
+ import { Finding } from '../../types/index.js';
2
+ import { Pin } from './pin.js';
3
+ export declare const LOCK_FILE = "blazon.plugins.lock";
4
+ export interface LockEntry {
5
+ kind: 'file' | 'tree';
6
+ /** Relative to the project when inside it, with `/`; absolute otherwise */
7
+ path: string;
8
+ /** For a tree: the relative path of the program inside it */
9
+ entry?: string;
10
+ digest: string;
11
+ /** For a tree: the lines the digest is the hash of (`treeLines`), so a mismatch can name the files. Optional; a lock without it works as before */
12
+ files?: string[];
13
+ source: 'vouched' | 'computed';
14
+ }
15
+ export interface Lock {
16
+ v: 1;
17
+ plugins: Record<string, LockEntry>;
18
+ }
19
+ /**
20
+ * Read the lock strictly: an unknown key or a malformed entry is a problem, every one is listed, and a lock with any
21
+ * problem gives no pins at all, so nothing is trusted on the word of a file that cannot be read. A missing file is an
22
+ * empty lock. A lock that group or others can write is refused, as the program would be.
23
+ */
24
+ export declare function readLock(cwd: string): {
25
+ lock: Lock;
26
+ problems: Finding[];
27
+ };
28
+ /** The same, for a lock at any path. `label` names it in what is reported: the lock that ships with blazon is read this way too. */
29
+ export declare function readLockFile(file: string, label: string): {
30
+ lock: Lock;
31
+ problems: Finding[];
32
+ };
33
+ /** Write the lock sorted by plugin name, as two-space JSON with a final newline, atomically: nothing is left beside it. */
34
+ export declare function writeLock(cwd: string, lock: Lock): void;
35
+ /** The same, for a lock at any path. */
36
+ export declare function writeLockFile(file: string, lock: Lock): void;
37
+ /**
38
+ * Pin a plugin: hash what is at `target` and record it in the lock, keeping the other entries. With `digest` the
39
+ * operator vouches for the bytes: they must be those, and the entry says so. Throws an Error saying why it did not.
40
+ */
41
+ export declare function recordPin(cwd: string, name: string, target: string, options?: {
42
+ digest?: string;
43
+ entry?: string;
44
+ }): LockEntry;
45
+ /** The pin a lock entry describes, with its path resolved against the project. */
46
+ export declare function pinFor(cwd: string, entry: LockEntry): Pin;
47
+ //# sourceMappingURL=lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../src/plugins/pins/lock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAe,GAAG,EAA6D,MAAM,UAAU,CAAC;AAQvG,eAAO,MAAM,SAAS,wBAAwB,CAAC;AAE/C,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,mJAAmJ;IACnJ,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,UAAU,CAAC;CAChC;AAED,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,CAAC,CAAC;IACL,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC;AA2CD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,CAEzE;AAED,oIAAoI;AACpI,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,CA4B7F;AAED,2HAA2H;AAC3H,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAEvD;AAED,wCAAwC;AACxC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAiB5D;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,SAAS,CA4BjI;AAED,kFAAkF;AAClF,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,GAAG,CAEzD"}
@@ -0,0 +1,65 @@
1
+ export declare const MAX_ENTRIES = 10000;
2
+ export declare const MAX_BYTES: number;
3
+ /** A path a host must refuse to hash or copy. */
4
+ export declare class Refused extends Error {
5
+ readonly reason: string;
6
+ constructor(reason: string, where: string | Buffer);
7
+ }
8
+ /** What differs between the pinned tree and the one found: one path and how it changed. */
9
+ export interface TreeChange {
10
+ path: string;
11
+ change: 'modified' | 'added' | 'removed' | 'mode changed';
12
+ }
13
+ /** A pin that no longer matches: the plugin is not run. `changes` names the files, when the pin kept the list of them. */
14
+ export declare class PinMismatch extends Error {
15
+ readonly want: string;
16
+ readonly got: string;
17
+ readonly changes?: TreeChange[] | undefined;
18
+ constructor(want: string, got: string, changes?: TreeChange[] | undefined);
19
+ }
20
+ /** The sha256, as hex, of a regular file. `budget`, when given, is reduced by the bytes read. */
21
+ export declare function sha256File(file: string | Buffer, budget?: {
22
+ left: number;
23
+ }): string;
24
+ /** The `t1:` digest of a directory: the sha256 of the lines `<f|d> <x|-> <path> <sha256 of the file, or ->` LF, sorted by path. */
25
+ export declare function treeDigest(root: string): string;
26
+ /**
27
+ * The lines the tree digest is the hash of, without their LF, so a lock can keep them and a mismatch can name the files. Undefined when
28
+ * a name is not valid UTF-8, which JSON cannot hold: that tree is pinned by its digest alone.
29
+ */
30
+ export declare function treeLines(root: string): string[] | undefined;
31
+ /** The `t1:` digest of such lines: what a list in the lock must hash to, or it is not the list that was pinned. */
32
+ export declare function linesDigest(lines: readonly string[]): string;
33
+ /** One line of a tree digest: the type, the execute bit, the path (which may hold spaces) and the sha256 of a file or `-`. */
34
+ export declare const TREE_LINE: RegExp;
35
+ /** What changed between the pinned lines and the lines found, by path. */
36
+ export declare function diffTree(pinned: readonly string[], found: readonly string[]): TreeChange[];
37
+ /** The `sha256:` digest of a regular file that is not a symlink. */
38
+ export declare function fileDigest(file: string): string;
39
+ /** What a plugin is made of. `kind` is `file` (`path` is an executable) or `tree` (`path` is a directory and `entry` the relative path of the program inside it). */
40
+ export declare class Pin {
41
+ readonly kind: 'file' | 'tree';
42
+ readonly path: string;
43
+ readonly digest: string;
44
+ readonly entry: string;
45
+ /** The lines of the pinned tree (`treeLines`), when the lock kept them: a mismatch then names the files */
46
+ readonly files?: readonly string[] | undefined;
47
+ constructor(kind: 'file' | 'tree', path: string, digest: string, entry?: string,
48
+ /** The lines of the pinned tree (`treeLines`), when the lock kept them: a mismatch then names the files */
49
+ files?: readonly string[] | undefined);
50
+ /** The files that differ from the pin in the tree at `target`; undefined without the list, or when the tree cannot be read. */
51
+ private changesIn;
52
+ private digestOf;
53
+ /** Hash the original and compare it with the pin. It hashes every time: a host that must detect every change does (section 3.4). */
54
+ check(): void;
55
+ /**
56
+ * Copy what the pin names into a new private directory (mode 0700), hash the copy, compare it with the pin and
57
+ * return the directory and the program in the copy. The original is read once to make the copy and never run. The
58
+ * caller removes the directory.
59
+ */
60
+ verify(store?: string): {
61
+ directory: string;
62
+ program: string;
63
+ };
64
+ }
65
+ //# sourceMappingURL=pin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pin.d.ts","sourceRoot":"","sources":["../../../src/plugins/pins/pin.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW,QAAS,CAAC;AAClC,eAAO,MAAM,SAAS,QAAoB,CAAC;AAE3C,iDAAiD;AACjD,qBAAa,OAAQ,SAAQ,KAAK;IAE9B,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM,EACvB,KAAK,EAAE,MAAM,GAAG,MAAM;CAKzB;AAED,2FAA2F;AAC3F,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,cAAc,CAAC;CAC3D;AAaD,0HAA0H;AAC1H,qBAAa,WAAY,SAAQ,KAAK;IAElC,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM;IACpB,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE;gBAFtB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,UAAU,EAAE,YAAA;CASlC;AAuED,iGAAiG;AACjG,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAKnF;AAWD,mIAAmI;AACnI,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAI5D;AAED,mHAAmH;AACnH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAE5D;AAED,8HAA8H;AAC9H,eAAO,MAAM,SAAS,QAA0C,CAAC;AAEjE,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,EAAE,CAmB1F;AAED,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK/C;AAcD,qKAAqK;AACrK,qBAAa,GAAG;IAEZ,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,KAAK;IACd,2GAA2G;IAC3G,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE;gBALzB,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,SAAK;IACnB,2GAA2G;IAClG,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,YAAA;IAGpC,+HAA+H;IAC/H,OAAO,CAAC,SAAS;IAUjB,OAAO,CAAC,QAAQ;IAMhB,oIAAoI;IACpI,KAAK,IAAI,IAAI;IAKb;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;CAuC/D"}
@@ -0,0 +1,40 @@
1
+ import { SHIPPED_LOCK } from '../../core/shipped-names.js';
2
+ export { SHIPPED_LOCK };
3
+ /** A shipped plugin as the lock describes it, with absolute paths. */
4
+ export interface Shipped {
5
+ /** The plugin's folder; the program runs with this as its working directory */
6
+ directory: string;
7
+ /** The program, inside the folder */
8
+ entry: string;
9
+ digest: string;
10
+ }
11
+ /** The folder that holds the shipped plugins and their lock. */
12
+ export declare const shippedDirectory: () => string;
13
+ /**
14
+ * The shipped plugin called `name`: undefined when the lock does not list it, a reason when the lock cannot be used or
15
+ * its entry is wrong. A lock that cannot be read lists nothing, so it is a reason for every name, never a way to look
16
+ * past it.
17
+ */
18
+ export declare function findShipped(directory: string, name: string): Shipped | {
19
+ problem: string;
20
+ } | undefined;
21
+ /** Why a shipped plugin may not run now, or undefined. Done before every call: a change after the last one is caught by the next. */
22
+ export declare function shippedProblem(shipped: Shipped): string | undefined;
23
+ /**
24
+ * The same, with `place` set when the cause is where blazon is installed: a folder on the way that another user can write
25
+ * or owns. That one is not fixed by reinstalling in the same place, so the host gives it a fix of its own.
26
+ */
27
+ export declare function shippedTrouble(shipped: Shipped): {
28
+ problem: string;
29
+ place: boolean;
30
+ } | undefined;
31
+ /**
32
+ * How to start the program. JavaScript runs on the node that runs blazon, by its own path: a lookup on PATH would run
33
+ * whatever node the environment names, and the interpreter search of a pinned copy refuses a machine whose node sits
34
+ * in a directory others can write. Anything else is started as the kernel starts it.
35
+ */
36
+ export declare function shippedLaunch(entry: string): {
37
+ program: string;
38
+ args: string[];
39
+ };
40
+ //# sourceMappingURL=shipped.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipped.d.ts","sourceRoot":"","sources":["../../../src/plugins/pins/shipped.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAU3D,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,sEAAsE;AACtE,MAAM,WAAW,OAAO;IACtB,+EAA+E;IAC/E,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gEAAgE;AAChE,eAAO,MAAM,gBAAgB,QAAO,MAA6C,CAAC;AAOlF;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAUtG;AAED,qIAAqI;AACrI,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAEnE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAchG;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAKhF"}
@@ -0,0 +1,18 @@
1
+ /** Three breaks in a row, the core's threshold (RFC 0005 section 7). A host MAY use another. */
2
+ export declare const DEFAULT_THRESHOLD = 3;
3
+ /**
4
+ * Stops calling a plugin that keeps breaking, for the rest of a unit of work. After `threshold` breaks in a row it is
5
+ * open, and every later call in that unit ends at once as an error without starting the program. An answer resets
6
+ * the count. It never closes within the unit and never carries into the next one: make a new Breaker per unit of
7
+ * work. An open breaker must not turn a stopped call into a pass; the caller reports the skipped call as a break.
8
+ */
9
+ export declare class Breaker {
10
+ private readonly threshold;
11
+ private breaks;
12
+ private opened;
13
+ constructor(threshold?: number);
14
+ get open(): boolean;
15
+ /** Note how a call that did start ended: a break, or an answer. */
16
+ record(broke: boolean): void;
17
+ }
18
+ //# sourceMappingURL=breaker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breaker.d.ts","sourceRoot":"","sources":["../../../src/plugins/roles/breaker.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;;;;GAKG;AACH,qBAAa,OAAO;IAIN,OAAO,CAAC,QAAQ,CAAC,SAAS;IAHtC,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,MAAM,CAAS;gBAEM,SAAS,SAAoB;IAE1D,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,mEAAmE;IACnE,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;CAS7B"}
@@ -0,0 +1,4 @@
1
+ import { RoleCases } from '../host/check.js';
2
+ /** The cases of blazon's roles for the plugin at `program`. */
3
+ export declare function blazonRoleCases(program: string): RoleCases;
4
+ //# sourceMappingURL=check-cases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-cases.d.ts","sourceRoot":"","sources":["../../../src/plugins/roles/check-cases.ts"],"names":[],"mappings":"AAGA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAyB5E,+DAA+D;AAC/D,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAiE1D"}
@@ -0,0 +1,35 @@
1
+ import { Finding, BlazonConfig, BlazonData } from '../../types/index.js';
2
+ export interface DevChecksOptions {
3
+ /** The clock the cooldown reads; default Date.now */
4
+ now?: () => number;
5
+ cooldownMs?: number;
6
+ /** The environment a plugin may be given; default: this process's */
7
+ env?: NodeJS.ProcessEnv;
8
+ /** Where verified copies of pinned plugins are made; default: the system's temporary directory */
9
+ store?: string;
10
+ }
11
+ export declare class DevChecks {
12
+ private readonly cwd;
13
+ private readonly options;
14
+ private readonly gate;
15
+ private generation;
16
+ private running;
17
+ private waiting;
18
+ constructor(cwd: string, options?: DevChecksOptions);
19
+ private run;
20
+ /** Whether the project allows any plugin, so a project that allows none starts no process and sends no second update. */
21
+ has(config: BlazonConfig): boolean;
22
+ /**
23
+ * What the check plugins find for this compile, after the core's findings, which this does not change. Undefined when
24
+ * a newer compile was asked for before this one finished: its answer would describe files that have changed.
25
+ */
26
+ check(data: BlazonData, config: BlazonConfig): Promise<Finding[] | undefined>;
27
+ /**
28
+ * A change replaced the compile any check was running or waiting for, and it asks for no check of its own (the project now allows no
29
+ * plugin, or the new compile failed). What is running describes files that have changed, so its answer is dropped, as a newer check
30
+ * would drop it. Nothing is dropped for the next check.
31
+ */
32
+ supersede(): void;
33
+ private drain;
34
+ }
35
+ //# sourceMappingURL=dev.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/plugins/roles/dev.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAU9E,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,kGAAkG;IAClG,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AASD,qBAAa,SAAS;IAOlB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAP1B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAW;IAChC,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAkB;gBAGd,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,gBAAqB;IAKjD,OAAO,CAAC,GAAG;IAKX,yHAAyH;IACzH,GAAG,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO;IAIlC;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC;IAQ7E;;;;OAIG;IACH,SAAS,IAAI,IAAI;YAMH,KAAK;CAmBpB"}
@@ -0,0 +1,24 @@
1
+ import { BreakCause } from '../host/call.js';
2
+ /** The plugin's entry in blazon.json or a --plugin argument cannot be used as it is. */
3
+ export declare const CONFIG_FIX = "Change the plugins entry in blazon.json, or the --plugin argument, that the message names.";
4
+ /** No program was found for a plugin that is not pinned or shipped. */
5
+ export declare const notFoundFix: (name: string) => string;
6
+ /** An unpinned program that group or others can write. It is the user's own file or the project's own folder, never a shared one. */
7
+ export declare const writableFix: (place: string) => string;
8
+ /** A check or build plugin that must be pinned and is not. */
9
+ export declare const pinFix: (program: string, name: string) => string;
10
+ /** A plugin that takes a labelled variable without listing it as secret. */
11
+ export declare const labelFix: (variable: string) => string;
12
+ /** A build plugin whose output folder holds an input. */
13
+ export declare const OUT_DIR_FIX = "Move the file out of the output folder, or set tokensOutDir to another folder.";
14
+ /** A plugin stopped by its breaker after earlier breaks. */
15
+ export declare const STOPPED_FIX = "Fix the failure reported for this plugin before it was stopped; blazon starts it again on the next run.";
16
+ /** A plugin that answered with exit 2: it could not judge, and said why. */
17
+ export declare const COULD_NOT_FIX = "Fix what the plugin names in the message, then run the command again.";
18
+ /** A manifest or an answer that breaks the plugin protocol. */
19
+ export declare const PROTOCOL_FIX = "The plugin does not follow the plugin protocol (docs/manual/13-writing-a-plugin.md): fix the program, or send the message to the plugin's author.";
20
+ /** A manifest call that answered with an exit code other than 0. */
21
+ export declare const MANIFEST_EXIT_FIX = "The plugin must answer --blazon-manifest with exit 0 (docs/manual/13-writing-a-plugin.md): fix the program, or send the message to the plugin's author.";
22
+ /** The fix for a call that broke, by the kind of cause. `pin` is the project lock's path of the plugin, when it is pinned there. */
23
+ export declare function breakFix(cause: BreakCause | undefined, name: string, pin?: string): string | undefined;
24
+ //# sourceMappingURL=fixes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixes.d.ts","sourceRoot":"","sources":["../../../src/plugins/roles/fixes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAUlD,wFAAwF;AACxF,eAAO,MAAM,UAAU,+FAA+F,CAAC;AAEvH,uEAAuE;AACvE,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,MAC4I,CAAC;AAExL,qIAAqI;AACrI,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,MAC2E,CAAC;AAExH,8DAA8D;AAC9D,eAAO,MAAM,MAAM,GAAI,SAAS,MAAM,EAAE,MAAM,MAAM,KAAG,MAAiG,CAAC;AAEzJ,4EAA4E;AAC5E,eAAO,MAAM,QAAQ,GAAI,UAAU,MAAM,KAAG,MAA0F,CAAC;AAEvI,yDAAyD;AACzD,eAAO,MAAM,WAAW,mFAAmF,CAAC;AAE5G,4DAA4D;AAC5D,eAAO,MAAM,WAAW,4GAA4G,CAAC;AAErI,4EAA4E;AAC5E,eAAO,MAAM,aAAa,0EAA0E,CAAC;AAErG,+DAA+D;AAC/D,eAAO,MAAM,YAAY,sJAAkF,CAAC;AAE5G,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,4JAAwF,CAAC;AAEvH,oIAAoI;AACpI,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAuBtG"}
@@ -0,0 +1,26 @@
1
+ export interface Gate {
2
+ /** Why a call to this plugin must not start, or undefined when it may. */
3
+ stopped(name: string): string | undefined;
4
+ /** Note how a call that did start ended: an answer, a break, or exit 2 (the plugin could not answer). */
5
+ record(name: string, ended: Ended): void;
6
+ }
7
+ /** How a call ended, for a gate: `exit-2` is a plugin that said it could not answer (RFC 0005 section 7). */
8
+ export type Ended = 'answer' | 'break' | 'exit-2';
9
+ /** Three breaks in a row stop a plugin for the rest of the run; exit 2 counts as a break. */
10
+ export declare class RunBreakers implements Gate {
11
+ private readonly breakers;
12
+ private breaker;
13
+ stopped(name: string): string | undefined;
14
+ record(name: string, ended: Ended): void;
15
+ }
16
+ /** The dev server's cooldown: a plugin that broke is not started again until `ms` after its latest break. */
17
+ export declare const DEV_COOLDOWN_MS = 30000;
18
+ export declare class Cooldown implements Gate {
19
+ private readonly now;
20
+ private readonly ms;
21
+ private readonly until;
22
+ constructor(now?: () => number, ms?: number);
23
+ stopped(name: string): string | undefined;
24
+ record(name: string, ended: Ended): void;
25
+ }
26
+ //# sourceMappingURL=gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../../src/plugins/roles/gate.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,IAAI;IACnB,0EAA0E;IAC1E,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1C,yGAAyG;IACzG,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC1C;AAED,6GAA6G;AAC7G,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAElD,6FAA6F;AAC7F,qBAAa,WAAY,YAAW,IAAI;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA8B;IAEvD,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIzC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;CAGzC;AAED,6GAA6G;AAC7G,eAAO,MAAM,eAAe,QAAS,CAAC;AAEtC,qBAAa,QAAS,YAAW,IAAI;IAIjC,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,EAAE;IAJrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA6B;gBAGhC,GAAG,GAAE,MAAM,MAAiB,EAC5B,EAAE,GAAE,MAAwB;IAG/C,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAOzC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;CAGzC"}
@@ -0,0 +1,12 @@
1
+ import { Finding, BlazonConfig, BlazonData } from '../../types/index.js';
2
+ import { PluginRun } from './roles.js';
3
+ /** brand.json as a value: what a plugin receives as `brand`, and exactly what the site holds. */
4
+ export declare function brandFor(data: BlazonData, config: BlazonConfig, cwd: string): unknown;
5
+ /**
6
+ * Run the `check` role and add what the plugins found to `data.findings`, after the core's. A plugin is given the brand as
7
+ * the core's findings left it, never another plugin's. Nothing is built when the project allows no plugin.
8
+ */
9
+ export declare function applyCheckPlugins(data: BlazonData, config: BlazonConfig, cwd: string, run: PluginRun): Promise<void>;
10
+ /** Run the `build` role once the site is written. `data` is the brand the site holds, plugin findings included. */
11
+ export declare function applyBuildPlugins(data: BlazonData, config: BlazonConfig, cwd: string, run: PluginRun, siteDir: string): Promise<Finding[]>;
12
+ //# sourceMappingURL=integrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integrate.d.ts","sourceRoot":"","sources":["../../../src/plugins/roles/integrate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C,iGAAiG;AACjG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAErF;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1H;AAED,mHAAmH;AACnH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAGhJ"}
@@ -0,0 +1,69 @@
1
+ import { Finding, BlazonConfig } from '../../types/index.js';
2
+ import { Gate } from './gate.js';
3
+ import { LOCK_FILE } from '../pins/lock.js';
4
+ export type Role = 'check' | 'build';
5
+ /** The most findings one answer may hold; more is an answer blazon refuses. */
6
+ export declare const MAX_FINDINGS = 500;
7
+ export interface PluginRunOptions {
8
+ /** Programs the operator named on the command line: they run unpinned, once, with a warning */
9
+ named?: readonly string[];
10
+ /** Where a warning goes. Default: stderr */
11
+ log?: (line: string) => void;
12
+ /** The environment variables a plugin may be given; default: this process's */
13
+ env?: NodeJS.ProcessEnv;
14
+ /** Where verified copies of pinned plugins are made; default: the system's temporary directory */
15
+ store?: string;
16
+ /** What stops a plugin that keeps breaking; default: three breaks in a row stop it for this run. The dev server passes a cooldown */
17
+ gate?: Gate;
18
+ /** The folder that holds the plugins shipped with blazon and their lock; default: plugins/ at blazon's package root. For tests, so no variable or key sets it */
19
+ shipped?: string;
20
+ }
21
+ /**
22
+ * The end of what a call that broke wrote to stderr, as one line to add to the reason: its last non-empty lines, scrubbed of
23
+ * every labelled value and of the characters a terminal acts on, joined with " | " so no line of it can pass for a line of
24
+ * blazon's, and cut from the front to a length. Empty when it wrote nothing. Never used for a call that answered.
25
+ */
26
+ export declare function stderrTail(stderr: Buffer, secrets: readonly string[]): string;
27
+ export declare class PluginRun {
28
+ private readonly config;
29
+ private readonly cwd;
30
+ private readonly options;
31
+ private readonly lock;
32
+ private lockProblems;
33
+ private readonly gate;
34
+ private readonly env;
35
+ private readonly log;
36
+ constructor(config: BlazonConfig, cwd: string, options?: PluginRunOptions);
37
+ /** Whether the config or the command line allows any plugin at all. Without one, nothing is read, built or run. */
38
+ get active(): boolean;
39
+ /** The `check` role: every plugin that fills it judges the brand. `brand` is the content of brand.json. */
40
+ check(brand: unknown): Promise<Finding[]>;
41
+ /** The `build` role: every plugin that fills it makes something from the brand, in its own out_dir. */
42
+ build(brand: unknown, siteDir: string): Promise<Finding[]>;
43
+ private each;
44
+ /**
45
+ * The plugins that may run: those in the config, in its order, then programs named on the command line. This is the one list
46
+ * of the ids that run, so every id is checked here (RFC 0014 sections 3.1 and 3.3), whichever place it came from: it is at
47
+ * most 64 characters, and no two targets share one, because the id owns an output folder and a breaker. The first to take an
48
+ * id keeps it; a later target that breaks a rule is refused with a finding and never started.
49
+ */
50
+ private targets;
51
+ /** Where a plugin is: pinned in the project's lock, shipped with blazon, or a program found by name. A pinned or shipped plugin is never searched for. */
52
+ private locate;
53
+ /** The names a plugin could have been meant by: those pinned in the lock, shipped with blazon, or found as programs in .blazon/plugins. */
54
+ private pluginNames;
55
+ /** The plugin of that name in blazon's package, ahead of every program found by name, so nothing in .blazon/plugins or on PATH can take its place. */
56
+ private shipped;
57
+ private callFor;
58
+ private one;
59
+ /** What a call that ended means: the findings it answered with, or one finding about the plugin. */
60
+ private outcome;
61
+ }
62
+ /** The findings in a plugin's answer of `role`, if the answer follows the rules; otherwise what is wrong with it. `name` is the plugin's, the prefix of its codes; `instance` is the id to name when the plugin is listed more than once. */
63
+ export declare function readAnswer(role: Role, name: string, stdout: Buffer, secrets: readonly string[], instance?: string): {
64
+ findings: Finding[];
65
+ } | {
66
+ problem: string;
67
+ };
68
+ export { LOCK_FILE };
69
+ //# sourceMappingURL=roles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../../src/plugins/roles/roles.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,SAAS,EAA+B,MAAM,iBAAiB,CAAC;AAczE,MAAM,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC;AAOrC,+EAA+E;AAC/E,eAAO,MAAM,YAAY,MAAM,CAAC;AAQhC,MAAM,WAAW,gBAAgB;IAC/B,+FAA+F;IAC/F,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,4CAA4C;IAC5C,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,kGAAkG;IAClG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qIAAqI;IACrI,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,iKAAiK;IACjK,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA0CD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAQ7E;AAWD,qBAAa,SAAS;IAQlB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAT1B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAO;IAC5B,OAAO,CAAC,YAAY,CAAY;IAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAO;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAoB;IACxC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAyB;gBAG1B,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,gBAAqB;IAUjD,mHAAmH;IACnH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,2GAA2G;IAC3G,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAIzC,uGAAuG;IACvG,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;YAI5C,IAAI;IAOlB;;;;;OAKG;IACH,OAAO,CAAC,OAAO;IAmCf,0JAA0J;IAC1J,OAAO,CAAC,MAAM;IAyBd,2IAA2I;IAC3I,OAAO,CAAC,WAAW;IAkBnB,sJAAsJ;IACtJ,OAAO,CAAC,OAAO;IAYf,OAAO,CAAC,OAAO;YAMD,GAAG;IAuFjB,oGAAoG;IACpG,OAAO,CAAC,OAAO;CAWhB;AAED,6OAA6O;AAC7O,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAmCjK;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The only part of the host's environment a plugin sees without asking: `PATH`, which the host sets itself for a pinned script (the
3
+ * trusted interpreter directories) and which an unpinned program needs to find its own tools. Anything else, `HOME` and `TMPDIR`
4
+ * included, is a name the manifest lists and the project's config approves.
5
+ */
6
+ export declare const BASE_ENV: readonly ["PATH"];
7
+ /** BASE_ENV from this process, then the variables the manifest lists and the config approves, with the values the host resolved. */
8
+ export declare function environment(listed?: Readonly<Record<string, string>>): Record<string, string>;
9
+ //# sourceMappingURL=environment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../src/plugins/wire/environment.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,mBAAoB,CAAC;AAE1C,oIAAoI;AACpI,wBAAgB,WAAW,CAAC,MAAM,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOjG"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The forms section 3.5 has the host scrub: as it is, base64 in both alphabets without padding, and URL-encoded as a
3
+ * query (a space as `+`), with `%20` for the space, and as a path segment. The unpadded base64 form is also the start
4
+ * of the padded one, so it finds both. After those, in this order, so that the first six keep their places:
5
+ *
6
+ * - the percent-encoded forms with lowercase hex (`%2f`), where that differs;
7
+ * - base64 of a larger string that the value sits inside, at each of the three alignments and in both alphabets: the part that
8
+ * does not depend on the bytes around the value (Basic auth sends `base64("api:" + value)`);
9
+ * - the value as the body of a JSON string, with non-ASCII characters as `\uXXXX` in either case of hex, and with `<`, `>` and `&`
10
+ * escaped as Go's encoder does.
11
+ */
12
+ export declare function encodings(value: string): Buffer[];
13
+ //# sourceMappingURL=forms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../../../src/plugins/wire/forms.ts"],"names":[],"mappings":"AA6BA;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA0BjD"}
@@ -0,0 +1,11 @@
1
+ /** What a plugin may print on stdout in one answer, in bytes. A profile MAY raise it for a named role. */
2
+ export declare const STDOUT_LIMIT = 65536;
3
+ /** How much of a plugin's stderr a call keeps, in bytes. */
4
+ export declare const STDERR_KEEP = 8192;
5
+ /** Seconds one call may take when the manifest says nothing. */
6
+ export declare const DEFAULT_TIMEOUT = 5;
7
+ /** The most a manifest's `timeout_ms` can ask for, in seconds. A profile MAY raise it for a role whose call waits on a person. */
8
+ export declare const TIMEOUT_CAP = 60;
9
+ /** The manifest call has a fixed 15 seconds and 64 KB of stdout (section 3.8). */
10
+ export declare const MANIFEST_TIMEOUT = 15;
11
+ //# sourceMappingURL=limits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/plugins/wire/limits.ts"],"names":[],"mappings":"AAEA,0GAA0G;AAC1G,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,4DAA4D;AAC5D,eAAO,MAAM,WAAW,OAAO,CAAC;AAEhC,gEAAgE;AAChE,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC,kIAAkI;AAClI,eAAO,MAAM,WAAW,KAAK,CAAC;AAE9B,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,KAAK,CAAC"}