cc-api-statusline 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -697,7 +697,7 @@ function detectClaudeVersion() {
697
697
  }
698
698
  }
699
699
 
700
- // src/providers/sub2api.ts
700
+ // src/services/time.ts
701
701
  function computeNextMidnightLocal() {
702
702
  const now = new Date;
703
703
  const tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1, 0, 0, 0, 0);
@@ -715,6 +715,8 @@ function computeFirstOfNextMonthLocal() {
715
715
  const nextMonth = new Date(now.getFullYear(), now.getMonth() + 1, 1, 0, 0, 0, 0);
716
716
  return nextMonth.toISOString();
717
717
  }
718
+
719
+ // src/providers/sub2api.ts
718
720
  function mapPeriodTokens(data) {
719
721
  if (!data)
720
722
  return null;
@@ -930,16 +932,18 @@ async function fetchClaudeRelayService(baseUrl, token, config, timeoutMs = 5000)
930
932
  tokenStats: null,
931
933
  rateLimit: null
932
934
  };
933
- result.daily = createQuotaWindow2(limits.currentDailyCost, limits.dailyCostLimit, null);
935
+ result.daily = createQuotaWindow2(limits.currentDailyCost, limits.dailyCostLimit, computeNextMidnightLocal());
934
936
  if (limits.weeklyResetDay !== undefined && limits.weeklyResetHour !== undefined) {
935
937
  const weeklyResetsAt = computeWeeklyResetTime(limits.weeklyResetDay, limits.weeklyResetHour);
936
938
  result.weekly = createQuotaWindow2(limits.weeklyOpusCost, limits.weeklyOpusCostLimit, weeklyResetsAt);
937
939
  } else {
938
- result.weekly = createQuotaWindow2(limits.weeklyOpusCost, limits.weeklyOpusCostLimit, null);
940
+ result.weekly = createQuotaWindow2(limits.weeklyOpusCost, limits.weeklyOpusCostLimit, computeNextMondayLocal());
939
941
  }
940
942
  result.monthly = null;
941
943
  if (limits.windowEndTime) {
942
944
  result.resetsAt = new Date(limits.windowEndTime).toISOString();
945
+ } else {
946
+ result.resetsAt = computeSoonestReset(result);
943
947
  }
944
948
  if (data.usage?.total) {
945
949
  const total = data.usage.total;
@@ -2226,7 +2230,7 @@ function uninstallStatusLine() {
2226
2230
  // package.json
2227
2231
  var package_default = {
2228
2232
  name: "cc-api-statusline",
2229
- version: "0.1.3",
2233
+ version: "0.1.4",
2230
2234
  description: "Claude Code statusline tool that polls API usage from third-party proxy backends",
2231
2235
  type: "module",
2232
2236
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-api-statusline",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Claude Code statusline tool that polls API usage from third-party proxy backends",
5
5
  "type": "module",
6
6
  "bin": {