@ai-matrx/agents 0.21.39 → 0.21.41

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.
@@ -897,6 +897,22 @@ declare function panelHeightBelow(trigger: Element | null, options?: {
897
897
  minUsable?: number;
898
898
  gap?: number;
899
899
  }): string | null;
900
+ /**
901
+ * 🚨 A SIDE-OPENING PANEL NEVER LEAVES THE SCREEN.
902
+ *
903
+ * A host may ask for `side="left"` / `"right"` (the chat composer's presets
904
+ * panel opens "All agents" to its left). Radix shifts a side-placed popover
905
+ * only VERTICALLY, so when the 680px panel does not fit on that side it runs
906
+ * off the screen edge and the search box, tabs and names are cut off (blind run
907
+ * PB-03, /chat/new in an 800px pane, 2026-10-01). Measured at open time: keep
908
+ * the asked side when the panel fits there, else the opposite side when it
909
+ * fits, else open below, where Radix can shift it horizontally into view.
910
+ * Vertical sides pass through unchanged.
911
+ */
912
+ declare function sideThatFits(trigger: Element | null, side: "top" | "right" | "bottom" | "left", options?: {
913
+ width?: number;
914
+ gap?: number;
915
+ }): "top" | "right" | "bottom" | "left";
900
916
 
901
917
  interface AgentListContentProps {
902
918
  agents: AgentSummary[];
@@ -1104,4 +1120,4 @@ declare function orchestraDepthLine(badge: OrchestraBadge): string | null;
1104
1120
  */
1105
1121
  declare function orchestraDelegatesLine(badge: OrchestraBadge, limit?: number): string | null;
1106
1122
 
1107
- export { type AgentCatalogLinkComponent, AgentCatalogProvider, type AgentCatalogProviderProps, type AgentCatalogRenderModelRef, type AgentCatalogUiPorts, AgentCategoriesPanel, type AgentCategoriesPanelProps, AgentDetailCard, type AgentDetailCardProps, AgentFilterBar, type AgentFilterBarProps, AgentListContent, type AgentListContentProps, type AgentListCoreOptions, AgentListDropdown, type AgentListDropdownProps, AgentListInlinePicker, type AgentListInlinePickerProps, AgentListPanel, AgentListPanelBody, type AgentListPanelBodyProps, type AgentListPanelProps, type AgentListTabCounts, AgentListTabs, AgentMobileSubView, type AgentMobileSubViewProps, AgentRow, type AgentRowProps, AgentSortPanel, type AgentSortPanelProps, AgentTagsPanel, type AgentTagsPanelProps, CheckRow, FavoriteAgentButton, FilterChip, HOVER_GRACE_MS, type IconProps, LIST_MAX_HEIGHT, Music4Icon, OptionRow, type OrchestraBadge, PANEL_HEIGHT, PANEL_WIDTH, type RightPanel, SORT_OPTIONS, SearchInput, SidePanelHeader, type UseAgentConsumerReturn, coerceVisibleTab, orchestraDelegatesLine, orchestraDepthLine, orchestraLabel, orchestraModeLabel, panelHeightBelow, useAgentCatalog, useAgentCatalogRows, useAgentCatalogState, useAgentCatalogUiPorts, useAgentConsumer, useAgentListCore };
1123
+ export { type AgentCatalogLinkComponent, AgentCatalogProvider, type AgentCatalogProviderProps, type AgentCatalogRenderModelRef, type AgentCatalogUiPorts, AgentCategoriesPanel, type AgentCategoriesPanelProps, AgentDetailCard, type AgentDetailCardProps, AgentFilterBar, type AgentFilterBarProps, AgentListContent, type AgentListContentProps, type AgentListCoreOptions, AgentListDropdown, type AgentListDropdownProps, AgentListInlinePicker, type AgentListInlinePickerProps, AgentListPanel, AgentListPanelBody, type AgentListPanelBodyProps, type AgentListPanelProps, type AgentListTabCounts, AgentListTabs, AgentMobileSubView, type AgentMobileSubViewProps, AgentRow, type AgentRowProps, AgentSortPanel, type AgentSortPanelProps, AgentTagsPanel, type AgentTagsPanelProps, CheckRow, FavoriteAgentButton, FilterChip, HOVER_GRACE_MS, type IconProps, LIST_MAX_HEIGHT, Music4Icon, OptionRow, type OrchestraBadge, PANEL_HEIGHT, PANEL_WIDTH, type RightPanel, SORT_OPTIONS, SearchInput, SidePanelHeader, type UseAgentConsumerReturn, coerceVisibleTab, orchestraDelegatesLine, orchestraDepthLine, orchestraLabel, orchestraModeLabel, panelHeightBelow, sideThatFits, useAgentCatalog, useAgentCatalogRows, useAgentCatalogState, useAgentCatalogUiPorts, useAgentConsumer, useAgentListCore };
@@ -897,6 +897,22 @@ declare function panelHeightBelow(trigger: Element | null, options?: {
897
897
  minUsable?: number;
898
898
  gap?: number;
899
899
  }): string | null;
900
+ /**
901
+ * 🚨 A SIDE-OPENING PANEL NEVER LEAVES THE SCREEN.
902
+ *
903
+ * A host may ask for `side="left"` / `"right"` (the chat composer's presets
904
+ * panel opens "All agents" to its left). Radix shifts a side-placed popover
905
+ * only VERTICALLY, so when the 680px panel does not fit on that side it runs
906
+ * off the screen edge and the search box, tabs and names are cut off (blind run
907
+ * PB-03, /chat/new in an 800px pane, 2026-10-01). Measured at open time: keep
908
+ * the asked side when the panel fits there, else the opposite side when it
909
+ * fits, else open below, where Radix can shift it horizontally into view.
910
+ * Vertical sides pass through unchanged.
911
+ */
912
+ declare function sideThatFits(trigger: Element | null, side: "top" | "right" | "bottom" | "left", options?: {
913
+ width?: number;
914
+ gap?: number;
915
+ }): "top" | "right" | "bottom" | "left";
900
916
 
901
917
  interface AgentListContentProps {
902
918
  agents: AgentSummary[];
@@ -1104,4 +1120,4 @@ declare function orchestraDepthLine(badge: OrchestraBadge): string | null;
1104
1120
  */
1105
1121
  declare function orchestraDelegatesLine(badge: OrchestraBadge, limit?: number): string | null;
1106
1122
 
1107
- export { type AgentCatalogLinkComponent, AgentCatalogProvider, type AgentCatalogProviderProps, type AgentCatalogRenderModelRef, type AgentCatalogUiPorts, AgentCategoriesPanel, type AgentCategoriesPanelProps, AgentDetailCard, type AgentDetailCardProps, AgentFilterBar, type AgentFilterBarProps, AgentListContent, type AgentListContentProps, type AgentListCoreOptions, AgentListDropdown, type AgentListDropdownProps, AgentListInlinePicker, type AgentListInlinePickerProps, AgentListPanel, AgentListPanelBody, type AgentListPanelBodyProps, type AgentListPanelProps, type AgentListTabCounts, AgentListTabs, AgentMobileSubView, type AgentMobileSubViewProps, AgentRow, type AgentRowProps, AgentSortPanel, type AgentSortPanelProps, AgentTagsPanel, type AgentTagsPanelProps, CheckRow, FavoriteAgentButton, FilterChip, HOVER_GRACE_MS, type IconProps, LIST_MAX_HEIGHT, Music4Icon, OptionRow, type OrchestraBadge, PANEL_HEIGHT, PANEL_WIDTH, type RightPanel, SORT_OPTIONS, SearchInput, SidePanelHeader, type UseAgentConsumerReturn, coerceVisibleTab, orchestraDelegatesLine, orchestraDepthLine, orchestraLabel, orchestraModeLabel, panelHeightBelow, useAgentCatalog, useAgentCatalogRows, useAgentCatalogState, useAgentCatalogUiPorts, useAgentConsumer, useAgentListCore };
1123
+ export { type AgentCatalogLinkComponent, AgentCatalogProvider, type AgentCatalogProviderProps, type AgentCatalogRenderModelRef, type AgentCatalogUiPorts, AgentCategoriesPanel, type AgentCategoriesPanelProps, AgentDetailCard, type AgentDetailCardProps, AgentFilterBar, type AgentFilterBarProps, AgentListContent, type AgentListContentProps, type AgentListCoreOptions, AgentListDropdown, type AgentListDropdownProps, AgentListInlinePicker, type AgentListInlinePickerProps, AgentListPanel, AgentListPanelBody, type AgentListPanelBodyProps, type AgentListPanelProps, type AgentListTabCounts, AgentListTabs, AgentMobileSubView, type AgentMobileSubViewProps, AgentRow, type AgentRowProps, AgentSortPanel, type AgentSortPanelProps, AgentTagsPanel, type AgentTagsPanelProps, CheckRow, FavoriteAgentButton, FilterChip, HOVER_GRACE_MS, type IconProps, LIST_MAX_HEIGHT, Music4Icon, OptionRow, type OrchestraBadge, PANEL_HEIGHT, PANEL_WIDTH, type RightPanel, SORT_OPTIONS, SearchInput, SidePanelHeader, type UseAgentConsumerReturn, coerceVisibleTab, orchestraDelegatesLine, orchestraDepthLine, orchestraLabel, orchestraModeLabel, panelHeightBelow, sideThatFits, useAgentCatalog, useAgentCatalogRows, useAgentCatalogState, useAgentCatalogUiPorts, useAgentConsumer, useAgentListCore };
@@ -1561,6 +1561,17 @@ function panelHeightBelow(trigger, options = {}) {
1561
1561
  if (below >= full) return null;
1562
1562
  return below >= minUsable ? `${Math.floor(below)}px` : null;
1563
1563
  }
1564
+ function sideThatFits(trigger, side, options = {}) {
1565
+ if (!trigger || typeof window === "undefined" || side !== "left" && side !== "right") return side;
1566
+ const width = options.width ?? 680;
1567
+ const gap = options.gap ?? 16;
1568
+ const rect = trigger.getBoundingClientRect();
1569
+ const room = { left: rect.left - gap, right: window.innerWidth - rect.right - gap };
1570
+ if (room[side] >= width) return side;
1571
+ const other = side === "left" ? "right" : "left";
1572
+ if (room[other] >= width) return other;
1573
+ return "bottom";
1574
+ }
1564
1575
 
1565
1576
  // catalog/react/AgentFilterBar.tsx
1566
1577
  import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
@@ -2464,6 +2475,7 @@ function AgentListDropdown({
2464
2475
  const [open, setOpen] = useState4(false);
2465
2476
  const triggerRef = useRef5(null);
2466
2477
  const [fitHeight, setFitHeight] = useState4(null);
2478
+ const [openSide, setOpenSide] = useState4(contentSide);
2467
2479
  const core = useAgentListCore({
2468
2480
  consumerId,
2469
2481
  ...onSelect ? { onSelect } : {},
@@ -2485,6 +2497,7 @@ function AgentListDropdown({
2485
2497
  setOpen(nextOpen);
2486
2498
  if (nextOpen) {
2487
2499
  setFitHeight(contentSide || isMobile ? null : panelHeightBelow(triggerRef.current));
2500
+ setOpenSide(contentSide && !isMobile ? sideThatFits(triggerRef.current, contentSide) : contentSide);
2488
2501
  }
2489
2502
  };
2490
2503
  const resolveAgentHref = useMemo5(() => {
@@ -2545,7 +2558,7 @@ function AgentListDropdown({
2545
2558
  /* @__PURE__ */ jsx16(
2546
2559
  PopoverContent,
2547
2560
  {
2548
- ...contentSide ? { side: contentSide } : fitHeight ? { side: "bottom" } : {},
2561
+ ...openSide ? { side: openSide } : fitHeight ? { side: "bottom" } : {},
2549
2562
  align: "start",
2550
2563
  sideOffset: 4,
2551
2564
  collisionPadding: 12,
@@ -2736,6 +2749,7 @@ export {
2736
2749
  orchestraLabel,
2737
2750
  orchestraModeLabel,
2738
2751
  panelHeightBelow,
2752
+ sideThatFits,
2739
2753
  useAgentCatalog,
2740
2754
  useAgentCatalogRows,
2741
2755
  useAgentCatalogState,