Documentation
¶
Overview ¶
Package bootstrap is what `steerloop run` and `steerloop chat` share: the flags they both take, the loop each turn runs, its tools and the recording. How turns are run is each command's own business.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitialMessages ¶
InitialMessages is the conversation the first turn starts from: the --system-prompt file, if any, then the user prompt, if any.
func ParseFlags ¶
ParseFlags parses args and reports its own errors to stderr. It rejects leftover arguments: the flag package stops at the first one, so `--user-prompt fix the bug --debug` would otherwise run with the prompt "fix" and drop the rest without a word.
Types ¶
type Loops ¶
type Loops struct {
// contains filtered or unexported fields
}
Loops builds the loop for a turn. A loop runs once, so a command that runs several turns asks for a fresh one each time, all with the same settings and the same model; the command carries the conversation over.
func NewLoops ¶
func NewLoops(ctx context.Context, env cli.Environment, opts Options, humanAvailable bool) (Loops, error)
NewLoops connects to the model and loads the tools. humanAvailable says whether someone can answer an ask_user or confirm question.
func (Loops) StopCondition ¶
func (f Loops) StopCondition() loop.StopCondition
StopCondition is how every loop ends, which the trace shows.
type Options ¶
type Options struct {
// Prompt Options
SystemPromptPath string
UserPrompt string
// Model Options
Model string
Temperature float64 // below 0: not sent, so the provider's default applies
MaxTokens int
// Loop Options
MaxIterations int
IterationTimeout time.Duration
TotalTimeout time.Duration
StopCondition string
Reflect string // "on-iteration" or "on-finish"
// Tool Options
ToolsManifestPath string
AutoApprove bool
AskUser bool
// Output Options
OutputRecordPath string // also write every event to a JSONL file
Debug bool
}
Options are the flags of every command that runs the loop. Each command adds its own --user-prompt, since only `run` requires one.
type Recording ¶
type Recording struct {
// contains filtered or unexported fields
}
Recording is the JSONL file a run, or every turn of a chat, writes each event to, for `steerloop replay`. It is an EventSink.
func OpenRecording ¶
OpenRecording creates the file for path:
- a path ending in .jsonl is that file, created or truncated;
- anything else is a folder, created if needed, that gets one new <timestamp>-<random>.jsonl file per run. A relative folder sits under the repo root.
Files in a folder are created readable by the owner only: a recording holds prompts and tool output.
type Toolset ¶
type Toolset struct {
Infos []*schema.ToolInfo
Executor loop.ToolExecutor
Gates map[string]pause.Handler // tool name → the gate that handles it
}
Toolset is what the model can call, and the gates in front of some of it. Gates are loop pause.Handlers, so they go straight into loop.Config with no conversion.