agentcut 0.2.28 → 0.2.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentcut",
3
- "version": "0.2.28",
3
+ "version": "0.2.29",
4
4
  "description": "Local helper for Agentcut: runs your coding agent (Claude Code or Codex), your video workspace and live preview bundles for the Agentcut studio page.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -571,6 +571,11 @@ function PlaneBody({
571
571
  // mounting and dropping blurred copies of the content (and their GPU layers) frame after frame, which made
572
572
  // the whole studio flicker. Captures and exports draw as before.
573
573
  const [was, setWas] = useState({ filter: false, copies: false });
574
+ // Without this hint Chromium redraws a layer whenever its on-screen scale changes, which a moving camera
575
+ // does on every frame: each pan, push or whip redrew every copy of every plane (the picture inside, its
576
+ // blur and its mask) frame after frame, and that churn of big GPU layers made the whole studio flash.
577
+ // With it a copy is drawn once and only moved; it's redrawn if the camera ends up far closer.
578
+ const moveOnly = lightPreview ? "transform" : undefined;
574
579
  const model = mul(ctx.model, basis);
575
580
  const camModel = mul(ctx.view, model, translate(-width / 2, -height / 2, 0));
576
581
 
@@ -632,6 +637,7 @@ function PlaneBody({
632
637
  height: height + o.pad * 2,
633
638
  transformOrigin: "0 0",
634
639
  transform: toCss(projected),
640
+ willChange: moveOnly,
635
641
  display: hidden ? "none" : undefined,
636
642
  ...o.mask,
637
643
  }}
@@ -663,6 +669,7 @@ function PlaneBody({
663
669
  height: height + pad * 2,
664
670
  transformOrigin: "0 0",
665
671
  transform: matrix(mul(sm, translate(-pad, -pad, 0))),
672
+ willChange: moveOnly,
666
673
  }}
667
674
  >
668
675
  <div
@@ -1118,6 +1125,34 @@ export function Lift({
1118
1125
  /** A band of light sweeping across a plane (put it last inside a Plane or Device screen). */
1119
1126
  export function Glare({ progress, angle = 115, width = 0.35, strength = 0.35, color = "#ffffff" }: { progress: number; angle?: number; width?: number; strength?: number; color?: string }) {
1120
1127
  const p = -0.6 + progress * 2.2;
1128
+ const env = useRemotionEnvironment();
1129
+ if (env.isPlayer && !env.isRendering) {
1130
+ // Live preview: the same band as a fixed strip that only moves. A gradient that changes every frame
1131
+ // repaints the whole plane, once per lens-blur copy and reflection (each a filtered, masked layer with
1132
+ // the screenshot in it), and that per-frame churn of big GPU layers made the whole studio flash during
1133
+ // a sweep. A moving strip on its own layer leaves the plane's picture untouched.
1134
+ const rad = (angle * Math.PI) / 180;
1135
+ const [dx, dy] = [Math.sin(rad), -Math.cos(rad)];
1136
+ const [a, b] = [Math.abs(dx), Math.abs(dy)];
1137
+ // Along the gradient line (length a·W + b·H), in the box's own units.
1138
+ const along = (k: number) => `calc(${(k * a * 100).toFixed(3)}cqw + ${(k * b * 100).toFixed(3)}cqh)`;
1139
+ return (
1140
+ <div style={{ position: "absolute", inset: 0, overflow: "hidden", containerType: "size", pointerEvents: "none" }}>
1141
+ <div
1142
+ style={{
1143
+ position: "absolute",
1144
+ left: "50%",
1145
+ top: "50%",
1146
+ width: along(width),
1147
+ height: "calc(100cqw + 100cqh)",
1148
+ background: `linear-gradient(90deg, ${alpha(color, 0)} 0%, ${alpha(color, strength)} 50%, ${alpha(color, 0)} 100%)`,
1149
+ transform: `translate(-50%, -50%) translate(${along((p - 0.5) * dx)}, ${along((p - 0.5) * dy)}) rotate(${angle - 90}deg)`,
1150
+ willChange: "transform",
1151
+ }}
1152
+ />
1153
+ </div>
1154
+ );
1155
+ }
1121
1156
  const g = `linear-gradient(${angle}deg, ${alpha(color, 0)} ${((p - width / 2) * 100).toFixed(1)}%, ${alpha(color, strength)} ${(p * 100).toFixed(1)}%, ${alpha(color, 0)} ${((p + width / 2) * 100).toFixed(1)}%)`;
1122
1157
  return <div style={{ position: "absolute", inset: 0, background: g, pointerEvents: "none" }} />;
1123
1158
  }