MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / callWorker

Function callWorker

src/ifcchat/app.js:405–418  ·  view source on GitHub ↗
(type, payload = {})

Source from the content-addressed store, hash-verified

403const worker = new Worker("./ifc_worker.js", { type: "module" });
404
405function callWorker(type, payload = {}) {
406 return new Promise((resolve, reject) => {
407 const id = crypto.randomUUID();
408 const onMsg = (ev) => {
409 const msg = ev.data;
410 if (!msg || msg.id !== id) return;
411 worker.removeEventListener("message", onMsg);
412 if (msg.ok) resolve(msg);
413 else reject(new Error(msg.error || "Worker error"));
414 };
415 worker.addEventListener("message", onMsg);
416 worker.postMessage({ id, type, payload });
417 });
418}
419
420// ---- Tool schemas (should match ifcmcp.core openai_tools()) ----
421const tools = [

Callers 2

runAgentTurnFunction · 0.85
app.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected