Skip to content

agent-interface-tui Specification

Scope

Owns TUI interaction contracts for the Robota SDK. This package contains only type contracts and narrow runtime type guards — no implementation, no classes, no React, no Ink.

It defines the interaction protocol between command handlers (which may run at any layer) and TUI renderers (which live in agent-transport/tui).

Boundaries

  • Contains only type contracts and narrow type guards — no implementation, no UI, no React.
  • Depends on nothing (@robota-sdk/agent-core is not required; TUI contracts are UI-layer only).
  • Implementation rendering lives in agent-transport/src/tui.
  • agent-framework uses these contracts to describe TUI interaction requirements for command modules.

Architecture Overview

agent-interface-tui            ← this package (contracts only)
  ├── ITuiCommandInteraction   ← base: optional onMissingArgs action
  ├── ITuiPickerInteraction    ← requires picker UI (getItems → ITuiPickerItem[])
  ├── ITuiConfirmInteraction   ← requires confirm UI (boolean prompt)
  └── TAnyTuiCommandInteraction ← union of all concrete interaction shapes

agent-transport/tui
  └── useSideEffects           ← renders TAnyTuiCommandInteraction via ITuiCliAdapter

agent-command/*
  └── command descriptors      ← annotate onMissingArgs to trigger interaction

Public API

ExportKindDescription
TOnMissingArgsActiontype'picker' | 'wizard' | 'confirm'
ITuiPickerIteminterfaceItem in a picker list (label, value, description?)
ITuiCommandInteractioninterfaceBase interaction: optional onMissingArgs
ITuiPickerInteractioninterfacePicker variant: getItems() + onMissingArgs: 'picker'
ITuiConfirmInteractioninterfaceConfirm variant: message + onMissingArgs: 'confirm'
TAnyTuiCommandInteractiontypeUnion of all interaction variants
isPickerInteractiontype guardNarrows to ITuiPickerInteraction
isConfirmInteractiontype guardNarrows to ITuiConfirmInteraction

Invariants

  • This package must never gain runtime dependencies.
  • No framework or provider knowledge may enter this package.
  • wizard is defined in the TOnMissingArgsAction union but not yet implemented by a transport.

Released under the MIT License.