crackerjack 0.31.10__py3-none-any.whl → 0.31.13__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.
Potentially problematic release.
This version of crackerjack might be problematic. Click here for more details.
- crackerjack/CLAUDE.md +288 -705
- crackerjack/__main__.py +22 -8
- crackerjack/agents/__init__.py +0 -3
- crackerjack/agents/architect_agent.py +0 -43
- crackerjack/agents/base.py +1 -9
- crackerjack/agents/coordinator.py +2 -148
- crackerjack/agents/documentation_agent.py +109 -81
- crackerjack/agents/dry_agent.py +122 -97
- crackerjack/agents/formatting_agent.py +3 -16
- crackerjack/agents/import_optimization_agent.py +1174 -130
- crackerjack/agents/performance_agent.py +956 -188
- crackerjack/agents/performance_helpers.py +229 -0
- crackerjack/agents/proactive_agent.py +1 -48
- crackerjack/agents/refactoring_agent.py +516 -246
- crackerjack/agents/refactoring_helpers.py +282 -0
- crackerjack/agents/security_agent.py +393 -90
- crackerjack/agents/test_creation_agent.py +1776 -120
- crackerjack/agents/test_specialist_agent.py +59 -15
- crackerjack/agents/tracker.py +0 -102
- crackerjack/api.py +145 -37
- crackerjack/cli/handlers.py +48 -30
- crackerjack/cli/interactive.py +11 -11
- crackerjack/cli/options.py +66 -4
- crackerjack/code_cleaner.py +808 -148
- crackerjack/config/global_lock_config.py +110 -0
- crackerjack/config/hooks.py +43 -64
- crackerjack/core/async_workflow_orchestrator.py +247 -97
- crackerjack/core/autofix_coordinator.py +192 -109
- crackerjack/core/enhanced_container.py +46 -63
- crackerjack/core/file_lifecycle.py +549 -0
- crackerjack/core/performance.py +9 -8
- crackerjack/core/performance_monitor.py +395 -0
- crackerjack/core/phase_coordinator.py +281 -94
- crackerjack/core/proactive_workflow.py +9 -58
- crackerjack/core/resource_manager.py +501 -0
- crackerjack/core/service_watchdog.py +490 -0
- crackerjack/core/session_coordinator.py +4 -8
- crackerjack/core/timeout_manager.py +504 -0
- crackerjack/core/websocket_lifecycle.py +475 -0
- crackerjack/core/workflow_orchestrator.py +343 -209
- crackerjack/dynamic_config.py +50 -9
- crackerjack/errors.py +3 -4
- crackerjack/executors/async_hook_executor.py +63 -13
- crackerjack/executors/cached_hook_executor.py +14 -14
- crackerjack/executors/hook_executor.py +100 -37
- crackerjack/executors/hook_lock_manager.py +856 -0
- crackerjack/executors/individual_hook_executor.py +120 -86
- crackerjack/intelligence/__init__.py +0 -7
- crackerjack/intelligence/adaptive_learning.py +13 -86
- crackerjack/intelligence/agent_orchestrator.py +15 -78
- crackerjack/intelligence/agent_registry.py +12 -59
- crackerjack/intelligence/agent_selector.py +31 -92
- crackerjack/intelligence/integration.py +1 -41
- crackerjack/interactive.py +9 -9
- crackerjack/managers/async_hook_manager.py +25 -8
- crackerjack/managers/hook_manager.py +9 -9
- crackerjack/managers/publish_manager.py +57 -59
- crackerjack/managers/test_command_builder.py +6 -36
- crackerjack/managers/test_executor.py +9 -61
- crackerjack/managers/test_manager.py +17 -63
- crackerjack/managers/test_manager_backup.py +77 -127
- crackerjack/managers/test_progress.py +4 -23
- crackerjack/mcp/cache.py +5 -12
- crackerjack/mcp/client_runner.py +10 -10
- crackerjack/mcp/context.py +64 -6
- crackerjack/mcp/dashboard.py +14 -11
- crackerjack/mcp/enhanced_progress_monitor.py +55 -55
- crackerjack/mcp/file_monitor.py +72 -42
- crackerjack/mcp/progress_components.py +103 -84
- crackerjack/mcp/progress_monitor.py +122 -49
- crackerjack/mcp/rate_limiter.py +12 -12
- crackerjack/mcp/server_core.py +16 -22
- crackerjack/mcp/service_watchdog.py +26 -26
- crackerjack/mcp/state.py +15 -0
- crackerjack/mcp/tools/core_tools.py +95 -39
- crackerjack/mcp/tools/error_analyzer.py +6 -32
- crackerjack/mcp/tools/execution_tools.py +1 -56
- crackerjack/mcp/tools/execution_tools_backup.py +35 -131
- crackerjack/mcp/tools/intelligence_tool_registry.py +0 -36
- crackerjack/mcp/tools/intelligence_tools.py +2 -55
- crackerjack/mcp/tools/monitoring_tools.py +308 -145
- crackerjack/mcp/tools/proactive_tools.py +12 -42
- crackerjack/mcp/tools/progress_tools.py +23 -15
- crackerjack/mcp/tools/utility_tools.py +3 -40
- crackerjack/mcp/tools/workflow_executor.py +40 -60
- crackerjack/mcp/websocket/app.py +0 -3
- crackerjack/mcp/websocket/endpoints.py +206 -268
- crackerjack/mcp/websocket/jobs.py +213 -66
- crackerjack/mcp/websocket/server.py +84 -6
- crackerjack/mcp/websocket/websocket_handler.py +137 -29
- crackerjack/models/config_adapter.py +3 -16
- crackerjack/models/protocols.py +162 -3
- crackerjack/models/resource_protocols.py +454 -0
- crackerjack/models/task.py +3 -3
- crackerjack/monitoring/__init__.py +0 -0
- crackerjack/monitoring/ai_agent_watchdog.py +25 -71
- crackerjack/monitoring/regression_prevention.py +28 -87
- crackerjack/orchestration/advanced_orchestrator.py +44 -78
- crackerjack/orchestration/coverage_improvement.py +10 -60
- crackerjack/orchestration/execution_strategies.py +16 -16
- crackerjack/orchestration/test_progress_streamer.py +61 -53
- crackerjack/plugins/base.py +1 -1
- crackerjack/plugins/managers.py +22 -20
- crackerjack/py313.py +65 -21
- crackerjack/services/backup_service.py +467 -0
- crackerjack/services/bounded_status_operations.py +627 -0
- crackerjack/services/cache.py +7 -9
- crackerjack/services/config.py +35 -52
- crackerjack/services/config_integrity.py +5 -16
- crackerjack/services/config_merge.py +542 -0
- crackerjack/services/contextual_ai_assistant.py +17 -19
- crackerjack/services/coverage_ratchet.py +44 -73
- crackerjack/services/debug.py +25 -39
- crackerjack/services/dependency_monitor.py +52 -50
- crackerjack/services/enhanced_filesystem.py +14 -11
- crackerjack/services/file_hasher.py +1 -1
- crackerjack/services/filesystem.py +1 -12
- crackerjack/services/git.py +71 -47
- crackerjack/services/health_metrics.py +31 -27
- crackerjack/services/initialization.py +276 -428
- crackerjack/services/input_validator.py +760 -0
- crackerjack/services/log_manager.py +16 -16
- crackerjack/services/logging.py +7 -6
- crackerjack/services/metrics.py +43 -43
- crackerjack/services/pattern_cache.py +2 -31
- crackerjack/services/pattern_detector.py +26 -63
- crackerjack/services/performance_benchmarks.py +20 -45
- crackerjack/services/regex_patterns.py +2887 -0
- crackerjack/services/regex_utils.py +537 -0
- crackerjack/services/secure_path_utils.py +683 -0
- crackerjack/services/secure_status_formatter.py +534 -0
- crackerjack/services/secure_subprocess.py +605 -0
- crackerjack/services/security.py +47 -10
- crackerjack/services/security_logger.py +492 -0
- crackerjack/services/server_manager.py +109 -50
- crackerjack/services/smart_scheduling.py +8 -25
- crackerjack/services/status_authentication.py +603 -0
- crackerjack/services/status_security_manager.py +442 -0
- crackerjack/services/thread_safe_status_collector.py +546 -0
- crackerjack/services/tool_version_service.py +1 -23
- crackerjack/services/unified_config.py +36 -58
- crackerjack/services/validation_rate_limiter.py +269 -0
- crackerjack/services/version_checker.py +9 -40
- crackerjack/services/websocket_resource_limiter.py +572 -0
- crackerjack/slash_commands/__init__.py +52 -2
- crackerjack/tools/__init__.py +0 -0
- crackerjack/tools/validate_input_validator_patterns.py +262 -0
- crackerjack/tools/validate_regex_patterns.py +198 -0
- {crackerjack-0.31.10.dist-info → crackerjack-0.31.13.dist-info}/METADATA +197 -12
- crackerjack-0.31.13.dist-info/RECORD +178 -0
- crackerjack/cli/facade.py +0 -104
- crackerjack-0.31.10.dist-info/RECORD +0 -149
- {crackerjack-0.31.10.dist-info → crackerjack-0.31.13.dist-info}/WHEEL +0 -0
- {crackerjack-0.31.10.dist-info → crackerjack-0.31.13.dist-info}/entry_points.txt +0 -0
- {crackerjack-0.31.10.dist-info → crackerjack-0.31.13.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"""Intelligence tool registry for MCP server."""
|
|
2
|
-
|
|
3
1
|
from .intelligence_tools import (
|
|
4
2
|
analyze_agent_performance,
|
|
5
3
|
execute_smart_agent_task,
|
|
@@ -9,8 +7,6 @@ from .intelligence_tools import (
|
|
|
9
7
|
|
|
10
8
|
|
|
11
9
|
def register_intelligence_tools(mcp_app) -> None:
|
|
12
|
-
"""Register intelligence system tools with the MCP server."""
|
|
13
|
-
|
|
14
10
|
@mcp_app.tool()
|
|
15
11
|
async def execute_smart_task(
|
|
16
12
|
task_description: str,
|
|
@@ -19,18 +15,6 @@ def register_intelligence_tools(mcp_app) -> None:
|
|
|
19
15
|
max_agents: int = 3,
|
|
20
16
|
use_learning: bool = True,
|
|
21
17
|
):
|
|
22
|
-
"""Execute a task using intelligent agent selection.
|
|
23
|
-
|
|
24
|
-
Args:
|
|
25
|
-
task_description: Description of the task to execute
|
|
26
|
-
context_type: Type of task context (architecture, refactoring, testing, etc.)
|
|
27
|
-
strategy: Execution strategy (single_best, parallel, sequential, consensus)
|
|
28
|
-
max_agents: Maximum number of agents to consider
|
|
29
|
-
use_learning: Whether to apply adaptive learning
|
|
30
|
-
|
|
31
|
-
Returns:
|
|
32
|
-
Dictionary with execution results and metadata
|
|
33
|
-
"""
|
|
34
18
|
return await execute_smart_agent_task(
|
|
35
19
|
task_description,
|
|
36
20
|
context_type,
|
|
@@ -45,16 +29,6 @@ def register_intelligence_tools(mcp_app) -> None:
|
|
|
45
29
|
context_type: str = "general",
|
|
46
30
|
include_analysis: bool = True,
|
|
47
31
|
):
|
|
48
|
-
"""Get intelligent agent recommendation for a task without executing it.
|
|
49
|
-
|
|
50
|
-
Args:
|
|
51
|
-
task_description: Description of the task
|
|
52
|
-
context_type: Type of task context
|
|
53
|
-
include_analysis: Whether to include complexity analysis
|
|
54
|
-
|
|
55
|
-
Returns:
|
|
56
|
-
Dictionary with recommendation details
|
|
57
|
-
"""
|
|
58
32
|
return await get_smart_agent_recommendation(
|
|
59
33
|
task_description,
|
|
60
34
|
context_type,
|
|
@@ -63,18 +37,8 @@ def register_intelligence_tools(mcp_app) -> None:
|
|
|
63
37
|
|
|
64
38
|
@mcp_app.tool()
|
|
65
39
|
async def intelligence_system_status():
|
|
66
|
-
"""Get comprehensive status of the intelligent agent system.
|
|
67
|
-
|
|
68
|
-
Returns:
|
|
69
|
-
Dictionary with system status and statistics
|
|
70
|
-
"""
|
|
71
40
|
return await get_intelligence_system_status()
|
|
72
41
|
|
|
73
42
|
@mcp_app.tool()
|
|
74
43
|
async def agent_performance_analysis():
|
|
75
|
-
"""Analyze agent performance and learning insights.
|
|
76
|
-
|
|
77
|
-
Returns:
|
|
78
|
-
Dictionary with performance analysis and insights
|
|
79
|
-
"""
|
|
80
44
|
return await analyze_agent_performance()
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"""MCP tools for the Intelligent Agent Selection System."""
|
|
2
|
-
|
|
3
1
|
import asyncio
|
|
4
2
|
import logging
|
|
5
3
|
import typing as t
|
|
@@ -16,23 +14,10 @@ async def execute_smart_agent_task(
|
|
|
16
14
|
max_agents: int = 3,
|
|
17
15
|
use_learning: bool = True,
|
|
18
16
|
) -> dict[str, t.Any]:
|
|
19
|
-
"""Execute a task using intelligent agent selection.
|
|
20
|
-
|
|
21
|
-
Args:
|
|
22
|
-
task_description: Description of the task to execute
|
|
23
|
-
context_type: Type of task context (architecture, refactoring, testing, etc.)
|
|
24
|
-
strategy: Execution strategy (single_best, parallel, sequential, consensus)
|
|
25
|
-
max_agents: Maximum number of agents to consider
|
|
26
|
-
use_learning: Whether to apply adaptive learning
|
|
27
|
-
|
|
28
|
-
Returns:
|
|
29
|
-
Dictionary with execution results and metadata
|
|
30
|
-
"""
|
|
31
17
|
get_context()
|
|
32
18
|
logger = logging.getLogger(__name__)
|
|
33
19
|
|
|
34
20
|
try:
|
|
35
|
-
# Parse context type
|
|
36
21
|
task_context = None
|
|
37
22
|
context_map = {
|
|
38
23
|
"architecture": TaskContext.ARCHITECTURE,
|
|
@@ -50,7 +35,6 @@ async def execute_smart_agent_task(
|
|
|
50
35
|
if context_type.lower() in context_map:
|
|
51
36
|
task_context = context_map[context_type.lower()]
|
|
52
37
|
|
|
53
|
-
# Parse strategy
|
|
54
38
|
strategy_map = {
|
|
55
39
|
"single_best": ExecutionStrategy.SINGLE_BEST,
|
|
56
40
|
"parallel": ExecutionStrategy.PARALLEL,
|
|
@@ -62,7 +46,6 @@ async def execute_smart_agent_task(
|
|
|
62
46
|
strategy.lower(), ExecutionStrategy.SINGLE_BEST
|
|
63
47
|
)
|
|
64
48
|
|
|
65
|
-
# Get intelligent agent system
|
|
66
49
|
system = await get_intelligent_agent_system()
|
|
67
50
|
|
|
68
51
|
logger.info(
|
|
@@ -70,14 +53,12 @@ async def execute_smart_agent_task(
|
|
|
70
53
|
f"(context: {context_type}, strategy: {strategy})"
|
|
71
54
|
)
|
|
72
55
|
|
|
73
|
-
# Execute task
|
|
74
56
|
result = await system.execute_smart_task(
|
|
75
57
|
description=task_description,
|
|
76
58
|
context=task_context,
|
|
77
59
|
strategy=execution_strategy,
|
|
78
60
|
)
|
|
79
61
|
|
|
80
|
-
# Prepare response
|
|
81
62
|
response = {
|
|
82
63
|
"success": result.success,
|
|
83
64
|
"agents_used": result.agents_used,
|
|
@@ -90,12 +71,9 @@ async def execute_smart_agent_task(
|
|
|
90
71
|
"strategy_used": strategy,
|
|
91
72
|
}
|
|
92
73
|
|
|
93
|
-
# Add result based on type
|
|
94
74
|
if hasattr(result.result, "__dict__"):
|
|
95
|
-
# Complex object - convert to dict
|
|
96
75
|
try:
|
|
97
76
|
if hasattr(result.result, "success"):
|
|
98
|
-
# Looks like FixResult
|
|
99
77
|
response["fix_result"] = {
|
|
100
78
|
"success": getattr(result.result, "success", False),
|
|
101
79
|
"confidence": getattr(result.result, "confidence", 0.0),
|
|
@@ -118,7 +96,7 @@ async def execute_smart_agent_task(
|
|
|
118
96
|
if result.success:
|
|
119
97
|
logger.info(
|
|
120
98
|
f"Smart task completed successfully using {len(result.agents_used)} agents "
|
|
121
|
-
f"in {result.execution_time
|
|
99
|
+
f"in {result.execution_time: .2f}s"
|
|
122
100
|
)
|
|
123
101
|
else:
|
|
124
102
|
logger.warning(f"Smart task failed: {result.recommendations}")
|
|
@@ -141,20 +119,9 @@ async def get_smart_agent_recommendation(
|
|
|
141
119
|
context_type: str = "general",
|
|
142
120
|
include_analysis: bool = True,
|
|
143
121
|
) -> dict[str, t.Any]:
|
|
144
|
-
"""Get agent recommendation for a task without executing it.
|
|
145
|
-
|
|
146
|
-
Args:
|
|
147
|
-
task_description: Description of the task
|
|
148
|
-
context_type: Type of task context
|
|
149
|
-
include_analysis: Whether to include complexity analysis
|
|
150
|
-
|
|
151
|
-
Returns:
|
|
152
|
-
Dictionary with recommendation details
|
|
153
|
-
"""
|
|
154
122
|
logger = logging.getLogger(__name__)
|
|
155
123
|
|
|
156
124
|
try:
|
|
157
|
-
# Parse context type
|
|
158
125
|
task_context = None
|
|
159
126
|
context_map = {
|
|
160
127
|
"architecture": TaskContext.ARCHITECTURE,
|
|
@@ -172,10 +139,8 @@ async def get_smart_agent_recommendation(
|
|
|
172
139
|
if context_type.lower() in context_map:
|
|
173
140
|
task_context = context_map[context_type.lower()]
|
|
174
141
|
|
|
175
|
-
# Get intelligent agent system
|
|
176
142
|
system = await get_intelligent_agent_system()
|
|
177
143
|
|
|
178
|
-
# Get recommendation
|
|
179
144
|
recommendation = await system.get_best_agent_for_task(
|
|
180
145
|
description=task_description,
|
|
181
146
|
context=task_context,
|
|
@@ -205,7 +170,6 @@ async def get_smart_agent_recommendation(
|
|
|
205
170
|
}
|
|
206
171
|
)
|
|
207
172
|
|
|
208
|
-
# Add complexity analysis if requested
|
|
209
173
|
if include_analysis:
|
|
210
174
|
try:
|
|
211
175
|
analysis = await system.analyze_task_complexity(task_description)
|
|
@@ -228,18 +192,12 @@ async def get_smart_agent_recommendation(
|
|
|
228
192
|
|
|
229
193
|
|
|
230
194
|
async def get_intelligence_system_status() -> dict[str, t.Any]:
|
|
231
|
-
"""Get comprehensive status of the intelligent agent system.
|
|
232
|
-
|
|
233
|
-
Returns:
|
|
234
|
-
Dictionary with system status and statistics
|
|
235
|
-
"""
|
|
236
195
|
logger = logging.getLogger(__name__)
|
|
237
196
|
|
|
238
197
|
try:
|
|
239
198
|
system = await get_intelligent_agent_system()
|
|
240
199
|
status = await system.get_system_status()
|
|
241
200
|
|
|
242
|
-
# Add additional runtime information
|
|
243
201
|
status["runtime_info"] = {
|
|
244
202
|
"system_initialized": system._initialized,
|
|
245
203
|
"components_loaded": {
|
|
@@ -261,24 +219,16 @@ async def get_intelligence_system_status() -> dict[str, t.Any]:
|
|
|
261
219
|
|
|
262
220
|
|
|
263
221
|
async def analyze_agent_performance() -> dict[str, t.Any]:
|
|
264
|
-
"""Analyze agent performance and learning insights.
|
|
265
|
-
|
|
266
|
-
Returns:
|
|
267
|
-
Dictionary with performance analysis and insights
|
|
268
|
-
"""
|
|
269
222
|
logger = logging.getLogger(__name__)
|
|
270
223
|
|
|
271
224
|
try:
|
|
272
225
|
system = await get_intelligent_agent_system()
|
|
273
226
|
await system.initialize()
|
|
274
227
|
|
|
275
|
-
# Get learning summary
|
|
276
228
|
learning_summary = system.learning_system.get_learning_summary()
|
|
277
229
|
|
|
278
|
-
# Get orchestrator stats
|
|
279
230
|
orchestration_stats = system.orchestrator.get_execution_stats()
|
|
280
231
|
|
|
281
|
-
# Get agent capabilities overview
|
|
282
232
|
registry_stats = system.registry.get_agent_stats()
|
|
283
233
|
|
|
284
234
|
performance_analysis = {
|
|
@@ -288,7 +238,6 @@ async def analyze_agent_performance() -> dict[str, t.Any]:
|
|
|
288
238
|
"analysis_timestamp": asyncio.get_event_loop().time(),
|
|
289
239
|
}
|
|
290
240
|
|
|
291
|
-
# Add insights if available
|
|
292
241
|
if hasattr(system.learning_system, "_learning_insights"):
|
|
293
242
|
recent_insights = [
|
|
294
243
|
{
|
|
@@ -297,9 +246,7 @@ async def analyze_agent_performance() -> dict[str, t.Any]:
|
|
|
297
246
|
"confidence": insight.confidence,
|
|
298
247
|
"description": insight.description,
|
|
299
248
|
}
|
|
300
|
-
for insight in system.learning_system._learning_insights[
|
|
301
|
-
-10:
|
|
302
|
-
] # Last 10 insights
|
|
249
|
+
for insight in system.learning_system._learning_insights[-10:]
|
|
303
250
|
]
|
|
304
251
|
performance_analysis["recent_insights"] = recent_insights
|
|
305
252
|
|