mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-27 01:11:40 +00:00
feat(tui): /model and /setup slash commands with in-place CLI handoff
- hermes-ink: export `withInkSuspended()` + `useExternalProcess()` that pause/resume Ink around an arbitrary external process (built on the existing enterAlternateScreen/exitAlternateScreen plumbing) - tui: `launchHermesCommand(args)` spawns the `hermes` binary with inherited stdio, with `HERMES_BIN` override for non-standard launches - tui: `/model` and `/setup` slash commands invoke the CLI wizards in-place, then re-preflight `setup.status` and auto-start a session on success — no more exit-and-relaunch to finish first-run setup - setup panel now advertises those slashes instead of only pointing users back at the shell
This commit is contained in:
parent
0dd5055d59
commit
a82097e7a2
8 changed files with 141 additions and 7 deletions
16
ui-tui/src/lib/externalCli.ts
Normal file
16
ui-tui/src/lib/externalCli.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { spawn } from 'node:child_process'
|
||||
|
||||
export interface LaunchResult {
|
||||
code: null | number
|
||||
error?: string
|
||||
}
|
||||
|
||||
const resolveHermesBin = () => process.env.HERMES_BIN?.trim() || 'hermes'
|
||||
|
||||
export const launchHermesCommand = (args: string[]): Promise<LaunchResult> =>
|
||||
new Promise(resolve => {
|
||||
const child = spawn(resolveHermesBin(), args, { stdio: 'inherit' })
|
||||
|
||||
child.on('error', err => resolve({ code: null, error: err.message }))
|
||||
child.on('exit', code => resolve({ code }))
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue