conformtools 0.6.5 → 0.6.7

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 (149) hide show
  1. package/README.md +18 -13
  2. package/dist/account-DJTD3KYK.js +3 -0
  3. package/dist/arriraw-YIJ3BYNN.js +525 -0
  4. package/dist/avid-panel/MANIFEST.json +11 -0
  5. package/dist/avid-panel/avid-manifest.json +46 -0
  6. package/dist/avid-panel/icon.svg +4 -0
  7. package/dist/avid-panel/icons/conformtools.svg +4 -0
  8. package/dist/avid-panel/index.html +26 -0
  9. package/dist/avid-panel/panel.css +12 -0
  10. package/dist/avid-panel/panel.js +7 -0
  11. package/dist/bridge-JQF4V3V2.js +3 -0
  12. package/dist/browser/timeline_core_bg.wasm +0 -0
  13. package/dist/chunk-2BPR6LK6.js +3 -0
  14. package/dist/chunk-3D3Z4TBR.js +3 -0
  15. package/dist/chunk-55BKURYP.js +378 -0
  16. package/dist/chunk-5WEZRGXG.js +39 -0
  17. package/dist/chunk-6V4OEOOX.js +3 -0
  18. package/dist/chunk-7D7H6VFW.js +3 -0
  19. package/dist/chunk-A7FNR3T5.js +3 -0
  20. package/dist/chunk-AACY2V3L.js +3 -0
  21. package/dist/chunk-AMRJXYL4.js +3 -0
  22. package/dist/chunk-C2ESM27Z.js +3 -0
  23. package/dist/chunk-D4WPRRBT.js +3 -0
  24. package/dist/chunk-D6YDLKSA.js +3 -0
  25. package/dist/chunk-DKGGJM6Z.js +3 -0
  26. package/dist/chunk-EUBXH67N.js +7 -0
  27. package/dist/chunk-GK4YYKJ6.js +19 -0
  28. package/dist/chunk-GM6QKY7W.js +3 -0
  29. package/dist/chunk-J2JXLEAI.js +3 -0
  30. package/dist/chunk-JV7TZDKJ.js +3 -0
  31. package/dist/chunk-NAFLOZER.js +9 -0
  32. package/dist/chunk-NFJHWZJX.js +3 -0
  33. package/dist/chunk-NU3X7P4N.js +3 -0
  34. package/dist/chunk-P2LL3JMC.js +20 -0
  35. package/dist/chunk-PFISREY4.js +3 -0
  36. package/dist/chunk-PFZVET7S.js +3 -0
  37. package/dist/chunk-PHAMF4JF.js +4 -0
  38. package/dist/chunk-PLRB2YXJ.js +3 -0
  39. package/dist/chunk-PSANHDZM.js +3 -0
  40. package/dist/chunk-RGMTLNMF.js +3 -0
  41. package/dist/chunk-RJ6JA2LZ.js +3 -0
  42. package/dist/chunk-S5JDS5PQ.js +5 -0
  43. package/dist/chunk-SGLQY53R.js +3 -0
  44. package/dist/chunk-SKFMOLUO.js +8 -0
  45. package/dist/chunk-SNTAZJ5A.js +6 -0
  46. package/dist/chunk-TK55FA56.js +3 -0
  47. package/dist/chunk-TXQR2HI2.js +4 -0
  48. package/dist/chunk-VIBEEWPC.js +10 -0
  49. package/dist/chunk-WN53ARHJ.js +3 -0
  50. package/dist/chunk-XLEINKFL.js +5 -0
  51. package/dist/claude-setup-IIWUB4CE.js +5 -0
  52. package/dist/cli.js +17 -0
  53. package/dist/clip-state-B6JOX3JE.js +3 -0
  54. package/dist/conformtools-analyze +0 -0
  55. package/dist/conformtools-decode +0 -0
  56. package/dist/cr3-wasm-HLJWEV2S.js +3 -0
  57. package/dist/dng-wasm-CQDLPM5V.js +3 -0
  58. package/dist/dpx-wasm-TLGMM7BO.js +3 -0
  59. package/dist/engine-P6H5P6HP.js +5 -0
  60. package/dist/esm-SFFBP7PS.js +3 -0
  61. package/dist/exr-wasm-2NPKPTVB.js +3 -0
  62. package/dist/flame/hook/conformtools_flame/__init__.py +10 -0
  63. package/dist/flame/hook/conformtools_flame/building.py +191 -0
  64. package/dist/flame/hook/conformtools_flame/hook.py +177 -0
  65. package/dist/flame/hook/conformtools_flame/render.py +622 -0
  66. package/dist/flame/hook/conformtools_flame/util.py +33 -0
  67. package/dist/flame/hook/conformtools_flame/verbs.py +1037 -0
  68. package/dist/flame/hook/conformtools_flame_hook.py +42 -0
  69. package/dist/fonts/gfx/BarlowCondensed-Bold.ttf +0 -0
  70. package/dist/fonts/gfx/BarlowCondensed-Regular.ttf +0 -0
  71. package/dist/fonts/gfx/InstrumentSerif-Regular.ttf +0 -0
  72. package/dist/fonts/gfx/Inter-Bold.ttf +0 -0
  73. package/dist/fonts/gfx/Inter-Regular.ttf +0 -0
  74. package/dist/fonts/gfx/JetBrainsMono-Bold.ttf +0 -0
  75. package/dist/fonts/gfx/JetBrainsMono-Regular.ttf +0 -0
  76. package/dist/fonts/gfx/OFL.txt +100 -0
  77. package/dist/framing-SWOD4CWB.js +3 -0
  78. package/dist/gfx-worker.js +3 -0
  79. package/dist/h264-JJMZSUWW.js +3 -0
  80. package/dist/h264-mxf-DCUOGLDU.js +3 -0
  81. package/dist/host-relink-TWAF6WIG.js +10 -0
  82. package/dist/hosts-Z666EF7V.js +3 -0
  83. package/dist/http.js +5 -0
  84. package/dist/i2o-transfer +0 -0
  85. package/dist/inspect-FJKYPEXL.js +68 -0
  86. package/dist/isobmff-VJOWP4MH.js +3 -0
  87. package/dist/mc-video-5MGGOQN4.js +3 -0
  88. package/dist/mcp.js +13 -0
  89. package/dist/media-NZYVREUF.js +3 -0
  90. package/dist/media_core-YZ3PABEG.js +9 -0
  91. package/dist/media_core_bg-FDL7GJZP.js +3 -0
  92. package/dist/media_core_bg-XRBVKQZH.js +3 -0
  93. package/dist/mxf-FJSRFLJC.js +3 -0
  94. package/dist/nuke/panel/python/Startup/conformtools_nuke_startup.py +44 -0
  95. package/dist/nuke/panel/python/conformtools_nuke/__init__.py +10 -0
  96. package/dist/nuke/panel/python/conformtools_nuke/panel.py +217 -0
  97. package/dist/nuke/panel/python/conformtools_nuke/verbs.py +837 -0
  98. package/dist/ops-X7NAREC4.js +3 -0
  99. package/dist/peer-kit/ctpeer/__init__.py +21 -0
  100. package/dist/peer-kit/ctpeer/client.py +247 -0
  101. package/dist/peer-kit/ctpeer/neutral.py +178 -0
  102. package/dist/peer-kit/ctpeer/pairing.py +139 -0
  103. package/dist/peer-kit/ctpeer/protocol.py +209 -0
  104. package/dist/peer-kit/ctpeer/websocket.py +289 -0
  105. package/dist/premiere-uxp/icons/panel.png +0 -0
  106. package/dist/premiere-uxp/icons/panel@2x.png +0 -0
  107. package/dist/premiere-uxp/icons/plugin.png +0 -0
  108. package/dist/premiere-uxp/icons/plugin@2x.png +0 -0
  109. package/dist/premiere-uxp/index.html +38 -0
  110. package/dist/premiere-uxp/index.js +93 -0
  111. package/dist/premiere-uxp/lib/clipmeta.js +170 -0
  112. package/dist/premiere-uxp/lib/ctx.js +68 -0
  113. package/dist/premiere-uxp/lib/edit.js +516 -0
  114. package/dist/premiere-uxp/lib/handles.js +57 -0
  115. package/dist/premiere-uxp/lib/markers.js +198 -0
  116. package/dist/premiere-uxp/lib/pairing.js +67 -0
  117. package/dist/premiere-uxp/lib/premiere.js +91 -0
  118. package/dist/premiere-uxp/lib/probe.js +452 -0
  119. package/dist/premiere-uxp/lib/protocol.js +165 -0
  120. package/dist/premiere-uxp/lib/render.js +45 -0
  121. package/dist/premiere-uxp/lib/session.js +85 -0
  122. package/dist/premiere-uxp/lib/sizing.js +325 -0
  123. package/dist/premiere-uxp/lib/time.js +88 -0
  124. package/dist/premiere-uxp/lib/timeline.js +336 -0
  125. package/dist/premiere-uxp/lib/verbs.js +21 -0
  126. package/dist/premiere-uxp/lib/write.js +97 -0
  127. package/dist/premiere-uxp/manifest.json +102 -0
  128. package/dist/probe-F7WQHMIA.js +3 -0
  129. package/dist/prores-RIG37OIH.js +526 -0
  130. package/dist/r3d-CXUNG6VS.js +1025 -0
  131. package/dist/r3d-T5O6IIZZ.js +3 -0
  132. package/dist/resolve-bridge.py +2286 -0
  133. package/dist/resolve-presets/conform.tools.xml +127 -0
  134. package/dist/source-QGWWLMME.js +3 -0
  135. package/dist/statusline-GMMCFMOA.js +4 -0
  136. package/dist/statusline.js +3 -0
  137. package/dist/still-P4JJNTEO.js +3 -0
  138. package/dist/still-wasm-DN5LPASS.js +3 -0
  139. package/dist/store-7IOEBOZY.js +3 -0
  140. package/dist/tiff-wasm-BPRDR6EB.js +3 -0
  141. package/dist/timeline-DQG6TVPF.js +3 -0
  142. package/dist/timeline_core-IOENXK4Z.js +3 -0
  143. package/dist/timeline_core_bg-JW42YM3G.js +3 -0
  144. package/dist/udf_bg-B37GKRIH.js +3 -0
  145. package/dist/wasm/media_core_bg.wasm +0 -0
  146. package/dist/wasm/udf_bg.wasm +0 -0
  147. package/dist/wasm-threads/media_core_bg.wasm +0 -0
  148. package/dist/wav-64SC6P7U.js +3 -0
  149. package/package.json +6 -4
@@ -0,0 +1,42 @@
1
+ """CONFORM.TOOLS for Autodesk Flame - the Python hook Flame loads.
2
+
3
+ Install this file AND `conformtools_flame.zip` side by side in a Flame Python
4
+ hook folder (`/opt/Autodesk/shared/python/`, the per-user
5
+ `~/flame/python` on Linux or `~/Library/Preferences/Autodesk/flame/python` on
6
+ macOS, or a folder on `DL_PYTHON_HOOK_PATH`). Flame scans `.py` files only,
7
+ so the library inside the zip is never mistaken for a hook.
8
+
9
+ Hooks provided: `get_main_menu_custom_ui_actions` (Flame menu > CONFORM.TOOLS:
10
+ connect / disconnect / status / connect automatically) and `app_initialized`
11
+ (called whenever the project changes).
12
+ """
13
+
14
+ import os
15
+ import sys
16
+
17
+ _HERE = os.path.dirname(os.path.abspath(__file__))
18
+ _ZIP = os.path.join(_HERE, "conformtools_flame.zip")
19
+ for _p in (_ZIP, _HERE):
20
+ if (_p == _HERE or os.path.isfile(_p)) and _p not in sys.path:
21
+ sys.path.insert(0, _p)
22
+
23
+
24
+ def _controller():
25
+ from conformtools_flame.hook import controller
26
+
27
+ return controller()
28
+
29
+
30
+ def get_main_menu_custom_ui_actions():
31
+ try:
32
+ return _controller().menu()
33
+ except Exception as e: # a hook must never take Flame's menu down
34
+ print(f"[CONFORM.TOOLS] menu unavailable: {e}", file=sys.stderr)
35
+ return []
36
+
37
+
38
+ def app_initialized(project_name):
39
+ try:
40
+ _controller().project_changed(project_name)
41
+ except Exception as e:
42
+ print(f"[CONFORM.TOOLS] {e}", file=sys.stderr)
Binary file
Binary file
@@ -0,0 +1,100 @@
1
+ The typefaces in this folder are licensed under the SIL Open Font License, Version 1.1:
2
+
3
+ Inter-Regular.ttf, Inter-Bold.ttf
4
+ Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)
5
+ BarlowCondensed-Regular.ttf, BarlowCondensed-Bold.ttf
6
+ Copyright 2017 The Barlow Project Authors (https://github.com/jpt/barlow)
7
+ JetBrainsMono-Regular.ttf, JetBrainsMono-Bold.ttf
8
+ Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
9
+ InstrumentSerif-Regular.ttf
10
+ Copyright 2022 The Instrument Serif Project Authors (https://github.com/Instrument/instrument-serif)
11
+
12
+ These files are prepared copies (GSUB removed by scripts/prepare-gfx-fonts.py in the conform.tools
13
+ repository) of the upstream releases; the licence below applies to them unchanged.
14
+
15
+ -----------------------------------------------------------
16
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
17
+ -----------------------------------------------------------
18
+
19
+ PREAMBLE
20
+ The goals of the Open Font License (OFL) are to stimulate worldwide
21
+ development of collaborative font projects, to support the font creation
22
+ efforts of academic and linguistic communities, and to provide a free and
23
+ open framework in which fonts may be shared and improved in partnership
24
+ with others.
25
+
26
+ The OFL allows the licensed fonts to be used, studied, modified and
27
+ redistributed freely as long as they are not sold by themselves. The
28
+ fonts, including any derivative works, can be bundled, embedded,
29
+ redistributed and/or sold with any software provided that any reserved
30
+ names are not used by derivative works. The fonts and derivatives,
31
+ however, cannot be released under any other type of license. The
32
+ requirement for fonts to remain under this license does not apply
33
+ to any document created using the fonts or their derivatives.
34
+
35
+ DEFINITIONS
36
+ "Font Software" refers to the set of files released by the Copyright
37
+ Holder(s) under this license and clearly marked as such. This may
38
+ include source files, build scripts and documentation.
39
+
40
+ "Reserved Font Name" refers to any names specified as such after the
41
+ copyright statement(s).
42
+
43
+ "Original Version" refers to the collection of Font Software components as
44
+ distributed by the Copyright Holder(s).
45
+
46
+ "Modified Version" refers to any derivative made by adding to, deleting,
47
+ or substituting -- in part or in whole -- any of the components of the
48
+ Original Version, by changing formats or by porting the Font Software to a
49
+ new environment.
50
+
51
+ "Author" refers to any designer, engineer, programmer, technical
52
+ writer or other person who contributed to the Font Software.
53
+
54
+ PERMISSION AND CONDITIONS
55
+ Permission is hereby granted, free of charge, to any person obtaining
56
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
57
+ redistribute, and sell modified and unmodified copies of the Font
58
+ Software, subject to the following conditions:
59
+
60
+ 1) Neither the Font Software nor any of its individual components,
61
+ in Original or Modified Versions, may be sold by itself.
62
+
63
+ 2) Original or Modified Versions of the Font Software may be bundled,
64
+ redistributed and/or sold with any software, provided that each copy
65
+ contains the above copyright notice and this license. These can be
66
+ included either as stand-alone text files, human-readable headers or
67
+ in the appropriate machine-readable metadata fields within text or
68
+ binary files as long as those fields can be easily viewed by the user.
69
+
70
+ 3) No Modified Version of the Font Software may use the Reserved Font
71
+ Name(s) unless explicit written permission is granted by the corresponding
72
+ Copyright Holder. This restriction only applies to the primary font name as
73
+ presented to the users.
74
+
75
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
76
+ Software shall not be used to promote, endorse or advertise any
77
+ Modified Version, except to acknowledge the contribution(s) of the
78
+ Copyright Holder(s) and the Author(s) or with their explicit written
79
+ permission.
80
+
81
+ 5) The Font Software, modified or unmodified, in part or in whole,
82
+ must be distributed entirely under this license, and must not be
83
+ distributed under any other license. The requirement for fonts to
84
+ remain under this license does not apply to any document created
85
+ using the Font Software.
86
+
87
+ TERMINATION
88
+ This license becomes null and void if any of the above conditions are
89
+ not met.
90
+
91
+ DISCLAIMER
92
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
93
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
94
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
95
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
96
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
97
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
98
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
99
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
100
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i,o as j,p as k,q as l}from"./chunk-XLEINKFL.js";import"./chunk-5WEZRGXG.js";import"./chunk-PFISREY4.js";import"./chunk-JV7TZDKJ.js";import"./chunk-VIBEEWPC.js";import"./chunk-PFZVET7S.js";import"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-D4WPRRBT.js";import"./chunk-WN53ARHJ.js";import"./chunk-A7FNR3T5.js";import"./chunk-J2JXLEAI.js";import"./chunk-SGLQY53R.js";import"./chunk-DKGGJM6Z.js";import"./chunk-AMRJXYL4.js";import"./chunk-3D3Z4TBR.js";import"./chunk-2BPR6LK6.js";import"./chunk-NU3X7P4N.js";import"./chunk-RJ6JA2LZ.js";import"./chunk-NAFLOZER.js";import"./chunk-PHAMF4JF.js";import"./chunk-PLRB2YXJ.js";import"./chunk-C2ESM27Z.js";import"./chunk-PSANHDZM.js";export{i as ASPECTS,a as INPUT_SCALING,e as SIZING_TARGETS,h as alignText,g as alignTimeline,j as aspectOf,k as blankingQc,l as blankingText,c as inputFitRatio,f as offlineLane,d as resolveProps,b as scalingOf};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ import{e as h,f as d,n as w,p as _}from"./chunk-GK4YYKJ6.js";import"./chunk-NU3X7P4N.js";import{Ha as u,T as l,V as g}from"./chunk-RJ6JA2LZ.js";import"./chunk-PHAMF4JF.js";import{u as y}from"./chunk-PLRB2YXJ.js";import"./chunk-PSANHDZM.js";import{parentPort as p,workerData as C}from"node:worker_threads";import{createCanvas as M,loadImage as A}from"@napi-rs/canvas";var S=(async()=>{await w(C),await u()})(),o=new Map,c=new Map;p.on("message",async t=>{try{await S;let s={};for(let[e,a]of Object.entries(t.images))c.has(a)||c.set(a,await A(await y(a))),s[e]=c.get(a);let m=`${t.fmt.w}x${t.fmt.h}`;o.has(m)||o.set(m,M(t.fmt.w,t.fmt.h));let i=o.get(m).getContext("2d"),v=h(i),r=[],f=null;for(let e=t.from;e<t.to;e++){d(i,t.scene,e/t.fps,t.fmt,v,s);let a=i.getImageData(0,0,t.fmt.w,t.fmt.h).data,n=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);if(f&&_(f,n)){r.push(null);continue}r.push(t.alpha?l(n,t.fmt.w,t.fmt.h,4):g(n,t.fmt.w,t.fmt.h,4)),f=n.slice()}p.postMessage({id:t.id,samples:r},r.filter(e=>!!e).map(e=>e.buffer))}catch(s){p.postMessage({id:t.id,error:s.message??String(s)})}});
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ import{a as O}from"./chunk-TK55FA56.js";import"./chunk-PSANHDZM.js";function v(e,n,t,f){let s=new DataView(e.buffer,e.byteOffset,e.byteLength),r=n;for(;r+8<=t;){let o=s.getUint32(r),a=String.fromCharCode(e[r+4],e[r+5],e[r+6],e[r+7]),c=8;if(o===1){let l=s.getUint32(r+8),g=s.getUint32(r+12);o=l*2**32+g,c=16}else o===0&&(o=t-r);if(o<c||r+o>t)break;f(a,r+c,r+o),r+=o}}var E=new Set(["moov","trak","mdia","minf","stbl"]);function D(e){let n=new DataView(e.buffer,e.byteOffset,e.byteLength),t=null,f=(r,o)=>{let a={},c=!1,l=(g,y)=>{v(e,g,y,(w,i,p)=>{if(E.has(w)){l(i,p);return}if(!(!c&&w!=="hdlr"&&w!=="stsd"))switch(w){case"hdlr":{String.fromCharCode(e[i+8],e[i+9],e[i+10],e[i+11])==="vide"&&(c=!0);break}case"stsd":{let u=i+8;a.codec=String.fromCharCode(e[u+4],e[u+5],e[u+6],e[u+7]),a.width=n.getUint16(u+32),a.height=n.getUint16(u+34);break}case"stsz":{let u=n.getUint32(i+4),d=n.getUint32(i+8),m=[];if(u===0)for(let h=0;h<d;h++)m.push(n.getUint32(i+12+h*4));else for(let h=0;h<d;h++)m.push(u);a.sampleSizes=m;break}case"stco":{let u=n.getUint32(i+4),d=[];for(let m=0;m<u;m++)d.push(n.getUint32(i+8+m*4));a.chunkOffsets=d;break}case"co64":{let u=n.getUint32(i+4),d=[];for(let m=0;m<u;m++){let h=n.getUint32(i+8+m*8),k=n.getUint32(i+12+m*8);d.push(h*2**32+k)}a.chunkOffsets=d;break}case"stsc":{let u=n.getUint32(i+4),d=[];for(let m=0;m<u;m++)d.push({firstChunk:n.getUint32(i+8+m*12),samplesPerChunk:n.getUint32(i+8+m*12+4),descIdx:n.getUint32(i+8+m*12+8)});a.sampleToChunk=d;break}}})};l(r,o),c&&a.chunkOffsets&&a.sampleSizes&&a.sampleToChunk&&(t=a)};if(((r,o)=>{v(e,r,o,(a,c,l)=>{a==="moov"&&v(e,c,l,(g,y,w)=>{g==="trak"&&f(y,w)})})})(0,e.length),!t)throw new Error("could not find a video sample table");return t}function V(e){let n=[],t=0;for(let f=0;f<e.chunkOffsets.length;f++){let s=1;for(let o=0;o<e.sampleToChunk.length;o++)f+1>=e.sampleToChunk[o].firstChunk&&(s=e.sampleToChunk[o].samplesPerChunk);let r=e.chunkOffsets[f];for(let o=0;o<s&&t<e.sampleSizes.length;o++){let a=e.sampleSizes[t];n.push({offset:r,size:a}),r+=a,t++}}return n}var P=(e,n)=>String.fromCharCode(e[n],e[n+1],e[n+2],e[n+3]),z=e=>e.toString(16).padStart(2,"0");function S(e,n,t,f){let s=new DataView(e.buffer,e.byteOffset,e.byteLength),r=n;for(;r+8<=t;){let o=s.getUint32(r),a=8;if(o===1?(o=Number(s.getBigUint64(r+8)),a=16):o===0&&(o=t-r),P(e,r+4)===f)return[r+a,r+o];if(o<a)break;r+=o}return null}function H(e,n,t,f){let s=[n,t];for(let r of f){if(!s)return null;s=S(e,s[0],s[1],r)}return s}function M(e,n,t){let f=S(e,n[0],n[1],"stts");if(!f)return new Int32Array(0);let s=t.getUint32(f[0]+4),r=[],o=0,a=f[0]+8;for(let i=0;i<s;i++){let p=t.getUint32(a),u=t.getInt32(a+4);for(let d=0;d<p;d++)r.push(o),o+=u;a+=8}let c=r.length,l=S(e,n[0],n[1],"ctts"),g=new Float64Array(c);for(let i=0;i<c;i++)g[i]=r[i];if(l){let i=t.getUint32(l[0]+4),p=l[0]+8,u=0;for(let d=0;d<i&&u<c;d++){let m=t.getUint32(p),h=t.getInt32(p+4);for(let k=0;k<m&&u<c;k++)g[u++]+=h;p+=8}}let y=Array.from({length:c},(i,p)=>p).sort((i,p)=>g[i]-g[p]||i-p),w=new Int32Array(c);for(let i=0;i<c;i++)w[y[i]]=i;return w}function F(e){let n=new DataView(e.buffer,e.byteOffset,e.byteLength),t=S(e,0,e.length,"moov"),[f,s]=t??[0,e.length],r=f;for(;r+8<=s;){let o=n.getUint32(r),a=8;if(o===1?(o=Number(n.getBigUint64(r+8)),a=16):o===0&&(o=s-r),P(e,r+4)==="trak"){let c=H(e,r+a,r+o,["mdia","minf","stbl"]);if(c){let l=S(e,c[0],c[1],"stsd");if(l){let g=l[0]+8,y=P(e,g+4);if(y==="avc1"||y==="avc3"||y==="hvc1"||y==="hev1"){let w=n.getUint32(g),i=g+8+78,p=y.startsWith("hv")||y.startsWith("he"),u=S(e,i,g+w,p?"hvcC":"avcC");if(!u)return null;let d=e.subarray(u[0],u[1]),m=p?"hvc1.1.6.L93.B0":`avc1.${z(d[1])}${z(d[2])}${z(d[3])}`,h=M(e,c,n),k=h.length,U=S(e,c[0],c[1],"stss"),b=[];if(U){let T=n.getUint32(U[0]+4);for(let C=0;C<T;C++)b.push(n.getUint32(U[0]+8+C*4)-1)}else for(let T=0;T<k;T++)b.push(T);return(b.length===0||b[0]!==0)&&b.unshift(0),b.sort((T,C)=>T-C),{codec:m,description:d,keyframes:b,decodeToPres:h}}}}}if(o<a)break;r+=o}return null}var x=8,R=1500,I=new WeakMap;async function $(e){let n=I.get(e);return n||(n=L(e),I.set(e,n)),n}async function L(e){if(typeof VideoDecoder>"u")throw new Error("h264: WebCodecs (VideoDecoder) not available in this context");let n=e.parts[0],t=await O({fileSize:n.fileSize,read:n.read}),f=V(D(t)),s=F(t);if(!s)throw new Error("h264: no H.264/HEVC config in container");let r=s.decodeToPres.length||f.length,o=new Int32Array(r);for(let l=0;l<s.decodeToPres.length;l++)o[s.decodeToPres[l]]=l;let a=[];for(let l=0;l<s.keyframes.length;l++){let g=s.keyframes[l],y=l+1<s.keyframes.length?s.keyframes[l+1]:f.length;a.push([g,y])}let c={offs:f,cfg:s,gops:a,presToDecode:o,count:r,dec:null,wanted:-1,got:null,gotResolve:null,fedThrough:-1,queue:Promise.resolve()};return c.dec=new VideoDecoder({output:l=>{Number(l.timestamp)===c.wanted&&!c.got?(c.got=l,c.gotResolve?.()):l.close()},error:()=>{c.fedThrough=-1}}),c.dec.configure({codec:s.codec,description:s.description,optimizeForLatency:!0,hardwareAcceleration:"prefer-hardware"}),c}function q(e,n){let t=0,f=e.length-1,s=0;for(;t<=f;){let r=t+f>>1;e[r][0]<=n?(s=r,t=r+1):f=r-1}return s}async function B(e){let n=e.codedWidth,t=e.codedHeight;try{let f=n*t*4,s=new Uint8Array(f);return await e.copyTo(s,{format:"RGBA",colorSpace:"srgb"}),{width:n,height:t,rgba:s}}catch{let s=new OffscreenCanvas(n,t).getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("h264: no 2d context for frame readback");s.drawImage(e,0,0);let r=s.getImageData(0,0,n,t);return{width:n,height:t,rgba:new Uint8Array(r.data.buffer)}}}async function N(e,n){let t=await $(e);if(t.count===0)throw new Error("h264: empty clip");if(n<0||n>=t.count)throw new Error(`COVERAGE_MISS: frame ${n} outside 0..${t.count-1}`);let f,s=new Promise(o=>{f=o}),r=t.queue;t.queue=t.queue.then(()=>s),await r;try{let o=e.parts[0],a=t.presToDecode[n],c=q(t.gops,a),[l,g]=t.gops[c];for(let y=0;y<2;y++){let w=y===0&&t.fedThrough>l&&t.fedThrough<=g&&a>=t.fedThrough,i=w?t.fedThrough:l;if(!w&&t.fedThrough!==-1){try{await t.dec.flush()}catch{}t.fedThrough=-1}let p=Math.min(g,a+1+x);t.wanted=n,t.got=null;let u=new Promise(h=>{t.gotResolve=h});if(p>i){let h=1/0,k=0;for(let b=i;b<p;b++)h=Math.min(h,t.offs[b].offset),k=Math.max(k,t.offs[b].offset+t.offs[b].size);let U=await o.read(h,k-h);for(let b=i;b<p;b++){let T=t.offs[b];t.dec.decode(new EncodedVideoChunk({type:b===l?"key":"delta",timestamp:t.cfg.decodeToPres[b],data:U.subarray(T.offset-h,T.offset-h+T.size)}))}t.fedThrough=p}let d=new Promise(h=>setTimeout(h,R));if(await Promise.race([u,d]),!t.got){try{await t.dec.flush()}catch{}t.fedThrough=-1}let m=t.got;if(t.wanted=-1,t.gotResolve=null,t.got=null,!!m)try{return await B(m)}finally{m.close()}}throw new Error(`h264: frame ${n} did not decode`)}finally{f()}}async function A(){return(await import("./isobmff-VJOWP4MH.js")).isobmffFormat}var J={async inspect(e){return(await A()).inspect(e)},async extract(e){return(await A()).extract(e)},async sparsify(e,n){return(await A()).sparsify(e,n)},async trim(e,n){return(await A()).trim(e,n)},async decode(e,n){return N(e,n)}};export{J as h264Format};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ import{Ha as v,ma as g,oa as b}from"./chunk-RJ6JA2LZ.js";import"./chunk-PSANHDZM.js";var G=8,P=1500,M=new WeakMap,S=o=>(t,e)=>o.read(t,e);function F(o){let t=new DataView(o.buffer,o.byteOffset,o.byteLength),e=t.getUint32(0,!0),n=[];for(let a=0;a<e;a++)n.push(t.getUint32(4+a*4,!0));let i=[],r=4+e*4;for(let a of n)i.push(o.subarray(r,r+a)),r+=a;return i}function V(o){for(let t=0;t+5<o.length;t++){let e=o[t]===0&&o[t+1]===0&&o[t+2]===0&&o[t+3]===1,n=o[t]===0&&o[t+1]===0&&o[t+2]===1;if(e||n){let i=t+(e?4:3);if((o[i]&31)===7){let r=a=>a.toString(16).padStart(2,"0");return`avc1.${r(o[i+1])}${r(o[i+2])}${r(o[i+3])}`}t=i-1}}return"avc1.640028"}async function A(o){if(typeof VideoDecoder>"u")throw new Error("h264-mxf: WebCodecs (VideoDecoder) not available in this context");await v();let t=o.parts[0],e=S(t),n=JSON.parse(await b(e,t.fileSize));if(!n.raps.length)throw new Error("h264-mxf: no random-access points in MXF index");let i=V(F(await g(e,t.fileSize,0,0))[0]),r={map:n,codec:i,dec:null,wanted:-1,emitted:0,got:null,gotResolve:null,fedGop:-1,fedThrough:-1,queue:Promise.resolve()};return r.dec=new VideoDecoder({output:a=>{r.emitted++===r.wanted&&!r.got?(r.got=a,r.gotResolve?.()):a.close()},error:()=>{r.fedGop=-1,r.fedThrough=-1}}),r.dec.configure({codec:i,codedWidth:n.coded_width||1920,codedHeight:n.coded_height||1088,optimizeForLatency:!0}),r}async function E(o){let t=M.get(o);return t||(t=A(o),M.set(o,t)),t}function D(o,t){let e=o.raps,n=0,i=e.length-1,r=0;for(;n<=i;){let a=n+i>>1;e[a]<=t?(r=a,n=a+1):i=a-1}return{start:e[r],end:r+1<e.length?e[r+1]:o.total_frames}}async function R(o){let t=o.visibleRect,e=t?t.width:o.codedWidth,n=t?t.height:o.codedHeight;try{let i=new Uint8Array(e*n*4);return await o.copyTo(i,{format:"RGBA",colorSpace:"srgb",rect:t??void 0}),{width:e,height:n,rgba:i}}catch{let r=new OffscreenCanvas(e,n).getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("h264-mxf: no 2d context for frame readback");r.drawImage(o,t?t.x:0,t?t.y:0,e,n,0,0,e,n);let a=r.getImageData(0,0,e,n);return{width:e,height:n,rgba:new Uint8Array(a.data.buffer)}}}async function U(o,t){let e=await E(o);if(e.map.total_frames===0)throw new Error("h264-mxf: empty clip");if(t<0||t>=e.map.total_frames)throw new Error(`COVERAGE_MISS: frame ${t} outside 0..${e.map.total_frames-1}`);let n,i=new Promise(a=>{n=a}),r=e.queue;e.queue=e.queue.then(()=>i),await r;try{let a=o.parts[0],w=S(a),{start:c,end:_}=D(e.map,t);for(let u=0;u<2;u++){let f=u===0&&e.fedGop===c&&e.fedThrough>c&&t>=e.fedThrough;if(!f&&e.fedGop!==-1){try{await e.dec.flush()}catch{}e.fedGop=-1,e.fedThrough=-1}let l=f?e.fedThrough:c,h=Math.min(_,t+1+G);f||(e.emitted=0),e.wanted=t-c,e.got=null;let T=new Promise(s=>{e.gotResolve=s});if(h>l){let s=F(await g(w,a.fileSize,l,h-1));for(let d=0;d<s.length;d++){let y=l+d;e.dec.decode(new EncodedVideoChunk({type:y===c?"key":"delta",timestamp:y*1e3,data:s[d]}))}e.fedGop=c,e.fedThrough=h}let x=new Promise(s=>setTimeout(s,P));if(await Promise.race([T,x]),!e.got){try{await e.dec.flush()}catch{}e.fedGop=-1,e.fedThrough=-1}let p=e.got;if(e.wanted=-1,e.gotResolve=null,e.got=null,!!p)try{return await R(p)}finally{p.close()}}throw new Error(`h264-mxf: frame ${t} did not decode`)}finally{n()}}async function m(){return(await import("./mxf-FJSRFLJC.js")).mxfFormat}var O={async inspect(o){return(await m()).inspect(o)},async extract(o){return(await m()).extract(o)},async sparsify(o,t){return(await m()).sparsify(o,t)},async trim(o,t){return(await m()).trim(o,t)},async decode(o,t){return U(o,t)}};export{O as h264MxfFormat};
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ import{a as C}from"./chunk-S5JDS5PQ.js";import{c as D}from"./chunk-SNTAZJ5A.js";import{L as A,O as P,V as N,Y as q}from"./chunk-5WEZRGXG.js";import"./chunk-P2LL3JMC.js";import"./chunk-PFISREY4.js";import"./chunk-JV7TZDKJ.js";import{k as M}from"./chunk-VIBEEWPC.js";import"./chunk-PFZVET7S.js";import"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-D4WPRRBT.js";import"./chunk-WN53ARHJ.js";import"./chunk-A7FNR3T5.js";import"./chunk-J2JXLEAI.js";import"./chunk-SGLQY53R.js";import"./chunk-DKGGJM6Z.js";import"./chunk-AMRJXYL4.js";import"./chunk-3D3Z4TBR.js";import"./chunk-2BPR6LK6.js";import{b as F}from"./chunk-NU3X7P4N.js";import"./chunk-RJ6JA2LZ.js";import"./chunk-NAFLOZER.js";import"./chunk-PHAMF4JF.js";import{H as x,I as E,V as U,W as R,Y as k,m as O,q as S}from"./chunk-PLRB2YXJ.js";import"./chunk-C2ESM27Z.js";import"./chunk-PSANHDZM.js";var y=s=>{let i=s?.target_url??s?.local_path??"";return i.startsWith("file://")?O(i):i};async function H(s,i){let a=await s.items({timeline:i,kind:"video"}),r=a.items.map(m=>`${m.kind}:${m.track}:${m.start}:${m.end-m.start}`),c=async m=>{let l=await D(m,a.timeline).catch(()=>null);if(!l||!r.every(p=>l.has(p)))return null;let{session:h}=await P(m,"prproj"),u=h.timelines.find(p=>p.name===a.timeline);return u?z(h,u):null};if(a.project_path){let m=await c(a.project_path);if(m)return await T(m),{session:m,from:"the saved project (matches the live sequence)",path:a.project_path};let l=k(R(a.project_path),"Adobe Premiere Pro Auto-Save"),h=U(a.project_path).replace(/\.prproj$/i,""),u=[];try{for await(let p of E(l))p.isFile&&p.name.startsWith(`${h}--`)&&p.name.endsWith(".prproj")&&u.push({path:k(l,p.name),mtime:(await S(k(l,p.name))).mtime?.getTime()??0})}catch{}for(let p of u.sort((g,_)=>_.mtime-g.mtime).slice(0,3)){let g=await c(p.path);if(g&&await T(g),g)return{session:g,from:`Premiere's auto-save of ${new Date(p.mtime).toLocaleTimeString()} (matches the live sequence; the project itself is not saved)`,path:p.path}}}let e=k(await x("conform-ppro-"),"live.otio"),t=await s.export({timeline:i,out_path:e}),{session:n}=await P(t.path,t.format);if(await Z(s,n),await I(n),typeof a.drop_frame=="boolean")for(let m of n.timelines)m.is_drop_frame=a.drop_frame;await T(n);for(let m of n.timelines)for(let l of m.tracks)for(let h of l.items){let u=h;u.scale=null,u.position_x=null,u.position_y=null,u.rotation=null}let o=await s.model(i).then(m=>m.items.filter(l=>Object.keys(l.sizing??{}).length).map(l=>`${l.name??l.file_path.split("/").pop()} (V${l.track} @${l.start-m.start_frame})`)).catch(()=>[]),f=`Premiere's OTIO export carries the cut, not the clips' Motion / Opacity / effects / retimes${o.length?` \u2014 ${o.length} clip(s) here have Motion that will not carry: ${o.slice(0,6).join(", ")}${o.length>6?"\u2026":""}`:""}; save the project (or wait for its auto-save) and run it again for every one of them`;return{session:n,from:"Premiere's OTIO export of the live sequence (no saved or auto-saved copy matches it yet)",path:t.path,lossy:f}}async function T(s){let i=new Set;for(let r of s.media_references??[]){if(r.binding_state==="linked")continue;let c=y(r);c&&await S(c).then(e=>e.isFile,()=>!1)&&i.add(R(c))}let a=s;for(let r of i){let c=await C(a,{media_root:r,gather:"path",criteria:{file_name:!0,file_name_mode:"tight"},lane:"both",reset:!1,dry_run:!1,compare:!1,cap:2e3,remember:!1}).catch(()=>null);c?.changed&&(a=c.session)}return a!==s&&Object.assign(s,a),(s.media_references??[]).filter(r=>r.binding_state==="linked").length}async function I(s){let i=0;for(let a of s.media_references??[]){if(a.source_resolution_w)continue;let r=y(a),c=r?await M(r).catch(()=>null):null;if(!c)continue;let e=c;for(let t of["source_resolution_w","source_resolution_h","source_pixel_aspect","codec","container","streams"])e[t]!=null&&a[t]==null&&(a[t]=e[t]);a.source_fps??=e.source_fps??null,a.source_timecode??=e.source_timecode??null,!a.available_range&&e.available_range&&(a.available_range=e.available_range),i++}return i}async function ie(s,i){let a=i.timelines.filter(t=>t.offline_reference?.clip_id);if(!a.length)return 0;let r=t=>[...t?.clip_list??[],...(t?.folders??[]).flatMap(r)],c=new Map(r((await s.project({clips:!0})).pool).map(t=>[t.id,t])),e=0;for(let t of a){let n=c.get(t.offline_reference.clip_id);if(n?.file){let o=i.media_references.find(f=>y(f)===n.file);o||(o={id:`offline-ref-${t.id??e}`,kind:"external",name:n.name,target_url:`file://${n.file}`,local_path:n.file},i.media_references.push(o)),t.offline_reference.media_reference_id=o.id,e++}else if(n&&n.name!==t.name&&(n.type==="Timeline"||/compound/i.test(n.type??""))){let{createSession:o}=await import("./store-7IOEBOZY.js"),f=k(await x("conform-offline-ref-"),`${n.name.replace(/[^\w.-]+/g,"_")}.drt`),m=await s.export(n.type==="Timeline"?{timeline:n.name,out_path:f}:{clip_id:n.id,out_path:f}),{session:l}=await P(m.path,"drt");l=(await A(l))?.session??l,t.offline_reference.session_id=(await o(l,m.path,"drt")).id,e++}else t.offline_reference=null}return e}async function Z(s,i){let a=(await s.projectClips()).clips,r=new Map(a.filter(e=>e.start_frame!=null&&e.fps).map(e=>[e.file,e])),c=0;for(let e of i.media_references??[]){if(e.source_timecode)continue;let t=r.get(y(e));if(t){e.source_timecode=F(t.start_frame,t.fps),e.source_fps??=t.fps,c++;continue}let n=y(e),o=n?await M(n).catch(()=>null):null;o?.source_timecode&&(e.source_timecode=o.source_timecode,e.source_fps??=o.source_fps??null,c++)}return c}function z(s,i){let a=new Map(s.timelines.map(c=>[c.id,c])),r=[i];for(let c=0;c<r.length;c++)for(let e of r[c].tracks)for(let t of e.items){let n=t.nested_timeline_id,o=n?a.get(n):void 0;o&&!r.includes(o)&&r.push(o)}return{...s,timelines:r}}function V(s,i){let a=new Map((s.media_references??[]).map(n=>[n.id,y(n)])),r=[];for(let n of i.media_references??[]){let o=a.get(n.id),f=y(n);o!==void 0&&f&&f!==o&&r.push({ref_id:n.id,old:o,new:f})}let c=new Map(r.map(n=>[n.ref_id,n])),e=[],t=i.timelines.find(n=>n.kind==="primary")??i.timelines[0];for(let n of t?.tracks??[])if(n.kind==="Video")for(let o of n.items){let f=o.media_reference_id?c.get(o.media_reference_id):void 0;!f||o.kind!=="clip"||!o.source_range||e.push({track:n.track_index,start:o.timeline_range.start.value,duration:o.timeline_range.duration.value,src_in:o.source_range.start.value,path:f.new,name:o.name??""})}return{media:r,cuts:e}}async function se(s,i){let{session:a,from:r,lossy:c}=await H(s,i.timeline),e=await C(structuredClone(a),{media_root:i.media_root,gather:"walk",reset:!0,lane:"video",dry_run:!1,cap:2e3,criteria:i.criteria??(i.mode==="cut_in"?{file_name:!1,reel_name:!0}:{file_name:!0,file_name_mode:"loose"}),tolerances:i.tolerances}),{media:t,cuts:n}=V(a,e.session),o=[`read from ${r}`,...c&&i.mode==="new_version"?[`\u26A0 ${c}`]:[],`matched ${t.length} medi${t.length===1?"um":"a"} under ${i.media_root} (${n.length} clip use${n.length===1?"":"s"} in the sequence)`],f=t.map(u=>` ${u.old.split("/").pop()} \u2192 ${u.new}`);if(i.dry_run||!t.length)return{text:[...o,...f,i.dry_run?"(dry run \u2014 nothing changed in Premiere)":"",e.text.split(`
4
+ `).slice(-6).join(`
5
+ `)].filter(Boolean).join(`
6
+ `),data:{media:t,cuts:n,from:r}};if(i.mode==="replace"||i.mode==="hires"||i.mode==="proxy"){let p=(await s.projectClips()).clips.flatMap(w=>t.filter(v=>v.old===w.file).map(v=>({clip:w.id,path:v.new,mode:i.mode}))),g=i.mode==="replace"?W(a,e.session,t):new Map,_=g.size?await X(s,new Set(g.keys())):[],b=await s.relinkClips(p),d=b.results.filter(w=>w.ok).length,$=[...o,`${i.mode==="hires"?"attached full-res behind":i.mode==="proxy"?"attached as proxies to":"repointed"} ${d}/${p.length} project clip(s)${i.mode==="proxy"?" (Toggle Proxies in Premiere switches)":""}`,...f,...b.results.filter(w=>!w.ok).map(w=>` refused: ${w.detail??"Premiere refused"}`)],j=_.length?await Y(s,_,g):null;return j&&$.push(...j.lines),{text:$.join(`
7
+ `),data:{media:t,results:b.results,undo_relink:b.undo,...j?{refit:j.data}:{},from:r}}}if(i.mode==="cut_in"){let u=await s.items({timeline:i.timeline,kind:"video"}),p=Math.max(0,...u.items.map(d=>d.track)),g=i.track??p+1,_=await s.cutIn(i.timeline,n.map(d=>({path:d.path,track:g,start:d.start,src_in:d.src_in,duration:d.duration,copy_from:{track:d.track,start:d.start}}))),b=_.results.filter(d=>d.ok).length;return{text:[...o,`cut in ${b}/${n.length} on V${g} (video only, the originals untouched underneath; Edit > Undo ${_.undo_steps}\xD7 in Premiere takes the cuts${_.undo_steps>1?" and the carried sizing":""} back; each return clip keeps its in/out marks)`,...n.map((d,$)=>` V${d.track} @${d.start} ${d.name} \u2192 ${d.path.split("/").pop()} src ${d.src_in}${_.results[$]?.ok?"":` REFUSED: ${_.results[$]?.detail??""}`}`)].join(`
8
+ `),data:{media:t,cuts:n,results:_.results,track:g,from:r}}}let m=e.session.timelines.find(u=>u.kind==="primary")??e.session.timelines[0];m&&(m.name=i.name??`${m.name}_CONFORMED`);let l=await q(e.session,"premiere-prproj",k(await x("conform-ppro-"),"/"),""),h=await s.open({path:l.path});return{text:[...o,`new sequence "${h.timeline}" in ${h.project} (the open sequence is untouched)`,...f,...h.notes,...l.issues.slice(0,10).map(u=>` note: ${u.message}`)].join(`
9
+ `),data:{media:t,path:l.path,sequence:h.timeline,issues:l.issues,from:r}}}function W(s,i,a){let r=new Map,c=(e,t)=>(e.media_references??[]).find(n=>n.id===t);for(let e of a){let t=c(s,e.ref_id),n=c(i,e.ref_id),o=t?.source_resolution_w,f=t?.source_resolution_h,m=n?.source_resolution_w,l=n?.source_resolution_h;!o||!f||!m||!l||o===m||Math.abs(o/f-m/l)>.01||r.set(e.old,o/m)}return r}async function X(s,i){let a=[];for(let r of(await s.current()).timelines){let c=await s.model(r).catch(()=>null);for(let e of c?.items??[])i.has(e.file_path)&&a.push({sequence:r,track:e.track,start:e.start-c.start_frame,file:e.file_path,zx:e.sizing.ZoomX??1,zy:e.sizing.ZoomY??e.sizing.ZoomX??1,keyframed:!!e.sizing_keyframed})}return a}async function Y(s,i,a){let r=[],c={},e=new Map;for(let t of i)(e.get(t.sequence)??e.set(t.sequence,[]).get(t.sequence)).push(t);for(let[t,n]of e){let o=n.filter(l=>l.keyframed),f=n.filter(l=>!l.keyframed).map(l=>{let h=a.get(l.file);return{op:"properties",item:{kind:"video",track:l.track,start:l.start},set:{ZoomX:+(l.zx*h).toFixed(6),ZoomY:+(l.zy*h).toFixed(6)}}}),m=f.length?await s.apply({timeline:t,ops:f}):null;c[t]={rescaled:m?.applied??0,keyframed:o.length,undo:m?.undo??[]},r.push(` "${t}": ${m?.applied??0}/${f.length} use(s) rescaled to keep their framing on the new raster (one Edit > Undo)${o.length?`; ${o.length} with keyframed scale left as they are \u2014 check them`:""}`)}return{lines:["framing kept through the raster change (Premiere's Scale is a percent of the media's pixels):",...r],data:c}}async function B(s){let i=new Set;for(let e of s.timelines)for(let t of e.tracks)for(let n of t.items)n.is_adjustment&&(i.add(n.id),n.is_adjustment=!1);let a=s.timelines.flatMap(e=>e.tracks.flatMap(t=>t.items)).filter(e=>e.kind==="nested").length,r=await A(s);if(!r)throw new Error("un-nesting needs the conform.tools engine on this machine");for(let e of r.session.timelines)for(let t of e.tracks)for(let n of t.items)i.has(n.id)&&(n.is_adjustment=!0);let c=s.timelines[0]?.id;return Object.assign(s,r.session),s.timelines=s.timelines.filter(e=>e.id===c),{summary:`un-nested ${a} nest${a===1?"":"s"}`,issues:r.issues}}async function re(s,i){let{session:a,from:r,lossy:c}=await H(s,i.timeline),e=await L(a,i.ops,i.name),t=await q(e.session,"premiere-prproj",k(await x("conform-ppro-"),"/"),""),n=await s.open({path:t.path}),o=[...e.issues,...t.issues.map(f=>f.message)];return{text:[`read from ${r}`,...c?[`\u26A0 ${c}`]:[],...e.lines,`new sequence "${n.timeline}" in ${n.project} (the open sequence is untouched)`,...o.slice(0,12).map(f=>` note: ${f}`),...o.length>12?[` \u2026and ${o.length-12} more notes`]:[]].join(`
10
+ `),data:{sequence:n.timeline,path:t.path,notes:o,from:r}}}async function L(s,i,a){let r=[],c=[],e=()=>s.timelines[0];for(let n of i){if(n.kind==="unnest"){let l=await B(s);r.push(l.summary),c.push(...l.issues);continue}let o=new Set(s.timelines.map(l=>l.id)),f=N(s,n.kind,{timeline_id:e()?.id,...n.args??{}});r.push(f.summary);let m=s.timelines.find(l=>!o.has(l.id)&&l.kind!=="compound");m&&(s.timelines=z(s,m).timelines)}let t=e();if(!t)throw new Error("nothing to write: the operations left no timeline");return t.name=a??(i.length===1?`${t.name}_${i[0].kind.toUpperCase()}`:`${t.name}_EDIT`),{session:z(s,t),lines:r,issues:c}}export{T as bindAtRecordedPaths,V as changes,L as editSession,re as hostEdit,se as hostRelink,H as premiereSession,I as probeRefs,W as rasterRatios,z as withNests,ie as withOfflineReference,Z as withPremiereTimecodes};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ import{f as a,g as b,h as c,i as d,j as e}from"./chunk-EUBXH67N.js";import"./chunk-SNTAZJ5A.js";import"./chunk-TXQR2HI2.js";import"./chunk-5WEZRGXG.js";import"./chunk-P2LL3JMC.js";import"./chunk-PFISREY4.js";import"./chunk-JV7TZDKJ.js";import"./chunk-VIBEEWPC.js";import"./chunk-PFZVET7S.js";import"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-D4WPRRBT.js";import"./chunk-WN53ARHJ.js";import"./chunk-A7FNR3T5.js";import"./chunk-J2JXLEAI.js";import"./chunk-SGLQY53R.js";import"./chunk-DKGGJM6Z.js";import"./chunk-AMRJXYL4.js";import"./chunk-3D3Z4TBR.js";import"./chunk-2BPR6LK6.js";import"./chunk-NU3X7P4N.js";import"./chunk-RJ6JA2LZ.js";import"./chunk-NAFLOZER.js";import"./chunk-PHAMF4JF.js";import"./chunk-PLRB2YXJ.js";import"./chunk-C2ESM27Z.js";import"./chunk-PSANHDZM.js";export{a as AVID_SETUP,b as FLAME_SETUP,c as NUKE_SETUP,e as adapter,d as setAdapter};
package/dist/http.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ import{a as xt}from"./chunk-NFJHWZJX.js";import{$ as yt,G as nt,H as ot,I as dt,J as pt,K as gt,R as ht,S as wt,T as _t,X as b,Y as kt,_ as U}from"./chunk-55BKURYP.js";import"./chunk-S5JDS5PQ.js";import"./chunk-XLEINKFL.js";import"./chunk-EUBXH67N.js";import"./chunk-SNTAZJ5A.js";import"./chunk-TXQR2HI2.js";import{J as I,t as mt,u as ft}from"./chunk-5WEZRGXG.js";import{a as et}from"./chunk-P2LL3JMC.js";import"./chunk-GM6QKY7W.js";import"./chunk-PFISREY4.js";import"./chunk-JV7TZDKJ.js";import"./chunk-VIBEEWPC.js";import"./chunk-PFZVET7S.js";import"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-D4WPRRBT.js";import"./chunk-WN53ARHJ.js";import"./chunk-A7FNR3T5.js";import"./chunk-J2JXLEAI.js";import"./chunk-SGLQY53R.js";import"./chunk-DKGGJM6Z.js";import"./chunk-D6YDLKSA.js";import"./chunk-AMRJXYL4.js";import"./chunk-3D3Z4TBR.js";import"./chunk-2BPR6LK6.js";import"./chunk-GK4YYKJ6.js";import"./chunk-NU3X7P4N.js";import"./chunk-RJ6JA2LZ.js";import{B as v,D as lt,t as rt,u as st,v as it,x as at,y as ct,z as ut}from"./chunk-SKFMOLUO.js";import{n as H}from"./chunk-NAFLOZER.js";import{a as B}from"./chunk-PHAMF4JF.js";import{D as L,H as D,I as Z,J as q,Q as tt,V as M,W as J,Y as x,b as E,k as P,q as V,r as W,u as K,v as X,w as A,x as Y,y as $,z as Q}from"./chunk-PLRB2YXJ.js";import"./chunk-C2ESM27Z.js";import"./chunk-PSANHDZM.js";import C from"node:process";var bt=new Map;function St(t,s,o,T){let i=`${t}:${o}:${T}`,a=bt.get(i);return a||(a=(async()=>{let n=x(P(),"cache","grade-luts",t);await $(n);let l=x(n,`V${o}_${T}.cube`);if(!await W(l)){let{adapter:_}=await import("./hosts-Z666EF7V.js");if((await _("resolve").clipLut({timeline:s,track:o,start:T,out_path:l})).ok===!1)return null}return l})().catch(()=>null),bt.set(i,a)),a}var Ct=new Set(["/app/convert","/app/canonicalize"]);function Ot(t,s){let o=(s??"").split(";")[0].trim().toLowerCase();return o==="application/json"||o==="application/octet-stream"&&Ct.has(t)}function Nt(t){let s=t.replace(/[\\/:*?"<>|\x00-\x1f]+/g,"_").replace(/[. ]+$/,"")||"timeline";return/^(con|prn|aux|nul|com\d|lpt\d)(\..*)?$/i.test(s)?`_${s}`:s}var F={id:"local",name:"Local",client_name:null,handles:24,local:!0};async function Rt(){try{return JSON.parse(await X(x(P(),"projects","projects.json")))}catch{return[]}}async function Tt(){let t=await b("project",{action:"list"});if(!t.isError){let s=t.structuredContent?.projects??[];return await $(x(P(),"projects")),await Y(x(P(),"projects","projects.json"),JSON.stringify(s)),{projects:[F,...s],offline:!1}}return{projects:[F,...await Rt()],offline:!0,code:String(t.structuredContent?.code??"offline"),reason:String(t.structuredContent?.message??t.content[0]?.text??"")}}async function $t(t){return t==="local"?F:(await Rt()).find(s=>s.id===t)??{id:t,name:t}}async function Pt(t,s,o,T,i=(a,n)=>new Response(a,{headers:{"content-type":n}})){if(s[0]!=="app")return null;let[,a,n,l]=s,_=async()=>t.headers.get("content-type")?.includes("json")?await t.json():{};try{if(a==="policy"&&t.method==="GET"){let{config:e}=await import("./account-DJTD3KYK.js"),r=await fetch(`${e().supabaseUrl}/functions/v1/v1-billing/v1/billing/app-policy`,{signal:AbortSignal.timeout(3e3)}).catch(()=>null);return o(r?.ok?await r.json():{offline:!0})}if(a==="account"&&t.method==="GET"){let e=await b("account_status",{}),r=await H().then(()=>({app:!0}),u=>({app:!1,app_reason:u.message,code:u.code}));return o({...e.structuredContent,...e.structuredContent?.account??{},...r,text:e.content[0]?.text})}{let e=await H().then(()=>null,r=>r);if(e)return o({ok:!1,code:e.code,message:e.message,needs:"app"},e.code==="not_signed_in"?401:402)}if(a==="events"&&t.method==="GET")return T(gt());if(a==="front"&&t.method==="POST"){let e=await t.json();return pt({project:String(e.project??""),view:String(e.view??""),...e.tool?{tool:String(e.tool)}:{}}),o({ok:!0})}if(a==="convert"&&t.method==="POST"){let e=new URL(t.url).searchParams,r=M(e.get("name")||"timeline"),u=e.get("out")||"",g=JSON.parse(e.get("targets")||"[]"),c=JSON.parse(e.get("sequences")||"[]");if(!u||!g.length)return o({ok:!1,error:"a folder and at least one format are needed"},400);let m=await D("conform-te-"),k=x(m,r);await A(k,new Uint8Array(await t.arrayBuffer()));let h=await b("timeline_read",{path:k}),S=h.structuredContent?.session_id??h.content[0]?.text.match(/session_id: (\w+)/)?.[1];if(h.isError||!S)return o({ok:!1,error:h.content[0]?.text??"could not read the timeline"});let p=(await v(S)).session.timelines.filter(y=>y.kind!=="compound"),w=c.length?p.filter(y=>c.includes(y.name??"")):p,d=[],O=0;for(let y of w)for(let R of g){let N=x(u,`${Nt(y.name??"timeline")}.${R.ext}`),z=await b("timeline_write",{session_id:S,target:R.target,out_path:N,...w.length>1||p.length>1?{timeline_id:y.id}:{}});z.isError?d.push(`${y.name} \u2192 ${R.target}: ${z.content[0]?.text}`):O++}return await L(m).catch(()=>{}),o({ok:O>0,savedCount:O,...d.length?{error:d.join(`
4
+ `)}:{}})}if(a==="fs"&&t.method==="POST"){let{op:e,path:r,offset:u=0,length:g=0}=await _();if(e==="statPath"){let c=await V(r).catch(()=>null);return o({ok:!0,result:c?{kind:c.isDirectory?"directory":"file",size:c.size,lastModified:Math.round(c.mtimeMs)}:null})}if(e==="readDir"){let c=[];for await(let m of Z(r))(m.isFile||m.isDirectory)&&c.push({name:m.name,kind:m.isDirectory?"directory":"file"});return o({ok:!0,result:c})}if(e==="readFile"){let c=await q(r);try{return i(await c.readAt(Math.max(0,u),Math.min(Math.max(0,g),16<<20)),"application/octet-stream")}finally{await c.close()}}return o({ok:!1,code:"bad_request",message:`no fs op ${e}`},400)}if(a==="canonicalize"&&t.method==="POST"){let e=new URL(t.url).searchParams,r=JSON.parse(e.get("sequences")||"[]"),u=JSON.parse(e.get("previous")||"[]"),g=await D("conform-te-");try{let c=x(g,M(e.get("name")||"timeline"));await A(c,new Uint8Array(await t.arrayBuffer()));let m=await b("timeline_read",{path:c}),k=m.structuredContent?.session_id??m.content[0]?.text.match(/session_id: (\w+)/)?.[1];if(m.isError||!k)return o({ok:!1,error:m.content[0]?.text??"could not read the timeline"},422);let h=(await v(k)).session,S=h.timelines;if(r.length){let p=new Map;for(let d of u)p.set(d,(p.get(d)??0)+1);let w=new Set;for(let d of r){let O=h.timelines.filter(N=>N.kind!=="compound"&&(N.name??"")===d),y=p.get(d)??0;p.set(d,y+1);let R=O[Math.min(y,O.length-1)];R&&w.add(R)}S=h.timelines.filter(d=>d.kind==="compound"||w.has(d))}return o({ok:!0,session_id:k,session:{...h,timelines:S}})}finally{await L(g).catch(()=>{})}}if(a==="sessions"&&n&&l==="frame"){let e=new URL(t.url).searchParams,r=Math.max(0,Math.round(Number(e.get("f")??0))),u=Math.min(3840,Math.max(64,Number(e.get("w")??1280)|0));try{let k=(await v(n)).session,h=e.get("track")==="offline"?"offline":Number(e.get("track"))||void 0,S;if(e.get("grade")==="resolve"&&h!=="offline"){let w=(()=>{try{return mt(k,{record:r,timeline:e.get("timeline")??void 0,track:h})}catch{return null}})();w&&(S=await St(n,e.get("host_timeline")??void 0,w.video_track,w.record_start)??void 0)}let p=await ft(k,r,u,e.get("timeline")??void 0,h,S);if(p){let w=new Uint8Array(12+p.px.length),d=new DataView(w.buffer);return d.setUint32(0,p.w,!0),d.setUint32(4,p.h,!0),d.setUint32(8,p.order==="bgra"?1:0,!0),w.set(p.px,12),i(w,"application/x-conform-pixels")}}catch(k){return o({ok:!1,code:"no_frame",message:k.message},404)}let g=await b("timeline_frame",{session_id:n,record:r,width:u,...e.get("timeline")?{timeline:e.get("timeline")}:{}}),c=g.structuredContent?.out_path;if(g.isError||!c)return o({ok:!1,code:String(g.structuredContent?.code??"no_frame"),message:g.content[0]?.text??"no picture here"},404);let m=await K(c);return await(M(J(c)).startsWith("conform-frame-")?L(J(c)):Q(c)).catch(()=>{}),i(m,"image/png")}if(a==="sessions"&&n&&t.method==="GET"){let e=await v(n).catch(()=>null);return e?o(e):o({ok:!1,code:"not_found"},404)}if(a==="sessions"&&!n)return o(await lt());if(a!=="projects")return o({ok:!1,code:"not_found"},404);if(!n){if(t.method==="POST"){let e=await _(),r=await b("project",{action:"create",name:e.name,client_name:e.client_name,handles:e.handles});return r.isError?o({...r.structuredContent,text:r.content[0]?.text},422):(await Tt(),o(r.structuredContent))}return o(await Tt())}if(!l){let[e,r,u,g]=await Promise.all([$t(n),st(n).catch(()=>null),ut(n),dt(n)]);await at(n===rt?null:{id:n,name:e.name??n});let{text:c="",...m}=r??{};return o({project:e,context:c,context_meta:m,sessions:u,activity:g.slice(-100).reverse()})}if(l==="sessions"&&t.method==="PUT")return await ct(n,String((await _()).session_id??"")),o({ok:!0});if(l==="context"&&t.method==="PUT"){let e=await _();try{let{text:r,...u}=await it(n,String(e.text??""),e.base===void 0?void 0:e.base);return o({ok:!0,context:r,context_meta:u})}catch(r){if(r instanceof B&&r.code==="context_conflict"){let u=r.data?.current;return o({ok:!1,code:r.code,message:r.message,context:u.context,context_meta:{updated_at:u.context_updated_at,updated_by:u.context_updated_by_name??null}},409)}throw r}}return o({ok:!1,code:"not_found"},404)}catch(e){let r=e instanceof B?e:null;return o({ok:!1,code:r?.code??"internal",message:e.message},r?.code==="not_found"?404:r?.code==="invalid_args"?400:500)}}var Lt=Number(E("CONFORM_HTTP_PORT")??7791);E("CONFORM_EXIT_WITH_PARENT")==="1"&&(C.stdin.on("end",()=>C.exit(0)),C.stdin.on("close",()=>C.exit(0)),C.stdin.resume());var G=E("CONFORM_HTTP_TOKEN")??"",vt=(E("CONFORM_HTTP_ORIGINS")??"https://conform.tools,https://app.conform.tools,http://localhost:5173,http://localhost:3000").split(","),j=(t,s=new Headers)=>{let o=t.headers.get("origin")??"";return vt.includes(o)&&s.set("access-control-allow-origin",o),s.set("access-control-allow-headers","authorization, content-type"),s.set("access-control-allow-methods","GET, POST, PUT, DELETE, OPTIONS"),s.set("access-control-allow-private-network","true"),s.set("vary","origin"),s},Et=new Set,f=(t,s,o=200)=>new Response(JSON.stringify(s),{status:o,headers:j(t,new Headers({"content-type":"application/json"}))});tt({hostname:"127.0.0.1",port:Lt,onListen:t=>{Et=new Set([`127.0.0.1:${t}`,`localhost:${t}`,`[::1]:${t}`]),console.error(`conformtools HTTP API on http://127.0.0.1:${t} (${U.length} verbs)`),xt(t,G)}},async t=>{let s=new URL(t.url),o=(t.headers.get("host")??"").toLowerCase();if(!Et.has(o))return new Response("forbidden host",{status:403});let T=t.headers.get("origin");if(T&&!vt.includes(T))return new Response("forbidden origin",{status:403});if(t.method==="OPTIONS")return new Response(null,{status:204,headers:j(t)});if((t.method==="POST"||t.method==="PUT")&&t.headers.get("content-length")!=="0"&&!Ot(s.pathname,t.headers.get("content-type")))return f(t,{ok:!1,code:"unsupported_media_type",message:"send the body as application/json"},415);if(G&&t.headers.get("authorization")!==`Bearer ${G}`&&s.pathname!=="/health")return f(t,{ok:!1,code:"unauthorized"},401);let i=s.pathname.split("/").filter(Boolean);try{if(s.pathname==="/health")return f(t,{ok:!0,verbs:U.length,version:et,engine:I()});if(i[0]==="verbs"&&i.length===1&&t.method==="GET")return f(t,U.map(n=>({name:n.name,title:n.title,description:n.description,long:!!n.long,input_schema:ot(nt.object(n.inputSchema)),protected_stages:n.protectedStages??[],engine:I()})));if(i[0]==="verbs"&&i.length===2&&t.method==="POST"){let n=yt(i[1]);if(!n)return f(t,{ok:!1,code:"not_found",message:`unknown verb ${i[1]}`},404);let l=t.headers.get("content-type")?.includes("json")?await t.json():{},_=kt(n.name,l);if(!_.ok)return f(t,{..._.result.structuredContent,text:_.result.content[0].text},400);let e=await b(n.name,_.data);return f(t,{...e.structuredContent??{ok:!e.isError},text:e.content.map(r=>r.text).join(`
5
+ `)},e.isError?422:200)}if(i[0]==="debug"&&i.length===3&&t.method==="POST"&&Deno.env.get("CONFORM_DEBUG_BRIDGE")==="1"){let{hostBridge:n}=await import("./bridge-JQF4V3V2.js"),l=await n();return await l.waitFor(i[1],5e3)?f(t,{ok:!0,result:await l.request(i[1],i[2],t.headers.get("content-type")?.includes("json")?await t.json():{},12e4)}):f(t,{ok:!1,code:"not_connected"},409)}let a=await Pt(t,i,(n,l)=>f(t,n,l),n=>new Response(n,{headers:j(t,new Headers({"content-type":"text/event-stream","cache-control":"no-cache"}))}),(n,l)=>new Response(n,{headers:j(t,new Headers({"content-type":l,"cache-control":"no-store"}))}));if(a)return a;if(i[0]==="jobs"&&i.length===1)return f(t,await _t());if(i[0]==="jobs"&&i.length===2){if(t.method==="DELETE")return f(t,{ok:wt(i[1])});let n=await ht(i[1]);return n?f(t,n):f(t,{ok:!1,code:"not_found"},404)}return f(t,{ok:!1,code:"not_found"},404)}catch(a){return f(t,{ok:!1,code:"internal",message:a instanceof Error?a.message:String(a)},500)}});
Binary file