@friendlyrobot/discord-pi-agent 0.19.9 → 0.19.10
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 +9 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -375,23 +375,17 @@ function truncateForLog(value, maxLength = 400) {
|
|
|
375
375
|
return `${value.slice(0, maxLength)}...`;
|
|
376
376
|
}
|
|
377
377
|
function extractToolOutput(output) {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
return JSON.stringify(item);
|
|
387
|
-
}
|
|
388
|
-
}).join(`
|
|
378
|
+
if (Array.isArray(output)) {
|
|
379
|
+
return output.map((item) => {
|
|
380
|
+
if (item?.type === "text") {
|
|
381
|
+
return item.text;
|
|
382
|
+
} else {
|
|
383
|
+
return JSON.stringify(item);
|
|
384
|
+
}
|
|
385
|
+
}).join(`
|
|
389
386
|
`);
|
|
390
|
-
}
|
|
391
|
-
return String(output);
|
|
392
|
-
} catch {
|
|
393
|
-
return String(output);
|
|
394
387
|
}
|
|
388
|
+
return String(output);
|
|
395
389
|
}
|
|
396
390
|
function getLatestAssistantText(messages) {
|
|
397
391
|
const latestAssistantMessage = [...messages].reverse().find((message) => {
|