relay

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package relay implements optional pane-pool dispatch for the /api/relay endpoint. Wraps two Workshop-shipped bash scripts (pane_pool.sh / relay.sh from ~/.claude/skills/tmux-relay/scripts/) so the WebUI can hand long-running tasks off to a dedicated relay pane.

Disabled by default: when config.relay.{pane_pool_script, relay_script} are both empty, the /api/relay endpoint returns 501 Not Implemented.

Workshop dogfood enables relay by pointing the two paths at the bash scripts under ~/.claude/skills/tmux-relay/scripts/. Public OSS users who don't have those scripts simply leave the config blank.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

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

Dispatcher is the optional relay backend. Returns nil from New() when disabled (paneScript or relayScript empty); callers should fall back to 501 stub.

func New

func New(paneScript, relayScript, signalDir string) (*Dispatcher, error)

New returns nil when relay is disabled (any required path empty). Returns a non-nil error if config points at non-existent scripts — surfacing misconfiguration loudly rather than silently disabling.

func (*Dispatcher) Check

func (d *Dispatcher) Check(signalFile string) (string, error)

Check inspects the signal file. Returns "completed" when present, "running" otherwise. Path validation prevents traversal: the file MUST live in d.signalDir AND start with "relay-webui-".

func (*Dispatcher) CheckHandler

func (d *Dispatcher) CheckHandler() http.HandlerFunc

CheckHandler returns the GET /api/relay/check handler.

func (*Dispatcher) Dispatch

func (d *Dispatcher) Dispatch(ctx context.Context, command string, timeoutSec int) (pane, signalFile string, err error)

Dispatch acquires a pane and starts the relay run in background. Returns immediately; caller polls Check via signal file.

func (*Dispatcher) DispatchHandler

func (d *Dispatcher) DispatchHandler() http.HandlerFunc

Jump to

Keyboard shortcuts

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