feat(runtime): add Buerli (ClassCAD) WASM kernel plugin#173
Draft
rifont wants to merge 4 commits into
Draft
Conversation
- Implement buerli kernel with WASM-only client (no WebSocket) - Require classcadKey as config for API license validation - Register @buerli.io/classcad as built-in module - Wire into plugin factories, exports, presets, build entries - Add kernel catalog metadata and UI defaults - Add prompt config for AI chat system - Extract and register Monaco IntelliSense types - Update architecture policy documentation - Add comprehensive unit tests
- Fix naming convention violations (initFn → initFunction, WASMClient) - Fix max-depth nesting by extracting geometry helpers - Fix unnecessary type assertions and optional chains - Use dynamic gltfCore import to avoid naming convention errors - Make classcadKey optional for zero-config preset compatibility - Use computed property for @buerli.io/classcad module path
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Replace synthetic array tests with API-pattern-driven integration tests - Add tests modeled after real buerli-examples (Solid/Part/Sketch APIs) - Test full pipeline: module registration → bundling → execute → GLB - Validate geometry conversion: position arrays, indexed geometry, toJSON - Test parametric models, multi-file projects, barrel exports - Test module resolution (named + default imports from @buerli.io/classcad) - Test error handling: syntax errors, runtime errors, type errors - Add research doc documenting WASM runtime constraints and test strategy - Track buerli-examples and buerligons repos via repos.yaml - 40 passing tests covering all kernel operations
- Discovered classCadWorkerApi in CDN worker script has zero Worker dependency - Mapped full command protocol: facade → callSafeApiV → executeRequest → WASM execute - Found ClassCADWasm.js is compiled with ENVIRONMENT_IS_WEB=true (no Node.js support) - Documented Emscripten module init, FS setup, and command format - Architecture blueprint for NodeWASMClient bypassing Comlink - Confirmed WASM module hangs in Node.js due to browser-only async read paths - Tracked buerli-examples and buerligons repos via repos.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Buerli (ClassCAD) kernel as a first-party plugin to
@taucad/runtime, using the WASM-only variant with no WebSocket connections. Users import from@buerli.io/classcadto access the Solid, Part, Assembly, Sketch, and Curve APIs powered by the ClassCAD engine running entirely in-browser via WebAssembly.Changes
Kernel Implementation
packages/runtime/src/kernels/buerli/buerli.kernel.ts— FulldefineKernelimplementation with WASM-only ClassCAD client initialization, module registration, bundler integration, geometry conversion to glTF, and export supportpackages/runtime/src/kernels/buerli/buerli.plugin.ts— Plugin factory withcreateKernelPlugin, detect pattern for@buerli.io/classcadimportsSystem Wiring
kernel-factories.ts), kernel exports (kernels-entry.ts), presets (presets.ts)package.jsonexports + publishConfig for./kernels/buerlisubpathtsdown.config.tsbuild entry, smoke ESM import testCatalog & UI
libs/types/src/constants/kernel.constants.ts— AddedbuerlitoKernelBackendunion andkernelConfigurationsarrayapps/ui/app/constants/kernel-worker.constants.ts— Addedbuerli()to default kernel optionsapps/ui/app/environment.config.ts— Added optionalCLASSCAD_WASM_KEYenv varAI Chat Prompts
buerli.prompt.config.ts+buerli.prompt.example.ts— Prompt configuration and canonical exampleMonaco IntelliSense
libs/api-extractor/src/extract-buerli-types.ts— Self-contained type extraction script@taucad/api-extractorkernelTypeMapsarrayResearch & Documentation
docs/research/buerli-classcad-kernel-integration.md— Research doc covering API surface, WASM runtime constraints, and test strategydocs/policy/runtime-architecture-policy.mdbuerli-examplesandbuerligonsrepos viarepos.yamlTests (40 passing)
Tests modeled after real buerli-examples patterns (Solid API, Part API, Sketch API):
WASM Runtime Constraint
ClassCAD WASM uses Comlink + browser Web Workers and cannot run in Node.js/Vitest (
ReferenceError: Worker is not defined). Tests validate the full kernel pipeline (module registration → bundling → execution → geometry conversion → GLB) using realistic geometry data structures matching whatcreateBufferGeometry()returns in the browser.See:
docs/research/buerli-classcad-kernel-integration.mdTesting
pnpm nx test runtime ./src/kernels/buerli/buerli.kernel.test.ts --watch=false— 40/40 passpnpm nx test runtime ./src/testing/smoke-esm.test.ts --watch=false— 7/7 passpnpm nx lint runtime --files='src/kernels/buerli/buerli.kernel.ts src/kernels/buerli/buerli.plugin.ts'pnpm nx lint runtime --files='src/kernels/buerli/buerli.kernel.test.ts'pnpm nx lint api --files='...',pnpm nx lint ui --files='...',pnpm nx lint types --files='...'pnpm nx typecheck typespnpm nx typecheck runtime— pre-existing opencascade WASM module errors only