mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 16:08:56 +00:00
* fix(cli): resolve helper programs from PATH, never the working directory On Windows a bare command name is looked up in the working directory before PATH. The CLI now sets NoDefaultCurrentDirectoryInExePath at startup, which Node's spawn and cmd.exe both honor and child processes inherit, so tools such as powershell.exe, taskkill and npx.cmd always come from PATH. The shared ffmpeg/ffprobe resolver no longer scans the working directory on Windows and skips relative PATH entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): keep Python helpers from importing files in the working directory `python -c` and `python -m` put the working directory first on sys.path, so a file in the project named like a probed module ran instead of the installed package. Inline helper code now drops that entry before any import, and `-m` helpers (pip) run through runpy after the same step. Paths and arguments are unchanged. On Windows, findPython also skips a `where` match in the working directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): run the skills installer and nested CLI calls independent of the project The global skills install ran `npx skills@<pin>` in the current folder, so npm could take the package or registry from that project's node_modules or .npmrc. It now runs from the home folder; the install is global either way. When the CLI starts the media-use engine it hands over its own entry file. The local voice fallback and the audio helpers then run that same CLI with the same Node instead of resolving `npx hyperframes` from the project. Without a handed-over entry they behave as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(media-use): load only provider keys from a project .env The audio scripts copied every key of a project .env into their environment except two. They now take the same kind of short allowlist the CLI uses: HeyGen, ElevenLabs and Gemini API keys plus a few harmless settings. Program overrides, runtime options, credential files and the credential store path come only from the person's own environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): build whisper.cpp only from a pinned, verified release The source-build fallback cloned the upstream default branch. It now clones the v1.9.5 release tag and refuses to build unless the checkout is the reviewed commit for that tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): keep registry caches apart and refuse config install targets Registry cache file names now include a digest of the exact registry URL, and each entry records the URL it came from, so one registry's cached manifest is never read for another. Entries from older versions are refetched once. Registry installs refuse targets inside .git or any hidden directory, hidden configuration files, and package.json, hyperframes.json and hyperframes.lock.json. An example installed by `init` may still bring its own package.json and .gitignore. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(capture): keep page text to one line in agent files and validate Vertex keys Capture writes AGENTS.md, CLAUDE.md and .cursorrules from the page's title, font names and colours. Page text is now flattened to one short line and colours must be hex values. Existing agent files that capture did not write are kept, with a warning. HYPERFRAMES_VERTEX_SERVICE_ACCOUNT must now be a plain service-account key with a Google token endpoint; other credential types skip captioning with a warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(cli): find the digest-named registry cache and trim a new file's comment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): match registry targets as Windows names them; skills install without HOME Windows drops trailing dots and spaces from a path segment and reads name:stream as name, so package.json. or .git./hooks reached the files the target rules refuse. The global skills install now falls back to the temp folder when HOME does not exist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): turn off the Windows working-directory lookup in every program entry The warm-check server and client are their own tsup entries and copied the environment before cli.js set NoDefaultCurrentDirectoryInExePath, so the server spawned a bare powershell.exe that Windows could take from the project folder. Every entry that hides child consoles now also loads windowsExeSearch first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): refuse Windows short-name registry targets A segment like CLAUDE~1 or PACKAG~1.JSO opens the long name on NTFS, so it reached the files the target rules refuse. The trailing-dot and stream-name normalization is removed: publication already rejects those segments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
53 lines
1.6 KiB
TypeScript
53 lines
1.6 KiB
TypeScript
import "./utils/hideChildConsoles.js";
|
|
import "./utils/windowsExeSearch.js";
|
|
import { writeFileSync } from "node:fs";
|
|
import { isAbsolute, join } from "node:path";
|
|
|
|
const QUIET_MS = 60_000;
|
|
|
|
interface Output {
|
|
write: (...args: never[]) => unknown;
|
|
}
|
|
|
|
/** Writes the report without environment values; before Node 22.13 that is impossible, so nothing is written. */
|
|
export function writeReportFile(
|
|
path: string,
|
|
report: Pick<typeof process.report, "getReport"> = process.report,
|
|
): boolean {
|
|
if (!("excludeEnv" in report)) return false;
|
|
report.excludeEnv = true;
|
|
// writeReport announces the file on stderr; getReport keeps the file the only trace.
|
|
writeFileSync(path, JSON.stringify(report.getReport()), { mode: 0o600 });
|
|
return true;
|
|
}
|
|
|
|
/** With HYPERFRAMES_HANG_REPORT=<absolute dir>, one diagnostic report after 60 s of silence; behaviour is unchanged. */
|
|
export function watchForHang(
|
|
outputs: readonly Output[] = [process.stdout, process.stderr],
|
|
env = process.env,
|
|
writeReport: (path: string) => unknown = writeReportFile,
|
|
): void {
|
|
const dir = env.HYPERFRAMES_HANG_REPORT;
|
|
if (!dir || !isAbsolute(dir)) return;
|
|
let timer: NodeJS.Timeout | undefined;
|
|
let written = false;
|
|
const arm = () => {
|
|
if (written) return;
|
|
clearTimeout(timer);
|
|
timer = setTimeout(() => {
|
|
written = true;
|
|
try {
|
|
writeReport(join(dir, `hang-${process.pid}.json`));
|
|
} catch {}
|
|
}, QUIET_MS).unref();
|
|
};
|
|
for (const output of outputs) {
|
|
const write = output.write.bind(output);
|
|
output.write = (...args: never[]) => {
|
|
arm();
|
|
return write(...args);
|
|
};
|
|
}
|
|
arm();
|
|
}
|