@bike4mind/cli 0.2.16-block-missing-tool-result.17608 → 0.2.16-cj-GH6131.17608

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-LL5J3SVB.js";
4
+ } from "./chunk-KGX2FFHZ.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-W2GB4FA6.js";
9
+ } from "./chunk-VGF6M3GC.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-LL5J3SVB.js";
14
+ } from "./chunk-KGX2FFHZ.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
17
17
  import { z } from "zod";
@@ -4491,10 +4491,11 @@ function formatPageResponse(page, siteUrl) {
4491
4491
  link = `${baseUrl}/pages/${page.id}`;
4492
4492
  }
4493
4493
  return {
4494
- id: page.id,
4494
+ pageId: page.id,
4495
4495
  title: page.title,
4496
4496
  status: page.status,
4497
4497
  spaceId: page.spaceId,
4498
+ spaceKey: page.space?.key,
4498
4499
  body: stripHtmlAndNormalizeWhitespace(page.body?.storage?.value || page.body?.view?.value),
4499
4500
  version: page.version?.number,
4500
4501
  parentId: page.parentId,
@@ -4564,7 +4565,7 @@ function formatPageList(pagesResponse, siteUrl) {
4564
4565
  return pagesResponse;
4565
4566
  }
4566
4567
  const results = Array.isArray(pagesResponse.results) ? pagesResponse.results.map((page) => ({
4567
- id: page.id,
4568
+ pageId: page.id,
4568
4569
  title: page.title,
4569
4570
  status: page.status,
4570
4571
  parentId: page.parentId,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  BadRequestError,
4
4
  secureParameters
5
- } from "./chunk-W2GB4FA6.js";
5
+ } from "./chunk-VGF6M3GC.js";
6
6
  import {
7
7
  CompletionApiUsageTransaction,
8
8
  GenericCreditDeductTransaction,
@@ -11,7 +11,7 @@ import {
11
11
  RealtimeVoiceUsageTransaction,
12
12
  TextGenerationUsageTransaction,
13
13
  TransferCreditTransaction
14
- } from "./chunk-LL5J3SVB.js";
14
+ } from "./chunk-KGX2FFHZ.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
17
17
  import { z } from "zod";
@@ -13,7 +13,7 @@ import {
13
13
  dayjsConfig_default,
14
14
  extractSnippetMeta,
15
15
  settingsMap
16
- } from "./chunk-LL5J3SVB.js";
16
+ } from "./chunk-KGX2FFHZ.js";
17
17
  import {
18
18
  Logger
19
19
  } from "./chunk-OCYRD7D6.js";
@@ -6515,60 +6515,30 @@ async function buildAndSortMessages(previousMessages, fabMessages, userPrompt, m
6515
6515
  }
6516
6516
  }
6517
6517
  const imageMessages = fabMessages.filter((message) => message.role === "user" && Array.isArray(message.content) && message.content.some((obj) => obj.type.startsWith("image")));
6518
- const lastHistoryMessage = processedPreviousMessages[processedPreviousMessages.length - 1];
6519
- const historyEndsWithToolUse = lastHistoryMessage?.role === "assistant" && Array.isArray(lastHistoryMessage.content) && lastHistoryMessage.content.some((block) => block.type === "tool_use");
6520
- const promptHasToolResult = userPrompt.some((msg) => msg.role === "user" && Array.isArray(msg.content) && msg.content.some((block) => block.type === "tool_result"));
6521
- let messages;
6522
- if (historyEndsWithToolUse && promptHasToolResult) {
6523
- messages = [
6524
- ...systemMessages,
6525
- // System messages go first for instruction
6526
- ...processedPreviousMessages,
6527
- // previous message context
6528
- ...userPrompt,
6529
- // Tool result must follow tool use immediately
6530
- ...imageMessages,
6531
- // Include all image messages
6532
- ...processedContentMessages
6533
- // fab file content (non-image messages)
6534
- ];
6535
- } else {
6536
- messages = [
6537
- ...systemMessages,
6538
- // System messages go first for instruction
6539
- ...processedPreviousMessages,
6540
- // previous message context
6541
- ...imageMessages,
6542
- // Include all image messages
6543
- ...processedContentMessages,
6544
- // fab file content (non-image messages)
6545
- ...userPrompt
6546
- // Spread the userPrompt array into the messages array
6547
- ];
6548
- }
6518
+ const messages = [
6519
+ ...systemMessages,
6520
+ // System messages go first for instruction
6521
+ ...processedPreviousMessages,
6522
+ // previous message context
6523
+ ...imageMessages,
6524
+ // Include all image messages
6525
+ ...processedContentMessages,
6526
+ // fab file content (non-image messages)
6527
+ ...userPrompt
6528
+ // Spread the userPrompt array into the messages array
6529
+ ];
6549
6530
  const finalTokenCount = await calculateTotalTokenLength(messages, { estimateOnly: false, tokenizer });
6550
6531
  if (finalTokenCount > maxInputTokens) {
6551
6532
  logger.warn(`\u26A0\uFE0F Final message token count (${finalTokenCount}) exceeds maxInputTokens (${maxInputTokens}). Truncating messages.`);
6552
6533
  const excessTokens = finalTokenCount - maxInputTokens;
6553
6534
  const reducedContentMessagesResult = processMessages(processedContentMessages, Math.max(0, await calculateTotalTokenLength(processedContentMessages, { estimateOnly: false, tokenizer }) - excessTokens));
6554
- let truncatedMessages;
6555
- if (historyEndsWithToolUse && promptHasToolResult) {
6556
- truncatedMessages = [
6557
- ...systemMessages,
6558
- ...processedPreviousMessages,
6559
- ...userPrompt,
6560
- ...imageMessages,
6561
- ...reducedContentMessagesResult.messages
6562
- ];
6563
- } else {
6564
- truncatedMessages = [
6565
- ...systemMessages,
6566
- ...processedPreviousMessages,
6567
- ...imageMessages,
6568
- ...reducedContentMessagesResult.messages,
6569
- ...userPrompt
6570
- ];
6571
- }
6535
+ const truncatedMessages = [
6536
+ ...systemMessages,
6537
+ ...processedPreviousMessages,
6538
+ ...imageMessages,
6539
+ ...reducedContentMessagesResult.messages,
6540
+ ...userPrompt
6541
+ ];
6572
6542
  return ensureToolPairingIntegrity(truncatedMessages, logger);
6573
6543
  }
6574
6544
  const VERBOSE_MESSAGE_BUILDING = process.env.VERBOSE_MESSAGE_BUILDING === "true";
@@ -7,11 +7,11 @@ import {
7
7
  getSettingsMap,
8
8
  getSettingsValue,
9
9
  secureParameters
10
- } from "./chunk-W2GB4FA6.js";
10
+ } from "./chunk-VGF6M3GC.js";
11
11
  import {
12
12
  KnowledgeType,
13
13
  SupportedFabFileMimeTypes
14
- } from "./chunk-LL5J3SVB.js";
14
+ } from "./chunk-KGX2FFHZ.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/fabFileService/create.js
17
17
  import { z } from "zod";
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  createFabFile,
4
4
  createFabFileSchema
5
- } from "./chunk-HG7OEWJG.js";
6
- import "./chunk-W2GB4FA6.js";
7
- import "./chunk-LL5J3SVB.js";
5
+ } from "./chunk-WGSIOHQC.js";
6
+ import "./chunk-VGF6M3GC.js";
7
+ import "./chunk-KGX2FFHZ.js";
8
8
  import "./chunk-OCYRD7D6.js";
9
9
  export {
10
10
  createFabFile,
package/dist/index.js CHANGED
@@ -4,12 +4,12 @@ import {
4
4
  getEffectiveApiKey,
5
5
  getOpenWeatherKey,
6
6
  getSerperKey
7
- } from "./chunk-ISY2LX2J.js";
7
+ } from "./chunk-GJ3EQRX5.js";
8
8
  import {
9
9
  ConfigStore
10
10
  } from "./chunk-FFJX3FF3.js";
11
- import "./chunk-32MIJDKQ.js";
12
- import "./chunk-HG7OEWJG.js";
11
+ import "./chunk-PJQUVSHP.js";
12
+ import "./chunk-WGSIOHQC.js";
13
13
  import {
14
14
  BFLImageService,
15
15
  BaseStorage,
@@ -21,7 +21,7 @@ import {
21
21
  OpenAIBackend,
22
22
  OpenAIImageService,
23
23
  XAIImageService
24
- } from "./chunk-W2GB4FA6.js";
24
+ } from "./chunk-VGF6M3GC.js";
25
25
  import {
26
26
  AiEvents,
27
27
  ApiKeyEvents,
@@ -75,7 +75,7 @@ import {
75
75
  XAI_IMAGE_MODELS,
76
76
  b4mLLMTools,
77
77
  getMcpProviderMetadata
78
- } from "./chunk-LL5J3SVB.js";
78
+ } from "./chunk-KGX2FFHZ.js";
79
79
  import {
80
80
  Logger
81
81
  } from "./chunk-OCYRD7D6.js";
@@ -11430,7 +11430,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
11430
11430
  // package.json
11431
11431
  var package_default = {
11432
11432
  name: "@bike4mind/cli",
11433
- version: "0.2.16-block-missing-tool-result.17608+13b93034b",
11433
+ version: "0.2.16-cj-GH6131.17608+dcdc1e087",
11434
11434
  type: "module",
11435
11435
  description: "Interactive CLI tool for Bike4Mind with ReAct agents",
11436
11436
  license: "UNLICENSED",
@@ -11537,10 +11537,10 @@ var package_default = {
11537
11537
  },
11538
11538
  devDependencies: {
11539
11539
  "@bike4mind/agents": "0.1.0",
11540
- "@bike4mind/common": "2.42.2-block-missing-tool-result.17608+13b93034b",
11541
- "@bike4mind/mcp": "1.22.2-block-missing-tool-result.17608+13b93034b",
11542
- "@bike4mind/services": "2.39.1-block-missing-tool-result.17608+13b93034b",
11543
- "@bike4mind/utils": "2.1.10-block-missing-tool-result.17608+13b93034b",
11540
+ "@bike4mind/common": "2.42.2-cj-GH6131.17608+dcdc1e087",
11541
+ "@bike4mind/mcp": "1.22.2-cj-GH6131.17608+dcdc1e087",
11542
+ "@bike4mind/services": "2.39.1-cj-GH6131.17608+dcdc1e087",
11543
+ "@bike4mind/utils": "2.1.10-cj-GH6131.17608+dcdc1e087",
11544
11544
  "@types/better-sqlite3": "^7.6.13",
11545
11545
  "@types/diff": "^5.0.9",
11546
11546
  "@types/jsonwebtoken": "^9.0.4",
@@ -11554,7 +11554,7 @@ var package_default = {
11554
11554
  typescript: "^5.9.3",
11555
11555
  vitest: "^3.2.4"
11556
11556
  },
11557
- gitHead: "13b93034ba30ba48dd597037effa64bd812b76b0"
11557
+ gitHead: "dcdc1e087ec6b9dd112d1eeab86e351ebe5ac881"
11558
11558
  };
11559
11559
 
11560
11560
  // src/config/constants.ts
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-LL5J3SVB.js";
4
+ } from "./chunk-KGX2FFHZ.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-LL5J3SVB.js";
4
+ } from "./chunk-KGX2FFHZ.js";
5
5
 
6
6
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/markdownGenerator.js
7
7
  var DEFAULT_OPTIONS = {
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  findMostSimilarMemento,
4
4
  getRelevantMementos
5
- } from "./chunk-ISY2LX2J.js";
6
- import "./chunk-W2GB4FA6.js";
7
- import "./chunk-LL5J3SVB.js";
5
+ } from "./chunk-GJ3EQRX5.js";
6
+ import "./chunk-VGF6M3GC.js";
7
+ import "./chunk-KGX2FFHZ.js";
8
8
  import "./chunk-OCYRD7D6.js";
9
9
  export {
10
10
  findMostSimilarMemento,
@@ -297,7 +297,7 @@ import {
297
297
  validateReactArtifactV2,
298
298
  validateSvgArtifactV2,
299
299
  wikiMarkupToAdf
300
- } from "./chunk-LL5J3SVB.js";
300
+ } from "./chunk-KGX2FFHZ.js";
301
301
  export {
302
302
  ALL_IMAGE_MODELS,
303
303
  ALL_IMAGE_SIZES,
@@ -129,8 +129,8 @@ import {
129
129
  validateMermaidSyntax,
130
130
  warmUpSettingsCache,
131
131
  withRetry
132
- } from "./chunk-W2GB4FA6.js";
133
- import "./chunk-LL5J3SVB.js";
132
+ } from "./chunk-VGF6M3GC.js";
133
+ import "./chunk-KGX2FFHZ.js";
134
134
  import {
135
135
  Logger,
136
136
  NotificationDeduplicator,
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  SubtractCreditsSchema,
4
4
  subtractCredits
5
- } from "./chunk-32MIJDKQ.js";
6
- import "./chunk-W2GB4FA6.js";
7
- import "./chunk-LL5J3SVB.js";
5
+ } from "./chunk-PJQUVSHP.js";
6
+ import "./chunk-VGF6M3GC.js";
7
+ import "./chunk-KGX2FFHZ.js";
8
8
  import "./chunk-OCYRD7D6.js";
9
9
  export {
10
10
  SubtractCreditsSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.2.16-block-missing-tool-result.17608+13b93034b",
3
+ "version": "0.2.16-cj-GH6131.17608+dcdc1e087",
4
4
  "type": "module",
5
5
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
6
6
  "license": "UNLICENSED",
@@ -107,10 +107,10 @@
107
107
  },
108
108
  "devDependencies": {
109
109
  "@bike4mind/agents": "0.1.0",
110
- "@bike4mind/common": "2.42.2-block-missing-tool-result.17608+13b93034b",
111
- "@bike4mind/mcp": "1.22.2-block-missing-tool-result.17608+13b93034b",
112
- "@bike4mind/services": "2.39.1-block-missing-tool-result.17608+13b93034b",
113
- "@bike4mind/utils": "2.1.10-block-missing-tool-result.17608+13b93034b",
110
+ "@bike4mind/common": "2.42.2-cj-GH6131.17608+dcdc1e087",
111
+ "@bike4mind/mcp": "1.22.2-cj-GH6131.17608+dcdc1e087",
112
+ "@bike4mind/services": "2.39.1-cj-GH6131.17608+dcdc1e087",
113
+ "@bike4mind/utils": "2.1.10-cj-GH6131.17608+dcdc1e087",
114
114
  "@types/better-sqlite3": "^7.6.13",
115
115
  "@types/diff": "^5.0.9",
116
116
  "@types/jsonwebtoken": "^9.0.4",
@@ -124,5 +124,5 @@
124
124
  "typescript": "^5.9.3",
125
125
  "vitest": "^3.2.4"
126
126
  },
127
- "gitHead": "13b93034ba30ba48dd597037effa64bd812b76b0"
127
+ "gitHead": "dcdc1e087ec6b9dd112d1eeab86e351ebe5ac881"
128
128
  }