@ai-matrx/agents 0.59.258 → 0.59.260

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,9 +1,14 @@
1
1
  # Changelog
2
2
 
3
- ## 0.59.258
4
-
5
- UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
6
- Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/matrx-agents/src`.
3
+ ## 0.59.260
4
+ ### the pinned read asks the server for those agents only (FW-015)
5
+
6
+ - `ensureFavoriteRows()` / `readFavoriteAgentRows` now read the starred agents through
7
+ `agent.agx_get_by_ids(p_ids)` (same columns and access words as `agx_get_list_full`) instead of
8
+ `agx_get_list_full` filtered by id, which made the server build the caller's whole catalog first.
9
+ Measured on live: ordinary account 161 → 41 ms, admin 390 → 53 ms, identical rows.
10
+ - The narrow read needs a client with `schema()` (supabase-js has it); without one the store falls back to the
11
+ whole catalog and reports `pinned_read_unsupported`, as before. Consumer action: none.
7
12
 
8
13
  ## 0.59.257
9
14
 
@@ -398,6 +398,9 @@ async function readFavoriteAgentRows(client, favorites) {
398
398
  if (typeof favorites.list !== "function") {
399
399
  throw new AgentPinnedReadUnsupported("the favorites port has no list()");
400
400
  }
401
+ if (typeof client.schema !== "function") {
402
+ throw new AgentPinnedReadUnsupported("the client has no schema()");
403
+ }
401
404
  const listed = await favorites.list("favorite");
402
405
  if (!listed.ok) {
403
406
  throw new AgentCatalogReadError(
@@ -416,13 +419,9 @@ async function readFavoriteAgentRows(client, favorites) {
416
419
  const rows = [];
417
420
  for (let at = 0; at < ids.length; at += PINNED_ID_CHUNK) {
418
421
  const chunk = ids.slice(at, at + PINNED_ID_CHUNK);
419
- const call = client.rpc("agx_get_list_full", {});
420
- if (typeof call.in !== "function") {
421
- throw new AgentPinnedReadUnsupported("the client's rpc builder has no in()");
422
- }
423
- const { data, error } = await call.in("id", chunk);
422
+ const { data, error } = await client.schema("agent").rpc("agx_get_by_ids", { p_ids: chunk });
424
423
  if (error) {
425
- throw new AgentCatalogReadError("agx_get_list_full (pinned)", pgDetail(error));
424
+ throw new AgentCatalogReadError("agent.agx_get_by_ids (pinned)", pgDetail(error));
426
425
  }
427
426
  for (const item of Array.isArray(data) ? data : []) {
428
427
  const summary = toAgentSummary(item);
@@ -814,10 +814,11 @@ declare function getRegisteredAgentCatalog(catalogId?: string): AgentCatalog | u
814
814
  * set this module returns to the store.
815
815
  * 5. ONE write: the caller's star, `ues_set` through the same port. The
816
816
  * retired `agent.definition.is_favorite` column is never read or written.
817
- * 6. THE PINNED READ (2026-10-09): the caller's starred ids (`ues_list`
818
- * through the favorites port), then `agx_get_list_full` filtered to
819
- * exactly those ids (`?id=in.(…)`). A sidebar's Pinned section shows a
820
- * handful of rows; it never pays for the whole catalog to find them.
817
+ * 6. THE PINNED READ (2026-10-09; by-ids 2026-10-23): the caller's starred
818
+ * ids (`ues_list` through the favorites port), then
819
+ * `agent.agx_get_by_ids(p_ids)` for exactly those ids. A sidebar's Pinned
820
+ * section shows a handful of rows; it never pays for the whole catalog,
821
+ * in the browser or on the server, to find them.
821
822
  *
822
823
  * 🚨 THE LIST READ IS COMPLETE OR IT THROWS. PostgREST caps every response at
823
824
  * `db-max-rows` (1000 on Matrx Main) and reports success — matrx-frontend's
@@ -814,10 +814,11 @@ declare function getRegisteredAgentCatalog(catalogId?: string): AgentCatalog | u
814
814
  * set this module returns to the store.
815
815
  * 5. ONE write: the caller's star, `ues_set` through the same port. The
816
816
  * retired `agent.definition.is_favorite` column is never read or written.
817
- * 6. THE PINNED READ (2026-10-09): the caller's starred ids (`ues_list`
818
- * through the favorites port), then `agx_get_list_full` filtered to
819
- * exactly those ids (`?id=in.(…)`). A sidebar's Pinned section shows a
820
- * handful of rows; it never pays for the whole catalog to find them.
817
+ * 6. THE PINNED READ (2026-10-09; by-ids 2026-10-23): the caller's starred
818
+ * ids (`ues_list` through the favorites port), then
819
+ * `agent.agx_get_by_ids(p_ids)` for exactly those ids. A sidebar's Pinned
820
+ * section shows a handful of rows; it never pays for the whole catalog,
821
+ * in the browser or on the server, to find them.
821
822
  *
822
823
  * 🚨 THE LIST READ IS COMPLETE OR IT THROWS. PostgREST caps every response at
823
824
  * `db-max-rows` (1000 on Matrx Main) and reports success — matrx-frontend's
@@ -292,6 +292,9 @@ async function readFavoriteAgentRows(client, favorites) {
292
292
  if (typeof favorites.list !== "function") {
293
293
  throw new AgentPinnedReadUnsupported("the favorites port has no list()");
294
294
  }
295
+ if (typeof client.schema !== "function") {
296
+ throw new AgentPinnedReadUnsupported("the client has no schema()");
297
+ }
295
298
  const listed = await favorites.list("favorite");
296
299
  if (!listed.ok) {
297
300
  throw new AgentCatalogReadError(
@@ -310,13 +313,9 @@ async function readFavoriteAgentRows(client, favorites) {
310
313
  const rows = [];
311
314
  for (let at = 0; at < ids.length; at += PINNED_ID_CHUNK) {
312
315
  const chunk = ids.slice(at, at + PINNED_ID_CHUNK);
313
- const call = client.rpc("agx_get_list_full", {});
314
- if (typeof call.in !== "function") {
315
- throw new AgentPinnedReadUnsupported("the client's rpc builder has no in()");
316
- }
317
- const { data, error } = await call.in("id", chunk);
316
+ const { data, error } = await client.schema("agent").rpc("agx_get_by_ids", { p_ids: chunk });
318
317
  if (error) {
319
- throw new AgentCatalogReadError("agx_get_list_full (pinned)", pgDetail(error));
318
+ throw new AgentCatalogReadError("agent.agx_get_by_ids (pinned)", pgDetail(error));
320
319
  }
321
320
  for (const item of Array.isArray(data) ? data : []) {
322
321
  const summary = toAgentSummary(item);
@@ -426,7 +426,7 @@ function compareReceipt(expected, receipt) {
426
426
  reason: "self_check"
427
427
  });
428
428
  }
429
- if (!selfChecked && !consumed && modelReadsContext && !exp.serverResolved && exp.delivery !== "server" && exp.chars !== null && actual.chars !== null && actual.delivery !== exp.delivery) {
429
+ if (!selfChecked && !consumed && modelReadsContext && !serverOwned && exp.delivery !== "server" && exp.chars !== null && actual.chars !== null && actual.delivery !== exp.delivery) {
430
430
  mismatches.push({ key: exp.key, field: "delivery", expected: exp.delivery, actual: actual.delivery });
431
431
  }
432
432
  const expRule = normalizeUserRule(exp.userRule);
@@ -363,7 +363,7 @@ function compareReceipt(expected, receipt) {
363
363
  reason: "self_check"
364
364
  });
365
365
  }
366
- if (!selfChecked && !consumed && modelReadsContext && !exp.serverResolved && exp.delivery !== "server" && exp.chars !== null && actual.chars !== null && actual.delivery !== exp.delivery) {
366
+ if (!selfChecked && !consumed && modelReadsContext && !serverOwned && exp.delivery !== "server" && exp.chars !== null && actual.chars !== null && actual.delivery !== exp.delivery) {
367
367
  mismatches.push({ key: exp.key, field: "delivery", expected: exp.delivery, actual: actual.delivery });
368
368
  }
369
369
  const expRule = normalizeUserRule(exp.userRule);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/agents",
3
- "version": "0.59.258",
3
+ "version": "0.59.260",
4
4
  "description": "Portable AI Matrx agent stream protocol, event projection, and safe result-presentation primitives.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -562,5 +562,5 @@
562
562
  "verify:tarball": "node ./scripts/verify-tarball.mjs",
563
563
  "typegen:self-test": "node scripts/typegen/drop-guard.self-test.mjs && node scripts/typegen/check-api-types-fresh.mjs --self-test"
564
564
  },
565
- "gitHead": "48dc0c53e766ad507fa37f41893b2b358be229f4"
565
+ "gitHead": "9a4fd3053c05194032de663989ec2f851ab0db6c"
566
566
  }