Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.
TypeScript browser-shellcontrol-planefile-managerhomelabmobile-firstnextjsptyreactself-hostedserver-managementshadcn-uisysadmintailwindcssterminaltypescriptvpsweb-desktopweb-terminal
feat(tui): install the print sink the last change forgot, and migrate the modules that still print (#206)
Abdurrahman Fakhrul9e0a82a4772c
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.mdindex 5a0b8ef8..251f24fb 100644--- a/docs/CHANGELOG.md+++ b/docs/CHANGELOG.md@@ -8,6 +8,8 @@ this is the *what*, and it is what Settings → Account → About shows as “Wh**Added**+- `tui` install the print sink the last change forgot, and migrate the modules that still print+- `tui` a suspended panel really leaves the alternate screen, so an approval is readable (#205)- `tui` mid-turn writes go into the panel, and prompts suspend it instead of fighting it (#204)- `tui` the composer reports its height, so the panel stops guessing how much to reserve (#203)- `tui` one print sink, so command output lands in the panel instead of on top of it (#202)@@ -20,16 +22,10 @@ this is the *what*, and it is what Settings → Account → About shows as “Wh**Fixed**-- `gates` enforce the byte budget against a build of this tree- `tui` the two bugs a real pty found, and the test that found them (#201)- `ci` apply the same parser workaround to the last two mock call sites (#196)- `ci` stop the semgrep scan failing on a generic argument in a test mock (#195)-**Faster**--- `shell` take 26.7 KiB gzip off the eager graph-- `shell` pick one artwork variant instead of letting CSS hide two-**Changed**- `tui` paint the composer through a frame writer instead of appending (#189)diff --git a/scripts/mso-agent-mentions.mjs b/scripts/mso-agent-mentions.mjsindex b6c3ea0a..71398958 100644--- a/scripts/mso-agent-mentions.mjs+++ b/scripts/mso-agent-mentions.mjs@@ -2,6 +2,7 @@ import { api } from "./mso-agent-api.mjs";import { persistSession } from "./mso-agent-session-ui.mjs";import { sectionBlock } from "./mso-agent-layout.mjs";import { safeErrorSummary } from "./mso-agent-errors.mjs";+import { createPrinter } from "./mso-agent-print.mjs";function clean(value) {return String(value || "").trim().replace(/^\[|\]$/g, "").toLocaleLowerCase();@@ -104,7 +105,7 @@ export async function handleLocalAgentMentionInput(session, line, colors) {try {const mention = await dispatchLocalAgentMention(session, line);if (!mention) return false;- console.log(sectionBlock("local", `${colors.c}↳ ${mention.acknowledgement}${colors.reset}`, {+ createPrinter({ session }).print(sectionBlock("local", `${colors.c}↳ ${mention.acknowledgement}${colors.reset}`, {columns: process.stdout.columns, detail: mention.result?.target?.label || parsedTarget(line), colors,}));return true;diff --git a/scripts/mso-agent-screen-loop.mjs b/scripts/mso-agent-screen-loop.mjsindex 2f32b715..2938b85d 100644--- a/scripts/mso-agent-screen-loop.mjs+++ b/scripts/mso-agent-screen-loop.mjs@@ -118,14 +118,11 @@ export function mountScreenLoop({paint();};- // Streaming text goes into the buffer and repaints, so a long answer does not wait for the turn- // to end before it becomes visible.- session.streamSink = {- write(chunk) {- appendStream(viewport, chunk);- paint();- },- };+ // Streaming text goes into the buffer and repaints, so a long answer does not wait for the turn to+ // end before it becomes visible. Command output arrives as whole lines instead of chunks, so it is+ // committed immediately rather than left as a partial line.+ session.streamSink = { write(chunk) { appendStream(viewport, chunk); paint(); } };+ session.printSink = (line) => { appendStream(viewport, `${String(line ?? "")}\n`); commitStream(viewport); paint(); };const onResize = () => {viewport.rows = output.rows || 24;@@ -198,6 +195,7 @@ export function mountScreenLoop({hook.dispose();disableMouse(output);if (session.streamSink) delete session.streamSink;+ if (session.printSink) delete session.printSink;if (session.onComposerRows) delete session.onComposerRows;if (session.screenLoop) delete session.screenLoop;// The panel owns the whole screen, so the inline transcript is repainted once on the way outdiff --git a/scripts/mso-agent-session-ui.mjs b/scripts/mso-agent-session-ui.mjsindex bbdd62f8..6dd1d089 100644--- a/scripts/mso-agent-session-ui.mjs+++ b/scripts/mso-agent-session-ui.mjs@@ -1,6 +1,7 @@import { C } from "./mso-agent-runtime.mjs";import { createCliSession, listCliSessions, loadCliSession, renameCliSession, renameCliSessionName, resumeCliSession, saveCliSession } from "./mso-agent-api.mjs";import { sessionCompletionItems, sessionPromptHistory, visibleSessionRows } from "./mso-agent-sessions.mjs";+import { createPrinter } from "./mso-agent-print.mjs";function autoTitle(history) {const first = history.find((row) => row?.role === "user" && typeof row.text === "string" && row.text.trim());@@ -58,7 +59,7 @@ export async function startNewSession(rl, session, title = "") {if (!loaded || loaded.source !== "cli") throw new Error("could not create a new CLI MSO Agent session");applyNewSessionState(session, loaded, requestedTitle);syncPromptHistory(rl, session);- console.log(`${C.c}new session @${loaded.name} · ${loaded.title || "MSO Agent session"}${C.reset}`);+ createPrinter({ session }).print(`${C.c}new session @${loaded.name} · ${loaded.title || "MSO Agent session"}${C.reset}`);return true;}@@ -77,13 +78,13 @@ export async function resumeInto(rl, session, query) {pendingApproval: null,});syncPromptHistory(rl, session);- console.log(`${C.c}resumed @${loaded.name} · ${loaded.title || "MSO Agent session"}${C.reset} · ${session.history.length} history rows`);+ createPrinter({ session }).print(`${C.c}resumed @${loaded.name} · ${loaded.title || "MSO Agent session"}${C.reset} · ${session.history.length} history rows`);return true;}export async function resumePicker(rl, session) {const rows = visibleSessionRows(await listCliSessions(100));- if (!rows.length) { console.log("No resumable MSO Agent sessions yet."); return false; }+ if (!rows.length) { createPrinter({ session }).print("No resumable MSO Agent sessions yet."); return false; }const answer = await rl.question(`${C.blue}${C.bold}session ›${C.reset} `, {history: false,complete: (value) => sessionCompletionItems(rows, value, Date.now(), session.agentSession?.id),diff --git a/scripts/mso-agent-subagent.mjs b/scripts/mso-agent-subagent.mjsindex e8c9ac27..93e3160c 100644--- a/scripts/mso-agent-subagent.mjs+++ b/scripts/mso-agent-subagent.mjs@@ -1,5 +1,6 @@import { persistSession } from "./mso-agent-session-ui.mjs";import { printSection } from "./mso-agent-layout.mjs";+import { createPrinter } from "./mso-agent-print.mjs";export const SUBAGENT_USAGE = "/spawn [--name <name>] [--scope read|write|exec] [--turns 1-12] <objective>";@@ -35,5 +36,5 @@ export async function runForegroundSubagent({ rl, session, input, executeTool, cstatus: parsed?.status || "completed", text, createdAt: new Date().toISOString(),});await persistSession(session);- console.log(`${colors.c}${colors.bold}[subagent-${name}]${colors.reset} ${text || "completed"}`);+ createPrinter({ session }).print(`${colors.c}${colors.bold}[subagent-${name}]${colors.reset} ${text || "completed"}`);}