pkg rename + docs

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