ponzu 1.73.0 → 1.74.0

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/dist/chromium.js CHANGED
@@ -12855,9 +12855,11 @@ async function recordFrames(page, opts) {
12855
12855
  throw new Error("That node isn't in this artboard.");
12856
12856
  const layout = sheetLayout(plan.steps.length, box.width, box.height);
12857
12857
  const frames = [];
12858
+ const pngs = [];
12858
12859
  for (const step of plan.steps) {
12859
12860
  await page.evaluate(motionCall("apply", step));
12860
12861
  const png = await page.capture(box, layout.scale);
12862
+ pngs.push(png);
12861
12863
  frames.push({ label: step.label, src: `data:image/png;base64,${base64(png)}` });
12862
12864
  }
12863
12865
  await page.evaluate(motionCall("settle"));
@@ -12870,6 +12872,8 @@ async function recordFrames(page, opts) {
12870
12872
  width: sheet.width,
12871
12873
  height: sheet.height,
12872
12874
  steps: plan.steps,
12875
+ frames: pngs,
12876
+ box,
12873
12877
  motion: prepared,
12874
12878
  issues
12875
12879
  };
package/dist/index.js CHANGED
@@ -34431,6 +34431,7 @@ ${lint}`,
34431
34431
  failure: "capture_failed",
34432
34432
  stage: "capture"
34433
34433
  };
34434
+ ws.capture?.(key, { id: crypto.randomUUID(), artboard: ab.id, kind: "screenshot" });
34434
34435
  const image = { data: toBase64(out.bytes), mime: out.mime };
34435
34436
  const lines = [
34436
34437
  `${nodeId ?? ab.id} rendered ${Math.round(out.width)}\xD7${Math.round(out.height)} at ${shownScale(scale, out.scale)}${out.motion ? `, ${moment(out.motion, args.at)}` : ""}.`
@@ -34502,6 +34503,13 @@ ${lint}`,
34502
34503
  lint: true,
34503
34504
  assetBase: ws.assetBase?.(key)
34504
34505
  });
34506
+ ws.capture?.(key, {
34507
+ id: crypto.randomUUID(),
34508
+ artboard: ab.id,
34509
+ kind: "record",
34510
+ frames: out.frames.map((png) => `data:image/png;base64,${toBase64(png)}`),
34511
+ ...ab.id === args.id ? {} : { box: out.box }
34512
+ });
34505
34513
  const m = out.motion;
34506
34514
  const first = out.steps[0]?.label ?? "";
34507
34515
  const last = out.steps[out.steps.length - 1]?.label ?? "";
@@ -40630,9 +40638,11 @@ async function recordFrames(page, opts) {
40630
40638
  throw new Error("That node isn't in this artboard.");
40631
40639
  const layout = sheetLayout(plan.steps.length, box.width, box.height);
40632
40640
  const frames = [];
40641
+ const pngs = [];
40633
40642
  for (const step of plan.steps) {
40634
40643
  await page.evaluate(motionCall("apply", step));
40635
40644
  const png = await page.capture(box, layout.scale);
40645
+ pngs.push(png);
40636
40646
  frames.push({ label: step.label, src: `data:image/png;base64,${base642(png)}` });
40637
40647
  }
40638
40648
  await page.evaluate(motionCall("settle"));
@@ -40645,6 +40655,8 @@ async function recordFrames(page, opts) {
40645
40655
  width: sheet.width,
40646
40656
  height: sheet.height,
40647
40657
  steps: plan.steps,
40658
+ frames: pngs,
40659
+ box,
40648
40660
  motion: prepared,
40649
40661
  issues
40650
40662
  };
@@ -43671,6 +43683,7 @@ class LocalWorkspace {
43671
43683
  entries = new Map;
43672
43684
  opening = new Map;
43673
43685
  focusListeners = new Set;
43686
+ captureListeners = new Set;
43674
43687
  openListeners = new Set;
43675
43688
  createListeners = new Set;
43676
43689
  previewTimers = new Map;
@@ -43704,6 +43717,10 @@ class LocalWorkspace {
43704
43717
  for (const l of this.focusListeners)
43705
43718
  l(key, artboard);
43706
43719
  }
43720
+ capture(key, capture) {
43721
+ for (const l of this.captureListeners)
43722
+ l(key, capture);
43723
+ }
43707
43724
  link(key, opts = {}) {
43708
43725
  if (!this.opensIn)
43709
43726
  return;
@@ -43715,6 +43732,10 @@ class LocalWorkspace {
43715
43732
  this.focusListeners.add(fn);
43716
43733
  return () => this.focusListeners.delete(fn);
43717
43734
  }
43735
+ onCapture(fn) {
43736
+ this.captureListeners.add(fn);
43737
+ return () => this.captureListeners.delete(fn);
43738
+ }
43718
43739
  onOpen(fn) {
43719
43740
  this.openListeners.add(fn);
43720
43741
  return () => this.openListeners.delete(fn);
@@ -46952,6 +46973,7 @@ function serve(ws, opts = {}) {
46952
46973
  if (page)
46953
46974
  broadcast(key, { t: "focus", artboard, page: page.id });
46954
46975
  });
46976
+ ws.onCapture((key, capture) => broadcast(key, { t: "capture", capture }));
46955
46977
  const agentWorking = () => {
46956
46978
  const agent = ws.presence.list().find((p) => p.kind === "agent" && p.working.length > 0);
46957
46979
  return agent && (agent.client ?? "other");
@@ -47716,7 +47738,7 @@ function remoteUpdater(endpoint, token) {
47716
47738
  // apps/cli/package.json
47717
47739
  var package_default = {
47718
47740
  name: "ponzu",
47719
- version: "1.73.0",
47741
+ version: "1.74.0",
47720
47742
  description: "The open source canvas your agent draws on in HTML and CSS.",
47721
47743
  type: "module",
47722
47744
  license: "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ponzu",
3
- "version": "1.73.0",
3
+ "version": "1.74.0",
4
4
  "description": "The open source canvas your agent draws on in HTML and CSS.",
5
5
  "license": "MIT",
6
6
  "type": "module",