@yooz-labs/remi 0.4.7-dev.2 → 0.4.7
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/remi +2 -69
- package/package.json +5 -5
package/bin/remi
CHANGED
|
@@ -23,46 +23,10 @@ if (!pkg) {
|
|
|
23
23
|
process.exit(1);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
* Auto-upgrade the platform binary when the wrapper version doesn't match.
|
|
28
|
-
* This handles package managers (e.g. bun --force) that upgrade the main
|
|
29
|
-
* package but skip optionalDependencies.
|
|
30
|
-
*/
|
|
31
|
-
function autoUpgradePlatformBinary(wrapperVersion) {
|
|
32
|
-
console.error(`[remi] Binary outdated, upgrading ${pkg} to ${wrapperVersion}...`);
|
|
33
|
-
|
|
34
|
-
// Try npm first (most reliable for global installs), then bun
|
|
35
|
-
const managers = [
|
|
36
|
-
{ cmd: "npm", args: ["install", "-g", `${pkg}@${wrapperVersion}`] },
|
|
37
|
-
{ cmd: "bun", args: ["install", "-g", `${pkg}@${wrapperVersion}`] },
|
|
38
|
-
];
|
|
39
|
-
|
|
40
|
-
for (const { cmd, args } of managers) {
|
|
41
|
-
try {
|
|
42
|
-
const r = spawnSync(cmd, args, { stdio: "pipe", timeout: 30000 });
|
|
43
|
-
if (r.status === 0) {
|
|
44
|
-
console.error(`[remi] Upgraded ${pkg} to ${wrapperVersion} via ${cmd}`);
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
const stderr = r.stderr?.toString().trim();
|
|
48
|
-
if (stderr) {
|
|
49
|
-
console.error(`[remi] ${cmd} upgrade failed (exit ${r.status}): ${stderr.split("\n")[0]}`);
|
|
50
|
-
}
|
|
51
|
-
} catch (err) {
|
|
52
|
-
// ENOENT = command not found (expected if npm/bun not installed); log anything else
|
|
53
|
-
if (err.code !== "ENOENT") {
|
|
54
|
-
console.error(`[remi] ${cmd} upgrade error: ${err.message}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
26
|
let binPath;
|
|
62
|
-
let platPkgDir;
|
|
63
27
|
try {
|
|
64
|
-
|
|
65
|
-
binPath = path.join(
|
|
28
|
+
const pkgDir = path.dirname(require.resolve(`${pkg}/package.json`));
|
|
29
|
+
binPath = path.join(pkgDir, "bin", "remi");
|
|
66
30
|
} catch (err) {
|
|
67
31
|
if (err.code === "MODULE_NOT_FOUND") {
|
|
68
32
|
console.error(`Platform package ${pkg} is not installed.`);
|
|
@@ -79,37 +43,6 @@ if (!fs.existsSync(binPath)) {
|
|
|
79
43
|
process.exit(1);
|
|
80
44
|
}
|
|
81
45
|
|
|
82
|
-
// Check if the platform binary version matches the wrapper package version.
|
|
83
|
-
// If mismatched, attempt an automatic upgrade before falling through to the
|
|
84
|
-
// (possibly stale) binary so the user isn't stuck.
|
|
85
|
-
try {
|
|
86
|
-
const wrapperPkg = require(path.resolve(__dirname, "..", "package.json"));
|
|
87
|
-
const platPkg = require(path.join(platPkgDir, "package.json"));
|
|
88
|
-
if (wrapperPkg.version && platPkg.version && wrapperPkg.version !== platPkg.version) {
|
|
89
|
-
if (autoUpgradePlatformBinary(wrapperPkg.version)) {
|
|
90
|
-
// Re-resolve after upgrade to use the new binary
|
|
91
|
-
try {
|
|
92
|
-
delete require.cache[require.resolve(`${pkg}/package.json`)];
|
|
93
|
-
platPkgDir = path.dirname(require.resolve(`${pkg}/package.json`));
|
|
94
|
-
binPath = path.join(platPkgDir, "bin", "remi");
|
|
95
|
-
} catch (resolveErr) {
|
|
96
|
-
console.error(
|
|
97
|
-
`[remi] Upgrade succeeded but failed to resolve new binary: ${resolveErr.message}`
|
|
98
|
-
);
|
|
99
|
-
console.error(`[remi] Running previously resolved binary at: ${binPath}`);
|
|
100
|
-
}
|
|
101
|
-
} else {
|
|
102
|
-
console.error(
|
|
103
|
-
`[remi] Version mismatch: wrapper is ${wrapperPkg.version} but binary is ${platPkg.version}.`
|
|
104
|
-
);
|
|
105
|
-
console.error(`[remi] Auto-upgrade failed. Fix manually:`);
|
|
106
|
-
console.error(`[remi] npm install -g @yooz-labs/remi@${wrapperPkg.version}`);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
} catch (err) {
|
|
110
|
-
console.error(`[remi] Version check skipped: ${err.message}`);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
46
|
const result = spawnSync(binPath, process.argv.slice(2), {
|
|
114
47
|
stdio: "inherit",
|
|
115
48
|
env: process.env,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yooz-labs/remi",
|
|
3
|
-
"version": "0.4.7
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "Remote monitor for Claude Code CLI sessions",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"remi": "bin/remi"
|
|
21
21
|
},
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"@yooz-labs/remi-darwin-arm64": "0.4.7
|
|
24
|
-
"@yooz-labs/remi-darwin-x64": "0.4.7
|
|
25
|
-
"@yooz-labs/remi-linux-arm64": "0.4.7
|
|
26
|
-
"@yooz-labs/remi-linux-x64": "0.4.7
|
|
23
|
+
"@yooz-labs/remi-darwin-arm64": "0.4.7",
|
|
24
|
+
"@yooz-labs/remi-darwin-x64": "0.4.7",
|
|
25
|
+
"@yooz-labs/remi-linux-arm64": "0.4.7",
|
|
26
|
+
"@yooz-labs/remi-linux-x64": "0.4.7"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">=16"
|