@efengx/openclaw-channel-dragon 0.5.25 → 0.5.26

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineChannelPluginEntry, createChatChannelPlugin, createChannelPluginBase } from "openclaw/plugin-sdk/core";
1
+ import { defineChannelPluginEntry, createChatChannelPlugin, createChannelPluginBase, buildChannelOutboundSessionRoute } from "openclaw/plugin-sdk/core";
2
2
  import { createRawChannelSendResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
3
3
  import * as InfraRuntime from "openclaw/plugin-sdk/infra-runtime";
4
4
  import { ServiceContainer } from "./core/ServiceContainer.js";
@@ -86,6 +86,61 @@ const plugin = createChatChannelPlugin({
86
86
  });
87
87
  }
88
88
  },
89
+ messaging: {
90
+ targetPrefixes: ["dragon-workbench", "dragon"],
91
+ normalizeTarget: (raw) => {
92
+ let target = raw || "";
93
+ for (const prefix of ["dragon-workbench-", "dragon-workbench:", "dragon-", "dragon:"]) {
94
+ if (target.startsWith(prefix)) {
95
+ target = target.substring(prefix.length);
96
+ }
97
+ }
98
+ return target ? `dragon-workbench-${target}` : "";
99
+ },
100
+ resolveOutboundSessionRoute: (params) => {
101
+ let target = params.target || "";
102
+ for (const prefix of ["dragon-workbench-", "dragon-workbench:", "dragon-", "dragon:"]) {
103
+ if (target.startsWith(prefix)) {
104
+ target = target.substring(prefix.length);
105
+ }
106
+ }
107
+ if (!target)
108
+ return null;
109
+ return buildChannelOutboundSessionRoute({
110
+ cfg: params.cfg,
111
+ agentId: params.agentId,
112
+ channel: channelId,
113
+ accountId: params.accountId,
114
+ peer: {
115
+ kind: "direct",
116
+ id: target
117
+ },
118
+ chatType: "direct",
119
+ from: `dragon-workbench-${target}`,
120
+ to: `dragon-workbench-${target}`
121
+ });
122
+ },
123
+ targetResolver: {
124
+ looksLikeId: (raw) => {
125
+ return raw.startsWith("dragon-workbench-") || raw.startsWith("session-");
126
+ },
127
+ hint: "<sessionId>",
128
+ resolveTarget: async ({ input }) => {
129
+ let sessionId = input;
130
+ for (const prefix of ["dragon-workbench-", "dragon-workbench:", "dragon-", "dragon:"]) {
131
+ if (sessionId.startsWith(prefix)) {
132
+ sessionId = sessionId.substring(prefix.length);
133
+ }
134
+ }
135
+ return {
136
+ to: `dragon-workbench-${sessionId}`,
137
+ kind: "direct",
138
+ display: `Dragon Workbench User (${sessionId})`,
139
+ source: "normalized"
140
+ };
141
+ }
142
+ }
143
+ }
89
144
  },
90
145
  outbound: {
91
146
  attachedResults: createRawChannelSendResultAdapter({
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const dragonChannelPluginVersion = "0.5.25";
1
+ export declare const dragonChannelPluginVersion = "0.5.26";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const dragonChannelPluginVersion = "0.5.25";
1
+ export const dragonChannelPluginVersion = "0.5.26";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@efengx/openclaw-channel-dragon",
3
- "version": "0.5.25",
3
+ "version": "0.5.26",
4
4
  "description": "Dragon workbench channel for OpenClaw",
5
5
  "author": "feng xiang <ofengx@gmail.com>",
6
6
  "type": "module",