/** * Shared plumbing for the `scai agents …` task runners. * * Every runner resolves the environment, loads the keychain-backed * Agentic Studio session, calls a library helper, then prints human or * JSON output. The helpers here keep that boilerplate in one place. */ import { Logger } from "../../shared/logger.js"; import type { AgentsSession } from "../session/types.js"; /** The option bag every `agents` runner accepts (env + verbosity flags). */ export interface RunAgentsBaseOptions { config?: string; environmentName?: string; verbose?: boolean; trace?: boolean; quiet?: boolean; json?: boolean; logFile?: string; } export declare const toLogger: (options: RunAgentsBaseOptions) => Logger; /** * Emit a canonical `ScaiEnvelope` on stdout. Used by `--json` output * paths across the agents task family. Each call site passes a * command suffix that gets prefixed with `agents.` (e.g. `agent.list` * → `agents.agent.list`) plus the env name from the options bag. */ export declare const writeAgentsEnvelope: (command: string, options: RunAgentsBaseOptions, data: unknown, extra?: Record) => void; /** Resolve the env and load its Agentic Studio session. */ export declare const prepare: (options: RunAgentsBaseOptions) => Promise<{ logger: Logger; session: AgentsSession; envName: string; }>; /** * Shared list rendering. JSON path emits a `ScaiEnvelope`; human * path emits one line per item. `command` is the agents-suffix * (e.g. `agent.list`) — the helper prefixes `agents.` for the * envelope. */ export interface RenderListArgs { logger: Logger; command: string; options: RunAgentsBaseOptions; label: string; items: T[]; line: (item: T) => string; } export declare const renderList: (args: RenderListArgs) => void; /** Shared single-item rendering — envelope on `--json`, key/value list otherwise. */ export declare const renderItem: (logger: Logger, command: string, options: RunAgentsBaseOptions, label: string, item: Record) => void; /** * Gate an UNVERIFIED write (update / delete on a resource whose endpoint * is not confirmed). Throws unless the operator opted in * with `--unverified`. */ export declare const requireUnverified: (unverified: boolean | undefined, resource: string, verb: "update" | "delete") => void;