@anthonyhan/token-pilot 0.0.0-stage → 0.2.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/.github/FUNDING.yml +3 -0
- package/.github/workflows/build-desktop.yml +68 -0
- package/.idea/go.imports.xml +10 -0
- package/.idea/modules.xml +8 -0
- package/.idea/sonarlint/vulnerabilitystore/default/index.pb +0 -0
- package/.idea/thriftCompilerAssist.xml +6 -0
- package/.idea/token-pilot.iml +9 -0
- package/.idea/vcs.xml +6 -0
- package/README-en.md +127 -0
- package/README.md +146 -2
- package/bin/token-pilot.js +15 -0
- package/docs/assets/dashboard.png +0 -0
- package/docs/assets/icon.png +0 -0
- package/docs/assets/menubar-panel.png +0 -0
- package/docs/assets/sponsor-alipay.png +0 -0
- package/docs/assets/sponsor-wechat.png +0 -0
- package/llms.txt +40 -0
- package/menubar/package-lock.json +248 -0
- package/menubar/package.json +16 -0
- package/menubar/src/dashboard.html +1266 -0
- package/menubar/src/index.html +674 -0
- package/menubar/src-tauri/Cargo.lock +4963 -0
- package/menubar/src-tauri/Cargo.toml +15 -0
- package/menubar/src-tauri/build.rs +3 -0
- package/menubar/src-tauri/gen/schemas/acl-manifests.json +1 -0
- package/menubar/src-tauri/gen/schemas/capabilities.json +1 -0
- package/menubar/src-tauri/gen/schemas/desktop-schema.json +2526 -0
- package/menubar/src-tauri/gen/schemas/macOS-schema.json +2526 -0
- package/menubar/src-tauri/icons/128x128.png +0 -0
- package/menubar/src-tauri/icons/128x128@2x.png +0 -0
- package/menubar/src-tauri/icons/32x32.png +0 -0
- package/menubar/src-tauri/icons/64x64.png +0 -0
- package/menubar/src-tauri/icons/Square107x107Logo.png +0 -0
- package/menubar/src-tauri/icons/Square142x142Logo.png +0 -0
- package/menubar/src-tauri/icons/Square150x150Logo.png +0 -0
- package/menubar/src-tauri/icons/Square284x284Logo.png +0 -0
- package/menubar/src-tauri/icons/Square30x30Logo.png +0 -0
- package/menubar/src-tauri/icons/Square310x310Logo.png +0 -0
- package/menubar/src-tauri/icons/Square44x44Logo.png +0 -0
- package/menubar/src-tauri/icons/Square71x71Logo.png +0 -0
- package/menubar/src-tauri/icons/Square89x89Logo.png +0 -0
- package/menubar/src-tauri/icons/StoreLogo.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/menubar/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/menubar/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/menubar/src-tauri/icons/android/values/ic_launcher_background.xml +4 -0
- package/menubar/src-tauri/icons/icon.icns +0 -0
- package/menubar/src-tauri/icons/icon.ico +0 -0
- package/menubar/src-tauri/icons/icon.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-20x20@1x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-20x20@2x-1.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-20x20@2x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-20x20@3x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-29x29@1x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-29x29@2x-1.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-29x29@2x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-29x29@3x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-40x40@1x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-40x40@2x-1.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-40x40@2x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-40x40@3x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-512@2x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-60x60@2x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-60x60@3x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-76x76@1x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-76x76@2x.png +0 -0
- package/menubar/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png +0 -0
- package/menubar/src-tauri/icons/tray-win.png +0 -0
- package/menubar/src-tauri/icons/tray.png +0 -0
- package/menubar/src-tauri/src/main.rs +486 -0
- package/menubar/src-tauri/tauri.conf.json +56 -0
- package/package.json +20 -3
- package/pricing/models.json +311 -0
- package/scripts/gen-icons.py +153 -0
- package/scripts/reconcile.py +162 -0
- package/scripts/verify-dashboard.py +101 -0
- package/src/adapters/claude-code.ts +246 -0
- package/src/adapters/codex.ts +166 -0
- package/src/adapters/dsh.ts +156 -0
- package/src/adapters/kimi-code.ts +164 -0
- package/src/adapters/opencode.ts +120 -0
- package/src/adapters/pi.ts +99 -0
- package/src/adapters/qoder.ts +43 -0
- package/src/adapters/types.ts +39 -0
- package/src/adapters/volc-ark.ts +102 -0
- package/src/adapters/workbuddy.ts +135 -0
- package/src/cli/index.ts +294 -0
- package/src/cli/serve.ts +209 -0
- package/src/core/aggregate.ts +821 -0
- package/src/core/alert.ts +33 -0
- package/src/core/autocompact.ts +46 -0
- package/src/core/budget.ts +42 -0
- package/src/core/collector.ts +209 -0
- package/src/core/compression.ts +163 -0
- package/src/core/config.ts +71 -0
- package/src/core/contract.ts +181 -0
- package/src/core/metrics.ts +72 -0
- package/src/core/price-fetch.ts +112 -0
- package/src/core/pricing.ts +182 -0
- package/src/core/registry.ts +141 -0
- package/src/core/retry-detector.ts +64 -0
- package/src/core/rtk.ts +58 -0
- package/src/core/savings.ts +55 -0
- package/src/core/schema.ts +66 -0
- package/src/core/unknown-models.ts +64 -0
- package/tests/adapters-dsh.test.ts +35 -0
- package/tests/adapters-opencode.test.ts +39 -0
- package/tests/adapters-pi.test.ts +33 -0
- package/tests/adapters-workbuddy.test.ts +34 -0
- package/tests/adapters.test.ts +45 -0
- package/tests/aggregate.test.ts +153 -0
- package/tests/compression.test.ts +71 -0
- package/tests/fixtures/claude-session.jsonl +9 -0
- package/tests/fixtures/codex-rollout.jsonl +5 -0
- package/tests/fixtures/kimi-wire.jsonl +6 -0
- package/tests/pricing-timebased.test.ts +51 -0
- package/tests/pricing.test.ts +73 -0
- package/tests/serve.test.ts +29 -0
- package/tsconfig.json +19 -0
- package/web/dashboard.html +1266 -0
- package/web/panel.html +674 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schema.tauri.app/config/2",
|
|
3
|
+
"productName": "token-pilot",
|
|
4
|
+
"version": "0.2.3",
|
|
5
|
+
"identifier": "com.anthonyhann.tokenpilot",
|
|
6
|
+
"build": {
|
|
7
|
+
"beforeDevCommand": "",
|
|
8
|
+
"beforeBuildCommand": "",
|
|
9
|
+
"frontendDist": "../src"
|
|
10
|
+
},
|
|
11
|
+
"app": {
|
|
12
|
+
"withGlobalTauri": true,
|
|
13
|
+
"windows": [
|
|
14
|
+
{
|
|
15
|
+
"label": "main",
|
|
16
|
+
"title": "Token Pilot",
|
|
17
|
+
"width": 480,
|
|
18
|
+
"height": 760,
|
|
19
|
+
"resizable": true,
|
|
20
|
+
"minWidth": 400,
|
|
21
|
+
"minHeight": 520,
|
|
22
|
+
"maxWidth": 720,
|
|
23
|
+
"alwaysOnTop": true,
|
|
24
|
+
"decorations": false,
|
|
25
|
+
"transparent": true,
|
|
26
|
+
"visible": false,
|
|
27
|
+
"skipTaskbar": true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"label": "dashboard",
|
|
31
|
+
"title": "Token Pilot · 本地看板",
|
|
32
|
+
"url": "dashboard.html",
|
|
33
|
+
"width": 1500,
|
|
34
|
+
"height": 950,
|
|
35
|
+
"minWidth": 1040,
|
|
36
|
+
"minHeight": 640,
|
|
37
|
+
"resizable": true,
|
|
38
|
+
"visible": false
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"security": {
|
|
42
|
+
"csp": null
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"bundle": {
|
|
46
|
+
"active": true,
|
|
47
|
+
"targets": "all",
|
|
48
|
+
"icon": [
|
|
49
|
+
"icons/32x32.png",
|
|
50
|
+
"icons/128x128.png",
|
|
51
|
+
"icons/128x128@2x.png",
|
|
52
|
+
"icons/icon.icns",
|
|
53
|
+
"icons/icon.ico"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anthonyhan/token-pilot",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"description": "你所有 AI 工具的本地账单 + 预算控制器 — 只读本地日志,零入侵,不出本机",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"token-pilot": "./bin/token-pilot.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"dev": "tsc --watch",
|
|
12
|
+
"today": "node --experimental-strip-types src/cli/index.ts today",
|
|
13
|
+
"test": "node --experimental-strip-types --test tests/*.test.ts"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"dependencies": {},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
}
|
|
6
23
|
}
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "每 1M token 定价。currency: USD=美元(官方美元目录价)/ CNY=人民币(官方人民币目录价,加载时按汇率折算)。DeepSeek 为分时定价:peak=北京时间工作日 9-12/14-18(不含法定节假日),offpeak=其余。来源见 _sources。欢迎 PR 修正。",
|
|
3
|
+
"_updated": "2026-10-22",
|
|
4
|
+
"_sources": {
|
|
5
|
+
"deepseek": "https://api-docs.deepseek.com/zh-cn/quick_start/pricing/",
|
|
6
|
+
"minimax": "https://platform.minimax.cn/docs/pricing/overview",
|
|
7
|
+
"glm": "https://docs.bigmodel.cn/cn/guide/start/pricing",
|
|
8
|
+
"kimi": "https://platform.kimi.com/docs/pricing/chat",
|
|
9
|
+
"claude": "https://claude.com/pricing#api",
|
|
10
|
+
"openai": "https://developers.openai.com/api/docs/pricing",
|
|
11
|
+
"gemini": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing",
|
|
12
|
+
"grok": "https://grok.cadn.net.cn/docs_cn/models.html",
|
|
13
|
+
"mimo": "https://mimo.mi.com/docs/zh-CN/price/pay-as-you-go",
|
|
14
|
+
"longcat": "https://longcat.chat/platform/docs/zh/api-pay-as-you-go"
|
|
15
|
+
},
|
|
16
|
+
"models": {
|
|
17
|
+
"claude-fable-5-1": {
|
|
18
|
+
"provider": "anthropic",
|
|
19
|
+
"input": 10.0,
|
|
20
|
+
"output": 50.0,
|
|
21
|
+
"cacheRead": 0.25,
|
|
22
|
+
"cacheCreation": 12.5
|
|
23
|
+
},
|
|
24
|
+
"claude-opus-5-5": {
|
|
25
|
+
"provider": "anthropic",
|
|
26
|
+
"input": 4.0,
|
|
27
|
+
"output": 20.0,
|
|
28
|
+
"cacheRead": 0.2,
|
|
29
|
+
"cacheCreation": 5.0
|
|
30
|
+
},
|
|
31
|
+
"claude-sonnet-5-5": {
|
|
32
|
+
"provider": "anthropic",
|
|
33
|
+
"input": 2.0,
|
|
34
|
+
"output": 10.0,
|
|
35
|
+
"cacheRead": 0.1,
|
|
36
|
+
"cacheCreation": 2.5
|
|
37
|
+
},
|
|
38
|
+
"claude-haiku-5-5": {
|
|
39
|
+
"provider": "anthropic",
|
|
40
|
+
"input": 0.1,
|
|
41
|
+
"output": 0.5,
|
|
42
|
+
"cacheRead": 0.01,
|
|
43
|
+
"cacheCreation": 0.125
|
|
44
|
+
},
|
|
45
|
+
"claude-sonnet-4-6": {
|
|
46
|
+
"provider": "anthropic",
|
|
47
|
+
"input": 3.0,
|
|
48
|
+
"output": 15.0,
|
|
49
|
+
"cacheRead": 0.3,
|
|
50
|
+
"cacheCreation": 3.75
|
|
51
|
+
},
|
|
52
|
+
"claude-opus-4-5": {
|
|
53
|
+
"provider": "anthropic",
|
|
54
|
+
"input": 15.0,
|
|
55
|
+
"output": 75.0,
|
|
56
|
+
"cacheRead": 1.5,
|
|
57
|
+
"cacheCreation": 18.75
|
|
58
|
+
},
|
|
59
|
+
"gpt-5.6-sol": {
|
|
60
|
+
"provider": "openai",
|
|
61
|
+
"input": 4.0,
|
|
62
|
+
"output": 20.0,
|
|
63
|
+
"cacheRead": 0.4
|
|
64
|
+
},
|
|
65
|
+
"gpt-5.6-cyber": {
|
|
66
|
+
"provider": "openai",
|
|
67
|
+
"input": 12.5,
|
|
68
|
+
"output": 75.0,
|
|
69
|
+
"cacheRead": 1.25
|
|
70
|
+
},
|
|
71
|
+
"gpt-5": {
|
|
72
|
+
"provider": "openai",
|
|
73
|
+
"input": 2.5,
|
|
74
|
+
"output": 15.0,
|
|
75
|
+
"cacheRead": 0.25
|
|
76
|
+
},
|
|
77
|
+
"gpt-5.4": {
|
|
78
|
+
"provider": "openai",
|
|
79
|
+
"input": 2.5,
|
|
80
|
+
"output": 15.0,
|
|
81
|
+
"cacheRead": 0.25
|
|
82
|
+
},
|
|
83
|
+
"gpt-5-mini": {
|
|
84
|
+
"provider": "openai",
|
|
85
|
+
"input": 0.5,
|
|
86
|
+
"output": 2.0,
|
|
87
|
+
"cacheRead": 0.05
|
|
88
|
+
},
|
|
89
|
+
"codex": {
|
|
90
|
+
"provider": "openai",
|
|
91
|
+
"input": 2.5,
|
|
92
|
+
"output": 15.0,
|
|
93
|
+
"cacheRead": 0.25
|
|
94
|
+
},
|
|
95
|
+
"gemini-3-flash": {
|
|
96
|
+
"provider": "gemini",
|
|
97
|
+
"input": 0.75,
|
|
98
|
+
"output": 3.75,
|
|
99
|
+
"cacheRead": 0.075,
|
|
100
|
+
"_note": "2026-12-31 前体验价;之后 1.5/7.5"
|
|
101
|
+
},
|
|
102
|
+
"gemini-3-pro": {
|
|
103
|
+
"provider": "gemini",
|
|
104
|
+
"input": 2.0,
|
|
105
|
+
"output": 10.0,
|
|
106
|
+
"cacheRead": 0.1
|
|
107
|
+
},
|
|
108
|
+
"google/gemini-3-flash-preview": {
|
|
109
|
+
"provider": "gemini",
|
|
110
|
+
"input": 0.75,
|
|
111
|
+
"output": 3.75,
|
|
112
|
+
"cacheRead": 0.075
|
|
113
|
+
},
|
|
114
|
+
"grok-2": {
|
|
115
|
+
"provider": "grok",
|
|
116
|
+
"input": 2.0,
|
|
117
|
+
"output": 10.0
|
|
118
|
+
},
|
|
119
|
+
"grok-2-vision": {
|
|
120
|
+
"provider": "grok",
|
|
121
|
+
"input": 2.0,
|
|
122
|
+
"output": 10.0
|
|
123
|
+
},
|
|
124
|
+
"deepseek-flash": {
|
|
125
|
+
"provider": "deepseek",
|
|
126
|
+
"currency": "CNY",
|
|
127
|
+
"peak": {
|
|
128
|
+
"input": 2.0,
|
|
129
|
+
"output": 8.0,
|
|
130
|
+
"cacheRead": 0.04
|
|
131
|
+
},
|
|
132
|
+
"offpeak": {
|
|
133
|
+
"input": 1.0,
|
|
134
|
+
"output": 4.0,
|
|
135
|
+
"cacheRead": 0.02
|
|
136
|
+
},
|
|
137
|
+
"_note": "V4.1-Flash;高峰=北京时间工作日 9-12/14-18(不含法定节假日)"
|
|
138
|
+
},
|
|
139
|
+
"deepseek-v4.1-flash": {
|
|
140
|
+
"_alias": "deepseek-flash"
|
|
141
|
+
},
|
|
142
|
+
"deepseek-v4-1-flash": {
|
|
143
|
+
"_alias": "deepseek-flash"
|
|
144
|
+
},
|
|
145
|
+
"deepseek-v4-pro": {
|
|
146
|
+
"provider": "deepseek",
|
|
147
|
+
"currency": "CNY",
|
|
148
|
+
"peak": {
|
|
149
|
+
"input": 9.0,
|
|
150
|
+
"output": 27.0,
|
|
151
|
+
"cacheRead": 0.3
|
|
152
|
+
},
|
|
153
|
+
"offpeak": {
|
|
154
|
+
"input": 4.5,
|
|
155
|
+
"output": 13.5,
|
|
156
|
+
"cacheRead": 0.15
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"glm-5.3": {
|
|
160
|
+
"provider": "glm",
|
|
161
|
+
"currency": "CNY",
|
|
162
|
+
"input": 8.0,
|
|
163
|
+
"output": 28.0,
|
|
164
|
+
"cacheRead": 2.0
|
|
165
|
+
},
|
|
166
|
+
"glm-5.3-flash": {
|
|
167
|
+
"provider": "glm",
|
|
168
|
+
"currency": "CNY",
|
|
169
|
+
"input": 0.8,
|
|
170
|
+
"output": 2.8,
|
|
171
|
+
"cacheRead": 0.23
|
|
172
|
+
},
|
|
173
|
+
"glm-5.3-flashx": {
|
|
174
|
+
"provider": "glm",
|
|
175
|
+
"currency": "CNY",
|
|
176
|
+
"input": 2.0,
|
|
177
|
+
"output": 7.0,
|
|
178
|
+
"cacheRead": 0.57
|
|
179
|
+
},
|
|
180
|
+
"glm-5": {
|
|
181
|
+
"provider": "glm",
|
|
182
|
+
"currency": "CNY",
|
|
183
|
+
"input": 4.0,
|
|
184
|
+
"output": 16.0,
|
|
185
|
+
"cacheRead": 1.0
|
|
186
|
+
},
|
|
187
|
+
"kimi-k3": {
|
|
188
|
+
"provider": "kimi",
|
|
189
|
+
"currency": "CNY",
|
|
190
|
+
"input": 20.0,
|
|
191
|
+
"output": 100.0,
|
|
192
|
+
"cacheRead": 2.0
|
|
193
|
+
},
|
|
194
|
+
"kimi-k2.7-code": {
|
|
195
|
+
"provider": "kimi",
|
|
196
|
+
"currency": "CNY",
|
|
197
|
+
"input": 6.5,
|
|
198
|
+
"output": 27.0,
|
|
199
|
+
"cacheRead": 1.3
|
|
200
|
+
},
|
|
201
|
+
"kimi-k2.6": {
|
|
202
|
+
"provider": "kimi",
|
|
203
|
+
"currency": "CNY",
|
|
204
|
+
"input": 6.5,
|
|
205
|
+
"output": 27.0,
|
|
206
|
+
"cacheRead": 1.1
|
|
207
|
+
},
|
|
208
|
+
"minimax-m3.1-flash": {
|
|
209
|
+
"provider": "minimax",
|
|
210
|
+
"currency": "CNY",
|
|
211
|
+
"input": 1.0,
|
|
212
|
+
"output": 4.0,
|
|
213
|
+
"cacheRead": 0.1
|
|
214
|
+
},
|
|
215
|
+
"minimax-m3": {
|
|
216
|
+
"provider": "minimax",
|
|
217
|
+
"currency": "CNY",
|
|
218
|
+
"input": 2.1,
|
|
219
|
+
"output": 8.4,
|
|
220
|
+
"cacheRead": 0.42
|
|
221
|
+
},
|
|
222
|
+
"qwen3-coder": {
|
|
223
|
+
"provider": "qwen",
|
|
224
|
+
"currency": "CNY",
|
|
225
|
+
"input": 2.0,
|
|
226
|
+
"output": 8.0
|
|
227
|
+
},
|
|
228
|
+
"qwen-max": {
|
|
229
|
+
"provider": "qwen",
|
|
230
|
+
"currency": "CNY",
|
|
231
|
+
"input": 2.4,
|
|
232
|
+
"output": 9.6
|
|
233
|
+
},
|
|
234
|
+
"doubao-seed-2-1-pro": {
|
|
235
|
+
"provider": "doubao",
|
|
236
|
+
"currency": "CNY",
|
|
237
|
+
"input": 0.8,
|
|
238
|
+
"output": 2.0
|
|
239
|
+
},
|
|
240
|
+
"doubao-seed-2-0-lite": {
|
|
241
|
+
"provider": "doubao",
|
|
242
|
+
"currency": "CNY",
|
|
243
|
+
"input": 0.3,
|
|
244
|
+
"output": 0.6
|
|
245
|
+
},
|
|
246
|
+
"hunyuan-large": {
|
|
247
|
+
"provider": "hunyuan",
|
|
248
|
+
"currency": "CNY",
|
|
249
|
+
"input": 4.0,
|
|
250
|
+
"output": 12.0
|
|
251
|
+
},
|
|
252
|
+
"hy3": {
|
|
253
|
+
"provider": "hunyuan",
|
|
254
|
+
"currency": "CNY",
|
|
255
|
+
"input": 4.0,
|
|
256
|
+
"output": 12.0
|
|
257
|
+
},
|
|
258
|
+
"step-5-preview": {
|
|
259
|
+
"provider": "stepfun",
|
|
260
|
+
"currency": "CNY",
|
|
261
|
+
"input": 4.0,
|
|
262
|
+
"output": 12.0
|
|
263
|
+
},
|
|
264
|
+
"mimo-v2.6-flash": {
|
|
265
|
+
"provider": "mimo",
|
|
266
|
+
"currency": "CNY",
|
|
267
|
+
"input": 1.0,
|
|
268
|
+
"output": 2.0,
|
|
269
|
+
"cacheRead": 0.02
|
|
270
|
+
},
|
|
271
|
+
"mimo-v2.6-pro": {
|
|
272
|
+
"provider": "mimo",
|
|
273
|
+
"currency": "CNY",
|
|
274
|
+
"input": 3.0,
|
|
275
|
+
"output": 6.0,
|
|
276
|
+
"cacheRead": 0.025
|
|
277
|
+
},
|
|
278
|
+
"mimo-v2.6-pro-ultraspeed": {
|
|
279
|
+
"provider": "mimo",
|
|
280
|
+
"currency": "CNY",
|
|
281
|
+
"input": 30.0,
|
|
282
|
+
"output": 60.0,
|
|
283
|
+
"cacheRead": 0.25
|
|
284
|
+
},
|
|
285
|
+
"longcat-2.5-preview": {
|
|
286
|
+
"provider": "longcat",
|
|
287
|
+
"currency": "CNY",
|
|
288
|
+
"input": 2.0,
|
|
289
|
+
"output": 8.0,
|
|
290
|
+
"cacheRead": 0.04
|
|
291
|
+
},
|
|
292
|
+
"longcat-2.0": {
|
|
293
|
+
"provider": "longcat",
|
|
294
|
+
"currency": "CNY",
|
|
295
|
+
"input": 2.0,
|
|
296
|
+
"output": 8.0,
|
|
297
|
+
"cacheRead": 0.04
|
|
298
|
+
},
|
|
299
|
+
"mimo-v2": {
|
|
300
|
+
"_alias": "mimo-v2.6-flash"
|
|
301
|
+
},
|
|
302
|
+
"longcat-flash": {
|
|
303
|
+
"_alias": "longcat-2.5-preview"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"fallback": {
|
|
307
|
+
"input": 1.0,
|
|
308
|
+
"output": 5.0,
|
|
309
|
+
"_note": "未知模型按此估算(USD)"
|
|
310
|
+
}
|
|
311
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# token-pilot 图标生成 — 借 CatPaw 雷达底稿风格,换品牌闪电+橙红渐变
|
|
3
|
+
# 产出:menubar/src-tauri/icons/icon.png(1024 app 图标)+ tray.png(44 单色模板图标)
|
|
4
|
+
|
|
5
|
+
from PIL import Image, ImageDraw, ImageFilter
|
|
6
|
+
import math
|
|
7
|
+
import os
|
|
8
|
+
|
|
9
|
+
OUT = os.path.join(os.path.dirname(__file__), '..', 'menubar', 'src-tauri', 'icons')
|
|
10
|
+
os.makedirs(OUT, exist_ok=True)
|
|
11
|
+
|
|
12
|
+
# 品牌色(与设计体系 oklch 对应)
|
|
13
|
+
C_ORANGE = (255, 122, 69) # accent
|
|
14
|
+
C_PINK = (255, 77, 109) # accent-2
|
|
15
|
+
C_VIOLET = (178, 102, 255) # accent-3
|
|
16
|
+
C_BG = (22, 24, 43) # 深夜蓝底
|
|
17
|
+
C_BG2 = (31, 34, 56)
|
|
18
|
+
|
|
19
|
+
BOLT = [(13, 2), (4, 14), (10, 14), (9, 22), (20, 10), (14, 10)] # 24px viewBox 闪电路径转多边形
|
|
20
|
+
|
|
21
|
+
def bolt_poly(cx, cy, w, h):
|
|
22
|
+
"""以 (cx,cy) 为中心、宽 w 高 h 的闪电多边形"""
|
|
23
|
+
return [(cx - w/2 + px/24*w, cy - h/2 + py/24*h) for px, py in BOLT]
|
|
24
|
+
|
|
25
|
+
def lerp(a, b, t):
|
|
26
|
+
return tuple(int(a[i] + (b[i]-a[i])*t) for i in range(3))
|
|
27
|
+
|
|
28
|
+
def vgrad(draw_fn, box, c_top, c_bottom):
|
|
29
|
+
"""竖直渐变填充:逐行画"""
|
|
30
|
+
x0, y0, x1, y1 = box
|
|
31
|
+
im = Image.new('RGBA', (x1-x0, y1-y0), (0,0,0,0))
|
|
32
|
+
d = ImageDraw.Draw(im)
|
|
33
|
+
for y in range(y1-y0):
|
|
34
|
+
d.line([(0,y),(x1-x0,y)], fill=lerp(c_top, c_bottom, y/(y1-y0)) + (255,))
|
|
35
|
+
mask = Image.new('L', (x1-x0, y1-y0), 0)
|
|
36
|
+
md = ImageDraw.Draw(mask)
|
|
37
|
+
draw_fn(md)
|
|
38
|
+
return im, mask, (x0, y0)
|
|
39
|
+
|
|
40
|
+
# ============ App 图标 1024 ============
|
|
41
|
+
S = 1024
|
|
42
|
+
SS = 4 # 超采样抗锯齿
|
|
43
|
+
W = S * SS
|
|
44
|
+
img = Image.new('RGBA', (W, W), (0, 0, 0, 0))
|
|
45
|
+
d = ImageDraw.Draw(img)
|
|
46
|
+
|
|
47
|
+
# 圆角方底(macOS 风格 22% 半径)+ 微渐变
|
|
48
|
+
body = Image.new('RGBA', (W, W), (0,0,0,0))
|
|
49
|
+
bd = ImageDraw.Draw(body)
|
|
50
|
+
for y in range(W):
|
|
51
|
+
bd.line([(0,y),(W,y)], fill=lerp(C_BG2, C_BG, y/W) + (255,))
|
|
52
|
+
mask = Image.new('L', (W, W), 0)
|
|
53
|
+
ImageDraw.Draw(mask).rounded_rectangle([0,0,W-1,W-1], radius=int(W*0.225), fill=255)
|
|
54
|
+
img.paste(body, (0,0), mask)
|
|
55
|
+
d = ImageDraw.Draw(img)
|
|
56
|
+
|
|
57
|
+
cx = cy = W/2
|
|
58
|
+
|
|
59
|
+
# 雷达同心圆环 + 十字线(品牌橙,低透明)
|
|
60
|
+
ring = Image.new('RGBA', (W, W), (0,0,0,0))
|
|
61
|
+
rd = ImageDraw.Draw(ring)
|
|
62
|
+
for r, alpha in [(0.36, 200), (0.26, 120), (0.16, 80)]:
|
|
63
|
+
rr = W * r
|
|
64
|
+
rd.ellipse([cx-rr, cy-rr, cx+rr, cy+rr], outline=C_ORANGE + (alpha,), width=int(W*0.004))
|
|
65
|
+
rd.line([(cx - W*0.36, cy), (cx + W*0.36, cy)], fill=C_ORANGE + (60,), width=int(W*0.002))
|
|
66
|
+
rd.line([(cx, cy - W*0.36), (cx, cy + W*0.36)], fill=C_ORANGE + (60,), width=int(W*0.002))
|
|
67
|
+
img = Image.alpha_composite(img, ring)
|
|
68
|
+
|
|
69
|
+
# 雷达扫掠扇形(橙→粉渐变,向尾缘渐隐)
|
|
70
|
+
sweep = Image.new('RGBA', (W, W), (0,0,0,0))
|
|
71
|
+
sd = ImageDraw.Draw(sweep)
|
|
72
|
+
R = W * 0.36
|
|
73
|
+
A0, A1 = -75, -20 # 扫掠角(12 点方向附近)
|
|
74
|
+
steps = 60
|
|
75
|
+
for i in range(steps):
|
|
76
|
+
a = A0 + (A1-A0) * i/steps
|
|
77
|
+
t = i/steps
|
|
78
|
+
col = lerp(C_ORANGE, C_PINK, t)
|
|
79
|
+
alpha = int(10 + 120*t) # 尾缘亮
|
|
80
|
+
sd.pieslice([cx-R, cy-R, cx+R, cy+R], start=a, end=a + (A1-A0)/steps + 0.5, fill=col + (alpha,))
|
|
81
|
+
sweep = sweep.filter(ImageFilter.GaussianBlur(W*0.004))
|
|
82
|
+
img = Image.alpha_composite(img, sweep)
|
|
83
|
+
|
|
84
|
+
# 雷达点(小圆点装饰)
|
|
85
|
+
d = ImageDraw.Draw(img)
|
|
86
|
+
for ang, rr, s, col in [(145, 0.24, 0.012, C_ORANGE), (30, 0.30, 0.010, C_PINK), (255, 0.20, 0.011, C_VIOLET)]:
|
|
87
|
+
px = cx + math.cos(math.radians(ang)) * W * rr
|
|
88
|
+
py = cy + math.sin(math.radians(ang)) * W * rr
|
|
89
|
+
r = W * s
|
|
90
|
+
d.ellipse([px-r, py-r, px+r, py+r], fill=col + (230,))
|
|
91
|
+
|
|
92
|
+
# 中心闪电:外发光 + 渐变主体
|
|
93
|
+
bolt_w, bolt_h = W*0.30, W*0.42
|
|
94
|
+
bx0, by0 = int(cx-bolt_w*0.8), int(cy-bolt_h*0.7)
|
|
95
|
+
bx1, by1 = int(cx+bolt_w*0.8), int(cy+bolt_h*0.7)
|
|
96
|
+
bcx, bcy = (bx0+bx1)/2, (by0+by1)/2
|
|
97
|
+
poly = bolt_poly(bcx, bcy, bolt_w, bolt_h)
|
|
98
|
+
|
|
99
|
+
glow = Image.new('RGBA', (W, W), (0,0,0,0))
|
|
100
|
+
ImageDraw.Draw(glow).polygon(poly, fill=C_ORANGE + (160,))
|
|
101
|
+
glow = glow.filter(ImageFilter.GaussianBlur(W*0.02))
|
|
102
|
+
img = Image.alpha_composite(img, glow)
|
|
103
|
+
|
|
104
|
+
grad_im, grad_mask, pos = vgrad(lambda md: md.polygon([(x-bx0, y-by0) for x, y in poly], fill=255),
|
|
105
|
+
(bx0, by0, bx1, by1), (255, 214, 170), C_PINK)
|
|
106
|
+
img.paste(grad_im, pos, grad_mask)
|
|
107
|
+
|
|
108
|
+
img = img.resize((S, S), Image.LANCZOS)
|
|
109
|
+
img.save(os.path.join(OUT, 'icon.png'))
|
|
110
|
+
print('icon.png', img.size)
|
|
111
|
+
|
|
112
|
+
# ============ 状态栏模板图标(单色黑 + 透明,macOS template) ============
|
|
113
|
+
TS = 88 # 22pt @4x,足够清晰
|
|
114
|
+
TW = TS * SS
|
|
115
|
+
timg = Image.new('RGBA', (TW, TW), (0, 0, 0, 0))
|
|
116
|
+
td = ImageDraw.Draw(timg)
|
|
117
|
+
tpoly = bolt_poly(TW/2, TW/2, TW*0.56, TW*0.78)
|
|
118
|
+
td.polygon(tpoly, fill=(0, 0, 0, 255))
|
|
119
|
+
timg = timg.resize((TS, TS), Image.LANCZOS)
|
|
120
|
+
# 裁掉透明边距到内容 bbox + 留 6% 边距
|
|
121
|
+
bbox = timg.getbbox()
|
|
122
|
+
if bbox:
|
|
123
|
+
timg = timg.crop(bbox)
|
|
124
|
+
side = int(max(timg.width, timg.height) * 1.12)
|
|
125
|
+
canvas = Image.new('RGBA', (side, side), (0,0,0,0))
|
|
126
|
+
canvas.paste(timg, ((side-timg.width)//2, (side-timg.height)//2), timg)
|
|
127
|
+
timg = canvas.resize((44, 44), Image.LANCZOS)
|
|
128
|
+
timg.save(os.path.join(OUT, 'tray.png'))
|
|
129
|
+
print('tray.png', timg.size)
|
|
130
|
+
|
|
131
|
+
# ============ Windows 托盘图标(彩色——黑闪电在 Windows 深色任务栏上会隐形) ============
|
|
132
|
+
WS = 64
|
|
133
|
+
WW = WS * SS
|
|
134
|
+
wimg = Image.new('RGBA', (WW, WW), (0, 0, 0, 0))
|
|
135
|
+
# 外发光描边(深橙描边保证浅色任务栏也看得清)
|
|
136
|
+
wpoly = bolt_poly(WW/2, WW/2, WW*0.56, WW*0.78)
|
|
137
|
+
gloww = Image.new('RGBA', (WW, WW), (0,0,0,0))
|
|
138
|
+
ImageDraw.Draw(gloww).polygon(wpoly, fill=(200, 80, 30, 255))
|
|
139
|
+
gloww = gloww.filter(ImageFilter.GaussianBlur(WW*0.02))
|
|
140
|
+
wimg = Image.alpha_composite(wimg, gloww)
|
|
141
|
+
wg, wm, wpos = vgrad(lambda md: md.polygon([(x-0, y-0) for x, y in wpoly], fill=255),
|
|
142
|
+
(0, 0, WW, WW), (255, 160, 110), C_PINK)
|
|
143
|
+
wimg.paste(wg, wpos, wm)
|
|
144
|
+
wimg = wimg.resize((WS, WS), Image.LANCZOS)
|
|
145
|
+
bbox = wimg.getbbox()
|
|
146
|
+
if bbox:
|
|
147
|
+
wimg = wimg.crop(bbox)
|
|
148
|
+
side = int(max(wimg.width, wimg.height) * 1.08)
|
|
149
|
+
canvas = Image.new('RGBA', (side, side), (0,0,0,0))
|
|
150
|
+
canvas.paste(wimg, ((side-wimg.width)//2, (side-wimg.height)//2), wimg)
|
|
151
|
+
wimg = canvas.resize((32, 32), Image.LANCZOS)
|
|
152
|
+
wimg.save(os.path.join(OUT, 'tray-win.png'))
|
|
153
|
+
print('tray-win.png', wimg.size)
|