Repository navigation
Labels
This page is for developers of other apps that connect to herdr-core. As a Canopy user you do not need it.
Core clients share which agents you have seen and pinned through terminal labels. Following this protocol lets another client agree with Canopy about which agents are done and which are pinned, so marking an agent as seen in one app clears it in the other.
- Labels belong to the terminal. The shared state ends with it.
-
events.subscribesnapshots containlabelsandturn. Eachlabelsevent contains the whole label map. - Remote terminals use the same rules.
- These labels are optional. Clients can ignore them and keep their own behavior.
The core increases turn each time the terminal leaves working.
A change from blocked to idle does not increase it.
Show an agent in this order:
- For
blockedorerror, show that it needs you. - For
working, show that it is working. - Otherwise, show
donewhenturn > herdr.seen. Showidlewhen it is not.
With no herdr.seen label, use the client's own seen rules.
A missing label is not 0.
Write the label with these rules:
- Write
herdr.seen=<turn>when you look at an agent. Raise an existing value, or write it when missing. - Count an agent only when its app or window is in the foreground and the agent appears on screen.
- A peek or floating view counts. A terminal that replaces another pane's terminal hides that terminal from the seen check.
- Write once per turn while the agent stays on screen. Do not write on every update.
- This rule preserves another client's mark unread. Looking again later can raise the value again.
- To mark unread, write
herdr.seen=<turn - 1>. This is the only lower write. Do not mark unread at turn0. - Give a terminal that your client starts
herdr.seen=0.
The last writer wins. Each client chooses how long a done row stays in place while you look at it.
- A present, non-empty value means pinned.
- To unpin, write an empty value:
herdr.pinned=. This removes the label. - Show pinned agents first, in the client's usual order.
- In Canopy mods, use
terminal.pin {terminal, pinned}and readpinnedfromagents(). Do not write the label directly from a mod.
- Use labels for small values that change at human speed.
- Use the
herdr.prefix. - Use documents (
doc.get,doc.set) for larger values or app-wide state. - Keep state for one device on that device.
See Agents for using agents in Canopy.
These pages come from docs/wiki. Change them with a pull request. Edits made on the wiki are overwritten.
Get started
Guides
The canvas
Panes
Agents
Make it yours
Reference
Help