@ynhcj/xiaoyi 2.3.1 → 2.3.3

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/channel.js CHANGED
@@ -80,14 +80,11 @@ exports.xiaoyiPlugin = {
80
80
  }
81
81
  const config = account.config;
82
82
  // Check each field is a string and has content after trimming
83
- // Support both old wsUrl and new wsUrl1/wsUrl2
84
- const hasWsUrl = ((typeof config.wsUrl === 'string' && config.wsUrl.trim().length > 0) ||
85
- (typeof config.wsUrl1 === 'string' && config.wsUrl1.trim().length > 0) ||
86
- (typeof config.wsUrl2 === 'string' && config.wsUrl2.trim().length > 0));
83
+ // Note: wsUrl1/wsUrl2 are optional (defaults will be used if not provided)
87
84
  const hasAk = typeof config.ak === 'string' && config.ak.trim().length > 0;
88
85
  const hasSk = typeof config.sk === 'string' && config.sk.trim().length > 0;
89
86
  const hasAgentId = typeof config.agentId === 'string' && config.agentId.trim().length > 0;
90
- return hasWsUrl && hasAk && hasSk && hasAgentId;
87
+ return hasAk && hasSk && hasAgentId;
91
88
  },
92
89
  isEnabled: (account, cfg) => {
93
90
  return account?.enabled !== false;
@@ -96,14 +93,13 @@ exports.xiaoyiPlugin = {
96
93
  return "Channel is disabled in configuration";
97
94
  },
98
95
  unconfiguredReason: (account, cfg) => {
99
- return "Missing required configuration: wsUrl/wsUrl1/wsUrl2, ak, sk, or agentId";
96
+ return "Missing required configuration: ak, sk, or agentId (wsUrl1/wsUrl2 are optional, defaults will be used)";
100
97
  },
101
98
  describeAccount: (account, cfg) => ({
102
99
  accountId: account.accountId,
103
100
  name: 'XiaoYi',
104
101
  enabled: account.enabled,
105
- configured: Boolean((account.config?.wsUrl || account.config?.wsUrl1 || account.config?.wsUrl2) &&
106
- account.config?.ak && account.config?.sk && account.config?.agentId),
102
+ configured: Boolean(account.config?.ak && account.config?.sk && account.config?.agentId),
107
103
  }),
108
104
  },
109
105
  /**
package/dist/types.d.ts CHANGED
@@ -6,7 +6,7 @@ export interface A2ARequestMessage {
6
6
  method: "message/stream";
7
7
  params: {
8
8
  id: string;
9
- sessionId: string;
9
+ sessionId?: string;
10
10
  agentLoginSessionId?: string;
11
11
  message: {
12
12
  role: "user" | "agent";
@@ -163,7 +163,7 @@ export interface WebSocketConnectionState {
163
163
  reconnectAttempts: number;
164
164
  maxReconnectAttempts: number;
165
165
  }
166
- export declare const DEFAULT_WS_URL_1 = "wss://hag-drcn.op.hicloud.com/openclaw/v1/ws/link";
166
+ export declare const DEFAULT_WS_URL_1 = "wss://hag.cloud.huawei.com/openclaw/v1/ws/link";
167
167
  export declare const DEFAULT_WS_URL_2 = "wss://116.63.174.231";
168
168
  export interface InternalWebSocketConfig {
169
169
  wsUrl1: string;
package/dist/types.js CHANGED
@@ -4,5 +4,5 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.DEFAULT_WS_URL_2 = exports.DEFAULT_WS_URL_1 = void 0;
6
6
  // Dual server configuration
7
- exports.DEFAULT_WS_URL_1 = "wss://hag-drcn.op.hicloud.com/openclaw/v1/ws/link";
7
+ exports.DEFAULT_WS_URL_1 = "wss://hag.cloud.huawei.com/openclaw/v1/ws/link";
8
8
  exports.DEFAULT_WS_URL_2 = "wss://116.63.174.231";
package/dist/websocket.js CHANGED
@@ -776,7 +776,8 @@ class XiaoYiWebSocketManager extends events_1.EventEmitter {
776
776
  data.method === "message/stream" &&
777
777
  data.params &&
778
778
  typeof data.params.id === "string" &&
779
- typeof data.params.sessionId === "string" &&
779
+ // params.sessionId is optional - not sent by actual server
780
+ (data.params.sessionId === undefined || typeof data.params.sessionId === "string") &&
780
781
  data.params.message &&
781
782
  typeof data.params.message.role === "string" &&
782
783
  Array.isArray(data.params.message.parts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "description": "XiaoYi channel plugin for OpenClaw",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",