@ai-matrx/agents 0.59.263 → 0.59.265

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.
@@ -1024,7 +1024,7 @@ function createModelRecords(config) {
1024
1024
  capabilities: requireCanonicalCapabilities(r.capabilities, { modelId: r.id, modelName: r.name })
1025
1025
  }));
1026
1026
  }
1027
- return {
1027
+ const api = {
1028
1028
  getState: () => state2,
1029
1029
  subscribe(listener) {
1030
1030
  listeners.add(listener);
@@ -1197,6 +1197,52 @@ function createModelRecords(config) {
1197
1197
  }
1198
1198
  });
1199
1199
  },
1200
+ loadIdentities(modelIds) {
1201
+ const asked = (id) => {
1202
+ const status = state2.identityStatusById[id];
1203
+ return Boolean(state2.entities[id] || state2.identityById[id] || status === "loading" || status === "succeeded" || status === "failed");
1204
+ };
1205
+ const ids = [...new Set(modelIds.filter((id) => Boolean(id)))];
1206
+ const waits = [];
1207
+ const wanted = [];
1208
+ for (const id of ids) {
1209
+ if (catalogKeyColumn(id) !== "id") waits.push(api.loadIdentity(id));
1210
+ else if (asked(id)) waits.push(inFlight.get(`identity:${id}`) ?? Promise.resolve());
1211
+ else wanted.push(id);
1212
+ }
1213
+ if (wanted.length > 0) {
1214
+ const marked = Object.fromEntries(wanted.map((id) => [id, "loading"]));
1215
+ update((s3) => ({ ...s3, identityStatusById: { ...s3.identityStatusById, ...marked } }));
1216
+ const run = (async () => {
1217
+ try {
1218
+ const { data, error } = await ai().from("model_definition").select("id, name, common_name, is_deprecated").in("id", wanted);
1219
+ if (error) throw error;
1220
+ const rows3 = Array.isArray(data) ? data : [];
1221
+ const got = new Set(rows3.map((r) => r.id));
1222
+ update((s3) => ({
1223
+ ...s3,
1224
+ identityById: { ...s3.identityById, ...Object.fromEntries(rows3.map((r) => [r.id, r])) },
1225
+ identityStatusById: {
1226
+ ...s3.identityStatusById,
1227
+ ...Object.fromEntries(wanted.map((id) => [id, got.has(id) ? "succeeded" : "failed"]))
1228
+ }
1229
+ }));
1230
+ } catch (err) {
1231
+ errorSink({ code: "model-records-identity-failed", message: messageOf(err), context: { modelIds: wanted } });
1232
+ update((s3) => ({
1233
+ ...s3,
1234
+ identityStatusById: { ...s3.identityStatusById, ...Object.fromEntries(wanted.map((id) => [id, "failed"])) }
1235
+ }));
1236
+ }
1237
+ })();
1238
+ for (const id of wanted) inFlight.set(`identity:${id}`, run);
1239
+ void run.finally(() => {
1240
+ for (const id of wanted) if (inFlight.get(`identity:${id}`) === run) inFlight.delete(`identity:${id}`);
1241
+ });
1242
+ waits.push(run);
1243
+ }
1244
+ return Promise.all(waits).then(() => void 0);
1245
+ },
1200
1246
  refresh: () => refreshAll(),
1201
1247
  seedModel({ modelId, config: config2, offerings }) {
1202
1248
  if (!modelId) return;
@@ -1256,6 +1302,7 @@ function createModelRecords(config) {
1256
1302
  });
1257
1303
  }
1258
1304
  };
1305
+ return api;
1259
1306
  }
1260
1307
  function memo(fn) {
1261
1308
  let lastIn = UNSET;
@@ -331,6 +331,12 @@ interface ModelRecords {
331
331
  loadModelClasses(modelId: string): Promise<void>;
332
332
  /** The durable label of a model outside the options list. Never throws. */
333
333
  loadIdentity(modelId: string): Promise<void>;
334
+ /**
335
+ * The durable labels of SEVERAL models in ONE read (`ai.model_definition … in(id)`) — what an open
336
+ * menu names (its presets' models), never the options list. Skips every id already named or asked;
337
+ * a name-shaped key falls back to `loadIdentity`. Never throws.
338
+ */
339
+ loadIdentities(modelIds: readonly (string | null | undefined)[]): Promise<void>;
334
340
  /**
335
341
  * The catalog changed upstream (a `catalog_changed` notice: an admin renamed, offered or retired a model):
336
342
  * re-read everything this instance already read — the options list, every full record, every identity,
@@ -331,6 +331,12 @@ interface ModelRecords {
331
331
  loadModelClasses(modelId: string): Promise<void>;
332
332
  /** The durable label of a model outside the options list. Never throws. */
333
333
  loadIdentity(modelId: string): Promise<void>;
334
+ /**
335
+ * The durable labels of SEVERAL models in ONE read (`ai.model_definition … in(id)`) — what an open
336
+ * menu names (its presets' models), never the options list. Skips every id already named or asked;
337
+ * a name-shaped key falls back to `loadIdentity`. Never throws.
338
+ */
339
+ loadIdentities(modelIds: readonly (string | null | undefined)[]): Promise<void>;
334
340
  /**
335
341
  * The catalog changed upstream (a `catalog_changed` notice: an admin renamed, offered or retired a model):
336
342
  * re-read everything this instance already read — the options list, every full record, every identity,
@@ -1,4 +1,4 @@
1
- import { A as AgentSummary } from '../types-DZhDqrVE.cjs';
1
+ import { A as AgentSummary } from '../types-5pX8AZBM.cjs';
2
2
 
3
3
  /**
4
4
  * `@ai-matrx/agents/quick` — QUICK AGENTS (CONFIDENTIAL-PARITY §2.2/§2.3).
@@ -1,4 +1,4 @@
1
- import { A as AgentSummary } from '../types-DZhDqrVE.js';
1
+ import { A as AgentSummary } from '../types-5pX8AZBM.js';
2
2
 
3
3
  /**
4
4
  * `@ai-matrx/agents/quick` — QUICK AGENTS (CONFIDENTIAL-PARITY §2.2/§2.3).
@@ -122,6 +122,16 @@ interface AgentSummary {
122
122
  * host can tell "the default" from a stored agent without parsing the id.
123
123
  */
124
124
  mandateKey?: string;
125
+ /**
126
+ * THE THIN ROW (FW-014). `true` when this row came from the picker's page
127
+ * read (`agent.agx_picker_page`), which carries only what a picker row
128
+ * renders: no description, model, offering, task, source or sharer. A
129
+ * consumer that needs those asks `catalog.ensureAgentRows([id])` (hover,
130
+ * open), which replaces it with the full row. Absent = a full row.
131
+ */
132
+ isThin?: boolean;
133
+ /** When the caller last used this agent (their latest conversation with it). Page reads only. */
134
+ lastUsedAt?: string | null;
125
135
  }
126
136
  type AgentSortOption = "updated-desc" | "created-desc" | "name-asc" | "name-desc" | "category-asc";
127
137
  /** Which ownership tab is active in the agent list. */
@@ -122,6 +122,16 @@ interface AgentSummary {
122
122
  * host can tell "the default" from a stored agent without parsing the id.
123
123
  */
124
124
  mandateKey?: string;
125
+ /**
126
+ * THE THIN ROW (FW-014). `true` when this row came from the picker's page
127
+ * read (`agent.agx_picker_page`), which carries only what a picker row
128
+ * renders: no description, model, offering, task, source or sharer. A
129
+ * consumer that needs those asks `catalog.ensureAgentRows([id])` (hover,
130
+ * open), which replaces it with the full row. Absent = a full row.
131
+ */
132
+ isThin?: boolean;
133
+ /** When the caller last used this agent (their latest conversation with it). Page reads only. */
134
+ lastUsedAt?: string | null;
125
135
  }
126
136
  type AgentSortOption = "updated-desc" | "created-desc" | "name-asc" | "name-desc" | "category-asc";
127
137
  /** Which ownership tab is active in the agent list. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/agents",
3
- "version": "0.59.263",
3
+ "version": "0.59.265",
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",
@@ -483,23 +483,6 @@
483
483
  }
484
484
  }
485
485
  },
486
- "devDependencies": {
487
- "@arethetypeswrong/cli": "^0.18.5",
488
- "@testing-library/react": "^16.3.3",
489
- "@types/node": "^26.6.2",
490
- "@types/react": "19.3.0",
491
- "jsdom": "^30.1.1",
492
- "lossless-json": "4.3.3",
493
- "openapi-typescript": "^7.13.0",
494
- "publint": "^0.3.24",
495
- "react": "^19.3.0",
496
- "react-dom": "^19.3.0",
497
- "react-native": "0.87.1",
498
- "react-native-svg": "^15.15.5",
499
- "tsup": "^8.5.1",
500
- "typescript": "^6.0.3",
501
- "vitest": "^5.0.1"
502
- },
503
486
  "publishConfig": {
504
487
  "access": "public",
505
488
  "registry": "https://registry.npmjs.org/"
@@ -553,14 +536,5 @@
553
536
  ],
554
537
  "layer": 5
555
538
  },
556
- "scripts": {
557
- "build": "pnpm clean && node ./scripts/build-parts.mjs && node ../scripts/guard-exit.mjs ../scripts/check-node-env-not-inlined.mjs",
558
- "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
559
- "check:package": "node ./scripts/check-model-catalog-reads.mjs && node ./scripts/check-model-catalog-reads.mjs --self-test && node ./scripts/check-catalog-reader-columns.mjs && node ./scripts/check-catalog-reader-columns.mjs --self-test && node ../scripts/check-no-model-literals.mjs && node ../scripts/check-no-model-literals.mjs --self-test && node ../scripts/check-agents-below-chat.mjs && node ../scripts/check-agents-below-chat.mjs --self-test && pnpm build && node ../scripts/check-exports-agreement.mjs && publint && pnpm verify:tarball && node ../scripts/check-tarball-relative-imports.mjs --self-test && node ../scripts/check-tarball-relative-imports.mjs --pack . && node ../scripts/check-package-rules.mjs --self-test && node ../scripts/check-package-rules.mjs .",
560
- "typecheck": "tsc --noEmit",
561
- "test": "vitest run",
562
- "verify:tarball": "node ./scripts/verify-tarball.mjs",
563
- "typegen:self-test": "node scripts/typegen/drop-guard.self-test.mjs && node scripts/typegen/check-api-types-fresh.mjs --self-test"
564
- },
565
- "gitHead": "6201da503daf423d01eadb1c5ff2efa5bc846bc0"
539
+ "gitHead": "e9d7fb471faed968ff24ed0cf3d2aef2a5cdd3b6"
566
540
  }