@gendive/chatllm 0.17.40 → 0.17.42
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 +2 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +35 -6
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +35 -6
- package/dist/react/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react/index.mjs
CHANGED
|
@@ -1651,6 +1651,12 @@ var fileToBase64 = (file) => new Promise((resolve, reject) => {
|
|
|
1651
1651
|
reader.onerror = reject;
|
|
1652
1652
|
reader.readAsDataURL(file);
|
|
1653
1653
|
});
|
|
1654
|
+
var fileToDataUri = (file) => new Promise((resolve, reject) => {
|
|
1655
|
+
const reader = new FileReader();
|
|
1656
|
+
reader.onload = () => resolve(reader.result);
|
|
1657
|
+
reader.onerror = reject;
|
|
1658
|
+
reader.readAsDataURL(file);
|
|
1659
|
+
});
|
|
1654
1660
|
var convertAttachmentsToBase64 = async (attachments) => Promise.all(
|
|
1655
1661
|
attachments.map(async (att) => ({
|
|
1656
1662
|
name: att.name,
|
|
@@ -2482,8 +2488,9 @@ ${finalContent}`;
|
|
|
2482
2488
|
userContentParts.push({ type: "text", content: finalContent });
|
|
2483
2489
|
}
|
|
2484
2490
|
for (const att of currentAttachments) {
|
|
2485
|
-
if (att.type === "image" && att.
|
|
2486
|
-
|
|
2491
|
+
if (att.type === "image" && att.file) {
|
|
2492
|
+
const dataUri = await fileToDataUri(att.file);
|
|
2493
|
+
userContentParts.push({ type: "image", url: dataUri, alt: att.name });
|
|
2487
2494
|
} else {
|
|
2488
2495
|
userContentParts.push({ type: "file", name: att.name, url: att.previewUrl || "", mimeType: att.mimeType, size: att.size });
|
|
2489
2496
|
}
|
|
@@ -2669,6 +2676,7 @@ ${finalContent}`;
|
|
|
2669
2676
|
const shouldSkipSkillParsing = skipNextSkillParsingRef.current;
|
|
2670
2677
|
skipNextSkillParsingRef.current = false;
|
|
2671
2678
|
let accumulatedContent = "";
|
|
2679
|
+
let checklistStepImageUrl = null;
|
|
2672
2680
|
let messagesToSend = [...existingMessages, userMessage];
|
|
2673
2681
|
const recompressionThreshold = DEFAULT_RECOMPRESSION_THRESHOLD;
|
|
2674
2682
|
const tokenLimit = DEFAULT_TOKEN_LIMIT;
|
|
@@ -2979,7 +2987,12 @@ ${attachmentContext}
|
|
|
2979
2987
|
}, attachExtra);
|
|
2980
2988
|
pendingAttachmentDataRef.current = null;
|
|
2981
2989
|
if (skillResult?.content) {
|
|
2982
|
-
|
|
2990
|
+
if (skillResult.metadata?.type === "image") {
|
|
2991
|
+
accumulatedContent = skillResult.metadata?.outputText || "\uC774\uBBF8\uC9C0 \uC0DD\uC131 \uC644\uB8CC";
|
|
2992
|
+
checklistStepImageUrl = skillResult.content;
|
|
2993
|
+
} else {
|
|
2994
|
+
accumulatedContent = skillResult.content;
|
|
2995
|
+
}
|
|
2983
2996
|
}
|
|
2984
2997
|
} catch (e) {
|
|
2985
2998
|
console.warn("[useChatUI] \uCCB4\uD06C\uB9AC\uC2A4\uD2B8 \uB0B4 \uC2A4\uD0AC \uC2E4\uD589 \uC2E4\uD328:", e);
|
|
@@ -3254,7 +3267,9 @@ ${result.content}
|
|
|
3254
3267
|
const updatedItems = m.checklistBlock.items.map((it, idx) => ({
|
|
3255
3268
|
...it,
|
|
3256
3269
|
status: idx <= stepIndex ? "done" : it.status,
|
|
3257
|
-
result: idx === stepIndex ? accumulatedContent : it.result
|
|
3270
|
+
result: idx === stepIndex ? accumulatedContent : it.result,
|
|
3271
|
+
/** @Todo vibecode - 이미지 스킬 결과 URL 저장 */
|
|
3272
|
+
...idx === stepIndex && checklistStepImageUrl ? { imageUrl: checklistStepImageUrl } : {}
|
|
3258
3273
|
}));
|
|
3259
3274
|
return {
|
|
3260
3275
|
...m,
|
|
@@ -9056,7 +9071,7 @@ var ChecklistCard = ({
|
|
|
9056
9071
|
]
|
|
9057
9072
|
}
|
|
9058
9073
|
),
|
|
9059
|
-
canExpand && isExpanded && /* @__PURE__ */
|
|
9074
|
+
canExpand && isExpanded && /* @__PURE__ */ jsxs14(
|
|
9060
9075
|
"div",
|
|
9061
9076
|
{
|
|
9062
9077
|
style: {
|
|
@@ -9072,7 +9087,21 @@ var ChecklistCard = ({
|
|
|
9072
9087
|
whiteSpace: "pre-wrap",
|
|
9073
9088
|
wordBreak: "break-word"
|
|
9074
9089
|
},
|
|
9075
|
-
children:
|
|
9090
|
+
children: [
|
|
9091
|
+
item.imageUrl && /* @__PURE__ */ jsx15(
|
|
9092
|
+
"img",
|
|
9093
|
+
{
|
|
9094
|
+
src: item.imageUrl,
|
|
9095
|
+
alt: item.result || "\uC0DD\uC131\uB41C \uC774\uBBF8\uC9C0",
|
|
9096
|
+
style: {
|
|
9097
|
+
maxWidth: "100%",
|
|
9098
|
+
borderRadius: "8px",
|
|
9099
|
+
marginBottom: item.result ? "8px" : 0
|
|
9100
|
+
}
|
|
9101
|
+
}
|
|
9102
|
+
),
|
|
9103
|
+
item.result
|
|
9104
|
+
]
|
|
9076
9105
|
}
|
|
9077
9106
|
)
|
|
9078
9107
|
] }, item.id);
|