opencode-manifold 0.5.31 → 0.5.32

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 +8 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -283,14 +283,16 @@ async function pollForResponse(client, sessionID, maxAttempts, intervalMs) {
283
283
  const msg = messages[i];
284
284
  const info = msg.info;
285
285
  if (info?.role === "assistant") {
286
- return extractText(msg.parts);
286
+ return extractText(msg.parts || []);
287
287
  }
288
288
  }
289
289
  }
290
290
  throw new Error(`Timed out waiting for agent response after ${maxAttempts} attempts`);
291
291
  }
292
292
  function extractText(parts) {
293
- return parts.filter((p) => p.type === "text").map((p) => p.text).join("");
293
+ if (!parts || !Array.isArray(parts))
294
+ return "";
295
+ return parts.filter((p) => p && p.type === "text").map((p) => p.text === undefined || p.text === null ? "" : String(p.text)).join("");
294
296
  }
295
297
  function sleep(ms) {
296
298
  return new Promise((resolve) => setTimeout(resolve, ms));
@@ -497,6 +499,8 @@ async function markTodoDone(planPath, taskNumber) {
497
499
  }
498
500
  }
499
501
  function extractSummary(implementation) {
502
+ if (!implementation || typeof implementation !== "string")
503
+ return "No implementation provided";
500
504
  const lines = implementation.split(`
501
505
  `).filter((l) => l.trim());
502
506
  const marker = lines.find((l) => /^(?:Summary|IMPLEMENTATION SUMMARY|What was done):/i.test(l));
@@ -506,6 +510,8 @@ function extractSummary(implementation) {
506
510
  return lines[0]?.substring(0, 200) || "No summary";
507
511
  }
508
512
  function extractFiles(implementation) {
513
+ if (!implementation || typeof implementation !== "string")
514
+ return [];
509
515
  const files = [];
510
516
  const mdMatches = implementation.matchAll(/\[`([^`]+)`\]/g);
511
517
  for (const m of mdMatches)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-manifold",
3
- "version": "0.5.31",
3
+ "version": "0.5.32",
4
4
  "description": "Multi-agent development system for opencode with persistent knowledge",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",