/** * watch command — keyless page monitoring registry (watch-temporal-diff * lane B, T4). * * The stateful family over the T2 watch store: * * - `watch add [--name ] [--keep <1..100>]` — register a * page target; the name defaults to the URL host+path slug. * - `watch list` — the registry, ascending by id (chronological). * - `watch remove [--purge]` — identity-guarded removal; * the change-log evidence dir survives by default, `--purge` drops it. * - `watch run` — the cron tick with the 0/1/2 exit contract. * - `watch feed [--format ]` — the change * history as a document: jsonl streams the change log verbatim, * rss renders change/moved entries as RSS 2.0. * * Credential-free (no Provider resolution, no Adapter, no quota * tracking) and dispatched before the credentialed config load — but * stateful BY DESIGN: the persistent snapshot ring and change log live * under `SCOUTLINE_WATCH_DIR` / `/watch`, which is exactly * why the dispatcher rejects `--isolated` (a unique artifacts namespace * would silently orphan the monitored state). */ import type { OutputMode } from "../lib/output.js"; import type { HandlerDependencies } from "../index.js"; import { type WatchTarget } from "../lib/watch-store.js"; export declare const WATCH_HELP: string; /** Report envelope for `watch add` (the registry entry + removal evidence). */ export interface WatchAddReport extends WatchTarget { readonly schemaVersion: 1; } /** Report envelope for `watch remove`. */ export interface WatchRemoveReport { readonly schemaVersion: 1; readonly id: string; readonly name: string; readonly type: string; readonly url: string; readonly keep: number; readonly createdAt: string; /** true when --purge deleted the per-target evidence dir. */ readonly purged: boolean; } /** Report envelope for `watch list`. */ export interface WatchListReport { readonly schemaVersion: 1; readonly total: number; readonly targets: readonly WatchTarget[]; } /** * Parse CLI args for the watch command (the `parseArchiveArgs` shape: * `--help`-aware, leading `--flags` never displace the subcommand). */ export declare function parseWatchArgs(args: readonly string[]): { readonly subcommand?: string; readonly positional: readonly string[]; readonly flags: Record; readonly showHelp: boolean; }; /** `watch run` report payload (frozen contract; data-only stdout). */ export interface WatchRunReport { readonly schemaVersion: 1; readonly target: string; readonly gen: number | null; readonly result: "baseline" | "no-change" | "change" | "moved" | "error"; readonly baseline?: boolean; readonly diff?: { added: string[]; removed: string[]; changed: string[]; }; readonly hashOnly?: boolean; readonly finalUrl?: string | null; /** Present only when result is "moved" (plan ruling #7). */ readonly moved?: boolean; /** Present only when result is "error" (the failure reason). */ readonly reason?: string; readonly prevAt: string | null; readonly nowAt: string; } /** `watch run --all` payload: one report per target, id (chronological) order. */ export interface WatchRunAllReport { readonly schemaVersion: 1; readonly results: readonly WatchRunReport[]; } /** * Dispatcher handler for `watch` in `src/index.ts`. `isolated` is the * global-flag extraction result: watch state is a design feature (the * persistent ring + change log), so a subcommand run under --isolated * is refused here — at parse time, before any store I/O. Help surfaces * (bare `watch`, `--help`) still render documentation. */ export declare function handleWatch(args: string[], outputMode: OutputMode, deps: HandlerDependencies, isolated?: boolean): Promise; //# sourceMappingURL=watch.d.ts.map