import { AgentsClient } from "@nylorun/agents"; import { CliError } from "../errors.js"; import { parseStackFlags, type StackDeps } from "../stack/commands.js"; import { type Connection } from "./target.js"; /** Flags every Runtime API command takes. */ export declare const RUNTIME_FLAGS: { readonly values: readonly ["--tenant", "--as"]; readonly lists: readonly ["--scope"]; }; export declare const runtimeFlagsUsage: string; export declare const usageError: (message: string) => CliError; export type Flags = ReturnType; /** `args` parsed with the Runtime flags added to `allowed`; `--help` names them too. */ export declare function parseFlags(args: readonly string[], allowed: { booleans?: readonly string[]; values?: readonly string[]; lists?: readonly string[]; }, usage: string): Flags; /** Exactly `count` positional arguments, else a usage error. */ export declare function positional(flags: Flags, count: number, usage: string): string[]; /** The Runtime API client of the installation the flags (or the environment) name. */ export declare function runtimeClient(deps: StackDeps, flags: Flags): Promise<{ client: AgentsClient; connection: Connection; }>; /** Runs `command`, turning a Runtime's refusal into a `CliError` with its message (exit 1). */ export declare function runtimeCall(command: () => Promise): Promise; /** Standard input, whole. */ export declare function readStdin(): Promise; /** A JSON object from file `path`, or from standard input when `path` is `-`. */ export declare function readJson(path: string, what: string): Promise>; /** A JSON value given on the command line. */ export declare function parseJsonArgument(text: string, what: string): unknown; /** `key=value` pairs (`--label`), as a record. */ export declare function labelsOf(flags: Flags, name?: string): Record | undefined; /** A positive integer flag, when given. */ export declare function integerFlag(flags: Flags, name: string): number | undefined; export { printJson, printTable } from "./io.js"; /** A page's `next cursor` hint, when there is one. */ export declare function printCursor(deps: StackDeps, cursor: string | null | undefined): void;