@bike4mind/cli 0.2.10-fix-b4m-cli-flicker.17230 → 0.2.10-fix-b4m-cli-flicker.17235
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 +19 -23
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -91,7 +91,7 @@ import { Box as Box10, Text as Text10, Static } from "ink";
|
|
|
91
91
|
import React from "react";
|
|
92
92
|
import { Box, Text } from "ink";
|
|
93
93
|
var StatusBar = React.memo(function StatusBar2({ sessionName, model, tokenUsage }) {
|
|
94
|
-
return /* @__PURE__ */ React.createElement(Box, {
|
|
94
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "row", justifyContent: "space-between", width: "100%", paddingX: 1 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, sessionName), /* @__PURE__ */ React.createElement(Box, { gap: 2 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, tokenUsage.toLocaleString(), " tokens"), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, model)));
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
// src/components/InputPrompt.tsx
|
|
@@ -1245,7 +1245,7 @@ import React10 from "react";
|
|
|
1245
1245
|
import { Box as Box9, Text as Text9 } from "ink";
|
|
1246
1246
|
function MessageItem({ message }) {
|
|
1247
1247
|
const isUser = message.role === "user";
|
|
1248
|
-
return /* @__PURE__ */ React10.createElement(Box9, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React10.createElement(Box9, null, /* @__PURE__ */ React10.createElement(Text9, { bold: true, color: isUser ? "cyan" : "green" }, isUser ? "\u{1F464} You" : "\u{1F916} Assistant"), /* @__PURE__ */ React10.createElement(Text9, { dimColor: true }, " \u2022 ", new Date(message.timestamp).toLocaleTimeString())), isUser && message.content && /* @__PURE__ */ React10.createElement(Box9, { paddingLeft: 2 }, /* @__PURE__ */ React10.createElement(Text9, { backgroundColor: "whiteBright", color: "black" }, " ", message.content, " ")), !isUser && message.metadata?.steps && message.metadata.steps.length > 0 && /* @__PURE__ */ React10.createElement(Box9, { paddingLeft: 2, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React10.createElement(Text9, { dimColor: true, bold: true }, "\u{1F527} Agent Reasoning Trace (", message.metadata.steps.filter((s) => s.type === "action").length, " ", "tools used, ", message.metadata.steps.length, " total steps)", message.metadata.tokenUsage && ` \u2022 ${message.metadata.tokenUsage.total} tokens`), /* @__PURE__ */ React10.createElement(Text9, { dimColor: true }, "Step types: ", message.metadata.steps.map((s) => s.type).join(", ")), message.metadata.steps.map((step, idx) => {
|
|
1248
|
+
return /* @__PURE__ */ React10.createElement(Box9, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React10.createElement(Box9, null, /* @__PURE__ */ React10.createElement(Text9, { bold: true, color: isUser ? "cyan" : "green" }, isUser ? "\u{1F464} You" : "\u{1F916} Assistant"), isUser && /* @__PURE__ */ React10.createElement(Text9, { dimColor: true }, " \u2022 ", new Date(message.timestamp).toLocaleTimeString())), isUser && message.content && /* @__PURE__ */ React10.createElement(Box9, { paddingLeft: 2 }, /* @__PURE__ */ React10.createElement(Text9, { backgroundColor: "whiteBright", color: "black" }, " ", message.content, " ")), !isUser && message.metadata?.steps && message.metadata.steps.length > 0 && /* @__PURE__ */ React10.createElement(Box9, { paddingLeft: 2, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React10.createElement(Text9, { dimColor: true, bold: true }, "\u{1F527} Agent Reasoning Trace (", message.metadata.steps.filter((s) => s.type === "action").length, " ", "tools used, ", message.metadata.steps.length, " total steps)", message.metadata.tokenUsage && ` \u2022 ${message.metadata.tokenUsage.total} tokens`), /* @__PURE__ */ React10.createElement(Text9, { dimColor: true }, "Step types: ", message.metadata.steps.map((s) => s.type).join(", ")), message.metadata.steps.map((step, idx) => {
|
|
1249
1249
|
if (step.type === "thought") {
|
|
1250
1250
|
return /* @__PURE__ */ React10.createElement(Box9, { key: idx, paddingLeft: 2, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React10.createElement(Text9, { color: "blue" }, "\u{1F4AD} Thought:"), /* @__PURE__ */ React10.createElement(Text9, { dimColor: true }, ` ${step.content.slice(0, 200)}${step.content.length > 200 ? "..." : ""}`));
|
|
1251
1251
|
}
|
|
@@ -1444,7 +1444,7 @@ ${errorBlock}`;
|
|
|
1444
1444
|
canBeTrusted: permissionPrompt.canBeTrusted,
|
|
1445
1445
|
onResponse: onPermissionResponse
|
|
1446
1446
|
}
|
|
1447
|
-
)) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(Static, { items: messages }, (message, index) => /* @__PURE__ */ React11.createElement(Box10, { key: `${message.timestamp}-${message.role}-${index}`, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React11.createElement(MessageItem, { message }))), /* @__PURE__ */ React11.createElement(Box10, { flexDirection: "column" }, pendingMessages.map((message, index) => /* @__PURE__ */ React11.createElement(Box10, { key: `pending-${message.timestamp}-${index}`, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React11.createElement(MessageItem, { message })))), /* @__PURE__ */ React11.createElement(AgentThinking, null), exitRequested && /* @__PURE__ */ React11.createElement(Box10, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React11.createElement(Text10, { color: "yellow", bold: true }, "Press Ctrl+C again to exit")), /* @__PURE__ */ React11.createElement(
|
|
1447
|
+
)) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(Static, { items: messages }, (message, index) => /* @__PURE__ */ React11.createElement(Box10, { key: `${message.timestamp}-${message.role}-${index}`, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React11.createElement(MessageItem, { message }))), /* @__PURE__ */ React11.createElement(Box10, { flexDirection: "column" }, pendingMessages.map((message, index) => /* @__PURE__ */ React11.createElement(Box10, { key: `pending-${message.timestamp}-${index}`, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React11.createElement(MessageItem, { message })))), /* @__PURE__ */ React11.createElement(AgentThinking, null), exitRequested && /* @__PURE__ */ React11.createElement(Box10, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React11.createElement(Text10, { color: "yellow", bold: true }, "Press Ctrl+C again to exit")), /* @__PURE__ */ React11.createElement(Box10, { borderStyle: "single", borderColor: "cyan", paddingX: 1 }, /* @__PURE__ */ React11.createElement(
|
|
1448
1448
|
InputPrompt,
|
|
1449
1449
|
{
|
|
1450
1450
|
onSubmit: handleSubmit,
|
|
@@ -1454,7 +1454,7 @@ ${errorBlock}`;
|
|
|
1454
1454
|
prefillInput,
|
|
1455
1455
|
onPrefillConsumed
|
|
1456
1456
|
}
|
|
1457
|
-
))));
|
|
1457
|
+
)), /* @__PURE__ */ React11.createElement(StatusBar, { sessionName, model: currentModel, tokenUsage: totalTokens })));
|
|
1458
1458
|
}
|
|
1459
1459
|
|
|
1460
1460
|
// src/components/MessageList.tsx
|
|
@@ -9685,6 +9685,7 @@ var Logger2 = class _Logger {
|
|
|
9685
9685
|
}
|
|
9686
9686
|
};
|
|
9687
9687
|
var logger = Logger2.getInstance();
|
|
9688
|
+
logger.setVerbose(process.env.B4M_VERBOSE === "1");
|
|
9688
9689
|
|
|
9689
9690
|
// src/llm/ServerToolExecutor.ts
|
|
9690
9691
|
var ServerToolExecutor = class {
|
|
@@ -11113,7 +11114,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
|
|
|
11113
11114
|
// package.json
|
|
11114
11115
|
var package_default = {
|
|
11115
11116
|
name: "@bike4mind/cli",
|
|
11116
|
-
version: "0.2.10-fix-b4m-cli-flicker.
|
|
11117
|
+
version: "0.2.10-fix-b4m-cli-flicker.17235+479bb7772",
|
|
11117
11118
|
type: "module",
|
|
11118
11119
|
description: "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
11119
11120
|
license: "UNLICENSED",
|
|
@@ -11216,10 +11217,10 @@ var package_default = {
|
|
|
11216
11217
|
},
|
|
11217
11218
|
devDependencies: {
|
|
11218
11219
|
"@bike4mind/agents": "0.1.0",
|
|
11219
|
-
"@bike4mind/common": "2.39.1-fix-b4m-cli-flicker.
|
|
11220
|
-
"@bike4mind/mcp": "1.20.4-fix-b4m-cli-flicker.
|
|
11221
|
-
"@bike4mind/services": "2.34.2-fix-b4m-cli-flicker.
|
|
11222
|
-
"@bike4mind/utils": "2.1.4-fix-b4m-cli-flicker.
|
|
11220
|
+
"@bike4mind/common": "2.39.1-fix-b4m-cli-flicker.17235+479bb7772",
|
|
11221
|
+
"@bike4mind/mcp": "1.20.4-fix-b4m-cli-flicker.17235+479bb7772",
|
|
11222
|
+
"@bike4mind/services": "2.34.2-fix-b4m-cli-flicker.17235+479bb7772",
|
|
11223
|
+
"@bike4mind/utils": "2.1.4-fix-b4m-cli-flicker.17235+479bb7772",
|
|
11223
11224
|
"@types/better-sqlite3": "^7.6.13",
|
|
11224
11225
|
"@types/diff": "^5.0.9",
|
|
11225
11226
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -11232,7 +11233,7 @@ var package_default = {
|
|
|
11232
11233
|
typescript: "^5.9.3",
|
|
11233
11234
|
vitest: "^3.2.4"
|
|
11234
11235
|
},
|
|
11235
|
-
gitHead: "
|
|
11236
|
+
gitHead: "479bb77726d7e49cda72367ba8fd3c84e346474d"
|
|
11236
11237
|
};
|
|
11237
11238
|
|
|
11238
11239
|
// src/config/constants.ts
|
|
@@ -11396,13 +11397,11 @@ function CliApp() {
|
|
|
11396
11397
|
if (models.length === 0) {
|
|
11397
11398
|
throw new Error("No models available from server.");
|
|
11398
11399
|
}
|
|
11399
|
-
|
|
11400
|
+
logger.debug(`\u{1F4CB} Available models: ${models.map((m) => m.id).join(", ")}`);
|
|
11400
11401
|
const modelInfo = models.find((m) => m.id === config.defaultModel) || models[0];
|
|
11401
11402
|
if (modelInfo.id !== config.defaultModel) {
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
} else {
|
|
11405
|
-
console.log(`\u{1F916} Using model: ${modelInfo.id}`);
|
|
11403
|
+
logger.warn(`\u26A0\uFE0F Requested model '${config.defaultModel}' not available`);
|
|
11404
|
+
logger.warn(`\u{1F916} Using fallback model: ${modelInfo.id}`);
|
|
11406
11405
|
}
|
|
11407
11406
|
llm.currentModel = modelInfo.id;
|
|
11408
11407
|
const newSession = {
|
|
@@ -11421,9 +11420,6 @@ function CliApp() {
|
|
|
11421
11420
|
};
|
|
11422
11421
|
await logger.initialize(newSession.id);
|
|
11423
11422
|
logger.setVerbose(process.env.B4M_VERBOSE === "1");
|
|
11424
|
-
logger.info(`API: ${apiBaseURL}`);
|
|
11425
|
-
logger.info(`Environment: ${envName}`);
|
|
11426
|
-
logger.info(`Model: ${modelInfo.id}`);
|
|
11427
11423
|
logger.debug("=== Session Configuration Complete ===");
|
|
11428
11424
|
logger.cleanupOldLogs().catch(() => {
|
|
11429
11425
|
});
|
|
@@ -11472,7 +11468,7 @@ function CliApp() {
|
|
|
11472
11468
|
state.configStore,
|
|
11473
11469
|
apiClient
|
|
11474
11470
|
);
|
|
11475
|
-
console.log(`\u{1F6E0}\uFE0F
|
|
11471
|
+
console.log(`\u{1F6E0}\uFE0F Loaded ${b4mTools.length} B4M tool(s)`);
|
|
11476
11472
|
const mcpManager = new McpManager(config);
|
|
11477
11473
|
await mcpManager.initialize();
|
|
11478
11474
|
const mcpTools = mcpManager.getTools();
|
|
@@ -11483,7 +11479,6 @@ function CliApp() {
|
|
|
11483
11479
|
});
|
|
11484
11480
|
}
|
|
11485
11481
|
const allTools = [...b4mTools, ...mcpTools];
|
|
11486
|
-
console.log(`\u2705 Total: ${allTools.length} tool(s) available`);
|
|
11487
11482
|
const projectDir = state.configStore.getProjectConfigDir();
|
|
11488
11483
|
const contextResult = await loadContextFiles(projectDir);
|
|
11489
11484
|
if (contextResult.globalContext) {
|
|
@@ -11559,6 +11554,7 @@ Remember: Use context from previous messages to understand follow-up questions.$
|
|
|
11559
11554
|
}));
|
|
11560
11555
|
setStoreSession(newSession);
|
|
11561
11556
|
setIsInitialized(true);
|
|
11557
|
+
console.log("\n");
|
|
11562
11558
|
} catch (error) {
|
|
11563
11559
|
console.error("Initialization error:", error);
|
|
11564
11560
|
setInitError(error instanceof Error ? error.message : "Unknown error");
|
|
@@ -12387,11 +12383,11 @@ var BANNER = `
|
|
|
12387
12383
|
\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D
|
|
12388
12384
|
`;
|
|
12389
12385
|
console.log("\x1B[36m\x1B[1m%s\x1B[0m", BANNER);
|
|
12390
|
-
console.log(`\x1B[2m v${package_default.version} - AI-Powered CLI\x1B[0m
|
|
12391
|
-
|
|
12386
|
+
console.log(`\x1B[2m v${package_default.version} - AI-Powered CLI\x1B[0m`);
|
|
12387
|
+
console.log(" /help for more information\n");
|
|
12392
12388
|
var isDevMode = import.meta.url.includes("/src/") || process.env.NODE_ENV === "development";
|
|
12393
12389
|
if (isDevMode) {
|
|
12394
|
-
|
|
12390
|
+
logger.debug("\u{1F527} Running in development mode (using TypeScript source)\n");
|
|
12395
12391
|
}
|
|
12396
12392
|
render(/* @__PURE__ */ React17.createElement(CliApp, null), {
|
|
12397
12393
|
exitOnCtrlC: false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bike4mind/cli",
|
|
3
|
-
"version": "0.2.10-fix-b4m-cli-flicker.
|
|
3
|
+
"version": "0.2.10-fix-b4m-cli-flicker.17235+479bb7772",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -103,10 +103,10 @@
|
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@bike4mind/agents": "0.1.0",
|
|
106
|
-
"@bike4mind/common": "2.39.1-fix-b4m-cli-flicker.
|
|
107
|
-
"@bike4mind/mcp": "1.20.4-fix-b4m-cli-flicker.
|
|
108
|
-
"@bike4mind/services": "2.34.2-fix-b4m-cli-flicker.
|
|
109
|
-
"@bike4mind/utils": "2.1.4-fix-b4m-cli-flicker.
|
|
106
|
+
"@bike4mind/common": "2.39.1-fix-b4m-cli-flicker.17235+479bb7772",
|
|
107
|
+
"@bike4mind/mcp": "1.20.4-fix-b4m-cli-flicker.17235+479bb7772",
|
|
108
|
+
"@bike4mind/services": "2.34.2-fix-b4m-cli-flicker.17235+479bb7772",
|
|
109
|
+
"@bike4mind/utils": "2.1.4-fix-b4m-cli-flicker.17235+479bb7772",
|
|
110
110
|
"@types/better-sqlite3": "^7.6.13",
|
|
111
111
|
"@types/diff": "^5.0.9",
|
|
112
112
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"typescript": "^5.9.3",
|
|
120
120
|
"vitest": "^3.2.4"
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "479bb77726d7e49cda72367ba8fd3c84e346474d"
|
|
123
123
|
}
|