@blank-utils/llm 0.3.19 → 0.3.20
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/{chunk-UGYWT6UB.js → chunk-7YC6ECAU.js} +97 -96
- package/dist/index.css +244 -402
- package/dist/index.js +1 -1
- package/dist/react/index.css +244 -402
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
|
@@ -1006,7 +1006,7 @@ ${newText}` : newText);
|
|
|
1006
1006
|
return /* @__PURE__ */ jsxs2(
|
|
1007
1007
|
"div",
|
|
1008
1008
|
{
|
|
1009
|
-
className: `relative flex flex-col bg-
|
|
1009
|
+
className: `relative flex flex-col bg-black border border-white/30 rounded-none focus-within:border-white/60 transition-colors p-3 font-mono ${className}`,
|
|
1010
1010
|
onDragOver: (e) => {
|
|
1011
1011
|
e.preventDefault();
|
|
1012
1012
|
setIsDragging(true);
|
|
@@ -1014,9 +1014,9 @@ ${newText}` : newText);
|
|
|
1014
1014
|
onDragLeave: () => setIsDragging(false),
|
|
1015
1015
|
onDrop: handleDrop,
|
|
1016
1016
|
children: [
|
|
1017
|
-
isDragging && /* @__PURE__ */ jsxs2("div", { className: "absolute inset-x-0 inset-y-0 bg-
|
|
1018
|
-
/* @__PURE__ */ jsx2(ImagePlus, { className: "w-8 h-8 text-
|
|
1019
|
-
/* @__PURE__ */ jsx2("span", { className: "text-
|
|
1017
|
+
isDragging && /* @__PURE__ */ jsxs2("div", { className: "absolute inset-x-0 inset-y-0 bg-black/90 flex flex-col items-center justify-center z-20 border border-dashed border-white/50 rounded-none m-1", children: [
|
|
1018
|
+
/* @__PURE__ */ jsx2(ImagePlus, { className: "w-8 h-8 text-white mb-2" }),
|
|
1019
|
+
/* @__PURE__ */ jsx2("span", { className: "text-white font-light tracking-widest uppercase text-xs", children: "Drop file to attach" })
|
|
1020
1020
|
] }),
|
|
1021
1021
|
/* @__PURE__ */ jsx2(
|
|
1022
1022
|
"input",
|
|
@@ -1029,13 +1029,13 @@ ${newText}` : newText);
|
|
|
1029
1029
|
onChange: handleFileSelect
|
|
1030
1030
|
}
|
|
1031
1031
|
),
|
|
1032
|
-
images.length > 0 && /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap gap-2 mb-
|
|
1033
|
-
/* @__PURE__ */ jsx2("img", { src: img.dataUrl, alt: "attachment", className: "w-full h-full object-cover grayscale
|
|
1032
|
+
images.length > 0 && /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap gap-2 mb-3", children: images.map((img) => /* @__PURE__ */ jsxs2("div", { className: "relative w-16 h-16 overflow-hidden border border-white/30 rounded-none group select-none", children: [
|
|
1033
|
+
/* @__PURE__ */ jsx2("img", { src: img.dataUrl, alt: "attachment", className: "w-full h-full object-cover grayscale transition-all group-hover:grayscale-0" }),
|
|
1034
1034
|
/* @__PURE__ */ jsx2(
|
|
1035
1035
|
"button",
|
|
1036
1036
|
{
|
|
1037
1037
|
type: "button",
|
|
1038
|
-
className: "absolute top-0 right-0 w-
|
|
1038
|
+
className: "absolute top-0 right-0 w-5 h-5 bg-black/80 text-white border-l border-b border-white/30 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1039
1039
|
onClick: () => onImageRemove?.(img.id),
|
|
1040
1040
|
children: /* @__PURE__ */ jsx2(X, { className: "w-3 h-3" })
|
|
1041
1041
|
}
|
|
@@ -1052,17 +1052,17 @@ ${newText}` : newText);
|
|
|
1052
1052
|
placeholder,
|
|
1053
1053
|
disabled: disabled && !isGenerating,
|
|
1054
1054
|
rows: 1,
|
|
1055
|
-
className: "w-full min-h-[24px] max-h-[200px] resize-none border-none outline-none bg-transparent text-
|
|
1055
|
+
className: "w-full min-h-[24px] max-h-[200px] resize-none border-none outline-none bg-transparent text-white text-sm font-light font-mono leading-relaxed p-0 m-0 placeholder:text-white/30 placeholder:uppercase placeholder:tracking-widest scrollbar-thin scrollbar-thumb-white/20 scrollbar-track-transparent"
|
|
1056
1056
|
}
|
|
1057
1057
|
),
|
|
1058
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-
|
|
1059
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-
|
|
1058
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between mt-3 pt-3 border-t border-white/10", children: [
|
|
1059
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
|
|
1060
1060
|
modelSelector && /* @__PURE__ */ jsx2("div", { className: "mr-2", children: modelSelector }),
|
|
1061
1061
|
/* @__PURE__ */ jsx2(
|
|
1062
1062
|
"button",
|
|
1063
1063
|
{
|
|
1064
1064
|
type: "button",
|
|
1065
|
-
className: "flex items-center justify-center
|
|
1065
|
+
className: "flex items-center justify-center w-8 h-8 rounded-none text-white/50 hover:text-white transition-colors",
|
|
1066
1066
|
onClick: () => fileInputRef.current?.click(),
|
|
1067
1067
|
title: "Attach image or PDF (Ctrl+V to paste)",
|
|
1068
1068
|
children: /* @__PURE__ */ jsx2(ImagePlus, { className: "w-4 h-4" })
|
|
@@ -1070,25 +1070,25 @@ ${newText}` : newText);
|
|
|
1070
1070
|
),
|
|
1071
1071
|
actions
|
|
1072
1072
|
] }),
|
|
1073
|
-
/* @__PURE__ */ jsx2("div", { className: "flex items-center gap-
|
|
1073
|
+
/* @__PURE__ */ jsx2("div", { className: "flex items-center gap-2", children: isGenerating ? /* @__PURE__ */ jsxs2(
|
|
1074
1074
|
"button",
|
|
1075
1075
|
{
|
|
1076
1076
|
type: "button",
|
|
1077
|
-
className: "flex items-center justify-center text-red-500 hover:
|
|
1077
|
+
className: "flex items-center justify-center h-8 px-4 rounded-none border border-red-500/50 bg-red-500/10 text-red-500 hover:bg-red-500/20 font-light text-[10px] uppercase tracking-widest transition-colors gap-2 cursor-pointer",
|
|
1078
1078
|
onClick: onStop,
|
|
1079
1079
|
children: [
|
|
1080
|
-
/* @__PURE__ */ jsx2(Square, { className: "w-
|
|
1081
|
-
"
|
|
1080
|
+
/* @__PURE__ */ jsx2(Square, { className: "w-3 h-3 fill-current" }),
|
|
1081
|
+
" STOP"
|
|
1082
1082
|
]
|
|
1083
1083
|
}
|
|
1084
1084
|
) : /* @__PURE__ */ jsx2(
|
|
1085
1085
|
"button",
|
|
1086
1086
|
{
|
|
1087
1087
|
type: "button",
|
|
1088
|
-
className: `flex items-center justify-center font-
|
|
1088
|
+
className: `flex items-center justify-center h-8 px-4 rounded-none border text-[10px] font-light uppercase tracking-widest transition-colors gap-2 ${canSend ? "border-white/30 bg-transparent text-white hover:bg-white hover:text-black cursor-pointer" : "border-white/10 bg-transparent text-white/20 cursor-not-allowed"}`,
|
|
1089
1089
|
onClick: onSend,
|
|
1090
1090
|
disabled: !canSend,
|
|
1091
|
-
children: "
|
|
1091
|
+
children: "SEND"
|
|
1092
1092
|
}
|
|
1093
1093
|
) })
|
|
1094
1094
|
] })
|
|
@@ -1098,7 +1098,7 @@ ${newText}` : newText);
|
|
|
1098
1098
|
}
|
|
1099
1099
|
|
|
1100
1100
|
// src/react/components.tsx
|
|
1101
|
-
import { ChevronDown, AlertCircle } from "lucide-react";
|
|
1101
|
+
import { RotateCcw, ChevronDown, AlertCircle } from "lucide-react";
|
|
1102
1102
|
import { clsx } from "clsx";
|
|
1103
1103
|
import { twMerge } from "tailwind-merge";
|
|
1104
1104
|
import { Streamdown, parseMarkdownIntoBlocks } from "streamdown";
|
|
@@ -1163,20 +1163,20 @@ function isVisionModel2(modelId) {
|
|
|
1163
1163
|
return lower.includes("vl") || lower.includes("vision") || lower.includes("moondream");
|
|
1164
1164
|
}
|
|
1165
1165
|
var markdownComponents = {
|
|
1166
|
-
h1: ({ children }) => /* @__PURE__ */ jsx3("h1", { className: "text-
|
|
1167
|
-
h2: ({ children }) => /* @__PURE__ */ jsx3("h2", { className: "text-
|
|
1168
|
-
h3: ({ children }) => /* @__PURE__ */ jsx3("h3", { className: "text-
|
|
1169
|
-
h4: ({ children }) => /* @__PURE__ */ jsx3("h4", { className: "text-
|
|
1170
|
-
p: ({ children }) => /* @__PURE__ */ jsx3("p", { className: "leading-relaxed [&:not(:first-child)]:mt-
|
|
1171
|
-
ul: ({ children }) => /* @__PURE__ */ jsx3("ul", { className: "my-
|
|
1172
|
-
ol: ({ children }) => /* @__PURE__ */ jsx3("ol", { className: "my-
|
|
1166
|
+
h1: ({ children }) => /* @__PURE__ */ jsx3("h1", { className: "text-2xl font-light uppercase tracking-tight mt-6 mb-4 text-white border-b border-white/30 pb-2", children }),
|
|
1167
|
+
h2: ({ children }) => /* @__PURE__ */ jsx3("h2", { className: "text-xl font-light uppercase tracking-tight mt-6 mb-4 text-white border-b border-white/30 pb-2", children }),
|
|
1168
|
+
h3: ({ children }) => /* @__PURE__ */ jsx3("h3", { className: "text-lg font-light uppercase tracking-tight mt-4 mb-3 text-white", children }),
|
|
1169
|
+
h4: ({ children }) => /* @__PURE__ */ jsx3("h4", { className: "text-base font-light uppercase tracking-tight mt-4 mb-2 text-white", children }),
|
|
1170
|
+
p: ({ children }) => /* @__PURE__ */ jsx3("p", { className: "leading-relaxed [&:not(:first-child)]:mt-4 text-white/80 text-sm font-light font-mono", children }),
|
|
1171
|
+
ul: ({ children }) => /* @__PURE__ */ jsx3("ul", { className: "my-4 ml-6 list-square [&>li]:mt-2 text-white/80 font-mono text-sm font-light", children }),
|
|
1172
|
+
ol: ({ children }) => /* @__PURE__ */ jsx3("ol", { className: "my-4 ml-6 list-decimal [&>li]:mt-2 text-white/80 font-mono text-sm font-light", children }),
|
|
1173
1173
|
li: ({ children }) => /* @__PURE__ */ jsx3("li", { children }),
|
|
1174
|
-
blockquote: ({ children }) => /* @__PURE__ */ jsx3("blockquote", { className: "mt-
|
|
1175
|
-
a: ({ href, children }) => /* @__PURE__ */ jsx3("a", { href, className: "underline
|
|
1176
|
-
table: ({ children }) => /* @__PURE__ */ jsx3("div", { className: "my-
|
|
1177
|
-
tr: ({ children }) => /* @__PURE__ */ jsx3("tr", { className: "m-0 border-b border-
|
|
1178
|
-
th: ({ children }) => /* @__PURE__ */ jsx3("th", { className: "
|
|
1179
|
-
td: ({ children }) => /* @__PURE__ */ jsx3("td", { className: "px-4 py-
|
|
1174
|
+
blockquote: ({ children }) => /* @__PURE__ */ jsx3("blockquote", { className: "mt-4 border border-white/30 p-4 italic text-white/60 font-mono text-sm font-light bg-transparent", children }),
|
|
1175
|
+
a: ({ href, children }) => /* @__PURE__ */ jsx3("a", { href, className: "underline text-white hover:bg-white hover:text-black transition-colors", target: "_blank", rel: "noopener noreferrer", children }),
|
|
1176
|
+
table: ({ children }) => /* @__PURE__ */ jsx3("div", { className: "my-4 w-full overflow-y-auto border border-white/30", children: /* @__PURE__ */ jsx3("table", { className: "w-full text-sm font-mono font-light text-white", children }) }),
|
|
1177
|
+
tr: ({ children }) => /* @__PURE__ */ jsx3("tr", { className: "m-0 border-b border-white/30 p-0 hover:bg-white/5", children }),
|
|
1178
|
+
th: ({ children }) => /* @__PURE__ */ jsx3("th", { className: "border-r border-white/30 last:border-r-0 text-white/50 px-4 py-2 font-light uppercase text-left", children }),
|
|
1179
|
+
td: ({ children }) => /* @__PURE__ */ jsx3("td", { className: "border-r border-white/30 last:border-r-0 px-4 py-2 text-left text-white/80", children })
|
|
1180
1180
|
};
|
|
1181
1181
|
function ModelSelector({
|
|
1182
1182
|
currentModel,
|
|
@@ -1207,22 +1207,22 @@ function ModelSelector({
|
|
|
1207
1207
|
"button",
|
|
1208
1208
|
{
|
|
1209
1209
|
type: "button",
|
|
1210
|
-
className: "flex items-center gap-2 px-
|
|
1210
|
+
className: "flex items-center gap-2 px-3 py-1.5 border border-white/30 bg-transparent text-white hover:bg-white hover:text-black text-xs font-light uppercase tracking-widest transition-colors",
|
|
1211
1211
|
onClick: () => setIsOpen(!isOpen),
|
|
1212
1212
|
children: [
|
|
1213
1213
|
/* @__PURE__ */ jsx3("span", { children: displayModel }),
|
|
1214
|
-
/* @__PURE__ */ jsx3(ChevronDown, { className: "w-
|
|
1214
|
+
/* @__PURE__ */ jsx3(ChevronDown, { className: "w-4 h-4" })
|
|
1215
1215
|
]
|
|
1216
1216
|
}
|
|
1217
1217
|
),
|
|
1218
|
-
isOpen && /* @__PURE__ */ jsxs3("div", { className: "absolute top-[calc(100%+8px)] left-0 w-72 max-h-[300px] overflow-y-auto bg-
|
|
1219
|
-
/* @__PURE__ */ jsx3("div", { className: "px-3 py-2 text-[
|
|
1218
|
+
isOpen && /* @__PURE__ */ jsxs3("div", { className: "absolute top-[calc(100%+8px)] left-0 w-72 max-h-[300px] overflow-y-auto bg-black border border-white/30 z-50 p-2 scrollbar-none", children: [
|
|
1219
|
+
/* @__PURE__ */ jsx3("div", { className: "px-3 py-2 text-[10px] font-light text-white/50 uppercase tracking-widest border-b border-white/10 mb-1", children: "WebLLM" }),
|
|
1220
1220
|
Object.entries(WEBLLM_MODELS).map(([key, value]) => /* @__PURE__ */ jsxs3(
|
|
1221
1221
|
"button",
|
|
1222
1222
|
{
|
|
1223
1223
|
className: cn(
|
|
1224
|
-
"block w-full text-left px-3 py-2 text-
|
|
1225
|
-
currentModel === value ? "bg-
|
|
1224
|
+
"block w-full text-left px-3 py-2.5 text-xs font-light uppercase tracking-wider truncate transition-colors",
|
|
1225
|
+
currentModel === value ? "bg-white text-black" : "text-white hover:bg-white/10"
|
|
1226
1226
|
),
|
|
1227
1227
|
onClick: () => {
|
|
1228
1228
|
onSelect(value);
|
|
@@ -1231,18 +1231,18 @@ function ModelSelector({
|
|
|
1231
1231
|
children: [
|
|
1232
1232
|
key,
|
|
1233
1233
|
" ",
|
|
1234
|
-
isVisionModel2(value) && /* @__PURE__ */ jsx3("span", { className: "ml-2
|
|
1234
|
+
isVisionModel2(value) && /* @__PURE__ */ jsx3("span", { className: "ml-2 px-1.5 py-0.5 border border-current text-[9px]", children: "VISION" })
|
|
1235
1235
|
]
|
|
1236
1236
|
},
|
|
1237
1237
|
key
|
|
1238
1238
|
)),
|
|
1239
|
-
/* @__PURE__ */ jsx3("div", { className: "px-3 py-2 text-[
|
|
1239
|
+
/* @__PURE__ */ jsx3("div", { className: "px-3 py-2 text-[10px] font-light text-white/50 uppercase tracking-widest mt-4 border-b border-white/10 mb-1", children: "Transformers.js" }),
|
|
1240
1240
|
Object.entries(TRANSFORMERS_MODELS).map(([key, value]) => /* @__PURE__ */ jsxs3(
|
|
1241
1241
|
"button",
|
|
1242
1242
|
{
|
|
1243
1243
|
className: cn(
|
|
1244
|
-
"block w-full text-left px-3 py-2 text-
|
|
1245
|
-
currentModel === value ? "bg-
|
|
1244
|
+
"block w-full text-left px-3 py-2.5 text-xs font-light uppercase tracking-wider truncate transition-colors",
|
|
1245
|
+
currentModel === value ? "bg-white text-black" : "text-white hover:bg-white/10"
|
|
1246
1246
|
),
|
|
1247
1247
|
onClick: () => {
|
|
1248
1248
|
onSelect(value);
|
|
@@ -1251,7 +1251,7 @@ function ModelSelector({
|
|
|
1251
1251
|
children: [
|
|
1252
1252
|
key,
|
|
1253
1253
|
" ",
|
|
1254
|
-
isVisionModel2(value) && /* @__PURE__ */ jsx3("span", { className: "ml-2
|
|
1254
|
+
isVisionModel2(value) && /* @__PURE__ */ jsx3("span", { className: "ml-2 px-1.5 py-0.5 border border-current text-[9px]", children: "VISION" })
|
|
1255
1255
|
]
|
|
1256
1256
|
},
|
|
1257
1257
|
key
|
|
@@ -1394,80 +1394,66 @@ ${systemPrompt}` : systemPrompt;
|
|
|
1394
1394
|
setStreamingText("");
|
|
1395
1395
|
}
|
|
1396
1396
|
};
|
|
1397
|
-
return /* @__PURE__ */ jsxs3("div", { className: cn("flex flex-col bg-
|
|
1398
|
-
showHeader && /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4
|
|
1397
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn("flex flex-col bg-black text-white font-mono rounded-none overflow-hidden", className), style: { maxHeight, height: "100%" }, children: [
|
|
1398
|
+
showHeader && /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4 bg-black border-b border-white/30", children: [
|
|
1399
1399
|
onModelChange ? /* @__PURE__ */ jsx3(
|
|
1400
1400
|
ModelSelector,
|
|
1401
1401
|
{
|
|
1402
1402
|
currentModel: modelId,
|
|
1403
1403
|
onSelect: onModelChange
|
|
1404
1404
|
}
|
|
1405
|
-
) : /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
|
|
1406
|
-
/* @__PURE__ */ jsx3("span", { className: "text-
|
|
1407
|
-
modelId && isVisionModel2(modelId) && /* @__PURE__ */ jsx3("span", { className: "text-[9px] font-
|
|
1405
|
+
) : /* @__PURE__ */ jsxs3("div", { className: "px-3 py-1.5 border border-white/30 flex items-center gap-3", children: [
|
|
1406
|
+
/* @__PURE__ */ jsx3("span", { className: "text-xs font-light uppercase tracking-widest text-white", children: modelId?.split("/").pop() }),
|
|
1407
|
+
modelId && isVisionModel2(modelId) && /* @__PURE__ */ jsx3("span", { className: "px-1.5 py-0.5 border border-white/30 text-[9px] font-light uppercase tracking-widest text-white bg-transparent", children: "VISION" })
|
|
1408
1408
|
] }),
|
|
1409
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-
|
|
1410
|
-
/* @__PURE__ */ jsx3("span", { className: "text-[10px] font-
|
|
1409
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
|
|
1410
|
+
/* @__PURE__ */ jsx3("span", { className: "text-[10px] font-light tracking-widest text-white uppercase opacity-70", children: error ? "ERR" : isReady ? "RDY" : isLoading ? "LOD" : "IDL" }),
|
|
1411
1411
|
/* @__PURE__ */ jsx3("div", { className: cn(
|
|
1412
|
-
"w-
|
|
1413
|
-
error ? "bg-red-500" : isReady ? "bg-
|
|
1412
|
+
"w-2 h-2 rounded-none",
|
|
1413
|
+
error ? "bg-red-500" : isReady ? "bg-white" : "bg-white/30 animate-pulse"
|
|
1414
1414
|
) })
|
|
1415
1415
|
] })
|
|
1416
1416
|
] }),
|
|
1417
|
-
showProgress && isLoading && loadProgress && /* @__PURE__ */ jsxs3("div", { className: "px-6 py-4 border-b border-
|
|
1418
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-center mb-2 font-mono uppercase tracking-
|
|
1419
|
-
/* @__PURE__ */ jsx3("span", { className: "truncate pr-4", children: loadProgress.status }),
|
|
1420
|
-
/* @__PURE__ */ jsxs3("span", { children: [
|
|
1417
|
+
showProgress && isLoading && loadProgress && /* @__PURE__ */ jsxs3("div", { className: "px-6 py-4 border-b border-white/30 bg-black", children: [
|
|
1418
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-center mb-2 font-mono uppercase tracking-widest text-[10px]", children: [
|
|
1419
|
+
/* @__PURE__ */ jsx3("span", { className: "text-white/70 font-light truncate pr-4", children: loadProgress.status }),
|
|
1420
|
+
/* @__PURE__ */ jsxs3("span", { className: "font-light text-white/70", children: [
|
|
1421
1421
|
Math.round(loadProgress.progress),
|
|
1422
1422
|
"%"
|
|
1423
1423
|
] })
|
|
1424
1424
|
] }),
|
|
1425
|
-
/* @__PURE__ */ jsx3("div", { className: "h-
|
|
1425
|
+
/* @__PURE__ */ jsx3("div", { className: "h-1 w-full bg-white/10 rounded-none overflow-hidden relative", children: /* @__PURE__ */ jsx3(
|
|
1426
1426
|
"div",
|
|
1427
1427
|
{
|
|
1428
|
-
className: "h-full bg-
|
|
1428
|
+
className: "h-full bg-white transition-all duration-300 ease-out",
|
|
1429
1429
|
style: { width: `${Math.min(100, loadProgress.progress)}%` }
|
|
1430
1430
|
}
|
|
1431
1431
|
) })
|
|
1432
1432
|
] }),
|
|
1433
|
-
error && /* @__PURE__ */ jsxs3("div", { className: "flex flex-col sm:flex-row items-start sm:items-center justify-between mx-6 mt-6 p-4 border border-red-500/
|
|
1434
|
-
/* @__PURE__ */ jsx3("span", { className: "text-[
|
|
1435
|
-
/* @__PURE__ */
|
|
1433
|
+
error && /* @__PURE__ */ jsxs3("div", { className: "flex flex-col sm:flex-row items-start sm:items-center justify-between mx-6 mt-6 p-4 border border-red-500/50 bg-red-500/10 rounded-none gap-4", children: [
|
|
1434
|
+
/* @__PURE__ */ jsx3("span", { className: "text-[10px] text-red-500 font-light uppercase tracking-wider", children: error.message }),
|
|
1435
|
+
/* @__PURE__ */ jsxs3(
|
|
1436
1436
|
"button",
|
|
1437
1437
|
{
|
|
1438
|
-
className: "
|
|
1438
|
+
className: "flex items-center gap-2 px-3 py-1.5 bg-transparent text-red-500 border border-red-500/50 hover:bg-red-500/20 transition-colors rounded-none text-[10px] font-light uppercase tracking-widest",
|
|
1439
1439
|
onClick: reload,
|
|
1440
|
-
children:
|
|
1440
|
+
children: [
|
|
1441
|
+
/* @__PURE__ */ jsx3(RotateCcw, { className: "w-3 h-3" }),
|
|
1442
|
+
" REBOOT"
|
|
1443
|
+
]
|
|
1441
1444
|
}
|
|
1442
1445
|
)
|
|
1443
1446
|
] }),
|
|
1444
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex-1 overflow-y-auto
|
|
1445
|
-
!isLoading && messages.length === 0 && !error && /* @__PURE__ */ jsxs3("div", { className: "flex-1 flex flex-col items-center justify-center text-center mt-12 mb-8", children: [
|
|
1446
|
-
/* @__PURE__ */ jsx3("
|
|
1447
|
-
/* @__PURE__ */ jsx3("
|
|
1447
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex-1 overflow-y-auto p-6 flex flex-col gap-6 scrollbar-thin scrollbar-thumb-white/20 scrollbar-track-transparent", children: [
|
|
1448
|
+
!isLoading && messages.length === 0 && !error && /* @__PURE__ */ jsxs3("div", { className: "flex-1 flex flex-col items-center justify-center text-center mt-12 mb-8 p-8 border border-white/10", children: [
|
|
1449
|
+
/* @__PURE__ */ jsx3("div", { className: "w-16 h-16 border border-white/30 mb-6 flex items-center justify-center text-xl font-light bg-transparent text-white/50", children: "//" }),
|
|
1450
|
+
/* @__PURE__ */ jsx3("h3", { className: "text-xl font-light uppercase tracking-widest text-white/70 mb-4", children: "SYSTEM READY" }),
|
|
1451
|
+
/* @__PURE__ */ jsx3("p", { className: "text-white/40 max-w-sm uppercase text-[10px] leading-relaxed tracking-widest font-light", children: "[ MARKDOWN | MATH | MERMAID ] INITIALIZED. AWAITING INPUT." })
|
|
1448
1452
|
] }),
|
|
1449
|
-
messages.map((msg, i) => /* @__PURE__ */
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
" ]"
|
|
1454
|
-
] }),
|
|
1455
|
-
msg.role === "user" ? /* @__PURE__ */ jsxs3("div", { className: "text-black dark:text-white", children: [
|
|
1456
|
-
msg.images && msg.images.length > 0 && /* @__PURE__ */ jsx3("div", { className: "flex flex-wrap gap-2 mb-4", children: msg.images.map((img) => /* @__PURE__ */ jsx3("img", { src: img.dataUrl, className: "w-20 h-20 object-cover grayscale opacity-80", alt: "attachment" }, img.id)) }),
|
|
1457
|
-
/* @__PURE__ */ jsx3("div", { className: "prose prose-sm dark:prose-invert max-w-none font-mono font-light text-[13px] tracking-wide prose-pre:!bg-black/5 dark:prose-pre:!bg-white/5 prose-pre:!p-4 prose-pre:!rounded-none prose-pre:!border-none prose-img:!rounded-none prose-img:grayscale", children: /* @__PURE__ */ jsx3(
|
|
1458
|
-
Streamdown,
|
|
1459
|
-
{
|
|
1460
|
-
plugins: { code, mermaid, math },
|
|
1461
|
-
components: markdownComponents,
|
|
1462
|
-
animated: true,
|
|
1463
|
-
isAnimating: false,
|
|
1464
|
-
mermaid: mermaidOptions,
|
|
1465
|
-
controls: streamdownControls,
|
|
1466
|
-
parseMarkdownIntoBlocksFn: sanitizeMarkdownLanguageBlocks,
|
|
1467
|
-
children: msg.content
|
|
1468
|
-
}
|
|
1469
|
-
) })
|
|
1470
|
-
] }) : /* @__PURE__ */ jsx3("div", { className: "prose prose-sm dark:prose-invert max-w-none font-mono font-light text-[13px] tracking-wide prose-pre:!bg-black/5 dark:prose-pre:!bg-white/5 prose-pre:!p-4 prose-pre:!rounded-none prose-pre:!border-none prose-pre:!m-0 prose-img:!rounded-none prose-img:grayscale", children: /* @__PURE__ */ jsx3(
|
|
1453
|
+
messages.map((msg, i) => /* @__PURE__ */ jsx3("div", { className: "flex flex-col w-full", children: msg.role === "user" ? /* @__PURE__ */ jsxs3("div", { className: "bg-transparent text-white/50 px-4 py-4 border border-white/10 rounded-none w-full", children: [
|
|
1454
|
+
/* @__PURE__ */ jsx3("div", { className: "mb-2 text-[10px] tracking-widest uppercase opacity-50", children: "USER" }),
|
|
1455
|
+
msg.images && msg.images.length > 0 && /* @__PURE__ */ jsx3("div", { className: "flex flex-wrap gap-3 mb-4", children: msg.images.map((img) => /* @__PURE__ */ jsx3("img", { src: img.dataUrl, className: "w-24 h-24 object-cover border border-white/30", alt: "attachment" }, img.id)) }),
|
|
1456
|
+
/* @__PURE__ */ jsx3("div", { className: "prose prose-base dark:prose-invert max-w-none font-mono", children: /* @__PURE__ */ jsx3(
|
|
1471
1457
|
Streamdown,
|
|
1472
1458
|
{
|
|
1473
1459
|
plugins: { code, mermaid, math },
|
|
@@ -1480,10 +1466,25 @@ ${systemPrompt}` : systemPrompt;
|
|
|
1480
1466
|
children: msg.content
|
|
1481
1467
|
}
|
|
1482
1468
|
) })
|
|
1483
|
-
] },
|
|
1484
|
-
|
|
1485
|
-
/* @__PURE__ */ jsx3(
|
|
1486
|
-
|
|
1469
|
+
] }) : /* @__PURE__ */ jsxs3("div", { className: "prose prose-base dark:prose-invert max-w-none px-4 py-4 w-full min-w-0 font-mono border border-white/10 bg-transparent mt-1", children: [
|
|
1470
|
+
/* @__PURE__ */ jsx3("div", { className: "mb-2 text-[10px] tracking-widest uppercase opacity-50 text-white", children: "SYSTEM" }),
|
|
1471
|
+
/* @__PURE__ */ jsx3(
|
|
1472
|
+
Streamdown,
|
|
1473
|
+
{
|
|
1474
|
+
plugins: { code, mermaid, math },
|
|
1475
|
+
components: markdownComponents,
|
|
1476
|
+
animated: true,
|
|
1477
|
+
isAnimating: false,
|
|
1478
|
+
mermaid: mermaidOptions,
|
|
1479
|
+
controls: streamdownControls,
|
|
1480
|
+
parseMarkdownIntoBlocksFn: sanitizeMarkdownLanguageBlocks,
|
|
1481
|
+
children: msg.content
|
|
1482
|
+
}
|
|
1483
|
+
)
|
|
1484
|
+
] }) }, i)),
|
|
1485
|
+
streamingText && /* @__PURE__ */ jsx3("div", { className: "flex flex-col w-full mt-1", children: /* @__PURE__ */ jsxs3("div", { className: "prose prose-base dark:prose-invert max-w-none px-4 py-4 w-full min-w-0 font-mono border border-white/10 bg-transparent", children: [
|
|
1486
|
+
/* @__PURE__ */ jsx3("div", { className: "mb-2 text-[10px] tracking-widest uppercase opacity-50 text-white", children: "SYSTEM" }),
|
|
1487
|
+
/* @__PURE__ */ jsx3(
|
|
1487
1488
|
Streamdown,
|
|
1488
1489
|
{
|
|
1489
1490
|
plugins: { code, mermaid, math },
|
|
@@ -1496,11 +1497,11 @@ ${systemPrompt}` : systemPrompt;
|
|
|
1496
1497
|
caret: "block",
|
|
1497
1498
|
children: streamingText
|
|
1498
1499
|
}
|
|
1499
|
-
)
|
|
1500
|
-
] }),
|
|
1500
|
+
)
|
|
1501
|
+
] }) }),
|
|
1501
1502
|
/* @__PURE__ */ jsx3("div", { ref: messagesEndRef, className: "h-4" })
|
|
1502
1503
|
] }),
|
|
1503
|
-
/* @__PURE__ */ jsx3("div", { className: "p-
|
|
1504
|
+
/* @__PURE__ */ jsx3("div", { className: "p-4 bg-black border-t border-white/30", children: /* @__PURE__ */ jsx3(
|
|
1504
1505
|
ChatInput,
|
|
1505
1506
|
{
|
|
1506
1507
|
value: input,
|
|
@@ -1509,7 +1510,7 @@ ${systemPrompt}` : systemPrompt;
|
|
|
1509
1510
|
onStop: handleStop,
|
|
1510
1511
|
disabled: !isReady && !isLoading,
|
|
1511
1512
|
isGenerating,
|
|
1512
|
-
placeholder: isLoading ? "
|
|
1513
|
+
placeholder: isLoading ? "MODEL IS LOADING..." : "MESSAGE...",
|
|
1513
1514
|
actions: inputActions,
|
|
1514
1515
|
images,
|
|
1515
1516
|
onImageAdd: (img) => setImages((prev) => [...prev, img]),
|