lcc — Local Context Compiler

v1.2.0
io.github.lucasmartins-ai/lcc Checked 15 hours ago Published 1 month ago

Compact agent context verbatim, offline: cut spent tool outputs, recall them by hash.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

compact

Drop context blocks irrelevant to an objective. Default provider mechanical is fully offline (no key, no network); laya is offline semantic (needs the [laya] extra, else honest mechanical fallback); jev needs TYPESAFE_API_KEY. Fail-safe: failures keep content.

ParameterTypeDescription
question *string
text *string
providerstring
thresholdnumber

compact_transcript

Tool-call compaction for a session transcript: pairs each tool call with its result, pins the first and newest messages, and drops the pairs a semantic judge says are spent — kept messages stay verbatim, so nothing is summarized. Default 'auto' is the local specialist-v3 ranker (offline, no key); 'jev' is remote and needs TYPESAFE_API_KEY. Every failure keeps the call.

ParameterTypeDescription
messages *arrayMessages with role/text and toolUses/toolResults blocks (Claude Code hook shape) or tool_calls/tool_results.
question *string
allow_command_pointersbooleanrules_mode 'recoverable' only: also replace allowlisted read-only command outputs with a re-run pointer. Off by default.
disk_checkboolean
idle_gap_bucketstringRequest-log label only: the idle gap bucket, e.g. '1h-2h'.
jev_modelstring
laya_modelstring
max_request_tokensinteger
max_state_tokensinteger
max_workersinteger
min_reductionnumber
preserve_recentinteger
providerstring'auto' (default) and 'specialist-v3' use the local CPU ranker (no key, no network; ranks, does not judge). 'jev' is the remote TypeSafe System 1, needs TYPESAFE_API_KEY, and runs only when named. 'lay…
ref_blocksbooleanref_unchanged down to the block: a changed message comes back as {'ref': <input index>, 'toolUses': [<kept call index>...], 'toolResults': [<kept result index> | {'ref', 'tool_use_id', 'text', 'head'?…
ref_unchangedbooleanReturn each message the pass left unchanged as {'ref': <input index>} and leave per-call decisions out, for size-capped callers.
rules_modestringOnly for provider 'rules'. 'lossless' replaces a tool result with a pointer only when its text is kept verbatim in a later result, and verifies it. 'recoverable' also replaces old file reads (of files…
thresholdnumber
triggerstringRequest-log label only: 'idle' for the plugin's idle stash.
trim_head_charsinteger
workspace_rootstringrules_mode 'recoverable' only: the session's working directory. When set (and disk_check on), the disk decides file pointers: a read is replaced iff the file inside it (or its own directory) currently…

inspect

Read-only diagnostic inspection of a text: tokens, structure, duplication, cleanup projection, and recommendation. Offline.

ParameterTypeDescription
text *string

prepare

Inspect-first deterministic prompt preparation: runs inspection, then lexical selection + safe optimization only when recommended. Never summarizes or paraphrases. Offline.

ParameterTypeDescription
text *string
questionstring

explain

Explain a relevance-compaction report (as produced by compact): why every block was kept, trimmed, or dropped. Never re-runs, never touches the network.

ParameterTypeDescription
report *object
limitinteger
onlystring
source_textstring

recall

Return a tool output that compact_transcript (rules_mode 'stashed') replaced with '[removed: N tokens · lcc recall <id>]'. The bytes are re-hashed on read, so the text is exactly what was removed. Offline, local stash only.

ParameterTypeDescription
id *stringThe hex id from the pointer.
linesstringOptional 1-based range 'a-b'.

intake

Intake triage for raw prompt input: readiness, intent, clarifying questions, assumptions, and a compiled prompt. Offline by default.

ParameterTypeDescription
text *string
questionstring