@ynhcj/xiaoyi-channel 0.0.56-beta → 0.0.58-beta

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.
@@ -5,6 +5,7 @@ import type { XYChannelConfig } from "./types.js";
5
5
  */
6
6
  export declare class XYPushService {
7
7
  private config;
8
+ private readonly DEFAULT_PUSH_URL;
8
9
  private readonly REQUEST_FROM;
9
10
  constructor(config: XYChannelConfig);
10
11
  /**
package/dist/src/push.js CHANGED
@@ -7,6 +7,7 @@ import { randomUUID } from "crypto";
7
7
  */
8
8
  export class XYPushService {
9
9
  config;
10
+ DEFAULT_PUSH_URL = "https://hag.cloud.huawei.com/open-ability-agent/v1/agent-webhook";
10
11
  REQUEST_FROM = "openclaw";
11
12
  constructor(config) {
12
13
  this.config = config;
@@ -28,7 +29,7 @@ export class XYPushService {
28
29
  * @param pushId - Push ID to use (required)
29
30
  */
30
31
  async sendPush(content, title, data, sessionId, pushDataId, pushId) {
31
- const pushUrl = `${this.config.fileUploadUrl}/open-ability-agent/v1/agent-webhook`;
32
+ const pushUrl = this.config.pushUrl || this.DEFAULT_PUSH_URL;
32
33
  const traceId = this.generateTraceId();
33
34
  // Use provided pushId or fall back to config pushId
34
35
  const actualPushId = pushId || this.config.pushId;
@@ -90,33 +90,17 @@ export const callPhoneTool = {
90
90
  clearTimeout(timeout);
91
91
  wsManager.off("data-event", handler);
92
92
  if (event.status === "success" && event.outputs) {
93
- // Check for error code in outputs
94
- const code = event.outputs.code !== undefined ? event.outputs.code : null;
95
- if (code !== null && code !== 0) {
96
- const errorMsg = event.outputs.errorMsg || event.outputs.errMsg || "未知错误";
97
- reject(new Error(`拨打电话失败: ${errorMsg} (错误代码: ${code})`));
98
- return;
99
- }
100
- // Return the outputs directly
101
- const result = {
102
- success: true,
103
- code: code,
104
- phoneNumber: params.phoneNumber,
105
- slotId: slotId,
106
- message: "电话拨打成功",
107
- };
108
93
  resolve({
109
94
  content: [
110
95
  {
111
96
  type: "text",
112
- text: JSON.stringify(result),
97
+ text: JSON.stringify(event.outputs),
113
98
  },
114
99
  ],
115
100
  });
116
101
  }
117
102
  else {
118
- const errorDetail = event.outputs ? JSON.stringify(event.outputs) : event.status;
119
- reject(new Error(`拨打电话失败: ${errorDetail}`));
103
+ reject(new Error(`拨打电话失败: ${event.status}`));
120
104
  }
121
105
  }
122
106
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "0.0.56-beta",
3
+ "version": "0.0.58-beta",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",