/** * Plan-family operation lifecycle wrapper. * * Owns the lifecycle fact a handler body cannot own for itself: * **interruption**. An external termination request resolves through the * normal lifecycle: the body's interruption is converted — from the operation * journal the resolution boundary maintains — into a terminal resolution with * outcome `interrupted`, a contract-valid document, a stated durable-state * disposition, and the signal's exit code. * * Mutual exclusion is not acquired here: planning, network acquisition, * preview, and confirmation run lock-free, and the plan-family apply (or the * workspace transaction it delegates to) acquires the workspace transition * after confirmation, for revalidation through apply. */ import * as Effect from "effect/Effect"; import * as Path from "effect/Path"; import { type ProductActivityIntent } from "./cli-runtime/index.js"; import { OperationJournal, OperationLifecycle, type AtomicityClass, type OperationMode, type OperationPresentation, type SettledOutcome } from "@agentxm/workspace/transitions/planning"; import { Screen } from "./screen/index.js"; import { WorkspaceLocation } from "@agentxm/workspace/desired-state"; import { FootprintRecorder } from "@agentxm/workspace/transitions/settlement"; export interface OperationLifecycleArgs { /** Command identity, dot-separated as elsewhere (e.g. "skills.update"). */ readonly command: string; readonly mode: "preview" | "apply"; /** Operation name for a resolution produced before planning completes. */ readonly planName: string; /** * The command family's statically declared atomicity, for a resolution * produced before the journal exists. Defaults to `closure-atomic`. */ readonly declaredAtomicity?: AtomicityClass; readonly presentation?: OperationPresentation; readonly productActivity?: ProductActivityIntent; } export interface LiveOperationArgs { /** Command identity, dot-separated as elsewhere (e.g. "cache.prune"). */ readonly command: string; /** Operation name observers render; never a formatted phrase. */ readonly name: string; readonly mode: OperationMode; /** Outcome a successful body settles with; `completed` for non-plan operations. */ readonly successOutcome?: SettledOutcome; readonly productActivity?: ProductActivityIntent; } /** * Run a body as one observed operation: create the lifecycle broadcast, * attach the Screen's observer and telemetry before anything publishes, * announce the start, and on every exit settle (unless the body already did) * and wait for lossless observers to drain, bounded so exit never hangs. * * Non-plan commands wrap their work — not their result rendering — so the * live frame collapses before the settled document prints. */ export declare const withLiveOperation: (args: LiveOperationArgs, body: Effect.Effect) => Effect.Effect | Screen>; /** * Run a plan-family handler body under the operation lifecycle. The body owns * planning, confirmation, apply (which acquires the workspace transition * after confirmation), and emit; interruption resolves through the same emit * boundary as every other termination. */ export declare const withOperationLifecycle: (args: OperationLifecycleArgs, body: Effect.Effect) => Effect.Effect, FootprintRecorder>, OperationLifecycle>, import("effect/Scope").Scope>>; //# sourceMappingURL=operation-lifecycle.d.ts.map