@waifusmy/openclaw-waifus 0.0.2 → 0.0.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/index.ts +1 -1
- package/package.json +3 -3
- package/src/channel.ts +8 -7
- package/src/onboarding.ts +1 -1
- package/src/types.ts +2 -2
package/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
|
|
|
9
9
|
import { waifusmyPlugin } from "./src/channel.js";
|
|
10
10
|
|
|
11
11
|
const plugin = {
|
|
12
|
-
id: "
|
|
12
|
+
id: "openclaw-waifus",
|
|
13
13
|
name: "WaifusMy",
|
|
14
14
|
description: "OpenClaw channel plugin for WaifusMy desktop companion app",
|
|
15
15
|
configSchema: emptyPluginConfigSchema(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waifusmy/openclaw-waifus",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "OpenClaw channel plugin for WaifusMy desktop companion app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"channel": {
|
|
24
24
|
"id": "waifusmy",
|
|
25
25
|
"label": "WaifusMy",
|
|
26
|
-
"selectionLabel": "WaifusMy Desktop
|
|
26
|
+
"selectionLabel": "WaifusMy Desktop",
|
|
27
27
|
"docsPath": "/channels/waifusmy",
|
|
28
28
|
"docsLabel": "waifusmy",
|
|
29
|
-
"blurb": "Connect to WaifusMy desktop
|
|
29
|
+
"blurb": "Connect to WaifusMy desktop app",
|
|
30
30
|
"order": 80,
|
|
31
31
|
"quickstartAllowFrom": false
|
|
32
32
|
}
|
package/src/channel.ts
CHANGED
|
@@ -27,6 +27,8 @@ import type {
|
|
|
27
27
|
import { WaifusMyConfigSchema } from "./types.js";
|
|
28
28
|
import { waifusmyOnboardingAdapter } from "./onboarding.js";
|
|
29
29
|
|
|
30
|
+
const RELAY_URL = "wss://waifus-relay.ezshine.workers.dev/ws";
|
|
31
|
+
|
|
30
32
|
// Channel metadata
|
|
31
33
|
const meta: ChannelMeta = getChatChannelMeta("waifusmy");
|
|
32
34
|
|
|
@@ -108,10 +110,10 @@ function connectWebSocket(account: ResolvedWaifusMyAccount): Promise<void> {
|
|
|
108
110
|
const runtime = getRuntime();
|
|
109
111
|
runtime.account = account;
|
|
110
112
|
|
|
111
|
-
console.log(`[waifusmy] Connecting to ${
|
|
113
|
+
console.log(`[waifusmy] Connecting to ${RELAY_URL}`);
|
|
112
114
|
|
|
113
115
|
try {
|
|
114
|
-
runtime.ws = new WebSocket(
|
|
116
|
+
runtime.ws = new WebSocket(RELAY_URL);
|
|
115
117
|
|
|
116
118
|
runtime.ws.onopen = () => {
|
|
117
119
|
console.log("[waifusmy] WebSocket connected");
|
|
@@ -319,9 +321,9 @@ export const waifusmyPlugin: ChannelPlugin<ResolvedWaifusMyAccount> = {
|
|
|
319
321
|
accountId: resolvedId,
|
|
320
322
|
name: "WaifusMy",
|
|
321
323
|
enabled: false,
|
|
322
|
-
config: { enabled: false, api_key: ""
|
|
324
|
+
config: { enabled: false, api_key: "" },
|
|
323
325
|
apiKey: "",
|
|
324
|
-
relayUrl:
|
|
326
|
+
relayUrl: RELAY_URL,
|
|
325
327
|
tokenSource: "none" as const,
|
|
326
328
|
};
|
|
327
329
|
}
|
|
@@ -332,7 +334,7 @@ export const waifusmyPlugin: ChannelPlugin<ResolvedWaifusMyAccount> = {
|
|
|
332
334
|
enabled: waifusmyConfig.enabled ?? true,
|
|
333
335
|
config: waifusmyConfig,
|
|
334
336
|
apiKey: waifusmyConfig.api_key ?? "",
|
|
335
|
-
relayUrl:
|
|
337
|
+
relayUrl: RELAY_URL,
|
|
336
338
|
tokenSource: waifusmyConfig.api_key ? ("config" as const) : ("none" as const),
|
|
337
339
|
};
|
|
338
340
|
},
|
|
@@ -390,7 +392,6 @@ export const waifusmyPlugin: ChannelPlugin<ResolvedWaifusMyAccount> = {
|
|
|
390
392
|
...existing,
|
|
391
393
|
enabled: true,
|
|
392
394
|
api_key: setupInput.apiKey ?? existing.api_key ?? "",
|
|
393
|
-
relay_url: existing.relay_url ?? "wss://waifus-relay.ezshine.workers.dev/ws",
|
|
394
395
|
},
|
|
395
396
|
},
|
|
396
397
|
} as OpenClawConfig;
|
|
@@ -399,7 +400,7 @@ export const waifusmyPlugin: ChannelPlugin<ResolvedWaifusMyAccount> = {
|
|
|
399
400
|
security: {
|
|
400
401
|
resolveDmPolicy: () => ({
|
|
401
402
|
policy: "open" as const,
|
|
402
|
-
allowFrom: [],
|
|
403
|
+
allowFrom: ["*"],
|
|
403
404
|
policyPath: "channels.waifusmy.dmPolicy",
|
|
404
405
|
allowFromPath: "channels.waifusmy.",
|
|
405
406
|
approveHint: undefined,
|
package/src/onboarding.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* WaifusMy Channel Types
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import type { z } from "zod";
|
|
6
5
|
import { z } from "zod";
|
|
7
6
|
|
|
7
|
+
|
|
8
8
|
// WebSocket message types from the relay server
|
|
9
9
|
export const WaifusMyAuthSchema = z.object({
|
|
10
10
|
type: z.literal("auth"),
|
|
@@ -66,7 +66,7 @@ export type WaifusMyOutboundMessage =
|
|
|
66
66
|
export const WaifusMyConfigSchema = z.object({
|
|
67
67
|
enabled: z.boolean().default(true),
|
|
68
68
|
api_key: z.string().min(1, "API key is required"),
|
|
69
|
-
|
|
69
|
+
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
export type WaifusMyConfig = z.infer<typeof WaifusMyConfigSchema>;
|