rird-ai 2.3.2 → 2.3.3

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.
Files changed (3) hide show
  1. package/bin/rird +25 -6
  2. package/package.json +12 -12
  3. package/postinstall.mjs +47 -11
package/bin/rird CHANGED
@@ -95,13 +95,23 @@ if (command === "upgrade" || command === "update") {
95
95
  ["install", "-g", "rird-ai@latest"],
96
96
  { stdio: "inherit", shell: true }
97
97
  )
98
- } else {
98
+ } else if (os.platform() !== "win32") {
99
+ // curl | bash only works on Unix systems
99
100
  console.log("Running: curl -fsSL https://rird.ai/install.sh | bash")
100
101
  result = childProcess.spawnSync(
101
102
  "bash",
102
103
  ["-c", "curl -fsSL https://rird.ai/install.sh | bash"],
103
104
  { stdio: "inherit" }
104
105
  )
106
+ } else {
107
+ // Windows without npm - give clear instructions
108
+ console.error("")
109
+ console.error("Error [INSTALLATION_ERROR]: npm not found")
110
+ console.error("")
111
+ console.error("Please install Node.js from https://nodejs.org/")
112
+ console.error("Then run: npm install -g rird-ai@latest")
113
+ console.error("")
114
+ process.exit(1)
105
115
  }
106
116
 
107
117
  if (result.error || result.status !== 0) {
@@ -257,11 +267,6 @@ if (command === "activate") {
257
267
  process.exit(0)
258
268
  } else {
259
269
  // Only run the binary if NOT processing a special command
260
- const envPath = process.env.RIRD_BIN_PATH
261
- if (envPath) {
262
- run(envPath)
263
- }
264
-
265
270
  const scriptPath = fs.realpathSync(__filename)
266
271
  const scriptDir = path.dirname(scriptPath)
267
272
 
@@ -315,6 +320,14 @@ if (command === "activate") {
315
320
  const engineDir = path.join(rirdHome, "engine")
316
321
  const brainDir = path.join(rirdHome, "brain")
317
322
 
323
+ // Ensure directories exist
324
+ if (!fs.existsSync(rirdHome)) {
325
+ fs.mkdirSync(rirdHome, { recursive: true })
326
+ }
327
+ if (!fs.existsSync(engineDir)) {
328
+ fs.mkdirSync(engineDir, { recursive: true })
329
+ }
330
+
318
331
  // Use engine config (from postinstall with MCP) if it exists, otherwise brain
319
332
  const engineConfig = path.join(engineDir, "rird.json")
320
333
  const brainConfig = path.join(brainDir, "rird.json")
@@ -386,6 +399,12 @@ if (command === "activate") {
386
399
 
387
400
  const args = process.argv.slice(2)
388
401
 
402
+ // Check for explicit binary path override (must be after run() is defined)
403
+ const envPath = process.env.RIRD_BIN_PATH
404
+ if (envPath && fs.existsSync(envPath)) {
405
+ run(envPath)
406
+ }
407
+
389
408
  const resolved = findBinary(scriptDir)
390
409
  if (!resolved) {
391
410
  // FALLBACK: If binary not found, try to run from source if in dev tree
package/package.json CHANGED
@@ -7,18 +7,18 @@
7
7
  "scripts": {
8
8
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
9
9
  },
10
- "version": "2.3.2",
10
+ "version": "2.3.3",
11
11
  "optionalDependencies": {
12
- "rird-linux-arm64": "2.3.2",
13
- "rird-linux-x64": "2.3.2",
14
- "rird-linux-x64-baseline": "2.3.2",
15
- "rird-linux-arm64-musl": "2.3.2",
16
- "rird-linux-x64-musl": "2.3.2",
17
- "rird-linux-x64-baseline-musl": "2.3.2",
18
- "rird-darwin-arm64": "2.3.2",
19
- "rird-darwin-x64": "2.3.2",
20
- "rird-darwin-x64-baseline": "2.3.2",
21
- "rird-windows-x64": "2.3.2",
22
- "rird-windows-x64-baseline": "2.3.2"
12
+ "rird-linux-arm64": "2.3.3",
13
+ "rird-linux-x64": "2.3.3",
14
+ "rird-linux-x64-baseline": "2.3.3",
15
+ "rird-linux-arm64-musl": "2.3.3",
16
+ "rird-linux-x64-musl": "2.3.3",
17
+ "rird-linux-x64-baseline-musl": "2.3.3",
18
+ "rird-darwin-arm64": "2.3.3",
19
+ "rird-darwin-x64": "2.3.3",
20
+ "rird-darwin-x64-baseline": "2.3.3",
21
+ "rird-windows-x64": "2.3.3",
22
+ "rird-windows-x64-baseline": "2.3.3"
23
23
  }
24
24
  }
package/postinstall.mjs CHANGED
@@ -93,7 +93,26 @@ function installPythonDeps(pipCmd) {
93
93
  "patchright", "beautifulsoup4", "lxml", "pydantic",
94
94
  "psutil", "python-dotenv", "aiohttp", "requests"
95
95
  ]
96
- execSafe(`${pipCmd} install --user ${deps.join(" ")}`, { stdio: "inherit" })
96
+ // On Windows, --user can conflict with system Python; try without first
97
+ // Use spawnSync for better cross-platform argument handling
98
+ const pipArgs = pipCmd.includes("-m pip")
99
+ ? pipCmd.split(" ").concat(["install", ...deps])
100
+ : ["install", ...deps]
101
+
102
+ const pipExecutable = pipCmd.includes("-m pip") ? pipCmd.split(" ")[0] : pipCmd
103
+ const fullArgs = pipCmd.includes("-m pip")
104
+ ? ["-m", "pip", "install", "--user", ...deps]
105
+ : ["install", "--user", ...deps]
106
+
107
+ // Try with --user first (more compatible), fall back to without
108
+ let result = spawnSync(pipExecutable, fullArgs, { stdio: "inherit", timeout: 300000, shell: isWindows })
109
+ if (result.status !== 0) {
110
+ log("Retrying pip install without --user flag...")
111
+ const fallbackArgs = pipCmd.includes("-m pip")
112
+ ? ["-m", "pip", "install", ...deps]
113
+ : ["install", ...deps]
114
+ spawnSync(pipExecutable, fallbackArgs, { stdio: "inherit", timeout: 300000, shell: isWindows })
115
+ }
97
116
  }
98
117
 
99
118
  // Clone browser MCP (Chrome)
@@ -105,12 +124,20 @@ function cloneChromeBrowserMcp() {
105
124
 
106
125
  log("Installing Chrome browser integration...")
107
126
 
108
- // Try git clone
127
+ // Try git clone - use spawnSync for better cross-platform path handling
109
128
  if (execSafe("git --version")) {
110
- const result = execSafe(`git clone --depth 1 https://github.com/vibheksoni/stealth-browser-mcp "${MCP_DIR}"`, { stdio: "inherit" })
111
- if (result !== null || fs.existsSync(MCP_DIR)) {
112
- log("Chrome browser integration installed")
113
- return true
129
+ try {
130
+ const result = spawnSync("git", ["clone", "--depth", "1", "https://github.com/vibheksoni/stealth-browser-mcp", MCP_DIR], {
131
+ stdio: "inherit",
132
+ timeout: 120000,
133
+ shell: isWindows
134
+ })
135
+ if (result.status === 0 || fs.existsSync(MCP_DIR)) {
136
+ log("Chrome browser integration installed")
137
+ return true
138
+ }
139
+ } catch (e) {
140
+ log(`Git clone failed: ${e.message}`)
114
141
  }
115
142
  }
116
143
 
@@ -434,17 +461,26 @@ function installComputerUseMcp() {
434
461
  const mcpPath = path.join(RIRD_HOME, "mcp", "automation-mcp")
435
462
  if (!fs.existsSync(mcpPath)) {
436
463
  fs.mkdirSync(path.join(RIRD_HOME, "mcp"), { recursive: true })
437
- execSafe(`git clone --depth 1 https://github.com/ashwwwin/automation-mcp "${mcpPath}"`, { stdio: "inherit" })
438
- if (fs.existsSync(mcpPath)) {
439
- execSafe("bun install", { cwd: mcpPath, stdio: "inherit" })
464
+ // Use spawnSync for better path handling
465
+ const cloneResult = spawnSync("git", ["clone", "--depth", "1", "https://github.com/ashwwwin/automation-mcp", mcpPath], {
466
+ stdio: "inherit",
467
+ timeout: 120000
468
+ })
469
+ if (cloneResult.status === 0 && fs.existsSync(mcpPath)) {
470
+ // Check if bun is available
471
+ if (execSafe("bun --version")) {
472
+ spawnSync("bun", ["install"], { cwd: mcpPath, stdio: "inherit" })
473
+ } else {
474
+ log("Note: bun not found - install bun for full computer-use support")
475
+ }
440
476
  }
441
477
  }
442
478
  } else if (isLinux) {
443
479
  log("Linux: computer-use via npx mcp-desktop-automation")
444
480
  // Pre-cache the package
445
481
  execSafe("npx -y mcp-desktop-automation --version", { stdio: "pipe" })
446
- // Install xdotool as fallback
447
- execSafe("sudo apt install -y xdotool 2>/dev/null || true", { stdio: "pipe" })
482
+ // Install xdotool as fallback (silent if not sudo)
483
+ execSafe("which xdotool || (which apt && sudo apt install -y xdotool 2>/dev/null) || true", { stdio: "pipe" })
448
484
  }
449
485
  }
450
486