chuk-tool-processor 0.6.10__tar.gz → 0.6.12__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.
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/PKG-INFO +2 -1
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/pyproject.toml +3 -2
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/mcp/mcp_tool.py +40 -8
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/mcp/transport/http_streamable_transport.py +229 -78
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/mcp/transport/sse_transport.py +154 -74
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/mcp/transport/stdio_transport.py +293 -58
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor.egg-info/PKG-INFO +2 -1
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor.egg-info/requires.txt +1 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/README.md +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/setup.cfg +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/core/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/core/exceptions.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/core/processor.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/execution/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/execution/strategies/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/execution/strategies/inprocess_strategy.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/execution/strategies/subprocess_strategy.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/execution/tool_executor.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/execution/wrappers/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/execution/wrappers/caching.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/execution/wrappers/rate_limiting.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/execution/wrappers/retry.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/logging/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/logging/context.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/logging/formatter.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/logging/helpers.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/logging/metrics.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/mcp/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/mcp/register_mcp_tools.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/mcp/setup_mcp_http_streamable.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/mcp/setup_mcp_sse.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/mcp/setup_mcp_stdio.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/mcp/stream_manager.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/mcp/transport/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/mcp/transport/base_transport.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/models/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/models/execution_strategy.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/models/streaming_tool.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/models/tool_call.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/models/tool_export_mixin.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/models/tool_result.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/models/validated_tool.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/plugins/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/plugins/discovery.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/plugins/parsers/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/plugins/parsers/base.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/plugins/parsers/function_call_tool.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/plugins/parsers/json_tool.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/plugins/parsers/openai_tool.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/plugins/parsers/xml_tool.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/registry/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/registry/auto_register.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/registry/decorators.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/registry/interface.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/registry/metadata.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/registry/provider.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/registry/providers/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/registry/providers/memory.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/registry/tool_export.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/utils/__init__.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/utils/validation.py +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor.egg-info/SOURCES.txt +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor.egg-info/dependency_links.txt +0 -0
- {chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chuk-tool-processor
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.12
|
|
4
4
|
Summary: Async-native framework for registering, discovering, and executing tools referenced in LLM responses
|
|
5
5
|
Author-email: CHUK Team <chrishayuk@somejunkmailbox.com>
|
|
6
6
|
Maintainer-email: CHUK Team <chrishayuk@somejunkmailbox.com>
|
|
@@ -22,6 +22,7 @@ Requires-Python: >=3.11
|
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
Requires-Dist: chuk-mcp>=0.5.2
|
|
24
24
|
Requires-Dist: dotenv>=0.9.9
|
|
25
|
+
Requires-Dist: psutil>=7.0.0
|
|
25
26
|
Requires-Dist: pydantic>=2.11.3
|
|
26
27
|
Requires-Dist: uuid>=1.30
|
|
27
28
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "chuk-tool-processor"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.12"
|
|
8
8
|
description = "Async-native framework for registering, discovering, and executing tools referenced in LLM responses"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -43,6 +43,7 @@ classifiers = [
|
|
|
43
43
|
dependencies = [
|
|
44
44
|
"chuk-mcp>=0.5.2",
|
|
45
45
|
"dotenv>=0.9.9",
|
|
46
|
+
"psutil>=7.0.0",
|
|
46
47
|
"pydantic>=2.11.3",
|
|
47
48
|
"uuid>=1.30",
|
|
48
49
|
]
|
|
@@ -68,4 +69,4 @@ dev = [
|
|
|
68
69
|
"uvicorn>=0.34.2",
|
|
69
70
|
"fastapi>=0.115.12",
|
|
70
71
|
"langchain>=0.3.25",
|
|
71
|
-
]
|
|
72
|
+
]
|
{chuk_tool_processor-0.6.10 → chuk_tool_processor-0.6.12}/src/chuk_tool_processor/mcp/mcp_tool.py
RENAMED
|
@@ -9,6 +9,10 @@ not configuration or bootstrapping. Configuration is handled at registration tim
|
|
|
9
9
|
CORE PRINCIPLE: MCPTool wraps a StreamManager and delegates calls to it.
|
|
10
10
|
If the StreamManager becomes unavailable, return graceful errors rather than
|
|
11
11
|
trying to recreate it with config files.
|
|
12
|
+
|
|
13
|
+
HEALTH MONITORING FIX: Updated health checking to be more lenient and trust
|
|
14
|
+
the underlying transport's health monitoring instead of doing aggressive
|
|
15
|
+
ping tests that create false negatives.
|
|
12
16
|
"""
|
|
13
17
|
from __future__ import annotations
|
|
14
18
|
|
|
@@ -60,6 +64,9 @@ class MCPTool:
|
|
|
60
64
|
|
|
61
65
|
SIMPLIFIED: This class now focuses only on execution delegation.
|
|
62
66
|
It does NOT handle configuration files or StreamManager bootstrapping.
|
|
67
|
+
|
|
68
|
+
FIXED: Health monitoring is now more lenient and trusts the underlying
|
|
69
|
+
transport's health reporting instead of doing aggressive health checks.
|
|
63
70
|
"""
|
|
64
71
|
|
|
65
72
|
def __init__(
|
|
@@ -200,7 +207,7 @@ class MCPTool:
|
|
|
200
207
|
effective_timeout = timeout if timeout is not None else self.default_timeout
|
|
201
208
|
self.stats.total_calls += 1
|
|
202
209
|
|
|
203
|
-
#
|
|
210
|
+
# FIXED: More lenient health check - trust the transport layer
|
|
204
211
|
if not await self._is_stream_manager_healthy():
|
|
205
212
|
await self._record_failure(is_connection_error=True)
|
|
206
213
|
return {
|
|
@@ -294,17 +301,41 @@ class MCPTool:
|
|
|
294
301
|
raise
|
|
295
302
|
|
|
296
303
|
async def _is_stream_manager_healthy(self) -> bool:
|
|
297
|
-
"""
|
|
304
|
+
"""
|
|
305
|
+
FIXED: Much more lenient health check.
|
|
306
|
+
|
|
307
|
+
The diagnostic proves SSE transport is healthy, so we should trust it
|
|
308
|
+
instead of doing aggressive health checking that creates false negatives.
|
|
309
|
+
|
|
310
|
+
This replaces the previous ping_servers() call which was too aggressive
|
|
311
|
+
and caused "unhealthy connection" false positives.
|
|
312
|
+
"""
|
|
298
313
|
if self._sm is None:
|
|
299
314
|
return False
|
|
300
315
|
|
|
316
|
+
# FIXED: Simple check - if we have a StreamManager, assume it's available
|
|
317
|
+
# The underlying SSE transport now has proper health monitoring
|
|
301
318
|
try:
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
319
|
+
# Just check if the StreamManager has basic functionality
|
|
320
|
+
if hasattr(self._sm, 'transports') and self._sm.transports:
|
|
321
|
+
logger.debug(f"StreamManager healthy for '{self.tool_name}' - has {len(self._sm.transports)} transports")
|
|
322
|
+
return True
|
|
323
|
+
|
|
324
|
+
# Fallback - try very quick operation with short timeout
|
|
325
|
+
server_info = await asyncio.wait_for(self._sm.get_server_info(), timeout=1.0)
|
|
326
|
+
healthy = len(server_info) > 0
|
|
327
|
+
logger.debug(f"StreamManager health for '{self.tool_name}': {healthy} (via server_info)")
|
|
328
|
+
return healthy
|
|
329
|
+
|
|
330
|
+
except asyncio.TimeoutError:
|
|
331
|
+
logger.debug(f"StreamManager health check timed out for '{self.tool_name}' - assuming healthy")
|
|
332
|
+
# FIXED: Timeout doesn't mean unavailable, just slow
|
|
333
|
+
return True
|
|
305
334
|
except Exception as e:
|
|
306
|
-
logger.debug(f"
|
|
307
|
-
|
|
335
|
+
logger.debug(f"StreamManager health check failed for '{self.tool_name}': {e}")
|
|
336
|
+
# FIXED: Most exceptions don't mean the StreamManager is unavailable
|
|
337
|
+
# The transport layer handles real connectivity issues
|
|
338
|
+
return True
|
|
308
339
|
|
|
309
340
|
def _is_connection_error(self, exception: Exception) -> bool:
|
|
310
341
|
"""Determine if an exception indicates a connection problem."""
|
|
@@ -312,7 +343,8 @@ class MCPTool:
|
|
|
312
343
|
connection_indicators = [
|
|
313
344
|
"connection lost", "connection closed", "connection refused",
|
|
314
345
|
"broken pipe", "timeout", "eof", "pipe closed", "process died",
|
|
315
|
-
"no route to host", "no server found"
|
|
346
|
+
"no route to host", "no server found", "transport not initialized",
|
|
347
|
+
"stream manager unavailable"
|
|
316
348
|
]
|
|
317
349
|
return any(indicator in error_str for indicator in connection_indicators)
|
|
318
350
|
|