Documentation
¶
Overview ¶
Package harness orchestrates agent runs with hooks, tools, and session persistence.
Index ¶
- type Harness
- func (h *Harness) Agent() *agent.Agent
- func (h *Harness) ContextManager() *ctxmgr.Manager
- func (h *Harness) Hooks() *hooks.Registry
- func (h *Harness) LastRunResult() agentevent.Result
- func (h *Harness) MoveTo(ctx context.Context, entryID, summary string) error
- func (h *Harness) Prompt(ctx context.Context, prompts ...agent.AgentMessage) (*agentevent.Stream, error)
- func (h *Harness) RegisterTool(t tool.Tool) error
- func (h *Harness) Session() *session.Session
- func (h *Harness) SetActiveTools(names []string)
- func (h *Harness) SetModel(llmModel llms.Model, modelName string)
- func (h *Harness) SetRunStartedAt(start time.Time)
- func (h *Harness) SetSystemPrompt(systemPrompt string)
- func (h *Harness) WaitIdle(ctx context.Context) error
- type Options
- type Phase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Harness ¶
type Harness struct {
// contains filtered or unexported fields
}
Harness orchestrates agent loop, session tree, tools, and lifecycle hooks.
func (*Harness) ContextManager ¶
ContextManager exposes the optional context budget manager.
func (*Harness) LastRunResult ¶
func (h *Harness) LastRunResult() agentevent.Result
LastRunResult returns the final outcome after Prompt completes, including overflow retries.
func (*Harness) MoveTo ¶
MoveTo switches the session leaf, auto-summarizing abandoned branches when configured.
func (*Harness) Prompt ¶
func (h *Harness) Prompt(ctx context.Context, prompts ...agent.AgentMessage) (*agentevent.Stream, error)
Prompt starts an agent run with optional session persistence.
func (*Harness) RegisterTool ¶
RegisterTool adds a tool to the harness registry.
func (*Harness) SetActiveTools ¶
SetActiveTools restricts exposed tools for the next run.
func (*Harness) SetRunStartedAt ¶ added in v0.95.0
SetRunStartedAt records the wall-clock start of the current run for RunDurationMs persistence.
func (*Harness) SetSystemPrompt ¶
SetSystemPrompt replaces the harness system prompt used on subsequent runs.