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.
    • If you installed abstractgateway[http], this is already included.
    • If you installed only the base package, install it explicitly:
pip install "abstractruntime[abstractcore]>=0.4.0"

Visual Agent nodes require abstractagent (also included by abstractgateway[http]):

pip install abstractagent

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.2.0.tar.gz (270.8 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.2.0-py3-none-any.whl (206.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for abstractgateway-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2a77566b8c2f5bf6100ae5d7eb4519daefa754e59b47e6d3a90aedbd4a5b7f44
MD5 ca0390481dab210be6a829bba726933b
BLAKE2b-256 9ffbfb289e52b19bcfcca42978effd6313748cfcdd50f687c4c8bcb08fa23a83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for abstractgateway-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1c57c0f41b9e679ae29a74262b817af90cea97734ebaee6addad25451c6f13b
MD5 9b44e8c6ac768468440e857376e37742
BLAKE2b-256 2068dab589114c1a21c5b566651c93c4fe17cdefbd74d2af4765db5d8bcf2256

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