From c115dbd0510200371dc033c208c0c3c09131c797 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sun, 17 May 2026 03:34:08 +0300 Subject: docs: document terminal core in next docs --- docs/next/README.md | 8 +++++- docs/next/SOCKET_API.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 74 insertions(+), 3 deletions(-) (limited to 'docs/next') diff --git a/docs/next/README.md b/docs/next/README.md index 1b5ed7fa..f5faf558 100644 --- a/docs/next/README.md +++ b/docs/next/README.md @@ -108,6 +108,12 @@ Host workbox same session, same agents, same state. +### direct agent attach + +`herdr` and `herdr --remote` attach to the full Herdr session UI. `herdr agent attach ` attaches your current terminal directly to one server-owned terminal, like a single-pane terminal attach. `herdr terminal attach ` does the same by terminal id. + +Direct attach streams the current rendered terminal state first, then live ANSI frames. Your input goes straight to that terminal. Detach with `ctrl+b q`; send a literal `ctrl+b` with `ctrl+b ctrl+b`. One writable client owns input and resize for a terminal. A second attach fails unless you pass `--takeover`. + ## agent awareness the sidebar shows which agents are blocked, working, or done. workspaces roll up to their most urgent state so you can scan the full list at a glance. @@ -147,7 +153,7 @@ herdr tab create --label "logs" herdr pane split 1-1 --direction right herdr pane run 1-2 "npm test" -# wait for an agent +# wait for a pane-level UI attention state herdr wait agent-status 1-1 --status done # read output diff --git a/docs/next/SOCKET_API.md b/docs/next/SOCKET_API.md index 783d6e97..e639940e 100644 --- a/docs/next/SOCKET_API.md +++ b/docs/next/SOCKET_API.md @@ -9,7 +9,7 @@ if you are teaching an agent that is already running inside herdr, start with [` there are three practical ways to integrate with herdr: - **agent skill** — [`SKILL.md`](./SKILL.md). best when an agent inside herdr just needs to learn the workflow quickly. -- **cli wrappers** — `herdr server stop`, `herdr workspace ...`, `herdr tab ...`, `herdr pane ...`, `herdr wait ...`. best for shell scripts and simple orchestration. +- **cli wrappers** — `herdr server stop`, `herdr workspace ...`, `herdr tab ...`, `herdr agent ...`, `herdr pane ...`, `herdr wait ...`. best for shell scripts and simple orchestration. - **raw socket api** — best when you want direct request/response control or long-lived event subscriptions. these layers are intentionally stacked on top of the same control surface. @@ -141,6 +141,7 @@ for backward compatibility, requests also accept the older positional forms like ```json { "pane_id": "w64e95948145ed1-1", + "terminal_id": "term_64e95948145ed1", "workspace_id": "w64e95948145ed1", "tab_id": "w64e95948145ed1:1", "focused": true, @@ -153,8 +154,30 @@ for backward compatibility, requests also accept the older positional forms like } ``` +`terminal_id` is an opaque terminal identity. during the pane-backed transition each pane has one terminal id, but clients should not derive it from the pane id. + `label` is an optional manual pane name set through `pane.rename`. +`agent_info` responses contain a terminal-facing view of a live agent terminal: + +```json +{ + "terminal_id": "term_64e95948145ed1", + "name": "reviewer", + "agent": "pi", + "agent_status": "working", + "custom_status": "indexing", + "workspace_id": "w64e95948145ed1", + "tab_id": "w64e95948145ed1:1", + "pane_id": "w64e95948145ed1-1", + "focused": true, + "cwd": "/home/can/Projects/herdr", + "revision": 0 +} +``` + +`name` is an optional unique agent alias set by `agent.start` or `agent.rename`. it is separate from the pane `label`: `pane.rename` names a terminal/pane for UI purposes, while `agent.rename` declares or changes the agent-facing name and rejects duplicate active agent names. + `agent` is an optional display label string. - when herdr detects a built-in agent, this is that built-in name like `pi` or `claude` @@ -206,6 +229,13 @@ for backward compatibility, requests also accept the older positional forms like | `tab.focus` | focus a tab | `tab_info` | | `tab.rename` | rename a tab | `tab_info` | | `tab.close` | close a tab | `ok` | +| `agent.list` | list terminal-backed agents | `agent_list` | +| `agent.get` | inspect one agent by terminal id, unique agent name, detected agent label, or pane id | `agent_info` | +| `agent.read` | read output from one agent terminal | `pane_read` | +| `agent.send` | send literal text to one agent terminal | `ok` | +| `agent.rename` | set or clear the unique agent name | `agent_info` | +| `agent.focus` | show the agent terminal in the TUI | `agent_info` | +| `agent.start` | start a named agent terminal from argv | `agent_started` | | `pane.list` | list panes, optionally filtered by workspace | `pane_list` | | `pane.get` | inspect one pane | `pane_info` | | `pane.rename` | set or clear a manual pane label | `pane_info` | @@ -968,6 +998,30 @@ herdr tab rename