@miraland-labs/conduit-bridge 0.16.12 → 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 +30 -11
  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,22 +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
- const detected = await detectInstalledClients();
494
- const drivers = driverIdsFromDetectedLabels(detected);
495
- if (drivers.length === 0) {
496
- throw new Error("No coding agent detected. Install one (Claude Code, Codex, Cursor, …), then re-run this command.");
497
- }
498
- for (const id of drivers) {
508
+ // Same lane resolution as `ops install` (honours CONDUIT_DRIVERS and the one-lane default)
509
+ // rather than a second copy of detection — and it keeps the seam tests inject through.
510
+ for (const id of installDrivers) {
499
511
  if (LOCAL_FUEL_DRIVERS.has(id))
500
512
  runBridge(["drivers", "fuel", id, "local"]);
501
513
  }
502
- runBridge(["drivers", "online", ...drivers]);
514
+ runBridge(["drivers", "online", ...installDrivers]);
503
515
  applyRunnerToolPath();
504
516
  runBridge(["install-service", "--workspace", root]);
505
517
  console.log(`Conduit manages checkouts under ${root}. Assign this computer to a project from the console — it clones and switches on its own.`);
@@ -507,7 +519,7 @@ export async function runOps(verb, argv = [], deps = {}) {
507
519
  }
508
520
  if (workspace) {
509
521
  const refreshedEnv = loadOpsEnv();
510
- await runOps("install", [], { ...deps, env: refreshedEnv });
522
+ await runOps("install", installDrivers, { ...deps, env: refreshedEnv });
511
523
  }
512
524
  return;
513
525
  }
@@ -530,8 +542,15 @@ export async function runOps(verb, argv = [], deps = {}) {
530
542
  ? `Cloned ${installEnv.CONDUIT_REPO} into ${workspace}`
531
543
  : `Workspace already matches ${installEnv.CONDUIT_REPO}`);
532
544
  }
533
- // Prove the exact local environment before installing a service that advertises availability.
534
- 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
+ }
535
554
  const installArgs = ["install-service", "--workspace", workspace];
536
555
  if (installEnv.CONDUIT_REPO)
537
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.12",
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": {