graphon 0.7.0__tar.gz → 0.9.0__tar.gz

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 (348) hide show
  1. graphon-0.9.0/PKG-INFO +68 -0
  2. graphon-0.9.0/README.md +37 -0
  3. {graphon-0.7.0 → graphon-0.9.0}/pyproject.toml +34 -7
  4. {graphon-0.7.0 → graphon-0.9.0}/pyproject.toml.orig +34 -8
  5. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/dsl/importer.py +68 -28
  6. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/dsl/node_factory.py +292 -95
  7. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/dsl/slim/llm.py +34 -64
  8. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/dsl/slim/package_loader.py +3 -2
  9. graphon-0.9.0/src/graphon/engine/__init__.py +3 -0
  10. graphon-0.9.0/src/graphon/engine/command/README.md +39 -0
  11. graphon-0.9.0/src/graphon/engine/command/__init__.py +23 -0
  12. graphon-0.9.0/src/graphon/engine/command/builtin/__init__.py +1 -0
  13. graphon-0.7.0/src/graphon/graph_engine/command_channels/in_memory_channel.py → graphon-0.9.0/src/graphon/engine/command/builtin/in_memory.py +6 -6
  14. graphon-0.7.0/src/graphon/graph_engine/command_channels/redis_channel.py → graphon-0.9.0/src/graphon/engine/command/builtin/redis.py +67 -62
  15. graphon-0.9.0/src/graphon/engine/command/entities.py +42 -0
  16. graphon-0.9.0/src/graphon/engine/command/processor.py +127 -0
  17. graphon-0.9.0/src/graphon/engine/command/protocol.py +39 -0
  18. graphon-0.9.0/src/graphon/engine/container_handler/__init__.py +13 -0
  19. graphon-0.9.0/src/graphon/engine/container_handler/builtin/__init__.py +1 -0
  20. graphon-0.7.0/src/graphon/graph_engine/iteration_container_handler.py → graphon-0.9.0/src/graphon/engine/container_handler/builtin/iteration.py +121 -82
  21. graphon-0.7.0/src/graphon/graph_engine/loop_container_handler.py → graphon-0.9.0/src/graphon/engine/container_handler/builtin/loop.py +112 -50
  22. graphon-0.9.0/src/graphon/engine/container_handler/container_handler_factory.py +8 -0
  23. graphon-0.9.0/src/graphon/engine/container_handler/protocol.py +73 -0
  24. graphon-0.9.0/src/graphon/engine/dispatcher.py +221 -0
  25. graphon-0.9.0/src/graphon/engine/engine.py +450 -0
  26. graphon-0.9.0/src/graphon/engine/event/__init__.py +1 -0
  27. graphon-0.7.0/src/graphon/graph_engine/error_handler.py → graphon-0.9.0/src/graphon/engine/event/node_failure.py +40 -62
  28. graphon-0.7.0/src/graphon/graph_engine/event_management/event_handlers.py → graphon-0.9.0/src/graphon/engine/event/processor.py +139 -82
  29. graphon-0.9.0/src/graphon/engine/event/stream.py +85 -0
  30. graphon-0.9.0/src/graphon/engine/filter/__init__.py +13 -0
  31. graphon-0.9.0/src/graphon/engine/filter/builtin/__init__.py +1 -0
  32. graphon-0.9.0/src/graphon/engine/filter/builtin/response_stream/__init__.py +3 -0
  33. graphon-0.9.0/src/graphon/engine/filter/builtin/response_stream/filter.py +264 -0
  34. graphon-0.9.0/src/graphon/engine/filter/builtin/response_stream/frame_graph.py +175 -0
  35. graphon-0.9.0/src/graphon/engine/filter/builtin/response_stream/frame_session.py +662 -0
  36. graphon-0.9.0/src/graphon/engine/filter/builtin/response_stream/ids.py +6 -0
  37. graphon-0.9.0/src/graphon/engine/filter/builtin/response_stream/reachability.py +76 -0
  38. graphon-0.9.0/src/graphon/engine/filter/builtin/response_stream/reply_order.py +182 -0
  39. graphon-0.9.0/src/graphon/engine/filter/builtin/response_stream/snapshot.py +151 -0
  40. graphon-0.9.0/src/graphon/engine/filter/builtin/response_stream/template_stream.py +493 -0
  41. graphon-0.9.0/src/graphon/engine/filter/builtin/response_stream/v1.py +250 -0
  42. graphon-0.9.0/src/graphon/engine/filter/builtin/response_stream/v2.py +84 -0
  43. graphon-0.9.0/src/graphon/engine/filter/builtin/response_stream/v3.py +72 -0
  44. {graphon-0.7.0/src/graphon/graph_engine/filters → graphon-0.9.0/src/graphon/engine/filter}/chain.py +14 -14
  45. graphon-0.9.0/src/graphon/engine/filter/protocol.py +52 -0
  46. graphon-0.9.0/src/graphon/engine/frame.py +458 -0
  47. graphon-0.9.0/src/graphon/engine/layer/README.md +50 -0
  48. graphon-0.9.0/src/graphon/engine/layer/__init__.py +13 -0
  49. graphon-0.9.0/src/graphon/engine/layer/base.py +166 -0
  50. graphon-0.9.0/src/graphon/engine/layer/builtin/__init__.py +1 -0
  51. {graphon-0.7.0/src/graphon/graph_engine/layers → graphon-0.9.0/src/graphon/engine/layer/builtin}/execution_limits.py +29 -48
  52. graphon-0.9.0/src/graphon/engine/ready_queue/__init__.py +11 -0
  53. graphon-0.9.0/src/graphon/engine/ready_queue/entities.py +5 -0
  54. graphon-0.9.0/src/graphon/engine/ready_queue/in_memory.py +5 -0
  55. graphon-0.9.0/src/graphon/engine/scheduler.py +418 -0
  56. graphon-0.9.0/src/graphon/engine/worker/__init__.py +12 -0
  57. {graphon-0.7.0/src/graphon/graph_engine → graphon-0.9.0/src/graphon/engine/worker}/worker.py +140 -93
  58. graphon-0.9.0/src/graphon/engine/worker/worker_pool.py +132 -0
  59. {graphon-0.7.0/src/graphon/graph_events → graphon-0.9.0/src/graphon/engine_events}/__init__.py +7 -8
  60. {graphon-0.7.0/src/graphon/graph_events → graphon-0.9.0/src/graphon/engine_events}/agent.py +2 -2
  61. {graphon-0.7.0/src/graphon/graph_events → graphon-0.9.0/src/graphon/engine_events}/base.py +8 -14
  62. graphon-0.9.0/src/graphon/engine_events/frame.py +40 -0
  63. {graphon-0.7.0/src/graphon/graph_events → graphon-0.9.0/src/graphon/engine_events}/graph.py +7 -7
  64. {graphon-0.7.0/src/graphon/graph_events → graphon-0.9.0/src/graphon/engine_events}/iteration.py +5 -5
  65. {graphon-0.7.0/src/graphon/graph_events → graphon-0.9.0/src/graphon/engine_events}/loop.py +5 -5
  66. {graphon-0.7.0/src/graphon/graph_events → graphon-0.9.0/src/graphon/engine_events}/node.py +14 -14
  67. {graphon-0.7.0/src/graphon/graph_events → graphon-0.9.0/src/graphon/engine_events}/traversal.py +3 -2
  68. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/entities/__init__.py +0 -2
  69. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/entities/base_node_data.py +11 -0
  70. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/entities/workflow_execution.py +3 -1
  71. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/file/models.py +17 -1
  72. graphon-0.9.0/src/graphon/file/runtime.py +48 -0
  73. graphon-0.9.0/src/graphon/file/serialization.py +31 -0
  74. graphon-0.9.0/src/graphon/graph/graph.py +919 -0
  75. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/graph/graph_template.py +1 -1
  76. graphon-0.9.0/src/graphon/graph/scoping.py +132 -0
  77. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/graph/validation.py +59 -24
  78. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/http/__init__.py +0 -8
  79. graphon-0.9.0/src/graphon/model_runtime/README.md +57 -0
  80. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/callbacks/base_callback.py +2 -2
  81. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/callbacks/logging_callback.py +2 -2
  82. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/entities/llm_entities.py +6 -1
  83. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/entities/message_entities.py +25 -11
  84. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/entities/model_entities.py +4 -5
  85. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/model_providers/base/large_language_model.py +74 -27
  86. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/model_providers/base/tokenizers/gpt2_tokenizer.py +16 -26
  87. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/model_providers/base/tts_model.py +7 -3
  88. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/protocols/tts_runtime.py +10 -1
  89. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/utils/encoders.py +6 -6
  90. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/node_events/__init__.py +2 -2
  91. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/node_events/agent.py +2 -2
  92. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/node_events/base.py +2 -2
  93. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/node_events/iteration.py +5 -5
  94. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/node_events/loop.py +5 -5
  95. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/node_events/node.py +12 -12
  96. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/answer/answer_node.py +19 -34
  97. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/base/node.py +43 -43
  98. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/base/template.py +1 -1
  99. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/base/variable_template_parser.py +2 -2
  100. graphon-0.9.0/src/graphon/nodes/code/__init__.py +17 -0
  101. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/code/code_node.py +9 -24
  102. graphon-0.9.0/src/graphon/nodes/code/protocols.py +21 -0
  103. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/container_effects.py +16 -20
  104. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/document_extractor/node.py +121 -56
  105. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/end/end_node.py +1 -1
  106. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/http_request/node.py +14 -11
  107. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/human_input/entities.py +1 -1
  108. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/human_input/human_input_node.py +10 -11
  109. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/if_else/if_else_node.py +1 -1
  110. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/iteration/iteration_node.py +36 -31
  111. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/list_operator/entities.py +1 -1
  112. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/list_operator/node.py +7 -5
  113. graphon-0.9.0/src/graphon/nodes/llm/__init__.py +32 -0
  114. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/llm/entities.py +12 -3
  115. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/llm/file_saver.py +2 -2
  116. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/llm/llm_utils.py +24 -25
  117. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/llm/node.py +184 -758
  118. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/loop/loop_node.py +74 -30
  119. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/parameter_extractor/parameter_extractor_node.py +17 -19
  120. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/question_classifier/question_classifier_node.py +11 -11
  121. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/start/start_node.py +2 -2
  122. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/template_transform/template_transform_node.py +7 -8
  123. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/tool/tool_node.py +29 -26
  124. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_aggregator/variable_aggregator_node.py +2 -2
  125. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_assigner/v1/node.py +14 -21
  126. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_assigner/v2/helpers.py +2 -0
  127. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_assigner/v2/node.py +10 -10
  128. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/protocols/__init__.py +4 -4
  129. graphon-0.9.0/src/graphon/runtime/__init__.py +24 -0
  130. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/runtime/container_state.py +36 -2
  131. graphon-0.7.0/src/graphon/graph_engine/domain/graph_execution.py → graphon-0.9.0/src/graphon/runtime/execution.py +93 -24
  132. graphon-0.7.0/src/graphon/entities/graph_init_params.py → graphon-0.9.0/src/graphon/runtime/init_params.py +3 -5
  133. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/runtime/read_only_wrappers.py +6 -6
  134. graphon-0.9.0/src/graphon/runtime/ready_queue/__init__.py +7 -0
  135. {graphon-0.7.0/src/graphon/graph_engine → graphon-0.9.0/src/graphon/runtime}/ready_queue/in_memory.py +39 -17
  136. graphon-0.7.0/src/graphon/runtime/ready_queue.py → graphon-0.9.0/src/graphon/runtime/ready_queue/protocol.py +8 -3
  137. graphon-0.7.0/src/graphon/graph_engine/ready_queue/protocol.py → graphon-0.9.0/src/graphon/runtime/ready_queue/tasks.py +2 -23
  138. graphon-0.9.0/src/graphon/runtime/runtime_state/__init__.py +9 -0
  139. graphon-0.9.0/src/graphon/runtime/runtime_state/protocol.py +49 -0
  140. graphon-0.9.0/src/graphon/runtime/runtime_state/snapshot.py +203 -0
  141. graphon-0.9.0/src/graphon/runtime/runtime_state/state.py +384 -0
  142. graphon-0.9.0/src/graphon/runtime/runtime_state/v1.py +147 -0
  143. graphon-0.9.0/src/graphon/runtime/runtime_state/v2.py +273 -0
  144. graphon-0.9.0/src/graphon/runtime/runtime_state/v3.py +85 -0
  145. graphon-0.7.0/src/graphon/runtime/graph_runtime_state_protocol.py → graphon-0.9.0/src/graphon/runtime/runtime_state_protocol.py +10 -4
  146. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/runtime/variable_pool.py +3 -0
  147. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/utils/condition/processor.py +3 -3
  148. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/variables/__init__.py +2 -0
  149. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/variables/factory.py +32 -91
  150. graphon-0.9.0/src/graphon/variables/file_snapshot.py +112 -0
  151. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/variables/segment_group.py +3 -1
  152. graphon-0.9.0/src/graphon/variables/segments.py +320 -0
  153. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/variables/sensitivity.py +4 -5
  154. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/variables/template_resolution.py +1 -1
  155. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/variables/types.py +6 -3
  156. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/variables/utils.py +6 -3
  157. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/variables/variables.py +43 -37
  158. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/workflow_type_encoder.py +1 -1
  159. graphon-0.7.0/PKG-INFO +0 -199
  160. graphon-0.7.0/README.md +0 -169
  161. graphon-0.7.0/src/graphon/file/runtime.py +0 -63
  162. graphon-0.7.0/src/graphon/filters/__init__.py +0 -15
  163. graphon-0.7.0/src/graphon/graph/graph.py +0 -527
  164. graphon-0.7.0/src/graphon/graph_engine/__init__.py +0 -22
  165. graphon-0.7.0/src/graphon/graph_engine/_engine_utils.py +0 -20
  166. graphon-0.7.0/src/graphon/graph_engine/command_channels/README.md +0 -32
  167. graphon-0.7.0/src/graphon/graph_engine/command_channels/__init__.py +0 -7
  168. graphon-0.7.0/src/graphon/graph_engine/command_channels/protocol.py +0 -42
  169. graphon-0.7.0/src/graphon/graph_engine/command_processing/__init__.py +0 -19
  170. graphon-0.7.0/src/graphon/graph_engine/command_processing/command_handlers.py +0 -71
  171. graphon-0.7.0/src/graphon/graph_engine/command_processing/command_processor.py +0 -110
  172. graphon-0.7.0/src/graphon/graph_engine/config.py +0 -14
  173. graphon-0.7.0/src/graphon/graph_engine/container_handlers.py +0 -57
  174. graphon-0.7.0/src/graphon/graph_engine/domain/__init__.py +0 -13
  175. graphon-0.7.0/src/graphon/graph_engine/domain/node_execution.py +0 -19
  176. graphon-0.7.0/src/graphon/graph_engine/entities/commands.py +0 -70
  177. graphon-0.7.0/src/graphon/graph_engine/entities/tasks.py +0 -21
  178. graphon-0.7.0/src/graphon/graph_engine/event_management/__init__.py +0 -13
  179. graphon-0.7.0/src/graphon/graph_engine/event_management/event_manager.py +0 -190
  180. graphon-0.7.0/src/graphon/graph_engine/filters/__init__.py +0 -15
  181. graphon-0.7.0/src/graphon/graph_engine/filters/base.py +0 -70
  182. graphon-0.7.0/src/graphon/graph_engine/filters/response_stream.py +0 -807
  183. graphon-0.7.0/src/graphon/graph_engine/frames.py +0 -146
  184. graphon-0.7.0/src/graphon/graph_engine/graph_engine.py +0 -391
  185. graphon-0.7.0/src/graphon/graph_engine/graph_state_manager.py +0 -214
  186. graphon-0.7.0/src/graphon/graph_engine/graph_traversal/__init__.py +0 -13
  187. graphon-0.7.0/src/graphon/graph_engine/graph_traversal/edge_processor.py +0 -174
  188. graphon-0.7.0/src/graphon/graph_engine/graph_traversal/skip_propagator.py +0 -128
  189. graphon-0.7.0/src/graphon/graph_engine/layers/README.md +0 -52
  190. graphon-0.7.0/src/graphon/graph_engine/layers/__init__.py +0 -15
  191. graphon-0.7.0/src/graphon/graph_engine/layers/base.py +0 -140
  192. graphon-0.7.0/src/graphon/graph_engine/layers/debug_logging.py +0 -300
  193. graphon-0.7.0/src/graphon/graph_engine/manager.py +0 -85
  194. graphon-0.7.0/src/graphon/graph_engine/orchestration/__init__.py +0 -9
  195. graphon-0.7.0/src/graphon/graph_engine/orchestration/dispatcher.py +0 -175
  196. graphon-0.7.0/src/graphon/graph_engine/ready_queue/__init__.py +0 -16
  197. graphon-0.7.0/src/graphon/graph_engine/worker_management/__init__.py +0 -11
  198. graphon-0.7.0/src/graphon/graph_engine/worker_management/worker_pool.py +0 -278
  199. graphon-0.7.0/src/graphon/graph_events/human_input.py +0 -0
  200. graphon-0.7.0/src/graphon/http/runtime.py +0 -20
  201. graphon-0.7.0/src/graphon/model_runtime/README.md +0 -69
  202. graphon-0.7.0/src/graphon/nodes/code/__init__.py +0 -3
  203. graphon-0.7.0/src/graphon/nodes/llm/__init__.py +0 -17
  204. graphon-0.7.0/src/graphon/runtime/__init__.py +0 -22
  205. graphon-0.7.0/src/graphon/runtime/graph_runtime_state.py +0 -528
  206. graphon-0.7.0/src/graphon/utils/condition/__init__.py +0 -0
  207. graphon-0.7.0/src/graphon/variables/segments.py +0 -245
  208. {graphon-0.7.0 → graphon-0.9.0}/LICENSE +0 -0
  209. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/__init__.py +0 -0
  210. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/dsl/__init__.py +0 -0
  211. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/dsl/code_runtime.py +0 -0
  212. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/dsl/entities.py +0 -0
  213. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/dsl/errors.py +0 -0
  214. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/dsl/slim/__init__.py +0 -0
  215. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/dsl/slim/client.py +0 -0
  216. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/dsl/slim/config.py +0 -0
  217. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/dsl/tool_runtime.py +0 -0
  218. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/entities/exc.py +0 -0
  219. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/entities/graph_config.py +0 -0
  220. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/entities/pause_reason.py +0 -0
  221. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/entities/workflow_node_execution.py +0 -0
  222. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/entities/workflow_start_reason.py +0 -0
  223. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/enums.py +0 -0
  224. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/errors.py +0 -0
  225. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/file/__init__.py +0 -0
  226. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/file/constants.py +0 -0
  227. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/file/enums.py +0 -0
  228. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/file/file_factory.py +0 -0
  229. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/file/file_manager.py +0 -0
  230. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/file/helpers.py +0 -0
  231. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/file/protocols.py +0 -0
  232. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/file/tool_file_parser.py +0 -0
  233. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/graph/__init__.py +0 -0
  234. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/graph/edge.py +0 -0
  235. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/http/client.py +0 -0
  236. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/http/protocols.py +0 -0
  237. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/http/response.py +0 -0
  238. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/__init__.py +0 -0
  239. {graphon-0.7.0/src/graphon/graph_engine/entities → graphon-0.9.0/src/graphon/model_runtime/callbacks}/__init__.py +0 -0
  240. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/entities/__init__.py +0 -0
  241. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/entities/common_entities.py +0 -0
  242. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/entities/defaults.py +0 -0
  243. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/entities/provider_entities.py +0 -0
  244. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/entities/rerank_entities.py +0 -0
  245. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/entities/text_embedding_entities.py +0 -0
  246. {graphon-0.7.0/src/graphon/model_runtime/callbacks → graphon-0.9.0/src/graphon/model_runtime/errors}/__init__.py +0 -0
  247. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/errors/invoke.py +0 -0
  248. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/errors/validate.py +0 -0
  249. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/memory/__init__.py +0 -0
  250. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/memory/prompt_message_memory.py +0 -0
  251. {graphon-0.7.0/src/graphon/model_runtime/errors → graphon-0.9.0/src/graphon/model_runtime/model_providers}/__init__.py +0 -0
  252. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/model_providers/_position.yaml +0 -0
  253. {graphon-0.7.0/src/graphon/model_runtime/model_providers → graphon-0.9.0/src/graphon/model_runtime/model_providers/base}/__init__.py +0 -0
  254. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/model_providers/base/ai_model.py +0 -0
  255. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/model_providers/base/moderation_model.py +0 -0
  256. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/model_providers/base/rerank_model.py +0 -0
  257. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/model_providers/base/speech2text_model.py +0 -0
  258. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/model_providers/base/text_embedding_model.py +0 -0
  259. {graphon-0.7.0/src/graphon/model_runtime/model_providers/base → graphon-0.9.0/src/graphon/model_runtime/model_providers/base/tokenizers}/__init__.py +0 -0
  260. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/model_providers/model_provider_factory.py +0 -0
  261. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/protocols/__init__.py +0 -0
  262. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/protocols/llm_runtime.py +0 -0
  263. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/protocols/moderation_runtime.py +0 -0
  264. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/protocols/provider_runtime.py +0 -0
  265. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/protocols/rerank_runtime.py +0 -0
  266. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/protocols/runtime.py +0 -0
  267. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/protocols/speech_to_text_runtime.py +0 -0
  268. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/protocols/text_embedding_runtime.py +0 -0
  269. {graphon-0.7.0/src/graphon/model_runtime/model_providers/base/tokenizers → graphon-0.9.0/src/graphon/model_runtime/schema_validators}/__init__.py +0 -0
  270. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/schema_validators/common_validator.py +0 -0
  271. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/schema_validators/model_credential_schema_validator.py +0 -0
  272. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/model_runtime/schema_validators/provider_credential_schema_validator.py +0 -0
  273. {graphon-0.7.0/src/graphon/model_runtime/schema_validators → graphon-0.9.0/src/graphon/model_runtime/utils}/__init__.py +0 -0
  274. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/__init__.py +0 -0
  275. {graphon-0.7.0/src/graphon/model_runtime/utils → graphon-0.9.0/src/graphon/nodes/answer}/__init__.py +0 -0
  276. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/answer/entities.py +0 -0
  277. {graphon-0.7.0/src/graphon/nodes/answer → graphon-0.9.0/src/graphon/nodes/base}/__init__.py +0 -0
  278. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/base/entities.py +0 -0
  279. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/code/entities.py +0 -0
  280. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/code/exc.py +0 -0
  281. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/code/limits.py +0 -0
  282. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/document_extractor/__init__.py +0 -0
  283. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/document_extractor/entities.py +0 -0
  284. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/document_extractor/exc.py +0 -0
  285. {graphon-0.7.0/src/graphon/nodes/base → graphon-0.9.0/src/graphon/nodes/end}/__init__.py +0 -0
  286. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/end/entities.py +0 -0
  287. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/http_request/__init__.py +0 -0
  288. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/http_request/config.py +0 -0
  289. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/http_request/entities.py +0 -0
  290. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/http_request/exc.py +0 -0
  291. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/http_request/executor.py +0 -0
  292. {graphon-0.7.0/src/graphon/nodes/end → graphon-0.9.0/src/graphon/nodes/human_input}/__init__.py +0 -0
  293. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/if_else/__init__.py +0 -0
  294. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/if_else/entities.py +0 -0
  295. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/iteration/__init__.py +0 -0
  296. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/iteration/entities.py +0 -0
  297. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/iteration/iteration_start_node.py +0 -0
  298. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/list_operator/__init__.py +0 -0
  299. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/list_operator/exc.py +0 -0
  300. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/llm/exc.py +0 -0
  301. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/llm/protocols.py +0 -0
  302. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/llm/reasoning.py +0 -0
  303. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/llm/runtime_protocols.py +0 -0
  304. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/loop/__init__.py +0 -0
  305. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/loop/entities.py +0 -0
  306. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/loop/loop_end_node.py +0 -0
  307. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/loop/loop_start_node.py +0 -0
  308. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/parameter_extractor/__init__.py +0 -0
  309. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/parameter_extractor/entities.py +0 -0
  310. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/parameter_extractor/exc.py +0 -0
  311. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/parameter_extractor/prompts.py +0 -0
  312. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/protocols.py +0 -0
  313. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/question_classifier/__init__.py +0 -0
  314. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/question_classifier/entities.py +0 -0
  315. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/question_classifier/exc.py +0 -0
  316. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/question_classifier/template_prompts.py +0 -0
  317. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/runtime.py +0 -0
  318. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/start/__init__.py +0 -0
  319. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/start/entities.py +0 -0
  320. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/template_transform/__init__.py +0 -0
  321. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/template_transform/entities.py +0 -0
  322. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/tool/__init__.py +0 -0
  323. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/tool/entities.py +0 -0
  324. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/tool/exc.py +0 -0
  325. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/tool_runtime_entities.py +0 -0
  326. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_aggregator/__init__.py +0 -0
  327. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_aggregator/entities.py +0 -0
  328. {graphon-0.7.0/src/graphon/nodes/human_input → graphon-0.9.0/src/graphon/nodes/variable_assigner}/__init__.py +0 -0
  329. {graphon-0.7.0/src/graphon/nodes/variable_assigner → graphon-0.9.0/src/graphon/nodes/variable_assigner/common}/__init__.py +0 -0
  330. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_assigner/common/exc.py +0 -0
  331. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_assigner/common/helpers.py +0 -0
  332. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_assigner/v1/__init__.py +0 -0
  333. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_assigner/v1/node_data.py +0 -0
  334. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_assigner/v2/__init__.py +0 -0
  335. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_assigner/v2/entities.py +0 -0
  336. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_assigner/v2/enums.py +0 -0
  337. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/nodes/variable_assigner/v2/exc.py +0 -0
  338. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/prompt_entities.py +0 -0
  339. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/py.typed +0 -0
  340. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/template_rendering.py +0 -0
  341. {graphon-0.7.0/src/graphon/nodes/variable_assigner/common → graphon-0.9.0/src/graphon/utils}/__init__.py +0 -0
  342. {graphon-0.7.0/src/graphon/utils → graphon-0.9.0/src/graphon/utils/condition}/__init__.py +0 -0
  343. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/utils/condition/entities.py +0 -0
  344. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/utils/json_in_md_parser.py +0 -0
  345. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/variable_loader.py +0 -0
  346. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/variables/consts.py +0 -0
  347. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/variables/exc.py +0 -0
  348. {graphon-0.7.0 → graphon-0.9.0}/src/graphon/variables/input_entities.py +0 -0
graphon-0.9.0/PKG-INFO ADDED
@@ -0,0 +1,68 @@
1
+ Metadata-Version: 2.4
2
+ Name: graphon
3
+ Version: 0.9.0
4
+ Summary: Graph execution engine for agentic AI workflows.
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ Requires-Dist: charset-normalizer>=2.1
8
+ Requires-Dist: defusedxml>=0.7
9
+ Requires-Dist: httpx>=0.28
10
+ Requires-Dist: json-repair>=0.55
11
+ Requires-Dist: jsonschema>=4.18
12
+ Requires-Dist: odfdo>=3.22.8
13
+ Requires-Dist: orjson>=3
14
+ Requires-Dist: pandas[excel]>=2.1
15
+ Requires-Dist: pydantic>=2.11
16
+ Requires-Dist: pydantic-extra-types>=2
17
+ Requires-Dist: pypdf>=6.21.2
18
+ Requires-Dist: pypdfium2>=5
19
+ Requires-Dist: python-docx>=1.2
20
+ Requires-Dist: pyyaml>=6
21
+ Requires-Dist: tiktoken>=0.12
22
+ Requires-Dist: transformers>=4
23
+ Requires-Dist: typing-extensions>=4.10.0
24
+ Requires-Dist: unstructured[docx,md,ppt,pptx]>=0.27.37
25
+ Requires-Dist: webvtt-py>=0.5
26
+ Requires-Python: >=3.12, <3.14
27
+ Project-URL: source, https://github.com/langgenius/graphon
28
+ Project-URL: homepage, https://github.com/langgenius/graphon
29
+ Project-URL: issues, https://github.com/langgenius/graphon/issues
30
+ Description-Content-Type: text/markdown
31
+
32
+ <!-- knowledge
33
+ last_checked: "2026-11-26T01:12:45Z"
34
+ -->
35
+ # Graphon
36
+
37
+ Graphon is a Python graph execution engine for agentic AI workflows.
38
+
39
+ The repository is still evolving, but it already contains a working execution
40
+ engine, built-in workflow nodes, model runtime abstractions, integration
41
+ protocols, and a runnable end-to-end example.
42
+
43
+ ## Highlights
44
+
45
+ - Queue-based `Engine` orchestration with event-driven execution
46
+ - Graph parsing, validation, and fluent graph building
47
+ - Frame-owned runtime state and variables with shared workflow execution state
48
+ - Built-in node implementations for common workflow patterns
49
+ - DSL import support with Slim-backed LLM nodes
50
+ - HTTP, file, tool, and human-input integration protocols
51
+ - Extensible engine layers and external command channels
52
+
53
+ ## Get started
54
+
55
+ Follow [development setup](CONTRIBUTING.md#development-setup), then run the
56
+ [Slim LLM example](examples/slim_llm/README.md). It includes both DSL import and
57
+ direct Python graph construction.
58
+
59
+ ## Find the implementation
60
+
61
+ - [Architecture](ARCHITECTURE.md): public entry points, execution flow, and state ownership.
62
+ - [Development guide](docs/development.md): change surfaces and host integrations.
63
+ - [Repository knowledge](docs/README.md): component guides and maintenance.
64
+ - [Contributing](CONTRIBUTING.md): setup, validation, and contribution workflow.
65
+
66
+ ## License
67
+
68
+ Apache-2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,37 @@
1
+ <!-- knowledge
2
+ last_checked: "2026-11-26T01:12:45Z"
3
+ -->
4
+ # Graphon
5
+
6
+ Graphon is a Python graph execution engine for agentic AI workflows.
7
+
8
+ The repository is still evolving, but it already contains a working execution
9
+ engine, built-in workflow nodes, model runtime abstractions, integration
10
+ protocols, and a runnable end-to-end example.
11
+
12
+ ## Highlights
13
+
14
+ - Queue-based `Engine` orchestration with event-driven execution
15
+ - Graph parsing, validation, and fluent graph building
16
+ - Frame-owned runtime state and variables with shared workflow execution state
17
+ - Built-in node implementations for common workflow patterns
18
+ - DSL import support with Slim-backed LLM nodes
19
+ - HTTP, file, tool, and human-input integration protocols
20
+ - Extensible engine layers and external command channels
21
+
22
+ ## Get started
23
+
24
+ Follow [development setup](CONTRIBUTING.md#development-setup), then run the
25
+ [Slim LLM example](examples/slim_llm/README.md). It includes both DSL import and
26
+ direct Python graph construction.
27
+
28
+ ## Find the implementation
29
+
30
+ - [Architecture](ARCHITECTURE.md): public entry points, execution flow, and state ownership.
31
+ - [Development guide](docs/development.md): change surfaces and host integrations.
32
+ - [Repository knowledge](docs/README.md): component guides and maintenance.
33
+ - [Contributing](CONTRIBUTING.md): setup, validation, and contribution workflow.
34
+
35
+ ## License
36
+
37
+ Apache-2.0. See [LICENSE](LICENSE).
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "graphon"
3
- version = "0.7.0"
3
+ version = "0.9.0"
4
4
  description = "Graph execution engine for agentic AI workflows."
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -8,22 +8,23 @@ license-files = ["LICENSE"]
8
8
  requires-python = ">=3.12,<3.14"
9
9
  dependencies = [
10
10
  "charset-normalizer>=2.1",
11
+ "defusedxml>=0.7",
11
12
  "httpx>=0.28",
12
13
  "json-repair>=0.55",
13
- "jsonschema>=4",
14
+ "jsonschema>=4.18",
15
+ "odfdo>=3.22.8",
14
16
  "orjson>=3",
15
17
  "pandas[excel]>=2.1",
16
- "pydantic>=2.7",
18
+ "pydantic>=2.11",
17
19
  "pydantic-extra-types>=2",
18
- "pypdf>=6.14.2",
20
+ "pypdf>=6.21.2",
19
21
  "pypdfium2>=5",
20
22
  "python-docx>=1.2",
21
23
  "pyyaml>=6",
22
24
  "tiktoken>=0.12",
23
25
  "transformers>=4",
24
26
  "typing-extensions>=4.10.0",
25
- "unstructured[docx,epub,md,ppt,pptx]>=0.21",
26
- "pypandoc>=1.13",
27
+ "unstructured[docx,md,ppt,pptx]>=0.27.37",
27
28
  "webvtt-py>=0.5",
28
29
  ]
29
30
 
@@ -35,20 +36,25 @@ issues = "https://github.com/langgenius/graphon/issues"
35
36
  [dependency-groups]
36
37
  dev = [
37
38
  "pytest",
39
+ "pytest-benchmark",
38
40
  "pytest-cov",
39
41
  "pytest-mock",
40
42
  "pytest-xdist",
41
43
  "ruff",
42
44
  "prek",
43
45
  "ty",
46
+ "gevent>=26.8.0",
47
+ "import-linter>=2.15",
48
+ "hypothesis>=6.170.15",
44
49
  ]
45
50
 
46
51
  [build-system]
47
- requires = ["uv_build~=0.11"]
52
+ requires = ["uv_build>=0.13.7,<0.14"]
48
53
  build-backend = "uv_build"
49
54
 
50
55
  [tool.uv]
51
56
  default-groups = ["dev"]
57
+ prerelease = "disallow"
52
58
 
53
59
  [tool.ruff]
54
60
  fix = true
@@ -86,9 +92,30 @@ ignore-one-line-docstrings = true
86
92
  [tool.ty.environment]
87
93
  python-platform = "linux"
88
94
 
95
+ [tool.importlinter]
96
+ root_package = "graphon"
97
+ exclude_type_checking_imports = false
98
+
99
+ [[tool.importlinter.contracts]]
100
+ id = "architecture-layers"
101
+ name = "Packages import within their layer or below"
102
+ type = "layers"
103
+ containers = ["graphon"]
104
+ exhaustive = true
105
+ layers = [
106
+ "dsl",
107
+ "engine",
108
+ "protocols : errors",
109
+ "graph : nodes : runtime : utils : variable_loader",
110
+ "engine_events : node_events",
111
+ "entities : variables : file : http : model_runtime : enums : prompt_entities : template_rendering : workflow_type_encoder",
112
+ ]
113
+ broken_contract_guidance = "Depend on the same or a lower architectural layer. Inject dependencies from the composition layer, and classify every new top-level module in this contract. See ARCHITECTURE.md#import-boundaries."
114
+
89
115
  [tool.pytest]
90
116
  minversion = "9.0"
91
117
  addopts = [
118
+ "--benchmark-disable",
92
119
  "-n",
93
120
  "auto",
94
121
  ]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = 'graphon'
3
- version = '0.7.0'
3
+ version = "0.9.0"
4
4
  description = 'Graph execution engine for agentic AI workflows.'
5
5
  readme = 'README.md'
6
6
  license = 'Apache-2.0'
@@ -10,22 +10,23 @@ license-files = ['LICENSE']
10
10
  requires-python = '>=3.12,<3.14'
11
11
  dependencies = [
12
12
  'charset-normalizer>=2.1',
13
+ 'defusedxml>=0.7',
13
14
  'httpx>=0.28',
14
15
  'json-repair>=0.55',
15
- 'jsonschema>=4',
16
+ 'jsonschema>=4.18',
17
+ 'odfdo>=3.22.8',
16
18
  'orjson>=3',
17
19
  'pandas[excel]>=2.1',
18
- 'pydantic>=2.7',
20
+ 'pydantic>=2.11',
19
21
  'pydantic-extra-types>=2',
20
- 'pypdf>=6.14.2',
22
+ 'pypdf>=6.21.2',
21
23
  'pypdfium2>=5',
22
24
  'python-docx>=1.2',
23
25
  'pyyaml>=6',
24
26
  'tiktoken>=0.12',
25
27
  'transformers>=4',
26
28
  'typing-extensions>=4.10.0',
27
- 'unstructured[docx,epub,md,ppt,pptx]>=0.21',
28
- 'pypandoc>=1.13',
29
+ 'unstructured[docx,md,ppt,pptx]>=0.27.37',
29
30
  'webvtt-py>=0.5',
30
31
  ]
31
32
 
@@ -37,20 +38,25 @@ issues = 'https://github.com/langgenius/graphon/issues'
37
38
  [dependency-groups]
38
39
  dev = [
39
40
  'pytest',
41
+ 'pytest-benchmark',
40
42
  'pytest-cov',
41
43
  'pytest-mock',
42
44
  'pytest-xdist',
43
45
  'ruff',
44
46
  'prek',
45
47
  'ty',
48
+ 'gevent>=26.8.0',
49
+ "import-linter>=2.15",
50
+ "hypothesis>=6.170.15",
46
51
  ]
47
52
 
48
53
  [build-system]
49
- requires = ['uv_build~=0.11']
54
+ requires = ['uv_build>=0.13.7,<0.14']
50
55
  build-backend = 'uv_build'
51
56
 
52
57
  [tool.uv]
53
58
  default-groups = ['dev']
59
+ prerelease = 'disallow'
54
60
 
55
61
  [tool.ruff]
56
62
  fix = true
@@ -91,7 +97,27 @@ ignore-one-line-docstrings = true
91
97
  [tool.ty.environment]
92
98
  python-platform = 'linux'
93
99
 
100
+ [tool.importlinter]
101
+ root_package = 'graphon'
102
+ exclude_type_checking_imports = false
103
+
104
+ [[tool.importlinter.contracts]]
105
+ id = 'architecture-layers'
106
+ name = 'Packages import within their layer or below'
107
+ type = 'layers'
108
+ containers = ['graphon']
109
+ exhaustive = true
110
+ layers = [
111
+ 'dsl',
112
+ 'engine',
113
+ 'protocols : errors',
114
+ 'graph : nodes : runtime : utils : variable_loader',
115
+ 'engine_events : node_events',
116
+ 'entities : variables : file : http : model_runtime : enums : prompt_entities : template_rendering : workflow_type_encoder',
117
+ ]
118
+ broken_contract_guidance = 'Depend on the same or a lower architectural layer. Inject dependencies from the composition layer, and classify every new top-level module in this contract. See ARCHITECTURE.md#import-boundaries.'
119
+
94
120
  [tool.pytest]
95
121
  minversion = '9.0'
96
- addopts = ['-n', 'auto']
122
+ addopts = ['--benchmark-disable', '-n', 'auto']
97
123
  testpaths = ['tests']
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  import time
4
4
  from collections.abc import Mapping, Sequence
5
5
  from copy import deepcopy
6
+ from dataclasses import asdict
6
7
  from enum import StrEnum, auto
7
8
  from typing import Any, cast
8
9
  from uuid import uuid4
@@ -10,15 +11,15 @@ from uuid import uuid4
10
11
  import yaml
11
12
  from pydantic import ValidationError
12
13
 
13
- from graphon.entities.graph_init_params import GraphInitParams
14
+ from graphon.engine import Engine
15
+ from graphon.engine.command import CommandChannel
16
+ from graphon.engine.container_handler import ContainerHandlerFactory
14
17
  from graphon.enums import BuiltinNodeTypes
15
18
  from graphon.graph.graph import Graph
19
+ from graphon.graph.scoping import resolve_container_id
16
20
  from graphon.graph.validation import GraphValidationError
17
- from graphon.graph_engine.command_channels import CommandChannel, InMemoryChannel
18
- from graphon.graph_engine.config import GraphEngineConfig
19
- from graphon.graph_engine.container_handlers import ContainerHandlerFactory
20
- from graphon.graph_engine.graph_engine import GraphEngine
21
- from graphon.runtime.graph_runtime_state import GraphRuntimeState
21
+ from graphon.runtime.init_params import InitParams
22
+ from graphon.runtime.runtime_state import RuntimeState
22
23
  from graphon.runtime.variable_pool import VariablePool
23
24
 
24
25
  from .entities import (
@@ -94,9 +95,9 @@ def loads(
94
95
  run_context: Mapping[str, Any] | None = None,
95
96
  start_inputs: Mapping[str, Any] | None = None,
96
97
  command_channel: CommandChannel | None = None,
97
- config: GraphEngineConfig | None = None,
98
+ workers: int = 5,
98
99
  container_handler_factories: Sequence[ContainerHandlerFactory] = (),
99
- ) -> GraphEngine:
100
+ ) -> Engine:
100
101
  plan = inspect(dsl, source_kind=source_kind)
101
102
  if plan.load_status == LoadStatus.UNSUPPORTED:
102
103
  raise _dsl_error(
@@ -128,22 +129,22 @@ def loads(
128
129
  run_context=run_context or {},
129
130
  start_inputs=start_inputs or {},
130
131
  )
131
- graph_init_params = GraphInitParams(
132
+ init_params = InitParams(
132
133
  workflow_id=workflow_id,
133
134
  graph_config=graph_config,
134
135
  run_context=run_context or {},
135
136
  call_depth=0,
136
137
  )
137
- graph_runtime_state = GraphRuntimeState(
138
+ runtime_state = RuntimeState(
138
139
  variable_pool=variable_pool,
139
140
  start_at=time.time(),
141
+ workflow_id=workflow_id,
140
142
  )
141
143
  parsed_credentials = _parse_credentials(credentials)
142
- engine_config = config or GraphEngineConfig()
143
144
  node_factory = SlimDslNodeFactory(
144
145
  graph_config=graph_config,
145
- graph_init_params=graph_init_params,
146
- graph_runtime_state=graph_runtime_state,
146
+ init_params=init_params,
147
+ runtime_state=runtime_state,
147
148
  credentials=parsed_credentials,
148
149
  dependencies=list(plan.dependencies),
149
150
  )
@@ -161,7 +162,7 @@ def loads(
161
162
  str(error),
162
163
  code="graph.validation_failed",
163
164
  kind=plan.document.kind,
164
- details={"issues": [issue.__dict__ for issue in error.issues]},
165
+ details={"issues": [asdict(issue) for issue in error.issues]},
165
166
  ) from error
166
167
  except Exception as error:
167
168
  raise _dsl_error(
@@ -170,12 +171,11 @@ def loads(
170
171
  kind=plan.document.kind,
171
172
  ) from error
172
173
 
173
- return GraphEngine(
174
- workflow_id=workflow_id,
174
+ return Engine(
175
175
  graph=graph,
176
- graph_runtime_state=graph_runtime_state,
177
- command_channel=command_channel or InMemoryChannel(),
178
- config=engine_config,
176
+ runtime_state=runtime_state,
177
+ command_channel=command_channel,
178
+ workers=workers,
179
179
  container_handler_factories=container_handler_factories,
180
180
  )
181
181
 
@@ -618,7 +618,28 @@ def _canonical_vendor(provider: str | None) -> str | None:
618
618
  return parts[-1] if parts else provider
619
619
 
620
620
 
621
- def _normalize_edges(
621
+ def _node_owner_for_edge_validation(
622
+ node: Mapping[str, Any],
623
+ *,
624
+ nodes_by_id: Mapping[str, Mapping[str, Any]],
625
+ ) -> str | None:
626
+ """Resolve a node's direct graph owner for scoped edge-ID validation.
627
+
628
+ The graph scoping resolver owns canonical and legacy hierarchy semantics.
629
+ Invalid or genuinely ambiguous ownership returns ``None`` here so edge-ID
630
+ normalization does not mask the more actionable error raised by Graph.
631
+
632
+ Returns:
633
+ The direct container ID, ``""`` for the root graph, or ``None`` when
634
+ ownership cannot be resolved safely.
635
+ """
636
+ try:
637
+ return resolve_container_id(node, nodes_by_id=nodes_by_id)
638
+ except (TypeError, ValueError):
639
+ return None
640
+
641
+
642
+ def _normalize_edges( # ruff:ignore[complex-structure]
622
643
  edges: object,
623
644
  *,
624
645
  nodes: Sequence[Mapping[str, Any]],
@@ -640,8 +661,16 @@ def _normalize_edges(
640
661
  for node in nodes
641
662
  if isinstance(node.get("data"), Mapping)
642
663
  }
664
+ nodes_by_id = {str(node["id"]): node for node in nodes}
665
+ node_owners = {
666
+ node_id: _node_owner_for_edge_validation(
667
+ node,
668
+ nodes_by_id=nodes_by_id,
669
+ )
670
+ for node_id, node in nodes_by_id.items()
671
+ }
643
672
  normalized_edges: list[dict[str, Any]] = []
644
- seen_edge_ids: set[str] = set()
673
+ seen_edge_ids: set[tuple[str, str]] = set()
645
674
  for index, edge in enumerate(edges):
646
675
  path = f"/workflow/graph/edges/{index}"
647
676
  if not isinstance(edge, Mapping):
@@ -672,18 +701,29 @@ def _normalize_edges(
672
701
  kind=kind,
673
702
  details={"source": source, "target": target},
674
703
  )
675
- edge_id = edge_mapping.get("id")
676
- if isinstance(edge_id, str):
677
- if edge_id in seen_edge_ids:
678
- msg = f"Duplicate graph edge id: {edge_id}"
704
+ if "id" in edge_mapping:
705
+ edge_id = edge_mapping["id"]
706
+ if not isinstance(edge_id, str) or not edge_id:
707
+ msg = "Graph edge id must be a non-empty string."
679
708
  raise _dsl_error(
680
709
  msg,
681
- code="graph.duplicate_edge_id",
710
+ code="graph.invalid_edge_id",
682
711
  path=f"{path}/id",
683
712
  kind=kind,
684
- details={"edge_id": edge_id},
685
713
  )
686
- seen_edge_ids.add(edge_id)
714
+ source_owner = node_owners[source]
715
+ if source_owner is not None and source_owner == node_owners[target]:
716
+ scoped_edge_id = (source_owner, edge_id)
717
+ if scoped_edge_id in seen_edge_ids:
718
+ msg = f"Duplicate graph edge id: {edge_id}"
719
+ raise _dsl_error(
720
+ msg,
721
+ code="graph.duplicate_edge_id",
722
+ path=f"{path}/id",
723
+ kind=kind,
724
+ details={"edge_id": edge_id},
725
+ )
726
+ seen_edge_ids.add(scoped_edge_id)
687
727
 
688
728
  normalized_edge = deepcopy(dict(edge_mapping))
689
729
  data = dict(normalized_edge.get("data") or {})