@jonaskahn/relo 0.1.13 → 0.1.14-beta.51.252796db

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/lib/conflict.mjs CHANGED
@@ -3,8 +3,8 @@
3
3
  // installers. Two installs would still fight over the name, the home
4
4
  // directory, and the ports, so the install refuses when a command this
5
5
  // package did not install answers PATH.
6
- import { accessSync, constants, existsSync, realpathSync } from 'node:fs';
7
- import { delimiter, join, resolve, sep } from 'node:path';
6
+ import { accessSync, constants, existsSync, readFileSync, realpathSync } from 'node:fs';
7
+ import { delimiter, dirname, join, resolve, sep } from 'node:path';
8
8
  import { homedir } from 'node:os';
9
9
  import { execFileSync } from 'node:child_process';
10
10
 
@@ -44,11 +44,29 @@ export function findConflictingRelo({
44
44
  if (selfDir && insideDir(candidate, selfDir)) {
45
45
  continue;
46
46
  }
47
+ if (selfDir && nodePlatform === 'win32' && ownNpmShim(candidate, selfDir)) {
48
+ continue;
49
+ }
47
50
  return candidate;
48
51
  }
49
52
  return null;
50
53
  }
51
54
 
55
+ // npm's Windows command shim is a batch file, not a symlink. Recognize its
56
+ // launcher invocation only; other shim formats remain conflicts until supported.
57
+ function ownNpmShim(candidate, selfDir) {
58
+ if (!candidate.toLowerCase().endsWith('.cmd')) return false;
59
+ try {
60
+ const text = readFileSync(candidate, 'utf8');
61
+ const match = /"%_prog%"[ \t]+"%dp0%\\([^"\r\n]+)"[ \t]+%\*/i.exec(text);
62
+ if (!match) return false;
63
+ const launcher = resolve(dirname(candidate), ...match[1].split('\\'));
64
+ return realpathSync(launcher) === realpathSync(join(selfDir, 'relo.mjs'));
65
+ } catch {
66
+ return false;
67
+ }
68
+ }
69
+
52
70
  // appBundles lists where the macOS Relo.app may live. The bundle installs
53
71
  // no command on PATH, so the PATH search below never sees it, and a stacked
54
72
  // install would fight it over the home directory and the ports.
package/lib/daemon.mjs CHANGED
@@ -334,6 +334,10 @@ function escapeEnd(text, at) {
334
334
  function terminalInput() {
335
335
  if (process.platform === 'win32') {
336
336
  if (!process.stdin?.isTTY) return null;
337
+ // close() unrefs stdin so the installer can exit; a second question
338
+ // needs it flowing again or its read never settles.
339
+ process.stdin.ref();
340
+ process.stdin.resume();
337
341
  return {
338
342
  input: process.stdin,
339
343
  close() {
package/lib/progress.mjs CHANGED
@@ -20,7 +20,7 @@ const BRIGHT = [155, 188, 15];
20
20
  // all share this width, so every row ends on the same column.
21
21
  const INNER = 76;
22
22
 
23
- let handle;
23
+ let handle = null;
24
24
  let tried = false;
25
25
  let active = null;
26
26
  let frame = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jonaskahn/relo",
3
- "version": "0.1.13",
3
+ "version": "0.1.14-beta.51.252796db",
4
4
  "description": "One local proxy that lets Codex, Claude Code, Cursor and Grok, etc. Talk to any model, any provider with no config changes",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",