Documentation
¶
Index ¶
- func StartFileSystemMCPServer(ctx context.Context, transport mcp.Transport, root string) error
- func StartSkillsMCPServer(ctx context.Context, transport mcp.Transport, skills []types.Skill) error
- func StartTransports(ctx context.Context, cfg types.Config, shellJobs *ShellJobs) ([]mcp.Transport, error)
- func StartWebMCPServer(ctx context.Context, transport mcp.Transport, cfg types.Config) error
- func TransportForServer(srv types.MCPServer) mcp.Transport
- type ShellJobInfo
- type ShellJobs
- func (s *ShellJobs) DetachForeground() (string, bool)
- func (s *ShellJobs) HasForeground() bool
- func (s *ShellJobs) HasRunning() bool
- func (s *ShellJobs) Kill(id string) bool
- func (s *ShellJobs) List() []ShellJobInfo
- func (s *ShellJobs) Output(id string) (stdout, stderr string, ok bool)
- func (s *ShellJobs) SetOnJobDone(fn func(ShellJobInfo))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartFileSystemMCPServer ¶
StartFileSystemMCPServer starts the filesystem MCP server. When root is non-empty, relative paths are rooted at it; an empty root preserves the legacy process-cwd behavior.
func StartSkillsMCPServer ¶
StartSkillsMCPServer runs an in-memory MCP server exposing a load_skill tool that returns a skill's full instructions by name.
func StartTransports ¶
func StartWebMCPServer ¶
StartWebMCPServer starts the web MCP server exposing web_fetch and web_search. web_fetch reuses the session's main model and request options (model, API key, base URL, metadata, and reasoning effort) for its extraction pass.
func TransportForServer ¶ added in v0.3.0
TransportForServer returns the client transport for a configured MCP server. A server with URL set uses a remote HTTP/SSE transport (Streamable HTTP by default, SSE when Transport == "sse"); otherwise it launches Command over stdio, inheriting the process environment plus the server's Env.
Types ¶
type ShellJobInfo ¶
type ShellJobInfo struct {
ID string
Script string
Status string // running | completed | failed
Running bool
// Backgrounded is true for jobs that run detached from a turn — started via
// bash_background, or a foreground command the user backgrounded with Ctrl+B.
// A normal foreground command (consumed inline by the turn) is false.
Backgrounded bool
}
ShellJobInfo is a UI-facing snapshot of a shell job.
type ShellJobs ¶
type ShellJobs struct {
// contains filtered or unexported fields
}
ShellJobs is the shared registry of shell jobs. It is created in main.go and shared between the shell MCP server (which starts/manages jobs) and the UI (which lists jobs for the footer and backgrounds the foreground one on Ctrl+B).
func NewShellJobs ¶
func NewShellJobs() *ShellJobs
NewShellJobs creates an empty shared shell-job registry.
func NewShellJobsInDir ¶ added in v0.4.1
NewShellJobsInDir creates a shell-job registry whose commands run in dir (cmd.Dir). An empty dir preserves the legacy process-cwd behavior.
func (*ShellJobs) DetachForeground ¶
DetachForeground backgrounds the running foreground shell command (Ctrl+B).
func (*ShellJobs) HasForeground ¶
HasForeground reports whether a detachable foreground shell command is currently running.
func (*ShellJobs) HasRunning ¶
HasRunning reports whether any shell job (background or foreground) is still running. Used as a WithPendingWork predicate so the live agent run parks while a backgrounded shell command is still in flight.
func (*ShellJobs) List ¶
func (s *ShellJobs) List() []ShellJobInfo
List returns all shell jobs in start order, oldest first.
func (*ShellJobs) SetOnJobDone ¶
func (s *ShellJobs) SetOnJobDone(fn func(ShellJobInfo))
SetOnJobDone registers a callback invoked once for each shell job that finishes (from the job's wait goroutine). The session uses it to inject a completion notice into the live run. fn receives a UI-facing snapshot; it is called for every job — the caller decides whether to act (e.g. only on backgrounded jobs). Safe to call once at setup.