mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-17 15:24:19 +00:00
* feat(plugins): ship portable agent bundles and installation guides * fix(plugins): align new manifests with current release * test(plugins): split caption fixture setup and cleanup * test(plugins): pass render fixture path as an argument
34 lines
1.2 KiB
JavaScript
34 lines
1.2 KiB
JavaScript
// Resolve CLI ownership once for matting, transcription, and shell rendering.
|
|
const fs = require("node:fs");
|
|
const path = require("node:path");
|
|
const os = require("node:os");
|
|
function hfCli(checkout) {
|
|
const root = path.resolve(__dirname, "../../..");
|
|
for (const dir of [checkout, process.env.HYPERFRAMES_ROOT].filter(Boolean)) {
|
|
const cli = path.join(dir, "packages/cli/dist/cli.js");
|
|
if (fs.existsSync(cli)) return cli;
|
|
}
|
|
const manifests = [
|
|
"plugin.json",
|
|
".claude-plugin/plugin.json",
|
|
".codex-plugin/plugin.json",
|
|
".cursor-plugin/plugin.json",
|
|
"gemini-extension.json",
|
|
];
|
|
if (
|
|
!fs.existsSync(path.join(root, "packages/cli/dist/cli.js")) &&
|
|
manifests.some((p) => fs.existsSync(path.join(root, p)))
|
|
) {
|
|
return path.join(root, "skills/hyperframes/scripts/plugin-cli.mjs");
|
|
}
|
|
for (const dir of [root, path.join(os.homedir(), "Downloads/hyperframes")].filter(Boolean)) {
|
|
const cli = path.join(dir, "packages/cli/dist/cli.js");
|
|
if (fs.existsSync(cli)) return cli;
|
|
}
|
|
throw new Error(
|
|
"HyperFrames CLI unavailable: install the full plugin or set HYPERFRAMES_ROOT to a built checkout.",
|
|
);
|
|
}
|
|
module.exports = { hfCli };
|
|
if (require.main === module) console.log(hfCli(process.argv[2]));
|