Commit graph

19556 commits

Author SHA1 Message Date
Brooklyn Nicholson
fb5efe917a feat(desktop): parse the @kind: prefix as a browse scope
detectTrigger split an `@folder:apps/desk` token into one opaque query, so
every consumer downstream had to re-parse the prefix — or, more often, treat
it as characters the user was expected to maintain by hand.

Split it into `scope` + `value` at the source, behind a known-kinds list so a
handle like @teknium1: or a host:port stays ordinary text, and add
openDirectiveScope() for callers that need to know the caret is sitting in an
empty scope.
2026-07-30 04:52:06 -05:00
hermes-seaeye[bot]
11089899fb
fmt(js): npm run fix on merge (#74740)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-07-30 09:42:51 +00:00
brooklyn!
c581ad402e
Merge pull request #74736 from NousResearch/bb/clear-draft
feat: double ESC discards the draft; make Ctrl+U/K line-scoped
2026-07-30 04:34:21 -05:00
brooklyn!
9d75c418ad
Merge pull request #74693 from NousResearch/bb/cmd-backspace
fix: Cmd+Backspace and Cmd+ForwardDelete reach the readline kill bindings
2026-07-30 04:31:48 -05:00
Brooklyn Nicholson
6d5b3e2520 docs(tui): list Esc Esc in the hotkey panel; correct the Ctrl+U/K wording
The kills are line-scoped now, so "delete to start / end" overstated them.
2026-07-30 04:27:44 -05:00
Brooklyn Nicholson
01022d737a feat(tui): double ESC discards the draft, even mid-stream
Mirrors the CLI binding. Placed above the isBlocked early-return so it
works while the agent streams — that is the whole gap, since Ctrl+C
interrupts a running turn and only clears the composer when idle.

Pushes the draft to history before clearing so Up recalls it.
2026-07-30 04:26:48 -05:00
Brooklyn Nicholson
59a7da9a89 fix(tui): scope Ctrl+U / Ctrl+K to the current line, per readline
Both kills operated on the whole buffer: Ctrl+U wiped everything before
the cursor and Ctrl+K everything after, regardless of newlines. Readline
scopes them to the current logical line, and Claude Code documents Ctrl+U
as "repeat to clear across lines in multiline input" — which only works
if a press at a line boundary consumes the newline and makes progress.

Extract killToLineStart / killToLineEnd and route all four call sites
through them, so the Cmd chords and their Ctrl equivalents cannot drift.
2026-07-30 04:26:42 -05:00
brooklyn!
94924c6430
Merge pull request #74674 from NousResearch/bb/yolo-palette
Put YOLO in ⌘K and show each toggle's live state
2026-07-30 04:25:18 -05:00
brooklyn!
1ae1eb47bc
Merge pull request #74729 from NousResearch/bb/no-auto-filetree
Opening the diff pane no longer opens the file tree
2026-07-30 04:23:18 -05:00
CK iRonin.IT
c1ec394160 feat(cli): double ESC discards the draft, even mid-stream
Ctrl+C interrupts a running turn and only clears the composer when idle,
so there was no way to discard a half-typed prompt while the agent was
streaming. Claude Code and Gemini CLI both bind that to double-Esc.

Appends the draft to history before clearing, so Up recalls it — the same
undo affordance Claude Code gives, which is what makes this safe on a key
people hit by reflex. Excluded when a modal prompt is up, since those bind
ESC eagerly and cancel should still win.

Co-authored-by: Brooklyn Nicholson <brooklyn.bb.nicholson@gmail.com>
2026-07-30 04:20:41 -05:00
Brooklyn Nicholson
7996ec66cd test(desktop): match the switch and disclosure labels to what they render
These assert the accessible name, and the name now states the action rather
than the word toggle: an enabled toolset offers "Turn X toolset off", a
collapsed project offers "Show X sessions".
2026-07-30 04:18:17 -05:00
Brooklyn Nicholson
6cb1aa44ed fix(desktop): opening the diff pane no longer opens the file tree
`revealTreePane` un-collapsed a pane's column by calling the side's bound
store setter. On the right that setter IS `setFileBrowserOpen` — the file
tree's own toggle — so anything sharing that column dragged the tree open
with it: ⌘G on the diff, a session tile reveal, `focus_pane`.

Un-collapse the column directly instead. The tree now opens only when its
own toggle is pressed. `revealPreview` had a local workaround for exactly
this, which the fix makes redundant.
2026-07-30 04:16:34 -05:00
brooklyn!
dd241cf0cd
Merge pull request #74644 from NousResearch/bb/double-tap-heart
feat(desktop): double-click a message to heart it
2026-07-30 03:56:01 -05:00
Brooklyn Nicholson
640056704c Merge remote-tracking branch 'origin/main' into bb/yolo-palette
# Conflicts:
#	apps/desktop/src/app/command-palette/index.tsx
2026-07-30 03:49:03 -05:00
Brooklyn Nicholson
3f5ec8b45d fix(tui): Cmd+Backspace kills the line; Option/Ctrl+Backspace stay delete-word
On terminals that send Cmd+Backspace as a CSI-u sequence rather than
rewriting it to Ctrl+U, the keystroke fell through to the word-delete
branch and erased a single word.

The modifier this hinges on is easy to get wrong. isActionMod accepts
key.meta on macOS, and hermes-ink reports Option as meta — so keying on
it would turn Option+Backspace, the platform's delete-word shortcut, into
delete-the-whole-line. On Linux/Windows isActionMod is key.ctrl, where
Ctrl+Backspace is likewise delete-word in readline, VS Code, browsers,
and Windows Terminal. Only the super bit, set by kitty CSI-u and xterm
modifyOtherKeys, unambiguously means Cmd.

Extract that decision into isLineKillModifier so the reasoning lives in
one place and the regressions above are pinned by tests.
2026-07-30 03:39:34 -05:00
Brooklyn Nicholson
8d112c05f7 fix(cli): route Cmd+Backspace and Cmd+ForwardDelete to the kill bindings
Terminals that rewrite Cmd+Backspace to Ctrl+U already reach
unix-line-discard. Kitty keyboard protocol and xterm modifyOtherKeys
terminals instead report Cmd as the super modifier bit, producing CSI
sequences prompt_toolkit has no entry for — the raw bytes fall through
the VT100 parser and land in the buffer as literal text.

Alias those to the readline kill bindings prompt_toolkit already ships.
Backspace is a CSI-u codepoint (127); ForwardDelete is a CSI tilde key,
so its modifier rides in the CSI 3 ; mod ~ form rather than CSI-u.
Ctrl+ForwardDelete keeps its own binding — that is delete-word on
Linux/Windows, not kill-line.
2026-07-30 03:39:26 -05:00
hermes-seaeye[bot]
9accf79d83
fmt(js): npm run fix on merge (#74702)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-07-30 08:19:58 +00:00
Brooklyn Nicholson
129b4e7fef feat(desktop): make the ⌘K row note a shared primitive with a state variant
A toggle's on/off isn't a passive fact like a version string — the row is about
to change it. It keeps the label's color so the two read as one phrase, and
earns its separation from a faint underline instead of going muted. Both
variants live in floating-hud.ts beside the other shared HUD chrome.

That underline needs room to exist: flex items are blockified, so the note's
truncate/overflow-hidden bites, and the app's global 0.25rem offset sits at the
bottom edge of a text-xs line box. The state variant drops truncate (one word,
nothing to clip) and pulls the offset to 2px.

Flipping a setting isn't navigation either, so toggles keep the palette open the
way the theme and color-mode rows already do, and selecting a keepOpen row bumps
a counter that rebuilds the groups so the note can't report the state it left.

Also: yolo is lowercase, and logs gets its own icon instead of borrowing the
YOLO bolt.
2026-07-30 03:18:13 -05:00
Brooklyn Nicholson
2c71a37ad1 fix(desktop): clear double-click heart lint errors 2026-07-30 03:16:42 -05:00
Brooklyn Nicholson
b69d4e5a78 feat(desktop): double-click a message to heart it
The iMessage gesture, on the same opt-in toggle as the rest of reactions —
double-click any message and it gets a heart; double-click again and it comes
off. Off by default, and while it's off the message root carries no listener
at all.

The gesture is deliberately narrow about what it claims: only a true
double-click (detail === 2, so a triple-click to select the paragraph doesn't
re-toggle), and never over an element where a double-click already means
something — links, buttons, inputs, code blocks. It clears the word selection
the browser just made, since the tapback is what the gesture meant.

Reaction state for the handler is read lazily off the message runtime at
event time rather than subscribed to, mirroring how the footer already reads
its text: the handler renders nothing, so subscribing the message root to
every reaction change would be cost for no paint.
2026-07-30 03:16:42 -05:00
Brooklyn Nicholson
9d589b92d3 refactor(desktop): one hook for a message's reactions
The assistant footer and the user bubble each carried the same block: two
metadata reads, the three-store merge, and a local-first toggle that paints
before it persists. Same code, two files, and the next surface that wants to
react would have been a third copy.

useMessageReactions owns it now, with commitReaction as the single write path
so every caller applies identical tapback semantics.
2026-07-30 03:16:41 -05:00
brooklyn!
d437d3e54d
Merge pull request #74665 from NousResearch/bb/palette-perf
perf(desktop): ⌘K opens instantly, whatever else the shell is doing
2026-07-30 03:08:58 -05:00
hermes-seaeye[bot]
b5ca900508
fmt(js): npm run fix on merge (#74694)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-07-30 08:08:51 +00:00
Brooklyn Nicholson
0481766561 perf(desktop): make ⌘K cost nothing until it opens
⌘K is an overlay that is stateful to itself — pressing it owes the user a
frame immediately, whatever else the shell is doing. It was not built that
way.

`CommandPalette` is mounted for the life of the app, and its body ran
unconditionally: a dozen store subscriptions (connection, desktop version,
client + backend update status/apply, keybinds, worktrees, theme, i18n),
three `useQuery`s, and the group builders that assemble a few hundred rows.
`<Portal>` renders nothing while closed, so none of it was ever visible —
but all of it still ran. An in-flight update rewrites `$updateApply` on
every progress line, and each of those rebuilt the entire row set for a
surface nobody could see.

Split the body into `CommandPaletteBody`, mounted only while the palette is
on screen. A closed palette is now one store subscription. The body is keyed
by open count, so per-open state (search, sub-page) resets by remount and
the explicit close-reset effect goes away, and `mounted` lags `open` by the
150ms exit animation so Radix can still play `data-[state=closed]` instead
of the overlay vanishing.

Rows additionally move behind `useDeferredValue` in their own memo
component. Because that component mounts with the portal, the deferred
initial value applies per open: the first commit is the frame + input, and
the several-hundred-row list arrives in an interruptible follow-up render
rather than blocking the frame the keypress asked for. The empty state is
suppressed while rows are still pending so opening doesn't flash "no
results".

The `enabled: open` gates on the three queries are dropped — the component
only exists when open, so they are inherently lazy, and react-query still
serves a reopen from cache while revalidating.
2026-07-30 03:01:05 -05:00
Brooklyn Nicholson
09fa5c063c fix(desktop): make ⌘K group order the priority it already was
Group order is the only tiebreaker rankGroups has (stable sort), and ties are
the common case: "yolo" matches both "Toggle YOLO" and a worktree named
bb/yolo-palette as a whole word. Branch rows sat second and won, burying the
command under a list that grows with whatever's checked out.

The order now reads as the priority: where you're going, what you can do, what
you can configure, then the typed-only lists, and branches last.

Also pulls the muted detail back to ~4px — it reads as a suffix of the label,
not another flex item at the row's icon-to-label gap.
2026-07-30 03:00:58 -05:00
brooklyn!
c55159f185
Merge pull request #74683 from NousResearch/bb/osc-tab-title
fix(tui): split terminal tab title from window title
2026-07-30 02:58:04 -05:00
Brooklyn Nicholson
3198ed7cc3 refactor(desktop): name value-taking setters set*, not toggle*
toggleSkill(name, enabled) is a setter wearing a toggle's name. A toggle takes
no argument; anything handed an explicit value is a set.
2026-07-30 02:41:41 -05:00
Brooklyn Nicholson
f975837054 fix(desktop): name the direction in labels that describe live state
The sidebar rail, project disclosures, and the toolset switch now read "Show" or
"Hide" from what's actually on screen, and a failed write says which direction
failed instead of "Failed to toggle". All five locales.
2026-07-30 02:41:41 -05:00
Brooklyn Nicholson
b86ae0d108 feat(desktop): put YOLO in ⌘K and show each toggle's live state
YOLO had a status-bar zap and a slash command but was never registered as a
palette contribution, so ⌘K couldn't reach it.

Adding it exposed the wider gap: "Toggle status bar" doesn't say which way it
will go. Rows already carry a muted `detail` slot, so paletteToggle fills it
with on/off — no new chrome, and the verb stays. Status bar, logs, and layout
edit mode go through the same helper.
2026-07-30 02:41:34 -05:00
Brooklyn Nicholson
975f4ef38d perf(desktop): budget the transcript live tail in parts, not turns
The content-visibility virtualization from #66470 stopped engaging on agent
sessions. Its live tail — the newest turns kept always-rendered so a turn is
only virtualized once its height has settled — was sized as a raw count of 6
turns, while everything else in this file budgets in rendered PARTS
(RENDER_BUDGET=300, FIRST_PAINT_BUDGET=20).

Those units diverge badly on agent transcripts. A chat turn is 2-6 parts, but a
turn with tool calls is 50-200, so "6 turns" can exempt the entire visible
transcript. Measured on a 5-tile window (7/3/5/3/2 groups per tile): zero
content-visibility containers were active anywhere, and every Radix overlay
open paid the full whole-document style recalc that #66470 exists to avoid
(~610ms of a ~700ms open, in a handful of enormous recalcs rather than any
long task).

Size the tail by parts instead, clamped to [2, 6] turns. The floor keeps the
streaming turn rendered when turns are huge, preserving the anti-drift
guarantee; the ceiling stops a tail of tiny turns from reaching further back
than the old turn-count policy did, so no transcript shape renders more than
before. `liveTailStart` replaces the per-row `isVirtualizedGroup` predicate and
is computed once per render off the weighted groups.

Parts left always-rendered, real transcript shapes:

| shape                        | before | after |
|------------------------------|--------|-------|
| agent tile (7 tool-heavy)    |    690 |   270 |
| agent tile (5 turns)         |    535 |   225 |
| long agent session (40)      |    720 |   240 |
| long chat (40 short turns)   |     24 |    24 |
2026-07-30 02:38:41 -05:00
hermes-seaeye[bot]
fed48cf5b0
fmt(js): npm run fix on merge (#74677)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-07-30 07:36:23 +00:00
Brooklyn Nicholson
f1a91ad416 fix(tui): split terminal tab title from window title
Terminal.app truncates background tab titles from the left, so a single
long OSC 0 string (marker · session · model · cwd) leaves only the tail
visible — usually the cwd or process name. Emit OSC 1 (icon/tab) with
just the short session title and OSC 2 (window) with the full composed
string, so background tabs show the session name instead of the cwd tail.
2026-07-30 02:31:47 -05:00
brooklyn!
866c9adae3
Merge pull request #74651 from NousResearch/bb/composer-paste-directives
Paste directives into the composer
2026-07-30 02:25:09 -05:00
brooklyn!
a2a74d7acf
Merge pull request #74623 from NousResearch/bb/open-project
feat(desktop): ⌘O open folder as project, projects in ⌘K
2026-07-30 02:12:22 -05:00
Juan Martitegui
0bf471dd68 fix(gateway): preserve voice_only semantics for text input 2026-07-30 00:11:33 -07:00
brooklyn!
05f5df6bdb
Merge pull request #74640 from NousResearch/bb/undo-close-tab-focus
fix(desktop): focus the tab restored by undo-close (⌘⇧T)
2026-07-30 02:06:29 -05:00
brooklyn!
1e2d55072c
Merge pull request #74642 from NousResearch/bb/sidebar-icon-clip
fix(desktop): sidebar labels truncate instead of pushing header icons out
2026-07-30 02:04:54 -05:00
Brooklyn Nicholson
422ecfe1da feat(desktop): hydrate commands when repainting inert composer text
Two repaint sites hand the editor text that is finished rather than
mid-keystroke: the main composer's programmatic draft writes (restore,
insert, history recall) and the inline edit composer opening a sent
message. Both now render with `trailingCommitted`, so a command ending
that text chips instead of reading as a half-typed token — the edit
composer in particular showed plain text for a message the transcript
had just rendered with a pill.

Regression tests cover the paste path: a command ending the paste, one
named mid-prose beside a ref, a path left alone, a paste landing against
a word, and one landing after an existing chip.
2026-07-30 02:00:22 -05:00
Brooklyn Nicholson
ccca952b92 feat(desktop): chip pasted directives in the composer
`appendComposerContents` — the one builder every paste goes through —
only ever chipped `@kind:value` refs. Slash commands had a single
leading-token special case in `renderComposerContents`, which paste
doesn't call, so a pasted `/clean` landed as dead text while the same
text typed by hand became a pill.

Both directive kinds now hydrate from one ordered span walk, with `@`
refs winning a tie so a slash inside a quoted ref value stays part of
that value. Paste additionally scans as inert text: a command ending the
paste is complete rather than half-typed, and the insertion point's own
token boundary decides the leading token, so `foo` + `/clean` stays
`foo/clean`.

`textBeforeCaret`'s chip-atomic serialization moves to rich-editor as
`serializeTextBefore` — the paste path needs the same "a chip edge is a
token boundary" reading that trigger detection does.
2026-07-30 02:00:22 -05:00
Brooklyn Nicholson
c5a68213fa feat(desktop): recognize slash commands in text the composer didn't watch typed
The composer chips a `/command` when it's picked or accepted from the
popover. Text that arrives whole — a paste, a restored draft, an undo
step — never passes through that path, so nothing recognizes the
commands in it.

Extract that recognition into a scanner that answers on the same terms
the typed path uses: no-arg commands only, no paths, built-ins as
invocations while skills may also be named mid-prose, and a trailing
token still-typed unless the caller says the text is inert.
2026-07-30 02:00:22 -05:00
brooklyn!
fa8b959b92
Merge pull request #74630 from NousResearch/bb/update-restart-race
fix(update): GUI update self-deadlocks against its own lock — every retry fails with "Hermes is still running"
2026-07-30 01:43:38 -05:00
Brooklyn Nicholson
3209236ae3 fix(desktop): fade the ⌘-held project label
The 'New session in <project>' preview is a note about what Enter will do,
not the row's name — so it takes text-muted-foreground/80, the same muted
tone the palette's detail notes already use.
2026-07-30 01:20:08 -05:00
Brooklyn Nicholson
958ab818b8 fix(desktop): sidebar labels truncate instead of pushing header icons out
Flex containers around section/lane labels kept their default min-width:auto,
so a long project title refused to shrink at narrow sidebar widths and shoved
the trailing action icons (caret, +, kebab, branch) past the edge. Give every
header label min-w-0 so its truncate can engage, pin shrink-0 on the caret at
the primitive level and on SidebarSectionMeta, and clip LaneLabel's pinned
tail inside the label. Icons now stay visible at any width.
2026-07-30 01:19:31 -05:00
konsisumer
8e1debd5ed docs: purge stale xdist/_enforce_test_timeout test-runner references repo-wide
The test runner moved to per-file subprocess isolation via
scripts/run_tests_parallel.py (hermetic `env -i`, worker count auto-scaled
from CPU count, FLAKY-retry policy) — no pytest-xdist, no SIGALRM per-test
timeout fixture. Docs still described the old runner in many places:

- AGENTS.md: "-n auto xdist workers, in-tree subprocess-isolation plugin"
  clause replaced with the current per-file-subprocess description; the
  `::test_x` single-test example now shows file + -k (runner is
  file-granular).
- CONTRIBUTING.md: "hermetic env, 4 xdist workers" comment corrected;
  `tests/conftest.py::_enforce_test_timeout` reference redirected to the
  win32 timeout-method shim in `tests/conftest.py::pytest_configure`.
- skills/autonomous-ai-agents/hermes-agent/references/contributor-guide.md
  and windows-quirks.md: same corrections (the bundled skill mirrors the
  contributor docs); Windows workaround no longer installs pytest-xdist
  or passes -n 0.
- website/docs + zh-Hans i18n mirrors: same fixes in adding-providers.md
  and the bundled-skill doc pages.
- skills/software-development/python-debugpy/SKILL.md (+ zh-Hans mirror):
  "-p no:xdist"/"-n 0" pdb advice rewritten for the captured per-file
  subprocess runner.
- skills/creative/comfyui/tests/README.md: parent-repo "-n auto by
  default" rationale updated to past tense.

Combined salvage of PR #38295 (konsisumer), PR #51354 (TutkuEroglu,
redirected to the current conftest truth and the relocated
references/contributor-guide.md), and PR #54956 (waroffchange).

Co-authored-by: TutkuEroglu <rrandqua@gmail.com>
Co-authored-by: waroffchange <116298975+waroffchange@users.noreply.github.com>
2026-07-29 23:16:18 -07:00
Jeff Watts
53f7d137ed fix(windows): native Windows correctness for CLI, gateway status, banner, and WSL browser paths
Salvaged from #57016 by @lEWFkRAD:
- cli.py: handle file:///C:/... drive-letter URIs on nt (strip the
  leading slash urlparse leaves); join Termux example paths with literal
  forward slashes so hints stay POSIX on Windows.
- gateway/status.py + hermes_cli/gateway.py: normalize backslashes to
  forward slashes before the HERMES_HOME substring match so separator
  style cannot defeat profile ownership detection.
- hermes_cli/banner.py: cprint degrades to plain print when
  prompt_toolkit has no console (NoConsoleScreenBufferError on
  redirected/absent Windows stdout).
- hermes_cli/browser_connect.py: posixpath.join for WSL /mnt/c/... bases
  (os.path.join would emit backslashes on nt).
- Test hardening: symlink skip-guards, USERPROFILE alongside HOME for
  ntpath.expanduser, SIGKILL absence skipif fixed via monkeypatch,
  drive-letter URI / separator-normalization / banner-fallback coverage.

Dropped from the original PR: tests/cli/conftest.py fixture and the
AppSession _output monkeypatch — main's merged tests/cli/conftest.py
already handles that prompt_toolkit pollution.
2026-07-29 23:16:18 -07:00
Brooklyn Nicholson
ba194c1d19 feat(desktop): File > Open Folder… menu item
No accelerator (⌘O stays a rebindable renderer keybind, matching New
Window's rationale); clicking routes hermes:open-folder-requested through
the preload bridge to the same openFolderAsProject flow.
2026-07-30 01:15:01 -05:00
Brooklyn Nicholson
a11611af39 feat(desktop): projects in the command palette
⌘K gains a Projects group carrying each project's own sidebar codicon.
Selecting one is a pure scope switch; holding ⌘/⌃ previews the variant —
the label swaps to 'New session in <project>' beside a ⌘↵ chip — and
⌘-Enter runs it. A pinned row opens the native picker, and typing an
absolute path offers the same upsert inline. modLabel/comboHint live on
PaletteItem, so the next modifier-variant row gets both for free.
2026-07-30 01:15:01 -05:00
Brooklyn Nicholson
5affcd6bf4 feat(desktop): open a folder as a project with ⌘O
workspace.openFolder (default mod+o, the editor-standard open-folder chord)
runs openFolderAsProject: pick a folder, enter the project that already owns
it or create one named after the folder, scope the sidebar, and land on a
fresh session draft anchored there. A stale backend without the projects.*
RPC still gets the workspace session, with a warning.

StartWorkSessionRequest grows an openTab flag so these opens-from-nowhere
stack a tab instead of spending an occupied main, and goToProject/
resolveNewSessionCwd share one projectRootCwd resolver.
2026-07-30 01:15:01 -05:00
Brooklyn Nicholson
7556c51234 fix(desktop): focus the tab restored by undo-close (⌘⇧T)
Adoption alone is silent, so reopenLastClosedTile only restored placement
and left the tab behind the still-fronted workspace. Focus it after open.
2026-07-30 01:14:11 -05:00
brooklyn!
382282d5a0
Merge pull request #74610 from NousResearch/bb/checkbox-indeterminate
fix(desktop): stop the checkbox painting the check and dash at once
2026-07-30 01:06:49 -05:00