@bike4mind/cli 0.2.10-feat-explore-subagent-implementation.17267 → 0.2.10-feat-cli-message-unique-ids.17271

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.
Files changed (2) hide show
  1. package/dist/index.js +52 -26
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -82,7 +82,7 @@ import {
82
82
  import React17, { useState as useState8, useEffect as useEffect3, useCallback, useRef as useRef2 } from "react";
83
83
  import { render, Box as Box16, Text as Text16, useApp, useInput as useInput6 } from "ink";
84
84
  import { execSync } from "child_process";
85
- import { v4 as uuidv49 } from "uuid";
85
+ import { v4 as uuidv410 } from "uuid";
86
86
 
87
87
  // src/components/App.tsx
88
88
  import React11, { useState as useState4 } from "react";
@@ -1523,7 +1523,7 @@ ${errorBlock}`;
1523
1523
  onSave: onSaveConfig,
1524
1524
  onClose: () => setShowConfigEditor(false)
1525
1525
  }
1526
- )) : permissionPrompt ? /* @__PURE__ */ React11.createElement(Box10, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React11.createElement(
1526
+ )) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(Static, { items: messages }, (message) => /* @__PURE__ */ React11.createElement(Box10, { key: message.id, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React11.createElement(MessageItem, { message }))), /* @__PURE__ */ React11.createElement(Box10, { flexDirection: "column" }, pendingMessages.map((message) => /* @__PURE__ */ React11.createElement(Box10, { key: message.id, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React11.createElement(MessageItem, { message })))), permissionPrompt && /* @__PURE__ */ React11.createElement(Box10, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React11.createElement(
1527
1527
  PermissionPrompt,
1528
1528
  {
1529
1529
  toolName: permissionPrompt.toolName,
@@ -1532,7 +1532,7 @@ ${errorBlock}`;
1532
1532
  canBeTrusted: permissionPrompt.canBeTrusted,
1533
1533
  onResponse: onPermissionResponse
1534
1534
  }
1535
- )) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(Static, { items: messages }, (message, index) => /* @__PURE__ */ React11.createElement(Box10, { key: `${message.timestamp}-${message.role}-${index}`, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React11.createElement(MessageItem, { message }))), /* @__PURE__ */ React11.createElement(Box10, { flexDirection: "column" }, pendingMessages.map((message, index) => /* @__PURE__ */ React11.createElement(Box10, { key: `pending-${message.timestamp}-${index}`, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React11.createElement(MessageItem, { message })))), /* @__PURE__ */ React11.createElement(AgentThinking, null), exitRequested && /* @__PURE__ */ React11.createElement(Box10, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React11.createElement(Text10, { color: "yellow", bold: true }, "Press Ctrl+C again to exit")), /* @__PURE__ */ React11.createElement(Box10, { borderStyle: "single", borderColor: isBashMode ? "yellow" : "cyan", paddingX: 1 }, /* @__PURE__ */ React11.createElement(
1535
+ )), !permissionPrompt && /* @__PURE__ */ React11.createElement(AgentThinking, null), exitRequested && /* @__PURE__ */ React11.createElement(Box10, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React11.createElement(Text10, { color: "yellow", bold: true }, "Press Ctrl+C again to exit")), /* @__PURE__ */ React11.createElement(Box10, { borderStyle: "single", borderColor: isBashMode ? "yellow" : "cyan", paddingX: 1 }, /* @__PURE__ */ React11.createElement(
1536
1536
  InputPrompt,
1537
1537
  {
1538
1538
  onSubmit: handleSubmit,
@@ -1932,6 +1932,7 @@ function LoginFlow({ apiUrl = "http://localhost:3000", configStore, onSuccess, o
1932
1932
  import { promises as fs3 } from "fs";
1933
1933
  import path3 from "path";
1934
1934
  import { homedir } from "os";
1935
+ import { v4 as uuidv4 } from "uuid";
1935
1936
  var SessionStore = class {
1936
1937
  constructor(basePath) {
1937
1938
  this.basePath = basePath || path3.join(homedir(), ".bike4mind", "sessions");
@@ -1967,7 +1968,14 @@ var SessionStore = class {
1967
1968
  const filePath = path3.join(this.basePath, `${id}.json`);
1968
1969
  try {
1969
1970
  const data = await fs3.readFile(filePath, "utf-8");
1970
- return JSON.parse(data);
1971
+ const session = JSON.parse(data);
1972
+ session.messages = session.messages.map((msg) => {
1973
+ if (!msg.id) {
1974
+ return { ...msg, id: uuidv4() };
1975
+ }
1976
+ return msg;
1977
+ });
1978
+ return session;
1971
1979
  } catch (error) {
1972
1980
  if (error.code === "ENOENT") {
1973
1981
  return null;
@@ -1996,7 +2004,14 @@ var SessionStore = class {
1996
2004
  jsonFiles.map(async (file) => {
1997
2005
  const filePath = path3.join(this.basePath, file);
1998
2006
  const data = await fs3.readFile(filePath, "utf-8");
1999
- return JSON.parse(data);
2007
+ const session = JSON.parse(data);
2008
+ session.messages = session.messages.map((msg) => {
2009
+ if (!msg.id) {
2010
+ return { ...msg, id: uuidv4() };
2011
+ }
2012
+ return msg;
2013
+ });
2014
+ return session;
2000
2015
  })
2001
2016
  );
2002
2017
  return sessions.sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime());
@@ -2050,7 +2065,7 @@ var SessionStore = class {
2050
2065
  import { promises as fs4, existsSync as existsSync3 } from "fs";
2051
2066
  import path4 from "path";
2052
2067
  import { homedir as homedir2 } from "os";
2053
- import { v4 as uuidv4 } from "uuid";
2068
+ import { v4 as uuidv42 } from "uuid";
2054
2069
  import { z } from "zod";
2055
2070
  var AuthTokensSchema = z.object({
2056
2071
  accessToken: z.string(),
@@ -2144,7 +2159,7 @@ var ProjectLocalConfigSchema = z.object({
2144
2159
  });
2145
2160
  var DEFAULT_CONFIG = {
2146
2161
  version: "0.1.0",
2147
- userId: uuidv4(),
2162
+ userId: uuidv42(),
2148
2163
  defaultModel: "claude-sonnet-4-5-20250929",
2149
2164
  toolApiKeys: {
2150
2165
  openweather: void 0,
@@ -2426,7 +2441,7 @@ var ConfigStore = class {
2426
2441
  * Reset configuration to defaults
2427
2442
  */
2428
2443
  async reset() {
2429
- this.config = { ...DEFAULT_CONFIG, userId: uuidv4() };
2444
+ this.config = { ...DEFAULT_CONFIG, userId: uuidv42() };
2430
2445
  await this.save();
2431
2446
  return this.config;
2432
2447
  }
@@ -4336,7 +4351,7 @@ var listFabFilesSchema = z86.object({
4336
4351
 
4337
4352
  // ../../b4m-core/packages/services/dist/src/fabFileService/update.js
4338
4353
  import mime from "mime-types";
4339
- import { v4 as uuidv42 } from "uuid";
4354
+ import { v4 as uuidv43 } from "uuid";
4340
4355
  import { z as z87 } from "zod";
4341
4356
  var updateFabFileSchema = z87.object({
4342
4357
  id: z87.string(),
@@ -4457,7 +4472,7 @@ var editFabFileSchema = z98.object({
4457
4472
 
4458
4473
  // ../../b4m-core/packages/services/dist/src/fabFileService/applyEdit.js
4459
4474
  import mime2 from "mime-types";
4460
- import { v4 as uuidv43 } from "uuid";
4475
+ import { v4 as uuidv44 } from "uuid";
4461
4476
  import { z as z99 } from "zod";
4462
4477
  var applyEditSchema = z99.object({
4463
4478
  id: z99.string(),
@@ -5285,7 +5300,7 @@ import { toFile } from "openai/uploads";
5285
5300
  import { Readable } from "stream";
5286
5301
  import { TranscribeClient, StartTranscriptionJobCommand, GetTranscriptionJobCommand, LanguageCode, MediaFormat } from "@aws-sdk/client-transcribe";
5287
5302
  import { S3Client, PutObjectCommand, GetObjectCommand, DeleteObjectCommand } from "@aws-sdk/client-s3";
5288
- import { v4 as uuidv44 } from "uuid";
5303
+ import { v4 as uuidv45 } from "uuid";
5289
5304
 
5290
5305
  // ../../b4m-core/packages/services/dist/src/emailIngestionService/processIngestedEmail.js
5291
5306
  import { randomUUID as randomUUID5 } from "crypto";
@@ -5446,7 +5461,7 @@ var weatherTool = {
5446
5461
  // ../../b4m-core/packages/services/dist/src/llm/tools/implementation/imageGeneration/index.js
5447
5462
  import axios6 from "axios";
5448
5463
  import { fileTypeFromBuffer as fileTypeFromBuffer2 } from "file-type";
5449
- import { v4 as uuidv45 } from "uuid";
5464
+ import { v4 as uuidv46 } from "uuid";
5450
5465
  async function downloadImage(url) {
5451
5466
  if (url.startsWith("data:image/")) {
5452
5467
  const base64Data = url.split(",")[1];
@@ -5460,7 +5475,7 @@ async function processAndStoreImages(images, context) {
5460
5475
  return Promise.all(images.map(async (image) => {
5461
5476
  const buffer = await downloadImage(image);
5462
5477
  const fileType = await fileTypeFromBuffer2(buffer);
5463
- const filename = `${uuidv45()}.${fileType?.ext}`;
5478
+ const filename = `${uuidv46()}.${fileType?.ext}`;
5464
5479
  const path16 = await context.imageGenerateStorage.upload(buffer, filename, {});
5465
5480
  return path16;
5466
5481
  }));
@@ -6629,7 +6644,7 @@ Return only the edited content without any markdown code blocks or explanations.
6629
6644
  // ../../b4m-core/packages/services/dist/src/llm/tools/implementation/imageEdit/index.js
6630
6645
  import axios7 from "axios";
6631
6646
  import { fileTypeFromBuffer as fileTypeFromBuffer3 } from "file-type";
6632
- import { v4 as uuidv46 } from "uuid";
6647
+ import { v4 as uuidv47 } from "uuid";
6633
6648
  async function downloadImage2(url) {
6634
6649
  if (url.startsWith("data:image/")) {
6635
6650
  const base64Data = url.split(",")[1];
@@ -6673,7 +6688,7 @@ async function getImageFromFileId(fileId, context) {
6673
6688
  async function processAndStoreImage(imageUrl, context) {
6674
6689
  const buffer = await downloadImage2(imageUrl);
6675
6690
  const fileType = await fileTypeFromBuffer3(buffer);
6676
- const filename = `${uuidv46()}.${fileType?.ext}`;
6691
+ const filename = `${uuidv47()}.${fileType?.ext}`;
6677
6692
  const path16 = await context.imageGenerateStorage.upload(buffer, filename, {});
6678
6693
  return path16;
6679
6694
  }
@@ -9650,7 +9665,7 @@ var QuestStartBodySchema = z139.object({
9650
9665
  // ../../b4m-core/packages/services/dist/src/llm/ImageGeneration.js
9651
9666
  import axios8 from "axios";
9652
9667
  import { fileTypeFromBuffer as fileTypeFromBuffer4 } from "file-type";
9653
- import { v4 as uuidv47 } from "uuid";
9668
+ import { v4 as uuidv48 } from "uuid";
9654
9669
  import { z as z140 } from "zod";
9655
9670
  import { fromZodError as fromZodError2 } from "zod-validation-error";
9656
9671
  var ImageGenerationBodySchema = OpenAIImageGenerationInput.extend({
@@ -9671,7 +9686,7 @@ var ImageGenerationBodySchema = OpenAIImageGenerationInput.extend({
9671
9686
  // ../../b4m-core/packages/services/dist/src/llm/ImageEdit.js
9672
9687
  import axios9 from "axios";
9673
9688
  import { fileTypeFromBuffer as fileTypeFromBuffer5 } from "file-type";
9674
- import { v4 as uuidv48 } from "uuid";
9689
+ import { v4 as uuidv49 } from "uuid";
9675
9690
  import { z as z141 } from "zod";
9676
9691
  import { fromZodError as fromZodError3 } from "zod-validation-error";
9677
9692
  var ImageEditBodySchema = OpenAIImageGenerationInput.extend({
@@ -11512,7 +11527,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
11512
11527
  // package.json
11513
11528
  var package_default = {
11514
11529
  name: "@bike4mind/cli",
11515
- version: "0.2.10-feat-explore-subagent-implementation.17267+b95ee4da4",
11530
+ version: "0.2.10-feat-cli-message-unique-ids.17271+dbdd57e69",
11516
11531
  type: "module",
11517
11532
  description: "Interactive CLI tool for Bike4Mind with ReAct agents",
11518
11533
  license: "UNLICENSED",
@@ -11616,10 +11631,10 @@ var package_default = {
11616
11631
  },
11617
11632
  devDependencies: {
11618
11633
  "@bike4mind/agents": "0.1.0",
11619
- "@bike4mind/common": "2.39.1-feat-explore-subagent-implementation.17267+b95ee4da4",
11620
- "@bike4mind/mcp": "1.20.4-feat-explore-subagent-implementation.17267+b95ee4da4",
11621
- "@bike4mind/services": "2.34.2-feat-explore-subagent-implementation.17267+b95ee4da4",
11622
- "@bike4mind/utils": "2.1.4-feat-explore-subagent-implementation.17267+b95ee4da4",
11634
+ "@bike4mind/common": "2.39.1-feat-cli-message-unique-ids.17271+dbdd57e69",
11635
+ "@bike4mind/mcp": "1.20.4-feat-cli-message-unique-ids.17271+dbdd57e69",
11636
+ "@bike4mind/services": "2.34.2-feat-cli-message-unique-ids.17271+dbdd57e69",
11637
+ "@bike4mind/utils": "2.1.4-feat-cli-message-unique-ids.17271+dbdd57e69",
11623
11638
  "@types/better-sqlite3": "^7.6.13",
11624
11639
  "@types/diff": "^5.0.9",
11625
11640
  "@types/jsonwebtoken": "^9.0.4",
@@ -11632,7 +11647,7 @@ var package_default = {
11632
11647
  typescript: "^5.9.3",
11633
11648
  vitest: "^3.2.4"
11634
11649
  },
11635
- gitHead: "b95ee4da40b8b23ebad5933069750f828b85e72e"
11650
+ gitHead: "dbdd57e69e453a6c69e32529dfd7defede8ae278"
11636
11651
  };
11637
11652
 
11638
11653
  // src/config/constants.ts
@@ -12095,7 +12110,7 @@ function CliApp() {
12095
12110
  if (!isAuthenticated) {
12096
12111
  console.log("\u2139\uFE0F AI features disabled. Available commands: /login, /help, /config\n");
12097
12112
  const minimalSession = {
12098
- id: uuidv49(),
12113
+ id: uuidv410(),
12099
12114
  name: `Session ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
12100
12115
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
12101
12116
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -12139,7 +12154,7 @@ function CliApp() {
12139
12154
  }
12140
12155
  llm.currentModel = modelInfo.id;
12141
12156
  const newSession = {
12142
- id: uuidv49(),
12157
+ id: uuidv410(),
12143
12158
  name: `Session ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
12144
12159
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
12145
12160
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -12385,11 +12400,13 @@ Remember: Use context from previous messages to understand follow-up questions.$
12385
12400
  messageContent = multimodalMessage.content;
12386
12401
  }
12387
12402
  const userMessage = {
12403
+ id: uuidv410(),
12388
12404
  role: "user",
12389
12405
  content: userMessageContent,
12390
12406
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
12391
12407
  };
12392
12408
  const pendingAssistantMessage = {
12409
+ id: uuidv410(),
12393
12410
  role: "assistant",
12394
12411
  content: "...",
12395
12412
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
@@ -12420,7 +12437,10 @@ Remember: Use context from previous messages to understand follow-up questions.$
12420
12437
  const currentSession = useCliStore.getState().session;
12421
12438
  if (!currentSession) return;
12422
12439
  const updatedMessages = [...currentSession.messages];
12440
+ const lastMessage = updatedMessages[updatedMessages.length - 1];
12423
12441
  updatedMessages[updatedMessages.length - 1] = {
12442
+ id: lastMessage.id,
12443
+ // Preserve the original message ID
12424
12444
  role: "assistant",
12425
12445
  content: result.finalAnswer,
12426
12446
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
@@ -12535,11 +12555,13 @@ Remember: Use context from previous messages to understand follow-up questions.$
12535
12555
  userMessageContent = message;
12536
12556
  }
12537
12557
  const userMessage = {
12558
+ id: uuidv410(),
12538
12559
  role: "user",
12539
12560
  content: userMessageContent,
12540
12561
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
12541
12562
  };
12542
12563
  const pendingAssistantMessage = {
12564
+ id: uuidv410(),
12543
12565
  role: "assistant",
12544
12566
  content: "...",
12545
12567
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
@@ -12569,6 +12591,8 @@ Remember: Use context from previous messages to understand follow-up questions.$
12569
12591
  }
12570
12592
  const successfulToolCalls = result.steps.filter((s) => s.type === "observation").length;
12571
12593
  const finalAssistantMessage = {
12594
+ id: pendingAssistantMessage.id,
12595
+ // Preserve the original message ID
12572
12596
  role: "assistant",
12573
12597
  content: result.finalAnswer,
12574
12598
  timestamp: pendingAssistantMessage.timestamp,
@@ -12630,11 +12654,13 @@ Remember: Use context from previous messages to understand follow-up questions.$
12630
12654
  isError = true;
12631
12655
  }
12632
12656
  const userMessage = {
12657
+ id: uuidv410(),
12633
12658
  role: "user",
12634
12659
  content: `$ ${command}`,
12635
12660
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
12636
12661
  };
12637
12662
  const assistantMessage = {
12663
+ id: uuidv410(),
12638
12664
  role: "assistant",
12639
12665
  content: isError ? `\u274C Error:
12640
12666
  ${output}` : output.trim() || "(no output)",
@@ -13045,7 +13071,7 @@ Custom Commands:
13045
13071
  console.clear();
13046
13072
  const model = state.session?.model || state.config?.defaultModel || "claude-sonnet";
13047
13073
  const newSession = {
13048
- id: uuidv49(),
13074
+ id: uuidv410(),
13049
13075
  name: `Session ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
13050
13076
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
13051
13077
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.2.10-feat-explore-subagent-implementation.17267+b95ee4da4",
3
+ "version": "0.2.10-feat-cli-message-unique-ids.17271+dbdd57e69",
4
4
  "type": "module",
5
5
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
6
6
  "license": "UNLICENSED",
@@ -104,10 +104,10 @@
104
104
  },
105
105
  "devDependencies": {
106
106
  "@bike4mind/agents": "0.1.0",
107
- "@bike4mind/common": "2.39.1-feat-explore-subagent-implementation.17267+b95ee4da4",
108
- "@bike4mind/mcp": "1.20.4-feat-explore-subagent-implementation.17267+b95ee4da4",
109
- "@bike4mind/services": "2.34.2-feat-explore-subagent-implementation.17267+b95ee4da4",
110
- "@bike4mind/utils": "2.1.4-feat-explore-subagent-implementation.17267+b95ee4da4",
107
+ "@bike4mind/common": "2.39.1-feat-cli-message-unique-ids.17271+dbdd57e69",
108
+ "@bike4mind/mcp": "1.20.4-feat-cli-message-unique-ids.17271+dbdd57e69",
109
+ "@bike4mind/services": "2.34.2-feat-cli-message-unique-ids.17271+dbdd57e69",
110
+ "@bike4mind/utils": "2.1.4-feat-cli-message-unique-ids.17271+dbdd57e69",
111
111
  "@types/better-sqlite3": "^7.6.13",
112
112
  "@types/diff": "^5.0.9",
113
113
  "@types/jsonwebtoken": "^9.0.4",
@@ -120,5 +120,5 @@
120
120
  "typescript": "^5.9.3",
121
121
  "vitest": "^3.2.4"
122
122
  },
123
- "gitHead": "b95ee4da40b8b23ebad5933069750f828b85e72e"
123
+ "gitHead": "dbdd57e69e453a6c69e32529dfd7defede8ae278"
124
124
  }