| Crates.io | ubl-office |
| lib.rs | ubl-office |
| version | 0.1.1 |
| created_at | 2026-01-10 17:50:29.329406+00 |
| updated_at | 2026-01-10 18:01:55.018439+00 |
| description | Execution environment for LogLine Agents: lifecycle, memory, and I/O coordination. |
| homepage | https://logline.foundation |
| repository | https://github.com/LogLine-Foundation/logline-workspace |
| max_upload_size | |
| id | 2034472 |
| size | 68,865 |
The Agent Runtime (Wake · Work · Dream)
Run agents like reliable services, not fragile notebooks.
ubl-office is the execution environment for LogLine agents. It coordinates thinking (TDLN), acting (MCP tools), memory, and policy (Gate) under one tight loop. No root access, no mystery state, no shrug emojis.
CognitiveContext (system directive, recall, constraints)tdln-brain to produce a strict SemanticUnit (TDLN AST)tdln-gate → Permit | Deny | Challengeubl-mcp (MCP tools)use ubl_office::{Office, OfficeConfig, OfficeState};
use tdln_brain::MockBackend;
use serde_json::json;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// 1) Create brain (mock for testing)
let brain = MockBackend::with_intent("greet", json!({"name": "world"}));
// 2) Configure office
let config = OfficeConfig {
tenant_id: "my-agent".into(),
max_steps_before_dream: 10,
step_pause_ms: 100,
..Default::default()
};
// 3) Create office
let (mut office, state_rx) = Office::new(config, brain);
// 4) Open and run a step
office.open().await?;
assert_eq!(office.state(), OfficeState::Active);
let intent = office.step(Some("hello")).await?;
println!("Got intent: {:?}", intent);
// 5) Check metrics
println!("Steps: {}", office.metrics().steps_total);
println!("Decisions: {}", office.metrics().decisions_total);
Ok(())
}
enum OfficeState {
Opening, // Bootstrapping
Active, // OODA loop running
Maintenance, // Dreaming / consolidation
Closing, // Shutdown with flush
}
struct OfficeConfig {
tenant_id: String, // Agent identity
constitution_path: Option<PathBuf>, // Policy file
workspace_root: PathBuf, // Working directory
model_id: String, // Brain model ID
max_steps_before_dream: u64, // Steps before maintenance
step_pause_ms: u64, // Delay between steps
max_consecutive_errors: u32, // Error threshold
}
impl Office<B: NeuralBackend> {
fn new(config: OfficeConfig, brain: B) -> (Self, Receiver<OfficeState>);
async fn open(&mut self) -> Result<(), OfficeError>;
async fn step(&mut self, input: Option<&str>) -> Result<Option<SemanticUnit>, OfficeError>;
async fn dream(&mut self) -> Result<(), OfficeError>;
async fn run(self) -> Result<(), OfficeError>;
fn shutdown(&mut self);
}
impl MemorySystem {
fn remember(&mut self, note: impl Into<String>);
fn recall(&self, signal: &str) -> Vec<String>;
fn consolidate(&mut self, events: &[String]);
}
| Error | Meaning |
|---|---|
Brain(msg) |
Cognition/LLM error |
Gate(msg) |
Policy violation |
Tool(msg) |
MCP tool error |
Io(msg) |
File/network error |
Config(msg) |
Configuration error |
Shutdown |
Clean shutdown requested |
#![forbid(unsafe_code)]MIT — See LICENSE