import type { VoyantGraphJsonValue } from "@voyant-travel/core/project"; import { type ResolvedVoyantDeploymentGraph, type VoyantGraphDiagnostic } from "./deployment-graph.js"; export type VoyantGraphLifecycleOperation = "upgrade" | "uninstall"; export type VoyantGraphLifecycleFacet = "runtime" | "api" | "schema" | "migration" | "link" | "subscriber" | "event" | "job" | "schedule" | "setup-migration" | "config" | "secret" | "resource" | "provider" | "access-resource" | "access-role" | "admin-runtime" | "admin-copy" | "admin-route" | "admin-nav" | "admin-slot" | "admin-contribution" | "tool" | "webhook" | "action"; export interface VoyantGraphLifecycleConsequence { id: string; unitId: string; facet: VoyantGraphLifecycleFacet; entityId: string; action: "detach" | "activate" | "retain-data" | "release"; } export interface VoyantGraphLifecycleStep { id: string; idempotencyKey: string; kind: "migrate-graph" | "detach-unit" | "release-resource" | "activate-unit"; unitId?: string; resourceId?: string; fromGraphHash: string; toGraphHash: string; reversible: boolean; } export interface VoyantGraphLifecyclePlan { schemaVersion: "voyant.graph-lifecycle-plan.v1"; operationId: string; operation: VoyantGraphLifecycleOperation; fromGraphHash: string; toGraphHash: string; /** Complete graph-derived surface and data consequences for review and doctor output. */ consequences: readonly VoyantGraphLifecycleConsequence[]; steps: readonly VoyantGraphLifecycleStep[]; } export interface CreateVoyantGraphLifecyclePlanInput { operationId: string; operation: VoyantGraphLifecycleOperation; previous: ResolvedVoyantDeploymentGraph; next: ResolvedVoyantDeploymentGraph; } export interface VoyantGraphLifecycleStepState { stepId: string; status: "completed" | "rolled-back"; rollbackToken?: VoyantGraphJsonValue; } export interface VoyantGraphLifecycleExecutionState { schemaVersion: "voyant.graph-lifecycle-state.v1"; operationId: string; planFingerprint: string; attempt: number; status: "running" | "rolling-back" | "completed" | "rolled-back"; steps: readonly VoyantGraphLifecycleStepState[]; error?: string; } export interface VoyantGraphLifecycleStateStore { load(operationId: string): Promise; save(state: VoyantGraphLifecycleExecutionState): Promise; } export interface VoyantGraphLifecycleExecutor { execute(step: VoyantGraphLifecycleStep, context: { operationId: string; attempt: number; }): Promise<{ rollbackToken?: VoyantGraphJsonValue; } | undefined>; rollback(step: VoyantGraphLifecycleStep, context: { operationId: string; attempt: number; rollbackToken?: VoyantGraphJsonValue; }): Promise; } export declare class VoyantGraphLifecyclePlanError extends Error { readonly diagnostics: readonly VoyantGraphDiagnostic[]; constructor(diagnostics: readonly VoyantGraphDiagnostic[]); } export declare function createVoyantGraphLifecyclePlan(input: CreateVoyantGraphLifecyclePlanInput): VoyantGraphLifecyclePlan; export declare function executeVoyantGraphLifecyclePlan(plan: VoyantGraphLifecyclePlan, store: VoyantGraphLifecycleStateStore, executor: VoyantGraphLifecycleExecutor): Promise; export declare function validateVoyantGraphEventCompatibility(previous: ResolvedVoyantDeploymentGraph, next: ResolvedVoyantDeploymentGraph): VoyantGraphDiagnostic[]; export declare function validateVoyantGraphUpgradeCompatibility(previous: ResolvedVoyantDeploymentGraph, next: ResolvedVoyantDeploymentGraph): VoyantGraphDiagnostic[];