mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-20 05:01:30 +00:00
refactor(docker): drop manual @hermes/ink build, rely on esbuild bundle
the esbuild pipeline (scripts/build.mjs) already bundles ink into a single self-contained dist/entry.js. remove the Dockerfile steps that manually copied packages/hermes-ink into node_modules/@hermes/ink and ran a nested npm install there. - Dockerfile: simplify TUI build step to just 'npm run build' - hermes_cli/main.py: _tui_build_needed now checks dist/entry.js staleness against source files before falling back to the old ink-bundle.js logic - tests: update TUI npm install tests and drop the Dockerfile contract test for the removed ink materialization step
This commit is contained in:
parent
279504d5b8
commit
42e166c7ea
4 changed files with 47 additions and 24 deletions
|
|
@ -922,9 +922,39 @@ def _find_bundled_tui(tui_dir: Path) -> Optional[Path]:
|
|||
|
||||
|
||||
def _tui_build_needed(tui_dir: Path) -> bool:
|
||||
entry = tui_dir / "dist" / "entry.js"
|
||||
# In the esbuild pipeline, ink is bundled into dist/entry.js directly.
|
||||
# If the main bundle exists and is up to date with all source files,
|
||||
# no separate ink rebuild is needed.
|
||||
if entry.exists():
|
||||
dist_m = entry.stat().st_mtime
|
||||
skip = frozenset({"node_modules", "dist"})
|
||||
stale = False
|
||||
for dirpath, dirnames, filenames in os.walk(tui_dir, topdown=True):
|
||||
dirnames[:] = [d for d in dirnames if d not in skip]
|
||||
for fn in filenames:
|
||||
if fn.endswith((".ts", ".tsx")):
|
||||
if os.path.getmtime(os.path.join(dirpath, fn)) > dist_m:
|
||||
stale = True
|
||||
break
|
||||
if stale:
|
||||
break
|
||||
if not stale:
|
||||
for meta in (
|
||||
"package.json",
|
||||
"package-lock.json",
|
||||
"tsconfig.json",
|
||||
"tsconfig.build.json",
|
||||
):
|
||||
mp = tui_dir / meta
|
||||
if mp.exists() and mp.stat().st_mtime > dist_m:
|
||||
stale = True
|
||||
break
|
||||
if not stale:
|
||||
return False
|
||||
|
||||
if _hermes_ink_bundle_stale(tui_dir):
|
||||
return True
|
||||
entry = tui_dir / "dist" / "entry.js"
|
||||
if not entry.exists():
|
||||
return True
|
||||
dist_m = entry.stat().st_mtime
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue