refactor: add typed mcp source connection seam
This commit is contained in:
@@ -21,23 +21,31 @@ from .auth import (
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .connections import (
|
||||
McpSourceConnection,
|
||||
mcp_source_connection_from_connection_config,
|
||||
mcp_source_connection_from_registry_entry,
|
||||
)
|
||||
from .source_registry import (
|
||||
FileSourceRegistryStore,
|
||||
HttpSourceTransport,
|
||||
McpSourceRegistryEntry,
|
||||
SourceRegistryFile,
|
||||
SourceRegistryStore,
|
||||
SourceTransport,
|
||||
StdioSourceTransport,
|
||||
connection_config_to_registry_entry,
|
||||
registry_entry_to_connection_config,
|
||||
workflow_mcp_source_to_connection_config,
|
||||
)
|
||||
from .transports import (
|
||||
HttpSourceTransport,
|
||||
SourceTransport,
|
||||
StdioSourceTransport,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"AuthRecord",
|
||||
"FileSourceRegistryStore",
|
||||
"HttpSourceTransport",
|
||||
"McpSourceConnection",
|
||||
"McpSourceRegistryEntry",
|
||||
"SourceRegistryFile",
|
||||
"SourceRegistryStore",
|
||||
@@ -50,6 +58,8 @@ __all__ = [
|
||||
"mcp_auth_env",
|
||||
"mcp_auth_from_neutral",
|
||||
"mcp_auth_headers",
|
||||
"mcp_source_connection_from_connection_config",
|
||||
"mcp_source_connection_from_registry_entry",
|
||||
"neutral_auth_from_mcp",
|
||||
"registry_entry_to_connection_config",
|
||||
"workflow_mcp_source_to_connection_config",
|
||||
@@ -57,14 +67,19 @@ __all__ = [
|
||||
|
||||
|
||||
def __getattr__(name: str) -> object:
|
||||
if name in {
|
||||
"McpSourceConnection",
|
||||
"mcp_source_connection_from_connection_config",
|
||||
"mcp_source_connection_from_registry_entry",
|
||||
}:
|
||||
from . import connections
|
||||
|
||||
return getattr(connections, name)
|
||||
if name in {
|
||||
"FileSourceRegistryStore",
|
||||
"HttpSourceTransport",
|
||||
"McpSourceRegistryEntry",
|
||||
"SourceRegistryFile",
|
||||
"SourceRegistryStore",
|
||||
"SourceTransport",
|
||||
"StdioSourceTransport",
|
||||
"connection_config_to_registry_entry",
|
||||
"registry_entry_to_connection_config",
|
||||
"workflow_mcp_source_to_connection_config",
|
||||
@@ -72,4 +87,12 @@ def __getattr__(name: str) -> object:
|
||||
from . import source_registry
|
||||
|
||||
return getattr(source_registry, name)
|
||||
if name in {
|
||||
"HttpSourceTransport",
|
||||
"SourceTransport",
|
||||
"StdioSourceTransport",
|
||||
}:
|
||||
from . import transports
|
||||
|
||||
return getattr(transports, name)
|
||||
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
||||
|
||||
Reference in New Issue
Block a user