fix(tui): include apps/shared in npm build source - #1
Merged
Conversation
…workspace dependency The TUI imports from @hermes/shared/charge-settlement and other shared modules, but mkNpmPassthru only included 'ui-tui' in the build source. This meant apps/shared/package.json was present (for npm workspace resolution) but apps/shared/src/ was not — so the actual TypeScript source files like charge-settlement.ts were missing at build time.
ryjen
pushed a commit
that referenced
this pull request
Jul 20, 2026
…reaming Two real render-cost wins found by inspection (no behavior change): 1. Sidebar re-rendered on every stream token. $sessionStates is republished on every message delta (tens/sec during a turn), and the derived ID computeds ($workingSessionIds, $attentionSessionIds, $backgroundRunningSessionIds) allocated a fresh array each time. nanostores notifies on !==, so the whole ChatSidebar + every mounted row re-rendered per token even when the working/ attention/background set was unchanged. Return the previous array reference when the contents match → nanostores skips the notify unless the set actually changes. Turns streaming from O(visible rows)/token into O(0) for the sidebar. 2. Tool rows normalized the FULL uncapped detail every render. `looksRedundant` (lowercase + whitespace-collapse over the entire read_file/terminal payload) ran twice in the ToolEntry render body, so every completed tool re-normalized its whole output on every stream tick of the running message. Memoize on the view fields so it recomputes only when the tool's content changes. Both are correctness-preserving (stable refs + memoization). The CI stream scenario drives $messages directly, not the publishSessionState path, so it won't reflect #1 — verified by inspection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The TUI build (
nix/tui.nix) only includesui-tuiin the npm build source viamkNpmPassthru. Whileapps/shared/package.jsonis present (pulled in bynpmWorkspaceFilesfor npm workspace resolution), theapps/shared/src/directory with the actual TypeScript source files is excluded.This means
@hermes/shared/charge-settlement(and other subpath exports fromapps/shared/package.json) fail to resolve at build time:Root Cause
mkNpmSrcinnix/lib.nixconstructs the build source from:package.jsonmanifests (vianpmWorkspaceFiles)dirsSince
dirs = [ "ui-tui" ], onlyapps/shared/package.jsonis included — notapps/shared/src/.Fix
Add
"apps/shared"to the dirs list so the fullapps/shared/tree is available in the TUI build source.Validation
nix build .#checks.x86_64-linux.hermes-tuipassesnix build .#packages.x86_64-linux.defaultsucceeds