Skip to main content

Module frontmatter

Module frontmatter 

Source

Structs§

Frontmatter
ResolvedMode
Resolved mode pair — the canonical representation after deprecation migration.
StreamConfig
Configuration for stream mode (real-time CRDT write-back).

Enums§

AgentDocFormat
Document format: controls document structure.
AgentDocWrite
Write strategy: controls how responses are merged into the document.

Functions§

ensure_session
Ensure the document has a session ID. If no frontmatter exists, creates one with a new UUID v4. If frontmatter exists but session is None/null, generates a UUID and sets it. If session already exists, returns as-is. Returns (updated_content, session_id).
merge_fields
Merge YAML key/value pairs into a document’s frontmatter.
parse
Parse YAML frontmatter from a document. Returns (frontmatter, body). If no frontmatter block is present, returns defaults and the full content as body.
set_format_and_write
Set both agent_doc_format and agent_doc_write, clearing deprecated agent_doc_mode.
set_resume_id
Update the resume (agent conversation) ID in a document string.
set_session_id
Update the session ID in a document string. Creates frontmatter if missing.
set_tmux_session
Update the tmux_session name in a document string.
write
Write frontmatter back into a document, preserving the body.