Expand description
The activity stream of LeanCTX | OSS: one host-neutral, bounded event log
per agent session (session id, agent, project root), fed by host hooks,
LeanCTX MCP calls and ACP client callbacks, read by lean-ctx activity list --json (Local Read v1, docs/contracts/local-read-v1.md).
The crate never depends on the engine: the engine’s facade
(core::activity) supplies the data directory and the secret redaction.
Structs§
- Draft
- What a producer reports; the store adds
seqandat, redacts and bounds. - Event
- One stored event: one line of a session’s log, and one item of
activity.list(Local Read v1). - Filter
- What a listing selects.
sessionandproject_rootnarrow, both may be given; with neither the listing is empty. - Listing
- A listing: the newest
limitmatches, sorted oldest → newest. - Store
- The activity store under one root directory.
Enums§
- Kind
- What happened.
- Outcome
- How a tool call, shell command or permission prompt ended.
- Source
- Who reported the event.
Constants§
- DEFAULT_
LIMIT - Events returned when no
limitis given. - MAX_
LABEL_ BYTES - Longest label kept (session id, agent, tool name), in bytes.
- MAX_
LIMIT - The largest
limita listing accepts. - MAX_
ROOT_ BYTES - Longest project root kept, in bytes.
- MAX_
SESSIONS_ PER_ PROJECT - Sessions kept per project (most recently written).
- MAX_
SESSION_ BYTES - A session log larger than this keeps its newest half.
- MAX_
SESSION_ ID_ BYTES - Longest accepted id.
- MAX_
SESSION_ NAME_ CHARS - Longest accepted session name, in characters.
- MAX_
TARGET_ BYTES - Longest target kept (path, redacted shell command, URL, query), in bytes.
- MAX_
TEXT_ BYTES - Longest message text kept (user or agent message, permission prompt, error), in bytes; longer text is cut at a char boundary.
- SESSION_
ENV - Environment variable naming the app’s session (
LEAN_CTX_SESSION_ID). - SESSION_
HEADER - Request header naming the app’s session at the proxy.
- SESSION_
NAME_ ENV - Environment variable naming the app’s session for people
(
LEAN_CTX_SESSION_NAME, e.g. “LeanCTX · Contracts”): shown on the bus presence, never used to attribute or authorize anything.
Functions§
- session_
id rawas a session id: trimmed, 1–128 bytes of[A-Za-z0-9._:-]; anything else is no id (ignored, never an error).- session_
id_ from_ env - The app session id of this process (
SESSION_ENV), if valid. - session_
name rawas a session name: trimmed, 1–128 characters, no control characters; anything else is no name (ignored, never an error).- session_
name_ from_ env - The app session name of this process (
SESSION_NAME_ENV), if valid.