@rayu-dev/rayu-cli 1.3.466 → 1.4.467
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/dist/rayu.js +168618 -175328
- package/package.json +2 -3
- package/scripts/preinstall.cjs +27 -57
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rayu-dev/rayu-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.467",
|
|
4
4
|
"description": "Rayu-CLI — a multi-provider AI coding CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"scripts/preinstall.cjs",
|
|
13
13
|
"scripts/postinstall.cjs"
|
|
14
14
|
],
|
|
15
|
-
|
|
16
15
|
"scripts": {
|
|
17
16
|
"preinstall": "node scripts/preinstall.cjs",
|
|
18
17
|
"postinstall": "node scripts/postinstall.cjs",
|
|
@@ -50,7 +49,6 @@
|
|
|
50
49
|
"@aws-sdk/client-sts": "^3.1057.0",
|
|
51
50
|
"@commander-js/extra-typings": "12",
|
|
52
51
|
"@google/genai": "2.8.0",
|
|
53
|
-
"@growthbook/growthbook": "^1.6.5",
|
|
54
52
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
55
53
|
"@opentelemetry/api": "^1.9.1",
|
|
56
54
|
"@opentelemetry/api-logs": "^0.218.0",
|
|
@@ -101,6 +99,7 @@
|
|
|
101
99
|
"react": "^19.2.6",
|
|
102
100
|
"react-reconciler": "^0.33.0",
|
|
103
101
|
"semver": "^7.8.1",
|
|
102
|
+
"sharp": "0.35.3",
|
|
104
103
|
"shell-quote": "^1.8.4",
|
|
105
104
|
"signal-exit": "^4.1.0",
|
|
106
105
|
"stack-utils": "^2.0.6",
|
package/scripts/preinstall.cjs
CHANGED
|
@@ -1,59 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} catch (_) {
|
|
31
|
-
// Non-interactive environment (CI, pipes, Windows) — proceed with install
|
|
32
|
-
process.exit(0);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
process.stdout.write(
|
|
36
|
-
'\n Rayu CLI v' + currentVersion + ' is already installed.\n' +
|
|
37
|
-
' Replace with the latest version? Your config will not be changed. [y/N] '
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
// Read answer synchronously directly from the terminal
|
|
41
|
-
const buf = Buffer.alloc(256);
|
|
42
|
-
let bytesRead = 0;
|
|
43
|
-
try {
|
|
44
|
-
bytesRead = fs.readSync(ttyFd, buf, 0, buf.length, null);
|
|
45
|
-
} catch (_) {
|
|
46
|
-
fs.closeSync(ttyFd);
|
|
47
|
-
process.exit(0);
|
|
48
|
-
}
|
|
49
|
-
fs.closeSync(ttyFd);
|
|
50
|
-
|
|
51
|
-
const answer = buf.slice(0, bytesRead).toString().trim();
|
|
52
|
-
|
|
53
|
-
if (answer.toLowerCase() === 'y') {
|
|
54
|
-
process.stdout.write(' Installing latest version...\n\n');
|
|
55
|
-
process.exit(0);
|
|
56
|
-
} else {
|
|
57
|
-
process.stdout.write(' Keeping current version. No changes made.\n\n');
|
|
58
|
-
process.exit(1);
|
|
59
|
-
}
|
|
3
|
+
// This script intentionally does nothing interactive.
|
|
4
|
+
//
|
|
5
|
+
// It previously prompted "Replace with the latest version? [y/N]" via a
|
|
6
|
+
// blocking fs.readSync() on /dev/tty, and exited 1 (aborting the whole
|
|
7
|
+
// `npm install` per npm's lifecycle-script contract) on any answer other
|
|
8
|
+
// than "y".
|
|
9
|
+
//
|
|
10
|
+
// That was broken in two independent ways:
|
|
11
|
+
// 1. The prompt's answer never actually controlled anything — npm always
|
|
12
|
+
// overwrites the previous global install once preinstall exits 0,
|
|
13
|
+
// regardless of what the script printed. The y/N choice was purely
|
|
14
|
+
// cosmetic.
|
|
15
|
+
// 2. When `npm install -g` is spawned as a child process (e.g. from
|
|
16
|
+
// `rayu update`) or run inside another tool's spinner/output, this
|
|
17
|
+
// prompt's text can be interleaved with or overwritten by the parent
|
|
18
|
+
// process's own terminal output, making the prompt invisible. Users
|
|
19
|
+
// would see a stalled spinner while the script silently blocked on
|
|
20
|
+
// readSync waiting for a keypress that was never visibly requested —
|
|
21
|
+
// indistinguishable from a hang, forcing a Ctrl-C. Any non-"y" answer
|
|
22
|
+
// (including "no answer available", e.g. non-interactive CI/pipes)
|
|
23
|
+
// then aborted the install with a non-zero exit, breaking automated
|
|
24
|
+
// and headless updates entirely.
|
|
25
|
+
//
|
|
26
|
+
// Always exit 0 so `npm install -g @rayu-dev/rayu-cli[@latest]` completes
|
|
27
|
+
// deterministically and non-interactively on every OS and in every
|
|
28
|
+
// environment (interactive terminal, CI, piped, Windows).
|
|
29
|
+
process.exit(0);
|