@lukeashford/aurelius 2.21.0 → 3.1.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 +208 -219
- package/dist/index.d.ts +208 -219
- package/dist/index.js +199 -188
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +144 -132
- package/dist/index.mjs.map +1 -1
- package/llms.md +32 -63
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -163,7 +163,6 @@ __export(index_exports, {
|
|
|
163
163
|
switchBranch: () => switchBranch,
|
|
164
164
|
updateNodeContent: () => updateNodeContent,
|
|
165
165
|
useArtifactTreeNavigation: () => useArtifactTreeNavigation,
|
|
166
|
-
useArtifacts: () => useArtifacts,
|
|
167
166
|
useResizable: () => useResizable,
|
|
168
167
|
useScrollAnchor: () => useScrollAnchor,
|
|
169
168
|
useToast: () => useToast,
|
|
@@ -4291,7 +4290,7 @@ var StreamingCursor = import_react55.default.forwardRef(
|
|
|
4291
4290
|
StreamingCursor.displayName = "StreamingCursor";
|
|
4292
4291
|
|
|
4293
4292
|
// src/components/chat/ChatInterface.tsx
|
|
4294
|
-
var
|
|
4293
|
+
var import_react77 = __toESM(require("react"));
|
|
4295
4294
|
|
|
4296
4295
|
// src/components/chat/ChatView.tsx
|
|
4297
4296
|
var import_react59 = __toESM(require("react"));
|
|
@@ -6031,7 +6030,6 @@ function NodeRenderer({
|
|
|
6031
6030
|
var ArtifactsPanel = import_react72.default.forwardRef(
|
|
6032
6031
|
({
|
|
6033
6032
|
nodes,
|
|
6034
|
-
artifacts,
|
|
6035
6033
|
loading,
|
|
6036
6034
|
className,
|
|
6037
6035
|
...rest
|
|
@@ -6039,7 +6037,7 @@ var ArtifactsPanel = import_react72.default.forwardRef(
|
|
|
6039
6037
|
const [expandedArtifact, setExpandedArtifact] = (0, import_react72.useState)(null);
|
|
6040
6038
|
const [zoomIndex, setZoomIndex] = (0, import_react72.useState)(ZOOM_LEVELS.length - 1);
|
|
6041
6039
|
const treeNav = useArtifactTreeNavigation(nodes || []);
|
|
6042
|
-
const
|
|
6040
|
+
const hasNodes = !!nodes && nodes.length > 0;
|
|
6043
6041
|
const handleExpandArtifact = (0, import_react72.useCallback)((artifact) => {
|
|
6044
6042
|
setExpandedArtifact(artifact);
|
|
6045
6043
|
}, []);
|
|
@@ -6081,7 +6079,7 @@ var ArtifactsPanel = import_react72.default.forwardRef(
|
|
|
6081
6079
|
className: "flex items-center justify-between p-4 border-b border-ash/40 shrink-0"
|
|
6082
6080
|
},
|
|
6083
6081
|
/* @__PURE__ */ import_react72.default.createElement("h3", { className: "text-sm font-semibold text-white" }, "Artifacts"),
|
|
6084
|
-
|
|
6082
|
+
hasNodes && /* @__PURE__ */ import_react72.default.createElement(
|
|
6085
6083
|
"div",
|
|
6086
6084
|
{
|
|
6087
6085
|
className: "flex items-center gap-0.5",
|
|
@@ -6118,7 +6116,7 @@ var ArtifactsPanel = import_react72.default.forwardRef(
|
|
|
6118
6116
|
)
|
|
6119
6117
|
)
|
|
6120
6118
|
),
|
|
6121
|
-
|
|
6119
|
+
hasNodes && !treeNav.isAtRoot && /* @__PURE__ */ import_react72.default.createElement(
|
|
6122
6120
|
"nav",
|
|
6123
6121
|
{
|
|
6124
6122
|
className: "flex items-center gap-1 px-4 py-2 border-b border-ash/40 shrink-0 overflow-x-auto text-xs",
|
|
@@ -6159,7 +6157,7 @@ var ArtifactsPanel = import_react72.default.forwardRef(
|
|
|
6159
6157
|
transformOrigin: "top center"
|
|
6160
6158
|
} : void 0
|
|
6161
6159
|
},
|
|
6162
|
-
|
|
6160
|
+
treeNav.currentNodes.length === 0 ? /* @__PURE__ */ import_react72.default.createElement("p", { className: "text-xs text-silver/60 text-center py-8" }, hasNodes ? "Empty group" : "No artifacts to display") : treeNav.currentNodes.map((node) => /* @__PURE__ */ import_react72.default.createElement(
|
|
6163
6161
|
NodeRenderer,
|
|
6164
6162
|
{
|
|
6165
6163
|
key: node.id,
|
|
@@ -6168,14 +6166,6 @@ var ArtifactsPanel = import_react72.default.forwardRef(
|
|
|
6168
6166
|
onExpandArtifact: handleExpandArtifact,
|
|
6169
6167
|
onGroupClick: handleGroupClick
|
|
6170
6168
|
}
|
|
6171
|
-
)) : (!artifacts || artifacts.length === 0) && !loading ? /* @__PURE__ */ import_react72.default.createElement("p", { className: "text-xs text-silver/60 text-center py-8" }, "No artifacts to display") : artifacts?.map((artifact) => /* @__PURE__ */ import_react72.default.createElement(
|
|
6172
|
-
ArtifactCard,
|
|
6173
|
-
{
|
|
6174
|
-
key: artifact.id,
|
|
6175
|
-
artifact,
|
|
6176
|
-
loading,
|
|
6177
|
-
onExpand: handleExpandArtifact
|
|
6178
|
-
}
|
|
6179
6169
|
))
|
|
6180
6170
|
)
|
|
6181
6171
|
)
|
|
@@ -6366,9 +6356,9 @@ function areAllTasksSettled(tasks) {
|
|
|
6366
6356
|
// src/components/chat/ToolSidebar.tsx
|
|
6367
6357
|
var import_react74 = __toESM(require("react"));
|
|
6368
6358
|
var ToolSidebar = import_react74.default.forwardRef(
|
|
6369
|
-
({ tools, activeTools, onToggleTool, className, ...rest }, ref) => {
|
|
6370
|
-
const topTools = tools.filter((t) => t.group ===
|
|
6371
|
-
const bottomTools = tools.filter((t) => t.group ===
|
|
6359
|
+
({ tools, activeTools, onToggleTool, side, className, ...rest }, ref) => {
|
|
6360
|
+
const topTools = tools.filter((t) => t.group === `top-${side}`);
|
|
6361
|
+
const bottomTools = tools.filter((t) => t.group === `bottom-${side}`);
|
|
6372
6362
|
const isActive = (toolId) => {
|
|
6373
6363
|
const tool = tools.find((t) => t.id === toolId);
|
|
6374
6364
|
if (!tool) return false;
|
|
@@ -6396,7 +6386,8 @@ var ToolSidebar = import_react74.default.forwardRef(
|
|
|
6396
6386
|
{
|
|
6397
6387
|
ref,
|
|
6398
6388
|
className: cx(
|
|
6399
|
-
"h-full w-9 bg-charcoal/80
|
|
6389
|
+
"h-full w-9 bg-charcoal/80 flex flex-col items-center shrink-0 py-2",
|
|
6390
|
+
side === "left" ? "border-r border-ash/40" : "border-l border-ash/40",
|
|
6400
6391
|
className
|
|
6401
6392
|
),
|
|
6402
6393
|
...rest
|
|
@@ -6412,7 +6403,7 @@ ToolSidebar.displayName = "ToolSidebar";
|
|
|
6412
6403
|
// src/components/chat/ToolPanelContainer.tsx
|
|
6413
6404
|
var import_react75 = __toESM(require("react"));
|
|
6414
6405
|
var ToolPanelContainer = import_react75.default.forwardRef(
|
|
6415
|
-
({ topContent, bottomContent, width, onResizeStart, className, ...rest }, ref) => {
|
|
6406
|
+
({ topContent, bottomContent, width, onResizeStart, side = "right", className, ...rest }, ref) => {
|
|
6416
6407
|
const [topPercent, setTopPercent] = (0, import_react75.useState)(60);
|
|
6417
6408
|
const [isResizingHeight, setIsResizingHeight] = (0, import_react75.useState)(false);
|
|
6418
6409
|
const containerRef = (0, import_react75.useRef)(null);
|
|
@@ -6470,7 +6461,8 @@ var ToolPanelContainer = import_react75.default.forwardRef(
|
|
|
6470
6461
|
else if (ref) ref.current = node;
|
|
6471
6462
|
},
|
|
6472
6463
|
className: cx(
|
|
6473
|
-
"h-full bg-charcoal/50
|
|
6464
|
+
"h-full bg-charcoal/50 flex flex-col relative shrink-0",
|
|
6465
|
+
side === "left" ? "border-r border-ash/40" : "border-l border-ash/40",
|
|
6474
6466
|
className
|
|
6475
6467
|
),
|
|
6476
6468
|
style: width ? { width } : void 0,
|
|
@@ -6481,9 +6473,9 @@ var ToolPanelContainer = import_react75.default.forwardRef(
|
|
|
6481
6473
|
{
|
|
6482
6474
|
onMouseDown: onResizeStart,
|
|
6483
6475
|
className: cx(
|
|
6484
|
-
"absolute top-0
|
|
6476
|
+
"absolute top-0 w-1 h-full cursor-col-resize z-50",
|
|
6485
6477
|
"hover:bg-gold/50 transition-colors",
|
|
6486
|
-
"after:absolute after:inset-y-0 after:-left-1 after:w-2"
|
|
6478
|
+
side === "left" ? "right-0 after:absolute after:inset-y-0 after:-right-1 after:w-2" : "left-0 after:absolute after:inset-y-0 after:-left-1 after:w-2"
|
|
6487
6479
|
)
|
|
6488
6480
|
}
|
|
6489
6481
|
),
|
|
@@ -6520,58 +6512,27 @@ var ToolPanelContainer = import_react75.default.forwardRef(
|
|
|
6520
6512
|
);
|
|
6521
6513
|
ToolPanelContainer.displayName = "ToolPanelContainer";
|
|
6522
6514
|
|
|
6523
|
-
// src/components/chat/hooks/useArtifacts.ts
|
|
6524
|
-
var import_react76 = require("react");
|
|
6525
|
-
function useArtifacts() {
|
|
6526
|
-
const [artifacts, setArtifacts] = (0, import_react76.useState)([]);
|
|
6527
|
-
const scheduleArtifact = (0, import_react76.useCallback)((artifact) => {
|
|
6528
|
-
setArtifacts((prev) => [...prev, { ...artifact, isPending: true }]);
|
|
6529
|
-
}, []);
|
|
6530
|
-
const showArtifact = (0, import_react76.useCallback)(
|
|
6531
|
-
(artifactId, updates) => {
|
|
6532
|
-
setArtifacts((prev) => {
|
|
6533
|
-
const existingIndex = prev.findIndex((a) => a.id === artifactId);
|
|
6534
|
-
if (existingIndex >= 0) {
|
|
6535
|
-
return prev.map(
|
|
6536
|
-
(a) => a.id === artifactId ? { ...a, ...updates, isPending: false } : a
|
|
6537
|
-
);
|
|
6538
|
-
} else {
|
|
6539
|
-
return [...prev, { id: artifactId, ...updates, isPending: false }];
|
|
6540
|
-
}
|
|
6541
|
-
});
|
|
6542
|
-
},
|
|
6543
|
-
[]
|
|
6544
|
-
);
|
|
6545
|
-
const removeArtifact = (0, import_react76.useCallback)((artifactId) => {
|
|
6546
|
-
setArtifacts((prev) => prev.filter((a) => a.id !== artifactId));
|
|
6547
|
-
}, []);
|
|
6548
|
-
const clearArtifacts = (0, import_react76.useCallback)(() => {
|
|
6549
|
-
setArtifacts([]);
|
|
6550
|
-
}, []);
|
|
6551
|
-
return { artifacts, scheduleArtifact, showArtifact, removeArtifact, clearArtifacts };
|
|
6552
|
-
}
|
|
6553
|
-
|
|
6554
6515
|
// src/components/chat/hooks/useResizable.ts
|
|
6555
|
-
var
|
|
6516
|
+
var import_react76 = require("react");
|
|
6556
6517
|
function useResizable({
|
|
6557
6518
|
initialWidthPercent,
|
|
6558
6519
|
minWidthPercent,
|
|
6559
6520
|
maxWidthPercent,
|
|
6560
6521
|
direction
|
|
6561
6522
|
}) {
|
|
6562
|
-
const [widthPercent, setWidthPercent] = (0,
|
|
6563
|
-
const [isResizing, setIsResizing] = (0,
|
|
6564
|
-
const lastX = (0,
|
|
6565
|
-
const startResizing = (0,
|
|
6523
|
+
const [widthPercent, setWidthPercent] = (0, import_react76.useState)(initialWidthPercent);
|
|
6524
|
+
const [isResizing, setIsResizing] = (0, import_react76.useState)(false);
|
|
6525
|
+
const lastX = (0, import_react76.useRef)(null);
|
|
6526
|
+
const startResizing = (0, import_react76.useCallback)((e) => {
|
|
6566
6527
|
e.preventDefault();
|
|
6567
6528
|
setIsResizing(true);
|
|
6568
6529
|
lastX.current = e.clientX;
|
|
6569
6530
|
}, []);
|
|
6570
|
-
const stopResizing = (0,
|
|
6531
|
+
const stopResizing = (0, import_react76.useCallback)(() => {
|
|
6571
6532
|
setIsResizing(false);
|
|
6572
6533
|
lastX.current = null;
|
|
6573
6534
|
}, []);
|
|
6574
|
-
const resize = (0,
|
|
6535
|
+
const resize = (0, import_react76.useCallback)(
|
|
6575
6536
|
(e) => {
|
|
6576
6537
|
if (!isResizing || lastX.current === null) {
|
|
6577
6538
|
return;
|
|
@@ -6587,7 +6548,7 @@ function useResizable({
|
|
|
6587
6548
|
},
|
|
6588
6549
|
[isResizing, direction, minWidthPercent, maxWidthPercent]
|
|
6589
6550
|
);
|
|
6590
|
-
(0,
|
|
6551
|
+
(0, import_react76.useEffect)(() => {
|
|
6591
6552
|
if (isResizing) {
|
|
6592
6553
|
window.addEventListener("mousemove", resize);
|
|
6593
6554
|
window.addEventListener("mouseup", stopResizing);
|
|
@@ -6611,7 +6572,7 @@ function useResizable({
|
|
|
6611
6572
|
}
|
|
6612
6573
|
|
|
6613
6574
|
// src/components/chat/ChatInterface.tsx
|
|
6614
|
-
var ChatInterface =
|
|
6575
|
+
var ChatInterface = import_react77.default.forwardRef(
|
|
6615
6576
|
({
|
|
6616
6577
|
messages = [],
|
|
6617
6578
|
conversationTree,
|
|
@@ -6633,34 +6594,37 @@ var ChatInterface = import_react78.default.forwardRef(
|
|
|
6633
6594
|
enableMessageActions = true,
|
|
6634
6595
|
attachments: propsAttachments,
|
|
6635
6596
|
onAttachmentsChange,
|
|
6636
|
-
artifacts = [],
|
|
6637
6597
|
artifactNodes,
|
|
6638
6598
|
isArtifactsPanelOpen,
|
|
6639
6599
|
onArtifactsPanelOpenChange,
|
|
6640
6600
|
tasks = [],
|
|
6641
6601
|
tasksTitle,
|
|
6602
|
+
tools: externalTools = [],
|
|
6642
6603
|
className,
|
|
6643
6604
|
...rest
|
|
6644
6605
|
}, ref) => {
|
|
6645
|
-
const [sidebarCollapsed, setSidebarCollapsed] = (0,
|
|
6646
|
-
const
|
|
6647
|
-
const prevTasksRef = (0,
|
|
6648
|
-
const [internalTools, setInternalTools] = (0,
|
|
6649
|
-
top: null,
|
|
6650
|
-
bottom: null
|
|
6606
|
+
const [sidebarCollapsed, setSidebarCollapsed] = (0, import_react77.useState)(initialSidebarCollapsed);
|
|
6607
|
+
const prevArtifactNodesRef = (0, import_react77.useRef)([]);
|
|
6608
|
+
const prevTasksRef = (0, import_react77.useRef)([]);
|
|
6609
|
+
const [internalTools, setInternalTools] = (0, import_react77.useState)({
|
|
6610
|
+
"top-left": null,
|
|
6611
|
+
"bottom-left": null,
|
|
6612
|
+
"top-right": null,
|
|
6613
|
+
"bottom-right": null
|
|
6651
6614
|
});
|
|
6652
|
-
const dismissedToolsRef = (0,
|
|
6615
|
+
const dismissedToolsRef = (0, import_react77.useRef)(/* @__PURE__ */ new Set());
|
|
6653
6616
|
const isPanelControlled = isArtifactsPanelOpen !== void 0;
|
|
6654
|
-
const activeTools = (0,
|
|
6617
|
+
const activeTools = (0, import_react77.useMemo)(() => {
|
|
6655
6618
|
if (isPanelControlled) {
|
|
6656
6619
|
return {
|
|
6657
|
-
|
|
6658
|
-
|
|
6620
|
+
...internalTools,
|
|
6621
|
+
"top-right": isArtifactsPanelOpen ? "artifacts" : internalTools["top-right"]
|
|
6659
6622
|
};
|
|
6660
6623
|
}
|
|
6661
6624
|
return internalTools;
|
|
6662
6625
|
}, [isPanelControlled, isArtifactsPanelOpen, internalTools]);
|
|
6663
|
-
const
|
|
6626
|
+
const isLeftPanelOpen = activeTools["top-left"] !== null || activeTools["bottom-left"] !== null;
|
|
6627
|
+
const isRightPanelOpen = activeTools["top-right"] !== null || activeTools["bottom-right"] !== null;
|
|
6664
6628
|
const {
|
|
6665
6629
|
width: sidebarWidth,
|
|
6666
6630
|
startResizing: startResizingSidebar
|
|
@@ -6671,20 +6635,44 @@ var ChatInterface = import_react78.default.forwardRef(
|
|
|
6671
6635
|
direction: "right"
|
|
6672
6636
|
});
|
|
6673
6637
|
const {
|
|
6674
|
-
width:
|
|
6675
|
-
startResizing:
|
|
6638
|
+
width: rightToolsWidth,
|
|
6639
|
+
startResizing: startResizingRightTools
|
|
6676
6640
|
} = useResizable({
|
|
6677
6641
|
initialWidthPercent: 50,
|
|
6678
6642
|
minWidthPercent: 25,
|
|
6679
6643
|
maxWidthPercent: 70,
|
|
6680
6644
|
direction: "left"
|
|
6681
6645
|
});
|
|
6682
|
-
const
|
|
6683
|
-
|
|
6646
|
+
const {
|
|
6647
|
+
width: leftToolsWidth,
|
|
6648
|
+
startResizing: startResizingLeftTools
|
|
6649
|
+
} = useResizable({
|
|
6650
|
+
initialWidthPercent: 25,
|
|
6651
|
+
minWidthPercent: 15,
|
|
6652
|
+
maxWidthPercent: 40,
|
|
6653
|
+
direction: "right"
|
|
6654
|
+
});
|
|
6655
|
+
const allSettled = tasks.length === 0 || areAllTasksSettled(tasks);
|
|
6656
|
+
const allToolDefinitions = (0, import_react77.useMemo)(() => {
|
|
6657
|
+
const builtIn = [
|
|
6658
|
+
{ id: "history", icon: /* @__PURE__ */ import_react77.default.createElement(HistoryIcon, null), label: "History", group: "top-left" },
|
|
6659
|
+
{ id: "artifacts", icon: /* @__PURE__ */ import_react77.default.createElement(MediaIcon, null), label: "Artifacts", group: "top-right" },
|
|
6660
|
+
{
|
|
6661
|
+
id: "todos",
|
|
6662
|
+
icon: allSettled ? /* @__PURE__ */ import_react77.default.createElement(CheckSquareIcon, null) : /* @__PURE__ */ import_react77.default.createElement(SquareLoaderIcon, null),
|
|
6663
|
+
label: "Tasks",
|
|
6664
|
+
group: "bottom-right"
|
|
6665
|
+
}
|
|
6666
|
+
];
|
|
6667
|
+
const external = externalTools.map(({ content: _content, ...def }) => def);
|
|
6668
|
+
return [...builtIn, ...external];
|
|
6669
|
+
}, [allSettled, externalTools]);
|
|
6670
|
+
const toggleTool = (0, import_react77.useCallback)((toolId) => {
|
|
6671
|
+
const toolDef = allToolDefinitions.find((t) => t.id === toolId);
|
|
6684
6672
|
if (!toolDef) return;
|
|
6685
6673
|
const group = toolDef.group;
|
|
6686
6674
|
if (toolId === "artifacts" && isPanelControlled) {
|
|
6687
|
-
const isCurrentlyOpen = activeTools
|
|
6675
|
+
const isCurrentlyOpen = activeTools["top-right"] === "artifacts";
|
|
6688
6676
|
if (isCurrentlyOpen) {
|
|
6689
6677
|
dismissedToolsRef.current.add("artifacts");
|
|
6690
6678
|
} else {
|
|
@@ -6705,9 +6693,9 @@ var ChatInterface = import_react78.default.forwardRef(
|
|
|
6705
6693
|
[group]: isCurrentlyOpen ? null : toolId
|
|
6706
6694
|
};
|
|
6707
6695
|
});
|
|
6708
|
-
}, [isPanelControlled, activeTools
|
|
6696
|
+
}, [allToolDefinitions, isPanelControlled, activeTools, onArtifactsPanelOpenChange]);
|
|
6709
6697
|
const isTreeMode = !!conversationTree;
|
|
6710
|
-
const effectiveMessages = (0,
|
|
6698
|
+
const effectiveMessages = (0, import_react77.useMemo)(() => {
|
|
6711
6699
|
if (isTreeMode && conversationTree) {
|
|
6712
6700
|
const pathNodes = getActivePathMessages(conversationTree);
|
|
6713
6701
|
return pathNodes.map((node) => ({
|
|
@@ -6719,23 +6707,18 @@ var ChatInterface = import_react78.default.forwardRef(
|
|
|
6719
6707
|
}
|
|
6720
6708
|
return messages;
|
|
6721
6709
|
}, [isTreeMode, conversationTree, messages]);
|
|
6722
|
-
const latestUserMessageIndex = (0,
|
|
6710
|
+
const latestUserMessageIndex = (0, import_react77.useMemo)(() => {
|
|
6723
6711
|
for (let i = effectiveMessages.length - 1; i >= 0; i--) {
|
|
6724
6712
|
if (effectiveMessages[i].variant === "user") return i;
|
|
6725
6713
|
}
|
|
6726
6714
|
return -1;
|
|
6727
6715
|
}, [effectiveMessages]);
|
|
6728
|
-
(0,
|
|
6729
|
-
const
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
return false;
|
|
6735
|
-
});
|
|
6736
|
-
const hasNodes = artifactNodes && artifactNodes.length > 0;
|
|
6737
|
-
if (!isPanelControlled && (hasNewOrSignificantArtifact || hasNodes) && !dismissedToolsRef.current.has("artifacts")) {
|
|
6738
|
-
setInternalTools((prev) => ({ ...prev, top: "artifacts" }));
|
|
6716
|
+
(0, import_react77.useEffect)(() => {
|
|
6717
|
+
const nodes = artifactNodes || [];
|
|
6718
|
+
const prevNodes = prevArtifactNodesRef.current;
|
|
6719
|
+
const hasNewOrChangedNode = nodes.length !== prevNodes.length || nodes.some((n, i) => n.id !== prevNodes[i]?.id);
|
|
6720
|
+
if (!isPanelControlled && hasNewOrChangedNode && nodes.length > 0 && !dismissedToolsRef.current.has("artifacts")) {
|
|
6721
|
+
setInternalTools((prev) => ({ ...prev, "top-right": "artifacts" }));
|
|
6739
6722
|
}
|
|
6740
6723
|
const hasNewOrUpdatedTask = (curr, prev) => {
|
|
6741
6724
|
return curr.some((c) => {
|
|
@@ -6747,12 +6730,12 @@ var ChatInterface = import_react78.default.forwardRef(
|
|
|
6747
6730
|
});
|
|
6748
6731
|
};
|
|
6749
6732
|
if (hasNewOrUpdatedTask(tasks, prevTasksRef.current) && !dismissedToolsRef.current.has("todos")) {
|
|
6750
|
-
setInternalTools((prev) => ({ ...prev, bottom: "todos" }));
|
|
6733
|
+
setInternalTools((prev) => ({ ...prev, "bottom-right": "todos" }));
|
|
6751
6734
|
}
|
|
6752
|
-
|
|
6735
|
+
prevArtifactNodesRef.current = nodes;
|
|
6753
6736
|
prevTasksRef.current = tasks;
|
|
6754
|
-
}, [
|
|
6755
|
-
const handleBranchSwitch = (0,
|
|
6737
|
+
}, [artifactNodes, tasks, isPanelControlled]);
|
|
6738
|
+
const handleBranchSwitch = (0, import_react77.useCallback)(
|
|
6756
6739
|
(nodeId, direction) => {
|
|
6757
6740
|
if (!isTreeMode || !conversationTree || !onTreeChange) return;
|
|
6758
6741
|
const newTree = switchBranch(conversationTree, nodeId, direction);
|
|
@@ -6760,7 +6743,7 @@ var ChatInterface = import_react78.default.forwardRef(
|
|
|
6760
6743
|
},
|
|
6761
6744
|
[isTreeMode, conversationTree, onTreeChange]
|
|
6762
6745
|
);
|
|
6763
|
-
const displayMessages = (0,
|
|
6746
|
+
const displayMessages = (0, import_react77.useMemo)(() => {
|
|
6764
6747
|
return effectiveMessages.map((msg) => {
|
|
6765
6748
|
let branchInfo = void 0;
|
|
6766
6749
|
if (isTreeMode && conversationTree) {
|
|
@@ -6790,57 +6773,69 @@ var ChatInterface = import_react78.default.forwardRef(
|
|
|
6790
6773
|
onRetryMessage,
|
|
6791
6774
|
handleBranchSwitch
|
|
6792
6775
|
]);
|
|
6793
|
-
const handleSubmit = (0,
|
|
6776
|
+
const handleSubmit = (0, import_react77.useCallback)(
|
|
6794
6777
|
(message, attachments) => {
|
|
6795
6778
|
onMessageSubmit?.(message, attachments);
|
|
6796
6779
|
},
|
|
6797
6780
|
[onMessageSubmit]
|
|
6798
6781
|
);
|
|
6799
|
-
const toggleSidebar = (0,
|
|
6782
|
+
const toggleSidebar = (0, import_react77.useCallback)(() => {
|
|
6800
6783
|
setSidebarCollapsed((prev) => !prev);
|
|
6801
6784
|
}, []);
|
|
6802
6785
|
const isEmpty = effectiveMessages.length === 0;
|
|
6803
|
-
const
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
icon: allSettled ? /* @__PURE__ */ import_react78.default.createElement(CheckSquareIcon, null) : /* @__PURE__ */ import_react78.default.createElement(SquareLoaderIcon, null),
|
|
6814
|
-
label: "Tasks",
|
|
6815
|
-
group: "bottom"
|
|
6816
|
-
}
|
|
6817
|
-
], [allSettled]);
|
|
6786
|
+
const leftToolDefs = (0, import_react77.useMemo)(
|
|
6787
|
+
() => allToolDefinitions.filter((t) => t.group === "top-left" || t.group === "bottom-left"),
|
|
6788
|
+
[allToolDefinitions]
|
|
6789
|
+
);
|
|
6790
|
+
const rightToolDefs = (0, import_react77.useMemo)(
|
|
6791
|
+
() => allToolDefinitions.filter((t) => t.group === "top-right" || t.group === "bottom-right"),
|
|
6792
|
+
[allToolDefinitions]
|
|
6793
|
+
);
|
|
6794
|
+
const hasLeftTools = leftToolDefs.length > 0;
|
|
6795
|
+
const hasRightTools = rightToolDefs.length > 0;
|
|
6818
6796
|
const renderToolContent = (toolId) => {
|
|
6819
6797
|
if (!toolId) return null;
|
|
6820
6798
|
switch (toolId) {
|
|
6799
|
+
case "history":
|
|
6800
|
+
return /* @__PURE__ */ import_react77.default.createElement("div", { className: "h-full flex flex-col" }, /* @__PURE__ */ import_react77.default.createElement("div", { className: "flex items-center p-4 border-b border-ash/40 shrink-0" }, /* @__PURE__ */ import_react77.default.createElement("h3", { className: "text-xs font-medium text-white" }, "History")), /* @__PURE__ */ import_react77.default.createElement("div", { className: "flex-1 overflow-y-auto py-2" }, conversations.length === 0 ? /* @__PURE__ */ import_react77.default.createElement("p", { className: "px-4 py-2 text-xs text-silver/60" }, "No conversations yet") : /* @__PURE__ */ import_react77.default.createElement("div", { className: "space-y-1 px-2" }, conversations.map((conversation) => /* @__PURE__ */ import_react77.default.createElement(
|
|
6801
|
+
"button",
|
|
6802
|
+
{
|
|
6803
|
+
key: conversation.id,
|
|
6804
|
+
onClick: () => onSelectConversation?.(conversation.id),
|
|
6805
|
+
className: cx(
|
|
6806
|
+
"w-full px-3 py-2 text-left",
|
|
6807
|
+
"transition-colors duration-150",
|
|
6808
|
+
conversation.isActive ? "bg-ash/40 text-white" : "text-silver hover:bg-ash/20 hover:text-white"
|
|
6809
|
+
)
|
|
6810
|
+
},
|
|
6811
|
+
/* @__PURE__ */ import_react77.default.createElement("p", { className: "text-sm font-medium truncate" }, conversation.title),
|
|
6812
|
+
conversation.preview && /* @__PURE__ */ import_react77.default.createElement("p", { className: "text-xs text-silver/60 truncate mt-0.5" }, conversation.preview),
|
|
6813
|
+
conversation.timestamp && /* @__PURE__ */ import_react77.default.createElement("p", { className: "text-xs text-silver/40 mt-1" }, conversation.timestamp)
|
|
6814
|
+
)))));
|
|
6821
6815
|
case "artifacts":
|
|
6822
|
-
return /* @__PURE__ */
|
|
6816
|
+
return /* @__PURE__ */ import_react77.default.createElement(
|
|
6823
6817
|
ArtifactsPanel,
|
|
6824
6818
|
{
|
|
6825
|
-
artifacts,
|
|
6826
6819
|
nodes: artifactNodes,
|
|
6827
6820
|
className: "h-full"
|
|
6828
6821
|
}
|
|
6829
6822
|
);
|
|
6830
6823
|
case "todos":
|
|
6831
|
-
return tasks.length > 0 ? /* @__PURE__ */
|
|
6832
|
-
default:
|
|
6833
|
-
|
|
6824
|
+
return tasks.length > 0 ? /* @__PURE__ */ import_react77.default.createElement(TodosList, { tasks, title: tasksTitle, className: "h-full" }) : /* @__PURE__ */ import_react77.default.createElement("div", { className: "h-full flex flex-col" }, /* @__PURE__ */ import_react77.default.createElement("div", { className: "flex items-center p-4 border-b border-ash/40 shrink-0" }, /* @__PURE__ */ import_react77.default.createElement("h3", { className: "text-xs font-medium text-white" }, "Tasks")), /* @__PURE__ */ import_react77.default.createElement("div", { className: "flex-1 flex items-center justify-center" }, /* @__PURE__ */ import_react77.default.createElement("p", { className: "text-xs text-silver/60" }, "No tasks")));
|
|
6825
|
+
default: {
|
|
6826
|
+
const externalTool = externalTools.find((t) => t.id === toolId);
|
|
6827
|
+
return externalTool?.content ?? null;
|
|
6828
|
+
}
|
|
6834
6829
|
}
|
|
6835
6830
|
};
|
|
6836
|
-
return /* @__PURE__ */
|
|
6831
|
+
return /* @__PURE__ */ import_react77.default.createElement(
|
|
6837
6832
|
"div",
|
|
6838
6833
|
{
|
|
6839
6834
|
ref,
|
|
6840
6835
|
className: cx("flex h-full w-full bg-obsidian overflow-hidden", className),
|
|
6841
6836
|
...rest
|
|
6842
6837
|
},
|
|
6843
|
-
/* @__PURE__ */
|
|
6838
|
+
/* @__PURE__ */ import_react77.default.createElement(
|
|
6844
6839
|
ConversationSidebar,
|
|
6845
6840
|
{
|
|
6846
6841
|
conversations,
|
|
@@ -6852,16 +6847,35 @@ var ChatInterface = import_react78.default.forwardRef(
|
|
|
6852
6847
|
onResizeStart: startResizingSidebar
|
|
6853
6848
|
}
|
|
6854
6849
|
),
|
|
6855
|
-
|
|
6850
|
+
hasLeftTools && /* @__PURE__ */ import_react77.default.createElement(
|
|
6851
|
+
ToolSidebar,
|
|
6852
|
+
{
|
|
6853
|
+
tools: leftToolDefs,
|
|
6854
|
+
activeTools,
|
|
6855
|
+
onToggleTool: toggleTool,
|
|
6856
|
+
side: "left"
|
|
6857
|
+
}
|
|
6858
|
+
),
|
|
6859
|
+
isLeftPanelOpen && /* @__PURE__ */ import_react77.default.createElement(
|
|
6860
|
+
ToolPanelContainer,
|
|
6861
|
+
{
|
|
6862
|
+
topContent: renderToolContent(activeTools["top-left"]),
|
|
6863
|
+
bottomContent: renderToolContent(activeTools["bottom-left"]),
|
|
6864
|
+
width: leftToolsWidth,
|
|
6865
|
+
onResizeStart: startResizingLeftTools,
|
|
6866
|
+
side: "left"
|
|
6867
|
+
}
|
|
6868
|
+
),
|
|
6869
|
+
/* @__PURE__ */ import_react77.default.createElement("div", { className: "flex-1 flex flex-col min-w-0 relative" }, /* @__PURE__ */ import_react77.default.createElement("div", { className: cx(
|
|
6856
6870
|
"flex-1 flex flex-col min-h-0 relative",
|
|
6857
6871
|
isEmpty ? "justify-center" : "justify-start"
|
|
6858
|
-
) }, /* @__PURE__ */
|
|
6872
|
+
) }, /* @__PURE__ */ import_react77.default.createElement("div", { className: cx(
|
|
6859
6873
|
"transition-all duration-500 ease-in-out",
|
|
6860
6874
|
isEmpty ? "flex-1" : "flex-zero"
|
|
6861
|
-
) }), /* @__PURE__ */
|
|
6875
|
+
) }), /* @__PURE__ */ import_react77.default.createElement("div", { className: cx(
|
|
6862
6876
|
"transition-all duration-500 ease-in-out overflow-hidden flex flex-col",
|
|
6863
6877
|
isEmpty ? "flex-zero opacity-0" : "flex-1 opacity-100"
|
|
6864
|
-
) }, /* @__PURE__ */
|
|
6878
|
+
) }, /* @__PURE__ */ import_react77.default.createElement(
|
|
6865
6879
|
ChatView,
|
|
6866
6880
|
{
|
|
6867
6881
|
messages: displayMessages,
|
|
@@ -6870,10 +6884,10 @@ var ChatInterface = import_react78.default.forwardRef(
|
|
|
6870
6884
|
isThinking,
|
|
6871
6885
|
className: "flex-1"
|
|
6872
6886
|
}
|
|
6873
|
-
)), /* @__PURE__ */
|
|
6887
|
+
)), /* @__PURE__ */ import_react77.default.createElement("div", { className: cx(
|
|
6874
6888
|
"transition-all duration-500 ease-in-out z-10 w-full flex flex-col items-center",
|
|
6875
6889
|
isEmpty ? "p-4" : "shrink-0 p-4 border-t border-ash/40 bg-obsidian"
|
|
6876
|
-
) }, isEmpty && /* @__PURE__ */
|
|
6890
|
+
) }, isEmpty && /* @__PURE__ */ import_react77.default.createElement("div", { className: "mb-8 text-center animate-fade-in duration-500" }, emptyState ? emptyState : /* @__PURE__ */ import_react77.default.createElement("h1", { className: "text-4xl md:text-5xl font-heading text-gold mb-2 tracking-tight" }, "Welcome!")), /* @__PURE__ */ import_react77.default.createElement(
|
|
6877
6891
|
ChatInput,
|
|
6878
6892
|
{
|
|
6879
6893
|
position: isEmpty ? "centered" : "bottom",
|
|
@@ -6887,40 +6901,38 @@ var ChatInterface = import_react78.default.forwardRef(
|
|
|
6887
6901
|
attachments: propsAttachments,
|
|
6888
6902
|
onAttachmentsChange
|
|
6889
6903
|
}
|
|
6890
|
-
)), /* @__PURE__ */
|
|
6904
|
+
)), /* @__PURE__ */ import_react77.default.createElement("div", { className: cx(
|
|
6891
6905
|
"transition-all duration-500 ease-in-out",
|
|
6892
6906
|
isEmpty ? "flex-1" : "flex-zero"
|
|
6893
6907
|
) }))),
|
|
6894
|
-
|
|
6908
|
+
isRightPanelOpen && /* @__PURE__ */ import_react77.default.createElement(
|
|
6895
6909
|
ToolPanelContainer,
|
|
6896
6910
|
{
|
|
6897
|
-
topContent: renderToolContent(activeTools
|
|
6898
|
-
bottomContent: renderToolContent(activeTools
|
|
6899
|
-
width:
|
|
6900
|
-
onResizeStart:
|
|
6911
|
+
topContent: renderToolContent(activeTools["top-right"]),
|
|
6912
|
+
bottomContent: renderToolContent(activeTools["bottom-right"]),
|
|
6913
|
+
width: rightToolsWidth,
|
|
6914
|
+
onResizeStart: startResizingRightTools,
|
|
6915
|
+
side: "right"
|
|
6901
6916
|
}
|
|
6902
6917
|
),
|
|
6903
|
-
/* @__PURE__ */
|
|
6918
|
+
hasRightTools && /* @__PURE__ */ import_react77.default.createElement(
|
|
6904
6919
|
ToolSidebar,
|
|
6905
6920
|
{
|
|
6906
|
-
tools:
|
|
6921
|
+
tools: rightToolDefs,
|
|
6907
6922
|
activeTools,
|
|
6908
|
-
onToggleTool: toggleTool
|
|
6923
|
+
onToggleTool: toggleTool,
|
|
6924
|
+
side: "right"
|
|
6909
6925
|
}
|
|
6910
6926
|
)
|
|
6911
6927
|
);
|
|
6912
6928
|
}
|
|
6913
6929
|
);
|
|
6914
6930
|
ChatInterface.displayName = "ChatInterface";
|
|
6915
|
-
var TOOL_DEFINITIONS = [
|
|
6916
|
-
{ id: "artifacts", icon: null, label: "Artifacts", group: "top" },
|
|
6917
|
-
{ id: "todos", icon: null, label: "Tasks", group: "bottom" }
|
|
6918
|
-
];
|
|
6919
6931
|
|
|
6920
6932
|
// src/components/chat/MessageActions.tsx
|
|
6921
|
-
var
|
|
6933
|
+
var import_react78 = __toESM(require("react"));
|
|
6922
6934
|
var import_lucide_react14 = require("lucide-react");
|
|
6923
|
-
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */
|
|
6935
|
+
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */ import_react78.default.createElement(
|
|
6924
6936
|
"button",
|
|
6925
6937
|
{
|
|
6926
6938
|
type: "button",
|
|
@@ -6936,7 +6948,7 @@ var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @_
|
|
|
6936
6948
|
},
|
|
6937
6949
|
children
|
|
6938
6950
|
);
|
|
6939
|
-
var MessageActions =
|
|
6951
|
+
var MessageActions = import_react78.default.forwardRef(
|
|
6940
6952
|
({
|
|
6941
6953
|
variant,
|
|
6942
6954
|
content,
|
|
@@ -6948,12 +6960,12 @@ var MessageActions = import_react79.default.forwardRef(
|
|
|
6948
6960
|
className,
|
|
6949
6961
|
...rest
|
|
6950
6962
|
}, ref) => {
|
|
6951
|
-
const [localIsEditing, setLocalIsEditing] = (0,
|
|
6952
|
-
const [localEditValue, setLocalEditValue] = (0,
|
|
6953
|
-
const [copied, setCopied] = (0,
|
|
6963
|
+
const [localIsEditing, setLocalIsEditing] = (0, import_react78.useState)(false);
|
|
6964
|
+
const [localEditValue, setLocalEditValue] = (0, import_react78.useState)(content);
|
|
6965
|
+
const [copied, setCopied] = (0, import_react78.useState)(false);
|
|
6954
6966
|
const isEditing = controlledIsEditing ?? localIsEditing;
|
|
6955
6967
|
const editValue = controlledEditValue ?? localEditValue;
|
|
6956
|
-
const setIsEditing = (0,
|
|
6968
|
+
const setIsEditing = (0, import_react78.useCallback)(
|
|
6957
6969
|
(value) => {
|
|
6958
6970
|
if (onEditingChange) {
|
|
6959
6971
|
onEditingChange(value);
|
|
@@ -6963,10 +6975,10 @@ var MessageActions = import_react79.default.forwardRef(
|
|
|
6963
6975
|
},
|
|
6964
6976
|
[onEditingChange]
|
|
6965
6977
|
);
|
|
6966
|
-
const setEditValue = (0,
|
|
6978
|
+
const setEditValue = (0, import_react78.useCallback)((value) => {
|
|
6967
6979
|
setLocalEditValue(value);
|
|
6968
6980
|
}, []);
|
|
6969
|
-
const handleCopy = (0,
|
|
6981
|
+
const handleCopy = (0, import_react78.useCallback)(async () => {
|
|
6970
6982
|
try {
|
|
6971
6983
|
await navigator.clipboard.writeText(content);
|
|
6972
6984
|
setCopied(true);
|
|
@@ -6982,22 +6994,22 @@ var MessageActions = import_react79.default.forwardRef(
|
|
|
6982
6994
|
setTimeout(() => setCopied(false), 2e3);
|
|
6983
6995
|
}
|
|
6984
6996
|
}, [content]);
|
|
6985
|
-
const handleStartEdit = (0,
|
|
6997
|
+
const handleStartEdit = (0, import_react78.useCallback)(() => {
|
|
6986
6998
|
setLocalEditValue(content);
|
|
6987
6999
|
setIsEditing(true);
|
|
6988
7000
|
}, [content, setIsEditing]);
|
|
6989
|
-
const handleCancelEdit = (0,
|
|
7001
|
+
const handleCancelEdit = (0, import_react78.useCallback)(() => {
|
|
6990
7002
|
setIsEditing(false);
|
|
6991
7003
|
setLocalEditValue(content);
|
|
6992
7004
|
}, [content, setIsEditing]);
|
|
6993
|
-
const handleSubmitEdit = (0,
|
|
7005
|
+
const handleSubmitEdit = (0, import_react78.useCallback)(() => {
|
|
6994
7006
|
const trimmed = editValue.trim();
|
|
6995
7007
|
if (trimmed && trimmed !== content) {
|
|
6996
7008
|
onEdit?.(trimmed);
|
|
6997
7009
|
}
|
|
6998
7010
|
setIsEditing(false);
|
|
6999
7011
|
}, [editValue, content, onEdit, setIsEditing]);
|
|
7000
|
-
const handleEditKeyDown = (0,
|
|
7012
|
+
const handleEditKeyDown = (0, import_react78.useCallback)(
|
|
7001
7013
|
(e) => {
|
|
7002
7014
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
7003
7015
|
e.preventDefault();
|
|
@@ -7010,19 +7022,19 @@ var MessageActions = import_react79.default.forwardRef(
|
|
|
7010
7022
|
);
|
|
7011
7023
|
const isUser = variant === "user";
|
|
7012
7024
|
if (isUser && isEditing) {
|
|
7013
|
-
return /* @__PURE__ */
|
|
7025
|
+
return /* @__PURE__ */ import_react78.default.createElement(
|
|
7014
7026
|
"div",
|
|
7015
7027
|
{
|
|
7016
7028
|
ref,
|
|
7017
7029
|
className: cx("mt-2", className),
|
|
7018
7030
|
...rest
|
|
7019
7031
|
},
|
|
7020
|
-
/* @__PURE__ */
|
|
7032
|
+
/* @__PURE__ */ import_react78.default.createElement(
|
|
7021
7033
|
"div",
|
|
7022
7034
|
{
|
|
7023
7035
|
className: "relative bg-charcoal border border-ash/60 focus-within:border-gold/60 focus-within:ring-1 focus-within:ring-gold/20"
|
|
7024
7036
|
},
|
|
7025
|
-
/* @__PURE__ */
|
|
7037
|
+
/* @__PURE__ */ import_react78.default.createElement(
|
|
7026
7038
|
"textarea",
|
|
7027
7039
|
{
|
|
7028
7040
|
value: editValue,
|
|
@@ -7033,15 +7045,15 @@ var MessageActions = import_react79.default.forwardRef(
|
|
|
7033
7045
|
rows: 2
|
|
7034
7046
|
}
|
|
7035
7047
|
),
|
|
7036
|
-
/* @__PURE__ */
|
|
7048
|
+
/* @__PURE__ */ import_react78.default.createElement("div", { className: "absolute right-2 bottom-2 flex gap-1" }, /* @__PURE__ */ import_react78.default.createElement(
|
|
7037
7049
|
ActionButton2,
|
|
7038
7050
|
{
|
|
7039
7051
|
onClick: handleCancelEdit,
|
|
7040
7052
|
label: "Cancel edit",
|
|
7041
7053
|
className: "text-silver/60 hover:text-error"
|
|
7042
7054
|
},
|
|
7043
|
-
/* @__PURE__ */
|
|
7044
|
-
), /* @__PURE__ */
|
|
7055
|
+
/* @__PURE__ */ import_react78.default.createElement(import_lucide_react14.X, { className: "w-4 h-4" })
|
|
7056
|
+
), /* @__PURE__ */ import_react78.default.createElement(
|
|
7045
7057
|
ActionButton2,
|
|
7046
7058
|
{
|
|
7047
7059
|
onClick: handleSubmitEdit,
|
|
@@ -7049,13 +7061,13 @@ var MessageActions = import_react79.default.forwardRef(
|
|
|
7049
7061
|
className: "text-silver/60 hover:text-gold",
|
|
7050
7062
|
disabled: !editValue.trim() || editValue.trim() === content
|
|
7051
7063
|
},
|
|
7052
|
-
/* @__PURE__ */
|
|
7064
|
+
/* @__PURE__ */ import_react78.default.createElement(import_lucide_react14.Send, { className: "w-4 h-4" })
|
|
7053
7065
|
))
|
|
7054
7066
|
),
|
|
7055
|
-
/* @__PURE__ */
|
|
7067
|
+
/* @__PURE__ */ import_react78.default.createElement("p", { className: "text-xs text-silver/50 mt-1" }, "Press Enter to submit, Esc to cancel. This will create a new branch.")
|
|
7056
7068
|
);
|
|
7057
7069
|
}
|
|
7058
|
-
return /* @__PURE__ */
|
|
7070
|
+
return /* @__PURE__ */ import_react78.default.createElement(
|
|
7059
7071
|
"div",
|
|
7060
7072
|
{
|
|
7061
7073
|
ref,
|
|
@@ -7066,18 +7078,18 @@ var MessageActions = import_react79.default.forwardRef(
|
|
|
7066
7078
|
),
|
|
7067
7079
|
...rest
|
|
7068
7080
|
},
|
|
7069
|
-
/* @__PURE__ */
|
|
7070
|
-
isUser && onEdit && /* @__PURE__ */
|
|
7071
|
-
!isUser && onRetry && /* @__PURE__ */
|
|
7081
|
+
/* @__PURE__ */ import_react78.default.createElement(ActionButton2, { onClick: handleCopy, label: copied ? "Copied!" : "Copy message" }, copied ? /* @__PURE__ */ import_react78.default.createElement(import_lucide_react14.Check, { className: "w-3.5 h-3.5 text-success" }) : /* @__PURE__ */ import_react78.default.createElement(import_lucide_react14.Copy, { className: "w-3.5 h-3.5" })),
|
|
7082
|
+
isUser && onEdit && /* @__PURE__ */ import_react78.default.createElement(ActionButton2, { onClick: handleStartEdit, label: "Edit message" }, /* @__PURE__ */ import_react78.default.createElement(import_lucide_react14.Pencil, { className: "w-3.5 h-3.5" })),
|
|
7083
|
+
!isUser && onRetry && /* @__PURE__ */ import_react78.default.createElement(ActionButton2, { onClick: onRetry, label: "Regenerate response" }, /* @__PURE__ */ import_react78.default.createElement(import_lucide_react14.RotateCcw, { className: "w-3.5 h-3.5" }))
|
|
7072
7084
|
);
|
|
7073
7085
|
}
|
|
7074
7086
|
);
|
|
7075
7087
|
MessageActions.displayName = "MessageActions";
|
|
7076
7088
|
|
|
7077
7089
|
// src/components/chat/BranchNavigator.tsx
|
|
7078
|
-
var
|
|
7090
|
+
var import_react79 = __toESM(require("react"));
|
|
7079
7091
|
var import_lucide_react15 = require("lucide-react");
|
|
7080
|
-
var BranchNavigator =
|
|
7092
|
+
var BranchNavigator = import_react79.default.forwardRef(
|
|
7081
7093
|
({
|
|
7082
7094
|
current,
|
|
7083
7095
|
total,
|
|
@@ -7096,7 +7108,7 @@ var BranchNavigator = import_react80.default.forwardRef(
|
|
|
7096
7108
|
const buttonSize = size === "sm" ? "p-0.5" : "p-1";
|
|
7097
7109
|
const iconSize = size === "sm" ? "w-3 h-3" : "w-4 h-4";
|
|
7098
7110
|
const textSize = size === "sm" ? "text-xs" : "text-sm";
|
|
7099
|
-
return /* @__PURE__ */
|
|
7111
|
+
return /* @__PURE__ */ import_react79.default.createElement(
|
|
7100
7112
|
"div",
|
|
7101
7113
|
{
|
|
7102
7114
|
ref,
|
|
@@ -7108,8 +7120,8 @@ var BranchNavigator = import_react80.default.forwardRef(
|
|
|
7108
7120
|
"aria-label": "Branch navigation",
|
|
7109
7121
|
...rest
|
|
7110
7122
|
},
|
|
7111
|
-
showIcon && /* @__PURE__ */
|
|
7112
|
-
/* @__PURE__ */
|
|
7123
|
+
showIcon && /* @__PURE__ */ import_react79.default.createElement(import_lucide_react15.GitBranch, { className: cx(iconSize, "mr-0.5 text-silver/50"), "aria-hidden": "true" }),
|
|
7124
|
+
/* @__PURE__ */ import_react79.default.createElement(
|
|
7113
7125
|
"button",
|
|
7114
7126
|
{
|
|
7115
7127
|
type: "button",
|
|
@@ -7122,10 +7134,10 @@ var BranchNavigator = import_react80.default.forwardRef(
|
|
|
7122
7134
|
),
|
|
7123
7135
|
"aria-label": "Previous branch"
|
|
7124
7136
|
},
|
|
7125
|
-
/* @__PURE__ */
|
|
7137
|
+
/* @__PURE__ */ import_react79.default.createElement(import_lucide_react15.ChevronLeft, { className: iconSize })
|
|
7126
7138
|
),
|
|
7127
|
-
/* @__PURE__ */
|
|
7128
|
-
/* @__PURE__ */
|
|
7139
|
+
/* @__PURE__ */ import_react79.default.createElement("span", { className: cx(textSize, "tabular-nums min-w-6 text-center") }, current, "/", total),
|
|
7140
|
+
/* @__PURE__ */ import_react79.default.createElement(
|
|
7129
7141
|
"button",
|
|
7130
7142
|
{
|
|
7131
7143
|
type: "button",
|
|
@@ -7138,7 +7150,7 @@ var BranchNavigator = import_react80.default.forwardRef(
|
|
|
7138
7150
|
),
|
|
7139
7151
|
"aria-label": "Next branch"
|
|
7140
7152
|
},
|
|
7141
|
-
/* @__PURE__ */
|
|
7153
|
+
/* @__PURE__ */ import_react79.default.createElement(import_lucide_react15.ChevronRight, { className: iconSize })
|
|
7142
7154
|
)
|
|
7143
7155
|
);
|
|
7144
7156
|
}
|
|
@@ -7146,16 +7158,16 @@ var BranchNavigator = import_react80.default.forwardRef(
|
|
|
7146
7158
|
BranchNavigator.displayName = "BranchNavigator";
|
|
7147
7159
|
|
|
7148
7160
|
// src/components/BrandIcon.tsx
|
|
7149
|
-
var
|
|
7161
|
+
var import_react80 = __toESM(require("react"));
|
|
7150
7162
|
var sizeMap2 = {
|
|
7151
7163
|
sm: "h-8 w-8 text-sm",
|
|
7152
7164
|
md: "h-12 w-12 text-base",
|
|
7153
7165
|
lg: "h-16 w-16 text-lg"
|
|
7154
7166
|
};
|
|
7155
|
-
var BrandIcon =
|
|
7167
|
+
var BrandIcon = import_react80.default.forwardRef(
|
|
7156
7168
|
({ size = "md", variant = "solid", children, className, ...rest }, ref) => {
|
|
7157
7169
|
const variantClasses = variant === "solid" ? "bg-gold text-obsidian border-2 border-gold" : "bg-transparent text-gold border-2 border-gold";
|
|
7158
|
-
return /* @__PURE__ */
|
|
7170
|
+
return /* @__PURE__ */ import_react80.default.createElement(
|
|
7159
7171
|
"div",
|
|
7160
7172
|
{
|
|
7161
7173
|
ref,
|
|
@@ -7174,17 +7186,17 @@ var BrandIcon = import_react81.default.forwardRef(
|
|
|
7174
7186
|
BrandIcon.displayName = "BrandIcon";
|
|
7175
7187
|
|
|
7176
7188
|
// src/components/ColorSwatch.tsx
|
|
7177
|
-
var
|
|
7178
|
-
var ColorSwatch =
|
|
7189
|
+
var import_react81 = __toESM(require("react"));
|
|
7190
|
+
var ColorSwatch = import_react81.default.forwardRef(
|
|
7179
7191
|
({ color, label, className, ...rest }, ref) => {
|
|
7180
|
-
return /* @__PURE__ */
|
|
7192
|
+
return /* @__PURE__ */ import_react81.default.createElement(
|
|
7181
7193
|
"div",
|
|
7182
7194
|
{
|
|
7183
7195
|
ref,
|
|
7184
7196
|
className: cx("flex flex-col items-center gap-2", className),
|
|
7185
7197
|
...rest
|
|
7186
7198
|
},
|
|
7187
|
-
/* @__PURE__ */
|
|
7199
|
+
/* @__PURE__ */ import_react81.default.createElement(
|
|
7188
7200
|
"div",
|
|
7189
7201
|
{
|
|
7190
7202
|
className: "h-16 w-16 border-2 border-ash rounded-none shadow-sm",
|
|
@@ -7192,22 +7204,22 @@ var ColorSwatch = import_react82.default.forwardRef(
|
|
|
7192
7204
|
"aria-label": label || color
|
|
7193
7205
|
}
|
|
7194
7206
|
),
|
|
7195
|
-
label && /* @__PURE__ */
|
|
7207
|
+
label && /* @__PURE__ */ import_react81.default.createElement("span", { className: "text-xs text-silver font-medium" }, label)
|
|
7196
7208
|
);
|
|
7197
7209
|
}
|
|
7198
7210
|
);
|
|
7199
7211
|
ColorSwatch.displayName = "ColorSwatch";
|
|
7200
7212
|
|
|
7201
7213
|
// src/components/SectionHeading.tsx
|
|
7202
|
-
var
|
|
7214
|
+
var import_react82 = __toESM(require("react"));
|
|
7203
7215
|
var levelStyles = {
|
|
7204
7216
|
h2: "text-2xl mb-4",
|
|
7205
7217
|
h3: "text-xl mb-3"
|
|
7206
7218
|
};
|
|
7207
|
-
var SectionHeading =
|
|
7219
|
+
var SectionHeading = import_react82.default.forwardRef(
|
|
7208
7220
|
({ level = "h2", children, className, ...rest }, ref) => {
|
|
7209
7221
|
const Component = level;
|
|
7210
|
-
return /* @__PURE__ */
|
|
7222
|
+
return /* @__PURE__ */ import_react82.default.createElement(
|
|
7211
7223
|
Component,
|
|
7212
7224
|
{
|
|
7213
7225
|
ref,
|
|
@@ -7368,7 +7380,6 @@ var version = "2.0.0";
|
|
|
7368
7380
|
switchBranch,
|
|
7369
7381
|
updateNodeContent,
|
|
7370
7382
|
useArtifactTreeNavigation,
|
|
7371
|
-
useArtifacts,
|
|
7372
7383
|
useResizable,
|
|
7373
7384
|
useScrollAnchor,
|
|
7374
7385
|
useToast,
|