@bike4mind/cli 0.2.68-fix-opus-isSlowModel-flags.21926 → 0.2.68-fix-sre-json-resilience.21935

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 { spawn } from "child_process";
3
3
  import path from "path";
4
- //#region ../../b4m-core/services/dist/bashExecute-CFg0Cl-k.mjs
4
+ //#region ../../b4m-core/services/dist/bashExecute-pYljpfPn.mjs
5
5
  const DEFAULT_TIMEOUT_MS = 6e4;
6
6
  const MAX_OUTPUT_SIZE = 100 * 1024;
7
7
  /**
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { i as version, n as fetchLatestVersion, r as forceCheckForUpdate } from "../updateChecker-Be4Tethj.mjs";
2
+ import { i as version, n as fetchLatestVersion, r as forceCheckForUpdate } from "../updateChecker-OX4Owcxh.mjs";
3
3
  import { execSync } from "child_process";
4
4
  import { constants, existsSync, promises } from "fs";
5
5
  import { homedir } from "os";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { I as isReadOnlyTool, L as ReActAgent, M as setWebSocketToolExecutor, P as buildCoreSystemPrompt, R as CustomCommandStore, S as getApiUrl, T as generateCliTools, V as SessionStore, _ as McpManager, a as createBackgroundAgentTools, c as AgentStore, f as ApiClient, g as ServerLlmBackend, h as WebSocketLlmBackend, i as createWriteTodosTool, l as SubagentOrchestrator, m as WebSocketConnectionManager, n as createFindDefinitionTool, o as BackgroundAgentManager, p as WebSocketToolExecutor, r as createTodoStore, s as createAgentDelegateTool, t as createGetFileStructureTool, u as createSkillTool, w as PermissionManager, x as loadContextFiles, z as CheckpointStore } from "../tools-CuOD_EmG.mjs";
2
+ import { I as isReadOnlyTool, L as ReActAgent, M as setWebSocketToolExecutor, P as buildCoreSystemPrompt, R as CustomCommandStore, S as getApiUrl, T as generateCliTools, V as SessionStore, _ as McpManager, a as createBackgroundAgentTools, c as AgentStore, f as ApiClient, g as ServerLlmBackend, h as WebSocketLlmBackend, i as createWriteTodosTool, l as SubagentOrchestrator, m as WebSocketConnectionManager, n as createFindDefinitionTool, o as BackgroundAgentManager, p as WebSocketToolExecutor, r as createTodoStore, s as createAgentDelegateTool, t as createGetFileStructureTool, u as createSkillTool, w as PermissionManager, x as loadContextFiles, z as CheckpointStore } from "../tools-DrTz2x6c.mjs";
3
3
  import { n as logger, t as ConfigStore } from "../ConfigStore-ChOlZu1G.mjs";
4
4
  import { t as DEFAULT_SANDBOX_CONFIG } from "../types-DBEjF9YS.mjs";
5
5
  import { t as createSandboxRuntime } from "../SandboxRuntimeAdapter-C1B4t20N.mjs";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { i as version, r as forceCheckForUpdate } from "../updateChecker-Be4Tethj.mjs";
2
+ import { i as version, r as forceCheckForUpdate } from "../updateChecker-OX4Owcxh.mjs";
3
3
  import { execSync } from "child_process";
4
4
  //#region src/commands/updateCommand.ts
5
5
  /**
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { t as assertPathAllowed } from "./pathValidation-B8P0stPW-n-OGhUWO.mjs";
2
+ import { t as assertPathAllowed } from "./pathValidation-CIytuhr3-Dt5dntLx.mjs";
3
3
  import { existsSync, promises } from "fs";
4
4
  import path from "path";
5
- //#region ../../b4m-core/services/dist/createFile-U1V-Ael_.mjs
5
+ //#region ../../b4m-core/services/dist/createFile-C1JoeuYh.mjs
6
6
  async function createFile(params, allowedDirectories) {
7
7
  const { path: filePath, content, createDirectories = true } = params;
8
8
  const resolvedPath = assertPathAllowed(filePath, allowedDirectories, "create");
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { t as assertPathAllowed } from "./pathValidation-B8P0stPW-n-OGhUWO.mjs";
2
+ import { t as assertPathAllowed } from "./pathValidation-CIytuhr3-Dt5dntLx.mjs";
3
3
  import { existsSync, promises, statSync } from "fs";
4
4
  import path from "path";
5
- //#region ../../b4m-core/services/dist/deleteFile-BFsQ8m7A.mjs
5
+ //#region ../../b4m-core/services/dist/deleteFile-BTberNGj.mjs
6
6
  async function deleteFile(params, allowedDirectories) {
7
7
  const { path: filePath, recursive = false } = params;
8
8
  const resolvedPath = assertPathAllowed(filePath, allowedDirectories, "delete");
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { n as isPathAllowed } from "./pathValidation-B8P0stPW-n-OGhUWO.mjs";
2
+ import { n as isPathAllowed } from "./pathValidation-CIytuhr3-Dt5dntLx.mjs";
3
3
  import path from "path";
4
4
  import { stat } from "fs/promises";
5
5
  import { glob } from "glob";
6
- //#region ../../b4m-core/services/dist/globFiles-Cm98oQml.mjs
6
+ //#region ../../b4m-core/services/dist/globFiles-Bez8QCbS.mjs
7
7
  const DEFAULT_IGNORE_PATTERNS = [
8
8
  "**/node_modules/**",
9
9
  "**/.git/**",
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
- import { n as isPathAllowed } from "./pathValidation-B8P0stPW-n-OGhUWO.mjs";
2
+ import { n as isPathAllowed } from "./pathValidation-CIytuhr3-Dt5dntLx.mjs";
3
3
  import { execFile, execFileSync } from "child_process";
4
4
  import { existsSync } from "fs";
5
5
  import path from "path";
6
6
  import { stat } from "fs/promises";
7
7
  import { promisify } from "util";
8
8
  import { createRequire } from "module";
9
- //#region ../../b4m-core/services/dist/grepSearch-Dqpkuj21.mjs
9
+ //#region ../../b4m-core/services/dist/grepSearch-DMuEcUSq.mjs
10
10
  const execFileAsync = promisify(execFile);
11
11
  const require = createRequire(import.meta.url);
12
12
  /** Cached ripgrep binary path after first resolution */
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { n as useCliStore, t as selectActiveBackgroundAgents } from "./store-Dw1nZX2Y.mjs";
3
- import { A as clearFeatureModuleTools, B as CommandHistoryStore, C as getEnvironmentName, D as DEFAULT_AGENT_MODEL, E as ALWAYS_DENIED_FOR_AGENTS, F as buildSkillsPromptSection, G as searchCommands, H as OAuthClient, I as isReadOnlyTool, J as searchFiles, K as mergeCommands, L as ReActAgent, M as setWebSocketToolExecutor, N as OllamaBackend, O as DEFAULT_MAX_ITERATIONS, P as buildCoreSystemPrompt, R as CustomCommandStore, S as getApiUrl, T as generateCliTools, U as hasFileReferences, V as SessionStore, W as processFileReferences, Y as warmFileCache, _ as McpManager, a as createBackgroundAgentTools, b as extractCompactInstructions, c as AgentStore, d as parseAgentConfig, f as ApiClient, g as ServerLlmBackend, h as WebSocketLlmBackend, i as createWriteTodosTool, j as registerFeatureModuleTools, k as DEFAULT_THOROUGHNESS, l as SubagentOrchestrator, m as WebSocketConnectionManager, n as createFindDefinitionTool, o as BackgroundAgentManager, p as WebSocketToolExecutor, q as formatFileSize, r as createTodoStore, s as createAgentDelegateTool, t as createGetFileStructureTool, u as createSkillTool, v as substituteArguments, w as PermissionManager, x as loadContextFiles, y as formatStep, z as CheckpointStore } from "./tools-CuOD_EmG.mjs";
3
+ import { A as clearFeatureModuleTools, B as CommandHistoryStore, C as getEnvironmentName, D as DEFAULT_AGENT_MODEL, E as ALWAYS_DENIED_FOR_AGENTS, F as buildSkillsPromptSection, G as searchCommands, H as OAuthClient, I as isReadOnlyTool, J as searchFiles, K as mergeCommands, L as ReActAgent, M as setWebSocketToolExecutor, N as OllamaBackend, O as DEFAULT_MAX_ITERATIONS, P as buildCoreSystemPrompt, R as CustomCommandStore, S as getApiUrl, T as generateCliTools, U as hasFileReferences, V as SessionStore, W as processFileReferences, Y as warmFileCache, _ as McpManager, a as createBackgroundAgentTools, b as extractCompactInstructions, c as AgentStore, d as parseAgentConfig, f as ApiClient, g as ServerLlmBackend, h as WebSocketLlmBackend, i as createWriteTodosTool, j as registerFeatureModuleTools, k as DEFAULT_THOROUGHNESS, l as SubagentOrchestrator, m as WebSocketConnectionManager, n as createFindDefinitionTool, o as BackgroundAgentManager, p as WebSocketToolExecutor, q as formatFileSize, r as createTodoStore, s as createAgentDelegateTool, t as createGetFileStructureTool, u as createSkillTool, v as substituteArguments, w as PermissionManager, x as loadContextFiles, y as formatStep, z as CheckpointStore } from "./tools-DrTz2x6c.mjs";
4
4
  import { Dt as validateNotebookPath$1, Et as validateJupyterKernelName, g as ChatModels, m as CREDIT_DEDUCT_TRANSACTION_TYPES, n as logger, t as ConfigStore } from "./ConfigStore-ChOlZu1G.mjs";
5
- import { i as version, t as checkForUpdate } from "./updateChecker-Be4Tethj.mjs";
5
+ import { i as version, t as checkForUpdate } from "./updateChecker-OX4Owcxh.mjs";
6
6
  import React, { useCallback, useEffect, useMemo, useReducer, useRef, useState } from "react";
7
7
  import { Box, Static, Text, render, useApp, useInput } from "ink";
8
8
  import { execSync } from "child_process";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { realpathSync } from "fs";
3
3
  import path from "path";
4
- //#region ../../b4m-core/services/dist/pathValidation-B8P0stPW.mjs
4
+ //#region ../../b4m-core/services/dist/pathValidation-CIytuhr3.mjs
5
5
  /**
6
6
  * Resolves a path to its canonical form, following symlinks.
7
7
  * If the path doesn't exist (e.g., file being created), resolves the
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { $ as RegInviteEvents, A as ImageGenerationUsageTransaction, B as OpenAIEmbeddingModel, C as FileEvents, Ct as isGPTImageModel, D as GenericCreditAddTransaction, E as GenerateImageToolCallSchema, F as KnowledgeType, G as ProjectEvents, H as Permission, I as LLMEvents, J as QuestMasterParamsSchema, K as PromptMetaZodSchema, L as MiscEvents, M as InboxEvents, N as InviteEvents, O as GenericCreditDeductTransaction, Ot as CollectionType, P as InviteType, Q as RechartsChartTypeList, R as ModalEvents, S as FeedbackEvents, St as getViewById, T as GEMINI_IMAGE_MODELS, Tt as sanitizeTelemetryError, U as PermissionDeniedError, V as OpenAIImageGenerationInput, W as ProfileEvents, X as RealtimeVoiceUsageTransaction, Y as REASONING_SUPPORTED_MODELS, Z as ReceivedCreditTransaction, _ as CompletionApiUsageTransaction, _t as VoyageAIEmbeddingModel, a as ApiKeyEvents, at as SpeechToTextModels, b as FIXED_TEMPERATURE_MODELS, bt as getDataLakeTags, c as AppFileEvents, ct as TagType, d as BFL_IMAGE_MODELS, dt as ToolUsageTransaction, et as ResearchModeParamsSchema, f as BFL_SAFETY_TOLERANCE, ft as TransferCreditTransaction, g as ChatModels, gt as VideoModels, h as ChatCompletionCreateInputSchema, ht as VideoGenerationUsageTransaction, i as AiEvents, it as SessionEvents, j as ImageModels, k as ImageEditUsageTransaction, l as ArtifactTypeSchema, lt as TaskScheduleHandler, mt as VIDEO_SIZE_CONSTRAINTS, n as logger, nt as ResearchTaskPeriodicFrequencyType, o as ApiKeyScope, ot as SubscriptionCreditTransaction, p as BedrockEmbeddingModel, pt as UiNavigationEvents, q as PurchaseTransaction, r as ALERT_THRESHOLDS, rt as ResearchTaskType, s as ApiKeyType, st as SupportedFabFileMimeTypes, t as ConfigStore, tt as ResearchTaskExecutionType, u as AuthEvents, ut as TextGenerationUsageTransaction, v as DashboardParamsSchema, vt as XAI_IMAGE_MODELS, w as FriendshipEvents, wt as resolveNavigationIntents, x as FavoriteDocumentType, xt as getMcpProviderMetadata, y as ElabsEvents, yt as b4mLLMTools, z as ModelBackend } from "./ConfigStore-ChOlZu1G.mjs";
3
- import { n as isPathAllowed, t as assertPathAllowed } from "./pathValidation-B8P0stPW-n-OGhUWO.mjs";
3
+ import { n as isPathAllowed, t as assertPathAllowed } from "./pathValidation-CIytuhr3-Dt5dntLx.mjs";
4
4
  import { execFile, execFileSync, spawn } from "child_process";
5
5
  import { createHash, randomBytes } from "crypto";
6
6
  import { existsSync, promises, readFileSync, readdirSync, rmSync, statSync, unlinkSync, writeFileSync } from "fs";
@@ -6235,6 +6235,60 @@ const webFetchTool = {
6235
6235
  })
6236
6236
  };
6237
6237
  //#endregion
6238
+ //#region ../../b4m-core/services/dist/jsonSanitize-NGoqEfny.mjs
6239
+ /**
6240
+ * Sanitize a JSON string by escaping control characters inside string literals.
6241
+ * LLMs sometimes return JSON with unescaped newlines/tabs inside string values,
6242
+ * which causes JSON.parse to fail with "Bad control character in string literal".
6243
+ *
6244
+ * Covers all U+0000–U+001F control characters per JSON RFC 8259.
6245
+ */
6246
+ function sanitizeJsonString(jsonStr) {
6247
+ let result = "";
6248
+ let inString = false;
6249
+ let i = 0;
6250
+ while (i < jsonStr.length) {
6251
+ const char = jsonStr[i];
6252
+ if (inString && char === "\\" && i + 1 < jsonStr.length) {
6253
+ result += char + jsonStr[i + 1];
6254
+ i += 2;
6255
+ continue;
6256
+ }
6257
+ if (char === "\"") {
6258
+ inString = !inString;
6259
+ result += char;
6260
+ i++;
6261
+ continue;
6262
+ }
6263
+ if (inString) {
6264
+ const code = char.charCodeAt(0);
6265
+ if (code >= 0 && code <= 31) switch (code) {
6266
+ case 8:
6267
+ result += "\\b";
6268
+ break;
6269
+ case 9:
6270
+ result += "\\t";
6271
+ break;
6272
+ case 10:
6273
+ result += "\\n";
6274
+ break;
6275
+ case 12:
6276
+ result += "\\f";
6277
+ break;
6278
+ case 13:
6279
+ result += "\\r";
6280
+ break;
6281
+ default:
6282
+ result += "\\u" + code.toString(16).padStart(4, "0");
6283
+ break;
6284
+ }
6285
+ else result += char;
6286
+ } else result += char;
6287
+ i++;
6288
+ }
6289
+ return result;
6290
+ }
6291
+ //#endregion
6238
6292
  //#region ../../b4m-core/quantum/dist/index.mjs
6239
6293
  const OperationSchema = z.object({
6240
6294
  jobId: z.number(),
@@ -8080,7 +8134,7 @@ No markdown, no explanation, no code blocks — just the raw JSON object.`;
8080
8134
  "Minimize: sum(error^2)"
8081
8135
  ].join("\n");
8082
8136
  //#endregion
8083
- //#region ../../b4m-core/services/dist/tools-Cfd2eXZL.mjs
8137
+ //#region ../../b4m-core/services/dist/tools-DbFIhlfY.mjs
8084
8138
  async function performDeepResearch(context, params, config) {
8085
8139
  const maxDepth = config.maxDepth || 7;
8086
8140
  const duration = config.duration || 4.5;
@@ -10121,45 +10175,6 @@ IMPORTANT:
10121
10175
  return prompt;
10122
10176
  }
10123
10177
  /**
10124
- * Sanitize a JSON string by escaping control characters inside string literals.
10125
- * LLMs sometimes return JSON with unescaped newlines/tabs inside string values,
10126
- * which causes JSON.parse to fail with "Bad control character in string literal".
10127
- */
10128
- function sanitizeJsonString(jsonStr) {
10129
- let result = "";
10130
- let inString = false;
10131
- let i = 0;
10132
- while (i < jsonStr.length) {
10133
- const char = jsonStr[i];
10134
- if (inString && char === "\\" && i + 1 < jsonStr.length) {
10135
- result += char + jsonStr[i + 1];
10136
- i += 2;
10137
- continue;
10138
- }
10139
- if (char === "\"") {
10140
- inString = !inString;
10141
- result += char;
10142
- i++;
10143
- continue;
10144
- }
10145
- if (inString) switch (char) {
10146
- case "\n":
10147
- result += "\\n";
10148
- break;
10149
- case "\r":
10150
- result += "\\r";
10151
- break;
10152
- case " ":
10153
- result += "\\t";
10154
- break;
10155
- default: result += char;
10156
- }
10157
- else result += char;
10158
- i++;
10159
- }
10160
- return result;
10161
- }
10162
- /**
10163
10178
  * Parse transformation result from LLM response
10164
10179
  */
10165
10180
  function parseTransformationResult(llmResponse) {
@@ -13021,7 +13036,7 @@ process.emitWarning = (warning, name) => {
13021
13036
  };
13022
13037
  process.emitWarning = originalEmitWarning;
13023
13038
  //#endregion
13024
- //#region ../../b4m-core/services/dist/askUserQuestion-Dqt6xswW.mjs
13039
+ //#region ../../b4m-core/services/dist/askUserQuestion-DyEMPAlD.mjs
13025
13040
  let _showUserQuestion = null;
13026
13041
  /**
13027
13042
  * Inject the CLI callback that displays the question UI.
@@ -16383,11 +16398,11 @@ function parseQuery(query) {
16383
16398
  */
16384
16399
  const getCliOnlyTools = async () => {
16385
16400
  const [{ createFileTool }, { globFilesTool }, { grepSearchTool }, { deleteFileTool }, { bashExecuteTool }] = await Promise.all([
16386
- import("./createFile-U1V-Ael_-CopqVv92.mjs"),
16387
- import("./globFiles-Cm98oQml-ThKah94n.mjs"),
16388
- import("./grepSearch-Dqpkuj21-Dmj3R-sE.mjs"),
16389
- import("./deleteFile-BFsQ8m7A-DKwEnD3s.mjs"),
16390
- import("./bashExecute-CFg0Cl-k-qZPbD_qK.mjs")
16401
+ import("./createFile-C1JoeuYh-LvIRJtxM.mjs"),
16402
+ import("./globFiles-Bez8QCbS-DyZsKEJB.mjs"),
16403
+ import("./grepSearch-DMuEcUSq-D3RsGLCg.mjs"),
16404
+ import("./deleteFile-BTberNGj-BpBvrcoC.mjs"),
16405
+ import("./bashExecute-pYljpfPn-Bsh-jb3S.mjs")
16391
16406
  ]);
16392
16407
  return {
16393
16408
  file_read: fileReadTool,
@@ -4,7 +4,7 @@ import { homedir } from "os";
4
4
  import path from "path";
5
5
  import axios from "axios";
6
6
  //#region package.json
7
- var version = "0.2.68-fix-opus-isSlowModel-flags.21926+c1d6e79d2";
7
+ var version = "0.2.68-fix-sre-json-resilience.21935+3323b0bc1";
8
8
  //#endregion
9
9
  //#region src/utils/updateChecker.ts
10
10
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.2.68-fix-opus-isSlowModel-flags.21926+c1d6e79d2",
3
+ "version": "0.2.68-fix-sre-json-resilience.21935+3323b0bc1",
4
4
  "type": "module",
5
5
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
6
6
  "license": "UNLICENSED",
@@ -115,11 +115,11 @@
115
115
  "zustand": "^4.5.4"
116
116
  },
117
117
  "devDependencies": {
118
- "@bike4mind/agents": "0.4.6-fix-opus-isSlowModel-flags.21926+c1d6e79d2",
119
- "@bike4mind/common": "2.76.2-fix-opus-isSlowModel-flags.21926+c1d6e79d2",
120
- "@bike4mind/mcp": "1.33.25-fix-opus-isSlowModel-flags.21926+c1d6e79d2",
121
- "@bike4mind/services": "2.70.2-fix-opus-isSlowModel-flags.21926+c1d6e79d2",
122
- "@bike4mind/utils": "2.16.7-fix-opus-isSlowModel-flags.21926+c1d6e79d2",
118
+ "@bike4mind/agents": "0.4.6-fix-sre-json-resilience.21935+3323b0bc1",
119
+ "@bike4mind/common": "2.76.2-fix-sre-json-resilience.21935+3323b0bc1",
120
+ "@bike4mind/mcp": "1.33.25-fix-sre-json-resilience.21935+3323b0bc1",
121
+ "@bike4mind/services": "2.70.2-fix-sre-json-resilience.21935+3323b0bc1",
122
+ "@bike4mind/utils": "2.16.7-fix-sre-json-resilience.21935+3323b0bc1",
123
123
  "@types/better-sqlite3": "^7.6.13",
124
124
  "@types/jsonwebtoken": "^9.0.4",
125
125
  "@types/node": "^22.9.0",
@@ -136,5 +136,5 @@
136
136
  "optionalDependencies": {
137
137
  "@vscode/ripgrep": "^1.17.1"
138
138
  },
139
- "gitHead": "c1d6e79d275c20cc36e32443c9213f04707f3654"
139
+ "gitHead": "3323b0bc139b70ab69227f3878dd49e87bff44d1"
140
140
  }