@ai-matrx/agents 0.59.261 → 0.59.263
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 +26 -0
- package/dist/catalog/index.cjs +7 -45
- package/dist/catalog/index.d.cts +4 -3
- package/dist/catalog/index.d.ts +4 -3
- package/dist/catalog/index.js +7 -45
- package/dist/context/index.cjs +3 -1
- package/dist/context/index.js +3 -1
- package/dist/context/react/index.cjs +33 -19
- package/dist/context/react/index.js +34 -20
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.59.263
|
|
4
|
+
### no second star read after a catalog or search read (FW-014)
|
|
5
|
+
|
|
6
|
+
- `ensureLoaded()` and `searchServer()` no longer follow each read with `ues_get_bulk('agent', every id)`.
|
|
7
|
+
Every catalog read (`agx_get_list_full`, `agx_search`, `agent.agx_get_by_ids`) already returns
|
|
8
|
+
`is_favorite` computed server-side from `platform.user_entity_state` (`platform.my_favorite`), so
|
|
9
|
+
`toAgentSummary` now reads it. Saves one sequential request uploading every agent id (673 ids for an
|
|
10
|
+
ordinary account, 1,478 for admin) on every picker load and search.
|
|
11
|
+
- Removed: `overlayAgentFavorites` (internal) and the `favorite_read_failed` error code. The favorites
|
|
12
|
+
port's `getBulk` is no longer called by the catalog. Consumer action: none.
|
|
13
|
+
|
|
3
14
|
## 0.59.261
|
|
15
|
+
|
|
16
|
+
Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 9a4fd3053c c006aa4394 -- apps/shared/matrx-agents/src`
|
|
17
|
+
has no shipped-source changes outside tests, fixtures and docs). No consumer action required.
|
|
18
|
+
|
|
19
|
+
## 0.59.260
|
|
4
20
|
### the pinned read asks the server for those agents only (FW-015)
|
|
5
21
|
|
|
6
22
|
- `ensureFavoriteRows()` / `readFavoriteAgentRows` now read the starred agents through
|
|
@@ -10,6 +26,16 @@
|
|
|
10
26
|
- The narrow read needs a client with `schema()` (supabase-js has it); without one the store falls back to the
|
|
11
27
|
whole catalog and reports `pinned_read_unsupported`, as before. Consumer action: none.
|
|
12
28
|
|
|
29
|
+
## 0.59.259
|
|
30
|
+
|
|
31
|
+
Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 48dc0c53e7 c3bd77d32a -- apps/shared/matrx-agents/src`
|
|
32
|
+
has no shipped-source changes outside tests, fixtures and docs). No consumer action required.
|
|
33
|
+
|
|
34
|
+
## 0.59.258
|
|
35
|
+
|
|
36
|
+
Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 0a2b8c9356 48dc0c53e7 -- apps/shared/matrx-agents/src`
|
|
37
|
+
has no shipped-source changes outside tests, fixtures and docs). No consumer action required.
|
|
38
|
+
|
|
13
39
|
## 0.59.257
|
|
14
40
|
|
|
15
41
|
Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 76b41cb76b 0a2b8c9356 -- apps/shared/matrx-agents/src`
|
package/dist/catalog/index.cjs
CHANGED
|
@@ -239,9 +239,11 @@ function toAgentSummary(raw) {
|
|
|
239
239
|
modelId: str(raw["model_id"]),
|
|
240
240
|
isActive: bool(raw["is_active"]),
|
|
241
241
|
isArchived: bool(raw["is_archived"]),
|
|
242
|
-
//
|
|
243
|
-
//
|
|
244
|
-
|
|
242
|
+
// The caller's star. Every read this module maps (agx_get_list_full,
|
|
243
|
+
// agx_search, agent.agx_get_by_ids) computes it server-side with
|
|
244
|
+
// platform.my_favorite — platform.user_entity_state for auth.uid(), the
|
|
245
|
+
// same table the favorites port reads — so no second read is needed (FW-014).
|
|
246
|
+
isFavorite: bool(raw["is_favorite"]),
|
|
245
247
|
createdBy: str(raw["created_by"]),
|
|
246
248
|
organizationId: str(raw["organization_id"]),
|
|
247
249
|
taskId: str(raw["task_id"]),
|
|
@@ -354,29 +356,6 @@ async function readSingleAgentRow(client, agentId) {
|
|
|
354
356
|
return null;
|
|
355
357
|
}
|
|
356
358
|
var AGENT_FAVORITE_ENTITY_TYPE = "agent";
|
|
357
|
-
async function overlayAgentFavorites(favorites, rows, onError) {
|
|
358
|
-
if (rows.length === 0) return rows;
|
|
359
|
-
let starred = null;
|
|
360
|
-
try {
|
|
361
|
-
const result = await favorites.getBulk(
|
|
362
|
-
AGENT_FAVORITE_ENTITY_TYPE,
|
|
363
|
-
rows.map((r) => r.id)
|
|
364
|
-
);
|
|
365
|
-
if (result.ok) {
|
|
366
|
-
starred = new Set(
|
|
367
|
-
result.data.items.filter((s) => s.isFavorite).map((s) => s.entityId)
|
|
368
|
-
);
|
|
369
|
-
} else {
|
|
370
|
-
onError(result.error.message);
|
|
371
|
-
}
|
|
372
|
-
} catch (e) {
|
|
373
|
-
onError(e instanceof Error ? e.message : String(e));
|
|
374
|
-
}
|
|
375
|
-
return rows.map((r) => {
|
|
376
|
-
const isFavorite2 = starred?.has(r.id) ?? false;
|
|
377
|
-
return r.isFavorite === isFavorite2 ? r : { ...r, isFavorite: isFavorite2 };
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
359
|
async function writeAgentFavorite(favorites, agentId, isFavorite2) {
|
|
381
360
|
const result = await favorites.setFavorite(
|
|
382
361
|
AGENT_FAVORITE_ENTITY_TYPE,
|
|
@@ -832,13 +811,6 @@ function createAgentCatalog(config) {
|
|
|
832
811
|
identity,
|
|
833
812
|
errorSink
|
|
834
813
|
}).favorites;
|
|
835
|
-
function reportFavoriteReadFailure(message) {
|
|
836
|
-
errorSink({
|
|
837
|
-
code: "favorite_read_failed",
|
|
838
|
-
message: `your starred agents could not be read (${message}); every star is shown unset until the next catalog load`,
|
|
839
|
-
context: { catalogId }
|
|
840
|
-
});
|
|
841
|
-
}
|
|
842
814
|
const labels = {
|
|
843
815
|
...DEFAULT_AGENT_CATALOG_LABELS,
|
|
844
816
|
...config.labels ?? {}
|
|
@@ -910,11 +882,7 @@ function createAgentCatalog(config) {
|
|
|
910
882
|
}
|
|
911
883
|
publish({ ...state, status: "loading", error: null });
|
|
912
884
|
try {
|
|
913
|
-
const rows = await
|
|
914
|
-
favorites,
|
|
915
|
-
await readAgentCatalogRows(client),
|
|
916
|
-
reportFavoriteReadFailure
|
|
917
|
-
);
|
|
885
|
+
const rows = await readAgentCatalogRows(client);
|
|
918
886
|
replaceRows(rows);
|
|
919
887
|
publish({ ...state, status: "succeeded", error: null, favoriteRowsStatus: "succeeded" });
|
|
920
888
|
globalState.listFetchedAt.set(catalogId, Date.now());
|
|
@@ -1064,13 +1032,7 @@ function createAgentCatalog(config) {
|
|
|
1064
1032
|
}
|
|
1065
1033
|
async function searchServer(query, deep = false) {
|
|
1066
1034
|
const result = await searchAgentsOnServer(client, { query, deep });
|
|
1067
|
-
mergeRows(
|
|
1068
|
-
await overlayAgentFavorites(
|
|
1069
|
-
favorites,
|
|
1070
|
-
result.rows,
|
|
1071
|
-
reportFavoriteReadFailure
|
|
1072
|
-
)
|
|
1073
|
-
);
|
|
1035
|
+
mergeRows(result.rows);
|
|
1074
1036
|
return result.ids;
|
|
1075
1037
|
}
|
|
1076
1038
|
async function setFavorite(agentId, isFavorite2) {
|
package/dist/catalog/index.d.cts
CHANGED
|
@@ -809,9 +809,10 @@ declare function getRegisteredAgentCatalog(catalogId?: string): AgentCatalog | u
|
|
|
809
809
|
* 2. `agx_search(p_query, p_deep, p_limit, p_offset)` — tier-2 server search.
|
|
810
810
|
* 3. `agx_resolve_agent_address(p_ids)` — the single-agent name read, used
|
|
811
811
|
* when a mandate's Holder is not in the caller's own catalog.
|
|
812
|
-
* 4. The caller's stars:
|
|
813
|
-
*
|
|
814
|
-
*
|
|
812
|
+
* 4. The caller's stars arrive ON the rows: every read above computes
|
|
813
|
+
* `is_favorite` server-side from `platform.user_entity_state`
|
|
814
|
+
* (`platform.my_favorite`). There is no second star read (FW-014; the
|
|
815
|
+
* `ues_get_bulk` overlay over every id was retired 2026-10-23).
|
|
815
816
|
* 5. ONE write: the caller's star, `ues_set` through the same port. The
|
|
816
817
|
* retired `agent.definition.is_favorite` column is never read or written.
|
|
817
818
|
* 6. THE PINNED READ (2026-10-09; by-ids 2026-10-23): the caller's starred
|
package/dist/catalog/index.d.ts
CHANGED
|
@@ -809,9 +809,10 @@ declare function getRegisteredAgentCatalog(catalogId?: string): AgentCatalog | u
|
|
|
809
809
|
* 2. `agx_search(p_query, p_deep, p_limit, p_offset)` — tier-2 server search.
|
|
810
810
|
* 3. `agx_resolve_agent_address(p_ids)` — the single-agent name read, used
|
|
811
811
|
* when a mandate's Holder is not in the caller's own catalog.
|
|
812
|
-
* 4. The caller's stars:
|
|
813
|
-
*
|
|
814
|
-
*
|
|
812
|
+
* 4. The caller's stars arrive ON the rows: every read above computes
|
|
813
|
+
* `is_favorite` server-side from `platform.user_entity_state`
|
|
814
|
+
* (`platform.my_favorite`). There is no second star read (FW-014; the
|
|
815
|
+
* `ues_get_bulk` overlay over every id was retired 2026-10-23).
|
|
815
816
|
* 5. ONE write: the caller's star, `ues_set` through the same port. The
|
|
816
817
|
* retired `agent.definition.is_favorite` column is never read or written.
|
|
817
818
|
* 6. THE PINNED READ (2026-10-09; by-ids 2026-10-23): the caller's starred
|
package/dist/catalog/index.js
CHANGED
|
@@ -133,9 +133,11 @@ function toAgentSummary(raw) {
|
|
|
133
133
|
modelId: str(raw["model_id"]),
|
|
134
134
|
isActive: bool(raw["is_active"]),
|
|
135
135
|
isArchived: bool(raw["is_archived"]),
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
|
|
136
|
+
// The caller's star. Every read this module maps (agx_get_list_full,
|
|
137
|
+
// agx_search, agent.agx_get_by_ids) computes it server-side with
|
|
138
|
+
// platform.my_favorite — platform.user_entity_state for auth.uid(), the
|
|
139
|
+
// same table the favorites port reads — so no second read is needed (FW-014).
|
|
140
|
+
isFavorite: bool(raw["is_favorite"]),
|
|
139
141
|
createdBy: str(raw["created_by"]),
|
|
140
142
|
organizationId: str(raw["organization_id"]),
|
|
141
143
|
taskId: str(raw["task_id"]),
|
|
@@ -248,29 +250,6 @@ async function readSingleAgentRow(client, agentId) {
|
|
|
248
250
|
return null;
|
|
249
251
|
}
|
|
250
252
|
var AGENT_FAVORITE_ENTITY_TYPE = "agent";
|
|
251
|
-
async function overlayAgentFavorites(favorites, rows, onError) {
|
|
252
|
-
if (rows.length === 0) return rows;
|
|
253
|
-
let starred = null;
|
|
254
|
-
try {
|
|
255
|
-
const result = await favorites.getBulk(
|
|
256
|
-
AGENT_FAVORITE_ENTITY_TYPE,
|
|
257
|
-
rows.map((r) => r.id)
|
|
258
|
-
);
|
|
259
|
-
if (result.ok) {
|
|
260
|
-
starred = new Set(
|
|
261
|
-
result.data.items.filter((s) => s.isFavorite).map((s) => s.entityId)
|
|
262
|
-
);
|
|
263
|
-
} else {
|
|
264
|
-
onError(result.error.message);
|
|
265
|
-
}
|
|
266
|
-
} catch (e) {
|
|
267
|
-
onError(e instanceof Error ? e.message : String(e));
|
|
268
|
-
}
|
|
269
|
-
return rows.map((r) => {
|
|
270
|
-
const isFavorite2 = starred?.has(r.id) ?? false;
|
|
271
|
-
return r.isFavorite === isFavorite2 ? r : { ...r, isFavorite: isFavorite2 };
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
253
|
async function writeAgentFavorite(favorites, agentId, isFavorite2) {
|
|
275
254
|
const result = await favorites.setFavorite(
|
|
276
255
|
AGENT_FAVORITE_ENTITY_TYPE,
|
|
@@ -726,13 +705,6 @@ function createAgentCatalog(config) {
|
|
|
726
705
|
identity,
|
|
727
706
|
errorSink
|
|
728
707
|
}).favorites;
|
|
729
|
-
function reportFavoriteReadFailure(message) {
|
|
730
|
-
errorSink({
|
|
731
|
-
code: "favorite_read_failed",
|
|
732
|
-
message: `your starred agents could not be read (${message}); every star is shown unset until the next catalog load`,
|
|
733
|
-
context: { catalogId }
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
708
|
const labels = {
|
|
737
709
|
...DEFAULT_AGENT_CATALOG_LABELS,
|
|
738
710
|
...config.labels ?? {}
|
|
@@ -804,11 +776,7 @@ function createAgentCatalog(config) {
|
|
|
804
776
|
}
|
|
805
777
|
publish({ ...state, status: "loading", error: null });
|
|
806
778
|
try {
|
|
807
|
-
const rows = await
|
|
808
|
-
favorites,
|
|
809
|
-
await readAgentCatalogRows(client),
|
|
810
|
-
reportFavoriteReadFailure
|
|
811
|
-
);
|
|
779
|
+
const rows = await readAgentCatalogRows(client);
|
|
812
780
|
replaceRows(rows);
|
|
813
781
|
publish({ ...state, status: "succeeded", error: null, favoriteRowsStatus: "succeeded" });
|
|
814
782
|
globalState.listFetchedAt.set(catalogId, Date.now());
|
|
@@ -958,13 +926,7 @@ function createAgentCatalog(config) {
|
|
|
958
926
|
}
|
|
959
927
|
async function searchServer(query, deep = false) {
|
|
960
928
|
const result = await searchAgentsOnServer(client, { query, deep });
|
|
961
|
-
mergeRows(
|
|
962
|
-
await overlayAgentFavorites(
|
|
963
|
-
favorites,
|
|
964
|
-
result.rows,
|
|
965
|
-
reportFavoriteReadFailure
|
|
966
|
-
)
|
|
967
|
-
);
|
|
929
|
+
mergeRows(result.rows);
|
|
968
930
|
return result.ids;
|
|
969
931
|
}
|
|
970
932
|
async function setFavorite(agentId, isFavorite2) {
|
package/dist/context/index.cjs
CHANGED
|
@@ -470,7 +470,9 @@ function receiptRowToResolved(row, blocks) {
|
|
|
470
470
|
surfaceKey: row.surface_key,
|
|
471
471
|
origin,
|
|
472
472
|
value: void 0,
|
|
473
|
-
|
|
473
|
+
// The server's own count of the text it sent (the text View opens); the value's
|
|
474
|
+
// size on the page is only the fallback for a receipt that states none.
|
|
475
|
+
chars: row.delivered && isServerAuthoritativeKey(row.key) ? row.delivered.chars + attached.reduce((n, b) => n + b.delivered.chars, 0) : row.delivered?.chars ?? row.on_request?.chars ?? row.chars,
|
|
474
476
|
userRule: normalizeUserRule(row.user_rule),
|
|
475
477
|
include: row.include,
|
|
476
478
|
max_inline_chars: row.max_inline_chars,
|
package/dist/context/index.js
CHANGED
|
@@ -407,7 +407,9 @@ function receiptRowToResolved(row, blocks) {
|
|
|
407
407
|
surfaceKey: row.surface_key,
|
|
408
408
|
origin,
|
|
409
409
|
value: void 0,
|
|
410
|
-
|
|
410
|
+
// The server's own count of the text it sent (the text View opens); the value's
|
|
411
|
+
// size on the page is only the fallback for a receipt that states none.
|
|
412
|
+
chars: row.delivered && isServerAuthoritativeKey(row.key) ? row.delivered.chars + attached.reduce((n, b) => n + b.delivered.chars, 0) : row.delivered?.chars ?? row.on_request?.chars ?? row.chars,
|
|
411
413
|
userRule: normalizeUserRule(row.user_rule),
|
|
412
414
|
include: row.include,
|
|
413
415
|
max_inline_chars: row.max_inline_chars,
|
|
@@ -205,6 +205,20 @@ function buildContextLevels(rows, hierarchy) {
|
|
|
205
205
|
for (const level of out) level.groups = stableSort(level.groups, (g) => g.ref);
|
|
206
206
|
return stableSort(out, (level) => level.ref);
|
|
207
207
|
}
|
|
208
|
+
function mergeLevels(a, b) {
|
|
209
|
+
const groups = a.groups.map((g) => ({ ref: g.ref, rows: [...g.rows] }));
|
|
210
|
+
for (const g of b.groups) {
|
|
211
|
+
const hit = groups.find((x) => x.ref.id === g.ref.id);
|
|
212
|
+
if (hit) hit.rows.push(...g.rows);
|
|
213
|
+
else groups.push({ ref: g.ref, rows: [...g.rows] });
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
ref: { ...a.ref, order: Math.min(a.ref.order ?? 0, b.ref.order ?? 0) },
|
|
217
|
+
rows: [...a.rows, ...b.rows],
|
|
218
|
+
groups,
|
|
219
|
+
master: a.master ?? b.master
|
|
220
|
+
};
|
|
221
|
+
}
|
|
208
222
|
function buildContextTree(levels) {
|
|
209
223
|
const roots = [];
|
|
210
224
|
const byId = /* @__PURE__ */ new Map();
|
|
@@ -228,7 +242,7 @@ function buildContextTree(levels) {
|
|
|
228
242
|
last = hit;
|
|
229
243
|
siblings = hit.children;
|
|
230
244
|
}
|
|
231
|
-
if (last) last.level = level;
|
|
245
|
+
if (last) last.level = last.level ? mergeLevels(last.level, level) : level;
|
|
232
246
|
}
|
|
233
247
|
const sort = (list) => {
|
|
234
248
|
const sorted = stableSort(list, (n) => ({ order: rank.get(n) ?? 0 }));
|
|
@@ -857,7 +871,7 @@ var import_controls = require("@ai-matrx/design-system/controls");
|
|
|
857
871
|
var import_design_system4 = require("@ai-matrx/design-system");
|
|
858
872
|
var import_icons7 = require("@ai-matrx/design-system/icons");
|
|
859
873
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
860
|
-
var BLIND_TOOLTIP = "
|
|
874
|
+
var BLIND_TOOLTIP = "Not sent to this model";
|
|
861
875
|
var BLIND_LABEL = "Not read";
|
|
862
876
|
function IconButton({
|
|
863
877
|
label,
|
|
@@ -1107,11 +1121,8 @@ function DeliveredSection({
|
|
|
1107
1121
|
});
|
|
1108
1122
|
},
|
|
1109
1123
|
(error) => {
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
state: "error",
|
|
1113
|
-
message: error instanceof Error && error.message ? error.message : "Couldn't load"
|
|
1114
|
-
});
|
|
1124
|
+
void error;
|
|
1125
|
+
if (live) setLoaded({ state: "error" });
|
|
1115
1126
|
}
|
|
1116
1127
|
);
|
|
1117
1128
|
return () => {
|
|
@@ -1139,18 +1150,21 @@ function DeliveredSection({
|
|
|
1139
1150
|
}
|
|
1140
1151
|
) : null
|
|
1141
1152
|
] }),
|
|
1142
|
-
unavailable ? null : !load ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-xs text-muted-foreground", children: "\u2014" }) : loaded.state === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system5.Skeleton, { "data-testid": "context-delivered-loading", className: "h-16 w-full" }) : loaded.state === "error" ?
|
|
1143
|
-
|
|
1144
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.
|
|
1145
|
-
"
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1153
|
+
unavailable ? null : !load ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-xs text-muted-foreground", children: "\u2014" }) : loaded.state === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system5.Skeleton, { "data-testid": "context-delivered-loading", className: "h-16 w-full" }) : loaded.state === "error" ? (
|
|
1154
|
+
// Calm and one line: the server's words never reach the person (the host's loader files the error).
|
|
1155
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-testid": "context-delivered-unavailable", className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
1156
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "min-w-0 truncate", children: "Text not kept for this message" }),
|
|
1157
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1158
|
+
"button",
|
|
1159
|
+
{
|
|
1160
|
+
type: "button",
|
|
1161
|
+
onClick: () => setAttempt((n) => n + 1),
|
|
1162
|
+
className: "shrink-0 rounded px-1.5 py-0.5 text-foreground hover:bg-accent",
|
|
1163
|
+
children: "Try again"
|
|
1164
|
+
}
|
|
1165
|
+
)
|
|
1166
|
+
] })
|
|
1167
|
+
) : loaded.text === "" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "data-testid": "context-delivered-empty", className: "text-xs text-muted-foreground", children: "None" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1154
1168
|
"pre",
|
|
1155
1169
|
{
|
|
1156
1170
|
"data-testid": "context-delivered-text",
|
|
@@ -167,6 +167,20 @@ function buildContextLevels(rows, hierarchy) {
|
|
|
167
167
|
for (const level of out) level.groups = stableSort(level.groups, (g) => g.ref);
|
|
168
168
|
return stableSort(out, (level) => level.ref);
|
|
169
169
|
}
|
|
170
|
+
function mergeLevels(a, b) {
|
|
171
|
+
const groups = a.groups.map((g) => ({ ref: g.ref, rows: [...g.rows] }));
|
|
172
|
+
for (const g of b.groups) {
|
|
173
|
+
const hit = groups.find((x) => x.ref.id === g.ref.id);
|
|
174
|
+
if (hit) hit.rows.push(...g.rows);
|
|
175
|
+
else groups.push({ ref: g.ref, rows: [...g.rows] });
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
ref: { ...a.ref, order: Math.min(a.ref.order ?? 0, b.ref.order ?? 0) },
|
|
179
|
+
rows: [...a.rows, ...b.rows],
|
|
180
|
+
groups,
|
|
181
|
+
master: a.master ?? b.master
|
|
182
|
+
};
|
|
183
|
+
}
|
|
170
184
|
function buildContextTree(levels) {
|
|
171
185
|
const roots = [];
|
|
172
186
|
const byId = /* @__PURE__ */ new Map();
|
|
@@ -190,7 +204,7 @@ function buildContextTree(levels) {
|
|
|
190
204
|
last = hit;
|
|
191
205
|
siblings = hit.children;
|
|
192
206
|
}
|
|
193
|
-
if (last) last.level = level;
|
|
207
|
+
if (last) last.level = last.level ? mergeLevels(last.level, level) : level;
|
|
194
208
|
}
|
|
195
209
|
const sort = (list) => {
|
|
196
210
|
const sorted = stableSort(list, (n) => ({ order: rank.get(n) ?? 0 }));
|
|
@@ -836,7 +850,7 @@ import {
|
|
|
836
850
|
} from "@ai-matrx/design-system";
|
|
837
851
|
import { EyeOffIcon, PanelRightIcon } from "@ai-matrx/design-system/icons";
|
|
838
852
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
839
|
-
var BLIND_TOOLTIP = "
|
|
853
|
+
var BLIND_TOOLTIP = "Not sent to this model";
|
|
840
854
|
var BLIND_LABEL = "Not read";
|
|
841
855
|
function IconButton({
|
|
842
856
|
label,
|
|
@@ -1012,7 +1026,7 @@ import { ChevronLeftIcon, SearchIcon } from "@ai-matrx/design-system/icons";
|
|
|
1012
1026
|
|
|
1013
1027
|
// context/react/ContextDeliveredValue.tsx
|
|
1014
1028
|
import * as React4 from "react";
|
|
1015
|
-
import {
|
|
1029
|
+
import { Skeleton, cn as cn5 } from "@ai-matrx/design-system";
|
|
1016
1030
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1017
1031
|
function ContextDeliveredValue({
|
|
1018
1032
|
row,
|
|
@@ -1091,11 +1105,8 @@ function DeliveredSection({
|
|
|
1091
1105
|
});
|
|
1092
1106
|
},
|
|
1093
1107
|
(error) => {
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
state: "error",
|
|
1097
|
-
message: error instanceof Error && error.message ? error.message : "Couldn't load"
|
|
1098
|
-
});
|
|
1108
|
+
void error;
|
|
1109
|
+
if (live) setLoaded({ state: "error" });
|
|
1099
1110
|
}
|
|
1100
1111
|
);
|
|
1101
1112
|
return () => {
|
|
@@ -1123,18 +1134,21 @@ function DeliveredSection({
|
|
|
1123
1134
|
}
|
|
1124
1135
|
) : null
|
|
1125
1136
|
] }),
|
|
1126
|
-
unavailable ? null : !load ? /* @__PURE__ */ jsx5("span", { className: "text-xs text-muted-foreground", children: "\u2014" }) : loaded.state === "loading" ? /* @__PURE__ */ jsx5(Skeleton, { "data-testid": "context-delivered-loading", className: "h-16 w-full" }) : loaded.state === "error" ?
|
|
1127
|
-
|
|
1128
|
-
/* @__PURE__ */
|
|
1129
|
-
"
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1137
|
+
unavailable ? null : !load ? /* @__PURE__ */ jsx5("span", { className: "text-xs text-muted-foreground", children: "\u2014" }) : loaded.state === "loading" ? /* @__PURE__ */ jsx5(Skeleton, { "data-testid": "context-delivered-loading", className: "h-16 w-full" }) : loaded.state === "error" ? (
|
|
1138
|
+
// Calm and one line: the server's words never reach the person (the host's loader files the error).
|
|
1139
|
+
/* @__PURE__ */ jsxs5("span", { "data-testid": "context-delivered-unavailable", className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
1140
|
+
/* @__PURE__ */ jsx5("span", { className: "min-w-0 truncate", children: "Text not kept for this message" }),
|
|
1141
|
+
/* @__PURE__ */ jsx5(
|
|
1142
|
+
"button",
|
|
1143
|
+
{
|
|
1144
|
+
type: "button",
|
|
1145
|
+
onClick: () => setAttempt((n) => n + 1),
|
|
1146
|
+
className: "shrink-0 rounded px-1.5 py-0.5 text-foreground hover:bg-accent",
|
|
1147
|
+
children: "Try again"
|
|
1148
|
+
}
|
|
1149
|
+
)
|
|
1150
|
+
] })
|
|
1151
|
+
) : loaded.text === "" ? /* @__PURE__ */ jsx5("span", { "data-testid": "context-delivered-empty", className: "text-xs text-muted-foreground", children: "None" }) : /* @__PURE__ */ jsx5(
|
|
1138
1152
|
"pre",
|
|
1139
1153
|
{
|
|
1140
1154
|
"data-testid": "context-delivered-text",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/agents",
|
|
3
|
-
"version": "0.59.
|
|
3
|
+
"version": "0.59.263",
|
|
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": "
|
|
565
|
+
"gitHead": "6201da503daf423d01eadb1c5ff2efa5bc846bc0"
|
|
566
566
|
}
|