@tablation/crew 0.128.1 → 0.128.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.
Files changed (2) hide show
  1. package/dist/cli.js +30 -2
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -4937,7 +4937,7 @@ WorkingDirectory=${crewHome}
4937
4937
  ${systemdEnvLines(ship)}
4938
4938
  StandardOutput=append:${schedulerLog}
4939
4939
  StandardError=append:${schedulerLog}
4940
- Restart=on-failure
4940
+ Restart=always
4941
4941
  RestartSec=5
4942
4942
  # CREW-1775: a restart stops only the daemon; agent runs it started live in
4943
4943
  # their own process groups and the next daemon reattaches to them.
@@ -15441,6 +15441,10 @@ function applyManagedDefaultsToDoc(doc) {
15441
15441
  doc.setIn(["ship", "sandbox", "cacheVolume"], MANAGED_CACHE_VOLUME);
15442
15442
  wrote.push("ship.sandbox.cacheVolume");
15443
15443
  }
15444
+ if (doc.getIn(["ship", "cloneScheme"]) === void 0) {
15445
+ doc.setIn(["ship", "cloneScheme"], "https");
15446
+ wrote.push("ship.cloneScheme");
15447
+ }
15444
15448
  const existing = doc.getIn(["ship", "toolchains"]);
15445
15449
  const hasClaude = isMap2(existing) && existing.items.some((i) => (isScalar(i.key) ? i.key.value : i.key) === "claude");
15446
15450
  if (!hasClaude) {
@@ -15869,6 +15873,9 @@ function rejectedTunnels(stateDir) {
15869
15873
  }
15870
15874
 
15871
15875
  // src/pool-member-host.ts
15876
+ function platformBaseUrl(poolUrl) {
15877
+ return poolUrl.trim().replace(/\/+$/, "").replace(/\/api$/i, "");
15878
+ }
15872
15879
  function loadShip(crewHome) {
15873
15880
  try {
15874
15881
  return loadConfig(crewHome, void 0, { allowNoRoutes: true });
@@ -15902,7 +15909,7 @@ function realPoolMemberDeps(o) {
15902
15909
  instanceClass,
15903
15910
  relayHost: lease.relayHost,
15904
15911
  maxConcurrentAgents: lease.maxConcurrentAgents,
15905
- baseUrl: o.platformUrl,
15912
+ baseUrl: platformBaseUrl(o.platformUrl),
15906
15913
  forgeHosts: hosts,
15907
15914
  tokens: Object.fromEntries(lease.forges.map((f) => [f.host.toLowerCase(), f.token])),
15908
15915
  json: false,
@@ -30221,6 +30228,17 @@ ${where.join("\n")}`);
30221
30228
  const control = host === "windows" ? null : planDaemonControl(CREW_HOME, host, detectSystemd());
30222
30229
  const unitStatus = control?.statusCommand ? spawnSync12(control.statusCommand[0], control.statusCommand.slice(1), { cwd: CREW_HOME, encoding: "utf8" }) : null;
30223
30230
  const unitRunning = unitStatus !== null && !unitStatus.error && unitStatus.status === 0;
30231
+ if (!unitRunning && control?.mechanism === "systemd" && control.startCommand) {
30232
+ const res = spawnSync12(control.startCommand[0], control.startCommand.slice(1), { cwd: CREW_HOME, encoding: "utf8" });
30233
+ if (res.error || res.status !== 0) {
30234
+ process.stderr.write(`crew reload: ${control.startCommand.join(" ")} exited ${res.status ?? "error"}
30235
+ `);
30236
+ process.exitCode = 1;
30237
+ } else {
30238
+ process.stdout.write("crew reload: the daemon unit was not running \u2014 started it, so it reads crew.yaml fresh\n");
30239
+ }
30240
+ break;
30241
+ }
30224
30242
  if (!unitRunning) {
30225
30243
  process.stdout.write("crew reload: no daemon unit is running \u2014 nothing to reload (the next run reads crew.yaml fresh)\n");
30226
30244
  break;
@@ -30892,6 +30910,16 @@ routes: ${cfg.routes.map((c) => c.route).join(", ")}
30892
30910
  );
30893
30911
  }
30894
30912
  }
30913
+ if (host === "linux" && detectSystemd()) {
30914
+ const ctl = planDaemonControl(CREW_HOME, host, true);
30915
+ const unitPlan = planInstall(cfg.ship, CREW_HOME, host, true, "run", installContext());
30916
+ if (ctl.statusCommand && unitPlan.unitPaths.some((p) => existsSync52(p))) {
30917
+ const st = spawnSync12(ctl.statusCommand[0], ctl.statusCommand.slice(1), { cwd: CREW_HOME, encoding: "utf8" });
30918
+ if (!st.error && st.status !== 0) {
30919
+ process.stdout.write("daemon unit: WARN installed but not running \u2014 no work is picked up; run `crew reload` (or `crew daemon start`), and `crew install` if the unit still says Restart=on-failure\n");
30920
+ }
30921
+ }
30922
+ }
30895
30923
  const reloadAt = readReloadRequestedAt(cfg.ship.stateDir);
30896
30924
  if (reloadAt !== null) {
30897
30925
  process.stdout.write(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tablation/crew",
3
- "version": "0.128.1",
3
+ "version": "0.128.3",
4
4
  "description": "A standing team of headless agents that picks work off a Tablation board, does it on a machine you control, and reports back.",
5
5
  "type": "module",
6
6
  "license": "MIT",