omp packages

@srobroek/pi-herdr-core1.1.0

Opens pi-subagents inspectors in an hc side terminal under Herdr desktop, on this machine or a remote hc machine.

GitHub Actions Published 1 day ago Apache-2.0 ~423 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

herdr-core

The pi package @srobroek/pi-herdr-core adds an hc inspector to pi-subagents. With it, the pi-subagents inspector.open action works in Herdr desktop and other hc (herdr-core) terminals. The built-in Herdr inspector of pi-subagents needs the Herdr TUI (HERDR_ENV and HERDR_PANE_ID), and hc terminals set HC_TERMINAL_ID instead.

Install

pi install npm:@srobroek/pi-herdr-core

The package needs pi-subagents 0.72.0 or later, Node.js, and hc on PATH. It has no settings.

How it works

  • At each session start, the extension registers an inspector named hc through the pi-subagents:inspector-register:v1 event.
  • pi-subagents tries its built-in Herdr, Ghostty and tmux inspectors first. It uses hc when none of them applies and HC_TERMINAL_ID is not blank.
  • In a pi-subagents child (PI_SUBAGENT_CHILD=1), the extension registers nothing. A child inherits HC_TERMINAL_ID but does not own that terminal.
  • The first inspector.open starts a side terminal with hc run --bg. There is one side terminal for each parent hc terminal. Its name is pi-inspect- followed by the parent's terminal ID, in lowercase.
  • When the parent has both the herdr.space and herdr.tab labels, the side terminal gets them too. Herdr desktop then shows it as a pane in the parent's tab. Otherwise it is a child terminal of the parent. Use hc attach <side terminal> to show it.
  • The side terminal runs a Node.js loop that starts the pi-subagents inspector runner for the target in ~/.local/state/pi-herdr-core/inspect-<side terminal>.json ($XDG_STATE_HOME/pi-herdr-core when XDG_STATE_HOME is set).
  • While the side terminal is live, another inspector.open rewrites that file, for any run or child. The loop then stops the current runner and starts the new one in the same pane.
  • inspector.status reports whether the side terminal is live and which run its target file names.
  • inspector.close closes the side terminal only when its target file still names that run. It sends no stop request to the subagent. Ctrl+C in the pane also closes it.
  • The steer and stop controls in the pane follow the pi-subagents authority policy.

Remote machines

hc runs each command on the core of the machine it runs on. A pi session on a remote hc machine (hc machine add) therefore opens its side terminal on that machine, with the remote parent's labels. Herdr desktop then shows it next to the parent. The remote machine needs hc, Node.js and pi-subagents. The extension calls only hc.

Limits

  • hc cannot focus a pane, so focus: true leaves focus where it is. Click the pane to type in it.
  • To watch two runs side by side, run inspector.command and start the printed command in another terminal.