Files
nanobot/nanobot/channels/_setup.py
T
chengyongru a4d2430140 refactor: remove redundant comments and docstrings (#6527)
* refactor: remove redundant comments and docstrings

* fix(signal): annotate async context manager as a generator
2026-10-30 13:07:03 +08:00

22 lines
547 B
Python

from __future__ import annotations
from typing import TYPE_CHECKING
from nanobot.channels.contracts import ChannelSetupSpec
if TYPE_CHECKING:
from nanobot.channels.plugin import ChannelPlugin
def channel_setup_spec(
name: str,
*,
plugin: ChannelPlugin | None = None,
) -> ChannelSetupSpec | None:
"""Return the setup contract declared by one channel descriptor."""
if plugin is None:
from nanobot.channels.registry import load_channel_plugin
plugin = load_channel_plugin(name)
return plugin.setup