From b0e4d8fc4c5a78af4a64444d6a302d9c033cb080 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 24 Apr 2026 15:41:05 +0000 Subject: [PATCH] Clean up OpenShell control UI --- app/api/sandbox/create/route.ts | 9 - app/components/ConfigurationPanel.tsx | 23 +- app/components/SandboxDetails.tsx | 2 +- app/components/SandboxList.tsx | 77 +--- app/components/Sidebar.tsx | 362 +++++------------- app/operator-terminal/page.tsx | 4 +- app/page.tsx | 91 +---- ...aw-dashboard-instance-resolution-check.mjs | 4 +- 8 files changed, 136 insertions(+), 436 deletions(-) diff --git a/app/api/sandbox/create/route.ts b/app/api/sandbox/create/route.ts index e195b8f..58a9694 100644 --- a/app/api/sandbox/create/route.ts +++ b/app/api/sandbox/create/route.ts @@ -20,13 +20,6 @@ const HOST_PATH = [ process.env.PATH || "", ].filter(Boolean).join(":") -const GATEWAY_REUSE_POLICY = [ - "Gateway reuse policy:", - "- reuse the existing OpenShell gateway when `openshell status` reports `Connected`", - "- only start a fresh gateway when no healthy gateway is already connected", - `- force non-interactive PATH to include ${HOME}/.local/bin so openshell resolves during setup`, -].join("\n") - function validateSandboxName(name: string) { if (!name || typeof name !== "string") throw new Error("sandbox name is required") if (name.length > 63) throw new Error("sandbox name too long (max 63 chars)") @@ -99,7 +92,6 @@ async function verifySandboxCreation(sandboxName: string): Promise -

{mode === 'create' ? 'CREATE SANDBOX WORKFLOW' : `${sandboxId} — OPENSHELL POLICY`}

Static / Recreate RequiredDynamic / Apply Live
+
+

+ {mode === 'create' ? 'New Sandbox' : `${sandboxId} — OpenShell Policy`} +

+ +
{loading ?
Loading policy…
:
- {mode === 'create' &&
Create Sandbox

Choose a blueprint-backed workflow or create a custom sandbox, then provide a sandbox name.

Gateway reuse policy: -- reuse the existing OpenShell gateway when `openshell status` reports `Connected` -- only start a fresh gateway when no healthy gateway is already connected -- force non-interactive PATH to include $HOME/.local/bin so openshell resolves during setup
{blueprints.map((bp) => )}
setSandboxName(e.target.value)} placeholder={selectedBlueprint === 'nemoclaw-blueprint' ? 'my-assistant' : 'custom-sandbox'} className="mt-2 w-full rounded-sm border border-[var(--border-subtle)] bg-[var(--background)] px-3 py-2 text-xs font-mono text-[var(--foreground)]" />
{activeBlueprint?.supportsTailscale && }{enableTailscale &&
Tailscale-enabled creation requires NVIDIA_API_KEY in the dashboard process environment.
}
} + {mode === 'create' &&
Create Sandbox

Choose a template and enter a sandbox name.

{blueprints.map((bp) => )}
setSandboxName(e.target.value)} placeholder={selectedBlueprint === 'nemoclaw-blueprint' ? 'my-assistant' : 'custom-sandbox'} className="mt-2 w-full rounded-sm border border-[var(--border-subtle)] bg-[var(--background)] px-3 py-2 text-xs font-mono text-[var(--foreground)]" />
{activeBlueprint?.supportsTailscale && }{enableTailscale &&
Tailscale-enabled creation requires NVIDIA_API_KEY in the dashboard process environment.
}
}
Security Presets

Use a canned profile for new sandboxes or switch an existing sandbox policy baseline on the fly.

{activePreset &&
{activePreset.label}

{activePreset.summary}

}
Filesystem Policy
Static
setPolicy({ ...policy, filesystem_policy: { ...policy.filesystem_policy, read_only: v } })} placeholder="/usr\n/lib\n/etc" /> setPolicy({ ...policy, filesystem_policy: { ...policy.filesystem_policy, read_write: v } })} placeholder="/sandbox\n/tmp" />
Network Policies
Dynamic
-
Policy JSON Preview
{JSON.stringify(assembledPolicy, null, 2)}
{message &&
{message}
}
+ {mode === 'existing' &&
Policy JSON
{JSON.stringify(assembledPolicy, null, 2)}
} + {message &&
{message}
}
} ) diff --git a/app/components/SandboxDetails.tsx b/app/components/SandboxDetails.tsx index 3e5542b..cf6023a 100644 --- a/app/components/SandboxDetails.tsx +++ b/app/components/SandboxDetails.tsx @@ -111,7 +111,7 @@ export default function SandboxDetails({

Running

-

NEMOSHELL

+

OPENSHELL

diff --git a/app/components/SandboxList.tsx b/app/components/SandboxList.tsx index c043aeb..be79026 100644 --- a/app/components/SandboxList.tsx +++ b/app/components/SandboxList.tsx @@ -26,32 +26,8 @@ interface SandboxListProps { } function renderDashboardTruthMessage(data: any) { - const listenerSummary = data.listenerSummary ? `\nListener: ${data.listenerSummary}` : '' - const showUpstreamSummary = !data.reachable || data.degraded || data.truthState !== 'verified' - const upstreamSummary = showUpstreamSummary && (data.upstreamStatus || data.upstreamStatusText) - ? `\nUpstream probe: ${data.upstreamStatus ?? 'no-status'} ${data.upstreamStatusText ?? ''}`.trimEnd() - : '' - const inventorySummary = typeof data.inventoryCount === 'number' - ? `Inventory visibility: ${data.inventoryCount} live sandbox${data.inventoryCount === 1 ? '' : 'es'}.` - : 'Inventory visibility: unknown.' - const mappingSummary = data.sandboxId - ? (data.authority?.usedMappedSandboxInstance - ? `Sandbox ${data.sandboxId} resolved to OpenClaw instance ${data.instanceId} via bridge mapping (fallback-active).` - : `Sandbox ${data.sandboxId} resolved to OpenClaw instance ${data.instanceId}.`) - : `OpenClaw instance: ${data.instanceId}.` - const reachabilitySummary = data.reachable - ? `Dashboard reachability: reachable at ${data.dashboardUrl}.` - : `Dashboard reachability: unreachable at ${data.dashboardUrl}.` - - if (data.degraded) { - return `${inventorySummary} ${mappingSummary} ${reachabilitySummary} Degraded truth: the dashboard is reachable, but live OpenShell inventory is zero, so mapping alone does not prove the sandbox currently exists.${listenerSummary}${upstreamSummary}` - } - - if (data.reachable) { - return `${inventorySummary} ${mappingSummary} ${data.note || reachabilitySummary}`.trim() - } - - return `${inventorySummary} ${mappingSummary} ${data.note || `OpenClaw Dashboard at ${data.dashboardUrl} is currently unreachable from this host.`}${listenerSummary}${upstreamSummary}` + if (data.reachable) return 'OpenClaw dashboard opened in a new tab.' + return 'OpenClaw dashboard is not reachable from this host right now.' } function openDashboardUrl(url: string, openInNewTab: boolean) { @@ -64,7 +40,7 @@ function openDashboardUrl(url: string, openInNewTab: boolean) { export default function SandboxList({ sandboxes, - nemoclaw, + nemoclaw: _nemoclaw, dashboardSessionId, selectedSandboxId, selectedSandbox, @@ -119,51 +95,6 @@ export default function SandboxList({ - {!isDestroyMode && ( -
-
-
-

Inventory Source

-

Live OpenShell gateway inventory

-
-
-

NemoClaw Operator Surface

-

- {nemoclaw?.available ? 'Local registry + services' : 'Unavailable'} -

-
-
-
-
- Inventory visibility: {sandboxes.length} live sandbox{sandboxes.length === 1 ? '' : 'es'} -
-
- Mapping truth: intent only, not proof of sandbox existence -
-
- {sandboxes.length === 0 ? 'Truth state: degraded / unverified' : 'Truth state: verified from live inventory'} -
-
-

- Dashboard session: {dashboardSessionId.slice(0, 8)} -

- {nemoclaw?.defaultSandboxNames?.length ? ( -

- Default sandbox marker: {nemoclaw.defaultSandboxNames.join(', ')} -

- ) : null} - {nemoclaw?.serviceLines?.length ? ( -
- {nemoclaw.serviceLines.slice(0, 4).map((line) => ( -
- {line} -
- ))} -
- ) : null} -
- )} -
{sandboxes.map((sandbox) => ( - -
- - - - - {(isCreateMode || isDestroyMode) && ( - - )} - - -
- - -
-

OpenShell Control

-

v1.0.0

-
- - -
-
-

- {isCreateMode ? 'CREATE SANDBOX' : isDestroyMode ? 'DESTROY SANDBOX' : 'SANDBOXES'} -

-

- {isDestroyMode && 'SELECT A SANDBOX BELOW'} - {!isCreateMode && !isDestroyMode && `${sandboxes.filter(s => s.status === 'running').length} RUNNING / ${sandboxes.length} TOTAL`} -

- {!isCreateMode && !isDestroyMode && ( -
-

Inventory Source

-

Live OpenShell sandboxes

-

NemoClaw Operator

-

- {nemoclaw?.available ? 'Registry/service summary available' : 'No NemoClaw summary detected'} -

-

Dashboard session: {dashboardSessionId.slice(0, 8)}

- {nemoclaw?.defaultSandboxNames?.length ? ( -

- Default: {nemoclaw.defaultSandboxNames.join(', ')} -

- ) : null} - {nemoclaw?.serviceLines?.slice(0, 2).map((line) => ( -

{line}

- ))} -
- )} -
- -
- {isCreateMode ? ( -
- - - -

CONFIGURATION PANEL WILL OPEN BELOW

-
- ) : isDestroyMode ? ( -
- {sandboxes.length === 0 ? ( -
-

NO SANDBOXES TO DESTROY

-
- ) : ( - sandboxes.map((sandbox) => ( - - )) - )} -
- ) : ( -
- - - {sandboxes.map((sandbox) => ( - - ))} -
- )} +
+

OpenShell Control

+

+ {sandboxesRunning} running / {sandboxesTotal} total +

+
- + + + ) } diff --git a/app/operator-terminal/page.tsx b/app/operator-terminal/page.tsx index 59084c6..baa3cf7 100644 --- a/app/operator-terminal/page.tsx +++ b/app/operator-terminal/page.tsx @@ -207,7 +207,7 @@ function OperatorTerminalInner() { socket.addEventListener('open', () => { setTerminalState('connected') - setTerminalStatus(`Live terminal connected for ${liveSession.sandboxId} in dashboard session ${liveSession.dashboardSessionId.slice(0, 8)}.`) + setTerminalStatus(`Live terminal connected for ${liveSession.sandboxId}.`) fitAddonRef.current?.fit() term.focus() socket.send(JSON.stringify({ type: 'resize', cols: term.cols, rows: term.rows })) @@ -274,7 +274,7 @@ function OperatorTerminalInner() {

Operator path

Operator Terminal

{sandboxId ? 'Live operator terminal for the selected sandbox, brokered through the dashboard-owned terminal bridge.' : 'Live operator terminal for host mode, brokered through the dashboard-owned terminal bridge.'}

-

Dashboard session {dashboardSessionId.slice(0, 8)}

+

OpenShell operator terminal

Back to Dashboard diff --git a/app/page.tsx b/app/page.tsx index b3246d9..ff2969b 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -13,15 +13,13 @@ import { export default function Dashboard() { const [theme, setTheme] = useState<'light' | 'dark'>('dark') - const [isSubmenuOpen, setIsSubmenuOpen] = useState(false) - const [hostIP] = useState('192.168.50.173') const [dashboardSession, setDashboardSession] = useState(() => createHydrationSafeDashboardSessionState()) const [isCreateMode, setIsCreateMode] = useState(false) const [isDestroyMode, setIsDestroyMode] = useState(false) - const [activeView, setActiveView] = useState<'overview' | 'settings' | 'sandboxes'>('sandboxes') + const [activeView, setActiveView] = useState<'settings' | 'sandboxes'>('sandboxes') const [deletingSandboxId, setDeletingSandboxId] = useState(null) const [showDeleteConfirm, setShowDeleteConfirm] = useState(false) - const inventoryEnabled = isSubmenuOpen || activeView === 'sandboxes' || isCreateMode || isDestroyMode + const inventoryEnabled = activeView === 'sandboxes' || isCreateMode || isDestroyMode const { sandboxes, nemoclaw, loading, error, refresh } = useSandboxInventory({ enabled: inventoryEnabled, }) @@ -64,7 +62,6 @@ export default function Dashboard() { setIsCreateMode(false) setIsDestroyMode(false) setActiveView('sandboxes') - setIsSubmenuOpen(true) const latest = await refresh() const created = latest.find((sandbox) => sandbox.id === createdSandboxId || sandbox.name === createdSandboxId) setDashboardSession((current) => updateDashboardSessionSelection(current, created?.id ?? createdSandboxId)) @@ -91,47 +88,32 @@ export default function Dashboard() { }`} > { - setIsSubmenuOpen(!isSubmenuOpen) - if (isCreateMode) setIsCreateMode(false) - if (isDestroyMode) setIsDestroyMode(false) - }} + sandboxesRunning={sandboxes.filter((sandbox) => sandbox.status === 'running').length} + sandboxesTotal={sandboxes.length} isCreateMode={isCreateMode} isDestroyMode={isDestroyMode} activeView={activeView} + onSandboxesClick={() => { + setActiveView('sandboxes') + setIsCreateMode(false) + setIsDestroyMode(false) + }} onCreateClick={() => { setActiveView('sandboxes') setIsCreateMode(true) setIsDestroyMode(false) clearSelection() - setIsSubmenuOpen(true) }} onDestroyClick={() => { setActiveView('sandboxes') setIsDestroyMode(true) setIsCreateMode(false) - setIsSubmenuOpen(true) - }} - onOverviewClick={() => { - setActiveView('overview') - setIsCreateMode(false) - setIsDestroyMode(false) - clearSelection() - setIsSubmenuOpen(false) }} onSettingsClick={() => { setActiveView('settings') setIsCreateMode(false) setIsDestroyMode(false) clearSelection() - setIsSubmenuOpen(false) }} onExitMode={() => { setIsCreateMode(false) @@ -141,57 +123,29 @@ export default function Dashboard() { />
-
+
- {activeView === 'overview' ? ( + {activeView === 'settings' ? (

- OVERVIEW + STATUS

-

- Operational summary of the current OpenShell environment and preset posture. -

-

HOST

-

{hostIP}

+

Sandboxes

+

{sandboxes.length}

-

VIEW

-

OVERVIEW

+

Running

+

{sandboxes.filter((sandbox) => sandbox.status === 'running').length}

-

STATUS

-

ONLINE

+

OpenClaw

+

{nemoclaw?.available ? 'available' : 'not detected'}

-
-

Preset Ladder

-
-

Lockdown Mode → minimum writable scope

-

Enterprise Mode → controlled enterprise defaults

-

Medium-Spicy → balanced dev workflow

-

Spicy → broad engineering access, dangerous if misused

-

Ultra-Lobster → maximum lab convenience, highly permissive

-
-
-
- ) : activeView === 'settings' ? ( -
-
-

- SETTINGS -

-

- Global defaults and preset-driven policy controls for this dashboard instance. -

-

- Dashboard session {dashboardSession.dashboardSessionId.slice(0, 8)} -

-
-
) : isCreateMode ? (
@@ -200,7 +154,7 @@ export default function Dashboard() { CREATE SANDBOX

- Start from a named security preset, then refine the OpenShell policy before creating the sandbox. + Choose a blueprint, name the sandbox, and create it.

@@ -230,13 +184,10 @@ export default function Dashboard() {

- NEMOSHELL DASHBOARD + OPENSHELL CONTROL

- Real-time OpenShell sandbox monitoring -

-

- Dashboard session {dashboardSession.dashboardSessionId.slice(0, 8)} + Manage local OpenShell sandboxes and operator access.