import { type PlanSummary } from "./plan.js";
import { type SyncMode } from "./engine.js";
import type { RecipeKind, SyncContext } from "./kind.js";
/** Default workspace directory for aggregate recipe files. */
export declare const DEFAULT_SYNC_DIR = ".scai/sync";
/** Slugify an instance id for a recipe filename. */
export declare const slugifyRecipeId: (value: string) => string;
/** One recipe captured by `aggregatePull`. */
export interface AggregatePullItem {
id: string;
file: string;
}
/** Per-kind outcome of `aggregatePull`. */
export interface AggregatePullKind {
kind: string;
pulled: AggregatePullItem[];
/** Set when the kind could not enumerate itself (e.g. no credential). */
skipped?: string;
}
/** Structured result of `aggregatePull`. */
export interface AggregatePullResult {
dir: string;
kinds: AggregatePullKind[];
total: number;
}
/**
* Enumerate every instance of every enumerable kind and capture each as
* a recipe file under `
//.yaml`. A kind that cannot
* enumerate itself (no credential for this environment) is recorded as
* `skipped` rather than failing the whole run.
*/
export declare const aggregatePull: (kinds: ReadonlyArray>, ctx: SyncContext, options?: {
dir?: string;
}) => Promise;
/** Drift classification of one recipe in `aggregateStatus`. */
export type AggregateDriftStatus = "in-sync" | "drift" | "error";
/** One recipe's drift status. */
export interface AggregateStatusItem {
id: string;
status: AggregateDriftStatus;
/** Plan tally — present when `status` is `drift`. */
summary?: PlanSummary;
/** Failure message — present when `status` is `error`. */
error?: string;
}
/** Per-kind outcome of `aggregateStatus`. */
export interface AggregateStatusKind {
kind: string;
items: AggregateStatusItem[];
}
/** Structured result of `aggregateStatus`. */
export interface AggregateStatusResult {
dir: string;
kinds: AggregateStatusKind[];
/** Count of recipes that drifted from the environment. */
drifted: number;
}
/**
* Diff every recipe file in the workspace against the environment. A
* kind with no workspace files is omitted from the result.
*/
export declare const aggregateStatus: (kinds: ReadonlyArray>, ctx: SyncContext, options?: {
dir?: string;
}) => Promise;
/** Outcome of pushing one recipe in `aggregatePush`. */
export type AggregatePushStatus = "applied" | "in-sync" | "planned" | "error";
/** One recipe's push outcome. */
export interface AggregatePushItem {
id: string;
status: AggregatePushStatus;
/** Changes written — present when `status` is `applied`. */
appliedCount?: number;
/** Changes that a non-dry-run would write — present when `status` is `planned`. */
plannedCount?: number;
/** Failure message — present when `status` is `error`. */
error?: string;
}
/** Per-kind outcome of `aggregatePush`. */
export interface AggregatePushKind {
kind: string;
items: AggregatePushItem[];
}
/** Structured result of `aggregatePush`. */
export interface AggregatePushResult {
dir: string;
mode: SyncMode;
kinds: AggregatePushKind[];
/** Total changes written across every recipe (zero in `what-if` mode). */
applied: number;
}
/**
* Converge every recipe file in the workspace onto the environment. In
* `what-if` mode nothing is written — each recipe reports its planned
* change count instead. A kind with no workspace files is omitted.
*/
export declare const aggregatePush: (kinds: ReadonlyArray>, ctx: SyncContext, options: {
dir?: string;
mode: SyncMode;
prune?: boolean;
}) => Promise;