mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-02 07:11:49 +00:00
Three small follow-ups from the Copilot review on #27489: 1. Declare `wrap-ansi` as a direct dependency of `ui-tui`. It was a phantom dep that resolved via npm hoisting from `@hermes/ink`'s transitive graph — fine on hoisted installs, but breaks under pnpm or `npm install --no-install-strategy=hoisted` style isolated installs. Now listed as `"wrap-ansi": "^9.0.0"` matching the @hermes/ink version. Lockfile regenerated. 2. Implement the defensive resync the comment promised. Previously the comment claimed the loop would "fall back to advancing by one to stay in lockstep" on wrap-ansi desync, but the code unconditionally advanced `originalIdx` with no actual check — so any future wrap-ansi option change or styled-input caller could silently slide `originalIdx` past the end of `value` and emit garbage line ranges. Now actually compares `value[originalIdx] === ch`, re-syncs via `indexOf` on mismatch, and bails out (returning whatever was built so far) if the desync is unrecoverable. Production paths still hit the equality fast-path on every char. 3. Drop the `visualLines` wrapper. It was a one-line indirection over `visualLinesFromWrappedOutput`. Renamed the implementation to `visualLines` and removed the wrapper — same name, no extra layer. No behavior change beyond the defensive realign; all 791 vitest tests still pass.
51 lines
1.5 KiB
JSON
51 lines
1.5 KiB
JSON
{
|
|
"name": "hermes-tui",
|
|
"version": "0.0.1",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "npm run build --prefix packages/hermes-ink && tsx --watch src/entry.tsx",
|
|
"start": "tsx src/entry.tsx",
|
|
"build": "node scripts/build.mjs",
|
|
"type-check": "tsc --noEmit -p tsconfig.json",
|
|
"lint": "eslint src/ packages/",
|
|
"lint:fix": "eslint src/ packages/ --fix",
|
|
"fmt": "prettier --write 'src/**/*.{ts,tsx}' 'packages/**/*.{ts,tsx}'",
|
|
"fix": "npm run lint:fix && npm run fmt",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest"
|
|
},
|
|
"dependencies": {
|
|
"@hermes/ink": "file:./packages/hermes-ink",
|
|
"@nanostores/react": "^1.1.0",
|
|
"ink": "^6.8.0",
|
|
"ink-text-input": "^6.0.0",
|
|
"nanostores": "^1.2.0",
|
|
"react": "^19.2.4",
|
|
"unicode-animations": "^1.0.3",
|
|
"wrap-ansi": "^9.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"@babel/cli": "^7.28.6",
|
|
"@babel/core": "^7.29.0",
|
|
"@babel/plugin-syntax-jsx": "^7.28.6",
|
|
"@eslint/js": "^9",
|
|
"@types/node": "^25.5.0",
|
|
"@types/react": "^19.2.14",
|
|
"@typescript-eslint/eslint-plugin": "^8",
|
|
"@typescript-eslint/parser": "^8",
|
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
"esbuild": "~0.27.0",
|
|
"eslint": "^9",
|
|
"eslint-plugin-perfectionist": "^5",
|
|
"eslint-plugin-react": "^7",
|
|
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
"eslint-plugin-react-hooks": "^7",
|
|
"eslint-plugin-unused-imports": "^4",
|
|
"globals": "^16",
|
|
"prettier": "^3",
|
|
"tsx": "^4.19.0",
|
|
"typescript": "^5.7.0",
|
|
"vitest": "^4.1.3"
|
|
}
|
|
}
|