@field/cascade 0.11.0 → 0.13.0

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 (220) hide show
  1. package/AGENTS.md +8 -5
  2. package/ARCHITECTURE.md +5 -4
  3. package/CHANGELOG.md +245 -0
  4. package/README.md +1 -1
  5. package/dist/assets/AgentPanel-1JugFjE4.css +1 -0
  6. package/dist/assets/AgentPanel-BDL5MddA.js +5 -0
  7. package/dist/assets/{CodeEditor-4O7FQ__R.js → CodeEditor-C-xYG-Wn.js} +120 -120
  8. package/dist/assets/CodePanel-CtXd50m6.js +2 -0
  9. package/dist/assets/CookInfoPanel-B3NMhKJF.css +1 -0
  10. package/dist/assets/CookInfoPanel-DG4_TRsX.js +2 -0
  11. package/dist/assets/CustomNodeDialog-CHfZUs-r.js +1 -0
  12. package/dist/assets/DefinitionNode-CaRTXQ_b.js +1 -0
  13. package/dist/assets/DefinitionPanel-C3CxZY9r.js +1 -0
  14. package/dist/assets/DefinitionPanel-VNLnAiQD.css +1 -0
  15. package/dist/assets/OpenGraphDialog-BLdr6k_q.js +1 -0
  16. package/dist/assets/ProjectSettings-ZnvmIAir.js +2 -0
  17. package/dist/assets/{SettingsDialog-Bz8JxISH.js → SettingsDialog-CBX3Wa87.js} +1 -1
  18. package/dist/assets/TimelinePanel-CDeR0arY.css +1 -0
  19. package/dist/assets/TimelinePanel-CWgnFH1e.js +1 -0
  20. package/dist/assets/{VersionHistoryDialog-D5Z0nJ5-.js → VersionHistoryDialog-BOSoW1R-.js} +1 -1
  21. package/dist/assets/assert-BO2_erPD.js +1 -0
  22. package/dist/assets/assert-hvykGCnP.js +1 -0
  23. package/dist/assets/builder-BmBKcDix.js +1 -0
  24. package/dist/assets/camera-DFF7YA3F.js +1 -0
  25. package/dist/assets/checks-DAvyO9Gf.js +1 -0
  26. package/dist/assets/contactSheet-N1NcaWxw.js +2 -0
  27. package/dist/assets/{core-Yqi0Ni61.js → core-DB-MkGjj.js} +3 -4
  28. package/dist/assets/coreTypes-DtnDATZ7.js +1 -0
  29. package/dist/assets/{cssMode-CxUzc4vp.js → cssMode-DPVckSOc.js} +1 -1
  30. package/dist/assets/definitions-B227e7f_.js +1 -0
  31. package/dist/assets/definitions-D0WOUJd7.js +1 -0
  32. package/dist/assets/{editor.api-BNFb25CX.js → editor.api-Dkutg_Z1.js} +1 -1
  33. package/dist/assets/expressions-X-Z-GrgW.js +5 -0
  34. package/dist/assets/file-DAL6IfjV.js +1 -0
  35. package/dist/assets/filters-D3k1LRMa.js +1 -0
  36. package/dist/assets/{freemarker2-0ZDnWxeM.js → freemarker2-CLiLKk3B.js} +1 -1
  37. package/dist/assets/generators-BhDxRAFC.js +1 -0
  38. package/dist/assets/geo-BsMImJIJ.js +1 -0
  39. package/dist/assets/geo-C4YngDob.js +2 -0
  40. package/dist/assets/{handlebars-Cy18MoaD.js → handlebars-CcD3aMeL.js} +1 -1
  41. package/dist/assets/{html-B-2Dx7nq.js → html-DvZWGfqb.js} +1 -1
  42. package/dist/assets/{htmlMode-DUAc9B_d.js → htmlMode-DUD3VaoN.js} +1 -1
  43. package/dist/assets/image-0SfH-snh.js +1 -0
  44. package/dist/assets/image-Ck-RdGU4.js +2 -0
  45. package/dist/assets/index-BWnrmIB9.js +137 -0
  46. package/dist/assets/index-DIaxEONI.css +1 -0
  47. package/dist/assets/io-BGmt2g0D.js +1 -0
  48. package/dist/assets/{javascript-DeQsDqP5.js → javascript-Cap2ahgh.js} +1 -1
  49. package/dist/assets/{jsonMode-BiFwJVSk.js → jsonMode-B0uLjp9C.js} +1 -1
  50. package/dist/assets/{liquid-BLoHH68a.js → liquid-CnxwhfLn.js} +1 -1
  51. package/dist/assets/{lspLanguageFeatures-CNFgm1Kv.js → lspLanguageFeatures-Dn9hlKX6.js} +1 -1
  52. package/dist/assets/math-GeULS-sk.js +1 -0
  53. package/dist/assets/{mdx-CFXQVNfs.js → mdx-BV3jbrVa.js} +1 -1
  54. package/dist/assets/pop-KMF_qloi.js +1 -0
  55. package/dist/assets/preload-helper-Czpn1I53.js +1 -0
  56. package/dist/assets/{python-Cf7S7p2E.js → python-CGyFk4XK.js} +1 -1
  57. package/dist/assets/{razor-CMHBcG-g.js → razor-CQfzX3-N.js} +1 -1
  58. package/dist/assets/remap-5SjXQU-q.js +1 -0
  59. package/dist/assets/renderMarkdown-ork0Oir7.js +67 -0
  60. package/dist/assets/studioImages-CAyH-0Pl.js +1 -0
  61. package/dist/assets/text-ZpX7qNkx.js +2 -0
  62. package/dist/assets/time-P_OiBhcf.js +1 -0
  63. package/dist/assets/{tsMode-BEih0GDj.js → tsMode-BOeXzO9H.js} +1 -1
  64. package/dist/assets/{typescript-COEKYD_a.js → typescript-J1SnE_Tu.js} +1 -1
  65. package/dist/assets/{workers-BNhAhMNn.js → workers-CYwwTiVF.js} +1 -1
  66. package/dist/assets/{xml-CPiMpnPl.js → xml-DnPRNzK9.js} +1 -1
  67. package/dist/assets/{yaml-Bgp1ITLR.js → yaml-BmmYBNa9.js} +1 -1
  68. package/dist/cli/DefinitionNode-P7AA4TAU.js +15 -0
  69. package/dist/cli/{Graph-ZJJTRQTM.js → Graph-OB6EWSGL.js} +12 -12
  70. package/dist/cli/assert-GROGQNCQ.js +25 -0
  71. package/dist/cli/checks-3WB44XBL.js +189 -0
  72. package/dist/cli/{chunk-3JTJHF7V.js → chunk-2L34ERS2.js} +4 -4
  73. package/dist/cli/chunk-53LGFPWX.js +138 -0
  74. package/dist/cli/chunk-5ORUQ6ES.js +267 -0
  75. package/dist/cli/{chunk-YAT5Y25U.js → chunk-7QE2ZNSN.js} +3 -3
  76. package/dist/cli/{chunk-SGJAET2L.js → chunk-BPODRH52.js} +8 -4
  77. package/dist/cli/{chunk-XWDSKG7N.js → chunk-BZ63XQ3I.js} +2 -2
  78. package/dist/cli/{chunk-FCDXJ6EK.js → chunk-CTPLRSWF.js} +2 -13
  79. package/dist/cli/{chunk-WIH4TEIS.js → chunk-EZRWJ4G2.js} +1 -1
  80. package/dist/cli/{chunk-BIJO5OFS.js → chunk-FWMSGKEH.js} +1 -1
  81. package/dist/cli/{chunk-POMMNKZZ.js → chunk-G23A2BZZ.js} +38 -5
  82. package/dist/cli/{chunk-35D343DC.js → chunk-GRIN2DDP.js} +19 -1
  83. package/dist/cli/{chunk-WKURDVYP.js → chunk-JEW5MPGI.js} +28 -331
  84. package/dist/cli/chunk-JVOCK5W4.js +83 -0
  85. package/dist/cli/chunk-KBGUO27Q.js +15 -0
  86. package/dist/cli/{chunk-GFS6W3C5.js → chunk-L6B6FUQP.js} +54 -32
  87. package/dist/cli/chunk-LTXWBXOM.js +438 -0
  88. package/dist/cli/chunk-MI5JLQYA.js +220 -0
  89. package/dist/cli/{chunk-A4OAMOZH.js → chunk-NJFMDXHR.js} +13 -3
  90. package/dist/cli/{chunk-DUIUFVU2.js → chunk-OBZAP3GG.js} +49 -23
  91. package/dist/cli/chunk-QAGATJGE.js +336 -0
  92. package/dist/cli/{chunk-EUIAC3U3.js → chunk-QKL7CCRS.js} +966 -132
  93. package/dist/cli/{chunk-RLCAJBVR.js → chunk-TJW67QSI.js} +8 -7
  94. package/dist/cli/{chunk-RQZ4SX5R.js → chunk-W5PJ5RMP.js} +156 -84
  95. package/dist/cli/chunk-W7OUAT7J.js +122 -0
  96. package/dist/cli/chunk-WGKPJZDY.js +364 -0
  97. package/dist/cli/{chunk-D6BUOHUG.js → chunk-X4WKAOQP.js} +4 -4
  98. package/dist/cli/{chunk-VVGSLVSF.js → chunk-X566FWBV.js} +6 -1
  99. package/dist/cli/chunk-YH637PDL.js +317 -0
  100. package/dist/cli/chunk-ZSCUZE6I.js +112 -0
  101. package/dist/cli/{cliCommands-UQSFGEHF.js → cliCommands-XVFRD7CF.js} +23 -17
  102. package/dist/cli/{commands-Q23M26QM.js → commands-M2XLTPTZ.js} +129 -47
  103. package/dist/cli/contactSheet-2PQVRUFW.js +11 -0
  104. package/dist/cli/{definitions-HF2FTHYU.js → definitions-BPOPW52L.js} +7 -7
  105. package/dist/cli/{doctorCommand-B7BPQMN6.js → doctorCommand-RAEI7GVY.js} +36 -6
  106. package/dist/cli/{edit-JHCPTQFT.js → edit-S5KEQ5RA.js} +3 -3
  107. package/dist/cli/editorCommands-5BBG4S6V.js +41 -0
  108. package/dist/cli/{encode-HAUZTYPT.js → encode-ICPEPMH5.js} +2 -2
  109. package/dist/cli/file-3HTQHPYQ.js +41 -0
  110. package/dist/cli/filters-6ODFWYK4.js +379 -0
  111. package/dist/cli/generators-YU7GB4MD.js +210 -0
  112. package/dist/cli/{geo-4RNK3QVN.js → geo-6ZPGKZRU.js} +7 -7
  113. package/dist/cli/{graphCommands-6BMAKGQE.js → graphCommands-MULQ7VD2.js} +4 -4
  114. package/dist/cli/{graphFile-VPSQ6OF7.js → graphFile-CITF36ZM.js} +25 -19
  115. package/dist/cli/{headlessCanvas-5XLDZT7M.js → headlessCanvas-ENRHC7GS.js} +3 -2
  116. package/dist/cli/{helpCommand-3VRE3KVO.js → helpCommand-X2QDANM3.js} +9 -7
  117. package/dist/cli/image-TXELZZK5.js +55 -0
  118. package/dist/cli/index.js +14 -14
  119. package/dist/cli/{math-ZRMLKU2D.js → math-RSYRQ3C6.js} +5 -5
  120. package/dist/cli/{mcp-ZLEEMYGF.js → mcp-YRIGRLYQ.js} +4 -4
  121. package/dist/cli/{parity-KINARCP2.js → parity-3N3HTKWX.js} +42 -36
  122. package/dist/cli/{pop-USDFXB7H.js → pop-B7SIIYKN.js} +5 -5
  123. package/dist/cli/project-SJF5ZF3F.js +12 -0
  124. package/dist/cli/{projectDefinition-DMTZN2NE.js → projectDefinition-F3D7UIHJ.js} +8 -8
  125. package/dist/cli/{projectRuntime-Z5PJOH47.js → projectRuntime-NY4XMDFH.js} +19 -12
  126. package/dist/cli/registerStandardNodes-BXJCB6E4.js +744 -0
  127. package/dist/cli/{render-YURAPPUI.js → render-Y23W6MY6.js} +29 -22
  128. package/dist/cli/{runCommand-PI764LEG.js → runCommand-XOG7AVC5.js} +3 -3
  129. package/dist/cli/runner-DNJO5WO2.js +43 -0
  130. package/dist/cli/runtime/image.ts +27 -2
  131. package/dist/cli/runtime/io.ts +78 -0
  132. package/dist/cli/share-B7HTCOJX.js +166 -0
  133. package/dist/cli/stageCache-TY2BFZJR.js +15 -0
  134. package/dist/cli/{stageRunner-KUNIMQKJ.js → stageRunner-KY2EJP7X.js} +2 -2
  135. package/dist/cli/text-MB3EKR4H.js +126 -0
  136. package/dist/cli/{verbs-RCE3K4VQ.js → verbs-PI2JH5FI.js} +2 -2
  137. package/dist/cli/webBuild-2K4COCGY.js +44 -0
  138. package/dist/contracts/capabilities.d.ts +39 -1
  139. package/dist/contracts/color.d.ts +8 -0
  140. package/dist/contracts/color.js +23 -0
  141. package/dist/contracts/definition.d.ts +10 -0
  142. package/dist/contracts/schema.d.ts +1 -1
  143. package/dist/contracts/schema.js +1 -0
  144. package/dist/contracts/validate.js +11 -1
  145. package/dist/contracts/values.d.ts +24 -0
  146. package/dist/image.d.ts +15 -0
  147. package/dist/image.js +36 -2
  148. package/dist/index.html +8 -2
  149. package/dist/io.d.ts +29 -0
  150. package/dist/io.js +40 -0
  151. package/dist/player/app.js +11 -7
  152. package/dist/player/editor.js +3 -2
  153. package/dist/player/editorEngine.js +3 -2
  154. package/dist/player/embed.js +2 -0
  155. package/dist/player/types.d.ts +6 -0
  156. package/dist/runtime/builtins/assert/checks.d.ts +18 -0
  157. package/dist/runtime/builtins/assert/checks.js +207 -0
  158. package/dist/runtime/builtins/assert/definitions.d.ts +130 -0
  159. package/dist/runtime/builtins/assert/definitions.js +54 -0
  160. package/dist/runtime/builtins/assert/index.d.ts +152 -0
  161. package/dist/runtime/builtins/assert/index.js +36 -0
  162. package/dist/runtime/builtins/image/contactSheet.d.ts +3 -165
  163. package/dist/runtime/builtins/image/contactSheet.js +0 -49
  164. package/dist/runtime/builtins/image/definitions.d.ts +950 -0
  165. package/dist/runtime/builtins/image/definitions.js +343 -0
  166. package/dist/runtime/builtins/image/file.d.ts +8 -0
  167. package/dist/runtime/builtins/image/file.js +37 -0
  168. package/dist/runtime/builtins/image/filters.d.ts +8 -0
  169. package/dist/runtime/builtins/image/filters.js +394 -0
  170. package/dist/runtime/builtins/image/generators.d.ts +7 -0
  171. package/dist/runtime/builtins/image/generators.js +144 -0
  172. package/dist/runtime/builtins/image/index.d.ts +947 -4
  173. package/dist/runtime/builtins/image/index.js +41 -6
  174. package/dist/runtime/builtins/image/io.d.ts +100 -0
  175. package/dist/runtime/builtins/image/io.js +142 -0
  176. package/dist/runtime/builtins/image/planar.d.ts +55 -0
  177. package/dist/runtime/builtins/image/planar.js +274 -0
  178. package/dist/runtime/builtins/image/simplex.d.ts +22 -0
  179. package/dist/runtime/builtins/image/simplex.js +92 -0
  180. package/dist/runtime/builtins/image/text.d.ts +4 -0
  181. package/dist/runtime/builtins/image/text.js +141 -0
  182. package/dist/runtime/builtins/index.d.ts +3 -0
  183. package/dist/runtime/builtins/index.js +7 -0
  184. package/dist/runtime/definition/architecture.js +89 -0
  185. package/dist/runtime/gpu.d.ts +25 -0
  186. package/dist/runtime/gpu.js +40 -0
  187. package/dist/runtime/runtime.d.ts +2 -0
  188. package/dist/runtime/runtime.js +268 -44
  189. package/dist/runtime/types.d.ts +30 -0
  190. package/doc/CLI_REFERENCE.md +21 -3
  191. package/doc/EDITOR_EXPORT.md +26 -0
  192. package/doc/MCP.md +2 -1
  193. package/doc/NODE_REFERENCE.md +286 -14
  194. package/doc/PROJECT_AUTHORING.md +158 -4
  195. package/doc/WEB_PLAYER.md +9 -1
  196. package/package.json +4 -1
  197. package/dist/assets/CodePanel-BU-autmq.js +0 -2
  198. package/dist/assets/CustomNodeDialog-BRpDfOV5.js +0 -1
  199. package/dist/assets/OpenGraphDialog-BwbRlC0X.js +0 -1
  200. package/dist/assets/ProjectSettings-DLOXLxcA.js +0 -2
  201. package/dist/assets/definitions-GreEMXLV.js +0 -1
  202. package/dist/assets/geo-u0n_jOsD.js +0 -1
  203. package/dist/assets/image-cAa-Nu9O.js +0 -2062
  204. package/dist/assets/index-5ZtDAuy2.js +0 -220
  205. package/dist/assets/index-7vae6YFC.css +0 -1
  206. package/dist/assets/math-DioIQOPJ.js +0 -1
  207. package/dist/assets/pop-DC_TQG9t.js +0 -1
  208. package/dist/cli/chunk-36P5K3SD.js +0 -631
  209. package/dist/cli/chunk-4UDFYF5G.js +0 -132
  210. package/dist/cli/chunk-53NMBJAO.js +0 -35
  211. package/dist/cli/chunk-MIIEFUGG.js +0 -623
  212. package/dist/cli/chunk-QBBKRNGY.js +0 -90
  213. package/dist/cli/chunk-WPUDGEFY.js +0 -20
  214. package/dist/cli/editorCommands-UIF5YLUZ.js +0 -33
  215. package/dist/cli/project-K3QIPGBB.js +0 -12
  216. package/dist/cli/registerStandardNodes-S2VLMF6J.js +0 -3081
  217. package/dist/cli/runner-RA6UKEPD.js +0 -37
  218. package/dist/cli/webBuild-GT4PZT5D.js +0 -37
  219. package/dist/runtime/builtins/headless.d.ts +0 -19
  220. package/dist/runtime/builtins/headless.js +0 -25
@@ -1 +1 @@
1
- import{c as e}from"./editor.api-BNFb25CX.js";import"./CodeEditor-4O7FQ__R.js";function t(e,t){let n=globalThis.MonacoEnvironment;if(n?.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(e,t)}catch(e){console.error(e);return}try{return globalThis.trustedTypes?.createPolicy(e,t)}catch(e){console.error(e);return}}var n=typeof self==`object`&&self.constructor&&self.constructor.name===`DedicatedWorkerGlobalScope`&&globalThis.workerttPolicy!==void 0?globalThis.workerttPolicy:t(`defaultWorkerFactory`,{createScriptURL:e=>e});function r(e){let t=e.label,r=globalThis.MonacoEnvironment;if(r){if(typeof r.getWorker==`function`)return r.getWorker(`workerMain.js`,t);if(typeof r.getWorkerUrl==`function`){let e=r.getWorkerUrl(`workerMain.js`,t);return new Worker(n?n.createScriptURL(e):e,{name:t,type:`module`})}}if(e.createWorker)return e.createWorker();throw Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`)}function i(t){let n=Promise.resolve(r({label:t.label??`monaco-editor-worker`,moduleId:t.moduleId,createWorker:t.createWorker})).then(e=>(e.postMessage(`ignore`),e.postMessage(t.createData),e));return e.createWebWorker({worker:n,host:t.host,keepIdleModels:t.keepIdleModels})}export{i as t};
1
+ import{c as e}from"./editor.api-Dkutg_Z1.js";import"./CodeEditor-C-xYG-Wn.js";function t(e,t){let n=globalThis.MonacoEnvironment;if(n?.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(e,t)}catch(e){console.error(e);return}try{return globalThis.trustedTypes?.createPolicy(e,t)}catch(e){console.error(e);return}}var n=typeof self==`object`&&self.constructor&&self.constructor.name===`DedicatedWorkerGlobalScope`&&globalThis.workerttPolicy!==void 0?globalThis.workerttPolicy:t(`defaultWorkerFactory`,{createScriptURL:e=>e});function r(e){let t=e.label,r=globalThis.MonacoEnvironment;if(r){if(typeof r.getWorker==`function`)return r.getWorker(`workerMain.js`,t);if(typeof r.getWorkerUrl==`function`){let e=r.getWorkerUrl(`workerMain.js`,t);return new Worker(n?n.createScriptURL(e):e,{name:t,type:`module`})}}if(e.createWorker)return e.createWorker();throw Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`)}function i(t){let n=Promise.resolve(r({label:t.label??`monaco-editor-worker`,moduleId:t.moduleId,createWorker:t.createWorker})).then(e=>(e.postMessage(`ignore`),e.postMessage(t.createData),e));return e.createWebWorker({worker:n,host:t.host,keepIdleModels:t.keepIdleModels})}export{i as t};
@@ -1 +1 @@
1
- import{l as e}from"./editor.api-BNFb25CX.js";var t={comments:{blockComment:[`<!--`,`-->`]},brackets:[[`<`,`>`]],autoClosingPairs:[{open:`<`,close:`>`},{open:`'`,close:`'`},{open:`"`,close:`"`}],surroundingPairs:[{open:`<`,close:`>`},{open:`'`,close:`'`},{open:`"`,close:`"`}],onEnterRules:[{beforeText:RegExp(`<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),action:{indentAction:e.IndentAction.Indent}}]},n={defaultToken:``,tokenPostfix:`.xml`,ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,``],{include:`@whitespace`},[/(<)(@qualifiedName)/,[{token:`delimiter`},{token:`tag`,next:`@tag`}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:`delimiter`},{token:`tag`},``,{token:`delimiter`}]],[/(<\?)(@qualifiedName)/,[{token:`delimiter`},{token:`metatag`,next:`@tag`}]],[/(<\!)(@qualifiedName)/,[{token:`delimiter`},{token:`metatag`,next:`@tag`}]],[/<\!\[CDATA\[/,{token:`delimiter.cdata`,next:`@cdata`}],[/&\w+;/,`string.escape`]],cdata:[[/[^\]]+/,``],[/\]\]>/,{token:`delimiter.cdata`,next:`@pop`}],[/\]/,``]],tag:[[/[ \t\r\n]+/,``],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,[`attribute.name`,``,`attribute.value`]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,[`attribute.name`,``,`attribute.value`]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,[`attribute.name`,``,`attribute.value`]],[/@qualifiedName/,`attribute.name`],[/\?>/,{token:`delimiter`,next:`@pop`}],[/(\/)(>)/,[{token:`tag`},{token:`delimiter`,next:`@pop`}]],[/>/,{token:`delimiter`,next:`@pop`}]],whitespace:[[/[ \t\r\n]+/,``],[/<!--/,{token:`comment`,next:`@comment`}]],comment:[[/[^<\-]+/,`comment.content`],[/-->/,{token:`comment`,next:`@pop`}],[/<!--/,`comment.content.invalid`],[/[<\-]/,`comment.content`]]}};export{t as conf,n as language};
1
+ import{l as e}from"./editor.api-Dkutg_Z1.js";var t={comments:{blockComment:[`<!--`,`-->`]},brackets:[[`<`,`>`]],autoClosingPairs:[{open:`<`,close:`>`},{open:`'`,close:`'`},{open:`"`,close:`"`}],surroundingPairs:[{open:`<`,close:`>`},{open:`'`,close:`'`},{open:`"`,close:`"`}],onEnterRules:[{beforeText:RegExp(`<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),action:{indentAction:e.IndentAction.Indent}}]},n={defaultToken:``,tokenPostfix:`.xml`,ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,``],{include:`@whitespace`},[/(<)(@qualifiedName)/,[{token:`delimiter`},{token:`tag`,next:`@tag`}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:`delimiter`},{token:`tag`},``,{token:`delimiter`}]],[/(<\?)(@qualifiedName)/,[{token:`delimiter`},{token:`metatag`,next:`@tag`}]],[/(<\!)(@qualifiedName)/,[{token:`delimiter`},{token:`metatag`,next:`@tag`}]],[/<\!\[CDATA\[/,{token:`delimiter.cdata`,next:`@cdata`}],[/&\w+;/,`string.escape`]],cdata:[[/[^\]]+/,``],[/\]\]>/,{token:`delimiter.cdata`,next:`@pop`}],[/\]/,``]],tag:[[/[ \t\r\n]+/,``],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,[`attribute.name`,``,`attribute.value`]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,[`attribute.name`,``,`attribute.value`]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,[`attribute.name`,``,`attribute.value`]],[/@qualifiedName/,`attribute.name`],[/\?>/,{token:`delimiter`,next:`@pop`}],[/(\/)(>)/,[{token:`tag`},{token:`delimiter`,next:`@pop`}]],[/>/,{token:`delimiter`,next:`@pop`}]],whitespace:[[/[ \t\r\n]+/,``],[/<!--/,{token:`comment`,next:`@comment`}]],comment:[[/[^<\-]+/,`comment.content`],[/-->/,{token:`comment`,next:`@pop`}],[/<!--/,`comment.content.invalid`],[/[<\-]/,`comment.content`]]}};export{t as conf,n as language};
@@ -1 +1 @@
1
- import{l as e}from"./editor.api-BNFb25CX.js";var t={comments:{lineComment:`#`},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},n={tokenPostfix:`.yaml`,brackets:[{token:`delimiter.bracket`,open:`{`,close:`}`},{token:`delimiter.square`,open:`[`,close:`]`}],keywords:[`true`,`True`,`TRUE`,`false`,`False`,`FALSE`,`null`,`Null`,`Null`,`~`],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:`@whitespace`},{include:`@comment`},[/%[^ ]+.*$/,`meta.directive`],[/---/,`operators.directivesEnd`],[/\.{3}/,`operators.documentEnd`],[/[-?:](?= )/,`operators`],{include:`@anchor`},{include:`@tagHandle`},{include:`@flowCollections`},{include:`@blockStyle`},[/@numberInteger(?![ \t]*\S+)/,`number`],[/@numberFloat(?![ \t]*\S+)/,`number.float`],[/@numberOctal(?![ \t]*\S+)/,`number.octal`],[/@numberHex(?![ \t]*\S+)/,`number.hex`],[/@numberInfinity(?![ \t]*\S+)/,`number.infinity`],[/@numberNaN(?![ \t]*\S+)/,`number.nan`],[/@numberDate(?![ \t]*\S+)/,`number.date`],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,[`type`,`white`,`operators`,`white`]],{include:`@flowScalars`},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],object:[{include:`@whitespace`},{include:`@comment`},[/\}/,`@brackets`,`@pop`],[/,/,`delimiter.comma`],[/:(?= )/,`operators`],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,`type`],{include:`@flowCollections`},{include:`@flowScalars`},{include:`@tagHandle`},{include:`@anchor`},{include:`@flowNumber`},[/[^\},]+/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],array:[{include:`@whitespace`},{include:`@comment`},[/\]/,`@brackets`,`@pop`],[/,/,`delimiter.comma`],{include:`@flowCollections`},{include:`@flowScalars`},{include:`@tagHandle`},{include:`@anchor`},{include:`@flowNumber`},[/[^\],]+/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],multiString:[[/^( +).+$/,`string`,`@multiStringContinued.$1`]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":`string`,"@default":{token:`@rematch`,next:`@popall`}}}]],whitespace:[[/[ \t\r\n]+/,`white`]],comment:[[/#.*$/,`comment`]],flowCollections:[[/\[/,`@brackets`,`@array`],[/\{/,`@brackets`,`@object`]],flowScalars:[[/"([^"\\]|\\.)*$/,`string.invalid`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/'[^']*'/,`string`],[/"/,`string`,`@doubleQuotedString`]],doubleQuotedString:[[/[^\\"]+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/"/,`string`,`@pop`]],blockStyle:[[/[>|][0-9]*[+-]?$/,`operators`,`@multiString`]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,`number`],[/@numberFloat(?=[ \t]*[,\]\}])/,`number.float`],[/@numberOctal(?=[ \t]*[,\]\}])/,`number.octal`],[/@numberHex(?=[ \t]*[,\]\}])/,`number.hex`],[/@numberInfinity(?=[ \t]*[,\]\}])/,`number.infinity`],[/@numberNaN(?=[ \t]*[,\]\}])/,`number.nan`],[/@numberDate(?=[ \t]*[,\]\}])/,`number.date`]],tagHandle:[[/\![^ ]*/,`tag`]],anchor:[[/[&*][^ ]+/,`namespace`]]}};export{t as conf,n as language};
1
+ import{l as e}from"./editor.api-Dkutg_Z1.js";var t={comments:{lineComment:`#`},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},n={tokenPostfix:`.yaml`,brackets:[{token:`delimiter.bracket`,open:`{`,close:`}`},{token:`delimiter.square`,open:`[`,close:`]`}],keywords:[`true`,`True`,`TRUE`,`false`,`False`,`FALSE`,`null`,`Null`,`Null`,`~`],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:`@whitespace`},{include:`@comment`},[/%[^ ]+.*$/,`meta.directive`],[/---/,`operators.directivesEnd`],[/\.{3}/,`operators.documentEnd`],[/[-?:](?= )/,`operators`],{include:`@anchor`},{include:`@tagHandle`},{include:`@flowCollections`},{include:`@blockStyle`},[/@numberInteger(?![ \t]*\S+)/,`number`],[/@numberFloat(?![ \t]*\S+)/,`number.float`],[/@numberOctal(?![ \t]*\S+)/,`number.octal`],[/@numberHex(?![ \t]*\S+)/,`number.hex`],[/@numberInfinity(?![ \t]*\S+)/,`number.infinity`],[/@numberNaN(?![ \t]*\S+)/,`number.nan`],[/@numberDate(?![ \t]*\S+)/,`number.date`],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,[`type`,`white`,`operators`,`white`]],{include:`@flowScalars`},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],object:[{include:`@whitespace`},{include:`@comment`},[/\}/,`@brackets`,`@pop`],[/,/,`delimiter.comma`],[/:(?= )/,`operators`],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,`type`],{include:`@flowCollections`},{include:`@flowScalars`},{include:`@tagHandle`},{include:`@anchor`},{include:`@flowNumber`},[/[^\},]+/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],array:[{include:`@whitespace`},{include:`@comment`},[/\]/,`@brackets`,`@pop`],[/,/,`delimiter.comma`],{include:`@flowCollections`},{include:`@flowScalars`},{include:`@tagHandle`},{include:`@anchor`},{include:`@flowNumber`},[/[^\],]+/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],multiString:[[/^( +).+$/,`string`,`@multiStringContinued.$1`]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":`string`,"@default":{token:`@rematch`,next:`@popall`}}}]],whitespace:[[/[ \t\r\n]+/,`white`]],comment:[[/#.*$/,`comment`]],flowCollections:[[/\[/,`@brackets`,`@array`],[/\{/,`@brackets`,`@object`]],flowScalars:[[/"([^"\\]|\\.)*$/,`string.invalid`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/'[^']*'/,`string`],[/"/,`string`,`@doubleQuotedString`]],doubleQuotedString:[[/[^\\"]+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/"/,`string`,`@pop`]],blockStyle:[[/[>|][0-9]*[+-]?$/,`operators`,`@multiString`]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,`number`],[/@numberFloat(?=[ \t]*[,\]\}])/,`number.float`],[/@numberOctal(?=[ \t]*[,\]\}])/,`number.octal`],[/@numberHex(?=[ \t]*[,\]\}])/,`number.hex`],[/@numberInfinity(?=[ \t]*[,\]\}])/,`number.infinity`],[/@numberNaN(?=[ \t]*[,\]\}])/,`number.nan`],[/@numberDate(?=[ \t]*[,\]\}])/,`number.date`]],tagHandle:[[/\![^ ]*/,`tag`]],anchor:[[/[&*][^ ]+/,`namespace`]]}};export{t as conf,n as language};
@@ -0,0 +1,15 @@
1
+ import {
2
+ attachDefinition,
3
+ registerDefinitionNodes
4
+ } from "./chunk-BPODRH52.js";
5
+ import "./chunk-CTPLRSWF.js";
6
+ import "./chunk-RUU3YWXU.js";
7
+ import "./chunk-L6B6FUQP.js";
8
+ import "./chunk-HFHWYL55.js";
9
+ import "./chunk-CO22XHNG.js";
10
+ import "./chunk-FWMSGKEH.js";
11
+ export {
12
+ attachDefinition,
13
+ registerDefinitionNodes
14
+ };
15
+ //# sourceMappingURL=DefinitionNode-P7AA4TAU.js.map
@@ -1,12 +1,8 @@
1
- import {
2
- loadEmbeddedModule,
3
- loadProjectModule
4
- } from "./chunk-2KXB47FP.js";
5
1
  import {
6
2
  moduleNodeFunction
7
- } from "./chunk-RLCAJBVR.js";
8
- import "./chunk-53NMBJAO.js";
9
- import "./chunk-SGJAET2L.js";
3
+ } from "./chunk-TJW67QSI.js";
4
+ import "./chunk-ZSCUZE6I.js";
5
+ import "./chunk-BPODRH52.js";
10
6
  import {
11
7
  Node,
12
8
  canConnect,
@@ -17,20 +13,24 @@ import {
17
13
  normalizeColor,
18
14
  normalizeType,
19
15
  packagePathToType
20
- } from "./chunk-FCDXJ6EK.js";
16
+ } from "./chunk-CTPLRSWF.js";
17
+ import {
18
+ loadEmbeddedModule,
19
+ loadProjectModule
20
+ } from "./chunk-2KXB47FP.js";
21
21
  import "./chunk-RUU3YWXU.js";
22
22
  import {
23
23
  bundleSchemasCompatible,
24
24
  unknownFieldMessage
25
- } from "./chunk-GFS6W3C5.js";
25
+ } from "./chunk-L6B6FUQP.js";
26
26
  import "./chunk-HFHWYL55.js";
27
27
  import {
28
28
  parseBundleFieldPath,
29
29
  remoteBundlePath
30
30
  } from "./chunk-CO22XHNG.js";
31
- import "./chunk-A4OAMOZH.js";
31
+ import "./chunk-NJFMDXHR.js";
32
32
  import "./chunk-J7VK7MNF.js";
33
- import "./chunk-BIJO5OFS.js";
33
+ import "./chunk-FWMSGKEH.js";
34
34
 
35
35
  // src/nodes/annotations/Annotation.ts
36
36
  var Annotation = class extends Node {
@@ -2972,4 +2972,4 @@ export {
2972
2972
  GRAPH_FORMAT_VERSION,
2973
2973
  Graph
2974
2974
  };
2975
- //# sourceMappingURL=Graph-ZJJTRQTM.js.map
2975
+ //# sourceMappingURL=Graph-OB6EWSGL.js.map
@@ -0,0 +1,25 @@
1
+ import {
2
+ ASSERT_NAMESPACE,
3
+ assertNodeRegistrations,
4
+ equalsDefinition,
5
+ equalsRegistration,
6
+ notBlankDefinition,
7
+ notBlankRegistration,
8
+ rangeDefinition,
9
+ rangeRegistration,
10
+ trueDefinition,
11
+ trueRegistration
12
+ } from "./chunk-JVOCK5W4.js";
13
+ export {
14
+ ASSERT_NAMESPACE,
15
+ assertNodeRegistrations,
16
+ equalsDefinition,
17
+ equalsRegistration,
18
+ notBlankDefinition,
19
+ notBlankRegistration,
20
+ rangeDefinition,
21
+ rangeRegistration,
22
+ trueDefinition,
23
+ trueRegistration
24
+ };
25
+ //# sourceMappingURL=assert-GROGQNCQ.js.map
@@ -0,0 +1,189 @@
1
+ // packages/runtime/src/builtins/assert/checks.ts
2
+ var AssertionFailed = class extends Error {
3
+ constructor(nodeId, moduleId, detail, message) {
4
+ const extra = typeof message === "string" && message.trim() ? ` ${message.trim()}` : "";
5
+ super(`Assertion failed in "${nodeId}" (${moduleId}): ${detail}.${extra}`);
6
+ this.name = "AssertionFailed";
7
+ }
8
+ };
9
+ function executeRange({ nodeId, inputs, props, outputs }) {
10
+ const value = inputs.value;
11
+ if (typeof value !== "number" || !Number.isFinite(value)) {
12
+ throw new AssertionFailed(nodeId, "cascade.assert.Range", `value ${String(value)} is not a finite number`, props.message);
13
+ }
14
+ if (value < props.min || value > props.max) {
15
+ throw new AssertionFailed(nodeId, "cascade.assert.Range", `value ${value} is outside [${props.min}, ${props.max}]`, props.message);
16
+ }
17
+ outputs.value.set(value);
18
+ }
19
+ function executeEquals({ nodeId, inputs, props, outputs }) {
20
+ if (!deepEqual(inputs.value, props.expected, props.tolerance)) {
21
+ throw new AssertionFailed(nodeId, "cascade.assert.Equals", `got ${preview(inputs.value)}, expected ${preview(props.expected)}`, props.message);
22
+ }
23
+ outputs.value.set(inputs.value);
24
+ }
25
+ function executeTrue({ nodeId, inputs, props, outputs }) {
26
+ if (inputs.value !== true) throw new AssertionFailed(nodeId, "cascade.assert.True", `value is ${preview(inputs.value)}`, props.message);
27
+ outputs.value.set(true);
28
+ }
29
+ async function executeNotBlank({ nodeId, inputs, props, outputs, capabilities, signal }) {
30
+ const image = inputs.image;
31
+ const ref = typeof image === "string" ? { path: image } : image;
32
+ if (!ref || typeof ref.path !== "string" || !ref.path) {
33
+ throw new AssertionFailed(nodeId, "cascade.assert.NotBlank", "no image arrived", props.message);
34
+ }
35
+ const path = ref.path;
36
+ const kept = capabilities.assets.imagePixels?.({ path });
37
+ const pixels = kept ? { width: kept.width, height: kept.height, channels: 4, data: kept.data } : await decodeImage(await capabilities.assets.read({ path }, { signal }));
38
+ if (!pixels) throw new AssertionFailed(nodeId, "cascade.assert.NotBlank", `${path} is not a PNG or PPM this node can read`, props.message);
39
+ const verdict = blankness(pixels, props.tolerance);
40
+ if (verdict) throw new AssertionFailed(nodeId, "cascade.assert.NotBlank", `${path} (${pixels.width}x${pixels.height}) is ${verdict}`, props.message);
41
+ outputs.image.set(inputs.image);
42
+ }
43
+ function preview(value) {
44
+ const text = JSON.stringify(value) ?? String(value);
45
+ return text.length > 120 ? `${text.slice(0, 117)}...` : text;
46
+ }
47
+ function deepEqual(a, b, tolerance) {
48
+ if (typeof a === "number" && typeof b === "number") return a === b || Math.abs(a - b) <= tolerance;
49
+ if (Array.isArray(a) && Array.isArray(b)) return a.length === b.length && a.every((item, index) => deepEqual(item, b[index], tolerance));
50
+ if (a && b && typeof a === "object" && typeof b === "object" && !Array.isArray(a) && !Array.isArray(b)) {
51
+ const left = a;
52
+ const right = b;
53
+ const keys = Object.keys(left);
54
+ if (keys.length !== Object.keys(right).length) return false;
55
+ return keys.every((key) => key in right && deepEqual(left[key], right[key], tolerance));
56
+ }
57
+ return a === b || a == null && b == null;
58
+ }
59
+ function blankness(pixels, tolerance = 0) {
60
+ const { channels, data } = pixels;
61
+ const alpha = channels === 2 || channels === 4 ? channels - 1 : -1;
62
+ const colour = alpha === -1 ? channels : channels - 1;
63
+ const min = new Array(channels).fill(255);
64
+ const max = new Array(channels).fill(0);
65
+ let opaque = alpha === -1;
66
+ for (let index = 0; index < data.length; index += channels) {
67
+ if (alpha !== -1 && data[index + alpha] > tolerance) opaque = true;
68
+ for (let channel = 0; channel < channels; channel += 1) {
69
+ const value = data[index + channel];
70
+ if (value < min[channel]) min[channel] = value;
71
+ if (value > max[channel]) max[channel] = value;
72
+ }
73
+ }
74
+ if (!opaque) return "fully transparent";
75
+ const spread = Math.max(...max.map((value, channel) => value - min[channel]));
76
+ if (spread <= tolerance) return colour === 1 ? `one flat grey (${min[0]})` : `one flat colour (rgb ${min.slice(0, 3).join(", ")})`;
77
+ return null;
78
+ }
79
+ async function decodeImage(bytes) {
80
+ if (bytes[0] === 137 && bytes[1] === 80 && bytes[2] === 78 && bytes[3] === 71) return decodePng(bytes);
81
+ if (bytes[0] === 80 && (bytes[1] === 54 || bytes[1] === 53)) return decodePnm(bytes);
82
+ return null;
83
+ }
84
+ function decodePnm(bytes) {
85
+ const fields = [];
86
+ let index = 2;
87
+ while (fields.length < 3 && index < bytes.length) {
88
+ while (index < bytes.length && /\s/.test(String.fromCharCode(bytes[index]))) index += 1;
89
+ if (bytes[index] === 35) {
90
+ while (index < bytes.length && bytes[index] !== 10) index += 1;
91
+ continue;
92
+ }
93
+ let field = "";
94
+ while (index < bytes.length && !/\s/.test(String.fromCharCode(bytes[index]))) field += String.fromCharCode(bytes[index++]);
95
+ fields.push(field);
96
+ }
97
+ const [width, height, maxValue] = fields.map(Number);
98
+ if (!width || !height || maxValue !== 255) return null;
99
+ const channels = bytes[1] === 54 ? 3 : 1;
100
+ return { width, height, channels, data: bytes.subarray(index + 1, index + 1 + width * height * channels) };
101
+ }
102
+ async function inflate(data) {
103
+ const globals = globalThis;
104
+ if (!globals.DecompressionStream || !globals.Blob || !globals.Response) {
105
+ throw new Error("cascade.assert.NotBlank: this host has no DecompressionStream to read a PNG with");
106
+ }
107
+ const stream = new globals.Blob([data]).stream().pipeThrough(new globals.DecompressionStream("deflate"));
108
+ return new Uint8Array(await new globals.Response(stream).arrayBuffer());
109
+ }
110
+ async function decodePng(bytes) {
111
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
112
+ let offset = 8;
113
+ let width = 0;
114
+ let height = 0;
115
+ let channels = 0;
116
+ const idat = [];
117
+ while (offset + 8 <= bytes.length) {
118
+ const length = view.getUint32(offset);
119
+ const type = String.fromCharCode(...bytes.subarray(offset + 4, offset + 8));
120
+ const body = bytes.subarray(offset + 8, offset + 8 + length);
121
+ if (type === "IHDR") {
122
+ width = view.getUint32(offset + 8);
123
+ height = view.getUint32(offset + 12);
124
+ const depth = body[8];
125
+ const colourType = body[9];
126
+ const interlace = body[12];
127
+ channels = { 0: 1, 4: 2, 2: 3, 6: 4 }[colourType] ?? 0;
128
+ if (depth !== 8 || !channels || interlace !== 0) return null;
129
+ } else if (type === "IDAT") idat.push(body);
130
+ else if (type === "IEND") break;
131
+ offset += 12 + length;
132
+ }
133
+ if (!width || !height || !idat.length) return null;
134
+ const joined = new Uint8Array(idat.reduce((sum, part) => sum + part.length, 0));
135
+ let at = 0;
136
+ for (const part of idat) {
137
+ joined.set(part, at);
138
+ at += part.length;
139
+ }
140
+ const raw = await inflate(joined);
141
+ const stride = width * channels;
142
+ const data = new Uint8Array(stride * height);
143
+ for (let row = 0; row < height; row += 1) {
144
+ const filter = raw[row * (stride + 1)];
145
+ const line = raw.subarray(row * (stride + 1) + 1, (row + 1) * (stride + 1));
146
+ const out = data.subarray(row * stride, (row + 1) * stride);
147
+ const previous = row > 0 ? data.subarray((row - 1) * stride, row * stride) : new Uint8Array(stride);
148
+ for (let x = 0; x < stride; x += 1) {
149
+ const left = x >= channels ? out[x - channels] : 0;
150
+ const up = previous[x];
151
+ const upLeft = x >= channels ? previous[x - channels] : 0;
152
+ const value = line[x];
153
+ switch (filter) {
154
+ case 0:
155
+ out[x] = value;
156
+ break;
157
+ case 1:
158
+ out[x] = value + left & 255;
159
+ break;
160
+ case 2:
161
+ out[x] = value + up & 255;
162
+ break;
163
+ case 3:
164
+ out[x] = value + (left + up >> 1) & 255;
165
+ break;
166
+ case 4: {
167
+ const estimate = left + up - upLeft;
168
+ const a = Math.abs(estimate - left);
169
+ const b = Math.abs(estimate - up);
170
+ const c = Math.abs(estimate - upLeft);
171
+ out[x] = value + (a <= b && a <= c ? left : b <= c ? up : upLeft) & 255;
172
+ break;
173
+ }
174
+ default:
175
+ return null;
176
+ }
177
+ }
178
+ }
179
+ return { width, height, channels, data };
180
+ }
181
+ export {
182
+ blankness,
183
+ decodeImage,
184
+ executeEquals,
185
+ executeNotBlank,
186
+ executeRange,
187
+ executeTrue
188
+ };
189
+ //# sourceMappingURL=checks-3WB44XBL.js.map
@@ -3,14 +3,14 @@ import {
3
3
  moduleId,
4
4
  projectModuleFile,
5
5
  validateNodeModuleArchitecture
6
- } from "./chunk-EUIAC3U3.js";
6
+ } from "./chunk-QKL7CCRS.js";
7
7
  import {
8
8
  builtinNodeRegistration
9
- } from "./chunk-36P5K3SD.js";
9
+ } from "./chunk-MI5JLQYA.js";
10
10
  import {
11
11
  ProjectRoot,
12
12
  extractNodeDefinition
13
- } from "./chunk-RQZ4SX5R.js";
13
+ } from "./chunk-W5PJ5RMP.js";
14
14
 
15
15
  // src/cli/webBuild.ts
16
16
  import fs from "node:fs/promises";
@@ -264,4 +264,4 @@ export {
264
264
  inside,
265
265
  exists
266
266
  };
267
- //# sourceMappingURL=chunk-3JTJHF7V.js.map
267
+ //# sourceMappingURL=chunk-2L34ERS2.js.map
@@ -0,0 +1,138 @@
1
+ // packages/runtime/src/builtins/image/contactSheet.ts
2
+ function contactSheetLayout(sizes, options = {}) {
3
+ const count = sizes.length;
4
+ if (!count) throw new Error("cascade.image.ContactSheet needs at least one image");
5
+ for (const [width, height] of sizes) {
6
+ if (!(width > 0 && height > 0)) throw new Error(`cascade.image.ContactSheet: an image is ${width}x${height}`);
7
+ }
8
+ const gap = Math.max(0, Math.round(options.gap ?? 16));
9
+ const columns = Math.min(count, options.columns && options.columns > 0 ? Math.round(options.columns) : Math.ceil(Math.sqrt(count)));
10
+ const rows = Math.ceil(count / columns);
11
+ const scaled = Boolean(options.cellWidth && options.cellWidth > 0);
12
+ const cellWidth = scaled ? Math.round(options.cellWidth) : Math.max(...sizes.map(([width]) => width));
13
+ const cellHeight = scaled ? Math.max(...sizes.map(([width, height]) => Math.round(height * cellWidth / width))) : Math.max(...sizes.map(([, height]) => height));
14
+ const labelHeight = Math.max(0, Math.round(options.labelHeight ?? 0));
15
+ const cells = sizes.map(([width, height], index) => {
16
+ const column = index % columns;
17
+ const row = Math.floor(index / columns);
18
+ const fit = Math.min(cellWidth / width, cellHeight / height);
19
+ const scale = scaled ? fit : Math.min(1, fit);
20
+ const drawnWidth = Math.max(1, Math.round(width * scale));
21
+ const drawnHeight = Math.max(1, Math.round(height * scale));
22
+ const left = gap + column * (cellWidth + gap);
23
+ const top = gap + row * (cellHeight + labelHeight + gap);
24
+ return {
25
+ x: left + Math.floor((cellWidth - drawnWidth) / 2),
26
+ y: top + Math.floor((cellHeight - drawnHeight) / 2),
27
+ width: drawnWidth,
28
+ height: drawnHeight,
29
+ labelX: left,
30
+ labelY: top + cellHeight
31
+ };
32
+ });
33
+ return {
34
+ width: gap + columns * (cellWidth + gap),
35
+ height: gap + rows * (cellHeight + labelHeight + gap),
36
+ columns,
37
+ rows,
38
+ cell: [cellWidth, cellHeight],
39
+ labelHeight,
40
+ cells
41
+ };
42
+ }
43
+ function host() {
44
+ const globals = globalThis;
45
+ const Canvas = globals.OffscreenCanvas;
46
+ const createBitmap = globals.createImageBitmap;
47
+ if (!Canvas || !createBitmap || !globals.Blob) {
48
+ throw new Error("cascade.image.ContactSheet needs OffscreenCanvas and createImageBitmap, which this host does not provide");
49
+ }
50
+ const BlobType = globals.Blob;
51
+ return {
52
+ surface: (width, height) => new Canvas(width, height),
53
+ decode: (bytes) => createBitmap(new BlobType([bytes]))
54
+ };
55
+ }
56
+ function css(colour, fallback) {
57
+ const [r = 0, g = 0, b = 0, a = 1] = colour ?? fallback;
58
+ return `rgba(${Math.round(r * 255)}, ${Math.round(g * 255)}, ${Math.round(b * 255)}, ${a})`;
59
+ }
60
+ async function composeContactSheet(images, options = {}) {
61
+ const canvas = host();
62
+ const bitmaps = [];
63
+ try {
64
+ for (const bytes of images) bitmaps.push(await canvas.decode(bytes));
65
+ const labels = options.labels ?? [];
66
+ const labelSize = Math.round(options.labelSize ?? 14);
67
+ const labelled = labels.some((label) => label.trim().length > 0);
68
+ const layout = contactSheetLayout(bitmaps.map((bitmap) => [bitmap.width, bitmap.height]), {
69
+ columns: options.columns,
70
+ gap: options.gap,
71
+ cellWidth: options.cellWidth,
72
+ labelHeight: labelled ? Math.round(labelSize * 1.8) : 0
73
+ });
74
+ const surface = canvas.surface(layout.width, layout.height);
75
+ const context = surface.getContext("2d");
76
+ if (!context) throw new Error("cascade.image.ContactSheet: no 2D context");
77
+ context.fillStyle = css(options.background, [1, 1, 1, 1]);
78
+ context.fillRect(0, 0, layout.width, layout.height);
79
+ context.imageSmoothingEnabled = true;
80
+ context.imageSmoothingQuality = "high";
81
+ layout.cells.forEach((cell, index) => context.drawImage(bitmaps[index], cell.x, cell.y, cell.width, cell.height));
82
+ if (labelled) {
83
+ context.fillStyle = css(options.labelColor, [0.1, 0.1, 0.1, 1]);
84
+ context.font = `${labelSize}px sans-serif`;
85
+ context.textBaseline = "top";
86
+ layout.cells.forEach((cell, index) => {
87
+ const label = labels[index];
88
+ if (label) context.fillText(label, cell.labelX, cell.labelY + Math.round((layout.labelHeight - labelSize) / 2), layout.cell[0]);
89
+ });
90
+ }
91
+ const blob = await surface.convertToBlob({ type: "image/png" });
92
+ return { bytes: new Uint8Array(await blob.arrayBuffer()), layout };
93
+ } finally {
94
+ for (const bitmap of bitmaps) bitmap.close?.();
95
+ }
96
+ }
97
+ function imageReference(value) {
98
+ if (typeof value === "string" && value) return { path: value };
99
+ const candidate = value?.path;
100
+ return typeof candidate === "string" && candidate ? { path: candidate } : void 0;
101
+ }
102
+ async function executeContactSheet(context) {
103
+ const { props } = context;
104
+ const references = [...context.inputs.images, ...context.inputs.list ?? []].map(imageReference).filter((reference) => reference !== void 0);
105
+ const bytes = [];
106
+ for (const reference of references) {
107
+ bytes.push(await context.capabilities.assets.read(reference, { signal: context.signal }));
108
+ }
109
+ const { bytes: sheet, layout } = await composeContactSheet(bytes, {
110
+ columns: props.columns,
111
+ gap: props.gap,
112
+ cellWidth: props.cellWidth,
113
+ labels: props.labels ? props.labels.split("\n") : [],
114
+ labelSize: props.labelSize,
115
+ background: props.background,
116
+ labelColor: props.labelColor
117
+ });
118
+ const asset = await context.capabilities.assets.write(
119
+ sheet,
120
+ { mediaType: "image/png", suggestedName: props.filename },
121
+ { signal: context.signal }
122
+ );
123
+ context.outputs.asset.set(asset);
124
+ context.outputs.image.set({
125
+ path: asset.path ?? props.filename,
126
+ size: [layout.width, layout.height],
127
+ channels: "rgba",
128
+ depth: "u8",
129
+ space: "srgb"
130
+ });
131
+ }
132
+
133
+ export {
134
+ contactSheetLayout,
135
+ composeContactSheet,
136
+ executeContactSheet
137
+ };
138
+ //# sourceMappingURL=chunk-53LGFPWX.js.map