MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / handler

Function handler

packages/core/src/runtime/bridge.ts:76–83  ·  view source on GitHub ↗
(event: MessageEvent)

Source from the content-addressed store, hash-verified

74
75export function installRuntimeControlBridge(deps: BridgeDeps): (event: MessageEvent) => void {
76 const handler = (event: MessageEvent) => {
77 const data = event.data as BridgeControlData | null;
78 if (!data || data.source !== "hf-parent" || data.type !== "control") return;
79 const action = data.action;
80 if (typeof action !== "string") return;
81 const fn = CONTROL_HANDLERS[action];
82 if (fn) fn(data, deps);
83 };
84 window.addEventListener("message", handler);
85 // Announce that the bridge listener is installed so the parent can replay
86 // any control messages it posted before the iframe runtime was ready

Callers 2

swallowFunction · 0.70
bridge.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected