refactor(webchat): SwiftUI-only WebChat UI

# Conflicts:
#	apps/macos/Package.swift
This commit is contained in:
Peter Steinberger
2025-12-17 23:05:28 +01:00
parent ca85d217ec
commit 875cf9a054
7451 changed files with 218063 additions and 776607 deletions

View File

@@ -4,7 +4,6 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
const sendCommand = vi.fn();
const statusCommand = vi.fn();
const loginWeb = vi.fn();
const startWebChatServer = vi.fn(async () => ({ port: 18788 }));
const callGateway = vi.fn();
const runtime = {
@@ -25,10 +24,6 @@ vi.mock("../gateway/call.js", () => ({
callGateway,
randomIdempotencyKey: () => "idem-test",
}));
vi.mock("../webchat/server.js", () => ({
startWebChatServer,
getWebChatServer: () => null,
}));
vi.mock("./deps.js", () => ({
createDefaultDeps: () => ({}),
}));
@@ -54,16 +49,6 @@ describe("cli program", () => {
expect(statusCommand).toHaveBeenCalled();
});
it("starts webchat server and prints json", async () => {
const program = buildProgram();
runtime.log.mockClear();
await program.parseAsync(["webchat", "--json"], { from: "user" });
expect(startWebChatServer).toHaveBeenCalled();
expect(runtime.log).toHaveBeenCalledWith(
JSON.stringify({ port: 18788, basePath: "/", host: "127.0.0.1" }),
);
});
it("runs nodes list and calls node.pair.list", async () => {
callGateway.mockResolvedValue({ pending: [], paired: [] });
const program = buildProgram();