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,15 +1,3 @@
|
|
|
1
|
-
"""Refactored MCP execution tools with focused responsibilities.
|
|
2
|
-
|
|
3
|
-
This module provides the main MCP tool registration and high-level coordination.
|
|
4
|
-
Implementation details are delegated to specialized modules:
|
|
5
|
-
- workflow_executor.py: Core workflow execution logic
|
|
6
|
-
- error_analyzer.py: Error analysis and pattern detection
|
|
7
|
-
- (Additional initialization and suggestion modules as needed)
|
|
8
|
-
|
|
9
|
-
REFACTORING NOTE: Original execution_tools.py was 1110 lines with 30+ functions.
|
|
10
|
-
This refactored version is ~300 lines and delegates to focused modules.
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
1
|
import json
|
|
14
2
|
import typing as t
|
|
15
3
|
|
|
@@ -20,7 +8,6 @@ from .workflow_executor import execute_crackerjack_workflow
|
|
|
20
8
|
|
|
21
9
|
|
|
22
10
|
def register_execution_tools(mcp_app: t.Any) -> None:
|
|
23
|
-
"""Register all execution-related MCP tools."""
|
|
24
11
|
_register_execute_crackerjack_tool(mcp_app)
|
|
25
12
|
_register_smart_error_analysis_tool(mcp_app)
|
|
26
13
|
_register_init_crackerjack_tool(mcp_app)
|
|
@@ -28,26 +15,20 @@ def register_execution_tools(mcp_app: t.Any) -> None:
|
|
|
28
15
|
|
|
29
16
|
|
|
30
17
|
def _register_execute_crackerjack_tool(mcp_app: t.Any) -> None:
|
|
31
|
-
"""Register the main crackerjack execution tool."""
|
|
32
|
-
|
|
33
18
|
@mcp_app.tool()
|
|
34
19
|
async def execute_crackerjack(args: str, kwargs: str) -> str:
|
|
35
|
-
"""Execute crackerjack workflow with AI agent auto-fixing."""
|
|
36
20
|
context = get_context()
|
|
37
21
|
|
|
38
|
-
# Validate context and rate limits
|
|
39
22
|
validation_error = await _validate_context_and_rate_limit(context)
|
|
40
23
|
if validation_error:
|
|
41
24
|
return validation_error
|
|
42
25
|
|
|
43
|
-
# Parse arguments
|
|
44
26
|
kwargs_result = _parse_kwargs(kwargs)
|
|
45
27
|
if "error" in kwargs_result:
|
|
46
28
|
return json.dumps(kwargs_result)
|
|
47
29
|
|
|
48
30
|
extra_kwargs = kwargs_result["kwargs"]
|
|
49
31
|
|
|
50
|
-
# Execute workflow
|
|
51
32
|
try:
|
|
52
33
|
result = await execute_crackerjack_workflow(args, extra_kwargs)
|
|
53
34
|
return json.dumps(result, indent=2)
|
|
@@ -64,11 +45,8 @@ def _register_execute_crackerjack_tool(mcp_app: t.Any) -> None:
|
|
|
64
45
|
|
|
65
46
|
|
|
66
47
|
def _register_smart_error_analysis_tool(mcp_app: t.Any) -> None:
|
|
67
|
-
"""Register the smart error analysis tool."""
|
|
68
|
-
|
|
69
48
|
@mcp_app.tool()
|
|
70
49
|
async def smart_error_analysis(use_cache: bool = True) -> str:
|
|
71
|
-
"""Analyze cached error patterns and provide intelligent recommendations."""
|
|
72
50
|
context = get_context()
|
|
73
51
|
|
|
74
52
|
try:
|
|
@@ -85,11 +63,8 @@ def _register_smart_error_analysis_tool(mcp_app: t.Any) -> None:
|
|
|
85
63
|
|
|
86
64
|
|
|
87
65
|
def _register_init_crackerjack_tool(mcp_app: t.Any) -> None:
|
|
88
|
-
"""Register the crackerjack initialization tool."""
|
|
89
|
-
|
|
90
66
|
@mcp_app.tool()
|
|
91
67
|
def init_crackerjack(args: str = "", kwargs: str = "{}") -> str:
|
|
92
|
-
"""Initialize or update crackerjack configuration in current project."""
|
|
93
68
|
try:
|
|
94
69
|
target_path, force, error = _parse_init_arguments(args, kwargs)
|
|
95
70
|
if error:
|
|
@@ -103,15 +78,12 @@ def _register_init_crackerjack_tool(mcp_app: t.Any) -> None:
|
|
|
103
78
|
|
|
104
79
|
|
|
105
80
|
def _register_agent_suggestions_tool(mcp_app: t.Any) -> None:
|
|
106
|
-
"""Register the agent suggestions tool."""
|
|
107
|
-
|
|
108
81
|
@mcp_app.tool()
|
|
109
82
|
def suggest_agents(
|
|
110
83
|
task_description: str = "",
|
|
111
84
|
project_type: str = "python",
|
|
112
85
|
current_context: str = "",
|
|
113
86
|
) -> str:
|
|
114
|
-
"""Suggest appropriate Claude Code agents based on task and context."""
|
|
115
87
|
try:
|
|
116
88
|
recommendations = _generate_agent_recommendations(
|
|
117
89
|
task_description, project_type, current_context
|
|
@@ -127,15 +99,10 @@ def _register_agent_suggestions_tool(mcp_app: t.Any) -> None:
|
|
|
127
99
|
)
|
|
128
100
|
|
|
129
101
|
|
|
130
|
-
# Helper functions for argument parsing and validation
|
|
131
|
-
|
|
132
|
-
|
|
133
102
|
async def _validate_context_and_rate_limit(context: t.Any) -> str | None:
|
|
134
|
-
"""Validate MCP context and check rate limits."""
|
|
135
103
|
if not context:
|
|
136
104
|
return json.dumps({"status": "error", "message": "MCP context not available"})
|
|
137
105
|
|
|
138
|
-
# Check rate limits if available
|
|
139
106
|
if hasattr(context, "rate_limiter"):
|
|
140
107
|
from contextlib import suppress
|
|
141
108
|
|
|
@@ -155,18 +122,13 @@ async def _validate_context_and_rate_limit(context: t.Any) -> str | None:
|
|
|
155
122
|
|
|
156
123
|
|
|
157
124
|
def _parse_kwargs(kwargs: str) -> dict[str, t.Any]:
|
|
158
|
-
"""Parse and validate kwargs string."""
|
|
159
125
|
try:
|
|
160
126
|
return {"kwargs": json.loads(kwargs) if kwargs.strip() else {}}
|
|
161
127
|
except json.JSONDecodeError as e:
|
|
162
128
|
return {"error": f"Invalid JSON in kwargs: {e}"}
|
|
163
129
|
|
|
164
130
|
|
|
165
|
-
# Initialization helper functions
|
|
166
|
-
|
|
167
|
-
|
|
168
131
|
def _parse_init_arguments(args: str, kwargs: str) -> tuple[t.Any, bool, str | None]:
|
|
169
|
-
"""Parse and validate initialization arguments."""
|
|
170
132
|
try:
|
|
171
133
|
target_path = args.strip() or "."
|
|
172
134
|
kwargs_dict = json.loads(kwargs) if kwargs.strip() else {}
|
|
@@ -185,7 +147,6 @@ def _parse_init_arguments(args: str, kwargs: str) -> tuple[t.Any, bool, str | No
|
|
|
185
147
|
|
|
186
148
|
|
|
187
149
|
def _execute_initialization(target_path: t.Any, force: bool) -> dict[str, t.Any]:
|
|
188
|
-
"""Execute crackerjack initialization."""
|
|
189
150
|
from rich.console import Console
|
|
190
151
|
|
|
191
152
|
from crackerjack.services.initialization import InitializationService
|
|
@@ -198,7 +159,6 @@ def _execute_initialization(target_path: t.Any, force: bool) -> dict[str, t.Any]
|
|
|
198
159
|
|
|
199
160
|
|
|
200
161
|
def _create_init_error_response(message: str) -> str:
|
|
201
|
-
"""Create initialization error response."""
|
|
202
162
|
return json.dumps(
|
|
203
163
|
{
|
|
204
164
|
"status": "error",
|
|
@@ -209,7 +169,6 @@ def _create_init_error_response(message: str) -> str:
|
|
|
209
169
|
|
|
210
170
|
|
|
211
171
|
def _create_init_success_response(result: dict[str, t.Any]) -> str:
|
|
212
|
-
"""Create initialization success response."""
|
|
213
172
|
return json.dumps(
|
|
214
173
|
{
|
|
215
174
|
"status": "success",
|
|
@@ -222,7 +181,6 @@ def _create_init_success_response(result: dict[str, t.Any]) -> str:
|
|
|
222
181
|
|
|
223
182
|
|
|
224
183
|
def _create_init_exception_response(error: Exception, target_path: t.Any) -> str:
|
|
225
|
-
"""Create initialization exception response."""
|
|
226
184
|
return json.dumps(
|
|
227
185
|
{
|
|
228
186
|
"status": "error",
|
|
@@ -233,13 +191,9 @@ def _create_init_exception_response(error: Exception, target_path: t.Any) -> str
|
|
|
233
191
|
)
|
|
234
192
|
|
|
235
193
|
|
|
236
|
-
# Agent suggestion helper functions
|
|
237
|
-
|
|
238
|
-
|
|
239
194
|
def _generate_agent_recommendations(
|
|
240
195
|
task_description: str, project_type: str, current_context: str
|
|
241
196
|
) -> dict[str, t.Any]:
|
|
242
|
-
"""Generate agent recommendations based on task context."""
|
|
243
197
|
recommendations = {
|
|
244
198
|
"status": "success",
|
|
245
199
|
"task_analysis": {
|
|
@@ -252,7 +206,6 @@ def _generate_agent_recommendations(
|
|
|
252
206
|
"reasoning": "",
|
|
253
207
|
}
|
|
254
208
|
|
|
255
|
-
# Analyze task and context
|
|
256
209
|
suggestions = _analyze_task_for_agents(
|
|
257
210
|
task_description, project_type, current_context
|
|
258
211
|
)
|
|
@@ -266,7 +219,6 @@ def _generate_agent_recommendations(
|
|
|
266
219
|
def _analyze_task_for_agents(
|
|
267
220
|
task_description: str, project_type: str, current_context: str
|
|
268
221
|
) -> dict[str, t.Any]:
|
|
269
|
-
"""Analyze task description to determine appropriate agents."""
|
|
270
222
|
agents = []
|
|
271
223
|
workflows = []
|
|
272
224
|
reasoning_parts = []
|
|
@@ -274,7 +226,6 @@ def _analyze_task_for_agents(
|
|
|
274
226
|
task_lower = task_description.lower()
|
|
275
227
|
current_context.lower()
|
|
276
228
|
|
|
277
|
-
# Code quality and testing agents
|
|
278
229
|
if any(keyword in task_lower for keyword in ("test", "quality", "fix", "error")):
|
|
279
230
|
agents.extend(
|
|
280
231
|
[
|
|
@@ -292,7 +243,6 @@ def _analyze_task_for_agents(
|
|
|
292
243
|
)
|
|
293
244
|
reasoning_parts.append("Task involves testing or quality improvement")
|
|
294
245
|
|
|
295
|
-
# Security-related tasks
|
|
296
246
|
if any(
|
|
297
247
|
keyword in task_lower for keyword in ("security", "vulnerability", "secure")
|
|
298
248
|
):
|
|
@@ -305,7 +255,6 @@ def _analyze_task_for_agents(
|
|
|
305
255
|
)
|
|
306
256
|
reasoning_parts.append("Security concerns detected")
|
|
307
257
|
|
|
308
|
-
# Performance optimization
|
|
309
258
|
if any(
|
|
310
259
|
keyword in task_lower
|
|
311
260
|
for keyword in ("performance", "optimize", "speed", "slow")
|
|
@@ -319,7 +268,6 @@ def _analyze_task_for_agents(
|
|
|
319
268
|
)
|
|
320
269
|
reasoning_parts.append("Performance optimization required")
|
|
321
270
|
|
|
322
|
-
# Documentation tasks
|
|
323
271
|
if any(
|
|
324
272
|
keyword in task_lower for keyword in ("document", "readme", "doc", "explain")
|
|
325
273
|
):
|
|
@@ -332,7 +280,6 @@ def _analyze_task_for_agents(
|
|
|
332
280
|
)
|
|
333
281
|
reasoning_parts.append("Documentation work identified")
|
|
334
282
|
|
|
335
|
-
# Import and dependency management
|
|
336
283
|
if any(
|
|
337
284
|
keyword in task_lower
|
|
338
285
|
for keyword in ("import", "dependency", "package", "module")
|
|
@@ -344,9 +291,8 @@ def _analyze_task_for_agents(
|
|
|
344
291
|
"confidence": 0.7,
|
|
345
292
|
}
|
|
346
293
|
)
|
|
347
|
-
reasoning_parts.append("Import/dependency work detected")
|
|
294
|
+
reasoning_parts.append("Import / dependency work detected")
|
|
348
295
|
|
|
349
|
-
# Project type specific suggestions
|
|
350
296
|
if project_type == "python":
|
|
351
297
|
workflows.extend(
|
|
352
298
|
[
|
|
@@ -356,7 +302,6 @@ def _analyze_task_for_agents(
|
|
|
356
302
|
]
|
|
357
303
|
)
|
|
358
304
|
|
|
359
|
-
# Default fallback
|
|
360
305
|
if not agents:
|
|
361
306
|
agents.append(
|
|
362
307
|
{
|