@taggor/contract 0.0.0-stage → 0.2.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 (343) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -2
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/artifact-keys.d.ts +169 -0
  5. package/dist/artifact-keys.d.ts.map +1 -0
  6. package/dist/artifact-keys.js +195 -0
  7. package/dist/artifact-keys.js.map +1 -0
  8. package/dist/assets.d.ts +72 -0
  9. package/dist/assets.d.ts.map +1 -0
  10. package/dist/assets.js +94 -0
  11. package/dist/assets.js.map +1 -0
  12. package/dist/bounded-path.d.ts +29 -0
  13. package/dist/bounded-path.d.ts.map +1 -0
  14. package/dist/bounded-path.js +57 -0
  15. package/dist/bounded-path.js.map +1 -0
  16. package/dist/bounded.d.ts +47 -0
  17. package/dist/bounded.d.ts.map +1 -0
  18. package/dist/bounded.js +93 -0
  19. package/dist/bounded.js.map +1 -0
  20. package/dist/build-diagnostic.d.ts +89 -0
  21. package/dist/build-diagnostic.d.ts.map +1 -0
  22. package/dist/build-diagnostic.js +91 -0
  23. package/dist/build-diagnostic.js.map +1 -0
  24. package/dist/component-types.d.ts +61 -0
  25. package/dist/component-types.d.ts.map +1 -0
  26. package/dist/component-types.js +277 -0
  27. package/dist/component-types.js.map +1 -0
  28. package/dist/consent-text.d.ts +31 -0
  29. package/dist/consent-text.d.ts.map +1 -0
  30. package/dist/consent-text.js +41 -0
  31. package/dist/consent-text.js.map +1 -0
  32. package/dist/contract-version.d.ts +150 -0
  33. package/dist/contract-version.d.ts.map +1 -0
  34. package/dist/contract-version.js +198 -0
  35. package/dist/contract-version.js.map +1 -0
  36. package/dist/credential-fields.d.ts +31 -0
  37. package/dist/credential-fields.d.ts.map +1 -0
  38. package/dist/credential-fields.js +36 -0
  39. package/dist/credential-fields.js.map +1 -0
  40. package/dist/css-tokens.d.ts +46 -0
  41. package/dist/css-tokens.d.ts.map +1 -0
  42. package/dist/css-tokens.js +189 -0
  43. package/dist/css-tokens.js.map +1 -0
  44. package/dist/css-value.d.ts +42 -0
  45. package/dist/css-value.d.ts.map +1 -0
  46. package/dist/css-value.js +78 -0
  47. package/dist/css-value.js.map +1 -0
  48. package/dist/data-api.d.ts +127 -0
  49. package/dist/data-api.d.ts.map +1 -0
  50. package/dist/data-api.js +167 -0
  51. package/dist/data-api.js.map +1 -0
  52. package/dist/denylist-keys.d.ts +19 -0
  53. package/dist/denylist-keys.d.ts.map +1 -0
  54. package/dist/denylist-keys.js +48 -0
  55. package/dist/denylist-keys.js.map +1 -0
  56. package/dist/diagnostic-catalog.d.ts +1402 -0
  57. package/dist/diagnostic-catalog.d.ts.map +1 -0
  58. package/dist/diagnostic-catalog.js +1311 -0
  59. package/dist/diagnostic-catalog.js.map +1 -0
  60. package/dist/dom-members.snapshot.d.ts +33 -0
  61. package/dist/dom-members.snapshot.d.ts.map +1 -0
  62. package/dist/dom-members.snapshot.js +760 -0
  63. package/dist/dom-members.snapshot.js.map +1 -0
  64. package/dist/early-loading.d.ts +27 -0
  65. package/dist/early-loading.d.ts.map +1 -0
  66. package/dist/early-loading.js +44 -0
  67. package/dist/early-loading.js.map +1 -0
  68. package/dist/error-catalog.d.ts +749 -0
  69. package/dist/error-catalog.d.ts.map +1 -0
  70. package/dist/error-catalog.js +720 -0
  71. package/dist/error-catalog.js.map +1 -0
  72. package/dist/executable-config.d.ts +35 -0
  73. package/dist/executable-config.d.ts.map +1 -0
  74. package/dist/executable-config.js +44 -0
  75. package/dist/executable-config.js.map +1 -0
  76. package/dist/freeze.d.ts +17 -0
  77. package/dist/freeze.d.ts.map +1 -0
  78. package/dist/freeze.js +29 -0
  79. package/dist/freeze.js.map +1 -0
  80. package/dist/gunzip.d.ts +33 -0
  81. package/dist/gunzip.d.ts.map +1 -0
  82. package/dist/gunzip.js +330 -0
  83. package/dist/gunzip.js.map +1 -0
  84. package/dist/hostname.d.ts +74 -0
  85. package/dist/hostname.d.ts.map +1 -0
  86. package/dist/hostname.js +215 -0
  87. package/dist/hostname.js.map +1 -0
  88. package/dist/human-actions.d.ts +49 -0
  89. package/dist/human-actions.d.ts.map +1 -0
  90. package/dist/human-actions.js +272 -0
  91. package/dist/human-actions.js.map +1 -0
  92. package/dist/index.d.ts +73 -0
  93. package/dist/index.d.ts.map +1 -0
  94. package/dist/index.js +73 -0
  95. package/dist/index.js.map +1 -0
  96. package/dist/json-schema.d.ts +108 -0
  97. package/dist/json-schema.d.ts.map +1 -0
  98. package/dist/json-schema.js +240 -0
  99. package/dist/json-schema.js.map +1 -0
  100. package/dist/key-checksum.d.ts +33 -0
  101. package/dist/key-checksum.d.ts.map +1 -0
  102. package/dist/key-checksum.js +67 -0
  103. package/dist/key-checksum.js.map +1 -0
  104. package/dist/libraries.d.ts +60 -0
  105. package/dist/libraries.d.ts.map +1 -0
  106. package/dist/libraries.js +120 -0
  107. package/dist/libraries.js.map +1 -0
  108. package/dist/limit-catalog.d.ts +381 -0
  109. package/dist/limit-catalog.d.ts.map +1 -0
  110. package/dist/limit-catalog.js +429 -0
  111. package/dist/limit-catalog.js.map +1 -0
  112. package/dist/limits.d.ts +167 -0
  113. package/dist/limits.d.ts.map +1 -0
  114. package/dist/limits.js +175 -0
  115. package/dist/limits.js.map +1 -0
  116. package/dist/locale-tag.d.ts +21 -0
  117. package/dist/locale-tag.d.ts.map +1 -0
  118. package/dist/locale-tag.js +21 -0
  119. package/dist/locale-tag.js.map +1 -0
  120. package/dist/make-diagnostic.d.ts +74 -0
  121. package/dist/make-diagnostic.d.ts.map +1 -0
  122. package/dist/make-diagnostic.js +100 -0
  123. package/dist/make-diagnostic.js.map +1 -0
  124. package/dist/manifest-compat-diagnostics.d.ts +23 -0
  125. package/dist/manifest-compat-diagnostics.d.ts.map +1 -0
  126. package/dist/manifest-compat-diagnostics.js +150 -0
  127. package/dist/manifest-compat-diagnostics.js.map +1 -0
  128. package/dist/manifest-compat.d.ts +58 -0
  129. package/dist/manifest-compat.d.ts.map +1 -0
  130. package/dist/manifest-compat.js +377 -0
  131. package/dist/manifest-compat.js.map +1 -0
  132. package/dist/manifest.d.ts +1769 -0
  133. package/dist/manifest.d.ts.map +1 -0
  134. package/dist/manifest.js +421 -0
  135. package/dist/manifest.js.map +1 -0
  136. package/dist/metering.d.ts +126 -0
  137. package/dist/metering.d.ts.map +1 -0
  138. package/dist/metering.js +147 -0
  139. package/dist/metering.js.map +1 -0
  140. package/dist/migrate.d.ts +70 -0
  141. package/dist/migrate.d.ts.map +1 -0
  142. package/dist/migrate.js +159 -0
  143. package/dist/migrate.js.map +1 -0
  144. package/dist/money.d.ts +41 -0
  145. package/dist/money.d.ts.map +1 -0
  146. package/dist/money.js +52 -0
  147. package/dist/money.js.map +1 -0
  148. package/dist/names.d.ts +37 -0
  149. package/dist/names.d.ts.map +1 -0
  150. package/dist/names.js +55 -0
  151. package/dist/names.js.map +1 -0
  152. package/dist/overage-pricing.d.ts +89 -0
  153. package/dist/overage-pricing.d.ts.map +1 -0
  154. package/dist/overage-pricing.js +170 -0
  155. package/dist/overage-pricing.js.map +1 -0
  156. package/dist/plan-ids.d.ts +10 -0
  157. package/dist/plan-ids.d.ts.map +1 -0
  158. package/dist/plan-ids.js +8 -0
  159. package/dist/plan-ids.js.map +1 -0
  160. package/dist/plan-limits.d.ts +138 -0
  161. package/dist/plan-limits.d.ts.map +1 -0
  162. package/dist/plan-limits.js +112 -0
  163. package/dist/plan-limits.js.map +1 -0
  164. package/dist/plan-pricing.d.ts +145 -0
  165. package/dist/plan-pricing.d.ts.map +1 -0
  166. package/dist/plan-pricing.js +172 -0
  167. package/dist/plan-pricing.js.map +1 -0
  168. package/dist/plan-usage.d.ts +112 -0
  169. package/dist/plan-usage.d.ts.map +1 -0
  170. package/dist/plan-usage.js +134 -0
  171. package/dist/plan-usage.js.map +1 -0
  172. package/dist/preview-token.d.ts +52 -0
  173. package/dist/preview-token.d.ts.map +1 -0
  174. package/dist/preview-token.js +106 -0
  175. package/dist/preview-token.js.map +1 -0
  176. package/dist/prop-names.d.ts +51 -0
  177. package/dist/prop-names.d.ts.map +1 -0
  178. package/dist/prop-names.js +150 -0
  179. package/dist/prop-names.js.map +1 -0
  180. package/dist/prop-type-docs.d.ts +20 -0
  181. package/dist/prop-type-docs.d.ts.map +1 -0
  182. package/dist/prop-type-docs.js +89 -0
  183. package/dist/prop-type-docs.js.map +1 -0
  184. package/dist/prop-types.d.ts +97 -0
  185. package/dist/prop-types.d.ts.map +1 -0
  186. package/dist/prop-types.js +299 -0
  187. package/dist/prop-types.js.map +1 -0
  188. package/dist/props.d.ts +996 -0
  189. package/dist/props.d.ts.map +1 -0
  190. package/dist/props.js +183 -0
  191. package/dist/props.js.map +1 -0
  192. package/dist/proto-guard.d.ts +29 -0
  193. package/dist/proto-guard.d.ts.map +1 -0
  194. package/dist/proto-guard.js +79 -0
  195. package/dist/proto-guard.js.map +1 -0
  196. package/dist/runtime-errors.d.ts +42 -0
  197. package/dist/runtime-errors.d.ts.map +1 -0
  198. package/dist/runtime-errors.js +42 -0
  199. package/dist/runtime-errors.js.map +1 -0
  200. package/dist/runtime-pointers.d.ts +58 -0
  201. package/dist/runtime-pointers.d.ts.map +1 -0
  202. package/dist/runtime-pointers.js +84 -0
  203. package/dist/runtime-pointers.js.map +1 -0
  204. package/dist/secret-scan.d.ts +191 -0
  205. package/dist/secret-scan.d.ts.map +1 -0
  206. package/dist/secret-scan.js +542 -0
  207. package/dist/secret-scan.js.map +1 -0
  208. package/dist/semver.d.ts +89 -0
  209. package/dist/semver.d.ts.map +1 -0
  210. package/dist/semver.js +400 -0
  211. package/dist/semver.js.map +1 -0
  212. package/dist/server-key.d.ts +68 -0
  213. package/dist/server-key.d.ts.map +1 -0
  214. package/dist/server-key.js +150 -0
  215. package/dist/server-key.js.map +1 -0
  216. package/dist/site-manifest-keys.d.ts +107 -0
  217. package/dist/site-manifest-keys.d.ts.map +1 -0
  218. package/dist/site-manifest-keys.js +146 -0
  219. package/dist/site-manifest-keys.js.map +1 -0
  220. package/dist/site-manifest.d.ts +286 -0
  221. package/dist/site-manifest.d.ts.map +1 -0
  222. package/dist/site-manifest.js +100 -0
  223. package/dist/site-manifest.js.map +1 -0
  224. package/dist/source-archive.d.ts +119 -0
  225. package/dist/source-archive.d.ts.map +1 -0
  226. package/dist/source-archive.js +644 -0
  227. package/dist/source-archive.js.map +1 -0
  228. package/dist/source-package-corpus.d.ts +55 -0
  229. package/dist/source-package-corpus.d.ts.map +1 -0
  230. package/dist/source-package-corpus.js +303 -0
  231. package/dist/source-package-corpus.js.map +1 -0
  232. package/dist/source-package.d.ts +227 -0
  233. package/dist/source-package.d.ts.map +1 -0
  234. package/dist/source-package.js +361 -0
  235. package/dist/source-package.js.map +1 -0
  236. package/dist/source-secrets.d.ts +21 -0
  237. package/dist/source-secrets.d.ts.map +1 -0
  238. package/dist/source-secrets.js +43 -0
  239. package/dist/source-secrets.js.map +1 -0
  240. package/dist/ssr-cap.d.ts +61 -0
  241. package/dist/ssr-cap.d.ts.map +1 -0
  242. package/dist/ssr-cap.js +107 -0
  243. package/dist/ssr-cap.js.map +1 -0
  244. package/dist/ssr-kv.d.ts +18 -0
  245. package/dist/ssr-kv.d.ts.map +1 -0
  246. package/dist/ssr-kv.js +18 -0
  247. package/dist/ssr-kv.js.map +1 -0
  248. package/dist/ssr-version-ledger.d.ts +53 -0
  249. package/dist/ssr-version-ledger.d.ts.map +1 -0
  250. package/dist/ssr-version-ledger.js +88 -0
  251. package/dist/ssr-version-ledger.js.map +1 -0
  252. package/dist/style-references.d.ts +58 -0
  253. package/dist/style-references.d.ts.map +1 -0
  254. package/dist/style-references.js +241 -0
  255. package/dist/style-references.js.map +1 -0
  256. package/dist/tag-name.d.ts +87 -0
  257. package/dist/tag-name.d.ts.map +1 -0
  258. package/dist/tag-name.js +222 -0
  259. package/dist/tag-name.js.map +1 -0
  260. package/dist/tar-writer.d.ts +74 -0
  261. package/dist/tar-writer.d.ts.map +1 -0
  262. package/dist/tar-writer.js +148 -0
  263. package/dist/tar-writer.js.map +1 -0
  264. package/dist/testing.d.ts +11 -0
  265. package/dist/testing.d.ts.map +1 -0
  266. package/dist/testing.js +11 -0
  267. package/dist/testing.js.map +1 -0
  268. package/dist/text-codec.d.ts +36 -0
  269. package/dist/text-codec.d.ts.map +1 -0
  270. package/dist/text-codec.js +32 -0
  271. package/dist/text-codec.js.map +1 -0
  272. package/dist/url-value.d.ts +41 -0
  273. package/dist/url-value.d.ts.map +1 -0
  274. package/dist/url-value.js +147 -0
  275. package/dist/url-value.js.map +1 -0
  276. package/dist/usage-guard.d.ts +99 -0
  277. package/dist/usage-guard.d.ts.map +1 -0
  278. package/dist/usage-guard.js +104 -0
  279. package/dist/usage-guard.js.map +1 -0
  280. package/dist/usage-mirror.d.ts +55 -0
  281. package/dist/usage-mirror.d.ts.map +1 -0
  282. package/dist/usage-mirror.js +52 -0
  283. package/dist/usage-mirror.js.map +1 -0
  284. package/dist/value-check.d.ts +88 -0
  285. package/dist/value-check.d.ts.map +1 -0
  286. package/dist/value-check.js +279 -0
  287. package/dist/value-check.js.map +1 -0
  288. package/dist/value-patterns.d.ts +9 -0
  289. package/dist/value-patterns.d.ts.map +1 -0
  290. package/dist/value-patterns.js +17 -0
  291. package/dist/value-patterns.js.map +1 -0
  292. package/dist/value-schema.d.ts +796 -0
  293. package/dist/value-schema.d.ts.map +1 -0
  294. package/dist/value-schema.js +231 -0
  295. package/dist/value-schema.js.map +1 -0
  296. package/dist/zod-free.d.ts +60 -0
  297. package/dist/zod-free.d.ts.map +1 -0
  298. package/dist/zod-free.js +59 -0
  299. package/dist/zod-free.js.map +1 -0
  300. package/package.json +75 -3
  301. package/schema/DEPLOYED +12 -0
  302. package/schema/build-diagnostic.v1.json +63 -0
  303. package/schema/component-manifest.v1.json +1000 -0
  304. package/schema/data-api.v1.json +194 -0
  305. package/schema/library-manifest.v1.json +60 -0
  306. package/schema/published/SHA256SUMS +36 -0
  307. package/schema/published/build-diagnostic/v1.10.json +83 -0
  308. package/schema/published/build-diagnostic/v1.3.json +83 -0
  309. package/schema/published/build-diagnostic/v1.4.json +83 -0
  310. package/schema/published/build-diagnostic/v1.5.json +83 -0
  311. package/schema/published/build-diagnostic/v1.6.json +83 -0
  312. package/schema/published/build-diagnostic/v1.7.json +83 -0
  313. package/schema/published/build-diagnostic/v1.8.json +83 -0
  314. package/schema/published/build-diagnostic/v1.9.json +83 -0
  315. package/schema/published/component-manifest/v1.10.json +1443 -0
  316. package/schema/published/component-manifest/v1.3.json +1411 -0
  317. package/schema/published/component-manifest/v1.4.json +1419 -0
  318. package/schema/published/component-manifest/v1.5.json +1437 -0
  319. package/schema/published/component-manifest/v1.6.json +1437 -0
  320. package/schema/published/component-manifest/v1.7.json +1437 -0
  321. package/schema/published/component-manifest/v1.8.json +1437 -0
  322. package/schema/published/component-manifest/v1.9.json +1437 -0
  323. package/schema/published/data-api/v1.10.json +282 -0
  324. package/schema/published/data-api/v1.3.json +281 -0
  325. package/schema/published/data-api/v1.4.json +281 -0
  326. package/schema/published/data-api/v1.5.json +281 -0
  327. package/schema/published/data-api/v1.6.json +281 -0
  328. package/schema/published/data-api/v1.7.json +281 -0
  329. package/schema/published/data-api/v1.8.json +282 -0
  330. package/schema/published/data-api/v1.9.json +282 -0
  331. package/schema/published/library-manifest/v1.10.json +68 -0
  332. package/schema/published/library-manifest/v1.5.json +68 -0
  333. package/schema/published/library-manifest/v1.6.json +68 -0
  334. package/schema/published/library-manifest/v1.7.json +68 -0
  335. package/schema/published/library-manifest/v1.8.json +68 -0
  336. package/schema/published/library-manifest/v1.9.json +68 -0
  337. package/schema/published/taggor-config/v1.10.json +56 -0
  338. package/schema/published/taggor-config/v1.5.json +56 -0
  339. package/schema/published/taggor-config/v1.6.json +56 -0
  340. package/schema/published/taggor-config/v1.7.json +56 -0
  341. package/schema/published/taggor-config/v1.8.json +56 -0
  342. package/schema/published/taggor-config/v1.9.json +56 -0
  343. package/schema/taggor-config.v1.json +39 -0
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Component assets (TAG-213, contract 1.3), without Zod: the file types a component may import as an
3
+ * asset (`import logo from "./logo.svg"`), the content address every asset is served under, and
4
+ * the check of an asset URL the SDK's `useFont` runs before it registers a font.
5
+ *
6
+ * The builder (TAG-410) turns each asset import into a file named by the SHA-256 of its bytes,
7
+ * stored once and served by the edge with an immutable cache at `/a/<sha256>.<extension>`, on the
8
+ * same origin that serves the component's bundle; the import evaluates to that absolute URL. The
9
+ * manifest's `assets` lists them (type, size, hash) so the builder can apply the plan's limits and
10
+ * a site can write its CSP (`img-src` and `font-src` for the CDN origin). The runtime and the SDK
11
+ * may import this module through `@taggor/contract/zod-free`.
12
+ */
13
+ /**
14
+ * Asset types (MIME type → file extension of the content address). Closed list: anything else
15
+ * imported as a file is refused by the builder. Fonts are WOFF2 only (the format every supported
16
+ * browser reads, and the smallest).
17
+ */
18
+ export declare const ASSET_TYPES: Readonly<{
19
+ readonly "image/avif": "avif";
20
+ readonly "image/jpeg": "jpg";
21
+ readonly "image/png": "png";
22
+ readonly "image/svg+xml": "svg";
23
+ readonly "image/webp": "webp";
24
+ readonly "font/woff2": "woff2";
25
+ }>;
26
+ /** One asset MIME type of `ASSET_TYPES`. */
27
+ export type AssetType = keyof typeof ASSET_TYPES;
28
+ /**
29
+ * File extensions a source package may hold as an asset (TAG-410), with the asset type each one
30
+ * is: the extensions of `ASSET_TYPES` plus `jpeg` (stored as `jpg`), the same list
31
+ * `@taggor/component/assets` declares modules for. The archive reader keeps these files as bytes,
32
+ * not text. Frozen.
33
+ */
34
+ export declare const ASSET_SOURCE_EXTENSIONS: Readonly<Record<string, AssetType>>;
35
+ /**
36
+ * The asset type of a file by its name (TAG-410).
37
+ *
38
+ * Inputs: a path or file name (`/src/logo.svg`). Output: the `AssetType` its extension names in
39
+ * `ASSET_SOURCE_EXTENSIONS` (lower case only, as the module declarations of
40
+ * `@taggor/component/assets` match), or `undefined` for any other file. Errors: none. Side effects:
41
+ * none.
42
+ */
43
+ export declare function assetTypeOfPath(path: string): AssetType | undefined;
44
+ /** An asset's hash, as the key of `assets` and in its URL: the SHA-256 of its bytes, lowercase hex. */
45
+ export declare const ASSET_HASH_PATTERN: RegExp;
46
+ /**
47
+ * Path of an asset on the CDN: `/a/<sha256>.<extension>`, with the hash and the extension as the
48
+ * two groups. Nothing else (no query, fragment or extra segment) is an asset path.
49
+ */
50
+ export declare const ASSET_PATH_PATTERN: RegExp;
51
+ /** An asset URL that passed `checkAssetUrl`: the SHA-256 of the file and the URL. */
52
+ export interface CheckedAssetUrl {
53
+ /** The 64-character lowercase hex hash of the path. */
54
+ readonly hash: string;
55
+ /** `<bundle origin>/a/<hash>.<extension>`, exactly. */
56
+ readonly url: string;
57
+ }
58
+ /**
59
+ * Checks that a URL is an asset served next to a component's bundle.
60
+ *
61
+ * Inputs: the asset URL (untrusted: a component's code or a page may pass anything), the extension it
62
+ * must have (`"woff2"` for fonts) and the URL of the component's bundle (its `import.meta.url`), whose
63
+ * origin is the only one assets come from. Output: `{ hash, url }` when `url` is exactly
64
+ * `<origin of the bundle>/a/<sha256>.<extension>`, the form the builder's asset imports evaluate
65
+ * to (TAG-410: `new URL("../a/<sha256>.<ext>", import.meta.url).href`); otherwise `undefined`
66
+ * (another origin, a relative, `data:` or `blob:` URL, user info, a query or fragment, upper-case
67
+ * hex, another extension, or a bundle URL that is not `http(s)`). The comparison is on the text,
68
+ * with no URL parser, so nothing is normalized into a match. Errors: never throws. Side effects:
69
+ * none.
70
+ */
71
+ export declare function checkAssetUrl(url: unknown, extension: string, bundleUrl: unknown): CheckedAssetUrl | undefined;
72
+ //# sourceMappingURL=assets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../src/assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;EAOb,CAAC;AAEZ,4CAA4C;AAC5C,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,WAAW,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CASpE,CAAC;AAEL;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAQnE;AAED,uGAAuG;AACvG,eAAO,MAAM,kBAAkB,QAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAyD,CAAC;AAQzF,qFAAqF;AACrF,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,OAAO,GACjB,eAAe,GAAG,SAAS,CAM7B"}
package/dist/assets.js ADDED
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Component assets (TAG-213, contract 1.3), without Zod: the file types a component may import as an
3
+ * asset (`import logo from "./logo.svg"`), the content address every asset is served under, and
4
+ * the check of an asset URL the SDK's `useFont` runs before it registers a font.
5
+ *
6
+ * The builder (TAG-410) turns each asset import into a file named by the SHA-256 of its bytes,
7
+ * stored once and served by the edge with an immutable cache at `/a/<sha256>.<extension>`, on the
8
+ * same origin that serves the component's bundle; the import evaluates to that absolute URL. The
9
+ * manifest's `assets` lists them (type, size, hash) so the builder can apply the plan's limits and
10
+ * a site can write its CSP (`img-src` and `font-src` for the CDN origin). The runtime and the SDK
11
+ * may import this module through `@taggor/contract/zod-free`.
12
+ */
13
+ /**
14
+ * Asset types (MIME type → file extension of the content address). Closed list: anything else
15
+ * imported as a file is refused by the builder. Fonts are WOFF2 only (the format every supported
16
+ * browser reads, and the smallest).
17
+ */
18
+ export const ASSET_TYPES = /* @__PURE__ */ Object.freeze({
19
+ "image/avif": "avif",
20
+ "image/jpeg": "jpg",
21
+ "image/png": "png",
22
+ "image/svg+xml": "svg",
23
+ "image/webp": "webp",
24
+ "font/woff2": "woff2",
25
+ });
26
+ /**
27
+ * File extensions a source package may hold as an asset (TAG-410), with the asset type each one
28
+ * is: the extensions of `ASSET_TYPES` plus `jpeg` (stored as `jpg`), the same list
29
+ * `@taggor/component/assets` declares modules for. The archive reader keeps these files as bytes,
30
+ * not text. Frozen.
31
+ */
32
+ export const ASSET_SOURCE_EXTENSIONS =
33
+ /* @__PURE__ */ Object.freeze({
34
+ avif: "image/avif",
35
+ jpeg: "image/jpeg",
36
+ jpg: "image/jpeg",
37
+ png: "image/png",
38
+ svg: "image/svg+xml",
39
+ webp: "image/webp",
40
+ woff2: "font/woff2",
41
+ });
42
+ /**
43
+ * The asset type of a file by its name (TAG-410).
44
+ *
45
+ * Inputs: a path or file name (`/src/logo.svg`). Output: the `AssetType` its extension names in
46
+ * `ASSET_SOURCE_EXTENSIONS` (lower case only, as the module declarations of
47
+ * `@taggor/component/assets` match), or `undefined` for any other file. Errors: none. Side effects:
48
+ * none.
49
+ */
50
+ export function assetTypeOfPath(path) {
51
+ const name = path.slice(path.lastIndexOf("/") + 1);
52
+ const dot = name.lastIndexOf(".");
53
+ if (dot <= 0)
54
+ return undefined;
55
+ const extension = name.slice(dot + 1);
56
+ return Object.hasOwn(ASSET_SOURCE_EXTENSIONS, extension)
57
+ ? ASSET_SOURCE_EXTENSIONS[extension]
58
+ : undefined;
59
+ }
60
+ /** An asset's hash, as the key of `assets` and in its URL: the SHA-256 of its bytes, lowercase hex. */
61
+ export const ASSET_HASH_PATTERN = /^[0-9a-f]{64}$/;
62
+ /**
63
+ * Path of an asset on the CDN: `/a/<sha256>.<extension>`, with the hash and the extension as the
64
+ * two groups. Nothing else (no query, fragment or extra segment) is an asset path.
65
+ */
66
+ export const ASSET_PATH_PATTERN = /^\/a\/([0-9a-f]{64})\.(avif|jpg|png|svg|webp|woff2)$/;
67
+ /**
68
+ * Scheme and authority of an `http(s)` URL, without user info: what `URL.origin` gives for a
69
+ * canonical URL such as `import.meta.url` (no `URL` here, the contract has no DOM or Node types).
70
+ */
71
+ const HTTP_ORIGIN_PATTERN = /^https?:\/\/[^/?#\\@\s]+(?=[/?#]|$)/;
72
+ /**
73
+ * Checks that a URL is an asset served next to a component's bundle.
74
+ *
75
+ * Inputs: the asset URL (untrusted: a component's code or a page may pass anything), the extension it
76
+ * must have (`"woff2"` for fonts) and the URL of the component's bundle (its `import.meta.url`), whose
77
+ * origin is the only one assets come from. Output: `{ hash, url }` when `url` is exactly
78
+ * `<origin of the bundle>/a/<sha256>.<extension>`, the form the builder's asset imports evaluate
79
+ * to (TAG-410: `new URL("../a/<sha256>.<ext>", import.meta.url).href`); otherwise `undefined`
80
+ * (another origin, a relative, `data:` or `blob:` URL, user info, a query or fragment, upper-case
81
+ * hex, another extension, or a bundle URL that is not `http(s)`). The comparison is on the text,
82
+ * with no URL parser, so nothing is normalized into a match. Errors: never throws. Side effects:
83
+ * none.
84
+ */
85
+ export function checkAssetUrl(url, extension, bundleUrl) {
86
+ if (typeof url !== "string" || typeof bundleUrl !== "string")
87
+ return undefined;
88
+ const origin = HTTP_ORIGIN_PATTERN.exec(bundleUrl)?.[0];
89
+ if (origin === undefined || !url.startsWith(origin))
90
+ return undefined;
91
+ const path = ASSET_PATH_PATTERN.exec(url.slice(origin.length));
92
+ return path?.[2] === extension ? { hash: path[1], url } : undefined;
93
+ }
94
+ //# sourceMappingURL=assets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assets.js","sourceRoot":"","sources":["../src/assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC;IACvD,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,KAAK;IACnB,WA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AK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC/E,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxD,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IACtE,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/D,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAW,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAChF,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Bounds paths and names taken from untrusted input before they reach a log line or the portal
3
+ * (TAG-220). A key of decoded JSON may be megabytes long, hold a newline that forges a log line,
4
+ * or a bidi override (U+202E) that makes the portal show another text; issue paths and messages
5
+ * quote such keys, so they go through `boundedPath` or `boundedSegment` first.
6
+ *
7
+ * Zod-free and pure (the runtime may use it through `findOwnProtoKey`).
8
+ */
9
+ /** Most characters (code points) of one path segment, the cut marker included. */
10
+ export declare const PROTO_PATH_MAX_SEGMENT_LENGTH = 64;
11
+ /** Most segments of a path, the elision marker included. */
12
+ export declare const PROTO_PATH_MAX_SEGMENTS = 32;
13
+ /**
14
+ * Bounds one segment (a key or a name) for a log line.
15
+ *
16
+ * Inputs: any string. Output: at most `PROTO_PATH_MAX_SEGMENT_LENGTH` code points, ending in `…`
17
+ * when cut (never splitting a surrogate pair), with every unsafe character (see above) replaced
18
+ * by U+FFFD. Errors: none. Side effects: none.
19
+ */
20
+ export declare function boundedSegment(segment: string): string;
21
+ /**
22
+ * Joins path segments with dots for a log line.
23
+ *
24
+ * Inputs: the segments, outermost first. Output: each segment through `boundedSegment`; a path of
25
+ * more than `PROTO_PATH_MAX_SEGMENTS` segments keeps its first and last ones around a `…`
26
+ * segment, so the result has at most that many. Errors: none. Side effects: none.
27
+ */
28
+ export declare function boundedPath(segments: readonly string[]): string;
29
+ //# sourceMappingURL=bounded-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bounded-path.d.ts","sourceRoot":"","sources":["../src/bounded-path.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,kFAAkF;AAClF,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,4DAA4D;AAC5D,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAY1C;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAUtD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAW/D"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Bounds paths and names taken from untrusted input before they reach a log line or the portal
3
+ * (TAG-220). A key of decoded JSON may be megabytes long, hold a newline that forges a log line,
4
+ * or a bidi override (U+202E) that makes the portal show another text; issue paths and messages
5
+ * quote such keys, so they go through `boundedPath` or `boundedSegment` first.
6
+ *
7
+ * Zod-free and pure (the runtime may use it through `findOwnProtoKey`).
8
+ */
9
+ /** Most characters (code points) of one path segment, the cut marker included. */
10
+ export const PROTO_PATH_MAX_SEGMENT_LENGTH = 64;
11
+ /** Most segments of a path, the elision marker included. */
12
+ export const PROTO_PATH_MAX_SEGMENTS = 32;
13
+ /** Marks a cut segment and the elided middle of a deep path. */
14
+ const ELLIPSIS = "\u2026";
15
+ /**
16
+ * Characters replaced by U+FFFD: controls (newline, NUL), format characters (bidi overrides such
17
+ * as U+202E, zero-width U+200B), line and paragraph separators (U+2028, U+2029) and, with the `u`
18
+ * flag, lone surrogates.
19
+ */
20
+ const UNSAFE_CHARACTER = /[\p{Cc}\p{Cf}\p{Zl}\p{Zp}\p{Cs}]/gu;
21
+ /**
22
+ * Bounds one segment (a key or a name) for a log line.
23
+ *
24
+ * Inputs: any string. Output: at most `PROTO_PATH_MAX_SEGMENT_LENGTH` code points, ending in `…`
25
+ * when cut (never splitting a surrogate pair), with every unsafe character (see above) replaced
26
+ * by U+FFFD. Errors: none. Side effects: none.
27
+ */
28
+ export function boundedSegment(segment) {
29
+ const points = [];
30
+ for (const point of segment) {
31
+ if (points.length === PROTO_PATH_MAX_SEGMENT_LENGTH) {
32
+ points[PROTO_PATH_MAX_SEGMENT_LENGTH - 1] = ELLIPSIS;
33
+ break;
34
+ }
35
+ points.push(point);
36
+ }
37
+ return points.join("").replace(UNSAFE_CHARACTER, "\uFFFD");
38
+ }
39
+ /**
40
+ * Joins path segments with dots for a log line.
41
+ *
42
+ * Inputs: the segments, outermost first. Output: each segment through `boundedSegment`; a path of
43
+ * more than `PROTO_PATH_MAX_SEGMENTS` segments keeps its first and last ones around a `…`
44
+ * segment, so the result has at most that many. Errors: none. Side effects: none.
45
+ */
46
+ export function boundedPath(segments) {
47
+ const half = Math.floor((PROTO_PATH_MAX_SEGMENTS - 1) / 2);
48
+ const kept = segments.length > PROTO_PATH_MAX_SEGMENTS
49
+ ? [
50
+ ...segments.slice(0, PROTO_PATH_MAX_SEGMENTS - 1 - half),
51
+ ELLIPSIS,
52
+ ...segments.slice(-half),
53
+ ]
54
+ : segments;
55
+ return kept.map(boundedSegment).join(".");
56
+ }
57
+ //# sourceMappingURL=bounded-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bounded-path.js","sourceRoot":"","sources":["../src/bounded-path.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,kFAAkF;AAClF,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAEhD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C,gEAAgE;AAChE,MAAM,QAAQ,GAAG,QAAQ,CAAC;AAE1B;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,oCAAoC,CAAC;AAE9D;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,MAAM,CAAC,MAAM,KAAK,6BAA6B,EAAE,CAAC;YACpD,MAAM,CAAC,6BAA6B,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;YACrD,MAAM;QACR,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,QAA2B;IACrD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,uBAAuB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3D,MAAM,IAAI,GACR,QAAQ,CAAC,MAAM,GAAG,uBAAuB;QACvC,CAAC,CAAC;YACE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,uBAAuB,GAAG,CAAC,GAAG,IAAI,CAAC;YACxD,QAAQ;YACR,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;SACzB;QACH,CAAC,CAAC,QAAQ,CAAC;IACf,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Bounded building blocks shared by the contract schemas (TAG-201): records with a maximum number
3
+ * of keys, arrays without duplicates, plain text and declared CSS values.
4
+ *
5
+ * Zod has no native "max keys" for records nor "unique items" for arrays, so each helper pairs a
6
+ * refinement (what Zod checks) with the matching JSON Schema keyword in `.meta()` (what the
7
+ * generated schema checks). Both sides read the same number, so they cannot drift.
8
+ */
9
+ import * as z from "zod";
10
+ /**
11
+ * Record keyed by a validated name, with between `minKeys` and `maxKeys` entries.
12
+ *
13
+ * Inputs: the key schema (a bounded pattern string), the value schema, the key limits and a noun
14
+ * used in the error message ("props", "events"…). Output: a Zod record that also emits
15
+ * `maxProperties` (and `minProperties` when above 0) in JSON Schema. Errors: parsing reports
16
+ * `"<label>: at most N entries"` or `"<label>: at least N entries"`. Side effects: none.
17
+ */
18
+ export declare function boundedRecord<K extends z.ZodString, V extends z.ZodType>(key: K, value: V, maxKeys: number, label: string, minKeys?: number): z.ZodRecord<K, V>;
19
+ /**
20
+ * Array of distinct items, between `minItems` and `maxItems` long.
21
+ *
22
+ * Inputs: the item schema (strings or numbers, compared with `===`), the bounds and a noun for the
23
+ * error message. Output: a Zod array that also emits `uniqueItems: true` in JSON Schema.
24
+ * Errors: parsing reports `"<label> must not contain duplicates"`. Side effects: none.
25
+ */
26
+ export declare function uniqueArray<T extends z.ZodType<string | number>>(item: T, minItems: number, maxItems: number, label: string): z.ZodArray<T>;
27
+ /**
28
+ * Human text (title, description): bounded, no control characters. It is never interpreted as
29
+ * HTML; every consumer escapes it on output.
30
+ *
31
+ * Inputs: the maximum length. Output: a Zod string schema (min length 1). Errors: none at build
32
+ * time. Side effects: none.
33
+ */
34
+ export declare function plainText(maxLength: number): z.ZodString;
35
+ /** Optional description shared by every declared member (prop, event, slot, part, field…). */
36
+ export declare const memberDescriptionSchema: z.ZodOptional<z.ZodString>;
37
+ /**
38
+ * Builds the schema of a declared CSS value (moved here from css-value.ts by TAG-205, so that
39
+ * module stays free of Zod). Same rules as `isCssValue`.
40
+ *
41
+ * Inputs: the maximum length, the allowlist pattern (`CSS_VALUE_PATTERN` or `FONT_FAMILY_PATTERN`)
42
+ * and a noun for the messages ("color default"…). Output: a Zod string schema (min length 1).
43
+ * Errors: none at build time; parsing reports characters or functions outside the allowlist, or
44
+ * unbalanced parentheses. Side effects: none.
45
+ */
46
+ export declare function cssValueSchema(maxLength: number, pattern: RegExp, label: string): z.ZodString;
47
+ //# sourceMappingURL=bounded.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bounded.d.ts","sourceRoot":"","sources":["../src/bounded.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAKzB;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC,OAAO,EACtE,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,SAAI,qBAeZ;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,EAC9D,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,iBAWd;AAKD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,eAM1C;AAED,8FAA8F;AAC9F,eAAO,MAAM,uBAAuB,4BAEyD,CAAC;AAE9F;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAY/E"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Bounded building blocks shared by the contract schemas (TAG-201): records with a maximum number
3
+ * of keys, arrays without duplicates, plain text and declared CSS values.
4
+ *
5
+ * Zod has no native "max keys" for records nor "unique items" for arrays, so each helper pairs a
6
+ * refinement (what Zod checks) with the matching JSON Schema keyword in `.meta()` (what the
7
+ * generated schema checks). Both sides read the same number, so they cannot drift.
8
+ */
9
+ import * as z from "zod";
10
+ import { CSS_FUNCTIONS, hasBalancedParentheses } from "./css-value.js";
11
+ import { MANIFEST_LIMITS } from "./limits.js";
12
+ /**
13
+ * Record keyed by a validated name, with between `minKeys` and `maxKeys` entries.
14
+ *
15
+ * Inputs: the key schema (a bounded pattern string), the value schema, the key limits and a noun
16
+ * used in the error message ("props", "events"…). Output: a Zod record that also emits
17
+ * `maxProperties` (and `minProperties` when above 0) in JSON Schema. Errors: parsing reports
18
+ * `"<label>: at most N entries"` or `"<label>: at least N entries"`. Side effects: none.
19
+ */
20
+ export function boundedRecord(key, value, maxKeys, label, minKeys = 0) {
21
+ return z
22
+ .record(key, value)
23
+ .refine((record) => Object.keys(record).length <= maxKeys, {
24
+ // json-schema: maxProperties (the .meta below)
25
+ error: `${label}: at most ${String(maxKeys)} entries`,
26
+ })
27
+ .refine((record) => Object.keys(record).length >= minKeys, {
28
+ // json-schema: minProperties (the .meta below)
29
+ error: `${label}: at least ${String(minKeys)} entries`,
30
+ })
31
+ .meta(minKeys > 0 ? { minProperties: minKeys, maxProperties: maxKeys } : { maxProperties: maxKeys });
32
+ }
33
+ /**
34
+ * Array of distinct items, between `minItems` and `maxItems` long.
35
+ *
36
+ * Inputs: the item schema (strings or numbers, compared with `===`), the bounds and a noun for the
37
+ * error message. Output: a Zod array that also emits `uniqueItems: true` in JSON Schema.
38
+ * Errors: parsing reports `"<label> must not contain duplicates"`. Side effects: none.
39
+ */
40
+ export function uniqueArray(item, minItems, maxItems, label) {
41
+ return z
42
+ .array(item)
43
+ .min(minItems, { error: `${label}: at least ${String(minItems)} item(s)` })
44
+ .max(maxItems, { error: `${label}: at most ${String(maxItems)} items` })
45
+ .refine((items) => new Set(items).size === items.length, {
46
+ // json-schema: uniqueItems (the .meta below)
47
+ error: `${label} must not contain duplicates`,
48
+ })
49
+ .meta({ uniqueItems: true });
50
+ }
51
+ /** Control characters other than tab, line feed and carriage return are refused in text. */
52
+ const PLAIN_TEXT_PATTERN = /^[^\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]*$/;
53
+ /**
54
+ * Human text (title, description): bounded, no control characters. It is never interpreted as
55
+ * HTML; every consumer escapes it on output.
56
+ *
57
+ * Inputs: the maximum length. Output: a Zod string schema (min length 1). Errors: none at build
58
+ * time. Side effects: none.
59
+ */
60
+ export function plainText(maxLength) {
61
+ return z
62
+ .string()
63
+ .min(1, { error: "must not be empty" })
64
+ .max(maxLength, { error: `must be at most ${String(maxLength)} characters` })
65
+ .regex(PLAIN_TEXT_PATTERN, { error: "must not contain control characters" });
66
+ }
67
+ /** Optional description shared by every declared member (prop, event, slot, part, field…). */
68
+ export const memberDescriptionSchema = plainText(MANIFEST_LIMITS.memberDescriptionMaxLength)
69
+ .optional()
70
+ .meta({ description: "What this member is for; shown in docs, the portal and to agents." });
71
+ /**
72
+ * Builds the schema of a declared CSS value (moved here from css-value.ts by TAG-205, so that
73
+ * module stays free of Zod). Same rules as `isCssValue`.
74
+ *
75
+ * Inputs: the maximum length, the allowlist pattern (`CSS_VALUE_PATTERN` or `FONT_FAMILY_PATTERN`)
76
+ * and a noun for the messages ("color default"…). Output: a Zod string schema (min length 1).
77
+ * Errors: none at build time; parsing reports characters or functions outside the allowlist, or
78
+ * unbalanced parentheses. Side effects: none.
79
+ */
80
+ export function cssValueSchema(maxLength, pattern, label) {
81
+ return z
82
+ .string()
83
+ .min(1, { error: `${label} must not be empty` })
84
+ .max(maxLength, { error: `${label} must be at most ${String(maxLength)} characters` })
85
+ .regex(pattern, {
86
+ error: `${label} must only use the CSS value allowlist (functions: ${CSS_FUNCTIONS.join(", ")})`,
87
+ })
88
+ .refine(hasBalancedParentheses, {
89
+ // zod-only: css-balanced-parentheses
90
+ error: `${label} has unbalanced parentheses`,
91
+ });
92
+ }
93
+ //# sourceMappingURL=bounded.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bounded.js","sourceRoot":"","sources":["../src/bounded.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAE,aAAa,EA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jG,CAAC;SACD,MAAM,CAAC,sBAAsB,EAAE;QAC9B,qCAAqC;QACrC,KAAK,EAAE,GAAG,KAAK,6BAA6B;KAC7C,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * `BuildDiagnostic` (TAG-404): one error or warning of a build, in the shape an agent acts on.
3
+ *
4
+ * Every problem the builder finds (bundler, type check, manifest, gates, infrastructure) is
5
+ * normalized to this: a stable `code` from `diagnosticCatalog` (or `TS2322` from the type check),
6
+ * the `severity`, the position in the source package (`file`, `line`, `column`, the quoted
7
+ * `snippet`) or in the manifest (`manifestPath`), a `message` in English, a `hint` with the fix
8
+ * and the `docsUrl` of the code's page. `GET /v1/builds/{id}` (TAG-910), the CLI and the MCP pass
9
+ * these on unchanged. The container that produces them runs customer code, so the Worker parses
10
+ * them with this schema again (FC-12): every string is bounded and `file` is always relative.
11
+ *
12
+ * Two schemas since TAG-234 (ADR 0021): `buildDiagnosticWireSchema` is the published format,
13
+ * whose `code` is any string in the catalog's format, so a new catalog code changes no published
14
+ * JSON Schema; clients read with it and treat a code they do not know as generic.
15
+ * `buildDiagnosticSchema` is the same object restricted to this package's catalog: what Taggor
16
+ * emits and what the Worker accepts back from the container.
17
+ */
18
+ import * as z from "zod";
19
+ import { type DiagnosticCode } from "./diagnostic-catalog.js";
20
+ /**
21
+ * A path inside the source package: relative (no leading `/`), `/` separators, no `.` or `..`
22
+ * segment, no empty segment, no backslash and no control character.
23
+ */
24
+ export declare const DIAGNOSTIC_FILE_PATTERN: RegExp;
25
+ /** A `docsUrl`: the catalog page of the code, with `#TSxxxx` for a TypeScript code. */
26
+ export declare const DIAGNOSTIC_DOCS_URL_PATTERN: RegExp;
27
+ /**
28
+ * A build diagnostic code as published (TAG-234): any string in the catalog's format, bounded,
29
+ * known to this package or not. The JSON Schema of `code` is this, never the list of codes.
30
+ */
31
+ export declare const diagnosticCodeFormatSchema: z.ZodString;
32
+ /** A build diagnostic code Taggor emits: a named catalog code or a TypeScript code. */
33
+ export declare const diagnosticCodeSchema: z.ZodType<DiagnosticCode, DiagnosticCode>;
34
+ /**
35
+ * The published schema of one build diagnostic (TAG-234): the source of
36
+ * `schema/build-diagnostic.v1.json`. Strict: an unknown key is refused. `code` is any code in the
37
+ * catalog's format (`diagnosticCodeFormatSchema`), so adding a code to `diagnosticCatalog` does
38
+ * not change it. Clients of `GET /v1/builds/{id}` (CLI, MCP, portal) parse with this one and show
39
+ * a code they do not know as a generic diagnostic: its `severity`, `message`, `hint` and
40
+ * `docsUrl` say everything an agent needs.
41
+ *
42
+ * `line` and `column` are 1-based, the column counted in UTF-16 code units (what editors show).
43
+ * `file`, `line`, `column` and `snippet` exist only when the problem is at a place in the
44
+ * package; `manifestPath` only when it is a field of the declaration (`MANIFEST_INVALID`).
45
+ * Every text field is untrusted (it can quote the customer's source): no control, bidi or line
46
+ * separator character and no lone surrogate (`DIAGNOSTIC_TEXT_PATTERN`); consumers still render
47
+ * it as text, never as HTML or terminal markup.
48
+ */
49
+ export declare const buildDiagnosticWireSchema: z.ZodObject<{
50
+ severity: z.ZodEnum<{
51
+ error: "error";
52
+ warning: "warning";
53
+ }>;
54
+ message: z.ZodString;
55
+ hint: z.ZodString;
56
+ docsUrl: z.ZodString;
57
+ file: z.ZodOptional<z.ZodString>;
58
+ line: z.ZodOptional<z.ZodNumber>;
59
+ column: z.ZodOptional<z.ZodNumber>;
60
+ snippet: z.ZodOptional<z.ZodString>;
61
+ manifestPath: z.ZodOptional<z.ZodString>;
62
+ code: z.ZodString;
63
+ }, z.core.$strict>;
64
+ /** One build diagnostic as published: `code` may be one this package does not know. */
65
+ export type WireBuildDiagnostic = z.infer<typeof buildDiagnosticWireSchema>;
66
+ /**
67
+ * The schema of one build diagnostic Taggor emits: `buildDiagnosticWireSchema` with `code`
68
+ * restricted to this package's catalog (`diagnosticCodeSchema`). The builder parses the
69
+ * container's diagnostics with it, so customer code cannot make up a code; it is never the
70
+ * source of a published JSON Schema.
71
+ */
72
+ export declare const buildDiagnosticSchema: z.ZodObject<{
73
+ severity: z.ZodEnum<{
74
+ error: "error";
75
+ warning: "warning";
76
+ }>;
77
+ message: z.ZodString;
78
+ hint: z.ZodString;
79
+ docsUrl: z.ZodString;
80
+ file: z.ZodOptional<z.ZodString>;
81
+ line: z.ZodOptional<z.ZodNumber>;
82
+ column: z.ZodOptional<z.ZodNumber>;
83
+ snippet: z.ZodOptional<z.ZodString>;
84
+ manifestPath: z.ZodOptional<z.ZodString>;
85
+ code: z.ZodType<DiagnosticCode, DiagnosticCode, z.core.$ZodTypeInternals<DiagnosticCode, DiagnosticCode>>;
86
+ }, z.core.$strict>;
87
+ /** One build diagnostic Taggor emits, as `buildDiagnosticSchema` accepts it. */
88
+ export type BuildDiagnostic = z.infer<typeof buildDiagnosticSchema>;
89
+ //# sourceMappingURL=build-diagnostic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-diagnostic.d.ts","sourceRoot":"","sources":["../src/build-diagnostic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAOL,KAAK,cAAc,EAGpB,MAAM,yBAAyB,CAAC;AAIjC;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QACgD,CAAC;AAErF,uFAAuF;AACvF,eAAO,MAAM,2BAA2B,QAEvC,CAAC;AAaF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,aAGN,CAAC;AAElC,uFAAuF;AACvF,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAGzE,CAAC;AAoBH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;kBAOlC,CAAC;AAEL,uFAAuF;AACvF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;kBAA+D,CAAC;AAElG,gFAAgF;AAChF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * `BuildDiagnostic` (TAG-404): one error or warning of a build, in the shape an agent acts on.
3
+ *
4
+ * Every problem the builder finds (bundler, type check, manifest, gates, infrastructure) is
5
+ * normalized to this: a stable `code` from `diagnosticCatalog` (or `TS2322` from the type check),
6
+ * the `severity`, the position in the source package (`file`, `line`, `column`, the quoted
7
+ * `snippet`) or in the manifest (`manifestPath`), a `message` in English, a `hint` with the fix
8
+ * and the `docsUrl` of the code's page. `GET /v1/builds/{id}` (TAG-910), the CLI and the MCP pass
9
+ * these on unchanged. The container that produces them runs customer code, so the Worker parses
10
+ * them with this schema again (FC-12): every string is bounded and `file` is always relative.
11
+ *
12
+ * Two schemas since TAG-234 (ADR 0021): `buildDiagnosticWireSchema` is the published format,
13
+ * whose `code` is any string in the catalog's format, so a new catalog code changes no published
14
+ * JSON Schema; clients read with it and treat a code they do not know as generic.
15
+ * `buildDiagnosticSchema` is the same object restricted to this package's catalog: what Taggor
16
+ * emits and what the Worker accepts back from the container.
17
+ */
18
+ import * as z from "zod";
19
+ import { BUILD_DIAGNOSTIC_LIMITS, DIAGNOSTIC_CODE_PATTERN, DIAGNOSTIC_DOCS_BASE_URL, DIAGNOSTIC_TEXT_PATTERN, NAMED_DIAGNOSTIC_CODES, TYPESCRIPT_DIAGNOSTIC_PATTERN, } from "./diagnostic-catalog.js";
20
+ const L = BUILD_DIAGNOSTIC_LIMITS;
21
+ /**
22
+ * A path inside the source package: relative (no leading `/`), `/` separators, no `.` or `..`
23
+ * segment, no empty segment, no backslash and no control character.
24
+ */
25
+ export const DIAGNOSTIC_FILE_PATTERN = /^(?!\/)(?!.*\/\/)(?!(?:.*\/)?\.{1,2}(?:\/|$))(?!.*\/$)[^\\\u0000-\u001f\u007f]+$/;
26
+ /** A `docsUrl`: the catalog page of the code, with `#TSxxxx` for a TypeScript code. */
27
+ export const DIAGNOSTIC_DOCS_URL_PATTERN = new RegExp(`^${DIAGNOSTIC_DOCS_BASE_URL.replaceAll(".", "\\.")}[A-Z][A-Z0-9_]*(?:#TS[1-9][0-9]{3,4})?$`);
28
+ const namedCode = z.enum(NAMED_DIAGNOSTIC_CODES);
29
+ // Zod infers `string` for a regex; the pattern is exactly `TS${number}` without sign or fraction.
30
+ const typescriptCode = z
31
+ .string()
32
+ .max(L.diagnosticCodeMaxLength)
33
+ .regex(TYPESCRIPT_DIAGNOSTIC_PATTERN);
34
+ /**
35
+ * A build diagnostic code as published (TAG-234): any string in the catalog's format, bounded,
36
+ * known to this package or not. The JSON Schema of `code` is this, never the list of codes.
37
+ */
38
+ export const diagnosticCodeFormatSchema = z
39
+ .string()
40
+ .max(L.diagnosticCodeMaxLength)
41
+ .regex(DIAGNOSTIC_CODE_PATTERN);
42
+ /** A build diagnostic code Taggor emits: a named catalog code or a TypeScript code. */
43
+ export const diagnosticCodeSchema = z.union([
44
+ namedCode,
45
+ typescriptCode,
46
+ ]);
47
+ const position = z.number().int().min(1).max(L.diagnosticPositionMax);
48
+ /** Untrusted text (from the customer's source): bounded, no control or bidi character, well-formed. */
49
+ const text = (max) => z.string().max(max).regex(DIAGNOSTIC_TEXT_PATTERN);
50
+ /** Every field but `code`, shared by the wire and the emitted schema. */
51
+ const fields = {
52
+ severity: z.enum(["error", "warning"]),
53
+ message: text(L.diagnosticMessageMaxLength).min(1),
54
+ hint: text(L.diagnosticHintMaxLength).min(1),
55
+ docsUrl: z.string().max(L.diagnosticDocsUrlMaxLength).regex(DIAGNOSTIC_DOCS_URL_PATTERN),
56
+ file: text(L.diagnosticFileMaxLength).min(1).regex(DIAGNOSTIC_FILE_PATTERN).optional(),
57
+ line: position.optional(),
58
+ column: position.optional(),
59
+ snippet: text(L.diagnosticSnippetMaxLength).optional(),
60
+ manifestPath: text(L.diagnosticManifestPathMaxLength).optional(),
61
+ };
62
+ /**
63
+ * The published schema of one build diagnostic (TAG-234): the source of
64
+ * `schema/build-diagnostic.v1.json`. Strict: an unknown key is refused. `code` is any code in the
65
+ * catalog's format (`diagnosticCodeFormatSchema`), so adding a code to `diagnosticCatalog` does
66
+ * not change it. Clients of `GET /v1/builds/{id}` (CLI, MCP, portal) parse with this one and show
67
+ * a code they do not know as a generic diagnostic: its `severity`, `message`, `hint` and
68
+ * `docsUrl` say everything an agent needs.
69
+ *
70
+ * `line` and `column` are 1-based, the column counted in UTF-16 code units (what editors show).
71
+ * `file`, `line`, `column` and `snippet` exist only when the problem is at a place in the
72
+ * package; `manifestPath` only when it is a field of the declaration (`MANIFEST_INVALID`).
73
+ * Every text field is untrusted (it can quote the customer's source): no control, bidi or line
74
+ * separator character and no lone surrogate (`DIAGNOSTIC_TEXT_PATTERN`); consumers still render
75
+ * it as text, never as HTML or terminal markup.
76
+ */
77
+ export const buildDiagnosticWireSchema = z
78
+ .object({ code: diagnosticCodeFormatSchema, ...fields })
79
+ .strict()
80
+ .meta({
81
+ id: "BuildDiagnostic",
82
+ description: "One error or warning of a component build. A code you do not know is a generic diagnostic: use its severity, message, hint and docsUrl. Generated from the Zod source in @taggor/contract; do not edit.",
83
+ });
84
+ /**
85
+ * The schema of one build diagnostic Taggor emits: `buildDiagnosticWireSchema` with `code`
86
+ * restricted to this package's catalog (`diagnosticCodeSchema`). The builder parses the
87
+ * container's diagnostics with it, so customer code cannot make up a code; it is never the
88
+ * source of a published JSON Schema.
89
+ */
90
+ export const buildDiagnosticSchema = z.object({ code: diagnosticCodeSchema, ...fields }).strict();
91
+ //# sourceMappingURL=build-diagnostic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-diagnostic.js","sourceRoot":"","sources":["../src/build-diagnostic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EACL,uBAA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