@bike4mind/cli 0.2.29-prod.18975 → 0.2.29-refactor-extract-workers-and-shared.18923

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-5GSDPBTM.js";
4
+ } from "./chunk-FKJTU7KU.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-S7BPPS33.js";
9
+ } from "./chunk-Q7CVAY4M.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-5GSDPBTM.js";
14
+ } from "./chunk-FKJTU7KU.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
17
17
  import { z } from "zod";
@@ -7,11 +7,11 @@ import {
7
7
  getSettingsMap,
8
8
  getSettingsValue,
9
9
  secureParameters
10
- } from "./chunk-S7BPPS33.js";
10
+ } from "./chunk-Q7CVAY4M.js";
11
11
  import {
12
12
  KnowledgeType,
13
13
  SupportedFabFileMimeTypes
14
- } from "./chunk-5GSDPBTM.js";
14
+ } from "./chunk-FKJTU7KU.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/fabFileService/create.js
17
17
  import { z } from "zod";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  BadRequestError,
4
4
  secureParameters
5
- } from "./chunk-S7BPPS33.js";
5
+ } from "./chunk-Q7CVAY4M.js";
6
6
  import {
7
7
  CompletionApiUsageTransaction,
8
8
  GenericCreditDeductTransaction,
@@ -12,7 +12,7 @@ import {
12
12
  TextGenerationUsageTransaction,
13
13
  TransferCreditTransaction,
14
14
  VideoGenerationUsageTransaction
15
- } from "./chunk-5GSDPBTM.js";
15
+ } from "./chunk-FKJTU7KU.js";
16
16
 
17
17
  // ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
18
18
  import { z } from "zod";
@@ -7781,6 +7781,12 @@ function buildSSEEvent(text, info) {
7781
7781
  outputTokens: info.outputTokens
7782
7782
  };
7783
7783
  }
7784
+ if (info?.creditsUsed !== void 0 || info?.usdCost !== void 0) {
7785
+ event.credits = {
7786
+ used: info.creditsUsed,
7787
+ usdCost: info.usdCost
7788
+ };
7789
+ }
7784
7790
  if (info?.thinking && info.thinking.length > 0) {
7785
7791
  event.thinking = info.thinking;
7786
7792
  }
@@ -15,7 +15,7 @@ import {
15
15
  dayjsConfig_default,
16
16
  extractSnippetMeta,
17
17
  settingsMap
18
- } from "./chunk-5GSDPBTM.js";
18
+ } from "./chunk-FKJTU7KU.js";
19
19
  import {
20
20
  Logger
21
21
  } from "./chunk-OCYRD7D6.js";
@@ -1797,7 +1797,6 @@ var ensureToolPairingIntegrity = (messages, logger) => {
1797
1797
  }
1798
1798
  logger.log(`Tool pairing integrity: removed ${parts.join(" and ")} after truncation`);
1799
1799
  }
1800
- let adjacencyStrippedCount = 0;
1801
1800
  for (let i = 0; i < result.length; i++) {
1802
1801
  const msg = result[i];
1803
1802
  if (msg.role !== "assistant" || !Array.isArray(msg.content))
@@ -1822,7 +1821,6 @@ var ensureToolPairingIntegrity = (messages, logger) => {
1822
1821
  const unmatchedSet = new Set(unmatchedIds);
1823
1822
  const filtered = content.filter((b) => {
1824
1823
  if (b.type === "tool_use" && "id" in b && unmatchedSet.has(b.id)) {
1825
- adjacencyStrippedCount++;
1826
1824
  return false;
1827
1825
  }
1828
1826
  return true;
@@ -7446,23 +7444,16 @@ var PipelineTimer = class {
7446
7444
  totalMs() {
7447
7445
  return Date.now() - this.start;
7448
7446
  }
7449
- /** Formatted multi-line summary table suitable for logging. */
7447
+ /** Formatted single-line summary suitable for structured loggers that prefix each line. */
7450
7448
  summary() {
7451
7449
  const total = this.totalMs();
7452
- const lines = [];
7453
- lines.push("Phase Duration % of Total");
7454
- 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 = [];
7455
7451
  for (const p of this.phases) {
7456
7452
  const dur = (p.end ?? Date.now()) - p.start;
7457
7453
  const pct = total > 0 ? (dur / total * 100).toFixed(1) : "0.0";
7458
- const name = p.name.padEnd(23);
7459
- const durStr = `${dur}ms`.padStart(9);
7460
- const pctStr = `${pct}%`.padStart(10);
7461
- lines.push(`${name} ${durStr} ${pctStr}`);
7462
- }
7463
- 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");
7464
- lines.push(`${"TOTAL".padEnd(23)} ${`${total}ms`.padStart(9)}`);
7465
- return lines.join("\n");
7454
+ parts.push(`${p.name}: ${dur}ms (${pct}%)`);
7455
+ }
7456
+ return `${parts.join(" | ")} | TOTAL: ${total}ms`;
7466
7457
  }
7467
7458
  };
7468
7459
 
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  createFabFile,
4
4
  createFabFileSchema
5
- } from "./chunk-ELTTBWAQ.js";
6
- import "./chunk-S7BPPS33.js";
7
- import "./chunk-5GSDPBTM.js";
5
+ } from "./chunk-5JTIPGUF.js";
6
+ import "./chunk-Q7CVAY4M.js";
7
+ import "./chunk-FKJTU7KU.js";
8
8
  import "./chunk-OCYRD7D6.js";
9
9
  export {
10
10
  createFabFile,