@anthonyhaussman/opencode-agy-auth 1.1.14-alpha.1 → 1.1.14-alpha.2

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
@@ -18539,20 +18539,26 @@ function injectMissingToolCallIds(contents) {
18539
18539
  }
18540
18540
  }
18541
18541
  function applyLatestSignature(contents, latestSig) {
18542
- const allFunctionCalls = [];
18542
+ const allFunctionParts = [];
18543
18543
  for (const content of contents) {
18544
18544
  if (content && typeof content === "object" && Array.isArray(content.parts)) {
18545
18545
  for (const part of content.parts) {
18546
18546
  if (part && typeof part === "object" && part.functionCall) {
18547
- allFunctionCalls.push(part.functionCall);
18547
+ if (part.functionCall.thoughtSignature) {
18548
+ if (!part.thoughtSignature || part.thoughtSignature === "skip_thought_signature_validator") {
18549
+ part.thoughtSignature = part.functionCall.thoughtSignature;
18550
+ }
18551
+ delete part.functionCall.thoughtSignature;
18552
+ }
18553
+ allFunctionParts.push(part);
18548
18554
  }
18549
18555
  }
18550
18556
  }
18551
18557
  }
18552
- if (allFunctionCalls.length > 0 && latestSig) {
18553
- const lastFunctionCall = allFunctionCalls[allFunctionCalls.length - 1];
18554
- if (!lastFunctionCall.thoughtSignature || lastFunctionCall.thoughtSignature === "skip_thought_signature_validator") {
18555
- lastFunctionCall.thoughtSignature = latestSig;
18558
+ if (allFunctionParts.length > 0 && latestSig) {
18559
+ const lastPart = allFunctionParts[allFunctionParts.length - 1];
18560
+ if (!lastPart.thoughtSignature || lastPart.thoughtSignature === "skip_thought_signature_validator") {
18561
+ lastPart.thoughtSignature = latestSig;
18556
18562
  }
18557
18563
  }
18558
18564
  }