TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
tmk::session::Session Class Reference

#include <session/session.hpp>

Classes

struct  Replay
 Runs the calls of a log written by SessionOptions::log and stops at the first result or state digest that differs. More...

Public Member Functions

 Session (SessionOptions opt)
 Reads the board and its rules. Throws on an unreadable board.
nlohmann::json call (const std::string &tool, const nlohmann::json &args)
 One tool call (doc 19 §4). Deterministic: the result depends on the board, the state, the arguments and the seed only.
Replay replay (const std::string &log_path)
int state () const
std::string state_digest () const
 FNV-1a 64 of the current state's session copper in canonical order (a digest, not a cryptographic hash).
const model::Board & base () const
long work_used () const

Static Public Member Functions

static nlohmann::json tools ()
 The tools as MCP descriptors {name, description, inputSchema}, and the text the server sends as instructions.
static const char * instructions ()

Detailed Description

Definition at line 38 of file session.hpp.

Constructor & Destructor Documentation

◆ Session()

tmk::session::Session::Session ( SessionOptions opt)
explicit

Reads the board and its rules. Throws on an unreadable board.

Member Function Documentation

◆ base()

const model::Board & tmk::session::Session::base ( ) const
inline

Definition at line 61 of file session.hpp.

◆ call()

nlohmann::json tmk::session::Session::call ( const std::string & tool,
const nlohmann::json & args )

One tool call (doc 19 §4). Deterministic: the result depends on the board, the state, the arguments and the seed only.

◆ instructions()

const char * tmk::session::Session::instructions ( )
static

◆ replay()

Replay tmk::session::Session::replay ( const std::string & log_path)

◆ state()

int tmk::session::Session::state ( ) const
inline

Definition at line 58 of file session.hpp.

◆ state_digest()

std::string tmk::session::Session::state_digest ( ) const

FNV-1a 64 of the current state's session copper in canonical order (a digest, not a cryptographic hash).

◆ tools()

nlohmann::json tmk::session::Session::tools ( )
static

The tools as MCP descriptors {name, description, inputSchema}, and the text the server sends as instructions.

◆ work_used()

long tmk::session::Session::work_used ( ) const
inline

Definition at line 62 of file session.hpp.


The documentation for this class was generated from the following file: