crackerjack 0.29.0__py3-none-any.whl → 0.31.4__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 +1005 -0
- crackerjack/RULES.md +380 -0
- crackerjack/__init__.py +42 -13
- crackerjack/__main__.py +225 -253
- crackerjack/agents/__init__.py +41 -0
- crackerjack/agents/architect_agent.py +281 -0
- crackerjack/agents/base.py +169 -0
- crackerjack/agents/coordinator.py +512 -0
- crackerjack/agents/documentation_agent.py +498 -0
- crackerjack/agents/dry_agent.py +388 -0
- crackerjack/agents/formatting_agent.py +245 -0
- crackerjack/agents/import_optimization_agent.py +281 -0
- crackerjack/agents/performance_agent.py +669 -0
- crackerjack/agents/proactive_agent.py +104 -0
- crackerjack/agents/refactoring_agent.py +788 -0
- crackerjack/agents/security_agent.py +529 -0
- crackerjack/agents/test_creation_agent.py +652 -0
- crackerjack/agents/test_specialist_agent.py +486 -0
- crackerjack/agents/tracker.py +212 -0
- crackerjack/api.py +560 -0
- crackerjack/cli/__init__.py +24 -0
- crackerjack/cli/facade.py +104 -0
- crackerjack/cli/handlers.py +267 -0
- crackerjack/cli/interactive.py +471 -0
- crackerjack/cli/options.py +401 -0
- crackerjack/cli/utils.py +18 -0
- crackerjack/code_cleaner.py +670 -0
- crackerjack/config/__init__.py +19 -0
- crackerjack/config/hooks.py +218 -0
- crackerjack/core/__init__.py +0 -0
- crackerjack/core/async_workflow_orchestrator.py +406 -0
- crackerjack/core/autofix_coordinator.py +200 -0
- crackerjack/core/container.py +104 -0
- crackerjack/core/enhanced_container.py +542 -0
- crackerjack/core/performance.py +243 -0
- crackerjack/core/phase_coordinator.py +561 -0
- crackerjack/core/proactive_workflow.py +316 -0
- crackerjack/core/session_coordinator.py +289 -0
- crackerjack/core/workflow_orchestrator.py +640 -0
- crackerjack/dynamic_config.py +577 -0
- crackerjack/errors.py +263 -41
- crackerjack/executors/__init__.py +11 -0
- crackerjack/executors/async_hook_executor.py +431 -0
- crackerjack/executors/cached_hook_executor.py +242 -0
- crackerjack/executors/hook_executor.py +345 -0
- crackerjack/executors/individual_hook_executor.py +669 -0
- crackerjack/intelligence/__init__.py +44 -0
- crackerjack/intelligence/adaptive_learning.py +751 -0
- crackerjack/intelligence/agent_orchestrator.py +551 -0
- crackerjack/intelligence/agent_registry.py +414 -0
- crackerjack/intelligence/agent_selector.py +502 -0
- crackerjack/intelligence/integration.py +290 -0
- crackerjack/interactive.py +576 -315
- crackerjack/managers/__init__.py +11 -0
- crackerjack/managers/async_hook_manager.py +135 -0
- crackerjack/managers/hook_manager.py +137 -0
- crackerjack/managers/publish_manager.py +411 -0
- crackerjack/managers/test_command_builder.py +151 -0
- crackerjack/managers/test_executor.py +435 -0
- crackerjack/managers/test_manager.py +258 -0
- crackerjack/managers/test_manager_backup.py +1124 -0
- crackerjack/managers/test_progress.py +144 -0
- crackerjack/mcp/__init__.py +0 -0
- crackerjack/mcp/cache.py +336 -0
- crackerjack/mcp/client_runner.py +104 -0
- crackerjack/mcp/context.py +615 -0
- crackerjack/mcp/dashboard.py +636 -0
- crackerjack/mcp/enhanced_progress_monitor.py +479 -0
- crackerjack/mcp/file_monitor.py +336 -0
- crackerjack/mcp/progress_components.py +569 -0
- crackerjack/mcp/progress_monitor.py +949 -0
- crackerjack/mcp/rate_limiter.py +332 -0
- crackerjack/mcp/server.py +22 -0
- crackerjack/mcp/server_core.py +244 -0
- crackerjack/mcp/service_watchdog.py +501 -0
- crackerjack/mcp/state.py +395 -0
- crackerjack/mcp/task_manager.py +257 -0
- crackerjack/mcp/tools/__init__.py +17 -0
- crackerjack/mcp/tools/core_tools.py +249 -0
- crackerjack/mcp/tools/error_analyzer.py +308 -0
- crackerjack/mcp/tools/execution_tools.py +370 -0
- crackerjack/mcp/tools/execution_tools_backup.py +1097 -0
- crackerjack/mcp/tools/intelligence_tool_registry.py +80 -0
- crackerjack/mcp/tools/intelligence_tools.py +314 -0
- crackerjack/mcp/tools/monitoring_tools.py +502 -0
- crackerjack/mcp/tools/proactive_tools.py +384 -0
- crackerjack/mcp/tools/progress_tools.py +141 -0
- crackerjack/mcp/tools/utility_tools.py +341 -0
- crackerjack/mcp/tools/workflow_executor.py +360 -0
- crackerjack/mcp/websocket/__init__.py +14 -0
- crackerjack/mcp/websocket/app.py +39 -0
- crackerjack/mcp/websocket/endpoints.py +559 -0
- crackerjack/mcp/websocket/jobs.py +253 -0
- crackerjack/mcp/websocket/server.py +116 -0
- crackerjack/mcp/websocket/websocket_handler.py +78 -0
- crackerjack/mcp/websocket_server.py +10 -0
- crackerjack/models/__init__.py +31 -0
- crackerjack/models/config.py +93 -0
- crackerjack/models/config_adapter.py +230 -0
- crackerjack/models/protocols.py +118 -0
- crackerjack/models/task.py +154 -0
- crackerjack/monitoring/ai_agent_watchdog.py +450 -0
- crackerjack/monitoring/regression_prevention.py +638 -0
- crackerjack/orchestration/__init__.py +0 -0
- crackerjack/orchestration/advanced_orchestrator.py +970 -0
- crackerjack/orchestration/execution_strategies.py +341 -0
- crackerjack/orchestration/test_progress_streamer.py +636 -0
- crackerjack/plugins/__init__.py +15 -0
- crackerjack/plugins/base.py +200 -0
- crackerjack/plugins/hooks.py +246 -0
- crackerjack/plugins/loader.py +335 -0
- crackerjack/plugins/managers.py +259 -0
- crackerjack/py313.py +8 -3
- crackerjack/services/__init__.py +22 -0
- crackerjack/services/cache.py +314 -0
- crackerjack/services/config.py +347 -0
- crackerjack/services/config_integrity.py +99 -0
- crackerjack/services/contextual_ai_assistant.py +516 -0
- crackerjack/services/coverage_ratchet.py +347 -0
- crackerjack/services/debug.py +736 -0
- crackerjack/services/dependency_monitor.py +617 -0
- crackerjack/services/enhanced_filesystem.py +439 -0
- crackerjack/services/file_hasher.py +151 -0
- crackerjack/services/filesystem.py +395 -0
- crackerjack/services/git.py +165 -0
- crackerjack/services/health_metrics.py +611 -0
- crackerjack/services/initialization.py +847 -0
- crackerjack/services/log_manager.py +286 -0
- crackerjack/services/logging.py +174 -0
- crackerjack/services/metrics.py +578 -0
- crackerjack/services/pattern_cache.py +362 -0
- crackerjack/services/pattern_detector.py +515 -0
- crackerjack/services/performance_benchmarks.py +653 -0
- crackerjack/services/security.py +163 -0
- crackerjack/services/server_manager.py +234 -0
- crackerjack/services/smart_scheduling.py +144 -0
- crackerjack/services/tool_version_service.py +61 -0
- crackerjack/services/unified_config.py +437 -0
- crackerjack/services/version_checker.py +248 -0
- crackerjack/slash_commands/__init__.py +14 -0
- crackerjack/slash_commands/init.md +122 -0
- crackerjack/slash_commands/run.md +163 -0
- crackerjack/slash_commands/status.md +127 -0
- crackerjack-0.31.4.dist-info/METADATA +742 -0
- crackerjack-0.31.4.dist-info/RECORD +148 -0
- crackerjack-0.31.4.dist-info/entry_points.txt +2 -0
- crackerjack/.gitignore +0 -34
- crackerjack/.libcst.codemod.yaml +0 -18
- crackerjack/.pdm.toml +0 -1
- crackerjack/.pre-commit-config-ai.yaml +0 -149
- crackerjack/.pre-commit-config-fast.yaml +0 -69
- crackerjack/.pre-commit-config.yaml +0 -114
- crackerjack/crackerjack.py +0 -4140
- crackerjack/pyproject.toml +0 -285
- crackerjack-0.29.0.dist-info/METADATA +0 -1289
- crackerjack-0.29.0.dist-info/RECORD +0 -17
- {crackerjack-0.29.0.dist-info → crackerjack-0.31.4.dist-info}/WHEEL +0 -0
- {crackerjack-0.29.0.dist-info → crackerjack-0.31.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from rich.console import Console
|
|
7
|
+
|
|
8
|
+
from .options import Options
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def setup_ai_agent_env(ai_agent: bool, verbose: bool = False) -> None:
|
|
12
|
+
if ai_agent:
|
|
13
|
+
os.environ["AI_AGENT"] = "1"
|
|
14
|
+
os.environ["AI_AGENT_DEBUG"] = "1"
|
|
15
|
+
|
|
16
|
+
if verbose:
|
|
17
|
+
os.environ["AI_AGENT_VERBOSE"] = "1"
|
|
18
|
+
|
|
19
|
+
if verbose:
|
|
20
|
+
console = Console()
|
|
21
|
+
console.print(
|
|
22
|
+
"[bold cyan]🐛 AI Agent Debug Mode Configuration: [/bold cyan]",
|
|
23
|
+
)
|
|
24
|
+
console.print(f" • AI Agent: {'✅ Enabled' if ai_agent else '❌ Disabled'}")
|
|
25
|
+
console.print(
|
|
26
|
+
f" • Debug Mode: {'✅ Enabled' if os.environ.get('AI_AGENT_DEBUG') == '1' else '❌ Disabled'}",
|
|
27
|
+
)
|
|
28
|
+
console.print(
|
|
29
|
+
f" • Verbose Mode: {'✅ Enabled' if os.environ.get('AI_AGENT_VERBOSE') == '1' else '❌ Disabled'}",
|
|
30
|
+
)
|
|
31
|
+
console.print(" • Enhanced logging will be available during execution")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def handle_mcp_server(websocket_port: int | None = None) -> None:
|
|
35
|
+
from crackerjack.mcp.server import main as start_mcp_main
|
|
36
|
+
|
|
37
|
+
# Always pass current working directory as project path
|
|
38
|
+
project_path = str(Path.cwd())
|
|
39
|
+
|
|
40
|
+
if websocket_port:
|
|
41
|
+
start_mcp_main(project_path, websocket_port)
|
|
42
|
+
else:
|
|
43
|
+
start_mcp_main(project_path)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def handle_monitor_mode(dev_mode: bool = False) -> None:
|
|
47
|
+
from crackerjack.mcp.progress_monitor import run_progress_monitor
|
|
48
|
+
|
|
49
|
+
console = Console()
|
|
50
|
+
console.print("[bold cyan]🌟 Starting Multi-Project Progress Monitor[/bold cyan]")
|
|
51
|
+
console.print(
|
|
52
|
+
"[bold yellow]🐕 With integrated Service Watchdog and WebSocket polling[/bold yellow]",
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
try:
|
|
56
|
+
asyncio.run(run_progress_monitor(dev_mode=dev_mode))
|
|
57
|
+
except KeyboardInterrupt:
|
|
58
|
+
console.print("\n[yellow]🛑 Monitor stopped[/yellow]")
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def handle_enhanced_monitor_mode(dev_mode: bool = False) -> None:
|
|
62
|
+
from crackerjack.mcp.enhanced_progress_monitor import run_enhanced_progress_monitor
|
|
63
|
+
|
|
64
|
+
console = Console()
|
|
65
|
+
console.print("[bold magenta]✨ Starting Enhanced Progress Monitor[/bold magenta]")
|
|
66
|
+
console.print(
|
|
67
|
+
"[bold cyan]📊 With advanced MetricCard widgets and modern web UI patterns[/bold cyan]",
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
try:
|
|
71
|
+
asyncio.run(run_enhanced_progress_monitor(dev_mode=dev_mode))
|
|
72
|
+
except KeyboardInterrupt:
|
|
73
|
+
console.print("\n[yellow]🛑 Enhanced Monitor stopped[/yellow]")
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def handle_dashboard_mode(dev_mode: bool = False) -> None:
|
|
77
|
+
from crackerjack.mcp.dashboard import run_dashboard
|
|
78
|
+
|
|
79
|
+
console = Console()
|
|
80
|
+
console.print("[bold green]🎯 Starting Comprehensive Dashboard[/bold green]")
|
|
81
|
+
console.print(
|
|
82
|
+
"[bold cyan]📈 With system metrics, job tracking, and performance monitoring[/bold cyan]",
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
try:
|
|
86
|
+
run_dashboard()
|
|
87
|
+
except KeyboardInterrupt:
|
|
88
|
+
console.print("\n[yellow]🛑 Dashboard stopped[/yellow]")
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def handle_watchdog_mode() -> None:
|
|
92
|
+
from crackerjack.mcp.service_watchdog import main as start_watchdog
|
|
93
|
+
|
|
94
|
+
console = Console()
|
|
95
|
+
try:
|
|
96
|
+
asyncio.run(start_watchdog())
|
|
97
|
+
except KeyboardInterrupt:
|
|
98
|
+
console.print("\n[yellow]🛑 Watchdog stopped[/yellow]")
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def handle_start_websocket_server(port: int = 8675) -> None:
|
|
102
|
+
from crackerjack.mcp.websocket.server import handle_websocket_server_command
|
|
103
|
+
|
|
104
|
+
handle_websocket_server_command(start=True, port=port)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def handle_stop_websocket_server() -> None:
|
|
108
|
+
from crackerjack.mcp.websocket.server import handle_websocket_server_command
|
|
109
|
+
|
|
110
|
+
handle_websocket_server_command(stop=True)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def handle_restart_websocket_server(port: int = 8675) -> None:
|
|
114
|
+
from crackerjack.mcp.websocket.server import handle_websocket_server_command
|
|
115
|
+
|
|
116
|
+
handle_websocket_server_command(restart=True, port=port)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def handle_stop_mcp_server() -> None:
|
|
120
|
+
from crackerjack.services.server_manager import list_server_status, stop_all_servers
|
|
121
|
+
|
|
122
|
+
console = Console()
|
|
123
|
+
console.print("[bold red]🛑 Stopping MCP Servers[/bold red]")
|
|
124
|
+
|
|
125
|
+
list_server_status(console)
|
|
126
|
+
|
|
127
|
+
if stop_all_servers(console):
|
|
128
|
+
console.print("\n[bold green]✅ All servers stopped successfully[/bold green]")
|
|
129
|
+
else:
|
|
130
|
+
console.print("\n[bold red]❌ Some servers failed to stop[/bold red]")
|
|
131
|
+
raise SystemExit(1)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def handle_restart_mcp_server(websocket_port: int | None = None) -> None:
|
|
135
|
+
from crackerjack.services.server_manager import restart_mcp_server
|
|
136
|
+
|
|
137
|
+
console = Console()
|
|
138
|
+
if restart_mcp_server(websocket_port, console):
|
|
139
|
+
console.print("\n[bold green]✅ MCP server restart completed[/bold green]")
|
|
140
|
+
else:
|
|
141
|
+
console.print("\n[bold red]❌ MCP server restart failed[/bold red]")
|
|
142
|
+
raise SystemExit(1)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def handle_interactive_mode(options: Options) -> None:
|
|
146
|
+
from crackerjack.cli.utils import get_package_version
|
|
147
|
+
|
|
148
|
+
from .interactive import launch_interactive_cli
|
|
149
|
+
|
|
150
|
+
pkg_version = get_package_version()
|
|
151
|
+
launch_interactive_cli(pkg_version, options)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def handle_standard_mode(
|
|
155
|
+
options: Options,
|
|
156
|
+
async_mode: bool,
|
|
157
|
+
job_id: str | None = None,
|
|
158
|
+
orchestrated: bool = False,
|
|
159
|
+
) -> None:
|
|
160
|
+
from rich.console import Console
|
|
161
|
+
|
|
162
|
+
console = Console()
|
|
163
|
+
|
|
164
|
+
if orchestrated:
|
|
165
|
+
handle_orchestrated_mode(options, job_id)
|
|
166
|
+
else:
|
|
167
|
+
from crackerjack.core.async_workflow_orchestrator import (
|
|
168
|
+
AsyncWorkflowOrchestrator,
|
|
169
|
+
)
|
|
170
|
+
from crackerjack.core.workflow_orchestrator import WorkflowOrchestrator
|
|
171
|
+
|
|
172
|
+
pkg_path = Path.cwd()
|
|
173
|
+
|
|
174
|
+
if async_mode:
|
|
175
|
+
orchestrator = AsyncWorkflowOrchestrator(
|
|
176
|
+
console=console,
|
|
177
|
+
pkg_path=pkg_path,
|
|
178
|
+
web_job_id=job_id,
|
|
179
|
+
)
|
|
180
|
+
success = asyncio.run(orchestrator.run_complete_workflow_async(options))
|
|
181
|
+
else:
|
|
182
|
+
orchestrator = WorkflowOrchestrator(
|
|
183
|
+
console=console,
|
|
184
|
+
pkg_path=pkg_path,
|
|
185
|
+
web_job_id=job_id,
|
|
186
|
+
verbose=options.verbose,
|
|
187
|
+
)
|
|
188
|
+
success = asyncio.run(orchestrator.run_complete_workflow(options))
|
|
189
|
+
|
|
190
|
+
if not success:
|
|
191
|
+
raise SystemExit(1)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def handle_orchestrated_mode(options: Options, job_id: str | None = None) -> None:
|
|
195
|
+
from rich.console import Console
|
|
196
|
+
|
|
197
|
+
console = Console()
|
|
198
|
+
console.print("[bold bright_blue]🚀 ORCHESTRATED MODE ENABLED[/bold bright_blue]")
|
|
199
|
+
|
|
200
|
+
try:
|
|
201
|
+
from crackerjack.core.session_coordinator import SessionCoordinator
|
|
202
|
+
from crackerjack.orchestration.advanced_orchestrator import (
|
|
203
|
+
AdvancedWorkflowOrchestrator,
|
|
204
|
+
)
|
|
205
|
+
from crackerjack.orchestration.execution_strategies import (
|
|
206
|
+
AICoordinationMode,
|
|
207
|
+
ExecutionStrategy,
|
|
208
|
+
OrchestrationConfig,
|
|
209
|
+
ProgressLevel,
|
|
210
|
+
)
|
|
211
|
+
except ImportError as e:
|
|
212
|
+
console.print(f"[red]Orchestrated mode not available: {e}[/red]")
|
|
213
|
+
console.print("[yellow]Falling back to standard mode[/yellow]")
|
|
214
|
+
handle_standard_mode(options, False, job_id)
|
|
215
|
+
return
|
|
216
|
+
|
|
217
|
+
try:
|
|
218
|
+
strategy = ExecutionStrategy(options.orchestration_strategy)
|
|
219
|
+
except ValueError:
|
|
220
|
+
console.print(
|
|
221
|
+
f"[red]Invalid orchestration strategy: {options.orchestration_strategy}[/red]",
|
|
222
|
+
)
|
|
223
|
+
strategy = ExecutionStrategy.ADAPTIVE
|
|
224
|
+
|
|
225
|
+
try:
|
|
226
|
+
progress = ProgressLevel(options.orchestration_progress)
|
|
227
|
+
except ValueError:
|
|
228
|
+
console.print(
|
|
229
|
+
f"[red]Invalid progress level: {options.orchestration_progress}[/red]",
|
|
230
|
+
)
|
|
231
|
+
progress = ProgressLevel.GRANULAR
|
|
232
|
+
|
|
233
|
+
try:
|
|
234
|
+
ai_mode = AICoordinationMode(options.orchestration_ai_mode)
|
|
235
|
+
except ValueError:
|
|
236
|
+
console.print(f"[red]Invalid AI mode: {options.orchestration_ai_mode}[/red]")
|
|
237
|
+
ai_mode = AICoordinationMode.SINGLE_AGENT
|
|
238
|
+
|
|
239
|
+
config = OrchestrationConfig(
|
|
240
|
+
execution_strategy=strategy,
|
|
241
|
+
progress_level=progress,
|
|
242
|
+
ai_coordination_mode=ai_mode,
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
console.print(f"[cyan]Execution Strategy: [/cyan] {strategy.value}")
|
|
246
|
+
console.print(f"[cyan]Progress Level: [/cyan] {progress.value}")
|
|
247
|
+
console.print(f"[cyan]AI Coordination: [/cyan] {ai_mode.value}")
|
|
248
|
+
|
|
249
|
+
pkg_path = Path.cwd()
|
|
250
|
+
session = SessionCoordinator(console, pkg_path, web_job_id=job_id)
|
|
251
|
+
orchestrator = AdvancedWorkflowOrchestrator(console, pkg_path, session, config)
|
|
252
|
+
|
|
253
|
+
try:
|
|
254
|
+
success = asyncio.run(orchestrator.execute_orchestrated_workflow(options))
|
|
255
|
+
if success:
|
|
256
|
+
console.print(
|
|
257
|
+
"\n[bold green]🎉 ORCHESTRATED WORKFLOW COMPLETED SUCCESSFULLY![/bold green]",
|
|
258
|
+
)
|
|
259
|
+
else:
|
|
260
|
+
console.print("\n[bold red]❌ ORCHESTRATED WORKFLOW FAILED[/bold red]")
|
|
261
|
+
sys.exit(1)
|
|
262
|
+
except KeyboardInterrupt:
|
|
263
|
+
console.print("\n[yellow]🛑 Orchestrated workflow interrupted[/yellow]")
|
|
264
|
+
sys.exit(130)
|
|
265
|
+
except Exception as e:
|
|
266
|
+
console.print(f"\n[red]💥 Orchestrated workflow error: {e}[/red]")
|
|
267
|
+
sys.exit(1)
|