feat: install herdr agent integrations after the install pipeline

herdr hook files are herdr-managed, so none is committed. The installer ends
by running `herdr integration install <agent>` for each of claude, codex, pi
and omp that is present, skipping any herdr already reports current and
saying nothing when herdr is absent. Seal and fake learn herdr; tests and two
mutations cover install, idempotence, failure and absence (G-AG-5).
This commit is contained in:
bcherb2 committed 2026-11-18 02:13:05 -05:00
1 parent f8b17a79d3
commit 4e2452e994
6 files changed
+92 -1

No files matched your search

+24
View File
@@ -1196,6 +1196,29 @@ install_bespoke() {
done
}
# herdr's per-agent hooks (claude, codex, pi, omp) are herdr's own files:
# "managed by herdr; reinstalling or updating the integration overwrites this
# file". A committed copy drifts against every herdr upgrade, so none is
# committed and herdr installs them itself. Last in the pipeline because every
# channel that delivers an agent -- script, brew, npm -- has run by then. An
# integration herdr already reports `current` is left alone; no herdr at all is
# not this run's business and says nothing.
herdr_integrations() {
have herdr || return 0
HERDR=$(find_tool herdr)
hst=$("$HERDR" integration status 2>/dev/null || :)
hd=
for ag in claude codex pi omp; do
have "$ag" || continue
case $(printf '%s\n' "$hst" | grep "^$ag: " || :) in
*": current"*) continue ;;
esac
[ -n "$hd" ] || { head_ "herdr integrations"; hd=1; }
run_sh "'$HERDR' integration install $ag" \
|| warn "herdr integration install $ag failed — agent state will not show in herdr"
done
}
cmd_install() {
# A cron job re-running `--unattended install` gets its SAVED selection --
# that contract stands. But on a box where nothing was ever chosen,
@@ -1255,6 +1278,7 @@ cmd_install() {
install_flatpak "$(col flatpak)"
install_npm "$(col npm)"
install_uv "$(col uv)"
herdr_integrations
rm -f "$tbl"
if [ -s "$FAILED" ]; then