@anthonyhaussman/opencode-agy-auth 1.0.9 → 1.0.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 +29 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -170,7 +170,7 @@ function createAgyActivityRequestId() {
|
|
|
170
170
|
import os from "os";
|
|
171
171
|
|
|
172
172
|
// src/sdk/agy-cli-version.ts
|
|
173
|
-
var AGY_CLI_VERSION = "1.0.
|
|
173
|
+
var AGY_CLI_VERSION = "1.0.10";
|
|
174
174
|
|
|
175
175
|
// src/sdk/user-agent.ts
|
|
176
176
|
var cachedUserAgent = null;
|
|
@@ -15389,6 +15389,9 @@ function deduplicateThinkingText(response, sentBuffer, displayedThinkingHashes)
|
|
|
15389
15389
|
return block;
|
|
15390
15390
|
});
|
|
15391
15391
|
const filteredContent = newContent.filter((b) => b !== null);
|
|
15392
|
+
if (filteredContent.length === 0) {
|
|
15393
|
+
return { ...resp, content: [] };
|
|
15394
|
+
}
|
|
15392
15395
|
return { ...resp, content: filteredContent };
|
|
15393
15396
|
}
|
|
15394
15397
|
return response;
|
|
@@ -15531,6 +15534,11 @@ function createStreamingTransformer(signatureStore, callbacks, options = {}) {
|
|
|
15531
15534
|
if (!hasSeenUsageMetadata) {
|
|
15532
15535
|
const syntheticUsage = {
|
|
15533
15536
|
response: {
|
|
15537
|
+
candidates: [
|
|
15538
|
+
{
|
|
15539
|
+
finishReason: "STOP"
|
|
15540
|
+
}
|
|
15541
|
+
],
|
|
15534
15542
|
usageMetadata: {
|
|
15535
15543
|
promptTokenCount: 0,
|
|
15536
15544
|
candidatesTokenCount: 0,
|
|
@@ -15651,22 +15659,7 @@ function transformRequestBody(body, projectId, effectiveModel, requestedModel, t
|
|
|
15651
15659
|
contents2 = normalizeContentsSequence(contents2);
|
|
15652
15660
|
injectMissingToolCallIds(contents2);
|
|
15653
15661
|
const latestSig = getLatestSignature(sessionId2);
|
|
15654
|
-
|
|
15655
|
-
for (const content of contents2) {
|
|
15656
|
-
if (content && typeof content === "object" && Array.isArray(content.parts)) {
|
|
15657
|
-
for (const part of content.parts) {
|
|
15658
|
-
if (part && typeof part === "object" && part.functionCall) {
|
|
15659
|
-
allFunctionCalls.push(part);
|
|
15660
|
-
}
|
|
15661
|
-
}
|
|
15662
|
-
}
|
|
15663
|
-
}
|
|
15664
|
-
if (allFunctionCalls.length > 0 && latestSig) {
|
|
15665
|
-
const lastFunctionCall = allFunctionCalls[allFunctionCalls.length - 1];
|
|
15666
|
-
if (!lastFunctionCall.thoughtSignature || lastFunctionCall.thoughtSignature === "skip_thought_signature_validator") {
|
|
15667
|
-
lastFunctionCall.thoughtSignature = latestSig;
|
|
15668
|
-
}
|
|
15669
|
-
}
|
|
15662
|
+
applyLatestSignature(contents2, latestSig);
|
|
15670
15663
|
requestPayloadInside.contents = contents2;
|
|
15671
15664
|
}
|
|
15672
15665
|
return { body: JSON.stringify(wrappedBody2), userPromptId: userPromptId2, sessionId: sessionId2 };
|
|
@@ -15694,22 +15687,7 @@ function transformRequestBody(body, projectId, effectiveModel, requestedModel, t
|
|
|
15694
15687
|
contents = normalizeContentsSequence(contents);
|
|
15695
15688
|
injectMissingToolCallIds(contents);
|
|
15696
15689
|
const latestSig = getLatestSignature(sessionId);
|
|
15697
|
-
|
|
15698
|
-
for (const content of contents) {
|
|
15699
|
-
if (content && typeof content === "object" && Array.isArray(content.parts)) {
|
|
15700
|
-
for (const part of content.parts) {
|
|
15701
|
-
if (part && typeof part === "object" && part.functionCall) {
|
|
15702
|
-
allFunctionCalls.push(part);
|
|
15703
|
-
}
|
|
15704
|
-
}
|
|
15705
|
-
}
|
|
15706
|
-
}
|
|
15707
|
-
if (allFunctionCalls.length > 0 && latestSig) {
|
|
15708
|
-
const lastFunctionCall = allFunctionCalls[allFunctionCalls.length - 1];
|
|
15709
|
-
if (!lastFunctionCall.thoughtSignature || lastFunctionCall.thoughtSignature === "skip_thought_signature_validator") {
|
|
15710
|
-
lastFunctionCall.thoughtSignature = latestSig;
|
|
15711
|
-
}
|
|
15712
|
-
}
|
|
15690
|
+
applyLatestSignature(contents, latestSig);
|
|
15713
15691
|
requestPayload.contents = contents;
|
|
15714
15692
|
}
|
|
15715
15693
|
if ("model" in requestPayload) {
|
|
@@ -15949,6 +15927,24 @@ function injectMissingToolCallIds(contents) {
|
|
|
15949
15927
|
}
|
|
15950
15928
|
}
|
|
15951
15929
|
}
|
|
15930
|
+
function applyLatestSignature(contents, latestSig) {
|
|
15931
|
+
const allFunctionCalls = [];
|
|
15932
|
+
for (const content of contents) {
|
|
15933
|
+
if (content && typeof content === "object" && Array.isArray(content.parts)) {
|
|
15934
|
+
for (const part of content.parts) {
|
|
15935
|
+
if (part && typeof part === "object" && part.functionCall) {
|
|
15936
|
+
allFunctionCalls.push(part);
|
|
15937
|
+
}
|
|
15938
|
+
}
|
|
15939
|
+
}
|
|
15940
|
+
}
|
|
15941
|
+
if (allFunctionCalls.length > 0 && latestSig) {
|
|
15942
|
+
const lastFunctionCall = allFunctionCalls[allFunctionCalls.length - 1];
|
|
15943
|
+
if (!lastFunctionCall.thoughtSignature || lastFunctionCall.thoughtSignature === "skip_thought_signature_validator") {
|
|
15944
|
+
lastFunctionCall.thoughtSignature = latestSig;
|
|
15945
|
+
}
|
|
15946
|
+
}
|
|
15947
|
+
}
|
|
15952
15948
|
|
|
15953
15949
|
// src/sdk/request/response.ts
|
|
15954
15950
|
async function transformAgyResponse(response, streaming, _ignoredDebugContext, requestedModel, sessionId, chatLogger) {
|