Expand description
Pluggable token compression for OpenHuman and other Rust hosts.
TinyJuice owns the reusable TokenJuice compression engine. Hosts provide configuration mapping, optional ML callbacks, savings attribution, and their own RPC/tool surfaces.
Re-exports§
pub use compress::compress_content;pub use compress::route;pub use compressor::CompressionInput;pub use compressor::CompressionOutput;pub use compressor::CompressionReport;pub use compressor::Compressor;pub use compressor::PassthroughCompressor;pub use compressors::compressor_for;pub use compressors::generic_compressor;pub use config::CompressionConfig;pub use detect::detect_content_kind;pub use reduce::reduce_execution_with_rules;pub use rules::LoadRuleOptions;pub use rules::load_builtin_rules;pub use rules::load_rules;pub use sdk::HostInstallSpec;pub use sdk::SdkCompressOptions;pub use sdk::SdkCompressionClassification;pub use sdk::SdkCompressionRequest;pub use sdk::SdkCompressionResponse;pub use sdk::SdkCompressionStats;pub use sdk::TinyJuiceHost;pub use sdk::TinyJuiceSdk;pub use sdk::arguments_value;pub use sdk::compress_host_hook_payload;pub use sdk::compress_request;pub use sdk::host_hook_response;pub use sdk::host_install_spec;pub use sdk::host_install_specs;pub use sdk::host_template;pub use sdk::request_from_json_value;pub use tool_integration::CompactionStats;pub use tool_integration::compact_output;pub use tool_integration::compact_output_with_policy;pub use tool_integration::compact_tool_output_with_policy;pub use tool_integration::configure;pub use tool_integration::current_options;pub use tool_integration::install_config;pub use types::AgentTokenjuiceCompression;pub use types::CompactResult;pub use types::CompressInput;pub use types::CompressOptions;pub use types::CompressOutput;pub use types::CompressedOutput;pub use types::CompressorKind;pub use types::ContentHint;pub use types::ContentKind;pub use types::ReduceOptions;pub use types::ToolExecutionInput;
Modules§
- cache
- CCR (Compress-Cache-Retrieve) — original storage + retrieval markers.
- classify
- Rule classification: given a
ToolExecutionInput, find the best-matchingCompiledRuleand return aClassificationResult. - compress
- Universal content-aware compression entry point.
- compressor
- compressors
- Per-content-kind compressors and the registry that maps a
ContentKindto theCompressorthat handles it. - config
- detect
- Content-kind detection + tool-name priors for the TokenJuice content router.
- ml
- Optional ML compressor callback slot.
- openhuman
- reduce
- The main reduction pipeline:
reduce_executionand helpers. - rules
- Rule loading, compilation, and the built-in rule set.
- savings
- Host-provided savings attribution hook.
- sdk
- Host-neutral SDK and plugin adapter surface.
- text
- Text-processing utilities for the TokenJuice engine.
- tokens
- Lightweight token estimation for compaction savings accounting.
- tool_
integration - Glue between the agent tool loop and the TokenJuice content router.
- types
- Core type definitions for the TokenJuice reduction engine.