Fix bridge history, profile models, and Windows gateway handling (#845)
* feat: support profile-aware group chat bridge flows * feat: route cron jobs through hermes cli * Fix group chat routing and isolate bridge tests * Add Grok image-to-video media skill * Default Grok videos to media directory * Fix bridge profile fallback and cron repeat clearing * Refine bridge chat and gateway platform handling * Filter bridge tool-call text deltas * Preserve structured bridge chat history * Prepare beta release build artifacts * Fix Windows run profile resolution * Fix Windows path compatibility checks * Fix profile-scoped model page display * Hide Windows subprocess windows for jobs and updates * Hide Windows file backend subprocess windows * Avoid Windows gateway restart lock conflicts * Treat Windows gateway lock as running on startup * Force release Windows gateway lock on restart * Tighten Windows gateway lock cleanup * Update chat e2e source expectation * Bump package version to 0.5.30 --------- Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* - 用户自定义: HERMES_HOME 环境变量
|
||||
*/
|
||||
|
||||
import { basename, dirname, resolve, join } from 'path'
|
||||
import { basename, dirname, isAbsolute, relative, resolve, join } from 'path'
|
||||
import { homedir } from 'os'
|
||||
|
||||
/**
|
||||
@@ -62,3 +62,20 @@ export function getHermesBin(customBin?: string): string {
|
||||
if (process.env.HERMES_BIN?.trim()) return process.env.HERMES_BIN.trim()
|
||||
return 'hermes'
|
||||
}
|
||||
|
||||
function comparablePath(path: string): string {
|
||||
return process.platform === 'win32' ? path.toLowerCase() : path
|
||||
}
|
||||
|
||||
export function isPathWithin(targetPath: string, basePath: string): boolean {
|
||||
const base = resolve(basePath)
|
||||
const target = resolve(targetPath)
|
||||
const rel = relative(comparablePath(base), comparablePath(target))
|
||||
return rel === '' || (!!rel && !rel.startsWith('..') && !isAbsolute(rel))
|
||||
}
|
||||
|
||||
export function relativePathFromBase(targetPath: string, basePath: string): string | null {
|
||||
if (!isPathWithin(targetPath, basePath)) return null
|
||||
const rel = relative(resolve(basePath), resolve(targetPath))
|
||||
return rel.replace(/\\/g, '/')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user