@gendive/chatllm 0.14.1 → 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.
- package/dist/react/index.d.mts +168 -3
- package/dist/react/index.d.ts +168 -3
- package/dist/react/index.js +824 -274
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +809 -263
- package/dist/react/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/react/ChatUI.tsx
|
|
2
|
-
import
|
|
2
|
+
import React12 from "react";
|
|
3
3
|
|
|
4
4
|
// src/react/hooks/useChatUI.ts
|
|
5
5
|
import { useState as useState4, useRef as useRef3, useCallback as useCallback4, useEffect as useEffect2, useMemo as useMemo2 } from "react";
|
|
@@ -1155,6 +1155,45 @@ var formatPollResponse = (question, selectedOptions, otherText) => {
|
|
|
1155
1155
|
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.`;
|
|
1156
1156
|
};
|
|
1157
1157
|
|
|
1158
|
+
// src/react/utils/toolAdapter.ts
|
|
1159
|
+
var convertToolsToSkills = (tools, onToolCall) => {
|
|
1160
|
+
const skillMap = {};
|
|
1161
|
+
for (const tool of tools) {
|
|
1162
|
+
skillMap[tool.name] = {
|
|
1163
|
+
description: tool.description,
|
|
1164
|
+
trigger: "auto",
|
|
1165
|
+
label: tool.name,
|
|
1166
|
+
parameters: {
|
|
1167
|
+
type: "object",
|
|
1168
|
+
properties: Object.fromEntries(
|
|
1169
|
+
Object.entries(tool.parameters).map(([key, param]) => [
|
|
1170
|
+
key,
|
|
1171
|
+
{
|
|
1172
|
+
type: param.type,
|
|
1173
|
+
description: param.description,
|
|
1174
|
+
enum: param.enum
|
|
1175
|
+
}
|
|
1176
|
+
])
|
|
1177
|
+
),
|
|
1178
|
+
required: Object.entries(tool.parameters).filter(([, param]) => param.required).map(([key]) => key)
|
|
1179
|
+
},
|
|
1180
|
+
execute: async (params) => {
|
|
1181
|
+
const result = await onToolCall(tool.name, params);
|
|
1182
|
+
return {
|
|
1183
|
+
content: result.content,
|
|
1184
|
+
metadata: {
|
|
1185
|
+
__toolResult__: true,
|
|
1186
|
+
resultType: result.type,
|
|
1187
|
+
toolName: tool.name,
|
|
1188
|
+
...result.metadata
|
|
1189
|
+
}
|
|
1190
|
+
};
|
|
1191
|
+
}
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
return skillMap;
|
|
1195
|
+
};
|
|
1196
|
+
|
|
1158
1197
|
// src/react/utils/sessionCache.ts
|
|
1159
1198
|
var buildCacheKey = (storageKey, sessionId) => `${storageKey}_cache_${sessionId}`;
|
|
1160
1199
|
var writeSessionCache = (storageKey, session) => {
|
|
@@ -1232,7 +1271,10 @@ var useChatUI = (options) => {
|
|
|
1232
1271
|
// Poll options
|
|
1233
1272
|
enablePoll = true,
|
|
1234
1273
|
// Skills options
|
|
1235
|
-
skills
|
|
1274
|
+
skills,
|
|
1275
|
+
// Tool options
|
|
1276
|
+
tools,
|
|
1277
|
+
onToolCall
|
|
1236
1278
|
} = options;
|
|
1237
1279
|
const enableAutoExtraction = enableAutoExtractionProp ?? !useExternalStorage;
|
|
1238
1280
|
const [sessions, setSessions] = useState4([]);
|
|
@@ -1277,6 +1319,11 @@ var useChatUI = (options) => {
|
|
|
1277
1319
|
[globalMemoryConfig, storageKey]
|
|
1278
1320
|
);
|
|
1279
1321
|
const globalMemory = useGlobalMemoryEnabled ? useGlobalMemory(memoryOptions) : null;
|
|
1322
|
+
const mergedSkills = useMemo2(() => {
|
|
1323
|
+
if (!tools || !onToolCall) return skills || {};
|
|
1324
|
+
const toolSkills = convertToolsToSkills(tools, onToolCall);
|
|
1325
|
+
return { ...skills || {}, ...toolSkills };
|
|
1326
|
+
}, [skills, tools, onToolCall]);
|
|
1280
1327
|
const {
|
|
1281
1328
|
buildSkillsPrompt,
|
|
1282
1329
|
handleSkillCall,
|
|
@@ -1285,7 +1332,7 @@ var useChatUI = (options) => {
|
|
|
1285
1332
|
activeSkillExecution,
|
|
1286
1333
|
resolvedSkills
|
|
1287
1334
|
} = useSkills({
|
|
1288
|
-
skills,
|
|
1335
|
+
skills: mergedSkills,
|
|
1289
1336
|
deepResearch
|
|
1290
1337
|
});
|
|
1291
1338
|
const infoExtraction = useInfoExtraction({
|
|
@@ -1751,6 +1798,9 @@ ${newConversation}
|
|
|
1751
1798
|
return next;
|
|
1752
1799
|
});
|
|
1753
1800
|
}, [options.onPersonalizationChange]);
|
|
1801
|
+
const savePersonalization = useCallback4(() => {
|
|
1802
|
+
options.onPersonalizationSave?.(personalization);
|
|
1803
|
+
}, [options.onPersonalizationSave, personalization]);
|
|
1754
1804
|
const toggleDeepResearchMode = useCallback4(() => {
|
|
1755
1805
|
setIsDeepResearchMode((prev) => !prev);
|
|
1756
1806
|
}, []);
|
|
@@ -2122,6 +2172,60 @@ ${currentContextSummary}` },
|
|
|
2122
2172
|
signal: abortControllerRef.current?.signal
|
|
2123
2173
|
});
|
|
2124
2174
|
if (result) {
|
|
2175
|
+
if (result.metadata?.__toolResult__) {
|
|
2176
|
+
const resultType = result.metadata.resultType;
|
|
2177
|
+
const toolName = result.metadata.toolName;
|
|
2178
|
+
const parts = [];
|
|
2179
|
+
if (skillCleanContent.trim()) {
|
|
2180
|
+
parts.push({ type: "text", content: skillCleanContent });
|
|
2181
|
+
}
|
|
2182
|
+
if (resultType === "image") {
|
|
2183
|
+
parts.push({ type: "image", url: result.content, alt: result.metadata?.alt });
|
|
2184
|
+
} else if (resultType === "file") {
|
|
2185
|
+
parts.push({
|
|
2186
|
+
type: "file",
|
|
2187
|
+
name: result.metadata?.fileName || "file",
|
|
2188
|
+
url: result.content,
|
|
2189
|
+
mimeType: result.metadata?.mimeType
|
|
2190
|
+
});
|
|
2191
|
+
} else if (resultType === "error") {
|
|
2192
|
+
parts.push({ type: "error", message: result.content });
|
|
2193
|
+
} else {
|
|
2194
|
+
parts.push({ type: "text", content: result.content });
|
|
2195
|
+
}
|
|
2196
|
+
setSessions(
|
|
2197
|
+
(prev) => prev.map((s) => {
|
|
2198
|
+
if (s.id !== capturedSessionId) return s;
|
|
2199
|
+
return {
|
|
2200
|
+
...s,
|
|
2201
|
+
messages: s.messages.map((m) => {
|
|
2202
|
+
if (m.id !== assistantMessageId) return m;
|
|
2203
|
+
return {
|
|
2204
|
+
...m,
|
|
2205
|
+
contentParts: parts,
|
|
2206
|
+
skillExecution: {
|
|
2207
|
+
...m.skillExecution,
|
|
2208
|
+
status: "done",
|
|
2209
|
+
result
|
|
2210
|
+
}
|
|
2211
|
+
};
|
|
2212
|
+
})
|
|
2213
|
+
};
|
|
2214
|
+
})
|
|
2215
|
+
);
|
|
2216
|
+
skipNextSkillParsingRef.current = true;
|
|
2217
|
+
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:
|
|
2218
|
+
|
|
2219
|
+
${result.content}
|
|
2220
|
+
|
|
2221
|
+
\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.`;
|
|
2222
|
+
setTimeout(() => {
|
|
2223
|
+
sendMessage(feedbackPrompt, { hiddenUserMessage: true });
|
|
2224
|
+
}, 100);
|
|
2225
|
+
setIsLoading(false);
|
|
2226
|
+
abortControllerRef.current = null;
|
|
2227
|
+
return;
|
|
2228
|
+
}
|
|
2125
2229
|
setSessions(
|
|
2126
2230
|
(prev) => prev.map((s) => {
|
|
2127
2231
|
if (s.id !== capturedSessionId) return s;
|
|
@@ -2716,6 +2820,7 @@ ${currentSession.contextSummary}` },
|
|
|
2716
2820
|
setActiveAlternative,
|
|
2717
2821
|
getActiveAlternative,
|
|
2718
2822
|
updatePersonalization,
|
|
2823
|
+
savePersonalization,
|
|
2719
2824
|
models,
|
|
2720
2825
|
// Memory
|
|
2721
2826
|
globalMemory,
|
|
@@ -4113,10 +4218,10 @@ var iconButtonStyle = {
|
|
|
4113
4218
|
};
|
|
4114
4219
|
|
|
4115
4220
|
// src/react/components/MessageList.tsx
|
|
4116
|
-
import { useRef as useRef6, useEffect as useEffect6, useCallback as useCallback7, useState as
|
|
4221
|
+
import { useRef as useRef6, useEffect as useEffect6, useCallback as useCallback7, useState as useState12 } from "react";
|
|
4117
4222
|
|
|
4118
4223
|
// src/react/components/MessageBubble.tsx
|
|
4119
|
-
import { useState as
|
|
4224
|
+
import { useState as useState11 } from "react";
|
|
4120
4225
|
|
|
4121
4226
|
// src/react/components/MarkdownRenderer.tsx
|
|
4122
4227
|
import React5, { useMemo as useMemo3 } from "react";
|
|
@@ -4305,6 +4410,49 @@ var ITALIC_REGEX = /(?<!\*)\*([^*]+)\*(?!\*)/g;
|
|
|
4305
4410
|
var HR_REGEX = /^---+$/gm;
|
|
4306
4411
|
var TABLE_ROW_REGEX = /^\|(.+)\|$/;
|
|
4307
4412
|
var TABLE_SEPARATOR_REGEX = /^\|[\s\-:|]+\|$/;
|
|
4413
|
+
var convertNonStandardTable = (codeContent) => {
|
|
4414
|
+
const lines = codeContent.trim().split("\n");
|
|
4415
|
+
const nonEmptyLines = lines.filter((l) => l.trim());
|
|
4416
|
+
if (nonEmptyLines.length < 2) return null;
|
|
4417
|
+
const isSeparatorLine = (line) => /^[-=\s\t|:]+$/.test(line.trim()) && /[-=]{2,}/.test(line);
|
|
4418
|
+
if (nonEmptyLines[0].includes(" ")) {
|
|
4419
|
+
const dataLines2 = nonEmptyLines.filter((l) => !isSeparatorLine(l));
|
|
4420
|
+
if (dataLines2.length < 2) return null;
|
|
4421
|
+
if (!dataLines2.every((l) => l.includes(" "))) return null;
|
|
4422
|
+
const colCount2 = dataLines2[0].split(" ").length;
|
|
4423
|
+
if (colCount2 < 2) return null;
|
|
4424
|
+
const result2 = [];
|
|
4425
|
+
const headerCells = dataLines2[0].split(" ").map((c) => c.trim());
|
|
4426
|
+
result2.push("| " + headerCells.join(" | ") + " |");
|
|
4427
|
+
result2.push("| " + Array(colCount2).fill("---").join(" | ") + " |");
|
|
4428
|
+
for (let i = 1; i < dataLines2.length; i++) {
|
|
4429
|
+
const cells = dataLines2[i].split(" ").map((c) => c.trim());
|
|
4430
|
+
while (cells.length < colCount2) cells.push("");
|
|
4431
|
+
result2.push("| " + cells.join(" | ") + " |");
|
|
4432
|
+
}
|
|
4433
|
+
return result2.join("\n");
|
|
4434
|
+
}
|
|
4435
|
+
const dataLines = nonEmptyLines.filter((l) => !isSeparatorLine(l));
|
|
4436
|
+
if (dataLines.length < 2) return null;
|
|
4437
|
+
const spaceParsed = dataLines.map(
|
|
4438
|
+
(l) => l.split(/\s{2,}/).map((c) => c.trim()).filter(Boolean)
|
|
4439
|
+
);
|
|
4440
|
+
const colCount = spaceParsed[0].length;
|
|
4441
|
+
if (colCount < 3) return null;
|
|
4442
|
+
const consistent = spaceParsed.every(
|
|
4443
|
+
(cols) => cols.length >= colCount - 1 && cols.length <= colCount + 1
|
|
4444
|
+
);
|
|
4445
|
+
if (!consistent) return null;
|
|
4446
|
+
const result = [];
|
|
4447
|
+
result.push("| " + spaceParsed[0].join(" | ") + " |");
|
|
4448
|
+
result.push("| " + Array(colCount).fill("---").join(" | ") + " |");
|
|
4449
|
+
for (let i = 1; i < spaceParsed.length; i++) {
|
|
4450
|
+
const cells = [...spaceParsed[i]];
|
|
4451
|
+
while (cells.length < colCount) cells.push("");
|
|
4452
|
+
result.push("| " + cells.join(" | ") + " |");
|
|
4453
|
+
}
|
|
4454
|
+
return result.join("\n");
|
|
4455
|
+
};
|
|
4308
4456
|
var parseSourceLinks = (text) => {
|
|
4309
4457
|
const links = [];
|
|
4310
4458
|
let match;
|
|
@@ -5031,8 +5179,15 @@ var MarkdownRenderer = ({
|
|
|
5031
5179
|
processedContent = processedContent.replace(UNCLOSED_SKILL_TAG_REGEX, "");
|
|
5032
5180
|
const codeBlocks = [];
|
|
5033
5181
|
processedContent = processedContent.replace(CODE_BLOCK_REGEX, (match, lang, code) => {
|
|
5034
|
-
if (lang === "markdown"
|
|
5035
|
-
|
|
5182
|
+
if (lang === "markdown" || lang === "md") {
|
|
5183
|
+
const trimmedCode = code.trim();
|
|
5184
|
+
if (TABLE_ROW_REGEX.test(trimmedCode.split("\n")[0])) {
|
|
5185
|
+
return "\n" + trimmedCode + "\n";
|
|
5186
|
+
}
|
|
5187
|
+
const converted = convertNonStandardTable(trimmedCode);
|
|
5188
|
+
if (converted) {
|
|
5189
|
+
return "\n" + converted + "\n";
|
|
5190
|
+
}
|
|
5036
5191
|
}
|
|
5037
5192
|
codeBlocks.push({ language: lang || "", code });
|
|
5038
5193
|
return `\xA7CODEBLOCK\xA7${codeBlocks.length - 1}\xA7/CODEBLOCK\xA7`;
|
|
@@ -6097,8 +6252,358 @@ var SkillProgressUI = ({
|
|
|
6097
6252
|
);
|
|
6098
6253
|
};
|
|
6099
6254
|
|
|
6255
|
+
// src/react/components/ImageContentCard.tsx
|
|
6256
|
+
import { useState as useState10 } from "react";
|
|
6257
|
+
import { Fragment as Fragment5, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
6258
|
+
var ImageContentCard = ({ part }) => {
|
|
6259
|
+
const [isExpanded, setIsExpanded] = useState10(false);
|
|
6260
|
+
const [isLoaded, setIsLoaded] = useState10(false);
|
|
6261
|
+
const [hasError, setHasError] = useState10(false);
|
|
6262
|
+
if (hasError) {
|
|
6263
|
+
return /* @__PURE__ */ jsxs9(
|
|
6264
|
+
"div",
|
|
6265
|
+
{
|
|
6266
|
+
style: {
|
|
6267
|
+
padding: "16px",
|
|
6268
|
+
backgroundColor: "var(--chatllm-bg-secondary, #f9fafb)",
|
|
6269
|
+
borderRadius: "8px",
|
|
6270
|
+
border: "1px solid var(--chatllm-border, #e5e7eb)",
|
|
6271
|
+
color: "var(--chatllm-text-muted, #64748b)",
|
|
6272
|
+
fontSize: "13px",
|
|
6273
|
+
display: "flex",
|
|
6274
|
+
alignItems: "center",
|
|
6275
|
+
gap: "8px"
|
|
6276
|
+
},
|
|
6277
|
+
children: [
|
|
6278
|
+
/* @__PURE__ */ jsx10(IconSvg, { name: "error-warning-line", size: 16, color: "var(--chatllm-error, #ef4444)" }),
|
|
6279
|
+
"\uC774\uBBF8\uC9C0\uB97C \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4"
|
|
6280
|
+
]
|
|
6281
|
+
}
|
|
6282
|
+
);
|
|
6283
|
+
}
|
|
6284
|
+
return /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
6285
|
+
/* @__PURE__ */ jsxs9(
|
|
6286
|
+
"div",
|
|
6287
|
+
{
|
|
6288
|
+
style: {
|
|
6289
|
+
position: "relative",
|
|
6290
|
+
borderRadius: "8px",
|
|
6291
|
+
overflow: "hidden",
|
|
6292
|
+
border: "1px solid var(--chatllm-border, #e5e7eb)",
|
|
6293
|
+
cursor: "pointer",
|
|
6294
|
+
maxWidth: part.width ? `${Math.min(part.width, 480)}px` : "480px"
|
|
6295
|
+
},
|
|
6296
|
+
onClick: () => setIsExpanded(true),
|
|
6297
|
+
children: [
|
|
6298
|
+
!isLoaded && /* @__PURE__ */ jsx10(
|
|
6299
|
+
"div",
|
|
6300
|
+
{
|
|
6301
|
+
style: {
|
|
6302
|
+
padding: "40px",
|
|
6303
|
+
display: "flex",
|
|
6304
|
+
alignItems: "center",
|
|
6305
|
+
justifyContent: "center",
|
|
6306
|
+
backgroundColor: "var(--chatllm-bg-secondary, #f1f5f9)"
|
|
6307
|
+
},
|
|
6308
|
+
children: /* @__PURE__ */ jsx10(IconSvg, { name: "loader-4-line", size: 24, color: "var(--chatllm-text-muted, #94a3b8)" })
|
|
6309
|
+
}
|
|
6310
|
+
),
|
|
6311
|
+
/* @__PURE__ */ jsx10(
|
|
6312
|
+
"img",
|
|
6313
|
+
{
|
|
6314
|
+
src: part.url,
|
|
6315
|
+
alt: part.alt || "",
|
|
6316
|
+
onLoad: () => setIsLoaded(true),
|
|
6317
|
+
onError: () => setHasError(true),
|
|
6318
|
+
style: {
|
|
6319
|
+
display: isLoaded ? "block" : "none",
|
|
6320
|
+
width: "100%",
|
|
6321
|
+
height: "auto",
|
|
6322
|
+
maxHeight: "400px",
|
|
6323
|
+
objectFit: "contain"
|
|
6324
|
+
}
|
|
6325
|
+
}
|
|
6326
|
+
),
|
|
6327
|
+
part.alt && isLoaded && /* @__PURE__ */ jsx10(
|
|
6328
|
+
"div",
|
|
6329
|
+
{
|
|
6330
|
+
style: {
|
|
6331
|
+
padding: "6px 10px",
|
|
6332
|
+
fontSize: "12px",
|
|
6333
|
+
color: "var(--chatllm-text-muted, #64748b)",
|
|
6334
|
+
backgroundColor: "var(--chatllm-bg-secondary, #f9fafb)",
|
|
6335
|
+
borderTop: "1px solid var(--chatllm-border, #e5e7eb)"
|
|
6336
|
+
},
|
|
6337
|
+
children: part.alt
|
|
6338
|
+
}
|
|
6339
|
+
)
|
|
6340
|
+
]
|
|
6341
|
+
}
|
|
6342
|
+
),
|
|
6343
|
+
isExpanded && /* @__PURE__ */ jsx10(
|
|
6344
|
+
"div",
|
|
6345
|
+
{
|
|
6346
|
+
onClick: () => setIsExpanded(false),
|
|
6347
|
+
style: {
|
|
6348
|
+
position: "fixed",
|
|
6349
|
+
inset: 0,
|
|
6350
|
+
backgroundColor: "rgba(0, 0, 0, 0.8)",
|
|
6351
|
+
display: "flex",
|
|
6352
|
+
alignItems: "center",
|
|
6353
|
+
justifyContent: "center",
|
|
6354
|
+
zIndex: 9999,
|
|
6355
|
+
cursor: "zoom-out"
|
|
6356
|
+
},
|
|
6357
|
+
children: /* @__PURE__ */ jsx10(
|
|
6358
|
+
"img",
|
|
6359
|
+
{
|
|
6360
|
+
src: part.url,
|
|
6361
|
+
alt: part.alt || "",
|
|
6362
|
+
style: {
|
|
6363
|
+
maxWidth: "90vw",
|
|
6364
|
+
maxHeight: "90vh",
|
|
6365
|
+
objectFit: "contain",
|
|
6366
|
+
borderRadius: "4px"
|
|
6367
|
+
}
|
|
6368
|
+
}
|
|
6369
|
+
)
|
|
6370
|
+
}
|
|
6371
|
+
)
|
|
6372
|
+
] });
|
|
6373
|
+
};
|
|
6374
|
+
|
|
6375
|
+
// src/react/components/FileContentCard.tsx
|
|
6376
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
6377
|
+
var formatFileSize = (bytes) => {
|
|
6378
|
+
if (!bytes) return "";
|
|
6379
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
6380
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
6381
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
6382
|
+
};
|
|
6383
|
+
var getFileIcon = (mimeType) => {
|
|
6384
|
+
if (!mimeType) return "file-text-line";
|
|
6385
|
+
if (mimeType.startsWith("image/")) return "image-line";
|
|
6386
|
+
if (mimeType.startsWith("video/")) return "video-line";
|
|
6387
|
+
if (mimeType.startsWith("audio/")) return "mic-line";
|
|
6388
|
+
if (mimeType.includes("pdf")) return "file-text-line";
|
|
6389
|
+
if (mimeType.includes("zip") || mimeType.includes("compressed")) return "folder-line";
|
|
6390
|
+
return "file-text-line";
|
|
6391
|
+
};
|
|
6392
|
+
var FileContentCard = ({ part }) => {
|
|
6393
|
+
return /* @__PURE__ */ jsxs10(
|
|
6394
|
+
"a",
|
|
6395
|
+
{
|
|
6396
|
+
href: part.url,
|
|
6397
|
+
target: "_blank",
|
|
6398
|
+
rel: "noopener noreferrer",
|
|
6399
|
+
download: part.name,
|
|
6400
|
+
style: {
|
|
6401
|
+
display: "flex",
|
|
6402
|
+
alignItems: "center",
|
|
6403
|
+
gap: "12px",
|
|
6404
|
+
padding: "12px 16px",
|
|
6405
|
+
backgroundColor: "var(--chatllm-bg-secondary, #f9fafb)",
|
|
6406
|
+
borderRadius: "8px",
|
|
6407
|
+
border: "1px solid var(--chatllm-border, #e5e7eb)",
|
|
6408
|
+
textDecoration: "none",
|
|
6409
|
+
color: "inherit",
|
|
6410
|
+
transition: "background-color 0.15s ease",
|
|
6411
|
+
maxWidth: "320px"
|
|
6412
|
+
},
|
|
6413
|
+
children: [
|
|
6414
|
+
/* @__PURE__ */ jsx11(
|
|
6415
|
+
"div",
|
|
6416
|
+
{
|
|
6417
|
+
style: {
|
|
6418
|
+
width: "36px",
|
|
6419
|
+
height: "36px",
|
|
6420
|
+
borderRadius: "8px",
|
|
6421
|
+
backgroundColor: "var(--chatllm-primary-light, rgba(74, 144, 226, 0.1))",
|
|
6422
|
+
display: "flex",
|
|
6423
|
+
alignItems: "center",
|
|
6424
|
+
justifyContent: "center",
|
|
6425
|
+
flexShrink: 0
|
|
6426
|
+
},
|
|
6427
|
+
children: /* @__PURE__ */ jsx11(IconSvg, { name: getFileIcon(part.mimeType), size: 18, color: "var(--chatllm-primary, #4A90E2)" })
|
|
6428
|
+
}
|
|
6429
|
+
),
|
|
6430
|
+
/* @__PURE__ */ jsxs10("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
6431
|
+
/* @__PURE__ */ jsx11(
|
|
6432
|
+
"div",
|
|
6433
|
+
{
|
|
6434
|
+
style: {
|
|
6435
|
+
fontSize: "13px",
|
|
6436
|
+
fontWeight: 500,
|
|
6437
|
+
color: "var(--chatllm-text, #1e293b)",
|
|
6438
|
+
overflow: "hidden",
|
|
6439
|
+
textOverflow: "ellipsis",
|
|
6440
|
+
whiteSpace: "nowrap"
|
|
6441
|
+
},
|
|
6442
|
+
children: part.name
|
|
6443
|
+
}
|
|
6444
|
+
),
|
|
6445
|
+
(part.size || part.mimeType) && /* @__PURE__ */ jsx11(
|
|
6446
|
+
"div",
|
|
6447
|
+
{
|
|
6448
|
+
style: {
|
|
6449
|
+
fontSize: "11px",
|
|
6450
|
+
color: "var(--chatllm-text-muted, #94a3b8)",
|
|
6451
|
+
marginTop: "2px"
|
|
6452
|
+
},
|
|
6453
|
+
children: [formatFileSize(part.size), part.mimeType].filter(Boolean).join(" \xB7 ")
|
|
6454
|
+
}
|
|
6455
|
+
)
|
|
6456
|
+
] }),
|
|
6457
|
+
/* @__PURE__ */ jsx11(IconSvg, { name: "download-line", size: 16, color: "var(--chatllm-text-muted, #94a3b8)" })
|
|
6458
|
+
]
|
|
6459
|
+
}
|
|
6460
|
+
);
|
|
6461
|
+
};
|
|
6462
|
+
|
|
6463
|
+
// src/react/components/ContentPartRenderer.tsx
|
|
6464
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6465
|
+
var ContentPartRenderer = ({
|
|
6466
|
+
parts,
|
|
6467
|
+
onChoiceClick,
|
|
6468
|
+
showThinking,
|
|
6469
|
+
thinkingDefaultOpen
|
|
6470
|
+
}) => {
|
|
6471
|
+
return /* @__PURE__ */ jsx12("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: parts.map((part, idx) => {
|
|
6472
|
+
switch (part.type) {
|
|
6473
|
+
case "text":
|
|
6474
|
+
return /* @__PURE__ */ jsx12(
|
|
6475
|
+
MarkdownRenderer,
|
|
6476
|
+
{
|
|
6477
|
+
content: part.content,
|
|
6478
|
+
onChoiceClick,
|
|
6479
|
+
showThinking,
|
|
6480
|
+
thinkingDefaultOpen
|
|
6481
|
+
},
|
|
6482
|
+
idx
|
|
6483
|
+
);
|
|
6484
|
+
case "image":
|
|
6485
|
+
return /* @__PURE__ */ jsx12(ImageContentCard, { part }, idx);
|
|
6486
|
+
case "file":
|
|
6487
|
+
return /* @__PURE__ */ jsx12(FileContentCard, { part }, idx);
|
|
6488
|
+
case "search_result":
|
|
6489
|
+
return /* @__PURE__ */ jsx12("div", { style: { display: "flex", flexWrap: "wrap", gap: "6px" }, children: part.results.map((source, si) => /* @__PURE__ */ jsx12(
|
|
6490
|
+
LinkChip,
|
|
6491
|
+
{
|
|
6492
|
+
text: source.title,
|
|
6493
|
+
url: source.url,
|
|
6494
|
+
index: si + 1,
|
|
6495
|
+
showFavicon: true
|
|
6496
|
+
},
|
|
6497
|
+
si
|
|
6498
|
+
)) }, idx);
|
|
6499
|
+
case "tool_loading":
|
|
6500
|
+
return /* @__PURE__ */ jsxs11(
|
|
6501
|
+
"div",
|
|
6502
|
+
{
|
|
6503
|
+
style: {
|
|
6504
|
+
display: "flex",
|
|
6505
|
+
alignItems: "center",
|
|
6506
|
+
gap: "8px",
|
|
6507
|
+
padding: "8px 12px",
|
|
6508
|
+
backgroundColor: "var(--chatllm-bg-secondary, #f9fafb)",
|
|
6509
|
+
borderRadius: "8px",
|
|
6510
|
+
fontSize: "13px",
|
|
6511
|
+
color: "var(--chatllm-text-muted, #64748b)"
|
|
6512
|
+
},
|
|
6513
|
+
children: [
|
|
6514
|
+
/* @__PURE__ */ jsx12(IconSvg, { name: "loader-4-line", size: 16, color: "var(--chatllm-primary, #4A90E2)" }),
|
|
6515
|
+
part.label || `${part.toolName} \uC2E4\uD589 \uC911...`
|
|
6516
|
+
]
|
|
6517
|
+
},
|
|
6518
|
+
idx
|
|
6519
|
+
);
|
|
6520
|
+
case "tool_result":
|
|
6521
|
+
if (part.result.type === "image") {
|
|
6522
|
+
return /* @__PURE__ */ jsx12(
|
|
6523
|
+
ImageContentCard,
|
|
6524
|
+
{
|
|
6525
|
+
part: { type: "image", url: part.result.content, alt: part.result.metadata?.alt }
|
|
6526
|
+
},
|
|
6527
|
+
idx
|
|
6528
|
+
);
|
|
6529
|
+
}
|
|
6530
|
+
if (part.result.type === "file") {
|
|
6531
|
+
return /* @__PURE__ */ jsx12(
|
|
6532
|
+
FileContentCard,
|
|
6533
|
+
{
|
|
6534
|
+
part: {
|
|
6535
|
+
type: "file",
|
|
6536
|
+
name: part.result.metadata?.fileName || "file",
|
|
6537
|
+
url: part.result.content,
|
|
6538
|
+
mimeType: part.result.metadata?.mimeType
|
|
6539
|
+
}
|
|
6540
|
+
},
|
|
6541
|
+
idx
|
|
6542
|
+
);
|
|
6543
|
+
}
|
|
6544
|
+
if (part.result.type === "error") {
|
|
6545
|
+
return /* @__PURE__ */ jsxs11(
|
|
6546
|
+
"div",
|
|
6547
|
+
{
|
|
6548
|
+
style: {
|
|
6549
|
+
padding: "10px 14px",
|
|
6550
|
+
backgroundColor: "var(--chatllm-error-bg, #fef2f2)",
|
|
6551
|
+
borderRadius: "8px",
|
|
6552
|
+
border: "1px solid var(--chatllm-error-border, #fecaca)",
|
|
6553
|
+
fontSize: "13px",
|
|
6554
|
+
color: "var(--chatllm-error, #ef4444)",
|
|
6555
|
+
display: "flex",
|
|
6556
|
+
alignItems: "center",
|
|
6557
|
+
gap: "8px"
|
|
6558
|
+
},
|
|
6559
|
+
children: [
|
|
6560
|
+
/* @__PURE__ */ jsx12(IconSvg, { name: "error-warning-line", size: 16, color: "var(--chatllm-error, #ef4444)" }),
|
|
6561
|
+
part.result.content
|
|
6562
|
+
]
|
|
6563
|
+
},
|
|
6564
|
+
idx
|
|
6565
|
+
);
|
|
6566
|
+
}
|
|
6567
|
+
return /* @__PURE__ */ jsx12(
|
|
6568
|
+
MarkdownRenderer,
|
|
6569
|
+
{
|
|
6570
|
+
content: part.result.content,
|
|
6571
|
+
onChoiceClick,
|
|
6572
|
+
showThinking,
|
|
6573
|
+
thinkingDefaultOpen
|
|
6574
|
+
},
|
|
6575
|
+
idx
|
|
6576
|
+
);
|
|
6577
|
+
case "error":
|
|
6578
|
+
return /* @__PURE__ */ jsxs11(
|
|
6579
|
+
"div",
|
|
6580
|
+
{
|
|
6581
|
+
style: {
|
|
6582
|
+
padding: "10px 14px",
|
|
6583
|
+
backgroundColor: "var(--chatllm-error-bg, #fef2f2)",
|
|
6584
|
+
borderRadius: "8px",
|
|
6585
|
+
border: "1px solid var(--chatllm-error-border, #fecaca)",
|
|
6586
|
+
fontSize: "13px",
|
|
6587
|
+
color: "var(--chatllm-error, #ef4444)",
|
|
6588
|
+
display: "flex",
|
|
6589
|
+
alignItems: "center",
|
|
6590
|
+
gap: "8px"
|
|
6591
|
+
},
|
|
6592
|
+
children: [
|
|
6593
|
+
/* @__PURE__ */ jsx12(IconSvg, { name: "error-warning-line", size: 16, color: "var(--chatllm-error, #ef4444)" }),
|
|
6594
|
+
part.message
|
|
6595
|
+
]
|
|
6596
|
+
},
|
|
6597
|
+
idx
|
|
6598
|
+
);
|
|
6599
|
+
default:
|
|
6600
|
+
return null;
|
|
6601
|
+
}
|
|
6602
|
+
}) });
|
|
6603
|
+
};
|
|
6604
|
+
|
|
6100
6605
|
// src/react/components/MessageBubble.tsx
|
|
6101
|
-
import { jsx as
|
|
6606
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6102
6607
|
var MessageBubble = ({
|
|
6103
6608
|
message,
|
|
6104
6609
|
isLoading,
|
|
@@ -6120,8 +6625,8 @@ var MessageBubble = ({
|
|
|
6120
6625
|
isLoadingAlternative = false,
|
|
6121
6626
|
onPollSubmit
|
|
6122
6627
|
}) => {
|
|
6123
|
-
const [showActions, setShowActions] =
|
|
6124
|
-
const [showModelMenu, setShowModelMenu] =
|
|
6628
|
+
const [showActions, setShowActions] = useState11(false);
|
|
6629
|
+
const [showModelMenu, setShowModelMenu] = useState11(false);
|
|
6125
6630
|
const isUser = message.role === "user";
|
|
6126
6631
|
const isAssistant = message.role === "assistant";
|
|
6127
6632
|
const relevantAlternatives = isUser ? alternatives : message.alternatives;
|
|
@@ -6139,7 +6644,7 @@ var MessageBubble = ({
|
|
|
6139
6644
|
}
|
|
6140
6645
|
};
|
|
6141
6646
|
if (isUser) {
|
|
6142
|
-
return /* @__PURE__ */
|
|
6647
|
+
return /* @__PURE__ */ jsxs12(
|
|
6143
6648
|
"div",
|
|
6144
6649
|
{
|
|
6145
6650
|
className: "chatllm-message chatllm-message--user",
|
|
@@ -6153,7 +6658,7 @@ var MessageBubble = ({
|
|
|
6153
6658
|
onMouseLeave: () => setShowActions(false),
|
|
6154
6659
|
onMouseUp: handleMouseUp,
|
|
6155
6660
|
children: [
|
|
6156
|
-
/* @__PURE__ */
|
|
6661
|
+
/* @__PURE__ */ jsx13(
|
|
6157
6662
|
"div",
|
|
6158
6663
|
{
|
|
6159
6664
|
style: {
|
|
@@ -6163,7 +6668,7 @@ var MessageBubble = ({
|
|
|
6163
6668
|
borderRadius: "16px",
|
|
6164
6669
|
borderTopRightRadius: "4px"
|
|
6165
6670
|
},
|
|
6166
|
-
children: /* @__PURE__ */
|
|
6671
|
+
children: /* @__PURE__ */ jsx13(
|
|
6167
6672
|
"div",
|
|
6168
6673
|
{
|
|
6169
6674
|
style: {
|
|
@@ -6177,7 +6682,7 @@ var MessageBubble = ({
|
|
|
6177
6682
|
)
|
|
6178
6683
|
}
|
|
6179
6684
|
),
|
|
6180
|
-
!isLoading && /* @__PURE__ */
|
|
6685
|
+
!isLoading && /* @__PURE__ */ jsxs12(
|
|
6181
6686
|
"div",
|
|
6182
6687
|
{
|
|
6183
6688
|
style: {
|
|
@@ -6189,7 +6694,7 @@ var MessageBubble = ({
|
|
|
6189
6694
|
transition: "opacity 0.15s ease"
|
|
6190
6695
|
},
|
|
6191
6696
|
children: [
|
|
6192
|
-
/* @__PURE__ */
|
|
6697
|
+
/* @__PURE__ */ jsx13("button", { onClick: onCopy, style: actionButtonSmallStyle, title: "\uBCF5\uC0AC", children: /* @__PURE__ */ jsx13(
|
|
6193
6698
|
IconSvg,
|
|
6194
6699
|
{
|
|
6195
6700
|
name: isCopied ? "check-line" : "file-copy-line",
|
|
@@ -6197,7 +6702,7 @@ var MessageBubble = ({
|
|
|
6197
6702
|
color: isCopied ? "var(--chatllm-success)" : "var(--chatllm-text-muted)"
|
|
6198
6703
|
}
|
|
6199
6704
|
) }),
|
|
6200
|
-
/* @__PURE__ */
|
|
6705
|
+
/* @__PURE__ */ jsx13("button", { onClick: onEdit, style: actionButtonSmallStyle, title: "\uC218\uC815", children: /* @__PURE__ */ jsx13(IconSvg, { name: "edit-line", size: 12, color: "var(--chatllm-text-muted)" }) })
|
|
6201
6706
|
]
|
|
6202
6707
|
}
|
|
6203
6708
|
)
|
|
@@ -6205,7 +6710,7 @@ var MessageBubble = ({
|
|
|
6205
6710
|
}
|
|
6206
6711
|
);
|
|
6207
6712
|
}
|
|
6208
|
-
return /* @__PURE__ */
|
|
6713
|
+
return /* @__PURE__ */ jsxs12(
|
|
6209
6714
|
"div",
|
|
6210
6715
|
{
|
|
6211
6716
|
className: "chatllm-message chatllm-message--assistant",
|
|
@@ -6219,7 +6724,7 @@ var MessageBubble = ({
|
|
|
6219
6724
|
onMouseLeave: () => setShowActions(false),
|
|
6220
6725
|
onMouseUp: handleMouseUp,
|
|
6221
6726
|
children: [
|
|
6222
|
-
/* @__PURE__ */
|
|
6727
|
+
/* @__PURE__ */ jsxs12(
|
|
6223
6728
|
"div",
|
|
6224
6729
|
{
|
|
6225
6730
|
className: "chatllm-sheet",
|
|
@@ -6230,7 +6735,7 @@ var MessageBubble = ({
|
|
|
6230
6735
|
gap: "12px"
|
|
6231
6736
|
},
|
|
6232
6737
|
children: [
|
|
6233
|
-
/* @__PURE__ */
|
|
6738
|
+
/* @__PURE__ */ jsx13("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx13(
|
|
6234
6739
|
"div",
|
|
6235
6740
|
{
|
|
6236
6741
|
style: {
|
|
@@ -6243,11 +6748,11 @@ var MessageBubble = ({
|
|
|
6243
6748
|
justifyContent: "center",
|
|
6244
6749
|
color: "var(--chatllm-primary)"
|
|
6245
6750
|
},
|
|
6246
|
-
children: /* @__PURE__ */
|
|
6751
|
+
children: /* @__PURE__ */ jsx13(IconSvg, { name: "magic-line", size: 20 })
|
|
6247
6752
|
}
|
|
6248
6753
|
) }),
|
|
6249
|
-
/* @__PURE__ */
|
|
6250
|
-
displayModel && /* @__PURE__ */
|
|
6754
|
+
/* @__PURE__ */ jsxs12("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
6755
|
+
displayModel && /* @__PURE__ */ jsx13(
|
|
6251
6756
|
"div",
|
|
6252
6757
|
{
|
|
6253
6758
|
style: {
|
|
@@ -6256,7 +6761,7 @@ var MessageBubble = ({
|
|
|
6256
6761
|
gap: "8px",
|
|
6257
6762
|
marginBottom: "8px"
|
|
6258
6763
|
},
|
|
6259
|
-
children: /* @__PURE__ */
|
|
6764
|
+
children: /* @__PURE__ */ jsx13(
|
|
6260
6765
|
"span",
|
|
6261
6766
|
{
|
|
6262
6767
|
style: {
|
|
@@ -6271,9 +6776,9 @@ var MessageBubble = ({
|
|
|
6271
6776
|
)
|
|
6272
6777
|
}
|
|
6273
6778
|
),
|
|
6274
|
-
message.isDeepResearch && message.researchProgress && message.researchProgress.phase !== "done" && /* @__PURE__ */
|
|
6275
|
-
message.skillExecution && message.skillExecution.status !== "done" && (message.skillExecution.progress?.subAgents ? /* @__PURE__ */
|
|
6276
|
-
message.isDeepResearch && displayContent && /* @__PURE__ */
|
|
6779
|
+
message.isDeepResearch && message.researchProgress && message.researchProgress.phase !== "done" && /* @__PURE__ */ jsx13(DeepResearchProgressUI, { progress: message.researchProgress }),
|
|
6780
|
+
message.skillExecution && message.skillExecution.status !== "done" && (message.skillExecution.progress?.subAgents ? /* @__PURE__ */ jsx13(DeepResearchProgressUI, { progress: message.skillExecution.progress }) : /* @__PURE__ */ jsx13(SkillProgressUI, { execution: message.skillExecution })),
|
|
6781
|
+
message.isDeepResearch && displayContent && /* @__PURE__ */ jsxs12(
|
|
6277
6782
|
"div",
|
|
6278
6783
|
{
|
|
6279
6784
|
className: "chatllm-deep-research__header",
|
|
@@ -6286,8 +6791,8 @@ var MessageBubble = ({
|
|
|
6286
6791
|
borderBottom: "1px solid var(--chatllm-border-light)"
|
|
6287
6792
|
},
|
|
6288
6793
|
children: [
|
|
6289
|
-
/* @__PURE__ */
|
|
6290
|
-
/* @__PURE__ */
|
|
6794
|
+
/* @__PURE__ */ jsx13(IconSvg, { name: "search-eye-line", size: 18, color: "var(--chatllm-primary)" }),
|
|
6795
|
+
/* @__PURE__ */ jsx13(
|
|
6291
6796
|
"span",
|
|
6292
6797
|
{
|
|
6293
6798
|
style: {
|
|
@@ -6298,7 +6803,7 @@ var MessageBubble = ({
|
|
|
6298
6803
|
children: "\uC2EC\uCE35\uC5F0\uAD6C"
|
|
6299
6804
|
}
|
|
6300
6805
|
),
|
|
6301
|
-
displaySources && displaySources.length > 0 && /* @__PURE__ */
|
|
6806
|
+
displaySources && displaySources.length > 0 && /* @__PURE__ */ jsxs12(
|
|
6302
6807
|
"span",
|
|
6303
6808
|
{
|
|
6304
6809
|
className: "chatllm-deep-research__source-count",
|
|
@@ -6320,14 +6825,14 @@ var MessageBubble = ({
|
|
|
6320
6825
|
]
|
|
6321
6826
|
}
|
|
6322
6827
|
),
|
|
6323
|
-
isLoading && !displayContent && !message.isDeepResearch && /* @__PURE__ */
|
|
6324
|
-
/* @__PURE__ */
|
|
6325
|
-
/* @__PURE__ */
|
|
6326
|
-
/* @__PURE__ */
|
|
6327
|
-
/* @__PURE__ */
|
|
6328
|
-
/* @__PURE__ */
|
|
6828
|
+
isLoading && !displayContent && !message.isDeepResearch && /* @__PURE__ */ jsxs12("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: [
|
|
6829
|
+
/* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
6830
|
+
/* @__PURE__ */ jsxs12("div", { style: { display: "flex", gap: "4px", alignItems: "center" }, children: [
|
|
6831
|
+
/* @__PURE__ */ jsx13("span", { className: "chatllm-dot-bounce", style: dotStyle }),
|
|
6832
|
+
/* @__PURE__ */ jsx13("span", { className: "chatllm-dot-bounce", style: dotStyle }),
|
|
6833
|
+
/* @__PURE__ */ jsx13("span", { className: "chatllm-dot-bounce", style: dotStyle })
|
|
6329
6834
|
] }),
|
|
6330
|
-
/* @__PURE__ */
|
|
6835
|
+
/* @__PURE__ */ jsx13(
|
|
6331
6836
|
"span",
|
|
6332
6837
|
{
|
|
6333
6838
|
style: {
|
|
@@ -6340,16 +6845,24 @@ var MessageBubble = ({
|
|
|
6340
6845
|
}
|
|
6341
6846
|
)
|
|
6342
6847
|
] }),
|
|
6343
|
-
/* @__PURE__ */
|
|
6344
|
-
/* @__PURE__ */
|
|
6345
|
-
/* @__PURE__ */
|
|
6346
|
-
/* @__PURE__ */
|
|
6347
|
-
/* @__PURE__ */
|
|
6348
|
-
/* @__PURE__ */
|
|
6848
|
+
/* @__PURE__ */ jsxs12("div", { className: "chatllm-skeleton-pulse", style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [
|
|
6849
|
+
/* @__PURE__ */ jsx13("div", { style: { height: "32px", width: "75%", backgroundColor: "var(--chatllm-bg-tertiary)", borderRadius: "8px" } }),
|
|
6850
|
+
/* @__PURE__ */ jsxs12("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
6851
|
+
/* @__PURE__ */ jsx13("div", { style: { height: "16px", width: "100%", backgroundColor: "var(--chatllm-bg-secondary)", borderRadius: "4px" } }),
|
|
6852
|
+
/* @__PURE__ */ jsx13("div", { style: { height: "16px", width: "85%", backgroundColor: "var(--chatllm-bg-secondary)", borderRadius: "4px" } }),
|
|
6853
|
+
/* @__PURE__ */ jsx13("div", { style: { height: "16px", width: "65%", backgroundColor: "var(--chatllm-bg-secondary)", borderRadius: "4px" } })
|
|
6349
6854
|
] })
|
|
6350
6855
|
] })
|
|
6351
6856
|
] }),
|
|
6352
|
-
|
|
6857
|
+
message.contentParts?.length ? /* @__PURE__ */ jsx13("div", { style: { wordBreak: "break-word" }, children: /* @__PURE__ */ jsx13(
|
|
6858
|
+
ContentPartRenderer,
|
|
6859
|
+
{
|
|
6860
|
+
parts: message.contentParts,
|
|
6861
|
+
onChoiceClick,
|
|
6862
|
+
showThinking,
|
|
6863
|
+
thinkingDefaultOpen
|
|
6864
|
+
}
|
|
6865
|
+
) }) : displayContent ? /* @__PURE__ */ jsx13("div", { style: { wordBreak: "break-word" }, children: /* @__PURE__ */ jsx13(
|
|
6353
6866
|
MarkdownRenderer,
|
|
6354
6867
|
{
|
|
6355
6868
|
content: displayContent,
|
|
@@ -6357,8 +6870,8 @@ var MessageBubble = ({
|
|
|
6357
6870
|
showThinking,
|
|
6358
6871
|
thinkingDefaultOpen
|
|
6359
6872
|
}
|
|
6360
|
-
) }),
|
|
6361
|
-
message.pollBlock && message.pollBlock.questions.length > 0 && /* @__PURE__ */
|
|
6873
|
+
) }) : null,
|
|
6874
|
+
message.pollBlock && message.pollBlock.questions.length > 0 && /* @__PURE__ */ jsx13(
|
|
6362
6875
|
PollCard,
|
|
6363
6876
|
{
|
|
6364
6877
|
questions: message.pollBlock.questions,
|
|
@@ -6370,7 +6883,7 @@ var MessageBubble = ({
|
|
|
6370
6883
|
}
|
|
6371
6884
|
}
|
|
6372
6885
|
),
|
|
6373
|
-
!isLoading && !displayContent && !message.pollBlock && /* @__PURE__ */
|
|
6886
|
+
!isLoading && !displayContent && !message.pollBlock && /* @__PURE__ */ jsx13(
|
|
6374
6887
|
"div",
|
|
6375
6888
|
{
|
|
6376
6889
|
style: {
|
|
@@ -6383,7 +6896,7 @@ var MessageBubble = ({
|
|
|
6383
6896
|
children: "\uC751\uB2F5\uC744 \uC0DD\uC131\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694."
|
|
6384
6897
|
}
|
|
6385
6898
|
),
|
|
6386
|
-
displaySources && displaySources.length > 0 && /* @__PURE__ */
|
|
6899
|
+
displaySources && displaySources.length > 0 && /* @__PURE__ */ jsxs12(
|
|
6387
6900
|
"div",
|
|
6388
6901
|
{
|
|
6389
6902
|
style: {
|
|
@@ -6395,7 +6908,7 @@ var MessageBubble = ({
|
|
|
6395
6908
|
borderTop: "1px solid var(--chatllm-border-light)"
|
|
6396
6909
|
},
|
|
6397
6910
|
children: [
|
|
6398
|
-
/* @__PURE__ */
|
|
6911
|
+
/* @__PURE__ */ jsx13(
|
|
6399
6912
|
"span",
|
|
6400
6913
|
{
|
|
6401
6914
|
style: {
|
|
@@ -6407,7 +6920,7 @@ var MessageBubble = ({
|
|
|
6407
6920
|
children: "\uCD9C\uCC98:"
|
|
6408
6921
|
}
|
|
6409
6922
|
),
|
|
6410
|
-
displaySources.map((source, index) => /* @__PURE__ */
|
|
6923
|
+
displaySources.map((source, index) => /* @__PURE__ */ jsx13(
|
|
6411
6924
|
LinkChip,
|
|
6412
6925
|
{
|
|
6413
6926
|
text: source.title,
|
|
@@ -6420,7 +6933,7 @@ var MessageBubble = ({
|
|
|
6420
6933
|
]
|
|
6421
6934
|
}
|
|
6422
6935
|
),
|
|
6423
|
-
relevantAlternatives && relevantAlternatives.length > 0 && /* @__PURE__ */
|
|
6936
|
+
relevantAlternatives && relevantAlternatives.length > 0 && /* @__PURE__ */ jsxs12(
|
|
6424
6937
|
"div",
|
|
6425
6938
|
{
|
|
6426
6939
|
style: {
|
|
@@ -6434,8 +6947,8 @@ var MessageBubble = ({
|
|
|
6434
6947
|
fontSize: "12px"
|
|
6435
6948
|
},
|
|
6436
6949
|
children: [
|
|
6437
|
-
/* @__PURE__ */
|
|
6438
|
-
/* @__PURE__ */
|
|
6950
|
+
/* @__PURE__ */ jsx13("span", { style: { color: "var(--chatllm-text-muted)", marginRight: "4px" }, children: displayModel || "\uBAA8\uB378" }),
|
|
6951
|
+
/* @__PURE__ */ jsx13(
|
|
6439
6952
|
"button",
|
|
6440
6953
|
{
|
|
6441
6954
|
onClick: () => onAlternativeChange?.(Math.max(0, relevantActiveIndex - 1)),
|
|
@@ -6445,15 +6958,15 @@ var MessageBubble = ({
|
|
|
6445
6958
|
opacity: relevantActiveIndex === 0 ? 0.5 : 1,
|
|
6446
6959
|
cursor: relevantActiveIndex === 0 ? "not-allowed" : "pointer"
|
|
6447
6960
|
},
|
|
6448
|
-
children: /* @__PURE__ */
|
|
6961
|
+
children: /* @__PURE__ */ jsx13(IconSvg, { name: "arrow-left-line", size: 12 })
|
|
6449
6962
|
}
|
|
6450
6963
|
),
|
|
6451
|
-
/* @__PURE__ */
|
|
6964
|
+
/* @__PURE__ */ jsxs12("span", { style: { color: "var(--chatllm-text-secondary)" }, children: [
|
|
6452
6965
|
relevantActiveIndex + 1,
|
|
6453
6966
|
" / ",
|
|
6454
6967
|
relevantAlternatives.length + 1
|
|
6455
6968
|
] }),
|
|
6456
|
-
/* @__PURE__ */
|
|
6969
|
+
/* @__PURE__ */ jsx13(
|
|
6457
6970
|
"button",
|
|
6458
6971
|
{
|
|
6459
6972
|
onClick: () => onAlternativeChange?.(Math.min(relevantAlternatives.length, relevantActiveIndex + 1)),
|
|
@@ -6463,13 +6976,13 @@ var MessageBubble = ({
|
|
|
6463
6976
|
opacity: relevantActiveIndex === relevantAlternatives.length ? 0.5 : 1,
|
|
6464
6977
|
cursor: relevantActiveIndex === relevantAlternatives.length ? "not-allowed" : "pointer"
|
|
6465
6978
|
},
|
|
6466
|
-
children: /* @__PURE__ */
|
|
6979
|
+
children: /* @__PURE__ */ jsx13(IconSvg, { name: "arrow-right-line", size: 12 })
|
|
6467
6980
|
}
|
|
6468
6981
|
)
|
|
6469
6982
|
]
|
|
6470
6983
|
}
|
|
6471
6984
|
),
|
|
6472
|
-
isLoadingAlternative && /* @__PURE__ */
|
|
6985
|
+
isLoadingAlternative && /* @__PURE__ */ jsxs12(
|
|
6473
6986
|
"div",
|
|
6474
6987
|
{
|
|
6475
6988
|
style: {
|
|
@@ -6484,12 +6997,12 @@ var MessageBubble = ({
|
|
|
6484
6997
|
color: "var(--chatllm-primary, #2563eb)"
|
|
6485
6998
|
},
|
|
6486
6999
|
children: [
|
|
6487
|
-
/* @__PURE__ */
|
|
6488
|
-
/* @__PURE__ */
|
|
6489
|
-
/* @__PURE__ */
|
|
6490
|
-
/* @__PURE__ */
|
|
7000
|
+
/* @__PURE__ */ jsxs12("div", { style: { display: "flex", gap: "4px", alignItems: "center" }, children: [
|
|
7001
|
+
/* @__PURE__ */ jsx13("span", { className: "chatllm-dot-bounce", style: dotStyle }),
|
|
7002
|
+
/* @__PURE__ */ jsx13("span", { className: "chatllm-dot-bounce", style: dotStyle }),
|
|
7003
|
+
/* @__PURE__ */ jsx13("span", { className: "chatllm-dot-bounce", style: dotStyle })
|
|
6491
7004
|
] }),
|
|
6492
|
-
/* @__PURE__ */
|
|
7005
|
+
/* @__PURE__ */ jsx13("span", { style: { fontWeight: 500 }, children: "\uB2E4\uB978 \uBAA8\uB378 \uC751\uB2F5 \uC0DD\uC131 \uC911..." })
|
|
6493
7006
|
]
|
|
6494
7007
|
}
|
|
6495
7008
|
)
|
|
@@ -6497,7 +7010,7 @@ var MessageBubble = ({
|
|
|
6497
7010
|
]
|
|
6498
7011
|
}
|
|
6499
7012
|
),
|
|
6500
|
-
!isLoading && /* @__PURE__ */
|
|
7013
|
+
!isLoading && /* @__PURE__ */ jsxs12(
|
|
6501
7014
|
"div",
|
|
6502
7015
|
{
|
|
6503
7016
|
style: {
|
|
@@ -6510,7 +7023,7 @@ var MessageBubble = ({
|
|
|
6510
7023
|
transition: "opacity 0.15s ease"
|
|
6511
7024
|
},
|
|
6512
7025
|
children: [
|
|
6513
|
-
/* @__PURE__ */
|
|
7026
|
+
/* @__PURE__ */ jsx13("button", { onClick: onCopy, style: actionButtonSmallStyle, title: "\uBCF5\uC0AC", children: /* @__PURE__ */ jsx13(
|
|
6514
7027
|
IconSvg,
|
|
6515
7028
|
{
|
|
6516
7029
|
name: isCopied ? "check-line" : "file-copy-line",
|
|
@@ -6518,18 +7031,18 @@ var MessageBubble = ({
|
|
|
6518
7031
|
color: isCopied ? "var(--chatllm-success)" : "var(--chatllm-text-muted)"
|
|
6519
7032
|
}
|
|
6520
7033
|
) }),
|
|
6521
|
-
onRegenerate && /* @__PURE__ */
|
|
6522
|
-
onAskOtherModel && otherModels.length > 0 && /* @__PURE__ */
|
|
6523
|
-
/* @__PURE__ */
|
|
7034
|
+
onRegenerate && /* @__PURE__ */ jsx13("button", { onClick: onRegenerate, style: actionButtonSmallStyle, title: "\uB2E4\uC2DC \uC0DD\uC131", children: /* @__PURE__ */ jsx13(IconSvg, { name: "refresh-line", size: 12, color: "var(--chatllm-text-muted)" }) }),
|
|
7035
|
+
onAskOtherModel && otherModels.length > 0 && /* @__PURE__ */ jsxs12("div", { style: { position: "relative" }, children: [
|
|
7036
|
+
/* @__PURE__ */ jsx13(
|
|
6524
7037
|
"button",
|
|
6525
7038
|
{
|
|
6526
7039
|
onClick: () => setShowModelMenu(!showModelMenu),
|
|
6527
7040
|
style: actionButtonSmallStyle,
|
|
6528
7041
|
title: "\uB2E4\uB978 \uBAA8\uB378\uC5D0\uAC8C \uC9C8\uBB38",
|
|
6529
|
-
children: /* @__PURE__ */
|
|
7042
|
+
children: /* @__PURE__ */ jsx13(IconSvg, { name: "robot-line", size: 12, color: "var(--chatllm-text-muted)" })
|
|
6530
7043
|
}
|
|
6531
7044
|
),
|
|
6532
|
-
showModelMenu && /* @__PURE__ */
|
|
7045
|
+
showModelMenu && /* @__PURE__ */ jsx13(
|
|
6533
7046
|
ModelMenu,
|
|
6534
7047
|
{
|
|
6535
7048
|
models: otherModels,
|
|
@@ -6548,7 +7061,7 @@ var MessageBubble = ({
|
|
|
6548
7061
|
}
|
|
6549
7062
|
);
|
|
6550
7063
|
};
|
|
6551
|
-
var ModelMenu = ({ models, onSelect, onClose }) => /* @__PURE__ */
|
|
7064
|
+
var ModelMenu = ({ models, onSelect, onClose }) => /* @__PURE__ */ jsxs12(
|
|
6552
7065
|
"div",
|
|
6553
7066
|
{
|
|
6554
7067
|
style: {
|
|
@@ -6566,7 +7079,7 @@ var ModelMenu = ({ models, onSelect, onClose }) => /* @__PURE__ */ jsxs9(
|
|
|
6566
7079
|
},
|
|
6567
7080
|
onMouseLeave: onClose,
|
|
6568
7081
|
children: [
|
|
6569
|
-
/* @__PURE__ */
|
|
7082
|
+
/* @__PURE__ */ jsx13(
|
|
6570
7083
|
"div",
|
|
6571
7084
|
{
|
|
6572
7085
|
style: {
|
|
@@ -6581,7 +7094,7 @@ var ModelMenu = ({ models, onSelect, onClose }) => /* @__PURE__ */ jsxs9(
|
|
|
6581
7094
|
children: "\uB2E4\uB978 \uBAA8\uB378\uC5D0\uAC8C \uC9C8\uBB38"
|
|
6582
7095
|
}
|
|
6583
7096
|
),
|
|
6584
|
-
models.map((model) => /* @__PURE__ */
|
|
7097
|
+
models.map((model) => /* @__PURE__ */ jsxs12(
|
|
6585
7098
|
"button",
|
|
6586
7099
|
{
|
|
6587
7100
|
onClick: () => onSelect(model.id),
|
|
@@ -6606,9 +7119,9 @@ var ModelMenu = ({ models, onSelect, onClose }) => /* @__PURE__ */ jsxs9(
|
|
|
6606
7119
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
6607
7120
|
},
|
|
6608
7121
|
children: [
|
|
6609
|
-
/* @__PURE__ */
|
|
6610
|
-
/* @__PURE__ */
|
|
6611
|
-
model.provider && /* @__PURE__ */
|
|
7122
|
+
/* @__PURE__ */ jsx13(IconSvg, { name: "robot-line", size: 16, color: "var(--chatllm-primary)" }),
|
|
7123
|
+
/* @__PURE__ */ jsx13("span", { style: { flex: 1, fontWeight: 500 }, children: model.name }),
|
|
7124
|
+
model.provider && /* @__PURE__ */ jsx13(
|
|
6612
7125
|
"span",
|
|
6613
7126
|
{
|
|
6614
7127
|
style: {
|
|
@@ -6657,7 +7170,7 @@ var navButtonStyle = {
|
|
|
6657
7170
|
};
|
|
6658
7171
|
|
|
6659
7172
|
// src/react/components/MessageList.tsx
|
|
6660
|
-
import { jsx as
|
|
7173
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6661
7174
|
var MessageList = ({
|
|
6662
7175
|
messages,
|
|
6663
7176
|
isLoading,
|
|
@@ -6679,8 +7192,8 @@ var MessageList = ({
|
|
|
6679
7192
|
}) => {
|
|
6680
7193
|
const messagesEndRef = useRef6(null);
|
|
6681
7194
|
const containerRef = useRef6(null);
|
|
6682
|
-
const [selectedText, setSelectedText] =
|
|
6683
|
-
const [selectionPosition, setSelectionPosition] =
|
|
7195
|
+
const [selectedText, setSelectedText] = useState12("");
|
|
7196
|
+
const [selectionPosition, setSelectionPosition] = useState12(null);
|
|
6684
7197
|
useEffect6(() => {
|
|
6685
7198
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
6686
7199
|
}, [messages]);
|
|
@@ -6716,7 +7229,7 @@ var MessageList = ({
|
|
|
6716
7229
|
window.getSelection()?.removeAllRanges();
|
|
6717
7230
|
}
|
|
6718
7231
|
};
|
|
6719
|
-
return /* @__PURE__ */
|
|
7232
|
+
return /* @__PURE__ */ jsxs13(
|
|
6720
7233
|
"div",
|
|
6721
7234
|
{
|
|
6722
7235
|
ref: containerRef,
|
|
@@ -6728,7 +7241,7 @@ var MessageList = ({
|
|
|
6728
7241
|
},
|
|
6729
7242
|
onMouseUp: handleMouseUp,
|
|
6730
7243
|
children: [
|
|
6731
|
-
/* @__PURE__ */
|
|
7244
|
+
/* @__PURE__ */ jsxs13(
|
|
6732
7245
|
"div",
|
|
6733
7246
|
{
|
|
6734
7247
|
style: {
|
|
@@ -6743,7 +7256,7 @@ var MessageList = ({
|
|
|
6743
7256
|
const nextAssistant = message.role === "user" && index + 1 < messages.length ? messages[index + 1] : null;
|
|
6744
7257
|
const assistantForAlts = nextAssistant?.role === "assistant" ? nextAssistant : null;
|
|
6745
7258
|
const activeAltIndex = assistantForAlts ? activeAlternatives[assistantForAlts.id] ?? 0 : 0;
|
|
6746
|
-
return /* @__PURE__ */
|
|
7259
|
+
return /* @__PURE__ */ jsx14(
|
|
6747
7260
|
MessageBubble,
|
|
6748
7261
|
{
|
|
6749
7262
|
message,
|
|
@@ -6774,11 +7287,11 @@ var MessageList = ({
|
|
|
6774
7287
|
message.id
|
|
6775
7288
|
);
|
|
6776
7289
|
}),
|
|
6777
|
-
/* @__PURE__ */
|
|
7290
|
+
/* @__PURE__ */ jsx14("div", { ref: messagesEndRef })
|
|
6778
7291
|
]
|
|
6779
7292
|
}
|
|
6780
7293
|
),
|
|
6781
|
-
selectionPosition && /* @__PURE__ */
|
|
7294
|
+
selectionPosition && /* @__PURE__ */ jsxs13(
|
|
6782
7295
|
"div",
|
|
6783
7296
|
{
|
|
6784
7297
|
style: {
|
|
@@ -6790,7 +7303,7 @@ var MessageList = ({
|
|
|
6790
7303
|
pointerEvents: "auto"
|
|
6791
7304
|
},
|
|
6792
7305
|
children: [
|
|
6793
|
-
/* @__PURE__ */
|
|
7306
|
+
/* @__PURE__ */ jsxs13(
|
|
6794
7307
|
"button",
|
|
6795
7308
|
{
|
|
6796
7309
|
onClick: handleQuote,
|
|
@@ -6810,12 +7323,12 @@ var MessageList = ({
|
|
|
6810
7323
|
whiteSpace: "nowrap"
|
|
6811
7324
|
},
|
|
6812
7325
|
children: [
|
|
6813
|
-
/* @__PURE__ */
|
|
7326
|
+
/* @__PURE__ */ jsx14(IconSvg, { name: "double-quotes-l", size: 16, color: "#ffffff" }),
|
|
6814
7327
|
"\uC778\uC6A9\uD558\uAE30"
|
|
6815
7328
|
]
|
|
6816
7329
|
}
|
|
6817
7330
|
),
|
|
6818
|
-
/* @__PURE__ */
|
|
7331
|
+
/* @__PURE__ */ jsx14(
|
|
6819
7332
|
"div",
|
|
6820
7333
|
{
|
|
6821
7334
|
style: {
|
|
@@ -6840,7 +7353,7 @@ var MessageList = ({
|
|
|
6840
7353
|
};
|
|
6841
7354
|
|
|
6842
7355
|
// src/react/components/EmptyState.tsx
|
|
6843
|
-
import { jsx as
|
|
7356
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6844
7357
|
var EmptyState = ({
|
|
6845
7358
|
greeting,
|
|
6846
7359
|
templates = [],
|
|
@@ -6858,7 +7371,7 @@ var EmptyState = ({
|
|
|
6858
7371
|
return iconMap[icon] || "sparkling-line";
|
|
6859
7372
|
};
|
|
6860
7373
|
const hasContent = actions.length > 0 || templates.length > 0;
|
|
6861
|
-
return /* @__PURE__ */
|
|
7374
|
+
return /* @__PURE__ */ jsxs14(
|
|
6862
7375
|
"div",
|
|
6863
7376
|
{
|
|
6864
7377
|
className: "chatllm-empty-state",
|
|
@@ -6873,7 +7386,7 @@ var EmptyState = ({
|
|
|
6873
7386
|
textAlign: "center"
|
|
6874
7387
|
},
|
|
6875
7388
|
children: [
|
|
6876
|
-
/* @__PURE__ */
|
|
7389
|
+
/* @__PURE__ */ jsx15(
|
|
6877
7390
|
"div",
|
|
6878
7391
|
{
|
|
6879
7392
|
className: "chatllm-sheet",
|
|
@@ -6887,10 +7400,10 @@ var EmptyState = ({
|
|
|
6887
7400
|
marginBottom: "32px",
|
|
6888
7401
|
color: "var(--chatllm-primary)"
|
|
6889
7402
|
},
|
|
6890
|
-
children: /* @__PURE__ */
|
|
7403
|
+
children: /* @__PURE__ */ jsx15(IconSvg, { name: "chat-1-line", size: 40 })
|
|
6891
7404
|
}
|
|
6892
7405
|
),
|
|
6893
|
-
/* @__PURE__ */
|
|
7406
|
+
/* @__PURE__ */ jsx15(
|
|
6894
7407
|
"h1",
|
|
6895
7408
|
{
|
|
6896
7409
|
style: {
|
|
@@ -6903,7 +7416,7 @@ var EmptyState = ({
|
|
|
6903
7416
|
children: "How can I help you today?"
|
|
6904
7417
|
}
|
|
6905
7418
|
),
|
|
6906
|
-
(actions.length > 0 || templates.length > 0) && /* @__PURE__ */
|
|
7419
|
+
(actions.length > 0 || templates.length > 0) && /* @__PURE__ */ jsxs14(
|
|
6907
7420
|
"div",
|
|
6908
7421
|
{
|
|
6909
7422
|
style: {
|
|
@@ -6915,7 +7428,7 @@ var EmptyState = ({
|
|
|
6915
7428
|
marginBottom: "48px"
|
|
6916
7429
|
},
|
|
6917
7430
|
children: [
|
|
6918
|
-
actions.map((action) => /* @__PURE__ */
|
|
7431
|
+
actions.map((action) => /* @__PURE__ */ jsxs14(
|
|
6919
7432
|
"button",
|
|
6920
7433
|
{
|
|
6921
7434
|
onClick: () => onActionSelect?.(action),
|
|
@@ -6929,7 +7442,7 @@ var EmptyState = ({
|
|
|
6929
7442
|
fontWeight: 500
|
|
6930
7443
|
},
|
|
6931
7444
|
children: [
|
|
6932
|
-
/* @__PURE__ */
|
|
7445
|
+
/* @__PURE__ */ jsx15(
|
|
6933
7446
|
IconSvg,
|
|
6934
7447
|
{
|
|
6935
7448
|
name: getActionIcon(action.icon),
|
|
@@ -6942,7 +7455,7 @@ var EmptyState = ({
|
|
|
6942
7455
|
},
|
|
6943
7456
|
action.id
|
|
6944
7457
|
)),
|
|
6945
|
-
templates.slice(0, 4).map((template) => /* @__PURE__ */
|
|
7458
|
+
templates.slice(0, 4).map((template) => /* @__PURE__ */ jsxs14(
|
|
6946
7459
|
"button",
|
|
6947
7460
|
{
|
|
6948
7461
|
onClick: () => onTemplateClick(template),
|
|
@@ -6956,7 +7469,7 @@ var EmptyState = ({
|
|
|
6956
7469
|
fontWeight: 500
|
|
6957
7470
|
},
|
|
6958
7471
|
children: [
|
|
6959
|
-
/* @__PURE__ */
|
|
7472
|
+
/* @__PURE__ */ jsx15(
|
|
6960
7473
|
IconSvg,
|
|
6961
7474
|
{
|
|
6962
7475
|
name: "sparkling-line",
|
|
@@ -6978,8 +7491,8 @@ var EmptyState = ({
|
|
|
6978
7491
|
};
|
|
6979
7492
|
|
|
6980
7493
|
// src/react/components/SettingsModal.tsx
|
|
6981
|
-
import { useState as
|
|
6982
|
-
import { jsx as
|
|
7494
|
+
import { useState as useState13 } from "react";
|
|
7495
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
6983
7496
|
var DEFAULT_PERSONALIZATION2 = {
|
|
6984
7497
|
responseStyle: {
|
|
6985
7498
|
warmth: "medium",
|
|
@@ -7005,10 +7518,11 @@ var SettingsModal = ({
|
|
|
7005
7518
|
memoryItems = [],
|
|
7006
7519
|
contextSummary,
|
|
7007
7520
|
onDeleteMemory,
|
|
7008
|
-
onClearMemory
|
|
7521
|
+
onClearMemory,
|
|
7522
|
+
onSave
|
|
7009
7523
|
}) => {
|
|
7010
|
-
const [activeTab, setActiveTab] =
|
|
7011
|
-
const [localApiKey, setLocalApiKey] =
|
|
7524
|
+
const [activeTab, setActiveTab] = useState13("general");
|
|
7525
|
+
const [localApiKey, setLocalApiKey] = useState13(apiKey);
|
|
7012
7526
|
if (!isOpen) return null;
|
|
7013
7527
|
const updateResponseStyle = (key, value) => {
|
|
7014
7528
|
onPersonalizationChange({
|
|
@@ -7032,7 +7546,7 @@ var SettingsModal = ({
|
|
|
7032
7546
|
setLocalApiKey(value);
|
|
7033
7547
|
onApiKeyChange?.(value);
|
|
7034
7548
|
};
|
|
7035
|
-
return /* @__PURE__ */
|
|
7549
|
+
return /* @__PURE__ */ jsx16(
|
|
7036
7550
|
"div",
|
|
7037
7551
|
{
|
|
7038
7552
|
className: "chatllm-settings-overlay",
|
|
@@ -7046,7 +7560,7 @@ var SettingsModal = ({
|
|
|
7046
7560
|
zIndex: 1e3
|
|
7047
7561
|
},
|
|
7048
7562
|
onClick: onClose,
|
|
7049
|
-
children: /* @__PURE__ */
|
|
7563
|
+
children: /* @__PURE__ */ jsxs15(
|
|
7050
7564
|
"div",
|
|
7051
7565
|
{
|
|
7052
7566
|
className: "chatllm-settings-modal",
|
|
@@ -7064,7 +7578,7 @@ var SettingsModal = ({
|
|
|
7064
7578
|
},
|
|
7065
7579
|
onClick: (e) => e.stopPropagation(),
|
|
7066
7580
|
children: [
|
|
7067
|
-
/* @__PURE__ */
|
|
7581
|
+
/* @__PURE__ */ jsxs15(
|
|
7068
7582
|
"div",
|
|
7069
7583
|
{
|
|
7070
7584
|
style: {
|
|
@@ -7075,7 +7589,7 @@ var SettingsModal = ({
|
|
|
7075
7589
|
flexDirection: "column"
|
|
7076
7590
|
},
|
|
7077
7591
|
children: [
|
|
7078
|
-
/* @__PURE__ */
|
|
7592
|
+
/* @__PURE__ */ jsx16("div", { style: { padding: "16px", borderBottom: "1px solid var(--chatllm-border, #e5e7eb)" }, children: /* @__PURE__ */ jsx16(
|
|
7079
7593
|
"button",
|
|
7080
7594
|
{
|
|
7081
7595
|
onClick: onClose,
|
|
@@ -7089,11 +7603,11 @@ var SettingsModal = ({
|
|
|
7089
7603
|
alignItems: "center",
|
|
7090
7604
|
justifyContent: "center"
|
|
7091
7605
|
},
|
|
7092
|
-
children: /* @__PURE__ */
|
|
7606
|
+
children: /* @__PURE__ */ jsx16(IconSvg, { name: "close-line", size: 20, color: "var(--chatllm-text-muted, #6b7280)" })
|
|
7093
7607
|
}
|
|
7094
7608
|
) }),
|
|
7095
|
-
/* @__PURE__ */
|
|
7096
|
-
/* @__PURE__ */
|
|
7609
|
+
/* @__PURE__ */ jsxs15("nav", { style: { flex: 1, padding: "8px" }, children: [
|
|
7610
|
+
/* @__PURE__ */ jsx16(
|
|
7097
7611
|
TabButton,
|
|
7098
7612
|
{
|
|
7099
7613
|
active: activeTab === "general",
|
|
@@ -7102,7 +7616,7 @@ var SettingsModal = ({
|
|
|
7102
7616
|
label: "\uC77C\uBC18"
|
|
7103
7617
|
}
|
|
7104
7618
|
),
|
|
7105
|
-
/* @__PURE__ */
|
|
7619
|
+
/* @__PURE__ */ jsx16(
|
|
7106
7620
|
TabButton,
|
|
7107
7621
|
{
|
|
7108
7622
|
active: activeTab === "personalization",
|
|
@@ -7111,7 +7625,7 @@ var SettingsModal = ({
|
|
|
7111
7625
|
label: "\uAC1C\uC778 \uB9DE\uCDA4 \uC124\uC815"
|
|
7112
7626
|
}
|
|
7113
7627
|
),
|
|
7114
|
-
/* @__PURE__ */
|
|
7628
|
+
/* @__PURE__ */ jsx16(
|
|
7115
7629
|
TabButton,
|
|
7116
7630
|
{
|
|
7117
7631
|
active: activeTab === "memory",
|
|
@@ -7120,7 +7634,7 @@ var SettingsModal = ({
|
|
|
7120
7634
|
label: "AI \uBA54\uBAA8\uB9AC"
|
|
7121
7635
|
}
|
|
7122
7636
|
),
|
|
7123
|
-
/* @__PURE__ */
|
|
7637
|
+
/* @__PURE__ */ jsx16(
|
|
7124
7638
|
TabButton,
|
|
7125
7639
|
{
|
|
7126
7640
|
active: activeTab === "data",
|
|
@@ -7133,24 +7647,24 @@ var SettingsModal = ({
|
|
|
7133
7647
|
]
|
|
7134
7648
|
}
|
|
7135
7649
|
),
|
|
7136
|
-
/* @__PURE__ */
|
|
7137
|
-
activeTab === "general" && /* @__PURE__ */
|
|
7138
|
-
/* @__PURE__ */
|
|
7139
|
-
/* @__PURE__ */
|
|
7650
|
+
/* @__PURE__ */ jsxs15("div", { style: { flex: 1, overflow: "auto", padding: "24px" }, children: [
|
|
7651
|
+
activeTab === "general" && /* @__PURE__ */ jsxs15("div", { children: [
|
|
7652
|
+
/* @__PURE__ */ jsx16("h2", { style: { fontSize: "20px", fontWeight: 600, marginBottom: "24px", color: "var(--chatllm-text, #1f2937)" }, children: "\uC77C\uBC18" }),
|
|
7653
|
+
/* @__PURE__ */ jsx16(SettingRow, { label: "\uC5B8\uC5B4", children: /* @__PURE__ */ jsxs15(
|
|
7140
7654
|
"select",
|
|
7141
7655
|
{
|
|
7142
7656
|
value: personalization.language,
|
|
7143
7657
|
onChange: (e) => onPersonalizationChange({ ...personalization, language: e.target.value }),
|
|
7144
7658
|
style: selectStyle,
|
|
7145
7659
|
children: [
|
|
7146
|
-
/* @__PURE__ */
|
|
7147
|
-
/* @__PURE__ */
|
|
7148
|
-
/* @__PURE__ */
|
|
7149
|
-
/* @__PURE__ */
|
|
7660
|
+
/* @__PURE__ */ jsx16("option", { value: "auto", children: "\uC790\uB3D9 \uD0D0\uC9C0" }),
|
|
7661
|
+
/* @__PURE__ */ jsx16("option", { value: "ko", children: "\uD55C\uAD6D\uC5B4" }),
|
|
7662
|
+
/* @__PURE__ */ jsx16("option", { value: "en", children: "English" }),
|
|
7663
|
+
/* @__PURE__ */ jsx16("option", { value: "ja", children: "\u65E5\u672C\u8A9E" })
|
|
7150
7664
|
]
|
|
7151
7665
|
}
|
|
7152
7666
|
) }),
|
|
7153
|
-
/* @__PURE__ */
|
|
7667
|
+
/* @__PURE__ */ jsx16(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__ */ jsx16(
|
|
7154
7668
|
"button",
|
|
7155
7669
|
{
|
|
7156
7670
|
onClick: () => onPersonalizationChange(DEFAULT_PERSONALIZATION2),
|
|
@@ -7158,11 +7672,11 @@ var SettingsModal = ({
|
|
|
7158
7672
|
children: "\uCD08\uAE30\uD654"
|
|
7159
7673
|
}
|
|
7160
7674
|
) }),
|
|
7161
|
-
onApiKeyChange && /* @__PURE__ */
|
|
7162
|
-
/* @__PURE__ */
|
|
7163
|
-
/* @__PURE__ */
|
|
7164
|
-
/* @__PURE__ */
|
|
7165
|
-
/* @__PURE__ */
|
|
7675
|
+
onApiKeyChange && /* @__PURE__ */ jsxs15("div", { style: { marginTop: "32px", paddingTop: "24px", borderTop: "1px solid var(--chatllm-border, #e5e7eb)" }, children: [
|
|
7676
|
+
/* @__PURE__ */ jsx16("h3", { style: { fontSize: "16px", fontWeight: 500, marginBottom: "16px", color: "var(--chatllm-text, #1f2937)" }, children: "API \uC124\uC815" }),
|
|
7677
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
7678
|
+
/* @__PURE__ */ jsx16("label", { style: { display: "block", fontSize: "14px", marginBottom: "8px", color: "var(--chatllm-text, #374151)" }, children: apiKeyLabel }),
|
|
7679
|
+
/* @__PURE__ */ jsx16(
|
|
7166
7680
|
"input",
|
|
7167
7681
|
{
|
|
7168
7682
|
type: "password",
|
|
@@ -7172,18 +7686,18 @@ var SettingsModal = ({
|
|
|
7172
7686
|
style: inputStyle
|
|
7173
7687
|
}
|
|
7174
7688
|
),
|
|
7175
|
-
/* @__PURE__ */
|
|
7689
|
+
/* @__PURE__ */ jsx16("p", { style: { fontSize: "12px", color: "var(--chatllm-text-muted, #9ca3af)", marginTop: "4px" }, children: apiKeyDescription })
|
|
7176
7690
|
] })
|
|
7177
7691
|
] })
|
|
7178
7692
|
] }),
|
|
7179
|
-
activeTab === "personalization" && /* @__PURE__ */
|
|
7180
|
-
/* @__PURE__ */
|
|
7181
|
-
/* @__PURE__ */
|
|
7182
|
-
/* @__PURE__ */
|
|
7183
|
-
/* @__PURE__ */
|
|
7184
|
-
/* @__PURE__ */
|
|
7185
|
-
/* @__PURE__ */
|
|
7186
|
-
/* @__PURE__ */
|
|
7693
|
+
activeTab === "personalization" && /* @__PURE__ */ jsxs15("div", { children: [
|
|
7694
|
+
/* @__PURE__ */ jsx16("h2", { style: { fontSize: "20px", fontWeight: 600, marginBottom: "24px", color: "var(--chatllm-text, #1f2937)" }, children: "\uAC1C\uC778 \uB9DE\uCDA4 \uC124\uC815" }),
|
|
7695
|
+
/* @__PURE__ */ jsxs15("section", { style: { marginBottom: "32px" }, children: [
|
|
7696
|
+
/* @__PURE__ */ jsx16("h3", { style: { fontSize: "14px", fontWeight: 500, color: "var(--chatllm-text-muted, #6b7280)", marginBottom: "16px" }, children: "\uC0AC\uC6A9\uC790 \uD504\uB85C\uD544" }),
|
|
7697
|
+
/* @__PURE__ */ jsxs15("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [
|
|
7698
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
7699
|
+
/* @__PURE__ */ jsx16("label", { style: labelStyle, children: "\uB2C9\uB124\uC784" }),
|
|
7700
|
+
/* @__PURE__ */ jsx16(
|
|
7187
7701
|
"input",
|
|
7188
7702
|
{
|
|
7189
7703
|
type: "text",
|
|
@@ -7194,9 +7708,9 @@ var SettingsModal = ({
|
|
|
7194
7708
|
}
|
|
7195
7709
|
)
|
|
7196
7710
|
] }),
|
|
7197
|
-
/* @__PURE__ */
|
|
7198
|
-
/* @__PURE__ */
|
|
7199
|
-
/* @__PURE__ */
|
|
7711
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
7712
|
+
/* @__PURE__ */ jsx16("label", { style: labelStyle, children: "\uC9C1\uC5C5" }),
|
|
7713
|
+
/* @__PURE__ */ jsx16(
|
|
7200
7714
|
"input",
|
|
7201
7715
|
{
|
|
7202
7716
|
type: "text",
|
|
@@ -7207,9 +7721,9 @@ var SettingsModal = ({
|
|
|
7207
7721
|
}
|
|
7208
7722
|
)
|
|
7209
7723
|
] }),
|
|
7210
|
-
/* @__PURE__ */
|
|
7211
|
-
/* @__PURE__ */
|
|
7212
|
-
/* @__PURE__ */
|
|
7724
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
7725
|
+
/* @__PURE__ */ jsx16("label", { style: labelStyle, children: "\uCD94\uAC00 \uC815\uBCF4" }),
|
|
7726
|
+
/* @__PURE__ */ jsx16(
|
|
7213
7727
|
"textarea",
|
|
7214
7728
|
{
|
|
7215
7729
|
value: personalization.userProfile.additionalInfo || "",
|
|
@@ -7222,63 +7736,83 @@ var SettingsModal = ({
|
|
|
7222
7736
|
] })
|
|
7223
7737
|
] })
|
|
7224
7738
|
] }),
|
|
7225
|
-
/* @__PURE__ */
|
|
7226
|
-
/* @__PURE__ */
|
|
7227
|
-
/* @__PURE__ */
|
|
7739
|
+
/* @__PURE__ */ jsxs15("section", { children: [
|
|
7740
|
+
/* @__PURE__ */ jsx16("h3", { style: { fontSize: "14px", fontWeight: 500, color: "var(--chatllm-text-muted, #6b7280)", marginBottom: "16px" }, children: "\uC751\uB2F5 \uC2A4\uD0C0\uC77C" }),
|
|
7741
|
+
/* @__PURE__ */ jsx16(SettingRow, { label: "\uB530\uB73B\uD568", children: /* @__PURE__ */ jsxs15(
|
|
7228
7742
|
"select",
|
|
7229
7743
|
{
|
|
7230
7744
|
value: personalization.responseStyle.warmth,
|
|
7231
7745
|
onChange: (e) => updateResponseStyle("warmth", e.target.value),
|
|
7232
7746
|
style: selectStyle,
|
|
7233
7747
|
children: [
|
|
7234
|
-
/* @__PURE__ */
|
|
7235
|
-
/* @__PURE__ */
|
|
7236
|
-
/* @__PURE__ */
|
|
7748
|
+
/* @__PURE__ */ jsx16("option", { value: "high", children: "\uB192\uC74C - \uCE5C\uADFC\uD558\uACE0 \uB530\uB73B\uD558\uAC8C" }),
|
|
7749
|
+
/* @__PURE__ */ jsx16("option", { value: "medium", children: "\uAE30\uBCF8\uAC12" }),
|
|
7750
|
+
/* @__PURE__ */ jsx16("option", { value: "low", children: "\uB0AE\uC74C - \uAC04\uACB0\uD558\uACE0 \uC0AC\uBB34\uC801\uC73C\uB85C" })
|
|
7237
7751
|
]
|
|
7238
7752
|
}
|
|
7239
7753
|
) }),
|
|
7240
|
-
/* @__PURE__ */
|
|
7754
|
+
/* @__PURE__ */ jsx16(SettingRow, { label: "\uC5F4\uC815\uC801", children: /* @__PURE__ */ jsxs15(
|
|
7241
7755
|
"select",
|
|
7242
7756
|
{
|
|
7243
7757
|
value: personalization.responseStyle.enthusiasm,
|
|
7244
7758
|
onChange: (e) => updateResponseStyle("enthusiasm", e.target.value),
|
|
7245
7759
|
style: selectStyle,
|
|
7246
7760
|
children: [
|
|
7247
|
-
/* @__PURE__ */
|
|
7248
|
-
/* @__PURE__ */
|
|
7249
|
-
/* @__PURE__ */
|
|
7761
|
+
/* @__PURE__ */ jsx16("option", { value: "high", children: "\uB192\uC74C - \uC801\uADF9\uC801\uC774\uACE0 \uD65C\uBC1C\uD558\uAC8C" }),
|
|
7762
|
+
/* @__PURE__ */ jsx16("option", { value: "medium", children: "\uAE30\uBCF8\uAC12" }),
|
|
7763
|
+
/* @__PURE__ */ jsx16("option", { value: "low", children: "\uB0AE\uC74C - \uCC28\uBD84\uD558\uACE0 \uC808\uC81C\uC788\uAC8C" })
|
|
7250
7764
|
]
|
|
7251
7765
|
}
|
|
7252
7766
|
) }),
|
|
7253
|
-
/* @__PURE__ */
|
|
7767
|
+
/* @__PURE__ */ jsx16(SettingRow, { label: "\uC774\uBAA8\uC9C0 \uC0AC\uC6A9", children: /* @__PURE__ */ jsxs15(
|
|
7254
7768
|
"select",
|
|
7255
7769
|
{
|
|
7256
7770
|
value: personalization.responseStyle.emojiUsage,
|
|
7257
7771
|
onChange: (e) => updateResponseStyle("emojiUsage", e.target.value),
|
|
7258
7772
|
style: selectStyle,
|
|
7259
7773
|
children: [
|
|
7260
|
-
/* @__PURE__ */
|
|
7261
|
-
/* @__PURE__ */
|
|
7262
|
-
/* @__PURE__ */
|
|
7774
|
+
/* @__PURE__ */ jsx16("option", { value: "high", children: "\uB192\uC74C - \uC790\uC8FC \uC0AC\uC6A9" }),
|
|
7775
|
+
/* @__PURE__ */ jsx16("option", { value: "medium", children: "\uAE30\uBCF8\uAC12" }),
|
|
7776
|
+
/* @__PURE__ */ jsx16("option", { value: "low", children: "\uB0AE\uC74C - \uAC70\uC758 \uC0AC\uC6A9 \uC548 \uD568" })
|
|
7263
7777
|
]
|
|
7264
7778
|
}
|
|
7265
7779
|
) }),
|
|
7266
|
-
/* @__PURE__ */
|
|
7780
|
+
/* @__PURE__ */ jsx16(SettingRow, { label: "\uC751\uB2F5 \uAE38\uC774", children: /* @__PURE__ */ jsxs15(
|
|
7267
7781
|
"select",
|
|
7268
7782
|
{
|
|
7269
7783
|
value: personalization.responseStyle.verbosity,
|
|
7270
7784
|
onChange: (e) => updateResponseStyle("verbosity", e.target.value),
|
|
7271
7785
|
style: selectStyle,
|
|
7272
7786
|
children: [
|
|
7273
|
-
/* @__PURE__ */
|
|
7274
|
-
/* @__PURE__ */
|
|
7275
|
-
/* @__PURE__ */
|
|
7787
|
+
/* @__PURE__ */ jsx16("option", { value: "detailed", children: "\uC0C1\uC138 - \uC790\uC138\uD558\uAC8C \uC124\uBA85" }),
|
|
7788
|
+
/* @__PURE__ */ jsx16("option", { value: "balanced", children: "\uAE30\uBCF8\uAC12" }),
|
|
7789
|
+
/* @__PURE__ */ jsx16("option", { value: "concise", children: "\uAC04\uACB0 - \uD575\uC2EC\uB9CC \uC694\uC57D" })
|
|
7276
7790
|
]
|
|
7277
7791
|
}
|
|
7278
7792
|
) })
|
|
7279
|
-
] })
|
|
7793
|
+
] }),
|
|
7794
|
+
onSave && /* @__PURE__ */ jsx16("div", { style: { marginTop: "24px", display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ jsx16(
|
|
7795
|
+
"button",
|
|
7796
|
+
{
|
|
7797
|
+
onClick: onSave,
|
|
7798
|
+
style: {
|
|
7799
|
+
padding: "10px 24px",
|
|
7800
|
+
backgroundColor: "var(--chatllm-primary, #4A90E2)",
|
|
7801
|
+
color: "#fff",
|
|
7802
|
+
border: "none",
|
|
7803
|
+
borderRadius: "8px",
|
|
7804
|
+
fontSize: "14px",
|
|
7805
|
+
fontWeight: 600,
|
|
7806
|
+
cursor: "pointer",
|
|
7807
|
+
transition: "opacity 0.15s ease"
|
|
7808
|
+
},
|
|
7809
|
+
onMouseEnter: (e) => e.currentTarget.style.opacity = "0.85",
|
|
7810
|
+
onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
|
|
7811
|
+
children: "\uC800\uC7A5"
|
|
7812
|
+
}
|
|
7813
|
+
) })
|
|
7280
7814
|
] }),
|
|
7281
|
-
activeTab === "memory" && /* @__PURE__ */
|
|
7815
|
+
activeTab === "memory" && /* @__PURE__ */ jsx16(
|
|
7282
7816
|
MemoryTabContent,
|
|
7283
7817
|
{
|
|
7284
7818
|
items: memoryItems,
|
|
@@ -7287,9 +7821,9 @@ var SettingsModal = ({
|
|
|
7287
7821
|
onClearAll: onClearMemory
|
|
7288
7822
|
}
|
|
7289
7823
|
),
|
|
7290
|
-
activeTab === "data" && /* @__PURE__ */
|
|
7291
|
-
/* @__PURE__ */
|
|
7292
|
-
/* @__PURE__ */
|
|
7824
|
+
activeTab === "data" && /* @__PURE__ */ jsxs15("div", { children: [
|
|
7825
|
+
/* @__PURE__ */ jsx16("h2", { style: { fontSize: "20px", fontWeight: 600, marginBottom: "24px", color: "var(--chatllm-text, #1f2937)" }, children: "\uB370\uC774\uD130 \uC81C\uC5B4" }),
|
|
7826
|
+
/* @__PURE__ */ jsx16(SettingRow, { label: "\uBA54\uBAA8\uB9AC \uC0AC\uC6A9", description: "\uB300\uD654 \uCEE8\uD14D\uC2A4\uD2B8\uB97C \uAE30\uC5B5\uD569\uB2C8\uB2E4", children: /* @__PURE__ */ jsx16(
|
|
7293
7827
|
"button",
|
|
7294
7828
|
{
|
|
7295
7829
|
onClick: () => onPersonalizationChange({ ...personalization, useMemory: !personalization.useMemory }),
|
|
@@ -7303,7 +7837,7 @@ var SettingsModal = ({
|
|
|
7303
7837
|
position: "relative",
|
|
7304
7838
|
transition: "background-color 0.2s"
|
|
7305
7839
|
},
|
|
7306
|
-
children: /* @__PURE__ */
|
|
7840
|
+
children: /* @__PURE__ */ jsx16(
|
|
7307
7841
|
"div",
|
|
7308
7842
|
{
|
|
7309
7843
|
style: {
|
|
@@ -7321,7 +7855,7 @@ var SettingsModal = ({
|
|
|
7321
7855
|
)
|
|
7322
7856
|
}
|
|
7323
7857
|
) }),
|
|
7324
|
-
onClearAllData && /* @__PURE__ */
|
|
7858
|
+
onClearAllData && /* @__PURE__ */ jsx16(SettingRow, { label: "\uB300\uD654 \uAE30\uB85D \uC0AD\uC81C", description: "\uBAA8\uB4E0 \uB300\uD654 \uAE30\uB85D\uC744 \uC0AD\uC81C\uD569\uB2C8\uB2E4", children: /* @__PURE__ */ jsx16(
|
|
7325
7859
|
"button",
|
|
7326
7860
|
{
|
|
7327
7861
|
onClick: () => {
|
|
@@ -7341,7 +7875,7 @@ var SettingsModal = ({
|
|
|
7341
7875
|
}
|
|
7342
7876
|
);
|
|
7343
7877
|
};
|
|
7344
|
-
var TabButton = ({ active, onClick, icon, label }) => /* @__PURE__ */
|
|
7878
|
+
var TabButton = ({ active, onClick, icon, label }) => /* @__PURE__ */ jsxs15(
|
|
7345
7879
|
"button",
|
|
7346
7880
|
{
|
|
7347
7881
|
onClick,
|
|
@@ -7362,12 +7896,12 @@ var TabButton = ({ active, onClick, icon, label }) => /* @__PURE__ */ jsxs12(
|
|
|
7362
7896
|
marginBottom: "4px"
|
|
7363
7897
|
},
|
|
7364
7898
|
children: [
|
|
7365
|
-
/* @__PURE__ */
|
|
7899
|
+
/* @__PURE__ */ jsx16(IconSvg, { name: icon, size: 20 }),
|
|
7366
7900
|
label
|
|
7367
7901
|
]
|
|
7368
7902
|
}
|
|
7369
7903
|
);
|
|
7370
|
-
var SettingRow = ({ label, description, children }) => /* @__PURE__ */
|
|
7904
|
+
var SettingRow = ({ label, description, children }) => /* @__PURE__ */ jsxs15(
|
|
7371
7905
|
"div",
|
|
7372
7906
|
{
|
|
7373
7907
|
style: {
|
|
@@ -7378,9 +7912,9 @@ var SettingRow = ({ label, description, children }) => /* @__PURE__ */ jsxs12(
|
|
|
7378
7912
|
borderBottom: "1px solid var(--chatllm-border-light, #f3f4f6)"
|
|
7379
7913
|
},
|
|
7380
7914
|
children: [
|
|
7381
|
-
/* @__PURE__ */
|
|
7382
|
-
/* @__PURE__ */
|
|
7383
|
-
description && /* @__PURE__ */
|
|
7915
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
7916
|
+
/* @__PURE__ */ jsx16("span", { style: { fontSize: "14px", color: "var(--chatllm-text, #374151)" }, children: label }),
|
|
7917
|
+
description && /* @__PURE__ */ jsx16("p", { style: { fontSize: "12px", color: "var(--chatllm-text-muted, #9ca3af)", marginTop: "2px" }, children: description })
|
|
7384
7918
|
] }),
|
|
7385
7919
|
children
|
|
7386
7920
|
]
|
|
@@ -7440,8 +7974,8 @@ var memoryCategoryColors = {
|
|
|
7440
7974
|
preference: "#8b5cf6"
|
|
7441
7975
|
};
|
|
7442
7976
|
var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
|
|
7443
|
-
const [activeFilter, setActiveFilter] =
|
|
7444
|
-
const [expandedId, setExpandedId] =
|
|
7977
|
+
const [activeFilter, setActiveFilter] = useState13("all");
|
|
7978
|
+
const [expandedId, setExpandedId] = useState13(null);
|
|
7445
7979
|
const filteredItems = activeFilter === "all" ? items : items.filter((item) => item.category === activeFilter);
|
|
7446
7980
|
const formatDate = (timestamp) => {
|
|
7447
7981
|
const date = new Date(timestamp);
|
|
@@ -7452,15 +7986,15 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
|
|
|
7452
7986
|
minute: "2-digit"
|
|
7453
7987
|
});
|
|
7454
7988
|
};
|
|
7455
|
-
return /* @__PURE__ */
|
|
7456
|
-
/* @__PURE__ */
|
|
7457
|
-
/* @__PURE__ */
|
|
7458
|
-
/* @__PURE__ */
|
|
7989
|
+
return /* @__PURE__ */ jsxs15("div", { children: [
|
|
7990
|
+
/* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "24px" }, children: [
|
|
7991
|
+
/* @__PURE__ */ jsx16("h2", { style: { fontSize: "20px", fontWeight: 600, color: "var(--chatllm-text, #1f2937)", margin: 0 }, children: "AI \uBA54\uBAA8\uB9AC" }),
|
|
7992
|
+
/* @__PURE__ */ jsxs15("span", { style: { fontSize: "13px", color: "var(--chatllm-text-muted, #9ca3af)" }, children: [
|
|
7459
7993
|
items.length,
|
|
7460
7994
|
"\uAC1C \uD56D\uBAA9"
|
|
7461
7995
|
] })
|
|
7462
7996
|
] }),
|
|
7463
|
-
/* @__PURE__ */
|
|
7997
|
+
/* @__PURE__ */ jsx16("div", { style: { display: "flex", gap: "6px", marginBottom: "20px", flexWrap: "wrap" }, children: ["all", "fact", "skill", "preference"].map((tab) => /* @__PURE__ */ jsx16(
|
|
7464
7998
|
"button",
|
|
7465
7999
|
{
|
|
7466
8000
|
onClick: () => setActiveFilter(tab),
|
|
@@ -7478,7 +8012,7 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
|
|
|
7478
8012
|
},
|
|
7479
8013
|
tab
|
|
7480
8014
|
)) }),
|
|
7481
|
-
contextSummary && activeFilter === "all" && /* @__PURE__ */
|
|
8015
|
+
contextSummary && activeFilter === "all" && /* @__PURE__ */ jsxs15(
|
|
7482
8016
|
"div",
|
|
7483
8017
|
{
|
|
7484
8018
|
style: {
|
|
@@ -7489,19 +8023,19 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
|
|
|
7489
8023
|
borderLeft: "3px solid var(--chatllm-primary, #3b82f6)"
|
|
7490
8024
|
},
|
|
7491
8025
|
children: [
|
|
7492
|
-
/* @__PURE__ */
|
|
7493
|
-
/* @__PURE__ */
|
|
7494
|
-
/* @__PURE__ */
|
|
8026
|
+
/* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", gap: "6px", marginBottom: "8px" }, children: [
|
|
8027
|
+
/* @__PURE__ */ jsx16(IconSvg, { name: "file-text-line", size: 14, color: "var(--chatllm-primary, #3b82f6)" }),
|
|
8028
|
+
/* @__PURE__ */ jsx16("span", { style: { fontSize: "12px", fontWeight: 500, color: "var(--chatllm-primary, #3b82f6)" }, children: "\uB300\uD654 \uC694\uC57D" })
|
|
7495
8029
|
] }),
|
|
7496
|
-
/* @__PURE__ */
|
|
8030
|
+
/* @__PURE__ */ jsx16("p", { style: { fontSize: "13px", lineHeight: "1.6", color: "var(--chatllm-text, #374151)", margin: 0 }, children: contextSummary })
|
|
7497
8031
|
]
|
|
7498
8032
|
}
|
|
7499
8033
|
),
|
|
7500
|
-
filteredItems.length === 0 ? /* @__PURE__ */
|
|
7501
|
-
/* @__PURE__ */
|
|
7502
|
-
/* @__PURE__ */
|
|
7503
|
-
/* @__PURE__ */
|
|
7504
|
-
] }) : /* @__PURE__ */
|
|
8034
|
+
filteredItems.length === 0 ? /* @__PURE__ */ jsxs15("div", { style: { padding: "40px 16px", textAlign: "center" }, children: [
|
|
8035
|
+
/* @__PURE__ */ jsx16(IconSvg, { name: "robot-line", size: 40, color: "var(--chatllm-text-muted, #d1d5db)" }),
|
|
8036
|
+
/* @__PURE__ */ jsx16("p", { style: { fontSize: "14px", color: "var(--chatllm-text-muted, #9ca3af)", marginTop: "12px" }, children: "\uC800\uC7A5\uB41C \uBA54\uBAA8\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4" }),
|
|
8037
|
+
/* @__PURE__ */ jsx16("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" })
|
|
8038
|
+
] }) : /* @__PURE__ */ jsx16("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: filteredItems.map((item) => /* @__PURE__ */ jsxs15(
|
|
7505
8039
|
"div",
|
|
7506
8040
|
{
|
|
7507
8041
|
style: {
|
|
@@ -7514,10 +8048,10 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
|
|
|
7514
8048
|
},
|
|
7515
8049
|
onClick: () => setExpandedId(expandedId === item.id ? null : item.id),
|
|
7516
8050
|
children: [
|
|
7517
|
-
/* @__PURE__ */
|
|
7518
|
-
/* @__PURE__ */
|
|
7519
|
-
/* @__PURE__ */
|
|
7520
|
-
item.category && /* @__PURE__ */
|
|
8051
|
+
/* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" }, children: [
|
|
8052
|
+
/* @__PURE__ */ jsxs15("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
8053
|
+
/* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", gap: "8px", marginBottom: "4px" }, children: [
|
|
8054
|
+
item.category && /* @__PURE__ */ jsx16(
|
|
7521
8055
|
"span",
|
|
7522
8056
|
{
|
|
7523
8057
|
style: {
|
|
@@ -7531,12 +8065,12 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
|
|
|
7531
8065
|
children: memoryCategoryLabels[item.category]
|
|
7532
8066
|
}
|
|
7533
8067
|
),
|
|
7534
|
-
/* @__PURE__ */
|
|
8068
|
+
/* @__PURE__ */ jsx16("span", { style: { fontSize: "11px", color: "var(--chatllm-text-muted, #9ca3af)" }, children: formatDate(item.timestamp) })
|
|
7535
8069
|
] }),
|
|
7536
|
-
/* @__PURE__ */
|
|
8070
|
+
/* @__PURE__ */ jsx16("div", { style: { fontSize: "13px", fontWeight: 500, color: "var(--chatllm-text, #1f2937)" }, children: item.key })
|
|
7537
8071
|
] }),
|
|
7538
|
-
/* @__PURE__ */
|
|
7539
|
-
onDelete && /* @__PURE__ */
|
|
8072
|
+
/* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
8073
|
+
onDelete && /* @__PURE__ */ jsx16(
|
|
7540
8074
|
"button",
|
|
7541
8075
|
{
|
|
7542
8076
|
onClick: (e) => {
|
|
@@ -7552,10 +8086,10 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
|
|
|
7552
8086
|
opacity: 0.5
|
|
7553
8087
|
},
|
|
7554
8088
|
"aria-label": "\uBA54\uBAA8\uB9AC \uC0AD\uC81C",
|
|
7555
|
-
children: /* @__PURE__ */
|
|
8089
|
+
children: /* @__PURE__ */ jsx16(IconSvg, { name: "delete-bin-line", size: 14, color: "var(--chatllm-text-muted, #9ca3af)" })
|
|
7556
8090
|
}
|
|
7557
8091
|
),
|
|
7558
|
-
/* @__PURE__ */
|
|
8092
|
+
/* @__PURE__ */ jsx16(
|
|
7559
8093
|
IconSvg,
|
|
7560
8094
|
{
|
|
7561
8095
|
name: expandedId === item.id ? "arrow-up-s-line" : "arrow-down-s-line",
|
|
@@ -7565,7 +8099,7 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
|
|
|
7565
8099
|
)
|
|
7566
8100
|
] })
|
|
7567
8101
|
] }),
|
|
7568
|
-
expandedId === item.id && /* @__PURE__ */
|
|
8102
|
+
expandedId === item.id && /* @__PURE__ */ jsx16(
|
|
7569
8103
|
"div",
|
|
7570
8104
|
{
|
|
7571
8105
|
style: {
|
|
@@ -7573,7 +8107,7 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
|
|
|
7573
8107
|
paddingTop: "12px",
|
|
7574
8108
|
borderTop: "1px solid var(--chatllm-border-light, #f3f4f6)"
|
|
7575
8109
|
},
|
|
7576
|
-
children: /* @__PURE__ */
|
|
8110
|
+
children: /* @__PURE__ */ jsx16(
|
|
7577
8111
|
"p",
|
|
7578
8112
|
{
|
|
7579
8113
|
style: {
|
|
@@ -7592,7 +8126,7 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
|
|
|
7592
8126
|
},
|
|
7593
8127
|
item.id
|
|
7594
8128
|
)) }),
|
|
7595
|
-
onClearAll && items.length > 0 && /* @__PURE__ */
|
|
8129
|
+
onClearAll && items.length > 0 && /* @__PURE__ */ jsx16("div", { style: { marginTop: "24px", paddingTop: "16px", borderTop: "1px solid var(--chatllm-border, #e5e7eb)" }, children: /* @__PURE__ */ jsx16(
|
|
7596
8130
|
"button",
|
|
7597
8131
|
{
|
|
7598
8132
|
onClick: () => {
|
|
@@ -7608,7 +8142,7 @@ var MemoryTabContent = ({ items, contextSummary, onDelete, onClearAll }) => {
|
|
|
7608
8142
|
};
|
|
7609
8143
|
|
|
7610
8144
|
// src/react/ChatUI.tsx
|
|
7611
|
-
import { jsx as
|
|
8145
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
7612
8146
|
var DEFAULT_ACTIONS = [];
|
|
7613
8147
|
var DEFAULT_TEMPLATES = [];
|
|
7614
8148
|
var DEFAULT_MODELS = [
|
|
@@ -7891,6 +8425,7 @@ var ChatUIView = ({
|
|
|
7891
8425
|
activeAlternatives,
|
|
7892
8426
|
loadingAlternativeFor,
|
|
7893
8427
|
updatePersonalization,
|
|
8428
|
+
savePersonalization,
|
|
7894
8429
|
models: hookModels,
|
|
7895
8430
|
isDeepResearchMode,
|
|
7896
8431
|
toggleDeepResearchMode,
|
|
@@ -7914,7 +8449,7 @@ var ChatUIView = ({
|
|
|
7914
8449
|
const handleChoiceClick = (choice) => {
|
|
7915
8450
|
setInput(choice.text);
|
|
7916
8451
|
};
|
|
7917
|
-
const memoryItems =
|
|
8452
|
+
const memoryItems = React12.useMemo(() => {
|
|
7918
8453
|
if (!globalMemory?.state.entries) return [];
|
|
7919
8454
|
const items = [];
|
|
7920
8455
|
for (const [key, entry] of globalMemory.state.entries) {
|
|
@@ -7929,7 +8464,7 @@ var ChatUIView = ({
|
|
|
7929
8464
|
return items;
|
|
7930
8465
|
}, [globalMemory?.state.entries]);
|
|
7931
8466
|
const themeClass = theme?.mode === "dark" ? "chatllm-dark" : "";
|
|
7932
|
-
return /* @__PURE__ */
|
|
8467
|
+
return /* @__PURE__ */ jsxs16(
|
|
7933
8468
|
"div",
|
|
7934
8469
|
{
|
|
7935
8470
|
className: `chatllm-root ${themeClass} ${className}`,
|
|
@@ -7942,7 +8477,7 @@ var ChatUIView = ({
|
|
|
7942
8477
|
position: "relative"
|
|
7943
8478
|
},
|
|
7944
8479
|
children: [
|
|
7945
|
-
showSidebar && /* @__PURE__ */
|
|
8480
|
+
showSidebar && /* @__PURE__ */ jsx17(
|
|
7946
8481
|
ChatSidebar,
|
|
7947
8482
|
{
|
|
7948
8483
|
sessions,
|
|
@@ -7957,7 +8492,7 @@ var ChatUIView = ({
|
|
|
7957
8492
|
theme: theme?.mode
|
|
7958
8493
|
}
|
|
7959
8494
|
),
|
|
7960
|
-
/* @__PURE__ */
|
|
8495
|
+
/* @__PURE__ */ jsxs16(
|
|
7961
8496
|
"main",
|
|
7962
8497
|
{
|
|
7963
8498
|
style: {
|
|
@@ -7969,7 +8504,7 @@ var ChatUIView = ({
|
|
|
7969
8504
|
minWidth: 0
|
|
7970
8505
|
},
|
|
7971
8506
|
children: [
|
|
7972
|
-
/* @__PURE__ */
|
|
8507
|
+
/* @__PURE__ */ jsx17(
|
|
7973
8508
|
ChatHeader,
|
|
7974
8509
|
{
|
|
7975
8510
|
title: currentSession?.title || "\uC0C8 \uB300\uD654",
|
|
@@ -7983,7 +8518,7 @@ var ChatUIView = ({
|
|
|
7983
8518
|
showSettings
|
|
7984
8519
|
}
|
|
7985
8520
|
),
|
|
7986
|
-
messages.length === 0 ? /* @__PURE__ */
|
|
8521
|
+
messages.length === 0 ? /* @__PURE__ */ jsx17(
|
|
7987
8522
|
EmptyState,
|
|
7988
8523
|
{
|
|
7989
8524
|
greeting,
|
|
@@ -7992,7 +8527,7 @@ var ChatUIView = ({
|
|
|
7992
8527
|
actions,
|
|
7993
8528
|
onActionSelect: handleActionSelect
|
|
7994
8529
|
}
|
|
7995
|
-
) : /* @__PURE__ */
|
|
8530
|
+
) : /* @__PURE__ */ jsx17(
|
|
7996
8531
|
MessageList,
|
|
7997
8532
|
{
|
|
7998
8533
|
messages,
|
|
@@ -8014,7 +8549,7 @@ var ChatUIView = ({
|
|
|
8014
8549
|
onPollSubmit: handlePollSubmit
|
|
8015
8550
|
}
|
|
8016
8551
|
),
|
|
8017
|
-
/* @__PURE__ */
|
|
8552
|
+
/* @__PURE__ */ jsx17(
|
|
8018
8553
|
ChatInput,
|
|
8019
8554
|
{
|
|
8020
8555
|
value: input,
|
|
@@ -8040,7 +8575,7 @@ var ChatUIView = ({
|
|
|
8040
8575
|
]
|
|
8041
8576
|
}
|
|
8042
8577
|
),
|
|
8043
|
-
showSettings && /* @__PURE__ */
|
|
8578
|
+
showSettings && /* @__PURE__ */ jsx17(
|
|
8044
8579
|
SettingsModal,
|
|
8045
8580
|
{
|
|
8046
8581
|
isOpen: settingsOpen,
|
|
@@ -8057,7 +8592,8 @@ var ChatUIView = ({
|
|
|
8057
8592
|
memoryItems,
|
|
8058
8593
|
contextSummary: compressionState?.contextSummary,
|
|
8059
8594
|
onDeleteMemory: globalMemory ? (key) => globalMemory.remove(key) : void 0,
|
|
8060
|
-
onClearMemory: globalMemory ? () => globalMemory.clear() : void 0
|
|
8595
|
+
onClearMemory: globalMemory ? () => globalMemory.clear() : void 0,
|
|
8596
|
+
onSave: savePersonalization
|
|
8061
8597
|
}
|
|
8062
8598
|
)
|
|
8063
8599
|
]
|
|
@@ -8070,6 +8606,7 @@ var ChatUIWithHook = ({
|
|
|
8070
8606
|
templates = DEFAULT_TEMPLATES,
|
|
8071
8607
|
personalization,
|
|
8072
8608
|
onPersonalizationChange,
|
|
8609
|
+
onPersonalizationSave,
|
|
8073
8610
|
apiKey,
|
|
8074
8611
|
onApiKeyChange,
|
|
8075
8612
|
apiEndpoint = "/api/chat",
|
|
@@ -8099,13 +8636,16 @@ var ChatUIWithHook = ({
|
|
|
8099
8636
|
showThinking = true,
|
|
8100
8637
|
thinkingDefaultOpen = false,
|
|
8101
8638
|
deepResearch,
|
|
8102
|
-
skills
|
|
8639
|
+
skills,
|
|
8640
|
+
tools,
|
|
8641
|
+
onToolCall
|
|
8103
8642
|
}) => {
|
|
8104
8643
|
const hookOptions = {
|
|
8105
8644
|
models,
|
|
8106
8645
|
actions,
|
|
8107
8646
|
initialPersonalization: personalization,
|
|
8108
8647
|
onPersonalizationChange,
|
|
8648
|
+
onPersonalizationSave,
|
|
8109
8649
|
initialSessionId,
|
|
8110
8650
|
apiKey,
|
|
8111
8651
|
apiEndpoint,
|
|
@@ -8126,10 +8666,12 @@ var ChatUIWithHook = ({
|
|
|
8126
8666
|
onUpdateSessionTitle,
|
|
8127
8667
|
onSaveMessages,
|
|
8128
8668
|
deepResearch,
|
|
8129
|
-
skills
|
|
8669
|
+
skills,
|
|
8670
|
+
tools,
|
|
8671
|
+
onToolCall
|
|
8130
8672
|
};
|
|
8131
8673
|
const state = useChatUI(hookOptions);
|
|
8132
|
-
return /* @__PURE__ */
|
|
8674
|
+
return /* @__PURE__ */ jsx17(
|
|
8133
8675
|
ChatUIView,
|
|
8134
8676
|
{
|
|
8135
8677
|
state,
|
|
@@ -8169,7 +8711,7 @@ var ChatUI = (props) => {
|
|
|
8169
8711
|
onApiKeyChange,
|
|
8170
8712
|
deepResearch
|
|
8171
8713
|
} = props;
|
|
8172
|
-
return /* @__PURE__ */
|
|
8714
|
+
return /* @__PURE__ */ jsx17(
|
|
8173
8715
|
ChatUIView,
|
|
8174
8716
|
{
|
|
8175
8717
|
state: props.chatState,
|
|
@@ -8190,11 +8732,11 @@ var ChatUI = (props) => {
|
|
|
8190
8732
|
}
|
|
8191
8733
|
);
|
|
8192
8734
|
}
|
|
8193
|
-
return /* @__PURE__ */
|
|
8735
|
+
return /* @__PURE__ */ jsx17(ChatUIWithHook, { ...props });
|
|
8194
8736
|
};
|
|
8195
8737
|
|
|
8196
8738
|
// src/react/hooks/useDeepResearch.ts
|
|
8197
|
-
import { useState as
|
|
8739
|
+
import { useState as useState14, useCallback as useCallback8, useRef as useRef7 } from "react";
|
|
8198
8740
|
var REPORT_GENERATION_PROMPT2 = `\uB2F9\uC2E0\uC740 \uB9AC\uC11C\uCE58 \uBCF4\uACE0\uC11C \uC791\uC131 \uC804\uBB38\uAC00\uC785\uB2C8\uB2E4.
|
|
8199
8741
|
|
|
8200
8742
|
<collected_sources>
|
|
@@ -8245,8 +8787,8 @@ var QUERY_ANALYSIS_PROMPT2 = `\uC0AC\uC6A9\uC790 \uC9C8\uBB38\uC744 \uBD84\uC11D
|
|
|
8245
8787
|
- JSON \uC678 \uB2E4\uB978 \uD14D\uC2A4\uD2B8 \uCD9C\uB825 \uAE08\uC9C0`;
|
|
8246
8788
|
var useDeepResearch = (options) => {
|
|
8247
8789
|
const { onWebSearch, onExtractContent, apiEndpoint, apiKey, model, provider } = options;
|
|
8248
|
-
const [isResearching, setIsResearching] =
|
|
8249
|
-
const [progress, setProgress] =
|
|
8790
|
+
const [isResearching, setIsResearching] = useState14(false);
|
|
8791
|
+
const [progress, setProgress] = useState14(null);
|
|
8250
8792
|
const abortControllerRef = useRef7(null);
|
|
8251
8793
|
const callLLM2 = useCallback8(
|
|
8252
8794
|
async (prompt, stream = false) => {
|
|
@@ -8508,8 +9050,8 @@ var useDeepResearch = (options) => {
|
|
|
8508
9050
|
};
|
|
8509
9051
|
|
|
8510
9052
|
// src/react/components/MemoryPanel.tsx
|
|
8511
|
-
import { useState as
|
|
8512
|
-
import { jsx as
|
|
9053
|
+
import { useState as useState15 } from "react";
|
|
9054
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
8513
9055
|
var categoryLabels = {
|
|
8514
9056
|
fact: "\uC0AC\uC6A9\uC790 \uC815\uBCF4",
|
|
8515
9057
|
skill: "\uC804\uBB38 \uBD84\uC57C/\uAE30\uC220",
|
|
@@ -8528,8 +9070,8 @@ var MemoryPanel = ({
|
|
|
8528
9070
|
isOpen,
|
|
8529
9071
|
onToggle
|
|
8530
9072
|
}) => {
|
|
8531
|
-
const [expandedId, setExpandedId] =
|
|
8532
|
-
const [activeTab, setActiveTab] =
|
|
9073
|
+
const [expandedId, setExpandedId] = useState15(null);
|
|
9074
|
+
const [activeTab, setActiveTab] = useState15("all");
|
|
8533
9075
|
const filteredItems = activeTab === "all" ? items : items.filter((item) => item.category === activeTab);
|
|
8534
9076
|
const formatDate = (timestamp) => {
|
|
8535
9077
|
const date = new Date(timestamp);
|
|
@@ -8541,7 +9083,7 @@ var MemoryPanel = ({
|
|
|
8541
9083
|
});
|
|
8542
9084
|
};
|
|
8543
9085
|
if (!isOpen) {
|
|
8544
|
-
return /* @__PURE__ */
|
|
9086
|
+
return /* @__PURE__ */ jsx18(
|
|
8545
9087
|
"button",
|
|
8546
9088
|
{
|
|
8547
9089
|
onClick: onToggle,
|
|
@@ -8561,11 +9103,11 @@ var MemoryPanel = ({
|
|
|
8561
9103
|
justifyContent: "center",
|
|
8562
9104
|
zIndex: 100
|
|
8563
9105
|
},
|
|
8564
|
-
children: /* @__PURE__ */
|
|
9106
|
+
children: /* @__PURE__ */ jsx18(IconSvg, { name: "robot-line", size: 24, color: "#ffffff" })
|
|
8565
9107
|
}
|
|
8566
9108
|
);
|
|
8567
9109
|
}
|
|
8568
|
-
return /* @__PURE__ */
|
|
9110
|
+
return /* @__PURE__ */ jsxs17(
|
|
8569
9111
|
"div",
|
|
8570
9112
|
{
|
|
8571
9113
|
className: "chatllm-memory-panel",
|
|
@@ -8585,7 +9127,7 @@ var MemoryPanel = ({
|
|
|
8585
9127
|
zIndex: 100
|
|
8586
9128
|
},
|
|
8587
9129
|
children: [
|
|
8588
|
-
/* @__PURE__ */
|
|
9130
|
+
/* @__PURE__ */ jsxs17(
|
|
8589
9131
|
"div",
|
|
8590
9132
|
{
|
|
8591
9133
|
style: {
|
|
@@ -8596,8 +9138,8 @@ var MemoryPanel = ({
|
|
|
8596
9138
|
borderBottom: "1px solid var(--chatllm-border, #e5e7eb)"
|
|
8597
9139
|
},
|
|
8598
9140
|
children: [
|
|
8599
|
-
/* @__PURE__ */
|
|
8600
|
-
/* @__PURE__ */
|
|
9141
|
+
/* @__PURE__ */ jsxs17("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
9142
|
+
/* @__PURE__ */ jsx18(
|
|
8601
9143
|
"div",
|
|
8602
9144
|
{
|
|
8603
9145
|
style: {
|
|
@@ -8609,19 +9151,19 @@ var MemoryPanel = ({
|
|
|
8609
9151
|
alignItems: "center",
|
|
8610
9152
|
justifyContent: "center"
|
|
8611
9153
|
},
|
|
8612
|
-
children: /* @__PURE__ */
|
|
9154
|
+
children: /* @__PURE__ */ jsx18(IconSvg, { name: "robot-line", size: 18, color: "var(--chatllm-primary, #3b82f6)" })
|
|
8613
9155
|
}
|
|
8614
9156
|
),
|
|
8615
|
-
/* @__PURE__ */
|
|
8616
|
-
/* @__PURE__ */
|
|
8617
|
-
/* @__PURE__ */
|
|
9157
|
+
/* @__PURE__ */ jsxs17("div", { children: [
|
|
9158
|
+
/* @__PURE__ */ jsx18("div", { style: { fontSize: "15px", fontWeight: 600, color: "var(--chatllm-text, #1f2937)" }, children: "AI \uBA54\uBAA8\uB9AC" }),
|
|
9159
|
+
/* @__PURE__ */ jsxs17("div", { style: { fontSize: "12px", color: "var(--chatllm-text-muted, #9ca3af)" }, children: [
|
|
8618
9160
|
items.length,
|
|
8619
9161
|
"\uAC1C \uD56D\uBAA9"
|
|
8620
9162
|
] })
|
|
8621
9163
|
] })
|
|
8622
9164
|
] }),
|
|
8623
|
-
/* @__PURE__ */
|
|
8624
|
-
onClearAll && items.length > 0 && /* @__PURE__ */
|
|
9165
|
+
/* @__PURE__ */ jsxs17("div", { style: { display: "flex", gap: "4px" }, children: [
|
|
9166
|
+
onClearAll && items.length > 0 && /* @__PURE__ */ jsx18(
|
|
8625
9167
|
"button",
|
|
8626
9168
|
{
|
|
8627
9169
|
onClick: onClearAll,
|
|
@@ -8633,10 +9175,10 @@ var MemoryPanel = ({
|
|
|
8633
9175
|
cursor: "pointer"
|
|
8634
9176
|
},
|
|
8635
9177
|
title: "\uC804\uCCB4 \uC0AD\uC81C",
|
|
8636
|
-
children: /* @__PURE__ */
|
|
9178
|
+
children: /* @__PURE__ */ jsx18(IconSvg, { name: "delete-bin-line", size: 18, color: "var(--chatllm-text-muted, #9ca3af)" })
|
|
8637
9179
|
}
|
|
8638
9180
|
),
|
|
8639
|
-
/* @__PURE__ */
|
|
9181
|
+
/* @__PURE__ */ jsx18(
|
|
8640
9182
|
"button",
|
|
8641
9183
|
{
|
|
8642
9184
|
onClick: onToggle,
|
|
@@ -8647,14 +9189,14 @@ var MemoryPanel = ({
|
|
|
8647
9189
|
borderRadius: "8px",
|
|
8648
9190
|
cursor: "pointer"
|
|
8649
9191
|
},
|
|
8650
|
-
children: /* @__PURE__ */
|
|
9192
|
+
children: /* @__PURE__ */ jsx18(IconSvg, { name: "close-line", size: 18, color: "var(--chatllm-text-muted, #9ca3af)" })
|
|
8651
9193
|
}
|
|
8652
9194
|
)
|
|
8653
9195
|
] })
|
|
8654
9196
|
]
|
|
8655
9197
|
}
|
|
8656
9198
|
),
|
|
8657
|
-
/* @__PURE__ */
|
|
9199
|
+
/* @__PURE__ */ jsx18(
|
|
8658
9200
|
"div",
|
|
8659
9201
|
{
|
|
8660
9202
|
style: {
|
|
@@ -8664,7 +9206,7 @@ var MemoryPanel = ({
|
|
|
8664
9206
|
borderBottom: "1px solid var(--chatllm-border-light, #f3f4f6)",
|
|
8665
9207
|
overflowX: "auto"
|
|
8666
9208
|
},
|
|
8667
|
-
children: ["all", "fact", "skill", "preference"].map((tab) => /* @__PURE__ */
|
|
9209
|
+
children: ["all", "fact", "skill", "preference"].map((tab) => /* @__PURE__ */ jsx18(
|
|
8668
9210
|
"button",
|
|
8669
9211
|
{
|
|
8670
9212
|
onClick: () => setActiveTab(tab),
|
|
@@ -8685,8 +9227,8 @@ var MemoryPanel = ({
|
|
|
8685
9227
|
))
|
|
8686
9228
|
}
|
|
8687
9229
|
),
|
|
8688
|
-
/* @__PURE__ */
|
|
8689
|
-
contextSummary && activeTab === "all" && /* @__PURE__ */
|
|
9230
|
+
/* @__PURE__ */ jsxs17("div", { style: { flex: 1, overflow: "auto", padding: "12px" }, children: [
|
|
9231
|
+
contextSummary && activeTab === "all" && /* @__PURE__ */ jsxs17(
|
|
8690
9232
|
"div",
|
|
8691
9233
|
{
|
|
8692
9234
|
style: {
|
|
@@ -8697,7 +9239,7 @@ var MemoryPanel = ({
|
|
|
8697
9239
|
borderLeft: "3px solid var(--chatllm-primary, #3b82f6)"
|
|
8698
9240
|
},
|
|
8699
9241
|
children: [
|
|
8700
|
-
/* @__PURE__ */
|
|
9242
|
+
/* @__PURE__ */ jsxs17(
|
|
8701
9243
|
"div",
|
|
8702
9244
|
{
|
|
8703
9245
|
style: {
|
|
@@ -8707,12 +9249,12 @@ var MemoryPanel = ({
|
|
|
8707
9249
|
marginBottom: "8px"
|
|
8708
9250
|
},
|
|
8709
9251
|
children: [
|
|
8710
|
-
/* @__PURE__ */
|
|
8711
|
-
/* @__PURE__ */
|
|
9252
|
+
/* @__PURE__ */ jsx18(IconSvg, { name: "file-text-line", size: 14, color: "var(--chatllm-primary, #3b82f6)" }),
|
|
9253
|
+
/* @__PURE__ */ jsx18("span", { style: { fontSize: "12px", fontWeight: 500, color: "var(--chatllm-primary, #3b82f6)" }, children: "\uB300\uD654 \uC694\uC57D" })
|
|
8712
9254
|
]
|
|
8713
9255
|
}
|
|
8714
9256
|
),
|
|
8715
|
-
/* @__PURE__ */
|
|
9257
|
+
/* @__PURE__ */ jsx18(
|
|
8716
9258
|
"p",
|
|
8717
9259
|
{
|
|
8718
9260
|
style: {
|
|
@@ -8727,7 +9269,7 @@ var MemoryPanel = ({
|
|
|
8727
9269
|
]
|
|
8728
9270
|
}
|
|
8729
9271
|
),
|
|
8730
|
-
filteredItems.length === 0 ? /* @__PURE__ */
|
|
9272
|
+
filteredItems.length === 0 ? /* @__PURE__ */ jsxs17(
|
|
8731
9273
|
"div",
|
|
8732
9274
|
{
|
|
8733
9275
|
style: {
|
|
@@ -8736,11 +9278,11 @@ var MemoryPanel = ({
|
|
|
8736
9278
|
color: "var(--chatllm-text-muted, #9ca3af)"
|
|
8737
9279
|
},
|
|
8738
9280
|
children: [
|
|
8739
|
-
/* @__PURE__ */
|
|
8740
|
-
/* @__PURE__ */
|
|
9281
|
+
/* @__PURE__ */ jsx18(IconSvg, { name: "robot-line", size: 32, color: "var(--chatllm-text-muted, #d1d5db)" }),
|
|
9282
|
+
/* @__PURE__ */ jsx18("p", { style: { fontSize: "14px", marginTop: "12px" }, children: "\uC800\uC7A5\uB41C \uBA54\uBAA8\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4" })
|
|
8741
9283
|
]
|
|
8742
9284
|
}
|
|
8743
|
-
) : /* @__PURE__ */
|
|
9285
|
+
) : /* @__PURE__ */ jsx18("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: filteredItems.map((item) => /* @__PURE__ */ jsxs17(
|
|
8744
9286
|
"div",
|
|
8745
9287
|
{
|
|
8746
9288
|
style: {
|
|
@@ -8753,10 +9295,10 @@ var MemoryPanel = ({
|
|
|
8753
9295
|
},
|
|
8754
9296
|
onClick: () => setExpandedId(expandedId === item.id ? null : item.id),
|
|
8755
9297
|
children: [
|
|
8756
|
-
/* @__PURE__ */
|
|
8757
|
-
/* @__PURE__ */
|
|
8758
|
-
/* @__PURE__ */
|
|
8759
|
-
item.category && /* @__PURE__ */
|
|
9298
|
+
/* @__PURE__ */ jsxs17("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" }, children: [
|
|
9299
|
+
/* @__PURE__ */ jsxs17("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
9300
|
+
/* @__PURE__ */ jsxs17("div", { style: { display: "flex", alignItems: "center", gap: "8px", marginBottom: "4px" }, children: [
|
|
9301
|
+
item.category && /* @__PURE__ */ jsx18(
|
|
8760
9302
|
"span",
|
|
8761
9303
|
{
|
|
8762
9304
|
style: {
|
|
@@ -8770,9 +9312,9 @@ var MemoryPanel = ({
|
|
|
8770
9312
|
children: categoryLabels[item.category]
|
|
8771
9313
|
}
|
|
8772
9314
|
),
|
|
8773
|
-
/* @__PURE__ */
|
|
9315
|
+
/* @__PURE__ */ jsx18("span", { style: { fontSize: "11px", color: "var(--chatllm-text-muted, #9ca3af)" }, children: formatDate(item.timestamp) })
|
|
8774
9316
|
] }),
|
|
8775
|
-
/* @__PURE__ */
|
|
9317
|
+
/* @__PURE__ */ jsx18(
|
|
8776
9318
|
"div",
|
|
8777
9319
|
{
|
|
8778
9320
|
style: {
|
|
@@ -8784,8 +9326,8 @@ var MemoryPanel = ({
|
|
|
8784
9326
|
}
|
|
8785
9327
|
)
|
|
8786
9328
|
] }),
|
|
8787
|
-
/* @__PURE__ */
|
|
8788
|
-
onDelete && /* @__PURE__ */
|
|
9329
|
+
/* @__PURE__ */ jsxs17("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
9330
|
+
onDelete && /* @__PURE__ */ jsx18(
|
|
8789
9331
|
"button",
|
|
8790
9332
|
{
|
|
8791
9333
|
onClick: (e) => {
|
|
@@ -8800,10 +9342,10 @@ var MemoryPanel = ({
|
|
|
8800
9342
|
cursor: "pointer",
|
|
8801
9343
|
opacity: 0.5
|
|
8802
9344
|
},
|
|
8803
|
-
children: /* @__PURE__ */
|
|
9345
|
+
children: /* @__PURE__ */ jsx18(IconSvg, { name: "delete-bin-line", size: 14, color: "var(--chatllm-text-muted, #9ca3af)" })
|
|
8804
9346
|
}
|
|
8805
9347
|
),
|
|
8806
|
-
/* @__PURE__ */
|
|
9348
|
+
/* @__PURE__ */ jsx18(
|
|
8807
9349
|
IconSvg,
|
|
8808
9350
|
{
|
|
8809
9351
|
name: expandedId === item.id ? "arrow-up-s-line" : "arrow-down-s-line",
|
|
@@ -8813,7 +9355,7 @@ var MemoryPanel = ({
|
|
|
8813
9355
|
)
|
|
8814
9356
|
] })
|
|
8815
9357
|
] }),
|
|
8816
|
-
expandedId === item.id && /* @__PURE__ */
|
|
9358
|
+
expandedId === item.id && /* @__PURE__ */ jsx18(
|
|
8817
9359
|
"div",
|
|
8818
9360
|
{
|
|
8819
9361
|
style: {
|
|
@@ -8821,7 +9363,7 @@ var MemoryPanel = ({
|
|
|
8821
9363
|
paddingTop: "12px",
|
|
8822
9364
|
borderTop: "1px solid var(--chatllm-border-light, #f3f4f6)"
|
|
8823
9365
|
},
|
|
8824
|
-
children: /* @__PURE__ */
|
|
9366
|
+
children: /* @__PURE__ */ jsx18(
|
|
8825
9367
|
"p",
|
|
8826
9368
|
{
|
|
8827
9369
|
style: {
|
|
@@ -8850,10 +9392,13 @@ export {
|
|
|
8850
9392
|
ChatInput,
|
|
8851
9393
|
ChatSidebar,
|
|
8852
9394
|
ChatUI,
|
|
9395
|
+
ContentPartRenderer,
|
|
8853
9396
|
DeepResearchProgressUI,
|
|
8854
9397
|
EmptyState,
|
|
9398
|
+
FileContentCard,
|
|
8855
9399
|
Icon,
|
|
8856
9400
|
IconSvg,
|
|
9401
|
+
ImageContentCard,
|
|
8857
9402
|
LinkChip,
|
|
8858
9403
|
MarkdownRenderer,
|
|
8859
9404
|
MemoryPanel,
|
|
@@ -8862,6 +9407,7 @@ export {
|
|
|
8862
9407
|
PollCard,
|
|
8863
9408
|
SettingsModal,
|
|
8864
9409
|
SkillProgressUI,
|
|
9410
|
+
convertToolsToSkills,
|
|
8865
9411
|
createAdvancedResearchSkill,
|
|
8866
9412
|
createDeepResearchSkill,
|
|
8867
9413
|
useChatUI,
|