@say8425/cc-statusline 6.0.0 → 6.2.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/README.md CHANGED
@@ -62,9 +62,9 @@ Add the following to `~/.claude/settings.json`:
62
62
  - **TrueColor**: Dynamic colors based on thresholds
63
63
  - **Limit Reset Time**: Reset time display (HH:MM)
64
64
  - **Block Usage**: 5-hour utilization percentage
65
- - **Weekly Reset Timer**: Weekly limit reset time (MM/DD HH:MM)
65
+ - **Weekly Reset Timer**: Weekly limit reset time (MM/DD(Fri) HH:MM — the weekday name follows your locale)
66
66
  - **Weekly Usage**: 7-day utilization percentage
67
- - **Session ID**: Full session UUID at the end of the usage line, with no emoji label — ready to copy into `claude --resume <id>` or a log lookup
67
+ - **Session ID**: Full session UUID at the end of the session-time line (to the right of the model segment), with no emoji label — ready to copy into `claude --resume <id>` or a log lookup
68
68
 
69
69
  ## Emoji Guide
70
70
 
@@ -77,11 +77,11 @@ Add the following to `~/.claude/settings.json`:
77
77
  | 💰 | Session cost in USD (hidden by default — see [Configuration](#configuration)) |
78
78
  | 🧠 | Context window usage |
79
79
  | 🤖 | Current model and effort |
80
+ | _(none)_ | Session ID — the full UUID, shown after 🤖 (or at the end of the session-time line) without an emoji label |
80
81
  | ⏳ | Limit reset time |
81
82
  | 📊 | 5-hour utilization % |
82
83
  | ⏰ | Weekly limit reset time |
83
84
  | 📅 | 7-day utilization % |
84
- | _(none)_ | Session ID — the full UUID, shown after 📅 without an emoji label |
85
85
  | ✏️ | Uncommitted changes (click to open diff viewer) |
86
86
  | 📎 | Pull request link — color-coded state in brackets (`[Open]`/`[Draft]`/`[Merged]`/`[Closed]`) immediately followed by a color-coded CI check summary in parens (`(N passed)`/`(N running)`/`(N failed)`) when checks exist |
87
87
 
@@ -159,11 +159,11 @@ Claude Code passes `rate_limits` in the stdin JSON input (CLI 2.1.80+):
159
159
  1. **5-hour utilization** - Usage percentage for the current billing block (`rate_limits.five_hour.used_percentage`)
160
160
  2. **7-day utilization** - Weekly usage percentage (`rate_limits.seven_day.used_percentage`)
161
161
  3. **Reset timer** - Exact reset time (`rate_limits.five_hour.resets_at`), shown as `HH:MM`
162
- 4. **Weekly reset timer** - Weekly limit reset time (`rate_limits.seven_day.resets_at`), shown as `MM/DD HH:MM` (e.g., `02/15 17:00`)
162
+ 4. **Weekly reset timer** - Weekly limit reset time (`rate_limits.seven_day.resets_at`), shown as `MM/DD(weekday) HH:MM`. The weekday name is localized from `LC_ALL` / `LC_TIME` / `LANG` (e.g., `02/15(Thu) 17:00` under `en_US.UTF-8`, `02/15(목) 17:00` under `ko_KR.UTF-8`). If none of the three holds a usable value — unset, empty, or `C`/`POSIX`, which mean "do not localize" — the weekday falls back to the runtime default locale (`en-US` with current Bun). macOS Terminal leaves `LANG` empty unless "Set locale environment variables on startup" is enabled
163
163
 
164
164
  Usage metrics are **automatically displayed** when `rate_limits` is present in the stdin JSON. No additional flags or configuration needed.
165
165
 
166
- The session ID (`session_id`) is appended to the end of the same line, after the 7-day utilization. It comes from a separate field, so it still shows on its own when `rate_limits` is absent.
166
+ The session ID (`session_id`) lives on the session-time line instead — see [Features](#features) — since it comes from a separate field and doesn't depend on `rate_limits`.
167
167
 
168
168
  > [!NOTE]
169
169
  > `rate_limits` is only available for Claude.ai subscribers (Pro/Max) after the first API response. See the [official statusline docs](https://code.claude.com/docs/en/statusline) for the full JSON schema.
package/dist/index.js CHANGED
@@ -187,12 +187,13 @@ var buildDiffViewerUrl = (params) => {
187
187
  // src/format/formatNumber.ts
188
188
  var formatNumber = (n) => n.toLocaleString("en-US");
189
189
  // src/format/formatResetDate.ts
190
- var formatResetDate = (date) => {
190
+ var weekdayOf = (date, locale) => new Intl.DateTimeFormat(locale ?? undefined, { weekday: "short" }).format(date);
191
+ var formatResetDate = (date, locale) => {
191
192
  const month = (date.getMonth() + 1).toString().padStart(2, "0");
192
193
  const day = date.getDate().toString().padStart(2, "0");
193
194
  const hours = date.getHours().toString().padStart(2, "0");
194
195
  const minutes = date.getMinutes().toString().padStart(2, "0");
195
- return `${month}/${day} ${hours}:${minutes}`;
196
+ return `${month}/${day}(${weekdayOf(date, locale)}) ${hours}:${minutes}`;
196
197
  };
197
198
  // src/format/formatTime.ts
198
199
  var formatTime = (hours, mins) => `${hours.toString().padStart(2, "0")}:${mins.toString().padStart(2, "0")}`;
@@ -257,6 +258,29 @@ var ciSummaryColor = (ci) => {
257
258
  return C.YELLOW_MUTED;
258
259
  return C.GREEN_MUTED;
259
260
  };
261
+ // src/format/resolveLocale.ts
262
+ var LOCALE_ENV_KEYS = ["LC_ALL", "LC_TIME", "LANG"];
263
+ var toBcp47 = (posix) => {
264
+ const base = posix.split(".")[0]?.split("@")[0]?.trim() ?? "";
265
+ if (!base || base === "C" || base === "POSIX")
266
+ return null;
267
+ const tag = base.replace(/_/g, "-");
268
+ try {
269
+ Intl.DateTimeFormat.supportedLocalesOf([tag]);
270
+ } catch {
271
+ return null;
272
+ }
273
+ return tag;
274
+ };
275
+ var resolveLocale = (env = process.env) => {
276
+ for (const key of LOCALE_ENV_KEYS) {
277
+ const raw = env[key]?.trim();
278
+ if (!raw)
279
+ continue;
280
+ return toBcp47(raw);
281
+ }
282
+ return null;
283
+ };
260
284
  // src/format/toFileUrl.ts
261
285
  var toFileUrl = (absolutePath) => {
262
286
  const normalized = absolutePath.replace(/\\/g, "/");
@@ -536,6 +560,10 @@ var renderStatusLine = (ctx) => {
536
560
  modelText += " \u26A1ultra";
537
561
  line2 += ` | ${C.WHITE}\uD83E\uDD16 ${modelText}${C.RESET}`;
538
562
  }
563
+ const sessionId = ctx.claudeJson.session_id;
564
+ if (sessionId) {
565
+ line2 += ` | ${C.WHITE}${sessionId}${C.RESET}`;
566
+ }
539
567
  lines.push(line2);
540
568
  const usageParts = [];
541
569
  if (ctx.rateLimits?.five_hour) {
@@ -553,15 +581,11 @@ var renderStatusLine = (ctx) => {
553
581
  const { resets_at, used_percentage } = ctx.rateLimits.seven_day;
554
582
  if (resets_at) {
555
583
  const resetTime = new Date(resets_at * 1000);
556
- usageParts.push(`${C.WHITE}\u23F0 ${formatResetDate(resetTime)}${C.RESET}`);
584
+ usageParts.push(`${C.WHITE}\u23F0 ${formatResetDate(resetTime, ctx.locale)}${C.RESET}`);
557
585
  }
558
586
  const weekColor = getUsageColor(used_percentage);
559
587
  usageParts.push(`${weekColor}\uD83D\uDCC5 ${Math.round(used_percentage)}/100${C.RESET}`);
560
588
  }
561
- const sessionId = ctx.claudeJson.session_id;
562
- if (sessionId) {
563
- usageParts.push(`${C.WHITE}${sessionId}${C.RESET}`);
564
- }
565
589
  if (usageParts.length > 0) {
566
590
  lines.push(usageParts.join(" | "));
567
591
  }
@@ -688,6 +712,7 @@ var main = async () => {
688
712
  prInfo,
689
713
  ultracode,
690
714
  showCost: isCostVisible(),
715
+ locale: resolveLocale(),
691
716
  rateLimits: claudeJson.rate_limits ?? null,
692
717
  mainProjectName,
693
718
  diffViewerUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@say8425/cc-statusline",
3
- "version": "6.0.0",
3
+ "version": "6.2.0",
4
4
  "description": "Custom statusline for Claude Code",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,7 +27,7 @@
27
27
  "typecheck": "tsc --noEmit"
28
28
  },
29
29
  "dependencies": {
30
- "@say8425/diffdeck": "1.4.0"
30
+ "@say8425/diffdeck": "1.5.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/bun": "^1.3.14",