The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Delete the old web dashboard: nothing opened it (#919)
Dee8eb7c05a8329
diff --git a/cli/src/architecture.spec.ts b/cli/src/architecture.spec.tsindex 8392d1e48..b9c79e905 100644--- a/cli/src/architecture.spec.ts+++ b/cli/src/architecture.spec.ts@@ -270,7 +270,11 @@ const SERVICE_MAY_IMPORT: Record<string, string> = {// receipts and streams and its Store preparations run with the dials (services/wifi.ts, in the devices'// process; the core's side is core/wifi.ts and core/wifiLink.ts), and with them went the Store's installs// and catalog, which only the device's preparations reached from the core.-const CORE_CLOSURE_BUDGET = 75_850+//+// Then at 75,456 in 344, from 75,746 in 345: the web dashboard (webui.ts, `GET /`, its log tail and stop+// button, and its port in `e2e_status`) is deleted. Nothing opened it: no app, website, script or the+// backend, and the web client that linked to it retired with the browser setup links (#348).+const CORE_CLOSURE_BUDGET = 75_560/** What is not the core's, by path: each goes to a service or its own process, in the plan's order. */const EDGE: RegExp[] = [diff --git a/cli/src/backendSocket.ts b/cli/src/backendSocket.tsindex 74b698760..81ccc4f49 100644--- a/cli/src/backendSocket.ts+++ b/cli/src/backendSocket.ts@@ -299,12 +299,12 @@ export class BackendSocket {return this.localClients.size > this.toolClients.size}- /** True after a paired device has completed the E2EE hello/welcome session (the local dashboard's dot). */+ /** True after a paired device has completed the E2EE hello/welcome session (`/api/status`). */deviceE2eeConnected(): boolean {return [...this.remoteClients.values()].some((client) => client.role === 'device')}- /** Live backend link state (local dashboard), as the gateway last said. */+ /** Live backend link state (`/api/status`), as the gateway last said. */isConnected(): boolean {return this.linkUp}diff --git a/cli/src/cli.ts b/cli/src/cli.tsindex b4a0536ee..51d6b41af 100644--- a/cli/src/cli.ts+++ b/cli/src/cli.ts@@ -1177,7 +1177,7 @@ async function restartDaemonForIdentity(stoppedDaemon = false): Promise<void> {* `VERSION` is a constant baked into whichever bundle is doing the printing, and that is not always the* one running: `harness update` downloads a new build, spawns it, and then prints this block — all from* the OLD process — so the block announced the version it was replacing (`✓ installed v0.0.22` followed- * by `version v0.0.20`). Every other row here is a fact about the daemon (pid, sessions, dashboard); this+ * by `version v0.0.20`). Every other row here is a fact about the daemon (pid, sessions, local api); this* makes the version one too. Falls back to the local constant when the daemon cannot be reached, which is* exactly the case where the printing process IS the only build there is.*@@ -1252,7 +1252,9 @@ function printInfoBlock(opts: {if (opts.supervisor) console.log(row('supervisor', opts.supervisor))console.log(row('logs', tildify(LOG_FILE)))console.log(row('dial log', tildify(join(env.HARNESS_LOGS_DIR, 'dial-YYYYMMDD.log'))))- console.log(row('dashboard', `http://127.0.0.1:${daemonPort()}`))+ // The daemon's loopback API, which scripts read (`/api/status`). It was the web dashboard's address+ // until that page went: nothing opened it.+ console.log(row('local api', `http://127.0.0.1:${daemonPort()}`))console.log(rule)console.log(' running in background · stop with: harness stop')console.log('')@@ -1493,7 +1495,7 @@ async function daemonCall(method: 'GET' | 'POST', path: string, body?: unknown):const url = `http://127.0.0.1:${daemonPort()}${path}`let res: Responsetry {- const headers: Record<string, string> = { 'x-adapter-local': '1' } // passes the dashboard CSRF gate+ const headers: Record<string, string> = { 'x-adapter-local': '1' } // passes the local API's CSRF gateif (body) headers['content-type'] = 'application/json'res = await fetch(url, { method, headers, body: body ? JSON.stringify(body) : undefined })} catch {diff --git a/cli/src/core/api.ts b/cli/src/core/api.tsindex 5fbdcfadf..a9e269e0f 100644--- a/cli/src/core/api.ts+++ b/cli/src/core/api.ts@@ -1050,8 +1050,6 @@ export interface GatewayOps {* answer (`{ refused }`), as the device's local API words it. */wifi(request: { op: 'discover' | 'pair' | 'pairStatus' | 'list' | 'revoke'; device?: string; code?: string; id?: string }):Promise<{ result: Record<string, unknown> } | { refused: GatewayRefusal }>- /** The local dashboard's port, said to the web in `e2e_status` so it can link there to approve a pairing. */- dashboardPort(port: number): void/** The Wi-Fi device service is up (its direct links start) or gone (they stop). */wifiService(on: boolean): void/** A Wi-Fi device asked to be unpaired, over its own authenticated session. */diff --git a/cli/src/core/gatewayLink.spec.ts b/cli/src/core/gatewayLink.spec.tsindex 5b949ceed..e2ae96d99 100644--- a/cli/src/core/gatewayLink.spec.ts+++ b/cli/src/core/gatewayLink.spec.ts@@ -53,7 +53,6 @@ describe('the gateway in its own process, as the core sees it', () => {link.port.connect()link.port.holdRequests()link.port.localClients(2)- link.ops.dashboardPort(41000)link.ops.wifiService(true)link.ops.account({ machineId: 'm1', signIn: null })link.ops.reachable(['m2'])@@ -62,7 +61,7 @@ describe('the gateway in its own process, as the core sees it', () => {expect(kinds()).toEqual(['start'])expect(sent[0]).toEqual({kind: 'start', machineId: 'm1', computerId: 'c1', autonomousEnv: 'prod', signedIn: true,- requestsOpen: false, dial: 'connect', localClients: 2, dashboardPort: 41000, wifiService: true, reachable: ['m2'],+ requestsOpen: false, dial: 'connect', localClients: 2, wifiService: true, reachable: ['m2'],})link.port.openRequests()link.port.serveThisComputerOnly()diff --git a/cli/src/core/gatewayLink.ts b/cli/src/core/gatewayLink.tsindex cd2855c4e..3737e4719 100644--- a/cli/src/core/gatewayLink.ts+++ b/cli/src/core/gatewayLink.ts@@ -87,7 +87,6 @@ export function createGatewayLink(deps: GatewayLinkDeps) {let requestsOpen = truelet dial: 'connect' | 'local' | null = nulllet localClients = 0- let dashboardPort: number | null = nulllet wifiService = falselet reachable: string[] | null = null/** The remote clients the gateway registered, to forget each when it goes. */@@ -213,7 +212,6 @@ export function createGatewayLink(deps: GatewayLinkDeps) {: { code: 'UNAVAILABLE', message: 'The Wi-Fi device link is not reachable on this computer right now. Try again.' }return { refused: why }},- dashboardPort: (port) => { dashboardPort = port; send('dashboardPort', { port }) },wifiService: (on) => { wifiService = on; send('wifiService', { on }) },revokeIdentity: (identity) => { send('revokeIdentity', { identity }) },account: (next) => { send('account', { account: next }) },@@ -383,7 +381,7 @@ export function createGatewayLink(deps: GatewayLinkDeps) {if (up) this.disconnected()up = true// The account as the core reads it now (`start`), which is never older than the last one it said.- send('start', { requestsOpen, dial, localClients, dashboardPort, wifiService, reachable, ...deps.start() })+ send('start', { requestsOpen, dial, localClients, wifiService, reachable, ...deps.start() })},/** The gateway's process went: the relay with it, as far as everything in the core is concerned. */disconnected(): void {diff --git a/cli/src/core/main.ts b/cli/src/core/main.tsindex 73f066201..d47b6d4b2 100644--- a/cli/src/core/main.ts+++ b/cli/src/core/main.ts@@ -1610,9 +1610,10 @@ async function runForeground(session: AuthSession | null): Promise<void> {}- // Local dashboard (GET /api/status): adapter health + computer fingerprint + local pairings. It- // deliberately does NOT expose chat/transcripts — those live in the cloud web (WEB_URL/commander). The- // fingerprint and the pairings are the gateway's, asked for each time (bounded: core/gatewayLink.ts).+ // The daemon's status (GET /api/status, read by `harness status`, the desktop's discovery and scripts):+ // health, the computer's fingerprint and its local pairings. It deliberately does NOT expose chat or+ // transcripts. The fingerprint and the pairings are the gateway's, asked for each time (bounded:+ // core/gatewayLink.ts).const statusBody = async (relay: GatewayStatus): Promise<Record<string, unknown>> => ({machineId: backend.machineId,computerId: computerId(),@@ -1759,10 +1760,6 @@ async function runForeground(session: AuthSession | null): Promise<void> {onDevicesDismiss: (body) => gatewayOps.devicesDismiss(body),onDevicesRebaseline: (confirm, head) => gatewayOps.devicesRebaseline(confirm, head),onStatus: async () => statusBody(await gatewayOps.status()),- onLogs: () => {- try { return readFileSync(LOG_FILE, 'utf-8').split('\n').slice(-120).join('\n') } catch { return '' }- },- onStop: () => { setTimeout(() => process.kill(process.pid, 'SIGTERM'), 50) }, // let the 200 flush firstonMachinesList: () => machinesListWithFallback(),onMachineRename: (machineId, name) => proxyBackend('PATCH', `/api/machines/${encodeURIComponent(machineId)}`, { name }),onMachineDelete: (machineId) => proxyBackend('DELETE', `/api/machines/${encodeURIComponent(machineId)}`),@@ -1921,8 +1918,6 @@ async function runForeground(session: AuthSession | null): Promise<void> {localWsServerRef = localWsServer// Every engine's hooks, pointed at the port the local server actually bound (core/engines/hooks.ts).if (!env.DISABLE_HOOK_INSTALL) installEngineHooks(hookPort, { only: env.HOOK_INSTALL_ENGINES, loginShell: loginShellEnvPromise })- gatewayOps.dashboardPort(hookPort) // surfaced to the web (e2e_status) so it can link here to approve- console.log(`[cli] local dashboard → http://127.0.0.1:${hookPort}`)// Each transcript line, through its engine's normalizer, into the funnel (core/transcripts/ingest.ts).const ingest = createIngest({diff --git a/cli/src/gateway/gateway.ts b/cli/src/gateway/gateway.tsindex fd8cf999c..4680acae9 100644--- a/cli/src/gateway/gateway.ts+++ b/cli/src/gateway/gateway.ts@@ -831,10 +831,8 @@ export class RelayGateway implements GatewayPort {/** True after a paired device has completed the E2EE hello/welcome session. */deviceE2eeConnected(): boolean { return this.e2ee.deviceConnected() }- /** A browser waiting to pair (local dashboard), or null. */+ /** A browser waiting to pair (`/api/status`), or null. */pendingPair(): ReturnType<E2eeManager['pendingPair']> { return this.e2ee.pendingPair() }- /** Record the local dashboard port so it's surfaced to the web (in e2e_status) for approve-via-web. */- setDashboardPort(port: number): void { this.e2ee.dashboardPort = port }/** Run CPace pairing for a code entered via `harness pair <code>` (delegated to the manager). */pair(code: string): Promise<PairResult> { return this.e2ee.onPair(code) }fingerprint(): string { return this.e2ee.fingerprint() }diff --git a/cli/src/gateway/gatewayProcess.spec.ts b/cli/src/gateway/gatewayProcess.spec.tsindex 098ae63e6..2dce2abfc 100644--- a/cli/src/gateway/gatewayProcess.spec.ts+++ b/cli/src/gateway/gatewayProcess.spec.ts@@ -31,7 +31,7 @@ function stubGateway() {trustLinkedPeer: vi.fn(async () => answer), groupList: vi.fn(async () => answer), groupSync: vi.fn(async () => answer),groupRemove: vi.fn(async () => answer), devicesList: vi.fn(async () => answer), devicesRemove: vi.fn(async () => answer),devicesHistory: vi.fn(async () => answer), devicesDismiss: vi.fn(async () => answer), devicesRebaseline: vi.fn(async () => answer),- wifi: vi.fn(async () => ({ result: { devices: [] } })), dashboardPort: vi.fn(), wifiService: vi.fn(), revokeIdentity: vi.fn(),+ wifi: vi.fn(async () => ({ result: { devices: [] } })), wifiService: vi.fn(), revokeIdentity: vi.fn(),account: vi.fn(), reachable: vi.fn(),lane: {hello: vi.fn(async (machineId: string) => ({ type: 'e2e_hello', machineId })), welcome: vi.fn(async () => true),@@ -101,7 +101,6 @@ describe('the gateway\'s process, spoken to by the core', () => {w.link.port.holdRequests()w.link.port.connect()w.link.port.localClients(1)- w.link.ops.dashboardPort(41000)w.link.ops.reachable(['m2'])w.link.ops.wifiService(true)expect(w.gateways).toHaveLength(0)@@ -111,7 +110,6 @@ describe('the gateway\'s process, spoken to by the core', () => {expect(w.hosts[0]).toMatchObject({ machineId: 'machine-1', computerId: 'computer-1', autonomousEnv: 'prod', signedIn: true, account: { machineId: 'machine-1', signIn: null } })expect(gateway.port.holdRequests).toHaveBeenCalled()expect(gateway.port.localClients).toHaveBeenCalledWith(1)- expect(gateway.ops.dashboardPort).toHaveBeenCalledWith(41000)expect(gateway.ops.reachable).toHaveBeenCalledWith(['m2'])expect(gateway.ops.wifiService).toHaveBeenCalledWith(true)expect(gateway.port.connect).toHaveBeenCalled()diff --git a/cli/src/gateway/gatewayProcess.ts b/cli/src/gateway/gatewayProcess.tsindex c34855d3f..c12ced56e 100644--- a/cli/src/gateway/gatewayProcess.ts+++ b/cli/src/gateway/gatewayProcess.ts@@ -101,7 +101,6 @@ export function runGatewayService(options: GatewayServiceOptions): ServiceProces// Held first, so that nothing the link brings in is answered before the core is ready.if (payload.requestsOpen === false) started.port.holdRequests()started.port.localClients(Number(payload.localClients) || 0)- if (typeof payload.dashboardPort === 'number') started.ops.dashboardPort(payload.dashboardPort)if (Array.isArray(payload.reachable)) started.ops.reachable(payload.reachable as string[])if (payload.wifiService === true) started.ops.wifiService(true)if (payload.dial === 'connect') started.port.connect()@@ -174,7 +173,6 @@ export function runGatewayService(options: GatewayServiceOptions): ServiceProcescase 'localFrame': void port.local(connId, record(payload.frame)); returncase 'device': port.device(connId, text(payload.type), record(payload.payload)); returncase 'deviceClient': port.deviceClient(connId, typeof payload.identity === 'string' ? payload.identity : null); return- case 'dashboardPort': ops.dashboardPort(Number(payload.port)); returncase 'wifiService': ops.wifiService(payload.on === true); returncase 'revokeIdentity': ops.revokeIdentity(text(payload.identity)); returncase 'account': ops.account(payload.account as GatewayAccount); returndiff --git a/cli/src/gateway/start.ts b/cli/src/gateway/start.tsindex b30e15051..bd523789d 100644--- a/cli/src/gateway/start.ts+++ b/cli/src/gateway/start.ts@@ -410,7 +410,6 @@ export function startGateway(host: GatewayHost): StartedGateway {return { result: { revoked: 1 } }} catch (error) { return refusal(error) }},- dashboardPort: (port) => gateway.setDashboardPort(port),wifiService: (on) => {if (on) { startDirect(); return }direct?.stop()diff --git a/cli/src/gateway/upstream.ts b/cli/src/gateway/upstream.tsindex 1466e610e..2f35b5660 100644--- a/cli/src/gateway/upstream.ts+++ b/cli/src/gateway/upstream.ts@@ -126,7 +126,7 @@ export class UpstreamLink {this.url = (computerId ? `${base}&computer=${encodeURIComponent(computerId)}` : base) + claim}- /** Live backend link state (local dashboard + E2EE gating). */+ /** Live backend link state (`/api/status` + E2EE gating). */isConnected(): boolean {return this.ws?.readyState === WebSocket.OPEN}diff --git a/cli/src/hookServer.spec.ts b/cli/src/hookServer.spec.tsindex b8050d06d..b5992def6 100644--- a/cli/src/hookServer.spec.ts+++ b/cli/src/hookServer.spec.ts@@ -444,42 +444,52 @@ describe('requests must name this server', () => {it('refuses every route, reads included, when Host is not a loopback name for this port', async () => {const onStatus = vi.fn(() => ({ ok: true }))- const onLogs = vi.fn(() => 'secret log')- const { base } = await start({ onStatus, onLogs })+ const { base } = await start({ onStatus })const evil = { host: 'rebind.evil.example:' + new URL(base).port }for (const [method, path, extra] of [- ['GET', '/api/status', {}], ['GET', '/api/logs', {}], ['GET', '/', {}], ['GET', '/api/machines', {}],- ['POST', '/api/remote-password/set', { 'x-adapter-local': '1' }], ['POST', '/api/stop', { 'x-adapter-local': '1' }],+ ['GET', '/api/status', {}], ['GET', '/', {}], ['GET', '/api/machines', {}],+ ['POST', '/api/remote-password/set', { 'x-adapter-local': '1' }], ['POST', '/api/group/sync', { 'x-adapter-local': '1' }],] as const) {expect(await send(base, method, path, { ...evil, ...extra }), `${method} ${path}`).toBe(403)}expect(onStatus).not.toHaveBeenCalled()- expect(onLogs).not.toHaveBeenCalled()+ })++ it('serves no web dashboard: its page, log tail and stop button are gone', async () => {+ // Nothing opened the page (no app, website, script or the backend), and the web client that linked to+ // it retired with the browser setup links (#348). `harness stop` stops the daemon by its pid.+ const { base } = await start({ onStatus: () => ({ ok: true }) })+ for (const [method, path] of [['GET', '/'], ['GET', '/index.html'], ['GET', '/api/logs'], ['POST', '/api/stop']] as const) {+ expect(await send(base, method, path, { 'x-adapter-local': '1' }), `${method} ${path}`).toBe(404)+ }})it('answers every request even when its handler throws, instead of leaving the caller waiting', async () => {const error = vi.spyOn(console, 'error').mockImplementation(() => {})- const onStop = vi.fn(() => { throw new Error('stop failed after the answer') })- const { base } = await start({- onStatus: async () => { throw new Error('status read failed') },- onLogs: () => { throw 'log file gone' },- onStop,+ let failing: 'read' | 'body' = 'read'+ const { base, headers } = await start({+ // A status that cannot be read, then one that cannot be written once its headers went out.+ onStatus: async () => { if (failing === 'read') throw new Error('status read failed'); return { n: 1n } },+ // A hook told "pending" before its resolution failed.+ resolveHookAgent: async ({ onWait }) => { onWait?.(); throw 'resolution failed after the answer' },})// Before the answer: a 500 the caller can act on, at once.const status = await fetch(`${base}/api/status`)expect(status.status).toBe(500)expect(await status.json()).toEqual({ error: 'INTERNAL' })// After the headers went out: the response is ended, not left open.- const logs = await fetch(`${base}/api/logs`)- expect(logs.status).toBe(200)- expect(await logs.text()).toBe('')+ failing = 'body'+ const unwritable = await fetch(`${base}/api/status`)+ expect(unwritable.status).toBe(200)+ expect(await unwritable.text()).toBe('')// After the response ended: nothing more to send, and nothing breaks.- const stop = await fetch(`${base}/api/stop`, { method: 'POST', headers: { 'x-adapter-local': '1' } })- expect(await stop.json()).toEqual({ ok: true })- await vi.waitFor(() => expect(onStop).toHaveBeenCalled())+ const hook = await fetch(`${base}/api/hook/session-start`, {+ method: 'POST', headers, body: JSON.stringify({ engine: 'codex', tmuxPane: '%41', sessionId: '019fea92-e31a-7692-9c35-f616e9d458b7' }),+ })+ expect(await hook.json()).toEqual({ pending: true })expect(error).toHaveBeenCalledWith('[hooks] GET /api/status failed:', 'status read failed')- expect(error).toHaveBeenCalledWith('[hooks] GET /api/logs failed:', 'log file gone')- await vi.waitFor(() => expect(error).toHaveBeenCalledWith('[hooks] POST /api/stop failed:', 'stop failed after the answer'))+ expect(error).toHaveBeenCalledWith('[hooks] GET /api/status failed:', expect.stringContaining('BigInt'))+ await vi.waitFor(() => expect(error).toHaveBeenCalledWith('[hooks] POST /api/hook/session-start failed:', 'resolution failed after the answer'))error.mockRestore()})@@ -491,7 +501,7 @@ describe('requests must name this server', () => {expect(await res.json()).toEqual({ sessions: [{ id: 'a', updatedAt: 42 }] })})- it('still serves loopback names, and the dashboard from its own origin', async () => {+ it('still serves loopback names, and a page from the daemon\'s own origin', async () => {const { base } = await start({ onStatus: () => ({ ok: true }) })const port = new URL(base).portfor (const host of [`127.0.0.1:${port}`, `localhost:${port}`, `[::1]:${port}`]) {@@ -562,7 +572,7 @@ describe('the daemon socket', () => {expect(await viaSocket(socketPath, 'GET', '/api/command-bar/status', { 'x-adapter-local': '1' })).toBe(200)expect(await viaSocket(socketPath, 'GET', '/api/command-bar/status')).toBe(403)// Mutations still need the CSRF header, hooks still need their credential.- expect(await viaSocket(socketPath, 'POST', '/api/stop')).toBe(403)+ expect(await viaSocket(socketPath, 'POST', '/api/group/sync')).toBe(403)expect(await viaSocket(socketPath, 'POST', '/api/hook/session-start')).not.toBe(200)// The TCP port is untouched: a foreign Host is still refused there.const port = (started.server.address() as { port: number }).portdiff --git a/cli/src/hookServer.ts b/cli/src/hookServer.tsindex 68818f0f5..090f055f2 100644--- a/cli/src/hookServer.ts+++ b/cli/src/hookServer.ts@@ -13,7 +13,6 @@ import { hermesSessionSource, isHermesInteractiveSource } from './engines/hermesimport { hermesDbPath, listHermesHomes } from './engines/hermes/home.js'import { isRecentlyDeleted } from './lib/deletedSessions.js'import { registry, type RegisterInput, type RegisteredSession } from './lib/registry.js'-import { LOCAL_WEB_HTML } from './webui.js'import { sid } from './lib/log.js'import { VERSION } from './version.js'import { env } from './config/env.js'@@ -129,12 +128,8 @@ export interface HookServerHandlers {onDevicesHistory?: () => Promise<PairOutcome>/** `harness devices dismiss` and the window's "It's mine" / "Got it" — mark new devices as seen. */onDevicesDismiss?: (body: { pub?: string; pubs?: string[]; baseline?: boolean }) => PairOutcome | Promise<PairOutcome>- /** Local dashboard status snapshot (GET /api/status). */+ /** The daemon's status (GET /api/status): what `harness status`, the desktop's discovery and scripts read. */onStatus?: () => Record<string, unknown> | Promise<Record<string, unknown>>- /** Recent adapter log tail (GET /api/logs). */- onLogs?: () => string- /** Stop the adapter from the local dashboard (POST /api/stop). */- onStop?: () => void/** GET /api/machines — proxy the user's full machine list from backend using this daemon's own* saved SSO session, so a local GUI client never needs a token of its own. */onMachinesList?: () => Promise<PairOutcome>@@ -436,9 +431,9 @@ export function startHookServer(}}// CSRF guard for mutating endpoints: a cross-origin browser page cannot set a custom header on a- // simple request (it forces a CORS preflight we never allow), so only our same-origin dashboard- // (and the CLI, which sends it too) can trigger actions. A local process could still call it —- // same trust level as the CLI, which is acceptable on loopback.+ // simple request (it forces a CORS preflight we never allow), so only the CLI and the apps, which+ // send it, can trigger actions. A local process could still call it — same trust level as the+ // CLI, which is acceptable on loopback.const localOk = req.headers['x-adapter-local'] === '1'const hookOk = hookCredentialMatches(hookCredential, req.headers['x-harness-hook-token'])@@ -463,20 +458,13 @@ export function startHookServer(if (await handleCommandBarHttp(req, res, handlers.onCommandBar)) return- // Local dashboard (self-contained page) + its read-only status/logs.- if (req.method === 'GET' && (url === '/' || url === '/index.html')) {- res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' }); res.end(LOCAL_WEB_HTML); return- }+ // The local web dashboard that `GET /` served, with its log tail (`/api/logs`) and stop button+ // (`/api/stop`), is gone: no app, website, script or the backend opened it, and the web client+ // it linked from retired with the browser setup links (#348). `harness stop` stops the daemon+ // through its pid, never through here.if (req.method === 'GET' && url === '/api/status') {json(200, handlers.onStatus ? await handlers.onStatus() : { supported: false }); return}- if (req.method === 'GET' && url === '/api/logs') {- res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); res.end(handlers.onLogs ? handlers.onLogs() : ''); return- }- if (req.method === 'POST' && url === '/api/stop') {- if (!localOk) { json(403, { error: 'FORBIDDEN' }); return }- json(200, { ok: true }); handlers.onStop?.(); return- }// SessionStart AND UserPromptSubmit both POST here (the catch hook re-registers so a session// whose SessionStart the adapter missed still shows up on its first prompt).diff --git a/cli/src/lib/e2ee/manager.ts b/cli/src/lib/e2ee/manager.tsindex 2c964168a..af2735dc1 100644--- a/cli/src/lib/e2ee/manager.ts+++ b/cli/src/lib/e2ee/manager.ts@@ -166,10 +166,6 @@ export class E2eeManager {private helloWaits = new Map<string, number>()private helloSeq = 0private now: () => number- /** Local dashboard port (loopback) — surfaced to the web in e2e_status so it can link there to- * approve pairing. Not sensitive (a localhost port); set by the adapter after the hook server binds. */- dashboardPort: number | null = null-constructor(private deps: E2eeManagerDeps, now: () => number = () => Date.now()) {this.store.init()this.groupKey = crypto32()@@ -223,7 +219,7 @@ export class E2eeManager {}}- /** A browser currently waiting to pair (for the local dashboard), or null. `active` = CPace running. */+ /** A browser currently waiting to pair (for `/api/status`), or null. `active` = CPace running. */pendingConnection(): string | null { return this.slot?.connId ?? null }pendingPair(): PendingPairInfo | null {if (!this.slot) return null@@ -495,7 +491,6 @@ export class E2eeManager {enabled: true, // mandatory: user events are always group-encryptedpaired: identityPub ? this.store.isPaired(identityPub) : false,fingerprint: this.fingerprint(),- dashboardPort: this.dashboardPort, // so the web can link to the local dashboard to approve},})return truediff --git a/cli/src/lib/localSocket.ts b/cli/src/lib/localSocket.tsindex 6512635d4..b19c0db20 100644--- a/cli/src/lib/localSocket.ts+++ b/cli/src/lib/localSocket.ts@@ -7,7 +7,7 @@* user's processes can connect. A request that arrives over it is from this user, and needs none of* the address checks a TCP request does — its peer has no address at all.*- * TCP stays: the CLI, engine hooks and the dashboard (a browser cannot reach a socket file) still use+ * TCP stays: the CLI, engine hooks and scripts still use* it, as do app builds that predate this. Windows has no socket here; there everything is TCP.*/import { randomBytes } from 'node:crypto'diff --git a/cli/src/lib/loopbackRequest.spec.ts b/cli/src/lib/loopbackRequest.spec.tsindex 5b6048641..1f7424dbd 100644--- a/cli/src/lib/loopbackRequest.spec.ts+++ b/cli/src/lib/loopbackRequest.spec.ts@@ -6,7 +6,7 @@ const hosts = loopbackHosts(18473)const req = (headers: Record<string, string>) => ({ headers } as unknown as IncomingMessage)describe('isLoopbackRequest', () => {- it('serves the names every native caller and the dashboard use, on the bound port only', () => {+ it('serves the names every native caller uses, on the bound port only', () => {for (const host of ['127.0.0.1:18473', 'localhost:18473', '[::1]:18473', 'LOCALHOST:18473']) {expect(isLoopbackRequest(req({ host }), hosts)).toBe(true)}diff --git a/cli/src/lib/loopbackRequest.ts b/cli/src/lib/loopbackRequest.tsindex 51447b20b..0b33ab7a0 100644--- a/cli/src/lib/loopbackRequest.ts+++ b/cli/src/lib/loopbackRequest.ts@@ -7,7 +7,7 @@* served only when Host names this server, and a browser request only when its Origin is that name too.** Every native caller (the desktop app, the CLI, engine hooks, store agents) sends a loopback Host and- * no Origin; the dashboard sends its own loopback origin. Nothing legitimate is refused.+ * no Origin; a page the daemon served would send its own loopback origin. Nothing legitimate is refused.*/import type { IncomingMessage } from 'http'diff --git a/cli/src/lib/registry.ts b/cli/src/lib/registry.tsindex de2eb9698..2abcd9aa4 100644--- a/cli/src/lib/registry.ts+++ b/cli/src/lib/registry.ts@@ -2027,8 +2027,8 @@ class Registry {* the caller — a phone and a laptop whose clocks disagree would otherwise order the same agents* differently, which is the one thing this field exists to prevent.*- * `updatedAt` is left alone on purpose. That is the row's bookkeeping (the webui's "when" column,- * `session_get`'s timestamp), and looking at an agent changes nothing about the agent. The save+ * `updatedAt` is left alone on purpose. That is the row's bookkeeping (`session_get`'s timestamp),+ * and looking at an agent changes nothing about the agent. The save* still happens: a row is written whenever its bytes differ from the last write, whichever field* moved.*/diff --git a/cli/src/webui.ts b/cli/src/webui.tsdeleted file mode 100644index 3669d8b1c..000000000--- a/cli/src/webui.ts+++ /dev/null@@ -1,268 +0,0 @@-/**- * Self-contained local dashboard for the machine-adapter, served by the hook server on- * 127.0.0.1:<port>. Vanilla HTML/CSS/JS (no framework, no build) — polls GET /api/status and drives- * the loopback management API (approve pairing, unpair, stop). Scoped to LOCAL-only concerns (adapter- * health, machine fingerprint, local pairings); it never renders chat/transcripts — that's the cloud- * web (WEB_URL/machine/<agentId>).- *- * CSRF: mutating calls send the `x-adapter-local: 1` header, which a cross-origin page cannot set on a- * simple request (a custom header forces a CORS preflight the server never allows) — so only this- * same-origin page (and the CLI) can trigger actions.- */-export const LOCAL_WEB_HTML = /* html */ `<!doctype html>-<html lang="en">-<head>-<meta charset="utf-8" />-<meta name="viewport" content="width=device-width, initial-scale=1" />-<title>harness</title>-<style>- :root { color-scheme: dark; --bg:#0e1116; --card:#161b22; --line:#232a34; --fg:#e6edf3; --mut:#8b949e; --faint:#6e7681; --grn:#3fb950; --red:#e5534b; --yel:#d29922; --acc:#4c8bf5; --mono: ui-monospace, SFMono-Regular, Menlo, monospace; }- * { box-sizing: border-box; }- body { margin:0; background:var(--bg); color:var(--fg); font:14px/1.5 -apple-system, system-ui, sans-serif; }- a { color:var(--acc); text-decoration:none; } a:hover { text-decoration:underline; }- .wrap { max-width:960px; margin:0 auto; padding:20px 16px 48px; }- .bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px 16px; }- .brand { font-weight:600; }- .dot { width:9px; height:9px; border-radius:50%; display:inline-block; vertical-align:middle; }- .on { background:var(--grn); } .off { background:var(--red); } .idle { background:var(--faint); }- .mut { color:var(--mut); } .mono { font-family:var(--mono); }- .fp { font-family:var(--mono); letter-spacing:.04em; }- .pill { display:inline-block; border:1px solid var(--line); border-radius:999px; padding:1px 7px; font-size:11px; color:var(--mut); margin-right:6px; text-transform:uppercase; }- .spacer { flex:1; }- .btn { background:none; border:1px solid var(--line); color:var(--fg); border-radius:8px; padding:5px 12px; font-size:12.5px; cursor:pointer; }- .btn:hover { border-color:var(--acc); }- .btn.danger:hover { border-color:var(--red); color:var(--red); }- .btn.primary { background:var(--acc); border-color:var(--acc); color:#fff; font-weight:600; }- .btn.primary:hover { filter:brightness(1.08); }- .btn:disabled { opacity:.6; cursor:default; }- /* approve modal */- .modal { position:fixed; inset:0; background:rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; z-index:50; padding:16px; }- .modalCard { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:22px 22px 18px; max-width:440px; width:100%; box-shadow:0 12px 40px rgba(0,0,0,.5); }- .mTitle { font-size:17px; font-weight:600; }- .mSub { color:var(--mut); font-size:13px; margin-top:8px; line-height:1.5; }- .mCodeLabel { font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--faint); margin-top:16px; }- .mCode { font-family:var(--mono); font-size:30px; letter-spacing:.22em; font-weight:700; margin-top:4px; }- .mNote { font-size:12px; color:var(--mut); margin-top:6px; }- .mInput { font-family:var(--mono); background:var(--bg); border:1px solid var(--line); color:var(--fg); border-radius:8px; padding:8px 12px; letter-spacing:.2em; text-transform:uppercase; width:150px; margin-top:6px; }- .mFp { font-size:12px; color:var(--mut); margin-top:16px; }- .mBtns { display:flex; justify-content:flex-end; gap:10px; margin-top:20px; }- .grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:16px; }- @media (max-width:720px){ .grid { grid-template-columns:1fr; } }- .card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px 16px; }- .card h2 { margin:0 0 10px; font-size:13px; font-weight:600; color:var(--mut); text-transform:uppercase; letter-spacing:.05em; }- .row { display:flex; align-items:center; gap:10px; padding:8px 0; border-top:1px solid var(--line); }- .row:first-of-type { border-top:0; }- .row .main { flex:1; min-width:0; }- .row .name { font-weight:500; }- .row .sub { color:var(--faint); font-size:12px; font-family:var(--mono); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }- .empty { color:var(--faint); padding:8px 0; }- .pending { margin-top:16px; background:#20160a; border:1px solid #4a3a12; border-radius:12px; padding:14px 16px; }- .pending input { font-family:var(--mono); background:var(--bg); border:1px solid var(--line); color:var(--fg); border-radius:8px; padding:6px 10px; letter-spacing:.2em; text-transform:uppercase; width:120px; }- .about { margin-top:16px; }- .statusGrid { display:grid; grid-template-columns:1fr 1fr; gap:8px 18px; }- @media (max-width:520px){ .statusGrid { grid-template-columns:1fr; } }- .metric { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:7px 0; border-top:1px solid var(--line); }- .metric:first-child, .metric:nth-child(2) { border-top:0; }- @media (max-width:520px){ .metric:nth-child(2) { border-top:1px solid var(--line); } }- .metric .k { color:var(--mut); }- .metric .v { font-weight:600; white-space:nowrap; }- .actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }- .adv { margin-top:12px; border-top:1px solid var(--line); padding-top:10px; }- .adv summary { cursor:pointer; color:var(--mut); font-size:12.5px; }- .adv .kv { display:flex; gap:8px; padding:3px 0; font-size:12.5px; }- .adv .k { color:var(--faint); width:110px; flex:none; }- .adv .v { font-family:var(--mono); overflow:hidden; text-overflow:ellipsis; }- .toast { position:fixed; bottom:16px; left:50%; transform:translateX(-50%); background:var(--card); border:1px solid var(--line); border-radius:10px; padding:10px 16px; opacity:0; transition:opacity .2s; }- .toast.show { opacity:1; }- pre.logs { max-height:220px; overflow:auto; background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:10px; font-size:11.5px; color:var(--mut); margin:0; }-</style>-</head>-<body>-<div class="wrap">- <div class="bar">- <span class="brand">harness</span>- <span id="conn"><span class="dot idle"></span> <span class="mut">connecting…</span></span>- <span id="device"><span class="dot idle"></span> <span class="mut">device —</span></span>- <span class="mut">machine <span id="agent" class="mono">—</span></span>- <span class="mut" id="agents">no agents</span>- <span class="mut">up <span id="uptime">—</span></span>- <span class="spacer"></span>- <button class="btn danger" onclick="stopAdapter()">Stop</button>- </div>- <div class="bar" style="margin-top:10px;">- <span class="mut">machine fingerprint</span> <span id="fp" class="fp">—</span>- </div>-- <div id="pending"></div>-- <div class="grid">- <div class="card">- <h2>Sessions (tmux claude)</h2>- <div id="sessions"><div class="empty">loading…</div></div>- </div>- <div class="card">- <h2>Paired browsers <button class="btn danger" style="float:right;font-size:11px;padding:2px 8px" onclick="unpairAll()">Unpair all</button></h2>- <div id="pairs"><div class="empty">loading…</div></div>- </div>- </div>-- <div class="card about">- <h2>Machine</h2>- <div id="about"></div>- <details id="logsBox" style="margin-top:10px"><summary class="mut" style="cursor:pointer">Logs</summary>- <pre class="logs" id="logs">—</pre>- </details>- </div>-</div>-<div class="toast" id="toast"></div>--<script>-const H = { 'x-adapter-local': '1' };-let pendKey = null; // identity of the pending shown — so polling doesn't clobber the modal/input-let dismissedKey = null; // pending fully handled (approved) — don't rebuild until it changes-let modalClosed = false; // user hit Close on the approve modal → behave like no ?code (normal UI) this session-let lastStatus = null; // last /api/status snapshot (for closeModal to re-render inline immediately)-// Code from the "Open dashboard & approve" link on the web (?code=…). It travels via the URL the user-// clicks in their own browser (loopback), never through the backend — so CPace security is preserved.-const params = new URLSearchParams(location.search);-const urlCode = (params.get('code') || '').toUpperCase();-function esc(s){ return String(s==null?'':s).replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); }-function toast(m){ const t=document.getElementById('toast'); t.textContent=m; t.classList.add('show'); clearTimeout(t._h); t._h=setTimeout(()=>t.classList.remove('show'),1800); }-function fmtDur(s){ s=Math.max(0,s|0); const d=s/86400|0,h=s%86400/3600|0,m=s%3600/60|0; return d?d+'d '+h+'h':h?h+'h '+m+'m':m?m+'m':s+'s'; }-function fmtWhen(ts){ try{ return new Date(ts).toISOString().slice(0,16).replace('T',' ') }catch{ return '' } }--async function post(path, body){- const r = await fetch(path, { method:'POST', headers:{...H, ...(body?{'content-type':'application/json'}:{})}, body: body?JSON.stringify(body):undefined });- const j = await r.json().catch(()=>({})); return { ok:r.ok, status:r.status, j };-}-// Strip ?code=… from the address bar (no reload) once the pairing is handled — so a refresh doesn't-// re-open the modal with a stale/consumed code, and the code doesn't linger in history.-function clearUrlCode(){ try { history.replaceState(null, '', location.pathname); } catch(e) {} }--async function doApprove(){- const el = document.getElementById('code');- const code = (urlCode || (el ? el.value.trim().toUpperCase() : '')).trim();- if(!code){ toast('Enter the pairing code'); return; }- clearUrlCode();- const btn = document.getElementById('approveBtn'); if(btn){ btn.disabled = true; btn.textContent = 'Approving…'; }- const { ok, j } = await post('/api/pair', { code });- if (ok){ toast('✓ Paired '+(j.fingerprint||'')); dismissedKey = pendKey; document.getElementById('pending').innerHTML = ''; }- else { toast('✗ '+(j.error||'failed')); if(btn){ btn.disabled = false; btn.textContent = 'Approve'; } }- refresh();-}-// Close = don't approve now → drop back to the normal page (same as opening without ?code): show the-// subtle inline banner instead of the blocking modal, for the rest of this session.-function closeModal(){ modalClosed = true; clearUrlCode(); pendKey = null; if (lastStatus) render(lastStatus); else document.getElementById('pending').innerHTML = ''; }-function pendingRoleLabel(s){ return s && s.pending && s.pending.role === 'device' ? 'device' : 'browser'; }-// Inline (non-blocking) banner when the dashboard is opened directly and a client happens to be waiting.-function buildInlinePending(s){- const role = pendingRoleLabel(s);- document.getElementById('pending').innerHTML =- '<div class="pending"><b>🔒 A '+esc(role)+' is waiting to pair</b> — <span class="mut">'+esc(s.pending.label)+'</span>'- + '<div style="margin-top:8px">Enter the code shown on that '+esc(role)+': '- + '<input id="code" maxlength="8" placeholder="ABC123" onkeydown="if(event.key===\\'Enter\\')doApprove()"> '- + '<button class="btn" onclick="doApprove()">Approve</button></div></div>';-}-function buildApproveModal(s){- const p = s.pending;- const role = pendingRoleLabel(s);- const codeBlock = urlCode- ? '<div class="mCodeLabel">verification code</div><div class="mCode">'+esc(urlCode)+'</div><div class="mNote">Make sure this matches the code on your '+esc(role)+' screen.</div>'- : '<div class="mCodeLabel">enter the code shown on your '+esc(role)+'</div><input id="code" class="mInput" maxlength="8" placeholder="ABC123" onkeydown="if(event.key===\\'Enter\\')doApprove()">';- document.getElementById('pending').innerHTML =- '<div class="modal"><div class="modalCard">'- + '<div class="mTitle">🔒 Approve this '+esc(role)+'?</div>'- + '<div class="mSub">A '+esc(role)+' (<b>'+esc(p.label)+'</b>) is asking to pair for end-to-end encryption. Approve only if you started this flow.</div>'- + codeBlock- + '<div class="mFp">this computer · <span class="fp">'+esc(s.fingerprint||'')+'</span></div>'- + '<div class="mBtns"><button class="btn" onclick="closeModal()">Close</button><button id="approveBtn" class="btn primary" onclick="doApprove()">Approve</button></div>'- + '</div></div>';- const el = document.getElementById('code'); if (el) el.focus();-}-async function unpair(id){ const { ok, j } = await post('/api/revoke', { id }); toast(ok?('✓ Unpaired '+(j.fingerprint||'')):('✗ '+(j.error||'failed'))); refresh(); }-async function unpairAll(){ if(!confirm('Unpair every browser?')) return; const { j } = await post('/api/revoke-all'); toast('✓ Unpaired '+(j.count||0)); refresh(); }-async function stopAdapter(){ if(!confirm('Stop the adapter?')) return; await post('/api/stop'); toast('Stopping…'); }-function isDevicePair(p){- return !!p && (p.role === 'device' || String(p.label || '').toLowerCase() === 'device');-}--function render(s){- lastStatus = s;- const c = document.getElementById('conn');- c.innerHTML = '<span class="dot '+(s.connected?'on':'off')+'"></span> <span class="mut">'+(s.connected?'cloud connected':'cloud reconnecting…')+'</span>';- const d = document.getElementById('device');- const deviceOnline = !!s.deviceE2eeConnected || !!((s.pairs||[]).find(p => isDevicePair(p) && p.online));- const deviceTransport = !!s.deviceTransportConnected;- d.innerHTML = '<span class="dot '+(deviceOnline?'on':deviceTransport?'idle':'off')+'"></span> <span class="mut">device '+(deviceOnline?'connected':deviceTransport?'pairing':'offline')+'</span>';- document.getElementById('agent').textContent = (s.agentId||'').slice(0,8) || '—';- const nAgents = (s.sessions||[]).length;- document.getElementById('agents').textContent = s.discoveryReady === false- ? 'discovering terminal agents…'- : nAgents === 0 ? 'no agents' : nAgents + (nAgents === 1 ? ' agent' : ' agents');- document.getElementById('uptime').textContent = fmtDur(s.uptimeSec);- document.getElementById('fp').textContent = s.fingerprint || '—';-- // sessions- const se = document.getElementById('sessions');- se.innerHTML = s.discoveryReady === false- ? '<div class="empty">Discovering terminal agents…</div>'- : (s.sessions&&s.sessions.length) ? s.sessions.map(x =>- '<div class="row"><div class="main"><div class="name">'+esc(x.name)+'</div><div class="sub">'+esc(x.cwd||'')+' · '+esc((x.terminal&&x.terminal.primary)||x.tmuxPane||'')+'</div></div><div class="mut" style="font-size:12px">'+fmtWhen(x.updatedAt)+'</div></div>'- ).join('') : '<div class="empty">'+(s.discoveryError ? esc('Terminal discovery unavailable: '+s.discoveryError) : 'No terminal agents.')+'</div>';-- // pairs- const pe = document.getElementById('pairs');- pe.innerHTML = (s.pairs&&s.pairs.length) ? s.pairs.map(p => {- const role = isDevicePair(p) ? 'device' : (p.role || 'web');- return '<div class="row"><span class="dot '+(p.online?'on':'idle')+'"></span><div class="main"><div class="name fp">'+esc(p.fingerprint)+'</div><div class="sub"><span class="pill">'+esc(role)+'</span>'+esc(p.label)+' · paired '+fmtWhen(p.pairedAt)+'</div></div><button class="btn danger" onclick="unpair(\\''+esc(p.fingerprint)+'\\')">Unpair</button></div>';- }).join('') : '<div class="empty">No clients paired.</div>';-- // pending — rebuild ONLY when it actually changes (new/rotated pairing), else leave the code input- // and whatever the user typed/pasted intact (polling every 2.5s must not wipe the field).- // Pending pairing → a MODAL popup. Built once per pending (guarded by pendKey) so polling every 2.5s- // doesn't clobber it. If the web link supplied ?code=…, it's pre-filled and the user just clicks- // Approve — nothing to type. Otherwise a code input is shown as a fallback.- const pd = document.getElementById('pending');- if (s.pending) {- const key = s.pending.expiresAt + '|' + s.pending.label;- if (key !== pendKey) {- pendKey = key;- // A blocking modal ONLY when arrived via the web "Approve" link (?code=…) and not yet closed;- // opening directly (or after Close) shows a subtle inline banner instead (normal UI, no overlay).- if (dismissedKey !== key) { if (urlCode && !modalClosed) buildApproveModal(s); else buildInlinePending(s); }- }- } else if (pendKey !== null) { pd.innerHTML = ''; pendKey = null; dismissedKey = null; }-- // machine summary — keep the default view human-readable; tuck raw paths/ports into Advanced.- const cfg = s.config||{};- const sessionCount = (s.sessions&&s.sessions.length) || 0;- const pairCount = (s.pairs&&s.pairs.length) || 0;- document.getElementById('about').innerHTML =- '<div class="statusGrid">'- + metric('Machine cloud', s.connected ? 'Connected' : 'Reconnecting')- + metric('Claude sessions', sessionCount ? ('Watching '+sessionCount) : 'Waiting')- + metric('Browsers', pairCount ? (pairCount+' paired') : 'None paired')- + metric('Device', deviceOnline ? 'Connected' : deviceTransport ? 'Pairing' : 'Offline')- + '</div>'- + '<div class="actions"><a class="btn" href="#pairs">Clients</a><button class="btn" onclick="document.getElementById(\\'logsBox\\').open=true;document.getElementById(\\'logsBox\\').scrollIntoView({behavior:\\'smooth\\',block:\\'nearest\\'});">View logs</button></div>'- + '<details class="adv"><summary>Advanced</summary>'- + kv('Backend URL', s.backendUrl)- + kv('Watched folder', cfg.watching)- + kv('CLI data', cfg.dataDir)- + kv('Local control', cfg.port)- + '</details>';-}-function metric(k,v){ return '<div class="metric"><span class="k">'+esc(k)+'</span><span class="v">'+esc(v||'')+'</span></div>'; }-function kv(k,v){ return '<div class="kv"><span class="k">'+esc(k)+'</span><span class="v">'+esc(v||'')+'</span></div>'; }--async function refresh(){- try {- const s = await (await fetch('/api/status')).json();- render(s);- fetch('/api/logs').then(r=>r.ok?r.text():'').then(t=>{ if(t) document.getElementById('logs').textContent = t; }).catch(()=>{});- } catch { document.getElementById('conn').innerHTML = '<span class="dot off"></span> <span class="mut">cloud unreachable</span>'; }-}-refresh(); setInterval(refresh, 2500);-</script>-</body>-</html>`diff --git a/desktop/scripts/test-terminal-prod-e2e.sh b/desktop/scripts/test-terminal-prod-e2e.shindex 76ceb46e4..0aae69e71 100755--- a/desktop/scripts/test-terminal-prod-e2e.sh+++ b/desktop/scripts/test-terminal-prod-e2e.sh@@ -151,8 +151,9 @@ if [[ "$harness_status" != *"$E2E_MACHINE_NAME"* ]]; thenecho "REFUSED: joined machine does not match E2E_MACHINE_NAME" >&2exit 65fi-dashboard_url="$(printf '%s\n' "$harness_status" | sed -nE 's/^[[:space:]]*dashboard[[:space:]]+(http[^[:space:]]+).*$/\1/p' | head -1)"-[[ -n "$dashboard_url" ]] || { echo "REFUSED: Harness status did not expose its local dashboard" >&2; exit 65; }+# The daemon's loopback API: `local api` since the web dashboard went, `dashboard` before.+dashboard_url="$(printf '%s\n' "$harness_status" | sed -nE 's/^[[:space:]]*(local api|dashboard)[[:space:]]+(http[^[:space:]]+).*$/\2/p' | head -1)"+[[ -n "$dashboard_url" ]] || { echo "REFUSED: Harness status did not expose its local API" >&2; exit 65; }mkdir -p "$RUN_ROOT/bin" "$RUN_ROOT/work-a" "$RUN_ROOT/work-b"ln -s "$AUTONOMOUS_CODE_ROOT/scripts/fixtures/terminal-e2e-agent.mjs" "$RUN_ROOT/bin/codex"diff --git a/docs/autonomous-device-integration.md b/docs/autonomous-device-integration.mdindex 15f93ba0d..a61ed8a46 100644--- a/docs/autonomous-device-integration.md+++ b/docs/autonomous-device-integration.md@@ -83,7 +83,7 @@ this request remains `offline`, rather than being treated as a revoke, so transinot unpair the device.Revoke is bidirectional. When the app removes the device (`harness unpair`, `harness unpair --all`,-`harness autonomous-device revoke`, or the dashboard) while the device's direct session is open, the+or `harness autonomous-device revoke`) while the device's direct session is open, theCLI seals `{type:"pair.revoke",machineId:<this computer's machineId>}` as an `autonomous_device_event`over that same E2EE session, then closes the socket gracefully and deletes local trust. It isbest-effort: a send failure never blocks local removal. A device that is offline at that momentdiff --git a/docs/cli.md b/docs/cli.mdindex 185569c17..33952c9c1 100644--- a/docs/cli.md+++ b/docs/cli.md@@ -31,8 +31,9 @@ works the same on a headless Linux server; the app is not required on a machine,Interactive prompts read one line from stdin with `--stdin`; `--json` switches any of them to NDJSON.-The daemon also serves a loopback dashboard at `http://127.0.0.1:18473`: health, this machine's-fingerprint, paired clients, stop. It never renders a transcript. Configuration is environment+The daemon answers on loopback at `http://127.0.0.1:18473` (`harness status` prints it as `local api`):+`/api/status` gives its health, this machine's fingerprint and its paired clients. It serves no web+page and never a transcript. Configuration is environmentvariables (`BACKEND_WS_URL`, `WEB_URL`, `ADAPTER_DATA_DIR`, `ADAPTER_COMPUTER_ID`, `PORT`, and theper-engine home directories); [`cli/README.md`](cli/README.md) has the full table and the`.env.example`.