A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.
Rust agentagent-orchestrationaiai-agentsclaude-codecodexcoding-agentlinuxmacosmultiplayermultiplexerrustterminalterminal-emulatorterminal-multiplexertmuxtuiweztermwindows
Merge pull request #10 from Mirr0ch1/feat/omp-agent-status
RoversX8650370be6a6
diff --cc NOTICEindex 5adca50c,871e5b3a..aa5766a0--- a/NOTICE+++ b/NOTICE@@@ -26,10 -26,10 +26,11 @@@ included at mux/src/agent_status/manifecarries an attribution header naming the upstream commit it was takenfrom.- One manifest, mux/src/agent_status/manifests/codebuddy.toml, is not from-One manifest, mux/src/agent_status/manifests/omp.toml, is not from--herdr: it was authored by ThinkTerm's contributors and is distributed--under this repository's own license. Its header records that, and where--each of its detection signals came from.++Two manifests, mux/src/agent_status/manifests/codebuddy.toml and++mux/src/agent_status/manifests/omp.toml, are not from herdr: they were++authored by ThinkTerm's contributors and are distributed under this++repository's own license. Each one's header records that, and where each++of its detection signals came from.---diff --cc docs/agent-status.mdindex ff12a803,bb5053b0..12361d3a--- a/docs/agent-status.md+++ b/docs/agent-status.md@@@ -1,10 -1,10 +1,11 @@@# Agent Status Protocol-ThinkTerm can track the state of coding agents (Claude Code, Codex, Oh My-PI, Pi, OpenCode, …) running in its panes: **working**, **blocked**-(waiting for a user decision), or **idle**. The state feeds the thread-status indicators in the left sidebar and the Agents panel in the right-sidebar (Settings → Agents → *Agent Panel*, off by default).+ThinkTerm can track the state of coding agents (Claude Code, CodeBuddy- Code, Codex, Pi, OpenCode, …) running in its panes: **working**,- **blocked** (waiting for a user decision), or **idle**. The state feeds- the thread status indicators in the left sidebar and the Agents panel in- the right sidebar (Settings → Agents → *Agent Panel*, off by default).++Code, Codex, Oh My PI, Pi, OpenCode, …) running in its panes:++**working**, **blocked** (waiting for a user decision), or **idle**. The++state feeds the thread status indicators in the left sidebar and the++Agents panel in the right sidebar (Settings → Agents → *Agent Panel*,++off by default).Detection arbitrates three signal layers, strongest contract first:@@@ -117,44 -117,40 +118,70 @@@ reports back over `thinkterm cli` — hterminal sequence. (No such subcommand exists yet; `thinkterm cli agent`is query-only today.)+## CodeBuddy Code integration++Screen rules only — there is nothing to install. CodeBuddy Code reports+its run state through its OSC 0 title, which it rewrites whenever the+state changes: while a turn runs the title starts with one of ten Braille+spinner frames it advances every 200 ms, and when the turn ends the same+prefix becomes a static idle marker. Its npm shims (`codebuddy`,+`codebuddy-code`, `cbc`) are `#!/usr/bin/env node` scripts, so the pane's+foreground leader is the runtime and the agent is identified from the+shim path in `node`'s argv. Both directions of the title marker are used:+the spinner frames read as **working** and the static marker as **idle**,+so on the common path nothing has to be inferred from redrawn content at+all. Screen rules cover what the title does not speak for — the thinking+heading and MCP startup, both of which run before the title moves — and+both of its dialogs read as **blocked**: the permission prompt, which+always numbers its choices and offers "1. Yes", and the+`AskUserQuestion` panel, whose footer offers "Enter to select" beside+"Esc to cancel" for as long as it is open (its free-text row cannot be+used for this, because it turns into the user's own text as they type).+The turn's spinner stays on the title while either dialog waits, so both+blocker rules outrank the title's working rule.++Identity needs process visibility. A pane whose foreground program is+`ssh` only sees `ssh`; CodeBuddy runs on the remote host, so a bare SSH+pane gets no row (the same holds for any agent identified by its+process). Run it in a mux-domain pane — detection then happens on the+host that owns the pane and the state is mirrored to the client — or+have the agent report `THINKTERM_AGENT` itself, as OpenCode does.++ ## Oh My PI (OMP) integration++ Screen rules plus native OSC 7501 — there is nothing to install. OMP+ (`omp`, npm `@oh-my-pi/pi-coding-agent`) is a Pi fork that reports its run+ state twice: it writes the OSC 7501 root record+ (`state=working/idle/blocked:app=omp`), which ThinkTerm consumes+ directly, and it carries the same state in its OSC 0 title. The title is+ `π > …` when it is your turn, `π <spinner> …` while a turn runs, and+ `π ! …` when it is waiting on you; the spinner follows+ `tui.titleSpinner` (Braille by default, with pulse, dots, and ASCII line+ alternatives). The manifest reads all four styles.++ The title is not just a duplicate of the report. OMP's shell tool emits+ nested OSC 133 command markers, and ThinkTerm reads the `133;A` marker as+ the pane shell's prompt and retires the OSC 7501 record — the same thing+ it does when a real shell gets its prompt back. Without a second signal+ the row would disappear for the rest of the turn and return only when+ OMP reported idle again. The process name and the title keep the pane+ identified and classified through that gap. Keep `tui.titleState` on (the+ default); with it off the title is `π: …` and only OSC 7501 can classify.++ As with every process-identified agent, a bare SSH pane gets no row: the+ local pane's foreground program is `ssh`, not `omp`. Run OMP in a+ mux-domain pane — detection happens on the host that owns the pane — or+ on the machine that owns the pane.+## Screen-rule manifestsBundled manifests live in the ThinkTerm source under`mux/src/agent_status/manifests/` and are sourced from the[herdr](https://github.com/herdrdev/herdr) project (Apache-2.0), except- `codebuddy.toml`, which is authored here because herdr has no manifest- for that agent. The format is herdr's agent-detection manifest format; a- user override for an agent replaces the bundled file of the same id- wholesale.-`omp.toml`, which is authored here because herdr has no manifest for that-agent. The format is herdr's agent-detection manifest format; a user-override for an agent replaces the bundled file of the same id wholesale.++`codebuddy.toml` and `omp.toml`, which are authored here because herdr++has no manifest for those agents. The format is herdr's agent-detection++manifest format; a user override for an agent replaces the bundled file++of the same id wholesale.The `osc_title` and `osc_progress` regions see only what the applicationactually emitted: both are empty until an OSC title / OSC 9;4 progressdiff --cc mux/src/agent_status/engine.rsindex fdfaef42,47ebaafb..aeb1ff3d--- a/mux/src/agent_status/engine.rs+++ b/mux/src/agent_status/engine.rs@@@ -166,9 -166,9 +166,10 @@@ const BUNDLED_MANIFESTS: &[&str] = &include_str!("manifests/opencode.toml"),include_str!("manifests/kimi.toml"),// Hand-authored here rather than sourced from herdr, which carries no-- // manifest for it; the file's header records where its signals came-- // from.++ // manifest for these two; each file's header records where its signals++ // came from.+ include_str!("manifests/codebuddy.toml"),+ include_str!("manifests/omp.toml"),];static MANIFESTS: RwLock<Option<HashMap<String, CompiledManifest>>> = RwLock::new(None);diff --cc mux/src/agent_status/mod.rsindex f98688fa,c91eb23e..815a355f--- a/mux/src/agent_status/mod.rs+++ b/mux/src/agent_status/mod.rs@@@ -25,9 -25,9 +25,11 @@@ pub mod enginemod hysteresis;pub mod identify;mod proc_match;+#[cfg(test)]+mod manifest_tests;mod windows_select;+ #[cfg(test)]+ mod omp_tests;use crate::pane::{Pane, PaneId};use crate::{Mux, MuxNotification};