@moondeck/station 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@
9
9
  #
10
10
  # Design points:
11
11
  # - Debian bookworm-slim base, non-root `node` user (home /home/node).
12
- # - asdf at /opt/asdf with plugins for nodejs/python/golang/ruby/rust.
12
+ # - asdf at /opt/asdf with plugins for nodejs/python/golang/ruby/rust/bun.
13
13
  # Before Compose starts a task, a host-controlled maintenance container
14
14
  # materializes its declared versions into the host-wide /opt/asdf-data
15
15
  # volume. uai-init only installs task-local dependencies afterward.
@@ -29,6 +29,8 @@ FROM debian:bookworm-slim
29
29
 
30
30
  # asdf release to clone. Pinned for reproducible builds; bump deliberately.
31
31
  ENV ASDF_VERSION=v0.14.1
32
+ ENV ASDF_BUN_PLUGIN_COMMIT=804d9603c473ea616fa078f851fa8380246e2c7a
33
+ ENV MISE_VERSION=2026.11.1
32
34
 
33
35
  # Qualified agent builds. These are execution-contract pins: per-command env
34
36
  # freshness is requalified before any of them moves.
@@ -74,6 +76,7 @@ RUN apt-get update \
74
76
  procps \
75
77
  python3-minimal \
76
78
  ripgrep \
79
+ sqlite3 \
77
80
  tk-dev \
78
81
  tmux \
79
82
  unzip \
@@ -112,6 +115,30 @@ RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
112
115
  # Installed system-wide so both root and node can run it.
113
116
  RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=/usr/local/bin sh
114
117
 
118
+ # mise is opt-in: install its binary on the system PATH, with no activation
119
+ # hook or mise shims. asdf shims retain priority for every managed runtime.
120
+ # Published hashes: https://github.com/jdx/mise/releases/download/v2026.11.1/SHASUMS256.txt
121
+ RUN set -eu; \
122
+ case "$(dpkg --print-architecture)" in \
123
+ amd64) mise_arch=x64; mise_sha256=9c3f740597f5e5815ecb50ec6fafa080e94472d0780220bcb214eb98bd902dca ;; \
124
+ arm64) mise_arch=arm64; mise_sha256=6b54d9223f8bce04f9168ef482d9ee27f219c1ea11f4903569660049e5dec5aa ;; \
125
+ *) echo "unsupported mise architecture" >&2; exit 1 ;; \
126
+ esac; \
127
+ curl -fsSL "https://github.com/jdx/mise/releases/download/v${MISE_VERSION}/mise-v${MISE_VERSION}-linux-${mise_arch}.tar.gz" -o /tmp/mise.tar.gz; \
128
+ echo "$mise_sha256 /tmp/mise.tar.gz" | sha256sum -c -; \
129
+ tar -xzf /tmp/mise.tar.gz -C /tmp mise/bin/mise; \
130
+ install -m 0755 /tmp/mise/bin/mise /usr/local/bin/mise; \
131
+ rm -rf /tmp/mise /tmp/mise.tar.gz; \
132
+ mise --version
133
+
134
+ # Keep an image-local pinned Bun plugin for volumes created before Bun support.
135
+ # Give node ownership so Git permits its local clone (safe-directory ownership
136
+ # checks reject a root-owned source). Apple task edits affect only its overlay.
137
+ RUN git clone https://github.com/cometkim/asdf-bun.git /usr/local/share/uai/asdf-bun \
138
+ && git -C /usr/local/share/uai/asdf-bun checkout --detach "$ASDF_BUN_PLUGIN_COMMIT" \
139
+ && test "$(git -C /usr/local/share/uai/asdf-bun rev-parse HEAD)" = "$ASDF_BUN_PLUGIN_COMMIT" \
140
+ && chown -R 1000:1000 /usr/local/share/uai/asdf-bun
141
+
115
142
  # ---------------------------------------------------------------------------
116
143
  # 2. Non-root `node` user.
117
144
  #
@@ -232,6 +259,7 @@ RUN bash -lc '\
232
259
  asdf plugin add golang https://github.com/asdf-community/asdf-golang.git; \
233
260
  asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git; \
234
261
  asdf plugin add rust https://github.com/asdf-community/asdf-rust.git; \
262
+ asdf plugin add bun /usr/local/share/uai/asdf-bun; \
235
263
  cd /home/node && asdf install nodejs && asdf install python; \
236
264
  '
237
265
 
@@ -14,11 +14,16 @@ See [`docs/runtime.md`](../../../docs/runtime.md) for the authoritative spec.
14
14
  expect `/home/node`.
15
15
  - **asdf** at `/opt/asdf`, data dir `/opt/asdf-data` (the host-wide
16
16
  `moondeck-asdf-data` volume mounts there read-only in task apps). Plugins
17
- pre-added for `nodejs`, `python`, `golang`, `ruby`, `rust`. Only the root
18
- defaults are installed at build time; after worktree resolution, a
17
+ pre-added for `nodejs`, `python`, `golang`, `ruby`, `rust`, `bun` (pinned
18
+ plugin). Only the root defaults are installed at build time; after worktree resolution, a
19
19
  host-controlled pre-start maintenance container is the bounded, locked
20
20
  read-write user that installs and proves other versions before the task app
21
21
  exists.
22
+ - **mise** 2026.11.1 at `/usr/local/bin/mise`, checksum-verified for amd64/arm64.
23
+ It is not activated globally and adds no shims ahead of asdf. Use
24
+ `mise install <tool>@<version>`, then `mise exec -- <cmd>` for skipped tools;
25
+ repositories with `mise.toml` need `mise trust` first.
26
+ - **sqlite3**, the Debian command-line client, alongside `libsqlite3-dev`.
22
27
  - **Default `~/.tool-versions`** (asdf's global fallback, at `/home/node`)
23
28
  pinning a default Node + Python. The `tool-versions` file in this directory is
24
29
  the authoritative source for the numbers; the `Dockerfile` `COPY`s it to
@@ -99,6 +99,7 @@ export ASDF_PYTHON_VERSION=
99
99
  export ASDF_GOLANG_VERSION=
100
100
  export ASDF_RUBY_VERSION=
101
101
  export ASDF_RUST_VERSION=
102
+ export ASDF_BUN_VERSION=
102
103
  export ASDF_SKIP_RESHIM=1
103
104
  export COREPACK_HOME=/opt/asdf-data/corepack
104
105
  export COREPACK_DEFAULT_TO_LATEST=0
@@ -507,6 +508,49 @@ run_workspace_installs() {
507
508
  return 0
508
509
  }
509
510
 
511
+ # Synchronous, bounded runtime notes, separate from repository install output.
512
+ # Materialization has a read-only workspace and can only log to Station.
513
+ # Read only safe allowlisted worktrees; never discover extra runtime inputs.
514
+ log_skipped_runtime_tools() {
515
+ local slug manifest line tool shown hint count=0
516
+ local notes_file="$deps_state_dir/runtime-notes" staging
517
+ local -a fields=()
518
+ local -A seen=()
519
+ staging=$(mktemp "$deps_state_dir/.runtime-notes.XXXXXX") || return 0
520
+ # At most 16 entries, each with a 64-character slug and a 128-character
521
+ # tool name: under 8 KiB, regardless of repository install output or reruns.
522
+ while IFS= read -r slug || [ -n "$slug" ]; do
523
+ [[ "$slug" =~ ^[a-z0-9-]{1,64}$ ]] || continue
524
+ [ ! -L "$WORKSPACE/$slug" ] && [ -d "$WORKSPACE/$slug" ] || continue
525
+ manifest="$WORKSPACE/$slug/.tool-versions"
526
+ [ ! -L "$manifest" ] && [ -f "$manifest" ] || continue
527
+ while IFS= read -r line || [ -n "$line" ]; do
528
+ line=${line%%#*}
529
+ read -r -a fields <<< "$line" || true
530
+ [ "${#fields[@]}" -ge 2 ] || continue
531
+ tool=${fields[0]}
532
+ [[ "$tool" =~ ^[a-z0-9][a-z0-9_-]*$ ]] || continue
533
+ case "$tool" in
534
+ nodejs|python|golang|ruby|rust|bun|pnpm|yarn) continue ;;
535
+ esac
536
+ [ -z "${seen[$slug/$tool]:-}" ] || continue
537
+ seen[$slug/$tool]=1
538
+ shown=${tool:0:128}
539
+ [ "${#tool}" -le 128 ] || shown="$shown..."
540
+ hint=""
541
+ case "$tool" in node) hint=" Did you mean nodejs?" ;; go) hint=" Did you mean golang?" ;; esac
542
+ printf '%s\n' "$slug: skipped unsupported tool '$shown'; use mise install <tool>@<version>, then mise exec -- <cmd> (or its vendor installer).$hint" >>"$staging"
543
+ count=$((count + 1))
544
+ [ "$count" -lt 16 ] || break 2
545
+ done < "$manifest"
546
+ done < "$RUNTIME_PROJECTS"
547
+ if [ -s "$staging" ]; then
548
+ mv -fT -- "$staging" "$notes_file"
549
+ else
550
+ rm -f -- "$staging" "$notes_file"
551
+ fi
552
+ }
553
+
510
554
  # The detached worker is the only uai-init role that receives project env.
511
555
  # Its caller has already used uai-env-exec to perform one authenticated
512
556
  # refresh; this role does no editor or Git-control-plane work and exits after
@@ -526,6 +570,7 @@ if [ -d "$WORKSPACE" ] && [ -f "$RUNTIME_PROJECTS" ] \
526
570
  deps_log_file="$deps_state_dir/deps.log"
527
571
  deps_lock_dir="$deps_state_dir/deps.lock.d"
528
572
  mkdir -p "$deps_state_dir"
573
+ log_skipped_runtime_tools
529
574
 
530
575
  # One runner at a time. uai-init is re-runnable (task-up retry, recovery),
531
576
  # and each re-run SHOULD refresh dependencies — but never concurrently.
@@ -27,6 +27,9 @@ readonly PROJECT_ALLOWLIST=/run/uai/runtime-projects
27
27
  readonly COREPACK_VERSION_FILE=/usr/local/share/uai/corepack-version
28
28
  readonly ASDF_SH=/opt/asdf/asdf.sh
29
29
  readonly ASDF_DATA=/opt/asdf-data
30
+ # Pin bumps rely on ensure_bun_plugin replacing older cached checkouts under
31
+ # the maintenance lock; verify-only must escalate rather than mutate them.
32
+ readonly BUN_PLUGIN_COMMIT=804d9603c473ea616fa078f851fa8380246e2c7a
30
33
  readonly LOCK_PATH="$ASDF_DATA/.uai-maintenance.lock"
31
34
  readonly CONTROL_PATH=/opt/asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
32
35
  readonly APP_PATH="$ASDF_DATA/shims:$CONTROL_PATH"
@@ -249,6 +252,13 @@ validate_version() {
249
252
  reject_dot_segments "$version" "$manifest" "$line_number"
250
253
  }
251
254
 
255
+ supported_runtime() {
256
+ case "$1" in
257
+ nodejs|python|golang|ruby|rust|bun) return 0 ;;
258
+ *) return 1 ;;
259
+ esac
260
+ }
261
+
252
262
  # Parse and validate the complete manifest before passing any field to asdf.
253
263
  # ASDF remains the resolution authority; this parser only rejects shapes that
254
264
  # are ambiguous or could be interpreted as command/path injection.
@@ -277,7 +287,7 @@ validate_manifest() {
277
287
  [[ "$tool" =~ ^[a-z0-9][a-z0-9_-]*$ ]] \
278
288
  || fail "$manifest:$line_number has a malformed tool name '$tool'"
279
289
  case "$tool" in
280
- nodejs|python|golang|ruby|rust) ;;
290
+ nodejs|python|golang|ruby|rust|bun) ;;
281
291
  pnpm|yarn)
282
292
  # Not asdf plugins here: package managers are Corepack's domain
283
293
  # (live 2026-08-17 — the asdf-pnpm convention is common enough that
@@ -288,7 +298,7 @@ validate_manifest() {
288
298
  [[ "${fields[1]}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]] \
289
299
  || fail "$manifest:$line_number must pin an exact $tool version (Corepack manages package managers)"
290
300
  ;;
291
- *) fail "$manifest:$line_number requests unsupported asdf plugin '$tool'" ;;
301
+ *) ;; # Valid unknown tools are ignored after full syntax validation.
292
302
  esac
293
303
  [ -z "${seen_tools[$tool]:-}" ] \
294
304
  || fail "$manifest:$line_number declares '$tool' more than once"
@@ -339,7 +349,7 @@ unset_tool_override() {
339
349
  unset "$variable"
340
350
  }
341
351
 
342
- for baked_tool in nodejs python golang ruby rust; do
352
+ for baked_tool in nodejs python golang ruby rust bun; do
343
353
  unset_tool_override "$baked_tool"
344
354
  done
345
355
 
@@ -416,6 +426,7 @@ tool_executable() {
416
426
  golang) printf go ;;
417
427
  ruby) printf ruby ;;
418
428
  rust) printf rustc ;;
429
+ bun) printf bun ;;
419
430
  *) return 1 ;;
420
431
  esac
421
432
  }
@@ -541,6 +552,10 @@ normalize_tool_version_output() {
541
552
  [[ "$output" =~ ^rustc[[:space:]]+([^[:space:]]+) ]] || return 1
542
553
  NORMALIZED_TOOL_VERSION=${BASH_REMATCH[1]}
543
554
  ;;
555
+ bun)
556
+ [[ "$output" =~ ^([0-9]+\.[0-9]+\.[0-9]+)([[:space:]]|$) ]] || return 1
557
+ NORMALIZED_TOOL_VERSION=${BASH_REMATCH[1]}
558
+ ;;
544
559
  *) return 1 ;;
545
560
  esac
546
561
  }
@@ -560,7 +575,7 @@ tool_selection_requires_exact_output() {
560
575
  ruby)
561
576
  [[ "$version" =~ ^${numeric}(-(preview|rc)[0-9]+)?$ ]]
562
577
  ;;
563
- golang|rust)
578
+ golang|rust|bun)
564
579
  [[ "$version" =~ ^${numeric}$ ]]
565
580
  ;;
566
581
  *) return 1 ;;
@@ -674,7 +689,7 @@ managed_install_location() {
674
689
  local root lexical_root real_root candidate lexical_candidate real_candidate
675
690
 
676
691
  case "$tool" in
677
- nodejs|python|golang|ruby|rust) ;;
692
+ nodejs|python|golang|ruby|rust|bun) ;;
678
693
  *) fail "refusing to repair unsupported asdf plugin '$tool'" ;;
679
694
  esac
680
695
  case "$version" in
@@ -1066,8 +1081,84 @@ prepare_package_manager() {
1066
1081
  }
1067
1082
  # END UAI_MANAGED_COREPACK_REPAIR
1068
1083
 
1084
+ # An interrupted clone can have HEAD/bin but lack lib files or a full checkout.
1085
+ # Every validation operation is read-only, including Git's optional lock policy.
1086
+ bun_plugin_is_valid() {
1087
+ local plugin=$1 head
1088
+ BUN_PLUGIN_ERROR="bun plugin is incomplete at $plugin (needs .git, bin/download, bin/install, lib/utils.bash and lib/semver.bash)"
1089
+ [ ! -L "$plugin" ] && [ -d "$plugin/.git" ] && [ ! -L "$plugin/.git" ] \
1090
+ && [ -f "$plugin/bin/download" ] && [ -x "$plugin/bin/download" ] \
1091
+ && [ -f "$plugin/bin/install" ] && [ -x "$plugin/bin/install" ] \
1092
+ && [ -f "$plugin/lib/utils.bash" ] && [ -r "$plugin/lib/utils.bash" ] \
1093
+ && [ -f "$plugin/lib/semver.bash" ] && [ -r "$plugin/lib/semver.bash" ] \
1094
+ || return 1
1095
+ BUN_PLUGIN_ERROR="bun plugin commit cannot be verified at $plugin"
1096
+ head=$(GIT_OPTIONAL_LOCKS=0 git -C "$plugin" rev-parse HEAD 2>/dev/null) || return 1
1097
+ BUN_PLUGIN_ERROR="bun plugin commit mismatch at $plugin (expected $BUN_PLUGIN_COMMIT)"
1098
+ [ "$head" = "$BUN_PLUGIN_COMMIT" ] || return 1
1099
+ BUN_PLUGIN_ERROR="bun plugin checkout is dirty or incomplete at $plugin"
1100
+ GIT_OPTIONAL_LOCKS=0 git -c core.fsmonitor=false -C "$plugin" diff --quiet HEAD -- \
1101
+ || return 1
1102
+ BUN_PLUGIN_ERROR=""
1103
+ }
1104
+
1105
+ ensure_bun_plugin() {
1106
+ local plugins_root="$ASDF_DATA/plugins" plugin="$ASDF_DATA/plugins/bun" lexical resolved
1107
+ if bun_plugin_is_valid "$plugin"; then return 0; fi
1108
+ [ "$VERIFY_ONLY" != 1 ] \
1109
+ || fail "$BUN_PLUGIN_ERROR; verify-only pass makes no installs or repairs; retry with a writable maintenance pass"
1110
+ [ -d /usr/local/share/uai/asdf-bun ] \
1111
+ || fail "bun needs an updated standard image with the pinned asdf-bun plugin"
1112
+ # Keep all rename/delete targets in this exact real plugins directory, never
1113
+ # through an existing symlink. The caller already holds the maintenance lock.
1114
+ [ ! -L "$plugins_root" ] && [ -d "$plugins_root" ] \
1115
+ || fail "shared asdf plugins root is not a real directory"
1116
+ lexical=$("$REALPATH_BIN" -m -s -- "$plugins_root") \
1117
+ || fail "could not normalize shared asdf plugins root"
1118
+ resolved=$("$REALPATH_BIN" -e -- "$plugins_root") \
1119
+ || fail "could not resolve shared asdf plugins root"
1120
+ [ "$lexical" = "$resolved" ] \
1121
+ || fail "shared asdf plugins root traverses a symbolic link"
1122
+ log "$BUN_PLUGIN_ERROR; replacing bun plugin from the pinned image copy"
1123
+ (
1124
+ # asdf ignores dot directories. Clone/validate in staging even on the first
1125
+ # seed, so a killed clone cannot publish a half-written plugins/bun.
1126
+ staging=$(mktemp -d "$plugins_root/.bun-replace.XXXXXX") \
1127
+ || fail "could not stage bun plugin replacement"
1128
+ promoted=0
1129
+ cleanup_bun_replacement() {
1130
+ local status=$?
1131
+ trap - EXIT HUP INT TERM
1132
+ if [ "$promoted" != 1 ] && { [ -e "$staging/old" ] || [ -L "$staging/old" ]; }; then
1133
+ if [ -e "$plugin" ] || [ -L "$plugin" ] \
1134
+ || ! mv -T -- "$staging/old" "$plugin"; then
1135
+ log "could not restore old bun plugin; preserved at $staging/old"
1136
+ return 1
1137
+ fi
1138
+ fi
1139
+ if ! "$RM_BIN" -rf --one-file-system -- "$staging"; then
1140
+ log "could not remove bun plugin staging directory $staging"
1141
+ exit 1
1142
+ fi
1143
+ return "$status"
1144
+ }
1145
+ trap cleanup_bun_replacement EXIT
1146
+ trap 'exit 129' HUP
1147
+ trap 'exit 130' INT
1148
+ trap 'exit 143' TERM
1149
+ git clone --quiet -- /usr/local/share/uai/asdf-bun "$staging/new" \
1150
+ || fail "could not clone the image's bun plugin"
1151
+ bun_plugin_is_valid "$staging/new" || fail "$BUN_PLUGIN_ERROR"
1152
+ if [ -e "$plugin" ] || [ -L "$plugin" ]; then
1153
+ mv -T -- "$plugin" "$staging/old" || fail "could not move old bun plugin aside"
1154
+ fi
1155
+ mv -T -- "$staging/new" "$plugin" || fail "could not publish the validated bun plugin"
1156
+ promoted=1
1157
+ ) || fail "bun plugin replacement failed; retry runtime materialization"
1158
+ }
1159
+
1069
1160
  materialize_manifest() {
1070
- local manifest=$1 project line tool version line_number=0
1161
+ local manifest=$1 project line tool version hint line_number=0
1071
1162
  local -a fields=()
1072
1163
 
1073
1164
  project=$(dirname "$manifest")
@@ -1082,7 +1173,15 @@ materialize_manifest() {
1082
1173
  case "$tool" in
1083
1174
  pnpm|yarn) continue ;; # Corepack-managed; see project_package_manager.
1084
1175
  esac
1176
+ if ! supported_runtime "$tool"; then
1177
+ hint=""
1178
+ case "$tool" in node) hint=" Did you mean nodejs?" ;; go) hint=" Did you mean golang?" ;; esac
1179
+ log "$manifest:$line_number: skipped unsupported tool '$tool'; use mise install <tool>@<version>, then mise exec -- <cmd> (or its vendor installer).$hint"
1180
+ continue
1181
+ fi
1085
1182
  unset_tool_override "$tool"
1183
+ # Seed only this allowlisted plugin under the existing maintenance lock.
1184
+ [ "$tool" != bun ] || ensure_bun_plugin
1086
1185
  asdf plugin list | grep -Fqx -- "$tool" \
1087
1186
  || fail "$manifest:$line_number requests unsupported asdf plugin '$tool'"
1088
1187
 
@@ -1156,9 +1255,11 @@ materialize_fallback_runtimes() {
1156
1255
  [ -n "$line" ] || continue
1157
1256
  read -r -a fields <<< "$line"
1158
1257
  tool=${fields[0]}
1258
+ supported_runtime "$tool" || continue
1159
1259
  if manifest_declares_tool "$manifest" "$tool"; then
1160
1260
  continue
1161
1261
  fi
1262
+ [ "$tool" != bun ] || ensure_bun_plugin
1162
1263
  asdf plugin list | grep -Fqx -- "$tool" \
1163
1264
  || fail "$defaults requests unavailable fallback plugin '$tool'"
1164
1265
  for version in "${fields[@]:1}"; do
@@ -1345,6 +1446,7 @@ prove_fallback_runtimes() {
1345
1446
  [ -n "$line" ] || continue
1346
1447
  read -r -a fields <<< "$line"
1347
1448
  tool=${fields[0]}
1449
+ supported_runtime "$tool" || continue
1348
1450
  if manifest_declares_tool "$manifest" "$tool"; then
1349
1451
  continue
1350
1452
  fi
@@ -1508,6 +1610,7 @@ for manifest in "${manifests[@]}"; do
1508
1610
  case "${fields[0]}" in
1509
1611
  pnpm|yarn) continue ;; # proven via prove_project_package_manager below
1510
1612
  esac
1613
+ supported_runtime "${fields[0]}" || continue
1511
1614
  unset_tool_override "${fields[0]}"
1512
1615
  for version in "${fields[@]:1}"; do
1513
1616
  prove_selection "${fields[0]}" "$version" "$project" "$manifest"
package/lib/agent-cli.ts CHANGED
@@ -1288,7 +1288,7 @@ async function main() {
1288
1288
  ? await api("POST", "/api/agent/previews", { name, containerPort: port, ...upstream })
1289
1289
  : await api("PATCH", "/api/agent/previews/" + encodeURIComponent(name), { containerPort: port, ...upstream });
1290
1290
  out("preview '" + r.name + "' on port " + r.containerPort + (action === "add" ? " — turn it on with: moondeck preview enable " + r.name : " — updated"));
1291
- if (upstream.upstreamHost || upstream.upstreamTls) console.error("Portless users: outside self tasks, start with portless proxy start --lan (or PORTLESS_LAN=1; enables mDNS). Check for LAN mode disabled; if printed, use an updated Moondeck image with avahi-utils, or ask the operator to install it and fix any reported LAN-IP problem, then restart. Use its printed LAN hostname (usually mta.local) and proxy port: HTTPS 443, HTTP 80, or your explicit -p port (e.g. 1355).");
1291
+ if (upstream.upstreamHost || upstream.upstreamTls) console.error("Portless users: use Portless >= 0.16 (no sudo needed for ports >= 80). Outside self tasks, start with portless proxy start --lan (or PORTLESS_LAN=1; enables mDNS). Check for LAN mode disabled; if printed, use an updated Moondeck image with avahi-utils, or ask the operator to install it and fix any reported LAN-IP problem, then restart. Use its printed LAN hostname (usually mta.local) and proxy port: HTTPS 443, HTTP 80, or your explicit -p port (e.g. 1355).");
1292
1292
  break;
1293
1293
  }
1294
1294
  case "preview remove": {
@@ -1486,7 +1486,7 @@ async function main() {
1486
1486
  " moondeck preview add <name> <containerPort> [--upstream-host <h>] [--https]",
1487
1487
  " moondeck preview update <name> <containerPort> [--upstream-host <h>] [--https]",
1488
1488
  " moondeck preview remove <name>",
1489
- " Portless outside self: portless proxy start --lan or PORTLESS_LAN=1 (mDNS); use printed *.local Host and proxy port 443/80, or explicit -p 1355. Check for LAN mode disabled; update the image/install avahi-utils and resolve the reported LAN issue, then restart.",
1489
+ " Portless >= 0.16 (no sudo for ports >= 80), outside self: portless proxy start --lan or PORTLESS_LAN=1 (mDNS); use printed *.local Host and proxy port 443/80, or explicit -p 1355. Check for LAN mode disabled; update the image/install avahi-utils and resolve the reported LAN issue, then restart.",
1490
1490
  " moondeck preview enable|disable <name> (turn it on; prints its URL)",
1491
1491
  " moondeck preview public|private <name> (public: a link anyone can open)",
1492
1492
  " moondeck project list | show <id|slug>",
@@ -7880,6 +7880,9 @@ export function buildSystemPreamble(
7880
7880
  ...handoffBrief,
7881
7881
  "",
7882
7882
  ...workspaceBrief,
7883
+ `Read \`${workspacePath}/.moondeck/init/runtime-notes\` if present for skipped tools and installation guidance.`,
7884
+ "If dependencies seem missing, inspect deps-status and deps.log in that directory.",
7885
+ "",
7883
7886
  // ADR-062: shared files — only when this container actually carries the
7884
7887
  // mounts (task-up drops a marker; pre-feature containers have none).
7885
7888
  ...(sharedFiles &&
@@ -11251,6 +11254,8 @@ async function recoverOneDockerTask(
11251
11254
  "-e",
11252
11255
  "ASDF_RUST_VERSION=",
11253
11256
  "-e",
11257
+ "ASDF_BUN_VERSION=",
11258
+ "-e",
11254
11259
  "COREPACK_HOME=/opt/asdf-data/corepack",
11255
11260
  "-e",
11256
11261
  "COREPACK_DEFAULT_TO_LATEST=0",
@@ -30,6 +30,7 @@ export const RUNTIME_AUTHORITY_ENV: Readonly<Record<string, string>> =
30
30
  ASDF_GOLANG_VERSION: "",
31
31
  ASDF_RUBY_VERSION: "",
32
32
  ASDF_RUST_VERSION: "",
33
+ ASDF_BUN_VERSION: "",
33
34
  // asdf-nodejs wraps global npm installs with an automatic reshim. Task
34
35
  // mounts are intentionally read-only and private bins are already on PATH;
35
36
  // only host maintenance may mutate shared shims.
@@ -75,8 +75,8 @@ export const STANDARD_CODEX_CLI_VERSION = "0.164.0";
75
75
  * Runtimes the standard image's asdf plugins can satisfy, with a sensible set
76
76
  * of advertised versions per kind (ADR-021 `runtimes`). These are the
77
77
  * versions the cloud's task-creation picker hints; asdf will lazily install
78
- * any of them on first use (docs/runtime.md). The first entry of each list is
79
- * the root `/etc/.tool-versions` default baked into the image.
78
+ * any of them on first use (docs/runtime.md). Where the image bakes a root
79
+ * `/home/node/.tool-versions` default, it is the first entry in that list.
80
80
  *
81
81
  * KEEP IN SYNC with host-agent/images/standard/ (the asdf plugins and the
82
82
  * root tool-versions). Treat that directory as authoritative for the numbers;
@@ -98,6 +98,7 @@ export const STANDARD_RUNTIMES: ReadonlyArray<{
98
98
  { kind: "go", availableVersions: ["1.23.2", "1.22.8"] },
99
99
  { kind: "ruby", availableVersions: ["3.3.5", "3.2.5"] },
100
100
  { kind: "rust", availableVersions: ["1.81.0"] },
101
+ { kind: "bun", availableVersions: ["1.3.1"] },
101
102
  ];
102
103
 
103
104
  /** A fresh, mutable copy of the advertised runtimes for the capability frame. */
@@ -373,7 +373,7 @@ git rev-parse --show-toplevel
373
373
  export const SETUP_SCRIPT = `set -u
374
374
  IFS= read -r nonce || nonce=""
375
375
  case "$nonce" in *[!0-9a-f]*|"") echo "uai: setup needs its nonce" >&2; exit 64 ;; esac
376
- mark() { printf 'uai-setup-%s %s %s\\n' "$nonce" "$1" "$2"; }
376
+ mark() { [ "$1" != invalid-runtime ] || runtime_invalid=1; printf 'uai-setup-%s %s %s\\n' "$nonce" "$1" "$2"; }
377
377
  quiet() { "$@" </dev/null 1>&2; }
378
378
  # The effective requirements: this folder's .tool-versions (the repository's,
379
379
  # or the project's fallback Prepare seeded, as at start), parsed and checked
@@ -411,6 +411,7 @@ check_runtime() {
411
411
  ;;
412
412
  esac
413
413
  case "/$version/" in *"/../"*|*"/./"*|*"//"*) mark invalid-runtime "$tool $version (unsafe version path)"; return 0 ;; esac
414
+ case "$tool" in nodejs|python|golang|ruby|rust|bun) ;; *) return 0 ;; esac
414
415
  if ! command -v asdf >/dev/null 2>&1; then
415
416
  mark missing-runtime "$tool $version (no asdf to check it)"
416
417
  elif ! asdf where "$tool" "$version" </dev/null >/dev/null 2>&1; then
@@ -423,17 +424,24 @@ elif [ -f .tool-versions ]; then
423
424
  if LC_ALL=C grep -q '[[:cntrl:]]' .tool-versions; then
424
425
  mark invalid-runtime ".tool-versions (control characters; a start would refuse it)"
425
426
  else
427
+ declare -A seen_tools=()
426
428
  while IFS= read -r line || [ -n "$line" ]; do
427
429
  line=\${line%%#*}
428
430
  read -r -a fields <<< "$line" || true
429
431
  [ "\${#fields[@]}" -gt 0 ] || continue
430
432
  tool=\${fields[0]}
433
+ runtime_invalid=0
431
434
  if [ "\${#fields[@]}" -lt 2 ] || [[ ! "$tool" =~ ^[a-z0-9][a-z0-9_-]*$ ]]; then
432
435
  mark invalid-runtime "$line (a start would refuse this line)"
433
436
  continue
434
437
  fi
438
+ if [ -n "\${seen_tools[$tool]:-}" ]; then
439
+ mark invalid-runtime "$tool (duplicate tool)"
440
+ continue
441
+ fi
442
+ seen_tools[$tool]=1
435
443
  case "$tool" in
436
- nodejs|python|golang|ruby|rust)
444
+ nodejs|python|golang|ruby|rust|bun)
437
445
  for version in "\${fields[@]:1}"; do check_runtime "$tool" "$version"; done
438
446
  ;;
439
447
  pnpm|yarn)
@@ -442,7 +450,16 @@ elif [ -f .tool-versions ]; then
442
450
  mark invalid-runtime "$tool \${fields[*]:1} (must pin one exact version)"
443
451
  fi
444
452
  ;;
445
- *) mark invalid-runtime "$tool (not a runtime a task can install)" ;;
453
+ *)
454
+ for version in "\${fields[@]:1}"; do check_runtime "$tool" "$version"; done
455
+ if [ "$runtime_invalid" -eq 0 ]; then
456
+ case "$tool" in
457
+ node) mark skipped-runtime "$tool (did you mean nodejs?)" ;;
458
+ go) mark skipped-runtime "$tool (did you mean golang?)" ;;
459
+ *) mark skipped-runtime "$tool" ;;
460
+ esac
461
+ fi
462
+ ;;
446
463
  esac
447
464
  done < .tool-versions
448
465
  fi
@@ -495,10 +512,11 @@ export function boundWarning(value: string): string {
495
512
  export function parseSetupResult(
496
513
  stdout: string,
497
514
  nonce: string,
498
- ): { missing: string[]; invalid: string[]; failed: string[] } {
515
+ ): { missing: string[]; invalid: string[]; failed: string[]; skipped: string[] } {
499
516
  const missing: string[] = [];
500
517
  const invalid: string[] = [];
501
518
  const failed: string[] = [];
519
+ const skipped: string[] = [];
502
520
  const prefix = `uai-setup-${nonce} `;
503
521
  for (const raw of stdout.split("\n")) {
504
522
  if (!raw.startsWith(prefix)) continue;
@@ -510,9 +528,10 @@ export function parseSetupResult(
510
528
  if (!item) continue;
511
529
  if (kind === "missing-runtime" && missing.length < 20) missing.push(item);
512
530
  if (kind === "invalid-runtime" && invalid.length < 20) invalid.push(item);
531
+ if (kind === "skipped-runtime" && skipped.length < 20) skipped.push(item);
513
532
  if (kind === "failed-step" && failed.length < 20) failed.push(item);
514
533
  }
515
- return { missing, invalid, failed };
534
+ return { missing, invalid, failed, skipped };
516
535
  }
517
536
 
518
537
  export type TaskProjectEnvironment = Pick<TaskEnvironmentHandle, "exec" | "descriptor">;
@@ -955,12 +974,15 @@ export class TaskProjectOps {
955
974
  if ("error" in setup) {
956
975
  warnings.push(`dependency setup could not run: ${String((setup as { error: unknown }).error)}`);
957
976
  } else {
958
- const { missing, invalid, failed } = parseSetupResult(text(setup.stdout), nonce);
977
+ const { missing, invalid, failed, skipped } = parseSetupResult(text(setup.stdout), nonce);
959
978
  if (invalid.length > 0) {
960
979
  warnings.push(
961
980
  `the repository's .tool-versions has entries a task start would refuse (${invalid.join(", ")}); fix them before the task restarts`,
962
981
  );
963
982
  }
983
+ if (skipped.length > 0) warnings.push(
984
+ `unsupported tools skipped (${skipped.join(", ")}); use mise install <tool>@<version>, then mise exec -- <cmd> (or their vendor installers)`,
985
+ );
964
986
  if (missing.length > 0) {
965
987
  warnings.push(
966
988
  `runtimes this repository asks for are not installed in this task (${missing.join(", ")}). ` +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moondeck/station",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Moondeck Station: runs Moondeck tasks in containers on a machine you control.",
5
5
  "license": "MIT",
6
6
  "author": "Moondeck <team@moondeck.io>",
@@ -2048,6 +2048,7 @@ mv -f "$managed_env_keys_tmp" "$managed_env_keys_file"
2048
2048
  printf ' ASDF_GOLANG_VERSION: ""\n'
2049
2049
  printf ' ASDF_RUBY_VERSION: ""\n'
2050
2050
  printf ' ASDF_RUST_VERSION: ""\n'
2051
+ printf ' ASDF_BUN_VERSION: ""\n'
2051
2052
  printf ' ASDF_SKIP_RESHIM: "1"\n'
2052
2053
  printf ' COREPACK_HOME: "/opt/asdf-data/corepack"\n'
2053
2054
  printf ' COREPACK_DEFAULT_TO_LATEST: "0"\n'
@@ -2513,6 +2514,7 @@ if [ "$TASK_RUNTIME_MODE" = "apple-container" ]; then
2513
2514
  printf 'ASDF_GOLANG_VERSION=\n'
2514
2515
  printf 'ASDF_RUBY_VERSION=\n'
2515
2516
  printf 'ASDF_RUST_VERSION=\n'
2517
+ printf 'ASDF_BUN_VERSION=\n'
2516
2518
  printf 'ASDF_SKIP_RESHIM=1\n'
2517
2519
  printf 'COREPACK_HOME=/opt/asdf-data/corepack\n'
2518
2520
  printf 'COREPACK_DEFAULT_TO_LATEST=0\n'
@@ -3023,6 +3025,7 @@ managed_common_exec_env=(
3023
3025
  -e "ASDF_GOLANG_VERSION="
3024
3026
  -e "ASDF_RUBY_VERSION="
3025
3027
  -e "ASDF_RUST_VERSION="
3028
+ -e "ASDF_BUN_VERSION="
3026
3029
  -e "ASDF_SKIP_RESHIM=1"
3027
3030
  -e "COREPACK_HOME=/opt/asdf-data/corepack"
3028
3031
  -e "COREPACK_DEFAULT_TO_LATEST=0"
@@ -3100,6 +3103,7 @@ task_runtime_exec_env=(
3100
3103
  -e "ASDF_GOLANG_VERSION="
3101
3104
  -e "ASDF_RUBY_VERSION="
3102
3105
  -e "ASDF_RUST_VERSION="
3106
+ -e "ASDF_BUN_VERSION="
3103
3107
  -e "ASDF_SKIP_RESHIM=1"
3104
3108
  -e "COREPACK_HOME=/opt/asdf-data/corepack"
3105
3109
  -e "COREPACK_DEFAULT_TO_LATEST=0"