cc-pets 2.2.1 → 2.4.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/CC_BRIDGE.md +24 -2
- package/CC_BRIDGE.zh-CN.md +19 -2
- package/CHANGELOG.md +111 -0
- package/CHANGELOG.zh-CN.md +111 -0
- package/CONTRIBUTING.md +35 -10
- package/CONTRIBUTING.zh-CN.md +28 -10
- package/README.md +212 -32
- package/README.zh-CN.md +167 -36
- package/Resources/AgentIcons/claude.png +0 -0
- package/Resources/AgentIcons/codex.icns +0 -0
- package/Resources/IDEPlugins/cc-pets-terminal.vsix +0 -0
- package/Resources/IDEPlugins/cc-pets-terminal.zip +0 -0
- package/Resources/zh-Hans.lproj/Localizable.strings +699 -20
- package/Sources/CCPets/{CCPetsAppDelegate+AgentEvents.m → App/CCPetsAppDelegate+AgentEvents.m} +15 -5
- package/Sources/CCPets/{CCPetsAppDelegate+AgentStatus.m → App/CCPetsAppDelegate+AgentStatus.m} +90 -25
- package/Sources/CCPets/{CCPetsAppDelegate+Bridge.m → App/CCPetsAppDelegate+Bridge.m} +35 -24
- package/Sources/CCPets/{CCPetsAppDelegate+Pets.m → App/CCPetsAppDelegate+Pets.m} +17 -3
- package/Sources/CCPets/{CCPetsAppDelegate+Private.h → App/CCPetsAppDelegate+Private.h} +71 -23
- package/Sources/CCPets/App/CCPetsAppDelegate+Profiles.m +238 -0
- package/Sources/CCPets/{CCPetsAppDelegate+Quota.m → App/CCPetsAppDelegate+Quota.m} +47 -32
- package/Sources/CCPets/{CCPetsAppDelegate+Settings.m → App/CCPetsAppDelegate+Settings.m} +87 -102
- package/Sources/CCPets/{CCPetsAppDelegate+Speech.m → App/CCPetsAppDelegate+Speech.m} +121 -51
- package/Sources/CCPets/App/CCPetsAppDelegate+Workbench.m +139 -0
- package/Sources/CCPets/{CCPetsAppDelegate.h → App/CCPetsAppDelegate.h} +17 -2
- package/Sources/CCPets/{CCPetsAppDelegate.m → App/CCPetsAppDelegate.m} +107 -11
- package/Sources/CCPets/App/CCPetsOpenCommand.h +13 -0
- package/Sources/CCPets/App/CCPetsOpenCommand.m +99 -0
- package/Sources/CCPets/{main.m → App/main.m} +74 -1
- package/Sources/CCPets/{CCPetsBridge.h → Bridge/CCPetsBridge.h} +17 -4
- package/Sources/CCPets/{CCPetsBridge.m → Bridge/CCPetsBridge.m} +43 -23
- package/Sources/CCPets/Bridge/CCPetsBridgeCLI.h +10 -0
- package/Sources/CCPets/Bridge/CCPetsBridgeCLI.m +832 -0
- package/Sources/CCPets/Bridge/CCPetsBridgeCore.h +59 -0
- package/Sources/CCPets/Bridge/CCPetsBridgeCore.m +576 -0
- package/Sources/CCPets/Bridge/CCPetsBridgeSetup.h +24 -0
- package/Sources/CCPets/Bridge/CCPetsBridgeSetup.m +507 -0
- package/Sources/CCPets/Bridge/CCPetsBridgeStore.h +106 -0
- package/Sources/CCPets/Bridge/CCPetsBridgeStore.m +897 -0
- package/Sources/CCPets/Integrations/CCPetsCLISupport.h +75 -0
- package/Sources/CCPets/Integrations/CCPetsCLISupport.m +342 -0
- package/Sources/CCPets/Integrations/CCPetsEvents.h +15 -0
- package/Sources/CCPets/{CCPetsEvents.m → Integrations/CCPetsEvents.m} +23 -0
- package/Sources/CCPets/Integrations/CCPetsIDEIntegration.h +21 -0
- package/Sources/CCPets/Integrations/CCPetsIDEIntegration.m +503 -0
- package/Sources/CCPets/Integrations/CCPetsIntegrations.h +51 -0
- package/Sources/CCPets/Integrations/CCPetsIntegrations.m +662 -0
- package/Sources/CCPets/Integrations/CCPetsLaunchPreflight.h +5 -0
- package/Sources/CCPets/Integrations/CCPetsLaunchPreflight.m +367 -0
- package/Sources/CCPets/Integrations/CCPetsProfiles.h +38 -0
- package/Sources/CCPets/Integrations/CCPetsProfiles.m +516 -0
- package/Sources/CCPets/{CCPetsTerminalFocus.h → Integrations/CCPetsTerminalFocus.h} +2 -1
- package/Sources/CCPets/{CCPetsTerminalFocus.m → Integrations/CCPetsTerminalFocus.m} +148 -36
- package/Sources/CCPets/Integrations/CCPetsTerminalIntegration.h +17 -0
- package/Sources/CCPets/Integrations/CCPetsTerminalIntegration.m +64 -0
- package/Sources/CCPets/Integrations/CCPetsVSCodeIntegration.h +23 -0
- package/Sources/CCPets/Integrations/CCPetsVSCodeIntegration.m +475 -0
- package/Sources/CCPets/Pet/CCPetsPetStore.h +12 -0
- package/Sources/CCPets/Pet/CCPetsPetStore.m +476 -0
- package/Sources/CCPets/{CCPetsPhrases.h → Pet/CCPetsPhrases.h} +11 -2
- package/Sources/CCPets/{CCPetsPhrases.m → Pet/CCPetsPhrases.m} +19 -2
- package/Sources/CCPets/{CCPetsPhrasesEditor.m → Pet/CCPetsPhrasesEditor.m} +4 -1
- package/Sources/CCPets/Pet/PetView+Interaction.m +207 -0
- package/Sources/CCPets/Pet/PetView+Menu.m +598 -0
- package/Sources/CCPets/Pet/PetView+MicroBehavior.m +234 -0
- package/Sources/CCPets/Pet/PetView+Private.h +81 -0
- package/Sources/CCPets/{PetView.h → Pet/PetView.h} +3 -5
- package/Sources/CCPets/Pet/PetView.m +635 -0
- package/Sources/CCPets/Support/CCPetsDoctor.h +25 -0
- package/Sources/CCPets/Support/CCPetsDoctor.m +646 -0
- package/Sources/CCPets/Support/CCPetsJSON.h +27 -0
- package/Sources/CCPets/Support/CCPetsJSON.m +397 -0
- package/Sources/CCPets/{CCPetsL10n.h → Support/CCPetsL10n.h} +3 -1
- package/Sources/CCPets/{CCPetsL10n.m → Support/CCPetsL10n.m} +30 -1
- package/Sources/CCPets/Support/CCPetsPreferences.h +33 -0
- package/Sources/CCPets/Support/CCPetsPreferences.m +117 -0
- package/Sources/CCPets/UI/CCPetsDiagnosticsPage.h +25 -0
- package/Sources/CCPets/UI/CCPetsDiagnosticsPage.m +440 -0
- package/Sources/CCPets/UI/CCPetsFormBuilder.h +44 -0
- package/Sources/CCPets/UI/CCPetsFormBuilder.m +279 -0
- package/Sources/CCPets/UI/CCPetsGlassView.h +57 -0
- package/Sources/CCPets/{CCPetsGlassView.m → UI/CCPetsGlassView.m} +60 -11
- package/Sources/CCPets/UI/CCPetsMainWindow.h +55 -0
- package/Sources/CCPets/UI/CCPetsMainWindow.m +730 -0
- package/Sources/CCPets/UI/CCPetsSettingsPage.h +64 -0
- package/Sources/CCPets/UI/CCPetsSettingsPage.m +1412 -0
- package/Sources/CCPets/UI/CCPetsUIStyle.h +135 -0
- package/Sources/CCPets/UI/CCPetsUIStyle.m +865 -0
- package/Sources/CCPets/UI/CCPetsUsageChartView.h +15 -0
- package/Sources/CCPets/UI/CCPetsUsageChartView.m +288 -0
- package/Sources/CCPets/UI/CCPetsUsagePage.h +32 -0
- package/Sources/CCPets/UI/CCPetsUsagePage.m +712 -0
- package/Sources/CCPets/UI/CCPetsUsageShared.h +53 -0
- package/Sources/CCPets/UI/CCPetsUsageStore.m +120 -0
- package/Sources/CCPets/UI/CCPetsUsageWidgets.h +30 -0
- package/Sources/CCPets/UI/CCPetsUsageWidgets.m +201 -0
- package/Sources/CCPets/UI/CCPetsWorkbench.h +40 -0
- package/Sources/CCPets/UI/CCPetsWorkbenchPages.h +13 -0
- package/Sources/CCPets/UI/CCPetsWorkbenchPages.m +783 -0
- package/Sources/CCPets/{MenuToggleSwitch.m → UI/MenuToggleSwitch.m} +1 -0
- package/Sources/CCPets/{CCPetsCodexRateLimits.h → Usage/CCPetsCodexRateLimits.h} +1 -0
- package/Sources/CCPets/{CCPetsCodexRateLimits.m → Usage/CCPetsCodexRateLimits.m} +10 -3
- package/Sources/CCPets/{CCPetsQuotaHistory.h → Usage/CCPetsQuotaHistory.h} +3 -0
- package/Sources/CCPets/{CCPetsQuotaHistory.m → Usage/CCPetsQuotaHistory.m} +58 -0
- package/Sources/CCPets/Usage/CCPetsUsage+ClaudeReader.m +436 -0
- package/Sources/CCPets/Usage/CCPetsUsage+CodexBackground.m +193 -0
- package/Sources/CCPets/Usage/CCPetsUsage+CodexReader.m +392 -0
- package/Sources/CCPets/Usage/CCPetsUsage+CodexSessions.m +484 -0
- package/Sources/CCPets/Usage/CCPetsUsage+Internal.h +97 -0
- package/Sources/CCPets/Usage/CCPetsUsage+Models.m +323 -0
- package/Sources/CCPets/Usage/CCPetsUsage+TokenTotals.m +655 -0
- package/Sources/CCPets/Usage/CCPetsUsage.h +58 -0
- package/Sources/CCPets/Usage/CCPetsUsage.m +225 -0
- package/Sources/CCPets/Usage/CCPetsUsageMode.h +10 -0
- package/Sources/CCPets/Usage/CCPetsUsageMode.m +163 -0
- package/Sources/CCPets/{CCPetsUsageMonitor.h → Usage/CCPetsUsageMonitor.h} +3 -0
- package/Sources/CCPets/{CCPetsUsageMonitor.m → Usage/CCPetsUsageMonitor.m} +174 -19
- package/Sources/CCPets/Usage/QuotaDashboardView+Primitives.m +328 -0
- package/Sources/CCPets/Usage/QuotaDashboardView+Private.h +103 -0
- package/Sources/CCPets/Usage/QuotaDashboardView+Rendering.m +598 -0
- package/Sources/CCPets/{QuotaDashboardView.h → Usage/QuotaDashboardView.h} +17 -0
- package/Sources/CCPets/Usage/QuotaDashboardView.m +713 -0
- package/THIRD_PARTY_NOTICES.md +8 -4
- package/THIRD_PARTY_NOTICES.zh-CN.md +6 -2
- package/bin/cc-pets +8 -6
- package/bin/claude-with-pet +12 -2
- package/bin/codex-with-pet +15 -5
- package/package.json +5 -1
- package/plugins/jetbrains/README.md +62 -0
- package/plugins/jetbrains/src/main/java/com/ccpets/terminal/TerminalBridge.java +379 -0
- package/plugins/jetbrains/src/main/java/com/ccpets/terminal/TerminalIdentity.java +24 -0
- package/plugins/jetbrains/src/main/java/com/ccpets/terminal/TerminalStartup.java +12 -0
- package/plugins/jetbrains/src/main/resources/META-INF/plugin.xml +23 -0
- package/plugins/jetbrains/src/main/resources/META-INF/pluginIcon.svg +380 -0
- package/plugins/vscode/README.md +63 -0
- package/plugins/vscode/extension.js +210 -0
- package/plugins/vscode/package.json +18 -0
- package/scripts/build-idea-plugin.sh +101 -0
- package/scripts/build-vscode-extension.sh +112 -0
- package/scripts/build.sh +31 -5
- package/scripts/compile-cached.zsh +133 -0
- package/scripts/i18n.zsh +9 -52
- package/scripts/install-app.sh +4 -0
- package/scripts/install-shell-integration.sh +17 -10
- package/scripts/uninstall-shell-integration.sh +6 -1
- package/Sources/CCPets/CCPetsEvents.h +0 -10
- package/Sources/CCPets/CCPetsGlassView.h +0 -31
- package/Sources/CCPets/CCPetsUsage.h +0 -36
- package/Sources/CCPets/CCPetsUsage.m +0 -2069
- package/Sources/CCPets/PetView.m +0 -1839
- package/Sources/CCPets/QuotaDashboardView.m +0 -1145
- package/scripts/bridge/cli.mjs +0 -237
- package/scripts/bridge/core.mjs +0 -228
- package/scripts/bridge/hook.mjs +0 -150
- package/scripts/bridge/install.mjs +0 -311
- package/scripts/bridge/mcp-server.mjs +0 -308
- package/scripts/bridge/options.mjs +0 -87
- package/scripts/bridge/process.mjs +0 -151
- package/scripts/bridge/reservations.mjs +0 -248
- package/scripts/bridge/store.mjs +0 -433
- package/scripts/bridge/watch.mjs +0 -69
- package/scripts/check-l10n.mjs +0 -168
- package/scripts/configure-updater.mjs +0 -43
- package/scripts/detect-cli.mjs +0 -68
- package/scripts/doctor.mjs +0 -470
- package/scripts/i18n.mjs +0 -122
- package/scripts/install-claude-hooks.mjs +0 -253
- package/scripts/install-codex-hooks.mjs +0 -78
- package/scripts/integration-markers.mjs +0 -51
- package/scripts/locales/zh-Hans.json +0 -366
- package/scripts/pet-store.mjs +0 -415
- package/scripts/uninstall-integrations.mjs +0 -205
- /package/Sources/CCPets/{CCPetsAppDelegate+Update.m → App/CCPetsAppDelegate+Update.m} +0 -0
- /package/Sources/CCPets/{CCPetsVersion.h → App/CCPetsVersion.h} +0 -0
- /package/Sources/CCPets/{CCPetsVersion.m → App/CCPetsVersion.m} +0 -0
- /package/Sources/CCPets/{CCPetsImageLoader.h → Pet/CCPetsImageLoader.h} +0 -0
- /package/Sources/CCPets/{CCPetsImageLoader.m → Pet/CCPetsImageLoader.m} +0 -0
- /package/Sources/CCPets/{CCPetsPetSize.h → Pet/CCPetsPetSize.h} +0 -0
- /package/Sources/CCPets/{CCPetsPetSize.m → Pet/CCPetsPetSize.m} +0 -0
- /package/Sources/CCPets/{CCPetsPhrasesEditor.h → Pet/CCPetsPhrasesEditor.h} +0 -0
- /package/Sources/CCPets/{CCPetsPreviews.h → Pet/CCPetsPreviews.h} +0 -0
- /package/Sources/CCPets/{CCPetsPreviews.m → Pet/CCPetsPreviews.m} +0 -0
- /package/Sources/CCPets/Resources/{/351/273/230/350/256/244.webp" → ByteMochi.webp} +0 -0
- /package/Sources/CCPets/{CCPetsCleanup.h → Support/CCPetsCleanup.h} +0 -0
- /package/Sources/CCPets/{CCPetsCleanup.m → Support/CCPetsCleanup.m} +0 -0
- /package/Sources/CCPets/{CCPetsPaths.h → Support/CCPetsPaths.h} +0 -0
- /package/Sources/CCPets/{CCPetsPaths.m → Support/CCPetsPaths.m} +0 -0
- /package/Sources/CCPets/{CCPetsSystemMonitor.h → Support/CCPetsSystemMonitor.h} +0 -0
- /package/Sources/CCPets/{CCPetsSystemMonitor.m → Support/CCPetsSystemMonitor.m} +0 -0
- /package/Sources/CCPets/{CCPetsGlassMenu.h → UI/CCPetsGlassMenu.h} +0 -0
- /package/Sources/CCPets/{CCPetsGlassMenu.m → UI/CCPetsGlassMenu.m} +0 -0
- /package/Sources/CCPets/{MenuChoiceRow.h → UI/MenuChoiceRow.h} +0 -0
- /package/Sources/CCPets/{MenuChoiceRow.m → UI/MenuChoiceRow.m} +0 -0
- /package/Sources/CCPets/{MenuHintView.h → UI/MenuHintView.h} +0 -0
- /package/Sources/CCPets/{MenuHintView.m → UI/MenuHintView.m} +0 -0
- /package/Sources/CCPets/{MenuPetSizeView.h → UI/MenuPetSizeView.h} +0 -0
- /package/Sources/CCPets/{MenuPetSizeView.m → UI/MenuPetSizeView.m} +0 -0
- /package/Sources/CCPets/{MenuToggleSwitch.h → UI/MenuToggleSwitch.h} +0 -0
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
#import "QuotaDashboardView+Private.h"
|
|
2
|
+
|
|
3
|
+
@implementation QuotaDashboardView (Rendering)
|
|
4
|
+
- (void)drawProvider:(NSString *)name displayName:(NSString *)displayName
|
|
5
|
+
usage:(NSDictionary *)usage usedKey:(NSString *)usedKey color:(NSColor *)color
|
|
6
|
+
cardRect:(NSRect)card profileCount:(NSUInteger)profileCount selectedIndex:(NSUInteger)selectedIndex {
|
|
7
|
+
NSColor *primary = self.primaryColor;
|
|
8
|
+
NSColor *secondary = self.secondaryColor;
|
|
9
|
+
NSDictionary *five = [self quota:usage key:@"fiveHour"];
|
|
10
|
+
NSDictionary *week = [self quota:usage key:@"week"];
|
|
11
|
+
NSDictionary *fiveTokens = [self tokenTotals:usage key:@"fiveHour"];
|
|
12
|
+
NSDictionary *weekTokens = [self tokenTotals:usage key:@"week"];
|
|
13
|
+
NSDictionary *monthTokens = [self tokenTotals:usage key:@"month"];
|
|
14
|
+
// 同比两侧都只数到最后一个完整自然日(见 CalendarMonthWindows),因此不能拿含今天的
|
|
15
|
+
// monthTokens 去比不含同日的上月——那样每天都会凭空多出小半天的增量。
|
|
16
|
+
NSDictionary *monthComparable = [self tokenTotals:usage key:@"monthComparable"];
|
|
17
|
+
NSDictionary *previousMonthTokens = [self tokenTotals:usage key:@"previousMonthToDate"];
|
|
18
|
+
NSDictionary *tokenUsage = [usage[@"tokenUsage"] isKindOfClass:NSDictionary.class]
|
|
19
|
+
? usage[@"tokenUsage"] : nil;
|
|
20
|
+
NSArray<NSDictionary *> *monthDaily = [tokenUsage[@"monthDaily"] isKindOfClass:NSArray.class]
|
|
21
|
+
? tokenUsage[@"monthDaily"] : @[];
|
|
22
|
+
NSDictionary *profile = [self selectedProfileForProvider:name];
|
|
23
|
+
NSDictionary *state = [self accountStateForProvider:name profile:profile usage:usage];
|
|
24
|
+
BOOL apiMode = [state[@"apiMode"] boolValue];
|
|
25
|
+
NSNumber *fiveUsed = [self usedForQuota:five usedKey:usedKey];
|
|
26
|
+
NSNumber *weekUsed = [self usedForQuota:week usedKey:usedKey];
|
|
27
|
+
// usage_limit_exceeded 只能说明某次请求被额度限制,不能说明耗尽的是 5 小时还是
|
|
28
|
+
// 7 天窗口;切到 credits 后请求还能继续成功,但 rate_limits 可能一直为空。因此把它
|
|
29
|
+
// 作为独立的“额度受限”状态,不再拿一个无窗口归属的事件覆盖两个官方百分比。
|
|
30
|
+
BOOL exhausted = [usage[@"exhaustedAt"] isKindOfClass:NSNumber.class];
|
|
31
|
+
BOOL hasData = [state[@"hasData"] boolValue];
|
|
32
|
+
BOOL online = [state[@"online"] boolValue];
|
|
33
|
+
|
|
34
|
+
NSBezierPath *cardPath = [NSBezierPath bezierPathWithRoundedRect:card xRadius:18 yRadius:18];
|
|
35
|
+
// 经典主题的浅色渐变放到玻璃上会变成磨砂;原生玻璃下改垫一层深色衬底托住文字。
|
|
36
|
+
if (self.usesLiquidGlass) {
|
|
37
|
+
[self fillLiquidScrim:cardPath];
|
|
38
|
+
} else {
|
|
39
|
+
NSGradient *cardGlass = [[NSGradient alloc]
|
|
40
|
+
initWithStartingColor:[NSColor colorWithWhite:1 alpha:0.085]
|
|
41
|
+
endingColor:[color colorWithAlphaComponent:0.025]];
|
|
42
|
+
[cardGlass drawInBezierPath:cardPath angle:-25];
|
|
43
|
+
}
|
|
44
|
+
[[NSColor colorWithWhite:1 alpha:self.usesLiquidGlass ? 0.10 : 0.18] setStroke];
|
|
45
|
+
cardPath.lineWidth = 1;
|
|
46
|
+
[cardPath stroke];
|
|
47
|
+
|
|
48
|
+
// 账号列加宽,三个数据区略微收紧;Home 名称比 Provider 名更长。
|
|
49
|
+
NSArray<NSNumber *> *separators = @[@(NSMinX(card) + 220), @(NSMinX(card) + 390),
|
|
50
|
+
@(NSMinX(card) + 560)];
|
|
51
|
+
[[NSColor colorWithWhite:1 alpha:0.10] setStroke];
|
|
52
|
+
for (NSNumber *value in separators) {
|
|
53
|
+
[NSBezierPath strokeLineFromPoint:NSMakePoint(value.doubleValue, NSMinY(card) + 14)
|
|
54
|
+
toPoint:NSMakePoint(value.doubleValue, NSMaxY(card) - 14)];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 卡片增高后保持原有内容组垂直居中,新增空间均匀落在上下两侧。
|
|
58
|
+
CGFloat contentOffset = (NSHeight(card) - QuotaBaseCardHeight) / 2;
|
|
59
|
+
[NSGraphicsContext saveGraphicsState];
|
|
60
|
+
NSAffineTransform *contentTransform = [NSAffineTransform transform];
|
|
61
|
+
[contentTransform translateXBy:0 yBy:contentOffset];
|
|
62
|
+
[contentTransform concat];
|
|
63
|
+
card.size.height = QuotaBaseCardHeight;
|
|
64
|
+
|
|
65
|
+
NSRect icon = NSMakeRect(NSMinX(card) + 12, NSMinY(card) + 41, 70, 70);
|
|
66
|
+
NSImage *logo = [name isEqualToString:@"Codex"] ? self.codexLogo : self.claudeLogo;
|
|
67
|
+
if (logo) {
|
|
68
|
+
[NSGraphicsContext saveGraphicsState];
|
|
69
|
+
[[NSBezierPath bezierPathWithRoundedRect:icon xRadius:18 yRadius:18] addClip];
|
|
70
|
+
[logo drawInRect:icon fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0
|
|
71
|
+
respectFlipped:YES hints:@{NSImageHintInterpolation: @(NSImageInterpolationHigh)}];
|
|
72
|
+
[NSGraphicsContext restoreGraphicsState];
|
|
73
|
+
} else {
|
|
74
|
+
[self fillRoundedRect:icon radius:18 color:[color colorWithAlphaComponent:0.7]];
|
|
75
|
+
[name drawInRect:NSInsetRect(icon, 5, 23)
|
|
76
|
+
withAttributes:[self centeredTextAttributesWithSize:13 color:NSColor.whiteColor weight:NSFontWeightBold]];
|
|
77
|
+
}
|
|
78
|
+
CGFloat nameWidth = 118;
|
|
79
|
+
CGFloat nameSize = 22;
|
|
80
|
+
while (nameSize > 14 && [displayName sizeWithAttributes:
|
|
81
|
+
[self textAttributesWithSize:nameSize color:primary weight:NSFontWeightBold]].width > nameWidth) {
|
|
82
|
+
nameSize -= 1;
|
|
83
|
+
}
|
|
84
|
+
NSMutableDictionary *nameAttributes = [[self textAttributesWithSize:nameSize color:primary
|
|
85
|
+
weight:NSFontWeightBold] mutableCopy];
|
|
86
|
+
NSMutableParagraphStyle *nameStyle = [NSMutableParagraphStyle new];
|
|
87
|
+
nameStyle.lineBreakMode = NSLineBreakByTruncatingMiddle;
|
|
88
|
+
nameAttributes[NSParagraphStyleAttributeName] = nameStyle;
|
|
89
|
+
[displayName drawInRect:NSMakeRect(NSMinX(card) + 94, NSMinY(card) + 84, nameWidth, 30)
|
|
90
|
+
withAttributes:nameAttributes];
|
|
91
|
+
// 四态:额度被拒 → 额度受限(百分比仍是上次官方快照);没有任何额度数据 → 等待数据;
|
|
92
|
+
// 有数据但客户端已退出 → 离线;两者都有 → 在线。
|
|
93
|
+
NSString *statusText = state[@"status"];
|
|
94
|
+
NSColor *statusColor = (!apiMode && exhausted) ? NSColor.systemOrangeColor
|
|
95
|
+
: (online && hasData ? NSColor.systemGreenColor : secondary);
|
|
96
|
+
if (self.usesLiquidGlass) {
|
|
97
|
+
// 原生玻璃下不画彩色底标签,状态色交给字前的圆点;文字里自带的"●"去掉,免得两个点。
|
|
98
|
+
NSString *plain = [statusText stringByReplacingOccurrencesOfString:@"● " withString:@""];
|
|
99
|
+
[self drawText:plain inRect:NSMakeRect(NSMinX(card) + 96, NSMinY(card) + 57, 120, 20)
|
|
100
|
+
size:11 weight:NSFontWeightMedium color:statusColor dotColor:statusColor];
|
|
101
|
+
} else {
|
|
102
|
+
NSDictionary *statusAttributes = [self textAttributesWithSize:11 color:statusColor
|
|
103
|
+
weight:NSFontWeightMedium];
|
|
104
|
+
CGFloat statusWidth = ceil([statusText sizeWithAttributes:statusAttributes].width) + 18;
|
|
105
|
+
NSRect status = NSMakeRect(NSMinX(card) + 94, NSMinY(card) + 55, statusWidth, 24);
|
|
106
|
+
[self fillRoundedRect:status radius:12 color:[statusColor colorWithAlphaComponent:0.13]];
|
|
107
|
+
[statusText drawInRect:NSInsetRect(status, 9, 4) withAttributes:statusAttributes];
|
|
108
|
+
}
|
|
109
|
+
if (profileCount > 1) {
|
|
110
|
+
// 箭头画在卡片两侧 20pt 的留白里:描边 chevron 比"‹ ›"字形更大更清楚,用次要色压低存在感。
|
|
111
|
+
[NSGraphicsContext saveGraphicsState];
|
|
112
|
+
[[NSShadow new] set];
|
|
113
|
+
[[secondary colorWithAlphaComponent:0.75] setStroke];
|
|
114
|
+
for (NSNumber *side in @[@-1, @1]) {
|
|
115
|
+
CGFloat tipX = side.doubleValue < 0 ? NSMinX(card) - 15 : NSMaxX(card) + 15;
|
|
116
|
+
CGFloat tailX = tipX - side.doubleValue * 9;
|
|
117
|
+
NSBezierPath *chevron = [NSBezierPath bezierPath];
|
|
118
|
+
[chevron moveToPoint:NSMakePoint(tailX, NSMidY(card) + 13)];
|
|
119
|
+
[chevron lineToPoint:NSMakePoint(tipX, NSMidY(card))];
|
|
120
|
+
[chevron lineToPoint:NSMakePoint(tailX, NSMidY(card) - 13)];
|
|
121
|
+
chevron.lineWidth = 3;
|
|
122
|
+
chevron.lineCapStyle = NSLineCapStyleRound;
|
|
123
|
+
chevron.lineJoinStyle = NSLineJoinStyleRound;
|
|
124
|
+
[chevron stroke];
|
|
125
|
+
}
|
|
126
|
+
[NSGraphicsContext restoreGraphicsState];
|
|
127
|
+
CGFloat dotsWidth = (profileCount - 1) * QuotaCarouselDotGap + QuotaCarouselDotDiameter;
|
|
128
|
+
CGFloat dotsX = NSMinX(card) + 155 - dotsWidth / 2;
|
|
129
|
+
for (NSUInteger index = 0; index < profileCount; index++) {
|
|
130
|
+
NSRect dot = NSMakeRect(dotsX + index * QuotaCarouselDotGap, NSMinY(card) + 34,
|
|
131
|
+
QuotaCarouselDotDiameter, QuotaCarouselDotDiameter);
|
|
132
|
+
// 只标当前面板:选中用 Provider 主色,其余一律置灰。
|
|
133
|
+
NSColor *dotColor = index == selectedIndex ? color : [secondary colorWithAlphaComponent:0.35];
|
|
134
|
+
[dotColor setFill];
|
|
135
|
+
[[NSBezierPath bezierPathWithOvalInRect:dot] fill];
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (apiMode) {
|
|
140
|
+
CGFloat callX = NSMinX(card) + 244;
|
|
141
|
+
CGFloat tokenX = NSMinX(card) + 414;
|
|
142
|
+
[L(@"Calls this month") drawInRect:NSMakeRect(callX, NSMinY(card) + 114, 130, 20)
|
|
143
|
+
withAttributes:[self textAttributesWithSize:13 color:secondary weight:NSFontWeightRegular]];
|
|
144
|
+
[L(@"Tokens this month") drawInRect:NSMakeRect(tokenX, NSMinY(card) + 114, 130, 20)
|
|
145
|
+
withAttributes:[self textAttributesWithSize:13 color:secondary weight:NSFontWeightRegular]];
|
|
146
|
+
|
|
147
|
+
NSString *requests = [NSString stringWithFormat:L(@"%@ calls"),
|
|
148
|
+
[self formattedRequestCount:monthTokens ?: @{}]];
|
|
149
|
+
[requests drawInRect:NSMakeRect(callX, NSMinY(card) + 75, 142, 34)
|
|
150
|
+
withAttributes:[self textAttributesWithSize:24 color:primary weight:NSFontWeightBold]];
|
|
151
|
+
// 曲线铺满整个自然月,月末那些还没到的日子不能算进"已过天数",否则日均会被稀释。
|
|
152
|
+
NSTimeInterval now = NSDate.date.timeIntervalSince1970;
|
|
153
|
+
NSUInteger recordedDays = 0;
|
|
154
|
+
for (NSDictionary *day in monthDaily) {
|
|
155
|
+
if ([day[@"timestamp"] doubleValue] <= now) recordedDays += 1;
|
|
156
|
+
}
|
|
157
|
+
NSUInteger elapsedDays = MAX((NSUInteger)1, recordedDays);
|
|
158
|
+
NSNumber *requestCount = [monthTokens[@"request_count"] isKindOfClass:NSNumber.class]
|
|
159
|
+
? monthTokens[@"request_count"] : nil;
|
|
160
|
+
NSString *average = requestCount
|
|
161
|
+
? [NSString stringWithFormat:L(@"%@/day avg"),
|
|
162
|
+
[NSNumberFormatter localizedStringFromNumber:
|
|
163
|
+
@(llround(requestCount.doubleValue / elapsedDays))
|
|
164
|
+
numberStyle:NSNumberFormatterDecimalStyle]]
|
|
165
|
+
: L(@"--/day avg");
|
|
166
|
+
[average drawInRect:NSMakeRect(callX, NSMinY(card) + 48, 142, 20)
|
|
167
|
+
withAttributes:[self textAttributesWithSize:12 color:secondary weight:NSFontWeightRegular]];
|
|
168
|
+
|
|
169
|
+
// 这里不再重复"本月消耗"的合计:输入与输出各自的量级才是按量计费时要看的东西,
|
|
170
|
+
// 合计随时可以由这两个数得到,而它原先占掉了最显眼的一行。
|
|
171
|
+
NSArray<NSDictionary *> *splits = @[
|
|
172
|
+
@{@"label": L(@"Input"), @"value": [self formattedTokenSplit:monthTokens ?: @{}
|
|
173
|
+
wantsOutput:NO], @"y": @(NSMinY(card) + 76)},
|
|
174
|
+
@{@"label": L(@"Output"), @"value": [self formattedTokenSplit:monthTokens ?: @{}
|
|
175
|
+
wantsOutput:YES], @"y": @(NSMinY(card) + 48)}
|
|
176
|
+
];
|
|
177
|
+
for (NSDictionary *split in splits) {
|
|
178
|
+
CGFloat y = [split[@"y"] doubleValue];
|
|
179
|
+
[split[@"label"] drawInRect:NSMakeRect(tokenX, y + 4, 28, 16)
|
|
180
|
+
withAttributes:[self textAttributesWithSize:11 color:secondary
|
|
181
|
+
weight:NSFontWeightRegular]];
|
|
182
|
+
[split[@"value"] drawInRect:NSMakeRect(tokenX + 32, y, 110, 26)
|
|
183
|
+
withAttributes:[self textAttributesWithSize:18 color:primary
|
|
184
|
+
weight:NSFontWeightBold]];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
NSDictionary *requestComparison = [self comparisonForCurrent:
|
|
188
|
+
[monthComparable[@"request_count"] doubleValue]
|
|
189
|
+
previous:[previousMonthTokens[@"request_count"] doubleValue] color:color];
|
|
190
|
+
[self drawText:requestComparison[@"text"] inRect:NSMakeRect(callX, NSMinY(card) + 22, 142, 18)
|
|
191
|
+
size:11 weight:NSFontWeightMedium color:requestComparison[@"color"]
|
|
192
|
+
dotColor:requestComparison[@"color"]];
|
|
193
|
+
NSDictionary *tokenComparison = [self comparisonForCurrent:
|
|
194
|
+
[monthComparable[@"total_tokens"] doubleValue]
|
|
195
|
+
previous:[previousMonthTokens[@"total_tokens"] doubleValue] color:color];
|
|
196
|
+
[self drawText:tokenComparison[@"text"] inRect:NSMakeRect(tokenX, NSMinY(card) + 22, 142, 18)
|
|
197
|
+
size:11 weight:NSFontWeightMedium color:tokenComparison[@"color"]
|
|
198
|
+
dotColor:tokenComparison[@"color"]];
|
|
199
|
+
|
|
200
|
+
CGFloat trendX = NSMinX(card) + 574;
|
|
201
|
+
// 今日用量和记录天数各占一行,峰值放进悬浮提示。
|
|
202
|
+
[self drawText:L(@"Month") inRect:NSMakeRect(trendX, NSMinY(card) + 114, 145, 20)
|
|
203
|
+
size:13 weight:NSFontWeightRegular color:secondary dotColor:nil];
|
|
204
|
+
NSRect curveRect = NSMakeRect(trendX, NSMinY(card) + 66, 135, 34);
|
|
205
|
+
[self drawMonthlyTokenCurve:monthDaily inRect:curveRect color:color];
|
|
206
|
+
NSDictionary *todayTotals = nil;
|
|
207
|
+
for (NSDictionary *day in monthDaily) {
|
|
208
|
+
if ([day[@"timestamp"] doubleValue] > now) break;
|
|
209
|
+
NSDictionary *totals = [day[@"totals"] isKindOfClass:NSDictionary.class]
|
|
210
|
+
? day[@"totals"] : nil;
|
|
211
|
+
todayTotals = totals;
|
|
212
|
+
}
|
|
213
|
+
NSString *todayText = todayTotals
|
|
214
|
+
? [NSString stringWithFormat:L(@"Today %@"),
|
|
215
|
+
[self formattedTokenValue:[todayTotals[@"total_tokens"] doubleValue]]] : L(@"Today --");
|
|
216
|
+
[self drawText:todayText inRect:NSMakeRect(trendX, NSMinY(card) + 44, 145, 18)
|
|
217
|
+
size:11 weight:NSFontWeightRegular color:secondary dotColor:nil];
|
|
218
|
+
// 记录天数与左侧两列的月同比脚注保持相同基线和字号。
|
|
219
|
+
NSString *recordedText = [NSString stringWithFormat:L(@"%lu / %lu days recorded"),
|
|
220
|
+
(unsigned long)recordedDays, (unsigned long)monthDaily.count];
|
|
221
|
+
[self drawText:recordedText inRect:NSMakeRect(trendX, NSMinY(card) + 22, 145, 18)
|
|
222
|
+
size:11 weight:NSFontWeightMedium color:color dotColor:nil];
|
|
223
|
+
[NSGraphicsContext restoreGraphicsState];
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// 层级:官方剩余额度是订阅限额的权威值,占主位;本机 Token 是参考量,降一级并用
|
|
228
|
+
// 强调色区分;重置时间最小。反过来会让最抢眼的数字恰好是最不该照着做决定的那个。
|
|
229
|
+
NSArray<NSDictionary *> *windows = @[
|
|
230
|
+
@{@"x": @(NSMinX(card) + 244), @"title": L(@"5h window"), @"quota": five ?: @{},
|
|
231
|
+
@"tokens": fiveTokens ?: @{}, @"used": fiveUsed ?: NSNull.null,
|
|
232
|
+
@"showDate": @NO, @"rolling": L(@"Waiting for refresh")},
|
|
233
|
+
@{@"x": @(NSMinX(card) + 414), @"title": L(@"7d window"), @"quota": week ?: @{},
|
|
234
|
+
@"tokens": weekTokens ?: @{}, @"used": weekUsed ?: NSNull.null,
|
|
235
|
+
@"showDate": @YES, @"rolling": L(@"Waiting for refresh")}
|
|
236
|
+
];
|
|
237
|
+
for (NSDictionary *window in windows) {
|
|
238
|
+
CGFloat x = [window[@"x"] doubleValue];
|
|
239
|
+
[window[@"title"] drawInRect:NSMakeRect(x, NSMinY(card) + 114, 130, 20)
|
|
240
|
+
withAttributes:[self textAttributesWithSize:13 color:secondary weight:NSFontWeightRegular]];
|
|
241
|
+
NSNumber *used = [window[@"used"] isKindOfClass:NSNumber.class] ? window[@"used"] : nil;
|
|
242
|
+
double remaining = used ? 100.0 - used.doubleValue : 0;
|
|
243
|
+
NSString *official = used ? [NSString stringWithFormat:@"%.0f%%", remaining] : @"--";
|
|
244
|
+
// 百分比是"剩余"、Token 是"已用",方向相反。后缀直接贴在数字右侧、
|
|
245
|
+
// 前缀写进 Token 行,否则两个数字并排看会被当成同一口径。
|
|
246
|
+
NSDictionary *valueAttributes = [self textAttributesWithSize:25
|
|
247
|
+
color:exhausted ? NSColor.systemOrangeColor : primary
|
|
248
|
+
weight:NSFontWeightBold];
|
|
249
|
+
CGFloat valueWidth = ceil([official sizeWithAttributes:valueAttributes].width);
|
|
250
|
+
[official drawInRect:NSMakeRect(x, NSMinY(card) + 74, valueWidth + 4, 34)
|
|
251
|
+
withAttributes:valueAttributes];
|
|
252
|
+
// 没有数字可标时不给口径标签:"-- 剩余"看起来像一个真实的 0 值,而实际上是
|
|
253
|
+
// 官方快照待刷新。下方的状态文字会说明它为何不可用。
|
|
254
|
+
NSString *valueLabel = !used ? @"" : (exhausted ? L(@"Snapshot") : L(@"Left"));
|
|
255
|
+
if (valueLabel.length > 0) {
|
|
256
|
+
[valueLabel drawInRect:NSMakeRect(x + valueWidth + 7, NSMinY(card) + 78, 60, 20)
|
|
257
|
+
withAttributes:[self textAttributesWithSize:12 color:secondary
|
|
258
|
+
weight:NSFontWeightRegular]];
|
|
259
|
+
}
|
|
260
|
+
// 官方窗口拿不到时(账号没有这个窗口、或响应里没带),Token 走的是本机滚动窗口。
|
|
261
|
+
// 说清楚这一行的口径,比留一个 `--` 让人以为是渲染坏了要好。
|
|
262
|
+
NSString *resetValue = [self resetText:window[@"quota"]
|
|
263
|
+
showDate:[window[@"showDate"] boolValue]];
|
|
264
|
+
NSString *reset = [resetValue isEqualToString:@"--"]
|
|
265
|
+
? window[@"rolling"] : [NSString stringWithFormat:L(@"Reset %@"), resetValue];
|
|
266
|
+
[self drawText:reset inRect:NSMakeRect(x, NSMinY(card) + 46, 160, 18)
|
|
267
|
+
size:11 weight:NSFontWeightRegular color:secondary dotColor:nil];
|
|
268
|
+
// 两个主题统一使用紧凑文案;脚注里已说明 Token 即本机统计的已用量。
|
|
269
|
+
NSString *tokenText = [NSString stringWithFormat:L(@"Used %@"),
|
|
270
|
+
[self formattedTokenCount:window[@"tokens"]]];
|
|
271
|
+
[self drawText:tokenText inRect:NSMakeRect(x, NSMinY(card) + 22, 142, 22) size:14
|
|
272
|
+
weight:NSFontWeightSemibold color:color dotColor:color];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
CGFloat trendX = NSMinX(card) + 574;
|
|
276
|
+
// 与 API 卡同一套骨架:标题行带 pill、中间曲线、脚注和左边两列齐平。
|
|
277
|
+
[L(@"Trend") drawInRect:NSMakeRect(trendX, NSMinY(card) + 114, 60, 20)
|
|
278
|
+
withAttributes:[self textAttributesWithSize:13 color:secondary weight:NSFontWeightRegular]];
|
|
279
|
+
NSString *profileID = [self selectedProfileForProvider:name][@"id"];
|
|
280
|
+
NSArray<NSDictionary *> *history = profileID.length > 0 ? (self.profileHistories[profileID] ?: @[])
|
|
281
|
+
: ([name isEqualToString:@"Codex"] ? self.codexHistory : self.claudeHistory);
|
|
282
|
+
NSNumber *currentUsed = weekUsed;
|
|
283
|
+
NSArray<NSDictionary *> *points = [self curvePointsFromHistory:history currentUsed:currentUsed];
|
|
284
|
+
// 趋势这一列算的是 7 天窗口(currentUsed 取 weekUsed)。而 exhaustedAt 来自
|
|
285
|
+
// rateLimitReachedType,没有窗口归属,实际撞墙的通常是 5 小时窗口——拿它一票否决
|
|
286
|
+
// 整列,会出现左边 7 天窗口好好显示着 45% 剩余、右边却说"等待官方额度刷新"的自相
|
|
287
|
+
// 矛盾。所以只有 7 天窗口自己确实没有百分比时才退回"待刷新"。
|
|
288
|
+
BOOL weekUnknown = exhausted && currentUsed == nil;
|
|
289
|
+
NSDictionary *pace = weekUnknown
|
|
290
|
+
? @{ @"label": L(@"Stale"), @"tip": L(@"Awaiting refresh"),
|
|
291
|
+
@"color": NSColor.systemOrangeColor }
|
|
292
|
+
: [self paceStatusForQuota:week currentUsed:currentUsed color:color];
|
|
293
|
+
NSColor *paceColor = pace[@"color"];
|
|
294
|
+
// 档位讲的是 7 天趋势,脚注讲的是此刻为什么发不出请求:受限但 7 天窗口尚有余量时
|
|
295
|
+
// 两者都要说清,所以脚注单独取色,不跟着档位走。
|
|
296
|
+
NSString *paceTip = pace[@"tip"];
|
|
297
|
+
NSColor *tipColor = paceColor;
|
|
298
|
+
if (exhausted && !weekUnknown) {
|
|
299
|
+
paceTip = L(@"Limited until reset");
|
|
300
|
+
tipColor = NSColor.systemOrangeColor;
|
|
301
|
+
}
|
|
302
|
+
if (self.usesLiquidGlass) {
|
|
303
|
+
[self drawText:pace[@"label"] inRect:NSMakeRect(trendX + 62, NSMinY(card) + 114, 96, 20)
|
|
304
|
+
size:11 weight:NSFontWeightSemibold color:paceColor dotColor:paceColor];
|
|
305
|
+
} else {
|
|
306
|
+
NSDictionary *pillAttributes = [self textAttributesWithSize:11 color:paceColor
|
|
307
|
+
weight:NSFontWeightSemibold];
|
|
308
|
+
// 档位标签跟在标题后面。宽度仍按文字算:四个档位不一样长,最宽的"数据不足"到
|
|
309
|
+
// trendX + 131,列宽 145 放得下。
|
|
310
|
+
CGFloat pillWidth = ceil([pace[@"label"] sizeWithAttributes:pillAttributes].width) + 18;
|
|
311
|
+
NSRect pill = NSMakeRect(trendX + 59, NSMinY(card) + 113, pillWidth, 22);
|
|
312
|
+
[self fillRoundedRect:pill radius:11 color:[paceColor colorWithAlphaComponent:0.14]];
|
|
313
|
+
[pace[@"label"] drawInRect:NSInsetRect(pill, 9, 3) withAttributes:pillAttributes];
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
NSRect curveRect = NSMakeRect(trendX, NSMinY(card) + 62, 135, 38);
|
|
317
|
+
[self drawUsageCurve:points inRect:curveRect color:color];
|
|
318
|
+
double peak = 0;
|
|
319
|
+
for (NSDictionary *point in points) peak = fmax(peak, [point[@"used"] doubleValue]);
|
|
320
|
+
NSString *peakText = points.count > 0
|
|
321
|
+
? [NSString stringWithFormat:L(@"Max %.0f%%"), peak] : L(@"Max --");
|
|
322
|
+
NSString *currentText = currentUsed
|
|
323
|
+
? [NSString stringWithFormat:L(@"Now %.0f%%"), currentUsed.doubleValue] : L(@"Now --");
|
|
324
|
+
[peakText drawInRect:NSMakeRect(trendX, NSMinY(card) + 42 - 2 / QuotaScale, 72, 16)
|
|
325
|
+
withAttributes:[self textAttributesWithSize:10 color:secondary weight:NSFontWeightRegular]];
|
|
326
|
+
[currentText drawInRect:NSMakeRect(trendX + 66, NSMinY(card) + 42 - 2 / QuotaScale, 69, 16)
|
|
327
|
+
withAttributes:[self rightAlignedTextAttributesWithSize:10 color:secondary
|
|
328
|
+
weight:NSFontWeightRegular]];
|
|
329
|
+
// 与左边两列的"已用 Token"同一条基线(+22),也和 API 卡的脚注行对齐。
|
|
330
|
+
[self drawTip:paceTip inRect:NSMakeRect(trendX, NSMinY(card) + 22 - 2 / QuotaScale,
|
|
331
|
+
145, 18) color:tipColor];
|
|
332
|
+
[NSGraphicsContext restoreGraphicsState];
|
|
333
|
+
}
|
|
334
|
+
- (void)drawRect:(NSRect)dirtyRect {
|
|
335
|
+
[NSGraphicsContext saveGraphicsState];
|
|
336
|
+
NSAffineTransform *scale = [NSAffineTransform transform];
|
|
337
|
+
[scale scaleBy:QuotaScale];
|
|
338
|
+
[scale concat];
|
|
339
|
+
NSArray<NSString *> *visibleProviders = [self visibleProviders];
|
|
340
|
+
const CGFloat height = [self logicalHeight];
|
|
341
|
+
NSRect logicalBounds = NSMakeRect(0, 0, QuotaLogicalWidth, height);
|
|
342
|
+
NSRect outer = NSInsetRect(logicalBounds, 1, 1);
|
|
343
|
+
NSBezierPath *background = [NSBezierPath bezierPathWithRoundedRect:outer xRadius:24 yRadius:24];
|
|
344
|
+
// 原生玻璃按 13pt 圆角裁切整个面板;底色也铺满到同一圆角,否则玻璃边缘和
|
|
345
|
+
// 底色之间会露出一圈细缝。
|
|
346
|
+
if (self.usesLiquidGlass) {
|
|
347
|
+
CGFloat radius = 13 / QuotaScale;
|
|
348
|
+
background = [NSBezierPath bezierPathWithRoundedRect:logicalBounds
|
|
349
|
+
xRadius:radius yRadius:radius];
|
|
350
|
+
}
|
|
351
|
+
// 原生玻璃不铺底色:任何一层深色都会把 Clear 玻璃压回磨砂感。
|
|
352
|
+
if (!self.usesLiquidGlass) {
|
|
353
|
+
NSGradient *gradient = [[NSGradient alloc]
|
|
354
|
+
initWithStartingColor:[NSColor colorWithRed:0.025 green:0.055 blue:0.095 alpha:0.88]
|
|
355
|
+
endingColor:[NSColor colorWithRed:0.07 green:0.12 blue:0.19 alpha:0.80]];
|
|
356
|
+
[gradient drawInBezierPath:background angle:-20];
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// 原生玻璃自己绘制高光和边缘,不叠加经典主题的模拟反光。
|
|
360
|
+
if (!self.usesLiquidGlass) {
|
|
361
|
+
[NSGraphicsContext saveGraphicsState];
|
|
362
|
+
[background addClip];
|
|
363
|
+
NSGradient *topGlow = [[NSGradient alloc]
|
|
364
|
+
initWithStartingColor:[NSColor colorWithWhite:1 alpha:0.34]
|
|
365
|
+
endingColor:[NSColor colorWithWhite:1 alpha:0.0]];
|
|
366
|
+
// 两处光晕原本是按 H=590 定的绝对点。面板会变矮,改成跟着高度走:顶部光源始终悬在
|
|
367
|
+
// 面板上沿之外,冷色光晕落在内容区中段。
|
|
368
|
+
NSPoint topGlowCenter = NSMakePoint(700, height + 60);
|
|
369
|
+
[topGlow drawFromCenter:topGlowCenter radius:0
|
|
370
|
+
toCenter:topGlowCenter radius:250 options:0];
|
|
371
|
+
NSGradient *cyanGlow = [[NSGradient alloc]
|
|
372
|
+
initWithStartingColor:[NSColor colorWithRed:0.18 green:0.72 blue:1 alpha:0.11]
|
|
373
|
+
endingColor:[NSColor colorWithRed:0.18 green:0.88 blue:1 alpha:0.0]];
|
|
374
|
+
NSPoint cyanGlowCenter = NSMakePoint(660, height * 0.42);
|
|
375
|
+
[cyanGlow drawFromCenter:cyanGlowCenter radius:0
|
|
376
|
+
toCenter:cyanGlowCenter radius:260 options:0];
|
|
377
|
+
[NSGraphicsContext restoreGraphicsState];
|
|
378
|
+
|
|
379
|
+
[[NSColor colorWithWhite:1 alpha:0.34] setStroke];
|
|
380
|
+
background.lineWidth = 1.5;
|
|
381
|
+
[background stroke];
|
|
382
|
+
NSBezierPath *innerGlassBorder = [NSBezierPath bezierPathWithRoundedRect:NSInsetRect(outer, 2, 2)
|
|
383
|
+
xRadius:22 yRadius:22];
|
|
384
|
+
[[NSColor colorWithRed:0.58 green:0.82 blue:1 alpha:0.22] setStroke];
|
|
385
|
+
innerGlassBorder.lineWidth = 0.8;
|
|
386
|
+
[innerGlassBorder stroke];
|
|
387
|
+
}
|
|
388
|
+
// 玻璃底下可能是任意亮度的壁纸,除了玻璃背后的压暗层,再给白字加一层很淡的投影托底。
|
|
389
|
+
if (self.usesLiquidGlass) {
|
|
390
|
+
NSShadow *legibility = [NSShadow new];
|
|
391
|
+
legibility.shadowColor = [NSColor colorWithWhite:0 alpha:0.4];
|
|
392
|
+
legibility.shadowBlurRadius = 2;
|
|
393
|
+
legibility.shadowOffset = NSMakeSize(0, -0.5);
|
|
394
|
+
[legibility set];
|
|
395
|
+
}
|
|
396
|
+
NSColor *primary = self.primaryColor;
|
|
397
|
+
NSColor *secondary = self.secondaryColor;
|
|
398
|
+
NSColor *cyan = self.accentColor;
|
|
399
|
+
NSColor *agentColor = self.agentStatusColor;
|
|
400
|
+
[@"Agent Usage" drawInRect:NSMakeRect(28, height - 65, 260, 42)
|
|
401
|
+
withAttributes:[self textAttributesWithSize:30 color:primary weight:NSFontWeightBold]];
|
|
402
|
+
NSDictionary *liveStatusAttributes = [self textAttributesWithSize:14 color:secondary
|
|
403
|
+
weight:NSFontWeightRegular];
|
|
404
|
+
NSString *liveStatusText = L(@"Live status");
|
|
405
|
+
[liveStatusText drawInRect:NSMakeRect(30, height - 94, 142, 22)
|
|
406
|
+
withAttributes:liveStatusAttributes];
|
|
407
|
+
CGFloat agentIndicatorX = 30 + [liveStatusText sizeWithAttributes:liveStatusAttributes].width + 12;
|
|
408
|
+
[agentColor setFill];
|
|
409
|
+
[[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(agentIndicatorX, height - 88, 9, 9)] fill];
|
|
410
|
+
NSString *agentText = self.activeAgentCount > 0
|
|
411
|
+
? [NSString stringWithFormat:self.activeAgentCount != 1 ? L(@"%ld Agents online")
|
|
412
|
+
: L(@"%ld Agent online"), (long)self.activeAgentCount]
|
|
413
|
+
: L(@"No Agents online");
|
|
414
|
+
[agentText drawInRect:NSMakeRect(agentIndicatorX + 16, height - 95, 160, 22)
|
|
415
|
+
withAttributes:[self textAttributesWithSize:14 color:agentColor weight:NSFontWeightMedium]];
|
|
416
|
+
[self drawSystemMetricsEndingAtX:QuotaLogicalWidth - 28 y:height - 95];
|
|
417
|
+
|
|
418
|
+
// 用量由定时器自动刷新,面板不再提供手动刷新按钮;右上角只留上次刷新的时间,
|
|
419
|
+
// 与下一行的系统指标右边对齐。放回汇总条里会挤掉一整格 Provider 数据。
|
|
420
|
+
[[NSString stringWithFormat:L(@"Updated %@"), [self refreshAgeText]]
|
|
421
|
+
drawInRect:NSMakeRect(QuotaLogicalWidth - 28 - 200, height - 45, 200, 18)
|
|
422
|
+
withAttributes:[self rightAlignedTextAttributesWithSize:11 color:secondary
|
|
423
|
+
weight:NSFontWeightRegular]];
|
|
424
|
+
|
|
425
|
+
if (visibleProviders.count > 0) {
|
|
426
|
+
[self drawSummaryForProviders:visibleProviders primary:primary secondary:secondary
|
|
427
|
+
accent:cyan];
|
|
428
|
+
}
|
|
429
|
+
NSDictionary *cardSpecs = @{
|
|
430
|
+
@"Codex": @{@"usage": [self usageForProvider:@"Codex"], @"usedKey": @"used_percent",
|
|
431
|
+
@"color": cyan},
|
|
432
|
+
@"Claude": @{@"usage": [self usageForProvider:@"Claude"], @"usedKey": @"used_percentage",
|
|
433
|
+
@"color": self.claudeColor}
|
|
434
|
+
};
|
|
435
|
+
// 卡片从汇总条下方依次向下排;原脚注空间按可见卡片数平分。这里的分段账必须和
|
|
436
|
+
// QuotaLogicalHeightForProviderCount 完全一致,否则面板会多出或少掉一段空白。
|
|
437
|
+
CGFloat cardTop = height - QuotaHeaderHeight - QuotaSummaryHeight;
|
|
438
|
+
CGFloat cardHeight = QuotaCardHeightForProviderCount(visibleProviders.count);
|
|
439
|
+
for (NSString *name in visibleProviders) {
|
|
440
|
+
NSDictionary *spec = cardSpecs[name];
|
|
441
|
+
cardTop -= QuotaBlockGap;
|
|
442
|
+
NSArray<NSDictionary *> *profiles = [self profilesForProvider:name];
|
|
443
|
+
NSRect cardRect = NSMakeRect(20, cardTop - cardHeight,
|
|
444
|
+
QuotaLogicalWidth - 40, cardHeight);
|
|
445
|
+
BOOL animating = [self.animatingCarouselProvider isEqualToString:name];
|
|
446
|
+
if (animating) {
|
|
447
|
+
NSTimeInterval elapsed = NSDate.date.timeIntervalSince1970 - self.carouselAnimationStartedAt;
|
|
448
|
+
CGFloat progress = fmax(0, fmin(1, elapsed / 0.20));
|
|
449
|
+
CGFloat eased = 1 - pow(1 - progress, 3);
|
|
450
|
+
[NSGraphicsContext saveGraphicsState];
|
|
451
|
+
[[NSBezierPath bezierPathWithRect:NSInsetRect(cardRect, -20, 0)] addClip];
|
|
452
|
+
CGContextSetAlpha(NSGraphicsContext.currentContext.CGContext, 0.45 + 0.55 * eased);
|
|
453
|
+
NSAffineTransform *transform = [NSAffineTransform transform];
|
|
454
|
+
[transform translateXBy:self.carouselAnimationDirection * (1 - eased) * 48 yBy:0];
|
|
455
|
+
[transform concat];
|
|
456
|
+
}
|
|
457
|
+
[self drawProvider:name displayName:[self displayNameForProvider:name]
|
|
458
|
+
usage:spec[@"usage"] usedKey:spec[@"usedKey"] color:spec[@"color"]
|
|
459
|
+
cardRect:cardRect
|
|
460
|
+
profileCount:profiles.count selectedIndex:[self selectedIndexForProvider:name]];
|
|
461
|
+
if (animating) [NSGraphicsContext restoreGraphicsState];
|
|
462
|
+
cardTop -= cardHeight;
|
|
463
|
+
}
|
|
464
|
+
if (visibleProviders.count == 0) {
|
|
465
|
+
// 官方 Home 自动发现;自定义 Home 必须由用户明确选择,不能扫描接管。
|
|
466
|
+
CGFloat noticeTop = height - QuotaHeaderHeight;
|
|
467
|
+
[L(@"No Agent accounts detected") drawInRect:NSMakeRect(28, noticeTop - 30, 460, 26)
|
|
468
|
+
withAttributes:[self textAttributesWithSize:17 color:primary weight:NSFontWeightMedium]];
|
|
469
|
+
[L(@"Official Homes appear automatically")
|
|
470
|
+
drawInRect:NSMakeRect(28, noticeTop - 52, 560, 20)
|
|
471
|
+
withAttributes:[self textAttributesWithSize:12 color:secondary weight:NSFontWeightRegular]];
|
|
472
|
+
[L(@"Add custom Homes from Multi-Account in the Main menu")
|
|
473
|
+
drawInRect:NSMakeRect(28, noticeTop - 72, 560, 18)
|
|
474
|
+
withAttributes:[self textAttributesWithSize:11
|
|
475
|
+
color:[NSColor colorWithWhite:0.52 alpha:1] weight:NSFontWeightRegular]];
|
|
476
|
+
}
|
|
477
|
+
[NSGraphicsContext restoreGraphicsState];
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// 今日与最近 7 天都按 Provider 分开展示。底层本来就是两套独立的自然日统计,
|
|
481
|
+
// 不在展示层相加,避免用户无法判断 Token 来自 Codex 还是 Claude。
|
|
482
|
+
// 每格内是一张 2×2 表:标题独占一行,每个 Provider 独占一行;输入/输出标签放在
|
|
483
|
+
// 对应数值上方。这样既能完整展示 7 天统计起期,也不会挤乱两家的数据行。
|
|
484
|
+
- (void)drawSummaryForProviders:(NSArray<NSString *> *)providers primary:(NSColor *)primary
|
|
485
|
+
secondary:(NSColor *)secondary accent:(NSColor *)cyan {
|
|
486
|
+
NSRect summary = [self logicalSummaryRect];
|
|
487
|
+
NSBezierPath *summaryPath = [NSBezierPath bezierPathWithRoundedRect:summary xRadius:18 yRadius:18];
|
|
488
|
+
if (self.usesLiquidGlass) {
|
|
489
|
+
[self fillLiquidScrim:summaryPath];
|
|
490
|
+
} else {
|
|
491
|
+
[[NSColor colorWithWhite:1 alpha:0.065] setFill];
|
|
492
|
+
[summaryPath fill];
|
|
493
|
+
}
|
|
494
|
+
[[NSColor colorWithWhite:1 alpha:self.usesLiquidGlass ? 0.10 : 0.16] setStroke];
|
|
495
|
+
[summaryPath stroke];
|
|
496
|
+
|
|
497
|
+
NSArray<NSDictionary *> *cells = @[
|
|
498
|
+
@{@"icon": @"◔", @"headerSymbol": @"calendar", @"key": @"today",
|
|
499
|
+
@"label": L(@"Today")},
|
|
500
|
+
@{@"icon": @"◉", @"headerSymbol": @"calendar.badge.clock", @"key": @"recentWeek",
|
|
501
|
+
@"label": [self recentWeekUsageLabel]}
|
|
502
|
+
];
|
|
503
|
+
BOOL hasMultipleAccounts = [self profilesForProvider:@"Codex"].count > 1 ||
|
|
504
|
+
[self profilesForProvider:@"Claude"].count > 1;
|
|
505
|
+
NSDictionary *rowSpecs = @{
|
|
506
|
+
@"Codex": @{@"usage": [self summaryUsageForProvider:@"Codex"], @"color": cyan},
|
|
507
|
+
@"Claude": @{@"usage": [self summaryUsageForProvider:@"Claude"],
|
|
508
|
+
@"color": self.claudeColor}
|
|
509
|
+
};
|
|
510
|
+
// 两行版的槽位是写死的。只装了一家时改用居中的单行槽位,否则汇总条会空出半格,
|
|
511
|
+
// 看着像数据没加载出来。
|
|
512
|
+
NSArray<NSDictionary *> *slots = providers.count == 1
|
|
513
|
+
? @[@{@"iconY": @24, @"nameY": @33, @"labelY": @49, @"valueY": @28}]
|
|
514
|
+
: @[@{@"iconY": @43, @"nameY": @52, @"labelY": @68, @"valueY": @47},
|
|
515
|
+
@{@"iconY": @5, @"nameY": @14, @"labelY": @30, @"valueY": @9}];
|
|
516
|
+
NSMutableArray<NSDictionary *> *rows = [NSMutableArray array];
|
|
517
|
+
for (NSUInteger index = 0; index < providers.count && index < slots.count; index++) {
|
|
518
|
+
NSMutableDictionary *row = [slots[index] mutableCopy];
|
|
519
|
+
[row addEntriesFromDictionary:rowSpecs[providers[index]]];
|
|
520
|
+
row[@"name"] = providers[index];
|
|
521
|
+
[rows addObject:row];
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
[[NSColor colorWithWhite:1 alpha:0.10] setStroke];
|
|
525
|
+
for (NSUInteger index = 1; index < cells.count; index++) {
|
|
526
|
+
CGFloat x = NSMinX([self logicalSummaryCellRectAtIndex:index]);
|
|
527
|
+
[NSBezierPath strokeLineFromPoint:NSMakePoint(x, NSMinY(summary) + 16)
|
|
528
|
+
toPoint:NSMakePoint(x, NSMaxY(summary) - 16)];
|
|
529
|
+
}
|
|
530
|
+
for (NSUInteger index = 0; index < cells.count; index++) {
|
|
531
|
+
NSDictionary *cell = cells[index];
|
|
532
|
+
NSString *key = cell[@"key"];
|
|
533
|
+
CGFloat x = NSMinX([self logicalSummaryCellRectAtIndex:index]);
|
|
534
|
+
const CGFloat inputX = x + 176;
|
|
535
|
+
const CGFloat outputX = x + 276;
|
|
536
|
+
NSFont *headerFont = [self fontWithSize:11 weight:NSFontWeightRegular];
|
|
537
|
+
NSDictionary *headerAttributes = @{NSFontAttributeName: headerFont,
|
|
538
|
+
NSForegroundColorAttributeName: [self textColor:secondary]};
|
|
539
|
+
NSDictionary *titleAttributes = @{NSFontAttributeName:
|
|
540
|
+
[self fontWithSize:11 weight:NSFontWeightBold],
|
|
541
|
+
NSForegroundColorAttributeName: [self textColor:secondary]};
|
|
542
|
+
NSImage *headerIcon = [NSImage imageWithSystemSymbolName:cell[@"headerSymbol"]
|
|
543
|
+
accessibilityDescription:cell[@"label"]];
|
|
544
|
+
NSImageSymbolConfiguration *headerIconConfiguration =
|
|
545
|
+
[NSImageSymbolConfiguration configurationWithPointSize:11
|
|
546
|
+
weight:NSFontWeightRegular];
|
|
547
|
+
headerIconConfiguration = [headerIconConfiguration configurationByApplyingConfiguration:
|
|
548
|
+
[NSImageSymbolConfiguration configurationWithHierarchicalColor:secondary]];
|
|
549
|
+
headerIcon = [headerIcon imageWithSymbolConfiguration:headerIconConfiguration];
|
|
550
|
+
NSTextAttachment *headerAttachment = [NSTextAttachment new];
|
|
551
|
+
headerAttachment.image = headerIcon;
|
|
552
|
+
const CGFloat headerIconSize = 13;
|
|
553
|
+
headerAttachment.bounds = NSMakeRect(0,
|
|
554
|
+
(headerFont.capHeight - headerIconSize) / 2.0, headerIconSize, headerIconSize);
|
|
555
|
+
NSMutableAttributedString *header = [[NSMutableAttributedString alloc]
|
|
556
|
+
initWithAttributedString:[NSAttributedString
|
|
557
|
+
attributedStringWithAttachment:headerAttachment]];
|
|
558
|
+
[header appendAttributedString:[[NSAttributedString alloc]
|
|
559
|
+
initWithString:@" " attributes:headerAttributes]];
|
|
560
|
+
[header appendAttributedString:[[NSAttributedString alloc]
|
|
561
|
+
initWithString:cell[@"label"] attributes:titleAttributes]];
|
|
562
|
+
[header drawInRect:NSMakeRect(x + 24, NSMinY(summary) + 89,
|
|
563
|
+
NSWidth([self logicalSummaryCellRectAtIndex:index]) - 48, 18)];
|
|
564
|
+
if (hasMultipleAccounts) {
|
|
565
|
+
[L(@"All accounts") drawInRect:NSMakeRect(x + 230, NSMinY(summary) + 89, 120, 18)
|
|
566
|
+
withAttributes:[self rightAlignedTextAttributesWithSize:10 color:secondary
|
|
567
|
+
weight:NSFontWeightRegular]];
|
|
568
|
+
}
|
|
569
|
+
for (NSDictionary *row in rows) {
|
|
570
|
+
NSDictionary *usage = row[@"usage"];
|
|
571
|
+
NSColor *rowColor = row[@"color"];
|
|
572
|
+
CGFloat iconY = NSMinY(summary) + [row[@"iconY"] doubleValue];
|
|
573
|
+
CGFloat nameY = NSMinY(summary) + [row[@"nameY"] doubleValue];
|
|
574
|
+
CGFloat labelY = NSMinY(summary) + [row[@"labelY"] doubleValue];
|
|
575
|
+
if (CCPetsLanguageIsSource()) labelY += 2 / QuotaScale;
|
|
576
|
+
CGFloat valueY = NSMinY(summary) + [row[@"valueY"] doubleValue];
|
|
577
|
+
// 这是图标字形不是文字,原生玻璃下也保留颜色:它负责标出这一行是哪一家。
|
|
578
|
+
[cell[@"icon"] drawInRect:NSMakeRect(x + 20, iconY, 42, 42)
|
|
579
|
+
withAttributes:@{NSFontAttributeName: [NSFont systemFontOfSize:30
|
|
580
|
+
weight:NSFontWeightRegular], NSForegroundColorAttributeName: rowColor}];
|
|
581
|
+
[row[@"name"] drawInRect:NSMakeRect(x + 66, nameY, 76, 22)
|
|
582
|
+
withAttributes:[self textAttributesWithSize:14 color:rowColor
|
|
583
|
+
weight:NSFontWeightMedium]];
|
|
584
|
+
[L(@"Input") drawInRect:NSMakeRect(inputX, labelY, 76, 16)
|
|
585
|
+
withAttributes:headerAttributes];
|
|
586
|
+
[L(@"Output") drawInRect:NSMakeRect(outputX, labelY, 76, 16)
|
|
587
|
+
withAttributes:headerAttributes];
|
|
588
|
+
NSDictionary *valueAttributes = [self textAttributesWithSize:16 color:primary
|
|
589
|
+
weight:NSFontWeightBold];
|
|
590
|
+
[[self formattedTokenSplitForUsage:usage key:key wantsOutput:NO]
|
|
591
|
+
drawInRect:NSMakeRect(inputX, valueY, 86, 23) withAttributes:valueAttributes];
|
|
592
|
+
[[self formattedTokenSplitForUsage:usage key:key wantsOutput:YES]
|
|
593
|
+
drawInRect:NSMakeRect(outputX, valueY, 76, 23) withAttributes:valueAttributes];
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
}
|
|
598
|
+
@end
|
|
@@ -15,12 +15,21 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName);
|
|
|
15
15
|
@property CGFloat cardScrimAlpha;
|
|
16
16
|
@property NSDictionary *codexUsage;
|
|
17
17
|
@property NSDictionary *claudeUsage;
|
|
18
|
+
@property NSArray<NSDictionary *> *profiles;
|
|
19
|
+
@property NSDictionary<NSString *, NSDictionary *> *profileUsages;
|
|
20
|
+
@property NSDictionary<NSString *, NSArray<NSDictionary *> *> *profileHistories;
|
|
18
21
|
@property NSArray<NSDictionary *> *codexHistory;
|
|
19
22
|
@property NSArray<NSDictionary *> *claudeHistory;
|
|
20
23
|
@property NSInteger activeAgentCount;
|
|
21
24
|
// 仍在运行的客户端所属的 provider("Codex" / "Claude")。卡片的在线徽章据此判定,
|
|
22
25
|
// 而不是看有没有额度数据——额度会一直缓存着,拿它当在线信号会恒亮。
|
|
23
26
|
@property NSSet<NSString *> *liveProviders;
|
|
27
|
+
// Hook 能提供 profileId 时优先按账号显示在线状态;老会话没有 profileId 时仍退回 provider。
|
|
28
|
+
@property NSSet<NSString *> *liveProfileIDs;
|
|
29
|
+
// 仍在线但旧事件没有 profileId 的 provider;无法精确归属时避免把账号卡误判为离线。
|
|
30
|
+
@property NSSet<NSString *> *liveUnscopedProviders;
|
|
31
|
+
@property NSSet<NSString *> *pendingApprovalProfileIDs;
|
|
32
|
+
@property NSSet<NSString *> *bridgeActivityProfileIDs;
|
|
24
33
|
// 老版本包装脚本写出的 pid 文件没有 provider 名。有这种客户端时无法断言某一家离线。
|
|
25
34
|
@property BOOL hasUnlabeledClient;
|
|
26
35
|
// 这台机器上检测到的 provider("Codex" / "Claude")。决定渲染几张额度卡、面板多高。
|
|
@@ -39,6 +48,14 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName);
|
|
|
39
48
|
@property BOOL codexShowsAPIUsage;
|
|
40
49
|
@property BOOL claudeShowsAPIUsage;
|
|
41
50
|
- (BOOL)isProviderOnline:(NSString *)name;
|
|
51
|
+
- (NSDictionary *)selectedProfileForProvider:(NSString *)name;
|
|
52
|
+
- (NSDictionary *)usageForProvider:(NSString *)name;
|
|
53
|
+
// 指定账号的独立快照,不改变悬停面板的轮播选择;概览复用同一份账号数据。
|
|
54
|
+
- (NSDictionary *)accountSnapshotForProvider:(NSString *)name profile:(NSDictionary *)profile;
|
|
55
|
+
// 本周额度的节奏判断,主窗口概览页的额度卡和面板用同一份。返回 label、tip、color,
|
|
56
|
+
// 有数据时还有 level(0 充足 / 1 平稳 / 2 需关注 / 3 高风险)。
|
|
57
|
+
- (NSDictionary *)paceStatusForQuota:(NSDictionary *)quota currentUsed:(NSNumber *)currentUsed
|
|
58
|
+
color:(NSColor *)providerColor;
|
|
42
59
|
@property NSImage *codexLogo;
|
|
43
60
|
@property NSImage *claudeLogo;
|
|
44
61
|
@property(copy) void (^hoverChanged)(BOOL hovering);
|