@ynhcj/xiaoyi 1.6.0 → 1.7.0

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/auth.d.ts CHANGED
@@ -6,7 +6,8 @@ import { AuthCredentials } from "./types";
6
6
  export declare class XiaoYiAuth {
7
7
  private ak;
8
8
  private sk;
9
- constructor(ak: string, sk: string);
9
+ private agentId;
10
+ constructor(ak: string, sk: string, agentId: string);
10
11
  /**
11
12
  * Generate authentication credentials with signature
12
13
  */
package/dist/auth.js CHANGED
@@ -40,9 +40,10 @@ const crypto = __importStar(require("crypto"));
40
40
  * Based on: https://developer.huawei.com/consumer/cn/doc/service/pushmessage-0000002505761436
41
41
  */
42
42
  class XiaoYiAuth {
43
- constructor(ak, sk) {
43
+ constructor(ak, sk, agentId) {
44
44
  this.ak = ak;
45
45
  this.sk = sk;
46
+ this.agentId = agentId;
46
47
  }
47
48
  /**
48
49
  * Generate authentication credentials with signature
@@ -81,11 +82,10 @@ class XiaoYiAuth {
81
82
  const credentials = this.generateAuthCredentials();
82
83
  return {
83
84
  type: "auth",
84
- data: {
85
- ak: credentials.ak,
86
- timestamp: credentials.timestamp,
87
- signature: credentials.signature,
88
- },
85
+ ak: credentials.ak,
86
+ agentId: this.agentId,
87
+ timestamp: credentials.timestamp,
88
+ signature: credentials.signature,
89
89
  };
90
90
  }
91
91
  }
package/dist/websocket.js CHANGED
@@ -14,7 +14,7 @@ class XiaoYiWebSocketManager extends events_1.EventEmitter {
14
14
  this.heartbeatInterval = null;
15
15
  this.reconnectTimeout = null;
16
16
  this.config = config;
17
- this.auth = new auth_1.XiaoYiAuth(config.ak, config.sk);
17
+ this.auth = new auth_1.XiaoYiAuth(config.ak, config.sk, config.agentId);
18
18
  this.state = {
19
19
  connected: false,
20
20
  authenticated: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "XiaoYi channel plugin for OpenClaw",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",