@blank-utils/llm 0.3.17 → 0.3.19

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.
@@ -894,7 +894,7 @@ import { useRef as useRef3, useEffect as useEffect3, useState as useState3, useM
894
894
  // src/react/chat-input.tsx
895
895
  import "react";
896
896
  import { useRef as useRef2, useEffect as useEffect2, useCallback as useCallback2, useState as useState2 } from "react";
897
- import { Send, Square, ImagePlus, X } from "lucide-react";
897
+ import { Square, ImagePlus, X } from "lucide-react";
898
898
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
899
899
  function ChatInput({
900
900
  value,
@@ -1006,7 +1006,7 @@ ${newText}` : newText);
1006
1006
  return /* @__PURE__ */ jsxs2(
1007
1007
  "div",
1008
1008
  {
1009
- className: `relative flex flex-col bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl shadow-sm focus-within:ring-2 focus-within:ring-blue-500/20 focus-within:border-blue-500 transition-all p-3 ${className}`,
1009
+ className: `relative flex flex-col bg-white dark:bg-black rounded-none transition-none p-4 font-mono font-light tracking-wide ${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-0 bg-white/90 dark:bg-zinc-900/90 flex flex-col items-center justify-center z-20 border-2 border-dashed border-blue-500 rounded-2xl", children: [
1018
- /* @__PURE__ */ jsx2(ImagePlus, { className: "w-8 h-8 text-blue-500 mb-2" }),
1019
- /* @__PURE__ */ jsx2("span", { className: "text-blue-500 font-medium tracking-wide", children: "Drop file to attach" })
1017
+ isDragging && /* @__PURE__ */ jsxs2("div", { className: "absolute inset-x-0 inset-y-0 bg-white/90 dark:bg-black/90 flex flex-col items-center justify-center z-20 border border-dashed border-black/30 dark:border-white/30 rounded-none mx-2 my-2 transition-opacity", children: [
1018
+ /* @__PURE__ */ jsx2(ImagePlus, { className: "w-8 h-8 text-black/50 dark:text-white/50 mb-4" }),
1019
+ /* @__PURE__ */ jsx2("span", { className: "text-black/50 dark:text-white/50 font-medium tracking-[0.2em] 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-3 px-2", children: images.map((img) => /* @__PURE__ */ jsxs2("div", { className: "relative w-14 h-14 overflow-hidden border border-zinc-200 dark:border-zinc-700 rounded-xl group select-none", children: [
1033
- /* @__PURE__ */ jsx2("img", { src: img.dataUrl, alt: "attachment", className: "w-full h-full object-cover transition-transform group-hover:scale-105" }),
1032
+ images.length > 0 && /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap gap-2 mb-4 px-2 mt-2", children: images.map((img) => /* @__PURE__ */ jsxs2("div", { className: "relative w-16 h-16 overflow-hidden border border-black/10 dark:border-white/10 rounded-none group select-none", children: [
1033
+ /* @__PURE__ */ jsx2("img", { src: img.dataUrl, alt: "attachment", className: "w-full h-full object-cover grayscale opacity-80 transition-all group-hover:grayscale-0 group-hover:opacity-100" }),
1034
1034
  /* @__PURE__ */ jsx2(
1035
1035
  "button",
1036
1036
  {
1037
1037
  type: "button",
1038
- className: "absolute top-1 right-1 w-5 h-5 bg-black/50 hover:bg-black/80 text-white rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-all backdrop-blur-sm",
1038
+ className: "absolute top-0 right-0 w-6 h-6 bg-black/50 text-white backdrop-blur-sm rounded-none 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-zinc-900 dark:text-zinc-100 text-[15px] leading-relaxed px-2 m-0 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 scrollbar-thin scrollbar-thumb-zinc-300 dark:scrollbar-thumb-zinc-700"
1055
+ className: "w-full min-h-[24px] max-h-[200px] resize-none border-none outline-none bg-transparent text-black dark:text-white text-[13px] font-mono font-light tracking-wide leading-relaxed px-2 py-1 m-0 placeholder:text-black/30 dark:placeholder:text-white/30 placeholder:uppercase placeholder:tracking-[0.2em] scrollbar-thin scrollbar-thumb-black/20 dark:scrollbar-thumb-white/20 scrollbar-track-transparent"
1056
1056
  }
1057
1057
  ),
1058
- /* @__PURE__ */ jsxs2("div", { className: "flex items-end justify-between mt-3 px-1", children: [
1059
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1", children: [
1058
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-end justify-between mt-6 px-2", children: [
1059
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-4", 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 w-8 h-8 rounded-full text-zinc-500 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100 hover:bg-zinc-200/50 dark:hover:bg-zinc-800 transition-colors",
1065
+ className: "flex items-center justify-center text-black/40 dark:text-white/40 hover:text-black dark: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,28 +1070,25 @@ ${newText}` : newText);
1070
1070
  ),
1071
1071
  actions
1072
1072
  ] }),
1073
- /* @__PURE__ */ jsx2("div", { className: "flex items-center gap-2", children: isGenerating ? /* @__PURE__ */ jsxs2(
1073
+ /* @__PURE__ */ jsx2("div", { className: "flex items-center gap-4", children: isGenerating ? /* @__PURE__ */ jsxs2(
1074
1074
  "button",
1075
1075
  {
1076
1076
  type: "button",
1077
- className: "flex items-center justify-center h-8 px-4 rounded-full bg-zinc-200 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-xs font-semibold tracking-wide transition-colors gap-1.5 cursor-pointer shadow-sm",
1077
+ className: "flex items-center justify-center text-red-500 hover:text-red-400 font-medium uppercase tracking-[0.2em] transition-colors gap-2 cursor-pointer text-[10px]",
1078
1078
  onClick: onStop,
1079
1079
  children: [
1080
- /* @__PURE__ */ jsx2(Square, { className: "w-3 h-3 fill-current" }),
1081
- " Stop"
1080
+ /* @__PURE__ */ jsx2(Square, { className: "w-2.5 h-2.5 fill-current" }),
1081
+ " [ STOP ]"
1082
1082
  ]
1083
1083
  }
1084
- ) : /* @__PURE__ */ jsxs2(
1084
+ ) : /* @__PURE__ */ jsx2(
1085
1085
  "button",
1086
1086
  {
1087
1087
  type: "button",
1088
- className: `flex items-center justify-center h-8 px-4 rounded-full text-xs font-semibold tracking-wide transition-all gap-1.5 ${canSend ? "bg-black dark:bg-white text-white dark:text-black shadow-md hover:scale-[1.02] active:scale-[0.98] cursor-pointer" : "bg-zinc-200 dark:bg-zinc-800 text-zinc-400 dark:text-zinc-600 cursor-not-allowed"}`,
1088
+ className: `flex items-center justify-center font-medium uppercase tracking-[0.2em] transition-colors gap-2 text-[10px] ${canSend ? "text-black dark:text-white hover:opacity-70 cursor-pointer" : "text-black/20 dark:text-white/20 cursor-not-allowed"}`,
1089
1089
  onClick: onSend,
1090
1090
  disabled: !canSend,
1091
- children: [
1092
- "Send ",
1093
- /* @__PURE__ */ jsx2(Send, { className: "w-3.5 h-3.5" })
1094
- ]
1091
+ children: "[ SEND ]"
1095
1092
  }
1096
1093
  ) })
1097
1094
  ] })
@@ -1101,7 +1098,7 @@ ${newText}` : newText);
1101
1098
  }
1102
1099
 
1103
1100
  // src/react/components.tsx
1104
- import { RotateCcw, ChevronDown, AlertCircle } from "lucide-react";
1101
+ import { ChevronDown, AlertCircle } from "lucide-react";
1105
1102
  import { clsx } from "clsx";
1106
1103
  import { twMerge } from "tailwind-merge";
1107
1104
  import { Streamdown, parseMarkdownIntoBlocks } from "streamdown";
@@ -1166,20 +1163,20 @@ function isVisionModel2(modelId) {
1166
1163
  return lower.includes("vl") || lower.includes("vision") || lower.includes("moondream");
1167
1164
  }
1168
1165
  var markdownComponents = {
1169
- h1: ({ children }) => /* @__PURE__ */ jsx3("h1", { className: "text-3xl font-bold tracking-tight mt-6 mb-4 text-zinc-900 dark:text-zinc-100", children }),
1170
- h2: ({ children }) => /* @__PURE__ */ jsx3("h2", { className: "text-2xl font-semibold tracking-tight mt-6 mb-4 text-zinc-900 dark:text-zinc-100 border-b border-zinc-200 dark:border-zinc-800 pb-2", children }),
1171
- h3: ({ children }) => /* @__PURE__ */ jsx3("h3", { className: "text-xl font-semibold tracking-tight mt-6 mb-3 text-zinc-900 dark:text-zinc-100", children }),
1172
- h4: ({ children }) => /* @__PURE__ */ jsx3("h4", { className: "text-lg font-semibold tracking-tight mt-4 mb-2 text-zinc-900 dark:text-zinc-100", children }),
1173
- p: ({ children }) => /* @__PURE__ */ jsx3("p", { className: "leading-7 [&:not(:first-child)]:mt-4 text-zinc-800 dark:text-zinc-300", children }),
1174
- ul: ({ children }) => /* @__PURE__ */ jsx3("ul", { className: "my-4 ml-6 list-disc [&>li]:mt-2 text-zinc-800 dark:text-zinc-300", children }),
1175
- ol: ({ children }) => /* @__PURE__ */ jsx3("ol", { className: "my-4 ml-6 list-decimal [&>li]:mt-2 text-zinc-800 dark:text-zinc-300", children }),
1166
+ h1: ({ children }) => /* @__PURE__ */ jsx3("h1", { className: "text-xl font-medium tracking-widest mt-8 mb-4 text-black dark:text-white pb-2 border-b border-black/10 dark:border-white/10 uppercase", children }),
1167
+ h2: ({ children }) => /* @__PURE__ */ jsx3("h2", { className: "text-lg font-medium tracking-widest mt-8 mb-4 text-black dark:text-white pb-2 border-b border-black/10 dark:border-white/10 uppercase", children }),
1168
+ h3: ({ children }) => /* @__PURE__ */ jsx3("h3", { className: "text-base font-medium tracking-widest mt-6 mb-3 text-black dark:text-white uppercase", children }),
1169
+ h4: ({ children }) => /* @__PURE__ */ jsx3("h4", { className: "text-sm font-medium tracking-widest mt-4 mb-2 text-black dark:text-white uppercase", children }),
1170
+ p: ({ children }) => /* @__PURE__ */ jsx3("p", { className: "leading-relaxed [&:not(:first-child)]:mt-5 text-black dark:text-white text-[13px] font-mono font-light tracking-wide", children }),
1171
+ ul: ({ children }) => /* @__PURE__ */ jsx3("ul", { className: "my-5 ml-6 list-square [&>li]:mt-2 text-black dark:text-white font-mono text-[13px] font-light tracking-wide", children }),
1172
+ ol: ({ children }) => /* @__PURE__ */ jsx3("ol", { className: "my-5 ml-6 list-decimal [&>li]:mt-2 text-black dark:text-white font-mono text-[13px] font-light tracking-wide", children }),
1176
1173
  li: ({ children }) => /* @__PURE__ */ jsx3("li", { children }),
1177
- blockquote: ({ children }) => /* @__PURE__ */ jsx3("blockquote", { className: "mt-4 border-l-2 border-zinc-300 dark:border-zinc-700 pl-4 italic text-zinc-600 dark:text-zinc-400", children }),
1178
- a: ({ href, children }) => /* @__PURE__ */ jsx3("a", { href, className: "font-medium text-blue-600 hover:underline dark:text-blue-400", target: "_blank", rel: "noopener noreferrer", children }),
1179
- table: ({ children }) => /* @__PURE__ */ jsx3("div", { className: "my-4 w-full overflow-y-auto", children: /* @__PURE__ */ jsx3("table", { className: "w-full text-sm", children }) }),
1180
- tr: ({ children }) => /* @__PURE__ */ jsx3("tr", { className: "m-0 border-t border-zinc-200 dark:border-zinc-800 p-0 even:bg-zinc-50 dark:even:bg-zinc-900/50", children }),
1181
- th: ({ children }) => /* @__PURE__ */ jsx3("th", { className: "border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 px-4 py-2 font-semibold text-zinc-900 dark:text-zinc-100 text-left [&[align=center]]:text-center [&[align=right]]:text-right", children }),
1182
- td: ({ children }) => /* @__PURE__ */ jsx3("td", { className: "border border-zinc-200 dark:border-zinc-700 px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right text-zinc-700 dark:text-zinc-300", children })
1174
+ blockquote: ({ children }) => /* @__PURE__ */ jsx3("blockquote", { className: "mt-5 pl-4 italic text-black/60 dark:text-white/60 font-mono text-[13px] font-light tracking-wide border-l border-black/20 dark:border-white/20", children }),
1175
+ a: ({ href, children }) => /* @__PURE__ */ jsx3("a", { href, className: "underline decoration-1 underline-offset-4 text-black dark:text-white hover:text-black/60 dark:hover:text-white/60 transition-colors", target: "_blank", rel: "noopener noreferrer", children }),
1176
+ table: ({ children }) => /* @__PURE__ */ jsx3("div", { className: "my-5 w-full overflow-y-auto", children: /* @__PURE__ */ jsx3("table", { className: "w-full text-[13px] font-mono font-light tracking-wide", children }) }),
1177
+ tr: ({ children }) => /* @__PURE__ */ jsx3("tr", { className: "m-0 border-b border-black/10 dark:border-white/10 p-0", children }),
1178
+ th: ({ children }) => /* @__PURE__ */ jsx3("th", { className: "text-black/50 dark:text-white/50 px-4 py-2 font-medium tracking-widest uppercase text-left text-xs", children }),
1179
+ td: ({ children }) => /* @__PURE__ */ jsx3("td", { className: "px-4 py-3 text-left text-black dark:text-white", children })
1183
1180
  };
1184
1181
  function ModelSelector({
1185
1182
  currentModel,
@@ -1205,27 +1202,27 @@ function ModelSelector({
1205
1202
  }
1206
1203
  return label;
1207
1204
  }, [currentModel]);
1208
- return /* @__PURE__ */ jsxs3("div", { className: "relative", ref, children: [
1205
+ return /* @__PURE__ */ jsxs3("div", { className: "relative font-mono", ref, children: [
1209
1206
  /* @__PURE__ */ jsxs3(
1210
1207
  "button",
1211
1208
  {
1212
1209
  type: "button",
1213
- className: "flex items-center gap-1.5 px-3 py-1.5 bg-zinc-100 hover:bg-zinc-200 dark:bg-zinc-800 dark:hover:bg-zinc-700 text-zinc-700 dark:text-zinc-300 text-xs font-medium tracking-wide rounded-full transition-colors",
1210
+ className: "flex items-center gap-2 px-0 py-1.5 bg-transparent text-black dark:text-white hover:text-black/60 dark:hover:text-white/60 text-[10px] font-medium uppercase tracking-[0.2em] transition-colors",
1214
1211
  onClick: () => setIsOpen(!isOpen),
1215
1212
  children: [
1216
1213
  /* @__PURE__ */ jsx3("span", { children: displayModel }),
1217
- /* @__PURE__ */ jsx3(ChevronDown, { className: "w-3.5 h-3.5 opacity-70" })
1214
+ /* @__PURE__ */ jsx3(ChevronDown, { className: "w-3 h-3 opacity-50" })
1218
1215
  ]
1219
1216
  }
1220
1217
  ),
1221
- isOpen && /* @__PURE__ */ jsxs3("div", { className: "absolute top-[calc(100%+8px)] left-0 w-72 max-h-[300px] overflow-y-auto bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl shadow-xl z-50 py-2 scrollbar-thin", children: [
1222
- /* @__PURE__ */ jsx3("div", { className: "px-3 py-1.5 text-[10px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-wider", children: "WebLLM" }),
1218
+ isOpen && /* @__PURE__ */ jsxs3("div", { className: "absolute top-[calc(100%+8px)] left-0 w-72 max-h-[300px] overflow-y-auto bg-white/95 dark:bg-black/95 backdrop-blur-md border border-black/10 dark:border-white/10 z-50 p-1 scrollbar-none shadow-2xl", children: [
1219
+ /* @__PURE__ */ jsx3("div", { className: "px-3 py-2 text-[9px] text-black/40 dark:text-white/40 uppercase tracking-[0.2em] border-b border-black/5 dark:border-white/5 mb-1", children: "WebLLM" }),
1223
1220
  Object.entries(WEBLLM_MODELS).map(([key, value]) => /* @__PURE__ */ jsxs3(
1224
1221
  "button",
1225
1222
  {
1226
1223
  className: cn(
1227
- "block w-full text-left px-3 py-2 text-xs font-medium truncate transition-colors",
1228
- currentModel === value ? "bg-blue-50 text-blue-600 dark:bg-blue-900/20 dark:text-blue-400" : "text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800/50"
1224
+ "block w-full text-left px-3 py-2 text-[11px] uppercase tracking-widest truncate transition-colors",
1225
+ currentModel === value ? "bg-black/5 dark:bg-white/10 text-black dark:text-white" : "text-black/70 dark:text-white/70 hover:bg-black/5 dark:hover:bg-white/5"
1229
1226
  ),
1230
1227
  onClick: () => {
1231
1228
  onSelect(value);
@@ -1234,18 +1231,18 @@ function ModelSelector({
1234
1231
  children: [
1235
1232
  key,
1236
1233
  " ",
1237
- isVisionModel2(value) && /* @__PURE__ */ jsx3("span", { className: "ml-1 px-1.5 py-0.5 rounded text-[9px] bg-zinc-100 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700", children: "VISION" })
1234
+ isVisionModel2(value) && /* @__PURE__ */ jsx3("span", { className: "ml-2 text-[8px] text-black/40 dark:text-white/40", children: "VISION" })
1238
1235
  ]
1239
1236
  },
1240
1237
  key
1241
1238
  )),
1242
- /* @__PURE__ */ jsx3("div", { className: "px-3 py-1.5 text-[10px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-wider mt-2 border-t border-zinc-100 dark:border-zinc-800 pt-3", children: "Transformers.js" }),
1239
+ /* @__PURE__ */ jsx3("div", { className: "px-3 py-2 text-[9px] text-black/40 dark:text-white/40 uppercase tracking-[0.2em] mt-2 border-b border-black/5 dark:border-white/5 mb-1", children: "Transformers.js" }),
1243
1240
  Object.entries(TRANSFORMERS_MODELS).map(([key, value]) => /* @__PURE__ */ jsxs3(
1244
1241
  "button",
1245
1242
  {
1246
1243
  className: cn(
1247
- "block w-full text-left px-3 py-2 text-xs font-medium truncate transition-colors",
1248
- currentModel === value ? "bg-blue-50 text-blue-600 dark:bg-blue-900/20 dark:text-blue-400" : "text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800/50"
1244
+ "block w-full text-left px-3 py-2 text-[11px] uppercase tracking-widest truncate transition-colors",
1245
+ currentModel === value ? "bg-black/5 dark:bg-white/10 text-black dark:text-white" : "text-black/70 dark:text-white/70 hover:bg-black/5 dark:hover:bg-white/5"
1249
1246
  ),
1250
1247
  onClick: () => {
1251
1248
  onSelect(value);
@@ -1254,7 +1251,7 @@ function ModelSelector({
1254
1251
  children: [
1255
1252
  key,
1256
1253
  " ",
1257
- isVisionModel2(value) && /* @__PURE__ */ jsx3("span", { className: "ml-1 px-1.5 py-0.5 rounded text-[9px] bg-zinc-100 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700", children: "VISION" })
1254
+ isVisionModel2(value) && /* @__PURE__ */ jsx3("span", { className: "ml-2 text-[8px] text-black/40 dark:text-white/40", children: "VISION" })
1258
1255
  ]
1259
1256
  },
1260
1257
  key
@@ -1397,65 +1394,80 @@ ${systemPrompt}` : systemPrompt;
1397
1394
  setStreamingText("");
1398
1395
  }
1399
1396
  };
1400
- return /* @__PURE__ */ jsxs3("div", { className: cn("flex flex-col bg-white dark:bg-[#09090b] border border-zinc-200 dark:border-zinc-800 rounded-3xl overflow-hidden shadow-sm", className), style: { maxHeight, height: "100%" }, children: [
1401
- showHeader && /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-5 py-4 border-b border-zinc-100 dark:border-zinc-800/60 bg-white/50 dark:bg-zinc-900/20 backdrop-blur-md", children: [
1397
+ return /* @__PURE__ */ jsxs3("div", { className: cn("flex flex-col bg-white dark:bg-black text-black dark:text-white font-mono overflow-hidden", className), style: { maxHeight, height: "100%" }, children: [
1398
+ showHeader && /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4 border-b border-black/10 dark:border-white/10 bg-white dark:bg-black", children: [
1402
1399
  onModelChange ? /* @__PURE__ */ jsx3(
1403
1400
  ModelSelector,
1404
1401
  {
1405
1402
  currentModel: modelId,
1406
1403
  onSelect: onModelChange
1407
1404
  }
1408
- ) : /* @__PURE__ */ jsxs3("div", { className: "px-3 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-full flex items-center gap-2", children: [
1409
- /* @__PURE__ */ jsx3("span", { className: "text-xs font-semibold tracking-wide text-zinc-700 dark:text-zinc-300", children: modelId?.split("/").pop() }),
1410
- modelId && isVisionModel2(modelId) && /* @__PURE__ */ jsx3("span", { className: "px-1.5 py-0.5 rounded text-[9px] font-bold bg-blue-100 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 border border-blue-200 dark:border-blue-800", children: "VISION" })
1405
+ ) : /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
1406
+ /* @__PURE__ */ jsx3("span", { className: "text-[10px] font-medium uppercase tracking-[0.2em] text-black dark:text-white", children: modelId?.split("/").pop() }),
1407
+ modelId && isVisionModel2(modelId) && /* @__PURE__ */ jsx3("span", { className: "text-[9px] font-medium uppercase tracking-[0.2em] text-black/40 dark:text-white/40", children: "VISION" })
1411
1408
  ] }),
1412
- /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
1413
- /* @__PURE__ */ jsx3("span", { className: "text-xs font-medium text-zinc-500 dark:text-zinc-400 capitalize", children: error ? "Error" : isReady ? "Ready" : isLoading ? "Loading" : "Idle" }),
1409
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 opacity-50", children: [
1410
+ /* @__PURE__ */ jsx3("span", { className: "text-[10px] font-medium tracking-[0.2em] uppercase", children: error ? "ERR" : isReady ? "RDY" : isLoading ? "LOD" : "IDL" }),
1414
1411
  /* @__PURE__ */ jsx3("div", { className: cn(
1415
- "w-2 h-2 rounded-full",
1416
- error ? "bg-red-500" : isReady ? "bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.5)]" : "bg-zinc-300 dark:bg-zinc-700 animate-pulse"
1412
+ "w-1.5 h-1.5",
1413
+ error ? "bg-red-500" : isReady ? "bg-black dark:bg-white" : "bg-black/20 dark:bg-white/20 animate-pulse"
1417
1414
  ) })
1418
1415
  ] })
1419
1416
  ] }),
1420
- showProgress && isLoading && loadProgress && /* @__PURE__ */ jsxs3("div", { className: "px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-900/30", children: [
1421
- /* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-center mb-1.5", children: [
1422
- /* @__PURE__ */ jsx3("span", { className: "text-xs font-medium text-zinc-600 dark:text-zinc-400 truncate pr-4", children: loadProgress.status }),
1423
- /* @__PURE__ */ jsxs3("span", { className: "text-xs font-bold text-zinc-900 dark:text-zinc-100", children: [
1417
+ showProgress && isLoading && loadProgress && /* @__PURE__ */ jsxs3("div", { className: "px-6 py-4 border-b border-black/10 dark:border-white/10 bg-white dark:bg-black", children: [
1418
+ /* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-center mb-2 font-mono uppercase tracking-[0.2em] text-[10px] text-black/60 dark:text-white/60", children: [
1419
+ /* @__PURE__ */ jsx3("span", { className: "truncate pr-4", children: loadProgress.status }),
1420
+ /* @__PURE__ */ jsxs3("span", { children: [
1424
1421
  Math.round(loadProgress.progress),
1425
1422
  "%"
1426
1423
  ] })
1427
1424
  ] }),
1428
- /* @__PURE__ */ jsx3("div", { className: "h-1.5 w-full bg-zinc-200 dark:bg-zinc-800 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx3(
1425
+ /* @__PURE__ */ jsx3("div", { className: "h-[1px] w-full bg-black/10 dark:bg-white/10 overflow-hidden relative", children: /* @__PURE__ */ jsx3(
1429
1426
  "div",
1430
1427
  {
1431
- className: "h-full bg-blue-500 dark:bg-blue-600 rounded-full transition-all duration-300 ease-out",
1428
+ className: "h-full bg-black dark:bg-white transition-all duration-300 ease-out",
1432
1429
  style: { width: `${Math.min(100, loadProgress.progress)}%` }
1433
1430
  }
1434
1431
  ) })
1435
1432
  ] }),
1436
- error && /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between mx-5 mt-4 p-3 bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-900/50 rounded-xl", children: [
1437
- /* @__PURE__ */ jsx3("span", { className: "text-sm text-red-700 dark:text-red-400 font-medium", children: error.message }),
1438
- /* @__PURE__ */ jsxs3(
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/30 bg-red-50/50 dark:bg-red-950/20 gap-4", children: [
1434
+ /* @__PURE__ */ jsx3("span", { className: "text-[11px] text-red-600 dark:text-red-400 font-medium uppercase tracking-widest", children: error.message }),
1435
+ /* @__PURE__ */ jsx3(
1439
1436
  "button",
1440
1437
  {
1441
- className: "flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-black border border-red-200 dark:border-red-900 shadow-sm rounded-lg text-xs font-semibold text-red-700 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-950/50 transition-colors",
1438
+ className: "text-[10px] font-medium uppercase tracking-[0.2em] text-red-600 dark:text-red-400 hover:opacity-70 transition-opacity",
1442
1439
  onClick: reload,
1443
- children: [
1444
- /* @__PURE__ */ jsx3(RotateCcw, { className: "w-3.5 h-3.5" }),
1445
- " Retry"
1446
- ]
1440
+ children: "[ REBOOT ]"
1447
1441
  }
1448
1442
  )
1449
1443
  ] }),
1450
- /* @__PURE__ */ jsxs3("div", { className: "flex-1 overflow-y-auto p-5 flex flex-col gap-6 scrollbar-thin scrollbar-thumb-zinc-200 dark:scrollbar-thumb-zinc-800", children: [
1451
- !isLoading && messages.length === 0 && !error && /* @__PURE__ */ jsxs3("div", { className: "flex-1 flex flex-col items-center justify-center text-center opacity-80 mt-12 mb-8 transition-opacity hover:opacity-100", children: [
1452
- /* @__PURE__ */ jsx3("div", { className: "w-16 h-16 bg-gradient-to-tr from-blue-500 to-cyan-400 rounded-2xl shadow-xl shadow-blue-500/20 mb-6 flex items-center justify-center transform rotate-3", children: /* @__PURE__ */ jsx3("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "white", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx3("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) }) }),
1453
- /* @__PURE__ */ jsx3("h3", { className: "text-2xl font-bold tracking-tight text-zinc-900 dark:text-zinc-100 mb-2", children: welcomeMessage }),
1454
- /* @__PURE__ */ jsx3("p", { className: "text-zinc-500 dark:text-zinc-400 max-w-sm", children: "Use Markdown, paste images (Ctrl+V), create Mermaid diagrams, and write math equations safely." })
1444
+ /* @__PURE__ */ jsxs3("div", { className: "flex-1 overflow-y-auto px-6 py-8 flex flex-col gap-10 scrollbar-thin scrollbar-thumb-black/20 dark:scrollbar-thumb-white/20 scrollbar-track-transparent", children: [
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("h3", { className: "text-sm font-medium uppercase tracking-[0.3em] text-black/40 dark:text-white/40 mb-2", children: "SYSTEM READY" }),
1447
+ /* @__PURE__ */ jsx3("p", { className: "text-black/30 dark:text-white/30 uppercase text-[10px] tracking-[0.2em]", children: "[ MARKDOWN ] [ MATH ] [ MERMAID ]" })
1455
1448
  ] }),
1456
- messages.map((msg, i) => /* @__PURE__ */ jsx3("div", { className: cn("flex flex-col max-w-[85%]", msg.role === "user" ? "self-end" : "self-start w-full"), children: msg.role === "user" ? /* @__PURE__ */ jsxs3("div", { className: "bg-zinc-100 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 px-5 py-3.5 rounded-[24px] rounded-br-[8px] sm:px-6 shadow-sm border border-zinc-200 dark:border-zinc-700/50", children: [
1457
- msg.images && msg.images.length > 0 && /* @__PURE__ */ jsx3("div", { className: "flex flex-wrap gap-2 mb-3 mt-1", children: msg.images.map((img) => /* @__PURE__ */ jsx3("img", { src: img.dataUrl, className: "w-24 h-24 object-cover rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm", alt: "attachment" }, img.id)) }),
1458
- /* @__PURE__ */ jsx3("div", { className: "prose prose-sm dark:prose-invert max-w-none", children: /* @__PURE__ */ jsx3(
1449
+ messages.map((msg, i) => /* @__PURE__ */ jsxs3("div", { className: "flex flex-col max-w-full w-full", children: [
1450
+ /* @__PURE__ */ jsxs3("div", { className: "text-[10px] text-black/30 dark:text-white/30 tracking-[0.2em] uppercase mb-2", children: [
1451
+ "[ ",
1452
+ msg.role === "user" ? "USER" : "SYSTEM",
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(
1459
1471
  Streamdown,
1460
1472
  {
1461
1473
  plugins: { code, mermaid, math },
@@ -1468,36 +1480,27 @@ ${systemPrompt}` : systemPrompt;
1468
1480
  children: msg.content
1469
1481
  }
1470
1482
  ) })
1471
- ] }) : /* @__PURE__ */ jsx3("div", { className: "prose prose-sm dark:prose-invert max-w-none px-2 w-full min-w-0", children: /* @__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
- ) }) }, i)),
1484
- streamingText && /* @__PURE__ */ jsx3("div", { className: "flex flex-col self-start w-full max-w-[85%]", children: /* @__PURE__ */ jsx3("div", { className: "prose prose-sm dark:prose-invert max-w-none px-2 w-full min-w-0", children: /* @__PURE__ */ jsx3(
1485
- Streamdown,
1486
- {
1487
- plugins: { code, mermaid, math },
1488
- components: markdownComponents,
1489
- animated: true,
1490
- isAnimating: isGenerating,
1491
- mermaid: mermaidOptions,
1492
- controls: streamdownControls,
1493
- parseMarkdownIntoBlocksFn: sanitizeMarkdownLanguageBlocks,
1494
- caret: "block",
1495
- children: streamingText
1496
- }
1497
- ) }) }),
1483
+ ] }, i)),
1484
+ streamingText && /* @__PURE__ */ jsxs3("div", { className: "flex flex-col max-w-full w-full", children: [
1485
+ /* @__PURE__ */ jsx3("div", { className: "text-[10px] text-black/30 dark:text-white/30 tracking-[0.2em] uppercase mb-2 animate-pulse", children: "[ SYSTEM GENERATING ]" }),
1486
+ /* @__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(
1487
+ Streamdown,
1488
+ {
1489
+ plugins: { code, mermaid, math },
1490
+ components: markdownComponents,
1491
+ animated: true,
1492
+ isAnimating: isGenerating,
1493
+ mermaid: mermaidOptions,
1494
+ controls: streamdownControls,
1495
+ parseMarkdownIntoBlocksFn: sanitizeMarkdownLanguageBlocks,
1496
+ caret: "block",
1497
+ children: streamingText
1498
+ }
1499
+ ) })
1500
+ ] }),
1498
1501
  /* @__PURE__ */ jsx3("div", { ref: messagesEndRef, className: "h-4" })
1499
1502
  ] }),
1500
- /* @__PURE__ */ jsx3("div", { className: "p-4 bg-white/80 dark:bg-zinc-950/80 backdrop-blur-xl border-t border-zinc-100 dark:border-zinc-800/80", children: /* @__PURE__ */ jsx3(
1503
+ /* @__PURE__ */ jsx3("div", { className: "p-0 border-t border-black/10 dark:border-white/10 bg-white dark:bg-black", children: /* @__PURE__ */ jsx3(
1501
1504
  ChatInput,
1502
1505
  {
1503
1506
  value: input,