agents

package
v0.5.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package agents renders the five Codex agent TOMLs `orch render-agents` writes into <repo>/.codex/agents/ (PRD §22): each file's model and model_reasoning_effort are substituted from the effective configuration's hosts.codex.roles, but the surrounding body — name, description, developer_instructions — is the canonical shipped text embedded from adapters/codex/agents/*.toml (adapters/codex/embed.go's AgentTOMLs). That embed is the one source of truth: this package never carries its own copy of the prose, so the shipped plugin files and this package's rendered output cannot silently diverge from one another.

Index

Constants

View Source
const Dir = ".codex/agents"

Dir is the repo-relative, slash-form destination directory `orch render-agents` writes into. It is a machine-local artifact (like config.local.toml), not a committed one: a repository's own .gitignore, not this package, decides whether it is tracked.

Variables

This section is empty.

Functions

func Write

func Write(repoRoot string, files []File) error

Write atomically writes each of files into repoRoot's Dir, creating the directory if absent and overwriting any existing file: a temp file in the same directory, synced, then renamed over the destination (internal/config.WriteLocal's shape, which also replaces atomically on Windows). On any single file's failure the files written before it are left in place; the failing file's own prior content, if any, is left untouched and its temp file removed on a best-effort basis.

Types

type File

type File struct {
	Name    string
	Content []byte
}

File is one rendered agent TOML: Name is the file stem (e.g. "orch-scout", no extension), Content its fully substituted bytes.

func Render

func Render(h *config.Host) ([]File, error)

Render produces the five agent TOMLs for h's roles, in roleFiles order. h must not be nil — the caller (`orch render-agents`) fails closed before calling Render when hosts.codex is not enabled.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL