@gloablehive/ipad-wechat-plugin 1.0.11 → 1.0.12

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.
@@ -206,6 +206,27 @@ export const ipadWeChatPlugin = createChatChannelPlugin({
206
206
  defaultPolicy: "allowlist",
207
207
  },
208
208
  },
209
+ // Messaging adapter - for target resolution
210
+ messaging: {
211
+ targetResolver: {
212
+ looksLikeId: (raw) => {
213
+ // WeChat IDs typically start with "wxid_" or are phone numbers
214
+ return raw.startsWith("wxid_") || /^\d{5,15}$/.test(raw) || raw.includes("@chatroom");
215
+ },
216
+ resolveTarget: async (params) => {
217
+ const target = params.input?.trim() || params.normalized?.trim();
218
+ if (!target)
219
+ return null;
220
+ // For WeChat, just pass through the ID - it's already valid
221
+ return {
222
+ to: target,
223
+ kind: target.includes("@chatroom") ? "group" : "user",
224
+ display: target,
225
+ source: "normalized"
226
+ };
227
+ },
228
+ },
229
+ },
209
230
  threading: {
210
231
  topLevelReplyToMode: "reply",
211
232
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gloablehive/ipad-wechat-plugin",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "type": "module",
5
5
  "description": "OpenClaw channel plugin for iPad WeChat protocol - enables sending/receiving WeChat messages through iPad protocol",
6
6
  "main": "index.ts",
package/src/channel.ts CHANGED
@@ -267,6 +267,28 @@ export const ipadWeChatPlugin = createChatChannelPlugin<IPadWeChatResolvedAccoun
267
267
  },
268
268
  },
269
269
 
270
+ // Messaging adapter - for target resolution
271
+ messaging: {
272
+ targetResolver: {
273
+ looksLikeId: (raw: string) => {
274
+ // WeChat IDs typically start with "wxid_" or are phone numbers
275
+ return raw.startsWith("wxid_") || /^\d{5,15}$/.test(raw) || raw.includes("@chatroom");
276
+ },
277
+ resolveTarget: async (params: any) => {
278
+ const target = params.input?.trim() || params.normalized?.trim();
279
+ if (!target) return null;
280
+
281
+ // For WeChat, just pass through the ID - it's already valid
282
+ return {
283
+ to: target,
284
+ kind: target.includes("@chatroom") ? "group" : "user",
285
+ display: target,
286
+ source: "normalized"
287
+ };
288
+ },
289
+ },
290
+ },
291
+
270
292
  threading: {
271
293
  topLevelReplyToMode: "reply",
272
294
  },