bostrat-node 1.14.4 → 1.14.6
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.
- package/bin/bostrat-blueprint +1 -1
- package/dist/cli.js +93 -93
- package/dist/index.js +287 -260
- package/node-entrypoint.sh +31 -0
- package/package.json +1 -1
package/node-entrypoint.sh
CHANGED
|
@@ -12,8 +12,39 @@ git config --global user.email >/dev/null 2>&1 || git config --global user.email
|
|
|
12
12
|
SOCKET="${BOSTRAT_TMUX_SOCKET:-/tmp/tmux-0/default}"
|
|
13
13
|
mkdir -p "$(dirname "$SOCKET")"
|
|
14
14
|
tmux -S "$SOCKET" has-session 2>/dev/null || tmux -S "$SOCKET" new-session -d -s keeper "sleep infinity"
|
|
15
|
+
# The server is a daemon beside the agent, not its child: when `bostrat-node
|
|
16
|
+
# run` relaunches a stalled agent (BP-NG-R2 — heartbeat.json stale 3 min →
|
|
17
|
+
# SIGTERM/SIGKILL → respawn, node-cli.js createRunSupervisor), every box keeps
|
|
18
|
+
# running here and the lead resumes by session id on the next drive.
|
|
19
|
+
# In-VM OOM guard (BP-NG-R4 / D4): memory exhaustion inside the guest must
|
|
20
|
+
# kill the offending process, never the machine or the agent. The Fly init
|
|
21
|
+
# runs no systemd, so this is the Pi's earlyoom backstop started by hand with
|
|
22
|
+
# the Pi's tuning (ugrep-memory-lock-2026-07-17): act at 10% available memory
|
|
23
|
+
# / 70% swap free (no swap → only the memory leg counts), and print a memory
|
|
24
|
+
# report every 10 min to the machine log (the 09-22 flight recorder).
|
|
25
|
+
# earlyoom matches --prefer/--avoid against the KERNEL process name (comm,
|
|
26
|
+
# 15 chars) — not the command line. Node ≥ 24 names its main thread
|
|
27
|
+
# "MainThread", so a bare node process is "MainThread", never "node"; the CLI
|
|
28
|
+
# and the agent set their own titles (bostrat-node / bostrat-agent, node-cli.js
|
|
29
|
+
# runAgent + index.js) so the avoid list actually matches them. Claude's
|
|
30
|
+
# bundled helpers take their version string as comm (the 2.1.x pattern).
|
|
31
|
+
# Relaunched if it ever exits — a guard that silently died is no guard.
|
|
32
|
+
if command -v earlyoom >/dev/null 2>&1; then
|
|
33
|
+
(
|
|
34
|
+
while :; do
|
|
35
|
+
earlyoom -m 10 -s 70 -r 600 \
|
|
36
|
+
--prefer '^(ugrep|rg|2\.1\.[0-9]+|cursor-agent|codex|npm|node|MainThread)' \
|
|
37
|
+
--avoid '^(bostrat-|tmux|earlyoom)' \
|
|
38
|
+
2>&1 | sed -u 's/^/[earlyoom] /'
|
|
39
|
+
sleep 5
|
|
40
|
+
done
|
|
41
|
+
) &
|
|
42
|
+
fi
|
|
15
43
|
# Global-install layout (the GHCR image / npm -g) has bostrat-node on PATH;
|
|
16
44
|
# staged repo-context builds (`bostrat-node fly` wizard) run the tree copy.
|
|
45
|
+
# Both exec `run` — the foreground SUPERVISOR (self-update restarts + the stall
|
|
46
|
+
# watchdog), so this script needs no loop of its own; if the supervisor itself
|
|
47
|
+
# dies the machine's restart policy (always) brings the whole node back.
|
|
17
48
|
if command -v bostrat-node >/dev/null 2>&1; then
|
|
18
49
|
exec bostrat-node run
|
|
19
50
|
else
|
package/package.json
CHANGED