deltara 0.30.16 → 0.30.17

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "deltara": "sha256:bbda32f722207125036a44e3988bdf46f5ead822810ddc702fb8b79b51de948d",
3
- "generated_at": "2026-04-30T10:09:37Z",
4
- "version": "0.30.16"
2
+ "deltara": "sha256:7276e9bee5347f0911bd00483aa0767c23ffce14d90f0818909897d4d4220dfb",
3
+ "generated_at": "2026-04-30T10:33:59Z",
4
+ "version": "0.30.17"
5
5
  }
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env node
2
+ // postinstall.js — runs `deltara setup --auto` with output wired directly to
3
+ // the controlling terminal, bypassing npm's stdout pipe.
4
+ //
5
+ // npm (v7+) runs lifecycle scripts with stdout piped — not connected to the
6
+ // terminal. Even `stdio: "inherit"` inherits npm's pipe, not /dev/tty.
7
+ // Opening /dev/tty directly gives us the actual terminal fd, so all setup
8
+ // output (header, steps, privacy lines) is visible to the user.
9
+
10
+ const { spawnSync } = require("child_process");
11
+ const path = require("path");
12
+ const fs = require("fs");
13
+ const os = require("os");
14
+
15
+ // Skip in CI or non-interactive environments where /dev/tty won't exist.
16
+ if (process.env.CI || process.env.DELTARA_NO_SETUP) {
17
+ process.exit(0);
18
+ }
19
+
20
+ const platform = os.platform();
21
+ const arch = os.arch();
22
+ const platformKey = `${platform}-${arch}`;
23
+ const binName = platform === "win32" ? "deltara.exe" : "deltara";
24
+ const binPath = path.join(__dirname, "..", "vendor", platformKey, binName);
25
+
26
+ if (!fs.existsSync(binPath)) {
27
+ // Unsupported platform — not an error, setup just won't run.
28
+ process.exit(0);
29
+ }
30
+
31
+ // Ensure executable bit (may be missing on some npm extract paths).
32
+ try { fs.chmodSync(binPath, 0o755); } catch (_) {}
33
+
34
+ // Open /dev/tty as the output fd — this is the controlling terminal regardless
35
+ // of how npm has wired our stdout/stderr.
36
+ let ttyFd;
37
+ if (platform !== "win32") {
38
+ try {
39
+ ttyFd = fs.openSync("/dev/tty", "w");
40
+ } catch (_) {
41
+ // No controlling terminal (e.g. SSH without TTY allocation, Docker).
42
+ // Run silently rather than crashing the install.
43
+ process.exit(0);
44
+ }
45
+ } else {
46
+ // Windows: stdout is already fine (npm behaviour differs).
47
+ ttyFd = process.stdout.fd;
48
+ }
49
+
50
+ const result = spawnSync(binPath, ["setup", "--auto"], {
51
+ stdio: ["inherit", ttyFd, ttyFd],
52
+ env: process.env,
53
+ });
54
+
55
+ if (ttyFd !== process.stdout.fd) {
56
+ try { fs.closeSync(ttyFd); } catch (_) {}
57
+ }
58
+
59
+ // Non-zero exits are non-fatal — a failed setup shouldn't block npm install.
60
+ process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deltara",
3
- "version": "0.30.16",
3
+ "version": "0.30.17",
4
4
  "description": "Multi-agent research pipelines \u2014 run deep research from your terminal",
5
5
  "bin": {
6
6
  "deltara": "bin/deltara.js"
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "scripts": {
28
28
  "preinstall": "node bin/clean-cache.js 2>/dev/null || true",
29
- "postinstall": "node bin/deltara.js setup --auto || true",
29
+ "postinstall": "node bin/postinstall.js || true",
30
30
  "preuninstall": "node bin/deltara.js uninstall || true"
31
31
  },
32
32
  "engines": {
Binary file