feat: add workflow rpc server command

This commit is contained in:
lda
2026-06-03 07:12:10 +07:00 Verified
parent 66750a8386
commit 19e4c61257
3 changed files with 47 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
from __future__ import annotations
from pathlib import Path
import typer
import uvicorn
from wf_server import build_local_static_workflow_server
from .app import create_rpc_app
app = typer.Typer(add_completion=False)
@app.callback(invoke_without_command=True)
def serve(
store_root: Path = typer.Option(
...,
"--store-root",
help="Directory containing workflow artifact, draft, and run stores.",
),
host: str = typer.Option("127.0.0.1", "--host"),
port: int = typer.Option(8765, "--port", min=1, max=65535),
) -> None:
"""Serve the local/static WorkflowApi over JSON-RPC HTTP."""
server = build_local_static_workflow_server(store_root)
rpc_app = create_rpc_app(server)
uvicorn.run(rpc_app, host=host, port=port, access_log=False)
def main() -> None:
app()