benignswarm 0.12.52 → 0.12.54

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.
@@ -43,7 +43,8 @@ else
43
43
  for b in node npm npx; do ln -sf "$HOME/.local/node/bin/$b" "$HOME/.local/bin/$b"; done
44
44
  hash -r; step node done "$(node --version) in ~/.local/node"
45
45
  fi
46
- npx -y -p benignswarm@${version} bschat install ${version} >/tmp/bschat-install.$$ 2>&1 || fail bschat "$(tail -1 /tmp/bschat-install.$$)"
46
+ # --prefer-online: a cached package listing from before the publish says the version does not exist.
47
+ npx -y --prefer-online -p benignswarm@${version} bschat install ${version} >/tmp/bschat-install.$$ 2>&1 || fail bschat "$(grep -v 'complete log' /tmp/bschat-install.$$ | grep -m1 -iE 'error|failed' || tail -1 /tmp/bschat-install.$$)"
47
48
  rm -f /tmp/bschat-install.$$
48
49
  bin=$(node -p 'require(require("os").homedir()+"/.bschat/install.json").bin')
49
50
  for b in bschat bschat-admin; do [ -e "$HOME/.local/bin/$b" ] || ln -sf "$(dirname "$bin")/$b" "$HOME/.local/bin/$b"; done
@@ -200,7 +200,7 @@ export function prepare() {
200
200
  else {
201
201
  const login = spawnSync("codex", ["login", "status"], { encoding: "utf8" });
202
202
  const ok = login.status === 0 && /logged in/i.test(`${login.stdout}${login.stderr}`);
203
- steps.push({ step: "codex", result: ok ? "ok" : "failed", detail: ok ? `${codex.stdout.trim()}, ${login.stdout.trim()}` : `${codex.stdout.trim()} is not logged in: run codex login --device-auth on this machine` });
203
+ steps.push({ step: "codex", result: ok ? "ok" : "failed", detail: ok ? `${codex.stdout.trim()}, ${`${login.stdout}${login.stderr}`.trim()}` : `${codex.stdout.trim()} is not logged in: run codex login --device-auth on this machine` });
204
204
  }
205
205
  const req = "/etc/codex/requirements.toml";
206
206
  const { requirements, wrapper } = codexManagedHooks(requireInstall().bin);
package/dist/install.js CHANGED
@@ -157,7 +157,8 @@ export function systemdUnit(label, args, cwd, env, logDir, slug = label.slice(WA
157
157
  ``,
158
158
  `[Service]`,
159
159
  `ExecStart=${args.map(sdq).join(" ")}`,
160
- `WorkingDirectory=${sdq(cwd)}`,
160
+ // Not quoted: systemd reads a quoted WorkingDirectory as a relative path and refuses the unit.
161
+ `WorkingDirectory=${cwd.replace(/%/g, "%%")}`,
161
162
  ...Object.entries(env).map(([k, v]) => `Environment=${sdq(`${k}=${v}`)}`),
162
163
  `Restart=always`,
163
164
  `RestartSec=5`,
@@ -172,6 +173,12 @@ export function systemdUnit(label, args, cwd, env, logDir, slug = label.slice(WA
172
173
  }
173
174
  /** Loads (or reloads) a systemd user unit from its file and (re)starts it; throws when systemd refuses. */
174
175
  export function loadSystemdUnit(label) {
176
+ // systemd's own checker first, where it exists: it names the bad line (a quoted WorkingDirectory
177
+ // once failed only at restart, as "bad unit file setting").
178
+ const path = join(systemdUserDir(), `${label}.service`);
179
+ const v = spawnSync("systemd-analyze", ["--user", "verify", path], { encoding: "utf8" });
180
+ if (!v.error && v.status !== 0)
181
+ throw new CliError("bad_unit", `systemd rejects ${path}`, (v.stderr ?? "").trim().slice(0, 500));
175
182
  for (const args of [["daemon-reload"], ["enable", `${label}.service`], ["restart", `${label}.service`]]) {
176
183
  const r = spawnSync("systemctl", ["--user", ...args], { encoding: "utf8" });
177
184
  if (r.status !== 0)
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = "0.12.52";
1
+ export const CLI_VERSION = "0.12.54";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "benignswarm",
3
- "version": "0.12.52",
3
+ "version": "0.12.54",
4
4
  "description": "bschat: chat, status board and evidence store for coding agents (benignswarm.org)",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {