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.

Files changed (158) hide show
  1. crackerjack/CLAUDE.md +1005 -0
  2. crackerjack/RULES.md +380 -0
  3. crackerjack/__init__.py +42 -13
  4. crackerjack/__main__.py +225 -253
  5. crackerjack/agents/__init__.py +41 -0
  6. crackerjack/agents/architect_agent.py +281 -0
  7. crackerjack/agents/base.py +169 -0
  8. crackerjack/agents/coordinator.py +512 -0
  9. crackerjack/agents/documentation_agent.py +498 -0
  10. crackerjack/agents/dry_agent.py +388 -0
  11. crackerjack/agents/formatting_agent.py +245 -0
  12. crackerjack/agents/import_optimization_agent.py +281 -0
  13. crackerjack/agents/performance_agent.py +669 -0
  14. crackerjack/agents/proactive_agent.py +104 -0
  15. crackerjack/agents/refactoring_agent.py +788 -0
  16. crackerjack/agents/security_agent.py +529 -0
  17. crackerjack/agents/test_creation_agent.py +652 -0
  18. crackerjack/agents/test_specialist_agent.py +486 -0
  19. crackerjack/agents/tracker.py +212 -0
  20. crackerjack/api.py +560 -0
  21. crackerjack/cli/__init__.py +24 -0
  22. crackerjack/cli/facade.py +104 -0
  23. crackerjack/cli/handlers.py +267 -0
  24. crackerjack/cli/interactive.py +471 -0
  25. crackerjack/cli/options.py +401 -0
  26. crackerjack/cli/utils.py +18 -0
  27. crackerjack/code_cleaner.py +670 -0
  28. crackerjack/config/__init__.py +19 -0
  29. crackerjack/config/hooks.py +218 -0
  30. crackerjack/core/__init__.py +0 -0
  31. crackerjack/core/async_workflow_orchestrator.py +406 -0
  32. crackerjack/core/autofix_coordinator.py +200 -0
  33. crackerjack/core/container.py +104 -0
  34. crackerjack/core/enhanced_container.py +542 -0
  35. crackerjack/core/performance.py +243 -0
  36. crackerjack/core/phase_coordinator.py +561 -0
  37. crackerjack/core/proactive_workflow.py +316 -0
  38. crackerjack/core/session_coordinator.py +289 -0
  39. crackerjack/core/workflow_orchestrator.py +640 -0
  40. crackerjack/dynamic_config.py +577 -0
  41. crackerjack/errors.py +263 -41
  42. crackerjack/executors/__init__.py +11 -0
  43. crackerjack/executors/async_hook_executor.py +431 -0
  44. crackerjack/executors/cached_hook_executor.py +242 -0
  45. crackerjack/executors/hook_executor.py +345 -0
  46. crackerjack/executors/individual_hook_executor.py +669 -0
  47. crackerjack/intelligence/__init__.py +44 -0
  48. crackerjack/intelligence/adaptive_learning.py +751 -0
  49. crackerjack/intelligence/agent_orchestrator.py +551 -0
  50. crackerjack/intelligence/agent_registry.py +414 -0
  51. crackerjack/intelligence/agent_selector.py +502 -0
  52. crackerjack/intelligence/integration.py +290 -0
  53. crackerjack/interactive.py +576 -315
  54. crackerjack/managers/__init__.py +11 -0
  55. crackerjack/managers/async_hook_manager.py +135 -0
  56. crackerjack/managers/hook_manager.py +137 -0
  57. crackerjack/managers/publish_manager.py +411 -0
  58. crackerjack/managers/test_command_builder.py +151 -0
  59. crackerjack/managers/test_executor.py +435 -0
  60. crackerjack/managers/test_manager.py +258 -0
  61. crackerjack/managers/test_manager_backup.py +1124 -0
  62. crackerjack/managers/test_progress.py +144 -0
  63. crackerjack/mcp/__init__.py +0 -0
  64. crackerjack/mcp/cache.py +336 -0
  65. crackerjack/mcp/client_runner.py +104 -0
  66. crackerjack/mcp/context.py +615 -0
  67. crackerjack/mcp/dashboard.py +636 -0
  68. crackerjack/mcp/enhanced_progress_monitor.py +479 -0
  69. crackerjack/mcp/file_monitor.py +336 -0
  70. crackerjack/mcp/progress_components.py +569 -0
  71. crackerjack/mcp/progress_monitor.py +949 -0
  72. crackerjack/mcp/rate_limiter.py +332 -0
  73. crackerjack/mcp/server.py +22 -0
  74. crackerjack/mcp/server_core.py +244 -0
  75. crackerjack/mcp/service_watchdog.py +501 -0
  76. crackerjack/mcp/state.py +395 -0
  77. crackerjack/mcp/task_manager.py +257 -0
  78. crackerjack/mcp/tools/__init__.py +17 -0
  79. crackerjack/mcp/tools/core_tools.py +249 -0
  80. crackerjack/mcp/tools/error_analyzer.py +308 -0
  81. crackerjack/mcp/tools/execution_tools.py +370 -0
  82. crackerjack/mcp/tools/execution_tools_backup.py +1097 -0
  83. crackerjack/mcp/tools/intelligence_tool_registry.py +80 -0
  84. crackerjack/mcp/tools/intelligence_tools.py +314 -0
  85. crackerjack/mcp/tools/monitoring_tools.py +502 -0
  86. crackerjack/mcp/tools/proactive_tools.py +384 -0
  87. crackerjack/mcp/tools/progress_tools.py +141 -0
  88. crackerjack/mcp/tools/utility_tools.py +341 -0
  89. crackerjack/mcp/tools/workflow_executor.py +360 -0
  90. crackerjack/mcp/websocket/__init__.py +14 -0
  91. crackerjack/mcp/websocket/app.py +39 -0
  92. crackerjack/mcp/websocket/endpoints.py +559 -0
  93. crackerjack/mcp/websocket/jobs.py +253 -0
  94. crackerjack/mcp/websocket/server.py +116 -0
  95. crackerjack/mcp/websocket/websocket_handler.py +78 -0
  96. crackerjack/mcp/websocket_server.py +10 -0
  97. crackerjack/models/__init__.py +31 -0
  98. crackerjack/models/config.py +93 -0
  99. crackerjack/models/config_adapter.py +230 -0
  100. crackerjack/models/protocols.py +118 -0
  101. crackerjack/models/task.py +154 -0
  102. crackerjack/monitoring/ai_agent_watchdog.py +450 -0
  103. crackerjack/monitoring/regression_prevention.py +638 -0
  104. crackerjack/orchestration/__init__.py +0 -0
  105. crackerjack/orchestration/advanced_orchestrator.py +970 -0
  106. crackerjack/orchestration/execution_strategies.py +341 -0
  107. crackerjack/orchestration/test_progress_streamer.py +636 -0
  108. crackerjack/plugins/__init__.py +15 -0
  109. crackerjack/plugins/base.py +200 -0
  110. crackerjack/plugins/hooks.py +246 -0
  111. crackerjack/plugins/loader.py +335 -0
  112. crackerjack/plugins/managers.py +259 -0
  113. crackerjack/py313.py +8 -3
  114. crackerjack/services/__init__.py +22 -0
  115. crackerjack/services/cache.py +314 -0
  116. crackerjack/services/config.py +347 -0
  117. crackerjack/services/config_integrity.py +99 -0
  118. crackerjack/services/contextual_ai_assistant.py +516 -0
  119. crackerjack/services/coverage_ratchet.py +347 -0
  120. crackerjack/services/debug.py +736 -0
  121. crackerjack/services/dependency_monitor.py +617 -0
  122. crackerjack/services/enhanced_filesystem.py +439 -0
  123. crackerjack/services/file_hasher.py +151 -0
  124. crackerjack/services/filesystem.py +395 -0
  125. crackerjack/services/git.py +165 -0
  126. crackerjack/services/health_metrics.py +611 -0
  127. crackerjack/services/initialization.py +847 -0
  128. crackerjack/services/log_manager.py +286 -0
  129. crackerjack/services/logging.py +174 -0
  130. crackerjack/services/metrics.py +578 -0
  131. crackerjack/services/pattern_cache.py +362 -0
  132. crackerjack/services/pattern_detector.py +515 -0
  133. crackerjack/services/performance_benchmarks.py +653 -0
  134. crackerjack/services/security.py +163 -0
  135. crackerjack/services/server_manager.py +234 -0
  136. crackerjack/services/smart_scheduling.py +144 -0
  137. crackerjack/services/tool_version_service.py +61 -0
  138. crackerjack/services/unified_config.py +437 -0
  139. crackerjack/services/version_checker.py +248 -0
  140. crackerjack/slash_commands/__init__.py +14 -0
  141. crackerjack/slash_commands/init.md +122 -0
  142. crackerjack/slash_commands/run.md +163 -0
  143. crackerjack/slash_commands/status.md +127 -0
  144. crackerjack-0.31.4.dist-info/METADATA +742 -0
  145. crackerjack-0.31.4.dist-info/RECORD +148 -0
  146. crackerjack-0.31.4.dist-info/entry_points.txt +2 -0
  147. crackerjack/.gitignore +0 -34
  148. crackerjack/.libcst.codemod.yaml +0 -18
  149. crackerjack/.pdm.toml +0 -1
  150. crackerjack/.pre-commit-config-ai.yaml +0 -149
  151. crackerjack/.pre-commit-config-fast.yaml +0 -69
  152. crackerjack/.pre-commit-config.yaml +0 -114
  153. crackerjack/crackerjack.py +0 -4140
  154. crackerjack/pyproject.toml +0 -285
  155. crackerjack-0.29.0.dist-info/METADATA +0 -1289
  156. crackerjack-0.29.0.dist-info/RECORD +0 -17
  157. {crackerjack-0.29.0.dist-info → crackerjack-0.31.4.dist-info}/WHEEL +0 -0
  158. {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 .crackerjack import create_crackerjack_runner
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
- class BumpOption(str, Enum):
17
- patch = "patch"
18
- minor = "minor"
19
- major = "major"
20
-
21
- def __str__(self) -> str:
22
- return self.value
23
-
24
-
25
- class Options(BaseModel):
26
- commit: bool = False
27
- interactive: bool = False
28
- no_config_updates: bool = False
29
- publish: BumpOption | None = None
30
- bump: BumpOption | None = None
31
- verbose: bool = False
32
- update_precommit: bool = False
33
- update_docs: bool = False
34
- force_update_docs: bool = False
35
- compress_docs: bool = False
36
- clean: bool = False
37
- test: bool = False
38
- benchmark: bool = False
39
- benchmark_regression: bool = False
40
- benchmark_regression_threshold: float = 5.0
41
- test_workers: int = 0
42
- test_timeout: int = 0
43
- all: BumpOption | None = None
44
- ai_agent: bool = False
45
- create_pr: bool = False
46
- skip_hooks: bool = False
47
- comprehensive: bool = False
48
- async_mode: bool = False
49
- track_progress: bool = False
50
- resume_from: str | None = None
51
- progress_file: str | None = None
52
-
53
- @classmethod
54
- @field_validator("publish", "bump", mode="before")
55
- def validate_bump_options(cls, value: str | None) -> BumpOption | None:
56
- if value is None:
57
- return None
58
- try:
59
- return BumpOption(value.lower())
60
- except ValueError:
61
- valid_options = ", ".join([o.value for o in BumpOption])
62
- raise ValueError(
63
- f"Invalid bump option: {value}. Must be one of: {valid_options}"
64
- )
65
-
66
-
67
- cli_options = {
68
- "commit": typer.Option(False, "-c", "--commit", help="Commit changes to Git."),
69
- "interactive": typer.Option(
70
- False,
71
- "-i",
72
- "--interactive",
73
- help="Use the interactive Rich UI for a better experience.",
74
- ),
75
- "no_config_updates": typer.Option(
76
- False, "-n", "--no-config-updates", help="Do not update configuration files."
77
- ),
78
- "update_precommit": typer.Option(
79
- False, "-u", "--update-precommit", help="Update pre-commit hooks."
80
- ),
81
- "update_docs": typer.Option(
82
- False,
83
- "--update-docs",
84
- help="Update CLAUDE.md and RULES.md with latest quality standards.",
85
- ),
86
- "force_update_docs": typer.Option(
87
- False,
88
- "--force-update-docs",
89
- help="Force update CLAUDE.md and RULES.md even if they exist.",
90
- ),
91
- "compress_docs": typer.Option(
92
- False,
93
- "--compress-docs",
94
- help="Automatically compress CLAUDE.md to optimize for Claude Code (enabled by default for other projects).",
95
- ),
96
- "verbose": typer.Option(False, "-v", "--verbose", help="Enable verbose output."),
97
- "publish": typer.Option(
98
- None,
99
- "-p",
100
- "--publish",
101
- help="Bump version and publish to PyPI (patch, minor, major).",
102
- case_sensitive=False,
103
- ),
104
- "bump": typer.Option(
105
- None,
106
- "-b",
107
- "--bump",
108
- help="Bump version (patch, minor, major).",
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 = cli_options["commit"],
197
- interactive: bool = cli_options["interactive"],
198
- no_config_updates: bool = cli_options["no_config_updates"],
199
- update_precommit: bool = cli_options["update_precommit"],
200
- update_docs: bool = cli_options["update_docs"],
201
- force_update_docs: bool = cli_options["force_update_docs"],
202
- compress_docs: bool = cli_options["compress_docs"],
203
- verbose: bool = cli_options["verbose"],
204
- publish: BumpOption | None = cli_options["publish"],
205
- all: BumpOption | None = cli_options["all"],
206
- bump: BumpOption | None = cli_options["bump"],
207
- clean: bool = cli_options["clean"],
208
- test: bool = cli_options["test"],
209
- benchmark: bool = cli_options["benchmark"],
210
- benchmark_regression: bool = cli_options["benchmark_regression"],
211
- benchmark_regression_threshold: float = cli_options[
212
- "benchmark_regression_threshold"
213
- ],
214
- test_workers: int = cli_options["test_workers"],
215
- test_timeout: int = cli_options["test_timeout"],
216
- skip_hooks: bool = cli_options["skip_hooks"],
217
- create_pr: bool = cli_options["create_pr"],
218
- ai_agent: bool = cli_options["ai_agent"],
219
- comprehensive: bool = cli_options["comprehensive"],
220
- async_mode: bool = cli_options["async_mode"],
221
- track_progress: bool = cli_options["track_progress"],
222
- resume_from: str | None = cli_options["resume_from"],
223
- progress_file: str | None = cli_options["progress_file"],
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 = Options(
226
- commit=commit,
227
- interactive=interactive,
228
- no_config_updates=no_config_updates,
229
- update_precommit=update_precommit,
230
- update_docs=update_docs,
231
- force_update_docs=force_update_docs,
232
- compress_docs=compress_docs,
233
- verbose=verbose,
234
- publish=publish,
235
- bump=bump,
236
- clean=clean,
237
- test=test,
238
- benchmark=benchmark,
239
- benchmark_regression=benchmark_regression,
240
- benchmark_regression_threshold=benchmark_regression_threshold,
241
- test_workers=test_workers,
242
- test_timeout=test_timeout,
243
- skip_hooks=skip_hooks,
244
- all=all,
245
- ai_agent=ai_agent,
246
- comprehensive=comprehensive,
247
- create_pr=create_pr,
248
- async_mode=async_mode,
249
- track_progress=track_progress,
250
- resume_from=resume_from,
251
- progress_file=progress_file,
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
- os.environ["AI_AGENT"] = "1"
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
- from .interactive import launch_interactive_cli
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
- pkg_version = version("crackerjack")
264
- except (ImportError, ModuleNotFoundError):
265
- pkg_version = "0.19.8"
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
+ ]