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 pi;
28mod provider;
29mod render;
30mod resolve;
31mod targets;
32
33pub use codex::{emit_codex_interactive, emit_codex_interactive_with_host};
34pub use emit::{
35    emit_claude_code, emit_claude_code_with_context, emit_claude_code_with_models,
36    emit_claude_code_with_native_host, emit_claude_code_with_native_purpose,
37    emit_claude_code_with_providers, emit_claude_code_with_realization, resolve_node_capabilities,
38    ContextInjection, ContextInjectionMode, ContextInjectionReport, HybridRealization,
39    RenderFlavor, DEFAULT_CONTEXT_INJECTION, DEFAULT_RENDER_FLAVOR,
40};
41pub use error::DispatchError;
42pub use interactive::{
43    setup_recovery_input_schema, setup_recovery_instructions, validate_setup_recovery_report,
44    NativeBinding, NativeMcpDescriptor, NativePurpose, NativeSessionScope,
45};
46pub use manifest::{build_manifest, CapabilityManifest};
47pub use models::{
48    ModelConfig, Provider, TierBinding, ANTHROPIC_PROVIDER, BINDING_SPEC_VERSION,
49    OPENAI_COMPAT_PROVIDER,
50};
51pub use pi::{
52    emit_pi_interactive, emit_pi_interactive_with_host, PiModel, PI_AGENT_DIR_PATH,
53    PI_MCP_CONFIG_PATH, PI_MINIMUM_VERSION, PI_SETTINGS_PATH, PI_SYSTEM_PROMPT_PATH,
54};
55pub use provider::{compose_for_conformance, parse_provider_fragments, ProviderFragment};
56pub use render::{parse_envelope, render_envelope_to_html, Envelope, RenderOptions};
57pub use resolve::{resolve_capabilities, ResolutionReport, ResolvedCapability};
58pub use targets::DEFAULT_TARGET;
59pub use targets::{is_known_target, known_target_names, TargetId};