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