code

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const BuiltinAgentName = "wingman"

Variables

View Source
var AvailableModels = []Model{
	{ID: "claude-sonnet-4-6", Name: "Claude Sonnet 4.6"},
	{ID: "claude-sonnet-4-5", Name: "Claude Sonnet 4.5"},

	{ID: "gpt-5.5", Name: "GPT 5.5"},
	{ID: "gpt-5.4", Name: "GPT 5.4"},

	{ID: "gpt-5.3-codex", Name: "GPT 5.3 Codex"},
	{ID: "gpt-5.2-codex", Name: "GPT 5.2 Codex"},

	{ID: "claude-opus-4-8", Name: "Claude Opus 4.8"},
	{ID: "claude-opus-4-7", Name: "Claude Opus 4.7"},
	{ID: "claude-opus-4-6", Name: "Claude Opus 4.6"},
	{ID: "claude-opus-4-5", Name: "Claude Opus 4.5"},
}

Functions

func HasAgentsConfig added in v0.8.3

func HasAgentsConfig() bool

func ModelName

func ModelName(id string) string

func SaveAgents added in v0.7.0

func SaveAgents(defs []AgentDef) error

func SessionIDFromContext added in v0.7.0

func SessionIDFromContext(ctx context.Context) string

func SessionsDir added in v0.6.9

func SessionsDir(workingDir string) string

func WithSessionID added in v0.7.0

func WithSessionID(ctx context.Context, sid string) context.Context

Types

type Agent

type Agent interface {
	Name() string

	Workspace() *Workspace

	Models(sessionID string) (available []Model, current string)

	SetModel(ctx context.Context, sessionID, id string) error

	Effort(sessionID string) (current string, options []string)

	SetEffort(ctx context.Context, sessionID, value string) error

	Modes(sessionID string) (available []Mode, current string)

	SetMode(ctx context.Context, sessionID, modeID string) error

	ListSessions(ctx context.Context) ([]SessionInfo, error)

	NewSession(ctx context.Context) (string, error)

	LoadSession(ctx context.Context, id string) error

	DeleteSession(ctx context.Context, id string) error

	Messages(sessionID string) []agent.Message

	Usage(sessionID string) agent.Usage

	Send(ctx context.Context, sessionID string, input []agent.Content) iter.Seq2[agent.Message, error]

	Cancel(sessionID string)

	Close() error
}

type AgentDef added in v0.7.0

type AgentDef struct {
	Name string `json:"name"`

	Command string `json:"command"`

	Args []string `json:"args,omitempty"`

	Env map[string]string `json:"env,omitempty"`
}

func LoadAgents added in v0.7.0

func LoadAgents() []AgentDef

type Mode added in v0.8.0

type Mode struct {
	ID          string
	Name        string
	Description string
}

type Model

type Model struct {
	ID   string
	Name string
}

type SessionInfo added in v0.7.0

type SessionInfo struct {
	ID        string
	Title     string
	UpdatedAt time.Time
}

type SessionLoadStreamer added in v0.8.8

type SessionLoadStreamer interface {
	LoadSessionStream(ctx context.Context, id string) iter.Seq2[[]agent.Message, error]
}

type UI

type UI interface {
	Ask(ctx context.Context, message string) (string, error)
	Confirm(ctx context.Context, message string) (bool, error)
}

type Workspace added in v0.6.9

type Workspace struct {
	Root        *os.Root
	RootPath    string
	MemoryPath  string
	ScratchPath string

	Skills []skill.Skill

	MCP *mcp.Manager

	LSP    *lsp.Manager
	Rewind *rewind.Manager
	// contains filtered or unexported fields
}

func NewWorkspace added in v0.6.9

func NewWorkspace(workDir string) (*Workspace, error)

func (*Workspace) Checkpoints added in v0.6.9

func (w *Workspace) Checkpoints() ([]rewind.Checkpoint, error)

func (*Workspace) Close added in v0.6.9

func (w *Workspace) Close()

func (*Workspace) Commit added in v0.6.9

func (w *Workspace) Commit(msg string) error

func (*Workspace) Diagnostics added in v0.6.9

func (w *Workspace) Diagnostics(ctx context.Context) map[string][]lsp.Diagnostic

func (*Workspace) Diffs added in v0.6.9

func (w *Workspace) Diffs() ([]rewind.FileDiff, error)

func (*Workspace) InitMCP added in v0.6.9

func (w *Workspace) InitMCP(ctx context.Context) error

func (*Workspace) IsGitRepo added in v0.6.9

func (w *Workspace) IsGitRepo() bool

func (*Workspace) ManagedTools added in v0.7.0

func (w *Workspace) ManagedTools() (mcpTools, lspTools []tool.Tool)

func (*Workspace) MemoryContent added in v0.6.9

func (w *Workspace) MemoryContent() string

func (*Workspace) Restore added in v0.6.9

func (w *Workspace) Restore(hash string) error

func (*Workspace) SyncProjectMode added in v0.6.9

func (w *Workspace) SyncProjectMode()

func (*Workspace) WarmUp added in v0.6.9

func (w *Workspace) WarmUp()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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