@glissade/cli 0.28.0-pre.0 → 0.28.0-pre.1

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.
Files changed (2) hide show
  1. package/dist/mcp.js +17 -7
  2. package/package.json +10 -10
package/dist/mcp.js CHANGED
@@ -31,11 +31,13 @@ import { describe } from "@glissade/scene/describe";
31
31
  * track for a non-animatable prop (fail-loud at the write boundary).
32
32
  */
33
33
  var McpSession = class McpSession {
34
+ mod;
34
35
  scene;
35
36
  codeTimeline;
36
37
  sidecar = emptySidecar();
37
38
  undoStack = [];
38
39
  constructor(mod) {
40
+ this.mod = mod;
39
41
  this.scene = mod.createScene();
40
42
  this.codeTimeline = mod.timeline;
41
43
  }
@@ -123,16 +125,24 @@ var McpSession = class McpSession {
123
125
  editCount() {
124
126
  return this.undoStack.length;
125
127
  }
126
- /** Render ONE frame of the current (patched) scene to a PNG — the agent's verifier. */
128
+ /**
129
+ * Render ONE frame of the current (patched) scene to a PNG — the agent's verifier.
130
+ * Builds a FRESH scene each call (like `gs render` does per run): the verifier is
131
+ * stateless, so a track that was added then undone — leaving the sidecar back at a
132
+ * prior/empty state — can't leave a stale binding on a reused scene instance
133
+ * (evaluate binds the current timeline's tracks but won't unbind a track absent
134
+ * from it). This keeps render_frame a pure function of (current merged timeline, t).
135
+ */
127
136
  async renderFrame(t, outPath) {
128
- if ([...this.scene.nodes.values()].some((n) => n.constructor.isLayoutNode === true)) {
137
+ const scene = this.mod.createScene();
138
+ if ([...scene.nodes.values()].some((n) => n.constructor.isLayoutNode === true)) {
129
139
  const { loadYogaLayoutEngine } = await import("@glissade/scene/layout");
130
140
  await loadYogaLayoutEngine();
131
141
  }
132
- const dl = evaluate(this.scene, this.mergedTimeline(), t);
133
- const backend = new SkiaBackend(this.scene.size.w, this.scene.size.h);
142
+ const dl = evaluate(scene, this.mergedTimeline(), t);
143
+ const backend = new SkiaBackend(scene.size.w, scene.size.h);
134
144
  try {
135
- this.scene.setTextMeasurer(backend);
145
+ scene.setTextMeasurer(backend);
136
146
  backend.render(dl);
137
147
  writeFileSync(outPath, backend.encodePng());
138
148
  } finally {
@@ -140,8 +150,8 @@ var McpSession = class McpSession {
140
150
  }
141
151
  return {
142
152
  path: outPath,
143
- width: this.scene.size.w,
144
- height: this.scene.size.h
153
+ width: scene.size.w,
154
+ height: scene.size.h
145
155
  };
146
156
  }
147
157
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissade/cli",
3
- "version": "0.28.0-pre.0",
3
+ "version": "0.28.0-pre.1",
4
4
  "description": "glissade CLI: headless rendering via backend-skia (+ FFmpeg mux).",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {
@@ -24,15 +24,15 @@
24
24
  "@napi-rs/canvas": "^0.1.65",
25
25
  "esbuild": "0.28.0",
26
26
  "jiti": "^2.4.2",
27
- "@glissade/backend-skia": "0.28.0-pre.0",
28
- "@glissade/core": "0.28.0-pre.0",
29
- "@glissade/interact": "0.28.0-pre.0",
30
- "@glissade/lottie": "0.28.0-pre.0",
31
- "@glissade/narrate": "0.28.0-pre.0",
32
- "@glissade/player": "0.28.0-pre.0",
33
- "@glissade/scene": "0.28.0-pre.0",
34
- "@glissade/sfx": "0.28.0-pre.0",
35
- "@glissade/svg": "0.28.0-pre.0"
27
+ "@glissade/backend-skia": "0.28.0-pre.1",
28
+ "@glissade/core": "0.28.0-pre.1",
29
+ "@glissade/interact": "0.28.0-pre.1",
30
+ "@glissade/lottie": "0.28.0-pre.1",
31
+ "@glissade/narrate": "0.28.0-pre.1",
32
+ "@glissade/player": "0.28.0-pre.1",
33
+ "@glissade/scene": "0.28.0-pre.1",
34
+ "@glissade/sfx": "0.28.0-pre.1",
35
+ "@glissade/svg": "0.28.0-pre.1"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",