mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-06-10 17:35:57 +00:00
fix(runtime): use pass for protocol stubs
This commit is contained in:
@@ -10,7 +10,8 @@ from ..domain import Run
|
|||||||
class RunExecutor(Protocol):
|
class RunExecutor(Protocol):
|
||||||
"""Executes one run against the underlying agent or graph runtime."""
|
"""Executes one run against the underlying agent or graph runtime."""
|
||||||
|
|
||||||
async def execute(self, run: Run) -> None: ...
|
async def execute(self, run: Run) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ class RunExecutionHandle:
|
|||||||
class RunExecutionScheduler(Protocol):
|
class RunExecutionScheduler(Protocol):
|
||||||
"""Starts background execution for an accepted run."""
|
"""Starts background execution for an accepted run."""
|
||||||
|
|
||||||
async def start(self, run_id: RunId) -> RunExecutionHandle: ...
|
async def start(self, run_id: RunId) -> RunExecutionHandle:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ from ..domain import CancelAction, RunId
|
|||||||
class RunSupervisor(Protocol):
|
class RunSupervisor(Protocol):
|
||||||
"""Controls lifecycle operations for already scheduled runs."""
|
"""Controls lifecycle operations for already scheduled runs."""
|
||||||
|
|
||||||
async def cancel(self, run_id: RunId, *, action: CancelAction = CancelAction.interrupt) -> bool: ...
|
async def cancel(self, run_id: RunId, *, action: CancelAction = CancelAction.interrupt) -> bool:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ if TYPE_CHECKING:
|
|||||||
class RunEventLog(Protocol):
|
class RunEventLog(Protocol):
|
||||||
"""Persistence boundary for run messages and execution trace events."""
|
"""Persistence boundary for run messages and execution trace events."""
|
||||||
|
|
||||||
async def append(self, events: list[RunEvent]) -> list[StoredRunEvent]: ...
|
async def append(self, events: list[RunEvent]) -> list[StoredRunEvent]:
|
||||||
|
pass
|
||||||
|
|
||||||
async def list_messages_by_run(
|
async def list_messages_by_run(
|
||||||
self,
|
self,
|
||||||
@@ -23,7 +24,8 @@ class RunEventLog(Protocol):
|
|||||||
limit: int = 50,
|
limit: int = 50,
|
||||||
before_seq: int | None = None,
|
before_seq: int | None = None,
|
||||||
after_seq: int | None = None,
|
after_seq: int | None = None,
|
||||||
) -> list[RunMessageView]: ...
|
) -> list[RunMessageView]:
|
||||||
|
pass
|
||||||
|
|
||||||
async def list_events_by_run(
|
async def list_events_by_run(
|
||||||
self,
|
self,
|
||||||
@@ -31,7 +33,8 @@ class RunEventLog(Protocol):
|
|||||||
run_id: RunId,
|
run_id: RunId,
|
||||||
*,
|
*,
|
||||||
limit: int = 500,
|
limit: int = 500,
|
||||||
) -> list[StoredRunEvent]: ...
|
) -> list[StoredRunEvent]:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|||||||
@@ -13,9 +13,11 @@ if TYPE_CHECKING:
|
|||||||
class RunRepository(Protocol):
|
class RunRepository(Protocol):
|
||||||
"""Persistence boundary for run state snapshots."""
|
"""Persistence boundary for run state snapshots."""
|
||||||
|
|
||||||
async def save(self, run: Run) -> None: ...
|
async def save(self, run: Run) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
async def get(self, run_id: RunId, *, user_id: UserId | None = None) -> Run | None: ...
|
async def get(self, run_id: RunId, *, user_id: UserId | None = None) -> Run | None:
|
||||||
|
pass
|
||||||
|
|
||||||
async def list_by_thread(
|
async def list_by_thread(
|
||||||
self,
|
self,
|
||||||
@@ -23,9 +25,11 @@ class RunRepository(Protocol):
|
|||||||
*,
|
*,
|
||||||
user_id: UserId | None = None,
|
user_id: UserId | None = None,
|
||||||
limit: int = 100,
|
limit: int = 100,
|
||||||
) -> list[RunSnapshot]: ...
|
) -> list[RunSnapshot]:
|
||||||
|
pass
|
||||||
|
|
||||||
async def delete(self, run_id: RunId) -> bool: ...
|
async def delete(self, run_id: RunId) -> bool:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|||||||
@@ -19,9 +19,11 @@ class RunStreamEvent:
|
|||||||
class RunStreamBroker(Protocol):
|
class RunStreamBroker(Protocol):
|
||||||
"""Realtime publish/subscribe boundary for run streams."""
|
"""Realtime publish/subscribe boundary for run streams."""
|
||||||
|
|
||||||
async def publish(self, run_id: RunId, event: str, data: Any) -> None: ...
|
async def publish(self, run_id: RunId, event: str, data: Any) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
async def publish_terminal(self, run_id: RunId, *, event: str = "end", data: Any = None) -> None: ...
|
async def publish_terminal(self, run_id: RunId, *, event: str = "end", data: Any = None) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
def subscribe(
|
def subscribe(
|
||||||
self,
|
self,
|
||||||
@@ -29,9 +31,11 @@ class RunStreamBroker(Protocol):
|
|||||||
*,
|
*,
|
||||||
last_event_id: str | None = None,
|
last_event_id: str | None = None,
|
||||||
heartbeat_interval: float = 15.0,
|
heartbeat_interval: float = 15.0,
|
||||||
) -> AsyncIterator[RunStreamEvent]: ...
|
) -> AsyncIterator[RunStreamEvent]:
|
||||||
|
pass
|
||||||
|
|
||||||
async def cleanup(self, run_id: RunId, *, delay: float = 0) -> None: ...
|
async def cleanup(self, run_id: RunId, *, delay: float = 0) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|||||||
Reference in New Issue
Block a user