export interface FilesConfig { /** Master switch. When false/absent, no file routes are registered. */ enabled: boolean; /** * Drop-zone directory holding uploaded files, their per-file DuckDB * databases, and sidecar manifests. Created on demand. Default: * `/toolplex-app-files`. */ dir?: string; /** * Auto-delete an uploaded file (and its DuckDB db) this many minutes after * upload. The desktop treats files as session-scoped; this is the * backstop sweep for abandoned uploads. Default: 1440 (24 hours). */ ttlMinutes?: number; /** Reject uploads larger than this. Default: 100 MB. */ maxUploadBytes?: number; /** Hard cap on rows returned by a single query. Default: 1000. */ maxQueryRows?: number; /** * Hard cap on the serialized byte size of a query result. Rows are dropped * (and `truncated` set) until the payload fits. Default: 512 KB. */ maxResultBytes?: number; /** Per-query wall-clock timeout in ms. Default: 15000. */ queryTimeoutMs?: number; /** Sample rows embedded per table in the manifest. Default: 5. */ manifestSampleRows?: number; /** * Max ingests running concurrently in this process. Excess uploads are * rejected with 503 rather than queued, bounding peak memory (the main * lever against zip-bomb / many-large-file memory exhaustion). Default: 4. */ maxConcurrentIngests?: number; /** * Cap on the total bytes held in the drop dir. A new upload that would * exceed it triggers an eager TTL sweep; if still over, it's rejected with * 507. Bounds disk usage between sweeps. Default: 2 GB. */ maxTotalBytes?: number; /** * Reject a file whose ingested table exceeds this row count. Prevents * absurdly large tables reaching the query layer. Default: 2,000,000. */ maxIngestRows?: number; } /** Resolved config with defaults applied — what the store actually uses. */ export interface ResolvedFilesConfig { dir: string; ttlMinutes: number; maxUploadBytes: number; maxQueryRows: number; maxResultBytes: number; queryTimeoutMs: number; manifestSampleRows: number; maxConcurrentIngests: number; maxTotalBytes: number; maxIngestRows: number; } export interface FileColumn { /** Column name — the identifier the agent uses in SQL. */ name: string; /** DuckDB-inferred type, e.g. "BIGINT", "VARCHAR", "DATE", "DOUBLE". */ type: string; } export interface FileTableManifest { /** * SQL table name the agent queries. For CSV this is always `data`; for * XLSX it is the sanitized sheet name (or `sheet1`, `sheet2`, … on * collision / empty names — see `sheetName` for the original label). */ name: string; /** Original worksheet name (XLSX only). */ sheetName?: string; rowCount: number; columns: FileColumn[]; /** First N rows, value-normalized and length-capped for compactness. */ sampleRows: Record[]; } export interface FileManifest { fileId: string; filename: string; kind: "csv" | "tsv" | "xlsx"; sizeBytes: number; tables: FileTableManifest[]; /** ISO timestamp of ingestion. */ createdAt: string; /** * Non-fatal ingestion notes surfaced to the agent — e.g. "types could not * be inferred; all columns are text" or "skipped empty sheet 'Notes'". */ notes?: string[]; } export interface FileQueryResult { columns: FileColumn[]; rows: Record[]; /** Rows returned after caps applied. */ rowCount: number; /** True when the result was capped by row count or byte size. */ truncated: boolean; } //# sourceMappingURL=types.d.ts.map