client

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAgentNotRunning = fmt.Errorf("agent not running")

ErrAgentNotRunning is returned when the target agent is not registered with pogod.

Functions

func ArchiveMGDoneItems added in v0.1.2

func ArchiveMGDoneItems() (string, error)

ArchiveMGDoneItems triggers macguffin to archive all done work items immediately (--days=0). Called by the refinery after a successful merge so the merged item moves from done/ to archive/ at its natural lifecycle endpoint rather than waiting for time-based cleanup.

func AttachAgent

func AttachAgent(socketPath string) error

AttachAgent connects the current terminal to a running agent's PTY via its unix domain socket. Returns when the connection closes or the user sends the escape sequence (Ctrl-\).

func GetAgent

func GetAgent(name string) (*agent.AgentInfo, error)

GetAgent returns details for a specific agent.

func GetAgentOutput

func GetAgentOutput(name string) (string, error)

GetAgentOutput returns recent output from an agent.

func GetPlugins

func GetPlugins() ([]string, error)

func GetProjects

func GetProjects() ([]project.Project, error)

func GetRefineryQueue

func GetRefineryQueue() ([]refinery.MergeRequest, error)

GetRefineryQueue returns all queued merge requests.

func GetRefineryStatus

func GetRefineryStatus() (*refinery.Status, error)

GetRefineryStatus returns the refinery status summary.

func GetSearchPlugin

func GetSearchPlugin() (string, error)

func HealthCheck

func HealthCheck() error

func ListAgents

func ListAgents() ([]agent.AgentInfo, error)

ListAgents returns all running agents from pogod.

func ListPrompts

func ListPrompts() ([]agent.PromptInfo, error)

ListPrompts returns all discovered prompt files from pogod.

func NudgeAgent

func NudgeAgent(name, message string, opts *NudgeOpts) error

NudgeAgent sends a message to an agent's PTY with the given options.

func NudgeOrMail

func NudgeOrMail(name, message string, opts *NudgeOpts) (fallback bool, err error)

NudgeOrMail tries to nudge an agent via PTY. If the agent is not running, it falls back to sending a macguffin mail message via the gt CLI.

func RemoveProject added in v0.1.1

func RemoveProject(path string) error

RemoveProject removes a project from pogod by path.

func RunWithHealthCheck

func RunWithHealthCheck[T ClientResp](run func() (T, error)) (T, error)

Run closure with health check

func SendMGMail

func SendMGMail(to, from, subject, body string) error

SendMGMail sends a mail message via macguffin (mg mail send). Used by non-agent components like the refinery that need to deliver mail to agents reading via mg mail list.

func SendMail

func SendMail(address, subject, body string) error

SendMail sends a mail message to the given address via gt mail send. The address is interpreted as a rig/role path (e.g. "mayor/", "pogo/polecats/chrome").

func SpawnAgent

func SpawnAgent(req agent.SpawnAPIRequest) (*agent.AgentInfo, error)

SpawnAgent asks pogod to spawn a new agent.

func SpawnPolecat

func SpawnPolecat(req agent.SpawnPolecatAPIRequest) (*agent.AgentInfo, error)

SpawnPolecat asks pogod to spawn a polecat from a template.

func StartAgent

func StartAgent(name string) (*agent.AgentInfo, error)

StartAgent asks pogod to start a crew agent by name. The prompt file is looked up from ~/.pogo/agents/crew/<name>.md.

func StartServer

func StartServer() error

func StopAgent

func StopAgent(name string) error

StopAgent asks pogod to stop an agent.

func StopServer

func StopServer() error

func SubmitMerge

func SubmitMerge(req refinery.SubmitRequest) (string, error)

SubmitMerge submits a branch to the refinery merge queue.

func Visit

func Visit(path string) (*project.VisitResponse, error)

Types

type ClientResp

type ClientResp interface {
	[]project.Project | *project.VisitResponse | *SearchResponse | []string | []ProjectStatusResponse
}

type IndexedProject

type IndexedProject struct {
	Root   string   `json:"root"`
	Paths  []string `json:"paths"`
	Status string   `json:"indexing_status"`
}

type NudgeOpts

type NudgeOpts struct {
	Mode    string // "wait-idle" or "immediate"
	Timeout int    // seconds, for wait-idle mode
}

NudgeOpts configures nudge delivery.

type PogoChunkMatch

type PogoChunkMatch struct {
	Line    uint32 `json:"line"`
	Content string `json:"content"`
}

type PogoFileMatch

type PogoFileMatch struct {
	Path    string           `json:"path"`
	Matches []PogoChunkMatch `json:"matches"`
}

type ProjectStatusResponse

type ProjectStatusResponse struct {
	Id        int    `json:"id"`
	Path      string `json:"path"`
	Status    string `json:"indexing_status"`
	FileCount int    `json:"file_count"`
}

func GetStatus

func GetStatus() ([]ProjectStatusResponse, error)

type SearchRequest

type SearchRequest struct {
	// Values: "search" or "files"
	Type        string `json:"type"`
	ProjectRoot string `json:"projectRoot"`
	// Command timeout duration - only for 'search'-type requests
	Duration string `json:"string"`
	Data     string `json:"data"`
}

type SearchResponse

type SearchResponse struct {
	Index   IndexedProject `json:"index"`
	Results SearchResults  `json:"results"`
	Error   string         `json:"error"`
}
func Search(query string, dir string) (*SearchResponse, error)

dir may be inside of a project path. First we have to look up the

func SearchAll

func SearchAll(query string) ([]*SearchResponse, error)

SearchAll searches across all known projects, returning results for each.

type SearchResults

type SearchResults struct {
	Files []PogoFileMatch `json:"files"`
}

Jump to

Keyboard shortcuts

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