latticesql 3.4.7 → 4.0.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/README.md +18 -12
- package/dist/cli.js +18539 -16882
- package/dist/index.cjs +8022 -6370
- package/dist/index.d.cts +296 -136
- package/dist/index.d.ts +296 -136
- package/dist/index.js +8001 -6342
- package/docs/MIGRATING-4.0.md +407 -0
- package/docs/bugs/2026-06-19-cloud-switch-hang-per-table-migration.md +64 -0
- package/docs/cli.md +3 -1
- package/docs/configuration.md +66 -29
- package/docs/consistency.md +117 -0
- package/docs/examples/agent-system.md +6 -2
- package/docs/examples/cms.md +3 -1
- package/docs/examples/ticket-tracker.md +10 -4
- package/docs/scaling.md +56 -0
- package/docs/templates.md +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,6 +24,8 @@ Every AI agent session starts cold — no memory of what happened yesterday, wha
|
|
|
24
24
|
|
|
25
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.
|
|
26
26
|
|
|
27
|
+
**New in 4.0 (major release — mostly drop-in):** a major version that decomposes the three largest internal modules and hardens the cloud path for many simultaneous users, while keeping the `Lattice` / GUI surface stable. **Existing 3.0+ configs and databases are migrated forward SILENTLY on open** — you usually need to do nothing. The breaking changes are auto-handled on open (or clearly documented): the per-field `ref:` shorthand is still parsed (and the GUI rewrites it to the explicit `relations:` block on disk); a legacy empty-string `deleted_at` is normalized to `NULL`; a legacy `files.path`-only row is backfilled into the reference model; the render manifest is v2-only and self-upgrades on first render. The one consumer-code change: the exported `MEMBER_GROUP` constant is replaced by **`memberGroupFor(db)`** (the member group role is now **per-cloud** — derived from the database/schema — so unrelated clouds on one Postgres cluster no longer share a group). Opening a cloud workspace is now **much faster** (one batched schema introspection instead of per-table round-trips; the owner-side RLS/grant convergence runs in the background since the owner is BYPASSRLS). See **[docs/MIGRATING-4.0.md](docs/MIGRATING-4.0.md)** for the (mostly no-op) migration and the manual steps for library/non-GUI consumers.
|
|
28
|
+
|
|
27
29
|
**New in 3.4:** the browser GUI now **updates itself** — launched from an npm install it silently installs the latest published version and keeps checking in the background, relaunching on the same port while the open tab auto-reloads onto the new build (a git checkout / `npx` copy is left untouched); **file loopback** — editing a rendered `.md` context file on disk flows back into the database through the normal write path (changelog/versioned/undoable, live in the GUI), with a public [`reverseSyncFromFiles()`](docs/api-reference.md) for embedders; on a cloud, a member's **rendered context is now scoped to their own visibility** (rendered through their RLS connection + masking view, so their assistant only ever reads rows they may see); the assistant gains a **`get_row_context`** tool (reads a record's pre-joined rendered context in one call) and **`add_column`** (add a field to an existing table on request); and the cloud gets resilience + search fixes — the open-time converge is **per-table fault-isolated** (one un-manageable table no longer breaks the whole workspace), `migrate-to-cloud` now builds the full-text index (with a public [`rebuildFtsIndexes()`](docs/api-reference.md)), and a plaintext `postgres://` URL in a config is healed into an encrypted credential reference on open. New `GET /api/version`, `GET /api/update/status`, and `POST /api/workspaces/reload` endpoints. See [docs/workspaces.md](docs/workspaces.md), [docs/cloud.md](docs/cloud.md), and [docs/assistant.md](docs/assistant.md).
|
|
28
30
|
|
|
29
31
|
**New in 2.1:** the GUI search box now asks the **assistant** (it answers using a full-text `search` tool) instead of running a plain text match; the assistant gains a **guarded, reversible `delete_entity`** (empty tables go immediately, non-empty tables ask what to do with the data first); new chat threads are named from a short AI summary; ingest failures are surfaced loudly instead of swallowed; and the activity feed, voice-note composer, upload timer, and live counts get a round of fixes. See [docs/assistant.md](docs/assistant.md).
|
|
@@ -1907,7 +1909,9 @@ entities:
|
|
|
1907
1909
|
title: { type: text, required: true }
|
|
1908
1910
|
status: { type: text, default: open }
|
|
1909
1911
|
priority: { type: integer, default: 1 }
|
|
1910
|
-
assignee_id: { type: uuid
|
|
1912
|
+
assignee_id: { type: uuid } # plain FK column
|
|
1913
|
+
relations:
|
|
1914
|
+
assignee: { type: belongsTo, table: user, foreignKey: assignee_id }
|
|
1911
1915
|
render:
|
|
1912
1916
|
template: default-list
|
|
1913
1917
|
formatRow: '{{title}} ({{status}}) — {{assignee.name}}'
|
|
@@ -1932,13 +1936,14 @@ entities:
|
|
|
1932
1936
|
|
|
1933
1937
|
**Field options**
|
|
1934
1938
|
|
|
1935
|
-
| Option | Type | Description
|
|
1936
|
-
| ------------ | ------------------ |
|
|
1937
|
-
| `type` | `LatticeFieldType` | Column data type (required)
|
|
1938
|
-
| `primaryKey` | boolean | Primary key column (`TEXT PRIMARY KEY` for uuid/text)
|
|
1939
|
-
| `required` | boolean | `NOT NULL` constraint
|
|
1940
|
-
| `default` | string/number/bool | SQL `DEFAULT` value
|
|
1941
|
-
|
|
1939
|
+
| Option | Type | Description |
|
|
1940
|
+
| ------------ | ------------------ | ----------------------------------------------------- |
|
|
1941
|
+
| `type` | `LatticeFieldType` | Column data type (required) |
|
|
1942
|
+
| `primaryKey` | boolean | Primary key column (`TEXT PRIMARY KEY` for uuid/text) |
|
|
1943
|
+
| `required` | boolean | `NOT NULL` constraint |
|
|
1944
|
+
| `default` | string/number/bool | SQL `DEFAULT` value |
|
|
1945
|
+
|
|
1946
|
+
> Foreign-key relationships are declared at the **entity level** via `relations:` (see the entity-context examples above), not as a per-field option. The former per-field `ref:` shorthand was removed in 4.0 — a config that still uses it fails with a clear error pointing at `relations:`.
|
|
1942
1947
|
|
|
1943
1948
|
**Entity-level options**
|
|
1944
1949
|
|
|
@@ -2120,10 +2125,11 @@ trail tracks the drill path. **Click any value to edit it in place** — the cha
|
|
|
2120
2125
|
saves immediately via `PATCH` and is undoable. Native `files` rows show the inline
|
|
2121
2126
|
file/markdown preview; their binary metadata stays read-only.
|
|
2122
2127
|
|
|
2123
|
-
Relationships come from the schema: a `belongsTo` (
|
|
2124
|
-
a parent link, while the reverse side (other
|
|
2125
|
-
many-to-many junctions become the drill-in
|
|
2126
|
-
foreign-key
|
|
2128
|
+
Relationships come from the schema: a `belongsTo` (declared in an entity's
|
|
2129
|
+
`relations:` block) renders as a parent link, while the reverse side (other
|
|
2130
|
+
entities that point here) plus many-to-many junctions become the drill-in
|
|
2131
|
+
sub-folders. Declare a `belongsTo` relation for each foreign-key field to get the
|
|
2132
|
+
nested file tree.
|
|
2127
2133
|
|
|
2128
2134
|
The header carries the logo, undo/redo, the **workspace switcher**, and a
|
|
2129
2135
|
**settings gear** (top-right). The gear opens a slide-over drawer with **Workspace**,
|