@mailwoman/core 11.2.0 → 11.4.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 (463) hide show
  1. package/README.md +2 -2
  2. package/lib/api/ckan.ts +1 -1
  3. package/lib/api/disk-storage.ts +2 -2
  4. package/lib/api/ogc.ts +1 -1
  5. package/lib/api/retry.ts +7 -2
  6. package/lib/api/test/transport.ts +1 -1
  7. package/lib/{binary-frame.ts → asset/binary-frame.ts} +1 -1
  8. package/lib/async/abort.ts +100 -0
  9. package/lib/{memoize.ts → async/memoize.ts} +2 -2
  10. package/lib/{promises.ts → async/promises.ts} +1 -1
  11. package/lib/cloudflare/tokens.ts +1 -1
  12. package/lib/cloudflare/wrangler.ts +3 -3
  13. package/lib/crypto/digest.ts +1 -1
  14. package/lib/crypto/ed25519.ts +8 -0
  15. package/lib/{hash.ts → crypto/hash.ts} +16 -1
  16. package/lib/crypto/node.ts +1 -1
  17. package/lib/data-root.ts +16 -3
  18. package/lib/decoder/containment.ts +4 -1
  19. package/lib/decoder/serialize/outline.ts +19 -6
  20. package/lib/decoder/types.ts +9 -1
  21. package/lib/env/schema.ts +5 -0
  22. package/lib/fs/deflate64.ts +1 -1
  23. package/lib/fs/lock.ts +183 -25
  24. package/lib/fs/readers.ts +1 -1
  25. package/lib/fs/writers.ts +18 -1
  26. package/lib/geocode/result.ts +50 -6
  27. package/lib/html/text.ts +2 -2
  28. package/lib/index.ts +0 -1
  29. package/lib/layers/artifact.ts +2 -2
  30. package/lib/layers/coverage.ts +1 -1
  31. package/lib/layers/manifest.ts +94 -2
  32. package/lib/layers/provenance.ts +246 -0
  33. package/lib/layers/publication.ts +4 -3
  34. package/lib/layers/selection.ts +2 -2
  35. package/lib/license/branch.ts +66 -0
  36. package/lib/license/configured.ts +4 -2
  37. package/lib/license/declaration.ts +1 -1
  38. package/lib/license/key/file.ts +1 -1
  39. package/lib/license/key.ts +148 -201
  40. package/lib/license/provenance.ts +193 -0
  41. package/lib/license/register.ts +7 -78
  42. package/lib/license/stamp.ts +8 -2
  43. package/lib/license/text-url.ts +55 -0
  44. package/lib/license/training.ts +67 -0
  45. package/lib/license.ts +7 -6
  46. package/lib/locale/registry.ts +1 -1
  47. package/lib/locale/zh-cn-units.ts +1 -1
  48. package/lib/module/workspace.ts +1 -1
  49. package/lib/{routing.ts → network/routing.ts} +1 -1
  50. package/lib/pipeline/result.ts +6 -25
  51. package/lib/pipeline/runtime-pipeline.ts +129 -144
  52. package/lib/pipeline/stage.ts +290 -0
  53. package/lib/pipeline/types.ts +33 -14
  54. package/lib/pipeline.ts +14 -2
  55. package/lib/{git.ts → repo/git.ts} +21 -1
  56. package/lib/{release-config.ts → repo/release-config.ts} +8 -0
  57. package/lib/{spdx-header.ts → repo/spdx-header.ts} +8 -0
  58. package/lib/{workspaces.ts → repo/workspaces.ts} +1 -1
  59. package/lib/resolver/lookup-types.ts +1 -1
  60. package/lib/resolver/region-database-provider.ts +33 -0
  61. package/lib/resolver/synthetic-id-ranges.ts +19 -9
  62. package/lib/resolver/types.ts +220 -7
  63. package/lib/resolver.ts +14 -1
  64. package/lib/state-machine.ts +1 -1
  65. package/lib/strings/python-json.ts +3 -2
  66. package/lib/utils/chunk-process.ts +2 -2
  67. package/lib/utils/geodatabase-archive.ts +1 -1
  68. package/lib/utils/time.ts +136 -12
  69. package/lib/utils.ts +4 -4
  70. package/out/api/ckan.js +1 -1
  71. package/out/api/ckan.js.map +1 -1
  72. package/out/api/disk-storage.d.ts.map +1 -1
  73. package/out/api/disk-storage.js +2 -2
  74. package/out/api/disk-storage.js.map +1 -1
  75. package/out/api/ogc.js +1 -1
  76. package/out/api/ogc.js.map +1 -1
  77. package/out/api/retry.d.ts.map +1 -1
  78. package/out/api/retry.js +6 -2
  79. package/out/api/retry.js.map +1 -1
  80. package/out/api/test/transport.js +1 -1
  81. package/out/api/test/transport.js.map +1 -1
  82. package/out/asset/binary-frame.d.ts.map +1 -0
  83. package/out/{binary-frame.js → asset/binary-frame.js} +1 -1
  84. package/out/asset/binary-frame.js.map +1 -0
  85. package/out/asset/load-ledger.d.ts.map +1 -0
  86. package/out/asset/load-ledger.js.map +1 -0
  87. package/out/asset/overture-pins.d.ts.map +1 -0
  88. package/out/asset/overture-pins.js.map +1 -0
  89. package/out/asset/postcode-prefix-files.d.ts.map +1 -0
  90. package/out/asset/postcode-prefix-files.js.map +1 -0
  91. package/out/async/abort.d.ts +57 -0
  92. package/out/async/abort.d.ts.map +1 -0
  93. package/out/async/abort.js +89 -0
  94. package/out/async/abort.js.map +1 -0
  95. package/out/async/memoize.d.ts.map +1 -0
  96. package/out/{memoize.js → async/memoize.js} +2 -2
  97. package/out/async/memoize.js.map +1 -0
  98. package/out/{promises.d.ts → async/promises.d.ts} +1 -1
  99. package/out/async/promises.d.ts.map +1 -0
  100. package/out/{promises.js → async/promises.js} +1 -1
  101. package/out/async/promises.js.map +1 -0
  102. package/out/cloudflare/tokens.js +1 -1
  103. package/out/cloudflare/tokens.js.map +1 -1
  104. package/out/cloudflare/wrangler.js +3 -3
  105. package/out/cloudflare/wrangler.js.map +1 -1
  106. package/out/crypto/digest.d.ts +1 -1
  107. package/out/crypto/digest.js +1 -1
  108. package/out/crypto/ed25519.d.ts +7 -0
  109. package/out/crypto/ed25519.d.ts.map +1 -1
  110. package/out/crypto/ed25519.js +7 -0
  111. package/out/crypto/ed25519.js.map +1 -1
  112. package/out/{hash.d.ts → crypto/hash.d.ts} +12 -0
  113. package/out/crypto/hash.d.ts.map +1 -0
  114. package/out/{hash.js → crypto/hash.js} +15 -1
  115. package/out/crypto/hash.js.map +1 -0
  116. package/out/crypto/node.js +1 -1
  117. package/out/crypto/node.js.map +1 -1
  118. package/out/data-root.d.ts +11 -3
  119. package/out/data-root.d.ts.map +1 -1
  120. package/out/data-root.js +14 -3
  121. package/out/data-root.js.map +1 -1
  122. package/out/decoder/containment.d.ts.map +1 -1
  123. package/out/decoder/containment.js +1 -1
  124. package/out/decoder/containment.js.map +1 -1
  125. package/out/decoder/serialize/outline.d.ts +9 -0
  126. package/out/decoder/serialize/outline.d.ts.map +1 -1
  127. package/out/decoder/serialize/outline.js +16 -6
  128. package/out/decoder/serialize/outline.js.map +1 -1
  129. package/out/decoder/types.d.ts +8 -0
  130. package/out/decoder/types.d.ts.map +1 -1
  131. package/out/decoder/types.js +1 -1
  132. package/out/decoder/types.js.map +1 -1
  133. package/out/env/schema.d.ts +1 -0
  134. package/out/env/schema.d.ts.map +1 -1
  135. package/out/env/schema.js +4 -0
  136. package/out/env/schema.js.map +1 -1
  137. package/out/env.d.ts +1 -0
  138. package/out/env.d.ts.map +1 -1
  139. package/out/fs/deflate64.js +1 -1
  140. package/out/fs/deflate64.js.map +1 -1
  141. package/out/fs/lock.d.ts +73 -4
  142. package/out/fs/lock.d.ts.map +1 -1
  143. package/out/fs/lock.js +96 -19
  144. package/out/fs/lock.js.map +1 -1
  145. package/out/fs/readers.js +1 -1
  146. package/out/fs/readers.js.map +1 -1
  147. package/out/fs/writers.d.ts +9 -1
  148. package/out/fs/writers.d.ts.map +1 -1
  149. package/out/fs/writers.js +15 -2
  150. package/out/fs/writers.js.map +1 -1
  151. package/out/geocode/result.d.ts +25 -1
  152. package/out/geocode/result.d.ts.map +1 -1
  153. package/out/geocode/result.js +49 -6
  154. package/out/geocode/result.js.map +1 -1
  155. package/out/html/text.js +2 -2
  156. package/out/html/trust-policies.d.ts.map +1 -0
  157. package/out/html/trust-policies.js.map +1 -0
  158. package/out/index.d.ts +0 -1
  159. package/out/index.d.ts.map +1 -1
  160. package/out/index.js +0 -1
  161. package/out/index.js.map +1 -1
  162. package/out/layers/artifact.js +2 -2
  163. package/out/layers/artifact.js.map +1 -1
  164. package/out/layers/coverage.d.ts.map +1 -1
  165. package/out/layers/coverage.js +1 -1
  166. package/out/layers/coverage.js.map +1 -1
  167. package/out/layers/manifest.d.ts +53 -0
  168. package/out/layers/manifest.d.ts.map +1 -1
  169. package/out/layers/manifest.js +68 -2
  170. package/out/layers/manifest.js.map +1 -1
  171. package/out/layers/provenance.d.ts +127 -0
  172. package/out/layers/provenance.d.ts.map +1 -0
  173. package/out/layers/provenance.js +122 -0
  174. package/out/layers/provenance.js.map +1 -0
  175. package/out/layers/publication.d.ts.map +1 -1
  176. package/out/layers/publication.js +3 -3
  177. package/out/layers/publication.js.map +1 -1
  178. package/out/layers/selection.d.ts.map +1 -1
  179. package/out/layers/selection.js +2 -2
  180. package/out/layers/selection.js.map +1 -1
  181. package/out/license/branch.d.ts +33 -0
  182. package/out/license/branch.d.ts.map +1 -0
  183. package/out/license/branch.js +52 -0
  184. package/out/license/branch.js.map +1 -0
  185. package/out/license/configured.d.ts +1 -1
  186. package/out/license/configured.d.ts.map +1 -1
  187. package/out/license/configured.js +1 -9
  188. package/out/license/configured.js.map +1 -1
  189. package/out/license/declaration.d.ts +1 -1
  190. package/out/license/declaration.d.ts.map +1 -1
  191. package/out/license/key/file.js +1 -1
  192. package/out/license/key/file.js.map +1 -1
  193. package/out/license/key.d.ts +27 -115
  194. package/out/license/key.d.ts.map +1 -1
  195. package/out/license/key.js +98 -164
  196. package/out/license/key.js.map +1 -1
  197. package/out/license/provenance.d.ts +47 -0
  198. package/out/license/provenance.d.ts.map +1 -0
  199. package/out/license/provenance.js +134 -0
  200. package/out/license/provenance.js.map +1 -0
  201. package/out/license/register.d.ts +6 -47
  202. package/out/license/register.d.ts.map +1 -1
  203. package/out/license/register.js +7 -58
  204. package/out/license/register.js.map +1 -1
  205. package/out/license/stamp.d.ts +7 -1
  206. package/out/license/stamp.d.ts.map +1 -1
  207. package/out/license/stamp.js +2 -2
  208. package/out/license/stamp.js.map +1 -1
  209. package/out/license/text-url.d.ts +9 -0
  210. package/out/license/text-url.d.ts.map +1 -0
  211. package/out/license/text-url.js +49 -0
  212. package/out/license/text-url.js.map +1 -0
  213. package/out/license/training.d.ts +29 -0
  214. package/out/license/training.d.ts.map +1 -0
  215. package/out/license/training.js +52 -0
  216. package/out/license/training.js.map +1 -0
  217. package/out/license.d.ts +7 -6
  218. package/out/license.d.ts.map +1 -1
  219. package/out/license.js +7 -6
  220. package/out/license.js.map +1 -1
  221. package/out/locale/registry.d.ts.map +1 -1
  222. package/out/locale/registry.js +1 -1
  223. package/out/locale/registry.js.map +1 -1
  224. package/out/locale/zh-cn-units.js +1 -1
  225. package/out/locale/zh-cn-units.js.map +1 -1
  226. package/out/math/numeric.d.ts.map +1 -0
  227. package/out/math/numeric.js.map +1 -0
  228. package/out/math/random.d.ts.map +1 -0
  229. package/out/math/random.js.map +1 -0
  230. package/out/math/stats.d.ts.map +1 -0
  231. package/out/math/stats.js.map +1 -0
  232. package/out/module/workspace.js +1 -1
  233. package/out/module/workspace.js.map +1 -1
  234. package/out/network/routing.d.ts.map +1 -0
  235. package/out/{routing.js → network/routing.js} +1 -1
  236. package/out/network/routing.js.map +1 -0
  237. package/out/pipeline/result.d.ts +7 -24
  238. package/out/pipeline/result.d.ts.map +1 -1
  239. package/out/pipeline/runtime-pipeline.d.ts +7 -2
  240. package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
  241. package/out/pipeline/runtime-pipeline.js +56 -103
  242. package/out/pipeline/runtime-pipeline.js.map +1 -1
  243. package/out/pipeline/stage.d.ts +180 -0
  244. package/out/pipeline/stage.d.ts.map +1 -0
  245. package/out/pipeline/stage.js +130 -0
  246. package/out/pipeline/stage.js.map +1 -0
  247. package/out/pipeline/types.d.ts +31 -12
  248. package/out/pipeline/types.d.ts.map +1 -1
  249. package/out/pipeline/types.js +0 -8
  250. package/out/pipeline/types.js.map +1 -1
  251. package/out/pipeline.d.ts +5 -3
  252. package/out/pipeline.d.ts.map +1 -1
  253. package/out/pipeline.js +2 -1
  254. package/out/pipeline.js.map +1 -1
  255. package/out/{git.d.ts → repo/git.d.ts} +10 -1
  256. package/out/repo/git.d.ts.map +1 -0
  257. package/out/{git.js → repo/git.js} +14 -1
  258. package/out/repo/git.js.map +1 -0
  259. package/out/{release-config.d.ts → repo/release-config.d.ts} +8 -0
  260. package/out/repo/release-config.d.ts.map +1 -0
  261. package/out/repo/release-config.js.map +1 -0
  262. package/out/repo/scope-config.d.ts.map +1 -0
  263. package/out/repo/scope-config.js.map +1 -0
  264. package/out/repo/spdx-header.d.ts.map +1 -0
  265. package/out/{spdx-header.js → repo/spdx-header.js} +7 -0
  266. package/out/repo/spdx-header.js.map +1 -0
  267. package/out/repo/vale.d.ts.map +1 -0
  268. package/out/repo/vale.js.map +1 -0
  269. package/out/repo/workspaces.d.ts.map +1 -0
  270. package/out/{workspaces.js → repo/workspaces.js} +1 -1
  271. package/out/repo/workspaces.js.map +1 -0
  272. package/out/resolver/lookup-types.d.ts +1 -1
  273. package/out/resolver/region-database-provider.d.ts +30 -0
  274. package/out/resolver/region-database-provider.d.ts.map +1 -1
  275. package/out/resolver/synthetic-id-ranges.d.ts +15 -8
  276. package/out/resolver/synthetic-id-ranges.d.ts.map +1 -1
  277. package/out/resolver/synthetic-id-ranges.js +18 -9
  278. package/out/resolver/synthetic-id-ranges.js.map +1 -1
  279. package/out/resolver/types.d.ts +192 -8
  280. package/out/resolver/types.d.ts.map +1 -1
  281. package/out/resolver/types.js +56 -0
  282. package/out/resolver/types.js.map +1 -1
  283. package/out/resolver.d.ts +3 -3
  284. package/out/resolver.d.ts.map +1 -1
  285. package/out/resolver.js +1 -1
  286. package/out/resolver.js.map +1 -1
  287. package/out/scripting/process.d.ts.map +1 -0
  288. package/out/scripting/process.js.map +1 -0
  289. package/out/scripting/workers.d.ts.map +1 -0
  290. package/out/scripting/workers.js.map +1 -0
  291. package/out/state-machine.d.ts +1 -1
  292. package/out/strings/python-json.d.ts +2 -1
  293. package/out/strings/python-json.d.ts.map +1 -1
  294. package/out/strings/python-json.js +1 -1
  295. package/out/strings/python-json.js.map +1 -1
  296. package/out/tools/build-deflate64-wasm.run.js +2 -2
  297. package/out/tools/build-deflate64-wasm.run.js.map +1 -1
  298. package/out/tools/coarse-placer/build/dataset.js +1 -1
  299. package/out/tools/coarse-placer/build/dataset.js.map +1 -1
  300. package/out/tools/coarse-placer/build/outlier/exposure.js +1 -1
  301. package/out/tools/coarse-placer/build/outlier/exposure.js.map +1 -1
  302. package/out/tools/coarse-placer/build/outlier/latin.d.ts.map +1 -1
  303. package/out/tools/coarse-placer/build/outlier/latin.js +5 -1
  304. package/out/tools/coarse-placer/build/outlier/latin.js.map +1 -1
  305. package/out/tools/coarse-placer/country-sets.d.ts +2 -2
  306. package/out/tools/coarse-placer/country-sets.js +2 -2
  307. package/out/tools/coarse-placer/outlier-rows.js +2 -2
  308. package/out/tools/coarse-placer/outlier-rows.js.map +1 -1
  309. package/out/tools/coarse-placer/train.js +1 -1
  310. package/out/tools/coarse-placer/train.js.map +1 -1
  311. package/out/tools/generate-language-types.js +2 -2
  312. package/out/tools/generate-language-types.js.map +1 -1
  313. package/out/tools/license/product-fixtures.run.d.ts +2 -0
  314. package/out/tools/license/product-fixtures.run.d.ts.map +1 -0
  315. package/out/tools/license/product-fixtures.run.js +350 -0
  316. package/out/tools/license/product-fixtures.run.js.map +1 -0
  317. package/out/utils/chunk-process.js +2 -2
  318. package/out/utils/chunk-process.js.map +1 -1
  319. package/out/utils/geodatabase-archive.js +1 -1
  320. package/out/utils/geodatabase-archive.js.map +1 -1
  321. package/out/utils/time.d.ts +15 -4
  322. package/out/utils/time.d.ts.map +1 -1
  323. package/out/utils/time.js +114 -12
  324. package/out/utils/time.js.map +1 -1
  325. package/out/utils.d.ts +4 -4
  326. package/out/utils.d.ts.map +1 -1
  327. package/out/utils.js +4 -4
  328. package/out/utils.js.map +1 -1
  329. package/out/values/identical.d.ts.map +1 -0
  330. package/out/values/identical.js.map +1 -0
  331. package/out/values/json.d.ts.map +1 -0
  332. package/out/values/json.js.map +1 -0
  333. package/out/values/objects.d.ts.map +1 -0
  334. package/out/values/objects.js.map +1 -0
  335. package/package.json +278 -243
  336. package/tools/build-deflate64-wasm.run.ts +2 -2
  337. package/tools/coarse-placer/build/dataset.ts +1 -1
  338. package/tools/coarse-placer/build/outlier/exposure.ts +1 -1
  339. package/tools/coarse-placer/build/outlier/latin.ts +5 -1
  340. package/tools/coarse-placer/country-sets.ts +2 -2
  341. package/tools/coarse-placer/outlier-rows.ts +2 -2
  342. package/tools/coarse-placer/train.ts +1 -1
  343. package/tools/generate-language-types.ts +2 -2
  344. package/tools/license/product-fixtures.run.ts +449 -0
  345. package/lib/collections.ts +0 -5
  346. package/lib/license/decision.ts +0 -329
  347. package/lib/license/obligations.ts +0 -256
  348. package/lib/license/record.ts +0 -277
  349. package/lib/scripting/ingest-chunk-script.ts +0 -87
  350. package/out/binary-frame.d.ts.map +0 -1
  351. package/out/binary-frame.js.map +0 -1
  352. package/out/collections.d.ts +0 -2
  353. package/out/collections.d.ts.map +0 -1
  354. package/out/collections.js +0 -5
  355. package/out/collections.js.map +0 -1
  356. package/out/git.d.ts.map +0 -1
  357. package/out/git.js.map +0 -1
  358. package/out/hash.d.ts.map +0 -1
  359. package/out/hash.js.map +0 -1
  360. package/out/identical.d.ts.map +0 -1
  361. package/out/identical.js.map +0 -1
  362. package/out/json.d.ts.map +0 -1
  363. package/out/json.js.map +0 -1
  364. package/out/license/decision.d.ts +0 -179
  365. package/out/license/decision.d.ts.map +0 -1
  366. package/out/license/decision.js +0 -169
  367. package/out/license/decision.js.map +0 -1
  368. package/out/license/obligations.d.ts +0 -102
  369. package/out/license/obligations.d.ts.map +0 -1
  370. package/out/license/obligations.js +0 -188
  371. package/out/license/obligations.js.map +0 -1
  372. package/out/license/record.d.ts +0 -136
  373. package/out/license/record.d.ts.map +0 -1
  374. package/out/license/record.js +0 -222
  375. package/out/license/record.js.map +0 -1
  376. package/out/load-ledger.d.ts.map +0 -1
  377. package/out/load-ledger.js.map +0 -1
  378. package/out/memoize.d.ts.map +0 -1
  379. package/out/memoize.js.map +0 -1
  380. package/out/numeric.d.ts.map +0 -1
  381. package/out/numeric.js.map +0 -1
  382. package/out/objects.d.ts.map +0 -1
  383. package/out/objects.js.map +0 -1
  384. package/out/overture-pins.d.ts.map +0 -1
  385. package/out/overture-pins.js.map +0 -1
  386. package/out/postcode-prefix-files.d.ts.map +0 -1
  387. package/out/postcode-prefix-files.js.map +0 -1
  388. package/out/process.d.ts.map +0 -1
  389. package/out/process.js.map +0 -1
  390. package/out/promises.d.ts.map +0 -1
  391. package/out/promises.js.map +0 -1
  392. package/out/random.d.ts.map +0 -1
  393. package/out/random.js.map +0 -1
  394. package/out/release-config.d.ts.map +0 -1
  395. package/out/release-config.js.map +0 -1
  396. package/out/routing.d.ts.map +0 -1
  397. package/out/routing.js.map +0 -1
  398. package/out/scope-config.d.ts.map +0 -1
  399. package/out/scope-config.js.map +0 -1
  400. package/out/scripting/ingest-chunk-script.d.ts +0 -58
  401. package/out/scripting/ingest-chunk-script.d.ts.map +0 -1
  402. package/out/scripting/ingest-chunk-script.js +0 -47
  403. package/out/scripting/ingest-chunk-script.js.map +0 -1
  404. package/out/spdx-header.d.ts.map +0 -1
  405. package/out/spdx-header.js.map +0 -1
  406. package/out/stats.d.ts.map +0 -1
  407. package/out/stats.js.map +0 -1
  408. package/out/trust-policies.d.ts.map +0 -1
  409. package/out/trust-policies.js.map +0 -1
  410. package/out/vale.d.ts.map +0 -1
  411. package/out/vale.js.map +0 -1
  412. package/out/workers.d.ts.map +0 -1
  413. package/out/workers.js.map +0 -1
  414. package/out/workspaces.d.ts.map +0 -1
  415. package/out/workspaces.js.map +0 -1
  416. /package/lib/{load-ledger.ts → asset/load-ledger.ts} +0 -0
  417. /package/lib/{overture-pins.ts → asset/overture-pins.ts} +0 -0
  418. /package/lib/{postcode-prefix-files.ts → asset/postcode-prefix-files.ts} +0 -0
  419. /package/lib/{trust-policies.ts → html/trust-policies.ts} +0 -0
  420. /package/lib/{numeric.ts → math/numeric.ts} +0 -0
  421. /package/lib/{random.ts → math/random.ts} +0 -0
  422. /package/lib/{stats.ts → math/stats.ts} +0 -0
  423. /package/lib/{scope-config.ts → repo/scope-config.ts} +0 -0
  424. /package/lib/{vale.ts → repo/vale.ts} +0 -0
  425. /package/lib/{process.ts → scripting/process.ts} +0 -0
  426. /package/lib/{workers.ts → scripting/workers.ts} +0 -0
  427. /package/lib/{identical.ts → values/identical.ts} +0 -0
  428. /package/lib/{json.ts → values/json.ts} +0 -0
  429. /package/lib/{objects.ts → values/objects.ts} +0 -0
  430. /package/out/{binary-frame.d.ts → asset/binary-frame.d.ts} +0 -0
  431. /package/out/{load-ledger.d.ts → asset/load-ledger.d.ts} +0 -0
  432. /package/out/{load-ledger.js → asset/load-ledger.js} +0 -0
  433. /package/out/{overture-pins.d.ts → asset/overture-pins.d.ts} +0 -0
  434. /package/out/{overture-pins.js → asset/overture-pins.js} +0 -0
  435. /package/out/{postcode-prefix-files.d.ts → asset/postcode-prefix-files.d.ts} +0 -0
  436. /package/out/{postcode-prefix-files.js → asset/postcode-prefix-files.js} +0 -0
  437. /package/out/{memoize.d.ts → async/memoize.d.ts} +0 -0
  438. /package/out/{trust-policies.d.ts → html/trust-policies.d.ts} +0 -0
  439. /package/out/{trust-policies.js → html/trust-policies.js} +0 -0
  440. /package/out/{numeric.d.ts → math/numeric.d.ts} +0 -0
  441. /package/out/{numeric.js → math/numeric.js} +0 -0
  442. /package/out/{random.d.ts → math/random.d.ts} +0 -0
  443. /package/out/{random.js → math/random.js} +0 -0
  444. /package/out/{stats.d.ts → math/stats.d.ts} +0 -0
  445. /package/out/{stats.js → math/stats.js} +0 -0
  446. /package/out/{routing.d.ts → network/routing.d.ts} +0 -0
  447. /package/out/{release-config.js → repo/release-config.js} +0 -0
  448. /package/out/{scope-config.d.ts → repo/scope-config.d.ts} +0 -0
  449. /package/out/{scope-config.js → repo/scope-config.js} +0 -0
  450. /package/out/{spdx-header.d.ts → repo/spdx-header.d.ts} +0 -0
  451. /package/out/{vale.d.ts → repo/vale.d.ts} +0 -0
  452. /package/out/{vale.js → repo/vale.js} +0 -0
  453. /package/out/{workspaces.d.ts → repo/workspaces.d.ts} +0 -0
  454. /package/out/{process.d.ts → scripting/process.d.ts} +0 -0
  455. /package/out/{process.js → scripting/process.js} +0 -0
  456. /package/out/{workers.d.ts → scripting/workers.d.ts} +0 -0
  457. /package/out/{workers.js → scripting/workers.js} +0 -0
  458. /package/out/{identical.d.ts → values/identical.d.ts} +0 -0
  459. /package/out/{identical.js → values/identical.js} +0 -0
  460. /package/out/{json.d.ts → values/json.d.ts} +0 -0
  461. /package/out/{json.js → values/json.js} +0 -0
  462. /package/out/{objects.d.ts → values/objects.d.ts} +0 -0
  463. /package/out/{objects.js → values/objects.js} +0 -0
@@ -2,86 +2,15 @@
2
2
  // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
3
 
4
4
  /**
5
- * The register of license signing keys: the one source both the shipped trust map
6
- * and the well-known JSON on mailwoman.post derive from, so the two cannot disagree.
5
+ * The well-known JSON on mailwoman.post that publishes the license signing keys.
7
6
  *
8
- * A key enters when `mailwoman license keygen` mints it and moves through three states:
9
- *
10
- * - `active`: may sign and verify.
11
- * - `retired`: may no longer sign. tokens it signed still verify offline until they expire.
12
- * - `revoked`: compromised.
13
- * Online status refuses its tokens at once.
14
- * The derived trust map omits the key, so the next release stops trusting it offline.
15
- *
16
- * `mailwoman license register --write` regenerates the well-known file from this module.
17
- * The `license-register` health check reports a mismatch between the register and the generated file.
18
- */
19
-
20
- /**
21
- * The three states a signing key moves through, in order.
22
- * A key never moves back.
7
+ * The keys themselves live in `@mailwoman/license/product/trust`, which reads the
8
+ * one trust register the TypeScript and Rust verifiers share.
9
+ * `mailwoman license register --write` regenerates the well-known file from it, and the
10
+ * `license-register` health check reports a mismatch between the register and the generated file.
23
11
  */
24
- export const LicenseKeyStatus = {
25
- Active: "active",
26
- Retired: "retired",
27
- Revoked: "revoked",
28
- } as const
29
-
30
- export type LicenseKeyStatus = (typeof LicenseKeyStatus)[keyof typeof LicenseKeyStatus]
31
-
32
- export interface LicenseSigningKey {
33
- /**
34
- * `licenseKeyID(publicKeyPEM, majorVersions[0])`.
35
- * The register test checks that value for every entry.
36
- */
37
- kid: string
38
- publicKeyPEM: string
39
- /**
40
- * The mailwoman major versions this key signs for.
41
- */
42
- majorVersions: readonly number[]
43
- status: LicenseKeyStatus
44
- }
45
12
 
46
- /**
47
- * Every signing key ever registered, with its current status.
48
- *
49
- * `mailwoman license keygen` prints the entry to add.
50
- * Keys remain in this list for their full history.
51
- * Their status records later changes.
52
- */
53
- export const LICENSE_SIGNING_KEYS: readonly LicenseSigningKey[] = [
54
- {
55
- kid: "v9-ecec29be",
56
- publicKeyPEM: `-----BEGIN PUBLIC KEY-----
57
- MCowBQYDK2VwAyEAwPWLp1gjTRCSKjPqrS5q1jw5WP7SlofcVap390Z2Te4=
58
- -----END PUBLIC KEY-----
59
- `,
60
- majorVersions: [9],
61
- status: LicenseKeyStatus.Active,
62
- },
63
- {
64
- kid: "v9-e3d8105a",
65
- publicKeyPEM: `-----BEGIN PUBLIC KEY-----
66
- MCowBQYDK2VwAyEAv0e7Yn028V/BS2AT0tW5a/reOLpWnGiaOxwoscegolQ=
67
- -----END PUBLIC KEY-----
68
- `,
69
- majorVersions: [9],
70
- status: LicenseKeyStatus.Active,
71
- },
72
- ]
73
-
74
- /**
75
- * Key id → PEM public key for offline verification: every key that's not revoked.
76
- */
77
- export function trustedLicenseSigningKeys(): Readonly<Record<string, string>> {
78
- return Object.fromEntries(
79
- LICENSE_SIGNING_KEYS.filter((key) => key.status !== LicenseKeyStatus.Revoked).map((key) => [
80
- key.kid,
81
- key.publicKeyPEM,
82
- ])
83
- )
84
- }
13
+ import { LICENSE_SIGNING_KEYS, type LicenseKeyStatus } from "@mailwoman/license/product/trust"
85
14
 
86
15
  /**
87
16
  * The shape of the well-known file at `/.well-known/mailwoman/license-keys.json`.
@@ -99,7 +28,7 @@ export interface PublishedLicenseKeys {
99
28
  }
100
29
 
101
30
  const WELL_KNOWN_COMMENT =
102
- "The public halves of the commercial license signing keys, by key id, with each key's status. `mailwoman doctor --online` and `mailwoman license verify --online` read this to confirm a configured key's id is still active; offline verification uses the same keys shipped in @mailwoman/core/license. Derived from packages/core/lib/license/register.ts by `mailwoman license register --write`; edit the register, not this file."
31
+ "The public halves of the commercial license signing keys, by key id, with each key's status. `mailwoman doctor --online` and `mailwoman license verify --online` read this to confirm a configured key's id is still active; offline verification uses the same keys shipped in @mailwoman/license/product/trust. Derived from packages/license/lib/product/trust-register.json by `mailwoman license register --write`; edit the register, not this file."
103
32
 
104
33
  export function publishedLicenseKeys(): PublishedLicenseKeys {
105
34
  return {
@@ -8,10 +8,16 @@
8
8
  * The well-known register supplies the doctor's freshness check, so each process makes no network call.
9
9
  */
10
10
 
11
+ import {
12
+ licenseExpiryInstant,
13
+ type LicenseKeyPayload,
14
+ type LicenseKeyVerification,
15
+ LicenseTerms,
16
+ } from "@mailwoman/license/product/token"
17
+
18
+ import { appliedLicenseBranch, grantsCommercialTerms } from "#license/branch"
11
19
  import { EXPIRY_NOTICE_DAYS } from "#license/declaration"
12
20
  import { docsSiteURL } from "#license/docs-site"
13
- import { licenseExpiryInstant, type LicenseKeyPayload, type LicenseKeyVerification, LicenseTerms } from "#license/key"
14
- import { appliedLicenseBranch, grantsCommercialTerms } from "#license/obligations"
15
21
 
16
22
  /**
17
23
  * The singular page path the notice and the `Link: rel="license"` header point at,
@@ -0,0 +1,55 @@
1
+ // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
+
4
+ /**
5
+ * @file Where the text of a license identifier can be read.
6
+ *
7
+ * An SPDX identifier's text is at SPDX's license list, under the identifier itself.
8
+ * A `LicenseRef-` this repository defines has no SPDX page, so the URL of the text it
9
+ * refers to is recorded beside it here, and an identifier without one has no URL.
10
+ */
11
+
12
+ import { summarizeLicense } from "@mailwoman/license/obligations"
13
+
14
+ import { licensePageURL } from "#license/stamp"
15
+
16
+ /**
17
+ * The text each `LicenseRef-` refers to, for the identifiers whose text is published.
18
+ *
19
+ * `LicenseRef-WhosOnFirst-Mixed` points to Who's On First's own license text.
20
+ * That text requires a link back to itself.
21
+ */
22
+ const LICENSE_REF_TEXT_URLS: ReadonlyMap<string, () => string> = new Map([
23
+ ["LicenseRef-WhosOnFirst-Mixed", () => "https://github.com/whosonfirst-data/whosonfirst-data/blob/master/LICENSE.md"],
24
+ // A US Government work has no copyright under 17 U.S.C. § 105, so its text is that section,
25
+ // as the U.S. Copyright Office publishes Title 17.
26
+ ["LicenseRef-USGov-Public-Domain", () => "https://www.copyright.gov/title17/92chap1.html#105"],
27
+ // The US address layer combines about two thousand publishers' files.
28
+ // No one document states their terms.
29
+ // The layer-interface section lists each source class's terms and what remains unread.
30
+ [
31
+ "LicenseRef-US-Mixed",
32
+ () =>
33
+ "https://github.com/sister-software/mailwoman/blob/main/docs/engineering/reference/layer-interface.mdx#the-us-address-layers-obligations",
34
+ ],
35
+ // The license page lives on the docs site.
36
+ // A deployment may configure the site's base URL.
37
+ ["LicenseRef-Commercial", () => licensePageURL()],
38
+ ])
39
+
40
+ /**
41
+ * The URL of the text of one license identifier, or null when none is recorded.
42
+ *
43
+ * An identifier the obligations table recognizes and that isn't a `LicenseRef-` is an
44
+ * SPDX identifier, and its text is `https://spdx.org/licenses/<identifier>.html`.
45
+ * An unrecognized identifier, such as `NOASSERTION` or a misspelling, has no URL.
46
+ */
47
+ export function licenseTextURL(identifier: string): string | null {
48
+ const ref = LICENSE_REF_TEXT_URLS.get(identifier)
49
+
50
+ if (ref) return ref()
51
+
52
+ if (identifier.startsWith("LicenseRef-") || !summarizeLicense(identifier).recognized) return null
53
+
54
+ return `https://spdx.org/licenses/${encodeURIComponent(identifier)}.html`
55
+ }
@@ -0,0 +1,67 @@
1
+ // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
+
4
+ /**
5
+ * The commercial training entitlement check over a raw credential: absent,
6
+ * a platform key, or a training grant.
7
+ *
8
+ * The Rust trainer runs the same check at its training entry point
9
+ * (`trainer authorize` and `trainer train` in a build with the `commercial` feature).
10
+ * This module serves the issuer's tooling and the host-side preflight.
11
+ *
12
+ * The preflight rejects a local credential before a sandbox starts.
13
+ */
14
+
15
+ import {
16
+ type EntitlementAdmission,
17
+ EntitlementRefusal,
18
+ trainingAdmission,
19
+ } from "@mailwoman/license/product/entitlement"
20
+ import { splitProductToken, TRAINING_GRANT_PREFIX } from "@mailwoman/license/product/token"
21
+ import { trustedLicenseSigningKeys } from "@mailwoman/license/product/trust"
22
+
23
+ import { verifyTrainingGrant } from "#license/key"
24
+
25
+ /**
26
+ * The environment variable the commercial trainer reads its training grant from.
27
+ *
28
+ * The Modal launcher fills it from the training Secret `MAILWOMAN_MODAL_TRAINING_SECRET`
29
+ * identifies, so the token never enters a command argument, a launch record or a log.
30
+ */
31
+ export const TRAINING_GRANT_ENV = "MAILWOMAN_TRAINING_GRANT"
32
+
33
+ /**
34
+ * Checks whether a credential admits a commercial training run.
35
+ *
36
+ * A missing credential and a platform key are refusals: a platform key's
37
+ * `scope` governs artifact access only.
38
+ */
39
+ export async function checkTrainingEntitlement(
40
+ token: string | null | undefined,
41
+ options: { trustedKeys?: Readonly<Record<string, string>>; now?: Date } = {}
42
+ ): Promise<EntitlementAdmission> {
43
+ if (!token?.trim()) {
44
+ return {
45
+ admitted: false,
46
+ refusal: EntitlementRefusal.Missing,
47
+ reason: `no training grant in ${TRAINING_GRANT_ENV}`,
48
+ }
49
+ }
50
+
51
+ const parts = splitProductToken(token)
52
+
53
+ if (!("reason" in parts) && parts.prefix !== TRAINING_GRANT_PREFIX) {
54
+ return {
55
+ admitted: false,
56
+ refusal: EntitlementRefusal.NotATrainingGrant,
57
+ reason: `a ${parts.prefix} platform key grants no training permission; commercial training needs a ${TRAINING_GRANT_PREFIX} training grant`,
58
+ }
59
+ }
60
+
61
+ const verification = await verifyTrainingGrant(token, {
62
+ trustedKeys: options.trustedKeys ?? trustedLicenseSigningKeys(),
63
+ ...(options.now ? { now: options.now } : {}),
64
+ })
65
+
66
+ return trainingAdmission(verification)
67
+ }
package/lib/license.ts CHANGED
@@ -2,9 +2,11 @@
2
2
  // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
3
 
4
4
  /**
5
- * License posture utilities cover the obligations an SPDX expression is known to impose,
6
- * the branch of a dual license that applies to an installation, the signed commercial
7
- * license key with its offline verification and the engine stamp.
5
+ * Mailwoman's own license: the branch of its dual license that applies to an installation,
6
+ * the signed commercial license key with its offline verification and the engine stamp.
7
+ *
8
+ * The rights of third-party data sources, from license decisions to the obligations
9
+ * an SPDX expression imposes, are `@mailwoman/license`.
8
10
  *
9
11
  * Everything here is offline.
10
12
  * The well-known freshness check is `@mailwoman/core/license/publication`,
@@ -12,14 +14,13 @@
12
14
  * on the CLI launcher's path for every invocation.
13
15
  */
14
16
 
17
+ export * from "#license/branch"
15
18
  export * from "#license/configured"
16
- export * from "#license/decision"
17
19
  export * from "#license/declaration"
18
20
  export * from "#license/docs-site"
19
21
  export * from "#license/install-id"
20
22
  export * from "#license/key"
21
23
  export * from "#license/key/file"
22
- export * from "#license/obligations"
23
- export * from "#license/record"
24
24
  export * from "#license/register"
25
25
  export * from "#license/stamp"
26
+ export * from "#license/training"
@@ -11,8 +11,8 @@
11
11
 
12
12
  import { COMPONENT_TAGS, type ComponentTag } from "@mailwoman/codex/component"
13
13
 
14
- import { stringifyJSON } from "#json"
15
14
  import type { LocaleProfile, LocaleRegistry } from "#locale/locale"
15
+ import { stringifyJSON } from "#values/json"
16
16
 
17
17
  const COMPONENT_TAG_SET = new Set<ComponentTag>(COMPONENT_TAGS)
18
18
 
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
2
  // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
3
 
4
- import { stringifyJSON } from "#json"
4
+ import { stringifyJSON } from "#values/json"
5
5
 
6
6
  /**
7
7
  * @file The CN organizational-unit reader: the schema holds China's below-settlement ordinal chain as one
@@ -14,7 +14,7 @@ import type { Tagged } from "type-fest"
14
14
 
15
15
  import { readPackageJSON } from "#module/resolve-from"
16
16
  import { OutDirectoryName } from "#paths"
17
- import { readWorkspaceDirectories } from "#workspaces"
17
+ import { readWorkspaceDirectories } from "#repo/workspaces"
18
18
 
19
19
  /**
20
20
  * A package name proven to occur in the root manifest's expanded workspace set.
@@ -3,7 +3,7 @@
3
3
 
4
4
  import type { AxiosRequestConfig } from "axios"
5
5
 
6
- import { prettyJSON, stringifyJSON } from "#json"
6
+ import { prettyJSON, stringifyJSON } from "#values/json"
7
7
 
8
8
  /**
9
9
  * Derived from React Router, this type helper is used to extract the parameters from a path pattern.
@@ -2,44 +2,22 @@
2
2
  // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
3
 
4
4
  import type { AddressTree } from "#decoder/types"
5
+ import type { PipelineFault, PipelineFaultStage } from "#pipeline/stage"
5
6
  import type {
6
7
  LocaleHint,
7
8
  NormalizedInputLite,
8
9
  PhraseProposal,
9
10
  PipelineTiming,
10
- PipelineFaultStage,
11
11
  QueryIntentMarker,
12
12
  QueryKindResult,
13
13
  QueryShapeLite,
14
14
  POIQueryResult,
15
15
  } from "#pipeline/types"
16
16
 
17
- /**
18
- * One stage crash that the coordinator caught and degraded past.
19
- *
20
- * `runPipeline` still resolves.
21
- * `tree` contains whatever the remaining stages could prove.
22
- */
23
- export interface PipelineFault {
24
- stage: PipelineFaultStage
25
- /**
26
- * The thrown value's `name`, or `"Error"` when something that isn't an `Error` was thrown.
27
- *
28
- * It is machine-stable enough to branch on, with the `cause` carrying the rest.
29
- */
30
- name: string
31
- message: string
32
- /**
33
- * The value the stage threw, verbatim: not JSON-serializable in the useful sense,
34
- * so serialize `stage`/`name`/`message` when you need this on a wire.
35
- */
36
- cause: unknown
37
- }
38
-
39
17
  /**
40
18
  * Result of one `runPipeline` call.
41
19
  */
42
- export interface PipelineResult {
20
+ export interface PipelineResult<FaultStage extends string = PipelineFaultStage> {
43
21
  input: string
44
22
  normalized: NormalizedInputLite
45
23
  queryShape: QueryShapeLite
@@ -64,8 +42,11 @@ export interface PipelineResult {
64
42
  * The array is always present.
65
43
  * An empty array states that no stage faulted.
66
44
  * A missing field would make a different claim.
45
+ *
46
+ * A fault's `stage` is one of the parse pipeline's spellings, unless the caller
47
+ * ran the parse on a context with stages of its own.
67
48
  */
68
- faults: PipelineFault[]
49
+ faults: PipelineFault<FaultStage>[]
69
50
  /**
70
51
  * Query-intent advisories lifted from the kind classifier's verdict, always present
71
52
  * so an empty array states that the vocabulary examined this query and made no