@gloablehive/ipad-wechat-plugin 1.0.12 → 1.0.15

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.
@@ -208,11 +208,21 @@ export const ipadWeChatPlugin = createChatChannelPlugin({
208
208
  },
209
209
  // Messaging adapter - for target resolution
210
210
  messaging: {
211
+ inferTargetChatType: ({ to }) => {
212
+ // WeChat chatroom IDs contain "@chatroom"
213
+ if (to?.includes("@chatroom"))
214
+ return "group";
215
+ return "direct";
216
+ },
211
217
  targetResolver: {
212
- looksLikeId: (raw) => {
218
+ looksLikeId: (raw, _normalized) => {
213
219
  // WeChat IDs typically start with "wxid_" or are phone numbers
214
- return raw.startsWith("wxid_") || /^\d{5,15}$/.test(raw) || raw.includes("@chatroom");
220
+ const trimmed = raw?.trim();
221
+ if (!trimmed)
222
+ return false;
223
+ return trimmed.startsWith("wxid_") || /^\d{5,15}$/.test(trimmed) || trimmed.includes("@chatroom");
215
224
  },
225
+ hint: "<wxid_xxx|phone|xxx@chatroom>",
216
226
  resolveTarget: async (params) => {
217
227
  const target = params.input?.trim() || params.normalized?.trim();
218
228
  if (!target)
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://openclaw.ai/schema/plugin.json",
3
3
  "id": "ipad-wechat",
4
4
  "name": "iPad WeChat",
5
- "version": "1.0.0",
5
+ "version": "1.0.14",
6
6
  "description": "Connect OpenClaw to iPad WeChat protocol for sending and receiving WeChat messages",
7
7
  "author": {
8
8
  "name": "gloablehive",
@@ -14,6 +14,9 @@
14
14
  },
15
15
  "keywords": ["openclaw", "channel", "wechat", "ipad", "messaging"],
16
16
  "license": "MIT",
17
+ "channels": [
18
+ "ipad-wechat"
19
+ ],
17
20
  "type": "channel",
18
21
  "capabilities": {
19
22
  "inbound": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gloablehive/ipad-wechat-plugin",
3
- "version": "1.0.12",
3
+ "version": "1.0.15",
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
@@ -269,11 +269,19 @@ export const ipadWeChatPlugin = createChatChannelPlugin<IPadWeChatResolvedAccoun
269
269
 
270
270
  // Messaging adapter - for target resolution
271
271
  messaging: {
272
+ inferTargetChatType: ({ to }) => {
273
+ // WeChat chatroom IDs contain "@chatroom"
274
+ if (to?.includes("@chatroom")) return "group";
275
+ return "direct";
276
+ },
272
277
  targetResolver: {
273
- looksLikeId: (raw: string) => {
278
+ looksLikeId: (raw: string, _normalized?: string) => {
274
279
  // WeChat IDs typically start with "wxid_" or are phone numbers
275
- return raw.startsWith("wxid_") || /^\d{5,15}$/.test(raw) || raw.includes("@chatroom");
280
+ const trimmed = raw?.trim();
281
+ if (!trimmed) return false;
282
+ return trimmed.startsWith("wxid_") || /^\d{5,15}$/.test(trimmed) || trimmed.includes("@chatroom");
276
283
  },
284
+ hint: "<wxid_xxx|phone|xxx@chatroom>",
277
285
  resolveTarget: async (params: any) => {
278
286
  const target = params.input?.trim() || params.normalized?.trim();
279
287
  if (!target) return null;