Documentation
¶
Overview ¶
Package zot is the embeddable core of the zot automated software factory. It turns a single plain-English task into an agentic run - plan, act, observe, exit - and renders the run in a read-only terminal UI.
The agentic loop is zot's own (see the agent package): thread assembly, compaction, loop detection and the tool-call cycle all run locally, against any OpenAI-compatible provider. zot needs no account and no hosted engine.
The standalone binary is cmd/zot; an embedding program can import this package and call Run directly while zot's internals stay internal.
Index ¶
- Constants
- Variables
- func DefaultConfigPath() string
- func LoadProjectContext(cfg *Config, dirs ...string) error
- func Run(ctx context.Context, cfg Config, task string) error
- func RunWith(ctx context.Context, cfg Config, task string, options RunOptions) error
- func Version() string
- type Config
- type RunOptions
Constants ¶
const DefaultInstructions = `` /* 1549-byte string literal not displayed */
DefaultInstructions is the system prompt handed to the agent when the configuration does not override it. It establishes the fully-autonomous, no-questions-asked contract: zot has no input channel, so the agent must never wait for the user.
The opening and the "act, don't narrate" rule imitate the batch-mode prompt of the engine zot was derived from: a run is a non-interactive background session whose deliverable is the changed working tree, not prose, and which ends only by recording an outcome with a terminal tool.
Variables ¶
var ExampleConfigYAML []byte
ExampleConfigYAML is the commented starter config baked into the binary, used by `zot config` to seed ~/.config/zot/config.yaml when it does not exist yet.
Functions ¶
func DefaultConfigPath ¶
func DefaultConfigPath() string
DefaultConfigPath is the default config file location.
func LoadProjectContext ¶
LoadProjectContext augments cfg with on-disk context discovered under the given directories, searched in order (typically the config directory first, then the working directory):
- <dir>/AGENT.md - appended to the agent instructions
- <dir>/skills/ - loaded via the SDK and added as a "skills" feature
Missing files and directories are ignored, and duplicate directories are searched once. AGENT.md content augments (never replaces) the base instructions.
func Run ¶
Run executes one autonomous coding task, rendering the agent's activity in the read-only TUI. The agent's file and shell tools operate on the current working directory, so callers should chdir into the target project first. Run blocks until the user quits the viewer or the program errors.
Types ¶
type Config ¶
Config is the fully-resolved zot configuration. Load it with Load; its Validate method enforces the same checks the standalone binary runs.
type RunOptions ¶
type RunOptions struct {
// SessionDir is where the run's log is written. Empty disables recording.
SessionDir string
// Resume seeds the conversation from an earlier session, so a run that ran
// out of budget or died overnight continues rather than starting again.
Resume *session.Session
// OnSession is called once the log is open, with its path. Used to tell the
// operator where the record is before the run takes over the screen.
OnSession func(path string)
// Prompt is an optional user message that opens the run, distinct from the
// task. The task (in the instructions) is the durable objective; the prompt is
// an ephemeral nudge - "start with the error handling" - and may be
// compacted away later, which is fine because it is not the objective.
Prompt string
}
RunOptions configures a run beyond the configuration itself.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agent runs autonomous, tool-using conversations against any OpenAI-compatible model provider.
|
Package agent runs autonomous, tool-using conversations against any OpenAI-compatible model provider. |
|
cmd
|
|
|
zot
command
Command zot is an automated software factory you watch, not drive.
|
Command zot is an automated software factory you watch, not drive. |
|
internal
|
|
|
buildinfo
Package buildinfo reports which kind of binary this is.
|
Package buildinfo reports which kind of binary this is. |
|
catalogue
Package catalogue records what the engine needs to know about a model before it calls one: how much context it has, how much of that it may spend on the answer, and whether it can use tools or emits a reasoning channel.
|
Package catalogue records what the engine needs to know about a model before it calls one: how much context it has, how much of that it may spend on the answer, and whether it can use tools or emits a reasoning channel. |
|
compaction
Package compaction condenses a conversation that has outgrown the model's context window.
|
Package compaction condenses a conversation that has outgrown the model's context window. |
|
config
Package config loads zot's configuration, layering built-in defaults, an optional YAML file, and environment variables (defaults < file < env).
|
Package config loads zot's configuration, layering built-in defaults, an optional YAML file, and environment variables (defaults < file < env). |
|
loop
Package loop runs the agentic conversation: call the model, execute the tools it asks for, feed the results back, repeat until the task settles.
|
Package loop runs the agentic conversation: call the model, execute the tools it asks for, feed the results back, repeat until the task settles. |
|
provider
Package provider talks to OpenAI-compatible chat-completions endpoints.
|
Package provider talks to OpenAI-compatible chat-completions endpoints. |
|
session
Package session records a run to disk so it can be inspected afterwards and picked up again.
|
Package session records a run to disk so it can be inspected afterwards and picked up again. |
|
thread
Package thread assembles conversation threads that fit a model's context window, and detects when an agent has stopped making progress.
|
Package thread assembles conversation threads that fit a model's context window, and detects when an agent has stopped making progress. |
|
tokenizer
Package tokenizer counts tokens the way a model actually does.
|
Package tokenizer counts tokens the way a model actually does. |
|
version
Package version provides build-time version information and update checking for the zot binary.
|
Package version provides build-time version information and update checking for the zot binary. |
|
Package tui renders the read-only terminal view of an autonomous agent run.
|
Package tui renders the read-only terminal view of an autonomous agent run. |