@gendive/chatllm 0.14.0 → 0.15.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.
@@ -34,10 +34,13 @@ __export(index_exports, {
34
34
  ChatInput: () => ChatInput,
35
35
  ChatSidebar: () => ChatSidebar,
36
36
  ChatUI: () => ChatUI,
37
+ ContentPartRenderer: () => ContentPartRenderer,
37
38
  DeepResearchProgressUI: () => DeepResearchProgressUI,
38
39
  EmptyState: () => EmptyState,
40
+ FileContentCard: () => FileContentCard,
39
41
  Icon: () => Icon,
40
42
  IconSvg: () => IconSvg,
43
+ ImageContentCard: () => ImageContentCard,
41
44
  LinkChip: () => LinkChip,
42
45
  MarkdownRenderer: () => MarkdownRenderer,
43
46
  MemoryPanel: () => MemoryPanel,
@@ -46,6 +49,7 @@ __export(index_exports, {
46
49
  PollCard: () => PollCard,
47
50
  SettingsModal: () => SettingsModal,
48
51
  SkillProgressUI: () => SkillProgressUI,
52
+ convertToolsToSkills: () => convertToolsToSkills,
49
53
  createAdvancedResearchSkill: () => createAdvancedResearchSkill,
50
54
  createDeepResearchSkill: () => createDeepResearchSkill,
51
55
  useChatUI: () => useChatUI,
@@ -55,7 +59,7 @@ __export(index_exports, {
55
59
  module.exports = __toCommonJS(index_exports);
56
60
 
57
61
  // src/react/ChatUI.tsx
58
- var import_react15 = __toESM(require("react"));
62
+ var import_react16 = __toESM(require("react"));
59
63
 
60
64
  // src/react/hooks/useChatUI.ts
61
65
  var import_react4 = require("react");
@@ -1211,6 +1215,45 @@ var formatPollResponse = (question, selectedOptions, otherText) => {
1211
1215
  return `${selectedLabels.join(", ")}\uC744(\uB97C) \uC120\uD0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774 \uC120\uD0DD\uC744 \uBC14\uD0D5\uC73C\uB85C \uC9C4\uD589\uD574\uC8FC\uC138\uC694.`;
1212
1216
  };
1213
1217
 
1218
+ // src/react/utils/toolAdapter.ts
1219
+ var convertToolsToSkills = (tools, onToolCall) => {
1220
+ const skillMap = {};
1221
+ for (const tool of tools) {
1222
+ skillMap[tool.name] = {
1223
+ description: tool.description,
1224
+ trigger: "auto",
1225
+ label: tool.name,
1226
+ parameters: {
1227
+ type: "object",
1228
+ properties: Object.fromEntries(
1229
+ Object.entries(tool.parameters).map(([key, param]) => [
1230
+ key,
1231
+ {
1232
+ type: param.type,
1233
+ description: param.description,
1234
+ enum: param.enum
1235
+ }
1236
+ ])
1237
+ ),
1238
+ required: Object.entries(tool.parameters).filter(([, param]) => param.required).map(([key]) => key)
1239
+ },
1240
+ execute: async (params) => {
1241
+ const result = await onToolCall(tool.name, params);
1242
+ return {
1243
+ content: result.content,
1244
+ metadata: {
1245
+ __toolResult__: true,
1246
+ resultType: result.type,
1247
+ toolName: tool.name,
1248
+ ...result.metadata
1249
+ }
1250
+ };
1251
+ }
1252
+ };
1253
+ }
1254
+ return skillMap;
1255
+ };
1256
+
1214
1257
  // src/react/utils/sessionCache.ts
1215
1258
  var buildCacheKey = (storageKey, sessionId) => `${storageKey}_cache_${sessionId}`;
1216
1259
  var writeSessionCache = (storageKey, session) => {
@@ -1288,7 +1331,10 @@ var useChatUI = (options) => {
1288
1331
  // Poll options
1289
1332
  enablePoll = true,
1290
1333
  // Skills options
1291
- skills
1334
+ skills,
1335
+ // Tool options
1336
+ tools,
1337
+ onToolCall
1292
1338
  } = options;
1293
1339
  const enableAutoExtraction = enableAutoExtractionProp ?? !useExternalStorage;
1294
1340
  const [sessions, setSessions] = (0, import_react4.useState)([]);
@@ -1333,6 +1379,11 @@ var useChatUI = (options) => {
1333
1379
  [globalMemoryConfig, storageKey]
1334
1380
  );
1335
1381
  const globalMemory = useGlobalMemoryEnabled ? useGlobalMemory(memoryOptions) : null;
1382
+ const mergedSkills = (0, import_react4.useMemo)(() => {
1383
+ if (!tools || !onToolCall) return skills || {};
1384
+ const toolSkills = convertToolsToSkills(tools, onToolCall);
1385
+ return { ...skills || {}, ...toolSkills };
1386
+ }, [skills, tools, onToolCall]);
1336
1387
  const {
1337
1388
  buildSkillsPrompt,
1338
1389
  handleSkillCall,
@@ -1341,7 +1392,7 @@ var useChatUI = (options) => {
1341
1392
  activeSkillExecution,
1342
1393
  resolvedSkills
1343
1394
  } = useSkills({
1344
- skills,
1395
+ skills: mergedSkills,
1345
1396
  deepResearch
1346
1397
  });
1347
1398
  const infoExtraction = useInfoExtraction({
@@ -1807,6 +1858,9 @@ ${newConversation}
1807
1858
  return next;
1808
1859
  });
1809
1860
  }, [options.onPersonalizationChange]);
1861
+ const savePersonalization = (0, import_react4.useCallback)(() => {
1862
+ options.onPersonalizationSave?.(personalization);
1863
+ }, [options.onPersonalizationSave, personalization]);
1810
1864
  const toggleDeepResearchMode = (0, import_react4.useCallback)(() => {
1811
1865
  setIsDeepResearchMode((prev) => !prev);
1812
1866
  }, []);
@@ -2178,6 +2232,60 @@ ${currentContextSummary}` },
2178
2232
  signal: abortControllerRef.current?.signal
2179
2233
  });
2180
2234
  if (result) {
2235
+ if (result.metadata?.__toolResult__) {
2236
+ const resultType = result.metadata.resultType;
2237
+ const toolName = result.metadata.toolName;
2238
+ const parts = [];
2239
+ if (skillCleanContent.trim()) {
2240
+ parts.push({ type: "text", content: skillCleanContent });
2241
+ }
2242
+ if (resultType === "image") {
2243
+ parts.push({ type: "image", url: result.content, alt: result.metadata?.alt });
2244
+ } else if (resultType === "file") {
2245
+ parts.push({
2246
+ type: "file",
2247
+ name: result.metadata?.fileName || "file",
2248
+ url: result.content,
2249
+ mimeType: result.metadata?.mimeType
2250
+ });
2251
+ } else if (resultType === "error") {
2252
+ parts.push({ type: "error", message: result.content });
2253
+ } else {
2254
+ parts.push({ type: "text", content: result.content });
2255
+ }
2256
+ setSessions(
2257
+ (prev) => prev.map((s) => {
2258
+ if (s.id !== capturedSessionId) return s;
2259
+ return {
2260
+ ...s,
2261
+ messages: s.messages.map((m) => {
2262
+ if (m.id !== assistantMessageId) return m;
2263
+ return {
2264
+ ...m,
2265
+ contentParts: parts,
2266
+ skillExecution: {
2267
+ ...m.skillExecution,
2268
+ status: "done",
2269
+ result
2270
+ }
2271
+ };
2272
+ })
2273
+ };
2274
+ })
2275
+ );
2276
+ skipNextSkillParsingRef.current = true;
2277
+ const feedbackPrompt = resultType === "image" ? `\uB3C4\uAD6C "${toolName}": \uC774\uBBF8\uC9C0 \uC0DD\uC131 \uC644\uB8CC. \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uACB0\uACFC\uB97C \uC124\uBA85\uD574\uC8FC\uC138\uC694. skill_use \uD0DC\uADF8\uB294 \uC0AC\uC6A9\uD558\uC9C0 \uB9C8\uC138\uC694.` : `\uB3C4\uAD6C "${toolName}" \uACB0\uACFC:
2278
+
2279
+ ${result.content}
2280
+
2281
+ \uC704 \uACB0\uACFC\uB97C \uBC14\uD0D5\uC73C\uB85C \uB2F5\uBCC0\uD574\uC8FC\uC138\uC694. skill_use \uD0DC\uADF8\uB294 \uC0AC\uC6A9\uD558\uC9C0 \uB9C8\uC138\uC694.`;
2282
+ setTimeout(() => {
2283
+ sendMessage(feedbackPrompt, { hiddenUserMessage: true });
2284
+ }, 100);
2285
+ setIsLoading(false);
2286
+ abortControllerRef.current = null;
2287
+ return;
2288
+ }
2181
2289
  setSessions(
2182
2290
  (prev) => prev.map((s) => {
2183
2291
  if (s.id !== capturedSessionId) return s;
@@ -2772,6 +2880,7 @@ ${currentSession.contextSummary}` },
2772
2880
  setActiveAlternative,
2773
2881
  getActiveAlternative,
2774
2882
  updatePersonalization,
2883
+ savePersonalization,
2775
2884
  models,
2776
2885
  // Memory
2777
2886
  globalMemory,
@@ -4169,10 +4278,10 @@ var iconButtonStyle = {
4169
4278
  };
4170
4279
 
4171
4280
  // src/react/components/MessageList.tsx
4172
- var import_react13 = require("react");
4281
+ var import_react14 = require("react");
4173
4282
 
4174
4283
  // src/react/components/MessageBubble.tsx
4175
- var import_react12 = require("react");
4284
+ var import_react13 = require("react");
4176
4285
 
4177
4286
  // src/react/components/MarkdownRenderer.tsx
4178
4287
  var import_react9 = __toESM(require("react"));
@@ -4361,6 +4470,49 @@ var ITALIC_REGEX = /(?<!\*)\*([^*]+)\*(?!\*)/g;
4361
4470
  var HR_REGEX = /^---+$/gm;
4362
4471
  var TABLE_ROW_REGEX = /^\|(.+)\|$/;
4363
4472
  var TABLE_SEPARATOR_REGEX = /^\|[\s\-:|]+\|$/;
4473
+ var convertNonStandardTable = (codeContent) => {
4474
+ const lines = codeContent.trim().split("\n");
4475
+ const nonEmptyLines = lines.filter((l) => l.trim());
4476
+ if (nonEmptyLines.length < 2) return null;
4477
+ const isSeparatorLine = (line) => /^[-=\s\t|:]+$/.test(line.trim()) && /[-=]{2,}/.test(line);
4478
+ if (nonEmptyLines[0].includes(" ")) {
4479
+ const dataLines2 = nonEmptyLines.filter((l) => !isSeparatorLine(l));
4480
+ if (dataLines2.length < 2) return null;
4481
+ if (!dataLines2.every((l) => l.includes(" "))) return null;
4482
+ const colCount2 = dataLines2[0].split(" ").length;
4483
+ if (colCount2 < 2) return null;
4484
+ const result2 = [];
4485
+ const headerCells = dataLines2[0].split(" ").map((c) => c.trim());
4486
+ result2.push("| " + headerCells.join(" | ") + " |");
4487
+ result2.push("| " + Array(colCount2).fill("---").join(" | ") + " |");
4488
+ for (let i = 1; i < dataLines2.length; i++) {
4489
+ const cells = dataLines2[i].split(" ").map((c) => c.trim());
4490
+ while (cells.length < colCount2) cells.push("");
4491
+ result2.push("| " + cells.join(" | ") + " |");
4492
+ }
4493
+ return result2.join("\n");
4494
+ }
4495
+ const dataLines = nonEmptyLines.filter((l) => !isSeparatorLine(l));
4496
+ if (dataLines.length < 2) return null;
4497
+ const spaceParsed = dataLines.map(
4498
+ (l) => l.split(/\s{2,}/).map((c) => c.trim()).filter(Boolean)
4499
+ );
4500
+ const colCount = spaceParsed[0].length;
4501
+ if (colCount < 3) return null;
4502
+ const consistent = spaceParsed.every(
4503
+ (cols) => cols.length >= colCount - 1 && cols.length <= colCount + 1
4504
+ );
4505
+ if (!consistent) return null;
4506
+ const result = [];
4507
+ result.push("| " + spaceParsed[0].join(" | ") + " |");
4508
+ result.push("| " + Array(colCount).fill("---").join(" | ") + " |");
4509
+ for (let i = 1; i < spaceParsed.length; i++) {
4510
+ const cells = [...spaceParsed[i]];
4511
+ while (cells.length < colCount) cells.push("");
4512
+ result.push("| " + cells.join(" | ") + " |");
4513
+ }
4514
+ return result.join("\n");
4515
+ };
4364
4516
  var parseSourceLinks = (text) => {
4365
4517
  const links = [];
4366
4518
  let match;
@@ -5086,7 +5238,17 @@ var MarkdownRenderer = ({
5086
5238
  processedContent = processedContent.replace(UNCLOSED_POLL_TAG_REGEX, "");
5087
5239
  processedContent = processedContent.replace(UNCLOSED_SKILL_TAG_REGEX, "");
5088
5240
  const codeBlocks = [];
5089
- processedContent = processedContent.replace(CODE_BLOCK_REGEX, (_, lang, code) => {
5241
+ processedContent = processedContent.replace(CODE_BLOCK_REGEX, (match, lang, code) => {
5242
+ if (lang === "markdown" || lang === "md") {
5243
+ const trimmedCode = code.trim();
5244
+ if (TABLE_ROW_REGEX.test(trimmedCode.split("\n")[0])) {
5245
+ return "\n" + trimmedCode + "\n";
5246
+ }
5247
+ const converted = convertNonStandardTable(trimmedCode);
5248
+ if (converted) {
5249
+ return "\n" + converted + "\n";
5250
+ }
5251
+ }
5090
5252
  codeBlocks.push({ language: lang || "", code });
5091
5253
  return `\xA7CODEBLOCK\xA7${codeBlocks.length - 1}\xA7/CODEBLOCK\xA7`;
5092
5254
  });
@@ -6150,8 +6312,358 @@ var SkillProgressUI = ({
6150
6312
  );
6151
6313
  };
6152
6314
 
6153
- // src/react/components/MessageBubble.tsx
6315
+ // src/react/components/ImageContentCard.tsx
6316
+ var import_react12 = require("react");
6154
6317
  var import_jsx_runtime10 = require("react/jsx-runtime");
6318
+ var ImageContentCard = ({ part }) => {
6319
+ const [isExpanded, setIsExpanded] = (0, import_react12.useState)(false);
6320
+ const [isLoaded, setIsLoaded] = (0, import_react12.useState)(false);
6321
+ const [hasError, setHasError] = (0, import_react12.useState)(false);
6322
+ if (hasError) {
6323
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
6324
+ "div",
6325
+ {
6326
+ style: {
6327
+ padding: "16px",
6328
+ backgroundColor: "var(--chatllm-bg-secondary, #f9fafb)",
6329
+ borderRadius: "8px",
6330
+ border: "1px solid var(--chatllm-border, #e5e7eb)",
6331
+ color: "var(--chatllm-text-muted, #64748b)",
6332
+ fontSize: "13px",
6333
+ display: "flex",
6334
+ alignItems: "center",
6335
+ gap: "8px"
6336
+ },
6337
+ children: [
6338
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconSvg, { name: "error-warning-line", size: 16, color: "var(--chatllm-error, #ef4444)" }),
6339
+ "\uC774\uBBF8\uC9C0\uB97C \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4"
6340
+ ]
6341
+ }
6342
+ );
6343
+ }
6344
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
6345
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
6346
+ "div",
6347
+ {
6348
+ style: {
6349
+ position: "relative",
6350
+ borderRadius: "8px",
6351
+ overflow: "hidden",
6352
+ border: "1px solid var(--chatllm-border, #e5e7eb)",
6353
+ cursor: "pointer",
6354
+ maxWidth: part.width ? `${Math.min(part.width, 480)}px` : "480px"
6355
+ },
6356
+ onClick: () => setIsExpanded(true),
6357
+ children: [
6358
+ !isLoaded && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6359
+ "div",
6360
+ {
6361
+ style: {
6362
+ padding: "40px",
6363
+ display: "flex",
6364
+ alignItems: "center",
6365
+ justifyContent: "center",
6366
+ backgroundColor: "var(--chatllm-bg-secondary, #f1f5f9)"
6367
+ },
6368
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconSvg, { name: "loader-4-line", size: 24, color: "var(--chatllm-text-muted, #94a3b8)" })
6369
+ }
6370
+ ),
6371
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6372
+ "img",
6373
+ {
6374
+ src: part.url,
6375
+ alt: part.alt || "",
6376
+ onLoad: () => setIsLoaded(true),
6377
+ onError: () => setHasError(true),
6378
+ style: {
6379
+ display: isLoaded ? "block" : "none",
6380
+ width: "100%",
6381
+ height: "auto",
6382
+ maxHeight: "400px",
6383
+ objectFit: "contain"
6384
+ }
6385
+ }
6386
+ ),
6387
+ part.alt && isLoaded && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6388
+ "div",
6389
+ {
6390
+ style: {
6391
+ padding: "6px 10px",
6392
+ fontSize: "12px",
6393
+ color: "var(--chatllm-text-muted, #64748b)",
6394
+ backgroundColor: "var(--chatllm-bg-secondary, #f9fafb)",
6395
+ borderTop: "1px solid var(--chatllm-border, #e5e7eb)"
6396
+ },
6397
+ children: part.alt
6398
+ }
6399
+ )
6400
+ ]
6401
+ }
6402
+ ),
6403
+ isExpanded && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6404
+ "div",
6405
+ {
6406
+ onClick: () => setIsExpanded(false),
6407
+ style: {
6408
+ position: "fixed",
6409
+ inset: 0,
6410
+ backgroundColor: "rgba(0, 0, 0, 0.8)",
6411
+ display: "flex",
6412
+ alignItems: "center",
6413
+ justifyContent: "center",
6414
+ zIndex: 9999,
6415
+ cursor: "zoom-out"
6416
+ },
6417
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6418
+ "img",
6419
+ {
6420
+ src: part.url,
6421
+ alt: part.alt || "",
6422
+ style: {
6423
+ maxWidth: "90vw",
6424
+ maxHeight: "90vh",
6425
+ objectFit: "contain",
6426
+ borderRadius: "4px"
6427
+ }
6428
+ }
6429
+ )
6430
+ }
6431
+ )
6432
+ ] });
6433
+ };
6434
+
6435
+ // src/react/components/FileContentCard.tsx
6436
+ var import_jsx_runtime11 = require("react/jsx-runtime");
6437
+ var formatFileSize = (bytes) => {
6438
+ if (!bytes) return "";
6439
+ if (bytes < 1024) return `${bytes} B`;
6440
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
6441
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
6442
+ };
6443
+ var getFileIcon = (mimeType) => {
6444
+ if (!mimeType) return "file-text-line";
6445
+ if (mimeType.startsWith("image/")) return "image-line";
6446
+ if (mimeType.startsWith("video/")) return "video-line";
6447
+ if (mimeType.startsWith("audio/")) return "mic-line";
6448
+ if (mimeType.includes("pdf")) return "file-text-line";
6449
+ if (mimeType.includes("zip") || mimeType.includes("compressed")) return "folder-line";
6450
+ return "file-text-line";
6451
+ };
6452
+ var FileContentCard = ({ part }) => {
6453
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
6454
+ "a",
6455
+ {
6456
+ href: part.url,
6457
+ target: "_blank",
6458
+ rel: "noopener noreferrer",
6459
+ download: part.name,
6460
+ style: {
6461
+ display: "flex",
6462
+ alignItems: "center",
6463
+ gap: "12px",
6464
+ padding: "12px 16px",
6465
+ backgroundColor: "var(--chatllm-bg-secondary, #f9fafb)",
6466
+ borderRadius: "8px",
6467
+ border: "1px solid var(--chatllm-border, #e5e7eb)",
6468
+ textDecoration: "none",
6469
+ color: "inherit",
6470
+ transition: "background-color 0.15s ease",
6471
+ maxWidth: "320px"
6472
+ },
6473
+ children: [
6474
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6475
+ "div",
6476
+ {
6477
+ style: {
6478
+ width: "36px",
6479
+ height: "36px",
6480
+ borderRadius: "8px",
6481
+ backgroundColor: "var(--chatllm-primary-light, rgba(74, 144, 226, 0.1))",
6482
+ display: "flex",
6483
+ alignItems: "center",
6484
+ justifyContent: "center",
6485
+ flexShrink: 0
6486
+ },
6487
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconSvg, { name: getFileIcon(part.mimeType), size: 18, color: "var(--chatllm-primary, #4A90E2)" })
6488
+ }
6489
+ ),
6490
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
6491
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6492
+ "div",
6493
+ {
6494
+ style: {
6495
+ fontSize: "13px",
6496
+ fontWeight: 500,
6497
+ color: "var(--chatllm-text, #1e293b)",
6498
+ overflow: "hidden",
6499
+ textOverflow: "ellipsis",
6500
+ whiteSpace: "nowrap"
6501
+ },
6502
+ children: part.name
6503
+ }
6504
+ ),
6505
+ (part.size || part.mimeType) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6506
+ "div",
6507
+ {
6508
+ style: {
6509
+ fontSize: "11px",
6510
+ color: "var(--chatllm-text-muted, #94a3b8)",
6511
+ marginTop: "2px"
6512
+ },
6513
+ children: [formatFileSize(part.size), part.mimeType].filter(Boolean).join(" \xB7 ")
6514
+ }
6515
+ )
6516
+ ] }),
6517
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconSvg, { name: "download-line", size: 16, color: "var(--chatllm-text-muted, #94a3b8)" })
6518
+ ]
6519
+ }
6520
+ );
6521
+ };
6522
+
6523
+ // src/react/components/ContentPartRenderer.tsx
6524
+ var import_jsx_runtime12 = require("react/jsx-runtime");
6525
+ var ContentPartRenderer = ({
6526
+ parts,
6527
+ onChoiceClick,
6528
+ showThinking,
6529
+ thinkingDefaultOpen
6530
+ }) => {
6531
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: parts.map((part, idx) => {
6532
+ switch (part.type) {
6533
+ case "text":
6534
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6535
+ MarkdownRenderer,
6536
+ {
6537
+ content: part.content,
6538
+ onChoiceClick,
6539
+ showThinking,
6540
+ thinkingDefaultOpen
6541
+ },
6542
+ idx
6543
+ );
6544
+ case "image":
6545
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ImageContentCard, { part }, idx);
6546
+ case "file":
6547
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FileContentCard, { part }, idx);
6548
+ case "search_result":
6549
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: "6px" }, children: part.results.map((source, si) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6550
+ LinkChip,
6551
+ {
6552
+ text: source.title,
6553
+ url: source.url,
6554
+ index: si + 1,
6555
+ showFavicon: true
6556
+ },
6557
+ si
6558
+ )) }, idx);
6559
+ case "tool_loading":
6560
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6561
+ "div",
6562
+ {
6563
+ style: {
6564
+ display: "flex",
6565
+ alignItems: "center",
6566
+ gap: "8px",
6567
+ padding: "8px 12px",
6568
+ backgroundColor: "var(--chatllm-bg-secondary, #f9fafb)",
6569
+ borderRadius: "8px",
6570
+ fontSize: "13px",
6571
+ color: "var(--chatllm-text-muted, #64748b)"
6572
+ },
6573
+ children: [
6574
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconSvg, { name: "loader-4-line", size: 16, color: "var(--chatllm-primary, #4A90E2)" }),
6575
+ part.label || `${part.toolName} \uC2E4\uD589 \uC911...`
6576
+ ]
6577
+ },
6578
+ idx
6579
+ );
6580
+ case "tool_result":
6581
+ if (part.result.type === "image") {
6582
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6583
+ ImageContentCard,
6584
+ {
6585
+ part: { type: "image", url: part.result.content, alt: part.result.metadata?.alt }
6586
+ },
6587
+ idx
6588
+ );
6589
+ }
6590
+ if (part.result.type === "file") {
6591
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6592
+ FileContentCard,
6593
+ {
6594
+ part: {
6595
+ type: "file",
6596
+ name: part.result.metadata?.fileName || "file",
6597
+ url: part.result.content,
6598
+ mimeType: part.result.metadata?.mimeType
6599
+ }
6600
+ },
6601
+ idx
6602
+ );
6603
+ }
6604
+ if (part.result.type === "error") {
6605
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6606
+ "div",
6607
+ {
6608
+ style: {
6609
+ padding: "10px 14px",
6610
+ backgroundColor: "var(--chatllm-error-bg, #fef2f2)",
6611
+ borderRadius: "8px",
6612
+ border: "1px solid var(--chatllm-error-border, #fecaca)",
6613
+ fontSize: "13px",
6614
+ color: "var(--chatllm-error, #ef4444)",
6615
+ display: "flex",
6616
+ alignItems: "center",
6617
+ gap: "8px"
6618
+ },
6619
+ children: [
6620
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconSvg, { name: "error-warning-line", size: 16, color: "var(--chatllm-error, #ef4444)" }),
6621
+ part.result.content
6622
+ ]
6623
+ },
6624
+ idx
6625
+ );
6626
+ }
6627
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6628
+ MarkdownRenderer,
6629
+ {
6630
+ content: part.result.content,
6631
+ onChoiceClick,
6632
+ showThinking,
6633
+ thinkingDefaultOpen
6634
+ },
6635
+ idx
6636
+ );
6637
+ case "error":
6638
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6639
+ "div",
6640
+ {
6641
+ style: {
6642
+ padding: "10px 14px",
6643
+ backgroundColor: "var(--chatllm-error-bg, #fef2f2)",
6644
+ borderRadius: "8px",
6645
+ border: "1px solid var(--chatllm-error-border, #fecaca)",
6646
+ fontSize: "13px",
6647
+ color: "var(--chatllm-error, #ef4444)",
6648
+ display: "flex",
6649
+ alignItems: "center",
6650
+ gap: "8px"
6651
+ },
6652
+ children: [
6653
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconSvg, { name: "error-warning-line", size: 16, color: "var(--chatllm-error, #ef4444)" }),
6654
+ part.message
6655
+ ]
6656
+ },
6657
+ idx
6658
+ );
6659
+ default:
6660
+ return null;
6661
+ }
6662
+ }) });
6663
+ };
6664
+
6665
+ // src/react/components/MessageBubble.tsx
6666
+ var import_jsx_runtime13 = require("react/jsx-runtime");
6155
6667
  var MessageBubble = ({
6156
6668
  message,
6157
6669
  isLoading,
@@ -6173,8 +6685,8 @@ var MessageBubble = ({
6173
6685
  isLoadingAlternative = false,
6174
6686
  onPollSubmit
6175
6687
  }) => {
6176
- const [showActions, setShowActions] = (0, import_react12.useState)(false);
6177
- const [showModelMenu, setShowModelMenu] = (0, import_react12.useState)(false);
6688
+ const [showActions, setShowActions] = (0, import_react13.useState)(false);
6689
+ const [showModelMenu, setShowModelMenu] = (0, import_react13.useState)(false);
6178
6690
  const isUser = message.role === "user";
6179
6691
  const isAssistant = message.role === "assistant";
6180
6692
  const relevantAlternatives = isUser ? alternatives : message.alternatives;
@@ -6192,7 +6704,7 @@ var MessageBubble = ({
6192
6704
  }
6193
6705
  };
6194
6706
  if (isUser) {
6195
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
6707
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6196
6708
  "div",
6197
6709
  {
6198
6710
  className: "chatllm-message chatllm-message--user",
@@ -6206,7 +6718,7 @@ var MessageBubble = ({
6206
6718
  onMouseLeave: () => setShowActions(false),
6207
6719
  onMouseUp: handleMouseUp,
6208
6720
  children: [
6209
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6721
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6210
6722
  "div",
6211
6723
  {
6212
6724
  style: {
@@ -6216,7 +6728,7 @@ var MessageBubble = ({
6216
6728
  borderRadius: "16px",
6217
6729
  borderTopRightRadius: "4px"
6218
6730
  },
6219
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6731
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6220
6732
  "div",
6221
6733
  {
6222
6734
  style: {
@@ -6230,7 +6742,7 @@ var MessageBubble = ({
6230
6742
  )
6231
6743
  }
6232
6744
  ),
6233
- !isLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
6745
+ !isLoading && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6234
6746
  "div",
6235
6747
  {
6236
6748
  style: {
@@ -6242,7 +6754,7 @@ var MessageBubble = ({
6242
6754
  transition: "opacity 0.15s ease"
6243
6755
  },
6244
6756
  children: [
6245
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { onClick: onCopy, style: actionButtonSmallStyle, title: "\uBCF5\uC0AC", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6757
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { onClick: onCopy, style: actionButtonSmallStyle, title: "\uBCF5\uC0AC", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6246
6758
  IconSvg,
6247
6759
  {
6248
6760
  name: isCopied ? "check-line" : "file-copy-line",
@@ -6250,7 +6762,7 @@ var MessageBubble = ({
6250
6762
  color: isCopied ? "var(--chatllm-success)" : "var(--chatllm-text-muted)"
6251
6763
  }
6252
6764
  ) }),
6253
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { onClick: onEdit, style: actionButtonSmallStyle, title: "\uC218\uC815", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconSvg, { name: "edit-line", size: 12, color: "var(--chatllm-text-muted)" }) })
6765
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { onClick: onEdit, style: actionButtonSmallStyle, title: "\uC218\uC815", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSvg, { name: "edit-line", size: 12, color: "var(--chatllm-text-muted)" }) })
6254
6766
  ]
6255
6767
  }
6256
6768
  )
@@ -6258,7 +6770,7 @@ var MessageBubble = ({
6258
6770
  }
6259
6771
  );
6260
6772
  }
6261
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
6773
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6262
6774
  "div",
6263
6775
  {
6264
6776
  className: "chatllm-message chatllm-message--assistant",
@@ -6272,7 +6784,7 @@ var MessageBubble = ({
6272
6784
  onMouseLeave: () => setShowActions(false),
6273
6785
  onMouseUp: handleMouseUp,
6274
6786
  children: [
6275
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
6787
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6276
6788
  "div",
6277
6789
  {
6278
6790
  className: "chatllm-sheet",
@@ -6283,7 +6795,7 @@ var MessageBubble = ({
6283
6795
  gap: "12px"
6284
6796
  },
6285
6797
  children: [
6286
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6798
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6287
6799
  "div",
6288
6800
  {
6289
6801
  style: {
@@ -6296,11 +6808,11 @@ var MessageBubble = ({
6296
6808
  justifyContent: "center",
6297
6809
  color: "var(--chatllm-primary)"
6298
6810
  },
6299
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconSvg, { name: "magic-line", size: 20 })
6811
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSvg, { name: "magic-line", size: 20 })
6300
6812
  }
6301
6813
  ) }),
6302
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
6303
- displayModel && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6814
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
6815
+ displayModel && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6304
6816
  "div",
6305
6817
  {
6306
6818
  style: {
@@ -6309,7 +6821,7 @@ var MessageBubble = ({
6309
6821
  gap: "8px",
6310
6822
  marginBottom: "8px"
6311
6823
  },
6312
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6824
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6313
6825
  "span",
6314
6826
  {
6315
6827
  style: {
@@ -6324,9 +6836,9 @@ var MessageBubble = ({
6324
6836
  )
6325
6837
  }
6326
6838
  ),
6327
- message.isDeepResearch && message.researchProgress && message.researchProgress.phase !== "done" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DeepResearchProgressUI, { progress: message.researchProgress }),
6328
- message.skillExecution && message.skillExecution.status !== "done" && (message.skillExecution.progress?.subAgents ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DeepResearchProgressUI, { progress: message.skillExecution.progress }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkillProgressUI, { execution: message.skillExecution })),
6329
- message.isDeepResearch && displayContent && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
6839
+ message.isDeepResearch && message.researchProgress && message.researchProgress.phase !== "done" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DeepResearchProgressUI, { progress: message.researchProgress }),
6840
+ message.skillExecution && message.skillExecution.status !== "done" && (message.skillExecution.progress?.subAgents ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DeepResearchProgressUI, { progress: message.skillExecution.progress }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkillProgressUI, { execution: message.skillExecution })),
6841
+ message.isDeepResearch && displayContent && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6330
6842
  "div",
6331
6843
  {
6332
6844
  className: "chatllm-deep-research__header",
@@ -6339,8 +6851,8 @@ var MessageBubble = ({
6339
6851
  borderBottom: "1px solid var(--chatllm-border-light)"
6340
6852
  },
6341
6853
  children: [
6342
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconSvg, { name: "search-eye-line", size: 18, color: "var(--chatllm-primary)" }),
6343
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6854
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSvg, { name: "search-eye-line", size: 18, color: "var(--chatllm-primary)" }),
6855
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6344
6856
  "span",
6345
6857
  {
6346
6858
  style: {
@@ -6351,7 +6863,7 @@ var MessageBubble = ({
6351
6863
  children: "\uC2EC\uCE35\uC5F0\uAD6C"
6352
6864
  }
6353
6865
  ),
6354
- displaySources && displaySources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
6866
+ displaySources && displaySources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6355
6867
  "span",
6356
6868
  {
6357
6869
  className: "chatllm-deep-research__source-count",
@@ -6373,14 +6885,14 @@ var MessageBubble = ({
6373
6885
  ]
6374
6886
  }
6375
6887
  ),
6376
- isLoading && !displayContent && !message.isDeepResearch && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: [
6377
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
6378
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", gap: "4px", alignItems: "center" }, children: [
6379
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "chatllm-dot-bounce", style: dotStyle }),
6380
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "chatllm-dot-bounce", style: dotStyle }),
6381
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "chatllm-dot-bounce", style: dotStyle })
6888
+ isLoading && !displayContent && !message.isDeepResearch && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: [
6889
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
6890
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", gap: "4px", alignItems: "center" }, children: [
6891
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "chatllm-dot-bounce", style: dotStyle }),
6892
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "chatllm-dot-bounce", style: dotStyle }),
6893
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "chatllm-dot-bounce", style: dotStyle })
6382
6894
  ] }),
6383
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6895
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6384
6896
  "span",
6385
6897
  {
6386
6898
  style: {
@@ -6393,16 +6905,24 @@ var MessageBubble = ({
6393
6905
  }
6394
6906
  )
6395
6907
  ] }),
6396
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "chatllm-skeleton-pulse", style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [
6397
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { height: "32px", width: "75%", backgroundColor: "var(--chatllm-bg-tertiary)", borderRadius: "8px" } }),
6398
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
6399
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { height: "16px", width: "100%", backgroundColor: "var(--chatllm-bg-secondary)", borderRadius: "4px" } }),
6400
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { height: "16px", width: "85%", backgroundColor: "var(--chatllm-bg-secondary)", borderRadius: "4px" } }),
6401
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { height: "16px", width: "65%", backgroundColor: "var(--chatllm-bg-secondary)", borderRadius: "4px" } })
6908
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "chatllm-skeleton-pulse", style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [
6909
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { height: "32px", width: "75%", backgroundColor: "var(--chatllm-bg-tertiary)", borderRadius: "8px" } }),
6910
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
6911
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { height: "16px", width: "100%", backgroundColor: "var(--chatllm-bg-secondary)", borderRadius: "4px" } }),
6912
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { height: "16px", width: "85%", backgroundColor: "var(--chatllm-bg-secondary)", borderRadius: "4px" } }),
6913
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { height: "16px", width: "65%", backgroundColor: "var(--chatllm-bg-secondary)", borderRadius: "4px" } })
6402
6914
  ] })
6403
6915
  ] })
6404
6916
  ] }),
6405
- displayContent && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { wordBreak: "break-word" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6917
+ message.contentParts?.length ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { wordBreak: "break-word" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6918
+ ContentPartRenderer,
6919
+ {
6920
+ parts: message.contentParts,
6921
+ onChoiceClick,
6922
+ showThinking,
6923
+ thinkingDefaultOpen
6924
+ }
6925
+ ) }) : displayContent ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { wordBreak: "break-word" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6406
6926
  MarkdownRenderer,
6407
6927
  {
6408
6928
  content: displayContent,
@@ -6410,8 +6930,8 @@ var MessageBubble = ({
6410
6930
  showThinking,
6411
6931
  thinkingDefaultOpen
6412
6932
  }
6413
- ) }),
6414
- message.pollBlock && message.pollBlock.questions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6933
+ ) }) : null,
6934
+ message.pollBlock && message.pollBlock.questions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6415
6935
  PollCard,
6416
6936
  {
6417
6937
  questions: message.pollBlock.questions,
@@ -6423,7 +6943,7 @@ var MessageBubble = ({
6423
6943
  }
6424
6944
  }
6425
6945
  ),
6426
- !isLoading && !displayContent && !message.pollBlock && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6946
+ !isLoading && !displayContent && !message.pollBlock && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6427
6947
  "div",
6428
6948
  {
6429
6949
  style: {
@@ -6436,7 +6956,7 @@ var MessageBubble = ({
6436
6956
  children: "\uC751\uB2F5\uC744 \uC0DD\uC131\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694."
6437
6957
  }
6438
6958
  ),
6439
- displaySources && displaySources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
6959
+ displaySources && displaySources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6440
6960
  "div",
6441
6961
  {
6442
6962
  style: {
@@ -6448,7 +6968,7 @@ var MessageBubble = ({
6448
6968
  borderTop: "1px solid var(--chatllm-border-light)"
6449
6969
  },
6450
6970
  children: [
6451
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6971
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6452
6972
  "span",
6453
6973
  {
6454
6974
  style: {
@@ -6460,7 +6980,7 @@ var MessageBubble = ({
6460
6980
  children: "\uCD9C\uCC98:"
6461
6981
  }
6462
6982
  ),
6463
- displaySources.map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
6983
+ displaySources.map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6464
6984
  LinkChip,
6465
6985
  {
6466
6986
  text: source.title,
@@ -6473,7 +6993,7 @@ var MessageBubble = ({
6473
6993
  ]
6474
6994
  }
6475
6995
  ),
6476
- relevantAlternatives && relevantAlternatives.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
6996
+ relevantAlternatives && relevantAlternatives.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6477
6997
  "div",
6478
6998
  {
6479
6999
  style: {
@@ -6487,8 +7007,8 @@ var MessageBubble = ({
6487
7007
  fontSize: "12px"
6488
7008
  },
6489
7009
  children: [
6490
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { color: "var(--chatllm-text-muted)", marginRight: "4px" }, children: displayModel || "\uBAA8\uB378" }),
6491
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
7010
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { color: "var(--chatllm-text-muted)", marginRight: "4px" }, children: displayModel || "\uBAA8\uB378" }),
7011
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6492
7012
  "button",
6493
7013
  {
6494
7014
  onClick: () => onAlternativeChange?.(Math.max(0, relevantActiveIndex - 1)),
@@ -6498,15 +7018,15 @@ var MessageBubble = ({
6498
7018
  opacity: relevantActiveIndex === 0 ? 0.5 : 1,
6499
7019
  cursor: relevantActiveIndex === 0 ? "not-allowed" : "pointer"
6500
7020
  },
6501
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconSvg, { name: "arrow-left-line", size: 12 })
7021
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSvg, { name: "arrow-left-line", size: 12 })
6502
7022
  }
6503
7023
  ),
6504
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { style: { color: "var(--chatllm-text-secondary)" }, children: [
7024
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { style: { color: "var(--chatllm-text-secondary)" }, children: [
6505
7025
  relevantActiveIndex + 1,
6506
7026
  " / ",
6507
7027
  relevantAlternatives.length + 1
6508
7028
  ] }),
6509
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
7029
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6510
7030
  "button",
6511
7031
  {
6512
7032
  onClick: () => onAlternativeChange?.(Math.min(relevantAlternatives.length, relevantActiveIndex + 1)),
@@ -6516,13 +7036,13 @@ var MessageBubble = ({
6516
7036
  opacity: relevantActiveIndex === relevantAlternatives.length ? 0.5 : 1,
6517
7037
  cursor: relevantActiveIndex === relevantAlternatives.length ? "not-allowed" : "pointer"
6518
7038
  },
6519
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconSvg, { name: "arrow-right-line", size: 12 })
7039
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSvg, { name: "arrow-right-line", size: 12 })
6520
7040
  }
6521
7041
  )
6522
7042
  ]
6523
7043
  }
6524
7044
  ),
6525
- isLoadingAlternative && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
7045
+ isLoadingAlternative && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6526
7046
  "div",
6527
7047
  {
6528
7048
  style: {
@@ -6537,12 +7057,12 @@ var MessageBubble = ({
6537
7057
  color: "var(--chatllm-primary, #2563eb)"
6538
7058
  },
6539
7059
  children: [
6540
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", gap: "4px", alignItems: "center" }, children: [
6541
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "chatllm-dot-bounce", style: dotStyle }),
6542
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "chatllm-dot-bounce", style: dotStyle }),
6543
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "chatllm-dot-bounce", style: dotStyle })
7060
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", gap: "4px", alignItems: "center" }, children: [
7061
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "chatllm-dot-bounce", style: dotStyle }),
7062
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "chatllm-dot-bounce", style: dotStyle }),
7063
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "chatllm-dot-bounce", style: dotStyle })
6544
7064
  ] }),
6545
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontWeight: 500 }, children: "\uB2E4\uB978 \uBAA8\uB378 \uC751\uB2F5 \uC0DD\uC131 \uC911..." })
7065
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontWeight: 500 }, children: "\uB2E4\uB978 \uBAA8\uB378 \uC751\uB2F5 \uC0DD\uC131 \uC911..." })
6546
7066
  ]
6547
7067
  }
6548
7068
  )
@@ -6550,7 +7070,7 @@ var MessageBubble = ({
6550
7070
  ]
6551
7071
  }
6552
7072
  ),
6553
- !isLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
7073
+ !isLoading && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6554
7074
  "div",
6555
7075
  {
6556
7076
  style: {
@@ -6563,7 +7083,7 @@ var MessageBubble = ({
6563
7083
  transition: "opacity 0.15s ease"
6564
7084
  },
6565
7085
  children: [
6566
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { onClick: onCopy, style: actionButtonSmallStyle, title: "\uBCF5\uC0AC", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
7086
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { onClick: onCopy, style: actionButtonSmallStyle, title: "\uBCF5\uC0AC", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6567
7087
  IconSvg,
6568
7088
  {
6569
7089
  name: isCopied ? "check-line" : "file-copy-line",
@@ -6571,18 +7091,18 @@ var MessageBubble = ({
6571
7091
  color: isCopied ? "var(--chatllm-success)" : "var(--chatllm-text-muted)"
6572
7092
  }
6573
7093
  ) }),
6574
- onRegenerate && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { onClick: onRegenerate, style: actionButtonSmallStyle, title: "\uB2E4\uC2DC \uC0DD\uC131", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconSvg, { name: "refresh-line", size: 12, color: "var(--chatllm-text-muted)" }) }),
6575
- onAskOtherModel && otherModels.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { position: "relative" }, children: [
6576
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
7094
+ onRegenerate && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { onClick: onRegenerate, style: actionButtonSmallStyle, title: "\uB2E4\uC2DC \uC0DD\uC131", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSvg, { name: "refresh-line", size: 12, color: "var(--chatllm-text-muted)" }) }),
7095
+ onAskOtherModel && otherModels.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { position: "relative" }, children: [
7096
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6577
7097
  "button",
6578
7098
  {
6579
7099
  onClick: () => setShowModelMenu(!showModelMenu),
6580
7100
  style: actionButtonSmallStyle,
6581
7101
  title: "\uB2E4\uB978 \uBAA8\uB378\uC5D0\uAC8C \uC9C8\uBB38",
6582
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconSvg, { name: "robot-line", size: 12, color: "var(--chatllm-text-muted)" })
7102
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSvg, { name: "robot-line", size: 12, color: "var(--chatllm-text-muted)" })
6583
7103
  }
6584
7104
  ),
6585
- showModelMenu && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
7105
+ showModelMenu && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6586
7106
  ModelMenu,
6587
7107
  {
6588
7108
  models: otherModels,
@@ -6601,7 +7121,7 @@ var MessageBubble = ({
6601
7121
  }
6602
7122
  );
6603
7123
  };
6604
- var ModelMenu = ({ models, onSelect, onClose }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
7124
+ var ModelMenu = ({ models, onSelect, onClose }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6605
7125
  "div",
6606
7126
  {
6607
7127
  style: {
@@ -6619,7 +7139,7 @@ var ModelMenu = ({ models, onSelect, onClose }) => /* @__PURE__ */ (0, import_js
6619
7139
  },
6620
7140
  onMouseLeave: onClose,
6621
7141
  children: [
6622
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
7142
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6623
7143
  "div",
6624
7144
  {
6625
7145
  style: {
@@ -6634,7 +7154,7 @@ var ModelMenu = ({ models, onSelect, onClose }) => /* @__PURE__ */ (0, import_js
6634
7154
  children: "\uB2E4\uB978 \uBAA8\uB378\uC5D0\uAC8C \uC9C8\uBB38"
6635
7155
  }
6636
7156
  ),
6637
- models.map((model) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
7157
+ models.map((model) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6638
7158
  "button",
6639
7159
  {
6640
7160
  onClick: () => onSelect(model.id),
@@ -6659,9 +7179,9 @@ var ModelMenu = ({ models, onSelect, onClose }) => /* @__PURE__ */ (0, import_js
6659
7179
  e.currentTarget.style.backgroundColor = "transparent";
6660
7180
  },
6661
7181
  children: [
6662
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconSvg, { name: "robot-line", size: 16, color: "var(--chatllm-primary)" }),
6663
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { flex: 1, fontWeight: 500 }, children: model.name }),
6664
- model.provider && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
7182
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSvg, { name: "robot-line", size: 16, color: "var(--chatllm-primary)" }),
7183
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { flex: 1, fontWeight: 500 }, children: model.name }),
7184
+ model.provider && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6665
7185
  "span",
6666
7186
  {
6667
7187
  style: {
@@ -6710,7 +7230,7 @@ var navButtonStyle = {
6710
7230
  };
6711
7231
 
6712
7232
  // src/react/components/MessageList.tsx
6713
- var import_jsx_runtime11 = require("react/jsx-runtime");
7233
+ var import_jsx_runtime14 = require("react/jsx-runtime");
6714
7234
  var MessageList = ({
6715
7235
  messages,
6716
7236
  isLoading,
@@ -6730,14 +7250,14 @@ var MessageList = ({
6730
7250
  loadingAlternativeFor,
6731
7251
  onPollSubmit
6732
7252
  }) => {
6733
- const messagesEndRef = (0, import_react13.useRef)(null);
6734
- const containerRef = (0, import_react13.useRef)(null);
6735
- const [selectedText, setSelectedText] = (0, import_react13.useState)("");
6736
- const [selectionPosition, setSelectionPosition] = (0, import_react13.useState)(null);
6737
- (0, import_react13.useEffect)(() => {
7253
+ const messagesEndRef = (0, import_react14.useRef)(null);
7254
+ const containerRef = (0, import_react14.useRef)(null);
7255
+ const [selectedText, setSelectedText] = (0, import_react14.useState)("");
7256
+ const [selectionPosition, setSelectionPosition] = (0, import_react14.useState)(null);
7257
+ (0, import_react14.useEffect)(() => {
6738
7258
  messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
6739
7259
  }, [messages]);
6740
- const handleMouseUp = (0, import_react13.useCallback)(() => {
7260
+ const handleMouseUp = (0, import_react14.useCallback)(() => {
6741
7261
  const selection = window.getSelection();
6742
7262
  const text = selection?.toString().trim();
6743
7263
  if (text && text.length > 0) {
@@ -6769,7 +7289,7 @@ var MessageList = ({
6769
7289
  window.getSelection()?.removeAllRanges();
6770
7290
  }
6771
7291
  };
6772
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7292
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
6773
7293
  "div",
6774
7294
  {
6775
7295
  ref: containerRef,
@@ -6781,7 +7301,7 @@ var MessageList = ({
6781
7301
  },
6782
7302
  onMouseUp: handleMouseUp,
6783
7303
  children: [
6784
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7304
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
6785
7305
  "div",
6786
7306
  {
6787
7307
  style: {
@@ -6796,7 +7316,7 @@ var MessageList = ({
6796
7316
  const nextAssistant = message.role === "user" && index + 1 < messages.length ? messages[index + 1] : null;
6797
7317
  const assistantForAlts = nextAssistant?.role === "assistant" ? nextAssistant : null;
6798
7318
  const activeAltIndex = assistantForAlts ? activeAlternatives[assistantForAlts.id] ?? 0 : 0;
6799
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7319
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6800
7320
  MessageBubble,
6801
7321
  {
6802
7322
  message,
@@ -6827,11 +7347,11 @@ var MessageList = ({
6827
7347
  message.id
6828
7348
  );
6829
7349
  }),
6830
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref: messagesEndRef })
7350
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { ref: messagesEndRef })
6831
7351
  ]
6832
7352
  }
6833
7353
  ),
6834
- selectionPosition && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7354
+ selectionPosition && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
6835
7355
  "div",
6836
7356
  {
6837
7357
  style: {
@@ -6843,7 +7363,7 @@ var MessageList = ({
6843
7363
  pointerEvents: "auto"
6844
7364
  },
6845
7365
  children: [
6846
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7366
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
6847
7367
  "button",
6848
7368
  {
6849
7369
  onClick: handleQuote,
@@ -6863,12 +7383,12 @@ var MessageList = ({
6863
7383
  whiteSpace: "nowrap"
6864
7384
  },
6865
7385
  children: [
6866
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconSvg, { name: "double-quotes-l", size: 16, color: "#ffffff" }),
7386
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IconSvg, { name: "double-quotes-l", size: 16, color: "#ffffff" }),
6867
7387
  "\uC778\uC6A9\uD558\uAE30"
6868
7388
  ]
6869
7389
  }
6870
7390
  ),
6871
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7391
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6872
7392
  "div",
6873
7393
  {
6874
7394
  style: {
@@ -6893,7 +7413,7 @@ var MessageList = ({
6893
7413
  };
6894
7414
 
6895
7415
  // src/react/components/EmptyState.tsx
6896
- var import_jsx_runtime12 = require("react/jsx-runtime");
7416
+ var import_jsx_runtime15 = require("react/jsx-runtime");
6897
7417
  var EmptyState = ({
6898
7418
  greeting,
6899
7419
  templates = [],
@@ -6911,7 +7431,7 @@ var EmptyState = ({
6911
7431
  return iconMap[icon] || "sparkling-line";
6912
7432
  };
6913
7433
  const hasContent = actions.length > 0 || templates.length > 0;
6914
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
7434
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6915
7435
  "div",
6916
7436
  {
6917
7437
  className: "chatllm-empty-state",
@@ -6926,7 +7446,7 @@ var EmptyState = ({
6926
7446
  textAlign: "center"
6927
7447
  },
6928
7448
  children: [
6929
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7449
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6930
7450
  "div",
6931
7451
  {
6932
7452
  className: "chatllm-sheet",
@@ -6940,10 +7460,10 @@ var EmptyState = ({
6940
7460
  marginBottom: "32px",
6941
7461
  color: "var(--chatllm-primary)"
6942
7462
  },
6943
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconSvg, { name: "chat-1-line", size: 40 })
7463
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconSvg, { name: "chat-1-line", size: 40 })
6944
7464
  }
6945
7465
  ),
6946
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7466
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6947
7467
  "h1",
6948
7468
  {
6949
7469
  style: {
@@ -6956,7 +7476,7 @@ var EmptyState = ({
6956
7476
  children: "How can I help you today?"
6957
7477
  }
6958
7478
  ),
6959
- (actions.length > 0 || templates.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
7479
+ (actions.length > 0 || templates.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6960
7480
  "div",
6961
7481
  {
6962
7482
  style: {
@@ -6968,7 +7488,7 @@ var EmptyState = ({
6968
7488
  marginBottom: "48px"
6969
7489
  },
6970
7490
  children: [
6971
- actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
7491
+ actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6972
7492
  "button",
6973
7493
  {
6974
7494
  onClick: () => onActionSelect?.(action),
@@ -6982,7 +7502,7 @@ var EmptyState = ({
6982
7502
  fontWeight: 500
6983
7503
  },
6984
7504
  children: [
6985
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7505
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6986
7506
  IconSvg,
6987
7507
  {
6988
7508
  name: getActionIcon(action.icon),
@@ -6995,7 +7515,7 @@ var EmptyState = ({
6995
7515
  },
6996
7516
  action.id
6997
7517
  )),
6998
- templates.slice(0, 4).map((template) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
7518
+ templates.slice(0, 4).map((template) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6999
7519
  "button",
7000
7520
  {
7001
7521
  onClick: () => onTemplateClick(template),
@@ -7009,7 +7529,7 @@ var EmptyState = ({
7009
7529
  fontWeight: 500
7010
7530
  },
7011
7531
  children: [
7012
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7532
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7013
7533
  IconSvg,
7014
7534
  {
7015
7535
  name: "sparkling-line",
@@ -7031,8 +7551,8 @@ var EmptyState = ({
7031
7551
  };
7032
7552
 
7033
7553
  // src/react/components/SettingsModal.tsx
7034
- var import_react14 = require("react");
7035
- var import_jsx_runtime13 = require("react/jsx-runtime");
7554
+ var import_react15 = require("react");
7555
+ var import_jsx_runtime16 = require("react/jsx-runtime");
7036
7556
  var DEFAULT_PERSONALIZATION2 = {
7037
7557
  responseStyle: {
7038
7558
  warmth: "medium",
@@ -7058,10 +7578,11 @@ var SettingsModal = ({
7058
7578
  memoryItems = [],
7059
7579
  contextSummary,
7060
7580
  onDeleteMemory,
7061
- onClearMemory
7581
+ onClearMemory,
7582
+ onSave
7062
7583
  }) => {
7063
- const [activeTab, setActiveTab] = (0, import_react14.useState)("general");
7064
- const [localApiKey, setLocalApiKey] = (0, import_react14.useState)(apiKey);
7584
+ const [activeTab, setActiveTab] = (0, import_react15.useState)("general");
7585
+ const [localApiKey, setLocalApiKey] = (0, import_react15.useState)(apiKey);
7065
7586
  if (!isOpen) return null;
7066
7587
  const updateResponseStyle = (key, value) => {
7067
7588
  onPersonalizationChange({
@@ -7085,7 +7606,7 @@ var SettingsModal = ({
7085
7606
  setLocalApiKey(value);
7086
7607
  onApiKeyChange?.(value);
7087
7608
  };
7088
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7609
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7089
7610
  "div",
7090
7611
  {
7091
7612
  className: "chatllm-settings-overlay",
@@ -7099,7 +7620,7 @@ var SettingsModal = ({
7099
7620
  zIndex: 1e3
7100
7621
  },
7101
7622
  onClick: onClose,
7102
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7623
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7103
7624
  "div",
7104
7625
  {
7105
7626
  className: "chatllm-settings-modal",
@@ -7117,7 +7638,7 @@ var SettingsModal = ({
7117
7638
  },
7118
7639
  onClick: (e) => e.stopPropagation(),
7119
7640
  children: [
7120
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7641
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7121
7642
  "div",
7122
7643
  {
7123
7644
  style: {
@@ -7128,7 +7649,7 @@ var SettingsModal = ({
7128
7649
  flexDirection: "column"
7129
7650
  },
7130
7651
  children: [
7131
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { padding: "16px", borderBottom: "1px solid var(--chatllm-border, #e5e7eb)" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7652
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { padding: "16px", borderBottom: "1px solid var(--chatllm-border, #e5e7eb)" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7132
7653
  "button",
7133
7654
  {
7134
7655
  onClick: onClose,
@@ -7142,11 +7663,11 @@ var SettingsModal = ({
7142
7663
  alignItems: "center",
7143
7664
  justifyContent: "center"
7144
7665
  },
7145
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSvg, { name: "close-line", size: 20, color: "var(--chatllm-text-muted, #6b7280)" })
7666
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IconSvg, { name: "close-line", size: 20, color: "var(--chatllm-text-muted, #6b7280)" })
7146
7667
  }
7147
7668
  ) }),
7148
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("nav", { style: { flex: 1, padding: "8px" }, children: [
7149
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7669
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("nav", { style: { flex: 1, padding: "8px" }, children: [
7670
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7150
7671
  TabButton,
7151
7672
  {
7152
7673
  active: activeTab === "general",
@@ -7155,7 +7676,7 @@ var SettingsModal = ({
7155
7676
  label: "\uC77C\uBC18"
7156
7677
  }
7157
7678
  ),
7158
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7679
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7159
7680
  TabButton,
7160
7681
  {
7161
7682
  active: activeTab === "personalization",
@@ -7164,7 +7685,7 @@ var SettingsModal = ({
7164
7685
  label: "\uAC1C\uC778 \uB9DE\uCDA4 \uC124\uC815"
7165
7686
  }
7166
7687
  ),
7167
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7688
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7168
7689
  TabButton,
7169
7690
  {
7170
7691
  active: activeTab === "memory",
@@ -7173,7 +7694,7 @@ var SettingsModal = ({
7173
7694
  label: "AI \uBA54\uBAA8\uB9AC"
7174
7695
  }
7175
7696
  ),
7176
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7697
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7177
7698
  TabButton,
7178
7699
  {
7179
7700
  active: activeTab === "data",
@@ -7186,24 +7707,24 @@ var SettingsModal = ({
7186
7707
  ]
7187
7708
  }
7188
7709
  ),
7189
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { flex: 1, overflow: "auto", padding: "24px" }, children: [
7190
- activeTab === "general" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
7191
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { style: { fontSize: "20px", fontWeight: 600, marginBottom: "24px", color: "var(--chatllm-text, #1f2937)" }, children: "\uC77C\uBC18" }),
7192
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SettingRow, { label: "\uC5B8\uC5B4", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7710
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { flex: 1, overflow: "auto", padding: "24px" }, children: [
7711
+ activeTab === "general" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
7712
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { style: { fontSize: "20px", fontWeight: 600, marginBottom: "24px", color: "var(--chatllm-text, #1f2937)" }, children: "\uC77C\uBC18" }),
7713
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SettingRow, { label: "\uC5B8\uC5B4", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7193
7714
  "select",
7194
7715
  {
7195
7716
  value: personalization.language,
7196
7717
  onChange: (e) => onPersonalizationChange({ ...personalization, language: e.target.value }),
7197
7718
  style: selectStyle,
7198
7719
  children: [
7199
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "auto", children: "\uC790\uB3D9 \uD0D0\uC9C0" }),
7200
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "ko", children: "\uD55C\uAD6D\uC5B4" }),
7201
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "en", children: "English" }),
7202
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "ja", children: "\u65E5\u672C\u8A9E" })
7720
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "auto", children: "\uC790\uB3D9 \uD0D0\uC9C0" }),
7721
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "ko", children: "\uD55C\uAD6D\uC5B4" }),
7722
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "en", children: "English" }),
7723
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "ja", children: "\u65E5\u672C\u8A9E" })
7203
7724
  ]
7204
7725
  }
7205
7726
  ) }),
7206
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SettingRow, { label: "\uAE30\uBCF8\uAC12\uC73C\uB85C \uCD08\uAE30\uD654", description: "\uBAA8\uB4E0 \uC124\uC815\uC744 \uCD08\uAE30 \uC0C1\uD0DC\uB85C \uB418\uB3CC\uB9BD\uB2C8\uB2E4", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7727
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SettingRow, { label: "\uAE30\uBCF8\uAC12\uC73C\uB85C \uCD08\uAE30\uD654", description: "\uBAA8\uB4E0 \uC124\uC815\uC744 \uCD08\uAE30 \uC0C1\uD0DC\uB85C \uB418\uB3CC\uB9BD\uB2C8\uB2E4", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7207
7728
  "button",
7208
7729
  {
7209
7730
  onClick: () => onPersonalizationChange(DEFAULT_PERSONALIZATION2),
@@ -7211,11 +7732,11 @@ var SettingsModal = ({
7211
7732
  children: "\uCD08\uAE30\uD654"
7212
7733
  }
7213
7734
  ) }),
7214
- onApiKeyChange && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { marginTop: "32px", paddingTop: "24px", borderTop: "1px solid var(--chatllm-border, #e5e7eb)" }, children: [
7215
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h3", { style: { fontSize: "16px", fontWeight: 500, marginBottom: "16px", color: "var(--chatllm-text, #1f2937)" }, children: "API \uC124\uC815" }),
7216
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
7217
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { style: { display: "block", fontSize: "14px", marginBottom: "8px", color: "var(--chatllm-text, #374151)" }, children: apiKeyLabel }),
7218
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7735
+ onApiKeyChange && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { marginTop: "32px", paddingTop: "24px", borderTop: "1px solid var(--chatllm-border, #e5e7eb)" }, children: [
7736
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h3", { style: { fontSize: "16px", fontWeight: 500, marginBottom: "16px", color: "var(--chatllm-text, #1f2937)" }, children: "API \uC124\uC815" }),
7737
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
7738
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { style: { display: "block", fontSize: "14px", marginBottom: "8px", color: "var(--chatllm-text, #374151)" }, children: apiKeyLabel }),
7739
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7219
7740
  "input",
7220
7741
  {
7221
7742
  type: "password",
@@ -7225,18 +7746,18 @@ var SettingsModal = ({
7225
7746
  style: inputStyle
7226
7747
  }
7227
7748
  ),
7228
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { style: { fontSize: "12px", color: "var(--chatllm-text-muted, #9ca3af)", marginTop: "4px" }, children: apiKeyDescription })
7749
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: { fontSize: "12px", color: "var(--chatllm-text-muted, #9ca3af)", marginTop: "4px" }, children: apiKeyDescription })
7229
7750
  ] })
7230
7751
  ] })
7231
7752
  ] }),
7232
- activeTab === "personalization" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
7233
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { style: { fontSize: "20px", fontWeight: 600, marginBottom: "24px", color: "var(--chatllm-text, #1f2937)" }, children: "\uAC1C\uC778 \uB9DE\uCDA4 \uC124\uC815" }),
7234
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { style: { marginBottom: "32px" }, children: [
7235
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h3", { style: { fontSize: "14px", fontWeight: 500, color: "var(--chatllm-text-muted, #6b7280)", marginBottom: "16px" }, children: "\uC0AC\uC6A9\uC790 \uD504\uB85C\uD544" }),
7236
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [
7237
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
7238
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { style: labelStyle, children: "\uB2C9\uB124\uC784" }),
7239
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7753
+ activeTab === "personalization" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
7754
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { style: { fontSize: "20px", fontWeight: 600, marginBottom: "24px", color: "var(--chatllm-text, #1f2937)" }, children: "\uAC1C\uC778 \uB9DE\uCDA4 \uC124\uC815" }),
7755
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("section", { style: { marginBottom: "32px" }, children: [
7756
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h3", { style: { fontSize: "14px", fontWeight: 500, color: "var(--chatllm-text-muted, #6b7280)", marginBottom: "16px" }, children: "\uC0AC\uC6A9\uC790 \uD504\uB85C\uD544" }),
7757
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [
7758
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
7759
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { style: labelStyle, children: "\uB2C9\uB124\uC784" }),
7760
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7240
7761
  "input",
7241
7762
  {
7242
7763
  type: "text",
@@ -7247,9 +7768,9 @@ var SettingsModal = ({
7247
7768
  }
7248
7769
  )
7249
7770
  ] }),
7250
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
7251
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { style: labelStyle, children: "\uC9C1\uC5C5" }),
7252
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7771
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
7772
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { style: labelStyle, children: "\uC9C1\uC5C5" }),
7773
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7253
7774
  "input",
7254
7775
  {
7255
7776
  type: "text",
@@ -7260,9 +7781,9 @@ var SettingsModal = ({
7260
7781
  }
7261
7782
  )
7262
7783
  ] }),
7263
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
7264
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { style: labelStyle, children: "\uCD94\uAC00 \uC815\uBCF4" }),
7265
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7784
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
7785
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { style: labelStyle, children: "\uCD94\uAC00 \uC815\uBCF4" }),
7786
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7266
7787
  "textarea",
7267
7788
  {
7268
7789
  value: personalization.userProfile.additionalInfo || "",
@@ -7275,63 +7796,83 @@ var SettingsModal = ({
7275
7796
  ] })
7276
7797
  ] })
7277
7798
  ] }),
7278
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { children: [
7279
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h3", { style: { fontSize: "14px", fontWeight: 500, color: "var(--chatllm-text-muted, #6b7280)", marginBottom: "16px" }, children: "\uC751\uB2F5 \uC2A4\uD0C0\uC77C" }),
7280
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SettingRow, { label: "\uB530\uB73B\uD568", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7799
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("section", { children: [
7800
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h3", { style: { fontSize: "14px", fontWeight: 500, color: "var(--chatllm-text-muted, #6b7280)", marginBottom: "16px" }, children: "\uC751\uB2F5 \uC2A4\uD0C0\uC77C" }),
7801
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SettingRow, { label: "\uB530\uB73B\uD568", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7281
7802
  "select",
7282
7803
  {
7283
7804
  value: personalization.responseStyle.warmth,
7284
7805
  onChange: (e) => updateResponseStyle("warmth", e.target.value),
7285
7806
  style: selectStyle,
7286
7807
  children: [
7287
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "high", children: "\uB192\uC74C - \uCE5C\uADFC\uD558\uACE0 \uB530\uB73B\uD558\uAC8C" }),
7288
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "medium", children: "\uAE30\uBCF8\uAC12" }),
7289
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "low", children: "\uB0AE\uC74C - \uAC04\uACB0\uD558\uACE0 \uC0AC\uBB34\uC801\uC73C\uB85C" })
7808
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "high", children: "\uB192\uC74C - \uCE5C\uADFC\uD558\uACE0 \uB530\uB73B\uD558\uAC8C" }),
7809
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "medium", children: "\uAE30\uBCF8\uAC12" }),
7810
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "low", children: "\uB0AE\uC74C - \uAC04\uACB0\uD558\uACE0 \uC0AC\uBB34\uC801\uC73C\uB85C" })
7290
7811
  ]
7291
7812
  }
7292
7813
  ) }),
7293
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SettingRow, { label: "\uC5F4\uC815\uC801", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7814
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SettingRow, { label: "\uC5F4\uC815\uC801", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7294
7815
  "select",
7295
7816
  {
7296
7817
  value: personalization.responseStyle.enthusiasm,
7297
7818
  onChange: (e) => updateResponseStyle("enthusiasm", e.target.value),
7298
7819
  style: selectStyle,
7299
7820
  children: [
7300
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "high", children: "\uB192\uC74C - \uC801\uADF9\uC801\uC774\uACE0 \uD65C\uBC1C\uD558\uAC8C" }),
7301
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "medium", children: "\uAE30\uBCF8\uAC12" }),
7302
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "low", children: "\uB0AE\uC74C - \uCC28\uBD84\uD558\uACE0 \uC808\uC81C\uC788\uAC8C" })
7821
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "high", children: "\uB192\uC74C - \uC801\uADF9\uC801\uC774\uACE0 \uD65C\uBC1C\uD558\uAC8C" }),
7822
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "medium", children: "\uAE30\uBCF8\uAC12" }),
7823
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "low", children: "\uB0AE\uC74C - \uCC28\uBD84\uD558\uACE0 \uC808\uC81C\uC788\uAC8C" })
7303
7824
  ]
7304
7825
  }
7305
7826
  ) }),
7306
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SettingRow, { label: "\uC774\uBAA8\uC9C0 \uC0AC\uC6A9", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7827
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SettingRow, { label: "\uC774\uBAA8\uC9C0 \uC0AC\uC6A9", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7307
7828
  "select",
7308
7829
  {
7309
7830
  value: personalization.responseStyle.emojiUsage,
7310
7831
  onChange: (e) => updateResponseStyle("emojiUsage", e.target.value),
7311
7832
  style: selectStyle,
7312
7833
  children: [
7313
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "high", children: "\uB192\uC74C - \uC790\uC8FC \uC0AC\uC6A9" }),
7314
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "medium", children: "\uAE30\uBCF8\uAC12" }),
7315
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "low", children: "\uB0AE\uC74C - \uAC70\uC758 \uC0AC\uC6A9 \uC548 \uD568" })
7834
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "high", children: "\uB192\uC74C - \uC790\uC8FC \uC0AC\uC6A9" }),
7835
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "medium", children: "\uAE30\uBCF8\uAC12" }),
7836
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "low", children: "\uB0AE\uC74C - \uAC70\uC758 \uC0AC\uC6A9 \uC548 \uD568" })
7316
7837
  ]
7317
7838
  }
7318
7839
  ) }),
7319
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SettingRow, { label: "\uC751\uB2F5 \uAE38\uC774", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7840
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SettingRow, { label: "\uC751\uB2F5 \uAE38\uC774", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7320
7841
  "select",
7321
7842
  {
7322
7843
  value: personalization.responseStyle.verbosity,
7323
7844
  onChange: (e) => updateResponseStyle("verbosity", e.target.value),
7324
7845
  style: selectStyle,
7325
7846
  children: [
7326
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "detailed", children: "\uC0C1\uC138 - \uC790\uC138\uD558\uAC8C \uC124\uBA85" }),
7327
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "balanced", children: "\uAE30\uBCF8\uAC12" }),
7328
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "concise", children: "\uAC04\uACB0 - \uD575\uC2EC\uB9CC \uC694\uC57D" })
7847
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "detailed", children: "\uC0C1\uC138 - \uC790\uC138\uD558\uAC8C \uC124\uBA85" }),
7848
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "balanced", children: "\uAE30\uBCF8\uAC12" }),
7849
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "concise", children: "\uAC04\uACB0 - \uD575\uC2EC\uB9CC \uC694\uC57D" })
7329
7850
  ]
7330
7851
  }
7331
7852
  ) })
7332
- ] })
7853
+ ] }),
7854
+ onSave && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { marginTop: "24px", display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7855
+ "button",
7856
+ {
7857
+ onClick: onSave,
7858
+ style: {
7859
+ padding: "10px 24px",
7860
+ backgroundColor: "var(--chatllm-primary, #4A90E2)",
7861
+ color: "#fff",
7862
+ border: "none",
7863
+ borderRadius: "8px",
7864
+ fontSize: "14px",
7865
+ fontWeight: 600,
7866
+ cursor: "pointer",
7867
+ transition: "opacity 0.15s ease"
7868
+ },
7869
+ onMouseEnter: (e) => e.currentTarget.style.opacity = "0.85",
7870
+ onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
7871
+ children: "\uC800\uC7A5"
7872
+ }
7873
+ ) })
7333
7874
  ] }),
7334
- activeTab === "memory" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7875
+ activeTab === "memory" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7335
7876
  MemoryTabContent,
7336
7877
  {
7337
7878
  items: memoryItems,
@@ -7340,9 +7881,9 @@ var SettingsModal = ({
7340
7881
  onClearAll: onClearMemory
7341
7882
  }
7342
7883
  ),
7343
- activeTab === "data" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
7344
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { style: { fontSize: "20px", fontWeight: 600, marginBottom: "24px", color: "var(--chatllm-text, #1f2937)" }, children: "\uB370\uC774\uD130 \uC81C\uC5B4" }),
7345
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SettingRow, { label: "\uBA54\uBAA8\uB9AC \uC0AC\uC6A9", description: "\uB300\uD654 \uCEE8\uD14D\uC2A4\uD2B8\uB97C \uAE30\uC5B5\uD569\uB2C8\uB2E4", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7884
+ activeTab === "data" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
7885
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { style: { fontSize: "20px", fontWeight: 600, marginBottom: "24px", color: "var(--chatllm-text, #1f2937)" }, children: "\uB370\uC774\uD130 \uC81C\uC5B4" }),
7886
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SettingRow, { label: "\uBA54\uBAA8\uB9AC \uC0AC\uC6A9", description: "\uB300\uD654 \uCEE8\uD14D\uC2A4\uD2B8\uB97C \uAE30\uC5B5\uD569\uB2C8\uB2E4", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7346
7887
  "button",
7347
7888
  {
7348
7889
  onClick: () => onPersonalizationChange({ ...personalization, useMemory: !personalization.useMemory }),
@@ -7356,7 +7897,7 @@ var SettingsModal = ({
7356
7897
  position: "relative",
7357
7898
  transition: "background-color 0.2s"
7358
7899
  },
7359
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7900
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7360
7901
  "div",
7361
7902
  {
7362
7903
  style: {
@@ -7374,7 +7915,7 @@ var SettingsModal = ({
7374
7915
  )
7375
7916
  }
7376
7917
  ) }),
7377
- onClearAllData && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SettingRow, { label: "\uB300\uD654 \uAE30\uB85D \uC0AD\uC81C", description: "\uBAA8\uB4E0 \uB300\uD654 \uAE30\uB85D\uC744 \uC0AD\uC81C\uD569\uB2C8\uB2E4", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7918
+ onClearAllData && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SettingRow, { label: "\uB300\uD654 \uAE30\uB85D \uC0AD\uC81C", description: "\uBAA8\uB4E0 \uB300\uD654 \uAE30\uB85D\uC744 \uC0AD\uC81C\uD569\uB2C8\uB2E4", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7378
7919
  "button",
7379
7920
  {
7380
7921
  onClick: () => {
@@ -7394,7 +7935,7 @@ var SettingsModal = ({
7394
7935
  }
7395
7936
  );
7396
7937
  };
7397
- var TabButton = ({ active, onClick, icon, label }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7938
+ var TabButton = ({ active, onClick, icon, label }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7398
7939
  "button",
7399
7940
  {
7400
7941
  onClick,
@@ -7415,12 +7956,12 @@ var TabButton = ({ active, onClick, icon, label }) => /* @__PURE__ */ (0, import
7415
7956
  marginBottom: "4px"
7416
7957
  },
7417
7958
  children: [
7418
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSvg, { name: icon, size: 20 }),
7959
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IconSvg, { name: icon, size: 20 }),
7419
7960
  label
7420
7961
  ]
7421
7962
  }
7422
7963
  );
7423
- var SettingRow = ({ label, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7964
+ var SettingRow = ({ label, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7424
7965
  "div",
7425
7966
  {
7426
7967
  style: {
@@ -7431,9 +7972,9 @@ var SettingRow = ({ label, description, children }) => /* @__PURE__ */ (0, impor
7431
7972
  borderBottom: "1px solid var(--chatllm-border-light, #f3f4f6)"
7432
7973
  },
7433
7974
  children: [
7434
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
7435
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: "14px", color: "var(--chatllm-text, #374151)" }, children: label }),
7436
- description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { style: { fontSize: "12px", color: "var(--chatllm-text-muted, #9ca3af)", marginTop: "2px" }, children: description })
7975
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
7976
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: "14px", color: "var(--chatllm-text, #374151)" }, children: label }),
7977
+ description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: { fontSize: "12px", color: "var(--chatllm-text-muted, #9ca3af)", marginTop: "2px" }, children: description })
7437
7978
  ] }),
7438
7979
  children
7439
7980
  ]
@@ -7493,8 +8034,8 @@ var memoryCategoryColors = {
7493
8034
  preference: "#8b5cf6"
7494
8035
  };
7495
8036
  var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
7496
- const [activeFilter, setActiveFilter] = (0, import_react14.useState)("all");
7497
- const [expandedId, setExpandedId] = (0, import_react14.useState)(null);
8037
+ const [activeFilter, setActiveFilter] = (0, import_react15.useState)("all");
8038
+ const [expandedId, setExpandedId] = (0, import_react15.useState)(null);
7498
8039
  const filteredItems = activeFilter === "all" ? items : items.filter((item) => item.category === activeFilter);
7499
8040
  const formatDate = (timestamp) => {
7500
8041
  const date = new Date(timestamp);
@@ -7505,15 +8046,15 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
7505
8046
  minute: "2-digit"
7506
8047
  });
7507
8048
  };
7508
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
7509
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "24px" }, children: [
7510
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { style: { fontSize: "20px", fontWeight: 600, color: "var(--chatllm-text, #1f2937)", margin: 0 }, children: "AI \uBA54\uBAA8\uB9AC" }),
7511
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { style: { fontSize: "13px", color: "var(--chatllm-text-muted, #9ca3af)" }, children: [
8049
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
8050
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "24px" }, children: [
8051
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { style: { fontSize: "20px", fontWeight: 600, color: "var(--chatllm-text, #1f2937)", margin: 0 }, children: "AI \uBA54\uBAA8\uB9AC" }),
8052
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { style: { fontSize: "13px", color: "var(--chatllm-text-muted, #9ca3af)" }, children: [
7512
8053
  items.length,
7513
8054
  "\uAC1C \uD56D\uBAA9"
7514
8055
  ] })
7515
8056
  ] }),
7516
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { display: "flex", gap: "6px", marginBottom: "20px", flexWrap: "wrap" }, children: ["all", "fact", "skill", "preference"].map((tab) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
8057
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: "flex", gap: "6px", marginBottom: "20px", flexWrap: "wrap" }, children: ["all", "fact", "skill", "preference"].map((tab) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7517
8058
  "button",
7518
8059
  {
7519
8060
  onClick: () => setActiveFilter(tab),
@@ -7531,7 +8072,7 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
7531
8072
  },
7532
8073
  tab
7533
8074
  )) }),
7534
- contextSummary && activeFilter === "all" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
8075
+ contextSummary && activeFilter === "all" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7535
8076
  "div",
7536
8077
  {
7537
8078
  style: {
@@ -7542,19 +8083,19 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
7542
8083
  borderLeft: "3px solid var(--chatllm-primary, #3b82f6)"
7543
8084
  },
7544
8085
  children: [
7545
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "6px", marginBottom: "8px" }, children: [
7546
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSvg, { name: "file-text-line", size: 14, color: "var(--chatllm-primary, #3b82f6)" }),
7547
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: "12px", fontWeight: 500, color: "var(--chatllm-primary, #3b82f6)" }, children: "\uB300\uD654 \uC694\uC57D" })
8086
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "6px", marginBottom: "8px" }, children: [
8087
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IconSvg, { name: "file-text-line", size: 14, color: "var(--chatllm-primary, #3b82f6)" }),
8088
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: "12px", fontWeight: 500, color: "var(--chatllm-primary, #3b82f6)" }, children: "\uB300\uD654 \uC694\uC57D" })
7548
8089
  ] }),
7549
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { style: { fontSize: "13px", lineHeight: "1.6", color: "var(--chatllm-text, #374151)", margin: 0 }, children: contextSummary })
8090
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: { fontSize: "13px", lineHeight: "1.6", color: "var(--chatllm-text, #374151)", margin: 0 }, children: contextSummary })
7550
8091
  ]
7551
8092
  }
7552
8093
  ),
7553
- filteredItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { padding: "40px 16px", textAlign: "center" }, children: [
7554
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSvg, { name: "robot-line", size: 40, color: "var(--chatllm-text-muted, #d1d5db)" }),
7555
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { style: { fontSize: "14px", color: "var(--chatllm-text-muted, #9ca3af)", marginTop: "12px" }, children: "\uC800\uC7A5\uB41C \uBA54\uBAA8\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4" }),
7556
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { style: { fontSize: "12px", color: "var(--chatllm-text-muted, #d1d5db)", marginTop: "4px" }, children: "\uB300\uD654\uAC00 \uC9C4\uD589\uB418\uBA74 AI\uAC00 \uC790\uB3D9\uC73C\uB85C \uC815\uBCF4\uB97C \uD559\uC2B5\uD569\uB2C8\uB2E4" })
7557
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: filteredItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
8094
+ filteredItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { padding: "40px 16px", textAlign: "center" }, children: [
8095
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IconSvg, { name: "robot-line", size: 40, color: "var(--chatllm-text-muted, #d1d5db)" }),
8096
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: { fontSize: "14px", color: "var(--chatllm-text-muted, #9ca3af)", marginTop: "12px" }, children: "\uC800\uC7A5\uB41C \uBA54\uBAA8\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4" }),
8097
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: { fontSize: "12px", color: "var(--chatllm-text-muted, #d1d5db)", marginTop: "4px" }, children: "\uB300\uD654\uAC00 \uC9C4\uD589\uB418\uBA74 AI\uAC00 \uC790\uB3D9\uC73C\uB85C \uC815\uBCF4\uB97C \uD559\uC2B5\uD569\uB2C8\uB2E4" })
8098
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: filteredItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7558
8099
  "div",
7559
8100
  {
7560
8101
  style: {
@@ -7567,10 +8108,10 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
7567
8108
  },
7568
8109
  onClick: () => setExpandedId(expandedId === item.id ? null : item.id),
7569
8110
  children: [
7570
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" }, children: [
7571
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
7572
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px", marginBottom: "4px" }, children: [
7573
- item.category && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
8111
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" }, children: [
8112
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
8113
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px", marginBottom: "4px" }, children: [
8114
+ item.category && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7574
8115
  "span",
7575
8116
  {
7576
8117
  style: {
@@ -7584,12 +8125,12 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
7584
8125
  children: memoryCategoryLabels[item.category]
7585
8126
  }
7586
8127
  ),
7587
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: "11px", color: "var(--chatllm-text-muted, #9ca3af)" }, children: formatDate(item.timestamp) })
8128
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: "11px", color: "var(--chatllm-text-muted, #9ca3af)" }, children: formatDate(item.timestamp) })
7588
8129
  ] }),
7589
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: "13px", fontWeight: 500, color: "var(--chatllm-text, #1f2937)" }, children: item.key })
8130
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: "13px", fontWeight: 500, color: "var(--chatllm-text, #1f2937)" }, children: item.key })
7590
8131
  ] }),
7591
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
7592
- onDelete && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
8132
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
8133
+ onDelete && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7593
8134
  "button",
7594
8135
  {
7595
8136
  onClick: (e) => {
@@ -7605,10 +8146,10 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
7605
8146
  opacity: 0.5
7606
8147
  },
7607
8148
  "aria-label": "\uBA54\uBAA8\uB9AC \uC0AD\uC81C",
7608
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSvg, { name: "delete-bin-line", size: 14, color: "var(--chatllm-text-muted, #9ca3af)" })
8149
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IconSvg, { name: "delete-bin-line", size: 14, color: "var(--chatllm-text-muted, #9ca3af)" })
7609
8150
  }
7610
8151
  ),
7611
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
8152
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7612
8153
  IconSvg,
7613
8154
  {
7614
8155
  name: expandedId === item.id ? "arrow-up-s-line" : "arrow-down-s-line",
@@ -7618,7 +8159,7 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
7618
8159
  )
7619
8160
  ] })
7620
8161
  ] }),
7621
- expandedId === item.id && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
8162
+ expandedId === item.id && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7622
8163
  "div",
7623
8164
  {
7624
8165
  style: {
@@ -7626,7 +8167,7 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
7626
8167
  paddingTop: "12px",
7627
8168
  borderTop: "1px solid var(--chatllm-border-light, #f3f4f6)"
7628
8169
  },
7629
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
8170
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7630
8171
  "p",
7631
8172
  {
7632
8173
  style: {
@@ -7645,7 +8186,7 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
7645
8186
  },
7646
8187
  item.id
7647
8188
  )) }),
7648
- onClearAll && items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { marginTop: "24px", paddingTop: "16px", borderTop: "1px solid var(--chatllm-border, #e5e7eb)" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
8189
+ onClearAll && items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { marginTop: "24px", paddingTop: "16px", borderTop: "1px solid var(--chatllm-border, #e5e7eb)" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7649
8190
  "button",
7650
8191
  {
7651
8192
  onClick: () => {
@@ -7661,7 +8202,7 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
7661
8202
  };
7662
8203
 
7663
8204
  // src/react/ChatUI.tsx
7664
- var import_jsx_runtime14 = require("react/jsx-runtime");
8205
+ var import_jsx_runtime17 = require("react/jsx-runtime");
7665
8206
  var DEFAULT_ACTIONS = [];
7666
8207
  var DEFAULT_TEMPLATES = [];
7667
8208
  var DEFAULT_MODELS = [
@@ -7944,6 +8485,7 @@ var ChatUIView = ({
7944
8485
  activeAlternatives,
7945
8486
  loadingAlternativeFor,
7946
8487
  updatePersonalization,
8488
+ savePersonalization,
7947
8489
  models: hookModels,
7948
8490
  isDeepResearchMode,
7949
8491
  toggleDeepResearchMode,
@@ -7967,7 +8509,7 @@ var ChatUIView = ({
7967
8509
  const handleChoiceClick = (choice) => {
7968
8510
  setInput(choice.text);
7969
8511
  };
7970
- const memoryItems = import_react15.default.useMemo(() => {
8512
+ const memoryItems = import_react16.default.useMemo(() => {
7971
8513
  if (!globalMemory?.state.entries) return [];
7972
8514
  const items = [];
7973
8515
  for (const [key, entry] of globalMemory.state.entries) {
@@ -7982,7 +8524,7 @@ var ChatUIView = ({
7982
8524
  return items;
7983
8525
  }, [globalMemory?.state.entries]);
7984
8526
  const themeClass = theme?.mode === "dark" ? "chatllm-dark" : "";
7985
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
8527
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
7986
8528
  "div",
7987
8529
  {
7988
8530
  className: `chatllm-root ${themeClass} ${className}`,
@@ -7995,7 +8537,7 @@ var ChatUIView = ({
7995
8537
  position: "relative"
7996
8538
  },
7997
8539
  children: [
7998
- showSidebar && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
8540
+ showSidebar && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7999
8541
  ChatSidebar,
8000
8542
  {
8001
8543
  sessions,
@@ -8010,7 +8552,7 @@ var ChatUIView = ({
8010
8552
  theme: theme?.mode
8011
8553
  }
8012
8554
  ),
8013
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
8555
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
8014
8556
  "main",
8015
8557
  {
8016
8558
  style: {
@@ -8022,7 +8564,7 @@ var ChatUIView = ({
8022
8564
  minWidth: 0
8023
8565
  },
8024
8566
  children: [
8025
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
8567
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8026
8568
  ChatHeader,
8027
8569
  {
8028
8570
  title: currentSession?.title || "\uC0C8 \uB300\uD654",
@@ -8036,7 +8578,7 @@ var ChatUIView = ({
8036
8578
  showSettings
8037
8579
  }
8038
8580
  ),
8039
- messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
8581
+ messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8040
8582
  EmptyState,
8041
8583
  {
8042
8584
  greeting,
@@ -8045,7 +8587,7 @@ var ChatUIView = ({
8045
8587
  actions,
8046
8588
  onActionSelect: handleActionSelect
8047
8589
  }
8048
- ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
8590
+ ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8049
8591
  MessageList,
8050
8592
  {
8051
8593
  messages,
@@ -8067,7 +8609,7 @@ var ChatUIView = ({
8067
8609
  onPollSubmit: handlePollSubmit
8068
8610
  }
8069
8611
  ),
8070
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
8612
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8071
8613
  ChatInput,
8072
8614
  {
8073
8615
  value: input,
@@ -8093,7 +8635,7 @@ var ChatUIView = ({
8093
8635
  ]
8094
8636
  }
8095
8637
  ),
8096
- showSettings && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
8638
+ showSettings && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8097
8639
  SettingsModal,
8098
8640
  {
8099
8641
  isOpen: settingsOpen,
@@ -8110,7 +8652,8 @@ var ChatUIView = ({
8110
8652
  memoryItems,
8111
8653
  contextSummary: compressionState?.contextSummary,
8112
8654
  onDeleteMemory: globalMemory ? (key) => globalMemory.remove(key) : void 0,
8113
- onClearMemory: globalMemory ? () => globalMemory.clear() : void 0
8655
+ onClearMemory: globalMemory ? () => globalMemory.clear() : void 0,
8656
+ onSave: savePersonalization
8114
8657
  }
8115
8658
  )
8116
8659
  ]
@@ -8123,6 +8666,7 @@ var ChatUIWithHook = ({
8123
8666
  templates = DEFAULT_TEMPLATES,
8124
8667
  personalization,
8125
8668
  onPersonalizationChange,
8669
+ onPersonalizationSave,
8126
8670
  apiKey,
8127
8671
  onApiKeyChange,
8128
8672
  apiEndpoint = "/api/chat",
@@ -8152,13 +8696,16 @@ var ChatUIWithHook = ({
8152
8696
  showThinking = true,
8153
8697
  thinkingDefaultOpen = false,
8154
8698
  deepResearch,
8155
- skills
8699
+ skills,
8700
+ tools,
8701
+ onToolCall
8156
8702
  }) => {
8157
8703
  const hookOptions = {
8158
8704
  models,
8159
8705
  actions,
8160
8706
  initialPersonalization: personalization,
8161
8707
  onPersonalizationChange,
8708
+ onPersonalizationSave,
8162
8709
  initialSessionId,
8163
8710
  apiKey,
8164
8711
  apiEndpoint,
@@ -8179,10 +8726,12 @@ var ChatUIWithHook = ({
8179
8726
  onUpdateSessionTitle,
8180
8727
  onSaveMessages,
8181
8728
  deepResearch,
8182
- skills
8729
+ skills,
8730
+ tools,
8731
+ onToolCall
8183
8732
  };
8184
8733
  const state = useChatUI(hookOptions);
8185
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
8734
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8186
8735
  ChatUIView,
8187
8736
  {
8188
8737
  state,
@@ -8222,7 +8771,7 @@ var ChatUI = (props) => {
8222
8771
  onApiKeyChange,
8223
8772
  deepResearch
8224
8773
  } = props;
8225
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
8774
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8226
8775
  ChatUIView,
8227
8776
  {
8228
8777
  state: props.chatState,
@@ -8243,11 +8792,11 @@ var ChatUI = (props) => {
8243
8792
  }
8244
8793
  );
8245
8794
  }
8246
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ChatUIWithHook, { ...props });
8795
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChatUIWithHook, { ...props });
8247
8796
  };
8248
8797
 
8249
8798
  // src/react/hooks/useDeepResearch.ts
8250
- var import_react16 = require("react");
8799
+ var import_react17 = require("react");
8251
8800
  var REPORT_GENERATION_PROMPT2 = `\uB2F9\uC2E0\uC740 \uB9AC\uC11C\uCE58 \uBCF4\uACE0\uC11C \uC791\uC131 \uC804\uBB38\uAC00\uC785\uB2C8\uB2E4.
8252
8801
 
8253
8802
  <collected_sources>
@@ -8298,10 +8847,10 @@ var QUERY_ANALYSIS_PROMPT2 = `\uC0AC\uC6A9\uC790 \uC9C8\uBB38\uC744 \uBD84\uC11D
8298
8847
  - JSON \uC678 \uB2E4\uB978 \uD14D\uC2A4\uD2B8 \uCD9C\uB825 \uAE08\uC9C0`;
8299
8848
  var useDeepResearch = (options) => {
8300
8849
  const { onWebSearch, onExtractContent, apiEndpoint, apiKey, model, provider } = options;
8301
- const [isResearching, setIsResearching] = (0, import_react16.useState)(false);
8302
- const [progress, setProgress] = (0, import_react16.useState)(null);
8303
- const abortControllerRef = (0, import_react16.useRef)(null);
8304
- const callLLM2 = (0, import_react16.useCallback)(
8850
+ const [isResearching, setIsResearching] = (0, import_react17.useState)(false);
8851
+ const [progress, setProgress] = (0, import_react17.useState)(null);
8852
+ const abortControllerRef = (0, import_react17.useRef)(null);
8853
+ const callLLM2 = (0, import_react17.useCallback)(
8305
8854
  async (prompt, stream = false) => {
8306
8855
  const response = await fetch(apiEndpoint, {
8307
8856
  method: "POST",
@@ -8328,7 +8877,7 @@ var useDeepResearch = (options) => {
8328
8877
  },
8329
8878
  [apiEndpoint, apiKey, model, provider]
8330
8879
  );
8331
- const analyzeQuery2 = (0, import_react16.useCallback)(
8880
+ const analyzeQuery2 = (0, import_react17.useCallback)(
8332
8881
  async (query) => {
8333
8882
  const prompt = QUERY_ANALYSIS_PROMPT2.replace("{question}", query);
8334
8883
  const response = await callLLM2(prompt);
@@ -8347,7 +8896,7 @@ var useDeepResearch = (options) => {
8347
8896
  },
8348
8897
  [callLLM2]
8349
8898
  );
8350
- const runSubAgent2 = (0, import_react16.useCallback)(
8899
+ const runSubAgent2 = (0, import_react17.useCallback)(
8351
8900
  async (topic, queries, agentId, updateProgress) => {
8352
8901
  updateProgress({ status: "searching", searchCount: 0, resultsCount: 0 });
8353
8902
  const allResults = [];
@@ -8386,7 +8935,7 @@ var useDeepResearch = (options) => {
8386
8935
  },
8387
8936
  [onWebSearch, onExtractContent]
8388
8937
  );
8389
- const generateReport2 = (0, import_react16.useCallback)(
8938
+ const generateReport2 = (0, import_react17.useCallback)(
8390
8939
  async (query, results, onStreamContent) => {
8391
8940
  const allSources = [];
8392
8941
  const sourcesForPrompt = [];
@@ -8444,7 +8993,7 @@ var useDeepResearch = (options) => {
8444
8993
  },
8445
8994
  [callLLM2]
8446
8995
  );
8447
- const runDeepResearch = (0, import_react16.useCallback)(
8996
+ const runDeepResearch = (0, import_react17.useCallback)(
8448
8997
  async (query, onStreamContent) => {
8449
8998
  abortControllerRef.current = new AbortController();
8450
8999
  setIsResearching(true);
@@ -8547,7 +9096,7 @@ var useDeepResearch = (options) => {
8547
9096
  },
8548
9097
  [analyzeQuery2, runSubAgent2, generateReport2]
8549
9098
  );
8550
- const stopResearch = (0, import_react16.useCallback)(() => {
9099
+ const stopResearch = (0, import_react17.useCallback)(() => {
8551
9100
  abortControllerRef.current?.abort();
8552
9101
  setIsResearching(false);
8553
9102
  setProgress(null);
@@ -8561,8 +9110,8 @@ var useDeepResearch = (options) => {
8561
9110
  };
8562
9111
 
8563
9112
  // src/react/components/MemoryPanel.tsx
8564
- var import_react17 = require("react");
8565
- var import_jsx_runtime15 = require("react/jsx-runtime");
9113
+ var import_react18 = require("react");
9114
+ var import_jsx_runtime18 = require("react/jsx-runtime");
8566
9115
  var categoryLabels = {
8567
9116
  fact: "\uC0AC\uC6A9\uC790 \uC815\uBCF4",
8568
9117
  skill: "\uC804\uBB38 \uBD84\uC57C/\uAE30\uC220",
@@ -8581,8 +9130,8 @@ var MemoryPanel = ({
8581
9130
  isOpen,
8582
9131
  onToggle
8583
9132
  }) => {
8584
- const [expandedId, setExpandedId] = (0, import_react17.useState)(null);
8585
- const [activeTab, setActiveTab] = (0, import_react17.useState)("all");
9133
+ const [expandedId, setExpandedId] = (0, import_react18.useState)(null);
9134
+ const [activeTab, setActiveTab] = (0, import_react18.useState)("all");
8586
9135
  const filteredItems = activeTab === "all" ? items : items.filter((item) => item.category === activeTab);
8587
9136
  const formatDate = (timestamp) => {
8588
9137
  const date = new Date(timestamp);
@@ -8594,7 +9143,7 @@ var MemoryPanel = ({
8594
9143
  });
8595
9144
  };
8596
9145
  if (!isOpen) {
8597
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9146
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8598
9147
  "button",
8599
9148
  {
8600
9149
  onClick: onToggle,
@@ -8614,11 +9163,11 @@ var MemoryPanel = ({
8614
9163
  justifyContent: "center",
8615
9164
  zIndex: 100
8616
9165
  },
8617
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconSvg, { name: "robot-line", size: 24, color: "#ffffff" })
9166
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconSvg, { name: "robot-line", size: 24, color: "#ffffff" })
8618
9167
  }
8619
9168
  );
8620
9169
  }
8621
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
9170
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8622
9171
  "div",
8623
9172
  {
8624
9173
  className: "chatllm-memory-panel",
@@ -8638,7 +9187,7 @@ var MemoryPanel = ({
8638
9187
  zIndex: 100
8639
9188
  },
8640
9189
  children: [
8641
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
9190
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8642
9191
  "div",
8643
9192
  {
8644
9193
  style: {
@@ -8649,8 +9198,8 @@ var MemoryPanel = ({
8649
9198
  borderBottom: "1px solid var(--chatllm-border, #e5e7eb)"
8650
9199
  },
8651
9200
  children: [
8652
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
8653
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9201
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
9202
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8654
9203
  "div",
8655
9204
  {
8656
9205
  style: {
@@ -8662,19 +9211,19 @@ var MemoryPanel = ({
8662
9211
  alignItems: "center",
8663
9212
  justifyContent: "center"
8664
9213
  },
8665
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconSvg, { name: "robot-line", size: 18, color: "var(--chatllm-primary, #3b82f6)" })
9214
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconSvg, { name: "robot-line", size: 18, color: "var(--chatllm-primary, #3b82f6)" })
8666
9215
  }
8667
9216
  ),
8668
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
8669
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: "15px", fontWeight: 600, color: "var(--chatllm-text, #1f2937)" }, children: "AI \uBA54\uBAA8\uB9AC" }),
8670
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: "12px", color: "var(--chatllm-text-muted, #9ca3af)" }, children: [
9217
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
9218
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { fontSize: "15px", fontWeight: 600, color: "var(--chatllm-text, #1f2937)" }, children: "AI \uBA54\uBAA8\uB9AC" }),
9219
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { fontSize: "12px", color: "var(--chatllm-text-muted, #9ca3af)" }, children: [
8671
9220
  items.length,
8672
9221
  "\uAC1C \uD56D\uBAA9"
8673
9222
  ] })
8674
9223
  ] })
8675
9224
  ] }),
8676
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", gap: "4px" }, children: [
8677
- onClearAll && items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9225
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { display: "flex", gap: "4px" }, children: [
9226
+ onClearAll && items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8678
9227
  "button",
8679
9228
  {
8680
9229
  onClick: onClearAll,
@@ -8686,10 +9235,10 @@ var MemoryPanel = ({
8686
9235
  cursor: "pointer"
8687
9236
  },
8688
9237
  title: "\uC804\uCCB4 \uC0AD\uC81C",
8689
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconSvg, { name: "delete-bin-line", size: 18, color: "var(--chatllm-text-muted, #9ca3af)" })
9238
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconSvg, { name: "delete-bin-line", size: 18, color: "var(--chatllm-text-muted, #9ca3af)" })
8690
9239
  }
8691
9240
  ),
8692
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9241
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8693
9242
  "button",
8694
9243
  {
8695
9244
  onClick: onToggle,
@@ -8700,14 +9249,14 @@ var MemoryPanel = ({
8700
9249
  borderRadius: "8px",
8701
9250
  cursor: "pointer"
8702
9251
  },
8703
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconSvg, { name: "close-line", size: 18, color: "var(--chatllm-text-muted, #9ca3af)" })
9252
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconSvg, { name: "close-line", size: 18, color: "var(--chatllm-text-muted, #9ca3af)" })
8704
9253
  }
8705
9254
  )
8706
9255
  ] })
8707
9256
  ]
8708
9257
  }
8709
9258
  ),
8710
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9259
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8711
9260
  "div",
8712
9261
  {
8713
9262
  style: {
@@ -8717,7 +9266,7 @@ var MemoryPanel = ({
8717
9266
  borderBottom: "1px solid var(--chatllm-border-light, #f3f4f6)",
8718
9267
  overflowX: "auto"
8719
9268
  },
8720
- children: ["all", "fact", "skill", "preference"].map((tab) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9269
+ children: ["all", "fact", "skill", "preference"].map((tab) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8721
9270
  "button",
8722
9271
  {
8723
9272
  onClick: () => setActiveTab(tab),
@@ -8738,8 +9287,8 @@ var MemoryPanel = ({
8738
9287
  ))
8739
9288
  }
8740
9289
  ),
8741
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { flex: 1, overflow: "auto", padding: "12px" }, children: [
8742
- contextSummary && activeTab === "all" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
9290
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { flex: 1, overflow: "auto", padding: "12px" }, children: [
9291
+ contextSummary && activeTab === "all" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8743
9292
  "div",
8744
9293
  {
8745
9294
  style: {
@@ -8750,7 +9299,7 @@ var MemoryPanel = ({
8750
9299
  borderLeft: "3px solid var(--chatllm-primary, #3b82f6)"
8751
9300
  },
8752
9301
  children: [
8753
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
9302
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8754
9303
  "div",
8755
9304
  {
8756
9305
  style: {
@@ -8760,12 +9309,12 @@ var MemoryPanel = ({
8760
9309
  marginBottom: "8px"
8761
9310
  },
8762
9311
  children: [
8763
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconSvg, { name: "file-text-line", size: 14, color: "var(--chatllm-primary, #3b82f6)" }),
8764
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: "12px", fontWeight: 500, color: "var(--chatllm-primary, #3b82f6)" }, children: "\uB300\uD654 \uC694\uC57D" })
9312
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconSvg, { name: "file-text-line", size: 14, color: "var(--chatllm-primary, #3b82f6)" }),
9313
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: { fontSize: "12px", fontWeight: 500, color: "var(--chatllm-primary, #3b82f6)" }, children: "\uB300\uD654 \uC694\uC57D" })
8765
9314
  ]
8766
9315
  }
8767
9316
  ),
8768
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9317
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8769
9318
  "p",
8770
9319
  {
8771
9320
  style: {
@@ -8780,7 +9329,7 @@ var MemoryPanel = ({
8780
9329
  ]
8781
9330
  }
8782
9331
  ),
8783
- filteredItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
9332
+ filteredItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8784
9333
  "div",
8785
9334
  {
8786
9335
  style: {
@@ -8789,11 +9338,11 @@ var MemoryPanel = ({
8789
9338
  color: "var(--chatllm-text-muted, #9ca3af)"
8790
9339
  },
8791
9340
  children: [
8792
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconSvg, { name: "robot-line", size: 32, color: "var(--chatllm-text-muted, #d1d5db)" }),
8793
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { style: { fontSize: "14px", marginTop: "12px" }, children: "\uC800\uC7A5\uB41C \uBA54\uBAA8\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4" })
9341
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconSvg, { name: "robot-line", size: 32, color: "var(--chatllm-text-muted, #d1d5db)" }),
9342
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { style: { fontSize: "14px", marginTop: "12px" }, children: "\uC800\uC7A5\uB41C \uBA54\uBAA8\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4" })
8794
9343
  ]
8795
9344
  }
8796
- ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: filteredItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
9345
+ ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: filteredItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8797
9346
  "div",
8798
9347
  {
8799
9348
  style: {
@@ -8806,10 +9355,10 @@ var MemoryPanel = ({
8806
9355
  },
8807
9356
  onClick: () => setExpandedId(expandedId === item.id ? null : item.id),
8808
9357
  children: [
8809
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" }, children: [
8810
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
8811
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px", marginBottom: "4px" }, children: [
8812
- item.category && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9358
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" }, children: [
9359
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
9360
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px", marginBottom: "4px" }, children: [
9361
+ item.category && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8813
9362
  "span",
8814
9363
  {
8815
9364
  style: {
@@ -8823,9 +9372,9 @@ var MemoryPanel = ({
8823
9372
  children: categoryLabels[item.category]
8824
9373
  }
8825
9374
  ),
8826
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: "11px", color: "var(--chatllm-text-muted, #9ca3af)" }, children: formatDate(item.timestamp) })
9375
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: { fontSize: "11px", color: "var(--chatllm-text-muted, #9ca3af)" }, children: formatDate(item.timestamp) })
8827
9376
  ] }),
8828
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9377
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8829
9378
  "div",
8830
9379
  {
8831
9380
  style: {
@@ -8837,8 +9386,8 @@ var MemoryPanel = ({
8837
9386
  }
8838
9387
  )
8839
9388
  ] }),
8840
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
8841
- onDelete && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9389
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
9390
+ onDelete && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8842
9391
  "button",
8843
9392
  {
8844
9393
  onClick: (e) => {
@@ -8853,10 +9402,10 @@ var MemoryPanel = ({
8853
9402
  cursor: "pointer",
8854
9403
  opacity: 0.5
8855
9404
  },
8856
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconSvg, { name: "delete-bin-line", size: 14, color: "var(--chatllm-text-muted, #9ca3af)" })
9405
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconSvg, { name: "delete-bin-line", size: 14, color: "var(--chatllm-text-muted, #9ca3af)" })
8857
9406
  }
8858
9407
  ),
8859
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9408
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8860
9409
  IconSvg,
8861
9410
  {
8862
9411
  name: expandedId === item.id ? "arrow-up-s-line" : "arrow-down-s-line",
@@ -8866,7 +9415,7 @@ var MemoryPanel = ({
8866
9415
  )
8867
9416
  ] })
8868
9417
  ] }),
8869
- expandedId === item.id && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9418
+ expandedId === item.id && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8870
9419
  "div",
8871
9420
  {
8872
9421
  style: {
@@ -8874,7 +9423,7 @@ var MemoryPanel = ({
8874
9423
  paddingTop: "12px",
8875
9424
  borderTop: "1px solid var(--chatllm-border-light, #f3f4f6)"
8876
9425
  },
8877
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9426
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8878
9427
  "p",
8879
9428
  {
8880
9429
  style: {
@@ -8904,10 +9453,13 @@ var MemoryPanel = ({
8904
9453
  ChatInput,
8905
9454
  ChatSidebar,
8906
9455
  ChatUI,
9456
+ ContentPartRenderer,
8907
9457
  DeepResearchProgressUI,
8908
9458
  EmptyState,
9459
+ FileContentCard,
8909
9460
  Icon,
8910
9461
  IconSvg,
9462
+ ImageContentCard,
8911
9463
  LinkChip,
8912
9464
  MarkdownRenderer,
8913
9465
  MemoryPanel,
@@ -8916,6 +9468,7 @@ var MemoryPanel = ({
8916
9468
  PollCard,
8917
9469
  SettingsModal,
8918
9470
  SkillProgressUI,
9471
+ convertToolsToSkills,
8919
9472
  createAdvancedResearchSkill,
8920
9473
  createDeepResearchSkill,
8921
9474
  useChatUI,