{"id":51851696,"url":"https://github.com/themetalstorm/herdr-freebuff-plugin","last_synced_at":"2026-07-23T20:01:35.191Z","repository":{"id":372530998,"uuid":"1308082105","full_name":"TheMetalStorm/herdr-freebuff-plugin","owner":"TheMetalStorm","description":"Freebuff lifecycle integration plugin for Herdr — reports idle/working/blocked state via file polling and PTY content scraping","archived":false,"fork":false,"pushed_at":"2026-07-21T20:12:07.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-21T22:11:36.654Z","etag":null,"topics":["cli","freebuff","herdr","herdr-integration","herdr-plugin"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheMetalStorm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-21T20:06:00.000Z","updated_at":"2026-07-21T20:14:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/TheMetalStorm/herdr-freebuff-plugin","commit_stats":null,"previous_names":["themetalstorm/herdr-freebuff-plugin"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/TheMetalStorm/herdr-freebuff-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheMetalStorm%2Fherdr-freebuff-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheMetalStorm%2Fherdr-freebuff-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheMetalStorm%2Fherdr-freebuff-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheMetalStorm%2Fherdr-freebuff-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheMetalStorm","download_url":"https://codeload.github.com/TheMetalStorm/herdr-freebuff-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheMetalStorm%2Fherdr-freebuff-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35814993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-23T02:00:06.683Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","freebuff","herdr","herdr-integration","herdr-plugin"],"created_at":"2026-07-23T20:01:34.423Z","updated_at":"2026-07-23T20:01:35.186Z","avatar_url":"https://github.com/TheMetalStorm.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# herdr-freebuff-plugin\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nMakes [Freebuff](https://freebuff.com) a first-class agent inside [Herdr](https://herdr.dev), the terminal multiplexer for coding agents.\n\n**Lifecycle state** (`idle` / `working` / `blocked`) is reported to the herdr pane socket automatically — no manual status commands. The plugin works via disk-file polling supplemented by PTY content scraping for state transitions that freebuff does not flush to disk promptly.\n\n## Features\n\n- **Lifecycle reporting** — freebuff pane shows `idle` → `working` → `blocked` → `idle` (green checkmark `done`). Detects:\n  - Normal processing turns (`working` / `idle` via `log.jsonl` timestamps)\n  - `ask_user` multiple-choice popups (`blocked` via PTY content scraping)\n  - Answer chosen (`working` via screen-detected answer echo)\n  - Esc abort (`idle` via `[response interrupted]` marker)\n- **Session restore** — reports the freebuff session ID so herdr can resume after a server restart.\n- **Sidebar detection** — seeds an agent-detection override so herdr recognises the `freebuff` process.\n- **Launch panes** — new task, resume last session, or resume a named session.\n- **Notifications** — a `notify` action sends a herdr toast.\n\n## Requirements\n\n- Herdr \u003e= 0.7.0\n- `freebuff` on your `PATH` (`npm i -g freebuff`)\n\n## Install\n\n```bash\nherdr plugin link /path/to/herdr-freebuff-plugin\nherdr plugin action invoke freebuff.integration.setup\n```\n\nOr from GitHub (requires repo access):\n\n```bash\nherdr plugin install TheMetalStorm/herdr-freebuff-plugin\nherdr plugin action invoke freebuff.integration.setup\n```\n\nThe `setup` action seeds the agent-detection override for the `freebuff` binary.\n\n## Use\n\nOpen a freebuff pane via the plugin entrypoints:\n\n```bash\nherdr plugin pane open --plugin freebuff.integration --entrypoint task\nherdr plugin pane open --plugin freebuff.integration --entrypoint resume-last\nherdr plugin pane open --plugin freebuff.integration --entrypoint resume-named\n```\n\nOr just type `freebuff` in any pane — a PATH wrapper (`~/.local/bin/freebuff`) spawns the lifecycle watcher automatically:\n\n```bash\nfreebuff                        # new session\nfreebuff --continue             # resume last session\nfreebuff --session \u003cid\u003e         # resume named session\n```\n\nSend a notification:\n\n```bash\nherdr plugin action invoke freebuff.integration.notify \"Build done\" \"api workspace\"\n```\n\nKeybinding:\n\n```toml\n[[keys.command]]\nkey = \"prefix+f\"\ntype = \"plugin_pane\"\ncommand = \"freebuff.integration.task\"\ndescription = \"Freebuff: new task\"\n```\n\n### Notifications (blocked → toast + sound)\n\nBy default herdr suppresses toasts for the active tab and has notifications off.\nEnable in `~/.config/herdr/config.toml`:\n\n```toml\n[ui.toast]\ndelivery = \"herdr\"\ndelay_seconds = 1\n\n[ui.toast.herdr]\nposition = \"bottom-right\"\n\n[ui.sound]\nenabled = true\n```\n\n## How status reporting works\n\nThis plugin mirrors herdr's OpenCode integration but with a key difference:\nfreebuff has **no internal hook system**. Instead, the plugin spawns a detached\nwatcher process that polls freebuff's per-chat state files on disk, supplemented\nby PTY screen scraping for mid-turn state.\n\n### State detection matrix\n\n| State | Primary signal | Fallback / supplement | When |\n|---|---|---|---|\n| `idle` | No chat dir or `Main prompt finished` newer than last `Start agent` | — | Just launched, or turn completed |\n| `working` | `[send-message]` or `Start agent step N` newer than last `Main prompt finished` | `Your answer:` + box on screen (answer chosen, AI processing) | Agent is processing or just received an answer |\n| `blocked` | `ask-user` block in last AI message (no user reply after it) in `chat-messages.json` | `Enter select` / `↑↓ navigate` on screen (live popup, not yet flushed to disk) | Freebuff presents up/down-arrow choices |\n| `idle` (Esc) | — | `[response interrupted]` on screen (Esc abort, popup gone but files still stale) | User pressed Esc to cancel a question |\n\n### Why screen scraping?\n\nFreebuff flushes chat files (`chat-messages.json`, `log.jsonl`) only at\nend-of-turn. During the mid-turn \"live ask_user popup\" window, the question\nblock is not yet on disk — file-polling alone cannot detect it. Similarly,\nafter the user answers or Esc's, the files stay stale (still showing the old\nunresolved `ask_user` block) until the next `Main prompt finished`.\n\nThe watcher uses `herdr pane read` to inspect visible pane content and detects\nthese transient UI states by their unique on-screen markers.\n\n### Polling\n\nState is checked every ~700ms from:\n\n```\n~/.config/manicode/projects/\u003cproject-slug\u003e/chats/\u003ctimestamp\u003e/\n    chat-messages.json\n    log.jsonl\n    chat-meta.json\n```\n\n## Files\n\n| File | Role |\n|---|---|\n| `herdr-plugin.toml` | Manifest: panes, setup action, notify action |\n| `scripts/launch.sh` | Pane entrypoint; execs `freebuff` |\n| `scripts/status-watcher.sh` | Detached lifecycle watcher polling to herdr socket |\n| `scripts/watcher-lib.sh` | Shared classify/detect helpers (file-based + screen) |\n| `scripts/common.sh` | Shared helpers (agent-detection seeding) |\n| `scripts/setup.sh` | Seeds agent-detection override; installs PATH wrapper |\n| `scripts/notify.sh` | Sends a herdr notification |\n| `scripts/freebuff-wrapper.sh` | Template for `~/.local/bin/freebuff` (spawns watcher on every invocation) |\n| `config/agent-detection/freebuff.toml` | Agent-detection override for `freebuff` |\n| `tests/` | Test suite (59+ assertions across 7 suites) |\n\n## Notes\n\n- Launching uses plugin **panes** (real PTYs); actions run detached without a TTY and `freebuff` requires one.\n- Windows is supported via Git Bash (scripts are POSIX `sh`).\n- Verify agent-detection schema with `herdr api schema --json`; adjust `config/agent-detection/freebuff.toml` if field names differ on your version.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemetalstorm%2Fherdr-freebuff-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthemetalstorm%2Fherdr-freebuff-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemetalstorm%2Fherdr-freebuff-plugin/lists"}