Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions plugins/ai_artifacts_normalizer/ai_artifacts_normalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
Hooks: prompt_pre_fetch, resource_post_fetch, tool_post_invoke
"""

# Future
from __future__ import annotations

# Standard
import re
from typing import Any

# Third-Party
from pydantic import BaseModel

# First-Party
from mcpgateway.plugins.framework import (
Plugin,
PluginConfig,
Expand All @@ -27,16 +30,13 @@
ToolPostInvokeResult,
)


SMART_MAP = {
""": '"',
""": '"',
"„": '"',
""": '"',
"'": "'",
'"': '"',
"'": "'",
"‚": "'",
"'": "'",
"—": "-",
"–": "-",
"−": "-",
Expand All @@ -54,9 +54,7 @@
"ff": "ff",
}

BIDI_AND_ZERO_WIDTH = re.compile(
"[\u200B\u200C\u200D\u200E\u200F\u202A-\u202E\u2066-\u2069]"
)
BIDI_AND_ZERO_WIDTH = re.compile("[\u200b\u200c\u200d\u200e\u200f\u202a-\u202e\u2066-\u2069]")

SPACING_RE = re.compile(r"[ \t\x0b\x0c]+")

Expand Down
5 changes: 2 additions & 3 deletions plugins/argument_normalizer/argument_normalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"""

# Standard
import re
import unicodedata
from dataclasses import dataclass
from enum import Enum
import re
from typing import Any, Dict, List, Optional
import unicodedata

# Third-Party
from pydantic import BaseModel, Field
Expand All @@ -37,7 +37,6 @@
)
from mcpgateway.services.logging_service import LoggingService


# Initialize logging service first
logging_service = LoggingService()
logger = logging_service.get_logger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion plugins/cached_tool_result/cached_tool_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
constraints; writes occur in tool_post_invoke.
"""

# Future
from __future__ import annotations

# Standard
from dataclasses import dataclass
import hashlib
import json
import time
from dataclasses import dataclass
from typing import Any, Dict, List, Optional

# Third-Party
Expand Down
5 changes: 4 additions & 1 deletion plugins/citation_validator/citation_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@
Hooks: resource_post_fetch, tool_post_invoke
"""

# Future
from __future__ import annotations

# Standard
import re
from typing import Any, Dict, List, Optional, Tuple

# Third-Party
from pydantic import BaseModel

# First-Party
from mcpgateway.plugins.framework import (
Plugin,
PluginConfig,
Expand All @@ -31,7 +35,6 @@
)
from mcpgateway.utils.retry_manager import ResilientHttpClient


URL_RE = re.compile(r"https?://[\w\-\._~:/%#\[\]@!\$&'\(\)\*\+,;=]+", re.IGNORECASE)


Expand Down
7 changes: 6 additions & 1 deletion plugins/code_formatter/code_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
Hooks: tool_post_invoke, resource_post_fetch
"""

# Future
from __future__ import annotations

# Standard
from textwrap import dedent
from typing import Any, Dict, Optional
from typing import Any, Optional

# Third-Party
from pydantic import BaseModel

# First-Party
from mcpgateway.plugins.framework import (
Plugin,
PluginConfig,
Expand Down Expand Up @@ -74,6 +78,7 @@ def _normalize_text(text: str, cfg: CodeFormatterConfig) -> str:


def _try_format_json(text: str) -> Optional[str]:
# Standard
import json

try:
Expand Down
3 changes: 2 additions & 1 deletion plugins/code_safety_linter/code_safety_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
either blocks or annotates based on mode.
"""

# Future
from __future__ import annotations

# Standard
import re
from typing import Any, List
from typing import List

# Third-Party
from pydantic import BaseModel, Field
Expand Down
Loading
Loading