uncompact 0.46.4 → 0.46.6

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 (2) hide show
  1. package/npm/install.js +25 -15
  2. package/package.json +1 -1
package/npm/install.js CHANGED
@@ -111,14 +111,15 @@ function extractZip(buffer, destDir, binaryName) {
111
111
 
112
112
  function log(msg) {
113
113
  process.stderr.write(msg);
114
- try {
115
- if (process.platform !== "win32" && process.stdout.isTTY) {
114
+ // Only write to /dev/tty if stderr is NOT a TTY, to avoid double-logging
115
+ if (!process.stderr.isTTY && process.platform !== "win32") {
116
+ try {
116
117
  const tty = fs.openSync("/dev/tty", "w");
117
118
  fs.writeSync(tty, msg);
118
119
  fs.closeSync(tty);
120
+ } catch (err) {
121
+ // Ignore TTY errors
119
122
  }
120
- } catch (err) {
121
- // Ignore TTY errors
122
123
  }
123
124
  }
124
125
 
@@ -204,17 +205,26 @@ async function main() {
204
205
  execFileSync(destPath, ["status"], { stdio: "inherit" });
205
206
 
206
207
  // If not authenticated, take them to the next step automatically
207
- const config = require(path.join(__dirname, "..", "package.json")); // Need version check logic? No, just use binary
208
- const checkAuthCmd = `"${destPath}" auth status`;
209
- try {
210
- const authStatus = execSync(checkAuthCmd).toString();
211
- if (authStatus.includes("Status: not authenticated") || authStatus.includes("✗")) {
212
- console.log("\n[uncompact] Authentication required. Taking you to the dashboard...");
213
- try {
214
- execFileSync(destPath, ["auth", "open"], { stdio: "inherit" });
215
- } catch (e) {}
216
- }
217
- } catch (e) {}
208
+ // Only attempt interactive login if we are in a terminal (TTY)
209
+ if (process.stdin.isTTY) {
210
+ const checkAuthCmd = `"${destPath}" auth status`;
211
+ try {
212
+ const authStatus = execSync(checkAuthCmd).toString();
213
+ if (authStatus.includes("Status: not authenticated") || authStatus.includes("✗")) {
214
+ log("\n[uncompact] Authentication required. Starting login flow...\n");
215
+ try {
216
+ // Use 'auth login' which opens browser AND prompts for key
217
+ execFileSync(destPath, ["auth", "login"], { stdio: "inherit" });
218
+ log("\n[uncompact] Login successful.\n");
219
+ } catch (err) {
220
+ log(`\n[uncompact] Login process exited: ${err.message}\n`);
221
+ log("[uncompact] You can run it manually later: uncompact auth login\n");
222
+ }
223
+ }
224
+ } catch (e) {}
225
+ } else {
226
+ log("\n[uncompact] Authentication required. Run 'uncompact auth login' to connect your account.\n");
227
+ }
218
228
  } catch (err) {
219
229
  // If status fails, show help as a fallback if we haven't shown anything yet
220
230
  if (!installSuccessful) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uncompact",
3
- "version": "0.46.4",
3
+ "version": "0.46.6",
4
4
  "description": "Stop Claude Code compaction from making your AI stupid. Re-inject project context after compaction via the Supermodel API.",
5
5
  "author": "Supermodel <abe@supermodel.software>",
6
6
  "license": "MIT",