@lukeashford/aurelius 3.5.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 +62 -4
- package/dist/index.d.ts +62 -4
- package/dist/index.js +489 -186
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +488 -186
- package/dist/index.mjs.map +1 -1
- package/llms.md +21 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -74,6 +74,7 @@ __export(index_exports, {
|
|
|
74
74
|
FileChip: () => FileChip,
|
|
75
75
|
HelperText: () => HelperText,
|
|
76
76
|
HistoryIcon: () => HistoryIcon,
|
|
77
|
+
HistoryPanel: () => HistoryPanel,
|
|
77
78
|
ImageCard: () => ImageCard,
|
|
78
79
|
Input: () => Input,
|
|
79
80
|
InputGroup: () => InputGroup,
|
|
@@ -4310,7 +4311,7 @@ var StreamingCursor = import_react56.default.forwardRef(
|
|
|
4310
4311
|
StreamingCursor.displayName = "StreamingCursor";
|
|
4311
4312
|
|
|
4312
4313
|
// src/components/chat/ChatInterface.tsx
|
|
4313
|
-
var
|
|
4314
|
+
var import_react78 = __toESM(require("react"));
|
|
4314
4315
|
|
|
4315
4316
|
// src/components/chat/ChatView.tsx
|
|
4316
4317
|
var import_react60 = __toESM(require("react"));
|
|
@@ -4798,6 +4799,7 @@ var ChatInput = import_react61.default.forwardRef(
|
|
|
4798
4799
|
acceptedFileTypes,
|
|
4799
4800
|
notice,
|
|
4800
4801
|
onInputChange,
|
|
4802
|
+
autoFocus = false,
|
|
4801
4803
|
className,
|
|
4802
4804
|
...rest
|
|
4803
4805
|
}, ref) => {
|
|
@@ -4850,10 +4852,10 @@ var ChatInput = import_react61.default.forwardRef(
|
|
|
4850
4852
|
textarea.style.height = `${Math.min(textarea.scrollHeight, 200)}px`;
|
|
4851
4853
|
}, [onInputChange]);
|
|
4852
4854
|
(0, import_react61.useEffect)(() => {
|
|
4853
|
-
if (!disabled && !isStreaming && textareaRef.current) {
|
|
4855
|
+
if (autoFocus && !disabled && !isStreaming && textareaRef.current) {
|
|
4854
4856
|
textareaRef.current.focus();
|
|
4855
4857
|
}
|
|
4856
|
-
}, [disabled, isStreaming]);
|
|
4858
|
+
}, [disabled, isStreaming, autoFocus]);
|
|
4857
4859
|
const addFiles = (0, import_react61.useCallback)(
|
|
4858
4860
|
(files) => {
|
|
4859
4861
|
const newAttachments = Array.from(files).map((file) => ({
|
|
@@ -6079,8 +6081,346 @@ var ArtifactsPanelToggle = import_react72.default.forwardRef(({ artifactCount =
|
|
|
6079
6081
|
});
|
|
6080
6082
|
ArtifactsPanelToggle.displayName = "ArtifactsPanelToggle";
|
|
6081
6083
|
|
|
6082
|
-
// src/components/chat/
|
|
6084
|
+
// src/components/chat/HistoryPanel.tsx
|
|
6083
6085
|
var import_react73 = __toESM(require("react"));
|
|
6086
|
+
function parseTimestamp(ts) {
|
|
6087
|
+
if (ts == null) {
|
|
6088
|
+
return null;
|
|
6089
|
+
}
|
|
6090
|
+
const d = ts instanceof Date ? ts : new Date(ts);
|
|
6091
|
+
return Number.isNaN(d.getTime()) ? null : d;
|
|
6092
|
+
}
|
|
6093
|
+
function startOfDay(d) {
|
|
6094
|
+
const x = new Date(d);
|
|
6095
|
+
x.setHours(0, 0, 0, 0);
|
|
6096
|
+
return x;
|
|
6097
|
+
}
|
|
6098
|
+
function groupConversations(conversations) {
|
|
6099
|
+
const today = startOfDay(/* @__PURE__ */ new Date());
|
|
6100
|
+
const yesterday = new Date(today);
|
|
6101
|
+
yesterday.setDate(yesterday.getDate() - 1);
|
|
6102
|
+
const todayList = [];
|
|
6103
|
+
const yesterdayList = [];
|
|
6104
|
+
const olderList = [];
|
|
6105
|
+
for (const c of conversations) {
|
|
6106
|
+
const d = parseTimestamp(c.timestamp);
|
|
6107
|
+
if (d && d >= today) {
|
|
6108
|
+
todayList.push(c);
|
|
6109
|
+
} else if (d && d >= yesterday) {
|
|
6110
|
+
yesterdayList.push(c);
|
|
6111
|
+
} else {
|
|
6112
|
+
olderList.push(c);
|
|
6113
|
+
}
|
|
6114
|
+
}
|
|
6115
|
+
return [
|
|
6116
|
+
{ key: "today", label: "Today", conversations: todayList },
|
|
6117
|
+
{ key: "yesterday", label: "Yesterday", conversations: yesterdayList },
|
|
6118
|
+
{ key: "older", label: "Older", conversations: olderList }
|
|
6119
|
+
].filter((g) => g.conversations.length > 0);
|
|
6120
|
+
}
|
|
6121
|
+
function ChevronDownIcon({ className }) {
|
|
6122
|
+
return /* @__PURE__ */ import_react73.default.createElement(
|
|
6123
|
+
"svg",
|
|
6124
|
+
{
|
|
6125
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6126
|
+
viewBox: "0 0 20 20",
|
|
6127
|
+
fill: "currentColor",
|
|
6128
|
+
className,
|
|
6129
|
+
"aria-hidden": "true"
|
|
6130
|
+
},
|
|
6131
|
+
/* @__PURE__ */ import_react73.default.createElement(
|
|
6132
|
+
"path",
|
|
6133
|
+
{
|
|
6134
|
+
fillRule: "evenodd",
|
|
6135
|
+
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",
|
|
6136
|
+
clipRule: "evenodd"
|
|
6137
|
+
}
|
|
6138
|
+
)
|
|
6139
|
+
);
|
|
6140
|
+
}
|
|
6141
|
+
function PencilIcon2({ className }) {
|
|
6142
|
+
return /* @__PURE__ */ import_react73.default.createElement(
|
|
6143
|
+
"svg",
|
|
6144
|
+
{
|
|
6145
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6146
|
+
viewBox: "0 0 20 20",
|
|
6147
|
+
fill: "currentColor",
|
|
6148
|
+
className,
|
|
6149
|
+
"aria-hidden": "true"
|
|
6150
|
+
},
|
|
6151
|
+
/* @__PURE__ */ import_react73.default.createElement(
|
|
6152
|
+
"path",
|
|
6153
|
+
{
|
|
6154
|
+
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"
|
|
6155
|
+
}
|
|
6156
|
+
)
|
|
6157
|
+
);
|
|
6158
|
+
}
|
|
6159
|
+
function ProjectFilter({
|
|
6160
|
+
projects,
|
|
6161
|
+
value,
|
|
6162
|
+
onChange,
|
|
6163
|
+
className
|
|
6164
|
+
}) {
|
|
6165
|
+
const [open, setOpen] = (0, import_react73.useState)(false);
|
|
6166
|
+
const ref = (0, import_react73.useRef)(null);
|
|
6167
|
+
(0, import_react73.useEffect)(() => {
|
|
6168
|
+
if (!open) {
|
|
6169
|
+
return;
|
|
6170
|
+
}
|
|
6171
|
+
const handler = (e) => {
|
|
6172
|
+
if (ref.current && !ref.current.contains(e.target)) {
|
|
6173
|
+
setOpen(false);
|
|
6174
|
+
}
|
|
6175
|
+
};
|
|
6176
|
+
document.addEventListener("mousedown", handler);
|
|
6177
|
+
return () => document.removeEventListener("mousedown", handler);
|
|
6178
|
+
}, [open]);
|
|
6179
|
+
const label = value ?? "All projects";
|
|
6180
|
+
return /* @__PURE__ */ import_react73.default.createElement("div", { className: cx("relative min-w-0", className), ref }, /* @__PURE__ */ import_react73.default.createElement(
|
|
6181
|
+
"button",
|
|
6182
|
+
{
|
|
6183
|
+
type: "button",
|
|
6184
|
+
onClick: () => setOpen((o) => !o),
|
|
6185
|
+
"aria-haspopup": "listbox",
|
|
6186
|
+
"aria-expanded": open,
|
|
6187
|
+
className: cx(
|
|
6188
|
+
"w-full flex items-center justify-between gap-1 px-2 py-1.5",
|
|
6189
|
+
"bg-obsidian/60 hover:bg-ash/30",
|
|
6190
|
+
"text-silver hover:text-white",
|
|
6191
|
+
"border border-ash/40",
|
|
6192
|
+
"text-xs",
|
|
6193
|
+
"transition-colors duration-150 min-w-0"
|
|
6194
|
+
)
|
|
6195
|
+
},
|
|
6196
|
+
/* @__PURE__ */ import_react73.default.createElement("span", { className: "truncate" }, label),
|
|
6197
|
+
/* @__PURE__ */ import_react73.default.createElement(ChevronDownIcon, { className: "w-3 h-3 shrink-0" })
|
|
6198
|
+
), open && /* @__PURE__ */ import_react73.default.createElement(
|
|
6199
|
+
"div",
|
|
6200
|
+
{
|
|
6201
|
+
role: "listbox",
|
|
6202
|
+
className: cx(
|
|
6203
|
+
"absolute top-full left-0 right-0 mt-1 z-20",
|
|
6204
|
+
"bg-charcoal border border-ash/40",
|
|
6205
|
+
"max-h-60 overflow-y-auto"
|
|
6206
|
+
)
|
|
6207
|
+
},
|
|
6208
|
+
/* @__PURE__ */ import_react73.default.createElement(
|
|
6209
|
+
"button",
|
|
6210
|
+
{
|
|
6211
|
+
type: "button",
|
|
6212
|
+
role: "option",
|
|
6213
|
+
"aria-selected": value === null,
|
|
6214
|
+
onClick: () => {
|
|
6215
|
+
onChange(null);
|
|
6216
|
+
setOpen(false);
|
|
6217
|
+
},
|
|
6218
|
+
className: cx(
|
|
6219
|
+
"w-full px-2 py-1.5 text-left text-xs truncate",
|
|
6220
|
+
"transition-colors duration-150",
|
|
6221
|
+
value === null ? "bg-gold/10 text-gold" : "text-silver hover:bg-ash/20 hover:text-white"
|
|
6222
|
+
)
|
|
6223
|
+
},
|
|
6224
|
+
"All projects"
|
|
6225
|
+
),
|
|
6226
|
+
projects.map((p) => /* @__PURE__ */ import_react73.default.createElement(
|
|
6227
|
+
"button",
|
|
6228
|
+
{
|
|
6229
|
+
key: p,
|
|
6230
|
+
type: "button",
|
|
6231
|
+
role: "option",
|
|
6232
|
+
"aria-selected": value === p,
|
|
6233
|
+
onClick: () => {
|
|
6234
|
+
onChange(p);
|
|
6235
|
+
setOpen(false);
|
|
6236
|
+
},
|
|
6237
|
+
className: cx(
|
|
6238
|
+
"w-full px-2 py-1.5 text-left text-xs truncate",
|
|
6239
|
+
"transition-colors duration-150",
|
|
6240
|
+
value === p ? "bg-gold/10 text-gold" : "text-silver hover:bg-ash/20 hover:text-white"
|
|
6241
|
+
)
|
|
6242
|
+
},
|
|
6243
|
+
p
|
|
6244
|
+
))
|
|
6245
|
+
));
|
|
6246
|
+
}
|
|
6247
|
+
function ConversationRow({
|
|
6248
|
+
conversation,
|
|
6249
|
+
onSelect,
|
|
6250
|
+
onRename
|
|
6251
|
+
}) {
|
|
6252
|
+
const [isEditing, setIsEditing] = (0, import_react73.useState)(false);
|
|
6253
|
+
const [draft, setDraft] = (0, import_react73.useState)(conversation.title);
|
|
6254
|
+
const inputRef = (0, import_react73.useRef)(null);
|
|
6255
|
+
(0, import_react73.useEffect)(() => {
|
|
6256
|
+
if (isEditing && inputRef.current) {
|
|
6257
|
+
inputRef.current.focus();
|
|
6258
|
+
inputRef.current.select();
|
|
6259
|
+
}
|
|
6260
|
+
}, [isEditing]);
|
|
6261
|
+
const startEdit = (0, import_react73.useCallback)((e) => {
|
|
6262
|
+
e.stopPropagation();
|
|
6263
|
+
setDraft(conversation.title);
|
|
6264
|
+
setIsEditing(true);
|
|
6265
|
+
}, [conversation.title]);
|
|
6266
|
+
const commit = (0, import_react73.useCallback)(() => {
|
|
6267
|
+
const trimmed = draft.trim();
|
|
6268
|
+
if (trimmed && trimmed !== conversation.title) {
|
|
6269
|
+
onRename?.(conversation.id, trimmed);
|
|
6270
|
+
}
|
|
6271
|
+
setIsEditing(false);
|
|
6272
|
+
}, [draft, conversation.id, conversation.title, onRename]);
|
|
6273
|
+
const cancel = (0, import_react73.useCallback)(() => {
|
|
6274
|
+
setDraft(conversation.title);
|
|
6275
|
+
setIsEditing(false);
|
|
6276
|
+
}, [conversation.title]);
|
|
6277
|
+
if (isEditing) {
|
|
6278
|
+
return /* @__PURE__ */ import_react73.default.createElement(
|
|
6279
|
+
"div",
|
|
6280
|
+
{
|
|
6281
|
+
className: cx(
|
|
6282
|
+
"w-full px-3 py-2",
|
|
6283
|
+
conversation.isActive ? "bg-ash/40" : "bg-ash/20"
|
|
6284
|
+
)
|
|
6285
|
+
},
|
|
6286
|
+
/* @__PURE__ */ import_react73.default.createElement(
|
|
6287
|
+
"input",
|
|
6288
|
+
{
|
|
6289
|
+
ref: inputRef,
|
|
6290
|
+
type: "text",
|
|
6291
|
+
value: draft,
|
|
6292
|
+
onChange: (e) => setDraft(e.target.value),
|
|
6293
|
+
onBlur: commit,
|
|
6294
|
+
onKeyDown: (e) => {
|
|
6295
|
+
if (e.key === "Enter") {
|
|
6296
|
+
e.preventDefault();
|
|
6297
|
+
commit();
|
|
6298
|
+
} else if (e.key === "Escape") {
|
|
6299
|
+
e.preventDefault();
|
|
6300
|
+
cancel();
|
|
6301
|
+
}
|
|
6302
|
+
},
|
|
6303
|
+
className: cx(
|
|
6304
|
+
"w-full px-2 py-1 text-sm font-medium text-white",
|
|
6305
|
+
"bg-obsidian border border-gold/40",
|
|
6306
|
+
"outline-none focus:border-gold"
|
|
6307
|
+
),
|
|
6308
|
+
"aria-label": "Conversation title"
|
|
6309
|
+
}
|
|
6310
|
+
),
|
|
6311
|
+
conversation.project && /* @__PURE__ */ import_react73.default.createElement("p", { className: "text-xs text-silver/60 truncate mt-1" }, conversation.project)
|
|
6312
|
+
);
|
|
6313
|
+
}
|
|
6314
|
+
return /* @__PURE__ */ import_react73.default.createElement("div", { className: "relative group" }, /* @__PURE__ */ import_react73.default.createElement(
|
|
6315
|
+
"button",
|
|
6316
|
+
{
|
|
6317
|
+
onClick: () => onSelect?.(conversation.id),
|
|
6318
|
+
className: cx(
|
|
6319
|
+
"w-full px-3 py-2 text-left",
|
|
6320
|
+
"transition-colors duration-150",
|
|
6321
|
+
conversation.isActive ? "bg-ash/40 text-white" : "text-silver hover:bg-ash/20 hover:text-white"
|
|
6322
|
+
)
|
|
6323
|
+
},
|
|
6324
|
+
/* @__PURE__ */ import_react73.default.createElement(
|
|
6325
|
+
"p",
|
|
6326
|
+
{
|
|
6327
|
+
className: cx(
|
|
6328
|
+
"text-sm font-medium truncate",
|
|
6329
|
+
onRename ? "pr-6" : ""
|
|
6330
|
+
)
|
|
6331
|
+
},
|
|
6332
|
+
conversation.title
|
|
6333
|
+
),
|
|
6334
|
+
conversation.project && /* @__PURE__ */ import_react73.default.createElement("p", { className: "text-xs text-silver/60 truncate mt-0.5" }, conversation.project)
|
|
6335
|
+
), onRename && /* @__PURE__ */ import_react73.default.createElement(
|
|
6336
|
+
"button",
|
|
6337
|
+
{
|
|
6338
|
+
type: "button",
|
|
6339
|
+
onClick: startEdit,
|
|
6340
|
+
"aria-label": "Rename conversation",
|
|
6341
|
+
className: cx(
|
|
6342
|
+
"absolute right-2 top-2",
|
|
6343
|
+
"p-1 text-silver/60 hover:text-gold hover:bg-ash/40",
|
|
6344
|
+
"opacity-0 group-hover:opacity-100 focus:opacity-100",
|
|
6345
|
+
"transition-opacity duration-150"
|
|
6346
|
+
)
|
|
6347
|
+
},
|
|
6348
|
+
/* @__PURE__ */ import_react73.default.createElement(PencilIcon2, { className: "w-3.5 h-3.5" })
|
|
6349
|
+
));
|
|
6350
|
+
}
|
|
6351
|
+
function HistoryPanel({
|
|
6352
|
+
conversations,
|
|
6353
|
+
onSelectConversation,
|
|
6354
|
+
onNewChat,
|
|
6355
|
+
onRenameConversation
|
|
6356
|
+
}) {
|
|
6357
|
+
const [projectFilter, setProjectFilter] = (0, import_react73.useState)(null);
|
|
6358
|
+
const projects = (0, import_react73.useMemo)(() => {
|
|
6359
|
+
const set = /* @__PURE__ */ new Set();
|
|
6360
|
+
for (const c of conversations) {
|
|
6361
|
+
if (c.project) {
|
|
6362
|
+
set.add(c.project);
|
|
6363
|
+
}
|
|
6364
|
+
}
|
|
6365
|
+
return Array.from(set).sort((a, b) => a.localeCompare(b));
|
|
6366
|
+
}, [conversations]);
|
|
6367
|
+
(0, import_react73.useEffect)(() => {
|
|
6368
|
+
if (projectFilter && !projects.includes(projectFilter)) {
|
|
6369
|
+
setProjectFilter(null);
|
|
6370
|
+
}
|
|
6371
|
+
}, [projects, projectFilter]);
|
|
6372
|
+
const filteredConversations = (0, import_react73.useMemo)(() => {
|
|
6373
|
+
if (!projectFilter) {
|
|
6374
|
+
return conversations;
|
|
6375
|
+
}
|
|
6376
|
+
return conversations.filter((c) => c.project === projectFilter);
|
|
6377
|
+
}, [conversations, projectFilter]);
|
|
6378
|
+
const groups = (0, import_react73.useMemo)(
|
|
6379
|
+
() => groupConversations(filteredConversations),
|
|
6380
|
+
[filteredConversations]
|
|
6381
|
+
);
|
|
6382
|
+
const hasFilter = projects.length > 0;
|
|
6383
|
+
return /* @__PURE__ */ import_react73.default.createElement("div", { className: "h-full flex flex-col" }, /* @__PURE__ */ import_react73.default.createElement("div", { className: "px-4 py-3 border-b border-ash/40 shrink-0 flex items-center gap-2" }, /* @__PURE__ */ import_react73.default.createElement("h3", { className: "text-xs font-medium text-white shrink-0" }, "History"), (hasFilter || onNewChat) && /* @__PURE__ */ import_react73.default.createElement("div", { className: "flex items-center gap-2 flex-1 min-w-0" }, hasFilter && /* @__PURE__ */ import_react73.default.createElement(import_react73.default.Fragment, null, /* @__PURE__ */ import_react73.default.createElement("div", { className: "w-px h-3 bg-ash/40 shrink-0 mx-1" }), /* @__PURE__ */ import_react73.default.createElement(
|
|
6384
|
+
ProjectFilter,
|
|
6385
|
+
{
|
|
6386
|
+
projects,
|
|
6387
|
+
value: projectFilter,
|
|
6388
|
+
onChange: setProjectFilter,
|
|
6389
|
+
className: "flex-1"
|
|
6390
|
+
}
|
|
6391
|
+
)), onNewChat && /* @__PURE__ */ import_react73.default.createElement(import_react73.default.Fragment, null, /* @__PURE__ */ import_react73.default.createElement("div", { className: "w-px h-3 bg-ash/40 shrink-0 mx-1" }), /* @__PURE__ */ import_react73.default.createElement(
|
|
6392
|
+
"button",
|
|
6393
|
+
{
|
|
6394
|
+
onClick: onNewChat,
|
|
6395
|
+
className: cx(
|
|
6396
|
+
"flex items-center gap-1 px-2.5 py-1.5 shrink-0",
|
|
6397
|
+
"bg-gold/10 hover:bg-gold/20 text-gold",
|
|
6398
|
+
"border border-gold/30",
|
|
6399
|
+
"text-xs font-medium",
|
|
6400
|
+
"transition-colors duration-200"
|
|
6401
|
+
)
|
|
6402
|
+
},
|
|
6403
|
+
/* @__PURE__ */ import_react73.default.createElement(PlusIcon, { className: "w-4 h-4" }),
|
|
6404
|
+
/* @__PURE__ */ import_react73.default.createElement("span", { className: "truncate" }, "New Chat")
|
|
6405
|
+
)))), /* @__PURE__ */ import_react73.default.createElement("div", { className: "flex-1 overflow-y-auto py-2" }, conversations.length === 0 ? /* @__PURE__ */ import_react73.default.createElement("p", { className: "px-4 py-2 text-xs text-silver/60" }, "No conversations yet") : groups.length === 0 ? /* @__PURE__ */ import_react73.default.createElement("p", { className: "px-4 py-2 text-xs text-silver/60" }, "No conversations match this filter") : /* @__PURE__ */ import_react73.default.createElement("div", null, groups.map((group, index) => /* @__PURE__ */ import_react73.default.createElement("section", { key: group.key, className: cx(index > 0 && "mt-3") }, /* @__PURE__ */ import_react73.default.createElement("div", { className: "flex items-center gap-2 px-3 pb-2" }, /* @__PURE__ */ import_react73.default.createElement(
|
|
6406
|
+
"span",
|
|
6407
|
+
{
|
|
6408
|
+
className: "text-xs font-medium uppercase tracking-wider text-gold/70"
|
|
6409
|
+
},
|
|
6410
|
+
group.label
|
|
6411
|
+
), /* @__PURE__ */ import_react73.default.createElement("div", { className: "flex-1 h-px bg-gold/20" })), /* @__PURE__ */ import_react73.default.createElement("div", { className: "space-y-1 px-2" }, group.conversations.map((conversation) => /* @__PURE__ */ import_react73.default.createElement(
|
|
6412
|
+
ConversationRow,
|
|
6413
|
+
{
|
|
6414
|
+
key: conversation.id,
|
|
6415
|
+
conversation,
|
|
6416
|
+
onSelect: onSelectConversation,
|
|
6417
|
+
onRename: onRenameConversation
|
|
6418
|
+
}
|
|
6419
|
+
))))))));
|
|
6420
|
+
}
|
|
6421
|
+
|
|
6422
|
+
// src/components/chat/TodosList.tsx
|
|
6423
|
+
var import_react74 = __toESM(require("react"));
|
|
6084
6424
|
var import_lucide_react14 = require("lucide-react");
|
|
6085
6425
|
var TASK_STATUSES = {
|
|
6086
6426
|
PENDING: "pending",
|
|
@@ -6092,16 +6432,16 @@ var TASK_STATUSES = {
|
|
|
6092
6432
|
function TaskIcon({ status }) {
|
|
6093
6433
|
switch (status) {
|
|
6094
6434
|
case "done":
|
|
6095
|
-
return /* @__PURE__ */
|
|
6435
|
+
return /* @__PURE__ */ import_react74.default.createElement(CheckSquareIcon, null);
|
|
6096
6436
|
case "in_progress":
|
|
6097
|
-
return /* @__PURE__ */
|
|
6437
|
+
return /* @__PURE__ */ import_react74.default.createElement(SquareLoaderIcon, null);
|
|
6098
6438
|
case "cancelled":
|
|
6099
|
-
return /* @__PURE__ */
|
|
6439
|
+
return /* @__PURE__ */ import_react74.default.createElement(CrossSquareIcon, { variant: "cancelled" });
|
|
6100
6440
|
case "failed":
|
|
6101
|
-
return /* @__PURE__ */
|
|
6441
|
+
return /* @__PURE__ */ import_react74.default.createElement(CrossSquareIcon, { variant: "failed" });
|
|
6102
6442
|
case "pending":
|
|
6103
6443
|
default:
|
|
6104
|
-
return /* @__PURE__ */
|
|
6444
|
+
return /* @__PURE__ */ import_react74.default.createElement(EmptySquareIcon, null);
|
|
6105
6445
|
}
|
|
6106
6446
|
}
|
|
6107
6447
|
function sortTasks(tasks) {
|
|
@@ -6121,7 +6461,7 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
6121
6461
|
const isSubtle = task.status === "cancelled" || task.status === "failed";
|
|
6122
6462
|
const showSubtasks = (task.status === "in_progress" || task.status === "done") && task.subtasks && task.subtasks.length > 0;
|
|
6123
6463
|
const sortedSubtasks = showSubtasks ? sortTasks(task.subtasks) : [];
|
|
6124
|
-
return /* @__PURE__ */
|
|
6464
|
+
return /* @__PURE__ */ import_react74.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ import_react74.default.createElement(
|
|
6125
6465
|
"div",
|
|
6126
6466
|
{
|
|
6127
6467
|
className: cx(
|
|
@@ -6129,8 +6469,8 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
6129
6469
|
depth > 0 && "pl-6"
|
|
6130
6470
|
)
|
|
6131
6471
|
},
|
|
6132
|
-
/* @__PURE__ */
|
|
6133
|
-
/* @__PURE__ */
|
|
6472
|
+
/* @__PURE__ */ import_react74.default.createElement(TaskIcon, { status: task.status }),
|
|
6473
|
+
/* @__PURE__ */ import_react74.default.createElement(
|
|
6134
6474
|
"span",
|
|
6135
6475
|
{
|
|
6136
6476
|
className: cx(
|
|
@@ -6142,10 +6482,10 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
6142
6482
|
)
|
|
6143
6483
|
},
|
|
6144
6484
|
task.label,
|
|
6145
|
-
task.status === "cancelled" && /* @__PURE__ */
|
|
6146
|
-
task.status === "failed" && /* @__PURE__ */
|
|
6485
|
+
task.status === "cancelled" && /* @__PURE__ */ import_react74.default.createElement("span", { className: "text-silver/40 ml-1" }, "(cancelled)"),
|
|
6486
|
+
task.status === "failed" && /* @__PURE__ */ import_react74.default.createElement("span", { className: "text-error/60 ml-1" }, "(failed)")
|
|
6147
6487
|
)
|
|
6148
|
-
), showSubtasks && /* @__PURE__ */
|
|
6488
|
+
), showSubtasks && /* @__PURE__ */ import_react74.default.createElement("div", { className: "flex flex-col" }, sortedSubtasks.map((subtask) => /* @__PURE__ */ import_react74.default.createElement(TaskItem, { key: subtask.id, task: subtask, depth: depth + 1 }))));
|
|
6149
6489
|
}
|
|
6150
6490
|
function hasInProgressTask(tasks) {
|
|
6151
6491
|
return tasks.some((t) => {
|
|
@@ -6154,11 +6494,11 @@ function hasInProgressTask(tasks) {
|
|
|
6154
6494
|
return false;
|
|
6155
6495
|
});
|
|
6156
6496
|
}
|
|
6157
|
-
var TodosList =
|
|
6497
|
+
var TodosList = import_react74.default.forwardRef(
|
|
6158
6498
|
({ tasks, title = "Tasks", onStopAllTasks, className, ...rest }, ref) => {
|
|
6159
|
-
const sortedTasks = (0,
|
|
6160
|
-
const [isStopping, setIsStopping] = (0,
|
|
6161
|
-
const handleStopClick = (0,
|
|
6499
|
+
const sortedTasks = (0, import_react74.useMemo)(() => sortTasks(tasks), [tasks]);
|
|
6500
|
+
const [isStopping, setIsStopping] = (0, import_react74.useState)(false);
|
|
6501
|
+
const handleStopClick = (0, import_react74.useCallback)(async () => {
|
|
6162
6502
|
if (!onStopAllTasks || isStopping) return;
|
|
6163
6503
|
try {
|
|
6164
6504
|
setIsStopping(true);
|
|
@@ -6192,7 +6532,7 @@ var TodosList = import_react73.default.forwardRef(
|
|
|
6192
6532
|
if (tasks.length === 0) {
|
|
6193
6533
|
return null;
|
|
6194
6534
|
}
|
|
6195
|
-
return /* @__PURE__ */
|
|
6535
|
+
return /* @__PURE__ */ import_react74.default.createElement(
|
|
6196
6536
|
"div",
|
|
6197
6537
|
{
|
|
6198
6538
|
ref,
|
|
@@ -6203,16 +6543,16 @@ var TodosList = import_react73.default.forwardRef(
|
|
|
6203
6543
|
),
|
|
6204
6544
|
...rest
|
|
6205
6545
|
},
|
|
6206
|
-
/* @__PURE__ */
|
|
6546
|
+
/* @__PURE__ */ import_react74.default.createElement(
|
|
6207
6547
|
"div",
|
|
6208
6548
|
{
|
|
6209
6549
|
className: "flex items-center justify-between px-4 py-2 border-b border-ash/40 flex-shrink-0"
|
|
6210
6550
|
},
|
|
6211
|
-
/* @__PURE__ */
|
|
6212
|
-
/* @__PURE__ */
|
|
6551
|
+
/* @__PURE__ */ import_react74.default.createElement("h4", { className: "text-xs font-medium text-white" }, title),
|
|
6552
|
+
/* @__PURE__ */ import_react74.default.createElement("span", { className: "text-xs text-silver/60" }, countCompleted(tasks), "/", countTotal(tasks))
|
|
6213
6553
|
),
|
|
6214
|
-
/* @__PURE__ */
|
|
6215
|
-
showStopButton && /* @__PURE__ */
|
|
6554
|
+
/* @__PURE__ */ import_react74.default.createElement("div", { className: "flex-1 overflow-y-auto px-4 py-2" }, sortedTasks.map((task) => /* @__PURE__ */ import_react74.default.createElement(TaskItem, { key: task.id, task }))),
|
|
6555
|
+
showStopButton && /* @__PURE__ */ import_react74.default.createElement("div", { className: "px-4 py-2 border-t border-ash/40 flex-shrink-0" }, /* @__PURE__ */ import_react74.default.createElement(
|
|
6216
6556
|
"button",
|
|
6217
6557
|
{
|
|
6218
6558
|
type: "button",
|
|
@@ -6229,7 +6569,7 @@ var TodosList = import_react73.default.forwardRef(
|
|
|
6229
6569
|
isStopping ? "cursor-not-allowed opacity-70" : "hover:bg-error/20"
|
|
6230
6570
|
)
|
|
6231
6571
|
},
|
|
6232
|
-
isStopping ? /* @__PURE__ */
|
|
6572
|
+
isStopping ? /* @__PURE__ */ import_react74.default.createElement(import_react74.default.Fragment, null, /* @__PURE__ */ import_react74.default.createElement(import_lucide_react14.Loader2, { className: "w-3 h-3 animate-spin" }), "Stopping tasks") : /* @__PURE__ */ import_react74.default.createElement(import_react74.default.Fragment, null, /* @__PURE__ */ import_react74.default.createElement(import_lucide_react14.Square, { className: "w-3 h-3 fill-current" }), "Stop All Tasks")
|
|
6233
6573
|
))
|
|
6234
6574
|
);
|
|
6235
6575
|
}
|
|
@@ -6245,8 +6585,8 @@ function areAllTasksSettled(tasks) {
|
|
|
6245
6585
|
}
|
|
6246
6586
|
|
|
6247
6587
|
// src/components/chat/ToolSidebar.tsx
|
|
6248
|
-
var
|
|
6249
|
-
var ToolSidebar =
|
|
6588
|
+
var import_react75 = __toESM(require("react"));
|
|
6589
|
+
var ToolSidebar = import_react75.default.forwardRef(
|
|
6250
6590
|
({ tools, activeTools, onToggleTool, side, className, ...rest }, ref) => {
|
|
6251
6591
|
const topTools = tools.filter((t) => t.group === `top-${side}`);
|
|
6252
6592
|
const bottomTools = tools.filter((t) => t.group === `bottom-${side}`);
|
|
@@ -6257,7 +6597,7 @@ var ToolSidebar = import_react74.default.forwardRef(
|
|
|
6257
6597
|
};
|
|
6258
6598
|
const renderButton = (tool) => {
|
|
6259
6599
|
const active = isActive(tool.id);
|
|
6260
|
-
return /* @__PURE__ */
|
|
6600
|
+
return /* @__PURE__ */ import_react75.default.createElement(
|
|
6261
6601
|
"button",
|
|
6262
6602
|
{
|
|
6263
6603
|
key: tool.id,
|
|
@@ -6269,10 +6609,10 @@ var ToolSidebar = import_react74.default.forwardRef(
|
|
|
6269
6609
|
"aria-label": tool.label,
|
|
6270
6610
|
"aria-pressed": active
|
|
6271
6611
|
},
|
|
6272
|
-
/* @__PURE__ */
|
|
6612
|
+
/* @__PURE__ */ import_react75.default.createElement("span", { className: "w-4 h-4 block" }, tool.icon)
|
|
6273
6613
|
);
|
|
6274
6614
|
};
|
|
6275
|
-
return /* @__PURE__ */
|
|
6615
|
+
return /* @__PURE__ */ import_react75.default.createElement(
|
|
6276
6616
|
"div",
|
|
6277
6617
|
{
|
|
6278
6618
|
ref,
|
|
@@ -6283,17 +6623,17 @@ var ToolSidebar = import_react74.default.forwardRef(
|
|
|
6283
6623
|
),
|
|
6284
6624
|
...rest
|
|
6285
6625
|
},
|
|
6286
|
-
/* @__PURE__ */
|
|
6287
|
-
/* @__PURE__ */
|
|
6288
|
-
/* @__PURE__ */
|
|
6626
|
+
/* @__PURE__ */ import_react75.default.createElement("div", { className: "flex flex-col items-center gap-1" }, topTools.map(renderButton)),
|
|
6627
|
+
/* @__PURE__ */ import_react75.default.createElement("div", { className: "flex-1 flex items-center justify-center" }, /* @__PURE__ */ import_react75.default.createElement("div", { className: "w-5 border-t border-ash/30" })),
|
|
6628
|
+
/* @__PURE__ */ import_react75.default.createElement("div", { className: "flex flex-col items-center gap-1" }, bottomTools.map(renderButton))
|
|
6289
6629
|
);
|
|
6290
6630
|
}
|
|
6291
6631
|
);
|
|
6292
6632
|
ToolSidebar.displayName = "ToolSidebar";
|
|
6293
6633
|
|
|
6294
6634
|
// src/components/chat/ToolPanelContainer.tsx
|
|
6295
|
-
var
|
|
6296
|
-
var ToolPanelContainer =
|
|
6635
|
+
var import_react76 = __toESM(require("react"));
|
|
6636
|
+
var ToolPanelContainer = import_react76.default.forwardRef(
|
|
6297
6637
|
({
|
|
6298
6638
|
topContent,
|
|
6299
6639
|
bottomContent,
|
|
@@ -6304,21 +6644,21 @@ var ToolPanelContainer = import_react75.default.forwardRef(
|
|
|
6304
6644
|
initialTopPercent = 60,
|
|
6305
6645
|
...rest
|
|
6306
6646
|
}, ref) => {
|
|
6307
|
-
const [topPercent, setTopPercent] = (0,
|
|
6308
|
-
const [isResizingHeight, setIsResizingHeight] = (0,
|
|
6309
|
-
const containerRef = (0,
|
|
6310
|
-
const lastY = (0,
|
|
6647
|
+
const [topPercent, setTopPercent] = (0, import_react76.useState)(initialTopPercent);
|
|
6648
|
+
const [isResizingHeight, setIsResizingHeight] = (0, import_react76.useState)(false);
|
|
6649
|
+
const containerRef = (0, import_react76.useRef)(null);
|
|
6650
|
+
const lastY = (0, import_react76.useRef)(null);
|
|
6311
6651
|
const hasBoth = topContent !== null && bottomContent !== null;
|
|
6312
|
-
const startHeightResize = (0,
|
|
6652
|
+
const startHeightResize = (0, import_react76.useCallback)((e) => {
|
|
6313
6653
|
e.preventDefault();
|
|
6314
6654
|
setIsResizingHeight(true);
|
|
6315
6655
|
lastY.current = e.clientY;
|
|
6316
6656
|
}, []);
|
|
6317
|
-
const stopHeightResize = (0,
|
|
6657
|
+
const stopHeightResize = (0, import_react76.useCallback)(() => {
|
|
6318
6658
|
setIsResizingHeight(false);
|
|
6319
6659
|
lastY.current = null;
|
|
6320
6660
|
}, []);
|
|
6321
|
-
const resizeHeight = (0,
|
|
6661
|
+
const resizeHeight = (0, import_react76.useCallback)(
|
|
6322
6662
|
(e) => {
|
|
6323
6663
|
if (!isResizingHeight || lastY.current === null || !containerRef.current) {
|
|
6324
6664
|
return;
|
|
@@ -6337,7 +6677,7 @@ var ToolPanelContainer = import_react75.default.forwardRef(
|
|
|
6337
6677
|
},
|
|
6338
6678
|
[isResizingHeight]
|
|
6339
6679
|
);
|
|
6340
|
-
(0,
|
|
6680
|
+
(0, import_react76.useEffect)(() => {
|
|
6341
6681
|
if (isResizingHeight) {
|
|
6342
6682
|
window.addEventListener("mousemove", resizeHeight);
|
|
6343
6683
|
window.addEventListener("mouseup", stopHeightResize);
|
|
@@ -6356,7 +6696,7 @@ var ToolPanelContainer = import_react75.default.forwardRef(
|
|
|
6356
6696
|
document.body.style.userSelect = "";
|
|
6357
6697
|
};
|
|
6358
6698
|
}, [isResizingHeight, resizeHeight, stopHeightResize]);
|
|
6359
|
-
return /* @__PURE__ */
|
|
6699
|
+
return /* @__PURE__ */ import_react76.default.createElement(
|
|
6360
6700
|
"div",
|
|
6361
6701
|
{
|
|
6362
6702
|
ref: (node) => {
|
|
@@ -6375,7 +6715,7 @@ var ToolPanelContainer = import_react75.default.forwardRef(
|
|
|
6375
6715
|
style: width ? { width } : void 0,
|
|
6376
6716
|
...rest
|
|
6377
6717
|
},
|
|
6378
|
-
/* @__PURE__ */
|
|
6718
|
+
/* @__PURE__ */ import_react76.default.createElement(
|
|
6379
6719
|
"div",
|
|
6380
6720
|
{
|
|
6381
6721
|
onMouseDown: onResizeStart,
|
|
@@ -6386,7 +6726,7 @@ var ToolPanelContainer = import_react75.default.forwardRef(
|
|
|
6386
6726
|
)
|
|
6387
6727
|
}
|
|
6388
6728
|
),
|
|
6389
|
-
topContent !== null && /* @__PURE__ */
|
|
6729
|
+
topContent !== null && /* @__PURE__ */ import_react76.default.createElement(
|
|
6390
6730
|
"div",
|
|
6391
6731
|
{
|
|
6392
6732
|
className: "min-h-0 overflow-hidden flex flex-col",
|
|
@@ -6394,7 +6734,7 @@ var ToolPanelContainer = import_react75.default.forwardRef(
|
|
|
6394
6734
|
},
|
|
6395
6735
|
topContent
|
|
6396
6736
|
),
|
|
6397
|
-
hasBoth && /* @__PURE__ */
|
|
6737
|
+
hasBoth && /* @__PURE__ */ import_react76.default.createElement(
|
|
6398
6738
|
"div",
|
|
6399
6739
|
{
|
|
6400
6740
|
onMouseDown: startHeightResize,
|
|
@@ -6406,7 +6746,7 @@ var ToolPanelContainer = import_react75.default.forwardRef(
|
|
|
6406
6746
|
)
|
|
6407
6747
|
}
|
|
6408
6748
|
),
|
|
6409
|
-
bottomContent !== null && /* @__PURE__ */
|
|
6749
|
+
bottomContent !== null && /* @__PURE__ */ import_react76.default.createElement(
|
|
6410
6750
|
"div",
|
|
6411
6751
|
{
|
|
6412
6752
|
className: "min-h-0 overflow-hidden flex flex-col",
|
|
@@ -6420,26 +6760,26 @@ var ToolPanelContainer = import_react75.default.forwardRef(
|
|
|
6420
6760
|
ToolPanelContainer.displayName = "ToolPanelContainer";
|
|
6421
6761
|
|
|
6422
6762
|
// src/components/chat/hooks/useResizable.ts
|
|
6423
|
-
var
|
|
6763
|
+
var import_react77 = require("react");
|
|
6424
6764
|
function useResizable({
|
|
6425
6765
|
initialWidthPercent,
|
|
6426
6766
|
minWidthPercent,
|
|
6427
6767
|
maxWidthPercent,
|
|
6428
6768
|
direction
|
|
6429
6769
|
}) {
|
|
6430
|
-
const [widthPercent, setWidthPercent] = (0,
|
|
6431
|
-
const [isResizing, setIsResizing] = (0,
|
|
6432
|
-
const lastX = (0,
|
|
6433
|
-
const startResizing = (0,
|
|
6770
|
+
const [widthPercent, setWidthPercent] = (0, import_react77.useState)(initialWidthPercent);
|
|
6771
|
+
const [isResizing, setIsResizing] = (0, import_react77.useState)(false);
|
|
6772
|
+
const lastX = (0, import_react77.useRef)(null);
|
|
6773
|
+
const startResizing = (0, import_react77.useCallback)((e) => {
|
|
6434
6774
|
e.preventDefault();
|
|
6435
6775
|
setIsResizing(true);
|
|
6436
6776
|
lastX.current = e.clientX;
|
|
6437
6777
|
}, []);
|
|
6438
|
-
const stopResizing = (0,
|
|
6778
|
+
const stopResizing = (0, import_react77.useCallback)(() => {
|
|
6439
6779
|
setIsResizing(false);
|
|
6440
6780
|
lastX.current = null;
|
|
6441
6781
|
}, []);
|
|
6442
|
-
const resize = (0,
|
|
6782
|
+
const resize = (0, import_react77.useCallback)(
|
|
6443
6783
|
(e) => {
|
|
6444
6784
|
if (!isResizing || lastX.current === null) {
|
|
6445
6785
|
return;
|
|
@@ -6455,7 +6795,7 @@ function useResizable({
|
|
|
6455
6795
|
},
|
|
6456
6796
|
[isResizing, direction, minWidthPercent, maxWidthPercent]
|
|
6457
6797
|
);
|
|
6458
|
-
(0,
|
|
6798
|
+
(0, import_react77.useEffect)(() => {
|
|
6459
6799
|
if (isResizing) {
|
|
6460
6800
|
window.addEventListener("mousemove", resize);
|
|
6461
6801
|
window.addEventListener("mouseup", stopResizing);
|
|
@@ -6479,7 +6819,7 @@ function useResizable({
|
|
|
6479
6819
|
}
|
|
6480
6820
|
|
|
6481
6821
|
// src/components/chat/ChatInterface.tsx
|
|
6482
|
-
var ChatInterface =
|
|
6822
|
+
var ChatInterface = import_react78.default.forwardRef(
|
|
6483
6823
|
({
|
|
6484
6824
|
messages = [],
|
|
6485
6825
|
conversationTree,
|
|
@@ -6491,6 +6831,7 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6491
6831
|
onStop,
|
|
6492
6832
|
onSelectConversation,
|
|
6493
6833
|
onNewChat,
|
|
6834
|
+
onRenameConversation,
|
|
6494
6835
|
isStreaming = false,
|
|
6495
6836
|
isThinking = false,
|
|
6496
6837
|
placeholder = "Send a message...",
|
|
@@ -6509,20 +6850,21 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6509
6850
|
inputNotice,
|
|
6510
6851
|
onInputChange,
|
|
6511
6852
|
tools: externalTools = [],
|
|
6853
|
+
autoFocus = true,
|
|
6512
6854
|
className,
|
|
6513
6855
|
...rest
|
|
6514
6856
|
}, ref) => {
|
|
6515
|
-
const prevArtifactNodesRef = (0,
|
|
6516
|
-
const prevTasksRef = (0,
|
|
6517
|
-
const [internalTools, setInternalTools] = (0,
|
|
6857
|
+
const prevArtifactNodesRef = (0, import_react78.useRef)([]);
|
|
6858
|
+
const prevTasksRef = (0, import_react78.useRef)([]);
|
|
6859
|
+
const [internalTools, setInternalTools] = (0, import_react78.useState)({
|
|
6518
6860
|
"top-left": "history",
|
|
6519
6861
|
"bottom-left": null,
|
|
6520
6862
|
"top-right": null,
|
|
6521
6863
|
"bottom-right": null
|
|
6522
6864
|
});
|
|
6523
|
-
const dismissedToolsRef = (0,
|
|
6865
|
+
const dismissedToolsRef = (0, import_react78.useRef)(/* @__PURE__ */ new Set());
|
|
6524
6866
|
const isPanelControlled = isArtifactsPanelOpen !== void 0;
|
|
6525
|
-
const activeTools = (0,
|
|
6867
|
+
const activeTools = (0, import_react78.useMemo)(() => {
|
|
6526
6868
|
if (isPanelControlled) {
|
|
6527
6869
|
return {
|
|
6528
6870
|
...internalTools,
|
|
@@ -6552,13 +6894,13 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6552
6894
|
direction: "right"
|
|
6553
6895
|
});
|
|
6554
6896
|
const allSettled = tasks.length === 0 || areAllTasksSettled(tasks);
|
|
6555
|
-
const allToolDefinitions = (0,
|
|
6897
|
+
const allToolDefinitions = (0, import_react78.useMemo)(() => {
|
|
6556
6898
|
const builtIn = [
|
|
6557
|
-
{ id: "history", icon: /* @__PURE__ */
|
|
6558
|
-
{ id: "artifacts", icon: /* @__PURE__ */
|
|
6899
|
+
{ id: "history", icon: /* @__PURE__ */ import_react78.default.createElement(ChatBubbleIcon, null), label: "History", group: "top-left" },
|
|
6900
|
+
{ id: "artifacts", icon: /* @__PURE__ */ import_react78.default.createElement(MediaIcon, null), label: "Artifacts", group: "top-right" },
|
|
6559
6901
|
{
|
|
6560
6902
|
id: "todos",
|
|
6561
|
-
icon: allSettled ? /* @__PURE__ */
|
|
6903
|
+
icon: allSettled ? /* @__PURE__ */ import_react78.default.createElement(CheckSquareIcon, null) : /* @__PURE__ */ import_react78.default.createElement(SquareLoaderIcon, null),
|
|
6562
6904
|
label: "Tasks",
|
|
6563
6905
|
group: "bottom-right"
|
|
6564
6906
|
}
|
|
@@ -6566,7 +6908,7 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6566
6908
|
const external = externalTools.map(({ content: _content, ...def }) => def);
|
|
6567
6909
|
return [...builtIn, ...external];
|
|
6568
6910
|
}, [allSettled, externalTools]);
|
|
6569
|
-
const toggleTool = (0,
|
|
6911
|
+
const toggleTool = (0, import_react78.useCallback)((toolId) => {
|
|
6570
6912
|
const toolDef = allToolDefinitions.find((t) => t.id === toolId);
|
|
6571
6913
|
if (!toolDef) {
|
|
6572
6914
|
return;
|
|
@@ -6596,7 +6938,7 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6596
6938
|
});
|
|
6597
6939
|
}, [allToolDefinitions, isPanelControlled, activeTools, onArtifactsPanelOpenChange]);
|
|
6598
6940
|
const isTreeMode = !!conversationTree;
|
|
6599
|
-
const effectiveMessages = (0,
|
|
6941
|
+
const effectiveMessages = (0, import_react78.useMemo)(() => {
|
|
6600
6942
|
if (isTreeMode && conversationTree) {
|
|
6601
6943
|
const pathNodes = getActivePathMessages(conversationTree);
|
|
6602
6944
|
return pathNodes.map((node) => ({
|
|
@@ -6608,7 +6950,7 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6608
6950
|
}
|
|
6609
6951
|
return messages;
|
|
6610
6952
|
}, [isTreeMode, conversationTree, messages]);
|
|
6611
|
-
const latestUserMessageIndex = (0,
|
|
6953
|
+
const latestUserMessageIndex = (0, import_react78.useMemo)(() => {
|
|
6612
6954
|
for (let i = effectiveMessages.length - 1; i >= 0; i--) {
|
|
6613
6955
|
if (effectiveMessages[i].variant === "user") {
|
|
6614
6956
|
return i;
|
|
@@ -6616,7 +6958,7 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6616
6958
|
}
|
|
6617
6959
|
return -1;
|
|
6618
6960
|
}, [effectiveMessages]);
|
|
6619
|
-
(0,
|
|
6961
|
+
(0, import_react78.useEffect)(() => {
|
|
6620
6962
|
const nodes = artifactNodes || [];
|
|
6621
6963
|
const prevNodes = prevArtifactNodesRef.current;
|
|
6622
6964
|
const hasNewOrChangedNode = nodes.length !== prevNodes.length || nodes.some((n, i) => n.id !== prevNodes[i]?.id);
|
|
@@ -6641,7 +6983,7 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6641
6983
|
prevArtifactNodesRef.current = nodes;
|
|
6642
6984
|
prevTasksRef.current = tasks;
|
|
6643
6985
|
}, [artifactNodes, tasks, isPanelControlled]);
|
|
6644
|
-
const handleBranchSwitch = (0,
|
|
6986
|
+
const handleBranchSwitch = (0, import_react78.useCallback)(
|
|
6645
6987
|
(nodeId, direction) => {
|
|
6646
6988
|
if (!isTreeMode || !conversationTree || !onTreeChange) {
|
|
6647
6989
|
return;
|
|
@@ -6651,7 +6993,7 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6651
6993
|
},
|
|
6652
6994
|
[isTreeMode, conversationTree, onTreeChange]
|
|
6653
6995
|
);
|
|
6654
|
-
const displayMessages = (0,
|
|
6996
|
+
const displayMessages = (0, import_react78.useMemo)(() => {
|
|
6655
6997
|
return effectiveMessages.map((msg) => {
|
|
6656
6998
|
let branchInfo = void 0;
|
|
6657
6999
|
if (isTreeMode && conversationTree) {
|
|
@@ -6681,18 +7023,18 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6681
7023
|
onRetryMessage,
|
|
6682
7024
|
handleBranchSwitch
|
|
6683
7025
|
]);
|
|
6684
|
-
const handleSubmit = (0,
|
|
7026
|
+
const handleSubmit = (0, import_react78.useCallback)(
|
|
6685
7027
|
(message, attachments) => {
|
|
6686
7028
|
onMessageSubmit?.(message, attachments);
|
|
6687
7029
|
},
|
|
6688
7030
|
[onMessageSubmit]
|
|
6689
7031
|
);
|
|
6690
7032
|
const isEmpty = effectiveMessages.length === 0;
|
|
6691
|
-
const leftToolDefs = (0,
|
|
7033
|
+
const leftToolDefs = (0, import_react78.useMemo)(
|
|
6692
7034
|
() => allToolDefinitions.filter((t) => t.group === "top-left" || t.group === "bottom-left"),
|
|
6693
7035
|
[allToolDefinitions]
|
|
6694
7036
|
);
|
|
6695
|
-
const rightToolDefs = (0,
|
|
7037
|
+
const rightToolDefs = (0, import_react78.useMemo)(
|
|
6696
7038
|
() => allToolDefinitions.filter(
|
|
6697
7039
|
(t) => t.group === "top-right" || t.group === "bottom-right"
|
|
6698
7040
|
),
|
|
@@ -6706,58 +7048,17 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6706
7048
|
}
|
|
6707
7049
|
switch (toolId) {
|
|
6708
7050
|
case "history":
|
|
6709
|
-
return /* @__PURE__ */
|
|
6710
|
-
|
|
7051
|
+
return /* @__PURE__ */ import_react78.default.createElement(
|
|
7052
|
+
HistoryPanel,
|
|
6711
7053
|
{
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
onClick: onNewChat,
|
|
6719
|
-
className: cx(
|
|
6720
|
-
"flex px-3 py-1.5",
|
|
6721
|
-
"bg-gold/10 hover:bg-gold/20 text-gold",
|
|
6722
|
-
"border border-gold/30",
|
|
6723
|
-
"text-xs font-medium",
|
|
6724
|
-
"transition-colors duration-200"
|
|
6725
|
-
)
|
|
6726
|
-
},
|
|
6727
|
-
/* @__PURE__ */ import_react77.default.createElement(
|
|
6728
|
-
"svg",
|
|
6729
|
-
{
|
|
6730
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
6731
|
-
viewBox: "0 0 20 20",
|
|
6732
|
-
fill: "currentColor",
|
|
6733
|
-
className: "w-4 h-4"
|
|
6734
|
-
},
|
|
6735
|
-
/* @__PURE__ */ import_react77.default.createElement(
|
|
6736
|
-
"path",
|
|
6737
|
-
{
|
|
6738
|
-
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"
|
|
6739
|
-
}
|
|
6740
|
-
)
|
|
6741
|
-
),
|
|
6742
|
-
"New Chat"
|
|
6743
|
-
)
|
|
6744
|
-
), /* @__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(
|
|
6745
|
-
"button",
|
|
6746
|
-
{
|
|
6747
|
-
key: conversation.id,
|
|
6748
|
-
onClick: () => onSelectConversation?.(conversation.id),
|
|
6749
|
-
className: cx(
|
|
6750
|
-
"w-full px-3 py-2 text-left",
|
|
6751
|
-
"transition-colors duration-150",
|
|
6752
|
-
conversation.isActive ? "bg-ash/40 text-white" : "text-silver hover:bg-ash/20 hover:text-white"
|
|
6753
|
-
)
|
|
6754
|
-
},
|
|
6755
|
-
/* @__PURE__ */ import_react77.default.createElement("p", { className: "text-sm font-medium truncate" }, conversation.title),
|
|
6756
|
-
conversation.preview && /* @__PURE__ */ import_react77.default.createElement("p", { className: "text-xs text-silver/60 truncate mt-0.5" }, conversation.preview),
|
|
6757
|
-
conversation.timestamp && /* @__PURE__ */ import_react77.default.createElement("p", { className: "text-xs text-silver/40 mt-1" }, conversation.timestamp)
|
|
6758
|
-
)))));
|
|
7054
|
+
conversations,
|
|
7055
|
+
onSelectConversation,
|
|
7056
|
+
onNewChat,
|
|
7057
|
+
onRenameConversation
|
|
7058
|
+
}
|
|
7059
|
+
);
|
|
6759
7060
|
case "artifacts":
|
|
6760
|
-
return /* @__PURE__ */
|
|
7061
|
+
return /* @__PURE__ */ import_react78.default.createElement(
|
|
6761
7062
|
ArtifactsPanel,
|
|
6762
7063
|
{
|
|
6763
7064
|
nodes: artifactNodes,
|
|
@@ -6765,7 +7066,7 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6765
7066
|
}
|
|
6766
7067
|
);
|
|
6767
7068
|
case "todos":
|
|
6768
|
-
return tasks.length > 0 ? /* @__PURE__ */
|
|
7069
|
+
return tasks.length > 0 ? /* @__PURE__ */ import_react78.default.createElement(
|
|
6769
7070
|
TodosList,
|
|
6770
7071
|
{
|
|
6771
7072
|
tasks,
|
|
@@ -6773,21 +7074,21 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6773
7074
|
onStopAllTasks,
|
|
6774
7075
|
className: "h-full"
|
|
6775
7076
|
}
|
|
6776
|
-
) : /* @__PURE__ */
|
|
7077
|
+
) : /* @__PURE__ */ import_react78.default.createElement("div", { className: "h-full flex flex-col" }, /* @__PURE__ */ import_react78.default.createElement("div", { className: "flex items-center p-4 border-b border-ash/40 shrink-0" }, /* @__PURE__ */ import_react78.default.createElement("h3", { className: "text-xs font-medium text-white" }, "Tasks")), /* @__PURE__ */ import_react78.default.createElement("div", { className: "flex-1 flex items-center justify-center" }, /* @__PURE__ */ import_react78.default.createElement("p", { className: "text-xs text-silver/60" }, "No tasks")));
|
|
6777
7078
|
default: {
|
|
6778
7079
|
const externalTool = externalTools.find((t) => t.id === toolId);
|
|
6779
7080
|
return externalTool?.content ?? null;
|
|
6780
7081
|
}
|
|
6781
7082
|
}
|
|
6782
7083
|
};
|
|
6783
|
-
return /* @__PURE__ */
|
|
7084
|
+
return /* @__PURE__ */ import_react78.default.createElement(
|
|
6784
7085
|
"div",
|
|
6785
7086
|
{
|
|
6786
7087
|
ref,
|
|
6787
7088
|
className: cx("flex h-full w-full bg-obsidian overflow-hidden", className),
|
|
6788
7089
|
...rest
|
|
6789
7090
|
},
|
|
6790
|
-
hasLeftTools && /* @__PURE__ */
|
|
7091
|
+
hasLeftTools && /* @__PURE__ */ import_react78.default.createElement(
|
|
6791
7092
|
ToolSidebar,
|
|
6792
7093
|
{
|
|
6793
7094
|
tools: leftToolDefs,
|
|
@@ -6796,7 +7097,7 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6796
7097
|
side: "left"
|
|
6797
7098
|
}
|
|
6798
7099
|
),
|
|
6799
|
-
isLeftPanelOpen && /* @__PURE__ */
|
|
7100
|
+
isLeftPanelOpen && /* @__PURE__ */ import_react78.default.createElement(
|
|
6800
7101
|
ToolPanelContainer,
|
|
6801
7102
|
{
|
|
6802
7103
|
topContent: renderToolContent(activeTools["top-left"]),
|
|
@@ -6807,16 +7108,16 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6807
7108
|
initialTopPercent: 30
|
|
6808
7109
|
}
|
|
6809
7110
|
),
|
|
6810
|
-
/* @__PURE__ */
|
|
7111
|
+
/* @__PURE__ */ import_react78.default.createElement("div", { className: "flex-1 flex flex-col min-w-0 relative" }, /* @__PURE__ */ import_react78.default.createElement("div", { className: cx(
|
|
6811
7112
|
"flex-1 flex flex-col min-h-0 relative",
|
|
6812
7113
|
isEmpty ? "justify-center" : "justify-start"
|
|
6813
|
-
) }, /* @__PURE__ */
|
|
7114
|
+
) }, /* @__PURE__ */ import_react78.default.createElement("div", { className: cx(
|
|
6814
7115
|
"transition-all duration-500 ease-in-out",
|
|
6815
7116
|
isEmpty ? "flex-1" : "flex-zero"
|
|
6816
|
-
) }), /* @__PURE__ */
|
|
7117
|
+
) }), /* @__PURE__ */ import_react78.default.createElement("div", { className: cx(
|
|
6817
7118
|
"transition-all duration-500 ease-in-out overflow-hidden flex flex-col",
|
|
6818
7119
|
isEmpty ? "flex-zero opacity-0" : "flex-1 opacity-100"
|
|
6819
|
-
) }, /* @__PURE__ */
|
|
7120
|
+
) }, /* @__PURE__ */ import_react78.default.createElement(
|
|
6820
7121
|
ChatView,
|
|
6821
7122
|
{
|
|
6822
7123
|
messages: displayMessages,
|
|
@@ -6825,10 +7126,10 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6825
7126
|
isThinking,
|
|
6826
7127
|
className: "flex-1"
|
|
6827
7128
|
}
|
|
6828
|
-
)), /* @__PURE__ */
|
|
7129
|
+
)), /* @__PURE__ */ import_react78.default.createElement("div", { className: cx(
|
|
6829
7130
|
"transition-all duration-500 ease-in-out z-10 w-full flex flex-col items-center",
|
|
6830
7131
|
isEmpty ? "p-4" : "shrink-0 p-4 border-t border-ash/40 bg-obsidian"
|
|
6831
|
-
) }, isEmpty && /* @__PURE__ */
|
|
7132
|
+
) }, isEmpty && /* @__PURE__ */ import_react78.default.createElement("div", { className: "mb-8 text-center animate-fade-in duration-500" }, emptyState ? emptyState : /* @__PURE__ */ import_react78.default.createElement("h1", { className: "text-4xl md:text-5xl font-heading text-gold mb-2 tracking-tight" }, "Welcome!")), /* @__PURE__ */ import_react78.default.createElement(
|
|
6832
7133
|
ChatInput,
|
|
6833
7134
|
{
|
|
6834
7135
|
position: isEmpty ? "centered" : "bottom",
|
|
@@ -6842,13 +7143,14 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6842
7143
|
attachments: propsAttachments,
|
|
6843
7144
|
onAttachmentsChange,
|
|
6844
7145
|
notice: inputNotice,
|
|
6845
|
-
onInputChange
|
|
7146
|
+
onInputChange,
|
|
7147
|
+
autoFocus
|
|
6846
7148
|
}
|
|
6847
|
-
)), /* @__PURE__ */
|
|
7149
|
+
)), /* @__PURE__ */ import_react78.default.createElement("div", { className: cx(
|
|
6848
7150
|
"transition-all duration-500 ease-in-out",
|
|
6849
7151
|
isEmpty ? "flex-1" : "flex-zero"
|
|
6850
7152
|
) }))),
|
|
6851
|
-
isRightPanelOpen && /* @__PURE__ */
|
|
7153
|
+
isRightPanelOpen && /* @__PURE__ */ import_react78.default.createElement(
|
|
6852
7154
|
ToolPanelContainer,
|
|
6853
7155
|
{
|
|
6854
7156
|
topContent: renderToolContent(activeTools["top-right"]),
|
|
@@ -6859,7 +7161,7 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6859
7161
|
initialTopPercent: 70
|
|
6860
7162
|
}
|
|
6861
7163
|
),
|
|
6862
|
-
hasRightTools && /* @__PURE__ */
|
|
7164
|
+
hasRightTools && /* @__PURE__ */ import_react78.default.createElement(
|
|
6863
7165
|
ToolSidebar,
|
|
6864
7166
|
{
|
|
6865
7167
|
tools: rightToolDefs,
|
|
@@ -6874,9 +7176,9 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6874
7176
|
ChatInterface.displayName = "ChatInterface";
|
|
6875
7177
|
|
|
6876
7178
|
// src/components/chat/MessageActions.tsx
|
|
6877
|
-
var
|
|
7179
|
+
var import_react79 = __toESM(require("react"));
|
|
6878
7180
|
var import_lucide_react15 = require("lucide-react");
|
|
6879
|
-
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */
|
|
7181
|
+
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */ import_react79.default.createElement(
|
|
6880
7182
|
"button",
|
|
6881
7183
|
{
|
|
6882
7184
|
type: "button",
|
|
@@ -6892,7 +7194,7 @@ var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @_
|
|
|
6892
7194
|
},
|
|
6893
7195
|
children
|
|
6894
7196
|
);
|
|
6895
|
-
var MessageActions =
|
|
7197
|
+
var MessageActions = import_react79.default.forwardRef(
|
|
6896
7198
|
({
|
|
6897
7199
|
variant,
|
|
6898
7200
|
content,
|
|
@@ -6904,12 +7206,12 @@ var MessageActions = import_react78.default.forwardRef(
|
|
|
6904
7206
|
className,
|
|
6905
7207
|
...rest
|
|
6906
7208
|
}, ref) => {
|
|
6907
|
-
const [localIsEditing, setLocalIsEditing] = (0,
|
|
6908
|
-
const [localEditValue, setLocalEditValue] = (0,
|
|
6909
|
-
const [copied, setCopied] = (0,
|
|
7209
|
+
const [localIsEditing, setLocalIsEditing] = (0, import_react79.useState)(false);
|
|
7210
|
+
const [localEditValue, setLocalEditValue] = (0, import_react79.useState)(content);
|
|
7211
|
+
const [copied, setCopied] = (0, import_react79.useState)(false);
|
|
6910
7212
|
const isEditing = controlledIsEditing ?? localIsEditing;
|
|
6911
7213
|
const editValue = controlledEditValue ?? localEditValue;
|
|
6912
|
-
const setIsEditing = (0,
|
|
7214
|
+
const setIsEditing = (0, import_react79.useCallback)(
|
|
6913
7215
|
(value) => {
|
|
6914
7216
|
if (onEditingChange) {
|
|
6915
7217
|
onEditingChange(value);
|
|
@@ -6919,10 +7221,10 @@ var MessageActions = import_react78.default.forwardRef(
|
|
|
6919
7221
|
},
|
|
6920
7222
|
[onEditingChange]
|
|
6921
7223
|
);
|
|
6922
|
-
const setEditValue = (0,
|
|
7224
|
+
const setEditValue = (0, import_react79.useCallback)((value) => {
|
|
6923
7225
|
setLocalEditValue(value);
|
|
6924
7226
|
}, []);
|
|
6925
|
-
const handleCopy = (0,
|
|
7227
|
+
const handleCopy = (0, import_react79.useCallback)(async () => {
|
|
6926
7228
|
try {
|
|
6927
7229
|
await navigator.clipboard.writeText(content);
|
|
6928
7230
|
setCopied(true);
|
|
@@ -6938,22 +7240,22 @@ var MessageActions = import_react78.default.forwardRef(
|
|
|
6938
7240
|
setTimeout(() => setCopied(false), 2e3);
|
|
6939
7241
|
}
|
|
6940
7242
|
}, [content]);
|
|
6941
|
-
const handleStartEdit = (0,
|
|
7243
|
+
const handleStartEdit = (0, import_react79.useCallback)(() => {
|
|
6942
7244
|
setLocalEditValue(content);
|
|
6943
7245
|
setIsEditing(true);
|
|
6944
7246
|
}, [content, setIsEditing]);
|
|
6945
|
-
const handleCancelEdit = (0,
|
|
7247
|
+
const handleCancelEdit = (0, import_react79.useCallback)(() => {
|
|
6946
7248
|
setIsEditing(false);
|
|
6947
7249
|
setLocalEditValue(content);
|
|
6948
7250
|
}, [content, setIsEditing]);
|
|
6949
|
-
const handleSubmitEdit = (0,
|
|
7251
|
+
const handleSubmitEdit = (0, import_react79.useCallback)(() => {
|
|
6950
7252
|
const trimmed = editValue.trim();
|
|
6951
7253
|
if (trimmed && trimmed !== content) {
|
|
6952
7254
|
onEdit?.(trimmed);
|
|
6953
7255
|
}
|
|
6954
7256
|
setIsEditing(false);
|
|
6955
7257
|
}, [editValue, content, onEdit, setIsEditing]);
|
|
6956
|
-
const handleEditKeyDown = (0,
|
|
7258
|
+
const handleEditKeyDown = (0, import_react79.useCallback)(
|
|
6957
7259
|
(e) => {
|
|
6958
7260
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
6959
7261
|
e.preventDefault();
|
|
@@ -6966,19 +7268,19 @@ var MessageActions = import_react78.default.forwardRef(
|
|
|
6966
7268
|
);
|
|
6967
7269
|
const isUser = variant === "user";
|
|
6968
7270
|
if (isUser && isEditing) {
|
|
6969
|
-
return /* @__PURE__ */
|
|
7271
|
+
return /* @__PURE__ */ import_react79.default.createElement(
|
|
6970
7272
|
"div",
|
|
6971
7273
|
{
|
|
6972
7274
|
ref,
|
|
6973
7275
|
className: cx("mt-2", className),
|
|
6974
7276
|
...rest
|
|
6975
7277
|
},
|
|
6976
|
-
/* @__PURE__ */
|
|
7278
|
+
/* @__PURE__ */ import_react79.default.createElement(
|
|
6977
7279
|
"div",
|
|
6978
7280
|
{
|
|
6979
7281
|
className: "relative bg-charcoal border border-ash/60 focus-within:border-gold/60 focus-within:ring-1 focus-within:ring-gold/20"
|
|
6980
7282
|
},
|
|
6981
|
-
/* @__PURE__ */
|
|
7283
|
+
/* @__PURE__ */ import_react79.default.createElement(
|
|
6982
7284
|
"textarea",
|
|
6983
7285
|
{
|
|
6984
7286
|
value: editValue,
|
|
@@ -6989,15 +7291,15 @@ var MessageActions = import_react78.default.forwardRef(
|
|
|
6989
7291
|
rows: 2
|
|
6990
7292
|
}
|
|
6991
7293
|
),
|
|
6992
|
-
/* @__PURE__ */
|
|
7294
|
+
/* @__PURE__ */ import_react79.default.createElement("div", { className: "absolute right-2 bottom-2 flex gap-1" }, /* @__PURE__ */ import_react79.default.createElement(
|
|
6993
7295
|
ActionButton2,
|
|
6994
7296
|
{
|
|
6995
7297
|
onClick: handleCancelEdit,
|
|
6996
7298
|
label: "Cancel edit",
|
|
6997
7299
|
className: "text-silver/60 hover:text-error"
|
|
6998
7300
|
},
|
|
6999
|
-
/* @__PURE__ */
|
|
7000
|
-
), /* @__PURE__ */
|
|
7301
|
+
/* @__PURE__ */ import_react79.default.createElement(import_lucide_react15.X, { className: "w-4 h-4" })
|
|
7302
|
+
), /* @__PURE__ */ import_react79.default.createElement(
|
|
7001
7303
|
ActionButton2,
|
|
7002
7304
|
{
|
|
7003
7305
|
onClick: handleSubmitEdit,
|
|
@@ -7005,13 +7307,13 @@ var MessageActions = import_react78.default.forwardRef(
|
|
|
7005
7307
|
className: "text-silver/60 hover:text-gold",
|
|
7006
7308
|
disabled: !editValue.trim() || editValue.trim() === content
|
|
7007
7309
|
},
|
|
7008
|
-
/* @__PURE__ */
|
|
7310
|
+
/* @__PURE__ */ import_react79.default.createElement(import_lucide_react15.Send, { className: "w-4 h-4" })
|
|
7009
7311
|
))
|
|
7010
7312
|
),
|
|
7011
|
-
/* @__PURE__ */
|
|
7313
|
+
/* @__PURE__ */ import_react79.default.createElement("p", { className: "text-xs text-silver/50 mt-1" }, "Press Enter to submit, Esc to cancel. This will create a new branch.")
|
|
7012
7314
|
);
|
|
7013
7315
|
}
|
|
7014
|
-
return /* @__PURE__ */
|
|
7316
|
+
return /* @__PURE__ */ import_react79.default.createElement(
|
|
7015
7317
|
"div",
|
|
7016
7318
|
{
|
|
7017
7319
|
ref,
|
|
@@ -7022,18 +7324,18 @@ var MessageActions = import_react78.default.forwardRef(
|
|
|
7022
7324
|
),
|
|
7023
7325
|
...rest
|
|
7024
7326
|
},
|
|
7025
|
-
/* @__PURE__ */
|
|
7026
|
-
isUser && onEdit && /* @__PURE__ */
|
|
7027
|
-
!isUser && onRetry && /* @__PURE__ */
|
|
7327
|
+
/* @__PURE__ */ import_react79.default.createElement(ActionButton2, { onClick: handleCopy, label: copied ? "Copied!" : "Copy message" }, copied ? /* @__PURE__ */ import_react79.default.createElement(import_lucide_react15.Check, { className: "w-3.5 h-3.5 text-success" }) : /* @__PURE__ */ import_react79.default.createElement(import_lucide_react15.Copy, { className: "w-3.5 h-3.5" })),
|
|
7328
|
+
isUser && onEdit && /* @__PURE__ */ import_react79.default.createElement(ActionButton2, { onClick: handleStartEdit, label: "Edit message" }, /* @__PURE__ */ import_react79.default.createElement(import_lucide_react15.Pencil, { className: "w-3.5 h-3.5" })),
|
|
7329
|
+
!isUser && onRetry && /* @__PURE__ */ import_react79.default.createElement(ActionButton2, { onClick: onRetry, label: "Regenerate response" }, /* @__PURE__ */ import_react79.default.createElement(import_lucide_react15.RotateCcw, { className: "w-3.5 h-3.5" }))
|
|
7028
7330
|
);
|
|
7029
7331
|
}
|
|
7030
7332
|
);
|
|
7031
7333
|
MessageActions.displayName = "MessageActions";
|
|
7032
7334
|
|
|
7033
7335
|
// src/components/chat/BranchNavigator.tsx
|
|
7034
|
-
var
|
|
7336
|
+
var import_react80 = __toESM(require("react"));
|
|
7035
7337
|
var import_lucide_react16 = require("lucide-react");
|
|
7036
|
-
var BranchNavigator =
|
|
7338
|
+
var BranchNavigator = import_react80.default.forwardRef(
|
|
7037
7339
|
({
|
|
7038
7340
|
current,
|
|
7039
7341
|
total,
|
|
@@ -7052,7 +7354,7 @@ var BranchNavigator = import_react79.default.forwardRef(
|
|
|
7052
7354
|
const buttonSize = size === "sm" ? "p-0.5" : "p-1";
|
|
7053
7355
|
const iconSize = size === "sm" ? "w-3 h-3" : "w-4 h-4";
|
|
7054
7356
|
const textSize = size === "sm" ? "text-xs" : "text-sm";
|
|
7055
|
-
return /* @__PURE__ */
|
|
7357
|
+
return /* @__PURE__ */ import_react80.default.createElement(
|
|
7056
7358
|
"div",
|
|
7057
7359
|
{
|
|
7058
7360
|
ref,
|
|
@@ -7064,8 +7366,8 @@ var BranchNavigator = import_react79.default.forwardRef(
|
|
|
7064
7366
|
"aria-label": "Branch navigation",
|
|
7065
7367
|
...rest
|
|
7066
7368
|
},
|
|
7067
|
-
showIcon && /* @__PURE__ */
|
|
7068
|
-
/* @__PURE__ */
|
|
7369
|
+
showIcon && /* @__PURE__ */ import_react80.default.createElement(import_lucide_react16.GitBranch, { className: cx(iconSize, "mr-0.5 text-silver/50"), "aria-hidden": "true" }),
|
|
7370
|
+
/* @__PURE__ */ import_react80.default.createElement(
|
|
7069
7371
|
"button",
|
|
7070
7372
|
{
|
|
7071
7373
|
type: "button",
|
|
@@ -7078,10 +7380,10 @@ var BranchNavigator = import_react79.default.forwardRef(
|
|
|
7078
7380
|
),
|
|
7079
7381
|
"aria-label": "Previous branch"
|
|
7080
7382
|
},
|
|
7081
|
-
/* @__PURE__ */
|
|
7383
|
+
/* @__PURE__ */ import_react80.default.createElement(import_lucide_react16.ChevronLeft, { className: iconSize })
|
|
7082
7384
|
),
|
|
7083
|
-
/* @__PURE__ */
|
|
7084
|
-
/* @__PURE__ */
|
|
7385
|
+
/* @__PURE__ */ import_react80.default.createElement("span", { className: cx(textSize, "tabular-nums min-w-6 text-center") }, current, "/", total),
|
|
7386
|
+
/* @__PURE__ */ import_react80.default.createElement(
|
|
7085
7387
|
"button",
|
|
7086
7388
|
{
|
|
7087
7389
|
type: "button",
|
|
@@ -7094,7 +7396,7 @@ var BranchNavigator = import_react79.default.forwardRef(
|
|
|
7094
7396
|
),
|
|
7095
7397
|
"aria-label": "Next branch"
|
|
7096
7398
|
},
|
|
7097
|
-
/* @__PURE__ */
|
|
7399
|
+
/* @__PURE__ */ import_react80.default.createElement(import_lucide_react16.ChevronRight, { className: iconSize })
|
|
7098
7400
|
)
|
|
7099
7401
|
);
|
|
7100
7402
|
}
|
|
@@ -7102,16 +7404,16 @@ var BranchNavigator = import_react79.default.forwardRef(
|
|
|
7102
7404
|
BranchNavigator.displayName = "BranchNavigator";
|
|
7103
7405
|
|
|
7104
7406
|
// src/components/BrandIcon.tsx
|
|
7105
|
-
var
|
|
7407
|
+
var import_react81 = __toESM(require("react"));
|
|
7106
7408
|
var sizeMap2 = {
|
|
7107
7409
|
sm: "h-8 w-8 text-sm",
|
|
7108
7410
|
md: "h-12 w-12 text-base",
|
|
7109
7411
|
lg: "h-16 w-16 text-lg"
|
|
7110
7412
|
};
|
|
7111
|
-
var BrandIcon =
|
|
7413
|
+
var BrandIcon = import_react81.default.forwardRef(
|
|
7112
7414
|
({ size = "md", variant = "solid", children, className, ...rest }, ref) => {
|
|
7113
7415
|
const variantClasses = variant === "solid" ? "bg-gold text-obsidian border-2 border-gold" : "bg-transparent text-gold border-2 border-gold";
|
|
7114
|
-
return /* @__PURE__ */
|
|
7416
|
+
return /* @__PURE__ */ import_react81.default.createElement(
|
|
7115
7417
|
"div",
|
|
7116
7418
|
{
|
|
7117
7419
|
ref,
|
|
@@ -7130,17 +7432,17 @@ var BrandIcon = import_react80.default.forwardRef(
|
|
|
7130
7432
|
BrandIcon.displayName = "BrandIcon";
|
|
7131
7433
|
|
|
7132
7434
|
// src/components/ColorSwatch.tsx
|
|
7133
|
-
var
|
|
7134
|
-
var ColorSwatch =
|
|
7435
|
+
var import_react82 = __toESM(require("react"));
|
|
7436
|
+
var ColorSwatch = import_react82.default.forwardRef(
|
|
7135
7437
|
({ color, label, className, ...rest }, ref) => {
|
|
7136
|
-
return /* @__PURE__ */
|
|
7438
|
+
return /* @__PURE__ */ import_react82.default.createElement(
|
|
7137
7439
|
"div",
|
|
7138
7440
|
{
|
|
7139
7441
|
ref,
|
|
7140
7442
|
className: cx("flex flex-col items-center gap-2", className),
|
|
7141
7443
|
...rest
|
|
7142
7444
|
},
|
|
7143
|
-
/* @__PURE__ */
|
|
7445
|
+
/* @__PURE__ */ import_react82.default.createElement(
|
|
7144
7446
|
"div",
|
|
7145
7447
|
{
|
|
7146
7448
|
className: "h-16 w-16 border-2 border-ash rounded-none shadow-sm",
|
|
@@ -7148,22 +7450,22 @@ var ColorSwatch = import_react81.default.forwardRef(
|
|
|
7148
7450
|
"aria-label": label || color
|
|
7149
7451
|
}
|
|
7150
7452
|
),
|
|
7151
|
-
label && /* @__PURE__ */
|
|
7453
|
+
label && /* @__PURE__ */ import_react82.default.createElement("span", { className: "text-xs text-silver font-medium" }, label)
|
|
7152
7454
|
);
|
|
7153
7455
|
}
|
|
7154
7456
|
);
|
|
7155
7457
|
ColorSwatch.displayName = "ColorSwatch";
|
|
7156
7458
|
|
|
7157
7459
|
// src/components/SectionHeading.tsx
|
|
7158
|
-
var
|
|
7460
|
+
var import_react83 = __toESM(require("react"));
|
|
7159
7461
|
var levelStyles = {
|
|
7160
7462
|
h2: "text-2xl mb-4",
|
|
7161
7463
|
h3: "text-xl mb-3"
|
|
7162
7464
|
};
|
|
7163
|
-
var SectionHeading =
|
|
7465
|
+
var SectionHeading = import_react83.default.forwardRef(
|
|
7164
7466
|
({ level = "h2", children, className, ...rest }, ref) => {
|
|
7165
7467
|
const Component = level;
|
|
7166
|
-
return /* @__PURE__ */
|
|
7468
|
+
return /* @__PURE__ */ import_react83.default.createElement(
|
|
7167
7469
|
Component,
|
|
7168
7470
|
{
|
|
7169
7471
|
ref,
|
|
@@ -7235,6 +7537,7 @@ var version = "2.0.0";
|
|
|
7235
7537
|
FileChip,
|
|
7236
7538
|
HelperText,
|
|
7237
7539
|
HistoryIcon,
|
|
7540
|
+
HistoryPanel,
|
|
7238
7541
|
ImageCard,
|
|
7239
7542
|
Input,
|
|
7240
7543
|
InputGroup,
|