@protolabsai/proto 0.25.12 → 0.25.14
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/cli.js +48 -4
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -147381,6 +147381,13 @@ var init_converter = __esm({
|
|
|
147381
147381
|
content: ""
|
|
147382
147382
|
};
|
|
147383
147383
|
}
|
|
147384
|
+
if (contentParts.length === 1 && contentParts[0].type === "text") {
|
|
147385
|
+
return {
|
|
147386
|
+
role: "tool",
|
|
147387
|
+
tool_call_id: response.id || "",
|
|
147388
|
+
content: contentParts[0].text
|
|
147389
|
+
};
|
|
147390
|
+
}
|
|
147384
147391
|
return {
|
|
147385
147392
|
role: "tool",
|
|
147386
147393
|
tool_call_id: response.id || "",
|
|
@@ -170887,7 +170894,7 @@ __export(geminiContentGenerator_exports, {
|
|
|
170887
170894
|
createGeminiContentGenerator: () => createGeminiContentGenerator
|
|
170888
170895
|
});
|
|
170889
170896
|
function createGeminiContentGenerator(config2, gcConfig) {
|
|
170890
|
-
const version2 = "0.25.
|
|
170897
|
+
const version2 = "0.25.14";
|
|
170891
170898
|
const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
|
|
170892
170899
|
const baseHeaders = {
|
|
170893
170900
|
"User-Agent": userAgent2
|
|
@@ -171943,6 +171950,27 @@ function extractCuratedHistory2(comprehensiveHistory) {
|
|
|
171943
171950
|
}
|
|
171944
171951
|
return curatedHistory;
|
|
171945
171952
|
}
|
|
171953
|
+
function trimToolErrorsFromContext(contents, maxTrimPairs = 6) {
|
|
171954
|
+
const trimmed2 = [...contents];
|
|
171955
|
+
let trimmed_count = 0;
|
|
171956
|
+
while (trimmed2.length >= 2 && trimmed_count < maxTrimPairs) {
|
|
171957
|
+
const last2 = trimmed2[trimmed2.length - 1];
|
|
171958
|
+
const prev = trimmed2[trimmed2.length - 2];
|
|
171959
|
+
if (last2.role !== "user")
|
|
171960
|
+
break;
|
|
171961
|
+
const allErrors = last2.parts?.every((p2) => p2.functionResponse !== void 0 && typeof p2.functionResponse.response?.["error"] === "string");
|
|
171962
|
+
if (!allErrors)
|
|
171963
|
+
break;
|
|
171964
|
+
if (prev.role !== "model")
|
|
171965
|
+
break;
|
|
171966
|
+
const hasToolCall2 = prev.parts?.some((p2) => p2.functionCall !== void 0);
|
|
171967
|
+
if (!hasToolCall2)
|
|
171968
|
+
break;
|
|
171969
|
+
trimmed2.splice(trimmed2.length - 2, 2);
|
|
171970
|
+
trimmed_count++;
|
|
171971
|
+
}
|
|
171972
|
+
return trimmed2;
|
|
171973
|
+
}
|
|
171946
171974
|
function isSchemaDepthError(errorMessage) {
|
|
171947
171975
|
return errorMessage.includes("maximum schema depth exceeded");
|
|
171948
171976
|
}
|
|
@@ -171988,6 +172016,7 @@ var init_geminiChat = __esm({
|
|
|
171988
172016
|
__name(isValidContentPart, "isValidContentPart");
|
|
171989
172017
|
__name(validateHistory2, "validateHistory");
|
|
171990
172018
|
__name(extractCuratedHistory2, "extractCuratedHistory");
|
|
172019
|
+
__name(trimToolErrorsFromContext, "trimToolErrorsFromContext");
|
|
171991
172020
|
InvalidStreamError = class extends Error {
|
|
171992
172021
|
static {
|
|
171993
172022
|
__name(this, "InvalidStreamError");
|
|
@@ -172118,6 +172147,21 @@ var init_geminiChat = __esm({
|
|
|
172118
172147
|
await new Promise((res) => setTimeout(res, delayMs));
|
|
172119
172148
|
continue;
|
|
172120
172149
|
}
|
|
172150
|
+
if (isTransientStreamError && error40.type === "NO_RESPONSE_TEXT") {
|
|
172151
|
+
const trimmedContents = trimToolErrorsFromContext(requestContents);
|
|
172152
|
+
if (trimmedContents.length < requestContents.length) {
|
|
172153
|
+
debugLogger22.warn(`NO_RESPONSE_TEXT: retrying with trimmed context (removed ${requestContents.length - trimmedContents.length} tool-error messages)`);
|
|
172154
|
+
try {
|
|
172155
|
+
const stream2 = await self2.makeApiCallAndProcessStream(model, trimmedContents, params, prompt_id);
|
|
172156
|
+
for await (const chunk of stream2) {
|
|
172157
|
+
yield { type: StreamEventType.CHUNK, value: chunk };
|
|
172158
|
+
}
|
|
172159
|
+
lastError = null;
|
|
172160
|
+
} catch {
|
|
172161
|
+
}
|
|
172162
|
+
}
|
|
172163
|
+
break;
|
|
172164
|
+
}
|
|
172121
172165
|
if (isTransientStreamError) {
|
|
172122
172166
|
break;
|
|
172123
172167
|
}
|
|
@@ -414864,7 +414908,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
414864
414908
|
// packages/cli/src/utils/version.ts
|
|
414865
414909
|
async function getCliVersion() {
|
|
414866
414910
|
const pkgJson = await getPackageJson();
|
|
414867
|
-
return "0.25.
|
|
414911
|
+
return "0.25.14";
|
|
414868
414912
|
}
|
|
414869
414913
|
__name(getCliVersion, "getCliVersion");
|
|
414870
414914
|
|
|
@@ -422636,7 +422680,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
422636
422680
|
|
|
422637
422681
|
// packages/cli/src/generated/git-commit.ts
|
|
422638
422682
|
init_esbuild_shims();
|
|
422639
|
-
var GIT_COMMIT_INFO = "
|
|
422683
|
+
var GIT_COMMIT_INFO = "a04b13211";
|
|
422640
422684
|
|
|
422641
422685
|
// packages/cli/src/utils/systemInfo.ts
|
|
422642
422686
|
async function getNpmVersion() {
|
|
@@ -490115,7 +490159,7 @@ var QwenAgent = class {
|
|
|
490115
490159
|
async initialize(args2) {
|
|
490116
490160
|
this.clientCapabilities = args2.clientCapabilities;
|
|
490117
490161
|
const authMethods = buildAuthMethods();
|
|
490118
|
-
const version2 = "0.25.
|
|
490162
|
+
const version2 = "0.25.14";
|
|
490119
490163
|
return {
|
|
490120
490164
|
protocolVersion: PROTOCOL_VERSION,
|
|
490121
490165
|
agentInfo: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protolabsai/proto",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.14",
|
|
4
4
|
"description": "proto - AI-powered coding agent",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"bundled"
|
|
22
22
|
],
|
|
23
23
|
"config": {
|
|
24
|
-
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.25.
|
|
24
|
+
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.25.14"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {},
|
|
27
27
|
"optionalDependencies": {
|