Skip to main content

AbstractGateway: deployable Run Gateway host for AbstractRuntime (commands + ledger).

Project description

AbstractGateway

AbstractGateway is a deployable Run Gateway host for AbstractRuntime runs:

  • start durable runs
  • accept a durable command inbox
  • replay/stream a durable ledger (replay-first)
  • enforce a security baseline (token + origin allowlist + limits)

This decouples the gateway service from any specific UI (AbstractFlow, AbstractCode, web/PWA thin clients).

Start here: docs/getting-started.md

Quickstart (HTTP server, bundle mode)

pip install "abstractgateway[http]"

export ABSTRACTGATEWAY_FLOWS_DIR="/path/to/bundles"   # *.flow dir (or a single .flow file)
export ABSTRACTGATEWAY_DATA_DIR="$PWD/runtime/gateway"

# Required by default: the server refuses to start without a token.
export ABSTRACTGATEWAY_AUTH_TOKEN="$(python -c 'import secrets; print(secrets.token_urlsafe(32))')"
# Browser-origin allowlist (glob patterns). Default allows localhost; customize when exposing remotely.
export ABSTRACTGATEWAY_ALLOWED_ORIGINS="http://localhost:*,http://127.0.0.1:*"

abstractgateway serve --host 127.0.0.1 --port 8080

OpenAPI docs (Swagger UI): http://127.0.0.1:8080/docs

Smoke checks:

curl -sS "http://127.0.0.1:8080/api/health"

curl -sS -H "Authorization: Bearer $ABSTRACTGATEWAY_AUTH_TOKEN" \
  "http://127.0.0.1:8080/api/gateway/bundles"

Client contract (replay-first)

  • Clients start runs: POST /api/gateway/runs/start
  • Clients act by submitting durable commands: POST /api/gateway/commands
    • supported types: pause|resume|cancel|emit_event|update_schedule|compact_memory
  • Clients render by replaying/streaming the durable ledger:
    • replay: GET /api/gateway/runs/{run_id}/ledger?after=...
    • stream (SSE): GET /api/gateway/runs/{run_id}/ledger/stream?after=...

See docs/api.md for curl examples and the live OpenAPI spec (/openapi.json).

Install

Base (runner + stores + CLI)

Requires Python >=3.10 (see pyproject.toml).

pip install abstractgateway

HTTP API/SSE server (FastAPI + Uvicorn)

pip install "abstractgateway[http]"

Optional extras

  • abstractgateway[visualflow]: run VisualFlow JSON from a directory of *.json files (requires abstractflow)
  • abstractgateway[telegram]: Telegram bridge dependencies
  • abstractgateway[dev]: local test/dev deps

Bundle-dependent dependencies (only if your workflows need them)

  • LLM/tool nodes in bundle mode require AbstractRuntime’s AbstractCore integration:
pip install "abstractruntime[abstractcore]>=0.4.0"

For details on ABSTRACTGATEWAY_PROVIDER/MODEL, store backends, and workflow sources, see docs/configuration.md.

Creating a .flow bundle (authoring)

Use AbstractFlow to pack a bundle:

abstractflow bundle pack /path/to/root.json --out /path/to/bundles/my.flow --flows-dir /path/to/flows

See docs/getting-started.md for running, split API/runner, and file→SQLite migration.

Docs

Project docs

Package docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abstractgateway-0.1.1.tar.gz (264.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abstractgateway-0.1.1-py3-none-any.whl (205.9 kB view details)

Uploaded Python 3

File details

Details for the file abstractgateway-0.1.1.tar.gz.

File metadata

  • Download URL: abstractgateway-0.1.1.tar.gz
  • Upload date:
  • Size: 264.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for abstractgateway-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3ca630bdf4120f189806f0782e0b3cda9fef685e127dd0386b823040dcbaf237
MD5 3243a643c4eb1deca1b1e274e7897165
BLAKE2b-256 279c2911d273817788fe0225d8c9c7ee7095458b4541a6efc44d47d5fefd9a64

See more details on using hashes here.

File details

Details for the file abstractgateway-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for abstractgateway-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a9e0cd2b67605c42707aea9f39e50f7e2adebb7349aff599a270f6953b5d52e4
MD5 6473bd8f7fb9790a6263e5a69e03c15f
BLAKE2b-256 86cfe070da73760e30f458e0e9ced3c76da52069810902c71d449ded814acb24

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page