import * as Cause from "effect/Cause"; import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import type { OutputFormat } from "./output-mode.js"; import { AppError } from "../app-error/index.js"; import { type WorkspaceFailure } from "../app-error/failure-catalog.js"; import type { InstallSelectionCancelled } from "@agentxm/workspace-kernel/operations"; /** * Structural shape of the workspace configuration feature's typed * initialization cancellation. The envelope dispatches on the tag alone, so * it does not import the feature package (the transitional residue may not * depend on features). */ export interface WorkspaceInitializationCancelled { readonly _tag: "WorkspaceInitializationCancelled"; readonly message: string; } import { OperationExit } from "./operation-exit.js"; import { CommandCompletion } from "./command-completion.js"; import { ConfigurationFailure } from "./configuration-failure.js"; import { TelemetryPreviewFraming } from "../telemetry/index.js"; import { type QuestionCancelled, OutputWriteFailed } from "../screen/index.js"; import { Verbosity, type VerbosityLevel } from "../cli-flags/index.js"; import { Screen } from "../screen/index.js"; /** * Emit a defect (unhandled panic). The squashed cause classifies through the * one failure classifier and renders through the one error renderer, so a * defect reads exactly like any other error of its code on every channel: the * same title, the same `--debug` cause chain in text, the same stable * envelope in JSON. The classification is handed back so the process exits * with the code the rendered phrase states. */ export declare const writeDefect: (cause: Cause.Cause, format: OutputFormat) => Effect.Effect; export type ExpectedCliError = OutputWriteFailed | AppError | WorkspaceFailure | QuestionCancelled | WorkspaceInitializationCancelled | InstallSelectionCancelled; export type CliRuntimeFoundation = Screen | Verbosity; /** * Emit an expected (handled) CLI error. * * Rendering is delegated to `renderAppErrorChannels` — the single source of * truth shared with the outer `classifyError`/`handleError` path — so the two * error paths cannot diverge. Suggestions appear once per channel: a single * `Next:` block in text mode, and the stderr suggestion stream plus the * stdout envelope (distinct surfaces) in json mode. The earlier bug emitted a * second `Next:` block on the same stderr channel in text mode. * * Exported for tests; production callers route through `withCliErrorHandling`. */ export declare const writeExpectedCliError: (error: ExpectedCliError, format: OutputFormat) => Effect.Effect; /** * Build the foundation layer: Screen + Verbosity. * * The returned layer requires the global verbosity flag settings in its * context when no explicit verbosity level is supplied. */ export declare const makeFoundationLayer: (format: OutputFormat, options?: { readonly envVerbose?: boolean | undefined; readonly envDebug?: boolean | undefined; readonly verbosityLevel?: VerbosityLevel | undefined; }) => Layer.Layer; /** * Resolve the output format from the global flag + options. */ export declare const resolveCliFormat: Effect.Effect; /** * Wrap a pre-provided program in CLI error handling and settlement telemetry. * * The program should already have all its service dependencies satisfied * except for the process-owned TelemetryClient, which the envelope requires * from its caller so one reporter serves the whole invocation. */ export declare const withCliErrorHandling: (program: Effect.Effect, options: { readonly command?: string | undefined; readonly format: OutputFormat; }) => Effect.Effect, ConfigurationFailure>, import("./telemetry.js").ProductActivity | import("./telemetry.js").CommandSemanticProperties>, OperationExit>, TelemetryPreviewFraming>>; //# sourceMappingURL=runtime-envelope.d.ts.map