sigrank 0.16.0 → 0.16.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.
- package/README.md +117 -77
- package/adapters.mjs +493 -238
- package/badges.mjs +157 -56
- package/cascade.mjs +132 -70
- package/cli.mjs +1311 -893
- package/connect.mjs +2 -2
- package/index.mjs +78 -59
- package/keystore.mjs +64 -44
- package/narrate.mjs +34 -22
- package/package.json +1 -1
- package/preflight.mjs +101 -29
- package/sign.mjs +46 -27
- package/submit.mjs +137 -71
- package/tokenpull.mjs +325 -188
- package/tools.mjs +1702 -951
- package/tui.mjs +1860 -1081
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
# SigRank MCP
|
|
2
|
+
|
|
1
3
|
> **🏆 SigRank is live: [signalaf.com](https://signalaf.com)** — the leaderboard for how
|
|
2
4
|
> efficiently you use AI, not how much. See your projected rank in 60 seconds at
|
|
3
|
-
> [signalaf.com/score](https://signalaf.com/score).
|
|
5
|
+
> [signalaf.com/score](https://signalaf.com/score). _Token counts only. Never your prompts._
|
|
4
6
|
|
|
5
7
|
<div align="center">
|
|
6
8
|
|
|
@@ -23,10 +25,27 @@ For all builders, burners and 10xers.
|
|
|
23
25
|
|
|
24
26
|
</div>
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
## Table of Contents
|
|
29
|
+
|
|
30
|
+
- [Quickstart](#quickstart--3-steps-to-the-board)
|
|
31
|
+
- [Install from GitHub](#install-from-github)
|
|
32
|
+
- [Install via Smithery](#install-via-smithery)
|
|
33
|
+
- [Commands](#commands)
|
|
34
|
+
- [MCP Server mode](#mcp-server-mode)
|
|
35
|
+
- [Cascade math](#cascade-math)
|
|
36
|
+
- [Token Pillars](#token-pillars--sources)
|
|
37
|
+
- [Platform adapters](#platform-adapters)
|
|
38
|
+
- [Privacy](#privacy)
|
|
39
|
+
- [Env vars](#env-vars)
|
|
40
|
+
- [Dev / test](#dev--test)
|
|
41
|
+
- [File map](#file-map)
|
|
42
|
+
- [Contributing](#contributing)
|
|
43
|
+
- [License](#license)
|
|
44
|
+
|
|
45
|
+
| The board | Your operator profile |
|
|
46
|
+
| :-----------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------: |
|
|
47
|
+
| [](https://signalaf.com/board/all) | [](https://signalaf.com) |
|
|
48
|
+
| Every operator ranked by **Υ Yield** — the architecture of the cascade, not raw spend | Cascade layer, class, and fingerprint — derived from four token counts |
|
|
30
49
|
|
|
31
50
|
> **Run [`sigrank enroll`](#sign-in--submit) then [`sigrank submit`](#sign-in--submit) to get ranked and claim your public profile at [signalaf.com](https://signalaf.com).**
|
|
32
51
|
|
|
@@ -113,7 +132,7 @@ smithery tool call sigrank rank_paste '{"text": "1000000 500000 50000 800000"}'
|
|
|
113
132
|
## Commands
|
|
114
133
|
|
|
115
134
|
```
|
|
116
|
-
⊙ SigRank CLI v0.
|
|
135
|
+
⊙ SigRank CLI v0.16.0
|
|
117
136
|
|
|
118
137
|
Default (no args)
|
|
119
138
|
sigrank unified dashboard: cascade + token pillars + board
|
|
@@ -162,14 +181,14 @@ npx sigrank
|
|
|
162
181
|
|
|
163
182
|
Six tabs. Keys: `1`-`6` or `←` `→` to switch · `R` refresh · `Q` quit.
|
|
164
183
|
|
|
165
|
-
| Tab
|
|
166
|
-
|
|
167
|
-
| **Dashboard** | `1` | Cascade table (all platforms × windows + combined) · Υ sparklines · token composition bars · mini board
|
|
168
|
-
| **Trends**
|
|
169
|
-
| **Compare**
|
|
170
|
-
| **Board**
|
|
171
|
-
| **Watch**
|
|
172
|
-
| **Connect**
|
|
184
|
+
| Tab | Key | Content |
|
|
185
|
+
| ------------- | --- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
186
|
+
| **Dashboard** | `1` | Cascade table (all platforms × windows + combined) · Υ sparklines · token composition bars · mini board |
|
|
187
|
+
| **Trends** | `2` | Every metric across windows — sub-views: You / Platform / Field |
|
|
188
|
+
| **Compare** | `3` | 4-source pillar audit (tokenpull vs ccusage vs token-dash vs tokscale) · delta % · cascade metrics per source · cache read bar chart |
|
|
189
|
+
| **Board** | `4` | Full leaderboard with all fields · `[W]` cycles window (7d/30d/90d/all) |
|
|
190
|
+
| **Watch** | `5` | In-TUI landing panel · `[Enter]` launches the live watcher (big numbers + pillar bars + Υ trend, auto-refreshes 30s) |
|
|
191
|
+
| **Connect** | `6` | Sign in / switch device — paste a connect code from signalaf.com → Settings. Then `[S]` submits. |
|
|
173
192
|
|
|
174
193
|
### Sign in + submit
|
|
175
194
|
|
|
@@ -188,6 +207,7 @@ Or do it inside the TUI on the **Connect** tab (`6`), then press `[S]` to submit
|
|
|
188
207
|
When stdout is not a TTY (i.e. piped to an AI client), `sigrank` starts an MCP stdio server automatically. AI clients (Claude Code, Cursor, Windsurf, etc.) use this path.
|
|
189
208
|
|
|
190
209
|
Add to `.mcp.json` or equivalent:
|
|
210
|
+
|
|
191
211
|
```json
|
|
192
212
|
{
|
|
193
213
|
"mcpServers": {
|
|
@@ -198,7 +218,9 @@ Add to `.mcp.json` or equivalent:
|
|
|
198
218
|
}
|
|
199
219
|
}
|
|
200
220
|
```
|
|
221
|
+
|
|
201
222
|
Or if installed globally:
|
|
223
|
+
|
|
202
224
|
```json
|
|
203
225
|
{
|
|
204
226
|
"mcpServers": {
|
|
@@ -211,23 +233,23 @@ Or if installed globally:
|
|
|
211
233
|
|
|
212
234
|
### MCP Tools
|
|
213
235
|
|
|
214
|
-
| Tool
|
|
215
|
-
|
|
216
|
-
| `rank_paste(text)`
|
|
217
|
-
| `get_leaderboard()`
|
|
218
|
-
| `get_operator(codename)`
|
|
219
|
-
| `submit_paste(text, codename)`
|
|
220
|
-
| `tokenpull(platform?)`
|
|
221
|
-
| `tokenpull_submit(codename, window?)` | `{codename?, window?}`
|
|
222
|
-
| `tokenpull_compare(platform?)`
|
|
223
|
-
| `rank_windows`
|
|
224
|
-
| `watch_tokenpull`
|
|
225
|
-
| `submit_verified`
|
|
226
|
-
| `enroll`
|
|
227
|
-
| `diagnose_cascade`
|
|
228
|
-
| `simulate_change`
|
|
229
|
-
| `suggest_improvements`
|
|
230
|
-
| `self_improve`
|
|
236
|
+
| Tool | Args | What |
|
|
237
|
+
| ------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
238
|
+
| `rank_paste(text)` | `{input, output, cacheCreate, cacheRead}` JSON or 4 whitespace-delimited numbers | Scores token pillars → Υ Yield / SNR / Leverage / Velocity / 10xDEV / Class + prose narration card |
|
|
239
|
+
| `get_leaderboard()` | `{window?}` | Live board from signalaf.com — sorted by Υ Yield |
|
|
240
|
+
| `get_operator(codename)` | `{codename}` | One operator's live profile |
|
|
241
|
+
| `submit_paste(text, codename)` | `{text, codename?}` | Rank locally then POST to board. Omit codename for preview-only |
|
|
242
|
+
| `tokenpull(platform?)` | `{platform?}` | On-device local reader: scans local logs → 4-window cascade. Zero paste, token-only |
|
|
243
|
+
| `tokenpull_submit(codename, window?)` | `{codename?, window?}` | `tokenpull` → publish to board. Omit codename for preview |
|
|
244
|
+
| `tokenpull_compare(platform?)` | `{platform?}` | All four sources side-by-side: tokenpull + ccusage + token-dash + tokscale. Returns pillars, cascade metrics, and delta % vs tokenpull per window |
|
|
245
|
+
| `rank_windows` | `{platform?, window?}` | Multi-window cascade from local logs |
|
|
246
|
+
| `watch_tokenpull` | `{platform?, interval_s?}` | One cascade snapshot per call (interval_s advisory) |
|
|
247
|
+
| `submit_verified` | `{window?, platform?, dry_run?}` | THE ranked path: builds + ed25519-signs Schema 1.0 snapshots and POSTs them. `platform:'multi'` sums all active platforms. `dry_run:true` returns the exact payload unsent |
|
|
248
|
+
| `enroll` | `{code, device_label?}` | Bind this device with a connect code from signalaf.com → Settings |
|
|
249
|
+
| `diagnose_cascade` | `{text?}` | Diagnoses where your token cascade is leaking efficiency — ranked findings with severity + estimated Υ impact |
|
|
250
|
+
| `simulate_change` | `{text?, changes}` | Prescriptive "what if" — test proposed pillar changes and see the exact Υ delta + class change before committing |
|
|
251
|
+
| `suggest_improvements` | `{text?}` | Generates ranked, simulated improvement suggestions — tests strategies and returns them sorted by Υ yield impact |
|
|
252
|
+
| `self_improve` | `{text?}` | One-click optimize: diagnoses, suggests, and simulates the best change in a single call |
|
|
231
253
|
|
|
232
254
|
---
|
|
233
255
|
|
|
@@ -250,19 +272,21 @@ Canon check: `MO§ES (1251211, 11296121, 128196310, 2555179769) → Υ 18436.98`
|
|
|
250
272
|
|
|
251
273
|
The dashboard pulls from multiple sources and shows them side-by-side for verification:
|
|
252
274
|
|
|
253
|
-
| Source
|
|
254
|
-
|
|
255
|
-
| `tokenpull`
|
|
256
|
-
| `ccusage`
|
|
257
|
-
| `token-dashboard` | `~/.claude/token-dashboard.db` SQLite (bundled)
|
|
258
|
-
| `tokscale`
|
|
275
|
+
| Source | What | Platform |
|
|
276
|
+
| ----------------- | ------------------------------------------------------------------------------ | --------------------- |
|
|
277
|
+
| `tokenpull` | On-device JSONL scanner (canon source) | claude, codex, amp, … |
|
|
278
|
+
| `ccusage` | `ccusage <platform> daily --json` CLI (bundled) | claude, codex |
|
|
279
|
+
| `token-dashboard` | `~/.claude/token-dashboard.db` SQLite (bundled) | claude only |
|
|
280
|
+
| `tokscale` | `tokscale models --json` CLI (bundled, falls back to `~/tokscale_report.json`) | claude, codex |
|
|
259
281
|
|
|
260
282
|
**Codex input is estimated** — Codex logs don't expose true input tokens directly. The formula:
|
|
283
|
+
|
|
261
284
|
```
|
|
262
285
|
input = output × ioRatio (ioRatio derived from Claude ratio, else 2.0)
|
|
263
286
|
cacheCreate = uncached − input (uncached = input_tokens − cached_input_tokens)
|
|
264
287
|
cacheRead = exact (from logs)
|
|
265
288
|
```
|
|
289
|
+
|
|
266
290
|
Verifier numbers (ccusage/tokscale for codex) show **raw uncached input** (`input_tokens − cached`) — a different field than the estimated input above. The discrepancy is expected and explained inline in the dashboard.
|
|
267
291
|
|
|
268
292
|
---
|
|
@@ -271,25 +295,25 @@ Verifier numbers (ccusage/tokscale for codex) show **raw uncached input** (`inpu
|
|
|
271
295
|
|
|
272
296
|
All adapters are token-only (no message content, no cost fields, no credentials).
|
|
273
297
|
|
|
274
|
-
| Platform
|
|
275
|
-
|
|
276
|
-
| Claude Code
|
|
277
|
-
| Codex
|
|
278
|
-
| Amp
|
|
279
|
-
| Kimi
|
|
280
|
-
| pi-agent
|
|
281
|
-
| OpenClaw
|
|
282
|
-
| Droid
|
|
283
|
-
| Codebuff
|
|
284
|
-
| Hermes
|
|
285
|
-
| Kilo
|
|
286
|
-
| Qwen
|
|
287
|
-
| Goose
|
|
288
|
-
| Gemini CLI
|
|
289
|
-
| GitHub Copilot CLI | ✅ `~/.copilot/otel`
|
|
290
|
-
| OpenCode
|
|
291
|
-
| Cursor
|
|
292
|
-
| Windsurf
|
|
298
|
+
| Platform | Path | Notes |
|
|
299
|
+
| ------------------ | ---------------------------------------------- | --------------------------------------------------------------- |
|
|
300
|
+
| Claude Code | ✅ `~/.claude/projects` | Native; dedup by `(session_id, message_id)`; subagents included |
|
|
301
|
+
| Codex | ✅ `~/.codex/sessions` | Estimated input via `io_ratio`; verified vs ccusage |
|
|
302
|
+
| Amp | ✅ `~/.local/share/amp/threads` | Full 4-pillar; per-message |
|
|
303
|
+
| Kimi | ✅ `~/.kimi/sessions` | Full 4-pillar; `StatusUpdate` lines only |
|
|
304
|
+
| pi-agent | ✅ `~/.pi/agent/sessions` | Full 4-pillar; per-message JSONL |
|
|
305
|
+
| OpenClaw | ✅ `~/.openclaw` | Full 4-pillar; per-message JSONL |
|
|
306
|
+
| Droid | ✅ `~/.factory/sessions/*.settings.json` | Full 4-pillar; thinking→output |
|
|
307
|
+
| Codebuff | ✅ `~/.config/manicode` | Full 4-pillar; `chat-messages.json` |
|
|
308
|
+
| Hermes | ✅ `~/.hermes/state.db` | Full 4-pillar; SQLite; reasoning→output |
|
|
309
|
+
| Kilo | ✅ `~/.local/share/kilo/kilo.db` | Full 4-pillar; SQLite |
|
|
310
|
+
| Qwen | ✅ `~/.qwen/projects` | `cacheCreate=0` estimated; thought→output |
|
|
311
|
+
| Goose | ✅ `~/.local/share/goose/sessions/sessions.db` | `cacheCreate=cacheRead=0` estimated; SQLite |
|
|
312
|
+
| Gemini CLI | ✅ `~/.gemini/tmp` | `cacheCreate=0` estimated; cache extracted from input field |
|
|
313
|
+
| GitHub Copilot CLI | ✅ `~/.copilot/otel` | OTel JSONL; requires `COPILOT_OTEL_ENABLED=true` |
|
|
314
|
+
| OpenCode | ⚠️ `~/.local/share/opencode` | Raw token counts not persisted in log format |
|
|
315
|
+
| Cursor | 🔜 | Chat log path TBD |
|
|
316
|
+
| Windsurf | 🔜 | Session logs at `~/.codeium/windsurf/` |
|
|
293
317
|
|
|
294
318
|
`estimated=true` means one or more pillars are derived, not native. The server re-scores all submitted pillars authoritatively; local preview Υ is indicative only.
|
|
295
319
|
|
|
@@ -307,10 +331,10 @@ All adapters are token-only (no message content, no cost fields, no credentials)
|
|
|
307
331
|
|
|
308
332
|
## Env vars
|
|
309
333
|
|
|
310
|
-
| Var
|
|
311
|
-
|
|
312
|
-
| `SIGRANK_API_BASE`
|
|
313
|
-
| `SIGRANK_FETCH_TIMEOUT` | `10000`
|
|
334
|
+
| Var | Default | Description |
|
|
335
|
+
| ----------------------- | ---------------------- | ---------------------------- |
|
|
336
|
+
| `SIGRANK_API_BASE` | `https://signalaf.com` | Override the board host |
|
|
337
|
+
| `SIGRANK_FETCH_TIMEOUT` | `10000` | Board API fetch timeout (ms) |
|
|
314
338
|
|
|
315
339
|
---
|
|
316
340
|
|
|
@@ -323,6 +347,7 @@ node index.mjs # stdio MCP server directly (pipe to MCP client)
|
|
|
323
347
|
```
|
|
324
348
|
|
|
325
349
|
Tests verify (13 groups, 200 assertions):
|
|
350
|
+
|
|
326
351
|
- `rank_paste` canon: MO§ES `(1251211, 11296121, 128196310, 2555179769)` → Υ 18436.98 · TRANSMITTER
|
|
327
352
|
- `submit_paste` preview (no codename) + POST shape (injected fetch, no live writes)
|
|
328
353
|
- `tokenpull` dedup, window slicing, 4-window pillars (mock adapter)
|
|
@@ -341,20 +366,35 @@ Tests verify (13 groups, 200 assertions):
|
|
|
341
366
|
|
|
342
367
|
## File map
|
|
343
368
|
|
|
344
|
-
| File
|
|
345
|
-
|
|
346
|
-
| `index.mjs`
|
|
347
|
-
| `cli.mjs`
|
|
348
|
-
| `tui.mjs`
|
|
349
|
-
| `cascade.mjs`
|
|
350
|
-
| `tokenpull.mjs` | On-device log scanner — Claude, Codex, multi-platform
|
|
351
|
-
| `adapters.mjs`
|
|
352
|
-
| `tools.mjs`
|
|
353
|
-
| `connect.mjs`
|
|
354
|
-
| `keystore.mjs`
|
|
355
|
-
| `submit.mjs`
|
|
356
|
-
| `sign.mjs`
|
|
357
|
-
| `narrate.mjs`
|
|
358
|
-
| `preflight.mjs` | Plausibility checks (Benford, bounds, anomaly detection)
|
|
359
|
-
| `test.mjs`
|
|
360
|
-
| `sign.test.mjs` | ed25519 signing + canon parity test
|
|
369
|
+
| File | Responsibility |
|
|
370
|
+
| --------------- | ----------------------------------------------------------------------- |
|
|
371
|
+
| `index.mjs` | Entry point — TTY detection, routes to CLI or MCP server |
|
|
372
|
+
| `cli.mjs` | CLI commands: board, compare, watch, enroll, submit, help |
|
|
373
|
+
| `tui.mjs` | Full tabbed TUI: Dashboard / Trends / Compare / Board / Watch / Connect |
|
|
374
|
+
| `cascade.mjs` | Pure cascade math (Υ, SNR, leverage, velocity, 10xDEV, class) |
|
|
375
|
+
| `tokenpull.mjs` | On-device log scanner — Claude, Codex, multi-platform |
|
|
376
|
+
| `adapters.mjs` | Platform adapter registry (15+ platforms) |
|
|
377
|
+
| `tools.mjs` | MCP tool table + dispatcher |
|
|
378
|
+
| `connect.mjs` | Connect-code enrollment + device identity |
|
|
379
|
+
| `keystore.mjs` | Local key management (paste-keys, not API keys) |
|
|
380
|
+
| `submit.mjs` | Verified submit flow (signs + POSTs to board) |
|
|
381
|
+
| `sign.mjs` | Schema 1.0 signing (X-Agent-Signature) |
|
|
382
|
+
| `narrate.mjs` | Deterministic prose narration card |
|
|
383
|
+
| `preflight.mjs` | Plausibility checks (Benford, bounds, anomaly detection) |
|
|
384
|
+
| `test.mjs` | Unit tests (no external deps) |
|
|
385
|
+
| `sign.test.mjs` | ed25519 signing + canon parity test |
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
## Contributing
|
|
390
|
+
|
|
391
|
+
Contributions welcome. SigRank MCP is built in the open.
|
|
392
|
+
|
|
393
|
+
- [Contributing guide](./.github/CONTRIBUTING.md)
|
|
394
|
+
- [Security policy](https://github.com/SunrisesIllNeverSee/sigrank-mcp/security/policy)
|
|
395
|
+
- Report bugs via [GitHub Issues](https://github.com/SunrisesIllNeverSee/sigrank-mcp/issues)
|
|
396
|
+
- PRs: fork → branch → `node test.mjs` passes → open PR against `main`
|
|
397
|
+
|
|
398
|
+
## License
|
|
399
|
+
|
|
400
|
+
MIT — see [`LICENSE`](./LICENSE).
|