@ai-matrx/records 0.93.5 → 0.94.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/data/index.cjs +17 -0
  3. package/dist/data/index.cjs.map +1 -1
  4. package/dist/data/index.d.cts +2 -2
  5. package/dist/data/index.d.ts +2 -2
  6. package/dist/data/index.js +17 -0
  7. package/dist/data/index.js.map +1 -1
  8. package/dist/data/react.cjs +16 -3
  9. package/dist/data/react.cjs.map +1 -1
  10. package/dist/data/react.d.cts +10 -0
  11. package/dist/data/react.d.ts +10 -0
  12. package/dist/data/react.js +16 -3
  13. package/dist/data/react.js.map +1 -1
  14. package/dist/entity/index.cjs +1 -1
  15. package/dist/entity/index.cjs.map +1 -1
  16. package/dist/entity/index.d.cts +3 -3
  17. package/dist/entity/index.d.ts +3 -3
  18. package/dist/entity/index.js +1 -1
  19. package/dist/entity/index.js.map +1 -1
  20. package/dist/entity/react.cjs +1 -1
  21. package/dist/entity/react.cjs.map +1 -1
  22. package/dist/entity/react.d.cts +10 -0
  23. package/dist/entity/react.d.ts +10 -0
  24. package/dist/entity/react.js +1 -1
  25. package/dist/entity/react.js.map +1 -1
  26. package/dist/first-page/index.cjs +1 -0
  27. package/dist/first-page/index.cjs.map +1 -1
  28. package/dist/first-page/index.d.cts +6 -0
  29. package/dist/first-page/index.d.ts +6 -0
  30. package/dist/first-page/index.js +1 -0
  31. package/dist/first-page/index.js.map +1 -1
  32. package/dist/memory/index.cjs.map +1 -1
  33. package/dist/memory/index.js.map +1 -1
  34. package/dist/{port-DyZ0GfxE.d.ts → port-BNXXJINy.d.ts} +1 -1
  35. package/dist/{port-B3UeC536.d.cts → port-CEf9hsW4.d.cts} +1 -1
  36. package/dist/react/index.cjs +17 -0
  37. package/dist/react/index.cjs.map +1 -1
  38. package/dist/react/index.js +17 -0
  39. package/dist/react/index.js.map +1 -1
  40. package/dist/setup/index.cjs +1 -1
  41. package/dist/setup/index.cjs.map +1 -1
  42. package/dist/setup/index.d.cts +2 -2
  43. package/dist/setup/index.d.ts +2 -2
  44. package/dist/setup/index.js +1 -1
  45. package/dist/setup/index.js.map +1 -1
  46. package/dist/templates/index.cjs +1 -1
  47. package/dist/templates/index.cjs.map +1 -1
  48. package/dist/templates/index.d.cts +1 -1
  49. package/dist/templates/index.d.ts +1 -1
  50. package/dist/templates/index.js +1 -1
  51. package/dist/templates/index.js.map +1 -1
  52. package/dist/{types-DB4J-zIt.d.ts → types-Du4Q9Rvi.d.ts} +10 -0
  53. package/dist/{types-Bg1q6qwq.d.cts → types-Dxc8Pt7Y.d.cts} +10 -0
  54. package/dist/views/index.cjs +1 -0
  55. package/dist/views/index.cjs.map +1 -1
  56. package/dist/views/index.js +1 -0
  57. package/dist/views/index.js.map +1 -1
  58. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog — @ai-matrx/records
2
2
 
3
+ ## 0.94.0 — an archived row has a door back (lane F5)
4
+
5
+ From the live Applets audit (2026-10-09, R5): a reading-list Applet's archive confirm promised "you can restore it
6
+ later" and nothing could read an archived row — the table port's only list door, `custom.read_records_keyset`,
7
+ answers live rows only.
8
+ - **`Query.archived: true`** (`@ai-matrx/records/data`) answers a source's ARCHIVE: the table port reads
9
+ `custom.read_records_archived` (the store's own archive door — same ladder, level and masking; newest archived
10
+ first, paged by an `archived:<offset>` cursor; `where` / `search` / `sort` are not applied to it); the entity port
11
+ asks the entity door's own archived lane. Each row carries `_archived_at` and `_archived_by_name`.
12
+ - **The data cache keeps the archive apart** (`data/react`): an archive list is never patched, dropped into or
13
+ placed into by live-row bookkeeping; it is read again when the alias moves, after an archive, and after a restore.
14
+ - Tests: `an-archived-row-has-a-door-back.test.ts`.
15
+ - **Consumer action:** none. A host's archive/restore UI can now read the rows it restores.
16
+
17
+ ## 0.93.6
18
+
19
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
20
+ `git diff npm/records/v0.93.5..npm/records/v0.93.6 -- apps/shared/records`).
21
+ No source changes intended and no consumer action required.
22
+
3
23
  ## 0.93.5
4
24
  ### Unreleased
5
25
  ### automations that act when a date arrives and on a schedule (lane AUTOMATION-TIME)
@@ -6339,6 +6339,7 @@ function clientIn(client, organizationId) {
6339
6339
  var import_uuid4 = require("@ai-matrx/kit/uuid");
6340
6340
  var DATA_PAGE_CEILING = 500;
6341
6341
  var DATA_PAGE_DEFAULT = 50;
6342
+ var ARCHIVED_CURSOR = "archived:";
6342
6343
  function refuse2(code, message, hint) {
6343
6344
  return { ok: false, error: { code, message, ...hint ? { hint } : {} } };
6344
6345
  }
@@ -6477,6 +6478,21 @@ function createTableDataPort({ client, aliases }) {
6477
6478
  if (!got.data) return refuse2("not_found", "The change was saved, but this row can no longer be read with your access.", "Ask the table's owner if you should still see it.");
6478
6479
  return { ok: true, data: got.data };
6479
6480
  }
6481
+ async function listArchived(binding, shape, q, cursor) {
6482
+ const limit = Math.max(1, Math.min(Math.floor(q.pageSize ?? DATA_PAGE_DEFAULT), DATA_PAGE_CEILING));
6483
+ const at = cursor?.startsWith(ARCHIVED_CURSOR) ? Number(cursor.slice(ARCHIVED_CURSOR.length)) : 0;
6484
+ const offset = Number.isInteger(at) && at > 0 ? at : 0;
6485
+ const page2 = await seat(binding).listArchived({ table_id: binding.tableId, lane: "org", limit, offset });
6486
+ if (!page2.ok) return page2;
6487
+ const read = page2.data.rows.map((r) => ({ ...r, version: 0, organization_id: binding.organizationId }));
6488
+ const rows = await toRows(binding, shape, read);
6489
+ page2.data.rows.forEach((r, i) => {
6490
+ rows[i]._archived_at = r.archivedAt;
6491
+ rows[i]._archived_by_name = r.archivedByName;
6492
+ });
6493
+ const cursorOut = page2.data.rows.length < limit ? null : `${ARCHIVED_CURSOR}${offset + page2.data.rows.length}`;
6494
+ return { ok: true, data: { rows, total: page2.data.total, cursor: cursorOut } };
6495
+ }
6480
6496
  return {
6481
6497
  async sources() {
6482
6498
  const out = [];
@@ -6518,6 +6534,7 @@ function createTableDataPort({ client, aliases }) {
6518
6534
  }
6519
6535
  const shape = await shapeOf(alias, binding);
6520
6536
  if (!shape.ok) return shape;
6537
+ if (q.archived === true) return listArchived(binding, shape.data, q, cursor);
6521
6538
  const filter = compileWhere(q.where, shape.data);
6522
6539
  if (!filter.ok) return filter;
6523
6540
  const sort = compileSort(q.sort, shape.data);