@aihu/compiler 1.2.0 → 1.3.1

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.
package/README.md CHANGED
@@ -21,7 +21,7 @@ npm install @aihu/compiler
21
21
  bun add @aihu/compiler
22
22
  ```
23
23
 
24
- <sub><i>Auto-generated against `@aihu/compiler@1.2.0`.</i></sub>
24
+ <sub><i>Auto-generated against `@aihu/compiler@1.3.0`.</i></sub>
25
25
 
26
26
  <!-- END_AUTOGEN: install -->
27
27
 
@@ -32,12 +32,12 @@ bun add @aihu/compiler
32
32
 
33
33
  | | |
34
34
  |---|---|
35
- | **Version** | `1.2.0` |
35
+ | **Version** | `1.3.0` |
36
36
  | **Tier** | D — Compiler — Single-File Component (.aihu) → Web Component |
37
37
  | **Published files** | 4 entries |
38
38
  | **License** | MIT |
39
39
 
40
- <sub><i>Auto-generated against `@aihu/compiler@1.2.0`.</i></sub>
40
+ <sub><i>Auto-generated against `@aihu/compiler@1.3.0`.</i></sub>
41
41
 
42
42
  <!-- END_AUTOGEN: stats -->
43
43
 
@@ -50,7 +50,7 @@ bun add @aihu/compiler
50
50
  |---|---|---|
51
51
  | `.` | `./dist/index.js` | `—` |
52
52
 
53
- <sub><i>Auto-generated against `@aihu/compiler@1.2.0`.</i></sub>
53
+ <sub><i>Auto-generated against `@aihu/compiler@1.3.0`.</i></sub>
54
54
 
55
55
  <!-- END_AUTOGEN: exports -->
56
56
 
@@ -65,18 +65,18 @@ bun add @aihu/compiler
65
65
 
66
66
  **Optional dependencies (platform-specific):**
67
67
 
68
- - `@aihu/compiler-darwin-arm64` — `0.1.50`
69
- - `@aihu/compiler-darwin-x64` — `0.1.50`
70
- - `@aihu/compiler-linux-x64-gnu` — `0.1.50`
71
- - `@aihu/compiler-linux-arm64-gnu` — `0.1.50`
72
- - `@aihu/compiler-win32-x64-msvc` — `0.1.50`
73
- - `@aihu/compiler-native-darwin-arm64` — `0.1.15`
74
- - `@aihu/compiler-native-darwin-x64` — `0.1.15`
75
- - `@aihu/compiler-native-linux-x64-gnu` — `0.1.15`
76
- - `@aihu/compiler-native-linux-arm64-gnu` — `0.1.15`
77
- - `@aihu/compiler-native-win32-x64-msvc` — `0.1.15`
68
+ - `@aihu/compiler-darwin-arm64` — `1.3.0`
69
+ - `@aihu/compiler-darwin-x64` — `1.3.0`
70
+ - `@aihu/compiler-linux-x64-gnu` — `1.3.0`
71
+ - `@aihu/compiler-linux-arm64-gnu` — `1.3.0`
72
+ - `@aihu/compiler-win32-x64-msvc` — `1.3.0`
73
+ - `@aihu/compiler-native-darwin-arm64` — `1.3.0`
74
+ - `@aihu/compiler-native-darwin-x64` — `1.3.0`
75
+ - `@aihu/compiler-native-linux-x64-gnu` — `1.3.0`
76
+ - `@aihu/compiler-native-linux-arm64-gnu` — `1.3.0`
77
+ - `@aihu/compiler-native-win32-x64-msvc` — `1.3.0`
78
78
 
79
- <sub><i>Auto-generated against `@aihu/compiler@1.2.0`.</i></sub>
79
+ <sub><i>Auto-generated against `@aihu/compiler@1.3.0`.</i></sub>
80
80
 
81
81
  <!-- END_AUTOGEN: deps -->
82
82
 
@@ -90,7 +90,7 @@ bun add @aihu/compiler
90
90
  - [Macro Vocabulary spec](../../docs/superpowers/specs/2026-05-02-spec-macro-vocabulary.md)
91
91
  - [Aihu framework root](../../README.md)
92
92
 
93
- <sub><i>Auto-generated against `@aihu/compiler@1.2.0`.</i></sub>
93
+ <sub><i>Auto-generated against `@aihu/compiler@1.3.0`.</i></sub>
94
94
 
95
95
  <!-- END_AUTOGEN: see-also -->
96
96
 
@@ -101,6 +101,6 @@ bun add @aihu/compiler
101
101
 
102
102
  MIT — see [LICENSE](../../LICENSE).
103
103
 
104
- <sub><i>Auto-generated against `@aihu/compiler@1.2.0`.</i></sub>
104
+ <sub><i>Auto-generated against `@aihu/compiler@1.3.0`.</i></sub>
105
105
 
106
106
  <!-- END_AUTOGEN: license -->
package/dist/index.d.ts CHANGED
@@ -1,36 +1,87 @@
1
- //#region js/envelope.d.ts
1
+ //#region js/native.d.ts
2
+ /**
3
+ * @aihu/compiler native-addon loader — the in-process compile fast path.
4
+ *
5
+ * A `native.ts`-style loader in the mold of packages/server/src/native.ts:
6
+ * platform matrix → per-platform optionalDependency package → dev fallback,
7
+ * with explicit escape hatches and a cached three-state result. The addon
8
+ * (packages/compiler/src-native, napi-rs) exposes
9
+ * `compileEnvelope(source, optionsJson) → envelopeJson` — one boundary
10
+ * crossing per file — which `js/envelope.ts` routes `transform()` /
11
+ * `compileToAst()` / `compileRouteMeta()` through.
12
+ *
13
+ * States:
14
+ * - loaded: addon required successfully; compiles run in-process.
15
+ * - disabled: `AIHU_COMPILER_NATIVE=0` — the documented escape hatch.
16
+ * - unavailable: no addon for this platform / load failed. UNLIKE
17
+ * @aihu/server's fail-loud contract, a failed load here is a
18
+ * one-shot WARNING, not a throw: the CLI spawn path is a
19
+ * byte-identical fallback that always exists, so failing the
20
+ * whole build over a fast-path load would be strictly worse.
21
+ * The exception is `AIHU_COMPILER_NATIVE_ADDON=<path>` — an
22
+ * explicit override that fails loud (same doctrine as
23
+ * AIHU_COMPILE_BIN: a pinned path that doesn't load is a
24
+ * configuration error, and silently ignoring it hands back a
25
+ * plausible-looking wrong backend).
26
+ */
27
+ interface CompilerNativeAddon {
28
+ compileEnvelope(source: string, optionsJson: string): string;
29
+ /**
30
+ * The version string baked into the addon at build time. Present since
31
+ * @aihu/compiler-native 0.1.x; ABSENT on older addons, which is why every
32
+ * consumer must treat a missing method as "unknown/incompatible" rather
33
+ * than assuming it is there (see envelope.ts's version handshake).
34
+ */
35
+ compilerVersion?(): string;
36
+ }
37
+ /**
38
+ * Where a loaded addon came from. This decides whether the version handshake
39
+ * in envelope.ts can say anything meaningful about it:
40
+ *
41
+ * - `package` — a published per-platform optionalDependency. Its release
42
+ * version is knowable (`packageVersion`) and is exactly the
43
+ * thing `packages/compiler/package.json` pins, so it CAN be
44
+ * compared against the pin.
45
+ * - `dev-build` — `src-native/aihu-compiler-native.node`, produced by
46
+ * `scripts/build-native.ts` from THIS source tree. It has no
47
+ * release version at all; it is trusted by construction.
48
+ * - `override` — `AIHU_COMPILER_NATIVE_ADDON=<path>`. Gated like `package`
49
+ * when the pinned file turns out to live inside a published
50
+ * platform package, trusted like `dev-build` otherwise.
51
+ */
52
+ type CompilerNativeOrigin = 'package' | 'dev-build' | 'override';
53
+ type CompilerNativeState = {
54
+ kind: 'loaded';
55
+ addon: CompilerNativeAddon;
56
+ addonPath: string;
57
+ origin: CompilerNativeOrigin;
58
+ /**
59
+ * The `version` of the published per-platform package the addon was
60
+ * loaded from, or `null` when the addon did not come from one (a local
61
+ * cargo build). NOT the crate version reported by `compilerVersion()`:
62
+ * `src-native/Cargo.toml` is pinned at 0.1.0 and never bumped per
63
+ * release, so `CARGO_PKG_VERSION` cannot identify a release. The npm
64
+ * package version can, and it is what the pin in
65
+ * `packages/compiler/package.json` is expressed in.
66
+ */
67
+ packageVersion: string | null;
68
+ } | {
69
+ kind: 'disabled';
70
+ } | {
71
+ kind: 'unavailable';
72
+ error?: Error;
73
+ };
2
74
  /**
3
- * envelope.ts backend dispatch for the single-parse envelope compile.
4
- *
5
- * Every compile request (`transform` / `compileToAst` / `compileRouteMeta`)
6
- * routes memo-first, then through ONE of three backends, in order:
7
- *
8
- * 1. **native addon** (packages/compiler/src-native, napi) — in-process,
9
- * zero spawn. Selected once per process by `_resolveCompileBackend()`.
10
- * 2. **envelope CLI spawn** — the legacy `aihu-compile` spawn args PLUS
11
- * `--envelope <options-json>`. A binary that knows the flag answers with
12
- * one JSON envelope (single parse, every requested artifact); the JSON
13
- * carries the `"envelope": 1` discriminant.
14
- * 3. **legacy per-output spawn** — an OLDER binary ignores `--envelope`
15
- * and answers with its normal single artifact (JS / AST JSON / route
16
- * JSON), which the discriminant check detects. That output is used
17
- * as-is, so stale binaries keep exactly their historical behavior —
18
- * feature detection costs zero extra spawns.
19
- *
20
- * Backend selection is CACHED at first use (per module instance):
21
- * `AIHU_COMPILER_NATIVE=0` forces spawn; an explicit `AIHU_COMPILE_BIN`
22
- * binary pin forces spawn (working ON the compiler means
23
- * the pinned binary must actually run — an addon silently shadowing it would
24
- * reintroduce the exact quiet-wrong-answer failure the pin exists to prevent).
25
- * The cache means css-engine's mid-build `AIHU_COMPILE_BIN` handshake
26
- * (which programmatically sets the var AFTER the first transform) cannot
27
- * de-select an already-active native backend.
28
- *
29
- * The memo's "binary stamp" (transform-memo.ts `_binStamp`) generalizes to
30
- * whichever backend is active: the addon's `.node` file path (stat'd for
31
- * mtime+size, so a rebuilt addon invalidates entries) when native, the
32
- * resolved CLI binary path when spawning.
75
+ * Resolve (and cache) the native compiler addon. This is the ONLY module in
76
+ * @aihu/compiler that requires a napi `.node` file.
33
77
  */
78
+ declare function loadCompilerNative(): CompilerNativeState;
79
+ /** Returns the cached state kind (resolving if needed). @internal */
80
+ declare function _getCompilerNativeStateKind(): CompilerNativeState['kind'];
81
+ /** Reset the cached state. Used by tests that mock detection/env. @internal */
82
+ declare function _resetCompilerNative(): void;
83
+ //#endregion
84
+ //#region js/envelope.d.ts
34
85
  /** The wire shape of a compile envelope (Rust `Envelope`, camelCase). */
35
86
  interface CompileEnvelope {
36
87
  envelope: number;
@@ -87,56 +138,6 @@ type EnvelopeReply = {
87
138
  */
88
139
  declare function _compileViaBackend(source: string, legacyArgs: string[], options: CompileEnvelopeOptions): EnvelopeReply;
89
140
  //#endregion
90
- //#region js/native.d.ts
91
- /**
92
- * @aihu/compiler native-addon loader — the in-process compile fast path.
93
- *
94
- * A `native.ts`-style loader in the mold of packages/server/src/native.ts:
95
- * platform matrix → per-platform optionalDependency package → dev fallback,
96
- * with explicit escape hatches and a cached three-state result. The addon
97
- * (packages/compiler/src-native, napi-rs) exposes
98
- * `compileEnvelope(source, optionsJson) → envelopeJson` — one boundary
99
- * crossing per file — which `js/envelope.ts` routes `transform()` /
100
- * `compileToAst()` / `compileRouteMeta()` through.
101
- *
102
- * States:
103
- * - loaded: addon required successfully; compiles run in-process.
104
- * - disabled: `AIHU_COMPILER_NATIVE=0` — the documented escape hatch.
105
- * - unavailable: no addon for this platform / load failed. UNLIKE
106
- * @aihu/server's fail-loud contract, a failed load here is a
107
- * one-shot WARNING, not a throw: the CLI spawn path is a
108
- * byte-identical fallback that always exists, so failing the
109
- * whole build over a fast-path load would be strictly worse.
110
- * The exception is `AIHU_COMPILER_NATIVE_ADDON=<path>` — an
111
- * explicit override that fails loud (same doctrine as
112
- * AIHU_COMPILE_BIN: a pinned path that doesn't load is a
113
- * configuration error, and silently ignoring it hands back a
114
- * plausible-looking wrong backend).
115
- */
116
- interface CompilerNativeAddon {
117
- compileEnvelope(source: string, optionsJson: string): string;
118
- compilerVersion(): string;
119
- }
120
- type CompilerNativeState = {
121
- kind: 'loaded';
122
- addon: CompilerNativeAddon;
123
- addonPath: string;
124
- } | {
125
- kind: 'disabled';
126
- } | {
127
- kind: 'unavailable';
128
- error?: Error;
129
- };
130
- /**
131
- * Resolve (and cache) the native compiler addon. This is the ONLY module in
132
- * @aihu/compiler that requires a napi `.node` file.
133
- */
134
- declare function loadCompilerNative(): CompilerNativeState;
135
- /** Returns the cached state kind (resolving if needed). @internal */
136
- declare function _getCompilerNativeStateKind(): CompilerNativeState['kind'];
137
- /** Reset the cached state. Used by tests that mock detection/env. @internal */
138
- declare function _resetCompilerNative(): void;
139
- //#endregion
140
141
  //#region js/transform-memo.d.ts
141
142
  /**
142
143
  * FIFO size bound. 1024 entries × a few KB of compiled output ≈ a few MB —
@@ -230,21 +231,42 @@ interface AihuCompilerPluginOptions {
230
231
  layoutsDir?: string;
231
232
  }
232
233
  /**
233
- * Inject `{ shadowMode: '...' }` (and, for light mode, `lightScopeId: '...'`
234
- * in the SAME options object) as the third argument to the emitted
235
- * `defineElement('tag', defineComponent(...))` call. The compiler emits
236
- * exactly two arguments today; this rewrites the closing of the
237
- * defineElement call to include the options object. Idempotent leaves
238
- * code untouched when the closer is not in the expected shape.
239
- *
240
- * `lightScopeId` is folded into this SAME regex operation rather than a
241
- * second independent injection pass, deliberately: it is only ever set when
242
- * `mode === 'light'` (see the call site, `index.ts`'s `transform` hook), so
243
- * every call that needs it ALSO needs a shadowMode injection at the exact
244
- * same spot a second pass would just re-match (and fight) the text this
245
- * one already rewrote. Stamps `data-a` on the root element at runtime
246
- * (light-DOM leaf flip, LDF §10 step 3) `packages/runtime/src/
247
- * define-element.ts`'s `wrapClass` reads `options.lightScopeId`.
234
+ * Inject `shadowMode: '...'` (and, for light mode, `lightScopeId: '...'` in
235
+ * the SAME options object) into the third argument of the emitted
236
+ * `defineElement('tag', defineComponent(...))` call appending the options
237
+ * object when the call has two arguments, or merging the fields into an
238
+ * existing third argument (`$form` emits `, { formAssociated: true }`).
239
+ * Idempotent — leaves code untouched when the call is not in a recognized
240
+ * shape or the options already carry a `shadowMode`.
241
+ *
242
+ * `lightScopeId` is folded into this SAME injection rather than a second
243
+ * independent pass, deliberately: it is only ever set when `mode === 'light'`
244
+ * (see the call site, `index.ts`'s `transform` hook), so every call that
245
+ * needs it ALSO needs a shadowMode injection at the exact same spot a
246
+ * second pass would just re-match (and fight) the text this one already
247
+ * rewrote. Stamps `data-a` on the root element at runtime (light-DOM leaf
248
+ * flip, LDF §10 step 3) — `packages/runtime/src/define-element.ts`'s
249
+ * `wrapClass` reads `options.lightScopeId`.
250
+ *
251
+ * History, because this anchor has now been wrong twice:
252
+ *
253
+ * 1. The original regex anchor (`defineComponent\([^]*\)\s*\)` — greedy, and
254
+ * `[^]` crosses newlines) ran past `defineElement` and matched the LAST
255
+ * `)\s*)` pair in the module. On a SERVER-target module the string
256
+ * renderer (`__ssrString`) is emitted AFTER the registration, so for any
257
+ * component with an `if=` the last such pair is the emitted condition,
258
+ * which became `if ((n() > 5), { shadowMode: 'light', … })` — the comma
259
+ * operator, always truthy, so a dead branch rendered (the SSR-child
260
+ * review's 33-nested-hosts measurement). Same corruption landed inside
261
+ * `__aihu_stext(...)` calls (a `(` in text content) and, on ALL targets,
262
+ * inside `$form`'s `setFormValue(...)`. The repro was missed at first
263
+ * because the probe regex `/if \([^)]*shadowMode/` cannot cross the `)`
264
+ * in `(n() > 5)` — evidence in light-scope-export.test.ts.
265
+ *
266
+ * 2. The first replacement — a bare balanced-paren count — read parens inside
267
+ * string literals (`leaf('(')`), drifted, and silently bailed on
268
+ * client/universal modules, stripping the injection those components need.
269
+ * Hence `_matchParen`'s lexer, and the tests that pin every shape above.
248
270
  *
249
271
  * @internal
250
272
  */
@@ -306,6 +328,153 @@ declare function _globalizeAuthoredStyle(code: string): string;
306
328
  * @internal
307
329
  */
308
330
  declare function _parseIslandMarker(compiledCode: string): 'static' | 'interactive';
331
+ /** Best-effort message text for an unknown thrown value. @internal */
332
+ declare function _errMessage(err: unknown): string;
333
+ /**
334
+ * Is this `import('vite')` rejection the ONE legitimate "there is no Vite here"
335
+ * case — a standalone `transform()` caller, a unit test, any non-Vite host?
336
+ *
337
+ * The distinction matters because the two outcomes are opposites: "no Vite"
338
+ * must hand the TypeScript back untouched (the caller owns it and never asked
339
+ * for a strip), while "Vite is here and something broke" must throw, because
340
+ * un-stripped TypeScript returned into a Vite build is silent corruption that
341
+ * only surfaces as an unrelated bundler `PARSE_ERROR` much later.
342
+ *
343
+ * The test is deliberately narrow: a module-resolution failure whose subject is
344
+ * the `vite` specifier itself. Both Node and Bun report `ERR_MODULE_NOT_FOUND`
345
+ * with a message naming the package (`Cannot find package 'vite' …`). A
346
+ * resolution failure for something else — a broken transitive dependency of an
347
+ * installed Vite, say — is NOT this case: Vite is present, the strip is
348
+ * expected, and swallowing it would be the same silent corruption. So it is
349
+ * loud.
350
+ *
351
+ * @internal
352
+ */
353
+ declare function _isViteMissing(err: unknown): boolean;
354
+ /**
355
+ * The message for a strip that failed with Vite present — names the branch, the
356
+ * Vite version, the environment and the file, and says why it is fatal rather
357
+ * than swallowed.
358
+ *
359
+ * @internal
360
+ */
361
+ declare function _stripFailure(fn: 'transformWithOxc' | 'transformWithEsbuild', id: string, viteVersion: string, isServerEnv: boolean, err: unknown): string;
362
+ /** What the Vite plugin's `transform` hook hands back after the strip. */
363
+ interface StripTypesResult {
364
+ readonly code: string;
365
+ readonly map: null;
366
+ /** Rolldown-only hint; set ONLY on the last-resort no-transform branch. */
367
+ readonly moduleType?: 'ts';
368
+ }
369
+ /**
370
+ * The subset of the Vite module `_stripTypes` uses — the seam tests fake.
371
+ *
372
+ * The trailing parameters are `any` on purpose: Vite's real signatures carry
373
+ * version-specific option/config/watcher types (and MORE parameters on some
374
+ * versions), and a narrower type here would make the genuine module fail to
375
+ * satisfy the interface. Only the first two parameters and `code` on the result
376
+ * are actually depended on.
377
+ */
378
+ interface ViteStripApi {
379
+ readonly version?: string;
380
+ readonly transformWithOxc?: (code: string, id: string, ...rest: any[]) => Promise<{
381
+ code: string;
382
+ }>;
383
+ readonly transformWithEsbuild?: (code: string, id: string, ...rest: any[]) => Promise<{
384
+ code: string;
385
+ }>;
386
+ }
387
+ /**
388
+ * Strip TypeScript from compiler output using whichever transform the resolved
389
+ * Vite exposes. Takes the Vite module as a PARAMETER so the branch order and
390
+ * the failure behaviour are testable without installing four Vite versions.
391
+ *
392
+ * Branch order, and why:
393
+ *
394
+ * 1. `transformWithOxc` — Vite's own transform, needing NO separate esbuild.
395
+ * Vite 8 made esbuild an OPTIONAL PEER while still *exporting* a
396
+ * `transformWithEsbuild` that throws "It is deprecated and it now requires
397
+ * esbuild to be installed separately … migrate to `transformWithOxc`" the
398
+ * moment it is called. So this branch is deliberately NOT gated on the
399
+ * environment: a fresh consumer install at vite 8 has no esbuild at all, and
400
+ * the esbuild branch would throw on the CLIENT build — which every output
401
+ * mode (`spa`, `static`, `ssr`) runs.
402
+ * 2. `transformWithEsbuild` — vite 6 and 5, where `transformWithOxc` does not
403
+ * exist (`'transformWithOxc' in vite` is literally false on 6.4.3), so those
404
+ * versions keep taking this branch and their output is unchanged.
405
+ * 3. Neither — hand the TypeScript to Rolldown with `moduleType: 'ts'`. A
406
+ * forward-compatibility escape hatch for a Vite that drops both.
407
+ *
408
+ * Preferring oxc on vite 8 is a DELIBERATE behaviour change, not a refactor:
409
+ * oxc lowers class fields with `useDefineForClassFields: true` (the modern-TS
410
+ * default) where esbuild used `false`, lowers enums to a different (equivalent)
411
+ * IIFE shape, and does not constant-inline enum member reads. Invisible for
412
+ * compiler-generated code, observable for user-authored classes in an `.aihu`
413
+ * script block. Pinned by `tests/strip-branch.test.ts`.
414
+ *
415
+ * Failures here are LOUD. Both call sites are individually wrapped so the
416
+ * thrown error names the branch, the Vite version, the environment and the
417
+ * file. The alternative — the swallowing `catch` this replaced — returned
418
+ * un-stripped TypeScript that only surfaced as an unrelated `PARSE_ERROR` from
419
+ * the bundler two hundred lines of build output later.
420
+ *
421
+ * @internal
422
+ */
423
+ declare function _stripTypes(vite: ViteStripApi, code: string, id: string, isServerEnv: boolean): Promise<StripTypesResult>;
424
+ /**
425
+ * §22 — parse the `// @aihu:component-tags a,b,c` marker the Rust codegen emits
426
+ * for every server/universal build, on the same channel as `@aihu:island` above.
427
+ *
428
+ * The list comes from `collect_component_tags` — the SAME walk that fills
429
+ * `route.json`'s `components` array — so it is already sorted, de-duplicated and
430
+ * kebab-normalized when it arrives here. Deliberately NOT re-sorted or
431
+ * re-de-duplicated: a second normalization would be a second place the rule
432
+ * lives, and the two would drift.
433
+ *
434
+ * Distinct from the `__aihu_child_tags__` derivation below: this is "tags the
435
+ * template references AT ALL", not "tags the compiled renderer will look up".
436
+ * See the comment on the `__aihu_referenced_tags__` export for why both exist.
437
+ *
438
+ * Returns `[]` when the marker is absent (an older binary, a client-target
439
+ * compile, a future emit shape) — the caller treats that identically to "the
440
+ * template references nothing".
441
+ *
442
+ * @internal
443
+ */
444
+ declare function _parseComponentTagsMarker(compiledCode: string): string[];
445
+ /**
446
+ * Derive the `__aihu_child_tags__` set from SERVER-TARGET compiled code: the
447
+ * tags the compiled string renderer will actually look up, read off the
448
+ * `__aihu_schild('<tag>'` call sites the Rust codegen emitted. Deduped, sorted.
449
+ *
450
+ * THE one derivation, deliberately. There are two consumers:
451
+ *
452
+ * 1. `aihuCompilerPlugin`'s transform, which turns the result into the
453
+ * `export const __aihu_child_tags__` a compiled module carries.
454
+ * 2. `@aihu/router`'s `genSC`, which needs the SAME edge set at CODEGEN
455
+ * time — before any module exists to read an export off — to walk from
456
+ * the pages out to the components the server bundle must actually carry.
457
+ *
458
+ * `genSC` reaching for this instead of re-deriving is the whole point. The
459
+ * `__aihu_referenced_tags__` docblock below spends a paragraph arguing that
460
+ * deriving the runtime edge set a second way would be "one rule written in two
461
+ * places, and the halves would drift the first time a boundary moved" — and
462
+ * that argument does not stop applying because the second site happens to live
463
+ * in another package. `readAihuLayoutComponents` (the source regex) is a THIRD,
464
+ * differently-defined set and is not a substitute: it counts references the
465
+ * emitter DECLINES (an attribute, children, a dynamic path), which produce no
466
+ * call site, so `__aihu_schild` can never look them up. Measured on a
467
+ * three-way fixture, it bundled a module whose rendered output was empty.
468
+ *
469
+ * Takes compiled code, not a source string: a caller with only source runs
470
+ * `transform(src, id, { target: 'server' }).code` first — which is memoized, so
471
+ * a file already compiled in this process costs a map lookup. Client- and
472
+ * universal-target output carries no `__aihu_schild` call sites at all and
473
+ * yields `[]`, which is correct: there is no server render to feed.
474
+ *
475
+ * @internal
476
+ */
477
+ declare function _deriveChildTags(compiledCode: string): string[];
309
478
  /**
310
479
  * GX Phase 1 (#437-GX) — parse the `// @aihu:extract read=<v> call=<v>` code
311
480
  * marker the Rust compiler emits for every server/universal build (the
@@ -365,6 +534,11 @@ declare function kebabComponentTag(raw: string): string;
365
534
  * Anchors on the exact `const createOutletBoundary = () => { … return host; };`
366
535
  * block the codegen emits (`packages/compiler/src/codegen/emit.rs`). No-op when
367
536
  * the layout declares no `<outlet>`.
537
+ *
538
+ * Shape B of the ReDoS note at the top of this file: the head is located with
539
+ * `indexOf` and the tail scanned once from there, instead of one regex whose
540
+ * lazy `[\s\S]*?` re-scanned the whole module at every repetition of the head
541
+ * literal.
368
542
  * @internal
369
543
  */
370
544
  declare function _passivizeOutlet(code: string): string;
@@ -437,49 +611,32 @@ declare function transform(source: string, id: string, options?: {
437
611
  map: null;
438
612
  };
439
613
  /**
440
- * Fold css-engine-produced scoped CSS into a compiled `.aihu` module.
441
- *
442
- * The Rust codegen emits the authored `@style` block (when present) as:
443
- *
444
- * const __style__ = new CSSStyleSheet();
445
- * __style__.replaceSync(`<authored css>`);
446
- * defineElement('tag', defineComponent((ctx) => {
447
- * (ctx.host as ShadowRoot).adoptedStyleSheets = [__style__];
448
- * return ...
449
- * }))
450
- *
451
- * css-engine's `compileSfc` output is the COMPLETE per-SFC stylesheet:
452
- * `:host` theme tokens, the variant-resolved utility-class rules, AND the
453
- * folded authored `@style` block (under an `authored @style` CSS comment).
454
- * So it is authoritative we adopt it as the single shadow `<style>` and
455
- * the authored `@style` keeps emitting through it (acceptance: "@style still
456
- * emits correctly alongside").
457
- *
458
- * Two shapes are handled:
459
- *
460
- * 1. **SFC has an `@style` block** — the Rust codegen already declared
461
- * `__style__` with the raw `@style` body. We REPLACE that body with the
462
- * css-engine output (which already CONTAINS the `@style` block) so the
463
- * `@style` rules are not duplicated. The existing `adoptedStyleSheets`
464
- * assignment is reused unchanged.
465
- *
466
- * 2. **SFC has NO `@style` block** — there is no `__style__`. We inject a
467
- * fresh `__style__` declaration after the last import and an
468
- * `adoptedStyleSheets` assignment as the first statement of the setup
469
- * function. The compiler emits the setup param as `_ctx` in this case;
470
- * we rename it to `ctx` so the injected `ctx.host` reference resolves.
471
- *
472
- * Runs on the RAW compiled output BEFORE the island / HMR / auto-wiring
473
- * transforms so those passes operate on the folded module uniformly:
474
- * - The static-island shim calls `__aihu_setup__({ host: root, ... })`
475
- * where `root` is the shadow root, so `ctx.host` is valid there too.
476
- * - The HMR / defer passes only touch the `defineElement(...)` wrapper and
477
- * the runtime import; they do not disturb `__style__` or the setup body.
478
- *
479
- * No-ops (returns input unchanged) when `css` is empty/whitespace.
480
- *
481
- * @internal
614
+ * Fold css-engine utility CSS into the SERVER target's `__aihu_css__` export.
615
+ *
616
+ * The shadow-DOM sibling of `_foldCssEngineStyles`. That one rewrites the
617
+ * client's `__style__.replaceSync(...)`; the server target has no `__style__`
618
+ * (`CSSStyleSheet` is a DOM dependency and the Rust codegen elides it), it has
619
+ * `export const __aihu_css__` — the string `__aihu_schild` inlines as `<style>`
620
+ * inside a declarative shadow template.
621
+ *
622
+ * Without this, that template shipped the authored `@style` block ALONE: no
623
+ * utility classes, no design tokens, no reset. A shadow child prerendered
624
+ * partially unstyled and repainted once its chunk loaded — precisely the #754
625
+ * failure the DSD `<style>` exists to prevent. (The step-4 scoping note claimed
626
+ * no css-engine work was needed. That was true of the Rust emitter, which
627
+ * applies no scoping transform, and wrong about the pipeline: the per-component
628
+ * utility CSS is folded HERE, in the JS layer, and the server target was simply
629
+ * never wired to it.)
630
+ *
631
+ * REPLACES rather than appends, for the same reason shape 1 above does: the
632
+ * css-engine output already contains the authored `@style` rules, so appending
633
+ * would duplicate them.
634
+ *
635
+ * Light-DOM components never reach this their utilities go through the global
636
+ * cascade via `_foldCssEngineStylesGlobal`, and their prerendered markup is
637
+ * covered by the app stylesheet's `@scope([data-a=…])` blocks.
482
638
  */
639
+ declare function _foldSsrCssExport(compiledCode: string, css: string): string;
483
640
  declare function _foldCssEngineStyles(compiledCode: string, css: string): string;
484
641
  /**
485
642
  * Virtual-module prefix used by the `shadowMode === 'light'` branch to route
@@ -739,5 +896,5 @@ declare function compileRouteMeta(source: string, id?: string): RouteMeta | null
739
896
  declare function _injectAutoWiring(code: string): string;
740
897
  declare function aihuCompilerPlugin(options?: AihuCompilerPluginOptions): VitePlugin;
741
898
  //#endregion
742
- export { AihuCompilerPluginOptions, type CompileEnvelope, type CompileEnvelopeOptions, RouteMeta, SfcAst, SfcAttr, SfcMacroValue, SfcMeta, SfcNode, SfcStyleBlock, VIRTUAL_UTILITY_PREFIX, _MEMO_MAX_ENTRIES, _buildDeferredHydration, _buildStaticIsland, _clearTransformMemo, _compileViaBackend, _foldCssEngineStyles, _foldCssEngineStylesGlobal, _formatExtractCensus, _getCompilerNativeStateKind, _globalizeAuthoredStyle, _hashIdForUtilityCss, _injectAutoWiring, _injectLightScopeId, _injectShadowMode, _isLayoutFile, _layoutTag, _lightScopeId, _parseExtractMarker, _parseIslandMarker, _passivizeOutlet, _resetCompileBackend, _resetCompilerNative, _resolveCompileBackend, _transformMemoStats, aihuCompilerPlugin, compileRouteMeta, compileSidecar, compileToAst, kebabComponentTag, loadCompilerNative, transform };
899
+ export { AihuCompilerPluginOptions, type CompileEnvelope, type CompileEnvelopeOptions, RouteMeta, SfcAst, SfcAttr, SfcMacroValue, SfcMeta, SfcNode, SfcStyleBlock, StripTypesResult, VIRTUAL_UTILITY_PREFIX, ViteStripApi, _MEMO_MAX_ENTRIES, _buildDeferredHydration, _buildStaticIsland, _clearTransformMemo, _compileViaBackend, _deriveChildTags, _errMessage, _foldCssEngineStyles, _foldCssEngineStylesGlobal, _foldSsrCssExport, _formatExtractCensus, _getCompilerNativeStateKind, _globalizeAuthoredStyle, _hashIdForUtilityCss, _injectAutoWiring, _injectLightScopeId, _injectShadowMode, _isLayoutFile, _isViteMissing, _layoutTag, _lightScopeId, _parseComponentTagsMarker, _parseExtractMarker, _parseIslandMarker, _passivizeOutlet, _resetCompileBackend, _resetCompilerNative, _resolveCompileBackend, _stripFailure, _stripTypes, _transformMemoStats, aihuCompilerPlugin, compileRouteMeta, compileSidecar, compileToAst, kebabComponentTag, loadCompilerNative, transform };
743
900
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../js/envelope.ts","../js/native.ts","../js/transform-memo.ts","../js/index.ts"],"mappings":";;AAsCA;;;;;;;;;;;;;;AASA;;;;;;;;;;;;;AASA;;;;;UAlBiB,eAAA;EACf,QAAA;EACA,OAAA,EAAS,MAAA;IAAiB,EAAA;IAAa,QAAA;EAAA;EACvC,OAAA;EACA,SAAA;EACA,WAAA;AAAA;;UAI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