herdr/src
Coder Wayne bfb9e756a0
feat: add Qoder CLI integration (#309)
* feat: add qodercli agent integration

Recognize qodercli as an agent in herdr panes, with basic Idle/Working/
Blocked screen-state detection mirroring the existing claude / codex
patterns. Adds an IntegrationTarget::Qodercli variant, install_target
wiring for shell hooks under src/integration/assets/qodercli/, the
herdr integration install qodercli CLI surface, and sound-override
coverage so qodercli notifications follow the same routing rules as
other agents.

refs #308

* fix: detect qodercli permission required as blocked

refs #308

* fix: detect qodercli ask-user prompt as blocked

refs #308

* refactor: extract has_qodercli_blocked_prompt helper aligning detect_claude

refs #308

* fix: tighten qodercli working state detection

Combine spinner-row strictness and explicit cancel-hint matching, and
stop matching the bare word 'working'. This avoids false positives when
narrative output (logs, commit messages, Markdown) contains the word
'working' or when a stale braille glyph is sitting in the scrollback
from a previous frame.

- has_qodercli_spinner_row: require row-start braille glyph + space +
  alphabetic char so only an active spinner row triggers Working.
- has_qodercli_working_hint: match '(esc to cancel,' as a positive
  signal that survives spinner masking (e.g. when a hook icon replaces
  the spinner glyph).

refs #308

* fix: short-circuit qodercli press-again banners to idle

refs #308

* fix: detect qodercli AskUser dialog by its 'Asking User' title

refs #308

* feat: recognize qodercli, qoderclicn, qoder, qodercn process names

Map qodercli, qoderclicn, qoder, and qodercn process names all to the
Qodercli agent. Covers both international (qodercli/qoder) and CN
(qoderclicn/qodercn) Qoder CLI binary names.

refs #308

* feat: register qodercli hook in qoder settings.json with stdin payload

Address the integration-layer feedback on #308:

- `herdr integration install qodercli` now writes the bundled hook into
  ~/.qoder/hooks/herdr-agent-state.sh AND registers it in
  ~/.qoder/settings.json under the schema documented at
  https://docs.qoder.com/zh/cli/hooks (and confirmed against the
  packages/core/src/hooks/types.ts type definitions in qodercli's own
  source tree). The hooks object is keyed by event name —
  SessionStart / UserPromptSubmit / PreToolUse / PermissionRequest /
  Stop / SessionEnd — with each entry holding a matcher and a list of
  `{ type: "command", command, timeout }` invocations, mirroring how
  install_claude already wires claude code's settings.json.
- The bundled assets/qodercli/herdr-agent-state.sh now reads the hook
  payload from stdin (per HookInput in qodercli's types.ts:
  session_id, transcript_path, cwd, hook_event_name, agent_id, ...).
  No environment variable is consulted to identify the event;
  SubagentStop and subagent release events return early so a recap or
  away-summary frame cannot revive an idle pane, mirroring
  assets/claude/herdr-agent-state.sh.
- uninstall_qodercli reverses the same set of entries while preserving
  any foreign hook entries the user may have configured by hand.
- Tests cover write / idempotency / uninstall-preserves-others and
  lock the stdin contract via a bundled-asset assertion.

refs #308

---------

Co-authored-by: coderwayne <jlu1318079810@163.com>
Co-authored-by: Can Celik <ogulcancelik@gmail.com>
2026-05-27 17:42:26 +03:00
..
api feat: add Qoder CLI integration (#309) 2026-05-27 17:42:26 +03:00
app feat: configure mobile width threshold (#317) 2026-05-27 15:09:31 +03:00
cli feat: add Qoder CLI integration (#309) 2026-05-27 17:42:26 +03:00
client feat: make focus-gain redraw configurable 2026-05-25 18:42:33 +03:00
config feat: add Qoder CLI integration (#309) 2026-05-27 17:42:26 +03:00
ghostty
input refactor: separate server client boundaries 2026-05-21 20:22:57 +03:00
integration feat: add Qoder CLI integration (#309) 2026-05-27 17:42:26 +03:00
pane feat: persist pane history across restarts (#248) 2026-05-24 21:28:33 +03:00
persist fix: spawn restored agents directly 2026-05-25 16:27:32 +03:00
platform feat: open pane links with ctrl-click 2026-05-26 18:26:12 +03:00
protocol feat: make focus-gain redraw configurable 2026-05-25 18:42:33 +03:00
server feat: add pane metadata reporting 2026-05-26 17:10:28 +03:00
terminal feat: add pane metadata reporting 2026-05-26 17:10:28 +03:00
ui feat: configure mobile width threshold (#317) 2026-05-27 15:09:31 +03:00
workspace feat: add pane metadata reporting 2026-05-26 17:10:28 +03:00
agent_resume.rs feat: persist pane history across restarts (#248) 2026-05-24 21:28:33 +03:00
cli.rs feat: add worktree cli and socket api 2026-05-23 15:19:36 +03:00
config.rs feat: configure mobile width threshold (#317) 2026-05-27 15:09:31 +03:00
detect.rs feat: add Qoder CLI integration (#309) 2026-05-27 17:42:26 +03:00
events.rs feat: add pane metadata reporting 2026-05-26 17:10:28 +03:00
ipc.rs feat: hand off ptys during updates 2026-05-25 15:36:50 +03:00
kitty_graphics.rs refactor: separate server client boundaries 2026-05-21 20:22:57 +03:00
layout.rs feat: add global last-pane navigation 2026-05-26 14:50:13 +03:00
logging.rs feat: add pane metadata reporting 2026-05-26 17:10:28 +03:00
main.rs feat: configure mobile width threshold (#317) 2026-05-27 15:09:31 +03:00
pane.rs fix: reduce idle agent checker CPU 2026-05-26 14:44:22 +03:00
persist.rs feat: hand off ptys during updates 2026-05-25 15:36:50 +03:00
product_announcements.rs
raw_input.rs fix: buffer split host color replies (#310) 2026-05-26 19:59:15 +03:00
release_notes.rs
remote.rs fix: handle package-manager remote updates 2026-05-26 22:51:28 +03:00
selection.rs Add tmux-style double-click word copy (#296) 2026-05-26 13:40:29 +03:00
session.rs fix: harden session stop socket handling 2026-05-27 01:01:23 +03:00
sound.rs fix: avoid aplay for linux mp3 sounds 2026-05-25 23:06:50 +03:00
terminal_notify.rs
terminal_theme.rs
ui.rs feat: configure mobile width threshold (#317) 2026-05-27 15:09:31 +03:00
update.rs fix: handle package-manager remote updates 2026-05-26 22:51:28 +03:00
workspace.rs feat: add git worktree workspace management 2026-05-22 02:23:35 +03:00
worktree.rs feat: add worktree cli and socket api 2026-05-23 15:19:36 +03:00