theway-daemon 0.1.21

theway daemon — the single agent-runtime kernel (bin `thewayd`): harness assembly, local/sandbox tool policy, triggers/cron/session/DAG runtime, skills, MCP/LSP wiring, serving the gRPC/HTTP/MCP transports from theway-transport. Terminal UI lives in the theway-tui crate.
Documentation
//! Tests for `session_ops` — split out of src (see docs/rust-test-files.md).
//!
//! Shared fixtures live here; each submodule covers one test face:
//! rolling summaries, lifecycle query/mutation ops, and collapse.

use std::collections::HashMap;
use std::sync::Arc;

use tempfile::tempdir;
use theway_contract::session::{SessionReader, SessionStore, StoredSessionEntry};
use theway_core::multiagent::graph::engine::DagEngine;
use theway_core::multiagent::jobs::SubagentJobRegistry;
use theway_storage::session_graph::SessionGraphStore;
use theway_storage::sqlite_repo::SqliteSessionRepo;
use theway_transport::transport::SessionOps;
use theway_transport::wire::WireCollapseSessionRequest;

use crate::runtime_storage::SessionRepository;
use crate::session_execution::SessionExecutionRegistry;
use crate::session_ops::{
    AppSessionOps, ROLLING_SUMMARY_COMPONENTS, read_session_metadata, render_rolling_summary,
};

mod collapse;
mod graph;
mod lifecycle;
mod metadata;
mod summary;
mod wire;

fn ops(repo: Arc<dyn SessionRepository>, _current_id: &str) -> AppSessionOps {
    let engine = Arc::new(DagEngine::new());
    AppSessionOps::new(repo, engine, "/cwd".into(), SessionExecutionRegistry::new())
}

async fn session_id_of(session: &(impl SessionReader + ?Sized)) -> String {
    session
        .get_metadata_json()
        .await
        .unwrap()
        .get("id")
        .and_then(|v| v.as_str())
        .unwrap()
        .to_string()
}