flowengine 0.3.1 → 0.4.1
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.
- checksums.yaml +4 -4
- data/.envrc +1 -0
- data/Brewfile +28 -0
- data/README.md +348 -888
- data/docs/PROJECT_STRUCTURE.md +64 -0
- data/docs/flowengine-processing.png +0 -0
- data/docs/tty-prompt.md +1746 -0
- data/examples/README.md +14 -0
- data/examples/chat_history__complex.yml +22 -0
- data/examples/chat_history__simple.yml +1 -0
- data/examples/final_estimate__complex.yml +58 -0
- data/examples/final_estimate__simple.yml +50 -0
- data/lefthook.yml +16 -0
- data/lib/flowengine/llm/adapters/anthropic_adapter.rb +17 -0
- data/lib/flowengine/llm/adapters/gemini_adapter.rb +17 -0
- data/lib/flowengine/llm/adapters/openai_adapter.rb +17 -0
- data/lib/flowengine/version.rb +1 -1
- metadata +43 -2
- /data/docs/{floweingine-architecture.png → flowengine-architecture.png} +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Project Structure
|
|
2
|
+
|
|
3
|
+
```text
|
|
4
|
+
lib/flowengine/
|
|
5
|
+
flowengine.rb # Module entry: define() and load_dsl()
|
|
6
|
+
version.rb # VERSION = "0.3.1"
|
|
7
|
+
errors.rb # Error hierarchy (8 classes)
|
|
8
|
+
clarification_result.rb # Data.define for AI intake round results
|
|
9
|
+
introduction.rb # Data.define(:label, :placeholder, :maxlength)
|
|
10
|
+
definition.rb # Immutable flow graph container
|
|
11
|
+
node.rb # Single flow step (question, type, transitions, max_clarifications)
|
|
12
|
+
transition.rb # Directed edge with optional rule condition
|
|
13
|
+
evaluator.rb # Rule evaluation against answers
|
|
14
|
+
engine.rb # Runtime session (answers, history, navigation, AI intake state)
|
|
15
|
+
engine/
|
|
16
|
+
state_serializer.rb # Symbolizes string-keyed state from JSON round-trips
|
|
17
|
+
dsl/
|
|
18
|
+
flow_builder.rb # FlowEngine.define {} context (start, introduction, step)
|
|
19
|
+
step_builder.rb # step {} block builder (includes max_clarifications)
|
|
20
|
+
rule_helpers.rb # contains(), equals(), all(), any(), etc.
|
|
21
|
+
rules/
|
|
22
|
+
base.rb # Abstract rule (evaluate + to_s)
|
|
23
|
+
contains.rb # Array.include? semantics
|
|
24
|
+
equals.rb # Simple equality
|
|
25
|
+
greater_than.rb # Numeric > comparison (coerces to_i)
|
|
26
|
+
less_than.rb # Numeric < comparison (coerces to_i)
|
|
27
|
+
not_empty.rb # !nil && !empty?
|
|
28
|
+
all.rb # Composite AND
|
|
29
|
+
any.rb # Composite OR
|
|
30
|
+
validation/
|
|
31
|
+
adapter.rb # Abstract validator interface
|
|
32
|
+
null_adapter.rb # No-op default validator
|
|
33
|
+
llm/
|
|
34
|
+
adapter.rb # Abstract LLM adapter interface
|
|
35
|
+
adapters.rb # Requires all concrete adapters
|
|
36
|
+
auto_client.rb # FlowEngine::LLM.auto_client factory
|
|
37
|
+
provider.rb # Provider/model registry from models.yml
|
|
38
|
+
client.rb # High-level LLM client (prompt building + response parsing)
|
|
39
|
+
system_prompt_builder.rb # Builds system prompt for introduction pre-fill
|
|
40
|
+
intake_prompt_builder.rb # Builds system prompt for AI intake steps
|
|
41
|
+
sensitive_data_filter.rb # Rejects SSN, ITIN, EIN patterns
|
|
42
|
+
graph/
|
|
43
|
+
mermaid_exporter.rb # Exports Definition to Mermaid diagram
|
|
44
|
+
resources/
|
|
45
|
+
models.yml # Vendor/model registry (Anthropic, OpenAI, Gemini)
|
|
46
|
+
prompts/
|
|
47
|
+
generic-dsl-intake.j2 # Static system prompt template for LLM parsing
|
|
48
|
+
spec/
|
|
49
|
+
flowengine_spec.rb # Top-level define/load_dsl tests
|
|
50
|
+
flowengine/ # Mirrors lib/ structure
|
|
51
|
+
engine_spec.rb # Core engine tests
|
|
52
|
+
engine_ai_intake_spec.rb # AI intake step tests
|
|
53
|
+
engine_introduction_spec.rb # Introduction pre-fill tests
|
|
54
|
+
engine_state_spec.rb # State persistence tests
|
|
55
|
+
clarification_result_spec.rb
|
|
56
|
+
llm/ # LLM adapter, client, filter, prompt builder specs
|
|
57
|
+
integration/
|
|
58
|
+
introduction_flow_spec.rb # Introduction + LLM pre-fill integration
|
|
59
|
+
multi_ai_intake_spec.rb # Multi-AI intake integration test
|
|
60
|
+
tax_intake_flow_spec.rb # Real-world tax intake example
|
|
61
|
+
complex_flow_spec.rb # Complex branching tests
|
|
62
|
+
fixtures/
|
|
63
|
+
complex_tax_intake.rb # 17-step tax intake flow definition
|
|
64
|
+
```
|
|
Binary file
|