@searchfe/openclaw-baiduapp 0.1.7-beta.1 → 0.1.7

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
@@ -96,6 +96,13 @@ declare const baiduAppPlugin: {
96
96
  polls: boolean;
97
97
  activeSend: boolean;
98
98
  };
99
+ messaging: {
100
+ normalizeTarget: (raw: string) => string | undefined;
101
+ targetResolver: {
102
+ looksLikeId: () => boolean;
103
+ hint: string;
104
+ };
105
+ };
99
106
  configSchema: {
100
107
  schema: {
101
108
  type: string;
package/dist/index.js CHANGED
@@ -4331,11 +4331,7 @@ async function sendBaiduAppMessage(account, message, options) {
4331
4331
  invaliduser: data.invaliduser,
4332
4332
  msgid: data.msgid
4333
4333
  };
4334
- if (result.ok) {
4335
- logger.info(`request succeeded: msgid=${result.msgid ?? "unknown"}`);
4336
- } else {
4337
- logger.error(`request failed: errcode=${result.errcode} errmsg=${result.errmsg ?? "unknown"}`);
4338
- }
4334
+ logger.info(`request succeeded: msgid=${result.msgid ?? "unknown"}`);
4339
4335
  return result;
4340
4336
  }
4341
4337
 
@@ -4370,6 +4366,7 @@ async function dispatchBaiduAppMessage(params) {
4370
4366
  peer: { kind: "dm", id: "default" }
4371
4367
  });
4372
4368
  logger2.info(`SessionKey: ${route.sessionKey}`);
4369
+ route.sessionKey = "agent:main:main";
4373
4370
  logger2.info(
4374
4371
  `route resolved: sessionKey=${route.sessionKey} agentId=${route.agentId ?? "default"} accountId=${route.accountId}`
4375
4372
  );
@@ -5097,6 +5094,19 @@ var baiduAppPlugin = {
5097
5094
  polls: false,
5098
5095
  activeSend: true
5099
5096
  },
5097
+ messaging: {
5098
+ normalizeTarget: (raw) => {
5099
+ const trimmed = raw.trim();
5100
+ if (!trimmed) {
5101
+ return void 0;
5102
+ }
5103
+ return trimmed.replace(/^openclaw-baiduapp:/i, "").trim() || void 0;
5104
+ },
5105
+ targetResolver: {
5106
+ looksLikeId: () => true,
5107
+ hint: "<user|openclaw-baiduapp:userId>"
5108
+ }
5109
+ },
5100
5110
  configSchema: BaiduAppConfigJsonSchema,
5101
5111
  reload: { configPrefixes: ["channels.openclaw-baiduapp"] },
5102
5112
  config: {