engine

package
v0.7.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyToClipboard

func CopyToClipboard(text string) error

CopyToClipboard copies text to the system clipboard.

func CreateSession

func CreateSession(name string) error

CreateSession spawns a new daemon process for the named session.

func DetachSession

func DetachSession(name string) error

DetachSession disconnects all attached clients from the named session.

func DisplayAgentModel

func DisplayAgentModel(kind, model string) string

func DisplayAgentState added in v0.4.2

func DisplayAgentState(state string, updatedAt int64) string

func FetchPreview

func FetchPreview(name string, lines int) string

FetchPreview returns the last `lines` lines of the daemon-rendered preview.

func FetchProcessInfo

func FetchProcessInfo(sessions []Session) map[string]ProcessInfo

FetchProcessInfo returns a map of session name → ProcessInfo. Uses a single `ps` call to read all processes, then walks the tree in memory.

func FormatBytes

func FormatBytes(b uint64) string

FormatBytes formats bytes as a human-readable string (e.g., "12M", "1.2G").

func FormatRelativeTime

func FormatRelativeTime(unixTS int64) string

func FormatUptime

func FormatUptime(secs int) string

FormatUptime formats seconds as a compact human-readable duration.

func KillSession

func KillSession(name string) error

KillSession sends a kill message to the named session via Unix socket.

func PreviewWidth

func PreviewWidth(raw string) int

func RenameSession

func RenameSession(oldName, newName string) error

RenameSession renames a session.

func ScrollPreview

func ScrollPreview(raw string, offsetX, maxWidth int) string

ScrollPreview applies a horizontal offset and width to raw preview text.

Types

type ProcessInfo

type ProcessInfo struct {
	Memory            uint64
	Uptime            int // seconds
	AgentKind         string
	AgentState        string
	AgentSummary      string
	AgentUpdated      int64
	AgentModel        string
	AgentVersion      string
	AgentPrompt       string
	AgentPlan         string
	AgentApproval     string
	AgentSandbox      string
	AgentBranch       string
	AgentGitSHA       string
	AgentGitOrigin    string
	AgentName         string
	AgentRole         string
	AgentMemory       string
	AgentSessionID    string
	AgentSubagent     bool
	AgentInput        int64
	AgentOutput       int64
	AgentCached       int64
	AgentTotal        int64
	AgentContext      int64
	AgentCostUSD      float64
	AgentDurationMS   int64
	AgentAPIMS        int64
	AgentLinesAdded   int64
	AgentLinesRemoved int64
	AgentOutputStyle  string
	AgentProjectDir   string
	AgentWorktreePath string
}

ProcessInfo holds per-session process data fetched asynchronously.

type Session

type Session = session.Session

Session is the session type used throughout the application.

func FetchSessions

func FetchSessions() ([]Session, error)

FetchSessions discovers sessions by probing Unix sockets directly.

Jump to

Keyboard shortcuts

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