pkg rename + docs
This commit is contained in:
@@ -62,9 +62,8 @@ teardown. Until that exists, reload should be treated as best-effort remounting,
|
||||
not a fully safe session/subscription lifecycle.
|
||||
|
||||
Unified mode currently reuses `ProxyRuntime` as its proxy mounting engine. The
|
||||
`transparent_proxy` package name is therefore partly legacy: the code is still
|
||||
the place where configured upstream MCP connections become mounted FastMCP
|
||||
providers. `TransparentProxyRuntime` remains a compatibility alias.
|
||||
old `TransparentProxyRuntime` compatibility alias has been removed; use
|
||||
`ProxyRuntime` directly.
|
||||
|
||||
`ProxyRuntime` now owns a small `ProxyMountRegistry`. Proxy/admin tools are
|
||||
registered once on the top-level local provider; reload only clears the visible
|
||||
|
||||
@@ -16,7 +16,7 @@ from .models import (
|
||||
from .proxy_validation import ProxyConfigError, validate_transparent_proxy_config
|
||||
from .sdk import McpSdkAdapter
|
||||
from .storage import FileStore, Store
|
||||
from .transparent_proxy import (
|
||||
from .proxy import (
|
||||
create_transparent_proxy_client,
|
||||
create_transparent_proxy_server,
|
||||
)
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
from .admin import register_proxy_admin_tools
|
||||
from .runtime import (
|
||||
ProxyRuntime,
|
||||
TransparentProxyRuntime,
|
||||
create_transparent_proxy_client,
|
||||
create_transparent_proxy_server,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"ProxyRuntime",
|
||||
"TransparentProxyRuntime",
|
||||
"register_proxy_admin_tools",
|
||||
"create_transparent_proxy_client",
|
||||
"create_transparent_proxy_server",
|
||||
@@ -219,9 +219,6 @@ class ProxyRuntime:
|
||||
}
|
||||
|
||||
|
||||
TransparentProxyRuntime = ProxyRuntime
|
||||
|
||||
|
||||
def create_transparent_proxy_server(
|
||||
config: BrokerConfig,
|
||||
*,
|
||||
@@ -82,12 +82,14 @@ class PersistentSessionFactory:
|
||||
http_client = await stack.enter_async_context(
|
||||
httpx.AsyncClient(headers=_auth_headers(auth) or None)
|
||||
)
|
||||
read_stream, write_stream, _get_session_id = (
|
||||
await stack.enter_async_context(
|
||||
streamable_http_client(
|
||||
connection.metadata["url"],
|
||||
http_client=http_client,
|
||||
)
|
||||
(
|
||||
read_stream,
|
||||
write_stream,
|
||||
_get_session_id,
|
||||
) = await stack.enter_async_context(
|
||||
streamable_http_client(
|
||||
connection.metadata["url"],
|
||||
http_client=http_client,
|
||||
)
|
||||
)
|
||||
session = await stack.enter_async_context(
|
||||
|
||||
@@ -25,7 +25,9 @@ class PersistentMcpSession:
|
||||
client: ClientSession
|
||||
close_callback: Callable[[], Awaitable[None]] | None = None
|
||||
|
||||
async def call_tool(self, tool_name: str, payload: dict[str, Any]) -> ToolCallResult:
|
||||
async def call_tool(
|
||||
self, tool_name: str, payload: dict[str, Any]
|
||||
) -> ToolCallResult:
|
||||
result = await self.client.call_tool(tool_name, payload)
|
||||
return tool_result_to_call_result(result)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from ..broker.transport import normalize_transport
|
||||
from ..documentation import build_local_documentation_source
|
||||
from ..models import BrokerConfig
|
||||
from ..sdk import McpSdkAdapter
|
||||
from ..transparent_proxy.runtime import ProxyRuntime
|
||||
from ..proxy.runtime import ProxyRuntime
|
||||
from ..workflow_surface import register_workflow_tools
|
||||
from .prompts import register_documentation_prompts
|
||||
from .resources import register_documentation_resources
|
||||
|
||||
@@ -27,12 +27,12 @@ def test_root_facade_exports_core_entrypoints() -> None:
|
||||
|
||||
def test_concern_package_imports_resolve() -> None:
|
||||
from wf_mcp.broker import WfMcpService, load_broker_config
|
||||
from wf_mcp.proxy import ProxyRuntime
|
||||
from wf_mcp.sdk import McpSdkAdapter
|
||||
from wf_mcp.storage import FileStore
|
||||
from wf_mcp.transparent_proxy import ProxyRuntime, TransparentProxyRuntime
|
||||
|
||||
assert FileStore.__name__ == "FileStore"
|
||||
assert McpSdkAdapter.__name__ == "McpSdkAdapter"
|
||||
assert WfMcpService.__name__ == "WfMcpService"
|
||||
assert ProxyRuntime.__name__ == "ProxyRuntime"
|
||||
assert callable(load_broker_config)
|
||||
assert TransparentProxyRuntime is ProxyRuntime
|
||||
|
||||
@@ -9,7 +9,7 @@ from mcp.client.session import ClientSession
|
||||
from mcp.client.stdio import StdioServerParameters, stdio_client
|
||||
|
||||
from wf_mcp.models import BrokerConfig, ConnectionConfig
|
||||
from wf_mcp.transparent_proxy import create_transparent_proxy_client
|
||||
from wf_mcp.proxy import create_transparent_proxy_client
|
||||
|
||||
from .test_support import fixture_server_path, local_temp_root
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ from mcp.client.session import ClientSession
|
||||
from mcp.client.stdio import StdioServerParameters, stdio_client
|
||||
|
||||
from wf_mcp.models import BrokerConfig, ConnectionConfig
|
||||
from wf_mcp.transparent_proxy import create_transparent_proxy_client
|
||||
from wf_mcp.proxy import create_transparent_proxy_client
|
||||
|
||||
from .test_support import fixture_server_path, local_temp_root
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import annotations
|
||||
from pathlib import Path
|
||||
|
||||
from wf_mcp.models import BrokerConfig, ConnectionConfig
|
||||
from wf_mcp.transparent_proxy.mounts import ProxyMount, ProxyMountRegistry
|
||||
from wf_mcp.proxy.mounts import ProxyMount, ProxyMountRegistry
|
||||
|
||||
|
||||
def test_registry_reuses_unchanged_enabled_mount() -> None:
|
||||
|
||||
@@ -4,7 +4,7 @@ import asyncio
|
||||
|
||||
from fastmcp import FastMCP
|
||||
|
||||
from wf_mcp.transparent_proxy.safe_names import (
|
||||
from wf_mcp.proxy.safe_names import (
|
||||
SafeToolNames,
|
||||
encode_safe_tool_name,
|
||||
)
|
||||
|
||||
@@ -11,12 +11,12 @@ import pytest
|
||||
from wf_mcp.events import EventBus, InMemoryEventSink
|
||||
from wf_mcp.models import BrokerConfig, ConnectionConfig
|
||||
from wf_mcp.proxy_validation import ProxyConfigError, validate_transparent_proxy_config
|
||||
from wf_mcp.transparent_proxy import ProxyRuntime, create_transparent_proxy_client
|
||||
from wf_mcp.transparent_proxy.reload_events import (
|
||||
from wf_mcp.proxy import ProxyRuntime, create_transparent_proxy_client
|
||||
from wf_mcp.proxy.reload_events import (
|
||||
ProxyReloadResult,
|
||||
reload_change_events,
|
||||
)
|
||||
from wf_mcp.transparent_proxy.tools import ProxyToolPayload, ProxyToolsPage
|
||||
from wf_mcp.proxy.tools import ProxyToolPayload, ProxyToolsPage
|
||||
from wf_mcp.broker import load_broker_config
|
||||
|
||||
from .test_support import fixture_server_path, local_temp_root
|
||||
|
||||
@@ -104,7 +104,9 @@ def test_workflow_surface_filters_stdlib_capabilities_by_source() -> None:
|
||||
FileWorkflowArtifactStore(local_temp_root() / "surface_filtered_caps")
|
||||
)
|
||||
|
||||
payload = asyncio.run(handlers.list_capabilities(source_id="wf.std", query="truthy"))
|
||||
payload = asyncio.run(
|
||||
handlers.list_capabilities(source_id="wf.std", query="truthy")
|
||||
)
|
||||
|
||||
assert [capability["name"] for capability in payload["capabilities"]] == [
|
||||
"wf.std.truthy"
|
||||
|
||||
Reference in New Issue
Block a user