@searchfe/openclaw-baiduapp 0.1.0-beta.5 → 0.1.0-beta.6

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.d.ts CHANGED
@@ -7,7 +7,6 @@ interface BaiduAppAccountConfig {
7
7
  webhookPath?: string;
8
8
  token?: string;
9
9
  encodingAESKey?: string;
10
- receiveId?: string;
11
10
  appKey?: string;
12
11
  appSecret?: string;
13
12
  apiBase?: string;
@@ -26,7 +25,6 @@ interface ResolvedBaiduAppAccount {
26
25
  configured: boolean;
27
26
  token?: string;
28
27
  encodingAESKey?: string;
29
- receiveId: string;
30
28
  appKey?: string;
31
29
  appSecret?: string;
32
30
  apiBase: string;
@@ -130,9 +128,6 @@ declare const baiduAppPlugin: {
130
128
  encodingAESKey: {
131
129
  type: string;
132
130
  };
133
- receiveId: {
134
- type: string;
135
- };
136
131
  appKey: {
137
132
  type: string;
138
133
  };
@@ -179,9 +174,6 @@ declare const baiduAppPlugin: {
179
174
  encodingAESKey: {
180
175
  type: string;
181
176
  };
182
- receiveId: {
183
- type: string;
184
- };
185
177
  appKey: {
186
178
  type: string;
187
179
  };
package/dist/index.js CHANGED
@@ -4055,7 +4055,6 @@ var BaiduAppAccountSchema = external_exports.object({
4055
4055
  webhookPath: external_exports.string().optional(),
4056
4056
  token: external_exports.string().optional(),
4057
4057
  encodingAESKey: external_exports.string().optional(),
4058
- receiveId: external_exports.string().optional(),
4059
4058
  appKey: external_exports.string().optional(),
4060
4059
  appSecret: external_exports.string().optional(),
4061
4060
  apiBase: external_exports.string().optional(),
@@ -4077,7 +4076,6 @@ var BaiduAppConfigJsonSchema = {
4077
4076
  webhookPath: { type: "string" },
4078
4077
  token: { type: "string" },
4079
4078
  encodingAESKey: { type: "string" },
4080
- receiveId: { type: "string" },
4081
4079
  appKey: { type: "string" },
4082
4080
  appSecret: { type: "string" },
4083
4081
  apiBase: { type: "string" },
@@ -4096,7 +4094,6 @@ var BaiduAppConfigJsonSchema = {
4096
4094
  webhookPath: { type: "string" },
4097
4095
  token: { type: "string" },
4098
4096
  encodingAESKey: { type: "string" },
4099
- receiveId: { type: "string" },
4100
4097
  appKey: { type: "string" },
4101
4098
  appSecret: { type: "string" },
4102
4099
  apiBase: { type: "string" },
@@ -4159,7 +4156,6 @@ function resolveBaiduAppAccount(params) {
4159
4156
  const isDefaultAccount = accountId === DEFAULT_ACCOUNT_ID;
4160
4157
  const token = merged.token?.trim() || (isDefaultAccount ? process.env.BAIDU_APP_TOKEN?.trim() : void 0) || void 0;
4161
4158
  const encodingAESKey = merged.encodingAESKey?.trim() || (isDefaultAccount ? process.env.BAIDU_APP_ENCODING_AES_KEY?.trim() : void 0) || void 0;
4162
- const receiveId = merged.receiveId?.trim() ?? "";
4163
4159
  const appKey = merged.appKey?.trim() || (isDefaultAccount ? process.env.BAIDU_APP_KEY?.trim() : void 0) || void 0;
4164
4160
  const appSecret = merged.appSecret?.trim() || (isDefaultAccount ? process.env.BAIDU_APP_SECRET?.trim() : void 0) || void 0;
4165
4161
  const configured = Boolean(token && encodingAESKey);
@@ -4173,7 +4169,6 @@ function resolveBaiduAppAccount(params) {
4173
4169
  configured,
4174
4170
  token,
4175
4171
  encodingAESKey,
4176
- receiveId,
4177
4172
  appKey,
4178
4173
  appSecret,
4179
4174
  apiBase,
@@ -4525,15 +4520,7 @@ function decryptBaiduAppEncrypted(params) {
4525
4520
  if (msgEnd > decrypted.length) {
4526
4521
  throw new Error(`invalid decrypted msg length (msgEnd=${msgEnd}, payloadLength=${decrypted.length})`);
4527
4522
  }
4528
- const msg = decrypted.subarray(msgStart, msgEnd).toString("utf8");
4529
- const receiveId = params.receiveId ?? "";
4530
- if (receiveId) {
4531
- const trailing = decrypted.subarray(msgEnd).toString("utf8");
4532
- if (trailing !== receiveId) {
4533
- throw new Error(`receiveId mismatch (expected "${receiveId}", got "${trailing}")`);
4534
- }
4535
- }
4536
- return msg;
4523
+ return decrypted.subarray(msgStart, msgEnd).toString("utf8");
4537
4524
  }
4538
4525
  function encryptBaiduAppPlaintext(params) {
4539
4526
  const aesKey = decodeEncodingAESKey(params.encodingAESKey);
@@ -4542,8 +4529,7 @@ function encryptBaiduAppPlaintext(params) {
4542
4529
  const msg = Buffer.from(params.plaintext ?? "", "utf8");
4543
4530
  const msgLen = Buffer.alloc(4);
4544
4531
  msgLen.writeUInt32BE(msg.length, 0);
4545
- const receiveId = Buffer.from(params.receiveId ?? "", "utf8");
4546
- const raw = Buffer.concat([random16, msgLen, msg, receiveId]);
4532
+ const raw = Buffer.concat([random16, msgLen, msg]);
4547
4533
  const padded = pkcs7Pad(raw, PKCS7_BLOCK_SIZE);
4548
4534
  const cipher = crypto.createCipheriv("aes-256-cbc", aesKey, iv);
4549
4535
  cipher.setAutoPadding(false);
@@ -4690,7 +4676,6 @@ function buildEncryptedJsonReply(params) {
4690
4676
  const plaintext = JSON.stringify(params.plaintextJson ?? {});
4691
4677
  const encrypt = encryptBaiduAppPlaintext({
4692
4678
  encodingAESKey: params.account.encodingAESKey ?? "",
4693
- receiveId: params.account.receiveId ?? "",
4694
4679
  plaintext
4695
4680
  });
4696
4681
  const msgsignature = computeBaiduAppMsgSignature({
@@ -4779,7 +4764,6 @@ function decryptBaiduAppCandidates(params) {
4779
4764
  try {
4780
4765
  const plaintext = decryptBaiduAppEncrypted({
4781
4766
  encodingAESKey: candidate.account.encodingAESKey,
4782
- receiveId: candidate.account.receiveId,
4783
4767
  encrypt: params.encrypt
4784
4768
  });
4785
4769
  const msg = parseBaiduAppPlainMessage(plaintext);