latticesql 4.2.3 → 4.3.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.ts CHANGED
@@ -770,6 +770,72 @@ declare function chunkText(text: string, chunker?: ChunkerFn, contextPrefix?: st
770
770
  content: string;
771
771
  }[];
772
772
 
773
+ /**
774
+ * Connected data types — tables backed by an external source via a connector.
775
+ *
776
+ * A table that declares `source` is a *connected data type*: its rows are
777
+ * ingested from an external system (e.g. issues from a project tracker) rather
778
+ * than authored locally. The framework stamps each row with bookkeeping that
779
+ * records which connector instance produced it and when, so the data can be
780
+ * re-synced idempotently, scoped per connector, and torn down completely when
781
+ * the connector is disconnected.
782
+ *
783
+ * The natural key (a stable external identifier — e.g. an issue key) is the
784
+ * table's primary key, so `upsert` is idempotent across re-syncs and the
785
+ * connector lineage columns are preserved on conflict.
786
+ *
787
+ * Lineage columns (`_source_connector_id`, `_source_model`) are immutable: once
788
+ * stamped at ingest they cannot be rewritten by `update()`, so a re-sync or a
789
+ * manual edit can't quietly relabel which connector a row came from. The
790
+ * sync-time bookkeeping column (`_source_synced_at`) is mutable.
791
+ *
792
+ * Opt-in per table; tables without a `source` add no columns and pay nothing.
793
+ */
794
+ /** A row's connector lineage / sync bookkeeping. Mirrors the governance pattern. */
795
+ declare const CONNECTED_COLUMNS: Record<string, string>;
796
+ /**
797
+ * Lineage columns that may not be changed by `update()` after a row exists.
798
+ * `_source_synced_at` is intentionally excluded — it is re-stamped every sync.
799
+ */
800
+ declare const IMMUTABLE_CONNECTED_FIELDS: readonly string[];
801
+ /** Row visibility a connected table's rows default to when ingested into a cloud. */
802
+ type ConnectedVisibility = 'private' | 'everyone';
803
+ /**
804
+ * Declares a table as a connected data type (see module docs). Attached to a
805
+ * {@link TableDefinition} as `source`.
806
+ */
807
+ interface ConnectorSource {
808
+ /** The connector implementation that backs this table (e.g. `'jira'`). */
809
+ connector: string;
810
+ /** The external product/toolkit (e.g. `'jira'`). */
811
+ toolkit: string;
812
+ /** The model within the toolkit (e.g. `'issue'`). */
813
+ model: string;
814
+ /**
815
+ * The column holding the stable external identifier. By convention this is
816
+ * the table's primary key, so re-syncs upsert idempotently on it.
817
+ */
818
+ naturalKey: string;
819
+ /**
820
+ * Default row visibility when ingested into a cloud workspace. `'private'`
821
+ * (the default) scopes rows to the connecting member; `'everyone'` shares
822
+ * them with all cloud members. Configurable per connected type.
823
+ */
824
+ defaultVisibility?: ConnectedVisibility;
825
+ }
826
+ /** The DDL column spec map a connected-data-type contributes. */
827
+ declare function connectedColumns(source: ConnectorSource | undefined): Record<string, string>;
828
+ /**
829
+ * Thrown when an `update()` tries to change an immutable connector-lineage
830
+ * column. Surfaced loudly so a row can't be silently relabeled to a different
831
+ * connector or model after ingest.
832
+ */
833
+ declare class ConnectedSourceImmutableError extends Error {
834
+ readonly table: string;
835
+ readonly column: string;
836
+ constructor(table: string, column: string);
837
+ }
838
+
773
839
  /**
774
840
  * Declarative computed columns + materialized rollups.
775
841
  *
@@ -1418,6 +1484,16 @@ interface TableDefinition {
1418
1484
  * `refreshMaterializedRollups`. See {@link MaterializedRollupSpec}.
1419
1485
  */
1420
1486
  materializedRollups?: Record<string, MaterializedRollupSpec>;
1487
+ /**
1488
+ * Mark this table as a *connected data type* (4.3+) — its rows are ingested
1489
+ * from an external system through a connector rather than authored locally.
1490
+ * Adds connector-lineage columns (`_source_connector_id`, `_source_model`,
1491
+ * `_source_synced_at`); the first two are immutable (an `update()` touching
1492
+ * them throws `ConnectedSourceImmutableError`). The GUI shows a "Connected"
1493
+ * badge for these tables, and disconnecting the connector tears their rows
1494
+ * down. Tables without a `source` are unaffected. See {@link ConnectorSource}.
1495
+ */
1496
+ source?: ConnectorSource;
1421
1497
  }
1422
1498
  interface MultiTableDefinition {
1423
1499
  /** Returns the "anchor" entities — one output file is produced per anchor */
@@ -3282,6 +3358,8 @@ declare class Lattice {
3282
3358
  private readonly _provenanceCols;
3283
3359
  /** table → default trust state for new rows (governance: P-TRUST). */
3284
3360
  private readonly _trustDefault;
3361
+ /** table → connector source descriptor (connected data types, 4.3+). */
3362
+ private readonly _connectedSources;
3285
3363
  /** table → computed-column specs + recompute order + dep set (P-VIEW). */
3286
3364
  private readonly _computed;
3287
3365
  /** table → materialized rollup specs (P-VIEW). */
@@ -3518,6 +3596,18 @@ declare class Lattice {
3518
3596
  * trust table. Returns a shallow copy; a no-op for tables without governance.
3519
3597
  */
3520
3598
  private _applyGovernanceDefaults;
3599
+ /**
3600
+ * Stamp connector defaults at insert time for a connected data type: default
3601
+ * `_source_model` from the table's source descriptor and `_source_synced_at`
3602
+ * to now, when not already supplied. A no-op for tables without a `source`.
3603
+ * The connector sync engine normally sets these explicitly; this is the
3604
+ * safety net for a direct insert into a connected table.
3605
+ */
3606
+ private _applyConnectedDefaults;
3607
+ /** The connector source descriptor for a connected data type, or undefined. */
3608
+ getConnectedSource(table: string): ConnectorSource | undefined;
3609
+ /** Names of all registered connected data types (tables with a `source`). */
3610
+ connectedTables(): string[];
3521
3611
  /** Post-insert side effects (changelog, audit, write hooks, embedding sync),
3522
3612
  * identical for the plain and force-visibility insert paths. */
3523
3613
  private _afterInsert;
@@ -4764,6 +4854,74 @@ declare class SQLiteAdapter implements StorageAdapter {
4764
4854
  withClient<T>(fn: (tx: TxClient) => Promise<T>): Promise<T>;
4765
4855
  }
4766
4856
 
4857
+ /**
4858
+ * SQLite adapter backed by the runtime's built-in `node:sqlite` `DatabaseSync`
4859
+ * (synchronous) instead of the `better-sqlite3` native addon. This exists so
4860
+ * Lattice can run under a runtime that ships `node:sqlite` but cannot load
4861
+ * native N-API addons (the desktop build). The surface is a 1:1 mirror of the
4862
+ * better-sqlite3 adapter — same StorageAdapter contract, same SQL — with three
4863
+ * substitutions where the two SQLite bindings differ:
4864
+ *
4865
+ * 1. pragmas are issued via `exec()` (no `.pragma()` helper);
4866
+ * 2. the `data_version` half of changeProbe is read with a plain
4867
+ * `PRAGMA data_version` statement (no `{ simple: true }` option);
4868
+ * 3. BLOB columns read back as `Uint8Array` rather than `Buffer`. Lattice's
4869
+ * own file storage is disk-based (content-addressed blobs), so the core
4870
+ * never round-trips file bytes through a BLOB column; a user-defined
4871
+ * `blob` column consumed specifically as a Node `Buffer` is the only place
4872
+ * the difference is observable. `Buffer` is itself a `Uint8Array`, so byte
4873
+ * access is identical; only Buffer-only methods would differ.
4874
+ */
4875
+ interface NodeSqliteRunResult {
4876
+ changes: number | bigint;
4877
+ lastInsertRowid: number | bigint;
4878
+ }
4879
+ interface NodeStatementSync {
4880
+ run(...params: unknown[]): NodeSqliteRunResult;
4881
+ get(...params: unknown[]): Row | undefined;
4882
+ all(...params: unknown[]): Row[];
4883
+ }
4884
+ interface NodeDatabaseSync {
4885
+ exec(sql: string): void;
4886
+ prepare(sql: string): NodeStatementSync;
4887
+ close(): void;
4888
+ }
4889
+ declare class DenoSqliteAdapter implements StorageAdapter {
4890
+ readonly dialect: "sqlite";
4891
+ private _db;
4892
+ private readonly _path;
4893
+ private readonly _wal;
4894
+ private readonly _busyTimeout;
4895
+ constructor(path: string, options?: {
4896
+ wal?: boolean;
4897
+ busyTimeout?: number;
4898
+ });
4899
+ get db(): NodeDatabaseSync;
4900
+ open(): void;
4901
+ close(): void;
4902
+ run(sql: string, params?: unknown[]): void;
4903
+ get(sql: string, params?: unknown[]): Row | undefined;
4904
+ all(sql: string, params?: unknown[]): Row[];
4905
+ prepare(sql: string): PreparedStatement;
4906
+ introspectColumns(table: string): string[];
4907
+ /** Mirror of SQLiteAdapter.addColumn — SQLite ALTER quirks are binding-agnostic. */
4908
+ addColumn(table: string, column: string, typeSpec: string): void;
4909
+ /**
4910
+ * O(1) watch-loop change-probe — same composition as SQLiteAdapter, but
4911
+ * `data_version` is read with a plain prepared statement because node:sqlite
4912
+ * has no `.pragma(name, { simple: true })` scalar helper.
4913
+ */
4914
+ changeProbe(): string;
4915
+ runAsync(sql: string, params?: unknown[]): Promise<void>;
4916
+ getAsync(sql: string, params?: unknown[]): Promise<Row | undefined>;
4917
+ allAsync(sql: string, params?: unknown[]): Promise<Row[]>;
4918
+ introspectColumnsAsync(table: string): Promise<string[]>;
4919
+ introspectAllColumns(tables: string[]): Promise<Map<string, Set<string>>>;
4920
+ addColumnAsync(table: string, column: string, typeSpec: string): Promise<void>;
4921
+ /** BEGIN/COMMIT around an awaited fn; ROLLBACK on throw. Mirror of SQLiteAdapter. */
4922
+ withClient<T>(fn: (tx: TxClient) => Promise<T>): Promise<T>;
4923
+ }
4924
+
4767
4925
  /**
4768
4926
  * Pluggable Postgres backend for Lattice.
4769
4927
  *
@@ -4898,6 +5056,724 @@ declare class PostgresAdapter implements StorageAdapter {
4898
5056
  private _registerPolyfills;
4899
5057
  }
4900
5058
 
5059
+ /**
5060
+ * Connector SPI — the fetch/auth contract a connector implementation satisfies.
5061
+ *
5062
+ * A *connector* (e.g. the built-in Jira connector) handles authentication and
5063
+ * data fetching for an external product (*toolkit*, e.g. `jira`), and exposes
5064
+ * each external object type as a *connected data type* — a Lattice table whose
5065
+ * rows are synced from the source.
5066
+ *
5067
+ * The SPI is deliberately small: establish a connection, stream normalized
5068
+ * records for a model, and revoke. Everything Lattice-specific
5069
+ * (schema, ACL, graph edges, teardown) is driven from the {@link ConnectedModelDef}
5070
+ * descriptors and handled by the sync engine — a connector only fetches + maps.
5071
+ */
5072
+
5073
+ /**
5074
+ * A foreign-key relation on a connected model, used to auto-build graph edges
5075
+ * after a sync (via `extractEdgesFromColumn`) so connected rows are retrievable
5076
+ * as relationship-aware context.
5077
+ */
5078
+ interface ConnectedEdgeSpec {
5079
+ /** FK column on this model's table. */
5080
+ fkColumn: string;
5081
+ /** The table the FK points to. */
5082
+ dstTable: string;
5083
+ /** Edge type label (e.g. `'in_project'`). */
5084
+ type: string;
5085
+ }
5086
+ /**
5087
+ * One model a toolkit exposes as a connected data type. Carries the full Lattice
5088
+ * {@link TableDefinition} (with a `source` descriptor) plus the graph edges to
5089
+ * derive after each sync.
5090
+ */
5091
+ interface ConnectedModelDef {
5092
+ /** Model key within the toolkit (e.g. `'issue'`). */
5093
+ model: string;
5094
+ /** Lattice table name (e.g. `'jira_issues'`). */
5095
+ table: string;
5096
+ /** Natural-key column — also the table's primary key, for idempotent upsert. */
5097
+ naturalKey: string;
5098
+ /** The table definition registered with `db.define()` (must set `source`). */
5099
+ definition: TableDefinition;
5100
+ /** FK relations to materialize as graph edges after sync. */
5101
+ graphEdges?: ConnectedEdgeSpec[];
5102
+ /** Embedded text columns, so the sync engine can refresh embeddings. */
5103
+ embedded?: boolean;
5104
+ /**
5105
+ * Declares this model is fetched once *per parent row* rather than in one pass
5106
+ * (e.g. comments fetched per issue). The sync engine queries the parent table's
5107
+ * already-synced keys and calls {@link Connector.listChanges} with each as
5108
+ * `parentKey`. Omit for models fetched in a single paged pass.
5109
+ */
5110
+ parent?: {
5111
+ /** The parent connected table (must be synced earlier in the model order). */
5112
+ table: string;
5113
+ /** The parent's key column to iterate (its natural key / primary key). */
5114
+ keyColumn: string;
5115
+ /** The FK column on THIS table to stamp with each parent key during sync. */
5116
+ childColumn: string;
5117
+ /**
5118
+ * Optional parent timestamp column (e.g. `'updated'`). When set, after the
5119
+ * first sync only parents whose timestamp advanced since the connector's last
5120
+ * sync are re-fetched — bounding an O(parents) per-parent crawl on a large
5121
+ * source. (The pass is then incremental, so vanished children aren't pruned.)
5122
+ */
5123
+ incrementalColumn?: string;
5124
+ };
5125
+ }
5126
+ /**
5127
+ * A record fetched from the external source, normalized for upsert. `row` holds
5128
+ * the column→value map for the Lattice table (the connector lineage columns are
5129
+ * stamped by the sync engine, not here).
5130
+ */
5131
+ interface ExternalRecord {
5132
+ /** Natural-key value (the row's primary key). */
5133
+ id: string;
5134
+ /** Column→value map for the table row. */
5135
+ row: Record<string, unknown>;
5136
+ }
5137
+ /**
5138
+ * Sidebar/settings presentation metadata for one toolkit — the label and logo
5139
+ * the GUI renders. Driven entirely by the connector so adding a connector needs
5140
+ * no GUI code.
5141
+ */
5142
+ interface ToolkitPresentation {
5143
+ /** Human-readable name shown next to the logo (e.g. `'Jira'`). */
5144
+ label: string;
5145
+ /** Logo as a `data:` URI (e.g. `data:image/svg+xml;base64,…`), shown as an `<img src>`. */
5146
+ icon?: string;
5147
+ }
5148
+ /**
5149
+ * One credential input on a connector's connect form — METADATA describing the
5150
+ * field, never a value. The GUI renders one input per entry; the generic connect
5151
+ * handler reads the submitted values by `key`.
5152
+ */
5153
+ interface CredentialField {
5154
+ /** Body key the submitted value is sent under (e.g. `'token'`). */
5155
+ key: string;
5156
+ /** Field label shown to the user (e.g. `'API token'`). */
5157
+ label: string;
5158
+ /** Input type — `'password'` masks the value. */
5159
+ type: 'text' | 'password';
5160
+ /** Optional placeholder shown in the empty input. */
5161
+ placeholder?: string;
5162
+ /** Whether the value is required (default true at the route layer). */
5163
+ required?: boolean;
5164
+ }
5165
+ /** Result of beginning an OAuth authorization for a member. */
5166
+ interface AuthorizeResult {
5167
+ /** The URL the member must visit to grant access. */
5168
+ redirectUrl: string;
5169
+ /** Opaque handle to poll/finalize the pending connection. */
5170
+ pendingId?: string;
5171
+ }
5172
+ /** Result of finalizing a connection after the member completes OAuth. */
5173
+ interface ConnectionResult {
5174
+ /** The backend connected-account id, stored in the registry. */
5175
+ connectionId: string;
5176
+ }
5177
+ /** Context for a sync fetch — the member's connection + identity. */
5178
+ interface ListChangesContext {
5179
+ /** The connector backend's connected-account id. */
5180
+ connectionId: string;
5181
+ /** Per-member identity (the connector backend's user id). */
5182
+ userId: string;
5183
+ /** Cursor from a prior page, or null for a full pull. */
5184
+ cursor?: string | null;
5185
+ /** Parent row key for a per-parent model (e.g. an issue key when fetching its comments). */
5186
+ parentKey?: string;
5187
+ }
5188
+ /**
5189
+ * A connector implementation. Concrete connectors (e.g. the Jira connector)
5190
+ * implement this; the sync engine and GUI program against it.
5191
+ */
5192
+ interface Connector {
5193
+ /** Connector id (e.g. `'jira'`). */
5194
+ readonly connector: string;
5195
+ /** The toolkits this connector can serve (e.g. `['jira']`). */
5196
+ toolkits(): string[];
5197
+ /** The connected-data-type models for a toolkit. */
5198
+ models(toolkit: string): ConnectedModelDef[];
5199
+ /** Sidebar/settings presentation (label + logo) for a toolkit this connector serves. */
5200
+ presentation(toolkit: string): ToolkitPresentation;
5201
+ /** Begin OAuth for a member + toolkit; returns a redirect URL. */
5202
+ authorize(userId: string, toolkit: string): Promise<AuthorizeResult>;
5203
+ /** Finalize the connection once the member has completed OAuth. */
5204
+ completeAuth(userId: string, toolkit: string): Promise<ConnectionResult>;
5205
+ /**
5206
+ * Stream normalized records for a model, paginated and bounded. Implementations
5207
+ * MUST page rather than load everything at once (bounded reads).
5208
+ */
5209
+ listChanges(toolkit: string, model: string, ctx: ListChangesContext): AsyncIterable<ExternalRecord>;
5210
+ /** Revoke a connected account (teardown). */
5211
+ disconnect(connectionId: string): Promise<void>;
5212
+ }
5213
+ /**
5214
+ * A connector that connects via direct credentials the member pastes in — an API
5215
+ * key, token, site URL, etc. — rather than an OAuth redirect. The GUI renders a
5216
+ * form from {@link CredentialConnector.credentialFields} and calls
5217
+ * {@link CredentialConnector.connect} with the collected values; the connector
5218
+ * validates them against the source and stores them encrypted.
5219
+ */
5220
+ interface CredentialConnector extends Connector {
5221
+ /** The credential inputs the connect form must render (metadata only). */
5222
+ credentialFields(): CredentialField[];
5223
+ /**
5224
+ * Validate the submitted credentials against the source and, on success, store
5225
+ * them encrypted under a fresh connection id. Returns the connection id (the
5226
+ * caller records it in the registry) and a validated display name for the UI.
5227
+ * Throws loudly on invalid credentials — never returns a silent default.
5228
+ */
5229
+ connect(creds: Record<string, string>): Promise<{
5230
+ connectionId: string;
5231
+ displayName: string | null;
5232
+ }>;
5233
+ /** Optional URL to docs for obtaining the credentials (shown as a help link). */
5234
+ helpUrl?(): string | undefined;
5235
+ }
5236
+ /**
5237
+ * True when `c` is a {@link CredentialConnector} — i.e. it connects via direct
5238
+ * credentials (both `connect` and `credentialFields` are functions). The route
5239
+ * layer uses this to decide whether to serve the credential connect form.
5240
+ */
5241
+ declare function isCredentialConnector(c: Connector): c is CredentialConnector;
5242
+
5243
+ /**
5244
+ * The connector catalog — the single place every built-in connector is wired.
5245
+ *
5246
+ * Routes, the sidebar, the settings panel, and sync-all all iterate this list via
5247
+ * the data-driven API ({@link Connector.presentation} / `credentialFields` /
5248
+ * `models`), so adding a connector is a new module under `src/connectors/<toolkit>/`
5249
+ * plus one line here — no route, GUI, or SPI changes.
5250
+ *
5251
+ * Named `catalog.ts` (not `registry.ts`) to avoid confusion with the
5252
+ * `__lattice_connectors` DB table managed in `registry.ts`: this is the in-memory
5253
+ * set of connector *implementations*; that is the per-member *connection* records.
5254
+ */
5255
+
5256
+ /**
5257
+ * Every built-in connector, fresh instances per call. The GUI server passes the
5258
+ * result to the connectors routes; toolkit ids must be unique across the list.
5259
+ */
5260
+ declare function builtinConnectors(): Connector[];
5261
+
5262
+ /**
5263
+ * Connector registry — the set of external sources a workspace has connected.
5264
+ *
5265
+ * One internal `__lattice_connectors` table (GUI-hidden by the `__lattice_`
5266
+ * prefix) records each connector instance: which implementation backs it
5267
+ * (`connector`, e.g. `'jira'`), which product (`toolkit`, e.g. `'jira'`),
5268
+ * the opaque per-member connection handle (`connectionRef`), who connected
5269
+ * it, and its sync state. No secret material is stored here — the connector's
5270
+ * credentials (e.g. a SaaS API token) live in the machine-local encrypted
5271
+ * credential store, keyed by the connection handle.
5272
+ *
5273
+ * On a cloud workspace the table is RLS-scoped private-to-owner (see the ACL
5274
+ * wiring), so each member sees and manages only their own connectors.
5275
+ *
5276
+ * The table is created on demand (idempotent `CREATE TABLE IF NOT EXISTS`), so a
5277
+ * library consumer that never touches connectors pays nothing.
5278
+ */
5279
+
5280
+ declare const CONNECTORS_TABLE = "__lattice_connectors";
5281
+ /** Lifecycle state of a connector instance. */
5282
+ type ConnectorStatus = 'connected' | 'error' | 'disconnected';
5283
+ /** A row in the connector registry. */
5284
+ interface ConnectorRecord {
5285
+ id: string;
5286
+ /** Connector implementation, e.g. `'jira'`. */
5287
+ connector: string;
5288
+ /** External product/toolkit, e.g. `'jira'`. */
5289
+ toolkit: string;
5290
+ /** Human-friendly label shown in the GUI. */
5291
+ displayName: string | null;
5292
+ /** Opaque per-member connection handle (the key for the connection's stored credentials). */
5293
+ connectionRef: string | null;
5294
+ /** Identity that connected this instance (member role / user id). */
5295
+ connectedBy: string | null;
5296
+ status: ConnectorStatus;
5297
+ /** ISO timestamp of the last successful sync, or null if never synced. */
5298
+ lastSyncAt: string | null;
5299
+ /** Last sync error message (cleared on success), or null. */
5300
+ lastError: string | null;
5301
+ createdAt: string;
5302
+ updatedAt: string;
5303
+ }
5304
+ /** Create the registry table if it doesn't exist (idempotent; both dialects). */
5305
+ declare function ensureConnectorRegistry(db: Lattice): Promise<void>;
5306
+ interface CreateConnectorInput {
5307
+ connector: string;
5308
+ toolkit: string;
5309
+ displayName?: string;
5310
+ connectionRef?: string;
5311
+ connectedBy?: string;
5312
+ }
5313
+ /** Insert a connector instance and return its id. */
5314
+ declare function createConnector(db: Lattice, input: CreateConnectorInput): Promise<string>;
5315
+ /** Fetch one connector by id, or null. */
5316
+ declare function getConnector(db: Lattice, id: string): Promise<ConnectorRecord | null>;
5317
+ /**
5318
+ * Fetch the connector for a toolkit (optionally scoped to a connecting identity).
5319
+ * Returns the most recently created match, or null.
5320
+ */
5321
+ declare function getConnectorByToolkit(db: Lattice, toolkit: string, connectedBy?: string): Promise<ConnectorRecord | null>;
5322
+ /**
5323
+ * List connectors. Pass `connectedBy` to scope to one identity — an APP-LAYER
5324
+ * fail-closed filter that does not rely on RLS (the app/owner connection is
5325
+ * BYPASSRLS, so RLS would not filter its own reads). Callers serving a specific
5326
+ * member MUST pass it so one member can't see another's connectors.
5327
+ */
5328
+ declare function listConnectors(db: Lattice, connectedBy?: string): Promise<ConnectorRecord[]>;
5329
+ /** Update a connector's backend connection id + mark it connected (re-auth/reuse). */
5330
+ declare function updateConnectorConnection(db: Lattice, id: string, connectionRef: string): Promise<void>;
5331
+ /** Record a sync outcome: success stamps `last_sync_at` + clears the error. */
5332
+ declare function recordSync(db: Lattice, id: string, outcome: {
5333
+ ok: true;
5334
+ at: string;
5335
+ } | {
5336
+ ok: false;
5337
+ error: string;
5338
+ }): Promise<void>;
5339
+ /**
5340
+ * The per-member identity to key connectors on. On a cloud (Postgres) this is the
5341
+ * member's `session_user` (the scoped login role the RLS ownership model keys on),
5342
+ * so the connector's per-member partition and the row-ownership stamp agree. On
5343
+ * SQLite / non-cloud it's the caller's `fallback` (the machine-local identity).
5344
+ */
5345
+ declare function resolveConnectorIdentity(db: Lattice, fallback: string): Promise<string>;
5346
+ /** Set a connector's lifecycle status (e.g. `'disconnected'` on teardown). */
5347
+ declare function setConnectorStatus(db: Lattice, id: string, status: ConnectorStatus): Promise<void>;
5348
+ /** Hard-delete a connector registry row (used by a full teardown). */
5349
+ declare function deleteConnectorRecord(db: Lattice, id: string): Promise<void>;
5350
+
5351
+ /**
5352
+ * The Jira connector — a {@link Connector} that talks to Jira Cloud's REST + Agile
5353
+ * APIs DIRECTLY via the optional `jira.js` dependency, authenticated with the
5354
+ * user's OWN Atlassian credentials (site URL + email + API token, HTTP Basic).
5355
+ * No broker, no extra API key.
5356
+ *
5357
+ * The SPI is OAuth-shaped (authorize→redirect→completeAuth); Jira uses direct
5358
+ * credentials instead, so `authorize`/`completeAuth` are not part of its flow —
5359
+ * the GUI collects credentials and calls {@link JiraConnector.connect}, which
5360
+ * validates them against Jira and stores them encrypted. `listChanges` (sync) and
5361
+ * `disconnect` (teardown) satisfy the SPI normally, keyed by the stored
5362
+ * connection. The schema (the six connected models) lives in `./models.ts`; this
5363
+ * file is the fetch/auth half.
5364
+ */
5365
+
5366
+ /** The user's Atlassian credentials for one Jira connection. */
5367
+ interface JiraCreds {
5368
+ /** Site base URL, e.g. `https://your-domain.atlassian.net`. */
5369
+ site: string;
5370
+ /** Atlassian account email (the Basic-auth username). */
5371
+ email: string;
5372
+ /** Atlassian API token (the Basic-auth password) — a user secret. */
5373
+ apiToken: string;
5374
+ }
5375
+ /** Thrown when the connector is used but its prerequisites are missing. */
5376
+ declare class ConnectorUnavailableError extends Error {
5377
+ constructor(message: string);
5378
+ }
5379
+ /** Read the stored credentials for a connection, or null. */
5380
+ declare function getJiraCreds(connectionId: string): JiraCreds | null;
5381
+ /** Persist credentials for a connection to the machine-local encrypted store. */
5382
+ declare function setJiraCreds(connectionId: string, creds: JiraCreds): void;
5383
+ /** Remove the stored credentials for a connection. */
5384
+ declare function clearJiraCreds(connectionId: string): void;
5385
+ type Json$1 = Record<string, unknown>;
5386
+ /** The minimal Jira surface the connector depends on (all calls return raw REST shapes). */
5387
+ interface JiraClient {
5388
+ /** Validate the credentials + return the authenticated account (`GET /myself`). */
5389
+ myself(): Promise<Json$1>;
5390
+ searchIssues(args: {
5391
+ jql: string;
5392
+ nextPageToken?: string;
5393
+ maxResults: number;
5394
+ fields?: string[];
5395
+ }): Promise<{
5396
+ issues: Json$1[];
5397
+ nextPageToken?: string;
5398
+ }>;
5399
+ searchProjects(args: {
5400
+ startAt: number;
5401
+ maxResults: number;
5402
+ }): Promise<{
5403
+ values: Json$1[];
5404
+ total?: number;
5405
+ isLast?: boolean;
5406
+ }>;
5407
+ getComments(args: {
5408
+ issueIdOrKey: string;
5409
+ startAt: number;
5410
+ maxResults: number;
5411
+ }): Promise<{
5412
+ comments: Json$1[];
5413
+ total?: number;
5414
+ }>;
5415
+ getAllUsers(args: {
5416
+ startAt: number;
5417
+ maxResults: number;
5418
+ }): Promise<Json$1[]>;
5419
+ getAllBoards(args: {
5420
+ startAt: number;
5421
+ maxResults: number;
5422
+ }): Promise<{
5423
+ values: Json$1[];
5424
+ total?: number;
5425
+ isLast?: boolean;
5426
+ }>;
5427
+ getAllSprints(args: {
5428
+ boardId: number;
5429
+ startAt: number;
5430
+ maxResults: number;
5431
+ }): Promise<{
5432
+ values: Json$1[];
5433
+ total?: number;
5434
+ isLast?: boolean;
5435
+ }>;
5436
+ }
5437
+ /**
5438
+ * Build a {@link JiraClient} from `jira.js` (lazy-imported) + the user's creds.
5439
+ * Throws {@link ConnectorUnavailableError} if the optional dependency is absent.
5440
+ * The dynamic import uses non-literal specifiers so TypeScript does not statically
5441
+ * resolve `jira.js` — it need not be installed to compile latticesql.
5442
+ */
5443
+ declare function loadJiraClient(creds: JiraCreds): Promise<JiraClient>;
5444
+ declare class JiraConnector implements CredentialConnector {
5445
+ private readonly clientFactory;
5446
+ private readonly credsLoader;
5447
+ readonly connector = "jira";
5448
+ /**
5449
+ * @param clientFactory builds a {@link JiraClient} from creds (default: the lazy
5450
+ * `jira.js` loader; tests inject a fake).
5451
+ * @param credsLoader resolves a connection id to its stored creds (default: the
5452
+ * machine-local store; tests inject a fake).
5453
+ */
5454
+ constructor(clientFactory?: (creds: JiraCreds) => Promise<JiraClient>, credsLoader?: (connectionId: string) => JiraCreds | null);
5455
+ toolkits(): string[];
5456
+ models(toolkit: string): ConnectedModelDef[];
5457
+ presentation(toolkit: string): ToolkitPresentation;
5458
+ credentialFields(): CredentialField[];
5459
+ helpUrl(): string;
5460
+ /**
5461
+ * Jira authenticates with direct credentials, not an OAuth redirect. The GUI
5462
+ * collects the site/email/token and calls {@link connect}; these SPI methods are
5463
+ * therefore not part of the Jira flow and throw a clear, actionable error.
5464
+ */
5465
+ authorize(_userId: string, _toolkit: string): Promise<AuthorizeResult>;
5466
+ completeAuth(_userId: string, _toolkit: string): Promise<ConnectionResult>;
5467
+ /**
5468
+ * Validate Atlassian credentials against Jira (`GET /myself`) and, on success,
5469
+ * store them encrypted under a fresh connection id. Reads the submitted
5470
+ * `site` / `email` / `token` values (the wire key stays `token`; it maps to the
5471
+ * internal `apiToken`). Returns the connection id (recorded in the registry by
5472
+ * the caller) and the validated account display name (for the UI). Throws a
5473
+ * clear, actionable error if the inputs are missing, the site isn't a URL, or
5474
+ * the credentials are invalid.
5475
+ */
5476
+ connect(creds: Record<string, string>): Promise<{
5477
+ connectionId: string;
5478
+ displayName: string | null;
5479
+ }>;
5480
+ listChanges(toolkit: string, model: string, ctx: ListChangesContext): AsyncIterable<ExternalRecord>;
5481
+ disconnect(connectionId: string): Promise<void>;
5482
+ /** Offset-paged fetch (startAt/total/isLast). Stops on isLast, exhausted total, or a short page. */
5483
+ private pageOffset;
5484
+ /** Token-paged fetch (nextPageToken) — the enhanced JQL issue search. */
5485
+ private pageToken;
5486
+ }
5487
+
5488
+ /**
5489
+ * Jira connected data types — the six tables the Jira connector syncs.
5490
+ *
5491
+ * Pure schema: each model's Lattice {@link TableDefinition} (with a `source`
5492
+ * descriptor), its natural key (a stable Jira id/key = the primary key, so
5493
+ * re-syncs upsert idempotently), and the FK relations that derive graph edges.
5494
+ * The fetch/map logic lives in the connector ({@link JiraConnector}), which calls
5495
+ * the Jira REST/Agile API directly via `jira.js` — there is no broker.
5496
+ */
5497
+
5498
+ /** All six Jira connected models, in dependency order (parents before children). */
5499
+ declare const JIRA_MODELS: ConnectedModelDef[];
5500
+ /**
5501
+ * Define the six Jira connected tables on a live database (post-init), skipping
5502
+ * any that already exist. Called before the first sync / on connector setup.
5503
+ */
5504
+ declare function defineJiraTables(db: Lattice): Promise<void>;
5505
+
5506
+ /**
5507
+ * The Trello connector — a {@link Connector} that talks to Trello's REST API
5508
+ * DIRECTLY over the Node global `fetch`, authenticated with the user's OWN API
5509
+ * key + token (passed as `?key=&token=` query params). No broker, no SDK, no
5510
+ * extra dependency.
5511
+ *
5512
+ * The SPI is OAuth-shaped (authorize→redirect→completeAuth); Trello uses direct
5513
+ * credentials instead, so `authorize`/`completeAuth` are not part of its flow —
5514
+ * the GUI collects the API key + token and calls {@link TrelloConnector.connect},
5515
+ * which validates them against Trello and stores them encrypted. `listChanges`
5516
+ * (sync) and `disconnect` (teardown) satisfy the SPI normally, keyed by the
5517
+ * stored connection. The schema (the eleven connected models) lives in
5518
+ * `./models.ts`; this file is the fetch/auth half.
5519
+ */
5520
+
5521
+ /** The user's Trello credentials for one connection. */
5522
+ interface TrelloCreds {
5523
+ /** Trello API key (from trello.com/power-ups/admin). */
5524
+ apiKey: string;
5525
+ /** Trello API token authorizing access for this key — a user secret. */
5526
+ token: string;
5527
+ }
5528
+ /** Read the stored credentials for a connection, or null. */
5529
+ declare function getTrelloCreds(connectionId: string): TrelloCreds | null;
5530
+ /** Persist credentials for a connection to the machine-local encrypted store. */
5531
+ declare function setTrelloCreds(connectionId: string, creds: TrelloCreds): void;
5532
+ /** Remove the stored credentials for a connection. */
5533
+ declare function clearTrelloCreds(connectionId: string): void;
5534
+ type Json = Record<string, unknown>;
5535
+ /** Options for the paged card/comment fetches (Trello's `before` cursor). */
5536
+ interface TrelloPageOpts {
5537
+ /** Max rows to return this page. */
5538
+ limit: number;
5539
+ /** Return only rows older than this id (Trello returns newest-first). */
5540
+ before?: string;
5541
+ }
5542
+ /** The minimal Trello surface the connector depends on (all calls return raw REST shapes). */
5543
+ interface TrelloClient {
5544
+ /** Validate the credentials + return the authenticated member (`GET /members/me`). */
5545
+ me(): Promise<Json>;
5546
+ /** The authenticated member's boards (`GET /members/me/boards`). */
5547
+ myBoards(): Promise<Json[]>;
5548
+ /** A board's lists (`GET /boards/{id}/lists`). */
5549
+ boardLists(boardId: string): Promise<Json[]>;
5550
+ /** A board's members (`GET /boards/{id}/members`). */
5551
+ boardMembers(boardId: string): Promise<Json[]>;
5552
+ /** A board's labels (`GET /boards/{id}/labels`). */
5553
+ boardLabels(boardId: string): Promise<Json[]>;
5554
+ /** A board's cards, paged newest-first via `before` (`GET /boards/{id}/cards`). */
5555
+ boardCards(boardId: string, opts: TrelloPageOpts): Promise<Json[]>;
5556
+ /** A card's `commentCard` actions, paged via `before` (`GET /cards/{id}/actions`). */
5557
+ cardComments(cardId: string, opts: TrelloPageOpts): Promise<Json[]>;
5558
+ /** A card's assigned members (`GET /cards/{id}/members`). */
5559
+ cardMembers(cardId: string): Promise<Json[]>;
5560
+ /** A card's applied labels (`GET /cards/{id}/labels`). */
5561
+ cardLabels(cardId: string): Promise<Json[]>;
5562
+ /** A card's checklists (`GET /cards/{id}/checklists`). */
5563
+ cardChecklists(cardId: string): Promise<Json[]>;
5564
+ /** A checklist's items (`GET /checklists/{id}/checkItems`). */
5565
+ checklistItems(checklistId: string): Promise<Json[]>;
5566
+ }
5567
+ /**
5568
+ * Build a {@link TrelloClient} that talks to Trello over the Node global `fetch`,
5569
+ * authenticated with the user's API key + token. No SDK, no extra dependency.
5570
+ */
5571
+ declare function loadTrelloClient(creds: TrelloCreds): Promise<TrelloClient>;
5572
+ declare class TrelloConnector implements CredentialConnector {
5573
+ private readonly clientFactory;
5574
+ private readonly credsLoader;
5575
+ readonly connector = "trello";
5576
+ /**
5577
+ * @param clientFactory builds a {@link TrelloClient} from creds (default: the
5578
+ * real `fetch`-backed client; tests inject a fake).
5579
+ * @param credsLoader resolves a connection id to its stored creds (default: the
5580
+ * machine-local store; tests inject a fake).
5581
+ */
5582
+ constructor(clientFactory?: (creds: TrelloCreds) => Promise<TrelloClient>, credsLoader?: (connectionId: string) => TrelloCreds | null);
5583
+ toolkits(): string[];
5584
+ models(toolkit: string): ConnectedModelDef[];
5585
+ presentation(toolkit: string): ToolkitPresentation;
5586
+ credentialFields(): CredentialField[];
5587
+ helpUrl(): string;
5588
+ /**
5589
+ * Trello authenticates with a direct API key + token, not an OAuth redirect.
5590
+ * The GUI collects them and calls {@link connect}; these SPI methods are
5591
+ * therefore not part of the Trello flow and reject with a clear error.
5592
+ */
5593
+ authorize(_userId: string, _toolkit: string): Promise<AuthorizeResult>;
5594
+ completeAuth(_userId: string, _toolkit: string): Promise<ConnectionResult>;
5595
+ /**
5596
+ * Validate Trello credentials (`GET /members/me`) and, on success, store them
5597
+ * encrypted under a fresh connection id. Returns the connection id (recorded in
5598
+ * the registry by the caller) and the validated member's full name (for the
5599
+ * UI). Throws if the credentials are invalid or absent.
5600
+ */
5601
+ connect(creds: Record<string, string>): Promise<{
5602
+ connectionId: string;
5603
+ displayName: string | null;
5604
+ }>;
5605
+ listChanges(toolkit: string, model: string, ctx: ListChangesContext): AsyncIterable<ExternalRecord>;
5606
+ disconnect(connectionId: string): Promise<void>;
5607
+ /**
5608
+ * Cursor-paged fetch for Trello's newest-first list endpoints: pass the oldest
5609
+ * id seen on the previous page as `before` to walk backwards. Stops on a short
5610
+ * page; throws past {@link MAX_PAGES} to avoid an unbounded loop.
5611
+ */
5612
+ private pageBefore;
5613
+ }
5614
+
5615
+ /**
5616
+ * Trello connected data types — the eleven tables the Trello connector syncs.
5617
+ *
5618
+ * Pure schema: each model's Lattice {@link TableDefinition} (with a `source`
5619
+ * descriptor), its natural key (a stable Trello id = the primary key, so re-syncs
5620
+ * upsert idempotently), and the FK relations that derive graph edges. The
5621
+ * fetch/map logic lives in the connector ({@link TrelloConnector}), which calls
5622
+ * the Trello REST API directly over the Node global `fetch` — there is no broker
5623
+ * and no SDK dependency.
5624
+ *
5625
+ * Trello's members-on-a-board and members/labels-on-a-card relationships are
5626
+ * many-to-many, and `graphEdges` derives one edge per single FK column. So those
5627
+ * relationships are modeled as junction tables (`trello_board_members`,
5628
+ * `trello_card_members`, `trello_card_labels`) whose composite-key rows each
5629
+ * carry the two FK columns that produce real graph edges. A flat
5630
+ * `trello_members` identity table holds member profiles (Trello has no global
5631
+ * member list, so members are discovered per board).
5632
+ */
5633
+
5634
+ /** All eleven Trello connected models, in dependency order (parents before children). */
5635
+ declare const TRELLO_MODELS: ConnectedModelDef[];
5636
+ /**
5637
+ * Define the eleven Trello connected tables on a live database (post-init),
5638
+ * skipping any that already exist. Called before the first sync / on connector
5639
+ * setup.
5640
+ */
5641
+ declare function defineTrelloTables(db: Lattice): Promise<void>;
5642
+
5643
+ /**
5644
+ * Connector sync engine.
5645
+ *
5646
+ * Pulls each connected model's records from the source (paginated, bounded),
5647
+ * upserts them idempotently on the natural key (stamping connector lineage),
5648
+ * soft-deletes rows that vanished from the source, and derives graph edges so
5649
+ * the data is retrievable as relationship-aware context. Driven entirely by the
5650
+ * connector's {@link ConnectedModelDef}s — no per-product code here.
5651
+ *
5652
+ * Failure policy: a sync touches an external system, so any error is recorded on
5653
+ * the connector and re-thrown (surfaced loudly, never swallowed).
5654
+ *
5655
+ * Freshness: `syncIfStale` / `syncStaleConnectors` implement "sync on connect,
5656
+ * on load if older than an hour, and on manual refresh" without a scheduler.
5657
+ */
5658
+
5659
+ /** Default staleness window — re-sync on load when older than this. */
5660
+ declare const DEFAULT_STALE_MS = 3600000;
5661
+ interface SyncConnectorResult {
5662
+ connectorId: string;
5663
+ /** Upserted row count per table. */
5664
+ upserted: Record<string, number>;
5665
+ /** Soft-deleted (vanished) row count per table. */
5666
+ softDeleted: Record<string, number>;
5667
+ /** Total graph edges derived. */
5668
+ edges: number;
5669
+ /** ISO timestamp stamped on this sync. */
5670
+ syncedAt: string;
5671
+ }
5672
+ interface SyncConnectorOptions {
5673
+ /** Soft-delete rows absent from the source this sync. Default true. */
5674
+ pruneVanished?: boolean;
5675
+ }
5676
+ /** Run a full sync for one connector instance. */
5677
+ declare function syncConnector(db: Lattice, connector: Connector, connectorId: string, opts?: SyncConnectorOptions): Promise<SyncConnectorResult>;
5678
+ /**
5679
+ * Collect all natural keys for a connector's rows in a table, paged + projected
5680
+ * to the single key column (bounded reads — never a full-row table scan). Shared
5681
+ * by the sync prune pass and the disconnect teardown.
5682
+ */
5683
+ declare function collectConnectorKeys(db: Lattice, table: string, keyColumn: string, connectorId: string): Promise<string[]>;
5684
+ /** Sync only if the connector hasn't synced within `maxAgeMs`. Returns null if fresh. */
5685
+ declare function syncIfStale(db: Lattice, connector: Connector, connectorId: string, maxAgeMs?: number): Promise<SyncConnectorResult | null>;
5686
+ /** Outcome of a batch stale-sync: the connectors that synced + the ones that failed. */
5687
+ interface SyncStaleResult {
5688
+ synced: SyncConnectorResult[];
5689
+ failed: {
5690
+ connectorId: string;
5691
+ error: string;
5692
+ }[];
5693
+ }
5694
+ /**
5695
+ * Sync every stale connector served by this connector implementation. The GUI
5696
+ * calls this on load so connected data refreshes hourly without a scheduler.
5697
+ *
5698
+ * Scope to the connecting member with `connectedBy` — each member syncs only
5699
+ * their OWN connectors (their session stamps row ownership; an owner must not
5700
+ * sync members' connectors as themselves). Per-connector failures are ISOLATED:
5701
+ * one broken connection records its error and is reported in `failed`, but never
5702
+ * blocks the refresh of the member's other connectors.
5703
+ */
5704
+ declare function syncStaleConnectors(db: Lattice, connector: Connector, maxAgeMs?: number, connectedBy?: string): Promise<SyncStaleResult>;
5705
+
5706
+ /**
5707
+ * Connector teardown — disconnecting a connector makes its data "no longer
5708
+ * available."
5709
+ *
5710
+ * Soft-deletes every row the connector ingested (children before parents), prunes
5711
+ * the rendered context files for them, marks the connector disconnected (or
5712
+ * removes it in hard mode), and revokes the backend connection. Soft-deleted rows
5713
+ * drop out of the rendered context, full-text search, and the GUI's listings (all
5714
+ * of which filter `deleted_at IS NULL`), and their graph edges are removed — so
5715
+ * the data is no longer available to the agent, while staying physically present
5716
+ * and restorable. On cloud, the per-viewer render prune removes each member's
5717
+ * context files.
5718
+ */
5719
+
5720
+ interface DisconnectOptions {
5721
+ /**
5722
+ * `'soft'` (default) keeps the registry row as `disconnected` (reconnectable);
5723
+ * `'hard'` also removes the registry row. Ingested rows are soft-deleted in
5724
+ * both modes (Lattice never hard-deletes rows).
5725
+ */
5726
+ mode?: 'soft' | 'hard';
5727
+ /** When set, re-render to prune context files for the removed rows. */
5728
+ outputDir?: string;
5729
+ }
5730
+ interface DisconnectResult {
5731
+ connectorId: string;
5732
+ mode: 'soft' | 'hard';
5733
+ /** Soft-deleted row count per table. */
5734
+ softDeleted: Record<string, number>;
5735
+ }
5736
+ /** Disconnect a connector and tear down everything it ingested. */
5737
+ declare function disconnectConnector(db: Lattice, connector: Connector, connectorId: string, opts?: DisconnectOptions): Promise<DisconnectResult>;
5738
+
5739
+ /**
5740
+ * Connector ACL wiring (cloud Postgres).
5741
+ *
5742
+ * On a cloud workspace, connected data is scoped per connecting member by the
5743
+ * same Row-Level Security that protects every other table: the registry and each
5744
+ * connected table get RLS enabled, the insert trigger stamps the connecting
5745
+ * member as owner, and `lattice_row_visible` keeps a member's rows private to
5746
+ * them — unless a connected type is marked shared (`everyone`), in which case its
5747
+ * rows default to visible to the whole team.
5748
+ *
5749
+ * Because enabling RLS / DDL requires owner privilege, this is an OWNER setup
5750
+ * step (it no-ops for a non-owner, a non-cloud workspace, or SQLite). The owner
5751
+ * defines the connected tables and calls this once; members then sync their own
5752
+ * rows into the shared tables, born private to each member.
5753
+ *
5754
+ * Derived enrichment over connected rows inherits the connector data's
5755
+ * visibility automatically: write it through `db.observe(..., { changeKind:
5756
+ * 'derived', sourceRef: [connectedRowId] })`, and the existing source-gated fold
5757
+ * (`foldEntity` / `observationVisible`) hides it from a viewer who can't see the
5758
+ * source. No connector-specific code is needed for that — use the substrate.
5759
+ */
5760
+
5761
+ /**
5762
+ * Enable per-member RLS on the connector registry and a toolkit's connected
5763
+ * tables, and apply each connected type's default visibility. Owner-only; a
5764
+ * no-op on SQLite, a non-cloud Postgres, or for a non-owner role. The connected
5765
+ * tables must already exist (define them first).
5766
+ */
5767
+ declare function enableConnectorRls(db: Lattice, connector: Connector, toolkit: string): Promise<void>;
5768
+ /**
5769
+ * Define + secure EVERY toolkit's connected tables (and the registry) for a
5770
+ * connector. Run by the owner on workspace open so connected tables created in a
5771
+ * member's session are RLS-protected even though the owner never connected — the
5772
+ * durable fix for "a member's lazily-registered connected table is born without
5773
+ * RLS." Owner-only; a no-op on SQLite / non-cloud / non-owner.
5774
+ */
5775
+ declare function secureConnectorTables(db: Lattice, connector: Connector): Promise<void>;
5776
+
4901
5777
  /**
4902
5778
  * Durable retry for transient database failures.
4903
5779
  *
@@ -5278,9 +6154,15 @@ interface UserPreferences {
5278
6154
  * Preferred speech-to-text provider for the assistant's voice notes. This is
5279
6155
  * a USER preference, not a workspace secret — it lives here (machine-local) so
5280
6156
  * it persists across workspaces and never appears in any workspace's `secrets`
5281
- * object. `'auto'` infers from whichever provider key is configured.
6157
+ * object.
6158
+ * `'local'` — on-device, in-browser speech model. The keyless default:
6159
+ * no API key, no config, audio never leaves the machine.
6160
+ * `'openai'` / — cloud providers (fallback when a key IS configured).
6161
+ * `'elevenlabs'`
6162
+ * `'auto'` — infer from whichever cloud provider key is configured;
6163
+ * legacy "off" sentinel kept for back-compat.
5282
6164
  */
5283
- voice_provider: 'auto' | 'openai' | 'elevenlabs';
6165
+ voice_provider: 'local' | 'auto' | 'openai' | 'elevenlabs';
5284
6166
  /**
5285
6167
  * Inference aggressiveness (0 = conservative … 1 = aggressive). Drives the
5286
6168
  * assistant's sampling temperature and how liberally ingest links/extracts.
@@ -6684,6 +7566,16 @@ interface StartGuiServerOptions {
6684
7566
  * ⇒ the version chip stays hidden.
6685
7567
  */
6686
7568
  version?: string;
7569
+ /**
7570
+ * Absolute path to the built `dist/gui-assets/` directory (the on-device voice
7571
+ * worker + ONNX-Runtime WASM), served read-only at `GET /gui-assets/*`. Passed
7572
+ * by `cli.ts` (resolved against the package via `import.meta.url`, like
7573
+ * `version`) because server.ts is bundled to both CJS and ESM — reading the
7574
+ * path via `import.meta.url` here would break the CJS bundle. Omitted ⇒ a
7575
+ * best-effort default (sibling of the running CLI bundle, else `<cwd>/dist/
7576
+ * gui-assets`), so source/dev/test runs still serve the assets when present.
7577
+ */
7578
+ guiAssetsDir?: string;
6687
7579
  /**
6688
7580
  * Realtime backstop liveness-poll interval (ms) for the RealtimeBroker. A
6689
7581
  * managed-Postgres proxy (e.g. AWS RDS Proxy) can silently drop the LISTEN
@@ -6707,6 +7599,13 @@ interface StartGuiServerOptions {
6707
7599
  * it overrides `selfUpdate`'s default factory.
6708
7600
  */
6709
7601
  updateServiceFactory?: (emit: (type: string, data: unknown) => void) => UpdateService;
7602
+ /**
7603
+ * Desktop shell only: open an external URL in the OS default browser. The
7604
+ * embedded desktop webview has no tabs, so `target="_blank"` links are routed
7605
+ * to `GET /api/desktop/open` which calls this. Omitted for the web/CLI GUI —
7606
+ * the route then 404s, so a browser-served GUI can never trigger an OS open.
7607
+ */
7608
+ desktopOpenExternal?: (url: string) => void;
6710
7609
  }
6711
7610
  interface GuiServerHandle {
6712
7611
  server: Server;
@@ -7117,4 +8016,4 @@ declare function dedupeAndDetectViews(plan: ProposedSchema, data: Record<string,
7117
8016
  views: DetectedView[];
7118
8017
  };
7119
8018
 
7120
- export { ALL_PROVENANCE_FIELDS, type AddWorkspaceOptions, type AdoptNativeOptions, type AdoptResult, type AggregateFunction, type AggregateHaving, type AggregateOptions, type AggregateResult, type AggregateSpec, type ApplyWriteResult, type AsOfCandidate, type AsOfColumnCandidate, type AsOfInputs, type AudienceRowCtx, type AuditEvent, type AutoUpdateResult, type BacklinkSignal, type BelongsToRelation, type BelongsToSource, type BenchmarkOptions, type BenchmarkReport, type BenchmarkScale, type BlobMetadata, BoundedReadError, type BuiltinTemplateName, CLOUD_SETTING_SYSTEM_PROMPT, CLOUD_SETTING_WORKSPACE_LOGO, CLOUD_SETTING_WORKSPACE_LOGO_ETAG, CONFIG_SUBDIR, type CatalogEntity, type CatalogRecord, type ChangeEntry, type ChangelogOptions, type ChunkedMigrationOptions, type ChunkedMigrationResult, type ChunkerFn, type ClassifyMatch, type CleanupOptions, type CleanupResult, type CloudProbeResult, type CloudS3Secret, ComputedColumnCycleError, type ComputedColumnSpec, type CountOptions, type CrawlOptions, type CrawlResult, type CustomSignal, type CustomSource, DEFAULT_ENTRY_TYPES, DEFAULT_MAX_NODES, DEFAULT_TYPE_ALIASES, type DetectedView, type DiagnoseOptions, type DiscoveredTable, EMBEDDINGS_TABLE, EmbeddingDimensionMismatchError, type EmbeddingRefreshResult, EmbeddingScanTooLargeError, type EmbeddingsConfig, type EnrichOptions, type EnrichResult, type EnrichedSource, type EnrichmentLookup, type EntityContextDefinition, type EntityContextManifestEntry, type EntityFileManifestInfo, type EntityFileSource, type EntityFileSpec, type EntityMatch, type EntityProfileField, type EntityProfileSection, type EntityProfileTemplate, type EntityRenderSpec, type EntityRenderTemplate, type EntitySectionPerRow, type EntitySectionsTemplate, type EntityTableColumn, type EntityTableTemplate, type EvalQuery, type EvalRegression, type ExistingTable, type ExtensionAvailability, type ExtractEdgesSpec, type ExtractedObject, FileSourceKeyStore, type FileSourceKeyStoreOptions, type FilesRow, type Filter, type FilterAnd, type FilterExpr, type FilterOp, type FilterOr, FoldCache, type FtsConfig, type FtsGroup, type FtsHit, type FtsOptions, type FtsResult, type GraphBoostOptions, type GraphBoostResult, type GraphEdge, type GraphNode, type GraphTraversalResult, type GuiServerHandle, type HasManyRelation, type HasManySource, type HealthIssueKind, type HealthSeverity, type HybridScoreBreakdown, type HybridSearchOptions, type HybridSearchResult, type ImportMode, type ImportProgress, InMemorySourceKeyStore, InMemoryStateStore, type InferredColumn, type InferredDimension, type InferredEntity, type InferredLinkage, type InferredType, type InitOptions, LEGACY_MEMBER_GROUP, LOCAL_DB_RELPATH, type LatencyStats, Lattice, type LatticeConfig, type LatticeConfigInput, type LatticeEntityDef, type LatticeEntityRenderSpec, type LatticeFieldDef, type LatticeFieldType, type LatticeManifest, type LatticeOptions, type LinkOptions, type LlmClient, type LlmMessage, MAX_TRAVERSAL_DEPTH, type ManyToManySource, type MarkdownTableColumn, type MaterializeCtx, type MaterializeOptions, type MaterializeResult, type MaterializedRollupSpec, type MigrateResult, type Migration, type MigrationCheckpoint, type MigrationOptions, type MigrationProgress, type MigrationResult, type MigrationStatus, 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 PerQueryEval, type PkLookup, PostgresAdapter, type PostgresAdapterOptions, type PreparedStatement, type PrimaryKey, ProgressThrottle, type ProposedSchema, type ProvenanceConfig, type ProvenanceField, ProvenanceImmutableError, type QueryOptions, type QueryPageOptions, type QueryPageResult, type QueryProjection, READ_ONLY_HEADER, ROOT_DIRNAME, type RankingOptions, type ReadOnlyHeaderOptions, type RecencySignal, type ReconcileOptions, type ReconcileResult, type RefKind, type RefProvider, type ReferenceMetadata, ReferenceUnavailableError, type RefreshEmbeddingsOptions, type Relation, type RelevanceLabel, 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 RerankCandidate, type RerankScore, type RerankerFn, type ResolveOptions, type RetrievalEvalOptions, type RetrievalEvalSummary, type RetrievalHealthIssue, type RetrievalHealthReport, type RetrievalHealthSpec, type RetrievalSlo, type Retriever, type RetryOptions, type ReverseSeedDetection, type ReverseSeedResult, type ReverseSeedTableResult, type ReverseSyncError, type ReverseSyncResult, type ReverseSyncUpdate, type RewardScores, type RewardSignal, type RollupFunction, type Row, type RowVisibilityDefault, type S3Config, type S3StoreConfig, S3UnavailableError, S3_SECRET_TABLE, SQLiteAdapter, type SchemaEntity, type SchemaMatch, type SearchOptions, type SearchResult, type SecurityOptions, type SeedConfig, type SeedLinkSpec, SeedReconciliationError, type SeedResult, type SelfSource, type SemanticChunkerOptions, type SessionEntry, type SessionParseOptions, type SessionWriteEntry, type SessionWriteOp, type SessionWriteParseResult, type SloViolation, type SourceHandle, type SourceKeyStore, type SourceMetadata, type SourceQueryOptions, SourceShreddedError, type StartGuiServerOptions, type StopFn, type StorageAdapter, type SyncResult, TRUST_COLUMNS, type TableDefinition, type TableHealth, type TablePolicy, type TemplateRenderSpec, type TextChunk, type TraversalDirection, type TraversalNode, type TraversalOptions, type TrustConfig, type TrustState, type TurnParams, type TurnResult, type UnresolvedLink, type UpsertByNaturalKeyOptions, type UserIdentity, type UserPreferences, type VectorHit, 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, addEdge, addEdges, addWorkspace, adoptNativeEntities, allComputedDeps, analyticsEnabled, applyChunkedMigration, applyReranker, applyTokenBudget, applyWriteEntry, archiveLocalSqlite, assertSafeUrl, attachBlob, audiencePredicate, audienceViewSql, autoFtsColumns, autoUpdate, backfillOwnership, backlinkBoost, benchmarkRetrieval, buildVectorIndex, canManageRoles, checkSlos, chunkText, classifyLinks, cloudRlsInstalled, computeColumns, computedColumnDdl, computedColumnOrder, concatRowText, configDir, contentHash, cosineSimilarity, crawlUrl, createReadOnlyHeader, createS3Store, createSQLiteStateStore, decrypt, dedupeAndDetectViews, defaultWorkspaceYaml, deleteDbCredential, deleteToken, deriveCanonicalContexts, deriveKey, describeImage, describePdf, detectAsOf, detectAsOfCandidates, detectAsOfColumns, detectRetrievalRegressions, diagnoseRetrieval, discoverCloudTables, dropVectorIndex, enableAudienceView, enableChangelogRls, enableRlsForTable, encrypt, enrichKnowledge, ensureCheckpointTable, ensureEdgesTable, ensureEmbeddingsTable, ensureFtsIndex, ensureLatticeRoot, entityFileNames, estimateTokens, evaluateRetrieval, excelToRecords, extractEdgesFromColumn, extractObjects, filePresignSql, findLatticeRoot, fixSchemaConflicts, foldEntity, formatHealthReport, frontmatter, ftsTableName, fullTextSearch, generateEntryId, generateMemberPassword, generateWriteEntryId, getActiveWorkspace, getCloudSetting, getDbCredential, getMigrationCheckpoint, getOrCreateMasterKey, getTablePolicy, getWorkspace, grantPresignerToMemberGroup, graphAdjacencyBoost, hasFilePresigner, hasFtsIndex, hasVectorIndex, hashFile, hybridSearch, importLegacyUserConfig, inferFieldType, inferSchema, installCloudRls, installCloudSettings, installFilePresigner, isEncrypted, isNativeEntity, isPostgresUrl, isPrivateIp, isRetryableDbError, isRowAudience, latencyStats, listDbCredentials, listMigrationCheckpoints, listNativeBindings, listTokens, listWorkspaces, loadColumnPolicy, manifestPath, markdownTable, matchSchemaToExisting, materializeImport, memberGroupFor, memberRoleName, migrateLatticeData, neighbors, normalizeName, observationVisible, observationsFromChange, openTargetLatticeForMigration, openUnderSource, organizeSource, parseCellDate, parseConfigFile, parseConfigString, parseMarkdownEntries, parseMatches, parseObjects, parseSessionMD, parseSessionWrites, percentile, probeCloud, provenanceColumns, providerForUrl, provisionMemberRole, rankingBoost, readIdentity, readManifest, readPreferences, readRegistry, readToken, recencyBoost, referenceLocalFile, referenceUrl, refreshEmbeddings, regenerateAudienceViewFromDb, registerNativeEntities, registryPath, removeEdge, removeEmbedding, renameEntities, resolveActiveS3Config, resolveLatticeRoot, resolveProvenanceFields, resolveSource, resolveTrustDefault, resolveWorkspacePaths, resumeMigration, revertMigration, revokeMemberRole, rewardBoost, rollupColumnDdl, rootConfigDir, s3Key, saveDbCredential, saveDbCredentialForTeam, sealUnderSource, searchByEmbedding, searchVectorIndex, secureCloud, seedColumnPolicyFromYaml, semanticChunker, setActiveWorkspace, setCloudS3Secret, setCloudSetting, setColumnAudience, setRowVisibility, setTableDefaultVisibility, setTableNeverShare, shredSource, slugify, sourceRecords, startGuiServer, storeEmbedding, summarizeText, tableNeedsAudienceView, toSafeDirName, traverse, truncate, validateEntryId, vectorIndexAvailable, vectorIndexName, withRetry, workspaceBlobsDir, workspaceConfigPath, workspaceContextDir, workspaceDataDir, workspaceDbPath, workspaceDir, workspacesDir, writeIdentity, writeManifest, writePreferences, writeRegistry, writeToken };
8019
+ export { ALL_PROVENANCE_FIELDS, type AddWorkspaceOptions, type AdoptNativeOptions, type AdoptResult, type AggregateFunction, type AggregateHaving, type AggregateOptions, type AggregateResult, type AggregateSpec, type ApplyWriteResult, type AsOfCandidate, type AsOfColumnCandidate, type AsOfInputs, type AudienceRowCtx, type AuditEvent, type AuthorizeResult, type AutoUpdateResult, type BacklinkSignal, type BelongsToRelation, type BelongsToSource, type BenchmarkOptions, type BenchmarkReport, type BenchmarkScale, type BlobMetadata, BoundedReadError, type BuiltinTemplateName, CLOUD_SETTING_SYSTEM_PROMPT, CLOUD_SETTING_WORKSPACE_LOGO, CLOUD_SETTING_WORKSPACE_LOGO_ETAG, CONFIG_SUBDIR, CONNECTED_COLUMNS, CONNECTORS_TABLE, type CatalogEntity, type CatalogRecord, type ChangeEntry, type ChangelogOptions, type ChunkedMigrationOptions, type ChunkedMigrationResult, type ChunkerFn, type ClassifyMatch, type CleanupOptions, type CleanupResult, type CloudProbeResult, type CloudS3Secret, ComputedColumnCycleError, type ComputedColumnSpec, type ConnectedEdgeSpec, type ConnectedModelDef, ConnectedSourceImmutableError, type ConnectedVisibility, type ConnectionResult, type Connector, type ConnectorRecord, type ConnectorSource, type ConnectorStatus, ConnectorUnavailableError, type CountOptions, type CrawlOptions, type CrawlResult, type CreateConnectorInput, type CredentialConnector, type CredentialField, type CustomSignal, type CustomSource, DEFAULT_ENTRY_TYPES, DEFAULT_MAX_NODES, DEFAULT_STALE_MS, DEFAULT_TYPE_ALIASES, DenoSqliteAdapter, type DetectedView, type DiagnoseOptions, type DisconnectOptions, type DisconnectResult, type DiscoveredTable, EMBEDDINGS_TABLE, EmbeddingDimensionMismatchError, type EmbeddingRefreshResult, EmbeddingScanTooLargeError, type EmbeddingsConfig, type EnrichOptions, type EnrichResult, type EnrichedSource, type EnrichmentLookup, type EntityContextDefinition, type EntityContextManifestEntry, type EntityFileManifestInfo, type EntityFileSource, type EntityFileSpec, type EntityMatch, type EntityProfileField, type EntityProfileSection, type EntityProfileTemplate, type EntityRenderSpec, type EntityRenderTemplate, type EntitySectionPerRow, type EntitySectionsTemplate, type EntityTableColumn, type EntityTableTemplate, type EvalQuery, type EvalRegression, type ExistingTable, type ExtensionAvailability, type ExternalRecord, type ExtractEdgesSpec, type ExtractedObject, FileSourceKeyStore, type FileSourceKeyStoreOptions, type FilesRow, type Filter, type FilterAnd, type FilterExpr, type FilterOp, type FilterOr, FoldCache, type FtsConfig, type FtsGroup, type FtsHit, type FtsOptions, type FtsResult, type GraphBoostOptions, type GraphBoostResult, type GraphEdge, type GraphNode, type GraphTraversalResult, type GuiServerHandle, type HasManyRelation, type HasManySource, type HealthIssueKind, type HealthSeverity, type HybridScoreBreakdown, type HybridSearchOptions, type HybridSearchResult, IMMUTABLE_CONNECTED_FIELDS, type ImportMode, type ImportProgress, InMemorySourceKeyStore, InMemoryStateStore, type InferredColumn, type InferredDimension, type InferredEntity, type InferredLinkage, type InferredType, type InitOptions, JIRA_MODELS, type JiraClient, JiraConnector, type JiraCreds, LEGACY_MEMBER_GROUP, LOCAL_DB_RELPATH, type LatencyStats, Lattice, type LatticeConfig, type LatticeConfigInput, type LatticeEntityDef, type LatticeEntityRenderSpec, type LatticeFieldDef, type LatticeFieldType, type LatticeManifest, type LatticeOptions, type LinkOptions, type ListChangesContext, type LlmClient, type LlmMessage, MAX_TRAVERSAL_DEPTH, type ManyToManySource, type MarkdownTableColumn, type MaterializeCtx, type MaterializeOptions, type MaterializeResult, type MaterializedRollupSpec, type MigrateResult, type Migration, type MigrationCheckpoint, type MigrationOptions, type MigrationProgress, type MigrationResult, type MigrationStatus, 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 PerQueryEval, type PkLookup, PostgresAdapter, type PostgresAdapterOptions, type PreparedStatement, type PrimaryKey, ProgressThrottle, type ProposedSchema, type ProvenanceConfig, type ProvenanceField, ProvenanceImmutableError, type QueryOptions, type QueryPageOptions, type QueryPageResult, type QueryProjection, READ_ONLY_HEADER, ROOT_DIRNAME, type RankingOptions, type ReadOnlyHeaderOptions, type RecencySignal, type ReconcileOptions, type ReconcileResult, type RefKind, type RefProvider, type ReferenceMetadata, ReferenceUnavailableError, type RefreshEmbeddingsOptions, type Relation, type RelevanceLabel, 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 RerankCandidate, type RerankScore, type RerankerFn, type ResolveOptions, type RetrievalEvalOptions, type RetrievalEvalSummary, type RetrievalHealthIssue, type RetrievalHealthReport, type RetrievalHealthSpec, type RetrievalSlo, type Retriever, type RetryOptions, type ReverseSeedDetection, type ReverseSeedResult, type ReverseSeedTableResult, type ReverseSyncError, type ReverseSyncResult, type ReverseSyncUpdate, type RewardScores, type RewardSignal, type RollupFunction, type Row, type RowVisibilityDefault, type S3Config, type S3StoreConfig, S3UnavailableError, S3_SECRET_TABLE, SQLiteAdapter, type SchemaEntity, type SchemaMatch, type SearchOptions, type SearchResult, type SecurityOptions, type SeedConfig, type SeedLinkSpec, SeedReconciliationError, type SeedResult, type SelfSource, type SemanticChunkerOptions, type SessionEntry, type SessionParseOptions, type SessionWriteEntry, type SessionWriteOp, type SessionWriteParseResult, type SloViolation, type SourceHandle, type SourceKeyStore, type SourceMetadata, type SourceQueryOptions, SourceShreddedError, type StartGuiServerOptions, type StopFn, type StorageAdapter, type SyncConnectorOptions, type SyncConnectorResult, type SyncResult, TRELLO_MODELS, TRUST_COLUMNS, type TableDefinition, type TableHealth, type TablePolicy, type TemplateRenderSpec, type TextChunk, type ToolkitPresentation, type TraversalDirection, type TraversalNode, type TraversalOptions, type TrelloClient, TrelloConnector, type TrelloCreds, type TrelloPageOpts, type TrustConfig, type TrustState, type TurnParams, type TurnResult, type UnresolvedLink, type UpsertByNaturalKeyOptions, type UserIdentity, type UserPreferences, type VectorHit, 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, addEdge, addEdges, addWorkspace, adoptNativeEntities, allComputedDeps, analyticsEnabled, applyChunkedMigration, applyReranker, applyTokenBudget, applyWriteEntry, archiveLocalSqlite, assertSafeUrl, attachBlob, audiencePredicate, audienceViewSql, autoFtsColumns, autoUpdate, backfillOwnership, backlinkBoost, benchmarkRetrieval, buildVectorIndex, builtinConnectors, canManageRoles, checkSlos, chunkText, classifyLinks, clearJiraCreds, clearTrelloCreds, cloudRlsInstalled, collectConnectorKeys, computeColumns, computedColumnDdl, computedColumnOrder, concatRowText, configDir, connectedColumns, contentHash, cosineSimilarity, crawlUrl, createConnector, createReadOnlyHeader, createS3Store, createSQLiteStateStore, decrypt, dedupeAndDetectViews, defaultWorkspaceYaml, defineJiraTables, defineTrelloTables, deleteConnectorRecord, deleteDbCredential, deleteToken, deriveCanonicalContexts, deriveKey, describeImage, describePdf, detectAsOf, detectAsOfCandidates, detectAsOfColumns, detectRetrievalRegressions, diagnoseRetrieval, disconnectConnector, discoverCloudTables, dropVectorIndex, enableAudienceView, enableChangelogRls, enableConnectorRls, enableRlsForTable, encrypt, enrichKnowledge, ensureCheckpointTable, ensureConnectorRegistry, ensureEdgesTable, ensureEmbeddingsTable, ensureFtsIndex, ensureLatticeRoot, entityFileNames, estimateTokens, evaluateRetrieval, excelToRecords, extractEdgesFromColumn, extractObjects, filePresignSql, findLatticeRoot, fixSchemaConflicts, foldEntity, formatHealthReport, frontmatter, ftsTableName, fullTextSearch, generateEntryId, generateMemberPassword, generateWriteEntryId, getActiveWorkspace, getCloudSetting, getConnector, getConnectorByToolkit, getDbCredential, getJiraCreds, getMigrationCheckpoint, getOrCreateMasterKey, getTablePolicy, getTrelloCreds, getWorkspace, grantPresignerToMemberGroup, graphAdjacencyBoost, hasFilePresigner, hasFtsIndex, hasVectorIndex, hashFile, hybridSearch, importLegacyUserConfig, inferFieldType, inferSchema, installCloudRls, installCloudSettings, installFilePresigner, isCredentialConnector, isEncrypted, isNativeEntity, isPostgresUrl, isPrivateIp, isRetryableDbError, isRowAudience, latencyStats, listConnectors, listDbCredentials, listMigrationCheckpoints, listNativeBindings, listTokens, listWorkspaces, loadColumnPolicy, loadJiraClient, loadTrelloClient, manifestPath, markdownTable, matchSchemaToExisting, materializeImport, memberGroupFor, memberRoleName, migrateLatticeData, neighbors, normalizeName, observationVisible, observationsFromChange, openTargetLatticeForMigration, openUnderSource, organizeSource, parseCellDate, parseConfigFile, parseConfigString, parseMarkdownEntries, parseMatches, parseObjects, parseSessionMD, parseSessionWrites, percentile, probeCloud, provenanceColumns, providerForUrl, provisionMemberRole, rankingBoost, readIdentity, readManifest, readPreferences, readRegistry, readToken, recencyBoost, recordSync, referenceLocalFile, referenceUrl, refreshEmbeddings, regenerateAudienceViewFromDb, registerNativeEntities, registryPath, removeEdge, removeEmbedding, renameEntities, resolveActiveS3Config, resolveConnectorIdentity, resolveLatticeRoot, resolveProvenanceFields, resolveSource, resolveTrustDefault, resolveWorkspacePaths, resumeMigration, revertMigration, revokeMemberRole, rewardBoost, rollupColumnDdl, rootConfigDir, s3Key, saveDbCredential, saveDbCredentialForTeam, sealUnderSource, searchByEmbedding, searchVectorIndex, secureCloud, secureConnectorTables, seedColumnPolicyFromYaml, semanticChunker, setActiveWorkspace, setCloudS3Secret, setCloudSetting, setColumnAudience, setConnectorStatus, setJiraCreds, setRowVisibility, setTableDefaultVisibility, setTableNeverShare, setTrelloCreds, shredSource, slugify, sourceRecords, startGuiServer, storeEmbedding, summarizeText, syncConnector, syncIfStale, syncStaleConnectors, tableNeedsAudienceView, toSafeDirName, traverse, truncate, updateConnectorConnection, validateEntryId, vectorIndexAvailable, vectorIndexName, withRetry, workspaceBlobsDir, workspaceConfigPath, workspaceContextDir, workspaceDataDir, workspaceDbPath, workspaceDir, workspacesDir, writeIdentity, writeManifest, writePreferences, writeRegistry, writeToken };