@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.
@@ -260,6 +260,8 @@ interface ChecklistItem {
260
260
  status: 'pending' | 'in_progress' | 'done' | 'error';
261
261
  /** 각 단계의 AI 실행 결과 (접이식 표시용) */
262
262
  result?: string;
263
+ /** @Todo vibecode - 이미지 스킬 결과 URL (체크리스트 단계에서 이미지 생성 시) */
264
+ imageUrl?: string;
263
265
  }
264
266
  /**
265
267
  * @description 체크리스트 블록 (메시지에 첨부)
@@ -260,6 +260,8 @@ interface ChecklistItem {
260
260
  status: 'pending' | 'in_progress' | 'done' | 'error';
261
261
  /** 각 단계의 AI 실행 결과 (접이식 표시용) */
262
262
  result?: string;
263
+ /** @Todo vibecode - 이미지 스킬 결과 URL (체크리스트 단계에서 이미지 생성 시) */
264
+ imageUrl?: string;
263
265
  }
264
266
  /**
265
267
  * @description 체크리스트 블록 (메시지에 첨부)
@@ -1720,6 +1720,12 @@ var fileToBase64 = (file) => new Promise((resolve, reject) => {
1720
1720
  reader.onerror = reject;
1721
1721
  reader.readAsDataURL(file);
1722
1722
  });
1723
+ var fileToDataUri = (file) => new Promise((resolve, reject) => {
1724
+ const reader = new FileReader();
1725
+ reader.onload = () => resolve(reader.result);
1726
+ reader.onerror = reject;
1727
+ reader.readAsDataURL(file);
1728
+ });
1723
1729
  var convertAttachmentsToBase64 = async (attachments) => Promise.all(
1724
1730
  attachments.map(async (att) => ({
1725
1731
  name: att.name,
@@ -2551,8 +2557,9 @@ ${finalContent}`;
2551
2557
  userContentParts.push({ type: "text", content: finalContent });
2552
2558
  }
2553
2559
  for (const att of currentAttachments) {
2554
- if (att.type === "image" && att.previewUrl) {
2555
- userContentParts.push({ type: "image", url: att.previewUrl, alt: att.name });
2560
+ if (att.type === "image" && att.file) {
2561
+ const dataUri = await fileToDataUri(att.file);
2562
+ userContentParts.push({ type: "image", url: dataUri, alt: att.name });
2556
2563
  } else {
2557
2564
  userContentParts.push({ type: "file", name: att.name, url: att.previewUrl || "", mimeType: att.mimeType, size: att.size });
2558
2565
  }
@@ -2738,6 +2745,7 @@ ${finalContent}`;
2738
2745
  const shouldSkipSkillParsing = skipNextSkillParsingRef.current;
2739
2746
  skipNextSkillParsingRef.current = false;
2740
2747
  let accumulatedContent = "";
2748
+ let checklistStepImageUrl = null;
2741
2749
  let messagesToSend = [...existingMessages, userMessage];
2742
2750
  const recompressionThreshold = DEFAULT_RECOMPRESSION_THRESHOLD;
2743
2751
  const tokenLimit = DEFAULT_TOKEN_LIMIT;
@@ -3048,7 +3056,12 @@ ${attachmentContext}
3048
3056
  }, attachExtra);
3049
3057
  pendingAttachmentDataRef.current = null;
3050
3058
  if (skillResult?.content) {
3051
- accumulatedContent = skillResult.content;
3059
+ if (skillResult.metadata?.type === "image") {
3060
+ accumulatedContent = skillResult.metadata?.outputText || "\uC774\uBBF8\uC9C0 \uC0DD\uC131 \uC644\uB8CC";
3061
+ checklistStepImageUrl = skillResult.content;
3062
+ } else {
3063
+ accumulatedContent = skillResult.content;
3064
+ }
3052
3065
  }
3053
3066
  } catch (e) {
3054
3067
  console.warn("[useChatUI] \uCCB4\uD06C\uB9AC\uC2A4\uD2B8 \uB0B4 \uC2A4\uD0AC \uC2E4\uD589 \uC2E4\uD328:", e);
@@ -3323,7 +3336,9 @@ ${result.content}
3323
3336
  const updatedItems = m.checklistBlock.items.map((it, idx) => ({
3324
3337
  ...it,
3325
3338
  status: idx <= stepIndex ? "done" : it.status,
3326
- result: idx === stepIndex ? accumulatedContent : it.result
3339
+ result: idx === stepIndex ? accumulatedContent : it.result,
3340
+ /** @Todo vibecode - 이미지 스킬 결과 URL 저장 */
3341
+ ...idx === stepIndex && checklistStepImageUrl ? { imageUrl: checklistStepImageUrl } : {}
3327
3342
  }));
3328
3343
  return {
3329
3344
  ...m,
@@ -9125,7 +9140,7 @@ var ChecklistCard = ({
9125
9140
  ]
9126
9141
  }
9127
9142
  ),
9128
- canExpand && isExpanded && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9143
+ canExpand && isExpanded && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
9129
9144
  "div",
9130
9145
  {
9131
9146
  style: {
@@ -9141,7 +9156,21 @@ var ChecklistCard = ({
9141
9156
  whiteSpace: "pre-wrap",
9142
9157
  wordBreak: "break-word"
9143
9158
  },
9144
- children: item.result
9159
+ children: [
9160
+ item.imageUrl && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9161
+ "img",
9162
+ {
9163
+ src: item.imageUrl,
9164
+ alt: item.result || "\uC0DD\uC131\uB41C \uC774\uBBF8\uC9C0",
9165
+ style: {
9166
+ maxWidth: "100%",
9167
+ borderRadius: "8px",
9168
+ marginBottom: item.result ? "8px" : 0
9169
+ }
9170
+ }
9171
+ ),
9172
+ item.result
9173
+ ]
9145
9174
  }
9146
9175
  )
9147
9176
  ] }, item.id);