mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-05 17:30:50 +00:00
fix(core): correct WAAPI rediscovery seek baselines and preview reuse invalidation
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import { existsSync, readFileSync } from "node:fs";
|
||||
import { resolve, dirname } from "node:path";
|
||||
|
||||
@@ -16,6 +17,21 @@ export async function loadRuntimeSource(): Promise<string | null> {
|
||||
return (await buildFromSource()) ?? (await getInlinedRuntime()) ?? readPrebuiltArtifact();
|
||||
}
|
||||
|
||||
export async function loadRuntimeSourceSignature(): Promise<string | null> {
|
||||
const source = await loadRuntimeSource();
|
||||
if (!source) return null;
|
||||
return createHash("sha256").update(source).digest("hex");
|
||||
}
|
||||
|
||||
export function hashSignatureParts(parts: Array<string | null | undefined>): string {
|
||||
const hash = createHash("sha256");
|
||||
for (const part of parts) {
|
||||
hash.update(part ?? "");
|
||||
hash.update("\n--hf-signature-part--\n");
|
||||
}
|
||||
return hash.digest("hex");
|
||||
}
|
||||
|
||||
// ── Strategy 1: live build from source (dev only) ──────────────────────────
|
||||
|
||||
const ENTRY_TS = resolve(__dirname, "..", "..", "..", "core", "src", "runtime", "entry.ts");
|
||||
|
||||
Reference in New Issue
Block a user