import { DiscoveryError } from "../../errors.js"; import type { DiscoveredComponent } from "../discover.js"; /** * chant #1051 — imports every discovered `*.component.ts` file for a build * TOGETHER, as one bundled module graph, inside one sandboxed child process, * and returns the same shape `discoverComponents`'s own in-process import * loop would have produced: named components plus any errors. * * Isolation mechanics are identical to `../../discovery/sandbox/run.ts`'s * `runFallbackFilesSandboxed` (chant #1045 Phase 2 — see that module's doc * for the full write-up, verified on Node v24.13.1): `--permission * --allow-fs-read=,[,]`, a spawn-time-scrubbed `env`, and a bounded wait before the child * is treated as hung. `bundleDriver` (`../../discovery/sandbox/bundle.ts`) is * reused as-is — it is generic over what the driver does, so the same * esbuild bundling (and the same `typescript`-stays-external carve-out) that * serves the entity path serves this one too. */ export interface ComponentSandboxRunResult { /** Discovered components from this sandboxed import, keyed by `component.name` — functionally indistinguishable from what `discoverComponents`'s in-process path would have produced for this same file set. */ components: Map; /** Import/collection/permission errors, already chant-shaped (`../../discovery/sandbox/child-errors.ts` — a permission denial names the file and the operation, never a raw `ERR_ACCESS_DENIED`). */ errors: DiscoveryError[]; /** esbuild bundling wall-clock time. */ bundleMs: number; /** Bundle size in bytes. */ bundleBytes: number; } /** * Import `files` (every discovered `*.component.ts` file) together, isolated, * in one sandboxed child process, and collect their `Component`-shaped * exports — including the duplicate-name check, which runs INSIDE the child * over live objects before anything is serialized (`../discover.ts`'s * `collectComponents`, bundled into the driver). * * @param files - Absolute paths to every discovered `*.component.ts` file. * @param buildRoot - The directory `discoverComponents` was pointed at — used * to compute the project-directory read allowance, mirroring `../../ * discovery/sandbox/run.ts`. */ export declare function discoverComponentsSandboxed(files: readonly string[], buildRoot: string): Promise; //# sourceMappingURL=run.d.ts.map