@tablation/crew 0.7.0 → 0.7.1

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 +35 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1990,6 +1990,13 @@ function findOnPath(bin, searchPath) {
1990
1990
  }
1991
1991
  return void 0;
1992
1992
  }
1993
+ var COMMON_DOCKER_DIRS = ["/usr/local/bin", "/opt/homebrew/bin", join5(homedir2(), ".docker", "bin")].join(":");
1994
+ function dockerPathProblem(ship, shellPath = process.env.PATH ?? "") {
1995
+ const schedulerPath = pathFor(ship);
1996
+ if (findOnPath("docker", schedulerPath)) return void 0;
1997
+ const inShell = findOnPath("docker", shellPath);
1998
+ return inShell ? `\`docker\` is not on the scheduler PATH (${schedulerPath}) but is at ${inShell} in your shell; add ${dirname3(inShell)} to ship.extraPath in crew.yaml and run \`crew install\`` : `\`docker\` is not on the scheduler PATH (${schedulerPath}) or your shell PATH; install Docker, then add its directory to ship.extraPath in crew.yaml and run \`crew install\``;
1999
+ }
1993
2000
  function xmlEscape(s) {
1994
2001
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1995
2002
  }
@@ -5263,8 +5270,7 @@ async function runWizard(p, env) {
5263
5270
  }
5264
5271
  const nodeDir = dirname6(env.nodePath);
5265
5272
  const pnpmPath = findOnPath2("pnpm", env.pathEnv, isExec);
5266
- const extraPath = deriveExtraPath([nodeDir, pnpmPath ? dirname6(pnpmPath) : void 0]);
5267
- if (extraPath) p.say(`Hooks will get ${extraPath} on their PATH (where node and pnpm live).`);
5273
+ const baseDirs = [nodeDir, pnpmPath ? dirname6(pnpmPath) : void 0];
5268
5274
  p.say(
5269
5275
  `
5270
5276
  Host Passengers lets this machine run the agent sessions that other people's
@@ -5274,6 +5280,11 @@ Tablation workspaces ask for, in a container. More: ${HOST_PASSENGERS_DOCS_URL}`
5274
5280
  if (hostPassengers && !env.dockerAvailable) {
5275
5281
  p.say("Docker is not available here, so nothing will be hosted until it is. Your answer is recorded anyway.");
5276
5282
  }
5283
+ const dockerPath = hostPassengers ? findOnPath2("docker", env.pathEnv, isExec) : void 0;
5284
+ const extraPath = deriveExtraPath([...baseDirs, dockerPath ? dirname6(dockerPath) : void 0]);
5285
+ if (extraPath) {
5286
+ p.say(`Hooks will get ${extraPath} on their PATH (where node, pnpm${dockerPath ? " and docker" : ""} live).`);
5287
+ }
5277
5288
  return { name, platform: env.platform, agentBin, extraPath, hostPassengers };
5278
5289
  }
5279
5290
  function renderShipBlock(a) {
@@ -9176,8 +9187,9 @@ if (command === "passenger-sync-daemon") {
9176
9187
  const passengerRoutes = cfg.routes.filter((r) => r.enabled && r.hostPassengers);
9177
9188
  if (passengerRoutes.length === 0) return;
9178
9189
  if (!dockerAvailable()) {
9190
+ const pathProblem = dockerPathProblem(cfg.ship, COMMON_DOCKER_DIRS);
9179
9191
  emit.warn(
9180
- "Host Passengers is on for at least one route but Docker is not available \u2014 skipping container sync this cycle",
9192
+ `Host Passengers is on for at least one route but ${pathProblem ?? "Docker is not available"} \u2014 skipping container sync this cycle`,
9181
9193
  { step: "passengers" }
9182
9194
  );
9183
9195
  return;
@@ -9302,7 +9314,12 @@ if (command === "passenger-sync-daemon") {
9302
9314
  process.stderr.write("crew install: no scheduler support yet for Windows (Task Scheduler is planned, not built)\n");
9303
9315
  process.exit(2);
9304
9316
  }
9305
- if (!dryRun && cfg.routes.some((r) => r.enabled && r.hostPassengers) && dockerAvailable()) {
9317
+ const installPathProblem = cfg.routes.some((r) => r.enabled && r.hostPassengers) ? dockerPathProblem(cfg.ship) : void 0;
9318
+ if (installPathProblem) {
9319
+ process.stderr.write(`crew install: Host Passengers is on but ${installPathProblem}
9320
+ `);
9321
+ process.exitCode = 1;
9322
+ } else if (!dryRun && cfg.routes.some((r) => r.enabled && r.hostPassengers) && dockerAvailable()) {
9306
9323
  const image = passengerImageRef(cfg);
9307
9324
  if (imagePresent(image)) {
9308
9325
  process.stdout.write(`Host Passengers image ${image} is already present
@@ -11463,6 +11480,20 @@ git: ${gitPath ? `OK (${gitPath})` : "NOT FOUND on the scheduler P
11463
11480
  process.stdout.write("host passengers: off (no enabled route sets hostPassengers: true)\n");
11464
11481
  } else {
11465
11482
  const dockerOk = dockerAvailable();
11483
+ const dockerPathIssue = dockerPathProblem(cfg.ship);
11484
+ const dockerKey = "docker_missing";
11485
+ if (dockerPathIssue) {
11486
+ process.stdout.write(`docker on scheduler PATH: NOT FOUND \u2014 ${dockerPathIssue}
11487
+ `);
11488
+ await raiseShipAttention({ state, emit, route: passengerRoutes[0], ship: cfg.ship }, {
11489
+ kind: "docker_missing",
11490
+ key: dockerKey,
11491
+ message: `Host Passengers is on but ${dockerPathIssue}`,
11492
+ since: (/* @__PURE__ */ new Date()).toISOString()
11493
+ });
11494
+ } else {
11495
+ clearShipAttention(state, dockerKey);
11496
+ }
11466
11497
  const keygenOk = sshKeygenAvailable();
11467
11498
  const image = passengerImageRef(cfg);
11468
11499
  const imageOk = dockerOk && imagePresent(image);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tablation/crew",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
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",