@tokentop/ttop 0.7.0 → 0.8.0

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 CHANGED
@@ -46,7 +46,7 @@ That's tokentop.
46
46
 
47
47
  - **Real-time dashboard** — Live token counts, costs, burn rate, and activity sparklines
48
48
  - **11 providers** — Anthropic, OpenAI, Google Gemini, GitHub Copilot, Codex, Perplexity, Antigravity, MiniMax, Zai, OpenCode Zen, Chutes
49
- - **7 coding agents** — Claude Code, OpenCode, Cursor, Copilot CLI, Gemini CLI, Antigravity, and Windsurf. See every session with model, tokens, cost, and duration
49
+ - **8 coding agents** — Claude Code, OpenCode, Cursor, Copilot CLI, Gemini CLI, Antigravity, Windsurf, and Pi. See every session with model, tokens, cost, and duration
50
50
  - **Budget guardrails** — Daily, weekly, and monthly limits with visual warnings at limit percentages you set
51
51
  - **Smart sidebar** — Adaptive panel that breaks down spending by model, project, or agent
52
52
  - **Efficiency insights** — Cache leverage, output verbosity, and cost-per-request analysis to help you spend less
@@ -144,7 +144,7 @@ tokentop has 4 main views, switchable with `1`–`4`:
144
144
 
145
145
  ## Agents
146
146
 
147
- tokentop tracks sessions from 7 coding agents. Each agent is a standalone plugin — built-in agents ship with the app, community agents install from npm.
147
+ tokentop tracks sessions from 8 coding agents. Each agent is a standalone plugin — built-in agents ship with the app, community agents install from npm.
148
148
 
149
149
  | Agent | What it tracks | Plugin |
150
150
  |-------|---------------|--------|
@@ -155,6 +155,7 @@ tokentop tracks sessions from 7 coding agents. Each agent is a standalone plugin
155
155
  | [Gemini CLI](https://tokentop.app/docs/agents/gemini-cli/) | Sessions, Google OAuth | [`@tokentop/agent-gemini`](https://github.com/tokentopapp/agent-gemini) |
156
156
  | [Antigravity](https://tokentop.app/docs/agents/antigravity/) | Sessions, Google OAuth | [`@tokentop/agent-gemini`](https://github.com/tokentopapp/agent-gemini) |
157
157
  | [Windsurf](https://tokentop.app/docs/agents/windsurf/) | Sessions, Codeium auth | [`@tokentop/agent-windsurf`](https://github.com/tokentopapp/agent-windsurf) |
158
+ | [Pi](https://github.com/tokentopapp/agent-pi) | Sessions, subagent usage, Pi-based agents such as Prime | [`@tokentop/agent-pi`](https://github.com/tokentopapp/agent-pi) |
158
159
 
159
160
  All agents are auto-discovered — if you have the tool installed, tokentop finds it. See the [agent docs](https://tokentop.app/docs/agents/) for details.
160
161
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokentop/ttop",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Real-time AI token usage monitor - htop for your API costs",
5
5
  "author": "Nigel Bazzeghin <nbazzeghin@gmail.com>",
6
6
  "license": "MIT",
@@ -11,6 +11,7 @@
11
11
  "files": [
12
12
  "bin/",
13
13
  "src/",
14
+ "tsconfig.json",
14
15
  "package.json",
15
16
  "README.md",
16
17
  "LICENSE"
@@ -34,16 +35,18 @@
34
35
  "analytics": "bun .opencode/skills/analytics/scripts/analytics.ts"
35
36
  },
36
37
  "dependencies": {
37
- "@opentui/core": "0.1.98",
38
- "@opentui/react": "0.1.98",
38
+ "@opentui/core": "0.5.14",
39
+ "@opentui/react": "0.5.14",
39
40
  "@tokentop/agent-claude-code": "^1.1.0",
40
41
  "@tokentop/agent-copilot-cli": "^1.0.0",
41
42
  "@tokentop/agent-cursor": "^1.2.0",
42
43
  "@tokentop/agent-gemini": "^1.0.0",
43
44
  "@tokentop/agent-opencode": "^1.0.0",
45
+ "@tokentop/agent-pi": "^0.2.0",
44
46
  "@tokentop/plugin-sdk": "^1.5.0",
45
47
  "react": "^19.0.0",
46
- "react-devtools-core": "^7.0.1",
48
+ "react-devtools-core": "^8.0.0",
49
+ "web-tree-sitter": "0.25.10",
47
50
  "zod": "^4.0.0"
48
51
  },
49
52
  "devDependencies": {
@@ -73,6 +76,6 @@
73
76
  "bun": ">=1.0.0"
74
77
  },
75
78
  "overrides": {
76
- "@types/node": "^25.0.0"
79
+ "@types/node": "^26.0.0"
77
80
  }
78
81
  }
@@ -3,3 +3,4 @@ export { default as copilotCliAgentPlugin } from "@tokentop/agent-copilot-cli";
3
3
  export { default as cursorAgentPlugin } from "@tokentop/agent-cursor";
4
4
  export { default as geminiAgentPlugin } from "@tokentop/agent-gemini";
5
5
  export { default as opencodeAgentPlugin } from "@tokentop/agent-opencode";
6
+ export { default as piAgentPlugin } from "@tokentop/agent-pi";
@@ -0,0 +1,24 @@
1
+ import { expect, test } from "bun:test";
2
+ import type { PluginHttpClient, ProviderFetchContext } from "@tokentop/plugin-sdk";
3
+ import { perplexityPlugin } from "./perplexity.ts";
4
+
5
+ test("attributes Perplexity API requests", async () => {
6
+ let requestHeaders = new Headers();
7
+ const http: PluginHttpClient = {
8
+ fetch: async (_url, init) => {
9
+ requestHeaders = new Headers(init?.headers);
10
+ return new Response(null, { status: 401 });
11
+ },
12
+ };
13
+ const context = {
14
+ credentials: { apiKey: "test-key", source: "env" },
15
+ http,
16
+ logger: { debug() {}, info() {}, warn() {}, error() {} },
17
+ config: {},
18
+ signal: AbortSignal.timeout(5000),
19
+ } satisfies ProviderFetchContext;
20
+
21
+ await perplexityPlugin.fetchUsage(context);
22
+
23
+ expect(requestHeaders.get("x-pplx-integration")).toBe("tokentop");
24
+ });
@@ -105,6 +105,7 @@ export const perplexityPlugin: ProviderPlugin = {
105
105
  headers: {
106
106
  Authorization: `Bearer ${credentials.apiKey}`,
107
107
  "Content-Type": "application/json",
108
+ "X-Pplx-Integration": "tokentop",
108
109
  },
109
110
  body: JSON.stringify({
110
111
  model: "sonar",
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.7.0"; // x-release-please-version
1
+ export const VERSION = "0.8.0"; // x-release-please-version
package/tsconfig.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "compilerOptions": {
3
+ // Environment setup
4
+ "lib": ["ESNext"],
5
+ "target": "ESNext",
6
+ "module": "ESNext",
7
+ "moduleDetection": "force",
8
+
9
+ // OpenTUI React JSX configuration
10
+ "jsx": "react-jsx",
11
+ "jsxImportSource": "@opentui/react",
12
+
13
+ // Bundler mode
14
+ "moduleResolution": "bundler",
15
+ "allowImportingTsExtensions": true,
16
+ "verbatimModuleSyntax": true,
17
+ "noEmit": true,
18
+ "allowJs": true,
19
+
20
+ // Strict mode
21
+ "strict": true,
22
+ "skipLibCheck": true,
23
+ "noFallthroughCasesInSwitch": true,
24
+ "noUncheckedIndexedAccess": true,
25
+ "noImplicitOverride": true,
26
+
27
+ // Path mapping
28
+ "paths": {
29
+ "@/*": ["./src/*"],
30
+ "@plugins/*": ["./src/plugins/*"],
31
+ "@tui/*": ["./src/tui/*"],
32
+ "@utils/*": ["./src/utils/*"]
33
+ },
34
+
35
+ // Additional checks
36
+ "noUnusedLocals": true,
37
+ "noUnusedParameters": true,
38
+ "exactOptionalPropertyTypes": true,
39
+ "noPropertyAccessFromIndexSignature": false
40
+ },
41
+ "include": ["src/**/*", "templates/**/*"],
42
+ "exclude": ["dist", "node_modules"]
43
+ }