@efengx/openclaw-channel-dragon 0.5.22 → 0.5.23
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.
|
@@ -18,12 +18,6 @@ export declare class ChannelComponent implements IComponent {
|
|
|
18
18
|
private normalizeSessionSegment;
|
|
19
19
|
private resolveOpenClawAgentId;
|
|
20
20
|
private buildOpenClawSessionKey;
|
|
21
|
-
/**
|
|
22
|
-
* Derives a stable, deterministic UUID (v4-shaped) from a sessionKey using SHA-256.
|
|
23
|
-
* This ensures each Dragon session maps to a unique physical .jsonl file in OpenClaw,
|
|
24
|
-
* preventing concurrent lane lock conflicts (EmbeddedAttemptSessionTakeoverError).
|
|
25
|
-
*/
|
|
26
|
-
private deriveSessionId;
|
|
27
21
|
private stringifyProgressDetail;
|
|
28
22
|
deliverToOpenClaw: (content: string, sessionId?: string, modelId?: string, attachments?: any[], messageId?: string | number) => Promise<void>;
|
|
29
23
|
handleOutboundText: (ctx: any) => Promise<{
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
1
|
import { dragonChannelPluginVersion } from "../../version.js";
|
|
3
2
|
const channelId = "dragon";
|
|
4
3
|
export class ChannelComponent {
|
|
@@ -35,22 +34,6 @@ export class ChannelComponent {
|
|
|
35
34
|
const workbenchSessionId = this.normalizeSessionSegment(sessionId, 'default');
|
|
36
35
|
return `agent:${openClawAgentId}:dragon:direct:${dragonAgentId}:${workbenchSessionId}`;
|
|
37
36
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Derives a stable, deterministic UUID (v4-shaped) from a sessionKey using SHA-256.
|
|
40
|
-
* This ensures each Dragon session maps to a unique physical .jsonl file in OpenClaw,
|
|
41
|
-
* preventing concurrent lane lock conflicts (EmbeddedAttemptSessionTakeoverError).
|
|
42
|
-
*/
|
|
43
|
-
deriveSessionId(sessionKey) {
|
|
44
|
-
const hash = createHash("sha256").update(`dragon:${sessionKey}`).digest("hex");
|
|
45
|
-
// Format as UUID v4 (variant bits set for RFC 4122 compliance)
|
|
46
|
-
return [
|
|
47
|
-
hash.slice(0, 8),
|
|
48
|
-
hash.slice(8, 12),
|
|
49
|
-
`4${hash.slice(13, 16)}`,
|
|
50
|
-
`${(["8", "9", "a", "b"][parseInt(hash[16], 16) >> 2])}${hash.slice(17, 20)}`,
|
|
51
|
-
hash.slice(20, 32),
|
|
52
|
-
].join("-");
|
|
53
|
-
}
|
|
54
37
|
stringifyProgressDetail(value, maxLength = 240) {
|
|
55
38
|
if (typeof value === 'string') {
|
|
56
39
|
const text = value.trim();
|
|
@@ -97,17 +80,12 @@ export class ChannelComponent {
|
|
|
97
80
|
ctx: {
|
|
98
81
|
Body: content,
|
|
99
82
|
From: sessionId === 'default' ? "workbench-user" : `workbench-user-${sessionId}`,
|
|
100
|
-
To:
|
|
83
|
+
To: sessionId === 'default' ? "dragon-workbench" : `dragon-workbench-${sessionId}`,
|
|
101
84
|
ChatType: "direct",
|
|
102
85
|
Provider: channelId,
|
|
103
86
|
ChannelId: channelId,
|
|
104
87
|
AccountId: accountId,
|
|
105
88
|
SessionKey: sessionKey,
|
|
106
|
-
// Deterministic SessionId derived from SessionKey — ensures each Dragon
|
|
107
|
-
// workbench session has its own isolated .jsonl file in OpenClaw,
|
|
108
|
-
// preventing EmbeddedAttemptSessionTakeoverError caused by concurrent
|
|
109
|
-
// lane access to the same physical session file.
|
|
110
|
-
SessionId: this.deriveSessionId(sessionKey),
|
|
111
89
|
Timestamp: Date.now(),
|
|
112
90
|
Model: modelId,
|
|
113
91
|
Attachments: attachments,
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const dragonChannelPluginVersion = "0.5.
|
|
1
|
+
export declare const dragonChannelPluginVersion = "0.5.23";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const dragonChannelPluginVersion = "0.5.
|
|
1
|
+
export const dragonChannelPluginVersion = "0.5.23";
|