@miraland-labs/conduit-bridge 0.16.13 → 0.16.14

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/ops.js +28 -10
  2. package/package.json +1 -1
package/dist/ops.js CHANGED
@@ -476,6 +476,21 @@ export async function runOps(verb, argv = [], deps = {}) {
476
476
  ...(repo ? { CONDUIT_REPO: repo } : {}),
477
477
  ...(managed ? { CONDUIT_MANAGED_ROOT: managedRoot } : {}),
478
478
  });
479
+ // Resolve the local lane before redeeming the single-use token. A missing coding agent is a
480
+ // local prerequisite, not an enrollment failure, and must leave the token available to retry.
481
+ // `--no-install` remains the explicit credential-only escape hatch.
482
+ const installDrivers = !values["no-install"] && workspace
483
+ ? await (deps.resolveInstallDrivers ?? resolveInstallDrivers)({
484
+ ...env,
485
+ CONDUIT_URL: url,
486
+ CONDUIT_WORKSPACE: workspace,
487
+ CONDUIT_REPO: repo,
488
+ CONDUIT_MANAGED_ROOT: managedRoot,
489
+ loadedFrom: envPath,
490
+ }, [])
491
+ : [];
492
+ if (managed)
493
+ mkdirSync(resolve(expandOpsValue(managedRoot)), { recursive: true });
479
494
  const args = ["enroll", "--url", url, "--token", token];
480
495
  if (machine)
481
496
  args.push("--machine", machine);
@@ -484,23 +499,19 @@ export async function runOps(verb, argv = [], deps = {}) {
484
499
  runBridge(args);
485
500
  if (values["no-install"])
486
501
  return;
502
+ console.log("Enrollment complete. If background setup is interrupted, rerun: npx @miraland-labs/conduit-bridge@latest ops install");
487
503
  if (managed) {
488
504
  const root = resolve(expandOpsValue(managedRoot));
489
- mkdirSync(root, { recursive: true });
490
505
  // Bring lanes online and install the resident runner, but skip `ops install`'s doctor gate:
491
506
  // an empty managed root is legitimately not a checkout yet, and failing here would leave the
492
507
  // computer with no background process — exactly the terminal round-trip this removes.
493
508
  // Same lane resolution as `ops install` (honours CONDUIT_DRIVERS and the one-lane default)
494
509
  // rather than a second copy of detection — and it keeps the seam tests inject through.
495
- const drivers = await (deps.resolveInstallDrivers ?? resolveInstallDrivers)(loadOpsEnv(), []);
496
- if (drivers.length === 0) {
497
- throw new Error("No coding agent detected. Install one (Claude Code, Codex, Cursor, …), then re-run this command.");
498
- }
499
- for (const id of drivers) {
510
+ for (const id of installDrivers) {
500
511
  if (LOCAL_FUEL_DRIVERS.has(id))
501
512
  runBridge(["drivers", "fuel", id, "local"]);
502
513
  }
503
- runBridge(["drivers", "online", ...drivers]);
514
+ runBridge(["drivers", "online", ...installDrivers]);
504
515
  applyRunnerToolPath();
505
516
  runBridge(["install-service", "--workspace", root]);
506
517
  console.log(`Conduit manages checkouts under ${root}. Assign this computer to a project from the console — it clones and switches on its own.`);
@@ -508,7 +519,7 @@ export async function runOps(verb, argv = [], deps = {}) {
508
519
  }
509
520
  if (workspace) {
510
521
  const refreshedEnv = loadOpsEnv();
511
- await runOps("install", [], { ...deps, env: refreshedEnv });
522
+ await runOps("install", installDrivers, { ...deps, env: refreshedEnv });
512
523
  }
513
524
  return;
514
525
  }
@@ -531,8 +542,15 @@ export async function runOps(verb, argv = [], deps = {}) {
531
542
  ? `Cloned ${installEnv.CONDUIT_REPO} into ${workspace}`
532
543
  : `Workspace already matches ${installEnv.CONDUIT_REPO}`);
533
544
  }
534
- // Prove the exact local environment before installing a service that advertises availability.
535
- runBridge(["ops", "doctor"]);
545
+ // A managed root is intentionally empty until the console assigns its first repository. It
546
+ // still needs a resident runner, and `ops install` is also the recovery path after enrollment.
547
+ const waitingOnManagedAssignment = Boolean(installEnv.CONDUIT_MANAGED_ROOT
548
+ && resolve(expandOpsValue(installEnv.CONDUIT_MANAGED_ROOT)) === workspace
549
+ && !installEnv.CONDUIT_REPO);
550
+ if (!waitingOnManagedAssignment) {
551
+ // Prove the exact local environment before installing a service that advertises availability.
552
+ runBridge(["ops", "doctor"]);
553
+ }
536
554
  const installArgs = ["install-service", "--workspace", workspace];
537
555
  if (installEnv.CONDUIT_REPO)
538
556
  installArgs.push("--ensure-checkout", installEnv.CONDUIT_REPO);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miraland-labs/conduit-bridge",
3
- "version": "0.16.13",
3
+ "version": "0.16.14",
4
4
  "description": "Conduit Bridge CLI — join, connect, disconnect, multi-driver lanes, and run Claude Code / Codex / Cursor / OpenCode / Pi / Kiro / Antigravity / Grok Build agents for a Conduit organization",
5
5
  "type": "module",
6
6
  "bin": {