import { type QualityProfile } from '../utils/visual-profile.js'; import type { GroupingMode } from '../vectordb/index.js'; /** * Delegates to `checkSensitivePath`, so the CLI and MCP entry points share one * policy. Returns an error message, or `undefined` when valid. */ export declare function validatePath(value: string, flagName: string): string | undefined; /** * Validate model name against allowed pattern. * Returns an error message if invalid, or undefined if valid. */ export declare function validateModelName(value: string): string | undefined; /** * Validate max file size is within acceptable range. * Returns an error message if invalid, or undefined if valid. */ export declare function validateMaxFileSize(value: number): string | undefined; /** * Validate chunk minimum length is within acceptable range. * Returns an error message if invalid, or undefined if valid. */ export declare function validateChunkMinLength(value: number): string | undefined; /** * Consume the value after a `--base-dir` and append it to `collected`, so the * flag can repeat with its order preserved. Returns the value's index, or * exits 1 when the value is missing. * * Shared because `ingest`, `list` and `sync` must stay in lockstep here. */ export declare function consumeBaseDirArg(argv: string[], flagIndex: number, collected: string[]): number; /** * Read the required value after a value-taking flag, exiting 1 when the next * token is absent or is itself a flag. The caller advances by 2. Numeric flags * validate the returned string themselves. */ export declare function requireFlagValue(argv: string[], flagIndex: number, flag: string): string; /** * Read the `--visual-quality` value, exiting 1 when it is missing or outside * the profile vocabulary. Shared by `ingest` and `sync` so both subcommands * accept and reject exactly the same values with the same message. */ export declare function requireVisualQuality(argv: string[], flagIndex: number): QualityProfile; export interface GlobalOptions { dbPath?: string | undefined; cacheDir?: string | undefined; modelName?: string | undefined; } export interface ParsedGlobalResult { globalOptions: GlobalOptions; remainingArgs: string[]; } export interface ResolvedGlobalConfig { dbPath: string; cacheDir: string; modelName: string; /** Search tuning, read from the same environment variables the MCP server uses. */ maxDistance?: number; grouping?: GroupingMode; maxFiles?: number; hybridWeight?: number; } export declare const GLOBAL_DEFAULTS: { readonly dbPath: './lancedb/'; readonly cacheDir: './models/'; readonly modelName: 'Xenova/all-MiniLM-L6-v2'; }; export declare const ROOT_HELP_TEXT: string; /** * Extract global options, which are recognized only BEFORE the subcommand. * Everything after it is forwarded as-is. */ export declare function parseGlobalOptions(args: string[]): ParsedGlobalResult; /** * Resolve global config with priority: CLI flags > environment variables > defaults. * Validates all resolved values before returning. */ /** Result of parsing an environment variable. */ export interface ParseResult { value: T | undefined; warning?: string; } /** Parse `RAG_GROUPING`. */ export declare function parseGroupingMode(value: string | undefined): ParseResult; /** Parse `RAG_MAX_DISTANCE`. */ export declare function parseMaxDistance(value: string | undefined): ParseResult; /** Parse `RAG_MAX_FILES`. */ export declare function parseMaxFiles(value: string | undefined): ParseResult; /** * Parse an on/off environment variable. Unset or empty is off; an * unrecognized value is off with a warning naming `name`. */ export declare function parseBooleanEnv(name: string, value: string | undefined): { value: boolean; warning?: string; }; /** Parse `RAG_HYBRID_WEIGHT`. */ export declare function parseHybridWeight(value: string | undefined): ParseResult; export declare function resolveGlobalConfig(options: GlobalOptions): ResolvedGlobalConfig; /** * Resolve RAG_DEVICE. The value is passed through to transformers.js — no * allowlist is maintained here. Whitespace-only is treated as unset. */ export declare function resolveDevice(value: string | undefined): string; /** * Resolve RAG_DTYPE, passed through with no allowlist like RAG_DEVICE. Unset * resolves to `undefined`, NOT a default: that is the only signal separating * "unset" from an explicit `RAG_DTYPE=fp32`, and it gates the failure-path * error enrichment. The fp32 default lives in `Embedder.initialize()` alone. */ export declare function resolveDtype(value: string | undefined): string | undefined; //# sourceMappingURL=options.d.ts.map