@bike4mind/cli 0.2.28-fix-cli-eslint-errors.18724 → 0.2.28-fix-edit-image.18726

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-F3HPUK2I.js";
4
+ } from "./chunk-H2YF5I6M.js";
5
5
 
6
6
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/artifactExtractor.js
7
7
  var ARTIFACT_TAG_REGEX = /<artifact\s+(.*?)>([\s\S]*?)<\/artifact>/gi;
@@ -6,12 +6,12 @@ import {
6
6
  getSettingsByNames,
7
7
  obfuscateApiKey,
8
8
  secureParameters
9
- } from "./chunk-JQOZTED2.js";
9
+ } from "./chunk-P4IZYP2A.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-F3HPUK2I.js";
14
+ } from "./chunk-H2YF5I6M.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
17
17
  import { z } from "zod";
@@ -4435,6 +4435,7 @@ var GenerateImageRequestBodySchema = GenerateImageIvokeParamsSchema.extend({
4435
4435
  var GenerateImageToolCallSchema = OpenAIImageGenerationInput.extend({
4436
4436
  safety_tolerance: z25.number().optional(),
4437
4437
  prompt_upsampling: z25.boolean().optional(),
4438
+ editModel: z25.string().optional(),
4438
4439
  output_format: z25.enum(["jpeg", "png"]).nullable().optional(),
4439
4440
  seed: z25.number().nullable().optional()
4440
4441
  }).omit({
@@ -15,7 +15,7 @@ import {
15
15
  dayjsConfig_default,
16
16
  extractSnippetMeta,
17
17
  settingsMap
18
- } from "./chunk-F3HPUK2I.js";
18
+ } from "./chunk-H2YF5I6M.js";
19
19
  import {
20
20
  Logger
21
21
  } from "./chunk-OCYRD7D6.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  BadRequestError,
4
4
  secureParameters
5
- } from "./chunk-JQOZTED2.js";
5
+ } from "./chunk-P4IZYP2A.js";
6
6
  import {
7
7
  CompletionApiUsageTransaction,
8
8
  GenericCreditDeductTransaction,
@@ -12,7 +12,7 @@ import {
12
12
  TextGenerationUsageTransaction,
13
13
  TransferCreditTransaction,
14
14
  VideoGenerationUsageTransaction
15
- } from "./chunk-F3HPUK2I.js";
15
+ } from "./chunk-H2YF5I6M.js";
16
16
 
17
17
  // ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
18
18
  import { z } from "zod";
@@ -7,11 +7,11 @@ import {
7
7
  getSettingsMap,
8
8
  getSettingsValue,
9
9
  secureParameters
10
- } from "./chunk-JQOZTED2.js";
10
+ } from "./chunk-P4IZYP2A.js";
11
11
  import {
12
12
  KnowledgeType,
13
13
  SupportedFabFileMimeTypes
14
- } from "./chunk-F3HPUK2I.js";
14
+ } from "./chunk-H2YF5I6M.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/fabFileService/create.js
17
17
  import { z } from "zod";
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  createFabFile,
4
4
  createFabFileSchema
5
- } from "./chunk-5ZYPV3TT.js";
6
- import "./chunk-JQOZTED2.js";
7
- import "./chunk-F3HPUK2I.js";
5
+ } from "./chunk-XSOK2XVG.js";
6
+ import "./chunk-P4IZYP2A.js";
7
+ import "./chunk-H2YF5I6M.js";
8
8
  import "./chunk-OCYRD7D6.js";
9
9
  export {
10
10
  createFabFile,
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  getEffectiveApiKey,
6
6
  getOpenWeatherKey,
7
7
  getSerperKey
8
- } from "./chunk-YY4HHPYV.js";
8
+ } from "./chunk-2MF6DCEP.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-5VZSKEEG.js";
17
- import "./chunk-5ZYPV3TT.js";
16
+ import "./chunk-XS6UHQOH.js";
17
+ import "./chunk-XSOK2XVG.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-JQOZTED2.js";
29
+ } from "./chunk-P4IZYP2A.js";
30
30
  import {
31
31
  AiEvents,
32
32
  ApiKeyEvents,
@@ -82,7 +82,7 @@ import {
82
82
  XAI_IMAGE_MODELS,
83
83
  b4mLLMTools,
84
84
  getMcpProviderMetadata
85
- } from "./chunk-F3HPUK2I.js";
85
+ } from "./chunk-H2YF5I6M.js";
86
86
  import {
87
87
  Logger
88
88
  } from "./chunk-OCYRD7D6.js";
@@ -13208,220 +13208,227 @@ var ServerLlmBackend = class {
13208
13208
  logger.debug("[ServerLlmBackend] Request aborted before start");
13209
13209
  return;
13210
13210
  }
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
- }
13247
- }
13248
- responseText = Buffer.concat(chunks).toString("utf-8");
13249
- } else if (typeof stream === "string") {
13250
- responseText = stream;
13251
- }
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();
13260
- }
13261
- } else if (responseText) {
13262
- errorDetails = responseText.substring(0, 100).trim();
13263
- }
13264
- } catch (extractError) {
13265
- logger.error("[ServerLlmBackend] Error extracting response:", extractError);
13266
- }
13267
- const errorMsg = errorDetails ? `403 Forbidden: ${errorDetails}` : "403 Forbidden - Request blocked by server. Check debug logs at ~/.bike4mind/debug/";
13268
- throw new Error(errorMsg);
13269
- }
13270
- if (error.response) {
13271
- throw new Error(
13272
- `Request failed with status ${error.response.status}: ${error.response.statusText || "Unknown error"}`
13273
- );
13274
- }
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}`);
13285
- }
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");
13211
+ return new Promise(async (resolve3, reject) => {
13212
+ try {
13213
+ logger.debug("[ServerLlmBackend] Making streaming request...");
13214
+ const response = await this.makeStreamingRequest(model, messages, options);
13215
+ logger.debug("[ServerLlmBackend] Got response, setting up SSE parser");
13216
+ const isVerbose = process.env.B4M_VERBOSE === "1";
13217
+ const isUltraVerbose = process.env.B4M_DEBUG_STREAM === "1";
13218
+ const streamLogger = new StreamLogger(logger, "ServerLlmBackend", isVerbose, isUltraVerbose);
13219
+ streamLogger.streamStart();
13220
+ let eventCount = 0;
13221
+ let accumulatedText = "";
13222
+ let lastUsageInfo = {};
13223
+ let toolsUsed = [];
13224
+ let thinkingBlocks = [];
13225
+ let receivedDone = false;
13226
+ const parser = createParser({
13227
+ onEvent: (event) => {
13228
+ eventCount++;
13229
+ streamLogger.onEvent(eventCount, event.data || "");
13230
+ const data = event.data;
13231
+ if (data === "[DONE]") {
13232
+ receivedDone = true;
13233
+ streamLogger.onCriticalEvent(eventCount, "[DONE]", `accumulated text length: ${accumulatedText.length}`);
13234
+ const cleanedText = stripThinkingBlocks(accumulatedText);
13235
+ streamLogger.streamComplete(accumulatedText);
13236
+ if (toolsUsed.length > 0) {
13237
+ const info = {
13238
+ toolsUsed,
13239
+ thinking: thinkingBlocks.length > 0 ? thinkingBlocks : void 0,
13240
+ ...lastUsageInfo
13241
+ };
13242
+ logger.debug(
13243
+ `[ServerLlmBackend] Calling callback with tools, thinking blocks: ${thinkingBlocks.length}`
13244
+ );
13245
+ callback([cleanedText], info).catch((err) => {
13246
+ logger.error("[ServerLlmBackend] Callback error:", err);
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 {
13324
13258
  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"));
13259
+ }
13341
13260
  return;
13342
13261
  }
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
- };
13262
+ try {
13263
+ const parsed = JSON.parse(data);
13264
+ if (parsed.type === "error") {
13265
+ streamLogger.onCriticalEvent(eventCount, "ERROR", parsed.message || "Server error");
13266
+ reject(new Error(parsed.message || "Server error"));
13267
+ return;
13351
13268
  }
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]`);
13269
+ if (parsed.type === "content") {
13270
+ const textChunk = parsed.text || "";
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
+ }
13363
13290
  }
13364
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
+ }
13365
13309
  }
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
- };
13382
- }
13310
+ } catch (parseError) {
13311
+ streamLogger.streamError(parseError);
13383
13312
  }
13384
- } catch (parseError) {
13385
- streamLogger.streamError(parseError);
13386
13313
  }
13314
+ });
13315
+ if (options.abortSignal) {
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
+ });
13387
13329
  }
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;
13398
- }
13399
- options.abortSignal.addEventListener("abort", abortHandler, { once: true });
13400
- response.data.on("close", () => {
13401
- options.abortSignal?.removeEventListener("abort", abortHandler);
13330
+ response.data.on("data", (chunk) => {
13331
+ if (options.abortSignal?.aborted) {
13332
+ return;
13333
+ }
13334
+ parser.feed(chunk.toString());
13402
13335
  });
13403
- }
13404
- response.data.on("data", (chunk) => {
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) {
13405
13352
  if (options.abortSignal?.aborted) {
13353
+ logger.debug("[ServerLlmBackend] Request was aborted, resolving gracefully");
13354
+ resolve3();
13406
13355
  return;
13407
13356
  }
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) {
13357
+ if (isAxiosError(error) && error.code === "ERR_CANCELED") {
13358
+ logger.debug("[ServerLlmBackend] Request was canceled, resolving gracefully");
13420
13359
  resolve3();
13421
13360
  return;
13422
13361
  }
13423
- reject(error);
13424
- });
13362
+ logger.error("LLM completion failed", error);
13363
+ if (isAxiosError(error)) {
13364
+ logger.debug(
13365
+ `[ServerLlmBackend] Axios error details: ${JSON.stringify({
13366
+ status: error.response?.status,
13367
+ statusText: error.response?.statusText,
13368
+ url: error.config?.url,
13369
+ method: error.config?.method
13370
+ })}`
13371
+ );
13372
+ if (error.response?.status === 403 && error.response.data) {
13373
+ let errorDetails = "";
13374
+ try {
13375
+ let responseText = "";
13376
+ const stream = error.response.data;
13377
+ if (Buffer.isBuffer(stream)) {
13378
+ responseText = stream.toString("utf-8");
13379
+ } else if (stream?._readableState?.buffer?.length > 0) {
13380
+ const chunks = [];
13381
+ for (const chunk of stream._readableState.buffer) {
13382
+ if (chunk?.data) {
13383
+ chunks.push(Buffer.from(chunk.data));
13384
+ }
13385
+ }
13386
+ responseText = Buffer.concat(chunks).toString("utf-8");
13387
+ } else if (typeof stream === "string") {
13388
+ responseText = stream;
13389
+ }
13390
+ logger.debug(`[ServerLlmBackend] Response preview: ${responseText.substring(0, 200)}`);
13391
+ if (responseText.includes("<!DOCTYPE") || responseText.includes("<html")) {
13392
+ const titleMatch = responseText.match(/<title>(.*?)<\/title>/i);
13393
+ const h1Match = responseText.match(/<h1>(.*?)<\/h1>/i);
13394
+ if (titleMatch && titleMatch[1] !== "Error") {
13395
+ errorDetails = titleMatch[1].trim();
13396
+ } else if (h1Match) {
13397
+ errorDetails = h1Match[1].trim();
13398
+ }
13399
+ } else if (responseText) {
13400
+ errorDetails = responseText.substring(0, 100).trim();
13401
+ }
13402
+ } catch (extractError) {
13403
+ logger.error("[ServerLlmBackend] Error extracting response:", extractError);
13404
+ }
13405
+ const errorMsg = errorDetails ? `403 Forbidden: ${errorDetails}` : "403 Forbidden - Request blocked by server. Check debug logs at ~/.bike4mind/debug/";
13406
+ reject(new Error(errorMsg));
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;
13416
+ }
13417
+ }
13418
+ if (error instanceof Error) {
13419
+ if (error.message.includes("Authentication expired") || error.message.includes("Authentication failed")) {
13420
+ reject(error);
13421
+ } else if (error.message.includes("ECONNREFUSED")) {
13422
+ reject(new Error("Cannot connect to Bike4Mind server. Please check your internet connection."));
13423
+ } else if (error.message.includes("Rate limit exceeded")) {
13424
+ reject(error);
13425
+ } else {
13426
+ reject(new Error(`Failed to complete LLM request: ${error.message}`));
13427
+ }
13428
+ } else {
13429
+ reject(error);
13430
+ }
13431
+ }
13425
13432
  });
13426
13433
  }
13427
13434
  /**
@@ -13683,7 +13690,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
13683
13690
  // package.json
13684
13691
  var package_default = {
13685
13692
  name: "@bike4mind/cli",
13686
- version: "0.2.28-fix-cli-eslint-errors.18724+641cb1245",
13693
+ version: "0.2.28-fix-edit-image.18726+d876e7db7",
13687
13694
  type: "module",
13688
13695
  description: "Interactive CLI tool for Bike4Mind with ReAct agents",
13689
13696
  license: "UNLICENSED",
@@ -13791,10 +13798,10 @@ var package_default = {
13791
13798
  },
13792
13799
  devDependencies: {
13793
13800
  "@bike4mind/agents": "0.1.0",
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",
13801
+ "@bike4mind/common": "2.49.1-fix-edit-image.18726+d876e7db7",
13802
+ "@bike4mind/mcp": "1.28.3-fix-edit-image.18726+d876e7db7",
13803
+ "@bike4mind/services": "2.47.2-fix-edit-image.18726+d876e7db7",
13804
+ "@bike4mind/utils": "2.4.2-fix-edit-image.18726+d876e7db7",
13798
13805
  "@types/better-sqlite3": "^7.6.13",
13799
13806
  "@types/diff": "^5.0.9",
13800
13807
  "@types/jsonwebtoken": "^9.0.4",
@@ -13811,7 +13818,7 @@ var package_default = {
13811
13818
  optionalDependencies: {
13812
13819
  "@vscode/ripgrep": "^1.17.0"
13813
13820
  },
13814
- gitHead: "641cb12453dc4afc0bc5e0b3d373a0d0d11a1b0c"
13821
+ gitHead: "d876e7db77f4521b8c6d8acd76a5d84bcc1cfc81"
13815
13822
  };
13816
13823
 
13817
13824
  // src/config/constants.ts
@@ -16591,7 +16598,7 @@ Custom Commands:
16591
16598
  await performCleanup();
16592
16599
  exit();
16593
16600
  break;
16594
- case "save": {
16601
+ case "save":
16595
16602
  if (!state.session) {
16596
16603
  console.log("No active session to save");
16597
16604
  return;
@@ -16605,7 +16612,6 @@ Custom Commands:
16605
16612
  await state.sessionStore.save(state.session);
16606
16613
  console.log(`\u2705 Session saved as "${sessionName}"`);
16607
16614
  break;
16608
- }
16609
16615
  case "sessions": {
16610
16616
  const sessions = await state.sessionStore.list(20);
16611
16617
  if (sessions.length === 0) {
@@ -16794,7 +16800,7 @@ Custom Commands:
16794
16800
  }));
16795
16801
  break;
16796
16802
  }
16797
- case "untrust": {
16803
+ case "untrust":
16798
16804
  if (!state.permissionManager) {
16799
16805
  console.log("Permission manager not initialized");
16800
16806
  return;
@@ -16808,8 +16814,7 @@ Custom Commands:
16808
16814
  await state.configStore.untrustTool(toolToUntrust);
16809
16815
  console.log(`\u2705 Tool '${toolToUntrust}' removed from trusted list`);
16810
16816
  break;
16811
- }
16812
- case "trusted": {
16817
+ case "trusted":
16813
16818
  if (!state.permissionManager) {
16814
16819
  console.log("Permission manager not initialized");
16815
16820
  return;
@@ -16823,7 +16828,6 @@ Custom Commands:
16823
16828
  }
16824
16829
  console.log("");
16825
16830
  break;
16826
- }
16827
16831
  case "login":
16828
16832
  setState((prev) => ({ ...prev, showLoginFlow: true }));
16829
16833
  break;
@@ -16832,7 +16836,7 @@ Custom Commands:
16832
16836
  await state.configStore.clearAuthTokens();
16833
16837
  console.log("\u2705 Successfully logged out");
16834
16838
  break;
16835
- case "whoami": {
16839
+ case "whoami":
16836
16840
  const authTokens = await state.configStore.getAuthTokens();
16837
16841
  if (!authTokens) {
16838
16842
  console.log("Not authenticated. Run /login to authenticate.");
@@ -16845,7 +16849,6 @@ Custom Commands:
16845
16849
  console.log(`Expires: ${new Date(authTokens.expiresAt).toLocaleString()}`);
16846
16850
  console.log("");
16847
16851
  break;
16848
- }
16849
16852
  case "clear":
16850
16853
  case "new": {
16851
16854
  console.clear();
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-F3HPUK2I.js";
4
+ } from "./chunk-H2YF5I6M.js";
5
5
 
6
6
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/llmMarkdownGenerator.js
7
7
  var DEFAULT_OPTIONS = {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-F3HPUK2I.js";
4
+ } from "./chunk-H2YF5I6M.js";
5
5
 
6
6
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/markdownGenerator.js
7
7
  var DEFAULT_OPTIONS = {
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  findMostSimilarMemento,
4
4
  getRelevantMementos
5
- } from "./chunk-YY4HHPYV.js";
6
- import "./chunk-JQOZTED2.js";
7
- import "./chunk-F3HPUK2I.js";
5
+ } from "./chunk-2MF6DCEP.js";
6
+ import "./chunk-P4IZYP2A.js";
7
+ import "./chunk-H2YF5I6M.js";
8
8
  import "./chunk-OCYRD7D6.js";
9
9
  export {
10
10
  findMostSimilarMemento,
@@ -333,7 +333,7 @@ import {
333
333
  validateReactArtifactV2,
334
334
  validateSvgArtifactV2,
335
335
  wikiMarkupToAdf
336
- } from "./chunk-F3HPUK2I.js";
336
+ } from "./chunk-H2YF5I6M.js";
337
337
  export {
338
338
  ALL_IMAGE_MODELS,
339
339
  ALL_IMAGE_SIZES,
@@ -133,8 +133,8 @@ import {
133
133
  validateMermaidSyntax,
134
134
  warmUpSettingsCache,
135
135
  withRetry
136
- } from "./chunk-JQOZTED2.js";
137
- import "./chunk-F3HPUK2I.js";
136
+ } from "./chunk-P4IZYP2A.js";
137
+ import "./chunk-H2YF5I6M.js";
138
138
  import {
139
139
  Logger,
140
140
  NotificationDeduplicator,
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  SubtractCreditsSchema,
4
4
  subtractCredits
5
- } from "./chunk-5VZSKEEG.js";
6
- import "./chunk-JQOZTED2.js";
7
- import "./chunk-F3HPUK2I.js";
5
+ } from "./chunk-XS6UHQOH.js";
6
+ import "./chunk-P4IZYP2A.js";
7
+ import "./chunk-H2YF5I6M.js";
8
8
  import "./chunk-OCYRD7D6.js";
9
9
  export {
10
10
  SubtractCreditsSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.2.28-fix-cli-eslint-errors.18724+641cb1245",
3
+ "version": "0.2.28-fix-edit-image.18726+d876e7db7",
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-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",
111
+ "@bike4mind/common": "2.49.1-fix-edit-image.18726+d876e7db7",
112
+ "@bike4mind/mcp": "1.28.3-fix-edit-image.18726+d876e7db7",
113
+ "@bike4mind/services": "2.47.2-fix-edit-image.18726+d876e7db7",
114
+ "@bike4mind/utils": "2.4.2-fix-edit-image.18726+d876e7db7",
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": "641cb12453dc4afc0bc5e0b3d373a0d0d11a1b0c"
131
+ "gitHead": "d876e7db77f4521b8c6d8acd76a5d84bcc1cfc81"
132
132
  }