latticesql 1.14.0 → 1.16.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/LICENSE +1 -1
- package/README.md +69 -3
- package/dist/cli.js +6885 -1954
- package/dist/index.cjs +2147 -613
- package/dist/index.d.cts +643 -6
- package/dist/index.d.ts +643 -6
- package/dist/index.js +2102 -612
- package/package.json +4 -1
package/LICENSE
CHANGED
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
|
|
168
168
|
END OF TERMS AND CONDITIONS
|
|
169
169
|
|
|
170
|
-
Copyright 2026 M-Flat Inc
|
|
170
|
+
Copyright 2026 Automated Industries (M-Flat Inc)
|
|
171
171
|
|
|
172
172
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
173
173
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -19,10 +19,13 @@ Every AI agent session starts cold — no memory of what happened yesterday, wha
|
|
|
19
19
|
3. **Ingests** agent-written output back into the DB via the writeback pipeline
|
|
20
20
|
4. **Manages** state with full CRUD, natural-key operations, seeding, and soft-delete
|
|
21
21
|
5. **Optimizes** context with token budgets, relevance filtering, enrichment pipelines, and reward-scored memory
|
|
22
|
-
6. **Searches** semantically
|
|
22
|
+
6. **Searches** full-text (FTS5 / `tsvector`, with a LIKE fallback) and semantically (bring-your-own embeddings + cosine similarity)
|
|
23
|
+
7. **Organizes** everything into `.lattice` workspaces with a local browser GUI, a workspace dashboard, changelog/version history, and a SQL↔markdown context bridge that auto-renders on every write
|
|
23
24
|
|
|
24
25
|
Lattice has no opinions about your schema, your agents, or your file format. You define the tables. You control the rendering. Lattice runs the sync loop.
|
|
25
26
|
|
|
27
|
+
**New in 1.16:** the `.lattice` workspace model + auto-render, full-text search, sources/references, a workspace dashboard, a **multiplayer cloud-editing** experience (live share/de-share, "last edited by", change-flash + counts, and an offline edit queue that replays on reconnect), and a much richer **Data Model editor** in the GUI — a force-directed schema graph, bidirectional many-to-many links, and a soft-delete model where every schema change (create/rename/delete a table, column, or link) is tracked in version history and **reversible** (deletes never destroy data; revert restores it), with session-scoped undo/redo. All with no AI dependency. See [docs/workspaces.md](docs/workspaces.md) and [docs/collaboration.md](docs/collaboration.md). The AI assistant, chat, and ingest summarization are exclusive to the 2.0 line (2.0 = the 1.16 feature set plus that AI layer).
|
|
28
|
+
|
|
26
29
|
---
|
|
27
30
|
|
|
28
31
|
## Table of contents
|
|
@@ -804,6 +807,16 @@ await db.seed({
|
|
|
804
807
|
});
|
|
805
808
|
```
|
|
806
809
|
|
|
810
|
+
A junction link whose target row doesn't resolve is **never silently dropped**. `SeedResult.unresolvedLinks` lists every such link (source record, field, target name, junction). Pass `onUnresolvedLink: 'throw'` to abort with a `SeedReconciliationError` instead — for pipelines that must never leave a record citing a relationship that has no link in the graph:
|
|
811
|
+
|
|
812
|
+
```typescript
|
|
813
|
+
const result = await db.seed({ ...config, onUnresolvedLink: 'collect' });
|
|
814
|
+
if (result.unresolvedLinks.length) {
|
|
815
|
+
// create the missing targets, then re-seed
|
|
816
|
+
console.warn('unresolved links:', result.unresolvedLinks);
|
|
817
|
+
}
|
|
818
|
+
```
|
|
819
|
+
|
|
807
820
|
### `buildReport()` (v0.14+)
|
|
808
821
|
|
|
809
822
|
```typescript
|
|
@@ -2065,6 +2078,52 @@ npx lattice gui
|
|
|
2065
2078
|
npx lattice gui --config ./lattice.config.yml --output ./context --port 4317
|
|
2066
2079
|
```
|
|
2067
2080
|
|
|
2081
|
+
### File-system workspace (v2.0+)
|
|
2082
|
+
|
|
2083
|
+
By default the GUI is a **file-system-style workspace**. The home dashboard shows
|
|
2084
|
+
one card per object; clicking in opens that object's rows as a grid of **folder
|
|
2085
|
+
tiles** rather than a spreadsheet. Click a tile to open an **item view** that
|
|
2086
|
+
renders the row as a document built from its columns — long-form fields render as
|
|
2087
|
+
formatted markdown — alongside that row's relationships as **sub-folders** you can
|
|
2088
|
+
keep opening (e.g. _Authors → a person → Books → a book → Reviews_). A breadcrumb
|
|
2089
|
+
trail tracks the drill path. **Click any value to edit it in place** — the change
|
|
2090
|
+
saves immediately via `PATCH` and is undoable. Native `files` rows show the inline
|
|
2091
|
+
file/markdown preview; their binary metadata stays read-only.
|
|
2092
|
+
|
|
2093
|
+
Relationships come from the schema: a `belongsTo` (a field with `ref:`) renders as
|
|
2094
|
+
a parent link, while the reverse side (other entities that point here) plus
|
|
2095
|
+
many-to-many junctions become the drill-in sub-folders. Declare `ref:` on your
|
|
2096
|
+
foreign-key fields to get the nested file tree.
|
|
2097
|
+
|
|
2098
|
+
The header carries the logo, undo/redo, the workspace (database) switcher, and a
|
|
2099
|
+
**settings gear** (top-right). The gear opens a slide-over drawer with **Database**,
|
|
2100
|
+
**Lattice**, and **User** settings plus an **Advanced mode** toggle. Turn Advanced
|
|
2101
|
+
mode on to switch the object/row views back to the classic editable **table + row**
|
|
2102
|
+
interface (below); turn it off for the file-system workspace. The left sidebar is
|
|
2103
|
+
slim and collapsible. The assistant rail is unchanged in either mode.
|
|
2104
|
+
|
|
2105
|
+
### Assistant sidebar (v2.0+)
|
|
2106
|
+
|
|
2107
|
+
The GUI has a fixed right sidebar with a live **activity feed** — every change
|
|
2108
|
+
(yours, the assistant's, or an ingest) streams in as it happens.
|
|
2109
|
+
|
|
2110
|
+
Add a Claude API token in **User Settings → Assistant** (or set
|
|
2111
|
+
`ANTHROPIC_API_KEY`) to enable the **AI assistant**: ask questions about your
|
|
2112
|
+
data or instruct edits in natural language. The assistant calls the same
|
|
2113
|
+
operations the UI does, so its changes are audited, shown in the feed, and
|
|
2114
|
+
undoable. A Claude subscription can be connected instead via OAuth when the
|
|
2115
|
+
`ANTHROPIC_OAUTH_*` environment variables are configured.
|
|
2116
|
+
|
|
2117
|
+
Optional extras, each enabled by its own key/binary:
|
|
2118
|
+
|
|
2119
|
+
- **Voice** — set an OpenAI (Whisper) or ElevenLabs key to dictate into the composer.
|
|
2120
|
+
- **File ingest** — reference a local file or paste text; it becomes a row in the
|
|
2121
|
+
native `files` entity with extracted text + (with a Claude key) an
|
|
2122
|
+
LLM-written description and links to related records. PDFs/office docs use the
|
|
2123
|
+
optional [`markitdown`](https://github.com/microsoft/markitdown) CLI when installed.
|
|
2124
|
+
|
|
2125
|
+
Chat threads, files, and secrets are all stored as native Lattice entities.
|
|
2126
|
+
|
|
2068
2127
|
**Options**
|
|
2069
2128
|
|
|
2070
2129
|
| Flag | Default | Description |
|
|
@@ -2091,11 +2150,16 @@ The convergence means you don't need to duplicate entity-context definitions in
|
|
|
2091
2150
|
|
|
2092
2151
|
**Dashboard renders every entity (v1.13.3+).** Previously the dashboard cards filtered through a hardcoded entity list (`meetings`, `people`, `messages`, `projects`, `repositories`, `files`). Installs whose YAML declared different names saw a blank dashboard. Now every first-class entity gets a card; the hardcoded list survives as an ordering preference only.
|
|
2093
2152
|
|
|
2153
|
+
**Approximate row counts on Postgres (v1.14.1+).** The dashboard / entity-list view reads row counts from `pg_class.reltuples` (the planner statistic maintained by `ANALYZE` / autovacuum) so that a single query covers every table. Older versions issued one `COUNT(*)` per table in parallel, which exhausted small connection pools (e.g. a 95-table database against Supabase's 15-slot session pooler). The trade is that list-view counts are approximate and include soft-deleted rows for tables that have a `deleted_at` column; per-table drill-in still shows exact filtered counts. SQLite-backed installs are unaffected and continue to show exact, soft-delete-aware counts (no pool to exhaust).
|
|
2154
|
+
|
|
2094
2155
|
**Views**
|
|
2095
2156
|
|
|
2096
2157
|
- **Dashboard** (`#/`) — one card per first-class entity with live row counts.
|
|
2097
|
-
- **
|
|
2098
|
-
- **
|
|
2158
|
+
- **Workspace / folder grid** (`#/fs/<entity>`, default mode, v2.0+) — the entity's rows as folder/file tiles.
|
|
2159
|
+
- **Item view** (`#/fs/<entity>/<id>[/<relation>/<id>…]`, default mode, v2.0+) — the row as a click-to-edit document plus its relationships as sub-folders; drill arbitrarily deep, with a clickable breadcrumb.
|
|
2160
|
+
- **Table view** (`#/objects/<entity>`, Advanced mode) — intrinsic columns, `belongsTo` chips, and a column per junction this entity participates in.
|
|
2161
|
+
- **Detail view** (`#/objects/<entity>/<id>`, Advanced mode) — read mode by default; `Edit` flips cells into inputs (`Save` PATCHes, `Cancel` reverts).
|
|
2162
|
+
- **Settings** (v2.0+) — opened from the header gear (Database / Lattice / User tabs + the Advanced-mode toggle); the legacy `#/settings/*` hashes still resolve and open the drawer.
|
|
2099
2163
|
- **Data Model** (inside **Database Settings**, v1.14+) — entity-level graph including the native `files`/`secrets` objects, with a per-entity editor. On a team cloud each table you own carries a **Share with team / Unshare** toggle. (Pre-1.14 this was a separate `#/settings/data-model` nav item; that hash still resolves for back-compat.)
|
|
2100
2164
|
|
|
2101
2165
|
**Internal tables added on first open**
|
|
@@ -2642,6 +2706,8 @@ DO_NOT_TRACK=1 npm install latticesql
|
|
|
2642
2706
|
npm install latticesql --ignore-scripts
|
|
2643
2707
|
```
|
|
2644
2708
|
|
|
2709
|
+
**In-app opt-out (consent preference)** — in the GUI, open **Settings → User → Preferences** and uncheck **"Send anonymous analytics"** (or set `"analytics": false` in `~/.lattice/preferences.json`). This is the single consent for all anonymous analytics Lattice shares via Scarf — the install ping and any Scarf pixel — so in-app updates (`lattice update` / `autoUpdate()`) suppress the Scarf ping and any future runtime telemetry is gated. Analytics is **on by default** (opt-out). The original `npm install` ping is governed at install time by the env-var options above — the preference governs reinstalls, not the install you already ran.
|
|
2710
|
+
|
|
2645
2711
|
Opting out has no effect on functionality — the package works identically. The Scarf postinstall is a fire-and-forget HTTPS ping with a short timeout; even when enabled it cannot fail your install.
|
|
2646
2712
|
|
|
2647
2713
|
See Scarf's own [privacy documentation](https://docs.scarf.sh) for the upstream policy.
|