import type { OutputStream } from "./output/format.ts"; import { ProtectClient } from "../../index.ts"; import type { ProtectLogging } from "../../index.ts"; /** * Options for {@link openClient}. `cwd`/`home` are forwarded to credential discovery (tests point them at a fixture); `log` is the logger the library emits through; * `debug` turns on verbose logging in the default stderr logger and has no effect when the caller supplies its own `log`; `refreshIntervalMs` overrides the * bootstrap-refresh failsafe cadence (a short command may pass `false` to skip the failsafe entirely); `signal` is the Ctrl-C lifetime. * * @category CLI */ export interface OpenClientOptions { cwd?: string; debug?: boolean; home?: string; log?: ProtectLogging; refreshIntervalMs?: number | false; signal?: AbortSignal; } /** * Build the CLI's {@link ProtectLogging} adapter. Every library log line is routed to stderr - never stdout - so a command's payload (a JPEG, an fMP4 stream, NDJSON) is * never interleaved with diagnostics. Warnings and errors always print (a throttle, a stall, a reboot is something the operator wants told); the lower-volume `info` * lifecycle lines and `debug` detail print only with `--debug`, so a plain command emits just its own output on stdout and nothing on stderr unless something went wrong. * Each line is tagged with its level so a human reading stderr can tell a warning from an error at a glance. * * @param opts - Whether debug is enabled, and the stream to write to (defaults to stderr). * * @returns A `ProtectLogging` implementation. * * @category CLI */ export declare function createCliLogger(opts?: { debug?: boolean; stream?: OutputStream; }): ProtectLogging; /** * Load credentials and connect a ready {@link ProtectClient}. The single home for "how the ufp CLI connects" - commands reach it through the injected `ctx.openClient` * seam (`await using client = await ctx.openClient({ debug, signal })`, never by importing this opener directly), so the `await using` lifetime is visible at each call * site while the credential-loading and connect-assembly live in exactly one place. `log` serves direct library callers; CLI commands leave it to the default logger. * * @param opts - Discovery overrides, logger, refresh cadence, and the Ctrl-C signal. * * @returns A connected client. * * @throws {@link CliError} when credentials cannot be loaded, or the typed `FatalError` the library throws on a failed connect. * * @category CLI */ export declare function openClient(opts?: OpenClientOptions): Promise; //# sourceMappingURL=client.d.ts.map