Documentation
¶
Overview ¶
Package zot is the embeddable core of the zot automated software factory. It turns a work order - a durable objective, rendered to a 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 NewClient(cfg Config) (*agent.Client, 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 = baseInstructions + "\n\n" + nonInteractiveContract
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.
It is assembled rather than written out because its closing half is not the caller's to drop - see nonInteractiveContract.
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>/AGENTS.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. AGENTS.md content augments (never replaces) the base instructions.
func NewClient ¶ added in v0.13.0
NewClient resolves the configuration into a provider-backed client, for engine work outside the main run path - the read-only survey that drafts a work order's acceptance criteria, say. A run of record never takes this path: it goes through Run or RunWith, which render, log, and record an outcome.
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)
// BatchIndex and BatchSize place this run in a batch - order 2 of 5 - so
// the viewer can show how much of the queue is left. Zero for a run that is
// not part of a batch.
BatchIndex int
BatchSize int
// Title is a short label for the work, shown in the viewer instead of the
// task text. A work order's title, or one derived from its file name;
// empty falls back to the task. It is presentation only and never reaches
// the model - the objective is the contract, a title is a label.
Title string
// QuitOnDone closes the viewer as soon as the run ends instead of holding
// the final screen. Set for the intermediate orders of a batch, where a
// held screen would stall the orders behind it until a keypress nobody
// unattended will make; the batch's last order still holds for review.
QuitOnDone bool
}
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. |
|
zotui
command
Command zotui serves the browser command center over the zot engine.
|
Command zotui serves the browser command center over the zot engine. |
|
Package configs embeds the example configuration files baked into the binaries, used to seed a user's config on first run.
|
Package configs embeds the example configuration files baked into the binaries, used to seed a user's config on first run. |
|
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). |
|
imaging
Package imaging recognises image files and prepares them to be shown to a model.
|
Package imaging recognises image files and prepares them to be shown to a model. |
|
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. |
|
order
Package order defines the work order: the document a zot run is dispatched from.
|
Package order defines the work order: the document a zot run is dispatched from. |
|
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 estimates the token cost of model input.
|
Package tokenizer estimates the token cost of model input. |
|
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. |
|
watch
Package watch keeps a running zot pointed at a folder - or at a glob naming the orders in one - so work orders are dispatched as they arrive.
|
Package watch keeps a running zot pointed at a folder - or at a glob naming the orders in one - so work orders are dispatched as they arrive. |
|
zotui/app
Package app implements the command center's worker and run lifecycle.
|
Package app implements the command center's worker and run lifecycle. |
|
zotui/compute
Package compute abstracts the providers that turn a resolved environment into a running remote computer.
|
Package compute abstracts the providers that turn a resolved environment into a running remote computer. |
|
zotui/compute/docker
Package docker provides local zotui compute using Docker containers.
|
Package docker provides local zotui compute using Docker containers. |
|
zotui/compute/vercel
Package vercel provides remote zotui compute using Vercel Sandbox.
|
Package vercel provides remote zotui compute using Vercel Sandbox. |
|
zotui/config
Package config defines the zotui configuration: the repository connections, compute providers, models, environments that bind compute to an image and env vars, and the store that tracks workers and their runs.
|
Package config defines the zotui configuration: the repository connections, compute providers, models, environments that bind compute to an image and env vars, and the store that tracks workers and their runs. |
|
zotui/dispatch
Package dispatch executes a worker run on a remote sandbox.
|
Package dispatch executes a worker run on a remote sandbox. |
|
zotui/ghapp
Package ghapp mints short-lived, repository-scoped GitHub App installation tokens.
|
Package ghapp mints short-lived, repository-scoped GitHub App installation tokens. |
|
zotui/repo
Package repo abstracts repository connections: where workers get their code and how zotui mints per-run credentials for it.
|
Package repo abstracts repository connections: where workers get their code and how zotui mints per-run credentials for it. |
|
zotui/repo/github
Package github exposes explicitly configured public GitHub repositories.
|
Package github exposes explicitly configured public GitHub repositories. |
|
zotui/repo/local
Package local exposes an explicitly configured local checkout without manufacturing a remote credential.
|
Package local exposes an explicitly configured local checkout without manufacturing a remote credential. |
|
zotui/store
Package store persists workers, their runs, and run output.
|
Package store persists workers, their runs, and run output. |
|
zotui/web
Package web serves the zot command center and its JSON API.
|
Package web serves the zot command center and its JSON API. |
|
zotui/worker
Package worker provides the platform-specific Zot executable deployed by the command center into each sandbox.
|
Package worker provides the platform-specific Zot executable deployed by the command center into each sandbox. |
|
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. |