Documentation
¶
Index ¶
- func BuildInstructions(modelID string, data prompt.SectionData) string
- type Agent
- func (a *Agent) Cancel(id string)
- func (a *Agent) Close() error
- func (a *Agent) Compact(ctx context.Context, id, focus string) (harness.CompactResult, error)
- func (a *Agent) ContextStats(id string) (harness.ContextStats, bool)
- func (a *Agent) DeleteSession(ctx context.Context, id string) error
- func (a *Agent) Effort(sessionID string) (string, []string)
- func (a *Agent) ExecSession(id string, execID int) (shell.ExecSessionInfo, bool)
- func (a *Agent) ExecSessions(id string) []shell.ExecSessionInfo
- func (a *Agent) FetchModels(ctx context.Context) error
- func (a *Agent) ForkSession(ctx context.Context, id, title string) (string, error)
- func (a *Agent) HasSession(id string) bool
- func (a *Agent) HistorySnapshot(id string) code.HistorySnapshot
- func (a *Agent) HistoryVersion(id string) code.HistoryVersion
- func (a *Agent) ListSessions(_ context.Context) ([]code.SessionInfo, error)
- func (a *Agent) LoadSession(ctx context.Context, id string) error
- func (a *Agent) LoadTurnQueue(sessionID string) (code.TurnQueueState, error)
- func (a *Agent) Messages(id string) []harness.Message
- func (a *Agent) ModelDiscoveryError() error
- func (a *Agent) Models(sessionID string) ([]model.Model, string)
- func (a *Agent) Modes(sessionID string) ([]code.Mode, string)
- func (a *Agent) Name() string
- func (a *Agent) NewSession(ctx context.Context) (string, error)
- func (a *Agent) Recap(ctx context.Context, id string) (string, error)
- func (a *Agent) RecordUserShellCommand(id, command, output string, exitCode int, duration time.Duration) error
- func (a *Agent) RoleModel(role string) (harness.ModelOption, bool)
- func (a *Agent) RunningTaskCount() int
- func (a *Agent) Save(id string) error
- func (a *Agent) SaveTurnQueue(sessionID string, state code.TurnQueueState) error
- func (a *Agent) Schedules(id string) schedule.Store
- func (a *Agent) Send(ctx context.Context, id string, input []harness.Content) (iter.Seq2[harness.Message, error], error)
- func (a *Agent) SessionsDir() string
- func (a *Agent) SetEffort(_ context.Context, sessionID, value string) error
- func (a *Agent) SetMode(_ context.Context, sessionID, modeID string) error
- func (a *Agent) SetModel(_ context.Context, sessionID, id string) error
- func (a *Agent) SetUI(ui code.UI)
- func (a *Agent) SetUnattended(_ context.Context, sessionID string, enabled bool) error
- func (a *Agent) Steer(_ context.Context, id string, input code.TurnInput) error
- func (a *Agent) StopExecSession(id string, execID int) error
- func (a *Agent) Tasks(id string) *task.Registry
- func (a *Agent) Tools(id string) []tool.Tool
- func (a *Agent) TurnFeatures(string) code.TurnFeatures
- func (a *Agent) TurnReviews(ctx context.Context, id string) ([]harness.TurnReview, error)
- func (a *Agent) Unattended(sessionID string) bool
- func (a *Agent) UndoTurn(ctx context.Context, sessionID, turnID string) error
- func (a *Agent) Usage(id string) harness.Usage
- func (a *Agent) Workspace() *code.Workspace
- type Config
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildInstructions ¶
func BuildInstructions(modelID string, data prompt.SectionData) string
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func (*Agent) ContextStats ¶ added in v0.11.2
func (a *Agent) ContextStats(id string) (harness.ContextStats, bool)
func (*Agent) ExecSession ¶ added in v0.16.4
func (*Agent) ExecSessions ¶ added in v0.16.4
func (a *Agent) ExecSessions(id string) []shell.ExecSessionInfo
ExecSessions exposes commands that exec left running so web clients can present them with the session's other background work.
func (*Agent) ForkSession ¶ added in v0.19.0
ForkSession copies history, model and mode; tasks, schedules and queued inputs stay with the source.
func (*Agent) HasSession ¶
func (*Agent) HistorySnapshot ¶ added in v0.12.9
func (a *Agent) HistorySnapshot(id string) code.HistorySnapshot
func (*Agent) HistoryVersion ¶ added in v0.12.9
func (a *Agent) HistoryVersion(id string) code.HistoryVersion
func (*Agent) ListSessions ¶
func (*Agent) LoadTurnQueue ¶ added in v0.15.8
func (a *Agent) LoadTurnQueue(sessionID string) (code.TurnQueueState, error)
func (*Agent) ModelDiscoveryError ¶ added in v0.18.0
ModelDiscoveryError reports discovery failure without discarding the last known model list or preventing the use of an explicitly configured model.
func (*Agent) RecordUserShellCommand ¶ added in v0.18.2
func (a *Agent) RecordUserShellCommand(id, command, output string, exitCode int, duration time.Duration) error
RecordUserShellCommand records a user-executed `!` shell command and its output in the session conversation history so the model can see it on subsequent turns.
func (*Agent) RoleModel ¶ added in v0.14.10
func (a *Agent) RoleModel(role string) (harness.ModelOption, bool)
RoleModel resolves "default", "complex", or "utility" without a session. Empty and "main" select default; "plan" is a compatibility alias for complex.
func (*Agent) RunningTaskCount ¶ added in v0.11.2
RunningTaskCount sums running background agents across every live session, so quitting warns about agents outside the currently viewed session too.
func (*Agent) SaveTurnQueue ¶ added in v0.15.8
func (a *Agent) SaveTurnQueue(sessionID string, state code.TurnQueueState) error
func (*Agent) Schedules ¶ added in v0.12.19
Schedules exposes the session's scheduled tasks so UI surfaces can list them alongside its background agents.
func (*Agent) SessionsDir ¶
func (*Agent) SetModel ¶
SetModel selects one model for the session, shared by Agent and Plan modes.
func (*Agent) SetUnattended ¶ added in v0.17.3
func (*Agent) StopExecSession ¶ added in v0.16.4
func (*Agent) Tasks ¶ added in v0.11.2
Tasks exposes the session's background-agent registry so UI surfaces can list running agents and deliver completion notifications.
func (*Agent) TurnFeatures ¶ added in v0.10.9
func (a *Agent) TurnFeatures(string) code.TurnFeatures
func (*Agent) TurnReviews ¶ added in v0.16.10
func (*Agent) Unattended ¶ added in v0.17.3
type Config ¶ added in v0.19.0
Config holds the startup settings for New.
func DefaultConfig ¶ added in v0.19.0
DefaultConfig loads settings from the environment; the caller must shut down Telemetry after closing its agents.
type Options ¶ added in v0.15.9
type Options struct {
// IsolateSessions disables single-client prompt routing fallbacks and keeps model
// and effort changes scoped to the session where they were made.
IsolateSessions bool
DisableShell bool
DisableSandbox bool
SandboxNetwork bool
DisableWebSearch bool
DisableWebFetch bool
// Empty role models are selected automatically from available models.
ComplexModel string
UtilityModel string
}
Options toggles code agent features; the zero value enables all tools with sandboxing.