Skip to content

Commit 8f839ec

Browse files
author
Factory Bot
committed
feat: Complete Skills and Multi-Agent system integration
- Integrate SkillsManager into Session with system prompt injection - Add ThreadManager global singleton (init/get/try_get functions) - Create SkillPicker widget for TUI with fuzzy search - Add skills_bridge for TUI-engine integration - Add comprehensive tests for ThreadManager (8 tests) - Add tests for SkillPicker (3 tests) Skills System: - SkillsManager loads skills per cwd with caching - Skills rendered in system prompt via progressive disclosure - detection and on-demand content loading Multi-Agent System: - ThreadManager with create/fork/switch/close operations - ThreadEvent broadcasting for UI updates - Thread state management with RwLock Windows Sandbox (10 modules): - winutil, env, cap, token, acl, audit - dpapi, identity, sandbox_users, process
1 parent c13186b commit 8f839ec

97 files changed

Lines changed: 21884 additions & 721 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.lock

Lines changed: 57 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# SYNTHESE EXECUTIVE: Codex vs Cortex CLI
2+
3+
## Verdict Global
4+
5+
| Aspect | Codex | Cortex | Verdict |
6+
|--------|-------|--------|---------|
7+
| **Core Engine** | Focused, API-centric | Feature-rich, extensible | Cortex +features, Codex +polish |
8+
| **TUI** | Markdown streaming, backtrack | 120 FPS, multi-provider | Different strengths |
9+
| **Sandboxing** | Windows complet | Linux/macOS OK, Windows incomplet | **Codex gagne** |
10+
| **MCP** | OAuth, protocol 2025-06-18 | Basique, protocol 2024-11-05 | **Codex gagne** |
11+
| **Skills/Plugins** | SKILL.md, $mentions, AGENTS.md | Plugins dynamiques, hooks | Different paradigms |
12+
| **SDK** | TypeScript complet | Editeurs (nvim, zed, jetbrains) | Different focus |
13+
| **Distribution** | NPM avec binaires | Direct binary, self-update | Codex +accessible |
14+
| **GUI Desktop** | Absent | Tauri + SolidJS | **Cortex gagne** |
15+
16+
---
17+
18+
## TOP 10 FONCTIONNALITES MANQUANTES (Priorite Critique)
19+
20+
| # | Fonctionnalite | Impact | Effort |
21+
|---|---------------|--------|--------|
22+
| 1 | **Windows Sandbox Complet** (ACL, env vars, audit) | Securite critique | Eleve |
23+
| 2 | **Skill Mentions ($skill_name)** | UX majeure | Moyen |
24+
| 3 | **AGENTS.md Hierarchique** | Personnalisation projet | Faible |
25+
| 4 | **OAuth 2.0 pour MCP** | Integration MCP servers | Moyen |
26+
| 5 | **Backtrack System (Undo)** | UX conversation | Moyen |
27+
| 6 | **Streaming Markdown** | UX visuelle | Moyen |
28+
| 7 | **File Search (@filename)** | Productivite | Moyen |
29+
| 8 | **Token Auto-Refresh** | Fiabilite | Faible |
30+
| 9 | **SDK TypeScript** | Ecosystem JS/TS | Eleve |
31+
| 10 | **exec-server MCP** | Interception syscall | Eleve |
32+
33+
---
34+
35+
## AVANTAGES UNIQUES DE CORTEX (A Conserver)
36+
37+
1. **GUI Desktop** - Application Tauri complete
38+
2. **Multi-Agent System** - 5 agents built-in, Agent Factory
39+
3. **Plugins Dynamiques** - Architecture extensible
40+
4. **Hook System** - Interception d'evenements
41+
5. **SDKs Editeurs** - Neovim, Zed, JetBrains
42+
6. **mDNS Discovery** - Decouverte reseau
43+
7. **REST API** - Accessible universellement
44+
8. **Browser Automation** - Playwright integre
45+
9. **Image Generation** - DALL-E integre
46+
10. **Undo/Redo** - Historique complet
47+
48+
---
49+
50+
## ROADMAP RECOMMANDEE
51+
52+
### Phase 1: Securite (Semaines 1-4)
53+
- [ ] Windows Sandbox complet (ACL, env vars)
54+
- [ ] Token auto-refresh
55+
- [ ] SSRF protection renforcee
56+
57+
### Phase 2: UX Core (Semaines 5-8)
58+
- [ ] Skill mentions ($skill_name)
59+
- [ ] AGENTS.md hierarchique
60+
- [ ] Backtrack system (Esc-Esc-Enter)
61+
- [ ] Streaming markdown
62+
63+
### Phase 3: Integrations (Semaines 9-12)
64+
- [ ] OAuth 2.0 pour MCP
65+
- [ ] Protocol MCP 2025-06-18
66+
- [ ] File search (@filename)
67+
- [ ] exec-server MCP
68+
69+
### Phase 4: Ecosystem (Semaines 13-16)
70+
- [ ] SDK TypeScript
71+
- [ ] Distribution NPM
72+
- [ ] VS Code extension
73+
74+
---
75+
76+
## FICHIERS DE CE DOSSIER
77+
78+
1. `00-SYNTHESE-EXECUTIVE.md` - Ce fichier
79+
2. `01-CORE-ENGINE-GAPS.md` - Fonctionnalites core manquantes
80+
3. `02-TUI-GAPS.md` - Fonctionnalites TUI manquantes
81+
4. `03-SANDBOX-GAPS.md` - Gaps sandboxing (CRITIQUE)
82+
5. `04-MCP-GAPS.md` - Gaps MCP
83+
6. `05-SKILLS-GAPS.md` - Skills vs Plugins
84+
7. `06-SDK-GAPS.md` - SDKs manquants
85+
8. `07-AUTH-GAPS.md` - Authentification
86+
9. `08-FULL-FEATURE-LIST.md` - Liste complete des ameliorations
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Core Engine: Fonctionnalites Manquantes
2+
3+
## Fonctionnalites Presentes dans Codex mais ABSENTES dans Cortex
4+
5+
### Critique
6+
7+
| Fonctionnalite | Description | Fichier Codex | Impact |
8+
|---------------|-------------|---------------|--------|
9+
| **ExecPolicy System** | Politique d'approbation basee sur regles `.rules` | `exec_policy.rs` (1284 lignes) | Securite |
10+
| **ThreadManager** | Gestion multi-thread/conversation avec broadcasting | `thread_manager.rs` | Architecture |
11+
| **Unified Exec (ConPTY)** | Terminal PTY avec allocation ConPTY | `unified_exec/` | Windows support |
12+
| **Remote Compaction** | Compaction cote serveur via API | `compact_remote.rs` | Performance |
13+
| **Agent Control** | `AgentControl`, `AgentStatus`, agents hierarchiques | `agent/` | Multi-agent |
14+
15+
### Haute Priorite
16+
17+
| Fonctionnalite | Description | Fichier Codex |
18+
|---------------|-------------|---------------|
19+
| **Collaboration Modes** | `wait_for_input`, modes collaboratifs | `collab.rs` (42KB) |
20+
| **MCP Resources** | Templates de ressources, lecture MCP | `handlers/mcp_resource.rs` (25KB) |
21+
| **Request User Input** | Outil pour questions mid-turn | `handlers/request_user_input.rs` |
22+
| **Models Manager** | Listing modeles, presets, providers | `models_manager/` |
23+
| **Turn Diff Tracker** | Tracking changements fichiers par turn | `turn_diff_tracker.rs` (31KB) |
24+
| **Shell Snapshot** | Capture/restore etat shell | `shell_snapshot.rs` (25KB) |
25+
| **Environment Context** | Info riche OS/shell/user | `environment_context.rs` |
26+
| **Connectors** | Integrations services externes | `connectors.rs` |
27+
28+
### Moyenne Priorite
29+
30+
| Fonctionnalite | Description |
31+
|---------------|-------------|
32+
| **User Notification** | Systeme d'alertes utilisateur |
33+
| **Codex Apps MCP** | `codex_apps_mcp` server pour ChatGPT |
34+
| **Test Sync Tool** | Utilitaire synchronisation tests |
35+
| **Plan Tool (different)** | Implementation differente |
36+
37+
## Differences d'Implementation Importantes
38+
39+
### Architecture Session
40+
41+
| Aspect | Cortex | Codex |
42+
|--------|--------|-------|
43+
| Orchestrateur principal | `Session` (1800 lignes) | `Codex` (5000+ lignes) |
44+
| Channels | `async_channel` (unbounded) | `async_channel` + `watch` |
45+
| Cancellation | `AtomicBool` flag | `CancellationToken` (tokio-util) |
46+
| Fork/Resume | Methodes directes | Via `ThreadManager` |
47+
48+
### Execution d'Outils
49+
50+
| Aspect | Cortex | Codex |
51+
|--------|--------|-------|
52+
| Shell tool | Local shell simple | Unified exec avec ConPTY |
53+
| Approval flow | In-session pending | `ExecPolicyManager` avec rules |
54+
| Streaming output | `ToolOutputChunk` enum | `StdoutStream` |
55+
| Parallel execution | Sequential en boucle | `ToolCallRuntime` parallel |
56+
57+
### Authentification
58+
59+
| Aspect | Cortex | Codex |
60+
|--------|--------|-------|
61+
| Storage | OS keyring + encrypted file | `AuthDotJson` + storage backend |
62+
| Token refresh | Manuel | Auto-refresh avec intervalle |
63+
| ChatGPT auth | Partiel | Full `AuthMode::ChatGPT` |
64+
| API key handling | `SecureApiKey` avec zeroization | Plain string avec masking |
65+
66+
## Recommandations d'Implementation
67+
68+
### 1. ExecPolicy System
69+
```rust
70+
// Ajouter cortex-execpolicy/src/rules.rs
71+
pub struct PrefixRule {
72+
pub pattern: PrefixPattern,
73+
pub decision: Decision, // Allow | Deny | Ask
74+
pub justification: Option<String>,
75+
}
76+
```
77+
78+
### 2. ThreadManager
79+
```rust
80+
// Ajouter cortex-engine/src/thread_manager.rs
81+
pub struct ThreadManager {
82+
threads: RwLock<HashMap<ThreadId, Arc<Thread>>>,
83+
created_tx: broadcast::Sender<ThreadId>,
84+
}
85+
```
86+
87+
### 3. Unified Exec
88+
- Porter `codex-rs/core/src/unified_exec/` vers Cortex
89+
- Implementer ConPTY pour Windows
90+
- Ajouter `spawn_pty_process()`

0 commit comments

Comments
 (0)