Crate ubl_office

Crate ubl_office 

Source
Expand description

ubl-office — 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.

§What it does (in one screen)

  • Boot: load identity/constitution, attach transports, warm caches
  • Orient: build a typed CognitiveContext (system directive, recall, constraints)
  • Decide: call tdln-brain to produce a strict SemanticUnit (TDLN AST)
  • Gate: run tdln-gate → Permit | Deny | Challenge
  • Act: execute via ubl-mcp (MCP tools)
  • Dream: consolidate short-term into durable memory; compact context; keep it fresh
  • Repeat, with backpressure, watchdog timers, exponential backoff on failure

§Mental Model

┌────────────┐  prepares   ┌──────────────┐  thinks   ┌──────────────┐   acts    ┌──────────────┐
│ Narrator   ├────────────▶│ ContextFrame ├──────────▶│ tdln-brain   ├──────────▶│ ubl-mcp/tools│
└────┬───────┘             └──────┬───────┘           └──────┬───────┘           └──────┬───────┘
     │                            │                          │                          │
     │ recall                     │ handover                 │ decision                 │ receipts
     ▼                            ▼                          ▼                          ▼
┌────────────┐              ┌──────────────┐           ┌──────────────┐          ┌──────────────┐
│ Memory     │◀─────────────│ UBL Ledger   │◀─────────▶│ TDLN Gate    │          │ UBL Ledger   │
└────────────┘              └──────────────┘           └──────────────┘          └──────────────┘

§Example

use ubl_office::{Office, OfficeConfig, OfficeState, SessionType, SessionMode};

let config = OfficeConfig {
    session_type: SessionType::Work,
    session_mode: SessionMode::Commitment,
    ..Default::default()
};
// Office::new(config, brain) to start

Structs§

DecisionReceipt
Receipt for an agent decision.
DreamConfig
Dreaming (maintenance) configuration.
DreamReceipt
Receipt for dreaming/maintenance.
HandoverReceipt
Receipt for handover (session pause/end).
MemorySystem
Memory system for agent state.
Narrator
Narrator builds cognitive context for the brain.
NarratorConfig
Narrator configuration.
NoopHooks
No-op hooks implementation.
Office
The Office runtime.
OfficeConfig
Runtime configuration.
OfficeMetrics
Structured metrics for the runtime.
QuotaBreachReceipt
Receipt for quota breach.
TokenBudget
Token budget configuration.
ToolCallReceipt
Receipt for a tool call.
TracingHooks
Tracing-based hooks (logs events via tracing).

Enums§

OfficeError
Errors from the Office runtime.
OfficeState
Agent lifecycle states.
SessionMode
Session mode determines commitment level.
SessionType
Session type determines allowed behaviors.

Traits§

OfficeHooks
Trait for receiving Office lifecycle events.