// fcweb toolkit -- one import for part, part-design, assembly and capture work. // // import { openPart } from "/tools/fcweb/index.mjs"; // // See README.md for the full surface and the contract notes that matter // (primitive argument keys differ between the two probes; volume is null for // sketches and datums; kernel artifacts live in MEMFS, not on the host). export { KernelError, TRACE_SCHEMA, STEM_PART, STEM_PARTDESIGN, STEM_ASSEMBLY, KERNEL_DIRS, locateProbe, openKernel, dispatch, createSession, compactArgs, summarise, writeTrace, } from "./kernel.mjs"; export { openPart, PartDocument, PART_SCHEMA, PART_MODULE, hostBytes } from "./part.mjs"; export { openPartDesign, PartDesignDocument, PARTDESIGN_SCHEMA, PARTDESIGN_MODULE } from "./partdesign.mjs"; export { openAssembly, AssemblySession, ASSEMBLY_OBJECT_TYPE } from "./assembly.mjs"; export { EXPORT_DIRECTORY, DEFAULT_ROOT, configureOpfs, storeRoot, safeName, writeExportFile, readExportFile, hasExportFile, listExportFiles, storeBytes, evidence, sha256, outRoot, } from "./opfs.mjs"; export { DEFAULT_CHROME, launchBrowser, openPage, screenshot, pageCheck, projectMesh, writeArtifact, } from "./capture.mjs"; /** * Adapter for scripts written against the old case-local helper * (`web/teaching/cases/secondary-reducer-pro/parts/buildPart.mjs`). * It returns the exact shape those scripts destructure, so migrating a case is * an import swap rather than a rewrite. */ export async function openPartLegacy(document, options = {}) { const { openPart } = await import("./part.mjs"); const part = await openPart(document, options); return { document, kernel: part.kernel, call: part.call, timed: part.timed, timings: part.timings, trace: { events: part.events, record: () => { /* legacy callers record through `timed` */ }, finish: extra => ({ ...part.trace(), ...extra }), }, close: () => part.dispose(), }; }