protocol

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ChannelControl = byte(0x00)
	ChannelData    = byte(0x01)
	MaxPayload     = 4 * 1024 * 1024
)

Variables

This section is empty.

Functions

func DecodePayload

func DecodePayload(m Envelope, target any) error

func EncodeControl

func EncodeControl(msgType string, payload any) ([]byte, error)

Types

type AttachMsg

type AttachMsg struct {
	SessionID string `json:"session_id"`
}

type ConfirmMsg

type ConfirmMsg struct {
	ConfirmID string `json:"confirm_id"`
	Prompt    string `json:"prompt"`
}

type ConfirmResponseMsg

type ConfirmResponseMsg struct {
	ConfirmID string `json:"confirm_id"`
	Confirmed bool   `json:"confirmed"`
}

type CreateMsg

type CreateMsg struct {
	Name     string `json:"name"`
	Agent    string `json:"agent"`
	RepoPath string `json:"repo_path"`
	Base     string `json:"base,omitempty"`
	Prompt   string `json:"prompt,omitempty"`
	NoRepo   bool   `json:"no_repo,omitempty"`
}

type DeleteMsg

type DeleteMsg struct {
	SessionID string `json:"session_id"`
}

type DetachedMsg

type DetachedMsg struct {
	Reason string `json:"reason"`
}

type Envelope

type Envelope struct {
	Type    string          `json:"type"`
	Payload json.RawMessage `json:"payload,omitempty"`
}

func DecodeControl

func DecodeControl(raw []byte) (Envelope, error)

type ErrorMsg

type ErrorMsg struct {
	Message string `json:"message"`
}

type Frame

type Frame struct {
	Channel byte
	Payload []byte
}

type FrameReader

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

func NewFrameReader

func NewFrameReader(r io.Reader) *FrameReader

func (*FrameReader) ReadFrame

func (fr *FrameReader) ReadFrame() (Frame, error)

type FrameWriter

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

func NewFrameWriter

func NewFrameWriter(w io.Writer) *FrameWriter

func (*FrameWriter) WriteFrame

func (fw *FrameWriter) WriteFrame(channel byte, payload []byte) error

type HandshakeErrMsg

type HandshakeErrMsg struct {
	Reason string `json:"reason"`
}

type HandshakeMsg

type HandshakeMsg struct {
	Version      string    `json:"version"`
	ClientID     string    `json:"client_id"`
	TerminalSize [2]uint16 `json:"terminal_size"`
	Cwd          string    `json:"cwd"`
}

Client -> Daemon

type HandshakeOkMsg

type HandshakeOkMsg struct {
	Version       string `json:"version"`
	DaemonVersion string `json:"daemon_version"`
}

Daemon -> Client

type LogsMsg

type LogsMsg struct {
	SessionID string `json:"session_id"`
	Lines     int    `json:"lines"`
	Follow    bool   `json:"follow"`
}

type MsgAckMsg

type MsgAckMsg struct {
	Stream     string `json:"stream"`
	Subscriber string `json:"subscriber"`
}

type MsgPubMsg

type MsgPubMsg struct {
	Stream     string `json:"stream"`
	Body       string `json:"body"`
	SenderID   string `json:"sender_id,omitempty"`
	SenderName string `json:"sender_name,omitempty"`
	ThreadID   string `json:"thread_id,omitempty"`
	ReplyTo    string `json:"reply_to,omitempty"`
}

type MsgSubMsg

type MsgSubMsg struct {
	Stream     string `json:"stream"`
	Subscriber string `json:"subscriber"`
	OnlyUnread bool   `json:"only_unread"`
	ThreadID   string `json:"thread_id,omitempty"`
	Wait       bool   `json:"wait"`
	Follow     bool   `json:"follow"`
	Ack        bool   `json:"ack"`
}

type MsgTopicsMsg

type MsgTopicsMsg struct {
	Subscriber string `json:"subscriber"`
}

type RenameMsg

type RenameMsg struct {
	SessionID string `json:"session_id"`
	NewName   string `json:"new_name"`
}

type ResizeMsg

type ResizeMsg struct {
	Cols uint16 `json:"cols"`
	Rows uint16 `json:"rows"`
}

type ResumeMsg

type ResumeMsg struct {
	SessionID string `json:"session_id"`
}

type ScreenPreviewMsg added in v0.2.0

type ScreenPreviewMsg struct {
	SessionID string `json:"session_id"`
}

type ScreenPreviewResponseMsg added in v0.2.0

type ScreenPreviewResponseMsg struct {
	SessionID string `json:"session_id"`
	Preview   string `json:"preview"`
}

type ScreenSnapshotMsg added in v0.2.0

type ScreenSnapshotMsg struct {
	SessionID string `json:"session_id"`
}

type ScreenSnapshotResponseMsg added in v0.2.0

type ScreenSnapshotResponseMsg struct {
	SessionID     string `json:"session_id"`
	Frame         string `json:"frame"`
	CursorX       int    `json:"cursor_x"`
	CursorY       int    `json:"cursor_y"`
	CursorVisible bool   `json:"cursor_visible"`
	Cols          int    `json:"cols"`
	Rows          int    `json:"rows"`
}

type ScrollbackMsg

type ScrollbackMsg struct {
	SessionID string `json:"session_id"`
	Lines     int    `json:"lines"`
}

type SearchMsg

type SearchMsg struct {
	SessionID string `json:"session_id"`
	Query     string `json:"query"`
	Direction string `json:"direction"`
}

type SessionInfo

type SessionInfo struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	RepoPath       string `json:"repo_path"`
	RepoName       string `json:"repo_name"`
	WorktreePath   string `json:"worktree_path"`
	Branch         string `json:"branch"`
	Agent          string `json:"agent"`
	AgentSessionID string `json:"agent_session_id,omitempty"`
	Status         string `json:"status"`
	AgentStatus    string `json:"agent_status,omitempty"`
	ExitCode       *int   `json:"exit_code,omitempty"`
	CreatedAt      string `json:"created_at"`
	LastAttachedAt string `json:"last_attached_at,omitempty"`
	Dirty          bool   `json:"dirty,omitempty"`
	UnpushedCount  int    `json:"unpushed_count,omitempty"`
}

type SessionListMsg

type SessionListMsg struct {
	Sessions []SessionInfo `json:"sessions"`
}

type SessionUpdateMsg

type SessionUpdateMsg struct {
	SessionID string `json:"session_id"`
	Status    string `json:"status"`
	ExitCode  *int   `json:"exit_code,omitempty"`
}

type StopMsg

type StopMsg struct {
	SessionID string `json:"session_id"`
}

type TypeMsg

type TypeMsg struct {
	SessionID string `json:"session_id"`
	Input     string `json:"input"`
	NoNewline bool   `json:"no_newline,omitempty"`
}

Jump to

Keyboard shortcuts

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