import type { OffloadOptions, RegisteredChildModule } from "../extensions/types.ts";
import type { ToolChildModuleJob, ToolDispatcher } from "./tool-dispatcher.ts";
export type OffloadErrorCode = "offload_module_unavailable" | "offload_unknown_module" | "offload_bad_registration" | "offload_bad_options" | "offload_session_closed" | "tool_child_deadline" | "tool_runtime_unavailable";
export declare class OffloadError extends Error {
    readonly code: OffloadErrorCode;
    constructor(code: OffloadErrorCode, message: string);
}
/** A registration as it is stored: a file-backed module only (an inline function is refused at registration). */
export declare function validateChildModuleRegistration(registration: unknown): void;
/** The absolute module path a registration names: relative paths resolve against the registering extension's file. */
export declare function childModulePath(entry: RegisteredChildModule): string;
export declare function offloadJob(entry: RegisteredChildModule, args: unknown, deadlineMs: number | undefined): ToolChildModuleJob;
/** The module files registered child modules name: granted to the session's child alongside its tools' modules. */
export declare function childModuleRoots(modules: ReadonlyMap<string, RegisteredChildModule>): string[];
/** `ctx.offload(id, args, options)`: the registered module, run where the session's dispatcher places it. */
export declare function offload(dispatcher: Pick<ToolDispatcher, "offload">, modules: ReadonlyMap<string, RegisteredChildModule>, id: string, args: unknown, options: OffloadOptions | undefined): Promise<unknown>;
//# sourceMappingURL=offload.d.ts.map