import type { SliceDag } from '../../services/dispatch/slice-dag.js'; import type { ProgramIO } from '../cli-helpers.js'; import { type DispatchOptions } from './sub-agent-shared.js'; /** The three things every refusal in this path needs to be emitted. */ export type DagScope = { readonly role: string; readonly asJson: boolean; readonly io: ProgramIO; }; /** Identity every `--from-dag` envelope is stamped with. */ export type DagIds = { readonly projectRoot: string; readonly sid: string; readonly rid: string; readonly batchId: string; }; /** * Resolve the project root + the four ids the DAG envelope reports. * * The sid falls back through `PEAKS_SESSION_ID` and the canonical binding * before the `unknown-sid` sentinel; the rid keeps its `unknown-rid` default * when the caller passed none. */ export declare function resolveDagIds(options: DispatchOptions): DagIds; /** * Lazy-load the three heavy modules only when `--from-dag` is actually used. * * The warm-path single dispatch does NOT load slice-dag / dag-orchestrator / * contract-store (slice 9 perf); the dynamic-import promise resolves on first * call and ESM caches the module for subsequent calls in the same process. */ export declare function loadDagRuntime(): Promise<{ readFileSync: typeof import("fs").readFileSync; validateDag: typeof import("../../services/dispatch/slice-dag.js").validateDag; topologicalLevels: typeof import("../../services/dispatch/slice-dag.js").topologicalLevels; isSliceComplexity: typeof import("../../services/dispatch/slice-dag-types.js").isSliceComplexity; runLayeredDag: typeof import("../../services/code/dag-orchestrator.js").runLayeredDag; listContracts: typeof import("../../services/dispatch/contract-store.js").listContracts; hashContract: typeof import("../../services/dispatch/contract-store.js").hashContract; }>; export type DagRuntime = Awaited>; /** Read + `JSON.parse` + `validateDag` the DAG file; `null` once refused. */ export declare function readDagOrFail(runtime: DagRuntime, fromDag: string, scope: DagScope): SliceDag | null; /** * Each DAG node must map to an explicitly prepared workflow graph node before * sub-agent dispatch. The mapping is the `graphNode` annotation on the node, * or — as a back-compat fallback — the node id itself. */ export declare function assertGraphNodesMapped(dag: SliceDag, scope: DagScope): true | null; /** Topologically order the DAG's nodes; `null` once the failure is emitted. */ export declare function topologicalLevelsOrFail(runtime: DagRuntime, dag: SliceDag, fromDag: string, scope: DagScope): readonly (readonly string[])[] | null;