uncompact 0.47.0 → 0.48.0

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/README.md +23 -42
  2. package/npm/install.js +20 -15
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -50,7 +50,7 @@ This installs both hooks automatically:
50
50
  - **`SessionStart`** — runs `scripts/setup.sh` which auto-installs the `uncompact` binary via `go install` if not already present.
51
51
  - **`Stop`** — runs `scripts/uncompact-hook.sh` which reinjects context after every compaction event.
52
52
 
53
- > **Note:** After plugin installation, authenticate once with `uncompact auth login` to connect your Supermodel API key. That's it — no manual binary install or hook setup required.
53
+ > **Note:** After plugin installation, run `uncompact auth login` once to authenticate. This also ensures hooks are installed — no separate `uncompact install` step needed.
54
54
 
55
55
  ### CI / GitHub Actions
56
56
 
@@ -65,69 +65,48 @@ env:
65
65
 
66
66
  ## Quick Start
67
67
 
68
- ### 1. Install
69
-
70
- **Via npm (recommended):**
71
-
72
- ```bash
73
- # Install CLI and automatically configure Claude Code hooks
74
- npm install -g uncompact
75
- ```
76
-
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:**
80
-
81
- ```bash
82
- # This will show full interactive output
83
- npx uncompact install
84
- ```
85
-
86
- ### 🗑 Uninstall
87
-
88
- To remove the Claude Code hooks only:
68
+ ### Via npm (recommended)
89
69
 
90
70
  ```bash
91
- uncompact uninstall
71
+ npm install -g uncompact --foreground-scripts
92
72
  ```
93
73
 
94
- To **completely remove** Uncompact configuration and cached data:
95
-
96
- ```bash
97
- uncompact uninstall --total
98
- ```
74
+ That's it. The installer downloads the binary, opens your browser for GitHub authentication, and installs the Claude Code hooks — all in one step.
99
75
 
100
- *Note: After running the above, you can remove the CLI itself with `npm uninstall -g uncompact`.*
76
+ > `--foreground-scripts` is required so the interactive auth prompt is visible in your terminal.
101
77
 
102
- **Via Go:**
78
+ ### Via Go or manual binary
103
79
 
104
80
  ```bash
105
81
  go install github.com/supermodeltools/uncompact@latest
82
+ # then:
83
+ uncompact auth login
106
84
  ```
107
85
 
108
- **Or download a binary** from [Releases](https://github.com/supermodeltools/Uncompact/releases).
86
+ `auth login` opens your browser for GitHub OAuth, saves your API key, and installs the Claude Code hooks automatically.
109
87
 
110
- ### 2. Authenticate
88
+ **Or download a binary** from [Releases](https://github.com/supermodeltools/Uncompact/releases) and run `uncompact auth login`.
89
+
90
+ ### Verify
111
91
 
112
92
  ```bash
113
- uncompact auth login
93
+ uncompact verify-install
94
+ uncompact run --debug
114
95
  ```
115
96
 
116
- This opens [dashboard.supermodeltools.com/api-keys/](https://dashboard.supermodeltools.com/api-keys/) where you can subscribe and generate an API key.
97
+ ### 🗑 Uninstall
117
98
 
118
- ### 3. Install Claude Code Hooks
99
+ To remove the Claude Code hooks only:
119
100
 
120
101
  ```bash
121
- uncompact install
102
+ uncompact uninstall
122
103
  ```
123
104
 
124
- This auto-detects your Claude Code `settings.json`, shows a diff, and merges the hooks non-destructively.
125
-
126
- ### 4. Verify
105
+ To **completely remove** Uncompact configuration and cached data:
127
106
 
128
107
  ```bash
129
- uncompact verify-install
130
- uncompact run --debug
108
+ uncompact uninstall --total
109
+ npm uninstall -g uncompact
131
110
  ```
132
111
 
133
112
  ## CLI Reference
@@ -164,6 +143,8 @@ uncompact cache clear --project # Clear only the current project's cache
164
143
  | Variable | Description |
165
144
  |----------|-------------|
166
145
  | `SUPERMODEL_API_KEY` | Supermodel API key (overrides config file) |
146
+ | `UNCOMPACT_API_URL` | Override the API base URL (e.g. for staging) |
147
+ | `UNCOMPACT_DASHBOARD_URL` | Override the dashboard base URL (e.g. for staging) |
167
148
 
168
149
  ### Config File
169
150
 
@@ -244,7 +225,7 @@ uncompact/
244
225
  |---------|--------|
245
226
  | Default TTL | 15 minutes |
246
227
  | Stale cache | Served with `⚠️ STALE` warning; fresh fetch attempted |
247
- | API unavailable | Serve most recent cache entry silently |
228
+ | API unreachable | Fail fast on connection error; serve stale cache if available |
248
229
  | No cache + API down | Silent exit 0 (never blocks Claude Code) |
249
230
  | Storage growth | Auto-prune entries older than 30 days |
250
231
  | Force refresh | `--force-refresh` flag |
package/npm/install.js CHANGED
@@ -187,27 +187,32 @@ async function main() {
187
187
  log(`[uncompact] Installed to ${destPath}\n\n`);
188
188
  }
189
189
 
190
- // Automatically install Claude Code hooks
191
- log("[uncompact] Configuring Claude Code hooks...\n");
190
+ // Check if already authenticated so we can decide what to run.
191
+ let isAuthenticated = false;
192
192
  try {
193
- execFileSync(destPath, ["install", "--yes"], { stdio: "inherit" });
193
+ const out = execFileSync(destPath, ["auth", "status"], { stdio: "pipe" }).toString();
194
+ isAuthenticated = out.includes("authenticated");
194
195
  } catch (err) {
195
- log("[uncompact] Note: Automatic hook configuration skipped or failed. Run manually if needed:\n");
196
- log(" uncompact install\n");
196
+ // binary failed or not runnable fall through to install
197
197
  }
198
198
 
199
- // Show status to verify setup
200
- try {
201
- console.log();
202
- execFileSync(destPath, ["status"], { stdio: "inherit" });
203
- } catch (err) {
199
+ if (isAuthenticated) {
200
+ // Existing user (upgrade): just make sure hooks are current.
201
+ log("[uncompact] Already authenticated. Ensuring Claude Code hooks are installed...\n");
204
202
  try {
205
- execFileSync(destPath, [], { stdio: "inherit" });
206
- } catch (e) {}
203
+ execFileSync(destPath, ["install", "--yes"], { stdio: "inherit" });
204
+ } catch (err) {
205
+ log("[uncompact] Note: hook configuration skipped. Run 'uncompact install' manually if needed.\n");
206
+ }
207
+ } else {
208
+ // Fresh install: auth login handles both authentication and hook installation.
209
+ log("[uncompact] Starting setup...\n\n");
210
+ try {
211
+ execFileSync(destPath, ["auth", "login"], { stdio: "inherit" });
212
+ } catch (err) {
213
+ log("[uncompact] Setup skipped or failed. Run 'uncompact auth login' to complete setup.\n");
214
+ }
207
215
  }
208
-
209
- log("\n");
210
- log("[uncompact] To authenticate: run 'uncompact auth login'\n");
211
216
  }
212
217
 
213
218
  main().catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uncompact",
3
- "version": "0.47.0",
3
+ "version": "0.48.0",
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",