flowgraph 0.1.8__tar.gz → 0.1.10__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 (146) hide show
  1. {flowgraph-0.1.8/src/flowgraph.egg-info → flowgraph-0.1.10}/PKG-INFO +65 -4
  2. {flowgraph-0.1.8 → flowgraph-0.1.10}/README.md +60 -2
  3. {flowgraph-0.1.8 → flowgraph-0.1.10}/pyproject.toml +5 -3
  4. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/__init__.py +8 -1
  5. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/data_types.py +1 -0
  6. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/field_ops.py +1 -0
  7. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/file_conversion.py +34 -23
  8. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/files.py +111 -12
  9. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/filters.py +1 -12
  10. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/image_tools.py +44 -1
  11. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/imagej.py +87 -6
  12. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/mesh_analysis.py +32 -8
  13. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/mesh_creation_tools.py +2 -2
  14. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/mesh_ops.py +2 -2
  15. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/readers.py +109 -24
  16. flowgraph-0.1.10/src/flowgraph/adapters/sinks.py +208 -0
  17. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/user_code.py +77 -2
  18. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/vector_tools.py +4 -3
  19. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/workflow.py +2 -0
  20. flowgraph-0.1.10/src/flowgraph/application/node_registry.py +28 -0
  21. flowgraph-0.1.10/src/flowgraph/application/plugins.py +60 -0
  22. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/application/port_conversions.py +6 -0
  23. flowgraph-0.1.10/src/flowgraph/application/wasm_packages.py +245 -0
  24. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/application/workflow_cli.py +68 -13
  25. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/application/workflow_core.py +147 -95
  26. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/application/workflow_defaults.py +11 -0
  27. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/application/workflow_execution.py +99 -8
  28. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/application/workflow_io.py +6 -3
  29. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/application/workflow_session.py +36 -5
  30. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/core_cli.py +64 -4
  31. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/paraview_gateway.py +26 -0
  32. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/server/http.py +162 -11
  33. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/server/jobs.py +153 -26
  34. flowgraph-0.1.10/src/flowgraph/server/packages.py +233 -0
  35. flowgraph-0.1.10/src/flowgraph/server/worker.py +81 -0
  36. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/server/workspace.py +16 -1
  37. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/testdata/AllFilters.json +3 -3
  38. flowgraph-0.1.10/src/flowgraph/testdata/ImageJBlur.json +249 -0
  39. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/testdata/SimpleReadMesh.json +3 -3
  40. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/version.py +1 -1
  41. {flowgraph-0.1.8 → flowgraph-0.1.10/src/flowgraph.egg-info}/PKG-INFO +65 -4
  42. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph.egg-info/SOURCES.txt +10 -0
  43. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph.egg-info/requires.txt +5 -1
  44. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_extract_vector_value.py +15 -9
  45. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_file_conversion.py +133 -13
  46. flowgraph-0.1.10/tests/test_image_roi.py +95 -0
  47. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_image_tools.py +96 -0
  48. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_imagej.py +217 -1
  49. flowgraph-0.1.10/tests/test_local_server.py +1066 -0
  50. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_mesh_analysis.py +107 -7
  51. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_mesh_ops.py +9 -5
  52. flowgraph-0.1.10/tests/test_native_packages.py +180 -0
  53. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_node_selector.py +2 -60
  54. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_packaging.py +51 -5
  55. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_paraview.py +54 -0
  56. flowgraph-0.1.10/tests/test_plugins.py +279 -0
  57. flowgraph-0.1.10/tests/test_readers.py +388 -0
  58. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_release.py +91 -0
  59. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_sinks.py +8 -2
  60. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_transfer_fields.py +23 -2
  61. flowgraph-0.1.10/tests/test_user_function_parameters.py +127 -0
  62. flowgraph-0.1.10/tests/test_wasm_packages.py +148 -0
  63. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_workflow_cli.py +120 -0
  64. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_workflow_execution.py +182 -2
  65. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_workflow_io.py +43 -1
  66. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_workflow_web_catalog.py +65 -2
  67. flowgraph-0.1.10/tests/test_workspace_file.py +473 -0
  68. flowgraph-0.1.8/src/flowgraph/adapters/sinks.py +0 -111
  69. flowgraph-0.1.8/src/flowgraph/application/node_registry.py +0 -14
  70. flowgraph-0.1.8/src/flowgraph/server/worker.py +0 -36
  71. flowgraph-0.1.8/tests/test_local_server.py +0 -536
  72. flowgraph-0.1.8/tests/test_readers.py +0 -185
  73. {flowgraph-0.1.8 → flowgraph-0.1.10}/LICENSE +0 -0
  74. {flowgraph-0.1.8 → flowgraph-0.1.10}/setup.cfg +0 -0
  75. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/__init__.py +0 -0
  76. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/__main__.py +0 -0
  77. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/calculator.py +0 -0
  78. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/controls.py +0 -0
  79. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/cosapp.py +0 -0
  80. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/documentation.py +0 -0
  81. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/field_gradient.py +0 -0
  82. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/mesh_composition.py +0 -0
  83. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/mesh_generations.py +0 -0
  84. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/paraview.py +0 -0
  85. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/plaid_bridge.py +0 -0
  86. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/remote_files.py +0 -0
  87. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/simple_sources.py +0 -0
  88. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/table_tools.py +0 -0
  89. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/workflow_interfaces.py +0 -0
  90. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/writers.py +0 -0
  91. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/adapters/zones.py +0 -0
  92. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/application/__init__.py +0 -0
  93. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/application/file_dependencies.py +0 -0
  94. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/application/workflow_history.py +0 -0
  95. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/application/workflow_layout.py +0 -0
  96. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/application/workflow_web_catalog.py +0 -0
  97. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/application/workflows.py +0 -0
  98. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/domain/__init__.py +0 -0
  99. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/domain/filepath.py +0 -0
  100. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/domain/mesh_document.py +0 -0
  101. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/examples/AllFilters.py +0 -0
  102. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/examples/convert_format.py +0 -0
  103. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/resources.py +0 -0
  104. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/server/__init__.py +0 -0
  105. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/testdata/ColorCardboard.jpg +0 -0
  106. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/testdata/FlowGraph.h5 +0 -0
  107. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/testdata/FlowGraph.stl +0 -0
  108. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/testdata/FlowGraph.xdmf +0 -0
  109. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/testdata/SpherePoints.csv +0 -0
  110. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph/testdata/muscat-muscat-mesh-conversion.json +0 -0
  111. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph.egg-info/dependency_links.txt +0 -0
  112. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph.egg-info/entry_points.txt +0 -0
  113. {flowgraph-0.1.8 → flowgraph-0.1.10}/src/flowgraph.egg-info/top_level.txt +0 -0
  114. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_array_nodes.py +0 -0
  115. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_array_types.py +0 -0
  116. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_audit_requirements.py +0 -0
  117. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_cache_policy.py +0 -0
  118. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_calculator.py +0 -0
  119. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_conditional_workflow.py +0 -0
  120. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_controls.py +0 -0
  121. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_core_gui_boundary.py +0 -0
  122. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_cosapp.py +0 -0
  123. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_directory_dependencies.py +0 -0
  124. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_extract_field.py +0 -0
  125. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_field_gradient.py +0 -0
  126. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_filepath.py +0 -0
  127. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_fluency_optimization.py +0 -0
  128. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_headless_boundary.py +0 -0
  129. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_mesh_composition.py +0 -0
  130. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_mesh_creation_tools.py +0 -0
  131. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_muscat_vtk.py +0 -0
  132. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_plaid_bridge.py +0 -0
  133. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_remote_files.py +0 -0
  134. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_remove_lonely_nodes.py +0 -0
  135. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_scalars_to_array_1d.py +0 -0
  136. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_simple_sources.py +0 -0
  137. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_table_tools.py +0 -0
  138. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_user_code_mesh.py +0 -0
  139. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_vector_field_gradient.py +0 -0
  140. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_vector_tools.py +0 -0
  141. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_workflow_core.py +0 -0
  142. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_workflow_history.py +0 -0
  143. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_workflow_session.py +0 -0
  144. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_workspace_directories.py +0 -0
  145. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_writers.py +0 -0
  146. {flowgraph-0.1.8 → flowgraph-0.1.10}/tests/test_zones.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flowgraph
3
- Version: 0.1.8
3
+ Version: 0.1.10
4
4
  Summary: Headless typed workflow engine and execution runtime
5
5
  Author: Felipe Bordeu
6
6
  Maintainer: Felipe Bordeu
@@ -24,8 +24,11 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
24
  Requires-Python: >=3.11
25
25
  Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
+ Requires-Dist: packaging>=24
27
28
  Requires-Dist: vtk>=9.2
28
- Requires-Dist: muscat>=2.5.2
29
+ Requires-Dist: muscat>=2.6.0
30
+ Provides-Extra: server
31
+ Requires-Dist: uv>=0.6; extra == "server"
29
32
  Provides-Extra: io
30
33
  Requires-Dist: meshio>=5.3; extra == "io"
31
34
  Requires-Dist: meshlane>=5.5.0; extra == "io"
@@ -91,10 +94,27 @@ uv run flowgraph run workflow.json --input name=value
91
94
  uv run flowgraph run workflow.json -i name=value
92
95
  uv run flowgraph run workflow.json --override node-id.parameter=value
93
96
  uv run flowgraph run workflow.json --json-output results.json
97
+ uv run flowgraph run workflow.json --verbose
98
+ uv run flowgraph run workflow.json --plugin /path/custom_nodes.py
99
+ uv run flowgraph inspect workflow.json --plugin /path/custom_nodes.py --full
94
100
  ```
95
101
 
102
+ Use repeatable `--plugin FILE.py` to load trusted custom definitions exported as
103
+ `AVAILABLE_NODES`. The same option on `flowgraph serve` adds nodes to its catalog
104
+ and execution workers. Imports execute Python code, including during inspection;
105
+ only load trusted files. See the [plugin guide](doc/user-guide/custom-nodes.md#load-python-file-plugins-from-the-cli-or-server)
106
+ for the file format, path rules, dependencies and restart requirements.
107
+
96
108
  Use `--input` or its short form `-i` for each published workflow input; repeat
97
109
  the option to provide multiple inputs.
110
+
111
+ Add `--verbose` (or `-v`) to `run` for execution states and live, bounded node
112
+ output-port summaries on stderr, matching `serve` diagnostics. Node stdout/stderr
113
+ remain visible and Python console output is line-buffered in verbose mode.
114
+ Summaries use runtime values without making copies or generating previews.
115
+ Verbose logs may contain sensitive workflow data; keep them private.
116
+ Final outputs and `--json-output` retain their normal behavior.
117
+
98
118
  `flowgraph inspect` displays the resolved default to the right of each published
99
119
  input, or marks it as required or having conflicting saved values.
100
120
  Inspection is compact by default; add `--full` (or `-f`) to include the workflow
@@ -141,12 +161,49 @@ together; the workflow file and execution response formats are unchanged.
141
161
 
142
162
  ## Experimental local server
143
163
 
144
- The prototype branch includes an authenticated, loopback-only execution API:
164
+ ### Optional workspace packages
165
+
166
+ Install the `server` extra (`uv sync --extra server`, or install `flowgraph[server]`)
167
+ and pass `--allow-package-install` to `flowgraph serve` to enable the web editor's
168
+ confirmed wheel-only installation API. It is disabled by default. Compatible
169
+ prebuilt Python/native wheels are installed with uv into
170
+ `<workspace>/.flowgraph-packages/<python-and-platform-id>/site-packages`, not the
171
+ base environment. Extras persist across server restarts. Stop the backend and
172
+ delete `.flowgraph-packages` to remove them. Read-only workspace destinations,
173
+ source builds, conflicting distributions and base-module shadowing are rejected.
174
+ Installation requires idle execution and restarts session workers, clearing caches.
175
+ The managed directory is excluded from the file API. Only install trusted code;
176
+ this is not a sandbox or a multi-user package service.
177
+
178
+ The prototype branch includes an authenticated execution API (loopback by default):
179
+
180
+ For LAN or internet browser clients, put an HTTPS reverse proxy in front of the
181
+ API and pass `--public-url https://python.example.com` to `flowgraph serve`.
182
+ The proxy must preserve the public Host header, Authorization, Origin, and CORS
183
+ preflight headers. Leave Python on `127.0.0.1:8765` when the proxy runs on the
184
+ same machine. An explicit IPv4 `--host` (including `0.0.0.0`) is supported but
185
+ non-loopback binding requires `--public-url`; restrict the HTTP port to a trusted
186
+ proxy network. This option advertises HTTPS; it does not enable TLS in Python.
187
+ Certificates must be trusted by browser clients, including for private LAN IPs.
188
+ Use `--allow-origin` to allow your exact editor origin (the hosted editor is the
189
+ default). The launch link includes the remote backend address in its fragment.
190
+ This is a trusted single-user service, not a sandbox or a public multi-user API;
191
+ use an unprivileged account, firewall/VPN restrictions, and proxy request limits.
145
192
 
146
193
  ```bash
147
194
  uv run flowgraph serve --workspace /absolute/path/to/existing/workspace
148
195
  ```
149
196
 
197
+ Add `--verbose` (or `-v`) for server lifecycle, configuration, sanitized HTTP
198
+ activity, execution state changes, and bounded node output-port summaries on
199
+ stderr. Worker stdout/stderr (prints and logs) also appear in the console.
200
+ Verbose logs may contain sensitive workflow data; keep them private.
201
+ For an isolated tool launch:
202
+
203
+ ```bash
204
+ uvx --with imagej flowgraph serve --workspace . --verbose
205
+ ```
206
+
150
207
  Port 8765 and the allowed editor origin `https://flowgraph-web.fbw-es.com` are
151
208
  defaults; explicit `--allow-origin` values replace that origin. The editor still
152
209
  requires bearer authentication and browser local-network permission. Click the
@@ -154,7 +211,11 @@ printed **Open editor** link to pass the token and port automatically; keep the
154
211
  link private.
155
212
 
156
213
  It runs one workflow at a time in a cancellable native subprocess and provides
157
- runtime metadata, catalog, and workspace file endpoints. Core is API-only and never
214
+ runtime metadata, catalog, and workspace file endpoints. Execution timeouts are
215
+ advisory: the worker remains alive until completion or explicit cancellation,
216
+ and the HTTP server is not stopped. GUI clients can supply a per-job timeout;
217
+ `--execution-timeout` sets the default warning threshold (120 seconds).
218
+ Core is API-only and never
158
219
  serves editor assets. Web and desktop clients own their GUI hosting and explicitly
159
220
  allow their origin with `--allow-origin`. Native workflow code is **not sandboxed**.
160
221
  See [Local server API and limitations](docs/local-server.md) for authentication,
@@ -39,10 +39,27 @@ uv run flowgraph run workflow.json --input name=value
39
39
  uv run flowgraph run workflow.json -i name=value
40
40
  uv run flowgraph run workflow.json --override node-id.parameter=value
41
41
  uv run flowgraph run workflow.json --json-output results.json
42
+ uv run flowgraph run workflow.json --verbose
43
+ uv run flowgraph run workflow.json --plugin /path/custom_nodes.py
44
+ uv run flowgraph inspect workflow.json --plugin /path/custom_nodes.py --full
42
45
  ```
43
46
 
47
+ Use repeatable `--plugin FILE.py` to load trusted custom definitions exported as
48
+ `AVAILABLE_NODES`. The same option on `flowgraph serve` adds nodes to its catalog
49
+ and execution workers. Imports execute Python code, including during inspection;
50
+ only load trusted files. See the [plugin guide](doc/user-guide/custom-nodes.md#load-python-file-plugins-from-the-cli-or-server)
51
+ for the file format, path rules, dependencies and restart requirements.
52
+
44
53
  Use `--input` or its short form `-i` for each published workflow input; repeat
45
54
  the option to provide multiple inputs.
55
+
56
+ Add `--verbose` (or `-v`) to `run` for execution states and live, bounded node
57
+ output-port summaries on stderr, matching `serve` diagnostics. Node stdout/stderr
58
+ remain visible and Python console output is line-buffered in verbose mode.
59
+ Summaries use runtime values without making copies or generating previews.
60
+ Verbose logs may contain sensitive workflow data; keep them private.
61
+ Final outputs and `--json-output` retain their normal behavior.
62
+
46
63
  `flowgraph inspect` displays the resolved default to the right of each published
47
64
  input, or marks it as required or having conflicting saved values.
48
65
  Inspection is compact by default; add `--full` (or `-f`) to include the workflow
@@ -89,12 +106,49 @@ together; the workflow file and execution response formats are unchanged.
89
106
 
90
107
  ## Experimental local server
91
108
 
92
- The prototype branch includes an authenticated, loopback-only execution API:
109
+ ### Optional workspace packages
110
+
111
+ Install the `server` extra (`uv sync --extra server`, or install `flowgraph[server]`)
112
+ and pass `--allow-package-install` to `flowgraph serve` to enable the web editor's
113
+ confirmed wheel-only installation API. It is disabled by default. Compatible
114
+ prebuilt Python/native wheels are installed with uv into
115
+ `<workspace>/.flowgraph-packages/<python-and-platform-id>/site-packages`, not the
116
+ base environment. Extras persist across server restarts. Stop the backend and
117
+ delete `.flowgraph-packages` to remove them. Read-only workspace destinations,
118
+ source builds, conflicting distributions and base-module shadowing are rejected.
119
+ Installation requires idle execution and restarts session workers, clearing caches.
120
+ The managed directory is excluded from the file API. Only install trusted code;
121
+ this is not a sandbox or a multi-user package service.
122
+
123
+ The prototype branch includes an authenticated execution API (loopback by default):
124
+
125
+ For LAN or internet browser clients, put an HTTPS reverse proxy in front of the
126
+ API and pass `--public-url https://python.example.com` to `flowgraph serve`.
127
+ The proxy must preserve the public Host header, Authorization, Origin, and CORS
128
+ preflight headers. Leave Python on `127.0.0.1:8765` when the proxy runs on the
129
+ same machine. An explicit IPv4 `--host` (including `0.0.0.0`) is supported but
130
+ non-loopback binding requires `--public-url`; restrict the HTTP port to a trusted
131
+ proxy network. This option advertises HTTPS; it does not enable TLS in Python.
132
+ Certificates must be trusted by browser clients, including for private LAN IPs.
133
+ Use `--allow-origin` to allow your exact editor origin (the hosted editor is the
134
+ default). The launch link includes the remote backend address in its fragment.
135
+ This is a trusted single-user service, not a sandbox or a public multi-user API;
136
+ use an unprivileged account, firewall/VPN restrictions, and proxy request limits.
93
137
 
94
138
  ```bash
95
139
  uv run flowgraph serve --workspace /absolute/path/to/existing/workspace
96
140
  ```
97
141
 
142
+ Add `--verbose` (or `-v`) for server lifecycle, configuration, sanitized HTTP
143
+ activity, execution state changes, and bounded node output-port summaries on
144
+ stderr. Worker stdout/stderr (prints and logs) also appear in the console.
145
+ Verbose logs may contain sensitive workflow data; keep them private.
146
+ For an isolated tool launch:
147
+
148
+ ```bash
149
+ uvx --with imagej flowgraph serve --workspace . --verbose
150
+ ```
151
+
98
152
  Port 8765 and the allowed editor origin `https://flowgraph-web.fbw-es.com` are
99
153
  defaults; explicit `--allow-origin` values replace that origin. The editor still
100
154
  requires bearer authentication and browser local-network permission. Click the
@@ -102,7 +156,11 @@ printed **Open editor** link to pass the token and port automatically; keep the
102
156
  link private.
103
157
 
104
158
  It runs one workflow at a time in a cancellable native subprocess and provides
105
- runtime metadata, catalog, and workspace file endpoints. Core is API-only and never
159
+ runtime metadata, catalog, and workspace file endpoints. Execution timeouts are
160
+ advisory: the worker remains alive until completion or explicit cancellation,
161
+ and the HTTP server is not stopped. GUI clients can supply a per-job timeout;
162
+ `--execution-timeout` sets the default warning threshold (120 seconds).
163
+ Core is API-only and never
106
164
  serves editor assets. Web and desktop clients own their GUI hosting and explicitly
107
165
  allow their origin with `--allow-origin`. Native workflow code is **not sandboxed**.
108
166
  See [Local server API and limitations](docs/local-server.md) for authentication,
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "flowgraph"
7
- version = "0.1.8"
7
+ version = "0.1.10"
8
8
  description = "Headless typed workflow engine and execution runtime"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -27,11 +27,13 @@ classifiers = [
27
27
  "Topic :: Software Development :: Libraries :: Python Modules",
28
28
  ]
29
29
  dependencies = [
30
+ "packaging>=24",
30
31
  "vtk>=9.2",
31
- "muscat>=2.5.2",
32
+ "muscat>=2.6.0",
32
33
  ]
33
34
 
34
35
  [project.optional-dependencies]
36
+ server = ["uv>=0.6"]
35
37
  io = [
36
38
  "meshio>=5.3",
37
39
  "meshlane>=5.5.0",
@@ -87,4 +89,4 @@ pythonpath = [".", "src"]
87
89
 
88
90
  [tool.ruff]
89
91
  target-version = "py311"
90
- line-length = 100
92
+ line-length = 100
@@ -12,6 +12,7 @@ from flowgraph.adapters.files import (
12
12
  READ_DIRECTORY_FILES,
13
13
  SELECT_FILE,
14
14
  SELECT_SERVER_FILE,
15
+ WORKSPACE,
15
16
  )
16
17
  from flowgraph.adapters.filters import (
17
18
  CREATE_MUSCAT_ELEMENT_FILTER,
@@ -117,7 +118,13 @@ ADAPTERS = AdapterCatalog(
117
118
  ),
118
119
  AdapterGroup(
119
120
  "Files",
120
- (SELECT_FILE, SELECT_SERVER_FILE, DOWNLOAD_URL, READ_DIRECTORY_FILES),
121
+ (
122
+ SELECT_FILE,
123
+ SELECT_SERVER_FILE,
124
+ WORKSPACE,
125
+ DOWNLOAD_URL,
126
+ READ_DIRECTORY_FILES,
127
+ ),
121
128
  ),
122
129
  ),
123
130
  ),
@@ -70,6 +70,7 @@ class ParameterKind:
70
70
  LIST_INT = LIST_INT
71
71
  LIST_FLOAT = LIST_FLOAT
72
72
  FILE = FILE
73
+ DIRECTORY = DIRECTORY
73
74
  VEC3D = VEC3D
74
75
  VEC2D = VEC2D
75
76
  VEC3DSTR = VEC3DSTR
@@ -109,6 +109,7 @@ TRANSFER_FIELDS_NODE = NodeDefinition(
109
109
  "Interpolation",
110
110
  "Interp/Clamp",
111
111
  options=(
112
+ ParameterOption("Nearest/Nearest", "Nearest point"),
112
113
  ParameterOption("Interp/Clamp", "Interpolation / Clamp"),
113
114
  ParameterOption("Interp/Nearest", "Interpolation / Nearest"),
114
115
  ParameterOption("Interp/Extrap", "Interpolation / Extrapolation"),
@@ -12,6 +12,7 @@ from flowgraph.application.workflow_core import (
12
12
  PortDefinition,
13
13
  PortDirection,
14
14
  )
15
+ from flowgraph.domain.filepath import FilePath
15
16
 
16
17
  from .data_types import FILE, ParameterKind
17
18
 
@@ -20,6 +21,23 @@ class MeshFileConversionError(RuntimeError):
20
21
  """Raised when a mesh file conversion cannot be completed."""
21
22
 
22
23
 
24
+ TIMESTEP_OPTIONS = (
25
+ ParameterOption("first", "First time step"),
26
+ ParameterOption("last", "Last time step"),
27
+ ParameterOption("all", "All time steps"),
28
+ )
29
+
30
+
31
+ def get_available_mesh_times(reader: Any) -> Any:
32
+ """Load temporal metadata only when supported, without copying the times."""
33
+ if getattr(reader, "canHandleTemporal", False):
34
+ reader.ReadMetaData()
35
+ times = reader.GetAvailableTimes()
36
+ if times is not None:
37
+ return times
38
+ return ()
39
+
40
+
23
41
  class DelayInitialization:
24
42
  """Lazily resolve the reader or writer classes in a conversion catalog."""
25
43
 
@@ -231,9 +249,9 @@ def mesh_file_conversion(
231
249
  Parameters
232
250
  ----------
233
251
  inputs : collections.abc.Mapping[str, Any]
234
- Input and output filenames.
252
+ Connected inputs, already merged into parameters by the workflow executor.
235
253
  parameters : collections.abc.Mapping[str, Any]
236
- Reader, writer, temporal selection, and binary-output settings.
254
+ Input and output filenames, reader, writer, temporal selection, and binary-output settings.
237
255
 
238
256
  Returns
239
257
  -------
@@ -292,23 +310,24 @@ def mesh_file_conversion(
292
310
  **extras,
293
311
  )
294
312
 
295
- if reader.canHandleTemporal:
296
- reader.ReadMetaData()
297
- timesAvailable = reader.GetAvailableTimes()
313
+ times_available = get_available_mesh_times(reader)
314
+
315
+ # A temporal-capable reader can still be reading a static mesh.
316
+ if len(times_available) > 0:
298
317
  writer.SetFileName(outputfilename)
299
318
  if hasattr(writer, "SetBinary"):
300
319
  writer.SetBinary(binary)
301
320
 
302
321
  if timestep_to_read == "first":
303
- times = [0]
322
+ times = [times_available[0]]
304
323
  elif timestep_to_read == "last":
305
- times = [timesAvailable[-1]]
324
+ times = [times_available[-1]]
306
325
  elif timestep_to_read == "all":
307
- times = timesAvailable
326
+ times = times_available
308
327
  else:
309
328
  from Muscat.Helpers.ParserHelper import ReadInts
310
329
 
311
- times = timesAvailable[ReadInts(timestep_to_read)]
330
+ times = times_available[ReadInts(timestep_to_read)]
312
331
 
313
332
  if writer.canHandleTemporal:
314
333
  writer.SetTemporal()
@@ -321,7 +340,9 @@ def mesh_file_conversion(
321
340
  finally:
322
341
  writer.Close()
323
342
  else:
324
- writer.Open(outputfilename)
343
+ # A single-snapshot writer uses the last of the selected times.
344
+ reader.SetTimeToRead(times[-1])
345
+ writer.Open()
325
346
  try:
326
347
  DoWrite(reader.Read(), writer)
327
348
  finally:
@@ -338,7 +359,7 @@ def mesh_file_conversion(
338
359
  finally:
339
360
  writer.Close()
340
361
 
341
- return {"converted_filename": str(outputfilename)}
362
+ return {"converted_filename": FilePath(outputfilename)}
342
363
 
343
364
 
344
365
  MESH_FILE_CONVERSION = NodeDefinition(
@@ -359,7 +380,6 @@ MESH_FILE_CONVERSION = NodeDefinition(
359
380
  "auto",
360
381
  options=(ParameterOption("auto", "Auto"),)
361
382
  + tuple(ParameterOption(k, k) for k in ReaderMapping.keys()), # noqa: SIM118
362
- port=False,
363
383
  ),
364
384
  ParameterDefinition(
365
385
  "writer",
@@ -368,24 +388,15 @@ MESH_FILE_CONVERSION = NodeDefinition(
368
388
  "auto",
369
389
  options=(ParameterOption("auto", "Auto"),)
370
390
  + tuple(ParameterOption(k, k) for k in WriterMapping.keys()), # noqa: SIM118
371
- port=False,
372
391
  ),
373
392
  ParameterDefinition(
374
393
  "timestep_to_read",
375
394
  ParameterKind.STR_SELECT,
376
395
  "Timestep to read",
377
396
  "last",
378
- options=(
379
- ParameterOption("first", "First time step"),
380
- ParameterOption("last", "Last time step"),
381
- ParameterOption("all", "All time steps"),
382
- # ParameterOption("Selected time step", "selected")
383
- ),
384
- port=False,
385
- ),
386
- ParameterDefinition(
387
- "binary", ParameterKind.BOOLEAN, "binary (if available)", True, port=False
397
+ options=TIMESTEP_OPTIONS,
388
398
  ),
399
+ ParameterDefinition("binary", ParameterKind.BOOLEAN, "binary (if available)", True),
389
400
  # ParameterDefinition(
390
401
  # "timestep", ParameterKind.LIST_INT, "time step to read", [-1], port=True
391
402
  # ),
@@ -2,7 +2,7 @@
2
2
 
3
3
  import re
4
4
  from collections.abc import Mapping
5
- from pathlib import Path
5
+ from pathlib import Path, PureWindowsPath
6
6
  from typing import Any
7
7
 
8
8
  from flowgraph.application.workflow_core import (
@@ -13,7 +13,7 @@ from flowgraph.application.workflow_core import (
13
13
  PortDirection,
14
14
  )
15
15
 
16
- from .data_types import LIST_STR, STRING, ParameterKind
16
+ from .data_types import DIRECTORY, LIST_STR, STRING, ParameterKind
17
17
 
18
18
 
19
19
  def _select_file(
@@ -53,31 +53,67 @@ SELECT_FILE = NodeDefinition(
53
53
 
54
54
 
55
55
  def _select_server_file(
56
- _inputs: Mapping[str, Any],
56
+ inputs: Mapping[str, Any],
57
57
  parameters: Mapping[str, Any],
58
58
  _exec_context: ExecContext | None = None,
59
59
  ) -> Mapping[str, Any]:
60
- """Output the configured uploaded-file path."""
61
- path = parameters.get("file name", "")
60
+ """Resolve selected files, or compose connected paths without filesystem validation."""
61
+ validate_selection = "workspace" not in inputs and "file name" not in inputs
62
+ path = inputs.get("file name", parameters.get("file name", ""))
62
63
  if not isinstance(path, str):
63
64
  raise TypeError("The selected file path parameter must be text")
64
65
  if len(path) == 0:
65
66
  raise ValueError("Path can't be empty")
66
- return {"path": path}
67
+ source = Path(path).expanduser()
68
+ # Absolute paths from existing workflows remain external references.
69
+ if source.is_absolute():
70
+ return {"path": str(source)}
71
+ root = _exec_context.workspace if _exec_context is not None else None
72
+ if "workspace" in inputs:
73
+ workspace = inputs["workspace"]
74
+ if not isinstance(workspace, (str, Path)):
75
+ raise TypeError("Workspace File workspace path must be text or a Path")
76
+ if workspace == "":
77
+ raise ValueError("Workspace File workspace path can't be empty")
78
+ root = Path(workspace).expanduser().resolve()
79
+ if root is None:
80
+ raise ValueError("Workspace File requires a configured workspace directory")
81
+ source = (root / source).resolve()
82
+ if validate_selection and not source.is_relative_to(root):
83
+ raise ValueError("Workspace File path escapes the workspace directory")
84
+ if validate_selection and not source.is_file():
85
+ raise ValueError(f"Workspace file does not exist or is not a file: {path}")
86
+ return {"path": str(source)}
67
87
 
68
88
 
69
89
  SELECT_SERVER_FILE = NodeDefinition(
70
90
  cache_policy="pure",
71
- id="select-server-file",
91
+ id="workspace-file",
72
92
  requirements=(),
73
93
  icon="mdi-cloud-upload-outline",
74
- label="Select uploaded file",
75
- description="Outputs a selected server file path as text without reading the file.",
76
- ports=(PortDefinition("path", PortDirection.OUTPUT, STRING, "File path"),),
94
+ label="Workspace File",
95
+ description="Resolves a workspace-relative file path without reading the file. Connected workspace or file name inputs compose paths without filesystem validation, including new writer destinations. Legacy absolute paths remain external references.",
96
+ ports=(
97
+ PortDefinition("path", PortDirection.OUTPUT, STRING, "File path"),
98
+ PortDefinition(
99
+ "workspace",
100
+ PortDirection.INPUT,
101
+ DIRECTORY,
102
+ "Workspace path",
103
+ required=False,
104
+ accepted_data_types=(STRING,),
105
+ ),
106
+ PortDefinition("file name", PortDirection.INPUT, STRING, "Workspace file", required=False),
107
+ ),
77
108
  executor=_select_server_file,
78
109
  parameters=(
79
110
  ParameterDefinition(
80
- "file name", ParameterKind.SELECT_SERVER_FILENAME, "File Name", "", port=False
111
+ "file name",
112
+ ParameterKind.SELECT_SERVER_FILENAME,
113
+ "Workspace file",
114
+ "",
115
+ port=False,
116
+ input_port="file name",
81
117
  ),
82
118
  ),
83
119
  )
@@ -87,6 +123,68 @@ class DirectoryReadError(ValueError):
87
123
  """Raised when a directory-file listing node receives an invalid directory path."""
88
124
 
89
125
 
126
+ def _workspace_directory(
127
+ inputs: Mapping[str, Any],
128
+ parameters: Mapping[str, Any],
129
+ _exec_context: ExecContext | None = None,
130
+ ) -> Mapping[str, Any]:
131
+ """Resolve the selector, or a node-local connected folder without filesystem checks."""
132
+ root = _exec_context.workspace if _exec_context is not None else None
133
+ if "folder" in inputs:
134
+ selected = inputs["folder"]
135
+ if not isinstance(selected, (str, Path)):
136
+ raise TypeError("Workspace Folder input must be text or a Path")
137
+ if selected == "":
138
+ raise ValueError("Workspace Folder input can't be empty")
139
+ folder = Path(selected).expanduser()
140
+ if folder.is_absolute():
141
+ return {"path": folder.resolve()}
142
+ if root is None:
143
+ raise ValueError("Workspace Folder requires a configured workspace directory")
144
+ return {"path": (root / folder).resolve()}
145
+ if root is None:
146
+ raise ValueError("Workspace Folder requires a configured workspace directory")
147
+ selected = parameters.get("folder", ".")
148
+ if not isinstance(selected, str):
149
+ raise TypeError("Workspace Folder selection must be text")
150
+ relative = Path(selected)
151
+ if relative.is_absolute() or PureWindowsPath(selected).anchor:
152
+ raise ValueError("Workspace Folder requires a workspace-relative folder path")
153
+ folder = (root / relative).resolve()
154
+ if not folder.is_relative_to(root):
155
+ raise ValueError("Workspace Folder path escapes the workspace directory")
156
+ if not folder.is_dir():
157
+ raise ValueError(f"Workspace folder does not exist or is not a directory: {selected}")
158
+ return {"path": folder}
159
+
160
+
161
+ WORKSPACE = NodeDefinition(
162
+ cache_policy="pure",
163
+ id="workspace-folder",
164
+ requirements=(),
165
+ icon="mdi-folder-outline",
166
+ label="Workspace Folder",
167
+ description="Resolves a selected workspace-relative folder as an absolute directory path. An optional folder input overrides this node only, without filesystem validation. Defaults to the workspace root.",
168
+ ports=(
169
+ PortDefinition("path", PortDirection.OUTPUT, DIRECTORY, "Directory path"),
170
+ PortDefinition(
171
+ "folder",
172
+ PortDirection.INPUT,
173
+ STRING,
174
+ "Workspace folder",
175
+ required=False,
176
+ accepted_data_types=(DIRECTORY,),
177
+ ),
178
+ ),
179
+ executor=_workspace_directory,
180
+ parameters=(
181
+ ParameterDefinition(
182
+ "folder", ParameterKind.TEXT, "Workspace folder", ".", port=False, input_port="folder"
183
+ ),
184
+ ),
185
+ )
186
+
187
+
90
188
  def _compile_filename_patterns(
91
189
  pattern: object,
92
190
  ) -> re.Pattern[str] | None:
@@ -171,7 +269,7 @@ READ_DIRECTORY_FILES = NodeDefinition(
171
269
  parameters=(
172
270
  ParameterDefinition(
173
271
  "path",
174
- ParameterKind.FILE,
272
+ ParameterKind.DIRECTORY,
175
273
  "Directory path",
176
274
  "",
177
275
  "/path/to/directory",
@@ -201,5 +299,6 @@ __all__ = [
201
299
  "READ_DIRECTORY_FILES",
202
300
  "SELECT_FILE",
203
301
  "SELECT_SERVER_FILE",
302
+ "WORKSPACE",
204
303
  "DirectoryReadError",
205
304
  ]
@@ -4,7 +4,6 @@ from collections.abc import Mapping, Sequence
4
4
  from typing import Any
5
5
 
6
6
  import Muscat.MeshContainers.ElementsDescription as ED
7
- import numpy as np
8
7
  from Muscat.MeshContainers.Filters.FilterObjects import ElementFilter, NodeFilter
9
8
  from Muscat.MeshContainers.Filters.FilterOperators import (
10
9
  ComplementaryFilter,
@@ -189,16 +188,6 @@ CREATE_MUSCAT_ELEMENT_FILTER = NodeDefinition(
189
188
  )
190
189
 
191
190
 
192
- class _ComposedNodeFilter(NodeFilter):
193
- """Honor nested nodal filters omitted by Muscat's NodeFilter implementation."""
194
-
195
- def GetNodesIndices(self, mesh):
196
- indices = super().GetNodesIndices(mesh)
197
- if self.nFilter is None:
198
- return indices
199
- return np.intersect1d(indices, self.nFilter.GetNodesIndices(mesh))
200
-
201
-
202
191
  def _create_node_filter(
203
192
  inputs: Mapping[str, Any],
204
193
  parameters: Mapping[str, Any],
@@ -206,7 +195,7 @@ def _create_node_filter(
206
195
  ) -> Mapping[str, Any]:
207
196
  """Create a Muscat nodal selector from tags, zones, and nested selectors."""
208
197
  return {
209
- "filter": _ComposedNodeFilter(
198
+ "filter": NodeFilter(
210
199
  nTag=_tag_list(parameters, "ntag") or None,
211
200
  eTag=_tag_list(parameters, "etag") or None,
212
201
  zone=[value for name, value in inputs.items() if name.startswith("zone_")],