75 lines
3.3 KiB
Markdown
75 lines
3.3 KiB
Markdown
# herdr-composer
|
|
|
|
A message bar for [Herdr](https://herdr.dev) agents: one field under the terminal
|
|
that writes to the focused agent, with per-agent drafts that survive a restart, a
|
|
queue that waits for the agent's turn, history and favourites, `/` and `@`
|
|
suggestions, and one pipeline for attachments (drop, `+`, Ctrl+V).
|
|
|
|
The package lives in [`herdr/herdr-composer/`](herdr/herdr-composer/) and has the
|
|
layout Herdr expects for shared mods and layouts:
|
|
|
|
- `layouts/herdr-composer.json` - the layout (a clone of `main` with the composer block)
|
|
- `mods/herdr-composer/` - the mod (ES modules)
|
|
- `keys.json` - the key it expects (`ctrl-shift-space` focuses the composer)
|
|
- `RECIPE.md` - the brief to build it from scratch, and what it runs and reads
|
|
|
|
Other folders: `tests/` (Node tests for the pure modules, `npm test`), `scripts/`
|
|
(the installer), `docs/` (spec, plan, verification).
|
|
|
|
## Install
|
|
|
|
Two ways, the same result.
|
|
|
|
**1. Through an agent** (the way herdr.dev layouts are added):
|
|
|
|
```text
|
|
Read ~/.config/herdr-app/AGENTS.md, then add this layout: clone http://git.mkali.pl/Factor/herdrMario.git and use the folder herdr/herdr-composer
|
|
```
|
|
|
|
**2. One command** (Windows):
|
|
|
|
```cmd
|
|
git clone http://git.mkali.pl/Factor/herdrMario.git "%USERPROFILE%\herdrMario" && "%USERPROFILE%\herdrMario\install.cmd"
|
|
```
|
|
|
|
The installer:
|
|
|
|
- pulls the repo (`git pull --ff-only`, only when it is a clean clone; a failure is a warning);
|
|
- **copies** the mod to `~\.config\herdr-app\mods\herdr-composer` (a mirror) and the
|
|
layout to `layouts\herdr-composer.json`, so Herdr loads the new files by itself (a layout that
|
|
is already there and differs is saved first; an identical one is left alone);
|
|
- merges `keys.json` of the package into yours. **The installer rewrites `keys.json`**: the
|
|
formatting changes (indentation, line breaks), the meaning does not. A copy is saved first, and a
|
|
key you bind to something else is left alone, with a warning;
|
|
- clears away the earlier version, `ovis-composer` (a junction is unlinked, a directory or
|
|
layout is moved out, its key is removed) - your history, favourites, drafts and queue are
|
|
kept: the mod reads what the earlier version stored;
|
|
- runs `herdr-app check` on the mod and switches to the `herdr-composer` layout - on the first
|
|
install, or when the earlier `ovis-composer` layout was the shown one; otherwise it only says
|
|
how to switch (`ctrl-shift-l`). Without `herdr-app` on the PATH these are warnings, not errors.
|
|
|
|
Every copy the installer makes (the earlier mod, layouts, `keys.json`) goes to
|
|
`~\.config\herdr-app\backups\herdr-composer\<yyyyMMdd-HHmmss>\`, never next to the originals:
|
|
Herdr loads whatever it finds in `mods\` and `layouts\`, so a backup left there would be loaded.
|
|
|
|
Files of this repo are never deleted.
|
|
|
|
## Update
|
|
|
|
Run `install.cmd` again (or ask the agent again). It is the same command: pull, copy, check.
|
|
There is no junction and no reload step - the copy is what Herdr sees.
|
|
|
|
## Uninstall
|
|
|
|
```cmd
|
|
install.cmd -Uninstall
|
|
```
|
|
|
|
Removes `mods\herdr-composer`, `layouts\herdr-composer.json` and its key from `keys.json`, and
|
|
switches to the `main` layout. Only the copies in `backups\herdr-composer\` stay.
|
|
|
|
## Develop
|
|
|
|
Edit the files in `herdr/herdr-composer/`, run `npm test`, then `install.cmd` to copy the
|
|
change into Herdr (`herdr-app check <mods>\herdr-composer` and `herdr-app status` show problems).
|