@emotion-machine/claw-messenger 0.1.0 → 0.1.1

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/channel.js CHANGED
@@ -174,10 +174,16 @@ export const clawMessengerPlugin = {
174
174
  };
175
175
  }
176
176
  if (action === "send") {
177
- const to = params.to;
178
- const chatId = params.chatId;
179
- const text = params.message ?? "";
180
- const mediaUrl = params.media?.trim();
177
+ // OpenClaw passes target (string) and targets (string[]) — normalise to a single `to`
178
+ const rawTo = params.targets
179
+ ?? params.to
180
+ ?? params.target;
181
+ const to = typeof rawTo === "string" && rawTo.includes(",")
182
+ ? rawTo.split(",").map((s) => s.trim()).filter(Boolean)
183
+ : rawTo;
184
+ const chatId = params.chatId ?? params.chat_id;
185
+ const text = params.message ?? params.text ?? "";
186
+ const mediaUrl = (params.media ?? params.mediaUrl)?.trim();
181
187
  if (!text && !mediaUrl)
182
188
  throw new Error("message or media is required");
183
189
  if (chatId) {
@@ -22,7 +22,7 @@ export async function sendMessage(ws, to, parts, service) {
22
22
  if (resp.ok) {
23
23
  return {
24
24
  messageId: resp.messageId ?? "",
25
- chatId: "",
25
+ chatId: resp.chatId ?? "",
26
26
  };
27
27
  }
28
28
  throw new Error(resp.error ?? "Send failed");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emotion-machine/claw-messenger",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "iMessage, RCS & SMS channel plugin for OpenClaw — no phone or Mac Mini required",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",