@reason-machines/cli 0.2.380 → 0.2.382
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/README.md +3 -1
- package/package.json +11 -8
- package/postinstall.mjs +8 -9
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ reason login
|
|
|
10
10
|
|
|
11
11
|
Requires Node.js 18 or newer for npm installation. Both reason and the compatibility alias ara are installed.
|
|
12
12
|
|
|
13
|
-
Platforms: macOS Apple Silicon and Intel; Linux ARM64 and x64 with glibc or musl
|
|
13
|
+
Platforms: macOS Apple Silicon and Intel; Linux ARM64 and x64 with glibc or musl; Windows ARM64 and x64.
|
|
14
14
|
|
|
15
15
|
The package runs an install script that places the native binary for your platform. If your package manager skips
|
|
16
16
|
optional dependencies, the script downloads the same archive from reasonmachines.com and checks its SHA-256.
|
|
@@ -18,6 +18,8 @@ With Bun, trust the script: bun install -g --trust @reason-machines/cli
|
|
|
18
18
|
|
|
19
19
|
Without Node.js: curl -fsSL https://reasonmachines.com/install.sh | bash
|
|
20
20
|
|
|
21
|
+
On Windows without Node.js, in PowerShell: irm https://reasonmachines.com/install.ps1 | iex
|
|
22
|
+
|
|
21
23
|
## Use
|
|
22
24
|
|
|
23
25
|
~~~sh
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reason-machines/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.382",
|
|
4
4
|
"description": "Reason CLI for sessions, coding agents, and optional local device work",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -22,19 +22,22 @@
|
|
|
22
22
|
},
|
|
23
23
|
"os": [
|
|
24
24
|
"darwin",
|
|
25
|
-
"linux"
|
|
25
|
+
"linux",
|
|
26
|
+
"win32"
|
|
26
27
|
],
|
|
27
28
|
"cpu": [
|
|
28
29
|
"arm64",
|
|
29
30
|
"x64"
|
|
30
31
|
],
|
|
31
32
|
"optionalDependencies": {
|
|
32
|
-
"@reason-machines/cli-darwin-arm64": "0.2.
|
|
33
|
-
"@reason-machines/cli-darwin-x64": "0.2.
|
|
34
|
-
"@reason-machines/cli-linux-arm64": "0.2.
|
|
35
|
-
"@reason-machines/cli-linux-arm64-musl": "0.2.
|
|
36
|
-
"@reason-machines/cli-linux-x64": "0.2.
|
|
37
|
-
"@reason-machines/cli-linux-x64-musl": "0.2.
|
|
33
|
+
"@reason-machines/cli-darwin-arm64": "0.2.382",
|
|
34
|
+
"@reason-machines/cli-darwin-x64": "0.2.382",
|
|
35
|
+
"@reason-machines/cli-linux-arm64": "0.2.382",
|
|
36
|
+
"@reason-machines/cli-linux-arm64-musl": "0.2.382",
|
|
37
|
+
"@reason-machines/cli-linux-x64": "0.2.382",
|
|
38
|
+
"@reason-machines/cli-linux-x64-musl": "0.2.382",
|
|
39
|
+
"@reason-machines/cli-win32-arm64": "0.2.382",
|
|
40
|
+
"@reason-machines/cli-win32-x64": "0.2.382"
|
|
38
41
|
},
|
|
39
42
|
"publishConfig": {
|
|
40
43
|
"access": "public",
|
package/postinstall.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { chmodSync, copyFileSync, cpSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { chmodSync, copyFileSync, cpSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { execFileSync } from "node:child_process";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
@@ -15,12 +15,8 @@ function linuxLibc() {
|
|
|
15
15
|
return "-musl";
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
if (process.platform === "win32") {
|
|
19
|
-
process.stderr.write("Reason runs on macOS and Linux. On Windows, install it inside WSL: npm install -g @reason-machines/cli\n");
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
18
|
const suffix = `${process.platform}-${process.arch}${linuxLibc()}`;
|
|
19
|
+
const executableName = process.platform === "win32" ? "ara.exe" : "ara";
|
|
24
20
|
const credentialLibraryName = "libara_device_keychain.dylib";
|
|
25
21
|
const packageName = `@reason-machines/cli-${suffix}`;
|
|
26
22
|
const { version } = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8"));
|
|
@@ -30,7 +26,7 @@ const releaseOrigin = process.env.REASON_RELEASE_ORIGIN || "https://reasonmachin
|
|
|
30
26
|
/** The platform package npm installed, or null when it skipped it (not yet served, --omit=optional). */
|
|
31
27
|
function installedPackageDirectory() {
|
|
32
28
|
try {
|
|
33
|
-
return dirname(dirname(require.resolve(`${packageName}/bin
|
|
29
|
+
return dirname(dirname(require.resolve(`${packageName}/bin/${executableName}`)));
|
|
34
30
|
} catch (error) {
|
|
35
31
|
if (error?.code === "MODULE_NOT_FOUND") return null;
|
|
36
32
|
throw error;
|
|
@@ -92,9 +88,12 @@ try {
|
|
|
92
88
|
const binDirectory = join(packageDirectory, "bin");
|
|
93
89
|
// npm links bin/reason.exe on every platform; the name is only the bin target.
|
|
94
90
|
const destination = fileURLToPath(new URL("./bin/reason.exe", import.meta.url));
|
|
95
|
-
copyFileSync(join(binDirectory,
|
|
96
|
-
chmodSync(destination, 0o755);
|
|
91
|
+
copyFileSync(join(binDirectory, executableName), destination);
|
|
92
|
+
if (process.platform !== "win32") chmodSync(destination, 0o755);
|
|
93
|
+
// Includes the platform's sandbox helper (apply-seccomp, srt-win.exe).
|
|
97
94
|
replaceTree(join(binDirectory, "runtime", "srt"), join(dirname(destination), "runtime", "srt"));
|
|
95
|
+
// pi-tui's optional Windows helper, probed beside the executable.
|
|
96
|
+
if (existsSync(join(binDirectory, "native"))) replaceTree(join(binDirectory, "native"), join(dirname(destination), "native"));
|
|
98
97
|
if (process.platform === "darwin") {
|
|
99
98
|
const credentialLibraryDestination = fileURLToPath(new URL(`./bin/${credentialLibraryName}`, import.meta.url));
|
|
100
99
|
copyFileSync(join(binDirectory, credentialLibraryName), credentialLibraryDestination);
|