mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-04 04:46:59 +00:00
* fix(skills): skill scripts run when the skills dir is a symlink * test(skills): plugin launcher fixture ships the shared main-module helper like an install * fix(skills): the CLI's cube validator runs through a symlink too, and the guard check is stricter * docs(skills): long agent-started renders run detached in their own process group * docs(cli): detached renders start in their own process group, on macOS too * docs(cli): the detached render recipe never waits on terminal input
14 lines
479 B
JavaScript
14 lines
479 B
JavaScript
import { realpathSync } from "node:fs";
|
|
import { pathToFileURL } from "node:url";
|
|
|
|
// Node resolves symlinks in the main module's import.meta.url but argv[1] keeps the invoked
|
|
// spelling (a symlinked skills dir, or /tmp vs /private/tmp on macOS), so compare real paths.
|
|
export function isMainModule(importMetaUrl) {
|
|
if (!process.argv[1]) return false;
|
|
try {
|
|
return pathToFileURL(realpathSync(process.argv[1])).href === importMetaUrl;
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|