Skip to main content

Crate zag

Crate zag 

Source
Expand description

Unified Rust interface for zag — AI coding agent orchestration.

This crate re-exports [zag-agent] (core agent library) and [zag-orch] (orchestration primitives) under a single zag package name.

§Usage

use zag::builder::AgentBuilder;
use zag::orch::spawn;

Modules§

agent
attachment
File attachment support for embedding files in agent prompts.
auto_selector
Auto-selection of provider and/or model based on task analysis.
builder
High-level builder API for driving agents programmatically.
capability
config
Configuration management for the zag CLI.
exit_mode
Library-level support for --exit interactive mode.
factory
file_util
Atomic file write utilities.
json_validation
JSON validation utilities for --json and --json-schema output modes.
listen
Event formatting and filtering helpers shared by zag listen, the library-side streaming builder options, and any consumer that wants to render AgentLogEvent values.
manpages
Built-in manpages and the --help-agent reference document.
mcp
orch
Orchestration primitives: spawn, wait, collect, pipe, status, events, cancel, and more.
output
plan
Library-level implementation of zag plan.
preflight
CLI binary pre-flight validation.
process
process_registration
Helper for registering an agent process in zag’s ProcessStore and producing the env vars (ZAG_PROCESS_ID, ZAG_SESSION_ID, etc.) that zag ps kill self / zig self terminate use to resolve the running agent from inside the agent’s own subshell.
process_store
Process tracking store.
progress
prompts
Helpers for loading versioned prompt files (§13.5).
providers
review
Library-level implementation of zag review.
sandbox
search
serve
Network server: remote access to AI agent orchestration over HTTP/WebSocket.
session
Session-to-worktree mapping store.
session_log
skills
streaming
Streaming session for programmatic stdin/stdout interaction with agents.
usage_limits
Shared types and helpers for provider usage-limit detection and auto-resume.
worktree