@bike4mind/cli 0.2.28-feat-questmaster-progress-indicators.18726 → 0.2.28-fix-cli-eslint-errors.18724
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-BM5UITAN.js → chunk-5VZSKEEG.js} +1 -1
- package/dist/{chunk-XZJWPZOH.js → chunk-5ZYPV3TT.js} +1 -1
- package/dist/{chunk-2J5AUNSH.js → chunk-JQOZTED2.js} +4 -4
- package/dist/{chunk-NPBR7F7W.js → chunk-YY4HHPYV.js} +1 -1
- package/dist/{create-6DLGYPYY.js → create-JY3A3VKV.js} +2 -2
- package/dist/index.js +215 -218
- package/dist/{mementoService-X3EDOW43.js → mementoService-6XGTK6H6.js} +2 -2
- package/dist/{src-WWNPTBHK.js → src-LZQJBWV3.js} +1 -1
- package/dist/{subtractCredits-IDJJN7IQ.js → subtractCredits-NN6GZFZY.js} +2 -2
- package/package.json +6 -6
|
@@ -9151,7 +9151,7 @@ var QuestMaster = class {
|
|
|
9151
9151
|
if (!this.quest) {
|
|
9152
9152
|
throw new Error("No quest context available");
|
|
9153
9153
|
}
|
|
9154
|
-
await this.onStatusUpdate(this.quest, "
|
|
9154
|
+
await this.onStatusUpdate(this.quest, "Processing quest plan...");
|
|
9155
9155
|
const defaultResponse = {
|
|
9156
9156
|
type: "narrative",
|
|
9157
9157
|
meta: {
|
|
@@ -9233,7 +9233,7 @@ var QuestMaster = class {
|
|
|
9233
9233
|
}
|
|
9234
9234
|
if (extracted.length > 0) {
|
|
9235
9235
|
this.logger.log("Successfully extracted QuestMaster data:", extracted);
|
|
9236
|
-
await this.onStatusUpdate(this.quest, "
|
|
9236
|
+
await this.onStatusUpdate(this.quest, "Extracted QuestMaster data");
|
|
9237
9237
|
const validQuests = extracted.filter((quest) => quest !== null && typeof quest === "object" && quest.id && quest.title && quest.description);
|
|
9238
9238
|
if (validQuests.length === 0) {
|
|
9239
9239
|
throw new Error("No valid quests found after filtering");
|
|
@@ -9326,7 +9326,7 @@ var QuestMaster = class {
|
|
|
9326
9326
|
questResponse = defaultResponse;
|
|
9327
9327
|
this.logger.error("Invalid quest response structure, using default");
|
|
9328
9328
|
}
|
|
9329
|
-
await this.onStatusUpdate(this.quest, "
|
|
9329
|
+
await this.onStatusUpdate(this.quest, "Saving quest plan...");
|
|
9330
9330
|
console.log("\u{1F3AF} Creating QuestMasterPlan with userId:", this.userId);
|
|
9331
9331
|
const questMasterPlan = await this.db.questMasterPlans.create({
|
|
9332
9332
|
notebookId: this.quest.sessionId,
|
|
@@ -9648,7 +9648,7 @@ HANDLING VERBOSE INPUT:
|
|
|
9648
9648
|
}
|
|
9649
9649
|
const { history = [] } = options;
|
|
9650
9650
|
this.logger.log(`Creating quest plan with ${history.length} history messages for context`);
|
|
9651
|
-
await this.onStatusUpdate(this.quest, "
|
|
9651
|
+
await this.onStatusUpdate(this.quest, "Creating quest plan...");
|
|
9652
9652
|
if (isGPT5ModelWithToolSupport(model)) {
|
|
9653
9653
|
this.logger.log(`Using function calling approach for GPT-5 model: ${model}`);
|
|
9654
9654
|
try {
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getEffectiveApiKey,
|
|
6
6
|
getOpenWeatherKey,
|
|
7
7
|
getSerperKey
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YY4HHPYV.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigStore
|
|
11
11
|
} from "./chunk-23T2XGSZ.js";
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
selectActiveBackgroundAgents,
|
|
14
14
|
useCliStore
|
|
15
15
|
} from "./chunk-TVW4ZESU.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-5VZSKEEG.js";
|
|
17
|
+
import "./chunk-5ZYPV3TT.js";
|
|
18
18
|
import {
|
|
19
19
|
BFLImageService,
|
|
20
20
|
BaseStorage,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
OpenAIBackend,
|
|
27
27
|
OpenAIImageService,
|
|
28
28
|
XAIImageService
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-JQOZTED2.js";
|
|
30
30
|
import {
|
|
31
31
|
AiEvents,
|
|
32
32
|
ApiKeyEvents,
|
|
@@ -13208,227 +13208,220 @@ var ServerLlmBackend = class {
|
|
|
13208
13208
|
logger.debug("[ServerLlmBackend] Request aborted before start");
|
|
13209
13209
|
return;
|
|
13210
13210
|
}
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
|
|
13233
|
-
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
|
|
13237
|
-
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
)
|
|
13245
|
-
|
|
13246
|
-
|
|
13247
|
-
reject(err);
|
|
13248
|
-
}).then(() => {
|
|
13249
|
-
logger.debug("[ServerLlmBackend] Callback completed, resolving");
|
|
13250
|
-
resolve3();
|
|
13251
|
-
});
|
|
13252
|
-
} else if (cleanedText) {
|
|
13253
|
-
callback([cleanedText], lastUsageInfo).catch((err) => {
|
|
13254
|
-
logger.error("[ServerLlmBackend] Callback error:", err);
|
|
13255
|
-
reject(err);
|
|
13256
|
-
}).then(() => resolve3());
|
|
13257
|
-
} else {
|
|
13258
|
-
resolve3();
|
|
13211
|
+
logger.debug("[ServerLlmBackend] Making streaming request...");
|
|
13212
|
+
let response;
|
|
13213
|
+
try {
|
|
13214
|
+
response = await this.makeStreamingRequest(model, messages, options);
|
|
13215
|
+
} catch (error) {
|
|
13216
|
+
if (options.abortSignal?.aborted) {
|
|
13217
|
+
logger.debug("[ServerLlmBackend] Request was aborted, resolving gracefully");
|
|
13218
|
+
return;
|
|
13219
|
+
}
|
|
13220
|
+
if (isAxiosError(error) && error.code === "ERR_CANCELED") {
|
|
13221
|
+
logger.debug("[ServerLlmBackend] Request was canceled, resolving gracefully");
|
|
13222
|
+
return;
|
|
13223
|
+
}
|
|
13224
|
+
logger.error("LLM completion failed", error);
|
|
13225
|
+
if (isAxiosError(error)) {
|
|
13226
|
+
logger.debug(
|
|
13227
|
+
`[ServerLlmBackend] Axios error details: ${JSON.stringify({
|
|
13228
|
+
status: error.response?.status,
|
|
13229
|
+
statusText: error.response?.statusText,
|
|
13230
|
+
url: error.config?.url,
|
|
13231
|
+
method: error.config?.method
|
|
13232
|
+
})}`
|
|
13233
|
+
);
|
|
13234
|
+
if (error.response?.status === 403 && error.response.data) {
|
|
13235
|
+
let errorDetails = "";
|
|
13236
|
+
try {
|
|
13237
|
+
let responseText = "";
|
|
13238
|
+
const stream = error.response.data;
|
|
13239
|
+
if (Buffer.isBuffer(stream)) {
|
|
13240
|
+
responseText = stream.toString("utf-8");
|
|
13241
|
+
} else if (stream?._readableState?.buffer?.length > 0) {
|
|
13242
|
+
const chunks = [];
|
|
13243
|
+
for (const chunk of stream._readableState.buffer) {
|
|
13244
|
+
if (chunk?.data) {
|
|
13245
|
+
chunks.push(Buffer.from(chunk.data));
|
|
13246
|
+
}
|
|
13259
13247
|
}
|
|
13260
|
-
|
|
13248
|
+
responseText = Buffer.concat(chunks).toString("utf-8");
|
|
13249
|
+
} else if (typeof stream === "string") {
|
|
13250
|
+
responseText = stream;
|
|
13261
13251
|
}
|
|
13262
|
-
|
|
13263
|
-
|
|
13264
|
-
|
|
13265
|
-
|
|
13266
|
-
|
|
13267
|
-
|
|
13252
|
+
logger.debug(`[ServerLlmBackend] Response preview: ${responseText.substring(0, 200)}`);
|
|
13253
|
+
if (responseText.includes("<!DOCTYPE") || responseText.includes("<html")) {
|
|
13254
|
+
const titleMatch = responseText.match(/<title>(.*?)<\/title>/i);
|
|
13255
|
+
const h1Match = responseText.match(/<h1>(.*?)<\/h1>/i);
|
|
13256
|
+
if (titleMatch && titleMatch[1] !== "Error") {
|
|
13257
|
+
errorDetails = titleMatch[1].trim();
|
|
13258
|
+
} else if (h1Match) {
|
|
13259
|
+
errorDetails = h1Match[1].trim();
|
|
13268
13260
|
}
|
|
13269
|
-
|
|
13270
|
-
|
|
13271
|
-
accumulatedText += textChunk;
|
|
13272
|
-
if (parsed.usage) {
|
|
13273
|
-
lastUsageInfo = {
|
|
13274
|
-
inputTokens: parsed.usage.inputTokens,
|
|
13275
|
-
outputTokens: parsed.usage.outputTokens
|
|
13276
|
-
};
|
|
13277
|
-
}
|
|
13278
|
-
streamLogger.onContent(eventCount, textChunk, accumulatedText);
|
|
13279
|
-
} else if (parsed.type === "tool_use") {
|
|
13280
|
-
streamLogger.onCriticalEvent(eventCount, "TOOL_USE", `tools: ${parsed.tools?.length}`);
|
|
13281
|
-
if (parsed.tools && parsed.tools.length > 0) {
|
|
13282
|
-
for (const tool of parsed.tools) {
|
|
13283
|
-
logger.debug(`TOOL REQUEST: ${tool.name}`);
|
|
13284
|
-
try {
|
|
13285
|
-
const paramsStr = JSON.stringify(tool.input);
|
|
13286
|
-
logger.debug(` Params: ${paramsStr}`);
|
|
13287
|
-
} catch {
|
|
13288
|
-
logger.debug(` Params: [Unable to stringify]`);
|
|
13289
|
-
}
|
|
13290
|
-
}
|
|
13291
|
-
}
|
|
13292
|
-
const textChunk = parsed.text || "";
|
|
13293
|
-
if (textChunk) {
|
|
13294
|
-
accumulatedText += textChunk;
|
|
13295
|
-
}
|
|
13296
|
-
if (parsed.tools && parsed.tools.length > 0) {
|
|
13297
|
-
toolsUsed = parsed.tools;
|
|
13298
|
-
}
|
|
13299
|
-
if (parsed.thinking && parsed.thinking.length > 0) {
|
|
13300
|
-
thinkingBlocks = parsed.thinking;
|
|
13301
|
-
streamLogger.onCriticalEvent(eventCount, "THINKING", `${thinkingBlocks.length} thinking blocks`);
|
|
13302
|
-
}
|
|
13303
|
-
if (parsed.usage) {
|
|
13304
|
-
lastUsageInfo = {
|
|
13305
|
-
inputTokens: parsed.usage.inputTokens,
|
|
13306
|
-
outputTokens: parsed.usage.outputTokens
|
|
13307
|
-
};
|
|
13308
|
-
}
|
|
13309
|
-
}
|
|
13310
|
-
} catch (parseError) {
|
|
13311
|
-
streamLogger.streamError(parseError);
|
|
13261
|
+
} else if (responseText) {
|
|
13262
|
+
errorDetails = responseText.substring(0, 100).trim();
|
|
13312
13263
|
}
|
|
13264
|
+
} catch (extractError) {
|
|
13265
|
+
logger.error("[ServerLlmBackend] Error extracting response:", extractError);
|
|
13313
13266
|
}
|
|
13314
|
-
|
|
13315
|
-
|
|
13316
|
-
const abortHandler = () => {
|
|
13317
|
-
logger.debug("[ServerLlmBackend] Abort signal received, destroying stream");
|
|
13318
|
-
response.data.destroy();
|
|
13319
|
-
resolve3();
|
|
13320
|
-
};
|
|
13321
|
-
if (options.abortSignal.aborted) {
|
|
13322
|
-
abortHandler();
|
|
13323
|
-
return;
|
|
13324
|
-
}
|
|
13325
|
-
options.abortSignal.addEventListener("abort", abortHandler, { once: true });
|
|
13326
|
-
response.data.on("close", () => {
|
|
13327
|
-
options.abortSignal?.removeEventListener("abort", abortHandler);
|
|
13328
|
-
});
|
|
13267
|
+
const errorMsg = errorDetails ? `403 Forbidden: ${errorDetails}` : "403 Forbidden - Request blocked by server. Check debug logs at ~/.bike4mind/debug/";
|
|
13268
|
+
throw new Error(errorMsg);
|
|
13329
13269
|
}
|
|
13330
|
-
|
|
13331
|
-
|
|
13332
|
-
|
|
13333
|
-
|
|
13334
|
-
parser.feed(chunk.toString());
|
|
13335
|
-
});
|
|
13336
|
-
response.data.on("end", () => {
|
|
13337
|
-
if (!receivedDone) {
|
|
13338
|
-
logger.debug("[ServerLlmBackend] Stream ended without [DONE], resolving anyway");
|
|
13339
|
-
resolve3();
|
|
13340
|
-
} else {
|
|
13341
|
-
logger.debug("[ServerLlmBackend] Stream ended, [DONE] handler will resolve");
|
|
13342
|
-
}
|
|
13343
|
-
});
|
|
13344
|
-
response.data.on("error", (error) => {
|
|
13345
|
-
if (options.abortSignal?.aborted) {
|
|
13346
|
-
resolve3();
|
|
13347
|
-
return;
|
|
13348
|
-
}
|
|
13349
|
-
reject(error);
|
|
13350
|
-
});
|
|
13351
|
-
} catch (error) {
|
|
13352
|
-
if (options.abortSignal?.aborted) {
|
|
13353
|
-
logger.debug("[ServerLlmBackend] Request was aborted, resolving gracefully");
|
|
13354
|
-
resolve3();
|
|
13355
|
-
return;
|
|
13270
|
+
if (error.response) {
|
|
13271
|
+
throw new Error(
|
|
13272
|
+
`Request failed with status ${error.response.status}: ${error.response.statusText || "Unknown error"}`
|
|
13273
|
+
);
|
|
13356
13274
|
}
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13275
|
+
}
|
|
13276
|
+
if (error instanceof Error) {
|
|
13277
|
+
if (error.message.includes("Authentication expired") || error.message.includes("Authentication failed")) {
|
|
13278
|
+
throw error;
|
|
13279
|
+
} else if (error.message.includes("ECONNREFUSED")) {
|
|
13280
|
+
throw new Error("Cannot connect to Bike4Mind server. Please check your internet connection.");
|
|
13281
|
+
} else if (error.message.includes("Rate limit exceeded")) {
|
|
13282
|
+
throw error;
|
|
13283
|
+
} else {
|
|
13284
|
+
throw new Error(`Failed to complete LLM request: ${error.message}`);
|
|
13361
13285
|
}
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
|
|
13382
|
-
|
|
13383
|
-
|
|
13286
|
+
} else {
|
|
13287
|
+
throw error;
|
|
13288
|
+
}
|
|
13289
|
+
}
|
|
13290
|
+
logger.debug("[ServerLlmBackend] Got response, setting up SSE parser");
|
|
13291
|
+
return new Promise((resolve3, reject) => {
|
|
13292
|
+
const isVerbose = process.env.B4M_VERBOSE === "1";
|
|
13293
|
+
const isUltraVerbose = process.env.B4M_DEBUG_STREAM === "1";
|
|
13294
|
+
const streamLogger = new StreamLogger(logger, "ServerLlmBackend", isVerbose, isUltraVerbose);
|
|
13295
|
+
streamLogger.streamStart();
|
|
13296
|
+
let eventCount = 0;
|
|
13297
|
+
let accumulatedText = "";
|
|
13298
|
+
let lastUsageInfo = {};
|
|
13299
|
+
let toolsUsed = [];
|
|
13300
|
+
let thinkingBlocks = [];
|
|
13301
|
+
let receivedDone = false;
|
|
13302
|
+
const parser = createParser({
|
|
13303
|
+
onEvent: (event) => {
|
|
13304
|
+
eventCount++;
|
|
13305
|
+
streamLogger.onEvent(eventCount, event.data || "");
|
|
13306
|
+
const data = event.data;
|
|
13307
|
+
if (data === "[DONE]") {
|
|
13308
|
+
receivedDone = true;
|
|
13309
|
+
streamLogger.onCriticalEvent(eventCount, "[DONE]", `accumulated text length: ${accumulatedText.length}`);
|
|
13310
|
+
const cleanedText = stripThinkingBlocks(accumulatedText);
|
|
13311
|
+
streamLogger.streamComplete(accumulatedText);
|
|
13312
|
+
if (toolsUsed.length > 0) {
|
|
13313
|
+
const info = {
|
|
13314
|
+
toolsUsed,
|
|
13315
|
+
thinking: thinkingBlocks.length > 0 ? thinkingBlocks : void 0,
|
|
13316
|
+
...lastUsageInfo
|
|
13317
|
+
};
|
|
13318
|
+
logger.debug(`[ServerLlmBackend] Calling callback with tools, thinking blocks: ${thinkingBlocks.length}`);
|
|
13319
|
+
callback([cleanedText], info).catch((err) => {
|
|
13320
|
+
logger.error("[ServerLlmBackend] Callback error:", err);
|
|
13321
|
+
reject(err);
|
|
13322
|
+
}).then(() => {
|
|
13323
|
+
logger.debug("[ServerLlmBackend] Callback completed, resolving");
|
|
13324
|
+
resolve3();
|
|
13325
|
+
});
|
|
13326
|
+
} else if (cleanedText) {
|
|
13327
|
+
callback([cleanedText], lastUsageInfo).catch((err) => {
|
|
13328
|
+
logger.error("[ServerLlmBackend] Callback error:", err);
|
|
13329
|
+
reject(err);
|
|
13330
|
+
}).then(() => resolve3());
|
|
13331
|
+
} else {
|
|
13332
|
+
resolve3();
|
|
13333
|
+
}
|
|
13334
|
+
return;
|
|
13335
|
+
}
|
|
13336
|
+
try {
|
|
13337
|
+
const parsed = JSON.parse(data);
|
|
13338
|
+
if (parsed.type === "error") {
|
|
13339
|
+
streamLogger.onCriticalEvent(eventCount, "ERROR", parsed.message || "Server error");
|
|
13340
|
+
reject(new Error(parsed.message || "Server error"));
|
|
13341
|
+
return;
|
|
13342
|
+
}
|
|
13343
|
+
if (parsed.type === "content") {
|
|
13344
|
+
const textChunk = parsed.text || "";
|
|
13345
|
+
accumulatedText += textChunk;
|
|
13346
|
+
if (parsed.usage) {
|
|
13347
|
+
lastUsageInfo = {
|
|
13348
|
+
inputTokens: parsed.usage.inputTokens,
|
|
13349
|
+
outputTokens: parsed.usage.outputTokens
|
|
13350
|
+
};
|
|
13351
|
+
}
|
|
13352
|
+
streamLogger.onContent(eventCount, textChunk, accumulatedText);
|
|
13353
|
+
} else if (parsed.type === "tool_use") {
|
|
13354
|
+
streamLogger.onCriticalEvent(eventCount, "TOOL_USE", `tools: ${parsed.tools?.length}`);
|
|
13355
|
+
if (parsed.tools && parsed.tools.length > 0) {
|
|
13356
|
+
for (const tool of parsed.tools) {
|
|
13357
|
+
logger.debug(`TOOL REQUEST: ${tool.name}`);
|
|
13358
|
+
try {
|
|
13359
|
+
const paramsStr = JSON.stringify(tool.input);
|
|
13360
|
+
logger.debug(` Params: ${paramsStr}`);
|
|
13361
|
+
} catch {
|
|
13362
|
+
logger.debug(` Params: [Unable to stringify]`);
|
|
13384
13363
|
}
|
|
13385
13364
|
}
|
|
13386
|
-
responseText = Buffer.concat(chunks).toString("utf-8");
|
|
13387
|
-
} else if (typeof stream === "string") {
|
|
13388
|
-
responseText = stream;
|
|
13389
13365
|
}
|
|
13390
|
-
|
|
13391
|
-
if (
|
|
13392
|
-
|
|
13393
|
-
|
|
13394
|
-
|
|
13395
|
-
|
|
13396
|
-
|
|
13397
|
-
|
|
13398
|
-
|
|
13399
|
-
|
|
13400
|
-
|
|
13366
|
+
const textChunk = parsed.text || "";
|
|
13367
|
+
if (textChunk) {
|
|
13368
|
+
accumulatedText += textChunk;
|
|
13369
|
+
}
|
|
13370
|
+
if (parsed.tools && parsed.tools.length > 0) {
|
|
13371
|
+
toolsUsed = parsed.tools;
|
|
13372
|
+
}
|
|
13373
|
+
if (parsed.thinking && parsed.thinking.length > 0) {
|
|
13374
|
+
thinkingBlocks = parsed.thinking;
|
|
13375
|
+
streamLogger.onCriticalEvent(eventCount, "THINKING", `${thinkingBlocks.length} thinking blocks`);
|
|
13376
|
+
}
|
|
13377
|
+
if (parsed.usage) {
|
|
13378
|
+
lastUsageInfo = {
|
|
13379
|
+
inputTokens: parsed.usage.inputTokens,
|
|
13380
|
+
outputTokens: parsed.usage.outputTokens
|
|
13381
|
+
};
|
|
13401
13382
|
}
|
|
13402
|
-
} catch (extractError) {
|
|
13403
|
-
logger.error("[ServerLlmBackend] Error extracting response:", extractError);
|
|
13404
13383
|
}
|
|
13405
|
-
|
|
13406
|
-
|
|
13407
|
-
return;
|
|
13408
|
-
}
|
|
13409
|
-
if (error.response) {
|
|
13410
|
-
reject(
|
|
13411
|
-
new Error(
|
|
13412
|
-
`Request failed with status ${error.response.status}: ${error.response.statusText || "Unknown error"}`
|
|
13413
|
-
)
|
|
13414
|
-
);
|
|
13415
|
-
return;
|
|
13384
|
+
} catch (parseError) {
|
|
13385
|
+
streamLogger.streamError(parseError);
|
|
13416
13386
|
}
|
|
13417
13387
|
}
|
|
13418
|
-
|
|
13419
|
-
|
|
13420
|
-
|
|
13421
|
-
|
|
13422
|
-
|
|
13423
|
-
|
|
13424
|
-
|
|
13425
|
-
|
|
13426
|
-
|
|
13427
|
-
|
|
13428
|
-
} else {
|
|
13429
|
-
reject(error);
|
|
13388
|
+
});
|
|
13389
|
+
if (options.abortSignal) {
|
|
13390
|
+
const abortHandler = () => {
|
|
13391
|
+
logger.debug("[ServerLlmBackend] Abort signal received, destroying stream");
|
|
13392
|
+
response.data.destroy();
|
|
13393
|
+
resolve3();
|
|
13394
|
+
};
|
|
13395
|
+
if (options.abortSignal.aborted) {
|
|
13396
|
+
abortHandler();
|
|
13397
|
+
return;
|
|
13430
13398
|
}
|
|
13399
|
+
options.abortSignal.addEventListener("abort", abortHandler, { once: true });
|
|
13400
|
+
response.data.on("close", () => {
|
|
13401
|
+
options.abortSignal?.removeEventListener("abort", abortHandler);
|
|
13402
|
+
});
|
|
13431
13403
|
}
|
|
13404
|
+
response.data.on("data", (chunk) => {
|
|
13405
|
+
if (options.abortSignal?.aborted) {
|
|
13406
|
+
return;
|
|
13407
|
+
}
|
|
13408
|
+
parser.feed(chunk.toString());
|
|
13409
|
+
});
|
|
13410
|
+
response.data.on("end", () => {
|
|
13411
|
+
if (!receivedDone) {
|
|
13412
|
+
logger.debug("[ServerLlmBackend] Stream ended without [DONE], resolving anyway");
|
|
13413
|
+
resolve3();
|
|
13414
|
+
} else {
|
|
13415
|
+
logger.debug("[ServerLlmBackend] Stream ended, [DONE] handler will resolve");
|
|
13416
|
+
}
|
|
13417
|
+
});
|
|
13418
|
+
response.data.on("error", (error) => {
|
|
13419
|
+
if (options.abortSignal?.aborted) {
|
|
13420
|
+
resolve3();
|
|
13421
|
+
return;
|
|
13422
|
+
}
|
|
13423
|
+
reject(error);
|
|
13424
|
+
});
|
|
13432
13425
|
});
|
|
13433
13426
|
}
|
|
13434
13427
|
/**
|
|
@@ -13690,7 +13683,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
|
|
|
13690
13683
|
// package.json
|
|
13691
13684
|
var package_default = {
|
|
13692
13685
|
name: "@bike4mind/cli",
|
|
13693
|
-
version: "0.2.28-
|
|
13686
|
+
version: "0.2.28-fix-cli-eslint-errors.18724+641cb1245",
|
|
13694
13687
|
type: "module",
|
|
13695
13688
|
description: "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
13696
13689
|
license: "UNLICENSED",
|
|
@@ -13798,10 +13791,10 @@ var package_default = {
|
|
|
13798
13791
|
},
|
|
13799
13792
|
devDependencies: {
|
|
13800
13793
|
"@bike4mind/agents": "0.1.0",
|
|
13801
|
-
"@bike4mind/common": "2.49.1-
|
|
13802
|
-
"@bike4mind/mcp": "1.28.3-
|
|
13803
|
-
"@bike4mind/services": "2.47.2-
|
|
13804
|
-
"@bike4mind/utils": "2.4.2-
|
|
13794
|
+
"@bike4mind/common": "2.49.1-fix-cli-eslint-errors.18724+641cb1245",
|
|
13795
|
+
"@bike4mind/mcp": "1.28.3-fix-cli-eslint-errors.18724+641cb1245",
|
|
13796
|
+
"@bike4mind/services": "2.47.2-fix-cli-eslint-errors.18724+641cb1245",
|
|
13797
|
+
"@bike4mind/utils": "2.4.2-fix-cli-eslint-errors.18724+641cb1245",
|
|
13805
13798
|
"@types/better-sqlite3": "^7.6.13",
|
|
13806
13799
|
"@types/diff": "^5.0.9",
|
|
13807
13800
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -13818,7 +13811,7 @@ var package_default = {
|
|
|
13818
13811
|
optionalDependencies: {
|
|
13819
13812
|
"@vscode/ripgrep": "^1.17.0"
|
|
13820
13813
|
},
|
|
13821
|
-
gitHead: "
|
|
13814
|
+
gitHead: "641cb12453dc4afc0bc5e0b3d373a0d0d11a1b0c"
|
|
13822
13815
|
};
|
|
13823
13816
|
|
|
13824
13817
|
// src/config/constants.ts
|
|
@@ -16598,7 +16591,7 @@ Custom Commands:
|
|
|
16598
16591
|
await performCleanup();
|
|
16599
16592
|
exit();
|
|
16600
16593
|
break;
|
|
16601
|
-
case "save":
|
|
16594
|
+
case "save": {
|
|
16602
16595
|
if (!state.session) {
|
|
16603
16596
|
console.log("No active session to save");
|
|
16604
16597
|
return;
|
|
@@ -16612,6 +16605,7 @@ Custom Commands:
|
|
|
16612
16605
|
await state.sessionStore.save(state.session);
|
|
16613
16606
|
console.log(`\u2705 Session saved as "${sessionName}"`);
|
|
16614
16607
|
break;
|
|
16608
|
+
}
|
|
16615
16609
|
case "sessions": {
|
|
16616
16610
|
const sessions = await state.sessionStore.list(20);
|
|
16617
16611
|
if (sessions.length === 0) {
|
|
@@ -16800,7 +16794,7 @@ Custom Commands:
|
|
|
16800
16794
|
}));
|
|
16801
16795
|
break;
|
|
16802
16796
|
}
|
|
16803
|
-
case "untrust":
|
|
16797
|
+
case "untrust": {
|
|
16804
16798
|
if (!state.permissionManager) {
|
|
16805
16799
|
console.log("Permission manager not initialized");
|
|
16806
16800
|
return;
|
|
@@ -16814,7 +16808,8 @@ Custom Commands:
|
|
|
16814
16808
|
await state.configStore.untrustTool(toolToUntrust);
|
|
16815
16809
|
console.log(`\u2705 Tool '${toolToUntrust}' removed from trusted list`);
|
|
16816
16810
|
break;
|
|
16817
|
-
|
|
16811
|
+
}
|
|
16812
|
+
case "trusted": {
|
|
16818
16813
|
if (!state.permissionManager) {
|
|
16819
16814
|
console.log("Permission manager not initialized");
|
|
16820
16815
|
return;
|
|
@@ -16828,6 +16823,7 @@ Custom Commands:
|
|
|
16828
16823
|
}
|
|
16829
16824
|
console.log("");
|
|
16830
16825
|
break;
|
|
16826
|
+
}
|
|
16831
16827
|
case "login":
|
|
16832
16828
|
setState((prev) => ({ ...prev, showLoginFlow: true }));
|
|
16833
16829
|
break;
|
|
@@ -16836,7 +16832,7 @@ Custom Commands:
|
|
|
16836
16832
|
await state.configStore.clearAuthTokens();
|
|
16837
16833
|
console.log("\u2705 Successfully logged out");
|
|
16838
16834
|
break;
|
|
16839
|
-
case "whoami":
|
|
16835
|
+
case "whoami": {
|
|
16840
16836
|
const authTokens = await state.configStore.getAuthTokens();
|
|
16841
16837
|
if (!authTokens) {
|
|
16842
16838
|
console.log("Not authenticated. Run /login to authenticate.");
|
|
@@ -16849,6 +16845,7 @@ Custom Commands:
|
|
|
16849
16845
|
console.log(`Expires: ${new Date(authTokens.expiresAt).toLocaleString()}`);
|
|
16850
16846
|
console.log("");
|
|
16851
16847
|
break;
|
|
16848
|
+
}
|
|
16852
16849
|
case "clear":
|
|
16853
16850
|
case "new": {
|
|
16854
16851
|
console.clear();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bike4mind/cli",
|
|
3
|
-
"version": "0.2.28-
|
|
3
|
+
"version": "0.2.28-fix-cli-eslint-errors.18724+641cb1245",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -108,10 +108,10 @@
|
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@bike4mind/agents": "0.1.0",
|
|
111
|
-
"@bike4mind/common": "2.49.1-
|
|
112
|
-
"@bike4mind/mcp": "1.28.3-
|
|
113
|
-
"@bike4mind/services": "2.47.2-
|
|
114
|
-
"@bike4mind/utils": "2.4.2-
|
|
111
|
+
"@bike4mind/common": "2.49.1-fix-cli-eslint-errors.18724+641cb1245",
|
|
112
|
+
"@bike4mind/mcp": "1.28.3-fix-cli-eslint-errors.18724+641cb1245",
|
|
113
|
+
"@bike4mind/services": "2.47.2-fix-cli-eslint-errors.18724+641cb1245",
|
|
114
|
+
"@bike4mind/utils": "2.4.2-fix-cli-eslint-errors.18724+641cb1245",
|
|
115
115
|
"@types/better-sqlite3": "^7.6.13",
|
|
116
116
|
"@types/diff": "^5.0.9",
|
|
117
117
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"optionalDependencies": {
|
|
129
129
|
"@vscode/ripgrep": "^1.17.0"
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "641cb12453dc4afc0bc5e0b3d373a0d0d11a1b0c"
|
|
132
132
|
}
|