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;
17pub mod slots;
18
19mod codex;
20mod emit;
21mod error;
22mod interactive;
23mod manifest;
24mod models;
25mod provider;
26mod render;
27mod resolve;
28mod targets;
29
30pub use codex::emit_codex_interactive;
31pub use emit::{
32    emit_claude_code, emit_claude_code_with_context, emit_claude_code_with_models,
33    emit_claude_code_with_native_purpose, emit_claude_code_with_providers,
34    emit_claude_code_with_realization, resolve_node_capabilities, ContextInjection,
35    ContextInjectionMode, ContextInjectionReport, HybridRealization, RenderFlavor,
36    DEFAULT_CONTEXT_INJECTION, DEFAULT_RENDER_FLAVOR,
37};
38pub use error::DispatchError;
39pub use interactive::{
40    setup_recovery_input_schema, setup_recovery_instructions, validate_setup_recovery_report,
41    NativeBinding, NativeMcpDescriptor, NativePurpose, NativeSessionScope,
42};
43pub use manifest::{build_manifest, CapabilityManifest};
44pub use models::{
45    ModelConfig, Provider, TierBinding, ANTHROPIC_PROVIDER, BINDING_SPEC_VERSION,
46    OPENAI_COMPAT_PROVIDER,
47};
48pub use provider::{compose_for_conformance, parse_provider_fragments, ProviderFragment};
49pub use render::{parse_envelope, render_envelope_to_html, Envelope, RenderOptions};
50pub use resolve::{resolve_capabilities, ResolutionReport, ResolvedCapability};
51pub use targets::DEFAULT_TARGET;
52pub use targets::{is_known_target, known_target_names, TargetId};