@bike4mind/cli 0.2.1-optimize-mcp-server-call.17006 → 0.2.2

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.
File without changes
@@ -7,7 +7,7 @@ import {
7
7
  getSettingsMap,
8
8
  getSettingsValue,
9
9
  secureParameters
10
- } from "./chunk-U3GPYBTD.js";
10
+ } from "./chunk-NZADYDFG.js";
11
11
  import {
12
12
  KnowledgeType,
13
13
  SupportedFabFileMimeTypes
File without changes
File without changes
File without changes
@@ -6,7 +6,7 @@ import {
6
6
  getSettingsByNames,
7
7
  obfuscateApiKey,
8
8
  secureParameters
9
- } from "./chunk-U3GPYBTD.js";
9
+ } from "./chunk-NZADYDFG.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
@@ -610,6 +610,10 @@ var AnthropicBackend = class {
610
610
  }
611
611
  if (collectedContent[event.index] && collectedContent[event.index].type === "tool_use") {
612
612
  }
613
+ } else if ("delta" in event && event.delta.type === "signature_delta") {
614
+ if (collectedContent[event.index] && collectedContent[event.index].type === "thinking") {
615
+ collectedContent[event.index].signature = event.delta.signature;
616
+ }
613
617
  }
614
618
  } else if (event.type === "content_block_stop") {
615
619
  if (isInThinkingBlock) {
@@ -792,14 +796,11 @@ var AnthropicBackend = class {
792
796
  }
793
797
  pushToolMessages(messages, tool, result, previousMessage) {
794
798
  if (this.isThinkingEnabled && this.lastAssistantContent.length > 0) {
795
- const contentWithoutThinking = this.lastAssistantContent.filter((block) => {
796
- return block.type !== "thinking";
797
- });
798
799
  messages.push({
799
800
  role: "assistant",
800
- content: contentWithoutThinking
801
+ content: this.lastAssistantContent
801
802
  });
802
- this.logger.debug(`[AnthropicBackend] Filtered thinking blocks from assistant content. Original: ${this.lastAssistantContent.length} blocks, Filtered: ${contentWithoutThinking.length} blocks`);
803
+ this.logger.debug(`[AnthropicBackend] Including ${this.lastAssistantContent.length} content blocks (thinking + tool_use) in assistant message`);
803
804
  } else {
804
805
  messages.push({
805
806
  role: "assistant",
@@ -1118,8 +1119,12 @@ var BaseBedrockBackend = class {
1118
1119
  await callback(streamedText, { inputTokens, outputTokens, toolsUsed });
1119
1120
  }
1120
1121
  } catch (error) {
1121
- console.error(`[BaseBedrockBackend] Error invoking model ${model}:`, error);
1122
1122
  if (error instanceof Error) {
1123
+ if (error.message.includes("aborted")) {
1124
+ console.log("[BaseBedrockBackend] Request aborted, skipping error logging");
1125
+ throw error;
1126
+ }
1127
+ console.error(`[BaseBedrockBackend] Error invoking model ${model}:`, error);
1123
1128
  console.error(`[BaseBedrockBackend] Error details:`, {
1124
1129
  name: error.name,
1125
1130
  message: error.message,
@@ -9952,7 +9957,7 @@ function shouldTriggerFallback(error) {
9952
9957
  return true;
9953
9958
  }
9954
9959
  }
9955
- if ("code" in error && error.code === "ECONNRESET") {
9960
+ if ("code" in error && error.code === "ECONNRESET" && !message.includes("aborted")) {
9956
9961
  return true;
9957
9962
  }
9958
9963
  if (error.name === "TypeError" && message.includes("terminated")) {
File without changes
File without changes
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  BadRequestError,
4
4
  secureParameters
5
- } from "./chunk-U3GPYBTD.js";
5
+ } from "./chunk-NZADYDFG.js";
6
6
  import {
7
7
  GenericCreditDeductTransaction,
8
8
  ImageEditUsageTransaction,
@@ -22,12 +22,20 @@ var SubtractCreditsSchema = z.discriminatedUnion("type", [
22
22
  ImageEditUsageTransaction.omit({ createdAt: true, updatedAt: true }),
23
23
  TransferCreditTransaction.omit({ createdAt: true, updatedAt: true })
24
24
  ]);
25
- async function subtractCredits(parameters, { db, creditHolderMethods }) {
25
+ async function subtractCredits(parameters, { db, creditHolderMethods, skipBalanceUpdate, currentCreditHolder }) {
26
26
  const params = secureParameters(parameters, SubtractCreditsSchema);
27
27
  const { ownerId, ownerType, credits, type, description, metadata } = params;
28
- const updatedEntity = await creditHolderMethods.incrementCredits(ownerId, -credits);
29
- if (!updatedEntity) {
30
- throw new BadRequestError("Failed to update credits");
28
+ let updatedEntity;
29
+ if (skipBalanceUpdate) {
30
+ if (!currentCreditHolder) {
31
+ throw new BadRequestError("currentCreditHolder is required when skipBalanceUpdate is true");
32
+ }
33
+ updatedEntity = currentCreditHolder;
34
+ } else {
35
+ updatedEntity = await creditHolderMethods.incrementCredits(ownerId, -credits);
36
+ if (!updatedEntity) {
37
+ throw new BadRequestError("Failed to update credits");
38
+ }
31
39
  }
32
40
  if (type === "generic_deduct") {
33
41
  await db.creditTransactions.createTransaction("generic_deduct", {
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  createFabFile,
4
4
  createFabFileSchema
5
- } from "./chunk-F3ETXO5N.js";
6
- import "./chunk-U3GPYBTD.js";
5
+ } from "./chunk-5N4PG5EH.js";
6
+ import "./chunk-NZADYDFG.js";
7
7
  import "./chunk-AMDXHL6S.js";
8
8
  import "./chunk-WR6YZRQV.js";
9
9
  import "./chunk-PDX44BCA.js";
File without changes