@efengx/openclaw-channel-dragon 0.5.44 → 0.5.45
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.
|
@@ -26,6 +26,7 @@ export declare class ChannelComponent implements IComponent {
|
|
|
26
26
|
private buildOpenClawSessionKey;
|
|
27
27
|
private resolveWorkbenchSessionIdFromOpenClawSessionKey;
|
|
28
28
|
private stringifyProgressDetail;
|
|
29
|
+
private extractToolCallId;
|
|
29
30
|
private summarizeOutboundContext;
|
|
30
31
|
private findTaskCompletionEvent;
|
|
31
32
|
private formatTaskCompletionReply;
|
|
@@ -115,6 +115,14 @@ export class ChannelComponent {
|
|
|
115
115
|
return String(value).slice(0, maxLength);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
+
extractToolCallId(payload) {
|
|
119
|
+
let toolCallId = payload?.toolCallId || payload?.tool_call_id || payload?.tool;
|
|
120
|
+
const itemId = payload?.itemId || payload?.data?.itemId;
|
|
121
|
+
if (!toolCallId && typeof itemId === 'string' && itemId.startsWith('tool:')) {
|
|
122
|
+
toolCallId = itemId.slice(5);
|
|
123
|
+
}
|
|
124
|
+
return toolCallId;
|
|
125
|
+
}
|
|
118
126
|
summarizeOutboundContext(ctx) {
|
|
119
127
|
const summarizeValue = (value) => {
|
|
120
128
|
if (Array.isArray(value))
|
|
@@ -275,7 +283,7 @@ export class ChannelComponent {
|
|
|
275
283
|
await progress({ kind: 'reasoning', phase: 'end', status: 'completed', title: '推理完成' });
|
|
276
284
|
},
|
|
277
285
|
onToolStart: async (payload) => {
|
|
278
|
-
const toolCallId = payload
|
|
286
|
+
const toolCallId = this.extractToolCallId(payload);
|
|
279
287
|
await progress({
|
|
280
288
|
kind: 'tool',
|
|
281
289
|
phase: payload?.phase || 'start',
|
|
@@ -289,7 +297,7 @@ export class ChannelComponent {
|
|
|
289
297
|
onToolResult: async (payload) => {
|
|
290
298
|
const isFailed = payload?.status === 'failed' || payload?.status === 'error' || !!payload?.error;
|
|
291
299
|
const archivedAttachments = await this.mediaRegistry.archiveStructuredMedia(payload);
|
|
292
|
-
const toolCallId = payload
|
|
300
|
+
const toolCallId = this.extractToolCallId(payload);
|
|
293
301
|
await progress({
|
|
294
302
|
kind: archivedAttachments.length > 0 ? 'media' : 'tool',
|
|
295
303
|
phase: 'end',
|
|
@@ -307,7 +315,7 @@ export class ChannelComponent {
|
|
|
307
315
|
});
|
|
308
316
|
},
|
|
309
317
|
onItemEvent: async (payload) => {
|
|
310
|
-
const toolCallId = payload
|
|
318
|
+
const toolCallId = this.extractToolCallId(payload);
|
|
311
319
|
await progress({
|
|
312
320
|
kind: payload?.kind || 'item',
|
|
313
321
|
phase: payload?.phase,
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const dragonChannelPluginVersion = "0.5.
|
|
1
|
+
export declare const dragonChannelPluginVersion = "0.5.45";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const dragonChannelPluginVersion = "0.5.
|
|
1
|
+
export const dragonChannelPluginVersion = "0.5.45";
|