import { z } from 'zod'; import type { OperationFault } from '../operation-fault.ts'; import { type DispatchContext, type DispatchResult, type ErasedOperation } from './types.ts'; /** * Look up an operation by name. Emits the `looked-up` trace marker on * success. On failure (unknown operation) emits no marker, matching the * existing dispatch behavior where `MethodNotFound` ends the pipeline * before any marker is recorded. */ export declare function lookupOperation(operationName: string, context: DispatchContext): DispatchResult; /** * Take an already-looked-up operation and run transport, access, input * parsing with unknown-key policy, and authorization. Emits markers * `transport-checked`, `access-checked`, the parse markers emitted from * inside `parseAndApplyUnknownKeyPolicy`, then `authorized`. * * Authorization is part of this helper's contract; callers must not * re-authorize the same input. */ export declare function prepareAuthorizedInput(operation: ErasedOperation, rawInput: unknown, context: DispatchContext): Promise>; /** * Safely run `schema.safeParse(value)`. Maps any thrown exception or * failed parse to `{ code: 'EngineFailure', message: 'internal error', data: {} }`. * On success returns the parsed data so Zod transforms, defaults, and * refinements are honored. * * The `Output` generic is the caller's declared output type for the * operation. The schema is erased to `z.ZodType` on `ErasedOperation`, * so we cast `parseResult.data` to `Output` at the validated boundary — * the same single-level cast the previous private helpers performed * (`validateAndReturnOutput` and `validateOutput`). The cast is safe * because the success branch is only reachable after `schema.safeParse` * succeeded. */ export declare function validateOutputAgainstSchema(schema: z.ZodType, value: unknown): DispatchResult; /** Wrap an `OperationFault` in the standard `DispatchResult` failure shape. */ export declare function dispatchFailure(fault: OperationFault): DispatchResult;