nexus-agents - v2.80.0
    Preparing search index...

    Function compilePlan

    • Compiles a PlanContract into a CompiledGraph.

      • Each stage becomes a node with a handler (plugin-backed or placeholder)
      • Dependencies become fixed edges
      • Policy gates become gate nodes between stages
      • Stages with no dependencies get edges from START
      • Stages with no dependents get edges to END

      Parameters

      • plan: {
            taskId: string;
            stages: {
                id: string;
                type: "analyze" | "validate" | "aggregate" | "execute" | "gate" | "route";
                pluginId: string;
                inputArtifacts: string[];
                outputArtifacts: string[];
                dependencies: string[];
                config: Record<string, unknown>;
                preferredCli?: string;
                maxRetries?: number;
                timeoutMs?: number;
            }[];
            policyGates: {
                id: string;
                afterStage: string;
                beforeStage: string;
                rules: string[];
                onFail: "warn"
                | "block"
                | "escalate";
            }[];
            estimatedCost: {
                totalTokensIn: number;
                totalTokensOut: number;
                estimatedCostUsd: number;
                modelCalls: number;
            };
            approvalRequired: boolean;
            maxIterations: number;
            timeoutMs: number;
        }
      • Optionaloptions: PlanCompileOptions

      Returns CompileResult