Skip to content

Commit cee4d00

Browse files
authored
refactor: reorganize crate structure and split large modules (#536)
- Move all crates from root directories to src/ for centralized organization - Split large modules (>500 lines) into logical submodules for better maintainability - Refactored modules across multiple crates: - cortex-cli: split command modules (agent, dag, debug, mcp, scrape) - cortex-engine: split session, auth, commands, hooks, store, registry, edit_strategies - cortex-tui: split app, sessions, handlers, form, executor, actions, command_palette - cortex-core: split spinner, renderer, animation - cortex-gui: split formatter, settings, extensions, lsp, testing, dap modules - cortex-storage: split sessions module - cortex-mcp-server: split lib.rs into submodules - cortex-mcp-types: split lib.rs into submodules - cortex-execpolicy: split lib.rs into submodules - cortex-login: split lib.rs into submodules - cortex-app-server: split api and tools modules - cortex-protocol: split protocol module - cortex-plugins: split hooks module - cortex-common: split model_presets module - cortex-lsp: split client and downloader modules - cortex-compact: split auto_compaction module - Split utility modules (fs, git, remote, mcp-manager) - Fix security module exports and rename DoomLoopDetector - Implement cortex-utils-pty module with proper exports - Replace hardcoded values and TODO comments with proper documentation - Update include_str paths for relocated files
1 parent c311f77 commit cee4d00

12,408 files changed

Lines changed: 110829 additions & 109538 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 111 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -4,93 +4,93 @@ members = [
44
# ==========================================================================
55
# CLI Application
66
# ==========================================================================
7-
"cortex-cli",
8-
"cortex-engine",
9-
"cortex-protocol",
10-
"cortex-exec",
7+
"src/cortex-cli",
8+
"src/cortex-engine",
9+
"src/cortex-protocol",
10+
"src/cortex-exec",
1111

1212
# CLI - Security
13-
"cortex-execpolicy",
14-
"cortex-sandbox",
15-
"cortex-process-hardening",
16-
"cortex-linux-sandbox",
17-
"cortex-windows-sandbox",
13+
"src/cortex-execpolicy",
14+
"src/cortex-sandbox",
15+
"src/cortex-process-hardening",
16+
"src/cortex-linux-sandbox",
17+
"src/cortex-windows-sandbox",
1818

1919
# CLI - MCP
20-
"cortex-mcp-server",
21-
"cortex-mcp-types",
22-
"cortex-mcp-client",
20+
"src/cortex-mcp-server",
21+
"src/cortex-mcp-types",
22+
"src/cortex-mcp-client",
2323

2424
# CLI - Tools
25-
"cortex-apply-patch",
26-
"cortex-file-search",
27-
"cortex-common",
25+
"src/cortex-apply-patch",
26+
"src/cortex-file-search",
27+
"src/cortex-common",
2828

2929
# CLI - Storage
30-
"cortex-storage",
30+
"src/cortex-storage",
3131

3232
# CLI - Authentication
33-
"cortex-login",
34-
"cortex-keyring-store",
33+
"src/cortex-login",
34+
"src/cortex-keyring-store",
3535

3636
# CLI - Feedback & Telemetry
37-
"cortex-feedback",
38-
"cortex-otel",
37+
"src/cortex-feedback",
38+
"src/cortex-otel",
3939

4040
# CLI - Server
41-
"cortex-app-server",
41+
"src/cortex-app-server",
4242

4343
# CLI - Utilities
44-
"cortex-utils/git",
45-
"cortex-utils/pty",
46-
"cortex-utils/image",
47-
"cortex-utils/string",
48-
"cortex-utils/cache",
49-
"cortex-utils/file-safety",
44+
"src/cortex-utils/git",
45+
"src/cortex-utils/pty",
46+
"src/cortex-utils/image",
47+
"src/cortex-utils/string",
48+
"src/cortex-utils/cache",
49+
"src/cortex-utils/file-safety",
5050

5151
# CLI - Features (Phase 1)
52-
"cortex-lsp",
53-
"cortex-snapshot",
54-
"cortex-agents",
55-
"cortex-hooks",
56-
"cortex-share",
57-
"cortex-plugins",
58-
"cortex-batch",
52+
"src/cortex-lsp",
53+
"src/cortex-snapshot",
54+
"src/cortex-agents",
55+
"src/cortex-hooks",
56+
"src/cortex-share",
57+
"src/cortex-plugins",
58+
"src/cortex-batch",
5959

6060
# CLI - Features (Phase 2)
61-
"cortex-ghost",
62-
"cortex-review",
63-
"cortex-resume",
64-
"cortex-compact",
65-
"cortex-ratelimits",
66-
"cortex-migrations",
67-
"cortex-experimental",
68-
"cortex-commands",
69-
"cortex-skills",
70-
"cortex-prompt-harness",
61+
"src/cortex-ghost",
62+
"src/cortex-review",
63+
"src/cortex-resume",
64+
"src/cortex-compact",
65+
"src/cortex-ratelimits",
66+
"src/cortex-migrations",
67+
"src/cortex-experimental",
68+
"src/cortex-commands",
69+
"src/cortex-skills",
70+
"src/cortex-prompt-harness",
7171

7272
# CLI - Features (Phase 3 - Codex-inspired)
73-
"cortex-collab",
74-
"cortex-network-proxy",
75-
"cortex-shell-snapshot",
73+
"src/cortex-collab",
74+
"src/cortex-network-proxy",
75+
"src/cortex-shell-snapshot",
7676

7777
# CLI - Integrations
78-
"cortex-slack",
78+
"src/cortex-slack",
7979

8080
# CLI - LM Studio Integration
81-
"cortex-lmstudio",
81+
"src/cortex-lmstudio",
8282

8383
# CLI - Ollama Integration
84-
"cortex-ollama",
84+
"src/cortex-ollama",
8585

8686
# CLI - TUI
87-
"cortex-core",
88-
"cortex-tui",
89-
"cortex-tui-capture",
90-
"cortex-tui-components",
87+
"src/cortex-core",
88+
"src/cortex-tui",
89+
"src/cortex-tui-capture",
90+
"src/cortex-tui-components",
9191

9292
# CLI - Auto-Update
93-
"cortex-update",
93+
"src/cortex-update",
9494

9595
# CLI - OpenTUI Framework
9696
"opentui-rs",
@@ -106,7 +106,7 @@ members = [
106106
# ==========================================================================
107107
# Desktop Application (GUI) - Tauri
108108
# ==========================================================================
109-
"cortex-gui/src-tauri",
109+
"src/cortex-gui/src-tauri",
110110
]
111111

112112
[workspace.package]
@@ -176,65 +176,65 @@ once_cell = "1.19"
176176
# ==========================================================================
177177

178178
# CLI internal crates
179-
cortex-cli = { path = "cortex-cli" }
180-
cortex-engine = { path = "cortex-engine" }
181-
cortex-protocol = { path = "cortex-protocol" }
182-
cortex-exec = { path = "cortex-exec" }
183-
cortex-execpolicy = { path = "cortex-execpolicy" }
184-
cortex-sandbox = { path = "cortex-sandbox" }
185-
cortex-mcp-server = { path = "cortex-mcp-server" }
186-
cortex-mcp-types = { path = "cortex-mcp-types" }
187-
cortex-mcp-client = { path = "cortex-mcp-client" }
188-
cortex-apply-patch = { path = "cortex-apply-patch" }
189-
cortex-file-search = { path = "cortex-file-search" }
190-
cortex-common = { path = "cortex-common" }
191-
cortex-utils-git = { path = "cortex-utils/git" }
192-
cortex-utils-pty = { path = "cortex-utils/pty" }
193-
cortex-utils-image = { path = "cortex-utils/image" }
194-
cortex-utils-string = { path = "cortex-utils/string" }
195-
cortex-utils-cache = { path = "cortex-utils/cache" }
196-
cortex-utils-file-safety = { path = "cortex-utils/file-safety" }
197-
cortex-login = { path = "cortex-login" }
198-
cortex-keyring-store = { path = "cortex-keyring-store" }
199-
cortex-feedback = { path = "cortex-feedback" }
200-
cortex-otel = { path = "cortex-otel" }
201-
cortex-process-hardening = { path = "cortex-process-hardening" }
202-
cortex-app-server = { path = "cortex-app-server" }
203-
cortex-commands = { path = "cortex-commands" }
204-
cortex-storage = { path = "cortex-storage" }
205-
cortex-core = { path = "cortex-core" }
206-
cortex-tui = { path = "cortex-tui" }
207-
cortex-tui-capture = { path = "cortex-tui-capture" }
208-
cortex-tui-components = { path = "cortex-tui-components" }
209-
cortex-update = { path = "cortex-update" }
210-
cortex-lsp = { path = "cortex-lsp" }
211-
cortex-snapshot = { path = "cortex-snapshot" }
212-
cortex-agents = { path = "cortex-agents" }
213-
cortex-hooks = { path = "cortex-hooks" }
214-
cortex-share = { path = "cortex-share" }
215-
cortex-plugins = { path = "cortex-plugins" }
216-
cortex-batch = { path = "cortex-batch" }
217-
cortex-ghost = { path = "cortex-ghost" }
218-
cortex-review = { path = "cortex-review" }
219-
cortex-resume = { path = "cortex-resume" }
220-
cortex-compact = { path = "cortex-compact" }
221-
cortex-ratelimits = { path = "cortex-ratelimits" }
222-
cortex-migrations = { path = "cortex-migrations" }
223-
cortex-experimental = { path = "cortex-experimental" }
224-
cortex-linux-sandbox = { path = "cortex-linux-sandbox" }
225-
cortex-windows-sandbox = { path = "cortex-windows-sandbox" }
226-
cortex-lmstudio = { path = "cortex-lmstudio" }
227-
cortex-ollama = { path = "cortex-ollama" }
228-
cortex-skills = { path = "cortex-skills" }
229-
cortex-prompt-harness = { path = "cortex-prompt-harness" }
179+
cortex-cli = { path = "src/cortex-cli" }
180+
cortex-engine = { path = "src/cortex-engine" }
181+
cortex-protocol = { path = "src/cortex-protocol" }
182+
cortex-exec = { path = "src/cortex-exec" }
183+
cortex-execpolicy = { path = "src/cortex-execpolicy" }
184+
cortex-sandbox = { path = "src/cortex-sandbox" }
185+
cortex-mcp-server = { path = "src/cortex-mcp-server" }
186+
cortex-mcp-types = { path = "src/cortex-mcp-types" }
187+
cortex-mcp-client = { path = "src/cortex-mcp-client" }
188+
cortex-apply-patch = { path = "src/cortex-apply-patch" }
189+
cortex-file-search = { path = "src/cortex-file-search" }
190+
cortex-common = { path = "src/cortex-common" }
191+
cortex-utils-git = { path = "src/cortex-utils/git" }
192+
cortex-utils-pty = { path = "src/cortex-utils/pty" }
193+
cortex-utils-image = { path = "src/cortex-utils/image" }
194+
cortex-utils-string = { path = "src/cortex-utils/string" }
195+
cortex-utils-cache = { path = "src/cortex-utils/cache" }
196+
cortex-utils-file-safety = { path = "src/cortex-utils/file-safety" }
197+
cortex-login = { path = "src/cortex-login" }
198+
cortex-keyring-store = { path = "src/cortex-keyring-store" }
199+
cortex-feedback = { path = "src/cortex-feedback" }
200+
cortex-otel = { path = "src/cortex-otel" }
201+
cortex-process-hardening = { path = "src/cortex-process-hardening" }
202+
cortex-app-server = { path = "src/cortex-app-server" }
203+
cortex-commands = { path = "src/cortex-commands" }
204+
cortex-storage = { path = "src/cortex-storage" }
205+
cortex-core = { path = "src/cortex-core" }
206+
cortex-tui = { path = "src/cortex-tui" }
207+
cortex-tui-capture = { path = "src/cortex-tui-capture" }
208+
cortex-tui-components = { path = "src/cortex-tui-components" }
209+
cortex-update = { path = "src/cortex-update" }
210+
cortex-lsp = { path = "src/cortex-lsp" }
211+
cortex-snapshot = { path = "src/cortex-snapshot" }
212+
cortex-agents = { path = "src/cortex-agents" }
213+
cortex-hooks = { path = "src/cortex-hooks" }
214+
cortex-share = { path = "src/cortex-share" }
215+
cortex-plugins = { path = "src/cortex-plugins" }
216+
cortex-batch = { path = "src/cortex-batch" }
217+
cortex-ghost = { path = "src/cortex-ghost" }
218+
cortex-review = { path = "src/cortex-review" }
219+
cortex-resume = { path = "src/cortex-resume" }
220+
cortex-compact = { path = "src/cortex-compact" }
221+
cortex-ratelimits = { path = "src/cortex-ratelimits" }
222+
cortex-migrations = { path = "src/cortex-migrations" }
223+
cortex-experimental = { path = "src/cortex-experimental" }
224+
cortex-linux-sandbox = { path = "src/cortex-linux-sandbox" }
225+
cortex-windows-sandbox = { path = "src/cortex-windows-sandbox" }
226+
cortex-lmstudio = { path = "src/cortex-lmstudio" }
227+
cortex-ollama = { path = "src/cortex-ollama" }
228+
cortex-skills = { path = "src/cortex-skills" }
229+
cortex-prompt-harness = { path = "src/cortex-prompt-harness" }
230230

231231
# Phase 3 - Codex-inspired crates
232-
cortex-collab = { path = "cortex-collab" }
233-
cortex-network-proxy = { path = "cortex-network-proxy" }
234-
cortex-shell-snapshot = { path = "cortex-shell-snapshot" }
232+
cortex-collab = { path = "src/cortex-collab" }
233+
cortex-network-proxy = { path = "src/cortex-network-proxy" }
234+
cortex-shell-snapshot = { path = "src/cortex-shell-snapshot" }
235235

236236
# Integrations
237-
cortex-slack = { path = "cortex-slack" }
237+
cortex-slack = { path = "src/cortex-slack" }
238238

239239
# OpenTUI crates
240240
opentui = { path = "opentui-rs" }

0 commit comments

Comments
 (0)