/** * Pure data-gathering query functions for CLI commands. * * Each function returns the structured data that the corresponding `run*` * handler needs for both `--json` serialization and human rendering. * No stdout/stderr writes happen here. */ import type { CliDoctor, CliStatus, SourceStatus } from "../core/cli-types.js"; import type { AvailableSource } from "../connectors/registry.js"; /** Result of `queryStatus()`. Contains everything both JSON and human paths need. */ export interface StatusQueryResult { status: CliStatus; nextSteps: string[]; } /** Result of `querySources()`. Matches the `--json` output shape exactly. */ export interface SourcesQueryResult { count: number; recommendedSource: (AvailableSource & { installed: boolean; dataState?: SourceStatus["dataState"]; lastRunOutcome?: string | null; sessionPresent?: boolean; }) | null; nextSteps: string[]; summary: { connectedCount: number; readyCount: number; manualCount: number; installedCount: number; }; sources: Array; } /** A single dataset record as returned by data-list and data-show queries. */ export interface DatasetRecord { source: string; name: string | null; authMode: "automated" | "interactive" | "legacy" | null; dataState?: SourceStatus["dataState"]; lastRunAt: string | null; path: string | null; summary: { lines: string[]; } | null; } /** Result of `queryDataList()`. Matches the `--json` output shape exactly. */ export interface DataListQueryResult { count: number; latestDataset: DatasetRecord | null; nextSteps: string[]; summary: { localCount: number; syncedCount: number; syncFailedCount: number; }; datasets: DatasetRecord[]; } /** Successful result of `queryDataShow()`. */ export interface DataShowSuccess { ok: true; source: string; name: string; path: string; summary: { lines: string[]; } | null; lastRunAt: string | null; dataState: SourceStatus["dataState"] | null; nextSteps: string[]; data: Record; datasetCount: number; } /** Not-found result of `queryDataShow()`. */ export interface DataShowNotFound { ok: false; error: "dataset_not_found"; source: string; message: string; nextSteps: string[]; datasetCount: number; /** A result file the last run left without data, when there is one. */ resultPath?: string; /** The last run's log, when the run that should have collected failed. */ logPath?: string; } /** `queryDataShow()` for an id no connector has. */ export interface DataShowUnknownSource { ok: false; error: "unknown_source"; source: string; message: string; nextSteps: string[]; suggestedSource: string | null; } /** Read-failure result of `queryDataShow()`. */ export interface DataShowReadFailed { ok: false; error: "dataset_read_failed"; source: string; path: string; message: string; } export type DataShowQueryResult = DataShowSuccess | DataShowNotFound | DataShowUnknownSource | DataShowReadFailed; /** Result of `queryDoctor()`. Matches the `CliDoctor` type exactly. */ export type DoctorQueryResult = CliDoctor; /** * Gather status data for `vana status`. * * Returns the full `CliStatus` plus computed `nextSteps`. * The `--json` handler selects the compact subset it needs. */ export declare function queryStatus(): Promise; /** * Gather sources data for `vana sources`. * * Returns the enriched source list with counts and recommendations. */ export declare function querySources(): Promise; /** * Gather dataset list for `vana data list`. * * Returns all collected datasets with summaries and counts. */ export declare function queryDataList(): Promise; /** * Gather data for `vana data show `. * * Returns the dataset contents and metadata, or an error descriptor. */ export declare function queryDataShow(source: string): Promise; /** * Gather diagnostic data for `vana doctor`. * * Returns the full `CliDoctor` payload. */ export declare function queryDoctor(): Promise; //# sourceMappingURL=queries.d.ts.map