@standardagents/builder 0.37.3 → 0.37.4

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/index.js CHANGED
@@ -10112,10 +10112,18 @@ ${msg.content}` : `${imageDescriptions}${nonImageList}`;
10112
10112
  const mimeType = match[1];
10113
10113
  const base64Data = match[2];
10114
10114
  const ext = mimeType.split("/")[1] || "png";
10115
+ if (base64Data.length < 64) {
10116
+ console.error("[FlowEngine] Generated image payload is empty/truncated, skipping");
10117
+ continue;
10118
+ }
10115
10119
  const attachmentId = crypto.randomUUID();
10116
10120
  const path21 = `/attachments/${Date.now()}-${attachmentId.slice(0, 8)}.${ext}`;
10117
10121
  try {
10118
- await state.thread.instance.writeFile(path21, base64Data, mimeType);
10122
+ const written = await state.thread.instance.writeFile(path21, base64Data, mimeType);
10123
+ if (written && written.success === false) {
10124
+ console.error("[FlowEngine] Generated image write failed:", written.error);
10125
+ continue;
10126
+ }
10119
10127
  if (image.id) {
10120
10128
  imagePathMap.set(image.id, path21);
10121
10129
  }
@@ -10182,10 +10190,18 @@ ${msg.content}` : `${imageDescriptions}${nonImageList}`;
10182
10190
  const mimeType = imageUrl.slice(dataPrefix.length, base64Index);
10183
10191
  const base64Data = imageUrl.slice(base64Index + base64Marker.length);
10184
10192
  const ext = mimeType.split("/")[1] || "png";
10193
+ if (base64Data.length < 64) {
10194
+ console.error(`[FlowEngine] ${toolName} image payload is empty/truncated, skipping`);
10195
+ continue;
10196
+ }
10185
10197
  const attachmentId = crypto.randomUUID();
10186
10198
  const path21 = `/attachments/${Date.now()}-${attachmentId.slice(0, 8)}.${ext}`;
10187
10199
  try {
10188
- await state.thread.instance.writeFile(path21, base64Data, mimeType);
10200
+ const written = await state.thread.instance.writeFile(path21, base64Data, mimeType);
10201
+ if (written && written.success === false) {
10202
+ console.error(`[FlowEngine] ${toolName} image write failed:`, written.error);
10203
+ continue;
10204
+ }
10189
10205
  const attachmentRef = {
10190
10206
  id: attachmentId,
10191
10207
  type: "file",