@webority/ensemble 0.5.42 → 0.5.44

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.
package/bin/ensemble.js CHANGED
@@ -21,6 +21,18 @@ function forwardToRuntime(argv) {
21
21
  if (!core.isUsableBinary(runtimePath)) {
22
22
  core.die('the Ensemble runtime is not installed — run `ensemble install` to download it.');
23
23
  }
24
+ // Existence was the only check here, so a bus subcommand would happily drive a runtime from an
25
+ // older release against a newer API — the exact drift BUG-06718 is about. The npm postinstall and
26
+ // the session-start self-heal both cover the common paths; this catches the leftover case (a
27
+ // machine that has done neither since the CLI moved) with a local file read, not a network call.
28
+ // Warn only: a subcommand must not stall to download, and stderr keeps stdout clean for parsing.
29
+ try {
30
+ const runtimeVersion = core.readInstalledVersion();
31
+ if (runtimeVersion && runtimeVersion !== core.PKG_VERSION) {
32
+ console.error('[ensemble] runtime ' + runtimeVersion + ' is older than the CLI ('
33
+ + core.PKG_VERSION + '); it runs your hooks. Run: ensemble install');
34
+ }
35
+ } catch (e) { /* diagnostics must never block a command */ }
24
36
  // Prefer env; else load ~/.ensemble/machine-token so bus subcommands work in shells that never
25
37
  // got setx/export (common after enroll from another terminal).
26
38
  const env = { ...process.env };
package/lib/core.js CHANGED
@@ -461,15 +461,24 @@ function writeRunnerConfig(api, machineToken) {
461
461
  if (pf.os === 'windows') {
462
462
  spawnSync('setx', ['ENSEMBLE_MACHINE_TOKEN', machineToken], { stdio: 'ignore' });
463
463
  }
464
- const rc = path.join(HOME, pf.os === 'mac' ? '.zshrc' : '.bashrc');
465
- try {
466
- let cur = fs.existsSync(rc) ? fs.readFileSync(rc, 'utf8') : '';
467
- cur = cur.replace(/(^|\n)export ENSEMBLE_MACHINE_TOKEN=.*\n?/g, '\n');
468
- if (!cur.endsWith('\n')) cur += '\n';
469
- cur += `export ENSEMBLE_MACHINE_TOKEN="${machineToken}"\n`;
470
- if (!/\.ensemble\/bin/.test(cur)) cur += `export PATH="$HOME/.ensemble/bin:$PATH"\n`;
471
- fs.writeFileSync(rc, cur);
472
- } catch (e) { /* best-effort */ }
464
+ // macOS defaults to zsh, but plenty of Mac developers still run bash — and a login bash shell
465
+ // reads .bash_profile, not .bashrc. Writing only .zshrc left those users without the token or the
466
+ // PATH entry exported. Update every rc that already exists, plus the platform default so a fresh
467
+ // machine still gets one. (Harmless if unused: nothing reads an rc for a shell you don't run.)
468
+ const rcs = pf.os === 'mac'
469
+ ? ['.zshrc', '.bash_profile', '.profile']
470
+ : ['.bashrc'];
471
+ const targets = rcs.map((f) => path.join(HOME, f)).filter((p, i) => i === 0 || fs.existsSync(p));
472
+ for (const rc of targets) {
473
+ try {
474
+ let cur = fs.existsSync(rc) ? fs.readFileSync(rc, 'utf8') : '';
475
+ cur = cur.replace(/(^|\n)export ENSEMBLE_MACHINE_TOKEN=.*\n?/g, '\n');
476
+ if (!cur.endsWith('\n')) cur += '\n';
477
+ cur += `export ENSEMBLE_MACHINE_TOKEN="${machineToken}"\n`;
478
+ if (!/\.ensemble\/bin/.test(cur)) cur += `export PATH="$HOME/.ensemble/bin:$PATH"\n`;
479
+ fs.writeFileSync(rc, cur);
480
+ } catch (e) { /* best-effort, per rc */ }
481
+ }
473
482
  }
474
483
 
475
484
  function ensureWindowsRuntimePath() {
@@ -605,7 +614,14 @@ function engineMarkers(engine) {
605
614
  case 'grok': return [path.join(HOME, '.grok', 'auth.json'), path.join(HOME, '.grok', 'config.toml')];
606
615
  case 'opencode': return [path.join(HOME, '.config', 'opencode', 'opencode.json'), path.join(HOME, '.local', 'share', 'opencode'), path.join(HOME, '.opencode')];
607
616
  case 'omp': return [path.join(HOME, '.omp', 'auth.json'), path.join(HOME, '.omp', 'config.json')];
608
- case 'antigravity': return [path.join(process.env.LOCALAPPDATA || '', 'Antigravity'), path.join(process.env.LOCALAPPDATA || '', 'antigravity'), path.join(HOME, '.antigravity', 'config.json')];
617
+ // LOCALAPPDATA exists only on Windows; without the guard the `|| ''` collapsed those two into
618
+ // bogus relative paths that got existsSync'd on every mac/linux detection. Harmless but dead.
619
+ case 'antigravity': return [
620
+ ...(process.env.LOCALAPPDATA
621
+ ? [path.join(process.env.LOCALAPPDATA, 'Antigravity'), path.join(process.env.LOCALAPPDATA, 'antigravity')]
622
+ : []),
623
+ path.join(HOME, '.antigravity', 'config.json'),
624
+ ];
609
625
  default: return [];
610
626
  }
611
627
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ensemble",
3
- "version": "0.5.42",
3
+ "version": "0.5.44",
4
4
  "description": "Connect this machine to Ensemble — runs the local agent runner and wires the ensemble session bus so your coding sessions talk (per-org, isolated).",
5
5
  "bin": {
6
6
  "ensemble": "bin/ensemble.js"
@@ -13,11 +13,11 @@
13
13
  "node": ">=18"
14
14
  },
15
15
  "optionalDependencies": {
16
- "@webority/ensemble-darwin-arm64": "0.5.42",
17
- "@webority/ensemble-darwin-x64": "0.5.42",
18
- "@webority/ensemble-linux-arm64": "0.5.42",
19
- "@webority/ensemble-linux-x64": "0.5.42",
20
- "@webority/ensemble-win-x64": "0.5.42"
16
+ "@webority/ensemble-darwin-arm64": "0.5.44",
17
+ "@webority/ensemble-darwin-x64": "0.5.44",
18
+ "@webority/ensemble-linux-arm64": "0.5.44",
19
+ "@webority/ensemble-linux-x64": "0.5.44",
20
+ "@webority/ensemble-win-x64": "0.5.44"
21
21
  },
22
22
  "files": [
23
23
  "bin",