fenix-mcp 0.5.7__tar.gz → 0.5.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/PKG-INFO +1 -1
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/__init__.py +1 -1
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/application/tools/intelligence.py +46 -2
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp.egg-info/PKG-INFO +1 -1
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/README.md +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/application/presenters.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/application/tool_base.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/application/tool_registry.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/application/tools/__init__.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/application/tools/health.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/application/tools/initialize.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/application/tools/knowledge.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/application/tools/productivity.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/application/tools/user_config.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/domain/initialization.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/domain/intelligence.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/domain/knowledge.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/domain/productivity.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/domain/user_config.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/infrastructure/config.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/infrastructure/context.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/infrastructure/fenix_api/client.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/infrastructure/http_client.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/infrastructure/logging.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/interface/mcp_server.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/interface/transports.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp/main.py +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp.egg-info/SOURCES.txt +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp.egg-info/dependency_links.txt +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp.egg-info/entry_points.txt +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp.egg-info/requires.txt +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/fenix_mcp.egg-info/top_level.txt +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/pyproject.toml +0 -0
- {fenix_mcp-0.5.7 → fenix_mcp-0.5.9}/setup.cfg +0 -0
|
@@ -6,7 +6,7 @@ from __future__ import annotations
|
|
|
6
6
|
from enum import Enum
|
|
7
7
|
from typing import Any, Dict, List, Optional
|
|
8
8
|
|
|
9
|
-
from pydantic import Field
|
|
9
|
+
from pydantic import Field, field_validator
|
|
10
10
|
|
|
11
11
|
from fenix_mcp.application.presenters import text
|
|
12
12
|
from fenix_mcp.application.tool_base import Tool, ToolRequest
|
|
@@ -83,7 +83,40 @@ class IntelligenceRequest(ToolRequest):
|
|
|
83
83
|
default=False,
|
|
84
84
|
description="Retornar metadata completa das memórias? Defina true para incluir o campo bruto.",
|
|
85
85
|
)
|
|
86
|
-
tags: Optional[List[str]] = Field(
|
|
86
|
+
tags: Optional[List[str]] = Field(
|
|
87
|
+
default=None,
|
|
88
|
+
description="Tags da memória como array JSON de strings.",
|
|
89
|
+
json_schema_extra={"example": ["tag1", "tag2", "tag3"]},
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
@field_validator("tags", mode="before")
|
|
93
|
+
@classmethod
|
|
94
|
+
def validate_tags(cls, v: Any) -> Optional[List[str]]:
|
|
95
|
+
"""Validate and normalize tags field."""
|
|
96
|
+
if v is None or v == "":
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
# If it's already a list, return as is
|
|
100
|
+
if isinstance(v, (list, tuple, set)):
|
|
101
|
+
return [str(item).strip() for item in v if str(item).strip()]
|
|
102
|
+
|
|
103
|
+
# If it's a string, try to parse as JSON
|
|
104
|
+
if isinstance(v, str):
|
|
105
|
+
try:
|
|
106
|
+
import json
|
|
107
|
+
|
|
108
|
+
parsed = json.loads(v)
|
|
109
|
+
if isinstance(parsed, list):
|
|
110
|
+
return [str(item).strip() for item in parsed if str(item).strip()]
|
|
111
|
+
except (json.JSONDecodeError, TypeError):
|
|
112
|
+
pass
|
|
113
|
+
|
|
114
|
+
# If JSON parsing fails, treat as comma-separated string
|
|
115
|
+
return [item.strip() for item in v.split(",") if item.strip()]
|
|
116
|
+
|
|
117
|
+
# For any other type, convert to string and wrap in list
|
|
118
|
+
return [str(v).strip()] if str(v).strip() else None
|
|
119
|
+
|
|
87
120
|
limit: int = Field(default=20, ge=1, le=100, description="Limite de resultados.")
|
|
88
121
|
offset: int = Field(default=0, ge=0, description="Offset para paginação.")
|
|
89
122
|
query: Optional[str] = Field(default=None, description="Termo de busca.")
|
|
@@ -342,6 +375,17 @@ def _ensure_tag_sequence(raw: Optional[Any]) -> Optional[List[str]]:
|
|
|
342
375
|
result = [str(item).strip() for item in raw if str(item).strip()]
|
|
343
376
|
return result or None
|
|
344
377
|
if isinstance(raw, str):
|
|
378
|
+
# Try to parse as JSON array first
|
|
379
|
+
try:
|
|
380
|
+
import json
|
|
381
|
+
|
|
382
|
+
parsed = json.loads(raw)
|
|
383
|
+
if isinstance(parsed, list):
|
|
384
|
+
result = [str(item).strip() for item in parsed if str(item).strip()]
|
|
385
|
+
return result or None
|
|
386
|
+
except (json.JSONDecodeError, TypeError):
|
|
387
|
+
pass
|
|
388
|
+
|
|
345
389
|
raise ValueError(
|
|
346
390
|
"O campo `tags` deve ser enviado como array JSON, por exemplo: "
|
|
347
391
|
'["tag1", "tag2"].'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|