@botcord/openclaw-plugin 0.0.2 → 0.0.3
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 -0
- package/index.ts +43 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/botcord/SKILL.md +45 -0
- package/src/client.ts +70 -2
- package/src/commands/healthcheck.ts +19 -2
- package/src/commands/register.ts +134 -11
- package/src/commands/token.ts +1 -2
- package/src/credentials.ts +14 -2
- package/src/hub-url.ts +41 -0
- package/src/inbound.ts +16 -2
- package/src/loop-risk.ts +409 -0
- package/src/tools/rooms.ts +6 -0
- package/src/tools/subscription.ts +176 -0
- package/src/types.ts +61 -0
- package/src/ws-client.ts +2 -2
package/src/ws-client.ts
CHANGED
|
@@ -13,6 +13,7 @@ import WebSocket from "ws";
|
|
|
13
13
|
import { BotCordClient } from "./client.js";
|
|
14
14
|
import { handleInboxMessage } from "./inbound.js";
|
|
15
15
|
import { displayPrefix } from "./config.js";
|
|
16
|
+
import { buildHubWebSocketUrl } from "./hub-url.js";
|
|
16
17
|
|
|
17
18
|
interface WsClientOptions {
|
|
18
19
|
client: BotCordClient;
|
|
@@ -73,7 +74,7 @@ export function startWsClient(opts: WsClientOptions): { stop: () => void } {
|
|
|
73
74
|
// Get a fresh JWT token
|
|
74
75
|
const token = await client.ensureToken();
|
|
75
76
|
const hubUrl = client.getHubUrl();
|
|
76
|
-
const wsUrl = hubUrl
|
|
77
|
+
const wsUrl = buildHubWebSocketUrl(hubUrl);
|
|
77
78
|
|
|
78
79
|
log?.info(`[${dp}] WebSocket connecting to ${wsUrl}`);
|
|
79
80
|
ws = new WebSocket(wsUrl);
|
|
@@ -184,4 +185,3 @@ export function stopWsClient(accountId: string): void {
|
|
|
184
185
|
const entry = activeWsClients.get(accountId);
|
|
185
186
|
if (entry) entry.stop();
|
|
186
187
|
}
|
|
187
|
-
|