@overweo/weoline-win32-x64 0.3.1 → 0.4.1

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 +80 -4
  2. package/package.json +1 -1
  3. package/weoline.exe +0 -0
package/README.md CHANGED
@@ -26,6 +26,12 @@ npx weoline
26
26
  pnpm add -D weoline
27
27
  ```
28
28
 
29
+ ### Cargo
30
+
31
+ ```bash
32
+ cargo install weoline
33
+ ```
34
+
29
35
  ### Homebrew (macOS / Linux)
30
36
 
31
37
  ```bash
@@ -69,8 +75,8 @@ Add to your Claude Code settings (`~/.claude/settings.json`):
69
75
 
70
76
  | Variant | Command | Includes | Binary Size |
71
77
  |---------|---------|----------|-------------|
72
- | **Full** (default) | `cargo build --release` | Context + tokens + cache + session + API rate limits + background fetch | ~773 KB (macOS) / ~1.3 MB (Linux) |
73
- | **Minimal** | `cargo build --release --no-default-features` | Context + tokens + cache + session only (from stdin) | ~500 KB |
78
+ | **Full** (default) | `cargo build --release` | Context + tokens + cache + session + API rate limits + background fetch + query mode | ~789 KB (macOS) / ~1.3 MB (Linux) |
79
+ | **Minimal** | `cargo build --release --no-default-features` | Context + tokens + cache + session only (from stdin) | ~345 KB |
74
80
 
75
81
  **Full** uses native-tls on macOS/Windows (OS TLS stack) and rustls on Linux (no OpenSSL dependency).
76
82
 
@@ -111,12 +117,78 @@ All settings are via `SL_*` environment variables, configurable in Claude Code's
111
117
  🧠 ██████░░░░░░░░ 45% (90k/200k)
112
118
  ```
113
119
 
120
+ ## Query Mode
121
+
122
+ Query cached rate limit data programmatically — no stdin required.
123
+
124
+ ```bash
125
+ weoline --query # toon, full detail, all buckets
126
+ weoline --query --format json # JSON, full detail, all buckets
127
+ weoline --query -f json -d minimal # JSON, just percentages
128
+ weoline --query -f json --filter sonnet # JSON, sonnet bucket only
129
+ weoline --query --refresh --format json # force fresh API fetch, then JSON
130
+ ```
131
+
132
+ ### Query Flags
133
+
134
+ | Flag | Short | Values | Default | Description |
135
+ |------|-------|--------|---------|-------------|
136
+ | `--query` | `-q` | (presence) | off | Activate query mode |
137
+ | `--format` | `-f` | `json`, `toon` | `toon` | Output format |
138
+ | `--detail` | `-d` | `minimal`, `full` | `full` | Detail level |
139
+ | `--filter` | | `all`, `sonnet`, `five-hour`, `seven-day` | `all` | Filter to specific bucket |
140
+ | `--refresh` | `-r` | (presence) | off | Force fresh API fetch before query (blocking) |
141
+ | `--version` | `-V` | (presence) | off | Print version |
142
+
143
+ ### JSON Output
144
+
145
+ **Full detail** (`--format json`):
146
+ ```json
147
+ {
148
+ "five_hour": {
149
+ "utilization": 24.0,
150
+ "resets_at": "2026-04-06T18:00:00+00:00",
151
+ "resets_in": "3h52m"
152
+ },
153
+ "seven_day": {
154
+ "utilization": 8.0,
155
+ "resets_at": "2026-04-10T00:00:00+00:00",
156
+ "resets_in": "3d0h"
157
+ },
158
+ "seven_day_sonnet": {
159
+ "utilization": 5.0,
160
+ "resets_at": "2026-04-10T00:00:00+00:00",
161
+ "resets_in": "3d0h"
162
+ },
163
+ "meta": {
164
+ "fetched_at": 1743955200,
165
+ "is_stale": false
166
+ }
167
+ }
168
+ ```
169
+
170
+ **Minimal detail** (`-f json -d minimal`):
171
+ ```json
172
+ {
173
+ "five_hour_pct": 24.0,
174
+ "seven_day_pct": 8.0,
175
+ "seven_day_sonnet_pct": 5.0,
176
+ "is_stale": false
177
+ }
178
+ ```
179
+
180
+ > **Note:** `--refresh` performs a blocking HTTP request. Use it for explicit user invocations, not automated statusline hooks.
181
+
114
182
  ## How It Works
115
183
 
116
184
  ```
117
185
  Claude Code → stdin (JSON) → weoline → stdout (ANSI)
118
186
 
119
187
  Background: --fetch → API → cache file
188
+
189
+ weoline --query → read cache → stdout (JSON/toon)
190
+ ↓ (--refresh)
191
+ API → cache file → read → stdout
120
192
  ```
121
193
 
122
194
  1. Claude Code pipes context window JSON to stdin
@@ -124,6 +196,7 @@ Claude Code → stdin (JSON) → weoline → stdout (ANSI)
124
196
  3. If the cache is stale, spawns a detached `weoline --fetch` subprocess
125
197
  4. The fetch subprocess acquires a file lock (OS-native via `fd-lock`), calls the Anthropic usage API, writes the cache atomically, and exits
126
198
  5. File lock is auto-released by the OS on process exit or crash
199
+ 6. Query mode (`--query`) reads the cache directly and outputs structured data (no stdin needed)
127
200
 
128
201
  ## Cross-Platform Notes
129
202
 
@@ -134,10 +207,13 @@ Claude Code → stdin (JSON) → weoline → stdout (ANSI)
134
207
  ## Testing
135
208
 
136
209
  ```bash
137
- # Run tests
210
+ # Unit tests
138
211
  cargo test
139
212
 
140
- # Pipe test
213
+ # Smoke tests (builds release, tests pipe/query/help/error modes)
214
+ ./tests/smoke-test.sh
215
+
216
+ # Manual pipe tests
141
217
  echo '{"context_window":{"used_percentage":45,"context_window_size":200000}}' | ./target/release/weoline
142
218
 
143
219
  # Empty input (graceful)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overweo/weoline-win32-x64",
3
- "version": "0.3.1",
3
+ "version": "0.4.1",
4
4
  "description": "weoline binary for Windows x64",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/weoline.exe CHANGED
Binary file