xpander-sdk 2.0.227__py3-none-any.whl → 2.0.228__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.
@@ -1005,8 +1005,19 @@ async def _resolve_agent_tools(agent: Agent, task: Optional[Task] = None, auth_e
1005
1005
  # check if we have user tokens for this mcp
1006
1006
  graph_item = next((gi for gi in agent.graph.items if gi.type == AgentGraphItemType.MCP and gi.settings and gi.settings.mcp_settings and gi.settings.mcp_settings.url and gi.settings.mcp_settings.url == mcp.url), None)
1007
1007
  if graph_item and task.user_tokens and isinstance(task.user_tokens, dict) and graph_item.id in task.user_tokens:
1008
- mcp.api_key = task.user_tokens[graph_item.id]
1009
- else:
1008
+ if isinstance(task.user_tokens[graph_item.id], dict):
1009
+ graph_item_headers = task.user_tokens[graph_item.id]
1010
+ if "Authorization" in graph_item_headers:
1011
+ mcp.api_key = graph_item_headers["Authorization"]
1012
+ for k in graph_item_headers:
1013
+ if k != "Authorization":
1014
+ if not mcp.headers or not isinstance(mcp.headers, dict):
1015
+ mcp.headers = {}
1016
+ mcp.headers[k] = graph_item_headers[k]
1017
+ else:
1018
+ mcp.api_key = task.user_tokens[graph_item.id]
1019
+
1020
+ if not mcp.api_key:
1010
1021
  if not task.input.user or not task.input.user.id:
1011
1022
  raise ValueError("MCP server with OAuth authentication detected but user id not set on the task (task.input.user.id)")
1012
1023
 
@@ -1024,7 +1035,17 @@ async def _resolve_agent_tools(agent: Agent, task: Optional[Task] = None, auth_e
1024
1035
  # check if we have user tokens for this mcp
1025
1036
  graph_item = next((gi for gi in agent.graph.items if gi.type == AgentGraphItemType.MCP and gi.settings and gi.settings.mcp_settings and gi.settings.mcp_settings.url and gi.settings.mcp_settings.url == mcp.url), None)
1026
1037
  if graph_item and task.user_tokens and isinstance(task.user_tokens, dict) and graph_item.id in task.user_tokens:
1027
- mcp.api_key = task.user_tokens[graph_item.id]
1038
+ if isinstance(task.user_tokens[graph_item.id], dict):
1039
+ graph_item_headers = task.user_tokens[graph_item.id]
1040
+ if "Authorization" in graph_item_headers:
1041
+ mcp.api_key = graph_item_headers["Authorization"]
1042
+ for k in graph_item_headers:
1043
+ if k != "Authorization":
1044
+ if not mcp.headers or not isinstance(mcp.headers, dict):
1045
+ mcp.headers = {}
1046
+ mcp.headers[k] = graph_item_headers[k]
1047
+ else:
1048
+ mcp.api_key = task.user_tokens[graph_item.id]
1028
1049
 
1029
1050
  if not mcp.headers:
1030
1051
  mcp.headers = {}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xpander-sdk
3
- Version: 2.0.227
3
+ Version: 2.0.228
4
4
  Summary: xpander.ai Backend-as-a-service for AI Agents - SDK
5
5
  Home-page: https://www.xpander.ai
6
6
  Author: xpanderAI
@@ -36,7 +36,7 @@ xpander_sdk/modules/backend/events_registry.py,sha256=d0V-lsz3I3G1QB643EM1i-a5oJ
36
36
  xpander_sdk/modules/backend/decorators/__init__.py,sha256=ub9c8G0Ll6AuCvfcFB6rqR8iamMJxtcW7QjWw3WSkPU,106
37
37
  xpander_sdk/modules/backend/decorators/on_auth_event.py,sha256=Xt_x9nncujMcF_SgM5hG6M-iZ6B-rDS97EPmgZkGdMk,4715
38
38
  xpander_sdk/modules/backend/frameworks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
- xpander_sdk/modules/backend/frameworks/agno.py,sha256=q0ImRrPYpYpGhZE2J0XqCYmXgZECRpgVqAGCkCVleDY,45336
39
+ xpander_sdk/modules/backend/frameworks/agno.py,sha256=sGJJCIKTfrBDHkyY9AG6Dsa7kEypEyRayJQfEsTIEPI,46699
40
40
  xpander_sdk/modules/backend/frameworks/dispatch.py,sha256=ht9hT5-cHATofQbWsbWeTARx51Hne3TNNNjw6KECRtA,1814
41
41
  xpander_sdk/modules/backend/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  xpander_sdk/modules/backend/utils/mcp_oauth.py,sha256=5sYJcw557V3pSgutxUFzkBp5YxUJFUoB1V1rEe814pc,5430
@@ -90,8 +90,8 @@ xpander_sdk/utils/generic.py,sha256=XrRj2-L8c0YWpfPdDyXE-pVL-6lKF9VpyZzKHQ4wuCc,
90
90
  xpander_sdk/utils/tools.py,sha256=lyFkq2yP7DxBkyXYVlnFRwDhQCvf0fZZMDm5fBycze4,1244
91
91
  xpander_sdk/utils/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
92
92
  xpander_sdk/utils/agents/compactization_agent.py,sha256=S_U1dSmDC7I0JUsp_THUYjfutEI5QMBaMPJEXGp0_Sw,14389
93
- xpander_sdk-2.0.227.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
94
- xpander_sdk-2.0.227.dist-info/METADATA,sha256=GsWF2uvdIA45EhMTa_hv_zGPnpLRDyTkLNjwI7T_kHg,17952
95
- xpander_sdk-2.0.227.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
96
- xpander_sdk-2.0.227.dist-info/top_level.txt,sha256=UCjnxQpsMy5Zoe7lmRuVDO6DI2V_6PgRFfm4oizRbVs,12
97
- xpander_sdk-2.0.227.dist-info/RECORD,,
93
+ xpander_sdk-2.0.228.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
94
+ xpander_sdk-2.0.228.dist-info/METADATA,sha256=aaggfiz8oURfeC5P8fxRkWYqWddO5L2nfulGybb_10E,17952
95
+ xpander_sdk-2.0.228.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
96
+ xpander_sdk-2.0.228.dist-info/top_level.txt,sha256=UCjnxQpsMy5Zoe7lmRuVDO6DI2V_6PgRFfm4oizRbVs,12
97
+ xpander_sdk-2.0.228.dist-info/RECORD,,