'use client'; import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'; import { Terminal } from 'lucide-react'; import { Terminal as XTerm } from '@xterm/xterm'; import { FitAddon } from '@xterm/addon-fit'; import '@xterm/xterm/css/xterm.css'; import { resolveAgentShellWsUrl } from '@/lib/agentShellWs'; const SHELL_FONT_PX = 14; const CWD_STORAGE_KEY = 'sb_agent_shell_cwd'; const INTRO_ACK_KEY = 'sb_agent_shell_intro_ack'; type Props = { active: boolean; expanded: boolean; onExpandedChange: (expanded: boolean) => void; }; function readStoredCwd(): string { if (typeof window === 'undefined') return ''; try { return window.localStorage.getItem(CWD_STORAGE_KEY) || ''; } catch { return ''; } } function readIntroAcknowledged(): boolean { if (typeof window === 'undefined') return false; try { return window.localStorage.getItem(INTRO_ACK_KEY) === '1'; } catch { return false; } } function ShellIntro({ onAcknowledge }: { onAcknowledge: () => void }) { return (
Connect your own agent CLIs here — OpenClaw, Codex, Gemini, or whatever you run locally.
The session opens in your Shadowbroker workspace by default. Use it for repo scripts, mesh tools, or any terminal workflow you already rely on.