- harness/es.py: append-only event store + проекции (образец — кооп-портал) - harness/levels.py: уровни 1с/1м/1ч/1д, контекст ∝ масштабу - harness/scheduler.py: уровневые потоки, идемпотентные тики, absorbed-стабы - harness/isolated_runner.py + _llm_worker.py: LLM-тик в сабпроцессе (глобальный asyncio-рантайм Strands не переживает 2+ create_harness) - cli.py: init/task/tasks/status/events + requeue (написан самим минутным агентом) - 9router: отдельный ключ sk-simbiot, модель auto (glm-5.3 первым)
21 lines
695 B
Python
21 lines
695 B
Python
"""Transport protocol for MCP clients."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from contextlib import AbstractAsyncContextManager
|
|
from typing import Protocol
|
|
|
|
from mcp.shared._stream_protocols import ReadStream, WriteStream
|
|
from mcp.shared.message import SessionMessage
|
|
|
|
__all__ = ["ReadStream", "WriteStream", "Transport", "TransportStreams"]
|
|
|
|
TransportStreams = tuple[ReadStream[SessionMessage | Exception], WriteStream[SessionMessage]]
|
|
|
|
|
|
class Transport(AbstractAsyncContextManager[TransportStreams], Protocol):
|
|
"""Protocol for MCP transports.
|
|
|
|
A transport is an async context manager that yields read and write streams
|
|
for bidirectional communication with an MCP server.
|
|
"""
|