@bike4mind/cli 0.2.29-ja-feat-slack-direct-react-agent.18921 → 0.2.29-ja-feat-slack-direct-react-agent.18924

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 +31 -23
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -3625,28 +3625,33 @@ Remember: You are an autonomous AGENT. Act independently and solve problems proa
3625
3625
  }
3626
3626
  }
3627
3627
  /**
3628
- * Build and append tool call/result messages for the conversation history
3628
+ * Build and append tool call/result messages for the conversation history.
3629
+ * Delegates to the backend's native pushToolMessages when available so each
3630
+ * backend can format messages for its own API (OpenAI, Anthropic, Gemini, etc.).
3631
+ * Falls back to Anthropic format for backends that don't implement pushToolMessages.
3629
3632
  */
3630
3633
  appendToolMessages(messages, toolUse, observation, thinkingBlocks) {
3631
3634
  const params = this.parseToolArguments(toolUse.arguments);
3632
- const msgToolCallId = `${toolUse.name}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
3633
- this.context.logger.info("[ReActAgent] appendToolMessages \u2014 using Anthropic tool_use format", {
3634
- model: this.context.model,
3635
- toolName: toolUse.name,
3636
- toolCallId: msgToolCallId
3637
- });
3638
- const assistantContent = [
3639
- ...thinkingBlocks,
3640
- {
3641
- type: "tool_use",
3642
- id: msgToolCallId,
3643
- name: toolUse.name,
3644
- input: params
3645
- }
3646
- ];
3635
+ const msgToolCallId = `call_${Math.random().toString(36).substring(2, 11)}${Date.now().toString(36)}`;
3636
+ if (this.context.llm.pushToolMessages) {
3637
+ this.context.llm.pushToolMessages(
3638
+ messages,
3639
+ { id: msgToolCallId, name: toolUse.name, parameters: toolUse.arguments || JSON.stringify(params ?? {}) },
3640
+ observation
3641
+ );
3642
+ return;
3643
+ }
3647
3644
  messages.push({
3648
3645
  role: "assistant",
3649
- content: assistantContent
3646
+ content: [
3647
+ ...thinkingBlocks,
3648
+ {
3649
+ type: "tool_use",
3650
+ id: msgToolCallId,
3651
+ name: toolUse.name,
3652
+ input: params
3653
+ }
3654
+ ]
3650
3655
  });
3651
3656
  messages.push({
3652
3657
  role: "user",
@@ -13639,6 +13644,9 @@ var NotifyingLlmBackend = class {
13639
13644
  constructor(inner, backgroundManager) {
13640
13645
  this.inner = inner;
13641
13646
  this.backgroundManager = backgroundManager;
13647
+ if (inner.pushToolMessages) {
13648
+ this.pushToolMessages = (messages, tool, result) => inner.pushToolMessages(messages, tool, result);
13649
+ }
13642
13650
  }
13643
13651
  get currentModel() {
13644
13652
  return this.inner.currentModel;
@@ -13805,7 +13813,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
13805
13813
  // package.json
13806
13814
  var package_default = {
13807
13815
  name: "@bike4mind/cli",
13808
- version: "0.2.29-ja-feat-slack-direct-react-agent.18921+e32d7600b",
13816
+ version: "0.2.29-ja-feat-slack-direct-react-agent.18924+274261d00",
13809
13817
  type: "module",
13810
13818
  description: "Interactive CLI tool for Bike4Mind with ReAct agents",
13811
13819
  license: "UNLICENSED",
@@ -13919,10 +13927,10 @@ var package_default = {
13919
13927
  },
13920
13928
  devDependencies: {
13921
13929
  "@bike4mind/agents": "0.1.0",
13922
- "@bike4mind/common": "2.50.1-ja-feat-slack-direct-react-agent.18921+e32d7600b",
13923
- "@bike4mind/mcp": "1.29.1-ja-feat-slack-direct-react-agent.18921+e32d7600b",
13924
- "@bike4mind/services": "2.48.1-ja-feat-slack-direct-react-agent.18921+e32d7600b",
13925
- "@bike4mind/utils": "2.5.1-ja-feat-slack-direct-react-agent.18921+e32d7600b",
13930
+ "@bike4mind/common": "2.50.1-ja-feat-slack-direct-react-agent.18924+274261d00",
13931
+ "@bike4mind/mcp": "1.29.1-ja-feat-slack-direct-react-agent.18924+274261d00",
13932
+ "@bike4mind/services": "2.48.1-ja-feat-slack-direct-react-agent.18924+274261d00",
13933
+ "@bike4mind/utils": "2.5.1-ja-feat-slack-direct-react-agent.18924+274261d00",
13926
13934
  "@types/better-sqlite3": "^7.6.13",
13927
13935
  "@types/diff": "^5.0.9",
13928
13936
  "@types/jsonwebtoken": "^9.0.4",
@@ -13940,7 +13948,7 @@ var package_default = {
13940
13948
  optionalDependencies: {
13941
13949
  "@vscode/ripgrep": "^1.17.0"
13942
13950
  },
13943
- gitHead: "e32d7600b097c4b768cd48d876dcd292434fd8e3"
13951
+ gitHead: "274261d0000d1ae3cba62caa37ac3168201bdc9e"
13944
13952
  };
13945
13953
 
13946
13954
  // src/config/constants.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.2.29-ja-feat-slack-direct-react-agent.18921+e32d7600b",
3
+ "version": "0.2.29-ja-feat-slack-direct-react-agent.18924+274261d00",
4
4
  "type": "module",
5
5
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
6
6
  "license": "UNLICENSED",
@@ -114,10 +114,10 @@
114
114
  },
115
115
  "devDependencies": {
116
116
  "@bike4mind/agents": "0.1.0",
117
- "@bike4mind/common": "2.50.1-ja-feat-slack-direct-react-agent.18921+e32d7600b",
118
- "@bike4mind/mcp": "1.29.1-ja-feat-slack-direct-react-agent.18921+e32d7600b",
119
- "@bike4mind/services": "2.48.1-ja-feat-slack-direct-react-agent.18921+e32d7600b",
120
- "@bike4mind/utils": "2.5.1-ja-feat-slack-direct-react-agent.18921+e32d7600b",
117
+ "@bike4mind/common": "2.50.1-ja-feat-slack-direct-react-agent.18924+274261d00",
118
+ "@bike4mind/mcp": "1.29.1-ja-feat-slack-direct-react-agent.18924+274261d00",
119
+ "@bike4mind/services": "2.48.1-ja-feat-slack-direct-react-agent.18924+274261d00",
120
+ "@bike4mind/utils": "2.5.1-ja-feat-slack-direct-react-agent.18924+274261d00",
121
121
  "@types/better-sqlite3": "^7.6.13",
122
122
  "@types/diff": "^5.0.9",
123
123
  "@types/jsonwebtoken": "^9.0.4",
@@ -135,5 +135,5 @@
135
135
  "optionalDependencies": {
136
136
  "@vscode/ripgrep": "^1.17.0"
137
137
  },
138
- "gitHead": "e32d7600b097c4b768cd48d876dcd292434fd8e3"
138
+ "gitHead": "274261d0000d1ae3cba62caa37ac3168201bdc9e"
139
139
  }