/**
 * Action event helper functions — type guards, validators, and data creation.
 *
 * @module
 */
import type { Result } from '@fuzdev/fuz_util/result.js';
import { type ActionEventStep, type ActionExecutor } from './action_event_types.js';
import type { ActionEventData, ActionEventRequestResponseData, ActionEventRemoteNotificationData, ActionEventLocalCallData } from './action_event_data.js';
import type { ActionEventPhase, ActionInitiator, ActionKind } from './action_spec.js';
import type { JsonrpcErrorObject } from '../http/jsonrpc.js';
import type { ActionEvent } from './action_event.js';
export declare const is_request_response: (data: ActionEventData) => data is ActionEventRequestResponseData;
export declare const is_remote_notification: (data: ActionEventData) => data is ActionEventRemoteNotificationData;
export declare const is_local_call: (data: ActionEventData) => data is ActionEventLocalCallData;
export declare const is_send_request: (data: ActionEventData) => data is ActionEventRequestResponseData & {
    phase: "send_request";
};
export declare const is_receive_request: (data: ActionEventData) => data is ActionEventRequestResponseData & {
    phase: "receive_request";
};
export declare const is_send_response: (data: ActionEventData) => data is ActionEventRequestResponseData & {
    phase: "send_response";
};
export declare const is_receive_response: (data: ActionEventData) => data is ActionEventRequestResponseData & {
    phase: "receive_response";
};
export declare const is_notification_send: (data: ActionEventData) => data is ActionEventRemoteNotificationData & {
    phase: "send";
};
export declare const is_notification_receive: (data: ActionEventData) => data is ActionEventRemoteNotificationData & {
    phase: "receive";
};
export declare const is_execute: (data: ActionEventData) => data is ActionEventLocalCallData & {
    phase: "execute";
};
export declare const is_initial: (data: ActionEventData) => data is ActionEventData & {
    step: "initial";
};
export declare const is_parsed: (data: ActionEventData) => data is ActionEventData & {
    step: "parsed";
};
export declare const is_handling: (data: ActionEventData) => data is ActionEventData & {
    step: "handling";
};
export declare const is_handled: (data: ActionEventData) => data is ActionEventData & {
    step: "handled";
};
export declare const is_failed: (data: ActionEventData) => data is ActionEventData & {
    step: "failed";
};
export declare const is_send_request_with_parsed_input: <TMethod extends string = string>(data: ActionEventData) => data is ActionEventRequestResponseData<TMethod> & {
    phase: "send_request";
    step: "parsed" | "handling";
    input: unknown;
};
export declare const is_notification_send_with_parsed_input: <TMethod extends string = string>(data: ActionEventData) => data is ActionEventRemoteNotificationData<TMethod> & {
    phase: "send";
    step: "parsed" | "handling";
    input: unknown;
};
/**
 * Validate that a step transition is legal per `action_event_step_transitions`.
 *
 * @throws Error if `from → to` is not a permitted transition
 */
export declare const validate_step_transition: (from: ActionEventStep, to: ActionEventStep) => void;
/**
 * Validate that `phase` is one of the phases allowed for `kind` per
 * `action_event_phase_by_kind`.
 *
 * @throws Error if `phase` is not valid for `kind`
 */
export declare const validate_phase_for_kind: (kind: ActionKind, phase: ActionEventPhase) => void;
/**
 * Validate that a phase chain is legal per `action_event_phase_transitions`.
 *
 * @throws Error if `from → to` is not the permitted next phase (or `from` is terminal)
 */
export declare const validate_phase_transition: (from: ActionEventPhase, to: ActionEventPhase) => void;
export declare const get_initial_phase: (kind: ActionKind, initiator: ActionInitiator, executor: ActionExecutor) => ActionEventPhase | null;
export declare const should_validate_output: (kind: ActionKind, phase: ActionEventPhase) => boolean;
export declare const is_action_complete: (data: ActionEventData) => boolean;
export declare const create_initial_data: (kind: ActionKind, phase: ActionEventPhase, method: string, executor: ActionExecutor, input: unknown) => ActionEventData;
/**
 * Pull the terminal `Result` from an action event.
 *
 * `data.error` populated → error path (covers both explicit `failed` and
 * the unhandled `receive_error` / `send_error` case where no handler was
 * registered for the error phase). `step === 'handled'` → success path.
 *
 * @throws Error if the event is in a non-terminal state (programming error —
 *   callers should check `is_action_complete` first)
 */
export declare const extract_action_result: (event: ActionEvent) => Result<{
    value: ActionEventData["output"];
}, {
    error: JsonrpcErrorObject;
}>;
//# sourceMappingURL=action_event_helpers.d.ts.map