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
crackerjack/__main__.py
CHANGED
|
@@ -1,275 +1,247 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
from enum import Enum
|
|
3
|
-
|
|
4
1
|
import typer
|
|
5
|
-
from pydantic import BaseModel, field_validator
|
|
6
2
|
from rich.console import Console
|
|
7
3
|
|
|
8
|
-
from .
|
|
4
|
+
from .cli import (
|
|
5
|
+
CLI_OPTIONS,
|
|
6
|
+
BumpOption,
|
|
7
|
+
create_options,
|
|
8
|
+
handle_interactive_mode,
|
|
9
|
+
handle_standard_mode,
|
|
10
|
+
setup_ai_agent_env,
|
|
11
|
+
)
|
|
12
|
+
from .cli.handlers import (
|
|
13
|
+
handle_dashboard_mode,
|
|
14
|
+
handle_enhanced_monitor_mode,
|
|
15
|
+
handle_mcp_server,
|
|
16
|
+
handle_monitor_mode,
|
|
17
|
+
handle_restart_mcp_server,
|
|
18
|
+
handle_restart_websocket_server,
|
|
19
|
+
handle_start_websocket_server,
|
|
20
|
+
handle_stop_mcp_server,
|
|
21
|
+
handle_stop_websocket_server,
|
|
22
|
+
handle_watchdog_mode,
|
|
23
|
+
)
|
|
9
24
|
|
|
10
25
|
console = Console(force_terminal=True)
|
|
11
26
|
app = typer.Typer(
|
|
12
|
-
help="Crackerjack: Your Python project setup and style enforcement tool."
|
|
27
|
+
help="Crackerjack: Your Python project setup and style enforcement tool.",
|
|
13
28
|
)
|
|
14
29
|
|
|
15
30
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
case_sensitive=False,
|
|
110
|
-
),
|
|
111
|
-
"clean": typer.Option(
|
|
112
|
-
False,
|
|
113
|
-
"-x",
|
|
114
|
-
"--clean",
|
|
115
|
-
help="Remove docstrings, line comments, and unnecessary whitespace from source code (doesn't affect test files).",
|
|
116
|
-
),
|
|
117
|
-
"test": typer.Option(False, "-t", "--test", help="Run tests."),
|
|
118
|
-
"benchmark": typer.Option(
|
|
119
|
-
False,
|
|
120
|
-
"--benchmark",
|
|
121
|
-
help="Run tests in benchmark mode (disables parallel execution).",
|
|
122
|
-
),
|
|
123
|
-
"benchmark_regression": typer.Option(
|
|
124
|
-
False,
|
|
125
|
-
"--benchmark-regression",
|
|
126
|
-
help="Fail tests if benchmarks regress beyond threshold.",
|
|
127
|
-
),
|
|
128
|
-
"benchmark_regression_threshold": typer.Option(
|
|
129
|
-
5.0,
|
|
130
|
-
"--benchmark-regression-threshold",
|
|
131
|
-
help="Maximum allowed performance regression percentage (default: 5.0%).",
|
|
132
|
-
),
|
|
133
|
-
"test_workers": typer.Option(
|
|
134
|
-
0,
|
|
135
|
-
"--test-workers",
|
|
136
|
-
help="Number of parallel workers for running tests (0 = auto-detect, 1 = disable parallelization).",
|
|
137
|
-
),
|
|
138
|
-
"test_timeout": typer.Option(
|
|
139
|
-
0,
|
|
140
|
-
"--test-timeout",
|
|
141
|
-
help="Timeout in seconds for individual tests (0 = use default based on project size).",
|
|
142
|
-
),
|
|
143
|
-
"skip_hooks": typer.Option(
|
|
144
|
-
False,
|
|
145
|
-
"-s",
|
|
146
|
-
"--skip-hooks",
|
|
147
|
-
help="Skip running pre-commit hooks (useful with -t).",
|
|
148
|
-
),
|
|
149
|
-
"all": typer.Option(
|
|
150
|
-
None,
|
|
151
|
-
"-a",
|
|
152
|
-
"--all",
|
|
153
|
-
help="Run with `-x -t -p <patch|minor|major> -c` development options).",
|
|
154
|
-
case_sensitive=False,
|
|
155
|
-
),
|
|
156
|
-
"create_pr": typer.Option(
|
|
157
|
-
False, "-r", "--pr", help="Create a pull request to the upstream repository."
|
|
158
|
-
),
|
|
159
|
-
"ai_agent": typer.Option(
|
|
160
|
-
False,
|
|
161
|
-
"--ai-agent",
|
|
162
|
-
help="Enable AI agent mode with structured output.",
|
|
163
|
-
hidden=True,
|
|
164
|
-
),
|
|
165
|
-
"comprehensive": typer.Option(
|
|
166
|
-
False,
|
|
167
|
-
"--comprehensive",
|
|
168
|
-
help="Use comprehensive pre-commit hooks (slower but thorough).",
|
|
169
|
-
),
|
|
170
|
-
"async_mode": typer.Option(
|
|
171
|
-
False,
|
|
172
|
-
"--async",
|
|
173
|
-
help="Enable async mode for faster file operations (experimental).",
|
|
174
|
-
hidden=True,
|
|
175
|
-
),
|
|
176
|
-
"track_progress": typer.Option(
|
|
177
|
-
False,
|
|
178
|
-
"--track-progress",
|
|
179
|
-
help="Enable session progress tracking with detailed markdown output.",
|
|
180
|
-
),
|
|
181
|
-
"resume_from": typer.Option(
|
|
182
|
-
None,
|
|
183
|
-
"--resume-from",
|
|
184
|
-
help="Resume session from existing progress file.",
|
|
185
|
-
),
|
|
186
|
-
"progress_file": typer.Option(
|
|
187
|
-
None,
|
|
188
|
-
"--progress-file",
|
|
189
|
-
help="Custom path for progress file (default: SESSION-PROGRESS-{timestamp}.md).",
|
|
190
|
-
),
|
|
191
|
-
}
|
|
31
|
+
def _handle_monitoring_commands(
|
|
32
|
+
monitor: bool,
|
|
33
|
+
enhanced_monitor: bool,
|
|
34
|
+
dashboard: bool,
|
|
35
|
+
watchdog: bool,
|
|
36
|
+
dev: bool,
|
|
37
|
+
) -> bool:
|
|
38
|
+
"""Handle monitoring commands."""
|
|
39
|
+
if monitor:
|
|
40
|
+
handle_monitor_mode(dev_mode=dev)
|
|
41
|
+
return True
|
|
42
|
+
if enhanced_monitor:
|
|
43
|
+
handle_enhanced_monitor_mode(dev_mode=dev)
|
|
44
|
+
return True
|
|
45
|
+
if dashboard:
|
|
46
|
+
handle_dashboard_mode(dev_mode=dev)
|
|
47
|
+
return True
|
|
48
|
+
if watchdog:
|
|
49
|
+
handle_watchdog_mode()
|
|
50
|
+
return True
|
|
51
|
+
return False
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _handle_websocket_commands(
|
|
55
|
+
start_websocket_server: bool,
|
|
56
|
+
stop_websocket_server: bool,
|
|
57
|
+
restart_websocket_server: bool,
|
|
58
|
+
websocket_port: int | None,
|
|
59
|
+
) -> bool:
|
|
60
|
+
"""Handle WebSocket server commands."""
|
|
61
|
+
if start_websocket_server:
|
|
62
|
+
port = websocket_port or 8675
|
|
63
|
+
handle_start_websocket_server(port)
|
|
64
|
+
return True
|
|
65
|
+
if stop_websocket_server:
|
|
66
|
+
handle_stop_websocket_server()
|
|
67
|
+
return True
|
|
68
|
+
if restart_websocket_server:
|
|
69
|
+
port = websocket_port or 8675
|
|
70
|
+
handle_restart_websocket_server(port)
|
|
71
|
+
return True
|
|
72
|
+
return False
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _handle_mcp_commands(
|
|
76
|
+
start_mcp_server: bool,
|
|
77
|
+
stop_mcp_server: bool,
|
|
78
|
+
restart_mcp_server: bool,
|
|
79
|
+
websocket_port: int | None,
|
|
80
|
+
) -> bool:
|
|
81
|
+
"""Handle MCP server commands."""
|
|
82
|
+
if start_mcp_server:
|
|
83
|
+
handle_mcp_server(websocket_port)
|
|
84
|
+
return True
|
|
85
|
+
if stop_mcp_server:
|
|
86
|
+
handle_stop_mcp_server()
|
|
87
|
+
return True
|
|
88
|
+
if restart_mcp_server:
|
|
89
|
+
handle_restart_mcp_server(websocket_port)
|
|
90
|
+
return True
|
|
91
|
+
return False
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def _handle_server_commands(
|
|
95
|
+
monitor: bool,
|
|
96
|
+
enhanced_monitor: bool,
|
|
97
|
+
dashboard: bool,
|
|
98
|
+
watchdog: bool,
|
|
99
|
+
start_websocket_server: bool,
|
|
100
|
+
stop_websocket_server: bool,
|
|
101
|
+
restart_websocket_server: bool,
|
|
102
|
+
start_mcp_server: bool,
|
|
103
|
+
stop_mcp_server: bool,
|
|
104
|
+
restart_mcp_server: bool,
|
|
105
|
+
websocket_port: int | None,
|
|
106
|
+
dev: bool,
|
|
107
|
+
) -> bool:
|
|
108
|
+
"""Handle server-related commands. Returns True if a server command was handled."""
|
|
109
|
+
return (
|
|
110
|
+
_handle_monitoring_commands(monitor, enhanced_monitor, dashboard, watchdog, dev)
|
|
111
|
+
or _handle_websocket_commands(
|
|
112
|
+
start_websocket_server,
|
|
113
|
+
stop_websocket_server,
|
|
114
|
+
restart_websocket_server,
|
|
115
|
+
websocket_port,
|
|
116
|
+
)
|
|
117
|
+
or _handle_mcp_commands(
|
|
118
|
+
start_mcp_server,
|
|
119
|
+
stop_mcp_server,
|
|
120
|
+
restart_mcp_server,
|
|
121
|
+
websocket_port,
|
|
122
|
+
)
|
|
123
|
+
)
|
|
192
124
|
|
|
193
125
|
|
|
194
126
|
@app.command()
|
|
195
127
|
def main(
|
|
196
|
-
commit: bool =
|
|
197
|
-
interactive: bool =
|
|
198
|
-
no_config_updates: bool =
|
|
199
|
-
update_precommit: bool =
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
],
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
128
|
+
commit: bool = CLI_OPTIONS["commit"],
|
|
129
|
+
interactive: bool = CLI_OPTIONS["interactive"],
|
|
130
|
+
no_config_updates: bool = CLI_OPTIONS["no_config_updates"],
|
|
131
|
+
update_precommit: bool = CLI_OPTIONS["update_precommit"],
|
|
132
|
+
verbose: bool = CLI_OPTIONS["verbose"],
|
|
133
|
+
publish: BumpOption | None = CLI_OPTIONS["publish"],
|
|
134
|
+
all: BumpOption | None = CLI_OPTIONS["all"],
|
|
135
|
+
bump: BumpOption | None = CLI_OPTIONS["bump"],
|
|
136
|
+
clean: bool = CLI_OPTIONS["clean"],
|
|
137
|
+
test: bool = CLI_OPTIONS["test"],
|
|
138
|
+
benchmark: bool = CLI_OPTIONS["benchmark"],
|
|
139
|
+
test_workers: int = CLI_OPTIONS["test_workers"],
|
|
140
|
+
test_timeout: int = CLI_OPTIONS["test_timeout"],
|
|
141
|
+
skip_hooks: bool = CLI_OPTIONS["skip_hooks"],
|
|
142
|
+
fast: bool = CLI_OPTIONS["fast"],
|
|
143
|
+
comp: bool = CLI_OPTIONS["comp"],
|
|
144
|
+
create_pr: bool = CLI_OPTIONS["create_pr"],
|
|
145
|
+
ai_agent: bool = CLI_OPTIONS["ai_agent"],
|
|
146
|
+
start_mcp_server: bool = CLI_OPTIONS["start_mcp_server"],
|
|
147
|
+
stop_mcp_server: bool = CLI_OPTIONS["stop_mcp_server"],
|
|
148
|
+
restart_mcp_server: bool = CLI_OPTIONS["restart_mcp_server"],
|
|
149
|
+
async_mode: bool = CLI_OPTIONS["async_mode"],
|
|
150
|
+
experimental_hooks: bool = CLI_OPTIONS["experimental_hooks"],
|
|
151
|
+
enable_pyrefly: bool = CLI_OPTIONS["enable_pyrefly"],
|
|
152
|
+
enable_ty: bool = CLI_OPTIONS["enable_ty"],
|
|
153
|
+
no_git_tags: bool = CLI_OPTIONS["no_git_tags"],
|
|
154
|
+
skip_version_check: bool = CLI_OPTIONS["skip_version_check"],
|
|
155
|
+
start_websocket_server: bool = CLI_OPTIONS["start_websocket_server"],
|
|
156
|
+
stop_websocket_server: bool = CLI_OPTIONS["stop_websocket_server"],
|
|
157
|
+
restart_websocket_server: bool = CLI_OPTIONS["restart_websocket_server"],
|
|
158
|
+
websocket_port: int | None = CLI_OPTIONS["websocket_port"],
|
|
159
|
+
watchdog: bool = CLI_OPTIONS["watchdog"],
|
|
160
|
+
monitor: bool = CLI_OPTIONS["monitor"],
|
|
161
|
+
enhanced_monitor: bool = CLI_OPTIONS["enhanced_monitor"],
|
|
162
|
+
ai_debug: bool = CLI_OPTIONS["ai_debug"],
|
|
163
|
+
job_id: str | None = CLI_OPTIONS["job_id"],
|
|
164
|
+
orchestrated: bool = CLI_OPTIONS["orchestrated"],
|
|
165
|
+
orchestration_strategy: str = CLI_OPTIONS["orchestration_strategy"],
|
|
166
|
+
orchestration_progress: str = CLI_OPTIONS["orchestration_progress"],
|
|
167
|
+
orchestration_ai_mode: str = CLI_OPTIONS["orchestration_ai_mode"],
|
|
168
|
+
dev: bool = CLI_OPTIONS["dev"],
|
|
169
|
+
dashboard: bool = CLI_OPTIONS["dashboard"],
|
|
170
|
+
max_iterations: int = CLI_OPTIONS["max_iterations"],
|
|
171
|
+
coverage_status: bool = CLI_OPTIONS["coverage_status"],
|
|
172
|
+
coverage_goal: float | None = CLI_OPTIONS["coverage_goal"],
|
|
173
|
+
no_coverage_ratchet: bool = CLI_OPTIONS["no_coverage_ratchet"],
|
|
224
174
|
) -> None:
|
|
225
|
-
options =
|
|
226
|
-
commit
|
|
227
|
-
interactive
|
|
228
|
-
no_config_updates
|
|
229
|
-
update_precommit
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
175
|
+
options = create_options(
|
|
176
|
+
commit,
|
|
177
|
+
interactive,
|
|
178
|
+
no_config_updates,
|
|
179
|
+
update_precommit,
|
|
180
|
+
verbose,
|
|
181
|
+
publish,
|
|
182
|
+
all,
|
|
183
|
+
bump,
|
|
184
|
+
clean,
|
|
185
|
+
test,
|
|
186
|
+
benchmark,
|
|
187
|
+
test_workers,
|
|
188
|
+
test_timeout,
|
|
189
|
+
skip_hooks,
|
|
190
|
+
fast,
|
|
191
|
+
comp,
|
|
192
|
+
create_pr,
|
|
193
|
+
ai_agent,
|
|
194
|
+
async_mode,
|
|
195
|
+
experimental_hooks,
|
|
196
|
+
enable_pyrefly,
|
|
197
|
+
enable_ty,
|
|
198
|
+
no_git_tags,
|
|
199
|
+
skip_version_check,
|
|
200
|
+
orchestrated,
|
|
201
|
+
orchestration_strategy,
|
|
202
|
+
orchestration_progress,
|
|
203
|
+
orchestration_ai_mode,
|
|
204
|
+
dev,
|
|
205
|
+
dashboard,
|
|
206
|
+
max_iterations,
|
|
207
|
+
coverage_status,
|
|
208
|
+
coverage_goal,
|
|
209
|
+
no_coverage_ratchet,
|
|
252
210
|
)
|
|
253
|
-
if ai_agent:
|
|
254
|
-
import os
|
|
255
211
|
|
|
256
|
-
|
|
212
|
+
if ai_debug:
|
|
213
|
+
ai_agent = True
|
|
214
|
+
verbose = True
|
|
215
|
+
|
|
216
|
+
setup_ai_agent_env(ai_agent, verbose or ai_debug)
|
|
217
|
+
|
|
218
|
+
# Handle server commands
|
|
219
|
+
if _handle_server_commands(
|
|
220
|
+
monitor,
|
|
221
|
+
enhanced_monitor,
|
|
222
|
+
dashboard,
|
|
223
|
+
watchdog,
|
|
224
|
+
start_websocket_server,
|
|
225
|
+
stop_websocket_server,
|
|
226
|
+
restart_websocket_server,
|
|
227
|
+
start_mcp_server,
|
|
228
|
+
stop_mcp_server,
|
|
229
|
+
restart_mcp_server,
|
|
230
|
+
websocket_port,
|
|
231
|
+
dev,
|
|
232
|
+
):
|
|
233
|
+
return
|
|
234
|
+
|
|
235
|
+
# Handle main workflow
|
|
257
236
|
if interactive:
|
|
258
|
-
|
|
237
|
+
handle_interactive_mode(options)
|
|
238
|
+
else:
|
|
239
|
+
handle_standard_mode(options, async_mode, job_id, orchestrated)
|
|
259
240
|
|
|
260
|
-
try:
|
|
261
|
-
from importlib.metadata import version
|
|
262
241
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
launch_interactive_cli(pkg_version)
|
|
267
|
-
else:
|
|
268
|
-
runner = create_crackerjack_runner(console=console)
|
|
269
|
-
if async_mode:
|
|
270
|
-
asyncio.run(runner.process_async(options))
|
|
271
|
-
else:
|
|
272
|
-
runner.process(options)
|
|
242
|
+
def cli() -> None:
|
|
243
|
+
"""Entry point for console script."""
|
|
244
|
+
app()
|
|
273
245
|
|
|
274
246
|
|
|
275
247
|
if __name__ == "__main__":
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Import all agent modules to trigger registration
|
|
2
|
+
from . import (
|
|
3
|
+
architect_agent,
|
|
4
|
+
documentation_agent,
|
|
5
|
+
dry_agent,
|
|
6
|
+
formatting_agent,
|
|
7
|
+
import_optimization_agent,
|
|
8
|
+
performance_agent,
|
|
9
|
+
refactoring_agent,
|
|
10
|
+
security_agent,
|
|
11
|
+
test_creation_agent,
|
|
12
|
+
test_specialist_agent,
|
|
13
|
+
)
|
|
14
|
+
from .base import AgentContext, FixResult, Issue, IssueType, Priority, SubAgent
|
|
15
|
+
from .coordinator import AgentCoordinator
|
|
16
|
+
from .tracker import AgentTracker, get_agent_tracker, reset_agent_tracker
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"AgentContext",
|
|
20
|
+
"AgentCoordinator",
|
|
21
|
+
"AgentTracker",
|
|
22
|
+
"FixResult",
|
|
23
|
+
# Exported classes
|
|
24
|
+
"Issue",
|
|
25
|
+
"IssueType",
|
|
26
|
+
"Priority",
|
|
27
|
+
"SubAgent",
|
|
28
|
+
# Agent modules (imported for registration)
|
|
29
|
+
"architect_agent",
|
|
30
|
+
"documentation_agent",
|
|
31
|
+
"dry_agent",
|
|
32
|
+
"formatting_agent",
|
|
33
|
+
"get_agent_tracker",
|
|
34
|
+
"import_optimization_agent",
|
|
35
|
+
"performance_agent",
|
|
36
|
+
"refactoring_agent",
|
|
37
|
+
"reset_agent_tracker",
|
|
38
|
+
"security_agent",
|
|
39
|
+
"test_creation_agent",
|
|
40
|
+
"test_specialist_agent",
|
|
41
|
+
]
|