/**
 * Shared params coercion + validation for `workflow run`.
 *
 * Used by:
 *   - IM `/workflow run <id> key=value …`  (key=value strings from chat)
 *   - CLI `botmux workflow run <id> --param key=value [--param-json key=<json>]`
 *
 * Behaviour contract (matches the schema in `ParamDefSchema`):
 *   - Unknown param names → throw `unknown param` (don't silently pass through;
 *     the workflow author hasn't declared them, so any binding would be a
 *     latent typo).
 *   - Missing required → throw.
 *   - Missing optional + has `default` → fill with default verbatim.
 *   - Missing optional + no default → omit (downstream `${params.X}` lookup
 *     surfaces a `BindingError` on use, which is the right place to fail).
 *   - Present + type=string → keep as string.
 *   - Present + type=number → `Number(raw)`; reject NaN / Infinity.
 *   - Present + type=boolean → accept `true/1/yes/y` / `false/0/no/n` (case
 *     insensitive); reject anything else.
 *   - Present + type=object|array → only valid via the JSON channel; the
 *     plain string channel throws to tell the caller to use `--param-json`
 *     (CLI) or pre-decoded JSON (programmatic).
 */
import type { WorkflowDefinition } from './definition.js';
export type RawParamInput = {
    kind: 'string';
    value: string;
} | {
    kind: 'json';
    value: unknown;
};
export type ParamCoerceError = {
    /** Param name that failed; undefined for whole-record-shape errors. */
    name?: string;
    /** Machine code for the failure category. */
    code: 'unknown_param' | 'missing_required' | 'type_mismatch' | 'unsupported_string_channel' | 'invalid_json';
    /** Human-readable Chinese-localized message (matches existing CLI/IM output). */
    message: string;
};
export declare class ParamCoerceFailure extends Error {
    readonly issues: ParamCoerceError[];
    constructor(issues: ParamCoerceError[]);
}
/**
 * Validate + coerce raw caller input against the workflow's `params` schema.
 *
 * `rawParams` accepts a mixed map of `{ kind: 'string' | 'json' }` so that
 * the CLI can pipe `--param-json` through the same code path as `--param`.
 * The IM `/workflow run` legacy entry calls `coerceWorkflowParamsFromStrings`
 * below which wraps every value as `{ kind: 'string' }`.
 *
 * All errors are aggregated into a single `ParamCoerceFailure` so the caller
 * can render every issue at once instead of one-by-one Enter-key fixes.
 */
export declare function coerceWorkflowParams(def: WorkflowDefinition, rawParams: Record<string, RawParamInput>): Record<string, unknown>;
/**
 * Legacy convenience: when every input is a raw string (IM chat path), wrap
 * each value into `{ kind: 'string' }` and delegate to `coerceWorkflowParams`.
 */
export declare function coerceWorkflowParamsFromStrings(def: WorkflowDefinition, rawParams: Record<string, string>): Record<string, unknown>;
//# sourceMappingURL=params.d.ts.map