mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-10 08:32:09 +00:00
- Feature Nous Portal as the primary onboarding card (Recommended tag, app logo, single pitch line); collapse other OAuth providers behind an "Other providers" disclosure whose open/closed state persists. - Surface OpenRouter as a one-click API-key option inside the disclosure; move "I have an API key" to a quiet bottom-right link. - Treat "no provider configured" as a normal onboarding state, not a red error banner (provider-setup-errors copy match). - Fix setup.runtime_check: it reported ready when the resolved runtime had an empty credential or only implicit Bedrock/IAM, so fresh installs never saw onboarding. Now requires a usable credential. - Auto-wire Windows fonts for WSL2 users so the renderer renders real Segoe UI instead of the DejaVu fallback; make WSL detection env-independent via the /proc kernel marker.
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
const fs = require('node:fs')
|
|
|
|
function isWslEnvironment(env = process.env, platform = process.platform, kernelRelease = null) {
|
|
if (platform !== 'linux') return false
|
|
if (env.WSL_DISTRO_NAME || env.WSL_INTEROP) return true
|
|
|
|
try {
|
|
const release = kernelRelease ?? fs.readFileSync('/proc/sys/kernel/osrelease', 'utf8')
|
|
return /microsoft|wsl/i.test(release)
|
|
} catch {
|
|
return false
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|