import type { SourceExportReceipt } from "./source-export.js"; export interface StoredSourceState { exportReceipt?: SourceExportReceipt; connectorInstalled?: boolean; connectorVersion?: string; exportFrequency?: string; sessionPresent?: boolean; lastRunAt?: string | null; lastRunOutcome?: string | null; lastCollectedAt?: string; dataState?: string | null; lastError?: string | null; lastResultPath?: string | null; lastLogPath?: string | null; connectionHealth?: "healthy" | "needs_reauth" | "error" | "stale"; connectionHealthChangedAt?: string; connectionHealthReason?: string; connectionHealthRetryable?: boolean; ingestScopes?: Array<{ scope: string; status: "stored" | "failed"; syncedAt?: string; error?: string; }>; /** Streams a Collection Profile run skipped; their earlier data was kept. */ skippedStreams?: Array<{ stream?: string; reason?: string; message?: string; }>; } /** * A Collection Profile connector registered from a directory on this machine * with `vana connectors add`. It runs unsigned source through tsx, so the * path is kept absolute and every run names it. */ export interface LocalConnectorEntry { /** Absolute path of the directory holding `connectors//`. */ path: string; addedAt: string; displayName: string; version: string; /** `git rev-parse HEAD` at add time; absent when the directory is not a repo. */ gitHead?: string; /** The manifest's `capabilities.human_interaction`, when declared. */ humanInteraction?: string[]; } export interface CliConfig { personalServerUrl?: string; skillsPromptCompleted?: boolean; telemetryEnabled?: boolean; telemetryInstallId?: string; /** Local Collection Profile connectors, keyed by connector key. */ localConnectors?: Record; } /** How one source fared in a scheduled `collect --all`. */ export type ScheduledSourceOutcome = "ok" | "collect_failed" | "sync_failed" | "sync_pending"; /** * The last scheduled `collect --all`. A scheduler shows nobody its output, * so this is the only place a failing night can surface (`vana status`). */ export interface ScheduledRunRecord { startedAt: string; finishedAt: string; exitCode: number; /** The log the job appends to, inside this state's home. */ logPath: string; sources: Array<{ source: string; outcome: ScheduledSourceOutcome; error?: string; }>; } export interface CliStateFile { version: 1; config?: CliConfig; sources: Record; lastScheduledRun?: ScheduledRunRecord; } export declare function readCliState(): Promise; type SourceExportGuard = { publish: SourceExportReceipt; } | { settle: string; }; export declare function updateSourceState(source: string, patch: StoredSourceState): Promise; export declare function updateSourceState(source: string, patch: StoredSourceState, exportGuard: SourceExportGuard): Promise; export declare function readCliConfig(): Promise; export declare function updateCliConfig(patch: Partial): Promise; export declare function recordScheduledRun(record: ScheduledRunRecord): Promise; export declare function ensureParentDir(filePath: string): Promise; export declare function __setStateStoreTestHooks(hooks: { beforeRead?: () => Promise | void; beforeWrite?: () => Promise | void; } | undefined): void; export {}; //# sourceMappingURL=state-store.d.ts.map