import type * as Config from "effect/Config"; 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-kernel/operations"; 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 { Glyphs } from "./glyphs.js"; import { OutputStreams } from "./streams.js"; import { CredentialDeliveryFailed, type OutputWriteFailed } 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; } interface ScreenFacts { readonly columns: number; readonly stdoutIsTTY: boolean; /** Whether the primary result stream is styled. */ readonly colors: 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) => Effect.Effect; /** Required handoff guidance, also emitted as a machine instruction. */ readonly instruction: (doc: Doc) => Effect.Effect; readonly document: (data: Schema.Schema.Type, schema: S, options?: ResultOptions) => Effect.Effect; readonly observe: (lifecycle: OperationLifecycleService) => Effect.Effect; readonly log: (record: ScreenLogRecord) => Effect.Effect; /** * Whether a question can open in this invocation: the flags and * environment allow a prompt, and the terminal can paint one. Planning, * command handlers, and `ask` itself read this one decision, so an * invocation that cannot ask is blocked with its recovery before any * question is raised. Machine output can never ask. */ readonly canAsk: 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 { } 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; /** Select the output projection once; machine mode never evaluates a human view. */ export declare const emitResult: (data: Schema.Schema.Type, schema: S, human: () => Doc, options?: ResultOptions) => Effect.Effect; //# sourceMappingURL=screen.d.ts.map