History

wire embedded web UI back into CLI for compiled binaries

Rhys Sullivan committed 7 months ago

Commit ce52c6d1 parent 756a9042 files · +35 −3Browse files

Showing the changes to apps/cli/src (1 of 2 files). Show all

Unified · Split

apps/cli/src/main.ts+6−1
@@ -30,6 +30,9 @@ import * as Cause from "effect/Cause"; · 29 unmodified lines
30import { ExecutorApi } from "@executor/api";30import { ExecutorApi } from "@executor/api";
31import { startServer, runMcpStdioServer, getExecutor } from "@executor/local";31import { startServer, runMcpStdioServer, getExecutor } from "@executor/local";
32 32
33// Embedded web UI — baked into compiled binaries via `with { type: "file" }`
34import embeddedWebUI from "./embedded-web-ui.gen";
35
33// ---------------------------------------------------------------------------36// ---------------------------------------------------------------------------
34// Constants37// Constants
35// ---------------------------------------------------------------------------38// ---------------------------------------------------------------------------
@@ -115,7 +118,9 @@ const makeApiClient = (baseUrl: string) => · 79 unmodified lines
115 118
116const runForegroundSession = (input: { port: number }) =>119const runForegroundSession = (input: { port: number }) =>
117 Effect.gen(function* () {120 Effect.gen(function* () {
118 const server = yield* Effect.promise(() => startServer({ port: input.port }));121 const server = yield* Effect.promise(() =>
122 startServer({ port: input.port, embeddedWebUI }),
123 );
119 124
120 const baseUrl = `http://localhost:${server.port}`;125 const baseUrl = `http://localhost:${server.port}`;
121 console.log(`Executor is ready.`);126 console.log(`Executor is ready.`);