@ai-matrx/agents 0.59.240 → 0.59.242

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,10 +1,20 @@
1
1
  # Changelog
2
2
 
3
- ## 0.59.240
3
+ ## 0.59.242
4
4
 
5
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
6
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/matrx-agents/src`.
7
7
 
8
+ ## 0.59.241
9
+
10
+ Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff c3acf23378 a53838052a -- apps/shared/matrx-agents/src`
11
+ has no shipped-source changes outside tests, fixtures and docs). No consumer action required.
12
+
13
+ ## 0.59.240
14
+
15
+ Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 6acfc6b938 c3acf23378 -- apps/shared/matrx-agents/src`
16
+ has no shipped-source changes outside tests, fixtures and docs). No consumer action required.
17
+
8
18
  ## 0.59.239
9
19
 
10
20
  Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 9df1465977 6acfc6b938 -- apps/shared/matrx-agents/src`
@@ -310,6 +310,10 @@ function onRequestReason(row) {
310
310
  if (row.max_inline_chars === 0) return "Never inline \u2014 the agent reads it on request";
311
311
  return "Over the limit \u2014 the agent reads it on request";
312
312
  }
313
+ function offByDefaultReason(row) {
314
+ if (row.include || row.decided_by.include !== "page") return null;
315
+ return row.layers?.surface?.auto_context === false ? "Off by default on this page" : null;
316
+ }
313
317
 
314
318
  // context/react/InlineMaxInput.tsx
315
319
  var import_jsx_runtime2 = require("react/jsx-runtime");
@@ -666,7 +670,8 @@ function ContextRuleRow({
666
670
  trail
667
671
  }) {
668
672
  const selfChecked = row.blockedBy === "self_check";
669
- const decided = selfChecked ? SELF_CHECK_TOOLTIP : row.serverResolved ? SERVER_RESOLVED_TOOLTIP : `Include: ${LAYER_LABEL[row.decided_by.include]} \xB7 Limit: ${LAYER_LABEL[row.decided_by.max_inline_chars]}`;
673
+ const decided = selfChecked ? SELF_CHECK_TOOLTIP : row.serverResolved ? SERVER_RESOLVED_TOOLTIP : offByDefaultReason(row) ?? `Include: ${LAYER_LABEL[row.decided_by.include]} \xB7 Limit: ${LAYER_LABEL[row.decided_by.max_inline_chars]}`;
674
+ const shownTrail = trail ?? offByDefaultReason(row);
670
675
  const labelNode = onOpenRow ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
671
676
  "button",
672
677
  {
@@ -710,7 +715,7 @@ function ContextRuleRow({
710
715
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "font-normal text-muted-foreground", children: decided })
711
716
  ] })
712
717
  ] }),
713
- trail ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "min-w-0 max-w-[45%] shrink truncate text-muted-foreground", children: trail }) : null
718
+ shownTrail ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "min-w-0 max-w-[45%] shrink truncate text-muted-foreground", children: shownTrail }) : null
714
719
  ]
715
720
  }
716
721
  ),
@@ -280,6 +280,10 @@ function onRequestReason(row) {
280
280
  if (row.max_inline_chars === 0) return "Never inline \u2014 the agent reads it on request";
281
281
  return "Over the limit \u2014 the agent reads it on request";
282
282
  }
283
+ function offByDefaultReason(row) {
284
+ if (row.include || row.decided_by.include !== "page") return null;
285
+ return row.layers?.surface?.auto_context === false ? "Off by default on this page" : null;
286
+ }
283
287
 
284
288
  // context/react/InlineMaxInput.tsx
285
289
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
@@ -636,7 +640,8 @@ function ContextRuleRow({
636
640
  trail
637
641
  }) {
638
642
  const selfChecked = row.blockedBy === "self_check";
639
- const decided = selfChecked ? SELF_CHECK_TOOLTIP : row.serverResolved ? SERVER_RESOLVED_TOOLTIP : `Include: ${LAYER_LABEL[row.decided_by.include]} \xB7 Limit: ${LAYER_LABEL[row.decided_by.max_inline_chars]}`;
643
+ const decided = selfChecked ? SELF_CHECK_TOOLTIP : row.serverResolved ? SERVER_RESOLVED_TOOLTIP : offByDefaultReason(row) ?? `Include: ${LAYER_LABEL[row.decided_by.include]} \xB7 Limit: ${LAYER_LABEL[row.decided_by.max_inline_chars]}`;
644
+ const shownTrail = trail ?? offByDefaultReason(row);
640
645
  const labelNode = onOpenRow ? /* @__PURE__ */ jsx3(
641
646
  "button",
642
647
  {
@@ -680,7 +685,7 @@ function ContextRuleRow({
680
685
  /* @__PURE__ */ jsx3("div", { className: "font-normal text-muted-foreground", children: decided })
681
686
  ] })
682
687
  ] }),
683
- trail ? /* @__PURE__ */ jsx3("span", { className: "min-w-0 max-w-[45%] shrink truncate text-muted-foreground", children: trail }) : null
688
+ shownTrail ? /* @__PURE__ */ jsx3("span", { className: "min-w-0 max-w-[45%] shrink truncate text-muted-foreground", children: shownTrail }) : null
684
689
  ]
685
690
  }
686
691
  ),
@@ -861,7 +861,9 @@ function createModelFavorites(config) {
861
861
  };
862
862
  const listCanonical = async () => {
863
863
  try {
864
- const { data, error } = await client().rpc("ues_list", { p_kind: "favorite" });
864
+ const c = client();
865
+ const scoped = c.schema?.("users");
866
+ const { data, error } = await (scoped?.rpc ? scoped.rpc("ues_list", { p_kind: "favorite" }) : c.rpc("ues_list", { p_kind: "favorite" }));
865
867
  if (error) {
866
868
  sink({ code: "model-favorite-ues_list-failed", message: error.message });
867
869
  return null;
@@ -1599,7 +1601,7 @@ function aiRpc(client, fn) {
1599
1601
  async function readCatalog(client, variant) {
1600
1602
  if (variant === "admin") {
1601
1603
  const [rpcRes, offeringsRes] = await Promise.all([
1602
- client.rpc("admin_model_catalog"),
1604
+ aiRpc(client, "admin_model_catalog"),
1603
1605
  aiRpc(client, "admin_model_offerings")
1604
1606
  ]);
1605
1607
  if (rpcRes.error) throw rpcRes.error;
@@ -339,14 +339,19 @@ declare function reconcileModelFavoriteIds(cached: readonly string[], canonical:
339
339
  missingFromCanonical: string[];
340
340
  };
341
341
  declare function favoriteIdsEqual(a: readonly string[], b: readonly string[]): boolean;
342
+ type ModelFavoritesRpcResult = PromiseLike<{
343
+ data: unknown;
344
+ error: {
345
+ message: string;
346
+ code?: string;
347
+ } | null;
348
+ }>;
342
349
  interface ModelFavoritesClient {
343
- rpc(fn: string, args?: Record<string, unknown>): PromiseLike<{
344
- data: unknown;
345
- error: {
346
- message: string;
347
- code?: string;
348
- } | null;
349
- }>;
350
+ rpc(fn: string, args?: Record<string, unknown>): ModelFavoritesRpcResult;
351
+ /** `users.ues_list` lives in its owner schema (the public forwarder closes). */
352
+ schema?(name: string): {
353
+ rpc?(fn: string, args?: Record<string, unknown>): ModelFavoritesRpcResult;
354
+ };
350
355
  }
351
356
  interface ModelFavoritesCache {
352
357
  get(): readonly string[];
@@ -756,7 +761,7 @@ declare const selectModelIdentityLookupStatus: (s: ModelRecordsState, modelId: s
756
761
  * - "user" → `ai.model_public` (anon + authenticated; masked, points pricing), filtered to
757
762
  * ROUTABLE models via `ai.model_offering`, which also supplies each model's serving
758
763
  * TIERS (`served_via` — the endpoint's public Matrx brand, never the real vendor).
759
- * - "admin" → `public.admin_model_catalog()` + `ai.admin_model_offerings()` (SECURITY
764
+ * - "admin" → `ai.admin_model_catalog()` + `ai.admin_model_offerings()` (SECURITY
760
765
  * DEFINER, gated by `is_super_admin()`): raw $ pricing, real vendors, every
761
766
  * offering. NEVER read `ai.model_admin` / `ai.offering` directly from a client.
762
767
  *
@@ -339,14 +339,19 @@ declare function reconcileModelFavoriteIds(cached: readonly string[], canonical:
339
339
  missingFromCanonical: string[];
340
340
  };
341
341
  declare function favoriteIdsEqual(a: readonly string[], b: readonly string[]): boolean;
342
+ type ModelFavoritesRpcResult = PromiseLike<{
343
+ data: unknown;
344
+ error: {
345
+ message: string;
346
+ code?: string;
347
+ } | null;
348
+ }>;
342
349
  interface ModelFavoritesClient {
343
- rpc(fn: string, args?: Record<string, unknown>): PromiseLike<{
344
- data: unknown;
345
- error: {
346
- message: string;
347
- code?: string;
348
- } | null;
349
- }>;
350
+ rpc(fn: string, args?: Record<string, unknown>): ModelFavoritesRpcResult;
351
+ /** `users.ues_list` lives in its owner schema (the public forwarder closes). */
352
+ schema?(name: string): {
353
+ rpc?(fn: string, args?: Record<string, unknown>): ModelFavoritesRpcResult;
354
+ };
350
355
  }
351
356
  interface ModelFavoritesCache {
352
357
  get(): readonly string[];
@@ -756,7 +761,7 @@ declare const selectModelIdentityLookupStatus: (s: ModelRecordsState, modelId: s
756
761
  * - "user" → `ai.model_public` (anon + authenticated; masked, points pricing), filtered to
757
762
  * ROUTABLE models via `ai.model_offering`, which also supplies each model's serving
758
763
  * TIERS (`served_via` — the endpoint's public Matrx brand, never the real vendor).
759
- * - "admin" → `public.admin_model_catalog()` + `ai.admin_model_offerings()` (SECURITY
764
+ * - "admin" → `ai.admin_model_catalog()` + `ai.admin_model_offerings()` (SECURITY
760
765
  * DEFINER, gated by `is_super_admin()`): raw $ pricing, real vendors, every
761
766
  * offering. NEVER read `ai.model_admin` / `ai.offering` directly from a client.
762
767
  *
@@ -702,7 +702,9 @@ function createModelFavorites(config) {
702
702
  };
703
703
  const listCanonical = async () => {
704
704
  try {
705
- const { data, error } = await client().rpc("ues_list", { p_kind: "favorite" });
705
+ const c = client();
706
+ const scoped = c.schema?.("users");
707
+ const { data, error } = await (scoped?.rpc ? scoped.rpc("ues_list", { p_kind: "favorite" }) : c.rpc("ues_list", { p_kind: "favorite" }));
706
708
  if (error) {
707
709
  sink({ code: "model-favorite-ues_list-failed", message: error.message });
708
710
  return null;
@@ -1440,7 +1442,7 @@ function aiRpc(client, fn) {
1440
1442
  async function readCatalog(client, variant) {
1441
1443
  if (variant === "admin") {
1442
1444
  const [rpcRes, offeringsRes] = await Promise.all([
1443
- client.rpc("admin_model_catalog"),
1445
+ aiRpc(client, "admin_model_catalog"),
1444
1446
  aiRpc(client, "admin_model_offerings")
1445
1447
  ]);
1446
1448
  if (rpcRes.error) throw rpcRes.error;
@@ -372,7 +372,7 @@ interface ModelRecords {
372
372
  * - "user" → `ai.model_public` (anon + authenticated; masked, points pricing), filtered to
373
373
  * ROUTABLE models via `ai.model_offering`, which also supplies each model's serving
374
374
  * TIERS (`served_via` — the endpoint's public Matrx brand, never the real vendor).
375
- * - "admin" → `public.admin_model_catalog()` + `ai.admin_model_offerings()` (SECURITY
375
+ * - "admin" → `ai.admin_model_catalog()` + `ai.admin_model_offerings()` (SECURITY
376
376
  * DEFINER, gated by `is_super_admin()`): raw $ pricing, real vendors, every
377
377
  * offering. NEVER read `ai.model_admin` / `ai.offering` directly from a client.
378
378
  *
@@ -372,7 +372,7 @@ interface ModelRecords {
372
372
  * - "user" → `ai.model_public` (anon + authenticated; masked, points pricing), filtered to
373
373
  * ROUTABLE models via `ai.model_offering`, which also supplies each model's serving
374
374
  * TIERS (`served_via` — the endpoint's public Matrx brand, never the real vendor).
375
- * - "admin" → `public.admin_model_catalog()` + `ai.admin_model_offerings()` (SECURITY
375
+ * - "admin" → `ai.admin_model_catalog()` + `ai.admin_model_offerings()` (SECURITY
376
376
  * DEFINER, gated by `is_super_admin()`): raw $ pricing, real vendors, every
377
377
  * offering. NEVER read `ai.model_admin` / `ai.offering` directly from a client.
378
378
  *
@@ -202,7 +202,7 @@ var AgentVersionsError = class extends Error {
202
202
  }
203
203
  };
204
204
  async function listAgentVersions(client, query) {
205
- const { data, error } = await client.rpc("agx_get_version_history", {
205
+ const { data, error } = await client.schema("agent").rpc("agx_get_version_history", {
206
206
  p_agent_id: query.agentId,
207
207
  p_limit: query.limit ?? 50,
208
208
  p_offset: query.offset ?? 0
@@ -211,7 +211,7 @@ async function listAgentVersions(client, query) {
211
211
  return Array.isArray(data) ? data : [];
212
212
  }
213
213
  async function readAgentVersionSnapshot(client, query) {
214
- const { data, error } = await client.rpc("agx_get_version_snapshot", {
214
+ const { data, error } = await client.schema("agent").rpc("agx_get_version_snapshot", {
215
215
  p_agent_id: query.agentId,
216
216
  p_version_number: query.version
217
217
  });
@@ -227,7 +227,7 @@ async function resolveAgentVersionId(client, versionId) {
227
227
  return { versionId: row.id, agentId: row.agent_id, versionNumber: row.version_number, agentName: row.name };
228
228
  }
229
229
  async function promoteAgentVersion(client, query) {
230
- const { data, error } = await client.rpc("agx_promote_version", {
230
+ const { data, error } = await client.schema("agent").rpc("agx_promote_version", {
231
231
  p_agent_id: query.agentId,
232
232
  p_version_number: query.version
233
233
  });
@@ -159,7 +159,7 @@ var AgentVersionsError = class extends Error {
159
159
  }
160
160
  };
161
161
  async function listAgentVersions(client, query) {
162
- const { data, error } = await client.rpc("agx_get_version_history", {
162
+ const { data, error } = await client.schema("agent").rpc("agx_get_version_history", {
163
163
  p_agent_id: query.agentId,
164
164
  p_limit: query.limit ?? 50,
165
165
  p_offset: query.offset ?? 0
@@ -168,7 +168,7 @@ async function listAgentVersions(client, query) {
168
168
  return Array.isArray(data) ? data : [];
169
169
  }
170
170
  async function readAgentVersionSnapshot(client, query) {
171
- const { data, error } = await client.rpc("agx_get_version_snapshot", {
171
+ const { data, error } = await client.schema("agent").rpc("agx_get_version_snapshot", {
172
172
  p_agent_id: query.agentId,
173
173
  p_version_number: query.version
174
174
  });
@@ -184,7 +184,7 @@ async function resolveAgentVersionId(client, versionId) {
184
184
  return { versionId: row.id, agentId: row.agent_id, versionNumber: row.version_number, agentName: row.name };
185
185
  }
186
186
  async function promoteAgentVersion(client, query) {
187
- const { data, error } = await client.rpc("agx_promote_version", {
187
+ const { data, error } = await client.schema("agent").rpc("agx_promote_version", {
188
188
  p_agent_id: query.agentId,
189
189
  p_version_number: query.version
190
190
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/agents",
3
- "version": "0.59.240",
3
+ "version": "0.59.242",
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",
@@ -509,11 +509,11 @@
509
509
  "sideEffects": false,
510
510
  "dependencies": {
511
511
  "@ai-matrx/alchemy": "latest",
512
- "@ai-matrx/api": "latest",
513
512
  "@ai-matrx/associations": "latest",
514
513
  "@ai-matrx/content-ir": "latest",
515
514
  "@ai-matrx/data": "latest",
516
515
  "@ai-matrx/design-system": "latest",
516
+ "@ai-matrx/api": "latest",
517
517
  "@ai-matrx/diff": "latest",
518
518
  "@ai-matrx/icons": "latest",
519
519
  "@ai-matrx/kit": "latest"
@@ -561,5 +561,5 @@
561
561
  "verify:tarball": "node ./scripts/verify-tarball.mjs",
562
562
  "typegen:self-test": "node scripts/typegen/drop-guard.self-test.mjs && node scripts/typegen/check-api-types-fresh.mjs --self-test"
563
563
  },
564
- "gitHead": "c3acf23378ea3cfd81a456efb31c6db0b65e89ef"
564
+ "gitHead": "60cd3951abb4c6805525952cccbd1d020ecb3010"
565
565
  }