@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/built-in-routes.js +19 -3
- package/dist/built-in-routes.js.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/runtime.js +18 -2
- package/dist/runtime.js.map +1 -1
- package/package.json +5 -5
package/dist/runtime.js
CHANGED
|
@@ -10103,10 +10103,18 @@ ${msg.content}` : `${imageDescriptions}${nonImageList}`;
|
|
|
10103
10103
|
const mimeType = match[1];
|
|
10104
10104
|
const base64Data = match[2];
|
|
10105
10105
|
const ext = mimeType.split("/")[1] || "png";
|
|
10106
|
+
if (base64Data.length < 64) {
|
|
10107
|
+
console.error("[FlowEngine] Generated image payload is empty/truncated, skipping");
|
|
10108
|
+
continue;
|
|
10109
|
+
}
|
|
10106
10110
|
const attachmentId = crypto.randomUUID();
|
|
10107
10111
|
const path = `/attachments/${Date.now()}-${attachmentId.slice(0, 8)}.${ext}`;
|
|
10108
10112
|
try {
|
|
10109
|
-
await state.thread.instance.writeFile(path, base64Data, mimeType);
|
|
10113
|
+
const written = await state.thread.instance.writeFile(path, base64Data, mimeType);
|
|
10114
|
+
if (written && written.success === false) {
|
|
10115
|
+
console.error("[FlowEngine] Generated image write failed:", written.error);
|
|
10116
|
+
continue;
|
|
10117
|
+
}
|
|
10110
10118
|
if (image.id) {
|
|
10111
10119
|
imagePathMap.set(image.id, path);
|
|
10112
10120
|
}
|
|
@@ -10173,10 +10181,18 @@ ${msg.content}` : `${imageDescriptions}${nonImageList}`;
|
|
|
10173
10181
|
const mimeType = imageUrl.slice(dataPrefix.length, base64Index);
|
|
10174
10182
|
const base64Data = imageUrl.slice(base64Index + base64Marker.length);
|
|
10175
10183
|
const ext = mimeType.split("/")[1] || "png";
|
|
10184
|
+
if (base64Data.length < 64) {
|
|
10185
|
+
console.error(`[FlowEngine] ${toolName} image payload is empty/truncated, skipping`);
|
|
10186
|
+
continue;
|
|
10187
|
+
}
|
|
10176
10188
|
const attachmentId = crypto.randomUUID();
|
|
10177
10189
|
const path = `/attachments/${Date.now()}-${attachmentId.slice(0, 8)}.${ext}`;
|
|
10178
10190
|
try {
|
|
10179
|
-
await state.thread.instance.writeFile(path, base64Data, mimeType);
|
|
10191
|
+
const written = await state.thread.instance.writeFile(path, base64Data, mimeType);
|
|
10192
|
+
if (written && written.success === false) {
|
|
10193
|
+
console.error(`[FlowEngine] ${toolName} image write failed:`, written.error);
|
|
10194
|
+
continue;
|
|
10195
|
+
}
|
|
10180
10196
|
const attachmentRef = {
|
|
10181
10197
|
id: attachmentId,
|
|
10182
10198
|
type: "file",
|