latticesql 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1731,6 +1731,97 @@ declare function openUnderSource(ciphertext: string, sourceId: string, store: So
1731
1731
  */
1732
1732
  declare function shredSource(sourceId: string, store: SourceKeyStore): void;
1733
1733
 
1734
+ /**
1735
+ * Progress reporting for the render engine.
1736
+ *
1737
+ * A render walks every table and every per-entity context file; for a large
1738
+ * database this can take a while. These types let a caller observe progress
1739
+ * (per-table %, which table is in flight) and cancel a render in progress via
1740
+ * an `AbortSignal`. All of it is optional: a render with no `onProgress` and no
1741
+ * `signal` behaves exactly as it did before — zero overhead, identical output.
1742
+ */
1743
+ /** The kind of progress event the render engine emits. */
1744
+ type RenderProgressKind = 'table-start' | 'table-progress' | 'table-done' | 'done' | 'error';
1745
+ /**
1746
+ * A single progress event. Fields beyond `kind` describe the table currently
1747
+ * being rendered (`table`, `tableIndex`, `tableCount`) and how far along it is
1748
+ * (`entitiesRendered`, `entitiesTotal`, `pct`). `durationMs` is set on the
1749
+ * terminal `done` event; `message` carries human-readable detail (e.g. the
1750
+ * error text on an `error` event).
1751
+ */
1752
+ interface RenderProgress {
1753
+ /** Discriminator: what stage of the render this event reports. */
1754
+ kind: RenderProgressKind;
1755
+ /** The table being rendered, or null for non-table events (`done`/`error`). */
1756
+ table: string | null;
1757
+ /** Entities rendered so far within `table` (per-table running count). */
1758
+ entitiesRendered: number;
1759
+ /** Total entities in `table` — the denominator for the per-table %. */
1760
+ entitiesTotal: number;
1761
+ /** Zero-based index of `table` among the entity-context tables. */
1762
+ tableIndex: number;
1763
+ /** Total number of entity-context tables in this render. */
1764
+ tableCount: number;
1765
+ /** Per-table completion percentage, 0–100, exact (`rendered/total`). */
1766
+ pct: number;
1767
+ /** Wall-clock duration of the whole render, set on the `done` event. */
1768
+ durationMs?: number;
1769
+ /** Human-readable detail; the error text on an `error` event. */
1770
+ message?: string;
1771
+ }
1772
+ /** Sink the render engine pushes {@link RenderProgress} events into. */
1773
+ type RenderProgressCallback = (event: RenderProgress) => void;
1774
+ /**
1775
+ * Optional knobs for a render. Both are opt-in:
1776
+ * - `onProgress` — observe per-table render progress.
1777
+ * - `signal` — cancel a render in flight; the engine bails between entities and
1778
+ * returns the partial manifest (which the caller is expected to discard).
1779
+ */
1780
+ interface RenderOptions {
1781
+ onProgress?: RenderProgressCallback;
1782
+ signal?: AbortSignal;
1783
+ }
1784
+ /**
1785
+ * Coalesces high-frequency `table-progress` events down to ≤ ~5/sec per table,
1786
+ * while always passing through the lifecycle events (`table-start`,
1787
+ * `table-done`, `done`, `error`) immediately.
1788
+ *
1789
+ * A render over a 6,760-row table would otherwise emit thousands of
1790
+ * `table-progress` events; this caps it at a few dozen. The throttle lives in
1791
+ * the engine so every consumer benefits and no per-entity object crosses the
1792
+ * progress boundary more than ~5×/sec.
1793
+ *
1794
+ * The 200 ms window is reset on every `table-start` (via {@link force}), so each
1795
+ * table gets its own fresh budget and the first progress tick of a new table is
1796
+ * not suppressed by the previous table's last tick.
1797
+ */
1798
+ declare class ProgressThrottle {
1799
+ private readonly cb;
1800
+ private readonly windowMs;
1801
+ /**
1802
+ * Last passthrough time, keyed per table (`event.table`, or `''` for the
1803
+ * table-less `done`/`error` lifecycle events). Per-table — not a single shared
1804
+ * clock — so when tables render CONCURRENTLY each one keeps its own ~5/sec
1805
+ * budget: a fast table can't consume the window and starve a slow table's
1806
+ * progress. `force` (table-start) resets only that table's budget.
1807
+ */
1808
+ private readonly lastEmit;
1809
+ constructor(cb: RenderProgressCallback | undefined, windowMs?: number);
1810
+ /**
1811
+ * Emit a `table-progress` event, but only if the window since this table's
1812
+ * last passthrough has elapsed. Dropped events are simply not delivered — the
1813
+ * next one that survives carries the latest running count.
1814
+ */
1815
+ tick(event: RenderProgress): void;
1816
+ /**
1817
+ * Emit a lifecycle event immediately and reset this table's throttle window.
1818
+ * Use for `table-start`, `table-done`, `done`, and `error` — none of which
1819
+ * should ever be dropped. Resetting on `table-start` gives each table a clean
1820
+ * budget.
1821
+ */
1822
+ force(event: RenderProgress): void;
1823
+ }
1824
+
1734
1825
  /**
1735
1826
  * Initialise Lattice from a YAML config file instead of an explicit path.
1736
1827
  *
@@ -1994,6 +2085,34 @@ declare class Lattice {
1994
2085
  */
1995
2086
  private _assertIdent;
1996
2087
  insert(table: string, row: Row, provenance?: ChangeProvenance): Promise<string>;
2088
+ /**
2089
+ * Insert a row while atomically forcing its cloud row-visibility, regardless of
2090
+ * the table's `default_row_visibility`. The per-table insert trigger reads a
2091
+ * transaction-local GUC (`lattice.force_row_visibility`); we set it and run the
2092
+ * INSERT inside a single transaction, so the row is stamped at `visibility` the
2093
+ * instant it exists — it is never momentarily visible at the table default, and
2094
+ * the change-feed `NOTIFY` (delivered only at COMMIT) fires when the row already
2095
+ * carries this visibility. This closes the create-then-demote window that a
2096
+ * plain `insert()` + `setRowVisibility()` would leave open.
2097
+ *
2098
+ * Postgres-only: SQLite is single-user (no cross-viewer leak) and has no trigger
2099
+ * to read the GUC, so it degrades to a plain {@link insert}. A `never_share`
2100
+ * table still wins — its rows are forced private even if `visibility` is
2101
+ * `'everyone'` (the trigger enforces that precedence).
2102
+ *
2103
+ * @since 3.1.0
2104
+ */
2105
+ insertForcingVisibility(table: string, row: Row, visibility: 'private' | 'everyone', provenance?: ChangeProvenance): Promise<string>;
2106
+ /**
2107
+ * Build the INSERT statement + canonical pk for a row (sanitize → schema-filter →
2108
+ * auto-pk → encrypt). Shared by {@link insert} and {@link insertForcingVisibility}
2109
+ * so both produce byte-identical writes; the latter only differs in running it
2110
+ * inside a GUC-scoped transaction.
2111
+ */
2112
+ private _prepareInsert;
2113
+ /** Post-insert side effects (changelog, audit, write hooks, embedding sync),
2114
+ * identical for the plain and force-visibility insert paths. */
2115
+ private _afterInsert;
1997
2116
  /**
1998
2117
  * Insert a row and return the full inserted row (including auto-generated
1999
2118
  * fields and defaults). Equivalent to `insert()` followed by `get()`.
@@ -2120,7 +2239,22 @@ declare class Lattice {
2120
2239
  search(table: string, query: string, opts?: SearchOptions): Promise<SearchResult[]>;
2121
2240
  query(table: string, opts?: QueryOptions): Promise<Row[]>;
2122
2241
  count(table: string, opts?: CountOptions): Promise<number>;
2123
- render(outputDir: string): Promise<RenderResult>;
2242
+ render(outputDir: string, opts?: RenderOptions): Promise<RenderResult>;
2243
+ /**
2244
+ * Render into `outputDir` through the shared single-flight guard, intended to
2245
+ * be called fire-and-forget (e.g. the GUI's instant-open background render).
2246
+ *
2247
+ * The guard ({@link _renderGuarded}) holds {@link _autoRenderInFlight} for the
2248
+ * render's duration, so a data mutation that lands while this render is in
2249
+ * flight is deferred by {@link _runAutoRender} and coalesced — when this
2250
+ * render settles, `finally` clears the flag and re-arms exactly one follow-up
2251
+ * render via {@link _rearmAutoRenderIfPending}. Net invariant: at most one
2252
+ * render to a given dir at a time.
2253
+ *
2254
+ * Errors propagate to the caller (the GUI surfaces them, never silently swallowed); they are
2255
+ * not swallowed here.
2256
+ */
2257
+ renderInBackground(outputDir: string, opts?: RenderOptions): Promise<RenderResult>;
2124
2258
  sync(outputDir: string): Promise<SyncResult>;
2125
2259
  /**
2126
2260
  * Recover rows from rendered files into empty database tables.
@@ -2236,6 +2370,17 @@ declare class Lattice {
2236
2370
  /** Turn off automatic rendering and cancel any pending render. */
2237
2371
  disableAutoRender(): this;
2238
2372
  private _scheduleAutoRender;
2373
+ /**
2374
+ * Shared single-flight render path used by {@link renderInBackground}.
2375
+ *
2376
+ * Holds {@link _autoRenderInFlight} for the render's duration so the
2377
+ * mutation-driven {@link _runAutoRender} defers while this render runs (it
2378
+ * sees the flag and marks itself pending instead of starting a second,
2379
+ * overlapping render). On settle, `finally` clears the flag and re-arms a
2380
+ * single coalesced follow-up render if any mutation arrived mid-flight.
2381
+ * Errors propagate to the caller; the flag is always cleared.
2382
+ */
2383
+ private _renderGuarded;
2239
2384
  private _runAutoRender;
2240
2385
  private _rearmAutoRenderIfPending;
2241
2386
  /**
@@ -3904,10 +4049,10 @@ declare function isPostgresUrl(url: string): boolean;
3904
4049
  * `CREATE OR REPLACE FUNCTION`). Multi-statement — Postgres-only, so it never hits
3905
4050
  * the single-statement SQLite migration path.
3906
4051
  *
3907
- * NOTE (follow-up): the `SECURITY DEFINER` helpers below should pin `search_path`
3908
- * to the cloud schema to fully close the definer-search_path class of issue. Today
3909
- * members are `NOSUPERUSER` without CREATE on the schema, so they cannot plant a
3910
- * shadowing object; the pin is hardening, tracked for the schema-awareness pass.
4052
+ * Every `SECURITY DEFINER` helper below gets `search_path` pinned at install time
4053
+ * via {@link pinDefinerSearchPath} (see its doc for the threat it closes). The pin
4054
+ * is applied in {@link installCloudRls}, not baked into the literal here, because
4055
+ * the cloud's schema name is only known at runtime (`current_schema()`).
3911
4056
  */
3912
4057
  /**
3913
4058
  * Group role every cloud member inherits. Table privileges are granted to the
@@ -3923,14 +4068,31 @@ declare function installCloudRls(db: Lattice): Promise<void>;
3923
4068
  * only what they're allowed to: a DERIVED observation only when it can reach
3924
4069
  * EVERY source it was derived from (so a hidden enrichment never reaches the
3925
4070
  * member — existence-hiding is structural), and a ground-truth / audit entry
3926
- * only for a row that is itself visible to the member. Both predicates route
3927
- * through the `session_user`-keyed SECURITY DEFINER helpers, so they bind to the
3928
- * real member. `FORCE ROW LEVEL SECURITY` applies the policy even to the table
3929
- * owner. No-op on SQLite (single-user; no cross-viewer leak to guard). Run after
3930
- * the change-log table exists (`Lattice.ensureObservationSubstrate`).
4071
+ * only when the member OWNS the row it records. Both predicates route through the
4072
+ * `session_user`-keyed SECURITY DEFINER helpers, so they bind to the real member.
4073
+ * `FORCE ROW LEVEL SECURITY` applies the policy even to the table owner. No-op on
4074
+ * SQLite (single-user; no cross-viewer leak to guard). Run after the change-log
4075
+ * table exists (`Lattice.ensureObservationSubstrate`).
4076
+ *
4077
+ * Ground-truth entries are OWNER-ONLY (v2), not merely "row is visible". A
4078
+ * changelog row carries the full `changes`/`previous` JSON of the underlying row —
4079
+ * EVERY column in cleartext, including ones the `<table>_v` mask hides from a
4080
+ * non-owner (an `owner`-audience secret column, a role-gated column). If a member
4081
+ * who was merely granted the row could read its history, those masked columns
4082
+ * would leak in cleartext, bypassing column masking. The row's full mutation
4083
+ * history is an owner/audit artifact; a non-owner sees the row only through the
4084
+ * masked view, never its raw history. (The derived-observation branch is the
4085
+ * per-viewer enrichment path and is unaffected — it carries enrichment, not the
4086
+ * base row's masked columns.)
3931
4087
  */
3932
4088
  declare function enableChangelogRls(db: Lattice): Promise<void>;
3933
- /** Enable RLS on one shared table. No-op on SQLite. Idempotent via a per-table version key. */
4089
+ /**
4090
+ * Enable RLS on one shared table. No-op on SQLite. Idempotent via a per-table
4091
+ * version key. v3 bumps the key so existing clouds re-install the policy-aware
4092
+ * insert trigger (which now stamps the per-table `default_row_visibility` / forces
4093
+ * private under `never_share`) and pick up the `search_path` pin on the trigger
4094
+ * function — neither of which a v2-stamped clone would otherwise get.
4095
+ */
3934
4096
  declare function enableRlsForTable(db: Lattice, table: string, pkCols: readonly string[]): Promise<void>;
3935
4097
  /**
3936
4098
  * Stamp the current role as owner of every row that already exists in a table —
@@ -4008,6 +4170,11 @@ interface DiscoveredTable {
4008
4170
  */
4009
4171
  declare function discoverCloudTables(db: Lattice): Promise<DiscoveredTable[]>;
4010
4172
 
4173
+ /** Row context the `owner` clause needs (the table literal + pk SQL expression). */
4174
+ interface AudienceRowCtx {
4175
+ tableLit: string;
4176
+ pkExpr: string;
4177
+ }
4011
4178
  /** True when this audience means "no mask" (visible to whoever can see the row). */
4012
4179
  declare function isRowAudience(audience: string | undefined): boolean;
4013
4180
  /**
@@ -4015,7 +4182,7 @@ declare function isRowAudience(audience: string | undefined): boolean;
4015
4182
  * functions. Returns `'true'` for the row-audience / everyone case. Throws on an
4016
4183
  * unknown or malformed clause.
4017
4184
  */
4018
- declare function audiencePredicate(audience: string): string;
4185
+ declare function audiencePredicate(audience: string, ctx?: AudienceRowCtx): string;
4019
4186
  /** Whether a table needs a masking view at all (any column has a real audience). */
4020
4187
  declare function tableNeedsAudienceView(columnAudience: Record<string, string>): boolean;
4021
4188
  /**
@@ -4047,6 +4214,54 @@ declare function audienceViewSql(table: string, columns: readonly string[], pkCo
4047
4214
  * visibility helper and revokes the base SELECT that enableRlsForTable granted).
4048
4215
  */
4049
4216
  declare function enableAudienceView(db: Lattice, table: string, columns: readonly string[], pkCols: readonly string[], columnAudience: Record<string, string>): Promise<void>;
4217
+ /** Read a table's canonical column->audience map from __lattice_column_policy. */
4218
+ declare function loadColumnPolicy(db: Lattice, table: string): Promise<Record<string, string>>;
4219
+ /** Seed a table's YAML-declared audiences into __lattice_column_policy — ONE TIME
4220
+ * per table, the migration from the legacy on-disk spec to the DB-canonical store.
4221
+ * A marker in __lattice_migrations gates it: after the first run we never seed from
4222
+ * YAML again, because a later secureCloud would otherwise re-insert a policy row
4223
+ * for a column the owner has since CLEARED through the DB (a cleared column has no
4224
+ * row, so ON CONFLICT DO NOTHING would NOT protect it) — silently re-masking a
4225
+ * column the owner deliberately un-masked. Once seeded, the DB is canonical and
4226
+ * the only path to change a column's audience is setColumnAudience. */
4227
+ declare function seedColumnPolicyFromYaml(db: Lattice, table: string, yamlAudience: Record<string, string>): Promise<void>;
4228
+ /** Regenerate a table's cell-masking view FROM the DB column-policy (not YAML). If
4229
+ * the table now has no audience columns, drop the view and restore base SELECT to
4230
+ * members; otherwise (re)create the masked view and revoke base SELECT. Runs the
4231
+ * DDL directly (not via db.migrate) so it always reflects the current spec. */
4232
+ declare function regenerateAudienceViewFromDb(db: Lattice, table: string, columns: readonly string[], pkCols: readonly string[]): Promise<void>;
4233
+ /** Owner-only: set (or clear, with an empty spec) a column's audience in the DB and
4234
+ * regenerate the table's mask view from the DB. The owner gate is enforced inside
4235
+ * lattice_set_column_audience (raises for a non-owner). */
4236
+ declare function setColumnAudience(db: Lattice, table: string, column: string, audience: string, columns: readonly string[], pkCols: readonly string[]): Promise<void>;
4237
+
4238
+ /**
4239
+ * Per-table cloud policy (owner-controlled, Postgres-stored + enforced):
4240
+ * - `defaultRowVisibility` — the visibility NEW rows in this table are stamped
4241
+ * with (the per-table insert trigger reads `__lattice_table_policy`); default
4242
+ * `private` ⇒ unchanged behavior.
4243
+ * - `neverShare` — a hard exclusion (Secrets/Messages-class): the share/grant
4244
+ * SECURITY DEFINER functions raise for the table and the trigger forces its rows
4245
+ * private. Set at the data-model level, so a direct `psql` connection obeys it.
4246
+ *
4247
+ * These are thin wrappers over the owner-gated SQL functions in the RLS bootstrap
4248
+ * (`lattice_set_table_default_visibility` / `lattice_set_table_never_share`), which
4249
+ * raise unless the caller can create roles. No-op / safe defaults on SQLite.
4250
+ */
4251
+ type RowVisibilityDefault = 'private' | 'everyone';
4252
+ interface TablePolicy {
4253
+ defaultRowVisibility: RowVisibilityDefault;
4254
+ neverShare: boolean;
4255
+ }
4256
+ /** Read a table's policy. Returns the safe default (private, shareable) on SQLite
4257
+ * or when no policy row exists. */
4258
+ declare function getTablePolicy(db: Lattice, table: string): Promise<TablePolicy>;
4259
+ /** Owner-only: set the visibility NEW rows in `table` are created with. Raises (via
4260
+ * the SQL function) for a non-owner or for `everyone` on a never-share table. */
4261
+ declare function setTableDefaultVisibility(db: Lattice, table: string, visibility: RowVisibilityDefault): Promise<void>;
4262
+ /** Owner-only: mark (or unmark) a table never-shareable. When on, the share/grant
4263
+ * functions refuse it and its new rows are forced private. */
4264
+ declare function setTableNeverShare(db: Lattice, table: string, on: boolean): Promise<void>;
4050
4265
 
4051
4266
  /**
4052
4267
  * The per-viewer fold (the "local compile" of the per-viewer enrichment model).
@@ -4130,19 +4345,6 @@ declare class FoldCache {
4130
4345
  get size(): number;
4131
4346
  }
4132
4347
 
4133
- /**
4134
- * Turn a Postgres database into a secured Lattice cloud, in place: install the
4135
- * RLS bootstrap + the observation substrate, then for every registered user
4136
- * table stamp the current role as owner of the existing rows and force RLS (plus
4137
- * a cell-masking view for any audience columns). Idempotent and additive — safe
4138
- * to run on a fresh migration target OR on an already-populated Postgres that
4139
- * isn't a cloud yet (the "secure this cloud" cutover). No-op on SQLite.
4140
- *
4141
- * Must run as a role that owns the tables and can create roles (a cloud
4142
- * owner / DBA). `backfillOwnership` runs BEFORE `enableRlsForTable` so a
4143
- * non-superuser owner can still SELECT every row to stamp it before FORCE RLS
4144
- * filters the table to rows it already owns.
4145
- */
4146
4348
  declare function secureCloud(db: Lattice): Promise<void>;
4147
4349
 
4148
4350
  /**
@@ -4476,4 +4678,4 @@ interface PdfOptions {
4476
4678
  */
4477
4679
  declare function describePdf(auth: ClaudeAuth, path: string, opts?: PdfOptions): Promise<string>;
4478
4680
 
4479
- export { type AddWorkspaceOptions, type AdoptNativeOptions, type AdoptResult, type ApplyWriteResult, type AuditEvent, type AutoUpdateResult, type BelongsToRelation, type BelongsToSource, type BlobMetadata, type BuiltinTemplateName, CLOUD_SETTING_SYSTEM_PROMPT, CONFIG_SUBDIR, type CatalogEntity, type CatalogRecord, type ChangeEntry, type ChangelogOptions, type ClassifyMatch, type CleanupOptions, type CleanupResult, type CloudProbeResult, type CountOptions, type CrawlOptions, type CrawlResult, type CustomSource, DEFAULT_ENTRY_TYPES, DEFAULT_TYPE_ALIASES, type DiscoveredTable, type EmbeddingsConfig, type EnrichOptions, type EnrichResult, type EnrichedSource, type EnrichmentLookup, type EntityContextDefinition, type EntityContextManifestEntry, type EntityFileManifestInfo, type EntityFileSource, type EntityFileSpec, type EntityProfileField, type EntityProfileSection, type EntityProfileTemplate, type EntityRenderSpec, type EntityRenderTemplate, type EntitySectionPerRow, type EntitySectionsTemplate, type EntityTableColumn, type EntityTableTemplate, type ExtractedObject, type FilesRow, type Filter, type FilterOp, FoldCache, type FtsConfig, type FtsGroup, type FtsHit, type FtsOptions, type FtsResult, type HasManyRelation, type HasManySource, InMemorySourceKeyStore, InMemoryStateStore, type InitOptions, LOCAL_DB_RELPATH, Lattice, type LatticeConfig, type LatticeConfigInput, type LatticeEntityDef, type LatticeEntityRenderSpec, type LatticeFieldDef, type LatticeFieldType, type LatticeManifest, type LatticeOptions, type LinkOptions, type LlmClient, type LlmMessage, MEMBER_GROUP, type ManyToManySource, type MarkdownTableColumn, type MigrateResult, type Migration, type MigrationOptions, type MigrationProgress, type MigrationResult, type MultiTableDefinition, NATIVE_ENTITY_DEFS, NATIVE_ENTITY_NAMES, NATIVE_REGISTRY_TABLE, type Observation, type OrderBySpec, type OrganizeOptions, type OrganizeResult, type OrganizedCreation, type OrganizedLink, type ParseError, type ParseResult, type ParsedConfig, type PdfOptions, type PdfSenderInput, type PkLookup, PostgresAdapter, type PostgresAdapterOptions, type PreparedStatement, type PrimaryKey, type QueryOptions, READ_ONLY_HEADER, ROOT_DIRNAME, type ReadOnlyHeaderOptions, type ReconcileOptions, type ReconcileResult, type RefKind, type RefProvider, type ReferenceMetadata, ReferenceUnavailableError, type Relation, type RemoteBlobStore, type RenderHooks, type RenderResult, type RenderSpec, type ReportConfig, type ReportResult, type ReportSection, type ReportSectionResult, type ResolveOptions, type ReverseSeedDetection, type ReverseSeedResult, type ReverseSeedTableResult, type ReverseSyncError, type ReverseSyncResult, type ReverseSyncUpdate, type RewardScores, type Row, type S3Config, type S3StoreConfig, S3UnavailableError, SQLiteAdapter, type SchemaEntity, type SearchOptions, type SearchResult, type SecurityOptions, type SeedConfig, type SeedLinkSpec, SeedReconciliationError, type SeedResult, type SelfSource, type SessionEntry, type SessionParseOptions, type SessionWriteEntry, type SessionWriteOp, type SessionWriteParseResult, type SourceHandle, type SourceKeyStore, type SourceMetadata, type SourceQueryOptions, SourceShreddedError, type StopFn, type StorageAdapter, type SyncResult, type TableDefinition, type TemplateRenderSpec, type TurnParams, type TurnResult, type UnresolvedLink, type UpsertByNaturalKeyOptions, type UserIdentity, type UserPreferences, type Viewer, type VisionOptions, type VisionSenderInput, WORKSPACES_SUBDIR, type WatchOptions, type WorkspacePaths, type WorkspaceRecord, type WorkspaceRegistry, type WriteHook, type WriteHookContext, type WritebackDefinition, type WritebackStateStore, type WritebackValidationResult, activeWorkspaceLabel, addWorkspace, adoptNativeEntities, analyticsEnabled, applyTokenBudget, applyWriteEntry, archiveLocalSqlite, assertSafeUrl, attachBlob, audiencePredicate, audienceViewSql, autoFtsColumns, autoUpdate, backfillOwnership, canManageRoles, classifyLinks, cloudRlsInstalled, configDir, contentHash, crawlUrl, createReadOnlyHeader, createS3Store, createSQLiteStateStore, decrypt, defaultWorkspaceYaml, deleteDbCredential, deleteToken, deriveCanonicalContexts, deriveKey, describeImage, describePdf, discoverCloudTables, enableAudienceView, enableChangelogRls, enableRlsForTable, encrypt, enrichKnowledge, ensureFtsIndex, ensureLatticeRoot, entityFileNames, estimateTokens, extractObjects, findLatticeRoot, fixSchemaConflicts, foldEntity, frontmatter, ftsTableName, fullTextSearch, generateEntryId, generateMemberPassword, generateWriteEntryId, getActiveWorkspace, getCloudSetting, getDbCredential, getOrCreateMasterKey, getWorkspace, grantCell, hasFtsIndex, hashFile, importLegacyUserConfig, installCloudRls, installCloudSettings, isEncrypted, isNativeEntity, isPostgresUrl, isPrivateIp, isRowAudience, isV1EntityFiles, listDbCredentials, listNativeBindings, listTokens, listWorkspaces, manifestPath, markdownTable, memberRoleName, migrateLatticeData, normalizeEntityFiles, observationVisible, observationsFromChange, openTargetLatticeForMigration, openUnderSource, organizeSource, parseConfigFile, parseConfigString, parseMarkdownEntries, parseMatches, parseObjects, parseSessionMD, parseSessionWrites, probeCloud, providerForUrl, provisionMemberRole, readIdentity, readManifest, readPreferences, readRegistry, readToken, referenceLocalFile, referenceUrl, registerNativeEntities, registryPath, resolveActiveS3Config, resolveLatticeRoot, resolveSource, resolveWorkspacePaths, revokeCell, revokeMemberRole, rootConfigDir, s3Key, saveDbCredential, saveDbCredentialForTeam, sealUnderSource, secureCloud, setActiveWorkspace, setCloudSetting, setRowVisibility, shredSource, slugify, summarizeText, tableNeedsAudienceView, toSafeDirName, truncate, validateEntryId, workspaceBlobsDir, workspaceConfigPath, workspaceContextDir, workspaceDataDir, workspaceDbPath, workspaceDir, workspacesDir, writeIdentity, writeManifest, writePreferences, writeRegistry, writeToken };
4681
+ export { type AddWorkspaceOptions, type AdoptNativeOptions, type AdoptResult, type ApplyWriteResult, type AudienceRowCtx, type AuditEvent, type AutoUpdateResult, type BelongsToRelation, type BelongsToSource, type BlobMetadata, type BuiltinTemplateName, CLOUD_SETTING_SYSTEM_PROMPT, CONFIG_SUBDIR, type CatalogEntity, type CatalogRecord, type ChangeEntry, type ChangelogOptions, type ClassifyMatch, type CleanupOptions, type CleanupResult, type CloudProbeResult, type CountOptions, type CrawlOptions, type CrawlResult, type CustomSource, DEFAULT_ENTRY_TYPES, DEFAULT_TYPE_ALIASES, type DiscoveredTable, type EmbeddingsConfig, type EnrichOptions, type EnrichResult, type EnrichedSource, type EnrichmentLookup, type EntityContextDefinition, type EntityContextManifestEntry, type EntityFileManifestInfo, type EntityFileSource, type EntityFileSpec, type EntityProfileField, type EntityProfileSection, type EntityProfileTemplate, type EntityRenderSpec, type EntityRenderTemplate, type EntitySectionPerRow, type EntitySectionsTemplate, type EntityTableColumn, type EntityTableTemplate, type ExtractedObject, type FilesRow, type Filter, type FilterOp, FoldCache, type FtsConfig, type FtsGroup, type FtsHit, type FtsOptions, type FtsResult, type HasManyRelation, type HasManySource, InMemorySourceKeyStore, InMemoryStateStore, type InitOptions, LOCAL_DB_RELPATH, Lattice, type LatticeConfig, type LatticeConfigInput, type LatticeEntityDef, type LatticeEntityRenderSpec, type LatticeFieldDef, type LatticeFieldType, type LatticeManifest, type LatticeOptions, type LinkOptions, type LlmClient, type LlmMessage, MEMBER_GROUP, type ManyToManySource, type MarkdownTableColumn, type MigrateResult, type Migration, type MigrationOptions, type MigrationProgress, type MigrationResult, type MultiTableDefinition, NATIVE_ENTITY_DEFS, NATIVE_ENTITY_NAMES, NATIVE_REGISTRY_TABLE, type Observation, type OrderBySpec, type OrganizeOptions, type OrganizeResult, type OrganizedCreation, type OrganizedLink, type ParseError, type ParseResult, type ParsedConfig, type PdfOptions, type PdfSenderInput, type PkLookup, PostgresAdapter, type PostgresAdapterOptions, type PreparedStatement, type PrimaryKey, ProgressThrottle, type QueryOptions, READ_ONLY_HEADER, ROOT_DIRNAME, type ReadOnlyHeaderOptions, type ReconcileOptions, type ReconcileResult, type RefKind, type RefProvider, type ReferenceMetadata, ReferenceUnavailableError, type Relation, type RemoteBlobStore, type RenderHooks, type RenderOptions, type RenderProgress, type RenderProgressCallback, type RenderProgressKind, type RenderResult, type RenderSpec, type ReportConfig, type ReportResult, type ReportSection, type ReportSectionResult, type ResolveOptions, type ReverseSeedDetection, type ReverseSeedResult, type ReverseSeedTableResult, type ReverseSyncError, type ReverseSyncResult, type ReverseSyncUpdate, type RewardScores, type Row, type RowVisibilityDefault, type S3Config, type S3StoreConfig, S3UnavailableError, SQLiteAdapter, type SchemaEntity, type SearchOptions, type SearchResult, type SecurityOptions, type SeedConfig, type SeedLinkSpec, SeedReconciliationError, type SeedResult, type SelfSource, type SessionEntry, type SessionParseOptions, type SessionWriteEntry, type SessionWriteOp, type SessionWriteParseResult, type SourceHandle, type SourceKeyStore, type SourceMetadata, type SourceQueryOptions, SourceShreddedError, type StopFn, type StorageAdapter, type SyncResult, type TableDefinition, type TablePolicy, type TemplateRenderSpec, type TurnParams, type TurnResult, type UnresolvedLink, type UpsertByNaturalKeyOptions, type UserIdentity, type UserPreferences, type Viewer, type VisionOptions, type VisionSenderInput, WORKSPACES_SUBDIR, type WatchOptions, type WorkspacePaths, type WorkspaceRecord, type WorkspaceRegistry, type WriteHook, type WriteHookContext, type WritebackDefinition, type WritebackStateStore, type WritebackValidationResult, activeWorkspaceLabel, addWorkspace, adoptNativeEntities, analyticsEnabled, applyTokenBudget, applyWriteEntry, archiveLocalSqlite, assertSafeUrl, attachBlob, audiencePredicate, audienceViewSql, autoFtsColumns, autoUpdate, backfillOwnership, canManageRoles, classifyLinks, cloudRlsInstalled, configDir, contentHash, crawlUrl, createReadOnlyHeader, createS3Store, createSQLiteStateStore, decrypt, defaultWorkspaceYaml, deleteDbCredential, deleteToken, deriveCanonicalContexts, deriveKey, describeImage, describePdf, discoverCloudTables, enableAudienceView, enableChangelogRls, enableRlsForTable, encrypt, enrichKnowledge, ensureFtsIndex, ensureLatticeRoot, entityFileNames, estimateTokens, extractObjects, findLatticeRoot, fixSchemaConflicts, foldEntity, frontmatter, ftsTableName, fullTextSearch, generateEntryId, generateMemberPassword, generateWriteEntryId, getActiveWorkspace, getCloudSetting, getDbCredential, getOrCreateMasterKey, getTablePolicy, getWorkspace, grantCell, hasFtsIndex, hashFile, importLegacyUserConfig, installCloudRls, installCloudSettings, isEncrypted, isNativeEntity, isPostgresUrl, isPrivateIp, isRowAudience, isV1EntityFiles, listDbCredentials, listNativeBindings, listTokens, listWorkspaces, loadColumnPolicy, manifestPath, markdownTable, memberRoleName, migrateLatticeData, normalizeEntityFiles, observationVisible, observationsFromChange, openTargetLatticeForMigration, openUnderSource, organizeSource, parseConfigFile, parseConfigString, parseMarkdownEntries, parseMatches, parseObjects, parseSessionMD, parseSessionWrites, probeCloud, providerForUrl, provisionMemberRole, readIdentity, readManifest, readPreferences, readRegistry, readToken, referenceLocalFile, referenceUrl, regenerateAudienceViewFromDb, registerNativeEntities, registryPath, resolveActiveS3Config, resolveLatticeRoot, resolveSource, resolveWorkspacePaths, revokeCell, revokeMemberRole, rootConfigDir, s3Key, saveDbCredential, saveDbCredentialForTeam, sealUnderSource, secureCloud, seedColumnPolicyFromYaml, setActiveWorkspace, setCloudSetting, setColumnAudience, setRowVisibility, setTableDefaultVisibility, setTableNeverShare, shredSource, slugify, summarizeText, tableNeedsAudienceView, toSafeDirName, truncate, validateEntryId, workspaceBlobsDir, workspaceConfigPath, workspaceContextDir, workspaceDataDir, workspaceDbPath, workspaceDir, workspacesDir, writeIdentity, writeManifest, writePreferences, writeRegistry, writeToken };