refactor: move mcp auth record ownership
This commit is contained in:
+2
-3
@@ -1,11 +1,10 @@
|
||||
import asyncio
|
||||
|
||||
import mcp.types as mcp_types
|
||||
from fastmcp import Client
|
||||
from fastmcp import Client, Context, FastMCP
|
||||
from fastmcp.client.transports import FastMCPTransport
|
||||
from fastmcp.server import create_proxy
|
||||
from fastmcp import Context, FastMCP
|
||||
from fastmcp.dependencies import CurrentContext
|
||||
from fastmcp.server import create_proxy
|
||||
from pydantic import AnyUrl
|
||||
|
||||
server = FastMCP("notification-fixture")
|
||||
|
||||
@@ -9,6 +9,7 @@ from pydantic import BaseModel
|
||||
if __package__ in {None, ""}:
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
||||
|
||||
from examples.demo_workflow import build_demo_registry, build_demo_workflow
|
||||
from wf_authoring import (
|
||||
WorkflowBuilder,
|
||||
input_from,
|
||||
@@ -19,8 +20,6 @@ from wf_authoring import (
|
||||
from wf_core import END
|
||||
from wf_core.run_state import RunState
|
||||
|
||||
from examples.demo_workflow import build_demo_registry, build_demo_workflow
|
||||
|
||||
|
||||
class ChildInput(BaseModel):
|
||||
"""Input accepted by the wrapped child workflow."""
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from pathlib import Path
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from wf_core import END
|
||||
from wf_mcp.broker import WfMcpService
|
||||
|
||||
@@ -9,10 +9,10 @@ from wf_artifacts import (
|
||||
FileWorkflowArtifactStore,
|
||||
WorkflowDeployment,
|
||||
)
|
||||
from wf_mcp.broker import WfMcpService
|
||||
from wf_mcp.capabilities import DiscoveredPrompt, DiscoveredResource, DiscoveredTool
|
||||
from wf_mcp.models import AuthRecord, ConnectionConfig
|
||||
from wf_mcp.sdk import ToolCallResult
|
||||
from wf_mcp.broker import WfMcpService
|
||||
from wf_mcp.sdk.base import BackendAdapter
|
||||
from wf_mcp.storage import FileStore
|
||||
from wf_mcp.workflow_surface import WorkflowSurfaceHandlers
|
||||
|
||||
@@ -3,11 +3,10 @@ from __future__ import annotations
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from examples.mcp_workflow_surface import prepare_demo_service
|
||||
from wf_artifacts import WorkflowDeployment
|
||||
from wf_mcp.workflow_surface import WorkflowSurfaceHandlers
|
||||
|
||||
from examples.mcp_workflow_surface import prepare_demo_service
|
||||
|
||||
|
||||
async def author_echo_wrapper_from_capability(root: Path) -> dict[str, Any]:
|
||||
"""Author, save, deploy, and run one wrapper from capability hints.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import json
|
||||
import sys
|
||||
|
||||
from wf_core import RunState, execute_workflow, resume_workflow
|
||||
from examples.demo_workflow import build_demo_registry, build_demo_workflow
|
||||
from wf_core import RunState, execute_workflow, resume_workflow
|
||||
|
||||
|
||||
def print_run(label: str, run: RunState) -> None:
|
||||
|
||||
+15
-17
@@ -1,7 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from .auth import AUTH_ID_PATTERN, AuthRecord, AuthStore, validate_auth_id
|
||||
from .listing import matches_query, paged_list_payload
|
||||
from .admin import (
|
||||
WorkflowAdminApi,
|
||||
WorkflowAdminAuthProvider,
|
||||
@@ -9,8 +7,7 @@ from .admin import (
|
||||
WorkflowAdminEventProvider,
|
||||
)
|
||||
from .artifacts import WorkflowArtifactApi
|
||||
from .local_sources import builtin_sources, get_qualified_spec, qualify_spec
|
||||
from .models import RawWorkflowPlan, TraceRange
|
||||
from .auth import AUTH_ID_PATTERN, AuthRecord, AuthStore, validate_auth_id
|
||||
from .capabilities import WorkflowCapabilityApi
|
||||
from .constants import (
|
||||
DEFAULT_CALL_STEP_ID,
|
||||
@@ -21,9 +18,21 @@ from .constants import (
|
||||
)
|
||||
from .deployments import WorkflowDeploymentApi
|
||||
from .drafts import WorkflowDraftApi
|
||||
from .next_actions import NextActionPatchExample, NextActionTool, NextActions
|
||||
from .durable_context import durable_workflow_api, require_workflow_stores
|
||||
from .listing import matches_query, paged_list_payload
|
||||
from .local_sources import builtin_sources, get_qualified_spec, qualify_spec
|
||||
from .models import RawWorkflowPlan, TraceRange
|
||||
from .next_actions import NextActionPatchExample, NextActions, NextActionTool
|
||||
from .operation_context import (
|
||||
WorkflowEventRecorder,
|
||||
WorkflowLiveSourceChecker,
|
||||
WorkflowOperationContext,
|
||||
WorkflowRuntimeRunner,
|
||||
WorkflowSpecProvider,
|
||||
)
|
||||
from .refs import WorkflowSurfaceCapabilityId, parse_workflow_surface_capability_id
|
||||
from .runs import WorkflowRunApi
|
||||
from .runtime_dependencies import RuntimeDependencies, resolve_runtime_dependencies
|
||||
from .service import WorkflowApi
|
||||
from .source_admin import WorkflowSourceAdminApi
|
||||
from .source_registry_admin import (
|
||||
@@ -32,6 +41,7 @@ from .source_registry_admin import (
|
||||
WorkflowSourceRegistryMutationProvider,
|
||||
WorkflowSourceRegistryProvider,
|
||||
)
|
||||
from .stores import WorkflowStores, file_workflow_stores
|
||||
from .surface import (
|
||||
WorkflowAdminSurface,
|
||||
WorkflowApiSurface,
|
||||
@@ -55,18 +65,6 @@ from .wrapper_hints import (
|
||||
wrapper_hints_for_capability,
|
||||
)
|
||||
|
||||
from .operation_context import (
|
||||
WorkflowEventRecorder,
|
||||
WorkflowLiveSourceChecker,
|
||||
WorkflowOperationContext,
|
||||
WorkflowRuntimeRunner,
|
||||
WorkflowSpecProvider,
|
||||
)
|
||||
|
||||
from .runtime_dependencies import RuntimeDependencies, resolve_runtime_dependencies
|
||||
from .stores import WorkflowStores, file_workflow_stores
|
||||
from .durable_context import durable_workflow_api, require_workflow_stores
|
||||
|
||||
__all__ = [
|
||||
"AUTH_ID_PATTERN",
|
||||
"DEFAULT_CALL_STEP_ID",
|
||||
|
||||
@@ -14,6 +14,8 @@ from wf_artifacts import (
|
||||
RequiredCapability,
|
||||
WorkflowArtifact,
|
||||
artifact_catalog_entry,
|
||||
)
|
||||
from wf_artifacts import (
|
||||
create_workflow_artifact_from_plan as build_workflow_artifact_from_plan,
|
||||
)
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ from typing import Any
|
||||
|
||||
from wf_artifacts import (
|
||||
RequiredCapability,
|
||||
)
|
||||
from wf_artifacts import (
|
||||
create_workflow_artifact_from_plan as build_workflow_artifact_from_plan,
|
||||
)
|
||||
from wf_platform import CapabilityRef, NodeSpecInventory
|
||||
|
||||
@@ -6,12 +6,18 @@ from typing import Any
|
||||
from wf_artifacts import (
|
||||
DraftWorkspaceStore,
|
||||
compile_workflow_draft,
|
||||
create_draft_workspace as create_draft_workspace_record,
|
||||
get_draft_workspace as get_draft_workspace_record,
|
||||
patch_draft_workspace as patch_draft_workspace_record,
|
||||
patch_workflow_draft,
|
||||
validate_workflow_draft,
|
||||
)
|
||||
from wf_artifacts import (
|
||||
create_draft_workspace as create_draft_workspace_record,
|
||||
)
|
||||
from wf_artifacts import (
|
||||
get_draft_workspace as get_draft_workspace_record,
|
||||
)
|
||||
from wf_artifacts import (
|
||||
patch_draft_workspace as patch_draft_workspace_record,
|
||||
)
|
||||
from wf_core.models.steps import (
|
||||
InputBinding,
|
||||
InputPathBinding,
|
||||
|
||||
@@ -3,12 +3,31 @@ from __future__ import annotations
|
||||
from collections.abc import Mapping
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from wf_authoring import NodeSpec, coalesce, concat, constant, default_if_none
|
||||
from wf_authoring import extract_field, filter_items, filter_items_present, first_item
|
||||
from wf_authoring import first_item_maybe, first_item_or_none, is_empty, last_item
|
||||
from wf_authoring import last_item_or_none, length, node, pick_key, pick_path
|
||||
from wf_authoring import project_fields, rename_fields, runtime_error, truthy
|
||||
from wf_authoring import extract_text_content
|
||||
from wf_authoring import (
|
||||
NodeSpec,
|
||||
coalesce,
|
||||
concat,
|
||||
constant,
|
||||
default_if_none,
|
||||
extract_field,
|
||||
extract_text_content,
|
||||
filter_items,
|
||||
filter_items_present,
|
||||
first_item,
|
||||
first_item_maybe,
|
||||
first_item_or_none,
|
||||
is_empty,
|
||||
last_item,
|
||||
last_item_or_none,
|
||||
length,
|
||||
node,
|
||||
pick_key,
|
||||
pick_path,
|
||||
project_fields,
|
||||
rename_fields,
|
||||
runtime_error,
|
||||
truthy,
|
||||
)
|
||||
from wf_core.runtime.ops.merges import DEFAULT_REDUCER_DEFINITIONS
|
||||
from wf_platform import (
|
||||
CapabilityBuckets,
|
||||
|
||||
@@ -4,6 +4,7 @@ from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from wf_core import Edge
|
||||
from wf_core.models.steps import InputBinding, Step
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
from datetime import UTC, datetime
|
||||
from uuid import uuid4
|
||||
|
||||
from wf_api.saved_subgraphs import SavedSubgraphTree
|
||||
from wf_artifacts import (
|
||||
AvailableSource,
|
||||
CheckpointReason,
|
||||
@@ -26,8 +27,6 @@ from wf_core import (
|
||||
load_run_state,
|
||||
)
|
||||
|
||||
from wf_api.saved_subgraphs import SavedSubgraphTree
|
||||
|
||||
|
||||
def create_pinned_environment(
|
||||
*,
|
||||
|
||||
+1
-1
@@ -14,6 +14,7 @@ from wf_core import RunState
|
||||
from .artifact_plans import raw_plan_from_artifact
|
||||
from .deployments import WorkflowDeploymentApi, _available_sources
|
||||
from .next_actions import NextActions
|
||||
from .operation_context import WorkflowOperationContext
|
||||
from .run_lifecycle import (
|
||||
create_pinned_environment,
|
||||
has_blocking_diagnostics,
|
||||
@@ -24,7 +25,6 @@ from .run_lifecycle import (
|
||||
validate_pinned_resume_environment,
|
||||
)
|
||||
from .saved_subgraphs import saved_subgraph_tree_from_snapshots
|
||||
from .operation_context import WorkflowOperationContext
|
||||
|
||||
|
||||
class TraceRangeLike(Protocol):
|
||||
|
||||
@@ -3,15 +3,9 @@ from .catalog import (
|
||||
artifact_catalog_entry,
|
||||
artifact_node_name,
|
||||
)
|
||||
from .factory import create_workflow_artifact_from_plan
|
||||
from .drafts import (
|
||||
compile_workflow_draft,
|
||||
patch_workflow_draft,
|
||||
validate_workflow_draft,
|
||||
)
|
||||
from .draft_workspaces import (
|
||||
DraftWorkspaceStore,
|
||||
DraftWorkspaceConflictError,
|
||||
DraftWorkspaceStore,
|
||||
FileDraftWorkspaceStore,
|
||||
WorkflowDraftWorkspace,
|
||||
create_draft_workspace,
|
||||
@@ -20,6 +14,12 @@ from .draft_workspaces import (
|
||||
patch_draft_workspace,
|
||||
summarize_draft_workspace,
|
||||
)
|
||||
from .drafts import (
|
||||
compile_workflow_draft,
|
||||
patch_workflow_draft,
|
||||
validate_workflow_draft,
|
||||
)
|
||||
from .factory import create_workflow_artifact_from_plan
|
||||
from .models import (
|
||||
ArtifactKind,
|
||||
AvailableCapability,
|
||||
@@ -32,13 +32,13 @@ from .models import (
|
||||
WorkflowArtifact,
|
||||
WorkflowDeployment,
|
||||
)
|
||||
from .references import logical_ref_for_concrete_ref, normalize_plan_node_refs
|
||||
from .refs import (
|
||||
WorkflowCapabilityRef,
|
||||
workflow_capability_ref_from_workflow_ref,
|
||||
workflow_ref_from_artifact,
|
||||
workflow_ref_from_capability,
|
||||
)
|
||||
from .store import FileWorkflowArtifactStore, WorkflowArtifactStore
|
||||
from .runs import (
|
||||
CheckpointReason,
|
||||
FileRunStore,
|
||||
@@ -50,8 +50,8 @@ from .runs import (
|
||||
WorkflowRunRecord,
|
||||
ensure_run_id,
|
||||
)
|
||||
from .store import FileWorkflowArtifactStore, WorkflowArtifactStore
|
||||
from .validation import validate_deployment_dependencies
|
||||
from .references import logical_ref_for_concrete_ref, normalize_plan_node_refs
|
||||
|
||||
__all__ = [
|
||||
"AvailableCapability",
|
||||
|
||||
@@ -14,8 +14,8 @@ from .models import (
|
||||
DraftJoinStep,
|
||||
DraftMatchCase,
|
||||
DraftMatchStep,
|
||||
DraftWhenStep,
|
||||
DraftUseStep,
|
||||
DraftWhenStep,
|
||||
WorkflowDraft,
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from copy import deepcopy
|
||||
from collections.abc import Callable
|
||||
from copy import deepcopy
|
||||
from typing import Any
|
||||
|
||||
import jsonpatch
|
||||
|
||||
@@ -19,6 +19,18 @@ from .dsl import (
|
||||
state,
|
||||
state_path,
|
||||
)
|
||||
from .nodes import (
|
||||
AsyncRegistryHandler,
|
||||
NodeReturn,
|
||||
NodeSpec,
|
||||
NoOutput,
|
||||
Nothing,
|
||||
SyncRegistryHandler,
|
||||
build_async_registry,
|
||||
build_registry,
|
||||
node,
|
||||
outcome,
|
||||
)
|
||||
from .ops import (
|
||||
BoolOutput,
|
||||
CoalesceInput,
|
||||
@@ -29,11 +41,11 @@ from .ops import (
|
||||
FilterItemsInput,
|
||||
FilterItemsPresentInput,
|
||||
ItemOutput,
|
||||
MappingOutput,
|
||||
MappingItemsOutput,
|
||||
MappingOutput,
|
||||
MaybeItemOutput,
|
||||
PickPathInput,
|
||||
PickKeyInput,
|
||||
PickPathInput,
|
||||
ProjectFieldsInput,
|
||||
RenameFieldsInput,
|
||||
RuntimeErrorInput,
|
||||
@@ -56,26 +68,13 @@ from .ops import (
|
||||
last_item,
|
||||
last_item_or_none,
|
||||
length,
|
||||
pick_path,
|
||||
pick_key,
|
||||
pick_path,
|
||||
project_fields,
|
||||
rename_fields,
|
||||
runtime_error,
|
||||
truthy,
|
||||
)
|
||||
from .nodes import (
|
||||
AsyncRegistryHandler,
|
||||
NoOutput,
|
||||
NodeReturn,
|
||||
NodeSpec,
|
||||
Nothing,
|
||||
SyncRegistryHandler,
|
||||
build_async_registry,
|
||||
build_registry,
|
||||
node,
|
||||
outcome,
|
||||
)
|
||||
from .reducers import AuthoredReducer, ReducerCatalog, reducer
|
||||
from .recipes import (
|
||||
ExtractTextContentInput,
|
||||
ExtractTextContentOutput,
|
||||
@@ -84,6 +83,7 @@ from .recipes import (
|
||||
build_extract_text_content_workflow,
|
||||
extract_text_content,
|
||||
)
|
||||
from .reducers import AuthoredReducer, ReducerCatalog, reducer
|
||||
from .schemas import StateFieldMetadata, state_field
|
||||
from .subgraph import async_subgraph_node, subgraph_node, subgraph_ref
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import warnings
|
||||
from collections.abc import Mapping, Sequence
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any, Literal, overload, cast
|
||||
import warnings
|
||||
from typing import Any, Literal, cast, overload
|
||||
from warnings import deprecated
|
||||
|
||||
from wf_authoring.ops.values import runtime_error
|
||||
@@ -18,18 +18,18 @@ from wf_core import (
|
||||
NodeHandler,
|
||||
NodeUse,
|
||||
PreparedSubgraph,
|
||||
RunState,
|
||||
SchemaRef,
|
||||
StateSchema,
|
||||
SubgraphNode,
|
||||
Workflow,
|
||||
WorkflowRef,
|
||||
RunState,
|
||||
execute_workflow,
|
||||
resume_workflow,
|
||||
)
|
||||
from wf_core.errors import WorkflowExecutionError
|
||||
from wf_core.models.conditions import Condition as CoreCondition
|
||||
from wf_core.models.conditions import BinaryCondition, ExistsCondition, PathOperand
|
||||
from wf_core.models.conditions import Condition as CoreCondition
|
||||
from wf_core.models.steps import (
|
||||
InputBinding,
|
||||
InputPathBinding,
|
||||
@@ -42,12 +42,12 @@ from wf_core.runtime.ops.merges import ReducerDefinition
|
||||
from wf_platform import CapabilityRef
|
||||
|
||||
from ..dsl import Expr, GraphPath, PathArg, PathExpr, compile_condition
|
||||
from ..nodes import NodeSpec
|
||||
from ..nodes.callables import SyncRegistryHandler
|
||||
from ..nodes.registry import build_registry
|
||||
from ..reducers import ReducerCatalog
|
||||
from ..schemas import SchemaLike, StateSchemaLike, schema_ref_from, state_schema_from
|
||||
from ..subgraph import subgraph_ref
|
||||
from ..nodes import NodeSpec
|
||||
from .ids import next_step_id, slug_id
|
||||
from .mapping import (
|
||||
InputBindingArg,
|
||||
|
||||
@@ -14,8 +14,8 @@ from wf_core.models.conditions import (
|
||||
)
|
||||
from wf_core.paths import GraphSourcePath
|
||||
|
||||
from .paths import GraphPath, context_path, input_path, state_path
|
||||
from .path_inputs import PathInput
|
||||
from .paths import GraphPath, context_path, input_path, state_path
|
||||
|
||||
|
||||
def _operand(value: object) -> PathOperand | LiteralOperand:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Iterable, Mapping
|
||||
import tomllib
|
||||
from collections.abc import Iterable, Mapping
|
||||
from typing import TypeAlias, cast
|
||||
|
||||
from wf_core.paths import GraphRoot, GraphSourcePath, LocalPath, StatePath
|
||||
|
||||
@@ -10,10 +10,10 @@ from .callables import (
|
||||
PlainNodeCallable,
|
||||
SyncRegistryHandler,
|
||||
)
|
||||
from .inference import accepts_context, infer_models, is_basemodel_subclass
|
||||
from .decorator import node
|
||||
from .inference import accepts_context, infer_models, is_basemodel_subclass
|
||||
from .registry import build_async_registry, build_registry
|
||||
from .result import NoOutput, NodeReturn, Nothing, outcome
|
||||
from .result import NodeReturn, NoOutput, Nothing, outcome
|
||||
from .schema import schema_ref_for
|
||||
from .spec import NodeSpec
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from inspect import iscoroutinefunction
|
||||
from collections.abc import Callable
|
||||
from inspect import iscoroutinefunction
|
||||
from typing import Any, cast, overload
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from inspect import Parameter, signature
|
||||
from collections.abc import Callable
|
||||
from inspect import Parameter, signature
|
||||
from typing import cast, get_args, get_origin, get_type_hints
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
@@ -25,20 +25,20 @@ from .values import (
|
||||
ConcatInput,
|
||||
ConstantInput,
|
||||
MappingOutput,
|
||||
PickPathInput,
|
||||
PickKeyInput,
|
||||
PickPathInput,
|
||||
ProjectFieldsInput,
|
||||
RenameFieldsInput,
|
||||
RuntimeErrorInput,
|
||||
TruthyInput,
|
||||
TextOutput,
|
||||
TruthyInput,
|
||||
ValueOutput,
|
||||
coalesce,
|
||||
concat,
|
||||
constant,
|
||||
default_if_none,
|
||||
pick_path,
|
||||
pick_key,
|
||||
pick_path,
|
||||
project_fields,
|
||||
rename_fields,
|
||||
runtime_error,
|
||||
|
||||
+3
-1
@@ -8,7 +8,6 @@ from .commands import (
|
||||
admin,
|
||||
artifacts,
|
||||
caps,
|
||||
config as config_commands,
|
||||
deployments,
|
||||
docs,
|
||||
drafts,
|
||||
@@ -17,6 +16,9 @@ from .commands import (
|
||||
schema,
|
||||
sources,
|
||||
)
|
||||
from .commands import (
|
||||
config as config_commands,
|
||||
)
|
||||
from .context import CliTyperState
|
||||
|
||||
app = typer.Typer(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Annotated
|
||||
|
||||
import typer
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Annotated, Literal
|
||||
|
||||
import typer
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Annotated
|
||||
|
||||
import typer
|
||||
|
||||
@@ -5,9 +5,8 @@ from typing import Annotated
|
||||
|
||||
import typer
|
||||
|
||||
from wf_mcp.broker.config import migrate_broker_config_file
|
||||
|
||||
from wf_cli.io import emit_json
|
||||
from wf_mcp.broker.config import migrate_broker_config_file
|
||||
|
||||
app = typer.Typer(
|
||||
name="config",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Annotated
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Annotated, Literal
|
||||
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
from __future__ import annotations
|
||||
from pathlib import Path
|
||||
|
||||
import time
|
||||
from pathlib import Path
|
||||
from typing import Annotated
|
||||
|
||||
import typer
|
||||
|
||||
from wf_api import TraceRange
|
||||
from wf_cli.context import load_cli_context_from_typer
|
||||
from wf_cli.io import CliInputError, emit_json, parse_json_input
|
||||
from wf_cli.remote_errors import run_cli_operation
|
||||
from wf_api import TraceRange
|
||||
|
||||
app = typer.Typer(
|
||||
name="run",
|
||||
@@ -99,7 +100,9 @@ def watch_run(
|
||||
context = load_cli_context_from_typer(ctx)
|
||||
started_at = time.monotonic()
|
||||
while True:
|
||||
payload = run_cli_operation(context, context.handlers.inspect_run(run_id=run_id))
|
||||
payload = run_cli_operation(
|
||||
context, context.handlers.inspect_run(run_id=run_id)
|
||||
)
|
||||
if payload.get("status") in _STOPPED_RUN_STATUSES:
|
||||
if include_trace:
|
||||
trace_payload = run_cli_operation(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Annotated, Any
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Annotated
|
||||
|
||||
import typer
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
import json
|
||||
from collections.abc import Mapping
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
import typer
|
||||
from pydantic import ValidationError
|
||||
|
||||
from wf_api import (
|
||||
WorkflowApi,
|
||||
WorkflowAdminApi,
|
||||
WorkflowAdminSurface,
|
||||
WorkflowApi,
|
||||
WorkflowApiSurface,
|
||||
WorkflowSourceAdminApi,
|
||||
WorkflowSourceAdminSurface,
|
||||
@@ -267,7 +267,7 @@ def _rpc_timeout_from_optional_config(
|
||||
return override
|
||||
try:
|
||||
config = load_workflow_config(path)
|
||||
except (FileNotFoundError, json.JSONDecodeError, ValidationError):
|
||||
except FileNotFoundError, json.JSONDecodeError, ValidationError:
|
||||
return 30.0
|
||||
target = config.client.target
|
||||
if isinstance(target, RpcHttpTargetConfig):
|
||||
|
||||
@@ -2,7 +2,6 @@ from __future__ import annotations
|
||||
|
||||
from .models import ExplainCard
|
||||
|
||||
|
||||
EXPLAIN_CARDS: tuple[ExplainCard, ...] = (
|
||||
ExplainCard(
|
||||
code="source_missing",
|
||||
|
||||
+18
-18
@@ -1,7 +1,7 @@
|
||||
from .models import (
|
||||
ConditionNode,
|
||||
EndNode,
|
||||
Edge,
|
||||
EndNode,
|
||||
ForeachConcurrentPolicy,
|
||||
ForeachItemErrorPolicy,
|
||||
ForeachNode,
|
||||
@@ -21,33 +21,33 @@ from .models import (
|
||||
WorkflowRef,
|
||||
workflow_ref_from,
|
||||
)
|
||||
from .runtime import (
|
||||
AsyncNodeHandler,
|
||||
NodeHandler,
|
||||
PreparedSubgraph,
|
||||
WorkflowExecutionError,
|
||||
coerce_node_result,
|
||||
execute_workflow_async,
|
||||
execute_workflow_result_async,
|
||||
execute_workflow,
|
||||
resume_workflow_async,
|
||||
resume_workflow_result_async,
|
||||
resume_workflow,
|
||||
step_workflow_async,
|
||||
step_workflow,
|
||||
)
|
||||
from .run_codec import PersistedRunState, dump_run_state, load_run_state
|
||||
from .run_state import (
|
||||
ExecutionFrame,
|
||||
FrameStatus,
|
||||
InterruptRoute,
|
||||
InterruptRequest,
|
||||
InterruptRoute,
|
||||
RunState,
|
||||
RunStatus,
|
||||
RuntimeContext,
|
||||
StepExecutionResult,
|
||||
TraceEntry,
|
||||
)
|
||||
from .run_codec import PersistedRunState, dump_run_state, load_run_state
|
||||
from .runtime import (
|
||||
AsyncNodeHandler,
|
||||
NodeHandler,
|
||||
PreparedSubgraph,
|
||||
WorkflowExecutionError,
|
||||
coerce_node_result,
|
||||
execute_workflow,
|
||||
execute_workflow_async,
|
||||
execute_workflow_result_async,
|
||||
resume_workflow,
|
||||
resume_workflow_async,
|
||||
resume_workflow_result_async,
|
||||
step_workflow,
|
||||
step_workflow_async,
|
||||
)
|
||||
from .tokens import END, START
|
||||
from .validation import (
|
||||
ValidationIssue,
|
||||
|
||||
@@ -11,8 +11,8 @@ from .models.conditions import (
|
||||
LiteralOperand,
|
||||
NotCondition,
|
||||
PathOperand,
|
||||
VariadicCondition,
|
||||
)
|
||||
from .models.conditions import VariadicCondition
|
||||
from .paths import PathResolutionError, path_exists, resolve_graph_path
|
||||
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ from wf_core.models.conditions import (
|
||||
PathOperand,
|
||||
VariadicCondition,
|
||||
)
|
||||
from wf_core.models.results import NodeResult
|
||||
from wf_core.models.reducers import ReducerRef, ReducerSpec, SiblingWritePolicy
|
||||
from wf_core.models.results import NodeResult
|
||||
from wf_core.models.schemas import NodeDef, SchemaRef, StateField, StateSchema
|
||||
from wf_core.models.steps import (
|
||||
ConditionNode,
|
||||
|
||||
@@ -15,8 +15,8 @@ from .engine import (
|
||||
resume_workflow_async,
|
||||
resume_workflow_result_async,
|
||||
)
|
||||
from .subgraphs import PreparedSubgraph
|
||||
from .step import complete_step, step_workflow, step_workflow_async
|
||||
from .subgraphs import PreparedSubgraph
|
||||
|
||||
__all__ = [
|
||||
"AsyncNodeHandler",
|
||||
|
||||
@@ -5,12 +5,12 @@ from typing import Any
|
||||
|
||||
from wf_core.errors import WorkflowExecutionError
|
||||
from wf_core.models.workflow import Workflow
|
||||
from wf_core.run_state import ROOT_SCOPE_ID, RunState, RunStatus
|
||||
from wf_core.runtime.ops.flow import finalize_run
|
||||
from wf_core.runtime.ops.merges import ReducerDefinition
|
||||
from wf_core.runtime.ops.nodes import AsyncNodeHandler, NodeHandler
|
||||
from wf_core.runtime.ops.runs import create_run_state
|
||||
from wf_core.runtime.scheduler import resolve_no_ready_frames, select_next_frame
|
||||
from wf_core.run_state import ROOT_SCOPE_ID, RunState, RunStatus
|
||||
from wf_core.tokens import END
|
||||
|
||||
from .preparation import prepare_new_run, prepare_resume
|
||||
|
||||
@@ -8,8 +8,11 @@ from typing import Any
|
||||
from wf_core.errors import WorkflowExecutionError
|
||||
from wf_core.run_state import ExecutionFrame, LineageState, RunState, StateWrite
|
||||
from wf_core.runtime.foreach_state import ForeachBarrierState, item_frame_owner
|
||||
from wf_core.runtime.ops.state import StatePatch
|
||||
from wf_core.runtime.ops.state import commit_state_patch, safe_set_nested_value
|
||||
from wf_core.runtime.ops.state import (
|
||||
StatePatch,
|
||||
commit_state_patch,
|
||||
safe_set_nested_value,
|
||||
)
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
|
||||
@@ -5,12 +5,12 @@ from copy import deepcopy
|
||||
from wf_core.models.workflow import Workflow
|
||||
from wf_core.paths import set_nested_value
|
||||
from wf_core.run_state import (
|
||||
ExecutionFrame,
|
||||
FrameStatus,
|
||||
LineageState,
|
||||
ROOT_FRAME_ID,
|
||||
ROOT_LINEAGE_ID,
|
||||
ROOT_SCOPE_ID,
|
||||
ExecutionFrame,
|
||||
FrameStatus,
|
||||
LineageState,
|
||||
RunState,
|
||||
RunStatus,
|
||||
RuntimeScope,
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from jsonschema import ValidationError, SchemaError, validators
|
||||
from jsonschema import SchemaError, ValidationError, validators
|
||||
|
||||
from wf_core.errors import WorkflowExecutionError
|
||||
from wf_core.models.schemas import SchemaRef
|
||||
|
||||
@@ -2,7 +2,8 @@ from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping, Sequence
|
||||
from copy import deepcopy
|
||||
from dataclasses import dataclass, field as dataclass_field
|
||||
from dataclasses import dataclass
|
||||
from dataclasses import field as dataclass_field
|
||||
from typing import Any
|
||||
|
||||
from wf_core.conditions import safe_resolve_path
|
||||
|
||||
@@ -5,12 +5,12 @@ from typing import Any
|
||||
|
||||
from wf_core.errors import WorkflowExecutionError
|
||||
from wf_core.models.workflow import Workflow
|
||||
from wf_core.run_state import FrameStatus, RunState, RunStatus
|
||||
from wf_core.runtime.ops.index import WorkflowIndex, build_workflow_index
|
||||
from wf_core.runtime.ops.interrupts import resume_interrupt
|
||||
from wf_core.runtime.ops.merges import ReducerDefinition
|
||||
from wf_core.runtime.ops.schemas import validate_payload_against_schema
|
||||
from wf_core.runtime.scheduler import wake_frame
|
||||
from wf_core.run_state import FrameStatus, RunState, RunStatus
|
||||
from wf_core.tokens import END
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ from wf_core.models.steps import (
|
||||
SubgraphNode,
|
||||
)
|
||||
from wf_core.models.workflow import Workflow
|
||||
from wf_core.run_state import ExecutionFrame, FrameStatus, RunState, StepExecutionResult
|
||||
from wf_core.runtime.foreach_state import ForeachBarrierState, item_frame_owner
|
||||
from wf_core.runtime.ops.flow import advance_frame, append_step_result_trace
|
||||
from wf_core.runtime.ops.foreach import step_foreach
|
||||
from wf_core.runtime.ops.handlers import (
|
||||
@@ -32,14 +34,12 @@ from wf_core.runtime.ops.nodes import (
|
||||
finalize_pending_async_node_result,
|
||||
invoke_node_use_async_for_frame,
|
||||
)
|
||||
from wf_core.runtime.foreach_state import ForeachBarrierState, item_frame_owner
|
||||
from wf_core.runtime.scheduler import (
|
||||
ForeachIterationMetadata,
|
||||
select_next_frame,
|
||||
wake_parent_for_child_progress,
|
||||
)
|
||||
from wf_core.runtime.subgraphs import PreparedSubgraph, step_subgraph
|
||||
from wf_core.run_state import ExecutionFrame, FrameStatus, RunState, StepExecutionResult
|
||||
from wf_core.tokens import END
|
||||
|
||||
from .preparation import prepare_step
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from wf_core.models.schemas import NodeDef
|
||||
from wf_core.models.steps import (
|
||||
ConditionNode,
|
||||
EndNode,
|
||||
@@ -9,7 +10,6 @@ from wf_core.models.steps import (
|
||||
Step,
|
||||
SubgraphNode,
|
||||
)
|
||||
from wf_core.models.schemas import NodeDef
|
||||
from wf_core.models.workflow import Workflow
|
||||
from wf_core.tokens import END
|
||||
from wf_core.validation.issues import ValidationIssueCode, ValidationReport
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from wf_core.local_paths import LocalPathError, has_overlapping_paths, split_local_path
|
||||
from wf_core.models.conditions import (
|
||||
BinaryCondition,
|
||||
Condition,
|
||||
@@ -9,7 +10,6 @@ from wf_core.models.conditions import (
|
||||
PathOperand,
|
||||
VariadicCondition,
|
||||
)
|
||||
from wf_core.local_paths import LocalPathError, has_overlapping_paths, split_local_path
|
||||
from wf_core.models.schemas import NodeDef
|
||||
from wf_core.models.steps import (
|
||||
ConditionNode,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from .auth import AuthRecord
|
||||
from .broker import (
|
||||
WfMcpService,
|
||||
load_broker_config,
|
||||
@@ -8,7 +9,6 @@ from .capabilities import (
|
||||
DiscoveredTool,
|
||||
)
|
||||
from .models import (
|
||||
AuthRecord,
|
||||
BrokerConfig,
|
||||
ConnectionConfig,
|
||||
RawWorkflowPlan,
|
||||
|
||||
+24
-9
@@ -1,24 +1,34 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Callable
|
||||
from dataclasses import dataclass, field
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from wf_api.auth import AuthRecord as NeutralAuthRecord
|
||||
from wf_artifacts import DependencyDiagnostic, DiagnosticSeverity
|
||||
|
||||
from .models import AuthRecord as McpAuthRecord, ConnectionConfig
|
||||
if TYPE_CHECKING:
|
||||
from .broker.models import ConnectionConfig
|
||||
|
||||
|
||||
def mcp_auth_from_neutral(record: NeutralAuthRecord) -> McpAuthRecord:
|
||||
@dataclass(slots=True)
|
||||
class AuthRecord:
|
||||
connection_id: str
|
||||
scheme: str
|
||||
payload: dict[str, Any] = field(default_factory=dict)
|
||||
|
||||
|
||||
def mcp_auth_from_neutral(record: NeutralAuthRecord) -> AuthRecord:
|
||||
"""Adapt neutral auth to the current MCP compatibility record."""
|
||||
|
||||
return McpAuthRecord(
|
||||
return AuthRecord(
|
||||
connection_id=record.id,
|
||||
scheme=record.scheme,
|
||||
payload=dict(record.payload),
|
||||
)
|
||||
|
||||
|
||||
def neutral_auth_from_mcp(record: McpAuthRecord) -> NeutralAuthRecord:
|
||||
def neutral_auth_from_mcp(record: AuthRecord) -> NeutralAuthRecord:
|
||||
"""Adapt legacy MCP auth into the neutral record shape."""
|
||||
|
||||
return NeutralAuthRecord(
|
||||
@@ -28,7 +38,7 @@ def neutral_auth_from_mcp(record: McpAuthRecord) -> NeutralAuthRecord:
|
||||
)
|
||||
|
||||
|
||||
def mcp_auth_headers(auth: McpAuthRecord | None) -> dict[str, str]:
|
||||
def mcp_auth_headers(auth: AuthRecord | None) -> dict[str, str]:
|
||||
"""Return HTTP headers understood by MCP HTTP transports.
|
||||
|
||||
This is intentionally MCP-specific. Neutral code must not inspect payload
|
||||
@@ -38,18 +48,22 @@ def mcp_auth_headers(auth: McpAuthRecord | None) -> dict[str, str]:
|
||||
if auth is None:
|
||||
return {}
|
||||
raw_headers = auth.payload.get("headers", {})
|
||||
headers = {
|
||||
headers = (
|
||||
{
|
||||
str(key): str(value)
|
||||
for key, value in raw_headers.items()
|
||||
if isinstance(key, str) and isinstance(value, str)
|
||||
} if isinstance(raw_headers, dict) else {}
|
||||
}
|
||||
if isinstance(raw_headers, dict)
|
||||
else {}
|
||||
)
|
||||
token = auth.payload.get("token")
|
||||
if isinstance(token, str) and "Authorization" not in headers:
|
||||
headers["Authorization"] = f"Bearer {token}"
|
||||
return headers
|
||||
|
||||
|
||||
def mcp_auth_env(auth: McpAuthRecord | None) -> dict[str, str]:
|
||||
def mcp_auth_env(auth: AuthRecord | None) -> dict[str, str]:
|
||||
"""Return environment variables understood by MCP stdio transports."""
|
||||
|
||||
if auth is None:
|
||||
@@ -98,7 +112,7 @@ def auth_missing_diagnostic(
|
||||
def connection_auth_diagnostic(
|
||||
connection: ConnectionConfig,
|
||||
*,
|
||||
load_auth: Callable[[str], McpAuthRecord | None],
|
||||
load_auth: Callable[[str], AuthRecord | None],
|
||||
logical_ref: str | None = None,
|
||||
) -> DependencyDiagnostic | None:
|
||||
"""Return an auth diagnostic for explicit auth_ref misses.
|
||||
@@ -121,6 +135,7 @@ def connection_auth_diagnostic(
|
||||
|
||||
|
||||
__all__ = [
|
||||
"AuthRecord",
|
||||
"auth_missing_diagnostic",
|
||||
"auth_ref_for_connection",
|
||||
"connection_auth_diagnostic",
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
from .catalog import CombinedCatalog, snapshot_from_specs
|
||||
from .config import build_service_from_config, load_broker_config
|
||||
from .discovery import (
|
||||
DiscoveredConnectionCapabilities,
|
||||
discover_connection_capabilities,
|
||||
specs_from_discovered_tools,
|
||||
)
|
||||
from .events import McpEvent, make_event
|
||||
from .models import BrokerConfig, ConnectionConfig, SourceConfigOwnership
|
||||
from .server import (
|
||||
build_workflow_server_from_config,
|
||||
build_workflow_server_from_workflow_config,
|
||||
create_broker_server,
|
||||
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
|
||||
from .transport import normalize_transport
|
||||
|
||||
__all__ = [
|
||||
"BrokerConfig",
|
||||
|
||||
@@ -11,15 +11,19 @@ from ..control import BrokerConfigFile, ConnectionConfigFile
|
||||
from ..models import BrokerConfig
|
||||
from ..runtime import McpRuntimePool, PersistentSessionFactory
|
||||
from ..sdk import McpSdkAdapter
|
||||
from ..source_registry import FileSourceRegistryStore, workflow_mcp_source_to_connection_config
|
||||
from ..source_registry import (
|
||||
FileSourceRegistryStore,
|
||||
workflow_mcp_source_to_connection_config,
|
||||
)
|
||||
from ..storage import FileStore
|
||||
from .service import WfMcpService
|
||||
|
||||
|
||||
_HTTP_TRANSPORTS = {"http", "streamable-http", "streamable_http", "sse"}
|
||||
|
||||
|
||||
def _source_metadata_without_transport(metadata: dict[str, object]) -> dict[str, object]:
|
||||
def _source_metadata_without_transport(
|
||||
metadata: dict[str, object],
|
||||
) -> dict[str, object]:
|
||||
return {
|
||||
key: value
|
||||
for key, value in metadata.items()
|
||||
|
||||
@@ -9,8 +9,9 @@ from mcp.types import METHOD_NOT_FOUND
|
||||
|
||||
from wf_authoring import NodeSpec
|
||||
|
||||
from ..auth import AuthRecord
|
||||
from ..capabilities import DiscoveredPrompt, DiscoveredResource, DiscoveredTool
|
||||
from ..models import AuthRecord, ConnectionConfig
|
||||
from ..models import ConnectionConfig
|
||||
from ..runtime import ToolExecutor
|
||||
from ..sdk import BackendAdapter
|
||||
from ..shared import root_exception
|
||||
|
||||
@@ -4,7 +4,6 @@ from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
from typing import Any, Literal
|
||||
|
||||
|
||||
SourceConfigOwnership = Literal["locked", "seed"]
|
||||
|
||||
|
||||
|
||||
@@ -10,9 +10,12 @@ from wf_api import (
|
||||
durable_workflow_api,
|
||||
)
|
||||
from wf_api.stores import WorkflowStores
|
||||
from wf_config import WorkflowConfigFile
|
||||
from wf_server import WorkflowServer, WorkflowServerConfig
|
||||
|
||||
from wf_config import WorkflowConfigFile
|
||||
from ..models import BrokerConfig
|
||||
from ..sdk.adapter import McpSdkAdapter
|
||||
from ..source_registry import FileSourceRegistryStore, SourceRegistryStore
|
||||
from .artifact_tools import register_artifact_tools
|
||||
from .config import broker_config_from_workflow_config, build_service_from_config
|
||||
from .prompts import register_broker_prompts
|
||||
@@ -22,9 +25,6 @@ from .service.auth_admin import McpAuthAdminProvider
|
||||
from .service.source_registry_admin import SourceRegistryAdminProvider
|
||||
from .service.workflow_operation_context import context_from_service
|
||||
from .tools import register_broker_tools
|
||||
from ..models import BrokerConfig
|
||||
from ..sdk.adapter import McpSdkAdapter
|
||||
from ..source_registry import FileSourceRegistryStore, SourceRegistryStore
|
||||
|
||||
|
||||
def create_broker_server(service: WfMcpService) -> FastMCP:
|
||||
@@ -75,11 +75,11 @@ def workflow_server_from_service(
|
||||
config_connections=config.connections,
|
||||
connection_service=service.connection_service,
|
||||
config=config,
|
||||
ensure_adapter=lambda connection: service.register_adapter(
|
||||
connection.server, McpSdkAdapter()
|
||||
)
|
||||
ensure_adapter=lambda connection: (
|
||||
service.register_adapter(connection.server, McpSdkAdapter())
|
||||
if connection.server not in service.adapters
|
||||
else None,
|
||||
else None
|
||||
),
|
||||
load_auth=service.upstream.load_auth,
|
||||
)
|
||||
source_registry_admin = WorkflowSourceRegistryApi(
|
||||
@@ -118,9 +118,7 @@ def build_workflow_server_from_workflow_config(
|
||||
config: WorkflowConfigFile,
|
||||
) -> WorkflowServer:
|
||||
"""Build an MCP-backed WorkflowServer from neutral workflow config sources."""
|
||||
return build_workflow_server_from_config(
|
||||
broker_config_from_workflow_config(config)
|
||||
)
|
||||
return build_workflow_server_from_config(broker_config_from_workflow_config(config))
|
||||
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -3,6 +3,8 @@ from __future__ import annotations
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any
|
||||
|
||||
from wf_api.models import RawWorkflowPlan
|
||||
from wf_api.saved_subgraphs import SavedSubgraphTree
|
||||
from wf_artifacts import (
|
||||
DraftWorkspaceStore,
|
||||
RunStore,
|
||||
@@ -15,29 +17,32 @@ from wf_core import (
|
||||
RunState,
|
||||
Workflow,
|
||||
)
|
||||
from wf_api.models import RawWorkflowPlan
|
||||
from wf_mcp.capabilities import CatalogNodeEntry, CatalogPromptEntry, CatalogResourceEntry
|
||||
from wf_mcp.capabilities import (
|
||||
CatalogNodeEntry,
|
||||
CatalogPromptEntry,
|
||||
CatalogResourceEntry,
|
||||
)
|
||||
from wf_platform import (
|
||||
CapabilitySource,
|
||||
)
|
||||
|
||||
from ...auth import AuthRecord
|
||||
from ...connections import ConnectionRegistry
|
||||
from ...events import EventBus, McpEvent
|
||||
from ...models import (
|
||||
AuthRecord,
|
||||
CatalogSnapshot,
|
||||
BrokerConfig,
|
||||
CatalogSnapshot,
|
||||
ConnectionConfig,
|
||||
)
|
||||
from ...sdk import BackendAdapter
|
||||
from ...runtime import ToolExecutor
|
||||
from ...sdk import BackendAdapter
|
||||
from ...source_registry import SourceRegistryStore
|
||||
from .connection_service import ConnectionService
|
||||
from .content_access import ContentAccessService
|
||||
from ...storage import Store
|
||||
from wf_api.saved_subgraphs import SavedSubgraphTree
|
||||
from ..admin_capabilities import admin_source
|
||||
from ..catalog import CombinedCatalog
|
||||
from .builtins import builtin_sources
|
||||
from .connection_service import ConnectionService
|
||||
from .content_access import ContentAccessService
|
||||
from .events import BrokerEventRecorder
|
||||
from .source_catalog import SourceCatalogService
|
||||
from .upstream_transport import UpstreamTransportService
|
||||
|
||||
@@ -6,8 +6,13 @@ from dataclasses import dataclass, field
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from wf_authoring import NodeReturn, NodeSpec
|
||||
from wf_mcp.capabilities import CatalogNodeEntry, CatalogPromptEntry, CatalogResourceEntry
|
||||
from wf_mcp.capabilities import (
|
||||
CatalogNodeEntry,
|
||||
CatalogPromptEntry,
|
||||
CatalogResourceEntry,
|
||||
)
|
||||
from wf_platform import (
|
||||
CapabilityBuckets,
|
||||
CapabilitySource,
|
||||
@@ -18,10 +23,10 @@ from wf_platform import (
|
||||
page_items,
|
||||
)
|
||||
|
||||
from ...auth import AuthRecord
|
||||
from ...connections import ConnectionConfig, qualify_node_name
|
||||
from ...events import McpEvent, make_event
|
||||
from ...models import (
|
||||
AuthRecord,
|
||||
CatalogSnapshot,
|
||||
)
|
||||
from ...runtime import ToolExecutor
|
||||
@@ -30,7 +35,6 @@ from ...workflow.wrappers import _model_from_schema
|
||||
from ..catalog import CombinedCatalog, snapshot_from_specs
|
||||
from .specs import get_qualified_spec, qualify_spec
|
||||
|
||||
|
||||
ConnectionLookup = Callable[[str], ConnectionConfig]
|
||||
ConnectionList = Callable[[], list[ConnectionConfig]]
|
||||
ToolExecutorLookup = Callable[[ConnectionConfig], ToolExecutor]
|
||||
|
||||
@@ -6,8 +6,8 @@ from typing import Any
|
||||
|
||||
from wf_api.source_registry_admin import WorkflowSourceRegistryMutationProvider
|
||||
|
||||
from ...auth import connection_auth_diagnostic
|
||||
from ...models import AuthRecord, BrokerConfig, ConnectionConfig
|
||||
from ...auth import AuthRecord, connection_auth_diagnostic
|
||||
from ...models import BrokerConfig, ConnectionConfig
|
||||
from ...source_registry import (
|
||||
McpSourceRegistryEntry,
|
||||
SourceRegistryFile,
|
||||
@@ -135,12 +135,18 @@ class SourceRegistryAdminProvider(WorkflowSourceRegistryMutationProvider):
|
||||
if self.connection_service is None or self.config is None:
|
||||
raise RuntimeError("source registry apply requires runtime service context")
|
||||
|
||||
before = {connection.id: connection for connection in self.connection_service.list_all()}
|
||||
before = {
|
||||
connection.id: connection
|
||||
for connection in self.connection_service.list_all()
|
||||
}
|
||||
self.connection_service.sync_connections_from_config(
|
||||
self.config,
|
||||
source_registry_store=self.source_registry_store,
|
||||
)
|
||||
after = {connection.id: connection for connection in self.connection_service.list_all()}
|
||||
after = {
|
||||
connection.id: connection
|
||||
for connection in self.connection_service.list_all()
|
||||
}
|
||||
|
||||
if self.ensure_adapter is not None:
|
||||
for connection in after.values():
|
||||
|
||||
@@ -4,9 +4,8 @@ from collections.abc import Mapping
|
||||
from typing import Any
|
||||
|
||||
from wf_authoring import NodeSpec
|
||||
|
||||
from wf_platform import CapabilitySource
|
||||
from wf_mcp.connections import qualify_node_name
|
||||
from wf_platform import CapabilitySource
|
||||
|
||||
|
||||
def qualify_spec(connection_id: str, spec: NodeSpec[Any, Any]) -> NodeSpec[Any, Any]:
|
||||
|
||||
@@ -10,19 +10,21 @@ import anyio
|
||||
import httpx
|
||||
from mcp.client.streamable_http import StreamableHTTPError
|
||||
from mcp.shared.exceptions import McpError
|
||||
|
||||
from wf_artifacts import (
|
||||
DependencyDiagnostic,
|
||||
DiagnosticSeverity,
|
||||
WorkflowArtifact,
|
||||
WorkflowDeployment,
|
||||
)
|
||||
from wf_mcp.auth import AuthRecord
|
||||
from wf_mcp.broker.catalog import snapshot_from_specs
|
||||
from wf_mcp.broker.discovery import (
|
||||
discover_connection_capabilities,
|
||||
specs_from_discovered_tools,
|
||||
)
|
||||
from wf_mcp.events import McpEvent, make_event
|
||||
from wf_mcp.models import AuthRecord, CatalogSnapshot, ConnectionConfig
|
||||
from wf_mcp.models import CatalogSnapshot, ConnectionConfig
|
||||
from wf_mcp.runtime import ToolExecutor
|
||||
from wf_mcp.sdk import BackendAdapter
|
||||
from wf_mcp.shared.errors import error_payload
|
||||
|
||||
@@ -4,8 +4,6 @@ from collections.abc import Sequence
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
from wf_artifacts import DependencyDiagnostic, WorkflowArtifact, WorkflowDeployment
|
||||
from wf_authoring import NodeSpec
|
||||
from wf_api.operation_context import (
|
||||
WorkflowEventRecorder,
|
||||
WorkflowLiveSourceChecker,
|
||||
@@ -13,6 +11,9 @@ from wf_api.operation_context import (
|
||||
WorkflowRuntimeRunner,
|
||||
WorkflowSpecProvider,
|
||||
)
|
||||
from wf_artifacts import DependencyDiagnostic, WorkflowArtifact, WorkflowDeployment
|
||||
from wf_authoring import NodeSpec
|
||||
|
||||
from .core import WfMcpService
|
||||
from .events import BrokerEventRecorder
|
||||
from .source_catalog import SourceCatalogService
|
||||
|
||||
@@ -4,6 +4,13 @@ from collections.abc import Callable
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
from wf_api.models import RawWorkflowPlan
|
||||
from wf_api.runtime_dependencies import resolve_runtime_dependencies
|
||||
from wf_api.saved_subgraphs import (
|
||||
SavedSubgraphTree,
|
||||
prepare_saved_subgraphs,
|
||||
resolve_saved_subgraph_tree,
|
||||
)
|
||||
from wf_artifacts import WorkflowArtifact, WorkflowArtifactStore, WorkflowDeployment
|
||||
from wf_authoring import NodeSpec
|
||||
from wf_core import (
|
||||
@@ -14,13 +21,6 @@ from wf_core import (
|
||||
execute_workflow_result_async,
|
||||
resume_workflow_result_async,
|
||||
)
|
||||
from wf_api.models import RawWorkflowPlan
|
||||
from wf_api.runtime_dependencies import resolve_runtime_dependencies
|
||||
from wf_api.saved_subgraphs import (
|
||||
SavedSubgraphTree,
|
||||
prepare_saved_subgraphs,
|
||||
resolve_saved_subgraph_tree,
|
||||
)
|
||||
|
||||
from ...events import McpEvent, make_event
|
||||
from .source_catalog import SourceCatalogService
|
||||
|
||||
+2
-13
@@ -1,21 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any
|
||||
|
||||
# RawWorkflowPlan moved to wf_api.models; re-exported here for backward compat.
|
||||
from wf_api.models import RawWorkflowPlan # noqa: F401
|
||||
from wf_api.models import RawWorkflowPlan
|
||||
from wf_mcp.auth import AuthRecord
|
||||
from wf_mcp.broker.models import BrokerConfig, ConnectionConfig, SourceConfigOwnership
|
||||
from wf_mcp.catalog.models import CatalogSnapshot, dump_catalog_snapshot
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class AuthRecord:
|
||||
connection_id: str
|
||||
scheme: str
|
||||
payload: dict[str, Any] = field(default_factory=dict)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"AuthRecord",
|
||||
"BrokerConfig",
|
||||
|
||||
@@ -17,8 +17,8 @@ from mcp.client.streamable_http import StreamableHTTPError
|
||||
from mcp.shared.exceptions import McpError
|
||||
|
||||
from ..models import BrokerConfig, ConnectionConfig
|
||||
from ..proxy_results import ResourceLinkNamespace
|
||||
from ..proxy_config import broker_config_to_fastmcp_config
|
||||
from ..proxy_results import ResourceLinkNamespace
|
||||
from ..shared.names import ProxyNamespace
|
||||
|
||||
ProxyT = TypeVar("ProxyT")
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from .resource_link_transform import ResourceLinkNamespace, ResourceLinkRewritingTool
|
||||
from .resource_links import (
|
||||
ResourceUriRewriter,
|
||||
rewrite_call_tool_result_resource_links,
|
||||
rewrite_resource_link_content,
|
||||
)
|
||||
from .resource_link_transform import ResourceLinkNamespace, ResourceLinkRewritingTool
|
||||
|
||||
__all__ = [
|
||||
"ResourceLinkNamespace",
|
||||
|
||||
@@ -9,8 +9,8 @@ from fastmcp.utilities.versions import VersionSpec
|
||||
from pydantic import ConfigDict
|
||||
from pydantic.json_schema import SkipJsonSchema
|
||||
|
||||
from .resource_links import rewrite_resource_link_content
|
||||
from ..shared.names import connection_id_to_resource_path
|
||||
from .resource_links import rewrite_resource_link_content
|
||||
|
||||
|
||||
class ResourceLinkRewritingTool(Tool):
|
||||
|
||||
@@ -10,8 +10,8 @@ from mcp.client.stdio import StdioServerParameters, stdio_client
|
||||
from mcp.client.streamable_http import streamable_http_client
|
||||
from mcp.types import CallToolResult
|
||||
|
||||
from ..auth import mcp_auth_env, mcp_auth_headers
|
||||
from ..models import AuthRecord, ConnectionConfig
|
||||
from ..auth import AuthRecord, mcp_auth_env, mcp_auth_headers
|
||||
from ..models import ConnectionConfig
|
||||
from .session import PersistentMcpSession
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from inspect import isawaitable
|
||||
from collections.abc import Awaitable, Callable
|
||||
from dataclasses import asdict, dataclass, field
|
||||
from inspect import isawaitable
|
||||
from typing import Any, cast
|
||||
|
||||
from ..models import AuthRecord, ConnectionConfig
|
||||
from ..auth import AuthRecord
|
||||
from ..models import ConnectionConfig
|
||||
from ..sdk import ToolCallResult
|
||||
from .session import PersistentMcpSession
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any, Protocol
|
||||
|
||||
from ..models import AuthRecord, ConnectionConfig
|
||||
from ..auth import AuthRecord
|
||||
from ..models import ConnectionConfig
|
||||
from ..sdk import ToolCallResult
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ from typing import Any
|
||||
from mcp.client.session import ClientSession
|
||||
from mcp.types import CallToolResult
|
||||
|
||||
from ..models import AuthRecord, ConnectionConfig
|
||||
from ..auth import AuthRecord
|
||||
from ..models import ConnectionConfig
|
||||
from ..sdk import ToolCallResult
|
||||
from ..sdk.converters import tool_result_to_call_result
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ from mcp.types import (
|
||||
)
|
||||
from pydantic import AnyUrl
|
||||
|
||||
from ..auth import mcp_auth_env, mcp_auth_headers
|
||||
from ..auth import AuthRecord, mcp_auth_env, mcp_auth_headers
|
||||
from ..capabilities import DiscoveredPrompt, DiscoveredResource, DiscoveredTool
|
||||
from ..models import AuthRecord, ConnectionConfig
|
||||
from ..models import ConnectionConfig
|
||||
from .base import BackendAdapter, ToolCallResult
|
||||
from .converters import (
|
||||
prompt_to_discovered,
|
||||
|
||||
@@ -3,8 +3,9 @@ from __future__ import annotations
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any, Protocol
|
||||
|
||||
from ..auth import AuthRecord
|
||||
from ..capabilities import DiscoveredPrompt, DiscoveredResource, DiscoveredTool
|
||||
from ..models import AuthRecord, ConnectionConfig
|
||||
from ..models import ConnectionConfig
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
|
||||
@@ -12,9 +12,9 @@ from ..broker.config import build_service_from_config
|
||||
from ..broker.transport import normalize_transport
|
||||
from ..documentation import build_local_documentation_source
|
||||
from ..models import BrokerConfig
|
||||
from ..proxy.runtime import ProxyRuntime
|
||||
from ..sdk import McpSdkAdapter
|
||||
from ..source_registry import FileSourceRegistryStore
|
||||
from ..proxy.runtime import ProxyRuntime
|
||||
from ..workflow_surface import register_workflow_tools
|
||||
from .prompts import register_documentation_prompts
|
||||
from .resources import register_documentation_resources
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
import re
|
||||
from collections.abc import Sequence
|
||||
from dataclasses import dataclass
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from fastmcp.server.transforms import (
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Annotated, Literal, Protocol
|
||||
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Annotated, Literal, Protocol
|
||||
|
||||
from pydantic import (
|
||||
AnyHttpUrl,
|
||||
@@ -14,9 +13,11 @@ from pydantic import (
|
||||
from wf_api.source_registry import (
|
||||
AtomicJsonRegistryStore,
|
||||
SourceRegistryBaseModel,
|
||||
SourceRegistryStore as GenericSourceRegistryStore,
|
||||
validate_unique_source_ids,
|
||||
)
|
||||
from wf_api.source_registry import (
|
||||
SourceRegistryStore as GenericSourceRegistryStore,
|
||||
)
|
||||
|
||||
from .connections import parse_connection_id
|
||||
from .shared.names import RESERVED_CONNECTION_IDS
|
||||
|
||||
@@ -10,10 +10,9 @@ from wf_mcp.capabilities import (
|
||||
CatalogResourceEntry,
|
||||
)
|
||||
|
||||
from ..auth import mcp_auth_from_neutral, neutral_auth_from_mcp
|
||||
from ..auth import AuthRecord, mcp_auth_from_neutral, neutral_auth_from_mcp
|
||||
from ..connections import parse_connection_id
|
||||
from ..models import (
|
||||
AuthRecord,
|
||||
CatalogSnapshot,
|
||||
dump_catalog_snapshot,
|
||||
)
|
||||
|
||||
@@ -10,11 +10,11 @@ from wf_authoring import NodeReturn, NodeSpec
|
||||
from wf_core import RuntimeContext
|
||||
from wf_mcp.broker.events import McpEvent, make_event
|
||||
|
||||
from ..auth import AuthRecord
|
||||
from ..capabilities import DiscoveredTool
|
||||
from ..models import AuthRecord, ConnectionConfig
|
||||
from ..models import ConnectionConfig
|
||||
from ..runtime import ToolExecutor
|
||||
|
||||
|
||||
_JSON_TYPE_MAP: dict[str, object] = {
|
||||
"string": str,
|
||||
"integer": int,
|
||||
|
||||
@@ -4,7 +4,7 @@ New code should import from `wf_api.next_actions`. This module stays so older
|
||||
MCP workflow-surface imports keep working during extraction.
|
||||
"""
|
||||
|
||||
from wf_api.next_actions import NextActionPatchExample, NextActionTool, NextActions
|
||||
from wf_api.next_actions import NextActionPatchExample, NextActions, NextActionTool
|
||||
|
||||
__all__ = [
|
||||
"NextActionPatchExample",
|
||||
|
||||
@@ -5,11 +5,12 @@ from typing import Annotated, Any, Mapping
|
||||
from fastmcp import FastMCP
|
||||
from pydantic import Field
|
||||
|
||||
from wf_api import WorkflowApi
|
||||
from wf_artifacts import ArtifactKind
|
||||
from wf_artifacts.models import RequiredCapability
|
||||
from wf_api import WorkflowApi
|
||||
from wf_mcp.broker.service import WfMcpService
|
||||
from wf_mcp.broker.service.workflow_operation_context import context_from_service
|
||||
|
||||
from .models import (
|
||||
CallCapabilityResult,
|
||||
CreateArtifactFromWorkspaceRequest,
|
||||
|
||||
@@ -4,7 +4,6 @@ from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Any, Literal
|
||||
|
||||
|
||||
JsonObject = dict[str, Any]
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .refs import CapabilityRef, SourceRef
|
||||
from .paging import Page, page_items
|
||||
from .refs import CapabilityRef, SourceRef
|
||||
from .schema_hashes import hash_json_schema
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
||||
@@ -8,7 +8,9 @@ from .context import WorkflowServer, build_local_static_workflow_server
|
||||
|
||||
|
||||
def _has_mcp_sources(config: WorkflowConfigFile) -> bool:
|
||||
return any(getattr(source, "kind", None) == "mcp" for source in config.server.sources)
|
||||
return any(
|
||||
getattr(source, "kind", None) == "mcp" for source in config.server.sources
|
||||
)
|
||||
|
||||
|
||||
def _build_mcp_workflow_server_from_workflow_config(
|
||||
|
||||
@@ -10,7 +10,6 @@ from wf_config import (
|
||||
RpcHttpTransportConfig,
|
||||
load_workflow_config,
|
||||
)
|
||||
|
||||
from wf_server.config import (
|
||||
build_workflow_server_from_legacy_mcp_config,
|
||||
build_workflow_server_from_workflow_config,
|
||||
|
||||
@@ -4,8 +4,8 @@ from dataclasses import dataclass
|
||||
|
||||
import httpx # noqa: F401 # Backcompat for tests patching client.httpx.AsyncClient.
|
||||
|
||||
from .client_artifacts import RpcArtifactClientMixin
|
||||
from .client_admin import RpcAdminClientMixin
|
||||
from .client_artifacts import RpcArtifactClientMixin
|
||||
from .client_base import RpcClientTransport
|
||||
from .client_capabilities import RpcCapabilityClientMixin
|
||||
from .client_deployments import RpcDeploymentClientMixin
|
||||
|
||||
@@ -161,5 +161,11 @@ def register_methods(
|
||||
admin = _require_source_registry_admin(server, operation="apply")
|
||||
try:
|
||||
return await admin.apply_registry_changes()
|
||||
except (ValueError, KeyError, LookupError, FileNotFoundError, RuntimeError) as exc:
|
||||
except (
|
||||
ValueError,
|
||||
KeyError,
|
||||
LookupError,
|
||||
FileNotFoundError,
|
||||
RuntimeError,
|
||||
) as exc:
|
||||
raise_workflow_rpc_error(exc)
|
||||
|
||||
@@ -3,8 +3,8 @@ from __future__ import annotations
|
||||
from pydantic import ValidationError
|
||||
|
||||
from wf_artifacts.drafts import WorkflowDraft
|
||||
from wf_artifacts.drafts.api import compile_workflow_draft, validate_workflow_draft
|
||||
from wf_artifacts.drafts.adapter import build_workflow_from_draft
|
||||
from wf_artifacts.drafts.api import compile_workflow_draft, validate_workflow_draft
|
||||
from wf_core import (
|
||||
ConditionNode,
|
||||
EndNode,
|
||||
|
||||
@@ -5,7 +5,7 @@ import asyncio
|
||||
from pydantic import BaseModel
|
||||
|
||||
from wf_authoring import build_async_registry, node
|
||||
from wf_core import RuntimeContext, RunStatus, execute_workflow_async
|
||||
from wf_core import RunStatus, RuntimeContext, execute_workflow_async
|
||||
|
||||
from .test_demo_workflow import (
|
||||
build_authoring_demo_workflow,
|
||||
|
||||
@@ -6,6 +6,12 @@ from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.authoring.helpers import (
|
||||
AutoBindInput,
|
||||
AutoBindOutput,
|
||||
AutoBindState,
|
||||
auto_bind_node,
|
||||
)
|
||||
from wf_authoring import (
|
||||
WorkflowBuilder,
|
||||
input_from,
|
||||
@@ -14,19 +20,12 @@ from wf_authoring import (
|
||||
state,
|
||||
state_path,
|
||||
)
|
||||
from wf_authoring.builder.mapping import normalize_input_mapping
|
||||
from wf_core import END, EndNode, RunStatus, WorkflowExecutionError
|
||||
from wf_core.models.steps import InputPathBinding, InputValueBinding
|
||||
from wf_core.paths import GraphSourcePath, LocalPath, StatePath
|
||||
from wf_platform import CapabilityRef
|
||||
|
||||
from tests.authoring.helpers import (
|
||||
AutoBindInput,
|
||||
AutoBindOutput,
|
||||
AutoBindState,
|
||||
auto_bind_node,
|
||||
)
|
||||
from wf_authoring.builder.mapping import normalize_input_mapping
|
||||
|
||||
|
||||
def test_builder_auto_binds_matching_node_inputs_and_outputs_to_state() -> None:
|
||||
builder = WorkflowBuilder(
|
||||
|
||||
@@ -2,8 +2,6 @@ from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from wf_authoring import WorkflowBuilder, state
|
||||
|
||||
from tests.authoring.helpers import (
|
||||
AutoBindInput,
|
||||
AutoBindOutput,
|
||||
@@ -11,6 +9,7 @@ from tests.authoring.helpers import (
|
||||
auto_bind_node,
|
||||
branch_router,
|
||||
)
|
||||
from wf_authoring import WorkflowBuilder, state
|
||||
|
||||
|
||||
def test_builder_branch_connects_existing_steps() -> None:
|
||||
|
||||
@@ -16,8 +16,7 @@ from examples.authoring_concurrent_foreach import (
|
||||
run_replace_conflict_example,
|
||||
)
|
||||
from wf_authoring import WorkflowBuilder, state_path
|
||||
from wf_core import ForeachConcurrentPolicy
|
||||
from wf_core import RunStatus
|
||||
from wf_core import ForeachConcurrentPolicy, RunStatus
|
||||
|
||||
|
||||
def test_authoring_concurrent_foreach_collects_item_errors() -> None:
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from wf_core import END, NodeUse, RunStatus
|
||||
|
||||
from examples.authoring_control_flow import (
|
||||
build_branch_workflow,
|
||||
build_choose_workflow,
|
||||
@@ -10,6 +8,7 @@ from examples.authoring_control_flow import (
|
||||
build_use_ref_workflow,
|
||||
build_when_workflow,
|
||||
)
|
||||
from wf_core import END, NodeUse, RunStatus
|
||||
|
||||
|
||||
def test_branch_example_routes_node_outcomes() -> None:
|
||||
|
||||
@@ -3,30 +3,30 @@ from __future__ import annotations
|
||||
import pytest
|
||||
from pydantic import BaseModel
|
||||
|
||||
from examples.demo_workflow import build_demo_registry, build_demo_workflow
|
||||
from wf_authoring import (
|
||||
NodeReturn,
|
||||
WorkflowBuilder,
|
||||
build_registry,
|
||||
context_path,
|
||||
input_from,
|
||||
input_path,
|
||||
node,
|
||||
output_to,
|
||||
state,
|
||||
state_path,
|
||||
)
|
||||
from wf_core import (
|
||||
END,
|
||||
FrameStatus,
|
||||
RuntimeContext,
|
||||
RunStatus,
|
||||
RuntimeContext,
|
||||
WorkflowExecutionError,
|
||||
execute_workflow,
|
||||
resume_workflow,
|
||||
step_workflow,
|
||||
)
|
||||
from wf_core.runtime.ops.runs import create_run_state
|
||||
from examples.demo_workflow import build_demo_registry, build_demo_workflow
|
||||
from wf_authoring import (
|
||||
NodeReturn,
|
||||
WorkflowBuilder,
|
||||
build_registry,
|
||||
input_from,
|
||||
state,
|
||||
output_to,
|
||||
state_path,
|
||||
context_path,
|
||||
input_path,
|
||||
node,
|
||||
)
|
||||
|
||||
|
||||
class DriveListFilesInput(BaseModel):
|
||||
|
||||
@@ -3,9 +3,9 @@ from __future__ import annotations
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from wf_authoring import (
|
||||
NoOutput,
|
||||
NodeCatalog,
|
||||
NodeReturn,
|
||||
NoOutput,
|
||||
Nothing,
|
||||
build_registry,
|
||||
node,
|
||||
|
||||
@@ -6,9 +6,9 @@ from wf_authoring import (
|
||||
WorkflowBuilder,
|
||||
build_registry,
|
||||
coalesce,
|
||||
concat,
|
||||
constant,
|
||||
default_if_none,
|
||||
concat,
|
||||
extract_field,
|
||||
extract_text_content,
|
||||
filter_items,
|
||||
@@ -16,14 +16,14 @@ from wf_authoring import (
|
||||
first_item,
|
||||
first_item_maybe,
|
||||
first_item_or_none,
|
||||
is_empty,
|
||||
input_from,
|
||||
is_empty,
|
||||
last_item,
|
||||
last_item_or_none,
|
||||
length,
|
||||
output_to,
|
||||
pick_path,
|
||||
pick_key,
|
||||
pick_path,
|
||||
project_fields,
|
||||
rename_fields,
|
||||
runtime_error,
|
||||
|
||||
@@ -2,12 +2,12 @@ from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from wf_authoring import state, state_path
|
||||
from wf_authoring.dsl.path_inputs import (
|
||||
coerce_graph_path,
|
||||
coerce_local_path,
|
||||
coerce_state_path,
|
||||
)
|
||||
from wf_authoring import state, state_path
|
||||
from wf_core.models.conditions import BinaryCondition, PathOperand
|
||||
from wf_core.paths import GraphSourcePath, LocalPath, StatePath
|
||||
|
||||
|
||||
@@ -4,9 +4,6 @@ from typing import Annotated
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from wf_authoring import WorkflowBuilder, state_field
|
||||
from wf_core.paths import StatePath
|
||||
|
||||
from tests.authoring.helpers import (
|
||||
AppendState,
|
||||
DefaultedState,
|
||||
@@ -16,6 +13,8 @@ from tests.authoring.helpers import (
|
||||
WorkflowOutput,
|
||||
WorkflowState,
|
||||
)
|
||||
from wf_authoring import WorkflowBuilder, state_field
|
||||
from wf_core.paths import StatePath
|
||||
|
||||
|
||||
class DotAliasState(BaseModel):
|
||||
|
||||
@@ -4,6 +4,12 @@ import asyncio
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from examples.authoring_workflow_as_node import (
|
||||
build_parent_workflow,
|
||||
run_parent_workflow,
|
||||
wrapped_demo_workflow,
|
||||
)
|
||||
from examples.demo_workflow import build_demo_registry, build_demo_workflow
|
||||
from wf_authoring import (
|
||||
WorkflowBuilder,
|
||||
async_subgraph_node,
|
||||
@@ -14,8 +20,8 @@ from wf_authoring import (
|
||||
node,
|
||||
output_to,
|
||||
state_path,
|
||||
subgraph_ref,
|
||||
subgraph_node,
|
||||
subgraph_ref,
|
||||
)
|
||||
from wf_core import (
|
||||
END,
|
||||
@@ -25,12 +31,6 @@ from wf_core import (
|
||||
Workflow,
|
||||
execute_workflow_async,
|
||||
)
|
||||
from examples.demo_workflow import build_demo_registry, build_demo_workflow
|
||||
from examples.authoring_workflow_as_node import (
|
||||
build_parent_workflow,
|
||||
run_parent_workflow,
|
||||
wrapped_demo_workflow,
|
||||
)
|
||||
|
||||
|
||||
def test_subgraph_node_wraps_compiled_workflow() -> None:
|
||||
|
||||
@@ -2,10 +2,9 @@ from __future__ import annotations
|
||||
|
||||
import warnings
|
||||
|
||||
from wf_core import RunStatus
|
||||
|
||||
from examples.wrapper_status_route import build_wrapper
|
||||
from examples.wrapper_normalization import build_normalized_wrapper
|
||||
from examples.wrapper_status_route import build_wrapper
|
||||
from wf_core import RunStatus
|
||||
|
||||
|
||||
def test_status_wrapper_uses_match_without_deprecation_warning() -> None:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user