import type { ProcessRunner } from "../providers/process.js"; import type { ServiceManager } from "./service-plan.js"; import { type GeneratedUserSchedule } from "./user-plan.js"; export interface UserScheduleInstallationArtifact { readonly relative_path: string; readonly installed_path: string | null; readonly sha256: string; } interface UserScheduleInstallationRecordBase { readonly manager: ServiceManager; readonly plan_sha256: string; readonly manager_executable_path: string; readonly home_directory: string; readonly user_id: number | null; readonly installed_at: string; readonly artifacts: readonly UserScheduleInstallationArtifact[]; } export interface UserScheduleInstallationRecord extends UserScheduleInstallationRecordBase { readonly schema_version: 2; readonly executable_path: string; readonly environment_path: string; readonly state_root: string; readonly workspace_root: string; readonly repository: string; readonly github_poll_seconds: number; } export type InstalledUserSchedulePlanBinding = Readonly<{ schema_version: 1; manager: ServiceManager; }> | Readonly>; export interface UserScheduleLifecycleOptions { readonly generated: GeneratedUserSchedule; readonly packageRoot: string; readonly homeDirectory: string; readonly installationsRoot: string; readonly managerExecutablePath: string; readonly runner?: ProcessRunner; readonly env?: NodeJS.ProcessEnv; } export interface UserScheduleStatus { readonly state: "absent" | "installed" | "drifted"; readonly manager: ServiceManager; readonly plan_sha256: string; readonly recorded: boolean; readonly artifacts_exact: boolean; readonly active: boolean; } export declare function readInstalledUserSchedulePlanBinding(options: { readonly installationsRoot: string; readonly packageRoot: string; }): InstalledUserSchedulePlanBinding | undefined; export declare function installUserSchedule(options: UserScheduleLifecycleOptions & { readonly clock?: () => string; }): Readonly<{ status: "installed" | "replayed"; record: UserScheduleInstallationRecord; }>; export declare function statusUserSchedule(options: UserScheduleLifecycleOptions): UserScheduleStatus; export declare function removeUserSchedule(options: UserScheduleLifecycleOptions): Readonly<{ removed: boolean; }>; export {};