@khalilgharbaoui/opencode-claude-code-plugin 0.4.6 → 0.4.8

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
@@ -382,6 +382,19 @@ Now continuing with the current message:
382
382
  }
383
383
  }
384
384
  }
385
+ } else if (msg.role === "tool") {
386
+ if (Array.isArray(msg.content)) {
387
+ for (const part of msg.content) {
388
+ if (part?.type === "tool-result") {
389
+ const p = part;
390
+ content.push({
391
+ type: "tool_result",
392
+ tool_use_id: p.toolCallId,
393
+ content: getToolResultText(p)
394
+ });
395
+ }
396
+ }
397
+ }
385
398
  }
386
399
  }
387
400
  if (content.length === 0) {
@@ -1502,6 +1515,15 @@ function hasNewUserContent(prompt) {
1502
1515
  for (let i = prompt.length - 1; i >= 0; i--) {
1503
1516
  const msg = prompt[i];
1504
1517
  if (msg.role === "assistant") return false;
1518
+ if (msg.role === "tool") {
1519
+ const content2 = msg.content;
1520
+ if (Array.isArray(content2)) {
1521
+ for (const part of content2) {
1522
+ if (part?.type === "tool-result") return true;
1523
+ }
1524
+ }
1525
+ continue;
1526
+ }
1505
1527
  if (msg.role !== "user") continue;
1506
1528
  const content = msg.content;
1507
1529
  if (typeof content === "string") {