@efengx/openclaw-channel-dragon 0.5.9 → 0.5.10
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.
|
@@ -4,8 +4,6 @@ export declare class TelemetryComponent implements IComponent {
|
|
|
4
4
|
private http;
|
|
5
5
|
private agentId;
|
|
6
6
|
constructor(http: HttpComponent, agentId: string);
|
|
7
|
-
private lastReportedContent;
|
|
8
|
-
private lastReportedTime;
|
|
9
7
|
start(): Promise<void>;
|
|
10
8
|
stop(): Promise<void>;
|
|
11
9
|
reportReply(payload: {
|
|
@@ -5,20 +5,10 @@ export class TelemetryComponent {
|
|
|
5
5
|
this.http = http;
|
|
6
6
|
this.agentId = agentId;
|
|
7
7
|
}
|
|
8
|
-
lastReportedContent = "";
|
|
9
|
-
lastReportedTime = 0;
|
|
10
8
|
async start() { }
|
|
11
9
|
async stop() { }
|
|
12
10
|
async reportReply(payload) {
|
|
13
11
|
try {
|
|
14
|
-
const now = Date.now();
|
|
15
|
-
const content = payload.content || "";
|
|
16
|
-
// Deduplicate identical replies sent within 3 seconds
|
|
17
|
-
if (content && content === this.lastReportedContent && now - this.lastReportedTime < 3000) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
this.lastReportedContent = content;
|
|
21
|
-
this.lastReportedTime = now;
|
|
22
12
|
const msgId = crypto.randomUUID();
|
|
23
13
|
await this.http.fetch(`/api/agents/${this.agentId}/messages/reply`, {
|
|
24
14
|
method: "POST",
|