feat: 增强日历功能并集成 AgentScope 代理服务

This commit is contained in:
qzl
2026-03-11 17:16:11 +08:00
parent e20e7d2a02
commit 85b314cf64
53 changed files with 3642 additions and 297 deletions
@@ -0,0 +1,31 @@
from __future__ import annotations
from typing import Any, Protocol
class CodecLike(Protocol):
def to_wire(self, event: dict[str, Any]) -> dict[str, Any]: ...
class StoreLike(Protocol):
async def persist(self, event: dict[str, Any]) -> None: ...
class BusLike(Protocol):
async def publish(self, *, session_id: str, event: dict[str, Any]) -> str: ...
class AgentScopeEventPipeline:
_codec: CodecLike
_store: StoreLike
_bus: BusLike
def __init__(self, *, codec: CodecLike, store: StoreLike, bus: BusLike) -> None:
self._codec = codec
self._store = store
self._bus = bus
async def emit(self, *, session_id: str, event: dict[str, Any]) -> str:
wire_event = self._codec.to_wire(event)
await self._store.persist(wire_event)
return await self._bus.publish(session_id=session_id, event=wire_event)