ruff check fix
This commit is contained in:
@@ -9,7 +9,7 @@ ROOT = THESIS_DIR.parents[1]
|
|||||||
if str(ROOT) not in sys.path:
|
if str(ROOT) not in sys.path:
|
||||||
sys.path.insert(0, str(ROOT))
|
sys.path.insert(0, str(ROOT))
|
||||||
|
|
||||||
from examples.agent_challenges.evaluation import ( # noqa: E402
|
from examples.agent_challenges.evaluation import (
|
||||||
load_evaluation_cohort,
|
load_evaluation_cohort,
|
||||||
render_evaluation_figures,
|
render_evaluation_figures,
|
||||||
render_evaluation_markdown,
|
render_evaluation_markdown,
|
||||||
|
|||||||
@@ -30,29 +30,29 @@ def _utf8_subprocess_env() -> dict[str, str]:
|
|||||||
return env
|
return env
|
||||||
|
|
||||||
|
|
||||||
from examples.agent_challenges.names import ( # noqa: E402
|
from examples.agent_challenges.names import (
|
||||||
short_challenge_name,
|
short_challenge_name,
|
||||||
short_model_name,
|
short_model_name,
|
||||||
)
|
)
|
||||||
from examples.agent_challenges.opencode_io import ( # noqa: E402
|
from examples.agent_challenges.opencode_io import (
|
||||||
build_opencode_command,
|
build_opencode_command,
|
||||||
opencode_text_results,
|
opencode_text_results,
|
||||||
parse_opencode_output,
|
parse_opencode_output,
|
||||||
result_text,
|
result_text,
|
||||||
)
|
)
|
||||||
from examples.agent_challenges.opencode_resume import ( # noqa: E402
|
from examples.agent_challenges.opencode_resume import (
|
||||||
build_resume_command,
|
build_resume_command,
|
||||||
extract_session_id,
|
extract_session_id,
|
||||||
resume_prompt_for_result,
|
resume_prompt_for_result,
|
||||||
)
|
)
|
||||||
from examples.agent_challenges.report_models import ( # noqa: E402
|
from examples.agent_challenges.report_models import (
|
||||||
build_trial_report,
|
build_trial_report,
|
||||||
)
|
)
|
||||||
from examples.agent_challenges.reports import ( # noqa: E402
|
from examples.agent_challenges.reports import (
|
||||||
save_report_from_result_payload,
|
save_report_from_result_payload,
|
||||||
write_trial_report_projections,
|
write_trial_report_projections,
|
||||||
)
|
)
|
||||||
from examples.agent_challenges.workspace import ( # noqa: E402
|
from examples.agent_challenges.workspace import (
|
||||||
ChallengeDef,
|
ChallengeDef,
|
||||||
TrialConfig,
|
TrialConfig,
|
||||||
_display_path,
|
_display_path,
|
||||||
|
|||||||
+16
-16
@@ -71,17 +71,13 @@ from .wrapper_hints import (
|
|||||||
__all__ = [
|
__all__ = [
|
||||||
"AUTH_ID_PATTERN",
|
"AUTH_ID_PATTERN",
|
||||||
"DEFAULT_CALL_STEP_ID",
|
"DEFAULT_CALL_STEP_ID",
|
||||||
"AuthRecord",
|
|
||||||
"AuthStore",
|
|
||||||
"CapabilityStepUpdate",
|
|
||||||
"builtin_sources",
|
|
||||||
"get_qualified_spec",
|
|
||||||
"matches_query",
|
|
||||||
"paged_list_payload",
|
|
||||||
"qualify_spec",
|
|
||||||
"DEFAULT_ERROR_OUTCOME",
|
"DEFAULT_ERROR_OUTCOME",
|
||||||
"DEFAULT_ERROR_STEP_ID",
|
"DEFAULT_ERROR_STEP_ID",
|
||||||
"DEFAULT_OK_OUTCOME",
|
"DEFAULT_OK_OUTCOME",
|
||||||
|
"RUNTIME_ERROR_CAPABILITY",
|
||||||
|
"AuthRecord",
|
||||||
|
"AuthStore",
|
||||||
|
"CapabilityStepUpdate",
|
||||||
"MissingDecision",
|
"MissingDecision",
|
||||||
"MissingDecisionKind",
|
"MissingDecisionKind",
|
||||||
"NextActionPatchExample",
|
"NextActionPatchExample",
|
||||||
@@ -89,10 +85,10 @@ __all__ = [
|
|||||||
"NextActions",
|
"NextActions",
|
||||||
"OutcomeCandidate",
|
"OutcomeCandidate",
|
||||||
"OutcomeCandidateKind",
|
"OutcomeCandidateKind",
|
||||||
"RUNTIME_ERROR_CAPABILITY",
|
|
||||||
"RawWorkflowPlan",
|
"RawWorkflowPlan",
|
||||||
"RouteSource",
|
"RouteSource",
|
||||||
"RuntimeDependencies",
|
"RuntimeDependencies",
|
||||||
|
"SourceResourceRef",
|
||||||
"TraceRange",
|
"TraceRange",
|
||||||
"WorkflowAdminApi",
|
"WorkflowAdminApi",
|
||||||
"WorkflowAdminAuthProvider",
|
"WorkflowAdminAuthProvider",
|
||||||
@@ -112,10 +108,9 @@ __all__ = [
|
|||||||
"WorkflowEventRecorder",
|
"WorkflowEventRecorder",
|
||||||
"WorkflowLiveSourceChecker",
|
"WorkflowLiveSourceChecker",
|
||||||
"WorkflowOperationContext",
|
"WorkflowOperationContext",
|
||||||
"WorkflowRuntimeRunner",
|
|
||||||
"WorkflowRunApi",
|
"WorkflowRunApi",
|
||||||
"WorkflowRunSurface",
|
"WorkflowRunSurface",
|
||||||
"SourceResourceRef",
|
"WorkflowRuntimeRunner",
|
||||||
"WorkflowSourceAdminApi",
|
"WorkflowSourceAdminApi",
|
||||||
"WorkflowSourceAdminSurface",
|
"WorkflowSourceAdminSurface",
|
||||||
"WorkflowSourceRegistryApi",
|
"WorkflowSourceRegistryApi",
|
||||||
@@ -124,17 +119,22 @@ __all__ = [
|
|||||||
"WorkflowSourceRegistryProvider",
|
"WorkflowSourceRegistryProvider",
|
||||||
"WorkflowSourceRegistrySurface",
|
"WorkflowSourceRegistrySurface",
|
||||||
"WorkflowSpecProvider",
|
"WorkflowSpecProvider",
|
||||||
|
"WorkflowStores",
|
||||||
"WorkflowSurfaceCapabilityId",
|
"WorkflowSurfaceCapabilityId",
|
||||||
"WrapperAuthoringHints",
|
"WrapperAuthoringHints",
|
||||||
"WrapperHintConfidence",
|
"WrapperHintConfidence",
|
||||||
"WrapperOutcomePolicy",
|
"WrapperOutcomePolicy",
|
||||||
|
"builtin_sources",
|
||||||
|
"durable_workflow_api",
|
||||||
|
"file_workflow_stores",
|
||||||
|
"get_qualified_spec",
|
||||||
|
"matches_query",
|
||||||
|
"paged_list_payload",
|
||||||
"parse_workflow_surface_capability_id",
|
"parse_workflow_surface_capability_id",
|
||||||
|
"qualify_spec",
|
||||||
|
"require_workflow_stores",
|
||||||
|
"resolve_runtime_dependencies",
|
||||||
"validate_auth_id",
|
"validate_auth_id",
|
||||||
"workflow_output_schema_for_authoring",
|
"workflow_output_schema_for_authoring",
|
||||||
"wrapper_hints_for_capability",
|
"wrapper_hints_for_capability",
|
||||||
"resolve_runtime_dependencies",
|
|
||||||
"WorkflowStores",
|
|
||||||
"file_workflow_stores",
|
|
||||||
"durable_workflow_api",
|
|
||||||
"require_workflow_stores",
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -291,9 +291,7 @@ def _resolve_local_reference(
|
|||||||
raise ValueError(f"cyclic reference {reference!r} at schema path {label!r}")
|
raise ValueError(f"cyclic reference {reference!r} at schema path {label!r}")
|
||||||
seen.add(reference)
|
seen.add(reference)
|
||||||
|
|
||||||
if reference.startswith("#/$defs/"):
|
if reference.startswith("#/$defs/") or reference.startswith("#/definitions/"):
|
||||||
pointer = reference.removeprefix("#/")
|
|
||||||
elif reference.startswith("#/definitions/"):
|
|
||||||
pointer = reference.removeprefix("#/")
|
pointer = reference.removeprefix("#/")
|
||||||
else:
|
else:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
|
|||||||
@@ -102,10 +102,10 @@ class AtomicJsonRegistryStore(Generic[RegistryT]):
|
|||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
"SOURCE_REGISTRY_ID_PATTERN",
|
||||||
"AtomicJsonRegistryStore",
|
"AtomicJsonRegistryStore",
|
||||||
"SourceRegistryBaseModel",
|
"SourceRegistryBaseModel",
|
||||||
"SourceRegistryStore",
|
"SourceRegistryStore",
|
||||||
"SOURCE_REGISTRY_ID_PATTERN",
|
|
||||||
"validate_source_registry_id",
|
"validate_source_registry_id",
|
||||||
"validate_unique_source_ids",
|
"validate_unique_source_ids",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -56,46 +56,46 @@ from .store import FileWorkflowArtifactStore, WorkflowArtifactStore
|
|||||||
from .validation import validate_deployment_dependencies
|
from .validation import validate_deployment_dependencies
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"AvailableCapability",
|
|
||||||
"ArtifactKind",
|
"ArtifactKind",
|
||||||
|
"AvailableCapability",
|
||||||
"AvailableSource",
|
"AvailableSource",
|
||||||
|
"CheckpointReason",
|
||||||
"DependencyDiagnostic",
|
"DependencyDiagnostic",
|
||||||
"DiagnosticSeverity",
|
"DiagnosticSeverity",
|
||||||
"DriftPolicy",
|
|
||||||
"DraftWorkspaceConflictError",
|
"DraftWorkspaceConflictError",
|
||||||
"DraftWorkspaceStore",
|
"DraftWorkspaceStore",
|
||||||
|
"DriftPolicy",
|
||||||
"FileDraftWorkspaceStore",
|
"FileDraftWorkspaceStore",
|
||||||
"FileWorkflowArtifactStore",
|
|
||||||
"FileRunStore",
|
"FileRunStore",
|
||||||
|
"FileWorkflowArtifactStore",
|
||||||
|
"PinnedRunEnvironment",
|
||||||
"RequiredCapability",
|
"RequiredCapability",
|
||||||
|
"ResumeReadiness",
|
||||||
|
"RunCheckpoint",
|
||||||
|
"RunStore",
|
||||||
"SourceBinding",
|
"SourceBinding",
|
||||||
|
"StoredRunStatus",
|
||||||
"WorkflowArtifact",
|
"WorkflowArtifact",
|
||||||
"WorkflowArtifactCatalogEntry",
|
"WorkflowArtifactCatalogEntry",
|
||||||
"WorkflowCapabilityRef",
|
|
||||||
"WorkflowDraftWorkspace",
|
|
||||||
"WorkflowArtifactStore",
|
"WorkflowArtifactStore",
|
||||||
"WorkflowRunRecord",
|
"WorkflowCapabilityRef",
|
||||||
"WorkflowDeployment",
|
"WorkflowDeployment",
|
||||||
"RunStore",
|
"WorkflowDraftWorkspace",
|
||||||
"RunCheckpoint",
|
"WorkflowRunRecord",
|
||||||
"CheckpointReason",
|
|
||||||
"PinnedRunEnvironment",
|
|
||||||
"ResumeReadiness",
|
|
||||||
"StoredRunStatus",
|
|
||||||
"ensure_run_id",
|
|
||||||
"artifact_catalog_entry",
|
"artifact_catalog_entry",
|
||||||
"artifact_node_name",
|
"artifact_node_name",
|
||||||
|
"compile_workflow_draft",
|
||||||
"create_draft_workspace",
|
"create_draft_workspace",
|
||||||
"create_workflow_artifact_from_plan",
|
"create_workflow_artifact_from_plan",
|
||||||
"compile_workflow_draft",
|
"ensure_run_id",
|
||||||
"ensure_workspace_id",
|
"ensure_workspace_id",
|
||||||
"get_draft_workspace",
|
"get_draft_workspace",
|
||||||
"logical_ref_for_concrete_ref",
|
"logical_ref_for_concrete_ref",
|
||||||
"normalize_plan_node_refs",
|
"normalize_plan_node_refs",
|
||||||
"patch_draft_workspace",
|
"patch_draft_workspace",
|
||||||
|
"patch_workflow_draft",
|
||||||
"replace_draft_workspace_document",
|
"replace_draft_workspace_document",
|
||||||
"replace_validated_draft_document",
|
"replace_validated_draft_document",
|
||||||
"patch_workflow_draft",
|
|
||||||
"summarize_draft_workspace",
|
"summarize_draft_workspace",
|
||||||
"validate_deployment_dependencies",
|
"validate_deployment_dependencies",
|
||||||
"validate_workflow_draft",
|
"validate_workflow_draft",
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ from .models import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"DraftDiagnostic",
|
|
||||||
"DraftChooseClause",
|
"DraftChooseClause",
|
||||||
"DraftChooseStep",
|
"DraftChooseStep",
|
||||||
|
"DraftDiagnostic",
|
||||||
"DraftEndStep",
|
"DraftEndStep",
|
||||||
"DraftForeachStep",
|
"DraftForeachStep",
|
||||||
"DraftInterruptStep",
|
"DraftInterruptStep",
|
||||||
@@ -31,8 +31,8 @@ __all__ = [
|
|||||||
"DraftMatchCase",
|
"DraftMatchCase",
|
||||||
"DraftMatchStep",
|
"DraftMatchStep",
|
||||||
"DraftSubgraphStep",
|
"DraftSubgraphStep",
|
||||||
"DraftWhenStep",
|
|
||||||
"DraftUseStep",
|
"DraftUseStep",
|
||||||
|
"DraftWhenStep",
|
||||||
"WorkflowDraft",
|
"WorkflowDraft",
|
||||||
"build_workflow_from_draft",
|
"build_workflow_from_draft",
|
||||||
"compile_workflow_draft",
|
"compile_workflow_draft",
|
||||||
|
|||||||
@@ -88,10 +88,8 @@ from .schemas import StateFieldMetadata, state_field
|
|||||||
from .subgraph import async_subgraph_node, subgraph_node, subgraph_ref
|
from .subgraph import async_subgraph_node, subgraph_node, subgraph_ref
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"NodeCatalog",
|
"AsyncRegistryHandler",
|
||||||
"NodeCatalogEntry",
|
|
||||||
"AuthoredReducer",
|
"AuthoredReducer",
|
||||||
"async_subgraph_node",
|
|
||||||
"BoolOutput",
|
"BoolOutput",
|
||||||
"CoalesceInput",
|
"CoalesceInput",
|
||||||
"ConcatInput",
|
"ConcatInput",
|
||||||
@@ -105,47 +103,48 @@ __all__ = [
|
|||||||
"FilterItemsPresentInput",
|
"FilterItemsPresentInput",
|
||||||
"GraphPath",
|
"GraphPath",
|
||||||
"ItemOutput",
|
"ItemOutput",
|
||||||
"MappingOutput",
|
|
||||||
"MappingItemsOutput",
|
"MappingItemsOutput",
|
||||||
|
"MappingOutput",
|
||||||
"MaybeItemOutput",
|
"MaybeItemOutput",
|
||||||
|
"NoOutput",
|
||||||
|
"NodeCatalog",
|
||||||
|
"NodeCatalogEntry",
|
||||||
|
"NodeReturn",
|
||||||
|
"NodeSpec",
|
||||||
|
"Nothing",
|
||||||
"PickKeyInput",
|
"PickKeyInput",
|
||||||
"PickPathInput",
|
"PickPathInput",
|
||||||
"ProjectFieldsInput",
|
"ProjectFieldsInput",
|
||||||
"ReducerCatalog",
|
"ReducerCatalog",
|
||||||
"RenameFieldsInput",
|
"RenameFieldsInput",
|
||||||
"RuntimeErrorInput",
|
"RuntimeErrorInput",
|
||||||
"NoOutput",
|
|
||||||
"NodeReturn",
|
|
||||||
"NodeSpec",
|
|
||||||
"Nothing",
|
|
||||||
"AsyncRegistryHandler",
|
|
||||||
"SyncRegistryHandler",
|
|
||||||
"SequenceInput",
|
"SequenceInput",
|
||||||
"StateFieldMetadata",
|
"StateFieldMetadata",
|
||||||
|
"SyncRegistryHandler",
|
||||||
"TextOutput",
|
"TextOutput",
|
||||||
"TruthyInput",
|
"TruthyInput",
|
||||||
"ValueOutput",
|
"ValueOutput",
|
||||||
"ValuesOutput",
|
"ValuesOutput",
|
||||||
"WorkflowBuilder",
|
"WorkflowBuilder",
|
||||||
|
"async_subgraph_node",
|
||||||
"bind_fields",
|
"bind_fields",
|
||||||
|
"bind_state",
|
||||||
"build_async_registry",
|
"build_async_registry",
|
||||||
"build_registry",
|
|
||||||
"build_extract_text_content_spec",
|
"build_extract_text_content_spec",
|
||||||
"build_extract_text_content_workflow",
|
"build_extract_text_content_workflow",
|
||||||
"bind_state",
|
"build_registry",
|
||||||
"coalesce",
|
"coalesce",
|
||||||
"concat",
|
"concat",
|
||||||
"constant",
|
"constant",
|
||||||
|
"context",
|
||||||
|
"context_path",
|
||||||
"default_if_none",
|
"default_if_none",
|
||||||
|
"exists",
|
||||||
|
"expr",
|
||||||
"extract_field",
|
"extract_field",
|
||||||
"extract_text_content",
|
"extract_text_content",
|
||||||
"filter_items",
|
"filter_items",
|
||||||
"filter_items_present",
|
"filter_items_present",
|
||||||
"merge_maps",
|
|
||||||
"context",
|
|
||||||
"context_path",
|
|
||||||
"expr",
|
|
||||||
"exists",
|
|
||||||
"first_item",
|
"first_item",
|
||||||
"first_item_maybe",
|
"first_item_maybe",
|
||||||
"first_item_or_none",
|
"first_item_or_none",
|
||||||
@@ -158,16 +157,17 @@ __all__ = [
|
|||||||
"last_item",
|
"last_item",
|
||||||
"last_item_or_none",
|
"last_item_or_none",
|
||||||
"length",
|
"length",
|
||||||
"pick_key",
|
"merge_maps",
|
||||||
"pick_path",
|
|
||||||
"project_fields",
|
|
||||||
"rename_fields",
|
|
||||||
"runtime_error",
|
|
||||||
"node",
|
"node",
|
||||||
"not_",
|
"not_",
|
||||||
"outcome",
|
"outcome",
|
||||||
"output_to",
|
"output_to",
|
||||||
|
"pick_key",
|
||||||
|
"pick_path",
|
||||||
|
"project_fields",
|
||||||
"reducer",
|
"reducer",
|
||||||
|
"rename_fields",
|
||||||
|
"runtime_error",
|
||||||
"state",
|
"state",
|
||||||
"state_field",
|
"state_field",
|
||||||
"state_path",
|
"state_path",
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class NodeCatalogEntry:
|
|||||||
output_schema: dict[str, Any]
|
output_schema: dict[str, Any]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_spec(cls, spec: NodeSpec[Any, Any]) -> "NodeCatalogEntry":
|
def from_spec(cls, spec: NodeSpec[Any, Any]) -> NodeCatalogEntry:
|
||||||
input_schema = (
|
input_schema = (
|
||||||
spec.input_schema_contract or spec.input_model.model_json_schema()
|
spec.input_schema_contract or spec.input_model.model_json_schema()
|
||||||
)
|
)
|
||||||
@@ -38,7 +38,7 @@ class NodeCatalog:
|
|||||||
specs: dict[str, NodeSpec[Any, Any]]
|
specs: dict[str, NodeSpec[Any, Any]]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_specs(cls, *specs: NodeSpec[Any, Any]) -> "NodeCatalog":
|
def from_specs(cls, *specs: NodeSpec[Any, Any]) -> NodeCatalog:
|
||||||
return cls(specs={spec.name: spec for spec in specs})
|
return cls(specs={spec.name: spec for spec in specs})
|
||||||
|
|
||||||
def entries(self) -> list[NodeCatalogEntry]:
|
def entries(self) -> list[NodeCatalogEntry]:
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ __all__ = [
|
|||||||
"AsyncRegistryHandler",
|
"AsyncRegistryHandler",
|
||||||
"ContextNodeCallable",
|
"ContextNodeCallable",
|
||||||
"InputT",
|
"InputT",
|
||||||
"NodeCallable",
|
|
||||||
"NoOutput",
|
"NoOutput",
|
||||||
|
"NodeCallable",
|
||||||
"NodeReturn",
|
"NodeReturn",
|
||||||
"NodeSpec",
|
"NodeSpec",
|
||||||
"Nothing",
|
"Nothing",
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ from .result import NodeReturn, Nothing
|
|||||||
from .schema import schema_ref_for
|
from .schema import schema_ref_for
|
||||||
|
|
||||||
|
|
||||||
def _default_outcome(spec: "NodeSpec[Any, Any]") -> str:
|
def _default_outcome(spec: NodeSpec[Any, Any]) -> str:
|
||||||
return spec.outcomes[0]
|
return spec.outcomes[0]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,17 +55,17 @@ __all__ = [
|
|||||||
"FilterItemsInput",
|
"FilterItemsInput",
|
||||||
"FilterItemsPresentInput",
|
"FilterItemsPresentInput",
|
||||||
"ItemOutput",
|
"ItemOutput",
|
||||||
"MappingOutput",
|
|
||||||
"MappingItemsOutput",
|
"MappingItemsOutput",
|
||||||
|
"MappingOutput",
|
||||||
"MaybeItemOutput",
|
"MaybeItemOutput",
|
||||||
"PickPathInput",
|
|
||||||
"PickKeyInput",
|
"PickKeyInput",
|
||||||
|
"PickPathInput",
|
||||||
"ProjectFieldsInput",
|
"ProjectFieldsInput",
|
||||||
"RenameFieldsInput",
|
"RenameFieldsInput",
|
||||||
"RuntimeErrorInput",
|
"RuntimeErrorInput",
|
||||||
"SequenceInput",
|
"SequenceInput",
|
||||||
"TruthyInput",
|
|
||||||
"TextOutput",
|
"TextOutput",
|
||||||
|
"TruthyInput",
|
||||||
"ValueOutput",
|
"ValueOutput",
|
||||||
"ValuesOutput",
|
"ValuesOutput",
|
||||||
"coalesce",
|
"coalesce",
|
||||||
@@ -82,8 +82,8 @@ __all__ = [
|
|||||||
"last_item",
|
"last_item",
|
||||||
"last_item_or_none",
|
"last_item_or_none",
|
||||||
"length",
|
"length",
|
||||||
"pick_path",
|
|
||||||
"pick_key",
|
"pick_key",
|
||||||
|
"pick_path",
|
||||||
"project_fields",
|
"project_fields",
|
||||||
"rename_fields",
|
"rename_fields",
|
||||||
"runtime_error",
|
"runtime_error",
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ReducerCatalog:
|
|||||||
definitions: dict[str, ReducerDefinition]
|
definitions: dict[str, ReducerDefinition]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_reducers(cls, *reducers: AuthoredReducer) -> "ReducerCatalog":
|
def from_reducers(cls, *reducers: AuthoredReducer) -> ReducerCatalog:
|
||||||
return cls(
|
return cls(
|
||||||
definitions={
|
definitions={
|
||||||
reducer.definition.spec.name: reducer.definition for reducer in reducers
|
reducer.definition.spec.name: reducer.definition for reducer in reducers
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Mapping
|
from collections.abc import Iterator, Mapping
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from typing import Any, Iterator
|
from typing import Any
|
||||||
|
|
||||||
from pydantic import BaseModel, TypeAdapter
|
from pydantic import BaseModel, TypeAdapter
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ from .models import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"load_workflow_config",
|
|
||||||
"AuthConfig",
|
"AuthConfig",
|
||||||
"ClientConfig",
|
"ClientConfig",
|
||||||
"FilesystemStoreConfig",
|
"FilesystemStoreConfig",
|
||||||
@@ -40,4 +39,5 @@ __all__ = [
|
|||||||
"StdioSourceTransportConfig",
|
"StdioSourceTransportConfig",
|
||||||
"StdlibSourceConfig",
|
"StdlibSourceConfig",
|
||||||
"WorkflowConfigFile",
|
"WorkflowConfigFile",
|
||||||
|
"load_workflow_config",
|
||||||
]
|
]
|
||||||
|
|||||||
+20
-20
@@ -57,56 +57,56 @@ from .validation import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
"END",
|
||||||
|
"START",
|
||||||
|
"AsyncNodeHandler",
|
||||||
"ConditionNode",
|
"ConditionNode",
|
||||||
"Edge",
|
"Edge",
|
||||||
"EndNode",
|
"EndNode",
|
||||||
|
"ExecutionFrame",
|
||||||
"ForeachConcurrentPolicy",
|
"ForeachConcurrentPolicy",
|
||||||
"ForeachItemErrorPolicy",
|
"ForeachItemErrorPolicy",
|
||||||
"ForeachNode",
|
"ForeachNode",
|
||||||
|
"FrameStatus",
|
||||||
"InterruptNode",
|
"InterruptNode",
|
||||||
|
"InterruptRequest",
|
||||||
|
"InterruptRoute",
|
||||||
"JoinNode",
|
"JoinNode",
|
||||||
"NodeDef",
|
"NodeDef",
|
||||||
|
"NodeHandler",
|
||||||
"NodeResult",
|
"NodeResult",
|
||||||
"NodeUse",
|
"NodeUse",
|
||||||
|
"PersistedRunState",
|
||||||
|
"PreparedSubgraph",
|
||||||
"ReducerRef",
|
"ReducerRef",
|
||||||
"ReducerSpec",
|
"ReducerSpec",
|
||||||
|
"RunState",
|
||||||
|
"RunStatus",
|
||||||
|
"RuntimeContext",
|
||||||
"SchemaRef",
|
"SchemaRef",
|
||||||
"SiblingWritePolicy",
|
"SiblingWritePolicy",
|
||||||
"StateField",
|
"StateField",
|
||||||
"StateSchema",
|
"StateSchema",
|
||||||
"SubgraphNode",
|
|
||||||
"AsyncNodeHandler",
|
|
||||||
"NodeHandler",
|
|
||||||
"PreparedSubgraph",
|
|
||||||
"ExecutionFrame",
|
|
||||||
"FrameStatus",
|
|
||||||
"RunState",
|
|
||||||
"RunStatus",
|
|
||||||
"RuntimeContext",
|
|
||||||
"StepExecutionResult",
|
"StepExecutionResult",
|
||||||
|
"SubgraphNode",
|
||||||
"TraceEntry",
|
"TraceEntry",
|
||||||
"InterruptRoute",
|
|
||||||
"InterruptRequest",
|
|
||||||
"PersistedRunState",
|
|
||||||
"dump_run_state",
|
|
||||||
"load_run_state",
|
|
||||||
"START",
|
|
||||||
"END",
|
|
||||||
"ValidationIssue",
|
"ValidationIssue",
|
||||||
"ValidationIssueCode",
|
"ValidationIssueCode",
|
||||||
"ValidationReport",
|
"ValidationReport",
|
||||||
"Workflow",
|
"Workflow",
|
||||||
"WorkflowRef",
|
|
||||||
"WorkflowExecutionError",
|
"WorkflowExecutionError",
|
||||||
|
"WorkflowRef",
|
||||||
"coerce_node_result",
|
"coerce_node_result",
|
||||||
|
"dump_run_state",
|
||||||
|
"execute_workflow",
|
||||||
"execute_workflow_async",
|
"execute_workflow_async",
|
||||||
"execute_workflow_result_async",
|
"execute_workflow_result_async",
|
||||||
"execute_workflow",
|
"load_run_state",
|
||||||
|
"resume_workflow",
|
||||||
"resume_workflow_async",
|
"resume_workflow_async",
|
||||||
"resume_workflow_result_async",
|
"resume_workflow_result_async",
|
||||||
"resume_workflow",
|
|
||||||
"step_workflow_async",
|
|
||||||
"step_workflow",
|
"step_workflow",
|
||||||
|
"step_workflow_async",
|
||||||
"validate_workflow",
|
"validate_workflow",
|
||||||
"workflow_ref_from",
|
"workflow_ref_from",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -41,12 +41,12 @@ __all__ = [
|
|||||||
"LiteralOperand",
|
"LiteralOperand",
|
||||||
"NodeDef",
|
"NodeDef",
|
||||||
"NodeResult",
|
"NodeResult",
|
||||||
"ReducerRef",
|
|
||||||
"ReducerSpec",
|
|
||||||
"NodeUse",
|
"NodeUse",
|
||||||
"NotCondition",
|
"NotCondition",
|
||||||
"Operand",
|
"Operand",
|
||||||
"PathOperand",
|
"PathOperand",
|
||||||
|
"ReducerRef",
|
||||||
|
"ReducerSpec",
|
||||||
"SchemaRef",
|
"SchemaRef",
|
||||||
"SiblingWritePolicy",
|
"SiblingWritePolicy",
|
||||||
"StateField",
|
"StateField",
|
||||||
|
|||||||
@@ -34,14 +34,14 @@ class NotCondition(BaseModel):
|
|||||||
"""Condition that negates another condition expression."""
|
"""Condition that negates another condition expression."""
|
||||||
|
|
||||||
op: Literal["not"]
|
op: Literal["not"]
|
||||||
arg: "Condition"
|
arg: Condition
|
||||||
|
|
||||||
|
|
||||||
class VariadicCondition(BaseModel):
|
class VariadicCondition(BaseModel):
|
||||||
"""Condition that combines one or more child conditions."""
|
"""Condition that combines one or more child conditions."""
|
||||||
|
|
||||||
op: Literal["and", "or"]
|
op: Literal["and", "or"]
|
||||||
args: list["Condition"] = Field(min_length=1)
|
args: list[Condition] = Field(min_length=1)
|
||||||
|
|
||||||
|
|
||||||
class BinaryCondition(BaseModel):
|
class BinaryCondition(BaseModel):
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class Workflow(BaseModel):
|
|||||||
nodes: list[Step]
|
nodes: list[Step]
|
||||||
edges: list[Edge]
|
edges: list[Edge]
|
||||||
|
|
||||||
def validate_structure(self) -> "ValidationReport":
|
def validate_structure(self) -> ValidationReport:
|
||||||
"""Return all structural validation issues for this workflow."""
|
"""Return all structural validation issues for this workflow."""
|
||||||
validation = import_module("wf_core.validation.core")
|
validation = import_module("wf_core.validation.core")
|
||||||
return cast("ValidationReport", validation.validate_workflow(self))
|
return cast("ValidationReport", validation.validate_workflow(self))
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ from .subgraphs import PreparedSubgraph
|
|||||||
__all__ = [
|
__all__ = [
|
||||||
"AsyncNodeHandler",
|
"AsyncNodeHandler",
|
||||||
"NodeHandler",
|
"NodeHandler",
|
||||||
|
"PreparedSubgraph",
|
||||||
"WorkflowExecutionError",
|
"WorkflowExecutionError",
|
||||||
"coerce_node_result",
|
"coerce_node_result",
|
||||||
"complete_step",
|
"complete_step",
|
||||||
@@ -34,5 +35,4 @@ __all__ = [
|
|||||||
"resume_workflow_result_async",
|
"resume_workflow_result_async",
|
||||||
"step_workflow",
|
"step_workflow",
|
||||||
"step_workflow_async",
|
"step_workflow_async",
|
||||||
"PreparedSubgraph",
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class BlockedOnChildren:
|
|||||||
child_frame_ids: tuple[str, ...]
|
child_frame_ids: tuple[str, ...]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_frame(cls, frame: ExecutionFrame) -> "BlockedOnChildren | None":
|
def from_frame(cls, frame: ExecutionFrame) -> BlockedOnChildren | None:
|
||||||
raw = frame.metadata.get("blocked_on")
|
raw = frame.metadata.get("blocked_on")
|
||||||
if raw is None:
|
if raw is None:
|
||||||
return None
|
return None
|
||||||
@@ -46,7 +46,7 @@ class ForeachIterationMetadata:
|
|||||||
loop_alias: str
|
loop_alias: str
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_frame(cls, frame: ExecutionFrame) -> "ForeachIterationMetadata | None":
|
def from_frame(cls, frame: ExecutionFrame) -> ForeachIterationMetadata | None:
|
||||||
if frame.kind != "foreach_iteration":
|
if frame.kind != "foreach_iteration":
|
||||||
return None
|
return None
|
||||||
metadata = frame.metadata
|
metadata = frame.metadata
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
START = "__start__"
|
START = "__start__"
|
||||||
END = "__end__"
|
END = "__end__"
|
||||||
|
|
||||||
__all__ = ["START", "END"]
|
__all__ = ["END", "START"]
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ __all__ = [
|
|||||||
"discover_connection_capabilities",
|
"discover_connection_capabilities",
|
||||||
"load_broker_config",
|
"load_broker_config",
|
||||||
"make_event",
|
"make_event",
|
||||||
|
"normalize_transport",
|
||||||
"snapshot_from_specs",
|
"snapshot_from_specs",
|
||||||
"specs_from_discovered_tools",
|
"specs_from_discovered_tools",
|
||||||
"normalize_transport",
|
|
||||||
"workflow_server_from_service",
|
"workflow_server_from_service",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from .runtime import (
|
|||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"ProxyRuntime",
|
"ProxyRuntime",
|
||||||
"register_proxy_admin_tools",
|
|
||||||
"create_proxy_client",
|
"create_proxy_client",
|
||||||
"create_proxy_server",
|
"create_proxy_server",
|
||||||
|
"register_proxy_admin_tools",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ __all__ = [
|
|||||||
"LdaNamespace",
|
"LdaNamespace",
|
||||||
"ProxyNamespace",
|
"ProxyNamespace",
|
||||||
"ProxyToolName",
|
"ProxyToolName",
|
||||||
"connection_id_to_resource_path",
|
|
||||||
"clamp_limit",
|
"clamp_limit",
|
||||||
|
"connection_id_to_resource_path",
|
||||||
"error_payload",
|
"error_payload",
|
||||||
"is_admin_tool_name",
|
"is_admin_tool_name",
|
||||||
"make_cursor",
|
"make_cursor",
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ def workflow_mcp_source_to_connection_config(source: object) -> ConnectionConfig
|
|||||||
for field in ("id", "provider", "account", "enabled", "ownership", "transport"):
|
for field in ("id", "provider", "account", "enabled", "ownership", "transport"):
|
||||||
if getattr(source, field, None) is None:
|
if getattr(source, field, None) is None:
|
||||||
raise ValueError(f"wf_config MCP source missing required field: {field}")
|
raise ValueError(f"wf_config MCP source missing required field: {field}")
|
||||||
transport = getattr(source, "transport")
|
transport = source.transport
|
||||||
metadata = dict(getattr(source, "metadata", {}))
|
metadata = dict(getattr(source, "metadata", {}))
|
||||||
if transport.kind == "stdio":
|
if transport.kind == "stdio":
|
||||||
metadata.update(
|
metadata.update(
|
||||||
@@ -83,12 +83,12 @@ def workflow_mcp_source_to_connection_config(source: object) -> ConnectionConfig
|
|||||||
if auth_ref is not None:
|
if auth_ref is not None:
|
||||||
metadata["auth_ref"] = auth_ref
|
metadata["auth_ref"] = auth_ref
|
||||||
return ConnectionConfig(
|
return ConnectionConfig(
|
||||||
id=getattr(source, "id"),
|
id=source.id,
|
||||||
server=getattr(source, "provider"),
|
server=source.provider,
|
||||||
account=getattr(source, "account"),
|
account=source.account,
|
||||||
enabled=getattr(source, "enabled"),
|
enabled=source.enabled,
|
||||||
metadata=metadata,
|
metadata=metadata,
|
||||||
source_config_ownership=getattr(source, "ownership"),
|
source_config_ownership=source.ownership,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ older MCP workflow-surface imports keep working until callers migrate.
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from wf_api.runtime_dependencies import ( # noqa: F401
|
from wf_api.runtime_dependencies import (
|
||||||
RuntimeDependencies,
|
RuntimeDependencies,
|
||||||
resolve_runtime_dependencies,
|
resolve_runtime_dependencies,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Annotated, Any, Mapping
|
from collections.abc import Mapping
|
||||||
|
from typing import Annotated, Any
|
||||||
|
|
||||||
from fastmcp import FastMCP
|
from fastmcp import FastMCP
|
||||||
from pydantic import Field
|
from pydantic import Field
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ from .spec import load_openapi_document, load_openapi_operations
|
|||||||
__all__ = [
|
__all__ = [
|
||||||
"OPENAPI_OUTCOMES",
|
"OPENAPI_OUTCOMES",
|
||||||
"OpenApiExecutionConfig",
|
"OpenApiExecutionConfig",
|
||||||
"OpenApiOperationOutput",
|
|
||||||
"OpenApiOperation",
|
"OpenApiOperation",
|
||||||
|
"OpenApiOperationOutput",
|
||||||
"build_openapi_capability_source",
|
"build_openapi_capability_source",
|
||||||
"call_openapi_operation",
|
"call_openapi_operation",
|
||||||
"load_openapi_document",
|
"load_openapi_document",
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from typing import Any, Mapping
|
from typing import Any
|
||||||
from urllib.parse import quote
|
from urllib.parse import quote
|
||||||
|
|
||||||
from .models import OpenApiOperation
|
from .models import OpenApiOperation
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ _LAZY_EXPORTS = {
|
|||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"CapabilityBuckets",
|
"CapabilityBuckets",
|
||||||
"CapabilitySource",
|
|
||||||
"CapabilityRef",
|
"CapabilityRef",
|
||||||
|
"CapabilitySource",
|
||||||
"DocumentationPrompt",
|
"DocumentationPrompt",
|
||||||
"DocumentationResource",
|
"DocumentationResource",
|
||||||
"NodeSpecInventory",
|
"NodeSpecInventory",
|
||||||
@@ -63,10 +63,10 @@ __all__ = [
|
|||||||
"SourcePermissionsSnapshot",
|
"SourcePermissionsSnapshot",
|
||||||
"SourcePolicy",
|
"SourcePolicy",
|
||||||
"SourcePolicySnapshot",
|
"SourcePolicySnapshot",
|
||||||
|
"SourceRef",
|
||||||
"SourceStatus",
|
"SourceStatus",
|
||||||
"SourceVisibility",
|
"SourceVisibility",
|
||||||
"SourceVisibilitySnapshot",
|
"SourceVisibilitySnapshot",
|
||||||
"SourceRef",
|
|
||||||
"build_documentation_source",
|
"build_documentation_source",
|
||||||
"hash_json_schema",
|
"hash_json_schema",
|
||||||
"page_items",
|
"page_items",
|
||||||
|
|||||||
@@ -65,17 +65,19 @@ __all__ = [
|
|||||||
"AdapterLookupRef",
|
"AdapterLookupRef",
|
||||||
"AuthRecord",
|
"AuthRecord",
|
||||||
"DiscoveredConnectionCapabilities",
|
"DiscoveredConnectionCapabilities",
|
||||||
"LegacyAdapterRef",
|
|
||||||
"LegacyConnectionConfigLike",
|
|
||||||
"SourceAdapterRef",
|
|
||||||
"FileSourceRegistryStore",
|
"FileSourceRegistryStore",
|
||||||
"HttpSourceTransport",
|
"HttpSourceTransport",
|
||||||
|
"LegacyAdapterRef",
|
||||||
|
"LegacyConnectionConfigLike",
|
||||||
"McpSourceConnection",
|
"McpSourceConnection",
|
||||||
"McpSourceRegistryEntry",
|
"McpSourceRegistryEntry",
|
||||||
|
"SourceAdapterRef",
|
||||||
"SourceRegistryFile",
|
"SourceRegistryFile",
|
||||||
"SourceRegistryStore",
|
"SourceRegistryStore",
|
||||||
"SourceTransport",
|
"SourceTransport",
|
||||||
"StdioSourceTransport",
|
"StdioSourceTransport",
|
||||||
|
"ToolWrapperEvent",
|
||||||
|
"ToolWrapperEventSink",
|
||||||
"auth_missing_diagnostic",
|
"auth_missing_diagnostic",
|
||||||
"auth_ref_for_connection",
|
"auth_ref_for_connection",
|
||||||
"connection_auth_diagnostic",
|
"connection_auth_diagnostic",
|
||||||
@@ -92,8 +94,6 @@ __all__ = [
|
|||||||
"specs_from_discovered_tools",
|
"specs_from_discovered_tools",
|
||||||
"tool_call_completed_event",
|
"tool_call_completed_event",
|
||||||
"tool_call_started_event",
|
"tool_call_started_event",
|
||||||
"ToolWrapperEvent",
|
|
||||||
"ToolWrapperEventSink",
|
|
||||||
"wrap_discovered_tool",
|
"wrap_discovered_tool",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -77,14 +77,16 @@ async def open_mcp_session(
|
|||||||
headers=bound.headers or None,
|
headers=bound.headers or None,
|
||||||
auth=bound.auth,
|
auth=bound.auth,
|
||||||
)
|
)
|
||||||
async with http_client:
|
async with (
|
||||||
async with streamable_http_client(
|
http_client,
|
||||||
|
streamable_http_client(
|
||||||
str(transport.url),
|
str(transport.url),
|
||||||
http_client=http_client,
|
http_client=http_client,
|
||||||
) as (read_stream, write_stream, _get_session_id):
|
) as (read_stream, write_stream, _get_session_id),
|
||||||
async with ClientSession(read_stream, write_stream) as session:
|
):
|
||||||
await session.initialize()
|
async with ClientSession(read_stream, write_stream) as session:
|
||||||
yield session
|
await session.initialize()
|
||||||
|
yield session
|
||||||
return
|
return
|
||||||
|
|
||||||
raise ValueError(f"unsupported MCP transport {transport.kind!r}")
|
raise ValueError(f"unsupported MCP transport {transport.kind!r}")
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ def _module_file_under_root(root: Path, module: str) -> Path | None:
|
|||||||
|
|
||||||
|
|
||||||
def _synthetic_module_root(*, source_id: str, root: Path) -> str:
|
def _synthetic_module_root(*, source_id: str, root: Path) -> str:
|
||||||
digest = sha256(f"{source_id}\0{root}".encode("utf-8")).hexdigest()[:16]
|
digest = sha256(f"{source_id}\0{root}".encode()).hexdigest()[:16]
|
||||||
safe_source = source_id.replace(".", "_").replace("-", "_")
|
safe_source = source_id.replace(".", "_").replace("-", "_")
|
||||||
return f"_wf_source_{safe_source}_{digest}"
|
return f"_wf_source_{safe_source}_{digest}"
|
||||||
|
|
||||||
|
|||||||
@@ -91,12 +91,13 @@ __all__ = [
|
|||||||
"PatchDraftParams",
|
"PatchDraftParams",
|
||||||
"PatchDraftWorkspaceParams",
|
"PatchDraftWorkspaceParams",
|
||||||
"ReadRunTraceParams",
|
"ReadRunTraceParams",
|
||||||
"ReplaceDraftWorkspaceDocumentParams",
|
|
||||||
"RemoveDraftBindingParams",
|
"RemoveDraftBindingParams",
|
||||||
"RemoveDraftRouteParams",
|
"RemoveDraftRouteParams",
|
||||||
"RemoveDraftStepParams",
|
"RemoveDraftStepParams",
|
||||||
"RouteSourceParams",
|
"ReplaceDraftWorkspaceDocumentParams",
|
||||||
"ResumeRunParams",
|
"ResumeRunParams",
|
||||||
|
"RouteSourceParams",
|
||||||
|
"RpcWorkflowApiClient",
|
||||||
"SaveArtifactParams",
|
"SaveArtifactParams",
|
||||||
"SaveDeploymentParams",
|
"SaveDeploymentParams",
|
||||||
"SetDraftContractParams",
|
"SetDraftContractParams",
|
||||||
@@ -117,5 +118,4 @@ __all__ = [
|
|||||||
"ValidateDraftWorkspaceParams",
|
"ValidateDraftWorkspaceParams",
|
||||||
"WorkflowRpcError",
|
"WorkflowRpcError",
|
||||||
"create_rpc_app",
|
"create_rpc_app",
|
||||||
"RpcWorkflowApiClient",
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -112,4 +112,4 @@ def test_context_runtime_runner_uses_workflow_runtime_service(tmp_path: Path) ->
|
|||||||
service = WfMcpService(store=FileStore(tmp_path / "context_runtime"))
|
service = WfMcpService(store=FileStore(tmp_path / "context_runtime"))
|
||||||
context = context_from_service(service)
|
context = context_from_service(service)
|
||||||
|
|
||||||
assert getattr(context.runtime, "runtime") is service.workflow_runtime
|
assert context.runtime.runtime is service.workflow_runtime
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ from typing import Any
|
|||||||
import pytest
|
import pytest
|
||||||
from typer.testing import CliRunner
|
from typer.testing import CliRunner
|
||||||
|
|
||||||
import wf_cli.commands.caps as caps
|
|
||||||
from wf_cli.app import app
|
from wf_cli.app import app
|
||||||
|
from wf_cli.commands import caps
|
||||||
from wf_cli.commands.caps import (
|
from wf_cli.commands.caps import (
|
||||||
CapCallOutputFormat,
|
CapCallOutputFormat,
|
||||||
render_cap_call_output,
|
render_cap_call_output,
|
||||||
|
|||||||
@@ -320,8 +320,8 @@ def test_source_catalog_service_registers_and_lists_sources_directly(
|
|||||||
server="demo",
|
server="demo",
|
||||||
account="personal",
|
account="personal",
|
||||||
),
|
),
|
||||||
connection_list_enabled=lambda: [],
|
connection_list_enabled=list,
|
||||||
connection_list_all=lambda: [],
|
connection_list_all=list,
|
||||||
tool_executor_for=unused_tool_executor,
|
tool_executor_for=unused_tool_executor,
|
||||||
load_auth=lambda connection_id: None,
|
load_auth=lambda connection_id: None,
|
||||||
emit_event=lambda event: None,
|
emit_event=lambda event: None,
|
||||||
@@ -362,8 +362,8 @@ def test_source_catalog_service_excludes_hidden_sources_from_planner_catalog(
|
|||||||
server="demo",
|
server="demo",
|
||||||
account="personal",
|
account="personal",
|
||||||
),
|
),
|
||||||
connection_list_enabled=lambda: [],
|
connection_list_enabled=list,
|
||||||
connection_list_all=lambda: [],
|
connection_list_all=list,
|
||||||
tool_executor_for=unused_tool_executor,
|
tool_executor_for=unused_tool_executor,
|
||||||
load_auth=lambda connection_id: None,
|
load_auth=lambda connection_id: None,
|
||||||
emit_event=lambda event: None,
|
emit_event=lambda event: None,
|
||||||
@@ -538,8 +538,8 @@ def test_source_catalog_uses_catalog_store_only(tmp_path: Path) -> None:
|
|||||||
server="demo",
|
server="demo",
|
||||||
account="personal",
|
account="personal",
|
||||||
),
|
),
|
||||||
connection_list_enabled=lambda: [],
|
connection_list_enabled=list,
|
||||||
connection_list_all=lambda: [],
|
connection_list_all=list,
|
||||||
tool_executor_for=lambda connection: (_ for _ in ()).throw(
|
tool_executor_for=lambda connection: (_ for _ in ()).throw(
|
||||||
AssertionError("unexpected executor")
|
AssertionError("unexpected executor")
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ def test_wfmcpservice_uses_broker_event_recorder() -> None:
|
|||||||
event_bus=bus,
|
event_bus=bus,
|
||||||
)
|
)
|
||||||
|
|
||||||
service._record_event( # noqa: SLF001
|
service._record_event(
|
||||||
make_event("connection_registered", connection_id="demo.personal")
|
make_event("connection_registered", connection_id="demo.personal")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -240,8 +240,8 @@ async def test_upstream_transport_live_diagnostics_report_missing_connection() -
|
|||||||
source_catalog = SourceCatalogService(
|
source_catalog = SourceCatalogService(
|
||||||
store=transport.catalog_store,
|
store=transport.catalog_store,
|
||||||
connection_lookup=_raise_missing_connection,
|
connection_lookup=_raise_missing_connection,
|
||||||
connection_list_enabled=lambda: [],
|
connection_list_enabled=list,
|
||||||
connection_list_all=lambda: [],
|
connection_list_all=list,
|
||||||
tool_executor_for=transport.tool_executor_for,
|
tool_executor_for=transport.tool_executor_for,
|
||||||
load_auth=transport.load_connection_auth,
|
load_auth=transport.load_connection_auth,
|
||||||
emit_event=lambda event: None,
|
emit_event=lambda event: None,
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ async def test_httpx_oauth_refresher_posts_refresh_token_grant(
|
|||||||
def __init__(self, **kwargs: object) -> None:
|
def __init__(self, **kwargs: object) -> None:
|
||||||
assert kwargs["timeout"] == 10.0
|
assert kwargs["timeout"] == 10.0
|
||||||
|
|
||||||
async def __aenter__(self) -> "_Client":
|
async def __aenter__(self) -> _Client:
|
||||||
return self
|
return self
|
||||||
|
|
||||||
async def __aexit__(self, *args: object) -> None:
|
async def __aexit__(self, *args: object) -> None:
|
||||||
|
|||||||
@@ -274,10 +274,10 @@ async def test_open_mcp_session_uses_binder_for_http_headers(
|
|||||||
def __init__(self, **kwargs: Any) -> None:
|
def __init__(self, **kwargs: Any) -> None:
|
||||||
captured_clients.append(kwargs)
|
captured_clients.append(kwargs)
|
||||||
|
|
||||||
async def __aenter__(self) -> "_CapturingClient":
|
async def __aenter__(self) -> _CapturingClient:
|
||||||
return self
|
return self
|
||||||
|
|
||||||
async def __aexit__(self, *args: Any) -> None:
|
async def __aexit__(self, *args: object) -> None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
import wf_sources_mcp.client.transport as mod
|
import wf_sources_mcp.client.transport as mod
|
||||||
@@ -319,7 +319,7 @@ async def test_open_mcp_session_refreshes_oauth_record_for_http(
|
|||||||
def __init__(self, **kwargs: Any) -> None:
|
def __init__(self, **kwargs: Any) -> None:
|
||||||
captured_clients.append(kwargs)
|
captured_clients.append(kwargs)
|
||||||
|
|
||||||
async def __aenter__(self) -> "_CapturingClient":
|
async def __aenter__(self) -> _CapturingClient:
|
||||||
return self
|
return self
|
||||||
|
|
||||||
async def __aexit__(self, *args: object) -> None:
|
async def __aexit__(self, *args: object) -> None:
|
||||||
@@ -365,7 +365,7 @@ async def test_open_mcp_session_refreshes_oauth_record_for_http(
|
|||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_open_mcp_session_uses_binder_for_stdio_env() -> None:
|
async def test_open_mcp_session_uses_binder_for_stdio_env() -> None:
|
||||||
import wf_sources_mcp.client.transport as mod # noqa: I001
|
import wf_sources_mcp.client.transport as mod
|
||||||
from wf_api.auth import EnvAuth, StoredAuthRecord
|
from wf_api.auth import EnvAuth, StoredAuthRecord
|
||||||
|
|
||||||
captured_params: list[Any] = []
|
captured_params: list[Any] = []
|
||||||
|
|||||||
Reference in New Issue
Block a user