@viraatdas/rudder 1.1.0 → 1.1.2

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viraatdas/rudder",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "A Claude Code-style terminal app for running coding agents with worktree-isolated runs.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://rudder.viraat.dev",
@@ -21,11 +21,13 @@
21
21
  "test:worker-scroll": "cargo test --manifest-path native/Cargo.toml top_origin_scroll_region_history_scrolls_like_terminal_scrollback && cargo test --manifest-path native/Cargo.toml worker_wheel && cargo test --manifest-path native/Cargo.toml wheel_scroll && cargo test --manifest-path native/Cargo.toml worker_page && cargo test --manifest-path native/Cargo.toml codex_alternate_screen_page_key",
22
22
  "copy-native": "node -e \"const fs=require('fs');const path=require('path');const sources=[path.join('target','release','rudder-native'),path.join('native','target','release','rudder-native')];const src=sources.find((candidate)=>fs.existsSync(candidate));const dest=path.join('dist','native','rudder-native');if(src){fs.mkdirSync(path.dirname(dest),{recursive:true});fs.copyFileSync(src,dest);fs.chmodSync(dest,0o755);}else if(fs.existsSync(dest)){fs.unlinkSync(dest);}\"",
23
23
  "prepack": "npm run build",
24
+ "postinstall": "node scripts/postinstall.mjs",
24
25
  "start": "node dist/index.js"
25
26
  },
26
27
  "files": [
27
28
  "dist/",
28
29
  "assets/",
30
+ "scripts/postinstall.mjs",
29
31
  "README.md",
30
32
  "package.json"
31
33
  ],
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+ // Ensures jj (Jujutsu) is installed. Rudder uses jj as its required internal
3
+ // version-control substrate, so a fresh `npm install -g @viraatdas/rudder`
4
+ // should leave the user ready to run. This runs on install and NEVER fails the
5
+ // install: on any problem it prints guidance and exits 0.
6
+ import { spawnSync } from "node:child_process";
7
+
8
+ const TAG = "[rudder postinstall]";
9
+ const log = (m) => console.log(`${TAG} ${m}`);
10
+ const warn = (m) => console.warn(`${TAG} ${m}`);
11
+
12
+ function has(cmd) {
13
+ try {
14
+ const probe = process.platform === "win32" ? "where" : "which";
15
+ return spawnSync(probe, [cmd], { stdio: "ignore" }).status === 0;
16
+ } catch {
17
+ return false;
18
+ }
19
+ }
20
+
21
+ function run(cmd, args) {
22
+ log(`running: ${cmd} ${args.join(" ")}`);
23
+ try {
24
+ return spawnSync(cmd, args, { stdio: "inherit" }).status === 0;
25
+ } catch {
26
+ return false;
27
+ }
28
+ }
29
+
30
+ function manualHelp() {
31
+ warn("Could not auto-install jj. Rudder requires jj (Jujutsu).");
32
+ warn("Install it with one of:");
33
+ warn(" macOS: brew install jj");
34
+ warn(" Rust: cargo install jj-cli");
35
+ warn(" Other: https://jj-vcs.github.io/jj/latest/install-and-setup/");
36
+ warn("Then run: rudder doctor");
37
+ }
38
+
39
+ function main() {
40
+ if (process.env.RUDDER_SKIP_POSTINSTALL) {
41
+ return;
42
+ }
43
+ if (has("jj")) {
44
+ log("jj already installed.");
45
+ return;
46
+ }
47
+ log("jj not found. Rudder requires jj (Jujutsu) as its internal substrate; attempting to install it.");
48
+ let ok = false;
49
+ if (process.platform === "darwin" && has("brew")) {
50
+ ok = run("brew", ["install", "jj"]);
51
+ } else if (has("cargo")) {
52
+ log("installing jj via cargo (compiles from source; this can take a few minutes)...");
53
+ ok = run("cargo", ["install", "jj-cli"]);
54
+ }
55
+ if (ok && has("jj")) {
56
+ log("jj installed. Run `rudder doctor` to verify.");
57
+ } else {
58
+ manualHelp();
59
+ }
60
+ }
61
+
62
+ try {
63
+ main();
64
+ } catch (err) {
65
+ warn(`jj auto-install skipped: ${err && err.message ? err.message : err}`);
66
+ manualHelp();
67
+ }
68
+ process.exit(0);