@ai-matrx/agents 0.9.0 → 0.9.2
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 +196 -1
- package/dist/catalog/index.cjs +128 -25
- package/dist/catalog/index.cjs.map +1 -1
- package/dist/catalog/index.d.cts +138 -8
- package/dist/catalog/index.d.ts +138 -8
- package/dist/catalog/index.js +128 -25
- package/dist/catalog/index.js.map +1 -1
- package/dist/catalog/native/index.cjs +194 -70
- package/dist/catalog/native/index.cjs.map +1 -1
- package/dist/catalog/native/index.d.cts +49 -5
- package/dist/catalog/native/index.d.ts +49 -5
- package/dist/catalog/native/index.js +194 -70
- package/dist/catalog/native/index.js.map +1 -1
- package/dist/catalog/react/index.cjs +205 -71
- package/dist/catalog/react/index.cjs.map +1 -1
- package/dist/catalog/react/index.d.cts +77 -4
- package/dist/catalog/react/index.d.ts +77 -4
- package/dist/catalog/react/index.js +205 -71
- package/dist/catalog/react/index.js.map +1 -1
- package/dist/{orchestra-BWJM2MWP.d.cts → orchestra-DljbEiks.d.cts} +75 -2
- package/dist/{orchestra-BWJM2MWP.d.ts → orchestra-DljbEiks.d.ts} +75 -2
- package/package.json +1 -1
|
@@ -169,53 +169,27 @@ function AgentCatalogProvider({
|
|
|
169
169
|
|
|
170
170
|
// catalog/shared/useAgentConsumer.ts
|
|
171
171
|
var import_react3 = require("react");
|
|
172
|
-
|
|
173
|
-
// catalog/types.ts
|
|
174
|
-
function isMandateAgentId(id) {
|
|
175
|
-
return id.startsWith("mandate:");
|
|
176
|
-
}
|
|
177
|
-
var SORT_OPTIONS = [
|
|
178
|
-
{ value: "updated-desc", label: "Recent" },
|
|
179
|
-
{ value: "created-desc", label: "Created" },
|
|
180
|
-
{ value: "name-asc", label: "A \u2192 Z" },
|
|
181
|
-
{ value: "name-desc", label: "Z \u2192 A" },
|
|
182
|
-
{ value: "category-asc", label: "Category" }
|
|
183
|
-
];
|
|
184
|
-
var AGENT_NONE_SENTINEL = "__none__";
|
|
185
|
-
var DEFAULT_AGENT_CONSUMER_STATE = {
|
|
186
|
-
tab: "mine",
|
|
187
|
-
sortBy: "updated-desc",
|
|
188
|
-
searchTerm: "",
|
|
189
|
-
includedCats: [],
|
|
190
|
-
includedTags: [],
|
|
191
|
-
favFilter: "all",
|
|
192
|
-
archFilter: "active",
|
|
193
|
-
accessFilter: "any",
|
|
194
|
-
favoritesFirst: true,
|
|
195
|
-
listPage: 1,
|
|
196
|
-
sharedPage: 1,
|
|
197
|
-
serverMatchedIds: [],
|
|
198
|
-
isServerSearching: false,
|
|
199
|
-
deepSearch: false
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
// catalog/shared/useAgentConsumer.ts
|
|
203
172
|
var DEBOUNCE_MS = 250;
|
|
204
173
|
var MIN_QUERY_LENGTH = 2;
|
|
205
174
|
function useAgentConsumer(consumerId, options) {
|
|
206
175
|
const catalog = useAgentCatalog();
|
|
176
|
+
const defaults = catalog.consumerDefaults;
|
|
207
177
|
const selectConsumer = (0, import_react3.useCallback)(
|
|
208
|
-
(state) => state.consumers[consumerId] ??
|
|
209
|
-
[consumerId]
|
|
178
|
+
(state) => state.consumers[consumerId] ?? defaults,
|
|
179
|
+
[consumerId, defaults]
|
|
210
180
|
);
|
|
211
181
|
const consumer = useAgentCatalogState(selectConsumer);
|
|
212
182
|
const optionsRef = (0, import_react3.useRef)(options);
|
|
213
183
|
optionsRef.current = options;
|
|
214
184
|
(0, import_react3.useEffect)(() => {
|
|
215
185
|
const opts = optionsRef.current;
|
|
186
|
+
const initial = {
|
|
187
|
+
...opts?.initialTab ? { tab: opts.initialTab } : {},
|
|
188
|
+
...opts?.initialArchFilter ? { archFilter: opts.initialArchFilter } : {}
|
|
189
|
+
};
|
|
216
190
|
catalog.registerConsumer(
|
|
217
191
|
consumerId,
|
|
218
|
-
|
|
192
|
+
Object.keys(initial).length > 0 ? initial : void 0
|
|
219
193
|
);
|
|
220
194
|
return () => {
|
|
221
195
|
if (optionsRef.current?.unregisterOnUnmount) {
|
|
@@ -338,7 +312,10 @@ function useAgentConsumer(consumerId, options) {
|
|
|
338
312
|
isSearching
|
|
339
313
|
});
|
|
340
314
|
}, [consumerId, catalog, matchedIds, isSearching]);
|
|
341
|
-
const hasActiveFilters = consumer.searchTerm !== "" || consumer.includedCats.length > 0 || consumer.includedTags.length > 0 || consumer.favFilter !== "all" ||
|
|
315
|
+
const hasActiveFilters = consumer.searchTerm !== "" || consumer.includedCats.length > 0 || consumer.includedTags.length > 0 || consumer.favFilter !== "all" || // The archive filter is compared to THIS CATALOG'S default, not to the
|
|
316
|
+
// hardcoded platform one: a host that legitimately defaults to "show all"
|
|
317
|
+
// must not have the reset control permanently lit.
|
|
318
|
+
consumer.archFilter !== defaults.archFilter || consumer.accessFilter !== "any" || !consumer.favoritesFirst;
|
|
342
319
|
return {
|
|
343
320
|
tab: consumer.tab,
|
|
344
321
|
sortBy: consumer.sortBy,
|
|
@@ -347,6 +324,7 @@ function useAgentConsumer(consumerId, options) {
|
|
|
347
324
|
includedTags: consumer.includedTags,
|
|
348
325
|
favFilter: consumer.favFilter,
|
|
349
326
|
archFilter: consumer.archFilter,
|
|
327
|
+
archFilterDefault: defaults.archFilter,
|
|
350
328
|
accessFilter: consumer.accessFilter,
|
|
351
329
|
favoritesFirst: consumer.favoritesFirst,
|
|
352
330
|
listPage: consumer.listPage,
|
|
@@ -376,6 +354,34 @@ function useAgentConsumer(consumerId, options) {
|
|
|
376
354
|
// catalog/shared/useAgentListCore.ts
|
|
377
355
|
var import_react4 = require("react");
|
|
378
356
|
|
|
357
|
+
// catalog/types.ts
|
|
358
|
+
function isMandateAgentId(id) {
|
|
359
|
+
return id.startsWith("mandate:");
|
|
360
|
+
}
|
|
361
|
+
var SORT_OPTIONS = [
|
|
362
|
+
{ value: "updated-desc", label: "Recent" },
|
|
363
|
+
{ value: "created-desc", label: "Created" },
|
|
364
|
+
{ value: "name-asc", label: "A \u2192 Z" },
|
|
365
|
+
{ value: "name-desc", label: "Z \u2192 A" },
|
|
366
|
+
{ value: "category-asc", label: "Category" }
|
|
367
|
+
];
|
|
368
|
+
var ARCHIVE_FILTER_ORDER = [
|
|
369
|
+
"active",
|
|
370
|
+
"both",
|
|
371
|
+
"archived"
|
|
372
|
+
];
|
|
373
|
+
var ARCHIVE_FILTER_OPTIONS = [
|
|
374
|
+
{ value: "active", label: "Hide archived", chip: "Archive" },
|
|
375
|
+
{ value: "both", label: "Show all", chip: "All + archived" },
|
|
376
|
+
{ value: "archived", label: "Archived only", chip: "Archived only" }
|
|
377
|
+
];
|
|
378
|
+
function nextArchFilter(current) {
|
|
379
|
+
const index = ARCHIVE_FILTER_ORDER.indexOf(current);
|
|
380
|
+
if (index < 0) return ARCHIVE_FILTER_ORDER[0];
|
|
381
|
+
return ARCHIVE_FILTER_ORDER[(index + 1) % ARCHIVE_FILTER_ORDER.length];
|
|
382
|
+
}
|
|
383
|
+
var AGENT_NONE_SENTINEL = "__none__";
|
|
384
|
+
|
|
379
385
|
// catalog/labels.ts
|
|
380
386
|
function agentListEmptyLabel(tab, labels) {
|
|
381
387
|
switch (tab) {
|
|
@@ -392,6 +398,26 @@ function shouldDefaultAgentListToPublicTab(args) {
|
|
|
392
398
|
if (!args.agentsLoaded) return false;
|
|
393
399
|
return args.ownedCount === 0;
|
|
394
400
|
}
|
|
401
|
+
function agentArchiveFilterChipLabel(archFilter) {
|
|
402
|
+
return ARCHIVE_FILTER_OPTIONS.find((o) => o.value === archFilter)?.chip ?? "Archive";
|
|
403
|
+
}
|
|
404
|
+
function agentArchiveFilterStateLabel(archFilter) {
|
|
405
|
+
return ARCHIVE_FILTER_OPTIONS.find((o) => o.value === archFilter)?.label ?? "Hide archived";
|
|
406
|
+
}
|
|
407
|
+
function agentArchiveFilterControlLabel(archFilter) {
|
|
408
|
+
return `Archive filter: ${agentArchiveFilterStateLabel(
|
|
409
|
+
archFilter
|
|
410
|
+
).toLowerCase()}. Click for ${agentArchiveFilterStateLabel(
|
|
411
|
+
nextArchFilter(archFilter)
|
|
412
|
+
).toLowerCase()}`;
|
|
413
|
+
}
|
|
414
|
+
function agentListFooterLabel(args) {
|
|
415
|
+
const { count, archFilter, archivedHiddenCount } = args;
|
|
416
|
+
if (archFilter === "archived") return `${count} archived shown`;
|
|
417
|
+
const base = `${count} agent${count !== 1 ? "s" : ""}`;
|
|
418
|
+
if (archFilter === "both") return `${base} \xB7 archived shown`;
|
|
419
|
+
return archivedHiddenCount > 0 ? `${base} \xB7 ${archivedHiddenCount} archived hidden` : base;
|
|
420
|
+
}
|
|
395
421
|
|
|
396
422
|
// catalog/score.ts
|
|
397
423
|
function computeAgentSearchScore(agent, query) {
|
|
@@ -468,7 +494,19 @@ function memoize2(fn) {
|
|
|
468
494
|
return last;
|
|
469
495
|
};
|
|
470
496
|
}
|
|
497
|
+
function compareAgentIds(a, b) {
|
|
498
|
+
const idA = a.id ?? "";
|
|
499
|
+
const idB = b.id ?? "";
|
|
500
|
+
if (idA < idB) return -1;
|
|
501
|
+
if (idA > idB) return 1;
|
|
502
|
+
return 0;
|
|
503
|
+
}
|
|
471
504
|
function applyAgentSortComparator(a, b, sortBy) {
|
|
505
|
+
const primary = compareAgentSortKey(a, b, sortBy);
|
|
506
|
+
if (!Number.isFinite(primary) || primary === 0) return compareAgentIds(a, b);
|
|
507
|
+
return primary;
|
|
508
|
+
}
|
|
509
|
+
function compareAgentSortKey(a, b, sortBy) {
|
|
472
510
|
switch (sortBy) {
|
|
473
511
|
case "name-asc":
|
|
474
512
|
return (a.name ?? "").localeCompare(b.name ?? "");
|
|
@@ -570,8 +608,7 @@ function filterUserTypeAgents(agents, consumer) {
|
|
|
570
608
|
if (tab === "mine" && agent.isOwner !== true) return false;
|
|
571
609
|
if (tab === "shared" && !(agent.isOwner === false && agent.accessLevel != null))
|
|
572
610
|
return false;
|
|
573
|
-
if (archFilter
|
|
574
|
-
if (archFilter === "archived" && !agent.isArchived) return false;
|
|
611
|
+
if (!agentMatchesArchiveFilter(agent, archFilter)) return false;
|
|
575
612
|
if (favFilter === "yes" && !agent.isFavorite) return false;
|
|
576
613
|
if (favFilter === "no" && agent.isFavorite) return false;
|
|
577
614
|
if (accessFilter === "owned" && agent.isOwner !== true) return false;
|
|
@@ -601,9 +638,10 @@ function filterUserTypeAgents(agents, consumer) {
|
|
|
601
638
|
return sortFilteredAgents(filtered, consumer);
|
|
602
639
|
}
|
|
603
640
|
function filterBuiltinTypeAgents(agents, consumer) {
|
|
604
|
-
const { searchTerm, favFilter, includedCats, includedTags } = consumer;
|
|
641
|
+
const { searchTerm, favFilter, archFilter, includedCats, includedTags } = consumer;
|
|
605
642
|
const serverMatched = new Set(consumer.serverMatchedIds);
|
|
606
643
|
const filtered = agents.filter((agent) => {
|
|
644
|
+
if (!agentMatchesArchiveFilter(agent, archFilter)) return false;
|
|
607
645
|
if (favFilter === "yes" && !agent.isFavorite) return false;
|
|
608
646
|
if (favFilter === "no" && agent.isFavorite) return false;
|
|
609
647
|
if (includedCats.length > 0) {
|
|
@@ -644,22 +682,55 @@ var makeSelectFilteredAgents = (includeSystemInAll = false) => memoize2(
|
|
|
644
682
|
return filterUserTypeAgents(userAgents, consumer);
|
|
645
683
|
}
|
|
646
684
|
);
|
|
685
|
+
function agentMatchesArchiveFilter(agent, archFilter) {
|
|
686
|
+
if (archFilter === "active") return !agent.isArchived;
|
|
687
|
+
if (archFilter === "archived") return Boolean(agent.isArchived);
|
|
688
|
+
return true;
|
|
689
|
+
}
|
|
690
|
+
function countBuiltinRows(agents, archFilter) {
|
|
691
|
+
let n = 0;
|
|
692
|
+
for (const a of agents) {
|
|
693
|
+
if (a.agentType !== "builtin") continue;
|
|
694
|
+
if (!agentMatchesArchiveFilter(a, archFilter)) continue;
|
|
695
|
+
n += 1;
|
|
696
|
+
}
|
|
697
|
+
return n;
|
|
698
|
+
}
|
|
699
|
+
function countUserRows(agents, archFilter, predicate) {
|
|
700
|
+
let n = 0;
|
|
701
|
+
for (const a of agents) {
|
|
702
|
+
if (a.agentType !== "user") continue;
|
|
703
|
+
if (!agentMatchesArchiveFilter(a, archFilter)) continue;
|
|
704
|
+
if (predicate(a)) n += 1;
|
|
705
|
+
}
|
|
706
|
+
return n;
|
|
707
|
+
}
|
|
708
|
+
var isOwned = (a) => a.isOwner === true;
|
|
709
|
+
var isShared = (a) => a.isOwner === false && a.accessLevel != null;
|
|
710
|
+
var isAny = () => true;
|
|
711
|
+
var isFavorite = (a) => Boolean(a.isFavorite);
|
|
712
|
+
var selectAgentTabCounts = memoize2(
|
|
713
|
+
(agents, archFilter) => ({
|
|
714
|
+
mine: countUserRows(agents, archFilter, isOwned),
|
|
715
|
+
shared: countUserRows(agents, archFilter, isShared),
|
|
716
|
+
all: countUserRows(agents, archFilter, isAny),
|
|
717
|
+
system: countBuiltinRows(agents, archFilter)
|
|
718
|
+
})
|
|
719
|
+
);
|
|
647
720
|
var selectTotalUserAgentsCount = memoize1(
|
|
648
|
-
(agents) =>
|
|
721
|
+
(agents) => countUserRows(agents, "active", isAny)
|
|
649
722
|
);
|
|
650
723
|
var selectTotalOwnedAgentsCount = memoize1(
|
|
651
|
-
(agents) =>
|
|
724
|
+
(agents) => countUserRows(agents, "active", isOwned)
|
|
652
725
|
);
|
|
653
726
|
var selectTotalSharedAgentsCount = memoize1(
|
|
654
|
-
(agents) =>
|
|
655
|
-
(a) => a.isOwner === false && a.accessLevel != null
|
|
656
|
-
).length
|
|
727
|
+
(agents) => countUserRows(agents, "active", isShared)
|
|
657
728
|
);
|
|
658
729
|
var selectTotalBuiltinAgentsCount = memoize1(
|
|
659
|
-
(agents) =>
|
|
730
|
+
(agents) => countBuiltinRows(agents, "active")
|
|
660
731
|
);
|
|
661
732
|
var selectTotalFavoriteAgentsCount = memoize1(
|
|
662
|
-
(agents) =>
|
|
733
|
+
(agents) => countUserRows(agents, "active", isFavorite)
|
|
663
734
|
);
|
|
664
735
|
|
|
665
736
|
// catalog/shared/useAgentListCore.ts
|
|
@@ -678,6 +749,7 @@ function useAgentListCore({
|
|
|
678
749
|
initialTab,
|
|
679
750
|
includeSystemInAll = false,
|
|
680
751
|
visibleTabs,
|
|
752
|
+
initialArchFilter,
|
|
681
753
|
excludeAgentIds = EMPTY_EXCLUDES,
|
|
682
754
|
defaultMandateKey
|
|
683
755
|
}) {
|
|
@@ -687,10 +759,14 @@ function useAgentListCore({
|
|
|
687
759
|
const [hoveredAgent, setHoveredAgent] = (0, import_react4.useState)(null);
|
|
688
760
|
const hoverLeaveTimerRef = (0, import_react4.useRef)(null);
|
|
689
761
|
const defaultTabAppliedRef = (0, import_react4.useRef)(false);
|
|
690
|
-
const consumer = useAgentConsumer(consumerId, {
|
|
762
|
+
const consumer = useAgentConsumer(consumerId, {
|
|
763
|
+
unregisterOnUnmount: true,
|
|
764
|
+
...initialArchFilter ? { initialArchFilter } : {}
|
|
765
|
+
});
|
|
691
766
|
const rows = useAgentCatalogRows();
|
|
692
767
|
const userId = catalog.getUserIdOrNull();
|
|
693
|
-
const
|
|
768
|
+
const tabCountsForFilter = selectAgentTabCounts(rows, consumer.state.archFilter);
|
|
769
|
+
const ownedCount = tabCountsForFilter.mine;
|
|
694
770
|
const selectFiltered = (0, import_react4.useMemo)(
|
|
695
771
|
() => makeSelectFilteredAgents(includeSystemInAll),
|
|
696
772
|
[includeSystemInAll]
|
|
@@ -700,19 +776,27 @@ function useAgentListCore({
|
|
|
700
776
|
() => new Set(excludeAgentIds),
|
|
701
777
|
[excludeAgentIds]
|
|
702
778
|
);
|
|
703
|
-
const
|
|
779
|
+
const applyExcludes = (0, import_react4.useCallback)(
|
|
780
|
+
(list) => excludedAgentIds.size === 0 ? list : list.filter((agent) => !excludedAgentIds.has(agent.id)),
|
|
781
|
+
[excludedAgentIds]
|
|
782
|
+
);
|
|
783
|
+
const agents = applyExcludes(filteredAgents);
|
|
784
|
+
const selectArchivedProbe = (0, import_react4.useMemo)(
|
|
785
|
+
() => makeSelectFilteredAgents(includeSystemInAll),
|
|
786
|
+
[includeSystemInAll]
|
|
787
|
+
);
|
|
788
|
+
const archiveProbeState = (0, import_react4.useMemo)(
|
|
789
|
+
() => ({ ...consumer.state, archFilter: "archived" }),
|
|
790
|
+
[consumer.state]
|
|
791
|
+
);
|
|
792
|
+
const archivedHiddenCount = consumer.archFilter === "active" ? applyExcludes(selectArchivedProbe(rows, archiveProbeState)).length : 0;
|
|
704
793
|
const status = useAgentCatalogState(selectStatus);
|
|
705
794
|
const activeAgentId = activeAgentIdOverride ?? null;
|
|
706
795
|
const pinnedAgent = activeAgentId ? catalog.getAgent(activeAgentId) : void 0;
|
|
707
796
|
const onSystemTab = consumer.tab === "system";
|
|
708
797
|
const allCategories = onSystemTab ? selectAllSystemAgentCategories(rows) : selectAllAgentCategories(rows);
|
|
709
798
|
const allTags = onSystemTab ? selectAllSystemAgentTags(rows) : selectAllAgentTags(rows);
|
|
710
|
-
const tabCounts =
|
|
711
|
-
mine: ownedCount,
|
|
712
|
-
shared: selectTotalSharedAgentsCount(rows),
|
|
713
|
-
all: selectTotalUserAgentsCount(rows),
|
|
714
|
-
system: selectTotalBuiltinAgentsCount(rows)
|
|
715
|
-
};
|
|
799
|
+
const tabCounts = tabCountsForFilter;
|
|
716
800
|
const isLoading = status === "loading";
|
|
717
801
|
const agentsLoaded = status === "succeeded" || status === "failed";
|
|
718
802
|
const ensureLoaded = (0, import_react4.useCallback)(() => {
|
|
@@ -792,7 +876,9 @@ function useAgentListCore({
|
|
|
792
876
|
},
|
|
793
877
|
[onSelect, navigateTo, navigate, catalog, consumerId]
|
|
794
878
|
);
|
|
795
|
-
const activeFilterCount = (consumer.sortBy !== "updated-desc" ? 1 : 0) + (consumer.includedCats.length > 0 ? 1 : 0) + (consumer.includedTags.length > 0 ? 1 : 0) + (consumer.favFilter !== "all" ? 1 : 0)
|
|
879
|
+
const activeFilterCount = (consumer.sortBy !== "updated-desc" ? 1 : 0) + (consumer.includedCats.length > 0 ? 1 : 0) + (consumer.includedTags.length > 0 ? 1 : 0) + (consumer.favFilter !== "all" ? 1 : 0) + // The archive filter counts like every other filter, so a list showing
|
|
880
|
+
// archived rows offers the reset control that puts them away again.
|
|
881
|
+
(consumer.archFilter !== consumer.archFilterDefault ? 1 : 0);
|
|
796
882
|
const handleAgentHover = (0, import_react4.useCallback)(
|
|
797
883
|
(agent, panelOpen) => {
|
|
798
884
|
if (panelOpen) return;
|
|
@@ -833,8 +919,15 @@ function useAgentListCore({
|
|
|
833
919
|
},
|
|
834
920
|
[]
|
|
835
921
|
);
|
|
922
|
+
const footerLabel = agentListFooterLabel({
|
|
923
|
+
count: agents.length,
|
|
924
|
+
archFilter: consumer.archFilter,
|
|
925
|
+
archivedHiddenCount
|
|
926
|
+
});
|
|
836
927
|
return {
|
|
837
928
|
agents,
|
|
929
|
+
archivedHiddenCount,
|
|
930
|
+
footerLabel,
|
|
838
931
|
isLoading,
|
|
839
932
|
activeAgentId,
|
|
840
933
|
pinnedAgent: pinnedAgent ?? null,
|
|
@@ -951,6 +1044,18 @@ var SHAPES = {
|
|
|
951
1044
|
"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"
|
|
952
1045
|
]
|
|
953
1046
|
},
|
|
1047
|
+
/**
|
|
1048
|
+
* THE ARCHIVE GLYPH (Lucide `archive`) — the ONE mark of the platform
|
|
1049
|
+
* archive filter, drawn identically in every Matrx client so the control a
|
|
1050
|
+
* person learns on one surface is recognisable on all of them.
|
|
1051
|
+
*/
|
|
1052
|
+
archive: {
|
|
1053
|
+
paths: [
|
|
1054
|
+
"M3 3h18a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z",
|
|
1055
|
+
"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",
|
|
1056
|
+
"M10 12h4"
|
|
1057
|
+
]
|
|
1058
|
+
},
|
|
954
1059
|
circleCheck: {
|
|
955
1060
|
paths: ["m9 12 2 2 4-4"],
|
|
956
1061
|
circles: [{ cx: 12, cy: 12, r: 10 }]
|
|
@@ -1021,6 +1126,7 @@ var ArrowUpDownIcon = makeIcon("arrowUpDown");
|
|
|
1021
1126
|
var FolderIcon = makeIcon("folder");
|
|
1022
1127
|
var TagIcon = makeIcon("tag");
|
|
1023
1128
|
var RotateCcwIcon = makeIcon("rotateCcw");
|
|
1129
|
+
var ArchiveIcon = makeIcon("archive");
|
|
1024
1130
|
var LoaderIcon = makeIcon("loader");
|
|
1025
1131
|
var UsersIcon = makeIcon("users");
|
|
1026
1132
|
var ClockIcon = makeIcon("clock");
|
|
@@ -1078,13 +1184,17 @@ function FilterChip({
|
|
|
1078
1184
|
label,
|
|
1079
1185
|
active,
|
|
1080
1186
|
focused,
|
|
1081
|
-
onClick
|
|
1187
|
+
onClick,
|
|
1188
|
+
ariaLabel,
|
|
1189
|
+
testId
|
|
1082
1190
|
}) {
|
|
1083
1191
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
1084
1192
|
"button",
|
|
1085
1193
|
{
|
|
1086
1194
|
type: "button",
|
|
1087
1195
|
onClick,
|
|
1196
|
+
...ariaLabel ? { "aria-label": ariaLabel } : {},
|
|
1197
|
+
...testId ? { "data-testid": testId } : {},
|
|
1088
1198
|
className: (0, import_design_system.cn)(
|
|
1089
1199
|
"inline-flex items-center gap-1 h-6 px-1.5 rounded text-[11px] font-medium shrink-0 transition-colors",
|
|
1090
1200
|
focused ? "bg-primary/15 text-primary border border-primary/30 ring-1 ring-primary/20" : active ? "bg-primary/10 text-primary border border-primary/20" : "text-muted-foreground hover:text-foreground hover:bg-muted/50 border border-transparent"
|
|
@@ -1229,15 +1339,15 @@ function FavoriteAgentButton({
|
|
|
1229
1339
|
[id]
|
|
1230
1340
|
);
|
|
1231
1341
|
const record = useAgentCatalogState(select);
|
|
1232
|
-
const
|
|
1342
|
+
const isFavorite2 = record?.isFavorite ?? false;
|
|
1233
1343
|
const isOwner = record?.isOwner ?? true;
|
|
1234
1344
|
const handleClick = (e) => {
|
|
1235
1345
|
e.stopPropagation();
|
|
1236
1346
|
if (disabled || !isOwner) return;
|
|
1237
|
-
void catalog.setFavorite(id, !
|
|
1347
|
+
void catalog.setFavorite(id, !isFavorite2).catch(() => {
|
|
1238
1348
|
});
|
|
1239
1349
|
};
|
|
1240
|
-
const title = isOwner ?
|
|
1350
|
+
const title = isOwner ? isFavorite2 ? "Remove from favorites" : "Add to favorites" : "Shared \u2014 cannot favorite";
|
|
1241
1351
|
if (variant === "list") {
|
|
1242
1352
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1243
1353
|
"button",
|
|
@@ -1251,14 +1361,14 @@ function FavoriteAgentButton({
|
|
|
1251
1361
|
onClick: handleClick,
|
|
1252
1362
|
disabled: disabled || !isOwner,
|
|
1253
1363
|
title,
|
|
1254
|
-
"aria-label":
|
|
1364
|
+
"aria-label": isFavorite2 ? "Remove from favorites" : "Add to favorites",
|
|
1255
1365
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1256
1366
|
StarIcon,
|
|
1257
1367
|
{
|
|
1258
|
-
filled:
|
|
1368
|
+
filled: isFavorite2,
|
|
1259
1369
|
className: (0, import_design_system2.cn)(
|
|
1260
1370
|
"h-3.5 w-3.5 transition-all duration-150",
|
|
1261
|
-
|
|
1371
|
+
isFavorite2 ? "matrx-agent-star-on" : "text-muted-foreground/40 hover:matrx-agent-star-on"
|
|
1262
1372
|
)
|
|
1263
1373
|
}
|
|
1264
1374
|
)
|
|
@@ -1273,13 +1383,13 @@ function FavoriteAgentButton({
|
|
|
1273
1383
|
"absolute top-2.5 right-2.5 z-10 p-0.5 rounded transition-all duration-150",
|
|
1274
1384
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",
|
|
1275
1385
|
disabled || !isOwner ? "cursor-not-allowed" : "hover:scale-110 cursor-pointer",
|
|
1276
|
-
|
|
1386
|
+
isFavorite2 ? "matrx-agent-star-on" : "text-muted-foreground/40 hover:matrx-agent-star-on"
|
|
1277
1387
|
),
|
|
1278
1388
|
onClick: handleClick,
|
|
1279
1389
|
disabled: disabled || !isOwner,
|
|
1280
1390
|
title,
|
|
1281
|
-
"aria-label":
|
|
1282
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StarIcon, { filled:
|
|
1391
|
+
"aria-label": isFavorite2 ? "Remove from favorites" : "Add to favorites",
|
|
1392
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StarIcon, { filled: isFavorite2, className: "w-4 h-4 transition-all duration-150" })
|
|
1283
1393
|
}
|
|
1284
1394
|
);
|
|
1285
1395
|
}
|
|
@@ -1507,6 +1617,17 @@ function AgentFilterBar({
|
|
|
1507
1617
|
}
|
|
1508
1618
|
}
|
|
1509
1619
|
),
|
|
1620
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1621
|
+
FilterChip,
|
|
1622
|
+
{
|
|
1623
|
+
icon: ArchiveIcon,
|
|
1624
|
+
label: agentArchiveFilterChipLabel(consumer.archFilter),
|
|
1625
|
+
active: consumer.archFilter !== consumer.archFilterDefault,
|
|
1626
|
+
ariaLabel: agentArchiveFilterControlLabel(consumer.archFilter),
|
|
1627
|
+
testId: "agent-archive-filter",
|
|
1628
|
+
onClick: () => consumer.setArchFilter(nextArchFilter(consumer.archFilter))
|
|
1629
|
+
}
|
|
1630
|
+
),
|
|
1510
1631
|
allCategories.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1511
1632
|
FilterChip,
|
|
1512
1633
|
{
|
|
@@ -1615,6 +1736,7 @@ function AgentRow({
|
|
|
1615
1736
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1616
1737
|
"div",
|
|
1617
1738
|
{
|
|
1739
|
+
"data-testid": `agent-row-${agent.id}`,
|
|
1618
1740
|
className: (0, import_design_system5.cn)(
|
|
1619
1741
|
"flex items-center w-full text-left transition-colors group",
|
|
1620
1742
|
"hover:bg-muted/50 active:bg-muted/70",
|
|
@@ -1705,7 +1827,8 @@ function AgentListContent({
|
|
|
1705
1827
|
systemTabLabel,
|
|
1706
1828
|
pinnedAgent = null,
|
|
1707
1829
|
defaultRow = null,
|
|
1708
|
-
listOpen = false
|
|
1830
|
+
listOpen = false,
|
|
1831
|
+
archivedHiddenCount = 0
|
|
1709
1832
|
}) {
|
|
1710
1833
|
const catalog = useAgentCatalog();
|
|
1711
1834
|
const listScrollRef = (0, import_react6.useRef)(null);
|
|
@@ -1843,11 +1966,18 @@ function AgentListContent({
|
|
|
1843
1966
|
] }) }),
|
|
1844
1967
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "h-px bg-border shrink-0" }),
|
|
1845
1968
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center justify-between px-2.5 py-1.5 shrink-0", children: [
|
|
1846
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1969
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1970
|
+
"span",
|
|
1971
|
+
{
|
|
1972
|
+
"data-testid": "agent-list-footer",
|
|
1973
|
+
className: "text-[10px] text-muted-foreground tabular-nums",
|
|
1974
|
+
children: agentListFooterLabel({
|
|
1975
|
+
count: agents.length,
|
|
1976
|
+
archFilter: consumer.archFilter,
|
|
1977
|
+
archivedHiddenCount
|
|
1978
|
+
})
|
|
1979
|
+
}
|
|
1980
|
+
),
|
|
1851
1981
|
consumer.searchTerm && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1852
1982
|
"button",
|
|
1853
1983
|
{
|
|
@@ -2070,6 +2200,7 @@ function AgentListDropdown({
|
|
|
2070
2200
|
const inputRef = (0, import_react7.useRef)(null);
|
|
2071
2201
|
const {
|
|
2072
2202
|
agents,
|
|
2203
|
+
archivedHiddenCount,
|
|
2073
2204
|
isLoading,
|
|
2074
2205
|
activeAgentId,
|
|
2075
2206
|
pinnedAgent,
|
|
@@ -2205,6 +2336,7 @@ function AgentListDropdown({
|
|
|
2205
2336
|
onFilterChipClick: handleFilterChipClick,
|
|
2206
2337
|
rightPanel,
|
|
2207
2338
|
tabCounts,
|
|
2339
|
+
archivedHiddenCount,
|
|
2208
2340
|
...visibleTabs ? { visibleTabs } : {},
|
|
2209
2341
|
...systemTabLabel ?? (includeSystemInAll ? "System" : void 0) ? {
|
|
2210
2342
|
systemTabLabel: systemTabLabel ?? (includeSystemInAll ? "System" : void 0)
|
|
@@ -2361,6 +2493,7 @@ function AgentListInlinePicker({
|
|
|
2361
2493
|
const [mobileSubView, setMobileSubView] = (0, import_react8.useState)(null);
|
|
2362
2494
|
const {
|
|
2363
2495
|
agents,
|
|
2496
|
+
archivedHiddenCount,
|
|
2364
2497
|
isLoading,
|
|
2365
2498
|
allCategories,
|
|
2366
2499
|
allTags,
|
|
@@ -2467,6 +2600,7 @@ function AgentListInlinePicker({
|
|
|
2467
2600
|
onFilterChipClick: handleFilterChipClick,
|
|
2468
2601
|
rightPanel: null,
|
|
2469
2602
|
tabCounts,
|
|
2603
|
+
archivedHiddenCount,
|
|
2470
2604
|
...visibleTabs ? { visibleTabs } : {},
|
|
2471
2605
|
...systemTabLabel ?? (includeSystemInAll ? "System" : void 0) ? {
|
|
2472
2606
|
systemTabLabel: systemTabLabel ?? (includeSystemInAll ? "System" : void 0)
|