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) <noreply@anthropic.com>
This commit is contained in:
Miguel Palhas
2026-08-22 10:49:39 +01:00
co-authored by Claude Opus 5
parent 8ff5046ff3
commit 69586a4da5
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -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) => {
+1 -1
View File
@@ -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";