Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 47 additions & 47 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ members = [
[workspace.package]
# CLI version - kept in sync with VERSION_CLI and src/cortex-cli/VERSION
# Run `scripts/check-cli-version.sh` to verify consistency
version = "0.1.9"
version = "0.1.10"
edition = "2024"
rust-version = "1.98"
authors = ["Cortex Team <team@cortex.foundation>"]
Expand Down
2 changes: 1 addition & 1 deletion VERSION_CLI
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.9
0.1.10
Comment thread
cursor[bot] marked this conversation as resolved.
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cortexlm/sdk",
"version": "0.1.9",
"version": "0.1.10",
"description": "Typed, local Cortex CLI subprocess client",
"license": "Apache-2.0",
"private": true,
Expand Down
26 changes: 26 additions & 0 deletions scripts/bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,32 @@ else
echo -e " ${GREEN}✓ Updated Cargo.toml${NC}"
fi

# Keep the private SDK package version on VERSION_CLI (packages/sdk tests require it).
SDK_PKG="$REPO_ROOT/packages/sdk/package.json"
echo -e "${BLUE}Updating packages/sdk/package.json...${NC}"
if [ "$DRY_RUN" = true ]; then
echo " Would update version to \"$NEW_VERSION\" in $SDK_PKG"
elif [ -f "$SDK_PKG" ]; then
SDK_PKG_TMP=$(mktemp "${SDK_PKG}.tmp.XXXXXX")
awk -v new_ver="$NEW_VERSION" '
BEGIN { done = 0 }
!done && /"version"[[:space:]]*:/ {
sub(/"[0-9][^"]*"/, "\"" new_ver "\"")
done = 1
}
{ print }
' "$SDK_PKG" > "$SDK_PKG_TMP"
if ! grep -q "\"version\": \"$NEW_VERSION\"" "$SDK_PKG_TMP"; then
rm -f "$SDK_PKG_TMP"
echo -e "${RED}ERROR: Failed to update version in packages/sdk/package.json${NC}"
exit 1
fi
mv "$SDK_PKG_TMP" "$SDK_PKG"
echo -e " ${GREEN}✓ Updated packages/sdk/package.json${NC}"
else
echo -e " ${YELLOW}⚠ packages/sdk/package.json not found — skipped${NC}"
fi

echo ""

# Verify consistency
Expand Down
12 changes: 12 additions & 0 deletions scripts/check-cli-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ elif [ -n "$CLI_FILE_VERSION" ]; then
echo -e "${GREEN}✓ VERSION_CLI matches src/cortex-cli/VERSION${NC}"
fi

SDK_PKG="$REPO_ROOT/packages/sdk/package.json"
if [ -f "$SDK_PKG" ]; then
SDK_VERSION=$(grep -m1 '"version"' "$SDK_PKG" | sed 's/.*"\([^"]*\)".*/\1/')
echo "packages/sdk/package.json: $SDK_VERSION"
if [ "$VERSION_CLI" != "$SDK_VERSION" ]; then
echo -e "${RED}ERROR: VERSION_CLI ($VERSION_CLI) does not match packages/sdk/package.json ($SDK_VERSION)${NC}"
ERRORS=$((ERRORS + 1))
else
echo -e "${GREEN}✓ VERSION_CLI matches packages/sdk/package.json${NC}"
fi
fi

# Check against release version if provided (used in CI)
if [ -n "$CLI_RELEASE_VERSION" ]; then
echo ""
Expand Down
2 changes: 1 addition & 1 deletion src/cortex-cli/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.9
0.1.10
30 changes: 19 additions & 11 deletions src/cortex-tui/src/lock_boards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,10 +785,27 @@ fn bar(filled: u16, total: u16) -> String {
s
}

/// Splash hint row: full, 40-col, or short — picked by character budget.
/// Uses the full area width (not [`inner_width`]) so `v0.1.10` still fits
/// the 40-column mid form `v{version} · / commands · @ files · ! shell`.
pub(crate) fn splash_legend(version: &str, width: usize) -> String {
let full_h = format!("v{version} · {LAUNCH_HINTS}");
let mid_h = format!("v{version} · {LAUNCH_HINTS_NARROW}");
if full_h.chars().count() <= width {
full_h
} else if mid_h.chars().count() <= width {
mid_h
} else {
format!("v{version} · / commands")
}
}

/// Launch header: `Welcome to Cortex, the coding agent CLI` then
/// `v{version} · / commands · …`. No fake `> cortex` or painted cwd.
fn paint_launch_header(area: Rect, buf: &mut Buffer, full: bool) -> u16 {
let w = inner_width(area);
// Full terminal width: the 40-col lock is exactly the mid hint budget
// once the package version is seven characters (`v0.1.10`).
let w = area.width.max(1) as usize;
let mut y = area.y;
let dim = Style::default().fg(TEXT_DIM);
let bold = Style::default().fg(TEXT).add_modifier(Modifier::BOLD);
Expand All @@ -797,16 +814,7 @@ fn paint_launch_header(area: Rect, buf: &mut Buffer, full: bool) -> u16 {
buf.set_string(area.x + 17, y, ", the coding agent CLI", dim);
y += 1;
if full {
let version = env!("CARGO_PKG_VERSION");
let full_h = format!("v{version} · {LAUNCH_HINTS}");
let mid_h = format!("v{version} · {LAUNCH_HINTS_NARROW}");
let hints = if full_h.chars().count() <= w {
full_h
} else if mid_h.chars().count() <= w {
mid_h
} else {
format!("v{version} · / commands")
};
let hints = splash_legend(env!("CARGO_PKG_VERSION"), w);
buf.set_string(
area.x,
y,
Expand Down
25 changes: 24 additions & 1 deletion src/cortex-tui/src/lock_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2337,14 +2337,30 @@ mod tests {
);
}

#[test]
fn splash_legend_keeps_mid_hints_at_40_for_package_version() {
let version = env!("CARGO_PKG_VERSION");
let legend = crate::lock_boards::splash_legend(version, 40);
assert!(
legend.contains("/ commands · @ files · ! shell"),
"40-col splash must keep mid hints for v{version}: {legend}"
);
assert!(
!legend.contains("& cloud"),
"40-col splash shortens before & cloud: {legend}"
);
}

#[test]
fn splash_has_session_chrome() {
let version = env!("CARGO_PKG_VERSION");
let mid = format!("v{version} · / commands · @ files · ! shell");
for size in SIZES {
let frame = render_lock_scene("splash", size.0, size.1).expect("splash");
for needle in [
"Welcome to",
"the coding agent CLI",
"/ commands · @ files · ! shell",
"/ commands",
"Plan, search, build anything",
"Cortex Mini 1",
] {
Expand All @@ -2354,6 +2370,13 @@ mod tests {
frame.plain
);
}
if mid.chars().count() <= size.0 as usize {
assert!(
frame.plain.contains(&mid),
"splash missing mid chrome `{mid}` at {size:?}:\n{}",
frame.plain
);
}
assert!(!frame.plain.contains("▄█▀▀▀▀█▄"), "{}", frame.plain);
assert!(
!frame.plain.contains("> cortex"),
Expand Down
Loading