@mobcode/openclaw-plugin 0.1.25 → 0.1.26
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.
- package/package.json +1 -1
- package/src/plugin-definition.js +25 -8
package/package.json
CHANGED
package/src/plugin-definition.js
CHANGED
|
@@ -159,7 +159,7 @@ export function createMobcodePluginDefinition() {
|
|
|
159
159
|
api,
|
|
160
160
|
store,
|
|
161
161
|
});
|
|
162
|
-
api.on("after_tool_call", (event, ctx) => {
|
|
162
|
+
api.on("after_tool_call", async (event, ctx) => {
|
|
163
163
|
const persistedMessage = buildPersistedToolResultFromAfterToolCall(event, ctx);
|
|
164
164
|
const messageId =
|
|
165
165
|
typeof persistedMessage?.id === "string" && persistedMessage.id.trim()
|
|
@@ -172,7 +172,14 @@ export function createMobcodePluginDefinition() {
|
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
174
|
console.warn(
|
|
175
|
-
"[mobcode-direct-debug] after_tool_call
|
|
175
|
+
"[mobcode-direct-debug] after_tool_call store target",
|
|
176
|
+
"rootDir=",
|
|
177
|
+
store.rootDir,
|
|
178
|
+
"databasePath=",
|
|
179
|
+
store.databasePath,
|
|
180
|
+
);
|
|
181
|
+
console.warn(
|
|
182
|
+
"[mobcode-direct-debug] after_tool_call before appendMessage",
|
|
176
183
|
"sessionKey=",
|
|
177
184
|
String(ctx?.sessionKey ?? "").trim() || "-",
|
|
178
185
|
"toolCallId=",
|
|
@@ -182,12 +189,22 @@ export function createMobcodePluginDefinition() {
|
|
|
182
189
|
"messageId=",
|
|
183
190
|
messageId ?? "-",
|
|
184
191
|
);
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
192
|
+
try {
|
|
193
|
+
const appendResult = await store.appendMessage({
|
|
194
|
+
sessionKey: ctx?.sessionKey,
|
|
195
|
+
message: persistedMessage,
|
|
196
|
+
messageId,
|
|
197
|
+
});
|
|
198
|
+
console.warn(
|
|
199
|
+
"[mobcode-direct-debug] after_tool_call appendMessage result",
|
|
200
|
+
JSON.stringify(appendResult ?? null),
|
|
201
|
+
);
|
|
202
|
+
} catch (error) {
|
|
203
|
+
console.warn(
|
|
204
|
+
"[mobcode-direct-debug] after_tool_call appendMessage failed",
|
|
205
|
+
String(error),
|
|
206
|
+
);
|
|
207
|
+
}
|
|
191
208
|
});
|
|
192
209
|
api.on("tool_result_persist", (event, ctx) => {
|
|
193
210
|
const { toolCallId, toolName } = resolveToolIdentity(event, ctx);
|