@bike4mind/cli 0.2.29-slack-native-search.18848 → 0.2.29

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.
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ HydrationEngine,
4
+ createHydrationEngine
5
+ } from "./chunk-RUI6HNLO.js";
6
+ export {
7
+ HydrationEngine,
8
+ createHydrationEngine
9
+ };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-MPSPHOIZ.js";
4
+ } from "./chunk-TNFZP7FG.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-MDOLASLI.js";
9
+ } from "./chunk-5J4RL57F.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-MPSPHOIZ.js";
14
+ } from "./chunk-TNFZP7FG.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
17
17
  import { z } from "zod";
@@ -15,7 +15,7 @@ import {
15
15
  dayjsConfig_default,
16
16
  extractSnippetMeta,
17
17
  settingsMap
18
- } from "./chunk-MPSPHOIZ.js";
18
+ } from "./chunk-TNFZP7FG.js";
19
19
  import {
20
20
  Logger
21
21
  } from "./chunk-OCYRD7D6.js";
@@ -227,7 +227,7 @@ var ChoiceEndReason;
227
227
  // ../../b4m-core/packages/utils/dist/src/llm/toolStreamingHelper.js
228
228
  async function handleToolResultStreaming(toolName, toolResult, streamCallback) {
229
229
  const resultString = toolResult.toString();
230
- const shouldStream = toolName === "recharts" || resultString.includes("<artifact") || resultString.includes('type="application/vnd.ant.');
230
+ const shouldStream = toolName === "recharts" || resultString.includes("<artifact") || resultString.includes('type="application/vnd.ant.') || resultString.includes('type="application/vnd.b4m.');
231
231
  if (shouldStream) {
232
232
  await streamCallback([resultString]);
233
233
  }
@@ -1132,7 +1132,7 @@ async function calculateTotalTokenLength(messages, { estimateOnly = false, token
1132
1132
  concatenatedContent += message.role;
1133
1133
  if (Array.isArray(message.content)) {
1134
1134
  message.content.forEach((obj) => {
1135
- if (obj.type === "image") {
1135
+ if (obj.type === "image" || obj.type === "image_url") {
1136
1136
  imageTokenCount += 1600;
1137
1137
  } else {
1138
1138
  concatenatedContent += JSON.stringify(obj);
@@ -1285,11 +1285,14 @@ async function processFabFilesServer(embeddingFactory, fabFiles, userPrompt, max
1285
1285
  }
1286
1286
  switch (modelInfo?.backend) {
1287
1287
  case ModelBackend.OpenAI:
1288
- case ModelBackend.XAI:
1288
+ case ModelBackend.XAI: {
1289
+ const openaiImageBuffer = await storage.download(file.filePath);
1290
+ const { mime: openaiMimeType } = await getFileType(openaiImageBuffer, file.fileName, file.mimeType);
1291
+ const openaiBase64 = openaiImageBuffer.toString("base64");
1289
1292
  imageContent.push({
1290
1293
  type: "image_url",
1291
1294
  image_url: {
1292
- url: fileUrl
1295
+ url: `data:${openaiMimeType};base64,${openaiBase64}`
1293
1296
  }
1294
1297
  });
1295
1298
  imageContent.push({
@@ -1297,6 +1300,7 @@ async function processFabFilesServer(embeddingFactory, fabFiles, userPrompt, max
1297
1300
  text: `Image URL: ${fileUrl}`
1298
1301
  });
1299
1302
  break;
1303
+ }
1300
1304
  case ModelBackend.Anthropic:
1301
1305
  case ModelBackend.Gemini:
1302
1306
  case ModelBackend.Bedrock:
@@ -1793,7 +1797,6 @@ var ensureToolPairingIntegrity = (messages, logger) => {
1793
1797
  }
1794
1798
  logger.log(`Tool pairing integrity: removed ${parts.join(" and ")} after truncation`);
1795
1799
  }
1796
- let adjacencyStrippedCount = 0;
1797
1800
  for (let i = 0; i < result.length; i++) {
1798
1801
  const msg = result[i];
1799
1802
  if (msg.role !== "assistant" || !Array.isArray(msg.content))
@@ -1818,7 +1821,6 @@ var ensureToolPairingIntegrity = (messages, logger) => {
1818
1821
  const unmatchedSet = new Set(unmatchedIds);
1819
1822
  const filtered = content.filter((b) => {
1820
1823
  if (b.type === "tool_use" && "id" in b && unmatchedSet.has(b.id)) {
1821
- adjacencyStrippedCount++;
1822
1824
  return false;
1823
1825
  }
1824
1826
  return true;
@@ -6889,6 +6891,24 @@ var XAIBackend = class {
6889
6891
  }
6890
6892
  async getModelInfo() {
6891
6893
  return [
6894
+ {
6895
+ id: ChatModels.GROK_4,
6896
+ type: "text",
6897
+ name: "Grok 4",
6898
+ backend: ModelBackend.XAI,
6899
+ contextWindow: 256e3,
6900
+ max_tokens: 16384,
6901
+ can_stream: true,
6902
+ pricing: {
6903
+ // $3.00 / 1M Input tokens, $15.00 / 1M Output tokens. @see https://docs.x.ai/developers/models
6904
+ 256e3: { input: 3 / 1e6, output: 15 / 1e6 }
6905
+ },
6906
+ can_think: true,
6907
+ supportsVision: true,
6908
+ supportsTools: true,
6909
+ supportsImageVariation: false,
6910
+ description: "xAI's most capable reasoning model. Excels at complex problem-solving, coding, math, and multimodal understanding with 256K context window."
6911
+ },
6892
6912
  {
6893
6913
  id: ChatModels.GROK_3,
6894
6914
  type: "text",
@@ -7424,23 +7444,16 @@ var PipelineTimer = class {
7424
7444
  totalMs() {
7425
7445
  return Date.now() - this.start;
7426
7446
  }
7427
- /** Formatted multi-line summary table suitable for logging. */
7447
+ /** Formatted single-line summary suitable for structured loggers that prefix each line. */
7428
7448
  summary() {
7429
7449
  const total = this.totalMs();
7430
- const lines = [];
7431
- lines.push("Phase Duration % of Total");
7432
- lines.push("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
7450
+ const parts = [];
7433
7451
  for (const p of this.phases) {
7434
7452
  const dur = (p.end ?? Date.now()) - p.start;
7435
7453
  const pct = total > 0 ? (dur / total * 100).toFixed(1) : "0.0";
7436
- const name = p.name.padEnd(23);
7437
- const durStr = `${dur}ms`.padStart(9);
7438
- const pctStr = `${pct}%`.padStart(10);
7439
- lines.push(`${name} ${durStr} ${pctStr}`);
7454
+ parts.push(`${p.name}: ${dur}ms (${pct}%)`);
7440
7455
  }
7441
- lines.push("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
7442
- lines.push(`${"TOTAL".padEnd(23)} ${`${total}ms`.padStart(9)}`);
7443
- return lines.join("\n");
7456
+ return `${parts.join(" | ")} | TOTAL: ${total}ms`;
7444
7457
  }
7445
7458
  };
7446
7459
 
@@ -11268,6 +11281,8 @@ function mapMimeTypeToArtifactType(mimeType) {
11268
11281
  case ClaudeArtifactMimeTypes.MARKDOWN:
11269
11282
  return "code";
11270
11283
  // Treat markdown as code for now
11284
+ case ClaudeArtifactMimeTypes.LATTICE:
11285
+ return "lattice";
11271
11286
  default:
11272
11287
  if (mimeType.includes("javascript") || mimeType.includes("jsx")) {
11273
11288
  return "react";