import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import * as Schema from "effect/Schema"; import type * as Scope from "effect/Scope"; import * as ServiceMap from "effect/Context"; import type { SuggestedAction } from "@agentxm/registry-protocol/unstable/suggested-action"; import { type OperationLifecycleService } from "@agentxm/workspace/transitions/planning"; import type { AppError } from "../app-error/index.js"; import { type Ask, type InteractiveGuard } from "./ask/ask.js"; import type { QuestionCancelled } from "./ask/question-cancelled.js"; import { WaitAbandoned } from "./wait/wait-abandoned.js"; import type { WaitActions, WaitView } from "./wait/wait.js"; import type { Doc } from "./doc.js"; import { Frame } from "./frame.js"; import type { LivePlan } from "./live-ledger.js"; import type { Glyphs } from "./glyphs.js"; import { OutputStreams } from "./streams.js"; import type { CredentialDeliveryFailed } from "./streams.js"; import type { ResultOptions } from "./output.js"; export type { ResultOptions } from "./output.js"; export interface ScreenLogRecord { readonly level: "trace" | "debug" | "info" | "warn" | "error" | "fatal"; readonly message: string; } export interface ScreenFacts { readonly columns: number; readonly stdoutIsTTY: boolean; /** Whether the primary result stream is styled. */ readonly colors: boolean; readonly animate: boolean; } /** Operation whose plan the current feature invocation is presenting. */ export declare const CurrentScreenOperationId: ServiceMap.Reference; declare const Screen_base: ServiceMap.ServiceClass Effect.Effect; /** Deliver one credential to stdout and succeed only after the stream acknowledges it. */ readonly credential: (content: string) => Effect.Effect; readonly note: (doc: Doc, options?: { readonly persistent?: boolean; }) => Effect.Effect; readonly document: (data: Schema.Schema.Type, schema: S, options?: ResultOptions) => Effect.Effect; readonly observe: (lifecycle: OperationLifecycleService) => Effect.Effect; /** * Give the live ledger the plan whose rows it paints while the operation * runs. Returns whether the plan is visible in the live frame, so a caller * can print a static fallback when it is not. */ readonly showPlan: (plan: LivePlan) => Effect.Effect; readonly log: (record: ScreenLogRecord) => Effect.Effect; /** * Put a question to the person and answer with what they chose. The guard * decides whether a question may open at all: where it may not, and in * machine mode always, this fails with the usage error and its recovery * instead, so no prompt can reach a terminal that must not see one. */ readonly ask: (ask: Ask, guard?: InteractiveGuard) => Effect.Effect; /** * Park the terminal while a person acts somewhere else, and answer with * what the awaited effect settled on. The wait's brief prints once, its * countdown is the only live line, and stopping it fails with * `WaitAbandoned` so the caller can end with its own pending outcome. A * screen that cannot animate — or is quiet — prints the brief and simply * waits. */ readonly wait: (view: WaitView, awaited: Effect.Effect, actions?: WaitActions) => Effect.Effect; readonly facts: Effect.Effect; readonly settle: Effect.Effect; }>; /** * The application-owned terminal. Settled output crosses as a typed `Doc`; * live output reaches it only through `observe`, which subscribes the * mode's observer (live frame or machine writer) to an operation's * lifecycle broadcast within the caller's scope. */ export declare class Screen extends Screen_base { } export interface ScreenLiveOptions { /** ANSI styling per stream: only a stream that is itself a terminal is styled. */ readonly colors: { readonly stdout: boolean; readonly stderr: boolean; }; readonly animate: boolean; /** Quiet keeps a wait static: its brief prints once and nothing counts down. */ readonly quiet?: boolean; /** Symbol set for every painted document; defaults to the Unicode glyphs. */ readonly glyphs?: Glyphs; } export declare const ScreenLive: (options: ScreenLiveOptions) => Layer.Layer; export declare const ScreenMachine: (options?: { readonly quiet?: boolean; }) => Layer.Layer; export declare const emitSuggestionEvents: (screen: typeof OutputStreams.Service, suggestions: ReadonlyArray) => Effect.Effect; //# sourceMappingURL=screen.d.ts.map