@taggor/contract 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 (339) 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 +72 -0
  93. package/dist/index.d.ts.map +1 -0
  94. package/dist/index.js +72 -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 +371 -0
  109. package/dist/limit-catalog.d.ts.map +1 -0
  110. package/dist/limit-catalog.js +414 -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/names.d.ts +37 -0
  145. package/dist/names.d.ts.map +1 -0
  146. package/dist/names.js +55 -0
  147. package/dist/names.js.map +1 -0
  148. package/dist/overage-pricing.d.ts +89 -0
  149. package/dist/overage-pricing.d.ts.map +1 -0
  150. package/dist/overage-pricing.js +170 -0
  151. package/dist/overage-pricing.js.map +1 -0
  152. package/dist/plan-ids.d.ts +10 -0
  153. package/dist/plan-ids.d.ts.map +1 -0
  154. package/dist/plan-ids.js +8 -0
  155. package/dist/plan-ids.js.map +1 -0
  156. package/dist/plan-limits.d.ts +138 -0
  157. package/dist/plan-limits.d.ts.map +1 -0
  158. package/dist/plan-limits.js +112 -0
  159. package/dist/plan-limits.js.map +1 -0
  160. package/dist/plan-pricing.d.ts +145 -0
  161. package/dist/plan-pricing.d.ts.map +1 -0
  162. package/dist/plan-pricing.js +172 -0
  163. package/dist/plan-pricing.js.map +1 -0
  164. package/dist/plan-usage.d.ts +112 -0
  165. package/dist/plan-usage.d.ts.map +1 -0
  166. package/dist/plan-usage.js +134 -0
  167. package/dist/plan-usage.js.map +1 -0
  168. package/dist/preview-token.d.ts +52 -0
  169. package/dist/preview-token.d.ts.map +1 -0
  170. package/dist/preview-token.js +106 -0
  171. package/dist/preview-token.js.map +1 -0
  172. package/dist/prop-names.d.ts +51 -0
  173. package/dist/prop-names.d.ts.map +1 -0
  174. package/dist/prop-names.js +150 -0
  175. package/dist/prop-names.js.map +1 -0
  176. package/dist/prop-type-docs.d.ts +20 -0
  177. package/dist/prop-type-docs.d.ts.map +1 -0
  178. package/dist/prop-type-docs.js +89 -0
  179. package/dist/prop-type-docs.js.map +1 -0
  180. package/dist/prop-types.d.ts +97 -0
  181. package/dist/prop-types.d.ts.map +1 -0
  182. package/dist/prop-types.js +299 -0
  183. package/dist/prop-types.js.map +1 -0
  184. package/dist/props.d.ts +996 -0
  185. package/dist/props.d.ts.map +1 -0
  186. package/dist/props.js +183 -0
  187. package/dist/props.js.map +1 -0
  188. package/dist/proto-guard.d.ts +29 -0
  189. package/dist/proto-guard.d.ts.map +1 -0
  190. package/dist/proto-guard.js +79 -0
  191. package/dist/proto-guard.js.map +1 -0
  192. package/dist/runtime-errors.d.ts +42 -0
  193. package/dist/runtime-errors.d.ts.map +1 -0
  194. package/dist/runtime-errors.js +42 -0
  195. package/dist/runtime-errors.js.map +1 -0
  196. package/dist/runtime-pointers.d.ts +58 -0
  197. package/dist/runtime-pointers.d.ts.map +1 -0
  198. package/dist/runtime-pointers.js +84 -0
  199. package/dist/runtime-pointers.js.map +1 -0
  200. package/dist/secret-scan.d.ts +191 -0
  201. package/dist/secret-scan.d.ts.map +1 -0
  202. package/dist/secret-scan.js +542 -0
  203. package/dist/secret-scan.js.map +1 -0
  204. package/dist/semver.d.ts +89 -0
  205. package/dist/semver.d.ts.map +1 -0
  206. package/dist/semver.js +400 -0
  207. package/dist/semver.js.map +1 -0
  208. package/dist/server-key.d.ts +68 -0
  209. package/dist/server-key.d.ts.map +1 -0
  210. package/dist/server-key.js +150 -0
  211. package/dist/server-key.js.map +1 -0
  212. package/dist/site-manifest-keys.d.ts +107 -0
  213. package/dist/site-manifest-keys.d.ts.map +1 -0
  214. package/dist/site-manifest-keys.js +146 -0
  215. package/dist/site-manifest-keys.js.map +1 -0
  216. package/dist/site-manifest.d.ts +286 -0
  217. package/dist/site-manifest.d.ts.map +1 -0
  218. package/dist/site-manifest.js +100 -0
  219. package/dist/site-manifest.js.map +1 -0
  220. package/dist/source-archive.d.ts +119 -0
  221. package/dist/source-archive.d.ts.map +1 -0
  222. package/dist/source-archive.js +644 -0
  223. package/dist/source-archive.js.map +1 -0
  224. package/dist/source-package-corpus.d.ts +55 -0
  225. package/dist/source-package-corpus.d.ts.map +1 -0
  226. package/dist/source-package-corpus.js +303 -0
  227. package/dist/source-package-corpus.js.map +1 -0
  228. package/dist/source-package.d.ts +227 -0
  229. package/dist/source-package.d.ts.map +1 -0
  230. package/dist/source-package.js +361 -0
  231. package/dist/source-package.js.map +1 -0
  232. package/dist/source-secrets.d.ts +21 -0
  233. package/dist/source-secrets.d.ts.map +1 -0
  234. package/dist/source-secrets.js +43 -0
  235. package/dist/source-secrets.js.map +1 -0
  236. package/dist/ssr-cap.d.ts +61 -0
  237. package/dist/ssr-cap.d.ts.map +1 -0
  238. package/dist/ssr-cap.js +107 -0
  239. package/dist/ssr-cap.js.map +1 -0
  240. package/dist/ssr-kv.d.ts +18 -0
  241. package/dist/ssr-kv.d.ts.map +1 -0
  242. package/dist/ssr-kv.js +18 -0
  243. package/dist/ssr-kv.js.map +1 -0
  244. package/dist/ssr-version-ledger.d.ts +53 -0
  245. package/dist/ssr-version-ledger.d.ts.map +1 -0
  246. package/dist/ssr-version-ledger.js +88 -0
  247. package/dist/ssr-version-ledger.js.map +1 -0
  248. package/dist/style-references.d.ts +58 -0
  249. package/dist/style-references.d.ts.map +1 -0
  250. package/dist/style-references.js +241 -0
  251. package/dist/style-references.js.map +1 -0
  252. package/dist/tag-name.d.ts +87 -0
  253. package/dist/tag-name.d.ts.map +1 -0
  254. package/dist/tag-name.js +222 -0
  255. package/dist/tag-name.js.map +1 -0
  256. package/dist/tar-writer.d.ts +74 -0
  257. package/dist/tar-writer.d.ts.map +1 -0
  258. package/dist/tar-writer.js +148 -0
  259. package/dist/tar-writer.js.map +1 -0
  260. package/dist/testing.d.ts +11 -0
  261. package/dist/testing.d.ts.map +1 -0
  262. package/dist/testing.js +11 -0
  263. package/dist/testing.js.map +1 -0
  264. package/dist/text-codec.d.ts +36 -0
  265. package/dist/text-codec.d.ts.map +1 -0
  266. package/dist/text-codec.js +32 -0
  267. package/dist/text-codec.js.map +1 -0
  268. package/dist/url-value.d.ts +41 -0
  269. package/dist/url-value.d.ts.map +1 -0
  270. package/dist/url-value.js +147 -0
  271. package/dist/url-value.js.map +1 -0
  272. package/dist/usage-guard.d.ts +99 -0
  273. package/dist/usage-guard.d.ts.map +1 -0
  274. package/dist/usage-guard.js +104 -0
  275. package/dist/usage-guard.js.map +1 -0
  276. package/dist/usage-mirror.d.ts +55 -0
  277. package/dist/usage-mirror.d.ts.map +1 -0
  278. package/dist/usage-mirror.js +52 -0
  279. package/dist/usage-mirror.js.map +1 -0
  280. package/dist/value-check.d.ts +88 -0
  281. package/dist/value-check.d.ts.map +1 -0
  282. package/dist/value-check.js +279 -0
  283. package/dist/value-check.js.map +1 -0
  284. package/dist/value-patterns.d.ts +9 -0
  285. package/dist/value-patterns.d.ts.map +1 -0
  286. package/dist/value-patterns.js +17 -0
  287. package/dist/value-patterns.js.map +1 -0
  288. package/dist/value-schema.d.ts +796 -0
  289. package/dist/value-schema.d.ts.map +1 -0
  290. package/dist/value-schema.js +231 -0
  291. package/dist/value-schema.js.map +1 -0
  292. package/dist/zod-free.d.ts +59 -0
  293. package/dist/zod-free.d.ts.map +1 -0
  294. package/dist/zod-free.js +57 -0
  295. package/dist/zod-free.js.map +1 -0
  296. package/package.json +75 -3
  297. package/schema/DEPLOYED +12 -0
  298. package/schema/build-diagnostic.v1.json +63 -0
  299. package/schema/component-manifest.v1.json +1000 -0
  300. package/schema/data-api.v1.json +194 -0
  301. package/schema/library-manifest.v1.json +60 -0
  302. package/schema/published/SHA256SUMS +36 -0
  303. package/schema/published/build-diagnostic/v1.10.json +83 -0
  304. package/schema/published/build-diagnostic/v1.3.json +83 -0
  305. package/schema/published/build-diagnostic/v1.4.json +83 -0
  306. package/schema/published/build-diagnostic/v1.5.json +83 -0
  307. package/schema/published/build-diagnostic/v1.6.json +83 -0
  308. package/schema/published/build-diagnostic/v1.7.json +83 -0
  309. package/schema/published/build-diagnostic/v1.8.json +83 -0
  310. package/schema/published/build-diagnostic/v1.9.json +83 -0
  311. package/schema/published/component-manifest/v1.10.json +1443 -0
  312. package/schema/published/component-manifest/v1.3.json +1411 -0
  313. package/schema/published/component-manifest/v1.4.json +1419 -0
  314. package/schema/published/component-manifest/v1.5.json +1437 -0
  315. package/schema/published/component-manifest/v1.6.json +1437 -0
  316. package/schema/published/component-manifest/v1.7.json +1437 -0
  317. package/schema/published/component-manifest/v1.8.json +1437 -0
  318. package/schema/published/component-manifest/v1.9.json +1437 -0
  319. package/schema/published/data-api/v1.10.json +282 -0
  320. package/schema/published/data-api/v1.3.json +281 -0
  321. package/schema/published/data-api/v1.4.json +281 -0
  322. package/schema/published/data-api/v1.5.json +281 -0
  323. package/schema/published/data-api/v1.6.json +281 -0
  324. package/schema/published/data-api/v1.7.json +281 -0
  325. package/schema/published/data-api/v1.8.json +282 -0
  326. package/schema/published/data-api/v1.9.json +282 -0
  327. package/schema/published/library-manifest/v1.10.json +68 -0
  328. package/schema/published/library-manifest/v1.5.json +68 -0
  329. package/schema/published/library-manifest/v1.6.json +68 -0
  330. package/schema/published/library-manifest/v1.7.json +68 -0
  331. package/schema/published/library-manifest/v1.8.json +68 -0
  332. package/schema/published/library-manifest/v1.9.json +68 -0
  333. package/schema/published/taggor-config/v1.10.json +56 -0
  334. package/schema/published/taggor-config/v1.5.json +56 -0
  335. package/schema/published/taggor-config/v1.6.json +56 -0
  336. package/schema/published/taggor-config/v1.7.json +56 -0
  337. package/schema/published/taggor-config/v1.8.json +56 -0
  338. package/schema/published/taggor-config/v1.9.json +56 -0
  339. package/schema/taggor-config.v1.json +39 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAW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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BA8BA,CAAC"}
package/dist/props.js ADDED
@@ -0,0 +1,183 @@
1
+ /**
2
+ * Prop declarations of component contract v1 (TAG-201).
3
+ *
4
+ * A prop is declared by its `type` and plain options; how an HTML attribute becomes a prop value is
5
+ * fully determined by that type (golden rule 5, ADR 0016): the runtime (TAG-303) never evaluates the
6
+ * attribute. The per-type parse table is `propTypeCatalog` (prop-types.ts, TAG-205); this module
7
+ * fixes the shape of each declaration and checks that a declared `default` fits it.
8
+ *
9
+ * TAG-207: the defaults of `array` and `object` props have a structural shape (JSON scalars,
10
+ * arrays and records keyed by field names, as deep as a value schema), so the JSON Schema refuses
11
+ * an own `__proto__` key in a default as `parseManifest` does, instead of accepting any JSON.
12
+ */
13
+ import * as z from "zod";
14
+ import { boundedRecord, cssValueSchema, memberDescriptionSchema, uniqueArray } from "./bounded.js";
15
+ import { CSS_VALUE_PATTERN } from "./css-value.js";
16
+ import { MANIFEST_LIMITS } from "./limits.js";
17
+ import { fieldNameSchema } from "./names.js";
18
+ import { DEFAULT_URL_PROTOCOLS, isAllowedUrl, URL_PROTOCOLS, URL_VALUE_PATTERN, } from "./url-value.js";
19
+ import { ISO_DATE_PATTERN } from "./value-patterns.js";
20
+ import { arrayValueSchema, booleanValueSchema, enumValueTypeSchema, numberValueSchema, objectValueSchema, stringValueSchema, nestedValueSchema, valueValidator, } from "./value-schema.js";
21
+ /** A color value: the CSS value allowlist (no `url()`); the runtime confirms it with `CSS.supports`. */
22
+ const colorValueSchema = cssValueSchema(MANIFEST_LIMITS.colorMaxLength, CSS_VALUE_PATTERN, "color");
23
+ const isoDateSchema = z
24
+ .string()
25
+ .regex(ISO_DATE_PATTERN, { error: "must be an existing ISO date (YYYY-MM-DD)" });
26
+ const URL_TEXT_RULE = "in printable ASCII without spaces, quotes, angle brackets, backticks or backslashes";
27
+ const stringPropSchema = stringValueSchema.safeExtend({
28
+ default: z.string().max(MANIFEST_LIMITS.stringMaxLength).optional(),
29
+ });
30
+ const numberPropSchema = numberValueSchema.safeExtend({
31
+ default: z.number().optional(),
32
+ step: z.number().positive().optional(),
33
+ });
34
+ const booleanPropSchema = booleanValueSchema.safeExtend({
35
+ // A boolean attribute is true when present; a default of true could never be switched off from
36
+ // HTML, so the only default is false (name the prop `hideX` instead of `showX`).
37
+ default: z.literal(false).optional(),
38
+ });
39
+ const enumPropSchema = enumValueTypeSchema.safeExtend({
40
+ default: z.string().max(MANIFEST_LIMITS.enumValueMaxLength).optional(),
41
+ });
42
+ const colorPropSchema = z.strictObject({
43
+ type: z.literal("color"),
44
+ description: memberDescriptionSchema,
45
+ default: colorValueSchema.optional(),
46
+ });
47
+ const urlPropSchema = z.strictObject({
48
+ type: z.literal("url"),
49
+ description: memberDescriptionSchema,
50
+ protocols: uniqueArray(z.enum(URL_PROTOCOLS), 1, URL_PROTOCOLS.length, "protocols")
51
+ .optional()
52
+ .meta({ description: 'Accepted URL schemes; defaults to ["https"].' }),
53
+ // Structural rule, also in the JSON Schema: whatever `protocols` says, a default starts with
54
+ // https://, http:// or mailto: (TAG-201 security review). The declared schemes are checked by
55
+ // the default check below (Zod only, `SEMANTIC_RULES`).
56
+ default: z
57
+ .string()
58
+ .max(MANIFEST_LIMITS.urlMaxLength)
59
+ .regex(URL_VALUE_PATTERN, {
60
+ error: `URL default must start with https://, http:// or mailto: and be ${URL_TEXT_RULE}`,
61
+ })
62
+ .optional(),
63
+ });
64
+ const datePropSchema = z.strictObject({
65
+ type: z.literal("date"),
66
+ description: memberDescriptionSchema,
67
+ min: isoDateSchema.optional(),
68
+ max: isoDateSchema.optional(),
69
+ default: isoDateSchema.optional(),
70
+ });
71
+ // The shape of an `array` or `object` default before the declaration check: JSON scalars, arrays
72
+ // and records keyed by field names, nested like a value schema (the prop is the first container).
73
+ // Every value this refuses was already refused by that check; the point is that the JSON Schema
74
+ // now refuses it too, `__proto__` keys and Object.prototype member names included.
75
+ const defaultScalarSchema = z.union([
76
+ z.string().max(MANIFEST_LIMITS.stringMaxLength),
77
+ z.number(),
78
+ z.boolean(),
79
+ ]);
80
+ function withDefaultContainers(inner) {
81
+ return z.union([
82
+ defaultScalarSchema,
83
+ z.array(inner).max(MANIFEST_LIMITS.arrayMaxItems),
84
+ boundedRecord(fieldNameSchema, inner, MANIFEST_LIMITS.maxObjectFields, "default fields"),
85
+ ]);
86
+ }
87
+ const defaultItemDepth1 = withDefaultContainers(defaultScalarSchema).meta({
88
+ id: "DefaultValueDepth1",
89
+ });
90
+ const defaultItemDepth2 = withDefaultContainers(defaultItemDepth1).meta({
91
+ id: "DefaultValueDepth2",
92
+ });
93
+ const arrayPropSchema = arrayValueSchema(nestedValueSchema).safeExtend({
94
+ default: z.array(defaultItemDepth2).max(MANIFEST_LIMITS.arrayMaxItems).optional(),
95
+ });
96
+ const objectPropSchema = objectValueSchema(nestedValueSchema).safeExtend({
97
+ default: boundedRecord(fieldNameSchema, defaultItemDepth2, MANIFEST_LIMITS.maxObjectFields, "default fields").optional(),
98
+ });
99
+ /** A prop declaration before the default check; exported only as the `PropDeclaration` type. */
100
+ const propVariantsSchema = z.discriminatedUnion("type", [
101
+ stringPropSchema,
102
+ numberPropSchema,
103
+ booleanPropSchema,
104
+ enumPropSchema,
105
+ colorPropSchema,
106
+ urlPropSchema,
107
+ datePropSchema,
108
+ arrayPropSchema,
109
+ objectPropSchema,
110
+ ]);
111
+ /**
112
+ * Builds the validator of a value for one declared prop: what a `default`, a property assignment
113
+ * or an already parsed attribute must satisfy.
114
+ *
115
+ * Inputs: a prop declaration. Output: a Zod schema with the same rules as the Zod-free
116
+ * `propTypeCatalog[type].accept` (TAG-205; a test keeps them in agreement): `color` gets the CSS
117
+ * value allowlist (the runtime may narrow it further with `CSS.supports`), `url` the scheme
118
+ * allowlist, the printable-ASCII rule and the WHATWG URL parser (`isAllowedUrl`). Errors: none at
119
+ * build time. Side effects: none.
120
+ */
121
+ export function propValueValidator(prop) {
122
+ switch (prop.type) {
123
+ case "color":
124
+ return colorValueSchema;
125
+ case "url": {
126
+ const protocols = prop.protocols ?? DEFAULT_URL_PROTOCOLS;
127
+ return z.string().refine((text) => isAllowedUrl(text, protocols), {
128
+ // value-validator: checks a value, not the manifest (the default check uses it)
129
+ error: `URL must use one of the schemes: ${protocols.join(", ")}, ${URL_TEXT_RULE}`,
130
+ });
131
+ }
132
+ case "date":
133
+ return isoDateSchema
134
+ .refine((date) => prop.min === undefined || date >= prop.min, {
135
+ // value-validator: checks a value, not the manifest (the default check uses it)
136
+ error: `date must not be before ${prop.min ?? ""}`,
137
+ })
138
+ .refine((date) => prop.max === undefined || date <= prop.max, {
139
+ // value-validator: as above
140
+ error: `date must not be after ${prop.max ?? ""}`,
141
+ });
142
+ default:
143
+ return valueValidator(prop, "reject");
144
+ }
145
+ }
146
+ /**
147
+ * A prop declaration: one of nine types, each with its own options, an optional description and
148
+ * an optional `default` that must satisfy the declaration.
149
+ *
150
+ * Inputs: unknown data. Output: a `PropDeclaration`. Errors: Zod issues; a default that does not
151
+ * fit is reported at `default` with the reason. Side effects: none.
152
+ */
153
+ export const propDeclarationSchema = propVariantsSchema
154
+ .superRefine((prop, context) => {
155
+ // zod-only: date-bounds-ordered, prop-default-string, prop-default-number, prop-default-enum,
156
+ // prop-default-url-protocols, prop-default-date-bounds, prop-default-array, prop-default-object
157
+ if (prop.type === "date" &&
158
+ prop.min !== undefined &&
159
+ prop.max !== undefined &&
160
+ prop.min > prop.max) {
161
+ context.addIssue({
162
+ // zod-only: date-bounds-ordered
163
+ code: "custom",
164
+ path: ["min"],
165
+ message: "min must not be after max",
166
+ });
167
+ }
168
+ if (prop.default === undefined)
169
+ return;
170
+ const result = propValueValidator(prop).safeParse(prop.default);
171
+ if (!result.success) {
172
+ const reason = result.error.issues[0]?.message ?? "invalid value";
173
+ context.addIssue({
174
+ // zod-only: prop-default-string, prop-default-number, prop-default-enum,
175
+ // prop-default-url-protocols, prop-default-date-bounds, prop-default-array, prop-default-object
176
+ code: "custom",
177
+ path: ["default"],
178
+ message: `default does not match the prop declaration: ${reason}`,
179
+ });
180
+ }
181
+ })
182
+ .meta({ id: "PropDeclaration" });
183
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.js","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,iBAAiB,GAElB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,wGAAwG;AACxG,MAAM,gBAAgB,GAAG,cAAc,CAAC,eAAe,CAAC,cAAc,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAEpG,MAAM,aAAa,GAAG,CAAC;KACpB,MAAM,EAA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AAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,eAAe,CAAC;QAClE,OAAO,CAAC,QAAQ,CAAC;YACf,yEAAyE;YACzE,gGAAgG;YAChG,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,SAAS,CAAC;YACjB,OAAO,EAAE,gDAAgD,MAAM,EAAE;SAClE,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,iBAAiB,EAAE,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ export { PROTO_PATH_MAX_SEGMENTS, PROTO_PATH_MAX_SEGMENT_LENGTH } from "./bounded-path.js";
2
+ /**
3
+ * Most values one scan visits. Every value of decoded JSON takes at least one character of its
4
+ * text, so any manifest that `parseManifestJson` accepts has fewer; a bigger input is refused.
5
+ */
6
+ export declare const PROTO_SCAN_MAX_NODES: 65536;
7
+ /** What the scan found: an own `__proto__` key (at `path`) or an input too large to scan. */
8
+ export interface ProtoKeyFinding {
9
+ readonly reason: "proto-key" | "too-large";
10
+ /**
11
+ * Dotted path of the key (`props.card.default.__proto__`); empty for `too-large`. Bounded for
12
+ * logs by `boundedPath`.
13
+ */
14
+ readonly path: string;
15
+ readonly message: string;
16
+ }
17
+ /**
18
+ * Finds an own `__proto__` key anywhere in decoded JSON.
19
+ *
20
+ * Inputs: any value (cycles are tolerated: they only count against the node budget). Output:
21
+ * `undefined` when there is none; otherwise the first finding: `proto-key` with its dotted path,
22
+ * or `too-large` when the scan would visit more than `PROTO_SCAN_MAX_NODES` values, an array's
23
+ * `length` counting as that many values even when it is sparse, because serializing it visits
24
+ * every index (refused rather than half-checked). Errors: none for decoded JSON; a getter or a
25
+ * proxy trap that throws propagates. Side effects: none beyond invoking getters (reads own
26
+ * enumerable properties only).
27
+ */
28
+ export declare function findOwnProtoKey(input: unknown): ProtoKeyFinding | undefined;
29
+ //# sourceMappingURL=proto-guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proto-guard.d.ts","sourceRoot":"","sources":["../src/proto-guard.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAE3F;;;GAGG;AACH,eAAO,MAAM,oBAAoB,OAAgC,CAAC;AAElE,6FAA6F;AAC7F,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CA4B3E"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Refusal of own `__proto__` keys in decoded JSON (TAG-201, moved here and hardened by TAG-207).
3
+ *
4
+ * `JSON.parse` turns `"__proto__"` into a plain own key. Zod's records skip such a key in silence
5
+ * while the JSON Schema refuses it, so the two validators would disagree; worse, code that copies
6
+ * the input with `Object.assign` or a spread could set a prototype from it. Validators call
7
+ * `findOwnProtoKey` before parsing and refuse the whole input, so every validator agrees.
8
+ *
9
+ * The path of a finding names keys of untrusted input and ends up in logs and in the portal, so
10
+ * it is bounded by `boundedPath` (TAG-220, `bounded-path.ts`).
11
+ *
12
+ * Zod-free (the runtime and `migrateManifest` use it too). Pure.
13
+ */
14
+ import { boundedPath } from "./bounded-path.js";
15
+ import { MANIFEST_LIMITS } from "./limits.js";
16
+ export { PROTO_PATH_MAX_SEGMENTS, PROTO_PATH_MAX_SEGMENT_LENGTH } from "./bounded-path.js";
17
+ /**
18
+ * Most values one scan visits. Every value of decoded JSON takes at least one character of its
19
+ * text, so any manifest that `parseManifestJson` accepts has fewer; a bigger input is refused.
20
+ */
21
+ export const PROTO_SCAN_MAX_NODES = MANIFEST_LIMITS.maxJsonLength;
22
+ /**
23
+ * Finds an own `__proto__` key anywhere in decoded JSON.
24
+ *
25
+ * Inputs: any value (cycles are tolerated: they only count against the node budget). Output:
26
+ * `undefined` when there is none; otherwise the first finding: `proto-key` with its dotted path,
27
+ * or `too-large` when the scan would visit more than `PROTO_SCAN_MAX_NODES` values, an array's
28
+ * `length` counting as that many values even when it is sparse, because serializing it visits
29
+ * every index (refused rather than half-checked). Errors: none for decoded JSON; a getter or a
30
+ * proxy trap that throws propagates. Side effects: none beyond invoking getters (reads own
31
+ * enumerable properties only).
32
+ */
33
+ export function findOwnProtoKey(input) {
34
+ // Paths are kept as parent links and joined only on a finding, so deep or cyclic input costs
35
+ // linear time instead of copying the path at every level.
36
+ const pending = [{ value: input, key: undefined, parent: undefined }];
37
+ for (let visited = 0; pending.length > 0; visited += 1) {
38
+ // Visited plus queued values never exceed the budget, so the queue stays bounded too.
39
+ if (visited + pending.length > PROTO_SCAN_MAX_NODES)
40
+ return tooLarge();
41
+ const visit = pending.pop();
42
+ const { value } = visit;
43
+ if (typeof value !== "object" || value === null)
44
+ continue;
45
+ if (Object.hasOwn(value, "__proto__")) {
46
+ return {
47
+ reason: "proto-key",
48
+ path: boundedPath([...pathOf(visit), "__proto__"]),
49
+ message: '"__proto__" is not allowed as a key',
50
+ };
51
+ }
52
+ const budget = PROTO_SCAN_MAX_NODES - visited - 1 - pending.length;
53
+ // Checked before listing the entries: a sparse array of length 2**32 - 1 has none, yet
54
+ // JSON.stringify would walk every index (TAG-220).
55
+ if (Array.isArray(value) && value.length > budget)
56
+ return tooLarge();
57
+ const entries = Object.entries(value);
58
+ if (entries.length > budget)
59
+ return tooLarge();
60
+ for (const [key, child] of entries) {
61
+ pending.push({ value: child, key, parent: visit });
62
+ }
63
+ }
64
+ return undefined;
65
+ }
66
+ function tooLarge() {
67
+ return {
68
+ reason: "too-large",
69
+ path: "",
70
+ message: `input has more than ${String(PROTO_SCAN_MAX_NODES)} values`,
71
+ };
72
+ }
73
+ function pathOf(visit) {
74
+ const keys = [];
75
+ for (let at = visit; at?.key !== undefined; at = at.parent)
76
+ keys.push(at.key);
77
+ return keys.reverse();
78
+ }
79
+ //# sourceMappingURL=proto-guard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proto-guard.js","sourceRoot":"","sources":["../src/proto-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAE3F;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC,aAAa,CAAC;AAalE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,6FAA6F;IAC7F,0DAA0D;IAC1D,MAAM,OAAO,GAAY,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAC/E,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;QACvD,sFAAsF;QACtF,IAAI,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,oBAAoB;YAAE,OAAO,QAAQ,EAAE,CAAC;QACvE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAW,CAAC;QACrC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;QACxB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;YAAE,SAAS;QAC1D,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,E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CAAC,OAAO,EAAE,CAAC;AACxB,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The runtime error telemetry layout (TAG-318, which absorbed TAG-806): the kinds of failure the
3
+ * browser reports, the bounds on what it reports, and the extra columns of an `error` point of the
4
+ * `component_events` dataset (the first eight columns are the ones of `metering.ts`).
5
+ *
6
+ * The edge writes the points (`apps/edge` `domain/error-event.ts`), the API reads them
7
+ * (`GET /v1/components/{id}/errors`); both import the names from here so the layout has one owner.
8
+ * Pure data, no Zod, so the edge and the runtime may import it.
9
+ */
10
+ /**
11
+ * What failed: `render` (an exception in render, an effect or a cleanup, caught by the error
12
+ * boundary), `mount` (the element could not mount: shadow root, styles, lifecycle), `bundle_load`
13
+ * (the component's bundle did not load or did not match its manifest) and `unhandled_in_component`
14
+ * (an event handler of the component threw or rejected).
15
+ */
16
+ export declare const RUNTIME_ERROR_KINDS: readonly ["render", "mount", "bundle_load", "unhandled_in_component"];
17
+ export type RuntimeErrorKind = (typeof RUNTIME_ERROR_KINDS)[number];
18
+ /** Longest message stored, in characters (the edge cuts at this after scrubbing). */
19
+ export declare const RUNTIME_ERROR_MESSAGE_MAX = 200;
20
+ /** Most stack frames a report carries (positions inside the component's own bundle only). */
21
+ export declare const RUNTIME_ERROR_MAX_FRAMES = 5;
22
+ /**
23
+ * Most reports one component sends per page load: a technical protection against an error loop,
24
+ * not a plan limit (decision 79).
25
+ */
26
+ export declare const RUNTIME_ERRORS_PER_COMPONENT_PER_PAGE = 5;
27
+ /**
28
+ * Extra columns of an `error` point of `component_events`, after the eight of `metering.ts`:
29
+ * `blobs[8]` the scrubbed message (at most `RUNTIME_ERROR_MESSAGE_MAX` characters, no URL, no
30
+ * e-mail, no long number); `blobs[9]` the frame positions inside the bundle, `"line:col,line:col"`
31
+ * (`""` when the browser gave none); `blobs[10]` the stack hash, 14 hex digits of a non-secret hash
32
+ * of the kind, the positions and (without positions) the message, which groups equal errors of one
33
+ * version. `blobs[5]` (the event name) holds the `RuntimeErrorKind`. No IP, no URL, no props.
34
+ */
35
+ export declare const ERROR_POINT_BLOBS: {
36
+ readonly message: 8;
37
+ readonly frames: 9;
38
+ readonly hash: 10;
39
+ };
40
+ /** The pattern of a stack hash. */
41
+ export declare const STACK_HASH_PATTERN = "^[0-9a-f]{14}$";
42
+ //# sourceMappingURL=runtime-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-errors.d.ts","sourceRoot":"","sources":["../src/runtime-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,uEAKtB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,qFAAqF;AACrF,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,6FAA6F;AAC7F,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,qCAAqC,IAAI,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;;;;CAA+C,CAAC;AAE9E,mCAAmC;AACnC,eAAO,MAAM,kBAAkB,mBAAmB,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The runtime error telemetry layout (TAG-318, which absorbed TAG-806): the kinds of failure the
3
+ * browser reports, the bounds on what it reports, and the extra columns of an `error` point of the
4
+ * `component_events` dataset (the first eight columns are the ones of `metering.ts`).
5
+ *
6
+ * The edge writes the points (`apps/edge` `domain/error-event.ts`), the API reads them
7
+ * (`GET /v1/components/{id}/errors`); both import the names from here so the layout has one owner.
8
+ * Pure data, no Zod, so the edge and the runtime may import it.
9
+ */
10
+ /**
11
+ * What failed: `render` (an exception in render, an effect or a cleanup, caught by the error
12
+ * boundary), `mount` (the element could not mount: shadow root, styles, lifecycle), `bundle_load`
13
+ * (the component's bundle did not load or did not match its manifest) and `unhandled_in_component`
14
+ * (an event handler of the component threw or rejected).
15
+ */
16
+ export const RUNTIME_ERROR_KINDS = [
17
+ "render",
18
+ "mount",
19
+ "bundle_load",
20
+ "unhandled_in_component",
21
+ ];
22
+ /** Longest message stored, in characters (the edge cuts at this after scrubbing). */
23
+ export const RUNTIME_ERROR_MESSAGE_MAX = 200;
24
+ /** Most stack frames a report carries (positions inside the component's own bundle only). */
25
+ export const RUNTIME_ERROR_MAX_FRAMES = 5;
26
+ /**
27
+ * Most reports one component sends per page load: a technical protection against an error loop,
28
+ * not a plan limit (decision 79).
29
+ */
30
+ export const RUNTIME_ERRORS_PER_COMPONENT_PER_PAGE = 5;
31
+ /**
32
+ * Extra columns of an `error` point of `component_events`, after the eight of `metering.ts`:
33
+ * `blobs[8]` the scrubbed message (at most `RUNTIME_ERROR_MESSAGE_MAX` characters, no URL, no
34
+ * e-mail, no long number); `blobs[9]` the frame positions inside the bundle, `"line:col,line:col"`
35
+ * (`""` when the browser gave none); `blobs[10]` the stack hash, 14 hex digits of a non-secret hash
36
+ * of the kind, the positions and (without positions) the message, which groups equal errors of one
37
+ * version. `blobs[5]` (the event name) holds the `RuntimeErrorKind`. No IP, no URL, no props.
38
+ */
39
+ export const ERROR_POINT_BLOBS = { message: 8, frames: 9, hash: 10 };
40
+ /** The pattern of a stack hash. */
41
+ export const STACK_HASH_PATTERN = "^[0-9a-f]{14}$";
42
+ //# sourceMappingURL=runtime-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-errors.js","sourceRoot":"","sources":["../src/runtime-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,QAAQ;IACR,OAAO;IACP,aAAa;IACb,wBAAwB;CAChB,CAAC;AAGX,qFAAqF;AACrF,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C,6FAA6F;AAC7F,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAW,CAAC;AAE9E,mCAAmC;AACnC,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Runtime versions and the two global release pointers (TAG-611). The shared runtime lives in R2
3
+ * under immutable `rt/<version>/<file>` keys; two KV keys in the edge's `MANIFESTS` namespace,
4
+ * `runtime:canary` and `runtime:stable`, say which version the loader of each ring links to. The
5
+ * operator tooling writes them (`scripts/runtime-release`), the edge only reads them (threat T-60),
6
+ * and a site chooses its ring with `runtimeRing` in its manifest. Pure and import-free on purpose:
7
+ * the edge, the API and the release scripts all use these very rules, and the version goes into an
8
+ * R2 key and a URL path, so it is validated here once.
9
+ */
10
+ /** The rings of a runtime release, in rollout order: canary sites first, then everyone else. */
11
+ export declare const RUNTIME_RINGS: readonly ["canary", "stable"];
12
+ /** One of `RUNTIME_RINGS`. */
13
+ export type RuntimeRing = (typeof RUNTIME_RINGS)[number];
14
+ /** The ring of a site that has no `runtimeRing`. */
15
+ export declare const DEFAULT_RUNTIME_RING: RuntimeRing;
16
+ /** Longest runtime version, matching the edge's `/rt/<version>/` path rule. */
17
+ export declare const RUNTIME_VERSION_MAX_LENGTH = 32;
18
+ /**
19
+ * Whether a value is a runtime version: strict `MAJOR.MINOR.PATCH`, no leading zeros, no
20
+ * prerelease, no build metadata, at most 32 characters. That alphabet has no slash and no `..`,
21
+ * so it is safe inside an R2 key and a URL.
22
+ * Inputs: any value. Output: a type guard. Errors: none. Side effects: none.
23
+ */
24
+ export declare function isRuntimeVersion(value: unknown): value is string;
25
+ /**
26
+ * Whether a value is a ring name.
27
+ * Inputs: any value. Output: a type guard. Errors: none. Side effects: none.
28
+ */
29
+ export declare function isRuntimeRing(value: unknown): value is RuntimeRing;
30
+ /**
31
+ * KV key of a ring's pointer.
32
+ * Inputs: a ring. Output: `runtime:<ring>`. Errors: `TypeError` for anything but a ring.
33
+ * Side effects: none.
34
+ */
35
+ export declare function runtimePointerKvKey(ring: RuntimeRing): string;
36
+ /**
37
+ * A ring's pointer: the version the ring serves and, for rollback, the one it served before.
38
+ * Never carries more: the file list is the code's (`RUNTIME_FILES`), not stored data.
39
+ */
40
+ export interface RuntimePointer {
41
+ readonly version: string;
42
+ readonly previous?: string;
43
+ }
44
+ /**
45
+ * Reads a KV value as a pointer.
46
+ * Inputs: the raw KV text (or `null`). Output: the pointer, or `null` when the text is absent, is
47
+ * not JSON or its `version` (or a present `previous`) is not a runtime version: a damaged pointer
48
+ * reads as no pointer, so the edge falls back instead of building a path from garbage.
49
+ * Errors: none. Side effects: none.
50
+ */
51
+ export declare function parseRuntimePointer(raw: string | null): RuntimePointer | null;
52
+ /**
53
+ * The KV text of a pointer.
54
+ * Inputs: a pointer whose versions are valid. Output: JSON. Errors: `TypeError` for an invalid
55
+ * version (nothing malformed is ever written). Side effects: none.
56
+ */
57
+ export declare function serializeRuntimePointer(pointer: RuntimePointer): string;
58
+ //# sourceMappingURL=runtime-pointers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-pointers.d.ts","sourceRoot":"","sources":["../src/runtime-pointers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,gGAAgG;AAChG,eAAO,MAAM,aAAa,+BAAgC,CAAC;AAE3D,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,oDAAoD;AACpD,eAAO,MAAM,oBAAoB,EAAE,WAAsB,CAAC;AAE1D,+EAA+E;AAC/E,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAI7C;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAIhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAG7D;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,cAAc,GAAG,IAAI,CAa7E;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAUvE"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Runtime versions and the two global release pointers (TAG-611). The shared runtime lives in R2
3
+ * under immutable `rt/<version>/<file>` keys; two KV keys in the edge's `MANIFESTS` namespace,
4
+ * `runtime:canary` and `runtime:stable`, say which version the loader of each ring links to. The
5
+ * operator tooling writes them (`scripts/runtime-release`), the edge only reads them (threat T-60),
6
+ * and a site chooses its ring with `runtimeRing` in its manifest. Pure and import-free on purpose:
7
+ * the edge, the API and the release scripts all use these very rules, and the version goes into an
8
+ * R2 key and a URL path, so it is validated here once.
9
+ */
10
+ /** The rings of a runtime release, in rollout order: canary sites first, then everyone else. */
11
+ export const RUNTIME_RINGS = ["canary", "stable"];
12
+ /** The ring of a site that has no `runtimeRing`. */
13
+ export const DEFAULT_RUNTIME_RING = "stable";
14
+ /** Longest runtime version, matching the edge's `/rt/<version>/` path rule. */
15
+ export const RUNTIME_VERSION_MAX_LENGTH = 32;
16
+ const SEMVER = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
17
+ /**
18
+ * Whether a value is a runtime version: strict `MAJOR.MINOR.PATCH`, no leading zeros, no
19
+ * prerelease, no build metadata, at most 32 characters. That alphabet has no slash and no `..`,
20
+ * so it is safe inside an R2 key and a URL.
21
+ * Inputs: any value. Output: a type guard. Errors: none. Side effects: none.
22
+ */
23
+ export function isRuntimeVersion(value) {
24
+ return (typeof value === "string" && value.length <= RUNTIME_VERSION_MAX_LENGTH && SEMVER.test(value));
25
+ }
26
+ /**
27
+ * Whether a value is a ring name.
28
+ * Inputs: any value. Output: a type guard. Errors: none. Side effects: none.
29
+ */
30
+ export function isRuntimeRing(value) {
31
+ return value === "canary" || value === "stable";
32
+ }
33
+ /**
34
+ * KV key of a ring's pointer.
35
+ * Inputs: a ring. Output: `runtime:<ring>`. Errors: `TypeError` for anything but a ring.
36
+ * Side effects: none.
37
+ */
38
+ export function runtimePointerKvKey(ring) {
39
+ if (!isRuntimeRing(ring))
40
+ throw new TypeError("not a runtime ring");
41
+ return `runtime:${ring}`;
42
+ }
43
+ /**
44
+ * Reads a KV value as a pointer.
45
+ * Inputs: the raw KV text (or `null`). Output: the pointer, or `null` when the text is absent, is
46
+ * not JSON or its `version` (or a present `previous`) is not a runtime version: a damaged pointer
47
+ * reads as no pointer, so the edge falls back instead of building a path from garbage.
48
+ * Errors: none. Side effects: none.
49
+ */
50
+ export function parseRuntimePointer(raw) {
51
+ if (raw === null)
52
+ return null;
53
+ let value;
54
+ try {
55
+ value = JSON.parse(raw);
56
+ }
57
+ catch {
58
+ return null;
59
+ }
60
+ if (typeof value !== "object" || value === null)
61
+ return null;
62
+ const { version, previous } = value;
63
+ if (!isRuntimeVersion(version))
64
+ return null;
65
+ if (previous === undefined)
66
+ return { version };
67
+ return isRuntimeVersion(previous) ? { version, previous } : { version };
68
+ }
69
+ /**
70
+ * The KV text of a pointer.
71
+ * Inputs: a pointer whose versions are valid. Output: JSON. Errors: `TypeError` for an invalid
72
+ * version (nothing malformed is ever written). Side effects: none.
73
+ */
74
+ export function serializeRuntimePointer(pointer) {
75
+ if (!isRuntimeVersion(pointer.version))
76
+ throw new TypeError("not a runtime version");
77
+ if (pointer.previous !== undefined && !isRuntimeVersion(pointer.previous)) {
78
+ throw new TypeError("not a runtime version");
79
+ }
80
+ return JSON.stringify(pointer.previous === undefined
81
+ ? { version: pointer.version }
82
+ : { version: pointer.version, previous: pointer.previous });
83
+ }
84
+ //# sourceMappingURL=runtime-pointers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-pointers.js","sourceRoot":"","sources":["../src/runtime-pointers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,gGAAgG;AAChG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAK3D,oDAAoD;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAgB,QAAQ,CAAC;AAE1D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,MAAM,MAAM,GAAG,4CAA4C,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,0BAA0B,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAC9F,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,QAAQ,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAiB;IACnD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,oBAAoB,CAAC,CAAC;IACpE,OAAO,WAAW,IAAI,EAAE,CAAC;AAC3B,CAAC;AAWD;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAkB;IACpD,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC9B,IAAI,KAA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