@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 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CA+BrB;AAED,6CAA6C;AAC7C,MAAM,MAAM,aAAa,GACrB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAA;CAAE,CAAC;AAErE;;;;;;;;GAQG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;AAE3F;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,mBAA2C,GAClD,OAAO,CAAC,mBAAmB,CAAC,CA6B9B;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,SAAS,aAAa,EAAE,GACjC,SAAS,eAAe,EAAE,CAI5B;AAQD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIrE"}
@@ -0,0 +1,361 @@
1
+ /**
2
+ * The source package format (TAG-407): what a component's source looks like when it is uploaded,
3
+ * stored and built. `SPEC.md` §10 describes it; ADR 0017 and threats T-23, T-41, T-45 and T-46
4
+ * say why it is this strict.
5
+ *
6
+ * A package is a gzip-compressed POSIX tar (ustar/pax) of regular UTF-8 files:
7
+ *
8
+ * - `src/…`: the component's code and styles; the entry is `src/index.tsx` (or `.ts`, `.jsx`,
9
+ * `.js`) unless `taggor.json` names another file under `src/`; since TAG-410 also the images
10
+ * and WOFF2 fonts the code imports, kept as bytes (`assets`);
11
+ * - `taggor.json` (optional): the keys of `sourcePackageConfigSchema` (`$schema`, `entry`, and
12
+ * the project's own `components`, `site_key`, `workspace` so a project file is not refused), nothing else;
13
+ * - `package.json` (optional): any npm fields; `dependencies`, when present, maps package names
14
+ * to version ranges (TAG-402 resolves them against the allowlist). The checked package carries
15
+ * them as sorted name and range pairs (TAG-428), so the builder reads them from here and no
16
+ * second reader of `package.json` exists.
17
+ *
18
+ * `unpackSourcePackage` is the single validator: the API runs it before storing a package
19
+ * (`sources/<sha256>.tgz`, private) and the build container runs it again on what it is given,
20
+ * so both refuse with the same diagnostic codes. The decompression is injected (`Gunzip`): the
21
+ * API uses Web Streams, the container `node:zlib`, both capped.
22
+ *
23
+ * No customer file is ever evaluated here: `taggor.json` and `package.json` are parsed as JSON
24
+ * text with bounded length and nesting, then checked for own `__proto__` keys and by schema.
25
+ */
26
+ import * as z from "zod";
27
+ import { boundedPath } from "./bounded-path.js";
28
+ import { boundedRecord } from "./bounded.js";
29
+ import { DIAGNOSTIC_TEXT_PATTERN } from "./diagnostic-catalog.js";
30
+ import { errorDiagnostic } from "./make-diagnostic.js";
31
+ import { issueMessage } from "./manifest.js";
32
+ import { findOwnProtoKey } from "./proto-guard.js";
33
+ import { MAX_SOURCE_PROBLEMS, readSourceArchive, } from "./source-archive.js";
34
+ import { SITE_KEY_PATTERN } from "./site-manifest-keys.js";
35
+ import { parseBoundedJson } from "./value-check.js";
36
+ /**
37
+ * Limits of a source package (T-23, T-45). The builder's `BUILD_LIMITS` reads the same numbers,
38
+ * so the API never stores a package the container would refuse for its size.
39
+ *
40
+ * Inputs: none. Output: frozen numbers. Errors: none. Side effects: none.
41
+ */
42
+ export const SOURCE_PACKAGE_LIMITS = Object.freeze({
43
+ /** The `.tar.gz` as uploaded and stored. */
44
+ maxCompressedBytes: 5 * 1024 * 1024,
45
+ /**
46
+ * The decompressed tar, headers included, and all regular files together: the decompression
47
+ * stops here, so a bomb costs at most this much memory.
48
+ */
49
+ maxUnpackedBytes: 20 * 1024 * 1024,
50
+ /** Regular files. */
51
+ maxFiles: 500,
52
+ /**
53
+ * Headers of any kind, folders and pax headers included (TAG-407 re-review, B8):
54
+ * `ENTRIES_PER_FILE` × `maxFiles`.
55
+ */
56
+ maxEntries: 2_000,
57
+ /** Characters of one path inside the package. */
58
+ maxPathLength: 200,
59
+ /** Characters of `taggor.json` and of `package.json`, checked before parsing. */
60
+ metadataMaxLength: 65_536,
61
+ /** Nesting of arrays and objects in `taggor.json` and `package.json`. */
62
+ metadataMaxDepth: 32,
63
+ /** Entries of `package.json` `dependencies`. */
64
+ maxDependencies: 100,
65
+ /** Characters of a `$schema` URL in `taggor.json`. */
66
+ schemaUrlMaxLength: 2_048,
67
+ /** Entries of `components` in the project's `taggor.json` (TAG-240). */
68
+ maxProjectComponents: 100,
69
+ });
70
+ /**
71
+ * The limits a plan sets on the source package, for the API at upload and for the builder in the
72
+ * container, so both refuse the same package (TAG-909, review of TAG-425).
73
+ *
74
+ * Inputs: the compressed size and the file count the plan allows (`planLimits`' `maxSourceBytes`
75
+ * and `maxFiles`, possibly lowered by the platform). Output: `SOURCE_PACKAGE_LIMITS` with those
76
+ * two values and no `maxEntries`, so the reader derives it as `ENTRIES_PER_FILE` × `maxFiles`
77
+ * (a lower `maxFiles` can never keep the default 2,000 entries). Errors: none. Side effects: none.
78
+ */
79
+ export function sourcePackageLimitsFor(plan) {
80
+ return Object.freeze({
81
+ maxCompressedBytes: plan.maxSourceBytes,
82
+ maxUnpackedBytes: SOURCE_PACKAGE_LIMITS.maxUnpackedBytes,
83
+ maxFiles: plan.maxFiles,
84
+ maxPathLength: SOURCE_PACKAGE_LIMITS.maxPathLength,
85
+ metadataMaxLength: SOURCE_PACKAGE_LIMITS.metadataMaxLength,
86
+ metadataMaxDepth: SOURCE_PACKAGE_LIMITS.metadataMaxDepth,
87
+ maxDependencies: SOURCE_PACKAGE_LIMITS.maxDependencies,
88
+ schemaUrlMaxLength: SOURCE_PACKAGE_LIMITS.schemaUrlMaxLength,
89
+ });
90
+ }
91
+ /** Virtual path of the package's own settings. */
92
+ export const SOURCE_PACKAGE_CONFIG_PATH = "/taggor.json";
93
+ /** Virtual path of the npm manifest. */
94
+ export const PACKAGE_JSON_PATH = "/package.json";
95
+ /** Entry files tried in order when `taggor.json` names none (virtual paths). */
96
+ export const SOURCE_ENTRY_CANDIDATES = Object.freeze([
97
+ "/src/index.tsx",
98
+ "/src/index.ts",
99
+ "/src/index.jsx",
100
+ "/src/index.js",
101
+ ]);
102
+ /**
103
+ * An entry named in `taggor.json`: a relative path under `src/` with plain segments (letters,
104
+ * digits, `.`, `_`, `-`; never `.` or `..`) and a code extension.
105
+ */
106
+ export const SOURCE_ENTRY_PATTERN = /^src\/(?:(?!\.\.?\/)[A-Za-z0-9._-]+\/)*[A-Za-z0-9._-]+\.(?:tsx|ts|jsx|js)$/;
107
+ /** One component the project's `taggor.json` lists: its tag and its folder (TAG-240). */
108
+ const projectComponentSchema = z.strictObject({
109
+ name: z.string().min(1).max(64),
110
+ path: z.string().min(1).max(SOURCE_PACKAGE_LIMITS.maxPathLength),
111
+ });
112
+ /**
113
+ * `taggor.json`, the one file name of two places (TAG-240): at the root of a source package it
114
+ * holds the package's settings; at the root of a project it also lists the project's
115
+ * `components` and the CLI's `site_key` and `workspace`. One strict schema covers both, so an
116
+ * editor validates either and the package reader never refuses a project file's own keys.
117
+ *
118
+ * `$schema` lets an editor validate the file; `entry` names the component's entry module when it is
119
+ * not `src/index.tsx` (or `.ts`, `.jsx`, `.js`); `components` are `{ name, path }` entries
120
+ * (`taggor init`); `site_key` is the site `taggor sites create` recorded; `workspace` is the
121
+ * default workspace slug of `taggor workspaces use --project`. The CLI keeps unknown keys of a
122
+ * file it edits, but the schema stays strict so a typo shows in the editor.
123
+ */
124
+ export const sourcePackageConfigSchema = z
125
+ .strictObject({
126
+ $schema: z
127
+ .string()
128
+ .min(1)
129
+ .max(SOURCE_PACKAGE_LIMITS.schemaUrlMaxLength)
130
+ .regex(DIAGNOSTIC_TEXT_PATTERN, { error: "must not contain control characters" })
131
+ .optional(),
132
+ entry: z
133
+ .string()
134
+ .max(SOURCE_PACKAGE_LIMITS.maxPathLength)
135
+ .regex(SOURCE_ENTRY_PATTERN, {
136
+ error: "must be a path under src/ ending in .tsx, .ts, .jsx or .js (src/component.tsx)",
137
+ })
138
+ .optional(),
139
+ components: z
140
+ .array(projectComponentSchema)
141
+ .max(SOURCE_PACKAGE_LIMITS.maxProjectComponents)
142
+ .optional(),
143
+ site_key: z
144
+ .string()
145
+ .regex(new RegExp(SITE_KEY_PATTERN), { error: "not a site key" })
146
+ .optional(),
147
+ workspace: z
148
+ .string()
149
+ .regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/, { error: "not a workspace slug" })
150
+ .optional(),
151
+ })
152
+ .meta({ id: "SourcePackageConfig" });
153
+ /** An npm package name (scoped or not), as npm accepts new ones: lowercase, at most 214. */
154
+ const NPM_PACKAGE_NAME_PATTERN = /^(?:@[a-z0-9][a-z0-9._~-]*\/)?[a-z0-9][a-z0-9._~-]*$/;
155
+ /**
156
+ * The fields of `package.json` Taggor reads. Every other npm field is accepted and ignored
157
+ * (`scripts` included: nothing in a package is ever run).
158
+ */
159
+ export const sourcePackageJsonSchema = z.looseObject({
160
+ dependencies: boundedRecord(z.string().max(214).regex(NPM_PACKAGE_NAME_PATTERN, { error: "not an npm package name" }), z
161
+ .string()
162
+ .min(1)
163
+ .max(256)
164
+ .regex(DIAGNOSTIC_TEXT_PATTERN, { error: "must not contain control characters" }), SOURCE_PACKAGE_LIMITS.maxDependencies, "dependencies").optional(),
165
+ });
166
+ /**
167
+ * The `dependencies` of a decoded `package.json` as name and range pairs, sorted by name (code
168
+ * unit order), so no consumer keys an object by an untrusted name.
169
+ *
170
+ * Inputs: the decoded `package.json`, or `undefined` when the package has none. Output: the
171
+ * pairs (none without `package.json` or `dependencies`; `devDependencies`, `peerDependencies`
172
+ * and `optionalDependencies` are never read). Errors: none. Side effects: none.
173
+ */
174
+ function declaredDependencies(packageJson) {
175
+ const entries = Object.entries(packageJson?.dependencies ?? {});
176
+ return entries
177
+ .map(([name, range]) => ({ name, range }))
178
+ .sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
179
+ }
180
+ /** Quoted issues of one file, at most. */
181
+ const MAX_METADATA_ISSUES = 5;
182
+ /**
183
+ * Reads one JSON metadata file of the package, if present.
184
+ *
185
+ * Inputs: the files, the virtual path and the schema. Output: the parsed value (`undefined` when
186
+ * the file is absent) or a `SOURCE_METADATA_INVALID` problem naming the file and, for schema
187
+ * issues, the field. Errors: none. Side effects: none.
188
+ */
189
+ function readMetadata(files, path, schema) {
190
+ const text = files.get(path);
191
+ if (text === undefined)
192
+ return { ok: true, value: undefined };
193
+ const file = path.slice(1);
194
+ const refuse = (why) => ({
195
+ ok: false,
196
+ problem: { code: "SOURCE_METADATA_INVALID", message: `${file}: ${why}`, file },
197
+ });
198
+ const decoded = parseBoundedJson(text, SOURCE_PACKAGE_LIMITS.metadataMaxLength, SOURCE_PACKAGE_LIMITS.metadataMaxDepth);
199
+ if (!decoded.ok) {
200
+ return refuse(decoded.problem === "malformed"
201
+ ? "is not valid JSON"
202
+ : `is longer than ${String(SOURCE_PACKAGE_LIMITS.metadataMaxLength)} characters or nested deeper than ${String(SOURCE_PACKAGE_LIMITS.metadataMaxDepth)} levels`);
203
+ }
204
+ const finding = findOwnProtoKey(decoded.value);
205
+ if (finding !== undefined)
206
+ return refuse(finding.message);
207
+ if (typeof decoded.value !== "object" || decoded.value === null || Array.isArray(decoded.value)) {
208
+ return refuse("must be a JSON object");
209
+ }
210
+ const parsed = schema.safeParse(decoded.value);
211
+ if (parsed.success)
212
+ return { ok: true, value: parsed.data };
213
+ const issues = parsed.error.issues.slice(0, MAX_METADATA_ISSUES).map((issue) => {
214
+ const at = boundedPath(issue.path.map(String));
215
+ return at === "" ? issueMessage(issue) : `${at}: ${issueMessage(issue)}`;
216
+ });
217
+ return refuse(issues.join("; "));
218
+ }
219
+ /** Code files listed in the hint of a missing entry, at most. */
220
+ const MAX_LISTED_FILES = 5;
221
+ /** `ENTRY_NOT_FOUND`, with the code files the package does have. */
222
+ function entryNotFound(files, message) {
223
+ const code = [...files.keys()].filter((path) => /\.(?:tsx?|jsx?)$/.test(path)).sort();
224
+ const listed = code.slice(0, MAX_LISTED_FILES).map((path) => path.slice(1));
225
+ return {
226
+ code: "ENTRY_NOT_FOUND",
227
+ message,
228
+ ...(listed.length === 0
229
+ ? {}
230
+ : {
231
+ hint: `The package has ${listed.join(", ")}${code.length > listed.length ? ", …" : ""}. Move the component's entry to src/index.tsx (or .ts, .jsx, .js) with \`export default defineTaggorComponent({ … })\`, or name it in the entry field of taggor.json.`,
232
+ }),
233
+ };
234
+ }
235
+ function refused(problems) {
236
+ const bounded = problems.slice(0, MAX_SOURCE_PROBLEMS);
237
+ return {
238
+ ok: false,
239
+ problems: bounded,
240
+ reason: bounded.some((problem) => problem.code === "SOURCE_TOO_LARGE")
241
+ ? "too-large"
242
+ : "invalid",
243
+ };
244
+ }
245
+ /**
246
+ * Checks the files of a package that already passed the archive reader: `taggor.json` and
247
+ * `package.json` (when present) and the entry.
248
+ *
249
+ * Inputs: the file map of `readSourceArchive` and its assets (TAG-410; none by default), carried
250
+ * through unchanged. Output: the package with its entry, settings and
251
+ * declared `dependencies` (sorted name and range pairs), or the problems (`SOURCE_METADATA_INVALID` per bad file, then `ENTRY_NOT_FOUND` when the entry
252
+ * named in `taggor.json`, or every candidate, is missing). Errors: none. Side effects: none.
253
+ */
254
+ export function checkSourcePackage(files, assets = new Map()) {
255
+ const config = readMetadata(files, SOURCE_PACKAGE_CONFIG_PATH, sourcePackageConfigSchema);
256
+ const packageJson = readMetadata(files, PACKAGE_JSON_PATH, sourcePackageJsonSchema);
257
+ const problems = [config, packageJson].flatMap((read) => (read.ok ? [] : [read.problem]));
258
+ const settings = config.ok ? (config.value ?? {}) : {};
259
+ const named = settings.entry === undefined ? undefined : `/${settings.entry}`;
260
+ const entry = named === undefined
261
+ ? SOURCE_ENTRY_CANDIDATES.find((candidate) => files.has(candidate))
262
+ : files.has(named)
263
+ ? named
264
+ : undefined;
265
+ if (entry === undefined && config.ok) {
266
+ problems.push(entryNotFound(files, named === undefined
267
+ ? `none of ${SOURCE_ENTRY_CANDIDATES.map((path) => path.slice(1)).join(", ")} exists`
268
+ : `the entry ${named.slice(1)} named in taggor.json does not exist`));
269
+ }
270
+ if (problems.length > 0 || entry === undefined || !packageJson.ok)
271
+ return refused(problems);
272
+ return {
273
+ ok: true,
274
+ files,
275
+ assets,
276
+ entry,
277
+ config: settings,
278
+ dependencies: declaredDependencies(packageJson.value),
279
+ };
280
+ }
281
+ /**
282
+ * The single validator of a source package: size, gzip, tar, every path and entry, executable
283
+ * config files, `taggor.json`, `package.json` and the entry.
284
+ *
285
+ * Inputs: the `.tar.gz` bytes, the decompression and the limits (default
286
+ * `SOURCE_PACKAGE_LIMITS`). Output: the checked package, or the problems with `reason`
287
+ * `too-large` (compressed or unpacked size, file count) or `invalid` (everything else).
288
+ * Errors: rejects only if `gunzip` rejects. Side effects: those of `gunzip`; nothing is
289
+ * evaluated or written.
290
+ */
291
+ export async function unpackSourcePackage(compressed, gunzip, limits = SOURCE_PACKAGE_LIMITS) {
292
+ if (compressed.length === 0) {
293
+ return refused([{ code: "SOURCE_INVALID", message: "the source package is empty" }]);
294
+ }
295
+ if (compressed.length > limits.maxCompressedBytes) {
296
+ return refused([
297
+ {
298
+ code: "SOURCE_TOO_LARGE",
299
+ message: `the source package is over ${String(limits.maxCompressedBytes)} bytes compressed`,
300
+ },
301
+ ]);
302
+ }
303
+ const tar = await gunzip(compressed, limits.maxUnpackedBytes);
304
+ if (!tar.ok) {
305
+ return refused([
306
+ tar.reason === "too-large"
307
+ ? {
308
+ code: "SOURCE_TOO_LARGE",
309
+ message: `the source package unpacks to more than ${String(limits.maxUnpackedBytes)} bytes`,
310
+ }
311
+ : {
312
+ code: "SOURCE_INVALID",
313
+ message: "the source package is not exactly one gzip stream (corrupt, truncated, a second member or bytes after it)",
314
+ },
315
+ ]);
316
+ }
317
+ const read = readSourceArchive(tar.bytes, limits);
318
+ return read.ok ? checkSourcePackage(read.files, read.assets) : refused(read.problems);
319
+ }
320
+ /**
321
+ * The diagnostics of a refused package, in the format every build reports.
322
+ *
323
+ * Inputs: the problems. Output: one error `BuildDiagnostic` per problem, with its file and hint.
324
+ * Errors: none. Side effects: none.
325
+ */
326
+ export function sourceProblemDiagnostics(problems) {
327
+ return problems.map((problem) => errorDiagnostic(problem.code, problem.message, { file: problem.file, hint: problem.hint }));
328
+ }
329
+ const SHA256_HEX = /^[0-9a-f]{64}$/;
330
+ /** Start and end of a package's storage key, around its hash: the one layout of both functions. */
331
+ const SOURCE_KEY_PREFIX = "sources/";
332
+ const SOURCE_KEY_SUFFIX = ".tgz";
333
+ /**
334
+ * The storage key of a package: `sources/<sha256>.tgz`, addressed by the hash of the exact bytes
335
+ * stored, in the private sources bucket (the API writes it, the builder reads it).
336
+ *
337
+ * Inputs: the lowercase hex SHA-256 of the `.tar.gz`. Output: the key. Errors: `TypeError` when
338
+ * the hash is not 64 lowercase hex characters (a bug in the caller, which computed it). Side
339
+ * effects: none.
340
+ */
341
+ export function sourcePackageKey(sha256) {
342
+ if (!SHA256_HEX.test(sha256))
343
+ throw new TypeError("not a lowercase hex sha256");
344
+ return `${SOURCE_KEY_PREFIX}${sha256}${SOURCE_KEY_SUFFIX}`;
345
+ }
346
+ /**
347
+ * The hash a storage key addresses (TAG-437), the inverse of `sourcePackageKey`: the builder's
348
+ * cache reads it from a build record's `sourceKey` and checks the stored bytes against it.
349
+ *
350
+ * Inputs: any string (a key read from storage, not trusted). Output: the lowercase hex SHA-256
351
+ * when the key is exactly `sources/<sha256>.tgz`, so `sourcePackageKey(result) === key`;
352
+ * `undefined` for anything else (another prefix or extension, upper-case or short hex, a path
353
+ * around it). Errors: none. Side effects: none.
354
+ */
355
+ export function parseSourcePackageKey(key) {
356
+ if (!key.startsWith(SOURCE_KEY_PREFIX) || !key.endsWith(SOURCE_KEY_SUFFIX))
357
+ return undefined;
358
+ const sha256 = key.slice(SOURCE_KEY_PREFIX.length, key.length - SOURCE_KEY_SUFFIX.length);
359
+ return SHA256_HEX.test(sha256) ? sha256 : undefined;
360
+ }
361
+ //# sourceMappingURL=source-package.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-package.js","sourceRoot":"","sources":["../src/source-package.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,mBAAmB,EACnB,iBAAiB,GAGlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC;IACjD,4CAA4C;IAC5C,kBAAkB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IACnC;;;OAGG;IACH,gBAAgB,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;IAClC,qBAAqB;IACrB,QAAQ,EAAE,GAAG;IACb;;;OAGG;IACH,UAAU,EAAE,KAAK;IACjB,iDAAiD;IACjD,aAAa,EAAE,GAAG;IAClB,iFAAiF;IACjF,iBAAiB,EAAE,MAAM;IACzB,yEAAyE;IACzE,gBAAgB,EAAE,EAAE;IACpB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AAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,4BAA4B,CAAC,CAAC;IAChF,OAAO,GAAG,iBAAiB,GAAG,MAAM,GAAG,iBAAiB,EAAE,CAAC;AAC7D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QAAE,OAAO,SAAS,CAAC;IAC7F,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1F,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACtD,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { BuildDiagnostic } from "./build-diagnostic.js";
2
+ import { type SecretFinding, type SecretScanInput } from "./secret-scan.js";
3
+ /**
4
+ * The findings of one scan as diagnostics, or the scan's refusal under `tooLarge`.
5
+ *
6
+ * Inputs: the texts, how to turn a finding into a diagnostic and the code of a scan over the
7
+ * detector's ceilings. Output: the diagnostics. Errors: none. Side effects: none.
8
+ */
9
+ export declare function secretScanDiagnostics(inputs: readonly SecretScanInput[], toDiagnostic: (finding: SecretFinding) => BuildDiagnostic, tooLarge: "SOURCE_TOO_LARGE" | "OUTPUT_TOO_LARGE"): BuildDiagnostic[];
10
+ /**
11
+ * The `SECRET_IN_SOURCE` errors of a source package's files.
12
+ *
13
+ * Inputs: the customer's files (virtual paths, `/src/a.ts`), never the Taggor packages. Output:
14
+ * first the secrets in the paths themselves (no `file`: it would quote them), then one error per
15
+ * secret in the contents, in path and text order, with the file (relative), 1-based line and
16
+ * column, and the masked value in the message; at most the detector's 50 per pass; empty when
17
+ * there is none; one `SOURCE_TOO_LARGE` when the files are over the detector's ceilings. Errors:
18
+ * never throws. Side effects: none.
19
+ */
20
+ export declare function sourceSecretDiagnostics(files: ReadonlyMap<string, string>): BuildDiagnostic[];
21
+ //# sourceMappingURL=source-secrets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-secrets.d.ts","sourceRoot":"","sources":["../src/source-secrets.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAe,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEzF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,eAAe,EAAE,EAClC,YAAY,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,eAAe,EACzD,QAAQ,EAAE,kBAAkB,GAAG,kBAAkB,GAChD,eAAe,EAAE,CAInB;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,eAAe,EAAE,CAwB7F"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * `SECRET_IN_SOURCE` for a source package's files (TAG-1707; moved here by TAG-909): the one place
3
+ * that turns the detector's findings (`scanSecrets`) into build diagnostics, shared by the
4
+ * builder, which refuses a package whose files hold a credential, and the API, which refuses the
5
+ * same package at upload, before it is stored (a component's code is public).
6
+ *
7
+ * The value never reaches a diagnostic: each carries the file, line, column and the value masked
8
+ * by the detector, and no `snippet`. Nothing here evaluates the files.
9
+ */
10
+ import { errorDiagnostic } from "./make-diagnostic.js";
11
+ import { scanSecrets } from "./secret-scan.js";
12
+ /**
13
+ * The findings of one scan as diagnostics, or the scan's refusal under `tooLarge`.
14
+ *
15
+ * Inputs: the texts, how to turn a finding into a diagnostic and the code of a scan over the
16
+ * detector's ceilings. Output: the diagnostics. Errors: none. Side effects: none.
17
+ */
18
+ export function secretScanDiagnostics(inputs, toDiagnostic, tooLarge) {
19
+ const result = scanSecrets(inputs);
20
+ if (!result.ok)
21
+ return [errorDiagnostic(tooLarge, result.message)];
22
+ return result.findings.map(toDiagnostic);
23
+ }
24
+ /**
25
+ * The `SECRET_IN_SOURCE` errors of a source package's files.
26
+ *
27
+ * Inputs: the customer's files (virtual paths, `/src/a.ts`), never the Taggor packages. Output:
28
+ * first the secrets in the paths themselves (no `file`: it would quote them), then one error per
29
+ * secret in the contents, in path and text order, with the file (relative), 1-based line and
30
+ * column, and the masked value in the message; at most the detector's 50 per pass; empty when
31
+ * there is none; one `SOURCE_TOO_LARGE` when the files are over the detector's ceilings. Errors:
32
+ * never throws. Side effects: none.
33
+ */
34
+ export function sourceSecretDiagnostics(files) {
35
+ const inputs = [...files]
36
+ .map(([path, text]) => ({ path, text }))
37
+ .sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
38
+ const inPaths = secretScanDiagnostics([{ path: "", text: inputs.map((input) => input.path).join("\n") }], (finding) => errorDiagnostic("SECRET_IN_SOURCE", `${finding.description} (${finding.masked}) is in the name of a file of the package; the bundle is public, so the build refuses it`), "SOURCE_TOO_LARGE");
39
+ if (inPaths.length > 0)
40
+ return inPaths;
41
+ return secretScanDiagnostics(inputs, (finding) => errorDiagnostic("SECRET_IN_SOURCE", `${finding.description} (${finding.masked}) is in the component's source; the bundle is public, so the build refuses it`, { file: finding.path, line: finding.line, column: finding.column }), "SOURCE_TOO_LARGE");
42
+ }
43
+ //# sourceMappingURL=source-secrets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-secrets.js","sourceRoot":"","sources":["../src/source-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAA4C,MAAM,kBAAkB,CAAC;AAEzF;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,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N,CAAC,OAAO,EAAE,EAAE,CACV,eAAe,CACb,kBAAkB,EAClB,GAAG,OAAO,CAAC,WAAW,KAAK,OAAO,CAAC,MAAM,+EAA+E,EACxH,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CACnE,EACH,kBAAkB,CACnB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,61 @@
1
+ /** Layout version of the mark; a reader of another version treats the mark as absent. */
2
+ export declare const SSR_CAP_MARK_VERSION = 1;
3
+ /**
4
+ * How long a mark lives without being rewritten (KV `expirationTtl`): the same 6 hours as the renders
5
+ * cut (TAG-1630 finding 6: at 2 hours it lapsed between two visits of the usage job as soon as there
6
+ * were more than about 50 workspaces, and the cut stopped holding). A staff override or a plan upgrade
7
+ * reaches the edge within six hours even when the job does not rewrite the mark; a job that stops
8
+ * lifts the cut by itself.
9
+ */
10
+ export declare const SSR_CAP_MARK_TTL_SECONDS: number;
11
+ /** Why the edge gives no fragment: the workspace's server renders reached the month's limit. */
12
+ export type SsrCapRefusal = "ssr-renders-cap";
13
+ /** The mark of one site. */
14
+ export interface SsrCapMark {
15
+ readonly v: typeof SSR_CAP_MARK_VERSION;
16
+ /** `YYYY-MM` (UTC) of the month whose server renders reached the limit, or `null`. */
17
+ readonly month: string | null;
18
+ }
19
+ /**
20
+ * KV key of a site's SSR cut mark.
21
+ * Inputs: a site key. Output: `ssrcap:<siteKey>`. Errors: `TypeError` when the site key is
22
+ * malformed (keys never carry caller text). Side effects: none.
23
+ */
24
+ export declare function ssrCapKvKey(siteKey: string): string;
25
+ /** What the job measured for one workspace, against its effective limit. */
26
+ export interface SsrCapInput {
27
+ readonly now: Date;
28
+ /** Server renders of the workspace this UTC month (all its sites). */
29
+ readonly rendersUsed: number;
30
+ /** The effective `ssrRendersPerMonth` (plan, add-ons, overrides). */
31
+ readonly rendersLimit: number;
32
+ }
33
+ /**
34
+ * The mark a workspace's sites get, or `null` when it is under the limit (nothing is written).
35
+ * Inputs: the measured renders and the effective limit. Output: a mark for the current UTC month
36
+ * when `rendersUsed >= rendersLimit`. Errors: none. Pure. It does not decide whether the mark is
37
+ * written: the caller asks the plan first (`ssrCapAction`).
38
+ */
39
+ export declare function ssrCapMarkFor(input: SsrCapInput): SsrCapMark | null;
40
+ /**
41
+ * Reads a mark back from its KV text.
42
+ * Inputs: the stored text or `null`. Output: the mark, or `null` when absent, not JSON, of another
43
+ * version or malformed (the edge then serves the fragment: never "over" by doubt). Errors: none.
44
+ * Side effects: none.
45
+ */
46
+ export declare function parseSsrCapMark(text: string | null): SsrCapMark | null;
47
+ /**
48
+ * Whether the edge refuses a fragment now.
49
+ * Inputs: the parsed mark (or `null`) and the current time. Output: the refusal, or `null` to serve. A month cut counts only in its own UTC
50
+ * month, so a mark left from last month never blocks. Errors: none. Pure.
51
+ */
52
+ export declare function ssrCapRefusal(mark: SsrCapMark | null, now: Date): SsrCapRefusal | null;
53
+ /** KV key of the global SSR off switch: present, no site gets a fragment. */
54
+ export declare const SSR_OFF_KV_KEY = "ssr:off";
55
+ /**
56
+ * KV key of one site's SSR off switch.
57
+ * Inputs: a site key. Output: `ssr:off:<siteKey>`. Errors: `TypeError` when the site key is
58
+ * malformed. Side effects: none.
59
+ */
60
+ export declare function ssrSiteOffKvKey(siteKey: string): string;
61
+ //# sourceMappingURL=ssr-cap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssr-cap.d.ts","sourceRoot":"","sources":["../src/ssr-cap.ts"],"names":[],"mappings":"AA0BA,yFAAyF;AACzF,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,QAAc,CAAC;AAEpD,gGAAgG;AAChG,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAE9C,4BAA4B;AAC5B,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,CAAC,EAAE,OAAO,oBAAoB,CAAC;IACxC,sFAAsF;IACtF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAID;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED,4EAA4E;AAC5E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;IACnB,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,IAAI,CAGnE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,UAAU,GAAG,IAAI,CAetE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,aAAa,GAAG,IAAI,CAGtF;AAED,6EAA6E;AAC7E,eAAO,MAAM,cAAc,YAAY,CAAC;AAExC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGvD"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * The SSR plan cut mark (spike, ADR 0066, no ticket): what the API's hourly usage job writes to the
3
+ * edge's `MANIFESTS` KV when a workspace's server renders reached `ssrRendersPerMonth`, the only SSR
4
+ * plan limit, and the one rule the edge applies to it on `GET /r/<siteKey>/<tag>`. Zod-free: the API
5
+ * writes it and the edge reads it.
6
+ *
7
+ * Same pattern as the renders cut (`viewcap:<siteKey>`, TAG-1714): a KV mark per site that expires
8
+ * by itself, read with a deadline, and every doubt reads as "not over": a missing, damaged or
9
+ * unknown-version mark and a month cut of another month all let the fragment through. The only
10
+ * effect of a mark is "no fragment": the caller writes the bare tag and the browser renders the
11
+ * component as it does today, so a mark never stops a site's delivery. Whether a workspace at the
12
+ * cap gets the mark at all is the plan's call (`ssrCapAction` in apps/api, domain/billing).
13
+ *
14
+ * KV key `ssrcap:<siteKey>`; value JSON `{ v: 1, month: "YYYY-MM" | null }`: `month` set means the
15
+ * workspace's server renders reached the limit in that UTC month (every fragment refused). Marks
16
+ * written before the owner dropped the per-day versions cap (2026-11-13) also carry `day` and
17
+ * `versions`; those fields are ignored, never honored: the distinct versions rendered per day are a
18
+ * measured usage figure now (`ssr-version-ledger.ts`), not a limit.
19
+ *
20
+ * The run-time off switch lives here too (same namespace, same reading rule): `ssr:off` turns
21
+ * server rendering off for every site and `ssr:off:<siteKey>` for one site, without a deploy. Only
22
+ * the key's presence is read; a missing key or a failed read leaves SSR as it is. Staff write them
23
+ * through `/internal/ssr-switch` (apps/api).
24
+ */
25
+ import { isSiteKey } from "./site-manifest-keys.js";
26
+ /** Layout version of the mark; a reader of another version treats the mark as absent. */
27
+ export const SSR_CAP_MARK_VERSION = 1;
28
+ /**
29
+ * How long a mark lives without being rewritten (KV `expirationTtl`): the same 6 hours as the renders
30
+ * cut (TAG-1630 finding 6: at 2 hours it lapsed between two visits of the usage job as soon as there
31
+ * were more than about 50 workspaces, and the cut stopped holding). A staff override or a plan upgrade
32
+ * reaches the edge within six hours even when the job does not rewrite the mark; a job that stops
33
+ * lifts the cut by itself.
34
+ */
35
+ export const SSR_CAP_MARK_TTL_SECONDS = 6 * 60 * 60;
36
+ const MONTH = /^\d{4}-\d{2}$/;
37
+ /**
38
+ * KV key of a site's SSR cut mark.
39
+ * Inputs: a site key. Output: `ssrcap:<siteKey>`. Errors: `TypeError` when the site key is
40
+ * malformed (keys never carry caller text). Side effects: none.
41
+ */
42
+ export function ssrCapKvKey(siteKey) {
43
+ if (!isSiteKey(siteKey))
44
+ throw new TypeError("not a site key");
45
+ return `ssrcap:${siteKey}`;
46
+ }
47
+ /**
48
+ * The mark a workspace's sites get, or `null` when it is under the limit (nothing is written).
49
+ * Inputs: the measured renders and the effective limit. Output: a mark for the current UTC month
50
+ * when `rendersUsed >= rendersLimit`. Errors: none. Pure. It does not decide whether the mark is
51
+ * written: the caller asks the plan first (`ssrCapAction`).
52
+ */
53
+ export function ssrCapMarkFor(input) {
54
+ if (input.rendersUsed < input.rendersLimit)
55
+ return null;
56
+ return { v: SSR_CAP_MARK_VERSION, month: input.now.toISOString().slice(0, 7) };
57
+ }
58
+ /**
59
+ * Reads a mark back from its KV text.
60
+ * Inputs: the stored text or `null`. Output: the mark, or `null` when absent, not JSON, of another
61
+ * version or malformed (the edge then serves the fragment: never "over" by doubt). Errors: none.
62
+ * Side effects: none.
63
+ */
64
+ export function parseSsrCapMark(text) {
65
+ if (text === null)
66
+ return null;
67
+ let value;
68
+ try {
69
+ value = JSON.parse(text);
70
+ }
71
+ catch {
72
+ return null;
73
+ }
74
+ if (typeof value !== "object" || value === null)
75
+ return null;
76
+ const m = value;
77
+ if (m["v"] !== SSR_CAP_MARK_VERSION)
78
+ return null;
79
+ const month = m["month"];
80
+ if (month !== null && (typeof month !== "string" || !MONTH.test(month)))
81
+ return null;
82
+ // `day` and `versions` of an older mark are dropped here, so nothing downstream can honor them.
83
+ return { v: SSR_CAP_MARK_VERSION, month };
84
+ }
85
+ /**
86
+ * Whether the edge refuses a fragment now.
87
+ * Inputs: the parsed mark (or `null`) and the current time. Output: the refusal, or `null` to serve. A month cut counts only in its own UTC
88
+ * month, so a mark left from last month never blocks. Errors: none. Pure.
89
+ */
90
+ export function ssrCapRefusal(mark, now) {
91
+ if (mark === null)
92
+ return null;
93
+ return mark.month === now.toISOString().slice(0, 7) ? "ssr-renders-cap" : null;
94
+ }
95
+ /** KV key of the global SSR off switch: present, no site gets a fragment. */
96
+ export const SSR_OFF_KV_KEY = "ssr:off";
97
+ /**
98
+ * KV key of one site's SSR off switch.
99
+ * Inputs: a site key. Output: `ssr:off:<siteKey>`. Errors: `TypeError` when the site key is
100
+ * malformed. Side effects: none.
101
+ */
102
+ export function ssrSiteOffKvKey(siteKey) {
103
+ if (!isSiteKey(siteKey))
104
+ throw new TypeError("not a site key");
105
+ return `${SSR_OFF_KV_KEY}:${siteKey}`;
106
+ }
107
+ //# sourceMappingURL=ssr-cap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssr-cap.js","sourceRoot":"","sources":["../src/ssr-cap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,yFAAyF;AACzF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;AAYpD,MAAM,KAAK,GAAG,eAAe,CAAC;AAE9B;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC/D,OAAO,UAAU,OAAO,EAAE,CAAC;AAC7B,CAAC;AAWD;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAkB;IAC9C,IAAI,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IACxD,OAAO,EAAE,CAAC,EAAE,oBAAoB,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AACjF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,IAAmB;IACjD,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/B,IAAI,KAAc,CAAC;IACnB,IAAI,CAAC;QACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC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