mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-21 03:39:54 +00:00
89d5ee4b10
Add phase-based desktop boot progress, fresh-install sandbox testing, and first-run provider credential onboarding so packaged installs can start cleanly without manual settings detours.
31 lines
862 B
JavaScript
31 lines
862 B
JavaScript
function isWslEnvironment(env = process.env, platform = process.platform) {
|
|
if (platform !== 'linux') return false
|
|
return Boolean(env.WSL_DISTRO_NAME || env.WSL_INTEROP)
|
|
}
|
|
|
|
function isWindowsBinaryPathInWsl(filePath, options = {}) {
|
|
const isWsl = options.isWsl ?? isWslEnvironment(options.env, options.platform)
|
|
if (!isWsl) return false
|
|
|
|
const normalized = String(filePath || '')
|
|
.replace(/\\/g, '/')
|
|
.toLowerCase()
|
|
|
|
return (
|
|
normalized.endsWith('.exe') ||
|
|
normalized.endsWith('.cmd') ||
|
|
normalized.endsWith('.bat') ||
|
|
normalized.endsWith('.ps1')
|
|
)
|
|
}
|
|
|
|
function bundledRuntimeImportCheck(platform = process.platform) {
|
|
return platform === 'win32' ? 'import fastapi, uvicorn, winpty' : 'import fastapi, uvicorn, ptyprocess'
|
|
}
|
|
|
|
module.exports = {
|
|
bundledRuntimeImportCheck,
|
|
isWindowsBinaryPathInWsl,
|
|
isWslEnvironment
|
|
}
|