uncompact 0.45.0 → 0.45.5

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 CHANGED
@@ -70,13 +70,17 @@ env:
70
70
  **Via npm (recommended):**
71
71
 
72
72
  ```bash
73
+ # Install CLI and automatically configure Claude Code hooks
73
74
  npm install -g uncompact
74
75
  ```
75
76
 
76
- Or run without installing:
77
+ *Note: npm might hide the configuration output. You can verify the installation with `uncompact verify-install`.*
78
+
79
+ **Or run/install without global installation:**
77
80
 
78
81
  ```bash
79
- npx uncompact --help
82
+ # This will show full interactive output
83
+ npx uncompact install
80
84
  ```
81
85
 
82
86
  **Via Go:**
package/npm/install.js CHANGED
@@ -109,6 +109,19 @@ function extractZip(buffer, destDir, binaryName) {
109
109
  return extracted;
110
110
  }
111
111
 
112
+ function log(msg) {
113
+ process.stderr.write(msg);
114
+ try {
115
+ if (process.platform !== "win32" && process.stdout.isTTY) {
116
+ const tty = fs.openSync("/dev/tty", "w");
117
+ fs.writeSync(tty, msg);
118
+ fs.closeSync(tty);
119
+ }
120
+ } catch (err) {
121
+ // Ignore TTY errors
122
+ }
123
+ }
124
+
112
125
  async function main() {
113
126
  const platform = getPlatform();
114
127
  const arch = getArch();
@@ -116,7 +129,7 @@ async function main() {
116
129
  const binaryName = getBinaryName(platform);
117
130
  const binDir = path.join(__dirname, "bin");
118
131
 
119
- console.log(`[uncompact] Installing ${BINARY_NAME} for ${platform}/${arch}...`);
132
+ log(`[uncompact] Post-install setup for ${platform}/${arch}...\n`);
120
133
 
121
134
  if (!fs.existsSync(binDir)) {
122
135
  fs.mkdirSync(binDir, { recursive: true });
@@ -124,75 +137,70 @@ async function main() {
124
137
 
125
138
  const destPath = path.join(binDir, binaryName);
126
139
 
127
- if (fs.existsSync(destPath)) {
128
- console.log(`[uncompact] Binary already exists at ${destPath}`);
129
- return;
130
- }
140
+ if (!fs.existsSync(destPath)) {
141
+ const version = getPackageVersion();
142
+ let release;
143
+ try {
144
+ release = await getRelease(version);
145
+ } catch (err) {
146
+ log(`[uncompact] Failed to fetch release: ${err.message}\n`);
147
+ log(`[uncompact] You can install manually: go install github.com/${REPO_OWNER}/${REPO_NAME.toLowerCase()}@latest\n`);
148
+ process.exit(0);
149
+ }
131
150
 
132
- const version = getPackageVersion();
133
- let release;
134
- try {
135
- release = await getRelease(version);
136
- } catch (err) {
137
- console.error(`[uncompact] Failed to fetch release: ${err.message}`);
138
- console.error(`[uncompact] You can install manually: go install github.com/${REPO_OWNER}/${REPO_NAME.toLowerCase()}@latest`);
139
- process.exit(0);
140
- }
151
+ const asset = release.assets.find((a) => a.name === assetName);
152
+ if (!asset) {
153
+ log(`[uncompact] No binary found for ${platform}/${arch} in release ${release.tag_name}\n`);
154
+ log(`[uncompact] Available assets: ${release.assets.map((a) => a.name).join(", ")}\n`);
155
+ log(`[uncompact] You can install manually: go install github.com/${REPO_OWNER}/${REPO_NAME.toLowerCase()}@latest\n`);
156
+ process.exit(0);
157
+ }
141
158
 
142
- const asset = release.assets.find((a) => a.name === assetName);
143
- if (!asset) {
144
- console.error(`[uncompact] No binary found for ${platform}/${arch} in release ${release.tag_name}`);
145
- console.error(`[uncompact] Available assets: ${release.assets.map((a) => a.name).join(", ")}`);
146
- console.error(`[uncompact] You can install manually: go install github.com/${REPO_OWNER}/${REPO_NAME.toLowerCase()}@latest`);
147
- process.exit(0);
148
- }
159
+ log(`[uncompact] Downloading ${BINARY_NAME} ${release.tag_name}...\n`);
149
160
 
150
- console.log(`[uncompact] Downloading ${asset.name}...`);
161
+ let buffer;
162
+ try {
163
+ buffer = await httpsGet(asset.browser_download_url);
164
+ } catch (err) {
165
+ log(`[uncompact] Failed to download: ${err.message}\n`);
166
+ process.exit(0);
167
+ }
151
168
 
152
- let buffer;
153
- try {
154
- buffer = await httpsGet(asset.browser_download_url);
155
- } catch (err) {
156
- console.error(`[uncompact] Failed to download: ${err.message}`);
157
- process.exit(0);
158
- }
169
+ log(`[uncompact] Extracting...\n`);
159
170
 
160
- console.log(`[uncompact] Extracting...`);
171
+ try {
172
+ if (platform === "windows") {
173
+ extractZip(buffer, binDir, binaryName);
174
+ } else {
175
+ extractTarGz(buffer, binDir, binaryName);
176
+ }
177
+ } catch (err) {
178
+ log(`[uncompact] Failed to extract: ${err.message}\n`);
179
+ process.exit(0);
180
+ }
161
181
 
162
- try {
163
- if (platform === "windows") {
164
- extractZip(buffer, binDir, binaryName);
165
- } else {
166
- extractTarGz(buffer, binDir, binaryName);
182
+ if (platform !== "windows") {
183
+ fs.chmodSync(destPath, 0o755);
167
184
  }
168
- } catch (err) {
169
- console.error(`[uncompact] Failed to extract: ${err.message}`);
170
- process.exit(0);
171
- }
172
185
 
173
- if (platform !== "windows") {
174
- fs.chmodSync(destPath, 0o755);
186
+ log(`[uncompact] Installed to ${destPath}\n\n`);
175
187
  }
176
188
 
177
- console.log(`[uncompact] Installed to ${destPath}`);
178
- console.log();
179
-
180
189
  // Automatically install Claude Code hooks
181
- console.log("[uncompact] Configuring Claude Code hooks...");
190
+ log("[uncompact] Configuring Claude Code hooks...\n");
182
191
  try {
192
+ // The 'install' command now automatically shows the help menu upon completion
183
193
  execFileSync(destPath, ["install", "--yes"], { stdio: "inherit" });
184
194
  } catch (err) {
185
- console.error("[uncompact] Failed to automatically configure hooks. You can run it manually:");
186
- console.error(" uncompact install");
187
- }
188
- console.log();
189
-
190
- // Show help output after install
191
- try {
192
- execFileSync(destPath, [], { stdio: "inherit" });
193
- } catch (err) {
194
- // Ignore errors from running the binary itself
195
+ log("[uncompact] Note: Automatic hook configuration skipped or failed. Run manually if needed:\n");
196
+ log(" uncompact install\n");
197
+
198
+ // Fallback: Show help if the install command failed
199
+ try {
200
+ execFileSync(destPath, [], { stdio: "inherit" });
201
+ } catch (e) {}
195
202
  }
203
+ log("\n");
196
204
  }
197
205
 
198
206
  main().catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uncompact",
3
- "version": "0.45.0",
3
+ "version": "0.45.5",
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",