Skip to content

Expose configurable Herdr socket key sending - #2

Open
thefotes wants to merge 1 commit into
mainfrom
feat/herdr-socket-send-keys
Open

thefotes wants to merge 1 commit into
mainfrom
feat/herdr-socket-send-keys

Conversation

@thefotes

@thefotes thefotes commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Summary

Dispatch can encode pane.send_keys internally, but a user cannot bind that operation in config.json. This adds herdr.pane.sendKeys with a required, ordered keys array and optional paneID. For example, {"id":"herdr.pane.sendKeys","arguments":{"keys":["ctrl+z"]}} now sends Ctrl+Z over Herdr's socket to the pane focused when the binding executes. Supplying paneID targets that pane without moving focus or requiring the terminal to be foreground.

The implementation follows the existing provider path: register the action, decode its arguments, resolve omitted pane IDs from a fresh snapshot, and reuse the protocol-22 codec. Empty/malformed keys and empty explicit pane IDs fail before any input request; Herdr remains responsible for key-name validation. Focused key sequences are kept out of action-resolution logs. Documentation includes focused-pane and multi-pane macro examples, Herdr key syntax, and agent-specific suspension semantics.

This exposes configurable terminal input. It does not automatically discover or pause all agents; users can target known panes with ordered actions. No DispatchRuntime awaits or task behavior change, so the lifecycle specification remains unchanged.

Validation

  • scripts/check.sh passed with DISPATCH_BUILD_DIR=/private/tmp/dispatch-herdr-keys-build: build, parallel Swift tests, strict SwiftLint (zero violations), version checks, and both TLA+ configurations.
  • Tests cover behavior changes through public interfaces: JSON configuration and binding resolution through the registry to a fake Unix socket; focus changes since polling; explicit pane targeting and key order; missing focus/panes; argument validation; disconnected availability; and remote errors.
  • Creator Micro 2 live check: not applicable; no driver, HID, firmware, or physical control mapping changes.
  • Live Herdr check completed.

Manual checks and environment: macOS 26.6.2, Herdr 0.9.3 / protocol 22, isolated named headless server with configuration/state under /private/tmp. A temporary harness linked the built DispatchCore/DispatchProviders libraries and executed the registered action. Focused-pane Ctrl+Z suspended a disposable sleep 60; after shell fg, explicit-pane Ctrl+C interrupted it. The test server was stopped afterward. A terminal app and device firmware are not applicable to this socket check.

Checks not run / residual risks: No live Claude Code or other agent CLI suspension tests; the live check used a shell process. Individual programs decide what a key means, and suspension of all background/child work is not guaranteed. Multi-pane macros use live IDs scoped to Herdr's currently selected machine and stop at the first action error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant