import { type SystemTaskEvent, type SystemTaskJsonValue, type SystemTaskResult } from '@happier-dev/protocol';
export type InteractiveSystemTaskEventInput = Readonly<{
    type: string;
    stepId?: string;
    message?: string;
    data?: unknown;
}>;
export type InteractiveSystemTaskPromptRequest = Readonly<{
    kind: string;
    stepId?: string;
    message: string;
    data: SystemTaskJsonValue;
}>;
export type InteractiveSystemTaskContext = Readonly<{
    params: SystemTaskJsonValue;
    signal?: AbortSignal;
    emit: (event: InteractiveSystemTaskEventInput) => void;
    prompt: (prompt: InteractiveSystemTaskPromptRequest) => Promise<unknown>;
}>;
export type InteractiveSystemTaskKind<TResult extends SystemTaskJsonValue = SystemTaskJsonValue> = Readonly<{
    run: (context: InteractiveSystemTaskContext) => Promise<TResult>;
}>;
export type InteractiveSystemTaskKindMap = Readonly<Record<string, InteractiveSystemTaskKind>>;
type PromptEnvelope = Readonly<{
    kind: string;
    data: SystemTaskJsonValue;
}>;
export declare function createSystemTasksRunner(params: Readonly<{
    now?: () => number;
    kinds: InteractiveSystemTaskKindMap;
}>): Readonly<{
    start: (params: Readonly<{
        taskId: string;
        kind: string;
        params: SystemTaskJsonValue;
    }>) => Promise<Readonly<{
        taskId: string;
    }>>;
    poll: (params: Readonly<{
        taskId: string;
        cursor: number;
    }>) => Promise<Readonly<{
        events: SystemTaskEvent[];
        nextCursor: number;
        result: SystemTaskResult | null;
        pendingPrompt: PromptEnvelope | null;
    }>>;
    respond: (params: Readonly<{
        taskId: string;
        answer: unknown;
    }>) => Promise<void>;
}>;
export declare function buildPromptEventData(prompt: InteractiveSystemTaskPromptRequest): SystemTaskJsonValue;
export declare function redactSensitiveSystemTaskJsonValue(value: unknown): SystemTaskJsonValue;
export {};
//# sourceMappingURL=interactiveTaskKinds.d.ts.map