@lukeashford/aurelius 3.4.0 → 3.6.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 +102 -3
- package/dist/index.d.ts +102 -3
- package/dist/index.js +539 -196
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +540 -198
- package/dist/index.mjs.map +1 -1
- package/llms.md +29 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4157,7 +4157,7 @@ var StreamingCursor = React56.forwardRef(
|
|
|
4157
4157
|
StreamingCursor.displayName = "StreamingCursor";
|
|
4158
4158
|
|
|
4159
4159
|
// src/components/chat/ChatInterface.tsx
|
|
4160
|
-
import
|
|
4160
|
+
import React74, { useCallback as useCallback20, useEffect as useEffect16, useMemo as useMemo5, useRef as useRef14, useState as useState21 } from "react";
|
|
4161
4161
|
|
|
4162
4162
|
// src/components/chat/ChatView.tsx
|
|
4163
4163
|
import React58, { useEffect as useEffect9 } from "react";
|
|
@@ -4461,7 +4461,7 @@ ChatView.displayName = "ChatView";
|
|
|
4461
4461
|
|
|
4462
4462
|
// src/components/chat/ChatInput.tsx
|
|
4463
4463
|
import React59, { useCallback as useCallback13, useEffect as useEffect10, useRef as useRef8, useState as useState13 } from "react";
|
|
4464
|
-
import { Paperclip, Send, Square } from "lucide-react";
|
|
4464
|
+
import { Paperclip, Send, Square, X as X5 } from "lucide-react";
|
|
4465
4465
|
|
|
4466
4466
|
// src/components/chat/types.ts
|
|
4467
4467
|
function isImageFile(file) {
|
|
@@ -4643,6 +4643,9 @@ var ChatInput = React59.forwardRef(
|
|
|
4643
4643
|
onAttachmentsChange,
|
|
4644
4644
|
showAttachmentButton = true,
|
|
4645
4645
|
acceptedFileTypes,
|
|
4646
|
+
notice,
|
|
4647
|
+
onInputChange,
|
|
4648
|
+
autoFocus = false,
|
|
4646
4649
|
className,
|
|
4647
4650
|
...rest
|
|
4648
4651
|
}, ref) => {
|
|
@@ -4689,15 +4692,16 @@ var ChatInput = React59.forwardRef(
|
|
|
4689
4692
|
);
|
|
4690
4693
|
const handleChange = useCallback13((e) => {
|
|
4691
4694
|
setValue(e.target.value);
|
|
4695
|
+
onInputChange?.(e.target.value);
|
|
4692
4696
|
const textarea = e.target;
|
|
4693
4697
|
textarea.style.height = "auto";
|
|
4694
4698
|
textarea.style.height = `${Math.min(textarea.scrollHeight, 200)}px`;
|
|
4695
|
-
}, []);
|
|
4699
|
+
}, [onInputChange]);
|
|
4696
4700
|
useEffect10(() => {
|
|
4697
|
-
if (!disabled && !isStreaming && textareaRef.current) {
|
|
4701
|
+
if (autoFocus && !disabled && !isStreaming && textareaRef.current) {
|
|
4698
4702
|
textareaRef.current.focus();
|
|
4699
4703
|
}
|
|
4700
|
-
}, [disabled, isStreaming]);
|
|
4704
|
+
}, [disabled, isStreaming, autoFocus]);
|
|
4701
4705
|
const addFiles = useCallback13(
|
|
4702
4706
|
(files) => {
|
|
4703
4707
|
const newAttachments = Array.from(files).map((file) => ({
|
|
@@ -4776,6 +4780,23 @@ var ChatInput = React59.forwardRef(
|
|
|
4776
4780
|
...rest
|
|
4777
4781
|
},
|
|
4778
4782
|
isCentered && helperText && /* @__PURE__ */ React59.createElement("p", { className: "text-silver text-sm mb-4 text-center" }, helperText),
|
|
4783
|
+
notice && /* @__PURE__ */ React59.createElement("div", { className: cx(
|
|
4784
|
+
"w-full flex items-start gap-2 px-3 py-2 mb-1 text-xs",
|
|
4785
|
+
isCentered && "max-w-lg",
|
|
4786
|
+
notice.variant === "warning" ? "bg-gold/5 border border-gold/20 text-gold/80" : "bg-error/10 border border-error/30 text-error"
|
|
4787
|
+
) }, /* @__PURE__ */ React59.createElement("span", { className: "flex-1" }, notice.content), (notice.dismissible ?? notice.variant === "warning") && notice.onDismiss && /* @__PURE__ */ React59.createElement(
|
|
4788
|
+
"button",
|
|
4789
|
+
{
|
|
4790
|
+
type: "button",
|
|
4791
|
+
onClick: notice.onDismiss,
|
|
4792
|
+
"aria-label": "Dismiss",
|
|
4793
|
+
className: cx(
|
|
4794
|
+
"shrink-0 opacity-60 hover:opacity-100 transition-opacity",
|
|
4795
|
+
notice.variant === "warning" ? "text-gold" : "text-error"
|
|
4796
|
+
)
|
|
4797
|
+
},
|
|
4798
|
+
/* @__PURE__ */ React59.createElement(X5, { className: "w-3 h-3" })
|
|
4799
|
+
)),
|
|
4779
4800
|
/* @__PURE__ */ React59.createElement(
|
|
4780
4801
|
"div",
|
|
4781
4802
|
{
|
|
@@ -5906,8 +5927,346 @@ var ArtifactsPanelToggle = React69.forwardRef(({ artifactCount = 0, onExpand, cl
|
|
|
5906
5927
|
});
|
|
5907
5928
|
ArtifactsPanelToggle.displayName = "ArtifactsPanelToggle";
|
|
5908
5929
|
|
|
5930
|
+
// src/components/chat/HistoryPanel.tsx
|
|
5931
|
+
import React70, { useCallback as useCallback16, useEffect as useEffect13, useMemo as useMemo3, useRef as useRef11, useState as useState17 } from "react";
|
|
5932
|
+
function parseTimestamp(ts) {
|
|
5933
|
+
if (ts == null) {
|
|
5934
|
+
return null;
|
|
5935
|
+
}
|
|
5936
|
+
const d = ts instanceof Date ? ts : new Date(ts);
|
|
5937
|
+
return Number.isNaN(d.getTime()) ? null : d;
|
|
5938
|
+
}
|
|
5939
|
+
function startOfDay(d) {
|
|
5940
|
+
const x = new Date(d);
|
|
5941
|
+
x.setHours(0, 0, 0, 0);
|
|
5942
|
+
return x;
|
|
5943
|
+
}
|
|
5944
|
+
function groupConversations(conversations) {
|
|
5945
|
+
const today = startOfDay(/* @__PURE__ */ new Date());
|
|
5946
|
+
const yesterday = new Date(today);
|
|
5947
|
+
yesterday.setDate(yesterday.getDate() - 1);
|
|
5948
|
+
const todayList = [];
|
|
5949
|
+
const yesterdayList = [];
|
|
5950
|
+
const olderList = [];
|
|
5951
|
+
for (const c of conversations) {
|
|
5952
|
+
const d = parseTimestamp(c.timestamp);
|
|
5953
|
+
if (d && d >= today) {
|
|
5954
|
+
todayList.push(c);
|
|
5955
|
+
} else if (d && d >= yesterday) {
|
|
5956
|
+
yesterdayList.push(c);
|
|
5957
|
+
} else {
|
|
5958
|
+
olderList.push(c);
|
|
5959
|
+
}
|
|
5960
|
+
}
|
|
5961
|
+
return [
|
|
5962
|
+
{ key: "today", label: "Today", conversations: todayList },
|
|
5963
|
+
{ key: "yesterday", label: "Yesterday", conversations: yesterdayList },
|
|
5964
|
+
{ key: "older", label: "Older", conversations: olderList }
|
|
5965
|
+
].filter((g) => g.conversations.length > 0);
|
|
5966
|
+
}
|
|
5967
|
+
function ChevronDownIcon({ className }) {
|
|
5968
|
+
return /* @__PURE__ */ React70.createElement(
|
|
5969
|
+
"svg",
|
|
5970
|
+
{
|
|
5971
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5972
|
+
viewBox: "0 0 20 20",
|
|
5973
|
+
fill: "currentColor",
|
|
5974
|
+
className,
|
|
5975
|
+
"aria-hidden": "true"
|
|
5976
|
+
},
|
|
5977
|
+
/* @__PURE__ */ React70.createElement(
|
|
5978
|
+
"path",
|
|
5979
|
+
{
|
|
5980
|
+
fillRule: "evenodd",
|
|
5981
|
+
d: "M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 111.08 1.04l-4.25 4.39a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z",
|
|
5982
|
+
clipRule: "evenodd"
|
|
5983
|
+
}
|
|
5984
|
+
)
|
|
5985
|
+
);
|
|
5986
|
+
}
|
|
5987
|
+
function PencilIcon2({ className }) {
|
|
5988
|
+
return /* @__PURE__ */ React70.createElement(
|
|
5989
|
+
"svg",
|
|
5990
|
+
{
|
|
5991
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5992
|
+
viewBox: "0 0 20 20",
|
|
5993
|
+
fill: "currentColor",
|
|
5994
|
+
className,
|
|
5995
|
+
"aria-hidden": "true"
|
|
5996
|
+
},
|
|
5997
|
+
/* @__PURE__ */ React70.createElement(
|
|
5998
|
+
"path",
|
|
5999
|
+
{
|
|
6000
|
+
d: "M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"
|
|
6001
|
+
}
|
|
6002
|
+
)
|
|
6003
|
+
);
|
|
6004
|
+
}
|
|
6005
|
+
function ProjectFilter({
|
|
6006
|
+
projects,
|
|
6007
|
+
value,
|
|
6008
|
+
onChange,
|
|
6009
|
+
className
|
|
6010
|
+
}) {
|
|
6011
|
+
const [open, setOpen] = useState17(false);
|
|
6012
|
+
const ref = useRef11(null);
|
|
6013
|
+
useEffect13(() => {
|
|
6014
|
+
if (!open) {
|
|
6015
|
+
return;
|
|
6016
|
+
}
|
|
6017
|
+
const handler = (e) => {
|
|
6018
|
+
if (ref.current && !ref.current.contains(e.target)) {
|
|
6019
|
+
setOpen(false);
|
|
6020
|
+
}
|
|
6021
|
+
};
|
|
6022
|
+
document.addEventListener("mousedown", handler);
|
|
6023
|
+
return () => document.removeEventListener("mousedown", handler);
|
|
6024
|
+
}, [open]);
|
|
6025
|
+
const label = value ?? "All projects";
|
|
6026
|
+
return /* @__PURE__ */ React70.createElement("div", { className: cx("relative min-w-0", className), ref }, /* @__PURE__ */ React70.createElement(
|
|
6027
|
+
"button",
|
|
6028
|
+
{
|
|
6029
|
+
type: "button",
|
|
6030
|
+
onClick: () => setOpen((o) => !o),
|
|
6031
|
+
"aria-haspopup": "listbox",
|
|
6032
|
+
"aria-expanded": open,
|
|
6033
|
+
className: cx(
|
|
6034
|
+
"w-full flex items-center justify-between gap-1 px-2 py-1.5",
|
|
6035
|
+
"bg-obsidian/60 hover:bg-ash/30",
|
|
6036
|
+
"text-silver hover:text-white",
|
|
6037
|
+
"border border-ash/40",
|
|
6038
|
+
"text-xs",
|
|
6039
|
+
"transition-colors duration-150 min-w-0"
|
|
6040
|
+
)
|
|
6041
|
+
},
|
|
6042
|
+
/* @__PURE__ */ React70.createElement("span", { className: "truncate" }, label),
|
|
6043
|
+
/* @__PURE__ */ React70.createElement(ChevronDownIcon, { className: "w-3 h-3 shrink-0" })
|
|
6044
|
+
), open && /* @__PURE__ */ React70.createElement(
|
|
6045
|
+
"div",
|
|
6046
|
+
{
|
|
6047
|
+
role: "listbox",
|
|
6048
|
+
className: cx(
|
|
6049
|
+
"absolute top-full left-0 right-0 mt-1 z-20",
|
|
6050
|
+
"bg-charcoal border border-ash/40",
|
|
6051
|
+
"max-h-60 overflow-y-auto"
|
|
6052
|
+
)
|
|
6053
|
+
},
|
|
6054
|
+
/* @__PURE__ */ React70.createElement(
|
|
6055
|
+
"button",
|
|
6056
|
+
{
|
|
6057
|
+
type: "button",
|
|
6058
|
+
role: "option",
|
|
6059
|
+
"aria-selected": value === null,
|
|
6060
|
+
onClick: () => {
|
|
6061
|
+
onChange(null);
|
|
6062
|
+
setOpen(false);
|
|
6063
|
+
},
|
|
6064
|
+
className: cx(
|
|
6065
|
+
"w-full px-2 py-1.5 text-left text-xs truncate",
|
|
6066
|
+
"transition-colors duration-150",
|
|
6067
|
+
value === null ? "bg-gold/10 text-gold" : "text-silver hover:bg-ash/20 hover:text-white"
|
|
6068
|
+
)
|
|
6069
|
+
},
|
|
6070
|
+
"All projects"
|
|
6071
|
+
),
|
|
6072
|
+
projects.map((p) => /* @__PURE__ */ React70.createElement(
|
|
6073
|
+
"button",
|
|
6074
|
+
{
|
|
6075
|
+
key: p,
|
|
6076
|
+
type: "button",
|
|
6077
|
+
role: "option",
|
|
6078
|
+
"aria-selected": value === p,
|
|
6079
|
+
onClick: () => {
|
|
6080
|
+
onChange(p);
|
|
6081
|
+
setOpen(false);
|
|
6082
|
+
},
|
|
6083
|
+
className: cx(
|
|
6084
|
+
"w-full px-2 py-1.5 text-left text-xs truncate",
|
|
6085
|
+
"transition-colors duration-150",
|
|
6086
|
+
value === p ? "bg-gold/10 text-gold" : "text-silver hover:bg-ash/20 hover:text-white"
|
|
6087
|
+
)
|
|
6088
|
+
},
|
|
6089
|
+
p
|
|
6090
|
+
))
|
|
6091
|
+
));
|
|
6092
|
+
}
|
|
6093
|
+
function ConversationRow({
|
|
6094
|
+
conversation,
|
|
6095
|
+
onSelect,
|
|
6096
|
+
onRename
|
|
6097
|
+
}) {
|
|
6098
|
+
const [isEditing, setIsEditing] = useState17(false);
|
|
6099
|
+
const [draft, setDraft] = useState17(conversation.title);
|
|
6100
|
+
const inputRef = useRef11(null);
|
|
6101
|
+
useEffect13(() => {
|
|
6102
|
+
if (isEditing && inputRef.current) {
|
|
6103
|
+
inputRef.current.focus();
|
|
6104
|
+
inputRef.current.select();
|
|
6105
|
+
}
|
|
6106
|
+
}, [isEditing]);
|
|
6107
|
+
const startEdit = useCallback16((e) => {
|
|
6108
|
+
e.stopPropagation();
|
|
6109
|
+
setDraft(conversation.title);
|
|
6110
|
+
setIsEditing(true);
|
|
6111
|
+
}, [conversation.title]);
|
|
6112
|
+
const commit = useCallback16(() => {
|
|
6113
|
+
const trimmed = draft.trim();
|
|
6114
|
+
if (trimmed && trimmed !== conversation.title) {
|
|
6115
|
+
onRename?.(conversation.id, trimmed);
|
|
6116
|
+
}
|
|
6117
|
+
setIsEditing(false);
|
|
6118
|
+
}, [draft, conversation.id, conversation.title, onRename]);
|
|
6119
|
+
const cancel = useCallback16(() => {
|
|
6120
|
+
setDraft(conversation.title);
|
|
6121
|
+
setIsEditing(false);
|
|
6122
|
+
}, [conversation.title]);
|
|
6123
|
+
if (isEditing) {
|
|
6124
|
+
return /* @__PURE__ */ React70.createElement(
|
|
6125
|
+
"div",
|
|
6126
|
+
{
|
|
6127
|
+
className: cx(
|
|
6128
|
+
"w-full px-3 py-2",
|
|
6129
|
+
conversation.isActive ? "bg-ash/40" : "bg-ash/20"
|
|
6130
|
+
)
|
|
6131
|
+
},
|
|
6132
|
+
/* @__PURE__ */ React70.createElement(
|
|
6133
|
+
"input",
|
|
6134
|
+
{
|
|
6135
|
+
ref: inputRef,
|
|
6136
|
+
type: "text",
|
|
6137
|
+
value: draft,
|
|
6138
|
+
onChange: (e) => setDraft(e.target.value),
|
|
6139
|
+
onBlur: commit,
|
|
6140
|
+
onKeyDown: (e) => {
|
|
6141
|
+
if (e.key === "Enter") {
|
|
6142
|
+
e.preventDefault();
|
|
6143
|
+
commit();
|
|
6144
|
+
} else if (e.key === "Escape") {
|
|
6145
|
+
e.preventDefault();
|
|
6146
|
+
cancel();
|
|
6147
|
+
}
|
|
6148
|
+
},
|
|
6149
|
+
className: cx(
|
|
6150
|
+
"w-full px-2 py-1 text-sm font-medium text-white",
|
|
6151
|
+
"bg-obsidian border border-gold/40",
|
|
6152
|
+
"outline-none focus:border-gold"
|
|
6153
|
+
),
|
|
6154
|
+
"aria-label": "Conversation title"
|
|
6155
|
+
}
|
|
6156
|
+
),
|
|
6157
|
+
conversation.project && /* @__PURE__ */ React70.createElement("p", { className: "text-xs text-silver/60 truncate mt-1" }, conversation.project)
|
|
6158
|
+
);
|
|
6159
|
+
}
|
|
6160
|
+
return /* @__PURE__ */ React70.createElement("div", { className: "relative group" }, /* @__PURE__ */ React70.createElement(
|
|
6161
|
+
"button",
|
|
6162
|
+
{
|
|
6163
|
+
onClick: () => onSelect?.(conversation.id),
|
|
6164
|
+
className: cx(
|
|
6165
|
+
"w-full px-3 py-2 text-left",
|
|
6166
|
+
"transition-colors duration-150",
|
|
6167
|
+
conversation.isActive ? "bg-ash/40 text-white" : "text-silver hover:bg-ash/20 hover:text-white"
|
|
6168
|
+
)
|
|
6169
|
+
},
|
|
6170
|
+
/* @__PURE__ */ React70.createElement(
|
|
6171
|
+
"p",
|
|
6172
|
+
{
|
|
6173
|
+
className: cx(
|
|
6174
|
+
"text-sm font-medium truncate",
|
|
6175
|
+
onRename ? "pr-6" : ""
|
|
6176
|
+
)
|
|
6177
|
+
},
|
|
6178
|
+
conversation.title
|
|
6179
|
+
),
|
|
6180
|
+
conversation.project && /* @__PURE__ */ React70.createElement("p", { className: "text-xs text-silver/60 truncate mt-0.5" }, conversation.project)
|
|
6181
|
+
), onRename && /* @__PURE__ */ React70.createElement(
|
|
6182
|
+
"button",
|
|
6183
|
+
{
|
|
6184
|
+
type: "button",
|
|
6185
|
+
onClick: startEdit,
|
|
6186
|
+
"aria-label": "Rename conversation",
|
|
6187
|
+
className: cx(
|
|
6188
|
+
"absolute right-2 top-2",
|
|
6189
|
+
"p-1 text-silver/60 hover:text-gold hover:bg-ash/40",
|
|
6190
|
+
"opacity-0 group-hover:opacity-100 focus:opacity-100",
|
|
6191
|
+
"transition-opacity duration-150"
|
|
6192
|
+
)
|
|
6193
|
+
},
|
|
6194
|
+
/* @__PURE__ */ React70.createElement(PencilIcon2, { className: "w-3.5 h-3.5" })
|
|
6195
|
+
));
|
|
6196
|
+
}
|
|
6197
|
+
function HistoryPanel({
|
|
6198
|
+
conversations,
|
|
6199
|
+
onSelectConversation,
|
|
6200
|
+
onNewChat,
|
|
6201
|
+
onRenameConversation
|
|
6202
|
+
}) {
|
|
6203
|
+
const [projectFilter, setProjectFilter] = useState17(null);
|
|
6204
|
+
const projects = useMemo3(() => {
|
|
6205
|
+
const set = /* @__PURE__ */ new Set();
|
|
6206
|
+
for (const c of conversations) {
|
|
6207
|
+
if (c.project) {
|
|
6208
|
+
set.add(c.project);
|
|
6209
|
+
}
|
|
6210
|
+
}
|
|
6211
|
+
return Array.from(set).sort((a, b) => a.localeCompare(b));
|
|
6212
|
+
}, [conversations]);
|
|
6213
|
+
useEffect13(() => {
|
|
6214
|
+
if (projectFilter && !projects.includes(projectFilter)) {
|
|
6215
|
+
setProjectFilter(null);
|
|
6216
|
+
}
|
|
6217
|
+
}, [projects, projectFilter]);
|
|
6218
|
+
const filteredConversations = useMemo3(() => {
|
|
6219
|
+
if (!projectFilter) {
|
|
6220
|
+
return conversations;
|
|
6221
|
+
}
|
|
6222
|
+
return conversations.filter((c) => c.project === projectFilter);
|
|
6223
|
+
}, [conversations, projectFilter]);
|
|
6224
|
+
const groups = useMemo3(
|
|
6225
|
+
() => groupConversations(filteredConversations),
|
|
6226
|
+
[filteredConversations]
|
|
6227
|
+
);
|
|
6228
|
+
const hasFilter = projects.length > 0;
|
|
6229
|
+
return /* @__PURE__ */ React70.createElement("div", { className: "h-full flex flex-col" }, /* @__PURE__ */ React70.createElement("div", { className: "px-4 py-3 border-b border-ash/40 shrink-0 flex items-center gap-2" }, /* @__PURE__ */ React70.createElement("h3", { className: "text-xs font-medium text-white shrink-0" }, "History"), (hasFilter || onNewChat) && /* @__PURE__ */ React70.createElement("div", { className: "flex items-center gap-2 flex-1 min-w-0" }, hasFilter && /* @__PURE__ */ React70.createElement(React70.Fragment, null, /* @__PURE__ */ React70.createElement("div", { className: "w-px h-3 bg-ash/40 shrink-0 mx-1" }), /* @__PURE__ */ React70.createElement(
|
|
6230
|
+
ProjectFilter,
|
|
6231
|
+
{
|
|
6232
|
+
projects,
|
|
6233
|
+
value: projectFilter,
|
|
6234
|
+
onChange: setProjectFilter,
|
|
6235
|
+
className: "flex-1"
|
|
6236
|
+
}
|
|
6237
|
+
)), onNewChat && /* @__PURE__ */ React70.createElement(React70.Fragment, null, /* @__PURE__ */ React70.createElement("div", { className: "w-px h-3 bg-ash/40 shrink-0 mx-1" }), /* @__PURE__ */ React70.createElement(
|
|
6238
|
+
"button",
|
|
6239
|
+
{
|
|
6240
|
+
onClick: onNewChat,
|
|
6241
|
+
className: cx(
|
|
6242
|
+
"flex items-center gap-1 px-2.5 py-1.5 shrink-0",
|
|
6243
|
+
"bg-gold/10 hover:bg-gold/20 text-gold",
|
|
6244
|
+
"border border-gold/30",
|
|
6245
|
+
"text-xs font-medium",
|
|
6246
|
+
"transition-colors duration-200"
|
|
6247
|
+
)
|
|
6248
|
+
},
|
|
6249
|
+
/* @__PURE__ */ React70.createElement(PlusIcon, { className: "w-4 h-4" }),
|
|
6250
|
+
/* @__PURE__ */ React70.createElement("span", { className: "truncate" }, "New Chat")
|
|
6251
|
+
)))), /* @__PURE__ */ React70.createElement("div", { className: "flex-1 overflow-y-auto py-2" }, conversations.length === 0 ? /* @__PURE__ */ React70.createElement("p", { className: "px-4 py-2 text-xs text-silver/60" }, "No conversations yet") : groups.length === 0 ? /* @__PURE__ */ React70.createElement("p", { className: "px-4 py-2 text-xs text-silver/60" }, "No conversations match this filter") : /* @__PURE__ */ React70.createElement("div", null, groups.map((group, index) => /* @__PURE__ */ React70.createElement("section", { key: group.key, className: cx(index > 0 && "mt-3") }, /* @__PURE__ */ React70.createElement("div", { className: "flex items-center gap-2 px-3 pb-2" }, /* @__PURE__ */ React70.createElement(
|
|
6252
|
+
"span",
|
|
6253
|
+
{
|
|
6254
|
+
className: "text-xs font-medium uppercase tracking-wider text-gold/70"
|
|
6255
|
+
},
|
|
6256
|
+
group.label
|
|
6257
|
+
), /* @__PURE__ */ React70.createElement("div", { className: "flex-1 h-px bg-gold/20" })), /* @__PURE__ */ React70.createElement("div", { className: "space-y-1 px-2" }, group.conversations.map((conversation) => /* @__PURE__ */ React70.createElement(
|
|
6258
|
+
ConversationRow,
|
|
6259
|
+
{
|
|
6260
|
+
key: conversation.id,
|
|
6261
|
+
conversation,
|
|
6262
|
+
onSelect: onSelectConversation,
|
|
6263
|
+
onRename: onRenameConversation
|
|
6264
|
+
}
|
|
6265
|
+
))))))));
|
|
6266
|
+
}
|
|
6267
|
+
|
|
5909
6268
|
// src/components/chat/TodosList.tsx
|
|
5910
|
-
import
|
|
6269
|
+
import React71, { useCallback as useCallback17, useMemo as useMemo4, useState as useState18 } from "react";
|
|
5911
6270
|
import { Loader2 as Loader22, Square as Square2 } from "lucide-react";
|
|
5912
6271
|
var TASK_STATUSES = {
|
|
5913
6272
|
PENDING: "pending",
|
|
@@ -5919,16 +6278,16 @@ var TASK_STATUSES = {
|
|
|
5919
6278
|
function TaskIcon({ status }) {
|
|
5920
6279
|
switch (status) {
|
|
5921
6280
|
case "done":
|
|
5922
|
-
return /* @__PURE__ */
|
|
6281
|
+
return /* @__PURE__ */ React71.createElement(CheckSquareIcon, null);
|
|
5923
6282
|
case "in_progress":
|
|
5924
|
-
return /* @__PURE__ */
|
|
6283
|
+
return /* @__PURE__ */ React71.createElement(SquareLoaderIcon, null);
|
|
5925
6284
|
case "cancelled":
|
|
5926
|
-
return /* @__PURE__ */
|
|
6285
|
+
return /* @__PURE__ */ React71.createElement(CrossSquareIcon, { variant: "cancelled" });
|
|
5927
6286
|
case "failed":
|
|
5928
|
-
return /* @__PURE__ */
|
|
6287
|
+
return /* @__PURE__ */ React71.createElement(CrossSquareIcon, { variant: "failed" });
|
|
5929
6288
|
case "pending":
|
|
5930
6289
|
default:
|
|
5931
|
-
return /* @__PURE__ */
|
|
6290
|
+
return /* @__PURE__ */ React71.createElement(EmptySquareIcon, null);
|
|
5932
6291
|
}
|
|
5933
6292
|
}
|
|
5934
6293
|
function sortTasks(tasks) {
|
|
@@ -5948,7 +6307,7 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
5948
6307
|
const isSubtle = task.status === "cancelled" || task.status === "failed";
|
|
5949
6308
|
const showSubtasks = (task.status === "in_progress" || task.status === "done") && task.subtasks && task.subtasks.length > 0;
|
|
5950
6309
|
const sortedSubtasks = showSubtasks ? sortTasks(task.subtasks) : [];
|
|
5951
|
-
return /* @__PURE__ */
|
|
6310
|
+
return /* @__PURE__ */ React71.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React71.createElement(
|
|
5952
6311
|
"div",
|
|
5953
6312
|
{
|
|
5954
6313
|
className: cx(
|
|
@@ -5956,8 +6315,8 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
5956
6315
|
depth > 0 && "pl-6"
|
|
5957
6316
|
)
|
|
5958
6317
|
},
|
|
5959
|
-
/* @__PURE__ */
|
|
5960
|
-
/* @__PURE__ */
|
|
6318
|
+
/* @__PURE__ */ React71.createElement(TaskIcon, { status: task.status }),
|
|
6319
|
+
/* @__PURE__ */ React71.createElement(
|
|
5961
6320
|
"span",
|
|
5962
6321
|
{
|
|
5963
6322
|
className: cx(
|
|
@@ -5969,10 +6328,10 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
5969
6328
|
)
|
|
5970
6329
|
},
|
|
5971
6330
|
task.label,
|
|
5972
|
-
task.status === "cancelled" && /* @__PURE__ */
|
|
5973
|
-
task.status === "failed" && /* @__PURE__ */
|
|
6331
|
+
task.status === "cancelled" && /* @__PURE__ */ React71.createElement("span", { className: "text-silver/40 ml-1" }, "(cancelled)"),
|
|
6332
|
+
task.status === "failed" && /* @__PURE__ */ React71.createElement("span", { className: "text-error/60 ml-1" }, "(failed)")
|
|
5974
6333
|
)
|
|
5975
|
-
), showSubtasks && /* @__PURE__ */
|
|
6334
|
+
), showSubtasks && /* @__PURE__ */ React71.createElement("div", { className: "flex flex-col" }, sortedSubtasks.map((subtask) => /* @__PURE__ */ React71.createElement(TaskItem, { key: subtask.id, task: subtask, depth: depth + 1 }))));
|
|
5976
6335
|
}
|
|
5977
6336
|
function hasInProgressTask(tasks) {
|
|
5978
6337
|
return tasks.some((t) => {
|
|
@@ -5981,11 +6340,11 @@ function hasInProgressTask(tasks) {
|
|
|
5981
6340
|
return false;
|
|
5982
6341
|
});
|
|
5983
6342
|
}
|
|
5984
|
-
var TodosList =
|
|
6343
|
+
var TodosList = React71.forwardRef(
|
|
5985
6344
|
({ tasks, title = "Tasks", onStopAllTasks, className, ...rest }, ref) => {
|
|
5986
|
-
const sortedTasks =
|
|
5987
|
-
const [isStopping, setIsStopping] =
|
|
5988
|
-
const handleStopClick =
|
|
6345
|
+
const sortedTasks = useMemo4(() => sortTasks(tasks), [tasks]);
|
|
6346
|
+
const [isStopping, setIsStopping] = useState18(false);
|
|
6347
|
+
const handleStopClick = useCallback17(async () => {
|
|
5989
6348
|
if (!onStopAllTasks || isStopping) return;
|
|
5990
6349
|
try {
|
|
5991
6350
|
setIsStopping(true);
|
|
@@ -6019,7 +6378,7 @@ var TodosList = React70.forwardRef(
|
|
|
6019
6378
|
if (tasks.length === 0) {
|
|
6020
6379
|
return null;
|
|
6021
6380
|
}
|
|
6022
|
-
return /* @__PURE__ */
|
|
6381
|
+
return /* @__PURE__ */ React71.createElement(
|
|
6023
6382
|
"div",
|
|
6024
6383
|
{
|
|
6025
6384
|
ref,
|
|
@@ -6030,16 +6389,16 @@ var TodosList = React70.forwardRef(
|
|
|
6030
6389
|
),
|
|
6031
6390
|
...rest
|
|
6032
6391
|
},
|
|
6033
|
-
/* @__PURE__ */
|
|
6392
|
+
/* @__PURE__ */ React71.createElement(
|
|
6034
6393
|
"div",
|
|
6035
6394
|
{
|
|
6036
6395
|
className: "flex items-center justify-between px-4 py-2 border-b border-ash/40 flex-shrink-0"
|
|
6037
6396
|
},
|
|
6038
|
-
/* @__PURE__ */
|
|
6039
|
-
/* @__PURE__ */
|
|
6397
|
+
/* @__PURE__ */ React71.createElement("h4", { className: "text-xs font-medium text-white" }, title),
|
|
6398
|
+
/* @__PURE__ */ React71.createElement("span", { className: "text-xs text-silver/60" }, countCompleted(tasks), "/", countTotal(tasks))
|
|
6040
6399
|
),
|
|
6041
|
-
/* @__PURE__ */
|
|
6042
|
-
showStopButton && /* @__PURE__ */
|
|
6400
|
+
/* @__PURE__ */ React71.createElement("div", { className: "flex-1 overflow-y-auto px-4 py-2" }, sortedTasks.map((task) => /* @__PURE__ */ React71.createElement(TaskItem, { key: task.id, task }))),
|
|
6401
|
+
showStopButton && /* @__PURE__ */ React71.createElement("div", { className: "px-4 py-2 border-t border-ash/40 flex-shrink-0" }, /* @__PURE__ */ React71.createElement(
|
|
6043
6402
|
"button",
|
|
6044
6403
|
{
|
|
6045
6404
|
type: "button",
|
|
@@ -6056,7 +6415,7 @@ var TodosList = React70.forwardRef(
|
|
|
6056
6415
|
isStopping ? "cursor-not-allowed opacity-70" : "hover:bg-error/20"
|
|
6057
6416
|
)
|
|
6058
6417
|
},
|
|
6059
|
-
isStopping ? /* @__PURE__ */
|
|
6418
|
+
isStopping ? /* @__PURE__ */ React71.createElement(React71.Fragment, null, /* @__PURE__ */ React71.createElement(Loader22, { className: "w-3 h-3 animate-spin" }), "Stopping tasks") : /* @__PURE__ */ React71.createElement(React71.Fragment, null, /* @__PURE__ */ React71.createElement(Square2, { className: "w-3 h-3 fill-current" }), "Stop All Tasks")
|
|
6060
6419
|
))
|
|
6061
6420
|
);
|
|
6062
6421
|
}
|
|
@@ -6072,8 +6431,8 @@ function areAllTasksSettled(tasks) {
|
|
|
6072
6431
|
}
|
|
6073
6432
|
|
|
6074
6433
|
// src/components/chat/ToolSidebar.tsx
|
|
6075
|
-
import
|
|
6076
|
-
var ToolSidebar =
|
|
6434
|
+
import React72 from "react";
|
|
6435
|
+
var ToolSidebar = React72.forwardRef(
|
|
6077
6436
|
({ tools, activeTools, onToggleTool, side, className, ...rest }, ref) => {
|
|
6078
6437
|
const topTools = tools.filter((t) => t.group === `top-${side}`);
|
|
6079
6438
|
const bottomTools = tools.filter((t) => t.group === `bottom-${side}`);
|
|
@@ -6084,7 +6443,7 @@ var ToolSidebar = React71.forwardRef(
|
|
|
6084
6443
|
};
|
|
6085
6444
|
const renderButton = (tool) => {
|
|
6086
6445
|
const active = isActive(tool.id);
|
|
6087
|
-
return /* @__PURE__ */
|
|
6446
|
+
return /* @__PURE__ */ React72.createElement(
|
|
6088
6447
|
"button",
|
|
6089
6448
|
{
|
|
6090
6449
|
key: tool.id,
|
|
@@ -6096,10 +6455,10 @@ var ToolSidebar = React71.forwardRef(
|
|
|
6096
6455
|
"aria-label": tool.label,
|
|
6097
6456
|
"aria-pressed": active
|
|
6098
6457
|
},
|
|
6099
|
-
/* @__PURE__ */
|
|
6458
|
+
/* @__PURE__ */ React72.createElement("span", { className: "w-4 h-4 block" }, tool.icon)
|
|
6100
6459
|
);
|
|
6101
6460
|
};
|
|
6102
|
-
return /* @__PURE__ */
|
|
6461
|
+
return /* @__PURE__ */ React72.createElement(
|
|
6103
6462
|
"div",
|
|
6104
6463
|
{
|
|
6105
6464
|
ref,
|
|
@@ -6110,33 +6469,42 @@ var ToolSidebar = React71.forwardRef(
|
|
|
6110
6469
|
),
|
|
6111
6470
|
...rest
|
|
6112
6471
|
},
|
|
6113
|
-
/* @__PURE__ */
|
|
6114
|
-
/* @__PURE__ */
|
|
6115
|
-
/* @__PURE__ */
|
|
6472
|
+
/* @__PURE__ */ React72.createElement("div", { className: "flex flex-col items-center gap-1" }, topTools.map(renderButton)),
|
|
6473
|
+
/* @__PURE__ */ React72.createElement("div", { className: "flex-1 flex items-center justify-center" }, /* @__PURE__ */ React72.createElement("div", { className: "w-5 border-t border-ash/30" })),
|
|
6474
|
+
/* @__PURE__ */ React72.createElement("div", { className: "flex flex-col items-center gap-1" }, bottomTools.map(renderButton))
|
|
6116
6475
|
);
|
|
6117
6476
|
}
|
|
6118
6477
|
);
|
|
6119
6478
|
ToolSidebar.displayName = "ToolSidebar";
|
|
6120
6479
|
|
|
6121
6480
|
// src/components/chat/ToolPanelContainer.tsx
|
|
6122
|
-
import
|
|
6123
|
-
var ToolPanelContainer =
|
|
6124
|
-
({
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6481
|
+
import React73, { useCallback as useCallback18, useEffect as useEffect14, useRef as useRef12, useState as useState19 } from "react";
|
|
6482
|
+
var ToolPanelContainer = React73.forwardRef(
|
|
6483
|
+
({
|
|
6484
|
+
topContent,
|
|
6485
|
+
bottomContent,
|
|
6486
|
+
width,
|
|
6487
|
+
onResizeStart,
|
|
6488
|
+
side = "right",
|
|
6489
|
+
className,
|
|
6490
|
+
initialTopPercent = 60,
|
|
6491
|
+
...rest
|
|
6492
|
+
}, ref) => {
|
|
6493
|
+
const [topPercent, setTopPercent] = useState19(initialTopPercent);
|
|
6494
|
+
const [isResizingHeight, setIsResizingHeight] = useState19(false);
|
|
6495
|
+
const containerRef = useRef12(null);
|
|
6496
|
+
const lastY = useRef12(null);
|
|
6129
6497
|
const hasBoth = topContent !== null && bottomContent !== null;
|
|
6130
|
-
const startHeightResize =
|
|
6498
|
+
const startHeightResize = useCallback18((e) => {
|
|
6131
6499
|
e.preventDefault();
|
|
6132
6500
|
setIsResizingHeight(true);
|
|
6133
6501
|
lastY.current = e.clientY;
|
|
6134
6502
|
}, []);
|
|
6135
|
-
const stopHeightResize =
|
|
6503
|
+
const stopHeightResize = useCallback18(() => {
|
|
6136
6504
|
setIsResizingHeight(false);
|
|
6137
6505
|
lastY.current = null;
|
|
6138
6506
|
}, []);
|
|
6139
|
-
const resizeHeight =
|
|
6507
|
+
const resizeHeight = useCallback18(
|
|
6140
6508
|
(e) => {
|
|
6141
6509
|
if (!isResizingHeight || lastY.current === null || !containerRef.current) {
|
|
6142
6510
|
return;
|
|
@@ -6155,7 +6523,7 @@ var ToolPanelContainer = React72.forwardRef(
|
|
|
6155
6523
|
},
|
|
6156
6524
|
[isResizingHeight]
|
|
6157
6525
|
);
|
|
6158
|
-
|
|
6526
|
+
useEffect14(() => {
|
|
6159
6527
|
if (isResizingHeight) {
|
|
6160
6528
|
window.addEventListener("mousemove", resizeHeight);
|
|
6161
6529
|
window.addEventListener("mouseup", stopHeightResize);
|
|
@@ -6174,7 +6542,7 @@ var ToolPanelContainer = React72.forwardRef(
|
|
|
6174
6542
|
document.body.style.userSelect = "";
|
|
6175
6543
|
};
|
|
6176
6544
|
}, [isResizingHeight, resizeHeight, stopHeightResize]);
|
|
6177
|
-
return /* @__PURE__ */
|
|
6545
|
+
return /* @__PURE__ */ React73.createElement(
|
|
6178
6546
|
"div",
|
|
6179
6547
|
{
|
|
6180
6548
|
ref: (node) => {
|
|
@@ -6193,7 +6561,7 @@ var ToolPanelContainer = React72.forwardRef(
|
|
|
6193
6561
|
style: width ? { width } : void 0,
|
|
6194
6562
|
...rest
|
|
6195
6563
|
},
|
|
6196
|
-
/* @__PURE__ */
|
|
6564
|
+
/* @__PURE__ */ React73.createElement(
|
|
6197
6565
|
"div",
|
|
6198
6566
|
{
|
|
6199
6567
|
onMouseDown: onResizeStart,
|
|
@@ -6204,7 +6572,7 @@ var ToolPanelContainer = React72.forwardRef(
|
|
|
6204
6572
|
)
|
|
6205
6573
|
}
|
|
6206
6574
|
),
|
|
6207
|
-
topContent !== null && /* @__PURE__ */
|
|
6575
|
+
topContent !== null && /* @__PURE__ */ React73.createElement(
|
|
6208
6576
|
"div",
|
|
6209
6577
|
{
|
|
6210
6578
|
className: "min-h-0 overflow-hidden flex flex-col",
|
|
@@ -6212,7 +6580,7 @@ var ToolPanelContainer = React72.forwardRef(
|
|
|
6212
6580
|
},
|
|
6213
6581
|
topContent
|
|
6214
6582
|
),
|
|
6215
|
-
hasBoth && /* @__PURE__ */
|
|
6583
|
+
hasBoth && /* @__PURE__ */ React73.createElement(
|
|
6216
6584
|
"div",
|
|
6217
6585
|
{
|
|
6218
6586
|
onMouseDown: startHeightResize,
|
|
@@ -6224,7 +6592,7 @@ var ToolPanelContainer = React72.forwardRef(
|
|
|
6224
6592
|
)
|
|
6225
6593
|
}
|
|
6226
6594
|
),
|
|
6227
|
-
bottomContent !== null && /* @__PURE__ */
|
|
6595
|
+
bottomContent !== null && /* @__PURE__ */ React73.createElement(
|
|
6228
6596
|
"div",
|
|
6229
6597
|
{
|
|
6230
6598
|
className: "min-h-0 overflow-hidden flex flex-col",
|
|
@@ -6238,26 +6606,26 @@ var ToolPanelContainer = React72.forwardRef(
|
|
|
6238
6606
|
ToolPanelContainer.displayName = "ToolPanelContainer";
|
|
6239
6607
|
|
|
6240
6608
|
// src/components/chat/hooks/useResizable.ts
|
|
6241
|
-
import { useCallback as
|
|
6609
|
+
import { useCallback as useCallback19, useEffect as useEffect15, useRef as useRef13, useState as useState20 } from "react";
|
|
6242
6610
|
function useResizable({
|
|
6243
6611
|
initialWidthPercent,
|
|
6244
6612
|
minWidthPercent,
|
|
6245
6613
|
maxWidthPercent,
|
|
6246
6614
|
direction
|
|
6247
6615
|
}) {
|
|
6248
|
-
const [widthPercent, setWidthPercent] =
|
|
6249
|
-
const [isResizing, setIsResizing] =
|
|
6250
|
-
const lastX =
|
|
6251
|
-
const startResizing =
|
|
6616
|
+
const [widthPercent, setWidthPercent] = useState20(initialWidthPercent);
|
|
6617
|
+
const [isResizing, setIsResizing] = useState20(false);
|
|
6618
|
+
const lastX = useRef13(null);
|
|
6619
|
+
const startResizing = useCallback19((e) => {
|
|
6252
6620
|
e.preventDefault();
|
|
6253
6621
|
setIsResizing(true);
|
|
6254
6622
|
lastX.current = e.clientX;
|
|
6255
6623
|
}, []);
|
|
6256
|
-
const stopResizing =
|
|
6624
|
+
const stopResizing = useCallback19(() => {
|
|
6257
6625
|
setIsResizing(false);
|
|
6258
6626
|
lastX.current = null;
|
|
6259
6627
|
}, []);
|
|
6260
|
-
const resize =
|
|
6628
|
+
const resize = useCallback19(
|
|
6261
6629
|
(e) => {
|
|
6262
6630
|
if (!isResizing || lastX.current === null) {
|
|
6263
6631
|
return;
|
|
@@ -6273,7 +6641,7 @@ function useResizable({
|
|
|
6273
6641
|
},
|
|
6274
6642
|
[isResizing, direction, minWidthPercent, maxWidthPercent]
|
|
6275
6643
|
);
|
|
6276
|
-
|
|
6644
|
+
useEffect15(() => {
|
|
6277
6645
|
if (isResizing) {
|
|
6278
6646
|
window.addEventListener("mousemove", resize);
|
|
6279
6647
|
window.addEventListener("mouseup", stopResizing);
|
|
@@ -6297,7 +6665,7 @@ function useResizable({
|
|
|
6297
6665
|
}
|
|
6298
6666
|
|
|
6299
6667
|
// src/components/chat/ChatInterface.tsx
|
|
6300
|
-
var ChatInterface =
|
|
6668
|
+
var ChatInterface = React74.forwardRef(
|
|
6301
6669
|
({
|
|
6302
6670
|
messages = [],
|
|
6303
6671
|
conversationTree,
|
|
@@ -6309,6 +6677,7 @@ var ChatInterface = React73.forwardRef(
|
|
|
6309
6677
|
onStop,
|
|
6310
6678
|
onSelectConversation,
|
|
6311
6679
|
onNewChat,
|
|
6680
|
+
onRenameConversation,
|
|
6312
6681
|
isStreaming = false,
|
|
6313
6682
|
isThinking = false,
|
|
6314
6683
|
placeholder = "Send a message...",
|
|
@@ -6324,21 +6693,24 @@ var ChatInterface = React73.forwardRef(
|
|
|
6324
6693
|
tasks = [],
|
|
6325
6694
|
tasksTitle,
|
|
6326
6695
|
onStopAllTasks,
|
|
6696
|
+
inputNotice,
|
|
6697
|
+
onInputChange,
|
|
6327
6698
|
tools: externalTools = [],
|
|
6699
|
+
autoFocus = true,
|
|
6328
6700
|
className,
|
|
6329
6701
|
...rest
|
|
6330
6702
|
}, ref) => {
|
|
6331
|
-
const prevArtifactNodesRef =
|
|
6332
|
-
const prevTasksRef =
|
|
6333
|
-
const [internalTools, setInternalTools] =
|
|
6703
|
+
const prevArtifactNodesRef = useRef14([]);
|
|
6704
|
+
const prevTasksRef = useRef14([]);
|
|
6705
|
+
const [internalTools, setInternalTools] = useState21({
|
|
6334
6706
|
"top-left": "history",
|
|
6335
6707
|
"bottom-left": null,
|
|
6336
6708
|
"top-right": null,
|
|
6337
6709
|
"bottom-right": null
|
|
6338
6710
|
});
|
|
6339
|
-
const dismissedToolsRef =
|
|
6711
|
+
const dismissedToolsRef = useRef14(/* @__PURE__ */ new Set());
|
|
6340
6712
|
const isPanelControlled = isArtifactsPanelOpen !== void 0;
|
|
6341
|
-
const activeTools =
|
|
6713
|
+
const activeTools = useMemo5(() => {
|
|
6342
6714
|
if (isPanelControlled) {
|
|
6343
6715
|
return {
|
|
6344
6716
|
...internalTools,
|
|
@@ -6353,9 +6725,9 @@ var ChatInterface = React73.forwardRef(
|
|
|
6353
6725
|
width: rightToolsWidth,
|
|
6354
6726
|
startResizing: startResizingRightTools
|
|
6355
6727
|
} = useResizable({
|
|
6356
|
-
initialWidthPercent:
|
|
6357
|
-
minWidthPercent:
|
|
6358
|
-
maxWidthPercent:
|
|
6728
|
+
initialWidthPercent: 40,
|
|
6729
|
+
minWidthPercent: 30,
|
|
6730
|
+
maxWidthPercent: 80,
|
|
6359
6731
|
direction: "left"
|
|
6360
6732
|
});
|
|
6361
6733
|
const {
|
|
@@ -6368,13 +6740,13 @@ var ChatInterface = React73.forwardRef(
|
|
|
6368
6740
|
direction: "right"
|
|
6369
6741
|
});
|
|
6370
6742
|
const allSettled = tasks.length === 0 || areAllTasksSettled(tasks);
|
|
6371
|
-
const allToolDefinitions =
|
|
6743
|
+
const allToolDefinitions = useMemo5(() => {
|
|
6372
6744
|
const builtIn = [
|
|
6373
|
-
{ id: "history", icon: /* @__PURE__ */
|
|
6374
|
-
{ id: "artifacts", icon: /* @__PURE__ */
|
|
6745
|
+
{ id: "history", icon: /* @__PURE__ */ React74.createElement(ChatBubbleIcon, null), label: "History", group: "top-left" },
|
|
6746
|
+
{ id: "artifacts", icon: /* @__PURE__ */ React74.createElement(MediaIcon, null), label: "Artifacts", group: "top-right" },
|
|
6375
6747
|
{
|
|
6376
6748
|
id: "todos",
|
|
6377
|
-
icon: allSettled ? /* @__PURE__ */
|
|
6749
|
+
icon: allSettled ? /* @__PURE__ */ React74.createElement(CheckSquareIcon, null) : /* @__PURE__ */ React74.createElement(SquareLoaderIcon, null),
|
|
6378
6750
|
label: "Tasks",
|
|
6379
6751
|
group: "bottom-right"
|
|
6380
6752
|
}
|
|
@@ -6382,7 +6754,7 @@ var ChatInterface = React73.forwardRef(
|
|
|
6382
6754
|
const external = externalTools.map(({ content: _content, ...def }) => def);
|
|
6383
6755
|
return [...builtIn, ...external];
|
|
6384
6756
|
}, [allSettled, externalTools]);
|
|
6385
|
-
const toggleTool =
|
|
6757
|
+
const toggleTool = useCallback20((toolId) => {
|
|
6386
6758
|
const toolDef = allToolDefinitions.find((t) => t.id === toolId);
|
|
6387
6759
|
if (!toolDef) {
|
|
6388
6760
|
return;
|
|
@@ -6412,7 +6784,7 @@ var ChatInterface = React73.forwardRef(
|
|
|
6412
6784
|
});
|
|
6413
6785
|
}, [allToolDefinitions, isPanelControlled, activeTools, onArtifactsPanelOpenChange]);
|
|
6414
6786
|
const isTreeMode = !!conversationTree;
|
|
6415
|
-
const effectiveMessages =
|
|
6787
|
+
const effectiveMessages = useMemo5(() => {
|
|
6416
6788
|
if (isTreeMode && conversationTree) {
|
|
6417
6789
|
const pathNodes = getActivePathMessages(conversationTree);
|
|
6418
6790
|
return pathNodes.map((node) => ({
|
|
@@ -6424,7 +6796,7 @@ var ChatInterface = React73.forwardRef(
|
|
|
6424
6796
|
}
|
|
6425
6797
|
return messages;
|
|
6426
6798
|
}, [isTreeMode, conversationTree, messages]);
|
|
6427
|
-
const latestUserMessageIndex =
|
|
6799
|
+
const latestUserMessageIndex = useMemo5(() => {
|
|
6428
6800
|
for (let i = effectiveMessages.length - 1; i >= 0; i--) {
|
|
6429
6801
|
if (effectiveMessages[i].variant === "user") {
|
|
6430
6802
|
return i;
|
|
@@ -6432,7 +6804,7 @@ var ChatInterface = React73.forwardRef(
|
|
|
6432
6804
|
}
|
|
6433
6805
|
return -1;
|
|
6434
6806
|
}, [effectiveMessages]);
|
|
6435
|
-
|
|
6807
|
+
useEffect16(() => {
|
|
6436
6808
|
const nodes = artifactNodes || [];
|
|
6437
6809
|
const prevNodes = prevArtifactNodesRef.current;
|
|
6438
6810
|
const hasNewOrChangedNode = nodes.length !== prevNodes.length || nodes.some((n, i) => n.id !== prevNodes[i]?.id);
|
|
@@ -6448,10 +6820,7 @@ var ChatInterface = React73.forwardRef(
|
|
|
6448
6820
|
if (c.status !== p.status || c.label !== p.label) {
|
|
6449
6821
|
return true;
|
|
6450
6822
|
}
|
|
6451
|
-
|
|
6452
|
-
return true;
|
|
6453
|
-
}
|
|
6454
|
-
return false;
|
|
6823
|
+
return !!(c.subtasks && hasNewOrUpdatedTask(c.subtasks, p?.subtasks || []));
|
|
6455
6824
|
});
|
|
6456
6825
|
};
|
|
6457
6826
|
if (hasNewOrUpdatedTask(tasks, prevTasksRef.current) && !dismissedToolsRef.current.has("todos")) {
|
|
@@ -6460,7 +6829,7 @@ var ChatInterface = React73.forwardRef(
|
|
|
6460
6829
|
prevArtifactNodesRef.current = nodes;
|
|
6461
6830
|
prevTasksRef.current = tasks;
|
|
6462
6831
|
}, [artifactNodes, tasks, isPanelControlled]);
|
|
6463
|
-
const handleBranchSwitch =
|
|
6832
|
+
const handleBranchSwitch = useCallback20(
|
|
6464
6833
|
(nodeId, direction) => {
|
|
6465
6834
|
if (!isTreeMode || !conversationTree || !onTreeChange) {
|
|
6466
6835
|
return;
|
|
@@ -6470,7 +6839,7 @@ var ChatInterface = React73.forwardRef(
|
|
|
6470
6839
|
},
|
|
6471
6840
|
[isTreeMode, conversationTree, onTreeChange]
|
|
6472
6841
|
);
|
|
6473
|
-
const displayMessages =
|
|
6842
|
+
const displayMessages = useMemo5(() => {
|
|
6474
6843
|
return effectiveMessages.map((msg) => {
|
|
6475
6844
|
let branchInfo = void 0;
|
|
6476
6845
|
if (isTreeMode && conversationTree) {
|
|
@@ -6500,18 +6869,18 @@ var ChatInterface = React73.forwardRef(
|
|
|
6500
6869
|
onRetryMessage,
|
|
6501
6870
|
handleBranchSwitch
|
|
6502
6871
|
]);
|
|
6503
|
-
const handleSubmit =
|
|
6872
|
+
const handleSubmit = useCallback20(
|
|
6504
6873
|
(message, attachments) => {
|
|
6505
6874
|
onMessageSubmit?.(message, attachments);
|
|
6506
6875
|
},
|
|
6507
6876
|
[onMessageSubmit]
|
|
6508
6877
|
);
|
|
6509
6878
|
const isEmpty = effectiveMessages.length === 0;
|
|
6510
|
-
const leftToolDefs =
|
|
6879
|
+
const leftToolDefs = useMemo5(
|
|
6511
6880
|
() => allToolDefinitions.filter((t) => t.group === "top-left" || t.group === "bottom-left"),
|
|
6512
6881
|
[allToolDefinitions]
|
|
6513
6882
|
);
|
|
6514
|
-
const rightToolDefs =
|
|
6883
|
+
const rightToolDefs = useMemo5(
|
|
6515
6884
|
() => allToolDefinitions.filter(
|
|
6516
6885
|
(t) => t.group === "top-right" || t.group === "bottom-right"
|
|
6517
6886
|
),
|
|
@@ -6525,58 +6894,17 @@ var ChatInterface = React73.forwardRef(
|
|
|
6525
6894
|
}
|
|
6526
6895
|
switch (toolId) {
|
|
6527
6896
|
case "history":
|
|
6528
|
-
return /* @__PURE__ */
|
|
6529
|
-
|
|
6530
|
-
{
|
|
6531
|
-
className: "flex items-center justify-between p-4 border-b border-ash/40 shrink-0"
|
|
6532
|
-
},
|
|
6533
|
-
/* @__PURE__ */ React73.createElement("h3", { className: "text-xs font-medium text-white" }, "History"),
|
|
6534
|
-
onNewChat && /* @__PURE__ */ React73.createElement(
|
|
6535
|
-
"button",
|
|
6536
|
-
{
|
|
6537
|
-
onClick: onNewChat,
|
|
6538
|
-
className: cx(
|
|
6539
|
-
"flex px-3 py-1.5",
|
|
6540
|
-
"bg-gold/10 hover:bg-gold/20 text-gold",
|
|
6541
|
-
"border border-gold/30",
|
|
6542
|
-
"text-xs font-medium",
|
|
6543
|
-
"transition-colors duration-200"
|
|
6544
|
-
)
|
|
6545
|
-
},
|
|
6546
|
-
/* @__PURE__ */ React73.createElement(
|
|
6547
|
-
"svg",
|
|
6548
|
-
{
|
|
6549
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
6550
|
-
viewBox: "0 0 20 20",
|
|
6551
|
-
fill: "currentColor",
|
|
6552
|
-
className: "w-4 h-4"
|
|
6553
|
-
},
|
|
6554
|
-
/* @__PURE__ */ React73.createElement(
|
|
6555
|
-
"path",
|
|
6556
|
-
{
|
|
6557
|
-
d: "M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z"
|
|
6558
|
-
}
|
|
6559
|
-
)
|
|
6560
|
-
),
|
|
6561
|
-
"New Chat"
|
|
6562
|
-
)
|
|
6563
|
-
), /* @__PURE__ */ React73.createElement("div", { className: "flex-1 overflow-y-auto py-2" }, conversations.length === 0 ? /* @__PURE__ */ React73.createElement("p", { className: "px-4 py-2 text-xs text-silver/60" }, "No conversations yet") : /* @__PURE__ */ React73.createElement("div", { className: "space-y-1 px-2" }, conversations.map((conversation) => /* @__PURE__ */ React73.createElement(
|
|
6564
|
-
"button",
|
|
6897
|
+
return /* @__PURE__ */ React74.createElement(
|
|
6898
|
+
HistoryPanel,
|
|
6565
6899
|
{
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
)
|
|
6573
|
-
},
|
|
6574
|
-
/* @__PURE__ */ React73.createElement("p", { className: "text-sm font-medium truncate" }, conversation.title),
|
|
6575
|
-
conversation.preview && /* @__PURE__ */ React73.createElement("p", { className: "text-xs text-silver/60 truncate mt-0.5" }, conversation.preview),
|
|
6576
|
-
conversation.timestamp && /* @__PURE__ */ React73.createElement("p", { className: "text-xs text-silver/40 mt-1" }, conversation.timestamp)
|
|
6577
|
-
)))));
|
|
6900
|
+
conversations,
|
|
6901
|
+
onSelectConversation,
|
|
6902
|
+
onNewChat,
|
|
6903
|
+
onRenameConversation
|
|
6904
|
+
}
|
|
6905
|
+
);
|
|
6578
6906
|
case "artifacts":
|
|
6579
|
-
return /* @__PURE__ */
|
|
6907
|
+
return /* @__PURE__ */ React74.createElement(
|
|
6580
6908
|
ArtifactsPanel,
|
|
6581
6909
|
{
|
|
6582
6910
|
nodes: artifactNodes,
|
|
@@ -6584,21 +6912,29 @@ var ChatInterface = React73.forwardRef(
|
|
|
6584
6912
|
}
|
|
6585
6913
|
);
|
|
6586
6914
|
case "todos":
|
|
6587
|
-
return tasks.length > 0 ? /* @__PURE__ */
|
|
6915
|
+
return tasks.length > 0 ? /* @__PURE__ */ React74.createElement(
|
|
6916
|
+
TodosList,
|
|
6917
|
+
{
|
|
6918
|
+
tasks,
|
|
6919
|
+
title: tasksTitle,
|
|
6920
|
+
onStopAllTasks,
|
|
6921
|
+
className: "h-full"
|
|
6922
|
+
}
|
|
6923
|
+
) : /* @__PURE__ */ React74.createElement("div", { className: "h-full flex flex-col" }, /* @__PURE__ */ React74.createElement("div", { className: "flex items-center p-4 border-b border-ash/40 shrink-0" }, /* @__PURE__ */ React74.createElement("h3", { className: "text-xs font-medium text-white" }, "Tasks")), /* @__PURE__ */ React74.createElement("div", { className: "flex-1 flex items-center justify-center" }, /* @__PURE__ */ React74.createElement("p", { className: "text-xs text-silver/60" }, "No tasks")));
|
|
6588
6924
|
default: {
|
|
6589
6925
|
const externalTool = externalTools.find((t) => t.id === toolId);
|
|
6590
6926
|
return externalTool?.content ?? null;
|
|
6591
6927
|
}
|
|
6592
6928
|
}
|
|
6593
6929
|
};
|
|
6594
|
-
return /* @__PURE__ */
|
|
6930
|
+
return /* @__PURE__ */ React74.createElement(
|
|
6595
6931
|
"div",
|
|
6596
6932
|
{
|
|
6597
6933
|
ref,
|
|
6598
6934
|
className: cx("flex h-full w-full bg-obsidian overflow-hidden", className),
|
|
6599
6935
|
...rest
|
|
6600
6936
|
},
|
|
6601
|
-
hasLeftTools && /* @__PURE__ */
|
|
6937
|
+
hasLeftTools && /* @__PURE__ */ React74.createElement(
|
|
6602
6938
|
ToolSidebar,
|
|
6603
6939
|
{
|
|
6604
6940
|
tools: leftToolDefs,
|
|
@@ -6607,26 +6943,27 @@ var ChatInterface = React73.forwardRef(
|
|
|
6607
6943
|
side: "left"
|
|
6608
6944
|
}
|
|
6609
6945
|
),
|
|
6610
|
-
isLeftPanelOpen && /* @__PURE__ */
|
|
6946
|
+
isLeftPanelOpen && /* @__PURE__ */ React74.createElement(
|
|
6611
6947
|
ToolPanelContainer,
|
|
6612
6948
|
{
|
|
6613
6949
|
topContent: renderToolContent(activeTools["top-left"]),
|
|
6614
6950
|
bottomContent: renderToolContent(activeTools["bottom-left"]),
|
|
6615
6951
|
width: leftToolsWidth,
|
|
6616
6952
|
onResizeStart: startResizingLeftTools,
|
|
6617
|
-
side: "left"
|
|
6953
|
+
side: "left",
|
|
6954
|
+
initialTopPercent: 30
|
|
6618
6955
|
}
|
|
6619
6956
|
),
|
|
6620
|
-
/* @__PURE__ */
|
|
6957
|
+
/* @__PURE__ */ React74.createElement("div", { className: "flex-1 flex flex-col min-w-0 relative" }, /* @__PURE__ */ React74.createElement("div", { className: cx(
|
|
6621
6958
|
"flex-1 flex flex-col min-h-0 relative",
|
|
6622
6959
|
isEmpty ? "justify-center" : "justify-start"
|
|
6623
|
-
) }, /* @__PURE__ */
|
|
6960
|
+
) }, /* @__PURE__ */ React74.createElement("div", { className: cx(
|
|
6624
6961
|
"transition-all duration-500 ease-in-out",
|
|
6625
6962
|
isEmpty ? "flex-1" : "flex-zero"
|
|
6626
|
-
) }), /* @__PURE__ */
|
|
6963
|
+
) }), /* @__PURE__ */ React74.createElement("div", { className: cx(
|
|
6627
6964
|
"transition-all duration-500 ease-in-out overflow-hidden flex flex-col",
|
|
6628
6965
|
isEmpty ? "flex-zero opacity-0" : "flex-1 opacity-100"
|
|
6629
|
-
) }, /* @__PURE__ */
|
|
6966
|
+
) }, /* @__PURE__ */ React74.createElement(
|
|
6630
6967
|
ChatView,
|
|
6631
6968
|
{
|
|
6632
6969
|
messages: displayMessages,
|
|
@@ -6635,10 +6972,10 @@ var ChatInterface = React73.forwardRef(
|
|
|
6635
6972
|
isThinking,
|
|
6636
6973
|
className: "flex-1"
|
|
6637
6974
|
}
|
|
6638
|
-
)), /* @__PURE__ */
|
|
6975
|
+
)), /* @__PURE__ */ React74.createElement("div", { className: cx(
|
|
6639
6976
|
"transition-all duration-500 ease-in-out z-10 w-full flex flex-col items-center",
|
|
6640
6977
|
isEmpty ? "p-4" : "shrink-0 p-4 border-t border-ash/40 bg-obsidian"
|
|
6641
|
-
) }, isEmpty && /* @__PURE__ */
|
|
6978
|
+
) }, isEmpty && /* @__PURE__ */ React74.createElement("div", { className: "mb-8 text-center animate-fade-in duration-500" }, emptyState ? emptyState : /* @__PURE__ */ React74.createElement("h1", { className: "text-4xl md:text-5xl font-heading text-gold mb-2 tracking-tight" }, "Welcome!")), /* @__PURE__ */ React74.createElement(
|
|
6642
6979
|
ChatInput,
|
|
6643
6980
|
{
|
|
6644
6981
|
position: isEmpty ? "centered" : "bottom",
|
|
@@ -6650,23 +6987,27 @@ var ChatInterface = React73.forwardRef(
|
|
|
6650
6987
|
onStop,
|
|
6651
6988
|
showAttachmentButton,
|
|
6652
6989
|
attachments: propsAttachments,
|
|
6653
|
-
onAttachmentsChange
|
|
6990
|
+
onAttachmentsChange,
|
|
6991
|
+
notice: inputNotice,
|
|
6992
|
+
onInputChange,
|
|
6993
|
+
autoFocus
|
|
6654
6994
|
}
|
|
6655
|
-
)), /* @__PURE__ */
|
|
6995
|
+
)), /* @__PURE__ */ React74.createElement("div", { className: cx(
|
|
6656
6996
|
"transition-all duration-500 ease-in-out",
|
|
6657
6997
|
isEmpty ? "flex-1" : "flex-zero"
|
|
6658
6998
|
) }))),
|
|
6659
|
-
isRightPanelOpen && /* @__PURE__ */
|
|
6999
|
+
isRightPanelOpen && /* @__PURE__ */ React74.createElement(
|
|
6660
7000
|
ToolPanelContainer,
|
|
6661
7001
|
{
|
|
6662
7002
|
topContent: renderToolContent(activeTools["top-right"]),
|
|
6663
7003
|
bottomContent: renderToolContent(activeTools["bottom-right"]),
|
|
6664
7004
|
width: rightToolsWidth,
|
|
6665
7005
|
onResizeStart: startResizingRightTools,
|
|
6666
|
-
side: "right"
|
|
7006
|
+
side: "right",
|
|
7007
|
+
initialTopPercent: 70
|
|
6667
7008
|
}
|
|
6668
7009
|
),
|
|
6669
|
-
hasRightTools && /* @__PURE__ */
|
|
7010
|
+
hasRightTools && /* @__PURE__ */ React74.createElement(
|
|
6670
7011
|
ToolSidebar,
|
|
6671
7012
|
{
|
|
6672
7013
|
tools: rightToolDefs,
|
|
@@ -6681,9 +7022,9 @@ var ChatInterface = React73.forwardRef(
|
|
|
6681
7022
|
ChatInterface.displayName = "ChatInterface";
|
|
6682
7023
|
|
|
6683
7024
|
// src/components/chat/MessageActions.tsx
|
|
6684
|
-
import
|
|
6685
|
-
import { Check as Check3, Copy, Pencil, RotateCcw, Send as Send2, X as
|
|
6686
|
-
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */
|
|
7025
|
+
import React75, { useCallback as useCallback21, useState as useState22 } from "react";
|
|
7026
|
+
import { Check as Check3, Copy, Pencil, RotateCcw, Send as Send2, X as X6 } from "lucide-react";
|
|
7027
|
+
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */ React75.createElement(
|
|
6687
7028
|
"button",
|
|
6688
7029
|
{
|
|
6689
7030
|
type: "button",
|
|
@@ -6699,7 +7040,7 @@ var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @_
|
|
|
6699
7040
|
},
|
|
6700
7041
|
children
|
|
6701
7042
|
);
|
|
6702
|
-
var MessageActions =
|
|
7043
|
+
var MessageActions = React75.forwardRef(
|
|
6703
7044
|
({
|
|
6704
7045
|
variant,
|
|
6705
7046
|
content,
|
|
@@ -6711,12 +7052,12 @@ var MessageActions = React74.forwardRef(
|
|
|
6711
7052
|
className,
|
|
6712
7053
|
...rest
|
|
6713
7054
|
}, ref) => {
|
|
6714
|
-
const [localIsEditing, setLocalIsEditing] =
|
|
6715
|
-
const [localEditValue, setLocalEditValue] =
|
|
6716
|
-
const [copied, setCopied] =
|
|
7055
|
+
const [localIsEditing, setLocalIsEditing] = useState22(false);
|
|
7056
|
+
const [localEditValue, setLocalEditValue] = useState22(content);
|
|
7057
|
+
const [copied, setCopied] = useState22(false);
|
|
6717
7058
|
const isEditing = controlledIsEditing ?? localIsEditing;
|
|
6718
7059
|
const editValue = controlledEditValue ?? localEditValue;
|
|
6719
|
-
const setIsEditing =
|
|
7060
|
+
const setIsEditing = useCallback21(
|
|
6720
7061
|
(value) => {
|
|
6721
7062
|
if (onEditingChange) {
|
|
6722
7063
|
onEditingChange(value);
|
|
@@ -6726,10 +7067,10 @@ var MessageActions = React74.forwardRef(
|
|
|
6726
7067
|
},
|
|
6727
7068
|
[onEditingChange]
|
|
6728
7069
|
);
|
|
6729
|
-
const setEditValue =
|
|
7070
|
+
const setEditValue = useCallback21((value) => {
|
|
6730
7071
|
setLocalEditValue(value);
|
|
6731
7072
|
}, []);
|
|
6732
|
-
const handleCopy =
|
|
7073
|
+
const handleCopy = useCallback21(async () => {
|
|
6733
7074
|
try {
|
|
6734
7075
|
await navigator.clipboard.writeText(content);
|
|
6735
7076
|
setCopied(true);
|
|
@@ -6745,22 +7086,22 @@ var MessageActions = React74.forwardRef(
|
|
|
6745
7086
|
setTimeout(() => setCopied(false), 2e3);
|
|
6746
7087
|
}
|
|
6747
7088
|
}, [content]);
|
|
6748
|
-
const handleStartEdit =
|
|
7089
|
+
const handleStartEdit = useCallback21(() => {
|
|
6749
7090
|
setLocalEditValue(content);
|
|
6750
7091
|
setIsEditing(true);
|
|
6751
7092
|
}, [content, setIsEditing]);
|
|
6752
|
-
const handleCancelEdit =
|
|
7093
|
+
const handleCancelEdit = useCallback21(() => {
|
|
6753
7094
|
setIsEditing(false);
|
|
6754
7095
|
setLocalEditValue(content);
|
|
6755
7096
|
}, [content, setIsEditing]);
|
|
6756
|
-
const handleSubmitEdit =
|
|
7097
|
+
const handleSubmitEdit = useCallback21(() => {
|
|
6757
7098
|
const trimmed = editValue.trim();
|
|
6758
7099
|
if (trimmed && trimmed !== content) {
|
|
6759
7100
|
onEdit?.(trimmed);
|
|
6760
7101
|
}
|
|
6761
7102
|
setIsEditing(false);
|
|
6762
7103
|
}, [editValue, content, onEdit, setIsEditing]);
|
|
6763
|
-
const handleEditKeyDown =
|
|
7104
|
+
const handleEditKeyDown = useCallback21(
|
|
6764
7105
|
(e) => {
|
|
6765
7106
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
6766
7107
|
e.preventDefault();
|
|
@@ -6773,19 +7114,19 @@ var MessageActions = React74.forwardRef(
|
|
|
6773
7114
|
);
|
|
6774
7115
|
const isUser = variant === "user";
|
|
6775
7116
|
if (isUser && isEditing) {
|
|
6776
|
-
return /* @__PURE__ */
|
|
7117
|
+
return /* @__PURE__ */ React75.createElement(
|
|
6777
7118
|
"div",
|
|
6778
7119
|
{
|
|
6779
7120
|
ref,
|
|
6780
7121
|
className: cx("mt-2", className),
|
|
6781
7122
|
...rest
|
|
6782
7123
|
},
|
|
6783
|
-
/* @__PURE__ */
|
|
7124
|
+
/* @__PURE__ */ React75.createElement(
|
|
6784
7125
|
"div",
|
|
6785
7126
|
{
|
|
6786
7127
|
className: "relative bg-charcoal border border-ash/60 focus-within:border-gold/60 focus-within:ring-1 focus-within:ring-gold/20"
|
|
6787
7128
|
},
|
|
6788
|
-
/* @__PURE__ */
|
|
7129
|
+
/* @__PURE__ */ React75.createElement(
|
|
6789
7130
|
"textarea",
|
|
6790
7131
|
{
|
|
6791
7132
|
value: editValue,
|
|
@@ -6796,15 +7137,15 @@ var MessageActions = React74.forwardRef(
|
|
|
6796
7137
|
rows: 2
|
|
6797
7138
|
}
|
|
6798
7139
|
),
|
|
6799
|
-
/* @__PURE__ */
|
|
7140
|
+
/* @__PURE__ */ React75.createElement("div", { className: "absolute right-2 bottom-2 flex gap-1" }, /* @__PURE__ */ React75.createElement(
|
|
6800
7141
|
ActionButton2,
|
|
6801
7142
|
{
|
|
6802
7143
|
onClick: handleCancelEdit,
|
|
6803
7144
|
label: "Cancel edit",
|
|
6804
7145
|
className: "text-silver/60 hover:text-error"
|
|
6805
7146
|
},
|
|
6806
|
-
/* @__PURE__ */
|
|
6807
|
-
), /* @__PURE__ */
|
|
7147
|
+
/* @__PURE__ */ React75.createElement(X6, { className: "w-4 h-4" })
|
|
7148
|
+
), /* @__PURE__ */ React75.createElement(
|
|
6808
7149
|
ActionButton2,
|
|
6809
7150
|
{
|
|
6810
7151
|
onClick: handleSubmitEdit,
|
|
@@ -6812,13 +7153,13 @@ var MessageActions = React74.forwardRef(
|
|
|
6812
7153
|
className: "text-silver/60 hover:text-gold",
|
|
6813
7154
|
disabled: !editValue.trim() || editValue.trim() === content
|
|
6814
7155
|
},
|
|
6815
|
-
/* @__PURE__ */
|
|
7156
|
+
/* @__PURE__ */ React75.createElement(Send2, { className: "w-4 h-4" })
|
|
6816
7157
|
))
|
|
6817
7158
|
),
|
|
6818
|
-
/* @__PURE__ */
|
|
7159
|
+
/* @__PURE__ */ React75.createElement("p", { className: "text-xs text-silver/50 mt-1" }, "Press Enter to submit, Esc to cancel. This will create a new branch.")
|
|
6819
7160
|
);
|
|
6820
7161
|
}
|
|
6821
|
-
return /* @__PURE__ */
|
|
7162
|
+
return /* @__PURE__ */ React75.createElement(
|
|
6822
7163
|
"div",
|
|
6823
7164
|
{
|
|
6824
7165
|
ref,
|
|
@@ -6829,18 +7170,18 @@ var MessageActions = React74.forwardRef(
|
|
|
6829
7170
|
),
|
|
6830
7171
|
...rest
|
|
6831
7172
|
},
|
|
6832
|
-
/* @__PURE__ */
|
|
6833
|
-
isUser && onEdit && /* @__PURE__ */
|
|
6834
|
-
!isUser && onRetry && /* @__PURE__ */
|
|
7173
|
+
/* @__PURE__ */ React75.createElement(ActionButton2, { onClick: handleCopy, label: copied ? "Copied!" : "Copy message" }, copied ? /* @__PURE__ */ React75.createElement(Check3, { className: "w-3.5 h-3.5 text-success" }) : /* @__PURE__ */ React75.createElement(Copy, { className: "w-3.5 h-3.5" })),
|
|
7174
|
+
isUser && onEdit && /* @__PURE__ */ React75.createElement(ActionButton2, { onClick: handleStartEdit, label: "Edit message" }, /* @__PURE__ */ React75.createElement(Pencil, { className: "w-3.5 h-3.5" })),
|
|
7175
|
+
!isUser && onRetry && /* @__PURE__ */ React75.createElement(ActionButton2, { onClick: onRetry, label: "Regenerate response" }, /* @__PURE__ */ React75.createElement(RotateCcw, { className: "w-3.5 h-3.5" }))
|
|
6835
7176
|
);
|
|
6836
7177
|
}
|
|
6837
7178
|
);
|
|
6838
7179
|
MessageActions.displayName = "MessageActions";
|
|
6839
7180
|
|
|
6840
7181
|
// src/components/chat/BranchNavigator.tsx
|
|
6841
|
-
import
|
|
7182
|
+
import React76 from "react";
|
|
6842
7183
|
import { ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight3, GitBranch } from "lucide-react";
|
|
6843
|
-
var BranchNavigator =
|
|
7184
|
+
var BranchNavigator = React76.forwardRef(
|
|
6844
7185
|
({
|
|
6845
7186
|
current,
|
|
6846
7187
|
total,
|
|
@@ -6859,7 +7200,7 @@ var BranchNavigator = React75.forwardRef(
|
|
|
6859
7200
|
const buttonSize = size === "sm" ? "p-0.5" : "p-1";
|
|
6860
7201
|
const iconSize = size === "sm" ? "w-3 h-3" : "w-4 h-4";
|
|
6861
7202
|
const textSize = size === "sm" ? "text-xs" : "text-sm";
|
|
6862
|
-
return /* @__PURE__ */
|
|
7203
|
+
return /* @__PURE__ */ React76.createElement(
|
|
6863
7204
|
"div",
|
|
6864
7205
|
{
|
|
6865
7206
|
ref,
|
|
@@ -6871,8 +7212,8 @@ var BranchNavigator = React75.forwardRef(
|
|
|
6871
7212
|
"aria-label": "Branch navigation",
|
|
6872
7213
|
...rest
|
|
6873
7214
|
},
|
|
6874
|
-
showIcon && /* @__PURE__ */
|
|
6875
|
-
/* @__PURE__ */
|
|
7215
|
+
showIcon && /* @__PURE__ */ React76.createElement(GitBranch, { className: cx(iconSize, "mr-0.5 text-silver/50"), "aria-hidden": "true" }),
|
|
7216
|
+
/* @__PURE__ */ React76.createElement(
|
|
6876
7217
|
"button",
|
|
6877
7218
|
{
|
|
6878
7219
|
type: "button",
|
|
@@ -6885,10 +7226,10 @@ var BranchNavigator = React75.forwardRef(
|
|
|
6885
7226
|
),
|
|
6886
7227
|
"aria-label": "Previous branch"
|
|
6887
7228
|
},
|
|
6888
|
-
/* @__PURE__ */
|
|
7229
|
+
/* @__PURE__ */ React76.createElement(ChevronLeft2, { className: iconSize })
|
|
6889
7230
|
),
|
|
6890
|
-
/* @__PURE__ */
|
|
6891
|
-
/* @__PURE__ */
|
|
7231
|
+
/* @__PURE__ */ React76.createElement("span", { className: cx(textSize, "tabular-nums min-w-6 text-center") }, current, "/", total),
|
|
7232
|
+
/* @__PURE__ */ React76.createElement(
|
|
6892
7233
|
"button",
|
|
6893
7234
|
{
|
|
6894
7235
|
type: "button",
|
|
@@ -6901,7 +7242,7 @@ var BranchNavigator = React75.forwardRef(
|
|
|
6901
7242
|
),
|
|
6902
7243
|
"aria-label": "Next branch"
|
|
6903
7244
|
},
|
|
6904
|
-
/* @__PURE__ */
|
|
7245
|
+
/* @__PURE__ */ React76.createElement(ChevronRight3, { className: iconSize })
|
|
6905
7246
|
)
|
|
6906
7247
|
);
|
|
6907
7248
|
}
|
|
@@ -6909,16 +7250,16 @@ var BranchNavigator = React75.forwardRef(
|
|
|
6909
7250
|
BranchNavigator.displayName = "BranchNavigator";
|
|
6910
7251
|
|
|
6911
7252
|
// src/components/BrandIcon.tsx
|
|
6912
|
-
import
|
|
7253
|
+
import React77 from "react";
|
|
6913
7254
|
var sizeMap2 = {
|
|
6914
7255
|
sm: "h-8 w-8 text-sm",
|
|
6915
7256
|
md: "h-12 w-12 text-base",
|
|
6916
7257
|
lg: "h-16 w-16 text-lg"
|
|
6917
7258
|
};
|
|
6918
|
-
var BrandIcon =
|
|
7259
|
+
var BrandIcon = React77.forwardRef(
|
|
6919
7260
|
({ size = "md", variant = "solid", children, className, ...rest }, ref) => {
|
|
6920
7261
|
const variantClasses = variant === "solid" ? "bg-gold text-obsidian border-2 border-gold" : "bg-transparent text-gold border-2 border-gold";
|
|
6921
|
-
return /* @__PURE__ */
|
|
7262
|
+
return /* @__PURE__ */ React77.createElement(
|
|
6922
7263
|
"div",
|
|
6923
7264
|
{
|
|
6924
7265
|
ref,
|
|
@@ -6937,17 +7278,17 @@ var BrandIcon = React76.forwardRef(
|
|
|
6937
7278
|
BrandIcon.displayName = "BrandIcon";
|
|
6938
7279
|
|
|
6939
7280
|
// src/components/ColorSwatch.tsx
|
|
6940
|
-
import
|
|
6941
|
-
var ColorSwatch =
|
|
7281
|
+
import React78 from "react";
|
|
7282
|
+
var ColorSwatch = React78.forwardRef(
|
|
6942
7283
|
({ color, label, className, ...rest }, ref) => {
|
|
6943
|
-
return /* @__PURE__ */
|
|
7284
|
+
return /* @__PURE__ */ React78.createElement(
|
|
6944
7285
|
"div",
|
|
6945
7286
|
{
|
|
6946
7287
|
ref,
|
|
6947
7288
|
className: cx("flex flex-col items-center gap-2", className),
|
|
6948
7289
|
...rest
|
|
6949
7290
|
},
|
|
6950
|
-
/* @__PURE__ */
|
|
7291
|
+
/* @__PURE__ */ React78.createElement(
|
|
6951
7292
|
"div",
|
|
6952
7293
|
{
|
|
6953
7294
|
className: "h-16 w-16 border-2 border-ash rounded-none shadow-sm",
|
|
@@ -6955,22 +7296,22 @@ var ColorSwatch = React77.forwardRef(
|
|
|
6955
7296
|
"aria-label": label || color
|
|
6956
7297
|
}
|
|
6957
7298
|
),
|
|
6958
|
-
label && /* @__PURE__ */
|
|
7299
|
+
label && /* @__PURE__ */ React78.createElement("span", { className: "text-xs text-silver font-medium" }, label)
|
|
6959
7300
|
);
|
|
6960
7301
|
}
|
|
6961
7302
|
);
|
|
6962
7303
|
ColorSwatch.displayName = "ColorSwatch";
|
|
6963
7304
|
|
|
6964
7305
|
// src/components/SectionHeading.tsx
|
|
6965
|
-
import
|
|
7306
|
+
import React79 from "react";
|
|
6966
7307
|
var levelStyles = {
|
|
6967
7308
|
h2: "text-2xl mb-4",
|
|
6968
7309
|
h3: "text-xl mb-3"
|
|
6969
7310
|
};
|
|
6970
|
-
var SectionHeading =
|
|
7311
|
+
var SectionHeading = React79.forwardRef(
|
|
6971
7312
|
({ level = "h2", children, className, ...rest }, ref) => {
|
|
6972
7313
|
const Component = level;
|
|
6973
|
-
return /* @__PURE__ */
|
|
7314
|
+
return /* @__PURE__ */ React79.createElement(
|
|
6974
7315
|
Component,
|
|
6975
7316
|
{
|
|
6976
7317
|
ref,
|
|
@@ -7041,6 +7382,7 @@ export {
|
|
|
7041
7382
|
FileChip,
|
|
7042
7383
|
HelperText,
|
|
7043
7384
|
HistoryIcon,
|
|
7385
|
+
HistoryPanel,
|
|
7044
7386
|
ImageCard,
|
|
7045
7387
|
Input,
|
|
7046
7388
|
InputGroup,
|