openclaw-seatalk 0.1.3 → 0.1.4
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 +8 -2
- package/package.json +1 -1
- package/src/accounts.ts +0 -1
- package/src/monitor.ts +6 -2
- package/src/relay-client.ts +8 -3
- package/src/types.ts +0 -1
package/README.md
CHANGED
|
@@ -63,12 +63,18 @@ openclaw plugins install openclaw-seatalk
|
|
|
63
63
|
|
|
64
64
|
OpenClaw downloads the package, installs dependencies, and registers the plugin automatically. The plugin will appear in the `openclaw onboard` channel selection.
|
|
65
65
|
|
|
66
|
-
To pin a specific version:
|
|
66
|
+
To install and pin a specific version:
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
69
|
openclaw plugins install openclaw-seatalk --pin
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
To update to the latest version (restart the gateway afterwards to apply):
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
openclaw plugins update openclaw-seatalk
|
|
76
|
+
```
|
|
77
|
+
|
|
72
78
|
### From source (development)
|
|
73
79
|
|
|
74
80
|
Clone the repo and link it directly — no build step required. OpenClaw loads TypeScript via Jiti at runtime.
|
|
@@ -94,7 +100,7 @@ SeaTalk --HTTP POST-> OpenClaw (webhook server)
|
|
|
94
100
|
|
|
95
101
|
### Relay Mode (recommended for multiple apps)
|
|
96
102
|
|
|
97
|
-
The plugin connects to a [seatalk-relay](https://github.com/lf4096/
|
|
103
|
+
The plugin connects to a [seatalk-relay](https://github.com/lf4096/seatalk-relay) service as a WebSocket client. The relay service receives webhooks from SeaTalk and forwards events to the plugin. Suitable when OpenClaw runs behind a firewall or NAT without a public address.
|
|
98
104
|
|
|
99
105
|
```
|
|
100
106
|
SeaTalk API --HTTP POST-> seatalk-relay <-WebSocket-- OpenClaw (relay mode)
|
package/package.json
CHANGED
package/src/accounts.ts
CHANGED
|
@@ -77,7 +77,6 @@ export function resolveSeaTalkAccount(params: {
|
|
|
77
77
|
configured: Boolean(creds),
|
|
78
78
|
appId: creds?.appId,
|
|
79
79
|
appSecret: creds?.appSecret,
|
|
80
|
-
signingSecret: creds?.signingSecret,
|
|
81
80
|
mode: merged.mode ?? "webhook",
|
|
82
81
|
relayUrl: merged.relayUrl,
|
|
83
82
|
webhookPort: merged.webhookPort ?? 8080,
|
package/src/monitor.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as crypto from "node:crypto";
|
|
2
2
|
import * as http from "node:http";
|
|
3
3
|
import type { ClawdbotConfig, RuntimeEnv } from "openclaw/plugin-sdk";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
listEnabledSeaTalkAccounts,
|
|
6
|
+
resolveSeaTalkAccount,
|
|
7
|
+
resolveSeaTalkCredentials,
|
|
8
|
+
} from "./accounts.js";
|
|
5
9
|
import { dispatchSeaTalkEvent } from "./bot.js";
|
|
6
10
|
import { resolveSeaTalkClient } from "./client.js";
|
|
7
11
|
import type { ResolvedSeaTalkAccount, SeaTalkCallbackRequest } from "./types.js";
|
|
@@ -69,7 +73,7 @@ async function monitorSingleAccount(params: {
|
|
|
69
73
|
|
|
70
74
|
const port = account.webhookPort;
|
|
71
75
|
const callbackPath = account.webhookPath;
|
|
72
|
-
const signingSecret = account.signingSecret;
|
|
76
|
+
const signingSecret = resolveSeaTalkCredentials(account.config)?.signingSecret;
|
|
73
77
|
|
|
74
78
|
if (!signingSecret) {
|
|
75
79
|
throw new Error(`SeaTalk account "${accountId}" missing signingSecret`);
|
package/src/relay-client.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { ClawdbotConfig, RuntimeEnv } from "openclaw/plugin-sdk";
|
|
2
2
|
import WebSocket from "ws";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
listEnabledSeaTalkAccounts,
|
|
5
|
+
resolveSeaTalkAccount,
|
|
6
|
+
resolveSeaTalkCredentials,
|
|
7
|
+
} from "./accounts.js";
|
|
4
8
|
import { dispatchSeaTalkEvent } from "./bot.js";
|
|
5
9
|
import { resolveSeaTalkClient } from "./client.js";
|
|
6
10
|
import type { MonitorSeaTalkOpts } from "./monitor.js";
|
|
@@ -36,7 +40,8 @@ async function connectSingleAccount(params: {
|
|
|
36
40
|
const log = runtime?.log ?? console.log;
|
|
37
41
|
const error = runtime?.error ?? console.error;
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
const signingSecret = resolveSeaTalkCredentials(account.config)?.signingSecret;
|
|
44
|
+
if (!account.appId || !account.appSecret || !signingSecret) {
|
|
40
45
|
throw new Error(`SeaTalk account "${accountId}" missing credentials for relay mode`);
|
|
41
46
|
}
|
|
42
47
|
|
|
@@ -71,7 +76,7 @@ async function connectSingleAccount(params: {
|
|
|
71
76
|
type: "auth",
|
|
72
77
|
appId: account.appId,
|
|
73
78
|
appSecret: account.appSecret,
|
|
74
|
-
signingSecret
|
|
79
|
+
signingSecret,
|
|
75
80
|
}),
|
|
76
81
|
);
|
|
77
82
|
});
|