abstractflow 0.1.0__tar.gz → 0.3.1__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 (124) hide show
  1. abstractflow-0.3.1/CHANGELOG.md +178 -0
  2. {abstractflow-0.1.0 → abstractflow-0.3.1}/LICENSE +2 -0
  3. {abstractflow-0.1.0 → abstractflow-0.3.1}/MANIFEST.in +2 -0
  4. abstractflow-0.3.1/PKG-INFO +186 -0
  5. abstractflow-0.3.1/README.md +133 -0
  6. abstractflow-0.3.1/abstractflow/__init__.py +91 -0
  7. {abstractflow-0.1.0 → abstractflow-0.3.1}/abstractflow/__main__.py +2 -0
  8. abstractflow-0.3.1/abstractflow/adapters/__init__.py +11 -0
  9. abstractflow-0.3.1/abstractflow/adapters/agent_adapter.py +5 -0
  10. abstractflow-0.3.1/abstractflow/adapters/control_adapter.py +5 -0
  11. abstractflow-0.3.1/abstractflow/adapters/effect_adapter.py +5 -0
  12. abstractflow-0.3.1/abstractflow/adapters/event_adapter.py +5 -0
  13. abstractflow-0.3.1/abstractflow/adapters/function_adapter.py +5 -0
  14. abstractflow-0.3.1/abstractflow/adapters/subflow_adapter.py +5 -0
  15. abstractflow-0.3.1/abstractflow/adapters/variable_adapter.py +5 -0
  16. abstractflow-0.3.1/abstractflow/cli.py +89 -0
  17. abstractflow-0.3.1/abstractflow/compiler.py +23 -0
  18. abstractflow-0.3.1/abstractflow/core/__init__.py +5 -0
  19. abstractflow-0.3.1/abstractflow/core/flow.py +11 -0
  20. {abstractflow-0.1.0 → abstractflow-0.3.1}/abstractflow/py.typed +2 -0
  21. abstractflow-0.3.1/abstractflow/runner.py +402 -0
  22. abstractflow-0.3.1/abstractflow/visual/__init__.py +43 -0
  23. abstractflow-0.3.1/abstractflow/visual/agent_ids.py +5 -0
  24. abstractflow-0.3.1/abstractflow/visual/builtins.py +5 -0
  25. abstractflow-0.3.1/abstractflow/visual/code_executor.py +5 -0
  26. abstractflow-0.3.1/abstractflow/visual/event_ids.py +33 -0
  27. abstractflow-0.3.1/abstractflow/visual/executor.py +968 -0
  28. abstractflow-0.3.1/abstractflow/visual/interfaces.py +440 -0
  29. abstractflow-0.3.1/abstractflow/visual/models.py +277 -0
  30. abstractflow-0.3.1/abstractflow/visual/session_runner.py +182 -0
  31. abstractflow-0.3.1/abstractflow/visual/workspace_scoped_tools.py +29 -0
  32. abstractflow-0.3.1/abstractflow/workflow_bundle.py +290 -0
  33. abstractflow-0.3.1/abstractflow.egg-info/PKG-INFO +186 -0
  34. abstractflow-0.3.1/abstractflow.egg-info/SOURCES.txt +115 -0
  35. {abstractflow-0.1.0 → abstractflow-0.3.1}/abstractflow.egg-info/requires.txt +6 -2
  36. {abstractflow-0.1.0 → abstractflow-0.3.1}/pyproject.toml +16 -8
  37. {abstractflow-0.1.0 → abstractflow-0.3.1}/setup.py +2 -0
  38. abstractflow-0.3.1/tests/test_compiler.py +100 -0
  39. abstractflow-0.3.1/tests/test_flow.py +252 -0
  40. abstractflow-0.3.1/tests/test_gateway_connection_config.py +57 -0
  41. abstractflow-0.3.1/tests/test_gateway_token_resolution.py +38 -0
  42. abstractflow-0.3.1/tests/test_kg_ingest_output_budget_defaults.py +57 -0
  43. abstractflow-0.3.1/tests/test_ltm_ai_kg_extract_triples_defaults.py +38 -0
  44. abstractflow-0.3.1/tests/test_ltm_ai_kg_extract_triples_gate_normalization.py +126 -0
  45. abstractflow-0.3.1/tests/test_python_code_node_params.py +131 -0
  46. abstractflow-0.3.1/tests/test_role_workflows_are_valid_and_sota.py +157 -0
  47. abstractflow-0.3.1/tests/test_runner.py +191 -0
  48. abstractflow-0.3.1/tests/test_runtime_visualflow_compiler_shim.py +53 -0
  49. abstractflow-0.3.1/tests/test_semantic_extraction_multi_source_evidence_bundle.py +157 -0
  50. abstractflow-0.3.1/tests/test_sequence_parallel_nodes.py +202 -0
  51. abstractflow-0.3.1/tests/test_switch_node.py +156 -0
  52. abstractflow-0.3.1/tests/test_system_datetime_node.py +94 -0
  53. abstractflow-0.3.1/tests/test_visual_agent_reentry_re_resolves_inputs.py +89 -0
  54. abstractflow-0.3.1/tests/test_visual_agent_scratchpad_output.py +178 -0
  55. abstractflow-0.3.1/tests/test_visual_agent_structured_output_pin.py +91 -0
  56. abstractflow-0.3.1/tests/test_visual_agent_system_prompt_and_tools_override.py +195 -0
  57. abstractflow-0.3.1/tests/test_visual_agent_tool_serialization.py +90 -0
  58. abstractflow-0.3.1/tests/test_visual_agent_trace_report_node.py +107 -0
  59. abstractflow-0.3.1/tests/test_visual_bool_var_node.py +61 -0
  60. abstractflow-0.3.1/tests/test_visual_custom_events.py +190 -0
  61. abstractflow-0.3.1/tests/test_visual_file_nodes.py +49 -0
  62. abstractflow-0.3.1/tests/test_visual_for_node.py +97 -0
  63. abstractflow-0.3.1/tests/test_visual_format_tool_results_node.py +84 -0
  64. abstractflow-0.3.1/tests/test_visual_if_branching.py +76 -0
  65. abstractflow-0.3.1/tests/test_visual_ignores_unreachable_nodes.py +107 -0
  66. abstractflow-0.3.1/tests/test_visual_interfaces.py +156 -0
  67. abstractflow-0.3.1/tests/test_visual_llm_call_integration.py +301 -0
  68. abstractflow-0.3.1/tests/test_visual_llm_call_structured_output_pin.py +136 -0
  69. abstractflow-0.3.1/tests/test_visual_llm_call_tools_and_result_output.py +150 -0
  70. abstractflow-0.3.1/tests/test_visual_loop_node.py +98 -0
  71. abstractflow-0.3.1/tests/test_visual_loop_pure_node_invalidation.py +119 -0
  72. abstractflow-0.3.1/tests/test_visual_memory_kg_nodes.py +436 -0
  73. abstractflow-0.3.1/tests/test_visual_memory_kg_session_scope.py +180 -0
  74. abstractflow-0.3.1/tests/test_visual_models_accept_add_message_node.py +7 -0
  75. abstractflow-0.3.1/tests/test_visual_parse_json_node.py +94 -0
  76. abstractflow-0.3.1/tests/test_visual_pin_defaults.py +97 -0
  77. abstractflow-0.3.1/tests/test_visual_pure_nodes.py +703 -0
  78. abstractflow-0.3.1/tests/test_visual_resume_rehydrates_node_outputs.py +93 -0
  79. abstractflow-0.3.1/tests/test_visual_set_var_typed_defaults.py +75 -0
  80. abstractflow-0.3.1/tests/test_visual_split_node.py +97 -0
  81. abstractflow-0.3.1/tests/test_visual_stringify_json_node.py +135 -0
  82. abstractflow-0.3.1/tests/test_visual_subflow_recursion.py +231 -0
  83. abstractflow-0.3.1/tests/test_visual_subflow_registry_reachability.py +66 -0
  84. abstractflow-0.3.1/tests/test_visual_tool_calls_node.py +134 -0
  85. abstractflow-0.3.1/tests/test_visual_tools_allowlist_node.py +51 -0
  86. abstractflow-0.3.1/tests/test_visual_var_decl_node.py +114 -0
  87. abstractflow-0.3.1/tests/test_visual_variables_nodes.py +389 -0
  88. abstractflow-0.3.1/tests/test_visual_while_node.py +96 -0
  89. abstractflow-0.3.1/tests/test_visual_while_pure_node_invalidation.py +116 -0
  90. abstractflow-0.3.1/tests/test_visual_workflow_io.py +272 -0
  91. abstractflow-0.3.1/tests/test_visual_ws_agent_node_lifecycle.py +202 -0
  92. abstractflow-0.3.1/tests/test_visual_ws_answer_user.py +116 -0
  93. abstractflow-0.3.1/tests/test_visual_ws_custom_events_order.py +109 -0
  94. abstractflow-0.3.1/tests/test_visual_ws_delay_node.py +88 -0
  95. abstractflow-0.3.1/tests/test_visual_ws_memory_effects.py +139 -0
  96. abstractflow-0.3.1/tests/test_visual_ws_memory_rehydrate_effect.py +203 -0
  97. abstractflow-0.3.1/tests/test_visual_ws_nested_subworkflow_descendants.py +214 -0
  98. abstractflow-0.3.1/tests/test_visual_ws_observability.py +207 -0
  99. abstractflow-0.3.1/tests/test_visual_ws_on_schedule_node.py +162 -0
  100. abstractflow-0.3.1/tests/test_visual_ws_run_controls.py +184 -0
  101. abstractflow-0.3.1/tests/test_visual_ws_run_controls_responsive.py +104 -0
  102. abstractflow-0.3.1/tests/test_visual_ws_run_ids_for_child_runs.py +157 -0
  103. abstractflow-0.3.1/tests/test_visual_ws_subflow.py +398 -0
  104. abstractflow-0.3.1/tests/test_visual_ws_trace_update_streaming.py +175 -0
  105. abstractflow-0.3.1/tests/test_visual_ws_waiting.py +144 -0
  106. abstractflow-0.3.1/tests/test_visualflow_to_workflow_artifact_compiler.py +38 -0
  107. abstractflow-0.3.1/tests/test_web_backend_dev_import_paths.py +47 -0
  108. abstractflow-0.3.1/tests/test_web_execution_workspace.py +33 -0
  109. abstractflow-0.3.1/tests/test_web_memory_kg_query_api.py +160 -0
  110. abstractflow-0.3.1/tests/test_web_workspace_scoped_tools.py +108 -0
  111. abstractflow-0.3.1/tests/test_workflow_artifact_compiles_all_web_flows.py +25 -0
  112. abstractflow-0.3.1/tests/test_workflow_artifact_executes_real_visualflow_json.py +47 -0
  113. abstractflow-0.3.1/tests/test_workflow_bundle_pack.py +52 -0
  114. abstractflow-0.1.0/CHANGELOG.md +0 -30
  115. abstractflow-0.1.0/PKG-INFO +0 -238
  116. abstractflow-0.1.0/README.md +0 -186
  117. abstractflow-0.1.0/abstractflow/__init__.py +0 -111
  118. abstractflow-0.1.0/abstractflow/cli.py +0 -42
  119. abstractflow-0.1.0/abstractflow.egg-info/PKG-INFO +0 -238
  120. abstractflow-0.1.0/abstractflow.egg-info/SOURCES.txt +0 -16
  121. {abstractflow-0.1.0 → abstractflow-0.3.1}/abstractflow.egg-info/dependency_links.txt +0 -0
  122. {abstractflow-0.1.0 → abstractflow-0.3.1}/abstractflow.egg-info/entry_points.txt +0 -0
  123. {abstractflow-0.1.0 → abstractflow-0.3.1}/abstractflow.egg-info/top_level.txt +0 -0
  124. {abstractflow-0.1.0 → abstractflow-0.3.1}/setup.cfg +0 -0
@@ -0,0 +1,178 @@
1
+ # Changelog
2
+
3
+ All notable changes to AbstractFlow will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+ - **AbstractCode UI event demo flows** (`web/flows/*.json`):
12
+ - `acagent_message_demo.json`: `abstractcode.message`
13
+ - `acagent_ask_demo.json`: durable ask+wait via `wait_event.prompt`
14
+ - `acagent_tool_events_demo.json`: `abstractcode.tool_execution` + `abstractcode.tool_result`
15
+ - **Tool observability wiring improvements (Visual nodes)**:
16
+ - `LLM Call` exposes `tool_calls` as a first-class output pin (same as `result.tool_calls`) for easier wiring into `Tool Calls` / `Emit Event`.
17
+ - `Agent` exposes best-effort `tool_calls` / `tool_results` extracted from its scratchpad trace (post-run ergonomics).
18
+ - **Pure Utility Nodes (Runtime-backed)**:
19
+ - `Stringify JSON` (`stringify_json`): Render JSON (or JSON-ish strings) into text with a `mode` dropdown (`none` | `beautify` | `minified`). Implementation delegates to `abstractruntime.rendering.stringify_json` for consistent host behavior.
20
+ - `Agent Trace Report` (`agent_trace_report`): Render an agent scratchpad (`node_traces`) into a condensed Markdown timeline of LLM calls and tool actions (full tool args + results, no truncation). Implementation delegates to `abstractruntime.rendering.render_agent_trace_markdown`.
21
+
22
+ ### Changed
23
+ - **Run Flow modal (array parameters)**: Array pins now render as a Blueprint-style item list (add/remove items) with a "Raw JSON (advanced)" escape hatch for non-string arrays.
24
+
25
+ ### Fixed
26
+ - **FlowRunner SUBWORKFLOW auto-drive**: `FlowRunner.run()` no longer hangs if the runtime registry contains only subworkflow specs (common in unit tests). It now falls back to the runner’s own root `WorkflowSpec` when resuming/bubbling parents.
27
+
28
+ ## [0.3.1] - 2026-02-04
29
+
30
+ ### Added
31
+ - **User-facing documentation set** for public release:
32
+ - Core docs: `README.md`, `docs/getting-started.md`, `docs/architecture.md`, `docs/api.md`, `docs/faq.md`
33
+ - Repo policies: `CONTRIBUTING.md`, `SECURITY.md`, `ACKNOWLEDMENTS.md`
34
+ - Agentic index: `llms.txt`, `llms-full.txt`
35
+
36
+ ### Changed
37
+ - **Documentation accuracy + structure**: refreshed docs to match the implemented code (VisualFlow portability, runtime wiring, CLI bundle tooling, web editor layout) and improved cross-references for first-time users.
38
+
39
+ ## [0.3.0] - 2025-01-06
40
+
41
+ ### Added
42
+ - **VisualFlow Interface System** (`abstractflow/visual/interfaces.py`): Declarative workflow interface markers for portable host validation, enabling workflows to be run as specialized capabilities with known IO contracts
43
+ - `abstractcode.agent.v1` interface: Host-configurable prompt → response contract for running a workflow as an AbstractCode agent
44
+ - Interface validation with required/recommended pin specifications (provider/model/tools/prompt/response)
45
+ - Auto-scaffolding support: enabling `abstractcode.agent.v1` auto-creates `On Flow Start` / `On Flow End` nodes with required pins
46
+ - **Structured Output Support**: Visual `LLM Call` and `Agent` nodes accept optional `response_schema` input pin (JSON Schema object) for schema-conformant responses
47
+ - New literal node `JSON Schema` (`json_schema`) to author schema objects
48
+ - New `JsonSchemaNodeEditor` UI component for authoring schemas in the visual editor
49
+ - Pin-driven schema overrides node config and enables durable structured-output enforcement via AbstractRuntime `LLM_CALL`
50
+ - **Tool Calling Infrastructure**:
51
+ - Visual `LLM Call` nodes support optional **tool calling** via `tools` allowlist input (pin or node config)
52
+ - Expose structured `result` output object (normalized LLM response including `tool_calls`, `usage`, `trace_id`)
53
+ - Inline tools dropdown in node UI (when `tools` pin not connected)
54
+ - Visual `Tool Calls` node (`tool_calls`) to execute tool call requests via AbstractRuntime `EffectType.TOOL_CALLS`
55
+ - New pure node `Tools Allowlist` (`tools_allowlist`) with inline multi-select for workflow-scope tool lists
56
+ - Dedicated `tools` pin type (specialized `string[]`) for `On Flow Start` parameters
57
+ - **Control Flow & Loop Enhancements**:
58
+ - New control node `For` (`for`) for numeric loops with `start`/`end`/`step` inputs and `i`/`index` outputs
59
+ - `While` node now exposes `index` output pin (0-based iteration count) and `item:any` output pin for parity with `ForEach`
60
+ - `Loop` (Foreach) now invalidates cached pure-node outputs per-iteration (fixes scratchpad accumulation)
61
+ - **Workflow Variables**:
62
+ - New pure node `Variable` (`var_decl`) to declare workflow-scope persistent variables with explicit types
63
+ - New pure node `Bool Variable` (`bool_var`) for boolean variables with typed outputs
64
+ - New execution node `Set Variables` (`set_vars`) to update multiple variables in a single step
65
+ - New execution node `Set Variable Property` (`set_var_property`) to update nested object properties
66
+ - `Get Variable` (`get_var`) reads from durable `run.vars` by dotted path
67
+ - `Set Variable` (`set_var`) updates `run.vars` with pass-through execution semantics
68
+ - **Custom Events** (Blueprint-style):
69
+ - `On Event` listeners compiled into dedicated durable subworkflows (auto-started, session-scoped)
70
+ - `Emit Event` node dispatches durable events via AbstractRuntime
71
+ - **Run History & Observability**:
72
+ - New web API endpoints: `/api/runs`, `/api/runs/{run_id}/history`, `/api/runs/{run_id}/artifacts/{artifact_id}`
73
+ - UI "Run History" picker (🕘) to open past runs and apply pause/resume/cancel controls
74
+ - Run modal shows clickable **run id** pill (hover → copy to clipboard)
75
+ - Run modal header token badge reflects cumulative LLM usage across entire run tree
76
+ - WebSocket events include JSON-safe ISO timestamp (`ts`)
77
+ - Runtime node trace entries streamed incrementally over WebSocket (`trace_update`)
78
+ - Agent details panel renders live sub-run trace with expandable prompts/responses/errors
79
+ - **Pure Utility Nodes**:
80
+ - `Parse JSON` (`parse_json`) to convert JSON/JSON-ish strings into objects
81
+ - `coalesce` (first non-null selection by pin order)
82
+ - `string_template` (render `{{path.to.value}}` with filters: json, join, trim)
83
+ - `array_length`, `array_append`, `array_dedup`
84
+ - `Compare` (`compare`) now has `op` input pin supporting `==`, `>=`, `>`, `<=`, `<`
85
+ - `get` (Get Property) supports `default` input and safer nested path handling (e.g. `a[0].b`)
86
+ - **Memory Node Enhancements**:
87
+ - `Memorize` (`memory_note`) adds optional `location` input
88
+ - `Memorize` supports **Keep in context** toggle to rehydrate notes into `context.messages`
89
+ - `Recall` (`memory_query`) adds `tags_mode` (all/any), `usernames`, `locations` inputs
90
+ - **Subflow Enhancements**:
91
+ - `Subflow` supports **Inherit context** toggle to seed child run's `context.messages` from parent
92
+ - `multi_agent_state_machine` accepts `workspace_root` parameter to scope agent file/system tools
93
+ - **Visual Execution Defaults**:
94
+ - Default **LLM HTTP timeout** (7200s, overrideable via `ABSTRACTFLOW_LLM_TIMEOUT_S`)
95
+ - Default **max output token cap** (4096, overrideable via `ABSTRACTFLOW_LLM_MAX_OUTPUT_TOKENS`)
96
+ - **UI/UX Improvements**:
97
+ - Run preflight validation panel with itemized "Fix before running" checklist
98
+ - Node tooltips available in palette and on-canvas (hover > 1s)
99
+ - Node palette exposed transforms (`trim`, `substring`, `format`) and math ops (`modulo`, `power`)
100
+ - Enhanced `PropertiesPanel` with structured output configuration
101
+ - Improved `RunFlowModal` with better input validation and error display
102
+ - JSON validation and error handling across executor and frontend (`web/frontend/src/utils/validation.ts`)
103
+
104
+ ### Changed
105
+ - **Workflow-Agent Interface UX**: Enabling `abstractcode.agent.v1` auto-scaffolds `On Flow Start` / `On Flow End` pins (provider/model/tools)
106
+ - **Memory Nodes UX**: `memory_note` labeled **Memorize** (was Remember) to align with AbstractCode `/memorize`
107
+ - **Flow Library Modal**: Flow name/description edited via inline pencil icons (removed Rename/Edit Description buttons)
108
+ - **Run Modal UX**:
109
+ - String inputs default to 3-line textarea
110
+ - Modal actions pinned in footer (body scrolls)
111
+ - No truncation of sub-run/memory previews (full content on demand)
112
+ - JSON panels (`Raw JSON`, `Trace JSON`, `Scratchpad`) syntax-highlighted
113
+ - **Node Palette Organization**:
114
+ - Removed **Effects** category
115
+ - Added **Memory** category (memories + file IO)
116
+ - Added **Math** category (after Variables)
117
+ - Moved **Delay** to **Events**
118
+ - Split into **Literals**, **Variables**, **Data** (renamed from "Data" to **Transforms**)
119
+ - Reordered **Control** nodes (loops → branching → conditions)
120
+ - `System Date/Time` moved to **Events**
121
+ - `Provider Catalog` + `Models Catalog` moved to **Literals**
122
+ - `Tool Calls` moved from **Effects** to **Core** (reordered: Subflow, Agent, LLM Call, Tool Calls, Ask User, Answer User)
123
+ - **Models Catalog**: Removed deprecated `allowed_models` input pin (in-node multi-select synced with right panel)
124
+ - **Node/Pin Tooltips**: Appear after 2s hover, rendered in overlay layer (no clipping)
125
+ - **Python Code Nodes**: Include in-node **Edit Code** button; editor injects "Available variables" comment block
126
+ - **Execution Highlighting**: Stronger, more diffuse bloom for readability during runs; afterglow decays smoothly (3s), highlights only taken edges
127
+ - **Data Edges**: Colored by data type (based on source pin type)
128
+
129
+ ### Fixed
130
+ - **Recursive Subflows**: Visual data-edge cache (`flow._node_outputs`) now isolated per `run_id` to prevent stale outputs leaking across nested runs (fixes self/mutual recursion with pure nodes like `compare`, `subtract`)
131
+ - **Durable Persistence**: `on_flow_start` no longer leaks internal `_temp` into cached node outputs (prevented `RecursionError: maximum recursion depth exceeded`)
132
+ - **WebSocket Run Controls**: Pause/resume/cancel no longer block on per-connection execution lock (responsive during long-running LLM/Agent nodes)
133
+ - **WebSocket Resilience**:
134
+ - Controls resilient to transient disconnects (can send with explicit `run_id`, UI reconnects-and-sends)
135
+ - Execution resilient to UI disconnects (dropped connection doesn't cancel in-flight run)
136
+ - **VisualFlow Execution**: Ignores unreachable/disconnected execution nodes (orphan `llm_call`/`subflow` can't fail initialization)
137
+ - **Loop Nodes**:
138
+ - `Split` avoids spurious empty trailing items (e.g. `"A@@B@@"`) so `Loop` doesn't execute extra empty iteration
139
+ - Scheduler-node outputs in WebSocket `node_complete`: Loop/While/For sync persisted `{index,...}` outputs to `flow._node_outputs` (UI no longer shows stale index)
140
+ - **Pure Node Behavior**:
141
+ - `Concat` infers stable pin order (a..z) when template metadata missing
142
+ - `Set Variable` defaulting for typed primitives: `boolean/number/string` pins default to `false/0/""` instead of `None`
143
+ - **Agent Nodes**: Reset per-node state when re-entered (e.g. inside `Loop` iterations) so each iteration re-resolves inputs
144
+ - **Run Modal Observability**:
145
+ - WebSocket `node_start`/`node_complete` events include `runId` (distinguish root vs child runs)
146
+ - Visual Agent nodes start ReAct subworkflow in **async+wait** mode for incremental ticking
147
+ - Run history replay synthesizes missing `node_complete` events for steps left open in durable ledger
148
+ - **Canvas Highlighting**: Robust to fast child-run emissions (race with `node_start` before `runId` state update fixed)
149
+ - **WebSocket Subworkflow Waits**: Correctly close waiting node when run resumes past `WAITING(reason=SUBWORKFLOW)`
150
+ - **Web Run History**: Reliably shows persisted runs regardless of server working directory (backend defaults to `web/runtime` unless `ABSTRACTFLOW_RUNTIME_DIR` set)
151
+ - **Cancel Run**: No longer surfaces as `flow_error` from `asyncio.CancelledError` (treated as expected control-plane operation)
152
+ - **Markdown Code Blocks**: "Copy" now copies original raw code (preserves newlines/indentation) after syntax highlighting
153
+
154
+ ### Technical Details
155
+ - **13 commits**, **48 files changed**: 12,142 insertions, 368 deletions
156
+ - New module: `abstractflow/visual/interfaces.py` (347 lines)
157
+ - New UI component: `web/frontend/src/components/JsonSchemaNodeEditor.tsx` (460 lines)
158
+ - New tests: `test_visual_interfaces.py`, `test_visual_agent_structured_output_pin.py`, `test_visual_llm_call_structured_output_pin.py`, `test_visual_subflow_recursion.py`
159
+ - Compiler enhancements: Interface validation, per-run cache isolation, structured output pin support
160
+ - Executor optimizations: Performance improvements for VisualFlow execution
161
+ - 12 new example workflow JSON files in `web/flows/`
162
+
163
+ ### Notes
164
+ - This repository includes the published Python package (`abstractflow/`) and a reference visual editor app (`web/`).
165
+
166
+ ## [0.1.0] - 2025-01-15
167
+
168
+ ### Added
169
+ - Initial placeholder package to reserve PyPI name
170
+ - Basic project structure and packaging configuration
171
+ - Comprehensive README with project vision and roadmap
172
+ - MIT license and contribution guidelines
173
+ - CLI placeholder with planned command structure
174
+
175
+ ### Notes
176
+ - This is a placeholder release to secure the `abstractflow` name on PyPI
177
+ - No functional code is included in this version
178
+ - Follow the GitHub repository for development updates and release timeline
@@ -19,3 +19,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
+
23
+
@@ -24,3 +24,5 @@ exclude .pytest_cache
24
24
  exclude build
25
25
  exclude dist
26
26
  exclude *.egg-info
27
+
28
+
@@ -0,0 +1,186 @@
1
+ Metadata-Version: 2.4
2
+ Name: abstractflow
3
+ Version: 0.3.1
4
+ Summary: Diagram-based AI workflow generation built on AbstractCore
5
+ Author-email: AbstractFlow Team <contact@abstractflow.ai>
6
+ Maintainer-email: AbstractFlow Team <contact@abstractflow.ai>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/lpalbou/AbstractFlow
9
+ Project-URL: Documentation, https://abstractflow.readthedocs.io
10
+ Project-URL: Repository, https://github.com/lpalbou/AbstractFlow
11
+ Project-URL: Bug Tracker, https://github.com/lpalbou/AbstractFlow/issues
12
+ Project-URL: Changelog, https://github.com/lpalbou/AbstractFlow/blob/main/CHANGELOG.md
13
+ Keywords: ai,workflow,diagram,llm,automation,visual-programming,abstractcore,machine-learning
14
+ Classifier: Development Status :: 2 - Pre-Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Topic :: System :: Distributed Computing
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: AbstractRuntime>=0.4.0
29
+ Requires-Dist: abstractcore[tools]>=2.6.8
30
+ Requires-Dist: pydantic>=2.0.0
31
+ Requires-Dist: typing-extensions>=4.0.0
32
+ Provides-Extra: agent
33
+ Requires-Dist: abstractagent>=0.2.0; extra == "agent"
34
+ Provides-Extra: dev
35
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
36
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
37
+ Requires-Dist: black>=23.0.0; extra == "dev"
38
+ Requires-Dist: isort>=5.12.0; extra == "dev"
39
+ Requires-Dist: flake8>=6.0.0; extra == "dev"
40
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
41
+ Requires-Dist: pre-commit>=3.0.0; extra == "dev"
42
+ Provides-Extra: server
43
+ Requires-Dist: fastapi>=0.100.0; extra == "server"
44
+ Requires-Dist: uvicorn[standard]>=0.23.0; extra == "server"
45
+ Requires-Dist: websockets>=11.0.0; extra == "server"
46
+ Provides-Extra: ui
47
+ Requires-Dist: streamlit>=1.28.0; extra == "ui"
48
+ Requires-Dist: plotly>=5.15.0; extra == "ui"
49
+ Requires-Dist: networkx>=3.1.0; extra == "ui"
50
+ Provides-Extra: all
51
+ Requires-Dist: abstractflow[agent,dev,server,ui]; extra == "all"
52
+ Dynamic: license-file
53
+
54
+ # AbstractFlow
55
+
56
+ Diagram-based, **durable** AI workflows for Python.
57
+
58
+ AbstractFlow provides:
59
+ - A portable workflow format (`VisualFlow` JSON) and helpers to execute it from any host (`abstractflow.visual`).
60
+ - A simple programmatic API (`Flow`, `FlowRunner`) backed by **AbstractRuntime**.
61
+ - A reference visual editor app in `web/` (FastAPI backend + React frontend).
62
+
63
+ Project status: **Pre-alpha** (`pyproject.toml`: `Development Status :: 2 - Pre-Alpha`). Expect breaking changes.
64
+
65
+ ## Capabilities (implemented)
66
+
67
+ - Execute programmatic flows (`Flow` → `FlowRunner`) with a default in-memory runtime.
68
+ - Execute portable `VisualFlow` JSON from any host process (`abstractflow.visual`).
69
+ - Durable waits and resumption via AbstractRuntime (e.g. user/event/schedule waits).
70
+ - Package a flow tree as a WorkflowBundle (`.flow`) via the CLI.
71
+ - Author/run VisualFlows in the reference web editor (`web/`).
72
+
73
+ Evidence (code): `abstractflow/runner.py`, `abstractflow/visual/executor.py`, `abstractflow/cli.py`, `web/backend/routes/ws.py`.
74
+
75
+ ## Docs
76
+
77
+ - Start here: `docs/getting-started.md`
78
+ - API reference: `docs/api.md`
79
+ - VisualFlow format: `docs/visualflow.md`
80
+ - Visual editor: `docs/web-editor.md`
81
+ - CLI: `docs/cli.md`
82
+ - FAQ: `docs/faq.md`
83
+ - Architecture: `docs/architecture.md`
84
+ - Docs index: `docs/README.md`
85
+
86
+ ## Installation
87
+
88
+ ```bash
89
+ pip install abstractflow
90
+ ```
91
+
92
+ Requirements: Python **3.10+** (`pyproject.toml`: `requires-python`).
93
+
94
+ Optional extras:
95
+ - Agent nodes (ReAct workflows): `pip install "abstractflow[agent]"`
96
+ - Dev tools (tests/formatting): `pip install "abstractflow[dev]"`
97
+
98
+ Notes:
99
+ - `abstractflow` depends on `AbstractRuntime` and `abstractcore[tools]` (see `pyproject.toml`).
100
+ - Some VisualFlow node types require additional packages (e.g. `memory_kg_*` nodes need `abstractmemory`).
101
+
102
+ ## Quickstart (programmatic)
103
+
104
+ ```python
105
+ from abstractflow import Flow, FlowRunner
106
+
107
+ flow = Flow("linear")
108
+ flow.add_node("double", lambda x: x * 2, input_key="value", output_key="doubled")
109
+ flow.add_node("add_ten", lambda x: x + 10, input_key="doubled", output_key="final")
110
+ flow.add_edge("double", "add_ten")
111
+ flow.set_entry("double")
112
+
113
+ result = FlowRunner(flow).run({"value": 5})
114
+ print(result) # {"success": True, "result": 20}
115
+ ```
116
+
117
+ ## Quickstart (execute a VisualFlow JSON)
118
+
119
+ ```python
120
+ import json
121
+ from abstractflow.visual import VisualFlow, execute_visual_flow
122
+
123
+ with open("my-flow.json", "r", encoding="utf-8") as f:
124
+ vf = VisualFlow.model_validate(json.load(f))
125
+ result = execute_visual_flow(vf, {"prompt": "Hello"}, flows={vf.id: vf})
126
+ print(result) # {"success": True, "waiting": False, "result": ...}
127
+ ```
128
+
129
+ If your flow uses subflows, load all referenced `*.json` into the `flows={...}` mapping (see `docs/getting-started.md`).
130
+
131
+ ## Visual editor (from source)
132
+
133
+ The visual editor is a dev/reference app in `web/` (not shipped as a Python package on PyPI).
134
+
135
+ ```bash
136
+ git clone https://github.com/lpalbou/AbstractFlow.git
137
+ cd AbstractFlow
138
+
139
+ python -m venv .venv
140
+ source .venv/bin/activate
141
+ pip install -e ".[server,agent]"
142
+
143
+ # Terminal 1: Backend (FastAPI)
144
+ cd web && python -m backend --reload --port 8080
145
+
146
+ # Terminal 2: Frontend (Vite)
147
+ cd web/frontend && npm install && npm run dev
148
+ ```
149
+
150
+ Open the frontend at http://localhost:3003 (default Vite port). See `docs/web-editor.md`.
151
+
152
+ ## CLI (WorkflowBundle `.flow`)
153
+
154
+ ```bash
155
+ abstractflow bundle pack web/flows/ac-echo.json --out /tmp/ac-echo.flow
156
+ abstractflow bundle inspect /tmp/ac-echo.flow
157
+ abstractflow bundle unpack /tmp/ac-echo.flow --dir /tmp/ac-echo
158
+ ```
159
+
160
+ See `docs/cli.md` and `abstractflow/cli.py`.
161
+
162
+ ## Related projects
163
+
164
+ - AbstractRuntime (durable execution kernel): https://github.com/lpalbou/AbstractRuntime
165
+ - AbstractCore (providers/models/tools): https://github.com/lpalbou/AbstractCore
166
+ - AbstractAgent (ReAct/CodeAct): https://github.com/lpalbou/AbstractAgent
167
+
168
+ ## Changelog
169
+
170
+ See `CHANGELOG.md`.
171
+
172
+ ## Contributing
173
+
174
+ See `CONTRIBUTING.md`.
175
+
176
+ ## Security
177
+
178
+ See `SECURITY.md`.
179
+
180
+ ## Acknowledgments
181
+
182
+ See `ACKNOWLEDMENTS.md`.
183
+
184
+ ## License
185
+
186
+ MIT. See `LICENSE`.
@@ -0,0 +1,133 @@
1
+ # AbstractFlow
2
+
3
+ Diagram-based, **durable** AI workflows for Python.
4
+
5
+ AbstractFlow provides:
6
+ - A portable workflow format (`VisualFlow` JSON) and helpers to execute it from any host (`abstractflow.visual`).
7
+ - A simple programmatic API (`Flow`, `FlowRunner`) backed by **AbstractRuntime**.
8
+ - A reference visual editor app in `web/` (FastAPI backend + React frontend).
9
+
10
+ Project status: **Pre-alpha** (`pyproject.toml`: `Development Status :: 2 - Pre-Alpha`). Expect breaking changes.
11
+
12
+ ## Capabilities (implemented)
13
+
14
+ - Execute programmatic flows (`Flow` → `FlowRunner`) with a default in-memory runtime.
15
+ - Execute portable `VisualFlow` JSON from any host process (`abstractflow.visual`).
16
+ - Durable waits and resumption via AbstractRuntime (e.g. user/event/schedule waits).
17
+ - Package a flow tree as a WorkflowBundle (`.flow`) via the CLI.
18
+ - Author/run VisualFlows in the reference web editor (`web/`).
19
+
20
+ Evidence (code): `abstractflow/runner.py`, `abstractflow/visual/executor.py`, `abstractflow/cli.py`, `web/backend/routes/ws.py`.
21
+
22
+ ## Docs
23
+
24
+ - Start here: `docs/getting-started.md`
25
+ - API reference: `docs/api.md`
26
+ - VisualFlow format: `docs/visualflow.md`
27
+ - Visual editor: `docs/web-editor.md`
28
+ - CLI: `docs/cli.md`
29
+ - FAQ: `docs/faq.md`
30
+ - Architecture: `docs/architecture.md`
31
+ - Docs index: `docs/README.md`
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ pip install abstractflow
37
+ ```
38
+
39
+ Requirements: Python **3.10+** (`pyproject.toml`: `requires-python`).
40
+
41
+ Optional extras:
42
+ - Agent nodes (ReAct workflows): `pip install "abstractflow[agent]"`
43
+ - Dev tools (tests/formatting): `pip install "abstractflow[dev]"`
44
+
45
+ Notes:
46
+ - `abstractflow` depends on `AbstractRuntime` and `abstractcore[tools]` (see `pyproject.toml`).
47
+ - Some VisualFlow node types require additional packages (e.g. `memory_kg_*` nodes need `abstractmemory`).
48
+
49
+ ## Quickstart (programmatic)
50
+
51
+ ```python
52
+ from abstractflow import Flow, FlowRunner
53
+
54
+ flow = Flow("linear")
55
+ flow.add_node("double", lambda x: x * 2, input_key="value", output_key="doubled")
56
+ flow.add_node("add_ten", lambda x: x + 10, input_key="doubled", output_key="final")
57
+ flow.add_edge("double", "add_ten")
58
+ flow.set_entry("double")
59
+
60
+ result = FlowRunner(flow).run({"value": 5})
61
+ print(result) # {"success": True, "result": 20}
62
+ ```
63
+
64
+ ## Quickstart (execute a VisualFlow JSON)
65
+
66
+ ```python
67
+ import json
68
+ from abstractflow.visual import VisualFlow, execute_visual_flow
69
+
70
+ with open("my-flow.json", "r", encoding="utf-8") as f:
71
+ vf = VisualFlow.model_validate(json.load(f))
72
+ result = execute_visual_flow(vf, {"prompt": "Hello"}, flows={vf.id: vf})
73
+ print(result) # {"success": True, "waiting": False, "result": ...}
74
+ ```
75
+
76
+ If your flow uses subflows, load all referenced `*.json` into the `flows={...}` mapping (see `docs/getting-started.md`).
77
+
78
+ ## Visual editor (from source)
79
+
80
+ The visual editor is a dev/reference app in `web/` (not shipped as a Python package on PyPI).
81
+
82
+ ```bash
83
+ git clone https://github.com/lpalbou/AbstractFlow.git
84
+ cd AbstractFlow
85
+
86
+ python -m venv .venv
87
+ source .venv/bin/activate
88
+ pip install -e ".[server,agent]"
89
+
90
+ # Terminal 1: Backend (FastAPI)
91
+ cd web && python -m backend --reload --port 8080
92
+
93
+ # Terminal 2: Frontend (Vite)
94
+ cd web/frontend && npm install && npm run dev
95
+ ```
96
+
97
+ Open the frontend at http://localhost:3003 (default Vite port). See `docs/web-editor.md`.
98
+
99
+ ## CLI (WorkflowBundle `.flow`)
100
+
101
+ ```bash
102
+ abstractflow bundle pack web/flows/ac-echo.json --out /tmp/ac-echo.flow
103
+ abstractflow bundle inspect /tmp/ac-echo.flow
104
+ abstractflow bundle unpack /tmp/ac-echo.flow --dir /tmp/ac-echo
105
+ ```
106
+
107
+ See `docs/cli.md` and `abstractflow/cli.py`.
108
+
109
+ ## Related projects
110
+
111
+ - AbstractRuntime (durable execution kernel): https://github.com/lpalbou/AbstractRuntime
112
+ - AbstractCore (providers/models/tools): https://github.com/lpalbou/AbstractCore
113
+ - AbstractAgent (ReAct/CodeAct): https://github.com/lpalbou/AbstractAgent
114
+
115
+ ## Changelog
116
+
117
+ See `CHANGELOG.md`.
118
+
119
+ ## Contributing
120
+
121
+ See `CONTRIBUTING.md`.
122
+
123
+ ## Security
124
+
125
+ See `SECURITY.md`.
126
+
127
+ ## Acknowledgments
128
+
129
+ See `ACKNOWLEDMENTS.md`.
130
+
131
+ ## License
132
+
133
+ MIT. See `LICENSE`.
@@ -0,0 +1,91 @@
1
+ """AbstractFlow - Multi-agent orchestration layer for the Abstract Framework.
2
+
3
+ AbstractFlow enables composition of agents into pipelines and coordinates
4
+ their execution via AbstractRuntime. It provides:
5
+
6
+ - Flow: Declarative flow definition with nodes and edges
7
+ - FlowRunner: High-level interface for running flows
8
+ - compile_flow: Convert Flow to WorkflowSpec for direct runtime usage
9
+
10
+ Example:
11
+ >>> from abstractflow import Flow, FlowRunner
12
+ >>>
13
+ >>> # Define a simple flow
14
+ >>> flow = Flow("my_pipeline")
15
+ >>> flow.add_node("step1", lambda x: x * 2, input_key="value", output_key="doubled")
16
+ >>> flow.add_node("step2", lambda x: x + 10, input_key="doubled", output_key="result")
17
+ >>> flow.add_edge("step1", "step2")
18
+ >>> flow.set_entry("step1")
19
+ >>>
20
+ >>> # Run the flow
21
+ >>> runner = FlowRunner(flow)
22
+ >>> result = runner.run({"value": 5})
23
+ >>> print(result) # {'result': 20, 'success': True}
24
+
25
+ For agent-based flows:
26
+ >>> from abstractflow import Flow, FlowRunner
27
+ >>> from abstractagent import create_react_agent
28
+ >>>
29
+ >>> planner = create_react_agent(provider="ollama", model="qwen3:4b")
30
+ >>> executor = create_react_agent(provider="ollama", model="qwen3:4b")
31
+ >>>
32
+ >>> flow = Flow("plan_and_execute")
33
+ >>> flow.add_node("plan", planner, output_key="plan")
34
+ >>> flow.add_node("execute", executor, input_key="plan")
35
+ >>> flow.add_edge("plan", "execute")
36
+ >>> flow.set_entry("plan")
37
+ >>>
38
+ >>> runner = FlowRunner(flow)
39
+ >>> result = runner.run({"context": {"task": "Build a REST API"}})
40
+ """
41
+
42
+ __version__ = "0.3.1"
43
+ __author__ = "Laurent-Philippe Albou"
44
+ __email__ = "contact@abstractflow.ai"
45
+ __license__ = "MIT"
46
+
47
+ # Core classes
48
+ from .core.flow import Flow, FlowNode, FlowEdge
49
+
50
+ # Compiler
51
+ from .compiler import compile_flow
52
+
53
+ # Runner
54
+ from .runner import FlowRunner
55
+
56
+ # Adapters (for advanced usage)
57
+ from .adapters import (
58
+ create_function_node_handler,
59
+ create_agent_node_handler,
60
+ create_subflow_node_handler,
61
+ )
62
+
63
+ __all__ = [
64
+ # Version info
65
+ "__version__",
66
+ "__author__",
67
+ "__email__",
68
+ "__license__",
69
+ # Core classes
70
+ "Flow",
71
+ "FlowNode",
72
+ "FlowEdge",
73
+ # Compiler
74
+ "compile_flow",
75
+ # Runner
76
+ "FlowRunner",
77
+ # Adapters
78
+ "create_function_node_handler",
79
+ "create_agent_node_handler",
80
+ "create_subflow_node_handler",
81
+ ]
82
+
83
+
84
+ def get_version() -> str:
85
+ """Get the current version of AbstractFlow."""
86
+ return __version__
87
+
88
+
89
+ def is_development_version() -> bool:
90
+ """Check if this is a development version."""
91
+ return False # Now implemented!
@@ -8,3 +8,5 @@ from .cli import main
8
8
 
9
9
  if __name__ == "__main__":
10
10
  exit(main())
11
+
12
+
@@ -0,0 +1,11 @@
1
+ """AbstractFlow adapters for converting handlers to workflow nodes."""
2
+
3
+ from .function_adapter import create_function_node_handler
4
+ from .agent_adapter import create_agent_node_handler
5
+ from .subflow_adapter import create_subflow_node_handler
6
+
7
+ __all__ = [
8
+ "create_function_node_handler",
9
+ "create_agent_node_handler",
10
+ "create_subflow_node_handler",
11
+ ]
@@ -0,0 +1,5 @@
1
+ """Re-export: AbstractRuntime VisualFlow compiler adapter."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from abstractruntime.visualflow_compiler.adapters.agent_adapter import * # noqa: F401,F403
@@ -0,0 +1,5 @@
1
+ """Re-export: AbstractRuntime VisualFlow compiler adapter."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from abstractruntime.visualflow_compiler.adapters.control_adapter import * # noqa: F401,F403
@@ -0,0 +1,5 @@
1
+ """Re-export: AbstractRuntime VisualFlow compiler adapter."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from abstractruntime.visualflow_compiler.adapters.effect_adapter import * # noqa: F401,F403
@@ -0,0 +1,5 @@
1
+ """Re-export: AbstractRuntime VisualFlow compiler adapter."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from abstractruntime.visualflow_compiler.adapters.event_adapter import * # noqa: F401,F403
@@ -0,0 +1,5 @@
1
+ """Re-export: AbstractRuntime VisualFlow compiler adapter."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from abstractruntime.visualflow_compiler.adapters.function_adapter import * # noqa: F401,F403
@@ -0,0 +1,5 @@
1
+ """Re-export: AbstractRuntime VisualFlow compiler adapter."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from abstractruntime.visualflow_compiler.adapters.subflow_adapter import * # noqa: F401,F403
@@ -0,0 +1,5 @@
1
+ """Re-export: AbstractRuntime VisualFlow compiler adapter."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from abstractruntime.visualflow_compiler.adapters.variable_adapter import * # noqa: F401,F403