/** * Startup update check integration. * * The check itself — suppression, the cached latest release, the * notification a fresh cache justifies, and the bounded background * revalidation — belongs to `@agentxm/cli-maintenance`. This module supplies the * two things only the application knows: the runtime signals the skip context * is derived from (raw argv, output mode, TTY, agent session) and the surface * the notification is printed on. * * @experimental This API is unstable and may change without notice. */ import * as Effect from "effect/Effect"; import { type LatestReleaseCheck, type UpdateCheckCache } from "@agentxm/cli-maintenance/self-update/application"; import type { AvailableUpdate } from "@agentxm/cli-maintenance/self-update/domain"; import { Screen } from "./screen/index.js"; /** * Detect whether the command being run is `axm upgrade` from raw argv. */ export declare const isUpgradeCommand: (args: ReadonlyArray) => boolean; /** * Detect non-interactive mode from raw argv and environment. */ export declare const resolveNonInteractiveFromArgv: (args: ReadonlyArray) => boolean; export interface UpdateCheckContextInputs { readonly args: ReadonlyArray; readonly isNonInteractive: boolean; readonly isJsonOutput: boolean; /** Stderr TTY detection captured by the screen boundary. */ readonly isStderrTTY?: boolean | undefined; /** State `AXM_NO_UPDATE_CHECK` instead of reading it from configuration. */ readonly noUpdateCheckEnv?: boolean | undefined; /** Override agent-session detection. Defaults to `isAgent(process.env)`. */ readonly isAgentSession?: boolean | undefined; } export type NotificationPrinter = (message: string) => Effect.Effect; export declare const notificationMessage: (update: AvailableUpdate, audience: "human" | "agent") => string; /** * Wrap a command program with the startup update check. An agent session is * told before the command writes anything, in one machine-readable line; a * person is told after the command's result, in one dim line that never * interrupts it. */ export declare const withUpdateCheck: (program: Effect.Effect, options: { readonly localVersion: string; readonly inputs: UpdateCheckContextInputs; readonly printNotification?: NotificationPrinter | undefined; }) => Effect.Effect; //# sourceMappingURL=update-check-startup.d.ts.map