feat: WSL support, js-yaml migration, and stability improvements

- PID/log files moved to ~/.hermes-web-ui/ for WSL compatibility
- Replace all regex YAML parsing with js-yaml in filesystem.ts
- Auto-detect WSL and use hermes gateway run for background startup
- Stop command: SIGTERM with SIGKILL fallback, clean stale PIDs
- Setup script: auto-install Node.js and hermes-web-ui

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-14 10:22:29 +08:00
parent 60056e771a
commit 8f8cf629bb
5 changed files with 183 additions and 180 deletions
+15 -1
View File
@@ -182,7 +182,7 @@ export async function getVersion(): Promise<string> {
}
/**
* Start Hermes gateway
* Start Hermes gateway (uses launchd/systemd)
*/
export async function startGateway(): Promise<string> {
const { stdout, stderr } = await execFileAsync('hermes', ['gateway', 'start'], {
@@ -191,6 +191,20 @@ export async function startGateway(): Promise<string> {
return stdout || stderr
}
/**
* Start Hermes gateway in background (for WSL where launchd/systemd is unavailable)
* Uses "hermes gateway run" as a detached background process
*/
export async function startGatewayBackground(): Promise<number | null> {
const { spawn } = require('child_process') as typeof import('child_process')
const child = spawn('hermes', ['gateway', 'run'], {
detached: true,
stdio: 'ignore',
})
child.unref()
return child.pid ?? null
}
/**
* Restart Hermes gateway
*/