import { Effect, FileSystem, Stream } from "effect"; import { ChildProcessSpawner } from "effect/unstable/process"; import { CommandPlanFailed } from "../domain/errors.ts"; import { type VendoredRepo } from "../domain/vendor-state.ts"; import { type DependencyVendorCandidate, type PackageDependency } from "../package-sync/service.ts"; import { type VendoredPackageVersionMap } from "../package-sync/version-report.ts"; import type { CommandPlan } from "./dashboard.ts"; import type { VendorTuiSnapshot } from "./status.ts"; export interface CliInvocation { readonly args: ReadonlyArray; readonly command: string; } export interface PlanResult { readonly status: number | null; readonly stdout: string; readonly stderr: string; } /** * Pure: given whether a local CLI script exists, choose how to invoke ingraft. * If the local script exists, run it via Bun; otherwise call the published CLI. */ export declare const selectCliCommand: (params: { readonly localCliExists: boolean; readonly localCliPath: string; readonly args: ReadonlyArray; }) => CliInvocation; /** * Pure: given an exec result (status + stdout + stderr) and a plan label, * format the user-facing one-line status string. */ export declare const formatPlanResult: (params: { readonly result: PlanResult; readonly label: string; }) => string; export interface SnapshotResult { readonly message: string; readonly snapshot: VendorTuiSnapshot; } export interface SnapshotProgress extends SnapshotResult { readonly complete: boolean; } export interface SnapshotStreamServices { readonly detectVendoredVersions: (cwd: string, candidates: ReadonlyArray, repos: ReadonlyArray) => Effect.Effect; readonly listDependencies: (cwd: string) => Effect.Effect, E, R>; readonly listRepos: (cwd: string) => Effect.Effect, E, R>; readonly root: Effect.Effect; readonly scanDependency: (cwd: string, dependency: PackageDependency) => Effect.Effect; } export declare const emptySnapshot: () => VendorTuiSnapshot; export declare const streamSnapshotWith: (services: SnapshotStreamServices, onProgress: (progress: SnapshotProgress) => void) => Effect.Effect; /** * A Stream of snapshot progress events backed by the live services. Emits * intermediate progress and a final result, then ends. * * Service / layer construction errors (config file failures, git lookup, etc.) * are surfaced through the inner snapshot catch handler as a failed snapshot * with an error message — the stream itself never fails. Per-call errors are * captured into the snapshot catch handler via Effect.sandbox + asError pattern * implemented by `streamSnapshotWith`'s outer Effect.catch. */ export declare const readSnapshotStream: Stream.Stream; export declare const runCommandPlanEffect: (plan: CommandPlan) => Effect.Effect; //# sourceMappingURL=cli-adapter.d.ts.map