@bike4mind/cli 0.2.21-fix-idle-timeout-error-message.18217 → 0.2.21-fix-allow-empty-tool-parameters.18231
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-FGNCVUBR.js → chunk-IZFEZ3UT.js} +1 -1
- package/dist/{chunk-RQRJNE4K.js → chunk-R6PC7Y5F.js} +34 -28
- package/dist/{chunk-ZXXSKLZA.js → chunk-RYYR733I.js} +1 -1
- package/dist/{chunk-KUGWFEGL.js → chunk-TE2BC3P4.js} +1 -1
- package/dist/{create-QDEJLD6X.js → create-ZOQDBJNR.js} +2 -2
- package/dist/index.js +10 -10
- package/dist/{mementoService-KSDOJKMT.js → mementoService-J3JLN7L7.js} +2 -2
- package/dist/{src-XY56MWV2.js → src-434JFWL5.js} +1 -1
- package/dist/{subtractCredits-3VRXFXK3.js → subtractCredits-5ABLM7L7.js} +2 -2
- package/package.json +6 -6
|
@@ -2591,28 +2591,29 @@ var AnthropicBackend = class {
|
|
|
2591
2591
|
messageCountBefore: messages.length
|
|
2592
2592
|
});
|
|
2593
2593
|
for (const tool of func) {
|
|
2594
|
-
if (!tool || !tool.name
|
|
2594
|
+
if (!tool || !tool.name)
|
|
2595
2595
|
continue;
|
|
2596
2596
|
toolsUsed.push({
|
|
2597
2597
|
name: tool.name,
|
|
2598
|
-
arguments: tool.parameters
|
|
2598
|
+
arguments: tool.parameters || "{}"
|
|
2599
2599
|
});
|
|
2600
2600
|
}
|
|
2601
2601
|
if (options.executeTools !== false) {
|
|
2602
2602
|
for (const tool of func) {
|
|
2603
|
-
if (!tool || !tool.name
|
|
2603
|
+
if (!tool || !tool.name)
|
|
2604
2604
|
continue;
|
|
2605
|
-
const { id, name
|
|
2605
|
+
const { id, name } = tool;
|
|
2606
|
+
const parameters = tool.parameters || "{}";
|
|
2606
2607
|
const toolDef = options.tools?.find((tool2) => tool2.toolSchema.name === name);
|
|
2607
2608
|
const toolFn = toolDef?.toolFn;
|
|
2608
2609
|
const isMcpTool = toolDef?._isMcpTool ?? false;
|
|
2609
|
-
if (name &&
|
|
2610
|
+
if (name && toolFn) {
|
|
2610
2611
|
this.logger.info("[Tool Execution] Executing tool", {
|
|
2611
2612
|
model,
|
|
2612
2613
|
toolName: name,
|
|
2613
2614
|
isMcpTool,
|
|
2614
2615
|
toolCallIteration: toolCallCount + 1,
|
|
2615
|
-
parameterKeys: Object.keys(JSON.parse(parameters
|
|
2616
|
+
parameterKeys: Object.keys(JSON.parse(parameters))
|
|
2616
2617
|
});
|
|
2617
2618
|
const toolStartTime = Date.now();
|
|
2618
2619
|
try {
|
|
@@ -2652,7 +2653,7 @@ var AnthropicBackend = class {
|
|
|
2652
2653
|
const toolId = id || `tool_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
2653
2654
|
this.pushToolMessages(messages, { id: toolId, name, parameters }, `Error processing ${name} tool: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
2654
2655
|
}
|
|
2655
|
-
} else if (name &&
|
|
2656
|
+
} else if (name && !toolFn) {
|
|
2656
2657
|
this.logger.warn("[Tool Execution] Tool function not found", {
|
|
2657
2658
|
model,
|
|
2658
2659
|
toolName: name,
|
|
@@ -2725,10 +2726,10 @@ var AnthropicBackend = class {
|
|
|
2725
2726
|
}
|
|
2726
2727
|
}
|
|
2727
2728
|
for (const tool of func) {
|
|
2728
|
-
if (tool?.name
|
|
2729
|
+
if (tool?.name) {
|
|
2729
2730
|
toolsUsed.push({
|
|
2730
2731
|
name: tool.name,
|
|
2731
|
-
arguments: tool.parameters
|
|
2732
|
+
arguments: tool.parameters || "{}"
|
|
2732
2733
|
});
|
|
2733
2734
|
}
|
|
2734
2735
|
}
|
|
@@ -2744,19 +2745,20 @@ var AnthropicBackend = class {
|
|
|
2744
2745
|
});
|
|
2745
2746
|
if (options.executeTools !== false) {
|
|
2746
2747
|
for (const tool of func) {
|
|
2747
|
-
if (!tool || !tool.name
|
|
2748
|
+
if (!tool || !tool.name)
|
|
2748
2749
|
continue;
|
|
2749
|
-
const { id, name
|
|
2750
|
+
const { id, name } = tool;
|
|
2751
|
+
const parameters = tool.parameters || "{}";
|
|
2750
2752
|
const toolDef = options.tools?.find((tool2) => tool2.toolSchema.name === name);
|
|
2751
2753
|
const toolFn = toolDef?.toolFn;
|
|
2752
2754
|
const isMcpTool = toolDef?._isMcpTool ?? false;
|
|
2753
|
-
if (name &&
|
|
2755
|
+
if (name && toolFn) {
|
|
2754
2756
|
this.logger.info("[Tool Execution] Executing tool (non-streaming)", {
|
|
2755
2757
|
model,
|
|
2756
2758
|
toolName: name,
|
|
2757
2759
|
isMcpTool,
|
|
2758
2760
|
toolCallIteration: toolCallCount + 1,
|
|
2759
|
-
parameterKeys: Object.keys(JSON.parse(parameters
|
|
2761
|
+
parameterKeys: Object.keys(JSON.parse(parameters))
|
|
2760
2762
|
});
|
|
2761
2763
|
const toolStartTime = Date.now();
|
|
2762
2764
|
try {
|
|
@@ -2792,7 +2794,7 @@ var AnthropicBackend = class {
|
|
|
2792
2794
|
const toolId = id || `tool_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
2793
2795
|
this.pushToolMessages(messages, { id: toolId, name, parameters }, `Error processing ${name} tool: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
2794
2796
|
}
|
|
2795
|
-
} else if (name &&
|
|
2797
|
+
} else if (name && !toolFn) {
|
|
2796
2798
|
this.logger.warn("[Tool Execution] Tool function not found (non-streaming)", {
|
|
2797
2799
|
model,
|
|
2798
2800
|
toolName: name,
|
|
@@ -3158,15 +3160,16 @@ var BaseBedrockBackend = class {
|
|
|
3158
3160
|
if (func.some((f) => f.name)) {
|
|
3159
3161
|
for await (const tool of func) {
|
|
3160
3162
|
const { name, parameters } = tool;
|
|
3161
|
-
if (name
|
|
3162
|
-
toolsUsed.push({ name, arguments: parameters });
|
|
3163
|
+
if (name) {
|
|
3164
|
+
toolsUsed.push({ name, arguments: parameters || "{}" });
|
|
3163
3165
|
}
|
|
3164
3166
|
}
|
|
3165
3167
|
if (options.executeTools !== false) {
|
|
3166
3168
|
for await (const tool of func) {
|
|
3167
|
-
const { id, name
|
|
3169
|
+
const { id, name } = tool;
|
|
3170
|
+
const parameters = tool.parameters || "{}";
|
|
3168
3171
|
const toolFn = options.tools?.find((tool2) => tool2.toolSchema.name === name)?.toolFn;
|
|
3169
|
-
if (id && name &&
|
|
3172
|
+
if (id && name && toolFn) {
|
|
3170
3173
|
const result = await toolFn(JSON.parse(parameters));
|
|
3171
3174
|
await handleToolResultStreaming(name, result, async (results) => {
|
|
3172
3175
|
await callback(results, { inputTokens, outputTokens, toolsUsed });
|
|
@@ -3200,13 +3203,14 @@ var BaseBedrockBackend = class {
|
|
|
3200
3203
|
const toolChoice = chunk?.choices.find((choice) => choice.statusEndReason === ChoiceEndReason.TOOL_USE);
|
|
3201
3204
|
if (toolChoice?.tool) {
|
|
3202
3205
|
const { id, name, parameters } = toolChoice.tool;
|
|
3203
|
-
if (name
|
|
3204
|
-
toolsUsed.push({ name, arguments: parameters });
|
|
3206
|
+
if (name) {
|
|
3207
|
+
toolsUsed.push({ name, arguments: parameters || "{}" });
|
|
3205
3208
|
}
|
|
3206
3209
|
if (options.executeTools !== false) {
|
|
3207
3210
|
const toolFn = options.tools?.find((tool) => tool.toolSchema.name === name)?.toolFn;
|
|
3208
|
-
|
|
3209
|
-
|
|
3211
|
+
const safeParameters = parameters || "{}";
|
|
3212
|
+
if (id && name && toolFn) {
|
|
3213
|
+
const result = await toolFn(JSON.parse(safeParameters));
|
|
3210
3214
|
await handleToolResultStreaming(name, result, async (results) => {
|
|
3211
3215
|
await callback(results, { inputTokens, outputTokens, toolsUsed });
|
|
3212
3216
|
});
|
|
@@ -6397,9 +6401,10 @@ var OpenAIBackend = class {
|
|
|
6397
6401
|
}
|
|
6398
6402
|
if (options.executeTools !== false) {
|
|
6399
6403
|
for await (const tool of func) {
|
|
6400
|
-
const { id, name
|
|
6404
|
+
const { id, name } = tool;
|
|
6405
|
+
const parameters2 = tool.parameters || "{}";
|
|
6401
6406
|
const toolFn = options.tools?.find((tool2) => tool2.toolSchema.name === name)?.toolFn;
|
|
6402
|
-
if (id && name &&
|
|
6407
|
+
if (id && name && toolFn) {
|
|
6403
6408
|
try {
|
|
6404
6409
|
this.logger.debug("Using tool:", name);
|
|
6405
6410
|
this.logger.debug("Tool arguments:", parameters2);
|
|
@@ -6912,18 +6917,19 @@ var XAIBackend = class {
|
|
|
6912
6917
|
if (func.length > 0) {
|
|
6913
6918
|
for await (const tool of func) {
|
|
6914
6919
|
const { name, parameters: parameters2 } = tool;
|
|
6915
|
-
if (name
|
|
6920
|
+
if (name) {
|
|
6916
6921
|
toolsUsed.push({
|
|
6917
6922
|
name,
|
|
6918
|
-
arguments: parameters2
|
|
6923
|
+
arguments: parameters2 || "{}"
|
|
6919
6924
|
});
|
|
6920
6925
|
}
|
|
6921
6926
|
}
|
|
6922
6927
|
if (options.executeTools !== false) {
|
|
6923
6928
|
for await (const tool of func) {
|
|
6924
|
-
const { id, name
|
|
6929
|
+
const { id, name } = tool;
|
|
6930
|
+
const parameters2 = tool.parameters || "{}";
|
|
6925
6931
|
const toolFn = options.tools?.find((tool2) => tool2.toolSchema.name === name)?.toolFn;
|
|
6926
|
-
if (id && name &&
|
|
6932
|
+
if (id && name && toolFn) {
|
|
6927
6933
|
try {
|
|
6928
6934
|
const result = await toolFn(JSON.parse(parameters2));
|
|
6929
6935
|
this.pushToolMessages(messages, {
|
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-IZFEZ3UT.js";
|
|
8
8
|
import {
|
|
9
9
|
ConfigStore
|
|
10
10
|
} from "./chunk-VFQF2JIT.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-RYYR733I.js";
|
|
12
|
+
import "./chunk-TE2BC3P4.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-R6PC7Y5F.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-
|
|
12265
|
+
version: "0.2.21-fix-allow-empty-tool-parameters.18231+28e872d1c",
|
|
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-
|
|
12373
|
-
"@bike4mind/mcp": "1.25.1-fix-
|
|
12374
|
-
"@bike4mind/services": "2.43.1-fix-
|
|
12375
|
-
"@bike4mind/utils": "2.3.1-fix-
|
|
12372
|
+
"@bike4mind/common": "2.45.1-fix-allow-empty-tool-parameters.18231+28e872d1c",
|
|
12373
|
+
"@bike4mind/mcp": "1.25.1-fix-allow-empty-tool-parameters.18231+28e872d1c",
|
|
12374
|
+
"@bike4mind/services": "2.43.1-fix-allow-empty-tool-parameters.18231+28e872d1c",
|
|
12375
|
+
"@bike4mind/utils": "2.3.1-fix-allow-empty-tool-parameters.18231+28e872d1c",
|
|
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: "28e872d1c37191626443350aea9001612017375c"
|
|
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-
|
|
3
|
+
"version": "0.2.21-fix-allow-empty-tool-parameters.18231+28e872d1c",
|
|
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-
|
|
111
|
-
"@bike4mind/mcp": "1.25.1-fix-
|
|
112
|
-
"@bike4mind/services": "2.43.1-fix-
|
|
113
|
-
"@bike4mind/utils": "2.3.1-fix-
|
|
110
|
+
"@bike4mind/common": "2.45.1-fix-allow-empty-tool-parameters.18231+28e872d1c",
|
|
111
|
+
"@bike4mind/mcp": "1.25.1-fix-allow-empty-tool-parameters.18231+28e872d1c",
|
|
112
|
+
"@bike4mind/services": "2.43.1-fix-allow-empty-tool-parameters.18231+28e872d1c",
|
|
113
|
+
"@bike4mind/utils": "2.3.1-fix-allow-empty-tool-parameters.18231+28e872d1c",
|
|
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": "28e872d1c37191626443350aea9001612017375c"
|
|
131
131
|
}
|