Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/channel/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import {
} from "openclaw/plugin-sdk/setup";
import { SIMPLEX_CHANNEL_ID } from "../constants.js";

type SimplexSetupInput = ChannelSetupInput & {
cliPath?: string;
httpUrl?: string;
url?: string;
};

function resolveSetupAccountId(params: {
cfg: OpenClawConfig;
accountId?: string;
Expand Down Expand Up @@ -46,11 +52,12 @@ export const simplexSetupAdapter: ChannelSetupAdapter = {
});
},
validateInput: ({ input }) => {
const cliPath = input.cliPath?.trim();
const setupInput = input as SimplexSetupInput;
const cliPath = setupInput.cliPath?.trim();
if (cliPath) {
return "SimpleX CLI path is not configured in OpenClaw. Start simplex-chat separately with its WebSocket API enabled.";
}
const runtimeUrl = input.url?.trim() || input.httpUrl?.trim();
const runtimeUrl = setupInput.url?.trim() || setupInput.httpUrl?.trim();
if (runtimeUrl && !runtimeUrl.startsWith("ws://") && !runtimeUrl.startsWith("wss://")) {
return "SimpleX runtime URL must be a ws:// or wss:// WebSocket URL.";
}
Expand Down
Loading