Documentation
¶
Overview ¶
Package termhost publishes the visible chat lifecycle to terminal hosts. Host adapters are deliberately thin; Manager owns ordering, fanout, coalescing, timeouts, and shutdown.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
Adapter is the small integration boundary implemented by first-party hosts and generic command sinks.
type Control ¶
Control is terminal output that must be returned to Bubble Tea's renderer. RefreshAfter is non-zero while the active OSC protocol needs a keepalive.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager fans each lifecycle event out to independently scheduled adapters. Report never waits for an adapter. Each adapter retains only its latest pending state while its current command is running.
func New ¶
func New(cfg config.LifecycleConfig, legacyProgress bool) (*Manager, error)
New discovers all selected terminal hosts and starts one independent worker per enabled adapter. Multiple detected hosts are active simultaneously.
func (*Manager) Close ¶
func (m *Manager) Close()
Close relinquishes all claimed adapters in parallel. The total wait is one aggregate budget, regardless of adapter count. Close is idempotent.
func (*Manager) Report ¶
Report publishes a normalized snapshot once and returns any renderer-owned OSC output. Calling Report with an unchanged active snapshot is useful for an OSC keepalive; adapters still deduplicate it independently.
func (*Manager) RestoreOSC ¶
RestoreOSC returns a clear sequence when this manager currently owns an OSC indicator. The caller must write it only after Bubble Tea releases renderer ownership (or while performing bounded forced-exit cleanup).
type Status ¶
type Status struct {
Name string `json:"name"`
Type string `json:"type"`
Detected bool `json:"detected"`
Enabled bool `json:"enabled"`
Reason string `json:"reason"`
}
Status describes why an adapter is or is not active. It is safe to expose to users: command arguments and environment values are never included.
type StatusReport ¶
type StatusReport struct {
Enabled bool `json:"enabled"`
Reason string `json:"reason"`
Adapters []Status `json:"adapters"`
OSC Status `json:"osc"`
}
StatusReport is returned by lifecycle status and uses deterministic ordering.
func Inspect ¶
func Inspect(cfg config.LifecycleConfig, legacyProgress bool) (StatusReport, error)
Inspect reports discovery and policy without publishing state or executing a custom command.