slash-tokens 1.6.1 → 1.6.3

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/CHANGELOG.md CHANGED
@@ -1,12 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.6.3] — The Fixed Deal Edition
4
+
5
+ *2026-08-25*
6
+
7
+ Solo $20 mailbox, 10% waived. Team $39 for the data.
8
+
9
+ Tarball first screen is the try path (`bunx` / `npx`). `preflight` is analysis (all providers); `preflightRoute` is the same-provider route. SPDX MIT; brand reservation lives in NOTICE. Empty-folder CLI is a normal no-sites result, not a hang.
10
+
11
+ No price or fee change.
12
+
13
+ ## [1.6.2] — The Fixed Deal Edition
14
+
15
+ *2026-08-25*
16
+
17
+ Solo $20 mailbox, 10% waived. Team $39 for the data.
18
+
19
+ Worker already returns `fee_usd` 0. This patch is the tarball identity. House `$20` is the mailbox — we show savings, we don't skim. 10% is the comparison, waived. Team is `$39` for the data (`$390`/year). Free forever is `bunx` — no account. No `$5` house credit for Solo.
20
+
21
+ Dropped the CLI scanner's invented second 10% ("gate efficiency"). One 10% = the savings cut, waived.
22
+
3
23
  ## [1.6.1] — The Fixed Deal Edition
4
24
 
5
25
  *2026-08-24*
6
26
 
7
27
  Team/Pro is the live cart; 10% of savings shows on the weekly number as the comparison, not as what Team is charged.
8
28
 
9
- 1.6.0 put `counterfactual_fee_usd` on npm without Doc Gate (the tarball README still headlined v1.4). This patch is the public identity for that ship. Trial still meters 10% on the $5 credit. Team `fee_usd` is 0. slashtokens.com copy is unchanged.
29
+ 1.6.0 put `counterfactual_fee_usd` on npm without Doc Gate (the tarball README still headlined v1.4). This patch is the public identity for that ship. At ship, trial metered 10% on a $5 credit (superseded the same day: house credit is $20). Team `fee_usd` is 0.
10
30
 
11
31
  **Not claimed:** a walked Team checkout (cart unbought). 10% is postponed until-further-notice, not dropped. CLI scanner “10% gate efficiency” is a different 10% (salvage rate).
12
32
 
package/LICENSE CHANGED
@@ -19,11 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
-
23
- ---
24
-
25
- This project's name, ⚡ mark, and red/gold color scheme ("brand") are not
26
- covered by the MIT license above and are reserved for the slash-tokens
27
- project. If you fork, you agree to ship your derivative under your own name
28
- and colors. Representing your product as "slash-tokens" / "Slash" without
29
- written consent is not permitted.
package/NOTICE ADDED
@@ -0,0 +1,9 @@
1
+ slash-tokens brand reservation
2
+
3
+ The code is MIT — see LICENSE.
4
+
5
+ The slash-tokens name, ⚡ mark, and red/gold color scheme ("brand") are
6
+ not covered by that license and stay with the project.
7
+
8
+ If you fork, ship the derivative under your own name and colors. Do not
9
+ represent your product as "slash-tokens" / "Slash" without written consent.
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # /slash-tokens
2
2
 
3
3
  [![CI/CD](https://github.com/Wolfe-Jam/slash-tokens/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/Wolfe-Jam/slash-tokens/actions/workflows/test.yml)
4
- [![FAF Trophy 100%](https://img.shields.io/badge/FAF-%F0%9F%8F%86%20100%25-000000?labelColor=FF6B35)](https://faf.one)
5
4
  [![npm version](https://img.shields.io/npm/v/slash-tokens?style=flat&color=cb3837)](https://www.npmjs.com/package/slash-tokens)
6
5
  [![npm downloads](https://img.shields.io/npm/dm/slash-tokens?style=flat&color=brightgreen)](https://www.npmjs.com/package/slash-tokens)
7
6
  [![WASM size](https://img.shields.io/badge/WASM-4.8_KB-blue?style=flat)](https://bundlephobia.com/package/slash-tokens)
@@ -13,19 +12,21 @@ For anyone building with LLMs. 4.8 KB WASM. Sub-millisecond. Zero dependencies.
13
12
 
14
13
  Know the cost before the call leaves your machine.
15
14
 
16
- > 🆕 **v1.6.1 — The Fixed Deal Edition.** Team/Pro is the live cart; 10% of savings shows on the weekly number as the comparison, not as what Team is charged.
17
- >
18
- > **v1.5 — The Calibration Fix Edition.** Per-model calibration is wired into every call path. All four providers checked against the same 29-sample corpus.
19
- >
20
- > **v1.4 — The Single-Source-of-Truth Edition.** New `preflightRoute()` matches the Slash proxy exactly — same-provider only, zero routing drift. `PROVIDER_MODELS` is now the single source of truth across the SDK.
21
- >
22
- > **v1.3 — The Opus 4.7 Edition.** Same-day support for Claude Opus 4.7 with measured token calibration (1.16–1.51x). Plus Gemini proxy fix and benchmark harness for any upstream.
15
+ Models change. Windows grow. Slash adapts — you keep building.
16
+ Cheaper tokens haven't shrunk the bill — usage has.
23
17
 
24
- ## v1.6.1 — The Fixed Deal Edition
18
+ ## v1.6.3 — The Fixed Deal Edition
25
19
 
26
- Team/Pro is the live cart; 10% of savings shows on the weekly number as the comparison, not as what Team is charged.
20
+ Solo $20 mailbox, 10% waived. Team $39 for the data.
27
21
 
28
- The library stays free. Trial still takes 10% of measured savings on the $5 meter. Team is $39/month or $390/year: the weekly number shows what 10% would have been next to the plan. Team is not charged that 10%.
22
+ **Free forever is bunx** — no account. A one-person account is email → key, **$20 on the house**. We show the savings. We don't charge. 10% is the model, waived. Team is **$39 for the data** (`$390`/year).
23
+
24
+ ```bash
25
+ bunx slash-tokens
26
+ # or: npx --yes slash-tokens
27
+ ```
28
+
29
+ Run it in a project that already calls an LLM. An empty folder prints that nothing was found — that's normal.
29
30
 
30
31
  ```bash
31
32
  npm install slash-tokens
@@ -34,38 +35,35 @@ npm install slash-tokens
34
35
  ```js
35
36
  import { preflight, preflightRoute } from 'slash-tokens'
36
37
 
37
- // Analysis — all cheaper alternatives across all providers
38
+ // Analysis — cheaper alternatives across all providers. Not a route.
38
39
  const check = preflight(prompt, 'claude-opus-4.7')
39
- // tokens: 47,000 | cost: $0.71 | 11 cheaper options | save 99%
40
+ check.tokens
41
+ check.cost
42
+ check.fits
43
+ check.options
40
44
 
41
- // Routing decision — matches Slash proxy behavior (same-provider only)
45
+ // Routing decision — same-provider only, matches the Slash proxy
42
46
  const route = preflightRoute(prompt, 'claude-opus-4.7')
43
- // → { model: 'claude-haiku', cost: 0.14, salvaged: 0.57, ... } or null
47
+ // { model: 'claude-haiku', cost, salvaged, salvagePercent } or null
44
48
  ```
45
49
 
46
- Or one line — every API call optimized pre-call:
50
+ Or one line — every LLM call checked pre-call:
47
51
 
48
52
  ```js
49
53
  import 'slash-tokens/auto'
50
54
  ```
51
55
 
52
- Every call routed to the cheapest model that can execute it efficiently. Session summary on exit:
53
-
54
- ```
55
- [slash] Session: 47 calls | 23 routed | $0.89 salvaged — The more you build, the more you save
56
- ```
57
-
58
- ## Next.js Starter
56
+ Intercepts `fetch()` to Anthropic, OpenAI, xAI, and Google. Estimates before the call leaves your machine. Same-provider cheaper swap if one fits.
59
57
 
60
- One-click deploy with Vercel AI SDK + slash-tokens built in:
58
+ ## See it work
61
59
 
62
- [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/Wolfe-Jam/slash-nextjs&project-name=slash-nextjs&env=ANTHROPIC_API_KEY)
60
+ A live chat with every call through the gate: [live demo](https://slash-nextjs-wofejams-projects.vercel.app)
63
61
 
64
- → [slash-nextjs on GitHub](https://github.com/Wolfe-Jam/slash-nextjs)
62
+ Then `bunx slash-tokens`, [get a key](https://mcpaas.live/slash/setup) ($20 on the house), or [Team — $39 for the data](https://slashtokens.com).
65
63
 
66
64
  ## Dashboard
67
65
 
68
- Track savings across all your apps. Free key at [mcpaas.live/slash/setup](https://mcpaas.live/slash/setup)
66
+ Track savings across all your apps. One-person key (email, $20 on the house) at [mcpaas.live/slash/setup](https://mcpaas.live/slash/setup)
69
67
 
70
68
  Full docs, examples, and model pricing at **[GitHub](https://github.com/Wolfe-Jam/slash-tokens)**
71
69
 
@@ -73,7 +71,7 @@ Full docs, examples, and model pricing at **[GitHub](https://github.com/Wolfe-Ja
73
71
 
74
72
  **Code: MIT.** Fork it, ship it, change it, show it, share it, sell it.
75
73
 
76
- **Brand: reserved.** The slash-tokens name, ⚡ mark, and red/gold colors stay with the project. If you're building on top of the SDK, ship under your own name and colors — don't represent your app as Slash.
74
+ **Brand: reserved.** The slash-tokens name, ⚡ mark, and red/gold colors stay with the project. If you're building on top of the SDK, ship under your own name and colors — don't represent your app as Slash. See [NOTICE](./NOTICE).
77
75
 
78
76
  ---
79
77
 
package/dist/auto.js CHANGED
@@ -7,8 +7,8 @@ import { hasKey, isQuiet } from './config.js';
7
7
  // Silent by default. Routes to cheapest model within same provider.
8
8
  // Tracks cumulative savings. Nudges at thresholds.
9
9
  //
10
- // No key: routing still works (free forever), no dashboard tracking
11
- // With key (init or SLASH_KEY): savings reported to MCPaaS
10
+ // No key: routing still works (same as bunx — free forever), no dashboard
11
+ // With key (init or SLASH_KEY): one-person account; savings reported to MCPaaS
12
12
  // Session state
13
13
  let totalSalvaged = 0;
14
14
  let totalCalls = 0;
package/dist/cli.js CHANGED
@@ -289,13 +289,6 @@ function printReport(sites, filesScanned, timeMs, cwd) {
289
289
  console.log(`${GRAY} (${unknownProviderSites} call site${unknownProviderSites === 1 ? "" : "s"} use an assumed price — the detected SDK doesn't reveal the exact provider)${R}`);
290
290
  }
291
291
  console.log("");
292
- const recoveryPct = 10;
293
- const monthlyRecovered = monthlyCost * recoveryPct / 100;
294
- console.log(`${GOLD} ⚡ TOKENS SALVAGED ${GRAY}(${recoveryPct}% gate efficiency)${R}`);
295
- console.log(`${DIM} ${"─".repeat(60)}${R}`);
296
- console.log(`${WHITE} Monthly salvaged: ${GOLD}${B}$${monthlyRecovered.toFixed(2)}/mo${R}`);
297
- console.log(`${WHITE} Annual salvaged: ${GOLD}${B}$${(monthlyRecovered * 12).toFixed(2)}/yr${R}`);
298
- console.log("");
299
292
  console.log(`${GRAY} 4.8 KB WASM · sub-ms · zero deps${R}`);
300
293
  console.log(`${GRAY} → ${ORANGE}slashtokens.com${R}`);
301
294
  console.log("");
package/dist/report.js CHANGED
@@ -76,14 +76,6 @@ export function printReport(sites, filesScanned, timeMs, cwd) {
76
76
  console.log(`${GRAY} (${unknownProviderSites} call site${unknownProviderSites === 1 ? '' : 's'} use an assumed price — the detected SDK doesn't reveal the exact provider)${R}`);
77
77
  }
78
78
  console.log('');
79
- // Slash — sunk cost recovery (conservative 10% gate efficiency)
80
- const recoveryPct = 10;
81
- const monthlyRecovered = monthlyCost * recoveryPct / 100;
82
- console.log(`${GOLD} ⚡ TOKENS SALVAGED ${GRAY}(${recoveryPct}% gate efficiency)${R}`);
83
- console.log(`${DIM} ${'─'.repeat(60)}${R}`);
84
- console.log(`${WHITE} Monthly salvaged: ${GOLD}${B}$${monthlyRecovered.toFixed(2)}/mo${R}`);
85
- console.log(`${WHITE} Annual salvaged: ${GOLD}${B}$${(monthlyRecovered * 12).toFixed(2)}/yr${R}`);
86
- console.log('');
87
79
  console.log(`${GRAY} 4.8 KB WASM · sub-ms · zero deps${R}`);
88
80
  console.log(`${GRAY} → ${ORANGE}slashtokens.com${R}`);
89
81
  console.log('');
@@ -11,7 +11,5 @@ export interface ReportResult {
11
11
  fee_usd: number;
12
12
  balance_remaining_usd: number;
13
13
  timestamp: string;
14
- /** 10% of this call's savings — comparison only. Charged fee is fee_usd (0 on Team). */
15
- counterfactual_fee_usd?: number;
16
14
  }
17
15
  export declare function report(opts: ReportOptions): Promise<ReportResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slash-tokens",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "Token Optimization for Context Engineers. 4.8 KB WASM. Sub-millisecond. Zero dependencies.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -21,7 +21,8 @@
21
21
  },
22
22
  "files": [
23
23
  "dist",
24
- "CHANGELOG.md"
24
+ "CHANGELOG.md",
25
+ "NOTICE"
25
26
  ],
26
27
  "sideEffects": false,
27
28
  "scripts": {