wf reorg 6 remove pub uses

This commit is contained in:
lda
2026-05-08 22:19:04 +07:00 Verified
parent 8cb4e213d9
commit ea578d2e98
33 changed files with 19 additions and 215 deletions
-4
View File
@@ -16,10 +16,6 @@ overhead before the APIs settle.
| `wf_mcp.storage` | Persist auth records and catalog snapshots. |
| `wf_mcp.shared` | Pure helpers used across concerns, such as names, pagination, and error payloads. |
Root modules such as `wf_mcp.store`, `wf_mcp.service`, and
`wf_mcp.mcp_sdk_adapter` are compatibility shims. New internal imports should
prefer the concern package directly.
The root `wf_mcp` package is a small public facade for common user entrypoints,
not a dump of every internal helper. If a caller needs broker internals, SDK
adapter protocols, proxy admin pieces, or shared name parsing, import the
+1 -1
View File
@@ -24,7 +24,7 @@ from ..dsl import Expr, PathArg, compile_condition
from ..nodes.callables import SyncRegistryHandler
from ..nodes.registry import build_registry
from ..schemas import SchemaLike, StateSchemaLike, schema_ref_from, state_schema_from
from ..spec import NodeSpec
from ..nodes import NodeSpec
from .ids import next_step_id, slug_id
from .mapping import (
MapArg,
+1 -1
View File
@@ -6,7 +6,7 @@ from typing import Any, TypeAlias
from wf_core import SchemaRef, StateSchema
from ..dsl import GraphPath
from ..spec import NodeSpec
from ..nodes import NodeSpec
MapArg: TypeAlias = Mapping[Any, Any]
+1 -1
View File
@@ -4,7 +4,7 @@ from typing import Any, TypeAlias, TypeGuard
from wf_core import ConditionNode, ForeachNode, InterruptNode, NodeUse
from ..spec import NodeSpec
from ..nodes import NodeSpec
StepRef: TypeAlias = str | NodeUse | ConditionNode | ForeachNode | InterruptNode
BranchRef: TypeAlias = StepRef | NodeSpec[Any, Any]
-25
View File
@@ -1,25 +0,0 @@
from .nodes.callables import (
AsyncContextNodeCallable,
AsyncNodeCallable,
AsyncPlainNodeCallable,
AsyncRegistryHandler,
ContextNodeCallable,
InputT,
NodeCallable,
OutputT,
PlainNodeCallable,
SyncRegistryHandler,
)
__all__ = [
"AsyncContextNodeCallable",
"AsyncNodeCallable",
"AsyncPlainNodeCallable",
"AsyncRegistryHandler",
"ContextNodeCallable",
"InputT",
"NodeCallable",
"OutputT",
"PlainNodeCallable",
"SyncRegistryHandler",
]
+1 -1
View File
@@ -3,7 +3,7 @@ from __future__ import annotations
from dataclasses import dataclass
from typing import Any
from .spec import NodeSpec
from .nodes import NodeSpec
@dataclass(slots=True)
-21
View File
@@ -1,21 +0,0 @@
from .dsl.conditions import (
Expr,
PathExpr,
compile_condition,
context,
exists,
expr,
input,
state,
)
__all__ = [
"Expr",
"PathExpr",
"compile_condition",
"context",
"exists",
"expr",
"input",
"state",
]
-7
View File
@@ -1,7 +0,0 @@
from .nodes.inference import accepts_context, infer_models, is_basemodel_subclass
__all__ = [
"accepts_context",
"infer_models",
"is_basemodel_subclass",
]
-9
View File
@@ -1,9 +0,0 @@
from .dsl.mapping import PathArg, bind_fields, bind_state, merge_maps, normalize_path
__all__ = [
"PathArg",
"bind_fields",
"bind_state",
"merge_maps",
"normalize_path",
]
-9
View File
@@ -1,9 +0,0 @@
from .dsl.paths import GraphPath, context_path, graph_path, input_path, state_path
__all__ = [
"GraphPath",
"context_path",
"graph_path",
"input_path",
"state_path",
]
-39
View File
@@ -1,39 +0,0 @@
from .nodes import (
AsyncContextNodeCallable,
AsyncNodeCallable,
AsyncPlainNodeCallable,
AsyncRegistryHandler,
ContextNodeCallable,
InputT,
NodeCallable,
NodeReturn,
NodeSpec,
Nothing,
OutputT,
PlainNodeCallable,
SyncRegistryHandler,
build_async_registry,
build_registry,
node,
outcome,
)
__all__ = [
"AsyncContextNodeCallable",
"AsyncNodeCallable",
"AsyncPlainNodeCallable",
"AsyncRegistryHandler",
"ContextNodeCallable",
"InputT",
"NodeCallable",
"NodeReturn",
"NodeSpec",
"Nothing",
"OutputT",
"PlainNodeCallable",
"SyncRegistryHandler",
"build_async_registry",
"build_registry",
"node",
"outcome",
]
+1 -1
View File
@@ -7,7 +7,7 @@ from pydantic import BaseModel
from wf_core import RuntimeContext, Workflow, execute_workflow
from .spec import NodeSpec
from .nodes import NodeSpec
InputT = TypeVar("InputT", bound=BaseModel)
OutputT = TypeVar("OutputT", bound=BaseModel)
-3
View File
@@ -1,3 +0,0 @@
from .sdk.base import BackendAdapter, ToolCallResult
__all__ = ["BackendAdapter", "ToolCallResult"]
-15
View File
@@ -1,15 +0,0 @@
from .broker.server import (
build_service_from_config,
create_broker_server,
load_broker_config,
run_broker_server,
run_transparent_proxy_server,
)
__all__ = [
"build_service_from_config",
"create_broker_server",
"load_broker_config",
"run_broker_server",
"run_transparent_proxy_server",
]
-3
View File
@@ -1,3 +0,0 @@
from .broker.catalog import CombinedCatalog, snapshot_from_specs
__all__ = ["CombinedCatalog", "snapshot_from_specs"]
+1 -1
View File
@@ -6,7 +6,7 @@ import json
from pathlib import Path
from typing import Any
from .broker_server import (
from .broker import (
build_service_from_config,
load_broker_config,
run_broker_server,
-3
View File
@@ -1,3 +0,0 @@
from .control.manager import BrokerConfigManager, ConfigMutationError
__all__ = ["BrokerConfigManager", "ConfigMutationError"]
-13
View File
@@ -1,13 +0,0 @@
from .control.models import (
BrokerConfigFile,
ConnectionConfigFile,
HttpConnectionMetadata,
StdioConnectionMetadata,
)
__all__ = [
"BrokerConfigFile",
"ConnectionConfigFile",
"HttpConnectionMetadata",
"StdioConnectionMetadata",
]
-11
View File
@@ -1,11 +0,0 @@
from .broker.discovery import (
DiscoveredConnectionCapabilities,
discover_connection_capabilities,
specs_from_discovered_tools,
)
__all__ = [
"DiscoveredConnectionCapabilities",
"discover_connection_capabilities",
"specs_from_discovered_tools",
]
-3
View File
@@ -1,3 +0,0 @@
from .shared.errors import error_payload, root_exception
__all__ = ["error_payload", "root_exception"]
-3
View File
@@ -1,3 +0,0 @@
from .broker.events import McpEvent, make_event
__all__ = ["McpEvent", "make_event"]
-3
View File
@@ -1,3 +0,0 @@
from .sdk.adapter import McpSdkAdapter
__all__ = ["McpSdkAdapter"]
-17
View File
@@ -1,17 +0,0 @@
from .shared.names import (
ADMIN_NAMESPACE,
LdaNamespace,
ProxyToolName,
is_admin_tool_name,
namespaced_tool_name,
parse_namespaced_tool_name,
)
__all__ = [
"ADMIN_NAMESPACE",
"LdaNamespace",
"ProxyToolName",
"is_admin_tool_name",
"namespaced_tool_name",
"parse_namespaced_tool_name",
]
-3
View File
@@ -1,3 +0,0 @@
from .shared.pagination import clamp_limit, make_cursor, paginate_items, parse_cursor
__all__ = ["clamp_limit", "make_cursor", "paginate_items", "parse_cursor"]
-3
View File
@@ -1,3 +0,0 @@
from .broker.service import WfMcpService
__all__ = ["WfMcpService"]
-3
View File
@@ -1,3 +0,0 @@
from .storage import FileStore, Store
__all__ = ["FileStore", "Store"]
+1 -1
View File
@@ -9,9 +9,9 @@ from wf_authoring import NodeReturn, NodeSpec
from wf_core import RuntimeContext
from ..capabilities import DiscoveredTool
from ..events import McpEvent, make_event
from ..models import AuthRecord, ConnectionConfig
from ..sdk import BackendAdapter
from wf_mcp.broker.events import McpEvent, make_event
def _model_from_schema(name: str, schema: dict[str, Any]) -> type[BaseModel]:
-3
View File
@@ -1,3 +0,0 @@
from .workflow import wrap_discovered_tool
__all__ = ["wrap_discovered_tool"]
+5
View File
@@ -0,0 +1,5 @@
# rewrite of [lda/langgraph-demo][llgd]
so you know im using ts and influencing its design. im not just an user (lowk i am)
[llgd]: <https://git.ldlda.com/lda/langgraph-demo>
+1 -1
View File
@@ -7,7 +7,7 @@ import pytest
from pydantic import ValidationError
from wf_mcp.cli import build_parser, main
from wf_mcp.broker_server import load_broker_config
from wf_mcp.broker import load_broker_config
from .test_support import local_temp_root
+4 -5
View File
@@ -25,11 +25,10 @@ def test_root_facade_exports_core_entrypoints() -> None:
assert callable(load_broker_config)
def test_legacy_shim_imports_still_resolve() -> None:
from wf_mcp.broker_server import load_broker_config
from wf_mcp.mcp_sdk_adapter import McpSdkAdapter
from wf_mcp.service import WfMcpService
from wf_mcp.store import FileStore
def test_concern_package_imports_resolve() -> None:
from wf_mcp.broker import WfMcpService, load_broker_config
from wf_mcp.sdk import McpSdkAdapter
from wf_mcp.storage import FileStore
assert FileStore.__name__ == "FileStore"
assert McpSdkAdapter.__name__ == "McpSdkAdapter"
+1 -1
View File
@@ -1,6 +1,6 @@
from __future__ import annotations
from wf_mcp.names import (
from wf_mcp.shared.names import (
is_admin_tool_name,
namespaced_tool_name,
parse_namespaced_tool_name,
+1 -1
View File
@@ -10,7 +10,7 @@ import pytest
from wf_mcp.models import BrokerConfig, ConnectionConfig
from wf_mcp.proxy_validation import ProxyConfigError, validate_transparent_proxy_config
from wf_mcp.transparent_proxy import create_transparent_proxy_client
from wf_mcp.broker_server import load_broker_config
from wf_mcp.broker import load_broker_config
from .test_support import fixture_server_path, local_temp_root