@ai-matrx/records 0.84.4 → 0.84.6

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 (36) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/app-table/index.cjs +51 -2
  3. package/dist/app-table/index.cjs.map +1 -1
  4. package/dist/app-table/index.d.cts +3 -3
  5. package/dist/app-table/index.d.ts +3 -3
  6. package/dist/app-table/index.js +51 -2
  7. package/dist/app-table/index.js.map +1 -1
  8. package/dist/{client-TU-nvgcF.d.ts → client-Cx2JV38-.d.ts} +7 -1
  9. package/dist/{client-CesQciPd.d.cts → client-xErw4ZgF.d.cts} +7 -1
  10. package/dist/core/index.cjs +59 -4
  11. package/dist/core/index.cjs.map +1 -1
  12. package/dist/core/index.d.cts +12 -5
  13. package/dist/core/index.d.ts +12 -5
  14. package/dist/core/index.js +59 -4
  15. package/dist/core/index.js.map +1 -1
  16. package/dist/data/index.cjs +51 -2
  17. package/dist/data/index.cjs.map +1 -1
  18. package/dist/data/index.d.cts +2 -2
  19. package/dist/data/index.d.ts +2 -2
  20. package/dist/data/index.js +51 -2
  21. package/dist/data/index.js.map +1 -1
  22. package/dist/{declareTable-COXYIOiT.d.ts → declareTable-CYzGWD5K.d.ts} +2 -2
  23. package/dist/{declareTable-B9sr2E0h.d.cts → declareTable-G-H3AK48.d.cts} +2 -2
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +2 -2
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.js.map +1 -1
  28. package/dist/react/index.cjs +66 -5
  29. package/dist/react/index.cjs.map +1 -1
  30. package/dist/react/index.d.cts +16 -1
  31. package/dist/react/index.d.ts +16 -1
  32. package/dist/react/index.js +66 -5
  33. package/dist/react/index.js.map +1 -1
  34. package/dist/{table-kind-C5T-DOdc.d.ts → table-kind-B_qYmQJG.d.ts} +10 -1
  35. package/dist/{table-kind-B4vIKJVM.d.cts → table-kind-KMjVs-rk.d.cts} +10 -1
  36. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog — @ai-matrx/records
2
2
 
3
+ ## 0.84.6
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/records/v0.84.5..npm/records/v0.84.6 -- apps/shared/records`).
7
+ No source changes intended and no consumer action required.
8
+
9
+ ## 0.84.5
10
+ ### Unreleased
11
+ ### lane spaces-fixes-r39
12
+
13
+ - An archived record is no longer read again: `recordDelete` marks it removed (`markRecordRemoved`, lifted by `recordRestore`), and the live `useRecord` entry of a screen that closed (a peek) skips its re-read on the archive's change announcement and on realtime's echo of it — `custom.read_record` answered both with a 400.
14
+
15
+ **Consumer action:** none.
16
+
3
17
  ## 0.84.4
4
18
 
5
19
  Automatic changed-only republish (docs/metadata drift since the last tag — see
@@ -476,6 +476,13 @@ function announceRecordChanged(recordId) {
476
476
  }
477
477
  }
478
478
  }
479
+ var removed = /* @__PURE__ */ new Set();
480
+ function markRecordRemoved(recordId) {
481
+ removed.add(recordId);
482
+ }
483
+ function markRecordRestored(recordId) {
484
+ removed.delete(recordId);
485
+ }
479
486
  function onRecordChanged(listener) {
480
487
  listeners.add(listener);
481
488
  return () => listeners.delete(listener);
@@ -1981,6 +1988,10 @@ var OWED_BY = {
1981
1988
  // clone; they reach the main database when the chair applies them, after
1982
1989
  // visionreach_w4_a_the_store_asks_before_an_agent_changes_a_table.sql (its field_declare body).
1983
1990
  reverse_columns: "VIEWS-AND-FIELDS BL \u2014 matrx-frontend migrations/campaign/viewsfields_bl_a_link_shows_on_both_tables.sql (chair's production apply)",
1991
+ // SEED-ENTITY (2026-10-08): the same links through SEVERAL reverse columns in one call; applied to production
1992
+ // through the ledgered runner. Until `pnpm records:generate` lists it, `reverseLinksFields` asks it as an owed door
1993
+ // and a store without it answers `door_absent` (the caller falls back to one call per column).
1994
+ reverse_links_many_fields: "SEED-ENTITY \u2014 matrx-frontend migrations/campaign/seedentity_reverse_links_many_fields.sql (applied 2026-10-08)",
1984
1995
  reverse_links_many: "VIEWS-AND-FIELDS BL \u2014 matrx-frontend migrations/campaign/viewsfields_bl_a_link_shows_on_both_tables.sql (chair's production apply)",
1985
1996
  // Live on Matrx Main since 2026-10-06 (applied through the Supabase MCP); STORE_DOORS lists it at the
1986
1997
  // next `pnpm records:generate`, until then `listKeyset` asks it as an owed door.
@@ -2221,6 +2232,7 @@ var DOORS = {
2221
2232
  // links through one of them. Called through `owedDoor` until `pnpm records:generate` lists them.
2222
2233
  reverseColumns: "reverse_columns",
2223
2234
  reverseLinksMany: "reverse_links_many",
2235
+ reverseLinksManyFields: "reverse_links_many_fields",
2224
2236
  homeAdd: "home_add",
2225
2237
  recordReparent: "record_reparent",
2226
2238
  containmentChain: "containment_chain",
@@ -3281,7 +3293,10 @@ function createRecordsClient(given) {
3281
3293
  { p_organization_id: org, p_record_id: record_id },
3282
3294
  "recordDelete"
3283
3295
  );
3284
- if (result.ok) announceRecordChanged(record_id);
3296
+ if (result.ok) {
3297
+ markRecordRemoved(record_id);
3298
+ announceRecordChanged(record_id);
3299
+ }
3285
3300
  return result;
3286
3301
  },
3287
3302
  async recordRestore({ record_id }) {
@@ -3290,7 +3305,10 @@ function createRecordsClient(given) {
3290
3305
  { p_organization_id: org, p_record_id: record_id },
3291
3306
  "recordRestore"
3292
3307
  );
3293
- if (result.ok) announceRecordChanged(record_id);
3308
+ if (result.ok) {
3309
+ markRecordRestored(record_id);
3310
+ announceRecordChanged(record_id);
3311
+ }
3294
3312
  return result;
3295
3313
  },
3296
3314
  async tableArchive({ table_id, chunk, includeTable }) {
@@ -4091,6 +4109,37 @@ function createRecordsClient(given) {
4091
4109
  }
4092
4110
  return ok(out);
4093
4111
  },
4112
+ async reverseLinksFields(args) {
4113
+ const ids = [...new Set(args.record_ids.filter((id) => typeof id === "string" && id.length > 0))];
4114
+ const fieldIds = [...new Set(args.source_field_ids)];
4115
+ const out = Object.fromEntries(fieldIds.map((id) => [id, {}]));
4116
+ for (let f2 = 0; f2 < fieldIds.length || f2 === 0; f2 += 20) {
4117
+ for (let at = 0; at < ids.length; at += REVERSE_LINKS_RECORDS_PER_CALL) {
4118
+ const result = await owedDoor(
4119
+ DOORS.reverseLinksManyFields,
4120
+ {
4121
+ p_organization_id: org,
4122
+ p_table_id: args.table_id,
4123
+ p_field_ids: fieldIds.slice(f2, f2 + 20),
4124
+ p_record_ids: ids.slice(at, at + REVERSE_LINKS_RECORDS_PER_CALL),
4125
+ p_limit: args.limit ?? 10,
4126
+ p_offset: args.offset ?? 0
4127
+ },
4128
+ "reverseLinksFields"
4129
+ );
4130
+ if (!result.ok) return result;
4131
+ for (const row of result.data ?? []) {
4132
+ if (!row?.record_id || !row.field_id) continue;
4133
+ (out[row.field_id] ??= {})[row.record_id] = {
4134
+ total: typeof row.total === "number" ? row.total : 0,
4135
+ links: Array.isArray(row.links) ? row.links : []
4136
+ };
4137
+ }
4138
+ }
4139
+ if (fieldIds.length === 0) break;
4140
+ }
4141
+ return ok(out);
4142
+ },
4094
4143
  async relationNamesMatch(args) {
4095
4144
  const distinct = [];
4096
4145
  const seen = /* @__PURE__ */ new Set();