mirror of
https://github.com/hanzoai/frames.git
synced 2026-09-24 00:08:03 +00:00
Forked from HyperFrames (Apache-2.0), full history preserved. Hosts are mapped explicitly and BEFORE the identifier rename, because hyperframes.heygen.com is not decoration: 175 of its occurrences are $schema identifiers that a validator dereferences. A blind rename would have left them naming a host that never serves them. The schema files are in this repo under docs/schema, so the mapped host is one we can actually serve -- that is the condition that makes the rewrite safe, and serving them is a deploy task, not an edit. docs/schema/hyperframes.json is renamed to frames.json to match the identifier it is now published under. api.heygen.com and the CLI auth against heygen.com are left UNRENAMED on purpose. They are a dependency on HeyGen's SaaS, not a name of ours to take, and the right move is to remove that integration rather than rebrand it. LICENSE and CREDITS.md are untouched; NOTICE records the lineage. Co-authored-by: Hanzo Dev <[email protected]>
37 lines
1.5 KiB
TypeScript
37 lines
1.5 KiB
TypeScript
import { buildHyperframesRuntimeScript } from "../src/inline-scripts/framesRuntime.engine";
|
|
|
|
function assert(condition: unknown, message: string): void {
|
|
if (!condition) {
|
|
throw new Error(message);
|
|
}
|
|
}
|
|
|
|
const baseline = buildHyperframesRuntimeScript();
|
|
assert(baseline !== null, "buildHyperframesRuntimeScript() returned null — entry.ts not found");
|
|
const parityEnabled = buildHyperframesRuntimeScript({ defaultParityMode: true });
|
|
assert(parityEnabled !== null, "Parity-enabled build returned null");
|
|
const parityDisabled = buildHyperframesRuntimeScript({ defaultParityMode: false });
|
|
assert(parityDisabled !== null, "Parity-disabled build returned null");
|
|
const withSourceUrl = buildHyperframesRuntimeScript({
|
|
sourceUrl: "hyperframe.runtime.iife.js",
|
|
});
|
|
assert(withSourceUrl !== null, "Build with sourceUrl returned null");
|
|
|
|
assert(baseline.includes("window.__player"), "Baseline runtime should include player contract");
|
|
assert(parityEnabled.length > 0, "Parity-enabled build should produce non-empty runtime source");
|
|
assert(parityDisabled.length > 0, "Parity-disabled build should produce non-empty runtime source");
|
|
assert(
|
|
withSourceUrl.includes("//# sourceURL=hyperframe.runtime.iife.js"),
|
|
"Build with sourceUrl should append sourceURL comment",
|
|
);
|
|
|
|
console.log(
|
|
JSON.stringify({
|
|
event: "hyperframe_runtime_behavior_verified",
|
|
baselineBytes: baseline.length,
|
|
parityEnabledBytes: parityEnabled.length,
|
|
parityDisabledBytes: parityDisabled.length,
|
|
sourceUrlBytes: withSourceUrl.length,
|
|
}),
|
|
);
|