Skip to main content

Crate aphrodite

Crate aphrodite 

Source
Expand description

aphrodite: core compression engine exposed as both an rlib (for the aphrodite binary and the aphrodite-hermes bridge) and a C ABI cdylib.

The C ABI is agent-agnostic and handle-based: aphrodite_init allocates a session handle, the aphrodite_* functions operate on it (classify, compress, retrieve, transform, terminal, session_start, catalog, stats, reload, config_get/set, search, dispatch, resolve, stage2, struct_extract), and aphrodite_destroy frees it. The Hermes plugin uses the higher-level, process-global aphrodite_hermes_* ABI in the aphrodite-hermes crate.

Re-exports§

pub use preview::build_preview;
pub use preview::detect_type;

Modules§

catalog
Catalog generation - port of plugins/aphrodite/_hooks/catalog.py
config
CLI configuration for aphrodite.
config_loader
TOML config loader - port of plugins/aphrodite/_core/config.py
directives
Conversational Directives — lightweight behavioral context for the LLM.
hooks
Full hook implementations - expanded from plugins/aphrodite/_hooks/
marker
CCR marker generation - 1:1 port of plugins/aphrodite/_marker/marker.py
prefetch
Prefetch - background file loading into CCR. Port of plugins/aphrodite/_hooks/prefetch.py
preview
Preview builder: content-type detection and human-readable preview strings for compressed CCR content.
proxy
aphrodite - Reverse proxy with Chat Completions API support.
resolve
CCR marker resolution - port of plugins/aphrodite/_resolve.py
retrieve
/retrieve endpoint - resolve CCR markers to original content.
session
Session lifecycle - port of plugins/aphrodite/_hooks/session.py
setup
Bootstrap setup: aphrodite setup - one-shot install after cargo install aphrodite.
stage2
Stage 2 compression - semantic reduction of CCR-stored content. Port of plugins/aphrodite/_stage2.py
state
Aphrodite internal state - mirrors plugins/aphrodite/_core/state.py All session-scoped state lives here: inline store, conv index, markers, counters.
struct_extract
Code structure extractor - regex-based pattern matching per language. Port of plugins/aphrodite/_core/struct.py

Functions§

aphrodite_call_hook
Deprecated (report 01-T5): stateless, creates a throwaway AphroditeState per call. Use aphrodite_init + aphrodite_dispatch (stateful, handle-based) instead. This stub keeps the ABI symbol alive for any legacy consumer that hasn’t migrated yet.
aphrodite_catalog
aphrodite_classify
aphrodite_compress
aphrodite_config_get
aphrodite_config_set
aphrodite_destroy
aphrodite_directive
aphrodite_dispatch
Universal hook dispatcher. Python calls this for every hook handler. Returns JSON-wrapped result or raw string if content-only.
aphrodite_filter_lines
Filter lines by query - port of _resolve.py _filter_lines
aphrodite_free_string
aphrodite_hooks
aphrodite_init
aphrodite_preview
Generate preview for content - port of _marker/preview.py
aphrodite_reload
aphrodite_resolve
Resolve hash with full recursive expansion - port of _resolve.py
aphrodite_retrieve
aphrodite_search
aphrodite_session_start
aphrodite_stage2
Stage 2 semantic reduction - port of _stage2.py
aphrodite_stats
aphrodite_struct_extract
Code structure extraction - port of _core/struct.py
aphrodite_terminal
aphrodite_transform
aphrodite_version