@ai-matrx/agents 0.59.229 → 0.59.231

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.
@@ -348,85 +348,6 @@ import {
348
348
  useState as useState2
349
349
  } from "react";
350
350
 
351
- // quick/shape.ts
352
- var QUICK_AGENT_TAG = "kind:quick";
353
- var QUICK_AGENT_DEFAULT_SETTINGS = Object.freeze({
354
- temperature: 0.7,
355
- topP: 1,
356
- maxOutputTokens: 4096
357
- });
358
- function isQuickAgentSummary(row) {
359
- return row.tags.includes(QUICK_AGENT_TAG);
360
- }
361
- function withoutQuickAgents(rows) {
362
- return rows.filter((row) => !isQuickAgentSummary(row));
363
- }
364
-
365
- // catalog/types.ts
366
- function isMandateAgentId(id) {
367
- return id.startsWith("mandate:");
368
- }
369
- var SORT_OPTIONS = [
370
- { value: "updated-desc", label: "Recent" },
371
- { value: "created-desc", label: "Created" },
372
- { value: "name-asc", label: "A \u2192 Z" },
373
- { value: "name-desc", label: "Z \u2192 A" },
374
- { value: "category-asc", label: "Category" }
375
- ];
376
- var ARCHIVE_FILTER_ORDER = [
377
- "active",
378
- "both",
379
- "archived"
380
- ];
381
- var ARCHIVE_FILTER_OPTIONS = [
382
- { value: "active", label: "Hide archived", chip: "Archive" },
383
- { value: "both", label: "Show all", chip: "All + archived" },
384
- { value: "archived", label: "Archived only", chip: "Archived only" }
385
- ];
386
- function nextArchFilter(current) {
387
- const index = ARCHIVE_FILTER_ORDER.indexOf(current);
388
- if (index < 0) return ARCHIVE_FILTER_ORDER[0];
389
- return ARCHIVE_FILTER_ORDER[(index + 1) % ARCHIVE_FILTER_ORDER.length];
390
- }
391
- var AGENT_NONE_SENTINEL = "__none__";
392
-
393
- // catalog/labels.ts
394
- function agentListEmptyLabel(tab, labels) {
395
- switch (tab) {
396
- case "system":
397
- return labels.emptySystem;
398
- case "shared":
399
- return labels.emptyShared;
400
- default:
401
- return labels.emptyDefault;
402
- }
403
- }
404
- function shouldDefaultAgentListToPublicTab(args) {
405
- if (!args.userId) return true;
406
- if (!args.agentsLoaded) return false;
407
- return args.ownedCount === 0;
408
- }
409
- function agentArchiveFilterChipLabel(archFilter) {
410
- return ARCHIVE_FILTER_OPTIONS.find((o) => o.value === archFilter)?.chip ?? "Archive";
411
- }
412
- function agentArchiveFilterStateLabel(archFilter) {
413
- return ARCHIVE_FILTER_OPTIONS.find((o) => o.value === archFilter)?.label ?? "Hide archived";
414
- }
415
- function agentArchiveFilterControlLabel(archFilter) {
416
- return `Archive filter: ${agentArchiveFilterStateLabel(
417
- archFilter
418
- ).toLowerCase()}. Click for ${agentArchiveFilterStateLabel(
419
- nextArchFilter(archFilter)
420
- ).toLowerCase()}`;
421
- }
422
- function agentListFooterLabel(args) {
423
- const { count, archFilter, archivedHiddenCount } = args;
424
- if (archFilter === "archived") return `${count} archived shown`;
425
- const base = `${count} agent${count !== 1 ? "s" : ""}`;
426
- if (archFilter === "both") return `${base} \xB7 archived shown`;
427
- return archivedHiddenCount > 0 ? `${base} \xB7 ${archivedHiddenCount} archived hidden` : base;
428
- }
429
-
430
351
  // catalog/score.ts
431
352
  function computeAgentSearchScore(agent, query) {
432
353
  const q = query.trim().toLowerCase();
@@ -473,6 +394,34 @@ function agentMatchesSearch(agent, query) {
473
394
  return computeAgentSearchScore(agent, query) > 0;
474
395
  }
475
396
 
397
+ // catalog/types.ts
398
+ function isMandateAgentId(id) {
399
+ return id.startsWith("mandate:");
400
+ }
401
+ var SORT_OPTIONS = [
402
+ { value: "updated-desc", label: "Recent" },
403
+ { value: "created-desc", label: "Created" },
404
+ { value: "name-asc", label: "A \u2192 Z" },
405
+ { value: "name-desc", label: "Z \u2192 A" },
406
+ { value: "category-asc", label: "Category" }
407
+ ];
408
+ var ARCHIVE_FILTER_ORDER = [
409
+ "active",
410
+ "both",
411
+ "archived"
412
+ ];
413
+ var ARCHIVE_FILTER_OPTIONS = [
414
+ { value: "active", label: "Hide archived", chip: "Archive" },
415
+ { value: "both", label: "Show all", chip: "All + archived" },
416
+ { value: "archived", label: "Archived only", chip: "Archived only" }
417
+ ];
418
+ function nextArchFilter(current) {
419
+ const index = ARCHIVE_FILTER_ORDER.indexOf(current);
420
+ if (index < 0) return ARCHIVE_FILTER_ORDER[0];
421
+ return ARCHIVE_FILTER_ORDER[(index + 1) % ARCHIVE_FILTER_ORDER.length];
422
+ }
423
+ var AGENT_NONE_SENTINEL = "__none__";
424
+
476
425
  // catalog/selectors.ts
477
426
  function memoize1(fn) {
478
427
  let lastA;
@@ -741,6 +690,52 @@ var selectTotalFavoriteAgentsCount = memoize1(
741
690
  (agents) => countUserRows(agents, "active", isFavorite)
742
691
  );
743
692
 
693
+ // quick/shape.ts
694
+ var QUICK_AGENT_TAG = "kind:quick";
695
+ function isQuickAgentSummary(row) {
696
+ return row.tags.includes(QUICK_AGENT_TAG);
697
+ }
698
+ function withoutQuickAgents(rows) {
699
+ return rows.filter((row) => !isQuickAgentSummary(row));
700
+ }
701
+
702
+ // catalog/labels.ts
703
+ function agentListEmptyLabel(tab, labels) {
704
+ switch (tab) {
705
+ case "system":
706
+ return labels.emptySystem;
707
+ case "shared":
708
+ return labels.emptyShared;
709
+ default:
710
+ return labels.emptyDefault;
711
+ }
712
+ }
713
+ function shouldDefaultAgentListToPublicTab(args) {
714
+ if (!args.userId) return true;
715
+ if (!args.agentsLoaded) return false;
716
+ return args.ownedCount === 0;
717
+ }
718
+ function agentArchiveFilterChipLabel(archFilter) {
719
+ return ARCHIVE_FILTER_OPTIONS.find((o) => o.value === archFilter)?.chip ?? "Archive";
720
+ }
721
+ function agentArchiveFilterStateLabel(archFilter) {
722
+ return ARCHIVE_FILTER_OPTIONS.find((o) => o.value === archFilter)?.label ?? "Hide archived";
723
+ }
724
+ function agentArchiveFilterControlLabel(archFilter) {
725
+ return `Archive filter: ${agentArchiveFilterStateLabel(
726
+ archFilter
727
+ ).toLowerCase()}. Click for ${agentArchiveFilterStateLabel(
728
+ nextArchFilter(archFilter)
729
+ ).toLowerCase()}`;
730
+ }
731
+ function agentListFooterLabel(args) {
732
+ const { count, archFilter, archivedHiddenCount } = args;
733
+ if (archFilter === "archived") return `${count} archived shown`;
734
+ const base = `${count} agent${count !== 1 ? "s" : ""}`;
735
+ if (archFilter === "both") return `${base} \xB7 archived shown`;
736
+ return archivedHiddenCount > 0 ? `${base} \xB7 ${archivedHiddenCount} archived hidden` : base;
737
+ }
738
+
744
739
  // catalog/shared/useAgentListCore.ts
745
740
  var HOVER_GRACE_MS = 900;
746
741
  function coerceVisibleTab(current, allowed, initialTab) {
@@ -978,7 +973,7 @@ var selectStatus = (state) => state.status;
978
973
 
979
974
  // catalog/react/AgentListDropdown.tsx
980
975
  import {
981
- cn as cn5,
976
+ cn as cn6,
982
977
  Drawer,
983
978
  DrawerContent,
984
979
  DrawerTitle,
@@ -991,11 +986,11 @@ import {
991
986
  TooltipTrigger,
992
987
  useIsMobile as useIsMobile2
993
988
  } from "@ai-matrx/design-system";
994
- import { useMemo as useMemo5, useRef as useRef5, useState as useState4 } from "react";
989
+ import { useMemo as useMemo5, useRef as useRef5, useState as useState5 } from "react";
995
990
 
996
991
  // catalog/react/AgentListPanel.tsx
997
- import { cn as cn4, useIsMobile } from "@ai-matrx/design-system";
998
- import { useCallback as useCallback5, useEffect as useEffect5, useMemo as useMemo4, useRef as useRef4, useState as useState3 } from "react";
992
+ import { cn as cn5, useIsMobile } from "@ai-matrx/design-system";
993
+ import { useCallback as useCallback5, useEffect as useEffect5, useMemo as useMemo4, useRef as useRef4, useState as useState4 } from "react";
999
994
 
1000
995
  // catalog/react/primitives.tsx
1001
996
  import { cn } from "@ai-matrx/design-system";
@@ -1005,7 +1000,9 @@ var SearchInput = ({
1005
1000
  ref,
1006
1001
  value,
1007
1002
  onChange,
1008
- placeholder
1003
+ placeholder,
1004
+ onKeyDown,
1005
+ inputProps
1009
1006
  }) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 h-7 px-2 rounded-md bg-muted/40 border border-border/50", children: [
1010
1007
  /* @__PURE__ */ jsx3(SearchIcon, { className: "w-3 h-3 text-muted-foreground shrink-0" }),
1011
1008
  /* @__PURE__ */ jsx3(
@@ -1015,6 +1012,8 @@ var SearchInput = ({
1015
1012
  type: "text",
1016
1013
  value,
1017
1014
  onChange: (e) => onChange(e.target.value),
1015
+ onKeyDown,
1016
+ ...inputProps,
1018
1017
  placeholder,
1019
1018
  className: "flex-1 bg-transparent text-xs text-foreground placeholder:text-muted-foreground/50 outline-none min-w-0",
1020
1019
  style: { fontSize: "16px" }
@@ -1286,7 +1285,7 @@ var ICON_PATHS = SHAPES;
1286
1285
  var ICON_NAMES = Object.keys(ICON_PATHS);
1287
1286
 
1288
1287
  // catalog/react/icons.tsx
1289
- import { FolderIcon, RotateCcwIcon, TagIcon } from "@ai-matrx/design-system/icons";
1288
+ import { ArrowUpDownIcon, FolderIcon, MessageCircleIcon, RocketIcon, RotateCcwIcon, TagIcon } from "@ai-matrx/design-system/icons";
1290
1289
  import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
1291
1290
  function Svg({ children, ...props }) {
1292
1291
  return /* @__PURE__ */ jsx5(
@@ -1333,11 +1332,8 @@ function makeIcon(name) {
1333
1332
  return /* @__PURE__ */ jsx5(Svg, { ...props, children: /* @__PURE__ */ jsx5(Shape, { name, filled: false }) });
1334
1333
  };
1335
1334
  }
1336
- var ArrowUpDownIcon = makeIcon("arrowUpDown");
1337
1335
  var LoaderIcon = makeIcon("loader");
1338
1336
  var UsersIcon = makeIcon("users");
1339
- var MessageCircleIcon = makeIcon("messageCircle");
1340
- var RocketIcon = makeIcon("rocket");
1341
1337
  var CircleCheckIcon = makeIcon("circleCheck");
1342
1338
  var AlertTriangleIcon = makeIcon("alertTriangle");
1343
1339
  var Music4Icon = makeIcon("music4");
@@ -1472,8 +1468,9 @@ function AgentDetailCard({ agent, onSelect, duplicate, onHoldChange }) {
1472
1468
  }
1473
1469
 
1474
1470
  // catalog/react/AgentListContent.tsx
1475
- import { ErrorBox } from "@ai-matrx/design-system";
1476
- import { useEffect as useEffect4, useRef as useRef3 } from "react";
1471
+ import { cn as cn4, ErrorBox } from "@ai-matrx/design-system";
1472
+ import { computeWindow } from "@ai-matrx/design-system/data-table/virtual-window";
1473
+ import { useEffect as useEffect4, useId, useLayoutEffect, useRef as useRef3, useState as useState3 } from "react";
1477
1474
 
1478
1475
  // catalog/react/AgentFilterBar.tsx
1479
1476
  import { ArchiveIcon, StarIcon } from "@ai-matrx/design-system/icons";
@@ -1743,6 +1740,10 @@ function AgentRow({
1743
1740
  // catalog/react/AgentListContent.tsx
1744
1741
  import { XIcon as XIcon2 } from "@ai-matrx/design-system/icons";
1745
1742
  import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
1743
+ var AGENT_ROW_HEIGHT = 36;
1744
+ var UNMEASURED_VIEWPORT = 480;
1745
+ var ROW_OVERSCAN = 8;
1746
+ var WINDOW_ABOVE = 50;
1746
1747
  function AgentListContent({
1747
1748
  agents,
1748
1749
  isLoading,
@@ -1774,11 +1775,104 @@ function AgentListContent({
1774
1775
  }) {
1775
1776
  const catalog = useAgentCatalog();
1776
1777
  const listScrollRef = useRef3(null);
1778
+ const windowRef = useRef3(null);
1779
+ const listboxId = useId();
1780
+ const [scrollTop, setScrollTop] = useState3(0);
1781
+ const [viewport, setViewport] = useState3(0);
1782
+ const [listStart, setListStart] = useState3(0);
1783
+ const [activeIndex, setActiveIndex] = useState3(-1);
1784
+ const [resetKey, setResetKey] = useState3(
1785
+ `${consumer.tab}\0${consumer.searchTerm}`
1786
+ );
1787
+ const nextResetKey = `${consumer.tab}\0${consumer.searchTerm}`;
1788
+ if (nextResetKey !== resetKey) {
1789
+ setResetKey(nextResetKey);
1790
+ setActiveIndex(-1);
1791
+ }
1792
+ const defaultAgentId = defaultRow?.row?.id ?? null;
1793
+ useLayoutEffect(() => {
1794
+ const scroller = listScrollRef.current;
1795
+ if (!scroller) return void 0;
1796
+ const measure = () => {
1797
+ setViewport(scroller.clientHeight);
1798
+ setListStart(windowRef.current?.offsetTop ?? 0);
1799
+ };
1800
+ measure();
1801
+ if (typeof ResizeObserver === "undefined") return void 0;
1802
+ const observer = new ResizeObserver(measure);
1803
+ observer.observe(scroller);
1804
+ return () => observer.disconnect();
1805
+ }, [isLoading, pinnedAgent?.id, defaultAgentId, agents.length === 0]);
1777
1806
  useEffect4(() => {
1778
- if (listOpen && pinnedAgent) {
1779
- listScrollRef.current?.scrollTo({ top: 0 });
1807
+ const scroller = listScrollRef.current;
1808
+ if (!listOpen || !scroller) return;
1809
+ if (pinnedAgent) {
1810
+ scroller.scrollTo({ top: 0 });
1811
+ return;
1812
+ }
1813
+ const index = activeAgentId ? agents.findIndex((a) => a.id === activeAgentId) : -1;
1814
+ if (index < 0) return;
1815
+ const view = scroller.clientHeight || UNMEASURED_VIEWPORT;
1816
+ const top = Math.max(
1817
+ 0,
1818
+ (windowRef.current?.offsetTop ?? 0) + index * AGENT_ROW_HEIGHT - (view - AGENT_ROW_HEIGHT) / 2
1819
+ );
1820
+ scroller.scrollTo({ top });
1821
+ setScrollTop(top);
1822
+ }, [listOpen, pinnedAgent?.id, activeAgentId, isLoading]);
1823
+ const win = agents.length <= WINDOW_ABOVE ? { start: 0, end: agents.length, padStart: 0, padEnd: 0 } : computeWindow({
1824
+ count: agents.length,
1825
+ itemSize: AGENT_ROW_HEIGHT,
1826
+ viewport: viewport > 0 ? viewport : UNMEASURED_VIEWPORT,
1827
+ offset: Math.max(0, scrollTop - listStart),
1828
+ overscan: ROW_OVERSCAN
1829
+ });
1830
+ const visibleAgents = agents.slice(win.start, win.end);
1831
+ const optionId = (index) => `${listboxId}-option-${index}`;
1832
+ const revealIndex = (index) => {
1833
+ const scroller = listScrollRef.current;
1834
+ if (!scroller) return;
1835
+ const view = scroller.clientHeight || UNMEASURED_VIEWPORT;
1836
+ const top = listStart + index * AGENT_ROW_HEIGHT;
1837
+ const bottom = top + AGENT_ROW_HEIGHT;
1838
+ let next = null;
1839
+ if (top < scroller.scrollTop) next = top;
1840
+ else if (bottom > scroller.scrollTop + view) next = bottom - view;
1841
+ if (next === null) return;
1842
+ scroller.scrollTop = next;
1843
+ setScrollTop(next);
1844
+ };
1845
+ const handleListKeyDown = (event) => {
1846
+ if (agents.length === 0) return;
1847
+ const last = agents.length - 1;
1848
+ let next = null;
1849
+ switch (event.key) {
1850
+ case "ArrowDown":
1851
+ next = activeIndex < 0 ? 0 : Math.min(last, activeIndex + 1);
1852
+ break;
1853
+ case "ArrowUp":
1854
+ next = activeIndex <= 0 ? 0 : activeIndex - 1;
1855
+ break;
1856
+ case "PageDown":
1857
+ next = Math.min(last, Math.max(0, activeIndex) + 10);
1858
+ break;
1859
+ case "PageUp":
1860
+ next = Math.max(0, activeIndex - 10);
1861
+ break;
1862
+ case "Enter": {
1863
+ const agent = activeIndex >= 0 ? agents[activeIndex] : void 0;
1864
+ if (!agent) return;
1865
+ event.preventDefault();
1866
+ onSelectAgent(agent);
1867
+ return;
1868
+ }
1869
+ default:
1870
+ return;
1780
1871
  }
1781
- }, [listOpen, pinnedAgent?.id]);
1872
+ event.preventDefault();
1873
+ setActiveIndex(next);
1874
+ revealIndex(next);
1875
+ };
1782
1876
  const { labels } = catalog;
1783
1877
  const emptyLabel = catalog.getUserIdOrNull() === null ? labels.emptySignedOut : agentListEmptyLabel(consumer.tab, labels);
1784
1878
  const defaultAgent = defaultRow?.row ?? null;
@@ -1789,7 +1883,15 @@ function AgentListContent({
1789
1883
  ref: inputRef,
1790
1884
  value: consumer.searchTerm,
1791
1885
  onChange: consumer.setSearchTerm,
1792
- placeholder: labels.searchPlaceholder
1886
+ placeholder: labels.searchPlaceholder,
1887
+ onKeyDown: handleListKeyDown,
1888
+ inputProps: {
1889
+ role: "combobox",
1890
+ "aria-controls": listboxId,
1891
+ "aria-expanded": true,
1892
+ "aria-autocomplete": "list",
1893
+ ...activeIndex >= 0 && activeIndex < agents.length ? { "aria-activedescendant": optionId(activeIndex) } : {}
1894
+ }
1793
1895
  }
1794
1896
  ) }),
1795
1897
  /* @__PURE__ */ jsx10(
@@ -1878,65 +1980,106 @@ function AgentListContent({
1878
1980
  }
1879
1981
  ),
1880
1982
  /* @__PURE__ */ jsx10("div", { className: "h-px bg-border shrink-0" }),
1881
- /* @__PURE__ */ jsx10("div", { ref: listScrollRef, className: "overflow-y-auto flex-1 min-h-0", children: isLoading ? /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-center py-8 gap-2 text-muted-foreground", children: [
1882
- /* @__PURE__ */ jsx10(LoaderIcon, { className: "w-4 h-4 matrx-agent-spin" }),
1883
- /* @__PURE__ */ jsx10("span", { className: "text-xs", children: labels.loading })
1884
- ] }) : agents.length === 0 && !pinnedAgent && !defaultAgent ? /* @__PURE__ */ jsx10("div", { className: "flex flex-col items-center py-8 text-muted-foreground", children: /* @__PURE__ */ jsx10("span", { className: "text-xs", children: emptyLabel }) }) : /* @__PURE__ */ jsxs7("div", { className: "py-0.5", children: [
1885
- defaultAgent && /* @__PURE__ */ jsxs7(Fragment2, { children: [
1886
- /* @__PURE__ */ jsx10("div", { className: "px-3 pt-1.5 pb-0.5", children: /* @__PURE__ */ jsx10("span", { className: "text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: "Default" }) }),
1887
- /* @__PURE__ */ jsx10(
1888
- AgentRow,
1889
- {
1890
- agent: defaultAgent,
1891
- isActive: defaultAgent.id === activeAgentId,
1892
- isHovered: hoveredAgent?.id === defaultAgent.id,
1893
- isMobile,
1894
- onClick: () => onSelectAgent(defaultAgent),
1895
- href: resolveAgentHref?.(defaultAgent),
1896
- onHover: () => onAgentHover(defaultAgent),
1897
- onHoverEnd: () => onAgentHoverEnd(defaultAgent),
1898
- onDetailPress: () => onDetailPress(defaultAgent)
1899
- },
1900
- `default-${defaultAgent.id}`
1901
- ),
1902
- /* @__PURE__ */ jsx10("div", { className: "mx-2 my-0.5 h-px bg-border" })
1903
- ] }),
1904
- pinnedAgent && /* @__PURE__ */ jsxs7(Fragment2, { children: [
1905
- /* @__PURE__ */ jsx10("div", { className: "px-3 pt-1.5 pb-0.5", children: /* @__PURE__ */ jsx10("span", { className: "text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: labels.currentAgentHeading }) }),
1906
- /* @__PURE__ */ jsx10(
1907
- AgentRow,
1908
- {
1909
- agent: pinnedAgent,
1910
- isActive: true,
1911
- isHovered: hoveredAgent?.id === pinnedAgent.id,
1912
- isMobile,
1913
- onClick: () => onSelectAgent(pinnedAgent),
1914
- href: resolveAgentHref?.(pinnedAgent),
1915
- onHover: () => onAgentHover(pinnedAgent),
1916
- onHoverEnd: () => onAgentHoverEnd(pinnedAgent),
1917
- onDetailPress: () => onDetailPress(pinnedAgent)
1918
- },
1919
- `pinned-${pinnedAgent.id}`
1920
- ),
1921
- /* @__PURE__ */ jsx10("div", { className: "mx-2 my-0.5 h-px bg-border" })
1922
- ] }),
1923
- agents.map((agent) => /* @__PURE__ */ jsx10(
1924
- AgentRow,
1925
- {
1926
- agent,
1927
- isActive: agent.id === activeAgentId,
1928
- isHovered: hoveredAgent?.id === agent.id,
1929
- isMobile,
1930
- onClick: () => onSelectAgent(agent),
1931
- href: resolveAgentHref?.(agent),
1932
- onHover: () => onAgentHover(agent),
1933
- onHoverEnd: () => onAgentHoverEnd(agent),
1934
- onDetailPress: () => onDetailPress(agent)
1935
- },
1936
- agent.id
1937
- )),
1938
- agents.length === 0 && (pinnedAgent || defaultAgent) && /* @__PURE__ */ jsx10("div", { className: "flex flex-col items-center py-4 text-muted-foreground", children: /* @__PURE__ */ jsx10("span", { className: "text-xs", children: emptyLabel }) })
1939
- ] }) }),
1983
+ /* @__PURE__ */ jsx10(
1984
+ "div",
1985
+ {
1986
+ ref: listScrollRef,
1987
+ "data-agent-list-scroll": "",
1988
+ onScroll: (e) => setScrollTop(e.currentTarget.scrollTop),
1989
+ className: "relative overflow-y-auto flex-1 min-h-0",
1990
+ children: isLoading ? /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-center py-8 gap-2 text-muted-foreground", children: [
1991
+ /* @__PURE__ */ jsx10(LoaderIcon, { className: "w-4 h-4 matrx-agent-spin" }),
1992
+ /* @__PURE__ */ jsx10("span", { className: "text-xs", children: labels.loading })
1993
+ ] }) : agents.length === 0 && !pinnedAgent && !defaultAgent ? /* @__PURE__ */ jsx10("div", { className: "flex flex-col items-center py-8 text-muted-foreground", children: /* @__PURE__ */ jsx10("span", { className: "text-xs", children: emptyLabel }) }) : /* @__PURE__ */ jsxs7("div", { className: "py-0.5", children: [
1994
+ defaultAgent && /* @__PURE__ */ jsxs7(Fragment2, { children: [
1995
+ /* @__PURE__ */ jsx10("div", { className: "px-3 pt-1.5 pb-0.5", children: /* @__PURE__ */ jsx10("span", { className: "text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: "Default" }) }),
1996
+ /* @__PURE__ */ jsx10(
1997
+ AgentRow,
1998
+ {
1999
+ agent: defaultAgent,
2000
+ isActive: defaultAgent.id === activeAgentId,
2001
+ isHovered: hoveredAgent?.id === defaultAgent.id,
2002
+ isMobile,
2003
+ onClick: () => onSelectAgent(defaultAgent),
2004
+ href: resolveAgentHref?.(defaultAgent),
2005
+ onHover: () => onAgentHover(defaultAgent),
2006
+ onHoverEnd: () => onAgentHoverEnd(defaultAgent),
2007
+ onDetailPress: () => onDetailPress(defaultAgent)
2008
+ },
2009
+ `default-${defaultAgent.id}`
2010
+ ),
2011
+ /* @__PURE__ */ jsx10("div", { className: "mx-2 my-0.5 h-px bg-border" })
2012
+ ] }),
2013
+ pinnedAgent && /* @__PURE__ */ jsxs7(Fragment2, { children: [
2014
+ /* @__PURE__ */ jsx10("div", { className: "px-3 pt-1.5 pb-0.5", children: /* @__PURE__ */ jsx10("span", { className: "text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: labels.currentAgentHeading }) }),
2015
+ /* @__PURE__ */ jsx10(
2016
+ AgentRow,
2017
+ {
2018
+ agent: pinnedAgent,
2019
+ isActive: true,
2020
+ isHovered: hoveredAgent?.id === pinnedAgent.id,
2021
+ isMobile,
2022
+ onClick: () => onSelectAgent(pinnedAgent),
2023
+ href: resolveAgentHref?.(pinnedAgent),
2024
+ onHover: () => onAgentHover(pinnedAgent),
2025
+ onHoverEnd: () => onAgentHoverEnd(pinnedAgent),
2026
+ onDetailPress: () => onDetailPress(pinnedAgent)
2027
+ },
2028
+ `pinned-${pinnedAgent.id}`
2029
+ ),
2030
+ /* @__PURE__ */ jsx10("div", { className: "mx-2 my-0.5 h-px bg-border" })
2031
+ ] }),
2032
+ /* @__PURE__ */ jsxs7(
2033
+ "div",
2034
+ {
2035
+ ref: windowRef,
2036
+ id: listboxId,
2037
+ role: "listbox",
2038
+ "aria-label": labels.searchPlaceholder,
2039
+ children: [
2040
+ win.padStart > 0 && /* @__PURE__ */ jsx10("div", { "aria-hidden": true, style: { height: win.padStart } }),
2041
+ visibleAgents.map((agent, offset) => {
2042
+ const index = win.start + offset;
2043
+ return /* @__PURE__ */ jsx10(
2044
+ "div",
2045
+ {
2046
+ id: optionId(index),
2047
+ role: "option",
2048
+ "aria-selected": agent.id === activeAgentId,
2049
+ "aria-posinset": index + 1,
2050
+ "aria-setsize": agents.length,
2051
+ "data-agent-index": index,
2052
+ style: { height: AGENT_ROW_HEIGHT },
2053
+ className: cn4(
2054
+ "flex overflow-hidden",
2055
+ index === activeIndex && "bg-muted/60"
2056
+ ),
2057
+ children: /* @__PURE__ */ jsx10(
2058
+ AgentRow,
2059
+ {
2060
+ agent,
2061
+ isActive: agent.id === activeAgentId,
2062
+ isHovered: hoveredAgent?.id === agent.id,
2063
+ isMobile,
2064
+ onClick: () => onSelectAgent(agent),
2065
+ href: resolveAgentHref?.(agent),
2066
+ onHover: () => onAgentHover(agent),
2067
+ onHoverEnd: () => onAgentHoverEnd(agent),
2068
+ onDetailPress: () => onDetailPress(agent)
2069
+ }
2070
+ )
2071
+ },
2072
+ agent.id
2073
+ );
2074
+ }),
2075
+ win.padEnd > 0 && /* @__PURE__ */ jsx10("div", { "aria-hidden": true, style: { height: win.padEnd } })
2076
+ ]
2077
+ }
2078
+ ),
2079
+ agents.length === 0 && (pinnedAgent || defaultAgent) && /* @__PURE__ */ jsx10("div", { className: "flex flex-col items-center py-4 text-muted-foreground", children: /* @__PURE__ */ jsx10("span", { className: "text-xs", children: emptyLabel }) })
2080
+ ] })
2081
+ }
2082
+ ),
1940
2083
  /* @__PURE__ */ jsx10("div", { className: "h-px bg-border shrink-0" }),
1941
2084
  /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between px-2.5 py-1.5 shrink-0", children: [
1942
2085
  /* @__PURE__ */ jsx10(
@@ -2156,11 +2299,11 @@ function AgentListPanelBody({
2156
2299
  }) {
2157
2300
  const isMobile = useIsMobile();
2158
2301
  const { labels } = useAgentCatalog();
2159
- const [rightPanel, setRightPanel] = useState3(null);
2160
- const [catSearch, setCatSearch] = useState3("");
2161
- const [tagSearch, setTagSearch] = useState3("");
2162
- const [mobileDetailAgent, setMobileDetailAgent] = useState3(null);
2163
- const [mobileSubView, setMobileSubView] = useState3(null);
2302
+ const [rightPanel, setRightPanel] = useState4(null);
2303
+ const [catSearch, setCatSearch] = useState4("");
2304
+ const [tagSearch, setTagSearch] = useState4("");
2305
+ const [mobileDetailAgent, setMobileDetailAgent] = useState4(null);
2306
+ const [mobileSubView, setMobileSubView] = useState4(null);
2164
2307
  const inputRef = useRef4(null);
2165
2308
  const {
2166
2309
  agents,
@@ -2282,7 +2425,7 @@ function AgentListPanelBody({
2282
2425
  }
2283
2426
  );
2284
2427
  if (isMobile) {
2285
- return /* @__PURE__ */ jsx14("div", { className: cn4("flex min-h-0 flex-1 flex-col overflow-hidden", className), children: mobileDetailAgent ? /* @__PURE__ */ jsxs11("div", { className: "flex flex-col overflow-hidden", children: [
2428
+ return /* @__PURE__ */ jsx14("div", { className: cn5("flex min-h-0 flex-1 flex-col overflow-hidden", className), children: mobileDetailAgent ? /* @__PURE__ */ jsxs11("div", { className: "flex flex-col overflow-hidden", children: [
2286
2429
  /* @__PURE__ */ jsxs11(
2287
2430
  "button",
2288
2431
  {
@@ -2321,7 +2464,7 @@ function AgentListPanelBody({
2321
2464
  }
2322
2465
  ) : listPanel });
2323
2466
  }
2324
- return /* @__PURE__ */ jsxs11("div", { className: cn4("flex h-full", className), children: [
2467
+ return /* @__PURE__ */ jsxs11("div", { className: cn5("flex h-full", className), children: [
2325
2468
  /* @__PURE__ */ jsx14("div", { className: "flex flex-col min-w-[340px] flex-1 border-r border-border", children: listPanel }),
2326
2469
  /* @__PURE__ */ jsxs11(
2327
2470
  "div",
@@ -2422,7 +2565,7 @@ function AgentListPanel({
2422
2565
  return /* @__PURE__ */ jsx14(
2423
2566
  "div",
2424
2567
  {
2425
- className: cn4("flex min-h-0 flex-col overflow-hidden", (isMobile || fill) && "h-full w-full", className),
2568
+ className: cn5("flex min-h-0 flex-col overflow-hidden", (isMobile || fill) && "h-full w-full", className),
2426
2569
  style: isMobile || fill ? void 0 : { width: PANEL_WIDTH, height: PANEL_HEIGHT },
2427
2570
  children: /* @__PURE__ */ jsx14(
2428
2571
  AgentListPanelBody,
@@ -2468,10 +2611,10 @@ function AgentListDropdown({
2468
2611
  const isMobile = useIsMobile2();
2469
2612
  const { labels } = useAgentCatalog();
2470
2613
  const { popoverContainer } = useAgentCatalogUiPorts();
2471
- const [open, setOpen] = useState4(false);
2614
+ const [open, setOpen] = useState5(false);
2472
2615
  const triggerRef = useRef5(null);
2473
- const [fitHeight, setFitHeight] = useState4(null);
2474
- const [openSide, setOpenSide] = useState4(contentSide);
2616
+ const [fitHeight, setFitHeight] = useState5(null);
2617
+ const [openSide, setOpenSide] = useState5(contentSide);
2475
2618
  const core = useAgentListCore({
2476
2619
  consumerId,
2477
2620
  ...onSelect ? { onSelect } : {},
@@ -2512,7 +2655,7 @@ function AgentListDropdown({
2512
2655
  "button",
2513
2656
  {
2514
2657
  type: "button",
2515
- className: cn5(
2658
+ className: cn6(
2516
2659
  "inline-flex items-center rounded-md text-xs font-medium transition-colors",
2517
2660
  "bg-background hover:bg-muted/50 text-foreground/80 hover:text-foreground",
2518
2661
  compact ? "h-5 gap-1 px-1.5" : "h-7 gap-1.5 px-2.5",
@@ -2576,8 +2719,8 @@ function AgentListDropdown({
2576
2719
  }
2577
2720
 
2578
2721
  // catalog/react/AgentListInlinePicker.tsx
2579
- import { cn as cn6 } from "@ai-matrx/design-system";
2580
- import { useEffect as useEffect6, useRef as useRef6, useState as useState5 } from "react";
2722
+ import { cn as cn7 } from "@ai-matrx/design-system";
2723
+ import { useEffect as useEffect6, useRef as useRef6, useState as useState6 } from "react";
2581
2724
  import { ChevronRightIcon as ChevronRightIcon4 } from "@ai-matrx/design-system/icons";
2582
2725
  import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
2583
2726
  function AgentListInlinePicker({
@@ -2598,10 +2741,10 @@ function AgentListInlinePicker({
2598
2741
  includeQuickAgents
2599
2742
  }) {
2600
2743
  const inputRef = useRef6(null);
2601
- const [catSearch, setCatSearch] = useState5("");
2602
- const [tagSearch, setTagSearch] = useState5("");
2603
- const [mobileDetailAgent, setMobileDetailAgent] = useState5(null);
2604
- const [mobileSubView, setMobileSubView] = useState5(null);
2744
+ const [catSearch, setCatSearch] = useState6("");
2745
+ const [tagSearch, setTagSearch] = useState6("");
2746
+ const [mobileDetailAgent, setMobileDetailAgent] = useState6(null);
2747
+ const [mobileSubView, setMobileSubView] = useState6(null);
2605
2748
  const {
2606
2749
  agents,
2607
2750
  archivedHiddenCount,
@@ -2650,7 +2793,7 @@ function AgentListInlinePicker({
2650
2793
  };
2651
2794
  const isMobile = true;
2652
2795
  if (mobileDetailAgent) {
2653
- return /* @__PURE__ */ jsxs13("div", { className: cn6("flex h-full min-h-0 flex-col", className), children: [
2796
+ return /* @__PURE__ */ jsxs13("div", { className: cn7("flex h-full min-h-0 flex-col", className), children: [
2654
2797
  /* @__PURE__ */ jsxs13(
2655
2798
  "button",
2656
2799
  {
@@ -2673,7 +2816,7 @@ function AgentListInlinePicker({
2673
2816
  ] });
2674
2817
  }
2675
2818
  if (mobileSubView) {
2676
- return /* @__PURE__ */ jsx16("div", { className: cn6("flex h-full min-h-0 flex-col", className), children: /* @__PURE__ */ jsx16(
2819
+ return /* @__PURE__ */ jsx16("div", { className: cn7("flex h-full min-h-0 flex-col", className), children: /* @__PURE__ */ jsx16(
2677
2820
  AgentMobileSubView,
2678
2821
  {
2679
2822
  view: mobileSubView,
@@ -2692,7 +2835,7 @@ function AgentListInlinePicker({
2692
2835
  }
2693
2836
  ) });
2694
2837
  }
2695
- return /* @__PURE__ */ jsx16("div", { className: cn6("flex h-full min-h-0 flex-col", className), children: /* @__PURE__ */ jsx16(
2838
+ return /* @__PURE__ */ jsx16("div", { className: cn7("flex h-full min-h-0 flex-col", className), children: /* @__PURE__ */ jsx16(
2696
2839
  AgentListContent,
2697
2840
  {
2698
2841
  agents,
@@ -2730,7 +2873,7 @@ function AgentListInlinePicker({
2730
2873
  }
2731
2874
 
2732
2875
  // catalog/react/FavoriteAgentButton.tsx
2733
- import { cn as cn7 } from "@ai-matrx/design-system";
2876
+ import { cn as cn8 } from "@ai-matrx/design-system";
2734
2877
  import { useCallback as useCallback6 } from "react";
2735
2878
  import { StarIcon as StarIcon3 } from "@ai-matrx/design-system/icons";
2736
2879
  import { jsx as jsx17 } from "react/jsx-runtime";
@@ -2758,7 +2901,7 @@ function FavoriteAgentButton({
2758
2901
  "button",
2759
2902
  {
2760
2903
  type: "button",
2761
- className: cn7(
2904
+ className: cn8(
2762
2905
  "flex-shrink-0 p-0.5 rounded transition-all duration-150",
2763
2906
  "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",
2764
2907
  disabled ? "cursor-not-allowed" : "hover:scale-110 cursor-pointer"
@@ -2771,7 +2914,7 @@ function FavoriteAgentButton({
2771
2914
  StarIcon3,
2772
2915
  {
2773
2916
  fill: isFavorite2 ? "currentColor" : "none",
2774
- className: cn7(
2917
+ className: cn8(
2775
2918
  "h-3.5 w-3.5 transition-all duration-150",
2776
2919
  isFavorite2 ? "matrx-agent-star-on" : "text-muted-foreground/40 hover:matrx-agent-star-on"
2777
2920
  )
@@ -2784,7 +2927,7 @@ function FavoriteAgentButton({
2784
2927
  "button",
2785
2928
  {
2786
2929
  type: "button",
2787
- className: cn7(
2930
+ className: cn8(
2788
2931
  "absolute top-2.5 right-2.5 z-10 p-0.5 rounded transition-all duration-150",
2789
2932
  "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",
2790
2933
  disabled ? "cursor-not-allowed" : "hover:scale-110 cursor-pointer",