@ai-matrx/agents 0.14.3 → 0.15.1
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 +44 -0
- package/dist/catalog/react/index.cjs +303 -208
- package/dist/catalog/react/index.cjs.map +1 -1
- package/dist/catalog/react/index.d.cts +56 -1
- package/dist/catalog/react/index.d.ts +56 -1
- package/dist/catalog/react/index.js +304 -209
- package/dist/catalog/react/index.js.map +1 -1
- package/dist/content-transfer/index.cjs.map +1 -1
- package/dist/content-transfer/index.js.map +1 -1
- package/dist/content-transfer/react/index.cjs.map +1 -1
- package/dist/content-transfer/react/index.js.map +1 -1
- package/dist/mandates/index.cjs +2 -2
- package/dist/mandates/index.cjs.map +1 -1
- package/dist/mandates/index.d.cts +4 -4
- package/dist/mandates/index.d.ts +4 -4
- package/dist/mandates/index.js +2 -2
- package/dist/mandates/index.js.map +1 -1
- package/mandates/snapshots/keys.0.15.0.json +625 -0
- package/mandates/snapshots/keys.0.15.1.json +625 -0
- package/package.json +3 -3
|
@@ -29,6 +29,8 @@ __export(react_exports, {
|
|
|
29
29
|
AgentListContent: () => AgentListContent,
|
|
30
30
|
AgentListDropdown: () => AgentListDropdown,
|
|
31
31
|
AgentListInlinePicker: () => AgentListInlinePicker,
|
|
32
|
+
AgentListPanel: () => AgentListPanel,
|
|
33
|
+
AgentListPanelBody: () => AgentListPanelBody,
|
|
32
34
|
AgentListTabs: () => AgentListTabs,
|
|
33
35
|
AgentMobileSubView: () => AgentMobileSubView,
|
|
34
36
|
AgentRow: () => AgentRow,
|
|
@@ -42,6 +44,7 @@ __export(react_exports, {
|
|
|
42
44
|
Music4Icon: () => Music4Icon,
|
|
43
45
|
OptionRow: () => OptionRow,
|
|
44
46
|
PANEL_HEIGHT: () => PANEL_HEIGHT,
|
|
47
|
+
PANEL_WIDTH: () => PANEL_WIDTH,
|
|
45
48
|
SORT_OPTIONS: () => SORT_OPTIONS,
|
|
46
49
|
SearchInput: () => SearchInput,
|
|
47
50
|
SidePanelHeader: () => SidePanelHeader,
|
|
@@ -951,6 +954,10 @@ function useAgentListCore({
|
|
|
951
954
|
var selectStatus = (state) => state.status;
|
|
952
955
|
|
|
953
956
|
// catalog/react/AgentListDropdown.tsx
|
|
957
|
+
var import_design_system8 = require("@ai-matrx/design-system");
|
|
958
|
+
var import_react8 = require("react");
|
|
959
|
+
|
|
960
|
+
// catalog/react/AgentListPanel.tsx
|
|
954
961
|
var import_design_system7 = require("@ai-matrx/design-system");
|
|
955
962
|
var import_react7 = require("react");
|
|
956
963
|
|
|
@@ -2196,41 +2203,28 @@ function AgentTagsPanel({
|
|
|
2196
2203
|
] });
|
|
2197
2204
|
}
|
|
2198
2205
|
|
|
2199
|
-
// catalog/react/
|
|
2206
|
+
// catalog/react/AgentListPanel.tsx
|
|
2200
2207
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2201
|
-
var
|
|
2202
|
-
function
|
|
2203
|
-
|
|
2204
|
-
navigateTo,
|
|
2205
|
-
className,
|
|
2206
|
-
label,
|
|
2207
|
-
triggerSlot,
|
|
2208
|
-
noBorder = false,
|
|
2209
|
-
compact = false,
|
|
2210
|
-
activeAgentId: activeAgentIdProp,
|
|
2211
|
-
contentSide,
|
|
2212
|
-
consumerId = CONSUMER_ID,
|
|
2213
|
-
initialTab,
|
|
2214
|
-
includeSystemInAll = false,
|
|
2208
|
+
var PANEL_WIDTH = "680px";
|
|
2209
|
+
function AgentListPanelBody({
|
|
2210
|
+
core,
|
|
2215
2211
|
visibleTabs,
|
|
2216
2212
|
systemTabLabel,
|
|
2217
|
-
|
|
2213
|
+
includeSystemInAll = false,
|
|
2214
|
+
resolveAgentHref,
|
|
2218
2215
|
showPinnedAgent = true,
|
|
2219
|
-
|
|
2220
|
-
|
|
2216
|
+
autoFocusSearch = true,
|
|
2217
|
+
onAfterSelect,
|
|
2218
|
+
className
|
|
2221
2219
|
}) {
|
|
2222
2220
|
const isMobile = (0, import_design_system7.useIsMobile)();
|
|
2223
2221
|
const { labels } = useAgentCatalog();
|
|
2224
|
-
const { popoverContainer } = useAgentCatalogUiPorts();
|
|
2225
|
-
const [open, setOpen] = (0, import_react7.useState)(false);
|
|
2226
2222
|
const [rightPanel, setRightPanel] = (0, import_react7.useState)(null);
|
|
2227
2223
|
const [catSearch, setCatSearch] = (0, import_react7.useState)("");
|
|
2228
2224
|
const [tagSearch, setTagSearch] = (0, import_react7.useState)("");
|
|
2229
2225
|
const [mobileDetailAgent, setMobileDetailAgent] = (0, import_react7.useState)(null);
|
|
2230
2226
|
const [mobileSubView, setMobileSubView] = (0, import_react7.useState)(null);
|
|
2231
2227
|
const inputRef = (0, import_react7.useRef)(null);
|
|
2232
|
-
const triggerRef = (0, import_react7.useRef)(null);
|
|
2233
|
-
const [fitHeight, setFitHeight] = (0, import_react7.useState)(null);
|
|
2234
2228
|
const {
|
|
2235
2229
|
agents,
|
|
2236
2230
|
archivedHiddenCount,
|
|
@@ -2251,43 +2245,26 @@ function AgentListDropdown({
|
|
|
2251
2245
|
handleAgentHoverEnd: coreAgentHoverEnd,
|
|
2252
2246
|
handleDetailPanelMouseEnter,
|
|
2253
2247
|
handleDetailPanelMouseLeave: coreDetailMouseLeave
|
|
2254
|
-
} =
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
const showAssignedTooltip = Boolean(activeAgentId) && displayLabel.trim().length > 0 && displayLabel !== "Select an agent" && displayLabel !== labels.triggerFallback;
|
|
2270
|
-
const handleOpen = (nextOpen) => {
|
|
2271
|
-
setOpen(nextOpen);
|
|
2272
|
-
if (nextOpen) {
|
|
2273
|
-
setFitHeight(contentSide || isMobile ? null : panelHeightBelow(triggerRef.current));
|
|
2274
|
-
ensureLoaded();
|
|
2275
|
-
if (pinnedAgent && !isMobile) {
|
|
2276
|
-
setHoveredAgent(pinnedAgent);
|
|
2277
|
-
setRightPanel("detail");
|
|
2278
|
-
}
|
|
2279
|
-
setTimeout(() => inputRef.current?.focus(), 50);
|
|
2280
|
-
} else {
|
|
2281
|
-
setRightPanel(null);
|
|
2282
|
-
setCatSearch("");
|
|
2283
|
-
setTagSearch("");
|
|
2284
|
-
setMobileDetailAgent(null);
|
|
2285
|
-
setMobileSubView(null);
|
|
2286
|
-
}
|
|
2287
|
-
};
|
|
2248
|
+
} = core;
|
|
2249
|
+
(0, import_react7.useEffect)(() => {
|
|
2250
|
+
ensureLoaded();
|
|
2251
|
+
if (!autoFocusSearch) return void 0;
|
|
2252
|
+
const timer = setTimeout(() => inputRef.current?.focus(), 50);
|
|
2253
|
+
return () => clearTimeout(timer);
|
|
2254
|
+
}, [ensureLoaded, autoFocusSearch]);
|
|
2255
|
+
const pinnedPreviewedRef = (0, import_react7.useRef)(false);
|
|
2256
|
+
(0, import_react7.useEffect)(() => {
|
|
2257
|
+
if (pinnedPreviewedRef.current || isMobile || !pinnedAgent) return;
|
|
2258
|
+
pinnedPreviewedRef.current = true;
|
|
2259
|
+
if (rightPanel !== null) return;
|
|
2260
|
+
setHoveredAgent(pinnedAgent);
|
|
2261
|
+
setRightPanel("detail");
|
|
2262
|
+
}, [pinnedAgent, isMobile, rightPanel, setHoveredAgent]);
|
|
2288
2263
|
const handleSelectAgent = (agent) => {
|
|
2289
2264
|
coreSelectAgent(agent);
|
|
2290
|
-
|
|
2265
|
+
setMobileDetailAgent(null);
|
|
2266
|
+
setMobileSubView(null);
|
|
2267
|
+
onAfterSelect?.(agent);
|
|
2291
2268
|
};
|
|
2292
2269
|
const handleFilterChipClick = (panel) => {
|
|
2293
2270
|
if (isMobile) {
|
|
@@ -2316,39 +2293,7 @@ function AgentListDropdown({
|
|
|
2316
2293
|
const handleDetailPanelMouseLeave = (0, import_react7.useCallback)(() => {
|
|
2317
2294
|
coreDetailMouseLeave(() => setRightPanel(null));
|
|
2318
2295
|
}, [coreDetailMouseLeave]);
|
|
2319
|
-
const
|
|
2320
|
-
if (resolveAgentHrefProp) return resolveAgentHrefProp;
|
|
2321
|
-
if (!navigateTo) return void 0;
|
|
2322
|
-
return (agent) => navigateTo.replace("{id}", agent.id);
|
|
2323
|
-
}, [navigateTo, resolveAgentHrefProp]);
|
|
2324
|
-
const hasRightPanel = rightPanel !== null;
|
|
2325
|
-
const triggerButton = triggerSlot ?? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2326
|
-
"button",
|
|
2327
|
-
{
|
|
2328
|
-
type: "button",
|
|
2329
|
-
className: (0, import_design_system7.cn)(
|
|
2330
|
-
"inline-flex items-center rounded-md text-xs font-medium transition-colors",
|
|
2331
|
-
"bg-background hover:bg-muted/50 text-foreground/80 hover:text-foreground",
|
|
2332
|
-
compact ? "h-5 gap-1 px-1.5" : "h-7 gap-1.5 px-2.5",
|
|
2333
|
-
!noBorder && "border border-border",
|
|
2334
|
-
className
|
|
2335
|
-
),
|
|
2336
|
-
children: [
|
|
2337
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "min-w-0 max-w-[200px] flex-1 truncate text-left", children: displayLabel }),
|
|
2338
|
-
activeFilterCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "flex items-center justify-center w-4 h-4 rounded-md bg-primary text-primary-foreground text-[10px]", children: activeFilterCount }),
|
|
2339
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronDownIcon, { className: "w-3 h-3 text-muted-foreground/60" })
|
|
2340
|
-
]
|
|
2341
|
-
}
|
|
2342
|
-
);
|
|
2343
|
-
const wrapTrigger = (Trigger) => {
|
|
2344
|
-
if (!showAssignedTooltip) {
|
|
2345
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Trigger, { asChild: true, ref: triggerRef, children: triggerButton });
|
|
2346
|
-
}
|
|
2347
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_design_system7.Tooltip, { ...open ? { open: false } : {}, children: [
|
|
2348
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Trigger, { asChild: true, ref: triggerRef, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system7.TooltipTrigger, { asChild: true, children: triggerButton }) }),
|
|
2349
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system7.TooltipContent, { side: "bottom", className: "max-w-xs", children: displayLabel })
|
|
2350
|
-
] });
|
|
2351
|
-
};
|
|
2296
|
+
const effectiveSystemTabLabel = systemTabLabel ?? (includeSystemInAll ? "System" : void 0);
|
|
2352
2297
|
const listPanel = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2353
2298
|
AgentListContent,
|
|
2354
2299
|
{
|
|
@@ -2373,64 +2318,270 @@ function AgentListDropdown({
|
|
|
2373
2318
|
tabCounts,
|
|
2374
2319
|
archivedHiddenCount,
|
|
2375
2320
|
...visibleTabs ? { visibleTabs } : {},
|
|
2376
|
-
...
|
|
2377
|
-
systemTabLabel: systemTabLabel ?? (includeSystemInAll ? "System" : void 0)
|
|
2378
|
-
} : {},
|
|
2321
|
+
...effectiveSystemTabLabel ? { systemTabLabel: effectiveSystemTabLabel } : {},
|
|
2379
2322
|
pinnedAgent: showPinnedAgent ? pinnedAgent : null,
|
|
2380
2323
|
defaultRow,
|
|
2381
|
-
listOpen:
|
|
2324
|
+
listOpen: true
|
|
2382
2325
|
}
|
|
2383
2326
|
);
|
|
2384
2327
|
if (isMobile) {
|
|
2385
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_design_system7.cn)("flex min-h-0 flex-1 flex-col overflow-hidden", className), children: mobileDetailAgent ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col overflow-hidden", children: [
|
|
2329
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2330
|
+
"button",
|
|
2331
|
+
{
|
|
2332
|
+
type: "button",
|
|
2333
|
+
onClick: () => setMobileDetailAgent(null),
|
|
2334
|
+
className: "flex items-center gap-1.5 px-3 py-2.5 text-sm font-medium text-primary hover:bg-muted/30 transition-colors border-b border-border shrink-0",
|
|
2335
|
+
children: [
|
|
2336
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronRightIcon, { className: "w-4 h-4 rotate-180" }),
|
|
2337
|
+
"Back"
|
|
2338
|
+
]
|
|
2339
|
+
}
|
|
2340
|
+
),
|
|
2341
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2342
|
+
AgentDetailCard,
|
|
2343
|
+
{
|
|
2344
|
+
agent: mobileDetailAgent,
|
|
2345
|
+
onSelect: () => handleSelectAgent(mobileDetailAgent)
|
|
2346
|
+
}
|
|
2347
|
+
) })
|
|
2348
|
+
] }) : mobileSubView ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2349
|
+
AgentMobileSubView,
|
|
2350
|
+
{
|
|
2351
|
+
view: mobileSubView,
|
|
2352
|
+
consumer,
|
|
2353
|
+
allCategories,
|
|
2354
|
+
allTags,
|
|
2355
|
+
catSearch,
|
|
2356
|
+
setCatSearch,
|
|
2357
|
+
tagSearch,
|
|
2358
|
+
setTagSearch,
|
|
2359
|
+
onBack: () => {
|
|
2360
|
+
setMobileSubView(null);
|
|
2361
|
+
setCatSearch("");
|
|
2362
|
+
setTagSearch("");
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
) : listPanel });
|
|
2366
|
+
}
|
|
2367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: (0, import_design_system7.cn)("flex h-full", className), children: [
|
|
2368
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-col min-w-[340px] flex-1 border-r border-border", children: listPanel }),
|
|
2369
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2370
|
+
"div",
|
|
2371
|
+
{
|
|
2372
|
+
className: "h-full w-[340px] shrink-0 overflow-hidden flex flex-col",
|
|
2373
|
+
onMouseEnter: rightPanel === "detail" ? handleDetailPanelMouseEnter : void 0,
|
|
2374
|
+
onMouseLeave: rightPanel === "detail" ? handleDetailPanelMouseLeave : void 0,
|
|
2375
|
+
children: [
|
|
2376
|
+
rightPanel === "detail" && hoveredAgent && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "h-full matrx-agent-fade-in", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2377
|
+
AgentDetailCard,
|
|
2392
2378
|
{
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2379
|
+
agent: hoveredAgent,
|
|
2380
|
+
onSelect: () => handleSelectAgent(hoveredAgent)
|
|
2381
|
+
}
|
|
2382
|
+
) }, hoveredAgent.id),
|
|
2383
|
+
rightPanel === "sort" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2384
|
+
AgentSortPanel,
|
|
2385
|
+
{
|
|
2386
|
+
consumer,
|
|
2387
|
+
onClose: () => setRightPanel(null)
|
|
2400
2388
|
}
|
|
2401
2389
|
),
|
|
2402
|
-
|
|
2403
|
-
|
|
2390
|
+
rightPanel === "categories" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2391
|
+
AgentCategoriesPanel,
|
|
2404
2392
|
{
|
|
2405
|
-
|
|
2406
|
-
|
|
2393
|
+
consumer,
|
|
2394
|
+
allCategories,
|
|
2395
|
+
search: catSearch,
|
|
2396
|
+
setSearch: setCatSearch,
|
|
2397
|
+
onClose: () => {
|
|
2398
|
+
setRightPanel(null);
|
|
2399
|
+
setCatSearch("");
|
|
2400
|
+
}
|
|
2407
2401
|
}
|
|
2408
|
-
)
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
onBack: () => {
|
|
2421
|
-
setMobileSubView(null);
|
|
2422
|
-
setCatSearch("");
|
|
2423
|
-
setTagSearch("");
|
|
2402
|
+
),
|
|
2403
|
+
rightPanel === "tags" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2404
|
+
AgentTagsPanel,
|
|
2405
|
+
{
|
|
2406
|
+
consumer,
|
|
2407
|
+
allTags,
|
|
2408
|
+
search: tagSearch,
|
|
2409
|
+
setSearch: setTagSearch,
|
|
2410
|
+
onClose: () => {
|
|
2411
|
+
setRightPanel(null);
|
|
2412
|
+
setTagSearch("");
|
|
2413
|
+
}
|
|
2424
2414
|
}
|
|
2425
|
-
|
|
2426
|
-
|
|
2415
|
+
),
|
|
2416
|
+
rightPanel === null && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center", children: [
|
|
2417
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MousePointerClickIcon, { className: "h-6 w-6 text-muted-foreground/40" }),
|
|
2418
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-xs text-muted-foreground/70 leading-relaxed", children: labels.hoverHint })
|
|
2419
|
+
] })
|
|
2420
|
+
]
|
|
2421
|
+
}
|
|
2422
|
+
)
|
|
2423
|
+
] });
|
|
2424
|
+
}
|
|
2425
|
+
function AgentListPanel({
|
|
2426
|
+
consumerId,
|
|
2427
|
+
onSelect,
|
|
2428
|
+
navigateTo,
|
|
2429
|
+
activeAgentId,
|
|
2430
|
+
initialTab,
|
|
2431
|
+
includeSystemInAll = false,
|
|
2432
|
+
visibleTabs,
|
|
2433
|
+
excludeAgentIds,
|
|
2434
|
+
defaultMandateKey,
|
|
2435
|
+
resolveAgentHref: resolveAgentHrefProp,
|
|
2436
|
+
className,
|
|
2437
|
+
fill = false,
|
|
2438
|
+
...display
|
|
2439
|
+
}) {
|
|
2440
|
+
const isMobile = (0, import_design_system7.useIsMobile)();
|
|
2441
|
+
const core = useAgentListCore({
|
|
2442
|
+
consumerId,
|
|
2443
|
+
...onSelect ? { onSelect } : {},
|
|
2444
|
+
...navigateTo ? { navigateTo } : {},
|
|
2445
|
+
...activeAgentId !== void 0 ? { activeAgentIdOverride: activeAgentId } : {},
|
|
2446
|
+
...initialTab ? { initialTab } : {},
|
|
2447
|
+
includeSystemInAll,
|
|
2448
|
+
...visibleTabs ? { visibleTabs } : {},
|
|
2449
|
+
...excludeAgentIds ? { excludeAgentIds } : {},
|
|
2450
|
+
...defaultMandateKey ? { defaultMandateKey } : {}
|
|
2451
|
+
});
|
|
2452
|
+
const resolveAgentHref = (0, import_react7.useMemo)(() => {
|
|
2453
|
+
if (resolveAgentHrefProp) return resolveAgentHrefProp;
|
|
2454
|
+
if (!navigateTo) return void 0;
|
|
2455
|
+
return (agent) => navigateTo.replace("{id}", agent.id);
|
|
2456
|
+
}, [navigateTo, resolveAgentHrefProp]);
|
|
2457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2458
|
+
"div",
|
|
2459
|
+
{
|
|
2460
|
+
className: (0, import_design_system7.cn)("flex min-h-0 flex-col overflow-hidden", (isMobile || fill) && "h-full w-full", className),
|
|
2461
|
+
style: isMobile || fill ? void 0 : { width: PANEL_WIDTH, height: PANEL_HEIGHT },
|
|
2462
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2463
|
+
AgentListPanelBody,
|
|
2464
|
+
{
|
|
2465
|
+
core,
|
|
2466
|
+
includeSystemInAll,
|
|
2467
|
+
...visibleTabs ? { visibleTabs } : {},
|
|
2468
|
+
...resolveAgentHref ? { resolveAgentHref } : {},
|
|
2469
|
+
...display
|
|
2470
|
+
}
|
|
2471
|
+
)
|
|
2472
|
+
}
|
|
2473
|
+
);
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2476
|
+
// catalog/react/AgentListDropdown.tsx
|
|
2477
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2478
|
+
var CONSUMER_ID = "agent-list-dropdown";
|
|
2479
|
+
function AgentListDropdown({
|
|
2480
|
+
onSelect,
|
|
2481
|
+
navigateTo,
|
|
2482
|
+
className,
|
|
2483
|
+
label,
|
|
2484
|
+
triggerSlot,
|
|
2485
|
+
noBorder = false,
|
|
2486
|
+
compact = false,
|
|
2487
|
+
activeAgentId: activeAgentIdProp,
|
|
2488
|
+
contentSide,
|
|
2489
|
+
consumerId = CONSUMER_ID,
|
|
2490
|
+
initialTab,
|
|
2491
|
+
includeSystemInAll = false,
|
|
2492
|
+
visibleTabs,
|
|
2493
|
+
systemTabLabel,
|
|
2494
|
+
resolveAgentHref: resolveAgentHrefProp,
|
|
2495
|
+
showPinnedAgent = true,
|
|
2496
|
+
excludeAgentIds,
|
|
2497
|
+
defaultMandateKey
|
|
2498
|
+
}) {
|
|
2499
|
+
const isMobile = (0, import_design_system8.useIsMobile)();
|
|
2500
|
+
const { labels } = useAgentCatalog();
|
|
2501
|
+
const { popoverContainer } = useAgentCatalogUiPorts();
|
|
2502
|
+
const [open, setOpen] = (0, import_react8.useState)(false);
|
|
2503
|
+
const triggerRef = (0, import_react8.useRef)(null);
|
|
2504
|
+
const [fitHeight, setFitHeight] = (0, import_react8.useState)(null);
|
|
2505
|
+
const core = useAgentListCore({
|
|
2506
|
+
consumerId,
|
|
2507
|
+
...onSelect ? { onSelect } : {},
|
|
2508
|
+
...navigateTo ? { navigateTo } : {},
|
|
2509
|
+
...activeAgentIdProp !== void 0 ? { activeAgentIdOverride: activeAgentIdProp } : {},
|
|
2510
|
+
...initialTab ? { initialTab } : {},
|
|
2511
|
+
includeSystemInAll,
|
|
2512
|
+
// The restriction has to reach the CORE, not just the tab strip — see
|
|
2513
|
+
// `AgentListCoreOptions.visibleTabs`.
|
|
2514
|
+
...visibleTabs ? { visibleTabs } : {},
|
|
2515
|
+
...excludeAgentIds ? { excludeAgentIds } : {},
|
|
2516
|
+
...defaultMandateKey ? { defaultMandateKey } : {}
|
|
2517
|
+
});
|
|
2518
|
+
const { pinnedAgent, defaultRow, activeAgentId, isLoading, activeFilterCount } = core;
|
|
2519
|
+
const activeDefaultRow = defaultRow?.row?.id === activeAgentId ? defaultRow.row : null;
|
|
2520
|
+
const displayLabel = label ?? pinnedAgent?.name ?? activeDefaultRow?.name ?? (activeAgentId ? isLoading ? labels.triggerResolving : labels.triggerUnnameable : labels.triggerFallback);
|
|
2521
|
+
const showAssignedTooltip = Boolean(activeAgentId) && displayLabel.trim().length > 0 && displayLabel !== "Select an agent" && displayLabel !== labels.triggerFallback;
|
|
2522
|
+
const handleOpen = (nextOpen) => {
|
|
2523
|
+
setOpen(nextOpen);
|
|
2524
|
+
if (nextOpen) {
|
|
2525
|
+
setFitHeight(contentSide || isMobile ? null : panelHeightBelow(triggerRef.current));
|
|
2526
|
+
}
|
|
2527
|
+
};
|
|
2528
|
+
const resolveAgentHref = (0, import_react8.useMemo)(() => {
|
|
2529
|
+
if (resolveAgentHrefProp) return resolveAgentHrefProp;
|
|
2530
|
+
if (!navigateTo) return void 0;
|
|
2531
|
+
return (agent) => navigateTo.replace("{id}", agent.id);
|
|
2532
|
+
}, [navigateTo, resolveAgentHrefProp]);
|
|
2533
|
+
const triggerButton = triggerSlot ?? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2534
|
+
"button",
|
|
2535
|
+
{
|
|
2536
|
+
type: "button",
|
|
2537
|
+
className: (0, import_design_system8.cn)(
|
|
2538
|
+
"inline-flex items-center rounded-md text-xs font-medium transition-colors",
|
|
2539
|
+
"bg-background hover:bg-muted/50 text-foreground/80 hover:text-foreground",
|
|
2540
|
+
compact ? "h-5 gap-1 px-1.5" : "h-7 gap-1.5 px-2.5",
|
|
2541
|
+
!noBorder && "border border-border",
|
|
2542
|
+
className
|
|
2543
|
+
),
|
|
2544
|
+
children: [
|
|
2545
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "min-w-0 max-w-[200px] flex-1 truncate text-left", children: displayLabel }),
|
|
2546
|
+
activeFilterCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "flex items-center justify-center w-4 h-4 rounded-md bg-primary text-primary-foreground text-[10px]", children: activeFilterCount }),
|
|
2547
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ChevronDownIcon, { className: "w-3 h-3 text-muted-foreground/60" })
|
|
2548
|
+
]
|
|
2549
|
+
}
|
|
2550
|
+
);
|
|
2551
|
+
const wrapTrigger = (Trigger) => {
|
|
2552
|
+
if (!showAssignedTooltip) {
|
|
2553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Trigger, { asChild: true, ref: triggerRef, children: triggerButton });
|
|
2554
|
+
}
|
|
2555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system8.Tooltip, { ...open ? { open: false } : {}, children: [
|
|
2556
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Trigger, { asChild: true, ref: triggerRef, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system8.TooltipTrigger, { asChild: true, children: triggerButton }) }),
|
|
2557
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system8.TooltipContent, { side: "bottom", className: "max-w-xs", children: displayLabel })
|
|
2558
|
+
] });
|
|
2559
|
+
};
|
|
2560
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2561
|
+
AgentListPanelBody,
|
|
2562
|
+
{
|
|
2563
|
+
core,
|
|
2564
|
+
includeSystemInAll,
|
|
2565
|
+
showPinnedAgent,
|
|
2566
|
+
onAfterSelect: () => setOpen(false),
|
|
2567
|
+
...visibleTabs ? { visibleTabs } : {},
|
|
2568
|
+
...systemTabLabel ? { systemTabLabel } : {},
|
|
2569
|
+
...resolveAgentHref ? { resolveAgentHref } : {}
|
|
2570
|
+
}
|
|
2571
|
+
);
|
|
2572
|
+
if (isMobile) {
|
|
2573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system8.Drawer, { open, onOpenChange: handleOpen, children: [
|
|
2574
|
+
wrapTrigger(import_design_system8.DrawerTrigger),
|
|
2575
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system8.DrawerContent, { className: "h-[85dvh]", children: [
|
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system8.DrawerTitle, { className: "sr-only", children: "Select Agent" }),
|
|
2577
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex flex-col overflow-hidden flex-1 min-h-0", children: body })
|
|
2427
2578
|
] })
|
|
2428
2579
|
] });
|
|
2429
2580
|
}
|
|
2430
|
-
return /* @__PURE__ */ (0,
|
|
2431
|
-
wrapTrigger(
|
|
2432
|
-
/* @__PURE__ */ (0,
|
|
2433
|
-
|
|
2581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system8.Popover, { open, onOpenChange: handleOpen, modal: false, children: [
|
|
2582
|
+
wrapTrigger(import_design_system8.PopoverTrigger),
|
|
2583
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2584
|
+
import_design_system8.PopoverContent,
|
|
2434
2585
|
{
|
|
2435
2586
|
...contentSide ? { side: contentSide } : fitHeight ? { side: "bottom" } : {},
|
|
2436
2587
|
align: "start",
|
|
@@ -2438,74 +2589,18 @@ function AgentListDropdown({
|
|
|
2438
2589
|
collisionPadding: 12,
|
|
2439
2590
|
sticky: "always",
|
|
2440
2591
|
...popoverContainer ? { container: popoverContainer } : {},
|
|
2441
|
-
className: "p-0 overflow-hidden
|
|
2442
|
-
style: { height: fitHeight ?? PANEL_HEIGHT, maxHeight: fitHeight ?? LIST_MAX_HEIGHT },
|
|
2443
|
-
children:
|
|
2444
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-col min-w-0 w-[340px] shrink-0 border-r border-border", children: listPanel }),
|
|
2445
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2446
|
-
"div",
|
|
2447
|
-
{
|
|
2448
|
-
className: "h-full w-[340px] shrink-0 overflow-hidden flex flex-col",
|
|
2449
|
-
onMouseEnter: rightPanel === "detail" ? handleDetailPanelMouseEnter : void 0,
|
|
2450
|
-
onMouseLeave: rightPanel === "detail" ? handleDetailPanelMouseLeave : void 0,
|
|
2451
|
-
children: [
|
|
2452
|
-
rightPanel === "detail" && hoveredAgent && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "h-full matrx-agent-fade-in", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2453
|
-
AgentDetailCard,
|
|
2454
|
-
{
|
|
2455
|
-
agent: hoveredAgent,
|
|
2456
|
-
onSelect: () => handleSelectAgent(hoveredAgent)
|
|
2457
|
-
}
|
|
2458
|
-
) }, hoveredAgent.id),
|
|
2459
|
-
rightPanel === "sort" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2460
|
-
AgentSortPanel,
|
|
2461
|
-
{
|
|
2462
|
-
consumer,
|
|
2463
|
-
onClose: () => setRightPanel(null)
|
|
2464
|
-
}
|
|
2465
|
-
),
|
|
2466
|
-
rightPanel === "categories" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2467
|
-
AgentCategoriesPanel,
|
|
2468
|
-
{
|
|
2469
|
-
consumer,
|
|
2470
|
-
allCategories,
|
|
2471
|
-
search: catSearch,
|
|
2472
|
-
setSearch: setCatSearch,
|
|
2473
|
-
onClose: () => {
|
|
2474
|
-
setRightPanel(null);
|
|
2475
|
-
setCatSearch("");
|
|
2476
|
-
}
|
|
2477
|
-
}
|
|
2478
|
-
),
|
|
2479
|
-
rightPanel === "tags" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2480
|
-
AgentTagsPanel,
|
|
2481
|
-
{
|
|
2482
|
-
consumer,
|
|
2483
|
-
allTags,
|
|
2484
|
-
search: tagSearch,
|
|
2485
|
-
setSearch: setTagSearch,
|
|
2486
|
-
onClose: () => {
|
|
2487
|
-
setRightPanel(null);
|
|
2488
|
-
setTagSearch("");
|
|
2489
|
-
}
|
|
2490
|
-
}
|
|
2491
|
-
),
|
|
2492
|
-
!hasRightPanel && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center", children: [
|
|
2493
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MousePointerClickIcon, { className: "h-6 w-6 text-muted-foreground/40" }),
|
|
2494
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-xs text-muted-foreground/70 leading-relaxed", children: labels.hoverHint })
|
|
2495
|
-
] })
|
|
2496
|
-
]
|
|
2497
|
-
}
|
|
2498
|
-
)
|
|
2499
|
-
] })
|
|
2592
|
+
className: "p-0 overflow-hidden",
|
|
2593
|
+
style: { width: PANEL_WIDTH, height: fitHeight ?? PANEL_HEIGHT, maxHeight: fitHeight ?? LIST_MAX_HEIGHT },
|
|
2594
|
+
children: body
|
|
2500
2595
|
}
|
|
2501
2596
|
)
|
|
2502
2597
|
] });
|
|
2503
2598
|
}
|
|
2504
2599
|
|
|
2505
2600
|
// catalog/react/AgentListInlinePicker.tsx
|
|
2506
|
-
var
|
|
2507
|
-
var
|
|
2508
|
-
var
|
|
2601
|
+
var import_design_system9 = require("@ai-matrx/design-system");
|
|
2602
|
+
var import_react9 = require("react");
|
|
2603
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2509
2604
|
function AgentListInlinePicker({
|
|
2510
2605
|
consumerId,
|
|
2511
2606
|
onSelect,
|
|
@@ -2521,11 +2616,11 @@ function AgentListInlinePicker({
|
|
|
2521
2616
|
excludeAgentIds,
|
|
2522
2617
|
defaultMandateKey
|
|
2523
2618
|
}) {
|
|
2524
|
-
const inputRef = (0,
|
|
2525
|
-
const [catSearch, setCatSearch] = (0,
|
|
2526
|
-
const [tagSearch, setTagSearch] = (0,
|
|
2527
|
-
const [mobileDetailAgent, setMobileDetailAgent] = (0,
|
|
2528
|
-
const [mobileSubView, setMobileSubView] = (0,
|
|
2619
|
+
const inputRef = (0, import_react9.useRef)(null);
|
|
2620
|
+
const [catSearch, setCatSearch] = (0, import_react9.useState)("");
|
|
2621
|
+
const [tagSearch, setTagSearch] = (0, import_react9.useState)("");
|
|
2622
|
+
const [mobileDetailAgent, setMobileDetailAgent] = (0, import_react9.useState)(null);
|
|
2623
|
+
const [mobileSubView, setMobileSubView] = (0, import_react9.useState)(null);
|
|
2529
2624
|
const {
|
|
2530
2625
|
agents,
|
|
2531
2626
|
archivedHiddenCount,
|
|
@@ -2554,7 +2649,7 @@ function AgentListInlinePicker({
|
|
|
2554
2649
|
...excludeAgentIds ? { excludeAgentIds } : {},
|
|
2555
2650
|
...defaultMandateKey ? { defaultMandateKey } : {}
|
|
2556
2651
|
});
|
|
2557
|
-
(0,
|
|
2652
|
+
(0, import_react9.useEffect)(() => {
|
|
2558
2653
|
ensureLoaded();
|
|
2559
2654
|
if (!autoFocusSearch) return void 0;
|
|
2560
2655
|
const timer = setTimeout(() => inputRef.current?.focus(), 50);
|
|
@@ -2570,20 +2665,20 @@ function AgentListInlinePicker({
|
|
|
2570
2665
|
};
|
|
2571
2666
|
const isMobile = true;
|
|
2572
2667
|
if (mobileDetailAgent) {
|
|
2573
|
-
return /* @__PURE__ */ (0,
|
|
2574
|
-
/* @__PURE__ */ (0,
|
|
2668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: (0, import_design_system9.cn)("flex h-full min-h-0 flex-col", className), children: [
|
|
2669
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2575
2670
|
"button",
|
|
2576
2671
|
{
|
|
2577
2672
|
type: "button",
|
|
2578
2673
|
onClick: () => setMobileDetailAgent(null),
|
|
2579
2674
|
className: "flex shrink-0 items-center gap-1.5 border-b border-border px-3 py-2 text-sm font-medium text-primary transition-colors hover:bg-muted/30",
|
|
2580
2675
|
children: [
|
|
2581
|
-
/* @__PURE__ */ (0,
|
|
2676
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronRightIcon, { className: "h-4 w-4 rotate-180" }),
|
|
2582
2677
|
"Back"
|
|
2583
2678
|
]
|
|
2584
2679
|
}
|
|
2585
2680
|
),
|
|
2586
|
-
/* @__PURE__ */ (0,
|
|
2681
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2587
2682
|
AgentDetailCard,
|
|
2588
2683
|
{
|
|
2589
2684
|
agent: mobileDetailAgent,
|
|
@@ -2593,7 +2688,7 @@ function AgentListInlinePicker({
|
|
|
2593
2688
|
] });
|
|
2594
2689
|
}
|
|
2595
2690
|
if (mobileSubView) {
|
|
2596
|
-
return /* @__PURE__ */ (0,
|
|
2691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: (0, import_design_system9.cn)("flex h-full min-h-0 flex-col", className), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2597
2692
|
AgentMobileSubView,
|
|
2598
2693
|
{
|
|
2599
2694
|
view: mobileSubView,
|
|
@@ -2612,7 +2707,7 @@ function AgentListInlinePicker({
|
|
|
2612
2707
|
}
|
|
2613
2708
|
) });
|
|
2614
2709
|
}
|
|
2615
|
-
return /* @__PURE__ */ (0,
|
|
2710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: (0, import_design_system9.cn)("flex h-full min-h-0 flex-col", className), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2616
2711
|
AgentListContent,
|
|
2617
2712
|
{
|
|
2618
2713
|
agents,
|