export type ParamType = 'string' | 'number' | 'boolean' | 'json' | 'string[]';
export type ParamKind = 'doc' | 'flag' | 'jsonFlag';
export interface OperationParamSpec {
    readonly name: string;
    readonly kind: ParamKind;
    readonly flag?: string;
    readonly type: ParamType;
    readonly required?: boolean;
}
export interface OperationSpec {
    readonly operationId: string;
    readonly commandTokens: readonly string[];
    readonly params: readonly OperationParamSpec[];
}
export interface InvokeOptions {
    timeoutMs?: number;
    stdinBytes?: Uint8Array;
}
/**
 * Minimal invoke interface that both SuperDocRuntime and BoundRuntime satisfy.
 * Generated code depends on this interface, not on the concrete runtime class.
 */
export interface RuntimeInvoker {
    invoke<TData = unknown>(operation: OperationSpec, params?: Record<string, unknown>, options?: InvokeOptions): Promise<TData>;
}
export type ChangeMode = 'direct' | 'tracked';
export interface UserIdentity {
    name: string;
    email?: string;
}
export interface SuperDocClientOptions {
    env?: Record<string, string | undefined>;
    startupTimeoutMs?: number;
    shutdownTimeoutMs?: number;
    /**
     * Upper bound (ms) on how long the host process may spend on a single
     * `cli.invoke` request before it kills the operation and returns a
     * `RequestTimeout` error. Propagated to the host via `--request-timeout-ms`
     * at spawn. Raise this for documents that legitimately need more than 30s
     * to process; the SDK widens its own JSON-RPC watchdog to match.
     *
     * Defaults to the host's own default (30s) when unset.
     */
    requestTimeoutMs?: number;
    /**
     * JS-side watchdog (ms) the SDK waits for a host reply before giving up.
     * Independent of {@link requestTimeoutMs} (which controls the host-side
     * operation budget). Most callers should leave this at its default and use
     * {@link requestTimeoutMs} as the single operation-timeout knob —
     * `resolveWatchdogTimeout` already widens the watchdog above the host
     * ceiling automatically. Override only when you need to detect a hung or
     * crashed host faster than the operation budget allows.
     */
    watchdogTimeoutMs?: number;
    maxQueueDepth?: number;
    defaultChangeMode?: ChangeMode;
    user?: UserIdentity;
}
export interface CliInvocation {
    command: string;
    prefixArgs: string[];
}
export declare function resolveInvocation(cliBin: string): CliInvocation;
/**
 * Build the CLI argument vector for an operation invocation.
 *
 * Key design choices vs old SDK:
 * - changeMode injection BEFORE argv loop, not after. changeMode is already a
 *   param in operationSpec.params (envelope param for mutations). Appending after
 *   the loop would duplicate it.
 * - Booleans encoded as `--flag true`/`--flag false` explicitly, matching current CLI.
 */
export declare function buildOperationArgv(operation: OperationSpec, params: Record<string, unknown>, options: InvokeOptions, runtimeTimeoutMs: number | undefined, defaultChangeMode?: ChangeMode, user?: UserIdentity): string[];
//# sourceMappingURL=transport-common.d.ts.map