{"modulePath":"github.com/castingcode/tuicast","version":"v0.2.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package workbench\n\nPackage workbench records and replays language-neutral terminal workflows.\n\n## Constants\n\n```go\nconst RecordingVersion = \"1\"\n```\nRecordingVersion is the version of the recording format produced by this package.\n\n## Types\n\n```go\ntype AcquireControl func(uint64) (SessionControl, error)\n```\nAcquireControl acquires exclusive control of one driver session.\n\n```go\ntype Manager struct {\n\t// contains filtered or unexported fields\n}\n```\nManager owns active recordings and retained traces.\n\n```go\nfunc New(acquire AcquireControl) (*Manager, error)\n```\nNew creates a Workbench recording manager.\n\n```go\nfunc (m *Manager) AssertText(sessionID uint64, text string, timeout time.Duration) (Recording, error)\n```\nAssertText records the selected current-screen text as a replay wait.\n\n```go\nfunc (m *Manager) Close()\n```\nClose releases every active recording. It is safe to call repeatedly.\n\n```go\nfunc (m *Manager) Press(sessionID uint64, key tuicast.Key, modifiers ...tuicast.KeyModifier) (Recording, error)\n```\nPress sends a key and appends a press step.\n\n```go\nfunc (m *Manager) Recording(sessionID uint64) (Recording, bool, error)\n```\nRecording returns the current or most recently stopped trace.\n\n```go\nfunc (m *Manager) Replay(ctx context.Context, sessionID uint64, parameters map[string]string) error\n```\nReplay replays the retained trace using values for parameterized type steps.\n\n```go\nfunc (m *Manager) Start(session Session) (Recording, error)\n```\nStart starts a new recording and acquires exclusive session control.\n\n```go\nfunc (m *Manager) Stop(sessionID uint64) (Recording, error)\n```\nStop stops recording, releases the session, and retains the trace.\n\n```go\nfunc (m *Manager) Type(sessionID uint64, text, parameter string) (Recording, error)\n```\nType sends text and appends a type step. parameter records a placeholder instead of the supplied value so secrets do not enter the trace.\n\n```go\ntype Recording struct {\n\tVersion string  `json:\"version\"`\n\tSession Session `json:\"session\"`\n\tSteps   []Step  `json:\"steps\"`\n}\n```\nRecording is a versioned, language-neutral terminal workflow.\n\n```go\ntype Session struct {\n\tID       uint64 `json:\"id\"`\n\tTerminal string `json:\"terminal\"`\n\tWidth    int    `json:\"width\"`\n\tHeight   int    `json:\"height\"`\n}\n```\nSession identifies the terminal on which a recording was created.\n\n```go\ntype SessionControl interface {\n\tSend([]byte) error\n\tPress(tuicast.Key, ...tuicast.KeyModifier) error\n\tWaitFor(context.Context, tuicast.ScreenMatcher) (tuicast.Screen, error)\n\tScreen() tuicast.Screen\n\tRelease()\n}\n```\nSessionControl is the exclusive terminal capability consumed by Workbench.\n\n```go\ntype Step struct {\n\tAction              string               `json:\"action\"`\n\tText                string               `json:\"text,omitempty\"`\n\tParameter           string               `json:\"parameter,omitempty\"`\n\tKey                 string               `json:\"key,omitempty\"`\n\tModifiers           []string             `json:\"modifiers,omitempty\"`\n\tMatcher             *tuicast.MatcherSpec `json:\"matcher,omitempty\"`\n\tTimeoutMilliseconds int64                `json:\"timeoutMilliseconds,omitempty\"`\n\tStableMilliseconds  int64                `json:\"stableMilliseconds,omitempty\"`\n\tQuietMilliseconds   int64                `json:\"quietMilliseconds,omitempty\"`\n}\n```\nStep is one recorded terminal operation. Workbench records waitForText, type, and press steps; MCP recordings may also contain wait, waitForIdle, and waitForEnd steps.\n\n```go\nfunc PressStep(key tuicast.Key, modifiers ...tuicast.KeyModifier) Step\n```\nPressStep returns a press step using canonical, de-duplicated modifier names.\n\n```go\nfunc TypeStep(text, parameter string) (Step, error)\n```\nTypeStep returns a type step for text. A non-empty parameter is recorded in place of text so secrets do not enter the trace.\n\n","path":"github.com/castingcode/tuicast/workbench","name":"workbench","synopsis":"Package workbench records and replays language-neutral terminal workflows.","isRedistributable":true}
