code0-hercules 1.5.0__tar.gz → 1.7.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 (272) hide show
  1. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/PKG-INFO +4 -4
  2. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/README.md +2 -2
  3. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/code0_hercules.egg-info/PKG-INFO +4 -4
  4. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/code0_hercules.egg-info/SOURCES.txt +3 -0
  5. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/code0_hercules.egg-info/requires.txt +1 -1
  6. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/__init__.py +11 -2
  7. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/action.py +37 -1
  8. code0_hercules-1.7.0/hercules/actions/execution.py +194 -0
  9. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/rest_action/runtime_flow_types/rest.py +1 -1
  10. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_control/runtime_functions/std_control_if_else.py +1 -1
  11. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/runtime_functions/http_request_send.py +1 -1
  12. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/internal/schema.py +10 -0
  13. code0_hercules-1.7.0/hercules/internal/sub_flow_function.py +86 -0
  14. code0_hercules-1.7.0/hercules/manager/sub_flow_function.py +93 -0
  15. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/models/runtime_function.py +8 -3
  16. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/types.py +39 -1
  17. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/pyproject.toml +2 -2
  18. code0_hercules-1.7.0/tests/test_execution.py +309 -0
  19. code0_hercules-1.5.0/hercules/actions/execution.py +0 -121
  20. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/code0_hercules.egg-info/dependency_links.txt +0 -0
  21. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/code0_hercules.egg-info/entry_points.txt +0 -0
  22. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/code0_hercules.egg-info/top_level.txt +0 -0
  23. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/_metadata.py +0 -0
  24. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/_tsgen/convert.mjs +0 -0
  25. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/_tsgen/package-lock.json +0 -0
  26. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/_tsgen/package.json +0 -0
  27. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/_tucana/__init__.py +0 -0
  28. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/_tucana/helpers.py +0 -0
  29. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/actions/__init__.py +0 -0
  30. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/actions/flow_execution.py +0 -0
  31. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/actions/flow_update.py +0 -0
  32. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/actions/module_configurations.py +0 -0
  33. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/actions/sub_flow_execution.py +0 -0
  34. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/cli.py +0 -0
  35. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/decorators/__init__.py +0 -0
  36. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/decorators/datatype.py +0 -0
  37. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/decorators/event.py +0 -0
  38. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/decorators/function.py +0 -0
  39. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/decorators/meta.py +0 -0
  40. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/decorators/runtime_event.py +0 -0
  41. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/decorators/runtime_function.py +0 -0
  42. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/__init__.py +0 -0
  43. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/cron_action/__init__.py +0 -0
  44. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/cron_action/data_types/__init__.py +0 -0
  45. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/cron_action/data_types/cron_day_of_month.py +0 -0
  46. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/cron_action/data_types/cron_day_of_week.py +0 -0
  47. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/cron_action/data_types/cron_hour.py +0 -0
  48. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/cron_action/data_types/cron_minute.py +0 -0
  49. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/cron_action/data_types/cron_month.py +0 -0
  50. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/cron_action/runtime_flow_types/__init__.py +0 -0
  51. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/cron_action/runtime_flow_types/cron.py +0 -0
  52. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/rest_action/__init__.py +0 -0
  53. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/rest_action/data_types/__init__.py +0 -0
  54. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/rest_action/data_types/rest_adapter_input.py +0 -0
  55. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/rest_action/data_types/rest_auth_type.py +0 -0
  56. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/rest_action/data_types/rest_auth_value.py +0 -0
  57. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/rest_action/runtime_flow_types/__init__.py +0 -0
  58. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/rest_action/runtime_functions/__init__.py +0 -0
  59. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/rest_action/runtime_functions/rest_control_respond.py +0 -0
  60. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_boolean/__init__.py +0 -0
  61. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_boolean/data_types/__init__.py +0 -0
  62. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_boolean/data_types/boolean.py +0 -0
  63. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_boolean/runtime_functions/__init__.py +0 -0
  64. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_boolean/runtime_functions/std_boolean_as_number.py +0 -0
  65. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_boolean/runtime_functions/std_boolean_as_text.py +0 -0
  66. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_boolean/runtime_functions/std_boolean_from_number.py +0 -0
  67. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_boolean/runtime_functions/std_boolean_from_text.py +0 -0
  68. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_boolean/runtime_functions/std_boolean_is_equal.py +0 -0
  69. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_boolean/runtime_functions/std_boolean_negate.py +0 -0
  70. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_color/__init__.py +0 -0
  71. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_color/data_types/__init__.py +0 -0
  72. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_color/data_types/color.py +0 -0
  73. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_color/runtime_functions/__init__.py +0 -0
  74. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_color/runtime_functions/std_color_as_hex.py +0 -0
  75. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_color/runtime_functions/std_color_as_hsl.py +0 -0
  76. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_color/runtime_functions/std_color_as_rgb.py +0 -0
  77. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_color/runtime_functions/std_color_from_hex.py +0 -0
  78. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_color/runtime_functions/std_color_from_hsl.py +0 -0
  79. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_color/runtime_functions/std_color_from_rgb.py +0 -0
  80. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_control/__init__.py +0 -0
  81. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_control/data_types/__init__.py +0 -0
  82. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_control/data_types/comparator.py +0 -0
  83. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_control/data_types/consumer.py +0 -0
  84. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_control/data_types/predicate.py +0 -0
  85. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_control/data_types/runnable.py +0 -0
  86. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_control/data_types/transform.py +0 -0
  87. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_control/runtime_functions/__init__.py +0 -0
  88. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_control/runtime_functions/std_control_if.py +0 -0
  89. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_control/runtime_functions/std_control_return.py +0 -0
  90. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_control/runtime_functions/std_control_stop.py +0 -0
  91. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_control/runtime_functions/std_control_value.py +0 -0
  92. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_date/__init__.py +0 -0
  93. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_date/data_types/__init__.py +0 -0
  94. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_date/data_types/date.py +0 -0
  95. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_date/data_types/hour.py +0 -0
  96. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_date/data_types/minute.py +0 -0
  97. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_date/data_types/month.py +0 -0
  98. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_date/runtime_functions/__init__.py +0 -0
  99. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_date/runtime_functions/std_date_format.py +0 -0
  100. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_date/runtime_functions/std_date_from.py +0 -0
  101. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_date/runtime_functions/std_date_from_text.py +0 -0
  102. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_date/runtime_functions/std_date_from_unix.py +0 -0
  103. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_date/runtime_functions/std_date_now.py +0 -0
  104. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_file/__init__.py +0 -0
  105. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_file/data_types/__init__.py +0 -0
  106. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_file/data_types/file.py +0 -0
  107. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_file/runtime_functions/__init__.py +0 -0
  108. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_file/runtime_functions/std_file_size.py +0 -0
  109. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/__init__.py +0 -0
  110. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/data_types/__init__.py +0 -0
  111. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/data_types/http_auth_place.py +0 -0
  112. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/data_types/http_auth_type.py +0 -0
  113. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/data_types/http_auth_value.py +0 -0
  114. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/data_types/http_method.py +0 -0
  115. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/data_types/http_payload.py +0 -0
  116. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/data_types/http_request.py +0 -0
  117. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/data_types/http_response.py +0 -0
  118. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/data_types/http_schema.py +0 -0
  119. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/data_types/http_status_code.py +0 -0
  120. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/data_types/http_url.py +0 -0
  121. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_http/runtime_functions/__init__.py +0 -0
  122. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/__init__.py +0 -0
  123. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/data_types/__init__.py +0 -0
  124. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/data_types/list.py +0 -0
  125. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/__init__.py +0 -0
  126. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_at.py +0 -0
  127. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_concat.py +0 -0
  128. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_filter.py +0 -0
  129. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_find.py +0 -0
  130. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_find_index.py +0 -0
  131. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_find_last.py +0 -0
  132. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_first.py +0 -0
  133. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_flat.py +0 -0
  134. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_for_each.py +0 -0
  135. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_index_of.py +0 -0
  136. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_is_empty.py +0 -0
  137. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_join.py +0 -0
  138. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_last.py +0 -0
  139. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_map.py +0 -0
  140. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_max.py +0 -0
  141. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_min.py +0 -0
  142. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_pop.py +0 -0
  143. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_push.py +0 -0
  144. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_remove.py +0 -0
  145. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_reverse.py +0 -0
  146. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_size.py +0 -0
  147. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_sort.py +0 -0
  148. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_sort_reverse.py +0 -0
  149. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_sum.py +0 -0
  150. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_list/runtime_functions/std_list_to_unique.py +0 -0
  151. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/__init__.py +0 -0
  152. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/data_types/__init__.py +0 -0
  153. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/data_types/number.py +0 -0
  154. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/__init__.py +0 -0
  155. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_abs.py +0 -0
  156. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_add.py +0 -0
  157. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_arccos.py +0 -0
  158. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_arcsin.py +0 -0
  159. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_arctan.py +0 -0
  160. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_as_text.py +0 -0
  161. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_clamp.py +0 -0
  162. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_cos.py +0 -0
  163. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_cosh.py +0 -0
  164. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_divide.py +0 -0
  165. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_euler.py +0 -0
  166. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_exponential.py +0 -0
  167. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_from_text.py +0 -0
  168. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_has_digits.py +0 -0
  169. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_is_equal.py +0 -0
  170. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_is_greater.py +0 -0
  171. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_is_less.py +0 -0
  172. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_is_positive.py +0 -0
  173. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_is_zero.py +0 -0
  174. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_ln.py +0 -0
  175. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_log.py +0 -0
  176. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_max.py +0 -0
  177. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_min.py +0 -0
  178. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_modulo.py +0 -0
  179. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_multiply.py +0 -0
  180. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_negate.py +0 -0
  181. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_pi.py +0 -0
  182. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_random_number.py +0 -0
  183. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_remove_digits.py +0 -0
  184. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_root.py +0 -0
  185. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_round.py +0 -0
  186. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_round_down.py +0 -0
  187. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_round_up.py +0 -0
  188. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_sin.py +0 -0
  189. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_sinh.py +0 -0
  190. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_square.py +0 -0
  191. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_square_root.py +0 -0
  192. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_subtract.py +0 -0
  193. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_number/runtime_functions/std_number_tan.py +0 -0
  194. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_object/__init__.py +0 -0
  195. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_object/data_types/__init__.py +0 -0
  196. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_object/data_types/object.py +0 -0
  197. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_object/data_types/type.py +0 -0
  198. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_object/runtime_functions/__init__.py +0 -0
  199. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_object/runtime_functions/std_object_contains_key.py +0 -0
  200. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_object/runtime_functions/std_object_get.py +0 -0
  201. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_object/runtime_functions/std_object_keys.py +0 -0
  202. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_object/runtime_functions/std_object_set.py +0 -0
  203. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_object/runtime_functions/std_object_size.py +0 -0
  204. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/__init__.py +0 -0
  205. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/data_types/__init__.py +0 -0
  206. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/data_types/text.py +0 -0
  207. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/data_types/text_encoding.py +0 -0
  208. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/__init__.py +0 -0
  209. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_append.py +0 -0
  210. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_as_bytes.py +0 -0
  211. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_at.py +0 -0
  212. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_byte_size.py +0 -0
  213. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_capitalize.py +0 -0
  214. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_chars.py +0 -0
  215. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_contains.py +0 -0
  216. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_decode.py +0 -0
  217. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_encode.py +0 -0
  218. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_ends_with.py +0 -0
  219. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_from_ascii.py +0 -0
  220. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_hex.py +0 -0
  221. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_index_of.py +0 -0
  222. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_insert.py +0 -0
  223. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_is_equal.py +0 -0
  224. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_length.py +0 -0
  225. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_lowercase.py +0 -0
  226. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_octal.py +0 -0
  227. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_prepend.py +0 -0
  228. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_remove.py +0 -0
  229. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_replace.py +0 -0
  230. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_replace_first.py +0 -0
  231. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_replace_last.py +0 -0
  232. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_reverse.py +0 -0
  233. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_split.py +0 -0
  234. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_starts_with.py +0 -0
  235. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_swapcase.py +0 -0
  236. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_to_ascii.py +0 -0
  237. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_trim.py +0 -0
  238. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/definitions/taurus_text/runtime_functions/std_text_uppercase.py +0 -0
  239. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/events.py +0 -0
  240. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/internal/__init__.py +0 -0
  241. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/internal/connection.py +0 -0
  242. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/internal/jwt.py +0 -0
  243. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/internal/literal.py +0 -0
  244. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/internal/module_builder.py +0 -0
  245. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/internal/pydantic_codegen.py +0 -0
  246. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/internal/tsgen.py +0 -0
  247. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/manager/__init__.py +0 -0
  248. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/manager/base.py +0 -0
  249. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/manager/config.py +0 -0
  250. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/manager/datatype.py +0 -0
  251. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/manager/event.py +0 -0
  252. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/manager/flow.py +0 -0
  253. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/manager/function.py +0 -0
  254. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/manager/runtime_event.py +0 -0
  255. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/manager/runtime_function.py +0 -0
  256. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/map/__init__.py +0 -0
  257. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/map/datatype.py +0 -0
  258. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/map/event.py +0 -0
  259. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/map/function.py +0 -0
  260. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/map/runtime_event.py +0 -0
  261. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/map/runtime_function.py +0 -0
  262. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/models/__init__.py +0 -0
  263. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/models/datatype.py +0 -0
  264. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/models/event.py +0 -0
  265. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/models/function.py +0 -0
  266. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/models/runtime_event.py +0 -0
  267. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/hercules/schema.py +0 -0
  268. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/setup.cfg +0 -0
  269. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/tests/test_datatype.py +0 -0
  270. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/tests/test_export.py +0 -0
  271. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/tests/test_index.py +0 -0
  272. {code0_hercules-1.5.0 → code0_hercules-1.7.0}/tests/test_literal.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code0-hercules
3
- Version: 1.5.0
3
+ Version: 1.7.0
4
4
  Summary: Python SDK for the hercules action runner
5
5
  License-Expression: MIT
6
6
  Project-URL: Repository, https://github.com/code0-tech/hercules
@@ -8,7 +8,7 @@ Requires-Python: >=3.10
8
8
  Description-Content-Type: text/markdown
9
9
  Requires-Dist: grpcio>=1.64
10
10
  Requires-Dist: protobuf>=5.0
11
- Requires-Dist: tucana>=0.0.82
11
+ Requires-Dist: tucana>=0.0.83
12
12
  Requires-Dist: pydantic>=2
13
13
  Provides-Extra: codegen
14
14
  Requires-Dist: datamodel-code-generator>=0.25; extra == "codegen"
@@ -51,7 +51,7 @@ The built-in data types / functions in `hercules/definitions/` are **generated**
51
51
  release:
52
52
 
53
53
  ```bash
54
- uv run python scripts/build_definitions.py --version def-0.0.36
54
+ uv run python scripts/build_definitions.py --version def-0.0.38
55
55
  ```
56
56
 
57
57
  ## Build & release
@@ -70,7 +70,7 @@ git tag 0.1.0 && git push origin 0.1.0
70
70
  ```
71
71
 
72
72
  The `code0-definition` release used for the built-in definitions is controlled by
73
- the `HERCULES_DEFINITIONS_VERSION` repository variable (default `def-0.0.36`).
73
+ the `HERCULES_DEFINITIONS_VERSION` repository variable (default `def-0.0.38`).
74
74
 
75
75
  Build locally:
76
76
 
@@ -36,7 +36,7 @@ The built-in data types / functions in `hercules/definitions/` are **generated**
36
36
  release:
37
37
 
38
38
  ```bash
39
- uv run python scripts/build_definitions.py --version def-0.0.36
39
+ uv run python scripts/build_definitions.py --version def-0.0.38
40
40
  ```
41
41
 
42
42
  ## Build & release
@@ -55,7 +55,7 @@ git tag 0.1.0 && git push origin 0.1.0
55
55
  ```
56
56
 
57
57
  The `code0-definition` release used for the built-in definitions is controlled by
58
- the `HERCULES_DEFINITIONS_VERSION` repository variable (default `def-0.0.36`).
58
+ the `HERCULES_DEFINITIONS_VERSION` repository variable (default `def-0.0.38`).
59
59
 
60
60
  Build locally:
61
61
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code0-hercules
3
- Version: 1.5.0
3
+ Version: 1.7.0
4
4
  Summary: Python SDK for the hercules action runner
5
5
  License-Expression: MIT
6
6
  Project-URL: Repository, https://github.com/code0-tech/hercules
@@ -8,7 +8,7 @@ Requires-Python: >=3.10
8
8
  Description-Content-Type: text/markdown
9
9
  Requires-Dist: grpcio>=1.64
10
10
  Requires-Dist: protobuf>=5.0
11
- Requires-Dist: tucana>=0.0.82
11
+ Requires-Dist: tucana>=0.0.83
12
12
  Requires-Dist: pydantic>=2
13
13
  Provides-Extra: codegen
14
14
  Requires-Dist: datamodel-code-generator>=0.25; extra == "codegen"
@@ -51,7 +51,7 @@ The built-in data types / functions in `hercules/definitions/` are **generated**
51
51
  release:
52
52
 
53
53
  ```bash
54
- uv run python scripts/build_definitions.py --version def-0.0.36
54
+ uv run python scripts/build_definitions.py --version def-0.0.38
55
55
  ```
56
56
 
57
57
  ## Build & release
@@ -70,7 +70,7 @@ git tag 0.1.0 && git push origin 0.1.0
70
70
  ```
71
71
 
72
72
  The `code0-definition` release used for the built-in definitions is controlled by
73
- the `HERCULES_DEFINITIONS_VERSION` repository variable (default `def-0.0.36`).
73
+ the `HERCULES_DEFINITIONS_VERSION` repository variable (default `def-0.0.38`).
74
74
 
75
75
  Build locally:
76
76
 
@@ -238,6 +238,7 @@ hercules/internal/literal.py
238
238
  hercules/internal/module_builder.py
239
239
  hercules/internal/pydantic_codegen.py
240
240
  hercules/internal/schema.py
241
+ hercules/internal/sub_flow_function.py
241
242
  hercules/internal/tsgen.py
242
243
  hercules/manager/__init__.py
243
244
  hercules/manager/base.py
@@ -248,6 +249,7 @@ hercules/manager/flow.py
248
249
  hercules/manager/function.py
249
250
  hercules/manager/runtime_event.py
250
251
  hercules/manager/runtime_function.py
252
+ hercules/manager/sub_flow_function.py
251
253
  hercules/map/__init__.py
252
254
  hercules/map/datatype.py
253
255
  hercules/map/event.py
@@ -261,6 +263,7 @@ hercules/models/function.py
261
263
  hercules/models/runtime_event.py
262
264
  hercules/models/runtime_function.py
263
265
  tests/test_datatype.py
266
+ tests/test_execution.py
264
267
  tests/test_export.py
265
268
  tests/test_index.py
266
269
  tests/test_literal.py
@@ -1,6 +1,6 @@
1
1
  grpcio>=1.64
2
2
  protobuf>=5.0
3
- tucana>=0.0.82
3
+ tucana>=0.0.83
4
4
  pydantic>=2
5
5
 
6
6
  [codegen]
@@ -18,6 +18,8 @@ from hercules.types import (
18
18
  RuntimeError,
19
19
  RuntimeFlowTypeSetting_UniquenessScope,
20
20
  SubFlow,
21
+ SubFlowFunctionDefinition,
22
+ SubFlowFunctionSchema,
21
23
  Translation,
22
24
  )
23
25
  from hercules.events import CodeZeroEvent
@@ -55,6 +57,10 @@ from hercules.manager.flow import FlowManager
55
57
  from hercules.manager.function import FunctionManager
56
58
  from hercules.manager.runtime_event import RuntimeEventManager
57
59
  from hercules.manager.runtime_function import RuntimeFunctionManager
60
+ from hercules.manager.sub_flow_function import (
61
+ SUB_FLOW_FUNCTION_TTL_SECONDS,
62
+ SubFlowFunctionManager,
63
+ )
58
64
  from hercules.models.datatype import DataTypeProps, DataTypeRunnable
59
65
  from hercules.models.event import EventModel, EventSettingProps
60
66
  from hercules.models.function import FunctionParameterProps, FunctionProps
@@ -63,7 +69,8 @@ from hercules.models.runtime_function import RuntimeFunctionProps, RuntimeFuncti
63
69
  from hercules.action import Action, is_export_mode, registered_actions
64
70
 
65
71
  __all__ = [
66
- "Translation", "PlainValue", "SubFlow", "FunctionContext",
72
+ "Translation", "PlainValue", "SubFlow", "SubFlowFunctionDefinition",
73
+ "SubFlowFunctionSchema", "FunctionContext",
67
74
  "ProjectConfiguration", "ConfigurationDefinition", "RuntimeError",
68
75
  "FlowTypeSetting_UniquenessScope", "RuntimeFlowTypeSetting_UniquenessScope",
69
76
  "CodeZeroEvent", "SchemaType",
@@ -73,7 +80,9 @@ __all__ = [
73
80
  "OmitFunction", "Design", "ThrowsError", "Parameter", "Schema", "TypeString",
74
81
  "EventSetting", "OmitEvent", "OmitRuntimeFunction",
75
82
  "BaseManager", "ConfigManager", "FlowManager", "FunctionManager",
76
- "RuntimeFunctionManager", "DataTypeManager", "EventManager", "RuntimeEventManager",
83
+ "RuntimeFunctionManager", "SubFlowFunctionManager",
84
+ "SUB_FLOW_FUNCTION_TTL_SECONDS", "DataTypeManager",
85
+ "EventManager", "RuntimeEventManager",
77
86
  "FunctionProps", "FunctionParameterProps", "RuntimeFunctionProps",
78
87
  "RuntimeFunctionRunnable", "DataTypeProps", "DataTypeRunnable", "EventModel",
79
88
  "EventSettingProps", "RuntimeEventProps", "RuntimeEventRunnable",
@@ -22,6 +22,7 @@ from hercules.manager.flow import FlowManager
22
22
  from hercules.manager.function import FunctionManager
23
23
  from hercules.manager.runtime_event import RuntimeEventManager
24
24
  from hercules.manager.runtime_function import RuntimeFunctionManager
25
+ from hercules.manager.sub_flow_function import SubFlowFunctionManager
25
26
  from hercules.map.datatype import data_type_map
26
27
  from hercules.map.event import event_map
27
28
  from hercules.map.function import function_map
@@ -29,7 +30,12 @@ from hercules.map.runtime_event import runtime_event_map
29
30
  from hercules.map.runtime_function import runtime_function_map
30
31
  from hercules.models.event import EventModel
31
32
  from hercules.models.function import FunctionProps
32
- from hercules.types import ConfigurationDefinition, RuntimeError, Translation
33
+ from hercules.types import (
34
+ ConfigurationDefinition,
35
+ RuntimeError,
36
+ SubFlowFunctionDefinition,
37
+ Translation,
38
+ )
33
39
 
34
40
  # Registry of actions constructed while exporting, so the CLI can find them.
35
41
  _REGISTERED_ACTIONS: List["Action"] = []
@@ -114,6 +120,7 @@ class Action(EventEmitter):
114
120
  self.flows = FlowManager()
115
121
  self.functions = FunctionManager()
116
122
  self.runtime_functions = RuntimeFunctionManager()
123
+ self.sub_flow_functions = SubFlowFunctionManager()
117
124
  self.data_types = DataTypeManager()
118
125
  self.events = EventManager()
119
126
  self.runtime_events = RuntimeEventManager()
@@ -165,6 +172,35 @@ class Action(EventEmitter):
165
172
  ),
166
173
  )
167
174
 
175
+ def register_sub_flow_function(self, definition: SubFlowFunctionDefinition) -> str:
176
+ """Register a sub flow function returned from a ``run`` block.
177
+
178
+ Returns the identifier Aquila invokes it by. Each returned function gets its
179
+ own identifier, so repeatedly returning one (e.g. once per execution) never
180
+ overwrites a function a running flow still holds.
181
+
182
+ Aquila gives no signal that a flow is done with a function, so a registration
183
+ expires on its own 30 minutes after it was registered and can no longer be
184
+ invoked (see :class:`~hercules.manager.sub_flow_function.SubFlowFunctionManager`).
185
+ Call ``sub_flow_functions.delete(identifier)`` to drop one earlier.
186
+ """
187
+ identifier = f"{self._sub_flow_function_prefix}{definition.name}::{uuid.uuid4()}"
188
+ self.sub_flow_functions.set(identifier, definition)
189
+ return identifier
190
+
191
+ def is_sub_flow_function_identifier(self, identifier: str) -> bool:
192
+ """True for an identifier this action minted for a sub flow function.
193
+
194
+ Holds whether or not it is still registered. An execution request naming one
195
+ that is gone addresses a function that expired (or was deleted) rather than an
196
+ unknown one, which lets the execution handler report it as such.
197
+ """
198
+ return identifier.startswith(self._sub_flow_function_prefix)
199
+
200
+ @property
201
+ def _sub_flow_function_prefix(self) -> str:
202
+ return f"{self._identifier}::"
203
+
168
204
  def register_data_type_class(self, klass: type) -> None:
169
205
  definition = data_type_map(klass)
170
206
  self.data_types.set(definition.identifier, definition)
@@ -0,0 +1,194 @@
1
+ """Execution request handler (port of ``src/actions/Execution.ts``)."""
2
+ from __future__ import annotations
3
+
4
+ import asyncio
5
+ import inspect
6
+ import time
7
+ from dataclasses import dataclass
8
+ from typing import Callable, Optional
9
+
10
+ from hercules._tucana.helpers import construct_value
11
+ from tucana.generated.aquila import action_pb2
12
+ from tucana.generated.shared import errors_pb2, execution_result_pb2
13
+ from hercules.events import CodeZeroEvent
14
+ from hercules.internal.literal import resolve_node_value
15
+ from hercules.internal.sub_flow_function import (
16
+ as_sub_flow_function_definition,
17
+ build_sub_flow_function_result,
18
+ )
19
+ from hercules.types import ProjectConfiguration, RuntimeError
20
+
21
+ packet_type = "execution"
22
+
23
+
24
+ @dataclass
25
+ class _ExecutionTarget:
26
+ """A function an execution request may address.
27
+
28
+ Either a registered runtime function or a sub flow function returned by one.
29
+ ``parameter_count`` is ``None`` for a sub flow function, which has no definition
30
+ declaring its parameters, so every parameter of the request is passed through.
31
+ """
32
+
33
+ handler: Callable[..., object]
34
+ parameter_count: Optional[int] = None
35
+
36
+
37
+ def _now_micros() -> int:
38
+ return time.time_ns() // 1000
39
+
40
+
41
+ def _resolve_target(action, identifier: str) -> Optional[_ExecutionTarget]:
42
+ func = action.runtime_functions.get(identifier)
43
+ if func is not None:
44
+ return _ExecutionTarget(func.handler, len(func.parameters or []))
45
+
46
+ sub_flow_function = action.sub_flow_functions.get(identifier)
47
+ if sub_flow_function is not None:
48
+ return _ExecutionTarget(sub_flow_function.run)
49
+
50
+ return None
51
+
52
+
53
+ def _build_params(action, execution, target: _ExecutionTarget):
54
+ count = (
55
+ target.parameter_count
56
+ if target.parameter_count is not None
57
+ else len(execution.parameters)
58
+ )
59
+ params = []
60
+ for index in range(count):
61
+ field = execution.parameters[index] if index < len(execution.parameters) else None
62
+ params.append(resolve_node_value(action, field))
63
+ return params
64
+
65
+
66
+ def _wants_context(handler, param_count: int) -> bool:
67
+ try:
68
+ sig = inspect.signature(handler)
69
+ except (TypeError, ValueError):
70
+ return False
71
+ positional = [
72
+ p
73
+ for p in sig.parameters.values()
74
+ if p.kind in (p.POSITIONAL_ONLY, p.POSITIONAL_OR_KEYWORD)
75
+ ]
76
+ # A `*args` handler has no fixed positionals and never gets a context.
77
+ return len(positional) == param_count + 1
78
+
79
+
80
+ def _to_node_value(action, value) -> execution_result_pb2.NodeValueExecutionResult:
81
+ """Wrap a handler's return value in a ``NodeValueExecutionResult``.
82
+
83
+ Raw data goes out as a value; a returned sub flow function is registered on the
84
+ action and reported as a ``SubFlowFunctionResult`` so the flow can invoke it later.
85
+ """
86
+ definition = as_sub_flow_function_definition(value)
87
+ if definition is not None:
88
+ return execution_result_pb2.NodeValueExecutionResult(
89
+ sub_flow_function_result=build_sub_flow_function_result(action, definition)
90
+ )
91
+ return execution_result_pb2.NodeValueExecutionResult(
92
+ raw_value=construct_value(value if value is not None else None)
93
+ )
94
+
95
+
96
+ def handle(action, execution) -> None:
97
+ action.emit(CodeZeroEvent.execution_request_received, execution)
98
+
99
+ target = _resolve_target(action, execution.function_identifier)
100
+ if target is None:
101
+ if action.is_sub_flow_function_identifier(execution.function_identifier):
102
+ # A sub flow function this action returned earlier, whose maximum
103
+ # lifetime has passed (or which was deleted). Fail the node rather than
104
+ # staying silent, so the flow does not wait for a result that cannot come.
105
+ asyncio.ensure_future(
106
+ _send_error(
107
+ action,
108
+ execution,
109
+ RuntimeError(
110
+ "SUB_FLOW_FUNCTION_EXPIRED",
111
+ f"Sub flow function {execution.function_identifier} is no "
112
+ f"longer registered: its maximum lifetime has passed",
113
+ ),
114
+ _now_micros(),
115
+ )
116
+ )
117
+ return
118
+ print("Received execution request for unknown function:", execution.function_identifier)
119
+ return
120
+
121
+ params = _build_params(action, execution, target)
122
+
123
+ conf = action.configs.get(execution.project_id) or ProjectConfiguration(
124
+ project_id=0,
125
+ config_values=[],
126
+ find_config=lambda identifier: None,
127
+ )
128
+
129
+ from hercules.types import FunctionContext
130
+
131
+ context = FunctionContext(
132
+ project_id=execution.project_id,
133
+ execution_id=execution.execution_identifier,
134
+ matched_config=conf,
135
+ execute_flow=lambda flow_id, payload=None: action.execute_flow(flow_id, payload),
136
+ )
137
+
138
+ started_at = _now_micros()
139
+ handler = target.handler
140
+ all_params = (
141
+ [context, *params] if _wants_context(handler, len(params)) else params
142
+ )
143
+
144
+ asyncio.ensure_future(_run(action, execution, handler, all_params, started_at))
145
+
146
+
147
+ async def _run(action, execution, handler, all_params, started_at) -> None:
148
+ try:
149
+ value = handler(*all_params)
150
+ if inspect.isawaitable(value):
151
+ value = await value
152
+ finished_at = _now_micros()
153
+ request = action_pb2.ActionTransferRequest(
154
+ result=action_pb2.ActionExecutionResponse(
155
+ execution_identifier=execution.execution_identifier,
156
+ node_result=execution_result_pb2.NodeExecutionResult(
157
+ started_at=started_at,
158
+ finished_at=finished_at,
159
+ parameter_results=[],
160
+ success=_to_node_value(action, value),
161
+ ),
162
+ )
163
+ )
164
+ await action.send(request)
165
+ except Exception as error: # noqa: BLE001
166
+ await _send_error(action, execution, error, started_at)
167
+
168
+
169
+ async def _send_error(action, execution, error, started_at) -> None:
170
+ """Report a failed execution back to Aquila."""
171
+ finished_at = _now_micros()
172
+ is_runtime_error = isinstance(error, RuntimeError)
173
+ proto_error = errors_pb2.Error(
174
+ code=error.code if is_runtime_error else "UNKNOWN_ERROR",
175
+ category="RUNTIME",
176
+ message=(error.description or str(error)) if is_runtime_error else str(error),
177
+ timestamp=finished_at,
178
+ version=action.version,
179
+ )
180
+ request = action_pb2.ActionTransferRequest(
181
+ result=action_pb2.ActionExecutionResponse(
182
+ execution_identifier=execution.execution_identifier,
183
+ node_result=execution_result_pb2.NodeExecutionResult(
184
+ started_at=started_at,
185
+ finished_at=finished_at,
186
+ parameter_results=[],
187
+ error=proto_error,
188
+ ),
189
+ )
190
+ )
191
+ try:
192
+ await action.send(request)
193
+ except Exception as err: # noqa: BLE001
194
+ print("Failed to send execution error:", err)
@@ -4,7 +4,7 @@ from hercules.decorators.event import EventSetting
4
4
 
5
5
 
6
6
  @Identifier("REST")
7
- @Signature("<A extends REST_AUTH_TYPE, T>(http_schema: HTTP_SCHEMA, http_url: HTTP_URL, http_method: HTTP_METHOD, http_auth: A, http_auth_value: REST_AUTH_VALUE<A>, input_schema: TYPE<T>): REST_ADAPTER_INPUT<T>")
7
+ @Signature("<A extends REST_AUTH_TYPE, T extends TYPE>(http_schema: HTTP_SCHEMA, http_url: HTTP_URL, http_method: HTTP_METHOD, http_auth: A, http_auth_value: REST_AUTH_VALUE<A>, input_schema: T): REST_ADAPTER_INPUT<T>")
8
8
  @Name({"code": "en-US", "content": "Webhook"})
9
9
  @Description({"code": "en-US", "content": "A Webhook is an HTTP endpoint that listens for incoming requests from external services or clients, allowing you to react to events in real time using standard HTTP methods like GET, POST, PUT, and DELETE."})
10
10
  @DisplayMessage({"code": "en-US", "content": "Webhook on ${http_method} at ${http_url}"})
@@ -10,7 +10,7 @@ from hercules.decorators.function import Parameter
10
10
  @Name({"code": "en-US", "content": "If-Else"})
11
11
  @Description({"code": "en-US", "content": "Evaluates a condition and executes either the Then Runnable or the Else Runnable."})
12
12
  @Documentation({"code": "en-US", "content": "Evaluates a boolean condition. If true, executes the Runnable. Otherwise executes the Else Runnable."})
13
- @DisplayMessage({"code": "en-US", "content": "If ${condition} is True do ${then_runnable} else ${else_runnable}"})
13
+ @DisplayMessage({"code": "en-US", "content": "If ${condition} is True do ${runnable} else ${else_runnable}"})
14
14
  @Alias({"code": "en-US", "content": "if_else;control;std;if;else"})
15
15
  @DisplayIcon("tabler:arrow-ramp-right")
16
16
  @Parameter({"runtime_name": "condition", "name": [{"code": "en-US", "content": "Condition"}], "description": [{"code": "en-US", "content": "Boolean that determines which branch to execute. If true the Runnable runs otherwise the Else Runnable runs."}]})
@@ -6,7 +6,7 @@ from hercules.decorators.function import ThrowsError, Parameter
6
6
 
7
7
  @OmitRuntimeFunction()
8
8
  @Identifier("http::request::send")
9
- @Signature("<A extends HTTP_AUTH_TYPE, S extends HTTP_SCHEMA>(http_method: HTTP_METHOD, url: HTTP_URL, http_auth: A, http_auth_value: HTTP_AUTH_VALUE<A>, http_auth_place: HTTP_AUTH_PLACE<A>, http_schema: S, payload: HTTP_PAYLOAD<S>, headers?: OBJECT<{}>): HTTP_RESPONSE<any>")
9
+ @Signature("<A extends HTTP_AUTH_TYPE, S extends HTTP_SCHEMA>(http_method: HTTP_METHOD, url: HTTP_URL, http_auth: A, http_auth_value: HTTP_AUTH_VALUE<A>, http_auth_place: HTTP_AUTH_PLACE<A>, http_schema: S, payload: HTTP_PAYLOAD<S>, headers?: OBJECT<{ [key: TEXT]: TEXT }>): HTTP_RESPONSE<any>")
10
10
  @Name({"code": "en-US", "content": "Send HTTP request"})
11
11
  @Description({"code": "en-US", "content": "Sends a request to the specified url with the given method, headers and payload, and returns the response as an HTTP_RESPONSE object. This function initiates an HTTP request to a specified endpoint, allowing you to interact with web services or APIs by sending data and receiving responses."})
12
12
  @DisplayMessage({"code": "en-US", "content": "Send request to ${url} with ${payload}"})
@@ -133,6 +133,16 @@ def pydantic_to_type_string(model: SchemaModel) -> str:
133
133
  return json_schema_to_ts(resolved, name)
134
134
 
135
135
 
136
+ def pydantic_to_json_schema(model: SchemaModel, mode: str) -> Dict[str, Any]:
137
+ """Convert a Pydantic model into a plain JSON schema dict.
138
+
139
+ ``mode`` picks which side of the model is described: ``"validation"`` for the
140
+ input it accepts, ``"serialization"`` for the output it produces (the Python
141
+ counterpart of the TypeScript SDK's zod ``io`` option).
142
+ """
143
+ return model.model_json_schema(mode=mode)
144
+
145
+
136
146
  def pydantic_to_rules(model: SchemaModel) -> List[data_type_pb2.DefinitionDataTypeRule]:
137
147
  schema = model.model_json_schema()
138
148
  rules: List[data_type_pb2.DefinitionDataTypeRule] = []
@@ -0,0 +1,86 @@
1
+ """Sub flow function support (port of ``src/internal/sub-flow-function.ts``).
2
+
3
+ A runtime function's ``run`` may return a sub flow function instead of raw data.
4
+ Hercules registers it on the action and reports it to Aquila as a
5
+ ``shared.SubFlowFunctionResult``, which the flow can then invoke like any sub flow.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ from typing import Mapping, Optional
10
+
11
+ from pydantic import BaseModel
12
+
13
+ from hercules._tucana.helpers import construct_value
14
+ from hercules.internal.schema import pydantic_to_json_schema
15
+ from hercules.types import (
16
+ RuntimeError,
17
+ SubFlowFunctionDefinition,
18
+ SubFlowFunctionSchema,
19
+ )
20
+ from tucana.generated.shared import execution_result_pb2, flow_pb2, struct_pb2
21
+
22
+ __all__ = ["as_sub_flow_function_definition", "build_sub_flow_function_result", "to_struct"]
23
+
24
+
25
+ def as_sub_flow_function_definition(value) -> Optional[SubFlowFunctionDefinition]:
26
+ """Return ``value`` as a definition if ``run`` returned a sub flow function.
27
+
28
+ A sub flow function is told apart from raw data by its callable ``run``, which a
29
+ plain value never carries. Both a :class:`SubFlowFunctionDefinition` and a plain
30
+ mapping with the same keys are accepted.
31
+ """
32
+ if isinstance(value, SubFlowFunctionDefinition):
33
+ return value
34
+ if isinstance(value, Mapping) and callable(value.get("run")):
35
+ return SubFlowFunctionDefinition(
36
+ name=value.get("name"),
37
+ description=value.get("description") or "",
38
+ input_schema=value.get("input_schema") or {},
39
+ output_schema=value.get("output_schema") or {},
40
+ run=value["run"],
41
+ )
42
+ return None
43
+
44
+
45
+ def _is_model(schema) -> bool:
46
+ return isinstance(schema, type) and issubclass(schema, BaseModel)
47
+
48
+
49
+ def to_struct(schema: Optional[SubFlowFunctionSchema], mode: str) -> struct_pb2.Struct:
50
+ """Convert a declared schema into the ``shared.Struct`` the protobuf field expects.
51
+
52
+ A Pydantic model becomes a JSON schema first: ``mode`` is ``"validation"`` for a
53
+ function's input schema (what it accepts) and ``"serialization"`` for its output
54
+ schema (what it produces).
55
+ """
56
+ if isinstance(schema, struct_pb2.Struct):
57
+ return schema
58
+ if _is_model(schema):
59
+ return construct_value(pydantic_to_json_schema(schema, mode)).struct_value
60
+ return construct_value(schema or {}).struct_value
61
+
62
+
63
+ def build_sub_flow_function_result(
64
+ action, definition: SubFlowFunctionDefinition
65
+ ) -> execution_result_pb2.SubFlowFunctionResult:
66
+ """Register the sub flow function and build the result reported back to Aquila.
67
+
68
+ The identifier in the result is the one Aquila sends back on an execution request
69
+ when the flow invokes the function.
70
+ """
71
+ if not definition.name:
72
+ raise RuntimeError(
73
+ "SUB_FLOW_FUNCTION_MISSING_NAME",
74
+ "A sub flow function returned from a run block must declare a name",
75
+ )
76
+ function_identifier = action.register_sub_flow_function(definition)
77
+ return execution_result_pb2.SubFlowFunctionResult(
78
+ function=flow_pb2.SubFlowFunction(
79
+ function_identifier=function_identifier,
80
+ definition_source="action",
81
+ ),
82
+ name=definition.name,
83
+ description=definition.description or "",
84
+ input_schema=to_struct(definition.input_schema, "validation"),
85
+ output_schema=to_struct(definition.output_schema, "serialization"),
86
+ )
@@ -0,0 +1,93 @@
1
+ """Sub flow function manager (port of ``src/manager/SubFlowFunctionManager.ts``)."""
2
+ from __future__ import annotations
3
+
4
+ import asyncio
5
+ import time
6
+ from typing import Dict, Optional
7
+
8
+ from hercules.manager.base import BaseManager
9
+
10
+ #: How long a returned sub flow function stays in memory and invocable: 30 minutes.
11
+ SUB_FLOW_FUNCTION_TTL_SECONDS = 30 * 60
12
+
13
+
14
+ class SubFlowFunctionManager(BaseManager):
15
+ """Sub flow functions a runtime function returned at execution time.
16
+
17
+ Keyed by the identifier reported to Aquila. Unlike the other managers this one is
18
+ not filled by registering classes up front: entries appear while the action runs
19
+ (see :meth:`hercules.action.Action.register_sub_flow_function`).
20
+
21
+ Each entry has a maximum lifetime of :data:`SUB_FLOW_FUNCTION_TTL_SECONDS`,
22
+ counted from when it was registered and never extended by an invocation, so a flow
23
+ that holds a function forever cannot grow the registry without bound. Expired
24
+ entries are dropped by a sweep scheduled for the next expiry, and on any read or
25
+ write, so an expired function is never invoked even if the sweep could not run
26
+ (there is no running event loop to schedule it on, for instance).
27
+ """
28
+
29
+ def __init__(self, ttl_seconds: float = SUB_FLOW_FUNCTION_TTL_SECONDS) -> None:
30
+ super().__init__()
31
+ self._ttl_seconds = ttl_seconds
32
+ # Expiry per key. Insertion order is expiry order, since the TTL is fixed.
33
+ self._expiries: Dict[str, float] = {}
34
+ self._sweep_handle: Optional[asyncio.TimerHandle] = None
35
+
36
+ @staticmethod
37
+ def _now() -> float:
38
+ # Monotonic, so a system clock change cannot postpone or trigger an expiry.
39
+ return time.monotonic()
40
+
41
+ def set(self, key, value):
42
+ # Re-insert the expiry so a replaced key moves to the back and the dict stays
43
+ # ordered by expiry.
44
+ self._expiries.pop(key, None)
45
+ super().set(key, value)
46
+ self._expiries[key] = self._now() + self._ttl_seconds
47
+ self.prune()
48
+ return self
49
+
50
+ def get(self, key):
51
+ self.prune()
52
+ return super().get(key)
53
+
54
+ def has(self, key) -> bool:
55
+ self.prune()
56
+ return super().has(key)
57
+
58
+ def delete(self, key) -> bool:
59
+ self._expiries.pop(key, None)
60
+ deleted = super().delete(key)
61
+ self._schedule_sweep(self._now())
62
+ return deleted
63
+
64
+ def clear(self) -> None:
65
+ self._expiries.clear()
66
+ super().clear()
67
+ self._schedule_sweep(self._now())
68
+
69
+ def prune(self, now: Optional[float] = None) -> None:
70
+ """Drop every entry whose lifetime has passed, then schedule the next sweep."""
71
+ if now is None:
72
+ now = self._now()
73
+ for key, expires_at in list(self._expiries.items()):
74
+ # Ordered by expiry, so the first entry still alive ends the sweep.
75
+ if expires_at > now:
76
+ break
77
+ del self._expiries[key]
78
+ super().delete(key)
79
+ self._schedule_sweep(now)
80
+
81
+ def _schedule_sweep(self, now: float) -> None:
82
+ if self._sweep_handle is not None:
83
+ self._sweep_handle.cancel()
84
+ self._sweep_handle = None
85
+ next_expiry = next(iter(self._expiries.values()), None)
86
+ if next_expiry is None:
87
+ return
88
+ try:
89
+ loop = asyncio.get_running_loop()
90
+ except RuntimeError:
91
+ # No loop to schedule on; pruning on the next read or write still applies.
92
+ return
93
+ self._sweep_handle = loop.call_later(max(0.0, next_expiry - now), self.prune)