@bike4mind/cli 0.2.37 → 0.2.38-feat-ionq-sales-intelligence.20110

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-EY65E4W4.js";
4
+ } from "./chunk-JGSATYRQ.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-5YLGNW2B.js";
9
+ } from "./chunk-TKCXVYDJ.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-EY65E4W4.js";
14
+ } from "./chunk-JGSATYRQ.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
17
17
  import { z } from "zod";
@@ -4,7 +4,7 @@ import {
4
4
  getOpenWeatherKey,
5
5
  getSerperKey,
6
6
  getWolframAlphaKey
7
- } from "./chunk-NJQYWIDJ.js";
7
+ } from "./chunk-AVWSA2JN.js";
8
8
  import {
9
9
  BFLImageService,
10
10
  BaseStorage,
@@ -16,14 +16,14 @@ import {
16
16
  OpenAIBackend,
17
17
  OpenAIImageService,
18
18
  XAIImageService
19
- } from "./chunk-5YLGNW2B.js";
19
+ } from "./chunk-TKCXVYDJ.js";
20
20
  import {
21
21
  Logger
22
22
  } from "./chunk-PFBYGCOW.js";
23
23
  import {
24
24
  ConfigStore,
25
25
  logger
26
- } from "./chunk-H7RVLAQD.js";
26
+ } from "./chunk-VSZJ7FSP.js";
27
27
  import {
28
28
  AiEvents,
29
29
  ApiKeyEvents,
@@ -80,7 +80,7 @@ import {
80
80
  getMcpProviderMetadata,
81
81
  getViewById,
82
82
  resolveNavigationIntents
83
- } from "./chunk-EY65E4W4.js";
83
+ } from "./chunk-JGSATYRQ.js";
84
84
 
85
85
  // src/utils/fileSearch.ts
86
86
  import * as fs from "fs";
@@ -1846,7 +1846,8 @@ ${options.context}` : this.getSystemPrompt()
1846
1846
  temperature,
1847
1847
  abortSignal: options.signal,
1848
1848
  tool_choice: this.context.toolChoice,
1849
- executeTools: false
1849
+ executeTools: false,
1850
+ thinking: this.context.thinking
1850
1851
  },
1851
1852
  async (texts, completionInfo) => {
1852
1853
  for (const text of texts) {
@@ -2146,34 +2147,20 @@ Remember: You are an autonomous AGENT. Act independently and solve problems proa
2146
2147
  }
2147
2148
  }
2148
2149
  /**
2149
- * Build and append tool call/result messages for the conversation history
2150
+ * Build and append tool call/result messages for the conversation history.
2151
+ * Delegates to the backend's pushToolMessages so each provider formats
2152
+ * messages according to its own API requirements.
2150
2153
  */
2151
2154
  appendToolMessages(messages, toolUse, observation, thinkingBlocks) {
2152
2155
  const params = this.parseToolArguments(toolUse.arguments);
2153
- const msgToolCallId = `${toolUse.name}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
2154
- const assistantContent = [
2155
- ...thinkingBlocks,
2156
- {
2157
- type: "tool_use",
2158
- id: msgToolCallId,
2159
- name: toolUse.name,
2160
- input: params
2161
- }
2162
- ];
2163
- messages.push({
2164
- role: "assistant",
2165
- content: assistantContent
2166
- });
2167
- messages.push({
2168
- role: "user",
2169
- content: [
2170
- {
2171
- type: "tool_result",
2172
- tool_use_id: msgToolCallId,
2173
- content: observation
2174
- }
2175
- ]
2176
- });
2156
+ const toolId = toolUse.id || `${toolUse.name}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
2157
+ const parameters = typeof toolUse.arguments === "string" ? toolUse.arguments : JSON.stringify(params);
2158
+ this.context.llm.pushToolMessages(
2159
+ messages,
2160
+ { id: toolId, name: toolUse.name, parameters },
2161
+ observation,
2162
+ thinkingBlocks
2163
+ );
2177
2164
  }
2178
2165
  };
2179
2166
 
@@ -8745,7 +8732,7 @@ var knowledgeBaseSearchTool = {
8745
8732
  toolFn: async (value) => {
8746
8733
  const params = value;
8747
8734
  const { query, tags, file_type, max_results = 5 } = params;
8748
- context.logger.log("\u{1F4DA} Knowledge Base Search: Starting search for query:", query);
8735
+ context.logger.log("\u{1F4DA} Knowledge Base Search: userId:", context.userId, "query:", query, "tags:", tags);
8749
8736
  if (!context.db.fabfiles) {
8750
8737
  context.logger.error("\u274C Knowledge Base Search: fabfiles repository not available");
8751
8738
  return "Knowledge base search is not available at this time.";
@@ -8771,7 +8758,7 @@ var knowledgeBaseSearchTool = {
8771
8758
  userGroups: context.user.groups || []
8772
8759
  // Pass user's groups for org-level sharing
8773
8760
  });
8774
- context.logger.log("\u{1F4DA} Knowledge Base Search: Found", searchResults.data.length, "results");
8761
+ context.logger.log("\u{1F4DA} Knowledge Base Search: Found", searchResults.data.length, "of", searchResults.total, "results. Files:", searchResults.data.map((f) => f.fileName));
8775
8762
  return formatSearchResults(searchResults.data);
8776
8763
  } catch (error) {
8777
8764
  context.logger.error("\u274C Knowledge Base Search: Error during search:", error);
@@ -8791,7 +8778,7 @@ var knowledgeBaseSearchTool = {
8791
8778
  tags: {
8792
8779
  type: "array",
8793
8780
  items: { type: "string" },
8794
- description: 'Optional: filter results by tag names. Supports partial matching. For optimization docs, use tags like "opti:family:scheduling", "opti:QUBO", "opti:solver:highs", etc. Any matching tag qualifies the file.'
8781
+ description: 'Optional: filter results by tag names. Supports partial matching. For optimization docs, use tags like "opti:family:scheduling", "opti:QUBO", "opti:solver:highs". For IonQ sales intelligence, use tags like "ionq:vertical:pharma", "ionq:competitor:ibm", "ionq:type:product-specs", "ionq:stage:discovery", "ionq:offering:forte". Any matching tag qualifies the file.'
8795
8782
  },
8796
8783
  file_type: {
8797
8784
  type: "string",
@@ -8904,7 +8891,7 @@ Chunks: ${chunks.length} | Characters: ${charLabel}
8904
8891
  tags: {
8905
8892
  type: "array",
8906
8893
  items: { type: "string" },
8907
- description: 'Filter documents by tags. For optimization docs, use tags like "opti:family:scheduling", "opti:solver:highs", etc.'
8894
+ description: 'Filter documents by tags. For optimization docs, use tags like "opti:family:scheduling", "opti:solver:highs". For IonQ sales intelligence, use tags like "ionq:vertical:pharma", "ionq:competitor:ibm", "ionq:content:product-specs", "ionq:offering:forte".'
8908
8895
  },
8909
8896
  query: {
8910
8897
  type: "string",
@@ -13382,7 +13369,6 @@ var GithubManagerAgent = (config) => ({
13382
13369
  name: "github_manager",
13383
13370
  description: "GitHub operations (issues, pull requests, code search, branches, workflows, reviews). ALWAYS delegate GitHub requests to this agent \u2014 you do not have direct access to these tools",
13384
13371
  model: config?.model ?? ChatModels.CLAUDE_4_6_SONNET_BEDROCK,
13385
- fallbackModels: [ChatModels.GPT4_1, ChatModels.GPT4_1_MINI],
13386
13372
  defaultThoroughness: config?.defaultThoroughness ?? "medium",
13387
13373
  maxIterations: { quick: 3, medium: 8, very_thorough: 15 },
13388
13374
  allowedTools: [...config?.extraAllowedTools ?? []],
@@ -15904,6 +15890,9 @@ var ServerLlmBackend = class {
15904
15890
  });
15905
15891
  });
15906
15892
  }
15893
+ pushToolMessages(_messages, _tool, _result) {
15894
+ throw new Error("ServerLlmBackend does not support pushToolMessages \u2014 tools are executed server-side");
15895
+ }
15907
15896
  /**
15908
15897
  * Get available models from server
15909
15898
  * Fetches from /api/models and filters for CLI-compatible models
@@ -16123,6 +16112,9 @@ var WebSocketLlmBackend = class {
16123
16112
  });
16124
16113
  });
16125
16114
  }
16115
+ pushToolMessages(_messages, _tool, _result) {
16116
+ throw new Error("WebSocketLlmBackend does not support pushToolMessages \u2014 tools are executed server-side");
16117
+ }
16126
16118
  /**
16127
16119
  * Get available models from server (REST call, not streaming).
16128
16120
  * Delegates to ApiClient -- same as ServerLlmBackend.
@@ -1130,6 +1130,17 @@ var JiraWebhookDeliveryStatus;
1130
1130
  JiraWebhookDeliveryStatus2["Pending"] = "pending";
1131
1131
  })(JiraWebhookDeliveryStatus || (JiraWebhookDeliveryStatus = {}));
1132
1132
 
1133
+ // ../../b4m-core/packages/common/dist/src/types/entities/SystemPromptTypes.js
1134
+ var AdminSystemPromptCategory;
1135
+ (function(AdminSystemPromptCategory2) {
1136
+ AdminSystemPromptCategory2["SYSTEM"] = "system";
1137
+ AdminSystemPromptCategory2["ADMIN"] = "admin";
1138
+ AdminSystemPromptCategory2["AUTOMATION"] = "automation";
1139
+ AdminSystemPromptCategory2["VOICE"] = "voice";
1140
+ AdminSystemPromptCategory2["QUANTUM"] = "quantum";
1141
+ AdminSystemPromptCategory2["SALES_INTELLIGENCE"] = "sales_intelligence";
1142
+ })(AdminSystemPromptCategory || (AdminSystemPromptCategory = {}));
1143
+
1133
1144
  // ../../b4m-core/packages/common/dist/src/types/common.js
1134
1145
  var SupportedFabFileMimeTypes;
1135
1146
  (function(SupportedFabFileMimeTypes2) {
@@ -10473,6 +10484,7 @@ export {
10473
10484
  WebhookAuditStatus,
10474
10485
  COMMON_JIRA_WEBHOOK_EVENTS,
10475
10486
  JiraWebhookDeliveryStatus,
10487
+ AdminSystemPromptCategory,
10476
10488
  SupportedFabFileMimeTypes,
10477
10489
  REASONING_EFFORT_LABELS,
10478
10490
  REASONING_EFFORT_DESCRIPTIONS,
@@ -3,7 +3,7 @@
3
3
  // package.json
4
4
  var package_default = {
5
5
  name: "@bike4mind/cli",
6
- version: "0.2.37",
6
+ version: "0.2.38-feat-ionq-sales-intelligence.20110+eee0abd6a",
7
7
  type: "module",
8
8
  description: "Interactive CLI tool for Bike4Mind with ReAct agents",
9
9
  license: "UNLICENSED",
@@ -117,10 +117,10 @@ var package_default = {
117
117
  },
118
118
  devDependencies: {
119
119
  "@bike4mind/agents": "0.1.0",
120
- "@bike4mind/common": "2.58.0",
121
- "@bike4mind/mcp": "1.32.5",
122
- "@bike4mind/services": "2.54.1",
123
- "@bike4mind/utils": "2.11.0",
120
+ "@bike4mind/common": "2.58.1-feat-ionq-sales-intelligence.20110+eee0abd6a",
121
+ "@bike4mind/mcp": "1.32.6-feat-ionq-sales-intelligence.20110+eee0abd6a",
122
+ "@bike4mind/services": "2.54.2-feat-ionq-sales-intelligence.20110+eee0abd6a",
123
+ "@bike4mind/utils": "2.11.1-feat-ionq-sales-intelligence.20110+eee0abd6a",
124
124
  "@types/better-sqlite3": "^7.6.13",
125
125
  "@types/diff": "^5.0.9",
126
126
  "@types/jsonwebtoken": "^9.0.4",
@@ -138,7 +138,7 @@ var package_default = {
138
138
  optionalDependencies: {
139
139
  "@vscode/ripgrep": "^1.17.0"
140
140
  },
141
- gitHead: "474cb1d4152b065eb696701af0f8c20fb8daed57"
141
+ gitHead: "eee0abd6a3a3620e42e5445b3fcd8687e08d2006"
142
142
  };
143
143
 
144
144
  // src/utils/updateChecker.ts
@@ -7,11 +7,11 @@ import {
7
7
  getSettingsMap,
8
8
  getSettingsValue,
9
9
  secureParameters
10
- } from "./chunk-5YLGNW2B.js";
10
+ } from "./chunk-TKCXVYDJ.js";
11
11
  import {
12
12
  KnowledgeType,
13
13
  SupportedFabFileMimeTypes
14
- } from "./chunk-EY65E4W4.js";
14
+ } from "./chunk-JGSATYRQ.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/fabFileService/create.js
17
17
  import { z } from "zod";
@@ -19,7 +19,7 @@ import {
19
19
  dayjsConfig_default,
20
20
  extractSnippetMeta,
21
21
  settingsMap
22
- } from "./chunk-EY65E4W4.js";
22
+ } from "./chunk-JGSATYRQ.js";
23
23
 
24
24
  // ../../b4m-core/packages/utils/dist/src/storage/S3Storage.js
25
25
  import { S3Client, PutObjectCommand, DeleteObjectCommand, GetObjectCommand, HeadObjectCommand } from "@aws-sdk/client-s3";
@@ -2995,7 +2995,7 @@ IMPORTANT! Only when someone asks, remember that you are specifically the ${mode
2995
2995
  const modelInfo = await this.getModelInfo();
2996
2996
  const currentModelInfo = modelInfo.find((m) => m.id === model);
2997
2997
  if (currentModelInfo?.can_think) {
2998
- if (options.thinking?.enabled !== false) {
2998
+ if (options.thinking?.enabled === true) {
2999
2999
  const thinkingBudget = options.thinking?.budget_tokens ?? 16e3;
3000
3000
  apiParams.max_tokens = Math.max(apiParams.max_tokens ?? 4096, thinkingBudget + 1e3);
3001
3001
  apiParams.temperature = 1;
@@ -3547,13 +3547,27 @@ IMPORTANT! Only when someone asks, remember that you are specifically the ${mode
3547
3547
  };
3548
3548
  });
3549
3549
  }
3550
- pushToolMessages(messages, tool, result, previousMessage) {
3550
+ pushToolMessages(messages, tool, result, thinkingBlocks) {
3551
3551
  if (this.isThinkingEnabled && this.lastAssistantContent.length > 0) {
3552
3552
  messages.push({
3553
3553
  role: "assistant",
3554
3554
  content: this.lastAssistantContent
3555
3555
  });
3556
3556
  this.logger.debug(`[AnthropicBackend] Including ${this.lastAssistantContent.length} content blocks (thinking + tool_use) in assistant message`);
3557
+ } else if (thinkingBlocks && thinkingBlocks.length > 0) {
3558
+ messages.push({
3559
+ role: "assistant",
3560
+ content: [
3561
+ ...thinkingBlocks,
3562
+ {
3563
+ type: "tool_use",
3564
+ id: tool.id,
3565
+ name: tool.name,
3566
+ input: JSON.parse(tool.parameters || "{}")
3567
+ }
3568
+ ]
3569
+ });
3570
+ this.logger.debug(`[AnthropicBackend] Including ${thinkingBlocks.length} explicit thinking blocks in assistant message`);
3557
3571
  } else {
3558
3572
  messages.push({
3559
3573
  role: "assistant",
@@ -3700,6 +3714,9 @@ var AWSBackend = class {
3700
3714
  this.currentModel = model;
3701
3715
  throw new Error("AWSBackend does not support text completion, only speech-to-text transcription");
3702
3716
  }
3717
+ pushToolMessages(_messages, _tool, _result) {
3718
+ throw new Error("AWSBackend does not support tool messages");
3719
+ }
3703
3720
  async getModelInfo() {
3704
3721
  return [
3705
3722
  {
@@ -4351,7 +4368,7 @@ ${modelIdentity}` : modelIdentity;
4351
4368
  }
4352
4369
  const supportsThinking = model.includes("claude-3-7") || model.includes("claude-opus-4") || model.includes("claude-sonnet-4");
4353
4370
  if (supportsThinking) {
4354
- if (options.thinking?.enabled !== false) {
4371
+ if (options.thinking?.enabled === true) {
4355
4372
  const thinkingBudget = options.thinking?.budget_tokens ?? 16e3;
4356
4373
  body.max_tokens = Math.max(maxTokens, thinkingBudget + 1e3);
4357
4374
  body.temperature = 1;
@@ -4604,18 +4621,17 @@ ${modelIdentity}` : modelIdentity;
4604
4621
  };
4605
4622
  });
4606
4623
  }
4607
- pushToolMessages(messages, tool, result) {
4608
- const assistantMessage = [
4609
- {
4610
- type: "tool_use",
4611
- id: tool.id,
4612
- name: tool.name,
4613
- input: JSON.parse(tool.parameters || "{}")
4614
- }
4615
- ];
4624
+ pushToolMessages(messages, tool, result, thinkingBlocks) {
4625
+ const toolUseBlock = {
4626
+ type: "tool_use",
4627
+ id: tool.id,
4628
+ name: tool.name,
4629
+ input: JSON.parse(tool.parameters || "{}")
4630
+ };
4631
+ const assistantContent = thinkingBlocks && thinkingBlocks.length > 0 ? [...thinkingBlocks, toolUseBlock] : [toolUseBlock];
4616
4632
  messages.push({
4617
4633
  role: "assistant",
4618
- content: assistantMessage
4634
+ content: assistantContent
4619
4635
  });
4620
4636
  messages.push({
4621
4637
  role: "user",
@@ -4817,7 +4833,7 @@ ${finalResponse}`;
4817
4833
  translateStreamChunk(model, chunk) {
4818
4834
  return this.translateChunk(model, chunk);
4819
4835
  }
4820
- pushToolMessages(messages, _tool, _result) {
4836
+ pushToolMessages(messages, _tool, _result, _thinkingBlocks) {
4821
4837
  return messages;
4822
4838
  }
4823
4839
  };
@@ -4922,7 +4938,7 @@ ${m.content}
4922
4938
  }
4923
4939
  };
4924
4940
  }
4925
- pushToolMessages(_messages, _tool, _result) {
4941
+ pushToolMessages(_messages, _tool, _result, _thinkingBlocks) {
4926
4942
  throw new Error("Bedrock JurassicTwo: pushToolMessages not yet supported.");
4927
4943
  }
4928
4944
  };
@@ -5089,7 +5105,7 @@ var LlamaBedrockBackend = class extends BaseBedrockBackend {
5089
5105
  }
5090
5106
  };
5091
5107
  }
5092
- pushToolMessages(messages, _tool, _result) {
5108
+ pushToolMessages(messages, _tool, _result, _thinkingBlocks) {
5093
5109
  return messages;
5094
5110
  }
5095
5111
  };
@@ -5250,7 +5266,7 @@ var TitanBedrockBackend = class extends BaseBedrockBackend {
5250
5266
  }
5251
5267
  throw new Error("Bedrock Titan: Unsupported chunk format.");
5252
5268
  }
5253
- pushToolMessages(_messages, _tool, _result) {
5269
+ pushToolMessages(_messages, _tool, _result, _thinkingBlocks) {
5254
5270
  throw new Error("Bedrock Titan: push tool messages not supported.");
5255
5271
  }
5256
5272
  };
@@ -5278,7 +5294,7 @@ var UndifferentiatedBedrockBackend = class extends BaseBedrockBackend {
5278
5294
  translateChunk(model, chunk) {
5279
5295
  throw new Error("UndifferentiatedBedrockBackend does not support translateChunk");
5280
5296
  }
5281
- pushToolMessages(messages, tool, result) {
5297
+ pushToolMessages(messages, tool, result, _thinkingBlocks) {
5282
5298
  throw new Error("UndifferentiatedBedrockBackend does not support pushToolMessages");
5283
5299
  }
5284
5300
  };
@@ -5294,6 +5310,9 @@ var BFLBackend = class {
5294
5310
  this.currentModel = model;
5295
5311
  throw new Error("BFLBackend does not support text completion, only image generation");
5296
5312
  }
5313
+ pushToolMessages(_messages, _tool, _result, _thinkingBlocks) {
5314
+ throw new Error("BFLBackend does not support tool messages");
5315
+ }
5297
5316
  async getModelInfo() {
5298
5317
  return [
5299
5318
  // BFL Models first - modern, state-of-the-art image generation
@@ -5479,15 +5498,17 @@ var GeminiBackend = class {
5479
5498
  } else {
5480
5499
  this.logger.warn("[Gemini] Missing thought_signature for tool call:", { toolName });
5481
5500
  }
5501
+ const toolId = uuidv4();
5482
5502
  toolCalls.push({
5483
- id: uuidv4(),
5503
+ id: toolId,
5484
5504
  name: toolName,
5485
5505
  parameters: toolArgs,
5486
5506
  thought_signature: thoughtSignature
5487
5507
  });
5488
5508
  toolsUsed.push({
5489
5509
  name: toolName,
5490
- arguments: JSON.stringify(toolArgs)
5510
+ arguments: JSON.stringify(toolArgs),
5511
+ id: toolId
5491
5512
  });
5492
5513
  }
5493
5514
  async getModelInfo() {
@@ -5862,8 +5883,9 @@ var GeminiBackend = class {
5862
5883
  description: tool.toolSchema.description,
5863
5884
  parameters: {
5864
5885
  ...params,
5865
- type: params.type.toUpperCase()
5886
+ type: params.type.toUpperCase(),
5866
5887
  // "object" -> "OBJECT"
5888
+ properties: params.properties ? this.sanitizeProperties(params.properties) : params.properties
5867
5889
  }
5868
5890
  };
5869
5891
  })
@@ -6046,7 +6068,24 @@ var GeminiBackend = class {
6046
6068
  logCacheStats(this.logger, cacheStats, { streaming: false });
6047
6069
  }
6048
6070
  }
6049
- await callback(r.candidates?.map((candidate) => candidate.content?.parts?.[0]?.text) ?? [], {
6071
+ const textParts = [];
6072
+ r.candidates?.forEach((candidate) => {
6073
+ candidate.content?.parts?.forEach((part) => {
6074
+ if (part.text) {
6075
+ textParts.push(part.text);
6076
+ }
6077
+ if (part.functionCall) {
6078
+ this.registerToolCall(part.functionCall, part, toolCalls, toolsUsed);
6079
+ }
6080
+ if (part.function_call) {
6081
+ this.registerToolCall(part.function_call, part, toolCalls, toolsUsed);
6082
+ }
6083
+ if (part.name && part.args && !part.text) {
6084
+ this.registerToolCall({ name: part.name, args: part.args }, part, toolCalls, toolsUsed);
6085
+ }
6086
+ });
6087
+ });
6088
+ await callback(textParts.length ? textParts : [], {
6050
6089
  inputTokens: r.usageMetadata?.promptTokenCount ?? 0,
6051
6090
  outputTokens: r.usageMetadata?.candidatesTokenCount ?? 0,
6052
6091
  toolsUsed,
@@ -6252,12 +6291,80 @@ var GeminiBackend = class {
6252
6291
  }
6253
6292
  ];
6254
6293
  }
6294
+ /**
6295
+ * Strip JSON Schema fields that Gemini's API doesn't support
6296
+ * (e.g., exclusiveMinimum, exclusiveMaximum, additionalProperties on nested objects).
6297
+ */
6298
+ sanitizeProperties(properties) {
6299
+ const unsupportedFields = [
6300
+ "exclusiveMinimum",
6301
+ "exclusiveMaximum",
6302
+ "minLength",
6303
+ "maxLength",
6304
+ "pattern",
6305
+ "minItems",
6306
+ "maxItems",
6307
+ "uniqueItems",
6308
+ "additionalProperties",
6309
+ "default",
6310
+ "$schema"
6311
+ ];
6312
+ const sanitized = {};
6313
+ for (const [key, value] of Object.entries(properties)) {
6314
+ if (value && typeof value === "object" && !Array.isArray(value)) {
6315
+ const prop = { ...value };
6316
+ for (const field of unsupportedFields) {
6317
+ delete prop[field];
6318
+ }
6319
+ if (prop.properties && typeof prop.properties === "object") {
6320
+ prop.properties = this.sanitizeProperties(prop.properties);
6321
+ }
6322
+ if (prop.items && typeof prop.items === "object") {
6323
+ const items = { ...prop.items };
6324
+ for (const field of unsupportedFields) {
6325
+ delete items[field];
6326
+ }
6327
+ if (items.properties && typeof items.properties === "object") {
6328
+ items.properties = this.sanitizeProperties(items.properties);
6329
+ }
6330
+ prop.items = items;
6331
+ }
6332
+ sanitized[key] = prop;
6333
+ } else {
6334
+ sanitized[key] = value;
6335
+ }
6336
+ }
6337
+ return sanitized;
6338
+ }
6255
6339
  getGenerationConfig(model, options) {
6256
6340
  return {
6257
6341
  temperature: options.temperature ?? 0.9,
6258
6342
  maxOutputTokens: options.maxTokens ?? 8192
6259
6343
  };
6260
6344
  }
6345
+ pushToolMessages(messages, tool, result, _thinkingBlocks) {
6346
+ messages.push({
6347
+ role: "assistant",
6348
+ content: [
6349
+ {
6350
+ type: "tool_use",
6351
+ id: tool.id,
6352
+ name: tool.name,
6353
+ input: JSON.parse(tool.parameters || "{}")
6354
+ }
6355
+ ]
6356
+ });
6357
+ messages.push({
6358
+ role: "tool",
6359
+ content: [
6360
+ {
6361
+ type: "tool_result",
6362
+ tool_use_id: tool.id,
6363
+ content: result
6364
+ }
6365
+ ]
6366
+ });
6367
+ }
6261
6368
  };
6262
6369
 
6263
6370
  // ../../b4m-core/packages/utils/dist/src/llm/ollamaBackend.js
@@ -6381,29 +6488,27 @@ var OllamaBackend = class {
6381
6488
  };
6382
6489
  });
6383
6490
  }
6384
- // TODO: Tool support will be added in a future epic
6385
- // private pushToolMessages(messages: IMessage[], tool: IChoiceEndToolUse['tool'], result: string) {
6386
- // const toolCallMessage: ExtendedIMessage = {
6387
- // content: '',
6388
- // role: 'assistant',
6389
- // tool_calls: [
6390
- // {
6391
- // id: tool.id,
6392
- // type: 'function',
6393
- // function: {
6394
- // name: tool.name,
6395
- // arguments: tool.parameters,
6396
- // },
6397
- // },
6398
- // ],
6399
- // };
6400
- // const resultMessage: ExtendedIMessage = {
6401
- // role: 'tool',
6402
- // content: JSON.stringify({ result }),
6403
- // tool_call_id: tool.id,
6404
- // };
6405
- // messages.push(toolCallMessage, resultMessage);
6406
- // }
6491
+ pushToolMessages(messages, tool, result, _thinkingBlocks) {
6492
+ messages.push({
6493
+ content: null,
6494
+ role: "assistant",
6495
+ tool_calls: [
6496
+ {
6497
+ id: tool.id,
6498
+ type: "function",
6499
+ function: {
6500
+ name: tool.name,
6501
+ arguments: tool.parameters
6502
+ }
6503
+ }
6504
+ ]
6505
+ });
6506
+ messages.push({
6507
+ role: "tool",
6508
+ content: result,
6509
+ tool_call_id: tool.id
6510
+ });
6511
+ }
6407
6512
  // private formatTools(tools: ICompletionOptionTools[]): Tool[] {
6408
6513
  // return tools.map(tool => ({
6409
6514
  // type: 'function' as const,
@@ -7169,7 +7274,8 @@ var OpenAIBackend = class {
7169
7274
  if (toolCall.function.arguments) {
7170
7275
  toolsUsed.push({
7171
7276
  name: toolCall.function.name,
7172
- arguments: toolCall.function.arguments
7277
+ arguments: toolCall.function.arguments,
7278
+ id: toolCall.id
7173
7279
  });
7174
7280
  }
7175
7281
  }
@@ -7343,7 +7449,8 @@ var OpenAIBackend = class {
7343
7449
  if (tool.name && tool.parameters) {
7344
7450
  toolsUsed.push({
7345
7451
  name: tool.name,
7346
- arguments: tool.parameters
7452
+ arguments: tool.parameters,
7453
+ id: tool.id
7347
7454
  });
7348
7455
  }
7349
7456
  }
@@ -7448,7 +7555,7 @@ Only when someone asks, remember that you are specifically the ${model} model.`;
7448
7555
  });
7449
7556
  return isO1Model ? formattedMessages : [systemMessage, ...formattedMessages];
7450
7557
  }
7451
- pushToolMessages(messages, tool, result) {
7558
+ pushToolMessages(messages, tool, result, _thinkingBlocks) {
7452
7559
  messages.push({
7453
7560
  content: null,
7454
7561
  role: "assistant",
@@ -7726,7 +7833,7 @@ var XAIBackend = class {
7726
7833
  parameters.tools = this.formatTools(options.tools);
7727
7834
  }
7728
7835
  const supportsThinking = await this.modelSupportsThinking(model);
7729
- const thinkingEnabled = supportsThinking && options.thinking?.enabled !== false;
7836
+ const thinkingEnabled = supportsThinking && options.thinking?.enabled === true;
7730
7837
  const cacheStrategy = options.cacheStrategy;
7731
7838
  let headers = {};
7732
7839
  if (cacheStrategy?.enableCaching) {
@@ -7764,7 +7871,8 @@ var XAIBackend = class {
7764
7871
  if (toolCall.function.arguments) {
7765
7872
  toolsUsed.push({
7766
7873
  name: toolCall.function.name,
7767
- arguments: toolCall.function.arguments
7874
+ arguments: toolCall.function.arguments,
7875
+ id: toolCall.id
7768
7876
  });
7769
7877
  }
7770
7878
  }
@@ -7905,11 +8013,12 @@ var XAIBackend = class {
7905
8013
  }
7906
8014
  if (func.length > 0) {
7907
8015
  for await (const tool of func) {
7908
- const { name, parameters: parameters2 } = tool;
8016
+ const { name, parameters: parameters2, id } = tool;
7909
8017
  if (name) {
7910
8018
  toolsUsed.push({
7911
8019
  name,
7912
- arguments: parameters2 || "{}"
8020
+ arguments: parameters2 || "{}",
8021
+ id
7913
8022
  });
7914
8023
  }
7915
8024
  }
@@ -7984,7 +8093,7 @@ var XAIBackend = class {
7984
8093
  function: tool.toolSchema
7985
8094
  }));
7986
8095
  }
7987
- pushToolMessages(messages, tool, result) {
8096
+ pushToolMessages(messages, tool, result, _thinkingBlocks) {
7988
8097
  messages.push({
7989
8098
  content: null,
7990
8099
  role: "assistant",
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  BadRequestError,
4
4
  secureParameters
5
- } from "./chunk-5YLGNW2B.js";
5
+ } from "./chunk-TKCXVYDJ.js";
6
6
  import {
7
7
  CompletionApiUsageTransaction,
8
8
  GenericCreditDeductTransaction,
@@ -13,7 +13,7 @@ import {
13
13
  ToolUsageTransaction,
14
14
  TransferCreditTransaction,
15
15
  VideoGenerationUsageTransaction
16
- } from "./chunk-EY65E4W4.js";
16
+ } from "./chunk-JGSATYRQ.js";
17
17
 
18
18
  // ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
19
19
  import { z } from "zod";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ChatModels
4
- } from "./chunk-EY65E4W4.js";
4
+ } from "./chunk-JGSATYRQ.js";
5
5
  import {
6
6
  DEFAULT_SANDBOX_CONFIG
7
7
  } from "./chunk-4BIBE3J7.js";
@@ -3,7 +3,7 @@ import {
3
3
  fetchLatestVersion,
4
4
  forceCheckForUpdate,
5
5
  package_default
6
- } from "../chunk-FACWWYF7.js";
6
+ } from "../chunk-RVAQGXZD.js";
7
7
 
8
8
  // src/commands/doctorCommand.ts
9
9
  import { execSync } from "child_process";
@@ -36,20 +36,20 @@ import {
36
36
  isReadOnlyTool,
37
37
  loadContextFiles,
38
38
  setWebSocketToolExecutor
39
- } from "../chunk-XIB66EG7.js";
39
+ } from "../chunk-IAG5LCXN.js";
40
40
  import "../chunk-BDQBOLYG.js";
41
- import "../chunk-NJQYWIDJ.js";
41
+ import "../chunk-AVWSA2JN.js";
42
42
  import "../chunk-GQGOWACU.js";
43
- import "../chunk-LJG44UT3.js";
44
- import "../chunk-AOP6RYDY.js";
45
- import "../chunk-5YLGNW2B.js";
43
+ import "../chunk-V7HMAXDX.js";
44
+ import "../chunk-SJBMMQM3.js";
45
+ import "../chunk-TKCXVYDJ.js";
46
46
  import "../chunk-PFBYGCOW.js";
47
47
  import "../chunk-BPFEGDC7.js";
48
48
  import {
49
49
  ConfigStore,
50
50
  logger
51
- } from "../chunk-H7RVLAQD.js";
52
- import "../chunk-EY65E4W4.js";
51
+ } from "../chunk-VSZJ7FSP.js";
52
+ import "../chunk-JGSATYRQ.js";
53
53
  import {
54
54
  DEFAULT_SANDBOX_CONFIG
55
55
  } from "../chunk-4BIBE3J7.js";
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigStore
4
- } from "../chunk-H7RVLAQD.js";
5
- import "../chunk-EY65E4W4.js";
4
+ } from "../chunk-VSZJ7FSP.js";
5
+ import "../chunk-JGSATYRQ.js";
6
6
  import "../chunk-4BIBE3J7.js";
7
7
 
8
8
  // src/commands/mcpCommand.ts
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  forceCheckForUpdate,
4
4
  package_default
5
- } from "../chunk-FACWWYF7.js";
5
+ } from "../chunk-RVAQGXZD.js";
6
6
 
7
7
  // src/commands/updateCommand.ts
8
8
  import { execSync } from "child_process";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  createFabFile,
4
4
  createFabFileSchema
5
- } from "./chunk-AOP6RYDY.js";
6
- import "./chunk-5YLGNW2B.js";
5
+ } from "./chunk-SJBMMQM3.js";
6
+ import "./chunk-TKCXVYDJ.js";
7
7
  import "./chunk-PFBYGCOW.js";
8
- import "./chunk-EY65E4W4.js";
8
+ import "./chunk-JGSATYRQ.js";
9
9
  export {
10
10
  createFabFile,
11
11
  createFabFileSchema
package/dist/index.js CHANGED
@@ -46,23 +46,23 @@ import {
46
46
  setWebSocketToolExecutor,
47
47
  substituteArguments,
48
48
  warmFileCache
49
- } from "./chunk-XIB66EG7.js";
49
+ } from "./chunk-IAG5LCXN.js";
50
50
  import "./chunk-BDQBOLYG.js";
51
- import "./chunk-NJQYWIDJ.js";
51
+ import "./chunk-AVWSA2JN.js";
52
52
  import "./chunk-GQGOWACU.js";
53
- import "./chunk-LJG44UT3.js";
54
- import "./chunk-AOP6RYDY.js";
55
- import "./chunk-5YLGNW2B.js";
53
+ import "./chunk-V7HMAXDX.js";
54
+ import "./chunk-SJBMMQM3.js";
55
+ import "./chunk-TKCXVYDJ.js";
56
56
  import "./chunk-PFBYGCOW.js";
57
57
  import "./chunk-BPFEGDC7.js";
58
58
  import {
59
59
  ConfigStore,
60
60
  logger
61
- } from "./chunk-H7RVLAQD.js";
61
+ } from "./chunk-VSZJ7FSP.js";
62
62
  import {
63
63
  checkForUpdate,
64
64
  package_default
65
- } from "./chunk-FACWWYF7.js";
65
+ } from "./chunk-RVAQGXZD.js";
66
66
  import {
67
67
  selectActiveBackgroundAgents,
68
68
  useCliStore
@@ -70,7 +70,7 @@ import {
70
70
  import {
71
71
  CREDIT_DEDUCT_TRANSACTION_TYPES,
72
72
  ChatModels
73
- } from "./chunk-EY65E4W4.js";
73
+ } from "./chunk-JGSATYRQ.js";
74
74
  import "./chunk-4BIBE3J7.js";
75
75
 
76
76
  // src/index.tsx
@@ -2454,6 +2454,9 @@ Please acknowledge these background agent results and incorporate them into your
2454
2454
  }
2455
2455
  return this.inner.complete(model, effectiveMessages, options, callback);
2456
2456
  }
2457
+ pushToolMessages(messages, tool, result) {
2458
+ return this.inner.pushToolMessages(messages, tool, result);
2459
+ }
2457
2460
  async getModelInfo() {
2458
2461
  return this.inner.getModelInfo();
2459
2462
  }
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-EY65E4W4.js";
4
+ } from "./chunk-JGSATYRQ.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-EY65E4W4.js";
4
+ } from "./chunk-JGSATYRQ.js";
5
5
 
6
6
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/markdownGenerator.js
7
7
  var DEFAULT_OPTIONS = {
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  findMostSimilarMemento,
4
4
  getRelevantMementos
5
- } from "./chunk-NJQYWIDJ.js";
6
- import "./chunk-5YLGNW2B.js";
5
+ } from "./chunk-AVWSA2JN.js";
6
+ import "./chunk-TKCXVYDJ.js";
7
7
  import "./chunk-PFBYGCOW.js";
8
- import "./chunk-EY65E4W4.js";
8
+ import "./chunk-JGSATYRQ.js";
9
9
  export {
10
10
  findMostSimilarMemento,
11
11
  getRelevantMementos
@@ -139,7 +139,7 @@ import {
139
139
  validateUrlForFetch,
140
140
  warmUpSettingsCache,
141
141
  withRetry
142
- } from "./chunk-5YLGNW2B.js";
142
+ } from "./chunk-TKCXVYDJ.js";
143
143
  import {
144
144
  Logger,
145
145
  NotificationDeduplicator,
@@ -152,7 +152,7 @@ import {
152
152
  buildRateLimitLogEntry,
153
153
  isNearLimit,
154
154
  parseRateLimitHeaders
155
- } from "./chunk-EY65E4W4.js";
155
+ } from "./chunk-JGSATYRQ.js";
156
156
  export {
157
157
  AIVideoService,
158
158
  AWSBackend,
@@ -4,6 +4,7 @@ import {
4
4
  ALL_IMAGE_SIZES,
5
5
  API_SERVICE_GROUPS,
6
6
  APP_NAME,
7
+ AdminSystemPromptCategory,
7
8
  AgileApi,
8
9
  AiEvents,
9
10
  ApiKeyEvents,
@@ -457,12 +458,13 @@ import {
457
458
  validateReactArtifactV2,
458
459
  validateSvgArtifactV2,
459
460
  wikiMarkupToAdf
460
- } from "./chunk-EY65E4W4.js";
461
+ } from "./chunk-JGSATYRQ.js";
461
462
  export {
462
463
  ALL_IMAGE_MODELS,
463
464
  ALL_IMAGE_SIZES,
464
465
  API_SERVICE_GROUPS,
465
466
  APP_NAME,
467
+ AdminSystemPromptCategory,
466
468
  AgileApi,
467
469
  AiEvents,
468
470
  ApiKeyEvents,
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  SubtractCreditsSchema,
4
4
  subtractCredits
5
- } from "./chunk-LJG44UT3.js";
6
- import "./chunk-5YLGNW2B.js";
5
+ } from "./chunk-V7HMAXDX.js";
6
+ import "./chunk-TKCXVYDJ.js";
7
7
  import "./chunk-PFBYGCOW.js";
8
- import "./chunk-EY65E4W4.js";
8
+ import "./chunk-JGSATYRQ.js";
9
9
  export {
10
10
  SubtractCreditsSchema,
11
11
  subtractCredits
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.2.37",
3
+ "version": "0.2.38-feat-ionq-sales-intelligence.20110+eee0abd6a",
4
4
  "type": "module",
5
5
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
6
6
  "license": "UNLICENSED",
@@ -114,10 +114,10 @@
114
114
  },
115
115
  "devDependencies": {
116
116
  "@bike4mind/agents": "0.1.0",
117
- "@bike4mind/common": "2.58.0",
118
- "@bike4mind/mcp": "1.32.5",
119
- "@bike4mind/services": "2.54.1",
120
- "@bike4mind/utils": "2.11.0",
117
+ "@bike4mind/common": "2.58.1-feat-ionq-sales-intelligence.20110+eee0abd6a",
118
+ "@bike4mind/mcp": "1.32.6-feat-ionq-sales-intelligence.20110+eee0abd6a",
119
+ "@bike4mind/services": "2.54.2-feat-ionq-sales-intelligence.20110+eee0abd6a",
120
+ "@bike4mind/utils": "2.11.1-feat-ionq-sales-intelligence.20110+eee0abd6a",
121
121
  "@types/better-sqlite3": "^7.6.13",
122
122
  "@types/diff": "^5.0.9",
123
123
  "@types/jsonwebtoken": "^9.0.4",
@@ -135,5 +135,5 @@
135
135
  "optionalDependencies": {
136
136
  "@vscode/ripgrep": "^1.17.0"
137
137
  },
138
- "gitHead": "474cb1d4152b065eb696701af0f8c20fb8daed57"
138
+ "gitHead": "eee0abd6a3a3620e42e5445b3fcd8687e08d2006"
139
139
  }