@nifrajs/cli 2.1.0 → 2.3.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 (126) hide show
  1. package/README.md +25 -25
  2. package/dist/assure.d.ts +2 -2
  3. package/dist/assure.d.ts.map +1 -1
  4. package/dist/assure.js +17 -10
  5. package/dist/assure.js.map +1 -1
  6. package/dist/capabilities-tool.d.ts +7 -0
  7. package/dist/capabilities-tool.d.ts.map +1 -1
  8. package/dist/capabilities-tool.js +68 -16
  9. package/dist/capabilities-tool.js.map +1 -1
  10. package/dist/check.d.ts +64 -22
  11. package/dist/check.d.ts.map +1 -1
  12. package/dist/check.js +400 -83
  13. package/dist/check.js.map +1 -1
  14. package/dist/cli.d.ts +37 -0
  15. package/dist/cli.d.ts.map +1 -1
  16. package/dist/cli.js +291 -53
  17. package/dist/cli.js.map +1 -1
  18. package/dist/diff-tool.d.ts +3 -3
  19. package/dist/diff-tool.js +7 -7
  20. package/dist/docs-search.d.ts +3 -3
  21. package/dist/docs-search.js +6 -6
  22. package/dist/doctor.d.ts +8 -4
  23. package/dist/doctor.d.ts.map +1 -1
  24. package/dist/doctor.js +74 -14
  25. package/dist/doctor.js.map +1 -1
  26. package/dist/examples.d.ts +5 -5
  27. package/dist/examples.js +5 -5
  28. package/dist/init-agents.d.ts +14 -14
  29. package/dist/init-agents.js +14 -14
  30. package/dist/internal/typescript-import.d.ts +24 -0
  31. package/dist/internal/typescript-import.d.ts.map +1 -0
  32. package/dist/internal/typescript-import.js +32 -0
  33. package/dist/internal/typescript-import.js.map +1 -0
  34. package/dist/introspect.d.ts +12 -12
  35. package/dist/introspect.js +24 -24
  36. package/dist/levels-tool.d.ts +8 -8
  37. package/dist/levels-tool.d.ts.map +1 -1
  38. package/dist/levels-tool.js +33 -30
  39. package/dist/levels-tool.js.map +1 -1
  40. package/dist/load.d.ts +17 -6
  41. package/dist/load.d.ts.map +1 -1
  42. package/dist/load.js +45 -7
  43. package/dist/load.js.map +1 -1
  44. package/dist/manifest-tool.d.ts +1 -1
  45. package/dist/manifest-tool.d.ts.map +1 -1
  46. package/dist/manifest-tool.js +4 -2
  47. package/dist/manifest-tool.js.map +1 -1
  48. package/dist/mcp-docs-tools.d.ts +1 -1
  49. package/dist/mcp-docs-tools.d.ts.map +1 -1
  50. package/dist/mcp-docs-tools.js +14 -10
  51. package/dist/mcp-docs-tools.js.map +1 -1
  52. package/dist/mcp-http.d.ts +5 -5
  53. package/dist/mcp-http.js +7 -7
  54. package/dist/mcp-protocol.d.ts +2 -2
  55. package/dist/mcp-protocol.js +2 -2
  56. package/dist/mcp-render.d.ts +3 -3
  57. package/dist/mcp-render.js +15 -7
  58. package/dist/mcp-render.js.map +1 -1
  59. package/dist/mcp-run.d.ts +2 -2
  60. package/dist/mcp-run.js +2 -2
  61. package/dist/mcp.d.ts +14 -14
  62. package/dist/mcp.d.ts.map +1 -1
  63. package/dist/mcp.js +119 -47
  64. package/dist/mcp.js.map +1 -1
  65. package/dist/openapi-tool.d.ts +1 -1
  66. package/dist/openapi-tool.js +2 -2
  67. package/dist/pipeline-guard.d.ts +83 -0
  68. package/dist/pipeline-guard.d.ts.map +1 -0
  69. package/dist/pipeline-guard.js +136 -0
  70. package/dist/pipeline-guard.js.map +1 -0
  71. package/dist/port.d.ts +9 -9
  72. package/dist/port.js +27 -27
  73. package/dist/recipes/1.8.0.d.ts +2 -2
  74. package/dist/recipes/1.8.0.js +5 -5
  75. package/dist/recipes/index.d.ts +2 -2
  76. package/dist/recipes/index.js +1 -1
  77. package/dist/scaffold.d.ts +3 -3
  78. package/dist/scaffold.js +8 -8
  79. package/dist/sync-routes.d.ts +28 -0
  80. package/dist/sync-routes.d.ts.map +1 -0
  81. package/dist/sync-routes.js +55 -0
  82. package/dist/sync-routes.js.map +1 -0
  83. package/dist/types-search.d.ts +6 -6
  84. package/dist/types-search.d.ts.map +1 -1
  85. package/dist/types-search.js +53 -8
  86. package/dist/types-search.js.map +1 -1
  87. package/dist/upgrade.d.ts +7 -7
  88. package/dist/upgrade.js +12 -12
  89. package/dist/verification.d.ts +51 -0
  90. package/dist/verification.d.ts.map +1 -0
  91. package/dist/verification.js +80 -0
  92. package/dist/verification.js.map +1 -0
  93. package/docs/examples.json +178 -88
  94. package/docs/llms-full.txt +1766 -766
  95. package/docs/types.json +2171 -2807
  96. package/package.json +22 -11
  97. package/src/assure.ts +17 -18
  98. package/src/capabilities-tool.ts +82 -16
  99. package/src/check.ts +493 -100
  100. package/src/cli.ts +306 -54
  101. package/src/diff-tool.ts +8 -8
  102. package/src/docs-search.ts +6 -6
  103. package/src/doctor.ts +81 -16
  104. package/src/examples.ts +7 -7
  105. package/src/init-agents.ts +17 -17
  106. package/src/internal/typescript-import.ts +33 -0
  107. package/src/introspect.ts +28 -28
  108. package/src/levels-tool.ts +37 -31
  109. package/src/load.ts +65 -12
  110. package/src/manifest-tool.ts +4 -2
  111. package/src/mcp-docs-tools.ts +20 -10
  112. package/src/mcp-http.ts +7 -7
  113. package/src/mcp-protocol.ts +2 -2
  114. package/src/mcp-render.ts +15 -7
  115. package/src/mcp-run.ts +2 -2
  116. package/src/mcp.ts +127 -47
  117. package/src/openapi-tool.ts +2 -2
  118. package/src/pipeline-guard.ts +186 -0
  119. package/src/port.ts +31 -31
  120. package/src/recipes/1.8.0.ts +5 -5
  121. package/src/recipes/index.ts +2 -2
  122. package/src/scaffold.ts +8 -8
  123. package/src/sync-routes.ts +69 -0
  124. package/src/types-search.ts +57 -8
  125. package/src/upgrade.ts +12 -12
  126. package/src/verification.ts +123 -0
package/dist/check.d.ts CHANGED
@@ -1,20 +1,23 @@
1
1
  /**
2
- * `nifra check` — the agent's (and CI's) definition of done. It makes the guarantees that keep a nifra
2
+ * `nifra check` - the agent's (and CI's) definition of done. It makes the guarantees that keep a nifra
3
3
  * app drift-proof actually *fire*, instead of relying on the agent to remember them:
4
4
  *
5
- * 1. **typecheck** (`tsc --noEmit`) — the frontend↔backend contract is compiler-enforced. The typed
5
+ * 1. **typecheck** (`tsc --noEmit`) - the frontend↔backend contract is compiler-enforced. The typed
6
6
  * client derives request + response types from the routes, so a shape mismatch is a type error.
7
- * 2. **typed-client lint** — flags hand-rolled `fetch()` to this app's *own* API (a relative URL),
7
+ * 2. **typed-client lint** - flags hand-rolled `fetch()` to this app's *own* API (a relative URL),
8
8
  * which bypasses `client<typeof app>` so the compiler can't see the drift.
9
- * 3. **server-only-import lint** — flags a top-level import of server-only code (a DB driver, `node:`/
9
+ * 3. **server-only-import lint** - flags a top-level import of server-only code (a DB driver, `node:`/
10
10
  * `bun:` builtins, the `./db` module) into a `routes/` page module. Those modules are bundled for
11
- * the browser too, so the import ships server code to the client and breaks the build — the #1
11
+ * the browser too, so the import ships server code to the client and breaks the build - the #1
12
12
  * full-stack footgun. Reach server resources via `c.db` / `ctx.api`, never a top-level import.
13
13
  *
14
14
  * `collectCheckResult` returns a structured, machine-readable result (consumed by `--json` and the
15
15
  * `nifra_check` MCP tool, so an agent acts on diagnostics instead of scraping prose). Exits non-zero if
16
16
  * anything fails. Pure scanners (`scanFetchText`, `scanServerOnlyImports`) are unit-tested.
17
17
  */
18
+ import type { AssuranceConfig, AssuranceReport } from "@nifrajs/core/assurance";
19
+ import type { CapabilityProjectReport } from "./capabilities-tool.js";
20
+ import { type TypeScriptApi } from "./internal/typescript-import.js";
18
21
  export interface SourceFinding {
19
22
  readonly file: string;
20
23
  readonly line: number;
@@ -31,13 +34,13 @@ export interface StaticRouteFinding extends SourceFinding {
31
34
  readonly path: string;
32
35
  }
33
36
  /**
34
- * Blank, with spaces (newlines preserved, so every byte offset — and line number — is unchanged):
37
+ * Blank, with spaces (newlines preserved, so every byte offset - and line number - is unchanged):
35
38
  * - `//` line comments and block comments;
36
- * - the CONTENTS of backtick template literals — code-as-text (doc `CodeBlock` examples, code
39
+ * - the CONTENTS of backtick template literals - code-as-text (doc `CodeBlock` examples, code
37
40
  * generators), never a real statement to lint.
38
41
  * Single/double-quoted strings are KEPT (a real import/Response specifier lives in one). A small
39
42
  * char-state machine, not a full lexer: it doesn't model regex literals, so a regex containing a quote
40
- * could mis-skip — in practice the constructs these scanners look for sit before any such regex.
43
+ * could mis-skip - in practice the constructs these scanners look for sit before any such regex.
41
44
  * Shared by the source scanners here and by `nifra doctor` ({@link ./doctor.ts}).
42
45
  */
43
46
  export declare function stripComments(src: string): string;
@@ -54,8 +57,22 @@ export declare function codePositionMask(src: string): string;
54
57
  export declare function scanFetchText(file: string, content: string, externalMounts?: readonly string[]): SourceFinding[];
55
58
  /** Statically collect simple Nifra route registrations from source, without importing app code. */
56
59
  export declare function scanStaticRouteText(file: string, content: string): StaticRouteFinding[];
60
+ /** Scan one file's text for SQL assembled by interpolation. Pure + line-accurate. */
61
+ export declare function scanInterpolatedSql(file: string, content: string, ts: TypeScriptApi): SourceFinding[];
62
+ /**
63
+ * Collect interpolated-SQL findings across the project.
64
+ *
65
+ * Returns `undefined` - not an empty array - when TypeScript is not installed. The rule parses source
66
+ * with the compiler, so without it there is nothing to report and, more to the point, no basis for
67
+ * reporting nothing. An empty result would read as "no interpolated SQL found", which is the one
68
+ * answer a security rule must never give when it did not run.
69
+ */
70
+ export declare function scanProjectSql(cwd: string): Promise<SourceFinding[] | undefined>;
57
71
  /** Scan one file's text for untyped `client("…")` calls. Pure + line-accurate. */
58
72
  export declare function scanUntypedClient(file: string, content: string): SourceFinding[];
73
+ /** Flag an import of a specifier that no longer exists. Pure; matches the exact specifier or a subpath
74
+ * of it, so `@nifrajs/budget/x` is caught alongside `@nifrajs/budget`. */
75
+ export declare function scanRemovedImports(file: string, content: string): SourceFinding[];
59
76
  /** Scan a route module for top-level server-only imports. Returns `[]` for non-route files (only
60
77
  * `routes/` modules are browser-bundled, so a server-only import elsewhere is fine). Each finding carries
61
78
  * the offending `specifier` so the diagnostic can render the `routeFile → specifier` chain. Pure. */
@@ -64,13 +81,13 @@ export declare function scanServerOnlyImports(file: string, content: string): Se
64
81
  * Mirrors {@link STATIC_IMPORT}, so `import type` + dynamic `import()` are already excluded. Pure. */
65
82
  export declare function parseStaticImports(content: string): string[];
66
83
  /** The server-only SINK an import specifier names directly (a `node:`/`bun:` builtin or a known
67
- * server-only package), or `undefined` if it isn't a by-name sink. Pure — the label is the specifier
84
+ * server-only package), or `undefined` if it isn't a by-name sink. Pure - the label is the specifier
68
85
  * itself (it's already the actionable name). */
69
86
  export declare function directSinkSpecifier(spec: string): string | undefined;
70
87
  /** One transitive server-only finding: the route module, the route's offending top-level import (the
71
88
  * first hop / `specifier`), the line + snippet of that import, and the FULL chain to the sink. */
72
89
  export interface TransitiveServerImportFinding extends ServerImportFinding {
73
- /** `[routeFile, ...as-written specifiers…, sink]` — the shortest path the walk found. Length 2 means
90
+ /** `[routeFile, ...as-written specifiers…, sink]` - the shortest path the walk found. Length 2 means
74
91
  * the route imports the sink directly (same as the regex scan's direct edge). */
75
92
  readonly chain: readonly string[];
76
93
  /** True when a precise transitive resolve wasn't possible for the first hop (a bare pkg / path alias),
@@ -91,14 +108,14 @@ export type ModuleReader = (absPath: string) => string | undefined;
91
108
  * unresolvable alias). At each node, a by-name sink import (`node:fs`, `postgres`) OR a resolved
92
109
  * `*.server` / `server-only`-marked dependency terminates the chain. Bounded by depth + a visited set, so
93
110
  * it's linear and cycle-free. `routeFile`/`routeContent` seed the walk; `resolve`/`read` supply the graph
94
- * — pure given those, so it's unit-testable with a fake graph.
111
+ * - pure given those, so it's unit-testable with a fake graph.
95
112
  */
96
113
  export declare function walkServerOnlyChain(routeFile: string, routeContent: string, resolve: ModuleResolver, read: ModuleReader): readonly string[] | undefined;
97
114
  /**
98
115
  * Resolve the FULL transitive server-only chain(s) for a route module, given a real fs-backed resolver +
99
116
  * reader. For each of the route's top-level imports, if a precise transitive walk finds a sink, the
100
- * finding carries the full chain; otherwise — when the first hop is itself a direct by-name sink the
101
- * regex scan already flags, or when a relative import can't be resolved — it falls back to the DIRECT
117
+ * finding carries the full chain; otherwise - when the first hop is itself a direct by-name sink the
118
+ * regex scan already flags, or when a relative import can't be resolved - it falls back to the DIRECT
102
119
  * edge (`fallback: true`), never a fabricated chain. Returns one finding per offending top-level import,
103
120
  * de-duplicated to the shortest chain per first-hop specifier. Non-route files yield `[]`.
104
121
  */
@@ -112,7 +129,7 @@ export declare function scanProject(cwd: string): Promise<SourceFinding[]>;
112
129
  export interface ManifestDriftFinding {
113
130
  /** The committed server-manifest file (relative to cwd). */
114
131
  readonly file: string;
115
- /** Route files in `routes/` missing from the manifest (stale manifest — these routes won't serve). */
132
+ /** Route files in `routes/` missing from the manifest (stale manifest - these routes won't serve). */
116
133
  readonly missing: readonly string[];
117
134
  /** Route files the manifest imports that no longer exist in `routes/` (a dangling import). */
118
135
  readonly extra: readonly string[];
@@ -126,17 +143,17 @@ export interface ManifestDriftFinding {
126
143
  * a per-manifest miss (an unreadable routes dir is simply skipped).
127
144
  */
128
145
  export declare function scanServerManifestDrift(cwd: string): Promise<ManifestDriftFinding[]>;
129
- /** A single machine-readable check failure — the unit an agent (or CI) acts on. */
146
+ /** A single machine-readable check failure - the unit an agent (or CI) acts on. */
130
147
  export interface CheckDiagnostic {
131
- readonly rule: "typecheck" | "typed-client" | "untyped-client" | "server-only-import" | "response-route" | "undeclared-dependency" | "duplicate-install" | "server-manifest-drift" | "manifest-drift" | "capability-assurance" | "capability-config" | "check-config";
132
- /** `error` fails the gate (a real contract break); `warning` is advisory — surfaced to the agent but
148
+ readonly rule: "typecheck" | "typed-client" | "untyped-client" | "server-only-import" | "removed-import" | "interpolated-sql" | "response-route" | "undeclared-dependency" | "duplicate-install" | "server-manifest-drift" | "manifest-drift" | "capability-assurance" | "capability-config" | "check-config";
149
+ /** `error` fails the gate (a real contract break); `warning` is advisory - surfaced to the agent but
133
150
  * does NOT fail `nifra check`, for patterns that are sometimes intentional (a route returning a raw
134
151
  * `Response`, which silently drops the typed client to `data: never` but is valid for files/redirects). */
135
152
  readonly severity: "error" | "warning";
136
153
  readonly file?: string;
137
154
  readonly line?: number;
138
155
  readonly message: string;
139
- /** The canonical, rule-level fix — clean of the per-occurrence snippet, so an agent can apply it
156
+ /** The canonical, rule-level fix - clean of the per-occurrence snippet, so an agent can apply it
140
157
  * directly. Set for the lint rules (they have one correct fix); omitted for `typecheck` (the fix is
141
158
  * specific to each type error). */
142
159
  readonly fix?: string;
@@ -147,12 +164,12 @@ export interface CheckDiagnostic {
147
164
  * The import chain that pulls server-only code into the browser bundle, as display labels
148
165
  * `[routeFile, …as-written specifiers…, sink]`. Set only on `server-only-import`.
149
166
  *
150
- * #4.4: this is now the FULL **transitive** chain — a bounded import-resolution walk (`Bun.resolveSync`
167
+ * #4.4: this is now the FULL **transitive** chain - a bounded import-resolution walk (`Bun.resolveSync`
151
168
  * from each file's dir, BFS the local module graph) follows `route → ../data → ../db → node:crypto`,
152
169
  * matching the build leak-guard's depth (`detectNodeBuiltinsInClient` in `@nifrajs/web/build`). A
153
170
  * length-2 chain (`[routeFile, specifier]`) means the route imports the sink directly. When a hop can't
154
171
  * be resolved precisely (a bare pkg, a tsconfig path alias), the walk degrades to the honest direct
155
- * edge rather than fabricating a deeper path — never a lie.
172
+ * edge rather than fabricating a deeper path - never a lie.
156
173
  */
157
174
  readonly chain?: readonly string[];
158
175
  }
@@ -164,7 +181,7 @@ export interface CheckSuggestion {
164
181
  readonly command?: readonly string[];
165
182
  readonly steps?: readonly string[];
166
183
  }
167
- /** The structured result of a full check — what `--json` prints and the `nifra_check` MCP tool returns. */
184
+ /** The structured result of a full check - what `--json` prints and the `nifra_check` MCP tool returns. */
168
185
  export interface CheckResult {
169
186
  readonly ok: boolean;
170
187
  readonly typecheck: "pass" | "fail" | "skipped";
@@ -173,7 +190,7 @@ export interface CheckResult {
173
190
  * better-auth). Echoed here so `--json` / the MCP tool / the report can show what the typed-client scan
174
191
  * deliberately skipped - a suppressed prefix stays auditable instead of silently hiding real drift. */
175
192
  readonly externalMounts?: readonly string[];
176
- /** Set only when the caller passed `maxDiagnostics` and there were more — `diagnostics` then holds the
193
+ /** Set only when the caller passed `maxDiagnostics` and there were more - `diagnostics` then holds the
177
194
  * first `shown` of `total`. It caps the serialized size so the `nifra_check` MCP tool can't emit a
178
195
  * message large enough to break the stdio transport; fix the shown diagnostics and re-run for the rest. */
179
196
  readonly truncated?: {
@@ -181,6 +198,24 @@ export interface CheckResult {
181
198
  readonly total: number;
182
199
  };
183
200
  }
201
+ /**
202
+ * Pre-resolved route-assurance inputs, so the same reflection that `nifra assure` / `nifra levels`
203
+ * already ran can feed `check`'s capability + trust-manifest diagnostics instead of a second pass.
204
+ * Supplied by {@link collectProjectVerification}. When omitted, `collectCheckResult` loads and computes
205
+ * these itself (the standalone `nifra_check` MCP path); the two routes produce byte-identical results.
206
+ */
207
+ export interface CheckAssuranceContext {
208
+ /** Whether `nifra.assurance.ts` exists: the gate for running the assurance-fed diagnostics at all. */
209
+ readonly present: boolean;
210
+ /** The loaded config, when it loaded. Absent when the file is missing or {@link error} is set. */
211
+ readonly config?: AssuranceConfig;
212
+ /** The failure from loading/evaluating the config, surfaced as a `capability-config` diagnostic. */
213
+ readonly error?: unknown;
214
+ /** `evaluateRouteAssurance` over the config's source + policy (drives the trust-manifest check). */
215
+ readonly routeAssurance?: AssuranceReport;
216
+ /** Static capability provenance, when the config declares a capabilities policy. */
217
+ readonly capability?: CapabilityProjectReport;
218
+ }
184
219
  /** Run the three checks and assemble a structured, machine-readable result. The single source the CLI
185
220
  * report, `--json`, and the MCP tool all render from. */
186
221
  export declare function collectCheckResult(cwd: string, opts?: {
@@ -189,6 +224,13 @@ export declare function collectCheckResult(cwd: string, opts?: {
189
224
  /** Cap the returned `diagnostics` to this many (adds {@link CheckResult.truncated}). The MCP tool sets
190
225
  * it so a huge project can't produce a transport-breaking result; the CLI leaves it unset (all shown). */
191
226
  readonly maxDiagnostics?: number;
227
+ /** How the interpolated-SQL rule gets its compiler. Injectable so the "not installed" path - the
228
+ * one where a security rule reports that it did not run - is testable on a machine that has it. */
229
+ readonly loadTypeScript?: () => Promise<TypeScriptApi | undefined>;
230
+ /** Route-assurance inputs already computed by {@link collectProjectVerification}. When present,
231
+ * the capability + trust-manifest diagnostics reuse them instead of loading/reflecting a second
232
+ * time; when absent, they are computed here (unchanged standalone behavior). */
233
+ readonly assurance?: CheckAssuranceContext;
192
234
  }): Promise<CheckResult>;
193
235
  /** Run the full check; print a report (`--json` for machine output) and return whether it passed. */
194
236
  export declare function runCheck(cwd: string, opts?: {
@@ -1 +1 @@
1
- {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AACD;6GAC6G;AAC7G,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,oGAAoG;IACpG,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAiCD,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AA6JD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAyCjD;AAED;;;8FAG8F;AAC9F,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAoCpD;AA8FD;;;;kBAIkB;AAClB,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,cAAc,GAAE,SAAS,MAAM,EAAO,GACrC,aAAa,EAAE,CAkBjB;AAED,mGAAmG;AACnG,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAOvF;AAQD,kFAAkF;AAClF,wB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