trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
40 lines • 1.4 kB
TypeScript
/**
* Trellis Server — Data Import
*
* Ingest records from CSV, JSON, NDJSON, and Parquet files into the kernel.
* Each row becomes a Trellis entity of the given type.
*
* @module trellis/server
*/
import type { TrellisKernel } from '../core/kernel/trellis-kernel.js';
export interface ImportOptions {
/** Entity type to assign to every imported record. */
type: string;
/** Optional: field to use as entity ID. Defaults to auto-generated UUIDs. */
idField?: string;
/** Optional: prefix for generated entity IDs. Default: `import:` */
idPrefix?: string;
/** Skip rows where this field is falsy. */
skipEmpty?: boolean;
/** Max rows to import (useful for testing). */
limit?: number;
}
export interface ImportResult {
imported: number;
skipped: number;
errors: Array<{
row: number;
message: string;
}>;
entityIds: string[];
}
/**
* Import data from a file into the kernel.
* Format is inferred from the file extension.
*/
export declare function importFile(kernel: TrellisKernel, filePath: string, opts: ImportOptions): Promise<ImportResult>;
/**
* Import from an array of plain objects directly (useful for programmatic use).
*/
export declare function importRecords(kernel: TrellisKernel, records: Record<string, unknown>[], opts: ImportOptions): Promise<ImportResult>;
//# sourceMappingURL=import.d.ts.map