Skip to content

hermes-github-prs v0.2.0

Choose a tag to compare

@claudiumio claudiumio released this 20 Aug 03:32
· 61 commits to main since this release
ca8ca2b

hermes-github-prs v0.2.0

PRs & Issues as a pane inside Hermes Desktop — session-aware, CI-aware, review-aware. No backend, just gh.

poster


Highlights

  • Session-aware PR chip — finds the PR for your current branch and the last PR mentioned in chat
  • CI & review dots — passing / pending / failing + approved / changes / required on every row
  • Inline review threads — grouped by in_reply_to_id, with file:line chips and collapsible diff hunk
  • Full diff viewer — unified patch → structured rows (hunk/add/del/ctx), A/D/M/R badge, +N −N
  • In-pane merge — squash / merge / rebase + delete-branch, without leaving Hermes
  • Quote to chat — one click to cite any comment straight into the active session's composer

All data via host.request('shell.exec') + gh CLI. No server, no extra token.


What's new

Session-aware PR chip

  • Resolves PR from two sources (priority): git rev-parse --abbrev-ref HEAD + remote.origin.url → gh pr list --head <branch>, fallback session.history scan for last github.com/owner/repo/pull/N
  • Clickable chip #123 title with state dot; skips trunk branches (main/master/dev/trunk)

CI & review dots — Issue #10

  • CI from statusCheckRollup: merges CheckRun (status + conclusion) and StatusContext (state) → passing / pending / failing / none; failing wins over pending
  • Review from reviewDecision → approved / changes / required / none
  • Two 6px dots per row with native title tooltip, zero layout cost

Inline review threads — Issue #9

  • groupInlineThreads() groups in_reply_to_id → 30-thread cap, bodies never truncated
  • file:line chip falls back to original_line when line is null (outdated diff)
  • Collapsed <details> Diff context per inline comment
  • One chronological timeline: reviews + issue comments + inline threads

Diff viewer — Issue #12

  • parsePatch() → row model {type: hunk|add|del|ctx|meta, oldLine, newLine, text}
  • FileDiffBlock with A/D/M/R status badge, +N −N via theme diff vars, auto-open <150 lines
  • Table with old/new line numbers + sign + monospaced code

In-pane merge — Issue #2

  • Methods: Squash / Create merge commit / Rebase
  • Checkbox: Delete branch after merging
  • Exec: GH_PROMPT_DISABLED=1 gh pr merge --squash|--merge|--rebase [--delete-branch] (avoids TTY hang; --yes is unsupported)
  • Invalidates pr-page, prs, session-git queries on success

Quote to chat — Issue #1

  • Quote on every comment card → commentToChatText({login, timestamp, body, permalink}) → blockquote
  • Dispatches hermes:composer-insert (mode: block, target: main) + hermes:composer-focus via setTimeout(0) so composer focuses after click
  • Disabled with native tooltip when no active session

Under the hood

Area Detail
Big payloads shBig / shJsonBig route through /tmp/*.raw → base64 → *.b64 and re-join in 3800-byte chunks with atob (ASCII-safe, never splits multi-byte); N+2 shell.exec round-trips; ponytail: to replace with file-read RPC when gateway cap is raised
API helpers ghApi / ghApiBig / ghApiBigPaginated — compact REST via --jq, repoOk() validation, --paginate --slurp → flat()
Full bodies Fix #8: full comment bodies via shBig instead of 700-char truncation
Markdown mdBlocks / mdInline — GFM subset (headings, lists, task lists, tables, quotes, <details>, fences, hr, inline); raw HTML stripped; ponytail tag for full GFM when SDK ships markdown
Labels LabelChip + labelTextColor() — W3C relative luminance threshold 140 picks black/white text on any GitHub label color
Layout Radix ScrollArea display:table wrap fix — forced display:block !important inside .github-prs-pane so content reflows instead of clipping
Perf Lists capped at 30 rows; paginated comments/files; queries with staleTime 10–60s; payloads chunked to stay under shell.exec 4k stdout cap

Merged PRs in this release

  • #16 feat: PR status indicators (CI/review) and inline review comments
  • #17 feat: render label chips, diff hunks, and in-pane merge action
  • #18 fix(merge): use GH_PROMPT_DISABLED instead of unsupported --yes flag
  • #8 fix: show full comment bodies instead of truncating
  • #7 feat: auto-switch pane repo to the active session's repo
  • #6 fix: auto-refresh PR/issue detail views
  • #4 feat: quote PR/issue comment into active session chat

Install & Use

gh repo clone claudioorjunior/hermes-github-prs
# Hermes → Capabilities → Install plugin (local)
# Requires: gh authenticated (gh auth login) + git repo with origin

Pane: titlebar GitHub button → right workspace. PR chip: titlebar second. Detail: click any PR/Issue → tabs (Conversation / Commits / Files / Checks). External links via pluginCtx.os.openExternal.


🇧🇷 Português (Brasil)

PRs & Issues como um pane dentro do Hermes Desktop — consciente da sessão, do CI e do review. Sem backend, só gh.

Destaques

  • Chip de PR consciente da sessão — encontra o PR da sua branch + o último PR mencionado no chat
  • Bolinhas de CI & review — passing / pending / failing + approved / changes / required em cada linha
  • Threads inline — agrupadas por in_reply_to_id, com chip file:line e hunk colapsável
  • Diff viewer completo — patch unificado → linhas estruturadas (hunk/add/del/ctx), badge A/D/M/R, +N −N
  • Merge no pane — squash / merge / rebase + apagar branch, sem sair do Hermes
  • Citar no chat — um clique para citar qualquer comentário no composer da sessão ativa

O que mudou (resumo técnico)

Mesmo conteúdo da seção inglesa acima — statusCheckRollup+reviewDecision → bolinhas, groupInlineThreads() com fallback original_line, parsePatch() → FileDiffBlock, GH_PROMPT_DISABLED=1 gh pr merge, hermes:composer-insert via setTimeout(0), shBig em base64 3800-byte chunks, GFM subset, labelTextColor() por luminância W3C, fix do display:table do Radix.

Instalação

gh repo clone claudioorjunior/hermes-github-prs
# Hermes → Capabilities → Install plugin (local)
# Requer: gh autenticado (gh auth login) + repo git com origin

MIT · Built with @hermes/plugin-sdk · host.request('shell.exec') + gh — no backend.