Skip to main content

Module buffer_names

Module buffer_names 

Source
Expand description

Canonical synthetic buffer name for the per-process AI log family (AI-1b).

One flavour: *ai:<provider>:<index>* – one buffer per AI agent session, keyed by SessionKey. Mirrors lattice-lsp’s per-instance *lsp:<server>:<workspace>* naming, one level simpler (no trace-variant sibling).

The inverse helper (parse_ai_log_name) extracts the originating SessionKey from a synthetic name so AiLogMode::on_activate can derive its identity from its buffer’s name alone – no buffer-local seeding required.

§Invariant

Provider names never contain : (opencode, claude, gemini). The parser splits on the first colon after *ai:; everything after that up to the trailing * is the index.

Functions§

ai_log_name
Build the synthetic name for the per-session AI log buffer owned by super::modes::AiLogMode.
parse_ai_log_name
Recover the SessionKey from a per-session log buffer name. Returns None when name does not match the canonical *ai:<provider>:<index>* shape.