@ghl-ai/aw 0.1.44 → 0.1.45
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.
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
# @ghl-ai/aw@0.1.x for reproducible CI runs.
|
|
18
18
|
set -Eeuo pipefail
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
# GitHub auth is resolved inside `aw c4` so GITHUB_PAT, GITHUB_TOKEN, and
|
|
21
|
+
# no-token diagnostics stay centralized in the CLI preflight.
|
|
21
22
|
|
|
22
23
|
# Ensure npm is on PATH. Cursor Cloud's install shell is non-interactive — nvm
|
|
23
24
|
# is not auto-sourced, and Node may not be pre-installed at all. Walk common
|
|
@@ -30,6 +31,7 @@ set -Eeuo pipefail
|
|
|
30
31
|
# /usr/local/ or /opt/.
|
|
31
32
|
# - DEBIAN_FRONTEND=noninteractive prevents debconf prompts from hanging
|
|
32
33
|
# the apt configure step on a non-TTY shell.
|
|
34
|
+
# - Run apt-get directly when already root; use sudo only for non-root shells.
|
|
33
35
|
# - Drop the >/dev/null on apt + NodeSource setup so progress is visible.
|
|
34
36
|
# The previous "silent + interactive" combination produced the canonical
|
|
35
37
|
# "looks frozen" symptom in pilot use after Cursor Cloud stopped shipping
|
|
@@ -57,15 +59,28 @@ ensure_npm() {
|
|
|
57
59
|
fi
|
|
58
60
|
done
|
|
59
61
|
|
|
60
|
-
if command -v
|
|
62
|
+
if command -v apt-get >/dev/null 2>&1; then
|
|
61
63
|
echo "[aw-c4-bootstrap] npm not found; installing Node 20 via NodeSource (1-2 min over corporate proxy)"
|
|
62
64
|
export DEBIAN_FRONTEND=noninteractive
|
|
63
|
-
|
|
65
|
+
node_setup_command='curl -fsSL https://deb.nodesource.com/setup_20.x | bash -'
|
|
66
|
+
apt_install_command=(apt-get install -y nodejs)
|
|
67
|
+
current_uid="$(id -u 2>/dev/null || printf '1')"
|
|
68
|
+
if [ "$current_uid" != "0" ]; then
|
|
69
|
+
if command -v sudo >/dev/null 2>&1; then
|
|
70
|
+
node_setup_command='curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -'
|
|
71
|
+
apt_install_command=(sudo -E apt-get install -y nodejs)
|
|
72
|
+
else
|
|
73
|
+
echo "[aw-c4-bootstrap] FATAL: apt-get is available, but sudo is not, and the current user is not root" >&2
|
|
74
|
+
echo "[aw-c4-bootstrap] Run as root, install sudo, or preinstall Node 20+ in the harness snapshot." >&2
|
|
75
|
+
exit 1
|
|
76
|
+
fi
|
|
77
|
+
fi
|
|
78
|
+
if ! timeout 180 bash -c "$node_setup_command"; then
|
|
64
79
|
echo "[aw-c4-bootstrap] FATAL: NodeSource setup script timed out or failed after 180s" >&2
|
|
65
80
|
echo "[aw-c4-bootstrap] Preinstall Node 20+ in the agent snapshot, or check proxy reachability." >&2
|
|
66
81
|
exit 1
|
|
67
82
|
fi
|
|
68
|
-
if ! timeout 180
|
|
83
|
+
if ! timeout 180 "${apt_install_command[@]}"; then
|
|
69
84
|
echo "[aw-c4-bootstrap] FATAL: apt-get install nodejs timed out or failed after 180s" >&2
|
|
70
85
|
exit 1
|
|
71
86
|
fi
|
package/package.json
CHANGED
package/update.mjs
CHANGED
|
@@ -223,7 +223,14 @@ export async function promptUpdate(result) {
|
|
|
223
223
|
const cmd = getInstallCmd(result.latest);
|
|
224
224
|
fmt.logWarn(`Update available: ${chalk.dim(result.current)} → ${chalk.green(result.latest)}`);
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
let clackMod;
|
|
227
|
+
try {
|
|
228
|
+
clackMod = (await import('@clack/prompts')).default ?? await import('@clack/prompts');
|
|
229
|
+
} catch {
|
|
230
|
+
fmt.logStep(chalk.dim('Skipped update (clack unavailable)'));
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
const clack = clackMod;
|
|
227
234
|
const shouldUpdate = await clack.confirm({
|
|
228
235
|
message: `Update ${PKG_NAME} to ${result.latest}?`,
|
|
229
236
|
initialValue: true,
|