// SPDX-License-Identifier: LGPL-2.1-or-later const fs=require("fs"),path=require("path"),{pathToFileURL}=require("url");const build=path.resolve(process.argv[2]||"build-web/configure/bin");async function main(){globalThis.__dirname=`${build}${path.sep}`;globalThis.require=require;const m=await import(pathToFileURL(path.join(build,"FreeCADWebSketcherProbe.js")));const p=await m.default({wasmBinary:fs.readFileSync(path.join(build,"FreeCADWebSketcherProbe.wasm"))});const c=(n,t="number")=>p.ccall(n,t);const run=c("fc_web_sketcher_python_api_probe"),result={run,error:c("fc_web_sketcher_last_error","string"),apiCount:c("fc_web_sketcher_python_api_count")};if(run!==1||result.error!==""||result.apiCount!==6)throw Error(JSON.stringify(result));console.log(JSON.stringify({result:"pass",action:"python-api",...result}))}main().catch(e=>{console.error(e);process.exitCode=1});