@bike4mind/cli 0.2.5-feat-cli-dynamic-model-fetching.17089 → 0.2.5-feat-server-side-tool-execution.17093
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 +103 -157
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -685,119 +685,100 @@ var EXPORT_FORMAT_OPTIONS = [
|
|
|
685
685
|
{ label: "markdown", value: "markdown" },
|
|
686
686
|
{ label: "json", value: "json" }
|
|
687
687
|
];
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
{
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
preferences
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
preferences
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
},
|
|
779
|
-
{
|
|
780
|
-
key: "exportFormat",
|
|
781
|
-
label: "Export Format",
|
|
782
|
-
type: "select",
|
|
783
|
-
options: EXPORT_FORMAT_OPTIONS,
|
|
784
|
-
getValue: (config) => config.preferences.exportFormat,
|
|
785
|
-
setValue: (config, value) => ({
|
|
786
|
-
...config,
|
|
787
|
-
preferences: {
|
|
788
|
-
...config.preferences,
|
|
789
|
-
exportFormat: value
|
|
790
|
-
}
|
|
791
|
-
})
|
|
792
|
-
}
|
|
793
|
-
];
|
|
794
|
-
}
|
|
795
|
-
function ConfigEditor({ config, availableModels, onSave, onClose }) {
|
|
688
|
+
var CONFIG_ITEMS = [
|
|
689
|
+
{
|
|
690
|
+
key: "maxIterations",
|
|
691
|
+
label: "Max Iterations",
|
|
692
|
+
type: "select",
|
|
693
|
+
options: MAX_ITERATIONS_OPTIONS,
|
|
694
|
+
getValue: (config) => config.preferences.maxIterations,
|
|
695
|
+
setValue: (config, value) => ({
|
|
696
|
+
...config,
|
|
697
|
+
preferences: {
|
|
698
|
+
...config.preferences,
|
|
699
|
+
maxIterations: value
|
|
700
|
+
}
|
|
701
|
+
})
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
key: "maxTokens",
|
|
705
|
+
label: "Max Tokens",
|
|
706
|
+
type: "number",
|
|
707
|
+
min: 256,
|
|
708
|
+
max: 128e3,
|
|
709
|
+
step: 256,
|
|
710
|
+
getValue: (config) => config.preferences.maxTokens,
|
|
711
|
+
setValue: (config, value) => ({
|
|
712
|
+
...config,
|
|
713
|
+
preferences: {
|
|
714
|
+
...config.preferences,
|
|
715
|
+
maxTokens: value
|
|
716
|
+
}
|
|
717
|
+
})
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
key: "temperature",
|
|
721
|
+
label: "Temperature",
|
|
722
|
+
type: "number",
|
|
723
|
+
min: 0,
|
|
724
|
+
max: 2,
|
|
725
|
+
step: 0.1,
|
|
726
|
+
getValue: (config) => config.preferences.temperature,
|
|
727
|
+
setValue: (config, value) => ({
|
|
728
|
+
...config,
|
|
729
|
+
preferences: {
|
|
730
|
+
...config.preferences,
|
|
731
|
+
temperature: value
|
|
732
|
+
}
|
|
733
|
+
})
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
key: "autoSave",
|
|
737
|
+
label: "Auto Save",
|
|
738
|
+
type: "boolean",
|
|
739
|
+
getValue: (config) => config.preferences.autoSave,
|
|
740
|
+
setValue: (config, value) => ({
|
|
741
|
+
...config,
|
|
742
|
+
preferences: {
|
|
743
|
+
...config.preferences,
|
|
744
|
+
autoSave: value
|
|
745
|
+
}
|
|
746
|
+
})
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
key: "theme",
|
|
750
|
+
label: "Theme",
|
|
751
|
+
type: "select",
|
|
752
|
+
options: THEME_OPTIONS,
|
|
753
|
+
getValue: (config) => config.preferences.theme,
|
|
754
|
+
setValue: (config, value) => ({
|
|
755
|
+
...config,
|
|
756
|
+
preferences: {
|
|
757
|
+
...config.preferences,
|
|
758
|
+
theme: value
|
|
759
|
+
}
|
|
760
|
+
})
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
key: "exportFormat",
|
|
764
|
+
label: "Export Format",
|
|
765
|
+
type: "select",
|
|
766
|
+
options: EXPORT_FORMAT_OPTIONS,
|
|
767
|
+
getValue: (config) => config.preferences.exportFormat,
|
|
768
|
+
setValue: (config, value) => ({
|
|
769
|
+
...config,
|
|
770
|
+
preferences: {
|
|
771
|
+
...config.preferences,
|
|
772
|
+
exportFormat: value
|
|
773
|
+
}
|
|
774
|
+
})
|
|
775
|
+
}
|
|
776
|
+
];
|
|
777
|
+
function ConfigEditor({ config, onSave, onClose }) {
|
|
796
778
|
const [selectedIndex, setSelectedIndex] = useState2(0);
|
|
797
779
|
const [editedConfig, setEditedConfig] = useState2(config);
|
|
798
780
|
const [saveError, setSaveError] = useState2(null);
|
|
799
781
|
const [isSaving, setIsSaving] = useState2(false);
|
|
800
|
-
const configItems = useMemo2(() => buildConfigItems(availableModels), [availableModels]);
|
|
801
782
|
const hasChanges = useMemo2(() => {
|
|
802
783
|
return JSON.stringify(config.preferences) !== JSON.stringify(editedConfig.preferences);
|
|
803
784
|
}, [config.preferences, editedConfig.preferences]);
|
|
@@ -817,13 +798,13 @@ function ConfigEditor({ config, availableModels, onSave, onClose }) {
|
|
|
817
798
|
onClose();
|
|
818
799
|
};
|
|
819
800
|
useInput2((input, key) => {
|
|
820
|
-
const currentItem =
|
|
801
|
+
const currentItem = CONFIG_ITEMS[selectedIndex];
|
|
821
802
|
if (key.upArrow) {
|
|
822
|
-
setSelectedIndex((prev) => prev > 0 ? prev - 1 :
|
|
803
|
+
setSelectedIndex((prev) => prev > 0 ? prev - 1 : CONFIG_ITEMS.length - 1);
|
|
823
804
|
return;
|
|
824
805
|
}
|
|
825
806
|
if (key.downArrow) {
|
|
826
|
-
setSelectedIndex((prev) => prev <
|
|
807
|
+
setSelectedIndex((prev) => prev < CONFIG_ITEMS.length - 1 ? prev + 1 : 0);
|
|
827
808
|
return;
|
|
828
809
|
}
|
|
829
810
|
if ((key.escape || input === "q") && !isSaving) {
|
|
@@ -881,7 +862,7 @@ function ConfigEditor({ config, availableModels, onSave, onClose }) {
|
|
|
881
862
|
}
|
|
882
863
|
return String(value);
|
|
883
864
|
};
|
|
884
|
-
return /* @__PURE__ */ React8.createElement(Box8, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, marginY: 1 }, /* @__PURE__ */ React8.createElement(Box8, { justifyContent: "space-between", marginBottom: 1 }, /* @__PURE__ */ React8.createElement(Text7, { bold: true, color: "cyan" }, "Settings"), isSaving ? /* @__PURE__ */ React8.createElement(Text7, { color: "yellow" }, "Saving...") : hasChanges ? /* @__PURE__ */ React8.createElement(Text7, { dimColor: true, color: "yellow" }, "(unsaved changes)") : null), saveError && /* @__PURE__ */ React8.createElement(Box8, { marginBottom: 1 }, /* @__PURE__ */ React8.createElement(Text7, { color: "red" }, "Error: ", saveError)), /* @__PURE__ */ React8.createElement(Box8, { flexDirection: "column", marginBottom: 1 },
|
|
865
|
+
return /* @__PURE__ */ React8.createElement(Box8, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, marginY: 1 }, /* @__PURE__ */ React8.createElement(Box8, { justifyContent: "space-between", marginBottom: 1 }, /* @__PURE__ */ React8.createElement(Text7, { bold: true, color: "cyan" }, "Settings"), isSaving ? /* @__PURE__ */ React8.createElement(Text7, { color: "yellow" }, "Saving...") : hasChanges ? /* @__PURE__ */ React8.createElement(Text7, { dimColor: true, color: "yellow" }, "(unsaved changes)") : null), saveError && /* @__PURE__ */ React8.createElement(Box8, { marginBottom: 1 }, /* @__PURE__ */ React8.createElement(Text7, { color: "red" }, "Error: ", saveError)), /* @__PURE__ */ React8.createElement(Box8, { flexDirection: "column", marginBottom: 1 }, CONFIG_ITEMS.map((item, index) => {
|
|
885
866
|
const isSelected = index === selectedIndex;
|
|
886
867
|
const value = item.getValue(editedConfig);
|
|
887
868
|
const displayValue = formatValue(item, value);
|
|
@@ -1011,7 +992,6 @@ function App({
|
|
|
1011
992
|
onPermissionResponse,
|
|
1012
993
|
commandHistory = [],
|
|
1013
994
|
config,
|
|
1014
|
-
availableModels = [],
|
|
1015
995
|
onSaveConfig
|
|
1016
996
|
}) {
|
|
1017
997
|
const messages = useCliStore((state) => state.session?.messages || []);
|
|
@@ -1053,15 +1033,7 @@ ${errorBlock}`;
|
|
|
1053
1033
|
},
|
|
1054
1034
|
[onMessage, onCommand, setIsThinking]
|
|
1055
1035
|
);
|
|
1056
|
-
return /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column" }, /* @__PURE__ */ React9.createElement(StatusBar, { sessionName, model: currentModel, tokenUsage: totalTokens }), showConfigEditor && config && onSaveConfig ? /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React9.createElement(
|
|
1057
|
-
ConfigEditor,
|
|
1058
|
-
{
|
|
1059
|
-
config,
|
|
1060
|
-
availableModels,
|
|
1061
|
-
onSave: onSaveConfig,
|
|
1062
|
-
onClose: () => setShowConfigEditor(false)
|
|
1063
|
-
}
|
|
1064
|
-
)) : permissionPrompt ? /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React9.createElement(
|
|
1036
|
+
return /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column" }, /* @__PURE__ */ React9.createElement(StatusBar, { sessionName, model: currentModel, tokenUsage: totalTokens }), showConfigEditor && config && onSaveConfig ? /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React9.createElement(ConfigEditor, { config, onSave: onSaveConfig, onClose: () => setShowConfigEditor(false) })) : permissionPrompt ? /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React9.createElement(
|
|
1065
1037
|
PermissionPrompt,
|
|
1066
1038
|
{
|
|
1067
1039
|
toolName: permissionPrompt.toolName,
|
|
@@ -9243,32 +9215,9 @@ var ServerLlmBackend = class {
|
|
|
9243
9215
|
}
|
|
9244
9216
|
/**
|
|
9245
9217
|
* Get available models from server
|
|
9246
|
-
*
|
|
9247
|
-
* Falls back to hardcoded list if API fails
|
|
9218
|
+
* For now, returns hardcoded list of supported models
|
|
9248
9219
|
*/
|
|
9249
9220
|
async getModelInfo() {
|
|
9250
|
-
try {
|
|
9251
|
-
logger.debug("[ServerLlmBackend] Fetching models from /api/models");
|
|
9252
|
-
const response = await this.apiClient.get("/api/models");
|
|
9253
|
-
const filteredModels = response.models.filter((model) => model.type === "text" && model.supportsTools === true);
|
|
9254
|
-
logger.debug(`[ServerLlmBackend] Fetched ${filteredModels.length} CLI-compatible models`);
|
|
9255
|
-
if (filteredModels.length === 0) {
|
|
9256
|
-
logger.warn("[ServerLlmBackend] No CLI-compatible models found from API, using fallback");
|
|
9257
|
-
return this.getFallbackModels();
|
|
9258
|
-
}
|
|
9259
|
-
return filteredModels;
|
|
9260
|
-
} catch (error) {
|
|
9261
|
-
logger.warn(
|
|
9262
|
-
`[ServerLlmBackend] Failed to fetch models from API, using fallback: ${error instanceof Error ? error.message : String(error)}`
|
|
9263
|
-
);
|
|
9264
|
-
return this.getFallbackModels();
|
|
9265
|
-
}
|
|
9266
|
-
}
|
|
9267
|
-
/**
|
|
9268
|
-
* Fallback models when API is unavailable
|
|
9269
|
-
* Returns hardcoded list of commonly supported models
|
|
9270
|
-
*/
|
|
9271
|
-
getFallbackModels() {
|
|
9272
9221
|
return [
|
|
9273
9222
|
{
|
|
9274
9223
|
id: "claude-sonnet-4-5-20250929",
|
|
@@ -9453,7 +9402,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
|
|
|
9453
9402
|
// package.json
|
|
9454
9403
|
var package_default = {
|
|
9455
9404
|
name: "@bike4mind/cli",
|
|
9456
|
-
version: "0.2.5-feat-
|
|
9405
|
+
version: "0.2.5-feat-server-side-tool-execution.17093+db1662b89",
|
|
9457
9406
|
type: "module",
|
|
9458
9407
|
description: "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
9459
9408
|
license: "UNLICENSED",
|
|
@@ -9555,10 +9504,10 @@ var package_default = {
|
|
|
9555
9504
|
},
|
|
9556
9505
|
devDependencies: {
|
|
9557
9506
|
"@bike4mind/agents": "0.1.0",
|
|
9558
|
-
"@bike4mind/common": "2.37.1-feat-
|
|
9559
|
-
"@bike4mind/mcp": "1.19.6-feat-
|
|
9560
|
-
"@bike4mind/services": "2.32.2-feat-
|
|
9561
|
-
"@bike4mind/utils": "2.1.1-feat-
|
|
9507
|
+
"@bike4mind/common": "2.37.1-feat-server-side-tool-execution.17093+db1662b89",
|
|
9508
|
+
"@bike4mind/mcp": "1.19.6-feat-server-side-tool-execution.17093+db1662b89",
|
|
9509
|
+
"@bike4mind/services": "2.32.2-feat-server-side-tool-execution.17093+db1662b89",
|
|
9510
|
+
"@bike4mind/utils": "2.1.1-feat-server-side-tool-execution.17093+db1662b89",
|
|
9562
9511
|
"@types/diff": "^5.0.9",
|
|
9563
9512
|
"@types/jsonwebtoken": "^9.0.4",
|
|
9564
9513
|
"@types/node": "^22.9.0",
|
|
@@ -9570,7 +9519,7 @@ var package_default = {
|
|
|
9570
9519
|
typescript: "^5.9.3",
|
|
9571
9520
|
vitest: "^3.2.4"
|
|
9572
9521
|
},
|
|
9573
|
-
gitHead: "
|
|
9522
|
+
gitHead: "db1662b8926451c7fdba8eb99245b75f6fae6693"
|
|
9574
9523
|
};
|
|
9575
9524
|
|
|
9576
9525
|
// src/config/constants.ts
|
|
@@ -9853,10 +9802,8 @@ Remember: Use context from previous messages to understand follow-up questions.`
|
|
|
9853
9802
|
agent,
|
|
9854
9803
|
mcpManager,
|
|
9855
9804
|
permissionManager,
|
|
9856
|
-
config
|
|
9805
|
+
config
|
|
9857
9806
|
// Store config for synchronous access
|
|
9858
|
-
availableModels: models
|
|
9859
|
-
// Store models for ConfigEditor
|
|
9860
9807
|
}));
|
|
9861
9808
|
setStoreSession(newSession);
|
|
9862
9809
|
setIsInitialized(true);
|
|
@@ -10292,7 +10239,6 @@ No usage data available for the last ${USAGE_DAYS} days.`);
|
|
|
10292
10239
|
onCommand: handleCommand,
|
|
10293
10240
|
commandHistory,
|
|
10294
10241
|
config: state.config,
|
|
10295
|
-
availableModels: state.availableModels,
|
|
10296
10242
|
onSaveConfig: handleSaveConfig,
|
|
10297
10243
|
onPermissionResponse: (response) => {
|
|
10298
10244
|
if (state.permissionPrompt) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bike4mind/cli",
|
|
3
|
-
"version": "0.2.5-feat-
|
|
3
|
+
"version": "0.2.5-feat-server-side-tool-execution.17093+db1662b89",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -102,10 +102,10 @@
|
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
104
|
"@bike4mind/agents": "0.1.0",
|
|
105
|
-
"@bike4mind/common": "2.37.1-feat-
|
|
106
|
-
"@bike4mind/mcp": "1.19.6-feat-
|
|
107
|
-
"@bike4mind/services": "2.32.2-feat-
|
|
108
|
-
"@bike4mind/utils": "2.1.1-feat-
|
|
105
|
+
"@bike4mind/common": "2.37.1-feat-server-side-tool-execution.17093+db1662b89",
|
|
106
|
+
"@bike4mind/mcp": "1.19.6-feat-server-side-tool-execution.17093+db1662b89",
|
|
107
|
+
"@bike4mind/services": "2.32.2-feat-server-side-tool-execution.17093+db1662b89",
|
|
108
|
+
"@bike4mind/utils": "2.1.1-feat-server-side-tool-execution.17093+db1662b89",
|
|
109
109
|
"@types/diff": "^5.0.9",
|
|
110
110
|
"@types/jsonwebtoken": "^9.0.4",
|
|
111
111
|
"@types/node": "^22.9.0",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"typescript": "^5.9.3",
|
|
118
118
|
"vitest": "^3.2.4"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "db1662b8926451c7fdba8eb99245b75f6fae6693"
|
|
121
121
|
}
|