@docyrus/ui-pro-ai-assistant 0.1.7 → 0.1.9
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/README.md +5 -2
- package/dist/docy-assistant.d.ts +1 -1
- package/dist/index.js +616 -532
- package/dist/index.js.map +1 -1
- package/dist/internal/plate-editor/editor/plugins/code-block-base-kit.d.ts +2 -1
- package/dist/internal/plate-editor/editor/plugins/code-block-kit.d.ts +2 -1
- package/dist/styles.css +7 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/views/assistant-view.d.ts +2 -0
- package/package.json +3 -3
- package/dist/internal/plate-editor/editor/plugins/ai-kit.d.ts +0 -73
package/dist/index.js
CHANGED
|
@@ -2578,7 +2578,8 @@ function useAssistantApi({
|
|
|
2578
2578
|
const fetchThreads = useCallback(async () => {
|
|
2579
2579
|
try {
|
|
2580
2580
|
const apiParams = {
|
|
2581
|
-
columns: "id,subject,created_on,last_modified_on,body_text,tenant_ai_agent_id",
|
|
2581
|
+
columns: "id,subject,created_on,last_modified_on,body_text,tenant_ai_agent_id,created_by",
|
|
2582
|
+
expand: "created_by",
|
|
2582
2583
|
orderBy: JSON.stringify({ field: "created_on", direction: "desc" })
|
|
2583
2584
|
};
|
|
2584
2585
|
apiParams.filters = JSON.stringify({
|
|
@@ -2598,7 +2599,8 @@ function useAssistantApi({
|
|
|
2598
2599
|
title: item.subject,
|
|
2599
2600
|
messages: [],
|
|
2600
2601
|
createdAt: new Date(item.created_on),
|
|
2601
|
-
updatedAt: new Date(item.last_modified_on || item.created_on)
|
|
2602
|
+
updatedAt: new Date(item.last_modified_on || item.created_on),
|
|
2603
|
+
createdBy: item.created_by ?? null
|
|
2602
2604
|
}));
|
|
2603
2605
|
}
|
|
2604
2606
|
return [];
|
|
@@ -2610,13 +2612,14 @@ function useAssistantApi({
|
|
|
2610
2612
|
const fetchProjectThreads2 = useCallback(async (projectId) => {
|
|
2611
2613
|
try {
|
|
2612
2614
|
const apiParams = {
|
|
2613
|
-
columns: "id,subject,created_on,last_modified_on,body_text,tenant_ai_agent_id,tenant_ai_project_id
|
|
2615
|
+
columns: "id,subject,created_on,last_modified_on,body_text,tenant_ai_agent_id,tenant_ai_project_id,created_by",
|
|
2616
|
+
expand: "created_by",
|
|
2614
2617
|
orderBy: JSON.stringify({ field: "created_on", direction: "desc" })
|
|
2615
2618
|
};
|
|
2616
2619
|
apiParams.filters = JSON.stringify({
|
|
2617
2620
|
rules: [
|
|
2618
2621
|
{
|
|
2619
|
-
field: "tenant_ai_project_id
|
|
2622
|
+
field: "tenant_ai_project_id",
|
|
2620
2623
|
operator: "=",
|
|
2621
2624
|
value: projectId
|
|
2622
2625
|
}
|
|
@@ -2630,7 +2633,8 @@ function useAssistantApi({
|
|
|
2630
2633
|
title: item.subject,
|
|
2631
2634
|
messages: [],
|
|
2632
2635
|
createdAt: new Date(item.created_on),
|
|
2633
|
-
updatedAt: new Date(item.last_modified_on)
|
|
2636
|
+
updatedAt: new Date(item.last_modified_on),
|
|
2637
|
+
createdBy: item.created_by ?? null
|
|
2634
2638
|
}));
|
|
2635
2639
|
}
|
|
2636
2640
|
return [];
|
|
@@ -7168,7 +7172,7 @@ var MessageItem = memo(({
|
|
|
7168
7172
|
"flex items-start gap-3",
|
|
7169
7173
|
message.role === "user" && "flex-row-reverse"
|
|
7170
7174
|
), children: [
|
|
7171
|
-
isStreaming && isAssistantMessage ? /* @__PURE__ */ jsx(AssistantAnimations, { animationType: "working", className: "w-12 h-12 shrink-0" }) : /* @__PURE__ */ jsx(
|
|
7175
|
+
isStreaming && isAssistantMessage && !logo ? /* @__PURE__ */ jsx(AssistantAnimations, { animationType: "working", className: "w-12 h-12 shrink-0" }) : /* @__PURE__ */ jsx(
|
|
7172
7176
|
AIMessageAvatar,
|
|
7173
7177
|
{
|
|
7174
7178
|
src: message.role === "user" ? userPhoto || "" : logo || "",
|
|
@@ -7203,7 +7207,7 @@ var MessageList = memo(({
|
|
|
7203
7207
|
const lastMsgIdx = messages.length - 1;
|
|
7204
7208
|
return /* @__PURE__ */ jsx(AIConversation, { className: cn("flex-1", className), children: /* @__PURE__ */ jsxs(AIConversationContent, { className: "p-4 h-full", children: [
|
|
7205
7209
|
messages.length === 0 ? /* @__PURE__ */ jsx("div", { className: "h-full flex items-center justify-center", children: isLoadingAgent ? /* @__PURE__ */ jsx("div", { className: "p-2 bg-muted rounded-md", children: /* @__PURE__ */ jsx(Spinner, { className: "size-10 text-muted-foreground" }) }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center gap-3 text-center px-4", children: [
|
|
7206
|
-
/* @__PURE__ */ jsx(AssistantAnimations, { animationType: "opening", className: "w-32 h-32" }),
|
|
7210
|
+
logo ? /* @__PURE__ */ jsx(AIMessageAvatar, { src: logo, name: title || "Assistant", className: "w-20 h-20" }) : /* @__PURE__ */ jsx(AssistantAnimations, { animationType: "opening", className: "w-32 h-32" }),
|
|
7207
7211
|
title && /* @__PURE__ */ jsx("p", { className: "font-semibold text-base text-lg", children: title }),
|
|
7208
7212
|
/* @__PURE__ */ jsx("div", { className: "max-w-sm text-md text-muted-foreground", children: welcomeMessage ? /* @__PURE__ */ jsx(MessageResponse, { children: welcomeMessage }) : /* @__PURE__ */ jsx("p", { children: description || "Your AI-powered assistant for all your document needs." }) })
|
|
7209
7213
|
] }) }) : /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
@@ -7228,7 +7232,7 @@ var MessageList = memo(({
|
|
|
7228
7232
|
);
|
|
7229
7233
|
}),
|
|
7230
7234
|
isLoading && messages.length > 0 && messages[lastMsgIdx]?.role !== "assistant" && /* @__PURE__ */ jsx(Message, { from: "assistant", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
7231
|
-
/* @__PURE__ */ jsx(AssistantAnimations, { animationType: "thinking", className: "w-12 h-12 shrink-0" }),
|
|
7235
|
+
logo ? /* @__PURE__ */ jsx(AIMessageAvatar, { src: logo, name: "Assistant", isStreaming: true, className: "w-12 h-12 shrink-0" }) : /* @__PURE__ */ jsx(AssistantAnimations, { animationType: "thinking", className: "w-12 h-12 shrink-0" }),
|
|
7232
7236
|
/* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(Reasoning, { isStreaming: true, defaultOpen: true, className: "mb-0", children: /* @__PURE__ */ jsx(ReasoningTrigger, {}) }) })
|
|
7233
7237
|
] }) })
|
|
7234
7238
|
] }),
|
|
@@ -22433,560 +22437,579 @@ var AssistantView = ({ ref, ...props }) => {
|
|
|
22433
22437
|
onAgentChange,
|
|
22434
22438
|
hideCloseButton,
|
|
22435
22439
|
hideAgentSelector,
|
|
22440
|
+
hideBorder,
|
|
22441
|
+
showHeader = true,
|
|
22436
22442
|
t,
|
|
22437
22443
|
...commonProps
|
|
22438
22444
|
} = props;
|
|
22439
22445
|
if (!isOpen) return null;
|
|
22440
|
-
const content = /* @__PURE__ */
|
|
22446
|
+
const content = /* @__PURE__ */ jsx(
|
|
22441
22447
|
"div",
|
|
22442
22448
|
{
|
|
22443
22449
|
className: cn(
|
|
22444
|
-
"relative flex flex-col bg-background text-foreground
|
|
22450
|
+
"relative flex flex-col bg-background text-foreground @container",
|
|
22451
|
+
!hideBorder && "border shadow-sm",
|
|
22445
22452
|
isFullscreen ? "fixed inset-0 z-[9999] rounded-none h-screen" : "h-full min-h-0 overflow-hidden rounded-xl",
|
|
22446
22453
|
className
|
|
22447
22454
|
),
|
|
22448
22455
|
"data-render-mode": "inline",
|
|
22449
22456
|
ref,
|
|
22450
|
-
children:
|
|
22451
|
-
|
|
22452
|
-
|
|
22453
|
-
|
|
22457
|
+
children: (() => {
|
|
22458
|
+
const agentSelectorElement = (agentSelectorUrl || baseAgentSelectorUrl) && !hideAgentSelector ? /* @__PURE__ */ jsxs(
|
|
22459
|
+
DropdownMenu$1,
|
|
22460
|
+
{
|
|
22461
|
+
open: agentSelectorOpen,
|
|
22462
|
+
onOpenChange: (o) => {
|
|
22463
|
+
setAgentSelectorOpen(o);
|
|
22464
|
+
if (!o) setAgentSearch("");
|
|
22465
|
+
},
|
|
22466
|
+
children: [
|
|
22454
22467
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
22455
22468
|
Button,
|
|
22456
22469
|
{
|
|
22457
22470
|
variant: "ghost",
|
|
22458
|
-
|
|
22459
|
-
className: "h-8 w-8 rounded-md hover:bg-accent relative overflow-hidden group",
|
|
22471
|
+
className: "h-8 px-2 gap-1.5 text-sm font-medium text-foreground hover:bg-accent rounded-md max-w-[260px]",
|
|
22460
22472
|
children: [
|
|
22461
|
-
/* @__PURE__ */
|
|
22462
|
-
"
|
|
22463
|
-
{
|
|
22464
|
-
|
|
22465
|
-
|
|
22466
|
-
|
|
22467
|
-
),
|
|
22468
|
-
/* @__PURE__ */ jsx(Sparkles, { className: "w-4 h-4 text-brown-500 relative z-10" })
|
|
22473
|
+
(activeAgent?.avatar || commonProps.logo) && /* @__PURE__ */ jsxs(Avatar$1, { className: "w-5 h-5 shrink-0", children: [
|
|
22474
|
+
/* @__PURE__ */ jsx(AvatarImage$1, { src: activeAgent?.avatar || commonProps.logo, alt: activeAgent?.name ?? commonProps.title ?? "Assistant" }),
|
|
22475
|
+
/* @__PURE__ */ jsx(AvatarFallback$1, { className: "text-[10px]", children: (activeAgent?.name ?? commonProps.title ?? "A").slice(0, 2).toUpperCase() })
|
|
22476
|
+
] }),
|
|
22477
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: activeAgent?.name ?? commonProps.title ?? "Assistant" }),
|
|
22478
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "w-3 h-3 shrink-0 text-muted-foreground" })
|
|
22469
22479
|
]
|
|
22470
22480
|
}
|
|
22471
22481
|
) }),
|
|
22472
|
-
/* @__PURE__ */ jsxs(
|
|
22473
|
-
|
|
22474
|
-
|
|
22475
|
-
|
|
22476
|
-
|
|
22477
|
-
|
|
22478
|
-
|
|
22479
|
-
|
|
22480
|
-
|
|
22481
|
-
|
|
22482
|
-
|
|
22483
|
-
|
|
22484
|
-
|
|
22485
|
-
|
|
22486
|
-
|
|
22487
|
-
|
|
22488
|
-
|
|
22489
|
-
|
|
22490
|
-
|
|
22491
|
-
|
|
22492
|
-
|
|
22493
|
-
|
|
22494
|
-
className: "
|
|
22495
|
-
|
|
22496
|
-
|
|
22497
|
-
|
|
22498
|
-
|
|
22499
|
-
|
|
22500
|
-
|
|
22501
|
-
|
|
22502
|
-
|
|
22503
|
-
|
|
22504
|
-
|
|
22505
|
-
|
|
22506
|
-
|
|
22507
|
-
|
|
22508
|
-
|
|
22509
|
-
|
|
22510
|
-
|
|
22511
|
-
|
|
22512
|
-
|
|
22513
|
-
|
|
22514
|
-
|
|
22515
|
-
children: [
|
|
22516
|
-
/* @__PURE__ */ jsx(
|
|
22517
|
-
/* @__PURE__ */ jsx(
|
|
22518
|
-
|
|
22519
|
-
|
|
22520
|
-
|
|
22521
|
-
|
|
22522
|
-
|
|
22523
|
-
|
|
22524
|
-
|
|
22525
|
-
|
|
22526
|
-
|
|
22527
|
-
|
|
22528
|
-
|
|
22529
|
-
|
|
22530
|
-
|
|
22531
|
-
|
|
22532
|
-
|
|
22533
|
-
|
|
22534
|
-
|
|
22535
|
-
|
|
22536
|
-
|
|
22537
|
-
|
|
22538
|
-
|
|
22539
|
-
|
|
22540
|
-
|
|
22541
|
-
|
|
22542
|
-
|
|
22543
|
-
|
|
22544
|
-
|
|
22545
|
-
|
|
22546
|
-
filteredBaseAgents.map((agent) => /* @__PURE__ */ jsxs(
|
|
22547
|
-
DropdownMenuItem,
|
|
22548
|
-
{
|
|
22549
|
-
className: "cursor-pointer gap-2 px-3 py-2",
|
|
22550
|
-
onClick: () => {
|
|
22551
|
-
setSelectedAgent(agent);
|
|
22552
|
-
setAgentSelectorOpen(false);
|
|
22553
|
-
setAgentSearch("");
|
|
22554
|
-
onAgentChange?.(agent.id, "base");
|
|
22555
|
-
},
|
|
22556
|
-
children: [
|
|
22557
|
-
agent.avatar ? /* @__PURE__ */ jsx("img", { src: typeof agent.avatar === "string" ? agent.avatar : agent.avatar?.signed_url, alt: "", className: "w-5 h-5 rounded-full shrink-0 object-cover" }) : /* @__PURE__ */ jsx("div", { className: "w-5 h-5 rounded-full shrink-0 bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsx(Brain, { className: "w-3 h-3 text-muted-foreground" }) }),
|
|
22558
|
-
/* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: agent.name })
|
|
22559
|
-
]
|
|
22560
|
-
},
|
|
22561
|
-
agent.id
|
|
22562
|
-
))
|
|
22563
|
-
] }),
|
|
22564
|
-
filteredDeployedAgents.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22565
|
-
filteredBaseAgents.length > 0 && /* @__PURE__ */ jsx(DropdownMenuSeparator$1, {}),
|
|
22566
|
-
/* @__PURE__ */ jsx("div", { className: "px-3 py-1.5 text-xs font-medium text-muted-foreground", children: "Deployed Agents" }),
|
|
22567
|
-
filteredDeployedAgents.map((agent) => /* @__PURE__ */ jsxs(
|
|
22568
|
-
DropdownMenuItem,
|
|
22569
|
-
{
|
|
22570
|
-
className: "cursor-pointer gap-2 px-3 py-2",
|
|
22571
|
-
onClick: () => {
|
|
22572
|
-
setSelectedAgent(agent);
|
|
22573
|
-
setAgentSelectorOpen(false);
|
|
22574
|
-
setAgentSearch("");
|
|
22575
|
-
onAgentChange?.(agent.id, "deployment");
|
|
22576
|
-
},
|
|
22577
|
-
children: [
|
|
22578
|
-
agent.avatar ? /* @__PURE__ */ jsx("img", { src: typeof agent.avatar === "string" ? agent.avatar : agent.avatar?.signed_url, alt: "", className: "w-5 h-5 rounded-full shrink-0 object-cover" }) : /* @__PURE__ */ jsx("div", { className: "w-5 h-5 rounded-full shrink-0 bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsx(Brain, { className: "w-3 h-3 text-muted-foreground" }) }),
|
|
22579
|
-
/* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: agent.name })
|
|
22580
|
-
]
|
|
22581
|
-
},
|
|
22582
|
-
agent.id
|
|
22583
|
-
))
|
|
22584
|
-
] })
|
|
22585
|
-
] }) })
|
|
22586
|
-
]
|
|
22587
|
-
}
|
|
22588
|
-
)
|
|
22589
|
-
]
|
|
22590
|
-
}
|
|
22591
|
-
) : /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: activeAgent?.name ?? commonProps.title ?? "Assistant" })
|
|
22592
|
-
] }),
|
|
22593
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
22594
|
-
enableNavDropdown && onNewChat && /* @__PURE__ */ jsx(
|
|
22595
|
-
Button,
|
|
22596
|
-
{
|
|
22597
|
-
variant: "ghost",
|
|
22598
|
-
size: "icon",
|
|
22599
|
-
className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
|
|
22600
|
-
onClick: onNewChat,
|
|
22601
|
-
title: t("buttons.start_new_thread"),
|
|
22602
|
-
children: /* @__PURE__ */ jsx(Edit, { className: "w-4 h-4" })
|
|
22603
|
-
}
|
|
22604
|
-
),
|
|
22605
|
-
onExpand && /* @__PURE__ */ jsx(
|
|
22606
|
-
Button,
|
|
22607
|
-
{
|
|
22608
|
-
variant: "ghost",
|
|
22609
|
-
size: "icon",
|
|
22610
|
-
className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
|
|
22611
|
-
onClick: onExpand,
|
|
22612
|
-
title: isFullscreen ? t("actions.minimize") : t("actions.expand_fullscreen"),
|
|
22613
|
-
children: isFullscreen ? /* @__PURE__ */ jsx(Minimize2, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx(Maximize2, { className: "w-4 h-4" })
|
|
22614
|
-
}
|
|
22615
|
-
),
|
|
22616
|
-
!hideCloseButton && /* @__PURE__ */ jsx(
|
|
22617
|
-
Button,
|
|
22618
|
-
{
|
|
22619
|
-
variant: "ghost",
|
|
22620
|
-
size: "icon",
|
|
22621
|
-
className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
|
|
22622
|
-
onClick: () => onClose?.(),
|
|
22623
|
-
title: t("common.close"),
|
|
22624
|
-
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
22625
|
-
}
|
|
22626
|
-
)
|
|
22627
|
-
] })
|
|
22628
|
-
] }),
|
|
22629
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-row min-h-0 overflow-hidden relative", children: [
|
|
22630
|
-
!isSidebarOpen && /* @__PURE__ */ jsxs("div", { className: "absolute top-2 left-2 z-40 flex flex-col gap-1", children: [
|
|
22631
|
-
enableSidebar && onToggleSidebar && /* @__PURE__ */ jsx(
|
|
22632
|
-
Button,
|
|
22633
|
-
{
|
|
22634
|
-
variant: "ghost",
|
|
22635
|
-
size: "icon",
|
|
22636
|
-
onClick: onToggleSidebar,
|
|
22637
|
-
className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md shadow-sm",
|
|
22638
|
-
title: t("tabs.sessions"),
|
|
22639
|
-
children: /* @__PURE__ */ jsx(PanelLeft, { className: "w-4 h-4" })
|
|
22640
|
-
}
|
|
22641
|
-
),
|
|
22642
|
-
onTabChange && /* @__PURE__ */ jsx(
|
|
22643
|
-
Button,
|
|
22644
|
-
{
|
|
22645
|
-
variant: "ghost",
|
|
22646
|
-
size: "icon",
|
|
22647
|
-
onClick: () => onTabChange(activeTab === 4 ? 0 : 4),
|
|
22648
|
-
className: cn(
|
|
22649
|
-
"h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md shadow-sm",
|
|
22650
|
-
activeTab === 4 && "bg-background text-foreground shadow"
|
|
22651
|
-
),
|
|
22652
|
-
title: t("tabs.memories"),
|
|
22653
|
-
children: /* @__PURE__ */ jsx(Brain, { className: "w-4 h-4" })
|
|
22654
|
-
}
|
|
22655
|
-
),
|
|
22656
|
-
isFullscreen && onNewChat && /* @__PURE__ */ jsx(
|
|
22657
|
-
Button,
|
|
22658
|
-
{
|
|
22659
|
-
variant: "ghost",
|
|
22660
|
-
size: "icon",
|
|
22661
|
-
onClick: onNewChat,
|
|
22662
|
-
className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md shadow-sm",
|
|
22663
|
-
title: t("buttons.start_new_thread"),
|
|
22664
|
-
children: /* @__PURE__ */ jsx(Edit, { className: "w-4 h-4" })
|
|
22665
|
-
}
|
|
22666
|
-
)
|
|
22482
|
+
/* @__PURE__ */ jsxs(
|
|
22483
|
+
DropdownMenuContent,
|
|
22484
|
+
{
|
|
22485
|
+
align: "start",
|
|
22486
|
+
className: cn("w-64 p-0", isFullscreen && "z-[10000]"),
|
|
22487
|
+
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
22488
|
+
children: [
|
|
22489
|
+
/* @__PURE__ */ jsx("div", { className: "p-2 border-b", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
22490
|
+
/* @__PURE__ */ jsx(Search, { className: "absolute left-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground pointer-events-none" }),
|
|
22491
|
+
/* @__PURE__ */ jsx(
|
|
22492
|
+
Input,
|
|
22493
|
+
{
|
|
22494
|
+
ref: agentSearchRef,
|
|
22495
|
+
value: agentSearch,
|
|
22496
|
+
onChange: (e) => setAgentSearch(e.target.value),
|
|
22497
|
+
onKeyDown: (e) => e.stopPropagation(),
|
|
22498
|
+
placeholder: "Search agents...",
|
|
22499
|
+
className: "h-7 pl-7 text-sm",
|
|
22500
|
+
autoFocus: true
|
|
22501
|
+
}
|
|
22502
|
+
)
|
|
22503
|
+
] }) }),
|
|
22504
|
+
/* @__PURE__ */ jsx(ScrollArea, { className: "max-h-56", children: agentsLoading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ jsx(Loader2, { className: "w-4 h-4 animate-spin text-muted-foreground" }) }) : !hasAnyAgents ? /* @__PURE__ */ jsx("div", { className: "py-4 text-center text-xs text-muted-foreground", children: "No agents found" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22505
|
+
filteredBaseAgents.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22506
|
+
/* @__PURE__ */ jsx("div", { className: "px-3 py-1.5 text-xs font-medium text-muted-foreground", children: "Base Agents" }),
|
|
22507
|
+
filteredBaseAgents.map((agent) => /* @__PURE__ */ jsxs(
|
|
22508
|
+
DropdownMenuItem,
|
|
22509
|
+
{
|
|
22510
|
+
className: "cursor-pointer gap-2 px-3 py-2",
|
|
22511
|
+
onClick: () => {
|
|
22512
|
+
setSelectedAgent(agent);
|
|
22513
|
+
setAgentSelectorOpen(false);
|
|
22514
|
+
setAgentSearch("");
|
|
22515
|
+
onAgentChange?.(agent.id, "base");
|
|
22516
|
+
},
|
|
22517
|
+
children: [
|
|
22518
|
+
agent.avatar ? /* @__PURE__ */ jsx("img", { src: typeof agent.avatar === "string" ? agent.avatar : agent.avatar?.signed_url, alt: "", className: "w-5 h-5 rounded-full shrink-0 object-cover" }) : /* @__PURE__ */ jsx("div", { className: "w-5 h-5 rounded-full shrink-0 bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsx(Brain, { className: "w-3 h-3 text-muted-foreground" }) }),
|
|
22519
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: agent.name })
|
|
22520
|
+
]
|
|
22521
|
+
},
|
|
22522
|
+
agent.id
|
|
22523
|
+
))
|
|
22524
|
+
] }),
|
|
22525
|
+
filteredDeployedAgents.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22526
|
+
filteredBaseAgents.length > 0 && /* @__PURE__ */ jsx(DropdownMenuSeparator$1, {}),
|
|
22527
|
+
/* @__PURE__ */ jsx("div", { className: "px-3 py-1.5 text-xs font-medium text-muted-foreground", children: "Deployed Agents" }),
|
|
22528
|
+
filteredDeployedAgents.map((agent) => /* @__PURE__ */ jsxs(
|
|
22529
|
+
DropdownMenuItem,
|
|
22530
|
+
{
|
|
22531
|
+
className: "cursor-pointer gap-2 px-3 py-2",
|
|
22532
|
+
onClick: () => {
|
|
22533
|
+
setSelectedAgent(agent);
|
|
22534
|
+
setAgentSelectorOpen(false);
|
|
22535
|
+
setAgentSearch("");
|
|
22536
|
+
onAgentChange?.(agent.id, "deployment");
|
|
22537
|
+
},
|
|
22538
|
+
children: [
|
|
22539
|
+
agent.avatar ? /* @__PURE__ */ jsx("img", { src: typeof agent.avatar === "string" ? agent.avatar : agent.avatar?.signed_url, alt: "", className: "w-5 h-5 rounded-full shrink-0 object-cover" }) : /* @__PURE__ */ jsx("div", { className: "w-5 h-5 rounded-full shrink-0 bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsx(Brain, { className: "w-3 h-3 text-muted-foreground" }) }),
|
|
22540
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: agent.name })
|
|
22541
|
+
]
|
|
22542
|
+
},
|
|
22543
|
+
agent.id
|
|
22544
|
+
))
|
|
22545
|
+
] })
|
|
22546
|
+
] }) })
|
|
22547
|
+
]
|
|
22548
|
+
}
|
|
22549
|
+
)
|
|
22550
|
+
]
|
|
22551
|
+
}
|
|
22552
|
+
) : !hideAgentSelector ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5 text-sm font-medium text-foreground", children: [
|
|
22553
|
+
(activeAgent?.avatar || commonProps.logo) && /* @__PURE__ */ jsxs(Avatar$1, { className: "w-5 h-5 shrink-0", children: [
|
|
22554
|
+
/* @__PURE__ */ jsx(AvatarImage$1, { src: activeAgent?.avatar || commonProps.logo, alt: activeAgent?.name ?? commonProps.title ?? "Assistant" }),
|
|
22555
|
+
/* @__PURE__ */ jsx(AvatarFallback$1, { className: "text-[10px]", children: (activeAgent?.name ?? commonProps.title ?? "A").slice(0, 2).toUpperCase() })
|
|
22667
22556
|
] }),
|
|
22668
|
-
|
|
22669
|
-
|
|
22670
|
-
|
|
22671
|
-
|
|
22672
|
-
|
|
22673
|
-
|
|
22674
|
-
|
|
22675
|
-
),
|
|
22676
|
-
/* @__PURE__ */ jsx("div", { className: "absolute left-0 top-0 h-full w-72 bg-background z-[100] shadow-xl border-r @3xl:hidden", children: /* @__PURE__ */ jsxs("div", { className: "w-full h-full flex flex-col", children: [
|
|
22677
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between h-12 px-3 border-b shrink-0", children: [
|
|
22678
|
-
commonProps.logo || commonProps.title ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
22679
|
-
/* @__PURE__ */ jsxs(Avatar$1, { className: "h-7 w-7 shrink-0 after:hidden", children: [
|
|
22680
|
-
/* @__PURE__ */ jsx(AvatarImage$1, { src: commonProps.logo, alt: commonProps.title }),
|
|
22681
|
-
/* @__PURE__ */ jsx(AvatarFallback$1, { className: "text-xs", children: (commonProps.title || "AI").substring(0, 2).toUpperCase() })
|
|
22682
|
-
] }),
|
|
22683
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium truncate", children: commonProps.title })
|
|
22684
|
-
] }) : /* @__PURE__ */ jsx("div", {}),
|
|
22685
|
-
/* @__PURE__ */ jsx(
|
|
22557
|
+
activeAgent?.name ?? commonProps.title ?? "Assistant"
|
|
22558
|
+
] }) : null;
|
|
22559
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22560
|
+
showHeader && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between h-12 px-3 border-b shrink-0", children: [
|
|
22561
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
22562
|
+
enableNavDropdown && /* @__PURE__ */ jsxs(DropdownMenu$1, { children: [
|
|
22563
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
22686
22564
|
Button,
|
|
22687
22565
|
{
|
|
22688
22566
|
variant: "ghost",
|
|
22689
22567
|
size: "icon",
|
|
22690
|
-
|
|
22691
|
-
|
|
22692
|
-
|
|
22568
|
+
className: "h-8 w-8 rounded-md hover:bg-accent relative overflow-hidden group",
|
|
22569
|
+
children: [
|
|
22570
|
+
/* @__PURE__ */ jsx(
|
|
22571
|
+
"span",
|
|
22572
|
+
{
|
|
22573
|
+
className: "pointer-events-none absolute inset-0 -translate-x-full bg-gradient-to-r from-transparent via-violet-200/60 to-transparent group-hover:translate-x-full transition-transform duration-700 ease-in-out",
|
|
22574
|
+
"aria-hidden": "true"
|
|
22575
|
+
}
|
|
22576
|
+
),
|
|
22577
|
+
/* @__PURE__ */ jsx(Sparkles, { className: "w-4 h-4 text-brown-500 relative z-10" })
|
|
22578
|
+
]
|
|
22693
22579
|
}
|
|
22694
|
-
)
|
|
22695
|
-
|
|
22696
|
-
|
|
22697
|
-
|
|
22698
|
-
] }),
|
|
22699
|
-
enableSidebar && renderSidebar && /* @__PURE__ */ jsx(
|
|
22700
|
-
"div",
|
|
22701
|
-
{
|
|
22702
|
-
className: cn(
|
|
22703
|
-
"hidden @3xl:flex flex-col flex-none bg-background border-r transition-all duration-300 overflow-hidden",
|
|
22704
|
-
isSidebarOpen ? "w-72" : "w-0"
|
|
22705
|
-
),
|
|
22706
|
-
children: /* @__PURE__ */ jsxs("div", { className: "w-72 h-full flex flex-col relative", children: [
|
|
22707
|
-
isSidebarOpen && /* @__PURE__ */ jsxs("div", { className: "absolute top-2 right-2 z-10 flex flex-col gap-1", children: [
|
|
22708
|
-
onToggleSidebar && /* @__PURE__ */ jsx(
|
|
22709
|
-
Button,
|
|
22580
|
+
) }),
|
|
22581
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", className: cn("w-40", isFullscreen && "z-[10000]"), children: [
|
|
22582
|
+
/* @__PURE__ */ jsx(
|
|
22583
|
+
DropdownMenuItem,
|
|
22710
22584
|
{
|
|
22711
|
-
|
|
22712
|
-
|
|
22713
|
-
|
|
22714
|
-
className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
|
|
22715
|
-
children: /* @__PURE__ */ jsx(PanelLeft, { className: "w-4 h-4" })
|
|
22585
|
+
className: "cursor-pointer",
|
|
22586
|
+
onClick: () => onTabChange?.(activeTab === 1 ? 0 : 1),
|
|
22587
|
+
children: t("tabs.sessions")
|
|
22716
22588
|
}
|
|
22717
22589
|
),
|
|
22718
|
-
|
|
22719
|
-
|
|
22590
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator$1, {}),
|
|
22591
|
+
/* @__PURE__ */ jsx(
|
|
22592
|
+
DropdownMenuItem,
|
|
22720
22593
|
{
|
|
22721
|
-
|
|
22722
|
-
|
|
22723
|
-
|
|
22724
|
-
|
|
22725
|
-
|
|
22726
|
-
|
|
22727
|
-
|
|
22728
|
-
|
|
22729
|
-
|
|
22594
|
+
className: "cursor-pointer",
|
|
22595
|
+
onClick: () => onTabChange?.(activeTab === 2 ? 0 : 2),
|
|
22596
|
+
children: t("sections.projects")
|
|
22597
|
+
}
|
|
22598
|
+
),
|
|
22599
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator$1, {}),
|
|
22600
|
+
/* @__PURE__ */ jsx(
|
|
22601
|
+
DropdownMenuItem,
|
|
22602
|
+
{
|
|
22603
|
+
className: "cursor-pointer",
|
|
22604
|
+
onClick: () => onTabChange?.(activeTab === 3 ? 0 : 3),
|
|
22605
|
+
children: t("tabs.works")
|
|
22730
22606
|
}
|
|
22731
22607
|
)
|
|
22732
|
-
] })
|
|
22733
|
-
|
|
22734
|
-
|
|
22735
|
-
}
|
|
22736
|
-
|
|
22737
|
-
|
|
22738
|
-
"flex flex-col min-h-0 overflow-hidden transition-all duration-200",
|
|
22739
|
-
canvasWork ? "w-2/5" : "flex-1",
|
|
22740
|
-
!isSidebarOpen && enableSidebar && "pl-10"
|
|
22741
|
-
), children: activeTab === 1 ? (
|
|
22742
|
-
// Sessions View
|
|
22743
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
|
|
22744
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
|
|
22608
|
+
] })
|
|
22609
|
+
] }),
|
|
22610
|
+
agentSelectorElement
|
|
22611
|
+
] }),
|
|
22612
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
22613
|
+
enableNavDropdown && onNewChat && /* @__PURE__ */ jsx(
|
|
22745
22614
|
Button,
|
|
22746
22615
|
{
|
|
22747
22616
|
variant: "ghost",
|
|
22748
22617
|
size: "icon",
|
|
22749
|
-
className: "h-
|
|
22750
|
-
onClick:
|
|
22751
|
-
|
|
22618
|
+
className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
|
|
22619
|
+
onClick: onNewChat,
|
|
22620
|
+
title: t("buttons.start_new_thread"),
|
|
22621
|
+
children: /* @__PURE__ */ jsx(Edit, { className: "w-4 h-4" })
|
|
22752
22622
|
}
|
|
22753
|
-
)
|
|
22754
|
-
|
|
22755
|
-
] })
|
|
22756
|
-
) : activeTab === 2 ? (
|
|
22757
|
-
// Projects View
|
|
22758
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
|
|
22759
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
|
|
22623
|
+
),
|
|
22624
|
+
onExpand && /* @__PURE__ */ jsx(
|
|
22760
22625
|
Button,
|
|
22761
22626
|
{
|
|
22762
22627
|
variant: "ghost",
|
|
22763
22628
|
size: "icon",
|
|
22764
|
-
className: "h-
|
|
22765
|
-
onClick:
|
|
22766
|
-
|
|
22629
|
+
className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
|
|
22630
|
+
onClick: onExpand,
|
|
22631
|
+
title: isFullscreen ? t("actions.minimize") : t("actions.expand_fullscreen"),
|
|
22632
|
+
children: isFullscreen ? /* @__PURE__ */ jsx(Minimize2, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx(Maximize2, { className: "w-4 h-4" })
|
|
22767
22633
|
}
|
|
22768
|
-
)
|
|
22769
|
-
|
|
22770
|
-
] })
|
|
22771
|
-
) : activeTab === 4 ? (
|
|
22772
|
-
// Memories View
|
|
22773
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
|
|
22774
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
|
|
22634
|
+
),
|
|
22635
|
+
!hideCloseButton && /* @__PURE__ */ jsx(
|
|
22775
22636
|
Button,
|
|
22776
22637
|
{
|
|
22777
22638
|
variant: "ghost",
|
|
22778
22639
|
size: "icon",
|
|
22779
|
-
className: "h-
|
|
22780
|
-
onClick: () =>
|
|
22781
|
-
|
|
22640
|
+
className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
|
|
22641
|
+
onClick: () => onClose?.(),
|
|
22642
|
+
title: t("common.close"),
|
|
22643
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
22782
22644
|
}
|
|
22783
|
-
)
|
|
22784
|
-
renderMemoriesView ? renderMemoriesView() : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground", children: "Memories view not available" })
|
|
22645
|
+
)
|
|
22785
22646
|
] })
|
|
22786
|
-
)
|
|
22787
|
-
|
|
22788
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
22789
|
-
|
|
22647
|
+
] }),
|
|
22648
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-row min-h-0 overflow-hidden relative", children: [
|
|
22649
|
+
!isSidebarOpen && /* @__PURE__ */ jsxs("div", { className: "absolute top-2 left-2 z-40 flex flex-col gap-1", children: [
|
|
22650
|
+
enableSidebar && onToggleSidebar && /* @__PURE__ */ jsx(
|
|
22790
22651
|
Button,
|
|
22791
22652
|
{
|
|
22792
22653
|
variant: "ghost",
|
|
22793
22654
|
size: "icon",
|
|
22794
|
-
|
|
22795
|
-
|
|
22796
|
-
|
|
22655
|
+
onClick: onToggleSidebar,
|
|
22656
|
+
className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md shadow-sm",
|
|
22657
|
+
title: t("tabs.sessions"),
|
|
22658
|
+
children: /* @__PURE__ */ jsx(PanelLeft, { className: "w-4 h-4" })
|
|
22797
22659
|
}
|
|
22798
|
-
)
|
|
22799
|
-
|
|
22800
|
-
|
|
22801
|
-
|
|
22802
|
-
|
|
22803
|
-
|
|
22804
|
-
|
|
22660
|
+
),
|
|
22661
|
+
onTabChange && /* @__PURE__ */ jsx(
|
|
22662
|
+
Button,
|
|
22663
|
+
{
|
|
22664
|
+
variant: "ghost",
|
|
22665
|
+
size: "icon",
|
|
22666
|
+
onClick: () => onTabChange(activeTab === 4 ? 0 : 4),
|
|
22667
|
+
className: cn(
|
|
22668
|
+
"h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md shadow-sm",
|
|
22669
|
+
activeTab === 4 && "bg-background text-foreground shadow"
|
|
22670
|
+
),
|
|
22671
|
+
title: t("tabs.memories"),
|
|
22672
|
+
children: /* @__PURE__ */ jsx(Brain, { className: "w-4 h-4" })
|
|
22673
|
+
}
|
|
22674
|
+
),
|
|
22675
|
+
isFullscreen && onNewChat && /* @__PURE__ */ jsx(
|
|
22676
|
+
Button,
|
|
22677
|
+
{
|
|
22678
|
+
variant: "ghost",
|
|
22679
|
+
size: "icon",
|
|
22680
|
+
onClick: onNewChat,
|
|
22681
|
+
className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md shadow-sm",
|
|
22682
|
+
title: t("buttons.start_new_thread"),
|
|
22683
|
+
children: /* @__PURE__ */ jsx(Edit, { className: "w-4 h-4" })
|
|
22684
|
+
}
|
|
22685
|
+
)
|
|
22686
|
+
] }),
|
|
22687
|
+
enableSidebar && isSidebarOpen && renderSidebar && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22688
|
+
/* @__PURE__ */ jsx(
|
|
22689
|
+
"div",
|
|
22690
|
+
{
|
|
22691
|
+
className: "absolute inset-0 bg-black/20 z-[99] @3xl:hidden",
|
|
22692
|
+
onClick: onToggleSidebar
|
|
22693
|
+
}
|
|
22694
|
+
),
|
|
22695
|
+
/* @__PURE__ */ jsx("div", { className: "absolute left-0 top-0 h-full w-72 bg-background z-[100] shadow-xl border-r @3xl:hidden", children: /* @__PURE__ */ jsxs("div", { className: "w-full h-full flex flex-col", children: [
|
|
22696
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between h-12 px-3 border-b shrink-0", children: [
|
|
22697
|
+
commonProps.logo || commonProps.title ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
22698
|
+
/* @__PURE__ */ jsxs(Avatar$1, { className: "h-7 w-7 shrink-0 after:hidden", children: [
|
|
22699
|
+
/* @__PURE__ */ jsx(AvatarImage$1, { src: commonProps.logo, alt: commonProps.title }),
|
|
22700
|
+
/* @__PURE__ */ jsx(AvatarFallback$1, { className: "text-xs", children: (commonProps.title || "AI").substring(0, 2).toUpperCase() })
|
|
22701
|
+
] }),
|
|
22702
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium truncate", children: commonProps.title })
|
|
22703
|
+
] }) : /* @__PURE__ */ jsx("div", {}),
|
|
22704
|
+
/* @__PURE__ */ jsx(
|
|
22705
|
+
Button,
|
|
22706
|
+
{
|
|
22707
|
+
variant: "ghost",
|
|
22708
|
+
size: "icon",
|
|
22709
|
+
onClick: onToggleSidebar,
|
|
22710
|
+
className: "h-8 w-8 shrink-0 text-muted-foreground hover:text-foreground",
|
|
22711
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
22712
|
+
}
|
|
22713
|
+
)
|
|
22714
|
+
] }),
|
|
22715
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 p-4 flex flex-col min-h-0 overflow-hidden", children: renderSidebar(true) })
|
|
22716
|
+
] }) })
|
|
22717
|
+
] }),
|
|
22718
|
+
enableSidebar && renderSidebar && /* @__PURE__ */ jsx(
|
|
22719
|
+
"div",
|
|
22805
22720
|
{
|
|
22806
|
-
|
|
22807
|
-
|
|
22808
|
-
|
|
22809
|
-
|
|
22810
|
-
|
|
22811
|
-
|
|
22812
|
-
|
|
22813
|
-
|
|
22814
|
-
|
|
22815
|
-
|
|
22816
|
-
|
|
22817
|
-
|
|
22818
|
-
|
|
22819
|
-
|
|
22820
|
-
|
|
22821
|
-
|
|
22822
|
-
|
|
22823
|
-
|
|
22824
|
-
|
|
22825
|
-
|
|
22826
|
-
|
|
22827
|
-
|
|
22828
|
-
|
|
22829
|
-
|
|
22830
|
-
|
|
22831
|
-
|
|
22832
|
-
|
|
22833
|
-
|
|
22834
|
-
|
|
22835
|
-
|
|
22836
|
-
|
|
22837
|
-
|
|
22838
|
-
|
|
22839
|
-
|
|
22721
|
+
className: cn(
|
|
22722
|
+
"hidden @3xl:flex flex-col flex-none bg-background border-r transition-all duration-300 overflow-hidden",
|
|
22723
|
+
isSidebarOpen ? "w-72" : "w-0"
|
|
22724
|
+
),
|
|
22725
|
+
children: /* @__PURE__ */ jsxs("div", { className: "w-72 h-full flex flex-col relative", children: [
|
|
22726
|
+
isSidebarOpen && /* @__PURE__ */ jsxs("div", { className: "absolute top-2 right-2 z-10 flex flex-col gap-1", children: [
|
|
22727
|
+
onToggleSidebar && /* @__PURE__ */ jsx(
|
|
22728
|
+
Button,
|
|
22729
|
+
{
|
|
22730
|
+
variant: "ghost",
|
|
22731
|
+
size: "icon",
|
|
22732
|
+
onClick: onToggleSidebar,
|
|
22733
|
+
className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
|
|
22734
|
+
children: /* @__PURE__ */ jsx(PanelLeft, { className: "w-4 h-4" })
|
|
22735
|
+
}
|
|
22736
|
+
),
|
|
22737
|
+
onTabChange && /* @__PURE__ */ jsx(
|
|
22738
|
+
Button,
|
|
22739
|
+
{
|
|
22740
|
+
variant: "ghost",
|
|
22741
|
+
size: "icon",
|
|
22742
|
+
onClick: () => onTabChange(activeTab === 4 ? 0 : 4),
|
|
22743
|
+
className: cn(
|
|
22744
|
+
"h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
|
|
22745
|
+
activeTab === 4 && "bg-accent text-accent-foreground"
|
|
22746
|
+
),
|
|
22747
|
+
title: t("tabs.memories"),
|
|
22748
|
+
children: /* @__PURE__ */ jsx(Brain, { className: "w-4 h-4" })
|
|
22749
|
+
}
|
|
22750
|
+
)
|
|
22751
|
+
] }),
|
|
22752
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 p-4 flex flex-col min-h-0 overflow-hidden", children: [
|
|
22753
|
+
!showHeader && agentSelectorElement && /* @__PURE__ */ jsx("div", { className: "mb-3 shrink-0", children: agentSelectorElement }),
|
|
22754
|
+
renderSidebar(false)
|
|
22755
|
+
] })
|
|
22756
|
+
] })
|
|
22840
22757
|
}
|
|
22841
|
-
)
|
|
22842
|
-
|
|
22843
|
-
|
|
22844
|
-
|
|
22845
|
-
|
|
22846
|
-
|
|
22847
|
-
|
|
22758
|
+
),
|
|
22759
|
+
/* @__PURE__ */ jsx("div", { className: cn(
|
|
22760
|
+
"flex flex-col min-h-0 overflow-hidden transition-all duration-200",
|
|
22761
|
+
canvasWork ? "w-2/5" : "flex-1",
|
|
22762
|
+
!isSidebarOpen && enableSidebar && "pl-10"
|
|
22763
|
+
), children: activeTab === 1 ? (
|
|
22764
|
+
// Sessions View
|
|
22765
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
|
|
22766
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
|
|
22848
22767
|
Button,
|
|
22849
22768
|
{
|
|
22850
22769
|
variant: "ghost",
|
|
22851
|
-
size: "
|
|
22852
|
-
className:
|
|
22853
|
-
|
|
22854
|
-
|
|
22855
|
-
),
|
|
22856
|
-
onClick: () => setActiveCanvasTab(0),
|
|
22857
|
-
children: [
|
|
22858
|
-
/* @__PURE__ */ jsx(Eye, { className: "w-3 h-3 mr-1" }),
|
|
22859
|
-
"Preview"
|
|
22860
|
-
]
|
|
22770
|
+
size: "icon",
|
|
22771
|
+
className: "h-7 w-7 text-muted-foreground hover:text-foreground",
|
|
22772
|
+
onClick: () => onTabChange?.(0),
|
|
22773
|
+
children: /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4" })
|
|
22861
22774
|
}
|
|
22862
|
-
),
|
|
22863
|
-
/* @__PURE__ */
|
|
22775
|
+
) }),
|
|
22776
|
+
renderSessionsView ? renderSessionsView() : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground", children: "Sessions view not available" })
|
|
22777
|
+
] })
|
|
22778
|
+
) : activeTab === 2 ? (
|
|
22779
|
+
// Projects View
|
|
22780
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
|
|
22781
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
|
|
22864
22782
|
Button,
|
|
22865
22783
|
{
|
|
22866
22784
|
variant: "ghost",
|
|
22867
|
-
size: "
|
|
22868
|
-
className:
|
|
22869
|
-
|
|
22870
|
-
|
|
22871
|
-
),
|
|
22872
|
-
onClick: () => setActiveCanvasTab(1),
|
|
22873
|
-
children: [
|
|
22874
|
-
/* @__PURE__ */ jsx(Code2, { className: "w-3 h-3 mr-1" }),
|
|
22875
|
-
"Code"
|
|
22876
|
-
]
|
|
22785
|
+
size: "icon",
|
|
22786
|
+
className: "h-7 w-7 text-muted-foreground hover:text-foreground",
|
|
22787
|
+
onClick: () => onTabChange?.(0),
|
|
22788
|
+
children: /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4" })
|
|
22877
22789
|
}
|
|
22878
|
-
)
|
|
22879
|
-
|
|
22880
|
-
|
|
22881
|
-
|
|
22882
|
-
|
|
22883
|
-
|
|
22884
|
-
|
|
22885
|
-
|
|
22886
|
-
DropdownMenuItem,
|
|
22790
|
+
) }),
|
|
22791
|
+
renderProjectsView ? renderProjectsView() : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground", children: "Projects view not available" })
|
|
22792
|
+
] })
|
|
22793
|
+
) : activeTab === 4 ? (
|
|
22794
|
+
// Memories View
|
|
22795
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
|
|
22796
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
|
|
22797
|
+
Button,
|
|
22887
22798
|
{
|
|
22888
|
-
|
|
22889
|
-
|
|
22890
|
-
|
|
22891
|
-
|
|
22892
|
-
|
|
22893
|
-
|
|
22894
|
-
|
|
22799
|
+
variant: "ghost",
|
|
22800
|
+
size: "icon",
|
|
22801
|
+
className: "h-7 w-7 text-muted-foreground hover:text-foreground",
|
|
22802
|
+
onClick: () => onTabChange?.(0),
|
|
22803
|
+
children: /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4" })
|
|
22804
|
+
}
|
|
22805
|
+
) }),
|
|
22806
|
+
renderMemoriesView ? renderMemoriesView() : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground", children: "Memories view not available" })
|
|
22807
|
+
] })
|
|
22808
|
+
) : activeTab === 3 ? (
|
|
22809
|
+
// Works View
|
|
22810
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
|
|
22811
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
|
|
22812
|
+
Button,
|
|
22813
|
+
{
|
|
22814
|
+
variant: "ghost",
|
|
22815
|
+
size: "icon",
|
|
22816
|
+
className: "h-7 w-7 text-muted-foreground hover:text-foreground",
|
|
22817
|
+
onClick: () => onTabChange?.(0),
|
|
22818
|
+
children: /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4" })
|
|
22819
|
+
}
|
|
22820
|
+
) }),
|
|
22821
|
+
renderWorksView ? renderWorksView() : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground", children: "Works view not available" })
|
|
22822
|
+
] })
|
|
22823
|
+
) : (
|
|
22824
|
+
// Default: Chat View
|
|
22895
22825
|
/* @__PURE__ */ jsx(
|
|
22896
|
-
|
|
22826
|
+
ChatPanel,
|
|
22897
22827
|
{
|
|
22898
|
-
|
|
22899
|
-
|
|
22900
|
-
|
|
22901
|
-
|
|
22902
|
-
|
|
22828
|
+
messages: commonProps.messages,
|
|
22829
|
+
isLoading: commonProps.isLoading,
|
|
22830
|
+
input: commonProps.input,
|
|
22831
|
+
onInputChange: commonProps.onInputChange,
|
|
22832
|
+
onSendMessage: commonProps.onSendMessage,
|
|
22833
|
+
onStop: commonProps.onStop,
|
|
22834
|
+
logo: commonProps.logo,
|
|
22835
|
+
userPhoto: commonProps.userPhoto,
|
|
22836
|
+
userDisplayName: commonProps.userDisplayName,
|
|
22837
|
+
description: commonProps.description,
|
|
22838
|
+
title: commonProps.title,
|
|
22839
|
+
welcomeMessage: commonProps.welcomeMessage,
|
|
22840
|
+
isLoadingAgent: commonProps.isLoadingAgent,
|
|
22841
|
+
placeholder: commonProps.placeholder,
|
|
22842
|
+
footerText: commonProps.footerText,
|
|
22843
|
+
supportFiles: commonProps.supportFiles,
|
|
22844
|
+
supportWebSearch: commonProps.supportWebSearch,
|
|
22845
|
+
supportDocumentSearch: commonProps.supportDocumentSearch,
|
|
22846
|
+
supportDeepResearch: commonProps.supportDeepResearch,
|
|
22847
|
+
supportThinking: commonProps.supportThinking,
|
|
22848
|
+
supportWorkCanvas: commonProps.supportWorkCanvas,
|
|
22849
|
+
supportMultiModels: commonProps.supportMultiModels,
|
|
22850
|
+
deploymentId: commonProps.deploymentId,
|
|
22851
|
+
tenantAiAgentId: commonProps.tenantAiAgentId,
|
|
22852
|
+
enableMicrophone: commonProps.enableMicrophone,
|
|
22853
|
+
enableVoice: commonProps.enableVoice,
|
|
22854
|
+
isRecording: commonProps.isRecording,
|
|
22855
|
+
recognition: commonProps.recognition,
|
|
22856
|
+
onMicrophoneClick: commonProps.onMicrophoneClick,
|
|
22857
|
+
onToolAction: commonProps.onToolAction,
|
|
22858
|
+
openCanvasView: handleOpenCanvasViewInline,
|
|
22859
|
+
renderThreadHeader,
|
|
22860
|
+
threadId: commonProps.threadId,
|
|
22861
|
+
compactToolbar: !isFullscreen
|
|
22903
22862
|
}
|
|
22904
22863
|
)
|
|
22905
|
-
|
|
22906
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-
|
|
22907
|
-
|
|
22908
|
-
|
|
22909
|
-
|
|
22910
|
-
|
|
22911
|
-
|
|
22912
|
-
|
|
22913
|
-
|
|
22914
|
-
|
|
22915
|
-
|
|
22916
|
-
|
|
22917
|
-
|
|
22864
|
+
) }),
|
|
22865
|
+
canvasWork && /* @__PURE__ */ jsxs("div", { className: "w-3/5 border-l bg-background flex flex-col shrink-0", children: [
|
|
22866
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 h-12 px-3 border-b shrink-0", children: [
|
|
22867
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium truncate flex-1", children: canvasWork.title }),
|
|
22868
|
+
canvasWork.type === WorkTypes.Code && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5 bg-muted rounded-md p-0.5 shrink-0", children: [
|
|
22869
|
+
/* @__PURE__ */ jsxs(
|
|
22870
|
+
Button,
|
|
22871
|
+
{
|
|
22872
|
+
variant: "ghost",
|
|
22873
|
+
size: "sm",
|
|
22874
|
+
className: cn(
|
|
22875
|
+
"h-6 px-2 text-xs rounded-sm",
|
|
22876
|
+
activeCanvasTab === 0 ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
22877
|
+
),
|
|
22878
|
+
onClick: () => setActiveCanvasTab(0),
|
|
22879
|
+
children: [
|
|
22880
|
+
/* @__PURE__ */ jsx(Eye, { className: "w-3 h-3 mr-1" }),
|
|
22881
|
+
"Preview"
|
|
22882
|
+
]
|
|
22883
|
+
}
|
|
22884
|
+
),
|
|
22885
|
+
/* @__PURE__ */ jsxs(
|
|
22886
|
+
Button,
|
|
22887
|
+
{
|
|
22888
|
+
variant: "ghost",
|
|
22889
|
+
size: "sm",
|
|
22890
|
+
className: cn(
|
|
22891
|
+
"h-6 px-2 text-xs rounded-sm",
|
|
22892
|
+
activeCanvasTab === 1 ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
22893
|
+
),
|
|
22894
|
+
onClick: () => setActiveCanvasTab(1),
|
|
22895
|
+
children: [
|
|
22896
|
+
/* @__PURE__ */ jsx(Code2, { className: "w-3 h-3 mr-1" }),
|
|
22897
|
+
"Code"
|
|
22898
|
+
]
|
|
22899
|
+
}
|
|
22900
|
+
)
|
|
22901
|
+
] }),
|
|
22902
|
+
canvasWork.type !== WorkTypes.Record && canvasWork.type !== WorkTypes.Data && canvasWork.type !== WorkTypes.App && /* @__PURE__ */ jsxs(DropdownMenu$1, { children: [
|
|
22903
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", className: "h-7 text-xs px-2 shrink-0", disabled: canvasVersionsLoading, children: [
|
|
22904
|
+
canvasVersionsLoading ? "..." : canvasVersions.find((v) => v.id === canvasSelectedVersionId)?.name ?? t("labels.select_version"),
|
|
22905
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "ml-1 h-3 w-3" })
|
|
22906
|
+
] }) }),
|
|
22907
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", className: "max-h-60 overflow-y-auto", children: canvasVersions.length === 0 ? /* @__PURE__ */ jsx(DropdownMenuItem, { disabled: true, className: "text-xs text-muted-foreground", children: t("messages.no_versions_found") }) : canvasVersions.map((v) => /* @__PURE__ */ jsx(
|
|
22908
|
+
DropdownMenuItem,
|
|
22909
|
+
{
|
|
22910
|
+
className: `cursor-pointer text-xs ${canvasSelectedVersionId === v.id ? "bg-accent text-accent-foreground" : ""}`,
|
|
22911
|
+
onClick: () => handleCanvasVersionSelect(v.id),
|
|
22912
|
+
children: v.name
|
|
22913
|
+
},
|
|
22914
|
+
v.id
|
|
22915
|
+
)) })
|
|
22916
|
+
] }),
|
|
22917
|
+
/* @__PURE__ */ jsx(
|
|
22918
|
+
Button,
|
|
22919
|
+
{
|
|
22920
|
+
variant: "ghost",
|
|
22921
|
+
size: "icon",
|
|
22922
|
+
onClick: () => setCanvasWork(null),
|
|
22923
|
+
className: "h-8 w-8 shrink-0 text-muted-foreground hover:text-foreground",
|
|
22924
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
22918
22925
|
}
|
|
22919
|
-
|
|
22920
|
-
),
|
|
22921
|
-
|
|
22922
|
-
|
|
22923
|
-
|
|
22924
|
-
|
|
22925
|
-
|
|
22926
|
-
|
|
22927
|
-
|
|
22928
|
-
|
|
22929
|
-
|
|
22930
|
-
|
|
22931
|
-
|
|
22932
|
-
|
|
22933
|
-
title: canvasWork.title
|
|
22934
|
-
}
|
|
22935
|
-
),
|
|
22936
|
-
!canvasVersionsLoading && canvasWork.type === WorkTypes.Data && /* @__PURE__ */ jsx(
|
|
22937
|
-
CanvasDeepResearchView,
|
|
22938
|
-
{
|
|
22939
|
-
title: canvasWork.title,
|
|
22940
|
-
output_schema: canvasWork.content_json?.output_schema,
|
|
22941
|
-
content: canvasWork.content_json?.content,
|
|
22942
|
-
basis: canvasWork.content_json?.basis
|
|
22943
|
-
}
|
|
22944
|
-
),
|
|
22945
|
-
!canvasVersionsLoading && canvasWork.type === WorkTypes.Xlsx && (canvasSelectedVersionId && !canvasVersionImages ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx(Loader2, { className: "size-5 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ jsx(
|
|
22946
|
-
CanvasSpreadsheetView,
|
|
22947
|
-
{
|
|
22948
|
-
title: canvasWork.title,
|
|
22949
|
-
content: canvasVersionImages ?? canvasWork.content_json,
|
|
22950
|
-
workId: canvasWork.id,
|
|
22951
|
-
versionId: canvasSelectedVersionId ?? void 0,
|
|
22952
|
-
commands: canvasSpreadsheetCommands,
|
|
22953
|
-
onData: async (data) => {
|
|
22954
|
-
const workId = canvasWork.id;
|
|
22955
|
-
if (!workId || workId === "streaming") return;
|
|
22956
|
-
try {
|
|
22957
|
-
await apiClient.post(`/ai/works/${workId}/modify`, {
|
|
22958
|
-
content_json: {
|
|
22959
|
-
...canvasWork.content_json ?? {},
|
|
22960
|
-
workbook: data.workbook
|
|
22961
|
-
}
|
|
22962
|
-
});
|
|
22963
|
-
} catch {
|
|
22964
|
-
console.warn("Version didn't save succesfully.");
|
|
22926
|
+
)
|
|
22927
|
+
] }),
|
|
22928
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto", children: [
|
|
22929
|
+
canvasVersionsLoading && /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx(Loader2, { className: "size-5 animate-spin text-muted-foreground" }) }),
|
|
22930
|
+
!canvasVersionsLoading && canvasWork.type === WorkTypes.Record && /* @__PURE__ */ jsx(
|
|
22931
|
+
CanvasRecordView,
|
|
22932
|
+
{
|
|
22933
|
+
dataSourceId: canvasWork.content_json?.dataSourceId ?? "",
|
|
22934
|
+
mode: canvasWork.content_json?.mode ?? "add",
|
|
22935
|
+
defaultValues: canvasWork.content_json?.data,
|
|
22936
|
+
recordId: canvasWork.content_json?.recordId,
|
|
22937
|
+
onClose: () => setCanvasWork(null),
|
|
22938
|
+
onSave: (id, data) => {
|
|
22939
|
+
console.info("[CanvasRecordView] saved:", id, data);
|
|
22965
22940
|
}
|
|
22966
22941
|
}
|
|
22967
|
-
|
|
22968
|
-
|
|
22969
|
-
|
|
22970
|
-
|
|
22971
|
-
|
|
22972
|
-
|
|
22973
|
-
|
|
22974
|
-
|
|
22975
|
-
|
|
22976
|
-
|
|
22977
|
-
|
|
22978
|
-
|
|
22979
|
-
|
|
22980
|
-
|
|
22981
|
-
|
|
22982
|
-
|
|
22983
|
-
|
|
22984
|
-
|
|
22985
|
-
|
|
22942
|
+
),
|
|
22943
|
+
!canvasVersionsLoading && canvasWork.type === WorkTypes.Image && /* @__PURE__ */ jsx(
|
|
22944
|
+
CanvasImageView,
|
|
22945
|
+
{
|
|
22946
|
+
title: canvasWork.title,
|
|
22947
|
+
images: canvasVersionImages ?? canvasWork.content_json
|
|
22948
|
+
}
|
|
22949
|
+
),
|
|
22950
|
+
!canvasVersionsLoading && canvasWork.type === WorkTypes.Text && /* @__PURE__ */ jsx(
|
|
22951
|
+
CanvasTextView,
|
|
22952
|
+
{
|
|
22953
|
+
contentText: canvasVersionContent ?? "",
|
|
22954
|
+
language: canvasVersionLanguage ?? "markdown",
|
|
22955
|
+
title: canvasWork.title
|
|
22956
|
+
}
|
|
22957
|
+
),
|
|
22958
|
+
!canvasVersionsLoading && canvasWork.type === WorkTypes.Data && /* @__PURE__ */ jsx(
|
|
22959
|
+
CanvasDeepResearchView,
|
|
22960
|
+
{
|
|
22961
|
+
title: canvasWork.title,
|
|
22962
|
+
output_schema: canvasWork.content_json?.output_schema,
|
|
22963
|
+
content: canvasWork.content_json?.content,
|
|
22964
|
+
basis: canvasWork.content_json?.basis
|
|
22965
|
+
}
|
|
22966
|
+
),
|
|
22967
|
+
!canvasVersionsLoading && canvasWork.type === WorkTypes.Xlsx && (canvasSelectedVersionId && !canvasVersionImages ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx(Loader2, { className: "size-5 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ jsx(
|
|
22968
|
+
CanvasSpreadsheetView,
|
|
22969
|
+
{
|
|
22970
|
+
title: canvasWork.title,
|
|
22971
|
+
content: canvasVersionImages ?? canvasWork.content_json,
|
|
22972
|
+
workId: canvasWork.id,
|
|
22973
|
+
versionId: canvasSelectedVersionId ?? void 0,
|
|
22974
|
+
commands: canvasSpreadsheetCommands,
|
|
22975
|
+
onData: async (data) => {
|
|
22976
|
+
const workId = canvasWork.id;
|
|
22977
|
+
if (!workId || workId === "streaming") return;
|
|
22978
|
+
try {
|
|
22979
|
+
await apiClient.post(`/ai/works/${workId}/modify`, {
|
|
22980
|
+
content_json: {
|
|
22981
|
+
...canvasWork.content_json ?? {},
|
|
22982
|
+
workbook: data.workbook
|
|
22983
|
+
}
|
|
22984
|
+
});
|
|
22985
|
+
} catch {
|
|
22986
|
+
console.warn("Version didn't save succesfully.");
|
|
22987
|
+
}
|
|
22988
|
+
}
|
|
22989
|
+
},
|
|
22990
|
+
canvasSelectedVersionId ?? canvasWork.id
|
|
22991
|
+
)),
|
|
22992
|
+
!canvasVersionsLoading && canvasWork.type === WorkTypes.App && /* @__PURE__ */ jsx(CanvasAppView, { app: canvasWork.content_json }),
|
|
22993
|
+
!canvasVersionsLoading && canvasWork.type === WorkTypes.Code && canvasWork.id && (activeCanvasTab === 0 ? /* @__PURE__ */ jsx(
|
|
22994
|
+
ShellCanvas,
|
|
22995
|
+
{
|
|
22996
|
+
workId: canvasWork.id,
|
|
22997
|
+
versionId: canvasSelectedVersionId,
|
|
22998
|
+
title: canvasWork.title
|
|
22999
|
+
}
|
|
23000
|
+
) : /* @__PURE__ */ jsx(
|
|
23001
|
+
CanvasCodeView,
|
|
23002
|
+
{
|
|
23003
|
+
contentText: canvasVersionContent ?? "",
|
|
23004
|
+
language: canvasVersionLanguage,
|
|
23005
|
+
title: canvasWork.title
|
|
23006
|
+
}
|
|
23007
|
+
))
|
|
23008
|
+
] })
|
|
22986
23009
|
] })
|
|
22987
23010
|
] })
|
|
22988
|
-
] })
|
|
22989
|
-
|
|
23011
|
+
] });
|
|
23012
|
+
})()
|
|
22990
23013
|
}
|
|
22991
23014
|
);
|
|
22992
23015
|
if (isFullscreen && typeof document !== "undefined") {
|
|
@@ -23721,6 +23744,7 @@ var SidebarContent = ({
|
|
|
23721
23744
|
t
|
|
23722
23745
|
}) => {
|
|
23723
23746
|
const [activeListType, setActiveListType] = useState("sessions");
|
|
23747
|
+
const [openMenuId, setOpenMenuId] = useState(null);
|
|
23724
23748
|
const navItems = [{ id: 1, label: t("tabs.sessions"), icon: MessageSquare }, { id: 3, label: t("tabs.works"), icon: NotebookText }];
|
|
23725
23749
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0", children: [
|
|
23726
23750
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-px", children: [
|
|
@@ -23791,21 +23815,52 @@ var SidebarContent = ({
|
|
|
23791
23815
|
)
|
|
23792
23816
|
] }),
|
|
23793
23817
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col mt-4 flex-1 min-h-0", children: [
|
|
23794
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-
|
|
23795
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold uppercase tracking-
|
|
23796
|
-
/* @__PURE__ */
|
|
23797
|
-
|
|
23798
|
-
|
|
23799
|
-
|
|
23800
|
-
|
|
23801
|
-
|
|
23802
|
-
|
|
23803
|
-
|
|
23804
|
-
|
|
23805
|
-
|
|
23806
|
-
|
|
23807
|
-
|
|
23808
|
-
|
|
23818
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-start px-2 py-1.5 shrink-0", children: [
|
|
23819
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold uppercase tracking-tight text-muted-foreground", children: t("sections.recents") }),
|
|
23820
|
+
/* @__PURE__ */ jsxs(DropdownMenu$1, { children: [
|
|
23821
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
23822
|
+
Button,
|
|
23823
|
+
{
|
|
23824
|
+
variant: "ghost",
|
|
23825
|
+
size: "sm",
|
|
23826
|
+
className: "ml-1 h-auto cursor-pointer px-1 py-0 text-xs font-semibold uppercase tracking-tight text-muted-foreground hover:text-foreground",
|
|
23827
|
+
children: [
|
|
23828
|
+
activeListType === "sessions" ? `${t("tabs.sessions")} (${sessions.length})` : `${t("tabs.works")} (${works.length})`,
|
|
23829
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "ml-0.5 w-3 h-3" })
|
|
23830
|
+
]
|
|
23831
|
+
}
|
|
23832
|
+
) }),
|
|
23833
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", className: "w-44 z-[9999]", children: [
|
|
23834
|
+
/* @__PURE__ */ jsxs(
|
|
23835
|
+
DropdownMenuItem,
|
|
23836
|
+
{
|
|
23837
|
+
className: "cursor-pointer text-xs",
|
|
23838
|
+
onClick: () => setActiveListType("sessions"),
|
|
23839
|
+
children: [
|
|
23840
|
+
/* @__PURE__ */ jsx(MessageSquare, { className: "w-3.5 h-3.5 mr-2" }),
|
|
23841
|
+
t("tabs.sessions"),
|
|
23842
|
+
" (",
|
|
23843
|
+
sessions.length,
|
|
23844
|
+
")"
|
|
23845
|
+
]
|
|
23846
|
+
}
|
|
23847
|
+
),
|
|
23848
|
+
/* @__PURE__ */ jsxs(
|
|
23849
|
+
DropdownMenuItem,
|
|
23850
|
+
{
|
|
23851
|
+
className: "cursor-pointer text-xs",
|
|
23852
|
+
onClick: () => setActiveListType("works"),
|
|
23853
|
+
children: [
|
|
23854
|
+
/* @__PURE__ */ jsx(NotebookText, { className: "w-3.5 h-3.5 mr-2" }),
|
|
23855
|
+
t("tabs.works"),
|
|
23856
|
+
" (",
|
|
23857
|
+
works.length,
|
|
23858
|
+
")"
|
|
23859
|
+
]
|
|
23860
|
+
}
|
|
23861
|
+
)
|
|
23862
|
+
] })
|
|
23863
|
+
] })
|
|
23809
23864
|
] }),
|
|
23810
23865
|
/* @__PURE__ */ jsx(
|
|
23811
23866
|
"div",
|
|
@@ -23827,29 +23882,47 @@ var SidebarContent = ({
|
|
|
23827
23882
|
selectedSessionId === session.id && "bg-accent text-accent-foreground"
|
|
23828
23883
|
),
|
|
23829
23884
|
children: [
|
|
23830
|
-
/* @__PURE__ */
|
|
23831
|
-
|
|
23832
|
-
|
|
23833
|
-
|
|
23834
|
-
|
|
23835
|
-
|
|
23836
|
-
|
|
23837
|
-
|
|
23838
|
-
|
|
23839
|
-
|
|
23840
|
-
|
|
23885
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
23886
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm truncate pr-6", children: session.title }),
|
|
23887
|
+
onDeleteSession && /* @__PURE__ */ jsx(
|
|
23888
|
+
"div",
|
|
23889
|
+
{
|
|
23890
|
+
className: cn(
|
|
23891
|
+
"absolute right-0 top-1/2 -translate-y-1/2 transition-opacity",
|
|
23892
|
+
openMenuId === session.id ? "opacity-100" : "opacity-0 group-hover:opacity-100"
|
|
23893
|
+
),
|
|
23894
|
+
onClick: (e) => e.stopPropagation(),
|
|
23895
|
+
children: /* @__PURE__ */ jsxs(
|
|
23896
|
+
DropdownMenu$1,
|
|
23841
23897
|
{
|
|
23842
|
-
|
|
23843
|
-
|
|
23898
|
+
open: openMenuId === session.id,
|
|
23899
|
+
onOpenChange: (open) => setOpenMenuId(open ? session.id : null),
|
|
23844
23900
|
children: [
|
|
23845
|
-
/* @__PURE__ */ jsx(
|
|
23846
|
-
|
|
23901
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ jsx(MoreVertical, { className: "w-3.5 h-3.5" }) }) }),
|
|
23902
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", className: "w-36 z-[9999]", children: /* @__PURE__ */ jsxs(
|
|
23903
|
+
DropdownMenuItem,
|
|
23904
|
+
{
|
|
23905
|
+
className: "text-destructive focus:text-destructive cursor-pointer",
|
|
23906
|
+
onClick: () => onDeleteSession(session),
|
|
23907
|
+
children: [
|
|
23908
|
+
/* @__PURE__ */ jsx(Trash, { className: "w-3.5 h-3.5 mr-2" }),
|
|
23909
|
+
t("common.delete")
|
|
23910
|
+
]
|
|
23911
|
+
}
|
|
23912
|
+
) })
|
|
23847
23913
|
]
|
|
23848
23914
|
}
|
|
23849
|
-
)
|
|
23850
|
-
|
|
23851
|
-
|
|
23852
|
-
)
|
|
23915
|
+
)
|
|
23916
|
+
}
|
|
23917
|
+
)
|
|
23918
|
+
] }),
|
|
23919
|
+
/* @__PURE__ */ jsxs("div", { className: cn(
|
|
23920
|
+
"w-full text-xs text-muted-foreground flex justify-between items-center",
|
|
23921
|
+
selectedSessionId === session.id ? "flex" : "hidden group-hover:flex"
|
|
23922
|
+
), children: [
|
|
23923
|
+
/* @__PURE__ */ jsx("span", { children: session.createdAt.toLocaleDateString() }),
|
|
23924
|
+
session.createdBy?.name && /* @__PURE__ */ jsx("span", { children: session.createdBy.name })
|
|
23925
|
+
] })
|
|
23853
23926
|
]
|
|
23854
23927
|
},
|
|
23855
23928
|
session.id
|
|
@@ -23861,13 +23934,16 @@ var SidebarContent = ({
|
|
|
23861
23934
|
{
|
|
23862
23935
|
onClick: () => onWorkClick(work),
|
|
23863
23936
|
className: cn(
|
|
23864
|
-
"
|
|
23937
|
+
"group relative px-2 py-1 rounded-lg cursor-pointer transition-colors",
|
|
23865
23938
|
"hover:bg-accent hover:text-accent-foreground",
|
|
23866
23939
|
selectedWorkId === work.id && "bg-accent text-accent-foreground"
|
|
23867
23940
|
),
|
|
23868
23941
|
children: [
|
|
23869
23942
|
/* @__PURE__ */ jsx("div", { className: "text-sm truncate", children: work.title }),
|
|
23870
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
23943
|
+
/* @__PURE__ */ jsx("div", { className: cn(
|
|
23944
|
+
"w-full text-xs text-muted-foreground flex justify-between items-center",
|
|
23945
|
+
selectedWorkId === work.id ? "flex" : "hidden group-hover:flex"
|
|
23946
|
+
), children: /* @__PURE__ */ jsx("span", { children: work.created_on ? new Date(work.created_on).toLocaleDateString() : "" }) })
|
|
23871
23947
|
]
|
|
23872
23948
|
},
|
|
23873
23949
|
work.id
|
|
@@ -24006,6 +24082,7 @@ async function fetchAgentThreads(apiClient, tenantAiAgentId, onSuccess, userId,
|
|
|
24006
24082
|
try {
|
|
24007
24083
|
const apiParams = {
|
|
24008
24084
|
columns: "id,subject,created_on,last_modified_on,body_text,tenant_ai_agent_id,created_by",
|
|
24085
|
+
expand: "created_by",
|
|
24009
24086
|
orderBy: JSON.stringify({ field: "created_on", direction: "desc" })
|
|
24010
24087
|
};
|
|
24011
24088
|
const agentRule = deploymentId ? { field: "tenant_ai_agent_deployment_id", operator: "=", value: deploymentId } : { field: "tenant_ai_agent_id", operator: "=", value: tenantAiAgentId };
|
|
@@ -24025,7 +24102,8 @@ async function fetchAgentThreads(apiClient, tenantAiAgentId, onSuccess, userId,
|
|
|
24025
24102
|
title: item.subject,
|
|
24026
24103
|
messages: [],
|
|
24027
24104
|
createdAt: new Date(item.created_on),
|
|
24028
|
-
updatedAt: new Date(item.last_modified_on || item.created_on)
|
|
24105
|
+
updatedAt: new Date(item.last_modified_on || item.created_on),
|
|
24106
|
+
createdBy: item.created_by ?? null
|
|
24029
24107
|
}));
|
|
24030
24108
|
onSuccess(threads);
|
|
24031
24109
|
} else {
|
|
@@ -24038,11 +24116,12 @@ async function fetchAgentThreads(apiClient, tenantAiAgentId, onSuccess, userId,
|
|
|
24038
24116
|
async function fetchProjectThreads(apiClient, projectId, onSuccess) {
|
|
24039
24117
|
try {
|
|
24040
24118
|
const apiParams = {
|
|
24041
|
-
columns: "id,subject,created_on,last_modified_on,body_text,tenant_ai_agent_id,tenant_ai_project_id
|
|
24119
|
+
columns: "id,subject,created_on,last_modified_on,body_text,tenant_ai_agent_id,tenant_ai_project_id,created_by",
|
|
24120
|
+
expand: "created_by",
|
|
24042
24121
|
orderBy: JSON.stringify({ field: "created_on", direction: "desc" })
|
|
24043
24122
|
};
|
|
24044
24123
|
apiParams.filters = JSON.stringify({
|
|
24045
|
-
rules: [{ field: "tenant_ai_project_id
|
|
24124
|
+
rules: [{ field: "tenant_ai_project_id", operator: "=", value: projectId }]
|
|
24046
24125
|
});
|
|
24047
24126
|
const response = await apiClient.get("/apps/base/data-sources/thread/items", apiParams);
|
|
24048
24127
|
if (response.success && response.data) {
|
|
@@ -24052,7 +24131,8 @@ async function fetchProjectThreads(apiClient, projectId, onSuccess) {
|
|
|
24052
24131
|
title: item.subject,
|
|
24053
24132
|
messages: [],
|
|
24054
24133
|
createdAt: new Date(item.created_on),
|
|
24055
|
-
updatedAt: new Date(item.last_modified_on)
|
|
24134
|
+
updatedAt: new Date(item.last_modified_on),
|
|
24135
|
+
createdBy: item.created_by ?? null
|
|
24056
24136
|
}));
|
|
24057
24137
|
onSuccess(projectId, threads);
|
|
24058
24138
|
} else {
|
|
@@ -24496,6 +24576,8 @@ var DocyAssistant = ({
|
|
|
24496
24576
|
hideExpand = false,
|
|
24497
24577
|
hideCloseButton = false,
|
|
24498
24578
|
hideAgentSelector = false,
|
|
24579
|
+
hideBorder = false,
|
|
24580
|
+
showHeader = true,
|
|
24499
24581
|
agentSelectorUrl = "/ai/agent-deployments",
|
|
24500
24582
|
baseAgentSelectorUrl = "/ai/agent-deployments/base",
|
|
24501
24583
|
onAgentChange,
|
|
@@ -24988,11 +25070,11 @@ var DocyAssistant = ({
|
|
|
24988
25070
|
onInputChange: handleInputChange,
|
|
24989
25071
|
onSendMessage: handleSendMessage,
|
|
24990
25072
|
onStop: stop,
|
|
24991
|
-
title: agentDetails?.name ?? title,
|
|
25073
|
+
title: isLoadingAgentDetails ? "" : agentDetails?.name ?? title,
|
|
24992
25074
|
description,
|
|
24993
|
-
welcomeMessage: agentDetails?.welcomeMessage,
|
|
25075
|
+
welcomeMessage: isLoadingAgentDetails ? void 0 : agentDetails?.welcomeMessage,
|
|
24994
25076
|
isLoadingAgent: isLoadingAgentDetails,
|
|
24995
|
-
logo: agentDetails?.logo ?? logo,
|
|
25077
|
+
logo: isLoadingAgentDetails ? void 0 : agentDetails?.logo ?? logo,
|
|
24996
25078
|
placeholder,
|
|
24997
25079
|
footerText,
|
|
24998
25080
|
className: opts.className,
|
|
@@ -25337,6 +25419,8 @@ var DocyAssistant = ({
|
|
|
25337
25419
|
threadId: sessionState.selectedSessionId ?? void 0,
|
|
25338
25420
|
hideCloseButton,
|
|
25339
25421
|
hideAgentSelector,
|
|
25422
|
+
hideBorder,
|
|
25423
|
+
showHeader,
|
|
25340
25424
|
agentSelectorUrl,
|
|
25341
25425
|
baseAgentSelectorUrl,
|
|
25342
25426
|
onAgentChange: (agentId, agentType) => {
|