@kunal_dutt/token-lens 0.2.33 → 0.2.34
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/PRIVACY.md +1 -1
- package/README.md +8 -3
- package/package.json +1 -1
- package/server.mjs +147 -102
- package/token-lens.mcpb +0 -0
package/PRIVACY.md
CHANGED
|
@@ -18,7 +18,7 @@ anyone.
|
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
19
|
| **Browser extension** (Chrome, Edge, Firefox) | The prompt box, model picker and visible messages on the AI chat sites listed in its permissions, to count tokens. | Your settings, prices, budget and savings totals, in your browser's own extension storage. Uninstalling deletes them. | Nothing. Its only network request is on claude.ai: at most once a minute it reads your own session and weekly usage from claude.ai, signed in as you, so plan tips use real numbers. The result is not stored and goes nowhere else. |
|
|
20
20
|
| **MCP server on your computer** (`npx @kunal_dutt/token-lens`, Claude Desktop extension) | Only the text an AI app passes to its tools. | Savings totals only: per day, action and model, the number of tokens and dollars saved, in `~/.token-lens/savings.json` on your computer. Never any text. Delete the file to clear it; `TOKEN_LENS_LEDGER=off` turns it off. | Nothing by default. Only if you set your own `ANTHROPIC_API_KEY` or `GEMINI_API_KEY` for it does it send the text to that provider's token-counting endpoint, with your key, for an exact count. |
|
|
21
|
-
| **Live tips in the Claude app on a Mac** (part of the MCP server when the Claude desktop app starts it) | Through macOS Accessibility, once you
|
|
21
|
+
| **Live tips in the Claude app on a Mac** (part of the MCP server when the Claude desktop app starts it) | Through macOS Accessibility, granted to Token Lens Helper once you set it up: the text in the front AI app's message box and open chat (Claude or ChatGPT), to count tokens. | Only on/off settings in `~/.token-lens/live.json`, and the helper app itself in `~/.token-lens/helper`. The text stays in memory while counting and is never written down. | Nothing. macOS notifications on your Mac, and a panel served only to your own Mac at `localhost:4797` that refuses other sites. |
|
|
22
22
|
| **Your own connector** (`npx @kunal_dutt/token-lens --http`) | Only the text sent to its tools. | Nothing. | Nothing beyond the reply. |
|
|
23
23
|
| **Public hosted connector** (`/api/mcp`) | Only the text an AI app passes to its tools. | Nothing. Each request is handled in memory and discarded; requests are not logged or stored. The hosting provider keeps standard request metadata (time, IP address, URL) for security, as any website does. | Nothing beyond the reply. Prefer running your own copy if even that metadata matters. |
|
|
24
24
|
| **Developer library** (`@kunal_dutt/token-lens/sdk` on npm, `token-lens` on PyPI, inside your app) | Your app's requests to OpenAI or Anthropic, in your own process. | Savings counters in your app's memory. | Nothing of its own. Your requests still go only to the provider your code already calls. |
|
package/README.md
CHANGED
|
@@ -50,9 +50,14 @@ Then ask, for example: "optimize this prompt with Token Lens", "how full is this
|
|
|
50
50
|
chat?" or "optimize this agent's system prompt and tools".
|
|
51
51
|
|
|
52
52
|
**Live tips in the Claude app on a Mac, with no command.** When the Claude
|
|
53
|
-
desktop app starts Token Lens, it also watches
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
desktop app starts Token Lens, it also watches the message box and open chat of
|
|
54
|
+
the AI app in front (Claude, or ChatGPT's Mac app), through macOS Accessibility.
|
|
55
|
+
That permission goes to **Token Lens Helper**, a small app Token Lens builds in
|
|
56
|
+
`~/.token-lens/helper` only when you click **Set up Token Lens Helper** at
|
|
57
|
+
<http://localhost:4797> (or ask Claude to "set up Token Lens Helper"), then turn
|
|
58
|
+
on in System Settings > Privacy & Security > Accessibility. The helper holds
|
|
59
|
+
the permission for Token Lens alone, with its watcher compiled in, so you never
|
|
60
|
+
need to turn on "node", which would give every Node program that control. When you pause typing and a
|
|
56
61
|
shorter prompt says the same thing, or a chat gets long enough that every
|
|
57
62
|
message re-reads a lot, a macOS notification says so, in tokens and dollars.
|
|
58
63
|
The shorter draft waits, ready to copy, at <http://localhost:4797>. It never
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kunal_dutt/token-lens",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.34",
|
|
4
4
|
"description": "Count and cut the tokens your prompts, chats and agents use, adapted to the model and task. MCP server and self-hosted gateway. Collects no data.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|