/** * Shared bounds and internal transport for cold-start / dev launch arguments. * * Two producers feed `MainContext.launch`: the native launcher in packaged * builds (via `MainRuntimeOptions.launch`) and the `murasaki dev -- ` * CLI in development (via the env transport below). Both funnel through * {@link sanitizeLaunchArgv} so identical, defensive bounds apply everywhere. */ /** Maximum launch argv entries retained; extras beyond this are dropped. */ export declare const MAX_LAUNCH_ARGS = 64; /** Maximum UTF-8 bytes per launch argv entry; oversized entries are dropped. */ export declare const MAX_LAUNCH_ARG_BYTES = 8192; /** Maximum UTF-8 bytes of the encoded argv JSON array retained. */ export declare const MAX_LAUNCH_TOTAL_BYTES: number; /** * Internal env var carrying the `murasaki dev` app-argument suffix from the CLI * parent into the spawned Vite dev child. Private transport, not a public * contract. It lives in the env namespace (never the child's argv) so a * forwarded app flag such as `--port` cannot collide with the dev server's own * `--port`, and it is consumed and DELETED (see {@link consumeDevLaunchArgv}) * before any app-owned sidecar — which inherits `process.env` — can spawn. This * mirrors the packaged one-shot launch-file transport in * assets/prod-server.mjs. */ export declare const DEV_LAUNCH_ENV = "MURASAKI_DEV_LAUNCH"; /** Immutable cold-start launch snapshot shared by every runtime in a process. */ export interface LaunchSnapshot { readonly argv: readonly string[]; readonly cwd: string; } /** Drops non-strings and oversized entries, then caps the retained count. */ export declare function sanitizeLaunchArgv(rawArgv: unknown): string[]; /** * Extracts the app-argument suffix from a `murasaki dev` CLI argument list: * everything after the FIRST standalone `--` delimiter, sanitized. CLI flags * before the delimiter (dev's own options) never leak. Returns `[]` when no * `--` is present. */ export declare function parseDevAppArgv(cliArgv: readonly string[]): string[]; /** * Encodes a sanitized argv suffix for the internal env transport. Returns `''` * when the suffix is empty so the caller can omit the env var entirely and keep * plain `murasaki dev`'s empty-launch behavior. */ export declare function encodeDevLaunchArgv(argv: readonly string[]): string; /** * Reads, bounds, and DELETES the dev launch transport from `env` (default * `process.env`). Deleting on the same read guarantees the value is gone before * app-owned sidecars — which inherit `process.env` — can spawn. Malformed, * missing, or oversized payloads yield `[]`. */ export declare function consumeDevLaunchArgv(env?: NodeJS.ProcessEnv): string[]; //# sourceMappingURL=launch.d.ts.map