Loading files
710fbeaaeThis file is pinned to the selected release. Download the original to open it in your design tool.
Files from this revision, including CAD and LFS contents. Git history is not included.
Or in GitHub Desktop, choose File → Clone repository → URL and paste this address.
Public repositories can be cloned without signing in. For pushing, use your ThingAtlas username and a Git access token as the password.
git lfs install git clone https://thingatlas.com/git/-unclaimed/openharness-1322671404.git
Includes Git history, branches, and Git LFS files. Clones the repository’s default branch, regardless of the version shown here.
710fbeaaeThis file is pinned to the selected release. Download the original to open it in your design tool.
/**
* Which Hermes home a live `hermes` process was launched under, read off its environment.
*
* The free half of the answer `home.ts` documents: when the engine exports `HERMES_HOME` for a
* `hermes -p <name>` session, one cached `ps` names the home and the registry row is filled before any
* store is opened. When it does not, this says nothing (`null`) and the session-id lookup answers
* instead — which is why nothing here is load-bearing.
*
* Same three answers as `codexHomeProbe`: a path for a non-default home, `null` for the default or an
* engine that said nothing, and `undefined` when the process could not be read at all, which must
* never overwrite what the registry already knows.
*/
import type { AgentEngine } from '../types.js'
import { readProcessEnv } from '../../lib/processEnv.js'
import type { ProcessIdentity } from '../../lib/registry.js'
import { hermesHomeFromEnv } from './home.js'
export async function probeHermesHome(identity: ProcessIdentity, engine: AgentEngine): Promise<string | null | undefined> {
if (engine !== 'hermes') return null
const processEnv = await readProcessEnv(identity)
if (!processEnv) return undefined
return hermesHomeFromEnv(engine, processEnv)
}