@vcad/mcp 0.9.4-main.14 → 0.9.4-main.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,4 +6,4 @@ vcad's MCP server as a self-contained bundle (server + BRep kernel WASM).
6
6
  { "mcpServers": { "vcad": { "command": "npx", "args": ["-y", "@vcad/mcp"] } } }
7
7
  ```
8
8
 
9
- Built from 292cf10c5c65aec57d1c40f8bd5bdb0a1222acaf at 2026-07-24T16:37:44.101Z. Source: https://github.com/ecto/vcad
9
+ Built from ba0bbea017e3e720ec8796167b6824f3cdf235cf at 2026-07-24T17:18:07.764Z. Source: https://github.com/ecto/vcad
package/index.mjs CHANGED
@@ -69,7 +69,9 @@ __export(vcad_kernel_wasm_exports, {
69
69
  atoms_parse_xyz: () => atoms_parse_xyz,
70
70
  atoms_write_xyz: () => atoms_write_xyz,
71
71
  buildCalibrationReportJson: () => buildCalibrationReportJson,
72
+ buildGlbBytes: () => buildGlbBytes,
72
73
  buildPart: () => buildPart,
74
+ buildStlBytes: () => buildStlBytes,
73
75
  build_chat_system_prompt: () => build_chat_system_prompt,
74
76
  calibrationDefaultTolerance: () => calibrationDefaultTolerance,
75
77
  calibrationFingerprintDocument: () => calibrationFingerprintDocument,
@@ -150,6 +152,7 @@ __export(vcad_kernel_wasm_exports, {
150
152
  emSimulate: () => emSimulate,
151
153
  estimatePrintCost: () => estimatePrintCost,
152
154
  estimate_cost_for_process: () => estimate_cost_for_process,
155
+ eulerXyzDegToQuat: () => eulerXyzDegToQuat,
153
156
  evalVcadSource: () => evalVcadSource,
154
157
  evaluateDocument: () => evaluateDocument,
155
158
  evaluateSheetMetalChain: () => evaluateSheetMetalChain,
@@ -463,6 +466,21 @@ function buildCalibrationReportJson(prediction_json, measurements_json, options_
463
466
  wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
464
467
  }
465
468
  }
469
+ function buildGlbBytes(spec_json, f32_data, u32_data) {
470
+ const ptr0 = passStringToWasm0(spec_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
471
+ const len0 = WASM_VECTOR_LEN;
472
+ const ptr1 = passArrayF32ToWasm0(f32_data, wasm.__wbindgen_malloc);
473
+ const len1 = WASM_VECTOR_LEN;
474
+ const ptr2 = passArray32ToWasm0(u32_data, wasm.__wbindgen_malloc);
475
+ const len2 = WASM_VECTOR_LEN;
476
+ const ret = wasm.buildGlbBytes(ptr0, len0, ptr1, len1, ptr2, len2);
477
+ if (ret[3]) {
478
+ throw takeFromExternrefTable0(ret[2]);
479
+ }
480
+ var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
481
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
482
+ return v4;
483
+ }
466
484
  function buildPart(path, params_json) {
467
485
  let deferred4_0;
468
486
  let deferred4_1;
@@ -486,6 +504,21 @@ function buildPart(path, params_json) {
486
504
  wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
487
505
  }
488
506
  }
507
+ function buildStlBytes(spec_json, f32_data, u32_data) {
508
+ const ptr0 = passStringToWasm0(spec_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
509
+ const len0 = WASM_VECTOR_LEN;
510
+ const ptr1 = passArrayF32ToWasm0(f32_data, wasm.__wbindgen_malloc);
511
+ const len1 = WASM_VECTOR_LEN;
512
+ const ptr2 = passArray32ToWasm0(u32_data, wasm.__wbindgen_malloc);
513
+ const len2 = WASM_VECTOR_LEN;
514
+ const ret = wasm.buildStlBytes(ptr0, len0, ptr1, len1, ptr2, len2);
515
+ if (ret[3]) {
516
+ throw takeFromExternrefTable0(ret[2]);
517
+ }
518
+ var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
519
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
520
+ return v4;
521
+ }
489
522
  function build_chat_system_prompt(parts_json, selection_json) {
490
523
  let deferred3_0;
491
524
  let deferred3_1;
@@ -1506,6 +1539,12 @@ function estimate_cost_for_process(process3, material_name, part_volume_mm3, sto
1506
1539
  }
1507
1540
  return takeFromExternrefTable0(ret[0]);
1508
1541
  }
1542
+ function eulerXyzDegToQuat(x_deg, y_deg, z_deg) {
1543
+ const ret = wasm.eulerXyzDegToQuat(x_deg, y_deg, z_deg);
1544
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
1545
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
1546
+ return v1;
1547
+ }
1509
1548
  function evalVcadSource(source) {
1510
1549
  const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1511
1550
  const len0 = WASM_VECTOR_LEN;
@@ -8727,8 +8766,8 @@ function evaluateDocument2(doc, kernel2, options = {}) {
8727
8766
  if (p.mesh.positions.length === 0 && i < visibleRoots.length) {
8728
8767
  const emb = findEmbroideryPattern(visibleRoots[i].root, doc.nodes);
8729
8768
  if (emb) {
8730
- const baseMesh = embroideryPatternToMesh(emb.pattern);
8731
- const mesh = transformMesh(baseMesh, emb.transform);
8769
+ const baseMesh = embroideryPatternToMeshWithKernel(emb.pattern, kernel2);
8770
+ const mesh = transformMeshWithKernel(baseMesh, emb.transform, kernel2);
8732
8771
  return { mesh, material: p.material };
8733
8772
  }
8734
8773
  try {
@@ -8806,35 +8845,9 @@ function convertSketchToProfile(op) {
8806
8845
  }
8807
8846
  function solidToMesh(solid) {
8808
8847
  const meshData = solid.getMesh();
8809
- const positions = new Float32Array(meshData.positions);
8810
- const indices = new Uint32Array(meshData.indices);
8811
- const numVertices = positions.length / 3;
8812
- let hasInvalidIndices = false;
8813
- for (let i = 0; i < indices.length; i++) {
8814
- if (indices[i] >= numVertices) {
8815
- hasInvalidIndices = true;
8816
- break;
8817
- }
8818
- }
8819
- if (hasInvalidIndices) {
8820
- const validIndices = [];
8821
- for (let i = 0; i < indices.length; i += 3) {
8822
- const i0 = indices[i];
8823
- const i1 = indices[i + 1];
8824
- const i2 = indices[i + 2];
8825
- if (i0 < numVertices && i1 < numVertices && i2 < numVertices) {
8826
- validIndices.push(i0, i1, i2);
8827
- }
8828
- }
8829
- return {
8830
- positions,
8831
- indices: new Uint32Array(validIndices),
8832
- normals: meshData.normals ? new Float32Array(meshData.normals) : void 0
8833
- };
8834
- }
8835
8848
  return {
8836
- positions,
8837
- indices,
8849
+ positions: new Float32Array(meshData.positions),
8850
+ indices: new Uint32Array(meshData.indices),
8838
8851
  normals: meshData.normals ? new Float32Array(meshData.normals) : void 0
8839
8852
  };
8840
8853
  }
@@ -8855,7 +8868,7 @@ function resolveSheetMetalPart(rootId, nodes, kernel2) {
8855
8868
  return null;
8856
8869
  const { mesh, sheetMetal } = evaluateSheetMetalChain2(chain, kernel2);
8857
8870
  return {
8858
- mesh: isIdentityTransform(sm.transform) ? mesh : transformMesh(mesh, sm.transform),
8871
+ mesh: isIdentityTransform(sm.transform) ? mesh : transformMeshWithKernel(mesh, sm.transform, kernel2),
8859
8872
  sheetMetal
8860
8873
  };
8861
8874
  }
@@ -8898,6 +8911,37 @@ function embroideryPatternToMesh(op) {
8898
8911
  colors: new Float32Array(allColors)
8899
8912
  };
8900
8913
  }
8914
+ function embroideryPatternToMeshWithKernel(op, kernel2) {
8915
+ if (kernel2?.embroideryDesignToMesh) {
8916
+ try {
8917
+ const m = kernel2.embroideryDesignToMesh(JSON.stringify(op.design));
8918
+ return {
8919
+ positions: new Float32Array(m.positions),
8920
+ indices: new Uint32Array(m.indices),
8921
+ colors: new Float32Array(m.colors)
8922
+ };
8923
+ } catch (e) {
8924
+ console.warn("[ENGINE] kernel embroideryDesignToMesh failed, falling back to TS:", e);
8925
+ }
8926
+ }
8927
+ return embroideryPatternToMesh(op);
8928
+ }
8929
+ function transformMeshWithKernel(mesh, transform2, kernel2) {
8930
+ if (kernel2?.transformMeshBuffers) {
8931
+ try {
8932
+ const r = kernel2.transformMeshBuffers(mesh.positions, mesh.normals, JSON.stringify(transform2));
8933
+ return {
8934
+ positions: new Float32Array(r.positions),
8935
+ indices: mesh.indices,
8936
+ normals: r.normals ? new Float32Array(r.normals) : void 0,
8937
+ colors: mesh.colors
8938
+ };
8939
+ } catch (e) {
8940
+ console.warn("[ENGINE] kernel transformMeshBuffers failed, falling back to TS:", e);
8941
+ }
8942
+ }
8943
+ return transformMesh(mesh, transform2);
8944
+ }
8901
8945
  function transformMesh(mesh, transform2) {
8902
8946
  const { translate, rotate, scale } = transform2;
8903
8947
  const positions = new Float32Array(mesh.positions.length);
@@ -8954,8 +8998,8 @@ function evaluateDocumentTS(doc, kernel2, options = {}) {
8954
8998
  const parts = visibleRoots.map((entry, idx) => {
8955
8999
  const embPattern = findEmbroideryPattern(entry.root, doc.nodes);
8956
9000
  if (embPattern) {
8957
- const baseMesh = embroideryPatternToMesh(embPattern.pattern);
8958
- const mesh = transformMesh(baseMesh, embPattern.transform);
9001
+ const baseMesh = embroideryPatternToMeshWithKernel(embPattern.pattern, kernel2);
9002
+ const mesh = transformMeshWithKernel(baseMesh, embPattern.transform, kernel2);
8959
9003
  solids.push(Solid2.empty());
8960
9004
  return { mesh, material: entry.material };
8961
9005
  }
@@ -8966,7 +9010,7 @@ function evaluateDocumentTS(doc, kernel2, options = {}) {
8966
9010
  indices: new Uint32Array(imported.mesh.indices),
8967
9011
  normals: imported.mesh.normals ? new Float32Array(imported.mesh.normals) : void 0
8968
9012
  };
8969
- const mesh = transformMesh(baseMesh, imported.transform);
9013
+ const mesh = transformMeshWithKernel(baseMesh, imported.transform, kernel2);
8970
9014
  solids.push(Solid2.empty());
8971
9015
  return { mesh, material: entry.material };
8972
9016
  }
@@ -11640,6 +11684,7 @@ __export(dist_exports, {
11640
11684
  decimateMeshGpu: () => decimateMeshGpu2,
11641
11685
  defaultParamsFor: () => defaultParamsFor,
11642
11686
  deriveBoardFromCavity: () => deriveBoardFromCavity,
11687
+ embroideryPatternToMeshWithKernel: () => embroideryPatternToMeshWithKernel,
11643
11688
  estimateCost: () => estimateCost,
11644
11689
  evalAst: () => evalAst,
11645
11690
  evalExprSafe: () => evalExprSafe,
@@ -11717,6 +11762,7 @@ __export(dist_exports, {
11717
11762
  threeWayMerge: () => threeWayMerge,
11718
11763
  toWorld: () => toWorld,
11719
11764
  transformMesh: () => transformMesh,
11765
+ transformMeshWithKernel: () => transformMeshWithKernel,
11720
11766
  tryExportFabFiles: () => tryExportFabFiles,
11721
11767
  tryPcbPreviewMeshes: () => tryPcbPreviewMeshes,
11722
11768
  tryRunDrc: () => tryRunDrc,
@@ -11742,6 +11788,7 @@ var init_dist = __esm({
11742
11788
  init_mesh_cache();
11743
11789
  init_dependency_graph();
11744
11790
  init_evaluate();
11791
+ init_evaluate();
11745
11792
  init_sequence();
11746
11793
  init_sheet_metal();
11747
11794
  init_expressions();
@@ -49384,7 +49431,7 @@ function buildPartLabels(doc) {
49384
49431
  return `${entry.root}:${name ?? ""}`;
49385
49432
  });
49386
49433
  }
49387
- function eulerXyzDegToQuat(rotation) {
49434
+ function eulerXyzDegToQuat2(rotation) {
49388
49435
  const q = exportKernel().eulerXyzDegToQuat(rotation.x, rotation.y, rotation.z);
49389
49436
  return [q[0], q[1], q[2], q[3]];
49390
49437
  }
@@ -49597,7 +49644,7 @@ function generateInstancesGlbPreview(doc, engine) {
49597
49644
  inst.transform.translation.y,
49598
49645
  inst.transform.translation.z
49599
49646
  ],
49600
- rotationQuat: eulerXyzDegToQuat(inst.transform.rotation),
49647
+ rotationQuat: eulerXyzDegToQuat2(inst.transform.rotation),
49601
49648
  scale: [
49602
49649
  inst.transform.scale.x,
49603
49650
  inst.transform.scale.y,
@@ -76157,7 +76204,7 @@ function buildSequenceGlb(doc, timeline, frames, engine) {
76157
76204
  rec.times.push(frame.t);
76158
76205
  rec.trans.push(...translation);
76159
76206
  rec.rot.push(
76160
- ...eulerXyzDegToQuat(
76207
+ ...eulerXyzDegToQuat2(
76161
76208
  t2?.rotation ?? { x: 0, y: 0, z: 0 }
76162
76209
  )
76163
76210
  );
@@ -77758,8 +77805,8 @@ var init_server3 = __esm({
77758
77805
  init_order_feed();
77759
77806
  init_animate();
77760
77807
  PKG_VERSION = (() => {
77761
- if ("0.9.4-main.14") {
77762
- return "0.9.4-main.14";
77808
+ if ("0.9.4-main.15") {
77809
+ return "0.9.4-main.15";
77763
77810
  }
77764
77811
  try {
77765
77812
  const req = createRequire2(import.meta.url);
@@ -77768,8 +77815,8 @@ var init_server3 = __esm({
77768
77815
  return "0.0.0";
77769
77816
  }
77770
77817
  })();
77771
- BUILD_SHA = "292cf10c5c65aec57d1c40f8bd5bdb0a1222acaf";
77772
- BUILD_TIME = "2026-07-24T16:37:44.101Z";
77818
+ BUILD_SHA = "ba0bbea017e3e720ec8796167b6824f3cdf235cf";
77819
+ BUILD_TIME = "2026-07-24T17:18:07.764Z";
77773
77820
  SHORT_SHA = BUILD_SHA === "unknown" ? "unknown" : BUILD_SHA.slice(0, 7);
77774
77821
  VERSION_WITH_BUILD = SHORT_SHA === "unknown" ? PKG_VERSION : `${PKG_VERSION}+${SHORT_SHA}`;
77775
77822
  INSTANCE_ID = randomUUID6().slice(0, 8);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcad/mcp",
3
- "version": "0.9.4-main.14",
3
+ "version": "0.9.4-main.15",
4
4
  "description": "vcad MCP server — parametric CAD + PCB design tools for AI agents (self-contained: bundled server + kernel WASM)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "homepage": "https://vcad.io",
21
21
  "vcadBuild": {
22
- "sha": "292cf10c5c65aec57d1c40f8bd5bdb0a1222acaf",
23
- "builtAt": "2026-07-24T16:37:44.101Z"
22
+ "sha": "ba0bbea017e3e720ec8796167b6824f3cdf235cf",
23
+ "builtAt": "2026-07-24T17:18:07.764Z"
24
24
  }
25
25
  }
Binary file