ccstatusline 2.2.3 → 2.2.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.
package/README.md CHANGED
@@ -46,7 +46,7 @@
46
46
 
47
47
  ## 🆕 Recent Updates
48
48
 
49
- ### v2.2.0 - v2.2.2 - Token Speed + Skills widget updates
49
+ ### v2.2.0 - v2.2.4 - Token Speed + Skills widget updates
50
50
 
51
51
  - **🚀 New Token Speed widgets** - Added three widgets: **Input Speed**, **Output Speed**, and **Total Speed**.
52
52
  - Each speed widget supports a configurable window of `0-120` seconds in the widget editor (`w` key).
@@ -54,6 +54,7 @@
54
54
  - `1-120` calculates recent speed over the selected rolling window.
55
55
  - **🧩 New Skills widget controls (v2.2.1)** - Added configurable Skills modes (last/count/list), optional hide-when-empty behavior, and list-size limiting with most-recent-first ordering.
56
56
  - **🌐 Usage API proxy support (v2.2.2)** - Usage widgets honor the uppercase `HTTPS_PROXY` environment variable for their direct API call to Anthropic.
57
+ - **🧠 New Thinking Effort widget (v2.2.4)** - Added a widget that shows the current Claude Code thinking effort level.
57
58
  - **🤝 Better subagent-aware speed reporting** - Token speed calculations continue to include referenced subagent activity so displayed speeds better reflect actual concurrent work.
58
59
 
59
60
  ### v2.1.0 - v2.1.10 - Usage widgets, links, new git insertions / deletions widgets, and reliability fixes
@@ -56103,7 +56103,7 @@ function getTerminalWidth() {
56103
56103
  function canDetectTerminalWidth() {
56104
56104
  return probeTerminalWidth() !== null;
56105
56105
  }
56106
- var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils", PACKAGE_VERSION = "2.2.3";
56106
+ var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils", PACKAGE_VERSION = "2.2.4";
56107
56107
  var init_terminal = () => {};
56108
56108
 
56109
56109
  // src/utils/renderer.ts
@@ -62175,11 +62175,57 @@ var init_jsonl_metrics = __esm(() => {
62175
62175
  init_jsonl_lines();
62176
62176
  });
62177
62177
 
62178
+ // src/utils/jsonl-metadata.ts
62179
+ function normalizeThinkingEffort(value) {
62180
+ if (!value) {
62181
+ return;
62182
+ }
62183
+ const normalized = value.toLowerCase();
62184
+ if (normalized === "low" || normalized === "medium" || normalized === "high" || normalized === "max") {
62185
+ return normalized;
62186
+ }
62187
+ return;
62188
+ }
62189
+ function getTranscriptThinkingEffort(transcriptPath) {
62190
+ if (!transcriptPath) {
62191
+ return;
62192
+ }
62193
+ try {
62194
+ const lines = readJsonlLinesSync(transcriptPath);
62195
+ for (let i = lines.length - 1;i >= 0; i--) {
62196
+ const line = lines[i];
62197
+ if (!line) {
62198
+ continue;
62199
+ }
62200
+ const entry = parseJsonlLine(line);
62201
+ if (typeof entry?.message?.content !== "string") {
62202
+ continue;
62203
+ }
62204
+ const visibleContent = getVisibleText(entry.message.content).trim();
62205
+ if (!visibleContent.startsWith(MODEL_STDOUT_PREFIX)) {
62206
+ continue;
62207
+ }
62208
+ const match = MODEL_STDOUT_EFFORT_REGEX.exec(visibleContent);
62209
+ return normalizeThinkingEffort(match?.[1]);
62210
+ }
62211
+ } catch {
62212
+ return;
62213
+ }
62214
+ return;
62215
+ }
62216
+ var MODEL_STDOUT_PREFIX = "<local-command-stdout>Set model to ", MODEL_STDOUT_EFFORT_REGEX;
62217
+ var init_jsonl_metadata = __esm(() => {
62218
+ init_ansi();
62219
+ init_jsonl_lines();
62220
+ MODEL_STDOUT_EFFORT_REGEX = /^<local-command-stdout>Set model to[\s\S]*? with (low|medium|high|max) effort<\/local-command-stdout>$/i;
62221
+ });
62222
+
62178
62223
  // src/utils/jsonl.ts
62179
62224
  var init_jsonl = __esm(() => {
62180
62225
  init_jsonl_cache();
62181
62226
  init_jsonl_blocks();
62182
62227
  init_jsonl_metrics();
62228
+ init_jsonl_metadata();
62183
62229
  });
62184
62230
 
62185
62231
  // src/utils/usage-windows.ts
@@ -63998,6 +64044,64 @@ var init_Skills = __esm(async () => {
63998
64044
  MODE_LABELS = { current: "last used", count: "total count", list: "unique list" };
63999
64045
  });
64000
64046
 
64047
+ // src/widgets/ThinkingEffort.ts
64048
+ function normalizeThinkingEffort2(value) {
64049
+ if (!value) {
64050
+ return;
64051
+ }
64052
+ const normalized = value.toLowerCase();
64053
+ if (normalized === "low" || normalized === "medium" || normalized === "high" || normalized === "max") {
64054
+ return normalized;
64055
+ }
64056
+ return;
64057
+ }
64058
+ function resolveThinkingEffortFromSettings() {
64059
+ try {
64060
+ const settings = loadClaudeSettingsSync({ logErrors: false });
64061
+ return normalizeThinkingEffort2(settings.effortLevel);
64062
+ } catch {}
64063
+ return;
64064
+ }
64065
+ function resolveThinkingEffort(context) {
64066
+ return getTranscriptThinkingEffort(context.data?.transcript_path) ?? resolveThinkingEffortFromSettings() ?? "medium";
64067
+ }
64068
+
64069
+ class ThinkingEffortWidget {
64070
+ getDefaultColor() {
64071
+ return "magenta";
64072
+ }
64073
+ getDescription() {
64074
+ return `Displays the current thinking effort level (low, medium, high, max).
64075
+ May be incorrect when multiple Claude Code sessions are running due to current Claude Code limitations.`;
64076
+ }
64077
+ getDisplayName() {
64078
+ return "Thinking Effort";
64079
+ }
64080
+ getCategory() {
64081
+ return "Core";
64082
+ }
64083
+ getEditorDisplay(item) {
64084
+ return { displayText: this.getDisplayName() };
64085
+ }
64086
+ render(item, context, settings) {
64087
+ if (context.isPreview) {
64088
+ return item.rawValue ? "high" : "Thinking: high";
64089
+ }
64090
+ const effort = resolveThinkingEffort(context);
64091
+ return item.rawValue ? effort : `Thinking: ${effort}`;
64092
+ }
64093
+ supportsRawValue() {
64094
+ return true;
64095
+ }
64096
+ supportsColors(item) {
64097
+ return true;
64098
+ }
64099
+ }
64100
+ var init_ThinkingEffort = __esm(() => {
64101
+ init_claude_settings();
64102
+ init_jsonl();
64103
+ });
64104
+
64001
64105
  // src/widgets/index.ts
64002
64106
  var init_widgets = __esm(async () => {
64003
64107
  init_GitBranch();
@@ -64017,6 +64121,7 @@ var init_widgets = __esm(async () => {
64017
64121
  init_BlockResetTimer();
64018
64122
  init_WeeklyResetTimer();
64019
64123
  init_ContextBar();
64124
+ init_ThinkingEffort();
64020
64125
  await __promiseAll([
64021
64126
  init_TokensInput(),
64022
64127
  init_TokensOutput(),
@@ -64074,7 +64179,8 @@ var init_widget_manifest = __esm(async () => {
64074
64179
  { type: "reset-timer", create: () => new BlockResetTimerWidget },
64075
64180
  { type: "weekly-reset-timer", create: () => new WeeklyResetTimerWidget },
64076
64181
  { type: "context-bar", create: () => new ContextBarWidget },
64077
- { type: "skills", create: () => new SkillsWidget }
64182
+ { type: "skills", create: () => new SkillsWidget },
64183
+ { type: "thinking-effort", create: () => new ThinkingEffortWidget }
64078
64184
  ];
64079
64185
  LAYOUT_WIDGET_MANIFEST = [
64080
64186
  {
@@ -64440,6 +64546,22 @@ async function backupClaudeSettings(suffix = ".bak") {
64440
64546
  }
64441
64547
  return null;
64442
64548
  }
64549
+ function loadClaudeSettingsSync(options = {}) {
64550
+ const { logErrors = true } = options;
64551
+ const settingsPath2 = getClaudeSettingsPath();
64552
+ if (!fs10.existsSync(settingsPath2)) {
64553
+ return {};
64554
+ }
64555
+ try {
64556
+ const content = fs10.readFileSync(settingsPath2, "utf-8");
64557
+ return JSON.parse(content);
64558
+ } catch (error48) {
64559
+ if (logErrors) {
64560
+ console.error("Failed to load Claude settings:", error48);
64561
+ }
64562
+ throw error48;
64563
+ }
64564
+ }
64443
64565
  async function loadClaudeSettings(options = {}) {
64444
64566
  const { logErrors = true } = options;
64445
64567
  const settingsPath2 = getClaudeSettingsPath();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccstatusline",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "description": "A customizable status line formatter for Claude Code CLI",
5
5
  "module": "src/ccstatusline.ts",
6
6
  "type": "module",