myccusage 1.7.2__tar.gz → 1.7.4__tar.gz
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.
- {myccusage-1.7.2 → myccusage-1.7.4}/PKG-INFO +1 -1
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage.egg-info/PKG-INFO +1 -1
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/__init__.py +1 -1
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/macos/build_app.sh +2 -2
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/macos/main.swift +8 -3
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/web/static/app.js +24 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/web/static/index.html +1 -1
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/web/static/style.css +1 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/pyproject.toml +1 -1
- {myccusage-1.7.2 → myccusage-1.7.4}/LICENSE +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/README.md +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage.egg-info/SOURCES.txt +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage.egg-info/dependency_links.txt +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage.egg-info/entry_points.txt +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage.egg-info/top_level.txt +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/__main__.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/adapters/__init__.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/adapters/agy.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/adapters/base.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/adapters/claude.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/adapters/codex.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/adapters/grok.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/adapters/hermes.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/adapters/opencode.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/adapters/pi.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/adapters/workbuddy.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/cli.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/core.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/macos/AppIcon.icns +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/macos/generate_icon.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/sync.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/web/__init__.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/myccusage_lib/web/server.py +0 -0
- {myccusage-1.7.2 → myccusage-1.7.4}/setup.cfg +0 -0
|
@@ -91,9 +91,9 @@ cat << 'EOF' > "${CONTENTS_DIR}/Info.plist"
|
|
|
91
91
|
<key>CFBundlePackageType</key>
|
|
92
92
|
<string>APPL</string>
|
|
93
93
|
<key>CFBundleShortVersionString</key>
|
|
94
|
-
<string>1.7.
|
|
94
|
+
<string>1.7.4</string>
|
|
95
95
|
<key>CFBundleVersion</key>
|
|
96
|
-
<string>1.7.
|
|
96
|
+
<string>1.7.4</string>
|
|
97
97
|
<key>LSMinimumSystemVersion</key>
|
|
98
98
|
<string>13.0</string>
|
|
99
99
|
<key>LSUIElement</key>
|
|
@@ -774,13 +774,19 @@ class FloatingPopoverWindow: NSPanel {
|
|
|
774
774
|
}
|
|
775
775
|
|
|
776
776
|
func showNearDock() {
|
|
777
|
-
|
|
777
|
+
let mouseLoc = NSEvent.mouseLocation
|
|
778
|
+
|
|
779
|
+
// 核心修复:双屏/多屏环境下,必须优先定位到用户鼠标当前所在(即点击 Dock 栏所在)的真实物理屏幕,
|
|
780
|
+
// 彻底杜绝因 NSScreen.main 指向活跃 Key Window 屏幕而导致的“卡片在另一屏幕展开”的 Bug。
|
|
781
|
+
guard let screen = NSScreen.screens.first(where: { NSMouseInRect(mouseLoc, $0.frame, false) })
|
|
782
|
+
?? NSScreen.main
|
|
783
|
+
?? NSScreen.screens.first else {
|
|
778
784
|
self.center()
|
|
779
785
|
self.makeKeyAndOrderFront(nil)
|
|
780
786
|
return
|
|
781
787
|
}
|
|
782
788
|
|
|
783
|
-
//
|
|
789
|
+
// 根据 SwiftUI 实际撑开的内容高度动态收紧窗口,杜绝窗口空高导致的贴紧 Dock
|
|
784
790
|
if let hv = self.contentView {
|
|
785
791
|
let fit = hv.fittingSize
|
|
786
792
|
if fit.width > 0 && fit.height > 0 {
|
|
@@ -791,7 +797,6 @@ class FloatingPopoverWindow: NSPanel {
|
|
|
791
797
|
let screenRect = screen.visibleFrame
|
|
792
798
|
let fullRect = screen.frame
|
|
793
799
|
let windowSize = self.frame.size
|
|
794
|
-
let mouseLoc = NSEvent.mouseLocation
|
|
795
800
|
|
|
796
801
|
var targetX: CGFloat
|
|
797
802
|
var targetY: CGFloat
|
|
@@ -3276,9 +3276,13 @@
|
|
|
3276
3276
|
}
|
|
3277
3277
|
|
|
3278
3278
|
const model = getActiveModel();
|
|
3279
|
+
const isWorkbuddy = (state.agent === 'workbuddy') || (state.data && state.data.agent === 'workbuddy') || (state.data && state.data.summary && state.data.summary.credit > 0);
|
|
3279
3280
|
let rowsHtml = '';
|
|
3280
3281
|
filtered.forEach((r, idx) => {
|
|
3281
3282
|
const rCost = calcCost(model, r.inputTokens, r.cacheTokens, r.outputTokens);
|
|
3283
|
+
const creditHtml = isWorkbuddy
|
|
3284
|
+
? `<td class="col-credit">${(r.creditRaw !== undefined ? r.creditRaw : (r.credit || 0)).toFixed(2)}</td>`
|
|
3285
|
+
: '';
|
|
3282
3286
|
rowsHtml += `
|
|
3283
3287
|
<tr>
|
|
3284
3288
|
<td class="col-rank">${idx + 1}</td>
|
|
@@ -3288,6 +3292,7 @@
|
|
|
3288
3292
|
<td class="col-output">${formatTokens(r.outputTokens)}</td>
|
|
3289
3293
|
<td class="col-cache">${formatTokens(r.cacheTokens)}</td>
|
|
3290
3294
|
<td class="col-hitrate">${calcHitRateStr(r.cacheTokens, r.inputTokens)}</td>
|
|
3295
|
+
${creditHtml}
|
|
3291
3296
|
<td class="col-cost">${formatLedgerCost(model, rCost)}</td>
|
|
3292
3297
|
<td class="col-title">
|
|
3293
3298
|
<div class="title-cell">
|
|
@@ -3299,6 +3304,8 @@
|
|
|
3299
3304
|
`;
|
|
3300
3305
|
});
|
|
3301
3306
|
|
|
3307
|
+
const creditHeader = isWorkbuddy ? `<th class="col-credit">消耗积分</th>` : '';
|
|
3308
|
+
|
|
3302
3309
|
el.ledgerContainer.innerHTML = `
|
|
3303
3310
|
<div class="session-table-wrap">
|
|
3304
3311
|
<table class="data-table">
|
|
@@ -3311,6 +3318,7 @@
|
|
|
3311
3318
|
<th class="col-output">Output</th>
|
|
3312
3319
|
<th class="col-cache">Cache</th>
|
|
3313
3320
|
<th class="col-hitrate">Hitrate</th>
|
|
3321
|
+
${creditHeader}
|
|
3314
3322
|
<th class="col-cost">等效费用 (CNY ¥)</th>
|
|
3315
3323
|
<th class="col-title">会话标题</th>
|
|
3316
3324
|
</tr>
|
|
@@ -3333,6 +3341,7 @@
|
|
|
3333
3341
|
let totalMatched = 0;
|
|
3334
3342
|
let weeksHtml = '';
|
|
3335
3343
|
const model = getActiveModel();
|
|
3344
|
+
const isWorkbuddy = (state.agent === 'workbuddy') || (state.data && state.data.agent === 'workbuddy') || (state.data && state.data.summary && state.data.summary.credit > 0);
|
|
3336
3345
|
const weeksToRender = state.timeSortOrder === 'desc' ? [...weeks].reverse() : [...weeks];
|
|
3337
3346
|
|
|
3338
3347
|
weeksToRender.forEach(w => {
|
|
@@ -3359,6 +3368,9 @@
|
|
|
3359
3368
|
let tableRows = '';
|
|
3360
3369
|
recordsToRender.forEach(r => {
|
|
3361
3370
|
const rCost = calcCost(model, r.inputTokens, r.cacheTokens, r.outputTokens);
|
|
3371
|
+
const creditHtml = isWorkbuddy
|
|
3372
|
+
? `<td class="col-credit">${(r.creditRaw !== undefined ? r.creditRaw : (r.credit || 0)).toFixed(2)}</td>`
|
|
3373
|
+
: '';
|
|
3362
3374
|
tableRows += `
|
|
3363
3375
|
<tr>
|
|
3364
3376
|
<td class="col-rank">${r.index}</td>
|
|
@@ -3368,6 +3380,7 @@
|
|
|
3368
3380
|
<td class="col-output">${formatTokens(r.outputTokens)}</td>
|
|
3369
3381
|
<td class="col-cache">${formatTokens(r.cacheTokens)}</td>
|
|
3370
3382
|
<td class="col-hitrate">${calcHitRateStr(r.cacheTokens, r.inputTokens)}</td>
|
|
3383
|
+
${creditHtml}
|
|
3371
3384
|
<td class="col-cost">${formatLedgerCost(model, rCost)}</td>
|
|
3372
3385
|
<td class="col-title">
|
|
3373
3386
|
<div class="title-cell">
|
|
@@ -3381,6 +3394,11 @@
|
|
|
3381
3394
|
|
|
3382
3395
|
const dayShort = d.date.length >= 10 ? d.date.slice(5) : d.date;
|
|
3383
3396
|
const dCost = calcCost(model, d.inputTokens, d.cacheTokens, d.outputTokens);
|
|
3397
|
+
const dayCreditStat = (isWorkbuddy && d.credit !== undefined)
|
|
3398
|
+
? `<span>积分: <strong style="color:var(--accent-pink,#f43f5e);">${d.credit.toFixed(2)}积</strong></span>`
|
|
3399
|
+
: '';
|
|
3400
|
+
const tableCreditHeader = isWorkbuddy ? `<th class="col-credit">消耗积分</th>` : '';
|
|
3401
|
+
|
|
3384
3402
|
daysHtml += `
|
|
3385
3403
|
<div class="day-block">
|
|
3386
3404
|
<div class="day-header" onclick="this.parentElement.classList.toggle('collapsed')">
|
|
@@ -3391,6 +3409,7 @@
|
|
|
3391
3409
|
</div>
|
|
3392
3410
|
<div class="day-stats">
|
|
3393
3411
|
<span>总: <strong style="color:var(--accent-blue);">${formatTokens(d.totalTokens)}</strong></span>
|
|
3412
|
+
${dayCreditStat}
|
|
3394
3413
|
<span>费用: <strong style="color:var(--accent-green);">${formatInlineCost(model, dCost)}</strong></span>
|
|
3395
3414
|
</div>
|
|
3396
3415
|
</div>
|
|
@@ -3405,6 +3424,7 @@
|
|
|
3405
3424
|
<th class="col-output">Output</th>
|
|
3406
3425
|
<th class="col-cache">Cache</th>
|
|
3407
3426
|
<th class="col-hitrate">Hitrate</th>
|
|
3427
|
+
${tableCreditHeader}
|
|
3408
3428
|
<th class="col-cost">等效费用 (CNY ¥)</th>
|
|
3409
3429
|
<th class="col-title">会话标题</th>
|
|
3410
3430
|
</tr>
|
|
@@ -3418,6 +3438,9 @@
|
|
|
3418
3438
|
|
|
3419
3439
|
if (weekHasMatch) {
|
|
3420
3440
|
const wCost = calcCost(model, w.inputTokens, w.cacheTokens, w.outputTokens);
|
|
3441
|
+
const weekCreditStat = (isWorkbuddy && w.credit !== undefined)
|
|
3442
|
+
? `<span>积分: <strong style="color:var(--accent-pink,#f43f5e);">${w.credit.toFixed(2)}积</strong></span>`
|
|
3443
|
+
: '';
|
|
3421
3444
|
weeksHtml += `
|
|
3422
3445
|
<div class="week-card">
|
|
3423
3446
|
<div class="week-header" onclick="this.parentElement.classList.toggle('collapsed')">
|
|
@@ -3428,6 +3451,7 @@
|
|
|
3428
3451
|
</div>
|
|
3429
3452
|
<div class="week-subtotal-stats">
|
|
3430
3453
|
<span>Token: <strong class="stat-token-badge">${formatTokens(w.totalTokens)}</strong></span>
|
|
3454
|
+
${weekCreditStat}
|
|
3431
3455
|
<span>费用: <strong class="stat-cost-badge">${formatInlineCost(model, wCost)}</strong></span>
|
|
3432
3456
|
</div>
|
|
3433
3457
|
</div>
|
|
@@ -1209,6 +1209,7 @@ body.light-theme .navbar {
|
|
|
1209
1209
|
.col-output { text-align: right; font-family: "JetBrains Mono", monospace; color: var(--color-output); }
|
|
1210
1210
|
.col-cache { text-align: right; font-family: "JetBrains Mono", monospace; color: var(--color-cache); }
|
|
1211
1211
|
.col-hitrate { text-align: right; font-family: "JetBrains Mono", monospace; color: var(--color-cache); font-weight: 500; width: 75px; }
|
|
1212
|
+
.col-credit { text-align: right; font-family: "JetBrains Mono", monospace; color: var(--accent-pink, #f43f5e); font-weight: 600; min-width: 90px; }
|
|
1212
1213
|
.col-cost { text-align: right; font-family: "JetBrains Mono", monospace; color: var(--accent-green); font-weight: 600; min-width: 100px; }
|
|
1213
1214
|
|
|
1214
1215
|
.cost-cny-main {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|