@anthonyhan/token-pilot 0.2.3 → 0.2.4
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/bin/token-pilot.js +10 -7
- package/dist/adapters/claude-code.js +251 -0
- package/dist/adapters/codex.js +163 -0
- package/dist/adapters/dsh.js +163 -0
- package/dist/adapters/kimi-code.js +165 -0
- package/dist/adapters/opencode.js +126 -0
- package/dist/adapters/pi.js +119 -0
- package/dist/adapters/qoder.js +51 -0
- package/dist/adapters/types.js +7 -0
- package/dist/adapters/volc-ark.js +92 -0
- package/dist/adapters/workbuddy.js +144 -0
- package/dist/cli/index.js +278 -0
- package/dist/cli/serve.js +200 -0
- package/dist/core/aggregate.js +821 -0
- package/dist/core/alert.js +32 -0
- package/dist/core/autocompact.js +40 -0
- package/dist/core/budget.js +23 -0
- package/dist/core/collector.js +213 -0
- package/dist/core/compression.js +129 -0
- package/dist/core/config.js +41 -0
- package/dist/core/contract.js +4 -0
- package/dist/core/metrics.js +53 -0
- package/dist/core/price-fetch.js +128 -0
- package/dist/core/pricing.js +156 -0
- package/dist/core/registry.js +144 -0
- package/dist/core/retry-detector.js +41 -0
- package/dist/core/rtk.js +58 -0
- package/dist/core/savings.js +43 -0
- package/dist/core/schema.js +3 -0
- package/dist/core/unknown-models.js +50 -0
- package/package.json +16 -6
- package/.github/FUNDING.yml +0 -3
- package/.github/workflows/build-desktop.yml +0 -68
- package/.idea/go.imports.xml +0 -10
- package/.idea/modules.xml +0 -8
- package/.idea/sonarlint/vulnerabilitystore/default/index.pb +0 -0
- package/.idea/thriftCompilerAssist.xml +0 -6
- package/.idea/token-pilot.iml +0 -9
- package/.idea/vcs.xml +0 -6
- package/README-en.md +0 -127
- 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 +0 -40
- package/menubar/package-lock.json +0 -248
- package/menubar/package.json +0 -16
- package/menubar/src/dashboard.html +0 -1266
- package/menubar/src/index.html +0 -674
- package/menubar/src-tauri/Cargo.lock +0 -4963
- package/menubar/src-tauri/Cargo.toml +0 -15
- package/menubar/src-tauri/build.rs +0 -3
- package/menubar/src-tauri/gen/schemas/acl-manifests.json +0 -1
- package/menubar/src-tauri/gen/schemas/capabilities.json +0 -1
- package/menubar/src-tauri/gen/schemas/desktop-schema.json +0 -2526
- package/menubar/src-tauri/gen/schemas/macOS-schema.json +0 -2526
- 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 +0 -5
- 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 +0 -4
- 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 +0 -486
- package/menubar/src-tauri/tauri.conf.json +0 -56
- package/scripts/gen-icons.py +0 -153
- package/scripts/reconcile.py +0 -162
- package/scripts/verify-dashboard.py +0 -101
- package/src/adapters/claude-code.ts +0 -246
- package/src/adapters/codex.ts +0 -166
- package/src/adapters/dsh.ts +0 -156
- package/src/adapters/kimi-code.ts +0 -164
- package/src/adapters/opencode.ts +0 -120
- package/src/adapters/pi.ts +0 -99
- package/src/adapters/qoder.ts +0 -43
- package/src/adapters/types.ts +0 -39
- package/src/adapters/volc-ark.ts +0 -102
- package/src/adapters/workbuddy.ts +0 -135
- package/src/cli/index.ts +0 -294
- package/src/cli/serve.ts +0 -209
- package/src/core/aggregate.ts +0 -821
- package/src/core/alert.ts +0 -33
- package/src/core/autocompact.ts +0 -46
- package/src/core/budget.ts +0 -42
- package/src/core/collector.ts +0 -209
- package/src/core/compression.ts +0 -163
- package/src/core/config.ts +0 -71
- package/src/core/contract.ts +0 -181
- package/src/core/metrics.ts +0 -72
- package/src/core/price-fetch.ts +0 -112
- package/src/core/pricing.ts +0 -182
- package/src/core/registry.ts +0 -141
- package/src/core/retry-detector.ts +0 -64
- package/src/core/rtk.ts +0 -58
- package/src/core/savings.ts +0 -55
- package/src/core/schema.ts +0 -66
- package/src/core/unknown-models.ts +0 -64
- package/tests/adapters-dsh.test.ts +0 -35
- package/tests/adapters-opencode.test.ts +0 -39
- package/tests/adapters-pi.test.ts +0 -33
- package/tests/adapters-workbuddy.test.ts +0 -34
- package/tests/adapters.test.ts +0 -45
- package/tests/aggregate.test.ts +0 -153
- package/tests/compression.test.ts +0 -71
- package/tests/fixtures/claude-session.jsonl +0 -9
- package/tests/fixtures/codex-rollout.jsonl +0 -5
- package/tests/fixtures/kimi-wire.jsonl +0 -6
- package/tests/pricing-timebased.test.ts +0 -51
- package/tests/pricing.test.ts +0 -73
- package/tests/serve.test.ts +0 -29
- package/tsconfig.json +0 -19
- package/web/dashboard.html +0 -1266
- package/web/panel.html +0 -674
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// 定价表加载 + 成本核算
|
|
2
|
+
// 价格表内部统一 USD/1M tokens;CNY 目录价加载时按汇率折算。
|
|
3
|
+
// DeepSeek 分时定价:peak/offpeak 两档,按事件时间戳(北京时间)选档。
|
|
4
|
+
import { readFileSync } from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
let cached = null;
|
|
9
|
+
export function loadPricing() {
|
|
10
|
+
if (cached)
|
|
11
|
+
return cached;
|
|
12
|
+
const p = path.resolve(__dirname, '../../pricing/models.json');
|
|
13
|
+
cached = JSON.parse(readFileSync(p, 'utf8'));
|
|
14
|
+
return cached;
|
|
15
|
+
}
|
|
16
|
+
// CNY 目录价 → USD(按给定汇率),_alias 展开(解析到目标后再归一)
|
|
17
|
+
export function loadPricingNormalized(usdToCny = 7.2) {
|
|
18
|
+
const base = loadPricing();
|
|
19
|
+
const cvt = (t) => t ? {
|
|
20
|
+
input: (t.input ?? 0) / usdToCny,
|
|
21
|
+
output: (t.output ?? 0) / usdToCny,
|
|
22
|
+
...(t.cacheRead != null ? { cacheRead: t.cacheRead / usdToCny } : {}),
|
|
23
|
+
...(t.cacheCreation != null ? { cacheCreation: t.cacheCreation / usdToCny } : {}),
|
|
24
|
+
} : undefined;
|
|
25
|
+
const norm = (p) => {
|
|
26
|
+
if (p.currency !== 'CNY')
|
|
27
|
+
return p;
|
|
28
|
+
const flat = cvt(p) ?? {};
|
|
29
|
+
const out = { ...p, ...flat, peak: cvt(p.peak), offpeak: cvt(p.offpeak) };
|
|
30
|
+
// 分时条目顶层不留平铺价(防 NaN 泄漏),由 priceFor 从 offpeak 平铺
|
|
31
|
+
if (out.peak || out.offpeak) {
|
|
32
|
+
delete out.input;
|
|
33
|
+
delete out.output;
|
|
34
|
+
delete out.cacheRead;
|
|
35
|
+
delete out.cacheCreation;
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
};
|
|
39
|
+
const out = {};
|
|
40
|
+
for (const [name, p] of Object.entries(base.models)) {
|
|
41
|
+
if (p._alias) {
|
|
42
|
+
const target = base.models[p._alias];
|
|
43
|
+
if (target)
|
|
44
|
+
out[name] = norm({ ...target, _alias: undefined });
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
out[name] = norm(p);
|
|
48
|
+
}
|
|
49
|
+
return { models: out, fallback: base.fallback };
|
|
50
|
+
}
|
|
51
|
+
// 合并用户覆写价(CNY/1M → USD/1M),覆写优先于自动补价
|
|
52
|
+
export function loadPricingWithOverrides(overrides, usdToCny = 7.2) {
|
|
53
|
+
const base = loadPricingNormalized(usdToCny);
|
|
54
|
+
if (!overrides || Object.keys(overrides).length === 0)
|
|
55
|
+
return base;
|
|
56
|
+
const models = { ...base.models };
|
|
57
|
+
for (const [model, ov] of Object.entries(overrides)) {
|
|
58
|
+
const prev = models[model] ?? { provider: 'custom', input: 0, output: 0 };
|
|
59
|
+
models[model] = {
|
|
60
|
+
provider: prev.provider,
|
|
61
|
+
input: (ov.input ?? 0) / usdToCny,
|
|
62
|
+
output: (ov.output ?? 0) / usdToCny,
|
|
63
|
+
cacheRead: ov.cacheRead != null ? ov.cacheRead / usdToCny : undefined,
|
|
64
|
+
cacheCreation: prev.cacheCreation,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return { models, fallback: base.fallback };
|
|
68
|
+
}
|
|
69
|
+
// ---------- DeepSeek 分时 ----------
|
|
70
|
+
// 中国法定节假日 2026(国务院公布口径;近似即可,量级影响小)
|
|
71
|
+
const CN_HOLIDAYS_2026 = new Set([
|
|
72
|
+
'01-01', '01-02', '01-03', // 元旦
|
|
73
|
+
'02-16', '02-17', '02-18', '02-19', '02-20', '02-21', '02-22', // 春节
|
|
74
|
+
'04-04', '04-05', '04-06', // 清明
|
|
75
|
+
'05-01', '05-02', '05-03', '05-04', '05-05', // 劳动节
|
|
76
|
+
'06-19', '06-20', '06-21', // 端午
|
|
77
|
+
'09-25', '09-26', '09-27', // 中秋
|
|
78
|
+
'10-01', '10-02', '10-03', '10-04', '10-05', '10-06', '10-07', // 国庆
|
|
79
|
+
]);
|
|
80
|
+
export function isDeepSeekPeak(atMs) {
|
|
81
|
+
// 北京时间(UTC+8,无夏令时)
|
|
82
|
+
const d = new Date(atMs + 8 * 3600_000);
|
|
83
|
+
const dow = d.getUTCDay(); // 0=周日
|
|
84
|
+
if (dow === 0 || dow === 6)
|
|
85
|
+
return false;
|
|
86
|
+
const mmdd = `${String(d.getUTCMonth() + 1).padStart(2, '0')}-${String(d.getUTCDate()).padStart(2, '0')}`;
|
|
87
|
+
if (CN_HOLIDAYS_2026.has(mmdd))
|
|
88
|
+
return false;
|
|
89
|
+
const mins = d.getUTCHours() * 60 + d.getUTCMinutes();
|
|
90
|
+
return (mins >= 9 * 60 && mins < 12 * 60) || (mins >= 14 * 60 && mins < 18 * 60);
|
|
91
|
+
}
|
|
92
|
+
// 精确匹配 → 别名 → 大小写归一 → 前缀匹配 → fallback
|
|
93
|
+
// 分时定价条目(peak/offpeak)无时间戳时以 offpeak 平铺(展示口径;计费请走 costOf 带时间戳)
|
|
94
|
+
export function priceFor(model, table = loadPricing()) {
|
|
95
|
+
const flatten = (e) => {
|
|
96
|
+
let r = e._alias && table.models[e._alias] ? table.models[e._alias] : e;
|
|
97
|
+
if ((r.peak || r.offpeak) && !(typeof r.input === 'number' && isFinite(r.input))) {
|
|
98
|
+
const t = r.offpeak ?? r.peak;
|
|
99
|
+
r = { ...r, input: t.input, output: t.output, cacheRead: t.cacheRead, cacheCreation: t.cacheCreation };
|
|
100
|
+
}
|
|
101
|
+
return r;
|
|
102
|
+
};
|
|
103
|
+
const direct = table.models[model];
|
|
104
|
+
if (direct)
|
|
105
|
+
return flatten(direct);
|
|
106
|
+
const lower = model.toLowerCase();
|
|
107
|
+
for (const k of Object.keys(table.models)) {
|
|
108
|
+
if (k.toLowerCase() === lower)
|
|
109
|
+
return flatten(table.models[k]);
|
|
110
|
+
}
|
|
111
|
+
const key = Object.keys(table.models).find((k) => lower.startsWith(k.toLowerCase()) || k.toLowerCase().startsWith(lower));
|
|
112
|
+
if (key)
|
|
113
|
+
return flatten(table.models[key]);
|
|
114
|
+
return table.fallback;
|
|
115
|
+
}
|
|
116
|
+
// 该模型是否有已知价(精确/别名/大小写/前缀命中);false = 会落到 fallback
|
|
117
|
+
export function hasKnownPrice(model, table = loadPricing()) {
|
|
118
|
+
if (table.models[model])
|
|
119
|
+
return true;
|
|
120
|
+
const lower = model.toLowerCase();
|
|
121
|
+
if (Object.keys(table.models).some((k) => k.toLowerCase() === lower))
|
|
122
|
+
return true;
|
|
123
|
+
return Object.keys(table.models).some((k) => lower.startsWith(k.toLowerCase()) || k.toLowerCase().startsWith(lower));
|
|
124
|
+
}
|
|
125
|
+
// atMs:事件时间戳——分时定价模型(DeepSeek)按它选 peak/offpeak 档
|
|
126
|
+
// 本地模型(.gguf 文件路径)零费用——只记用量不计价
|
|
127
|
+
export function costOf(model, usage, table, atMs) {
|
|
128
|
+
if (model.endsWith('.gguf') || model.startsWith('/')) {
|
|
129
|
+
return { inputUsd: 0, outputUsd: 0, cacheReadUsd: 0, cacheCreationUsd: 0, totalUsd: 0 };
|
|
130
|
+
}
|
|
131
|
+
let p = priceFor(model, table);
|
|
132
|
+
if (atMs && (p.peak || p.offpeak)) {
|
|
133
|
+
const tier = isDeepSeekPeak(atMs) ? p.peak : p.offpeak;
|
|
134
|
+
if (tier)
|
|
135
|
+
p = { ...p, ...tier };
|
|
136
|
+
}
|
|
137
|
+
const M = 1_000_000;
|
|
138
|
+
const inputUsd = (usage.inputTokens / M) * p.input;
|
|
139
|
+
const outputUsd = (usage.outputTokens / M) * p.output;
|
|
140
|
+
const cacheReadUsd = (usage.cacheReadTokens / M) * (p.cacheRead ?? p.input * 0.1);
|
|
141
|
+
const cacheCreationUsd = (usage.cacheCreationTokens / M) * (p.cacheCreation ?? p.input * 1.25);
|
|
142
|
+
return {
|
|
143
|
+
inputUsd,
|
|
144
|
+
outputUsd,
|
|
145
|
+
cacheReadUsd,
|
|
146
|
+
cacheCreationUsd,
|
|
147
|
+
totalUsd: inputUsd + outputUsd + cacheReadUsd + cacheCreationUsd,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
// 缓存相对全价输入省下的钱(用于「缓存帮你省了 ¥x」)
|
|
151
|
+
export function cacheSavingsUsd(model, cacheReadTokens, table) {
|
|
152
|
+
const p = priceFor(model, table);
|
|
153
|
+
const full = p.input;
|
|
154
|
+
const hit = p.cacheRead ?? p.input * 0.1;
|
|
155
|
+
return (cacheReadTokens / 1_000_000) * Math.max(full - hit, 0);
|
|
156
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// 数据源注册表 — 25 个源、6 档,驱动「适配器状态」模块与宿主用量榜的分档标签
|
|
2
|
+
// 状态语义:on=有数据接入 · part=部分支持/验证中 · off=未配置 · sub=仅检测/订阅登记
|
|
3
|
+
import { promises as fs } from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
const HOME = os.homedir();
|
|
7
|
+
async function exists(p) {
|
|
8
|
+
try {
|
|
9
|
+
await fs.access(p);
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function countMatching(dir, match, depth = 6) {
|
|
17
|
+
let n = 0;
|
|
18
|
+
async function walk(d, lv) {
|
|
19
|
+
if (lv > depth)
|
|
20
|
+
return;
|
|
21
|
+
let entries;
|
|
22
|
+
try {
|
|
23
|
+
entries = await fs.readdir(d, { withFileTypes: true });
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
for (const e of entries) {
|
|
29
|
+
if (match(e.name, e.isDirectory()))
|
|
30
|
+
n++;
|
|
31
|
+
if (e.isDirectory())
|
|
32
|
+
await walk(path.join(d, e.name), lv + 1);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
await walk(dir, 0);
|
|
36
|
+
return n;
|
|
37
|
+
}
|
|
38
|
+
// 宿主用量榜的分档标签
|
|
39
|
+
export const HOST_TIERS = {
|
|
40
|
+
'claude-code': { label: '一档', cls: 'tier-1' },
|
|
41
|
+
'kimi-code': { label: '一档', cls: 'tier-1' },
|
|
42
|
+
'codex': { label: '一档', cls: 'tier-1' },
|
|
43
|
+
'pi': { label: '一档', cls: 'tier-1' },
|
|
44
|
+
'dsh': { label: '一档', cls: 'tier-1' },
|
|
45
|
+
'workbuddy': { label: '一档', cls: 'tier-1' },
|
|
46
|
+
'workbuddy-ai': { label: '一档', cls: 'tier-1' },
|
|
47
|
+
'volc-ark': { label: '四档', cls: 'tier-2' },
|
|
48
|
+
'opencode': { label: '二档', cls: 'tier-2' },
|
|
49
|
+
'qoder': { label: '无 token', cls: 'tier-0' },
|
|
50
|
+
};
|
|
51
|
+
export async function buildAdapterTiers(cfg) {
|
|
52
|
+
// ---- 一档:本地日志直读 ----
|
|
53
|
+
const claudeDir = path.join(HOME, '.claude', 'projects');
|
|
54
|
+
const dshDir = path.join(HOME, '.dsh', 'sessions');
|
|
55
|
+
const kimiDir = path.join(HOME, '.kimi-code', 'sessions');
|
|
56
|
+
const codexDir = path.join(HOME, '.codex', 'sessions');
|
|
57
|
+
const piDir = path.join(HOME, '.pi');
|
|
58
|
+
const [hasClaude, hasKimi, hasCodex, hasPi, hasDsh] = await Promise.all([
|
|
59
|
+
exists(claudeDir), exists(kimiDir), exists(codexDir), exists(piDir), exists(dshDir),
|
|
60
|
+
]);
|
|
61
|
+
const tier1 = [];
|
|
62
|
+
if (hasClaude) {
|
|
63
|
+
const n = await countMatching(claudeDir, (name, isDir) => !isDir && name.endsWith('.jsonl'));
|
|
64
|
+
tier1.push({ name: 'Claude Code', status: 'on', hint: `${n.toLocaleString()} 个日志` });
|
|
65
|
+
}
|
|
66
|
+
if (hasKimi) {
|
|
67
|
+
const n = await countMatching(kimiDir, (name, isDir) => isDir && name.startsWith('session_'), 2);
|
|
68
|
+
tier1.push({ name: 'Kimi Code', status: 'on', hint: `${n} 个会话` });
|
|
69
|
+
}
|
|
70
|
+
if (hasCodex) {
|
|
71
|
+
const n = await countMatching(codexDir, (name, isDir) => !isDir && name.endsWith('.jsonl'));
|
|
72
|
+
tier1.push({ name: 'Codex', status: 'on', hint: `${n} 个 rollout` });
|
|
73
|
+
}
|
|
74
|
+
// WorkBuddy 双变体(traces 目录存在即接)
|
|
75
|
+
for (const [dir, name] of [[path.join(HOME, '.workbuddy', 'traces'), 'WorkBuddy'], [path.join(HOME, '.workbuddy-ai', 'traces'), 'WorkBuddy AI']]) {
|
|
76
|
+
if (await exists(dir)) {
|
|
77
|
+
const n = await countMatching(dir, (nm, isDir) => !isDir && nm.endsWith('.jsonl'));
|
|
78
|
+
tier1.push({ name, status: 'on', hint: `${n} 个 trace` });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (hasDsh) {
|
|
82
|
+
const n = await countMatching(dshDir, (name, isDir) => !isDir && name === 'session.v4.jsonl.zstd');
|
|
83
|
+
tier1.push({ name: 'DeepSeek Harness', status: 'on', hint: `${n} 个会话(zstd)` });
|
|
84
|
+
}
|
|
85
|
+
if (hasPi) {
|
|
86
|
+
const n = await countMatching(piDir, (name, isDir) => !isDir && name.endsWith('.jsonl'));
|
|
87
|
+
tier1.push({ name: 'pi', status: 'on', hint: `${n} 个会话` });
|
|
88
|
+
}
|
|
89
|
+
// ---- 二档:SQLite 直读 ----
|
|
90
|
+
const opencodeDb = path.join(HOME, '.local', 'share', 'opencode', 'opencode.db');
|
|
91
|
+
const cursorDir = path.join(HOME, '.cursor');
|
|
92
|
+
const tier2 = [];
|
|
93
|
+
if (await exists(opencodeDb))
|
|
94
|
+
tier2.push({ name: 'OpenCode', status: 'on', hint: 'opencode.db 直读' });
|
|
95
|
+
if (await exists(cursorDir))
|
|
96
|
+
tier2.push({ name: 'Cursor', status: 'sub', hint: '无 token 用量数据' });
|
|
97
|
+
// ---- 特殊:仅会话数 ----
|
|
98
|
+
const qoderDir = path.join(HOME, '.qoder');
|
|
99
|
+
const special = [];
|
|
100
|
+
if (await exists(qoderDir)) {
|
|
101
|
+
const n = await countMatching(qoderDir, (name, isDir) => isDir && /sess/i.test(name), 5);
|
|
102
|
+
special.push({ name: 'Qoder', status: 'sub', hint: `${n} 个会话 · 无 token/模型` });
|
|
103
|
+
}
|
|
104
|
+
// ---- 四档:云端用量 API ----
|
|
105
|
+
const hasDoubao = (cfg.cloudApis ?? []).some((a) => /doubao|豆包|火山/i.test(a.name)) || await exists(path.join(HOME, '.arkcli'));
|
|
106
|
+
const tier4 = [
|
|
107
|
+
{ name: 'Doubao · 火山', status: hasDoubao ? 'on' : 'off', hint: hasDoubao ? 'arkcli 日粒度' : '未配置' },
|
|
108
|
+
{ name: 'OpenAI API', status: 'off', hint: '未配置' },
|
|
109
|
+
{ name: 'Kimi 开放平台', status: 'off', hint: '未配置' },
|
|
110
|
+
];
|
|
111
|
+
// ---- 五档:仅检测(不写本地用量日志) ----
|
|
112
|
+
const detectOnly = [
|
|
113
|
+
['Antigravity', '.antigravity'], ['Augment', '.augment'], ['CodeBuddy', '.codebuddy'],
|
|
114
|
+
['Copilot', '.copilot'], ['Kilo', '.kilo'], ['Qwen Code', '.qwen'],
|
|
115
|
+
['Trae', '.trae'], ['Windsurf', '.windsurf'], ['ZCode', '.zcode'],
|
|
116
|
+
['Hermes', '.hermes'], ['Cline', '.cline'], ['Kimi (agents)', '.kimi'],
|
|
117
|
+
['Zed', '.config/zed'], ['Ollama', '.ollama'],
|
|
118
|
+
];
|
|
119
|
+
const tier5 = [];
|
|
120
|
+
for (const [name, dir] of detectOnly) {
|
|
121
|
+
if (await exists(path.join(HOME, dir)))
|
|
122
|
+
tier5.push({ name, status: 'sub' });
|
|
123
|
+
}
|
|
124
|
+
// ---- 六档:订阅登记 ----
|
|
125
|
+
const subs = cfg.subscriptions ?? [];
|
|
126
|
+
const tier6 = subs.length > 0
|
|
127
|
+
? subs.map((s) => ({ name: s.name, status: 'sub', hint: `订阅 ¥${s.monthlyCny}/月` }))
|
|
128
|
+
: [
|
|
129
|
+
{ name: 'Kimi.app', status: 'sub', hint: '未登记' },
|
|
130
|
+
{ name: 'ChatGPT.app', status: 'sub', hint: '未登记' },
|
|
131
|
+
];
|
|
132
|
+
const tiers = [];
|
|
133
|
+
if (tier1.length)
|
|
134
|
+
tiers.push({ key: 'local', label: '一档 · 本地日志直读', count: `${tier1.length} · 全量 token + 模型`, chips: tier1 });
|
|
135
|
+
if (tier2.length)
|
|
136
|
+
tiers.push({ key: 'local', label: '二档 · SQLite 直读', count: `${tier2.length}`, chips: tier2 });
|
|
137
|
+
if (special.length)
|
|
138
|
+
tiers.push({ key: 'detect', label: '特殊 · 仅会话数', count: `${special.length} · 无 token / 模型`, chips: special });
|
|
139
|
+
tiers.push({ key: 'cloud', label: '四档 · 云端用量 API', count: `${tier4.length}`, chips: tier4 });
|
|
140
|
+
if (tier5.length)
|
|
141
|
+
tiers.push({ key: 'detect', label: '五档 · 仅检测', count: `${tier5.length} · 不写本地用量日志`, chips: tier5 });
|
|
142
|
+
tiers.push({ key: 'sub', label: '六档 · 订阅登记', count: `${tier6.length} · 桌面端为瘦客户端`, chips: tier6 });
|
|
143
|
+
return tiers;
|
|
144
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// 异常重试/打转检测 — 识别"同一 session 反复重试、token 在烧但没产出"
|
|
2
|
+
// 检测"打转"会话:单个 session 调用次数异常多,往往意味着 Agent 在死循环/重试
|
|
3
|
+
export function detectRetryLoops(events, costOfFn, opts = {}) {
|
|
4
|
+
const minCalls = opts.minCallsPerSession ?? 50;
|
|
5
|
+
const minCost = opts.minCostUsd ?? 1.0;
|
|
6
|
+
// 按 session 聚合
|
|
7
|
+
const bySession = new Map();
|
|
8
|
+
for (const e of events) {
|
|
9
|
+
const arr = bySession.get(e.sessionId) ?? [];
|
|
10
|
+
arr.push(e);
|
|
11
|
+
bySession.set(e.sessionId, arr);
|
|
12
|
+
}
|
|
13
|
+
const alerts = [];
|
|
14
|
+
for (const [sessionId, evs] of bySession) {
|
|
15
|
+
if (evs.length < minCalls)
|
|
16
|
+
continue;
|
|
17
|
+
let tokens = 0;
|
|
18
|
+
let cost = 0;
|
|
19
|
+
const models = new Set();
|
|
20
|
+
let agent = '';
|
|
21
|
+
for (const e of evs) {
|
|
22
|
+
tokens += e.usage.totalTokens;
|
|
23
|
+
cost += costOfFn(e.model, e.usage).totalUsd;
|
|
24
|
+
models.add(e.model);
|
|
25
|
+
agent = e.agent;
|
|
26
|
+
}
|
|
27
|
+
if (cost < minCost)
|
|
28
|
+
continue;
|
|
29
|
+
alerts.push({
|
|
30
|
+
sessionId,
|
|
31
|
+
agent,
|
|
32
|
+
model: [...models].join(','),
|
|
33
|
+
calls: evs.length,
|
|
34
|
+
totalTokens: tokens,
|
|
35
|
+
totalCostUsd: cost,
|
|
36
|
+
reason: `单会话 ${evs.length} 次调用,烧 $${cost.toFixed(2)},疑似打转/死循环`,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
// 按花费降序
|
|
40
|
+
return alerts.sort((a, b) => b.totalCostUsd - a.totalCostUsd);
|
|
41
|
+
}
|
package/dist/core/rtk.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// RTK(Rust Token Killer)接入层 — 用户显式勾选才安装;rtk-oss 纯 Apache 版
|
|
2
|
+
// 原则:少采集/不拦截——rtk 是独立的输出压缩工具,token-pilot 只负责装/检测/卸载,不嵌进请求链。
|
|
3
|
+
import { execFile } from 'node:child_process';
|
|
4
|
+
import { promisify } from 'node:util';
|
|
5
|
+
const execFileP = promisify(execFile);
|
|
6
|
+
export async function rtkInstalled() {
|
|
7
|
+
try {
|
|
8
|
+
const r = await execFileP('rtk', ['--version'], { timeout: 5000 });
|
|
9
|
+
return (r.stdout + r.stderr).length > 0;
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
// 安装 rtk-oss(纯 Apache 版):macOS/Linux 走 brew,Windows 走 winget
|
|
16
|
+
export async function installRtk() {
|
|
17
|
+
const platform = process.platform;
|
|
18
|
+
try {
|
|
19
|
+
if (platform === 'win32') {
|
|
20
|
+
await execFileP('winget', ['install', '--id', 'rtk-ai.rtk-oss', '-e', '--accept-source-agreements', '--accept-package-agreements'], { timeout: 300_000 });
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
// 优先 rtk-oss tap;没有 tap 就 brew 主仓库的 rtk
|
|
24
|
+
try {
|
|
25
|
+
await execFileP('brew', ['install', 'rtk-ai/tap/rtk-oss'], { timeout: 300_000 });
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
await execFileP('brew', ['install', 'rtk'], { timeout: 300_000 });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const ok = await rtkInstalled();
|
|
32
|
+
return ok
|
|
33
|
+
? { ok: true, message: 'RTK 已安装(rtk --version 验证通过)' }
|
|
34
|
+
: { ok: false, message: '安装命令执行了但 rtk --version 未通过,请手动检查' };
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
return { ok: false, message: `安装失败:${String(e).slice(0, 200)}` };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export async function uninstallRtk() {
|
|
41
|
+
try {
|
|
42
|
+
if (process.platform === 'win32') {
|
|
43
|
+
await execFileP('winget', ['uninstall', '--id', 'rtk-ai.rtk-oss', '-e'], { timeout: 180_000 });
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
try {
|
|
47
|
+
await execFileP('brew', ['uninstall', 'rtk-oss'], { timeout: 180_000 });
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
await execFileP('brew', ['uninstall', 'rtk'], { timeout: 180_000 });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return { ok: true, message: '已卸载 RTK' };
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
return { ok: false, message: `卸载失败:${String(e).slice(0, 200)}` };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// 省钱建议 — 事后分析(不拦截、不代理),符合"少采集/本地化"原则
|
|
2
|
+
// 逻辑:检测到贵模型在做轻量任务 → 建议换便宜模型,估算能省多少
|
|
3
|
+
import { priceFor } from './pricing.js';
|
|
4
|
+
// 找"贵模型干轻活"的浪费:贵模型的高频低输出调用
|
|
5
|
+
export function savingsAdvice(events) {
|
|
6
|
+
const advice = [];
|
|
7
|
+
// 按模型聚合
|
|
8
|
+
const byModel = new Map();
|
|
9
|
+
for (const e of events) {
|
|
10
|
+
const m = byModel.get(e.model) ?? { events: 0, outputTokens: 0, cost: 0 };
|
|
11
|
+
m.events++;
|
|
12
|
+
m.outputTokens += e.usage.outputTokens;
|
|
13
|
+
m.cost += 0; // cost 由调用方算,这里先记事件数
|
|
14
|
+
byModel.set(e.model, m);
|
|
15
|
+
}
|
|
16
|
+
// 找最贵的模型
|
|
17
|
+
const models = [...byModel.keys()];
|
|
18
|
+
const expensive = models
|
|
19
|
+
.map((m) => ({ m, p: priceFor(m) }))
|
|
20
|
+
.filter((x) => x.p.output >= 15)
|
|
21
|
+
.sort((a, b) => b.p.output - a.p.output);
|
|
22
|
+
for (const { m, p } of expensive) {
|
|
23
|
+
const agg = byModel.get(m);
|
|
24
|
+
// 平均每次调用 output 很少(<500 token)说明是轻量任务
|
|
25
|
+
const avgOut = agg.events > 0 ? agg.outputTokens / agg.events : 0;
|
|
26
|
+
if (avgOut < 500 && agg.events > 100) {
|
|
27
|
+
// 找一个便宜替代
|
|
28
|
+
const cheaper = models
|
|
29
|
+
.map((mm) => ({ mm, p: priceFor(mm) }))
|
|
30
|
+
.filter((x) => x.p.output < p.output * 0.4)
|
|
31
|
+
.sort((a, b) => a.p.output - b.p.output)[0];
|
|
32
|
+
if (cheaper) {
|
|
33
|
+
const cheapCost = agg.events * ((agg.outputTokens / agg.events / 1_000_000) * cheaper.p.output);
|
|
34
|
+
advice.push({
|
|
35
|
+
observation: `${m} 有 ${agg.events} 次调用,平均每次只输出 ${avgOut.toFixed(0)} token(轻量任务)`,
|
|
36
|
+
suggestion: `这类轻量任务可换 ${cheaper.mm},输出单价 $${p.output} → $${cheaper.p.output}/1M`,
|
|
37
|
+
estimatedSavingsUsdPerMonth: Math.max(0, (agg.events * avgOut / 1_000_000) * (p.output - cheaper.p.output)),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return advice;
|
|
43
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// 未知模型追踪 + 状态
|
|
2
|
+
// 采集到的模型在定价表与覆写里都找不到时,记进 ~/.token-pilot/unknown-models.json,
|
|
3
|
+
// 由 price-fetch 每天自动上网查价补全,人工随时可在设置弹窗核对修改。
|
|
4
|
+
import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { CONFIG_DIR } from './config.js';
|
|
7
|
+
const UNKNOWN_PATH = path.join(CONFIG_DIR, 'unknown-models.json');
|
|
8
|
+
export function loadUnknown() {
|
|
9
|
+
if (!existsSync(UNKNOWN_PATH))
|
|
10
|
+
return {};
|
|
11
|
+
try {
|
|
12
|
+
return JSON.parse(readFileSync(UNKNOWN_PATH, 'utf8'));
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export function saveUnknown(s) {
|
|
19
|
+
mkdirSync(CONFIG_DIR, { recursive: true });
|
|
20
|
+
writeFileSync(UNKNOWN_PATH, JSON.stringify(s, null, 2) + '\n', 'utf8');
|
|
21
|
+
}
|
|
22
|
+
export function trackUnknown(model, agent, now = Date.now()) {
|
|
23
|
+
const s = loadUnknown();
|
|
24
|
+
const u = s[model] ?? { model, firstSeen: now, lastSeen: now, calls: 0, agents: [] };
|
|
25
|
+
u.lastSeen = now;
|
|
26
|
+
u.calls++;
|
|
27
|
+
if (!u.agents.includes(agent))
|
|
28
|
+
u.agents.push(agent);
|
|
29
|
+
s[model] = u;
|
|
30
|
+
saveUnknown(s);
|
|
31
|
+
}
|
|
32
|
+
export function markPriced(model, price, source) {
|
|
33
|
+
const s = loadUnknown();
|
|
34
|
+
const u = s[model];
|
|
35
|
+
if (!u)
|
|
36
|
+
return;
|
|
37
|
+
u.autoPrice = price;
|
|
38
|
+
u.source = source;
|
|
39
|
+
u.fetchedAt = Date.now();
|
|
40
|
+
u.needsReview = true;
|
|
41
|
+
saveUnknown(s);
|
|
42
|
+
}
|
|
43
|
+
export function markFailed(model) {
|
|
44
|
+
const s = loadUnknown();
|
|
45
|
+
const u = s[model];
|
|
46
|
+
if (!u)
|
|
47
|
+
return;
|
|
48
|
+
u.failedAttempts = (u.failedAttempts ?? 0) + 1;
|
|
49
|
+
saveUnknown(s);
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anthonyhan/token-pilot",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.4",
|
|
4
|
+
"description": "\u4f60\u6240\u6709 AI \u5de5\u5177\u7684\u672c\u5730\u8d26\u5355 + \u9884\u7b97\u63a7\u5236\u5668 \u2014 \u53ea\u8bfb\u672c\u5730\u65e5\u5fd7\uff0c\u96f6\u5165\u4fb5\uff0c\u4e0d\u51fa\u672c\u673a",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"token-pilot": "./bin/token-pilot.js"
|
|
@@ -9,15 +9,25 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "tsc",
|
|
11
11
|
"dev": "tsc --watch",
|
|
12
|
-
"today": "
|
|
13
|
-
"test": "
|
|
12
|
+
"today": "npx tsx src/cli/index.ts today",
|
|
13
|
+
"test": "npx tsx --test tests/*.test.ts",
|
|
14
|
+
"prepublishOnly": "npm run build"
|
|
14
15
|
},
|
|
15
16
|
"engines": {
|
|
16
17
|
"node": ">=18"
|
|
17
18
|
},
|
|
18
19
|
"license": "MIT",
|
|
19
|
-
"dependencies": {},
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"access": "public"
|
|
22
|
-
}
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "^26.6.5",
|
|
25
|
+
"tsx": "^4.23.15",
|
|
26
|
+
"typescript": "^5.9.3"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"pricing",
|
|
31
|
+
"bin"
|
|
32
|
+
]
|
|
23
33
|
}
|
package/.github/FUNDING.yml
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# token-pilot 状态栏应用 — Windows / macOS 构建
|
|
2
|
-
# 触发:打 v* tag 或手动 dispatch。产出 .msi(Windows x64)与 .dmg(macOS arm64 + Intel)。
|
|
3
|
-
|
|
4
|
-
name: build-desktop
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
workflow_dispatch:
|
|
8
|
-
push:
|
|
9
|
-
tags: ["v*"]
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
build:
|
|
13
|
-
strategy:
|
|
14
|
-
matrix:
|
|
15
|
-
include:
|
|
16
|
-
- os: windows-latest
|
|
17
|
-
target: x86_64-pc-windows-msvc
|
|
18
|
-
- os: macos-latest
|
|
19
|
-
target: aarch64-apple-darwin
|
|
20
|
-
- os: macos-15-intel
|
|
21
|
-
target: x86_64-apple-darwin
|
|
22
|
-
runs-on: ${{ matrix.os }}
|
|
23
|
-
defaults:
|
|
24
|
-
run:
|
|
25
|
-
working-directory: menubar
|
|
26
|
-
steps:
|
|
27
|
-
- uses: actions/checkout@v4
|
|
28
|
-
|
|
29
|
-
- uses: actions/setup-node@v4
|
|
30
|
-
with:
|
|
31
|
-
node-version: 22
|
|
32
|
-
|
|
33
|
-
# Windows 交叉/本机构建 token-pilot CLI 依赖 node 全局安装由用户侧 npm link 提供;
|
|
34
|
-
# 桌面应用本身只依赖 Rust 工具链。
|
|
35
|
-
- uses: dtolnay/rust-toolchain@stable
|
|
36
|
-
with:
|
|
37
|
-
targets: ${{ matrix.target }}
|
|
38
|
-
|
|
39
|
-
- name: Cache cargo
|
|
40
|
-
uses: actions/cache@v4
|
|
41
|
-
with:
|
|
42
|
-
path: |
|
|
43
|
-
~/.cargo/registry
|
|
44
|
-
~/.cargo/git
|
|
45
|
-
menubar/src-tauri/target
|
|
46
|
-
key: ${{ matrix.os }}-${{ matrix.target }}-cargo-${{ hashFiles('menubar/src-tauri/Cargo.lock') }}
|
|
47
|
-
|
|
48
|
-
- name: Install tauri-cli
|
|
49
|
-
run: cargo install tauri-cli --version "^2" --locked
|
|
50
|
-
|
|
51
|
-
- name: Clean stale bundle artifacts(防缓存带旧版本包)
|
|
52
|
-
shell: bash
|
|
53
|
-
run: rm -rf src-tauri/target/*/release/bundle src-tauri/target/release/bundle
|
|
54
|
-
working-directory: menubar
|
|
55
|
-
|
|
56
|
-
- name: Build bundles
|
|
57
|
-
run: cargo tauri build --target ${{ matrix.target }}
|
|
58
|
-
working-directory: menubar
|
|
59
|
-
|
|
60
|
-
- name: Upload artifacts
|
|
61
|
-
uses: actions/upload-artifact@v4
|
|
62
|
-
with:
|
|
63
|
-
name: token-pilot-${{ matrix.target }}
|
|
64
|
-
path: |
|
|
65
|
-
menubar/src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi
|
|
66
|
-
menubar/src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg
|
|
67
|
-
menubar/src-tauri/target/${{ matrix.target }}/release/bundle/macos/*.app
|
|
68
|
-
if-no-files-found: ignore
|
package/.idea/go.imports.xml
DELETED
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/token-pilot.iml" filepath="$PROJECT_DIR$/.idea/token-pilot.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
|
File without changes
|
package/.idea/token-pilot.iml
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="Go" enabled="true" />
|
|
4
|
-
<component name="NewModuleRootManager">
|
|
5
|
-
<content url="file://$MODULE_DIR$" />
|
|
6
|
-
<orderEntry type="inheritedJdk" />
|
|
7
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
|
-
</component>
|
|
9
|
-
</module>
|