flow-forge-ai-sdk-ui 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- flow_forge_ai_sdk_ui-0.1.0/PKG-INFO +139 -0
- flow_forge_ai_sdk_ui-0.1.0/README.md +122 -0
- flow_forge_ai_sdk_ui-0.1.0/pyproject.toml +51 -0
- flow_forge_ai_sdk_ui-0.1.0/setup.cfg +4 -0
- flow_forge_ai_sdk_ui-0.1.0/src/flow_forge_ai_sdk_ui.egg-info/PKG-INFO +139 -0
- flow_forge_ai_sdk_ui-0.1.0/src/flow_forge_ai_sdk_ui.egg-info/SOURCES.txt +14 -0
- flow_forge_ai_sdk_ui-0.1.0/src/flow_forge_ai_sdk_ui.egg-info/dependency_links.txt +1 -0
- flow_forge_ai_sdk_ui-0.1.0/src/flow_forge_ai_sdk_ui.egg-info/entry_points.txt +2 -0
- flow_forge_ai_sdk_ui-0.1.0/src/flow_forge_ai_sdk_ui.egg-info/requires.txt +6 -0
- flow_forge_ai_sdk_ui-0.1.0/src/flow_forge_ai_sdk_ui.egg-info/top_level.txt +1 -0
- flow_forge_ai_sdk_ui-0.1.0/src/flow_forge_ai_ui/__init__.py +0 -0
- flow_forge_ai_sdk_ui-0.1.0/src/flow_forge_ai_ui/app.py +68 -0
- flow_forge_ai_sdk_ui-0.1.0/src/flow_forge_ai_ui/routes.py +180 -0
- flow_forge_ai_sdk_ui-0.1.0/src/flow_forge_ai_ui/static/js/dayjs.min.js +1 -0
- flow_forge_ai_sdk_ui-0.1.0/src/flow_forge_ai_ui/templates/index.html +1313 -0
- flow_forge_ai_sdk_ui-0.1.0/tests/test_ui_routes.py +88 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: flow-forge-ai-sdk-ui
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Debug UI for flow-forge-ai workflows.
|
|
5
|
+
Author-email: Alon Yampolski <yampolski.a@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/alonzo86/flow-forge-ai
|
|
8
|
+
Project-URL: Repository, https://github.com/alonzo86/flow-forge-ai
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: flow-forge-ai-sdk>=0.1.0
|
|
12
|
+
Requires-Dist: httpx>=0.24.0
|
|
13
|
+
Requires-Dist: fastapi>=0.115.0
|
|
14
|
+
Requires-Dist: uvicorn>=0.35.0
|
|
15
|
+
Requires-Dist: jinja2>=3.1.0
|
|
16
|
+
Requires-Dist: python-multipart>=0.0.20
|
|
17
|
+
|
|
18
|
+
# flow-forge-ai-ui
|
|
19
|
+
|
|
20
|
+
Web UI for browsing and replaying [flow-forge-ai](../core/) workflow runs.
|
|
21
|
+
|
|
22
|
+
[](#installation)
|
|
23
|
+
[](#)
|
|
24
|
+
|
|
25
|
+
## What It Does
|
|
26
|
+
|
|
27
|
+
- Connects to the runtime listener started by `flow-forge-ai`
|
|
28
|
+
- Displays a list of recorded runs and their steps/events
|
|
29
|
+
- Lets you trigger and monitor workflow replays from the browser
|
|
30
|
+
|
|
31
|
+
## Requirements
|
|
32
|
+
|
|
33
|
+
- `flow-forge-ai` installed and configured with `[runtime].enable = true`
|
|
34
|
+
- The runtime listener must be reachable at the configured `listener_host:listener_port`
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
cd ui
|
|
40
|
+
pip install -e .
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or install via the `ui` extra from the core package:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
cd core
|
|
47
|
+
pip install -e ".[ui]"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Starting the UI
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
flow-forge-ai-ui
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
By default the server listens on `http://127.0.0.1:8080`.
|
|
57
|
+
|
|
58
|
+
### Options
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
flow-forge-ai-ui --host 0.0.0.0 --port 9090
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
| Flag | Default | Description |
|
|
65
|
+
|------|---------|-------------|
|
|
66
|
+
| `-H` / `--host` | `127.0.0.1` | Bind address |
|
|
67
|
+
| `-p` / `--port` | `8080` | Port |
|
|
68
|
+
|
|
69
|
+
## Configuration
|
|
70
|
+
|
|
71
|
+
The UI reads `config.toml` from the **current working directory** (the same file used by the core runtime). It uses the `[runtime]` section to locate the listener:
|
|
72
|
+
|
|
73
|
+
```toml
|
|
74
|
+
[runtime]
|
|
75
|
+
enable = true
|
|
76
|
+
listener_host = "127.0.0.1"
|
|
77
|
+
listener_port = 7070
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Make sure the runtime listener is started before opening the UI. The core package starts the listener automatically when a workflow run begins inside an instrumented process.
|
|
81
|
+
|
|
82
|
+
## Usage
|
|
83
|
+
|
|
84
|
+
1. Start your workflow in another terminal (the core runtime listener starts automatically):
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
cd core/examples/02_ollama_workflow_decorator
|
|
88
|
+
python example.py
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
2. Start the UI from the directory containing `config.toml`:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
flow-forge-ai-ui
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
3. Open `http://127.0.0.1:8080` in your browser.
|
|
98
|
+
|
|
99
|
+
The UI shows all recorded runs. Select a run to inspect its steps and events, or trigger a replay.
|
|
100
|
+
|
|
101
|
+
## API Routes
|
|
102
|
+
|
|
103
|
+
The UI itself is a thin FastAPI app that proxies requests to the core runtime listener. It exposes the following routes:
|
|
104
|
+
|
|
105
|
+
| Method | Path | Description |
|
|
106
|
+
|--------|------|-------------|
|
|
107
|
+
| `GET` | `/` | Main UI page (HTML) |
|
|
108
|
+
| `GET` | `/api/runs` | Proxy: list runs |
|
|
109
|
+
| `GET` | `/api/steps` | Proxy: list steps for a run |
|
|
110
|
+
| `POST` | `/api/runs/{run_id}/replay` | Proxy: start replay |
|
|
111
|
+
| `GET` | `/api/runs/{run_id}/replay` | Proxy: get replay status |
|
|
112
|
+
| `DELETE` | `/api/runs/{run_id}/replay` | Proxy: stop replay |
|
|
113
|
+
|
|
114
|
+
## Package Layout
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
ui/
|
|
118
|
+
├── src/flow_forge_ai_ui/
|
|
119
|
+
│ ├── app.py # FastAPI app factory and CLI entry point
|
|
120
|
+
│ ├── routes.py # Route handlers and runtime proxy client
|
|
121
|
+
│ ├── templates/ # Jinja2 HTML templates
|
|
122
|
+
│ └── static/ # JS and static assets
|
|
123
|
+
└── tests/
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Development
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Install dev dependencies (from core package which includes UI dev deps)
|
|
130
|
+
cd core
|
|
131
|
+
pip install -e ".[dev]"
|
|
132
|
+
|
|
133
|
+
# Run UI tests
|
|
134
|
+
cd ui
|
|
135
|
+
pytest
|
|
136
|
+
|
|
137
|
+
# Run tests with coverage
|
|
138
|
+
pytest --cov=flow_forge_ai_ui --cov-report=term-missing
|
|
139
|
+
```
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# flow-forge-ai-ui
|
|
2
|
+
|
|
3
|
+
Web UI for browsing and replaying [flow-forge-ai](../core/) workflow runs.
|
|
4
|
+
|
|
5
|
+
[](#installation)
|
|
6
|
+
[](#)
|
|
7
|
+
|
|
8
|
+
## What It Does
|
|
9
|
+
|
|
10
|
+
- Connects to the runtime listener started by `flow-forge-ai`
|
|
11
|
+
- Displays a list of recorded runs and their steps/events
|
|
12
|
+
- Lets you trigger and monitor workflow replays from the browser
|
|
13
|
+
|
|
14
|
+
## Requirements
|
|
15
|
+
|
|
16
|
+
- `flow-forge-ai` installed and configured with `[runtime].enable = true`
|
|
17
|
+
- The runtime listener must be reachable at the configured `listener_host:listener_port`
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
cd ui
|
|
23
|
+
pip install -e .
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or install via the `ui` extra from the core package:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
cd core
|
|
30
|
+
pip install -e ".[ui]"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Starting the UI
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
flow-forge-ai-ui
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
By default the server listens on `http://127.0.0.1:8080`.
|
|
40
|
+
|
|
41
|
+
### Options
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
flow-forge-ai-ui --host 0.0.0.0 --port 9090
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
| Flag | Default | Description |
|
|
48
|
+
|------|---------|-------------|
|
|
49
|
+
| `-H` / `--host` | `127.0.0.1` | Bind address |
|
|
50
|
+
| `-p` / `--port` | `8080` | Port |
|
|
51
|
+
|
|
52
|
+
## Configuration
|
|
53
|
+
|
|
54
|
+
The UI reads `config.toml` from the **current working directory** (the same file used by the core runtime). It uses the `[runtime]` section to locate the listener:
|
|
55
|
+
|
|
56
|
+
```toml
|
|
57
|
+
[runtime]
|
|
58
|
+
enable = true
|
|
59
|
+
listener_host = "127.0.0.1"
|
|
60
|
+
listener_port = 7070
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Make sure the runtime listener is started before opening the UI. The core package starts the listener automatically when a workflow run begins inside an instrumented process.
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
1. Start your workflow in another terminal (the core runtime listener starts automatically):
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
cd core/examples/02_ollama_workflow_decorator
|
|
71
|
+
python example.py
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
2. Start the UI from the directory containing `config.toml`:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
flow-forge-ai-ui
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
3. Open `http://127.0.0.1:8080` in your browser.
|
|
81
|
+
|
|
82
|
+
The UI shows all recorded runs. Select a run to inspect its steps and events, or trigger a replay.
|
|
83
|
+
|
|
84
|
+
## API Routes
|
|
85
|
+
|
|
86
|
+
The UI itself is a thin FastAPI app that proxies requests to the core runtime listener. It exposes the following routes:
|
|
87
|
+
|
|
88
|
+
| Method | Path | Description |
|
|
89
|
+
|--------|------|-------------|
|
|
90
|
+
| `GET` | `/` | Main UI page (HTML) |
|
|
91
|
+
| `GET` | `/api/runs` | Proxy: list runs |
|
|
92
|
+
| `GET` | `/api/steps` | Proxy: list steps for a run |
|
|
93
|
+
| `POST` | `/api/runs/{run_id}/replay` | Proxy: start replay |
|
|
94
|
+
| `GET` | `/api/runs/{run_id}/replay` | Proxy: get replay status |
|
|
95
|
+
| `DELETE` | `/api/runs/{run_id}/replay` | Proxy: stop replay |
|
|
96
|
+
|
|
97
|
+
## Package Layout
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
ui/
|
|
101
|
+
├── src/flow_forge_ai_ui/
|
|
102
|
+
│ ├── app.py # FastAPI app factory and CLI entry point
|
|
103
|
+
│ ├── routes.py # Route handlers and runtime proxy client
|
|
104
|
+
│ ├── templates/ # Jinja2 HTML templates
|
|
105
|
+
│ └── static/ # JS and static assets
|
|
106
|
+
└── tests/
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Development
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Install dev dependencies (from core package which includes UI dev deps)
|
|
113
|
+
cd core
|
|
114
|
+
pip install -e ".[dev]"
|
|
115
|
+
|
|
116
|
+
# Run UI tests
|
|
117
|
+
cd ui
|
|
118
|
+
pytest
|
|
119
|
+
|
|
120
|
+
# Run tests with coverage
|
|
121
|
+
pytest --cov=flow_forge_ai_ui --cov-report=term-missing
|
|
122
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[project]
|
|
7
|
+
name = "flow-forge-ai-sdk-ui"
|
|
8
|
+
version = "0.1.0"
|
|
9
|
+
description = "Debug UI for flow-forge-ai workflows."
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
|
|
13
|
+
license = "MIT"
|
|
14
|
+
|
|
15
|
+
authors = [
|
|
16
|
+
{ name = "Alon Yampolski", email = "yampolski.a@gmail.com" }
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
dependencies = [
|
|
21
|
+
"flow-forge-ai-sdk>=0.1.0",
|
|
22
|
+
"httpx>=0.24.0",
|
|
23
|
+
"fastapi>=0.115.0",
|
|
24
|
+
"uvicorn>=0.35.0",
|
|
25
|
+
"jinja2>=3.1.0",
|
|
26
|
+
"python-multipart>=0.0.20",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
[project.scripts]
|
|
31
|
+
flow-forge-ai-ui = "flow_forge_ai_ui.app:main"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://github.com/alonzo86/flow-forge-ai"
|
|
36
|
+
Repository = "https://github.com/alonzo86/flow-forge-ai"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
[tool.setuptools.packages.find]
|
|
40
|
+
where = ["src"]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
[tool.setuptools.package-data]
|
|
44
|
+
flow_forge_ai_ui = [
|
|
45
|
+
"templates/**/*.html",
|
|
46
|
+
"static/**/*",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
[tool.pytest.ini_options]
|
|
50
|
+
pythonpath = ["src", "tests"]
|
|
51
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: flow-forge-ai-sdk-ui
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Debug UI for flow-forge-ai workflows.
|
|
5
|
+
Author-email: Alon Yampolski <yampolski.a@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/alonzo86/flow-forge-ai
|
|
8
|
+
Project-URL: Repository, https://github.com/alonzo86/flow-forge-ai
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: flow-forge-ai-sdk>=0.1.0
|
|
12
|
+
Requires-Dist: httpx>=0.24.0
|
|
13
|
+
Requires-Dist: fastapi>=0.115.0
|
|
14
|
+
Requires-Dist: uvicorn>=0.35.0
|
|
15
|
+
Requires-Dist: jinja2>=3.1.0
|
|
16
|
+
Requires-Dist: python-multipart>=0.0.20
|
|
17
|
+
|
|
18
|
+
# flow-forge-ai-ui
|
|
19
|
+
|
|
20
|
+
Web UI for browsing and replaying [flow-forge-ai](../core/) workflow runs.
|
|
21
|
+
|
|
22
|
+
[](#installation)
|
|
23
|
+
[](#)
|
|
24
|
+
|
|
25
|
+
## What It Does
|
|
26
|
+
|
|
27
|
+
- Connects to the runtime listener started by `flow-forge-ai`
|
|
28
|
+
- Displays a list of recorded runs and their steps/events
|
|
29
|
+
- Lets you trigger and monitor workflow replays from the browser
|
|
30
|
+
|
|
31
|
+
## Requirements
|
|
32
|
+
|
|
33
|
+
- `flow-forge-ai` installed and configured with `[runtime].enable = true`
|
|
34
|
+
- The runtime listener must be reachable at the configured `listener_host:listener_port`
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
cd ui
|
|
40
|
+
pip install -e .
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or install via the `ui` extra from the core package:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
cd core
|
|
47
|
+
pip install -e ".[ui]"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Starting the UI
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
flow-forge-ai-ui
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
By default the server listens on `http://127.0.0.1:8080`.
|
|
57
|
+
|
|
58
|
+
### Options
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
flow-forge-ai-ui --host 0.0.0.0 --port 9090
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
| Flag | Default | Description |
|
|
65
|
+
|------|---------|-------------|
|
|
66
|
+
| `-H` / `--host` | `127.0.0.1` | Bind address |
|
|
67
|
+
| `-p` / `--port` | `8080` | Port |
|
|
68
|
+
|
|
69
|
+
## Configuration
|
|
70
|
+
|
|
71
|
+
The UI reads `config.toml` from the **current working directory** (the same file used by the core runtime). It uses the `[runtime]` section to locate the listener:
|
|
72
|
+
|
|
73
|
+
```toml
|
|
74
|
+
[runtime]
|
|
75
|
+
enable = true
|
|
76
|
+
listener_host = "127.0.0.1"
|
|
77
|
+
listener_port = 7070
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Make sure the runtime listener is started before opening the UI. The core package starts the listener automatically when a workflow run begins inside an instrumented process.
|
|
81
|
+
|
|
82
|
+
## Usage
|
|
83
|
+
|
|
84
|
+
1. Start your workflow in another terminal (the core runtime listener starts automatically):
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
cd core/examples/02_ollama_workflow_decorator
|
|
88
|
+
python example.py
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
2. Start the UI from the directory containing `config.toml`:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
flow-forge-ai-ui
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
3. Open `http://127.0.0.1:8080` in your browser.
|
|
98
|
+
|
|
99
|
+
The UI shows all recorded runs. Select a run to inspect its steps and events, or trigger a replay.
|
|
100
|
+
|
|
101
|
+
## API Routes
|
|
102
|
+
|
|
103
|
+
The UI itself is a thin FastAPI app that proxies requests to the core runtime listener. It exposes the following routes:
|
|
104
|
+
|
|
105
|
+
| Method | Path | Description |
|
|
106
|
+
|--------|------|-------------|
|
|
107
|
+
| `GET` | `/` | Main UI page (HTML) |
|
|
108
|
+
| `GET` | `/api/runs` | Proxy: list runs |
|
|
109
|
+
| `GET` | `/api/steps` | Proxy: list steps for a run |
|
|
110
|
+
| `POST` | `/api/runs/{run_id}/replay` | Proxy: start replay |
|
|
111
|
+
| `GET` | `/api/runs/{run_id}/replay` | Proxy: get replay status |
|
|
112
|
+
| `DELETE` | `/api/runs/{run_id}/replay` | Proxy: stop replay |
|
|
113
|
+
|
|
114
|
+
## Package Layout
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
ui/
|
|
118
|
+
├── src/flow_forge_ai_ui/
|
|
119
|
+
│ ├── app.py # FastAPI app factory and CLI entry point
|
|
120
|
+
│ ├── routes.py # Route handlers and runtime proxy client
|
|
121
|
+
│ ├── templates/ # Jinja2 HTML templates
|
|
122
|
+
│ └── static/ # JS and static assets
|
|
123
|
+
└── tests/
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Development
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Install dev dependencies (from core package which includes UI dev deps)
|
|
130
|
+
cd core
|
|
131
|
+
pip install -e ".[dev]"
|
|
132
|
+
|
|
133
|
+
# Run UI tests
|
|
134
|
+
cd ui
|
|
135
|
+
pytest
|
|
136
|
+
|
|
137
|
+
# Run tests with coverage
|
|
138
|
+
pytest --cov=flow_forge_ai_ui --cov-report=term-missing
|
|
139
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/flow_forge_ai_sdk_ui.egg-info/PKG-INFO
|
|
4
|
+
src/flow_forge_ai_sdk_ui.egg-info/SOURCES.txt
|
|
5
|
+
src/flow_forge_ai_sdk_ui.egg-info/dependency_links.txt
|
|
6
|
+
src/flow_forge_ai_sdk_ui.egg-info/entry_points.txt
|
|
7
|
+
src/flow_forge_ai_sdk_ui.egg-info/requires.txt
|
|
8
|
+
src/flow_forge_ai_sdk_ui.egg-info/top_level.txt
|
|
9
|
+
src/flow_forge_ai_ui/__init__.py
|
|
10
|
+
src/flow_forge_ai_ui/app.py
|
|
11
|
+
src/flow_forge_ai_ui/routes.py
|
|
12
|
+
src/flow_forge_ai_ui/static/js/dayjs.min.js
|
|
13
|
+
src/flow_forge_ai_ui/templates/index.html
|
|
14
|
+
tests/test_ui_routes.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
flow_forge_ai_ui
|
|
File without changes
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import AsyncGenerator
|
|
5
|
+
|
|
6
|
+
import uvicorn
|
|
7
|
+
from fastapi.concurrency import asynccontextmanager
|
|
8
|
+
from fastapi import FastAPI
|
|
9
|
+
from fastapi.staticfiles import StaticFiles
|
|
10
|
+
from fastapi.templating import Jinja2Templates
|
|
11
|
+
|
|
12
|
+
from flow_forge_ai.config.config_handler import get_config_handler
|
|
13
|
+
from flow_forge_ai_ui.routes import router, initialize_client
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
BASE_DIR = Path(__file__).parent
|
|
17
|
+
TEMPLATES_DIR = BASE_DIR / "templates"
|
|
18
|
+
STATIC_DIR = BASE_DIR / "static"
|
|
19
|
+
|
|
20
|
+
def format_datetime(value: str) -> str:
|
|
21
|
+
return datetime.fromisoformat(value).strftime("%Y-%m-%d %H:%M:%S")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@asynccontextmanager
|
|
25
|
+
async def lifespan(_app: FastAPI) -> AsyncGenerator:
|
|
26
|
+
config = get_config_handler()
|
|
27
|
+
try:
|
|
28
|
+
runtime_cfg = config.get_runtime_config()
|
|
29
|
+
except Exception as ex:
|
|
30
|
+
raise RuntimeError("Failed to load runtime configuration from config handler") from ex
|
|
31
|
+
initialize_client(runtime_cfg)
|
|
32
|
+
yield
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
app = FastAPI(
|
|
36
|
+
title="AI Execution Infra UI",
|
|
37
|
+
lifespan=lifespan,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
app.include_router(router)
|
|
41
|
+
|
|
42
|
+
if STATIC_DIR.exists():
|
|
43
|
+
app.mount(
|
|
44
|
+
"/static",
|
|
45
|
+
StaticFiles(directory=STATIC_DIR),
|
|
46
|
+
name="static",
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
templates = Jinja2Templates(directory=TEMPLATES_DIR)
|
|
50
|
+
templates.env.filters["format_datetime"] = format_datetime
|
|
51
|
+
app.state.templates = templates
|
|
52
|
+
|
|
53
|
+
def main() -> None:
|
|
54
|
+
parser = argparse.ArgumentParser(description="Run the Flow Forge AI UI.")
|
|
55
|
+
parser.add_argument("-H", "--host", type=str, default="127.0.0.1", help="Host address (optional)")
|
|
56
|
+
parser.add_argument("-p", "--port", type=int, default=8080, help="Port number (optional)")
|
|
57
|
+
|
|
58
|
+
args = parser.parse_args()
|
|
59
|
+
|
|
60
|
+
uvicorn.run(
|
|
61
|
+
"flow_forge_ai_ui.app:app",
|
|
62
|
+
host=args.host,
|
|
63
|
+
port=args.port,
|
|
64
|
+
reload=False,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
if __name__ == "__main__":
|
|
68
|
+
main()
|