cc-pets 1.2.8 → 1.3.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.
@@ -4,6 +4,24 @@ const CGFloat QuotaLogicalWidth = 760;
4
4
  const CGFloat QuotaLogicalHeight = 590;
5
5
  const CGFloat QuotaScale = 0.58;
6
6
 
7
+ // 面板高度按"检测到几家 CLI"变化,所以纵向布局不再是一堆绝对坐标,而是自上而下的分段:
8
+ // 标题区 → 汇总条 → N × 额度卡 → 脚注区,块之间统一留 QuotaBlockGap。
9
+ // QuotaLogicalHeight 保留为两家都装时的高度(590),既是历史默认值,也是预览图尺寸。
10
+ static const CGFloat QuotaHeaderHeight = 106;
11
+ static const CGFloat QuotaSummaryHeight = 112;
12
+ static const CGFloat QuotaCardHeight = 152;
13
+ static const CGFloat QuotaBlockGap = 12;
14
+ static const CGFloat QuotaFooterHeight = 44;
15
+ // 两家都没装时的精简态:只留标题区、三行说明和脚注,汇总条和额度卡整块去掉——
16
+ // 没有 provider 的"今日用量/近 7 天"是两行 0,比不显示更让人以为是坏了。
17
+ static const CGFloat QuotaEmptyNoticeHeight = 76;
18
+
19
+ CGFloat QuotaLogicalHeightForProviderCount(NSUInteger count) {
20
+ if (count == 0) return QuotaHeaderHeight + QuotaEmptyNoticeHeight + QuotaFooterHeight;
21
+ return QuotaHeaderHeight + QuotaSummaryHeight +
22
+ count * (QuotaBlockGap + QuotaCardHeight) + QuotaFooterHeight;
23
+ }
24
+
7
25
  NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
8
26
  NSURL *appURL = [NSWorkspace.sharedWorkspace URLForApplicationWithBundleIdentifier:bundleIdentifier];
9
27
  NSMutableArray<NSString *> *paths = [NSMutableArray array];
@@ -48,14 +66,29 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
48
66
  self.needsDisplay = YES;
49
67
  if (self.hoverChanged) self.hoverChanged(NO);
50
68
  }
51
- - (NSRect)logicalRefreshRect { return NSMakeRect(QuotaLogicalWidth - 54, QuotaLogicalHeight - 52, 34, 32); }
69
+ // detectedProviders 未赋值时按"两家都有"渲染。这是刻意的兜底:探测是 App 侧的额外信号,
70
+ // 拿不到时宁可多画一张卡,也不要让有额度的用户看不到自己的卡片。
71
+ - (NSArray<NSString *> *)visibleProviders {
72
+ NSArray<NSString *> *order = @[@"Codex", @"Claude"];
73
+ if (!self.detectedProviders) return order;
74
+ NSMutableArray<NSString *> *visible = [NSMutableArray array];
75
+ for (NSString *name in order) {
76
+ if ([self.detectedProviders containsObject:name]) [visible addObject:name];
77
+ }
78
+ return visible;
79
+ }
80
+ - (CGFloat)logicalHeight {
81
+ return QuotaLogicalHeightForProviderCount([self visibleProviders].count);
82
+ }
83
+ - (NSRect)logicalRefreshRect { return NSMakeRect(QuotaLogicalWidth - 54, [self logicalHeight] - 52, 34, 32); }
52
84
  - (NSRect)refreshRect {
53
85
  NSRect logical = [self logicalRefreshRect];
54
86
  return NSMakeRect(logical.origin.x * QuotaScale, logical.origin.y * QuotaScale,
55
87
  logical.size.width * QuotaScale, logical.size.height * QuotaScale);
56
88
  }
57
89
  - (NSRect)logicalSummaryRect {
58
- return NSMakeRect(20, 372, QuotaLogicalWidth - 40, 112);
90
+ return NSMakeRect(20, [self logicalHeight] - QuotaHeaderHeight - QuotaSummaryHeight,
91
+ QuotaLogicalWidth - 40, QuotaSummaryHeight);
59
92
  }
60
93
  // 刷新时间挪去了右上角,这一版块整宽留给两个统计格,各占一半。
61
94
  - (NSRect)logicalSummaryCellRectAtIndex:(NSUInteger)index {
@@ -119,6 +152,25 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
119
152
  ? totals[@"total_tokens"] : nil;
120
153
  return number ? [self formattedTokenValue:number.doubleValue] : @"--";
121
154
  }
155
+ - (NSString *)formattedRequestCount:(NSDictionary *)totals {
156
+ NSNumber *number = [totals[@"request_count"] isKindOfClass:NSNumber.class]
157
+ ? totals[@"request_count"] : nil;
158
+ return number ? [NSNumberFormatter localizedStringFromNumber:number
159
+ numberStyle:NSNumberFormatterDecimalStyle] : @"--";
160
+ }
161
+ - (NSDictionary *)comparisonForCurrent:(double)current previous:(double)previous
162
+ color:(NSColor *)color {
163
+ if (previous <= 0) {
164
+ return @{ @"text": current > 0 ? @"较上月同期 新增" : @"较上月同期 持平",
165
+ @"color": current > 0 ? color : self.secondaryColor };
166
+ }
167
+ double change = (current - previous) * 100.0 / previous;
168
+ if (fabs(change) < 0.05) {
169
+ return @{ @"text": @"较上月同期 持平", @"color": self.secondaryColor };
170
+ }
171
+ return @{ @"text": [NSString stringWithFormat:@"较上月同期 %@%.1f%%",
172
+ change > 0 ? @"↑" : @"↓", fabs(change)], @"color": color };
173
+ }
122
174
  // 输入取 total - output,而不是把几个 input_* 字段加起来:两家的包含关系是相反的。
123
175
  // Codex 的 cached_input_tokens 是 input_tokens 的子集(实测 input+output == total),
124
176
  // 相加会把缓存部分算两遍;Claude 的 input_tokens 不含缓存读写,两者是并列项,不加又会漏。
@@ -294,6 +346,10 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
294
346
  }
295
347
  - (NSArray<NSDictionary *> *)curvePointsFromHistory:(NSArray<NSDictionary *> *)history
296
348
  currentUsed:(NSNumber *)currentUsed {
349
+ // 历史只能补充当前快照,不能替代当前快照。当前窗口还没有采集到额度时继续画旧历史,
350
+ // 会让“等待数据”的卡片同时出现一条悬在中间的曲线;此时只保留图表底部基线。
351
+ if (!currentUsed) return @[];
352
+
297
353
  NSTimeInterval now = NSDate.date.timeIntervalSince1970;
298
354
  NSTimeInterval cutoff = now - 7 * 24 * 60 * 60;
299
355
  NSMutableArray<NSDictionary *> *points = [NSMutableArray array];
@@ -309,9 +365,7 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
309
365
  }
310
366
  // 终点必须和卡片上的当前官方额度同源;历史落盘最多会慢 15 分钟,不能直接拿它
311
367
  // 冒充“当前”,否则同一张卡里会出现两个不同百分比。
312
- if (currentUsed) {
313
- [points addObject:@{@"timestamp": @(now), @"used": currentUsed}];
314
- }
368
+ [points addObject:@{@"timestamp": @(now), @"used": currentUsed}];
315
369
  return points;
316
370
  }
317
371
  - (void)appendCurveFromPoint:(NSPoint)from toPoint:(NSPoint)to path:(NSBezierPath *)path {
@@ -371,6 +425,37 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
371
425
  }
372
426
  [self drawCurveSegment:allPoints inRect:rect color:color];
373
427
  }
428
+ - (void)drawMonthlyTokenCurve:(NSArray<NSDictionary *> *)series inRect:(NSRect)rect
429
+ color:(NSColor *)color {
430
+ [[NSColor colorWithWhite:1 alpha:0.08] setStroke];
431
+ [NSBezierPath strokeLineFromPoint:NSMakePoint(NSMinX(rect), NSMinY(rect))
432
+ toPoint:NSMakePoint(NSMaxX(rect), NSMinY(rect))];
433
+ if (series.count == 0) return;
434
+ // 横轴铺满整个自然月,曲线只画到今天:把月末还没到的日子当成 0 画出去,看起来会像
435
+ // 用量突然归零。留白本身就是"这个月还剩多少天"的刻度。
436
+ NSTimeInterval now = NSDate.date.timeIntervalSince1970;
437
+ double peak = 0;
438
+ NSUInteger elapsed = 0;
439
+ for (NSDictionary *day in series) {
440
+ if ([day[@"timestamp"] doubleValue] > now) break;
441
+ NSDictionary *totals = [day[@"totals"] isKindOfClass:NSDictionary.class]
442
+ ? day[@"totals"] : nil;
443
+ peak = fmax(peak, [totals[@"total_tokens"] doubleValue]);
444
+ elapsed += 1;
445
+ }
446
+ if (peak <= 0 || elapsed == 0) return;
447
+ NSMutableArray<NSValue *> *points = [NSMutableArray arrayWithCapacity:elapsed];
448
+ for (NSUInteger index = 0; index < elapsed; index++) {
449
+ NSDictionary *totals = [series[index][@"totals"] isKindOfClass:NSDictionary.class]
450
+ ? series[index][@"totals"] : nil;
451
+ double value = [totals[@"total_tokens"] doubleValue];
452
+ CGFloat progress = series.count > 1 ? (CGFloat)index / (series.count - 1) : 1;
453
+ [points addObject:[NSValue valueWithPoint:NSMakePoint(
454
+ NSMinX(rect) + NSWidth(rect) * progress,
455
+ NSMinY(rect) + NSHeight(rect) * value / peak)]];
456
+ }
457
+ [self drawCurveSegment:points inRect:rect color:color];
458
+ }
374
459
  - (NSDictionary *)paceStatusForQuota:(NSDictionary *)quota currentUsed:(NSNumber *)currentUsed
375
460
  color:(NSColor *)providerColor {
376
461
  if (!currentUsed) {
@@ -385,37 +470,65 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
385
470
  NSTimeInterval elapsed = now - start;
386
471
  double projectedRemaining = NAN;
387
472
  const NSTimeInterval paceObservationSeconds = 24 * 60 * 60;
473
+ // 满 24 小时就全额外推的话,放大倍数还有 7 倍:窗口第 25 小时,任何已用超过 14.3%
474
+ // 的用户都会被判成"重置前用尽"。更糟的是两家的窗口起点差几个小时,就会出现一家
475
+ // 已外推、另一家还没到门槛的断层——剩 80% 的报高风险,剩 61% 的却显示平稳。
476
+ // 因此在 24 小时到窗口 1/3(56 小时)之间按观测时长加权,从"按当前已用"平滑过渡
477
+ // 到"完全信任外推",门槛处不再有跳变。
478
+ const NSTimeInterval paceFullTrustSeconds = sevenDaySeconds / 3.0;
388
479
  if (reset && reset.doubleValue > now && elapsed >= paceObservationSeconds) {
389
- double projectedUsed = currentUsed.doubleValue * sevenDaySeconds / elapsed;
480
+ double linearUsed = currentUsed.doubleValue * sevenDaySeconds / elapsed;
481
+ double confidence = fmin(1.0, (elapsed - paceObservationSeconds) /
482
+ (paceFullTrustSeconds - paceObservationSeconds));
483
+ double projectedUsed = currentUsed.doubleValue +
484
+ (linearUsed - currentUsed.doubleValue) * confidence;
390
485
  projectedRemaining = 100.0 - projectedUsed;
391
486
  }
392
487
 
488
+ // 四个档位从轻到重排成阶梯,后面的仲裁只在这上面挪档位,不再各写一套 label/tip/color。
393
489
  double remaining = 100.0 - currentUsed.doubleValue;
394
- NSString *label = remaining >= 70 ? @"充足"
395
- : (remaining >= 40 ? @"平稳" : (remaining >= 15 ? @"需关注" : @"高风险"));
396
- NSString *tip = remaining >= 70 ? @"当前额度余量充足"
397
- : (remaining >= 40 ? @"当前额度余量平稳"
398
- : (remaining >= 15 ? @"建议关注额度余量" : @"当前额度余量较低"));
399
- NSColor *statusColor = remaining >= 70 ? NSColor.systemGreenColor
400
- : (remaining >= 40 ? providerColor
401
- : (remaining >= 15 ? NSColor.systemOrangeColor : NSColor.systemRedColor));
402
- // 当前窗口开始满 24 小时后再按消耗节奏预测。此前只看真实剩余额度,避免把
403
- // 开窗头几个小时的突发任务线性外推到整整 7 天,造成“高风险”误报。
404
- if (!isnan(projectedRemaining) &&
405
- (remaining <= 5 || projectedRemaining < 0)) {
406
- label = @"高风险";
407
- tip = @"预计重置前额度用尽";
408
- statusColor = NSColor.systemRedColor;
409
- } else if (!isnan(projectedRemaining) && projectedRemaining < 10) {
410
- label = @"需关注";
411
- tip = @"建议减少高消耗任务";
412
- statusColor = NSColor.systemOrangeColor;
413
- } else if (!isnan(projectedRemaining) && projectedRemaining >= 30) {
414
- label = @"充足";
415
- tip = @"按当前节奏额度充足";
416
- statusColor = NSColor.systemGreenColor;
417
- }
418
- return @{@"label": label, @"tip": tip, @"color": statusColor};
490
+ NSArray<NSArray *> *ladder = @[
491
+ @[@"充足", @"当前额度余量充足", NSColor.systemGreenColor],
492
+ @[@"平稳", @"当前额度余量平稳", providerColor],
493
+ @[@"需关注", @"建议关注额度余量", NSColor.systemOrangeColor],
494
+ @[@"高风险", @"当前额度余量较低", NSColor.systemRedColor]
495
+ ];
496
+ NSUInteger baseRank = remaining >= 70 ? 0
497
+ : (remaining >= 40 ? 1 : (remaining >= 15 ? 2 : 3));
498
+
499
+ // 当前窗口开始满 24 小时后才按消耗节奏预测;此前 projectedRemaining 是 NAN,只看事实。
500
+ NSInteger projectedRank = -1;
501
+ NSString *projectedTip = nil;
502
+ if (!isnan(projectedRemaining)) {
503
+ if (remaining <= 5 || projectedRemaining < 0) {
504
+ projectedRank = 3;
505
+ projectedTip = @"预计重置前额度用尽";
506
+ } else if (projectedRemaining < 10) {
507
+ projectedRank = 2;
508
+ projectedTip = @"建议减少高消耗任务";
509
+ } else if (projectedRemaining >= 30) {
510
+ projectedRank = 0;
511
+ projectedTip = @"按当前节奏额度充足";
512
+ }
513
+ }
514
+
515
+ // 仲裁:有预测就以预测为准,但事实划两条不可逾越的线。预测是关于未来的猜测,
516
+ // 剩余额度是此刻的事实;让猜测把事实盖掉,两个方向都会出错——
517
+ // 剩 80% 被外推成"高风险"是虚惊,剩 10% 被外推成"需关注"是漏报,后者更危险。
518
+ NSUInteger rank = projectedRank >= 0 ? (NSUInteger)projectedRank : baseRank;
519
+ BOOL demotedByFact = NO;
520
+ if (remaining < 15) rank = 3; // 只剩一成,再乐观的预测也压不下来
521
+ else if (remaining < 40 && rank < 1) rank = 1; // 不到四成就别标"充足"
522
+ if (remaining >= 70 && rank > 2) { // 还有七成,再难看的预测也不报"高风险"
523
+ rank = 2;
524
+ demotedByFact = YES;
525
+ }
526
+
527
+ NSString *label = ladder[rank][0];
528
+ NSString *tip = ladder[rank][1];
529
+ if (demotedByFact) tip = @"消耗偏快,注意节奏";
530
+ else if (projectedRank >= 0 && rank == (NSUInteger)projectedRank) tip = projectedTip;
531
+ return @{@"label": label, @"tip": tip, @"color": ladder[rank][2]};
419
532
  }
420
533
  - (void)drawProvider:(NSString *)name usage:(NSDictionary *)usage usedKey:(NSString *)usedKey
421
534
  color:(NSColor *)color cardRect:(NSRect)card {
@@ -425,12 +538,24 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
425
538
  NSDictionary *week = [self quota:usage key:@"week"];
426
539
  NSDictionary *fiveTokens = [self tokenTotals:usage key:@"fiveHour"];
427
540
  NSDictionary *weekTokens = [self tokenTotals:usage key:@"week"];
541
+ NSDictionary *monthTokens = [self tokenTotals:usage key:@"month"];
542
+ // 同比两侧都只数到最后一个完整自然日(见 CalendarMonthWindows),因此不能拿含今天的
543
+ // monthTokens 去比不含同日的上月——那样每天都会凭空多出小半天的增量。
544
+ NSDictionary *monthComparable = [self tokenTotals:usage key:@"monthComparable"];
545
+ NSDictionary *previousMonthTokens = [self tokenTotals:usage key:@"previousMonthToDate"];
546
+ NSDictionary *tokenUsage = [usage[@"tokenUsage"] isKindOfClass:NSDictionary.class]
547
+ ? usage[@"tokenUsage"] : nil;
548
+ NSArray<NSDictionary *> *monthDaily = [tokenUsage[@"monthDaily"] isKindOfClass:NSArray.class]
549
+ ? tokenUsage[@"monthDaily"] : @[];
550
+ BOOL apiMode = [name isEqualToString:@"Codex"]
551
+ ? self.codexShowsAPIUsage : self.claudeShowsAPIUsage;
428
552
  NSNumber *fiveUsed = [self usedForQuota:five usedKey:usedKey];
429
553
  NSNumber *weekUsed = [self usedForQuota:week usedKey:usedKey];
430
554
  // 额度被拒之后官方不再报告任何窗口,留在手里的百分比既过期、指向的结论又正好相反
431
555
  // (账号是共享的,别人用完时本机的数字纹丝不动)。这时按 0 显示,并把状态说清楚。
432
556
  BOOL exhausted = [usage[@"exhaustedAt"] isKindOfClass:NSNumber.class];
433
- BOOL hasData = fiveUsed || weekUsed || fiveTokens || weekTokens || exhausted;
557
+ BOOL hasData = apiMode ? (monthTokens != nil)
558
+ : (fiveUsed || weekUsed || fiveTokens || weekTokens || exhausted);
434
559
  BOOL online = [self isProviderOnline:name];
435
560
 
436
561
  NSBezierPath *cardPath = [NSBezierPath bezierPathWithRoundedRect:card xRadius:18 yRadius:18];
@@ -467,9 +592,9 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
467
592
  withAttributes:[self textAttributesWithSize:22 color:primary weight:NSFontWeightBold]];
468
593
  // 四态:额度被拒 → 额度已用尽(压过在线,这是此刻唯一要紧的信息);没有任何额度
469
594
  // 数据 → 等待数据;有数据但客户端已退出 → 离线;两者都有 → 在线。
470
- NSString *statusText = exhausted ? @"额度已用尽"
595
+ NSString *statusText = (!apiMode && exhausted) ? @"额度已用尽"
471
596
  : (!hasData ? @"等待数据" : (online ? @"● 在线" : @"离线"));
472
- NSColor *statusColor = exhausted ? NSColor.systemOrangeColor
597
+ NSColor *statusColor = (!apiMode && exhausted) ? NSColor.systemOrangeColor
473
598
  : (online && hasData ? NSColor.systemGreenColor : secondary);
474
599
  NSDictionary *statusAttributes = [self textAttributesWithSize:11 color:statusColor
475
600
  weight:NSFontWeightMedium];
@@ -478,6 +603,106 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
478
603
  [self fillRoundedRect:status radius:12 color:[statusColor colorWithAlphaComponent:0.13]];
479
604
  [statusText drawInRect:NSInsetRect(status, 9, 4) withAttributes:statusAttributes];
480
605
 
606
+ if (apiMode) {
607
+ CGFloat callX = NSMinX(card) + 214;
608
+ CGFloat tokenX = NSMinX(card) + 394;
609
+ [@"本月调用" drawInRect:NSMakeRect(callX, NSMinY(card) + 114, 130, 20)
610
+ withAttributes:[self textAttributesWithSize:13 color:secondary weight:NSFontWeightRegular]];
611
+ [@"本月消耗" drawInRect:NSMakeRect(tokenX, NSMinY(card) + 114, 130, 20)
612
+ withAttributes:[self textAttributesWithSize:13 color:secondary weight:NSFontWeightRegular]];
613
+
614
+ NSString *requests = [NSString stringWithFormat:@"%@ 次",
615
+ [self formattedRequestCount:monthTokens ?: @{}]];
616
+ [requests drawInRect:NSMakeRect(callX, NSMinY(card) + 75, 150, 34)
617
+ withAttributes:[self textAttributesWithSize:24 color:primary weight:NSFontWeightBold]];
618
+ // 曲线铺满整个自然月,月末那些还没到的日子不能算进"已过天数",否则日均会被稀释。
619
+ NSTimeInterval now = NSDate.date.timeIntervalSince1970;
620
+ NSUInteger recordedDays = 0;
621
+ for (NSDictionary *day in monthDaily) {
622
+ if ([day[@"timestamp"] doubleValue] <= now) recordedDays += 1;
623
+ }
624
+ NSUInteger elapsedDays = MAX((NSUInteger)1, recordedDays);
625
+ NSNumber *requestCount = [monthTokens[@"request_count"] isKindOfClass:NSNumber.class]
626
+ ? monthTokens[@"request_count"] : nil;
627
+ NSString *average = requestCount
628
+ ? [NSString stringWithFormat:@"日均 %@ 次",
629
+ [NSNumberFormatter localizedStringFromNumber:
630
+ @(llround(requestCount.doubleValue / elapsedDays))
631
+ numberStyle:NSNumberFormatterDecimalStyle]]
632
+ : @"日均 --";
633
+ [average drawInRect:NSMakeRect(callX, NSMinY(card) + 48, 150, 20)
634
+ withAttributes:[self textAttributesWithSize:12 color:secondary weight:NSFontWeightRegular]];
635
+
636
+ // 这里不再重复"本月消耗"的合计:输入与输出各自的量级才是按量计费时要看的东西,
637
+ // 合计随时可以由这两个数得到,而它原先占掉了最显眼的一行。
638
+ NSArray<NSDictionary *> *splits = @[
639
+ @{@"label": @"输入", @"value": [self formattedTokenSplit:monthTokens ?: @{}
640
+ wantsOutput:NO], @"y": @(NSMinY(card) + 76)},
641
+ @{@"label": @"输出", @"value": [self formattedTokenSplit:monthTokens ?: @{}
642
+ wantsOutput:YES], @"y": @(NSMinY(card) + 48)}
643
+ ];
644
+ for (NSDictionary *split in splits) {
645
+ CGFloat y = [split[@"y"] doubleValue];
646
+ [split[@"label"] drawInRect:NSMakeRect(tokenX, y + 4, 28, 16)
647
+ withAttributes:[self textAttributesWithSize:11 color:secondary
648
+ weight:NSFontWeightRegular]];
649
+ [split[@"value"] drawInRect:NSMakeRect(tokenX + 32, y, 122, 26)
650
+ withAttributes:[self textAttributesWithSize:18 color:primary
651
+ weight:NSFontWeightBold]];
652
+ }
653
+
654
+ NSDictionary *requestComparison = [self comparisonForCurrent:
655
+ [monthComparable[@"request_count"] doubleValue]
656
+ previous:[previousMonthTokens[@"request_count"] doubleValue] color:color];
657
+ [requestComparison[@"text"] drawInRect:NSMakeRect(callX, NSMinY(card) + 22, 158, 18)
658
+ withAttributes:[self textAttributesWithSize:11 color:requestComparison[@"color"]
659
+ weight:NSFontWeightMedium]];
660
+ NSDictionary *tokenComparison = [self comparisonForCurrent:
661
+ [monthComparable[@"total_tokens"] doubleValue]
662
+ previous:[previousMonthTokens[@"total_tokens"] doubleValue] color:color];
663
+ [tokenComparison[@"text"] drawInRect:NSMakeRect(tokenX, NSMinY(card) + 22, 158, 18)
664
+ withAttributes:[self textAttributesWithSize:11 color:tokenComparison[@"color"]
665
+ weight:NSFontWeightMedium]];
666
+
667
+ CGFloat trendX = NSMinX(card) + 564;
668
+ // 「按日 Token」跟在标题后面,与标题同一行:它是标题的限定语,单独占一行既浪费
669
+ // 竖向空间,也把曲线和脚注挤得没法与左边两列对齐。
670
+ [@"本月趋势" drawInRect:NSMakeRect(trendX, NSMinY(card) + 114, 60, 20)
671
+ withAttributes:[self textAttributesWithSize:13 color:secondary weight:NSFontWeightRegular]];
672
+ NSDictionary *pillAttributes = [self textAttributesWithSize:11 color:color
673
+ weight:NSFontWeightSemibold];
674
+ NSRect pill = NSMakeRect(trendX + 59, NSMinY(card) + 113, 76, 22);
675
+ [self fillRoundedRect:pill radius:11 color:[color colorWithAlphaComponent:0.14]];
676
+ [@"按日 Token" drawInRect:NSInsetRect(pill, 9, 3) withAttributes:pillAttributes];
677
+ NSRect curveRect = NSMakeRect(trendX, NSMinY(card) + 62, 135, 38);
678
+ [self drawMonthlyTokenCurve:monthDaily inRect:curveRect color:color];
679
+ double peak = 0;
680
+ NSDictionary *todayTotals = nil;
681
+ for (NSDictionary *day in monthDaily) {
682
+ if ([day[@"timestamp"] doubleValue] > now) break;
683
+ NSDictionary *totals = [day[@"totals"] isKindOfClass:NSDictionary.class]
684
+ ? day[@"totals"] : nil;
685
+ peak = fmax(peak, [totals[@"total_tokens"] doubleValue]);
686
+ todayTotals = totals;
687
+ }
688
+ NSString *peakText = recordedDays > 0
689
+ ? [NSString stringWithFormat:@"峰值 %@", [self formattedTokenValue:peak]] : @"峰值 --";
690
+ NSString *todayText = todayTotals
691
+ ? [NSString stringWithFormat:@"今日 %@",
692
+ [self formattedTokenValue:[todayTotals[@"total_tokens"] doubleValue]]] : @"今日 --";
693
+ [peakText drawInRect:NSMakeRect(trendX, NSMinY(card) + 42, 74, 16)
694
+ withAttributes:[self textAttributesWithSize:10 color:secondary weight:NSFontWeightRegular]];
695
+ [todayText drawInRect:NSMakeRect(trendX + 61, NSMinY(card) + 42, 74, 16)
696
+ withAttributes:[self rightAlignedTextAttributesWithSize:10 color:secondary
697
+ weight:NSFontWeightRegular]];
698
+ // 与左边两列的"较上月同期"同一条基线(+22),三列脚注才在一条水平线上。
699
+ [[NSString stringWithFormat:@"本月已记录 %lu / %lu 天",
700
+ (unsigned long)recordedDays, (unsigned long)monthDaily.count]
701
+ drawInRect:NSMakeRect(trendX, NSMinY(card) + 22, 145, 18)
702
+ withAttributes:[self textAttributesWithSize:11 color:color weight:NSFontWeightMedium]];
703
+ return;
704
+ }
705
+
481
706
  // 层级:官方剩余额度是订阅限额的权威值,占主位;本机 Token 是参考量,降一级并用
482
707
  // 强调色区分;重置时间最小。反过来会让最抢眼的数字恰好是最不该照着做决定的那个。
483
708
  NSArray<NSDictionary *> *windows = @[
@@ -506,21 +731,22 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
506
731
  withAttributes:valueAttributes];
507
732
  [@"剩余" drawInRect:NSMakeRect(x + valueWidth + 7, NSMinY(card) + 78, 60, 20)
508
733
  withAttributes:[self textAttributesWithSize:12 color:secondary weight:NSFontWeightRegular]];
509
- NSString *tokenText = [NSString stringWithFormat:@"已用 Token %@",
510
- [self formattedTokenCount:window[@"tokens"]]];
511
- [tokenText drawInRect:NSMakeRect(x, NSMinY(card) + 46, 150, 22)
512
- withAttributes:[self textAttributesWithSize:14 color:color weight:NSFontWeightSemibold]];
513
734
  // 官方窗口拿不到时(账号没有这个窗口、或响应里没带),Token 走的是本机滚动窗口。
514
735
  // 说清楚这一行的口径,比留一个 `--` 让人以为是渲染坏了要好。
515
736
  NSString *resetValue = [self resetText:window[@"quota"]];
516
737
  NSString *reset = [resetValue isEqualToString:@"--"]
517
738
  ? window[@"rolling"] : [NSString stringWithFormat:@"重置时间 %@", resetValue];
518
- [reset drawInRect:NSMakeRect(x, NSMinY(card) + 22, 150, 18)
739
+ [reset drawInRect:NSMakeRect(x, NSMinY(card) + 46, 150, 18)
519
740
  withAttributes:[self textAttributesWithSize:11 color:secondary weight:NSFontWeightRegular]];
741
+ NSString *tokenText = [NSString stringWithFormat:@"已用 Token %@",
742
+ [self formattedTokenCount:window[@"tokens"]]];
743
+ [tokenText drawInRect:NSMakeRect(x, NSMinY(card) + 22, 150, 22)
744
+ withAttributes:[self textAttributesWithSize:14 color:color weight:NSFontWeightSemibold]];
520
745
  }
521
746
 
522
747
  CGFloat trendX = NSMinX(card) + 564;
523
- [@"使用趋势" drawInRect:NSMakeRect(trendX, NSMinY(card) + 114, 145, 20)
748
+ // 与 API 卡同一套骨架:标题行带 pill、中间曲线、脚注和左边两列齐平。
749
+ [@"使用趋势" drawInRect:NSMakeRect(trendX, NSMinY(card) + 114, 60, 20)
524
750
  withAttributes:[self textAttributesWithSize:13 color:secondary weight:NSFontWeightRegular]];
525
751
  NSArray<NSDictionary *> *history = [name isEqualToString:@"Codex"]
526
752
  ? self.codexHistory : self.claudeHistory;
@@ -530,12 +756,14 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
530
756
  NSColor *paceColor = pace[@"color"];
531
757
  NSDictionary *pillAttributes = [self textAttributesWithSize:11 color:paceColor
532
758
  weight:NSFontWeightSemibold];
759
+ // 档位标签跟在标题后面。宽度仍按文字算:四个档位不一样长,最宽的"数据不足"到
760
+ // trendX + 131,列宽 145 放得下。
533
761
  CGFloat pillWidth = ceil([pace[@"label"] sizeWithAttributes:pillAttributes].width) + 18;
534
- NSRect pill = NSMakeRect(trendX, NSMinY(card) + 88, pillWidth, 22);
762
+ NSRect pill = NSMakeRect(trendX + 59, NSMinY(card) + 113, pillWidth, 22);
535
763
  [self fillRoundedRect:pill radius:11 color:[paceColor colorWithAlphaComponent:0.14]];
536
764
  [pace[@"label"] drawInRect:NSInsetRect(pill, 9, 3) withAttributes:pillAttributes];
537
765
 
538
- NSRect curveRect = NSMakeRect(trendX, NSMinY(card) + 43, 135, 38);
766
+ NSRect curveRect = NSMakeRect(trendX, NSMinY(card) + 62, 135, 38);
539
767
  [self drawUsageCurve:points inRect:curveRect color:color];
540
768
  double peak = 0;
541
769
  for (NSDictionary *point in points) peak = fmax(peak, [point[@"used"] doubleValue]);
@@ -543,20 +771,23 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
543
771
  ? [NSString stringWithFormat:@"最高 %.0f%%", peak] : @"最高 --";
544
772
  NSString *currentText = currentUsed
545
773
  ? [NSString stringWithFormat:@"当前 %.0f%%", currentUsed.doubleValue] : @"当前 --";
546
- [peakText drawInRect:NSMakeRect(trendX, NSMinY(card) + 25, 72, 16)
774
+ [peakText drawInRect:NSMakeRect(trendX, NSMinY(card) + 42, 72, 16)
547
775
  withAttributes:[self textAttributesWithSize:10 color:secondary weight:NSFontWeightRegular]];
548
- [currentText drawInRect:NSMakeRect(trendX + 66, NSMinY(card) + 25, 69, 16)
776
+ [currentText drawInRect:NSMakeRect(trendX + 66, NSMinY(card) + 42, 69, 16)
549
777
  withAttributes:[self rightAlignedTextAttributesWithSize:10 color:secondary
550
778
  weight:NSFontWeightRegular]];
551
- [pace[@"tip"] drawInRect:NSMakeRect(trendX, NSMinY(card) + 7, 145, 16)
552
- withAttributes:[self textAttributesWithSize:10 color:paceColor weight:NSFontWeightMedium]];
779
+ // 与左边两列的"已用 Token"同一条基线(+22),也和 API 卡的脚注行对齐。
780
+ [pace[@"tip"] drawInRect:NSMakeRect(trendX, NSMinY(card) + 22, 145, 18)
781
+ withAttributes:[self textAttributesWithSize:11 color:paceColor weight:NSFontWeightMedium]];
553
782
  }
554
783
  - (void)drawRect:(NSRect)dirtyRect {
555
784
  [NSGraphicsContext saveGraphicsState];
556
785
  NSAffineTransform *scale = [NSAffineTransform transform];
557
786
  [scale scaleBy:QuotaScale];
558
787
  [scale concat];
559
- NSRect logicalBounds = NSMakeRect(0, 0, QuotaLogicalWidth, QuotaLogicalHeight);
788
+ NSArray<NSString *> *visibleProviders = [self visibleProviders];
789
+ const CGFloat height = [self logicalHeight];
790
+ NSRect logicalBounds = NSMakeRect(0, 0, QuotaLogicalWidth, height);
560
791
  NSRect outer = NSInsetRect(logicalBounds, 1, 1);
561
792
  NSBezierPath *background = [NSBezierPath bezierPathWithRoundedRect:outer xRadius:24 yRadius:24];
562
793
  NSGradient *gradient = [[NSGradient alloc]
@@ -569,13 +800,17 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
569
800
  NSGradient *topGlow = [[NSGradient alloc]
570
801
  initWithStartingColor:[NSColor colorWithWhite:1 alpha:0.34]
571
802
  endingColor:[NSColor colorWithWhite:1 alpha:0.0]];
572
- [topGlow drawFromCenter:NSMakePoint(700, 650) radius:0
573
- toCenter:NSMakePoint(700, 650) radius:250 options:0];
803
+ // 两处光晕原本是按 H=590 定的绝对点。面板会变矮,改成跟着高度走:顶部光源始终悬在
804
+ // 面板上沿之外,冷色光晕落在内容区中段。
805
+ NSPoint topGlowCenter = NSMakePoint(700, height + 60);
806
+ [topGlow drawFromCenter:topGlowCenter radius:0
807
+ toCenter:topGlowCenter radius:250 options:0];
574
808
  NSGradient *cyanGlow = [[NSGradient alloc]
575
809
  initWithStartingColor:[NSColor colorWithRed:0.18 green:0.72 blue:1 alpha:0.11]
576
810
  endingColor:[NSColor colorWithRed:0.18 green:0.88 blue:1 alpha:0.0]];
577
- [cyanGlow drawFromCenter:NSMakePoint(660, 250) radius:0
578
- toCenter:NSMakePoint(660, 250) radius:260 options:0];
811
+ NSPoint cyanGlowCenter = NSMakePoint(660, height * 0.42);
812
+ [cyanGlow drawFromCenter:cyanGlowCenter radius:0
813
+ toCenter:cyanGlowCenter radius:260 options:0];
579
814
  [NSGraphicsContext restoreGraphicsState];
580
815
 
581
816
  [[NSColor colorWithWhite:1 alpha:0.34] setStroke];
@@ -590,18 +825,18 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
590
825
  NSColor *secondary = self.secondaryColor;
591
826
  NSColor *cyan = self.accentColor;
592
827
  NSColor *agentColor = self.agentStatusColor;
593
- [@"Agent Usage" drawInRect:NSMakeRect(28, QuotaLogicalHeight - 65, 260, 42)
828
+ [@"Agent Usage" drawInRect:NSMakeRect(28, height - 65, 260, 42)
594
829
  withAttributes:[self textAttributesWithSize:30 color:primary weight:NSFontWeightBold]];
595
- [@"实时状态与滚动用量" drawInRect:NSMakeRect(30, QuotaLogicalHeight - 94, 130, 22)
830
+ [@"实时状态与滚动用量" drawInRect:NSMakeRect(30, height - 94, 130, 22)
596
831
  withAttributes:[self textAttributesWithSize:14 color:secondary weight:NSFontWeightRegular]];
597
832
  [agentColor setFill];
598
- [[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(174, QuotaLogicalHeight - 88, 9, 9)] fill];
833
+ [[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(174, height - 88, 9, 9)] fill];
599
834
  NSString *agentText = self.activeAgentCount > 0
600
835
  ? [NSString stringWithFormat:@"%ld 个 Agent 在线", (long)self.activeAgentCount]
601
836
  : @"暂无 Agent 在线";
602
- [agentText drawInRect:NSMakeRect(190, QuotaLogicalHeight - 95, 160, 22)
837
+ [agentText drawInRect:NSMakeRect(190, height - 95, 160, 22)
603
838
  withAttributes:[self textAttributesWithSize:14 color:agentColor weight:NSFontWeightMedium]];
604
- [self drawSystemMetricsEndingAtX:QuotaLogicalWidth - 28 y:QuotaLogicalHeight - 95];
839
+ [self drawSystemMetricsEndingAtX:QuotaLogicalWidth - 28 y:height - 95];
605
840
 
606
841
  BOOL recentlyRefreshed = self.refreshedUntil > NSDate.date.timeIntervalSince1970;
607
842
  CGFloat buttonAlpha = self.refreshPressed ? 0.18 : (self.refreshHovered ? 0.12 : 0.06);
@@ -617,6 +852,65 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
617
852
  withAttributes:[self rightAlignedTextAttributesWithSize:11 color:secondary
618
853
  weight:NSFontWeightRegular]];
619
854
 
855
+ if (visibleProviders.count > 0) {
856
+ [self drawSummaryForProviders:visibleProviders primary:primary secondary:secondary
857
+ accent:cyan];
858
+ }
859
+ NSDictionary *cardSpecs = @{
860
+ @"Codex": @{@"usage": self.codexUsage ?: @{}, @"usedKey": @"used_percent",
861
+ @"color": cyan},
862
+ @"Claude": @{@"usage": self.claudeUsage ?: @{}, @"usedKey": @"used_percentage",
863
+ @"color": [NSColor colorWithRed:0.66 green:0.43 blue:0.94 alpha:1]}
864
+ };
865
+ // 卡片从汇总条下方依次向下排。少一家就少一张卡,脚注跟着上移;这里的分段账必须和
866
+ // QuotaLogicalHeightForProviderCount 完全一致,否则面板会多出或少掉一段空白。
867
+ CGFloat cardTop = height - QuotaHeaderHeight - QuotaSummaryHeight;
868
+ for (NSString *name in visibleProviders) {
869
+ NSDictionary *spec = cardSpecs[name];
870
+ cardTop -= QuotaBlockGap;
871
+ [self drawProvider:name usage:spec[@"usage"] usedKey:spec[@"usedKey"]
872
+ color:spec[@"color"]
873
+ cardRect:NSMakeRect(20, cardTop - QuotaCardHeight,
874
+ QuotaLogicalWidth - 40, QuotaCardHeight)];
875
+ cardTop -= QuotaCardHeight;
876
+ }
877
+ if (visibleProviders.count == 0) {
878
+ // 精简态。说清楚是"没检测到 CLI",而不是让用户对着一片空白猜面板是不是坏了。
879
+ // 两行说明刻意分开:卡片出现只取决于装没装 CLI,探测每 ClientLifecycleInterval
880
+ // 跑一次,装完几秒内自己就冒出来,既不用重装也不用重启桌宠。而 cc-pets install
881
+ // 解决的是另一件事——Agent 动画,以及 Claude 额度(statusline 是它唯一的来源)。
882
+ // 把两者写成一句会让人以为不执行 install 卡片就不出现。
883
+ CGFloat noticeTop = height - QuotaHeaderHeight;
884
+ [@"未检测到 Codex / Claude Code CLI" drawInRect:NSMakeRect(28, noticeTop - 30, 460, 26)
885
+ withAttributes:[self textAttributesWithSize:17 color:primary weight:NSFontWeightMedium]];
886
+ [@"安装 Codex 或 Claude Code 后,额度卡会自动出现"
887
+ drawInRect:NSMakeRect(28, noticeTop - 52, 560, 20)
888
+ withAttributes:[self textAttributesWithSize:12 color:secondary weight:NSFontWeightRegular]];
889
+ [@"重新执行 cc-pets install 可启用 Agent 动画与 Claude 额度采集"
890
+ drawInRect:NSMakeRect(28, noticeTop - 72, 560, 18)
891
+ withAttributes:[self textAttributesWithSize:11
892
+ color:[NSColor colorWithWhite:0.52 alpha:1] weight:NSFontWeightRegular]];
893
+ }
894
+ BOOL hasAPICard = ([visibleProviders containsObject:@"Codex"] && self.codexShowsAPIUsage) ||
895
+ ([visibleProviders containsObject:@"Claude"] && self.claudeShowsAPIUsage);
896
+ NSString *footer = visibleProviders.count == 0
897
+ ? @"ⓘ 桌宠与系统状态不受影响;额度卡只在检测到对应 CLI 时显示"
898
+ : (hasAPICard
899
+ ? @"ⓘ API 用量 = 本机会话统计(输入含缓存读写);环比按上月相同时间进度计算"
900
+ : @"ⓘ 百分比 = 官方订阅额度的剩余比例;Token = 本机统计的已用量(输入含缓存读写),两者口径不同");
901
+ // 最后一块的底边距面板底 QuotaFooterHeight:脚注与其留约 8pt,底部留白 16pt,
902
+ // 和顶部标题的留白大致对称。
903
+ [footer drawInRect:NSMakeRect(28, 16, 650, 20)
904
+ withAttributes:[self textAttributesWithSize:11 color:[NSColor colorWithWhite:0.58 alpha:1] weight:NSFontWeightRegular]];
905
+ [NSGraphicsContext restoreGraphicsState];
906
+ }
907
+
908
+ // 今日与最近 7 天都按 Provider 分开展示。底层本来就是两套独立的自然日统计,
909
+ // 不在展示层相加,避免用户无法判断 Token 来自 Codex 还是 Claude。
910
+ // 每格内是一张 2×2 表:标题独占一行,每个 Provider 独占一行;输入/输出标签放在
911
+ // 对应数值上方。这样既能完整展示 7 天统计起期,也不会挤乱两家的数据行。
912
+ - (void)drawSummaryForProviders:(NSArray<NSString *> *)providers primary:(NSColor *)primary
913
+ secondary:(NSColor *)secondary accent:(NSColor *)cyan {
620
914
  NSRect summary = [self logicalSummaryRect];
621
915
  NSBezierPath *summaryPath = [NSBezierPath bezierPathWithRoundedRect:summary xRadius:18 yRadius:18];
622
916
  [[NSColor colorWithWhite:1 alpha:0.065] setFill];
@@ -624,23 +918,31 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
624
918
  [[NSColor colorWithWhite:1 alpha:0.16] setStroke];
625
919
  [summaryPath stroke];
626
920
 
627
- // 今日与最近 7 天都按 Provider 分开展示。底层本来就是两套独立的自然日统计,
628
- // 不在展示层相加,避免用户无法判断 Token 来自 Codex 还是 Claude。
629
- // 每格内是一张 2×2 表:标题独占一行,每个 Provider 独占一行;输入/输出标签放在
630
- // 对应数值上方。这样既能完整展示 7 天统计起期,也不会挤乱两家的数据行。
631
921
  NSArray<NSDictionary *> *cells = @[
632
922
  @{@"icon": @"◔", @"headerSymbol": @"calendar", @"key": @"today",
633
923
  @"label": @"今日用量"},
634
924
  @{@"icon": @"◉", @"headerSymbol": @"calendar.badge.clock", @"key": @"recentWeek",
635
925
  @"label": [self recentWeekUsageLabel]}
636
926
  ];
637
- NSColor *claudeColor = [NSColor colorWithRed:0.66 green:0.43 blue:0.94 alpha:1];
638
- NSArray<NSDictionary *> *rows = @[
639
- @{@"name": @"Codex", @"usage": self.codexUsage ?: @{}, @"color": cyan,
640
- @"iconY": @43, @"nameY": @52, @"labelY": @68, @"valueY": @47},
641
- @{@"name": @"Claude", @"usage": self.claudeUsage ?: @{}, @"color": claudeColor,
642
- @"iconY": @5, @"nameY": @14, @"labelY": @30, @"valueY": @9}
643
- ];
927
+ NSDictionary *rowSpecs = @{
928
+ @"Codex": @{@"usage": self.codexUsage ?: @{}, @"color": cyan},
929
+ @"Claude": @{@"usage": self.claudeUsage ?: @{},
930
+ @"color": [NSColor colorWithRed:0.66 green:0.43 blue:0.94 alpha:1]}
931
+ };
932
+ // 两行版的槽位是写死的。只装了一家时改用居中的单行槽位,否则汇总条会空出半格,
933
+ // 看着像数据没加载出来。
934
+ NSArray<NSDictionary *> *slots = providers.count == 1
935
+ ? @[@{@"iconY": @24, @"nameY": @33, @"labelY": @49, @"valueY": @28}]
936
+ : @[@{@"iconY": @43, @"nameY": @52, @"labelY": @68, @"valueY": @47},
937
+ @{@"iconY": @5, @"nameY": @14, @"labelY": @30, @"valueY": @9}];
938
+ NSMutableArray<NSDictionary *> *rows = [NSMutableArray array];
939
+ for (NSUInteger index = 0; index < providers.count && index < slots.count; index++) {
940
+ NSMutableDictionary *row = [slots[index] mutableCopy];
941
+ [row addEntriesFromDictionary:rowSpecs[providers[index]]];
942
+ row[@"name"] = providers[index];
943
+ [rows addObject:row];
944
+ }
945
+
644
946
  [[NSColor colorWithWhite:1 alpha:0.10] setStroke];
645
947
  for (NSUInteger index = 1; index < cells.count; index++) {
646
948
  CGFloat x = NSMinX([self logicalSummaryCellRectAtIndex:index]);
@@ -704,16 +1006,5 @@ NSImage *OfficialAppIcon(NSString *bundleIdentifier, NSString *resourceName) {
704
1006
  }
705
1007
  }
706
1008
 
707
- [self drawProvider:@"Codex" usage:self.codexUsage usedKey:@"used_percent"
708
- color:cyan cardRect:NSMakeRect(20, 208, QuotaLogicalWidth - 40, 152)];
709
- [self drawProvider:@"Claude" usage:self.claudeUsage usedKey:@"used_percentage"
710
- color:[NSColor colorWithRed:0.66 green:0.43 blue:0.94 alpha:1]
711
- cardRect:NSMakeRect(20, 44, QuotaLogicalWidth - 40, 152)];
712
- NSString *footer = @"ⓘ 百分比 = 官方订阅额度的剩余比例;Token = 本机统计的已用量(输入含缓存读写),两者口径不同";
713
- // 卡片底边在 y=44,原来 footer 顶到 44 完全没有间隙。下移到与卡片留约 8pt,
714
- // 同时底部留白 16pt,和顶部标题的留白大致对称。
715
- [footer drawInRect:NSMakeRect(28, 16, 650, 20)
716
- withAttributes:[self textAttributesWithSize:11 color:[NSColor colorWithWhite:0.58 alpha:1] weight:NSFontWeightRegular]];
717
- [NSGraphicsContext restoreGraphicsState];
718
1009
  }
719
1010
  @end
@@ -1,6 +1,6 @@
1
1
  # 第三方声明
2
2
 
3
- CC Pets 发布包不捆绑 PetDex 下载的角色素材。内置的 `ByteMochi.png` 是专为本项目创建的
3
+ CC Pets 发布包不捆绑 PetDex 下载的角色素材。内置的 `默认.webp` 是专为本项目创建的
4
4
  原创默认素材,与任何现有动漫、游戏或商业吉祥物无关,并与项目代码一同按 MIT License 分发。
5
5
 
6
6
  程序会在运行时尝试读取用户本机已安装的 Codex/ChatGPT 和 Claude 应用图标,仅用于界面识别;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-pets",
3
- "version": "1.2.8",
3
+ "version": "1.3.0",
4
4
  "description": "A native macOS desktop pet for Codex CLI and Claude Code",
5
5
  "author": "wangxinyusqn",
6
6
  "license": "MIT",