adp-openclaw 0.0.17 → 0.0.19
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/monitor.ts +9 -22
package/package.json
CHANGED
package/src/monitor.ts
CHANGED
|
@@ -5,6 +5,9 @@ import type { PluginLogger, ClawdbotConfig } from "openclaw/plugin-sdk";
|
|
|
5
5
|
import { getAdpOpenclawRuntime } from "./runtime.js";
|
|
6
6
|
import crypto from "crypto";
|
|
7
7
|
|
|
8
|
+
// Plugin version from package.json
|
|
9
|
+
const PLUGIN_VERSION = "0.0.18";
|
|
10
|
+
|
|
8
11
|
// WebSocket reconnect delay (fixed at 1 second)
|
|
9
12
|
const RECONNECT_DELAY_MS = 1000;
|
|
10
13
|
|
|
@@ -179,7 +182,7 @@ async function connectAndHandle(params: ConnectParams): Promise<void> {
|
|
|
179
182
|
const result = msg.payload as AuthResultPayload;
|
|
180
183
|
if (result.success) {
|
|
181
184
|
authenticated = true;
|
|
182
|
-
log?.info(`[adp-openclaw]
|
|
185
|
+
log?.info(`[adp-openclaw] Plugin v${PLUGIN_VERSION} authenticated as client ${result.clientId}`);
|
|
183
186
|
|
|
184
187
|
// Start ping interval
|
|
185
188
|
pingInterval = setInterval(() => {
|
|
@@ -376,27 +379,11 @@ async function connectAndHandle(params: ConnectParams): Promise<void> {
|
|
|
376
379
|
// Debug log for all deliver calls - log the actual info object
|
|
377
380
|
log?.info(`[adp-openclaw] deliver called: kind=${kind}, text.length=${text.length}, info=${JSON.stringify(info)}`);
|
|
378
381
|
|
|
379
|
-
// Handle streaming block -
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
type: MsgType.OutboundChunk,
|
|
385
|
-
requestId: generateRequestId(),
|
|
386
|
-
payload: {
|
|
387
|
-
to: inMsg.from,
|
|
388
|
-
chunk: text,
|
|
389
|
-
conversationId: inMsg.conversationId,
|
|
390
|
-
recordId: inMsg.recordId, // Pass recordId back to server
|
|
391
|
-
streamId: streamId,
|
|
392
|
-
index: chunkIndex,
|
|
393
|
-
user: inMsg.user,
|
|
394
|
-
},
|
|
395
|
-
timestamp: Date.now(),
|
|
396
|
-
};
|
|
397
|
-
|
|
398
|
-
ws.send(JSON.stringify(chunkMsg));
|
|
399
|
-
chunkIndex++;
|
|
382
|
+
// Handle streaming block - IGNORE because handlePartial already sent deltas
|
|
383
|
+
// The "block" callback contains cumulative text (same as final), not incremental delta
|
|
384
|
+
// Sending it would cause duplicate data on the server side
|
|
385
|
+
if (kind === "block") {
|
|
386
|
+
log?.debug?.(`[adp-openclaw] Ignoring block callback (handlePartial already sent deltas), text.length=${text.length}`);
|
|
400
387
|
return;
|
|
401
388
|
}
|
|
402
389
|
|