@ai-matrx/agents 0.14.3 → 0.15.0
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 +28 -0
- package/dist/catalog/react/index.cjs +302 -208
- package/dist/catalog/react/index.cjs.map +1 -1
- package/dist/catalog/react/index.d.cts +49 -1
- package/dist/catalog/react/index.d.ts +49 -1
- package/dist/catalog/react/index.js +303 -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/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,269 @@ 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-0 w-[340px] shrink-0 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
|
+
...display
|
|
2438
|
+
}) {
|
|
2439
|
+
const isMobile = (0, import_design_system7.useIsMobile)();
|
|
2440
|
+
const core = useAgentListCore({
|
|
2441
|
+
consumerId,
|
|
2442
|
+
...onSelect ? { onSelect } : {},
|
|
2443
|
+
...navigateTo ? { navigateTo } : {},
|
|
2444
|
+
...activeAgentId !== void 0 ? { activeAgentIdOverride: activeAgentId } : {},
|
|
2445
|
+
...initialTab ? { initialTab } : {},
|
|
2446
|
+
includeSystemInAll,
|
|
2447
|
+
...visibleTabs ? { visibleTabs } : {},
|
|
2448
|
+
...excludeAgentIds ? { excludeAgentIds } : {},
|
|
2449
|
+
...defaultMandateKey ? { defaultMandateKey } : {}
|
|
2450
|
+
});
|
|
2451
|
+
const resolveAgentHref = (0, import_react7.useMemo)(() => {
|
|
2452
|
+
if (resolveAgentHrefProp) return resolveAgentHrefProp;
|
|
2453
|
+
if (!navigateTo) return void 0;
|
|
2454
|
+
return (agent) => navigateTo.replace("{id}", agent.id);
|
|
2455
|
+
}, [navigateTo, resolveAgentHrefProp]);
|
|
2456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2457
|
+
"div",
|
|
2458
|
+
{
|
|
2459
|
+
className: (0, import_design_system7.cn)("flex min-h-0 flex-col overflow-hidden", isMobile && "h-full w-full", className),
|
|
2460
|
+
style: isMobile ? void 0 : { width: PANEL_WIDTH, height: PANEL_HEIGHT },
|
|
2461
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2462
|
+
AgentListPanelBody,
|
|
2463
|
+
{
|
|
2464
|
+
core,
|
|
2465
|
+
includeSystemInAll,
|
|
2466
|
+
...visibleTabs ? { visibleTabs } : {},
|
|
2467
|
+
...resolveAgentHref ? { resolveAgentHref } : {},
|
|
2468
|
+
...display
|
|
2469
|
+
}
|
|
2470
|
+
)
|
|
2471
|
+
}
|
|
2472
|
+
);
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
// catalog/react/AgentListDropdown.tsx
|
|
2476
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2477
|
+
var CONSUMER_ID = "agent-list-dropdown";
|
|
2478
|
+
function AgentListDropdown({
|
|
2479
|
+
onSelect,
|
|
2480
|
+
navigateTo,
|
|
2481
|
+
className,
|
|
2482
|
+
label,
|
|
2483
|
+
triggerSlot,
|
|
2484
|
+
noBorder = false,
|
|
2485
|
+
compact = false,
|
|
2486
|
+
activeAgentId: activeAgentIdProp,
|
|
2487
|
+
contentSide,
|
|
2488
|
+
consumerId = CONSUMER_ID,
|
|
2489
|
+
initialTab,
|
|
2490
|
+
includeSystemInAll = false,
|
|
2491
|
+
visibleTabs,
|
|
2492
|
+
systemTabLabel,
|
|
2493
|
+
resolveAgentHref: resolveAgentHrefProp,
|
|
2494
|
+
showPinnedAgent = true,
|
|
2495
|
+
excludeAgentIds,
|
|
2496
|
+
defaultMandateKey
|
|
2497
|
+
}) {
|
|
2498
|
+
const isMobile = (0, import_design_system8.useIsMobile)();
|
|
2499
|
+
const { labels } = useAgentCatalog();
|
|
2500
|
+
const { popoverContainer } = useAgentCatalogUiPorts();
|
|
2501
|
+
const [open, setOpen] = (0, import_react8.useState)(false);
|
|
2502
|
+
const triggerRef = (0, import_react8.useRef)(null);
|
|
2503
|
+
const [fitHeight, setFitHeight] = (0, import_react8.useState)(null);
|
|
2504
|
+
const core = useAgentListCore({
|
|
2505
|
+
consumerId,
|
|
2506
|
+
...onSelect ? { onSelect } : {},
|
|
2507
|
+
...navigateTo ? { navigateTo } : {},
|
|
2508
|
+
...activeAgentIdProp !== void 0 ? { activeAgentIdOverride: activeAgentIdProp } : {},
|
|
2509
|
+
...initialTab ? { initialTab } : {},
|
|
2510
|
+
includeSystemInAll,
|
|
2511
|
+
// The restriction has to reach the CORE, not just the tab strip — see
|
|
2512
|
+
// `AgentListCoreOptions.visibleTabs`.
|
|
2513
|
+
...visibleTabs ? { visibleTabs } : {},
|
|
2514
|
+
...excludeAgentIds ? { excludeAgentIds } : {},
|
|
2515
|
+
...defaultMandateKey ? { defaultMandateKey } : {}
|
|
2516
|
+
});
|
|
2517
|
+
const { pinnedAgent, defaultRow, activeAgentId, isLoading, activeFilterCount } = core;
|
|
2518
|
+
const activeDefaultRow = defaultRow?.row?.id === activeAgentId ? defaultRow.row : null;
|
|
2519
|
+
const displayLabel = label ?? pinnedAgent?.name ?? activeDefaultRow?.name ?? (activeAgentId ? isLoading ? labels.triggerResolving : labels.triggerUnnameable : labels.triggerFallback);
|
|
2520
|
+
const showAssignedTooltip = Boolean(activeAgentId) && displayLabel.trim().length > 0 && displayLabel !== "Select an agent" && displayLabel !== labels.triggerFallback;
|
|
2521
|
+
const handleOpen = (nextOpen) => {
|
|
2522
|
+
setOpen(nextOpen);
|
|
2523
|
+
if (nextOpen) {
|
|
2524
|
+
setFitHeight(contentSide || isMobile ? null : panelHeightBelow(triggerRef.current));
|
|
2525
|
+
}
|
|
2526
|
+
};
|
|
2527
|
+
const resolveAgentHref = (0, import_react8.useMemo)(() => {
|
|
2528
|
+
if (resolveAgentHrefProp) return resolveAgentHrefProp;
|
|
2529
|
+
if (!navigateTo) return void 0;
|
|
2530
|
+
return (agent) => navigateTo.replace("{id}", agent.id);
|
|
2531
|
+
}, [navigateTo, resolveAgentHrefProp]);
|
|
2532
|
+
const triggerButton = triggerSlot ?? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2533
|
+
"button",
|
|
2534
|
+
{
|
|
2535
|
+
type: "button",
|
|
2536
|
+
className: (0, import_design_system8.cn)(
|
|
2537
|
+
"inline-flex items-center rounded-md text-xs font-medium transition-colors",
|
|
2538
|
+
"bg-background hover:bg-muted/50 text-foreground/80 hover:text-foreground",
|
|
2539
|
+
compact ? "h-5 gap-1 px-1.5" : "h-7 gap-1.5 px-2.5",
|
|
2540
|
+
!noBorder && "border border-border",
|
|
2541
|
+
className
|
|
2542
|
+
),
|
|
2543
|
+
children: [
|
|
2544
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "min-w-0 max-w-[200px] flex-1 truncate text-left", children: displayLabel }),
|
|
2545
|
+
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 }),
|
|
2546
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ChevronDownIcon, { className: "w-3 h-3 text-muted-foreground/60" })
|
|
2547
|
+
]
|
|
2548
|
+
}
|
|
2549
|
+
);
|
|
2550
|
+
const wrapTrigger = (Trigger) => {
|
|
2551
|
+
if (!showAssignedTooltip) {
|
|
2552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Trigger, { asChild: true, ref: triggerRef, children: triggerButton });
|
|
2553
|
+
}
|
|
2554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system8.Tooltip, { ...open ? { open: false } : {}, children: [
|
|
2555
|
+
/* @__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 }) }),
|
|
2556
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system8.TooltipContent, { side: "bottom", className: "max-w-xs", children: displayLabel })
|
|
2557
|
+
] });
|
|
2558
|
+
};
|
|
2559
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2560
|
+
AgentListPanelBody,
|
|
2561
|
+
{
|
|
2562
|
+
core,
|
|
2563
|
+
includeSystemInAll,
|
|
2564
|
+
showPinnedAgent,
|
|
2565
|
+
onAfterSelect: () => setOpen(false),
|
|
2566
|
+
...visibleTabs ? { visibleTabs } : {},
|
|
2567
|
+
...systemTabLabel ? { systemTabLabel } : {},
|
|
2568
|
+
...resolveAgentHref ? { resolveAgentHref } : {}
|
|
2569
|
+
}
|
|
2570
|
+
);
|
|
2571
|
+
if (isMobile) {
|
|
2572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system8.Drawer, { open, onOpenChange: handleOpen, children: [
|
|
2573
|
+
wrapTrigger(import_design_system8.DrawerTrigger),
|
|
2574
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system8.DrawerContent, { className: "h-[85dvh]", children: [
|
|
2575
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system8.DrawerTitle, { className: "sr-only", children: "Select Agent" }),
|
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex flex-col overflow-hidden flex-1 min-h-0", children: body })
|
|
2427
2577
|
] })
|
|
2428
2578
|
] });
|
|
2429
2579
|
}
|
|
2430
|
-
return /* @__PURE__ */ (0,
|
|
2431
|
-
wrapTrigger(
|
|
2432
|
-
/* @__PURE__ */ (0,
|
|
2433
|
-
|
|
2580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system8.Popover, { open, onOpenChange: handleOpen, modal: false, children: [
|
|
2581
|
+
wrapTrigger(import_design_system8.PopoverTrigger),
|
|
2582
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2583
|
+
import_design_system8.PopoverContent,
|
|
2434
2584
|
{
|
|
2435
2585
|
...contentSide ? { side: contentSide } : fitHeight ? { side: "bottom" } : {},
|
|
2436
2586
|
align: "start",
|
|
@@ -2438,74 +2588,18 @@ function AgentListDropdown({
|
|
|
2438
2588
|
collisionPadding: 12,
|
|
2439
2589
|
sticky: "always",
|
|
2440
2590
|
...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
|
-
] })
|
|
2591
|
+
className: "p-0 overflow-hidden",
|
|
2592
|
+
style: { width: PANEL_WIDTH, height: fitHeight ?? PANEL_HEIGHT, maxHeight: fitHeight ?? LIST_MAX_HEIGHT },
|
|
2593
|
+
children: body
|
|
2500
2594
|
}
|
|
2501
2595
|
)
|
|
2502
2596
|
] });
|
|
2503
2597
|
}
|
|
2504
2598
|
|
|
2505
2599
|
// catalog/react/AgentListInlinePicker.tsx
|
|
2506
|
-
var
|
|
2507
|
-
var
|
|
2508
|
-
var
|
|
2600
|
+
var import_design_system9 = require("@ai-matrx/design-system");
|
|
2601
|
+
var import_react9 = require("react");
|
|
2602
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2509
2603
|
function AgentListInlinePicker({
|
|
2510
2604
|
consumerId,
|
|
2511
2605
|
onSelect,
|
|
@@ -2521,11 +2615,11 @@ function AgentListInlinePicker({
|
|
|
2521
2615
|
excludeAgentIds,
|
|
2522
2616
|
defaultMandateKey
|
|
2523
2617
|
}) {
|
|
2524
|
-
const inputRef = (0,
|
|
2525
|
-
const [catSearch, setCatSearch] = (0,
|
|
2526
|
-
const [tagSearch, setTagSearch] = (0,
|
|
2527
|
-
const [mobileDetailAgent, setMobileDetailAgent] = (0,
|
|
2528
|
-
const [mobileSubView, setMobileSubView] = (0,
|
|
2618
|
+
const inputRef = (0, import_react9.useRef)(null);
|
|
2619
|
+
const [catSearch, setCatSearch] = (0, import_react9.useState)("");
|
|
2620
|
+
const [tagSearch, setTagSearch] = (0, import_react9.useState)("");
|
|
2621
|
+
const [mobileDetailAgent, setMobileDetailAgent] = (0, import_react9.useState)(null);
|
|
2622
|
+
const [mobileSubView, setMobileSubView] = (0, import_react9.useState)(null);
|
|
2529
2623
|
const {
|
|
2530
2624
|
agents,
|
|
2531
2625
|
archivedHiddenCount,
|
|
@@ -2554,7 +2648,7 @@ function AgentListInlinePicker({
|
|
|
2554
2648
|
...excludeAgentIds ? { excludeAgentIds } : {},
|
|
2555
2649
|
...defaultMandateKey ? { defaultMandateKey } : {}
|
|
2556
2650
|
});
|
|
2557
|
-
(0,
|
|
2651
|
+
(0, import_react9.useEffect)(() => {
|
|
2558
2652
|
ensureLoaded();
|
|
2559
2653
|
if (!autoFocusSearch) return void 0;
|
|
2560
2654
|
const timer = setTimeout(() => inputRef.current?.focus(), 50);
|
|
@@ -2570,20 +2664,20 @@ function AgentListInlinePicker({
|
|
|
2570
2664
|
};
|
|
2571
2665
|
const isMobile = true;
|
|
2572
2666
|
if (mobileDetailAgent) {
|
|
2573
|
-
return /* @__PURE__ */ (0,
|
|
2574
|
-
/* @__PURE__ */ (0,
|
|
2667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: (0, import_design_system9.cn)("flex h-full min-h-0 flex-col", className), children: [
|
|
2668
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2575
2669
|
"button",
|
|
2576
2670
|
{
|
|
2577
2671
|
type: "button",
|
|
2578
2672
|
onClick: () => setMobileDetailAgent(null),
|
|
2579
2673
|
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
2674
|
children: [
|
|
2581
|
-
/* @__PURE__ */ (0,
|
|
2675
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronRightIcon, { className: "h-4 w-4 rotate-180" }),
|
|
2582
2676
|
"Back"
|
|
2583
2677
|
]
|
|
2584
2678
|
}
|
|
2585
2679
|
),
|
|
2586
|
-
/* @__PURE__ */ (0,
|
|
2680
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2587
2681
|
AgentDetailCard,
|
|
2588
2682
|
{
|
|
2589
2683
|
agent: mobileDetailAgent,
|
|
@@ -2593,7 +2687,7 @@ function AgentListInlinePicker({
|
|
|
2593
2687
|
] });
|
|
2594
2688
|
}
|
|
2595
2689
|
if (mobileSubView) {
|
|
2596
|
-
return /* @__PURE__ */ (0,
|
|
2690
|
+
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
2691
|
AgentMobileSubView,
|
|
2598
2692
|
{
|
|
2599
2693
|
view: mobileSubView,
|
|
@@ -2612,7 +2706,7 @@ function AgentListInlinePicker({
|
|
|
2612
2706
|
}
|
|
2613
2707
|
) });
|
|
2614
2708
|
}
|
|
2615
|
-
return /* @__PURE__ */ (0,
|
|
2709
|
+
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
2710
|
AgentListContent,
|
|
2617
2711
|
{
|
|
2618
2712
|
agents,
|