/** * Studio-internal data-engine orchestration types. The public engine contract * ({@link AgDataEngine}) and its direct dependencies ({@link AgExecuteRequest}, * {@link AgRequestOptions}, {@link AgResultShape}, {@link AgEngineCallInfo}) live in * `@api/agDataEngine`. This file owns result shapes and event types that are * used by the Studio layer but never cross the engine boundary. */ import type { Primitive } from '../api/agDataType'; import type { StudioError } from './validation'; /** * Per-result metadata. `rowCount` lives here — it is the canonical record of * how many rows the result carries. `totalRowCount` is the size before any * `limit` was applied. */ export interface ResultMetadata { rowCount: number; /** Total row count before any Limit operation was applied. Equals `rowCount` when no limit is used. */ totalRowCount?: number; } export interface RowsResult { shape: 'rows'; rows: Record[]; metadata: ResultMetadata; } export interface ColumnsResult { shape: 'columns'; columns: Map>; metadata: ResultMetadata; } export type ExecuteResult = RowsResult | ColumnsResult; export interface AgDataEngineValidationEvent { type: 'validation'; issues: StudioError[]; }