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