@spunto/build 0.28.1 → 0.28.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spunto/build",
3
- "version": "0.28.1",
3
+ "version": "0.28.3",
4
4
  "description": "Spunto's shared Build engine — the devcontainer image protocol and VS Code extension registry clients, with no database, no HTTP framework and no UI.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -134,13 +134,26 @@ function runnerPid() {
134
134
  return null
135
135
  }
136
136
 
137
- /** This boot of the box: the same after a resume (its RAM loaded), a new one after any boot. */
137
+ /**
138
+ * This boot of the box: the same after a resume (its RAM loaded), a new one after any boot. The
139
+ * kernel's boot_id alone is the host's in a container (Spunto Lite): the same at every
140
+ * `docker start`, so postStart never ran again after the first one (2026-11-09). The start time of
141
+ * PID 1 goes with it: a new init at every start of a container, the same one in a resumed microVM.
142
+ */
138
143
  function bootId() {
144
+ let boot
139
145
  try {
140
- return readFileSync("/proc/sys/kernel/random/boot_id", "utf8").trim()
146
+ boot = readFileSync("/proc/sys/kernel/random/boot_id", "utf8").trim()
141
147
  } catch {
142
148
  return null
143
149
  }
150
+ try {
151
+ // Field 22 (starttime), counted after the `(comm)`, which may hold spaces.
152
+ const stat = readFileSync("/proc/1/stat", "utf8")
153
+ const start = stat.slice(stat.lastIndexOf(")") + 2).split(" ")[19]
154
+ if (start) return `${boot}/${start}`
155
+ } catch {}
156
+ return boot
144
157
  }
145
158
 
146
159
  /** The runner's last start: under which boot, and how it ended (`exitCode`, null while it runs or unknown). */
@@ -278,10 +278,12 @@ while IFS= read -r line; do
278
278
  esac
279
279
  done
280
280
  REPO="\${REPO%.git}"
281
- RESPONSE=$(curl -fsS -m 20 -X POST "$SPUNTO_API_URL/api/workers/git-credential" -H "Authorization: Bearer $SPUNTO_WORKER_TOKEN" -H "Content-Type: application/json" -d "{\\"repo\\":\\"$REPO\\"}" 2>/dev/null)
281
+ # No -f: a refusal's body says why (which account the member authorized, what to do about it).
282
+ RESPONSE=$(curl -sS -m 20 -X POST "$SPUNTO_API_URL/api/workers/git-credential" -H "Authorization: Bearer $SPUNTO_WORKER_TOKEN" -H "Content-Type: application/json" -d "{\\"repo\\":\\"$REPO\\"}" 2>/dev/null)
282
283
  PASSWORD=$(printf "%s" "$RESPONSE" | sed -n 's/.*"password":"\\([^"]*\\)".*/\\1/p')
283
284
  if [ -z "$PASSWORD" ]; then
284
- echo "spunto: no git credential for $REPO - authorize the provider in Integrations." >&2
285
+ REASON=$(printf "%s" "$RESPONSE" | sed -n 's/.*"error":"\\([^"]*\\)".*/\\1/p')
286
+ echo "spunto: no git credential for $REPO - \${REASON:-authorize the provider in Integrations.}" >&2
285
287
  exit 0
286
288
  fi
287
289
  USERNAME=$(printf "%s" "$RESPONSE" | sed -n 's/.*"username":"\\([^"]*\\)".*/\\1/p')