mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 04:01:23 +00:00
refactor(webchat): SwiftUI-only WebChat UI
# Conflicts: # apps/macos/Package.swift
This commit is contained in:
@@ -85,7 +85,7 @@ export class GatewayClient {
|
||||
minProtocol: this.opts.minProtocol ?? PROTOCOL_VERSION,
|
||||
maxProtocol: this.opts.maxProtocol ?? PROTOCOL_VERSION,
|
||||
client: {
|
||||
name: this.opts.clientName ?? "webchat-backend",
|
||||
name: this.opts.clientName ?? "gateway-client",
|
||||
version: this.opts.clientVersion ?? "dev",
|
||||
platform: this.opts.platform ?? process.platform,
|
||||
mode: this.opts.mode ?? "backend",
|
||||
|
||||
@@ -91,9 +91,6 @@ vi.mock("../commands/health.js", () => ({
|
||||
vi.mock("../commands/status.js", () => ({
|
||||
getStatusSummary: vi.fn().mockResolvedValue({ ok: true }),
|
||||
}));
|
||||
vi.mock("../webchat/server.js", () => ({
|
||||
ensureWebChatServerFromConfig: vi.fn().mockResolvedValue(null),
|
||||
}));
|
||||
vi.mock("../web/outbound.js", () => ({
|
||||
sendMessageWhatsApp: vi
|
||||
.fn()
|
||||
|
||||
@@ -89,7 +89,6 @@ import { normalizeE164 } from "../utils.js";
|
||||
import { setHeartbeatsEnabled } from "../web/auto-reply.js";
|
||||
import { sendMessageWhatsApp } from "../web/outbound.js";
|
||||
import { requestReplyHeartbeatNow } from "../web/reply-heartbeat-wake.js";
|
||||
import { ensureWebChatServerFromConfig } from "../webchat/server.js";
|
||||
import { buildMessageWithAttachments } from "./chat-attachments.js";
|
||||
import {
|
||||
type ConnectParams,
|
||||
@@ -543,7 +542,6 @@ async function refreshHealthSnapshot(_opts?: { probe?: boolean }) {
|
||||
|
||||
export async function startGatewayServer(
|
||||
port = 18789,
|
||||
opts?: { webchatPort?: number },
|
||||
): Promise<GatewayServer> {
|
||||
const host = "127.0.0.1";
|
||||
const httpServer: HttpServer = createHttpServer();
|
||||
@@ -3419,19 +3417,6 @@ export async function startGatewayServer(
|
||||
);
|
||||
defaultRuntime.log(`gateway log file: ${getResolvedLoggerSettings().file}`);
|
||||
|
||||
// Start loopback WebChat server (unless disabled via config).
|
||||
void ensureWebChatServerFromConfig(opts?.webchatPort)
|
||||
.then((webchat) => {
|
||||
if (webchat) {
|
||||
defaultRuntime.log(
|
||||
`webchat listening on http://127.0.0.1:${webchat.port}/`,
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
logError(`gateway: webchat failed to start: ${String(err)}`);
|
||||
});
|
||||
|
||||
// Start clawd browser control server (unless disabled via config).
|
||||
void startBrowserControlServerFromConfig(defaultRuntime).catch((err) => {
|
||||
logError(`gateway: clawd browser server failed to start: ${String(err)}`);
|
||||
|
||||
Reference in New Issue
Block a user