claude-scope 0.8.49 → 1.0.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 +129 -186
- package/dist/claude-scope.cjs +619 -529
- package/package.json +1 -1
package/dist/claude-scope.cjs
CHANGED
|
@@ -1996,17 +1996,17 @@ var init_stdin_data_widget = __esm({
|
|
|
1996
1996
|
});
|
|
1997
1997
|
|
|
1998
1998
|
// src/widgets/active-tools/styles.ts
|
|
1999
|
-
function truncatePath(
|
|
2000
|
-
if (
|
|
2001
|
-
return
|
|
1999
|
+
function truncatePath(path3) {
|
|
2000
|
+
if (path3.length <= 30) {
|
|
2001
|
+
return path3;
|
|
2002
2002
|
}
|
|
2003
|
-
const parts =
|
|
2003
|
+
const parts = path3.split("/");
|
|
2004
2004
|
return ".../" + parts[parts.length - 1];
|
|
2005
2005
|
}
|
|
2006
|
-
function formatTool(name, target,
|
|
2007
|
-
const nameStr = colorize(name,
|
|
2006
|
+
function formatTool(name, target, colors3) {
|
|
2007
|
+
const nameStr = colorize(name, colors3.tools.name);
|
|
2008
2008
|
if (target) {
|
|
2009
|
-
const targetStr = colorize(": " + truncatePath(target),
|
|
2009
|
+
const targetStr = colorize(": " + truncatePath(target), colors3.tools.target);
|
|
2010
2010
|
return nameStr + targetStr;
|
|
2011
2011
|
}
|
|
2012
2012
|
return nameStr;
|
|
@@ -2123,9 +2123,9 @@ var init_styles = __esm({
|
|
|
2123
2123
|
* - Only completed: "Tools: 6"
|
|
2124
2124
|
* - No symbols, just text format
|
|
2125
2125
|
*/
|
|
2126
|
-
balanced: (data,
|
|
2126
|
+
balanced: (data, colors3) => {
|
|
2127
2127
|
const parts = [];
|
|
2128
|
-
const c =
|
|
2128
|
+
const c = colors3 ?? getDefaultColors();
|
|
2129
2129
|
const allToolNames = /* @__PURE__ */ new Set();
|
|
2130
2130
|
for (const tool of data.running) {
|
|
2131
2131
|
allToolNames.add(tool.name);
|
|
@@ -2166,9 +2166,9 @@ var init_styles = __esm({
|
|
|
2166
2166
|
/**
|
|
2167
2167
|
* compact: [ToolName] format for all tools
|
|
2168
2168
|
*/
|
|
2169
|
-
compact: (data,
|
|
2169
|
+
compact: (data, colors3) => {
|
|
2170
2170
|
const parts = [];
|
|
2171
|
-
const c =
|
|
2171
|
+
const c = colors3 ?? getDefaultColors();
|
|
2172
2172
|
for (const tool of data.running) {
|
|
2173
2173
|
parts.push("[" + colorize(tool.name, c.tools.name) + "]");
|
|
2174
2174
|
}
|
|
@@ -2183,19 +2183,19 @@ var init_styles = __esm({
|
|
|
2183
2183
|
/**
|
|
2184
2184
|
* minimal: Same as compact
|
|
2185
2185
|
*/
|
|
2186
|
-
minimal: (data,
|
|
2186
|
+
minimal: (data, colors3) => {
|
|
2187
2187
|
const compactStyle = activeToolsStyles.compact;
|
|
2188
2188
|
if (!compactStyle) return "";
|
|
2189
|
-
return compactStyle(data,
|
|
2189
|
+
return compactStyle(data, colors3);
|
|
2190
2190
|
},
|
|
2191
2191
|
/**
|
|
2192
2192
|
* playful: Emojis (📖✏️✨🔄🔍📁) with tool counts (like balanced but more fun)
|
|
2193
2193
|
* - Shows running + completed counts like balanced style
|
|
2194
2194
|
* - Uses emojis instead of text labels for a more playful look
|
|
2195
2195
|
*/
|
|
2196
|
-
playful: (data,
|
|
2196
|
+
playful: (data, colors3) => {
|
|
2197
2197
|
const parts = [];
|
|
2198
|
-
const c =
|
|
2198
|
+
const c = colors3 ?? getDefaultColors();
|
|
2199
2199
|
const emojis = {
|
|
2200
2200
|
Read: "\u{1F4D6}",
|
|
2201
2201
|
Write: "\u270F\uFE0F",
|
|
@@ -2245,9 +2245,9 @@ var init_styles = __esm({
|
|
|
2245
2245
|
/**
|
|
2246
2246
|
* verbose: Full text labels "Running:" and "Completed:"
|
|
2247
2247
|
*/
|
|
2248
|
-
verbose: (data,
|
|
2248
|
+
verbose: (data, colors3) => {
|
|
2249
2249
|
const parts = [];
|
|
2250
|
-
const c =
|
|
2250
|
+
const c = colors3 ?? getDefaultColors();
|
|
2251
2251
|
for (const tool of data.running) {
|
|
2252
2252
|
const label = colorize("Running:", c.tools.running);
|
|
2253
2253
|
parts.push(label + " " + formatTool(tool.name, tool.target, c));
|
|
@@ -2266,8 +2266,8 @@ var init_styles = __esm({
|
|
|
2266
2266
|
/**
|
|
2267
2267
|
* labeled: "Tools:" prefix with all tools
|
|
2268
2268
|
*/
|
|
2269
|
-
labeled: (data,
|
|
2270
|
-
const c =
|
|
2269
|
+
labeled: (data, colors3) => {
|
|
2270
|
+
const c = colors3 ?? getDefaultColors();
|
|
2271
2271
|
const allTools = [
|
|
2272
2272
|
...data.running.map((t) => {
|
|
2273
2273
|
const indicator = colorize("\u25D0", c.tools.running);
|
|
@@ -2282,15 +2282,15 @@ var init_styles = __esm({
|
|
|
2282
2282
|
if (allTools.length === 0) {
|
|
2283
2283
|
return "";
|
|
2284
2284
|
}
|
|
2285
|
-
const prefix =
|
|
2285
|
+
const prefix = colors3 ? colorize("Tools:", c.semantic.info) : "Tools:";
|
|
2286
2286
|
return prefix + ": " + allTools.join(" | ");
|
|
2287
2287
|
},
|
|
2288
2288
|
/**
|
|
2289
2289
|
* indicator: ● bullet indicators
|
|
2290
2290
|
*/
|
|
2291
|
-
indicator: (data,
|
|
2291
|
+
indicator: (data, colors3) => {
|
|
2292
2292
|
const parts = [];
|
|
2293
|
-
const c =
|
|
2293
|
+
const c = colors3 ?? getDefaultColors();
|
|
2294
2294
|
for (const tool of data.running) {
|
|
2295
2295
|
const bullet = colorize("\u25CF", c.semantic.info);
|
|
2296
2296
|
parts.push(bullet + " " + formatTool(tool.name, tool.target, c));
|
|
@@ -2317,9 +2317,9 @@ var init_active_tools_widget = __esm({
|
|
|
2317
2317
|
init_stdin_data_widget();
|
|
2318
2318
|
init_styles();
|
|
2319
2319
|
ActiveToolsWidget = class extends StdinDataWidget {
|
|
2320
|
-
constructor(
|
|
2320
|
+
constructor(colors3, transcriptProvider) {
|
|
2321
2321
|
super();
|
|
2322
|
-
this.colors =
|
|
2322
|
+
this.colors = colors3;
|
|
2323
2323
|
this.transcriptProvider = transcriptProvider;
|
|
2324
2324
|
}
|
|
2325
2325
|
id = "active-tools";
|
|
@@ -2811,13 +2811,13 @@ function formatCurrency(usd) {
|
|
|
2811
2811
|
}
|
|
2812
2812
|
return `$${usd.toFixed(2)}`;
|
|
2813
2813
|
}
|
|
2814
|
-
function getCacheColor(hitRate,
|
|
2814
|
+
function getCacheColor(hitRate, colors3) {
|
|
2815
2815
|
if (hitRate > 70) {
|
|
2816
|
-
return
|
|
2816
|
+
return colors3.cache.high;
|
|
2817
2817
|
} else if (hitRate >= 40) {
|
|
2818
|
-
return
|
|
2818
|
+
return colors3.cache.medium;
|
|
2819
2819
|
} else {
|
|
2820
|
-
return
|
|
2820
|
+
return colors3.cache.low;
|
|
2821
2821
|
}
|
|
2822
2822
|
}
|
|
2823
2823
|
var cacheMetricsStyles;
|
|
@@ -2829,20 +2829,20 @@ var init_styles2 = __esm({
|
|
|
2829
2829
|
/**
|
|
2830
2830
|
* balanced: 35.0k cache with color coding
|
|
2831
2831
|
*/
|
|
2832
|
-
balanced: (data,
|
|
2832
|
+
balanced: (data, colors3) => {
|
|
2833
2833
|
const { cacheRead, hitRate } = data;
|
|
2834
|
-
const color =
|
|
2834
|
+
const color = colors3 ? getCacheColor(hitRate, colors3) : "";
|
|
2835
2835
|
const amount = color ? `${color}${formatK(cacheRead)} cache` : `${formatK(cacheRead)} cache`;
|
|
2836
2836
|
return amount;
|
|
2837
2837
|
},
|
|
2838
2838
|
/**
|
|
2839
2839
|
* compact: Cache: 35.0k
|
|
2840
2840
|
*/
|
|
2841
|
-
compact: (data,
|
|
2841
|
+
compact: (data, colors3) => {
|
|
2842
2842
|
const { cacheRead } = data;
|
|
2843
2843
|
const amount = formatK(cacheRead);
|
|
2844
|
-
if (
|
|
2845
|
-
return `${
|
|
2844
|
+
if (colors3) {
|
|
2845
|
+
return `${colors3.cache.read}Cache: ${amount}`;
|
|
2846
2846
|
}
|
|
2847
2847
|
return `Cache: ${amount}`;
|
|
2848
2848
|
},
|
|
@@ -2857,37 +2857,37 @@ var init_styles2 = __esm({
|
|
|
2857
2857
|
/**
|
|
2858
2858
|
* verbose: Cache: 35.0k | $0.03 saved
|
|
2859
2859
|
*/
|
|
2860
|
-
verbose: (data,
|
|
2860
|
+
verbose: (data, colors3) => {
|
|
2861
2861
|
const { cacheRead, savings } = data;
|
|
2862
2862
|
const amount = formatK(cacheRead);
|
|
2863
|
-
const saved =
|
|
2863
|
+
const saved = colors3 ? `${colors3.cache.write}${formatCurrency(savings)} saved` : `${formatCurrency(savings)} saved`;
|
|
2864
2864
|
return `Cache: ${amount} | ${saved}`;
|
|
2865
2865
|
},
|
|
2866
2866
|
/**
|
|
2867
2867
|
* labeled: Cache: 35.0k | $0.03 saved
|
|
2868
2868
|
*/
|
|
2869
|
-
labeled: (data,
|
|
2869
|
+
labeled: (data, colors3) => {
|
|
2870
2870
|
const { cacheRead, savings } = data;
|
|
2871
2871
|
const amount = formatK(cacheRead);
|
|
2872
|
-
const saved =
|
|
2872
|
+
const saved = colors3 ? `${colors3.cache.write}${formatCurrency(savings)} saved` : `${formatCurrency(savings)} saved`;
|
|
2873
2873
|
return `Cache: ${amount} | ${saved}`;
|
|
2874
2874
|
},
|
|
2875
2875
|
/**
|
|
2876
2876
|
* indicator: ● 35.0k cache with color coding
|
|
2877
2877
|
*/
|
|
2878
|
-
indicator: (data,
|
|
2878
|
+
indicator: (data, colors3) => {
|
|
2879
2879
|
const { cacheRead, hitRate } = data;
|
|
2880
|
-
const color =
|
|
2880
|
+
const color = colors3 ? getCacheColor(hitRate, colors3) : "";
|
|
2881
2881
|
const amount = color ? `${color}${formatK(cacheRead)} cache` : `${formatK(cacheRead)} cache`;
|
|
2882
2882
|
return `\u25CF ${amount}`;
|
|
2883
2883
|
},
|
|
2884
2884
|
/**
|
|
2885
2885
|
* breakdown: Single-line with Hit: and Write: breakdown
|
|
2886
2886
|
*/
|
|
2887
|
-
breakdown: (data,
|
|
2887
|
+
breakdown: (data, colors3) => {
|
|
2888
2888
|
const { cacheRead, cacheWrite, savings } = data;
|
|
2889
2889
|
const amount = formatK(cacheRead);
|
|
2890
|
-
const saved =
|
|
2890
|
+
const saved = colors3 ? `${colors3.cache.write}${formatCurrency(savings)} saved` : `${formatCurrency(savings)} saved`;
|
|
2891
2891
|
const read = formatK(cacheRead);
|
|
2892
2892
|
const write = formatK(cacheWrite);
|
|
2893
2893
|
return `\u{1F4BE} ${amount} cache | Hit: ${read}, Write: ${write} | ${saved}`;
|
|
@@ -2927,9 +2927,9 @@ var init_cache_metrics_widget = __esm({
|
|
|
2927
2927
|
// Cache parsed usage within render cycle
|
|
2928
2928
|
cachedCumulativeCache;
|
|
2929
2929
|
// Cumulative cache for session
|
|
2930
|
-
constructor(
|
|
2930
|
+
constructor(colors3) {
|
|
2931
2931
|
super();
|
|
2932
|
-
this.colors =
|
|
2932
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
2933
2933
|
this.cacheManager = new CacheManager();
|
|
2934
2934
|
this.usageParser = new UsageParser();
|
|
2935
2935
|
}
|
|
@@ -3246,93 +3246,93 @@ var init_styles3 = __esm({
|
|
|
3246
3246
|
"use strict";
|
|
3247
3247
|
init_colors();
|
|
3248
3248
|
configCountStyles = {
|
|
3249
|
-
balanced: (data,
|
|
3249
|
+
balanced: (data, colors3) => {
|
|
3250
3250
|
const { claudeMdCount, rulesCount, mcpCount, hooksCount } = data;
|
|
3251
3251
|
const parts = [];
|
|
3252
3252
|
if (claudeMdCount > 0) {
|
|
3253
|
-
const label =
|
|
3253
|
+
const label = colors3 ? colorize("CLAUDE.md", colors3.label) : "CLAUDE.md";
|
|
3254
3254
|
parts.push(`${label}:${claudeMdCount}`);
|
|
3255
3255
|
}
|
|
3256
3256
|
if (rulesCount > 0) {
|
|
3257
|
-
const label =
|
|
3257
|
+
const label = colors3 ? colorize("rules", colors3.label) : "rules";
|
|
3258
3258
|
parts.push(`${label}:${rulesCount}`);
|
|
3259
3259
|
}
|
|
3260
3260
|
if (mcpCount > 0) {
|
|
3261
|
-
const label =
|
|
3261
|
+
const label = colors3 ? colorize("MCPs", colors3.label) : "MCPs";
|
|
3262
3262
|
parts.push(`${label}:${mcpCount}`);
|
|
3263
3263
|
}
|
|
3264
3264
|
if (hooksCount > 0) {
|
|
3265
|
-
const label =
|
|
3265
|
+
const label = colors3 ? colorize("hooks", colors3.label) : "hooks";
|
|
3266
3266
|
parts.push(`${label}:${hooksCount}`);
|
|
3267
3267
|
}
|
|
3268
|
-
const sep =
|
|
3268
|
+
const sep = colors3 ? colorize(" \u2502 ", colors3.separator) : " \u2502 ";
|
|
3269
3269
|
return parts.join(sep);
|
|
3270
3270
|
},
|
|
3271
|
-
compact: (data,
|
|
3271
|
+
compact: (data, colors3) => {
|
|
3272
3272
|
const { claudeMdCount, rulesCount, mcpCount, hooksCount } = data;
|
|
3273
3273
|
const parts = [];
|
|
3274
3274
|
if (claudeMdCount > 0) {
|
|
3275
|
-
const text =
|
|
3275
|
+
const text = colors3 ? colorize(`${claudeMdCount} docs`, colors3.label) : `${claudeMdCount} docs`;
|
|
3276
3276
|
parts.push(text);
|
|
3277
3277
|
}
|
|
3278
3278
|
if (rulesCount > 0) {
|
|
3279
|
-
const text =
|
|
3279
|
+
const text = colors3 ? colorize(`${rulesCount} rules`, colors3.label) : `${rulesCount} rules`;
|
|
3280
3280
|
parts.push(text);
|
|
3281
3281
|
}
|
|
3282
3282
|
if (mcpCount > 0) {
|
|
3283
|
-
const text =
|
|
3283
|
+
const text = colors3 ? colorize(`${mcpCount} MCPs`, colors3.label) : `${mcpCount} MCPs`;
|
|
3284
3284
|
parts.push(text);
|
|
3285
3285
|
}
|
|
3286
3286
|
if (hooksCount > 0) {
|
|
3287
3287
|
const hookLabel = hooksCount === 1 ? "hook" : "hooks";
|
|
3288
|
-
const text =
|
|
3288
|
+
const text = colors3 ? colorize(`${hooksCount} ${hookLabel}`, colors3.label) : `${hooksCount} ${hookLabel}`;
|
|
3289
3289
|
parts.push(text);
|
|
3290
3290
|
}
|
|
3291
|
-
const sep =
|
|
3291
|
+
const sep = colors3 ? colorize(" \u2502 ", colors3.separator) : " \u2502 ";
|
|
3292
3292
|
return parts.join(sep);
|
|
3293
3293
|
},
|
|
3294
|
-
playful: (data,
|
|
3294
|
+
playful: (data, colors3) => {
|
|
3295
3295
|
const { claudeMdCount, rulesCount, mcpCount, hooksCount } = data;
|
|
3296
3296
|
const parts = [];
|
|
3297
3297
|
if (claudeMdCount > 0) {
|
|
3298
|
-
const text =
|
|
3298
|
+
const text = colors3 ? colorize(`CLAUDE.md:${claudeMdCount}`, colors3.label) : `CLAUDE.md:${claudeMdCount}`;
|
|
3299
3299
|
parts.push(`\u{1F4C4} ${text}`);
|
|
3300
3300
|
}
|
|
3301
3301
|
if (rulesCount > 0) {
|
|
3302
|
-
const text =
|
|
3302
|
+
const text = colors3 ? colorize(`rules:${rulesCount}`, colors3.label) : `rules:${rulesCount}`;
|
|
3303
3303
|
parts.push(`\u{1F4DC} ${text}`);
|
|
3304
3304
|
}
|
|
3305
3305
|
if (mcpCount > 0) {
|
|
3306
|
-
const text =
|
|
3306
|
+
const text = colors3 ? colorize(`MCPs:${mcpCount}`, colors3.label) : `MCPs:${mcpCount}`;
|
|
3307
3307
|
parts.push(`\u{1F50C} ${text}`);
|
|
3308
3308
|
}
|
|
3309
3309
|
if (hooksCount > 0) {
|
|
3310
|
-
const text =
|
|
3310
|
+
const text = colors3 ? colorize(`hooks:${hooksCount}`, colors3.label) : `hooks:${hooksCount}`;
|
|
3311
3311
|
parts.push(`\u{1FA9D} ${text}`);
|
|
3312
3312
|
}
|
|
3313
|
-
const sep =
|
|
3313
|
+
const sep = colors3 ? colorize(" \u2502 ", colors3.separator) : " \u2502 ";
|
|
3314
3314
|
return parts.join(sep);
|
|
3315
3315
|
},
|
|
3316
|
-
verbose: (data,
|
|
3316
|
+
verbose: (data, colors3) => {
|
|
3317
3317
|
const { claudeMdCount, rulesCount, mcpCount, hooksCount } = data;
|
|
3318
3318
|
const parts = [];
|
|
3319
3319
|
if (claudeMdCount > 0) {
|
|
3320
|
-
const text =
|
|
3320
|
+
const text = colors3 ? colorize(`${claudeMdCount} CLAUDE.md`, colors3.label) : `${claudeMdCount} CLAUDE.md`;
|
|
3321
3321
|
parts.push(text);
|
|
3322
3322
|
}
|
|
3323
3323
|
if (rulesCount > 0) {
|
|
3324
|
-
const text =
|
|
3324
|
+
const text = colors3 ? colorize(`${rulesCount} rules`, colors3.label) : `${rulesCount} rules`;
|
|
3325
3325
|
parts.push(text);
|
|
3326
3326
|
}
|
|
3327
3327
|
if (mcpCount > 0) {
|
|
3328
|
-
const text =
|
|
3328
|
+
const text = colors3 ? colorize(`${mcpCount} MCP servers`, colors3.label) : `${mcpCount} MCP servers`;
|
|
3329
3329
|
parts.push(text);
|
|
3330
3330
|
}
|
|
3331
3331
|
if (hooksCount > 0) {
|
|
3332
|
-
const text =
|
|
3332
|
+
const text = colors3 ? colorize(`${hooksCount} hooks`, colors3.label) : `${hooksCount} hooks`;
|
|
3333
3333
|
parts.push(text);
|
|
3334
3334
|
}
|
|
3335
|
-
const sep =
|
|
3335
|
+
const sep = colors3 ? colorize(" \u2502 ", colors3.separator) : " \u2502 ";
|
|
3336
3336
|
return parts.join(sep);
|
|
3337
3337
|
}
|
|
3338
3338
|
};
|
|
@@ -3365,9 +3365,9 @@ var init_config_count_widget = __esm({
|
|
|
3365
3365
|
enabled = true;
|
|
3366
3366
|
styleFn = configCountStyles.balanced;
|
|
3367
3367
|
_lineOverride;
|
|
3368
|
-
constructor(configProvider,
|
|
3368
|
+
constructor(configProvider, colors3) {
|
|
3369
3369
|
this.configProvider = configProvider ?? new ConfigProvider();
|
|
3370
|
-
this.colors =
|
|
3370
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
3371
3371
|
}
|
|
3372
3372
|
setStyle(style = DEFAULT_WIDGET_STYLE) {
|
|
3373
3373
|
const fn = configCountStyles[style];
|
|
@@ -3432,14 +3432,14 @@ var init_style_utils = __esm({
|
|
|
3432
3432
|
});
|
|
3433
3433
|
|
|
3434
3434
|
// src/widgets/context/styles.ts
|
|
3435
|
-
function getContextColor(percent,
|
|
3435
|
+
function getContextColor(percent, colors3) {
|
|
3436
3436
|
const clampedPercent = Math.max(0, Math.min(100, percent));
|
|
3437
3437
|
if (clampedPercent < 50) {
|
|
3438
|
-
return
|
|
3438
|
+
return colors3.low;
|
|
3439
3439
|
} else if (clampedPercent < 80) {
|
|
3440
|
-
return
|
|
3440
|
+
return colors3.medium;
|
|
3441
3441
|
} else {
|
|
3442
|
-
return
|
|
3442
|
+
return colors3.high;
|
|
3443
3443
|
}
|
|
3444
3444
|
}
|
|
3445
3445
|
var contextStyles;
|
|
@@ -3449,48 +3449,48 @@ var init_styles4 = __esm({
|
|
|
3449
3449
|
init_colors();
|
|
3450
3450
|
init_style_utils();
|
|
3451
3451
|
contextStyles = {
|
|
3452
|
-
balanced: (data,
|
|
3452
|
+
balanced: (data, colors3) => {
|
|
3453
3453
|
const bar = progressBar(data.percent, 10);
|
|
3454
3454
|
const output = `[${bar}] ${data.percent}%`;
|
|
3455
|
-
if (!
|
|
3456
|
-
return colorize(output, getContextColor(data.percent,
|
|
3455
|
+
if (!colors3) return output;
|
|
3456
|
+
return colorize(output, getContextColor(data.percent, colors3));
|
|
3457
3457
|
},
|
|
3458
|
-
compact: (data,
|
|
3458
|
+
compact: (data, colors3) => {
|
|
3459
3459
|
const output = `${data.percent}%`;
|
|
3460
|
-
if (!
|
|
3461
|
-
return colorize(output, getContextColor(data.percent,
|
|
3460
|
+
if (!colors3) return output;
|
|
3461
|
+
return colorize(output, getContextColor(data.percent, colors3));
|
|
3462
3462
|
},
|
|
3463
|
-
playful: (data,
|
|
3463
|
+
playful: (data, colors3) => {
|
|
3464
3464
|
const bar = progressBar(data.percent, 10);
|
|
3465
3465
|
const output = `\u{1F9E0} [${bar}] ${data.percent}%`;
|
|
3466
|
-
if (!
|
|
3467
|
-
return `\u{1F9E0} ${colorize(`[${bar}] ${data.percent}%`, getContextColor(data.percent,
|
|
3466
|
+
if (!colors3) return output;
|
|
3467
|
+
return `\u{1F9E0} ${colorize(`[${bar}] ${data.percent}%`, getContextColor(data.percent, colors3))}`;
|
|
3468
3468
|
},
|
|
3469
|
-
verbose: (data,
|
|
3469
|
+
verbose: (data, colors3) => {
|
|
3470
3470
|
const usedFormatted = data.used.toLocaleString();
|
|
3471
3471
|
const maxFormatted = data.contextWindowSize.toLocaleString();
|
|
3472
3472
|
const output = `${usedFormatted} / ${maxFormatted} tokens (${data.percent}%)`;
|
|
3473
|
-
if (!
|
|
3474
|
-
return colorize(output, getContextColor(data.percent,
|
|
3473
|
+
if (!colors3) return output;
|
|
3474
|
+
return colorize(output, getContextColor(data.percent, colors3));
|
|
3475
3475
|
},
|
|
3476
|
-
symbolic: (data,
|
|
3476
|
+
symbolic: (data, colors3) => {
|
|
3477
3477
|
const filled = Math.round(data.percent / 100 * 5);
|
|
3478
3478
|
const empty = 5 - filled;
|
|
3479
3479
|
const output = `${"\u25AE".repeat(filled)}${"\u25AF".repeat(empty)} ${data.percent}%`;
|
|
3480
|
-
if (!
|
|
3481
|
-
return colorize(output, getContextColor(data.percent,
|
|
3480
|
+
if (!colors3) return output;
|
|
3481
|
+
return colorize(output, getContextColor(data.percent, colors3));
|
|
3482
3482
|
},
|
|
3483
|
-
"compact-verbose": (data,
|
|
3483
|
+
"compact-verbose": (data, colors3) => {
|
|
3484
3484
|
const usedK = data.used >= 1e3 ? `${Math.floor(data.used / 1e3)}K` : data.used.toString();
|
|
3485
3485
|
const maxK = data.contextWindowSize >= 1e3 ? `${Math.floor(data.contextWindowSize / 1e3)}K` : data.contextWindowSize.toString();
|
|
3486
3486
|
const output = `${data.percent}% (${usedK}/${maxK})`;
|
|
3487
|
-
if (!
|
|
3488
|
-
return colorize(output, getContextColor(data.percent,
|
|
3487
|
+
if (!colors3) return output;
|
|
3488
|
+
return colorize(output, getContextColor(data.percent, colors3));
|
|
3489
3489
|
},
|
|
3490
|
-
indicator: (data,
|
|
3490
|
+
indicator: (data, colors3) => {
|
|
3491
3491
|
const output = `\u25CF ${data.percent}%`;
|
|
3492
|
-
if (!
|
|
3493
|
-
return colorize(output, getContextColor(data.percent,
|
|
3492
|
+
if (!colors3) return output;
|
|
3493
|
+
return colorize(output, getContextColor(data.percent, colors3));
|
|
3494
3494
|
}
|
|
3495
3495
|
};
|
|
3496
3496
|
}
|
|
@@ -3525,9 +3525,9 @@ var init_context_widget = __esm({
|
|
|
3525
3525
|
lastSessionId;
|
|
3526
3526
|
cachedUsage;
|
|
3527
3527
|
// Cache parsed usage within render cycle
|
|
3528
|
-
constructor(
|
|
3528
|
+
constructor(colors3) {
|
|
3529
3529
|
super();
|
|
3530
|
-
this.colors =
|
|
3530
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
3531
3531
|
this.cacheManager = new CacheManager();
|
|
3532
3532
|
this.usageParser = new UsageParser();
|
|
3533
3533
|
}
|
|
@@ -3619,11 +3619,11 @@ var init_context_widget = __esm({
|
|
|
3619
3619
|
});
|
|
3620
3620
|
|
|
3621
3621
|
// src/widgets/cost/styles.ts
|
|
3622
|
-
function balancedStyle(data,
|
|
3622
|
+
function balancedStyle(data, colors3) {
|
|
3623
3623
|
const formatted = formatCostUSD(data.costUsd);
|
|
3624
|
-
if (!
|
|
3624
|
+
if (!colors3) return formatted;
|
|
3625
3625
|
const amountStr = data.costUsd.toFixed(2);
|
|
3626
|
-
return colorize("$",
|
|
3626
|
+
return colorize("$", colors3.currency) + colorize(amountStr, colors3.amount);
|
|
3627
3627
|
}
|
|
3628
3628
|
var costStyles;
|
|
3629
3629
|
var init_styles5 = __esm({
|
|
@@ -3635,25 +3635,25 @@ var init_styles5 = __esm({
|
|
|
3635
3635
|
costStyles = {
|
|
3636
3636
|
balanced: balancedStyle,
|
|
3637
3637
|
compact: balancedStyle,
|
|
3638
|
-
playful: (data,
|
|
3638
|
+
playful: (data, colors3) => {
|
|
3639
3639
|
const formatted = formatCostUSD(data.costUsd);
|
|
3640
|
-
if (!
|
|
3640
|
+
if (!colors3) return `\u{1F4B0} ${formatted}`;
|
|
3641
3641
|
const amountStr = data.costUsd.toFixed(2);
|
|
3642
|
-
const colored = colorize("$",
|
|
3642
|
+
const colored = colorize("$", colors3.currency) + colorize(amountStr, colors3.amount);
|
|
3643
3643
|
return `\u{1F4B0} ${colored}`;
|
|
3644
3644
|
},
|
|
3645
|
-
labeled: (data,
|
|
3645
|
+
labeled: (data, colors3) => {
|
|
3646
3646
|
const formatted = formatCostUSD(data.costUsd);
|
|
3647
|
-
if (!
|
|
3647
|
+
if (!colors3) return withLabel("Cost", formatted);
|
|
3648
3648
|
const amountStr = data.costUsd.toFixed(2);
|
|
3649
|
-
const colored = colorize("$",
|
|
3649
|
+
const colored = colorize("$", colors3.currency) + colorize(amountStr, colors3.amount);
|
|
3650
3650
|
return withLabel("Cost", colored);
|
|
3651
3651
|
},
|
|
3652
|
-
indicator: (data,
|
|
3652
|
+
indicator: (data, colors3) => {
|
|
3653
3653
|
const formatted = formatCostUSD(data.costUsd);
|
|
3654
|
-
if (!
|
|
3654
|
+
if (!colors3) return withIndicator(formatted);
|
|
3655
3655
|
const amountStr = data.costUsd.toFixed(2);
|
|
3656
|
-
const colored = colorize("$",
|
|
3656
|
+
const colored = colorize("$", colors3.currency) + colorize(amountStr, colors3.amount);
|
|
3657
3657
|
return withIndicator(colored);
|
|
3658
3658
|
}
|
|
3659
3659
|
};
|
|
@@ -3682,9 +3682,9 @@ var init_cost_widget = __esm({
|
|
|
3682
3682
|
);
|
|
3683
3683
|
colors;
|
|
3684
3684
|
styleFn = costStyles.balanced;
|
|
3685
|
-
constructor(
|
|
3685
|
+
constructor(colors3) {
|
|
3686
3686
|
super();
|
|
3687
|
-
this.colors =
|
|
3687
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
3688
3688
|
}
|
|
3689
3689
|
setStyle(style = DEFAULT_WIDGET_STYLE) {
|
|
3690
3690
|
const fn = costStyles[style];
|
|
@@ -3844,49 +3844,49 @@ var init_styles6 = __esm({
|
|
|
3844
3844
|
"use strict";
|
|
3845
3845
|
init_colors();
|
|
3846
3846
|
devServerStyles = {
|
|
3847
|
-
balanced: (data,
|
|
3847
|
+
balanced: (data, colors3) => {
|
|
3848
3848
|
if (!data.server) return "";
|
|
3849
3849
|
const { name, icon, isRunning, isBuilding } = data.server;
|
|
3850
3850
|
const status = isRunning ? "running" : isBuilding ? "building" : "stopped";
|
|
3851
|
-
const coloredName =
|
|
3852
|
-
const coloredStatus =
|
|
3851
|
+
const coloredName = colors3 ? colorize(name, colors3.name) : name;
|
|
3852
|
+
const coloredStatus = colors3 ? colorize(`(${status})`, colors3.status) : `(${status})`;
|
|
3853
3853
|
return `${icon} ${coloredName} ${coloredStatus}`;
|
|
3854
3854
|
},
|
|
3855
|
-
compact: (data,
|
|
3855
|
+
compact: (data, colors3) => {
|
|
3856
3856
|
if (!data.server) return "";
|
|
3857
3857
|
const { name, icon, isRunning, isBuilding } = data.server;
|
|
3858
3858
|
const statusIcon = isRunning ? "\u{1F680}" : isBuilding ? "\u{1F528}" : "\u{1F4A4}";
|
|
3859
|
-
const coloredName =
|
|
3859
|
+
const coloredName = colors3 ? colorize(name, colors3.name) : name;
|
|
3860
3860
|
return `${icon} ${coloredName} ${statusIcon}`;
|
|
3861
3861
|
},
|
|
3862
|
-
playful: (data,
|
|
3862
|
+
playful: (data, colors3) => {
|
|
3863
3863
|
if (!data.server) return "";
|
|
3864
3864
|
const { name, isRunning, isBuilding } = data.server;
|
|
3865
3865
|
const emoji = isRunning ? "\u{1F3C3}" : isBuilding ? "\u{1F528}" : "\u{1F4A4}";
|
|
3866
|
-
const coloredName =
|
|
3866
|
+
const coloredName = colors3 ? colorize(name, colors3.name) : name;
|
|
3867
3867
|
return `${emoji} ${coloredName}`;
|
|
3868
3868
|
},
|
|
3869
|
-
verbose: (data,
|
|
3869
|
+
verbose: (data, colors3) => {
|
|
3870
3870
|
if (!data.server) return "";
|
|
3871
3871
|
const { name, isRunning, isBuilding } = data.server;
|
|
3872
3872
|
const status = isRunning ? "running" : isBuilding ? "building" : "stopped";
|
|
3873
|
-
const label =
|
|
3874
|
-
const coloredName =
|
|
3875
|
-
const coloredStatus =
|
|
3873
|
+
const label = colors3 ? colorize("Dev Server:", colors3.label) : "Dev Server:";
|
|
3874
|
+
const coloredName = colors3 ? colorize(name, colors3.name) : name;
|
|
3875
|
+
const coloredStatus = colors3 ? colorize(`(${status})`, colors3.status) : `(${status})`;
|
|
3876
3876
|
return `${label} ${coloredName} ${coloredStatus}`;
|
|
3877
3877
|
},
|
|
3878
|
-
labeled: (data,
|
|
3878
|
+
labeled: (data, colors3) => {
|
|
3879
3879
|
if (!data.server) return "";
|
|
3880
3880
|
const { name, icon, isRunning } = data.server;
|
|
3881
3881
|
const status = isRunning ? "\u{1F7E2}" : "\u{1F534}";
|
|
3882
|
-
const label =
|
|
3883
|
-
const coloredName =
|
|
3882
|
+
const label = colors3 ? colorize("Server:", colors3.label) : "Server:";
|
|
3883
|
+
const coloredName = colors3 ? colorize(name, colors3.name) : name;
|
|
3884
3884
|
return `${label} ${icon} ${coloredName} ${status}`;
|
|
3885
3885
|
},
|
|
3886
|
-
indicator: (data,
|
|
3886
|
+
indicator: (data, colors3) => {
|
|
3887
3887
|
if (!data.server) return "";
|
|
3888
3888
|
const { name, icon } = data.server;
|
|
3889
|
-
const coloredName =
|
|
3889
|
+
const coloredName = colors3 ? colorize(name, colors3.name) : name;
|
|
3890
3890
|
return `\u25CF ${icon} ${coloredName}`;
|
|
3891
3891
|
}
|
|
3892
3892
|
};
|
|
@@ -3920,8 +3920,8 @@ var init_dev_server_widget = __esm({
|
|
|
3920
3920
|
cwd = null;
|
|
3921
3921
|
portDetector;
|
|
3922
3922
|
processDetector;
|
|
3923
|
-
constructor(
|
|
3924
|
-
this.colors =
|
|
3923
|
+
constructor(colors3) {
|
|
3924
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
3925
3925
|
this.portDetector = new PortDetector();
|
|
3926
3926
|
this.processDetector = new ProcessDetector();
|
|
3927
3927
|
}
|
|
@@ -4017,61 +4017,61 @@ var init_styles7 = __esm({
|
|
|
4017
4017
|
"use strict";
|
|
4018
4018
|
init_colors();
|
|
4019
4019
|
dockerStyles = {
|
|
4020
|
-
balanced: (data,
|
|
4020
|
+
balanced: (data, colors3) => {
|
|
4021
4021
|
const { running, total } = data.status;
|
|
4022
4022
|
if (running === 0) return "";
|
|
4023
4023
|
const status = running > 0 ? "\u{1F7E2}" : "\u26AA";
|
|
4024
4024
|
const count = total > running ? `${running}/${total}` : `${running}`;
|
|
4025
|
-
const label =
|
|
4026
|
-
const coloredCount =
|
|
4025
|
+
const label = colors3 ? colorize("Docker:", colors3.label) : "Docker:";
|
|
4026
|
+
const coloredCount = colors3 ? colorize(count, colors3.count) : count;
|
|
4027
4027
|
return `${label} ${coloredCount} ${status}`;
|
|
4028
4028
|
},
|
|
4029
|
-
compact: (data,
|
|
4029
|
+
compact: (data, colors3) => {
|
|
4030
4030
|
const { running, total } = data.status;
|
|
4031
4031
|
if (running === 0) return "";
|
|
4032
4032
|
const count = total > running ? `${running}/${total}` : `${running}`;
|
|
4033
|
-
const coloredCount =
|
|
4033
|
+
const coloredCount = colors3 ? colorize(count, colors3.count) : count;
|
|
4034
4034
|
return `\u{1F433} ${coloredCount}`;
|
|
4035
4035
|
},
|
|
4036
|
-
playful: (data,
|
|
4036
|
+
playful: (data, colors3) => {
|
|
4037
4037
|
const { running, total } = data.status;
|
|
4038
4038
|
if (running === 0) return "\u{1F433} Docker: \u{1F4A4}";
|
|
4039
4039
|
const status = running > 0 ? "\u{1F7E2}" : "\u26AA";
|
|
4040
4040
|
const count = total > running ? `${running}/${total}` : `${running}`;
|
|
4041
|
-
const label =
|
|
4042
|
-
const coloredCount =
|
|
4041
|
+
const label = colors3 ? colorize("Docker:", colors3.label) : "Docker:";
|
|
4042
|
+
const coloredCount = colors3 ? colorize(count, colors3.count) : count;
|
|
4043
4043
|
return `\u{1F433} ${label} ${coloredCount} ${status}`;
|
|
4044
4044
|
},
|
|
4045
|
-
verbose: (data,
|
|
4045
|
+
verbose: (data, colors3) => {
|
|
4046
4046
|
const { running, total } = data.status;
|
|
4047
4047
|
if (running === 0) {
|
|
4048
|
-
const label2 =
|
|
4048
|
+
const label2 = colors3 ? colorize("Docker:", colors3.label) : "Docker:";
|
|
4049
4049
|
return `${label2} no containers running`;
|
|
4050
4050
|
}
|
|
4051
|
-
const label =
|
|
4052
|
-
const coloredRunning =
|
|
4051
|
+
const label = colors3 ? colorize("Docker:", colors3.label) : "Docker:";
|
|
4052
|
+
const coloredRunning = colors3 ? colorize(String(running), colors3.count) : String(running);
|
|
4053
4053
|
return `${label} ${coloredRunning} running${total > running ? ` / ${total} total` : ""}`;
|
|
4054
4054
|
},
|
|
4055
|
-
labeled: (data,
|
|
4055
|
+
labeled: (data, colors3) => {
|
|
4056
4056
|
const { running, total } = data.status;
|
|
4057
4057
|
if (running === 0) {
|
|
4058
|
-
const label2 =
|
|
4058
|
+
const label2 = colors3 ? colorize("Docker:", colors3.label) : "Docker:";
|
|
4059
4059
|
return `${label2} --`;
|
|
4060
4060
|
}
|
|
4061
4061
|
const count = total > running ? `${running}/${total}` : `${running}`;
|
|
4062
|
-
const label =
|
|
4063
|
-
const coloredCount =
|
|
4062
|
+
const label = colors3 ? colorize("Docker:", colors3.label) : "Docker:";
|
|
4063
|
+
const coloredCount = colors3 ? colorize(count, colors3.count) : count;
|
|
4064
4064
|
return `${label} ${coloredCount}`;
|
|
4065
4065
|
},
|
|
4066
|
-
indicator: (data,
|
|
4066
|
+
indicator: (data, colors3) => {
|
|
4067
4067
|
const { running, total } = data.status;
|
|
4068
4068
|
if (running === 0) {
|
|
4069
|
-
const label2 =
|
|
4069
|
+
const label2 = colors3 ? colorize("Docker:", colors3.label) : "Docker:";
|
|
4070
4070
|
return `\u25CF ${label2} --`;
|
|
4071
4071
|
}
|
|
4072
4072
|
const count = total > running ? `${running}/${total}` : `${running}`;
|
|
4073
|
-
const label =
|
|
4074
|
-
const coloredCount =
|
|
4073
|
+
const label = colors3 ? colorize("Docker:", colors3.label) : "Docker:";
|
|
4074
|
+
const coloredCount = colors3 ? colorize(count, colors3.count) : count;
|
|
4075
4075
|
return `\u25CF ${label} ${coloredCount}`;
|
|
4076
4076
|
}
|
|
4077
4077
|
};
|
|
@@ -4106,8 +4106,8 @@ var init_docker_widget = __esm({
|
|
|
4106
4106
|
cachedStatus = null;
|
|
4107
4107
|
lastCheck = 0;
|
|
4108
4108
|
CACHE_TTL = 5e3;
|
|
4109
|
-
constructor(
|
|
4110
|
-
this.colors =
|
|
4109
|
+
constructor(colors3) {
|
|
4110
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
4111
4111
|
}
|
|
4112
4112
|
setStyle(style = DEFAULT_WIDGET_STYLE) {
|
|
4113
4113
|
const fn = dockerStyles[style];
|
|
@@ -4166,8 +4166,8 @@ var init_docker_widget = __esm({
|
|
|
4166
4166
|
});
|
|
4167
4167
|
|
|
4168
4168
|
// src/widgets/duration/styles.ts
|
|
4169
|
-
function formatDurationWithColors(ms,
|
|
4170
|
-
if (ms <= 0) return colorize("0s",
|
|
4169
|
+
function formatDurationWithColors(ms, colors3) {
|
|
4170
|
+
if (ms <= 0) return colorize("0s", colors3.value);
|
|
4171
4171
|
const totalSeconds = Math.floor(ms / 1e3);
|
|
4172
4172
|
const hours = Math.floor(totalSeconds / 3600);
|
|
4173
4173
|
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
@@ -4175,17 +4175,17 @@ function formatDurationWithColors(ms, colors2) {
|
|
|
4175
4175
|
const parts = [];
|
|
4176
4176
|
if (hours > 0) {
|
|
4177
4177
|
parts.push(
|
|
4178
|
-
colorize(`${hours}`,
|
|
4179
|
-
colorize(`${minutes}`,
|
|
4180
|
-
colorize(`${seconds}`,
|
|
4178
|
+
colorize(`${hours}`, colors3.value) + colorize("h", colors3.unit),
|
|
4179
|
+
colorize(`${minutes}`, colors3.value) + colorize("m", colors3.unit),
|
|
4180
|
+
colorize(`${seconds}`, colors3.value) + colorize("s", colors3.unit)
|
|
4181
4181
|
);
|
|
4182
4182
|
} else if (minutes > 0) {
|
|
4183
4183
|
parts.push(
|
|
4184
|
-
colorize(`${minutes}`,
|
|
4185
|
-
colorize(`${seconds}`,
|
|
4184
|
+
colorize(`${minutes}`, colors3.value) + colorize("m", colors3.unit),
|
|
4185
|
+
colorize(`${seconds}`, colors3.value) + colorize("s", colors3.unit)
|
|
4186
4186
|
);
|
|
4187
4187
|
} else {
|
|
4188
|
-
parts.push(colorize(`${seconds}`,
|
|
4188
|
+
parts.push(colorize(`${seconds}`, colors3.value) + colorize("s", colors3.unit));
|
|
4189
4189
|
}
|
|
4190
4190
|
return parts.join(" ");
|
|
4191
4191
|
}
|
|
@@ -4197,32 +4197,32 @@ var init_styles8 = __esm({
|
|
|
4197
4197
|
init_formatters();
|
|
4198
4198
|
init_style_utils();
|
|
4199
4199
|
durationStyles = {
|
|
4200
|
-
balanced: (data,
|
|
4200
|
+
balanced: (data, colors3) => {
|
|
4201
4201
|
const formatted = formatDuration(data.durationMs);
|
|
4202
|
-
if (!
|
|
4203
|
-
return formatDurationWithColors(data.durationMs,
|
|
4202
|
+
if (!colors3) return formatted;
|
|
4203
|
+
return formatDurationWithColors(data.durationMs, colors3);
|
|
4204
4204
|
},
|
|
4205
|
-
compact: (data,
|
|
4205
|
+
compact: (data, colors3) => {
|
|
4206
4206
|
const totalSeconds = Math.floor(data.durationMs / 1e3);
|
|
4207
4207
|
const hours = Math.floor(totalSeconds / 3600);
|
|
4208
4208
|
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
4209
|
-
if (!
|
|
4209
|
+
if (!colors3) {
|
|
4210
4210
|
if (hours > 0) {
|
|
4211
4211
|
return `${hours}h${minutes}m`;
|
|
4212
4212
|
}
|
|
4213
4213
|
return `${minutes}m`;
|
|
4214
4214
|
}
|
|
4215
4215
|
if (hours > 0) {
|
|
4216
|
-
return colorize(`${hours}`,
|
|
4216
|
+
return colorize(`${hours}`, colors3.value) + colorize("h", colors3.unit) + colorize(`${minutes}`, colors3.value) + colorize("m", colors3.unit);
|
|
4217
4217
|
}
|
|
4218
|
-
return colorize(`${minutes}`,
|
|
4218
|
+
return colorize(`${minutes}`, colors3.value) + colorize("m", colors3.unit);
|
|
4219
4219
|
},
|
|
4220
|
-
playful: (data,
|
|
4220
|
+
playful: (data, colors3) => {
|
|
4221
4221
|
const totalSeconds = Math.floor(data.durationMs / 1e3);
|
|
4222
4222
|
const hours = Math.floor(totalSeconds / 3600);
|
|
4223
4223
|
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
4224
4224
|
const seconds = totalSeconds % 60;
|
|
4225
|
-
if (!
|
|
4225
|
+
if (!colors3) {
|
|
4226
4226
|
if (hours > 0) {
|
|
4227
4227
|
return `\u231B ${hours}h ${minutes}m ${seconds}s`;
|
|
4228
4228
|
}
|
|
@@ -4232,30 +4232,30 @@ var init_styles8 = __esm({
|
|
|
4232
4232
|
return `\u231B ${seconds}s`;
|
|
4233
4233
|
}
|
|
4234
4234
|
if (hours > 0) {
|
|
4235
|
-
const colored = colorize(`${hours}`,
|
|
4235
|
+
const colored = colorize(`${hours}`, colors3.value) + colorize("h", colors3.unit) + colorize(` ${minutes}`, colors3.value) + colorize("m", colors3.unit) + colorize(` ${seconds}`, colors3.value) + colorize("s", colors3.unit);
|
|
4236
4236
|
return `\u231B ${colored}`;
|
|
4237
4237
|
}
|
|
4238
4238
|
if (minutes > 0) {
|
|
4239
|
-
const colored = colorize(`${minutes}`,
|
|
4239
|
+
const colored = colorize(`${minutes}`, colors3.value) + colorize("m", colors3.unit) + colorize(` ${seconds}`, colors3.value) + colorize("s", colors3.unit);
|
|
4240
4240
|
return `\u231B ${colored}`;
|
|
4241
4241
|
}
|
|
4242
|
-
return `\u231B ${colorize(`${seconds}`,
|
|
4242
|
+
return `\u231B ${colorize(`${seconds}`, colors3.value)}${colorize("s", colors3.unit)}`;
|
|
4243
4243
|
},
|
|
4244
|
-
technical: (data,
|
|
4244
|
+
technical: (data, colors3) => {
|
|
4245
4245
|
const value = `${Math.floor(data.durationMs)}ms`;
|
|
4246
|
-
if (!
|
|
4247
|
-
return colorize(`${Math.floor(data.durationMs)}`,
|
|
4246
|
+
if (!colors3) return value;
|
|
4247
|
+
return colorize(`${Math.floor(data.durationMs)}`, colors3.value) + colorize("ms", colors3.unit);
|
|
4248
4248
|
},
|
|
4249
|
-
labeled: (data,
|
|
4249
|
+
labeled: (data, colors3) => {
|
|
4250
4250
|
const formatted = formatDuration(data.durationMs);
|
|
4251
|
-
if (!
|
|
4252
|
-
const colored = formatDurationWithColors(data.durationMs,
|
|
4251
|
+
if (!colors3) return withLabel("Time", formatted);
|
|
4252
|
+
const colored = formatDurationWithColors(data.durationMs, colors3);
|
|
4253
4253
|
return withLabel("Time", colored);
|
|
4254
4254
|
},
|
|
4255
|
-
indicator: (data,
|
|
4255
|
+
indicator: (data, colors3) => {
|
|
4256
4256
|
const formatted = formatDuration(data.durationMs);
|
|
4257
|
-
if (!
|
|
4258
|
-
const colored = formatDurationWithColors(data.durationMs,
|
|
4257
|
+
if (!colors3) return withIndicator(formatted);
|
|
4258
|
+
const colored = formatDurationWithColors(data.durationMs, colors3);
|
|
4259
4259
|
return withIndicator(colored);
|
|
4260
4260
|
}
|
|
4261
4261
|
};
|
|
@@ -4284,9 +4284,9 @@ var init_duration_widget = __esm({
|
|
|
4284
4284
|
);
|
|
4285
4285
|
colors;
|
|
4286
4286
|
styleFn = durationStyles.balanced;
|
|
4287
|
-
constructor(
|
|
4287
|
+
constructor(colors3) {
|
|
4288
4288
|
super();
|
|
4289
|
-
this.colors =
|
|
4289
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
4290
4290
|
}
|
|
4291
4291
|
setStyle(style = DEFAULT_WIDGET_STYLE) {
|
|
4292
4292
|
const fn = durationStyles[style];
|
|
@@ -4411,30 +4411,30 @@ var init_styles9 = __esm({
|
|
|
4411
4411
|
init_colors();
|
|
4412
4412
|
init_style_utils();
|
|
4413
4413
|
gitTagStyles = {
|
|
4414
|
-
balanced: (data,
|
|
4415
|
-
if (!
|
|
4416
|
-
return colorize(data.tag,
|
|
4414
|
+
balanced: (data, colors3) => {
|
|
4415
|
+
if (!colors3) return data.tag;
|
|
4416
|
+
return colorize(data.tag, colors3.branch);
|
|
4417
4417
|
},
|
|
4418
|
-
compact: (data,
|
|
4418
|
+
compact: (data, colors3) => {
|
|
4419
4419
|
const tag = data.tag.replace(/^v/, "");
|
|
4420
|
-
if (!
|
|
4421
|
-
return colorize(tag,
|
|
4420
|
+
if (!colors3) return tag;
|
|
4421
|
+
return colorize(tag, colors3.branch);
|
|
4422
4422
|
},
|
|
4423
|
-
playful: (data,
|
|
4424
|
-
if (!
|
|
4425
|
-
return `\u{1F3F7}\uFE0F ${colorize(data.tag,
|
|
4423
|
+
playful: (data, colors3) => {
|
|
4424
|
+
if (!colors3) return `\u{1F3F7}\uFE0F ${data.tag}`;
|
|
4425
|
+
return `\u{1F3F7}\uFE0F ${colorize(data.tag, colors3.branch)}`;
|
|
4426
4426
|
},
|
|
4427
|
-
verbose: (data,
|
|
4428
|
-
if (!
|
|
4429
|
-
return `version ${colorize(data.tag,
|
|
4427
|
+
verbose: (data, colors3) => {
|
|
4428
|
+
if (!colors3) return `version ${data.tag}`;
|
|
4429
|
+
return `version ${colorize(data.tag, colors3.branch)}`;
|
|
4430
4430
|
},
|
|
4431
|
-
labeled: (data,
|
|
4432
|
-
if (!
|
|
4433
|
-
return withLabel("Tag", colorize(data.tag,
|
|
4431
|
+
labeled: (data, colors3) => {
|
|
4432
|
+
if (!colors3) return withLabel("Tag", data.tag);
|
|
4433
|
+
return withLabel("Tag", colorize(data.tag, colors3.branch));
|
|
4434
4434
|
},
|
|
4435
|
-
indicator: (data,
|
|
4436
|
-
if (!
|
|
4437
|
-
return withIndicator(colorize(data.tag,
|
|
4435
|
+
indicator: (data, colors3) => {
|
|
4436
|
+
if (!colors3) return withIndicator(data.tag);
|
|
4437
|
+
return withIndicator(colorize(data.tag, colors3.branch));
|
|
4438
4438
|
}
|
|
4439
4439
|
};
|
|
4440
4440
|
}
|
|
@@ -4473,9 +4473,9 @@ var init_git_tag_widget = __esm({
|
|
|
4473
4473
|
* Tests can inject MockGit factory here
|
|
4474
4474
|
* @param colors - Optional theme colors
|
|
4475
4475
|
*/
|
|
4476
|
-
constructor(gitFactory,
|
|
4476
|
+
constructor(gitFactory, colors3) {
|
|
4477
4477
|
this.gitFactory = gitFactory || createGit;
|
|
4478
|
-
this.colors =
|
|
4478
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
4479
4479
|
}
|
|
4480
4480
|
setStyle(style = DEFAULT_WIDGET_STYLE) {
|
|
4481
4481
|
const fn = gitTagStyles[style];
|
|
@@ -4528,89 +4528,89 @@ var init_styles10 = __esm({
|
|
|
4528
4528
|
init_colors();
|
|
4529
4529
|
init_style_utils();
|
|
4530
4530
|
gitStyles = {
|
|
4531
|
-
minimal: (data,
|
|
4532
|
-
if (!
|
|
4533
|
-
return colorize(data.branch,
|
|
4531
|
+
minimal: (data, colors3) => {
|
|
4532
|
+
if (!colors3) return data.branch;
|
|
4533
|
+
return colorize(data.branch, colors3.branch);
|
|
4534
4534
|
},
|
|
4535
|
-
balanced: (data,
|
|
4535
|
+
balanced: (data, colors3) => {
|
|
4536
4536
|
if (data.changes && data.changes.files > 0) {
|
|
4537
4537
|
const parts = [];
|
|
4538
4538
|
if (data.changes.insertions > 0) parts.push(`+${data.changes.insertions}`);
|
|
4539
4539
|
if (data.changes.deletions > 0) parts.push(`-${data.changes.deletions}`);
|
|
4540
4540
|
if (parts.length > 0) {
|
|
4541
|
-
const branch =
|
|
4542
|
-
const changes =
|
|
4541
|
+
const branch = colors3 ? colorize(data.branch, colors3.branch) : data.branch;
|
|
4542
|
+
const changes = colors3 ? colorize(`[${parts.join(" ")}]`, colors3.changes) : `[${parts.join(" ")}]`;
|
|
4543
4543
|
return `${branch} ${changes}`;
|
|
4544
4544
|
}
|
|
4545
4545
|
}
|
|
4546
|
-
return
|
|
4546
|
+
return colors3 ? colorize(data.branch, colors3.branch) : data.branch;
|
|
4547
4547
|
},
|
|
4548
|
-
compact: (data,
|
|
4548
|
+
compact: (data, colors3) => {
|
|
4549
4549
|
if (data.changes && data.changes.files > 0) {
|
|
4550
4550
|
const parts = [];
|
|
4551
4551
|
if (data.changes.insertions > 0) parts.push(`+${data.changes.insertions}`);
|
|
4552
4552
|
if (data.changes.deletions > 0) parts.push(`-${data.changes.deletions}`);
|
|
4553
4553
|
if (parts.length > 0) {
|
|
4554
|
-
const branch =
|
|
4554
|
+
const branch = colors3 ? colorize(data.branch, colors3.branch) : data.branch;
|
|
4555
4555
|
const changesStr = parts.join("/");
|
|
4556
4556
|
return `${branch} ${changesStr}`;
|
|
4557
4557
|
}
|
|
4558
4558
|
}
|
|
4559
|
-
return
|
|
4559
|
+
return colors3 ? colorize(data.branch, colors3.branch) : data.branch;
|
|
4560
4560
|
},
|
|
4561
|
-
playful: (data,
|
|
4561
|
+
playful: (data, colors3) => {
|
|
4562
4562
|
if (data.changes && data.changes.files > 0) {
|
|
4563
4563
|
const parts = [];
|
|
4564
4564
|
if (data.changes.insertions > 0) parts.push(`\u2B06${data.changes.insertions}`);
|
|
4565
4565
|
if (data.changes.deletions > 0) parts.push(`\u2B07${data.changes.deletions}`);
|
|
4566
4566
|
if (parts.length > 0) {
|
|
4567
|
-
const branch2 =
|
|
4567
|
+
const branch2 = colors3 ? colorize(data.branch, colors3.branch) : data.branch;
|
|
4568
4568
|
return `\u{1F500} ${branch2} ${parts.join(" ")}`;
|
|
4569
4569
|
}
|
|
4570
4570
|
}
|
|
4571
|
-
const branch =
|
|
4571
|
+
const branch = colors3 ? colorize(data.branch, colors3.branch) : data.branch;
|
|
4572
4572
|
return `\u{1F500} ${branch}`;
|
|
4573
4573
|
},
|
|
4574
|
-
verbose: (data,
|
|
4574
|
+
verbose: (data, colors3) => {
|
|
4575
4575
|
if (data.changes && data.changes.files > 0) {
|
|
4576
4576
|
const parts = [];
|
|
4577
4577
|
if (data.changes.insertions > 0) parts.push(`+${data.changes.insertions} insertions`);
|
|
4578
4578
|
if (data.changes.deletions > 0) parts.push(`-${data.changes.deletions} deletions`);
|
|
4579
4579
|
if (parts.length > 0) {
|
|
4580
|
-
const branch2 =
|
|
4581
|
-
const changes =
|
|
4580
|
+
const branch2 = colors3 ? colorize(data.branch, colors3.branch) : data.branch;
|
|
4581
|
+
const changes = colors3 ? colorize(`[${parts.join(", ")}]`, colors3.changes) : `[${parts.join(", ")}]`;
|
|
4582
4582
|
return `branch: ${branch2} ${changes}`;
|
|
4583
4583
|
}
|
|
4584
4584
|
}
|
|
4585
|
-
const branch =
|
|
4585
|
+
const branch = colors3 ? colorize(data.branch, colors3.branch) : data.branch;
|
|
4586
4586
|
return `branch: ${branch} (HEAD)`;
|
|
4587
4587
|
},
|
|
4588
|
-
labeled: (data,
|
|
4588
|
+
labeled: (data, colors3) => {
|
|
4589
4589
|
if (data.changes && data.changes.files > 0) {
|
|
4590
4590
|
const parts = [];
|
|
4591
4591
|
if (data.changes.insertions > 0) parts.push(`+${data.changes.insertions}`);
|
|
4592
4592
|
if (data.changes.deletions > 0) parts.push(`-${data.changes.deletions}`);
|
|
4593
4593
|
if (parts.length > 0) {
|
|
4594
|
-
const branch2 =
|
|
4594
|
+
const branch2 = colors3 ? colorize(data.branch, colors3.branch) : data.branch;
|
|
4595
4595
|
const changes = `${data.changes.files} files: ${parts.join("/")}`;
|
|
4596
4596
|
return `Git: ${branch2} [${changes}]`;
|
|
4597
4597
|
}
|
|
4598
4598
|
}
|
|
4599
|
-
const branch =
|
|
4599
|
+
const branch = colors3 ? colorize(data.branch, colors3.branch) : data.branch;
|
|
4600
4600
|
return `Git: ${branch}`;
|
|
4601
4601
|
},
|
|
4602
|
-
indicator: (data,
|
|
4602
|
+
indicator: (data, colors3) => {
|
|
4603
4603
|
if (data.changes && data.changes.files > 0) {
|
|
4604
4604
|
const parts = [];
|
|
4605
4605
|
if (data.changes.insertions > 0) parts.push(`+${data.changes.insertions}`);
|
|
4606
4606
|
if (data.changes.deletions > 0) parts.push(`-${data.changes.deletions}`);
|
|
4607
4607
|
if (parts.length > 0) {
|
|
4608
|
-
const branch =
|
|
4609
|
-
const changes =
|
|
4608
|
+
const branch = colors3 ? colorize(data.branch, colors3.branch) : data.branch;
|
|
4609
|
+
const changes = colors3 ? colorize(`[${parts.join(" ")}]`, colors3.changes) : `[${parts.join(" ")}]`;
|
|
4610
4610
|
return `\u25CF ${branch} ${changes}`;
|
|
4611
4611
|
}
|
|
4612
4612
|
}
|
|
4613
|
-
return withIndicator(
|
|
4613
|
+
return withIndicator(colors3 ? colorize(data.branch, colors3.branch) : data.branch);
|
|
4614
4614
|
}
|
|
4615
4615
|
};
|
|
4616
4616
|
}
|
|
@@ -4649,9 +4649,9 @@ var init_git_widget = __esm({
|
|
|
4649
4649
|
* Tests can inject MockGit factory here
|
|
4650
4650
|
* @param colors - Optional theme colors
|
|
4651
4651
|
*/
|
|
4652
|
-
constructor(gitFactory,
|
|
4652
|
+
constructor(gitFactory, colors3) {
|
|
4653
4653
|
this.gitFactory = gitFactory || createGit;
|
|
4654
|
-
this.colors =
|
|
4654
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
4655
4655
|
}
|
|
4656
4656
|
setStyle(style = DEFAULT_WIDGET_STYLE) {
|
|
4657
4657
|
const fn = gitStyles[style];
|
|
@@ -4721,45 +4721,45 @@ var init_styles11 = __esm({
|
|
|
4721
4721
|
init_colors();
|
|
4722
4722
|
init_style_utils();
|
|
4723
4723
|
linesStyles = {
|
|
4724
|
-
balanced: (data,
|
|
4725
|
-
if (!
|
|
4726
|
-
const addedStr = colorize(`+${data.added}`,
|
|
4727
|
-
const removedStr = colorize(`-${data.removed}`,
|
|
4724
|
+
balanced: (data, colors3) => {
|
|
4725
|
+
if (!colors3) return `+${data.added}/-${data.removed}`;
|
|
4726
|
+
const addedStr = colorize(`+${data.added}`, colors3.added);
|
|
4727
|
+
const removedStr = colorize(`-${data.removed}`, colors3.removed);
|
|
4728
4728
|
return `${addedStr}/${removedStr}`;
|
|
4729
4729
|
},
|
|
4730
|
-
compact: (data,
|
|
4731
|
-
if (!
|
|
4732
|
-
const addedStr = colorize(`+${data.added}`,
|
|
4733
|
-
const removedStr = colorize(`-${data.removed}`,
|
|
4730
|
+
compact: (data, colors3) => {
|
|
4731
|
+
if (!colors3) return `+${data.added}-${data.removed}`;
|
|
4732
|
+
const addedStr = colorize(`+${data.added}`, colors3.added);
|
|
4733
|
+
const removedStr = colorize(`-${data.removed}`, colors3.removed);
|
|
4734
4734
|
return `${addedStr}${removedStr}`;
|
|
4735
4735
|
},
|
|
4736
|
-
playful: (data,
|
|
4737
|
-
if (!
|
|
4738
|
-
const addedStr = colorize(`\u2795${data.added}`,
|
|
4739
|
-
const removedStr = colorize(`\u2796${data.removed}`,
|
|
4736
|
+
playful: (data, colors3) => {
|
|
4737
|
+
if (!colors3) return `\u2795${data.added} \u2796${data.removed}`;
|
|
4738
|
+
const addedStr = colorize(`\u2795${data.added}`, colors3.added);
|
|
4739
|
+
const removedStr = colorize(`\u2796${data.removed}`, colors3.removed);
|
|
4740
4740
|
return `${addedStr} ${removedStr}`;
|
|
4741
4741
|
},
|
|
4742
|
-
verbose: (data,
|
|
4742
|
+
verbose: (data, colors3) => {
|
|
4743
4743
|
const parts = [];
|
|
4744
4744
|
if (data.added > 0) {
|
|
4745
4745
|
const text = `+${data.added} added`;
|
|
4746
|
-
parts.push(
|
|
4746
|
+
parts.push(colors3 ? colorize(text, colors3.added) : text);
|
|
4747
4747
|
}
|
|
4748
4748
|
if (data.removed > 0) {
|
|
4749
4749
|
const text = `-${data.removed} removed`;
|
|
4750
|
-
parts.push(
|
|
4750
|
+
parts.push(colors3 ? colorize(text, colors3.removed) : text);
|
|
4751
4751
|
}
|
|
4752
4752
|
return parts.join(", ");
|
|
4753
4753
|
},
|
|
4754
|
-
labeled: (data,
|
|
4755
|
-
const addedStr =
|
|
4756
|
-
const removedStr =
|
|
4754
|
+
labeled: (data, colors3) => {
|
|
4755
|
+
const addedStr = colors3 ? colorize(`+${data.added}`, colors3.added) : `+${data.added}`;
|
|
4756
|
+
const removedStr = colors3 ? colorize(`-${data.removed}`, colors3.removed) : `-${data.removed}`;
|
|
4757
4757
|
const lines = `${addedStr}/${removedStr}`;
|
|
4758
4758
|
return withLabel("Lines", lines);
|
|
4759
4759
|
},
|
|
4760
|
-
indicator: (data,
|
|
4761
|
-
const addedStr =
|
|
4762
|
-
const removedStr =
|
|
4760
|
+
indicator: (data, colors3) => {
|
|
4761
|
+
const addedStr = colors3 ? colorize(`+${data.added}`, colors3.added) : `+${data.added}`;
|
|
4762
|
+
const removedStr = colors3 ? colorize(`-${data.removed}`, colors3.removed) : `-${data.removed}`;
|
|
4763
4763
|
const lines = `${addedStr}/${removedStr}`;
|
|
4764
4764
|
return withIndicator(lines);
|
|
4765
4765
|
}
|
|
@@ -4789,9 +4789,9 @@ var init_lines_widget = __esm({
|
|
|
4789
4789
|
);
|
|
4790
4790
|
colors;
|
|
4791
4791
|
styleFn = linesStyles.balanced;
|
|
4792
|
-
constructor(
|
|
4792
|
+
constructor(colors3) {
|
|
4793
4793
|
super();
|
|
4794
|
-
this.colors =
|
|
4794
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
4795
4795
|
}
|
|
4796
4796
|
setStyle(style = DEFAULT_WIDGET_STYLE) {
|
|
4797
4797
|
const fn = linesStyles[style];
|
|
@@ -4821,42 +4821,42 @@ var init_styles12 = __esm({
|
|
|
4821
4821
|
init_colors();
|
|
4822
4822
|
init_style_utils();
|
|
4823
4823
|
modelStyles = {
|
|
4824
|
-
balanced: (data,
|
|
4825
|
-
if (!
|
|
4826
|
-
return colorize(data.displayName,
|
|
4824
|
+
balanced: (data, colors3) => {
|
|
4825
|
+
if (!colors3) return data.displayName;
|
|
4826
|
+
return colorize(data.displayName, colors3.name);
|
|
4827
4827
|
},
|
|
4828
|
-
compact: (data,
|
|
4828
|
+
compact: (data, colors3) => {
|
|
4829
4829
|
const shortName = getShortName(data.displayName);
|
|
4830
|
-
if (!
|
|
4831
|
-
return colorize(shortName,
|
|
4830
|
+
if (!colors3) return shortName;
|
|
4831
|
+
return colorize(shortName, colors3.name);
|
|
4832
4832
|
},
|
|
4833
|
-
playful: (data,
|
|
4833
|
+
playful: (data, colors3) => {
|
|
4834
4834
|
const shortName = getShortName(data.displayName);
|
|
4835
|
-
if (!
|
|
4836
|
-
return `\u{1F916} ${colorize(shortName,
|
|
4835
|
+
if (!colors3) return `\u{1F916} ${shortName}`;
|
|
4836
|
+
return `\u{1F916} ${colorize(shortName, colors3.name)}`;
|
|
4837
4837
|
},
|
|
4838
|
-
technical: (data,
|
|
4839
|
-
if (!
|
|
4838
|
+
technical: (data, colors3) => {
|
|
4839
|
+
if (!colors3) return data.id;
|
|
4840
4840
|
const match = data.id.match(/^(.+?)-(\d[\d.]*)$/);
|
|
4841
4841
|
if (match) {
|
|
4842
|
-
return colorize(match[1],
|
|
4842
|
+
return colorize(match[1], colors3.name) + colorize(`-${match[2]}`, colors3.version);
|
|
4843
4843
|
}
|
|
4844
|
-
return colorize(data.id,
|
|
4844
|
+
return colorize(data.id, colors3.name);
|
|
4845
4845
|
},
|
|
4846
|
-
symbolic: (data,
|
|
4846
|
+
symbolic: (data, colors3) => {
|
|
4847
4847
|
const shortName = getShortName(data.displayName);
|
|
4848
|
-
if (!
|
|
4849
|
-
return `\u25C6 ${colorize(shortName,
|
|
4848
|
+
if (!colors3) return `\u25C6 ${shortName}`;
|
|
4849
|
+
return `\u25C6 ${colorize(shortName, colors3.name)}`;
|
|
4850
4850
|
},
|
|
4851
|
-
labeled: (data,
|
|
4851
|
+
labeled: (data, colors3) => {
|
|
4852
4852
|
const shortName = getShortName(data.displayName);
|
|
4853
|
-
if (!
|
|
4854
|
-
return withLabel("Model", colorize(shortName,
|
|
4853
|
+
if (!colors3) return withLabel("Model", shortName);
|
|
4854
|
+
return withLabel("Model", colorize(shortName, colors3.name));
|
|
4855
4855
|
},
|
|
4856
|
-
indicator: (data,
|
|
4856
|
+
indicator: (data, colors3) => {
|
|
4857
4857
|
const shortName = getShortName(data.displayName);
|
|
4858
|
-
if (!
|
|
4859
|
-
return withIndicator(colorize(shortName,
|
|
4858
|
+
if (!colors3) return withIndicator(shortName);
|
|
4859
|
+
return withIndicator(colorize(shortName, colors3.name));
|
|
4860
4860
|
}
|
|
4861
4861
|
};
|
|
4862
4862
|
}
|
|
@@ -4884,9 +4884,9 @@ var init_model_widget = __esm({
|
|
|
4884
4884
|
);
|
|
4885
4885
|
colors;
|
|
4886
4886
|
styleFn = modelStyles.balanced;
|
|
4887
|
-
constructor(
|
|
4887
|
+
constructor(colors3) {
|
|
4888
4888
|
super();
|
|
4889
|
-
this.colors =
|
|
4889
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
4890
4890
|
}
|
|
4891
4891
|
setStyle(style = DEFAULT_WIDGET_STYLE) {
|
|
4892
4892
|
const fn = modelStyles[style];
|
|
@@ -4931,36 +4931,36 @@ var init_styles13 = __esm({
|
|
|
4931
4931
|
"use strict";
|
|
4932
4932
|
init_colors();
|
|
4933
4933
|
sysmonStyles = {
|
|
4934
|
-
balanced: (data,
|
|
4935
|
-
const cpu =
|
|
4936
|
-
const ram =
|
|
4937
|
-
const disk =
|
|
4938
|
-
const net =
|
|
4939
|
-
const sep =
|
|
4934
|
+
balanced: (data, colors3) => {
|
|
4935
|
+
const cpu = colors3 ? colorize(`CPU ${data.cpu.percent}%`, colors3.cpu) : `CPU ${data.cpu.percent}%`;
|
|
4936
|
+
const ram = colors3 ? colorize(`RAM ${formatGB(data.memory.used)}`, colors3.ram) : `RAM ${formatGB(data.memory.used)}`;
|
|
4937
|
+
const disk = colors3 ? colorize(`Disk ${data.disk.percent}%`, colors3.disk) : `Disk ${data.disk.percent}%`;
|
|
4938
|
+
const net = colors3 ? colorize(`Net \u2193${formatMB(data.network.rxSec)}/s`, colors3.network) : `Net \u2193${formatMB(data.network.rxSec)}/s`;
|
|
4939
|
+
const sep = colors3 ? colorize("|", colors3.separator) : "|";
|
|
4940
4940
|
return `${cpu} ${sep} ${ram} ${sep} ${disk} ${sep} ${net}`;
|
|
4941
4941
|
},
|
|
4942
|
-
compact: (data,
|
|
4943
|
-
const cpu =
|
|
4944
|
-
const ram =
|
|
4945
|
-
const disk =
|
|
4946
|
-
const net =
|
|
4942
|
+
compact: (data, colors3) => {
|
|
4943
|
+
const cpu = colors3 ? colorize(`CPU${data.cpu.percent}%`, colors3.cpu) : `CPU${data.cpu.percent}%`;
|
|
4944
|
+
const ram = colors3 ? colorize(`RAM${formatGB(data.memory.used)}`, colors3.ram) : `RAM${formatGB(data.memory.used)}`;
|
|
4945
|
+
const disk = colors3 ? colorize(`D${data.disk.percent}%`, colors3.disk) : `D${data.disk.percent}%`;
|
|
4946
|
+
const net = colors3 ? colorize(`\u2193${formatMB(data.network.rxSec)}/s`, colors3.network) : `\u2193${formatMB(data.network.rxSec)}/s`;
|
|
4947
4947
|
return `${cpu} ${ram} ${disk} ${net}`;
|
|
4948
4948
|
},
|
|
4949
|
-
playful: (data,
|
|
4950
|
-
const cpu =
|
|
4951
|
-
const ram =
|
|
4952
|
-
const disk =
|
|
4953
|
-
const net =
|
|
4954
|
-
const sep =
|
|
4949
|
+
playful: (data, colors3) => {
|
|
4950
|
+
const cpu = colors3 ? colorize(`${data.cpu.percent}%`, colors3.cpu) : `${data.cpu.percent}%`;
|
|
4951
|
+
const ram = colors3 ? colorize(formatGB(data.memory.used), colors3.ram) : formatGB(data.memory.used);
|
|
4952
|
+
const disk = colors3 ? colorize(`${data.disk.percent}%`, colors3.disk) : `${data.disk.percent}%`;
|
|
4953
|
+
const net = colors3 ? colorize(`\u2193${formatMB(data.network.rxSec)}/s`, colors3.network) : `\u2193${formatMB(data.network.rxSec)}/s`;
|
|
4954
|
+
const sep = colors3 ? colorize("|", colors3.separator) : "|";
|
|
4955
4955
|
return `\u{1F5A5}\uFE0F ${cpu} ${sep} \u{1F4BE} ${ram} ${sep} \u{1F4BF} ${disk} ${sep} \u{1F310} ${net}`;
|
|
4956
4956
|
},
|
|
4957
|
-
verbose: (data,
|
|
4958
|
-
const cpu =
|
|
4959
|
-
const ram =
|
|
4960
|
-
const disk =
|
|
4961
|
-
const net =
|
|
4957
|
+
verbose: (data, colors3) => {
|
|
4958
|
+
const cpu = colors3 ? colorize(`CPU: ${data.cpu.percent}%`, colors3.cpu) : `CPU: ${data.cpu.percent}%`;
|
|
4959
|
+
const ram = colors3 ? colorize(`RAM: ${formatGB(data.memory.used)}/${formatGB(data.memory.total)}`, colors3.ram) : `RAM: ${formatGB(data.memory.used)}/${formatGB(data.memory.total)}`;
|
|
4960
|
+
const disk = colors3 ? colorize(`Disk: ${formatGB(data.disk.used)}/${formatGB(data.disk.total)}`, colors3.disk) : `Disk: ${formatGB(data.disk.used)}/${formatGB(data.disk.total)}`;
|
|
4961
|
+
const net = colors3 ? colorize(
|
|
4962
4962
|
`Net: \u2193${formatMB(data.network.rxSec)}/s \u2191${formatMB(data.network.txSec)}/s`,
|
|
4963
|
-
|
|
4963
|
+
colors3.network
|
|
4964
4964
|
) : `Net: \u2193${formatMB(data.network.rxSec)}/s \u2191${formatMB(data.network.txSec)}/s`;
|
|
4965
4965
|
return `${cpu} | ${ram} | ${disk} | ${net}`;
|
|
4966
4966
|
}
|
|
@@ -4992,8 +4992,8 @@ var init_sysmon_widget = __esm({
|
|
|
4992
4992
|
styleFn = sysmonStyles.balanced;
|
|
4993
4993
|
enabled = true;
|
|
4994
4994
|
_lineOverride;
|
|
4995
|
-
constructor(
|
|
4996
|
-
this.colors =
|
|
4995
|
+
constructor(colors3, provider) {
|
|
4996
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
4997
4997
|
this.provider = provider ?? null;
|
|
4998
4998
|
}
|
|
4999
4999
|
async initialize(context) {
|
|
@@ -5458,49 +5458,49 @@ var require_yoctocolors_cjs = __commonJS({
|
|
|
5458
5458
|
return result2;
|
|
5459
5459
|
};
|
|
5460
5460
|
};
|
|
5461
|
-
var
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
module2.exports =
|
|
5461
|
+
var colors3 = {};
|
|
5462
|
+
colors3.reset = format(0, 0);
|
|
5463
|
+
colors3.bold = format(1, 22);
|
|
5464
|
+
colors3.dim = format(2, 22);
|
|
5465
|
+
colors3.italic = format(3, 23);
|
|
5466
|
+
colors3.underline = format(4, 24);
|
|
5467
|
+
colors3.overline = format(53, 55);
|
|
5468
|
+
colors3.inverse = format(7, 27);
|
|
5469
|
+
colors3.hidden = format(8, 28);
|
|
5470
|
+
colors3.strikethrough = format(9, 29);
|
|
5471
|
+
colors3.black = format(30, 39);
|
|
5472
|
+
colors3.red = format(31, 39);
|
|
5473
|
+
colors3.green = format(32, 39);
|
|
5474
|
+
colors3.yellow = format(33, 39);
|
|
5475
|
+
colors3.blue = format(34, 39);
|
|
5476
|
+
colors3.magenta = format(35, 39);
|
|
5477
|
+
colors3.cyan = format(36, 39);
|
|
5478
|
+
colors3.white = format(37, 39);
|
|
5479
|
+
colors3.gray = format(90, 39);
|
|
5480
|
+
colors3.bgBlack = format(40, 49);
|
|
5481
|
+
colors3.bgRed = format(41, 49);
|
|
5482
|
+
colors3.bgGreen = format(42, 49);
|
|
5483
|
+
colors3.bgYellow = format(43, 49);
|
|
5484
|
+
colors3.bgBlue = format(44, 49);
|
|
5485
|
+
colors3.bgMagenta = format(45, 49);
|
|
5486
|
+
colors3.bgCyan = format(46, 49);
|
|
5487
|
+
colors3.bgWhite = format(47, 49);
|
|
5488
|
+
colors3.bgGray = format(100, 49);
|
|
5489
|
+
colors3.redBright = format(91, 39);
|
|
5490
|
+
colors3.greenBright = format(92, 39);
|
|
5491
|
+
colors3.yellowBright = format(93, 39);
|
|
5492
|
+
colors3.blueBright = format(94, 39);
|
|
5493
|
+
colors3.magentaBright = format(95, 39);
|
|
5494
|
+
colors3.cyanBright = format(96, 39);
|
|
5495
|
+
colors3.whiteBright = format(97, 39);
|
|
5496
|
+
colors3.bgRedBright = format(101, 49);
|
|
5497
|
+
colors3.bgGreenBright = format(102, 49);
|
|
5498
|
+
colors3.bgYellowBright = format(103, 49);
|
|
5499
|
+
colors3.bgBlueBright = format(104, 49);
|
|
5500
|
+
colors3.bgMagentaBright = format(105, 49);
|
|
5501
|
+
colors3.bgCyanBright = format(106, 49);
|
|
5502
|
+
colors3.bgWhiteBright = format(107, 49);
|
|
5503
|
+
module2.exports = colors3;
|
|
5504
5504
|
}
|
|
5505
5505
|
});
|
|
5506
5506
|
|
|
@@ -6904,15 +6904,15 @@ var require_route = __commonJS({
|
|
|
6904
6904
|
};
|
|
6905
6905
|
}
|
|
6906
6906
|
function wrapConversion(toModel, graph) {
|
|
6907
|
-
const
|
|
6907
|
+
const path3 = [graph[toModel].parent, toModel];
|
|
6908
6908
|
let fn = conversions[graph[toModel].parent][toModel];
|
|
6909
6909
|
let cur = graph[toModel].parent;
|
|
6910
6910
|
while (graph[cur].parent) {
|
|
6911
|
-
|
|
6911
|
+
path3.unshift(graph[cur].parent);
|
|
6912
6912
|
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
6913
6913
|
cur = graph[cur].parent;
|
|
6914
6914
|
}
|
|
6915
|
-
fn.conversion =
|
|
6915
|
+
fn.conversion = path3;
|
|
6916
6916
|
return fn;
|
|
6917
6917
|
}
|
|
6918
6918
|
module2.exports = function(fromModel) {
|
|
@@ -8214,9 +8214,9 @@ var require_package = __commonJS({
|
|
|
8214
8214
|
var require_util = __commonJS({
|
|
8215
8215
|
"node_modules/systeminformation/lib/util.js"(exports2) {
|
|
8216
8216
|
"use strict";
|
|
8217
|
-
var
|
|
8218
|
-
var
|
|
8219
|
-
var
|
|
8217
|
+
var os3 = require("os");
|
|
8218
|
+
var fs3 = require("fs");
|
|
8219
|
+
var path3 = require("path");
|
|
8220
8220
|
var spawn = require("child_process").spawn;
|
|
8221
8221
|
var exec = require("child_process").exec;
|
|
8222
8222
|
var execSync = require("child_process").execSync;
|
|
@@ -8321,7 +8321,7 @@ var require_util = __commonJS({
|
|
|
8321
8321
|
}
|
|
8322
8322
|
function cores() {
|
|
8323
8323
|
if (_cores === 0) {
|
|
8324
|
-
_cores =
|
|
8324
|
+
_cores = os3.cpus().length;
|
|
8325
8325
|
}
|
|
8326
8326
|
return _cores;
|
|
8327
8327
|
}
|
|
@@ -8512,7 +8512,7 @@ var require_util = __commonJS({
|
|
|
8512
8512
|
_powerShell = "powershell.exe";
|
|
8513
8513
|
if (_windows) {
|
|
8514
8514
|
const defaultPath = `${WINDIR}\\system32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
8515
|
-
if (
|
|
8515
|
+
if (fs3.existsSync(defaultPath)) {
|
|
8516
8516
|
_powerShell = defaultPath;
|
|
8517
8517
|
}
|
|
8518
8518
|
}
|
|
@@ -8582,7 +8582,7 @@ var require_util = __commonJS({
|
|
|
8582
8582
|
function powerShellRelease() {
|
|
8583
8583
|
try {
|
|
8584
8584
|
if (_psChild) {
|
|
8585
|
-
_psChild.stdin.write("exit" +
|
|
8585
|
+
_psChild.stdin.write("exit" + os3.EOL);
|
|
8586
8586
|
_psChild.stdin.end();
|
|
8587
8587
|
}
|
|
8588
8588
|
} catch {
|
|
@@ -8609,7 +8609,7 @@ var require_util = __commonJS({
|
|
|
8609
8609
|
});
|
|
8610
8610
|
try {
|
|
8611
8611
|
if (_psChild && _psChild.pid) {
|
|
8612
|
-
_psChild.stdin.write(_psToUTF8 + "echo " + _psCmdStart + id + _psIdSeperator + "; " +
|
|
8612
|
+
_psChild.stdin.write(_psToUTF8 + "echo " + _psCmdStart + id + _psIdSeperator + "; " + os3.EOL + cmd + os3.EOL + "echo " + _psCmdSeperator + os3.EOL);
|
|
8613
8613
|
}
|
|
8614
8614
|
} catch {
|
|
8615
8615
|
resolve("");
|
|
@@ -8621,7 +8621,7 @@ var require_util = __commonJS({
|
|
|
8621
8621
|
return new Promise((resolve) => {
|
|
8622
8622
|
process.nextTick(() => {
|
|
8623
8623
|
try {
|
|
8624
|
-
const osVersion =
|
|
8624
|
+
const osVersion = os3.release().split(".").map(Number);
|
|
8625
8625
|
const spanOptions = osVersion[0] < 10 ? ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-NoExit", "-ExecutionPolicy", "Unrestricted", "-Command", "-"] : ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-ExecutionPolicy", "Unrestricted", "-Command", cmd];
|
|
8626
8626
|
const child = spawn(_powerShell, spanOptions, {
|
|
8627
8627
|
stdio: "pipe",
|
|
@@ -8653,8 +8653,8 @@ var require_util = __commonJS({
|
|
|
8653
8653
|
});
|
|
8654
8654
|
if (osVersion[0] < 10) {
|
|
8655
8655
|
try {
|
|
8656
|
-
child.stdin.write(_psToUTF8 + cmd +
|
|
8657
|
-
child.stdin.write("exit" +
|
|
8656
|
+
child.stdin.write(_psToUTF8 + cmd + os3.EOL);
|
|
8657
|
+
child.stdin.write("exit" + os3.EOL);
|
|
8658
8658
|
child.stdin.end();
|
|
8659
8659
|
} catch {
|
|
8660
8660
|
child.kill();
|
|
@@ -8768,7 +8768,7 @@ var require_util = __commonJS({
|
|
|
8768
8768
|
cpuinfo = _rpi_cpuinfo;
|
|
8769
8769
|
} else if (cpuinfo === void 0) {
|
|
8770
8770
|
try {
|
|
8771
|
-
cpuinfo =
|
|
8771
|
+
cpuinfo = fs3.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split("\n");
|
|
8772
8772
|
_rpi_cpuinfo = cpuinfo;
|
|
8773
8773
|
} catch {
|
|
8774
8774
|
return false;
|
|
@@ -8781,7 +8781,7 @@ var require_util = __commonJS({
|
|
|
8781
8781
|
function isRaspbian() {
|
|
8782
8782
|
let osrelease = [];
|
|
8783
8783
|
try {
|
|
8784
|
-
osrelease =
|
|
8784
|
+
osrelease = fs3.readFileSync("/etc/os-release", { encoding: "utf8" }).toString().split("\n");
|
|
8785
8785
|
} catch {
|
|
8786
8786
|
return false;
|
|
8787
8787
|
}
|
|
@@ -8799,9 +8799,9 @@ var require_util = __commonJS({
|
|
|
8799
8799
|
});
|
|
8800
8800
|
}
|
|
8801
8801
|
function darwinXcodeExists() {
|
|
8802
|
-
const cmdLineToolsExists =
|
|
8803
|
-
const xcodeAppExists =
|
|
8804
|
-
const xcodeExists =
|
|
8802
|
+
const cmdLineToolsExists = fs3.existsSync("/Library/Developer/CommandLineTools/usr/bin/");
|
|
8803
|
+
const xcodeAppExists = fs3.existsSync("/Applications/Xcode.app/Contents/Developer/Tools");
|
|
8804
|
+
const xcodeExists = fs3.existsSync("/Library/Developer/Xcode/");
|
|
8805
8805
|
return cmdLineToolsExists || xcodeExists || xcodeAppExists;
|
|
8806
8806
|
}
|
|
8807
8807
|
function nanoSeconds() {
|
|
@@ -8919,9 +8919,9 @@ var require_util = __commonJS({
|
|
|
8919
8919
|
return ("00000000" + parseInt(hex, 16).toString(2)).substr(-8);
|
|
8920
8920
|
}
|
|
8921
8921
|
function getFilesInPath(source) {
|
|
8922
|
-
const lstatSync =
|
|
8923
|
-
const readdirSync =
|
|
8924
|
-
const
|
|
8922
|
+
const lstatSync = fs3.lstatSync;
|
|
8923
|
+
const readdirSync = fs3.readdirSync;
|
|
8924
|
+
const join6 = path3.join;
|
|
8925
8925
|
function isDirectory(source2) {
|
|
8926
8926
|
return lstatSync(source2).isDirectory();
|
|
8927
8927
|
}
|
|
@@ -8930,12 +8930,12 @@ var require_util = __commonJS({
|
|
|
8930
8930
|
}
|
|
8931
8931
|
function getDirectories(source2) {
|
|
8932
8932
|
return readdirSync(source2).map((name) => {
|
|
8933
|
-
return
|
|
8933
|
+
return join6(source2, name);
|
|
8934
8934
|
}).filter(isDirectory);
|
|
8935
8935
|
}
|
|
8936
8936
|
function getFiles(source2) {
|
|
8937
8937
|
return readdirSync(source2).map((name) => {
|
|
8938
|
-
return
|
|
8938
|
+
return join6(source2, name);
|
|
8939
8939
|
}).filter(isFile);
|
|
8940
8940
|
}
|
|
8941
8941
|
function getFilesRecursively(source2) {
|
|
@@ -8951,7 +8951,7 @@ var require_util = __commonJS({
|
|
|
8951
8951
|
return [];
|
|
8952
8952
|
}
|
|
8953
8953
|
}
|
|
8954
|
-
if (
|
|
8954
|
+
if (fs3.existsSync(source)) {
|
|
8955
8955
|
return getFilesRecursively(source);
|
|
8956
8956
|
} else {
|
|
8957
8957
|
return [];
|
|
@@ -9154,7 +9154,7 @@ var require_util = __commonJS({
|
|
|
9154
9154
|
cpuinfo = _rpi_cpuinfo;
|
|
9155
9155
|
} else {
|
|
9156
9156
|
try {
|
|
9157
|
-
cpuinfo =
|
|
9157
|
+
cpuinfo = fs3.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split("\n");
|
|
9158
9158
|
_rpi_cpuinfo = cpuinfo;
|
|
9159
9159
|
} catch {
|
|
9160
9160
|
return false;
|
|
@@ -10722,8 +10722,8 @@ var require_util = __commonJS({
|
|
|
10722
10722
|
var require_osinfo = __commonJS({
|
|
10723
10723
|
"node_modules/systeminformation/lib/osinfo.js"(exports2) {
|
|
10724
10724
|
"use strict";
|
|
10725
|
-
var
|
|
10726
|
-
var
|
|
10725
|
+
var os3 = require("os");
|
|
10726
|
+
var fs3 = require("fs");
|
|
10727
10727
|
var util = require_util();
|
|
10728
10728
|
var exec = require("child_process").exec;
|
|
10729
10729
|
var execSync = require("child_process").execSync;
|
|
@@ -10745,14 +10745,14 @@ var require_osinfo = __commonJS({
|
|
|
10745
10745
|
}
|
|
10746
10746
|
const result2 = {
|
|
10747
10747
|
current: Date.now(),
|
|
10748
|
-
uptime:
|
|
10748
|
+
uptime: os3.uptime(),
|
|
10749
10749
|
timezone: t.length >= 7 ? t[5] : "",
|
|
10750
10750
|
timezoneName
|
|
10751
10751
|
};
|
|
10752
10752
|
if (_darwin || _linux) {
|
|
10753
10753
|
try {
|
|
10754
10754
|
const stdout = execSync("date +%Z && date +%z && ls -l /etc/localtime 2>/dev/null", util.execOptsLinux);
|
|
10755
|
-
const lines = stdout.toString().split(
|
|
10755
|
+
const lines = stdout.toString().split(os3.EOL);
|
|
10756
10756
|
if (lines.length > 3 && !lines[0]) {
|
|
10757
10757
|
lines.shift();
|
|
10758
10758
|
}
|
|
@@ -10762,7 +10762,7 @@ var require_osinfo = __commonJS({
|
|
|
10762
10762
|
}
|
|
10763
10763
|
return {
|
|
10764
10764
|
current: Date.now(),
|
|
10765
|
-
uptime:
|
|
10765
|
+
uptime: os3.uptime(),
|
|
10766
10766
|
timezone: lines[1] ? timezone + lines[1] : timezone,
|
|
10767
10767
|
timezoneName: lines[2] && lines[2].indexOf("/zoneinfo/") > 0 ? lines[2].split("/zoneinfo/")[1] || "" : ""
|
|
10768
10768
|
};
|
|
@@ -10881,11 +10881,11 @@ var require_osinfo = __commonJS({
|
|
|
10881
10881
|
return "";
|
|
10882
10882
|
}
|
|
10883
10883
|
function getFQDN() {
|
|
10884
|
-
let fqdn =
|
|
10884
|
+
let fqdn = os3.hostname;
|
|
10885
10885
|
if (_linux || _darwin) {
|
|
10886
10886
|
try {
|
|
10887
10887
|
const stdout = execSync("hostname -f 2>/dev/null", util.execOptsLinux);
|
|
10888
|
-
fqdn = stdout.toString().split(
|
|
10888
|
+
fqdn = stdout.toString().split(os3.EOL)[0];
|
|
10889
10889
|
} catch {
|
|
10890
10890
|
util.noop();
|
|
10891
10891
|
}
|
|
@@ -10893,7 +10893,7 @@ var require_osinfo = __commonJS({
|
|
|
10893
10893
|
if (_freebsd || _openbsd || _netbsd) {
|
|
10894
10894
|
try {
|
|
10895
10895
|
const stdout = execSync("hostname 2>/dev/null");
|
|
10896
|
-
fqdn = stdout.toString().split(
|
|
10896
|
+
fqdn = stdout.toString().split(os3.EOL)[0];
|
|
10897
10897
|
} catch {
|
|
10898
10898
|
util.noop();
|
|
10899
10899
|
}
|
|
@@ -10901,7 +10901,7 @@ var require_osinfo = __commonJS({
|
|
|
10901
10901
|
if (_windows) {
|
|
10902
10902
|
try {
|
|
10903
10903
|
const stdout = execSync("echo %COMPUTERNAME%.%USERDNSDOMAIN%", util.execOptsWin);
|
|
10904
|
-
fqdn = stdout.toString().replace(".%USERDNSDOMAIN%", "").split(
|
|
10904
|
+
fqdn = stdout.toString().replace(".%USERDNSDOMAIN%", "").split(os3.EOL)[0];
|
|
10905
10905
|
} catch {
|
|
10906
10906
|
util.noop();
|
|
10907
10907
|
}
|
|
@@ -10916,9 +10916,9 @@ var require_osinfo = __commonJS({
|
|
|
10916
10916
|
distro: "unknown",
|
|
10917
10917
|
release: "unknown",
|
|
10918
10918
|
codename: "",
|
|
10919
|
-
kernel:
|
|
10920
|
-
arch:
|
|
10921
|
-
hostname:
|
|
10919
|
+
kernel: os3.release(),
|
|
10920
|
+
arch: os3.arch(),
|
|
10921
|
+
hostname: os3.hostname(),
|
|
10922
10922
|
fqdn: getFQDN(),
|
|
10923
10923
|
codepage: "",
|
|
10924
10924
|
logofile: "",
|
|
@@ -11084,7 +11084,7 @@ var require_osinfo = __commonJS({
|
|
|
11084
11084
|
function isUefiLinux() {
|
|
11085
11085
|
return new Promise((resolve) => {
|
|
11086
11086
|
process.nextTick(() => {
|
|
11087
|
-
|
|
11087
|
+
fs3.stat("/sys/firmware/efi", (err) => {
|
|
11088
11088
|
if (!err) {
|
|
11089
11089
|
return resolve(true);
|
|
11090
11090
|
} else {
|
|
@@ -11127,7 +11127,7 @@ var require_osinfo = __commonJS({
|
|
|
11127
11127
|
}
|
|
11128
11128
|
function versions(apps, callback) {
|
|
11129
11129
|
let versionObject = {
|
|
11130
|
-
kernel:
|
|
11130
|
+
kernel: os3.release(),
|
|
11131
11131
|
apache: "",
|
|
11132
11132
|
bash: "",
|
|
11133
11133
|
bun: "",
|
|
@@ -11324,7 +11324,7 @@ var require_osinfo = __commonJS({
|
|
|
11324
11324
|
}
|
|
11325
11325
|
if ({}.hasOwnProperty.call(appsObj.versions, "git")) {
|
|
11326
11326
|
if (_darwin) {
|
|
11327
|
-
const gitHomebrewExists =
|
|
11327
|
+
const gitHomebrewExists = fs3.existsSync("/usr/local/Cellar/git") || fs3.existsSync("/opt/homebrew/bin/git");
|
|
11328
11328
|
if (util.darwinXcodeExists() || gitHomebrewExists) {
|
|
11329
11329
|
exec("git --version", (error, stdout) => {
|
|
11330
11330
|
if (!error) {
|
|
@@ -11519,8 +11519,8 @@ var require_osinfo = __commonJS({
|
|
|
11519
11519
|
const stdout = execSync("sw_vers");
|
|
11520
11520
|
const lines = stdout.toString().split("\n");
|
|
11521
11521
|
const osVersion = util.getValue(lines, "ProductVersion", ":");
|
|
11522
|
-
const gitHomebrewExists1 =
|
|
11523
|
-
const gitHomebrewExists2 =
|
|
11522
|
+
const gitHomebrewExists1 = fs3.existsSync("/usr/local/Cellar/python");
|
|
11523
|
+
const gitHomebrewExists2 = fs3.existsSync("/opt/homebrew/bin/python");
|
|
11524
11524
|
if (util.darwinXcodeExists() && util.semverCompare("12.0.1", osVersion) < 0 || gitHomebrewExists1 || gitHomebrewExists2) {
|
|
11525
11525
|
const cmd2 = gitHomebrewExists1 ? "/usr/local/Cellar/python -V 2>&1" : gitHomebrewExists2 ? "/opt/homebrew/bin/python -V 2>&1" : "python -V 2>&1";
|
|
11526
11526
|
exec(cmd2, (error, stdout2) => {
|
|
@@ -11548,7 +11548,7 @@ var require_osinfo = __commonJS({
|
|
|
11548
11548
|
}
|
|
11549
11549
|
if ({}.hasOwnProperty.call(appsObj.versions, "python3")) {
|
|
11550
11550
|
if (_darwin) {
|
|
11551
|
-
const gitHomebrewExists =
|
|
11551
|
+
const gitHomebrewExists = fs3.existsSync("/usr/local/Cellar/python3") || fs3.existsSync("/opt/homebrew/bin/python3");
|
|
11552
11552
|
if (util.darwinXcodeExists() || gitHomebrewExists) {
|
|
11553
11553
|
exec("python3 -V 2>&1", (error, stdout) => {
|
|
11554
11554
|
if (!error) {
|
|
@@ -11572,7 +11572,7 @@ var require_osinfo = __commonJS({
|
|
|
11572
11572
|
}
|
|
11573
11573
|
if ({}.hasOwnProperty.call(appsObj.versions, "pip")) {
|
|
11574
11574
|
if (_darwin) {
|
|
11575
|
-
const gitHomebrewExists =
|
|
11575
|
+
const gitHomebrewExists = fs3.existsSync("/usr/local/Cellar/pip") || fs3.existsSync("/opt/homebrew/bin/pip");
|
|
11576
11576
|
if (util.darwinXcodeExists() || gitHomebrewExists) {
|
|
11577
11577
|
exec("pip -V 2>&1", (error, stdout) => {
|
|
11578
11578
|
if (!error) {
|
|
@@ -11598,7 +11598,7 @@ var require_osinfo = __commonJS({
|
|
|
11598
11598
|
}
|
|
11599
11599
|
if ({}.hasOwnProperty.call(appsObj.versions, "pip3")) {
|
|
11600
11600
|
if (_darwin) {
|
|
11601
|
-
const gitHomebrewExists =
|
|
11601
|
+
const gitHomebrewExists = fs3.existsSync("/usr/local/Cellar/pip3") || fs3.existsSync("/opt/homebrew/bin/pip3");
|
|
11602
11602
|
if (util.darwinXcodeExists() || gitHomebrewExists) {
|
|
11603
11603
|
exec("pip3 -V 2>&1", (error, stdout) => {
|
|
11604
11604
|
if (!error) {
|
|
@@ -11836,7 +11836,7 @@ var require_osinfo = __commonJS({
|
|
|
11836
11836
|
function getUniqueMacAdresses() {
|
|
11837
11837
|
let macs = [];
|
|
11838
11838
|
try {
|
|
11839
|
-
const ifaces =
|
|
11839
|
+
const ifaces = os3.networkInterfaces();
|
|
11840
11840
|
for (let dev in ifaces) {
|
|
11841
11841
|
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
|
11842
11842
|
ifaces[dev].forEach((details) => {
|
|
@@ -11901,7 +11901,7 @@ echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`;
|
|
|
11901
11901
|
result2.os = util.getValue(lines, "os").toLowerCase();
|
|
11902
11902
|
result2.hardware = util.getValue(lines, "hardware").toLowerCase();
|
|
11903
11903
|
if (!result2.hardware) {
|
|
11904
|
-
const lines2 =
|
|
11904
|
+
const lines2 = fs3.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split("\n");
|
|
11905
11905
|
const serial = util.getValue(lines2, "serial");
|
|
11906
11906
|
result2.hardware = serial || "";
|
|
11907
11907
|
}
|
|
@@ -11957,8 +11957,8 @@ echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`;
|
|
|
11957
11957
|
var require_system = __commonJS({
|
|
11958
11958
|
"node_modules/systeminformation/lib/system.js"(exports2) {
|
|
11959
11959
|
"use strict";
|
|
11960
|
-
var
|
|
11961
|
-
var
|
|
11960
|
+
var fs3 = require("fs");
|
|
11961
|
+
var os3 = require("os");
|
|
11962
11962
|
var util = require_util();
|
|
11963
11963
|
var { uuid } = require_osinfo();
|
|
11964
11964
|
var exec = require("child_process").exec;
|
|
@@ -12082,8 +12082,8 @@ var require_system = __commonJS({
|
|
|
12082
12082
|
util.noop();
|
|
12083
12083
|
}
|
|
12084
12084
|
}
|
|
12085
|
-
if (!result2.virtual && (
|
|
12086
|
-
const kernelVersion = parseFloat(
|
|
12085
|
+
if (!result2.virtual && (os3.release().toLowerCase().indexOf("microsoft") >= 0 || os3.release().toLowerCase().endsWith("wsl2"))) {
|
|
12086
|
+
const kernelVersion = parseFloat(os3.release().toLowerCase());
|
|
12087
12087
|
result2.virtual = true;
|
|
12088
12088
|
result2.manufacturer = "Microsoft";
|
|
12089
12089
|
result2.model = "WSL";
|
|
@@ -12112,7 +12112,7 @@ var require_system = __commonJS({
|
|
|
12112
12112
|
util.noop();
|
|
12113
12113
|
}
|
|
12114
12114
|
}
|
|
12115
|
-
if (
|
|
12115
|
+
if (fs3.existsSync("/.dockerenv") || fs3.existsSync("/.dockerinit")) {
|
|
12116
12116
|
result2.model = "Docker Container";
|
|
12117
12117
|
}
|
|
12118
12118
|
try {
|
|
@@ -12140,7 +12140,7 @@ var require_system = __commonJS({
|
|
|
12140
12140
|
util.noop();
|
|
12141
12141
|
}
|
|
12142
12142
|
if (result2.manufacturer === "" && result2.model === "Computer" && result2.version === "") {
|
|
12143
|
-
|
|
12143
|
+
fs3.readFile("/proc/cpuinfo", (error2, stdout2) => {
|
|
12144
12144
|
if (!error2) {
|
|
12145
12145
|
let lines2 = stdout2.toString().split("\n");
|
|
12146
12146
|
result2.model = util.getValue(lines2, "hardware", ":", true).toUpperCase();
|
|
@@ -12493,7 +12493,7 @@ var require_system = __commonJS({
|
|
|
12493
12493
|
result2.model = "Raspberry Pi";
|
|
12494
12494
|
result2.serial = rpi.serial;
|
|
12495
12495
|
result2.version = rpi.type + " - " + rpi.revision;
|
|
12496
|
-
result2.memMax =
|
|
12496
|
+
result2.memMax = os3.totalmem();
|
|
12497
12497
|
result2.memSlots = 0;
|
|
12498
12498
|
}
|
|
12499
12499
|
if (callback) {
|
|
@@ -12519,9 +12519,9 @@ var require_system = __commonJS({
|
|
|
12519
12519
|
}
|
|
12520
12520
|
devices.shift();
|
|
12521
12521
|
result2.memSlots = devices.length;
|
|
12522
|
-
if (
|
|
12522
|
+
if (os3.arch() === "arm64") {
|
|
12523
12523
|
result2.memSlots = 0;
|
|
12524
|
-
result2.memMax =
|
|
12524
|
+
result2.memMax = os3.totalmem();
|
|
12525
12525
|
}
|
|
12526
12526
|
if (callback) {
|
|
12527
12527
|
callback(result2);
|
|
@@ -12538,7 +12538,7 @@ var require_system = __commonJS({
|
|
|
12538
12538
|
if (_windows) {
|
|
12539
12539
|
try {
|
|
12540
12540
|
const workload = [];
|
|
12541
|
-
const win10plus = parseInt(
|
|
12541
|
+
const win10plus = parseInt(os3.release()) >= 10;
|
|
12542
12542
|
const maxCapacityAttribute = win10plus ? "MaxCapacityEx" : "MaxCapacity";
|
|
12543
12543
|
workload.push(util.powerShell("Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl"));
|
|
12544
12544
|
workload.push(util.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${maxCapacityAttribute}, MemoryDevices | fl`));
|
|
@@ -12734,10 +12734,10 @@ var require_system = __commonJS({
|
|
|
12734
12734
|
var require_cpu = __commonJS({
|
|
12735
12735
|
"node_modules/systeminformation/lib/cpu.js"(exports2) {
|
|
12736
12736
|
"use strict";
|
|
12737
|
-
var
|
|
12737
|
+
var os3 = require("os");
|
|
12738
12738
|
var exec = require("child_process").exec;
|
|
12739
12739
|
var execSync = require("child_process").execSync;
|
|
12740
|
-
var
|
|
12740
|
+
var fs3 = require("fs");
|
|
12741
12741
|
var util = require_util();
|
|
12742
12742
|
var _platform = process.platform;
|
|
12743
12743
|
var _linux = _platform === "linux" || _platform === "android";
|
|
@@ -13597,7 +13597,7 @@ var require_cpu = __commonJS({
|
|
|
13597
13597
|
const countProcessors = util.getValue(lines, "hw.packages");
|
|
13598
13598
|
const countCores = util.getValue(lines, "hw.physicalcpu_max");
|
|
13599
13599
|
const countThreads = util.getValue(lines, "hw.ncpu");
|
|
13600
|
-
if (
|
|
13600
|
+
if (os3.arch() === "arm64") {
|
|
13601
13601
|
result2.socket = "SOC";
|
|
13602
13602
|
try {
|
|
13603
13603
|
const clusters = execSync("ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type").toString().split("\n");
|
|
@@ -13625,8 +13625,8 @@ var require_cpu = __commonJS({
|
|
|
13625
13625
|
if (_linux) {
|
|
13626
13626
|
let modelline = "";
|
|
13627
13627
|
let lines = [];
|
|
13628
|
-
if (
|
|
13629
|
-
modelline =
|
|
13628
|
+
if (os3.cpus()[0] && os3.cpus()[0].model) {
|
|
13629
|
+
modelline = os3.cpus()[0].model;
|
|
13630
13630
|
}
|
|
13631
13631
|
exec('export LC_ALL=C; lscpu; echo -n "Governor: "; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null; echo; unset LC_ALL', (error, stdout) => {
|
|
13632
13632
|
if (!error) {
|
|
@@ -13694,7 +13694,7 @@ var require_cpu = __commonJS({
|
|
|
13694
13694
|
result2.socket = "SOC";
|
|
13695
13695
|
}
|
|
13696
13696
|
if (util.getValue(lines, "architecture") === "riscv64") {
|
|
13697
|
-
const linesRiscV =
|
|
13697
|
+
const linesRiscV = fs3.readFileSync("/proc/cpuinfo").toString().split("\n");
|
|
13698
13698
|
const uarch = util.getValue(linesRiscV, "uarch") || "";
|
|
13699
13699
|
if (uarch.indexOf(",") > -1) {
|
|
13700
13700
|
const split = uarch.split(",");
|
|
@@ -13715,8 +13715,8 @@ var require_cpu = __commonJS({
|
|
|
13715
13715
|
if (_freebsd || _openbsd || _netbsd) {
|
|
13716
13716
|
let modelline = "";
|
|
13717
13717
|
let lines = [];
|
|
13718
|
-
if (
|
|
13719
|
-
modelline =
|
|
13718
|
+
if (os3.cpus()[0] && os3.cpus()[0].model) {
|
|
13719
|
+
modelline = os3.cpus()[0].model;
|
|
13720
13720
|
}
|
|
13721
13721
|
exec("export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 unset LC_ALL", (error, stdout) => {
|
|
13722
13722
|
let cache = [];
|
|
@@ -13876,7 +13876,7 @@ var require_cpu = __commonJS({
|
|
|
13876
13876
|
}
|
|
13877
13877
|
exports2.cpu = cpu;
|
|
13878
13878
|
function getCpuCurrentSpeedSync() {
|
|
13879
|
-
const cpus =
|
|
13879
|
+
const cpus = os3.cpus();
|
|
13880
13880
|
let minFreq = 999999999;
|
|
13881
13881
|
let maxFreq = 0;
|
|
13882
13882
|
let avgFreq = 0;
|
|
@@ -14093,9 +14093,9 @@ var require_cpu = __commonJS({
|
|
|
14093
14093
|
return;
|
|
14094
14094
|
}
|
|
14095
14095
|
}
|
|
14096
|
-
|
|
14096
|
+
fs3.stat("/sys/class/thermal/thermal_zone0/temp", (err) => {
|
|
14097
14097
|
if (err === null) {
|
|
14098
|
-
|
|
14098
|
+
fs3.readFile("/sys/class/thermal/thermal_zone0/temp", (error3, stdout3) => {
|
|
14099
14099
|
if (!error3) {
|
|
14100
14100
|
const lines2 = stdout3.toString().split("\n");
|
|
14101
14101
|
if (lines2.length > 0) {
|
|
@@ -14318,7 +14318,7 @@ var require_cpu = __commonJS({
|
|
|
14318
14318
|
});
|
|
14319
14319
|
}
|
|
14320
14320
|
if (!result2) {
|
|
14321
|
-
|
|
14321
|
+
fs3.readFile("/proc/cpuinfo", (error2, stdout2) => {
|
|
14322
14322
|
if (!error2) {
|
|
14323
14323
|
let lines = stdout2.toString().split("\n");
|
|
14324
14324
|
result2 = util.getValue(lines, "features", ":", true).toLowerCase();
|
|
@@ -14571,7 +14571,7 @@ var require_cpu = __commonJS({
|
|
|
14571
14571
|
function getLoad() {
|
|
14572
14572
|
return new Promise((resolve) => {
|
|
14573
14573
|
process.nextTick(() => {
|
|
14574
|
-
const loads =
|
|
14574
|
+
const loads = os3.loadavg().map((x) => {
|
|
14575
14575
|
return x / util.cores();
|
|
14576
14576
|
});
|
|
14577
14577
|
const avgLoad = parseFloat(Math.max.apply(Math, loads).toFixed(2));
|
|
@@ -14579,7 +14579,7 @@ var require_cpu = __commonJS({
|
|
|
14579
14579
|
const now = Date.now() - _current_cpu.ms;
|
|
14580
14580
|
if (now >= 200) {
|
|
14581
14581
|
_current_cpu.ms = Date.now();
|
|
14582
|
-
const cpus =
|
|
14582
|
+
const cpus = os3.cpus().map((cpu2) => {
|
|
14583
14583
|
cpu2.times.steal = 0;
|
|
14584
14584
|
cpu2.times.guest = 0;
|
|
14585
14585
|
return cpu2;
|
|
@@ -14773,7 +14773,7 @@ var require_cpu = __commonJS({
|
|
|
14773
14773
|
function getFullLoad() {
|
|
14774
14774
|
return new Promise((resolve) => {
|
|
14775
14775
|
process.nextTick(() => {
|
|
14776
|
-
const cpus =
|
|
14776
|
+
const cpus = os3.cpus();
|
|
14777
14777
|
let totalUser = 0;
|
|
14778
14778
|
let totalSystem = 0;
|
|
14779
14779
|
let totalNice = 0;
|
|
@@ -14816,11 +14816,11 @@ var require_cpu = __commonJS({
|
|
|
14816
14816
|
var require_memory = __commonJS({
|
|
14817
14817
|
"node_modules/systeminformation/lib/memory.js"(exports2) {
|
|
14818
14818
|
"use strict";
|
|
14819
|
-
var
|
|
14819
|
+
var os3 = require("os");
|
|
14820
14820
|
var exec = require("child_process").exec;
|
|
14821
14821
|
var execSync = require("child_process").execSync;
|
|
14822
14822
|
var util = require_util();
|
|
14823
|
-
var
|
|
14823
|
+
var fs3 = require("fs");
|
|
14824
14824
|
var _platform = process.platform;
|
|
14825
14825
|
var _linux = _platform === "linux" || _platform === "android";
|
|
14826
14826
|
var _darwin = _platform === "darwin";
|
|
@@ -14862,12 +14862,12 @@ var require_memory = __commonJS({
|
|
|
14862
14862
|
return new Promise((resolve) => {
|
|
14863
14863
|
process.nextTick(() => {
|
|
14864
14864
|
let result2 = {
|
|
14865
|
-
total:
|
|
14866
|
-
free:
|
|
14867
|
-
used:
|
|
14868
|
-
active:
|
|
14865
|
+
total: os3.totalmem(),
|
|
14866
|
+
free: os3.freemem(),
|
|
14867
|
+
used: os3.totalmem() - os3.freemem(),
|
|
14868
|
+
active: os3.totalmem() - os3.freemem(),
|
|
14869
14869
|
// temporarily (fallback)
|
|
14870
|
-
available:
|
|
14870
|
+
available: os3.freemem(),
|
|
14871
14871
|
// temporarily (fallback)
|
|
14872
14872
|
buffers: 0,
|
|
14873
14873
|
cached: 0,
|
|
@@ -14882,13 +14882,13 @@ var require_memory = __commonJS({
|
|
|
14882
14882
|
};
|
|
14883
14883
|
if (_linux) {
|
|
14884
14884
|
try {
|
|
14885
|
-
|
|
14885
|
+
fs3.readFile("/proc/meminfo", function(error, stdout) {
|
|
14886
14886
|
if (!error) {
|
|
14887
14887
|
const lines = stdout.toString().split("\n");
|
|
14888
14888
|
result2.total = parseInt(util.getValue(lines, "memtotal"), 10);
|
|
14889
|
-
result2.total = result2.total ? result2.total * 1024 :
|
|
14889
|
+
result2.total = result2.total ? result2.total * 1024 : os3.totalmem();
|
|
14890
14890
|
result2.free = parseInt(util.getValue(lines, "memfree"), 10);
|
|
14891
|
-
result2.free = result2.free ? result2.free * 1024 :
|
|
14891
|
+
result2.free = result2.free ? result2.free * 1024 : os3.freemem();
|
|
14892
14892
|
result2.used = result2.total - result2.free;
|
|
14893
14893
|
result2.buffers = parseInt(util.getValue(lines, "buffers"), 10);
|
|
14894
14894
|
result2.buffers = result2.buffers ? result2.buffers * 1024 : 0;
|
|
@@ -15110,7 +15110,7 @@ var require_memory = __commonJS({
|
|
|
15110
15110
|
}
|
|
15111
15111
|
if (!result2.length) {
|
|
15112
15112
|
result2.push({
|
|
15113
|
-
size:
|
|
15113
|
+
size: os3.totalmem(),
|
|
15114
15114
|
bank: "",
|
|
15115
15115
|
type: "",
|
|
15116
15116
|
ecc: null,
|
|
@@ -15312,7 +15312,7 @@ var require_battery = __commonJS({
|
|
|
15312
15312
|
"node_modules/systeminformation/lib/battery.js"(exports2, module2) {
|
|
15313
15313
|
"use strict";
|
|
15314
15314
|
var exec = require("child_process").exec;
|
|
15315
|
-
var
|
|
15315
|
+
var fs3 = require("fs");
|
|
15316
15316
|
var util = require_util();
|
|
15317
15317
|
var _platform = process.platform;
|
|
15318
15318
|
var _linux = _platform === "linux" || _platform === "android";
|
|
@@ -15364,24 +15364,24 @@ var require_battery = __commonJS({
|
|
|
15364
15364
|
};
|
|
15365
15365
|
if (_linux) {
|
|
15366
15366
|
let battery_path = "";
|
|
15367
|
-
if (
|
|
15367
|
+
if (fs3.existsSync("/sys/class/power_supply/BAT1/uevent")) {
|
|
15368
15368
|
battery_path = "/sys/class/power_supply/BAT1/";
|
|
15369
|
-
} else if (
|
|
15369
|
+
} else if (fs3.existsSync("/sys/class/power_supply/BAT0/uevent")) {
|
|
15370
15370
|
battery_path = "/sys/class/power_supply/BAT0/";
|
|
15371
15371
|
}
|
|
15372
15372
|
let acConnected = false;
|
|
15373
15373
|
let acPath = "";
|
|
15374
|
-
if (
|
|
15374
|
+
if (fs3.existsSync("/sys/class/power_supply/AC/online")) {
|
|
15375
15375
|
acPath = "/sys/class/power_supply/AC/online";
|
|
15376
|
-
} else if (
|
|
15376
|
+
} else if (fs3.existsSync("/sys/class/power_supply/AC0/online")) {
|
|
15377
15377
|
acPath = "/sys/class/power_supply/AC0/online";
|
|
15378
15378
|
}
|
|
15379
15379
|
if (acPath) {
|
|
15380
|
-
const file =
|
|
15380
|
+
const file = fs3.readFileSync(acPath);
|
|
15381
15381
|
acConnected = file.toString().trim() === "1";
|
|
15382
15382
|
}
|
|
15383
15383
|
if (battery_path) {
|
|
15384
|
-
|
|
15384
|
+
fs3.readFile(battery_path + "uevent", (error, stdout) => {
|
|
15385
15385
|
if (!error) {
|
|
15386
15386
|
let lines = stdout.toString().split("\n");
|
|
15387
15387
|
result2.isCharging = util.getValue(lines, "POWER_SUPPLY_STATUS", "=").toLowerCase() === "charging";
|
|
@@ -15603,7 +15603,7 @@ var require_battery = __commonJS({
|
|
|
15603
15603
|
var require_graphics = __commonJS({
|
|
15604
15604
|
"node_modules/systeminformation/lib/graphics.js"(exports2) {
|
|
15605
15605
|
"use strict";
|
|
15606
|
-
var
|
|
15606
|
+
var fs3 = require("fs");
|
|
15607
15607
|
var exec = require("child_process").exec;
|
|
15608
15608
|
var execSync = require("child_process").execSync;
|
|
15609
15609
|
var util = require_util();
|
|
@@ -15967,16 +15967,16 @@ var require_graphics = __commonJS({
|
|
|
15967
15967
|
if (_windows) {
|
|
15968
15968
|
try {
|
|
15969
15969
|
const basePath = util.WINDIR + String.raw`\System32\DriverStore\FileRepository`;
|
|
15970
|
-
const candidateDirs =
|
|
15971
|
-
if (
|
|
15972
|
-
return
|
|
15970
|
+
const candidateDirs = fs3.readdirSync(basePath).filter((dir) => {
|
|
15971
|
+
if (fs3.statSync([basePath, dir].join("/")).isDirectory()) {
|
|
15972
|
+
return fs3.readdirSync([basePath, dir].join("/")).includes("nvidia-smi.exe");
|
|
15973
15973
|
} else {
|
|
15974
15974
|
return false;
|
|
15975
15975
|
}
|
|
15976
15976
|
});
|
|
15977
15977
|
const targetDir = candidateDirs.reduce((prevDir, currentDir) => {
|
|
15978
|
-
const previousNvidiaSmi =
|
|
15979
|
-
const currentNvidiaSmi =
|
|
15978
|
+
const previousNvidiaSmi = fs3.statSync([basePath, prevDir, "nvidia-smi.exe"].join("/"));
|
|
15979
|
+
const currentNvidiaSmi = fs3.statSync([basePath, currentDir, "nvidia-smi.exe"].join("/"));
|
|
15980
15980
|
return previousNvidiaSmi.ctimeMs > currentNvidiaSmi.ctimeMs ? prevDir : currentDir;
|
|
15981
15981
|
});
|
|
15982
15982
|
if (targetDir) {
|
|
@@ -16688,7 +16688,7 @@ var require_filesystem = __commonJS({
|
|
|
16688
16688
|
"node_modules/systeminformation/lib/filesystem.js"(exports2) {
|
|
16689
16689
|
"use strict";
|
|
16690
16690
|
var util = require_util();
|
|
16691
|
-
var
|
|
16691
|
+
var fs3 = require("fs");
|
|
16692
16692
|
var exec = require("child_process").exec;
|
|
16693
16693
|
var execSync = require("child_process").execSync;
|
|
16694
16694
|
var execPromiseSave = util.promisifySave(require("child_process").exec);
|
|
@@ -16709,11 +16709,11 @@ var require_filesystem = __commonJS({
|
|
|
16709
16709
|
}
|
|
16710
16710
|
let macOsDisks = [];
|
|
16711
16711
|
let osMounts = [];
|
|
16712
|
-
function getmacOsFsType(
|
|
16713
|
-
if (!
|
|
16712
|
+
function getmacOsFsType(fs4) {
|
|
16713
|
+
if (!fs4.startsWith("/")) {
|
|
16714
16714
|
return "NFS";
|
|
16715
16715
|
}
|
|
16716
|
-
const parts =
|
|
16716
|
+
const parts = fs4.split("/");
|
|
16717
16717
|
const fsShort = parts[parts.length - 1];
|
|
16718
16718
|
const macOsDisksSingle = macOsDisks.filter((item) => item.indexOf(fsShort) >= 0);
|
|
16719
16719
|
if (macOsDisksSingle.length === 1 && macOsDisksSingle[0].indexOf("APFS") >= 0) {
|
|
@@ -16721,11 +16721,11 @@ var require_filesystem = __commonJS({
|
|
|
16721
16721
|
}
|
|
16722
16722
|
return "HFS";
|
|
16723
16723
|
}
|
|
16724
|
-
function isLinuxTmpFs(
|
|
16724
|
+
function isLinuxTmpFs(fs4) {
|
|
16725
16725
|
const linuxTmpFileSystems = ["rootfs", "unionfs", "squashfs", "cramfs", "initrd", "initramfs", "devtmpfs", "tmpfs", "udev", "devfs", "specfs", "type", "appimaged"];
|
|
16726
16726
|
let result2 = false;
|
|
16727
16727
|
linuxTmpFileSystems.forEach((linuxFs) => {
|
|
16728
|
-
if (
|
|
16728
|
+
if (fs4.toLowerCase().indexOf(linuxFs) >= 0) {
|
|
16729
16729
|
result2 = true;
|
|
16730
16730
|
}
|
|
16731
16731
|
});
|
|
@@ -16753,18 +16753,18 @@ var require_filesystem = __commonJS({
|
|
|
16753
16753
|
if (line !== "") {
|
|
16754
16754
|
line = line.replace(/ +/g, " ").split(" ");
|
|
16755
16755
|
if (line && (line[0].startsWith("/") || line[6] && line[6] === "/" || line[0].indexOf("/") > 0 || line[0].indexOf(":") === 1 || !_darwin && !isLinuxTmpFs(line[1]))) {
|
|
16756
|
-
const
|
|
16756
|
+
const fs4 = line[0];
|
|
16757
16757
|
const fsType = _linux || _freebsd || _openbsd || _netbsd ? line[1] : getmacOsFsType(line[0]);
|
|
16758
16758
|
const size = parseInt(_linux || _freebsd || _openbsd || _netbsd ? line[2] : line[1], 10) * 1024;
|
|
16759
16759
|
const used = parseInt(_linux || _freebsd || _openbsd || _netbsd ? line[3] : line[2], 10) * 1024;
|
|
16760
16760
|
const available = parseInt(_linux || _freebsd || _openbsd || _netbsd ? line[4] : line[3], 10) * 1024;
|
|
16761
16761
|
const use = parseFloat((100 * (used / (used + available))).toFixed(2));
|
|
16762
|
-
const rw = osMounts && Object.keys(osMounts).length > 0 ? osMounts[
|
|
16762
|
+
const rw = osMounts && Object.keys(osMounts).length > 0 ? osMounts[fs4] || false : null;
|
|
16763
16763
|
line.splice(0, _linux || _freebsd || _openbsd || _netbsd ? 6 : 5);
|
|
16764
16764
|
const mount = line.join(" ");
|
|
16765
|
-
if (!data.find((el) => el.fs ===
|
|
16765
|
+
if (!data.find((el) => el.fs === fs4 && el.type === fsType && el.mount === mount)) {
|
|
16766
16766
|
data.push({
|
|
16767
|
-
fs:
|
|
16767
|
+
fs: fs4,
|
|
16768
16768
|
type: fsType,
|
|
16769
16769
|
size,
|
|
16770
16770
|
used,
|
|
@@ -16925,7 +16925,7 @@ var require_filesystem = __commonJS({
|
|
|
16925
16925
|
});
|
|
16926
16926
|
}
|
|
16927
16927
|
if (_linux) {
|
|
16928
|
-
|
|
16928
|
+
fs3.readFile("/proc/sys/fs/file-nr", (error, stdout) => {
|
|
16929
16929
|
if (!error) {
|
|
16930
16930
|
const lines = stdout.toString().split("\n");
|
|
16931
16931
|
if (lines[0]) {
|
|
@@ -16944,7 +16944,7 @@ var require_filesystem = __commonJS({
|
|
|
16944
16944
|
}
|
|
16945
16945
|
resolve(result2);
|
|
16946
16946
|
} else {
|
|
16947
|
-
|
|
16947
|
+
fs3.readFile("/proc/sys/fs/file-max", (error2, stdout2) => {
|
|
16948
16948
|
if (!error2) {
|
|
16949
16949
|
const lines = stdout2.toString().split("\n");
|
|
16950
16950
|
if (lines[0]) {
|
|
@@ -18210,10 +18210,10 @@ ${BSDName}|"; diskutil info /dev/${BSDName} | grep SMART;`;
|
|
|
18210
18210
|
var require_network = __commonJS({
|
|
18211
18211
|
"node_modules/systeminformation/lib/network.js"(exports2) {
|
|
18212
18212
|
"use strict";
|
|
18213
|
-
var
|
|
18213
|
+
var os3 = require("os");
|
|
18214
18214
|
var exec = require("child_process").exec;
|
|
18215
18215
|
var execSync = require("child_process").execSync;
|
|
18216
|
-
var
|
|
18216
|
+
var fs3 = require("fs");
|
|
18217
18217
|
var util = require_util();
|
|
18218
18218
|
var _platform = process.platform;
|
|
18219
18219
|
var _linux = _platform === "linux" || _platform === "android";
|
|
@@ -18234,7 +18234,7 @@ var require_network = __commonJS({
|
|
|
18234
18234
|
let ifacename = "";
|
|
18235
18235
|
let ifacenameFirst = "";
|
|
18236
18236
|
try {
|
|
18237
|
-
const ifaces =
|
|
18237
|
+
const ifaces = os3.networkInterfaces();
|
|
18238
18238
|
let scopeid = 9999;
|
|
18239
18239
|
for (let dev in ifaces) {
|
|
18240
18240
|
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
|
@@ -18254,7 +18254,7 @@ var require_network = __commonJS({
|
|
|
18254
18254
|
let defaultIp = "";
|
|
18255
18255
|
const cmd = "netstat -r";
|
|
18256
18256
|
const result2 = execSync(cmd, util.execOptsWin);
|
|
18257
|
-
const lines = result2.toString().split(
|
|
18257
|
+
const lines = result2.toString().split(os3.EOL);
|
|
18258
18258
|
lines.forEach((line) => {
|
|
18259
18259
|
line = line.replace(/\s+/g, " ").trim();
|
|
18260
18260
|
if (line.indexOf("0.0.0.0 0.0.0.0") > -1 && !/[a-zA-Z]/.test(line)) {
|
|
@@ -18887,7 +18887,7 @@ var require_network = __commonJS({
|
|
|
18887
18887
|
defaultString = "" + defaultString;
|
|
18888
18888
|
return new Promise((resolve) => {
|
|
18889
18889
|
process.nextTick(() => {
|
|
18890
|
-
const ifaces =
|
|
18890
|
+
const ifaces = os3.networkInterfaces();
|
|
18891
18891
|
let result2 = [];
|
|
18892
18892
|
let nics = [];
|
|
18893
18893
|
let dnsSuffixes = [];
|
|
@@ -19464,7 +19464,7 @@ var require_network = __commonJS({
|
|
|
19464
19464
|
let cmd, lines, stats;
|
|
19465
19465
|
if (!_network[ifaceSanitized] || _network[ifaceSanitized] && !_network[ifaceSanitized].ms || _network[ifaceSanitized] && _network[ifaceSanitized].ms && Date.now() - _network[ifaceSanitized].ms >= 500) {
|
|
19466
19466
|
if (_linux) {
|
|
19467
|
-
if (
|
|
19467
|
+
if (fs3.existsSync("/sys/class/net/" + ifaceSanitized)) {
|
|
19468
19468
|
cmd = "cat /sys/class/net/" + ifaceSanitized + "/operstate; cat /sys/class/net/" + ifaceSanitized + "/statistics/rx_bytes; cat /sys/class/net/" + ifaceSanitized + "/statistics/tx_bytes; cat /sys/class/net/" + ifaceSanitized + "/statistics/rx_dropped; cat /sys/class/net/" + ifaceSanitized + "/statistics/rx_errors; cat /sys/class/net/" + ifaceSanitized + "/statistics/tx_dropped; cat /sys/class/net/" + ifaceSanitized + "/statistics/tx_errors; ";
|
|
19469
19469
|
exec(cmd, (error, stdout) => {
|
|
19470
19470
|
if (!error) {
|
|
@@ -19957,7 +19957,7 @@ var require_network = __commonJS({
|
|
|
19957
19957
|
if (_windows) {
|
|
19958
19958
|
try {
|
|
19959
19959
|
exec("netstat -r", util.execOptsWin, (error, stdout) => {
|
|
19960
|
-
const lines = stdout.toString().split(
|
|
19960
|
+
const lines = stdout.toString().split(os3.EOL);
|
|
19961
19961
|
lines.forEach((line) => {
|
|
19962
19962
|
line = line.replace(/\s+/g, " ").trim();
|
|
19963
19963
|
if (line.indexOf("0.0.0.0 0.0.0.0") > -1 && !/[a-zA-Z]/.test(line)) {
|
|
@@ -20003,7 +20003,7 @@ var require_network = __commonJS({
|
|
|
20003
20003
|
var require_wifi = __commonJS({
|
|
20004
20004
|
"node_modules/systeminformation/lib/wifi.js"(exports2) {
|
|
20005
20005
|
"use strict";
|
|
20006
|
-
var
|
|
20006
|
+
var os3 = require("os");
|
|
20007
20007
|
var exec = require("child_process").exec;
|
|
20008
20008
|
var execSync = require("child_process").execSync;
|
|
20009
20009
|
var util = require_util();
|
|
@@ -20225,7 +20225,7 @@ var require_wifi = __commonJS({
|
|
|
20225
20225
|
parts.shift();
|
|
20226
20226
|
parts.forEach((part) => {
|
|
20227
20227
|
part = "ACTIVE:" + part;
|
|
20228
|
-
const lines = part.split(
|
|
20228
|
+
const lines = part.split(os3.EOL);
|
|
20229
20229
|
const channel = util.getValue(lines, "CHAN");
|
|
20230
20230
|
const frequency = util.getValue(lines, "FREQ").toLowerCase().replace("mhz", "").trim();
|
|
20231
20231
|
const security = util.getValue(lines, "SECURITY").replace("(", "").replace(")", "");
|
|
@@ -20449,15 +20449,15 @@ var require_wifi = __commonJS({
|
|
|
20449
20449
|
} else if (_windows) {
|
|
20450
20450
|
const cmd = "netsh wlan show networks mode=Bssid";
|
|
20451
20451
|
util.powerShell(cmd).then((stdout) => {
|
|
20452
|
-
const ssidParts = stdout.toString("utf8").split(
|
|
20452
|
+
const ssidParts = stdout.toString("utf8").split(os3.EOL + os3.EOL + "SSID ");
|
|
20453
20453
|
ssidParts.shift();
|
|
20454
20454
|
ssidParts.forEach((ssidPart) => {
|
|
20455
|
-
const ssidLines = ssidPart.split(
|
|
20455
|
+
const ssidLines = ssidPart.split(os3.EOL);
|
|
20456
20456
|
if (ssidLines && ssidLines.length >= 8 && ssidLines[0].indexOf(":") >= 0) {
|
|
20457
20457
|
const bssidsParts = ssidPart.split(" BSSID");
|
|
20458
20458
|
bssidsParts.shift();
|
|
20459
20459
|
bssidsParts.forEach((bssidPart) => {
|
|
20460
|
-
const bssidLines = bssidPart.split(
|
|
20460
|
+
const bssidLines = bssidPart.split(os3.EOL);
|
|
20461
20461
|
const bssidLine = bssidLines[0].split(":");
|
|
20462
20462
|
bssidLine.shift();
|
|
20463
20463
|
const bssid = bssidLine.join(":").trim().toLowerCase();
|
|
@@ -20781,9 +20781,9 @@ var require_wifi = __commonJS({
|
|
|
20781
20781
|
var require_processes = __commonJS({
|
|
20782
20782
|
"node_modules/systeminformation/lib/processes.js"(exports2) {
|
|
20783
20783
|
"use strict";
|
|
20784
|
-
var
|
|
20785
|
-
var
|
|
20786
|
-
var
|
|
20784
|
+
var os3 = require("os");
|
|
20785
|
+
var fs3 = require("fs");
|
|
20786
|
+
var path3 = require("path");
|
|
20787
20787
|
var exec = require("child_process").exec;
|
|
20788
20788
|
var execSync = require("child_process").execSync;
|
|
20789
20789
|
var util = require_util();
|
|
@@ -21353,7 +21353,7 @@ var require_processes = __commonJS({
|
|
|
21353
21353
|
}
|
|
21354
21354
|
if (firstPos === 1e4 && tmpCommand.indexOf(" ") > -1) {
|
|
21355
21355
|
const parts = tmpCommand.split(" ");
|
|
21356
|
-
if (
|
|
21356
|
+
if (fs3.existsSync(path3.join(cmdPath, parts[0]))) {
|
|
21357
21357
|
command = parts.shift();
|
|
21358
21358
|
params = (parts.join(" ") + " " + tmpParams).trim();
|
|
21359
21359
|
} else {
|
|
@@ -21432,7 +21432,7 @@ var require_processes = __commonJS({
|
|
|
21432
21432
|
line = line.trim().replace(/ +/g, " ").replace(/,+/g, ".");
|
|
21433
21433
|
const parts = line.split(" ");
|
|
21434
21434
|
const command = parts.slice(9).join(" ");
|
|
21435
|
-
const pmem = parseFloat((1 * parseInt(parts[3]) * 1024 /
|
|
21435
|
+
const pmem = parseFloat((1 * parseInt(parts[3]) * 1024 / os3.totalmem()).toFixed(1));
|
|
21436
21436
|
const started = parseElapsed(parts[5]);
|
|
21437
21437
|
result2.push({
|
|
21438
21438
|
pid: parseInt(parts[0]),
|
|
@@ -21635,7 +21635,7 @@ var require_processes = __commonJS({
|
|
|
21635
21635
|
cpu: 0,
|
|
21636
21636
|
cpuu: 0,
|
|
21637
21637
|
cpus: 0,
|
|
21638
|
-
mem: memw /
|
|
21638
|
+
mem: memw / os3.totalmem() * 100,
|
|
21639
21639
|
priority: element.Priority | null,
|
|
21640
21640
|
memVsz: element.PageFileUsage || null,
|
|
21641
21641
|
memRss: Math.floor((element.WorkingSetSize || 0) / 1024),
|
|
@@ -21789,7 +21789,7 @@ var require_processes = __commonJS({
|
|
|
21789
21789
|
result2.forEach((item) => {
|
|
21790
21790
|
if (item.proc.toLowerCase() === pname.toLowerCase()) {
|
|
21791
21791
|
item.pids.push(pid);
|
|
21792
|
-
item.mem += mem /
|
|
21792
|
+
item.mem += mem / os3.totalmem() * 100;
|
|
21793
21793
|
processFound = true;
|
|
21794
21794
|
}
|
|
21795
21795
|
});
|
|
@@ -21799,7 +21799,7 @@ var require_processes = __commonJS({
|
|
|
21799
21799
|
pid,
|
|
21800
21800
|
pids: [pid],
|
|
21801
21801
|
cpu: 0,
|
|
21802
|
-
mem: mem /
|
|
21802
|
+
mem: mem / os3.totalmem() * 100
|
|
21803
21803
|
});
|
|
21804
21804
|
}
|
|
21805
21805
|
}
|
|
@@ -23540,7 +23540,7 @@ var require_docker = __commonJS({
|
|
|
23540
23540
|
var require_virtualbox = __commonJS({
|
|
23541
23541
|
"node_modules/systeminformation/lib/virtualbox.js"(exports2) {
|
|
23542
23542
|
"use strict";
|
|
23543
|
-
var
|
|
23543
|
+
var os3 = require("os");
|
|
23544
23544
|
var exec = require("child_process").exec;
|
|
23545
23545
|
var util = require_util();
|
|
23546
23546
|
function vboxInfo(callback) {
|
|
@@ -23549,10 +23549,10 @@ var require_virtualbox = __commonJS({
|
|
|
23549
23549
|
process.nextTick(() => {
|
|
23550
23550
|
try {
|
|
23551
23551
|
exec(util.getVboxmanage() + " list vms --long", function(error, stdout) {
|
|
23552
|
-
let parts = (
|
|
23552
|
+
let parts = (os3.EOL + stdout.toString()).split(os3.EOL + "Name:");
|
|
23553
23553
|
parts.shift();
|
|
23554
23554
|
parts.forEach((part) => {
|
|
23555
|
-
const lines = ("Name:" + part).split(
|
|
23555
|
+
const lines = ("Name:" + part).split(os3.EOL);
|
|
23556
23556
|
const state = util.getValue(lines, "State");
|
|
23557
23557
|
const running = state.startsWith("running");
|
|
23558
23558
|
const runningSinceString = running ? state.replace("running (since ", "").replace(")", "").trim() : "";
|
|
@@ -25489,10 +25489,10 @@ var require_bluetooth = __commonJS({
|
|
|
25489
25489
|
"use strict";
|
|
25490
25490
|
var exec = require("child_process").exec;
|
|
25491
25491
|
var execSync = require("child_process").execSync;
|
|
25492
|
-
var
|
|
25492
|
+
var path3 = require("path");
|
|
25493
25493
|
var util = require_util();
|
|
25494
25494
|
var bluetoothVendors = require_bluetoothVendors();
|
|
25495
|
-
var
|
|
25495
|
+
var fs3 = require("fs");
|
|
25496
25496
|
var _platform = process.platform;
|
|
25497
25497
|
var _linux = _platform === "linux" || _platform === "android";
|
|
25498
25498
|
var _darwin = _platform === "darwin";
|
|
@@ -25621,12 +25621,12 @@ var require_bluetooth = __commonJS({
|
|
|
25621
25621
|
if (_linux) {
|
|
25622
25622
|
const btFiles = util.getFilesInPath("/var/lib/bluetooth/");
|
|
25623
25623
|
btFiles.forEach((element) => {
|
|
25624
|
-
const filename =
|
|
25624
|
+
const filename = path3.basename(element);
|
|
25625
25625
|
const pathParts = element.split("/");
|
|
25626
25626
|
const macAddr1 = pathParts.length >= 6 ? pathParts[pathParts.length - 2] : null;
|
|
25627
25627
|
const macAddr2 = pathParts.length >= 7 ? pathParts[pathParts.length - 3] : null;
|
|
25628
25628
|
if (filename === "info") {
|
|
25629
|
-
const infoFile =
|
|
25629
|
+
const infoFile = fs3.readFileSync(element, { encoding: "utf8" }).split("\n");
|
|
25630
25630
|
result2.push(parseLinuxBluetoothInfo(infoFile, macAddr1, macAddr2));
|
|
25631
25631
|
}
|
|
25632
25632
|
});
|
|
@@ -26140,6 +26140,11 @@ __export(index_exports, {
|
|
|
26140
26140
|
});
|
|
26141
26141
|
module.exports = __toCommonJS(index_exports);
|
|
26142
26142
|
|
|
26143
|
+
// src/cli/commands/install/index.ts
|
|
26144
|
+
var fs2 = __toESM(require("node:fs"), 1);
|
|
26145
|
+
var os2 = __toESM(require("node:os"), 1);
|
|
26146
|
+
var path2 = __toESM(require("node:path"), 1);
|
|
26147
|
+
|
|
26143
26148
|
// src/config/default-config.ts
|
|
26144
26149
|
init_theme();
|
|
26145
26150
|
function generateBalancedLayout(style, themeName) {
|
|
@@ -26391,6 +26396,12 @@ function generateRichLayout(style, themeName) {
|
|
|
26391
26396
|
};
|
|
26392
26397
|
}
|
|
26393
26398
|
|
|
26399
|
+
// src/cli/commands/quick-config/menu.ts
|
|
26400
|
+
init_theme();
|
|
26401
|
+
|
|
26402
|
+
// src/cli/commands/quick-config/config-writer.ts
|
|
26403
|
+
var import_promises = require("node:fs/promises");
|
|
26404
|
+
|
|
26394
26405
|
// src/cli/commands/quick-config/config-loader.ts
|
|
26395
26406
|
var import_node_os = require("node:os");
|
|
26396
26407
|
var import_node_path = require("node:path");
|
|
@@ -26402,7 +26413,6 @@ function getUserConfigPath() {
|
|
|
26402
26413
|
}
|
|
26403
26414
|
|
|
26404
26415
|
// src/cli/commands/quick-config/config-writer.ts
|
|
26405
|
-
var import_promises = require("node:fs/promises");
|
|
26406
26416
|
async function saveConfig(config) {
|
|
26407
26417
|
const configDir = getUserConfigDir();
|
|
26408
26418
|
const configPath = getUserConfigPath();
|
|
@@ -26416,11 +26426,7 @@ async function saveConfig(config) {
|
|
|
26416
26426
|
}
|
|
26417
26427
|
}
|
|
26418
26428
|
|
|
26419
|
-
// src/cli/commands/quick-config/index.ts
|
|
26420
|
-
init_layout_preview();
|
|
26421
|
-
|
|
26422
26429
|
// src/cli/commands/quick-config/menu.ts
|
|
26423
|
-
init_theme();
|
|
26424
26430
|
init_layout_preview();
|
|
26425
26431
|
init_select_with_preview();
|
|
26426
26432
|
function getLayoutGenerator(layout) {
|
|
@@ -26585,6 +26591,84 @@ async function runQuickConfigMenu() {
|
|
|
26585
26591
|
}
|
|
26586
26592
|
}
|
|
26587
26593
|
|
|
26594
|
+
// src/cli/commands/install/index.ts
|
|
26595
|
+
var colors2 = {
|
|
26596
|
+
reset: "\x1B[0m",
|
|
26597
|
+
green: "\x1B[32m",
|
|
26598
|
+
yellow: "\x1B[33m",
|
|
26599
|
+
blue: "\x1B[34m",
|
|
26600
|
+
cyan: "\x1B[36m",
|
|
26601
|
+
dim: "\x1B[2m",
|
|
26602
|
+
bold: "\x1B[1m"
|
|
26603
|
+
};
|
|
26604
|
+
function getClaudeSettingsPath() {
|
|
26605
|
+
return path2.join(os2.homedir(), ".claude", "settings.json");
|
|
26606
|
+
}
|
|
26607
|
+
function readClaudeSettings(settingsPath) {
|
|
26608
|
+
try {
|
|
26609
|
+
if (fs2.existsSync(settingsPath)) {
|
|
26610
|
+
const content = fs2.readFileSync(settingsPath, "utf-8");
|
|
26611
|
+
return JSON.parse(content);
|
|
26612
|
+
}
|
|
26613
|
+
} catch {
|
|
26614
|
+
}
|
|
26615
|
+
return {};
|
|
26616
|
+
}
|
|
26617
|
+
function ensureDir(dirPath) {
|
|
26618
|
+
if (!fs2.existsSync(dirPath)) {
|
|
26619
|
+
fs2.mkdirSync(dirPath, { recursive: true });
|
|
26620
|
+
}
|
|
26621
|
+
}
|
|
26622
|
+
function formatJson(obj) {
|
|
26623
|
+
return JSON.stringify(obj, null, 2);
|
|
26624
|
+
}
|
|
26625
|
+
function print(message) {
|
|
26626
|
+
console.log(message);
|
|
26627
|
+
}
|
|
26628
|
+
async function handleInstallCommand() {
|
|
26629
|
+
const settingsPath = getClaudeSettingsPath();
|
|
26630
|
+
const claudeDir = path2.dirname(settingsPath);
|
|
26631
|
+
print("");
|
|
26632
|
+
print(`${colors2.bold}${colors2.cyan}claude-scope${colors2.reset} installer`);
|
|
26633
|
+
print(`${colors2.dim}\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500${colors2.reset}`);
|
|
26634
|
+
print("");
|
|
26635
|
+
ensureDir(claudeDir);
|
|
26636
|
+
const settings = readClaudeSettings(settingsPath);
|
|
26637
|
+
const hadExistingStatusLine = !!settings.statusLine;
|
|
26638
|
+
settings.statusLine = {
|
|
26639
|
+
type: "command",
|
|
26640
|
+
command: "npx -y claude-scope@latest",
|
|
26641
|
+
padding: 0
|
|
26642
|
+
};
|
|
26643
|
+
try {
|
|
26644
|
+
fs2.writeFileSync(settingsPath, formatJson(settings), "utf-8");
|
|
26645
|
+
} catch (error) {
|
|
26646
|
+
print(`${colors2.yellow}Error:${colors2.reset} Failed to write settings.json`);
|
|
26647
|
+
print(`${colors2.dim}${error instanceof Error ? error.message : String(error)}${colors2.reset}`);
|
|
26648
|
+
process.exit(1);
|
|
26649
|
+
}
|
|
26650
|
+
if (hadExistingStatusLine) {
|
|
26651
|
+
print(
|
|
26652
|
+
`${colors2.green}\u2713${colors2.reset} Updated statusLine in ${colors2.dim}${settingsPath}${colors2.reset}`
|
|
26653
|
+
);
|
|
26654
|
+
} else {
|
|
26655
|
+
print(
|
|
26656
|
+
`${colors2.green}\u2713${colors2.reset} Added statusLine to ${colors2.dim}${settingsPath}${colors2.reset}`
|
|
26657
|
+
);
|
|
26658
|
+
}
|
|
26659
|
+
print("");
|
|
26660
|
+
print(`${colors2.bold}Now let's customize your statusline:${colors2.reset}`);
|
|
26661
|
+
print("");
|
|
26662
|
+
await runQuickConfigMenu();
|
|
26663
|
+
print("");
|
|
26664
|
+
print(`${colors2.green}\u2713${colors2.reset} Installation complete!`);
|
|
26665
|
+
print(`${colors2.dim}Restart Claude Code to see your new statusline.${colors2.reset}`);
|
|
26666
|
+
print("");
|
|
26667
|
+
}
|
|
26668
|
+
|
|
26669
|
+
// src/cli/commands/quick-config/index.ts
|
|
26670
|
+
init_layout_preview();
|
|
26671
|
+
|
|
26588
26672
|
// src/cli/commands/quick-config/preview.ts
|
|
26589
26673
|
init_renderer();
|
|
26590
26674
|
init_widget_registry();
|
|
@@ -26692,9 +26776,9 @@ init_stdin_data_widget();
|
|
|
26692
26776
|
// src/widgets/cwd/styles.ts
|
|
26693
26777
|
init_colors();
|
|
26694
26778
|
init_style_utils();
|
|
26695
|
-
function shortenPath(
|
|
26779
|
+
function shortenPath(path3) {
|
|
26696
26780
|
const home = process.env.HOME || "";
|
|
26697
|
-
const result2 = home &&
|
|
26781
|
+
const result2 = home && path3.startsWith(home) ? "~" + path3.slice(home.length) : path3;
|
|
26698
26782
|
const parts = result2.split("/").filter(Boolean);
|
|
26699
26783
|
if (parts.length <= 2) return result2;
|
|
26700
26784
|
const shortened = parts.map((p, i) => i === parts.length - 1 ? p : p[0] || p);
|
|
@@ -26707,67 +26791,67 @@ var cwdStyles = {
|
|
|
26707
26791
|
* Minimal style (default): shortened path with ~
|
|
26708
26792
|
* /Users/demo/projects/claude-scope -> ~/p/claude-scope
|
|
26709
26793
|
*/
|
|
26710
|
-
minimal: (data,
|
|
26794
|
+
minimal: (data, colors3) => {
|
|
26711
26795
|
const short = shortenPath(data.fullPath);
|
|
26712
|
-
return
|
|
26796
|
+
return colors3 ? colorize(short, colors3.name) : short;
|
|
26713
26797
|
},
|
|
26714
26798
|
/**
|
|
26715
26799
|
* Balanced style: directory name only
|
|
26716
26800
|
* /Users/demo/projects/claude-scope -> claude-scope
|
|
26717
26801
|
*/
|
|
26718
|
-
balanced: (data,
|
|
26719
|
-
return
|
|
26802
|
+
balanced: (data, colors3) => {
|
|
26803
|
+
return colors3 ? colorize(data.dirName, colors3.name) : data.dirName;
|
|
26720
26804
|
},
|
|
26721
26805
|
/**
|
|
26722
26806
|
* Compact style: same as balanced (directory name only)
|
|
26723
26807
|
* /Users/demo/projects/claude-scope -> claude-scope
|
|
26724
26808
|
*/
|
|
26725
|
-
compact: (data,
|
|
26726
|
-
return
|
|
26809
|
+
compact: (data, colors3) => {
|
|
26810
|
+
return colors3 ? colorize(data.dirName, colors3.name) : data.dirName;
|
|
26727
26811
|
},
|
|
26728
26812
|
/**
|
|
26729
26813
|
* Playful style: with folder emoji
|
|
26730
26814
|
* /Users/demo/projects/claude-scope -> 📁 claude-scope
|
|
26731
26815
|
*/
|
|
26732
|
-
playful: (data,
|
|
26733
|
-
const colored =
|
|
26816
|
+
playful: (data, colors3) => {
|
|
26817
|
+
const colored = colors3 ? colorize(data.dirName, colors3.name) : data.dirName;
|
|
26734
26818
|
return `\u{1F4C1} ${colored}`;
|
|
26735
26819
|
},
|
|
26736
26820
|
/**
|
|
26737
26821
|
* Technical style: full path with colored separators
|
|
26738
26822
|
* /Users/demo/projects/claude-scope -> /Users/demo/projects/claude-scope
|
|
26739
26823
|
*/
|
|
26740
|
-
technical: (data,
|
|
26741
|
-
if (!
|
|
26824
|
+
technical: (data, colors3) => {
|
|
26825
|
+
if (!colors3) return data.fullPath;
|
|
26742
26826
|
const parts = data.fullPath.split("/");
|
|
26743
26827
|
return parts.map((p, i) => {
|
|
26744
26828
|
if (p === "") return "";
|
|
26745
|
-
const color = i === parts.length - 1 ?
|
|
26829
|
+
const color = i === parts.length - 1 ? colors3.name : colors3.separator;
|
|
26746
26830
|
return colorize(p, color);
|
|
26747
|
-
}).join(colorize("/",
|
|
26831
|
+
}).join(colorize("/", colors3.separator));
|
|
26748
26832
|
},
|
|
26749
26833
|
/**
|
|
26750
26834
|
* Symbolic style: with diamond symbol
|
|
26751
26835
|
* /Users/demo/projects/claude-scope -> ◆ claude-scope
|
|
26752
26836
|
*/
|
|
26753
|
-
symbolic: (data,
|
|
26754
|
-
const colored =
|
|
26837
|
+
symbolic: (data, colors3) => {
|
|
26838
|
+
const colored = colors3 ? colorize(data.dirName, colors3.name) : data.dirName;
|
|
26755
26839
|
return `\u25C6 ${colored}`;
|
|
26756
26840
|
},
|
|
26757
26841
|
/**
|
|
26758
26842
|
* Labeled style: with Dir: prefix
|
|
26759
26843
|
* /Users/demo/projects/claude-scope -> Dir: claude-scope
|
|
26760
26844
|
*/
|
|
26761
|
-
labeled: (data,
|
|
26762
|
-
const colored =
|
|
26845
|
+
labeled: (data, colors3) => {
|
|
26846
|
+
const colored = colors3 ? colorize(data.dirName, colors3.name) : data.dirName;
|
|
26763
26847
|
return withLabel("Dir", colored);
|
|
26764
26848
|
},
|
|
26765
26849
|
/**
|
|
26766
26850
|
* Indicator style: with bullet indicator
|
|
26767
26851
|
* /Users/demo/projects/claude-scope -> ● claude-scope
|
|
26768
26852
|
*/
|
|
26769
|
-
indicator: (data,
|
|
26770
|
-
const colored =
|
|
26853
|
+
indicator: (data, colors3) => {
|
|
26854
|
+
const colored = colors3 ? colorize(data.dirName, colors3.name) : data.dirName;
|
|
26771
26855
|
return withIndicator(colored);
|
|
26772
26856
|
}
|
|
26773
26857
|
};
|
|
@@ -26784,9 +26868,9 @@ var CwdWidget = class extends StdinDataWidget {
|
|
|
26784
26868
|
);
|
|
26785
26869
|
colors;
|
|
26786
26870
|
styleFn = cwdStyles.minimal;
|
|
26787
|
-
constructor(
|
|
26871
|
+
constructor(colors3) {
|
|
26788
26872
|
super();
|
|
26789
|
-
this.colors =
|
|
26873
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
26790
26874
|
}
|
|
26791
26875
|
setStyle(style = "minimal") {
|
|
26792
26876
|
const fn = cwdStyles[style];
|
|
@@ -26829,6 +26913,9 @@ function parseCommand() {
|
|
|
26829
26913
|
if (args[0] === "quick-config") {
|
|
26830
26914
|
return "quick-config";
|
|
26831
26915
|
}
|
|
26916
|
+
if (args[0] === "install") {
|
|
26917
|
+
return "install";
|
|
26918
|
+
}
|
|
26832
26919
|
return "stdin";
|
|
26833
26920
|
}
|
|
26834
26921
|
async function routeCommand(command) {
|
|
@@ -26836,6 +26923,9 @@ async function routeCommand(command) {
|
|
|
26836
26923
|
case "quick-config":
|
|
26837
26924
|
await handleQuickConfigCommand();
|
|
26838
26925
|
break;
|
|
26926
|
+
case "install":
|
|
26927
|
+
await handleInstallCommand();
|
|
26928
|
+
break;
|
|
26839
26929
|
case "stdin":
|
|
26840
26930
|
throw new Error("stdin mode should be handled by main()");
|
|
26841
26931
|
default: {
|
|
@@ -26928,8 +27018,8 @@ async function loadSystemInformation() {
|
|
|
26928
27018
|
var NETWORK_STATS_FILE = "/tmp/claude-scope-network-stats.json";
|
|
26929
27019
|
async function loadNetworkStats() {
|
|
26930
27020
|
try {
|
|
26931
|
-
const
|
|
26932
|
-
const text = await
|
|
27021
|
+
const fs3 = await import("node:fs/promises");
|
|
27022
|
+
const text = await fs3.readFile(NETWORK_STATS_FILE, "utf-8");
|
|
26933
27023
|
const data = JSON.parse(text);
|
|
26934
27024
|
if (Date.now() - data.lastUpdate > 5 * 60 * 1e3) {
|
|
26935
27025
|
return /* @__PURE__ */ new Map();
|
|
@@ -26958,12 +27048,12 @@ async function saveNetworkStats(stats) {
|
|
|
26958
27048
|
return;
|
|
26959
27049
|
}
|
|
26960
27050
|
try {
|
|
26961
|
-
const
|
|
27051
|
+
const fs3 = await import("node:fs/promises");
|
|
26962
27052
|
const data = {
|
|
26963
27053
|
stats: Object.fromEntries(pendingSaveData),
|
|
26964
27054
|
lastUpdate: Date.now()
|
|
26965
27055
|
};
|
|
26966
|
-
await
|
|
27056
|
+
await fs3.writeFile(NETWORK_STATS_FILE, JSON.stringify(data), "utf-8");
|
|
26967
27057
|
} catch {
|
|
26968
27058
|
} finally {
|
|
26969
27059
|
pendingSave = null;
|
|
@@ -26995,7 +27085,7 @@ var SystemProvider = class {
|
|
|
26995
27085
|
return null;
|
|
26996
27086
|
}
|
|
26997
27087
|
try {
|
|
26998
|
-
const [cpuLoad, mem,
|
|
27088
|
+
const [cpuLoad, mem, fs3, net] = await Promise.all([
|
|
26999
27089
|
si.currentLoad(),
|
|
27000
27090
|
si.mem(),
|
|
27001
27091
|
si.fsSize(),
|
|
@@ -27007,7 +27097,7 @@ var SystemProvider = class {
|
|
|
27007
27097
|
const memUsedGB = mem.active / 1024 / 1024 / 1024;
|
|
27008
27098
|
const memTotalGB = mem.total / 1024 / 1024 / 1024;
|
|
27009
27099
|
const memPercent = Math.round(mem.active / mem.total * 100);
|
|
27010
|
-
const mainFs = Array.isArray(
|
|
27100
|
+
const mainFs = Array.isArray(fs3) ? fs3[0] : fs3;
|
|
27011
27101
|
const diskUsedGB = mainFs.used / 1024 / 1024 / 1024;
|
|
27012
27102
|
const diskTotalGB = mainFs.size / 1024 / 1024 / 1024;
|
|
27013
27103
|
const diskPercent = Math.round(mainFs.use);
|
|
@@ -27609,14 +27699,14 @@ function formatCardEmojiByParticipation(cardData, isParticipating) {
|
|
|
27609
27699
|
return `${cardText} `;
|
|
27610
27700
|
}
|
|
27611
27701
|
}
|
|
27612
|
-
function formatHandResult(handResult,
|
|
27702
|
+
function formatHandResult(handResult, colors3) {
|
|
27613
27703
|
if (!handResult) {
|
|
27614
27704
|
return "\u2014";
|
|
27615
27705
|
}
|
|
27616
27706
|
const playerParticipates = handResult.participatingIndices.some((idx) => idx < 2);
|
|
27617
27707
|
const resultText = !playerParticipates ? `Nothing \u{1F0CF}` : `${handResult.name}! ${handResult.emoji}`;
|
|
27618
|
-
if (!
|
|
27619
|
-
return colorize(resultText,
|
|
27708
|
+
if (!colors3) return resultText;
|
|
27709
|
+
return colorize(resultText, colors3.result);
|
|
27620
27710
|
}
|
|
27621
27711
|
function getHandAbbreviation(handResult) {
|
|
27622
27712
|
if (!handResult) {
|
|
@@ -27625,39 +27715,39 @@ function getHandAbbreviation(handResult) {
|
|
|
27625
27715
|
const abbreviation = HAND_ABBREVIATIONS[handResult.name] ?? "\u2014";
|
|
27626
27716
|
return `${abbreviation} (${handResult.name})`;
|
|
27627
27717
|
}
|
|
27628
|
-
function balancedStyle2(data,
|
|
27718
|
+
function balancedStyle2(data, colors3) {
|
|
27629
27719
|
const { holeCards, boardCards, handResult } = data;
|
|
27630
27720
|
const participatingSet = new Set(handResult?.participatingIndices || []);
|
|
27631
27721
|
const handStr = holeCards.map((hc, idx) => formatCardByParticipation(hc, participatingSet.has(idx))).join("");
|
|
27632
27722
|
const boardStr = boardCards.map((bc, idx) => formatCardByParticipation(bc, participatingSet.has(idx + 2))).join("");
|
|
27633
|
-
const labelColor =
|
|
27723
|
+
const labelColor = colors3?.participating ?? lightGray;
|
|
27634
27724
|
const handLabel = colorize("Hand:", labelColor);
|
|
27635
27725
|
const boardLabel = colorize("Board:", labelColor);
|
|
27636
|
-
return `${handLabel} ${handStr}| ${boardLabel} ${boardStr}\u2192 ${formatHandResult(handResult,
|
|
27726
|
+
return `${handLabel} ${handStr}| ${boardLabel} ${boardStr}\u2192 ${formatHandResult(handResult, colors3)}`;
|
|
27637
27727
|
}
|
|
27638
27728
|
var pokerStyles = {
|
|
27639
27729
|
balanced: balancedStyle2,
|
|
27640
27730
|
compact: balancedStyle2,
|
|
27641
27731
|
playful: balancedStyle2,
|
|
27642
|
-
"compact-verbose": (data,
|
|
27732
|
+
"compact-verbose": (data, colors3) => {
|
|
27643
27733
|
const { holeCards, boardCards, handResult } = data;
|
|
27644
27734
|
const participatingSet = new Set(handResult?.participatingIndices || []);
|
|
27645
27735
|
const handStr = holeCards.map((hc, idx) => formatCardCompact(hc, participatingSet.has(idx))).join("");
|
|
27646
27736
|
const boardStr = boardCards.map((bc, idx) => formatCardCompact(bc, participatingSet.has(idx + 2))).join("");
|
|
27647
27737
|
const abbreviation = getHandAbbreviation(handResult);
|
|
27648
27738
|
const result2 = `${handStr}| ${boardStr}\u2192 ${abbreviation}`;
|
|
27649
|
-
if (!
|
|
27650
|
-
return colorize(result2,
|
|
27739
|
+
if (!colors3) return result2;
|
|
27740
|
+
return colorize(result2, colors3.result);
|
|
27651
27741
|
},
|
|
27652
|
-
emoji: (data,
|
|
27742
|
+
emoji: (data, colors3) => {
|
|
27653
27743
|
const { holeCards, boardCards, handResult } = data;
|
|
27654
27744
|
const participatingSet = new Set(handResult?.participatingIndices || []);
|
|
27655
27745
|
const handStr = holeCards.map((hc, idx) => formatCardEmojiByParticipation(hc, participatingSet.has(idx))).join("");
|
|
27656
27746
|
const boardStr = boardCards.map((bc, idx) => formatCardEmojiByParticipation(bc, participatingSet.has(idx + 2))).join("");
|
|
27657
|
-
const labelColor =
|
|
27747
|
+
const labelColor = colors3?.participating ?? lightGray;
|
|
27658
27748
|
const handLabel = colorize("Hand:", labelColor);
|
|
27659
27749
|
const boardLabel = colorize("Board:", labelColor);
|
|
27660
|
-
return `${handLabel} ${handStr}| ${boardLabel} ${boardStr}\u2192 ${formatHandResult(handResult,
|
|
27750
|
+
return `${handLabel} ${handStr}| ${boardLabel} ${boardStr}\u2192 ${formatHandResult(handResult, colors3)}`;
|
|
27661
27751
|
}
|
|
27662
27752
|
};
|
|
27663
27753
|
|
|
@@ -27686,9 +27776,9 @@ var PokerWidget = class extends StdinDataWidget {
|
|
|
27686
27776
|
this.styleFn = fn;
|
|
27687
27777
|
}
|
|
27688
27778
|
}
|
|
27689
|
-
constructor(
|
|
27779
|
+
constructor(colors3) {
|
|
27690
27780
|
super();
|
|
27691
|
-
this.colors =
|
|
27781
|
+
this.colors = colors3 ?? DEFAULT_THEME;
|
|
27692
27782
|
}
|
|
27693
27783
|
/**
|
|
27694
27784
|
* Generate new poker hand on each update
|
|
@@ -27851,12 +27941,12 @@ init_widget_registry();
|
|
|
27851
27941
|
function success(data) {
|
|
27852
27942
|
return { success: true, data };
|
|
27853
27943
|
}
|
|
27854
|
-
function failure(
|
|
27855
|
-
return { success: false, error: { path:
|
|
27944
|
+
function failure(path3, message, value) {
|
|
27945
|
+
return { success: false, error: { path: path3, message, value } };
|
|
27856
27946
|
}
|
|
27857
27947
|
function formatError(error) {
|
|
27858
|
-
const
|
|
27859
|
-
return `${
|
|
27948
|
+
const path3 = error.path.length > 0 ? error.path.join(".") : "root";
|
|
27949
|
+
return `${path3}: ${error.message}`;
|
|
27860
27950
|
}
|
|
27861
27951
|
|
|
27862
27952
|
// src/validation/combinators.ts
|
|
@@ -28045,7 +28135,7 @@ function applyWidgetConfig(widget, widgetConfig) {
|
|
|
28045
28135
|
async function main() {
|
|
28046
28136
|
try {
|
|
28047
28137
|
const command = parseCommand();
|
|
28048
|
-
if (command === "quick-config") {
|
|
28138
|
+
if (command === "quick-config" || command === "install") {
|
|
28049
28139
|
await routeCommand(command);
|
|
28050
28140
|
return "";
|
|
28051
28141
|
}
|