Documentation
¶
Index ¶
- Variables
- func BuildInstructions(data prompt.SectionData) string
- func ModelName(id string) string
- func ReadProjectInstructions(wd string) string
- type Agent
- func (a *Agent) Close()
- func (a *Agent) InitMCP(ctx context.Context) error
- func (a *Agent) InstructionsData() prompt.SectionData
- func (a *Agent) IsGitRepo() bool
- func (a *Agent) MemoryContent() string
- func (a *Agent) RestartRewind()
- func (a *Agent) SyncProjectMode()
- func (a *Agent) WaitWarmUp()
- func (a *Agent) WarmUp()
- type Model
- type UI
Constants ¶
This section is empty.
Variables ¶
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-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"},
}
AvailableModels is the curated allowlist of models that wingman exposes in its UI. Lives in this package (not pkg/agent) so the underlying agent runtime stays provider-agnostic — pkg/agent doesn't know or care which models are "blessed."
Functions ¶
func BuildInstructions ¶
func BuildInstructions(data prompt.SectionData) string
func ModelName ¶
ModelName returns the friendly display name for a model ID, falling back to the ID itself if the model isn't in the curated list.
func ReadProjectInstructions ¶
ReadProjectInstructions walks from wd up to the filesystem root, collecting AGENTS.md and CLAUDE.md files. Returns them concatenated with headers, closest ancestor first. Truncates at 25KB.
Types ¶
type Agent ¶
type Agent struct {
*agent.Agent
Root *os.Root
RootPath string
MemoryPath string
ScratchPath string
Skills []skill.Skill
MCP *mcp.Manager
// LSP is set by WarmUp when the workspace is a supported git repo;
// nil otherwise. Callers nil-check before use.
LSP *lsp.Manager
// Rewind is set by WarmUp when the workspace is supported (git repo or
// small enough to walk in time); nil otherwise. Rewind == nil is the
// canonical "unsupported workspace" signal — UI shows the limited-mode
// banner and hides the Changes/Problems tabs.
Rewind *rewind.Manager
Bridge *bridge.Bridge
PlanMode bool
// contains filtered or unexported fields
}
func (*Agent) InitMCP ¶
InitMCP connects MCP servers, fetches their tools, and sets up the IDE bridge. Call this after the UI is ready (typically async).
func (*Agent) InstructionsData ¶
func (a *Agent) InstructionsData() prompt.SectionData
func (*Agent) IsGitRepo ¶
IsGitRepo reports whether the agent's working directory is currently a git repo. Re-evaluated on each call so callers can react to `git init` (or `rm -rf .git`) happening mid-session.
func (*Agent) MemoryContent ¶
func (*Agent) RestartRewind ¶
func (a *Agent) RestartRewind()
RestartRewind tears down the existing rewind manager and creates a fresh one, re-baselining at the current state. Used on /sessions/new so the checkpoint history is scoped to one conversation. No-op on unsupported workspaces (Rewind == nil). LSP is intentionally untouched — gopls/etc. are slow to spin up and shouldn't churn on session boundaries.
func (*Agent) SyncProjectMode ¶
func (a *Agent) SyncProjectMode()
SyncProjectMode rebuilds LSP when the working dir's git status flips (typically: agent ran `git init` in a scratch dir). No-op on unsupported workspaces — `git init` alone doesn't make a 1M-file home folder small enough to support full features.
func (*Agent) WaitWarmUp ¶
func (a *Agent) WaitWarmUp()
WaitWarmUp blocks until WarmUp has completed.
func (*Agent) WarmUp ¶
func (a *Agent) WarmUp()
WarmUp runs the slow workspace probe and initializes Rewind/LSP if the directory is supported. Idempotent and safe to call from any goroutine — the first call does the work, the rest wait on warmupDone. Callers that want to gate on completion (e.g. server startup) can use WaitWarmUp.
Three resulting modes:
- supported git repo → Rewind set, LSP set, lspTools set
- supported scratch → Rewind set, LSP nil, lspTools nil
- unsupported (huge) → Rewind nil, LSP nil; UI falls back to chat-only