@kunal_dutt/token-lens 0.2.33 → 0.2.35
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 +150 -106
- 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
|
|
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 it is allowed: 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`. 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 and shows drafts only with a key Token Lens gives the page it opens. |
|
|
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
|
+
macOS gives that permission to whatever started Token Lens, which is often
|
|
56
|
+
"node", and turning node on would give every Node program that control, so
|
|
57
|
+
Token Lens never asks for it. A helper app that holds the permission for Token
|
|
58
|
+
Lens alone is in the works; until then live tips run only where that access is
|
|
59
|
+
already granted. The panel at <http://localhost:4797> shows your drafts only
|
|
60
|
+
when Token Lens opens it (ask Claude to "open the Token Lens panel"). 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.35",
|
|
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",
|