Bus UI Terminal

TerminalAdapters normalize terminal events.

Use the adapter layer when the host has event streams or session metadata and needs a stable TerminalSessionView before rendering the session panel.

Public API

TerminalSessionAdapter(input TerminalSessionAdapterInput) (TerminalSessionView, Dispose, error)

BuildAITerminalSessionView(input AITerminalEventAdapterInput) (TerminalSessionView, error)

When to use it

Use TerminalAdapters when terminal data arrives as generic events and the host wants a normalized session view for node-first rendering or diagnostics.

Key names

TerminalSessionAdapterInput, TerminalSessionView, TerminalSessionMetadata, TerminalEvent, TerminalAdapterDiagnostic, and TerminalSessionView.TerminalSessionPanelProps().

Example

Loading TerminalAdapters demo...

Go API

import terminalui "github.com/busdk/bus-ui/pkg/terminalui"

view, _, err := terminalui.TerminalSessionAdapter(terminalui.TerminalSessionAdapterInput{
  Metadata: terminalui.TerminalSessionMetadata{SessionID: "sess_123", Command: "go test ./..."},
  Events: []terminalui.TerminalEvent{
    {Type: terminalui.TerminalEventOpened},
    {Type: terminalui.TerminalEventOutput, Payload: terminalui.TerminalEventPayload{Text: "ok"}},
  },
})

.gx source

In .gx source, author the visible component state as GX markup. Keep the Go API block above for the package helper or render-boundary call.

package busuiexamples

import gx "github.com/busdk/bus-gx/pkg/gx"

func TerminalSessionPanelExample() gx.Node {
  return <section class="terminal-adapters">
  <h2><Text value={"Local shell"}></Text></h2>
  <p><Text value={"Connected"}></Text></p>
</section>
}

Related

Return to Terminal or the Bus UI reference.