@docyrus/ui-pro-ai-assistant 0.5.3 → 0.5.5
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/dist/components/generative-tool.d.ts +7 -2
- package/dist/components/subagent-tool.d.ts +7 -6
- package/dist/hooks/use-assistant-api.d.ts +7 -0
- package/dist/index.js +347 -83
- package/dist/index.js.map +1 -1
- package/dist/styles.css +16 -6
- package/dist/tools/delete-record.d.ts +12 -0
- package/dist/views/assistant-view.d.ts +7 -0
- package/dist/views/chat-panel.d.ts +10 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Input } from '@docyrus/ui-pro-shared/components/input';
|
|
|
9
9
|
import { Tabs as Tabs$1, TabsList as TabsList$1, TabsTrigger as TabsTrigger$1, TabsContent as TabsContent$1 } from '@docyrus/ui-pro-shared/components/tabs';
|
|
10
10
|
import { cn } from '@docyrus/ui-pro-shared/lib/utils';
|
|
11
11
|
import { DefaultChatTransport, lastAssistantMessageIsCompleteWithToolCalls } from 'ai';
|
|
12
|
-
import { Pencil, PilcrowIcon, Heading1Icon, Heading2Icon, Heading3Icon, SquareIcon, ListIcon, ListOrderedIcon, ChevronDownIcon, Code2Icon, QuoteIcon, LightbulbIcon, Columns3Icon, GripVertical, FileUpIcon, TableIcon, ImageIcon, FilmIcon, AudioLinesIcon, TableOfContentsIcon, RadicalIcon, RectangleVerticalIcon, CalendarIcon, PlusIcon, FileCodeIcon, MinusIcon, ChevronRightIcon, ListTree, PenToolIcon, Link2Icon, Check, X, Copy, FilesIcon, Link, Text, ExternalLink, Unlink, Bold, Italic, Underline, Strikethrough, Code2, MoreHorizontal, ArrowLeftIcon, ArrowRightIcon, Minus, Plus, CircleArrowDown, Minimize2, Trash2, FileUp, CheckCircle2, FileText, Loader2, CornerDownLeftIcon, PencilLineIcon, MessageSquareTextIcon, MessagesSquareIcon, ArrowUpIcon, CheckIcon, CaptionsIcon, ZoomInIcon, CircleArrowDownIcon, MoveUpRightIcon, MoreHorizontalIcon, Eye, PlusCircle, HelpCircle, Maximize2, Download, FileSpreadsheet, ChevronDown, ChevronLeft, ChevronRight, CheckCircle, XCircle, Search, Globe,
|
|
12
|
+
import { Pencil, PilcrowIcon, Heading1Icon, Heading2Icon, Heading3Icon, SquareIcon, ListIcon, ListOrderedIcon, ChevronDownIcon, Code2Icon, QuoteIcon, LightbulbIcon, Columns3Icon, GripVertical, FileUpIcon, TableIcon, ImageIcon, FilmIcon, AudioLinesIcon, TableOfContentsIcon, RadicalIcon, RectangleVerticalIcon, CalendarIcon, PlusIcon, FileCodeIcon, MinusIcon, ChevronRightIcon, ListTree, PenToolIcon, Link2Icon, Check, X, Copy, FilesIcon, Link, Text, ExternalLink, Unlink, Bold, Italic, Underline, Strikethrough, Code2, MoreHorizontal, ArrowLeftIcon, ArrowRightIcon, Minus, Plus, CircleArrowDown, Minimize2, Trash2, FileUp, CheckCircle2, FileText, Loader2, CornerDownLeftIcon, PencilLineIcon, MessageSquareTextIcon, MessagesSquareIcon, ArrowUpIcon, CheckIcon, CaptionsIcon, ZoomInIcon, CircleArrowDownIcon, MoveUpRightIcon, MoreHorizontalIcon, Eye, PlusCircle, HelpCircle, Maximize2, Download, FileSpreadsheet, ChevronDown, ChevronLeft, ChevronRight, CheckCircle, XCircle, Search, Globe, User, ArrowRight, MapPin, CalendarClock, List, RefreshCw, FilePlus, XIcon, CornerUpLeftIcon, AlbumIcon, FeatherIcon, ListMinusIcon, ListPlusIcon, ListEnd, Wand, LanguagesIcon, BadgeHelpIcon, PenLineIcon, SearchIcon, MusicIcon, CompassIcon, SmileIcon, LeafIcon, ClockIcon, AppleIcon, FlagIcon, StarIcon, DeleteIcon, AlignLeft, AlignCenter, AlignRight, RotateCcw, AlertTriangle, AlertCircle, ArrowUpDown, ArrowDownToLine, PenLine, PencilIcon, TrashIcon, FileIcon, Star, ChevronsUpDown, FolderIcon, MessageSquare, Hash, Table, CheckSquare, Calendar as Calendar$1, Clock, Phone, Mail, Send, RefreshCcw, Undo2, ChevronsUpDownIcon, ChevronsRight, ChevronsLeft, CalendarDays, RefreshCwIcon, PaintRoller, MessageSquareText, ArrowLeft, Users, Bot, Brain, Lightbulb, BookOpen, PenTool, SlidersHorizontal, Wand2, Mic, Code, Trash, Edit, Share, FolderInput, Archive, Building2, ShieldCheck, Sparkles, PanelLeft, NotebookText, CirclePlus, MoreVertical, FileSearch, Microscope, Ruler, AudioLines, BrainCircuit, File as File$1, Plug, Inbox, Menu, FolderOpen, LayoutDashboard, Table2, WandSparklesIcon, ArrowUpToLineIcon, BoldIcon, ItalicIcon, UnderlineIcon, StrikethroughIcon, HighlighterIcon, Undo2Icon, Redo2Icon, ArrowDownToLineIcon, AlignLeftIcon, AlignCenterIcon, AlignRightIcon, AlignJustifyIcon, ListOrdered, ListTodoIcon, ListCollapseIcon, Grid3x3Icon, Combine, Ungroup, ArrowUp, ArrowDown, Trash2Icon, LinkIcon, WrapText, OutdentIcon, IndentIcon, EyeIcon, PenIcon } from 'lucide-react';
|
|
13
13
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
14
|
import { ScrollArea as ScrollArea$1 } from '@docyrus/ui-pro-shared/components/scroll-area';
|
|
15
15
|
import { AsyncTokenManager, RestApiClient } from '@docyrus/api-client';
|
|
@@ -3884,6 +3884,7 @@ function useAssistantApi({
|
|
|
3884
3884
|
const { user: configUser } = useAssistantConfig();
|
|
3885
3885
|
const [agentDetails, setAgentDetails] = useState(null);
|
|
3886
3886
|
const [isLoadingAgentDetails, setIsLoadingAgentDetails] = useState(!!tenantAiAgentId);
|
|
3887
|
+
const [subagents, setSubagents] = useState([]);
|
|
3887
3888
|
const apiClientRef = useRef(apiClient);
|
|
3888
3889
|
const fetchedAgentIdRef = useRef(null);
|
|
3889
3890
|
apiClientRef.current = apiClient;
|
|
@@ -3894,6 +3895,7 @@ function useAssistantApi({
|
|
|
3894
3895
|
let cancelled = false;
|
|
3895
3896
|
const fetchAgentDetails = async () => {
|
|
3896
3897
|
setAgentDetails(null);
|
|
3898
|
+
setSubagents([]);
|
|
3897
3899
|
setIsLoadingAgentDetails(true);
|
|
3898
3900
|
try {
|
|
3899
3901
|
const response = await apiClientRef.current.get(endpoint);
|
|
@@ -3905,6 +3907,13 @@ function useAssistantApi({
|
|
|
3905
3907
|
const name = data.name || data.agent?.agentName || data.agent?.name;
|
|
3906
3908
|
const welcomeMessage = data.welcomeMessage || data.agent?.welcomeMessage;
|
|
3907
3909
|
setAgentDetails({ logo: avatar, name, welcomeMessage });
|
|
3910
|
+
const direct = data.agent?.agents || [];
|
|
3911
|
+
const connected = (data.agent?.connectedAgents || []).map((c) => ({
|
|
3912
|
+
...c,
|
|
3913
|
+
id: c.id || c.agentId,
|
|
3914
|
+
name: c.name || c.agentName
|
|
3915
|
+
}));
|
|
3916
|
+
setSubagents([...direct, ...connected]);
|
|
3908
3917
|
} else {
|
|
3909
3918
|
setAgentDetails({ logo, name: title });
|
|
3910
3919
|
}
|
|
@@ -4190,6 +4199,7 @@ function useAssistantApi({
|
|
|
4190
4199
|
return {
|
|
4191
4200
|
agentDetails,
|
|
4192
4201
|
isLoadingAgentDetails,
|
|
4202
|
+
subagents,
|
|
4193
4203
|
fetchThreads,
|
|
4194
4204
|
fetchProjectThreads: fetchProjectThreads2,
|
|
4195
4205
|
loadThreadMessages: loadThreadMessages2,
|
|
@@ -10233,6 +10243,152 @@ function CreateRecord({
|
|
|
10233
10243
|
resultMessage && /* @__PURE__ */ jsx("div", { className: `text-xs font-medium ${resultError ? "text-destructive" : "text-green-600"}`, children: resultMessage })
|
|
10234
10244
|
] });
|
|
10235
10245
|
}
|
|
10246
|
+
function safeParseArray(value) {
|
|
10247
|
+
if (value == null) return null;
|
|
10248
|
+
if (Array.isArray(value)) return value.filter((id) => typeof id === "string");
|
|
10249
|
+
if (typeof value === "string") {
|
|
10250
|
+
try {
|
|
10251
|
+
const parsed = JSON.parse(value);
|
|
10252
|
+
return Array.isArray(parsed) ? parsed.filter((id) => typeof id === "string") : null;
|
|
10253
|
+
} catch {
|
|
10254
|
+
return null;
|
|
10255
|
+
}
|
|
10256
|
+
}
|
|
10257
|
+
return null;
|
|
10258
|
+
}
|
|
10259
|
+
function DeleteRecord({
|
|
10260
|
+
dataSourceId,
|
|
10261
|
+
recordId,
|
|
10262
|
+
recordIds,
|
|
10263
|
+
state,
|
|
10264
|
+
toolName = "deleteRecord",
|
|
10265
|
+
toolCallId,
|
|
10266
|
+
onToolAction
|
|
10267
|
+
}) {
|
|
10268
|
+
const apiClient = useApiClient();
|
|
10269
|
+
const [loading, setLoading] = useState(false);
|
|
10270
|
+
const [submitted, setSubmitted] = useState(false);
|
|
10271
|
+
const [resultMessage, setResultMessage] = useState("");
|
|
10272
|
+
const [resultError, setResultError] = useState(false);
|
|
10273
|
+
const { dataSource, loading: fieldsLoading } = useResolvedRecordFields(dataSourceId);
|
|
10274
|
+
const parsedRecordIds = useMemo(() => safeParseArray(recordIds), [recordIds]);
|
|
10275
|
+
const isBatch = parsedRecordIds != null && parsedRecordIds.length > 0;
|
|
10276
|
+
const recordCount = isBatch && parsedRecordIds ? parsedRecordIds.length : 1;
|
|
10277
|
+
const dataSourceName = dataSource?.name || "record";
|
|
10278
|
+
const emitResult = (input) => {
|
|
10279
|
+
onToolAction({
|
|
10280
|
+
tool: toolName,
|
|
10281
|
+
toolCallId,
|
|
10282
|
+
decision: "submit",
|
|
10283
|
+
input
|
|
10284
|
+
});
|
|
10285
|
+
};
|
|
10286
|
+
const handleApprove = async () => {
|
|
10287
|
+
if (!dataSource) {
|
|
10288
|
+
const message = "Data source metadata not available";
|
|
10289
|
+
setResultError(true);
|
|
10290
|
+
setResultMessage(message);
|
|
10291
|
+
emitResult({ success: false, error: message });
|
|
10292
|
+
return;
|
|
10293
|
+
}
|
|
10294
|
+
if (!isBatch && !recordId) {
|
|
10295
|
+
const message = "Either recordId or recordIds must be provided";
|
|
10296
|
+
setResultError(true);
|
|
10297
|
+
setResultMessage(message);
|
|
10298
|
+
emitResult({ success: false, error: message });
|
|
10299
|
+
return;
|
|
10300
|
+
}
|
|
10301
|
+
setLoading(true);
|
|
10302
|
+
setResultError(false);
|
|
10303
|
+
try {
|
|
10304
|
+
const { appSlug, dsSlug } = dataSource;
|
|
10305
|
+
const baseEndpoint = `/apps/${appSlug}/data-sources/${dsSlug}/items/`;
|
|
10306
|
+
const result = isBatch && parsedRecordIds ? await apiClient.deleteWithBody(baseEndpoint, { recordIds: parsedRecordIds }) : await apiClient.delete(`${baseEndpoint}${recordId}`);
|
|
10307
|
+
if (!result?.success) {
|
|
10308
|
+
throw new Error(
|
|
10309
|
+
typeof result?.error === "string" ? result.error : "Failed to delete record(s)"
|
|
10310
|
+
);
|
|
10311
|
+
}
|
|
10312
|
+
setSubmitted(true);
|
|
10313
|
+
setResultMessage(
|
|
10314
|
+
isBatch ? `${recordCount} record(s) deleted successfully` : "Record deleted successfully"
|
|
10315
|
+
);
|
|
10316
|
+
emitResult({
|
|
10317
|
+
success: true,
|
|
10318
|
+
data: result.data,
|
|
10319
|
+
count: isBatch ? recordCount : 1
|
|
10320
|
+
});
|
|
10321
|
+
} catch (error) {
|
|
10322
|
+
const message = error instanceof Error ? error.message : "Failed to delete record(s)";
|
|
10323
|
+
console.warn("[delete-record] delete failed", error);
|
|
10324
|
+
setResultError(true);
|
|
10325
|
+
setResultMessage(message);
|
|
10326
|
+
emitResult({ success: false, error: message });
|
|
10327
|
+
} finally {
|
|
10328
|
+
setLoading(false);
|
|
10329
|
+
}
|
|
10330
|
+
};
|
|
10331
|
+
const handleReject = () => {
|
|
10332
|
+
setSubmitted(true);
|
|
10333
|
+
setResultError(true);
|
|
10334
|
+
setResultMessage("Deletion cancelled by user");
|
|
10335
|
+
emitResult({ success: false, error: "User cancelled the deletion" });
|
|
10336
|
+
};
|
|
10337
|
+
const showActionButtons = state !== "output-available" && !submitted;
|
|
10338
|
+
return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4 space-y-3", children: [
|
|
10339
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
10340
|
+
/* @__PURE__ */ jsx(Trash2, { className: "size-5 text-rose-500" }),
|
|
10341
|
+
/* @__PURE__ */ jsx("h4", { className: "font-medium text-sm", children: isBatch ? `Delete ${recordCount} ${dataSourceName}` : `Delete ${dataSourceName}` })
|
|
10342
|
+
] }),
|
|
10343
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: isBatch ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10344
|
+
recordCount,
|
|
10345
|
+
" record(s) will be permanently deleted."
|
|
10346
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10347
|
+
"Record ",
|
|
10348
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono", children: recordId || "-" }),
|
|
10349
|
+
" will be permanently deleted."
|
|
10350
|
+
] }) }),
|
|
10351
|
+
fieldsLoading && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
10352
|
+
/* @__PURE__ */ jsx(Loader2, { className: "size-3.5 animate-spin" }),
|
|
10353
|
+
"Loading data source\u2026"
|
|
10354
|
+
] }),
|
|
10355
|
+
showActionButtons && /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
10356
|
+
/* @__PURE__ */ jsxs(
|
|
10357
|
+
Button,
|
|
10358
|
+
{
|
|
10359
|
+
variant: "destructive",
|
|
10360
|
+
size: "sm",
|
|
10361
|
+
disabled: loading || fieldsLoading,
|
|
10362
|
+
onClick: handleApprove,
|
|
10363
|
+
children: [
|
|
10364
|
+
loading ? /* @__PURE__ */ jsx(Loader2, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsx(Trash2, { className: "size-3.5" }),
|
|
10365
|
+
isBatch ? `Delete ${recordCount} Records` : "Delete Record"
|
|
10366
|
+
]
|
|
10367
|
+
}
|
|
10368
|
+
),
|
|
10369
|
+
/* @__PURE__ */ jsxs(
|
|
10370
|
+
Button,
|
|
10371
|
+
{
|
|
10372
|
+
variant: "outline",
|
|
10373
|
+
size: "sm",
|
|
10374
|
+
disabled: loading,
|
|
10375
|
+
onClick: handleReject,
|
|
10376
|
+
children: [
|
|
10377
|
+
/* @__PURE__ */ jsx(XCircle, { className: "size-3.5" }),
|
|
10378
|
+
"Cancel"
|
|
10379
|
+
]
|
|
10380
|
+
}
|
|
10381
|
+
)
|
|
10382
|
+
] }),
|
|
10383
|
+
resultMessage && /* @__PURE__ */ jsx(
|
|
10384
|
+
"div",
|
|
10385
|
+
{
|
|
10386
|
+
className: `text-xs font-medium ${resultError ? "text-destructive" : "text-emerald-600"}`,
|
|
10387
|
+
children: resultMessage
|
|
10388
|
+
}
|
|
10389
|
+
)
|
|
10390
|
+
] });
|
|
10391
|
+
}
|
|
10236
10392
|
function safeParse2(value) {
|
|
10237
10393
|
if (value == null) return null;
|
|
10238
10394
|
if (typeof value === "string") {
|
|
@@ -13315,26 +13471,58 @@ function WorkCanvas({
|
|
|
13315
13471
|
isStreaming && /* @__PURE__ */ jsx(Loader2, { className: "size-8 animate-spin text-primary flex-none" })
|
|
13316
13472
|
] });
|
|
13317
13473
|
}
|
|
13474
|
+
var stringify = (val) => {
|
|
13475
|
+
try {
|
|
13476
|
+
return typeof val === "string" ? val : JSON.stringify(val, null, 2);
|
|
13477
|
+
} catch {
|
|
13478
|
+
return String(val ?? "");
|
|
13479
|
+
}
|
|
13480
|
+
};
|
|
13481
|
+
var resolveAvatarUrl = (subagent) => {
|
|
13482
|
+
const avatar = subagent?.avatar;
|
|
13483
|
+
if (!avatar) {
|
|
13484
|
+
return null;
|
|
13485
|
+
}
|
|
13486
|
+
if (typeof avatar === "string") {
|
|
13487
|
+
return avatar;
|
|
13488
|
+
}
|
|
13489
|
+
return avatar.signed_url || avatar.url || null;
|
|
13490
|
+
};
|
|
13318
13491
|
function SubagentTool({
|
|
13319
13492
|
toolState,
|
|
13320
13493
|
input,
|
|
13321
13494
|
status,
|
|
13322
|
-
skillName,
|
|
13323
|
-
agentName,
|
|
13324
13495
|
step,
|
|
13325
13496
|
result,
|
|
13326
|
-
|
|
13497
|
+
subagent,
|
|
13327
13498
|
openCanvasView
|
|
13328
13499
|
}) {
|
|
13500
|
+
const [open, setOpen] = useState(true);
|
|
13329
13501
|
const [steps, setSteps] = useState([]);
|
|
13502
|
+
const [avatarLoaded, setAvatarLoaded] = useState(false);
|
|
13503
|
+
const [streamedContent, setStreamedContent] = useState("");
|
|
13330
13504
|
const hasOpenedXlsx = useRef(false);
|
|
13331
13505
|
const prevStep = useRef(void 0);
|
|
13506
|
+
const lastDeltaRef = useRef(void 0);
|
|
13507
|
+
useEffect(() => {
|
|
13508
|
+
const delta = result?.delta;
|
|
13509
|
+
if (typeof delta === "string" && delta && delta !== lastDeltaRef.current) {
|
|
13510
|
+
lastDeltaRef.current = delta;
|
|
13511
|
+
setStreamedContent((prev) => prev + delta);
|
|
13512
|
+
}
|
|
13513
|
+
}, [result?.delta]);
|
|
13514
|
+
const avatarUrl = useMemo(() => resolveAvatarUrl(subagent), [subagent]);
|
|
13332
13515
|
useEffect(() => {
|
|
13333
|
-
|
|
13516
|
+
setAvatarLoaded(false);
|
|
13517
|
+
}, [avatarUrl]);
|
|
13518
|
+
useEffect(() => {
|
|
13519
|
+
if (!step?.step || step === prevStep.current) {
|
|
13520
|
+
return;
|
|
13521
|
+
}
|
|
13334
13522
|
prevStep.current = step;
|
|
13335
13523
|
let message = step.step?.name || "Processing...";
|
|
13336
|
-
if (
|
|
13337
|
-
const stepConfig =
|
|
13524
|
+
if (Array.isArray(subagent?.steps)) {
|
|
13525
|
+
const stepConfig = subagent.steps.find((s) => s.id === step.step?.id);
|
|
13338
13526
|
const messageTemplates = stepConfig?.messageTemplates;
|
|
13339
13527
|
const template = step.eventType === "start" ? messageTemplates?.in_progress : messageTemplates?.completed;
|
|
13340
13528
|
if (template) {
|
|
@@ -13342,82 +13530,139 @@ function SubagentTool({
|
|
|
13342
13530
|
}
|
|
13343
13531
|
}
|
|
13344
13532
|
setSteps((prev) => [...prev, { data: step, message }]);
|
|
13345
|
-
}, [step,
|
|
13533
|
+
}, [step, subagent]);
|
|
13534
|
+
const effectiveType = input?.type ?? result?.type ?? null;
|
|
13346
13535
|
useEffect(() => {
|
|
13347
|
-
if (
|
|
13536
|
+
if (effectiveType === "xlsx" && status === "success" && result?.workId && !hasOpenedXlsx.current) {
|
|
13348
13537
|
hasOpenedXlsx.current = true;
|
|
13349
13538
|
openCanvasView?.({
|
|
13350
13539
|
type: "xlsx",
|
|
13351
13540
|
id: result.workId,
|
|
13352
13541
|
versionId: result.workVersionId,
|
|
13542
|
+
workId: result.workId,
|
|
13353
13543
|
title: result.title,
|
|
13354
13544
|
contentJson: result.content
|
|
13355
13545
|
});
|
|
13356
13546
|
}
|
|
13357
13547
|
}, [
|
|
13358
|
-
|
|
13548
|
+
effectiveType,
|
|
13359
13549
|
status,
|
|
13360
13550
|
result,
|
|
13361
13551
|
openCanvasView
|
|
13362
13552
|
]);
|
|
13553
|
+
const displayName = subagent?.agentName || subagent?.name || input?.agentName || "";
|
|
13363
13554
|
const isLoading = toolState === "input-streaming" || status === "started";
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
/* @__PURE__ */ jsx(
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13555
|
+
const renderBody = () => {
|
|
13556
|
+
if (isLoading) {
|
|
13557
|
+
return /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin text-muted-foreground" });
|
|
13558
|
+
}
|
|
13559
|
+
if (effectiveType === "text") {
|
|
13560
|
+
const content = result?.content || streamedContent;
|
|
13561
|
+
if (content) {
|
|
13562
|
+
const isStreaming = !result?.content && status !== "success";
|
|
13563
|
+
return /* @__PURE__ */ jsx(MessageResponse, { mode: isStreaming ? "streaming" : "static", children: content });
|
|
13564
|
+
}
|
|
13565
|
+
return /* @__PURE__ */ jsx("div", { className: "text-xs text-slate-500 italic", children: "No content returned." });
|
|
13566
|
+
}
|
|
13567
|
+
if (effectiveType === "image") {
|
|
13568
|
+
return /* @__PURE__ */ jsx(
|
|
13569
|
+
preview_image_default,
|
|
13570
|
+
{
|
|
13571
|
+
title: result?.title || input?.prompt || "Generated image",
|
|
13572
|
+
images: result?.images || result?.url
|
|
13573
|
+
}
|
|
13574
|
+
);
|
|
13575
|
+
}
|
|
13576
|
+
if (effectiveType === "xlsx") {
|
|
13577
|
+
if (status !== "success") {
|
|
13578
|
+
return /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin text-muted-foreground" });
|
|
13579
|
+
}
|
|
13580
|
+
return /* @__PURE__ */ jsx(
|
|
13380
13581
|
WorkCanvas,
|
|
13381
13582
|
{
|
|
13382
13583
|
title: result?.title,
|
|
13383
13584
|
description: result?.description,
|
|
13384
13585
|
id: result?.workId || "streaming",
|
|
13385
|
-
content:
|
|
13586
|
+
content: stringify(result?.content),
|
|
13386
13587
|
state: toolState,
|
|
13387
13588
|
onOpen: () => openCanvasView?.({
|
|
13388
13589
|
type: "xlsx",
|
|
13389
13590
|
id: result?.workId,
|
|
13390
13591
|
versionId: result?.workVersionId,
|
|
13592
|
+
workId: result?.workId,
|
|
13391
13593
|
title: result?.title,
|
|
13392
13594
|
contentJson: result?.content
|
|
13393
13595
|
})
|
|
13394
13596
|
}
|
|
13395
|
-
)
|
|
13396
|
-
|
|
13397
|
-
|
|
13398
|
-
|
|
13399
|
-
|
|
13597
|
+
);
|
|
13598
|
+
}
|
|
13599
|
+
if (effectiveType === "work") {
|
|
13600
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
13601
|
+
steps.length > 0 && /* @__PURE__ */ jsx("div", { className: "space-y-1 mb-2", children: steps.map((stepItem, idx) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-slate-600", children: [
|
|
13602
|
+
/* @__PURE__ */ jsx(CheckCircle, { className: "size-4" }),
|
|
13603
|
+
/* @__PURE__ */ jsx("span", { children: stepItem.message })
|
|
13400
13604
|
] }, idx)) }),
|
|
13401
13605
|
status === "success" && /* @__PURE__ */ jsx(
|
|
13402
13606
|
WorkCanvas,
|
|
13403
13607
|
{
|
|
13404
|
-
title: result?.title
|
|
13405
|
-
description: result?.description
|
|
13608
|
+
title: result?.title,
|
|
13609
|
+
description: result?.description,
|
|
13406
13610
|
id: result?.workId || "streaming",
|
|
13407
|
-
content:
|
|
13611
|
+
content: stringify(result?.content),
|
|
13408
13612
|
state: toolState,
|
|
13409
13613
|
onOpen: () => openCanvasView?.({
|
|
13410
13614
|
type: input?.workType,
|
|
13411
13615
|
id: result?.workId || "streaming",
|
|
13412
13616
|
versionId: result?.workVersionId || "streaming",
|
|
13413
|
-
title: result?.content?.
|
|
13414
|
-
description: result?.content?.
|
|
13617
|
+
title: result?.content?.title,
|
|
13618
|
+
description: result?.content?.description,
|
|
13415
13619
|
contentJson: result?.content
|
|
13416
13620
|
})
|
|
13417
13621
|
}
|
|
13418
13622
|
)
|
|
13419
|
-
] })
|
|
13420
|
-
|
|
13623
|
+
] });
|
|
13624
|
+
}
|
|
13625
|
+
if (typeof result?.content === "string" && result.content) {
|
|
13626
|
+
return /* @__PURE__ */ jsx(MessageResponse, { children: result.content });
|
|
13627
|
+
}
|
|
13628
|
+
if (result) {
|
|
13629
|
+
return /* @__PURE__ */ jsx("pre", { className: "text-xs text-slate-600 whitespace-pre-wrap break-words", children: stringify(result) });
|
|
13630
|
+
}
|
|
13631
|
+
return /* @__PURE__ */ jsx("div", { className: "text-xs text-slate-500 italic", children: "No content returned." });
|
|
13632
|
+
};
|
|
13633
|
+
return /* @__PURE__ */ jsxs("div", { className: "my-3", children: [
|
|
13634
|
+
/* @__PURE__ */ jsxs(
|
|
13635
|
+
"button",
|
|
13636
|
+
{
|
|
13637
|
+
type: "button",
|
|
13638
|
+
className: "flex items-center gap-1.5 text-xs text-slate-600 hover:text-slate-900 transition-colors",
|
|
13639
|
+
onClick: () => setOpen((o) => !o),
|
|
13640
|
+
children: [
|
|
13641
|
+
/* @__PURE__ */ jsx("span", { className: "text-slate-500", children: "Agent Called:" }),
|
|
13642
|
+
/* @__PURE__ */ jsx("span", { className: "size-4 rounded-full bg-slate-100 flex-shrink-0 overflow-hidden inline-flex items-center justify-center", children: avatarUrl ? /* @__PURE__ */ jsx(
|
|
13643
|
+
"img",
|
|
13644
|
+
{
|
|
13645
|
+
src: avatarUrl,
|
|
13646
|
+
alt: displayName,
|
|
13647
|
+
className: cn("size-4 object-cover", !avatarLoaded && "invisible"),
|
|
13648
|
+
onLoad: () => setAvatarLoaded(true)
|
|
13649
|
+
},
|
|
13650
|
+
avatarUrl
|
|
13651
|
+
) : /* @__PURE__ */ jsx(User, { className: "size-3 text-slate-400" }) }),
|
|
13652
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-slate-900 truncate", children: displayName }),
|
|
13653
|
+
/* @__PURE__ */ jsx(
|
|
13654
|
+
ChevronDown,
|
|
13655
|
+
{
|
|
13656
|
+
className: cn(
|
|
13657
|
+
"size-3 text-slate-400 flex-shrink-0 transition-transform",
|
|
13658
|
+
!open && "-rotate-90"
|
|
13659
|
+
)
|
|
13660
|
+
}
|
|
13661
|
+
)
|
|
13662
|
+
]
|
|
13663
|
+
}
|
|
13664
|
+
),
|
|
13665
|
+
open && /* @__PURE__ */ jsx("div", { className: "mt-2 pt-2 border-t border-slate-100", children: renderBody() })
|
|
13421
13666
|
] });
|
|
13422
13667
|
}
|
|
13423
13668
|
var commandConfig = {
|
|
@@ -13631,7 +13876,7 @@ function TextEditorTool({
|
|
|
13631
13876
|
isStreaming && /* @__PURE__ */ jsx(Loader2, { className: "size-6 animate-spin text-primary flex-none" })
|
|
13632
13877
|
] });
|
|
13633
13878
|
}
|
|
13634
|
-
var
|
|
13879
|
+
var stringify2 = (val) => {
|
|
13635
13880
|
try {
|
|
13636
13881
|
return typeof val === "string" ? val : JSON.stringify(val, null, 2);
|
|
13637
13882
|
} catch {
|
|
@@ -13649,7 +13894,7 @@ function GenerativeUITool({
|
|
|
13649
13894
|
onInsertText,
|
|
13650
13895
|
onReplaceText,
|
|
13651
13896
|
workId,
|
|
13652
|
-
|
|
13897
|
+
subagents
|
|
13653
13898
|
}) {
|
|
13654
13899
|
const { t } = useAssistantTranslation();
|
|
13655
13900
|
const emitToolAction = (decision) => {
|
|
@@ -13782,6 +14027,20 @@ function GenerativeUITool({
|
|
|
13782
14027
|
}
|
|
13783
14028
|
) });
|
|
13784
14029
|
}
|
|
14030
|
+
if (toolName === "deleteRecord") {
|
|
14031
|
+
return /* @__PURE__ */ jsx("div", { className: "not-prose mb-4 w-full", children: /* @__PURE__ */ jsx(
|
|
14032
|
+
DeleteRecord,
|
|
14033
|
+
{
|
|
14034
|
+
dataSourceId: part.input?.dataSourceId,
|
|
14035
|
+
recordId: part.input?.recordId,
|
|
14036
|
+
recordIds: part.input?.recordIds,
|
|
14037
|
+
state: part.state,
|
|
14038
|
+
toolName,
|
|
14039
|
+
toolCallId: part.toolCallId,
|
|
14040
|
+
onToolAction
|
|
14041
|
+
}
|
|
14042
|
+
) });
|
|
14043
|
+
}
|
|
13785
14044
|
if (toolName === "showCreateRecordForm" || toolName === "showUpdateRecordForm" || toolName === "showRecordDetailsForm") {
|
|
13786
14045
|
const recordMode = toolName === "showCreateRecordForm" ? "add" : toolName === "showUpdateRecordForm" ? "edit" : "view";
|
|
13787
14046
|
const dataSourceId = part.input?.dataSourceId || part.output?.result?.dataSourceId;
|
|
@@ -13969,19 +14228,17 @@ function GenerativeUITool({
|
|
|
13969
14228
|
}
|
|
13970
14229
|
if (toolName.startsWith("call") && toolName.endsWith("Agent") && (part.state === "input-available" || part.state === "input-streaming" || part.state === "output-available")) {
|
|
13971
14230
|
const output = part.output;
|
|
14231
|
+
const agentId = output?.result?.agentId || part.input?.agentId;
|
|
14232
|
+
const subagent = agentId && subagents?.length ? subagents.find((a) => (a.id || a.agentId) === agentId) || null : null;
|
|
13972
14233
|
return /* @__PURE__ */ jsx("div", { className: "not-prose mb-4 w-full", children: /* @__PURE__ */ jsx(
|
|
13973
14234
|
SubagentTool,
|
|
13974
14235
|
{
|
|
13975
14236
|
toolState: part.state,
|
|
13976
14237
|
input: part.input,
|
|
13977
14238
|
status: output?.status,
|
|
13978
|
-
text: output?.text,
|
|
13979
|
-
icon: output?.icon,
|
|
13980
|
-
skillName: output?.skillName,
|
|
13981
|
-
agentName: output?.agentName,
|
|
13982
14239
|
step: output?.step,
|
|
13983
14240
|
result: output?.result,
|
|
13984
|
-
|
|
14241
|
+
subagent,
|
|
13985
14242
|
openCanvasView
|
|
13986
14243
|
}
|
|
13987
14244
|
) });
|
|
@@ -14106,7 +14363,7 @@ function GenerativeUITool({
|
|
|
14106
14363
|
if (part.state === "output-available") {
|
|
14107
14364
|
return /* @__PURE__ */ jsx("div", { className: "not-prose mb-4 w-full", children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-3", children: [
|
|
14108
14365
|
/* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-muted-foreground mb-1", children: t("sections.output") }),
|
|
14109
|
-
/* @__PURE__ */ jsx(CodeBlock, { code:
|
|
14366
|
+
/* @__PURE__ */ jsx(CodeBlock, { code: stringify2(part.output), language: "json", children: /* @__PURE__ */ jsx(CodeBlockCopyButton, {}) })
|
|
14110
14367
|
] }) });
|
|
14111
14368
|
}
|
|
14112
14369
|
if (part.state === "output-error") {
|
|
@@ -14295,7 +14552,8 @@ var INTERACTIVE_GENERATIVE_TOOLS = /* @__PURE__ */ new Set([
|
|
|
14295
14552
|
"requestUserInput",
|
|
14296
14553
|
"createRecord",
|
|
14297
14554
|
"updateRecord",
|
|
14298
|
-
"viewRecord"
|
|
14555
|
+
"viewRecord",
|
|
14556
|
+
"deleteRecord"
|
|
14299
14557
|
]);
|
|
14300
14558
|
function CopyButton({ text }) {
|
|
14301
14559
|
const { t } = useAssistantTranslation();
|
|
@@ -14376,7 +14634,8 @@ var MessageItem = memo(({
|
|
|
14376
14634
|
onToolAction: onToolAction ?? (() => {
|
|
14377
14635
|
}),
|
|
14378
14636
|
openCanvasView,
|
|
14379
|
-
onForwardToAgent
|
|
14637
|
+
onForwardToAgent,
|
|
14638
|
+
subagents: agents
|
|
14380
14639
|
},
|
|
14381
14640
|
`${messageId}-gentool-${idx}`
|
|
14382
14641
|
);
|
|
@@ -14614,7 +14873,8 @@ function ChatPanel({
|
|
|
14614
14873
|
onSessionClick,
|
|
14615
14874
|
threadId,
|
|
14616
14875
|
initialModelId,
|
|
14617
|
-
initialFeatures
|
|
14876
|
+
initialFeatures,
|
|
14877
|
+
subagents
|
|
14618
14878
|
}) {
|
|
14619
14879
|
const renderInputArea = (hideFooter = false) => /* @__PURE__ */ jsx(
|
|
14620
14880
|
AIInputArea,
|
|
@@ -14707,6 +14967,7 @@ function ChatPanel({
|
|
|
14707
14967
|
welcomeMessage,
|
|
14708
14968
|
isLoadingAgent,
|
|
14709
14969
|
agentId: tenantAiAgentId,
|
|
14970
|
+
agents: subagents,
|
|
14710
14971
|
onToolAction,
|
|
14711
14972
|
openCanvasView,
|
|
14712
14973
|
onEditPrompt,
|
|
@@ -17637,7 +17898,7 @@ var buttonVariants = cva(
|
|
|
17637
17898
|
}
|
|
17638
17899
|
}
|
|
17639
17900
|
);
|
|
17640
|
-
var
|
|
17901
|
+
var Button31 = withTooltip(({
|
|
17641
17902
|
active,
|
|
17642
17903
|
asChild = false,
|
|
17643
17904
|
children,
|
|
@@ -18245,7 +18506,7 @@ function AIMenu() {
|
|
|
18245
18506
|
}
|
|
18246
18507
|
),
|
|
18247
18508
|
/* @__PURE__ */ jsx(
|
|
18248
|
-
|
|
18509
|
+
Button31,
|
|
18249
18510
|
{
|
|
18250
18511
|
className: "no-focus-ring mt-1 shrink-0",
|
|
18251
18512
|
disabled: !isLoading && input.trim().length === 0,
|
|
@@ -19119,7 +19380,7 @@ function Comment(props) {
|
|
|
19119
19380
|
] }),
|
|
19120
19381
|
isMyComment && (hovering || dropdownOpen) && /* @__PURE__ */ jsxs("div", { className: "absolute top-0 right-0 flex space-x-1", children: [
|
|
19121
19382
|
index === 0 && /* @__PURE__ */ jsx(
|
|
19122
|
-
|
|
19383
|
+
Button31,
|
|
19123
19384
|
{
|
|
19124
19385
|
className: "h-6 p-1 text-muted-foreground",
|
|
19125
19386
|
onClick: onResolveComment,
|
|
@@ -19168,7 +19429,7 @@ function Comment(props) {
|
|
|
19168
19429
|
),
|
|
19169
19430
|
isEditing && /* @__PURE__ */ jsxs("div", { className: "ml-auto flex shrink-0 gap-1", children: [
|
|
19170
19431
|
/* @__PURE__ */ jsx(
|
|
19171
|
-
|
|
19432
|
+
Button31,
|
|
19172
19433
|
{
|
|
19173
19434
|
className: "size-[28px]",
|
|
19174
19435
|
onClick: (e) => {
|
|
@@ -19181,7 +19442,7 @@ function Comment(props) {
|
|
|
19181
19442
|
}
|
|
19182
19443
|
),
|
|
19183
19444
|
/* @__PURE__ */ jsx(
|
|
19184
|
-
|
|
19445
|
+
Button31,
|
|
19185
19446
|
{
|
|
19186
19447
|
onClick: (e) => {
|
|
19187
19448
|
e.stopPropagation();
|
|
@@ -19249,7 +19510,7 @@ function CommentMoreDropdown(props) {
|
|
|
19249
19510
|
onOpenChange: setDropdownOpen,
|
|
19250
19511
|
open: dropdownOpen,
|
|
19251
19512
|
children: [
|
|
19252
|
-
/* @__PURE__ */ jsx(DropdownMenuTrigger3, { asChild: true, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(
|
|
19513
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger3, { asChild: true, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(Button31, { className: cn("h-6 p-1 text-muted-foreground"), variant: "ghost", children: /* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "size-4" }) }) }),
|
|
19253
19514
|
/* @__PURE__ */ jsx(
|
|
19254
19515
|
DropdownMenuContent3,
|
|
19255
19516
|
{
|
|
@@ -19421,7 +19682,7 @@ function CommentCreateForm({
|
|
|
19421
19682
|
}
|
|
19422
19683
|
),
|
|
19423
19684
|
/* @__PURE__ */ jsx(
|
|
19424
|
-
|
|
19685
|
+
Button31,
|
|
19425
19686
|
{
|
|
19426
19687
|
className: "absolute right-0 bottom-0 ml-auto shrink-0",
|
|
19427
19688
|
disabled: commentContent.trim().length === 0,
|
|
@@ -19755,7 +20016,7 @@ function BlockSuggestionCard({
|
|
|
19755
20016
|
)),
|
|
19756
20017
|
hovering && /* @__PURE__ */ jsxs("div", { className: "absolute top-4 right-4 flex gap-2", children: [
|
|
19757
20018
|
/* @__PURE__ */ jsx(
|
|
19758
|
-
|
|
20019
|
+
Button31,
|
|
19759
20020
|
{
|
|
19760
20021
|
variant: "ghost",
|
|
19761
20022
|
className: "size-6 p-1 text-muted-foreground",
|
|
@@ -19764,7 +20025,7 @@ function BlockSuggestionCard({
|
|
|
19764
20025
|
}
|
|
19765
20026
|
),
|
|
19766
20027
|
/* @__PURE__ */ jsx(
|
|
19767
|
-
|
|
20028
|
+
Button31,
|
|
19768
20029
|
{
|
|
19769
20030
|
variant: "ghost",
|
|
19770
20031
|
className: "size-6 p-1 text-muted-foreground",
|
|
@@ -20234,7 +20495,7 @@ var BlockCommentsContent = ({
|
|
|
20234
20495
|
}
|
|
20235
20496
|
),
|
|
20236
20497
|
totalCount > 0 && /* @__PURE__ */ jsx("div", { className: "relative left-0 size-0 select-none", children: /* @__PURE__ */ jsx(PopoverTrigger11, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
20237
|
-
|
|
20498
|
+
Button31,
|
|
20238
20499
|
{
|
|
20239
20500
|
className: "mt-1 ml-1 flex h-6 gap-1 px-1.5 py-0 text-muted-foreground/80 hover:text-muted-foreground/80 data-[active=true]:bg-muted",
|
|
20240
20501
|
contentEditable: false,
|
|
@@ -22150,7 +22411,7 @@ function BlockActionButton({
|
|
|
22150
22411
|
const editor = useEditorRef();
|
|
22151
22412
|
const element = useElement();
|
|
22152
22413
|
return /* @__PURE__ */ jsx(
|
|
22153
|
-
|
|
22414
|
+
Button31,
|
|
22154
22415
|
{
|
|
22155
22416
|
className: cn(
|
|
22156
22417
|
defaultStyles && "absolute top-1 right-1 opacity-0 transition-opacity group-hover:opacity-100",
|
|
@@ -22489,7 +22750,7 @@ function EmojiPickerSearchAndClear({
|
|
|
22489
22750
|
}
|
|
22490
22751
|
),
|
|
22491
22752
|
searchValue && /* @__PURE__ */ jsx(
|
|
22492
|
-
|
|
22753
|
+
Button31,
|
|
22493
22754
|
{
|
|
22494
22755
|
"aria-label": "Clear",
|
|
22495
22756
|
className: cn(
|
|
@@ -22578,7 +22839,7 @@ function EmojiPickerNavigation({
|
|
|
22578
22839
|
id: "emoji-nav",
|
|
22579
22840
|
children: /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
|
|
22580
22841
|
emojiLibrary.getGrid().sections().map(({ id }) => /* @__PURE__ */ jsx(
|
|
22581
|
-
|
|
22842
|
+
Button31,
|
|
22582
22843
|
{
|
|
22583
22844
|
"aria-label": i18n.categories[id],
|
|
22584
22845
|
className: cn(
|
|
@@ -22740,7 +23001,7 @@ function CalloutElement(props) {
|
|
|
22740
23001
|
{
|
|
22741
23002
|
...emojiToolbarDropdownProps,
|
|
22742
23003
|
control: /* @__PURE__ */ jsx(
|
|
22743
|
-
|
|
23004
|
+
Button31,
|
|
22744
23005
|
{
|
|
22745
23006
|
className: "size-6 select-none p-1 text-[18px] hover:bg-muted-foreground/15",
|
|
22746
23007
|
contentEditable: false,
|
|
@@ -22979,7 +23240,7 @@ function CodeBlockElement(props) {
|
|
|
22979
23240
|
contentEditable: false,
|
|
22980
23241
|
children: [
|
|
22981
23242
|
/* @__PURE__ */ jsxs(
|
|
22982
|
-
|
|
23243
|
+
Button31,
|
|
22983
23244
|
{
|
|
22984
23245
|
className: "relative top-0 right-0 w-auto",
|
|
22985
23246
|
onClick: () => {
|
|
@@ -23024,7 +23285,7 @@ function CodeBlockCombobox({ className }) {
|
|
|
23024
23285
|
if (readOnly) return null;
|
|
23025
23286
|
return /* @__PURE__ */ jsxs(Popover11, { onOpenChange: setOpen, open, children: [
|
|
23026
23287
|
/* @__PURE__ */ jsx(PopoverTrigger11, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
23027
|
-
|
|
23288
|
+
Button31,
|
|
23028
23289
|
{
|
|
23029
23290
|
"aria-expanded": open,
|
|
23030
23291
|
className: cn(
|
|
@@ -23385,7 +23646,7 @@ function Draggable(props) {
|
|
|
23385
23646
|
),
|
|
23386
23647
|
children: [
|
|
23387
23648
|
/* @__PURE__ */ jsx(
|
|
23388
|
-
|
|
23649
|
+
Button31,
|
|
23389
23650
|
{
|
|
23390
23651
|
className: "absolute right-0 h-6 w-6 p-0",
|
|
23391
23652
|
"data-plate-prevent-deselect": true,
|
|
@@ -23572,7 +23833,7 @@ var DraggableInsertHandle = () => {
|
|
|
23572
23833
|
const editor = useEditorRef();
|
|
23573
23834
|
const element = useElement();
|
|
23574
23835
|
return /* @__PURE__ */ jsx(
|
|
23575
|
-
|
|
23836
|
+
Button31,
|
|
23576
23837
|
{
|
|
23577
23838
|
className: "size-6 shrink-0 p-1",
|
|
23578
23839
|
onClick: (event) => {
|
|
@@ -24803,7 +25064,7 @@ function EquationPopoverContent({
|
|
|
24803
25064
|
...props
|
|
24804
25065
|
}
|
|
24805
25066
|
),
|
|
24806
|
-
/* @__PURE__ */ jsxs(
|
|
25067
|
+
/* @__PURE__ */ jsxs(Button31, { className: "px-3", onClick: onClose, variant: "brand", children: [
|
|
24807
25068
|
"Done ",
|
|
24808
25069
|
/* @__PURE__ */ jsx(CornerDownLeftIcon, { className: "size-3.5" })
|
|
24809
25070
|
] })
|
|
@@ -25681,7 +25942,7 @@ function MediaPlaceholderPopover({ children }) {
|
|
|
25681
25942
|
/* @__PURE__ */ jsx(TabsTrigger, { value: "password", children: "Embed link" })
|
|
25682
25943
|
] }),
|
|
25683
25944
|
/* @__PURE__ */ jsxs(TabsContent, { className: "w-[300px] px-3 py-2", value: "account", children: [
|
|
25684
|
-
/* @__PURE__ */ jsx(
|
|
25945
|
+
/* @__PURE__ */ jsx(Button31, { className: "w-full", onClick: openFilePicker, variant: "brand", children: currentMedia.buttonText }),
|
|
25685
25946
|
/* @__PURE__ */ jsx("div", { className: "mt-3 text-muted-foreground text-xs", children: "The maximum size per file is 5MB" })
|
|
25686
25947
|
] }),
|
|
25687
25948
|
/* @__PURE__ */ jsxs(
|
|
@@ -25699,7 +25960,7 @@ function MediaPlaceholderPopover({ children }) {
|
|
|
25699
25960
|
}
|
|
25700
25961
|
),
|
|
25701
25962
|
/* @__PURE__ */ jsx(
|
|
25702
|
-
|
|
25963
|
+
Button31,
|
|
25703
25964
|
{
|
|
25704
25965
|
className: "mt-2 w-full max-w-[300px]",
|
|
25705
25966
|
onClick: () => onEmbed(embedValue),
|
|
@@ -25819,12 +26080,12 @@ function ImagePreview() {
|
|
|
25819
26080
|
onClick: (e) => e.stopPropagation(),
|
|
25820
26081
|
children: [
|
|
25821
26082
|
!prevDisabled && !nextDisabled && /* @__PURE__ */ jsxs("div", { className: "flex rounded-sm bg-black/70", children: [
|
|
25822
|
-
/* @__PURE__ */ jsx(
|
|
25823
|
-
/* @__PURE__ */ jsx(
|
|
26083
|
+
/* @__PURE__ */ jsx(Button31, { ...prevProps, disabled: prevDisabled, children: /* @__PURE__ */ jsx(ArrowLeftIcon, { className: "size-5" }) }),
|
|
26084
|
+
/* @__PURE__ */ jsx(Button31, { ...nextProps, disabled: nextDisabled, children: /* @__PURE__ */ jsx(ArrowRightIcon, { className: "size-5" }) })
|
|
25824
26085
|
] }),
|
|
25825
26086
|
currentPreview && /* @__PURE__ */ jsxs("div", { className: "flex rounded-sm bg-black/70", children: [
|
|
25826
26087
|
/* @__PURE__ */ jsx(
|
|
25827
|
-
|
|
26088
|
+
Button31,
|
|
25828
26089
|
{
|
|
25829
26090
|
...zommOutProps,
|
|
25830
26091
|
disabled: zoomOutDisabled,
|
|
@@ -25837,7 +26098,7 @@ function ImagePreview() {
|
|
|
25837
26098
|
/* @__PURE__ */ jsx("div", { children: "%" })
|
|
25838
26099
|
] }),
|
|
25839
26100
|
/* @__PURE__ */ jsx(
|
|
25840
|
-
|
|
26101
|
+
Button31,
|
|
25841
26102
|
{
|
|
25842
26103
|
...zoomInProps,
|
|
25843
26104
|
disabled: zoomInDisabled,
|
|
@@ -25846,7 +26107,7 @@ function ImagePreview() {
|
|
|
25846
26107
|
}
|
|
25847
26108
|
),
|
|
25848
26109
|
/* @__PURE__ */ jsx(
|
|
25849
|
-
|
|
26110
|
+
Button31,
|
|
25850
26111
|
{
|
|
25851
26112
|
onClick: () => {
|
|
25852
26113
|
void downloadFile(currentPreview.url, currentPreview.id);
|
|
@@ -25855,7 +26116,7 @@ function ImagePreview() {
|
|
|
25855
26116
|
children: /* @__PURE__ */ jsx(CircleArrowDown, { className: "size-4" })
|
|
25856
26117
|
}
|
|
25857
26118
|
),
|
|
25858
|
-
/* @__PURE__ */ jsx(
|
|
26119
|
+
/* @__PURE__ */ jsx(Button31, { ...closeProps, tooltip: "Close", children: /* @__PURE__ */ jsx(Minimize2, { className: "size-4" }) })
|
|
25859
26120
|
] })
|
|
25860
26121
|
]
|
|
25861
26122
|
}
|
|
@@ -26495,7 +26756,7 @@ var TableElement = withHOC(
|
|
|
26495
26756
|
"group-has-[tr:last-child:hover]/table:opacity-100 max-sm:group-has-[tr[data-selected]:last-child]/table:opacity-100"
|
|
26496
26757
|
),
|
|
26497
26758
|
children: /* @__PURE__ */ jsx(
|
|
26498
|
-
|
|
26759
|
+
Button31,
|
|
26499
26760
|
{
|
|
26500
26761
|
className: "flex h-4 w-full grow items-center justify-center bg-muted",
|
|
26501
26762
|
onClick: () => tf.insert.tableRow({ at: editor.api.findPath(element) }),
|
|
@@ -26517,7 +26778,7 @@ var TableElement = withHOC(
|
|
|
26517
26778
|
"group-has-[td:last-child:hover,th:last-child:hover]/table:opacity-100 max-sm:group-has-[td[data-selected]:last-child,th[data-selected]:last-child]/table:opacity-100"
|
|
26518
26779
|
),
|
|
26519
26780
|
children: /* @__PURE__ */ jsx(
|
|
26520
|
-
|
|
26781
|
+
Button31,
|
|
26521
26782
|
{
|
|
26522
26783
|
className: "flex h-full w-4 grow items-center justify-center bg-muted",
|
|
26523
26784
|
onClick: () => tf.insert.tableColumn({
|
|
@@ -26541,7 +26802,7 @@ var TableElement = withHOC(
|
|
|
26541
26802
|
"group-has-[td:last-child:hover,th:last-child:hover]/table:group-has-[tr:last-child:hover]/table:opacity-100 max-sm:group-has-[td[data-selected]:last-child,th[data-selected]:last-child]/table:group-has-[tr[data-selected]:last-child]/table:opacity-100"
|
|
26542
26803
|
),
|
|
26543
26804
|
children: /* @__PURE__ */ jsx(
|
|
26544
|
-
|
|
26805
|
+
Button31,
|
|
26545
26806
|
{
|
|
26546
26807
|
className: "flex size-4 items-center justify-center rounded-full bg-muted",
|
|
26547
26808
|
onClick: () => {
|
|
@@ -26747,7 +27008,7 @@ function TocElement(props) {
|
|
|
26747
27008
|
const { headingList } = state;
|
|
26748
27009
|
return /* @__PURE__ */ jsxs(PlateElement, { ...props, className: "my-1", children: [
|
|
26749
27010
|
/* @__PURE__ */ jsx("div", { contentEditable: false, children: headingList.length > 0 ? headingList.map((item) => /* @__PURE__ */ jsx(
|
|
26750
|
-
|
|
27011
|
+
Button31,
|
|
26751
27012
|
{
|
|
26752
27013
|
"aria-current": true,
|
|
26753
27014
|
className: headingItemVariants({ depth: item.depth }),
|
|
@@ -27849,7 +28110,7 @@ function TocElementStatic(props) {
|
|
|
27849
28110
|
const headingList = getHeadingList(editor);
|
|
27850
28111
|
return /* @__PURE__ */ jsxs(SlateElement, { ...props, className: "mb-1 p-0", children: [
|
|
27851
28112
|
/* @__PURE__ */ jsx("div", { children: headingList.length > 0 ? headingList.map((item) => /* @__PURE__ */ jsx(
|
|
27852
|
-
|
|
28113
|
+
Button31,
|
|
27853
28114
|
{
|
|
27854
28115
|
className: headingItemVariants2({ depth: item.depth }),
|
|
27855
28116
|
variant: "ghost",
|
|
@@ -29816,6 +30077,7 @@ var AssistantView = ({ ref, ...props }) => {
|
|
|
29816
30077
|
threadId: commonProps2.threadId,
|
|
29817
30078
|
initialModelId: commonProps2.initialModelId,
|
|
29818
30079
|
initialFeatures: commonProps2.initialFeatures,
|
|
30080
|
+
subagents: commonProps2.subagents,
|
|
29819
30081
|
messagesClassName: "p-4"
|
|
29820
30082
|
}
|
|
29821
30083
|
);
|
|
@@ -30275,6 +30537,7 @@ var AssistantView = ({ ref, ...props }) => {
|
|
|
30275
30537
|
threadId: commonProps.threadId,
|
|
30276
30538
|
initialModelId: commonProps.initialModelId,
|
|
30277
30539
|
initialFeatures: commonProps.initialFeatures,
|
|
30540
|
+
subagents: commonProps.subagents,
|
|
30278
30541
|
compactToolbar: !isFullscreen
|
|
30279
30542
|
}
|
|
30280
30543
|
)
|
|
@@ -31789,7 +32052,7 @@ var DocyAssistant = ({
|
|
|
31789
32052
|
]);
|
|
31790
32053
|
const apiClientRef = useRef(apiClient);
|
|
31791
32054
|
apiClientRef.current = apiClient;
|
|
31792
|
-
const { agentDetails, isLoadingAgentDetails } = useAssistantApi({
|
|
32055
|
+
const { agentDetails, isLoadingAgentDetails, subagents } = useAssistantApi({
|
|
31793
32056
|
tenantAiAgentId: activeAgentId,
|
|
31794
32057
|
deploymentId,
|
|
31795
32058
|
logo,
|
|
@@ -32210,6 +32473,7 @@ var DocyAssistant = ({
|
|
|
32210
32473
|
supportMultiModels,
|
|
32211
32474
|
deploymentId,
|
|
32212
32475
|
tenantAiAgentId: activeAgentId,
|
|
32476
|
+
subagents,
|
|
32213
32477
|
initialModelId,
|
|
32214
32478
|
initialFeatures,
|
|
32215
32479
|
enableMicrophone,
|