abstractgateway 0.1.0__py3-none-any.whl
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.
- abstractgateway/__init__.py +11 -0
- abstractgateway/app.py +55 -0
- abstractgateway/cli.py +30 -0
- abstractgateway/config.py +94 -0
- abstractgateway/hosts/__init__.py +6 -0
- abstractgateway/hosts/bundle_host.py +626 -0
- abstractgateway/hosts/visualflow_host.py +213 -0
- abstractgateway/routes/__init__.py +5 -0
- abstractgateway/routes/gateway.py +393 -0
- abstractgateway/runner.py +429 -0
- abstractgateway/security/__init__.py +5 -0
- abstractgateway/security/gateway_security.py +504 -0
- abstractgateway/service.py +134 -0
- abstractgateway/stores.py +34 -0
- abstractgateway-0.1.0.dist-info/METADATA +101 -0
- abstractgateway-0.1.0.dist-info/RECORD +18 -0
- abstractgateway-0.1.0.dist-info/WHEEL +4 -0
- abstractgateway-0.1.0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: abstractgateway
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AbstractGateway: deployable Run Gateway host for AbstractRuntime (commands + ledger).
|
|
5
|
+
Project-URL: GitHub, https://github.com/lpalbou/abstractgateway
|
|
6
|
+
Author: Laurent-Philippe Albou
|
|
7
|
+
License: MIT
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Requires-Dist: abstractruntime>=0.4.0
|
|
10
|
+
Requires-Dist: fastapi>=0.100.0
|
|
11
|
+
Requires-Dist: uvicorn[standard]>=0.23.0
|
|
12
|
+
Provides-Extra: dev
|
|
13
|
+
Requires-Dist: httpx>=0.27.0; extra == 'dev'
|
|
14
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
15
|
+
Provides-Extra: visualflow
|
|
16
|
+
Requires-Dist: abstractflow>=0.3.0; extra == 'visualflow'
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# AbstractGateway
|
|
20
|
+
|
|
21
|
+
AbstractGateway is the **deployable Run Gateway host** for AbstractRuntime runs:
|
|
22
|
+
- durable command inbox
|
|
23
|
+
- ledger replay/stream
|
|
24
|
+
- security baseline (token + origin + limits)
|
|
25
|
+
|
|
26
|
+
This decouples the gateway service from any specific UI (AbstractFlow, AbstractCode, web/PWA thin clients).
|
|
27
|
+
|
|
28
|
+
## What it does (contract)
|
|
29
|
+
- Clients **act** by submitting durable commands: `start`, `resume`, `pause`, `cancel`, `emit_event`
|
|
30
|
+
- Clients **render** by replaying/streaming the durable ledger (cursor-based, replay-first)
|
|
31
|
+
|
|
32
|
+
Endpoints:
|
|
33
|
+
- `POST /api/gateway/runs/start`
|
|
34
|
+
- `GET /api/gateway/runs/{run_id}`
|
|
35
|
+
- `GET /api/gateway/runs/{run_id}/ledger`
|
|
36
|
+
- `GET /api/gateway/runs/{run_id}/ledger/stream` (SSE)
|
|
37
|
+
- `POST /api/gateway/commands`
|
|
38
|
+
|
|
39
|
+
## Install
|
|
40
|
+
|
|
41
|
+
### Default (bundle mode)
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install abstractgateway
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Bundle mode executes **WorkflowBundles** (`.flow`) via **WorkflowArtifacts** without importing `abstractflow`.
|
|
48
|
+
|
|
49
|
+
### Optional (compatibility): VisualFlow JSON
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install "abstractgateway[visualflow]"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
This mode depends on the **AbstractFlow compiler library** (`abstractflow`) to interpret VisualFlow JSON (it does **not** require the AbstractFlow web UI/app).
|
|
56
|
+
|
|
57
|
+
## Run
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
export ABSTRACTGATEWAY_DATA_DIR="./runtime"
|
|
61
|
+
export ABSTRACTGATEWAY_FLOWS_DIR="/path/to/bundles-or-flow"
|
|
62
|
+
|
|
63
|
+
# Security (recommended)
|
|
64
|
+
export ABSTRACTGATEWAY_AUTH_TOKEN="your-token"
|
|
65
|
+
export ABSTRACTGATEWAY_ALLOWED_ORIGINS="*"
|
|
66
|
+
|
|
67
|
+
abstractgateway serve --host 127.0.0.1 --port 8080
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Notes:
|
|
71
|
+
- `ABSTRACTGATEWAY_WORKFLOW_SOURCE` defaults to `bundle`. Valid values:
|
|
72
|
+
- `bundle` (default): `ABSTRACTGATEWAY_FLOWS_DIR` points to a directory containing `*.flow` bundles (or a single `.flow` file)
|
|
73
|
+
- `visualflow` (compat): `ABSTRACTGATEWAY_FLOWS_DIR` points to a directory containing `*.json` VisualFlow files
|
|
74
|
+
- For production, run behind HTTPS (reverse proxy) and set exact allowed origins.
|
|
75
|
+
|
|
76
|
+
## Creating a `.flow` bundle (authoring)
|
|
77
|
+
|
|
78
|
+
Use AbstractFlow to pack a bundle:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
abstractflow bundle pack /path/to/root.json --out /path/to/bundles/my.flow --flows-dir /path/to/flows
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Starting a run (bundle mode)
|
|
85
|
+
|
|
86
|
+
The stable way is to pass `bundle_id` + `flow_id`:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
curl -sS -X POST "http://localhost:8080/api/gateway/runs/start" \
|
|
90
|
+
-H "Content-Type: application/json" \
|
|
91
|
+
-H "Authorization: Bearer your-token" \
|
|
92
|
+
-d '{"bundle_id":"my-bundle","flow_id":"ac-echo","input_data":{}}'
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
For backwards-compatible clients, you can also pass a namespaced id as `flow_id` (`"my-bundle:ac-echo"`).
|
|
96
|
+
|
|
97
|
+
## Docs
|
|
98
|
+
- Architecture: `docs/architecture.md` (framework) and `abstractgateway/docs/architecture.md` (this package)
|
|
99
|
+
- Deployment: `docs/guide/deployment.md`
|
|
100
|
+
|
|
101
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
abstractgateway/__init__.py,sha256=JiTSUsov4YukN0mAmjzaQoSI5JDmwSrhf6KP0qVl2fY,281
|
|
2
|
+
abstractgateway/app.py,sha256=m6xQbTNnScc1XHtvnBCJiFCHt1AOun5v-7mrypSV5es,1541
|
|
3
|
+
abstractgateway/cli.py,sha256=q8uVDOqMyTxaCzsFvtFFHVAn0P4JtDabI0kCDuEDFvI,941
|
|
4
|
+
abstractgateway/config.py,sha256=V7HthrkWjR1XQaanGBW2npHiF2_lCZ7IqonisxAguw8,3150
|
|
5
|
+
abstractgateway/runner.py,sha256=3itMuGQvR3iJ5ITbxbaa2vhbYjGleGqKUNaq7AGqfFE,17080
|
|
6
|
+
abstractgateway/service.py,sha256=HfpNgmtXM9Q8LQnl0Ag1G99g79MqFbOPzmv4ondqJWE,4992
|
|
7
|
+
abstractgateway/stores.py,sha256=7Wlq5Zvmy5LWOGT5GBXfK9Se9MZu7IM6XUoqOXTpF-Q,1010
|
|
8
|
+
abstractgateway/hosts/__init__.py,sha256=RiIODYtCPUYeVPDKmVhqKLVwxw3D_NWdw4gnetVKdhA,170
|
|
9
|
+
abstractgateway/hosts/bundle_host.py,sha256=Ji3rR_DlhmJ2tqpQfCNpqKIVzjfNtnFZj3BCaUbLWwU,25380
|
|
10
|
+
abstractgateway/hosts/visualflow_host.py,sha256=xq90TYV1Ac4cSlXXwjvJZ4W1G2f6IzglTiWKntnq6Co,7554
|
|
11
|
+
abstractgateway/routes/__init__.py,sha256=qkxhZHLypa0-NlczRKA3wUmHsRXIx93HroBRc6g7BAo,78
|
|
12
|
+
abstractgateway/routes/gateway.py,sha256=ANTEuS6n-AaMBuBPFlZJ_kkpfbMN4uzyizso2P5p784,14747
|
|
13
|
+
abstractgateway/security/__init__.py,sha256=2pKIec_kuQ53_UAl0uij3u_1MInQOVDY_MF7ERr4Rgw,211
|
|
14
|
+
abstractgateway/security/gateway_security.py,sha256=1uhJ99i4Ifh24waqhNDO7euWnUZHmVOBMLIQxPoL2OE,18270
|
|
15
|
+
abstractgateway-0.1.0.dist-info/METADATA,sha256=lwOX7FB1yFLCfS1xMrO1RljdtuVA3UtH1Siu7SjQfN4,3293
|
|
16
|
+
abstractgateway-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
17
|
+
abstractgateway-0.1.0.dist-info/entry_points.txt,sha256=eDg0b1pu1ZLoFC8ZId_AlHn5rgaakmshL4vvI_FeAB4,61
|
|
18
|
+
abstractgateway-0.1.0.dist-info/RECORD,,
|