workbench

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package workbench records and replays language-neutral terminal workflows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcquireControl

type AcquireControl func(uint64) (SessionControl, error)

AcquireControl acquires exclusive control of one driver session.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager owns active recordings and retained traces.

func New

func New(acquire AcquireControl) (*Manager, error)

New creates a Workbench recording manager.

func (*Manager) AssertText

func (m *Manager) AssertText(sessionID uint64, text string, timeout time.Duration) (Recording, error)

AssertText records the selected current-screen text as a replay wait.

func (*Manager) Close

func (m *Manager) Close()

Close releases every active recording. It is safe to call repeatedly.

func (*Manager) Press

func (m *Manager) Press(sessionID uint64, key tuicast.Key, modifiers ...tuicast.KeyModifier) (Recording, error)

Press sends a key and appends a press step.

func (*Manager) Recording

func (m *Manager) Recording(sessionID uint64) (Recording, bool, error)

Recording returns the current or most recently stopped trace.

func (*Manager) Replay

func (m *Manager) Replay(ctx context.Context, sessionID uint64, parameters map[string]string) error

Replay replays the retained trace using values for parameterized type steps.

func (*Manager) Start

func (m *Manager) Start(session Session) (Recording, error)

Start starts a new recording and acquires exclusive session control.

func (*Manager) Stop

func (m *Manager) Stop(sessionID uint64) (Recording, error)

Stop stops recording, releases the session, and retains the trace.

func (*Manager) Type

func (m *Manager) Type(sessionID uint64, text, parameter string) (Recording, error)

Type sends text and appends a type step. parameter records a placeholder instead of the supplied value so secrets do not enter the trace.

type Recording

type Recording struct {
	Version string  `json:"version"`
	Session Session `json:"session"`
	Steps   []Step  `json:"steps"`
}

Recording is a versioned, language-neutral terminal workflow.

type Session

type Session struct {
	ID       uint64 `json:"id"`
	Terminal string `json:"terminal"`
	Width    int    `json:"width"`
	Height   int    `json:"height"`
}

Session identifies the terminal on which a recording was created.

type SessionControl

type SessionControl interface {
	Send([]byte) error
	Press(tuicast.Key, ...tuicast.KeyModifier) error
	WaitFor(context.Context, tuicast.ScreenMatcher) (tuicast.Screen, error)
	Screen() tuicast.Screen
	Release()
}

SessionControl is the exclusive terminal capability consumed by Workbench.

type Step

type Step struct {
	Action              string   `json:"action"`
	Text                string   `json:"text,omitempty"`
	Parameter           string   `json:"parameter,omitempty"`
	Key                 string   `json:"key,omitempty"`
	Modifiers           []string `json:"modifiers,omitempty"`
	TimeoutMilliseconds int64    `json:"timeoutMilliseconds,omitempty"`
}

Step is one replayable Workbench operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL