feat: add durable run listing

This commit is contained in:
lda
2026-06-11 17:54:19 +07:00 Verified
parent a9ba32c8d7
commit 094a4f726b
15 changed files with 413 additions and 5 deletions
+14
View File
@@ -9,6 +9,7 @@ from wf_server import WorkflowServer
from ..errors import WorkflowRpcError, raise_workflow_rpc_error
from ..models import (
InspectRunParams,
ListRunsParams,
ReadRunTraceParams,
ResumeRunParams,
StartRunParams,
@@ -22,6 +23,19 @@ def register_methods(
) -> None:
"""Register run lifecycle JSON-RPC methods."""
@entrypoint.method(name="workflow.runs.list", errors=[WorkflowRpcError])
async def workflow_runs_list(
params: ListRunsParams = RpcParams(),
) -> dict[str, Any]:
try:
return await server.api.list_runs(
status=params.status,
cursor=params.cursor,
limit=params.limit,
)
except (ValueError, KeyError, LookupError, FileNotFoundError) as exc:
raise_workflow_rpc_error(exc)
@entrypoint.method(name="workflow.runs.start", errors=[WorkflowRpcError])
async def workflow_runs_start(
params: StartRunParams = RpcParams(),