@ai-matrx/messaging 0.8.0 → 0.9.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/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog — `@ai-matrx/messaging`
2
2
 
3
+ ## 0.9.0 — 2026-09-07
4
+
5
+ **`<MessagingProvider client={supabase}>` did not typecheck for a host with generated Supabase
6
+ types** — the one line the README tells every consumer to write.
7
+
8
+ ### Fixed
9
+
10
+ - **The public `client` prop type is now shallow.** Checking a fully-typed
11
+ `SupabaseClient<Database>` against the rich internal shape makes tsc chase PostgREST's schema
12
+ machinery until it bails with `TS2589: Type instantiation is excessively deep and possibly
13
+ infinite`, followed by a page of "not assignable" — so the only way to pass the client a host
14
+ already has was the cast this package's own header forbids. The boundary is method names and
15
+ arity with `unknown` results; the rich contract (`MessagingSupabaseInternal`, formerly the
16
+ public type's body) is still what everything inside works against, and the provider narrows to
17
+ it ONCE, in-package. Same lesson as data 0.2.1: type a public boundary over `unknown`, never
18
+ over a strict recursive type the host's generator also produces.
19
+ - **`createMessagingRepository` takes the same shallow client**, so the framework-free path a
20
+ service module uses (the README's "Outside React" section) compiles for the same host that the
21
+ provider does. Both legs are proven at compile time.
22
+ - **`supabase-shape.test.ts` now proves the consumer's leg**: a `SupabaseClient<Database>` is
23
+ assignable to `MessagingSupabaseClient`. The old proof deliberately checked only the CALLS,
24
+ noting that whole-interface assignability "makes tsc bail with TS2589, which is a compiler
25
+ limit, not a contract failure" — true, and precisely why the consumer could not compile. The
26
+ limit was the contract failure.
27
+
28
+ ### Consumer action (C28)
29
+
30
+ None, and one less cast: pass your `SupabaseClient` straight in. A host that had written
31
+ `client={supabase as never}` can delete the cast. `MessagingSupabaseInternal` is exported for
32
+ anyone building the repository directly.
33
+
3
34
  ## 0.8.0 — 2026-09-07
4
35
 
5
36
  **Every conversation in the first real inbox was titled with a raw UUID.** The second live defect
package/dist/index.cjs CHANGED
@@ -1571,12 +1571,13 @@ function requireOrg(organizationId, operation) {
1571
1571
  return organizationId;
1572
1572
  }
1573
1573
  function createMessagingRepository(options) {
1574
- const { client, identity } = options;
1574
+ const { identity } = options;
1575
1575
  const org = requireOrg(identity.organizationId, "createMessagingRepository");
1576
1576
  const userCache = createReadCache({
1577
1577
  ttlMs: options.userTtlMs ?? 5 * 6e4,
1578
1578
  ...options.now !== void 0 ? { now: options.now } : {}
1579
1579
  });
1580
+ const client = options.client;
1580
1581
  const db = () => client.schema(MESSAGING_SCHEMA);
1581
1582
  const rpcDb = () => client.schema(MESSAGING_RPC_SCHEMA);
1582
1583
  async function withSessionRetry(operation, run) {