abstractgateway 0.1.0__py3-none-any.whl → 0.1.1__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.
Files changed (40) hide show
  1. abstractgateway/__init__.py +1 -2
  2. abstractgateway/__main__.py +7 -0
  3. abstractgateway/app.py +4 -4
  4. abstractgateway/cli.py +568 -8
  5. abstractgateway/config.py +15 -5
  6. abstractgateway/embeddings_config.py +45 -0
  7. abstractgateway/host_metrics.py +274 -0
  8. abstractgateway/hosts/bundle_host.py +528 -55
  9. abstractgateway/hosts/visualflow_host.py +30 -3
  10. abstractgateway/integrations/__init__.py +2 -0
  11. abstractgateway/integrations/email_bridge.py +782 -0
  12. abstractgateway/integrations/telegram_bridge.py +534 -0
  13. abstractgateway/maintenance/__init__.py +5 -0
  14. abstractgateway/maintenance/action_tokens.py +100 -0
  15. abstractgateway/maintenance/backlog_exec_runner.py +1592 -0
  16. abstractgateway/maintenance/backlog_parser.py +184 -0
  17. abstractgateway/maintenance/draft_generator.py +451 -0
  18. abstractgateway/maintenance/llm_assist.py +212 -0
  19. abstractgateway/maintenance/notifier.py +109 -0
  20. abstractgateway/maintenance/process_manager.py +1064 -0
  21. abstractgateway/maintenance/report_models.py +81 -0
  22. abstractgateway/maintenance/report_parser.py +219 -0
  23. abstractgateway/maintenance/text_similarity.py +123 -0
  24. abstractgateway/maintenance/triage.py +507 -0
  25. abstractgateway/maintenance/triage_queue.py +142 -0
  26. abstractgateway/migrate.py +155 -0
  27. abstractgateway/routes/__init__.py +2 -2
  28. abstractgateway/routes/gateway.py +10817 -179
  29. abstractgateway/routes/triage.py +118 -0
  30. abstractgateway/runner.py +689 -14
  31. abstractgateway/security/gateway_security.py +425 -110
  32. abstractgateway/service.py +213 -6
  33. abstractgateway/stores.py +64 -4
  34. abstractgateway/workflow_deprecations.py +225 -0
  35. abstractgateway-0.1.1.dist-info/METADATA +135 -0
  36. abstractgateway-0.1.1.dist-info/RECORD +40 -0
  37. abstractgateway-0.1.0.dist-info/METADATA +0 -101
  38. abstractgateway-0.1.0.dist-info/RECORD +0 -18
  39. {abstractgateway-0.1.0.dist-info → abstractgateway-0.1.1.dist-info}/WHEEL +0 -0
  40. {abstractgateway-0.1.0.dist-info → abstractgateway-0.1.1.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,135 @@
1
+ Metadata-Version: 2.4
2
+ Name: abstractgateway
3
+ Version: 0.1.1
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
+ Provides-Extra: dev
11
+ Requires-Dist: fastapi>=0.100.0; extra == 'dev'
12
+ Requires-Dist: httpx>=0.27.0; extra == 'dev'
13
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
14
+ Requires-Dist: uvicorn[standard]>=0.23.0; extra == 'dev'
15
+ Provides-Extra: http
16
+ Requires-Dist: fastapi>=0.100.0; extra == 'http'
17
+ Requires-Dist: uvicorn[standard]>=0.23.0; extra == 'http'
18
+ Provides-Extra: runner
19
+ Provides-Extra: telegram
20
+ Requires-Dist: abstractruntime[abstractcore]>=0.4.0; extra == 'telegram'
21
+ Provides-Extra: visualflow
22
+ Requires-Dist: abstractflow>=0.3.0; extra == 'visualflow'
23
+ Description-Content-Type: text/markdown
24
+
25
+ # AbstractGateway
26
+
27
+ AbstractGateway is a **deployable Run Gateway host** for AbstractRuntime runs:
28
+ - start durable runs
29
+ - accept a durable command inbox
30
+ - replay/stream a durable ledger (replay-first)
31
+ - enforce a security baseline (token + origin allowlist + limits)
32
+
33
+ This decouples the gateway service from any specific UI (AbstractFlow, AbstractCode, web/PWA thin clients).
34
+
35
+ Start here: [docs/getting-started.md](docs/getting-started.md)
36
+
37
+ ## Quickstart (HTTP server, bundle mode)
38
+
39
+ ```bash
40
+ pip install "abstractgateway[http]"
41
+
42
+ export ABSTRACTGATEWAY_FLOWS_DIR="/path/to/bundles" # *.flow dir (or a single .flow file)
43
+ export ABSTRACTGATEWAY_DATA_DIR="$PWD/runtime/gateway"
44
+
45
+ # Required by default: the server refuses to start without a token.
46
+ export ABSTRACTGATEWAY_AUTH_TOKEN="$(python -c 'import secrets; print(secrets.token_urlsafe(32))')"
47
+ # Browser-origin allowlist (glob patterns). Default allows localhost; customize when exposing remotely.
48
+ export ABSTRACTGATEWAY_ALLOWED_ORIGINS="http://localhost:*,http://127.0.0.1:*"
49
+
50
+ abstractgateway serve --host 127.0.0.1 --port 8080
51
+ ```
52
+
53
+ OpenAPI docs (Swagger UI): `http://127.0.0.1:8080/docs`
54
+
55
+ Smoke checks:
56
+
57
+ ```bash
58
+ curl -sS "http://127.0.0.1:8080/api/health"
59
+
60
+ curl -sS -H "Authorization: Bearer $ABSTRACTGATEWAY_AUTH_TOKEN" \
61
+ "http://127.0.0.1:8080/api/gateway/bundles"
62
+ ```
63
+
64
+ ## Client contract (replay-first)
65
+
66
+ - Clients **start runs**: `POST /api/gateway/runs/start`
67
+ - Clients **act** by submitting durable commands: `POST /api/gateway/commands`
68
+ - supported types: `pause|resume|cancel|emit_event|update_schedule|compact_memory`
69
+ - Clients **render** by replaying/streaming the durable ledger:
70
+ - replay: `GET /api/gateway/runs/{run_id}/ledger?after=...`
71
+ - stream (SSE): `GET /api/gateway/runs/{run_id}/ledger/stream?after=...`
72
+
73
+ See [docs/api.md](docs/api.md) for curl examples and the live OpenAPI spec (`/openapi.json`).
74
+
75
+ ## Install
76
+
77
+ ### Base (runner + stores + CLI)
78
+
79
+ Requires Python `>=3.10` (see `pyproject.toml`).
80
+
81
+ ```bash
82
+ pip install abstractgateway
83
+ ```
84
+
85
+ ### HTTP API/SSE server (FastAPI + Uvicorn)
86
+
87
+ ```bash
88
+ pip install "abstractgateway[http]"
89
+ ```
90
+
91
+ ### Optional extras
92
+
93
+ - `abstractgateway[visualflow]`: run VisualFlow JSON from a directory of `*.json` files (requires `abstractflow`)
94
+ - `abstractgateway[telegram]`: Telegram bridge dependencies
95
+ - `abstractgateway[dev]`: local test/dev deps
96
+
97
+ ### Bundle-dependent dependencies (only if your workflows need them)
98
+
99
+ - LLM/tool nodes in bundle mode require AbstractRuntime’s AbstractCore integration:
100
+
101
+ ```bash
102
+ pip install "abstractruntime[abstractcore]>=0.4.0"
103
+ ```
104
+
105
+ For details on `ABSTRACTGATEWAY_PROVIDER`/`MODEL`, store backends, and workflow sources, see [docs/configuration.md](docs/configuration.md).
106
+
107
+ ## Creating a `.flow` bundle (authoring)
108
+
109
+ Use AbstractFlow to pack a bundle:
110
+
111
+ ```bash
112
+ abstractflow bundle pack /path/to/root.json --out /path/to/bundles/my.flow --flows-dir /path/to/flows
113
+ ```
114
+
115
+ See [docs/getting-started.md](docs/getting-started.md) for running, split API/runner, and file→SQLite migration.
116
+
117
+ ## Docs
118
+
119
+ ### Project docs
120
+
121
+ - Changelog: [CHANGELOG.md](CHANGELOG.md) (compat: `CHANGELOD.md`)
122
+ - Contributing: [CONTRIBUTING.md](CONTRIBUTING.md)
123
+ - Security policy (vulnerability reporting): [SECURITY.md](SECURITY.md)
124
+ - Acknowledgments: [ACKNOWLEDGMENTS.md](ACKNOWLEDGMENTS.md) (compat: `ACKNOWLEDMENTS.md`)
125
+
126
+ ### Package docs
127
+
128
+ - Docs index: [docs/README.md](docs/README.md)
129
+ - Getting started: [docs/getting-started.md](docs/getting-started.md)
130
+ - FAQ: [docs/faq.md](docs/faq.md)
131
+ - Architecture: [docs/architecture.md](docs/architecture.md)
132
+ - Configuration: [docs/configuration.md](docs/configuration.md)
133
+ - API overview: [docs/api.md](docs/api.md)
134
+ - Security: [docs/security.md](docs/security.md)
135
+ - Operator tooling (optional): [docs/maintenance.md](docs/maintenance.md)
@@ -0,0 +1,40 @@
1
+ abstractgateway/__init__.py,sha256=m_biwVVD5XLm4Xt8Emo1DZWHjNOJEGL7fjTsrYWgLcA,280
2
+ abstractgateway/__main__.py,sha256=KQwnQ9WuHUzz-sQ6nZ89HfqUkDXMP0qCRPzAX128PHs,98
3
+ abstractgateway/app.py,sha256=s9mgAxFpGhR2FayYjwUJ2csJV0N5CzWT7o0eIhpnYns,1629
4
+ abstractgateway/cli.py,sha256=nW8mzUBi2ZL-T2_Nfvg9ATLQYupO0Zn8ITaGxFG9D54,25767
5
+ abstractgateway/config.py,sha256=0LuMxf58gB6W6gbQYRGf_-E8UlBrtCLz1H6NRRvJgzg,3627
6
+ abstractgateway/embeddings_config.py,sha256=wuQIx5z_a-YDx_7zxOcnqdg-0CnFw6S9VTyXiRhvXqk,1653
7
+ abstractgateway/host_metrics.py,sha256=SAmBreolwgFbeLakx0QAaQJUCv6Z6nXEEhhwJ43vxcY,8567
8
+ abstractgateway/migrate.py,sha256=gnCCCJGoO8o9V4jFnBylFTpX9w7CxMkhkgCS_NRPgGE,5600
9
+ abstractgateway/runner.py,sha256=fhJmvvzqFoIc2wY3F4mMx3hzv5fdBaYvTCzJznmThzU,45863
10
+ abstractgateway/service.py,sha256=ueRmDcyMSbfEEE7hKUb-GzHVXYTi3AdTHDF7NCDXLUQ,14007
11
+ abstractgateway/stores.py,sha256=c_YgQxQsPZzytYQunLHELLuWzmINgvdIT3-h27ldPoE,3084
12
+ abstractgateway/workflow_deprecations.py,sha256=wP4SaTJNVc5ATCyPSFLTiS8z8Y9nSJChYNdBPXZVb0k,7950
13
+ abstractgateway/hosts/__init__.py,sha256=RiIODYtCPUYeVPDKmVhqKLVwxw3D_NWdw4gnetVKdhA,170
14
+ abstractgateway/hosts/bundle_host.py,sha256=PU3gI-tnyFfwRVM1ZCLL8Kt0ZV4Jv-Me40x3VNHeDe0,47496
15
+ abstractgateway/hosts/visualflow_host.py,sha256=Mgoa30lHY0uuT5Qcrx6CHh-FXzKNW2zXryc3Ll6yT_Y,8742
16
+ abstractgateway/integrations/__init__.py,sha256=TKL8tZmwMPX-hfjPbdpQG8axDNolbX2zPfD1bs5qv3I,59
17
+ abstractgateway/integrations/email_bridge.py,sha256=FacYfEUPkZpDuX_lQGfnQK25Q4jvEvLa3aVc2xFLv0Y,30602
18
+ abstractgateway/integrations/telegram_bridge.py,sha256=8E958kJMuRYne6DGXFVkOsGb0scZzQ-rbShqwPOzeJw,21341
19
+ abstractgateway/maintenance/__init__.py,sha256=AdJnwhZ8zwo_SUFyWXF0jw7clhwkh6WopUBUxFk-zrk,121
20
+ abstractgateway/maintenance/action_tokens.py,sha256=DoI3b_Ngpypxc24FkXIZVkOP9KWVDHYcq5yaWf-5cO4,3163
21
+ abstractgateway/maintenance/backlog_exec_runner.py,sha256=wPdjN-UB2SOGsCTe5jhECUJXynMSe5Zu2OW6pvb2neU,58185
22
+ abstractgateway/maintenance/backlog_parser.py,sha256=weFuADQSI-frrxKNokICePpd2lzqlq0j15mW8fyiDNY,5734
23
+ abstractgateway/maintenance/draft_generator.py,sha256=g0TXIB8ybUWFz-TZ2qmNsqtbm1NHZE2poiPL3-6jSFA,16658
24
+ abstractgateway/maintenance/llm_assist.py,sha256=O0Q473ADSAq1lR-JfYQxbCCUC6VckOkOT3-suLxSN0o,6944
25
+ abstractgateway/maintenance/notifier.py,sha256=1TTJudiYM05msPSzmPn6pXTOzLCprtU2sEqnkKAR4S0,3813
26
+ abstractgateway/maintenance/process_manager.py,sha256=_hi-DmQGU2xdd27QeHD81PbDMB8O4YvS-G2uWCjJPPE,41659
27
+ abstractgateway/maintenance/report_models.py,sha256=gAHsuJCjRGrlKcLYRpr5zPMCz9dM0agZ2LGrJy91LOk,2338
28
+ abstractgateway/maintenance/report_parser.py,sha256=7DOqb9F0D_ONr8QkJj83uEky5h4aKdVO1Zgl3f228K0,7063
29
+ abstractgateway/maintenance/text_similarity.py,sha256=mD29VexyY3QYK5LthCw3t3EmJcebUQ_myfxnu4kAjtA,2703
30
+ abstractgateway/maintenance/triage.py,sha256=CQedaRwD5gJ88-zUHa21OlwAoNJptQrY8yttsn3GDAo,20588
31
+ abstractgateway/maintenance/triage_queue.py,sha256=CdZJpEWReODlvMzwQRiPO1KmnkNC1xTIUGNek-y7mgA,5035
32
+ abstractgateway/routes/__init__.py,sha256=gIj0jBKaEbGK5Xf20Fd2WAvvKEJn5n4314sC1p7pTUo,138
33
+ abstractgateway/routes/gateway.py,sha256=P9etfWLYhojqrbg-N_7QDw-C1L628-tAFdVKdX9SV40,448408
34
+ abstractgateway/routes/triage.py,sha256=sU1vlxBQPSZBsgEtQJOgYclfYniaM--AoaeBqA9pIAs,4585
35
+ abstractgateway/security/__init__.py,sha256=2pKIec_kuQ53_UAl0uij3u_1MInQOVDY_MF7ERr4Rgw,211
36
+ abstractgateway/security/gateway_security.py,sha256=FaUkI4TwKg-C-cxgFR_29_Cp4iEzyPF_kAZnIePlO9s,30676
37
+ abstractgateway-0.1.1.dist-info/METADATA,sha256=Qg3eGxj9WSLM7nLoc7_0_MFM2uvyqe3ByMXh994cHaI,4705
38
+ abstractgateway-0.1.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
39
+ abstractgateway-0.1.1.dist-info/entry_points.txt,sha256=eDg0b1pu1ZLoFC8ZId_AlHn5rgaakmshL4vvI_FeAB4,61
40
+ abstractgateway-0.1.1.dist-info/RECORD,,
@@ -1,101 +0,0 @@
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
-
@@ -1,18 +0,0 @@
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,,