agent

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	// Name returns the agent identifier.
	Name() string

	// BuildLaunchCommand returns the shell command to start the agent.
	BuildLaunchCommand(cfg LaunchConfig) string

	// BuildEnvironment returns environment variables for the agent process.
	BuildEnvironment(cfg LaunchConfig) map[string]string

	// IsProcessRunning checks if the agent process is running in the tmux session.
	IsProcessRunning(tmuxName string) (bool, error)

	// SetupHooks installs any hooks needed for metadata tracking.
	SetupHooks(workspacePath, sessionsDir, sessionID string) error
}

Agent is the interface for AI coding agent implementations.

func New

func New(name string) Agent

New creates an Agent by name. Supported: "claude-code", "codex".

type ClaudeCode

type ClaudeCode struct{}

ClaudeCode implements the Agent interface for Claude Code.

func (*ClaudeCode) BuildEnvironment

func (c *ClaudeCode) BuildEnvironment(cfg LaunchConfig) map[string]string

func (*ClaudeCode) BuildLaunchCommand

func (c *ClaudeCode) BuildLaunchCommand(cfg LaunchConfig) string

func (*ClaudeCode) IsProcessRunning

func (c *ClaudeCode) IsProcessRunning(tmuxName string) (bool, error)

func (*ClaudeCode) Name

func (c *ClaudeCode) Name() string

func (*ClaudeCode) SetupHooks

func (c *ClaudeCode) SetupHooks(workspacePath, sessionsDir, sessionID string) error

SetupHooks installs the PostToolUse hook for metadata tracking. Creates .claude/settings.json and .claude/metadata-updater.sh in the workspace.

type Codex

type Codex struct{}

Codex implements the Agent interface for OpenAI Codex CLI.

func (*Codex) BuildEnvironment

func (c *Codex) BuildEnvironment(cfg LaunchConfig) map[string]string

func (*Codex) BuildLaunchCommand

func (c *Codex) BuildLaunchCommand(cfg LaunchConfig) string

func (*Codex) IsProcessRunning

func (c *Codex) IsProcessRunning(tmuxName string) (bool, error)

func (*Codex) Name

func (c *Codex) Name() string

func (*Codex) SetupHooks

func (c *Codex) SetupHooks(workspacePath, sessionsDir, sessionID string) error

SetupHooks is a no-op for Codex — it uses PATH wrappers instead of hooks.

type LaunchConfig

type LaunchConfig struct {
	SessionID     string
	ProjectID     string
	IssueID       string
	WorkspacePath string
	AgentRules    string
	Prompt        string
}

LaunchConfig contains the parameters needed to launch an agent.

Jump to

Keyboard shortcuts

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