@bike4mind/cli 3.3.0 → 3.4.0

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,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { At as splitEquals, C as htmlErrorTitle, J as McpServerName, K as LOCATION_MAP_LANGUAGE, Kt as APP_NAME, Ot as secureParameters, P as BedrockEmbeddingModel, Q as OpenAIEmbeddingModel, R as ChatModels, Rt as withRetry, S as isValidSessionId, St as isRetryableError, T as escapeArtifactBodyJson, Tt as obfuscateApiKey, X as NotFoundError, Z as OllamaEmbeddingModel, a as commandTextOf, at as SupportedFabFileMimeTypes, b as logger, ct as VoyageAIEmbeddingModel, et as PermissionDeniedError, gt as getMcpProviderMetadata, j as ApiKeyType, kt as signImageUrl, l as writePathOf, lt as WORK_ITEM_STATUSES, nt as SEARCH_RESULT_CARDS_LANGUAGE, o as isReadOnlyTool, ot as UnprocessableEntityError, qt as WEBSITE_URL, r as loadContextFiles, s as sandboxedCommandArg, ut as assertAuthOriginMatchesApiKey, vt as googleMapsSearchUrl, w as htmlFirstH1, x as SESSION_ID_PATTERN, xt as isPlaceholderImageSigningSecret } from "./ConfigStore-DUATzLxB.mjs";
2
+ import { $ as OllamaEmbeddingModel, At as secureParameters, Bt as withRetry, C as htmlErrorTitle, Ct as isPlaceholderImageSigningSecret, Dt as obfuscateApiKey, J as LOCATION_MAP_LANGUAGE, Jt as frontmatterHasSourceStamp, Mt as splitEquals, P as BedrockEmbeddingModel, Q as NotFoundError, R as ChatModels, S as isValidSessionId, T as escapeArtifactBodyJson, U as DecisionTextPartSchema, W as DecisionsRequestSchema, X as McpServerName, Xt as WEBSITE_URL, Yt as APP_NAME, a as commandTextOf, b as logger, bt as googleMapsSearchUrl, ct as UnprocessableEntityError, dt as WORK_ITEM_STATUSES, et as OpenAIEmbeddingModel, ft as assertAuthOriginMatchesApiKey, it as SEARCH_RESULT_CARDS_LANGUAGE, j as ApiKeyType, jt as signImageUrl, l as writePathOf, nt as PermissionDeniedError, o as isReadOnlyTool, r as loadContextFiles, s as sandboxedCommandArg, st as SupportedFabFileMimeTypes, ut as VoyageAIEmbeddingModel, vt as getMcpProviderMetadata, w as htmlFirstH1, wt as isRetryableError, x as SESSION_ID_PATTERN } from "./ConfigStore-CbVFLXMH.mjs";
3
3
  import { n as isPathAllowed, t as assertPathAllowed } from "./pathValidation-BRqf4HFX-CHwtwp3O.mjs";
4
4
  import { n as isTerminalShellStatus, t as getShellSessionManager } from "./ShellSessionManager-6o8KZzl1-vrbPAUTq.mjs";
5
- import { n as B4mStreamEndedError, r as createClient, t as B4mApiError } from "./dist-DPP7UmK9.mjs";
5
+ import { n as B4mStreamEndedError, r as createClient, t as B4mApiError } from "./dist-DlBq3wHu.mjs";
6
6
  import { createHash, randomBytes } from "crypto";
7
7
  import { existsSync, lstatSync, promises, readdirSync, realpathSync, rmSync, statSync } from "fs";
8
8
  import os, { homedir } from "os";
@@ -4181,7 +4181,7 @@ async function getModelForWrite(user, modelId, deps) {
4181
4181
  return isModelOwner(model, user) ? model : null;
4182
4182
  }
4183
4183
  //#endregion
4184
- //#region ../../b4m-core/services/dist/toolGenerators-BVxSjEv_.mjs
4184
+ //#region ../../b4m-core/services/dist/toolGenerators-Ce9EJurs.mjs
4185
4185
  const diceRoll = async (parameters) => {
4186
4186
  if (!parameters?.sides || !parameters?.times) throw new Error("Tool dice roll: Missing required parameters");
4187
4187
  return sum(times(parameters.times, () => random(1, parameters.sides))).toString();
@@ -4776,6 +4776,119 @@ const promptEnhancementTool = {
4776
4776
  }
4777
4777
  })
4778
4778
  };
4779
+ const DecisionToolRequestSchema = DecisionsRequestSchema.pick({
4780
+ input: true,
4781
+ questions: true,
4782
+ model: true
4783
+ }).extend({
4784
+ input: DecisionTextPartSchema.shape.text,
4785
+ model: DecisionsRequestSchema.shape.model.optional()
4786
+ });
4787
+ /**
4788
+ * Typed decision checks (predicate / choice / score) answered with calibrated probabilities,
4789
+ * without spending a generation turn. Execution is host-injected (see `ToolContext.decide`): the
4790
+ * runner, its credit hold and provider retry live in the app tier, so this tool only forwards.
4791
+ */
4792
+ const decideTool = {
4793
+ name: "decide",
4794
+ implementation: (context) => ({
4795
+ toolFn: async (value) => {
4796
+ const run = context.decide;
4797
+ if (!run) throw new Error("decide is not available on this surface");
4798
+ const { input, questions, model } = DecisionToolRequestSchema.parse(value);
4799
+ const result = await run({
4800
+ userId: context.userId,
4801
+ user: context.user,
4802
+ logger: context.logger,
4803
+ authOrigin: context.authOrigin,
4804
+ apiKeyId: context.apiKeyId,
4805
+ organizationId: context.organizationId,
4806
+ request: {
4807
+ model,
4808
+ input,
4809
+ questions
4810
+ }
4811
+ });
4812
+ return JSON.stringify({
4813
+ id: result.id,
4814
+ model: result.model,
4815
+ answers: result.answers
4816
+ });
4817
+ },
4818
+ toolSchema: {
4819
+ name: "decide",
4820
+ description: "Answer typed questions about text with calibrated probabilities: classify, route or score without spending a full answer. Types are predicate (probability), choice (probabilities over values) and score (probabilities over an ordered scale). Answers return in question order; a declined question is a `refusal`, not an error.",
4821
+ parameters: {
4822
+ type: "object",
4823
+ properties: {
4824
+ input: {
4825
+ type: "string",
4826
+ description: "Text to judge."
4827
+ },
4828
+ questions: {
4829
+ type: "array",
4830
+ description: "One to twenty, each judged independently.",
4831
+ items: {
4832
+ type: "object",
4833
+ properties: {
4834
+ type: {
4835
+ type: "string",
4836
+ enum: [
4837
+ "predicate",
4838
+ "choice",
4839
+ "score"
4840
+ ]
4841
+ },
4842
+ name: {
4843
+ type: "string",
4844
+ description: "Unique within the call."
4845
+ },
4846
+ instructions: {
4847
+ type: "string",
4848
+ description: "What to judge."
4849
+ },
4850
+ choices: {
4851
+ type: "array",
4852
+ description: "Required for `choice`.",
4853
+ items: {
4854
+ type: "object",
4855
+ properties: {
4856
+ value: { type: "string" },
4857
+ description: { type: "string" }
4858
+ },
4859
+ required: ["value"]
4860
+ }
4861
+ },
4862
+ levels: {
4863
+ type: "array",
4864
+ description: "Required for `score`: lowest first.",
4865
+ items: {
4866
+ type: "object",
4867
+ properties: {
4868
+ label: { type: "string" },
4869
+ description: { type: "string" }
4870
+ },
4871
+ required: ["label"]
4872
+ }
4873
+ }
4874
+ },
4875
+ required: [
4876
+ "type",
4877
+ "name",
4878
+ "instructions"
4879
+ ]
4880
+ }
4881
+ },
4882
+ model: {
4883
+ type: "string",
4884
+ description: "Optional model id; omit for the deployment default."
4885
+ }
4886
+ },
4887
+ required: ["input", "questions"]
4888
+ }
4889
+ }
4890
+ })
4891
+ };
4779
4892
  let _showUserQuestion = null;
4780
4893
  /**
4781
4894
  * Inject the CLI callback that displays the question UI.
@@ -4895,7 +5008,7 @@ const askUserQuestionTool = {
4895
5008
  * re-export them without pulling the full tool graph. `index.ts` re-exports them
4896
5009
  * so the server barrel's public API is unchanged.
4897
5010
  */
4898
- const generateTools = (userId, user, logger, { db, retrievalFilter, kbScope, inlinedAttachmentIds, attachedFileIds, fullyInlinedAttachmentIds, suppressLakeArms, sessionRetrievalTags, sessionReaderConsentDatalakeTags, sessionLakeScopeExplicit, sessionIncludeLibraryFiles, sessionPreauthorizedLakeIds, organizationId, authOrigin, apiKeyId, questId, numberCitables, getAbortSignal }, storage, imageGenerateStorage, statusUpdate, onStart, onFinish, llm, config, model, imageProcessorLambdaName, tools, allowedDirectories, entitlementKeys = [], sessionId, codeMinifier, availableModels, onToolLlmUsage) => {
5011
+ const generateTools = (userId, user, logger, { db, retrievalFilter, kbScope, inlinedAttachmentIds, attachedFileIds, fullyInlinedAttachmentIds, suppressLakeArms, sessionRetrievalTags, sessionReaderConsentDatalakeTags, sessionLakeScopeExplicit, sessionIncludeLibraryFiles, sessionPreauthorizedLakeIds, organizationId, authOrigin, apiKeyId, questId, numberCitables, decide, getAbortSignal }, storage, imageGenerateStorage, statusUpdate, onStart, onFinish, llm, config, model, imageProcessorLambdaName, tools, allowedDirectories, entitlementKeys = [], sessionId, codeMinifier, availableModels, onToolLlmUsage) => {
4899
5012
  assertAuthOriginMatchesApiKey(authOrigin, apiKeyId);
4900
5013
  const context = {
4901
5014
  userId,
@@ -4931,6 +5044,7 @@ const generateTools = (userId, user, logger, { db, retrievalFilter, kbScope, inl
4931
5044
  codeMinifier,
4932
5045
  availableModels,
4933
5046
  onToolLlmUsage,
5047
+ decide,
4934
5048
  getAbortSignal,
4935
5049
  numberCitables
4936
5050
  };
@@ -7127,7 +7241,8 @@ const cliSharedTools = {
7127
7241
  prompt_enhancement: promptEnhancementTool,
7128
7242
  weather_info: weatherTool,
7129
7243
  web_search: webSearchTool,
7130
- web_fetch: webFetchTool
7244
+ web_fetch: webFetchTool,
7245
+ decide: decideTool
7131
7246
  };
7132
7247
  /**
7133
7248
  * The 6 Lattice tool implementations as a resolvable map keyed by tool name.
@@ -7786,7 +7901,8 @@ var CustomCommandStore = class {
7786
7901
  */
7787
7902
  async loadCommandFile(filePath, source) {
7788
7903
  const filename = path.basename(filePath);
7789
- const commandName = filename.toLowerCase() === "skill.md" ? this.extractSkillName(filePath) : extractCommandName(filename);
7904
+ const isSkillFile = filename.toLowerCase() === "skill.md";
7905
+ const commandName = isSkillFile ? this.extractSkillName(filePath) : extractCommandName(filename);
7790
7906
  if (!commandName) {
7791
7907
  console.warn(`Invalid command filename: ${filename} (must end with .md and have valid name)`);
7792
7908
  return;
@@ -7795,7 +7911,12 @@ var CustomCommandStore = class {
7795
7911
  console.warn(`Ignoring project command "${commandName}": name is reserved (built-in or feature command)`);
7796
7912
  return;
7797
7913
  }
7798
- const command = parseCommandFile(await fs.readFile(filePath, "utf-8"), filePath, commandName, source);
7914
+ const fileContent = await fs.readFile(filePath, "utf-8");
7915
+ if (isSkillFile && frontmatterHasSourceStamp(fileContent)) {
7916
+ logger.debug(`Skipping ${filePath}: exported from Bike4Mind; the account skill is used instead`);
7917
+ return;
7918
+ }
7919
+ const command = parseCommandFile(fileContent, filePath, commandName, source);
7799
7920
  this.commands.set(commandName, command);
7800
7921
  }
7801
7922
  /**
@@ -12576,11 +12697,12 @@ function setWebSocketToolExecutor(executor) {
12576
12697
  const SERVER_TOOLS = [
12577
12698
  "weather_info",
12578
12699
  "web_search",
12579
- "web_fetch"
12700
+ "web_fetch",
12701
+ "decide"
12580
12702
  ];
12581
12703
  /**
12582
- * Server-side tools (weather, web_search, web_fetch) run on B4M's API with company keys; every
12583
- * other tool runs locally through the implementation its caller passes in.
12704
+ * Server-side tools (weather, web_search, web_fetch, decide) run on B4M's API with company keys;
12705
+ * every other tool runs locally through the implementation its caller passes in.
12584
12706
  */
12585
12707
  function isServerTool(toolName) {
12586
12708
  return SERVER_TOOLS.includes(toolName);
@@ -13491,7 +13613,7 @@ The user has cycled into plan mode (Shift+Tab). Plan mode restricts WRITING, not
13491
13613
  - \`get_file_structure\` — AST overview of a file
13492
13614
  - \`agent_delegate\` — delegate to read-only subagents (e.g. 'explore', 'plan')
13493
13615
  - \`ask_user_question\` — ask the user clarifying questions
13494
- - \`current_datetime\`, \`math_evaluate\`, \`web_search\`, \`web_fetch\` — also fine
13616
+ - \`current_datetime\`, \`math_evaluate\`, \`web_search\`, \`web_fetch\`, \`decide\` - also fine
13495
13617
 
13496
13618
  **Tools blocked in plan mode:**
13497
13619
  - \`bash_execute\`, \`edit_local_file\`, \`create_file\`, \`delete_file\` — and any other tool that mutates state.
@@ -14064,6 +14186,28 @@ const DEFAULT_AGENT_MODEL = ChatModels.CLAUDE_4_5_HAIKU;
14064
14186
  */
14065
14187
  const DEFAULT_THOROUGHNESS = "medium";
14066
14188
  //#endregion
14189
+ //#region src/utils/decisionModelProbe.ts
14190
+ const probeDecisionModels = async (apiClient) => {
14191
+ try {
14192
+ const body = await apiClient.get("/api/v1/decision-models");
14193
+ return Array.isArray(body?.models) && body.models.length > 0;
14194
+ } catch {
14195
+ logger.debug("[decide] Decision-model availability lookup failed; hiding the tool until the next build.");
14196
+ return false;
14197
+ }
14198
+ };
14199
+ let decisionModelsProbe;
14200
+ /**
14201
+ * Whether this deployment serves a decision model this caller can call. The CLI holds no key
14202
+ * table of its own - the server resolves the key - so one request is the only honest signal;
14203
+ * a failed probe hides the tool rather than offering one that would only 503. A yes is cached
14204
+ * for the process (keys rarely appear mid-run); a no is not, so a later build re-checks.
14205
+ */
14206
+ const hasDecisionModels = (apiClient) => decisionModelsProbe ??= probeDecisionModels(apiClient).then((available) => {
14207
+ if (!available) decisionModelsProbe = void 0;
14208
+ return available;
14209
+ });
14210
+ //#endregion
14067
14211
  //#region src/utils/toolsAdapter.ts
14068
14212
  /**
14069
14213
  * Simple CLI-friendly storage adapter
@@ -14251,7 +14395,7 @@ async function generateCliTools(userId, llm, model, permissionManager, showPermi
14251
14395
  },
14252
14396
  authOrigin: "session"
14253
14397
  };
14254
- const filteredB4mTools = Object.fromEntries([
14398
+ const enabledB4mToolNames = [
14255
14399
  "dice_roll",
14256
14400
  "math_evaluate",
14257
14401
  "current_datetime",
@@ -14259,7 +14403,11 @@ async function generateCliTools(userId, llm, model, permissionManager, showPermi
14259
14403
  "weather_info",
14260
14404
  "web_search",
14261
14405
  "web_fetch"
14262
- ].filter((name) => name in cliSharedTools).map((name) => [name, cliSharedTools[name]]));
14406
+ ];
14407
+ const normalizedAllowed = toolFilter?.allowedTools?.map(normalizeToolName);
14408
+ const normalizedDenied = toolFilter?.deniedTools?.map(normalizeToolName);
14409
+ if (!normalizedDenied?.includes("decide") && (!normalizedAllowed?.length || normalizedAllowed.includes("decide")) && await hasDecisionModels(apiClient)) enabledB4mToolNames.push("decide");
14410
+ const filteredB4mTools = Object.fromEntries(enabledB4mToolNames.filter((name) => name in cliSharedTools).map((name) => [name, cliSharedTools[name]]));
14263
14411
  const cliOnlyTools = await getCliOnlyTools();
14264
14412
  const tools_to_generate = {
14265
14413
  ...filteredB4mTools,
@@ -14283,17 +14431,12 @@ async function generateCliTools(userId, llm, model, permissionManager, showPermi
14283
14431
  checkpointStore
14284
14432
  };
14285
14433
  let tools = wrapTools(Object.values(toolsMap), wrapDeps);
14286
- if (toolFilter) {
14287
- const { allowedTools, deniedTools } = toolFilter;
14288
- const normalizedAllowed = allowedTools?.map(normalizeToolName);
14289
- const normalizedDenied = deniedTools?.map(normalizeToolName);
14290
- tools = tools.filter((tool) => {
14291
- const toolName = tool.toolSchema.name;
14292
- if (normalizedDenied && normalizedDenied.includes(toolName)) return false;
14293
- if (normalizedAllowed && normalizedAllowed.length > 0) return normalizedAllowed.includes(toolName);
14294
- return true;
14295
- });
14296
- }
14434
+ if (toolFilter) tools = tools.filter((tool) => {
14435
+ const toolName = tool.toolSchema.name;
14436
+ if (normalizedDenied && normalizedDenied.includes(toolName)) return false;
14437
+ if (normalizedAllowed && normalizedAllowed.length > 0) return normalizedAllowed.includes(toolName);
14438
+ return true;
14439
+ });
14297
14440
  return {
14298
14441
  tools,
14299
14442
  agentContext
@@ -22,6 +22,49 @@ import { homedir as homedir$1 } from "node:os";
22
22
  const APP_NAME = process.env.APP_NAME || "";
23
23
  const WEBSITE_URL = process.env.WEBSITE_URL || "";
24
24
  //#endregion
25
+ //#region ../../b4m-core/common/dist/skillMdSource-DL0mQJK_.mjs
26
+ /**
27
+ * The marker an exported SKILL.md carries so Bike4Mind can recognize its own exports. The B4M
28
+ * CLI/desktop loader (packages/cli CustomCommandStore) skips stamped files, and a future CLI sync
29
+ * keys off it to find files it owns - keep the `# Bike4Mind-Source: <url>` line format stable.
30
+ *
31
+ * Deliberately import-free so the stamp check never needs a YAML parser. skillMd.ts, which does need
32
+ * one, sits behind `@bike4mind/common/utils/skillMd` rather than the barrel the CLI imports.
33
+ */
34
+ const SKILL_MD_SOURCE_MARKER = "Bike4Mind-Source:";
35
+ /** Opening `---<lang>` fence, the frontmatter text, then the closing `---` line. */
36
+ const FRONTMATTER = /^---([^\r\n]*)\r?\n(?:([\s\S]*?)\r?\n)?---[ \t]*(?:\r?\n|$)/;
37
+ const SOURCE_LINE = new RegExp(`^[ \\t]*#[ \\t]*${SKILL_MD_SOURCE_MARKER}[ \\t]*(\\S*)`);
38
+ /** Splits a SKILL.md into its raw frontmatter and the rest; null when there is no closed fence. */
39
+ function splitSkillMdFrontmatter(text) {
40
+ if (text.charCodeAt(0) === 65279) text = text.slice(1);
41
+ const match = text.match(FRONTMATTER);
42
+ if (!match) return null;
43
+ return {
44
+ lang: match[1].trim().toLowerCase(),
45
+ frontmatter: match[2] ?? "",
46
+ rest: text.slice(match[0].length)
47
+ };
48
+ }
49
+ /** The source URL in the leading comment header, before any YAML data or scalar content. */
50
+ function readSkillMdSourceUrl(frontmatter) {
51
+ for (const line of frontmatter.split(/\r?\n/)) {
52
+ const trimmed = line.trim();
53
+ if (!trimmed) continue;
54
+ if (!trimmed.startsWith("#")) return void 0;
55
+ const match = line.match(SOURCE_LINE);
56
+ if (match) return match[1];
57
+ }
58
+ }
59
+ /**
60
+ * True when the file's frontmatter carries the source stamp. Reads the raw fence text because the
61
+ * stamp is a YAML comment, which every YAML parser (gray-matter included) discards.
62
+ */
63
+ function frontmatterHasSourceStamp(text) {
64
+ const split = splitSkillMdFrontmatter(text);
65
+ return !!split && readSkillMdSourceUrl(split.frontmatter) !== void 0;
66
+ }
67
+ //#endregion
25
68
  //#region ../../b4m-core/hearth/dist/index.mjs
26
69
  /**
27
70
  * Zod validation for data crossing the Hearth boundary (API routes, CLI
@@ -354,6 +397,7 @@ const b4mLLMTools = z$1.enum([
354
397
  "retrieve_knowledge_content",
355
398
  "count_knowledge_base",
356
399
  "describe_knowledge_base",
400
+ "decide",
357
401
  "list_my_data_lakes",
358
402
  "create_data_lake",
359
403
  "save_content_to_data_lake",
@@ -2992,6 +3036,7 @@ z$1.object({
2992
3036
  }).optional(),
2993
3037
  backfilled: z$1.boolean().optional()
2994
3038
  });
3039
+ z$1.string({ error: "A reason is required" }).trim().min(5, `A reason of at least 5 characters is required`).max(500);
2995
3040
  z$1.object({
2996
3041
  category: AdminAuditCategorySchema.optional(),
2997
3042
  severity: AdminAuditSeveritySchema.optional(),
@@ -5431,8 +5476,9 @@ const ScopeForbiddenErrorSchema = ApiErrorSchema.extend({
5431
5476
  also_required_scopes: z$1.array(z$1.string()).optional().describe("API key scopes this route also requires. Every one must be held, on top of `required_scopes`.")
5432
5477
  });
5433
5478
  /**
5434
- * 403 on the v1 media create routes: the scope refusal above, or an organization-billed API key sent with
5435
- * another billing organization (apps/client/server/billing/resolveMediaBillingOrgId.ts).
5479
+ * 403 on the v1 media create routes and POST /api/v1/agent-executions: the scope refusal above, or an
5480
+ * organization-billed API key sent with another billing organization
5481
+ * (apps/client/server/billing/resolveMediaBillingOrgId.ts).
5436
5482
  */
5437
5483
  const BillingOrganizationForbiddenErrorSchema = ScopeForbiddenErrorSchema.extend({ errorCode: z$1.literal(BILLING_ORGANIZATION_MISMATCH_ERROR_CODE).optional() });
5438
5484
  const supportedVoiceGenerationVendor = z.enum(["openai", "elevenlabs"]);
@@ -13476,6 +13522,16 @@ const PermissionRequestAction = z$1.object({
13476
13522
  */
13477
13523
  toolCallId: z$1.string().optional()
13478
13524
  });
13525
+ const ConfidenceGateAction = z$1.object({
13526
+ action: z$1.literal("confidence_gate"),
13527
+ executionId: z$1.string(),
13528
+ /** 0-indexed wire convention, matching `permission_request` and `IterationStream`. */
13529
+ iteration: z$1.number(),
13530
+ /** 0..1, the agent's reported confidence for the paused iteration. */
13531
+ confidence: z$1.number(),
13532
+ /** Pre-formatted server copy, e.g. "Iteration confidence 42% below threshold 60%". */
13533
+ reason: z$1.string()
13534
+ });
13479
13535
  const ChildExecutionSnapshotSchema = z$1.lazy(() => z$1.object({
13480
13536
  executionId: z$1.string(),
13481
13537
  agentName: z$1.string(),
@@ -13490,6 +13546,7 @@ const ChildExecutionSnapshotSchema = z$1.lazy(() => z$1.object({
13490
13546
  }));
13491
13547
  const ReconnectResultAction = z$1.object({
13492
13548
  action: z$1.literal("reconnect_result"),
13549
+ requestId: z$1.string().optional(),
13493
13550
  found: z$1.boolean(),
13494
13551
  executionId: z$1.string().optional(),
13495
13552
  sessionId: z$1.string().optional(),
@@ -13500,6 +13557,13 @@ const ReconnectResultAction = z$1.object({
13500
13557
  requestedAt: z$1.union([z$1.string(), z$1.date()]),
13501
13558
  toolCallId: z$1.string().optional()
13502
13559
  }).optional(),
13560
+ pendingGate: z$1.object({
13561
+ /** 0-indexed wire convention, matching `ConfidenceGateAction` and `IterationStream`. */
13562
+ iteration: z$1.number(),
13563
+ confidence: z$1.number(),
13564
+ reason: z$1.string(),
13565
+ requestedAt: z$1.union([z$1.string(), z$1.date()])
13566
+ }).optional(),
13503
13567
  totalCreditsUsed: z$1.number().optional(),
13504
13568
  iterationCount: z$1.number().optional(),
13505
13569
  steps: z$1.array(AgentStepSchema).optional(),
@@ -13591,6 +13655,7 @@ z$1.discriminatedUnion("action", [
13591
13655
  SubagentFailedAction,
13592
13656
  SubagentProgressAction,
13593
13657
  PermissionRequestAction,
13658
+ ConfidenceGateAction,
13594
13659
  ReconnectResultAction
13595
13660
  ]);
13596
13661
  const FLEET_USAGE_MAX_ROWS = 1e4;
@@ -13708,11 +13773,7 @@ const AgentExecutionStartRequestSchema = z$1.object({
13708
13773
  * is what reproduces the product UI's Agent Mode toggle.
13709
13774
  */
13710
13775
  agent_id: z$1.string().optional(),
13711
- /**
13712
- * Bill this run to an organization's credit pool. The caller must belong to it; a
13713
- * non-member gets 404. Omit to bill the caller personally.
13714
- */
13715
- organization_id: z$1.string().optional(),
13776
+ organization_id: z$1.string().optional().describe("The organization whose credit pool pays for this run. You must belong to it; a non-member gets 404. Omit it to bill your personal credits. An organization-billed API key always bills its own organization: omit this or set it to the key's; any other value is a 403 (`errorCode: billing_organization_mismatch`)."),
13716
13777
  /**
13717
13778
  * Tool-id allowlist for the run. Omit to use the resolved profile's own list.
13718
13779
  *
@@ -13839,7 +13900,8 @@ const ToolExecutionRequestSchema = z$1.object({
13839
13900
  toolName: z$1.enum([
13840
13901
  "weather_info",
13841
13902
  "web_search",
13842
- "web_fetch"
13903
+ "web_fetch",
13904
+ "decide"
13843
13905
  ]),
13844
13906
  input: z$1.record(z$1.string(), z$1.unknown())
13845
13907
  });
@@ -15281,6 +15343,86 @@ z$2.object({
15281
15343
  success: z$2.literal(true),
15282
15344
  plan: questMasterPlanResponseSchema
15283
15345
  }).extend({ metrics: passthroughField });
15346
+ /** A lake document as returned by the SPA data-lake routes (editor document or reader projection). */
15347
+ const dataLakeResponseSchema = z$2.object(passthroughShape({
15348
+ id: true,
15349
+ createdAt: true,
15350
+ updatedAt: true,
15351
+ name: true,
15352
+ slug: true,
15353
+ description: true,
15354
+ systemPrompt: true,
15355
+ injectPromptForReaders: true,
15356
+ preferredSystemPromptId: true,
15357
+ groundingMode: true,
15358
+ requiredPassageTokenTarget: true,
15359
+ inconsistencyReport: true,
15360
+ inconsistencyComputedAt: true,
15361
+ lastInconsistencyScanAt: true,
15362
+ fileTagPrefix: true,
15363
+ datalakeTag: true,
15364
+ requiredUserTag: true,
15365
+ requiredEntitlement: true,
15366
+ createdByUserId: true,
15367
+ lastUpdatedByUserId: true,
15368
+ organizationId: true,
15369
+ isPublic: true,
15370
+ auditQueryTextEnabled: true,
15371
+ status: true,
15372
+ fileCount: true,
15373
+ totalSizeBytes: true,
15374
+ totalChunkedChars: true,
15375
+ embeddingSpendMicroUsd: true,
15376
+ lastSyncAt: true,
15377
+ lastHealthCheckedAt: true,
15378
+ filesDeletedAt: true,
15379
+ filesArchivedAt: true,
15380
+ purgeClaimId: true,
15381
+ purgeStartedAt: true,
15382
+ lakeMemoryEnabled: true,
15383
+ lakeMemoryExtractionAt: true,
15384
+ lakeMemoryCursor: true,
15385
+ lakeMemoryPurgedAt: true,
15386
+ origin: true,
15387
+ pendingConnector: true,
15388
+ modelInconsistencyRunAt: true
15389
+ }));
15390
+ z$2.object({ data: z$2.array(dataLakeResponseSchema) });
15391
+ z$2.object({ data: z$2.array(z$2.object(passthroughShape({
15392
+ id: true,
15393
+ slug: true,
15394
+ name: true,
15395
+ requiredUserTag: true,
15396
+ requiredEntitlement: true,
15397
+ fileTagPrefix: true,
15398
+ datalakeTag: true,
15399
+ organizationId: true,
15400
+ description: true,
15401
+ isPublic: true,
15402
+ lakeMemoryEnabled: true,
15403
+ injectPromptForReaders: true,
15404
+ canManage: true,
15405
+ status: true,
15406
+ origin: true,
15407
+ systemPrompt: true,
15408
+ requiredPassageTokenTarget: true,
15409
+ isOwn: true,
15410
+ isCreator: true,
15411
+ canPreauthorize: true,
15412
+ ownerDisplayName: true,
15413
+ ownerUserId: true,
15414
+ ownerUsername: true,
15415
+ preferredSystemPromptId: true,
15416
+ pendingProposalCount: true,
15417
+ groundingMode: true,
15418
+ pendingConnector: true,
15419
+ hasGitHubConnection: true,
15420
+ embeddingSpendMicroUsd: true,
15421
+ canRebuild: true,
15422
+ canManageSettings: true,
15423
+ canManageMemory: true,
15424
+ retrievable: true
15425
+ }))) });
15284
15426
  z$1.preprocess((val) => {
15285
15427
  if (typeof val === "string") {
15286
15428
  if (val.toLowerCase() === "true") return true;
@@ -15652,6 +15794,7 @@ const CORE_TOOL_SIDE_EFFECTS = {
15652
15794
  fmp_financial_data: "none",
15653
15795
  bob_panel_read: "none",
15654
15796
  skill: "none",
15797
+ decide: "none",
15655
15798
  recharts: "local",
15656
15799
  mermaid_chart: "local",
15657
15800
  navigate_view: "local",
@@ -17388,9 +17531,13 @@ defineEndpoint({
17388
17531
  schema: AgentExecutionAckSchema
17389
17532
  },
17390
17533
  400: {
17391
- description: "No usable default chat model is configured and none was supplied.",
17534
+ description: `No usable default chat model is configured and none was supplied. ${BILLING_ORGANIZATION_STALE_KEY_DESCRIPTION}`,
17392
17535
  schema: ApiErrorSchema
17393
17536
  },
17537
+ 403: {
17538
+ description: `The API key holds neither the \`ai:chat\` nor the \`ai:generate\` scope, or an organization-billed API key names any organization but its own (\`errorCode: ${BILLING_ORGANIZATION_MISMATCH_ERROR_CODE}\`).`,
17539
+ schema: BillingOrganizationForbiddenErrorSchema
17540
+ },
17394
17541
  404: {
17395
17542
  description: "No session with the given `session_id` is owned by the caller, or `organization_id` names an organization the caller does not belong to. \"Exists but is not yours\" is reported as 404 too, so neither session ids nor org membership can be probed through this endpoint.",
17396
17543
  schema: ApiErrorSchema
@@ -17600,7 +17747,7 @@ defineEndpoint({
17600
17747
  path: "/api/ai/v1/tools",
17601
17748
  operationId: "executeTool",
17602
17749
  summary: "Execute a server-side tool",
17603
- description: "Runs one of the built-in server-side tools (`weather_info`, `web_search`, `web_fetch`) and returns its result as JSON. Authenticate with a JWT access token only - API keys are NOT accepted on this endpoint. Rate-limited to 100 requests/hour per user, counted separately from other endpoints. `request_id` echoes the X-Request-ID response header.",
17750
+ description: "Runs one of the built-in server-side tools (`weather_info`, `web_search`, `web_fetch`, `decide`) and returns its result as JSON. Authenticate with a JWT access token only - API keys are NOT accepted on this endpoint. Rate-limited to 100 requests/hour per user, counted separately from other endpoints. `request_id` echoes the X-Request-ID response header.",
17604
17751
  tags: ["AI"],
17605
17752
  auth: "jwtOnly",
17606
17753
  request: ToolExecutionRequestSchema,
@@ -24298,6 +24445,7 @@ const CORE_TOOL_DESCRIPTORS = new Map(Object.entries({
24298
24445
  weather_info: reader(CORE, { openWorld: true }),
24299
24446
  web_search: reader(CORE, { openWorld: true }),
24300
24447
  web_fetch: reader(CORE, { openWorld: true }),
24448
+ decide: reader(CORE, { openWorld: true }),
24301
24449
  deep_research: reader(CORE, { openWorld: true }),
24302
24450
  check_shell_output: reader(),
24303
24451
  list_background_shells: reader(),
@@ -25867,4 +26015,4 @@ var ConfigStore = class {
25867
26015
  }
25868
26016
  };
25869
26017
  //#endregion
25870
- export { PROMPT_TEXT_MAX as $, ARTIFACT_REMOVED_PLACEHOLDER as A, splitEquals as At, CreateArtifactRequestSchema as B, DELEGATION_PAYLOAD_SCHEMA_NAME as Bt, htmlErrorTitle as C, isUserInitiatedAbort as Ct, AGENT_QUEST_MANIFEST as D, replacePromptVariables as Dt, AGENT_QUEST_ID as E, questReplyText as Et, BriefcasePromptIdSchema as F, ttsBase64ResponseSchema as Ft, ImagePromptResolutionSchema as G, selfClaimedActorKindSchema as Gt, DEGENERATE_FINISH_REASON as H, actorKindMarker as Ht, CONTEXT_WINDOW_SAFETY_BUFFER_TOKENS as I, ttsRequestSchema as It, McpServerName as J, LOCATION_MAP_LANGUAGE as K, APP_NAME as Kt, CREDIT_DEDUCT_TRANSACTION_TYPES as L, ttsResponseTooLargeSchema as Lt, ArtifactTypeSchema as M, stripToolArtifactMarkup as Mt, BRIEFCASE_CATALOG_QUERIES as N, supportedVoiceGenerationVendor as Nt, AGENT_QUEST_MCP_URI as O, secureParameters as Ot, BedrockEmbeddingModel as P, tokenEstimateMultiplier as Pt, OpenAIEmbeddingModel as Q, ChatModels as R, withRetry as Rt, isValidSessionId as S, isRetryableError as St, escapeArtifactBodyJson as T, obfuscateApiKey as Tt, GENERATED_IMAGE_EXTENSION_RE as U, actorKindSchema as Ut, DEFAULT_TTS_PROVIDER as V, actorColorIndex as Vt, ImageModels as W, delegationPayloadSchema as Wt, NotFoundError as X, ModelBackend as Y, OllamaEmbeddingModel as Z, LOCAL_DEV_URL as _, getQuestErrorCode as _t, commandTextOf as a, SupportedFabFileMimeTypes as at, logger as b, isEarlyStop as bt, toolCategory as c, VoyageAIEmbeddingModel as ct, getCreditsUrl as d, buildPromptContext as dt, PermissionDeniedError as et, getEnvironmentName as f, createThinkMarkerEscaper as ft, DeviceFlowClient as g, getMcpProviderMetadata as gt, AuthenticatedApiClient as h, generatedAudioResponseSchema as ht, ToolCatalog as i, SUBQUEST_STATUS_VALUES as it, ApiKeyType as j, stripDeliveredArtifactBlocks as jt, ARTIFACT_DELIVERED_PLACEHOLDER as k, signImageUrl as kt, writePathOf as l, WORK_ITEM_STATUSES as lt, resolveApiEndpoint as m, filterToolArtifactMarkup as mt, extractCompactInstructions as n, SEARCH_RESULT_CARDS_LANGUAGE as nt, isReadOnlyTool as o, UnprocessableEntityError as ot, requireApiUrl as p, escapeThinkMarkers as pt, MODEL_INFO_FIELD_GROUP_OF as q, WEBSITE_URL as qt, loadContextFiles as r, SLUG_OWNED_BY_OTHER as rt, sandboxedCommandArg as s, VisibilitySchema as st, ConfigStore as t, REVIEW_GATE_STATUS_VALUES as tt, ApiEndpointUnconfiguredError as u, assertAuthOriginMatchesApiKey as ut, NotAuthenticatedError as v, googleMapsSearchUrl as vt, htmlFirstH1 as w, joinReplySlots as wt, SESSION_ID_PATTERN as x, isPlaceholderImageSigningSecret as xt, parseApiUrl as y, hasDeliverablePinnedArtifact as yt, CompletionReasoningEffortSchema as z, ACTOR_COLOR_SLOTS as zt };
26018
+ export { OllamaEmbeddingModel as $, ARTIFACT_REMOVED_PLACEHOLDER as A, secureParameters as At, CreateArtifactRequestSchema as B, withRetry as Bt, htmlErrorTitle as C, isPlaceholderImageSigningSecret as Ct, AGENT_QUEST_MANIFEST as D, obfuscateApiKey as Dt, AGENT_QUEST_ID as E, joinReplySlots as Et, BriefcasePromptIdSchema as F, supportedVoiceGenerationVendor as Ft, GENERATED_IMAGE_EXTENSION_RE as G, actorKindSchema as Gt, DEGENERATE_FINISH_REASON as H, DELEGATION_PAYLOAD_SCHEMA_NAME as Ht, CONTEXT_WINDOW_SAFETY_BUFFER_TOKENS as I, tokenEstimateMultiplier as It, LOCATION_MAP_LANGUAGE as J, frontmatterHasSourceStamp as Jt, ImageModels as K, delegationPayloadSchema as Kt, CREDIT_DEDUCT_TRANSACTION_TYPES as L, ttsBase64ResponseSchema as Lt, ArtifactTypeSchema as M, splitEquals as Mt, BRIEFCASE_CATALOG_QUERIES as N, stripDeliveredArtifactBlocks as Nt, AGENT_QUEST_MCP_URI as O, questReplyText as Ot, BedrockEmbeddingModel as P, stripToolArtifactMarkup as Pt, NotFoundError as Q, ChatModels as R, ttsRequestSchema as Rt, isValidSessionId as S, isEarlyStop as St, escapeArtifactBodyJson as T, isUserInitiatedAbort as Tt, DecisionTextPartSchema as U, actorColorIndex as Ut, DEFAULT_TTS_PROVIDER as V, ACTOR_COLOR_SLOTS as Vt, DecisionsRequestSchema as W, actorKindMarker as Wt, McpServerName as X, WEBSITE_URL as Xt, MODEL_INFO_FIELD_GROUP_OF as Y, APP_NAME as Yt, ModelBackend as Z, LOCAL_DEV_URL as _, generatedAudioResponseSchema as _t, commandTextOf as a, SLUG_OWNED_BY_OTHER as at, logger as b, googleMapsSearchUrl as bt, toolCategory as c, UnprocessableEntityError as ct, getCreditsUrl as d, WORK_ITEM_STATUSES as dt, OpenAIEmbeddingModel as et, getEnvironmentName as f, assertAuthOriginMatchesApiKey as ft, DeviceFlowClient as g, filterToolArtifactMarkup as gt, AuthenticatedApiClient as h, escapeThinkMarkers as ht, ToolCatalog as i, SEARCH_RESULT_CARDS_LANGUAGE as it, ApiKeyType as j, signImageUrl as jt, ARTIFACT_DELIVERED_PLACEHOLDER as k, replacePromptVariables as kt, writePathOf as l, VisibilitySchema as lt, resolveApiEndpoint as m, createThinkMarkerEscaper as mt, extractCompactInstructions as n, PermissionDeniedError as nt, isReadOnlyTool as o, SUBQUEST_STATUS_VALUES as ot, requireApiUrl as p, buildPromptContext as pt, ImagePromptResolutionSchema as q, selfClaimedActorKindSchema as qt, loadContextFiles as r, REVIEW_GATE_STATUS_VALUES as rt, sandboxedCommandArg as s, SupportedFabFileMimeTypes as st, ConfigStore as t, PROMPT_TEXT_MAX as tt, ApiEndpointUnconfiguredError as u, VoyageAIEmbeddingModel as ut, NotAuthenticatedError as v, getMcpProviderMetadata as vt, htmlFirstH1 as w, isRetryableError as wt, SESSION_ID_PATTERN as x, hasDeliverablePinnedArtifact as xt, parseApiUrl as y, getQuestErrorCode as yt, CompletionReasoningEffortSchema as z, ttsResponseTooLargeSchema as zt };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { Pt as tokenEstimateMultiplier } from "./ConfigStore-DUATzLxB.mjs";
2
+ import { It as tokenEstimateMultiplier } from "./ConfigStore-CbVFLXMH.mjs";
3
3
  import { v4 } from "uuid";
4
4
  import { get_encoding } from "tiktoken";
5
5
  //#region ../../b4m-core/utils/dist/calibratedTokenizer.mjs
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { F as generateCliTools, G as setWebSocketToolExecutor, J as DeferredToolRegistry, U as wrapTools, V as buildSystemPrompt, Y as ReActAgent, a as loadProjectContext, c as createSseBackend, i as buildProjectAgentStore, l as ServerLlmBackend, n as BackgroundAgentManager, o as McpManager, q as getPlanModeFilePath, r as SubagentOrchestrator, t as AgentHistoryStore, ut as Logger } from "./AgentHistoryStore-CLidbOHG.mjs";
3
- import { A as ARTIFACT_REMOVED_PLACEHOLDER, Ct as isUserInitiatedAbort, I as CONTEXT_WINDOW_SAFETY_BUFFER_TOKENS, Mt as stripToolArtifactMarkup, R as ChatModels, Y as ModelBackend, _t as getQuestErrorCode, b as logger, et as PermissionDeniedError, ft as createThinkMarkerEscaper, jt as stripDeliveredArtifactBlocks, k as ARTIFACT_DELIVERED_PLACEHOLDER, mt as filterToolArtifactMarkup, pt as escapeThinkMarkers, q as MODEL_INFO_FIELD_GROUP_OF, yt as hasDeliverablePinnedArtifact, z as CompletionReasoningEffortSchema } from "./ConfigStore-DUATzLxB.mjs";
2
+ import { F as generateCliTools, G as setWebSocketToolExecutor, J as DeferredToolRegistry, U as wrapTools, V as buildSystemPrompt, Y as ReActAgent, a as loadProjectContext, c as createSseBackend, i as buildProjectAgentStore, l as ServerLlmBackend, n as BackgroundAgentManager, o as McpManager, q as getPlanModeFilePath, r as SubagentOrchestrator, t as AgentHistoryStore, ut as Logger } from "./AgentHistoryStore-ClO2zOn6.mjs";
3
+ import { A as ARTIFACT_REMOVED_PLACEHOLDER, I as CONTEXT_WINDOW_SAFETY_BUFFER_TOKENS, Nt as stripDeliveredArtifactBlocks, Pt as stripToolArtifactMarkup, R as ChatModels, Tt as isUserInitiatedAbort, Y as MODEL_INFO_FIELD_GROUP_OF, Z as ModelBackend, b as logger, gt as filterToolArtifactMarkup, ht as escapeThinkMarkers, k as ARTIFACT_DELIVERED_PLACEHOLDER, mt as createThinkMarkerEscaper, nt as PermissionDeniedError, xt as hasDeliverablePinnedArtifact, yt as getQuestErrorCode, z as CompletionReasoningEffortSchema } from "./ConfigStore-CbVFLXMH.mjs";
4
4
  import "crypto";
5
5
  import { v4 } from "uuid";
6
6
  import "axios";
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { $ as CustomCommandStore, A as createAgentDelegateTool, C as createTodoStore, D as createCoordinateTaskTool, G as setWebSocketToolExecutor, N as PermissionManager, O as createResumeAgentTool, P as buildCliToolList, Q as RemoteSkillSource, S as createFindDefinitionTool, T as createSkillTool, X as createToolSearchTool, b as createGetFileStructureTool, j as FallbackLlmBackend, k as createBackgroundAgentTools, nt as CheckpointStore, rt as SessionStore, s as buildSandbox, w as createWriteTodosTool } from "../AgentHistoryStore-CLidbOHG.mjs";
3
- import { b as logger, i as ToolCatalog, p as requireApiUrl, t as ConfigStore } from "../ConfigStore-DUATzLxB.mjs";
4
- import { a as NotifyingLlmBackend, i as deferredToolRegistry, n as buildSupportingStores, r as buildLlmBackend, t as buildAgent } from "../buildAgent-DyZWK0LW.mjs";
5
- import { a as ApiClient } from "../dist-DPP7UmK9.mjs";
2
+ import { $ as CustomCommandStore, A as createAgentDelegateTool, C as createTodoStore, D as createCoordinateTaskTool, G as setWebSocketToolExecutor, N as PermissionManager, O as createResumeAgentTool, P as buildCliToolList, Q as RemoteSkillSource, S as createFindDefinitionTool, T as createSkillTool, X as createToolSearchTool, b as createGetFileStructureTool, j as FallbackLlmBackend, k as createBackgroundAgentTools, nt as CheckpointStore, rt as SessionStore, s as buildSandbox, w as createWriteTodosTool } from "../AgentHistoryStore-ClO2zOn6.mjs";
3
+ import { b as logger, i as ToolCatalog, p as requireApiUrl, t as ConfigStore } from "../ConfigStore-CbVFLXMH.mjs";
4
+ import { a as NotifyingLlmBackend, i as deferredToolRegistry, n as buildSupportingStores, r as buildLlmBackend, t as buildAgent } from "../buildAgent-BeaVbpzH.mjs";
5
+ import { a as ApiClient } from "../dist-DlBq3wHu.mjs";
6
6
  import { randomUUID } from "crypto";
7
7
  import { existsSync, realpathSync, statSync } from "fs";
8
8
  import { isAbsolute } from "path";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { m as resolveApiEndpoint, t as ConfigStore, y as parseApiUrl } from "../ConfigStore-DUATzLxB.mjs";
2
+ import { m as resolveApiEndpoint, t as ConfigStore, y as parseApiUrl } from "../ConfigStore-CbVFLXMH.mjs";
3
3
  //#region src/commands/apiCommand.ts
4
4
  /**
5
5
  * External API config command (--api-url / --reset-api)
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as version } from "../package-DYPVrada.mjs";
2
+ import { t as version } from "../package-MoDZ9cGj.mjs";
3
3
  import { c as isNpmPrefixWritable, i as fetchLatestVersion, r as compareSemver } from "../updateChecker-CCLVVdH0.mjs";
4
4
  import { t as checkRipgrep } from "../ripgrepCheck-BmkyTK2i.mjs";
5
5
  import { existsSync } from "fs";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as ConfigStore } from "../ConfigStore-DUATzLxB.mjs";
2
+ import { t as ConfigStore } from "../ConfigStore-CbVFLXMH.mjs";
3
3
  //#region src/commands/envCommand.ts
4
4
  /**
5
5
  * Environment switching for the `--dev` / `--prod` launch flags.
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { $ as CustomCommandStore, A as createAgentDelegateTool, C as createTodoStore, D as createCoordinateTaskTool, F as generateCliTools, G as setWebSocketToolExecutor, K as classifyCommandRisk, N as PermissionManager, O as createResumeAgentTool, P as buildCliToolList, Q as RemoteSkillSource, S as createFindDefinitionTool, T as createSkillTool, U as wrapTools, V as buildSystemPrompt, Y as ReActAgent, a as loadProjectContext, b as createGetFileStructureTool, c as createSseBackend, i as buildProjectAgentStore, j as FallbackLlmBackend, k as createBackgroundAgentTools, n as BackgroundAgentManager, nt as CheckpointStore, o as McpManager, r as SubagentOrchestrator, rt as SessionStore, s as buildSandbox, t as AgentHistoryStore, w as createWriteTodosTool, x as createWorkItemTools } from "../AgentHistoryStore-CLidbOHG.mjs";
3
- import { a as commandTextOf, b as logger, c as toolCategory, i as ToolCatalog, p as requireApiUrl, t as ConfigStore } from "../ConfigStore-DUATzLxB.mjs";
4
- import { r as reconstructTurnBlocks, t as WorkItemsClient } from "../WorkItemsClient-BSoOblGp.mjs";
5
- import { a as ApiClient } from "../dist-DPP7UmK9.mjs";
2
+ import { $ as CustomCommandStore, A as createAgentDelegateTool, C as createTodoStore, D as createCoordinateTaskTool, F as generateCliTools, G as setWebSocketToolExecutor, K as classifyCommandRisk, N as PermissionManager, O as createResumeAgentTool, P as buildCliToolList, Q as RemoteSkillSource, S as createFindDefinitionTool, T as createSkillTool, U as wrapTools, V as buildSystemPrompt, Y as ReActAgent, a as loadProjectContext, b as createGetFileStructureTool, c as createSseBackend, i as buildProjectAgentStore, j as FallbackLlmBackend, k as createBackgroundAgentTools, n as BackgroundAgentManager, nt as CheckpointStore, o as McpManager, r as SubagentOrchestrator, rt as SessionStore, s as buildSandbox, t as AgentHistoryStore, w as createWriteTodosTool, x as createWorkItemTools } from "../AgentHistoryStore-ClO2zOn6.mjs";
3
+ import { a as commandTextOf, b as logger, c as toolCategory, i as ToolCatalog, p as requireApiUrl, t as ConfigStore } from "../ConfigStore-CbVFLXMH.mjs";
4
+ import { r as reconstructTurnBlocks, t as WorkItemsClient } from "../WorkItemsClient-SeNbzvEw.mjs";
5
+ import { a as ApiClient } from "../dist-DlBq3wHu.mjs";
6
6
  import { randomBytes } from "crypto";
7
7
  import { v4 } from "uuid";
8
8
  import { readFile } from "fs/promises";
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { t as ConfigStore } from "../ConfigStore-DUATzLxB.mjs";
3
- import { t as version } from "../package-DYPVrada.mjs";
2
+ import { t as ConfigStore } from "../ConfigStore-CbVFLXMH.mjs";
3
+ import { t as version } from "../package-MoDZ9cGj.mjs";
4
4
  //#region src/commands/mcpCommand.ts
5
5
  /**
6
6
  * External MCP commands (b4m mcp list, b4m mcp add, etc.)
@@ -70,7 +70,7 @@ async function handleMcpCommand(subcommand, argv) {
70
70
  await handleDisable(config, argv.name, configStore);
71
71
  break;
72
72
  case "serve": {
73
- const { handleMcpServeCommand } = await import("../serve-w6v3rZiR.mjs");
73
+ const { handleMcpServeCommand } = await import("../serve-zi-B2iUT.mjs");
74
74
  await handleMcpServeCommand({
75
75
  http: Boolean(argv.http),
76
76
  port: typeof argv.port === "number" ? argv.port : void 0,
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as ConfigStore } from "../ConfigStore-DUATzLxB.mjs";
2
+ import { t as ConfigStore } from "../ConfigStore-CbVFLXMH.mjs";
3
3
  import { n as getDefaultPluginsDir, r as isFeatureEnabled, t as PluginStore } from "../PluginStore-DwvOJ-G3.mjs";
4
4
  import { promises } from "fs";
5
5
  import path from "path";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as version } from "../package-DYPVrada.mjs";
2
+ import { t as version } from "../package-MoDZ9cGj.mjs";
3
3
  import { a as forceCheckForUpdate, c as isNpmPrefixWritable, d as shouldAttemptAutoUpdate, l as readCachedUpdate, n as REEXEC_GUARD_ENV, o as getAutoUpdatePreference, t as INSTALL_CMD, u as setAutoUpdatePreference } from "../updateChecker-CCLVVdH0.mjs";
4
4
  import { t as checkRipgrep } from "../ripgrepCheck-BmkyTK2i.mjs";
5
5
  import { execSync, spawnSync } from "child_process";
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { b as logger, g as DeviceFlowClient, h as AuthenticatedApiClient, t as ConfigStore } from "./ConfigStore-DUATzLxB.mjs";
3
- import { t as version } from "./package-DYPVrada.mjs";
2
+ import { b as logger, g as DeviceFlowClient, h as AuthenticatedApiClient, t as ConfigStore } from "./ConfigStore-CbVFLXMH.mjs";
3
+ import { t as version } from "./package-MoDZ9cGj.mjs";
4
4
  import { isAxiosError } from "axios";
5
5
  import { Readable } from "node:stream";
6
6
  import { createParser } from "eventsource-parser";
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import { $ as CustomCommandStore, A as createAgentDelegateTool, B as DEFAULT_THOROUGHNESS, C as createTodoStore, D as createCoordinateTaskTool, E as parseAgentConfig, G as setWebSocketToolExecutor, H as buildSkillsPromptSection, I as ALWAYS_DENIED_FOR_AGENTS, L as DEFAULT_AGENT_MODEL, M as substituteArguments, N as PermissionManager, O as createResumeAgentTool, P as buildCliToolList, Q as RemoteSkillSource, R as DEFAULT_MAX_ITERATIONS, S as createFindDefinitionTool, T as createSkillTool, V as buildSystemPrompt, W as getProcessHooks, X as createToolSearchTool, Z as findIterationBoundary, _ as createDecisionLogTool, at as mergeCommands, b as createGetFileStructureTool, ct as searchFiles, d as createReviewGateStore, dt as COMPACTION_SUMMARY_MARKER, et as processFileReferences, f as createReviewGateTool, g as formatBlockersOutput, h as createBlockerTools, it as searchCommands, j as FallbackLlmBackend, k as createBackgroundAgentTools, lt as warmFileCache, m as createBlockerStore, nt as CheckpointStore, ot as rewireReservedNames, p as formatReviewGatesOutput, pt as MAX_PASTE_SIZE, q as getPlanModeFilePath, rt as SessionStore, s as buildSandbox, st as formatFileSize, tt as hasFileReferences, u as isConnectionDrop, v as createDecisionStore, w as createWriteTodosTool, x as createWorkItemTools, y as formatDecisionsOutput, z as DEFAULT_RETRY_CONFIG } from "./AgentHistoryStore-CLidbOHG.mjs";
2
+ import { $ as CustomCommandStore, A as createAgentDelegateTool, B as DEFAULT_THOROUGHNESS, C as createTodoStore, D as createCoordinateTaskTool, E as parseAgentConfig, G as setWebSocketToolExecutor, H as buildSkillsPromptSection, I as ALWAYS_DENIED_FOR_AGENTS, L as DEFAULT_AGENT_MODEL, M as substituteArguments, N as PermissionManager, O as createResumeAgentTool, P as buildCliToolList, Q as RemoteSkillSource, R as DEFAULT_MAX_ITERATIONS, S as createFindDefinitionTool, T as createSkillTool, V as buildSystemPrompt, W as getProcessHooks, X as createToolSearchTool, Z as findIterationBoundary, _ as createDecisionLogTool, at as mergeCommands, b as createGetFileStructureTool, ct as searchFiles, d as createReviewGateStore, dt as COMPACTION_SUMMARY_MARKER, et as processFileReferences, f as createReviewGateTool, g as formatBlockersOutput, h as createBlockerTools, it as searchCommands, j as FallbackLlmBackend, k as createBackgroundAgentTools, lt as warmFileCache, m as createBlockerStore, nt as CheckpointStore, ot as rewireReservedNames, p as formatReviewGatesOutput, pt as MAX_PASTE_SIZE, q as getPlanModeFilePath, rt as SessionStore, s as buildSandbox, st as formatFileSize, tt as hasFileReferences, u as isConnectionDrop, v as createDecisionStore, w as createWriteTodosTool, x as createWorkItemTools, y as formatDecisionsOutput, z as DEFAULT_RETRY_CONFIG } from "./AgentHistoryStore-ClO2zOn6.mjs";
3
3
  import { a as selectLiveSubagentTokens, i as selectLiveSubagentCredits, n as selectActiveBackgroundShells, o as useCliStore, r as selectCompletedBackgroundShells, t as selectActiveBackgroundAgents } from "./store-BxmPEI3v.mjs";
4
- import { Bt as DELEGATION_PAYLOAD_SCHEMA_NAME, Gt as selfClaimedActorKindSchema, Ht as actorKindMarker, L as CREDIT_DEDUCT_TRANSACTION_TYPES, Pt as tokenEstimateMultiplier, R as ChatModels, S as isValidSessionId, Ut as actorKindSchema, Vt as actorColorIndex, Wt as delegationPayloadSchema, _ as LOCAL_DEV_URL, b as logger, bt as isEarlyStop, d as getCreditsUrl, f as getEnvironmentName, i as ToolCatalog, it as SUBQUEST_STATUS_VALUES, m as resolveApiEndpoint, n as extractCompactInstructions, p as requireApiUrl, t as ConfigStore, tt as REVIEW_GATE_STATUS_VALUES, u as ApiEndpointUnconfiguredError, x as SESSION_ID_PATTERN, y as parseApiUrl, zt as ACTOR_COLOR_SLOTS } from "./ConfigStore-DUATzLxB.mjs";
4
+ import { Gt as actorKindSchema, Ht as DELEGATION_PAYLOAD_SCHEMA_NAME, It as tokenEstimateMultiplier, Kt as delegationPayloadSchema, L as CREDIT_DEDUCT_TRANSACTION_TYPES, R as ChatModels, S as isValidSessionId, St as isEarlyStop, Ut as actorColorIndex, Vt as ACTOR_COLOR_SLOTS, Wt as actorKindMarker, _ as LOCAL_DEV_URL, b as logger, d as getCreditsUrl, f as getEnvironmentName, i as ToolCatalog, m as resolveApiEndpoint, n as extractCompactInstructions, ot as SUBQUEST_STATUS_VALUES, p as requireApiUrl, qt as selfClaimedActorKindSchema, rt as REVIEW_GATE_STATUS_VALUES, t as ConfigStore, u as ApiEndpointUnconfiguredError, x as SESSION_ID_PATTERN, y as parseApiUrl } from "./ConfigStore-CbVFLXMH.mjs";
5
5
  import { r as isFeatureEnabled, t as PluginStore } from "./PluginStore-DwvOJ-G3.mjs";
6
- import { i as getTokenCounter, n as ConversationContext, r as reconstructTurnBlocks, t as WorkItemsClient } from "./WorkItemsClient-BSoOblGp.mjs";
7
- import { a as NotifyingLlmBackend, i as deferredToolRegistry, n as buildSupportingStores, r as buildLlmBackend, t as buildAgent } from "./buildAgent-DyZWK0LW.mjs";
6
+ import { i as getTokenCounter, n as ConversationContext, r as reconstructTurnBlocks, t as WorkItemsClient } from "./WorkItemsClient-SeNbzvEw.mjs";
7
+ import { a as NotifyingLlmBackend, i as deferredToolRegistry, n as buildSupportingStores, r as buildLlmBackend, t as buildAgent } from "./buildAgent-BeaVbpzH.mjs";
8
8
  import { t as getShellSessionManager } from "./ShellSessionManager-6o8KZzl1-vrbPAUTq.mjs";
9
- import { a as ApiClient, s as OAuthClient } from "./dist-DPP7UmK9.mjs";
10
- import { t as version } from "./package-DYPVrada.mjs";
9
+ import { a as ApiClient, s as OAuthClient } from "./dist-DlBq3wHu.mjs";
10
+ import { t as version } from "./package-MoDZ9cGj.mjs";
11
11
  import { s as getStartupUpdateStatus } from "./updateChecker-CCLVVdH0.mjs";
12
12
  import React, { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
13
13
  import { Box, Static, Text, measureElement, render, useApp, useInput, usePaste, useStdout } from "ink";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  //#region package.json
3
- var version = "3.3.0";
3
+ var version = "3.4.0";
4
4
  //#endregion
5
5
  export { version as t };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { $ as PROMPT_TEXT_MAX, B as CreateArtifactRequestSchema, D as AGENT_QUEST_MANIFEST, Dt as replacePromptVariables, E as AGENT_QUEST_ID, Et as questReplyText, F as BriefcasePromptIdSchema, Ft as ttsBase64ResponseSchema, G as ImagePromptResolutionSchema, It as ttsRequestSchema, Lt as ttsResponseTooLargeSchema, M as ArtifactTypeSchema, N as BRIEFCASE_CATALOG_QUERIES, Nt as supportedVoiceGenerationVendor, O as AGENT_QUEST_MCP_URI, U as GENERATED_IMAGE_EXTENSION_RE, V as DEFAULT_TTS_PROVIDER, W as ImageModels, b as logger, dt as buildPromptContext, ht as generatedAudioResponseSchema, p as requireApiUrl, st as VisibilitySchema, t as ConfigStore, v as NotAuthenticatedError, wt as joinReplySlots, y as parseApiUrl } from "./ConfigStore-DUATzLxB.mjs";
3
- import { a as ApiClient, i as parseRetryAfterSeconds, o as isProviderKeyFailure, r as createClient, t as B4mApiError } from "./dist-DPP7UmK9.mjs";
2
+ import { B as CreateArtifactRequestSchema, D as AGENT_QUEST_MANIFEST, E as AGENT_QUEST_ID, Et as joinReplySlots, F as BriefcasePromptIdSchema, Ft as supportedVoiceGenerationVendor, G as GENERATED_IMAGE_EXTENSION_RE, K as ImageModels, Lt as ttsBase64ResponseSchema, M as ArtifactTypeSchema, N as BRIEFCASE_CATALOG_QUERIES, O as AGENT_QUEST_MCP_URI, Ot as questReplyText, Rt as ttsRequestSchema, V as DEFAULT_TTS_PROVIDER, _t as generatedAudioResponseSchema, b as logger, kt as replacePromptVariables, lt as VisibilitySchema, p as requireApiUrl, pt as buildPromptContext, q as ImagePromptResolutionSchema, t as ConfigStore, tt as PROMPT_TEXT_MAX, v as NotAuthenticatedError, y as parseApiUrl, zt as ttsResponseTooLargeSchema } from "./ConfigStore-CbVFLXMH.mjs";
3
+ import { a as ApiClient, i as parseRetryAfterSeconds, o as isProviderKeyFailure, r as createClient, t as B4mApiError } from "./dist-DlBq3wHu.mjs";
4
4
  import { z as z$1 } from "zod";
5
5
  import { isAxiosError } from "axios";
6
6
  import { createHash, randomUUID } from "node:crypto";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "mcpName": "io.github.Bike4Mind/bike4mind",
5
5
  "type": "module",
6
6
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
@@ -124,17 +124,17 @@
124
124
  "tsx": "^4.23.0",
125
125
  "typescript": "^5.9.3",
126
126
  "vitest": "^4.1.11",
127
- "@bike4mind/agents": "1.2.8",
127
+ "@bike4mind/agents": "1.2.9",
128
128
  "@bike4mind/client-auth": "0.2.1",
129
- "@bike4mind/common": "18.0.0",
130
- "@bike4mind/fab-pipeline": "2.1.8",
129
+ "@bike4mind/common": "19.0.0",
130
+ "@bike4mind/fab-pipeline": "2.1.9",
131
131
  "@bike4mind/hearth": "0.3.1",
132
- "@bike4mind/llm-adapters": "1.5.0",
133
- "@bike4mind/mcp": "2.1.8",
132
+ "@bike4mind/llm-adapters": "1.5.1",
133
+ "@bike4mind/mcp": "2.1.9",
134
134
  "@bike4mind/observability": "0.2.3",
135
- "@bike4mind/sdk": "1.2.0",
136
- "@bike4mind/services": "19.2.0",
137
- "@bike4mind/utils": "8.1.3"
135
+ "@bike4mind/sdk": "1.3.0",
136
+ "@bike4mind/services": "20.0.0",
137
+ "@bike4mind/utils": "8.1.4"
138
138
  },
139
139
  "optionalDependencies": {
140
140
  "@vscode/ripgrep": "^1.18.0"