Skip to main content

warble_claude_code/
lib.rs

1//! Warble back-end for the **Claude Code CLI** target.
2//!
3//! Consumes a compiled Warble IR (JSON) and emits a Claude Code agent runtime (agent files under
4//! `.claude/agents/`, settings, and `RUN.md`) — the static-file target, which needs no SDK, so it
5//! lives natively in Rust alongside the compiler and is driven by the `warble` CLI. Also hosts the
6//! deterministic reference renderer (`render`) and the capability-manifest projection (`manifest`).
7//!
8//! Dispatch is keyed on IR enums (`realization_kind`, `trigger.kind`, `effect.outcome.kind`),
9//! never on a component's id/verb. Enum arms not yet realized fail loudly (a "wall-hit").
10//!
11//! This crate is not a standalone tool — you install `warble-cli` (the `warble` binary), which
12//! links this crate in directly, and `warble dispatch --target claude-code` (or
13//! `claude-code:headless` / `claude-code:interactive`, the default) selects it at dispatch time.
14
15pub mod conditional;
16pub mod ir;
17
18mod emit;
19mod error;
20mod manifest;
21mod models;
22mod render;
23mod resolve;
24mod targets;
25
26pub use emit::{
27    emit_claude_code, emit_claude_code_with_models, emit_claude_code_with_realization,
28    resolve_node_capabilities, HybridRealization, RenderFlavor, DEFAULT_RENDER_FLAVOR,
29};
30pub use error::DispatchError;
31pub use manifest::{build_manifest, CapabilityManifest};
32pub use models::{
33    ModelConfig, Provider, TierBinding, ANTHROPIC_PROVIDER, BINDING_SPEC_VERSION,
34    OPENAI_COMPAT_PROVIDER,
35};
36pub use render::{parse_envelope, render_envelope_to_html, Envelope, RenderOptions};
37pub use resolve::{resolve_capabilities, ResolutionReport, ResolvedCapability};
38pub use targets::DEFAULT_TARGET;
39pub use targets::{is_known_target, known_target_names, TargetId};