import { z } from "zod"; import type { JsonCodec } from "../ports/codec.js"; import type { FileSystem } from "../ports/filesystem.js"; import type { GitClient } from "../ports/git.js"; import type { DaemonJobScheduler } from "./daemon-job-scheduler.js"; import type { DaemonWorkerPool } from "./daemon-worker-pool.js"; import type { DaemonControlPlane } from "./daemon-control-plane.js"; import type { WorkspaceBindRequest } from "./workspace-router.js"; export declare const CONTROL_PLANE_DIR = "control-plane"; export declare const MONITORS_FILE = "monitors.json"; export declare const DEFAULT_POLL_INTERVAL_MS = 5000; export type MonitorLifecycleState = "running" | "paused" | "stopped"; export type MonitorHealth = "ok" | "lagging" | "error" | "unauthorized" | "paused" | "stopped"; export type MonitorWorkerKind = "git_poll_indexer"; export type MonitorAction = "start" | "pause" | "resume" | "stop" | "nudge"; export declare const persistedMonitorSchema: z.ZodObject<{ repoId: z.ZodString; gitCommonDir: z.ZodString; anchorWorktreeRoot: z.ZodString; workerKind: z.ZodLiteral<"git_poll_indexer">; lifecycleState: z.ZodEnum<{ running: "running"; paused: "paused"; stopped: "stopped"; }>; health: z.ZodEnum<{ error: "error"; ok: "ok"; paused: "paused"; stopped: "stopped"; lagging: "lagging"; unauthorized: "unauthorized"; }>; pollIntervalMs: z.ZodNumber; lastStartedAt: z.ZodNullable; lastTickAt: z.ZodNullable; lastSuccessAt: z.ZodNullable; lastError: z.ZodNullable; lastIndexedCommit: z.ZodNullable; lastHeadCommit: z.ZodNullable; backlogCommits: z.ZodNumber; lastRunCommitsIndexed: z.ZodNumber; lastRunPatchesWritten: z.ZodNumber; }, z.core.$strict>; export declare const persistedMonitorStateSchema: z.ZodObject<{ version: z.ZodLiteral<1>; monitors: z.ZodArray; lifecycleState: z.ZodEnum<{ running: "running"; paused: "paused"; stopped: "stopped"; }>; health: z.ZodEnum<{ error: "error"; ok: "ok"; paused: "paused"; stopped: "stopped"; lagging: "lagging"; unauthorized: "unauthorized"; }>; pollIntervalMs: z.ZodNumber; lastStartedAt: z.ZodNullable; lastTickAt: z.ZodNullable; lastSuccessAt: z.ZodNullable; lastError: z.ZodNullable; lastIndexedCommit: z.ZodNullable; lastHeadCommit: z.ZodNullable; backlogCommits: z.ZodNumber; lastRunCommitsIndexed: z.ZodNumber; lastRunPatchesWritten: z.ZodNumber; }, z.core.$strict>>; }, z.core.$strict>; export type PersistedMonitorRecord = z.infer; export type PersistedMonitorState = z.infer; export interface MonitorTimerEntry { readonly timeout: ReturnType; } export interface MonitorStatusView { readonly repoId: string; readonly gitCommonDir: string; readonly anchorWorktreeRoot: string; readonly authorizedWorkspaces: number; readonly workerKind: MonitorWorkerKind; readonly lifecycleState: MonitorLifecycleState; readonly health: MonitorHealth; readonly pollIntervalMs: number; readonly lastStartedAt: string | null; readonly lastTickAt: string | null; readonly lastSuccessAt: string | null; readonly lastError: string | null; readonly lastIndexedCommit: string | null; readonly lastHeadCommit: string | null; readonly backlogCommits: number; readonly lastRunCommitsIndexed: number; readonly lastRunPatchesWritten: number; } export interface MonitorActionResult { readonly ok: boolean; readonly action: MonitorAction; readonly created: boolean; readonly changed: boolean; readonly status?: MonitorStatusView; readonly errorCode?: string; readonly error?: string; } export interface MonitorStartRequest extends WorkspaceBindRequest { readonly pollIntervalMs?: number | undefined; } export interface PersistentMonitorRuntimeOptions { readonly fs: FileSystem; readonly codec: JsonCodec; readonly git: GitClient; readonly graftDir: string; readonly controlPlane: DaemonControlPlane; readonly scheduler: DaemonJobScheduler; readonly workerPool: DaemonWorkerPool; readonly defaultPollIntervalMs?: number | undefined; } //# sourceMappingURL=monitor-types.d.ts.map