@hyperframes/producer 0.9.45 → 0.9.47

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.
@@ -292,6 +292,17 @@ function resolveVerifiedHyperframeRuntime() {
292
292
  };
293
293
  }
294
294
 
295
+ // src/services/servedPath.ts
296
+ function servedPath(urlPath) {
297
+ return urlPath.replace(/^\//, "").split("/").map((seg) => {
298
+ try {
299
+ return decodeURIComponent(seg);
300
+ } catch {
301
+ return seg;
302
+ }
303
+ }).join("/");
304
+ }
305
+
295
306
  // src/generated/hf-early-stub-inline.ts
296
307
  var HF_EARLY_STUB_IIFE = '"use strict";(()=>{var x=100,b=[],s=[],c=!1,w=!1,h=new Set;function _(n){let o=window.__HF_VIRTUAL_TIME__?.originalRequestAnimationFrame;return typeof o=="function"?o(n):requestAnimationFrame(n)}function O(n){let o=window.__HF_VIRTUAL_TIME__?.originalSetTimeout;if(typeof o=="function"){o(n,0);return}setTimeout(n,0)}function v(n){return n!==null&&typeof n=="object"&&"__hfIsProxy"in n?n.__hfReal:n}function m(n,o){n!=="add"&&A(o)}function p(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;let o=n;return"rotationX"in o||"rotationY"in o||"transformPerspective"in o}var d=new Set;function A(n){let o=n[0];if(o==null)return;let e=window;d.has(o)||(d.add(o),e.__hfAllTweenTargets=Array.from(d)),(p(n[1])||p(n[2]))&&(h.add(o),e.__hf3dTweenTargets=Array.from(h))}function y(n){let o=n.proxy.__hfReal,e=o[n.method];if(typeof e=="function"){let i=n.method==="add"?n.args.map(v):n.args;e.call(o,...i)}}function l(n,o,e){m(o,e);let i={proxy:n,method:o,args:e};return n.__hfQueue.push(i),s.push(i),R(),n}function g(n){let o=n.proxy.__hfQueue.indexOf(n);o>=0&&n.proxy.__hfQueue.splice(o,1)}function t(){for(;s.length>0;){let n=s.shift();n&&(g(n),y(n))}S()}function k(){w=!1,window.__hfTimelinesBuilding=!1;try{window.dispatchEvent(new CustomEvent("hf-timelines-built"))}catch{}}function S(){w||(w=!0,O(()=>{s.length===0?k():w=!1}))}function P(){c=!1;let n=s.splice(0,x);for(let o of n)g(o),y(o);s.length>0?(c=!0,_(P)):k()}function R(){c||(c=!0,window.__hfTimelinesBuilding=!0,_(P))}var I=new Set(["to","from","fromTo","set","add"]);function G(n,o){let e=o;for(;e!==null&&e!==Object.prototype;){for(let i of Object.getOwnPropertyNames(e)){if(i==="constructor"||i==="then"||i in n||I.has(i)||i.charAt(0)==="_")continue;let a=Object.getOwnPropertyDescriptor(e,i);if(!a||typeof a.value!="function")continue;let u=a.value;n[i]=function(...r){t();let f=u.call(o,...r);return f===o?n:f}}e=Object.getPrototypeOf(e)}}function B(n){let o={__hfReal:n,__hfQueue:[],__hfIsProxy:!0,to(...e){return l(o,"to",e)},from(...e){return l(o,"from",e)},fromTo(...e){return l(o,"fromTo",e)},set(...e){return l(o,"set",e)},add(...e){return l(o,"add",e)},pause(...e){return t(),n.pause(...e),o},play(...e){return t(),n.play(...e),o},seek(...e){return t(),n.seek(...e),o},totalTime(...e){return t(),e.length>0?(n.totalTime(...e),o):n.totalTime()},time(...e){return t(),e.length>0?(n.time(...e),o):n.time()},duration(...e){return t(),e.length>0?(n.duration(...e),o):n.duration()},getChildren(...e){t();let i=n.getChildren(...e);return Array.isArray(i)?i:[]},paused(...e){return t(),e.length>0?(n.paused(...e),o):n.paused()},timeScale(...e){return t(),e.length>0?(n.timeScale(...e),o):n.timeScale()},kill(){t(),n.kill()}};return G(o,n),b.push(o),o}if(typeof window<"u"){window.__hf||(window.__hf={}),window.__hfTimelinesBuilding=!1,window.__hfFlushSync=()=>{t(),s.length===0&&window.__hfTimelinesBuilding&&k()};let n=null,o=new WeakSet;try{Object.defineProperty(window,"gsap",{configurable:!0,enumerable:!0,get(){return n},set(e){if(n=e,!e||typeof e.timeline!="function"||o.has(e))return;o.add(e);let i=e.timeline.bind(e);e.timeline=u=>B(i(u));for(let u of["to","from","set"]){let r=e[u];if(typeof r!="function")continue;let f=r.bind(e);e[u]=(...T)=>(m(u,T),f(...T))}let a=e.fromTo;if(typeof a=="function"){let u=a.bind(e);e.fromTo=(...r)=>(m("fromTo",r),u(...r))}}})}catch{}}})();\n';
297
308
  function getHfEarlyStub() {
@@ -859,13 +870,7 @@ function createFileServer(options) {
859
870
  app.get("/*", async (c) => {
860
871
  let requestPath = c.req.path;
861
872
  if (requestPath === "/") requestPath = "/index.html";
862
- const relativePath = requestPath.replace(/^\//, "").split("/").map((seg) => {
863
- try {
864
- return decodeURIComponent(seg);
865
- } catch {
866
- return seg;
867
- }
868
- }).join("/");
873
+ const relativePath = servedPath(requestPath);
869
874
  let file = null;
870
875
  for (const root of compiledDir ? [compiledDir, projectDir] : [projectDir]) {
871
876
  const candidate = join2(root, relativePath);
@@ -5675,7 +5680,7 @@ async function runProbeStage(input) {
5675
5680
  if (existingVideoIds.has(el.id)) {
5676
5681
  const existing = composition.videos.find((v) => v.id === el.id);
5677
5682
  if (existing) {
5678
- const sourceChanged = existing.src !== src;
5683
+ const sourceChanged = servedPath(existing.src) !== servedPath(src);
5679
5684
  if (sourceChanged) {
5680
5685
  existing.src = src;
5681
5686
  }
@@ -5723,7 +5728,7 @@ async function runProbeStage(input) {
5723
5728
  if (existingAudioIds.has(el.id)) {
5724
5729
  const existing = composition.audios.find((a) => a.id === el.id);
5725
5730
  if (existing) {
5726
- const sourceChanged = existing.src !== src;
5731
+ const sourceChanged = servedPath(existing.src) !== servedPath(src);
5727
5732
  if (sourceChanged) {
5728
5733
  existing.src = src;
5729
5734
  }
@@ -11106,12 +11111,7 @@ function planV2BlobPath(root, sha256) {
11106
11111
  }
11107
11112
 
11108
11113
  // src/services/distributed/planV2Publisher.ts
11109
- import { createStagingDir as createStagingDir5 } from "@hyperframes/core/atomic-file";
11110
- function canFallbackToCopy(error) {
11111
- if (!(error instanceof Error) || !("code" in error)) return false;
11112
- const code = error.code;
11113
- return code === "EXDEV" || code === "EPERM" || code === "EACCES" || code === "ENOTSUP";
11114
- }
11114
+ import { cannotHardLink, createStagingDir as createStagingDir5 } from "@hyperframes/core/atomic-file";
11115
11115
  function isRecord2(value) {
11116
11116
  return typeof value === "object" && value !== null && !Array.isArray(value);
11117
11117
  }
@@ -11163,7 +11163,7 @@ var LocalPlanV2ArtifactPublisher = class {
11163
11163
  try {
11164
11164
  this.#linkFile(blob.sourcePath, temporaryPath);
11165
11165
  } catch (error) {
11166
- if (!canFallbackToCopy(error)) throw error;
11166
+ if (!cannotHardLink(error)) throw error;
11167
11167
  copyFileSync7(blob.sourcePath, temporaryPath);
11168
11168
  }
11169
11169
  renameWithRetry9(temporaryPath, destinationPath);
package/dist/index.js CHANGED
@@ -163,6 +163,17 @@ function resolveVerifiedHyperframeRuntime() {
163
163
  };
164
164
  }
165
165
 
166
+ // src/services/servedPath.ts
167
+ function servedPath(urlPath) {
168
+ return urlPath.replace(/^\//, "").split("/").map((seg) => {
169
+ try {
170
+ return decodeURIComponent(seg);
171
+ } catch {
172
+ return seg;
173
+ }
174
+ }).join("/");
175
+ }
176
+
166
177
  // src/generated/hf-early-stub-inline.ts
167
178
  var HF_EARLY_STUB_IIFE = '"use strict";(()=>{var x=100,b=[],s=[],c=!1,w=!1,h=new Set;function _(n){let o=window.__HF_VIRTUAL_TIME__?.originalRequestAnimationFrame;return typeof o=="function"?o(n):requestAnimationFrame(n)}function O(n){let o=window.__HF_VIRTUAL_TIME__?.originalSetTimeout;if(typeof o=="function"){o(n,0);return}setTimeout(n,0)}function v(n){return n!==null&&typeof n=="object"&&"__hfIsProxy"in n?n.__hfReal:n}function m(n,o){n!=="add"&&A(o)}function p(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;let o=n;return"rotationX"in o||"rotationY"in o||"transformPerspective"in o}var d=new Set;function A(n){let o=n[0];if(o==null)return;let e=window;d.has(o)||(d.add(o),e.__hfAllTweenTargets=Array.from(d)),(p(n[1])||p(n[2]))&&(h.add(o),e.__hf3dTweenTargets=Array.from(h))}function y(n){let o=n.proxy.__hfReal,e=o[n.method];if(typeof e=="function"){let i=n.method==="add"?n.args.map(v):n.args;e.call(o,...i)}}function l(n,o,e){m(o,e);let i={proxy:n,method:o,args:e};return n.__hfQueue.push(i),s.push(i),R(),n}function g(n){let o=n.proxy.__hfQueue.indexOf(n);o>=0&&n.proxy.__hfQueue.splice(o,1)}function t(){for(;s.length>0;){let n=s.shift();n&&(g(n),y(n))}S()}function k(){w=!1,window.__hfTimelinesBuilding=!1;try{window.dispatchEvent(new CustomEvent("hf-timelines-built"))}catch{}}function S(){w||(w=!0,O(()=>{s.length===0?k():w=!1}))}function P(){c=!1;let n=s.splice(0,x);for(let o of n)g(o),y(o);s.length>0?(c=!0,_(P)):k()}function R(){c||(c=!0,window.__hfTimelinesBuilding=!0,_(P))}var I=new Set(["to","from","fromTo","set","add"]);function G(n,o){let e=o;for(;e!==null&&e!==Object.prototype;){for(let i of Object.getOwnPropertyNames(e)){if(i==="constructor"||i==="then"||i in n||I.has(i)||i.charAt(0)==="_")continue;let a=Object.getOwnPropertyDescriptor(e,i);if(!a||typeof a.value!="function")continue;let u=a.value;n[i]=function(...r){t();let f=u.call(o,...r);return f===o?n:f}}e=Object.getPrototypeOf(e)}}function B(n){let o={__hfReal:n,__hfQueue:[],__hfIsProxy:!0,to(...e){return l(o,"to",e)},from(...e){return l(o,"from",e)},fromTo(...e){return l(o,"fromTo",e)},set(...e){return l(o,"set",e)},add(...e){return l(o,"add",e)},pause(...e){return t(),n.pause(...e),o},play(...e){return t(),n.play(...e),o},seek(...e){return t(),n.seek(...e),o},totalTime(...e){return t(),e.length>0?(n.totalTime(...e),o):n.totalTime()},time(...e){return t(),e.length>0?(n.time(...e),o):n.time()},duration(...e){return t(),e.length>0?(n.duration(...e),o):n.duration()},getChildren(...e){t();let i=n.getChildren(...e);return Array.isArray(i)?i:[]},paused(...e){return t(),e.length>0?(n.paused(...e),o):n.paused()},timeScale(...e){return t(),e.length>0?(n.timeScale(...e),o):n.timeScale()},kill(){t(),n.kill()}};return G(o,n),b.push(o),o}if(typeof window<"u"){window.__hf||(window.__hf={}),window.__hfTimelinesBuilding=!1,window.__hfFlushSync=()=>{t(),s.length===0&&window.__hfTimelinesBuilding&&k()};let n=null,o=new WeakSet;try{Object.defineProperty(window,"gsap",{configurable:!0,enumerable:!0,get(){return n},set(e){if(n=e,!e||typeof e.timeline!="function"||o.has(e))return;o.add(e);let i=e.timeline.bind(e);e.timeline=u=>B(i(u));for(let u of["to","from","set"]){let r=e[u];if(typeof r!="function")continue;let f=r.bind(e);e[u]=(...T)=>(m(u,T),f(...T))}let a=e.fromTo;if(typeof a=="function"){let u=a.bind(e);e.fromTo=(...r)=>(m("fromTo",r),u(...r))}}})}catch{}}})();\n';
168
179
  function getHfEarlyStub() {
@@ -849,13 +860,7 @@ function createFileServer(options) {
849
860
  app.get("/*", async (c) => {
850
861
  let requestPath = c.req.path;
851
862
  if (requestPath === "/") requestPath = "/index.html";
852
- const relativePath = requestPath.replace(/^\//, "").split("/").map((seg) => {
853
- try {
854
- return decodeURIComponent(seg);
855
- } catch {
856
- return seg;
857
- }
858
- }).join("/");
863
+ const relativePath = servedPath(requestPath);
859
864
  let file = null;
860
865
  for (const root of compiledDir ? [compiledDir, projectDir] : [projectDir]) {
861
866
  const candidate = join2(root, relativePath);
@@ -9968,7 +9973,7 @@ async function runProbeStage(input) {
9968
9973
  if (existingVideoIds.has(el.id)) {
9969
9974
  const existing = composition.videos.find((v) => v.id === el.id);
9970
9975
  if (existing) {
9971
- const sourceChanged = existing.src !== src;
9976
+ const sourceChanged = servedPath(existing.src) !== servedPath(src);
9972
9977
  if (sourceChanged) {
9973
9978
  existing.src = src;
9974
9979
  }
@@ -10016,7 +10021,7 @@ async function runProbeStage(input) {
10016
10021
  if (existingAudioIds.has(el.id)) {
10017
10022
  const existing = composition.audios.find((a) => a.id === el.id);
10018
10023
  if (existing) {
10019
- const sourceChanged = existing.src !== src;
10024
+ const sourceChanged = servedPath(existing.src) !== servedPath(src);
10020
10025
  if (sourceChanged) {
10021
10026
  existing.src = src;
10022
10027
  }
@@ -19326,12 +19331,7 @@ function planV2BlobPath(root, sha256) {
19326
19331
  }
19327
19332
 
19328
19333
  // src/services/distributed/planV2Publisher.ts
19329
- import { createStagingDir as createStagingDir5 } from "@hyperframes/core/atomic-file";
19330
- function canFallbackToCopy(error) {
19331
- if (!(error instanceof Error) || !("code" in error)) return false;
19332
- const code = error.code;
19333
- return code === "EXDEV" || code === "EPERM" || code === "EACCES" || code === "ENOTSUP";
19334
- }
19334
+ import { cannotHardLink, createStagingDir as createStagingDir5 } from "@hyperframes/core/atomic-file";
19335
19335
  function isRecord2(value) {
19336
19336
  return typeof value === "object" && value !== null && !Array.isArray(value);
19337
19337
  }
@@ -19383,7 +19383,7 @@ var LocalPlanV2ArtifactPublisher = class {
19383
19383
  try {
19384
19384
  this.#linkFile(blob.sourcePath, temporaryPath);
19385
19385
  } catch (error) {
19386
- if (!canFallbackToCopy(error)) throw error;
19386
+ if (!cannotHardLink(error)) throw error;
19387
19387
  copyFileSync7(blob.sourcePath, temporaryPath);
19388
19388
  }
19389
19389
  renameWithRetry9(temporaryPath, destinationPath);
@@ -180,6 +180,17 @@ function resolveVerifiedHyperframeRuntime() {
180
180
  };
181
181
  }
182
182
 
183
+ // src/services/servedPath.ts
184
+ function servedPath(urlPath) {
185
+ return urlPath.replace(/^\//, "").split("/").map((seg) => {
186
+ try {
187
+ return decodeURIComponent(seg);
188
+ } catch {
189
+ return seg;
190
+ }
191
+ }).join("/");
192
+ }
193
+
183
194
  // src/generated/hf-early-stub-inline.ts
184
195
  var HF_EARLY_STUB_IIFE = '"use strict";(()=>{var x=100,b=[],s=[],c=!1,w=!1,h=new Set;function _(n){let o=window.__HF_VIRTUAL_TIME__?.originalRequestAnimationFrame;return typeof o=="function"?o(n):requestAnimationFrame(n)}function O(n){let o=window.__HF_VIRTUAL_TIME__?.originalSetTimeout;if(typeof o=="function"){o(n,0);return}setTimeout(n,0)}function v(n){return n!==null&&typeof n=="object"&&"__hfIsProxy"in n?n.__hfReal:n}function m(n,o){n!=="add"&&A(o)}function p(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;let o=n;return"rotationX"in o||"rotationY"in o||"transformPerspective"in o}var d=new Set;function A(n){let o=n[0];if(o==null)return;let e=window;d.has(o)||(d.add(o),e.__hfAllTweenTargets=Array.from(d)),(p(n[1])||p(n[2]))&&(h.add(o),e.__hf3dTweenTargets=Array.from(h))}function y(n){let o=n.proxy.__hfReal,e=o[n.method];if(typeof e=="function"){let i=n.method==="add"?n.args.map(v):n.args;e.call(o,...i)}}function l(n,o,e){m(o,e);let i={proxy:n,method:o,args:e};return n.__hfQueue.push(i),s.push(i),R(),n}function g(n){let o=n.proxy.__hfQueue.indexOf(n);o>=0&&n.proxy.__hfQueue.splice(o,1)}function t(){for(;s.length>0;){let n=s.shift();n&&(g(n),y(n))}S()}function k(){w=!1,window.__hfTimelinesBuilding=!1;try{window.dispatchEvent(new CustomEvent("hf-timelines-built"))}catch{}}function S(){w||(w=!0,O(()=>{s.length===0?k():w=!1}))}function P(){c=!1;let n=s.splice(0,x);for(let o of n)g(o),y(o);s.length>0?(c=!0,_(P)):k()}function R(){c||(c=!0,window.__hfTimelinesBuilding=!0,_(P))}var I=new Set(["to","from","fromTo","set","add"]);function G(n,o){let e=o;for(;e!==null&&e!==Object.prototype;){for(let i of Object.getOwnPropertyNames(e)){if(i==="constructor"||i==="then"||i in n||I.has(i)||i.charAt(0)==="_")continue;let a=Object.getOwnPropertyDescriptor(e,i);if(!a||typeof a.value!="function")continue;let u=a.value;n[i]=function(...r){t();let f=u.call(o,...r);return f===o?n:f}}e=Object.getPrototypeOf(e)}}function B(n){let o={__hfReal:n,__hfQueue:[],__hfIsProxy:!0,to(...e){return l(o,"to",e)},from(...e){return l(o,"from",e)},fromTo(...e){return l(o,"fromTo",e)},set(...e){return l(o,"set",e)},add(...e){return l(o,"add",e)},pause(...e){return t(),n.pause(...e),o},play(...e){return t(),n.play(...e),o},seek(...e){return t(),n.seek(...e),o},totalTime(...e){return t(),e.length>0?(n.totalTime(...e),o):n.totalTime()},time(...e){return t(),e.length>0?(n.time(...e),o):n.time()},duration(...e){return t(),e.length>0?(n.duration(...e),o):n.duration()},getChildren(...e){t();let i=n.getChildren(...e);return Array.isArray(i)?i:[]},paused(...e){return t(),e.length>0?(n.paused(...e),o):n.paused()},timeScale(...e){return t(),e.length>0?(n.timeScale(...e),o):n.timeScale()},kill(){t(),n.kill()}};return G(o,n),b.push(o),o}if(typeof window<"u"){window.__hf||(window.__hf={}),window.__hfTimelinesBuilding=!1,window.__hfFlushSync=()=>{t(),s.length===0&&window.__hfTimelinesBuilding&&k()};let n=null,o=new WeakSet;try{Object.defineProperty(window,"gsap",{configurable:!0,enumerable:!0,get(){return n},set(e){if(n=e,!e||typeof e.timeline!="function"||o.has(e))return;o.add(e);let i=e.timeline.bind(e);e.timeline=u=>B(i(u));for(let u of["to","from","set"]){let r=e[u];if(typeof r!="function")continue;let f=r.bind(e);e[u]=(...T)=>(m(u,T),f(...T))}let a=e.fromTo;if(typeof a=="function"){let u=a.bind(e);e.fromTo=(...r)=>(m("fromTo",r),u(...r))}}})}catch{}}})();\n';
185
196
  function getHfEarlyStub() {
@@ -866,13 +877,7 @@ function createFileServer(options) {
866
877
  app.get("/*", async (c) => {
867
878
  let requestPath = c.req.path;
868
879
  if (requestPath === "/") requestPath = "/index.html";
869
- const relativePath = requestPath.replace(/^\//, "").split("/").map((seg) => {
870
- try {
871
- return decodeURIComponent(seg);
872
- } catch {
873
- return seg;
874
- }
875
- }).join("/");
880
+ const relativePath = servedPath(requestPath);
876
881
  let file = null;
877
882
  for (const root of compiledDir ? [compiledDir, projectDir] : [projectDir]) {
878
883
  const candidate = join2(root, relativePath);
@@ -9978,7 +9983,7 @@ async function runProbeStage(input) {
9978
9983
  if (existingVideoIds.has(el.id)) {
9979
9984
  const existing = composition.videos.find((v) => v.id === el.id);
9980
9985
  if (existing) {
9981
- const sourceChanged = existing.src !== src;
9986
+ const sourceChanged = servedPath(existing.src) !== servedPath(src);
9982
9987
  if (sourceChanged) {
9983
9988
  existing.src = src;
9984
9989
  }
@@ -10026,7 +10031,7 @@ async function runProbeStage(input) {
10026
10031
  if (existingAudioIds.has(el.id)) {
10027
10032
  const existing = composition.audios.find((a) => a.id === el.id);
10028
10033
  if (existing) {
10029
- const sourceChanged = existing.src !== src;
10034
+ const sourceChanged = servedPath(existing.src) !== servedPath(src);
10030
10035
  if (sourceChanged) {
10031
10036
  existing.src = src;
10032
10037
  }
@@ -0,0 +1,2 @@
1
+ /** The project-relative path a render file server URL path names: each segment decoded, as the browser encoded it. */
2
+ export declare function servedPath(urlPath: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/producer",
3
- "version": "0.9.45",
3
+ "version": "0.9.47",
4
4
  "description": "HTML-to-video rendering engine using Chrome's BeginFrame API",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,11 +35,11 @@
35
35
  "postcss": "^8.4.0",
36
36
  "puppeteer": "~25.13.0",
37
37
  "puppeteer-core": "^25.13.0",
38
- "@hyperframes/core": "0.9.45",
39
- "@hyperframes/engine": "0.9.45",
40
- "@hyperframes/studio-server": "0.9.45",
41
- "@hyperframes/parsers": "0.9.45",
42
- "@hyperframes/lint": "0.9.45"
38
+ "@hyperframes/core": "0.9.47",
39
+ "@hyperframes/lint": "0.9.47",
40
+ "@hyperframes/engine": "0.9.47",
41
+ "@hyperframes/parsers": "0.9.47",
42
+ "@hyperframes/studio-server": "0.9.47"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "^25.0.10",
@@ -48,7 +48,7 @@
48
48
  "tsx": "^4.21.0",
49
49
  "typescript": "^5.7.2",
50
50
  "vitest": "^4.1.12",
51
- "@hyperframes/aws-lambda": "0.9.45"
51
+ "@hyperframes/aws-lambda": "0.9.47"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22"