vibrante-node 2.5.1__py3-none-any.whl

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 (487) hide show
  1. src/core/__init__.py +0 -0
  2. src/core/engine.py +484 -0
  3. src/core/events.py +32 -0
  4. src/core/graph.py +74 -0
  5. src/core/integrity.py +925 -0
  6. src/core/loader.py +56 -0
  7. src/core/manifest.py +910 -0
  8. src/core/models.py +59 -0
  9. src/core/persistence.py +27 -0
  10. src/core/python_to_workflow.py +182 -0
  11. src/core/registry.py +314 -0
  12. src/core/workflow_to_python.py +801 -0
  13. src/main.py +188 -0
  14. src/models/__init__.py +0 -0
  15. src/nodes/__init__.py +0 -0
  16. src/nodes/ai/__init__.py +1 -0
  17. src/nodes/base.py +174 -0
  18. src/nodes/builtins/__init__.py +0 -0
  19. src/nodes/builtins/group_node.py +210 -0
  20. src/nodes/builtins/nodes.py +452 -0
  21. src/nodes/print.py +19 -0
  22. src/nodes/test.py +19 -0
  23. src/ui/__init__.py +0 -0
  24. src/ui/canvas/__init__.py +0 -0
  25. src/ui/canvas/backdrop.py +223 -0
  26. src/ui/canvas/canvas_search_bar.py +222 -0
  27. src/ui/canvas/edge.py +98 -0
  28. src/ui/canvas/mini_map.py +138 -0
  29. src/ui/canvas/node_search_popup.py +270 -0
  30. src/ui/canvas/scene.py +1149 -0
  31. src/ui/canvas/sticky_note.py +123 -0
  32. src/ui/canvas/view.py +285 -0
  33. src/ui/code_editor.py +435 -0
  34. src/ui/export_python_dialog.py +490 -0
  35. src/ui/gemini_api_dialog.py +41 -0
  36. src/ui/gemini_chat.py +370 -0
  37. src/ui/import_python_dialog.py +122 -0
  38. src/ui/library_panel.py +246 -0
  39. src/ui/log_panel.py +315 -0
  40. src/ui/node_builder.py +841 -0
  41. src/ui/node_widget.py +1009 -0
  42. src/ui/port_widget.py +116 -0
  43. src/ui/script_editor.py +53 -0
  44. src/ui/scripting_console.py +270 -0
  45. src/ui/settings_window.py +575 -0
  46. src/ui/window.py +2012 -0
  47. src/utils/color_manager.py +50 -0
  48. src/utils/config_manager.py +71 -0
  49. src/utils/env_manager.py +232 -0
  50. src/utils/highlighter.py +110 -0
  51. src/utils/paths.py +30 -0
  52. src/utils/prism_config.py +300 -0
  53. src/utils/prism_core.py +80 -0
  54. src/utils/qt_compat.py +159 -0
  55. src/utils/runtime.py +80 -0
  56. vibrante_node/CLA.md +96 -0
  57. vibrante_node/COMMERCIAL_LICENSE.md +170 -0
  58. vibrante_node/LICENSE +178 -0
  59. vibrante_node/LICENSES/AGPL-3.0.txt +661 -0
  60. vibrante_node/LICENSES/CC-BY-4.0-SCOPE.md +53 -0
  61. vibrante_node/LICENSES/CC-BY-4.0.txt +396 -0
  62. vibrante_node/LICENSES/GPL-3.0.txt +674 -0
  63. vibrante_node/LICENSES/LGPL-3.0.txt +165 -0
  64. vibrante_node/LICENSES/README.md +65 -0
  65. vibrante_node/THIRD_PARTY_NOTICES.txt +3277 -0
  66. vibrante_node/__init__.py +2 -0
  67. vibrante_node/app.py +60 -0
  68. vibrante_node/docs/AUTOMATION_API.html +785 -0
  69. vibrante_node/docs/DEVELOPER.html +891 -0
  70. vibrante_node/docs/DOCUMENTATION.html +2761 -0
  71. vibrante_node/docs/LICENSE.txt +35 -0
  72. vibrante_node/docs/NODE_BUILDER_API.html +1155 -0
  73. vibrante_node/docs/RELEASE_v1.0.5.html +140 -0
  74. vibrante_node/docs/RELEASE_v1.1.0.html +163 -0
  75. vibrante_node/docs/RELEASE_v1.1.5.html +286 -0
  76. vibrante_node/docs/RELEASE_v1.2.0.html +175 -0
  77. vibrante_node/docs/RELEASE_v1.3.0.html +168 -0
  78. vibrante_node/docs/RELEASE_v1.4.0.html +160 -0
  79. vibrante_node/docs/RELEASE_v1.5.0.html +432 -0
  80. vibrante_node/docs/RELEASE_v1.6.0.html +293 -0
  81. vibrante_node/docs/RELEASE_v1.6.1.html +171 -0
  82. vibrante_node/docs/RELEASE_v1.7.0.html +270 -0
  83. vibrante_node/docs/RELEASE_v1.8.0.html +201 -0
  84. vibrante_node/docs/RELEASE_v1.8.1.html +124 -0
  85. vibrante_node/docs/RELEASE_v1.8.2.html +119 -0
  86. vibrante_node/docs/RELEASE_v1.8.3.html +125 -0
  87. vibrante_node/docs/RELEASE_v1.8.4.html +210 -0
  88. vibrante_node/docs/RELEASE_v1.8.5.html +223 -0
  89. vibrante_node/docs/RELEASE_v2.0.0.html +284 -0
  90. vibrante_node/docs/RELEASE_v2.1.0.html +259 -0
  91. vibrante_node/docs/RELEASE_v2.1.1.html +156 -0
  92. vibrante_node/docs/RELEASE_v2.2.0.html +369 -0
  93. vibrante_node/docs/RELEASE_v2.2.1.html +168 -0
  94. vibrante_node/docs/RELEASE_v2.3.0.html +185 -0
  95. vibrante_node/docs/RELEASE_v2.4.0.html +446 -0
  96. vibrante_node/docs/RELEASE_v2.5.0.html +478 -0
  97. vibrante_node/docs/RELEASE_v2.5.1.html +190 -0
  98. vibrante_node/docs/USER_GUIDE.html +1407 -0
  99. vibrante_node/docs/index.html +103 -0
  100. vibrante_node/docs/portal/01_introduction.html +1177 -0
  101. vibrante_node/docs/portal/02_getting_started.html +1267 -0
  102. vibrante_node/docs/portal/03_user_guide.html +1736 -0
  103. vibrante_node/docs/portal/04_workflow_tutorials.html +1473 -0
  104. vibrante_node/docs/portal/05_node_development.html +1562 -0
  105. vibrante_node/docs/portal/06_backend_architecture.html +1373 -0
  106. vibrante_node/docs/portal/07_frontend_architecture.html +1588 -0
  107. vibrante_node/docs/portal/08_api_reference.html +2336 -0
  108. vibrante_node/docs/portal/09_advanced_topics.html +1664 -0
  109. vibrante_node/docs/portal/10_contribution_guide.html +1263 -0
  110. vibrante_node/docs/portal/11_troubleshooting.html +1108 -0
  111. vibrante_node/docs/portal/12_examples_library.html +1498 -0
  112. vibrante_node/docs/portal/13_general_purpose_automation.html +1472 -0
  113. vibrante_node/docs/portal/14_custom_nodes_api.html +1960 -0
  114. vibrante_node/docs/portal/index.html +605 -0
  115. vibrante_node/docs/portal/integrations_blender.html +605 -0
  116. vibrante_node/docs/portal/integrations_deadline.html +536 -0
  117. vibrante_node/docs/portal/integrations_houdini.html +787 -0
  118. vibrante_node/docs/portal/integrations_maya.html +675 -0
  119. vibrante_node/docs/portal/integrations_prism.html +628 -0
  120. vibrante_node/docs/portal/search.json +1 -0
  121. vibrante_node/docs/validation.json +333 -0
  122. vibrante_node/examples/arnold_lighting/orchestration_notes.md +45 -0
  123. vibrante_node/examples/arnold_lighting/prompt.md +47 -0
  124. vibrante_node/examples/automation/01_linear_chain.py +10 -0
  125. vibrante_node/examples/automation/02_batch_update_prefix.py +8 -0
  126. vibrante_node/examples/automation/03_reset_scene.py +5 -0
  127. vibrante_node/examples/automation/04_batch_execution.py +9 -0
  128. vibrante_node/examples/automation/05_git_backup.py +6 -0
  129. vibrante_node/examples/automation/06_reset_math_nodes.py +12 -0
  130. vibrante_node/examples/automation/07_stress_test_grid.py +8 -0
  131. vibrante_node/examples/automation/08_scene_summary.py +8 -0
  132. vibrante_node/examples/automation/09_toggle_bools.py +8 -0
  133. vibrante_node/examples/automation/10_session_report.py +7 -0
  134. vibrante_node/examples/automation/11_simple_math_node.py +7 -0
  135. vibrante_node/examples/cinematic_camera/orchestration_notes.md +56 -0
  136. vibrante_node/examples/cinematic_camera/prompt.md +50 -0
  137. vibrante_node/examples/cinematic_explosion/orchestration_notes.md +76 -0
  138. vibrante_node/examples/cinematic_explosion/prompt.md +47 -0
  139. vibrante_node/examples/cinematic_explosion/review.md +75 -0
  140. vibrante_node/examples/dust_wave/orchestration_notes.md +43 -0
  141. vibrante_node/examples/dust_wave/prompt.md +40 -0
  142. vibrante_node/examples/nodes/async_delay.py +21 -0
  143. vibrante_node/examples/nodes/connection_logger.py +25 -0
  144. vibrante_node/examples/nodes/data_filter.py +19 -0
  145. vibrante_node/examples/nodes/dict_merge.py +20 -0
  146. vibrante_node/examples/nodes/dict_summary.py +21 -0
  147. vibrante_node/examples/nodes/dropdown_selector.py +29 -0
  148. vibrante_node/examples/nodes/env_reader.py +18 -0
  149. vibrante_node/examples/nodes/list_item_picker.py +85 -0
  150. vibrante_node/examples/nodes/list_stats.py +27 -0
  151. vibrante_node/examples/nodes/logic_threshold.py +23 -0
  152. vibrante_node/examples/nodes/math_square.py +30 -0
  153. vibrante_node/examples/nodes/random_list.py +18 -0
  154. vibrante_node/examples/nodes/reactive_config.py +24 -0
  155. vibrante_node/examples/nodes/safety_reset.py +31 -0
  156. vibrante_node/examples/nodes/string_reverse.py +16 -0
  157. vibrante_node/icons/210429_DeadlineFreeOn10RenderMachines.jpg +0 -0
  158. vibrante_node/icons/README.md +39 -0
  159. vibrante_node/icons/blender_icon.png +0 -0
  160. vibrante_node/icons/braces.png +0 -0
  161. vibrante_node/icons/braces.svg +1 -0
  162. vibrante_node/icons/builder.png +0 -0
  163. vibrante_node/icons/check.png +0 -0
  164. vibrante_node/icons/check.svg +1 -0
  165. vibrante_node/icons/chevron-right.svg +3 -0
  166. vibrante_node/icons/code.png +0 -0
  167. vibrante_node/icons/code.svg +4 -0
  168. vibrante_node/icons/computer-window.png +0 -0
  169. vibrante_node/icons/data.png +0 -0
  170. vibrante_node/icons/data.svg +5 -0
  171. vibrante_node/icons/database-search.png +0 -0
  172. vibrante_node/icons/database-search.svg +5 -0
  173. vibrante_node/icons/database-zap.png +0 -0
  174. vibrante_node/icons/database-zap.svg +5 -0
  175. vibrante_node/icons/database.png +0 -0
  176. vibrante_node/icons/database.svg +5 -0
  177. vibrante_node/icons/dice.png +0 -0
  178. vibrante_node/icons/dice.svg +1 -0
  179. vibrante_node/icons/divide.svg +5 -0
  180. vibrante_node/icons/file-input.svg +6 -0
  181. vibrante_node/icons/file-plus.png +0 -0
  182. vibrante_node/icons/file-plus.svg +6 -0
  183. vibrante_node/icons/file-text.png +0 -0
  184. vibrante_node/icons/file-text.svg +7 -0
  185. vibrante_node/icons/folder-plus.png +0 -0
  186. vibrante_node/icons/folder-plus.svg +5 -0
  187. vibrante_node/icons/folder.png +0 -0
  188. vibrante_node/icons/folder.svg +3 -0
  189. vibrante_node/icons/gear.png +0 -0
  190. vibrante_node/icons/gear.svg +1 -0
  191. vibrante_node/icons/git-branch.svg +6 -0
  192. vibrante_node/icons/hash.png +0 -0
  193. vibrante_node/icons/hash.svg +1 -0
  194. vibrante_node/icons/houdini.svg +4 -0
  195. vibrante_node/icons/houdini_icon.png +0 -0
  196. vibrante_node/icons/http.png +0 -0
  197. vibrante_node/icons/list-check.png +0 -0
  198. vibrante_node/icons/list-check.svg +7 -0
  199. vibrante_node/icons/list-plus.svg +10 -0
  200. vibrante_node/icons/list.png +0 -0
  201. vibrante_node/icons/list.svg +8 -0
  202. vibrante_node/icons/logic.png +0 -0
  203. vibrante_node/icons/logic.svg +7 -0
  204. vibrante_node/icons/math.png +0 -0
  205. vibrante_node/icons/math.svg +4 -0
  206. vibrante_node/icons/maya_icon.jpg +0 -0
  207. vibrante_node/icons/message.png +0 -0
  208. vibrante_node/icons/message.svg +3 -0
  209. vibrante_node/icons/minus.svg +3 -0
  210. vibrante_node/icons/multiply.png +0 -0
  211. vibrante_node/icons/multiply.svg +1 -0
  212. vibrante_node/icons/online-library.png +0 -0
  213. vibrante_node/icons/percentage.svg +5 -0
  214. vibrante_node/icons/plus.png +0 -0
  215. vibrante_node/icons/plus.svg +1 -0
  216. vibrante_node/icons/print.png +0 -0
  217. vibrante_node/icons/print.svg +5 -0
  218. vibrante_node/icons/prism_icon.png +0 -0
  219. vibrante_node/icons/refresh.svg +6 -0
  220. vibrante_node/icons/repeat.svg +6 -0
  221. vibrante_node/icons/scales.png +0 -0
  222. vibrante_node/icons/scales.svg +1 -0
  223. vibrante_node/icons/shuffle.svg +7 -0
  224. vibrante_node/icons/string.png +0 -0
  225. vibrante_node/icons/string.svg +5 -0
  226. vibrante_node/icons/terminal.png +0 -0
  227. vibrante_node/icons/terminal.svg +1 -0
  228. vibrante_node/icons/timer.png +0 -0
  229. vibrante_node/icons/timer.svg +4 -0
  230. vibrante_node/icons/toggle-switch.svg +5 -0
  231. vibrante_node/icons/uppercase.png +0 -0
  232. vibrante_node/icons/uppercase.svg +1 -0
  233. vibrante_node/icons/variable-get.svg +4 -0
  234. vibrante_node/icons/variable-set.svg +6 -0
  235. vibrante_node/icons/variable.png +0 -0
  236. vibrante_node/icons/variable.svg +5 -0
  237. vibrante_node/icons/vibrante-node-icon.png +0 -0
  238. vibrante_node/icons/vibrante-node-logo.png +0 -0
  239. vibrante_node/icons/vibrante-node-main_logo.png +0 -0
  240. vibrante_node/icons/vibrante-node-resize_main_logo.png +0 -0
  241. vibrante_node/logo.png +0 -0
  242. vibrante_node/mcp_cli.py +36 -0
  243. vibrante_node/node_examples/Split_String.json +35 -0
  244. vibrante_node/node_examples/async_delay.json +32 -0
  245. vibrante_node/node_examples/delay_timer.json +29 -0
  246. vibrante_node/node_examples/file_reader.json +29 -0
  247. vibrante_node/node_examples/fruit_selector.json +37 -0
  248. vibrante_node/node_examples/json_parser.json +29 -0
  249. vibrante_node/node_examples/line_counter.json +29 -0
  250. vibrante_node/node_examples/list_append.json +32 -0
  251. vibrante_node/node_examples/list_images_recursive.json +55 -0
  252. vibrante_node/node_examples/logic_and.json +34 -0
  253. vibrante_node/node_examples/logic_compare.json +36 -0
  254. vibrante_node/node_examples/math_abs.json +29 -0
  255. vibrante_node/node_examples/math_add.json +32 -0
  256. vibrante_node/node_examples/reactive_config.json +28 -0
  257. vibrante_node/node_examples/string_uppercase.json +29 -0
  258. vibrante_node/nodes/Dropdown_Selector.json +27 -0
  259. vibrante_node/nodes/add_integers.json +34 -0
  260. vibrante_node/nodes/blender_action_bake_animation.json +23 -0
  261. vibrante_node/nodes/blender_action_custom.json +21 -0
  262. vibrante_node/nodes/blender_action_export_alembic.json +22 -0
  263. vibrante_node/nodes/blender_action_export_fbx.json +23 -0
  264. vibrante_node/nodes/blender_action_export_gltf.json +21 -0
  265. vibrante_node/nodes/blender_action_export_obj.json +19 -0
  266. vibrante_node/nodes/blender_action_export_usd.json +23 -0
  267. vibrante_node/nodes/blender_action_import_alembic.json +18 -0
  268. vibrante_node/nodes/blender_action_import_fbx.json +18 -0
  269. vibrante_node/nodes/blender_action_import_gltf.json +18 -0
  270. vibrante_node/nodes/blender_action_import_obj.json +18 -0
  271. vibrante_node/nodes/blender_action_new_blend.json +18 -0
  272. vibrante_node/nodes/blender_action_open_blend.json +18 -0
  273. vibrante_node/nodes/blender_action_render.json +23 -0
  274. vibrante_node/nodes/blender_action_save_blend.json +18 -0
  275. vibrante_node/nodes/blender_action_scene_info.json +17 -0
  276. vibrante_node/nodes/blender_action_set_frame_range.json +20 -0
  277. vibrante_node/nodes/blender_action_set_render_settings.json +27 -0
  278. vibrante_node/nodes/blender_get_action_result.json +22 -0
  279. vibrante_node/nodes/blender_headless.json +86 -0
  280. vibrante_node/nodes/compare.json +48 -0
  281. vibrante_node/nodes/console_print.json +29 -0
  282. vibrante_node/nodes/create_dictionary.json +18 -0
  283. vibrante_node/nodes/create_folder.json +17 -0
  284. vibrante_node/nodes/create_list.json +18 -0
  285. vibrante_node/nodes/deadline_blender_submit.json +38 -0
  286. vibrante_node/nodes/deadline_houdini_submit.json +38 -0
  287. vibrante_node/nodes/deadline_job_status.json +28 -0
  288. vibrante_node/nodes/deadline_maya_submit.json +40 -0
  289. vibrante_node/nodes/delay_timer.json +26 -0
  290. vibrante_node/nodes/example_random_float.json +35 -0
  291. vibrante_node/nodes/file_append.json +18 -0
  292. vibrante_node/nodes/file_write.json +18 -0
  293. vibrante_node/nodes/for_loop.json +46 -0
  294. vibrante_node/nodes/get_dict_value.json +19 -0
  295. vibrante_node/nodes/get_list_item.json +19 -0
  296. vibrante_node/nodes/houdini_action_bake_animation.json +20 -0
  297. vibrante_node/nodes/houdini_action_custom.json +20 -0
  298. vibrante_node/nodes/houdini_action_export_alembic.json +20 -0
  299. vibrante_node/nodes/houdini_action_export_camera_alembic.json +20 -0
  300. vibrante_node/nodes/houdini_action_export_fbx.json +18 -0
  301. vibrante_node/nodes/houdini_action_import_alembic.json +18 -0
  302. vibrante_node/nodes/houdini_action_import_camera.json +17 -0
  303. vibrante_node/nodes/houdini_action_import_fbx.json +18 -0
  304. vibrante_node/nodes/houdini_action_import_obj.json +18 -0
  305. vibrante_node/nodes/houdini_action_new_hip.json +16 -0
  306. vibrante_node/nodes/houdini_action_open_hip.json +17 -0
  307. vibrante_node/nodes/houdini_action_save_hip.json +17 -0
  308. vibrante_node/nodes/houdini_action_scene_info.json +16 -0
  309. vibrante_node/nodes/houdini_action_set_frame_range.json +18 -0
  310. vibrante_node/nodes/houdini_get_action_result.json +21 -0
  311. vibrante_node/nodes/houdini_headless.json +85 -0
  312. vibrante_node/nodes/houdini_scene_snapshot.json +41 -0
  313. vibrante_node/nodes/http_request.json +76 -0
  314. vibrante_node/nodes/if_condition.json +45 -0
  315. vibrante_node/nodes/list_directory.json +17 -0
  316. vibrante_node/nodes/list_images_recursive.json +41 -0
  317. vibrante_node/nodes/list_item_picker.json +41 -0
  318. vibrante_node/nodes/list_length.json +17 -0
  319. vibrante_node/nodes/logical_gate.json +45 -0
  320. vibrante_node/nodes/loop_body.json +62 -0
  321. vibrante_node/nodes/math_add.json +17 -0
  322. vibrante_node/nodes/math_divide.json +17 -0
  323. vibrante_node/nodes/math_modulo.json +17 -0
  324. vibrante_node/nodes/math_multiply.json +36 -0
  325. vibrante_node/nodes/math_subtract.json +17 -0
  326. vibrante_node/nodes/maya_action_assign_material.json +18 -0
  327. vibrante_node/nodes/maya_action_bake_animation.json +21 -0
  328. vibrante_node/nodes/maya_action_create_render_layer.json +19 -0
  329. vibrante_node/nodes/maya_action_custom.json +20 -0
  330. vibrante_node/nodes/maya_action_export_alembic.json +22 -0
  331. vibrante_node/nodes/maya_action_export_camera_alembic.json +20 -0
  332. vibrante_node/nodes/maya_action_export_fbx.json +18 -0
  333. vibrante_node/nodes/maya_action_import_alembic.json +17 -0
  334. vibrante_node/nodes/maya_action_import_camera.json +17 -0
  335. vibrante_node/nodes/maya_action_import_fbx.json +17 -0
  336. vibrante_node/nodes/maya_action_import_obj.json +17 -0
  337. vibrante_node/nodes/maya_action_list_references.json +16 -0
  338. vibrante_node/nodes/maya_action_new_scene.json +16 -0
  339. vibrante_node/nodes/maya_action_open_scene.json +18 -0
  340. vibrante_node/nodes/maya_action_playblast.json +22 -0
  341. vibrante_node/nodes/maya_action_reference_alembic.json +18 -0
  342. vibrante_node/nodes/maya_action_reference_scene.json +18 -0
  343. vibrante_node/nodes/maya_action_save_scene.json +18 -0
  344. vibrante_node/nodes/maya_action_scene_info.json +16 -0
  345. vibrante_node/nodes/maya_action_set_aovs.json +18 -0
  346. vibrante_node/nodes/maya_action_set_frame_range.json +18 -0
  347. vibrante_node/nodes/maya_action_set_render_settings.json +23 -0
  348. vibrante_node/nodes/maya_get_action_result.json +21 -0
  349. vibrante_node/nodes/maya_headless.json +27 -0
  350. vibrante_node/nodes/mcp_call_tool.json +19 -0
  351. vibrante_node/nodes/mcp_list_tools.json +18 -0
  352. vibrante_node/nodes/mcp_server_init.json +23 -0
  353. vibrante_node/nodes/message_node.json +32 -0
  354. vibrante_node/nodes/prism_add_integration.json +49 -0
  355. vibrante_node/nodes/prism_build_entity.json +45 -0
  356. vibrante_node/nodes/prism_change_project.json +37 -0
  357. vibrante_node/nodes/prism_core_info.json +37 -0
  358. vibrante_node/nodes/prism_core_init.json +46 -0
  359. vibrante_node/nodes/prism_create_category.json +44 -0
  360. vibrante_node/nodes/prism_create_entity.json +60 -0
  361. vibrante_node/nodes/prism_create_playblast.json +56 -0
  362. vibrante_node/nodes/prism_create_product_version.json +64 -0
  363. vibrante_node/nodes/prism_create_project.json +50 -0
  364. vibrante_node/nodes/prism_create_scene_from_preset.json +59 -0
  365. vibrante_node/nodes/prism_eval.json +42 -0
  366. vibrante_node/nodes/prism_get_aovs.json +29 -0
  367. vibrante_node/nodes/prism_get_asset_by_name.json +69 -0
  368. vibrante_node/nodes/prism_get_asset_type_by_name.json +62 -0
  369. vibrante_node/nodes/prism_get_asset_types_by_project.json +55 -0
  370. vibrante_node/nodes/prism_get_assets_by_project.json +41 -0
  371. vibrante_node/nodes/prism_get_assets_by_type.json +69 -0
  372. vibrante_node/nodes/prism_get_config.json +48 -0
  373. vibrante_node/nodes/prism_get_current_scene.json +37 -0
  374. vibrante_node/nodes/prism_get_departments.json +37 -0
  375. vibrante_node/nodes/prism_get_entity_info.json +69 -0
  376. vibrante_node/nodes/prism_get_entity_path.json +69 -0
  377. vibrante_node/nodes/prism_get_export_path.json +26 -0
  378. vibrante_node/nodes/prism_get_latest_product_path.json +34 -0
  379. vibrante_node/nodes/prism_get_media.json +29 -0
  380. vibrante_node/nodes/prism_get_media_versions.json +33 -0
  381. vibrante_node/nodes/prism_get_plugin.json +35 -0
  382. vibrante_node/nodes/prism_get_preset_scenes.json +35 -0
  383. vibrante_node/nodes/prism_get_product_versions.json +33 -0
  384. vibrante_node/nodes/prism_get_products.json +29 -0
  385. vibrante_node/nodes/prism_get_project_by_name.json +55 -0
  386. vibrante_node/nodes/prism_get_project_config_path.json +26 -0
  387. vibrante_node/nodes/prism_get_scene_files.json +45 -0
  388. vibrante_node/nodes/prism_get_scene_path.json +23 -0
  389. vibrante_node/nodes/prism_get_sequence_by_project.json +48 -0
  390. vibrante_node/nodes/prism_get_sequences_by_project.json +41 -0
  391. vibrante_node/nodes/prism_get_shot_by_name.json +62 -0
  392. vibrante_node/nodes/prism_get_shot_by_sequence.json +55 -0
  393. vibrante_node/nodes/prism_get_shot_info.json +69 -0
  394. vibrante_node/nodes/prism_get_shots.json +29 -0
  395. vibrante_node/nodes/prism_get_shots_by_project_sequence.json +48 -0
  396. vibrante_node/nodes/prism_get_shots_by_sequence.json +48 -0
  397. vibrante_node/nodes/prism_get_tasks.json +39 -0
  398. vibrante_node/nodes/prism_import_product.json +37 -0
  399. vibrante_node/nodes/prism_list_plugins.json +25 -0
  400. vibrante_node/nodes/prism_list_projects.json +25 -0
  401. vibrante_node/nodes/prism_login_token.json +33 -0
  402. vibrante_node/nodes/prism_monkey_patch.json +46 -0
  403. vibrante_node/nodes/prism_open_scene.json +33 -0
  404. vibrante_node/nodes/prism_popup.json +40 -0
  405. vibrante_node/nodes/prism_register_callback.json +58 -0
  406. vibrante_node/nodes/prism_save_scene_version.json +90 -0
  407. vibrante_node/nodes/prism_send_cmd.json +54 -0
  408. vibrante_node/nodes/prism_set_config.json +55 -0
  409. vibrante_node/nodes/prism_studio_assign_project.json +43 -0
  410. vibrante_node/nodes/prism_trigger_callback.json +42 -0
  411. vibrante_node/nodes/prism_usd_department_layer_path.json +35 -0
  412. vibrante_node/nodes/prism_usd_entity_path.json +29 -0
  413. vibrante_node/nodes/prism_usd_sublayer_path.json +41 -0
  414. vibrante_node/nodes/prism_usd_update_department_layer.json +33 -0
  415. vibrante_node/nodes/prism_usd_update_sublayer.json +33 -0
  416. vibrante_node/nodes/python_script.json +17 -0
  417. vibrante_node/nodes/scene_intent_extractor.json +25 -0
  418. vibrante_node/nodes/set_dict_value.json +20 -0
  419. vibrante_node/nodes/string_concat.json +47 -0
  420. vibrante_node/nodes/string_length.json +16 -0
  421. vibrante_node/nodes/string_lowercase.json +16 -0
  422. vibrante_node/nodes/string_replace.json +18 -0
  423. vibrante_node/nodes/string_split.json +17 -0
  424. vibrante_node/nodes/string_uppercase.json +16 -0
  425. vibrante_node/nodes/variable_node.json +42 -0
  426. vibrante_node/nodes/while_loop.json +18 -0
  427. vibrante_node/splash.png +0 -0
  428. vibrante_node/vfx_workflows/01_prism_project_overview.json +492 -0
  429. vibrante_node/vfx_workflows/02_maya_asset_publish.json +776 -0
  430. vibrante_node/vfx_workflows/03_multi_shot_alembic_export.json +856 -0
  431. vibrante_node/vfx_workflows/04_deadline_render_pipeline.json +994 -0
  432. vibrante_node/vfx_workflows/05_houdini_fx_pipeline.json +1056 -0
  433. vibrante_node/vfx_workflows/06_blender_multi_format_export.json +1206 -0
  434. vibrante_node/website_examples/database_query.json +69 -0
  435. vibrante_node/website_examples/email_notification.json +104 -0
  436. vibrante_node/website_examples/file_batch_processor.json +62 -0
  437. vibrante_node/website_examples/folder_monitor.json +55 -0
  438. vibrante_node/website_examples/hou_sop_chain.json +69 -0
  439. vibrante_node/website_examples/http_request.json +90 -0
  440. vibrante_node/website_examples/image_resizer.json +90 -0
  441. vibrante_node/website_examples/llm_text_generation.json +90 -0
  442. vibrante_node/website_examples/prism_multi_asset_publisher.json +76 -0
  443. vibrante_node/website_examples/regex_replace.json +69 -0
  444. vibrante_node/workflows/If_condition.json +134 -0
  445. vibrante_node/workflows/Maya_WorkFlow.json +464 -0
  446. vibrante_node/workflows/asset_intelligence_pipeline.json +259 -0
  447. vibrante_node/workflows/concat_string_with_loop.json +262 -0
  448. vibrante_node/workflows/delay_time.json +74 -0
  449. vibrante_node/workflows/example_workflow_maya_prism_demo.json +503 -0
  450. vibrante_node/workflows/example_workflow_prism_demo.json +276 -0
  451. vibrante_node/workflows/example_workflow_prism_demo_02.json +221 -0
  452. vibrante_node/workflows/extract_FPS_from_maya_scene.json +265 -0
  453. vibrante_node/workflows/for_each.json +260 -0
  454. vibrante_node/workflows/get_list_item.json +151 -0
  455. vibrante_node/workflows/hou_mcp_scene_context_demo.json +67 -0
  456. vibrante_node/workflows/list_recursive_images.json +103 -0
  457. vibrante_node/workflows/logic_if_example.json +262 -0
  458. vibrante_node/workflows/logic_if_with_variables.json +210 -0
  459. vibrante_node/workflows/loop_break_example.json +197 -0
  460. vibrante_node/workflows/loop_operation_example.json +382 -0
  461. vibrante_node/workflows/mcp_list_tools_demo.json +90 -0
  462. vibrante_node/workflows/prism_assets_workflow.json +131 -0
  463. vibrante_node/workflows/python_script_node.json +89 -0
  464. vibrante_node/workflows/run_in_sequence.json +158 -0
  465. vibrante_node/workflows/scene_intent_pipeline.json +134 -0
  466. vibrante_node/workflows/scene_planning_pipeline.json +258 -0
  467. vibrante_node/workflows/semantic_scene_intent.json +96 -0
  468. vibrante_node/workflows/setup_maya_scene.json +352 -0
  469. vibrante_node/workflows/tutorial_maya_headless_prism_pipeline.json +593 -0
  470. vibrante_node/workflows/two_way_switch.json +341 -0
  471. vibrante_node/workflows/while_loop_class_example.json +192 -0
  472. vibrante_node/workflows/while_loop_example.json +184 -0
  473. vibrante_node/workflows/while_loop_retry_example.json +276 -0
  474. vibrante_node-2.5.1.dist-info/METADATA +715 -0
  475. vibrante_node-2.5.1.dist-info/RECORD +487 -0
  476. vibrante_node-2.5.1.dist-info/WHEEL +5 -0
  477. vibrante_node-2.5.1.dist-info/entry_points.txt +3 -0
  478. vibrante_node-2.5.1.dist-info/licenses/CLA.md +96 -0
  479. vibrante_node-2.5.1.dist-info/licenses/COMMERCIAL_LICENSE.md +170 -0
  480. vibrante_node-2.5.1.dist-info/licenses/LICENSE +178 -0
  481. vibrante_node-2.5.1.dist-info/licenses/LICENSES/AGPL-3.0.txt +661 -0
  482. vibrante_node-2.5.1.dist-info/licenses/LICENSES/CC-BY-4.0-SCOPE.md +53 -0
  483. vibrante_node-2.5.1.dist-info/licenses/LICENSES/CC-BY-4.0.txt +396 -0
  484. vibrante_node-2.5.1.dist-info/licenses/LICENSES/GPL-3.0.txt +674 -0
  485. vibrante_node-2.5.1.dist-info/licenses/LICENSES/LGPL-3.0.txt +165 -0
  486. vibrante_node-2.5.1.dist-info/licenses/LICENSES/README.md +65 -0
  487. vibrante_node-2.5.1.dist-info/top_level.txt +2 -0
src/core/__init__.py ADDED
File without changes
src/core/engine.py ADDED
@@ -0,0 +1,484 @@
1
+ import asyncio
2
+ from typing import Dict, Any, List, Set, Optional
3
+ from uuid import UUID
4
+ from src.core.events import EngineSink
5
+ from src.core.graph import GraphManager
6
+ from src.core.registry import NodeRegistry
7
+ from src.utils.qt_compat import QtCore, Signal
8
+ from src.utils.runtime import SafeRuntime
9
+ from src.nodes.base import BaseNode
10
+
11
+ QObject = QtCore.QObject
12
+
13
+
14
+ class _QtSignalSink:
15
+ """Default event sink: forwards engine events to the public Qt signals.
16
+
17
+ The QObject facade — node_started, node_finished, node_error, node_output,
18
+ node_log, execution_finished — remains the production delivery channel.
19
+ This adapter is how the engine's internal event boundary reaches that
20
+ facade, so existing ``executor.node_*.connect(...)`` consumers (window.py,
21
+ group_node.py, tests) are unaffected.
22
+ """
23
+
24
+ def __init__(self, executor: "NetworkExecutor") -> None:
25
+ self._executor = executor
26
+
27
+ def on_node_started(self, node_id: UUID) -> None:
28
+ self._executor.node_started.emit(node_id)
29
+
30
+ def on_node_finished(self, node_id: UUID, status: str) -> None:
31
+ self._executor.node_finished.emit(node_id, status)
32
+
33
+ def on_node_error(self, node_id: UUID, error_message: str) -> None:
34
+ self._executor.node_error.emit(node_id, error_message)
35
+
36
+ def on_node_output(self, node_id: UUID, output_data: Dict[str, Any]) -> None:
37
+ self._executor.node_output.emit(node_id, output_data)
38
+
39
+ def on_node_log(self, node_id: UUID, message: str, level: str) -> None:
40
+ self._executor.node_log.emit(node_id, message, level)
41
+
42
+ def on_execution_finished(self, success: bool) -> None:
43
+ self._executor.execution_finished.emit(success)
44
+
45
+
46
+ class NetworkExecutor(QObject):
47
+ # Signals for UI feedback
48
+ node_started = Signal(UUID)
49
+ node_finished = Signal(UUID, str) # node_id, status ('success' or 'failed')
50
+ node_error = Signal(UUID, str) # node_id, error_message
51
+ node_output = Signal(UUID, dict) # node_id, output_data
52
+ node_log = Signal(UUID, str, str) # node_id, message, level
53
+ execution_finished = Signal(bool) # success
54
+
55
+ def __init__(self, graph_manager: GraphManager, sink: Optional[EngineSink] = None):
56
+ super().__init__()
57
+ self.graph_manager = graph_manager
58
+ # Event boundary (R3): every engine emission is routed through a typed
59
+ # sink. The default sink forwards to the public Qt signals (facade);
60
+ # a recording/headless sink can be injected without consumers changing.
61
+ self._sink: EngineSink = sink if sink is not None else _QtSignalSink(self)
62
+ self.node_instances: Dict[UUID, Any] = {}
63
+ self.node_results: Dict[UUID, Dict[str, Any]] = {}
64
+ self._executed_nodes: Set[UUID] = set() # Nodes that finished successfully
65
+ self._skipped_nodes: Set[UUID] = set() # Nodes skipped as unknown node types (F-04b)
66
+ self._currently_executing: Set[UUID] = set() # Nodes currently in the stack
67
+ self._is_stopped = False
68
+ self._active_tasks: Set[asyncio.Task] = set()
69
+ self._finished_event: Optional[asyncio.Event] = None
70
+
71
+ # Pre-calculated lookup maps
72
+ self._incoming_data_conns: Dict[UUID, List[Any]] = {}
73
+ self._driven_by_flow: Set[UUID] = set()
74
+
75
+ def stop(self) -> None:
76
+ self._is_stopped = True
77
+ for task in self._active_tasks:
78
+ task.cancel()
79
+ if self._finished_event is not None:
80
+ self._finished_event.set()
81
+
82
+ def _track_task(self, coro):
83
+ """Helper to create and track a task in the current event loop."""
84
+ if self._is_stopped: return None
85
+ task = asyncio.create_task(coro)
86
+ self._active_tasks.add(task)
87
+ def on_done(t):
88
+ self._active_tasks.discard(t)
89
+ if not self._active_tasks:
90
+ self._finished_event.set()
91
+ task.add_done_callback(on_done)
92
+ return task
93
+
94
+ async def run(self, init_only: bool = False) -> None:
95
+ """
96
+ Executes the graph. Standardizes on flow-based execution via output triggers.
97
+
98
+ :param init_only: When True, only run nodes with init_priority > 0 and
99
+ stop. Used after a workflow is loaded so init nodes
100
+ (login/auth/data-init) run automatically.
101
+ """
102
+ from src.nodes.base import BaseNode
103
+ BaseNode.memory.clear()
104
+
105
+ self._executed_nodes.clear()
106
+ self._skipped_nodes.clear()
107
+ self._currently_executing.clear()
108
+ self._is_stopped = False
109
+ self._active_tasks.clear()
110
+ self._finished_event = asyncio.Event()
111
+
112
+ # 1. PRE-CALCULATE LOOKUP MAPS
113
+ self._incoming_data_conns = {}
114
+ self._driven_by_flow = set()
115
+ for conn in self.graph_manager.connections:
116
+ if conn.is_exec:
117
+ self._driven_by_flow.add(conn.to_node)
118
+ else:
119
+ self._incoming_data_conns.setdefault(conn.to_node, []).append(conn)
120
+
121
+ # 2. PREPARE ALL NODES
122
+ self.node_results = {}
123
+ self.node_instances = {}
124
+
125
+ for node_id, node_model in self.graph_manager.nodes.items():
126
+ if self._is_stopped:
127
+ self._sink.on_execution_finished(False)
128
+ return
129
+
130
+ node_class = NodeRegistry.get_class(node_model.node_id)
131
+ if not node_class:
132
+ # F-04b: an unknown node type must NOT abort the whole run.
133
+ # Flag it per-node and continue so the remaining graph can
134
+ # still execute (pipeline-style partial-failure semantics).
135
+ err = f"Unknown node type: {node_model.node_id} (skipped)"
136
+ self._skipped_nodes.add(node_id)
137
+ self._sink.on_node_error(node_id, err)
138
+ self._sink.on_node_log(node_id, err, "error")
139
+ self.node_results[node_id] = {}
140
+ continue
141
+
142
+ instance = node_class()
143
+ instance.name = node_model.node_id
144
+
145
+ # 1. RESTORE DYNAMIC PORTS
146
+ instance.restore_from_parameters(node_model.parameters)
147
+
148
+ # 2. SYNC PARAMETERS
149
+ # Ignore saved parameter values for ports that have incoming data connections,
150
+ # so they start with their default state for each run.
151
+ incoming_ports = {c.to_port for c in self._incoming_data_conns.get(node_id, [])}
152
+
153
+ for p_name, p_val in node_model.parameters.items():
154
+ # If this port will be driven by an incoming data connection, reset to its port default
155
+ if p_name in incoming_ports:
156
+ port_obj = instance.inputs.get(p_name)
157
+ default = getattr(port_obj, 'default', None) if port_obj else None
158
+ instance.parameters[p_name] = default
159
+ else:
160
+ # Copy saved workflow parameter into the instance even if the node
161
+ # didn't predefine that parameter (e.g. `python_code`). This ensures
162
+ # dynamic/runtime-only parameters saved in workflows are available
163
+ # during execution.
164
+ instance.parameters[p_name] = p_val
165
+
166
+ instance.clear_outputs()
167
+ self.node_instances[node_id] = instance
168
+ self.node_results[node_id] = {}
169
+
170
+ # SETUP HOOKS
171
+ instance._check_stopped = lambda: self._is_stopped
172
+ def create_logger(nid):
173
+ return lambda msg, lvl: self._sink.on_node_log(nid, msg, lvl)
174
+ instance._on_log = create_logger(node_id)
175
+ instance._flush_pending_logs()
176
+
177
+ def create_output_handler(nid):
178
+ async def handler(name, value):
179
+ if self._is_stopped: return
180
+
181
+ # Store result immediately
182
+ self.node_results[nid][name] = value
183
+ self._sink.on_node_output(nid, {name: value})
184
+
185
+ # 1. REACTIVE DATA PROPAGATION
186
+ # exec_conns is defined below, but Python closures will find it
187
+ for conn in self.graph_manager.connections:
188
+ if conn.from_node == nid and conn.from_port == name and not conn.is_exec:
189
+ target_instance = self.node_instances.get(conn.to_node)
190
+ if target_instance:
191
+ # Sync both parameter and result cache
192
+ target_instance.parameters[conn.to_port] = value
193
+ self.node_results[conn.to_node][conn.to_port] = value
194
+
195
+ # Invalidate pure data nodes so they re-run next pull.
196
+ # This is essential for loops: when upstream data changes
197
+ # (e.g. current_index → get_list_item → entity → prism_get_shot_info)
198
+ # the data node must recompute, not serve a stale cached result.
199
+ if conn.to_node not in self._driven_by_flow:
200
+ self._executed_nodes.discard(conn.to_node)
201
+
202
+ # Notify the target so reactive nodes (e.g. TwoWaySwitch, GetVariable)
203
+ # can update their own outputs when upstream data changes during execution.
204
+ # Only called here (reactive propagation), NOT in the pre-execute sync,
205
+ # to avoid calling on_parameter_changed with partially-synced parameters.
206
+ await target_instance.on_parameter_changed(conn.to_port, value)
207
+
208
+ # 2. FLOW-BASED ROUTING
209
+ if bool(value) is True: # Handle both True and truthy values for execution pins
210
+ node_inst = self.node_instances.get(nid)
211
+ port_def = node_inst.outputs.get(name) if node_inst else None
212
+ if port_def and getattr(port_def, 'data_type', 'any') == 'exec':
213
+ for conn in self.graph_manager.connections:
214
+ if conn.from_node == nid and conn.from_port == name and conn.is_exec:
215
+ await self._execute_flow(conn.to_node)
216
+ return handler
217
+ instance._on_output = create_output_handler(node_id)
218
+
219
+ # 2. PRISM BOOTSTRAP
220
+ # If any prism_core_init node exists, initialise PrismCore before the
221
+ # main execution loop so every prism_* node can resolve it from the
222
+ # shared cache without requiring an explicit 'core' wire.
223
+ await self._bootstrap_prism_if_needed()
224
+
225
+ # 2.5 INIT NODES — run before the main graph (login, auth, data-init, etc.)
226
+ await self._run_init_nodes()
227
+ if self._is_stopped:
228
+ self._sink.on_execution_finished(False)
229
+ return
230
+
231
+ # If init_only, stop here — caller wants the init phase only
232
+ # (e.g. immediately after loading a saved workflow).
233
+ if init_only:
234
+ self._sink.on_execution_finished(True)
235
+ return
236
+
237
+ # 3. IDENTIFY ENTRY NODES
238
+ exec_conns = [c for c in self.graph_manager.connections if c.is_exec]
239
+
240
+ try:
241
+ if exec_conns:
242
+ # In flow mode, we start:
243
+ # 1. Any node that has an exec_out but no connected exec_in
244
+ # 2. Any pure data node (no exec pins at all) that has connections
245
+
246
+ connected_nodes = {c.from_node for c in self.graph_manager.connections} | \
247
+ {c.to_node for c in self.graph_manager.connections}
248
+ has_exec_in_conn = {c.to_node for c in exec_conns}
249
+
250
+ entry_nodes = []
251
+ for node_id, instance in self.node_instances.items():
252
+ if node_id not in connected_nodes: continue
253
+ if node_id in self._executed_nodes: continue # already ran as init node
254
+
255
+ has_exec_in_pin = any(p.data_type == 'exec' for p in instance.inputs.values())
256
+ has_exec_out_pin = any(p.data_type == 'exec' for p in instance.outputs.values())
257
+
258
+ # Logic:
259
+ # 1. If it has no exec_in pin, it's a potential starter (data node or flow starter)
260
+ # 2. If it HAS an exec_in pin but NO connection to it, it's a flow starter
261
+ if not has_exec_in_pin:
262
+ entry_nodes.append(node_id)
263
+ elif node_id not in has_exec_in_conn:
264
+ entry_nodes.append(node_id)
265
+
266
+ if entry_nodes:
267
+ for start_node in entry_nodes:
268
+ self._track_task(self._execute_flow(start_node))
269
+
270
+ # WAIT FOR ALL FLOWS TO FINISH
271
+ while self._active_tasks and not self._is_stopped:
272
+ await self._finished_event.wait()
273
+ self._finished_event.clear()
274
+ await asyncio.sleep(0.05)
275
+ else:
276
+ # CLASSIC DATA-FLOW (Using Topological Sorting)
277
+ # Execute the graph layer by layer as mandated by GEMINI.md
278
+ layers = self.graph_manager.get_topological_sort()
279
+
280
+ for layer in layers:
281
+ if self._is_stopped: break
282
+
283
+ # Skip nodes already executed by the init phase
284
+ layer = [nid for nid in layer if nid not in self._executed_nodes]
285
+ if not layer:
286
+ continue
287
+
288
+ # Track each node execution as a task so it can be cancelled
289
+ task_pairs = []
290
+ for nid in layer:
291
+ task = self._track_task(self._run_single_node(nid))
292
+ # Filter out None if _track_task returned None due to stop
293
+ if task is not None:
294
+ task_pairs.append((nid, task))
295
+
296
+ if task_pairs:
297
+ results = await asyncio.gather(*(t for _, t in task_pairs), return_exceptions=True)
298
+
299
+ # Check for errors or cancellation in layer. Node-level
300
+ # failures (exceptions caught by SafeRuntime) and escaped
301
+ # plumbing exceptions are now signalled per node inside
302
+ # _run_single_node_impl (R1/R1.1), so results here are
303
+ # normally booleans. This loop remains as a task-level
304
+ # backstop: if anything still reaches it as an Exception,
305
+ # report it per node instead of printing and silently
306
+ # dropping it. Cancellation means the user requested a
307
+ # stop — that is not a node failure and keeps the stop
308
+ # semantics intact.
309
+ for (nid, _task), res in zip(task_pairs, results):
310
+ if isinstance(res, asyncio.CancelledError):
311
+ self._is_stopped = True
312
+ break
313
+ if isinstance(res, Exception):
314
+ err = f"Node execution failed: {res}"
315
+ self._sink.on_node_error(nid, err)
316
+ self._sink.on_node_log(nid, err, "error")
317
+ self._sink.on_node_finished(nid, "failed")
318
+
319
+ finally:
320
+ self._sink.on_execution_finished(not self._is_stopped)
321
+
322
+ async def _run_init_nodes(self):
323
+ """Execute init-priority nodes (init_priority > 0) sequentially before the main graph.
324
+
325
+ Higher init_priority values run first. Each init node's full exec chain
326
+ completes before the next init node starts. Results are cached in
327
+ _executed_nodes so the main loop skips them.
328
+ """
329
+ init_node_ids = sorted(
330
+ [nid for nid, m in self.graph_manager.nodes.items() if getattr(m, 'init_priority', 0) > 0],
331
+ key=lambda nid: self.graph_manager.nodes[nid].init_priority,
332
+ reverse=True,
333
+ )
334
+ for node_id in init_node_ids:
335
+ if self._is_stopped:
336
+ return
337
+ self._finished_event.clear()
338
+ self._track_task(self._execute_flow(node_id))
339
+ while self._active_tasks and not self._is_stopped:
340
+ await self._finished_event.wait()
341
+ self._finished_event.clear()
342
+ await asyncio.sleep(0.05)
343
+
344
+ async def _bootstrap_prism_if_needed(self):
345
+ """Run bootstrap_prism_core before the main graph if a prism_core_init
346
+ node is present and PrismCore is not already cached."""
347
+ from src.utils.prism_core import resolve_prism_core, bootstrap_prism_core
348
+ if resolve_prism_core() is not None:
349
+ return
350
+ for node_id, node_model in self.graph_manager.nodes.items():
351
+ if node_model.node_id == "prism_core_init":
352
+ params = node_model.parameters
353
+ scripts_path = params.get("prism_scripts_path", "C:/Program Files/Prism2/Scripts")
354
+ load_project = bool(params.get("load_project", True))
355
+ show_ui = bool(params.get("show_ui", False))
356
+ try:
357
+ bootstrap_prism_core(
358
+ prism_scripts_path=scripts_path,
359
+ load_project=load_project,
360
+ show_ui=show_ui,
361
+ )
362
+ except Exception as e:
363
+ self._sink.on_node_log(node_id, f"Prism bootstrap failed: {e}", "error")
364
+ break
365
+
366
+ async def _execute_flow(self, node_id: UUID):
367
+ """Executes a single node. Flow continuation is handled EXCLUSIVELY by set_output calls."""
368
+ if self._is_stopped: return
369
+
370
+ await self._run_single_node_impl(node_id, is_data_pull=False)
371
+
372
+ async def _run_single_node(self, node_id: UUID) -> bool:
373
+ # This method is now redundant for internal calls but kept for external/reactive entry points
374
+ return await self._run_single_node_impl(node_id, is_data_pull=False)
375
+
376
+ async def _run_single_node_impl(self, node_id: UUID, is_data_pull: bool = False) -> bool:
377
+ """Internal implementation of node execution without locking, to allow recursion for data pulling."""
378
+ if self._is_stopped: return False
379
+
380
+ # Guard 1: Data Pulling Guard
381
+ # If we are just pulling data dependencies, don't run the same node twice.
382
+ # Flow triggers (is_data_pull=False) are allowed to re-run nodes (e.g. in loops).
383
+ if is_data_pull and node_id in self._executed_nodes:
384
+ return True
385
+
386
+ # Guard 2: Re-entrancy Guard (Recursion Guard)
387
+ # Prevents infinite stack depth if there's a cycle.
388
+ if node_id in self._currently_executing:
389
+ return True
390
+
391
+ self._currently_executing.add(node_id)
392
+
393
+ try:
394
+ node_model = self.graph_manager.nodes.get(node_id)
395
+ instance = self.node_instances.get(node_id)
396
+ if instance is None:
397
+ # F-04b: node was skipped during prepare (unknown type). Stop this
398
+ # chain quietly — never raise a KeyError or abort the whole run.
399
+ if node_id not in self._skipped_nodes:
400
+ self._skipped_nodes.add(node_id)
401
+ name = node_model.node_id if node_model else node_id
402
+ err = f"Unknown node type: {name} (skipped)"
403
+ self._sink.on_node_error(node_id, err)
404
+ self._sink.on_node_log(node_id, err, "error")
405
+ self.node_results[node_id] = {}
406
+ return False
407
+
408
+ # BYPASS: skip execution but pass exec flow through so the chain continues.
409
+ if node_model and getattr(node_model, 'bypassed', False):
410
+ self._sink.on_node_started(node_id)
411
+ self._sink.on_node_finished(node_id, "success")
412
+ # Fire every exec_out so downstream nodes still run.
413
+ for conn in self.graph_manager.connections:
414
+ if conn.from_node == node_id and conn.is_exec:
415
+ await self._execute_flow(conn.to_node)
416
+ return True
417
+
418
+ # 1. PULL UPSTREAM DATA NODES (In Port Order)
419
+ incoming = self._incoming_data_conns.get(node_id, [])
420
+
421
+ for port_name in instance.inputs:
422
+ for conn in incoming:
423
+ if conn.to_port == port_name:
424
+ from_id = conn.from_node
425
+ from_inst = self.node_instances.get(from_id)
426
+ if from_inst:
427
+ # Check if source node is pullable (either no exec_in, or it's not driven by flow)
428
+ is_driven_by_flow = from_id in self._driven_by_flow
429
+ if not is_driven_by_flow:
430
+ await self._run_single_node_impl(from_id, is_data_pull=True)
431
+
432
+ self._sink.on_node_started(node_id)
433
+
434
+ # Reset all exec outputs
435
+ for name, port in instance.outputs.items():
436
+ if port.data_type == 'exec':
437
+ instance.parameters[name] = None
438
+
439
+ # Sync all inputs
440
+ for conn in incoming:
441
+ from_results = self.node_results.get(conn.from_node, {})
442
+ if conn.from_port in from_results:
443
+ val = from_results.get(conn.from_port)
444
+ instance.parameters[conn.to_port] = val
445
+
446
+ inputs = instance.parameters.copy()
447
+ success, result, error = await SafeRuntime.run_node_safe(instance.execute, inputs)
448
+
449
+ if success:
450
+ self._executed_nodes.add(node_id)
451
+ result = result or {}
452
+ self.node_results[node_id].update(result)
453
+ self._sink.on_node_output(node_id, result)
454
+ self._sink.on_node_finished(node_id, "success")
455
+ return True
456
+ else:
457
+ self._sink.on_node_error(node_id, error)
458
+ self._sink.on_node_finished(node_id, "failed")
459
+ return False
460
+ except asyncio.CancelledError:
461
+ # R1.1: user-driven stop / cancellation is not a node failure — let
462
+ # the stop machinery report it (execution_finished(False)).
463
+ raise
464
+ except Exception as e:
465
+ # R1.1: an exception escaped the per-node safe wrapper (engine
466
+ # plumbing outside SafeRuntime — e.g. prepare, data-pull recursion,
467
+ # bypass chain, flow routing, or post-execute bookkeeping). In flow
468
+ # mode such an exception used to bubble out of the entry/init task
469
+ # and was dropped silently by asyncio ("Task exception was never
470
+ # retrieved") with no signals at all — or, when nested inside another
471
+ # node's execute, it was caught by the ANCESTOR's SafeRuntime and
472
+ # mis-attributed to the wrong node. Report it here for the node on
473
+ # the stack — correct attribution, exactly once — and let the run
474
+ # continue (F-04b pipeline semantics), the same way SafeRuntime
475
+ # handles node-execute failures. Duplicates cannot occur: SafeRuntime
476
+ # failures are returned (False, error), never raised, so they never
477
+ # reach this clause.
478
+ err = f"Node execution failed: {e}"
479
+ self._sink.on_node_error(node_id, err)
480
+ self._sink.on_node_log(node_id, err, "error")
481
+ self._sink.on_node_finished(node_id, "failed")
482
+ return False
483
+ finally:
484
+ self._currently_executing.discard(node_id)
src/core/events.py ADDED
@@ -0,0 +1,32 @@
1
+ """
2
+ Engine event-sink protocol (Qt-free).
3
+
4
+ The execution engine (`NetworkExecutor`) reports node lifecycle events through
5
+ this small typed boundary instead of coupling directly to Qt's signal
6
+ machinery. The default sink forwards each event to the engine's public Qt
7
+ signals (the QObject facade retained for the UI); a recording / headless sink
8
+ can be injected via ``NetworkExecutor(graph_manager, sink=...)`` with no
9
+ consumer of the Qt signals having to change.
10
+
11
+ This module intentionally contains **no Qt imports**, so it stays importable in
12
+ Qt-free environments (see the R3 non-Qt import probe, REGRESSION_REPORT §16).
13
+ """
14
+
15
+ from typing import Any, Dict, Protocol
16
+ from uuid import UUID
17
+
18
+
19
+ class EngineSink(Protocol):
20
+ """Typed callbacks matching the six public ``NetworkExecutor`` signals."""
21
+
22
+ def on_node_started(self, node_id: UUID) -> None: ...
23
+
24
+ def on_node_finished(self, node_id: UUID, status: str) -> None: ...
25
+
26
+ def on_node_error(self, node_id: UUID, error_message: str) -> None: ...
27
+
28
+ def on_node_output(self, node_id: UUID, output_data: Dict[str, Any]) -> None: ...
29
+
30
+ def on_node_log(self, node_id: UUID, message: str, level: str) -> None: ...
31
+
32
+ def on_execution_finished(self, success: bool) -> None: ...
src/core/graph.py ADDED
@@ -0,0 +1,74 @@
1
+ from typing import Dict, List, Set, Optional, Tuple
2
+ from uuid import UUID, uuid4
3
+ import toposort
4
+ from src.core.models import WorkflowModel, NodeInstanceModel, ConnectionModel
5
+
6
+ class GraphManager:
7
+ def __init__(self):
8
+ self.nodes: Dict[UUID, NodeInstanceModel] = {}
9
+ self.connections: List[ConnectionModel] = []
10
+
11
+ def add_node(self, node: NodeInstanceModel):
12
+ self.nodes[node.instance_id] = node
13
+
14
+ def remove_node(self, node_id: UUID):
15
+ if node_id in self.nodes:
16
+ del self.nodes[node_id]
17
+ # Remove associated connections
18
+ self.connections = [c for c in self.connections if c.from_node != node_id and c.to_node != node_id]
19
+
20
+ def add_connection(self, connection: ConnectionModel) -> bool:
21
+ """
22
+ Adds a connection and checks for cycles. Returns False if a cycle is created.
23
+ """
24
+ self.connections.append(connection)
25
+ if not self.is_dag():
26
+ self.connections.pop()
27
+ return False
28
+ return True
29
+
30
+ def remove_connection(self, connection_id: UUID):
31
+ self.connections = [c for c in self.connections if c.id != connection_id]
32
+
33
+ def is_dag(self) -> bool:
34
+ """
35
+ Checks if the current graph is a Directed Acyclic Graph (DAG).
36
+ """
37
+ try:
38
+ self.get_topological_sort()
39
+ return True
40
+ except toposort.CircularDependencyError:
41
+ return False
42
+
43
+ def get_topological_sort(self, ignore_ports: List[str] = None) -> List[Set[UUID]]:
44
+ """
45
+ Returns the nodes in topological order for execution.
46
+ :param ignore_ports: List of port names to ignore when calculating dependencies (breaks cycles).
47
+ """
48
+ if ignore_ports is None:
49
+ ignore_ports = ["break_condition"] # Default special ports that allow feedback
50
+
51
+ data = {}
52
+ # Ensure all nodes are in the data dictionary
53
+ for node_id in self.nodes:
54
+ data[node_id] = set()
55
+
56
+ # Add dependencies from connections
57
+ for conn in self.connections:
58
+ # If the destination port is in the ignore list, don't count it as a hard dependency
59
+ if conn.to_port in ignore_ports:
60
+ continue
61
+
62
+ data[conn.to_node].add(conn.from_node)
63
+
64
+ return list(toposort.toposort(data))
65
+
66
+ def to_model(self) -> WorkflowModel:
67
+ return WorkflowModel(
68
+ nodes=list(self.nodes.values()),
69
+ connections=self.connections
70
+ )
71
+
72
+ def from_model(self, model: WorkflowModel):
73
+ self.nodes = {node.instance_id: node for node in model.nodes}
74
+ self.connections = model.connections