@emotion-machine/claw-messenger 0.1.0 → 0.1.2
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/README.md +6 -10
- package/dist/channel.d.ts +0 -4
- package/dist/channel.js +11 -9
- package/dist/index.js +1 -1
- package/dist/outbound/send.d.ts +0 -4
- package/dist/outbound/send.js +1 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,16 +16,12 @@ After installing, add to your OpenClaw config under `channels`:
|
|
|
16
16
|
{
|
|
17
17
|
"channels": {
|
|
18
18
|
"claw-messenger": {
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"dmPolicy": "pairing", // "open" | "pairing" | "allowlist"
|
|
26
|
-
"allowFrom": ["+15551234567"] // only used with "allowlist" policy
|
|
27
|
-
}
|
|
28
|
-
}
|
|
19
|
+
"enabled": true,
|
|
20
|
+
"apiKey": "cm_live_XXXXXXXX_YYYYYYYYYYYYYY",
|
|
21
|
+
"serverUrl": "wss://claw-messenger.onrender.com",
|
|
22
|
+
"preferredService": "iMessage", // "iMessage" | "RCS" | "SMS"
|
|
23
|
+
"dmPolicy": "pairing", // "open" | "pairing" | "allowlist"
|
|
24
|
+
"allowFrom": ["+15551234567"] // only used with "allowlist" policy
|
|
29
25
|
}
|
|
30
26
|
}
|
|
31
27
|
}
|
package/dist/channel.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claw Messenger channel plugin — adapted from channel-linq.
|
|
3
|
-
* All Linq API interaction is replaced by WebSocket communication to claw-messenger.
|
|
4
|
-
*/
|
|
5
1
|
import { type ChannelPlugin } from "openclaw/plugin-sdk";
|
|
6
2
|
import { type ClawMessengerConfig } from "./config.js";
|
|
7
3
|
interface ResolvedAccount {
|
package/dist/channel.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claw Messenger channel plugin — adapted from channel-linq.
|
|
3
|
-
* All Linq API interaction is replaced by WebSocket communication to claw-messenger.
|
|
4
|
-
*/
|
|
5
1
|
import { buildChannelConfigSchema, DEFAULT_ACCOUNT_ID, formatPairingApproveHint, normalizeE164, PAIRING_APPROVED_MESSAGE, } from "openclaw/plugin-sdk";
|
|
6
2
|
import { ClawMessengerConfigSchema } from "./config.js";
|
|
7
3
|
import { getRuntime } from "./runtime.js";
|
|
@@ -52,7 +48,7 @@ const meta = {
|
|
|
52
48
|
detailLabel: "Claw Messenger",
|
|
53
49
|
docsPath: "/channels/claw-messenger",
|
|
54
50
|
docsLabel: "claw-messenger",
|
|
55
|
-
blurb: "iMessage, RCS & SMS without a Mac or
|
|
51
|
+
blurb: "iMessage, RCS & SMS without a Mac or a phone number",
|
|
56
52
|
systemImage: "message.fill",
|
|
57
53
|
};
|
|
58
54
|
export const clawMessengerPlugin = {
|
|
@@ -174,10 +170,16 @@ export const clawMessengerPlugin = {
|
|
|
174
170
|
};
|
|
175
171
|
}
|
|
176
172
|
if (action === "send") {
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
173
|
+
// OpenClaw passes target (string) and targets (string[]) — normalise to a single `to`
|
|
174
|
+
const rawTo = params.targets
|
|
175
|
+
?? params.to
|
|
176
|
+
?? params.target;
|
|
177
|
+
const to = typeof rawTo === "string" && rawTo.includes(",")
|
|
178
|
+
? rawTo.split(",").map((s) => s.trim()).filter(Boolean)
|
|
179
|
+
: rawTo;
|
|
180
|
+
const chatId = params.chatId ?? params.chat_id;
|
|
181
|
+
const text = params.message ?? params.text ?? "";
|
|
182
|
+
const mediaUrl = (params.media ?? params.mediaUrl)?.trim();
|
|
181
183
|
if (!text && !mediaUrl)
|
|
182
184
|
throw new Error("message or media is required");
|
|
183
185
|
if (chatId) {
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ const VALID_SERVICES = ["iMessage", "RCS", "SMS"];
|
|
|
6
6
|
const plugin = {
|
|
7
7
|
id: "claw-messenger",
|
|
8
8
|
name: "Claw Messenger",
|
|
9
|
-
description: "iMessage, RCS & SMS without a Mac or
|
|
9
|
+
description: "iMessage, RCS & SMS without a Mac or a phone number",
|
|
10
10
|
configSchema: emptyPluginConfigSchema(),
|
|
11
11
|
register(api) {
|
|
12
12
|
setRuntime(api.runtime);
|
package/dist/outbound/send.d.ts
CHANGED
package/dist/outbound/send.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Send messages via WebSocket to claw-messenger -> Linq -> iMessage.
|
|
3
|
-
* Replaces direct Linq API calls from channel-linq/src/outbound/send.ts.
|
|
4
|
-
*/
|
|
5
1
|
export async function sendText(ws, to, text, service) {
|
|
6
2
|
return sendMessage(ws, to, [{ type: "text", value: text }], service);
|
|
7
3
|
}
|
|
@@ -22,7 +18,7 @@ export async function sendMessage(ws, to, parts, service) {
|
|
|
22
18
|
if (resp.ok) {
|
|
23
19
|
return {
|
|
24
20
|
messageId: resp.messageId ?? "",
|
|
25
|
-
chatId: "",
|
|
21
|
+
chatId: resp.chatId ?? "",
|
|
26
22
|
};
|
|
27
23
|
}
|
|
28
24
|
throw new Error(resp.error ?? "Send failed");
|