/** * Field-level degradation guards for the payloads the panel renders (spec §2.4): * the client does not exhaustively validate the union — it narrows, then * degrades per field. Unknown/missing values render as `unknown`, never as * guessed values. * * This module ALSO carries the one place that validates the picker's untrusted * wire answer exhaustively: {@link parseSelectWorkflowResult} turns the * `/api/mstar/selectWorkflow` envelope into the panel's explicit state, so a * malformed or foreign answer degrades to `unavailable` — never to a * half-parsed acknowledgement. */ /** String field: non-empty string, else null (missing → `unknown`). */ export declare function str(value: unknown): string | null; /** Boolean field: real boolean, else null. */ export declare function bool(value: unknown): boolean | null; /** Count field: finite number, else null. */ export declare function count(value: unknown): number | null; /** Plain-object record (null and arrays are not records), else null. */ export declare function record(value: unknown): Record | null; /** One workflow-pick acknowledgement (the `selectWorkflow` wire result). */ export type MstarSelectWorkflowFetch = { readonly status: 'selected'; readonly sessionId: string; readonly workflowId: string; } | { readonly status: 'unavailable'; readonly reason: string; }; /** * Validate one `/api/mstar/selectWorkflow` response into the picker's state. * * The whole envelope is untrusted: the transport result, the endpoint result and * the acknowledged identity are all checked. A success MUST name the session AND the workflow this client asked * for — a foreign acknowledgement is refused rather than rendered as this * session's pick. * * @param raw - the value returned by `connection.rpc.call` (untrusted). * @param sessionId - the session this client ASKED for. * @param workflowId - the workflow id this client asked to select. * @returns the acknowledged pick, or the explicit unavailable state. */ export declare function parseSelectWorkflowResult(raw: unknown, sessionId: string, workflowId: string): MstarSelectWorkflowFetch;