@lukeashford/aurelius 4.3.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +31 -5
- package/dist/index.d.ts +31 -5
- package/dist/index.js +54 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +114 -79
- package/dist/index.mjs.map +1 -1
- package/llms.md +7 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1275,7 +1275,7 @@ var ListSubheader = React14.forwardRef(
|
|
|
1275
1275
|
ListSubheader.displayName = "ListSubheader";
|
|
1276
1276
|
|
|
1277
1277
|
// src/components/FileChip.tsx
|
|
1278
|
-
import React15 from "react";
|
|
1278
|
+
import React15, { useState as useState2 } from "react";
|
|
1279
1279
|
import {
|
|
1280
1280
|
File,
|
|
1281
1281
|
FileArchive,
|
|
@@ -1331,12 +1331,12 @@ var statusBorderClass = {
|
|
|
1331
1331
|
};
|
|
1332
1332
|
var statusHoverLabel = {
|
|
1333
1333
|
pending: null,
|
|
1334
|
-
uploading: "Uploading
|
|
1335
|
-
uploaded: "
|
|
1336
|
-
analyzing: "
|
|
1334
|
+
uploading: "Uploading",
|
|
1335
|
+
uploaded: "Analyzing",
|
|
1336
|
+
analyzing: "Analyzing",
|
|
1337
1337
|
analyzed: null,
|
|
1338
|
-
upload_failed: "Upload failed
|
|
1339
|
-
analysis_failed: "
|
|
1338
|
+
upload_failed: "Upload failed",
|
|
1339
|
+
analysis_failed: "Couldn't process this file"
|
|
1340
1340
|
};
|
|
1341
1341
|
function isErrorStatus(status) {
|
|
1342
1342
|
return status === "upload_failed" || status === "analysis_failed";
|
|
@@ -1362,7 +1362,9 @@ var FileChip = React15.forwardRef(
|
|
|
1362
1362
|
const showPreview = isImage && previewUrl;
|
|
1363
1363
|
const clickable = !!(artifactId && onOpen);
|
|
1364
1364
|
const hoverLabel = statusHoverLabel[status];
|
|
1365
|
-
const
|
|
1365
|
+
const tooltipContent = isErrorStatus(status) ? error ?? hoverLabel ?? null : hoverLabel;
|
|
1366
|
+
const [hovered, setHovered] = useState2(false);
|
|
1367
|
+
const [focused, setFocused] = useState2(false);
|
|
1366
1368
|
const showError = isErrorStatus(status);
|
|
1367
1369
|
const handleClick = () => {
|
|
1368
1370
|
if (clickable) {
|
|
@@ -1378,7 +1380,8 @@ var FileChip = React15.forwardRef(
|
|
|
1378
1380
|
onOpen(artifactId);
|
|
1379
1381
|
}
|
|
1380
1382
|
};
|
|
1381
|
-
|
|
1383
|
+
const tooltipOpen = tooltipContent !== null && (hovered || focused);
|
|
1384
|
+
const chip = /* @__PURE__ */ React15.createElement(
|
|
1382
1385
|
"div",
|
|
1383
1386
|
{
|
|
1384
1387
|
...rest,
|
|
@@ -1396,7 +1399,11 @@ var FileChip = React15.forwardRef(
|
|
|
1396
1399
|
tabIndex: clickable ? 0 : void 0,
|
|
1397
1400
|
onClick: clickable ? handleClick : void 0,
|
|
1398
1401
|
onKeyDown: clickable ? handleKeyDown : void 0,
|
|
1399
|
-
|
|
1402
|
+
onMouseEnter: () => setHovered(true),
|
|
1403
|
+
onMouseLeave: () => setHovered(false),
|
|
1404
|
+
onFocus: () => setFocused(true),
|
|
1405
|
+
onBlur: () => setFocused(false),
|
|
1406
|
+
title,
|
|
1400
1407
|
"aria-label": hoverLabel ? `${name}: ${hoverLabel}` : name
|
|
1401
1408
|
},
|
|
1402
1409
|
showPreview ? /* @__PURE__ */ React15.createElement("div", { className: "w-8 h-8 flex-shrink-0 overflow-hidden bg-slate" }, /* @__PURE__ */ React15.createElement(
|
|
@@ -1433,6 +1440,10 @@ var FileChip = React15.forwardRef(
|
|
|
1433
1440
|
/* @__PURE__ */ React15.createElement(X, { className: "w-3.5 h-3.5" })
|
|
1434
1441
|
)
|
|
1435
1442
|
);
|
|
1443
|
+
if (tooltipContent === null) {
|
|
1444
|
+
return chip;
|
|
1445
|
+
}
|
|
1446
|
+
return /* @__PURE__ */ React15.createElement(Tooltip, { content: tooltipContent, open: tooltipOpen, side: "top" }, chip);
|
|
1436
1447
|
}
|
|
1437
1448
|
);
|
|
1438
1449
|
FileChip.displayName = "FileChip";
|
|
@@ -1695,7 +1706,7 @@ var Radio = React22.forwardRef(
|
|
|
1695
1706
|
Radio.displayName = "Radio";
|
|
1696
1707
|
|
|
1697
1708
|
// src/components/Switch.tsx
|
|
1698
|
-
import React23, { useCallback as useCallback4, useRef as useRef2, useState as
|
|
1709
|
+
import React23, { useCallback as useCallback4, useRef as useRef2, useState as useState3 } from "react";
|
|
1699
1710
|
var Switch = React23.forwardRef(
|
|
1700
1711
|
({
|
|
1701
1712
|
checked: controlledChecked,
|
|
@@ -1706,7 +1717,7 @@ var Switch = React23.forwardRef(
|
|
|
1706
1717
|
label,
|
|
1707
1718
|
...rest
|
|
1708
1719
|
}, ref) => {
|
|
1709
|
-
const [internalChecked, setInternalChecked] =
|
|
1720
|
+
const [internalChecked, setInternalChecked] = useState3(defaultChecked);
|
|
1710
1721
|
const isControlled = controlledChecked !== void 0;
|
|
1711
1722
|
const checked = isControlled ? controlledChecked : internalChecked;
|
|
1712
1723
|
const buttonRef = useRef2(null);
|
|
@@ -1780,7 +1791,7 @@ var Switch = React23.forwardRef(
|
|
|
1780
1791
|
Switch.displayName = "Switch";
|
|
1781
1792
|
|
|
1782
1793
|
// src/components/Slider.tsx
|
|
1783
|
-
import React24, { useCallback as useCallback5, useRef as useRef3, useState as
|
|
1794
|
+
import React24, { useCallback as useCallback5, useRef as useRef3, useState as useState4 } from "react";
|
|
1784
1795
|
var SIZE_TRACK = {
|
|
1785
1796
|
sm: "h-1",
|
|
1786
1797
|
md: "h-2",
|
|
@@ -1807,8 +1818,8 @@ var Slider = React24.forwardRef(
|
|
|
1807
1818
|
className,
|
|
1808
1819
|
...props
|
|
1809
1820
|
}, ref) => {
|
|
1810
|
-
const [internalValue, setInternalValue] =
|
|
1811
|
-
const [isDragging, setIsDragging] =
|
|
1821
|
+
const [internalValue, setInternalValue] = useState4(defaultValue);
|
|
1822
|
+
const [isDragging, setIsDragging] = useState4(false);
|
|
1812
1823
|
const trackRef = useRef3(null);
|
|
1813
1824
|
const isControlled = controlledValue !== void 0;
|
|
1814
1825
|
const value = isControlled ? controlledValue : internalValue;
|
|
@@ -2169,7 +2180,7 @@ var Progress = React28.forwardRef(
|
|
|
2169
2180
|
Progress.displayName = "Progress";
|
|
2170
2181
|
|
|
2171
2182
|
// src/components/Toast.tsx
|
|
2172
|
-
import React29, { createContext as createContext2, useCallback as useCallback6, useContext as useContext2, useEffect as useEffect2, useState as
|
|
2183
|
+
import React29, { createContext as createContext2, useCallback as useCallback6, useContext as useContext2, useEffect as useEffect2, useState as useState5 } from "react";
|
|
2173
2184
|
import { createPortal } from "react-dom";
|
|
2174
2185
|
import { AlertCircle, AlertTriangle as AlertTriangle2, CheckCircle as CheckCircle2, Info as Info2, X as X2 } from "lucide-react";
|
|
2175
2186
|
var toastCounter = 0;
|
|
@@ -2199,8 +2210,8 @@ var ToastProvider = ({
|
|
|
2199
2210
|
position = "bottom-right",
|
|
2200
2211
|
defaultDuration = 5e3
|
|
2201
2212
|
}) => {
|
|
2202
|
-
const [toasts, setToasts] =
|
|
2203
|
-
const [mounted, setMounted] =
|
|
2213
|
+
const [toasts, setToasts] = useState5([]);
|
|
2214
|
+
const [mounted, setMounted] = useState5(false);
|
|
2204
2215
|
useEffect2(() => {
|
|
2205
2216
|
setMounted(true);
|
|
2206
2217
|
}, []);
|
|
@@ -2306,11 +2317,11 @@ var Toast = ({
|
|
|
2306
2317
|
Toast.displayName = "Toast";
|
|
2307
2318
|
|
|
2308
2319
|
// src/components/Modal.tsx
|
|
2309
|
-
import React30, { useEffect as useEffect3, useState as
|
|
2320
|
+
import React30, { useEffect as useEffect3, useState as useState6 } from "react";
|
|
2310
2321
|
import { createPortal as createPortal2 } from "react-dom";
|
|
2311
2322
|
import { X as X3 } from "lucide-react";
|
|
2312
2323
|
var Modal = ({ isOpen, onClose, title, children, className }) => {
|
|
2313
|
-
const [mounted, setMounted] =
|
|
2324
|
+
const [mounted, setMounted] = useState6(false);
|
|
2314
2325
|
useEffect3(() => {
|
|
2315
2326
|
setMounted(true);
|
|
2316
2327
|
}, []);
|
|
@@ -2355,7 +2366,7 @@ var Modal = ({ isOpen, onClose, title, children, className }) => {
|
|
|
2355
2366
|
Modal.displayName = "Modal";
|
|
2356
2367
|
|
|
2357
2368
|
// src/components/Drawer.tsx
|
|
2358
|
-
import React31, { useEffect as useEffect4, useState as
|
|
2369
|
+
import React31, { useEffect as useEffect4, useState as useState7 } from "react";
|
|
2359
2370
|
import { createPortal as createPortal3 } from "react-dom";
|
|
2360
2371
|
import { X as X4 } from "lucide-react";
|
|
2361
2372
|
var SIZE_MAP2 = {
|
|
@@ -2411,7 +2422,7 @@ var Drawer = ({
|
|
|
2411
2422
|
children,
|
|
2412
2423
|
className
|
|
2413
2424
|
}) => {
|
|
2414
|
-
const [mounted, setMounted] =
|
|
2425
|
+
const [mounted, setMounted] = useState7(false);
|
|
2415
2426
|
useEffect4(() => {
|
|
2416
2427
|
setMounted(true);
|
|
2417
2428
|
}, []);
|
|
@@ -2474,7 +2485,7 @@ var Drawer = ({
|
|
|
2474
2485
|
Drawer.displayName = "Drawer";
|
|
2475
2486
|
|
|
2476
2487
|
// src/components/Popover.tsx
|
|
2477
|
-
import React32, { useCallback as useCallback7, useId as useId3, useRef as useRef4, useState as
|
|
2488
|
+
import React32, { useCallback as useCallback7, useId as useId3, useRef as useRef4, useState as useState8 } from "react";
|
|
2478
2489
|
var POSITION_CLASSES3 = {
|
|
2479
2490
|
top: {
|
|
2480
2491
|
start: "bottom-full left-0 mb-2",
|
|
@@ -2506,7 +2517,7 @@ var Popover = ({
|
|
|
2506
2517
|
onOpenChange,
|
|
2507
2518
|
closeOnClickOutside = true
|
|
2508
2519
|
}) => {
|
|
2509
|
-
const [internalOpen, setInternalOpen] =
|
|
2520
|
+
const [internalOpen, setInternalOpen] = useState8(false);
|
|
2510
2521
|
const isControlled = controlledOpen !== void 0;
|
|
2511
2522
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
2512
2523
|
const containerRef = useRef4(null);
|
|
@@ -2654,7 +2665,7 @@ var PromptDialog = ({
|
|
|
2654
2665
|
PromptDialog.displayName = "PromptDialog";
|
|
2655
2666
|
|
|
2656
2667
|
// src/components/Tabs.tsx
|
|
2657
|
-
import React34, { createContext as createContext3, useCallback as useCallback9, useContext as useContext3, useId as useId4, useState as
|
|
2668
|
+
import React34, { createContext as createContext3, useCallback as useCallback9, useContext as useContext3, useId as useId4, useState as useState9 } from "react";
|
|
2658
2669
|
var TabsContext = createContext3(null);
|
|
2659
2670
|
function useTabsContext() {
|
|
2660
2671
|
const context = useContext3(TabsContext);
|
|
@@ -2665,7 +2676,7 @@ function useTabsContext() {
|
|
|
2665
2676
|
}
|
|
2666
2677
|
var Tabs = React34.forwardRef(
|
|
2667
2678
|
({ defaultValue, value, onValueChange, children, className, ...props }, ref) => {
|
|
2668
|
-
const [internalValue, setInternalValue] =
|
|
2679
|
+
const [internalValue, setInternalValue] = useState9(defaultValue ?? "");
|
|
2669
2680
|
const isControlled = value !== void 0;
|
|
2670
2681
|
const activeTab = isControlled ? value : internalValue;
|
|
2671
2682
|
const baseId = useId4();
|
|
@@ -2765,7 +2776,7 @@ var TabPanel = React34.forwardRef(
|
|
|
2765
2776
|
TabPanel.displayName = "TabPanel";
|
|
2766
2777
|
|
|
2767
2778
|
// src/components/Accordion.tsx
|
|
2768
|
-
import React35, { createContext as createContext4, useCallback as useCallback10, useContext as useContext4, useId as useId5, useState as
|
|
2779
|
+
import React35, { createContext as createContext4, useCallback as useCallback10, useContext as useContext4, useId as useId5, useState as useState10 } from "react";
|
|
2769
2780
|
import { ChevronDown } from "lucide-react";
|
|
2770
2781
|
var AccordionContext = createContext4(null);
|
|
2771
2782
|
function useAccordionContext() {
|
|
@@ -2777,7 +2788,7 @@ function useAccordionContext() {
|
|
|
2777
2788
|
}
|
|
2778
2789
|
var Accordion = React35.forwardRef(
|
|
2779
2790
|
({ type = "single", defaultValue, value, onValueChange, children, className, ...props }, ref) => {
|
|
2780
|
-
const [internalValue, setInternalValue] =
|
|
2791
|
+
const [internalValue, setInternalValue] = useState10(() => {
|
|
2781
2792
|
if (defaultValue) {
|
|
2782
2793
|
return new Set(Array.isArray(defaultValue) ? defaultValue : [defaultValue]);
|
|
2783
2794
|
}
|
|
@@ -2916,7 +2927,7 @@ import React36, {
|
|
|
2916
2927
|
useEffect as useEffect5,
|
|
2917
2928
|
useId as useId6,
|
|
2918
2929
|
useRef as useRef5,
|
|
2919
|
-
useState as
|
|
2930
|
+
useState as useState11
|
|
2920
2931
|
} from "react";
|
|
2921
2932
|
var MenuContext = createContext5(null);
|
|
2922
2933
|
function useMenuContext() {
|
|
@@ -2927,7 +2938,7 @@ function useMenuContext() {
|
|
|
2927
2938
|
return context;
|
|
2928
2939
|
}
|
|
2929
2940
|
var Menu = ({ children, open, onOpenChange }) => {
|
|
2930
|
-
const [internalOpen, setInternalOpen] =
|
|
2941
|
+
const [internalOpen, setInternalOpen] = useState11(false);
|
|
2931
2942
|
const isControlled = open !== void 0;
|
|
2932
2943
|
const isOpen = isControlled ? open : internalOpen;
|
|
2933
2944
|
const baseId = useId6();
|
|
@@ -3751,7 +3762,7 @@ function SquareLoaderIcon({ className, ...props }) {
|
|
|
3751
3762
|
}
|
|
3752
3763
|
|
|
3753
3764
|
// src/components/Message.tsx
|
|
3754
|
-
import React55, { useCallback as useCallback12, useEffect as useEffect6, useRef as useRef6, useState as
|
|
3765
|
+
import React55, { useCallback as useCallback12, useEffect as useEffect6, useRef as useRef6, useState as useState12 } from "react";
|
|
3755
3766
|
import { Check as Check3, ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight3, Copy, GitBranch, Pencil, RotateCcw, Send, X as X5 } from "lucide-react";
|
|
3756
3767
|
|
|
3757
3768
|
// src/components/MarkdownContent.tsx
|
|
@@ -3938,12 +3949,29 @@ var Message = React55.forwardRef(
|
|
|
3938
3949
|
hideActions,
|
|
3939
3950
|
attachments,
|
|
3940
3951
|
onAttachmentOpen,
|
|
3952
|
+
onJumpHere,
|
|
3953
|
+
isActive,
|
|
3941
3954
|
...rest
|
|
3942
3955
|
}, ref) => {
|
|
3943
3956
|
const isUser = variant === "user";
|
|
3957
|
+
const isJumpInteractive = !!onJumpHere && !isActive && !isStreaming;
|
|
3958
|
+
const handleBubbleClick = useCallback12((e) => {
|
|
3959
|
+
if (!isJumpInteractive) {
|
|
3960
|
+
return;
|
|
3961
|
+
}
|
|
3962
|
+
const target = e.target;
|
|
3963
|
+
if (target.closest("a, button")) {
|
|
3964
|
+
return;
|
|
3965
|
+
}
|
|
3966
|
+
const selection = typeof window !== "undefined" ? window.getSelection() : null;
|
|
3967
|
+
if (selection && !selection.isCollapsed) {
|
|
3968
|
+
return;
|
|
3969
|
+
}
|
|
3970
|
+
onJumpHere();
|
|
3971
|
+
}, [isJumpInteractive, onJumpHere]);
|
|
3944
3972
|
const { copied, copy } = useCopyToClipboard();
|
|
3945
|
-
const [isEditing, setIsEditing] =
|
|
3946
|
-
const [editValue, setEditValue] =
|
|
3973
|
+
const [isEditing, setIsEditing] = useState12(false);
|
|
3974
|
+
const [editValue, setEditValue] = useState12(typeof content === "string" ? content : "");
|
|
3947
3975
|
const textareaRef = useRef6(null);
|
|
3948
3976
|
const showBranchNav = branchInfo && branchInfo.total > 1;
|
|
3949
3977
|
const showActions = actions && !hideActions && !isStreaming;
|
|
@@ -4047,8 +4075,12 @@ var Message = React55.forwardRef(
|
|
|
4047
4075
|
{
|
|
4048
4076
|
className: cx(
|
|
4049
4077
|
"px-3 py-2 w-fit max-w-11/12",
|
|
4050
|
-
VARIANT_STYLES3[variant]
|
|
4051
|
-
|
|
4078
|
+
VARIANT_STYLES3[variant],
|
|
4079
|
+
isJumpInteractive && "cursor-pointer hover:brightness-110 transition-all duration-150"
|
|
4080
|
+
),
|
|
4081
|
+
onClick: isJumpInteractive ? handleBubbleClick : void 0,
|
|
4082
|
+
role: isJumpInteractive ? "button" : void 0,
|
|
4083
|
+
"aria-label": isJumpInteractive ? "Jump to this message" : void 0
|
|
4052
4084
|
},
|
|
4053
4085
|
typeof content === "string" ? /* @__PURE__ */ React55.createElement(
|
|
4054
4086
|
MarkdownContent,
|
|
@@ -4123,7 +4155,7 @@ var StreamingCursor = React56.forwardRef(
|
|
|
4123
4155
|
StreamingCursor.displayName = "StreamingCursor";
|
|
4124
4156
|
|
|
4125
4157
|
// src/components/chat/ChatInterface.tsx
|
|
4126
|
-
import React76, { useCallback as useCallback22, useEffect as useEffect16, useMemo as useMemo5, useRef as useRef15, useState as
|
|
4158
|
+
import React76, { useCallback as useCallback22, useEffect as useEffect16, useMemo as useMemo5, useRef as useRef15, useState as useState23 } from "react";
|
|
4127
4159
|
|
|
4128
4160
|
// src/components/chat/ChatView.tsx
|
|
4129
4161
|
import React60, { useEffect as useEffect9 } from "react";
|
|
@@ -4175,14 +4207,14 @@ function useScrollAnchor(options = {}) {
|
|
|
4175
4207
|
}
|
|
4176
4208
|
|
|
4177
4209
|
// src/components/chat/hooks/useAdaptiveSpacer.ts
|
|
4178
|
-
import { useCallback as useCallback14, useEffect as useEffect7, useRef as useRef8, useState as
|
|
4210
|
+
import { useCallback as useCallback14, useEffect as useEffect7, useRef as useRef8, useState as useState13 } from "react";
|
|
4179
4211
|
function useAdaptiveSpacer(options = {}) {
|
|
4180
4212
|
const { minHeight = 0, containerRef: externalContainerRef, anchorRef } = options;
|
|
4181
4213
|
const internalContainerRef = useRef8(null);
|
|
4182
4214
|
const containerRef = externalContainerRef ?? internalContainerRef;
|
|
4183
4215
|
const contentRef = useRef8(null);
|
|
4184
4216
|
const spacerRef = useRef8(null);
|
|
4185
|
-
const [spacerHeight, setSpacerHeight] =
|
|
4217
|
+
const [spacerHeight, setSpacerHeight] = useState13(0);
|
|
4186
4218
|
const recalculate = useCallback14(() => {
|
|
4187
4219
|
const container = containerRef.current;
|
|
4188
4220
|
const content = contentRef.current;
|
|
@@ -4242,7 +4274,7 @@ function useAdaptiveSpacer(options = {}) {
|
|
|
4242
4274
|
}
|
|
4243
4275
|
|
|
4244
4276
|
// src/components/chat/ThinkingIndicator.tsx
|
|
4245
|
-
import React57, { useEffect as useEffect8, useState as
|
|
4277
|
+
import React57, { useEffect as useEffect8, useState as useState14 } from "react";
|
|
4246
4278
|
var THINKING_PHRASES = [
|
|
4247
4279
|
"Consulting the ancient tomes...",
|
|
4248
4280
|
"Parsing the ineffable...",
|
|
@@ -4267,10 +4299,10 @@ var ThinkingIndicator = React57.forwardRef(
|
|
|
4267
4299
|
className,
|
|
4268
4300
|
...rest
|
|
4269
4301
|
}, ref) => {
|
|
4270
|
-
const [currentIndex, setCurrentIndex] =
|
|
4302
|
+
const [currentIndex, setCurrentIndex] = useState14(
|
|
4271
4303
|
() => Math.floor(Math.random() * phrases.length)
|
|
4272
4304
|
);
|
|
4273
|
-
const [isTransitioning, setIsTransitioning] =
|
|
4305
|
+
const [isTransitioning, setIsTransitioning] = useState14(false);
|
|
4274
4306
|
const isManual = manualLabel !== void 0;
|
|
4275
4307
|
useEffect8(() => {
|
|
4276
4308
|
if (!isVisible || isManual || phrases.length <= 1) {
|
|
@@ -4624,7 +4656,7 @@ var ChatView = React60.forwardRef(
|
|
|
4624
4656
|
ChatView.displayName = "ChatView";
|
|
4625
4657
|
|
|
4626
4658
|
// src/components/chat/ChatInput.tsx
|
|
4627
|
-
import React61, { useCallback as useCallback15, useEffect as useEffect10, useRef as useRef9, useState as
|
|
4659
|
+
import React61, { useCallback as useCallback15, useEffect as useEffect10, useRef as useRef9, useState as useState15 } from "react";
|
|
4628
4660
|
import { Paperclip, Send as Send2, Square, X as X6 } from "lucide-react";
|
|
4629
4661
|
|
|
4630
4662
|
// src/components/chat/types.ts
|
|
@@ -4672,9 +4704,9 @@ var ChatInput = React61.forwardRef(
|
|
|
4672
4704
|
className,
|
|
4673
4705
|
...rest
|
|
4674
4706
|
}, ref) => {
|
|
4675
|
-
const [value, setValue] =
|
|
4676
|
-
const [localAttachments, setLocalAttachments] =
|
|
4677
|
-
const [isDragOver, setIsDragOver] =
|
|
4707
|
+
const [value, setValue] = useState15(initialInputValue);
|
|
4708
|
+
const [localAttachments, setLocalAttachments] = useState15([]);
|
|
4709
|
+
const [isDragOver, setIsDragOver] = useState15(false);
|
|
4678
4710
|
const textareaRef = useRef9(null);
|
|
4679
4711
|
const fileInputRef = useRef9(null);
|
|
4680
4712
|
const attachments = controlledAttachments ?? localAttachments;
|
|
@@ -4931,7 +4963,7 @@ var ChatInput = React61.forwardRef(
|
|
|
4931
4963
|
ChatInput.displayName = "ChatInput";
|
|
4932
4964
|
|
|
4933
4965
|
// src/components/chat/ArtifactsPanel.tsx
|
|
4934
|
-
import React71, { useCallback as useCallback18, useEffect as useEffect13, useRef as useRef12, useState as
|
|
4966
|
+
import React71, { useCallback as useCallback18, useEffect as useEffect13, useRef as useRef12, useState as useState19 } from "react";
|
|
4935
4967
|
import { Image } from "lucide-react";
|
|
4936
4968
|
|
|
4937
4969
|
// src/components/ArtifactCard.tsx
|
|
@@ -5460,7 +5492,7 @@ var ArtifactCard = React68.forwardRef(
|
|
|
5460
5492
|
ArtifactCard.displayName = "ArtifactCard";
|
|
5461
5493
|
|
|
5462
5494
|
// src/components/ArtifactGroup.tsx
|
|
5463
|
-
import React69, { useEffect as useEffect11, useRef as useRef10, useState as
|
|
5495
|
+
import React69, { useEffect as useEffect11, useRef as useRef10, useState as useState16 } from "react";
|
|
5464
5496
|
var LAYER_OFFSET = "8px";
|
|
5465
5497
|
var LAYER_OFFSET_2X = "16px";
|
|
5466
5498
|
var ArtifactGroup = React69.forwardRef(
|
|
@@ -5469,7 +5501,7 @@ var ArtifactGroup = React69.forwardRef(
|
|
|
5469
5501
|
const count = children.length;
|
|
5470
5502
|
const frontChild = children[0];
|
|
5471
5503
|
const prevCountRef = useRef10(count);
|
|
5472
|
-
const [badgePing, setBadgePing] =
|
|
5504
|
+
const [badgePing, setBadgePing] = useState16(false);
|
|
5473
5505
|
useEffect11(() => {
|
|
5474
5506
|
if (count !== prevCountRef.current) {
|
|
5475
5507
|
prevCountRef.current = count;
|
|
@@ -5590,15 +5622,15 @@ var ArtifactVariantStack = React70.forwardRef(
|
|
|
5590
5622
|
ArtifactVariantStack.displayName = "ArtifactVariantStack";
|
|
5591
5623
|
|
|
5592
5624
|
// src/components/chat/hooks/useResizable.ts
|
|
5593
|
-
import { useCallback as useCallback16, useEffect as useEffect12, useRef as useRef11, useState as
|
|
5625
|
+
import { useCallback as useCallback16, useEffect as useEffect12, useRef as useRef11, useState as useState17 } from "react";
|
|
5594
5626
|
function useResizable({
|
|
5595
5627
|
initialWidthPercent,
|
|
5596
5628
|
minWidthPercent,
|
|
5597
5629
|
maxWidthPercent,
|
|
5598
5630
|
direction
|
|
5599
5631
|
}) {
|
|
5600
|
-
const [widthPercent, setWidthPercent] =
|
|
5601
|
-
const [isResizing, setIsResizing] =
|
|
5632
|
+
const [widthPercent, setWidthPercent] = useState17(initialWidthPercent);
|
|
5633
|
+
const [isResizing, setIsResizing] = useState17(false);
|
|
5602
5634
|
const lastX = useRef11(null);
|
|
5603
5635
|
const startResizing = useCallback16((e) => {
|
|
5604
5636
|
e.preventDefault();
|
|
@@ -5649,9 +5681,9 @@ function useResizable({
|
|
|
5649
5681
|
}
|
|
5650
5682
|
|
|
5651
5683
|
// src/components/chat/hooks/useArtifactTreeNavigation.ts
|
|
5652
|
-
import { useCallback as useCallback17, useMemo as useMemo2, useState as
|
|
5684
|
+
import { useCallback as useCallback17, useMemo as useMemo2, useState as useState18 } from "react";
|
|
5653
5685
|
function useArtifactTreeNavigation(rootNodes) {
|
|
5654
|
-
const [stack, setStack] =
|
|
5686
|
+
const [stack, setStack] = useState18([]);
|
|
5655
5687
|
const currentNodes = useMemo2(() => {
|
|
5656
5688
|
if (stack.length === 0) return rootNodes;
|
|
5657
5689
|
return stack[stack.length - 1].children;
|
|
@@ -5825,8 +5857,8 @@ var ArtifactsPanel = React71.forwardRef(
|
|
|
5825
5857
|
className,
|
|
5826
5858
|
...rest
|
|
5827
5859
|
}, ref) => {
|
|
5828
|
-
const [expandedArtifact, setExpandedArtifact] =
|
|
5829
|
-
const [zoomIndex, setZoomIndex] =
|
|
5860
|
+
const [expandedArtifact, setExpandedArtifact] = useState19(null);
|
|
5861
|
+
const [zoomIndex, setZoomIndex] = useState19(ZOOM_LEVELS.length - 1);
|
|
5830
5862
|
const treeNav = useArtifactTreeNavigation(nodes || []);
|
|
5831
5863
|
const hasNodes = !!nodes && nodes.length > 0;
|
|
5832
5864
|
const handleExpandArtifact = useCallback18((artifact) => {
|
|
@@ -5856,7 +5888,7 @@ var ArtifactsPanel = React71.forwardRef(
|
|
|
5856
5888
|
}, []);
|
|
5857
5889
|
const currentZoom = ZOOM_LEVELS[zoomIndex];
|
|
5858
5890
|
const contentRef = useRef12(null);
|
|
5859
|
-
const [contentHeight, setContentHeight] =
|
|
5891
|
+
const [contentHeight, setContentHeight] = useState19(void 0);
|
|
5860
5892
|
useEffect13(() => {
|
|
5861
5893
|
const el = contentRef.current;
|
|
5862
5894
|
if (!el) {
|
|
@@ -6025,7 +6057,7 @@ var ArtifactsPanelToggle = React71.forwardRef(({ artifactCount = 0, onExpand, cl
|
|
|
6025
6057
|
ArtifactsPanelToggle.displayName = "ArtifactsPanelToggle";
|
|
6026
6058
|
|
|
6027
6059
|
// src/components/chat/HistoryPanel.tsx
|
|
6028
|
-
import React72, { useCallback as useCallback19, useEffect as useEffect14, useMemo as useMemo3, useRef as useRef13, useState as
|
|
6060
|
+
import React72, { useCallback as useCallback19, useEffect as useEffect14, useMemo as useMemo3, useRef as useRef13, useState as useState20 } from "react";
|
|
6029
6061
|
import { ChevronDown as ChevronDown2, Pencil as Pencil2 } from "lucide-react";
|
|
6030
6062
|
function parseTimestamp(ts) {
|
|
6031
6063
|
if (ts == null) {
|
|
@@ -6068,7 +6100,7 @@ function ProjectFilter({
|
|
|
6068
6100
|
onChange,
|
|
6069
6101
|
className
|
|
6070
6102
|
}) {
|
|
6071
|
-
const [open, setOpen] =
|
|
6103
|
+
const [open, setOpen] = useState20(false);
|
|
6072
6104
|
const ref = useRef13(null);
|
|
6073
6105
|
const closeFilter = useCallback19(() => setOpen(false), []);
|
|
6074
6106
|
useClickOutside(ref, closeFilter, open);
|
|
@@ -6145,8 +6177,8 @@ function ConversationRow({
|
|
|
6145
6177
|
onSelect,
|
|
6146
6178
|
onRename
|
|
6147
6179
|
}) {
|
|
6148
|
-
const [isEditing, setIsEditing] =
|
|
6149
|
-
const [draft, setDraft] =
|
|
6180
|
+
const [isEditing, setIsEditing] = useState20(false);
|
|
6181
|
+
const [draft, setDraft] = useState20(conversation.title);
|
|
6150
6182
|
const inputRef = useRef13(null);
|
|
6151
6183
|
useEffect14(() => {
|
|
6152
6184
|
if (isEditing && inputRef.current) {
|
|
@@ -6250,7 +6282,7 @@ function HistoryPanel({
|
|
|
6250
6282
|
onNewChat,
|
|
6251
6283
|
onRenameConversation
|
|
6252
6284
|
}) {
|
|
6253
|
-
const [projectFilter, setProjectFilter] =
|
|
6285
|
+
const [projectFilter, setProjectFilter] = useState20(null);
|
|
6254
6286
|
const projects = useMemo3(() => {
|
|
6255
6287
|
const set = /* @__PURE__ */ new Set();
|
|
6256
6288
|
for (const c of conversations) {
|
|
@@ -6316,7 +6348,7 @@ function HistoryPanel({
|
|
|
6316
6348
|
}
|
|
6317
6349
|
|
|
6318
6350
|
// src/components/chat/TodosList.tsx
|
|
6319
|
-
import React73, { useCallback as useCallback20, useMemo as useMemo4, useState as
|
|
6351
|
+
import React73, { useCallback as useCallback20, useMemo as useMemo4, useState as useState21 } from "react";
|
|
6320
6352
|
import { Loader2 as Loader22, Square as Square2 } from "lucide-react";
|
|
6321
6353
|
var TASK_STATUSES = {
|
|
6322
6354
|
PENDING: "pending",
|
|
@@ -6395,7 +6427,7 @@ function hasInProgressTask(tasks) {
|
|
|
6395
6427
|
var TodosList = React73.forwardRef(
|
|
6396
6428
|
({ tasks, title = "Tasks", onStopAllTasks, className, ...rest }, ref) => {
|
|
6397
6429
|
const sortedTasks = useMemo4(() => sortTasks(tasks), [tasks]);
|
|
6398
|
-
const [isStopping, setIsStopping] =
|
|
6430
|
+
const [isStopping, setIsStopping] = useState21(false);
|
|
6399
6431
|
const handleStopClick = useCallback20(async () => {
|
|
6400
6432
|
if (!onStopAllTasks || isStopping) {
|
|
6401
6433
|
return;
|
|
@@ -6521,7 +6553,7 @@ var ToolSidebar = React74.forwardRef(
|
|
|
6521
6553
|
ToolSidebar.displayName = "ToolSidebar";
|
|
6522
6554
|
|
|
6523
6555
|
// src/components/chat/ToolPanelContainer.tsx
|
|
6524
|
-
import React75, { useCallback as useCallback21, useEffect as useEffect15, useRef as useRef14, useState as
|
|
6556
|
+
import React75, { useCallback as useCallback21, useEffect as useEffect15, useRef as useRef14, useState as useState22 } from "react";
|
|
6525
6557
|
var ToolPanelContainer = React75.forwardRef(
|
|
6526
6558
|
({
|
|
6527
6559
|
topContent,
|
|
@@ -6533,8 +6565,8 @@ var ToolPanelContainer = React75.forwardRef(
|
|
|
6533
6565
|
initialTopPercent = 60,
|
|
6534
6566
|
...rest
|
|
6535
6567
|
}, ref) => {
|
|
6536
|
-
const [topPercent, setTopPercent] =
|
|
6537
|
-
const [isResizingHeight, setIsResizingHeight] =
|
|
6568
|
+
const [topPercent, setTopPercent] = useState22(initialTopPercent);
|
|
6569
|
+
const [isResizingHeight, setIsResizingHeight] = useState22(false);
|
|
6538
6570
|
const containerRef = useRef14(null);
|
|
6539
6571
|
const lastY = useRef14(null);
|
|
6540
6572
|
const hasBoth = topContent !== null && bottomContent !== null;
|
|
@@ -6793,7 +6825,7 @@ var ChatInterface = React76.forwardRef(
|
|
|
6793
6825
|
onMessageSubmit,
|
|
6794
6826
|
onEditMessage,
|
|
6795
6827
|
onRetryMessage,
|
|
6796
|
-
|
|
6828
|
+
onJumpHere,
|
|
6797
6829
|
onJumpToLatest,
|
|
6798
6830
|
onStop,
|
|
6799
6831
|
onSelectConversation,
|
|
@@ -6827,7 +6859,7 @@ var ChatInterface = React76.forwardRef(
|
|
|
6827
6859
|
}, ref) => {
|
|
6828
6860
|
const prevArtifactNodesRef = useRef15([]);
|
|
6829
6861
|
const prevTasksRef = useRef15([]);
|
|
6830
|
-
const [panelOpenArtifactId, setPanelOpenArtifactId] =
|
|
6862
|
+
const [panelOpenArtifactId, setPanelOpenArtifactId] = useState23(null);
|
|
6831
6863
|
const handleAttachmentOpen = useCallback22((artifactId) => {
|
|
6832
6864
|
setPanelOpenArtifactId(artifactId);
|
|
6833
6865
|
onAttachmentOpen?.(artifactId);
|
|
@@ -6835,7 +6867,7 @@ var ChatInterface = React76.forwardRef(
|
|
|
6835
6867
|
const handleArtifactPanelClosed = useCallback22(() => {
|
|
6836
6868
|
setPanelOpenArtifactId(null);
|
|
6837
6869
|
}, []);
|
|
6838
|
-
const [internalTools, setInternalTools] =
|
|
6870
|
+
const [internalTools, setInternalTools] = useState23({
|
|
6839
6871
|
"top-left": "history",
|
|
6840
6872
|
"bottom-left": null,
|
|
6841
6873
|
"top-right": null,
|
|
@@ -6969,16 +7001,16 @@ var ChatInterface = React76.forwardRef(
|
|
|
6969
7001
|
},
|
|
6970
7002
|
[tree, onTreeChange]
|
|
6971
7003
|
);
|
|
6972
|
-
const
|
|
7004
|
+
const handleJumpHere = useCallback22((nodeId) => {
|
|
6973
7005
|
if (!tree) return;
|
|
6974
|
-
if (
|
|
6975
|
-
|
|
7006
|
+
if (onJumpHere) {
|
|
7007
|
+
onJumpHere(nodeId);
|
|
6976
7008
|
return;
|
|
6977
7009
|
}
|
|
6978
7010
|
if (onTreeChange) {
|
|
6979
|
-
onTreeChange(setActiveLeaf(tree,
|
|
7011
|
+
onTreeChange(setActiveLeaf(tree, nodeId));
|
|
6980
7012
|
}
|
|
6981
|
-
}, [tree, onTreeChange,
|
|
7013
|
+
}, [tree, onTreeChange, onJumpHere]);
|
|
6982
7014
|
const handleJumpToLatest = useCallback22(() => {
|
|
6983
7015
|
if (!tree) return;
|
|
6984
7016
|
if (onJumpToLatest) {
|
|
@@ -7006,7 +7038,7 @@ var ChatInterface = React76.forwardRef(
|
|
|
7006
7038
|
isActive: node.id === activeCheckpointId && !opts.muted,
|
|
7007
7039
|
muted: opts.muted,
|
|
7008
7040
|
branchInfo,
|
|
7009
|
-
onJumpHere: () =>
|
|
7041
|
+
onJumpHere: () => handleJumpHere(node.id)
|
|
7010
7042
|
};
|
|
7011
7043
|
}
|
|
7012
7044
|
const actions = enableMessageActions ? {
|
|
@@ -7014,6 +7046,7 @@ var ChatInterface = React76.forwardRef(
|
|
|
7014
7046
|
onEdit: node.role === "user" && onEditMessage ? (newContent) => onEditMessage(node.id, newContent) : void 0,
|
|
7015
7047
|
onRetry: node.role === "assistant" && onRetryMessage ? () => onRetryMessage(node.id) : void 0
|
|
7016
7048
|
} : void 0;
|
|
7049
|
+
const isActiveLeaf = tree?.activeLeafId === node.id;
|
|
7017
7050
|
return {
|
|
7018
7051
|
kind: "message",
|
|
7019
7052
|
id: node.id,
|
|
@@ -7030,7 +7063,9 @@ var ChatInterface = React76.forwardRef(
|
|
|
7030
7063
|
artifactId: a.artifactId,
|
|
7031
7064
|
status: a.status ?? "analyzed"
|
|
7032
7065
|
})) : void 0,
|
|
7033
|
-
onAttachmentOpen: handleAttachmentOpen
|
|
7066
|
+
onAttachmentOpen: handleAttachmentOpen,
|
|
7067
|
+
isActive: isActiveLeaf,
|
|
7068
|
+
onJumpHere: () => handleJumpHere(node.id)
|
|
7034
7069
|
};
|
|
7035
7070
|
},
|
|
7036
7071
|
[
|
|
@@ -7040,7 +7075,7 @@ var ChatInterface = React76.forwardRef(
|
|
|
7040
7075
|
onEditMessage,
|
|
7041
7076
|
onRetryMessage,
|
|
7042
7077
|
handleBranchSwitch,
|
|
7043
|
-
|
|
7078
|
+
handleJumpHere,
|
|
7044
7079
|
handleAttachmentOpen
|
|
7045
7080
|
]
|
|
7046
7081
|
);
|
|
@@ -7229,7 +7264,7 @@ var ChatInterface = React76.forwardRef(
|
|
|
7229
7264
|
ChatInterface.displayName = "ChatInterface";
|
|
7230
7265
|
|
|
7231
7266
|
// src/components/chat/MessageActions.tsx
|
|
7232
|
-
import React77, { useCallback as useCallback23, useState as
|
|
7267
|
+
import React77, { useCallback as useCallback23, useState as useState24 } from "react";
|
|
7233
7268
|
import { Check as Check4, Copy as Copy2, Pencil as Pencil3, RotateCcw as RotateCcw2, Send as Send3, X as X7 } from "lucide-react";
|
|
7234
7269
|
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */ React77.createElement(
|
|
7235
7270
|
"button",
|
|
@@ -7259,8 +7294,8 @@ var MessageActions = React77.forwardRef(
|
|
|
7259
7294
|
className,
|
|
7260
7295
|
...rest
|
|
7261
7296
|
}, ref) => {
|
|
7262
|
-
const [localIsEditing, setLocalIsEditing] =
|
|
7263
|
-
const [localEditValue, setLocalEditValue] =
|
|
7297
|
+
const [localIsEditing, setLocalIsEditing] = useState24(false);
|
|
7298
|
+
const [localEditValue, setLocalEditValue] = useState24(content);
|
|
7264
7299
|
const { copied, copy } = useCopyToClipboard();
|
|
7265
7300
|
const isEditing = controlledIsEditing ?? localIsEditing;
|
|
7266
7301
|
const editValue = controlledEditValue ?? localEditValue;
|