refactor: finish companion rename migration

Complete the remaining pi-to-companion rename across companion-os, web, vm-orchestrator, docker, and archived fixtures.

Verification:
- semantic rg sweeps for Pi/piConfig/getPi/.pi runtime references
- npm run check in apps/companion-os (fails in this worktree: biome not found)

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Harivansh Rathi 2026-03-10 07:39:32 -05:00
parent e8fe3d54af
commit 536241053c
303 changed files with 3603 additions and 3602 deletions

View file

@ -59,7 +59,7 @@ export class ProcessTerminal implements Terminal {
private _kittyProtocolActive = false;
private stdinBuffer?: StdinBuffer;
private stdinDataHandler?: (data: string) => void;
private writeLogPath = process.env.PI_TUI_WRITE_LOG || "";
private writeLogPath = process.env.COMPANION_TUI_WRITE_LOG || "";
get kittyProtocolActive(): boolean {
return this._kittyProtocolActive;

View file

@ -227,8 +227,8 @@ export class TUI extends Container {
private hardwareCursorRow = 0; // Actual terminal cursor row (may differ due to IME positioning)
private inputBuffer = ""; // Buffer for parsing terminal responses
private cellSizeQueryPending = false;
private showHardwareCursor = process.env.PI_HARDWARE_CURSOR === "1";
private clearOnShrink = process.env.PI_CLEAR_ON_SHRINK === "1"; // Clear empty rows when content shrinks (default: off)
private showHardwareCursor = process.env.COMPANION_HARDWARE_CURSOR === "1";
private clearOnShrink = process.env.COMPANION_CLEAR_ON_SHRINK === "1"; // Clear empty rows when content shrinks (default: off)
private maxLinesRendered = 0; // Track terminal's working area (max lines ever rendered)
private previousViewportTop = 0; // Track previous viewport top for resize-aware cursor moves
private fullRedrawCount = 0;
@ -1009,10 +1009,10 @@ export class TUI extends Container {
this.previousHeight = height;
};
const debugRedraw = process.env.PI_DEBUG_REDRAW === "1";
const debugRedraw = process.env.COMPANION_DEBUG_REDRAW === "1";
const logRedraw = (reason: string): void => {
if (!debugRedraw) return;
const logPath = path.join(os.homedir(), ".pi", "agent", "pi-debug.log");
const logPath = path.join(os.homedir(), ".companion", "agent", "companion-debug.log");
const msg = `[${new Date().toISOString()}] fullRender: ${reason} (prev=${this.previousLines.length}, new=${newLines.length}, height=${height})\n`;
fs.appendFileSync(logPath, msg);
};
@ -1035,7 +1035,7 @@ export class TUI extends Container {
// Content shrunk below the working area and no overlays - re-render to clear empty rows
// (overlays need the padding, so only do this when no overlays are active)
// Configurable via setClearOnShrink() or PI_CLEAR_ON_SHRINK=0 env var
// Configurable via setClearOnShrink() or COMPANION_CLEAR_ON_SHRINK=0 env var
if (
this.clearOnShrink &&
newLines.length < this.maxLinesRendered &&
@ -1180,9 +1180,9 @@ export class TUI extends Container {
// Log all lines to crash file for debugging
const crashLogPath = path.join(
os.homedir(),
".pi",
".companion",
"agent",
"pi-crash.log",
"companion-crash.log",
);
const crashData = [
`Crash at ${new Date().toISOString()}`,
@ -1233,7 +1233,7 @@ export class TUI extends Container {
buffer += "\x1b[?2026l"; // End synchronized output
if (process.env.PI_TUI_DEBUG === "1") {
if (process.env.COMPANION_TUI_DEBUG === "1") {
const debugDir = "/tmp/tui";
fs.mkdirSync(debugDir, { recursive: true });
const debugPath = path.join(