client

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDaemon

func EnsureDaemon(sockPath, configFile string) (net.Conn, error)

func FetchScreenSnapshot added in v0.2.0

func FetchScreenSnapshot(cfg *config.Config, paths config.Paths, configFile string, sessionID string) *protocol.ScreenSnapshotResponseMsg

func FetchScrollbackPreview

func FetchScrollbackPreview(cfg *config.Config, paths config.Paths, configFile string, sessionID string) string

func RunShellInWorktree

func RunShellInWorktree(worktreePath string) error

RunShellInWorktree spawns an interactive shell with its working directory set to the given worktree path, and GRAITH_WORKTREE exported in the env.

func ShortDuration added in v0.3.0

func ShortDuration(d time.Duration) string

func SortSessions added in v0.5.1

func SortSessions(sessions []protocol.SessionInfo)

func WriteScreenRestore added in v0.2.0

func WriteScreenRestore(snap *protocol.ScreenSnapshotResponseMsg)

Types

type Client

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

func Connect

func Connect(cfg *config.Config, paths config.Paths, configFile string) (*Client, error)

Connect creates a new client, performs the handshake, and reads the handshake response. On failure the connection is closed automatically.

func New

func New(cfg *config.Config, paths config.Paths, configFile string) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Handshake

func (c *Client) Handshake() error

func (*Client) ReadControlResponse

func (c *Client) ReadControlResponse() (protocol.Envelope, error)

func (*Client) ReadFrame

func (c *Client) ReadFrame() (protocol.Frame, error)

func (*Client) RunPassthrough

func (c *Client) RunPassthrough(ctx context.Context, opts PassthroughOpts) PassthroughResult

func (*Client) SendControl

func (c *Client) SendControl(msgType string, payload any) error

func (*Client) SendData

func (c *Client) SendData(data []byte) error

type DashboardModel added in v0.3.0

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

func NewDashboardModel added in v0.3.0

func NewDashboardModel(sessions []protocol.SessionInfo, refresh func() []protocol.SessionInfo) DashboardModel

func (DashboardModel) Init added in v0.3.0

func (m DashboardModel) Init() tea.Cmd

func (DashboardModel) Update added in v0.3.0

func (m DashboardModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (DashboardModel) View added in v0.3.0

func (m DashboardModel) View() tea.View

type DashboardResult added in v0.3.0

type DashboardResult struct {
	Action    string
	SessionID string
}

func RunDashboard added in v0.3.0

func RunDashboard(sessions []protocol.SessionInfo, refresh func() []protocol.SessionInfo) *DashboardResult

type OverlayResult

type OverlayResult struct {
	Action    string
	SessionID string
}

OverlayResult holds the outcome of the overlay interaction.

func RunOverlay

func RunOverlay(sessions []protocol.SessionInfo, currentSessionID string, fetchPreview func(sessionID string) string) *OverlayResult

RunOverlay launches the bubbletea overlay listing sessions grouped by repo. currentSessionID highlights the session the user was just attached to. fetchPreview is called asynchronously to load scrollback for the selected session.

type PassthroughKeys

type PassthroughKeys struct {
	Prefix      byte
	NextSession byte
	PrevSession byte
}

type PassthroughOpts added in v0.3.0

type PassthroughOpts struct {
	Keys      PassthroughKeys
	SessionID string
	Info      *protocol.SessionInfo
	StatusBar *StatusBarCfg
}

type PassthroughResult

type PassthroughResult int
const (
	ResultDetached PassthroughResult = iota
	ResultOverlay
	ResultShell
	ResultQuit
	ResultDisconnected
	ResultRestart
	ResultNextSession
	ResultPrevSession
)

type StatusBarCfg added in v0.3.0

type StatusBarCfg struct {
	Position string
}

Jump to

Keyboard shortcuts

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