colibri/docs/CLAWDIE-AGENT-WIKI.md
Sam & Claude aea2fbe60e feat: add clawdie — simplified operator agent in one small binary (Sam & Claude)
New `clawdie` crate: the operator-friendly face of Colibri. One small Rust
binary that reuses the proven control-plane core (glasspane supervision +
Herdr Unix-socket API + coordination loop — the "split brain") and puts a
DeepSeek-backed Telegram bot in front of it. That is the entire out-of-the-box
surface.

Deliberately lifted vs. the full control plane: cost modes, quota accounting,
context budgets, multi-provider fallback (OpenRouter/Anthropic), per-user
limits. One DeepSeek key serves both the chat lane and the daemon routing.

- crates/clawdie: main (core + bridge wiring), telegram (long-poll bridge),
  deepseek (minimal one-key chat), build.rs (bakes CLAWDIE_TG_TOKEN +
  CLAWDIE_DEEPSEEK_KEY build flags; runtime env overrides).
- packaging/freebsd/clawdie.in: rc.d service, daemon(8)-supervised, restart on
  crash, dedicated clawdie user — starts as a service like Clawdie-AI.
- release profile strips symbols (binary ~7.6 MB stripped).
- docs/CLAWDIE-AGENT-WIKI.md (mindmap), docs/CLAWDIE-BUILD.md (build + ISO +
  next-build XFCE USB fixes), README workspace table.

Build/clippy/fmt green; headless start smoke-tested (socket + sessions bind).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 08:31:59 +02:00

3.5 KiB

Clawdie Agent — wiki / mindmap

The Clawdie agent is the simplified, operator-friendly face of Colibri: one small Rust binary (clawdie) that ships with exactly two things wired up — a Telegram bot and a DeepSeek lane — sitting on top of the proven control-plane core. Everything heavier (cost modes, quotas, multi-provider fallback) is deliberately lifted.

This is a mindmap-style wiki page (the format from the Herdr/Colibri capability graph work — see HERDR-VS-COLIBRI-GRAPH.md and COLIBRI-GLASSPANE-DESIGN.md).

Mindmap

mindmap
  root((clawdie<br/>one binary))
    Split brain
      Glasspane radar
        5-state machine
        idle/working/blocked/done/error
        derived from Pi JSON events
      Coordination
        task board
        agent registry
        session JSONL
    Front door
      Telegram bot
        long-poll getUpdates
        sendMessage reply
      DeepSeek lane
        one model
        one key
        no fallback
    Build flags
      CLAWDIE_TG_TOKEN
      CLAWDIE_DEEPSEEK_KEY
      baked at compile time
      runtime env overrides
    Lifted (NOT shipped)
      cost modes
      quota accounting
      context budgets
      OpenRouter / Anthropic
      per-user limits
    Runs as a service
      rc.d clawdie
      daemon(8) supervised
      restart on crash
      like Clawdie-AI

What "split brain" means here

Two halves of the same daemon, both kept:

Half Crate / module Job
Glasspane colibri-glasspane + daemon socket The "radar": agent state, panes, supervision snapshot
Coordination colibri-store + daemon loop Task board, agent registry, session lifecycle

The Clawdie agent reuses these as-is over the Herdr Unix-socket API. It adds the Telegram + DeepSeek front door and removes the cost/quota machinery from its own runtime path.

Surface area (the whole product)

graph LR
  tg["Telegram<br/>(CLAWDIE_TG_TOKEN)"] -->|text| clawdie
  clawdie -->|chat| ds["DeepSeek<br/>(CLAWDIE_DEEPSEEK_KEY)"]
  ds -->|reply| clawdie
  clawdie --> gp["glasspane radar"]
  clawdie --> co["coordination board"]
  clawdie -. Herdr socket .- ui["operator tools (colibri CLI / TUI)"]

Files

Path Role
crates/clawdie/src/main.rs Entrypoint: resolve creds, start core + Telegram bridge
crates/clawdie/src/telegram.rs Long-poll bridge
crates/clawdie/src/deepseek.rs Minimal one-key chat lane (no cost/quota)
crates/clawdie/build.rs Bakes the two credentials from build flags
packaging/freebsd/clawdie.in rc.d service (daemon(8)-supervised, like Clawdie-AI)

Credential resolution order

  1. Runtime env (CLAWDIE_TG_TOKEN / TELEGRAM_BOT_TOKEN, CLAWDIE_DEEPSEEK_KEY / DEEPSEEK_API_KEY)
  2. Build-flag baked value (option_env! from build.rs)
  3. Absent → that half stays off (no token = headless control plane only)

One DeepSeek key serves both the Telegram chat lane and the daemon's own provider routing.

See CLAWDIE-BUILD.md for the build + ISO instructions.