@bike4mind/cli 0.2.21-fix-allow-empty-tool-parameters.18233 → 0.2.21-fix-allow-empty-tool-parameters.18234
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/{chunk-FIB7B2WC.js → chunk-DJTSB36E.js} +1 -1
- package/dist/{chunk-H5FTKFFY.js → chunk-DWGIDDBT.js} +1 -1
- package/dist/{chunk-VZ7C2T3W.js → chunk-QDCMDUAL.js} +23 -17
- package/dist/{chunk-WXWNRU6C.js → chunk-RG4QLGNR.js} +1 -1
- package/dist/{create-YAX3NXJV.js → create-C4RGG546.js} +2 -2
- package/dist/index.js +10 -10
- package/dist/{mementoService-OYS7FWZE.js → mementoService-5GXNZB6Z.js} +2 -2
- package/dist/{src-DEZUCS7S.js → src-DZEI6X5X.js} +1 -1
- package/dist/{subtractCredits-MCO3MKZ7.js → subtractCredits-NWB6N5VR.js} +2 -2
- package/package.json +6 -6
|
@@ -4719,9 +4719,11 @@ import pick from "lodash/pick.js";
|
|
|
4719
4719
|
import { v4 as uuidv4 } from "uuid";
|
|
4720
4720
|
var GeminiBackend = class {
|
|
4721
4721
|
_api;
|
|
4722
|
+
logger;
|
|
4722
4723
|
currentModel = "";
|
|
4723
|
-
constructor(apiKey) {
|
|
4724
|
+
constructor(apiKey, logger) {
|
|
4724
4725
|
this._api = new GoogleGenAI({ apiKey });
|
|
4726
|
+
this.logger = logger ?? new Logger();
|
|
4725
4727
|
}
|
|
4726
4728
|
/**
|
|
4727
4729
|
* Helper function to register a tool call and avoid code duplication
|
|
@@ -4737,9 +4739,9 @@ var GeminiBackend = class {
|
|
|
4737
4739
|
}
|
|
4738
4740
|
const thoughtSignature = part.thoughtSignature || part.thought_signature;
|
|
4739
4741
|
if (thoughtSignature) {
|
|
4740
|
-
|
|
4742
|
+
this.logger.debug("[Gemini] Captured thought_signature for tool call:", { toolName, hasSignature: true });
|
|
4741
4743
|
} else {
|
|
4742
|
-
|
|
4744
|
+
this.logger.warn("[Gemini] Missing thought_signature for tool call:", { toolName });
|
|
4743
4745
|
}
|
|
4744
4746
|
toolCalls.push({
|
|
4745
4747
|
id: uuidv4(),
|
|
@@ -5074,7 +5076,7 @@ var GeminiBackend = class {
|
|
|
5074
5076
|
}
|
|
5075
5077
|
const toolCallCount = options._internal?.toolCallCount ?? 0;
|
|
5076
5078
|
if (toolCallCount >= DEFAULT_MAX_TOOL_CALLS && options.tools?.length) {
|
|
5077
|
-
|
|
5079
|
+
this.logger.warn(`[Gemini] Max tool calls limit (${DEFAULT_MAX_TOOL_CALLS}) reached. Disabling tools to prevent infinite loops.`);
|
|
5078
5080
|
await this.complete(modelName, messages, {
|
|
5079
5081
|
...options,
|
|
5080
5082
|
tools: void 0,
|
|
@@ -5112,7 +5114,7 @@ var GeminiBackend = class {
|
|
|
5112
5114
|
tools
|
|
5113
5115
|
}
|
|
5114
5116
|
};
|
|
5115
|
-
|
|
5117
|
+
this.logger.debug("[Gemini] Request config:", { config: config2 });
|
|
5116
5118
|
const toolCalls = [];
|
|
5117
5119
|
if (options.stream) {
|
|
5118
5120
|
try {
|
|
@@ -5148,7 +5150,7 @@ var GeminiBackend = class {
|
|
|
5148
5150
|
}
|
|
5149
5151
|
}
|
|
5150
5152
|
if (lastChunk) {
|
|
5151
|
-
|
|
5153
|
+
this.logger.debug("[Gemini] Gemini final chunk structure:", {
|
|
5152
5154
|
hasCandidates: !!lastChunk.candidates,
|
|
5153
5155
|
candidatesCount: lastChunk.candidates?.length,
|
|
5154
5156
|
finishReason: lastChunk.candidates?.[0]?.finishReason,
|
|
@@ -5172,7 +5174,9 @@ var GeminiBackend = class {
|
|
|
5172
5174
|
});
|
|
5173
5175
|
}
|
|
5174
5176
|
if (toolCalls.length > 0 && options.tools?.length) {
|
|
5175
|
-
|
|
5177
|
+
this.logger.debug("[Gemini] Executing tools immediately:", {
|
|
5178
|
+
tools: toolCalls.map((tc) => tc.name)
|
|
5179
|
+
});
|
|
5176
5180
|
if (options.executeTools !== false) {
|
|
5177
5181
|
const assistantMessage = {
|
|
5178
5182
|
role: "assistant",
|
|
@@ -5189,7 +5193,7 @@ var GeminiBackend = class {
|
|
|
5189
5193
|
for (const toolCall of toolCalls) {
|
|
5190
5194
|
const toolFn = options.tools.find((tool) => tool.toolSchema.name === toolCall.name)?.toolFn;
|
|
5191
5195
|
if (!toolFn) {
|
|
5192
|
-
|
|
5196
|
+
this.logger.warn(`[Gemini] Tool ${toolCall.name} not found`);
|
|
5193
5197
|
continue;
|
|
5194
5198
|
}
|
|
5195
5199
|
try {
|
|
@@ -5211,7 +5215,7 @@ var GeminiBackend = class {
|
|
|
5211
5215
|
if (error instanceof PermissionDeniedError) {
|
|
5212
5216
|
throw error;
|
|
5213
5217
|
}
|
|
5214
|
-
|
|
5218
|
+
this.logger.error(`[Gemini] Error executing tool ${toolCall.name}:`, error);
|
|
5215
5219
|
messages.push({
|
|
5216
5220
|
role: "tool",
|
|
5217
5221
|
content: [
|
|
@@ -5233,7 +5237,7 @@ var GeminiBackend = class {
|
|
|
5233
5237
|
}
|
|
5234
5238
|
}, callback, toolsUsed);
|
|
5235
5239
|
} else {
|
|
5236
|
-
|
|
5240
|
+
this.logger.debug("[Gemini] Gemini executeTools=false, passing tool calls to callback");
|
|
5237
5241
|
await callback([null], { toolsUsed });
|
|
5238
5242
|
}
|
|
5239
5243
|
return;
|
|
@@ -5272,7 +5276,9 @@ var GeminiBackend = class {
|
|
|
5272
5276
|
}
|
|
5273
5277
|
}
|
|
5274
5278
|
if (!options.stream && toolCalls.length > 0 && options.tools?.length) {
|
|
5275
|
-
|
|
5279
|
+
this.logger.debug("[Gemini] Executing tools (non-streaming mode):", {
|
|
5280
|
+
tools: toolCalls.map((tc) => tc.name)
|
|
5281
|
+
});
|
|
5276
5282
|
if (options.executeTools !== false) {
|
|
5277
5283
|
const assistantMessage = {
|
|
5278
5284
|
role: "assistant",
|
|
@@ -5289,7 +5295,7 @@ var GeminiBackend = class {
|
|
|
5289
5295
|
for (const toolCall of toolCalls) {
|
|
5290
5296
|
const toolFn = options.tools.find((tool) => tool.toolSchema.name === toolCall.name)?.toolFn;
|
|
5291
5297
|
if (!toolFn) {
|
|
5292
|
-
|
|
5298
|
+
this.logger.warn(`[Gemini] Tool ${toolCall.name} not found`);
|
|
5293
5299
|
continue;
|
|
5294
5300
|
}
|
|
5295
5301
|
try {
|
|
@@ -5311,7 +5317,7 @@ var GeminiBackend = class {
|
|
|
5311
5317
|
if (error instanceof PermissionDeniedError) {
|
|
5312
5318
|
throw error;
|
|
5313
5319
|
}
|
|
5314
|
-
|
|
5320
|
+
this.logger.error(`[Gemini] Error executing tool ${toolCall.name}:`, error);
|
|
5315
5321
|
messages.push({
|
|
5316
5322
|
role: "tool",
|
|
5317
5323
|
content: [
|
|
@@ -5333,7 +5339,7 @@ var GeminiBackend = class {
|
|
|
5333
5339
|
}
|
|
5334
5340
|
}, callback, toolsUsed);
|
|
5335
5341
|
} else {
|
|
5336
|
-
|
|
5342
|
+
this.logger.debug("[Gemini] Gemini executeTools=false, passing tool calls to callback");
|
|
5337
5343
|
await callback([null], { toolsUsed });
|
|
5338
5344
|
}
|
|
5339
5345
|
}
|
|
@@ -5392,18 +5398,18 @@ var GeminiBackend = class {
|
|
|
5392
5398
|
if (index === 0 && toolUse.thought_signature) {
|
|
5393
5399
|
part.thoughtSignature = toolUse.thought_signature;
|
|
5394
5400
|
part.thought_signature = toolUse.thought_signature;
|
|
5395
|
-
|
|
5401
|
+
this.logger.debug("[Gemini] Including thought_signature in request (both formats):", {
|
|
5396
5402
|
name: toolUse.name,
|
|
5397
5403
|
id: toolUse.id,
|
|
5398
5404
|
position: "first"
|
|
5399
5405
|
});
|
|
5400
5406
|
} else if (index === 0 && !toolUse.thought_signature) {
|
|
5401
|
-
|
|
5407
|
+
this.logger.warn("[Gemini] Missing thought_signature for first function call:", {
|
|
5402
5408
|
name: toolUse.name,
|
|
5403
5409
|
id: toolUse.id,
|
|
5404
5410
|
messageRole: message.role
|
|
5405
5411
|
});
|
|
5406
|
-
|
|
5412
|
+
this.logger.warn("[Gemini] This may cause a 400 error with Gemini 3 Pro");
|
|
5407
5413
|
}
|
|
5408
5414
|
return part;
|
|
5409
5415
|
});
|
package/dist/index.js
CHANGED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
getEffectiveApiKey,
|
|
5
5
|
getOpenWeatherKey,
|
|
6
6
|
getSerperKey
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DWGIDDBT.js";
|
|
8
8
|
import {
|
|
9
9
|
ConfigStore
|
|
10
10
|
} from "./chunk-VFQF2JIT.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-RG4QLGNR.js";
|
|
12
|
+
import "./chunk-DJTSB36E.js";
|
|
13
13
|
import {
|
|
14
14
|
BFLImageService,
|
|
15
15
|
BaseStorage,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
OpenAIBackend,
|
|
22
22
|
OpenAIImageService,
|
|
23
23
|
XAIImageService
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-QDCMDUAL.js";
|
|
25
25
|
import {
|
|
26
26
|
AiEvents,
|
|
27
27
|
ApiKeyEvents,
|
|
@@ -12262,7 +12262,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
|
|
|
12262
12262
|
// package.json
|
|
12263
12263
|
var package_default = {
|
|
12264
12264
|
name: "@bike4mind/cli",
|
|
12265
|
-
version: "0.2.21-fix-allow-empty-tool-parameters.
|
|
12265
|
+
version: "0.2.21-fix-allow-empty-tool-parameters.18234+cda5fe331",
|
|
12266
12266
|
type: "module",
|
|
12267
12267
|
description: "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
12268
12268
|
license: "UNLICENSED",
|
|
@@ -12369,10 +12369,10 @@ var package_default = {
|
|
|
12369
12369
|
},
|
|
12370
12370
|
devDependencies: {
|
|
12371
12371
|
"@bike4mind/agents": "0.1.0",
|
|
12372
|
-
"@bike4mind/common": "2.45.1-fix-allow-empty-tool-parameters.
|
|
12373
|
-
"@bike4mind/mcp": "1.25.1-fix-allow-empty-tool-parameters.
|
|
12374
|
-
"@bike4mind/services": "2.43.1-fix-allow-empty-tool-parameters.
|
|
12375
|
-
"@bike4mind/utils": "2.3.1-fix-allow-empty-tool-parameters.
|
|
12372
|
+
"@bike4mind/common": "2.45.1-fix-allow-empty-tool-parameters.18234+cda5fe331",
|
|
12373
|
+
"@bike4mind/mcp": "1.25.1-fix-allow-empty-tool-parameters.18234+cda5fe331",
|
|
12374
|
+
"@bike4mind/services": "2.43.1-fix-allow-empty-tool-parameters.18234+cda5fe331",
|
|
12375
|
+
"@bike4mind/utils": "2.3.1-fix-allow-empty-tool-parameters.18234+cda5fe331",
|
|
12376
12376
|
"@types/better-sqlite3": "^7.6.13",
|
|
12377
12377
|
"@types/diff": "^5.0.9",
|
|
12378
12378
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -12389,7 +12389,7 @@ var package_default = {
|
|
|
12389
12389
|
optionalDependencies: {
|
|
12390
12390
|
"@vscode/ripgrep": "^1.17.0"
|
|
12391
12391
|
},
|
|
12392
|
-
gitHead: "
|
|
12392
|
+
gitHead: "cda5fe331b0805dff8f86162e6009e03b2fdd065"
|
|
12393
12393
|
};
|
|
12394
12394
|
|
|
12395
12395
|
// src/config/constants.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bike4mind/cli",
|
|
3
|
-
"version": "0.2.21-fix-allow-empty-tool-parameters.
|
|
3
|
+
"version": "0.2.21-fix-allow-empty-tool-parameters.18234+cda5fe331",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -107,10 +107,10 @@
|
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@bike4mind/agents": "0.1.0",
|
|
110
|
-
"@bike4mind/common": "2.45.1-fix-allow-empty-tool-parameters.
|
|
111
|
-
"@bike4mind/mcp": "1.25.1-fix-allow-empty-tool-parameters.
|
|
112
|
-
"@bike4mind/services": "2.43.1-fix-allow-empty-tool-parameters.
|
|
113
|
-
"@bike4mind/utils": "2.3.1-fix-allow-empty-tool-parameters.
|
|
110
|
+
"@bike4mind/common": "2.45.1-fix-allow-empty-tool-parameters.18234+cda5fe331",
|
|
111
|
+
"@bike4mind/mcp": "1.25.1-fix-allow-empty-tool-parameters.18234+cda5fe331",
|
|
112
|
+
"@bike4mind/services": "2.43.1-fix-allow-empty-tool-parameters.18234+cda5fe331",
|
|
113
|
+
"@bike4mind/utils": "2.3.1-fix-allow-empty-tool-parameters.18234+cda5fe331",
|
|
114
114
|
"@types/better-sqlite3": "^7.6.13",
|
|
115
115
|
"@types/diff": "^5.0.9",
|
|
116
116
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"optionalDependencies": {
|
|
128
128
|
"@vscode/ripgrep": "^1.17.0"
|
|
129
129
|
},
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "cda5fe331b0805dff8f86162e6009e03b2fdd065"
|
|
131
131
|
}
|