hyperframes 0.8.141 → 0.8.142

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 (160) hide show
  1. package/dist/{add-KH2CF4FD.js → add-YS2RCWEK.js} +11 -11
  2. package/dist/{animatedGifPrep-QO4BSKR7.js → animatedGifPrep-SAMCDT7T.js} +6 -7
  3. package/dist/{asset-4RDZILVJ.js → asset-BLWC2NWB.js} +2 -2
  4. package/dist/{assetCataloger-WGR4LYYN.js → assetCataloger-FVNBBRP3.js} +2 -2
  5. package/dist/{auth-WYQCOYE5.js → auth-DRZB7OAC.js} +5 -4
  6. package/dist/{autoUpdate-PC5TN3NL.js → autoUpdate-I5I3BOJK.js} +2 -2
  7. package/dist/{backgroundChecks-7M3T44EP.js → backgroundChecks-VR2QHGNY.js} +3 -3
  8. package/dist/backgroundChecksWorker.js +3 -3
  9. package/dist/{batchRender-GOLLOE4V.js → batchRender-4YUHQI6X.js} +3 -3
  10. package/dist/{beats-XJ7WP6QS.js → beats-7OT7ALV3.js} +11 -12
  11. package/dist/{benchmark-HCGFBEZJ.js → benchmark-Q2XQCRTR.js} +8 -8
  12. package/dist/{browser-VQKO2FKG.js → browser-7VAWQQZC.js} +3 -3
  13. package/dist/{bundleWithLocalizedFonts-FH7PHTTX.js → bundleWithLocalizedFonts-DDMLLL2R.js} +2 -2
  14. package/dist/{capture-TFZZSF6F.js → capture-HEJS6M5A.js} +74 -33
  15. package/dist/{capture-XD3P3YQR.js → capture-U7ABPKS5.js} +24 -8
  16. package/dist/{catalog-4S33QWJJ.js → catalog-DVJ3XPDN.js} +11 -11
  17. package/dist/{catch-up-RW7YXXNT.js → catch-up-DF6AVSN2.js} +4 -4
  18. package/dist/{check-XVTRRN4Y.js → check-KXORRWAE.js} +75 -72
  19. package/dist/{checkBrowser-HZXJ2EDU.js → checkBrowser-J7HZJTRH.js} +28 -29
  20. package/dist/{chunk-XTFJOR3K.js → chunk-4SFGME7K.js} +1 -1
  21. package/dist/{chunk-EDYBFSPE.js → chunk-6RAD4BCC.js} +5 -8
  22. package/dist/{chunk-4BB7V6AI.js → chunk-6UM3R7PP.js} +1 -1
  23. package/dist/{chunk-BM5PX3DJ.js → chunk-6UYZB4TY.js} +1 -1
  24. package/dist/{chunk-L3JSAB4L.js → chunk-75JJVANE.js} +2 -2
  25. package/dist/{chunk-IV7EI5E2.js → chunk-7FCDA4RH.js} +1 -1
  26. package/dist/{chunk-HKCNZITN.js → chunk-AM5L5YIA.js} +1 -1
  27. package/dist/{chunk-BRITLL56.js → chunk-B4P5VDFQ.js} +1 -1
  28. package/dist/{chunk-IO7ZIDRP.js → chunk-B6SMSALD.js} +53 -12
  29. package/dist/{chunk-XWVGSEUT.js → chunk-BPZVDBHY.js} +1 -1
  30. package/dist/{chunk-246MOR5U.js → chunk-DKSDVDXG.js} +175 -162
  31. package/dist/{chunk-35RSNI77.js → chunk-DPHJKWP5.js} +2 -2
  32. package/dist/{chunk-W6HTOVHU.js → chunk-DZEVA7DI.js} +2 -2
  33. package/dist/{chunk-AVWEIOEN.js → chunk-EFDXGAAD.js} +1 -1
  34. package/dist/{chunk-3A5AAPMP.js → chunk-FWRNQOLT.js} +1 -1
  35. package/dist/{chunk-GS6FE3IW.js → chunk-FZK35GT4.js} +1 -1
  36. package/dist/{chunk-RPYPW5NN.js → chunk-GYE63V4P.js} +10 -10
  37. package/dist/{chunk-R7UDXKI3.js → chunk-H2X52H2N.js} +3 -3
  38. package/dist/{chunk-3NBKW2QJ.js → chunk-HMUF7FEO.js} +1 -1
  39. package/dist/{chunk-E6SDW5FV.js → chunk-IDX52YJN.js} +5 -5
  40. package/dist/{chunk-OLDDJS3S.js → chunk-IMY4QQTQ.js} +7 -7
  41. package/dist/{chunk-WY5OODN5.js → chunk-IW2CKH6A.js} +3645 -3
  42. package/dist/{chunk-KFH6UD26.js → chunk-IXCTG2WY.js} +3 -3
  43. package/dist/chunk-J4UX3RS3.js +3717 -0
  44. package/dist/{chunk-IYFKBFTW.js → chunk-JLKMWY2T.js} +1 -1
  45. package/dist/{chunk-IKVBTDLO.js → chunk-JOTLPC6S.js} +1 -1
  46. package/dist/{chunk-6IFXWJDX.js → chunk-JU6Y5TTZ.js} +2 -2
  47. package/dist/{chunk-YURXPGAM.js → chunk-KYN364DU.js} +2 -2
  48. package/dist/{chunk-RCFCZT5O.js → chunk-LBKDQKWV.js} +1 -1
  49. package/dist/{chunk-TC2FBZJZ.js → chunk-LJAU4TPS.js} +1 -1
  50. package/dist/{chunk-34TXESM7.js → chunk-LQASVU3I.js} +3 -3
  51. package/dist/{chunk-NORZWWLK.js → chunk-LTGGTEMA.js} +2 -2
  52. package/dist/{chunk-K2GOFLTX.js → chunk-MVTUV4TP.js} +2 -2
  53. package/dist/{chunk-A7YQNIQT.js → chunk-OKCR3JTO.js} +104 -4
  54. package/dist/{chunk-O3SKIXQK.js → chunk-OSUKETIH.js} +1 -1
  55. package/dist/chunk-P36MALQF.js +15 -0
  56. package/dist/{chunk-P6E4HFFU.js → chunk-QGRFOOLE.js} +8 -8
  57. package/dist/{chunk-Q65ZQFF2.js → chunk-QXPCARFE.js} +1 -1
  58. package/dist/{chunk-E4BSCXMU.js → chunk-R2JEKLDZ.js} +1 -1
  59. package/dist/{chunk-EKA4ZZBI.js → chunk-TY6XOHEM.js} +1 -1
  60. package/dist/{chunk-INI3TM6I.js → chunk-WGVOWWVK.js} +2 -2
  61. package/dist/{chunk-XDSOIJC3.js → chunk-WSGY5CDQ.js} +5 -5
  62. package/dist/{chunk-J5IPIQU2.js → chunk-WTMUCJ6Z.js} +1 -1
  63. package/dist/{chunk-7XTZVLE6.js → chunk-XGMNQQTJ.js} +1 -1
  64. package/dist/{chunk-N77KD7ZZ.js → chunk-XTLBLWOV.js} +1 -1
  65. package/dist/{chunk-6E6CM7WS.js → chunk-YFT3BL7N.js} +1 -1
  66. package/dist/{chunk-6Q6FR4KH.js → chunk-YHRZQJXH.js} +43 -29
  67. package/dist/{clean-L2E4VD57.js → clean-KTHTV5G5.js} +12 -13
  68. package/dist/cli.js +52 -52
  69. package/dist/{cloud-IDUQRYLO.js → cloud-ARSZWALC.js} +4 -4
  70. package/dist/{cloudrun-R3JXWXGG.js → cloudrun-NM7RXOCL.js} +3 -3
  71. package/dist/commands/layout-audit.browser.js +20 -20
  72. package/dist/{compare-VYBWSP3Y.js → compare-CY4UO3RW.js} +23 -24
  73. package/dist/{compiler-ACHWOU5N.js → compiler-VTH2D3ID.js} +3 -4
  74. package/dist/{component-PYYV2V3F.js → component-FRUIAXIR.js} +3 -3
  75. package/dist/{compositions-B5GQSXH7.js → compositions-CUSY6ZYY.js} +10 -11
  76. package/dist/{delete-EAX2U3WI.js → delete-KT3VHP4L.js} +5 -5
  77. package/dist/{dist-ROUDWGLO.js → dist-2GC6XKRQ.js} +2 -2
  78. package/dist/{dist-NZSQCYOF.js → dist-7SZU7MA7.js} +1 -2
  79. package/dist/{doctor-PJX7MLFG.js → doctor-4ROTBL5U.js} +8 -9
  80. package/dist/{events-SBC54MHO.js → events-Q5PXT5UC.js} +2 -2
  81. package/dist/{events-YFFXKAQQ.js → events-QJDVMKSR.js} +3 -3
  82. package/dist/{feedback-UETLWREV.js → feedback-PQ7TWESA.js} +10 -10
  83. package/dist/{figma-QDSJPIRW.js → figma-JN5DDBDS.js} +3 -3
  84. package/dist/fontLocalizeCli.js +8 -9
  85. package/dist/{get-B5TS6C7H.js → get-KT6OTERO.js} +5 -5
  86. package/dist/{gpuPolicy-LYOVBAJP.js → gpuPolicy-LCBWVGEH.js} +6 -7
  87. package/dist/{grade-compare-LBIHMAUN.js → grade-compare-VS3RP73G.js} +23 -24
  88. package/dist/{help-XBP6A6LT.js → help-AD6FIZIO.js} +1 -1
  89. package/dist/{history-2S42ZXKL.js → history-ZRWYRY7R.js} +5 -5
  90. package/dist/hyperframe-runtime.js +2 -2
  91. package/dist/hyperframe.manifest.json +1 -1
  92. package/dist/hyperframe.runtime.iife.js +2 -2
  93. package/dist/hyperframes-player.global.js +1 -1
  94. package/dist/{info-I2VDAWT7.js → info-WBBQA2AX.js} +7 -7
  95. package/dist/{init-BGHSDODI.js → init-A2XBDFGF.js} +21 -22
  96. package/dist/{inspect-MZK5B5RP.js → inspect-CLTZHA5O.js} +24 -25
  97. package/dist/{installer-LL4QAKFW.js → installer-WQDRVXH4.js} +4 -4
  98. package/dist/{keyframes-2EBF7OSS.js → keyframes-3FYOK6H6.js} +6 -6
  99. package/dist/{lambda-XKFPAOFE.js → lambda-Y2PA2BGS.js} +4 -4
  100. package/dist/{layout-TP5ERKEF.js → layout-4KP5O7IJ.js} +24 -25
  101. package/dist/{lint-FQ6CEI7E.js → lint-V4GRFHOJ.js} +7 -8
  102. package/dist/{lintProject-LM3XZRPZ.js → lintProject-RG2KGAXB.js} +1 -2
  103. package/dist/{list-FRNUJXZ3.js → list-OQ4VED6E.js} +5 -5
  104. package/dist/{login-C25QU3BQ.js → login-W47NKN5S.js} +20 -24
  105. package/dist/{logout-GJXZQKOA.js → logout-B4KS4A7S.js} +6 -6
  106. package/dist/{media-treatment-DCANGWSV.js → media-treatment-HJYL3EME.js} +43 -24
  107. package/dist/{models-GOD6ARB3.js → models-DYBAD2GQ.js} +7 -8
  108. package/dist/{motionShot-FSKETANX.js → motionShot-7NE2YBB3.js} +12 -13
  109. package/dist/{normalize-audio-C2IM7OID.js → normalize-audio-INKCLMS2.js} +4 -4
  110. package/dist/{open-VVISXIII.js → open-TYC5THVY.js} +4 -4
  111. package/dist/{pipeline-7YHZPYIS.js → pipeline-EVKEPQEW.js} +6 -7
  112. package/dist/{play-DSELK7G3.js → play-QMZEM6X3.js} +17 -18
  113. package/dist/{present-N72YFDKP.js → present-Y7IK3C4W.js} +13 -14
  114. package/dist/{preview-XTYN4NJ2.js → preview-5OQRYE6A.js} +16 -17
  115. package/dist/{producer-NDCU3MHK.js → producer-Q6G6JU7B.js} +1 -1
  116. package/dist/{projectConfig-MH4QU4AC.js → projectConfig-RJN3DKDB.js} +6 -6
  117. package/dist/{publication-KUSHI5MG.js → publication-QCPGGN3U.js} +2 -2
  118. package/dist/{publish-3XEEFWMF.js → publish-VZLFIGYY.js} +15 -15
  119. package/dist/{refresh-MFITBIKV.js → refresh-PVHBEABE.js} +2 -2
  120. package/dist/{remove-background-2QKJ7XOD.js → remove-background-TKOEHBA5.js} +7 -8
  121. package/dist/{render-S73DW4KK.js → render-KIIIF6PS.js} +13 -13
  122. package/dist/{render-2DVYTVLQ.js → render-X3NFNVEQ.js} +19 -20
  123. package/dist/{render-75E342ZU.js → render-XTXE5CRU.js} +3 -3
  124. package/dist/{render-batch-YURBS54Q.js → render-batch-M55YZLZ5.js} +3 -3
  125. package/dist/{renderCancellation-373ASJTO.js → renderCancellation-X5BEHAZU.js} +6 -7
  126. package/dist/renderSetupWorker.js +1 -2
  127. package/dist/{resolver-FE3GBZ4T.js → resolver-GAMXRA42.js} +4 -4
  128. package/dist/{screenshotCapture-ECBTLCU6.js → screenshotCapture-TEUIWXWN.js} +53 -33
  129. package/dist/{sherpa-B2D3AGP6.js → sherpa-ZYTNFHD5.js} +7 -8
  130. package/dist/skills/hyperframes-cli/references/cloud.md +1 -1
  131. package/dist/skills/media-use/references/grading.md +4 -2
  132. package/dist/{skills-ICJ22CZZ.js → skills-CZHVAD3J.js} +5 -5
  133. package/dist/{skillsUpdateCheck-GXZN56I5.js → skillsUpdateCheck-6WLLX53A.js} +3 -3
  134. package/dist/{snapshot-XHKOAWF4.js → snapshot-K7BTJPYQ.js} +24 -25
  135. package/dist/{src-I7UC3JTL.js → src-3I3RH3V5.js} +5 -6
  136. package/dist/{src-74PFDTDX.js → src-YUW26JU5.js} +7 -8
  137. package/dist/{staticProjectServer-2DGKD6TF.js → staticProjectServer-IKCSGN2B.js} +13 -14
  138. package/dist/{status-JA6SKQVH.js → status-LXPGSSKY.js} +6 -4
  139. package/dist/studio/assets/{hyperframes-player-5Vx2AiUz.js → hyperframes-player-sAsRuV73.js} +1 -1
  140. package/dist/studio/assets/{index-C0thd4eM.js → index-B-wffzRH.js} +126 -126
  141. package/dist/studio/assets/{index-BAnh7cSQ.js → index-D3Vij9t1.js} +1 -1
  142. package/dist/studio/assets/{index-P8fgj_Xa.js → index-D5q2_7Gw.js} +1 -1
  143. package/dist/studio/index.html +1 -1
  144. package/dist/studio/index.js +26 -15
  145. package/dist/studio/index.js.map +1 -1
  146. package/dist/{studio-api-PROBO7JG.js → studio-api-SQ3NXFSM.js} +7 -8
  147. package/dist/{studioServer-ID6UV2NE.js → studioServer-VVEO7XCH.js} +35 -36
  148. package/dist/{telemetry-65LFHIWH.js → telemetry-FQDKR5XA.js} +3 -3
  149. package/dist/{timeline-6UV3JJXD.js → timeline-N6ZASFNE.js} +13 -14
  150. package/dist/{tokens-HIL4TZXI.js → tokens-2OIIBBCW.js} +2 -2
  151. package/dist/{transcribe-TIO6W3EQ.js → transcribe-4F6MK73N.js} +7 -8
  152. package/dist/{transcribe-V7F6QDSN.js → transcribe-7YTUCXDX.js} +6 -6
  153. package/dist/{updateCheck-GZELANMA.js → updateCheck-AZ2COZFR.js} +2 -2
  154. package/dist/{upgrade-BX3KDDZJ.js → upgrade-QAJEYB4X.js} +2 -2
  155. package/dist/{urlDownloader-R76OHFIE.js → urlDownloader-LSMFEO3R.js} +5 -6
  156. package/dist/{validate-7UX4I443.js → validate-GW5MDL36.js} +15 -16
  157. package/dist/{video-RVGYEFQU.js → video-PRNOKUK3.js} +6 -7
  158. package/package.json +1 -1
  159. package/dist/chunk-24OWOBQH.js +0 -3656
  160. package/dist/chunk-SYKKFAUW.js +0 -3711
@@ -6,13 +6,14 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  refreshIfNeeded
9
- } from "./chunk-BRITLL56.js";
9
+ } from "./chunk-B4P5VDFQ.js";
10
10
  import {
11
11
  buildAuthHeaders,
12
+ envCredentialVar,
12
13
  isAuthError,
13
14
  isTokenExpired,
14
15
  tryResolveCredential
15
- } from "./chunk-246MOR5U.js";
16
+ } from "./chunk-DKSDVDXG.js";
16
17
  import {
17
18
  CSS_URL_RE,
18
19
  isNonRelativeUrl,
@@ -204,12 +205,9 @@ async function metadataRequestError(response, fallback) {
204
205
  }
205
206
  var LOGIN_EXPIRED = "Your login expired. Run hyperframes auth login, then publish again.";
206
207
  var LOGIN_CHANGED = "Your login changed during publish. Run publish again.";
207
- var API_KEY_ENV_VAR = { env: "HEYGEN_API_KEY", env_alias: "HYPERFRAMES_API_KEY" };
208
208
  function rejectedCredentialMessage(credential) {
209
- if (credential.type === "api_key" && (credential.source === "env" || credential.source === "env_alias")) {
210
- return `${API_KEY_ENV_VAR[credential.source]} was rejected. Fix or unset it, then publish again.`;
211
- }
212
- return LOGIN_EXPIRED;
209
+ const envVar = envCredentialVar(credential.source);
210
+ return envVar ? `${envVar} was rejected. Fix or unset it, then publish again.` : LOGIN_EXPIRED;
213
211
  }
214
212
  async function resolvePublishCredential(checked) {
215
213
  try {
@@ -637,7 +635,6 @@ export {
637
635
  ensureProjectId,
638
636
  readTeamProject,
639
637
  writeTeamProject,
640
- API_KEY_ENV_VAR,
641
638
  resolvePublishCredential,
642
639
  rewriteHtmlAttributes,
643
640
  buildPublishFileMap,
@@ -9,7 +9,7 @@ import {
9
9
  formatPreviewProxyBox,
10
10
  hdrToSdrToneMapFilter,
11
11
  parseFirstFrameColour
12
- } from "./chunk-6E6CM7WS.js";
12
+ } from "./chunk-YFT3BL7N.js";
13
13
  import {
14
14
  mkdirWithinProject,
15
15
  realProjectRoot,
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  formatVariableValidationIssue,
18
18
  validateVariables
19
- } from "./chunk-6E6CM7WS.js";
19
+ } from "./chunk-YFT3BL7N.js";
20
20
  import {
21
21
  extractCompositionMetadata
22
22
  } from "./chunk-OZUQF4NB.js";
@@ -8,14 +8,14 @@ import {
8
8
  DEFAULT_REGISTRY_URL,
9
9
  fetchItemFile,
10
10
  validRegistryItem
11
- } from "./chunk-Q65ZQFF2.js";
11
+ } from "./chunk-QXPCARFE.js";
12
12
  import {
13
13
  publishRegistryFile,
14
14
  registryTargetPath
15
15
  } from "./chunk-GMECXFAN.js";
16
16
  import {
17
17
  validateVariables
18
- } from "./chunk-6E6CM7WS.js";
18
+ } from "./chunk-YFT3BL7N.js";
19
19
  import {
20
20
  realProjectRoot
21
21
  } from "./chunk-OFQWTKPW.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-6IHWCZ3W.js";
10
10
  import {
11
11
  stoppedByCancelSignal
12
- } from "./chunk-3A5AAPMP.js";
12
+ } from "./chunk-FWRNQOLT.js";
13
13
  import {
14
14
  DEFAULT_MODEL,
15
15
  ensureModel,
@@ -8,7 +8,7 @@ import {
8
8
  forceRefreshCredentials,
9
9
  resolveCloudAuthHeaders,
10
10
  resolveCloudBaseUrl
11
- } from "./chunk-BRITLL56.js";
11
+ } from "./chunk-B4P5VDFQ.js";
12
12
  import {
13
13
  errorBox
14
14
  } from "./chunk-IHFUKJOR.js";
@@ -9,7 +9,7 @@ import {
9
9
  buildAuthHeaders,
10
10
  refreshTokens,
11
11
  resolveCredential
12
- } from "./chunk-246MOR5U.js";
12
+ } from "./chunk-DKSDVDXG.js";
13
13
 
14
14
  // src/cloud/auth.ts
15
15
  async function resolveCloudAuthHeaders() {
@@ -6,24 +6,24 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  serveStaticProjectHtml
9
- } from "./chunk-34TXESM7.js";
9
+ } from "./chunk-LQASVU3I.js";
10
10
  import {
11
11
  resolveProject
12
- } from "./chunk-TC2FBZJZ.js";
12
+ } from "./chunk-LJAU4TPS.js";
13
13
  import {
14
14
  AUDIT_SEEK_OPTIONS,
15
15
  installPageFunctionGuard,
16
16
  seekCompositionTimeline,
17
17
  waitForCompositionFonts,
18
18
  waitForRuntimeReady
19
- } from "./chunk-XDSOIJC3.js";
19
+ } from "./chunk-WSGY5CDQ.js";
20
20
  import {
21
21
  launchManagedBrowser,
22
22
  resolveManagedGpuMode
23
- } from "./chunk-O3SKIXQK.js";
23
+ } from "./chunk-OSUKETIH.js";
24
24
  import {
25
25
  resolveDiagnosticNavigationTimeoutMs
26
- } from "./chunk-EKA4ZZBI.js";
26
+ } from "./chunk-TY6XOHEM.js";
27
27
  import {
28
28
  defineCommand
29
29
  } from "./chunk-S3S4TGEH.js";
@@ -34,7 +34,7 @@ import {
34
34
  import {
35
35
  printDeprecationNotice,
36
36
  withMeta
37
- } from "./chunk-IYFKBFTW.js";
37
+ } from "./chunk-JLKMWY2T.js";
38
38
  import {
39
39
  normalizeErrorMessage
40
40
  } from "./chunk-KNU5COPB.js";
@@ -47,6 +47,36 @@ import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
47
47
  import { dirname, join as join2 } from "path";
48
48
  import { fileURLToPath } from "url";
49
49
 
50
+ // src/utils/checkFindings.ts
51
+ var SEVERITY = { info: 0, warning: 1, error: 2 };
52
+ function findingElementKey(finding) {
53
+ return JSON.stringify([finding.sourceFile, finding.selector]);
54
+ }
55
+ function groupSampledFindings(findings, compareEvidence = () => 0) {
56
+ const groups = /* @__PURE__ */ new Map();
57
+ for (const finding of findings) {
58
+ const key = JSON.stringify([findingElementKey(finding), finding.code]);
59
+ const times = finding.times ?? [finding.time];
60
+ const group = groups.get(key);
61
+ if (!group) {
62
+ groups.set(key, { finding, times: new Set(times) });
63
+ continue;
64
+ }
65
+ for (const time of times) group.times.add(time);
66
+ const severity = SEVERITY[finding.severity] - SEVERITY[group.finding.severity];
67
+ if (severity > 0 || severity === 0 && compareEvidence(finding, group.finding) > 0) {
68
+ group.finding = finding;
69
+ }
70
+ }
71
+ return [...groups.values()].map(({ finding, times }) => ({
72
+ ...finding,
73
+ times: [...times].sort((a, b) => a - b)
74
+ }));
75
+ }
76
+ function formatFindingTimes(finding) {
77
+ return `t=${(finding.times ?? [finding.time]).join(", ")}s`;
78
+ }
79
+
50
80
  // src/utils/layoutAudit.ts
51
81
  function buildLayoutSampleTimes({ duration, samples, at }) {
52
82
  if (at?.length) {
@@ -73,7 +103,12 @@ function summarizeLayoutIssues(issues) {
73
103
  };
74
104
  }
75
105
  function formatLayoutIssue(issue) {
76
- const timeLabel = issue.occurrences && issue.occurrences > 1 ? `t=${formatNumber(issue.firstSeen ?? issue.time)}-${formatNumber(issue.lastSeen ?? issue.time)}s (${issue.occurrences} samples)` : `t=${formatNumber(issue.time)}s`;
106
+ let timeLabel = `t=${formatNumber(issue.time)}s`;
107
+ if (issue.times) {
108
+ timeLabel = formatFindingTimes(issue);
109
+ } else if (issue.occurrences && issue.occurrences > 1) {
110
+ timeLabel = `t=${formatNumber(issue.firstSeen ?? issue.time)}-${formatNumber(issue.lastSeen ?? issue.time)}s (${issue.occurrences} samples)`;
111
+ }
77
112
  const parts = [
78
113
  timeLabel,
79
114
  issue.code,
@@ -91,6 +126,7 @@ function dedupeLayoutIssues(issues) {
91
126
  const result = [];
92
127
  for (const issue of issues) {
93
128
  const key = [
129
+ Reflect.get(issue, "sourceFile") ?? "",
94
130
  issue.code,
95
131
  issue.severity,
96
132
  issue.time.toFixed(3),
@@ -152,11 +188,11 @@ function collapseStaticLayoutIssues(issues, totalSampleCount) {
152
188
  ({ issue, firstSeen, lastSeen, occurrences, times }) => applyPersistenceTier(
153
189
  {
154
190
  ...issue,
155
- time: firstSeen,
156
191
  firstSeen,
157
192
  lastSeen,
158
193
  occurrences,
159
- heldMs: longestContiguousRunMs(times)
194
+ heldMs: longestContiguousRunMs(times),
195
+ times: [...new Set(times)].sort((a, b) => a - b)
160
196
  },
161
197
  multiSampleRun
162
198
  )
@@ -234,6 +270,7 @@ function severityRank(severity) {
234
270
  }
235
271
  function staticIssueKey(issue) {
236
272
  return [
273
+ Reflect.get(issue, "sourceFile") ?? "",
237
274
  issue.code,
238
275
  issue.severity,
239
276
  issue.selector,
@@ -670,7 +707,7 @@ async function collectTweenBoundaries(page) {
670
707
  });
671
708
  }
672
709
  async function bundleProjectHtml(projectDir) {
673
- const { bundleToSingleHtml } = await import("./compiler-ACHWOU5N.js");
710
+ const { bundleToSingleHtml } = await import("./compiler-VTH2D3ID.js");
674
711
  return bundleToSingleHtml(projectDir);
675
712
  }
676
713
  async function alignViewportToComposition(page, url) {
@@ -692,8 +729,8 @@ async function alignViewportToComposition(page, url) {
692
729
  async function runLayoutAudit(projectDir, opts) {
693
730
  const { ensureBrowser } = await import("./manager-CT3D67CG.js");
694
731
  const puppeteer = await import("puppeteer-core");
695
- const { buildChromeArgs } = await import("./src-I7UC3JTL.js");
696
- const { assertWebGpuAdapterAvailable, compositionRequiresWebGpu, resolveLocalBrowserGpuMode } = await import("./gpuPolicy-LYOVBAJP.js");
732
+ const { buildChromeArgs } = await import("./src-3I3RH3V5.js");
733
+ const { assertWebGpuAdapterAvailable, compositionRequiresWebGpu, resolveLocalBrowserGpuMode } = await import("./gpuPolicy-LCBWVGEH.js");
697
734
  const html = await bundleProjectHtml(projectDir);
698
735
  const server = await serveStaticProjectHtml(
699
736
  projectDir,
@@ -1056,10 +1093,14 @@ function createInspectCommand(commandName) {
1056
1093
  var layout_default = createInspectCommand("layout");
1057
1094
 
1058
1095
  export {
1096
+ findingElementKey,
1097
+ groupSampledFindings,
1098
+ formatFindingTimes,
1059
1099
  buildLayoutSampleTimes,
1060
1100
  formatLayoutIssue,
1061
1101
  dedupeLayoutIssues,
1062
1102
  collapseStaticLayoutIssues,
1103
+ longestContiguousRunMs,
1063
1104
  limitLayoutIssues,
1064
1105
  buildTransitionSampleTimes,
1065
1106
  mergeSampleTimes,
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  VERSION
9
- } from "./chunk-W6HTOVHU.js";
9
+ } from "./chunk-DZEVA7DI.js";
10
10
 
11
11
  // src/registry/compatibility.ts
12
12
  import { compareVersions } from "compare-versions";
@@ -14,6 +14,19 @@ import {
14
14
  c
15
15
  } from "./chunk-ZTZA4UWZ.js";
16
16
 
17
+ // src/auth/paths.ts
18
+ import { homedir } from "os";
19
+ import { join } from "path";
20
+ var CREDENTIAL_FILENAME = "credentials";
21
+ function configDir() {
22
+ const override = process.env["HEYGEN_CONFIG_DIR"];
23
+ if (override && override.length > 0) return override;
24
+ return join(homedir(), ".heygen");
25
+ }
26
+ function credentialPath() {
27
+ return join(configDir(), CREDENTIAL_FILENAME);
28
+ }
29
+
17
30
  // src/auth/errors.ts
18
31
  var AuthError = class extends Error {
19
32
  code;
@@ -70,154 +83,6 @@ function isAuthError(err) {
70
83
  return err instanceof AuthError;
71
84
  }
72
85
 
73
- // src/auth/scrub.ts
74
- var HEYGEN_KEY = /\b(hg|sk)_[A-Za-z0-9_-]{4,}/g;
75
- var HEADER_LINE = /(authorization|x-api-key)[ \t]*[:=][ \t]*[^\r\n]+/gi;
76
- var JWT = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
77
- var SECRET_FIELDS = [
78
- "access_token",
79
- "refresh_token",
80
- "code_verifier",
81
- "client_secret",
82
- "id_token",
83
- "token",
84
- "code"
85
- ];
86
- var FORM_FIELD = new RegExp(`\\b(${SECRET_FIELDS.join("|")})=[^&\\s"']+`, "gi");
87
- var JSON_FIELD = new RegExp(`("(?:${SECRET_FIELDS.join("|")})"\\s*:\\s*)"[^"]*"`, "gi");
88
- function scrubCredentials(s) {
89
- return s.replace(HEYGEN_KEY, "$1_<redacted>").replace(HEADER_LINE, "$1: <redacted>").replace(JWT, "<jwt-redacted>").replace(FORM_FIELD, "$1=<redacted>").replace(JSON_FIELD, '$1"<redacted>"');
90
- }
91
-
92
- // src/auth/client.ts
93
- var DEFAULT_BASE_URL = "https://api.heygen.com";
94
- var HEYGEN_CLI_SOURCE_HEADER = "X-HeyGen-Source";
95
- var HEYGEN_CLI_SOURCE = "cli";
96
- var HEYGEN_CLIENT_SOURCE_HEADER = "X-HeyGen-Client-Source";
97
- var HEYGEN_CLIENT_SOURCE = "hyperframes";
98
- function apiBaseUrl() {
99
- const override = process.env["HEYGEN_API_URL"];
100
- return override && override.length > 0 ? override.replace(/\/+$/, "") : DEFAULT_BASE_URL;
101
- }
102
- var AuthClient = class {
103
- base;
104
- fetchImpl;
105
- onRefresh;
106
- constructor(opts = {}) {
107
- this.base = (opts.baseUrl ?? apiBaseUrl()).replace(/\/+$/, "");
108
- this.fetchImpl = opts.fetchImpl ?? fetch;
109
- this.onRefresh = opts.onUnauthenticatedRefresh;
110
- }
111
- /**
112
- * `GET /v3/users/me`. Throws `ErrUnauthenticated` on 401, `ErrApi`
113
- * on any other non-2xx or non-JSON body.
114
- *
115
- * On OAuth 401 with a refresh hook configured, the request is
116
- * retried once after refreshing the access token. The retry's
117
- * outcome is what the caller sees — if the refresh itself fails
118
- * (REFRESH_FAILED) or the retry still 401s, the user lands on a
119
- * "please log in again" path upstream.
120
- */
121
- async getCurrentUser(credential) {
122
- const url = `${this.base}/v3/users/me`;
123
- return await this.fetchUser(url, credential, true);
124
- }
125
- // fallow-ignore-next-line complexity
126
- async fetchUser(url, credential, allowRefresh) {
127
- const headers = buildAuthHeaders(credential);
128
- const res = await this.fetchImpl(url, { method: "GET", headers });
129
- if (res.status === 401) {
130
- if (allowRefresh && credential.type === "oauth" && credential.refresh_token && this.onRefresh) {
131
- const refreshed = await this.tryRefresh(credential.refresh_token);
132
- if (refreshed) {
133
- const next = {
134
- ...credential,
135
- access_token: refreshed.access_token,
136
- ...refreshed.refresh_token ? { refresh_token: refreshed.refresh_token } : {}
137
- };
138
- return await this.fetchUser(url, next, false);
139
- }
140
- }
141
- const detail = await safeText(res);
142
- throw ErrUnauthenticated(detail || `${res.status} ${res.statusText}`);
143
- }
144
- if (!res.ok) {
145
- throw ErrApi(res.status, await safeText(res) || res.statusText);
146
- }
147
- let payload;
148
- try {
149
- payload = await res.json();
150
- } catch (err) {
151
- throw ErrApi(res.status, `non-JSON body: ${err.message}`);
152
- }
153
- return extractUserInfo(payload);
154
- }
155
- async tryRefresh(refresh_token) {
156
- if (!this.onRefresh) return null;
157
- try {
158
- return await this.onRefresh(refresh_token);
159
- } catch (err) {
160
- if (isAuthError(err) && err.code === "REFRESH_FAILED") return null;
161
- throw err;
162
- }
163
- }
164
- };
165
- function buildAuthHeaders(credential) {
166
- if (credential.type === "oauth") {
167
- return {
168
- authorization: `Bearer ${credential.access_token}`,
169
- [HEYGEN_CLI_SOURCE_HEADER]: HEYGEN_CLI_SOURCE,
170
- [HEYGEN_CLIENT_SOURCE_HEADER]: HEYGEN_CLIENT_SOURCE
171
- };
172
- }
173
- return { "x-api-key": credential.key, [HEYGEN_CLIENT_SOURCE_HEADER]: HEYGEN_CLIENT_SOURCE };
174
- }
175
- async function safeText(res) {
176
- try {
177
- const body = (await res.text()).slice(0, 500);
178
- return scrubCredentials(body);
179
- } catch {
180
- return "";
181
- }
182
- }
183
- function extractUserInfo(payload) {
184
- if (!payload || typeof payload !== "object" || Array.isArray(payload)) return {};
185
- const obj = payload;
186
- const wrapped = obj["data"];
187
- const data = wrapped && typeof wrapped === "object" && !Array.isArray(wrapped) ? wrapped : obj;
188
- return {
189
- username: pickString(data, "username"),
190
- email: pickString(data, "email"),
191
- first_name: pickString(data, "first_name"),
192
- last_name: pickString(data, "last_name"),
193
- billing_type: pickString(data, "billing_type"),
194
- wallet: pickObject(data, "wallet"),
195
- subscription: pickObject(data, "subscription"),
196
- usage_based: pickObject(data, "usage_based")
197
- };
198
- }
199
- function pickString(obj, key) {
200
- const v = obj[key];
201
- return typeof v === "string" ? v : void 0;
202
- }
203
- function pickObject(obj, key) {
204
- const v = obj[key];
205
- return v && typeof v === "object" && !Array.isArray(v) ? v : void 0;
206
- }
207
-
208
- // src/auth/paths.ts
209
- import { homedir } from "os";
210
- import { join } from "path";
211
- var CREDENTIAL_FILENAME = "credentials";
212
- function configDir() {
213
- const override = process.env["HEYGEN_CONFIG_DIR"];
214
- if (override && override.length > 0) return override;
215
- return join(homedir(), ".heygen");
216
- }
217
- function credentialPath() {
218
- return join(configDir(), CREDENTIAL_FILENAME);
219
- }
220
-
221
86
  // src/auth/store.ts
222
87
  import { promises as fs } from "fs";
223
88
  import { dirname } from "path";
@@ -451,23 +316,27 @@ function looksLikeApiKey(s) {
451
316
  }
452
317
 
453
318
  // src/auth/resolver.ts
319
+ var ENV_CREDENTIAL_VAR = {
320
+ env: "HEYGEN_API_KEY",
321
+ env_alias: "HYPERFRAMES_API_KEY",
322
+ env_oauth: "HEYGEN_ACCESS_TOKEN"
323
+ };
324
+ var envCredentialVar = (source) => source in ENV_CREDENTIAL_VAR ? ENV_CREDENTIAL_VAR[source] : void 0;
454
325
  var EXPIRY_SKEW_MS = 60 * 1e3;
455
326
  async function resolveCredential(opts = {}) {
456
327
  const now = (opts.now ?? (() => /* @__PURE__ */ new Date()))();
457
- const heygenEnv = process.env["HEYGEN_API_KEY"];
458
- if (heygenEnv && heygenEnv.length > 0) {
459
- if (!isHeaderSafe(heygenEnv)) {
460
- throw ErrInvalidStore("HEYGEN_API_KEY contains control characters");
461
- }
328
+ const heygenEnv = headerSafeEnv(ENV_CREDENTIAL_VAR.env);
329
+ if (heygenEnv) {
462
330
  return { type: "api_key", key: heygenEnv, source: "env" };
463
331
  }
464
- const hfEnv = process.env["HYPERFRAMES_API_KEY"];
465
- if (hfEnv && hfEnv.length > 0) {
466
- if (!isHeaderSafe(hfEnv)) {
467
- throw ErrInvalidStore("HYPERFRAMES_API_KEY contains control characters");
468
- }
332
+ const hfEnv = headerSafeEnv(ENV_CREDENTIAL_VAR.env_alias);
333
+ if (hfEnv) {
469
334
  return { type: "api_key", key: hfEnv, source: "env_alias" };
470
335
  }
336
+ const accessToken = headerSafeEnv(ENV_CREDENTIAL_VAR.env_oauth);
337
+ if (accessToken) {
338
+ return { type: "oauth", access_token: accessToken, source: "env_oauth", refreshable: false };
339
+ }
471
340
  const { credentials, source } = await readStore();
472
341
  if (source === "absent") throw ErrNotConfigured();
473
342
  const fileSource = source === "file_legacy" ? "file_legacy" : "file_json";
@@ -478,6 +347,13 @@ async function resolveCredential(opts = {}) {
478
347
  }
479
348
  throw credentials.oauth ? ErrLoginExpired() : ErrNotConfigured();
480
349
  }
350
+ function headerSafeEnv(name) {
351
+ const value = process.env[name];
352
+ if (value && !isHeaderSafe(value)) {
353
+ throw ErrInvalidStore(`${name} contains control characters`);
354
+ }
355
+ return value;
356
+ }
481
357
  async function tryResolveCredential(opts = {}) {
482
358
  try {
483
359
  return await resolveCredential(opts);
@@ -512,6 +388,141 @@ function parseDate(s) {
512
388
  return Number.isNaN(d.getTime()) ? void 0 : d;
513
389
  }
514
390
 
391
+ // src/auth/scrub.ts
392
+ var HEYGEN_KEY = /\b(hg|sk)_[A-Za-z0-9_-]{4,}/g;
393
+ var HEADER_LINE = /(authorization|x-api-key)[ \t]*[:=][ \t]*[^\r\n]+/gi;
394
+ var JWT = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
395
+ var SECRET_FIELDS = [
396
+ "access_token",
397
+ "refresh_token",
398
+ "code_verifier",
399
+ "client_secret",
400
+ "id_token",
401
+ "token",
402
+ "code"
403
+ ];
404
+ var FORM_FIELD = new RegExp(`\\b(${SECRET_FIELDS.join("|")})=[^&\\s"']+`, "gi");
405
+ var JSON_FIELD = new RegExp(`("(?:${SECRET_FIELDS.join("|")})"\\s*:\\s*)"[^"]*"`, "gi");
406
+ function scrubCredentials(s) {
407
+ return s.replace(HEYGEN_KEY, "$1_<redacted>").replace(HEADER_LINE, "$1: <redacted>").replace(JWT, "<jwt-redacted>").replace(FORM_FIELD, "$1=<redacted>").replace(JSON_FIELD, '$1"<redacted>"');
408
+ }
409
+
410
+ // src/auth/client.ts
411
+ var DEFAULT_BASE_URL = "https://api.heygen.com";
412
+ var HEYGEN_CLI_SOURCE_HEADER = "X-HeyGen-Source";
413
+ var HEYGEN_CLI_SOURCE = "cli";
414
+ var HEYGEN_CLIENT_SOURCE_HEADER = "X-HeyGen-Client-Source";
415
+ var HEYGEN_CLIENT_SOURCE = "hyperframes";
416
+ function apiBaseUrl() {
417
+ const override = process.env["HEYGEN_API_URL"];
418
+ return override && override.length > 0 ? override.replace(/\/+$/, "") : DEFAULT_BASE_URL;
419
+ }
420
+ var AuthClient = class {
421
+ base;
422
+ fetchImpl;
423
+ onRefresh;
424
+ constructor(opts = {}) {
425
+ this.base = (opts.baseUrl ?? apiBaseUrl()).replace(/\/+$/, "");
426
+ this.fetchImpl = opts.fetchImpl ?? fetch;
427
+ this.onRefresh = opts.onUnauthenticatedRefresh;
428
+ }
429
+ /**
430
+ * `GET /v3/users/me`. Throws `ErrUnauthenticated` on 401, `ErrApi`
431
+ * on any other non-2xx or non-JSON body.
432
+ *
433
+ * On OAuth 401 with a refresh hook configured, the request is
434
+ * retried once after refreshing the access token. The retry's
435
+ * outcome is what the caller sees — if the refresh itself fails
436
+ * (REFRESH_FAILED) or the retry still 401s, the user lands on a
437
+ * "please log in again" path upstream.
438
+ */
439
+ async getCurrentUser(credential) {
440
+ const url = `${this.base}/v3/users/me`;
441
+ return await this.fetchUser(url, credential, true);
442
+ }
443
+ // fallow-ignore-next-line complexity
444
+ async fetchUser(url, credential, allowRefresh) {
445
+ const headers = buildAuthHeaders(credential);
446
+ const res = await this.fetchImpl(url, { method: "GET", headers });
447
+ if (res.status === 401) {
448
+ if (allowRefresh && credential.type === "oauth" && credential.refresh_token && this.onRefresh) {
449
+ const refreshed = await this.tryRefresh(credential.refresh_token);
450
+ if (refreshed) {
451
+ const next = {
452
+ ...credential,
453
+ access_token: refreshed.access_token,
454
+ ...refreshed.refresh_token ? { refresh_token: refreshed.refresh_token } : {}
455
+ };
456
+ return await this.fetchUser(url, next, false);
457
+ }
458
+ }
459
+ const detail = await safeText(res);
460
+ throw ErrUnauthenticated(detail || `${res.status} ${res.statusText}`);
461
+ }
462
+ if (!res.ok) {
463
+ throw ErrApi(res.status, await safeText(res) || res.statusText);
464
+ }
465
+ let payload;
466
+ try {
467
+ payload = await res.json();
468
+ } catch (err) {
469
+ throw ErrApi(res.status, `non-JSON body: ${err.message}`);
470
+ }
471
+ return extractUserInfo(payload);
472
+ }
473
+ async tryRefresh(refresh_token) {
474
+ if (!this.onRefresh) return null;
475
+ try {
476
+ return await this.onRefresh(refresh_token);
477
+ } catch (err) {
478
+ if (isAuthError(err) && err.code === "REFRESH_FAILED") return null;
479
+ throw err;
480
+ }
481
+ }
482
+ };
483
+ function buildAuthHeaders(credential) {
484
+ if (credential.type === "oauth") {
485
+ return {
486
+ authorization: `Bearer ${credential.access_token}`,
487
+ [HEYGEN_CLI_SOURCE_HEADER]: HEYGEN_CLI_SOURCE,
488
+ [HEYGEN_CLIENT_SOURCE_HEADER]: HEYGEN_CLIENT_SOURCE
489
+ };
490
+ }
491
+ return { "x-api-key": credential.key, [HEYGEN_CLIENT_SOURCE_HEADER]: HEYGEN_CLIENT_SOURCE };
492
+ }
493
+ async function safeText(res) {
494
+ try {
495
+ const body = (await res.text()).slice(0, 500);
496
+ return scrubCredentials(body);
497
+ } catch {
498
+ return "";
499
+ }
500
+ }
501
+ function extractUserInfo(payload) {
502
+ if (!payload || typeof payload !== "object" || Array.isArray(payload)) return {};
503
+ const obj = payload;
504
+ const wrapped = obj["data"];
505
+ const data = wrapped && typeof wrapped === "object" && !Array.isArray(wrapped) ? wrapped : obj;
506
+ return {
507
+ username: pickString(data, "username"),
508
+ email: pickString(data, "email"),
509
+ first_name: pickString(data, "first_name"),
510
+ last_name: pickString(data, "last_name"),
511
+ billing_type: pickString(data, "billing_type"),
512
+ wallet: pickObject(data, "wallet"),
513
+ subscription: pickObject(data, "subscription"),
514
+ usage_based: pickObject(data, "usage_based")
515
+ };
516
+ }
517
+ function pickString(obj, key) {
518
+ const v = obj[key];
519
+ return typeof v === "string" ? v : void 0;
520
+ }
521
+ function pickObject(obj, key) {
522
+ const v = obj[key];
523
+ return v && typeof v === "object" && !Array.isArray(v) ? v : void 0;
524
+ }
525
+
515
526
  // src/auth/pkce.ts
516
527
  import { createHash, randomBytes } from "crypto";
517
528
  var VERIFIER_BYTES = 64;
@@ -1190,21 +1201,23 @@ async function safeText2(res) {
1190
1201
  }
1191
1202
 
1192
1203
  export {
1193
- isAuthError,
1194
- apiBaseUrl,
1195
- AuthClient,
1196
- buildAuthHeaders,
1197
1204
  configDir,
1198
1205
  credentialPath,
1206
+ isAuthError,
1199
1207
  readStore,
1200
1208
  writeStore,
1201
1209
  deleteStore,
1202
1210
  hasPreservedUnknownData,
1203
1211
  clearOAuth,
1204
1212
  isHeaderSafe,
1213
+ ENV_CREDENTIAL_VAR,
1214
+ envCredentialVar,
1205
1215
  resolveCredential,
1206
1216
  tryResolveCredential,
1207
1217
  isTokenExpired,
1218
+ apiBaseUrl,
1219
+ AuthClient,
1220
+ buildAuthHeaders,
1208
1221
  assertOAuthConfiguredOrExit,
1209
1222
  startAuthorizationCodeFlow,
1210
1223
  startDeviceAuthorizationFlow,
@@ -35,7 +35,7 @@ import {
35
35
  stripEmbeddedRuntimeScripts,
36
36
  styleElementsFor,
37
37
  warnUnknownEnumValues
38
- } from "./chunk-SYKKFAUW.js";
38
+ } from "./chunk-J4UX3RS3.js";
39
39
  import {
40
40
  cssVariableName
41
41
  } from "./chunk-VC76R6W2.js";
@@ -45,7 +45,7 @@ import {
45
45
  } from "./chunk-OFQWTKPW.js";
46
46
  import {
47
47
  lintHyperframeHtml
48
- } from "./chunk-WY5OODN5.js";
48
+ } from "./chunk-IW2CKH6A.js";
49
49
  import {
50
50
  CSS_URL_RE,
51
51
  checkSubCompositionUsability,