Skip to content

Reason Network: your team's coding agents, talking to each other. The engine behind `reason network`.

Give `tincan who` room to breathe

Lars Taliane19e871ed514
diff --git a/Cargo.lock b/Cargo.lock
index e5c735d..60e19d8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3608,7 +3608,7 @@ dependencies = [
[[package]]
name = "tincan"
-version = "0.5.1"
+version = "0.5.2"
dependencies = [
"anyhow",
"blake3",
diff --git a/Cargo.toml b/Cargo.toml
index 416c977..a700c43 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "tincan"
-version = "0.5.1"
+version = "0.5.2"
edition = "2024"
description = "Team directory and message bus for coding agents across machines"
license = "MIT OR Apache-2.0"
diff --git a/README.md b/README.md
index c36f14f..693f3eb 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ A team directory and message bus for coding agents. Every agent session on every
Code, Codex, Cursor, Gemini CLI, Copilot CLI, opencode, pi, Reason) can see who is working on what right now, and message
the right session directly: across the LAN or the internet, peer to peer, with no server to run.
-<p align="center"><img src="site/who.svg" alt="tincan who in a terminal: alex, alice and sam's agent sessions, how to reach each, and what each is doing" width="820"></p>
+<p align="center"><img src="site/who.svg" alt="tincan who in a terminal: alex, alice and sam's agent sessions, how to reach each, and what each is doing" width="741"></p>
Your agent can then just do `send_message(to="alice/api-cursor", message="I'm changing the token format in
auth/session.rs, heads up")`, and it lands in alice's Cursor session.
diff --git a/site/index.html b/site/index.html
index 64c0cad..dc09030 100644
--- a/site/index.html
+++ b/site/index.html
@@ -43,7 +43,7 @@
<h1>Your team's coding agents, talking to each other.</h1>
<p class="lede">A live directory of every agent session on every teammate's machine (who is working on what, right now), and messages between them. Claude Code, Codex, Cursor, Gemini, Copilot, opencode, pi, Reason. Peer to peer, no server, open source.</p>
-<img class="term" src="who.svg" alt="tincan who in a terminal: alex, alice and sam's agent sessions, how to reach each, and what each is doing" width="869" height="410">
+<img class="term" src="who.svg" alt="tincan who in a terminal: alex, alice and sam's agent sessions, how to reach each, and what each is doing" width="741" height="528">
<h2>Start a team</h2>
<pre><code>curl -fsSL https://asdf9384.github.io/tincan/install.sh | sh</code></pre>
diff --git a/site/who.svg b/site/who.svg
index bd1f6fe..4182046 100644
--- a/site/who.svg
+++ b/site/who.svg
@@ -1,21 +1,21 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 869 410" width="869" height="410" role="img" aria-label="tincan who: every teammate's agent sessions and what each is doing">
-<rect x="0.5" y="0.5" width="868" height="409" rx="12" fill="#16171d" stroke="#2c2e38"/>
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 741 528" width="741" height="528" role="img" aria-label="tincan who: every teammate's agent sessions and what each is doing">
+<rect x="0.5" y="0.5" width="740" height="527" rx="12" fill="#16171d" stroke="#2c2e38"/>
<circle cx="24" cy="22" r="6" fill="#ff5f57"/><circle cx="44" cy="22" r="6" fill="#febc2e"/><circle cx="64" cy="22" r="6" fill="#28c840"/>
<g font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" style="white-space:pre">
-<text x="24" y="62" xml:space="preserve"><tspan fill="#7fd6a4">$ </tspan><tspan fill="#ffffff" font-weight="700">tincan who</tspan></text>
-<text x="24" y="84" xml:space="preserve"><tspan fill="#80838f">team </tspan><tspan fill="#ffffff" font-weight="700">vibes</tspan><tspan fill="#80838f"> · you are alex on mbp</tspan></text>
-<text x="24" y="106" xml:space="preserve"><tspan fill="#ffffff" font-weight="700">alex · mbp ·</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">this machine</tspan></text>
-<text x="24" y="128" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#ffffff" font-weight="700">api-claude </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">claude-code</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#f3c86f">busy 2m </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#d6d7de">acme/api@feat/auth</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#7fd6a4">push</tspan><tspan fill="#d6d7de"> · </tspan><tspan fill="#ffffff" font-weight="700">← you</tspan></text>
-<text x="24" y="150" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">doing: Session token rework · Moving sessions to JWT</tspan></text>
-<text x="24" y="172" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#ffffff" font-weight="700">web-codex </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">codex </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">idle 14m</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#d6d7de">acme/web@main </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#7fd6a4">push</tspan></text>
-<text x="24" y="194" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">doing: Checkout page polish</tspan></text>
-<text x="24" y="216" xml:space="preserve"><tspan fill="#ffffff" font-weight="700">alice · xps ·</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#7fd6a4">direct 4ms</tspan></text>
-<text x="24" y="238" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#ffffff" font-weight="700">api-cursor </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">cursor </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#f3c86f">busy 1m </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#d6d7de">acme/api@main </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#72c8e4">turn</tspan><tspan fill="#d6d7de"> · </tspan><tspan fill="#f3c86f">1 unread</tspan></text>
-<text x="24" y="260" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">doing: Fixing flaky refresh-token test</tspan></text>
-<text x="24" y="282" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#ffffff" font-weight="700">docs-pi </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">pi </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">idle 3m </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#d6d7de">acme/docs@main </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#7fd6a4">push</tspan></text>
-<text x="24" y="304" xml:space="preserve"><tspan fill="#ffffff" font-weight="700">sam · nuc ·</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#f3c86f">relay 38ms</tspan></text>
-<text x="24" y="326" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#ffffff" font-weight="700">infra-reason</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">reason </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#f3c86f">busy 6m </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#d6d7de">acme/infra </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#7fd6a4">push</tspan></text>
-<text x="24" y="348" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">doing: Terraform state cleanup</tspan></text>
-<text x="24" y="370" xml:space="preserve"><tspan fill="#80838f">push = sees messages right away, even when idle · turn = at its next step · pull = when it checks</tspan></text>
+<text x="28" y="66" xml:space="preserve"><tspan fill="#7fd6a4">$ </tspan><tspan fill="#ffffff" font-weight="700">tincan who</tspan></text>
+<text x="28" y="90" xml:space="preserve"><tspan fill="#80838f">team </tspan><tspan fill="#ffffff" font-weight="700">vibes</tspan><tspan fill="#80838f"> · you are alex on mbp</tspan></text>
+<text x="28" y="138" xml:space="preserve"><tspan fill="#7fd6a4">● </tspan><tspan fill="#ffffff" font-weight="700">alex · mbp ·</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">this machine</tspan></text>
+<text x="28" y="162" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#ffffff" font-weight="700">api-claude </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">claude-code</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#f3c86f">busy 2m </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#d6d7de">acme/api@feat/auth</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#7fd6a4">push</tspan><tspan fill="#d6d7de"> · </tspan><tspan fill="#ffffff" font-weight="700">← you</tspan></text>
+<text x="28" y="186" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">↳ Session token rework · Moving sessions to JWT</tspan></text>
+<text x="28" y="210" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#ffffff" font-weight="700">web-codex </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">codex </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">idle 14m</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#d6d7de">acme/web@main </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#7fd6a4">push</tspan></text>
+<text x="28" y="234" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">↳ Checkout page polish</tspan></text>
+<text x="28" y="282" xml:space="preserve"><tspan fill="#7fd6a4">● </tspan><tspan fill="#ffffff" font-weight="700">alice · xps ·</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#7fd6a4">direct 4ms</tspan></text>
+<text x="28" y="306" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#ffffff" font-weight="700">api-cursor </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">cursor </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#f3c86f">busy 1m </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#d6d7de">acme/api@main </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#72c8e4">turn</tspan><tspan fill="#d6d7de"> · </tspan><tspan fill="#f3c86f">1 unread</tspan></text>
+<text x="28" y="330" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">↳ Fixing flaky refresh-token test</tspan></text>
+<text x="28" y="354" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#ffffff" font-weight="700">docs-pi </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">pi </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">idle 3m </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#d6d7de">acme/docs@main </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#7fd6a4">push</tspan></text>
+<text x="28" y="402" xml:space="preserve"><tspan fill="#7fd6a4">● </tspan><tspan fill="#ffffff" font-weight="700">sam · nuc ·</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#f3c86f">relay 38ms</tspan></text>
+<text x="28" y="426" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#ffffff" font-weight="700">infra-reason</tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">reason </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#f3c86f">busy 6m </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#d6d7de">acme/infra </tspan><tspan fill="#d6d7de"> </tspan><tspan fill="#7fd6a4">push</tspan></text>
+<text x="28" y="450" xml:space="preserve"><tspan fill="#d6d7de"> </tspan><tspan fill="#80838f">↳ Terraform state cleanup</tspan></text>
+<text x="28" y="498" xml:space="preserve"><tspan fill="#80838f">push: sees it right away · turn: at its next step · pull: when it checks</tspan></text>
</g>
</svg>
diff --git a/src/render.rs b/src/render.rs
index 3240845..0df71f7 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -26,7 +26,8 @@ const GREEN: &str = "32";
const YELLOW: &str = "33";
const CYAN: &str = "36";
-/// The team directory. For an agent (`agent`), sessions without tincan are only counted: it can't message them.
+/// The team directory. For an agent (`agent`) it is compact, and sessions without tincan are only counted (it
+/// can't message them); people get more room, a dot for whether each machine is online, and colour.
pub fn directory(d: &Directory, agent: bool, paint: Paint) -> String {
let now = util::now_ms();
let mut out = String::new();
@@ -55,6 +56,7 @@ pub fn directory(d: &Directory, agent: bool, paint: Paint) -> String {
*w = (*w).max(c.chars().count());
}
}
+ let layout = Layout { width, gap: if agent { 2 } else { 3 }, agent, paint };
let mut quiet = Vec::new();
let mut shown = vec![false; d.sessions.len()];
@@ -65,12 +67,20 @@ pub fn directory(d: &Directory, agent: bool, paint: Paint) -> String {
let (unreachable, rows): (Vec<usize>, Vec<usize>) =
rows.into_iter().partition(|&i| agent && d.sessions[i].tier == Tier::None);
if rows.is_empty() && unreachable.is_empty() {
- quiet.push(format!("{} · {} ({})", m.person, m.machine, link(m, now)));
+ if agent {
+ quiet.push(format!("{} · {} ({})", m.person, m.machine, link(m, now)));
+ continue;
+ }
+ let _ = writeln!(out, "\n{} {}", header(m, now, paint), paint.on(DIM, "no sessions"));
continue;
}
- let _ = writeln!(out, "{} {}", paint.on(BOLD, &format!("{} · {} ·", m.person, m.machine)), link_painted(m, now, paint));
+ if agent {
+ let _ = writeln!(out, "{} · {} · {}", m.person, m.machine, link(m, now));
+ } else {
+ let _ = writeln!(out, "\n{}", header(m, now, paint));
+ }
for i in rows {
- session_line(&mut out, &d.sessions[i], &cells[i], &width, paint);
+ layout.session(&mut out, &d.sessions[i], &cells[i]);
}
if !unreachable.is_empty() {
let n = unreachable.len();
@@ -78,43 +88,63 @@ pub fn directory(d: &Directory, agent: bool, paint: Paint) -> String {
}
}
for (i, s) in d.sessions.iter().enumerate().filter(|(i, _)| !shown[*i]) {
- let _ = writeln!(out, "{}", paint.on(BOLD, &format!("{} · {}", s.person, s.machine)));
- session_line(&mut out, s, &cells[i], &width, paint);
+ let _ = writeln!(out, "{}{}", if agent { "" } else { "\n" }, paint.on(BOLD, &format!("{} · {}", s.person, s.machine)));
+ layout.session(&mut out, s, &cells[i]);
}
if !quiet.is_empty() {
- let _ = writeln!(out, "{}", paint.on(DIM, &format!("no sessions: {}", quiet.join(", "))));
+ let _ = writeln!(out, "no sessions: {}", quiet.join(", "));
}
if !d.sessions.is_empty() {
- let legend = "push = sees messages right away, even when idle · turn = at its next step · pull = when it checks";
- let _ = writeln!(out, "{}", paint.on(DIM, legend));
+ if agent {
+ out.push_str("push = sees messages right away, even when idle · turn = at its next step · pull = when it checks\n");
+ } else {
+ let _ = writeln!(out, "\n{}", paint.on(DIM, "push: sees it right away · turn: at its next step · pull: when it checks"));
+ }
}
out
}
-fn session_line(out: &mut String, s: &SessionInfo, row: &[String; 4], w: &[usize; 4], paint: Paint) {
- let pad = |i: usize| format!("{:w$}", row[i], w = w[i]);
- let status = match s.status.as_str() {
- "busy" => YELLOW,
- "idle" | "offline" => DIM,
- _ => "",
- };
- let tier = match s.tier {
- Tier::None => paint.on(DIM, "not on tincan"),
- Tier::Push => paint.on(GREEN, "push"),
- Tier::Turn => paint.on(CYAN, "turn"),
- t => paint.on(DIM, t.as_str()),
- };
- let mut line =
- format!(" {} {} {} {} {tier}", paint.on(BOLD, &pad(0)), paint.on(DIM, &pad(1)), paint.on(status, &pad(2)), pad(3));
- if s.unread > 0 {
- let _ = write!(line, " · {}", paint.on(YELLOW, &format!("{} unread", s.unread)));
- }
- if s.is_me {
- let _ = write!(line, " · {}", paint.on(BOLD, "← you"));
- }
- let _ = writeln!(out, "{}", line.trim_end());
- if let Some(doing) = &s.doing {
- let _ = writeln!(out, " {:w0$} {}", "", paint.on(DIM, &format!("doing: {doing}")), w0 = w[0]);
+/// `● alice · xps · direct 4ms`: a green dot while the machine is online.
+fn header(m: &MachineInfo, now: i64, paint: Paint) -> String {
+ let dot = if m.is_me || m.online { paint.on(GREEN, "●") } else { paint.on(DIM, "○") };
+ format!("{dot} {} {}", paint.on(BOLD, &format!("{} · {} ·", m.person, m.machine)), link_painted(m, now, paint))
+}
+
+struct Layout {
+ width: [usize; 4],
+ gap: usize,
+ agent: bool,
+ paint: Paint,
+}
+
+impl Layout {
+ fn session(&self, out: &mut String, s: &SessionInfo, row: &[String; 4]) {
+ let (paint, gap) = (self.paint, " ".repeat(self.gap));
+ let pad = |i: usize| format!("{:w$}", row[i], w = self.width[i]);
+ let status = match s.status.as_str() {
+ "busy" => YELLOW,
+ "idle" | "offline" => DIM,
+ _ => "",
+ };
+ let tier = match s.tier {
+ Tier::None => paint.on(DIM, "not on tincan"),
+ Tier::Push => paint.on(GREEN, "push"),
+ Tier::Turn => paint.on(CYAN, "turn"),
+ t => paint.on(DIM, t.as_str()),
+ };
+ let cols = [paint.on(BOLD, &pad(0)), paint.on(DIM, &pad(1)), paint.on(status, &pad(2)), pad(3), tier];
+ let mut line = format!(" {}", cols.join(&gap));
+ if s.unread > 0 {
+ let _ = write!(line, " · {}", paint.on(YELLOW, &format!("{} unread", s.unread)));
+ }
+ if s.is_me {
+ let _ = write!(line, " · {}", paint.on(BOLD, "← you"));
+ }
+ let _ = writeln!(out, "{}", line.trim_end());
+ if let Some(doing) = &s.doing {
+ let label = if self.agent { format!("doing: {doing}") } else { format!("↳ {doing}") };
+ let _ = writeln!(out, " {:w$}{gap}{}", "", paint.on(DIM, &label), w = self.width[0]);
+ }
}
}
diff --git a/tests/e2e/hooks.py b/tests/e2e/hooks.py
index ac6a64d..97b9330 100644
--- a/tests/e2e/hooks.py
+++ b/tests/e2e/hooks.py
@@ -55,11 +55,11 @@ with open(tp, "w") as f:
{"content": "Rename the config loader", "status": "in_progress"}]}}) + "\n")
hook("cursor", "post-tool-use", dict(cur, transcript_path=tp))
out = run("who", "proj-cursor")
-check("the todo in progress in the transcript shows as what the session is doing", "doing: Rename the config loader" in out, out)
+check("the todo in progress in the transcript shows as what the session is doing", "↳ Rename the config loader" in out, out)
with open(tp, "a") as f:
f.write(json.dumps({"args": {"todos": [{"content": "Rename the config loader", "status": "completed"}]}}) + "\n")
out = run("who", "proj-cursor")
-check("…and goes away once it's done", "doing:" not in out, out)
+check("…and goes away once it's done", "↳" not in out, out)
# Gemini
gem = {"session_id": "g-1", "cwd": D, "hook_event_name": "SessionStart"}
@@ -90,7 +90,7 @@ out = run("hook", "opencode", "poll", "--session", "o-1", cwd=oc)
check("…and nothing the next time", out == "", out)
run("hook", "opencode", "doing", "--session", "o-1", "--doing", "Flaky login test · Bisecting the failure", cwd=oc)
out = run("who", "oc-proj")
-check("the opencode plugin reports title and todo", "doing: Flaky login test · Bisecting the failure" in out, out)
+check("the opencode plugin reports title and todo", "↳ Flaky login test · Bisecting the failure" in out, out)
# pi: its extension reports busy/idle and the session's name, and asks for mail mid-run and when idle.
pi_dir = os.path.join(D, "pi-proj")
@@ -98,7 +98,7 @@ os.makedirs(pi_dir)
run("hook", "pi", "status", "--session", "pi-1", "--state", "busy", cwd=pi_dir)
run("hook", "pi", "doing", "--session", "pi-1", "--doing", "Auth refactor", cwd=pi_dir)
out = run("who", "pi-proj")
-check("pi's extension registers the session, named for what it's doing", "pi-proj-pi" in out and "busy" in out and "doing: Auth refactor" in out, out)
+check("pi's extension registers the session, named for what it's doing", "pi-proj-pi" in out and "busy" in out and "↳ Auth refactor" in out, out)
out = run("send", "pi-proj-pi", "pi: stop and look at this")
check("the sender hears pi gets it within seconds", "within seconds" in out, out)
out = run("hook", "pi", "post-tool-use", "--session", "pi-1", cwd=pi_dir)
@@ -135,7 +135,7 @@ run("who")
time.sleep(2)
out = run("who")
check("live Reason sessions are listed with their title, finished ones aren't",
- "fix-flaky-billing-reason" in out and "doing: Fix flaky billing test" in out and "Something finished" not in out, out)
+ "fix-flaky-billing-reason" in out and "↳ Fix flaky billing test" in out and "Something finished" not in out, out)
out = run("send", "fix-flaky-billing-reason", "reason: the billing test is flaky on main too")
time.sleep(1)
sent = open(reason_log).read() if os.path.exists(reason_log) else ""