ccstatusline-zh 2.2.33 → 2.2.34

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.
@@ -32,7 +32,7 @@ import {
32
32
  initConfigPath,
33
33
  loadSettings,
34
34
  saveSettings
35
- } from "./ccstatusline-3tcnryv5.js";
35
+ } from "./ccstatusline-jp52tswn.js";
36
36
  import {
37
37
  advanceGlobalPowerlineThemeIndex,
38
38
  advanceGlobalSeparatorIndex
@@ -54,6 +54,11 @@ var RateLimitPeriodSchema = object({
54
54
  used_percentage: CoercedNumberSchema.nullable().optional(),
55
55
  resets_at: CoercedNumberSchema.nullable().optional()
56
56
  });
57
+ var SpendLimitSchema = RateLimitPeriodSchema.extend({
58
+ used_usd: CoercedNumberSchema.nullable().optional(),
59
+ limit_usd: CoercedNumberSchema.nullable().optional(),
60
+ period: string().nullable().optional()
61
+ });
57
62
  var StatusJSONSchema = looseObject({
58
63
  hook_event_name: string().optional(),
59
64
  session_id: string().optional(),
@@ -108,7 +113,8 @@ var StatusJSONSchema = looseObject({
108
113
  five_hour: RateLimitPeriodSchema.optional(),
109
114
  seven_day: RateLimitPeriodSchema.optional(),
110
115
  seven_day_sonnet: RateLimitPeriodSchema.nullable().optional(),
111
- seven_day_opus: RateLimitPeriodSchema.nullable().optional()
116
+ seven_day_opus: RateLimitPeriodSchema.nullable().optional(),
117
+ spend_limit: SpendLimitSchema.nullable().optional()
112
118
  }).nullable().optional()
113
119
  });
114
120
 
@@ -216,7 +222,9 @@ var BASE_USAGE_WIDGET_TYPES = [
216
222
  "extra-usage-utilization",
217
223
  "extra-usage-remaining",
218
224
  "extra-usage-used",
219
- "extra-usage-daily-budget"
225
+ "extra-usage-daily-budget",
226
+ "spend-limit-usage",
227
+ "spend-limit-amount"
220
228
  ];
221
229
  var USAGE_WIDGET_TYPES = new Set([
222
230
  ...BASE_USAGE_WIDGET_TYPES,
@@ -228,6 +236,9 @@ var USAGE_DATA_FIELDS = [
228
236
  "weeklyUsage",
229
237
  "weeklyResetAt",
230
238
  ...WEEKLY_MODEL_USAGE_BUCKETS.flatMap((bucket) => [bucket.usageField, bucket.resetField]),
239
+ "spendLimitUsage",
240
+ "spendLimitUsedUsd",
241
+ "spendLimitLimitUsd",
231
242
  "extraUsageEnabled",
232
243
  "extraUsageLimit",
233
244
  "extraUsageUsed",
@@ -348,7 +359,10 @@ function extractUsageDataFromRateLimits(rateLimits) {
348
359
  sessionUsage: rateLimits.five_hour?.used_percentage ?? undefined,
349
360
  sessionResetAt: epochSecondsToIsoString(rateLimits.five_hour?.resets_at),
350
361
  weeklyUsage: rateLimits.seven_day?.used_percentage ?? undefined,
351
- weeklyResetAt: epochSecondsToIsoString(rateLimits.seven_day?.resets_at)
362
+ weeklyResetAt: epochSecondsToIsoString(rateLimits.seven_day?.resets_at),
363
+ spendLimitUsage: rateLimits.spend_limit?.used_percentage ?? undefined,
364
+ spendLimitUsedUsd: rateLimits.spend_limit?.used_usd ?? undefined,
365
+ spendLimitLimitUsd: rateLimits.spend_limit?.limit_usd ?? undefined
352
366
  };
353
367
  for (const bucket of WEEKLY_MODEL_USAGE_BUCKETS) {
354
368
  if (!bucket.apiBucketKey) {
@@ -607,7 +621,7 @@ async function main() {
607
621
  const { updatemessage, ...newSettings } = settings;
608
622
  await saveSettings(newSettings);
609
623
  }
610
- const { runTUI } = await import("./index-d0c2je2n.js");
624
+ const { runTUI } = await import("./index-pzts8765.js");
611
625
  runTUI();
612
626
  }
613
627
  }