import type { NormalizedExecutableGraphDocument } from "./executable-graph.js"; import type { GraphResponsePersistency } from "./graph-run-contract.js"; import type { ExecutionGateCondition } from "./gate-conditions.js"; import type { CaseCondition } from "./case-condition.js"; import type { DataRef } from "./execution-trace.js"; import type { FinalizerExecutionPlan, NodeExecutionPlan } from "./execution-unit.js"; import type { ModelFallbackPolicy, PlanPolicies } from "./plan-policies.js"; import type { HashFunction } from "./executable-plan.js"; import type { AiModelSelection } from "./model-config.js"; export declare const EXECUTABLE_PLAN_FORMAT_V2: "executable-plan"; export declare const EXECUTABLE_PLAN_VERSION_V2: 2; /** Alias for spec naming — same as NormalizedExecutableGraphDocument. */ export type NormalizedAuthoringGraphDocument = NormalizedExecutableGraphDocument; export interface ArtifactRef { uri: string; hash?: string; contentType?: string; } export type NormalizedGraphMaterialization = { mode: "embedded"; graph: NormalizedAuthoringGraphDocument; graphHash: string; } | { mode: "ref"; ref: ArtifactRef; graphHash: string; }; export interface PlanSourceRef { graphId: string; graphRevision?: string; graphHash: string; formatVersion: string; } export interface ProfileRegistryRef { package: "@x12i/ai-profiles"; version: string; registryHash: string; } export interface RuntimeBinding { jobId: string; mode?: "simulate" | "live" | "plan"; environment?: string; inputHash?: string; contextHash?: string; variablesHash?: string; jobHash?: string; sourceGraphHash: string; profileRegistryHash: string; } export interface RuntimeExpectations { requiredFields: string[]; hashIncludes: Array<"input" | "context" | "variables" | "job" | "executionMemory" | "outputsMemory">; requiresAgentId?: boolean; requiresJobTypeId?: boolean; allowsExecutionMemorySeed?: boolean; allowsOutputsMemorySeed?: boolean; plannerFields?: { goalNodeId?: string; dimension?: string; initialStateHash?: string; }; observabilityFields?: { runLogMode?: boolean; debugMode?: boolean; runTaskExecutionMode?: boolean; }; } export interface PlanNodeRef { nodeId: string; kind: string; nodeType: "task" | "finalizer" | "callGraph" | "special" | string; executionClass: "aiTask" | "localTask" | "finalizer" | "callGraph" | "special" | string; } export interface PlanEdgeRef { edgeId: string; from: { nodeId: string; portId?: string; }; to: { nodeId: string; portId?: string; }; hasDeferredGate?: boolean; deferredGateId?: string; } export interface PlanTopology { nodes: PlanNodeRef[]; edges: PlanEdgeRef[]; entryNodeIds: string[]; rootNodeIds: string[]; finalizerNodeIds: string[]; outputNodeIds: string[]; graphInputIds: string[]; graphOutputIds: string[]; } export interface SchedulingPolicy { mode: "forward" | "backward" | "hybrid"; goalNodeId?: string; dimension?: string; initialStateRef?: DataRef; initialStateHash?: string; wavePlanning: "staticSchedule" | "executorEvaluatesDeferredGates"; failFast?: boolean; } export interface MatchedCondition { path?: string; description: string; } export interface SelectedCaseV2 { caseId: string; matched: boolean; defaulted: boolean; reason?: string; matchedConditions?: MatchedCondition[]; sourcePath: string; } export interface PlanCaseSelection { graphModelCase: SelectedCaseV2; nodeModelCases: Record; policyCases?: Record; tracePolicyCases?: Record; } export interface DeferredNodeGate { gateId: string; nodeId: string; runWhen?: ExecutionGateCondition[]; skipWhen?: ExecutionGateCondition[]; sourcePath: string; } export interface DeferredEdgeGate { gateId: string; edgeId: string; fromNodeId: string; toNodeId: string; when: ExecutionGateCondition; sourcePath: string; } export interface DeferredEntryGate { gateId: string; inputId?: string; condition: ExecutionGateCondition; sourcePath: string; } export interface DeferredGateSet { entryGates?: DeferredEntryGate[]; nodeGates: Record; edgeGates: Record; } export interface PlanContracts { entry?: { graphEntryRef?: string; executionSchema?: Record; entryGateIds?: string[]; entryAccepted?: boolean; }; response: { graphResponseRef?: string; graphOutputIds: string[]; responseShapePath?: string; finalOutputSchema?: Record; persistency?: GraphResponsePersistency; responsePersistencyRef?: string; }; } export interface PlanCompatibility { authoringFormatVersion: string; planFormatVersion: string; requiredExecutorCapabilities: string[]; taskNodeFieldsCovered: string[]; unsupportedAuthoringFields?: Array<{ path: string; reason: string; severity: "error" | "warning"; }>; migrationNotes?: string[]; } export interface PlanValidationSummary { valid: boolean; validatedAt: string; errorCount: number; warningCount: number; } export interface ExecutableGraphPlanV2 { format: typeof EXECUTABLE_PLAN_FORMAT_V2; version: typeof EXECUTABLE_PLAN_VERSION_V2; planId: string; createdAt: string; source: PlanSourceRef; runtimeBinding: RuntimeBinding; runtimeExpectations: RuntimeExpectations; profileRegistry: ProfileRegistryRef; normalizedGraph: NormalizedGraphMaterialization; topology: PlanTopology; schedulingPolicy: SchedulingPolicy; caseSelection: PlanCaseSelection; deferredGates: DeferredGateSet; nodePlans: Record; finalizerPlans: Record; contracts: PlanContracts; policies: PlanPolicies; compatibility: PlanCompatibility; validation: PlanValidationSummary; } /** Model case conditions use deterministic predicates only. */ export type ModelCaseCondition = CaseCondition; export interface CompileExecutablePlanV2Options { profileRegistry?: { version: string; registryHash?: string; }; environment?: string; directModelPolicy?: PlanPolicies["directModelPolicy"]; fallbackOwner?: ModelFallbackPolicy["owner"]; now?: () => Date; hash?: HashFunction; } export interface CompileAuthoringGraphOptions { profileRegistry?: CompileExecutablePlanV2Options["profileRegistry"]; environment?: string; directModelPolicy?: PlanPolicies["directModelPolicy"]; fallbackOwner?: ModelFallbackPolicy["owner"]; now?: () => Date; hash?: HashFunction; /** Studio editor partial model-config draft merged before compile. */ modelConfigDraft?: AuthoringModelConfigPersistDraft; } /** Partial editor model-config slot draft (Studio merge-on-save). */ export interface AuthoringModelConfigSlotDraft { preActionModel?: string | AiModelSelection; skillModel?: string | AiModelSelection; postActionModel?: string | AiModelSelection; } export interface AuthoringModelConfigPersistDraft { graph?: AuthoringModelConfigSlotDraft; nodes?: Record; } //# sourceMappingURL=executable-plan-v2.d.ts.map