Skip to main content

TerminalApi

interface

Top-level terminal catalog, borrowing, and ownership capability.

interface TerminalApi

Import

import { TerminalApi } from '@modular/sdk';

Members6

agents
TerminalAgentApi

Provider-native Claude and Codex sessions running in integrated terminals.

snapshot
ReadonlySignal<TerminalCatalogSnapshot>

Atomic live catalog of every integrated terminal and the active terminal.

borrow
(id: string & $brand<'TerminalId'>, request: { authority: 'observe' }) => Promise<TerminalError | TerminalReference> | (id: string & $brand<'TerminalId'>, request: { authority: 'control' }) => Promise<TerminalError | ControlledTerminal>

Borrow an existing terminal without taking ownership.

create
(options?: TerminalCreateOptions) => Promise<TerminalError | OwnedTerminal>

Create a new terminal owned by the current mod.

findOwned
(key: string) => OwnedTerminal | null

Return the open mod-owned terminal at `key` without creating one.

getOrCreate
(key: string, options?: TerminalCreateOptions) => Promise<TerminalError | OwnedTerminal>

Reuse the mod-owned terminal at `key`, or create it once.