Skip to content

Commit eaa89da

Browse files
cursoragentechobt
andcommitted
fix(release): sync sdk 0.1.10 and splash chrome width
Keep @cortexlm/sdk on VERSION_CLI and use the full 40-col budget so v0.1.10 still shows the mid splash hints. Co-authored-by: Mathis <echobt@users.noreply.github.com>
1 parent 014f746 commit eaa89da

5 files changed

Lines changed: 82 additions & 13 deletions

File tree

packages/sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cortexlm/sdk",
3-
"version": "0.1.9",
3+
"version": "0.1.10",
44
"description": "Typed, local Cortex CLI subprocess client",
55
"license": "Apache-2.0",
66
"private": true,

scripts/bump-version.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,32 @@ else
248248
echo -e " ${GREEN}✓ Updated Cargo.toml${NC}"
249249
fi
250250

251+
# Keep the private SDK package version on VERSION_CLI (packages/sdk tests require it).
252+
SDK_PKG="$REPO_ROOT/packages/sdk/package.json"
253+
echo -e "${BLUE}Updating packages/sdk/package.json...${NC}"
254+
if [ "$DRY_RUN" = true ]; then
255+
echo " Would update version to \"$NEW_VERSION\" in $SDK_PKG"
256+
elif [ -f "$SDK_PKG" ]; then
257+
SDK_PKG_TMP=$(mktemp "${SDK_PKG}.tmp.XXXXXX")
258+
awk -v new_ver="$NEW_VERSION" '
259+
BEGIN { done = 0 }
260+
!done && /"version"[[:space:]]*:/ {
261+
sub(/"[0-9][^"]*"/, "\"" new_ver "\"")
262+
done = 1
263+
}
264+
{ print }
265+
' "$SDK_PKG" > "$SDK_PKG_TMP"
266+
if ! grep -q "\"version\": \"$NEW_VERSION\"" "$SDK_PKG_TMP"; then
267+
rm -f "$SDK_PKG_TMP"
268+
echo -e "${RED}ERROR: Failed to update version in packages/sdk/package.json${NC}"
269+
exit 1
270+
fi
271+
mv "$SDK_PKG_TMP" "$SDK_PKG"
272+
echo -e " ${GREEN}✓ Updated packages/sdk/package.json${NC}"
273+
else
274+
echo -e " ${YELLOW}⚠ packages/sdk/package.json not found — skipped${NC}"
275+
fi
276+
251277
echo ""
252278

253279
# Verify consistency

scripts/check-cli-version.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,18 @@ elif [ -n "$CLI_FILE_VERSION" ]; then
9494
echo -e "${GREEN}✓ VERSION_CLI matches src/cortex-cli/VERSION${NC}"
9595
fi
9696

97+
SDK_PKG="$REPO_ROOT/packages/sdk/package.json"
98+
if [ -f "$SDK_PKG" ]; then
99+
SDK_VERSION=$(grep -m1 '"version"' "$SDK_PKG" | sed 's/.*"\([^"]*\)".*/\1/')
100+
echo "packages/sdk/package.json: $SDK_VERSION"
101+
if [ "$VERSION_CLI" != "$SDK_VERSION" ]; then
102+
echo -e "${RED}ERROR: VERSION_CLI ($VERSION_CLI) does not match packages/sdk/package.json ($SDK_VERSION)${NC}"
103+
ERRORS=$((ERRORS + 1))
104+
else
105+
echo -e "${GREEN}✓ VERSION_CLI matches packages/sdk/package.json${NC}"
106+
fi
107+
fi
108+
97109
# Check against release version if provided (used in CI)
98110
if [ -n "$CLI_RELEASE_VERSION" ]; then
99111
echo ""

src/cortex-tui/src/lock_boards.rs

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -785,10 +785,27 @@ fn bar(filled: u16, total: u16) -> String {
785785
s
786786
}
787787

788+
/// Splash hint row: full, 40-col, or short — picked by character budget.
789+
/// Uses the full area width (not [`inner_width`]) so `v0.1.10` still fits
790+
/// the 40-column mid form `v{version} · / commands · @ files · ! shell`.
791+
pub(crate) fn splash_legend(version: &str, width: usize) -> String {
792+
let full_h = format!("v{version} · {LAUNCH_HINTS}");
793+
let mid_h = format!("v{version} · {LAUNCH_HINTS_NARROW}");
794+
if full_h.chars().count() <= width {
795+
full_h
796+
} else if mid_h.chars().count() <= width {
797+
mid_h
798+
} else {
799+
format!("v{version} · / commands")
800+
}
801+
}
802+
788803
/// Launch header: `Welcome to Cortex, the coding agent CLI` then
789804
/// `v{version} · / commands · …`. No fake `> cortex` or painted cwd.
790805
fn paint_launch_header(area: Rect, buf: &mut Buffer, full: bool) -> u16 {
791-
let w = inner_width(area);
806+
// Full terminal width: the 40-col lock is exactly the mid hint budget
807+
// once the package version is seven characters (`v0.1.10`).
808+
let w = area.width.max(1) as usize;
792809
let mut y = area.y;
793810
let dim = Style::default().fg(TEXT_DIM);
794811
let bold = Style::default().fg(TEXT).add_modifier(Modifier::BOLD);
@@ -797,16 +814,7 @@ fn paint_launch_header(area: Rect, buf: &mut Buffer, full: bool) -> u16 {
797814
buf.set_string(area.x + 17, y, ", the coding agent CLI", dim);
798815
y += 1;
799816
if full {
800-
let version = env!("CARGO_PKG_VERSION");
801-
let full_h = format!("v{version} · {LAUNCH_HINTS}");
802-
let mid_h = format!("v{version} · {LAUNCH_HINTS_NARROW}");
803-
let hints = if full_h.chars().count() <= w {
804-
full_h
805-
} else if mid_h.chars().count() <= w {
806-
mid_h
807-
} else {
808-
format!("v{version} · / commands")
809-
};
817+
let hints = splash_legend(env!("CARGO_PKG_VERSION"), w);
810818
buf.set_string(
811819
area.x,
812820
y,

src/cortex-tui/src/lock_proof.rs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2337,14 +2337,30 @@ mod tests {
23372337
);
23382338
}
23392339

2340+
#[test]
2341+
fn splash_legend_keeps_mid_hints_at_40_for_package_version() {
2342+
let version = env!("CARGO_PKG_VERSION");
2343+
let legend = crate::lock_boards::splash_legend(version, 40);
2344+
assert!(
2345+
legend.contains("/ commands · @ files · ! shell"),
2346+
"40-col splash must keep mid hints for v{version}: {legend}"
2347+
);
2348+
assert!(
2349+
!legend.contains("& cloud"),
2350+
"40-col splash shortens before & cloud: {legend}"
2351+
);
2352+
}
2353+
23402354
#[test]
23412355
fn splash_has_session_chrome() {
2356+
let version = env!("CARGO_PKG_VERSION");
2357+
let mid = format!("v{version} · / commands · @ files · ! shell");
23422358
for size in SIZES {
23432359
let frame = render_lock_scene("splash", size.0, size.1).expect("splash");
23442360
for needle in [
23452361
"Welcome to",
23462362
"the coding agent CLI",
2347-
"/ commands · @ files · ! shell",
2363+
"/ commands",
23482364
"Plan, search, build anything",
23492365
"Cortex Mini 1",
23502366
] {
@@ -2354,6 +2370,13 @@ mod tests {
23542370
frame.plain
23552371
);
23562372
}
2373+
if mid.chars().count() <= size.0 as usize {
2374+
assert!(
2375+
frame.plain.contains(&mid),
2376+
"splash missing mid chrome `{mid}` at {size:?}:\n{}",
2377+
frame.plain
2378+
);
2379+
}
23572380
assert!(!frame.plain.contains("▄█▀▀▀▀█▄"), "{}", frame.plain);
23582381
assert!(
23592382
!frame.plain.contains("> cortex"),

0 commit comments

Comments
 (0)