haywire-core 0.0.2__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 (226) hide show
  1. haywire_core-0.0.2/.gitignore +205 -0
  2. haywire_core-0.0.2/PKG-INFO +18 -0
  3. haywire_core-0.0.2/pyproject.toml +35 -0
  4. haywire_core-0.0.2/src/haywire/__init__.py +0 -0
  5. haywire_core-0.0.2/src/haywire/core/__init__.py +0 -0
  6. haywire_core-0.0.2/src/haywire/core/adapter/base.py +307 -0
  7. haywire_core-0.0.2/src/haywire/core/adapter/factory.py +509 -0
  8. haywire_core-0.0.2/src/haywire/core/adapter/registry.py +285 -0
  9. haywire_core-0.0.2/src/haywire/core/assembly/__init__.py +35 -0
  10. haywire_core-0.0.2/src/haywire/core/assembly/control_flow_builder.py +165 -0
  11. haywire_core-0.0.2/src/haywire/core/assembly/data_flow_builder.py +284 -0
  12. haywire_core-0.0.2/src/haywire/core/assembly/flow_assembly_manager.py +461 -0
  13. haywire_core-0.0.2/src/haywire/core/debug/__init__.py +0 -0
  14. haywire_core-0.0.2/src/haywire/core/debug/configurator.py +139 -0
  15. haywire_core-0.0.2/src/haywire/core/debug/debug_settings.py +99 -0
  16. haywire_core-0.0.2/src/haywire/core/debug/keys.py +31 -0
  17. haywire_core-0.0.2/src/haywire/core/di/__init__.py +6 -0
  18. haywire_core-0.0.2/src/haywire/core/di/config.py +925 -0
  19. haywire_core-0.0.2/src/haywire/core/di/context.py +148 -0
  20. haywire_core-0.0.2/src/haywire/core/di/test_config.py +259 -0
  21. haywire_core-0.0.2/src/haywire/core/edge/edge.py +52 -0
  22. haywire_core-0.0.2/src/haywire/core/edge/edge_wrapper.py +896 -0
  23. haywire_core-0.0.2/src/haywire/core/errors/__init__.py +15 -0
  24. haywire_core-0.0.2/src/haywire/core/errors/haywire_exception.py +1173 -0
  25. haywire_core-0.0.2/src/haywire/core/errors/node_exceptions.py +33 -0
  26. haywire_core-0.0.2/src/haywire/core/errors/utils.py +10 -0
  27. haywire_core-0.0.2/src/haywire/core/execution/__init__.py +68 -0
  28. haywire_core-0.0.2/src/haywire/core/execution/callback_manager.py +138 -0
  29. haywire_core-0.0.2/src/haywire/core/execution/event_source.py +139 -0
  30. haywire_core-0.0.2/src/haywire/core/execution/execution_context.py +69 -0
  31. haywire_core-0.0.2/src/haywire/core/execution/flow.py +318 -0
  32. haywire_core-0.0.2/src/haywire/core/execution/interpreter.py +373 -0
  33. haywire_core-0.0.2/src/haywire/core/execution/scheduler.py +397 -0
  34. haywire_core-0.0.2/src/haywire/core/execution/settings.py +27 -0
  35. haywire_core-0.0.2/src/haywire/core/execution/vm.py +391 -0
  36. haywire_core-0.0.2/src/haywire/core/graph/__init__.py +19 -0
  37. haywire_core-0.0.2/src/haywire/core/graph/base.py +1081 -0
  38. haywire_core-0.0.2/src/haywire/core/graph/editor.py +253 -0
  39. haywire_core-0.0.2/src/haywire/core/graph/types.py +216 -0
  40. haywire_core-0.0.2/src/haywire/core/graph/utils/graph_to_python.py +148 -0
  41. haywire_core-0.0.2/src/haywire/core/graph/validation.py +418 -0
  42. haywire_core-0.0.2/src/haywire/core/host/__init__.py +8 -0
  43. haywire_core-0.0.2/src/haywire/core/host/store.py +130 -0
  44. haywire_core-0.0.2/src/haywire/core/library/__init__.py +3 -0
  45. haywire_core-0.0.2/src/haywire/core/library/base.py +237 -0
  46. haywire_core-0.0.2/src/haywire/core/library/decorator.py +94 -0
  47. haywire_core-0.0.2/src/haywire/core/library/decorator_io.py +34 -0
  48. haywire_core-0.0.2/src/haywire/core/library/dep_detect.py +377 -0
  49. haywire_core-0.0.2/src/haywire/core/library/discovery.py +185 -0
  50. haywire_core-0.0.2/src/haywire/core/library/file_watcher.py +373 -0
  51. haywire_core-0.0.2/src/haywire/core/library/identity.py +33 -0
  52. haywire_core-0.0.2/src/haywire/core/library/info.py +30 -0
  53. haywire_core-0.0.2/src/haywire/core/library/install_type.py +13 -0
  54. haywire_core-0.0.2/src/haywire/core/library/registry.py +721 -0
  55. haywire_core-0.0.2/src/haywire/core/library/utils.py +136 -0
  56. haywire_core-0.0.2/src/haywire/core/marketstall/__init__.py +128 -0
  57. haywire_core-0.0.2/src/haywire/core/marketstall/cache.py +106 -0
  58. haywire_core-0.0.2/src/haywire/core/marketstall/errors.py +31 -0
  59. haywire_core-0.0.2/src/haywire/core/marketstall/helpers.py +237 -0
  60. haywire_core-0.0.2/src/haywire/core/marketstall/host_providers/__init__.py +38 -0
  61. haywire_core-0.0.2/src/haywire/core/marketstall/host_providers/base.py +46 -0
  62. haywire_core-0.0.2/src/haywire/core/marketstall/host_providers/config.py +50 -0
  63. haywire_core-0.0.2/src/haywire/core/marketstall/host_providers/github.py +58 -0
  64. haywire_core-0.0.2/src/haywire/core/marketstall/host_providers/gitlab.py +59 -0
  65. haywire_core-0.0.2/src/haywire/core/marketstall/parsing.py +223 -0
  66. haywire_core-0.0.2/src/haywire/core/marketstall/platform.py +35 -0
  67. haywire_core-0.0.2/src/haywire/core/marketstall/refresh.py +313 -0
  68. haywire_core-0.0.2/src/haywire/core/marketstall/subscribe.py +139 -0
  69. haywire_core-0.0.2/src/haywire/core/marketstall/types.py +150 -0
  70. haywire_core-0.0.2/src/haywire/core/marketstall/url_resolution.py +142 -0
  71. haywire_core-0.0.2/src/haywire/core/namespaces.py +14 -0
  72. haywire_core-0.0.2/src/haywire/core/node/__init__.py +48 -0
  73. haywire_core-0.0.2/src/haywire/core/node/base.py +1345 -0
  74. haywire_core-0.0.2/src/haywire/core/node/behavior.py +125 -0
  75. haywire_core-0.0.2/src/haywire/core/node/dataclasses.py +58 -0
  76. haywire_core-0.0.2/src/haywire/core/node/decorator.py +261 -0
  77. haywire_core-0.0.2/src/haywire/core/node/factory.py +285 -0
  78. haywire_core-0.0.2/src/haywire/core/node/identity.py +15 -0
  79. haywire_core-0.0.2/src/haywire/core/node/info.py +13 -0
  80. haywire_core-0.0.2/src/haywire/core/node/node_wrapper.py +709 -0
  81. haywire_core-0.0.2/src/haywire/core/node/properties.py +118 -0
  82. haywire_core-0.0.2/src/haywire/core/node/registry.py +109 -0
  83. haywire_core-0.0.2/src/haywire/core/node/user_data.py +290 -0
  84. haywire_core-0.0.2/src/haywire/core/registry/base.py +957 -0
  85. haywire_core-0.0.2/src/haywire/core/registry/dependency_graph.py +674 -0
  86. haywire_core-0.0.2/src/haywire/core/registry/folder_scan.py +206 -0
  87. haywire_core-0.0.2/src/haywire/core/registry/identity.py +18 -0
  88. haywire_core-0.0.2/src/haywire/core/registry/lifecycle_event.py +235 -0
  89. haywire_core-0.0.2/src/haywire/core/session/__init__.py +88 -0
  90. haywire_core-0.0.2/src/haywire/core/session/context.py +113 -0
  91. haywire_core-0.0.2/src/haywire/core/session/handlers.py +279 -0
  92. haywire_core-0.0.2/src/haywire/core/session/protocols.py +35 -0
  93. haywire_core-0.0.2/src/haywire/core/session/session.py +137 -0
  94. haywire_core-0.0.2/src/haywire/core/session/session_manager.py +143 -0
  95. haywire_core-0.0.2/src/haywire/core/session/signals/__init__.py +44 -0
  96. haywire_core-0.0.2/src/haywire/core/session/signals/bus.py +173 -0
  97. haywire_core-0.0.2/src/haywire/core/session/signals/descriptor.py +215 -0
  98. haywire_core-0.0.2/src/haywire/core/session/signals/host.py +33 -0
  99. haywire_core-0.0.2/src/haywire/core/session/signals/signal.py +38 -0
  100. haywire_core-0.0.2/src/haywire/core/session/signals/vocabulary.py +176 -0
  101. haywire_core-0.0.2/src/haywire/core/session/workspace/__init__.py +0 -0
  102. haywire_core-0.0.2/src/haywire/core/session/workspace/manager.py +54 -0
  103. haywire_core-0.0.2/src/haywire/core/settings/__init__.py +55 -0
  104. haywire_core-0.0.2/src/haywire/core/settings/base.py +102 -0
  105. haywire_core-0.0.2/src/haywire/core/settings/decorator.py +112 -0
  106. haywire_core-0.0.2/src/haywire/core/settings/descriptor.py +340 -0
  107. haywire_core-0.0.2/src/haywire/core/settings/enums.py +14 -0
  108. haywire_core-0.0.2/src/haywire/core/settings/node_settings.py +38 -0
  109. haywire_core-0.0.2/src/haywire/core/settings/registry.py +972 -0
  110. haywire_core-0.0.2/src/haywire/core/settings/schema.py +176 -0
  111. haywire_core-0.0.2/src/haywire/core/settings/settings.py +282 -0
  112. haywire_core-0.0.2/src/haywire/core/settings/types.py +59 -0
  113. haywire_core-0.0.2/src/haywire/core/settings/value.py +49 -0
  114. haywire_core-0.0.2/src/haywire/core/state/__init__.py +23 -0
  115. haywire_core-0.0.2/src/haywire/core/state/base.py +212 -0
  116. haywire_core-0.0.2/src/haywire/core/state/container.py +622 -0
  117. haywire_core-0.0.2/src/haywire/core/state/data_namespace.py +63 -0
  118. haywire_core-0.0.2/src/haywire/core/state/decorator.py +88 -0
  119. haywire_core-0.0.2/src/haywire/core/state/identity.py +23 -0
  120. haywire_core-0.0.2/src/haywire/core/state/registry.py +101 -0
  121. haywire_core-0.0.2/src/haywire/core/types/__init__.py +60 -0
  122. haywire_core-0.0.2/src/haywire/core/types/base.py +398 -0
  123. haywire_core-0.0.2/src/haywire/core/types/decorator.py +165 -0
  124. haywire_core-0.0.2/src/haywire/core/types/enums.py +60 -0
  125. haywire_core-0.0.2/src/haywire/core/types/event.py +219 -0
  126. haywire_core-0.0.2/src/haywire/core/types/fields.py +340 -0
  127. haywire_core-0.0.2/src/haywire/core/types/identity.py +99 -0
  128. haywire_core-0.0.2/src/haywire/core/types/interface.py +485 -0
  129. haywire_core-0.0.2/src/haywire/core/types/pipe.py +94 -0
  130. haywire_core-0.0.2/src/haywire/core/types/port.py +640 -0
  131. haywire_core-0.0.2/src/haywire/core/types/registry.py +199 -0
  132. haywire_core-0.0.2/src/haywire/core/types/utils.py +209 -0
  133. haywire_core-0.0.2/src/haywire/core/undo/__init__.py +1 -0
  134. haywire_core-0.0.2/src/haywire/core/undo/actions/__init__.py +1 -0
  135. haywire_core-0.0.2/src/haywire/core/undo/actions/graph_actions.py +457 -0
  136. haywire_core-0.0.2/src/haywire/core/undo/base_action.py +269 -0
  137. haywire_core-0.0.2/src/haywire/core/undo/config.py +112 -0
  138. haywire_core-0.0.2/src/haywire/core/undo/history_manager.py +483 -0
  139. haywire_core-0.0.2/src/haywire/core/undo/interfaces.py +180 -0
  140. haywire_core-0.0.2/src/haywire/core/undo/no_op_history_manager.py +71 -0
  141. haywire_core-0.0.2/src/haywire/core/utils.py +5 -0
  142. haywire_core-0.0.2/src/haywire/core/validation/interface.py +59 -0
  143. haywire_core-0.0.2/src/haywire/core/validation/structural_validator.py +373 -0
  144. haywire_core-0.0.2/src/haywire/py.typed +0 -0
  145. haywire_core-0.0.2/src/haywire/ui/app/icon_slot.py +163 -0
  146. haywire_core-0.0.2/src/haywire/ui/app/shell.py +652 -0
  147. haywire_core-0.0.2/src/haywire/ui/app/slot.py +826 -0
  148. haywire_core-0.0.2/src/haywire/ui/app/tab_slot.py +138 -0
  149. haywire_core-0.0.2/src/haywire/ui/components/__init__.py +3 -0
  150. haywire_core-0.0.2/src/haywire/ui/components/graph/canvas.py +110 -0
  151. haywire_core-0.0.2/src/haywire/ui/components/graph/canvas.vue +2408 -0
  152. haywire_core-0.0.2/src/haywire/ui/components/graph/event_definitions.py +391 -0
  153. haywire_core-0.0.2/src/haywire/ui/components/graph/generated/graph_events.js +336 -0
  154. haywire_core-0.0.2/src/haywire/ui/components/graph/generators.py +189 -0
  155. haywire_core-0.0.2/src/haywire/ui/components/minimap/minimap.py +113 -0
  156. haywire_core-0.0.2/src/haywire/ui/components/minimap/minimap.vue +412 -0
  157. haywire_core-0.0.2/src/haywire/ui/components/minimap/settings.py +52 -0
  158. haywire_core-0.0.2/src/haywire/ui/components/number/drag.py +68 -0
  159. haywire_core-0.0.2/src/haywire/ui/components/number/drag.vue +347 -0
  160. haywire_core-0.0.2/src/haywire/ui/components/popup/__init__.py +8 -0
  161. haywire_core-0.0.2/src/haywire/ui/components/popup/popup.py +195 -0
  162. haywire_core-0.0.2/src/haywire/ui/components/popup/popup.vue +343 -0
  163. haywire_core-0.0.2/src/haywire/ui/components/zoom/pan.py +385 -0
  164. haywire_core-0.0.2/src/haywire/ui/components/zoom/pan.vue +672 -0
  165. haywire_core-0.0.2/src/haywire/ui/components/zoom/settings.py +38 -0
  166. haywire_core-0.0.2/src/haywire/ui/console_bridge.py +140 -0
  167. haywire_core-0.0.2/src/haywire/ui/editor/__init__.py +19 -0
  168. haywire_core-0.0.2/src/haywire/ui/editor/base.py +151 -0
  169. haywire_core-0.0.2/src/haywire/ui/editor/decorator.py +95 -0
  170. haywire_core-0.0.2/src/haywire/ui/editor/identity.py +51 -0
  171. haywire_core-0.0.2/src/haywire/ui/editor/registry.py +125 -0
  172. haywire_core-0.0.2/src/haywire/ui/editor/wrapper.py +595 -0
  173. haywire_core-0.0.2/src/haywire/ui/elements/__init__.py +20 -0
  174. haywire_core-0.0.2/src/haywire/ui/elements/elements.py +975 -0
  175. haywire_core-0.0.2/src/haywire/ui/elements/icons.py +200 -0
  176. haywire_core-0.0.2/src/haywire/ui/errors/error_info.py +136 -0
  177. haywire_core-0.0.2/src/haywire/ui/errors/haywire_exception.py +327 -0
  178. haywire_core-0.0.2/src/haywire/ui/modals/__init__.py +21 -0
  179. haywire_core-0.0.2/src/haywire/ui/modals/confirm_modal.py +75 -0
  180. haywire_core-0.0.2/src/haywire/ui/modals/diff_modal.py +153 -0
  181. haywire_core-0.0.2/src/haywire/ui/modals/info_modal.py +54 -0
  182. haywire_core-0.0.2/src/haywire/ui/modals/install_safety_modal.py +108 -0
  183. haywire_core-0.0.2/src/haywire/ui/modals/pick_modal.py +86 -0
  184. haywire_core-0.0.2/src/haywire/ui/modals/rename_modal.py +140 -0
  185. haywire_core-0.0.2/src/haywire/ui/modals/save_as_modal.py +190 -0
  186. haywire_core-0.0.2/src/haywire/ui/panel/__init__.py +37 -0
  187. haywire_core-0.0.2/src/haywire/ui/panel/base.py +68 -0
  188. haywire_core-0.0.2/src/haywire/ui/panel/context_menu_base.py +89 -0
  189. haywire_core-0.0.2/src/haywire/ui/panel/decorator.py +126 -0
  190. haywire_core-0.0.2/src/haywire/ui/panel/error_boundary.py +42 -0
  191. haywire_core-0.0.2/src/haywire/ui/panel/focus.py +81 -0
  192. haywire_core-0.0.2/src/haywire/ui/panel/identity.py +56 -0
  193. haywire_core-0.0.2/src/haywire/ui/panel/layout.py +142 -0
  194. haywire_core-0.0.2/src/haywire/ui/panel/registry.py +172 -0
  195. haywire_core-0.0.2/src/haywire/ui/panel/render_utils.py +492 -0
  196. haywire_core-0.0.2/src/haywire/ui/prefs/__init__.py +23 -0
  197. haywire_core-0.0.2/src/haywire/ui/prefs/canvas.py +51 -0
  198. haywire_core-0.0.2/src/haywire/ui/prefs/edge_ui.py +91 -0
  199. haywire_core-0.0.2/src/haywire/ui/prefs/editor.py +161 -0
  200. haywire_core-0.0.2/src/haywire/ui/skin/base.py +126 -0
  201. haywire_core-0.0.2/src/haywire/ui/skin/decorator.py +88 -0
  202. haywire_core-0.0.2/src/haywire/ui/skin/factory.py +344 -0
  203. haywire_core-0.0.2/src/haywire/ui/skin/interface.py +12 -0
  204. haywire_core-0.0.2/src/haywire/ui/skin/nodecard.py +51 -0
  205. haywire_core-0.0.2/src/haywire/ui/skin/registry.py +229 -0
  206. haywire_core-0.0.2/src/haywire/ui/skin/settings.py +50 -0
  207. haywire_core-0.0.2/src/haywire/ui/themes/__init__.py +23 -0
  208. haywire_core-0.0.2/src/haywire/ui/themes/decorator.py +87 -0
  209. haywire_core-0.0.2/src/haywire/ui/themes/icon-preview.html +299 -0
  210. haywire_core-0.0.2/src/haywire/ui/themes/icons.py +90 -0
  211. haywire_core-0.0.2/src/haywire/ui/themes/identity.py +10 -0
  212. haywire_core-0.0.2/src/haywire/ui/themes/node_theme.py +38 -0
  213. haywire_core-0.0.2/src/haywire/ui/themes/registry.py +127 -0
  214. haywire_core-0.0.2/src/haywire/ui/themes/workbench.py +149 -0
  215. haywire_core-0.0.2/src/haywire/ui/utils.py +185 -0
  216. haywire_core-0.0.2/src/haywire/ui/widget/base.py +208 -0
  217. haywire_core-0.0.2/src/haywire/ui/widget/binding.py +321 -0
  218. haywire_core-0.0.2/src/haywire/ui/widget/converters.py +327 -0
  219. haywire_core-0.0.2/src/haywire/ui/widget/decorator.py +95 -0
  220. haywire_core-0.0.2/src/haywire/ui/widget/factory.py +182 -0
  221. haywire_core-0.0.2/src/haywire/ui/widget/factory_interface.py +28 -0
  222. haywire_core-0.0.2/src/haywire/ui/widget/globals.py +108 -0
  223. haywire_core-0.0.2/src/haywire/ui/widget/identity.py +13 -0
  224. haywire_core-0.0.2/src/haywire/ui/widget/interface.py +85 -0
  225. haywire_core-0.0.2/src/haywire/ui/widget/registry.py +96 -0
  226. haywire_core-0.0.2/src/haywire/ui/widget/simple.py +178 -0
@@ -0,0 +1,205 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ **/.env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ .idea/
169
+
170
+ # Abstra
171
+ # Abstra is an AI-powered process automation framework.
172
+ # Ignore directories containing user credentials, local state, and settings.
173
+ # Learn more at https://abstra.io/docs
174
+ .abstra/
175
+
176
+ # Visual Studio Code
177
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
178
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
179
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
180
+ # you could uncomment the following to ignore the enitre vscode folder
181
+ .vscode/
182
+
183
+ # Ruff stuff:
184
+ .ruff_cache/
185
+
186
+ # PyPI configuration file
187
+ .pypirc
188
+
189
+ # Cursor
190
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
191
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
192
+ # refer to https://docs.cursor.com/context/ignore-files
193
+ .cursorignore
194
+ .cursorindexingignore
195
+
196
+ .DS_Store
197
+ saves/*.*
198
+
199
+ # Dev-mode graphs (local testing only, not part of the repo)
200
+ graphs/*.json
201
+ # MkDocs build output
202
+ site/
203
+
204
+ # Local git worktrees (claude-code workflow)
205
+ .worktrees/
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: haywire-core
3
+ Version: 0.0.2
4
+ Summary: Haywire Node System Framework
5
+ Author: Haywire Team
6
+ License: MIT
7
+ Keywords: framework,haywire,node-editor,visual-programming
8
+ Requires-Python: >=3.10
9
+ Requires-Dist: attrs==25.4.0
10
+ Requires-Dist: cattrs==25.3.0
11
+ Requires-Dist: duit[nicegui]
12
+ Requires-Dist: ffmpegio~=0.11.1
13
+ Requires-Dist: injector>=0.22.0
14
+ Requires-Dist: nicegui
15
+ Requires-Dist: numpy
16
+ Requires-Dist: opencv-python
17
+ Requires-Dist: toml>=0.10.2
18
+ Requires-Dist: watchdog>=6.0.0
@@ -0,0 +1,35 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "haywire-core"
7
+ version = "0.0.2"
8
+ description = "Haywire Node System Framework"
9
+ requires-python = ">=3.10"
10
+ license = {text = "MIT"}
11
+ authors = [
12
+ {name = "Haywire Team"}
13
+ ]
14
+ keywords = ["haywire", "node-editor", "visual-programming", "framework"]
15
+
16
+ dependencies = [
17
+ "nicegui",
18
+ "ffmpegio~=0.11.1",
19
+ "numpy",
20
+ "opencv-python",
21
+ "watchdog>=6.0.0",
22
+ "injector>=0.22.0",
23
+ "attrs==25.4.0",
24
+ "cattrs==25.3.0",
25
+ "toml>=0.10.2",
26
+ "duit[nicegui]",
27
+ ]
28
+
29
+ [tool.hatch.build.targets.wheel]
30
+ packages = ["src/haywire"]
31
+
32
+ [tool.hatch.build.targets.sdist]
33
+ include = [
34
+ "src/haywire/",
35
+ ]
File without changes
File without changes
@@ -0,0 +1,307 @@
1
+ """
2
+ Base adapter classes for type conversion
3
+ """
4
+
5
+ from abc import ABC, abstractmethod
6
+ from typing import TYPE_CHECKING, Any, Callable, ClassVar, List, Optional, Type, TypeVar
7
+ from dataclasses import dataclass
8
+
9
+ from haywire.core.library.identity import LibraryIdentity
10
+ from haywire.core.registry.identity import BaseIdentity
11
+ from haywire.core.library.utils import ADAPTER, derive_library_identity, reg_key
12
+
13
+ if TYPE_CHECKING:
14
+ from haywire.core.types.interface import IType
15
+
16
+ # ============================================================================
17
+ # Decorator
18
+ # ============================================================================
19
+
20
+ T = TypeVar("T")
21
+
22
+
23
+ def adapter(**kwargs: Any) -> Callable[[Type[T]], Type[T]]:
24
+ """
25
+ Decorator to register a class as a type adapter.
26
+
27
+ Always invoked with parentheses — `@adapter(...)`. The bare `@adapter`
28
+ form (no parens) is not supported; `converts_from` and `converts_to`
29
+ are required.
30
+
31
+ Accepts any AdapterIdentity field as a keyword argument.
32
+
33
+ Args:
34
+ label (str, optional): Human-readable display name.
35
+ Defaults to class name if not provided.
36
+ description (str, optional): Human-readable description.
37
+ Defaults to empty string.
38
+ converts_from (type[IType], required): Source IType class.
39
+ converts_to (type[IType], required): Target IType class.
40
+ priority (int, optional): Priority (higher = preferred).
41
+ Defaults to 0.
42
+ deprecation_warning (str, optional): Deprecation warning message.
43
+ Defaults to empty string.
44
+ registry_id (str, optional): Unique identifier for the adapter.
45
+ Defaults to class name if not provided.
46
+
47
+ Any other keyword arguments will be passed through to AdapterIdentity.
48
+ See the AdapterIdentity dataclass for complete list of fields.
49
+
50
+ Usage:
51
+ # Common customization
52
+ @adapter(
53
+ description="Temperature to float conversion",
54
+ converts_from=Temperature,
55
+ converts_to=FLOAT,
56
+ )
57
+ class MyAdapter(BaseAdapter): ...
58
+
59
+ # Full customization with IType classes
60
+ @adapter(
61
+ description="Convert Temperature (Celsius) to FLOAT",
62
+ converts_from=Temperature,
63
+ converts_to=FLOAT,
64
+ priority=5
65
+ )
66
+ class TempToFloatAdapter(BaseAdapter): ...
67
+
68
+ # Multi-hop chain example
69
+ @adapter(
70
+ converts_from=Temperature,
71
+ converts_to=Kelvin,
72
+ priority=10,
73
+ description="Celsius to Kelvin"
74
+ )
75
+ class TempToKelvinAdapter(BaseAdapter): ...
76
+ """
77
+
78
+ def decorator(inner_cls: Type[T]) -> Type[T]:
79
+ if not issubclass(inner_cls, BaseAdapter):
80
+ raise TypeError(f"@adapter can only be applied to BaseAdapter subclasses, got {inner_cls}")
81
+
82
+ # Set defaults from class name if not provided
83
+ kwargs.setdefault("registry_id", inner_cls.__name__)
84
+ kwargs.setdefault("label", inner_cls.__name__)
85
+
86
+ # Get library identity (survives hot-reload)
87
+ library_identity = derive_library_identity(inner_cls)
88
+
89
+ # Auto-derive registry_key
90
+ kwargs["registry_key"] = reg_key(library_identity.id, ADAPTER, kwargs["registry_id"])
91
+
92
+ # Set source info from the class itself
93
+ kwargs["class_name"] = inner_cls.__name__
94
+ kwargs["module"] = inner_cls.__module__
95
+
96
+ # Create and attach identity and library
97
+ inner_cls.class_identity = AdapterIdentity(**kwargs)
98
+ inner_cls.class_library = library_identity
99
+ return inner_cls
100
+
101
+ return decorator
102
+
103
+
104
+ @dataclass(kw_only=True)
105
+ class AdapterIdentity(BaseIdentity):
106
+ """
107
+ Core identifying attributes of an adapter.
108
+
109
+ IType-based: converts_from and converts_to are IType classes.
110
+ """
111
+
112
+ converts_from: type["IType"] # Source IType (FLOAT, Temperature, etc.)
113
+ converts_to: type["IType"] # Target IType (INT, MeshData, etc.)
114
+ priority: int = 0 # Priority (higher = preferred)
115
+
116
+
117
+ # ============================================================================
118
+ # Adapter Interface
119
+ # ============================================================================
120
+
121
+
122
+ class IAdapter(ABC):
123
+ """
124
+ Interface for all adapters.
125
+
126
+ All adapters must implement:
127
+ - convert(): Transform a value
128
+ - execute(): Execute this adapter, then chain to next
129
+ - get_registry_keys(): Get all registry keys in chain
130
+ """
131
+
132
+ # IDENTITY ATTRIBUTES (set by @type decorator)
133
+ class_identity: ClassVar[AdapterIdentity]
134
+ class_library: ClassVar[LibraryIdentity]
135
+
136
+ @abstractmethod
137
+ def convert(self, value: Any) -> Any:
138
+ """
139
+ Method to convert value.
140
+ This method ONLY performs conversion.
141
+ Use execute() to run the full adapter chain.
142
+ Args:
143
+ value: Input value to convert
144
+ Returns:
145
+ Converted value by this adapter only
146
+ """
147
+ pass
148
+
149
+ @abstractmethod
150
+ def execute(self, value: Any) -> Any:
151
+ """
152
+ Main method to execute adapter-chain
153
+ Args:
154
+ value: Input value to convert
155
+ Returns:
156
+ Converted value after executing entire chain
157
+ """
158
+ pass
159
+
160
+ @abstractmethod
161
+ def _get_registry_keys(self) -> List[str]:
162
+ """Get all registry keys in chain"""
163
+ pass
164
+
165
+ @abstractmethod
166
+ def get_test_value(self) -> Any:
167
+ """
168
+ method returns a sample value of the type this adapter
169
+ is converting from for testing this adapter
170
+
171
+ Returns: sample value of the expected input type
172
+ """
173
+ return True
174
+
175
+ def get_test_repetitions(self) -> int:
176
+ """method returns the number of repetitions the test needs to run"""
177
+ return 1
178
+
179
+ @abstractmethod
180
+ def test(self, value: Any) -> Any:
181
+ """
182
+ Tests this adapter with sample data
183
+
184
+ Args:
185
+ value: Sample input value of the type this adapter expects
186
+ """
187
+ return True
188
+
189
+
190
+ # ============================================================================
191
+ # Base Adapter Class
192
+ # ============================================================================
193
+
194
+
195
+ class ReturnAdapter(IAdapter):
196
+ """
197
+ Terminal adapter that returns values unchanged.
198
+
199
+ Used as the default terminal adapter in chains.
200
+ Does not have a registry key (not registered).
201
+ """
202
+
203
+ def convert(self, value: Any) -> Any:
204
+ """Pass through unchanged"""
205
+ return value
206
+
207
+ def execute(self, value: Any) -> Any:
208
+ """Terminal - just return value"""
209
+ return value
210
+
211
+ def get_test_value(self) -> Any:
212
+ """Terminal - always succeeds"""
213
+ return True
214
+
215
+ def test(self, value: int) -> Any:
216
+ return self.execute(value)
217
+
218
+ def _get_registry_keys(self) -> List[str]:
219
+ """Terminal - no registry keys"""
220
+ return []
221
+
222
+
223
+ class BaseAdapter(IAdapter):
224
+ """
225
+ Base class for type adapters.
226
+
227
+ Key design:
228
+ - Type-level operations use IType classes (for registration, matching)
229
+ - Value-level operations use unwrapped primitives/instances (for conversion)
230
+ - Chaining via _chain attribute for recursive execution
231
+
232
+ This creates clean separation between type system and runtime values.
233
+
234
+ Example:
235
+ # Register with type classes
236
+ registry.register_adapter(
237
+ source=Temperature, # IType class
238
+ target=FLOAT, # IType class
239
+ adapter=TemperatureToFloatAdapter
240
+ )
241
+
242
+ # Convert with unwrapped values
243
+ adapter = TemperatureToFloatAdapter()
244
+ result = adapter.convert(25.0) # float -> float (not FLOAT -> FLOAT)
245
+ """
246
+
247
+ def __init__(self, child: Optional[IAdapter] = None):
248
+ """Initialize adapter with child in chain"""
249
+ self._chain: IAdapter = child if child is not None else ReturnAdapter()
250
+
251
+ @abstractmethod
252
+ def convert(self, value: Any) -> Any:
253
+ """
254
+ Value-level conversion: Convert UNWRAPPED value.
255
+ DO NOT USE THIS METHOD FOR CONVERSION. USE execute() INSTEAD.
256
+
257
+ This is where actual data transformation happens.
258
+ Operates on unwrapped primitives or instances, not IType wrappers.
259
+
260
+ Args:
261
+ value: Unwrapped value from source field
262
+ - For primitives: 25.0 (not FLOAT(25.0))
263
+ - For complex: MeshData(...) instance
264
+
265
+ Returns:
266
+ Unwrapped value for target field
267
+ - For primitives: 77.0 (not FLOAT(77.0))
268
+ - For complex: PointCloud(...) instance
269
+ """
270
+ pass
271
+
272
+ def execute(self, value: Any) -> Any:
273
+ """
274
+ Execute this adapter, then delegate to chain.
275
+
276
+ Args:
277
+ value: Input value (unwrapped)
278
+
279
+ Returns:
280
+ Transformed value after executing entire chain
281
+ """
282
+ converted = self.convert(value)
283
+ return self._chain.execute(converted)
284
+
285
+ def test(self, value: int) -> Any:
286
+ return self.execute(value)
287
+
288
+ def _get_registry_keys(self) -> List[str]:
289
+ """
290
+ Get all registry keys for this adapter and any nested adapters.
291
+
292
+ Base implementation returns this adapter's key plus chained keys.
293
+ Compound adapters (ArrayArrayAdapter, StructuralAdapter) should
294
+ override to include nested adapter keys.
295
+
296
+ Returns:
297
+ List of registry keys for hot-reload dependency tracking
298
+ """
299
+ keys = [self.class_identity.registry_key]
300
+ keys.extend(self._chain._get_registry_keys())
301
+ return keys
302
+
303
+
304
+ class ConversionError(Exception):
305
+ """Raised when a type conversion fails"""
306
+
307
+ pass