test ruff check fix fmt
This commit is contained in:
@@ -4,7 +4,6 @@ import sys
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from wf_mcp.models import BrokerConfig, ConnectionConfig
|
from wf_mcp.models import BrokerConfig, ConnectionConfig
|
||||||
from wf_mcp.proxy import create_proxy_client
|
|
||||||
|
|
||||||
from ..test_support import fixture_server_path, local_temp_root
|
from ..test_support import fixture_server_path, local_temp_root
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,10 @@ from __future__ import annotations
|
|||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import mcp.types as mcp_types
|
import mcp.types as mcp_types
|
||||||
|
|
||||||
from wf_mcp.broker import load_broker_config
|
from wf_mcp.broker import load_broker_config
|
||||||
from wf_mcp.models import BrokerConfig, ConnectionConfig
|
|
||||||
from wf_mcp.proxy import create_proxy_client
|
from wf_mcp.proxy import create_proxy_client
|
||||||
|
|
||||||
from ..test_support import fixture_server_path, local_temp_root
|
from ..test_support import fixture_server_path, local_temp_root
|
||||||
|
|||||||
@@ -1,15 +1,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
|
||||||
import json
|
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
|
||||||
from typing import Any
|
|
||||||
|
|
||||||
from wf_mcp.broker import load_broker_config
|
|
||||||
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 import ProxyRuntime, create_proxy_client
|
from wf_mcp.proxy import ProxyRuntime
|
||||||
from wf_mcp.proxy.reload_events import (
|
from wf_mcp.proxy.reload_events import (
|
||||||
ProxyReloadResult,
|
ProxyReloadResult,
|
||||||
reload_change_events,
|
reload_change_events,
|
||||||
@@ -17,7 +12,6 @@ from wf_mcp.proxy.reload_events import (
|
|||||||
from wf_mcp.proxy.tools import ProxyToolPayload, ProxyToolsPage
|
from wf_mcp.proxy.tools import ProxyToolPayload, ProxyToolsPage
|
||||||
|
|
||||||
from ..test_support import fixture_server_path, local_temp_root
|
from ..test_support import fixture_server_path, local_temp_root
|
||||||
from .conftest import structured
|
|
||||||
|
|
||||||
|
|
||||||
def test_proxy_runtime_reload_publishes_local_change_events() -> None:
|
def test_proxy_runtime_reload_publishes_local_change_events() -> None:
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import sys
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from wf_mcp.models import BrokerConfig, ConnectionConfig
|
from wf_mcp.models import BrokerConfig, ConnectionConfig
|
||||||
from wf_mcp.server import create_server_client
|
|
||||||
|
|
||||||
from ..test_support import fixture_server_path, local_temp_root
|
from ..test_support import fixture_server_path, local_temp_root
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import json
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from wf_mcp.broker.config import build_service_from_config, load_broker_config
|
from wf_mcp.broker.config import build_service_from_config
|
||||||
from wf_mcp.models import BrokerConfig, ConnectionConfig
|
|
||||||
from wf_mcp.server import create_server_client
|
from wf_mcp.server import create_server_client
|
||||||
|
|
||||||
from ..test_support import fixture_server_path, local_temp_root
|
|
||||||
from .conftest import server_config, structured
|
from .conftest import server_config, structured
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import sys
|
|||||||
from mcp import types as mcp_types
|
from mcp import types as mcp_types
|
||||||
|
|
||||||
from wf_mcp.broker.config import load_broker_config
|
from wf_mcp.broker.config import load_broker_config
|
||||||
from wf_mcp.models import BrokerConfig, ConnectionConfig
|
from wf_mcp.models import BrokerConfig
|
||||||
from wf_mcp.server import create_server_client
|
from wf_mcp.server import create_server_client
|
||||||
|
|
||||||
from ..test_support import fixture_server_path, local_temp_root
|
from ..test_support import fixture_server_path, local_temp_root
|
||||||
from .conftest import server_config, structured
|
from .conftest import structured
|
||||||
|
|
||||||
|
|
||||||
def test_server_exposes_platform_documentation_resources() -> None:
|
def test_server_exposes_platform_documentation_resources() -> None:
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
from typing import Any
|
|
||||||
|
|
||||||
from wf_mcp.models import BrokerConfig, ConnectionConfig
|
from wf_mcp.models import BrokerConfig
|
||||||
from wf_mcp.server import create_server_client
|
from wf_mcp.server import create_server_client
|
||||||
|
|
||||||
from ..test_support import fixture_server_path, local_temp_root
|
from ..test_support import local_temp_root
|
||||||
from .conftest import assert_safe_tool_maps, server_config, structured
|
from .conftest import assert_safe_tool_maps, server_config
|
||||||
|
|
||||||
|
|
||||||
def test_server_search_mode_pins_stable_control_and_workflow_tools() -> None:
|
def test_server_search_mode_pins_stable_control_and_workflow_tools() -> None:
|
||||||
|
|||||||
@@ -1,34 +1,18 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
from typing import Any
|
||||||
import shutil
|
|
||||||
from typing import Any, cast
|
|
||||||
|
|
||||||
from wf_artifacts import FileDraftWorkspaceStore, WorkflowDeployment
|
from wf_authoring import node
|
||||||
from wf_authoring import NodeSpec, build_async_registry, node
|
from wf_core import END
|
||||||
from wf_core import END, NodeUse, RunStatus, RuntimeContext
|
|
||||||
from wf_mcp.broker import WfMcpService
|
|
||||||
from wf_mcp.capabilities import DiscoveredTool
|
from wf_mcp.capabilities import DiscoveredTool
|
||||||
from wf_mcp.models import AuthRecord, ConnectionConfig, RawWorkflowPlan
|
from wf_mcp.models import AuthRecord, ConnectionConfig, RawWorkflowPlan
|
||||||
from wf_mcp.runtime import ToolExecutor
|
|
||||||
from wf_mcp.sdk import ToolCallResult
|
from wf_mcp.sdk import ToolCallResult
|
||||||
from wf_mcp.shared.errors import error_payload
|
|
||||||
from wf_mcp.storage import FileStore
|
|
||||||
from wf_platform import (
|
|
||||||
CapabilityBuckets,
|
|
||||||
CapabilitySource,
|
|
||||||
SourceVisibility,
|
|
||||||
)
|
|
||||||
|
|
||||||
from ..test_support import (
|
from ..test_support import (
|
||||||
EchoInput,
|
EchoInput,
|
||||||
EchoOutput,
|
EchoOutput,
|
||||||
FailingDiscoveryAdapter,
|
|
||||||
FakeAdapter,
|
FakeAdapter,
|
||||||
echo_tool,
|
|
||||||
finalize_tool,
|
|
||||||
input_binding,
|
input_binding,
|
||||||
local_temp_root,
|
|
||||||
output_binding,
|
output_binding,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import asyncio
|
|||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from wf_artifacts import FileDraftWorkspaceStore
|
from wf_artifacts import FileDraftWorkspaceStore
|
||||||
from wf_authoring import NodeSpec, node
|
from wf_authoring import NodeSpec
|
||||||
from wf_core import RunStatus
|
from wf_core import RunStatus
|
||||||
from wf_mcp.broker import WfMcpService
|
from wf_mcp.broker import WfMcpService
|
||||||
from wf_mcp.models import ConnectionConfig
|
from wf_mcp.models import ConnectionConfig
|
||||||
|
|||||||
@@ -20,10 +20,9 @@ from ..test_support import (
|
|||||||
|
|
||||||
|
|
||||||
def test_service_records_tool_call_events() -> None:
|
def test_service_records_tool_call_events() -> None:
|
||||||
from wf_authoring import node
|
|
||||||
from wf_core import END, RunStatus
|
from wf_core import END, RunStatus
|
||||||
|
|
||||||
from ..test_support import echo_tool, input_binding, output_binding
|
from ..test_support import input_binding, output_binding
|
||||||
from .conftest import raw_plan
|
from .conftest import raw_plan
|
||||||
|
|
||||||
service = WfMcpService(store=FileStore(local_temp_root() / "tool_event_store"))
|
service = WfMcpService(store=FileStore(local_temp_root() / "tool_event_store"))
|
||||||
@@ -75,7 +74,6 @@ def test_service_records_tool_call_events() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_service_rejects_text_binding_for_raw_mcp_content_contract() -> None:
|
def test_service_rejects_text_binding_for_raw_mcp_content_contract() -> None:
|
||||||
from wf_authoring import node
|
|
||||||
from wf_core import END
|
from wf_core import END
|
||||||
|
|
||||||
from ..test_support import input_binding, output_binding
|
from ..test_support import input_binding, output_binding
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from wf_authoring import NodeSpec, node
|
from wf_authoring import NodeSpec
|
||||||
from wf_mcp.broker import WfMcpService
|
from wf_mcp.broker import WfMcpService
|
||||||
from wf_mcp.models import ConnectionConfig
|
from wf_mcp.models import ConnectionConfig
|
||||||
from wf_mcp.storage import FileStore
|
from wf_mcp.storage import FileStore
|
||||||
@@ -47,8 +47,18 @@ def test_service_compiles_and_runs_raw_plan() -> None:
|
|||||||
"id": "echo",
|
"id": "echo",
|
||||||
"type": "node",
|
"type": "node",
|
||||||
"node": "demo.personal.echo_tool",
|
"node": "demo.personal.echo_tool",
|
||||||
"input": [{"target": {"root": "local", "parts": ["text"]}, "path": {"root": "input", "parts": ["text"]}}],
|
"input": [
|
||||||
"output": [{"source": {"root": "local", "parts": ["echoed"]}, "target": {"root": "state", "parts": ["echoed"]}}],
|
{
|
||||||
|
"target": {"root": "local", "parts": ["text"]},
|
||||||
|
"path": {"root": "input", "parts": ["text"]},
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"output": [
|
||||||
|
{
|
||||||
|
"source": {"root": "local", "parts": ["echoed"]},
|
||||||
|
"target": {"root": "state", "parts": ["echoed"]},
|
||||||
|
}
|
||||||
|
],
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
edges=[{"from": "echo", "outcome": "ok", "to": "__end__"}],
|
edges=[{"from": "echo", "outcome": "ok", "to": "__end__"}],
|
||||||
@@ -69,17 +79,35 @@ def test_service_preserves_raw_plan_root_output_bindings() -> None:
|
|||||||
|
|
||||||
plan = raw_plan(
|
plan = raw_plan(
|
||||||
name="root_output_plan",
|
name="root_output_plan",
|
||||||
input_schema={"type": "object", "properties": {"text": {"type": "string"}}, "required": ["text"]},
|
input_schema={
|
||||||
|
"type": "object",
|
||||||
|
"properties": {"text": {"type": "string"}},
|
||||||
|
"required": ["text"],
|
||||||
|
},
|
||||||
state_schema={"fields": {"echoed": {"type": "string"}}},
|
state_schema={"fields": {"echoed": {"type": "string"}}},
|
||||||
output_schema={"type": "object", "properties": {"echoed": {"type": "string"}}, "required": ["echoed"]},
|
output_schema={
|
||||||
|
"type": "object",
|
||||||
|
"properties": {"echoed": {"type": "string"}},
|
||||||
|
"required": ["echoed"],
|
||||||
|
},
|
||||||
start="echo",
|
start="echo",
|
||||||
nodes=[
|
nodes=[
|
||||||
{
|
{
|
||||||
"id": "echo",
|
"id": "echo",
|
||||||
"type": "node",
|
"type": "node",
|
||||||
"node": "demo.personal.echo_tool",
|
"node": "demo.personal.echo_tool",
|
||||||
"input": [{"target": {"root": "local", "parts": ["text"]}, "path": {"root": "input", "parts": ["text"]}}],
|
"input": [
|
||||||
"output": [{"source": {"root": "local", "parts": ["echoed"]}, "target": {"root": "state", "parts": ["echoed"]}}],
|
{
|
||||||
|
"target": {"root": "local", "parts": ["text"]},
|
||||||
|
"path": {"root": "input", "parts": ["text"]},
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"output": [
|
||||||
|
{
|
||||||
|
"source": {"root": "local", "parts": ["echoed"]},
|
||||||
|
"target": {"root": "state", "parts": ["echoed"]},
|
||||||
|
}
|
||||||
|
],
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
edges=[{"from": "echo", "outcome": "ok", "to": "__end__"}],
|
edges=[{"from": "echo", "outcome": "ok", "to": "__end__"}],
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
@@ -9,26 +8,16 @@ from wf_artifacts import (
|
|||||||
FileWorkflowArtifactStore,
|
FileWorkflowArtifactStore,
|
||||||
RequiredCapability,
|
RequiredCapability,
|
||||||
WorkflowArtifact,
|
WorkflowArtifact,
|
||||||
WorkflowDeployment,
|
|
||||||
)
|
)
|
||||||
from wf_authoring import node, reducer
|
from wf_authoring import node, reducer
|
||||||
from wf_mcp.broker import WfMcpService
|
from wf_mcp.broker import WfMcpService
|
||||||
from wf_mcp.models import AuthRecord, ConnectionConfig, RawWorkflowPlan
|
from wf_mcp.models import AuthRecord, ConnectionConfig
|
||||||
from wf_mcp.sdk import ToolCallResult
|
from wf_mcp.sdk import ToolCallResult
|
||||||
from wf_mcp.storage import FileStore
|
from wf_mcp.storage import FileStore
|
||||||
from wf_mcp.workflow_surface import TraceRange, WorkflowSurfaceHandlers
|
from wf_mcp.workflow_surface import WorkflowSurfaceHandlers
|
||||||
from wf_mcp.workflow_surface.models import CreateMinimalDraftWorkspaceRequest
|
|
||||||
from wf_core.models.steps import InputPathBinding, OutputBinding
|
|
||||||
from wf_core.paths import GraphSourcePath, LocalPath, StatePath
|
|
||||||
from wf_mcp.capabilities import DiscoveredTool
|
from wf_mcp.capabilities import DiscoveredTool
|
||||||
from wf_platform import (
|
|
||||||
CapabilityBuckets,
|
|
||||||
CapabilitySource,
|
|
||||||
SourcePermissions,
|
|
||||||
SourceVisibility,
|
|
||||||
)
|
|
||||||
|
|
||||||
from ..test_support import echo_tool, input_binding, local_temp_root, output_binding
|
from ..test_support import input_binding, output_binding
|
||||||
|
|
||||||
|
|
||||||
class AmountInput(BaseModel):
|
class AmountInput(BaseModel):
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import asyncio
|
|||||||
from wf_artifacts import FileWorkflowArtifactStore
|
from wf_artifacts import FileWorkflowArtifactStore
|
||||||
|
|
||||||
from ..test_support import local_temp_root
|
from ..test_support import local_temp_root
|
||||||
from .conftest import artifact, echo_artifact, handlers
|
from .conftest import artifact, handlers
|
||||||
|
|
||||||
|
|
||||||
def test_workflow_surface_lists_artifact_catalog_entries() -> None:
|
def test_workflow_surface_lists_artifact_catalog_entries() -> None:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from wf_artifacts import FileWorkflowArtifactStore, WorkflowArtifact
|
from wf_artifacts import FileWorkflowArtifactStore
|
||||||
from wf_mcp.broker import WfMcpService
|
from wf_mcp.broker import WfMcpService
|
||||||
from wf_mcp.models import ConnectionConfig
|
from wf_mcp.models import ConnectionConfig
|
||||||
from wf_mcp.storage import FileStore
|
from wf_mcp.storage import FileStore
|
||||||
@@ -37,13 +37,9 @@ def test_workflow_surface_lists_planner_visible_capabilities() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_workflow_surface_filters_stdlib_capabilities_by_source() -> None:
|
def test_workflow_surface_filters_stdlib_capabilities_by_source() -> None:
|
||||||
h = handlers(
|
h = handlers(FileWorkflowArtifactStore(local_temp_root() / "surface_filtered_caps"))
|
||||||
FileWorkflowArtifactStore(local_temp_root() / "surface_filtered_caps")
|
|
||||||
)
|
|
||||||
|
|
||||||
payload = asyncio.run(
|
payload = asyncio.run(h.list_capabilities(source_id="wf.std", query="truthy"))
|
||||||
h.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"
|
||||||
@@ -98,9 +94,7 @@ def test_workflow_surface_lists_saved_wrapper_capabilities() -> None:
|
|||||||
artifact_store.save_artifact(echo_artifact())
|
artifact_store.save_artifact(echo_artifact())
|
||||||
h = handlers(artifact_store)
|
h = handlers(artifact_store)
|
||||||
|
|
||||||
payload = asyncio.run(
|
payload = asyncio.run(h.list_capabilities(source_id="workflow", query="echo"))
|
||||||
h.list_capabilities(source_id="workflow", query="echo")
|
|
||||||
)
|
|
||||||
|
|
||||||
names = [capability["name"] for capability in payload["capabilities"]]
|
names = [capability["name"] for capability in payload["capabilities"]]
|
||||||
assert names == ["workflow.echo_wrapper.v1"]
|
assert names == ["workflow.echo_wrapper.v1"]
|
||||||
@@ -115,13 +109,9 @@ def test_workflow_surface_lists_saved_wrapper_capabilities() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_workflow_surface_inspects_one_capability() -> None:
|
def test_workflow_surface_inspects_one_capability() -> None:
|
||||||
h = handlers(
|
h = handlers(FileWorkflowArtifactStore(local_temp_root() / "surface_inspect_cap"))
|
||||||
FileWorkflowArtifactStore(local_temp_root() / "surface_inspect_cap")
|
|
||||||
)
|
|
||||||
|
|
||||||
payload = asyncio.run(
|
payload = asyncio.run(h.inspect_capability(qualified_name="wf.std.runtime_error"))
|
||||||
h.inspect_capability(qualified_name="wf.std.runtime_error")
|
|
||||||
)
|
|
||||||
|
|
||||||
assert payload["name"] == "wf.std.runtime_error"
|
assert payload["name"] == "wf.std.runtime_error"
|
||||||
assert payload["outcomes"] == ["ok"]
|
assert payload["outcomes"] == ["ok"]
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ from wf_core.paths import GraphSourcePath, LocalPath, StatePath
|
|||||||
|
|
||||||
from ..test_support import echo_tool, local_temp_root
|
from ..test_support import echo_tool, local_temp_root
|
||||||
from .conftest import (
|
from .conftest import (
|
||||||
echo_artifact,
|
|
||||||
echo_draft,
|
echo_draft,
|
||||||
handlers,
|
handlers,
|
||||||
mcp_echo_tool,
|
mcp_echo_tool,
|
||||||
@@ -222,9 +221,7 @@ def test_workflow_surface_deletes_draft_workspace() -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
deleted = asyncio.run(h.delete_draft_workspace(workspace_id="echo_draft"))
|
deleted = asyncio.run(h.delete_draft_workspace(workspace_id="echo_draft"))
|
||||||
deleted_again = asyncio.run(
|
deleted_again = asyncio.run(h.delete_draft_workspace(workspace_id="echo_draft"))
|
||||||
h.delete_draft_workspace(workspace_id="echo_draft")
|
|
||||||
)
|
|
||||||
listed = asyncio.run(h.list_draft_workspaces())
|
listed = asyncio.run(h.list_draft_workspaces())
|
||||||
|
|
||||||
assert deleted["deleted"] is True
|
assert deleted["deleted"] is True
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from wf_artifacts import FileWorkflowArtifactStore, WorkflowDeployment
|
from wf_artifacts import FileWorkflowArtifactStore, WorkflowDeployment
|
||||||
from wf_authoring import node, reducer
|
|
||||||
from wf_mcp.broker import WfMcpService
|
from wf_mcp.broker import WfMcpService
|
||||||
from wf_mcp.models import ConnectionConfig
|
from wf_mcp.models import ConnectionConfig
|
||||||
from wf_mcp.storage import FileStore
|
from wf_mcp.storage import FileStore
|
||||||
@@ -15,18 +14,14 @@ from wf_platform import (
|
|||||||
SourceVisibility,
|
SourceVisibility,
|
||||||
)
|
)
|
||||||
|
|
||||||
from ..test_support import echo_tool, input_binding, local_temp_root, output_binding
|
from ..test_support import echo_tool, local_temp_root
|
||||||
from .conftest import (
|
from .conftest import (
|
||||||
AmountInput,
|
|
||||||
AmountOutput,
|
|
||||||
amount_tool,
|
amount_tool,
|
||||||
changed_echo_tool,
|
changed_echo_tool,
|
||||||
custom_reducer_artifact,
|
custom_reducer_artifact,
|
||||||
echo_artifact,
|
echo_artifact,
|
||||||
echo_draft,
|
|
||||||
failing_artifact,
|
failing_artifact,
|
||||||
failing_tool,
|
failing_tool,
|
||||||
handlers,
|
|
||||||
logical_echo_artifact,
|
logical_echo_artifact,
|
||||||
multiply,
|
multiply,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user