import { type SystemTaskEvent, type SystemTaskResult } from '@happier-dev/protocol';
export declare class SystemTaskExecutionError extends Error {
    readonly code: string;
    constructor(code: string, message: string);
}
export type SystemTaskExecutionRunner = (params: unknown, context: Readonly<{
    taskId: string;
    signal: AbortSignal;
    now: () => number;
}>) => AsyncGenerator<unknown, unknown, void>;
export type SystemTaskRegistryEntry = Readonly<{
    kind: string;
    handler: SystemTaskExecutionRunner;
}>;
export type SystemTaskRegistry = ReadonlyMap<string, SystemTaskExecutionRunner>;
export declare function createSystemTaskRegistry(entries: ReadonlyArray<SystemTaskRegistryEntry>): SystemTaskRegistry;
export declare function executeSystemTask({ spec, taskId, registry, signal, now, emitEvent, }: Readonly<{
    spec: unknown;
    taskId: string;
    registry: SystemTaskRegistry;
    signal?: AbortSignal;
    now?: () => number;
    emitEvent?: (event: SystemTaskEvent) => void;
}>): Promise<SystemTaskResult>;
//# sourceMappingURL=runSystemTask.d.ts.map