@abloatai/ablo 0.33.0 → 0.34.1

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.
Files changed (45) hide show
  1. package/AGENTS.md +2 -0
  2. package/CHANGELOG.md +22 -0
  3. package/dist/cli.cjs +500 -383
  4. package/dist/client/Ablo.js +3 -2
  5. package/dist/client/createModelProxy.d.ts +53 -10
  6. package/dist/client/createModelProxy.js +24 -5
  7. package/dist/client/httpTransport.js +1 -0
  8. package/dist/client/resourceTypes.d.ts +10 -1
  9. package/dist/client/wsMutationExecutor.d.ts +2 -2
  10. package/dist/client/wsMutationExecutor.js +1 -1
  11. package/dist/coordination/index.d.ts +2 -2
  12. package/dist/coordination/index.js +1 -1
  13. package/dist/coordination/schema.d.ts +20 -0
  14. package/dist/coordination/schema.js +22 -0
  15. package/dist/errorCodes.d.ts +1 -1
  16. package/dist/errorCodes.js +1 -1
  17. package/dist/interfaces/index.d.ts +13 -1
  18. package/dist/react/AbloProvider.d.ts +8 -8
  19. package/dist/react/AbloProvider.js +6 -6
  20. package/dist/react/index.d.ts +2 -2
  21. package/dist/react/index.js +2 -2
  22. package/dist/server/commit.d.ts +8 -1
  23. package/dist/surface.d.ts +1 -1
  24. package/dist/surface.js +2 -1
  25. package/dist/sync/SyncWebSocket.d.ts +3 -3
  26. package/dist/sync/SyncWebSocket.js +4 -4
  27. package/dist/sync/commitFrames.d.ts +2 -2
  28. package/dist/sync/commitFrames.js +5 -1
  29. package/dist/transactions/TransactionQueue.d.ts +4 -1
  30. package/dist/transactions/TransactionQueue.js +18 -0
  31. package/dist/transactions/commitEnvelope.d.ts +8 -0
  32. package/dist/transactions/commitEnvelope.js +2 -1
  33. package/dist/transactions/durableWriteStore.d.ts +8 -0
  34. package/dist/wire/frames.d.ts +17 -1
  35. package/dist/wire/frames.js +2 -1
  36. package/docs/client-behavior.md +1 -1
  37. package/docs/coordination.md +5 -5
  38. package/docs/groups.md +50 -0
  39. package/docs/identity.md +2 -2
  40. package/docs/index.md +2 -0
  41. package/docs/migration.md +29 -5
  42. package/docs/operating-on-your-database.md +109 -0
  43. package/docs/react.md +9 -9
  44. package/llms.txt +1 -1
  45. package/package.json +1 -1
package/AGENTS.md CHANGED
@@ -19,6 +19,8 @@ Don't hand-write the integration. Run the CLI; it generates the current-API sche
19
19
 
20
20
  When you use the signed-endpoint fallback, the generated `ablo/data-source.ts` is the whole endpoint and needs no hand-editing: `dataSourceNext({ schema, apiKey, adapter: prismaDataSource(prisma, schema) })` (or `drizzleDataSource(db, schema)`). The adapter owns commit / idempotency / outbox.
21
21
 
22
+ **Working on a real database?** Ablo never runs DDL, migrates, or drops on your database, and every model write is claim-checked and reversible in the log — so reads and `ablo.<model>.update(...)` are yours to run freely, while raw DDL (`ALTER TABLE …`) and a `--yes` cutover belong to a human. When you're unsure whether a write fits, `npx ablo check` reports the live column-by-column fit read-only, before anything runs. Full sorting rule: [Operating on Your Database](./docs/operating-on-your-database.md).
23
+
22
24
  ## Rule
23
25
 
24
26
  Edit the generated files; teach this API only:
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.34.1
4
+
5
+ ### Patch Changes
6
+
7
+ Connecting a database whose tables are owned by an earlier integration's role now just works, with no manual step. When `ablo connect --apply` publishes your tables and grants the writer role access to them, Postgres reserves both operations for each table's owner — so if you reach that owner only through a membership that doesn't inherit its privileges, which is the ordinary shape on managed Postgres where a top role administers everything else without holding superuser, the run would otherwise stop partway through. Apply now clears that itself. It grants your admin inheritance of the owning role as the first step of the plan — shown in the preview and covered by the same confirmation you already give, `GRANT <owner> TO <your-admin> WITH INHERIT TRUE`, the per-membership inheritance Postgres 16 introduced — so the admin acts with the owner's authority for the rest of the setup, with no ownership change and reversible by `WITH INHERIT FALSE`. You approve the plan; you never run a line of SQL. The previous release had only detected the situation and suggested reassigning the table's ownership, which is itself reserved for the current owner and so couldn't run from where you stood; apply now does the one thing that can, and does it for you. Only when your admin genuinely can't take that authority — when it isn't a member with admin option of the owning role — does apply stop, and then it names the exact grant an authorized role must run, or the drop for the idempotency ledger. The same handling covers that ledger, which had kept an older, stricter ownership test that could turn away an admin who in fact inherited the owner.
8
+
9
+ The line printed once a database registers has been rewritten to say what happened and what comes next — that your database is connected, that reads follow its replication stream while writes go through Ablo and land in your own tables, and that `ablo connect check` verifies the connection at any time — in place of the internal shorthand it printed before.
10
+
11
+ A new page, **Operating on Your Database**, sets out the safety model for working on a live database through Ablo: which actions run freely because they are read-only or reversible, which to verify against the database first, and which change the database itself and belong to a human — written so a person or an agent can sort any action into the right one and stop guessing which move is the dangerous one.
12
+
13
+ ## 0.34.0
14
+
15
+ ### Minor Changes
16
+
17
+ A long-running actor has a stale-context problem the per-commit read gate never reaches. The `reads` guard is a premise for the commit in hand: you declare what you looked at, the server checks it at commit, and the premise is gone. That fits an actor that reads and writes in one breath, not one that reads a row, works for minutes — an LLM call, a fetch, a human's turn — and only then writes. By the time it commits, the premise it would have declared is already old, and there was no commit in between on which to hear that the ground had shifted. This release adds `track`, the durable half of the same idea. `ablo.<model>.track({ id })` registers a read-dependency that persists on the server; the next time you commit anything, a change that landed on the tracked row since you registered rides back on the receipt's `notifications` — the same `StaleNotification` an `onStale: 'notify'` premise hands you, arriving on the write you were going to make anyway. You can also register one as part of a write, `track: [{ group: 'deck:abc' }]` alongside the batch, the standing-subscription companion to the single-commit `reads`. A track is idempotent — registering the same target again refreshes the one subscription rather than stacking duplicates — it re-baselines after it fires so a given change notifies once, and it never notifies you of your own writes, since the signal is about what others did. Delivery is on your next commit's receipt; a track does not yet push out of band between commits, so it sharpens the write-time freshness check rather than replacing a live subscription.
18
+
19
+ The model-level presence verb is renamed from `watch` to `join`. It read like a data subscription but delivered presence — who else is on a set of rows and what they hold — so it now says what it does. `ablo.<model>.join(ids, { ttl })` opens the participant handle, with `.peers`, the scoped claim stream, and `await using` disposal unchanged; the handle's `status` was already `'joined'` and the layer beneath always called itself join, so the verb now matches the thing it returns. `onChange` remains the way to hear a row's *values* change, and `track` is the durable read-dependency for actors — three distinct jobs that the one overloaded `watch` used to blur. The React hook follows: `useWatch` becomes `useJoin`, the `WatchOptions` / `UseWatchOptions` / `UseWatchReturn` types become `JoinOptions` / `UseJoinOptions` / `UseJoinReturn`, and the error code `model_watch_not_configured` is now `model_join_not_configured`. There is no compatibility alias — rename the call sites and the type imports. The migration guide carries the mechanical diff.
20
+
21
+ ### Patch Changes
22
+
23
+ `ablo connect --apply` now checks, before it runs any grants, that you can actually grant on the tables you're publishing — and stops with the one-line fix if you can't, instead of failing partway through. The setup grants the writer role access to each published table, an operation Postgres reserves for the table's owner, so a table left owned by an earlier integration's role used to abort the run midway with a bare `must be owner of table …` and no guidance. Apply now names the offending tables and their owner up front and prints the exact `ALTER TABLE … OWNER TO` to reassign them to your admin — metadata only, your rows and row-level-security policies untouched. The check understands inherited role membership, so an admin that inherits the owning role — the ordinary managed-Postgres case — is left to proceed rather than stopped needlessly; only a membership that can't act as the owner is flagged.
24
+
3
25
  ## 0.33.0
4
26
 
5
27
  ### Minor Changes