fenix-mcp 0.2.2__py3-none-any.whl → 0.4.0__py3-none-any.whl

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/__init__.py CHANGED
@@ -17,4 +17,4 @@ Updated with improved error handling and better documentation.
17
17
 
18
18
  __all__ = ["__version__"]
19
19
 
20
- __version__ = "0.2.2"
20
+ __version__ = "0.4.0"
@@ -71,6 +71,14 @@ class IntelligenceRequest(ToolRequest):
71
71
  importance: str = Field(
72
72
  default="medium", description="Nível de importância da memória."
73
73
  )
74
+ include_content: bool = Field(
75
+ default=False,
76
+ description="Retornar conteúdo completo das memórias? Defina true para incluir o texto integral.",
77
+ )
78
+ include_metadata: bool = Field(
79
+ default=False,
80
+ description="Retornar metadata completa das memórias? Defina true para incluir o campo bruto.",
81
+ )
74
82
  tags: Optional[List[str]] = Field(default=None, description="Tags da memória.")
75
83
  limit: int = Field(default=20, ge=1, le=100, description="Limite de resultados.")
76
84
  offset: int = Field(default=0, ge=0, description="Offset para paginação.")
@@ -167,6 +175,13 @@ class IntelligenceTool(Tool):
167
175
  offset=payload.offset,
168
176
  query=payload.query,
169
177
  tags=payload.tags,
178
+ include_content=payload.include_content,
179
+ include_metadata=payload.include_metadata,
180
+ modeId=payload.mode_id,
181
+ ruleId=payload.rule_id,
182
+ workItemId=payload.work_item_id,
183
+ sprintId=payload.sprint_id,
184
+ documentationItemId=payload.documentation_item_id,
170
185
  category=payload.category,
171
186
  dateFrom=payload.date_from,
172
187
  dateTo=payload.date_to,
@@ -42,14 +42,31 @@ class IntelligenceService:
42
42
 
43
43
  async def query_memories(self, **filters: Any) -> List[Dict[str, Any]]:
44
44
  params = _strip_none(filters)
45
- include_content = bool(params.pop("content", True))
46
- include_metadata = bool(params.pop("metadata", False))
45
+ include_content = _coerce_bool(
46
+ params.pop("include_content", params.pop("content", None))
47
+ )
48
+ include_metadata = _coerce_bool(
49
+ params.pop("include_metadata", params.pop("metadata", None))
50
+ )
51
+ allowed_keys = {
52
+ "limit",
53
+ "offset",
54
+ "query",
55
+ "tags",
56
+ "modeId",
57
+ "ruleId",
58
+ "workItemId",
59
+ "sprintId",
60
+ "documentationItemId",
61
+ "importance",
62
+ }
63
+ cleaned_params = {key: params[key] for key in allowed_keys if key in params}
47
64
  return (
48
65
  await self._call(
49
66
  self.api.list_memories,
50
67
  include_content=include_content,
51
68
  include_metadata=include_metadata,
52
- **params,
69
+ **cleaned_params,
53
70
  )
54
71
  or []
55
72
  )
@@ -141,5 +158,21 @@ def _importance_to_priority(importance: Optional[str]) -> float:
141
158
  return mapping.get(importance.lower(), 0.5)
142
159
 
143
160
 
161
+ def _coerce_bool(value: Any, default: bool = False) -> bool:
162
+ if value is None or value == "":
163
+ return default
164
+ if isinstance(value, bool):
165
+ return value
166
+ if isinstance(value, (int, float)):
167
+ return bool(value)
168
+ if isinstance(value, str):
169
+ normalized = value.strip().lower()
170
+ if normalized in {"true", "1", "yes", "y"}:
171
+ return True
172
+ if normalized in {"false", "0", "no", "n"}:
173
+ return False
174
+ return bool(value)
175
+
176
+
144
177
  def _strip_none(data: Dict[str, Any]) -> Dict[str, Any]:
145
178
  return {key: value for key, value in data.items() if value not in (None, "")}
@@ -16,6 +16,8 @@ class FenixApiError(RuntimeError):
16
16
  def _to_query_value(value: Any) -> Any:
17
17
  if isinstance(value, bool):
18
18
  return "true" if value else "false"
19
+ if isinstance(value, (list, tuple, set)):
20
+ return ",".join(str(item) for item in value)
19
21
  return value
20
22
 
21
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fenix-mcp
3
- Version: 0.2.2
3
+ Version: 0.4.0
4
4
  Summary: Fênix Cloud MCP server implemented in Python
5
5
  Author: Fenix Inc
6
6
  Requires-Python: >=3.10
@@ -1,4 +1,4 @@
1
- fenix_mcp/__init__.py,sha256=W_iAG0ktWWVkX6wtJ3lfFzR8SyjeojSQSQp67Ar8cyI,615
1
+ fenix_mcp/__init__.py,sha256=RC_GHV0oxTvs3Y2i7XSIUtYYtjwepfTw40Tcnx2CdfU,615
2
2
  fenix_mcp/main.py,sha256=iJV-9btNMDJMObvcn7wBQdbLLKjkYCQ1ANGEwHGHlMU,2857
3
3
  fenix_mcp/application/presenters.py,sha256=fGME54PdCDhTBhXO-JUB9yLdBHiE1aeXLTC2fCuxnxM,689
4
4
  fenix_mcp/application/tool_base.py,sha256=qUcb46qx9gHQfrSHgj4RD4NCHW-OIvKQdR5G9uxZ5l4,1316
@@ -6,12 +6,12 @@ fenix_mcp/application/tool_registry.py,sha256=bPT5g8GfxG_qu28R1WaDOZHvtmG6TPDvZi
6
6
  fenix_mcp/application/tools/__init__.py,sha256=Gi1YvYh-KdL9HD8gLVrknHrxiKKEOhHBEZ02KBXJaKQ,796
7
7
  fenix_mcp/application/tools/health.py,sha256=m5DxhoRbdwl6INzd6PISxv1NAv-ljCrezsr773VB0wE,834
8
8
  fenix_mcp/application/tools/initialize.py,sha256=f33DNDn9u8IYwpqiBj6bjJ-wHgaUP1zEuAvUM1rMYPc,4674
9
- fenix_mcp/application/tools/intelligence.py,sha256=Tst0ydvaLgxx3GC1vyfNK3iWf2Nf46_A-DZGtgsMD-Q,12090
9
+ fenix_mcp/application/tools/intelligence.py,sha256=oRGmmaeRJG_6ckZaByAdZbMKmr2E1cZPxGeFwSFaCTE,12761
10
10
  fenix_mcp/application/tools/knowledge.py,sha256=4ClGoFRqyFIPuzzg2DAg-w2eMvTP37mH0THXDGftinw,44634
11
11
  fenix_mcp/application/tools/productivity.py,sha256=2IMkNdZ-Kd1CFAO7geruAVjtf_BWoDdbnwkl76vhtC8,9973
12
12
  fenix_mcp/application/tools/user_config.py,sha256=8mPOZuwszO0TapxgrA7Foe15VQE874_mvfQYlGzyv4Y,6230
13
13
  fenix_mcp/domain/initialization.py,sha256=AZhdSNITQ7O3clELBuqGvjJc-c8pFKc7zQz-XR2xXPc,6933
14
- fenix_mcp/domain/intelligence.py,sha256=8t4cgCsGwt8ouabVYrajp3-M90DepLnP_qZPNYnGCzU,4725
14
+ fenix_mcp/domain/intelligence.py,sha256=rOQWxtEceTWGlnWMfUXrBTzjt-yATrMPgFktWF1L5QA,5707
15
15
  fenix_mcp/domain/knowledge.py,sha256=fKQOTt20u5aa5Yo7gPeQ1Qxa_K5pBxn1yn8FEfOFltM,20241
16
16
  fenix_mcp/domain/productivity.py,sha256=nmHRuVJGRRu1s4eMoAv8vXHKsSauCPl-FvFx3I_yCTE,6661
17
17
  fenix_mcp/domain/user_config.py,sha256=LzBDCk31gLMtKHTbBmYb9VoFPHDW6OydpmDXeHHd0Mw,1642
@@ -19,11 +19,11 @@ fenix_mcp/infrastructure/config.py,sha256=zhJ3hhsP-bRfICcdq8rIDh5NGDe_u7AGpcgjcc
19
19
  fenix_mcp/infrastructure/context.py,sha256=kiDiamiPbHZpTGyZMylcQwtLhfaDXrxAkWSst_DWQNw,470
20
20
  fenix_mcp/infrastructure/http_client.py,sha256=QLIPhGYR_cBQGsbIO4RTR6ksyvkQt-OKHQU1JhPyap8,2470
21
21
  fenix_mcp/infrastructure/logging.py,sha256=bHrWlSi_0HshRe3--BK_5nzUszW-gh37q6jsd0ShS2Y,1371
22
- fenix_mcp/infrastructure/fenix_api/client.py,sha256=9gYNTxky5i3bjTiiRXdnld6ZCvkTtf0Xdlm0FDtQi24,28239
22
+ fenix_mcp/infrastructure/fenix_api/client.py,sha256=Navi7cGAOradghcbYkFIQQINpjFrdINlNhdfZ4iSSYQ,28338
23
23
  fenix_mcp/interface/mcp_server.py,sha256=5UM2NJuNbwHkmCEprIFataJ5nFZiO8efTtP_oW3_iX0,2331
24
24
  fenix_mcp/interface/transports.py,sha256=PxdhfjH8UMl03f7nuCLc-M6tMx6-Y-btVz_mSqXKrSI,8138
25
- fenix_mcp-0.2.2.dist-info/METADATA,sha256=tiq0YSn4en4c0V6Fi4fI2IQQ6I70fzTkRuWRp0cXsiY,7260
26
- fenix_mcp-0.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
- fenix_mcp-0.2.2.dist-info/entry_points.txt,sha256=o52x_YHBupEd-1Z1GSfUjv3gJrx5_I-EkHhCgt1WBaE,49
28
- fenix_mcp-0.2.2.dist-info/top_level.txt,sha256=2G1UtKpwjaIGQyE7sRoHecxaGLeuexfjrOUjv9DDKh4,10
29
- fenix_mcp-0.2.2.dist-info/RECORD,,
25
+ fenix_mcp-0.4.0.dist-info/METADATA,sha256=fIm7WGYy9JK5VwYIlc_iFWgLVh6XuNFvGJKkPrjS3O0,7260
26
+ fenix_mcp-0.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
+ fenix_mcp-0.4.0.dist-info/entry_points.txt,sha256=o52x_YHBupEd-1Z1GSfUjv3gJrx5_I-EkHhCgt1WBaE,49
28
+ fenix_mcp-0.4.0.dist-info/top_level.txt,sha256=2G1UtKpwjaIGQyE7sRoHecxaGLeuexfjrOUjv9DDKh4,10
29
+ fenix_mcp-0.4.0.dist-info/RECORD,,