import { type Token, type Type } from '@frontmcp/di'; import { type z } from '@frontmcp/lazy-zod'; import type { FrontMcpContext } from '../../context/frontmcp-context'; import { type HookEntry, type ScopeEntry } from '../entries'; import { type FlowMetadata, type FlowName } from '../metadata'; import { type FlowStateOf } from './internal/flow.utils'; import { type FrontMcpLogger } from './logger.interface'; export type FlowInputOf = z.infer; export type FlowOutputOf = z.infer; export type FlowPlanOf = ExtendFlows[N]['plan']; export type FlowCtxOf = ExtendFlows[N]['ctx']; export type FlowStagesOf = ExtendFlows[N]['stage']; export type FlowExecuteStagesOf = ExtendFlows[N]['executeStage']; export type FlowControlType = 'respond' | 'fail' | 'abort' | 'next' | 'handled'; export declare class FlowControl extends Error { readonly type: FlowControlType; readonly output: any; constructor(type: FlowControlType, output: any); static respond(output: T): never; static next(): never; static handled(): never; static fail(error: Error): never; static abort(reason: string): never; } export declare abstract class FlowBase { protected readonly metadata: FlowMetadata; readonly rawInput: Partial> | any; protected readonly scope: ScopeEntry; protected readonly appendContextHooks: (hooks: HookEntry[]) => void; protected readonly deps: ReadonlyMap; protected input: FlowInputOf; state: FlowStateOf; scopeLogger: FrontMcpLogger; constructor(metadata: FlowMetadata, rawInput: Partial> | any, scope: ScopeEntry, appendContextHooks: (hooks: HookEntry[]) => void, deps?: ReadonlyMap); get(token: Token): T; respond(output: FlowOutputOf): void; fail(error: Error): void; protected abort(message: string): void; protected next(): void; protected handled(): void; /** * Get the current FrontMcpContext from AsyncLocalStorage. * Available in all stages after context initialization. * * @throws Error if not in a context scope */ protected get context(): FrontMcpContext; /** * Safely try to get FrontMcpContext (returns undefined if not available). * Use this when context might not be available (e.g., non-HTTP flows). */ protected tryGetContext(): FrontMcpContext | undefined; } export type FlowType> = Type; //# sourceMappingURL=flow.interface.d.ts.map