relmio 0.2.8 → 0.2.9

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/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ checks the registry separately after publication.
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## [0.2.9] - 2026-08-02
11
+
12
+ ### Fixed
13
+
14
+ - Launch the local ChatGPT OAuth helper through the current Windows Node.js
15
+ runtime and npm's JavaScript CLI instead of executing `npx.cmd` directly,
16
+ preventing `spawn EINVAL` while preserving the native `npx` path on macOS,
17
+ Linux, WSL, and Git Bash.
18
+ - Explain how to recover when a refreshed wizard page no longer has its private
19
+ session URL.
20
+
10
21
  ## [0.2.8] - 2026-08-02
11
22
 
12
23
  ### Changed
package/README.md CHANGED
@@ -124,6 +124,10 @@ Users who already have Node.js 22 or newer can run the npm package directly:
124
124
  npx --yes --ignore-scripts relmio@latest
125
125
  ```
126
126
 
127
+ Keep the active setup terminal open while using the wizard. If the page says
128
+ the wizard link is incomplete, close that tab and open the full `Local wizard:`
129
+ URL printed by the current terminal instead of refreshing the stripped page.
130
+
127
131
  ### Requirements
128
132
 
129
133
  - On macOS/Linux/WSL/Git Bash: `curl`, `awk`, `tar`, and either `sha256sum` or
@@ -113,7 +113,9 @@ bypassed.
113
113
  | `node: command not found`, `node is not recognized`, or Node is older than 22 | The NPX fallback cannot use the local runtime. | Use the macOS/Linux curl command or the native Windows PowerShell/Command Prompt command above. Either can run with a verified temporary runtime. Do not install Node.js on the VPS for the wizard. |
114
114
  | `curl` or `sh` is not recognized on Windows | The macOS/Linux command was pasted into a native Windows terminal. | Use the PowerShell command in PowerShell, or the longer `powershell -NoProfile ...` command in Command Prompt. Git Bash is not required. |
115
115
  | A bootstrap reports a checksum mismatch | The Node.js download did not match the official SHA-256 manifest, so it was not executed. | Retry on a trusted connection. Do not bypass the check. If it repeats, use an existing Node.js 22+ installation and report the sanitized error. |
116
+ | Windows reports `spawn EINVAL` when starting ChatGPT sign-in | An older wizard tried to execute `npx.cmd` directly; Windows requires the current Node runtime to launch npm's JavaScript CLI. | Update to the latest `relmio@latest` release and restart the setup command. The current wizard keeps the macOS/Linux/WSL/Git Bash `npx` path unchanged. |
116
117
  | The browser did not open | The automatic browser launch failed, but the local server may still be running. | Keep the newest terminal open and copy its newest `127.0.0.1` setup URL into the browser. Do not reuse a URL from a closed terminal. |
118
+ | The wizard says `This wizard link is incomplete` | The page was refreshed or opened without the private `?session=...` token; the token is removed from the address bar after startup. | Close the tab and open the complete `Local wizard:` URL printed by the active setup terminal. Do not reuse a URL from a closed terminal. |
117
119
  | An old wizard page reports an invalid or expired setup session | The local server was closed or a newer wizard run created a different one-time session token. | Close the old page and use only the URL printed by the currently running terminal. |
118
120
  | `npx` appears to run an older wizard | An old terminal or tab is still active, or the package was run without an explicit tag. | Close old runs, check `npm view relmio version`, then run `npx --yes --ignore-scripts relmio@latest`. |
119
121
  | `This sign-in request expired` | The OAuth tab is old or the five-minute callback window ended. | Close the old tab and select **Refresh ChatGPT sign-in** from the newest active wizard. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relmio",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Turn a supported ChatGPT/Codex OAuth sign-in into a private OpenAI-compatible endpoint, starting with self-hosted n8n.",
5
5
  "keywords": [
6
6
  "relmio",
@@ -16,6 +16,37 @@ const OPENAI_AUTH_ORIGIN = "https://auth.openai.com";
16
16
  const wait = (milliseconds) =>
17
17
  new Promise((resolvePromise) => setTimeout(resolvePromise, milliseconds));
18
18
 
19
+ function resolveWindowsNpxCli({ env, execPath }) {
20
+ const npmExecPathKey = Object.keys(env ?? {}).find(
21
+ (key) => key.toLowerCase() === "npm_execpath",
22
+ );
23
+ const npmExecPath =
24
+ npmExecPathKey === undefined ? undefined : env[npmExecPathKey];
25
+
26
+ if (typeof npmExecPath === "string") {
27
+ if (/(?:^|[\\/])npx-cli\.js$/iu.test(npmExecPath)) {
28
+ return resolve(npmExecPath);
29
+ }
30
+ if (/(?:^|[\\/])npm-cli\.js$/iu.test(npmExecPath)) {
31
+ return resolve(dirname(npmExecPath), "npx-cli.js");
32
+ }
33
+ }
34
+
35
+ return resolve(dirname(execPath), "node_modules", "npm", "bin", "npx-cli.js");
36
+ }
37
+
38
+ function createNpxInvocation({ platform, env, execPath }) {
39
+ if (platform !== "win32") {
40
+ return { command: "npx", prefixArgs: [] };
41
+ }
42
+
43
+ return {
44
+ command: execPath,
45
+ // Windows cannot execute npx.cmd directly with shell:false.
46
+ prefixArgs: [resolveWindowsNpxCli({ env, execPath })],
47
+ };
48
+ }
49
+
19
50
  export function resolveAuthPath({
20
51
  env = process.env,
21
52
  homeDirectory = homedir(),
@@ -132,11 +163,12 @@ export async function startOAuthLogin({
132
163
  env = process.env,
133
164
  homeDirectory = homedir(),
134
165
  platform = process.platform,
166
+ execPath = process.execPath,
135
167
  spawnProcess = spawn,
136
168
  createPendingId = randomUUID,
137
169
  waitForCredentialPoll = wait,
138
170
  } = {}) {
139
- const command = platform === "win32" ? "npx.cmd" : "npx";
171
+ const npxInvocation = createNpxInvocation({ platform, env, execPath });
140
172
  const authPath = resolveAuthPath({ env, homeDirectory });
141
173
  const authDirectory = dirname(authPath);
142
174
  const pendingAuthPath = `${authPath}.pending-${createPendingId()}`;
@@ -155,12 +187,24 @@ export async function startOAuthLogin({
155
187
  await fileSystem.mkdir(authDirectory, { recursive: true, mode: 0o700 });
156
188
  await fileSystem.chmod(authDirectory, 0o700);
157
189
 
158
- const child = spawnProcess(command, args, {
159
- env,
160
- shell: false,
161
- stdio: ["ignore", "pipe", "pipe"],
162
- windowsHide: true,
163
- });
190
+ let child;
191
+ try {
192
+ child = spawnProcess(
193
+ npxInvocation.command,
194
+ [...npxInvocation.prefixArgs, ...args],
195
+ {
196
+ env,
197
+ shell: false,
198
+ stdio: ["ignore", "pipe", "pipe"],
199
+ windowsHide: true,
200
+ },
201
+ );
202
+ } catch (error) {
203
+ throw new Error(
204
+ "The local sign-in command could not start. Update Relmio and retry with Node.js 22 or newer.",
205
+ { cause: error },
206
+ );
207
+ }
164
208
  child.stderr?.resume();
165
209
 
166
210
  let loginOutput = "";
package/src/ui/app.js CHANGED
@@ -146,7 +146,9 @@ function showStep(step) {
146
146
 
147
147
  async function api(path, { method = "GET", body } = {}) {
148
148
  if (!token) {
149
- throw new Error("This wizard link is incomplete. Restart the setup command.");
149
+ throw new Error(
150
+ "This wizard link is incomplete. Close this tab and open the full URL printed by the active setup terminal.",
151
+ );
150
152
  }
151
153
 
152
154
  let response;