claude-scope 0.8.4 → 0.8.5
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/dist/claude-scope.cjs +196 -39
- package/package.json +7 -7
package/dist/claude-scope.cjs
CHANGED
|
@@ -1229,7 +1229,7 @@ var init_renderer = __esm({
|
|
|
1229
1229
|
if (!widget.isEnabled()) {
|
|
1230
1230
|
continue;
|
|
1231
1231
|
}
|
|
1232
|
-
const line = widget.metadata.line ?? 0;
|
|
1232
|
+
const line = widget.getLine ? widget.getLine() : widget.metadata.line ?? 0;
|
|
1233
1233
|
if (!lineMap.has(line)) {
|
|
1234
1234
|
lineMap.set(line, []);
|
|
1235
1235
|
}
|
|
@@ -1355,6 +1355,28 @@ var init_widget_registry = __esm({
|
|
|
1355
1355
|
}
|
|
1356
1356
|
});
|
|
1357
1357
|
|
|
1358
|
+
// src/providers/mock-config-provider.ts
|
|
1359
|
+
var MockConfigProvider;
|
|
1360
|
+
var init_mock_config_provider = __esm({
|
|
1361
|
+
"src/providers/mock-config-provider.ts"() {
|
|
1362
|
+
"use strict";
|
|
1363
|
+
MockConfigProvider = class {
|
|
1364
|
+
/**
|
|
1365
|
+
* Return demo config counts
|
|
1366
|
+
* @returns Demo counts for CLAUDE.md, rules, MCPs, hooks
|
|
1367
|
+
*/
|
|
1368
|
+
async getConfigs() {
|
|
1369
|
+
return {
|
|
1370
|
+
claudeMdCount: 1,
|
|
1371
|
+
rulesCount: 3,
|
|
1372
|
+
mcpCount: 2,
|
|
1373
|
+
hooksCount: 4
|
|
1374
|
+
};
|
|
1375
|
+
}
|
|
1376
|
+
};
|
|
1377
|
+
}
|
|
1378
|
+
});
|
|
1379
|
+
|
|
1358
1380
|
// src/providers/mock-git.ts
|
|
1359
1381
|
var MockGit;
|
|
1360
1382
|
var init_mock_git = __esm({
|
|
@@ -1801,6 +1823,7 @@ var init_active_tools_widget = __esm({
|
|
|
1801
1823
|
// Display on third line (0-indexed)
|
|
1802
1824
|
};
|
|
1803
1825
|
style = "balanced";
|
|
1826
|
+
_lineOverride;
|
|
1804
1827
|
tools = [];
|
|
1805
1828
|
renderData;
|
|
1806
1829
|
/**
|
|
@@ -1810,6 +1833,12 @@ var init_active_tools_widget = __esm({
|
|
|
1810
1833
|
setStyle(style) {
|
|
1811
1834
|
this.style = style;
|
|
1812
1835
|
}
|
|
1836
|
+
setLine(line) {
|
|
1837
|
+
this._lineOverride = line;
|
|
1838
|
+
}
|
|
1839
|
+
getLine() {
|
|
1840
|
+
return this._lineOverride ?? this.metadata.line ?? 0;
|
|
1841
|
+
}
|
|
1813
1842
|
/**
|
|
1814
1843
|
* Aggregate completed tools by name and sort by count (descending)
|
|
1815
1844
|
* @param tools - Array of tool entries
|
|
@@ -2090,13 +2119,13 @@ var init_styles2 = __esm({
|
|
|
2090
2119
|
init_formatters();
|
|
2091
2120
|
cacheMetricsStyles = {
|
|
2092
2121
|
/**
|
|
2093
|
-
* balanced:
|
|
2122
|
+
* balanced: 35.0k cache with color coding
|
|
2094
2123
|
*/
|
|
2095
2124
|
balanced: (data, colors2) => {
|
|
2096
2125
|
const { cacheRead, hitRate } = data;
|
|
2097
2126
|
const color = colors2 ? getCacheColor(hitRate, colors2) : "";
|
|
2098
2127
|
const amount = color ? `${color}${formatK(cacheRead)} cache` : `${formatK(cacheRead)} cache`;
|
|
2099
|
-
return
|
|
2128
|
+
return amount;
|
|
2100
2129
|
},
|
|
2101
2130
|
/**
|
|
2102
2131
|
* compact: Cache: 35.0k
|
|
@@ -2180,6 +2209,7 @@ var init_cache_metrics_widget = __esm({
|
|
|
2180
2209
|
// Third line
|
|
2181
2210
|
);
|
|
2182
2211
|
theme;
|
|
2212
|
+
_lineOverride;
|
|
2183
2213
|
style = "balanced";
|
|
2184
2214
|
renderData;
|
|
2185
2215
|
cacheManager;
|
|
@@ -2195,6 +2225,12 @@ var init_cache_metrics_widget = __esm({
|
|
|
2195
2225
|
setStyle(style) {
|
|
2196
2226
|
this.style = style;
|
|
2197
2227
|
}
|
|
2228
|
+
setLine(line) {
|
|
2229
|
+
this._lineOverride = line;
|
|
2230
|
+
}
|
|
2231
|
+
getLine() {
|
|
2232
|
+
return this._lineOverride ?? this.metadata.line ?? 0;
|
|
2233
|
+
}
|
|
2198
2234
|
/**
|
|
2199
2235
|
* Calculate cache metrics from context usage data
|
|
2200
2236
|
* Returns null if no usage data is available (current or cached)
|
|
@@ -2474,75 +2510,104 @@ var configCountStyles;
|
|
|
2474
2510
|
var init_styles3 = __esm({
|
|
2475
2511
|
"src/widgets/config-count/styles.ts"() {
|
|
2476
2512
|
"use strict";
|
|
2513
|
+
init_colors();
|
|
2477
2514
|
configCountStyles = {
|
|
2478
|
-
balanced: (data) => {
|
|
2515
|
+
balanced: (data, colors2) => {
|
|
2479
2516
|
const { claudeMdCount, rulesCount, mcpCount, hooksCount } = data;
|
|
2480
2517
|
const parts = [];
|
|
2518
|
+
const info = colors2?.semantic.info ?? "";
|
|
2519
|
+
const muted = colors2?.base.muted ?? "";
|
|
2481
2520
|
if (claudeMdCount > 0) {
|
|
2482
|
-
|
|
2521
|
+
const label = info ? colorize("CLAUDE.md", info) : "CLAUDE.md";
|
|
2522
|
+
parts.push(`${label}:${claudeMdCount}`);
|
|
2483
2523
|
}
|
|
2484
2524
|
if (rulesCount > 0) {
|
|
2485
|
-
|
|
2525
|
+
const label = info ? colorize("rules", info) : "rules";
|
|
2526
|
+
parts.push(`${label}:${rulesCount}`);
|
|
2486
2527
|
}
|
|
2487
2528
|
if (mcpCount > 0) {
|
|
2488
|
-
|
|
2529
|
+
const label = info ? colorize("MCPs", info) : "MCPs";
|
|
2530
|
+
parts.push(`${label}:${mcpCount}`);
|
|
2489
2531
|
}
|
|
2490
2532
|
if (hooksCount > 0) {
|
|
2491
|
-
|
|
2533
|
+
const label = info ? colorize("hooks", info) : "hooks";
|
|
2534
|
+
parts.push(`${label}:${hooksCount}`);
|
|
2492
2535
|
}
|
|
2493
|
-
|
|
2536
|
+
const sep = muted ? colorize(" \u2502 ", muted) : " \u2502 ";
|
|
2537
|
+
return parts.join(sep);
|
|
2494
2538
|
},
|
|
2495
|
-
compact: (data) => {
|
|
2539
|
+
compact: (data, colors2) => {
|
|
2496
2540
|
const { claudeMdCount, rulesCount, mcpCount, hooksCount } = data;
|
|
2497
2541
|
const parts = [];
|
|
2542
|
+
const info = colors2?.semantic.info ?? "";
|
|
2543
|
+
const muted = colors2?.base.muted ?? "";
|
|
2498
2544
|
if (claudeMdCount > 0) {
|
|
2499
|
-
|
|
2545
|
+
const text = info ? colorize(`${claudeMdCount} docs`, info) : `${claudeMdCount} docs`;
|
|
2546
|
+
parts.push(text);
|
|
2500
2547
|
}
|
|
2501
2548
|
if (rulesCount > 0) {
|
|
2502
|
-
|
|
2549
|
+
const text = info ? colorize(`${rulesCount} rules`, info) : `${rulesCount} rules`;
|
|
2550
|
+
parts.push(text);
|
|
2503
2551
|
}
|
|
2504
2552
|
if (mcpCount > 0) {
|
|
2505
|
-
|
|
2553
|
+
const text = info ? colorize(`${mcpCount} MCPs`, info) : `${mcpCount} MCPs`;
|
|
2554
|
+
parts.push(text);
|
|
2506
2555
|
}
|
|
2507
2556
|
if (hooksCount > 0) {
|
|
2508
2557
|
const hookLabel = hooksCount === 1 ? "hook" : "hooks";
|
|
2509
|
-
|
|
2558
|
+
const text = info ? colorize(`${hooksCount} ${hookLabel}`, info) : `${hooksCount} ${hookLabel}`;
|
|
2559
|
+
parts.push(text);
|
|
2510
2560
|
}
|
|
2511
|
-
|
|
2561
|
+
const sep = muted ? colorize(" \u2502 ", muted) : " \u2502 ";
|
|
2562
|
+
return parts.join(sep);
|
|
2512
2563
|
},
|
|
2513
|
-
playful: (data) => {
|
|
2564
|
+
playful: (data, colors2) => {
|
|
2514
2565
|
const { claudeMdCount, rulesCount, mcpCount, hooksCount } = data;
|
|
2515
2566
|
const parts = [];
|
|
2567
|
+
const info = colors2?.semantic.info ?? "";
|
|
2568
|
+
const muted = colors2?.base.muted ?? "";
|
|
2516
2569
|
if (claudeMdCount > 0) {
|
|
2517
|
-
|
|
2570
|
+
const text = info ? colorize(`CLAUDE.md:${claudeMdCount}`, info) : `CLAUDE.md:${claudeMdCount}`;
|
|
2571
|
+
parts.push(`\u{1F4C4} ${text}`);
|
|
2518
2572
|
}
|
|
2519
2573
|
if (rulesCount > 0) {
|
|
2520
|
-
|
|
2574
|
+
const text = info ? colorize(`rules:${rulesCount}`, info) : `rules:${rulesCount}`;
|
|
2575
|
+
parts.push(`\u{1F4DC} ${text}`);
|
|
2521
2576
|
}
|
|
2522
2577
|
if (mcpCount > 0) {
|
|
2523
|
-
|
|
2578
|
+
const text = info ? colorize(`MCPs:${mcpCount}`, info) : `MCPs:${mcpCount}`;
|
|
2579
|
+
parts.push(`\u{1F50C} ${text}`);
|
|
2524
2580
|
}
|
|
2525
2581
|
if (hooksCount > 0) {
|
|
2526
|
-
|
|
2582
|
+
const text = info ? colorize(`hooks:${hooksCount}`, info) : `hooks:${hooksCount}`;
|
|
2583
|
+
parts.push(`\u{1FA9D} ${text}`);
|
|
2527
2584
|
}
|
|
2528
|
-
|
|
2585
|
+
const sep = muted ? colorize(" \u2502 ", muted) : " \u2502 ";
|
|
2586
|
+
return parts.join(sep);
|
|
2529
2587
|
},
|
|
2530
|
-
verbose: (data) => {
|
|
2588
|
+
verbose: (data, colors2) => {
|
|
2531
2589
|
const { claudeMdCount, rulesCount, mcpCount, hooksCount } = data;
|
|
2532
2590
|
const parts = [];
|
|
2591
|
+
const info = colors2?.semantic.info ?? "";
|
|
2592
|
+
const muted = colors2?.base.muted ?? "";
|
|
2533
2593
|
if (claudeMdCount > 0) {
|
|
2534
|
-
|
|
2594
|
+
const text = info ? colorize(`${claudeMdCount} CLAUDE.md`, info) : `${claudeMdCount} CLAUDE.md`;
|
|
2595
|
+
parts.push(text);
|
|
2535
2596
|
}
|
|
2536
2597
|
if (rulesCount > 0) {
|
|
2537
|
-
|
|
2598
|
+
const text = info ? colorize(`${rulesCount} rules`, info) : `${rulesCount} rules`;
|
|
2599
|
+
parts.push(text);
|
|
2538
2600
|
}
|
|
2539
2601
|
if (mcpCount > 0) {
|
|
2540
|
-
|
|
2602
|
+
const text = info ? colorize(`${mcpCount} MCP servers`, info) : `${mcpCount} MCP servers`;
|
|
2603
|
+
parts.push(text);
|
|
2541
2604
|
}
|
|
2542
2605
|
if (hooksCount > 0) {
|
|
2543
|
-
|
|
2606
|
+
const text = info ? colorize(`${hooksCount} hooks`, info) : `${hooksCount} hooks`;
|
|
2607
|
+
parts.push(text);
|
|
2544
2608
|
}
|
|
2545
|
-
|
|
2609
|
+
const sep = muted ? colorize(" \u2502 ", muted) : " \u2502 ";
|
|
2610
|
+
return parts.join(sep);
|
|
2546
2611
|
}
|
|
2547
2612
|
};
|
|
2548
2613
|
}
|
|
@@ -2556,6 +2621,7 @@ var init_config_count_widget = __esm({
|
|
|
2556
2621
|
init_style_types();
|
|
2557
2622
|
init_widget_types();
|
|
2558
2623
|
init_config_provider();
|
|
2624
|
+
init_theme();
|
|
2559
2625
|
init_styles3();
|
|
2560
2626
|
ConfigCountWidget = class {
|
|
2561
2627
|
id = "config-count";
|
|
@@ -2567,16 +2633,28 @@ var init_config_count_widget = __esm({
|
|
|
2567
2633
|
1
|
|
2568
2634
|
// Second line
|
|
2569
2635
|
);
|
|
2570
|
-
configProvider
|
|
2636
|
+
configProvider;
|
|
2571
2637
|
configs;
|
|
2572
2638
|
cwd;
|
|
2639
|
+
themeColors;
|
|
2640
|
+
_lineOverride;
|
|
2573
2641
|
styleFn = configCountStyles.balanced;
|
|
2642
|
+
constructor(configProvider, themeColors) {
|
|
2643
|
+
this.configProvider = configProvider ?? new ConfigProvider();
|
|
2644
|
+
this.themeColors = themeColors ?? DEFAULT_THEME;
|
|
2645
|
+
}
|
|
2574
2646
|
setStyle(style = DEFAULT_WIDGET_STYLE) {
|
|
2575
2647
|
const fn = configCountStyles[style];
|
|
2576
2648
|
if (fn) {
|
|
2577
2649
|
this.styleFn = fn;
|
|
2578
2650
|
}
|
|
2579
2651
|
}
|
|
2652
|
+
setLine(line) {
|
|
2653
|
+
this._lineOverride = line;
|
|
2654
|
+
}
|
|
2655
|
+
getLine() {
|
|
2656
|
+
return this._lineOverride ?? this.metadata.line ?? 0;
|
|
2657
|
+
}
|
|
2580
2658
|
async initialize() {
|
|
2581
2659
|
}
|
|
2582
2660
|
async update(data) {
|
|
@@ -2599,9 +2677,10 @@ var init_config_count_widget = __esm({
|
|
|
2599
2677
|
claudeMdCount,
|
|
2600
2678
|
rulesCount,
|
|
2601
2679
|
mcpCount,
|
|
2602
|
-
hooksCount
|
|
2680
|
+
hooksCount,
|
|
2681
|
+
colors: this.themeColors
|
|
2603
2682
|
};
|
|
2604
|
-
return this.styleFn(renderData);
|
|
2683
|
+
return this.styleFn(renderData, this.themeColors);
|
|
2605
2684
|
}
|
|
2606
2685
|
async cleanup() {
|
|
2607
2686
|
}
|
|
@@ -2715,6 +2794,7 @@ var init_context_widget = __esm({
|
|
|
2715
2794
|
// First line
|
|
2716
2795
|
);
|
|
2717
2796
|
colors;
|
|
2797
|
+
_lineOverride;
|
|
2718
2798
|
styleFn = contextStyles.balanced;
|
|
2719
2799
|
cacheManager;
|
|
2720
2800
|
lastSessionId;
|
|
@@ -2729,6 +2809,12 @@ var init_context_widget = __esm({
|
|
|
2729
2809
|
this.styleFn = fn;
|
|
2730
2810
|
}
|
|
2731
2811
|
}
|
|
2812
|
+
setLine(line) {
|
|
2813
|
+
this._lineOverride = line;
|
|
2814
|
+
}
|
|
2815
|
+
getLine() {
|
|
2816
|
+
return this._lineOverride ?? this.metadata.line ?? 0;
|
|
2817
|
+
}
|
|
2732
2818
|
/**
|
|
2733
2819
|
* Update widget with new data, storing valid values in cache
|
|
2734
2820
|
*/
|
|
@@ -2837,6 +2923,7 @@ var init_cost_widget = __esm({
|
|
|
2837
2923
|
// First line
|
|
2838
2924
|
);
|
|
2839
2925
|
colors;
|
|
2926
|
+
_lineOverride;
|
|
2840
2927
|
styleFn = costStyles.balanced;
|
|
2841
2928
|
constructor(colors2) {
|
|
2842
2929
|
super();
|
|
@@ -2848,6 +2935,12 @@ var init_cost_widget = __esm({
|
|
|
2848
2935
|
this.styleFn = fn;
|
|
2849
2936
|
}
|
|
2850
2937
|
}
|
|
2938
|
+
setLine(line) {
|
|
2939
|
+
this._lineOverride = line;
|
|
2940
|
+
}
|
|
2941
|
+
getLine() {
|
|
2942
|
+
return this._lineOverride ?? this.metadata.line ?? 0;
|
|
2943
|
+
}
|
|
2851
2944
|
renderWithData(data, _context) {
|
|
2852
2945
|
if (!data.cost || data.cost.total_cost_usd === void 0) return null;
|
|
2853
2946
|
const renderData = {
|
|
@@ -2915,17 +3008,25 @@ var init_styles6 = __esm({
|
|
|
2915
3008
|
const totalSeconds = Math.floor(data.durationMs / 1e3);
|
|
2916
3009
|
const hours = Math.floor(totalSeconds / 3600);
|
|
2917
3010
|
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
3011
|
+
const seconds = totalSeconds % 60;
|
|
2918
3012
|
if (!colors2) {
|
|
2919
3013
|
if (hours > 0) {
|
|
2920
|
-
return `\u231B ${hours}h ${minutes}m`;
|
|
3014
|
+
return `\u231B ${hours}h ${minutes}m ${seconds}s`;
|
|
2921
3015
|
}
|
|
2922
|
-
|
|
3016
|
+
if (minutes > 0) {
|
|
3017
|
+
return `\u231B ${minutes}m ${seconds}s`;
|
|
3018
|
+
}
|
|
3019
|
+
return `\u231B ${seconds}s`;
|
|
2923
3020
|
}
|
|
2924
3021
|
if (hours > 0) {
|
|
2925
|
-
const colored = colorize(`${hours}`, colors2.value) + colorize("h", colors2.unit) + colorize(` ${minutes}`, colors2.value) + colorize("m", colors2.unit);
|
|
3022
|
+
const colored = colorize(`${hours}`, colors2.value) + colorize("h", colors2.unit) + colorize(` ${minutes}`, colors2.value) + colorize("m", colors2.unit) + colorize(` ${seconds}`, colors2.value) + colorize("s", colors2.unit);
|
|
3023
|
+
return `\u231B ${colored}`;
|
|
3024
|
+
}
|
|
3025
|
+
if (minutes > 0) {
|
|
3026
|
+
const colored = colorize(`${minutes}`, colors2.value) + colorize("m", colors2.unit) + colorize(` ${seconds}`, colors2.value) + colorize("s", colors2.unit);
|
|
2926
3027
|
return `\u231B ${colored}`;
|
|
2927
3028
|
}
|
|
2928
|
-
return `\u231B ${colorize(`${
|
|
3029
|
+
return `\u231B ${colorize(`${seconds}`, colors2.value)}${colorize("s", colors2.unit)}`;
|
|
2929
3030
|
},
|
|
2930
3031
|
technical: (data, colors2) => {
|
|
2931
3032
|
const value = `${Math.floor(data.durationMs)}ms`;
|
|
@@ -2968,6 +3069,7 @@ var init_duration_widget = __esm({
|
|
|
2968
3069
|
// First line
|
|
2969
3070
|
);
|
|
2970
3071
|
colors;
|
|
3072
|
+
_lineOverride;
|
|
2971
3073
|
styleFn = durationStyles.balanced;
|
|
2972
3074
|
constructor(colors2) {
|
|
2973
3075
|
super();
|
|
@@ -2979,6 +3081,12 @@ var init_duration_widget = __esm({
|
|
|
2979
3081
|
this.styleFn = fn;
|
|
2980
3082
|
}
|
|
2981
3083
|
}
|
|
3084
|
+
setLine(line) {
|
|
3085
|
+
this._lineOverride = line;
|
|
3086
|
+
}
|
|
3087
|
+
getLine() {
|
|
3088
|
+
return this._lineOverride ?? this.metadata.line ?? 0;
|
|
3089
|
+
}
|
|
2982
3090
|
renderWithData(data, _context) {
|
|
2983
3091
|
if (!data.cost || data.cost.total_duration_ms === void 0) return null;
|
|
2984
3092
|
const renderData = {
|
|
@@ -3121,6 +3229,7 @@ var init_git_tag_widget = __esm({
|
|
|
3121
3229
|
enabled = true;
|
|
3122
3230
|
cwd = null;
|
|
3123
3231
|
colors;
|
|
3232
|
+
_lineOverride;
|
|
3124
3233
|
styleFn = gitTagStyles.balanced;
|
|
3125
3234
|
/**
|
|
3126
3235
|
* @param gitFactory - Optional factory function for creating IGit instances
|
|
@@ -3138,6 +3247,12 @@ var init_git_tag_widget = __esm({
|
|
|
3138
3247
|
this.styleFn = fn;
|
|
3139
3248
|
}
|
|
3140
3249
|
}
|
|
3250
|
+
setLine(line) {
|
|
3251
|
+
this._lineOverride = line;
|
|
3252
|
+
}
|
|
3253
|
+
getLine() {
|
|
3254
|
+
return this._lineOverride ?? this.metadata.line ?? 0;
|
|
3255
|
+
}
|
|
3141
3256
|
async initialize(context) {
|
|
3142
3257
|
this.enabled = context.config?.enabled !== false;
|
|
3143
3258
|
}
|
|
@@ -3288,6 +3403,7 @@ var init_git_widget = __esm({
|
|
|
3288
3403
|
enabled = true;
|
|
3289
3404
|
cwd = null;
|
|
3290
3405
|
colors;
|
|
3406
|
+
_lineOverride;
|
|
3291
3407
|
styleFn = gitStyles.balanced;
|
|
3292
3408
|
/**
|
|
3293
3409
|
* @param gitFactory - Optional factory function for creating IGit instances
|
|
@@ -3305,6 +3421,12 @@ var init_git_widget = __esm({
|
|
|
3305
3421
|
this.styleFn = fn;
|
|
3306
3422
|
}
|
|
3307
3423
|
}
|
|
3424
|
+
setLine(line) {
|
|
3425
|
+
this._lineOverride = line;
|
|
3426
|
+
}
|
|
3427
|
+
getLine() {
|
|
3428
|
+
return this._lineOverride ?? this.metadata.line ?? 0;
|
|
3429
|
+
}
|
|
3308
3430
|
async initialize(context) {
|
|
3309
3431
|
this.enabled = context.config?.enabled !== false;
|
|
3310
3432
|
}
|
|
@@ -3429,6 +3551,7 @@ var init_lines_widget = __esm({
|
|
|
3429
3551
|
// First line
|
|
3430
3552
|
);
|
|
3431
3553
|
colors;
|
|
3554
|
+
_lineOverride;
|
|
3432
3555
|
styleFn = linesStyles.balanced;
|
|
3433
3556
|
constructor(colors2) {
|
|
3434
3557
|
super();
|
|
@@ -3440,6 +3563,12 @@ var init_lines_widget = __esm({
|
|
|
3440
3563
|
this.styleFn = fn;
|
|
3441
3564
|
}
|
|
3442
3565
|
}
|
|
3566
|
+
setLine(line) {
|
|
3567
|
+
this._lineOverride = line;
|
|
3568
|
+
}
|
|
3569
|
+
getLine() {
|
|
3570
|
+
return this._lineOverride ?? this.metadata.line ?? 0;
|
|
3571
|
+
}
|
|
3443
3572
|
renderWithData(data, _context) {
|
|
3444
3573
|
const added = data.cost?.total_lines_added ?? 0;
|
|
3445
3574
|
const removed = data.cost?.total_lines_removed ?? 0;
|
|
@@ -3522,6 +3651,7 @@ var init_model_widget = __esm({
|
|
|
3522
3651
|
// First line
|
|
3523
3652
|
);
|
|
3524
3653
|
colors;
|
|
3654
|
+
_lineOverride;
|
|
3525
3655
|
styleFn = modelStyles.balanced;
|
|
3526
3656
|
constructor(colors2) {
|
|
3527
3657
|
super();
|
|
@@ -3533,6 +3663,12 @@ var init_model_widget = __esm({
|
|
|
3533
3663
|
this.styleFn = fn;
|
|
3534
3664
|
}
|
|
3535
3665
|
}
|
|
3666
|
+
setLine(line) {
|
|
3667
|
+
this._lineOverride = line;
|
|
3668
|
+
}
|
|
3669
|
+
getLine() {
|
|
3670
|
+
return this._lineOverride ?? this.metadata.line ?? 0;
|
|
3671
|
+
}
|
|
3536
3672
|
renderWithData(data, _context) {
|
|
3537
3673
|
const renderData = {
|
|
3538
3674
|
displayName: data.model.display_name,
|
|
@@ -3631,7 +3767,8 @@ async function registerWidgetsFromConfig(registry, config, style, themeName) {
|
|
|
3631
3767
|
return w;
|
|
3632
3768
|
},
|
|
3633
3769
|
"config-count": (s) => {
|
|
3634
|
-
const
|
|
3770
|
+
const mockConfig = new MockConfigProvider();
|
|
3771
|
+
const w = new ConfigCountWidget(mockConfig, themeColors);
|
|
3635
3772
|
w.setStyle(s);
|
|
3636
3773
|
return w;
|
|
3637
3774
|
},
|
|
@@ -3682,6 +3819,7 @@ var init_layout_preview = __esm({
|
|
|
3682
3819
|
"use strict";
|
|
3683
3820
|
init_renderer();
|
|
3684
3821
|
init_widget_registry();
|
|
3822
|
+
init_mock_config_provider();
|
|
3685
3823
|
init_mock_git();
|
|
3686
3824
|
init_mock_transcript_provider();
|
|
3687
3825
|
init_theme();
|
|
@@ -7373,12 +7511,19 @@ var EmptyLineWidget = class extends StdinDataWidget {
|
|
|
7373
7511
|
5
|
|
7374
7512
|
// Sixth line (0-indexed)
|
|
7375
7513
|
);
|
|
7514
|
+
_lineOverride;
|
|
7376
7515
|
/**
|
|
7377
7516
|
* All styles return the same value (Braille Pattern Blank).
|
|
7378
7517
|
* This method exists for API consistency with other widgets.
|
|
7379
7518
|
*/
|
|
7380
7519
|
setStyle(_style) {
|
|
7381
7520
|
}
|
|
7521
|
+
setLine(line) {
|
|
7522
|
+
this._lineOverride = line;
|
|
7523
|
+
}
|
|
7524
|
+
getLine() {
|
|
7525
|
+
return this._lineOverride ?? this.metadata.line ?? 0;
|
|
7526
|
+
}
|
|
7382
7527
|
/**
|
|
7383
7528
|
* Return Braille Pattern Blank to create a visible empty separator line.
|
|
7384
7529
|
* U+2800 occupies cell width but appears blank, ensuring the line renders.
|
|
@@ -7958,6 +8103,7 @@ var PokerWidget = class extends StdinDataWidget {
|
|
|
7958
8103
|
THROTTLE_MS = 5e3;
|
|
7959
8104
|
// 5 seconds
|
|
7960
8105
|
colors;
|
|
8106
|
+
_lineOverride;
|
|
7961
8107
|
styleFn = pokerStyles.balanced;
|
|
7962
8108
|
setStyle(style = DEFAULT_WIDGET_STYLE) {
|
|
7963
8109
|
const fn = pokerStyles[style];
|
|
@@ -7965,6 +8111,12 @@ var PokerWidget = class extends StdinDataWidget {
|
|
|
7965
8111
|
this.styleFn = fn;
|
|
7966
8112
|
}
|
|
7967
8113
|
}
|
|
8114
|
+
setLine(line) {
|
|
8115
|
+
this._lineOverride = line;
|
|
8116
|
+
}
|
|
8117
|
+
getLine() {
|
|
8118
|
+
return this._lineOverride ?? this.metadata.line ?? 0;
|
|
8119
|
+
}
|
|
7968
8120
|
constructor(colors2) {
|
|
7969
8121
|
super();
|
|
7970
8122
|
this.colors = colors2 ?? DEFAULT_THEME;
|
|
@@ -8051,10 +8203,15 @@ async function readStdin() {
|
|
|
8051
8203
|
return Buffer.concat(chunks).toString("utf8");
|
|
8052
8204
|
}
|
|
8053
8205
|
function applyWidgetConfig(widget, widgetId, config) {
|
|
8054
|
-
for (const
|
|
8055
|
-
const widgetConfig =
|
|
8056
|
-
if (widgetConfig
|
|
8057
|
-
widget.setStyle(widgetConfig.style)
|
|
8206
|
+
for (const [lineNum, widgets] of Object.entries(config.lines)) {
|
|
8207
|
+
const widgetConfig = widgets.find((w) => w.id === widgetId);
|
|
8208
|
+
if (widgetConfig) {
|
|
8209
|
+
if (typeof widget.setStyle === "function" && isValidWidgetStyle(widgetConfig.style)) {
|
|
8210
|
+
widget.setStyle(widgetConfig.style);
|
|
8211
|
+
}
|
|
8212
|
+
if (typeof widget.setLine === "function") {
|
|
8213
|
+
widget.setLine(parseInt(lineNum, 10));
|
|
8214
|
+
}
|
|
8058
8215
|
break;
|
|
8059
8216
|
}
|
|
8060
8217
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-scope",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "Claude Code plugin for session status and analytics",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"build:tsc": "tsc",
|
|
20
20
|
"build:bundle": "esbuild src/index.ts --bundle --platform=node --target=node18 --outfile=dist/claude-scope.cjs && chmod +x dist/claude-scope.cjs",
|
|
21
21
|
"prebuild:bundle": "npm run build:tsc",
|
|
22
|
-
"test": "tsx --test tests/e2e/stdin-flow.test.ts tests/integration/cli-flow.integration.test.ts tests/integration/five-widgets.integration.test.ts tests/integration/quick-config.integration.test.ts tests/integration/three-stage-config-flow.test.ts tests/unit/cli.test.ts tests/unit/cli/commands/quick-config/*.test.ts tests/unit/types.test.ts tests/unit/config/*.test.ts tests/unit/core/*.test.ts tests/unit/data/*.test.ts tests/unit/utils/*.test.ts tests/unit/widgets/*.test.ts tests/unit/ui/theme/*.test.ts",
|
|
23
|
-
"test:unit": "tsx --test tests/unit/cli.test.ts tests/unit/types.test.ts tests/unit/config/*.test.ts tests/unit/core/*.test.ts tests/unit/data/*.test.ts tests/unit/utils/*.test.ts tests/unit/widgets/*.test.ts",
|
|
24
|
-
"test:integration": "tsx --test tests/e2e/stdin-flow.test.ts tests/integration/cli-flow.integration.test.ts tests/integration/five-widgets.integration.test.ts tests/integration/quick-config.integration.test.ts tests/integration/three-stage-config-flow.test.ts",
|
|
25
|
-
"test:coverage": "c8 --check-coverage --lines=80 --functions=75 --statements=80 --branches=65 --reporter=text --reporter=html --exclude='tests/**' --exclude='**/*.test.ts' tsx --test tests/e2e/stdin-flow.test.ts tests/integration/cli-flow.integration.test.ts tests/integration/five-widgets.integration.test.ts tests/integration/quick-config.integration.test.ts tests/integration/three-stage-config-flow.test.ts tests/unit/cli.test.ts tests/unit/cli/commands/quick-config/*.test.ts tests/unit/types.test.ts tests/unit/config/*.test.ts tests/unit/core/*.test.ts tests/unit/data/*.test.ts tests/unit/utils/*.test.ts tests/unit/widgets/*.test.ts tests/unit/ui/theme/*.test.ts",
|
|
26
|
-
"test:snapshot": "SNAPSHOT_UPDATE=true tsx --test tests/e2e/stdin-flow.test.ts tests/integration/cli-flow.integration.test.ts tests/integration/five-widgets.integration.test.ts tests/integration/quick-config.integration.test.ts tests/integration/three-stage-config-flow.test.ts tests/unit/cli.test.ts tests/unit/cli/commands/quick-config/*.test.ts tests/unit/types.test.ts tests/unit/config/*.test.ts tests/unit/core/*.test.ts tests/unit/data/*.test.ts tests/unit/utils/*.test.ts tests/unit/widgets/*.test.ts",
|
|
27
|
-
"test:snapshot:verify": "tsx --test tests/e2e/stdin-flow.test.ts tests/integration/cli-flow.integration.test.ts tests/integration/five-widgets.integration.test.ts tests/integration/quick-config.integration.test.ts tests/integration/three-stage-config-flow.test.ts tests/unit/cli.test.ts tests/unit/cli/commands/quick-config/*.test.ts tests/unit/types.test.ts tests/unit/config/*.test.ts tests/unit/core/*.test.ts tests/unit/data/*.test.ts tests/unit/utils/*.test.ts tests/unit/widgets/*.test.ts",
|
|
22
|
+
"test": "tsx --test tests/e2e/stdin-flow.test.ts tests/integration/cli-flow.integration.test.ts tests/integration/config-line-assignment.test.ts tests/integration/five-widgets.integration.test.ts tests/integration/preview-mock-config.test.ts tests/integration/quick-config.integration.test.ts tests/integration/three-stage-config-flow.test.ts tests/unit/cli.test.ts tests/unit/cli/commands/quick-config/*.test.ts tests/unit/providers/*.test.ts tests/unit/types.test.ts tests/unit/config/*.test.ts tests/unit/core/*.test.ts tests/unit/data/*.test.ts tests/unit/utils/*.test.ts tests/unit/widgets/*.test.ts tests/unit/ui/theme/*.test.ts",
|
|
23
|
+
"test:unit": "tsx --test tests/unit/cli.test.ts tests/unit/providers/*.test.ts tests/unit/types.test.ts tests/unit/config/*.test.ts tests/unit/core/*.test.ts tests/unit/data/*.test.ts tests/unit/utils/*.test.ts tests/unit/widgets/*.test.ts",
|
|
24
|
+
"test:integration": "tsx --test tests/e2e/stdin-flow.test.ts tests/integration/cli-flow.integration.test.ts tests/integration/config-line-assignment.test.ts tests/integration/five-widgets.integration.test.ts tests/integration/preview-mock-config.test.ts tests/integration/quick-config.integration.test.ts tests/integration/three-stage-config-flow.test.ts",
|
|
25
|
+
"test:coverage": "c8 --check-coverage --lines=80 --functions=75 --statements=80 --branches=65 --reporter=text --reporter=html --exclude='tests/**' --exclude='**/*.test.ts' tsx --test tests/e2e/stdin-flow.test.ts tests/integration/cli-flow.integration.test.ts tests/integration/config-line-assignment.test.ts tests/integration/five-widgets.integration.test.ts tests/integration/preview-mock-config.test.ts tests/integration/quick-config.integration.test.ts tests/integration/three-stage-config-flow.test.ts tests/unit/cli.test.ts tests/unit/cli/commands/quick-config/*.test.ts tests/unit/providers/*.test.ts tests/unit/types.test.ts tests/unit/config/*.test.ts tests/unit/core/*.test.ts tests/unit/data/*.test.ts tests/unit/utils/*.test.ts tests/unit/widgets/*.test.ts tests/unit/ui/theme/*.test.ts",
|
|
26
|
+
"test:snapshot": "SNAPSHOT_UPDATE=true tsx --test tests/e2e/stdin-flow.test.ts tests/integration/cli-flow.integration.test.ts tests/integration/config-line-assignment.test.ts tests/integration/five-widgets.integration.test.ts tests/integration/preview-mock-config.test.ts tests/integration/quick-config.integration.test.ts tests/integration/three-stage-config-flow.test.ts tests/unit/cli.test.ts tests/unit/cli/commands/quick-config/*.test.ts tests/unit/providers/*.test.ts tests/unit/types.test.ts tests/unit/config/*.test.ts tests/unit/core/*.test.ts tests/unit/data/*.test.ts tests/unit/utils/*.test.ts tests/unit/widgets/*.test.ts",
|
|
27
|
+
"test:snapshot:verify": "tsx --test tests/e2e/stdin-flow.test.ts tests/integration/cli-flow.integration.test.ts tests/integration/config-line-assignment.test.ts tests/integration/five-widgets.integration.test.ts tests/integration/preview-mock-config.test.ts tests/integration/quick-config.integration.test.ts tests/integration/three-stage-config-flow.test.ts tests/unit/cli.test.ts tests/unit/cli/commands/quick-config/*.test.ts tests/unit/providers/*.test.ts tests/unit/types.test.ts tests/unit/config/*.test.ts tests/unit/core/*.test.ts tests/unit/data/*.test.ts tests/unit/utils/*.test.ts tests/unit/widgets/*.test.ts",
|
|
28
28
|
"dev": "tsx src/index.ts",
|
|
29
29
|
"prepare": "husky",
|
|
30
30
|
"lint": "biome check .",
|