@efengx/openclaw-channel-dragon 0.5.2 → 0.5.4

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.
@@ -13,7 +13,7 @@ export declare class ChannelComponent implements IComponent {
13
13
  private bridge;
14
14
  private telemetry;
15
15
  private processedMessageIds;
16
- constructor(options: ChannelOptions, bridge: BridgeComponent, telemetry: TelemetryComponent);
16
+ constructor(options: ChannelOptions, bridge: BridgeComponent | null, telemetry: TelemetryComponent);
17
17
  start(): Promise<void>;
18
18
  stop(): Promise<void>;
19
19
  deliverToOpenClaw: (content: string, sessionId?: string, modelId?: string, attachments?: any[], messageId?: string | number) => Promise<void>;
@@ -48,7 +48,7 @@ export class ChannelComponent {
48
48
  const text = payload?.text || "";
49
49
  if (!text && !payload?.tool_calls?.length)
50
50
  return;
51
- if (this.bridge.client) {
51
+ if (this.bridge?.client) {
52
52
  this.bridge.client.sendJson({
53
53
  type: "outbound_text",
54
54
  channel: channelId,
@@ -72,7 +72,7 @@ export class ChannelComponent {
72
72
  const text = ctx?.text || "";
73
73
  const { accountId, agentId, logger } = this.options;
74
74
  logger?.info?.(`[Dragon Plugin] Outbound Text (Action): "${text.substring(0, 50)}${text.length > 50 ? '...' : ''}"`);
75
- if (this.bridge.client) {
75
+ if (this.bridge?.client) {
76
76
  this.bridge.client.sendJson({
77
77
  type: "outbound_text",
78
78
  channel: channelId,
@@ -85,7 +85,7 @@ export class ChannelComponent {
85
85
  };
86
86
  handleAgentEvent = async (evt) => {
87
87
  const { agentId, accountId } = this.options;
88
- if (this.bridge.client) {
88
+ if (this.bridge?.client) {
89
89
  this.bridge.client.sendJson({
90
90
  type: "agent_event",
91
91
  channel: channelId,
@@ -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
  }
package/dist/index.js CHANGED
@@ -24,15 +24,18 @@ async function getOrCreateContainer(account, ctx) {
24
24
  logger
25
25
  }));
26
26
  const telemetry = container.register('telemetry', new TelemetryComponent(http, account.agentId));
27
- const bridge = container.register('bridge', new BridgeComponent({
28
- host: account.bridgeHost,
29
- port: parseInt(account.bridgePort || "18799", 10),
30
- token: account.bridgeToken || "",
31
- agentId: account.agentId,
32
- gatewayPort: parseInt(account.gatewayPort || "18789", 10),
33
- gatewayToken: account.gatewayToken || "",
34
- logger
35
- }));
27
+ let bridge = null;
28
+ if (account.bridgeHost) {
29
+ bridge = container.register('bridge', new BridgeComponent({
30
+ host: account.bridgeHost,
31
+ port: parseInt(account.bridgePort || "18799", 10),
32
+ token: account.bridgeToken || "",
33
+ agentId: account.agentId,
34
+ gatewayPort: parseInt(account.gatewayPort || "18789", 10),
35
+ gatewayToken: account.gatewayToken || "",
36
+ logger
37
+ }));
38
+ }
36
39
  // 2. Channel Logic (Centralized)
37
40
  const channel = container.register('channel', new ChannelComponent({
38
41
  accountId: account.accountId,
@@ -2,7 +2,7 @@
2
2
  "id": "dragon",
3
3
  "name": "Dragon Workbench Channel",
4
4
  "description": "Connect OpenClaw to the Dragon agent-client workbench chat.",
5
- "version": "0.5.2",
5
+ "version": "0.5.4",
6
6
  "enabledByDefault": true,
7
7
  "activation": {
8
8
  "onCapabilities": ["hook"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@efengx/openclaw-channel-dragon",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "Dragon workbench channel for OpenClaw",
5
5
  "author": "feng xiang <ofengx@gmail.com>",
6
6
  "type": "module",