@nodetool-ai/gpu 0.8.1

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 (359) hide show
  1. package/README.md +52 -0
  2. package/dist/.nodetool-build-stamp +1 -0
  3. package/dist/blend/blendModes.d.ts +67 -0
  4. package/dist/blend/blendModes.d.ts.map +1 -0
  5. package/dist/blend/blendModes.js +80 -0
  6. package/dist/blend/blendModes.js.map +1 -0
  7. package/dist/blend/index.d.ts +10 -0
  8. package/dist/blend/index.d.ts.map +1 -0
  9. package/dist/blend/index.js +10 -0
  10. package/dist/blend/index.js.map +1 -0
  11. package/dist/blend/wgsl.d.ts +16 -0
  12. package/dist/blend/wgsl.d.ts.map +1 -0
  13. package/dist/blend/wgsl.js +85 -0
  14. package/dist/blend/wgsl.js.map +1 -0
  15. package/dist/compositor/compositor.d.ts +112 -0
  16. package/dist/compositor/compositor.d.ts.map +1 -0
  17. package/dist/compositor/compositor.js +353 -0
  18. package/dist/compositor/compositor.js.map +1 -0
  19. package/dist/compositor/headless.d.ts +47 -0
  20. package/dist/compositor/headless.d.ts.map +1 -0
  21. package/dist/compositor/headless.js +158 -0
  22. package/dist/compositor/headless.js.map +1 -0
  23. package/dist/compositor/index.d.ts +8 -0
  24. package/dist/compositor/index.d.ts.map +1 -0
  25. package/dist/compositor/index.js +8 -0
  26. package/dist/compositor/index.js.map +1 -0
  27. package/dist/compositor/shaders.d.ts +24 -0
  28. package/dist/compositor/shaders.d.ts.map +1 -0
  29. package/dist/compositor/shaders.js +241 -0
  30. package/dist/compositor/shaders.js.map +1 -0
  31. package/dist/compositor/transform.d.ts +49 -0
  32. package/dist/compositor/transform.d.ts.map +1 -0
  33. package/dist/compositor/transform.js +74 -0
  34. package/dist/compositor/transform.js.map +1 -0
  35. package/dist/context.d.ts +108 -0
  36. package/dist/context.d.ts.map +1 -0
  37. package/dist/context.js +205 -0
  38. package/dist/context.js.map +1 -0
  39. package/dist/debug/premulValidator.d.ts +85 -0
  40. package/dist/debug/premulValidator.d.ts.map +1 -0
  41. package/dist/debug/premulValidator.js +239 -0
  42. package/dist/debug/premulValidator.js.map +1 -0
  43. package/dist/executor.d.ts +74 -0
  44. package/dist/executor.d.ts.map +1 -0
  45. package/dist/executor.js +413 -0
  46. package/dist/executor.js.map +1 -0
  47. package/dist/fullscreenQuad.d.ts +11 -0
  48. package/dist/fullscreenQuad.d.ts.map +1 -0
  49. package/dist/fullscreenQuad.js +31 -0
  50. package/dist/fullscreenQuad.js.map +1 -0
  51. package/dist/index.d.ts +16 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +16 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/module.d.ts +162 -0
  56. package/dist/module.d.ts.map +1 -0
  57. package/dist/module.js +100 -0
  58. package/dist/module.js.map +1 -0
  59. package/dist/node.d.ts +38 -0
  60. package/dist/node.d.ts.map +1 -0
  61. package/dist/node.js +140 -0
  62. package/dist/node.js.map +1 -0
  63. package/dist/pool.d.ts +30 -0
  64. package/dist/pool.d.ts.map +1 -0
  65. package/dist/pool.js +33 -0
  66. package/dist/pool.js.map +1 -0
  67. package/dist/recipe.d.ts +148 -0
  68. package/dist/recipe.d.ts.map +1 -0
  69. package/dist/recipe.js +181 -0
  70. package/dist/recipe.js.map +1 -0
  71. package/dist/registry.d.ts +49 -0
  72. package/dist/registry.d.ts.map +1 -0
  73. package/dist/registry.js +100 -0
  74. package/dist/registry.js.map +1 -0
  75. package/dist/shaders/_canary/passthrough/v1/module.d.ts +13 -0
  76. package/dist/shaders/_canary/passthrough/v1/module.d.ts.map +1 -0
  77. package/dist/shaders/_canary/passthrough/v1/module.js +71 -0
  78. package/dist/shaders/_canary/passthrough/v1/module.js.map +1 -0
  79. package/dist/shaders/alpha/premulToStraight/v1/module.d.ts +16 -0
  80. package/dist/shaders/alpha/premulToStraight/v1/module.d.ts.map +1 -0
  81. package/dist/shaders/alpha/premulToStraight/v1/module.js +62 -0
  82. package/dist/shaders/alpha/premulToStraight/v1/module.js.map +1 -0
  83. package/dist/shaders/alpha/straightToPremul/v1/module.d.ts +19 -0
  84. package/dist/shaders/alpha/straightToPremul/v1/module.d.ts.map +1 -0
  85. package/dist/shaders/alpha/straightToPremul/v1/module.js +61 -0
  86. package/dist/shaders/alpha/straightToPremul/v1/module.js.map +1 -0
  87. package/dist/shaders/color/brightnessContrast/v1/module.d.ts +17 -0
  88. package/dist/shaders/color/brightnessContrast/v1/module.d.ts.map +1 -0
  89. package/dist/shaders/color/brightnessContrast/v1/module.js +84 -0
  90. package/dist/shaders/color/brightnessContrast/v1/module.js.map +1 -0
  91. package/dist/shaders/color/cdl/v1/module.d.ts +35 -0
  92. package/dist/shaders/color/cdl/v1/module.d.ts.map +1 -0
  93. package/dist/shaders/color/cdl/v1/module.js +106 -0
  94. package/dist/shaders/color/cdl/v1/module.js.map +1 -0
  95. package/dist/shaders/color/channelMerge/v1/module.d.ts +22 -0
  96. package/dist/shaders/color/channelMerge/v1/module.d.ts.map +1 -0
  97. package/dist/shaders/color/channelMerge/v1/module.js +101 -0
  98. package/dist/shaders/color/channelMerge/v1/module.js.map +1 -0
  99. package/dist/shaders/color/channelShuffle/v1/module.d.ts +29 -0
  100. package/dist/shaders/color/channelShuffle/v1/module.d.ts.map +1 -0
  101. package/dist/shaders/color/channelShuffle/v1/module.js +94 -0
  102. package/dist/shaders/color/channelShuffle/v1/module.js.map +1 -0
  103. package/dist/shaders/color/channelSplit/v1/module.d.ts +18 -0
  104. package/dist/shaders/color/channelSplit/v1/module.d.ts.map +1 -0
  105. package/dist/shaders/color/channelSplit/v1/module.js +90 -0
  106. package/dist/shaders/color/channelSplit/v1/module.js.map +1 -0
  107. package/dist/shaders/color/colorBalance/v1/module.d.ts +18 -0
  108. package/dist/shaders/color/colorBalance/v1/module.d.ts.map +1 -0
  109. package/dist/shaders/color/colorBalance/v1/module.js +86 -0
  110. package/dist/shaders/color/colorBalance/v1/module.js.map +1 -0
  111. package/dist/shaders/color/cubeLut/v1/module.d.ts +14 -0
  112. package/dist/shaders/color/cubeLut/v1/module.d.ts.map +1 -0
  113. package/dist/shaders/color/cubeLut/v1/module.js +78 -0
  114. package/dist/shaders/color/cubeLut/v1/module.js.map +1 -0
  115. package/dist/shaders/color/curves/v1/module.d.ts +31 -0
  116. package/dist/shaders/color/curves/v1/module.d.ts.map +1 -0
  117. package/dist/shaders/color/curves/v1/module.js +102 -0
  118. package/dist/shaders/color/curves/v1/module.js.map +1 -0
  119. package/dist/shaders/color/exposure/v1/module.d.ts +15 -0
  120. package/dist/shaders/color/exposure/v1/module.d.ts.map +1 -0
  121. package/dist/shaders/color/exposure/v1/module.js +78 -0
  122. package/dist/shaders/color/exposure/v1/module.js.map +1 -0
  123. package/dist/shaders/color/exposureTone/v1/module.d.ts +28 -0
  124. package/dist/shaders/color/exposureTone/v1/module.d.ts.map +1 -0
  125. package/dist/shaders/color/exposureTone/v1/module.js +107 -0
  126. package/dist/shaders/color/exposureTone/v1/module.js.map +1 -0
  127. package/dist/shaders/color/filmLook/v1/module.d.ts +28 -0
  128. package/dist/shaders/color/filmLook/v1/module.d.ts.map +1 -0
  129. package/dist/shaders/color/filmLook/v1/module.js +103 -0
  130. package/dist/shaders/color/filmLook/v1/module.js.map +1 -0
  131. package/dist/shaders/color/grade/v1/module.d.ts +35 -0
  132. package/dist/shaders/color/grade/v1/module.d.ts.map +1 -0
  133. package/dist/shaders/color/grade/v1/module.js +182 -0
  134. package/dist/shaders/color/grade/v1/module.js.map +1 -0
  135. package/dist/shaders/color/grayscale/v1/module.d.ts +14 -0
  136. package/dist/shaders/color/grayscale/v1/module.d.ts.map +1 -0
  137. package/dist/shaders/color/grayscale/v1/module.js +79 -0
  138. package/dist/shaders/color/grayscale/v1/module.js.map +1 -0
  139. package/dist/shaders/color/hsb/v1/module.d.ts +20 -0
  140. package/dist/shaders/color/hsb/v1/module.d.ts.map +1 -0
  141. package/dist/shaders/color/hsb/v1/module.js +131 -0
  142. package/dist/shaders/color/hsb/v1/module.js.map +1 -0
  143. package/dist/shaders/color/hslAdjust/v1/module.d.ts +30 -0
  144. package/dist/shaders/color/hslAdjust/v1/module.d.ts.map +1 -0
  145. package/dist/shaders/color/hslAdjust/v1/module.js +170 -0
  146. package/dist/shaders/color/hslAdjust/v1/module.js.map +1 -0
  147. package/dist/shaders/color/invert/v1/module.d.ts +15 -0
  148. package/dist/shaders/color/invert/v1/module.d.ts.map +1 -0
  149. package/dist/shaders/color/invert/v1/module.js +85 -0
  150. package/dist/shaders/color/invert/v1/module.js.map +1 -0
  151. package/dist/shaders/color/levels/v1/module.d.ts +33 -0
  152. package/dist/shaders/color/levels/v1/module.d.ts.map +1 -0
  153. package/dist/shaders/color/levels/v1/module.js +116 -0
  154. package/dist/shaders/color/levels/v1/module.js.map +1 -0
  155. package/dist/shaders/color/liftGammaGain/v1/module.d.ts +40 -0
  156. package/dist/shaders/color/liftGammaGain/v1/module.d.ts.map +1 -0
  157. package/dist/shaders/color/liftGammaGain/v1/module.js +114 -0
  158. package/dist/shaders/color/liftGammaGain/v1/module.js.map +1 -0
  159. package/dist/shaders/color/posterize/v1/module.d.ts +16 -0
  160. package/dist/shaders/color/posterize/v1/module.d.ts.map +1 -0
  161. package/dist/shaders/color/posterize/v1/module.js +80 -0
  162. package/dist/shaders/color/posterize/v1/module.js.map +1 -0
  163. package/dist/shaders/color/solarize/v1/module.d.ts +15 -0
  164. package/dist/shaders/color/solarize/v1/module.d.ts.map +1 -0
  165. package/dist/shaders/color/solarize/v1/module.js +83 -0
  166. package/dist/shaders/color/solarize/v1/module.js.map +1 -0
  167. package/dist/shaders/color/splitToning/v1/module.d.ts +26 -0
  168. package/dist/shaders/color/splitToning/v1/module.d.ts.map +1 -0
  169. package/dist/shaders/color/splitToning/v1/module.js +95 -0
  170. package/dist/shaders/color/splitToning/v1/module.js.map +1 -0
  171. package/dist/shaders/filters/blur/gaussian/v1/module.d.ts +23 -0
  172. package/dist/shaders/filters/blur/gaussian/v1/module.d.ts.map +1 -0
  173. package/dist/shaders/filters/blur/gaussian/v1/module.js +110 -0
  174. package/dist/shaders/filters/blur/gaussian/v1/module.js.map +1 -0
  175. package/dist/shaders/filters/blur/separable/v1/module.d.ts +18 -0
  176. package/dist/shaders/filters/blur/separable/v1/module.d.ts.map +1 -0
  177. package/dist/shaders/filters/blur/separable/v1/module.js +64 -0
  178. package/dist/shaders/filters/blur/separable/v1/module.js.map +1 -0
  179. package/dist/shaders/filters/convolve3x3/v1/module.d.ts +23 -0
  180. package/dist/shaders/filters/convolve3x3/v1/module.d.ts.map +1 -0
  181. package/dist/shaders/filters/convolve3x3/v1/module.js +128 -0
  182. package/dist/shaders/filters/convolve3x3/v1/module.js.map +1 -0
  183. package/dist/shaders/filters/glow/v1/module.d.ts +26 -0
  184. package/dist/shaders/filters/glow/v1/module.d.ts.map +1 -0
  185. package/dist/shaders/filters/glow/v1/module.js +102 -0
  186. package/dist/shaders/filters/glow/v1/module.js.map +1 -0
  187. package/dist/shaders/filters/grain/v1/module.d.ts +38 -0
  188. package/dist/shaders/filters/grain/v1/module.d.ts.map +1 -0
  189. package/dist/shaders/filters/grain/v1/module.js +110 -0
  190. package/dist/shaders/filters/grain/v1/module.js.map +1 -0
  191. package/dist/shaders/filters/pixelate/v1/module.d.ts +14 -0
  192. package/dist/shaders/filters/pixelate/v1/module.d.ts.map +1 -0
  193. package/dist/shaders/filters/pixelate/v1/module.js +76 -0
  194. package/dist/shaders/filters/pixelate/v1/module.js.map +1 -0
  195. package/dist/shaders/filters/sharpen/unsharpMask/v1/module.d.ts +17 -0
  196. package/dist/shaders/filters/sharpen/unsharpMask/v1/module.d.ts.map +1 -0
  197. package/dist/shaders/filters/sharpen/unsharpMask/v1/module.js +93 -0
  198. package/dist/shaders/filters/sharpen/unsharpMask/v1/module.js.map +1 -0
  199. package/dist/shaders/filters/threshold/v1/module.d.ts +17 -0
  200. package/dist/shaders/filters/threshold/v1/module.d.ts.map +1 -0
  201. package/dist/shaders/filters/threshold/v1/module.js +71 -0
  202. package/dist/shaders/filters/threshold/v1/module.js.map +1 -0
  203. package/dist/shaders/filters/vignette/v1/module.d.ts +18 -0
  204. package/dist/shaders/filters/vignette/v1/module.d.ts.map +1 -0
  205. package/dist/shaders/filters/vignette/v1/module.js +78 -0
  206. package/dist/shaders/filters/vignette/v1/module.js.map +1 -0
  207. package/dist/shaders/filters/visualFx/v1/module.d.ts +24 -0
  208. package/dist/shaders/filters/visualFx/v1/module.d.ts.map +1 -0
  209. package/dist/shaders/filters/visualFx/v1/module.js +210 -0
  210. package/dist/shaders/filters/visualFx/v1/module.js.map +1 -0
  211. package/dist/shaders/index.d.ts +86 -0
  212. package/dist/shaders/index.d.ts.map +1 -0
  213. package/dist/shaders/index.js +161 -0
  214. package/dist/shaders/index.js.map +1 -0
  215. package/dist/shaders/keyer/chromaKey/v1/module.d.ts +25 -0
  216. package/dist/shaders/keyer/chromaKey/v1/module.d.ts.map +1 -0
  217. package/dist/shaders/keyer/chromaKey/v1/module.js +111 -0
  218. package/dist/shaders/keyer/chromaKey/v1/module.js.map +1 -0
  219. package/dist/shaders/keyer/lumaKey/v1/module.d.ts +22 -0
  220. package/dist/shaders/keyer/lumaKey/v1/module.d.ts.map +1 -0
  221. package/dist/shaders/keyer/lumaKey/v1/module.js +89 -0
  222. package/dist/shaders/keyer/lumaKey/v1/module.js.map +1 -0
  223. package/dist/shaders/mask/apply/v1/module.d.ts +16 -0
  224. package/dist/shaders/mask/apply/v1/module.d.ts.map +1 -0
  225. package/dist/shaders/mask/apply/v1/module.js +79 -0
  226. package/dist/shaders/mask/apply/v1/module.js.map +1 -0
  227. package/dist/shaders/mask/fromImage/v1/module.d.ts +18 -0
  228. package/dist/shaders/mask/fromImage/v1/module.d.ts.map +1 -0
  229. package/dist/shaders/mask/fromImage/v1/module.js +99 -0
  230. package/dist/shaders/mask/fromImage/v1/module.js.map +1 -0
  231. package/dist/shaders/mask/invert/v1/module.d.ts +12 -0
  232. package/dist/shaders/mask/invert/v1/module.d.ts.map +1 -0
  233. package/dist/shaders/mask/invert/v1/module.js +57 -0
  234. package/dist/shaders/mask/invert/v1/module.js.map +1 -0
  235. package/dist/shaders/mixer/add/v1/module.d.ts +17 -0
  236. package/dist/shaders/mixer/add/v1/module.d.ts.map +1 -0
  237. package/dist/shaders/mixer/add/v1/module.js +73 -0
  238. package/dist/shaders/mixer/add/v1/module.js.map +1 -0
  239. package/dist/shaders/mixer/colorOverlay/v1/module.d.ts +26 -0
  240. package/dist/shaders/mixer/colorOverlay/v1/module.d.ts.map +1 -0
  241. package/dist/shaders/mixer/colorOverlay/v1/module.js +81 -0
  242. package/dist/shaders/mixer/colorOverlay/v1/module.js.map +1 -0
  243. package/dist/shaders/mixer/dropShadow/v1/module.d.ts +28 -0
  244. package/dist/shaders/mixer/dropShadow/v1/module.d.ts.map +1 -0
  245. package/dist/shaders/mixer/dropShadow/v1/module.js +104 -0
  246. package/dist/shaders/mixer/dropShadow/v1/module.js.map +1 -0
  247. package/dist/shaders/mixer/outline/v1/module.d.ts +27 -0
  248. package/dist/shaders/mixer/outline/v1/module.d.ts.map +1 -0
  249. package/dist/shaders/mixer/outline/v1/module.js +105 -0
  250. package/dist/shaders/mixer/outline/v1/module.js.map +1 -0
  251. package/dist/shaders/mixer/over/v1/module.d.ts +16 -0
  252. package/dist/shaders/mixer/over/v1/module.d.ts.map +1 -0
  253. package/dist/shaders/mixer/over/v1/module.js +71 -0
  254. package/dist/shaders/mixer/over/v1/module.js.map +1 -0
  255. package/dist/shaders/mixer/shadowCompose/v1/module.d.ts +26 -0
  256. package/dist/shaders/mixer/shadowCompose/v1/module.d.ts.map +1 -0
  257. package/dist/shaders/mixer/shadowCompose/v1/module.js +95 -0
  258. package/dist/shaders/mixer/shadowCompose/v1/module.js.map +1 -0
  259. package/dist/shaders/sources/angularGradient/v1/module.d.ts +18 -0
  260. package/dist/shaders/sources/angularGradient/v1/module.d.ts.map +1 -0
  261. package/dist/shaders/sources/angularGradient/v1/module.js +67 -0
  262. package/dist/shaders/sources/angularGradient/v1/module.js.map +1 -0
  263. package/dist/shaders/sources/checkerboard/v1/module.d.ts +19 -0
  264. package/dist/shaders/sources/checkerboard/v1/module.d.ts.map +1 -0
  265. package/dist/shaders/sources/checkerboard/v1/module.js +70 -0
  266. package/dist/shaders/sources/checkerboard/v1/module.js.map +1 -0
  267. package/dist/shaders/sources/diamondGradient/v1/module.d.ts +18 -0
  268. package/dist/shaders/sources/diamondGradient/v1/module.d.ts.map +1 -0
  269. package/dist/shaders/sources/diamondGradient/v1/module.js +61 -0
  270. package/dist/shaders/sources/diamondGradient/v1/module.js.map +1 -0
  271. package/dist/shaders/sources/gaussianNoise/v1/module.d.ts +21 -0
  272. package/dist/shaders/sources/gaussianNoise/v1/module.d.ts.map +1 -0
  273. package/dist/shaders/sources/gaussianNoise/v1/module.js +72 -0
  274. package/dist/shaders/sources/gaussianNoise/v1/module.js.map +1 -0
  275. package/dist/shaders/sources/linearGradient/v1/module.d.ts +21 -0
  276. package/dist/shaders/sources/linearGradient/v1/module.d.ts.map +1 -0
  277. package/dist/shaders/sources/linearGradient/v1/module.js +72 -0
  278. package/dist/shaders/sources/linearGradient/v1/module.js.map +1 -0
  279. package/dist/shaders/sources/radialGradient/v1/module.d.ts +18 -0
  280. package/dist/shaders/sources/radialGradient/v1/module.d.ts.map +1 -0
  281. package/dist/shaders/sources/radialGradient/v1/module.js +60 -0
  282. package/dist/shaders/sources/radialGradient/v1/module.js.map +1 -0
  283. package/dist/shaders/sources/solid/v1/module.d.ts +17 -0
  284. package/dist/shaders/sources/solid/v1/module.d.ts.map +1 -0
  285. package/dist/shaders/sources/solid/v1/module.js +49 -0
  286. package/dist/shaders/sources/solid/v1/module.js.map +1 -0
  287. package/dist/shaders/transform/affine/v1/module.d.ts +36 -0
  288. package/dist/shaders/transform/affine/v1/module.d.ts.map +1 -0
  289. package/dist/shaders/transform/affine/v1/module.js +94 -0
  290. package/dist/shaders/transform/affine/v1/module.js.map +1 -0
  291. package/dist/shaders/transform/cornerPin/v1/module.d.ts +40 -0
  292. package/dist/shaders/transform/cornerPin/v1/module.d.ts.map +1 -0
  293. package/dist/shaders/transform/cornerPin/v1/module.js +109 -0
  294. package/dist/shaders/transform/cornerPin/v1/module.js.map +1 -0
  295. package/dist/shaders/transform/crop/v1/module.d.ts +26 -0
  296. package/dist/shaders/transform/crop/v1/module.d.ts.map +1 -0
  297. package/dist/shaders/transform/crop/v1/module.js +82 -0
  298. package/dist/shaders/transform/crop/v1/module.js.map +1 -0
  299. package/dist/shaders/transform/displace/v1/module.d.ts +23 -0
  300. package/dist/shaders/transform/displace/v1/module.d.ts.map +1 -0
  301. package/dist/shaders/transform/displace/v1/module.js +95 -0
  302. package/dist/shaders/transform/displace/v1/module.js.map +1 -0
  303. package/dist/shaders/transform/mirror/v1/module.d.ts +14 -0
  304. package/dist/shaders/transform/mirror/v1/module.d.ts.map +1 -0
  305. package/dist/shaders/transform/mirror/v1/module.js +73 -0
  306. package/dist/shaders/transform/mirror/v1/module.js.map +1 -0
  307. package/dist/shaders/transform/offset/v1/module.d.ts +21 -0
  308. package/dist/shaders/transform/offset/v1/module.d.ts.map +1 -0
  309. package/dist/shaders/transform/offset/v1/module.js +88 -0
  310. package/dist/shaders/transform/offset/v1/module.js.map +1 -0
  311. package/dist/shaders/transform/pad/v1/module.d.ts +26 -0
  312. package/dist/shaders/transform/pad/v1/module.d.ts.map +1 -0
  313. package/dist/shaders/transform/pad/v1/module.js +95 -0
  314. package/dist/shaders/transform/pad/v1/module.js.map +1 -0
  315. package/dist/shaders/transform/polarRemap/v1/module.d.ts +20 -0
  316. package/dist/shaders/transform/polarRemap/v1/module.d.ts.map +1 -0
  317. package/dist/shaders/transform/polarRemap/v1/module.js +95 -0
  318. package/dist/shaders/transform/polarRemap/v1/module.js.map +1 -0
  319. package/dist/shaders/transform/resize/v1/module.d.ts +20 -0
  320. package/dist/shaders/transform/resize/v1/module.d.ts.map +1 -0
  321. package/dist/shaders/transform/resize/v1/module.js +116 -0
  322. package/dist/shaders/transform/resize/v1/module.js.map +1 -0
  323. package/dist/shaders/transform/rotate90/v1/module.d.ts +25 -0
  324. package/dist/shaders/transform/rotate90/v1/module.d.ts.map +1 -0
  325. package/dist/shaders/transform/rotate90/v1/module.js +90 -0
  326. package/dist/shaders/transform/rotate90/v1/module.js.map +1 -0
  327. package/dist/shaders/transform/spherize/v1/module.d.ts +21 -0
  328. package/dist/shaders/transform/spherize/v1/module.d.ts.map +1 -0
  329. package/dist/shaders/transform/spherize/v1/module.js +94 -0
  330. package/dist/shaders/transform/spherize/v1/module.js.map +1 -0
  331. package/dist/shaders/transform/tile/v1/module.d.ts +22 -0
  332. package/dist/shaders/transform/tile/v1/module.d.ts.map +1 -0
  333. package/dist/shaders/transform/tile/v1/module.js +89 -0
  334. package/dist/shaders/transform/tile/v1/module.js.map +1 -0
  335. package/dist/shared/lumaWgsl.d.ts +14 -0
  336. package/dist/shared/lumaWgsl.d.ts.map +1 -0
  337. package/dist/shared/lumaWgsl.js +18 -0
  338. package/dist/shared/lumaWgsl.js.map +1 -0
  339. package/dist/shared/premulWgsl.d.ts +46 -0
  340. package/dist/shared/premulWgsl.d.ts.map +1 -0
  341. package/dist/shared/premulWgsl.js +90 -0
  342. package/dist/shared/premulWgsl.js.map +1 -0
  343. package/dist/texture.d.ts +54 -0
  344. package/dist/texture.d.ts.map +1 -0
  345. package/dist/texture.js +70 -0
  346. package/dist/texture.js.map +1 -0
  347. package/dist/types.d.ts +103 -0
  348. package/dist/types.d.ts.map +1 -0
  349. package/dist/types.js +8 -0
  350. package/dist/types.js.map +1 -0
  351. package/dist/validate/wgslLinearity.d.ts +86 -0
  352. package/dist/validate/wgslLinearity.d.ts.map +1 -0
  353. package/dist/validate/wgslLinearity.js +298 -0
  354. package/dist/validate/wgslLinearity.js.map +1 -0
  355. package/dist/webgpu/index.d.ts +11 -0
  356. package/dist/webgpu/index.d.ts.map +1 -0
  357. package/dist/webgpu/index.js +11 -0
  358. package/dist/webgpu/index.js.map +1 -0
  359. package/package.json +85 -0
@@ -0,0 +1,162 @@
1
+ /**
2
+ * `ShaderModule` — the atomic unit of reuse in the shared shader pool.
3
+ *
4
+ * A module bundles hand-written WGSL with a TypeGPU bind group layout, a
5
+ * TypeGPU `d.struct` uniform schema, sampler descriptors, and a declared I/O
6
+ * contract. There is no way to import "just the WGSL": the layout, the
7
+ * uniform packer, and the I/O contract travel with it so later phases never
8
+ * re-derive uniform layouts or bind group layouts by hand.
9
+ *
10
+ * WGSL stays hand-written; {@link defineModule} runs `tgpu.resolve(...)` to
11
+ * connect it to the typed layout (the TS-to-WGSL compiler is not adopted).
12
+ */
13
+ import tgpu from "typegpu";
14
+ import type { TgpuBindGroupLayout } from "typegpu";
15
+ import type { AnyWgslStruct, Infer } from "typegpu/data";
16
+ import type { BindingKind, IOContract, LinearityMode, ShaderCategory, ShaderKind, ShaderSurface, UiHint } from "./types.js";
17
+ /**
18
+ * One value `tgpu.resolve` can inline into WGSL — a schema, a layout, a
19
+ * buffer usage, a TypeGPU function. Read off the resolver's own signature so
20
+ * the two never drift.
21
+ */
22
+ export type ResolveExternal = Parameters<typeof tgpu.resolve>[0][number];
23
+ /** Named resolve externals, as `tgpu.resolve` takes them. */
24
+ export type ResolveExternals = Record<string, ResolveExternal>;
25
+ /** Host-capability constraints a variant requires (Phase 3 scaffolding). */
26
+ export interface VariantRequirements {
27
+ /** Requires `texture_external` binding (browser camera/video fast path). */
28
+ textureExternal?: boolean;
29
+ /** Requires `shader-f16` feature (half-precision storage). */
30
+ f16Storage?: boolean;
31
+ }
32
+ /**
33
+ * Alternate `(layout, wgsl, entryPoint, samplers, workgroupSize)` for the
34
+ * same `ShaderModule`. Added in Phase 3 to handle distinct binding kinds
35
+ * (e.g. `texture_external` vs `texture_2d` for camera/video) without
36
+ * spawning duplicate module ids.
37
+ *
38
+ * Variants only appear when a concrete second binding kind / capability /
39
+ * quality split exists; modules without alternatives leave `variants`
40
+ * undefined and the Executor uses the module's primary layout.
41
+ */
42
+ export interface ShaderVariant {
43
+ /** Stable short name (`"external"`, `"f16"`). */
44
+ readonly name: string;
45
+ /** Binding kind the variant's main input expects, by input name. */
46
+ readonly bindingKinds?: Readonly<Record<string, BindingKind>>;
47
+ /** Required device capabilities. */
48
+ readonly requires?: VariantRequirements;
49
+ readonly layout: TgpuBindGroupLayout;
50
+ readonly wgsl: string;
51
+ readonly entryPoint: string;
52
+ readonly samplers?: Readonly<Record<string, GPUSamplerDescriptor>>;
53
+ readonly workgroupSize?: readonly [number, number, number];
54
+ }
55
+ /** Default key, within a module's layout, that holds the params uniform. */
56
+ export declare const DEFAULT_UNIFORM_BINDING = "params";
57
+ /**
58
+ * A registered, version-pinned GPU operation. Identity is `(id, version)`;
59
+ * renames/splits ship as a new version, never in-place.
60
+ */
61
+ export interface ShaderModule<Schema extends AnyWgslStruct = AnyWgslStruct> {
62
+ readonly id: string;
63
+ readonly version: number;
64
+ readonly surface: ShaderSurface;
65
+ readonly category: ShaderCategory;
66
+ readonly kind: ShaderKind;
67
+ /**
68
+ * Premul-invariant classification. Drives the static WGSL validator
69
+ * (load-time) and runtime debug pass (per-dispatch). See
70
+ * {@link LinearityMode}.
71
+ */
72
+ readonly linearity: LinearityMode;
73
+ /** TypeGPU uniform schema — source of truth for the WGSL struct + packer. */
74
+ readonly params: Schema;
75
+ readonly paramDefaults: Infer<Schema>;
76
+ readonly paramUi?: Readonly<Record<string, UiHint>>;
77
+ /** TypeGPU bind group layout; `root.unwrap(layout)` is the GPU layout. */
78
+ readonly layout: TgpuBindGroupLayout;
79
+ /** Layout key holding the params uniform (`""` if the module has none). */
80
+ readonly uniformBinding: string;
81
+ /** Sampler descriptors bundled with the module, keyed by layout binding. */
82
+ readonly samplers: Readonly<Record<string, GPUSamplerDescriptor>>;
83
+ /** Resolved WGSL (layout + uniform struct injected). */
84
+ readonly wgsl: string;
85
+ readonly entryPoint: string;
86
+ readonly workgroupSize: readonly [number, number, number];
87
+ readonly io: IOContract;
88
+ /**
89
+ * Alternate `(layout, wgsl, ...)` for distinct binding kinds or
90
+ * capabilities. Resolved by the Executor against bound inputs and
91
+ * `GPUContext.capabilities`. `undefined` ⇒ the module's primary
92
+ * `(layout, wgsl, entryPoint, samplers)` is the only variant.
93
+ */
94
+ readonly variants?: readonly ShaderVariant[];
95
+ }
96
+ /** Authoring input for {@link defineModule}. */
97
+ export interface ShaderModuleSpec<Schema extends AnyWgslStruct> {
98
+ id: string;
99
+ version: number;
100
+ surface: ShaderSurface;
101
+ category: ShaderCategory;
102
+ /** Defaults to `"fragment"` — the image-in/image-out default. */
103
+ kind?: ShaderKind;
104
+ /**
105
+ * Premul-invariant classification. Required — no default, so shader
106
+ * authors must classify their RGB math explicitly. See {@link LinearityMode}.
107
+ */
108
+ linearity: LinearityMode;
109
+ params: Schema;
110
+ paramDefaults: Infer<Schema>;
111
+ paramUi?: Record<string, UiHint>;
112
+ layout: TgpuBindGroupLayout;
113
+ /** Layout key for the params uniform. Defaults to `"params"`. */
114
+ uniformBinding?: string;
115
+ samplers?: Record<string, GPUSamplerDescriptor>;
116
+ /**
117
+ * Hand-written WGSL template referencing the layout (and any extra
118
+ * `externals`) by name. `tgpu.resolve` replaces those references with the
119
+ * generated bindings + struct definitions.
120
+ */
121
+ wgsl: string;
122
+ /** Extra resolve externals (shared snippets). The layout is auto-included. */
123
+ externals?: ResolveExternals;
124
+ /** Fragment entry point. Defaults to `"fs_main"` (fragment) / `"main"`. */
125
+ entryPoint?: string;
126
+ /** Compute workgroup size. Ignored for fragment modules. */
127
+ workgroupSize?: readonly [number, number, number];
128
+ io: IOContract;
129
+ /**
130
+ * Alternate-binding variants (Phase 3). Each variant gets its own resolved
131
+ * WGSL: `defineModule` runs `tgpu.resolve` over `variant.wgsl` with that
132
+ * variant's layout in scope, so the resolved string in the returned module
133
+ * already has variant-correct bindings injected.
134
+ */
135
+ variants?: ReadonlyArray<{
136
+ name: string;
137
+ bindingKinds?: Record<string, BindingKind>;
138
+ requires?: VariantRequirements;
139
+ layout: TgpuBindGroupLayout;
140
+ wgsl: string;
141
+ externals?: ResolveExternals;
142
+ entryPoint?: string;
143
+ samplers?: Record<string, GPUSamplerDescriptor>;
144
+ workgroupSize?: readonly [number, number, number];
145
+ /**
146
+ * Opt out of `tgpu.resolve` for this variant's WGSL. Needed for bindings
147
+ * TypeGPU's resolver can't inline (e.g. `texture_external`); the variant
148
+ * supplies fully-formed WGSL with hand-written `@group/@binding` decls.
149
+ * Defaults to `false` (the primary path runs resolve).
150
+ */
151
+ rawWgsl?: boolean;
152
+ }>;
153
+ }
154
+ /**
155
+ * Build a {@link ShaderModule}, resolving its WGSL against the typed layout
156
+ * at definition time. Resolution is device-free (pure string generation), so
157
+ * this runs at module load — failures surface before any GPU work.
158
+ */
159
+ export declare function defineModule<Schema extends AnyWgslStruct>(spec: ShaderModuleSpec<Schema>): ShaderModule<Schema>;
160
+ /** `(id, version)` rendered as a stable string key. */
161
+ export declare function moduleKey(id: string, version: number): string;
162
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,aAAa,EACb,cAAc,EACd,UAAU,EACV,aAAa,EACb,MAAM,EACP,MAAM,YAAY,CAAC;AAGpB;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAE/D,4E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written WGSL with a TypeGPU bind group layout, a
5
+ * TypeGPU `d.struct` uniform schema, sampler descriptors, and a declared I/O
6
+ * contract. There is no way to import "just the WGSL": the layout, the
7
+ * uniform packer, and the I/O contract travel with it so later phases never
8
+ * re-derive uniform layouts or bind group layouts by hand.
9
+ *
10
+ * WGSL stays hand-written; {@link defineModule} runs `tgpu.resolve(...)` to
11
+ * connect it to the typed layout (the TS-to-WGSL compiler is not adopted).
12
+ */
13
+ import tgpu from "typegpu";
14
+ import { validateWgslLinearity } from "./validate/wgslLinearity.js";
15
+ /** Default key, within a module's layout, that holds the params uniform. */
16
+ export const DEFAULT_UNIFORM_BINDING = "params";
17
+ /**
18
+ * Build a {@link ShaderModule}, resolving its WGSL against the typed layout
19
+ * at definition time. Resolution is device-free (pure string generation), so
20
+ * this runs at module load — failures surface before any GPU work.
21
+ */
22
+ export function defineModule(spec) {
23
+ if (!spec.id) {
24
+ throw new Error("defineModule: id is required");
25
+ }
26
+ if (!Number.isInteger(spec.version) || spec.version < 1) {
27
+ throw new Error(`defineModule(${spec.id}): version must be a positive integer`);
28
+ }
29
+ const kind = spec.kind ?? "fragment";
30
+ const wgsl = tgpu.resolve({
31
+ template: spec.wgsl,
32
+ externals: { layout: spec.layout, ...spec.externals },
33
+ names: "strict"
34
+ });
35
+ // Item 3 of the invariant-enforcement plan: static premul check against the
36
+ // declared `linearity` tag, run on the resolved WGSL so it sees the final
37
+ // bindings. Failures throw — a misclassified module never reaches the
38
+ // registry. `NODETOOL_GPU_VALIDATE=off` disables it for emergency hotfixes.
39
+ const linearityCheck = validateWgslLinearity({
40
+ id: spec.id,
41
+ linearity: spec.linearity,
42
+ wgsl,
43
+ inputs: spec.io.inputs
44
+ });
45
+ if (!linearityCheck.ok) {
46
+ throw new Error(`defineModule(${spec.id}): premul-invariant validation failed:\n - ${linearityCheck.violations.join("\n - ")}`);
47
+ }
48
+ const variants = spec.variants?.map((v) => {
49
+ const variantWgsl = v.rawWgsl
50
+ ? v.wgsl
51
+ : tgpu.resolve({
52
+ template: v.wgsl,
53
+ externals: { layout: v.layout, ...v.externals },
54
+ names: "strict"
55
+ });
56
+ const variantCheck = validateWgslLinearity({
57
+ id: `${spec.id}#${v.name}`,
58
+ linearity: spec.linearity,
59
+ wgsl: variantWgsl,
60
+ inputs: spec.io.inputs
61
+ });
62
+ if (!variantCheck.ok) {
63
+ throw new Error(`defineModule(${spec.id}, variant=${v.name}): premul-invariant validation failed:\n - ${variantCheck.violations.join("\n - ")}`);
64
+ }
65
+ return Object.freeze({
66
+ name: v.name,
67
+ bindingKinds: v.bindingKinds,
68
+ requires: v.requires,
69
+ layout: v.layout,
70
+ wgsl: variantWgsl,
71
+ entryPoint: v.entryPoint ?? (kind === "compute" ? "main" : "fs_main"),
72
+ samplers: v.samplers,
73
+ workgroupSize: v.workgroupSize
74
+ });
75
+ });
76
+ return Object.freeze({
77
+ id: spec.id,
78
+ version: spec.version,
79
+ surface: spec.surface,
80
+ category: spec.category,
81
+ kind,
82
+ linearity: spec.linearity,
83
+ params: spec.params,
84
+ paramDefaults: spec.paramDefaults,
85
+ paramUi: spec.paramUi,
86
+ layout: spec.layout,
87
+ uniformBinding: spec.uniformBinding ?? DEFAULT_UNIFORM_BINDING,
88
+ samplers: spec.samplers ?? {},
89
+ wgsl,
90
+ entryPoint: spec.entryPoint ?? (kind === "compute" ? "main" : "fs_main"),
91
+ workgroupSize: spec.workgroupSize ?? [1, 1, 1],
92
+ io: spec.io,
93
+ variants: variants ? Object.freeze(variants) : undefined
94
+ });
95
+ }
96
+ /** `(id, version)` rendered as a stable string key. */
97
+ export function moduleKey(id, version) {
98
+ return `${id}@${version}`;
99
+ }
100
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAY3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BA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AC,MAAM,CAAC;QACnB,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,IAAI;QACJ,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,uBAAuB;QAC9D,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;QAC7B,IAAI;QACJ,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACxE,aAAa,EAAE,IAAI,CAAC,aAAa,IAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAW;QACzD,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;KACzD,CAAC,CAAC;AACL,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,SAAS,CAAC,EAAU,EAAE,OAAe;IACnD,OAAO,GAAG,EAAE,IAAI,OAAO,EAAE,CAAC;AAC5B,CAAC"}
package/dist/node.d.ts ADDED
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @nodetool-ai/gpu/node — Node.js (Dawn) host adapter.
3
+ *
4
+ * Acquires a `GPUDevice` from the optional `webgpu` (Dawn) npm package and
5
+ * exposes the headless compositing path on top of it. Kept in its own entry
6
+ * so the native Dawn binding is only loaded when a Node consumer actually
7
+ * asks for server-side GPU work — the pure catalog (`.`), the pool (`./pool`),
8
+ * and the browser engine (`./webgpu`) never pull it in.
9
+ *
10
+ * WebGPU is required for this path; there is no silent CPU fallback. If Dawn
11
+ * is unavailable the device acquisition fails loud and the caller decides
12
+ * whether to fall back (e.g. to a Sharp-based node).
13
+ */
14
+ import { type GPUContext } from "./context.js";
15
+ import { compositeLayersHeadless, type HeadlessLayer, type HeadlessCompositeResult } from "./compositor/headless.js";
16
+ import type { LayerTransform2D } from "./compositor/transform.js";
17
+ /**
18
+ * Acquire a fresh `GPUDevice` from Dawn. Throws a clear error if the optional
19
+ * `webgpu` package is not installed or no adapter is available.
20
+ */
21
+ export declare function createNodeGPUDevice(): Promise<GPUDevice>;
22
+ /**
23
+ * Cached `GPUDevice` — acquiring a Dawn device is expensive, so a node that
24
+ * runs repeatedly reuses one across executions. A failed acquisition clears
25
+ * the cache so a later call can retry.
26
+ */
27
+ export declare function getNodeGPUDevice(): Promise<GPUDevice>;
28
+ /** Build a {@link GPUContext} backed by a Dawn device (for pool/Executor use). */
29
+ export declare function createNodeGPUContext(): Promise<GPUContext>;
30
+ /**
31
+ * Composite image layers on the GPU using the cached Dawn device. The
32
+ * convenience entry server-side nodes call: pass decoded straight-alpha RGBA
33
+ * layers, get back composited straight-alpha RGBA.
34
+ */
35
+ export declare function compositeImageLayers(layers: HeadlessLayer[], canvasWidth: number, canvasHeight: number): Promise<HeadlessCompositeResult>;
36
+ export { compositeLayersHeadless };
37
+ export type { HeadlessLayer, HeadlessCompositeResult, LayerTransform2D };
38
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAA8B,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EACL,uBAAuB,EACvB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AA+DlE;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,SAAS,CAAC,CAkC9D;AAkBD;;;;GAIG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,SAAS,CAAC,CAQ3D;AAED,kFAAkF;AAClF,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,UAAU,CAAC,CAEhE;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EAAE,EACvB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,uBAAuB,CAAC,CAGlC;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC;AACnC,YAAY,EAAE,aAAa,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,CAAC"}
package/dist/node.js ADDED
@@ -0,0 +1,140 @@
1
+ /**
2
+ * @nodetool-ai/gpu/node — Node.js (Dawn) host adapter.
3
+ *
4
+ * Acquires a `GPUDevice` from the optional `webgpu` (Dawn) npm package and
5
+ * exposes the headless compositing path on top of it. Kept in its own entry
6
+ * so the native Dawn binding is only loaded when a Node consumer actually
7
+ * asks for server-side GPU work — the pure catalog (`.`), the pool (`./pool`),
8
+ * and the browser engine (`./webgpu`) never pull it in.
9
+ *
10
+ * WebGPU is required for this path; there is no silent CPU fallback. If Dawn
11
+ * is unavailable the device acquisition fails loud and the caller decides
12
+ * whether to fall back (e.g. to a Sharp-based node).
13
+ */
14
+ import { createGPUContextFromDevice } from "./context.js";
15
+ import { compositeLayersHeadless } from "./compositor/headless.js";
16
+ let devicePromise = null;
17
+ /**
18
+ * Dawn instances we've created, kept alive for the process lifetime.
19
+ *
20
+ * dawn.node's `AsyncRunner` schedules `InstanceBase::ProcessEvents()` on the
21
+ * Node event loop (via setImmediate) for as long as the GPU instance lives.
22
+ * Only the resulting `GPUDevice` is cached below — the instance itself is a
23
+ * local in {@link createNodeGPUDevice}, so once it returns, the instance is
24
+ * unreferenced and eligible for GC. If a queued `ProcessEvents()` callback
25
+ * then fires after the instance is finalized, it locks a freed mutex and the
26
+ * process dies with `SIGSEGV` in `dawn::native::InstanceBase::ProcessEvents`
27
+ * (no JS error, just a hard crash). Retaining every instance prevents that.
28
+ *
29
+ * The cost of retaining is that **the Node event loop never drains again**: the
30
+ * re-scheduled `ProcessEvents()` stays an active handle for the process
31
+ * lifetime. A long-lived host (the server, the Electron backend) does not care.
32
+ * A one-shot host must call `process.exit()` once its work is done rather than
33
+ * setting `process.exitCode` and returning, or it hangs after printing its
34
+ * results — with the workflow having completed perfectly. `nodetool workflows
35
+ * run` and `scripts/run-workflow.mjs` both exit explicitly for this reason.
36
+ *
37
+ * There is deliberately no teardown export here: destroying the device does not
38
+ * stop the runner, and releasing the instance is the SIGSEGV above.
39
+ */
40
+ const retainedDawnInstances = [];
41
+ /**
42
+ * Install the WebGPU flag namespaces Dawn provides onto `globalThis`. In a
43
+ * browser these are ambient globals; under Node/Dawn they live on the module's
44
+ * `globals` export and must be assigned before anything references them. Both
45
+ * our own descriptors and typegpu's bind-group-layout builder read them as
46
+ * globals (e.g. `GPUShaderStage.FRAGMENT`), so a missing assignment surfaces as
47
+ * a `ReferenceError: GPUShaderStage is not defined` only once a layout is
48
+ * materialized. Existing globals are left untouched.
49
+ */
50
+ function installWebGPUGlobals(dawn) {
51
+ if (!dawn.globals)
52
+ return;
53
+ for (const [key, value] of Object.entries(dawn.globals)) {
54
+ if (!(key in globalThis)) {
55
+ Object.defineProperty(globalThis, key, {
56
+ value,
57
+ writable: true,
58
+ enumerable: true,
59
+ configurable: true
60
+ });
61
+ }
62
+ }
63
+ }
64
+ /**
65
+ * Acquire a fresh `GPUDevice` from Dawn. Throws a clear error if the optional
66
+ * `webgpu` package is not installed or no adapter is available.
67
+ */
68
+ export async function createNodeGPUDevice() {
69
+ // Variable specifier keeps bundlers (and tsc) from trying to resolve the
70
+ // native module at build time — it's an optional, runtime-only dependency.
71
+ const spec = "webgpu";
72
+ let dawn;
73
+ try {
74
+ // SAFETY: a dynamic import with a non-literal specifier is untyped, and
75
+ // `DawnModule` claims only `create` and `globals` — both optional, and
76
+ // both guarded at their use sites — so a `webgpu` build that ships
77
+ // neither fails on the explicit checks below rather than here.
78
+ dawn = (await import(/* @vite-ignore */ spec));
79
+ }
80
+ catch (err) {
81
+ throw new Error("Node WebGPU support requires the optional 'webgpu' (Dawn) package. " +
82
+ "Install it with `npm install webgpu`.", { cause: err });
83
+ }
84
+ installWebGPUGlobals(dawn);
85
+ const gpu = dawn.create?.([]);
86
+ if (!gpu) {
87
+ throw new Error("Failed to create a Dawn GPU instance (webgpu.create)");
88
+ }
89
+ // Keep the instance alive: its AsyncRunner keeps scheduling ProcessEvents()
90
+ // on the event loop, which segfaults if the instance is GC'd out from under
91
+ // it (see retainedDawnInstances).
92
+ retainedDawnInstances.push(gpu);
93
+ const adapter = await gpu.requestAdapter();
94
+ if (!adapter) {
95
+ throw new Error("No WebGPU adapter available (Node/Dawn). " + adapterHelpForPlatform());
96
+ }
97
+ return adapter.requestDevice();
98
+ }
99
+ /**
100
+ * Dawn reaches the GPU through a platform driver and ships no software
101
+ * fallback, so "no adapter" almost always means a missing driver rather than a
102
+ * missing GPU. On Linux that is a Vulkan ICD: with none installed the loader
103
+ * fails `vkCreateInstance` with `VK_ERROR_INCOMPATIBLE_DRIVER`, which surfaces
104
+ * here as a null adapter and says nothing about the cause. Name the fix.
105
+ */
106
+ function adapterHelpForPlatform() {
107
+ return ("On headless Linux this usually means no Vulkan driver (ICD) is installed — " +
108
+ "Dawn has no software fallback of its own. Install a software rasterizer " +
109
+ "with `apt-get install mesa-vulkan-drivers` (lavapipe), or point the loader " +
110
+ "at an existing one with VK_DRIVER_FILES=/path/to/icd.json.");
111
+ }
112
+ /**
113
+ * Cached `GPUDevice` — acquiring a Dawn device is expensive, so a node that
114
+ * runs repeatedly reuses one across executions. A failed acquisition clears
115
+ * the cache so a later call can retry.
116
+ */
117
+ export async function getNodeGPUDevice() {
118
+ if (!devicePromise) {
119
+ devicePromise = createNodeGPUDevice().catch((err) => {
120
+ devicePromise = null;
121
+ throw err;
122
+ });
123
+ }
124
+ return devicePromise;
125
+ }
126
+ /** Build a {@link GPUContext} backed by a Dawn device (for pool/Executor use). */
127
+ export async function createNodeGPUContext() {
128
+ return createGPUContextFromDevice(await getNodeGPUDevice());
129
+ }
130
+ /**
131
+ * Composite image layers on the GPU using the cached Dawn device. The
132
+ * convenience entry server-side nodes call: pass decoded straight-alpha RGBA
133
+ * layers, get back composited straight-alpha RGBA.
134
+ */
135
+ export async function compositeImageLayers(layers, canvasWidth, canvasHeight) {
136
+ const device = await getNodeGPUDevice();
137
+ return compositeLayersHeadless(device, layers, canvasWidth, canvasHeight);
138
+ }
139
+ export { compositeLayersHeadless };
140
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,0BAA0B,EAAmB,MAAM,cAAc,CAAC;AAC3E,OAAO,EACL,uBAAuB,EAGxB,MAAM,0BAA0B,CAAC;AAclC,IAAI,aAAa,GAA8B,IAAI,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,qBAAqB,GAAU,EAAE,CAAC;AAExC;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAAC,IAAgB;IAC5C,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO;IAC1B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACxD,IAAI,CAAC,CAAC,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,GAAG,EAAE;gBACrC,KAAK;gBACL,QAAQ,EAAE,IAAI;gBACd,UAAU,EAAE,IAAI;gBAChB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AAU,gBAAgB;IACpC,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,aAAa,GAAG,mBAAmB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YAClD,aAAa,GAAG,IAAI,CAAC;YACrB,MAAM,GAAG,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,OAAO,0BAA0B,CAAC,MAAM,gBAAgB,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAuB,EACvB,WAAmB,EACnB,YAAoB;IAEpB,MAAM,MAAM,GAAG,MAAM,gBAAgB,EAAE,CAAC;IACxC,OAAO,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;AAC5E,CAAC;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
package/dist/pool.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @nodetool-ai/gpu/pool — TypeGPU-backed shader pool (Phase 1+).
3
+ *
4
+ * The shared GPU operation catalog with a tiny runtime: `ShaderModule`
5
+ * (WGSL + typed bind group layout + typed uniform schema + sampler config +
6
+ * I/O contract), `LabeledTexture`, the `GPUContext` adapter, the registry,
7
+ * and the small `Executor`. From Phase 3 the catalog also exports
8
+ * `RecipeModule` + `RecipeRunner` for multi-pass operations. All TypeGPU-backed.
9
+ *
10
+ * Kept out of the package's pure root so that Node consumers of the blend
11
+ * catalog don't pull in TypeGPU. This entry is device-agnostic — the same
12
+ * module code runs against browser, Electron, and Node.js Dawn devices. The
13
+ * `navigator.gpu` adapter (`createBrowserGPUContext`) lives behind `./webgpu`.
14
+ */
15
+ export * from "./types.js";
16
+ export * from "./module.js";
17
+ export * from "./texture.js";
18
+ export * from "./registry.js";
19
+ export * from "./executor.js";
20
+ export * from "./recipe.js";
21
+ export * from "./fullscreenQuad.js";
22
+ export { consumePremulDebugWarnings, isPremulDebugEnabled, setPremulDebugEnabled, resetPremulDebugCache } from "./debug/premulValidator.js";
23
+ export type { DebugViolation, DebugReadback, DebugSink, EncodeValidationArgs } from "./debug/premulValidator.js";
24
+ export { ceilToBucket, makeScratchPool, makeUniformRing, createGPUContextFromDevice } from "./context.js";
25
+ export type { GPUContext, GPUCapabilities, PipelineCache, CachedPipeline, ScratchPool, ScratchSpec, UniformRing } from "./context.js";
26
+ export { ALL_SHADERS, ALL_RECIPES, ALL_CATALOG, passthroughV1, colorGradeV1, colorInvertV1, colorBrightnessContrastV1, colorHsbV1, colorExposureV1, colorPosterizeV1, colorCubeLutV1, colorChannelSplitV1, colorChannelShuffleV1, colorChannelMergeV1, colorGrayscaleV1, colorSolarizeV1, colorColorBalanceV1, colorExposureToneV1, colorLiftGammaGainV1, colorCdlV1, colorCurvesV1, colorHslAdjustV1, colorSplitToningV1, colorFilmLookV1, colorLevelsV1, blurGaussianV1, sharpenUnsharpMaskV1, vignetteV1, filtersGrainV1, filtersPixelateV1, filtersVisualFxV1, filtersThresholdV1, filtersConvolve3x3V1, filtersGlowV1, filtersBlurSeparableV1, chromaKeyV1, keyerLumaKeyV1, maskApplyV1, maskFromImageV1, maskInvertV1, sourcesSolidV1, sourcesLinearGradientV1, sourcesCheckerboardV1, sourcesRadialGradientV1, sourcesAngularGradientV1, sourcesDiamondGradientV1, sourcesGaussianNoiseV1, mixerAddV1, mixerColorOverlayV1, mixerOutlineV1, mixerShadowComposeV1, mixerDropShadowV1, mixerOverV1, transformMirrorV1, transformOffsetV1, transformCropV1, transformPadV1, transformTileV1, transformResizeV1, transformRotate90V1, transformAffineV1, transformCornerPinV1, transformPolarRemapV1, transformDisplaceV1, transformSpherizeV1, alphaStraightToPremulV1, alphaPremulToStraightV1 } from "./shaders/index.js";
27
+ import { ShaderRegistry } from "./registry.js";
28
+ /** A {@link ShaderRegistry} preloaded with every catalog module (shaders + recipes). */
29
+ export declare function createDefaultRegistry(): ShaderRegistry;
30
+ //# sourceMappingURL=pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,cAAc,EACd,aAAa,EACb,SAAS,EACT,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,0BAA0B,EAC3B,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,UAAU,EACV,eAAe,EACf,aAAa,EACb,cAAc,EACd,WAAW,EACX,WAAW,EACX,WAAW,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,YAAY,EACZ,aAAa,EACb,yBAAyB,EACzB,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,WAAW,EACX,cAAc,EACd,WAAW,EACX,eAAe,EACf,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,wFAAwF;AACxF,wBAAgB,qBAAqB,IAAI,cAAc,CAItD"}
package/dist/pool.js ADDED
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @nodetool-ai/gpu/pool — TypeGPU-backed shader pool (Phase 1+).
3
+ *
4
+ * The shared GPU operation catalog with a tiny runtime: `ShaderModule`
5
+ * (WGSL + typed bind group layout + typed uniform schema + sampler config +
6
+ * I/O contract), `LabeledTexture`, the `GPUContext` adapter, the registry,
7
+ * and the small `Executor`. From Phase 3 the catalog also exports
8
+ * `RecipeModule` + `RecipeRunner` for multi-pass operations. All TypeGPU-backed.
9
+ *
10
+ * Kept out of the package's pure root so that Node consumers of the blend
11
+ * catalog don't pull in TypeGPU. This entry is device-agnostic — the same
12
+ * module code runs against browser, Electron, and Node.js Dawn devices. The
13
+ * `navigator.gpu` adapter (`createBrowserGPUContext`) lives behind `./webgpu`.
14
+ */
15
+ export * from "./types.js";
16
+ export * from "./module.js";
17
+ export * from "./texture.js";
18
+ export * from "./registry.js";
19
+ export * from "./executor.js";
20
+ export * from "./recipe.js";
21
+ export * from "./fullscreenQuad.js";
22
+ export { consumePremulDebugWarnings, isPremulDebugEnabled, setPremulDebugEnabled, resetPremulDebugCache } from "./debug/premulValidator.js";
23
+ export { ceilToBucket, makeScratchPool, makeUniformRing, createGPUContextFromDevice } from "./context.js";
24
+ export { ALL_SHADERS, ALL_RECIPES, ALL_CATALOG, passthroughV1, colorGradeV1, colorInvertV1, colorBrightnessContrastV1, colorHsbV1, colorExposureV1, colorPosterizeV1, colorCubeLutV1, colorChannelSplitV1, colorChannelShuffleV1, colorChannelMergeV1, colorGrayscaleV1, colorSolarizeV1, colorColorBalanceV1, colorExposureToneV1, colorLiftGammaGainV1, colorCdlV1, colorCurvesV1, colorHslAdjustV1, colorSplitToningV1, colorFilmLookV1, colorLevelsV1, blurGaussianV1, sharpenUnsharpMaskV1, vignetteV1, filtersGrainV1, filtersPixelateV1, filtersVisualFxV1, filtersThresholdV1, filtersConvolve3x3V1, filtersGlowV1, filtersBlurSeparableV1, chromaKeyV1, keyerLumaKeyV1, maskApplyV1, maskFromImageV1, maskInvertV1, sourcesSolidV1, sourcesLinearGradientV1, sourcesCheckerboardV1, sourcesRadialGradientV1, sourcesAngularGradientV1, sourcesDiamondGradientV1, sourcesGaussianNoiseV1, mixerAddV1, mixerColorOverlayV1, mixerOutlineV1, mixerShadowComposeV1, mixerDropShadowV1, mixerOverV1, transformMirrorV1, transformOffsetV1, transformCropV1, transformPadV1, transformTileV1, transformResizeV1, transformRotate90V1, transformAffineV1, transformCornerPinV1, transformPolarRemapV1, transformDisplaceV1, transformSpherizeV1, alphaStraightToPremulV1, alphaPremulToStraightV1 } from "./shaders/index.js";
25
+ import { ShaderRegistry } from "./registry.js";
26
+ import { ALL_CATALOG } from "./shaders/index.js";
27
+ /** A {@link ShaderRegistry} preloaded with every catalog module (shaders + recipes). */
28
+ export function createDefaultRegistry() {
29
+ const registry = new ShaderRegistry();
30
+ registry.registerAll(ALL_CATALOG);
31
+ return registry;
32
+ }
33
+ //# sourceMappingURL=pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool.js","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":"AAAA;;;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