/** * `weft codegen` subcommand executor. Reads a registry snapshot from * either a live Weft server or a vendored JSON file, validates the * envelope, and emits a deterministic `.d.ts` augmenting the public * `'weft'` module. * * All user-caused failures (missing file, bad JSON, version mismatch, * HTTP errors, network timeout, missing parent directory, filesystem * errors) return a {@link CommandOutput} with `exitCode: 1` and a * single-line stderr diagnostic. Thrown errors are reserved for * programmer bugs. * * @module cli/codegen */ import type { CommandOutput } from './types.ts'; /** Parsed options accepted by {@link executeCodegen}. */ export type CodegenOptions = { server?: string; from?: string; token?: string; out: string; timeoutMs: number; /** When true, emit a single JSON object on stdout for machine consumers. */ json?: boolean; }; /** * Run the codegen pipeline end-to-end. Returns a {@link CommandOutput} * describing the result. Never rejects for user-caused failures. */ export declare function executeCodegen(options: CodegenOptions): Promise; /** * Compose the registry URL from a user-supplied base. Appends * `/api/v1/registry` to whatever path is present, so * `--server http://host/base` reaches `http://host/base/api/v1/registry`. * If the supplied URL already ends with `/api/v1/registry` (with or * without a trailing slash), the path is preserved as-is. */ export declare function composeRegistryUrl(serverUrl: string): URL;