@bike4mind/cli 0.2.10-fix-b4m-cli-flicker.17243 → 0.2.10-fix-extendend-thinking-with-tool-use.17269

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-DJPXSSP4.js";
4
+ } from "./chunk-3OX632TE.js";
5
5
  import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/artifactExtractor.js
@@ -5901,6 +5901,9 @@ function buildSSEEvent(text, info) {
5901
5901
  outputTokens: info.outputTokens
5902
5902
  };
5903
5903
  }
5904
+ if (info?.thinking && info.thinking.length > 0) {
5905
+ event.thinking = info.thinking;
5906
+ }
5904
5907
  return event;
5905
5908
  }
5906
5909
  function formatSSEError(error) {
@@ -6,12 +6,12 @@ import {
6
6
  getSettingsByNames,
7
7
  obfuscateApiKey,
8
8
  secureParameters
9
- } from "./chunk-GCVIRGIN.js";
9
+ } from "./chunk-T7NEJI2V.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-DJPXSSP4.js";
14
+ } from "./chunk-3OX632TE.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-GCVIRGIN.js";
10
+ } from "./chunk-T7NEJI2V.js";
11
11
  import {
12
12
  KnowledgeType,
13
13
  SupportedFabFileMimeTypes
14
- } from "./chunk-DJPXSSP4.js";
14
+ } from "./chunk-3OX632TE.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-GCVIRGIN.js";
5
+ } from "./chunk-T7NEJI2V.js";
6
6
  import {
7
7
  GenericCreditDeductTransaction,
8
8
  ImageEditUsageTransaction,
@@ -10,7 +10,7 @@ import {
10
10
  RealtimeVoiceUsageTransaction,
11
11
  TextGenerationUsageTransaction,
12
12
  TransferCreditTransaction
13
- } from "./chunk-DJPXSSP4.js";
13
+ } from "./chunk-3OX632TE.js";
14
14
 
15
15
  // ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
16
16
  import { z } from "zod";
@@ -16,7 +16,7 @@ import {
16
16
  dayjsConfig_default,
17
17
  extractSnippetMeta,
18
18
  settingsMap
19
- } from "./chunk-DJPXSSP4.js";
19
+ } from "./chunk-3OX632TE.js";
20
20
 
21
21
  // ../../b4m-core/packages/utils/dist/src/storage/S3Storage.js
22
22
  import { S3Client, PutObjectCommand, DeleteObjectCommand, GetObjectCommand, HeadObjectCommand } from "@aws-sdk/client-s3";
@@ -701,8 +701,12 @@ var AnthropicBackend = class {
701
701
  this.logger.debug(`[Tool Execution] Last few messages:`, JSON.stringify(messages.slice(-3), null, 2));
702
702
  await this.complete(model, messages, options, cb, toolsUsed);
703
703
  } else {
704
- this.logger.debug(`[Tool Execution] executeTools=false, passing tool calls to callback`);
705
- await cb([null], { toolsUsed });
704
+ const thinkingBlocks = this.isThinkingEnabled ? this.lastAssistantContent.filter((block) => block?.type === "thinking" || block?.type === "redacted_thinking") : void 0;
705
+ this.logger.debug(`[Tool Execution] executeTools=false, passing tool calls to callback with ${thinkingBlocks?.length || 0} thinking blocks`);
706
+ await cb([null], {
707
+ toolsUsed,
708
+ thinking: thinkingBlocks?.length ? thinkingBlocks : void 0
709
+ });
706
710
  }
707
711
  return;
708
712
  }
@@ -774,8 +778,12 @@ var AnthropicBackend = class {
774
778
  await this.complete(model, messages, { ...options, tools: void 0, _internal: void 0 }, cb, toolsUsed);
775
779
  }
776
780
  } else {
777
- this.logger.debug(`[Tool Execution] executeTools=false, passing tool calls to callback`);
778
- await cb([null], { toolsUsed });
781
+ const thinkingBlocks = this.isThinkingEnabled ? this.lastAssistantContent.filter((block) => block?.type === "thinking" || block?.type === "redacted_thinking") : void 0;
782
+ this.logger.debug(`[Tool Execution] executeTools=false, passing tool calls to callback with ${thinkingBlocks?.length || 0} thinking blocks`);
783
+ await cb([null], {
784
+ toolsUsed,
785
+ thinking: thinkingBlocks?.length ? thinkingBlocks : void 0
786
+ });
779
787
  }
780
788
  return;
781
789
  }
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  createFabFile,
4
4
  createFabFileSchema
5
- } from "./chunk-AQBZVAYO.js";
6
- import "./chunk-GCVIRGIN.js";
5
+ } from "./chunk-J5CBHZGK.js";
6
+ import "./chunk-T7NEJI2V.js";
7
7
  import "./chunk-AMDXHL6S.js";
8
- import "./chunk-DJPXSSP4.js";
8
+ import "./chunk-3OX632TE.js";
9
9
  import "./chunk-PDX44BCA.js";
10
10
  export {
11
11
  createFabFile,