claude-scope 0.8.45 → 0.8.47

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.
Files changed (2) hide show
  1. package/dist/claude-scope.cjs +253 -227
  2. package/package.json +1 -1
@@ -148,6 +148,10 @@ function createThemeColors(params) {
148
148
  disk: params.sysmonDisk,
149
149
  network: params.sysmonNetwork,
150
150
  separator: params.sysmonSeparator
151
+ },
152
+ configCount: {
153
+ label: params.configCountLabel ?? semantic.info,
154
+ separator: params.configCountSeparator ?? base.muted
151
155
  }
152
156
  };
153
157
  }
@@ -2092,6 +2096,10 @@ function getDefaultColors() {
2092
2096
  disk: "\x1B[33m",
2093
2097
  network: "\x1B[32m",
2094
2098
  separator: "\x1B[90m"
2099
+ },
2100
+ configCount: {
2101
+ label: "\x1B[36m",
2102
+ separator: "\x1B[90m"
2095
2103
  }
2096
2104
  };
2097
2105
  }
@@ -3233,98 +3241,90 @@ var init_styles3 = __esm({
3233
3241
  balanced: (data, colors2) => {
3234
3242
  const { claudeMdCount, rulesCount, mcpCount, hooksCount } = data;
3235
3243
  const parts = [];
3236
- const info = colors2?.semantic.info ?? "";
3237
- const muted = colors2?.base.muted ?? "";
3238
3244
  if (claudeMdCount > 0) {
3239
- const label = info ? colorize("CLAUDE.md", info) : "CLAUDE.md";
3245
+ const label = colors2 ? colorize("CLAUDE.md", colors2.label) : "CLAUDE.md";
3240
3246
  parts.push(`${label}:${claudeMdCount}`);
3241
3247
  }
3242
3248
  if (rulesCount > 0) {
3243
- const label = info ? colorize("rules", info) : "rules";
3249
+ const label = colors2 ? colorize("rules", colors2.label) : "rules";
3244
3250
  parts.push(`${label}:${rulesCount}`);
3245
3251
  }
3246
3252
  if (mcpCount > 0) {
3247
- const label = info ? colorize("MCPs", info) : "MCPs";
3253
+ const label = colors2 ? colorize("MCPs", colors2.label) : "MCPs";
3248
3254
  parts.push(`${label}:${mcpCount}`);
3249
3255
  }
3250
3256
  if (hooksCount > 0) {
3251
- const label = info ? colorize("hooks", info) : "hooks";
3257
+ const label = colors2 ? colorize("hooks", colors2.label) : "hooks";
3252
3258
  parts.push(`${label}:${hooksCount}`);
3253
3259
  }
3254
- const sep = muted ? colorize(" \u2502 ", muted) : " \u2502 ";
3260
+ const sep = colors2 ? colorize(" \u2502 ", colors2.separator) : " \u2502 ";
3255
3261
  return parts.join(sep);
3256
3262
  },
3257
3263
  compact: (data, colors2) => {
3258
3264
  const { claudeMdCount, rulesCount, mcpCount, hooksCount } = data;
3259
3265
  const parts = [];
3260
- const info = colors2?.semantic.info ?? "";
3261
- const muted = colors2?.base.muted ?? "";
3262
3266
  if (claudeMdCount > 0) {
3263
- const text = info ? colorize(`${claudeMdCount} docs`, info) : `${claudeMdCount} docs`;
3267
+ const text = colors2 ? colorize(`${claudeMdCount} docs`, colors2.label) : `${claudeMdCount} docs`;
3264
3268
  parts.push(text);
3265
3269
  }
3266
3270
  if (rulesCount > 0) {
3267
- const text = info ? colorize(`${rulesCount} rules`, info) : `${rulesCount} rules`;
3271
+ const text = colors2 ? colorize(`${rulesCount} rules`, colors2.label) : `${rulesCount} rules`;
3268
3272
  parts.push(text);
3269
3273
  }
3270
3274
  if (mcpCount > 0) {
3271
- const text = info ? colorize(`${mcpCount} MCPs`, info) : `${mcpCount} MCPs`;
3275
+ const text = colors2 ? colorize(`${mcpCount} MCPs`, colors2.label) : `${mcpCount} MCPs`;
3272
3276
  parts.push(text);
3273
3277
  }
3274
3278
  if (hooksCount > 0) {
3275
3279
  const hookLabel = hooksCount === 1 ? "hook" : "hooks";
3276
- const text = info ? colorize(`${hooksCount} ${hookLabel}`, info) : `${hooksCount} ${hookLabel}`;
3280
+ const text = colors2 ? colorize(`${hooksCount} ${hookLabel}`, colors2.label) : `${hooksCount} ${hookLabel}`;
3277
3281
  parts.push(text);
3278
3282
  }
3279
- const sep = muted ? colorize(" \u2502 ", muted) : " \u2502 ";
3283
+ const sep = colors2 ? colorize(" \u2502 ", colors2.separator) : " \u2502 ";
3280
3284
  return parts.join(sep);
3281
3285
  },
3282
3286
  playful: (data, colors2) => {
3283
3287
  const { claudeMdCount, rulesCount, mcpCount, hooksCount } = data;
3284
3288
  const parts = [];
3285
- const info = colors2?.semantic.info ?? "";
3286
- const muted = colors2?.base.muted ?? "";
3287
3289
  if (claudeMdCount > 0) {
3288
- const text = info ? colorize(`CLAUDE.md:${claudeMdCount}`, info) : `CLAUDE.md:${claudeMdCount}`;
3290
+ const text = colors2 ? colorize(`CLAUDE.md:${claudeMdCount}`, colors2.label) : `CLAUDE.md:${claudeMdCount}`;
3289
3291
  parts.push(`\u{1F4C4} ${text}`);
3290
3292
  }
3291
3293
  if (rulesCount > 0) {
3292
- const text = info ? colorize(`rules:${rulesCount}`, info) : `rules:${rulesCount}`;
3294
+ const text = colors2 ? colorize(`rules:${rulesCount}`, colors2.label) : `rules:${rulesCount}`;
3293
3295
  parts.push(`\u{1F4DC} ${text}`);
3294
3296
  }
3295
3297
  if (mcpCount > 0) {
3296
- const text = info ? colorize(`MCPs:${mcpCount}`, info) : `MCPs:${mcpCount}`;
3298
+ const text = colors2 ? colorize(`MCPs:${mcpCount}`, colors2.label) : `MCPs:${mcpCount}`;
3297
3299
  parts.push(`\u{1F50C} ${text}`);
3298
3300
  }
3299
3301
  if (hooksCount > 0) {
3300
- const text = info ? colorize(`hooks:${hooksCount}`, info) : `hooks:${hooksCount}`;
3302
+ const text = colors2 ? colorize(`hooks:${hooksCount}`, colors2.label) : `hooks:${hooksCount}`;
3301
3303
  parts.push(`\u{1FA9D} ${text}`);
3302
3304
  }
3303
- const sep = muted ? colorize(" \u2502 ", muted) : " \u2502 ";
3305
+ const sep = colors2 ? colorize(" \u2502 ", colors2.separator) : " \u2502 ";
3304
3306
  return parts.join(sep);
3305
3307
  },
3306
3308
  verbose: (data, colors2) => {
3307
3309
  const { claudeMdCount, rulesCount, mcpCount, hooksCount } = data;
3308
3310
  const parts = [];
3309
- const info = colors2?.semantic.info ?? "";
3310
- const muted = colors2?.base.muted ?? "";
3311
3311
  if (claudeMdCount > 0) {
3312
- const text = info ? colorize(`${claudeMdCount} CLAUDE.md`, info) : `${claudeMdCount} CLAUDE.md`;
3312
+ const text = colors2 ? colorize(`${claudeMdCount} CLAUDE.md`, colors2.label) : `${claudeMdCount} CLAUDE.md`;
3313
3313
  parts.push(text);
3314
3314
  }
3315
3315
  if (rulesCount > 0) {
3316
- const text = info ? colorize(`${rulesCount} rules`, info) : `${rulesCount} rules`;
3316
+ const text = colors2 ? colorize(`${rulesCount} rules`, colors2.label) : `${rulesCount} rules`;
3317
3317
  parts.push(text);
3318
3318
  }
3319
3319
  if (mcpCount > 0) {
3320
- const text = info ? colorize(`${mcpCount} MCP servers`, info) : `${mcpCount} MCP servers`;
3320
+ const text = colors2 ? colorize(`${mcpCount} MCP servers`, colors2.label) : `${mcpCount} MCP servers`;
3321
3321
  parts.push(text);
3322
3322
  }
3323
3323
  if (hooksCount > 0) {
3324
- const text = info ? colorize(`${hooksCount} hooks`, info) : `${hooksCount} hooks`;
3324
+ const text = colors2 ? colorize(`${hooksCount} hooks`, colors2.label) : `${hooksCount} hooks`;
3325
3325
  parts.push(text);
3326
3326
  }
3327
- const sep = muted ? colorize(" \u2502 ", muted) : " \u2502 ";
3327
+ const sep = colors2 ? colorize(" \u2502 ", colors2.separator) : " \u2502 ";
3328
3328
  return parts.join(sep);
3329
3329
  }
3330
3330
  };
@@ -3391,7 +3391,7 @@ var init_config_count_widget = __esm({
3391
3391
  mcpCount,
3392
3392
  hooksCount
3393
3393
  };
3394
- return this.styleFn(renderData, this.colors);
3394
+ return this.styleFn(renderData, this.colors.configCount);
3395
3395
  }
3396
3396
  setLine(line) {
3397
3397
  this._lineOverride = line;
@@ -4298,6 +4298,40 @@ var init_duration_widget = __esm({
4298
4298
  }
4299
4299
  });
4300
4300
 
4301
+ // src/widgets/empty-line-widget.ts
4302
+ var EmptyLineWidget;
4303
+ var init_empty_line_widget = __esm({
4304
+ "src/widgets/empty-line-widget.ts"() {
4305
+ "use strict";
4306
+ init_widget_types();
4307
+ init_stdin_data_widget();
4308
+ EmptyLineWidget = class extends StdinDataWidget {
4309
+ id = "empty-line";
4310
+ metadata = createWidgetMetadata(
4311
+ "Empty Line",
4312
+ "Empty line separator",
4313
+ "1.0.0",
4314
+ "claude-scope",
4315
+ 5
4316
+ // Sixth line (0-indexed)
4317
+ );
4318
+ /**
4319
+ * All styles return the same value (Braille Pattern Blank).
4320
+ * This method exists for API consistency with other widgets.
4321
+ */
4322
+ setStyle(_style) {
4323
+ }
4324
+ /**
4325
+ * Return Braille Pattern Blank to create a visible empty separator line.
4326
+ * U+2800 occupies cell width but appears blank, ensuring the line renders.
4327
+ */
4328
+ renderWithData(_data, _context) {
4329
+ return "\u2800";
4330
+ }
4331
+ };
4332
+ }
4333
+ });
4334
+
4301
4335
  // src/providers/git-provider.ts
4302
4336
  function createGit(cwd) {
4303
4337
  return new NativeGit(cwd);
@@ -4370,36 +4404,29 @@ var init_styles9 = __esm({
4370
4404
  init_style_utils();
4371
4405
  gitTagStyles = {
4372
4406
  balanced: (data, colors2) => {
4373
- const tag = data.tag || "\u2014";
4374
- if (!colors2) return tag;
4375
- return colorize(tag, colors2.branch);
4407
+ if (!colors2) return data.tag;
4408
+ return colorize(data.tag, colors2.branch);
4376
4409
  },
4377
4410
  compact: (data, colors2) => {
4378
- if (!data.tag) return "\u2014";
4379
4411
  const tag = data.tag.replace(/^v/, "");
4380
4412
  if (!colors2) return tag;
4381
4413
  return colorize(tag, colors2.branch);
4382
4414
  },
4383
4415
  playful: (data, colors2) => {
4384
- const tag = data.tag || "\u2014";
4385
- if (!colors2) return `\u{1F3F7}\uFE0F ${tag}`;
4386
- return `\u{1F3F7}\uFE0F ${colorize(tag, colors2.branch)}`;
4416
+ if (!colors2) return `\u{1F3F7}\uFE0F ${data.tag}`;
4417
+ return `\u{1F3F7}\uFE0F ${colorize(data.tag, colors2.branch)}`;
4387
4418
  },
4388
4419
  verbose: (data, colors2) => {
4389
- if (!data.tag) return "version: none";
4390
- const tag = `version ${data.tag}`;
4391
- if (!colors2) return tag;
4420
+ if (!colors2) return `version ${data.tag}`;
4392
4421
  return `version ${colorize(data.tag, colors2.branch)}`;
4393
4422
  },
4394
4423
  labeled: (data, colors2) => {
4395
- const tag = data.tag || "none";
4396
- if (!colors2) return withLabel("Tag", tag);
4397
- return withLabel("Tag", colorize(tag, colors2.branch));
4424
+ if (!colors2) return withLabel("Tag", data.tag);
4425
+ return withLabel("Tag", colorize(data.tag, colors2.branch));
4398
4426
  },
4399
4427
  indicator: (data, colors2) => {
4400
- const tag = data.tag || "\u2014";
4401
- if (!colors2) return withIndicator(tag);
4402
- return withIndicator(colorize(tag, colors2.branch));
4428
+ if (!colors2) return withIndicator(data.tag);
4429
+ return withIndicator(colorize(data.tag, colors2.branch));
4403
4430
  }
4404
4431
  };
4405
4432
  }
@@ -4463,6 +4490,9 @@ var init_git_tag_widget = __esm({
4463
4490
  }
4464
4491
  try {
4465
4492
  const latestTag = await (this.git.latestTag?.() ?? Promise.resolve(null));
4493
+ if (!latestTag) {
4494
+ return null;
4495
+ }
4466
4496
  const renderData = { tag: latestTag };
4467
4497
  return this.styleFn(renderData, this.colors.git);
4468
4498
  } catch {
@@ -4870,6 +4900,128 @@ var init_model_widget = __esm({
4870
4900
  }
4871
4901
  });
4872
4902
 
4903
+ // src/widgets/sysmon/styles.ts
4904
+ function formatGB(gb) {
4905
+ if (gb < 1) {
4906
+ return `${Math.round(gb * 1024)}MB`;
4907
+ }
4908
+ const formatted = gb.toFixed(1);
4909
+ return formatted.endsWith(".0") ? `${formatted.slice(0, -2)}GB` : `${formatted}GB`;
4910
+ }
4911
+ function formatMB(mb) {
4912
+ if (mb < 0.1) {
4913
+ const kb = mb * 1024;
4914
+ const formatted2 = kb.toFixed(1);
4915
+ return formatted2.endsWith(".0") ? `${formatted2.slice(0, -2)}KB` : `${formatted2}KB`;
4916
+ }
4917
+ const formatted = mb.toFixed(1);
4918
+ return formatted.endsWith(".0") ? `${formatted.slice(0, -2)}MB` : `${formatted}MB`;
4919
+ }
4920
+ var sysmonStyles;
4921
+ var init_styles13 = __esm({
4922
+ "src/widgets/sysmon/styles.ts"() {
4923
+ "use strict";
4924
+ init_colors();
4925
+ sysmonStyles = {
4926
+ balanced: (data, colors2) => {
4927
+ const cpu = colors2 ? colorize(`CPU ${data.cpu.percent}%`, colors2.cpu) : `CPU ${data.cpu.percent}%`;
4928
+ const ram = colors2 ? colorize(`RAM ${formatGB(data.memory.used)}`, colors2.ram) : `RAM ${formatGB(data.memory.used)}`;
4929
+ const disk = colors2 ? colorize(`Disk ${data.disk.percent}%`, colors2.disk) : `Disk ${data.disk.percent}%`;
4930
+ const net = colors2 ? colorize(`Net \u2193${formatMB(data.network.rxSec)}/s`, colors2.network) : `Net \u2193${formatMB(data.network.rxSec)}/s`;
4931
+ const sep = colors2 ? colorize("|", colors2.separator) : "|";
4932
+ return `${cpu} ${sep} ${ram} ${sep} ${disk} ${sep} ${net}`;
4933
+ },
4934
+ compact: (data, colors2) => {
4935
+ const cpu = colors2 ? colorize(`CPU${data.cpu.percent}%`, colors2.cpu) : `CPU${data.cpu.percent}%`;
4936
+ const ram = colors2 ? colorize(`RAM${formatGB(data.memory.used)}`, colors2.ram) : `RAM${formatGB(data.memory.used)}`;
4937
+ const disk = colors2 ? colorize(`D${data.disk.percent}%`, colors2.disk) : `D${data.disk.percent}%`;
4938
+ const net = colors2 ? colorize(`\u2193${formatMB(data.network.rxSec)}/s`, colors2.network) : `\u2193${formatMB(data.network.rxSec)}/s`;
4939
+ return `${cpu} ${ram} ${disk} ${net}`;
4940
+ },
4941
+ playful: (data, colors2) => {
4942
+ const cpu = colors2 ? colorize(`${data.cpu.percent}%`, colors2.cpu) : `${data.cpu.percent}%`;
4943
+ const ram = colors2 ? colorize(formatGB(data.memory.used), colors2.ram) : formatGB(data.memory.used);
4944
+ const disk = colors2 ? colorize(`${data.disk.percent}%`, colors2.disk) : `${data.disk.percent}%`;
4945
+ const net = colors2 ? colorize(`\u2193${formatMB(data.network.rxSec)}/s`, colors2.network) : `\u2193${formatMB(data.network.rxSec)}/s`;
4946
+ const sep = colors2 ? colorize("|", colors2.separator) : "|";
4947
+ return `\u{1F5A5}\uFE0F ${cpu} ${sep} \u{1F4BE} ${ram} ${sep} \u{1F4BF} ${disk} ${sep} \u{1F310} ${net}`;
4948
+ },
4949
+ verbose: (data, colors2) => {
4950
+ const cpu = colors2 ? colorize(`CPU: ${data.cpu.percent}%`, colors2.cpu) : `CPU: ${data.cpu.percent}%`;
4951
+ const ram = colors2 ? colorize(`RAM: ${formatGB(data.memory.used)}/${formatGB(data.memory.total)}`, colors2.ram) : `RAM: ${formatGB(data.memory.used)}/${formatGB(data.memory.total)}`;
4952
+ const disk = colors2 ? colorize(`Disk: ${formatGB(data.disk.used)}/${formatGB(data.disk.total)}`, colors2.disk) : `Disk: ${formatGB(data.disk.used)}/${formatGB(data.disk.total)}`;
4953
+ const net = colors2 ? colorize(
4954
+ `Net: \u2193${formatMB(data.network.rxSec)}/s \u2191${formatMB(data.network.txSec)}/s`,
4955
+ colors2.network
4956
+ ) : `Net: \u2193${formatMB(data.network.rxSec)}/s \u2191${formatMB(data.network.txSec)}/s`;
4957
+ return `${cpu} | ${ram} | ${disk} | ${net}`;
4958
+ }
4959
+ };
4960
+ }
4961
+ });
4962
+
4963
+ // src/widgets/sysmon-widget.ts
4964
+ var SysmonWidget;
4965
+ var init_sysmon_widget = __esm({
4966
+ "src/widgets/sysmon-widget.ts"() {
4967
+ "use strict";
4968
+ init_style_types();
4969
+ init_widget_types();
4970
+ init_theme();
4971
+ init_styles13();
4972
+ SysmonWidget = class {
4973
+ id = "sysmon";
4974
+ metadata = createWidgetMetadata(
4975
+ "Sysmon",
4976
+ "System monitoring: CPU, RAM, Disk, Network metrics",
4977
+ "1.0.0",
4978
+ "claude-scope",
4979
+ 2
4980
+ // Default to line 2
4981
+ );
4982
+ colors;
4983
+ provider;
4984
+ styleFn = sysmonStyles.balanced;
4985
+ enabled = true;
4986
+ _lineOverride;
4987
+ constructor(colors2, provider) {
4988
+ this.colors = colors2 ?? DEFAULT_THEME;
4989
+ this.provider = provider ?? null;
4990
+ }
4991
+ async initialize(context) {
4992
+ this.enabled = context.config?.enabled !== false;
4993
+ }
4994
+ async render(_context) {
4995
+ if (!this.provider || !this.isEnabled()) {
4996
+ return null;
4997
+ }
4998
+ const metrics = await this.provider.getMetrics();
4999
+ if (!metrics) {
5000
+ return null;
5001
+ }
5002
+ return this.styleFn(metrics, this.colors.sysmon);
5003
+ }
5004
+ async update(_data) {
5005
+ }
5006
+ isEnabled() {
5007
+ return this.enabled && this.provider !== null;
5008
+ }
5009
+ setStyle(style = DEFAULT_WIDGET_STYLE) {
5010
+ const fn = sysmonStyles[style];
5011
+ if (fn) {
5012
+ this.styleFn = fn;
5013
+ }
5014
+ }
5015
+ setLine(line) {
5016
+ this._lineOverride = line;
5017
+ }
5018
+ getLine() {
5019
+ return this._lineOverride ?? this.metadata.line ?? 0;
5020
+ }
5021
+ };
5022
+ }
5023
+ });
5024
+
4873
5025
  // src/cli/commands/quick-config/demo-data.ts
4874
5026
  function createDemoData() {
4875
5027
  return {
@@ -4911,6 +5063,21 @@ function createDemoData() {
4911
5063
  }
4912
5064
  };
4913
5065
  }
5066
+ function createMockSystemProvider() {
5067
+ const demoMetrics = {
5068
+ cpu: { percent: 42 },
5069
+ memory: { used: 8.2, total: 16, percent: 51 },
5070
+ disk: { used: 120, total: 256, percent: 47 },
5071
+ network: { rxSec: 2.4, txSec: 0.8 }
5072
+ };
5073
+ return {
5074
+ getMetrics: async () => demoMetrics,
5075
+ startUpdate: () => {
5076
+ },
5077
+ stopUpdate: () => {
5078
+ }
5079
+ };
5080
+ }
4914
5081
  var init_demo_data = __esm({
4915
5082
  "src/cli/commands/quick-config/demo-data.ts"() {
4916
5083
  "use strict";
@@ -4983,6 +5150,14 @@ async function registerWidgetsFromConfig(registry, config, style, themeName) {
4983
5150
  const w = new DockerWidget(themeColors);
4984
5151
  w.setStyle(s);
4985
5152
  return w;
5153
+ },
5154
+ sysmon: (s) => {
5155
+ const w = new SysmonWidget(themeColors, createMockSystemProvider());
5156
+ w.setStyle(s);
5157
+ return w;
5158
+ },
5159
+ "empty-line": () => {
5160
+ return new EmptyLineWidget();
4986
5161
  }
4987
5162
  };
4988
5163
  for (const [lineNum, widgets] of Object.entries(config.lines)) {
@@ -5033,10 +5208,12 @@ var init_layout_preview = __esm({
5033
5208
  init_dev_server_widget();
5034
5209
  init_docker_widget();
5035
5210
  init_duration_widget();
5211
+ init_empty_line_widget();
5036
5212
  init_git_tag_widget();
5037
5213
  init_git_widget();
5038
5214
  init_lines_widget();
5039
5215
  init_model_widget();
5216
+ init_sysmon_widget();
5040
5217
  init_demo_data();
5041
5218
  }
5042
5219
  });
@@ -7827,24 +8004,7 @@ __export(select_with_preview_exports, {
7827
8004
  async function generatePreviews(choices, style, themeName) {
7828
8005
  const previews = [];
7829
8006
  const isStyleSelection = choices.length >= 3 && choices.every((c) => isQuickConfigStyle(c.value));
7830
- const availableThemes = [
7831
- "catppuccin-mocha",
7832
- // AVAILABLE_THEMES[0]
7833
- "cyberpunk-neon",
7834
- // AVAILABLE_THEMES[1]
7835
- "dracula",
7836
- // AVAILABLE_THEMES[2]
7837
- "dusty-sage",
7838
- // AVAILABLE_THEMES[3]
7839
- "github-dark-dimmed",
7840
- // AVAILABLE_THEMES[4]
7841
- "gray",
7842
- // AVAILABLE_THEMES[5] - was missing!
7843
- "monokai",
7844
- // AVAILABLE_THEMES[6]
7845
- "muted-gray"
7846
- // AVAILABLE_THEMES[7] - was missing!
7847
- ];
8007
+ const availableThemes = AVAILABLE_THEMES.slice(0, 8).map((t) => t.name);
7848
8008
  const isThemeSelection = choices.some((c) => isThemeName(c.value, availableThemes));
7849
8009
  for (const choice of choices) {
7850
8010
  try {
@@ -7929,6 +8089,7 @@ var init_select_with_preview = __esm({
7929
8089
  "src/cli/commands/quick-config/select-with-preview.ts"() {
7930
8090
  "use strict";
7931
8091
  init_esm3();
8092
+ init_theme();
7932
8093
  init_layout_preview();
7933
8094
  selectWithPreview = createPrompt(selectWithPreviewImpl);
7934
8095
  }
@@ -26020,7 +26181,7 @@ function generateBalancedLayout(style, themeName) {
26020
26181
  {
26021
26182
  id: "git-tag",
26022
26183
  style,
26023
- colors: { base: theme.base.text }
26184
+ colors: { branch: theme.git.branch, changes: theme.git.changes }
26024
26185
  },
26025
26186
  {
26026
26187
  id: "cache-metrics",
@@ -26036,7 +26197,7 @@ function generateBalancedLayout(style, themeName) {
26036
26197
  {
26037
26198
  id: "config-count",
26038
26199
  style,
26039
- colors: { base: theme.base.muted }
26200
+ colors: { label: theme.configCount.label, separator: theme.configCount.separator }
26040
26201
  }
26041
26202
  ]
26042
26203
  }
@@ -26130,7 +26291,7 @@ function generateRichLayout(style, themeName) {
26130
26291
  {
26131
26292
  id: "git-tag",
26132
26293
  style,
26133
- colors: { base: theme.base.text }
26294
+ colors: { branch: theme.git.branch, changes: theme.git.changes }
26134
26295
  },
26135
26296
  {
26136
26297
  id: "cache-metrics",
@@ -26146,7 +26307,7 @@ function generateRichLayout(style, themeName) {
26146
26307
  {
26147
26308
  id: "config-count",
26148
26309
  style,
26149
- colors: { base: theme.base.muted }
26310
+ colors: { label: theme.configCount.label, separator: theme.configCount.separator }
26150
26311
  }
26151
26312
  ],
26152
26313
  "2": [
@@ -26262,7 +26423,7 @@ async function selectLayout() {
26262
26423
  },
26263
26424
  {
26264
26425
  name: "Rich",
26265
- description: "3 lines: + Dev Server|Docker|Active Tools on line 3",
26426
+ description: "5 lines: Core metrics + Git/Cache + Dev/Docker/Tools + Sysmon",
26266
26427
  value: "rich",
26267
26428
  getConfig: (s, t) => generateRichLayout(s, t)
26268
26429
  }
@@ -26501,119 +26662,7 @@ init_git_tag_widget();
26501
26662
  init_git_widget();
26502
26663
  init_lines_widget();
26503
26664
  init_model_widget();
26504
-
26505
- // src/widgets/sysmon-widget.ts
26506
- init_style_types();
26507
- init_widget_types();
26508
- init_theme();
26509
-
26510
- // src/widgets/sysmon/styles.ts
26511
- init_colors();
26512
- function formatGB(gb) {
26513
- if (gb < 1) {
26514
- return `${Math.round(gb * 1024)}MB`;
26515
- }
26516
- const formatted = gb.toFixed(1);
26517
- return formatted.endsWith(".0") ? `${formatted.slice(0, -2)}GB` : `${formatted}GB`;
26518
- }
26519
- function formatMB(mb) {
26520
- if (mb < 0.1) {
26521
- const kb = mb * 1024;
26522
- const formatted2 = kb.toFixed(1);
26523
- return formatted2.endsWith(".0") ? `${formatted2.slice(0, -2)}KB` : `${formatted2}KB`;
26524
- }
26525
- const formatted = mb.toFixed(1);
26526
- return formatted.endsWith(".0") ? `${formatted.slice(0, -2)}MB` : `${formatted}MB`;
26527
- }
26528
- var sysmonStyles = {
26529
- balanced: (data, colors2) => {
26530
- const cpu = colors2 ? colorize(`CPU ${data.cpu.percent}%`, colors2.cpu) : `CPU ${data.cpu.percent}%`;
26531
- const ram = colors2 ? colorize(`RAM ${formatGB(data.memory.used)}`, colors2.ram) : `RAM ${formatGB(data.memory.used)}`;
26532
- const disk = colors2 ? colorize(`Disk ${data.disk.percent}%`, colors2.disk) : `Disk ${data.disk.percent}%`;
26533
- const net = colors2 ? colorize(`Net \u2193${formatMB(data.network.rxSec)}/s`, colors2.network) : `Net \u2193${formatMB(data.network.rxSec)}/s`;
26534
- const sep = colors2 ? colorize("|", colors2.separator) : "|";
26535
- return `${cpu} ${sep} ${ram} ${sep} ${disk} ${sep} ${net}`;
26536
- },
26537
- compact: (data, colors2) => {
26538
- const cpu = colors2 ? colorize(`CPU${data.cpu.percent}%`, colors2.cpu) : `CPU${data.cpu.percent}%`;
26539
- const ram = colors2 ? colorize(`RAM${formatGB(data.memory.used)}`, colors2.ram) : `RAM${formatGB(data.memory.used)}`;
26540
- const disk = colors2 ? colorize(`D${data.disk.percent}%`, colors2.disk) : `D${data.disk.percent}%`;
26541
- const net = colors2 ? colorize(`\u2193${formatMB(data.network.rxSec)}/s`, colors2.network) : `\u2193${formatMB(data.network.rxSec)}/s`;
26542
- return `${cpu} ${ram} ${disk} ${net}`;
26543
- },
26544
- playful: (data, colors2) => {
26545
- const cpu = colors2 ? colorize(`${data.cpu.percent}%`, colors2.cpu) : `${data.cpu.percent}%`;
26546
- const ram = colors2 ? colorize(formatGB(data.memory.used), colors2.ram) : formatGB(data.memory.used);
26547
- const disk = colors2 ? colorize(`${data.disk.percent}%`, colors2.disk) : `${data.disk.percent}%`;
26548
- const net = colors2 ? colorize(`\u2193${formatMB(data.network.rxSec)}/s`, colors2.network) : `\u2193${formatMB(data.network.rxSec)}/s`;
26549
- const sep = colors2 ? colorize("|", colors2.separator) : "|";
26550
- return `\u{1F5A5}\uFE0F ${cpu} ${sep} \u{1F4BE} ${ram} ${sep} \u{1F4BF} ${disk} ${sep} \u{1F310} ${net}`;
26551
- },
26552
- verbose: (data, colors2) => {
26553
- const cpu = colors2 ? colorize(`CPU: ${data.cpu.percent}%`, colors2.cpu) : `CPU: ${data.cpu.percent}%`;
26554
- const ram = colors2 ? colorize(`RAM: ${formatGB(data.memory.used)}/${formatGB(data.memory.total)}`, colors2.ram) : `RAM: ${formatGB(data.memory.used)}/${formatGB(data.memory.total)}`;
26555
- const disk = colors2 ? colorize(`Disk: ${formatGB(data.disk.used)}/${formatGB(data.disk.total)}`, colors2.disk) : `Disk: ${formatGB(data.disk.used)}/${formatGB(data.disk.total)}`;
26556
- const net = colors2 ? colorize(
26557
- `Net: \u2193${formatMB(data.network.rxSec)}/s \u2191${formatMB(data.network.txSec)}/s`,
26558
- colors2.network
26559
- ) : `Net: \u2193${formatMB(data.network.rxSec)}/s \u2191${formatMB(data.network.txSec)}/s`;
26560
- return `${cpu} | ${ram} | ${disk} | ${net}`;
26561
- }
26562
- };
26563
-
26564
- // src/widgets/sysmon-widget.ts
26565
- var SysmonWidget = class {
26566
- id = "sysmon";
26567
- metadata = createWidgetMetadata(
26568
- "Sysmon",
26569
- "System monitoring: CPU, RAM, Disk, Network metrics",
26570
- "1.0.0",
26571
- "claude-scope",
26572
- 2
26573
- // Default to line 2
26574
- );
26575
- colors;
26576
- provider;
26577
- styleFn = sysmonStyles.balanced;
26578
- enabled = true;
26579
- _lineOverride;
26580
- constructor(colors2, provider) {
26581
- this.colors = colors2 ?? DEFAULT_THEME;
26582
- this.provider = provider ?? null;
26583
- }
26584
- async initialize(context) {
26585
- this.enabled = context.config?.enabled !== false;
26586
- }
26587
- async render(_context) {
26588
- if (!this.provider || !this.isEnabled()) {
26589
- return null;
26590
- }
26591
- const metrics = await this.provider.getMetrics();
26592
- if (!metrics) {
26593
- return null;
26594
- }
26595
- return this.styleFn(metrics, this.colors.sysmon);
26596
- }
26597
- async update(_data) {
26598
- }
26599
- isEnabled() {
26600
- return this.enabled && this.provider !== null;
26601
- }
26602
- setStyle(style = DEFAULT_WIDGET_STYLE) {
26603
- const fn = sysmonStyles[style];
26604
- if (fn) {
26605
- this.styleFn = fn;
26606
- }
26607
- }
26608
- setLine(line) {
26609
- this._lineOverride = line;
26610
- }
26611
- getLine() {
26612
- return this._lineOverride ?? this.metadata.line ?? 0;
26613
- }
26614
- };
26615
-
26616
- // src/cli/commands/quick-config/preview.ts
26665
+ init_sysmon_widget();
26617
26666
  init_demo_data();
26618
26667
 
26619
26668
  // src/cli/commands/quick-config/index.ts
@@ -26666,7 +26715,7 @@ async function ensureDefaultConfig() {
26666
26715
  if (!(0, import_node_fs3.existsSync)(configDir)) {
26667
26716
  (0, import_node_fs3.mkdirSync)(configDir, { recursive: true });
26668
26717
  }
26669
- const defaultConfig = generateRichLayout("balanced", "dracula");
26718
+ const defaultConfig = generateRichLayout("balanced", "monokai");
26670
26719
  (0, import_node_fs3.writeFileSync)(configPath, JSON.stringify(defaultConfig, null, 2), "utf-8");
26671
26720
  }
26672
26721
 
@@ -26909,36 +26958,7 @@ init_docker_widget();
26909
26958
 
26910
26959
  // src/core/widget-factory.ts
26911
26960
  init_duration_widget();
26912
-
26913
- // src/widgets/empty-line-widget.ts
26914
- init_widget_types();
26915
- init_stdin_data_widget();
26916
- var EmptyLineWidget = class extends StdinDataWidget {
26917
- id = "empty-line";
26918
- metadata = createWidgetMetadata(
26919
- "Empty Line",
26920
- "Empty line separator",
26921
- "1.0.0",
26922
- "claude-scope",
26923
- 5
26924
- // Sixth line (0-indexed)
26925
- );
26926
- /**
26927
- * All styles return the same value (Braille Pattern Blank).
26928
- * This method exists for API consistency with other widgets.
26929
- */
26930
- setStyle(_style) {
26931
- }
26932
- /**
26933
- * Return Braille Pattern Blank to create a visible empty separator line.
26934
- * U+2800 occupies cell width but appears blank, ensuring the line renders.
26935
- */
26936
- renderWithData(_data, _context) {
26937
- return "\u2800";
26938
- }
26939
- };
26940
-
26941
- // src/core/widget-factory.ts
26961
+ init_empty_line_widget();
26942
26962
  init_git_tag_widget();
26943
26963
  init_git_widget();
26944
26964
  init_lines_widget();
@@ -27590,12 +27610,18 @@ var PokerWidget = class extends StdinDataWidget {
27590
27610
  };
27591
27611
 
27592
27612
  // src/core/widget-factory.ts
27613
+ init_sysmon_widget();
27593
27614
  var WidgetFactory = class {
27594
27615
  transcriptProvider;
27595
27616
  systemProvider;
27596
- constructor() {
27617
+ theme;
27618
+ /**
27619
+ * @param theme - Optional theme colors. Defaults to DEFAULT_THEME (Monokai).
27620
+ */
27621
+ constructor(theme) {
27597
27622
  this.transcriptProvider = new TranscriptProvider();
27598
27623
  this.systemProvider = new SystemProvider();
27624
+ this.theme = theme ?? DEFAULT_THEME;
27599
27625
  }
27600
27626
  /**
27601
27627
  * Create a widget instance by ID
@@ -27605,33 +27631,33 @@ var WidgetFactory = class {
27605
27631
  createWidget(widgetId) {
27606
27632
  switch (widgetId) {
27607
27633
  case "model":
27608
- return new ModelWidget();
27634
+ return new ModelWidget(this.theme);
27609
27635
  case "context":
27610
- return new ContextWidget();
27636
+ return new ContextWidget(this.theme);
27611
27637
  case "cost":
27612
- return new CostWidget();
27638
+ return new CostWidget(this.theme);
27613
27639
  case "lines":
27614
- return new LinesWidget();
27640
+ return new LinesWidget(this.theme);
27615
27641
  case "duration":
27616
- return new DurationWidget();
27642
+ return new DurationWidget(this.theme);
27617
27643
  case "git":
27618
- return new GitWidget();
27644
+ return new GitWidget(void 0, this.theme);
27619
27645
  case "git-tag":
27620
- return new GitTagWidget();
27646
+ return new GitTagWidget(void 0, this.theme);
27621
27647
  case "config-count":
27622
- return new ConfigCountWidget();
27648
+ return new ConfigCountWidget(void 0, this.theme);
27623
27649
  case "cache-metrics":
27624
- return new CacheMetricsWidget(DEFAULT_THEME);
27650
+ return new CacheMetricsWidget(this.theme);
27625
27651
  case "active-tools":
27626
- return new ActiveToolsWidget(DEFAULT_THEME, this.transcriptProvider);
27652
+ return new ActiveToolsWidget(this.theme, this.transcriptProvider);
27627
27653
  case "dev-server":
27628
- return new DevServerWidget(DEFAULT_THEME);
27654
+ return new DevServerWidget(this.theme);
27629
27655
  case "docker":
27630
- return new DockerWidget(DEFAULT_THEME);
27656
+ return new DockerWidget(this.theme);
27631
27657
  case "poker":
27632
- return new PokerWidget(DEFAULT_THEME);
27658
+ return new PokerWidget(this.theme);
27633
27659
  case "sysmon":
27634
- return new SysmonWidget(DEFAULT_THEME, this.systemProvider);
27660
+ return new SysmonWidget(this.theme, this.systemProvider);
27635
27661
  case "empty-line":
27636
27662
  return new EmptyLineWidget();
27637
27663
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-scope",
3
- "version": "0.8.45",
3
+ "version": "0.8.47",
4
4
  "description": "Claude Code plugin for session status and analytics",
5
5
  "license": "MIT",
6
6
  "type": "module",