INDEX 11 / 14

TOOLS // THE AGENT'S HANDLES

Thirteen tools

A tool call's output becomes part of the model's context, and every one of these handles exists to decide what of it the model keeps.

Each is a thin relay into the Rust dylib: the plugin registers each tool from the dylib's schema list, and every call dispatches through aphrodite_hermes_dispatch_tool, returning the JSON result verbatim.

It is the reason all handlers share one session store: content compressed by a hook or by aphrodite_compress stays resolvable by aphrodite_retrieve for the life of the session.

01 // REGISTRY // 13 ENTRIES

Every handle, one relay

Each row is one registered handle: the identifier the agent types, the side of the session store it moves, the arguments its schema declares, and the sentence the schema gives it. The door chip's colour is the family and not a rank - teal reads, canary writes, and bone is the engine tuning itself.

#HandleDoorArgsWhat the model reads
01aphrodite_retrievePull3 args

Expand a CCR marker, or read a file, to full content.

02aphrodite_compressStore3 args

Store content in CCR and get a marker back.

03aphrodite_statsStatusNo args

Session and proxy health counters for the CCR engine.

04aphrodite_rebuildStatusNo args

Report dylib version and proxy health.

Reports state; it never rebuilds anything, whatever the name suggests.

05aphrodite_filesStatusNo args

List file paths touched this session.

06aphrodite_diffStatusNo args

Per-turn history of what was compressed.

07aphrodite_searchFind2 args

Find already-compressed entries by keyword or type.

08aphrodite_directiveTune2 args

Inspect or change the active behavioral directives.

09aphrodite_testTest1 args

Smoke-test the compress and retrieve round trip.

10aphrodite_catalogStatus1 args

List every CCR entry recorded this session.

11aphrodite_reclassifyRe-type1 args

Re-detect type and preview for stored entries.

12aphrodite_prefetchPreload1 args

Read files now and store them as CCR markers.

13aphrodite_prefetch_statusStatusNo args

List prefetched files that are resolvable now.

Live prefetch schedule - what is loaded and ready, not what was once asked for.

THERE IS AN INTERNAL 14TH REGISTRY ENTRY, context_engine_pre_llm - THE CONTEXT ENGINE'S OWN PRE-LLM HOOK, NOT A TOOL AN AGENT CALLS DIRECTLY. aphrodite_debug is compiled in under debug_assertions only: a real schema, not a registered tool, so it is named rather than counted.

direction B - HTTP relay on :9798direction A - in-processPOST /tool/relayno callbackhttps callback_urlasync - 5 s, fireand forgetagentpython shimaphrodite_hermes_dispatch_toolRust dylibcallertool relaysynchronous resultcallback delivery13 toolsone shared session storeaccepts only retrieve,compress and listretrieve without a hash: 400callback must be httpsmarkers do not survivea session restart
M4 // TOOL RELAY

02 // CONTRACT // THE MARKER

THE MARKER

<<<CCR:hash|type|size>>>
PayloadMARKER What the model receivesPREVIEW What it already reads
Build log 124 lines · 4,247 bytes
<<< CCR: a1b2c3d4... |build|4247 >>>
[build:4E 1W 124L | error[E0432]: unresolved import `crate::store::SessionStore`]
Test run 14 lines · 1,036 bytes
<<< CCR: e5f6a7b8... |terminal|1036 >>>
[terminal:14L exit code: 0]

A marker and its preview are two views of one payload, so both are computed from the same bytes: the hash addresses the stored output, the type is the classifier's verdict, and the size is the UTF-8 byte count of the bytes behind the hash - which is what a retrieval of that marker puts back into the transcript, not an estimate of it. The preview beside each one comes from the engine's own builders, so its tallies are the payload's own: the build-log sample counts four error lines, one warning line and every line it printed, and the test run reports the exit code of the last line it printed.

Both payloads clear their gate before either becomes a marker - 4,096 characters for a tool result, 1,024 for terminal output - because below the gate the engine passes the bytes through raw and no marker exists at all. Every figure here is the payload's own length rather than a typed number, so a change to the output moves the preview, the tallies and the size together.

  • BLAKE3 hash - pattern ^^[0-9a-fA-F]{8,64}$ ; truncated hashes never resolve, exact match only.
  • Byte-exact round-trip - aphrodite_retrieve returns the original bytes, nested markers expanded recursively.
  • Workspace-confined reads - path reads are capped at 10 MiB and refuse paths outside the workspace.
  • Markers don't survive a session restart - the dylib is loaded once per process, so a new session starts a fresh store.
two layouts<<<CCR:hash|type|size>>>hash - the BLAKE3 digestfirst 40 lowercase hex160 bitsinline-only entries carrythe i: prefix and at least 6 hextype - one of thethree classifiers' outputssize - the originalcontent bytesretrieval is an exactfull-hash match only -no prefix, no fuzzythe entry points tolerate atrailing echo or whitespaceproxy: preview first,then the marker linehook / FFI: marker first,then the preview and metacapped at 300 chars
M6 // MARKER FORMAT

03 // SCHEMAS // EVERY ARGUMENT

SCHEMAS // EVERY TOOL

Each panel is the schema the agent is handed: the description it reads, then every argument with its type and its own sentence. None of it is retyped - the schema is rendered straight from schemas.rs, so an argument added to a tool appears without an edit.

01

aphrodite_retrieve

Pull 3 args
"hash": { string · pattern ^[0-9a-fA-F]{8,64}$ · optional }
Full hex hash from a `<<<CCR:hash|type|size>>>` marker. Truncated hashes do not resolve - exact match only.
"query": { string · optional }
Case-insensitive substring; only lines containing it are returned.
"path": { string · optional }
Workspace-relative or absolute file path to read directly, bypassing CCR.

Expand a CCR marker, or read a file, to full content. Supply `hash` to resolve a marker recorded this session (nested markers are expanded recursively), or `path` to read a file straight from disk. Give one or the other - if both are present `path` wins. `path` reads are confined to the current workspace and capped at 10 MiB, so paths outside it are refused. `query` narrows the result to matching lines, which is the cheap way to poke at a large entry without pulling all of it into context. Returns {found: true, source: "ccr"|"path", hash|path, content} on success, {found: false, error} when the hash is unknown or the read is refused.

Give hash or path - if both are present, path wins.

The query parameter is the cheap way to poke at a large entry without pulling all of it into context.

02

aphrodite_compress

Store 3 args
"content": { string · minLength 1 · required }
Exact text to store. Round-trips byte-for-byte through aphrodite_retrieve.
"type": { string · enum: code | log | diff | error | json | build_output | text · optional }
Content-type hint that steers the preview and compression profile. Omit to auto-detect; "text" is treated as no hint.
"_ccr_center": { string · optional }
Optional label carried alongside the marker and echoed back by aphrodite_catalog - useful for tagging what a stored blob was for.

Store content in CCR and get a marker back. Hashes the content, classifies it (or trusts the `type` hint), keeps it in the session store, and hands back a resolvable `<<<CCR:hash|type|size>>>` marker - park bulky text here instead of carrying it in context, then pull it back with aphrodite_retrieve when you actually need it. Storage is in-process and sub-millisecond; markers stay resolvable for the life of the session but do not survive a process restart. Returns {hash, type, size, preview, marker}.

Hashes the content, classifies it (or trusts the type hint), keeps it in the session store, and hands back a resolvable marker - park bulky text here instead of carrying it in context.

03

aphrodite_stats

Status No args
takes no arguments

Session and proxy health counters for the CCR engine. One call covers both halves of the system: session state held by the dylib, and a live TCP poll of the two proxy ports. Takes no arguments. Returns {version, engine, inline_entries, markers, referenced_files, archived_turns, turn, engine_enabled, threshold_pct, tool_threshold, terminal_threshold, proxies: {token: {port, alive}, cache: {port, alive}}}. `alive: false` means nothing answered on that port within 400ms - the plugin still works, it just is not proxying.

04

aphrodite_rebuild

Status No args
takes no arguments

Report dylib version and proxy health. It does not rebuild or install anything - the loaded dylib cannot safely replace itself mid-session - it reports the state an operator needs plus the command to run outside the session. Takes no arguments. Returns {status: "ok", version, proxies, hint}.

05

aphrodite_files

Status No args
takes no arguments

List file paths touched this session. Populated as tool hooks observe reads, writes and prefetches, so it doubles as a record of what has already been looked at. Takes no arguments. Returns {total, files: [{path, tool}]} where `tool` is the tool that first referenced the path.

06

aphrodite_diff

Status No args
takes no arguments

Per-turn history of what was compressed. Walks the archived conversation index in turn order, one entry per turn that produced a compression. Takes no arguments. Returns {total, turns: [{turn, hash, summary, size}]}; each `hash` is resolvable through aphrodite_retrieve.

08

aphrodite_directive

Tune 2 args
"action": { string · enum: list | swap | add | load | remove | reset · default list · optional }
What to do. Defaults to `list`. `load` activates a directive just-in-time (lazy activation).
"name": { string · optional }
Directive name. Required for swap, add, load and remove; ignored by list and reset.

Inspect or change the active behavioral directives. Directives are short instruction files injected into every turn through pre_llm_call - "focus" for terse, minimal-tool execution, "explore" for broad reading, "lazy" for defer-until-needed execution, and whatever else ships in directives/. `list` returns {available, active, ephemeral: [{name, inline, expires_after_turn}]}; `swap` replaces the whole active set with one directive and returns {swapped, active}; `add` appends to the set (silent if already active) and returns {active}; `load` activates a directive from the available set on demand and returns {loaded, active} (errors on an unknown name, unlike `add`); `remove` drops one and returns {active}; `reset` clears actives, ephemerals and the manual latch, handing control back to automatic selection. An unknown directive name returns {error} and changes nothing.

09

aphrodite_test

Test 1 args
"mode": { string · enum: quick | full · default quick · optional }
`quick` runs 1 sample (source code). `full` runs 3 (source code, build output with errors and warnings, JSON). Any unrecognized value behaves like `full`.

Smoke-test the compress and retrieve round trip. Compresses built-in samples in-process and checks each one comes back byte-identical, then reports proxy health alongside. Use it to confirm the engine is actually wired up before trusting a marker. Returns {mode, status: "ok"|"fail", passed, total, checks: [{type, hash, roundtrip}], proxies}. `status` is "ok" only when every check round-tripped.

10

aphrodite_catalog

Status 1 args
"mode": { string · enum: full | toc · default full · optional }
`full` includes turn and center per entry. `toc` is the compact table-of-contents form.

List every CCR entry recorded this session. The complete inventory, newest first - unlike aphrodite_search it filters nothing, so this is the reliable way to find a marker you half-remember. Returns {mode, total, turn, items: [...]}, where each item is {hash, type, size, preview} in `toc` mode and additionally {turn, center} in `full` mode.

11

aphrodite_reclassify

Re-type 1 args
"hash": { string · pattern ^[0-9a-fA-F]{8,64}$ · optional }
Reclassify only this entry. Omit to reclassify every entry in the session.

Re-detect type and preview for stored entries. Re-runs classification against content already in the store and rewrites the catalog entry in place, which repairs entries that were typed before a classifier improvement or stored with a wrong hint. Content and hashes are never modified, so existing markers keep resolving. Returns {status: "ok", reclassified: <count>}.

12

aphrodite_prefetch

Preload 1 args
"paths": { array · required }
File paths to read and store. Absolute paths are safest; relative paths resolve against the session working directory.

Read files now and store them as CCR markers. Despite the name this is synchronous: every path is read and compressed before the call returns, so each returned hash is immediately resolvable through aphrodite_retrieve. Batch the files you expect to need next instead of reading them one at a time - one call, one marker per file, no file bodies in context. Oversized files are skipped rather than truncated. Returns {total, loaded, skipped_size, missing, inline_store_bytes, inline_store_byte_budget, results: [{path, status: "loaded"|"skipped"|"missing", hash, type, size, preview, reason}]}. Watch inline_store_bytes against its budget: a batch larger than the budget evicts older entries, including ones from the same batch.

13

aphrodite_prefetch_status

Status No args
takes no arguments

List prefetched files that are resolvable now. Because prefetch is synchronous, `loading` and `errors` are always empty and anything tracked is already `ready` - this is an inventory of file-backed markers, not a progress bar. Takes no arguments. Returns {loading: [], ready: [{path, hash, type, size}], errors: [], total_ready}.

04 // RULE // META-TOOLS

Meta-tool output is auto-expanded

Output from meta-tools (like aphrodite_stats or aphrodite_catalog) is expanded inline, never compressed - the agent always sees its own engine's status in full.

Compressing the catalog would just be the engine hiding its own ledger.