mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-09 08:21:50 +00:00
* feat: uninstall the Chat GUI without removing the agent (CLI + desktop UI) Adds a GUI-only uninstall path so people can remove the desktop Chat GUI while keeping the Hermes agent + their config/sessions/.env, and surfaces the three CLI uninstall modes inside the desktop app's Settings → About. CLI: - New hermes_cli/gui_uninstall.py: cross-platform discovery + removal of the desktop GUI's artifacts (source-built dist/release/node_modules + build stamp, the packaged app bundle, and the Electron userData dir) on Linux, macOS, and Windows. Never touches the agent source, venv, or user data. - `hermes uninstall --gui` removes only the Chat GUI; `--gui-summary` prints a JSON install snapshot (used by the desktop UI to gate options + detect a missing agent for a future lite client). - `hermes uninstall --yes` / `--full --yes` now run non-interactively, sharing the destructive sequence via a new _perform_uninstall() helper. The keep-data and full flows also sweep the GUI artifacts. Desktop: - electron/desktop-uninstall.cjs: pure helpers mapping each mode (gui/lite/full) to CLI flags, resolving the running app bundle per OS, and building the detached cleanup script that waits for the app to exit, runs the Python uninstall, and removes the bundle. - IPC hermes:uninstall:summary / :run, preload bridge, and types. - Settings → About "Danger zone" with the three options; agent-removing options hide when no local agent is detected. Tests: tests/hermes_cli/test_gui_uninstall.py (22 pass with the existing uninstall tests), electron/desktop-uninstall.test.cjs (17 pass, wired into test:desktop:platforms). Docs: desktop.md "Uninstalling" + cli-commands.md. * fix(desktop): tear down backend process tree before GUI uninstall (Windows lock safety) The desktop uninstall cleanup script waited only on the desktop app's own PID, but a backend grandchild (gateway / pty terminal / hermes REPL) can outlive it and keep hermes.exe + venv files mandatory-locked on Windows — making the script's rmdir half-fail and leaving a partial install, the same failure class as the self-update path's #37532. - main.cjs: runDesktopUninstall now awaits releaseBackendLock() before spawning the cleanup script — tree-kills every backend PID the desktop owns (primary + pool) via taskkill /T /F and polls the venv shim until unlocked. Extracted the shared core out of releaseBackendLockForUpdate so both the update hand-off and the uninstaller use the identical, incident-hardened teardown. No-op on macOS/Linux (no mandatory locks). - desktop-uninstall.cjs: Windows cleanup script removes the bundle via a bounded rmdir retry loop (10x, 1s) instead of a single rmdir, since Windows releases directory handles lazily even after the holding process exits. - Dropped a fragile tasklist|findstr reap-by-path attempt; the Electron-side tree-kill-by-PID is the reliable mechanism. Tests: desktop-uninstall.test.cjs updated for the retry-loop output (17 pass). * fix(desktop): address review on GUI uninstall (venv self-delete, gates, wait-loop) Resolves @OutThisLife's review on #40355: 1. full mode now gated on agent presence (needsAgent: true). It removes the agent + user data, so on a lite client with no local agent it's hidden like lite — no more offering to remove an agent that isn't there. 2. (Finding 3, the real bug) lite/full no longer rmtree the venv from the venv's OWN python. On Windows a running python.exe is mandatory-locked, so that half-fails. New lightweight 'python -m hermes_cli.uninstall --mode X' entrypoint (stdlib-only imports) lets the desktop run agent-removing modes under the SYSTEM python (findSystemPython) with PYTHONPATH=<agentRoot>, so import hermes_cli resolves from source while the venv is torn down. Falls back to venv python + logs when no system python (gui-only unaffected). 3. Windows wait-loop is now bounded (60 tries, matching POSIX) and matches the PID as a whole space-delimited token via findstr (no substring 99->990 trap, no redundant bare find). set HERMES_HOME/PID/PYTHONPATH now quoted. 4. Renamed the misleading 'returns null for dev run' test — the dev-run safety is shouldRemoveAppBundle(isPackaged=false), which the test now asserts. Docs: note that --gui on a source checkout also sweeps node_modules/build output. Tests: 18 python + 19 desktop pass.
238 lines
8.2 KiB
JSON
238 lines
8.2 KiB
JSON
{
|
|
"name": "hermes",
|
|
"productName": "Hermes",
|
|
"private": true,
|
|
"version": "0.15.1",
|
|
"description": "Native desktop shell for Hermes Agent.",
|
|
"author": "Nous Research",
|
|
"type": "module",
|
|
"main": "electron/main.cjs",
|
|
"engines": {
|
|
"node": "^20.19.0 || >=22.12.0"
|
|
},
|
|
"scripts": {
|
|
"dev": "concurrently -k \"npm:dev:renderer\" \"npm:dev:electron\"",
|
|
"dev:fake-boot": "cross-env HERMES_DESKTOP_BOOT_FAKE=1 HERMES_DESKTOP_BOOT_FAKE_STEP_MS=650 npm run dev",
|
|
"dev:renderer": "node scripts/assert-root-install.cjs && vite --host 127.0.0.1 --port 5174",
|
|
"dev:electron": "wait-on http://127.0.0.1:5174 && cross-env XCURSOR_SIZE=24 HERMES_DESKTOP_DEV_SERVER=http://127.0.0.1:5174 electron .",
|
|
"profile:main": "wait-on http://127.0.0.1:5174 && cross-env XCURSOR_SIZE=24 HERMES_DESKTOP_DEV_SERVER=http://127.0.0.1:5174 electron --inspect=9229 .",
|
|
"profile:main:cpu": "wait-on http://127.0.0.1:5174 && cross-env XCURSOR_SIZE=24 NODE_OPTIONS=--cpu-prof HERMES_DESKTOP_DEV_SERVER=http://127.0.0.1:5174 electron .",
|
|
"start": "npm run build && electron .",
|
|
"build": "node scripts/assert-root-install.cjs && node scripts/write-build-stamp.cjs && node scripts/stage-native-deps.cjs && tsc -b && vite build",
|
|
"builder": "cross-env NODE_OPTIONS=--max-old-space-size=16384 electron-builder",
|
|
"pack": "npm run build && npm run builder -- --dir",
|
|
"dist": "npm run build && npm run builder",
|
|
"dist:mac": "npm run build && npm run builder -- --mac",
|
|
"dist:mac:dmg": "npm run build && npm run builder -- --mac dmg",
|
|
"dist:mac:zip": "npm run build && npm run builder -- --mac zip",
|
|
"dist:win": "npm run build && npm run builder -- --win",
|
|
"dist:win:msi": "npm run build && npm run builder -- --win msi",
|
|
"dist:win:nsis": "npm run build && npm run builder -- --win nsis",
|
|
"dist:linux": "npm run build && npm run builder -- --linux AppImage deb rpm",
|
|
"test:desktop": "node scripts/test-desktop.mjs",
|
|
"test:desktop:all": "node scripts/test-desktop.mjs all",
|
|
"test:desktop:dmg": "node scripts/test-desktop.mjs dmg",
|
|
"test:desktop:nsis": "node scripts/test-desktop.mjs nsis",
|
|
"test:desktop:existing": "node scripts/test-desktop.mjs existing",
|
|
"test:desktop:fresh": "node scripts/test-desktop.mjs fresh",
|
|
"test:desktop:platforms": "node --test electron/bootstrap-platform.test.cjs electron/hardening.test.cjs electron/backend-probes.test.cjs electron/bootstrap-runner.test.cjs electron/connection-config.test.cjs electron/gateway-ws-probe.test.cjs electron/oauth-net-request.test.cjs electron/desktop-uninstall.test.cjs",
|
|
"type-check": "tsc -b",
|
|
"lint": "eslint src/ electron/",
|
|
"lint:fix": "eslint src/ electron/ --fix",
|
|
"fmt": "prettier --write 'src/**/*.{ts,tsx}' 'electron/**/*.{js,cjs}' 'vite.config.ts'",
|
|
"fix": "npm run lint:fix && npm run fmt",
|
|
"test:ui": "vitest run --environment jsdom",
|
|
"preview": "node scripts/assert-root-install.cjs && vite preview --host 127.0.0.1 --port 4174"
|
|
},
|
|
"dependencies": {
|
|
"@assistant-ui/react": "^0.12.28",
|
|
"@assistant-ui/react-streamdown": "^0.1.11",
|
|
"@audiowave/react": "^0.6.2",
|
|
"@chenglou/pretext": "^0.0.6",
|
|
"@dnd-kit/core": "^6.3.1",
|
|
"@dnd-kit/sortable": "^10.0.0",
|
|
"@dnd-kit/utilities": "^3.2.2",
|
|
"@hermes/shared": "file:../shared",
|
|
"@icons-pack/react-simple-icons": "^13.13.0",
|
|
"@nanostores/react": "^1.1.0",
|
|
"@nous-research/ui": "^0.13.0",
|
|
"@radix-ui/react-slot": "^1.2.4",
|
|
"@streamdown/code": "^1.1.1",
|
|
"@tabler/icons-react": "^3.41.1",
|
|
"@tailwindcss/typography": "^0.5.19",
|
|
"@tailwindcss/vite": "^4.2.4",
|
|
"@tanstack/react-query": "^5.100.6",
|
|
"@tanstack/react-virtual": "^3.13.24",
|
|
"@vscode/codicons": "^0.0.45",
|
|
"@xterm/addon-fit": "^0.11.0",
|
|
"@xterm/addon-unicode11": "^0.9.0",
|
|
"@xterm/addon-web-links": "^0.12.0",
|
|
"@xterm/addon-webgl": "^0.19.0",
|
|
"@xterm/xterm": "^6.0.0",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"cmdk": "^1.1.1",
|
|
"hast-util-from-html-isomorphic": "^2.0.0",
|
|
"hast-util-to-text": "^4.0.2",
|
|
"ignore": "^7.0.5",
|
|
"katex": "^0.16.45",
|
|
"leva": "^0.10.1",
|
|
"motion": "^12.38.0",
|
|
"nanostores": "^1.3.0",
|
|
"node-pty": "1.1.0",
|
|
"radix-ui": "^1.4.3",
|
|
"react": "^19.2.5",
|
|
"react-arborist": "^3.5.0",
|
|
"react-dom": "^19.2.5",
|
|
"react-router-dom": "^7.17.0",
|
|
"react-shiki": "^0.9.3",
|
|
"remark-math": "^6.0.0",
|
|
"shiki": "^4.0.2",
|
|
"streamdown": "^2.5.0",
|
|
"tailwind-merge": "^3.5.0",
|
|
"tailwindcss": "^4.2.4",
|
|
"tw-shimmer": "^0.4.11",
|
|
"unicode-animations": "^1.0.3",
|
|
"unified": "^11.0.5",
|
|
"unist-util-visit-parents": "^6.0.2",
|
|
"vfile": "^6.0.3",
|
|
"web-haptics": "^0.0.6"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^9.39.4",
|
|
"@testing-library/dom": "^10.4.0",
|
|
"@testing-library/react": "^16.3.2",
|
|
"@types/hast": "^3.0.4",
|
|
"@types/node": "^24.12.2",
|
|
"@types/react": "^19.2.14",
|
|
"@types/react-dom": "^19.2.3",
|
|
"@typescript-eslint/eslint-plugin": "^8.59.1",
|
|
"@typescript-eslint/parser": "^8.59.1",
|
|
"@vitejs/plugin-react": "^6.0.1",
|
|
"concurrently": "^9.2.1",
|
|
"cross-env": "^10.1.0",
|
|
"electron": "^40.9.3",
|
|
"electron-builder": "^26.8.1",
|
|
"eslint": "^9.39.4",
|
|
"eslint-plugin-perfectionist": "^5.9.0",
|
|
"eslint-plugin-react": "^7.37.5",
|
|
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
"globals": "^16.5.0",
|
|
"jsdom": "^29.1.1",
|
|
"prettier": "^3.8.3",
|
|
"rcedit": "^5.0.2",
|
|
"typescript": "^6.0.3",
|
|
"vite": "^8.0.10",
|
|
"vitest": "^4.1.5",
|
|
"wait-on": "^9.0.5"
|
|
},
|
|
"build": {
|
|
"electronVersion": "40.9.3",
|
|
"appId": "com.nousresearch.hermes",
|
|
"productName": "Hermes",
|
|
"executableName": "Hermes",
|
|
"artifactName": "Hermes-${version}-${os}-${arch}.${ext}",
|
|
"icon": "assets/icon",
|
|
"directories": {
|
|
"output": "release"
|
|
},
|
|
"files": [
|
|
"dist/**",
|
|
"assets/**",
|
|
"electron/**",
|
|
"public/**",
|
|
"package.json"
|
|
],
|
|
"beforeBuild": "scripts/before-build.cjs",
|
|
"beforePack": "scripts/before-pack.cjs",
|
|
"afterPack": "scripts/after-pack.cjs",
|
|
"extraResources": [
|
|
{
|
|
"from": "build/install-stamp.json",
|
|
"to": "install-stamp.json"
|
|
},
|
|
{
|
|
"from": "build/native-deps",
|
|
"to": "native-deps"
|
|
},
|
|
{
|
|
"from": "assets/icon.ico",
|
|
"to": "icon.ico"
|
|
}
|
|
],
|
|
"asar": true,
|
|
"afterSign": "scripts/notarize.cjs",
|
|
"asarUnpack": [
|
|
"**/*.node",
|
|
"**/prebuilds/**"
|
|
],
|
|
"mac": {
|
|
"category": "public.app-category.developer-tools",
|
|
"entitlements": "electron/entitlements.mac.plist",
|
|
"entitlementsInherit": "electron/entitlements.mac.inherit.plist",
|
|
"extendInfo": {
|
|
"CFBundleDisplayName": "Hermes",
|
|
"CFBundleExecutable": "Hermes",
|
|
"CFBundleName": "Hermes",
|
|
"NSAudioCaptureUsageDescription": "Hermes uses audio capture for voice conversations.",
|
|
"NSMicrophoneUsageDescription": "Hermes uses the microphone for voice input and voice conversations."
|
|
},
|
|
"gatekeeperAssess": false,
|
|
"hardenedRuntime": true,
|
|
"target": [
|
|
"dmg",
|
|
"zip"
|
|
]
|
|
},
|
|
"dmg": {
|
|
"title": "Install Hermes",
|
|
"backgroundColor": "#f5f5f7",
|
|
"iconSize": 96,
|
|
"window": {
|
|
"width": 560,
|
|
"height": 360
|
|
},
|
|
"contents": [
|
|
{
|
|
"x": 160,
|
|
"y": 170,
|
|
"type": "file"
|
|
},
|
|
{
|
|
"x": 400,
|
|
"y": 170,
|
|
"type": "link",
|
|
"path": "/Applications"
|
|
}
|
|
]
|
|
},
|
|
"win": {
|
|
"legalTrademarks": "Hermes",
|
|
"target": [
|
|
"nsis",
|
|
"msi"
|
|
],
|
|
"signAndEditExecutable": false
|
|
},
|
|
"linux": {
|
|
"category": "Development",
|
|
"maintainer": "Nous Research <support@nousresearch.com>",
|
|
"synopsis": "Native desktop shell for Hermes Agent.",
|
|
"target": [
|
|
"AppImage",
|
|
"deb",
|
|
"rpm"
|
|
]
|
|
},
|
|
"nsis": {
|
|
"oneClick": false,
|
|
"allowToChangeInstallationDirectory": true,
|
|
"perMachine": false,
|
|
"shortcutName": "Hermes",
|
|
"uninstallDisplayName": "Hermes",
|
|
"warningsAsErrors": false
|
|
}
|
|
}
|
|
}
|