abstractgateway 0.1.0__tar.gz → 0.1.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.
- abstractgateway-0.1.1/ACKNOWLEDGMENTS.md +30 -0
- abstractgateway-0.1.1/ACKNOWLEDMENTS.md +6 -0
- abstractgateway-0.1.1/CHANGELOD.md +6 -0
- abstractgateway-0.1.1/CHANGELOG.md +30 -0
- abstractgateway-0.1.1/CONTRIBUTING.md +63 -0
- abstractgateway-0.1.1/PKG-INFO +135 -0
- abstractgateway-0.1.1/README.md +111 -0
- abstractgateway-0.1.1/SECURITY.md +36 -0
- abstractgateway-0.1.1/docs/README.md +28 -0
- abstractgateway-0.1.1/docs/api.md +175 -0
- abstractgateway-0.1.1/docs/architecture.md +123 -0
- abstractgateway-0.1.1/docs/configuration.md +87 -0
- abstractgateway-0.1.1/docs/faq.md +204 -0
- abstractgateway-0.1.1/docs/getting-started.md +150 -0
- abstractgateway-0.1.1/docs/maintenance.md +154 -0
- abstractgateway-0.1.1/docs/security.md +101 -0
- abstractgateway-0.1.1/llms-full.txt +1361 -0
- abstractgateway-0.1.1/llms.txt +65 -0
- {abstractgateway-0.1.0 → abstractgateway-0.1.1}/pyproject.toml +15 -4
- {abstractgateway-0.1.0 → abstractgateway-0.1.1}/src/abstractgateway/__init__.py +1 -2
- abstractgateway-0.1.1/src/abstractgateway/__main__.py +7 -0
- {abstractgateway-0.1.0 → abstractgateway-0.1.1}/src/abstractgateway/app.py +4 -4
- abstractgateway-0.1.1/src/abstractgateway/cli.py +590 -0
- {abstractgateway-0.1.0 → abstractgateway-0.1.1}/src/abstractgateway/config.py +15 -5
- abstractgateway-0.1.1/src/abstractgateway/embeddings_config.py +45 -0
- abstractgateway-0.1.1/src/abstractgateway/host_metrics.py +274 -0
- abstractgateway-0.1.1/src/abstractgateway/hosts/bundle_host.py +1099 -0
- {abstractgateway-0.1.0 → abstractgateway-0.1.1}/src/abstractgateway/hosts/visualflow_host.py +30 -3
- abstractgateway-0.1.1/src/abstractgateway/integrations/__init__.py +2 -0
- abstractgateway-0.1.1/src/abstractgateway/integrations/email_bridge.py +782 -0
- abstractgateway-0.1.1/src/abstractgateway/integrations/telegram_bridge.py +534 -0
- abstractgateway-0.1.1/src/abstractgateway/maintenance/__init__.py +5 -0
- abstractgateway-0.1.1/src/abstractgateway/maintenance/action_tokens.py +100 -0
- abstractgateway-0.1.1/src/abstractgateway/maintenance/backlog_exec_runner.py +1592 -0
- abstractgateway-0.1.1/src/abstractgateway/maintenance/backlog_parser.py +184 -0
- abstractgateway-0.1.1/src/abstractgateway/maintenance/draft_generator.py +451 -0
- abstractgateway-0.1.1/src/abstractgateway/maintenance/llm_assist.py +212 -0
- abstractgateway-0.1.1/src/abstractgateway/maintenance/notifier.py +109 -0
- abstractgateway-0.1.1/src/abstractgateway/maintenance/process_manager.py +1064 -0
- abstractgateway-0.1.1/src/abstractgateway/maintenance/report_models.py +81 -0
- abstractgateway-0.1.1/src/abstractgateway/maintenance/report_parser.py +219 -0
- abstractgateway-0.1.1/src/abstractgateway/maintenance/text_similarity.py +123 -0
- abstractgateway-0.1.1/src/abstractgateway/maintenance/triage.py +507 -0
- abstractgateway-0.1.1/src/abstractgateway/maintenance/triage_queue.py +142 -0
- abstractgateway-0.1.1/src/abstractgateway/migrate.py +155 -0
- abstractgateway-0.1.1/src/abstractgateway/routes/__init__.py +5 -0
- abstractgateway-0.1.1/src/abstractgateway/routes/gateway.py +11031 -0
- abstractgateway-0.1.1/src/abstractgateway/routes/triage.py +118 -0
- abstractgateway-0.1.1/src/abstractgateway/runner.py +1104 -0
- abstractgateway-0.1.1/src/abstractgateway/security/gateway_security.py +819 -0
- abstractgateway-0.1.1/src/abstractgateway/service.py +341 -0
- abstractgateway-0.1.1/src/abstractgateway/stores.py +94 -0
- abstractgateway-0.1.1/src/abstractgateway/workflow_deprecations.py +225 -0
- abstractgateway-0.1.1/start-dev.sh +17 -0
- abstractgateway-0.1.1/tests/conftest.py +30 -0
- abstractgateway-0.1.1/tests/test_backlog_advisor_and_maintain_readonly_scope.py +185 -0
- abstractgateway-0.1.1/tests/test_backlog_browsing_recurrent_and_unparsed.py +89 -0
- abstractgateway-0.1.1/tests/test_backlog_exec_api_endpoints.py +430 -0
- abstractgateway-0.1.1/tests/test_backlog_exec_runner_basic.py +211 -0
- abstractgateway-0.1.1/tests/test_backlog_exec_runner_persists_ledger_log.py +68 -0
- abstractgateway-0.1.1/tests/test_backlog_template_and_attachments.py +108 -0
- abstractgateway-0.1.1/tests/test_backlog_write_endpoints_basic.py +194 -0
- abstractgateway-0.1.1/tests/test_capabilities_endpoint_contract.py +87 -0
- abstractgateway-0.1.1/tests/test_gateway_artifacts_endpoint.py +126 -0
- abstractgateway-0.1.1/tests/test_gateway_attachments_ingest.py +186 -0
- abstractgateway-0.1.1/tests/test_gateway_attachments_upload.py +117 -0
- abstractgateway-0.1.1/tests/test_gateway_audit_log_endpoints.py +48 -0
- abstractgateway-0.1.1/tests/test_gateway_bug_report_endpoint.py +186 -0
- {abstractgateway-0.1.0 → abstractgateway-0.1.1}/tests/test_gateway_bundle_llm_tools_agents.py +29 -9
- abstractgateway-0.1.1/tests/test_gateway_bundle_upload_remove.py +106 -0
- abstractgateway-0.1.1/tests/test_gateway_cli_split_runner.py +112 -0
- abstractgateway-0.1.1/tests/test_gateway_discovery_endpoints.py +220 -0
- abstractgateway-0.1.1/tests/test_gateway_e2e_split_api_runner.py +240 -0
- abstractgateway-0.1.1/tests/test_gateway_e2e_sqlite_wait_offloading_lmstudio.py +270 -0
- abstractgateway-0.1.1/tests/test_gateway_email_bridge_unit.py +163 -0
- abstractgateway-0.1.1/tests/test_gateway_email_inbox_endpoints.py +150 -0
- abstractgateway-0.1.1/tests/test_gateway_embeddings_endpoint.py +174 -0
- abstractgateway-0.1.1/tests/test_gateway_feature_report_endpoint.py +191 -0
- abstractgateway-0.1.1/tests/test_gateway_files_skim_endpoint.py +97 -0
- abstractgateway-0.1.1/tests/test_gateway_history_bundle_endpoint.py +151 -0
- abstractgateway-0.1.1/tests/test_gateway_host_metrics_gpu_endpoint.py +111 -0
- {abstractgateway-0.1.0 → abstractgateway-0.1.1}/tests/test_gateway_http_api.py +190 -1
- abstractgateway-0.1.1/tests/test_gateway_kg_query_endpoint.py +424 -0
- abstractgateway-0.1.1/tests/test_gateway_ledger_stream_closes_on_terminal.py +116 -0
- abstractgateway-0.1.1/tests/test_gateway_process_manager_endpoints.py +127 -0
- abstractgateway-0.1.1/tests/test_gateway_prompt_cache_endpoints.py +237 -0
- abstractgateway-0.1.1/tests/test_gateway_runner_subworkflow_traces.py +242 -0
- abstractgateway-0.1.1/tests/test_gateway_runs_list_endpoint.py +323 -0
- abstractgateway-0.1.1/tests/test_gateway_scheduled_runs.py +376 -0
- abstractgateway-0.1.1/tests/test_gateway_security_middleware_unit.py +291 -0
- abstractgateway-0.1.1/tests/test_gateway_split_api_runner.py +171 -0
- abstractgateway-0.1.1/tests/test_gateway_telegram_bridge_unit.py +147 -0
- abstractgateway-0.1.1/tests/test_gateway_workflow_deprecation.py +124 -0
- abstractgateway-0.1.1/tests/test_gateway_workspace_policy_enforcement.py +219 -0
- abstractgateway-0.1.1/tests/test_host_metrics_ioreg_unit.py +34 -0
- abstractgateway-0.1.1/tests/test_maintenance_report_triage_basic.py +162 -0
- abstractgateway-0.1.1/tests/test_process_manager_env_api.py +119 -0
- abstractgateway-0.1.1/tests/test_process_manager_env_overrides.py +98 -0
- abstractgateway-0.1.1/tests/test_process_manager_stop_safety.py +46 -0
- abstractgateway-0.1.1/tests/test_report_inbox_endpoints_basic.py +175 -0
- abstractgateway-0.1.1/tests/test_tool_specs_contract.py +31 -0
- abstractgateway-0.1.1/tests/test_voice_audio_api_contract.py +175 -0
- abstractgateway-0.1.1/tests/test_voice_audio_capabilities_durable.py +196 -0
- abstractgateway-0.1.1/tests/test_workflow_deprecation_store.py +62 -0
- abstractgateway-0.1.0/PKG-INFO +0 -101
- abstractgateway-0.1.0/README.md +0 -83
- abstractgateway-0.1.0/docs/architecture.md +0 -71
- abstractgateway-0.1.0/src/abstractgateway/cli.py +0 -30
- abstractgateway-0.1.0/src/abstractgateway/hosts/bundle_host.py +0 -626
- abstractgateway-0.1.0/src/abstractgateway/routes/__init__.py +0 -5
- abstractgateway-0.1.0/src/abstractgateway/routes/gateway.py +0 -393
- abstractgateway-0.1.0/src/abstractgateway/runner.py +0 -429
- abstractgateway-0.1.0/src/abstractgateway/security/gateway_security.py +0 -504
- abstractgateway-0.1.0/src/abstractgateway/service.py +0 -134
- abstractgateway-0.1.0/src/abstractgateway/stores.py +0 -34
- abstractgateway-0.1.0/tests/test_gateway_security_middleware_unit.py +0 -137
- {abstractgateway-0.1.0 → abstractgateway-0.1.1}/.gitignore +0 -0
- {abstractgateway-0.1.0 → abstractgateway-0.1.1}/src/abstractgateway/hosts/__init__.py +0 -0
- {abstractgateway-0.1.0 → abstractgateway-0.1.1}/src/abstractgateway/security/__init__.py +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Acknowledgments
|
|
2
|
+
|
|
3
|
+
AbstractGateway stands on the shoulders of many open-source projects and contributors.
|
|
4
|
+
|
|
5
|
+
This list is **non-exhaustive**. The canonical dependency list for this package is in `pyproject.toml`.
|
|
6
|
+
|
|
7
|
+
## Core dependencies
|
|
8
|
+
|
|
9
|
+
- **AbstractRuntime**: durable run model, workflow registry, file/SQLite stores, and runtime tick loop.
|
|
10
|
+
- **FastAPI** (via **Starlette**) + **Pydantic**: HTTP API surface and request/response models.
|
|
11
|
+
- **Uvicorn**: ASGI server used by `abstractgateway serve`.
|
|
12
|
+
|
|
13
|
+
## Optional integrations (feature-dependent)
|
|
14
|
+
|
|
15
|
+
These are not required for the base gateway, but are used by optional modes/features:
|
|
16
|
+
|
|
17
|
+
- **AbstractFlow**: VisualFlow JSON directory mode and workflow authoring/bundling workflows (see `abstractgateway[visualflow]`).
|
|
18
|
+
- **AbstractCore** integration (via `abstractruntime[abstractcore]`): LLM/tool execution wiring, embeddings client, Telegram TDLib wrapper.
|
|
19
|
+
- **AbstractAgent**: Visual Agent nodes in bundle mode.
|
|
20
|
+
- **AbstractMemory** + **LanceDB**: `memory_kg_*` nodes in bundle mode (knowledge graph storage).
|
|
21
|
+
- **TDLib**: Telegram Secret Chats support when using the TDLib transport.
|
|
22
|
+
|
|
23
|
+
## Dev/test tooling
|
|
24
|
+
|
|
25
|
+
- **pytest** and **httpx**: test suite and HTTP client utilities used under `tests/`.
|
|
26
|
+
- **hatchling**: Python packaging/build backend.
|
|
27
|
+
|
|
28
|
+
## Contributors
|
|
29
|
+
|
|
30
|
+
Thank you to everyone who reports issues, improves documentation, and contributes code.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.1.1] - 2026-02-04
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Documentation refresh for external users:
|
|
15
|
+
- new FAQ (`docs/faq.md`)
|
|
16
|
+
- clarified quickstart + smoke checks in `README.md`
|
|
17
|
+
- tightened getting started, configuration, security, and API overview docs
|
|
18
|
+
- improved cross-linking in `CONTRIBUTING.md` and `SECURITY.md`
|
|
19
|
+
- refreshed `llms.txt` / `llms-full.txt` for agent ingestion (index + full snapshot)
|
|
20
|
+
- Version bump to reflect the documentation release (`0.1.0` → `0.1.1`).
|
|
21
|
+
|
|
22
|
+
### Notes
|
|
23
|
+
|
|
24
|
+
- No intentional runtime behavior changes in this release; it is documentation-focused.
|
|
25
|
+
|
|
26
|
+
## [0.1.0] - 2026-02-03
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- Initial public package for AbstractGateway (`abstractgateway`).
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in improving AbstractGateway.
|
|
4
|
+
|
|
5
|
+
This repo is a Python package (`src/` layout) with a FastAPI server, a durable runner worker, and contract tests under `tests/`.
|
|
6
|
+
|
|
7
|
+
## Quick start (dev)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
python -m venv .venv
|
|
11
|
+
source .venv/bin/activate
|
|
12
|
+
|
|
13
|
+
python -m pip install -U pip
|
|
14
|
+
pip install -e ".[dev,http]"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Run the test suite:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pytest
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
If you only want the fast/unit/contract layer:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pytest -m basic
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Notes:
|
|
30
|
+
- `integration` and `e2e` tests may require optional dependencies and/or external services (e.g. an LLM provider).
|
|
31
|
+
- The CLI entrypoint is `abstractgateway` (see `pyproject.toml`).
|
|
32
|
+
|
|
33
|
+
## How to contribute
|
|
34
|
+
|
|
35
|
+
1. **Open an issue** (or a draft PR) describing what you want to change and why.
|
|
36
|
+
2. Keep changes **small and reviewable**.
|
|
37
|
+
3. Add/adjust tests where it improves confidence.
|
|
38
|
+
4. Update docs so they remain truthful and user-facing:
|
|
39
|
+
- README is the entrypoint.
|
|
40
|
+
- `docs/getting-started.md` is the step-by-step guide.
|
|
41
|
+
- Prefer adding FAQ entries for recurring “gotchas”.
|
|
42
|
+
|
|
43
|
+
## Project conventions
|
|
44
|
+
|
|
45
|
+
- Source of truth is the code in `src/`.
|
|
46
|
+
- Keep public docs concise, actionable, and aligned with the current behavior.
|
|
47
|
+
- Prefer explicit env var names as used in code (see `docs/configuration.md`).
|
|
48
|
+
|
|
49
|
+
## Release checklist (maintainers)
|
|
50
|
+
|
|
51
|
+
1. Update `CHANGELOG.md`.
|
|
52
|
+
2. Bump version in:
|
|
53
|
+
- `pyproject.toml`
|
|
54
|
+
- `src/abstractgateway/__init__.py`
|
|
55
|
+
- `src/abstractgateway/app.py` (FastAPI version string)
|
|
56
|
+
3. Run `pytest`.
|
|
57
|
+
4. Build artifacts (optional): `python -m build`
|
|
58
|
+
|
|
59
|
+
## Related docs
|
|
60
|
+
|
|
61
|
+
- Package overview + quickstart: [README.md](./README.md)
|
|
62
|
+
- Docs index: [docs/README.md](./docs/README.md)
|
|
63
|
+
- Getting started: [docs/getting-started.md](./docs/getting-started.md)
|
|
@@ -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,111 @@
|
|
|
1
|
+
# AbstractGateway
|
|
2
|
+
|
|
3
|
+
AbstractGateway is a **deployable Run Gateway host** for AbstractRuntime runs:
|
|
4
|
+
- start durable runs
|
|
5
|
+
- accept a durable command inbox
|
|
6
|
+
- replay/stream a durable ledger (replay-first)
|
|
7
|
+
- enforce a security baseline (token + origin allowlist + limits)
|
|
8
|
+
|
|
9
|
+
This decouples the gateway service from any specific UI (AbstractFlow, AbstractCode, web/PWA thin clients).
|
|
10
|
+
|
|
11
|
+
Start here: [docs/getting-started.md](docs/getting-started.md)
|
|
12
|
+
|
|
13
|
+
## Quickstart (HTTP server, bundle mode)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install "abstractgateway[http]"
|
|
17
|
+
|
|
18
|
+
export ABSTRACTGATEWAY_FLOWS_DIR="/path/to/bundles" # *.flow dir (or a single .flow file)
|
|
19
|
+
export ABSTRACTGATEWAY_DATA_DIR="$PWD/runtime/gateway"
|
|
20
|
+
|
|
21
|
+
# Required by default: the server refuses to start without a token.
|
|
22
|
+
export ABSTRACTGATEWAY_AUTH_TOKEN="$(python -c 'import secrets; print(secrets.token_urlsafe(32))')"
|
|
23
|
+
# Browser-origin allowlist (glob patterns). Default allows localhost; customize when exposing remotely.
|
|
24
|
+
export ABSTRACTGATEWAY_ALLOWED_ORIGINS="http://localhost:*,http://127.0.0.1:*"
|
|
25
|
+
|
|
26
|
+
abstractgateway serve --host 127.0.0.1 --port 8080
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
OpenAPI docs (Swagger UI): `http://127.0.0.1:8080/docs`
|
|
30
|
+
|
|
31
|
+
Smoke checks:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
curl -sS "http://127.0.0.1:8080/api/health"
|
|
35
|
+
|
|
36
|
+
curl -sS -H "Authorization: Bearer $ABSTRACTGATEWAY_AUTH_TOKEN" \
|
|
37
|
+
"http://127.0.0.1:8080/api/gateway/bundles"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Client contract (replay-first)
|
|
41
|
+
|
|
42
|
+
- Clients **start runs**: `POST /api/gateway/runs/start`
|
|
43
|
+
- Clients **act** by submitting durable commands: `POST /api/gateway/commands`
|
|
44
|
+
- supported types: `pause|resume|cancel|emit_event|update_schedule|compact_memory`
|
|
45
|
+
- Clients **render** by replaying/streaming the durable ledger:
|
|
46
|
+
- replay: `GET /api/gateway/runs/{run_id}/ledger?after=...`
|
|
47
|
+
- stream (SSE): `GET /api/gateway/runs/{run_id}/ledger/stream?after=...`
|
|
48
|
+
|
|
49
|
+
See [docs/api.md](docs/api.md) for curl examples and the live OpenAPI spec (`/openapi.json`).
|
|
50
|
+
|
|
51
|
+
## Install
|
|
52
|
+
|
|
53
|
+
### Base (runner + stores + CLI)
|
|
54
|
+
|
|
55
|
+
Requires Python `>=3.10` (see `pyproject.toml`).
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install abstractgateway
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### HTTP API/SSE server (FastAPI + Uvicorn)
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install "abstractgateway[http]"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Optional extras
|
|
68
|
+
|
|
69
|
+
- `abstractgateway[visualflow]`: run VisualFlow JSON from a directory of `*.json` files (requires `abstractflow`)
|
|
70
|
+
- `abstractgateway[telegram]`: Telegram bridge dependencies
|
|
71
|
+
- `abstractgateway[dev]`: local test/dev deps
|
|
72
|
+
|
|
73
|
+
### Bundle-dependent dependencies (only if your workflows need them)
|
|
74
|
+
|
|
75
|
+
- LLM/tool nodes in bundle mode require AbstractRuntime’s AbstractCore integration:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pip install "abstractruntime[abstractcore]>=0.4.0"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
For details on `ABSTRACTGATEWAY_PROVIDER`/`MODEL`, store backends, and workflow sources, see [docs/configuration.md](docs/configuration.md).
|
|
82
|
+
|
|
83
|
+
## Creating a `.flow` bundle (authoring)
|
|
84
|
+
|
|
85
|
+
Use AbstractFlow to pack a bundle:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
abstractflow bundle pack /path/to/root.json --out /path/to/bundles/my.flow --flows-dir /path/to/flows
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
See [docs/getting-started.md](docs/getting-started.md) for running, split API/runner, and file→SQLite migration.
|
|
92
|
+
|
|
93
|
+
## Docs
|
|
94
|
+
|
|
95
|
+
### Project docs
|
|
96
|
+
|
|
97
|
+
- Changelog: [CHANGELOG.md](CHANGELOG.md) (compat: `CHANGELOD.md`)
|
|
98
|
+
- Contributing: [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
99
|
+
- Security policy (vulnerability reporting): [SECURITY.md](SECURITY.md)
|
|
100
|
+
- Acknowledgments: [ACKNOWLEDGMENTS.md](ACKNOWLEDGMENTS.md) (compat: `ACKNOWLEDMENTS.md`)
|
|
101
|
+
|
|
102
|
+
### Package docs
|
|
103
|
+
|
|
104
|
+
- Docs index: [docs/README.md](docs/README.md)
|
|
105
|
+
- Getting started: [docs/getting-started.md](docs/getting-started.md)
|
|
106
|
+
- FAQ: [docs/faq.md](docs/faq.md)
|
|
107
|
+
- Architecture: [docs/architecture.md](docs/architecture.md)
|
|
108
|
+
- Configuration: [docs/configuration.md](docs/configuration.md)
|
|
109
|
+
- API overview: [docs/api.md](docs/api.md)
|
|
110
|
+
- Security: [docs/security.md](docs/security.md)
|
|
111
|
+
- Operator tooling (optional): [docs/maintenance.md](docs/maintenance.md)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
Thanks for helping keep AbstractGateway and its users safe.
|
|
4
|
+
|
|
5
|
+
## Reporting a vulnerability
|
|
6
|
+
|
|
7
|
+
Please **do not** open a public GitHub issue for security vulnerabilities.
|
|
8
|
+
|
|
9
|
+
Instead, use GitHub’s **private vulnerability reporting** / **Security Advisories** for this repository:
|
|
10
|
+
- Go to the repository’s **Security** tab
|
|
11
|
+
- Open **Advisories**
|
|
12
|
+
- Click **Report a vulnerability** (or create a draft advisory)
|
|
13
|
+
|
|
14
|
+
If you cannot use GitHub advisories, contact the maintainers privately (e.g. via GitHub profile contact links).
|
|
15
|
+
|
|
16
|
+
## What to include
|
|
17
|
+
|
|
18
|
+
To help us triage quickly, include:
|
|
19
|
+
- a clear description of the issue and impact
|
|
20
|
+
- minimal reproduction steps or a PoC
|
|
21
|
+
- affected versions and environments (OS/Python version/config)
|
|
22
|
+
- any suggested mitigation or patch
|
|
23
|
+
|
|
24
|
+
## Coordinated disclosure
|
|
25
|
+
|
|
26
|
+
We appreciate responsible disclosure and will work with you to:
|
|
27
|
+
- confirm the issue
|
|
28
|
+
- assess severity and affected versions
|
|
29
|
+
- produce a fix and release
|
|
30
|
+
|
|
31
|
+
Please avoid active exploitation, privacy violations, or destructive testing.
|
|
32
|
+
|
|
33
|
+
## Related docs
|
|
34
|
+
|
|
35
|
+
- Security configuration (auth/origin/limits): [docs/security.md](./docs/security.md)
|
|
36
|
+
- Getting started: [docs/getting-started.md](./docs/getting-started.md)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# AbstractGateway docs
|
|
2
|
+
|
|
3
|
+
Start here if you’re new to the project.
|
|
4
|
+
|
|
5
|
+
## Docs map
|
|
6
|
+
|
|
7
|
+
- Quickstart + stores (file/SQLite): [getting-started.md](./getting-started.md)
|
|
8
|
+
- FAQ / troubleshooting: [faq.md](./faq.md)
|
|
9
|
+
- Architecture (durable contract + components): [architecture.md](./architecture.md)
|
|
10
|
+
- Configuration (env vars + install extras): [configuration.md](./configuration.md)
|
|
11
|
+
- API overview (client contract + OpenAPI): [api.md](./api.md)
|
|
12
|
+
- Security guide (auth/origin/limits/audit log): [security.md](./security.md)
|
|
13
|
+
- Operator tooling (triage/backlog/process manager): [maintenance.md](./maintenance.md)
|
|
14
|
+
|
|
15
|
+
## API docs (generated)
|
|
16
|
+
|
|
17
|
+
When the HTTP server is running (`abstractgateway serve`):
|
|
18
|
+
- Health: `GET /api/health`
|
|
19
|
+
- OpenAPI JSON: `GET /openapi.json`
|
|
20
|
+
- Interactive Swagger UI: `GET /docs`
|
|
21
|
+
|
|
22
|
+
## Project docs
|
|
23
|
+
|
|
24
|
+
- Package README: [../README.md](../README.md)
|
|
25
|
+
- Changelog: [../CHANGELOG.md](../CHANGELOG.md) (compat: `CHANGELOD.md`)
|
|
26
|
+
- Contributing: [../CONTRIBUTING.md](../CONTRIBUTING.md)
|
|
27
|
+
- Security policy (vulnerability reporting): [../SECURITY.md](../SECURITY.md)
|
|
28
|
+
- Acknowledgments: [../ACKNOWLEDGMENTS.md](../ACKNOWLEDGMENTS.md) (compat: `ACKNOWLEDMENTS.md`)
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# AbstractGateway — API overview
|
|
2
|
+
|
|
3
|
+
The HTTP API is implemented with FastAPI under the `/api` prefix:
|
|
4
|
+
- Health: `GET /api/health`
|
|
5
|
+
- Gateway surface: `/api/gateway/*` (durable runs + operator tooling)
|
|
6
|
+
|
|
7
|
+
The API is documented at runtime:
|
|
8
|
+
- OpenAPI JSON: `GET /openapi.json`
|
|
9
|
+
- Swagger UI: `GET /docs`
|
|
10
|
+
|
|
11
|
+
## Auth
|
|
12
|
+
|
|
13
|
+
By default, `/api/gateway/*` is protected by `GatewaySecurityMiddleware` (bearer token + origin allowlist).
|
|
14
|
+
See: [security.md](./security.md).
|
|
15
|
+
|
|
16
|
+
All examples below assume:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
export BASE_URL="http://127.0.0.1:8080"
|
|
20
|
+
export AUTH="Authorization: Bearer $ABSTRACTGATEWAY_AUTH_TOKEN"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Core workflow lifecycle
|
|
24
|
+
|
|
25
|
+
### 1) List bundles (bundle mode)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
curl -sS -H "$AUTH" "$BASE_URL/api/gateway/bundles"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Upload a bundle:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
curl -sS -H "$AUTH" \
|
|
35
|
+
-F "file=@./my-bundle@0.1.0.flow" \
|
|
36
|
+
-F "overwrite=false" \
|
|
37
|
+
-F "reload=true" \
|
|
38
|
+
"$BASE_URL/api/gateway/bundles/upload"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2) Start a run
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
curl -sS -H "$AUTH" -H "Content-Type: application/json" \
|
|
45
|
+
-d '{"bundle_id":"my-bundle","input_data":{"prompt":"Hello"}}' \
|
|
46
|
+
"$BASE_URL/api/gateway/runs/start"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
If you need a specific entrypoint:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
curl -sS -H "$AUTH" -H "Content-Type: application/json" \
|
|
53
|
+
-d '{"bundle_id":"my-bundle","flow_id":"ac-echo","input_data":{"prompt":"Hello"}}' \
|
|
54
|
+
"$BASE_URL/api/gateway/runs/start"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Evidence: request/response models live in `src/abstractgateway/routes/gateway.py` (`StartRunRequest`, `start_run`).
|
|
58
|
+
|
|
59
|
+
### 3) Replay the ledger (cursor-based)
|
|
60
|
+
|
|
61
|
+
Ledger pages are replayed using `after` as “number of items already consumed”.
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
curl -sS -H "$AUTH" "$BASE_URL/api/gateway/runs/<run_id>/ledger?after=0&limit=200"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Response shape:
|
|
68
|
+
- `items`: list of durable ledger records
|
|
69
|
+
- `next_after`: the next cursor to use
|
|
70
|
+
|
|
71
|
+
Evidence: `src/abstractgateway/routes/gateway.py` (`get_ledger`).
|
|
72
|
+
|
|
73
|
+
### 4) Stream ledger updates (SSE)
|
|
74
|
+
|
|
75
|
+
SSE is an optimization; clients should always be able to reconnect by replaying from the last `next_after`.
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
curl -N -H "$AUTH" "$BASE_URL/api/gateway/runs/<run_id>/ledger/stream?after=0"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Evidence: `src/abstractgateway/routes/gateway.py` (`stream_ledger`).
|
|
82
|
+
|
|
83
|
+
## Durable commands (`POST /api/gateway/commands`)
|
|
84
|
+
|
|
85
|
+
Commands are appended to a durable inbox and applied asynchronously by the runner.
|
|
86
|
+
|
|
87
|
+
Request fields (see `SubmitCommandRequest` in `src/abstractgateway/routes/gateway.py`):
|
|
88
|
+
- `command_id`: client-supplied idempotency key (UUID recommended)
|
|
89
|
+
- `run_id`: target run id (or session id for some event use-cases)
|
|
90
|
+
- `type`: `pause|resume|cancel|emit_event|update_schedule|compact_memory`
|
|
91
|
+
- `payload`: command-specific object
|
|
92
|
+
|
|
93
|
+
### Pause / cancel
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
curl -sS -H "$AUTH" -H "Content-Type: application/json" \
|
|
97
|
+
-d '{"command_id":"'"$(python -c 'import uuid; print(uuid.uuid4())')"'", "run_id":"<run_id>", "type":"pause", "payload":{"reason":"operator_pause"}}' \
|
|
98
|
+
"$BASE_URL/api/gateway/commands"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Resume a paused run
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
curl -sS -H "$AUTH" -H "Content-Type: application/json" \
|
|
105
|
+
-d '{"command_id":"'"$(python -c 'import uuid; print(uuid.uuid4())')"'", "run_id":"<run_id>", "type":"resume", "payload":{}}' \
|
|
106
|
+
"$BASE_URL/api/gateway/commands"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Resume a WAITING run with a payload (WAIT resume)
|
|
110
|
+
|
|
111
|
+
When `payload.payload` is present, the runner interprets this as “resume a WAITING run with a durable payload”:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
curl -sS -H "$AUTH" -H "Content-Type: application/json" \
|
|
115
|
+
-d '{"command_id":"'"$(python -c 'import uuid; print(uuid.uuid4())')"'", "run_id":"<run_id>", "type":"resume", "payload":{"wait_key":"<optional_wait_key>", "payload":{"approved":true}}}' \
|
|
116
|
+
"$BASE_URL/api/gateway/commands"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Evidence: `src/abstractgateway/runner.py` (`_apply_command`, `_apply_run_control`).
|
|
120
|
+
|
|
121
|
+
### Emit an external event
|
|
122
|
+
|
|
123
|
+
Minimal form:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
curl -sS -H "$AUTH" -H "Content-Type: application/json" \
|
|
127
|
+
-d '{"command_id":"'"$(python -c 'import uuid; print(uuid.uuid4())')"'", "run_id":"<session_id>", "type":"emit_event", "payload":{"name":"chat.message","payload":{"text":"hi"}}}' \
|
|
128
|
+
"$BASE_URL/api/gateway/commands"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Evidence: `src/abstractgateway/runner.py` (`_apply_emit_event`).
|
|
132
|
+
|
|
133
|
+
## Beyond the core
|
|
134
|
+
|
|
135
|
+
`/api/gateway/*` also includes optional operator/tooling endpoints (reports inbox, triage queue, backlog browsing + exec runner, process manager, file/attachment helpers, embeddings, voice, discovery, …).
|
|
136
|
+
See: [maintenance.md](./maintenance.md).
|
|
137
|
+
|
|
138
|
+
## Email inbox (operator UI; optional)
|
|
139
|
+
|
|
140
|
+
These endpoints power AbstractObserver’s **Inbox → Email** UI. They are **account-scoped**: the browser cannot supply arbitrary IMAP/SMTP host/user credentials. The gateway host must be configured with one or more email accounts (multi-account YAML or env vars).
|
|
141
|
+
|
|
142
|
+
Endpoints:
|
|
143
|
+
- `GET /api/gateway/email/accounts`
|
|
144
|
+
- `GET /api/gateway/email/messages?account=…&mailbox=…&since=…&status=…&limit=…`
|
|
145
|
+
- `GET /api/gateway/email/messages/{uid}?account=…&mailbox=…&max_body_chars=…`
|
|
146
|
+
- `POST /api/gateway/email/send`
|
|
147
|
+
|
|
148
|
+
Examples:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
curl -sS -H "$AUTH" "$BASE_URL/api/gateway/email/accounts"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
curl -sS -H "$AUTH" "$BASE_URL/api/gateway/email/messages?status=unread&since=7d&limit=20"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
curl -sS -H "$AUTH" "$BASE_URL/api/gateway/email/messages/12345?max_body_chars=20000"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
curl -sS -H "$AUTH" -H "Content-Type: application/json" \
|
|
164
|
+
-d '{"to":"you@example.com","subject":"Hello","body_text":"Hi!"}' \
|
|
165
|
+
"$BASE_URL/api/gateway/email/send"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Configuration notes (gateway host):
|
|
169
|
+
- Multi-account: set `ABSTRACT_EMAIL_ACCOUNTS_CONFIG=/path/to/emails.yaml` (recommended).
|
|
170
|
+
- Single-account env fallback: set `ABSTRACT_EMAIL_IMAP_*` and/or `ABSTRACT_EMAIL_SMTP_*`.
|
|
171
|
+
- The secret itself must be present in the env var referenced by `*_PASSWORD_ENV_VAR` (e.g. `EMAIL_PASSWORD=...`).
|
|
172
|
+
|
|
173
|
+
Evidence: `src/abstractgateway/routes/gateway.py` (`/email/accounts|messages|send`) which proxies to `abstractcore.tools.comms_tools`.
|
|
174
|
+
|
|
175
|
+
Troubleshooting and common questions: [faq.md](./faq.md).
|