@vcad/mcp 0.9.4-main.7 → 0.9.4-main.8

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 3f7779633a486aaa3e0e6d984834c539769923cc at 2026-07-23T23:44:37.186Z. Source: https://github.com/ecto/vcad
9
+ Built from f09f3d656a04f8a18840c42116208ada180ce487 at 2026-07-24T16:11:19.940Z. Source: https://github.com/ecto/vcad
package/index.mjs CHANGED
@@ -10077,120 +10077,22 @@ var init_diff = __esm({
10077
10077
  });
10078
10078
 
10079
10079
  // ../engine/dist/sequence.js
10080
- function sampleTrackValue(track, t2) {
10081
- const keys = track.keys;
10082
- if (keys.length === 0)
10083
- return 0;
10084
- const first = keys[0];
10085
- if (t2 <= first.t)
10086
- return first.value;
10087
- const last = keys[keys.length - 1];
10088
- if (t2 >= last.t)
10089
- return last.value;
10090
- const idx = keys.findIndex((k) => k.t > t2);
10091
- const a = keys[idx - 1];
10092
- const b = keys[idx];
10093
- const span = b.t - a.t;
10094
- let u = span <= 0 ? 1 : (t2 - a.t) / span;
10095
- switch (b.ease ?? "linear") {
10096
- case "step":
10097
- u = u >= 1 ? 1 : 0;
10098
- break;
10099
- case "ease-in-out":
10100
- u = u * u * (3 - 2 * u);
10101
- break;
10102
- default:
10103
- break;
10104
- }
10105
- return a.value + (b.value - a.value) * u;
10106
- }
10107
- function cameraPoseAt(shots, t2, prevPose) {
10108
- let active;
10109
- for (const shot of shots) {
10110
- if (t2 >= shot.startS && t2 < shot.endS)
10111
- active = shot;
10112
- }
10113
- if (!active)
10114
- return prevPose;
10115
- const span = active.endS - active.startS;
10116
- const u = span <= 0 ? 1 : (t2 - active.startS) / span;
10117
- const kind = active.kind;
10118
- switch (kind.type) {
10119
- case "Turntable":
10120
- return {
10121
- azimuthDeg: kind.degrees * u,
10122
- elevationDeg: kind.elevationDeg,
10123
- dolly: 1
10124
- };
10125
- case "Orbit":
10126
- return {
10127
- azimuthDeg: kind.from[0] + (kind.to[0] - kind.from[0]) * u,
10128
- elevationDeg: kind.from[1] + (kind.to[1] - kind.from[1]) * u,
10129
- dolly: 1
10130
- };
10131
- case "Focus":
10132
- return {
10133
- azimuthDeg: prevPose.azimuthDeg,
10134
- elevationDeg: prevPose.elevationDeg,
10135
- dolly: 1 + (kind.dolly - 1) * u,
10136
- target: kind.target
10137
- };
10138
- case "Static":
10139
- return { ...DEFAULT_POSE };
10080
+ function requireWasm() {
10081
+ const mod = getKernelWasmSync();
10082
+ if (!mod || typeof mod.sample_timeline_sequence !== "function" || typeof mod.sample_timeline_track !== "function") {
10083
+ throw new Error("kernel WASM not initialized (or too old for timeline sampling) \u2014 await getKernelWasm() before sampling sequences");
10140
10084
  }
10085
+ return mod;
10086
+ }
10087
+ function sampleTrackValue(track, t2) {
10088
+ return requireWasm().sample_timeline_track(JSON.stringify(track), t2);
10141
10089
  }
10142
10090
  function sampleSequence(doc, timelineOverride) {
10143
10091
  const timeline = timelineOverride ?? doc.timeline;
10144
10092
  if (!timeline)
10145
10093
  return [];
10146
- const fps = timeline.fps && timeline.fps > 0 ? timeline.fps : 24;
10147
- const frameCount = Math.max(2, Math.round(timeline.durationS * fps) + 1);
10148
- const tracks = timeline.tracks ?? [];
10149
- const shots = timeline.camera ?? [];
10150
- const hasParamTracks2 = tracks.some((tr) => tr.target.type === "Parameter");
10151
- const frames = [];
10152
- let prevParams;
10153
- let prevPose = { ...DEFAULT_POSE };
10154
- for (let index = 0; index < frameCount; index++) {
10155
- const t2 = index / fps;
10156
- const params = {};
10157
- const joints = {};
10158
- const visibility = {};
10159
- let explode = 0;
10160
- for (const track of tracks) {
10161
- const value = sampleTrackValue(track, t2);
10162
- const target = track.target;
10163
- switch (target.type) {
10164
- case "Parameter":
10165
- params[target.name] = value;
10166
- break;
10167
- case "Joint":
10168
- joints[target.jointId] = value;
10169
- break;
10170
- case "Visibility":
10171
- visibility[target.instanceId] = value > 0.5;
10172
- break;
10173
- case "Explode":
10174
- explode = value;
10175
- break;
10176
- }
10177
- }
10178
- const camera = cameraPoseAt(shots, t2, prevPose);
10179
- prevPose = camera;
10180
- const geometryDirty = prevParams === void 0 ? hasParamTracks2 : Object.keys(params).some((name) => params[name] !== prevParams[name]);
10181
- prevParams = params;
10182
- frames.push({
10183
- index,
10184
- t: t2,
10185
- params,
10186
- joints,
10187
- visibility,
10188
- explode,
10189
- camera,
10190
- geometryDirty
10191
- });
10192
- }
10193
- return frames;
10094
+ const json = requireWasm().sample_timeline_sequence(JSON.stringify(timeline));
10095
+ return JSON.parse(json);
10194
10096
  }
10195
10097
  function poseDocument(doc, frame) {
10196
10098
  const posed = structuredClone(doc);
@@ -10212,11 +10114,10 @@ function poseDocument(doc, frame) {
10212
10114
  }
10213
10115
  return posed;
10214
10116
  }
10215
- var DEFAULT_POSE;
10216
10117
  var init_sequence = __esm({
10217
10118
  "../engine/dist/sequence.js"() {
10218
10119
  "use strict";
10219
- DEFAULT_POSE = { azimuthDeg: 0, elevationDeg: 30, dolly: 1 };
10120
+ init_wasm_singleton();
10220
10121
  }
10221
10122
  });
10222
10123
 
@@ -77183,6 +77084,7 @@ ${issues.map((i) => i.track >= 0 ? `track[${i.track}]: ${i.problem}` : i.problem
77183
77084
  );
77184
77085
  }
77185
77086
  doc.timeline = timeline;
77087
+ await getKernelWasm();
77186
77088
  const frames = sampleSequence(doc);
77187
77089
  return ok({
77188
77090
  duration_s: timeline.durationS,
@@ -77453,6 +77355,7 @@ async function renderSequence(args, ctx) {
77453
77355
  ${issues.map((i) => i.problem).join("\n")}`
77454
77356
  );
77455
77357
  }
77358
+ await getKernelWasm();
77456
77359
  const frames = sampleSequence(doc, timeline);
77457
77360
  if (frames.length > MAX_FRAMES) {
77458
77361
  return err2(
@@ -77637,6 +77540,7 @@ async function exportVideo(args, ctx) {
77637
77540
  return err2(`timeline invalid:
77638
77541
  ${issues.map((i) => i.problem).join("\n")}`);
77639
77542
  }
77543
+ await getKernelWasm();
77640
77544
  const frames = sampleSequence(doc, timeline);
77641
77545
  if (frames.length > MAX_FRAMES) {
77642
77546
  return err2(
@@ -78903,8 +78807,8 @@ var init_server3 = __esm({
78903
78807
  init_order_feed();
78904
78808
  init_animate();
78905
78809
  PKG_VERSION = (() => {
78906
- if ("0.9.4-main.7") {
78907
- return "0.9.4-main.7";
78810
+ if ("0.9.4-main.8") {
78811
+ return "0.9.4-main.8";
78908
78812
  }
78909
78813
  try {
78910
78814
  const req = createRequire2(import.meta.url);
@@ -78913,8 +78817,8 @@ var init_server3 = __esm({
78913
78817
  return "0.0.0";
78914
78818
  }
78915
78819
  })();
78916
- BUILD_SHA = "3f7779633a486aaa3e0e6d984834c539769923cc";
78917
- BUILD_TIME = "2026-07-23T23:44:37.186Z";
78820
+ BUILD_SHA = "f09f3d656a04f8a18840c42116208ada180ce487";
78821
+ BUILD_TIME = "2026-07-24T16:11:19.940Z";
78918
78822
  SHORT_SHA = BUILD_SHA === "unknown" ? "unknown" : BUILD_SHA.slice(0, 7);
78919
78823
  VERSION_WITH_BUILD = SHORT_SHA === "unknown" ? PKG_VERSION : `${PKG_VERSION}+${SHORT_SHA}`;
78920
78824
  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.7",
3
+ "version": "0.9.4-main.8",
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": "3f7779633a486aaa3e0e6d984834c539769923cc",
23
- "builtAt": "2026-07-23T23:44:37.186Z"
22
+ "sha": "f09f3d656a04f8a18840c42116208ada180ce487",
23
+ "builtAt": "2026-07-24T16:11:19.940Z"
24
24
  }
25
25
  }
Binary file