# Runtime Package

`@rig/runtime` contains the agent runtime, control plane, and local execution glue.

## Main areas

- `src/control-plane/`: command orchestration, hooks, native git and task ops, validators
- `src/index.ts`: exported package surface
- `bin/`: runtime-facing binaries and wrappers
- `native/`: Zig-owned runtime components and sidecars used by snapshots, hashing, and task file tools

## Role in the system

- prepares isolated workspaces
- resolves first-class browser-required task contracts and injects Rig Browser helpers into runtime `PATH`
- runs hooks and completion verification
- opens PRs, triggers verifier review, and enables auto-merge when policy allows
- provides local server and remote execution support to apps and CLI

Browser-required task operators should start with [../../docs/RIG_BROWSER.md](../../docs/RIG_BROWSER.md).

## Native Build Requirement

Rebuilding the runtime's native pieces requires `zig` on `PATH`.

- `./bootstrap.sh` installs Zig automatically on supported macOS and Linux hosts.
- Manual runtime development without bootstrap should install Zig first before rebuilding native artifacts.
