/**
 * Action event data types — discriminated union for state machine data.
 *
 * 39-variant discriminated union across 3 action kinds (request_response,
 * remote_notification, local_call). Each variant narrows the data shape
 * by kind, phase, and step.
 *
 * @module
 */
import { z } from 'zod';
import { ActionEventPhase, ActionKind } from './action_spec.js';
import { JsonrpcRequest, JsonrpcResponseOrError, JsonrpcNotification, JsonrpcErrorObject, } from '../http/jsonrpc.js';
import { ActionExecutor, ActionEventStep } from './action_event_types.js';
// Base schema for all action event data
export const ActionEventData = z.strictObject({
    kind: ActionKind,
    phase: ActionEventPhase,
    step: ActionEventStep,
    method: z.string(),
    executor: ActionExecutor,
    input: z.unknown().nullable(),
    output: z.unknown().nullable(),
    error: JsonrpcErrorObject.nullable(),
    progress: z.unknown().nullable(),
    // Fields for specific kinds - always present but may be null
    request: JsonrpcRequest.nullable(),
    response: JsonrpcResponseOrError.nullable(),
    notification: JsonrpcNotification.nullable(),
});
