@maverickcer/env-cap 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 (195) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +279 -0
  3. package/dist/.dts/build/assemble-project.d.ts +47 -0
  4. package/dist/.dts/build/assemble-project.d.ts.map +1 -0
  5. package/dist/.dts/build/change-model.d.ts +62 -0
  6. package/dist/.dts/build/change-model.d.ts.map +1 -0
  7. package/dist/.dts/build/check-artifacts.d.ts +48 -0
  8. package/dist/.dts/build/check-artifacts.d.ts.map +1 -0
  9. package/dist/.dts/build/citation-verification.d.ts +62 -0
  10. package/dist/.dts/build/citation-verification.d.ts.map +1 -0
  11. package/dist/.dts/build/compatibility.d.ts +76 -0
  12. package/dist/.dts/build/compatibility.d.ts.map +1 -0
  13. package/dist/.dts/build/contract-model.d.ts +92 -0
  14. package/dist/.dts/build/contract-model.d.ts.map +1 -0
  15. package/dist/.dts/build/deep-equal.d.ts +9 -0
  16. package/dist/.dts/build/deep-equal.d.ts.map +1 -0
  17. package/dist/.dts/build/deep-freeze.d.ts +20 -0
  18. package/dist/.dts/build/deep-freeze.d.ts.map +1 -0
  19. package/dist/.dts/build/dependency-graph.d.ts +168 -0
  20. package/dist/.dts/build/dependency-graph.d.ts.map +1 -0
  21. package/dist/.dts/build/dependency-model.d.ts +79 -0
  22. package/dist/.dts/build/dependency-model.d.ts.map +1 -0
  23. package/dist/.dts/build/discover.d.ts +25 -0
  24. package/dist/.dts/build/discover.d.ts.map +1 -0
  25. package/dist/.dts/build/display-path.d.ts +24 -0
  26. package/dist/.dts/build/display-path.d.ts.map +1 -0
  27. package/dist/.dts/build/docs.d.ts +176 -0
  28. package/dist/.dts/build/docs.d.ts.map +1 -0
  29. package/dist/.dts/build/env-example.d.ts +85 -0
  30. package/dist/.dts/build/env-example.d.ts.map +1 -0
  31. package/dist/.dts/build/errors.d.ts +78 -0
  32. package/dist/.dts/build/errors.d.ts.map +1 -0
  33. package/dist/.dts/build/evidence-cache.d.ts +74 -0
  34. package/dist/.dts/build/evidence-cache.d.ts.map +1 -0
  35. package/dist/.dts/build/evidence-model.d.ts +50 -0
  36. package/dist/.dts/build/evidence-model.d.ts.map +1 -0
  37. package/dist/.dts/build/evidence-reference.d.ts +67 -0
  38. package/dist/.dts/build/evidence-reference.d.ts.map +1 -0
  39. package/dist/.dts/build/evidence-snapshot.d.ts +123 -0
  40. package/dist/.dts/build/evidence-snapshot.d.ts.map +1 -0
  41. package/dist/.dts/build/exclusive-group.d.ts +19 -0
  42. package/dist/.dts/build/exclusive-group.d.ts.map +1 -0
  43. package/dist/.dts/build/finding-model.d.ts +79 -0
  44. package/dist/.dts/build/finding-model.d.ts.map +1 -0
  45. package/dist/.dts/build/generate-documentation.d.ts +176 -0
  46. package/dist/.dts/build/generate-documentation.d.ts.map +1 -0
  47. package/dist/.dts/build/generate-env-artifacts.d.ts +176 -0
  48. package/dist/.dts/build/generate-env-artifacts.d.ts.map +1 -0
  49. package/dist/.dts/build/generate-evidence.d.ts +77 -0
  50. package/dist/.dts/build/generate-evidence.d.ts.map +1 -0
  51. package/dist/.dts/build/generate-manifest.d.ts +101 -0
  52. package/dist/.dts/build/generate-manifest.d.ts.map +1 -0
  53. package/dist/.dts/build/generate-usage.d.ts +95 -0
  54. package/dist/.dts/build/generate-usage.d.ts.map +1 -0
  55. package/dist/.dts/build/generated-banner.d.ts +52 -0
  56. package/dist/.dts/build/generated-banner.d.ts.map +1 -0
  57. package/dist/.dts/build/glob.d.ts +18 -0
  58. package/dist/.dts/build/glob.d.ts.map +1 -0
  59. package/dist/.dts/build/governance-fields.d.ts +34 -0
  60. package/dist/.dts/build/governance-fields.d.ts.map +1 -0
  61. package/dist/.dts/build/humanize-key.d.ts +14 -0
  62. package/dist/.dts/build/humanize-key.d.ts.map +1 -0
  63. package/dist/.dts/build/index.d.ts +107 -0
  64. package/dist/.dts/build/index.d.ts.map +1 -0
  65. package/dist/.dts/build/lifecycle-model.d.ts +64 -0
  66. package/dist/.dts/build/lifecycle-model.d.ts.map +1 -0
  67. package/dist/.dts/build/link.d.ts +215 -0
  68. package/dist/.dts/build/link.d.ts.map +1 -0
  69. package/dist/.dts/build/literal-eval.d.ts +23 -0
  70. package/dist/.dts/build/literal-eval.d.ts.map +1 -0
  71. package/dist/.dts/build/live-expirations.d.ts +47 -0
  72. package/dist/.dts/build/live-expirations.d.ts.map +1 -0
  73. package/dist/.dts/build/manifest-snapshot.d.ts +229 -0
  74. package/dist/.dts/build/manifest-snapshot.d.ts.map +1 -0
  75. package/dist/.dts/build/manifest.d.ts +31 -0
  76. package/dist/.dts/build/manifest.d.ts.map +1 -0
  77. package/dist/.dts/build/map-utils.d.ts +8 -0
  78. package/dist/.dts/build/map-utils.d.ts.map +1 -0
  79. package/dist/.dts/build/ownership-model.d.ts +57 -0
  80. package/dist/.dts/build/ownership-model.d.ts.map +1 -0
  81. package/dist/.dts/build/parse.d.ts +199 -0
  82. package/dist/.dts/build/parse.d.ts.map +1 -0
  83. package/dist/.dts/build/reference-projections.d.ts +156 -0
  84. package/dist/.dts/build/reference-projections.d.ts.map +1 -0
  85. package/dist/.dts/build/resolution/resolve-import.d.ts +53 -0
  86. package/dist/.dts/build/resolution/resolve-import.d.ts.map +1 -0
  87. package/dist/.dts/build/resolution/resolve-package-schema.d.ts +83 -0
  88. package/dist/.dts/build/resolution/resolve-package-schema.d.ts.map +1 -0
  89. package/dist/.dts/build/resolution/resolve-tsconfig-paths.d.ts +101 -0
  90. package/dist/.dts/build/resolution/resolve-tsconfig-paths.d.ts.map +1 -0
  91. package/dist/.dts/build/resolution/resolve-within-root.d.ts +35 -0
  92. package/dist/.dts/build/resolution/resolve-within-root.d.ts.map +1 -0
  93. package/dist/.dts/build/resolve-import.d.ts +50 -0
  94. package/dist/.dts/build/resolve-import.d.ts.map +1 -0
  95. package/dist/.dts/build/resolve-package-schema.d.ts +99 -0
  96. package/dist/.dts/build/resolve-package-schema.d.ts.map +1 -0
  97. package/dist/.dts/build/resolve-tsconfig-paths.d.ts +100 -0
  98. package/dist/.dts/build/resolve-tsconfig-paths.d.ts.map +1 -0
  99. package/dist/.dts/build/resolve-within-root.d.ts +35 -0
  100. package/dist/.dts/build/resolve-within-root.d.ts.map +1 -0
  101. package/dist/.dts/build/sarif.d.ts +66 -0
  102. package/dist/.dts/build/sarif.d.ts.map +1 -0
  103. package/dist/.dts/build/scan-dependencies.d.ts +47 -0
  104. package/dist/.dts/build/scan-dependencies.d.ts.map +1 -0
  105. package/dist/.dts/build/sort-by-identity.d.ts +14 -0
  106. package/dist/.dts/build/sort-by-identity.d.ts.map +1 -0
  107. package/dist/.dts/build/source-position.d.ts +69 -0
  108. package/dist/.dts/build/source-position.d.ts.map +1 -0
  109. package/dist/.dts/build/tool-version.d.ts +8 -0
  110. package/dist/.dts/build/tool-version.d.ts.map +1 -0
  111. package/dist/.dts/build/types.d.ts +53 -0
  112. package/dist/.dts/build/types.d.ts.map +1 -0
  113. package/dist/.dts/build/usage-report.d.ts +124 -0
  114. package/dist/.dts/build/usage-report.d.ts.map +1 -0
  115. package/dist/.dts/cli/filesystem.d.ts +3 -0
  116. package/dist/.dts/cli/filesystem.d.ts.map +1 -0
  117. package/dist/.dts/eslint-plugin/glob.d.ts +18 -0
  118. package/dist/.dts/eslint-plugin/glob.d.ts.map +1 -0
  119. package/dist/.dts/eslint-plugin/index.d.ts +27 -0
  120. package/dist/.dts/eslint-plugin/index.d.ts.map +1 -0
  121. package/dist/.dts/eslint-plugin/no-node-fs.d.ts +25 -0
  122. package/dist/.dts/eslint-plugin/no-node-fs.d.ts.map +1 -0
  123. package/dist/.dts/eslint-plugin/no-raw-process-env.d.ts +23 -0
  124. package/dist/.dts/eslint-plugin/no-raw-process-env.d.ts.map +1 -0
  125. package/dist/.dts/evidence/define-projection.d.ts +51 -0
  126. package/dist/.dts/evidence/define-projection.d.ts.map +1 -0
  127. package/dist/.dts/evidence/index.d.ts +23 -0
  128. package/dist/.dts/evidence/index.d.ts.map +1 -0
  129. package/dist/.dts/helpers/index.d.ts +135 -0
  130. package/dist/.dts/helpers/index.d.ts.map +1 -0
  131. package/dist/.dts/helpers/processors.d.ts +32 -0
  132. package/dist/.dts/helpers/processors.d.ts.map +1 -0
  133. package/dist/.dts/helpers/validators.d.ts +68 -0
  134. package/dist/.dts/helpers/validators.d.ts.map +1 -0
  135. package/dist/.dts/node/index.d.ts +2 -0
  136. package/dist/.dts/node/index.d.ts.map +1 -0
  137. package/dist/.dts/runtime/cache.d.ts +20 -0
  138. package/dist/.dts/runtime/cache.d.ts.map +1 -0
  139. package/dist/.dts/runtime/create.d.ts +20 -0
  140. package/dist/.dts/runtime/create.d.ts.map +1 -0
  141. package/dist/.dts/runtime/document.d.ts +181 -0
  142. package/dist/.dts/runtime/document.d.ts.map +1 -0
  143. package/dist/.dts/runtime/errors.d.ts +55 -0
  144. package/dist/.dts/runtime/errors.d.ts.map +1 -0
  145. package/dist/.dts/runtime/index.d.ts +24 -0
  146. package/dist/.dts/runtime/index.d.ts.map +1 -0
  147. package/dist/.dts/runtime/registry.d.ts +12 -0
  148. package/dist/.dts/runtime/registry.d.ts.map +1 -0
  149. package/dist/.dts/runtime/reset.d.ts +8 -0
  150. package/dist/.dts/runtime/reset.d.ts.map +1 -0
  151. package/dist/.dts/runtime/types.d.ts +175 -0
  152. package/dist/.dts/runtime/types.d.ts.map +1 -0
  153. package/dist/.dts/runtime/validate.d.ts +14 -0
  154. package/dist/.dts/runtime/validate.d.ts.map +1 -0
  155. package/dist/build.cjs +83 -0
  156. package/dist/build.cjs.map +1 -0
  157. package/dist/build.d.cts +1 -0
  158. package/dist/build.d.ts +1 -0
  159. package/dist/build.js +19 -0
  160. package/dist/build.js.map +1 -0
  161. package/dist/cli/index.js +134 -0
  162. package/dist/cli/index.js.map +1 -0
  163. package/dist/eslint-plugin/index.cjs +12 -0
  164. package/dist/eslint-plugin/index.cjs.map +1 -0
  165. package/dist/eslint-plugin/index.d.cts +1 -0
  166. package/dist/eslint-plugin/index.d.ts +1 -0
  167. package/dist/eslint-plugin/index.js +5 -0
  168. package/dist/eslint-plugin/index.js.map +1 -0
  169. package/dist/evidence.cjs +7 -0
  170. package/dist/evidence.cjs.map +1 -0
  171. package/dist/evidence.d.cts +1 -0
  172. package/dist/evidence.d.ts +1 -0
  173. package/dist/evidence.js +5 -0
  174. package/dist/evidence.js.map +1 -0
  175. package/dist/helpers.cjs +8 -0
  176. package/dist/helpers.cjs.map +1 -0
  177. package/dist/helpers.d.cts +1 -0
  178. package/dist/helpers.d.ts +1 -0
  179. package/dist/helpers.js +5 -0
  180. package/dist/helpers.js.map +1 -0
  181. package/dist/index.cjs +15 -0
  182. package/dist/index.cjs.map +1 -0
  183. package/dist/index.d.cts +1 -0
  184. package/dist/index.d.ts +1 -0
  185. package/dist/index.js +7 -0
  186. package/dist/index.js.map +1 -0
  187. package/dist/node.cjs +13 -0
  188. package/dist/node.cjs.map +1 -0
  189. package/dist/node.d.cts +1 -0
  190. package/dist/node.d.ts +1 -0
  191. package/dist/node.js +7 -0
  192. package/dist/node.js.map +1 -0
  193. package/package.json +183 -0
  194. package/schemas/contract-model.schema.json +321 -0
  195. package/schemas/env-cap-report.schema.json +2369 -0
@@ -0,0 +1,95 @@
1
+ import type { BuildFileSystem } from "./types.js";
2
+ import type { DependencyGraph, ScannedSurface } from "./dependency-graph.js";
3
+ import type { DiscoveredContract } from "./link.js";
4
+ import type { ParseWarning } from "./parse.js";
5
+ import type { ImportResolutionContext } from "./resolution/resolve-import.js";
6
+ import type { PackageOrigin } from "./resolution/resolve-package-schema.js";
7
+ import type { DynamicAccessAssertion } from "./source-position.js";
8
+ import { type RenderUsageReportOptions } from "./usage-report.js";
9
+ /**
10
+ * Computes the full usage-scan surface: the local project root, plus (ADR
11
+ * 0036) each allow-listed `packages` (ADR 0014) name whose schema was
12
+ * successfully resolved -- reusing `origins`' already-resolved
13
+ * `packageDir` (from `resolveAllowlistedPackages()`, already computed by
14
+ * the caller for contract discovery, not re-resolved here) as a bounded
15
+ * scan root, walked with the exact same `discoverSchemaFiles()` +
16
+ * `SCAN_INCLUDE`/`defaultExclude()` policy the local root already uses --
17
+ * never a naive, unbounded walk of the package's whole directory. Shared by
18
+ * `generateUsageReport()` and `generateEvidenceModel()` so both agree on
19
+ * exactly the same scanned surface.
20
+ */
21
+ export declare function computeScanSurface(root: string, exclude: readonly string[], origins: ReadonlyMap<string, PackageOrigin>, fs: BuildFileSystem): Promise<{
22
+ scanFiles: string[];
23
+ scannedSurfaces: ScannedSurface[];
24
+ }>;
25
+ /** Options for {@link generateUsageReport}. */
26
+ export interface GenerateUsageReportOptions {
27
+ /** The filesystem capability -- `./build` never imports `node:fs` (ADR 0040). */
28
+ fs: BuildFileSystem;
29
+ /** Directory glob patterns are resolved against. Defaults to `process.cwd()`. */
30
+ root?: string | undefined;
31
+ /** Schema-discovery glob, for the contract graph -- self-sufficient like the other two generator functions. */
32
+ include?: string[] | undefined;
33
+ /** Glob patterns to exclude, for both schema discovery and the usage scan. Defaults to node_modules/dist/.git. */
34
+ exclude?: string[] | undefined;
35
+ /** **Experimental** (see VERSIONING.md) -- see `GenerateEnvManifestOptions.packages`; see ADR 0014. */
36
+ packages?: readonly string[] | undefined;
37
+ /** **Experimental** (see VERSIONING.md) -- see `GenerateEnvManifestOptions.tsconfig`; see ADR 0023. */
38
+ tsconfig?: string | false | undefined;
39
+ /** Also write the rendered Markdown report to this path, relative to `root`. Omitted: the report is only returned, not written. */
40
+ report?: {
41
+ /** Output path for the report, relative to `root`. */
42
+ location: string;
43
+ } | undefined;
44
+ }
45
+ /**
46
+ * Public result of {@link generateUsageReport}.
47
+ *
48
+ * @remarks
49
+ * Composed from the building-block types `usage-report.ts` (the renderer) owns, the same way
50
+ * `GenerateDocumentationResult` composes from `docs.ts`'s `CatalogContract` --
51
+ * keeps the renderer importable without its orchestrator (see
52
+ * `RenderUsageReportOptions`'s own doc comment).
53
+ */
54
+ export interface GenerateUsageReportResult extends RenderUsageReportOptions {
55
+ /** Absolute path the report was written to, or `undefined` if `options.report` wasn't passed. */
56
+ readonly reportPath: string | undefined;
57
+ }
58
+ export interface UsageComputation {
59
+ readonly graph: DependencyGraph;
60
+ readonly result: RenderUsageReportOptions;
61
+ }
62
+ /**
63
+ * Builds the dependency graph and maps it into the public, ownership-framed
64
+ * result. Never blocks -- see `RenderUsageReportOptions`'s finding fields'
65
+ * own doc comments; a team that wants to gate CI on an ownership issue reads
66
+ * `Finding[]` (the "ownership" family) from the persisted evidence artifact
67
+ * and decides for itself. See ADR 0038.
68
+ *
69
+ * @remarks
70
+ * This mapping is the actual API boundary: internal AST vocabulary
71
+ * ("member accessed", "dynamic") becomes ownership vocabulary ("who owns
72
+ * it", "who consumes it", "abandoned", "unresolved"). The result is a
73
+ * renderer-agnostic domain model -- the same computed data a future JSON or
74
+ * SARIF exporter would consume, not something coupled to the Markdown
75
+ * renderer.
76
+ */
77
+ export declare function computeUsage(root: string, contracts: readonly DiscoveredContract[], scanFiles: readonly string[], readFile: (filePath: string) => Promise<string>, context: ImportResolutionContext, parseWarnings: readonly ParseWarning[], scannedSurfaces?: readonly ScannedSurface[], dynamicAccessAcknowledgments?: ReadonlyMap<string, readonly DynamicAccessAssertion[]>): Promise<UsageComputation>;
78
+ /** Writes the Dependency & Ownership Report. Callers must have already confirmed `reportPath` is safe and nothing is blocking. */
79
+ export declare function writeUsageReport(reportPath: string, computed: Omit<GenerateUsageReportResult, "reportPath">, fs: BuildFileSystem): Promise<void>;
80
+ /**
81
+ * Build-time only. Answers who owns each contract, which features depend on
82
+ * it, and what the blast radius is if it changes -- the mirror image of
83
+ * {@link generateEnvManifest}'s "safer migrations" story: a schema that was never
84
+ * wired up, or was abandoned mid-removal, shows up here instead of sitting
85
+ * unnoticed.
86
+ *
87
+ * @remarks
88
+ * This is an additional, separate artifact, not a replacement for
89
+ * {@link generateDocumentation}'s Catalog -- the two serve different audiences
90
+ * (see ADR 0010).
91
+ *
92
+ * @throws {EnvUsageAnalysisError} If `report.location` escapes `root`.
93
+ */
94
+ export declare function generateUsageReport(options: GenerateUsageReportOptions): Promise<GenerateUsageReportResult>;
95
+ //# sourceMappingURL=generate-usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-usage.d.ts","sourceRoot":"","sources":["../../../src/build/generate-usage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAQ5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAE3E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAML,KAAK,wBAAwB,EAG9B,MAAM,mBAAmB,CAAA;AAE1B;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,EAC3C,EAAE,EAAE,eAAe,GAClB,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC,CA+BrE;AAED,+CAA+C;AAC/C,MAAM,WAAW,0BAA0B;IACzC,iFAAiF;IACjF,EAAE,EAAE,eAAe,CAAA;IACnB,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,+GAA+G;IAC/G,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC9B,kHAAkH;IAClH,OA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AmB,CACvC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,yBAAyB,CAAC,CAgDpC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Single source of truth for the "this file is generated" marker text, so it
3
+ * can never drift out of sync between where it's written (`manifest.ts`,
4
+ * `docs.ts`, `usage-report.ts`) and where it's read (`scan-dependencies.ts`,
5
+ * closing the self-reference loop where a contract's own generated manifest
6
+ * would otherwise make it look permanently "used"). Not configurable, not
7
+ * public.
8
+ *
9
+ * Also home to the two standing notices every governance-adjacent artifact
10
+ * stamps near the top -- `evidenceDisclaimer()` and
11
+ * `evidenceProjectionNote()`. They live here, next to the banner, because
12
+ * they answer the same question the banner does ("what is this file, and how
13
+ * much should I trust it?") and because a renderer that emits one must never
14
+ * be able to emit the others from a stale, separately-maintained copy.
15
+ */
16
+ /** Renders the "do not edit by hand" marker in the given comment syntax. */
17
+ export declare function generatedBanner(format?: "ts" | "markdown"): string;
18
+ /**
19
+ * Whether `content` carries a {@link generatedBanner}-produced marker, in
20
+ * either format.
21
+ *
22
+ * @remarks
23
+ * Deliberately not a bare `content.startsWith(generatedBanner(...))`: a
24
+ * shebang, a `"use strict"` pragma, or a license header pushes a real banner
25
+ * off line one, and a stricter check would then read a genuinely generated
26
+ * file as hand-written -- which `dependency-graph.ts` would take as "a real
27
+ * consumer imports this contract," permanently masking an abandoned one. The
28
+ * marker is looked for across the first 20 non-empty lines instead, which
29
+ * clears every realistic preamble without scanning a whole file.
30
+ */
31
+ export declare function isGeneratedFile(content: string): boolean;
32
+ /**
33
+ * Short disclaimer stamped into every artifact that renders sensitivity/
34
+ * ownership/expiry claims (the docs Catalog, the Dependency & Ownership
35
+ * Report). Never omit this from an artifact that renders `documentEnv()`
36
+ * metadata: it's what keeps "documented" from being misread as "verified" or
37
+ * "compliant." Every fact in those artifacts is either a statically-provable
38
+ * code fact or an author's own declaration -- env-cap never executes a schema
39
+ * file and never validates a declaration against reality.
40
+ */
41
+ export declare function evidenceDisclaimer(): string;
42
+ /**
43
+ * States, by concept, that this artifact is a projection of env-cap's
44
+ * Evidence Model (ADR 0031/0038) -- never a hardcoded path, since
45
+ * `docs/env.evidence.json` only exists on a run that actually passed
46
+ * `--evidence`; a project that never requests that flag would otherwise get
47
+ * a note pointing at a file that doesn't exist. `evidencePath`, when this
48
+ * same run's own options did include `--evidence <path>`, names that
49
+ * concrete path in addition to the concept.
50
+ */
51
+ export declare function evidenceProjectionNote(evidencePath?: string): string;
52
+ //# sourceMappingURL=generated-banner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-banner.d.ts","sourceRoot":"","sources":["../../../src/build/generated-banner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAeH,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,MAAM,GAAE,IAAI,GAAG,UAAiB,GAAG,MAAM,CAQxE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAMpE"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Converts one glob pattern to a RegExp. Handles `**` as "any number of path
3
+ * segments, including zero" (so `**\/node_modules/**` matches a root-level
4
+ * `node_modules`, and `**\/env.schema.ts` matches a root-level file, not just
5
+ * nested ones) -- a plain `**` -> `.*` substitution gets both of those wrong.
6
+ *
7
+ * Used by discover.ts's `include`/`exclude` schema-discovery walk.
8
+ *
9
+ * Deliberately duplicated (not shared) with
10
+ * src/eslint-plugin/glob.ts, which needs the exact same matching behavior
11
+ * for its own `allow` option -- keeps this build-only module free of any
12
+ * import reaching outside src/build, so `src/build` stays independently
13
+ * splittable into its own package with zero source-level cross-folder
14
+ * dependency. Not re-exported from `./index.js` -- Private tier per
15
+ * VERSIONING.md.
16
+ */
17
+ export declare function globToRegExp(pattern: string): RegExp;
18
+ //# sourceMappingURL=glob.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../../src/build/glob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAyBpD"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The declared governance-metadata field set every pipeline-stage contract and
3
+ * variable type carries -- `owner` through `metadata`. The field names and types
4
+ * are identical at every stage (parse -> link -> contract-model -> docs); only
5
+ * the surrounding context differs (a `parse`-stage value is "statically resolved
6
+ * from a string literal, or `undefined`"; a `link`/`contract-model`-stage value
7
+ * is "from the linked `documentEnv()` call, or `undefined`"). This is the single
8
+ * source of truth for the shape; each stage interface `extends` it.
9
+ *
10
+ * `metadata` is the open bag for keys `env-cap` has no named concept for (ADR
11
+ * 0037); `dataResidency`/`auditRequired`/`legalBasis`/`purpose`/`retention` are
12
+ * presence-only governance facts, never verified.
13
+ *
14
+ * Internal -- not re-exported from the public `.` barrel.
15
+ */
16
+ export interface EnvGovernanceFields {
17
+ readonly owner: string | undefined;
18
+ readonly sensitivity: string | undefined;
19
+ readonly expiresAt: string | undefined;
20
+ readonly purpose: string | undefined;
21
+ readonly legalBasis: string | undefined;
22
+ readonly retention: string | undefined;
23
+ readonly dataResidency: string | readonly string[] | undefined;
24
+ readonly auditRequired: boolean | undefined;
25
+ readonly metadata: Readonly<Record<string, unknown>> | undefined;
26
+ }
27
+ /**
28
+ * Copies exactly the {@link EnvGovernanceFields} out of a value that carries
29
+ * them -- for projecting one pipeline stage's contract/variable into the next
30
+ * (`link` -> `contract-model` -> `docs` catalog, ...) without re-listing all
31
+ * nine fields at every hop.
32
+ */
33
+ export declare function governanceFieldsOf(source: EnvGovernanceFields): EnvGovernanceFields;
34
+ //# sourceMappingURL=governance-fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"governance-fields.d.ts","sourceRoot":"","sources":["../../../src/build/governance-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IAC9D,QAAQ,CAAC,aAAa,EAAE,OAAO,GAAG,SAAS,CAAA;IAC3C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAA;CACjE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,mBAAmB,CAYnF"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Formats a metadata key for display in generated docs/examples:
3
+ * "lastRotation" -> "Last Rotation". Shared by `docs.ts` and `env-example.ts`
4
+ * so both generated artifacts label metadata the same way.
5
+ */
6
+ export declare function humanizeKey(key: string): string;
7
+ /**
8
+ * Formats a `metadata`/`dataResidency` value for display in generated docs/examples -- a string
9
+ * renders as-is; anything else (ADR 0035 widened `metadata` to any value) renders as its JSON
10
+ * text, so an object/array value never prints `[object Object]`. Shared by `docs.ts` and
11
+ * `env-example.ts`, same rationale as {@link humanizeKey}.
12
+ */
13
+ export declare function renderMetadataValue(value: unknown): string;
14
+ //# sourceMappingURL=humanize-key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"humanize-key.d.ts","sourceRoot":"","sources":["../../../src/build/humanize-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ/C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE1D"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * env-cap build-time entry point (`env-cap/build`).
3
+ *
4
+ * Discovery, static analysis, cross-file linking, and manifest/docs/
5
+ * ownership-report generation only -- this module imports `node:path` and
6
+ * (indirectly) `typescript`, and must never be imported from runtime/
7
+ * browser/edge code. It has no knowledge of `createEnv`/`documentEnv`/
8
+ * `validateEnv` and performs no environment validation, and never executes a
9
+ * discovered schema file.
10
+ *
11
+ * It never imports `node:fs` (ADR 0040): `./build` is a library surface, so
12
+ * the caller supplies the filesystem capability. Every public options object
13
+ * below carries a required `fs: BuildFileSystem` field; the `env-cap` CLI
14
+ * builds a concrete `node:fs/promises` adapter and hands it in. A consumer
15
+ * running these functions from their own Node build script imports the same
16
+ * adapter from `env-cap/node` (`{ nodeBuildFileSystem }`).
17
+ *
18
+ * The public API is deliberately curated: four generator functions
19
+ * (`generateEnvManifest`, `generateDocumentation`, `generateUsageReport`,
20
+ * `generateEnvArtifacts`) -- Stable, per VERSIONING.md -- plus the
21
+ * lower-level discovery/linking primitives already justified by real
22
+ * external use (custom CI scripts, bundler plugins). Those primitives are
23
+ * Experimental, not Stable, until each has been through a real feedback
24
+ * cycle on its own (see VERSIONING.md's Experimental tier). The
25
+ * dependency-ownership engine's internals (scanning, graph-building,
26
+ * derivation) are intentionally NOT exported here -- see ADR 0010 and ADR
27
+ * 0011. `env-cap` answers ownership/visibility questions; it doesn't ship a
28
+ * general-purpose static-analysis toolkit. The scanner follows
29
+ * object-destructuring and one level of file-unique `const` aliasing, and
30
+ * records every other shape as an explicit `escape` (ADR 0039); a variable
31
+ * on an escaped contract is `indeterminate`, never a false `unconsumed`, and
32
+ * the finding's `reason` cites every escape site.
33
+ *
34
+ * Each generator also accepts an Experimental `packages` option (an explicit
35
+ * allowlist of installed package names) for discovering a schema that ships
36
+ * inside a separately-published dependency rather than the project's own
37
+ * source tree -- see ADR 0014 and VERSIONING.md.
38
+ *
39
+ * Each generator also accepts an Experimental `tsconfig` option for resolving
40
+ * import specifiers written as TypeScript path aliases (e.g. `"@/lib/env"`)
41
+ * against a project's own `tsconfig.json` `paths`/`baseUrl` during static
42
+ * analysis. Unlike `packages`, this is on by default (auto-detecting
43
+ * `tsconfig.json` at `root`) since it never crosses a trust/versioning
44
+ * boundary -- see ADR 0023 and VERSIONING.md.
45
+ */
46
+ export { checkEnvArtifacts } from "./check-artifacts.js";
47
+ export type { ArtifactCheckFinding, CheckEnvArtifactsResult } from "./check-artifacts.js";
48
+ export { generateDocumentation } from "./generate-documentation.js";
49
+ export type { DocumentationFindings, GenerateDocumentationOptions, GenerateDocumentationResult, } from "./generate-documentation.js";
50
+ export { generateEnvArtifacts } from "./generate-env-artifacts.js";
51
+ export type { GenerateEnvArtifactsOptions, GenerateEnvArtifactsResult, } from "./generate-env-artifacts.js";
52
+ export { generateEnvManifest } from "./generate-manifest.js";
53
+ export type { GenerateEnvManifestOptions, GenerateEnvManifestResult } from "./generate-manifest.js";
54
+ export type { ManifestChangeReport, ManifestContractRef, ManifestContractUpdate, ManifestFieldChange, ManifestVariableRef, ManifestVariableUpdate, } from "./evidence-snapshot.js";
55
+ export { computeSourceFingerprint, getEvidenceModel } from "./evidence-cache.js";
56
+ export type { ComputeSourceFingerprintOptions, GetEvidenceModelOptions, GetEvidenceModelResult, } from "./evidence-cache.js";
57
+ export { generateUsageReport } from "./generate-usage.js";
58
+ export type { GenerateUsageReportOptions, GenerateUsageReportResult } from "./generate-usage.js";
59
+ export { renderUsageReport, type AbandonedContractFinding, type AssertedDynamicAccessFinding, type IndeterminateOwnershipFinding, type OwnershipDependencyEntry, type RenderUsageReportOptions, type UnconsumedOwnedVariableFinding, type UnresolvedConsumerFinding, } from "./usage-report.js";
60
+ export type { DynamicAccessCitationProblem } from "./citation-verification.js";
61
+ export type { CompatibilityIssue, CompatibilityIssueCode } from "./compatibility.js";
62
+ export { EnvDocumentationGenerationError, EnvManifestGenerationError, EnvProjectGenerationError, EnvUsageAnalysisError, } from "./errors.js";
63
+ export type { DiscoveredContractSummary } from "./link.js";
64
+ export { buildChangeModel, CHANGE_MODEL_SCHEMA_VERSION } from "./change-model.js";
65
+ export type { ChangeModel, RenamedVariable } from "./change-model.js";
66
+ export { detectCompatibilityIssues, detectDuplicateVariableShapes } from "./compatibility.js";
67
+ export { displayPath } from "./display-path.js";
68
+ export { buildSarifLog } from "./sarif.js";
69
+ export type { SarifLog } from "./sarif.js";
70
+ export { configurationReference, expiringSoonReport, groupVariablesByOwner, ownershipSummary, } from "./reference-projections.js";
71
+ export type { ConfigurationReference, ConfigurationReferenceEntry, ExpiringSoonEntry, ExpiringSoonReport, OwnerBearingContract, OwnershipSummary, OwnershipSummaryEntry, } from "./reference-projections.js";
72
+ export { buildContractModel, CONTRACT_MODEL_SCHEMA_VERSION } from "./contract-model.js";
73
+ export type { ContractModel, ContractModelContract, ContractModelVariable, } from "./contract-model.js";
74
+ export { deepFreeze } from "./deep-freeze.js";
75
+ export { buildDependencyModel, DEPENDENCY_MODEL_SCHEMA_VERSION } from "./dependency-model.js";
76
+ export type { DependencyModel, DependencyModelConsumer, DependencyModelContract, DependencyModelContractRef, DependencyModelVariable, } from "./dependency-model.js";
77
+ export type { ScannedSurface, VariableAccessStatus } from "./dependency-graph.js";
78
+ export { discoverSchemaFiles } from "./discover.js";
79
+ export { computeExpiringEntries, computeSecurityReviewCounters, extractPreviouslyDocumentedKeys, renderDocs, } from "./docs.js";
80
+ export type { ExpiringEntry, RenderDocsOptions, SecurityReviewCounters, UndocumentedContractRef, UndocumentedVariableRef, } from "./docs.js";
81
+ export { computeReconciliation, extractCommentedVariables, extractDeclaredVariables, renderEnvExample, writeEnvExample, } from "./env-example.js";
82
+ export type { EnvExampleOnExisting, EnvExampleResult, Reconciliation } from "./env-example.js";
83
+ export type { DynamicAccessAssertion, SourcePosition } from "./source-position.js";
84
+ export { EVIDENCE_MODEL_SCHEMA_VERSION } from "./evidence-model.js";
85
+ export type { EvidenceModel, EvidenceProvenance } from "./evidence-model.js";
86
+ export { generateEvidenceModel } from "./generate-evidence.js";
87
+ export type { GenerateEvidenceModelOptions } from "./generate-evidence.js";
88
+ export type { ChangeEvidenceReference, ContractEvidenceReference, ContractRef, EvidenceReference, OwnershipEvidenceReference, } from "./evidence-reference.js";
89
+ export { detectExclusiveGroupIssues } from "./exclusive-group.js";
90
+ export { buildFindingModel, FINDING_MODEL_SCHEMA_VERSION } from "./finding-model.js";
91
+ export type { BuildFindingModelInput, Finding, FindingCode, FindingFamily, FindingModel, } from "./finding-model.js";
92
+ export { buildLifecycleModel, LIFECYCLE_MODEL_SCHEMA_VERSION } from "./lifecycle-model.js";
93
+ export type { LifecycleModel, LifecycleModelContract, LifecycleModelVariable, } from "./lifecycle-model.js";
94
+ export { effectiveOwner, linkFiles } from "./link.js";
95
+ export type { DiscoveredContract, DiscoveredVariable, LinkResult, UnresolvedLink } from "./link.js";
96
+ export { applyLiveExpirationOverrides, collectVariableNames, resolveLiveExpirationDates, } from "./live-expirations.js";
97
+ export type { LiveExpirationDates } from "./live-expirations.js";
98
+ export { renderManifest } from "./manifest.js";
99
+ export { buildOwnershipModel, OWNERSHIP_MODEL_SCHEMA_VERSION } from "./ownership-model.js";
100
+ export type { OwnershipModel, OwnershipModelContract, OwnershipModelContractRef, OwnershipModelVariable, OwnershipModelVariableRef, } from "./ownership-model.js";
101
+ export { extractContractDocs, extractSchemaVariables, parseSchemaFile } from "./parse.js";
102
+ export type { DiscoveredContractDocs, DiscoveredSchemaVariable, DiscoveredVariableDocs, FileParseResult, ImportBinding, ParseWarning, SchemaRef, } from "./parse.js";
103
+ export { resolveRelativeImport } from "./resolution/resolve-import.js";
104
+ export type { PackageOrigin } from "./resolution/resolve-package-schema.js";
105
+ export type { BuildDirent, BuildFileSystem, BuildStats } from "./types.js";
106
+ export { readToolVersion } from "./tool-version.js";
107
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/build/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACnE,YAAY,EACV,qBAAqB,EACrB,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,YAAY,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAQnG,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,wBAAwB,CAAA;AAI/B,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAChF,YAAY,EACV,+BAA+B,EAC/B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,YAAY,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAUhG,OAAO,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./link.js";
3
+ /**
4
+ * The fifth of env-cap's seven canonical fact models (ADR 0024) -- every
5
+ * contract and variable's lifecycle data (expiry, deprecation, rename
6
+ * correlation), promoting `ExpiringEntry`/`computeExpiringEntries()`
7
+ * (already a good precedent -- real, exported, reused across `renderDocs()`
8
+ * and `generate-documentation.ts`) into a canonical, versioned shape
9
+ * alongside the new deprecation/rename fields. See ADR 0029.
10
+ */
11
+ /** Bump only when a reader could misinterpret the new shape -- same discipline every other canonical model's `schemaVersion` follows. */
12
+ export declare const LIFECYCLE_MODEL_SCHEMA_VERSION = 2;
13
+ /**
14
+ * One variable's lifecycle data (expiry, deprecation, rename correlation).
15
+ *
16
+ * @see {@link ContractModelVariable} -- this same declared variable's canonical starting point.
17
+ */
18
+ export interface LifecycleModelVariable {
19
+ readonly key: string;
20
+ readonly expiresAt: string | undefined;
21
+ readonly refreshInstructions: string | undefined;
22
+ readonly deprecated: boolean | undefined;
23
+ readonly deprecatedReason: string | undefined;
24
+ readonly removeBy: string | undefined;
25
+ /** The previous variable name this one renames, if set -- see `ManifestChangeReport`'s rename correlation (ADR 0029/0030). */
26
+ readonly renamedFrom: string | undefined;
27
+ /** Descriptive retention policy (e.g. "delete after 90 days") -- a policy statement, never computed or parsed, deliberately independent of `expiresAt`'s actual temporal constraint. See ADR 0035. */
28
+ readonly retention: string | undefined;
29
+ }
30
+ export interface LifecycleModelContract {
31
+ /** Root-relative, POSIX-separated -- matches `ContractModelContract.file`. */
32
+ readonly file: string;
33
+ readonly exportName: string;
34
+ readonly contractName: string;
35
+ readonly expiresAt: string | undefined;
36
+ readonly deprecated: boolean | undefined;
37
+ readonly deprecatedReason: string | undefined;
38
+ /** See {@link LifecycleModelVariable.retention}. */
39
+ readonly retention: string | undefined;
40
+ /** Only variables with at least one lifecycle field set (`expiresAt`, `refreshInstructions`, `deprecated`, `removeBy`, `renamedFrom`, `retention`) -- same "only what's relevant" scope `renderLifecycleReport()` already uses for its rows. */
41
+ readonly variables: readonly LifecycleModelVariable[];
42
+ }
43
+ export interface LifecycleModel {
44
+ readonly schemaVersion: typeof LIFECYCLE_MODEL_SCHEMA_VERSION;
45
+ /** Only contracts with at least one lifecycle-relevant field set, at the contract level or on at least one variable. */
46
+ readonly contracts: readonly LifecycleModelContract[];
47
+ /**
48
+ * Every contract-/variable-level `expiresAt` within the configured window,
49
+ * soonest-first -- see `computeExpiringEntries()`. `file` is root-relative
50
+ * and POSIX-separated here, matching `LifecycleModelContract.file`/every
51
+ * other canonical model -- unlike `ExpiringEntry`'s own doc comment, which
52
+ * describes its shape in `computeExpiringEntries()`'s other direct
53
+ * consumers (e.g. `DocumentationFindings.expiringSoon`), where `file`
54
+ * stays the absolute path `renderDocs()` itself expects.
55
+ */
56
+ readonly expiring: readonly ExpiringEntry[];
57
+ }
58
+ /**
59
+ * Projects every discovered contract with at least one lifecycle-relevant
60
+ * field set into the Lifecycle Model's versioned, JSON-serializable shape,
61
+ * plus the already-established `expiring` view.
62
+ */
63
+ export declare function buildLifecycleModel(contracts: readonly DiscoveredContract[], expiringWithinDays: number, now: Date, root: string): LifecycleModel;
64
+ //# sourceMappingURL=lifecycle-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-model.d.ts","sourceRoot":"","sources":["../../../src/build/lifecycle-model.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAsB,MAAM,WAAW,CAAA;AAEvE;;;;;;;GAOG;AAEH,yIAAyI;AACzI,eAAO,MAAM,8BAA8B,IAAI,CAAA;AAE/C;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAA;IAChD,QAAQ,CAAC,UAAU,EAAE,OA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