Skip to main content

Module sessionwiki

Module sessionwiki 

Source
Expand description

Publishing Mjolnir’s own checkpointed sessions into the user’s SessionWiki index, and the daemon-side job that keeps that index current.

SessionWiki keeps one searchable index of AI coding sessions across every tool a user runs. Mjolnir links it as a library and registers MjolnirAdapter beside SessionWiki’s built-in adapters, so a Mjolnir session is searchable next to a Claude Code or Codex one. The adapter is a “shared store” adapter: checkpoints are not one-file-per-session in a shape SessionWiki can parse, so the indexer enumerates sessions by key and asks this adapter to parse the ones whose checkpoint changed.

Structs§

ArchivedSession
What a restore needs from the index: the transcript as a snapshot the compaction pipeline accepts, plus the title and project of the session it came from.
MjolnirAdapter
Mjolnir’s sessions, as SessionWiki sees them.
WikiIndexer
The daemon’s SessionWiki sync job.

Constants§

DEFAULT_WIKI_LIMIT
The page size a caller that names none gets.
MAX_WIKI_LIMIT
The largest page a caller may ask a wiki query for.
SYNC_STALE_AFTER
How stale the index may be before a query triggers a background sync.

Functions§

archived_session
Load one indexed session for restore, or None when the id names none.
brief
The briefing for one indexed session, or None when the id names none.
index_state
What a surface should say about this index right now.
indexed_with_messages
Which of session_ids the index holds under this instance’s own key, with at least one message and not already archived.
query_rows
One page of the index, newest first or best match first.
sessions_ready_to_archive
The stopped sessions that archive_after_days = older_than_days has caught, children before their parents.
sync_is_stale
Whether a query should trigger a bounded background sync before it answers.