From 69586a4da59c024a4816eb6a153fb336c0f73f9a Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Sat, 22 Aug 2026 10:49:39 +0100 Subject: [PATCH] refactor(maestro): rename brokerStreamUrl to attachStreamUrl There is no broker: the SPA opens the daemon's /api/attach/:id directly through the maestro-web proxy. Co-Authored-By: Claude Opus 5 (1M context) --- web/src/attach.ts | 6 +++--- web/src/persistence.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/attach.ts b/web/src/attach.ts index 39c0310..0348740 100644 --- a/web/src/attach.ts +++ b/web/src/attach.ts @@ -5,7 +5,7 @@ import "@xterm/xterm/css/xterm.css"; import type { ClientControl, Uuid } from "./types.js"; /** - * A single live attach: an xterm terminal bound to a daemon-broker WebSocket. + * A single live attach: an xterm terminal bound to the daemon's attach WebSocket. * * The connection is **decoupled from the UI**: it owns a long-lived WS that * keeps streaming PTY output into the terminal buffer whether or not the view @@ -56,7 +56,7 @@ function esc(s: string): string { * reverse-proxies this WebSocket to the co-located daemon's `/api/attach/:id` * endpoint. */ -function brokerStreamUrl(sessionId: Uuid): string { +function attachStreamUrl(sessionId: Uuid): string { const proto = location.protocol === "https:" ? "wss:" : "ws:"; return `${proto}//${location.host}/api/attach/${encodeURIComponent(sessionId)}`; } @@ -264,7 +264,7 @@ export function createAttachConnection( } }; - const ws = new WebSocket(brokerStreamUrl(sessionId)); + const ws = new WebSocket(attachStreamUrl(sessionId)); ws.binaryType = "arraybuffer"; const sendControl = (msg: ClientControl) => { diff --git a/web/src/persistence.ts b/web/src/persistence.ts index d64e181..fb80c37 100644 --- a/web/src/persistence.ts +++ b/web/src/persistence.ts @@ -4,7 +4,7 @@ // anything malformed — a corrupt or stale blob falls back to a single empty tab. // // Sessions that no longer exist when a layout is restored are not pruned here -// (the session list isn't known yet at boot); their panes attach, the broker +// (the session list isn't known yet at boot); their panes attach, the daemon // closes the dead socket, and the pane auto-closes (see ConnectionPool.onClosed). import { freshId, type Layout, type Node, type Tab } from "./layout.js";