@friendlyrobot/discord-pi-agent 0.19.10 → 0.19.11

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -375,15 +375,17 @@ function truncateForLog(value, maxLength = 400) {
375
375
  return `${value.slice(0, maxLength)}...`;
376
376
  }
377
377
  function extractToolOutput(output) {
378
- if (Array.isArray(output)) {
379
- return output.map((item) => {
380
- if (item?.type === "text") {
381
- return item.text;
382
- } else {
378
+ if (typeof output === "object" && output !== null) {
379
+ const obj = output;
380
+ if (Array.isArray(obj.content)) {
381
+ return obj.content.map((item) => {
382
+ if (item.type === "text" && typeof item.text === "string") {
383
+ return item.text;
384
+ }
383
385
  return JSON.stringify(item);
384
- }
385
- }).join(`
386
+ }).join(`
386
387
  `);
388
+ }
387
389
  }
388
390
  return String(output);
389
391
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@friendlyrobot/discord-pi-agent",
3
- "version": "0.19.10",
3
+ "version": "0.19.11",
4
4
  "description": "Reusable Discord gateway for persistent pi agent sessions",
5
5
  "license": "MIT",
6
6
  "type": "module",