@efengx/openclaw-channel-dragon 0.5.1 → 0.5.3
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.
|
@@ -37,7 +37,7 @@ export class PollingComponent {
|
|
|
37
37
|
if (messages.length > 0) {
|
|
38
38
|
logger?.debug?.(`[Dragon Plugin] [Recovery] Polled ${messages.length} pending messages.`);
|
|
39
39
|
for (const m of messages) {
|
|
40
|
-
await this.channel.deliverToOpenClaw(String(m.content || ''), String(m.sessionId || 'default'), m.modelId, m.attachments, m.id);
|
|
40
|
+
await this.channel.deliverToOpenClaw(String(m.content || ''), String(m.sessionId || 'default'), m.modelId, m.attachments, m.externalId || m.id);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -86,9 +86,9 @@ export class SseComponent {
|
|
|
86
86
|
return;
|
|
87
87
|
// 2. Handle specific types
|
|
88
88
|
if (data.type === 'WORKBENCH_MESSAGE') {
|
|
89
|
-
const { content, sessionId, attachments, id } = data.payload || {};
|
|
89
|
+
const { content, sessionId, attachments, id, msgId } = data.payload || {};
|
|
90
90
|
logger?.info?.(`[Dragon Plugin] [SSE] Received from Workbench: "${content?.substring(0, 50)}${content?.length > 50 ? '...' : ''}" [Session: ${sessionId}]`);
|
|
91
|
-
this.channel.deliverToOpenClaw(content, sessionId, undefined, attachments, id);
|
|
91
|
+
this.channel.deliverToOpenClaw(content, sessionId, undefined, attachments, msgId || id);
|
|
92
92
|
}
|
|
93
93
|
else if (data.type === 'FETCH_HISTORY') {
|
|
94
94
|
const { sessionId } = data.payload || {};
|
|
@@ -9,10 +9,11 @@ export class TelemetryComponent {
|
|
|
9
9
|
async stop() { }
|
|
10
10
|
async reportReply(payload) {
|
|
11
11
|
try {
|
|
12
|
+
const msgId = crypto.randomUUID();
|
|
12
13
|
await this.http.fetch(`/api/agents/${this.agentId}/messages/reply`, {
|
|
13
14
|
method: "POST",
|
|
14
15
|
headers: { "Content-Type": "application/json" },
|
|
15
|
-
body: JSON.stringify(payload),
|
|
16
|
+
body: JSON.stringify({ ...payload, msgId }),
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
19
|
catch (e) {
|
|
@@ -41,10 +42,11 @@ export class TelemetryComponent {
|
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
44
|
if (telemetryPayload) {
|
|
45
|
+
const msgId = crypto.randomUUID();
|
|
44
46
|
this.http.fetch(`/api/agents/${this.agentId}/messages/reply`, {
|
|
45
47
|
method: "POST",
|
|
46
48
|
headers: { "Content-Type": "application/json" },
|
|
47
|
-
body: JSON.stringify(telemetryPayload),
|
|
49
|
+
body: JSON.stringify({ ...telemetryPayload, msgId }),
|
|
48
50
|
}).catch(() => { });
|
|
49
51
|
}
|
|
50
52
|
}
|
package/openclaw.plugin.json
CHANGED