Bake go, node LTS and web tooling into the agent VM
The image is now ready for Go, Rust, Node and web projects: - Go comes from go.dev at the latest release, so GOTOOLCHAIN=auto can fetch the version a go.mod asks for. - Node is the current LTS from nodejs.org, with corepack for pnpm and yarn. - Rust gains rustfmt and clippy. - apt adds python-is-python3, chromium with fonts for headless web checks, cmake and sqlite3. The setup screen now marks the stage a failed bake stopped in. Co-Authored-By: Claude Opus 5.5
@@ -9,8 +9,8 @@ H=/home/cast
99 say stage 1 0
1010 apt-get update -q || fail "apt-get update failed"
1111 apt-get install -y -q --no-install-recommends \
12- build-essential pkg-config libssl-dev git curl wget ca-certificates unzip jq ripgrep \
13- python3 python3-pip python3-venv nodejs npm 2>&1 \
12+ build-essential pkg-config libssl-dev cmake git curl wget ca-certificates unzip xz-utils jq ripgrep sqlite3 \
13+ python3 python3-pip python3-venv python-is-python3 chromium fonts-liberation 2>&1 \
1414 | tee /dev/ttyS1 \
1515 | awk '/newly installed/ { n = $3 } /^(Get:|Unpacking |Setting up )/ { c++; if (n) { printf "CAST stage 1 %d\n", c * 100 / (3 * n); fflush() } }'
1616 [ "${PIPESTATUS[0]}" -eq 0 ] || fail "apt-get install failed"
@@ -18,10 +18,17 @@ say stage 1 100
1818
1919 say stage 2 0
2020 sudo -u cast -H bash -c 'curl -fsSL https://claude.ai/install.sh | bash' || fail "claude install failed"
21-say stage 2 35
21+say stage 2 20
2222 sudo -u cast -H bash -c 'curl -fsSL https://opencode.ai/install | bash' || fail "opencode install failed"
23-say stage 2 70
24-sudo -u cast -H bash -c 'curl -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal' || fail "rustup install failed"
23+say stage 2 40
24+sudo -u cast -H bash -c 'curl -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal -c rustfmt -c clippy' || fail "rust install failed"
25+say stage 2 60
26+GO=$(curl -fsSL 'https://go.dev/VERSION?m=text' | head -1) || fail "go version lookup failed"
27+curl -fsSL "https://go.dev/dl/$GO.linux-amd64.tar.gz" | tar -C /usr/local -xz || fail "go install failed"
28+say stage 2 80
29+NODE=$(curl -fsSL https://nodejs.org/dist/index.json | jq -r '[.[] | select(.lts)][0].version') || fail "node version lookup failed"
30+curl -fsSL "https://nodejs.org/dist/$NODE/node-$NODE-linux-x64.tar.xz" | tar -C /usr/local -xJ --strip-components 1 || fail "node install failed"
31+npm install -g -q corepack && corepack enable || fail "corepack install failed"
2532 say stage 2 100
2633
2734 say stage 3 0
@@ -154,7 +154,7 @@ pub fn view(s: &App, k: &Kit) -> El {
154154 let vm = col()
155155 .child(line(
156156 "Image",
157- "debian 13 cloud image + dev packages, claude, opencode, rustup",
157+ "debian 13 + dev packages, chromium, rust, go, node, claude, opencode",
158158 rebake,
159159 ))
160160 .child(line(
@@ -13,6 +13,14 @@ pub struct Setup {
1313 pub error: Option<String>,
1414 }
1515
16+#[derive(Debug, PartialEq)]
17+pub enum Row {
18+ Done,
19+ Active,
20+ Failed,
21+ Wait,
22+}
23+
1624 impl Setup {
1725 pub fn new() -> Setup {
1826 let done = files::is_baked();
@@ -46,6 +54,15 @@ impl Setup {
4654 }
4755 }
4856
57+ pub fn row(&self, i: usize) -> Row {
58+ match (self.pct[i], i == self.stage()) {
59+ (100, _) => Row::Done,
60+ (_, true) if self.running => Row::Active,
61+ (_, true) if self.error.is_some() => Row::Failed,
62+ _ => Row::Wait,
63+ }
64+ }
65+
4966 pub fn stage(&self) -> usize {
5067 self.pct
5168 .iter()
@@ -83,3 +100,28 @@ impl App {
83100 self.drop_machine();
84101 }
85102 }
103+
104+#[cfg(test)]
105+mod tests {
106+ use super::*;
107+
108+ #[test]
109+ fn a_failed_bake_marks_the_stage_it_stopped_in() {
110+ let mut s = Setup {
111+ show: true,
112+ pct: [0; 5],
113+ running: true,
114+ done: false,
115+ detail: String::new(),
116+ error: None,
117+ };
118+ s.apply(Progress::Stage(2, 80));
119+ assert_eq!(s.row(2), Row::Active);
120+ s.apply(Progress::Failed("corepack".into()));
121+ let rows: Vec<Row> = (0..5).map(|i| s.row(i)).collect();
122+ assert_eq!(
123+ rows,
124+ [Row::Done, Row::Done, Row::Failed, Row::Wait, Row::Wait]
125+ );
126+ }
127+}
@@ -1,5 +1,6 @@
11 use crate::app::App;
22 use crate::settings::view::{credentials, default_agent};
3+use crate::setup::Row;
34 use crate::ui::theme::{self, pal};
45 use crate::ui::widgets::{Kind, bar, btn, lbl, mono};
56 use crate::vm::bake::STAGES;
@@ -13,11 +14,12 @@ pub fn view(s: &App, k: &Kit) -> El {
1314 .gap(8.0)
1415 .children(STAGES.iter().enumerate().map(|(i, label)| {
1516 let pct = st.pct[i];
16- let active = st.running && i == st.stage();
17- let (glyph, color, right) = match (pct, active) {
18- (100, _) => ("✓", p.ok, "DONE".to_string()),
19- (_, true) => ("◐", p.accent, format!("{pct}%")),
20- _ => ("○", p.muted, "WAIT".to_string()),
17+ let active = st.row(i) == Row::Active;
18+ let (glyph, color, right) = match st.row(i) {
19+ Row::Done => ("✓", p.ok, "DONE".to_string()),
20+ Row::Active => ("◐", p.accent, format!("{pct}%")),
21+ Row::Failed => ("✕", p.red, "FAILED".to_string()),
22+ Row::Wait => ("○", p.muted, "WAIT".to_string()),
2123 };
2224 let head = row()
2325 .gap(8.0)
@@ -13,7 +13,7 @@ const PROVISION: &str = include_str!("../../assets/provision.sh");
1313 pub const STAGES: [&str; 5] = [
1414 "Download debian-13 cloud image",
1515 "Install dev packages",
16- "Install claude, opencode and rustup",
16+ "Install claude, opencode, rust, go and node",
1717 "Copy ~/.claude/CLAUDE.md + skills",
1818 "Mount working directory (9p)",
1919 ];
@@ -2,7 +2,7 @@ use crate::config::{CLAUDE_ENV, Config, OPENCODE_ENV};
22
33 pub fn render(cfg: &Config) -> String {
44 let mut out = String::from(
5- "export PATH=\"$HOME/.local/bin:$HOME/.opencode/bin:$HOME/.cargo/bin:$PATH\"\n",
5+ "export PATH=\"$HOME/.local/bin:$HOME/.opencode/bin:$HOME/.cargo/bin:/usr/local/go/bin:$HOME/go/bin:$PATH\"\n",
66 );
77 for (name, secret) in [
88 (CLAUDE_ENV, cfg.claude_token()),