import { type TranslationBundle } from '@jupyterlab/translation'; import { LabIcon, ReactWidget } from '@jupyterlab/ui-components'; import * as React from 'react'; import { SessionRegistry } from './model'; /** * Left-sidebar panel listing every running terminal session. It is the * sidebar counterpart of the launcher's terminal tiles: where the * launcher *starts* sessions, this panel surfaces the ones already * running so the user can jump back to a backgrounded agent — including * sessions whose tab has been closed but which are still alive on the * server. Each row is labelled with the session's title and, for a session * running a coding agent, a smaller line below it showing the agent's latest * line of output (from {@link SessionRegistry.activityFor}). * * Backed by {@link SessionRegistry}: a `UseSignal` re-renders the list * whenever the registry emits `stateChanged`, so it tracks * `runningChanged` and the agent-title cache without any local state. * Click behavior (activate vs. reopen, shutdown, new terminal) is * delegated to plugin-supplied callbacks so the widget never imports * `app`. */ export declare class RunningTerminals extends ReactWidget { constructor(options: RunningTerminals.IOptions); dispose(): void; protected render(): React.ReactElement; private _registry; private _trans; private _iconForCommand; private _onActivate; private _onShutdown; private _onShutdownAll; private _onCreate; } export declare namespace RunningTerminals { interface IOptions { registry: SessionRegistry; trans?: TranslationBundle; /** * Resolve the running-agent command for a row (from * `registry.agentCommandFor`) to the icon to show before its label — * the agent's logo, or the plain terminal icon. Supplied by the plugin * so the widget never imports the agent list. */ iconForCommand: (command: string | null) => LabIcon; /** * Activate the named session's open tab, or reopen it in a fresh * terminal widget if no tab is currently attached. */ onActivate: (sessionName: string) => void; /** * Shut the named session down on the server. */ onShutdown: (sessionName: string) => void; /** * Shut down every running terminal at once. The plugin is expected to * confirm with the user first, since it tears down all live sessions. */ onShutdownAll: () => void; /** * Activate the "+" button, anchored at the given viewport coordinates * (the bottom-left of the button). The plugin decides what to show * there — a menu of agents plus a plain terminal, or just a new * terminal when no agents are available — so the panel only reports * where the button is and never imports the command/menu machinery. */ onCreate: (anchor: { x: number; y: number; }) => void; } }