Skip to content

fix(tui): include apps/shared in npm build source - #1

Merged
ryjen merged 1 commit into
mainfrom
fix/tui-shared-src
Jul 20, 2026
Merged

fix(tui): include apps/shared in npm build source#1
ryjen merged 1 commit into
mainfrom
fix/tui-shared-src

Conversation

@ryjen

@ryjen ryjen commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Problem

The TUI build (nix/tui.nix) only includes ui-tui in the npm build source via mkNpmPassthru. While apps/shared/package.json is present (pulled in by npmWorkspaceFiles for npm workspace resolution), the apps/shared/src/ directory with the actual TypeScript source files is excluded.

This means @hermes/shared/charge-settlement (and other subpath exports from apps/shared/package.json) fail to resolve at build time:

ERROR: Could not resolve "@hermes/shared/charge-settlement"

Root Cause

mkNpmSrc in nix/lib.nix constructs the build source from:

  1. All workspace member package.json manifests (via npmWorkspaceFiles)
  2. Recursive inclusion of directories listed in dirs

Since dirs = [ "ui-tui" ], only apps/shared/package.json is included — not apps/shared/src/.

Fix

Add "apps/shared" to the dirs list so the full apps/shared/ tree is available in the TUI build source.

Validation

  • nix build .#checks.x86_64-linux.hermes-tui passes
  • nix build .#packages.x86_64-linux.default succeeds

…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
ryjen merged commit 06e7d5e into main Jul 20, 2026
@ryjen
ryjen deleted the fix/tui-shared-src branch July 20, 2026 00:30
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.
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