engine

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FireWebhook

func FireWebhook(webhookURL, projectName string, payload WebhookPayload)

FireWebhook sends a status change notification to the configured webhook URL. Fire-and-forget: errors are logged but don't block.

Types

type Lifecycle

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

Lifecycle manages the polling loops and state transitions.

func NewLifecycle

func NewLifecycle(sm *SessionManager, cfg *config.Config) *Lifecycle

NewLifecycle creates a new Lifecycle manager.

func (*Lifecycle) Start

func (lc *Lifecycle) Start()

Start begins the polling loops.

func (*Lifecycle) Stop

func (lc *Lifecycle) Stop()

Stop signals the polling loops to stop and waits for them to finish.

type SessionManager

type SessionManager struct {
	Cfg *config.Config
}

SessionManager handles session CRUD operations.

func NewSessionManager

func NewSessionManager(cfg *config.Config) *SessionManager

NewSessionManager creates a new SessionManager.

func (*SessionManager) Cleanup

func (sm *SessionManager) Cleanup(session *core.Session) error

Cleanup destroys the tmux session and worktree, then marks as done.

func (*SessionManager) Get

func (sm *SessionManager) Get(sessionID string) (*core.Session, error)

Get returns a single session by ID, searching across all projects.

func (*SessionManager) Kill

func (sm *SessionManager) Kill(sessionID string) error

Kill terminates a session's tmux process, destroys worktree, and removes metadata.

func (*SessionManager) List

func (sm *SessionManager) List(projectID string) ([]*core.Session, error)

List returns all sessions for a project.

func (*SessionManager) ListAll

func (sm *SessionManager) ListAll() ([]*core.Session, error)

ListAll returns sessions across all projects.

func (*SessionManager) Resume added in v0.5.0

func (sm *SessionManager) Resume(sessionID string) error

Resume resets a stuck session back to working and refreshes its created-at timestamp so the inactivity timer starts over.

func (*SessionManager) SendMessage

func (sm *SessionManager) SendMessage(sessionID, message string) error

SendMessage sends a message to a running session.

func (*SessionManager) Spawn

func (sm *SessionManager) Spawn(projectID string, issue github.Issue) (*core.Session, error)

Spawn creates a new agent session for an issue.

func (*SessionManager) UpdateStatus

func (sm *SessionManager) UpdateStatus(sessionID string, status core.SessionStatus) error

UpdateStatus updates the status of a session.

type WebhookPayload

type WebhookPayload struct {
	Event      string `json:"event"`
	SessionID  string `json:"session_id"`
	IssueID    string `json:"issue_id"`
	IssueTitle string `json:"issue_title"`
	OldStatus  string `json:"old_status"`
	NewStatus  string `json:"new_status"`
	PRURL      string `json:"pr_url,omitempty"`
	Timestamp  string `json:"timestamp"`
}

WebhookPayload is sent on every session status change.

Jump to

Keyboard shortcuts

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