refactor: compartmentalize mcp models
This commit is contained in:
@@ -12,13 +12,17 @@ from .server import (
|
||||
workflow_server_from_service,
|
||||
)
|
||||
from .config import build_service_from_config, load_broker_config
|
||||
from .models import BrokerConfig, ConnectionConfig, SourceConfigOwnership
|
||||
from .transport import normalize_transport
|
||||
from .service import WfMcpService
|
||||
|
||||
__all__ = [
|
||||
"BrokerConfig",
|
||||
"CombinedCatalog",
|
||||
"ConnectionConfig",
|
||||
"DiscoveredConnectionCapabilities",
|
||||
"McpEvent",
|
||||
"SourceConfigOwnership",
|
||||
"WfMcpService",
|
||||
"build_service_from_config",
|
||||
"build_workflow_server_from_config",
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
from typing import Any, Literal
|
||||
|
||||
|
||||
SourceConfigOwnership = Literal["locked", "seed"]
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class ConnectionConfig:
|
||||
id: str
|
||||
server: str
|
||||
account: str
|
||||
enabled: bool = True
|
||||
metadata: dict[str, Any] = field(default_factory=dict)
|
||||
source_config_ownership: SourceConfigOwnership = "locked"
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class BrokerConfig:
|
||||
store_root: Path
|
||||
connections: list[ConnectionConfig] = field(default_factory=list)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"BrokerConfig",
|
||||
"ConnectionConfig",
|
||||
"SourceConfigOwnership",
|
||||
]
|
||||
@@ -16,6 +16,7 @@ from wf_core import (
|
||||
Workflow,
|
||||
)
|
||||
from wf_api.models import RawWorkflowPlan
|
||||
from wf_mcp.capabilities import CatalogNodeEntry, CatalogPromptEntry, CatalogResourceEntry
|
||||
from wf_platform import (
|
||||
CapabilitySource,
|
||||
)
|
||||
@@ -23,9 +24,6 @@ from ...connections import ConnectionRegistry
|
||||
from ...events import EventBus, McpEvent
|
||||
from ...models import (
|
||||
AuthRecord,
|
||||
CatalogNodeEntry,
|
||||
CatalogPromptEntry,
|
||||
CatalogResourceEntry,
|
||||
CatalogSnapshot,
|
||||
BrokerConfig,
|
||||
ConnectionConfig,
|
||||
|
||||
@@ -7,6 +7,7 @@ from typing import Any
|
||||
|
||||
from pydantic import BaseModel
|
||||
from wf_authoring import NodeReturn, NodeSpec
|
||||
from wf_mcp.capabilities import CatalogNodeEntry, CatalogPromptEntry, CatalogResourceEntry
|
||||
from wf_platform import (
|
||||
CapabilityBuckets,
|
||||
CapabilitySource,
|
||||
@@ -21,9 +22,6 @@ from ...connections import ConnectionConfig, qualify_node_name
|
||||
from ...events import McpEvent, make_event
|
||||
from ...models import (
|
||||
AuthRecord,
|
||||
CatalogNodeEntry,
|
||||
CatalogPromptEntry,
|
||||
CatalogResourceEntry,
|
||||
CatalogSnapshot,
|
||||
)
|
||||
from ...runtime import ToolExecutor
|
||||
|
||||
Reference in New Issue
Block a user