ultron-session-core 1.0.0

One session's runtime, shared by every mode through the session worker: the rlm lane (model, provider, system prompt, the single rlm tool), the composition root of its host stack, the format-4 run journal, session naming, Pi read views, and the session actor
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! The counters of a session whose root agent lives outside Ultron: Claude Code calling `rlm` over MCP
//! (session-worker.ts `new SessionStatsRecorder({ root: external === undefined ? "lane" : "external" })`).

use super::SessionStats;
use jsrt::sync;
use serde_json::json;

impl SessionStats {
    /// Count this session as one whose root is `root` (`external` for Claude Code). Called before
    /// [`SessionStats::attach`], it is the root the stored document takes; nothing is saved until a counter changes.
    pub fn set_root(&self, root: &str) {
        sync::lock(&self.shared.state).document["root"] = json!(root);
    }
}