# Agentee A compact Carbon-dark Herdr workspace: spaces and agents on the left, an icon-tabbed Files/Agents/System panel on the right, an editor with diff and blame, git branch tools, and a file/git status bar. ![Agentee](preview.png) ## What you see - **Left rail, 256 px** (`min 44`, `max 420`), background `chrome` (#111111): a 40 px brand bar (`Agentee` wordmark, search, panel toggle, sidebar toggle), then `SPACES` (28 px header; machine groups, colored 16 px avatars, active space on `raised` with a 2 px accent bar), then `AGENTS` (28 px header; group headers, 28 px agent rows with program icon, name, time, pin, status), then a 40 px footer: one row of icon buttons with tooltips — Theme settings (sliders, opens `agentee-settings`), Herdr settings (gear), Add machine (server, `mod.open machine-add`), and keyboard shortcuts at the right; a collapsed rail shows only Theme settings. - **Work area**: a 32 px app tab strip (Chrome-like: 30 px tabs, rounded top, 2 px accent top edge on the active tab, 28 px ghost `+` after the last tab), the active tab's panes (6 px gap, 8 px radius, 1 px border, 1 px focus), and a 24 px status bar. - **Right panel, 360 px** (`min 260`, `max 760`, `chrome`): the selected tool only — Files, Agents or System — with no inner header; the switcher lives in the window bar. - **Window bar, top right**: Files, Agents, System and Git icons immediately left of the window buttons. Active tool on `raised` with an accent icon; clicking the active one hides the panel. The panel is per space: `agentee-tabs` keeps each space’s shown/hidden state and tool in `shared("agentee.panel.bySpace")` and restores it on a space switch; a space that never opened it starts closed. - **Status bar**: folder, branch, ahead/behind, modified/new/deleted/staged/conflicted counts on the left; active file name, language, lines, chars, words, EOL, encoding and the save chord on the right. When the editor pane is focused, the folder and git read follow its open file's project root (resolved once per file, published as `shared("agentee.project")`), not the tab terminal's folder. Type: JetBrains Mono 13 for terminals/editor, Geist for chrome. Palette: background #161616, chrome #111111, surface #1c1c1c, raised #262626, border #2b2b2b, foreground #f4f4f4, accent #78a9ff, done #42be65, blocked #fa4d56, ansi0–15 Carbon-tuned. ## How it behaves - Spaces: click to switch, right-click for the Herdr space menu, drag a row onto another to reorder, machine headers fold; connected machines with no spaces keep their header but do not add an empty “New space there” row. - Agents: click to focus the pane, hover shows pin and elapsed time, group headers fold, sub-agents fold under their parent, the sort button opens the grouped/priority menu. - Panel icons: select/show the tool; the active icon toggles the panel closed; Git opens the overlay: Changes (the changed files with status letters; click opens the file in the editor and closes the overlay; Stage/Unstage per file, Stage all, a commit-message field and Commit of staged files; it starts on Changes when the worktree is dirty), Branches (checkout, merge, delete local or remote behind a confirm dialog — an unmerged local branch asks again before `branch -D`; LOCAL/REMOTE sections fold, REMOTE folded by default, remembered in `shared("agentee.git.folded")`); the header has Fetch (`fetch --all --prune`, no confirm), Pull (`pull --ff-only`, confirmed; shows ↓N) and Push (`push`, confirmed; shows ↑N; needs an upstream); the status text says what is waiting (N to commit · ↑N to push · ↓N to pull). The window-bar Git button carries a dot (red: conflicts or to pull, amber: changes, green: to push) from the status bar’s `shared("agentee.git.status")`, and Spaces rows show branch, ±changes, ↑push, ↓pull. An editor save or a git action sets `shared("agentee.git.changed")` so both re-read at once, History (the last 150 commits with short hash, subject, author, relative time, refs), New branch (create from any source), Merge (conflict reporting); blame when opened for a file. The overlay, status bar and Git button follow the focused editor file's project root; a home space shows that project as its row name (`shared("agentee.project")`). Theme settings → Git → Open as a tab (`git.openInTab`, off by default) makes the Git button focus or create a Git tab in the active space instead: the tab follows the active project, and its X/Esc closes its pane (when it is the only pane, the tab closes). - Files: click a folder to expand, a file to open it in the editor pane; right-click for Open, Rename, Copy, Cut, Paste, Git blame, Reveal, Delete (confirm); `Delete` and `F2` work on the selected row; `Ctrl/Cmd+C/X/V` copy, cut and paste on disk. When the focused pane is the editor, the panel follows that open file to its project root (`git rev-parse --show-toplevel`, else the file's folder), so it does not jump to the tab terminal's folder or home. Search: names (git index / bounded scan) and contents (`git grep` in repos, ripgrep elsewhere), 450 ms debounce, snippets with line numbers, paged to 200 results. - Editor tabs: flat, sharing the strip (72–200 px each), active one on the code background with a 2 px accent line; the close button keeps its place; middle-click closes; the toolbar’s `N ⌄` lists every open file (`shared("agentee.editor.pick")`), and `Ctrl+PageDown`/`Ctrl+PageUp` (`mod:agentee-editor`) step through them. Right-click anywhere in the editor opens its menu (Save, Save as, Diff, Git blame, Open files, Close file, then Split right/down, Zoom, Close pane), routed back by `shared("agentee.editor.cmd")` with the copy’s key. Theme settings → Wrap long lines (`appearance.softWrap`, on by default) rebuilds open editors when changed. - Editor: real writes; `Ctrl/Cmd+S` saves, `Ctrl/Cmd+Shift+S` saves an untitled buffer, `Ctrl/Cmd+W` closes the file (Save/Discard/Cancel when dirty); closing the last file retires the pane; external disk edits reload when clean and offer Overwrite/Reload when dirty; a pane toolbar has Diff, Blame, Save and Close. Dirty tabs show a dot. App/tab close with dirty buffers writes recovery copies to `~/.config/herdr-app/agentee-recovery/`. - Diff: HEAD version vs the current buffer (unsaved edits included), three context lines, `+`/`−` rows with old/new line numbers and totals; clean files say “No changes against HEAD”. - Blame: whole file, line numbers, short hash, author, relative date, source line, tooltip with the commit summary; uncommitted lines are labelled. - Agents panel: live agent list plus real token totals (input/output/cached/total), per agent/session/model and hour/day/month history, measured vs estimated distinguished. - System panel: CPU model/cores/threads/usage/per-core/frequency/temp; GPU(s) usage/VRAM/temp/clock; RAM/swap; every fixed disk; network rates; OS, arch, hostname, uptime, battery. Meters: normal <70 %, amber 70–90 %, red ≥90 %. - Settings (sidebar footer): Appearance, Themes, Tabs, Explorer, Agents, System, Status bar, Git, Updates; every edit writes `agentee-settings.json` immediately and republishes shared state. Themes list is paged (24/page) and filtered, because Herdr's own Settings draws a full card per theme file. Updates compares the shipped files with `main` by file content, CRLF-normalized (`updates.js`), and starts the repository's own installer detached; it polls `agentee-update/install.result` and re-checks when it finishes (the installer switches the layout to `agentee` unless `NO_LAYOUT` is set). ## Built from - `layouts/agentee.json`: root `row` (`theme: "agentee"`, `titlebar: "none"`, `traffic_lights`, `movable: false`, 13 px JetBrains Mono, Geist UI) → sidebar column (brand, spaces, agents, footer) + work column (tabs block, body row with the active tab block and the 360 px panel column holding `panel-body` stack, status block). - Layout ids: `sidebar`, `brand`, `spaces`, `agents`, `sidebar-footer`, `work`, `tabs`, `work-body`, `main`, `panel`, `panel-body`, `panel-files`, `panel-agents`, `panel-system`, `status`. A layout can pin the Files panel to a folder with `content: { mod: "agentee-explorer", props: { root: "..." } }` (used for the preview shot). Panel children are `panel-files`/`panel-agents`/`panel-system` (distinct from the sidebar `agents` id on purpose). - Mods and roles: `agentee-chrome` (brand, footer, Base theme/selection sync), `agentee-spaces` (fork of spaces), `agentee-agents-list` (fork of agents), `agentee-tabs` (tab strip + window-bar tools), `agentee-explorer` (Files panel and its dialogs), `agentee-editor` (mod pane, diff/blame/save), `agentee-status`, `agentee-agents` (token analytics), `agentee-system` (hardware probes), `agentee-git` (branches/merge/blame overlay), `agentee-settings` (settings overlay + theme list), `agentee-menu` (generic popup), `agentee-new-menu` (fork of new-menu: the tab strip's picker; the picked item creates the space). Shipped mods used: `pane` is not used; `new-menu`, `menu`, `picker`, `spaces`, `agents` are not referenced by the layout except the two forked lists. - Herdr API used: `theme()`, `shared`/`setShared`, `layout()`, `panes()`, `spaces()`, `agents()`, `terminals()`, `focused()`, `keys()`, `settings()`, `run()` (layout.show/select/hide, tab.new/close/select/move/rename, pane.split/focus/close, space.new/select/move, app.theme/help/settings, terminal.pin), `openOverlay`/`closeOverlay`, `notify`, `exec`, `readTextFile`, `writeTextFile`, `watchFolder`, `nextCommand`, `appHome`, `home`, `props`, `window`, `fs/promises` (settings file + recovery copies). - Programs: `git` (status, ls-files, grep, blame, rev-parse, show HEAD, log, branch list, checkout, merge), `rg` (non-repo content search, `-j 2`, depth 12), PowerShell CIM counters and `nvidia-smi` (Windows), `/proc`+`df`+`sysctl` probes (Linux/macOS), LibreHardwareMonitor WMI for CPU temps, agent session logs for tokens. - Art: `layouts/agentee.svg` preview, small inline SVG icons under the mod folders (folder, bot, cpu, branch, palette, layers, monitor, close, chevrons). ## Watch out - An event handler uses the `cx` it is handed, never the one `render` received: render's `cx` is stale once render returns, so a click that calls it updates state and never redraws (editor tabs did not switch). Async work after an `await` needs `ctx.spawn(async (cx) => …)` for the same reason. - Never start async work from `render`: `cx.spawn` there does not run. Poll `shared()` and start folder/read tasks from `cx.timer`, or files opened from the Files panel stay on “Loading file…”. - Each Editor needs its own element id (`Editor.new(state).id("ed-code-")`): without it GPUI reuses the previous native view when tabs switch and the editor paints blank. Keep the loading placeholder too, or a pending read looks like an empty file. - The editor API exposes no cursor, selection or decoration hooks. Diff is a separate view and blame is whole-file; there is no inline gutter. There is no Cut/Copy/Paste menu, and one cannot be built: a right press moves the caret, so the selection is gone before any menu opens, and a mod’s `window.dispatch_action("input::Copy")` goes to Herdr’s command table (“unknown command”), not the text area. Ctrl/Cmd+X/C/V work. EditorState has no `focus()`, so the editor must not take the keyboard back on Herdr’s `focus` command while a file is showing. - The editor’s selection colour is unset by the shell, so Base falls back to its `accent` at 40 %. The app maps Base `accent` from the theme’s `hover` (near-background). `agentee-chrome` republishes Base tokens with `set_theme` (from `gpui-base`; `cx.theme()` is flattened — use `.colors`, not `.tokens`) so selection is visible. Without that sync, selection looks absent. - The editor’s line-number gutter is painted with Base `surface`, which can be the light Base palette even under the dark layout (white strip beside dark code). `agentee-chrome` also pins Base `surface`, `background`, `foreground` and `muted_foreground` from the running theme, so the gutter follows the layout instead of the host palette. - `cx.theme().colors` reads back as `#rrggbb` with the alpha dropped (`#ffffff18` → `#ffffff`). Never feed a value read from it back into `set_theme` expecting it unchanged: themes with translucent borders turned every Base border solid white. Take colours from `theme()` instead. - The editor's indent guides are Base `border` at 85 %, and its current-line highlight is an `editor_active_line` colour Herdr never sets (EditorState has no option for either). `agentee-chrome` sets Base `border` to `#00000000`, which removes the guides; a current-line highlight is not possible from a mod. - Windows CPU usage: `Win32_PerfRawData_PerfOS_Processor.PercentProcessorTime` is the **inverted** counter; usage is `100 − Δ/Δt×100`. The original probe showed idle as load. - Real CPU temperature on Windows needs admin ACPI or LibreHardwareMonitor. ACPI thermal-zone perf counters are ambient, not core, and are deliberately not shown as CPU temp. - Herdr's Settings → Look interrupts with many theme files. Keep the theme picker inside `agentee-settings`, which pages and filters. - Mods get a sandboxed `fs/promises` subset, not Node's: `mkdir`, `readFile`, `readdir`, `writeFile`, `unlink`, `rmdir`, `exists` only (no `stat`, no `rm -r`, no `chmod`), and paths outside the app folder are refused. There is no `Buffer`, `TextEncoder` or `fetch` either. The update check therefore downloads the repository tarball into `/agentee-update/` and walks it with `readdir`; cleanups recurse by hand. - Herdr reloads a mod when its files change. Installing replaces `agentee-settings` itself, so the panel's poll for `install.result` usually ends with the instance: the reloaded panel re-checks on open instead (`updates.checkOnOpen`). Errors before the copy (no curl, no tar, no network) still reach the panel and the log at `/agentee-update/install.log`. - Shipped mods are rewritten at startup. These are personal copies; do not edit `~/.config/herdr-app/frame/*` or expect changes there to persist. - `tab.new` is only a person's new tab when Herdr runs it itself: from a mod with no space open it fails ("no space yet: make one first (space.new)"). `agentee-tabs` calls `ensureSpace()` (`space.new` when no space is active) before the Git-as-a-tab command. The strip's `+` only opens `agentee-new-menu`, which runs `space.new` when no space is active and `tab.new` otherwise — with the picked agent's `argv` when one was chosen — so a window with no space still opens a tab, but the click never leaves a stray shell behind the picker. - Layout ids must stay unique (`panel-agents` vs `agents`); a collision moved the token panel into the left rail. - `movable: false` removes the pane drag grip. Splitting/zooming/closing still works via keys and the terminal menu. - Search must stay bounded: at `~` content search is off; repos use single-threaded `git grep`; ripgrep is capped to 2 threads/depth 12. Unbounded scans spike all cores. - Escape whole paths in shell strings, never fragments: `mv '${sh(a)}' '${sh(join(dirname(a), b))}'`. A folder named `x'; id; '` inside a cloned repo ran `id` when a file in it was renamed, because only the new name was escaped and the raw directory sat inside the quoted destination. The Windows branch was safe (`q()` wraps the complete path in a PowerShell literal). A `git`/`rg` call needs an argument array, or `-e`/`--` before anything that came from a file name or a branch. - Every `git status` carries `-c core.fsmonitor=false` (reads also `--no-optional-locks`): a project folder's own `.git/config` can name a command as its fsmonitor hook, and the status refresh would run it. `agentee-git/git.js` exports that prefix as `READ`; the explorer's and status bar's own status calls must spell it out too. - The shell draws hover labels itself: the box is Base `surface` and the ink is Base `surface_foreground`. `agentee-chrome` pins `surface` to the code background, so it must pin `surface_foreground` to the theme's text too; without it the label paints the host's light-palette ink on a dark box and every tooltip looks like an empty rounded rectangle. - Files and Git → Changes open a file into the space's editor pane: this tab's, else the focused one, else the first in the space (then select its tab). Picking only a pane in the *focused tab* split a new editor pane for every click, so each file ended up in its own pane and the pane in view never grew a second file tab. `agentee.open` names the target tab; a copy in another tab ignores it. - Dialog copies of `agentee-explorer` must not start watchers or consume shared commands, and commands are one-shot (cleared from `shared`), or hot reloads spawn overlay floods. - Remote (ssh) files open read-only; only local writes are supported. - The old panel-bar mod is gone; the window bar in `agentee-tabs` owns the tools and is the only place that shows panel state. - `agentee-spaces`/`agentee-agents-list` are forks: Herdr updates to the originals will not reach them. - The bundle used to be named `abdh`. One namespace now: a mod's folder name is its id in `layouts/agentee.json`, the keys section (`mod:agentee-editor`), `openOverlay({ mod })`, `.` dispatch and its asset paths (`mods/agentee-tabs/icons/…`); shared state is `agentee.*` (`agentee.settings`, `agentee.git.status`, `agentee.project`, …). Settings live in `agentee-settings.json`, recovery copies in `agentee-recovery/`, update staging in `agentee-update/`. The installers migrate the old `abdh` files (backup, then move/remove) and drop `mod:abdh-editor` from `keys.json`; keep the old names out of new code. ## Done when - `herdr-app check` passes for every `mods/agentee-*`. - `herdr-app do layout.switch --name agentee` then `herdr-app status` shows `layout: "agentee"` and `errors: []`. - The window shows: left rail with Spaces/Agents, app tab strip, right panel Files, top-right tool icons, status bar. - Clicking Files/Agents/System switches the right panel; clicking the active icon hides it; Git opens the overlay with Branches, History, New branch and Merge tabs. - Files: expand a folder, open a file in the editor pane, save it (`Ctrl/Cmd+S`) and see the mtime change; external edit while clean reloads; delete a file through the menu (`Delete`) and it disappears from disk; search a repo for a string and get file+snippet rows. - Editor: select text and see a highlight; Diff on a modified file shows `+N −M`; Blame shows authors/hashes; closing the last file closes the pane. - System: CPU usage matches `Get-Counter '\Processor(_Total)\% Processor Time'` within a few points; memory/disk values match Explorer. - Settings: edit any value, reopen the overlay, the value persisted; Themes page lists all theme files without a re-render error.