Skip to content

Commit 3999e64

Browse files
committed
Merge origin/master and resolve conflicts
Keep Cortex naming convention, remove legacy FABRIC_ backward compatibility
2 parents 2475863 + eae1165 commit 3999e64

14 files changed

Lines changed: 1751 additions & 32 deletions

AMELIORATIONS.md

Lines changed: 740 additions & 0 deletions
Large diffs are not rendered by default.

Cargo.lock

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ toml_edit = "0.23"
242242
# CLI - Arguments
243243
clap = { version = "4", features = ["derive", "wrap_help", "env"] }
244244
clap_complete = "4"
245+
clap_mangen = "0.2"
245246

246247
# CLI - TUI
247248
ratatui = { version = "0.29", features = ["scrolling-regions", "unstable-backend-writer", "unstable-rendered-line-info", "unstable-widget-ref"] }

cortex-cli/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ workspace = true
2020
default = ["cortex-tui"]
2121
# Use the new Cortex TUI (120 FPS, Cortex theme)
2222
cortex-tui = ["dep:cortex-tui"]
23+
# Enable HTTP transport for MCP server
24+
mcp-http = ["cortex-mcp-server/http"]
2325

2426
[dependencies]
2527
cortex-engine = { workspace = true }
@@ -31,9 +33,11 @@ cortex-login = { workspace = true }
3133
cortex-process-hardening = { workspace = true }
3234
cortex-app-server = { workspace = true }
3335
cortex-update = { workspace = true }
36+
cortex-mcp-server = { workspace = true }
3437

3538
clap = { workspace = true }
3639
clap_complete = { workspace = true }
40+
clap_mangen = { workspace = true }
3741
tokio = { workspace = true, features = ["full"] }
3842
anyhow = { workspace = true }
3943
tracing = { workspace = true }
@@ -61,3 +65,6 @@ scraper = "0.22"
6165

6266
# For mDNS service discovery
6367
hostname = { workspace = true }
68+
69+
# For finding binary location in PATH
70+
which = { workspace = true }

cortex-cli/src/acp_cmd.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
use anyhow::Result;
77
use clap::Parser;
8+
use cortex_common::resolve_model_alias;
89
use std::net::SocketAddr;
910
use std::path::PathBuf;
1011

@@ -53,7 +54,8 @@ impl AcpCli {
5354
}
5455

5556
if let Some(model) = &self.model {
56-
config.model = model.clone();
57+
// Resolve model alias (e.g., "sonnet" -> "anthropic/claude-sonnet-4-20250514")
58+
config.model = resolve_model_alias(model).to_string();
5759
}
5860

5961
// Decide transport mode

cortex-cli/src/agent_cmd.rs

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,15 @@ async fn run_show(args: ShowArgs) -> Result<()> {
810810

811811
println!("Mode: {}", agent.mode);
812812
println!("Source: {}", agent.source);
813-
println!("Native: {}", agent.native);
813+
println!(
814+
"Native: {} ({})",
815+
if agent.native { "yes" } else { "no" },
816+
if agent.native {
817+
"built-in agent bundled with Cortex"
818+
} else {
819+
"user-defined agent"
820+
}
821+
);
814822
println!("Hidden: {}", agent.hidden);
815823
println!(
816824
"Can Delegate: {} ({})",
@@ -839,7 +847,9 @@ async fn run_show(args: ShowArgs) -> Result<()> {
839847
}
840848

841849
if let Some(ref color) = agent.color {
842-
println!("Color: {color}");
850+
// Display color with preview (colored block using ANSI escape codes)
851+
let color_preview = format_color_preview(color);
852+
println!("Color: {color} {color_preview}");
843853
}
844854

845855
if !agent.tags.is_empty() {
@@ -1512,6 +1522,30 @@ Provide architectural recommendations with:
15121522
- Implementation roadmap
15131523
"#;
15141524

1525+
/// Format a hex color as an ANSI-colored preview block.
1526+
///
1527+
/// Converts a hex color like "#FF5733" to an ANSI escape sequence that
1528+
/// displays a colored block (using true color if supported).
1529+
fn format_color_preview(hex_color: &str) -> String {
1530+
// Parse hex color (strip leading # if present)
1531+
let hex = hex_color.trim_start_matches('#');
1532+
1533+
// Only process valid 6-character hex colors
1534+
if hex.len() != 6 {
1535+
return String::new();
1536+
}
1537+
1538+
// Parse RGB components
1539+
let r = u8::from_str_radix(&hex[0..2], 16).unwrap_or(128);
1540+
let g = u8::from_str_radix(&hex[2..4], 16).unwrap_or(128);
1541+
let b = u8::from_str_radix(&hex[4..6], 16).unwrap_or(128);
1542+
1543+
// Create ANSI true color (24-bit) escape sequence for background
1544+
// Format: \x1b[48;2;R;G;Bm (background color)
1545+
// Use 2 space characters as the "block" with reset at end
1546+
format!("\x1b[48;2;{};{};{}m \x1b[0m", r, g, b)
1547+
}
1548+
15151549
#[cfg(test)]
15161550
mod tests {
15171551
use super::*;

0 commit comments

Comments
 (0)