claude-scope 0.8.8 → 0.8.11

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 +600 -18
  2. package/package.json +1 -1
@@ -127,6 +127,17 @@ function createThemeColors(params) {
127
127
  name: params.toolsName,
128
128
  target: params.toolsTarget,
129
129
  count: params.toolsCount
130
+ },
131
+ devServer: {
132
+ name: params.devServerName ?? params.model,
133
+ status: params.devServerStatus ?? params.contextLow,
134
+ label: params.devServerLabel ?? params.duration
135
+ },
136
+ docker: {
137
+ label: params.dockerLabel ?? params.duration,
138
+ count: params.dockerCount ?? params.model,
139
+ running: params.dockerRunning ?? params.contextLow,
140
+ stopped: params.dockerStopped ?? params.contextHigh
130
141
  }
131
142
  };
132
143
  }
@@ -168,7 +179,14 @@ var init_gray_theme = __esm({
168
179
  toolsError: gray,
169
180
  toolsName: gray,
170
181
  toolsTarget: gray,
171
- toolsCount: gray
182
+ toolsCount: gray,
183
+ devServerName: gray,
184
+ devServerStatus: gray,
185
+ devServerLabel: gray,
186
+ dockerLabel: gray,
187
+ dockerCount: gray,
188
+ dockerRunning: gray,
189
+ dockerStopped: gray
172
190
  })
173
191
  };
174
192
  }
@@ -226,8 +244,22 @@ var init_catppuccin_mocha_theme = __esm({
226
244
  // Blue
227
245
  toolsTarget: rgb(147, 153, 178),
228
246
  // Gray
229
- toolsCount: rgb(203, 166, 247)
247
+ toolsCount: rgb(203, 166, 247),
248
+ // Mauve
249
+ devServerName: rgb(166, 227, 161),
250
+ // Green
251
+ devServerStatus: rgb(238, 212, 159),
252
+ // Yellow
253
+ devServerLabel: rgb(137, 180, 250),
254
+ // Blue
255
+ dockerLabel: rgb(137, 180, 250),
256
+ // Blue
257
+ dockerCount: rgb(203, 166, 247),
230
258
  // Mauve
259
+ dockerRunning: rgb(166, 227, 161),
260
+ // Green
261
+ dockerStopped: rgb(243, 139, 168)
262
+ // Red
231
263
  })
232
264
  };
233
265
  }
@@ -285,8 +317,22 @@ var init_cyberpunk_neon_theme = __esm({
285
317
  // Cyan neon
286
318
  toolsTarget: rgb(140, 27, 255),
287
319
  // Purple neon
288
- toolsCount: rgb(255, 111, 97)
320
+ toolsCount: rgb(255, 111, 97),
289
321
  // Orange neon
322
+ devServerName: rgb(0, 255, 122),
323
+ // Green neon
324
+ devServerStatus: rgb(255, 214, 0),
325
+ // Yellow neon
326
+ devServerLabel: rgb(0, 191, 255),
327
+ // Cyan neon
328
+ dockerLabel: rgb(0, 191, 255),
329
+ // Cyan neon
330
+ dockerCount: rgb(140, 27, 255),
331
+ // Purple neon
332
+ dockerRunning: rgb(0, 255, 122),
333
+ // Green neon
334
+ dockerStopped: rgb(255, 0, 122)
335
+ // Magenta neon
290
336
  })
291
337
  };
292
338
  }
@@ -344,8 +390,22 @@ var init_dracula_theme = __esm({
344
390
  // Cyan
345
391
  toolsTarget: rgb(98, 114, 164),
346
392
  // Gray
347
- toolsCount: rgb(189, 147, 249)
393
+ toolsCount: rgb(189, 147, 249),
348
394
  // Purple
395
+ devServerName: rgb(80, 250, 123),
396
+ // Green
397
+ devServerStatus: rgb(241, 250, 140),
398
+ // Yellow
399
+ devServerLabel: rgb(139, 233, 253),
400
+ // Cyan
401
+ dockerLabel: rgb(139, 233, 253),
402
+ // Cyan
403
+ dockerCount: rgb(189, 147, 249),
404
+ // Purple
405
+ dockerRunning: rgb(80, 250, 123),
406
+ // Green
407
+ dockerStopped: rgb(255, 85, 85)
408
+ // Red
349
409
  })
350
410
  };
351
411
  }
@@ -392,8 +452,22 @@ var init_dusty_sage_theme = __esm({
392
452
  // Dusty green
393
453
  toolsTarget: rgb(148, 163, 184),
394
454
  // Gray
395
- toolsCount: rgb(156, 163, 175)
455
+ toolsCount: rgb(156, 163, 175),
396
456
  // Light gray
457
+ devServerName: rgb(135, 145, 140),
458
+ // Subtle sage
459
+ devServerStatus: rgb(150, 160, 145),
460
+ // Medium sage
461
+ devServerLabel: rgb(120, 140, 130),
462
+ // Dusty green
463
+ dockerLabel: rgb(120, 140, 130),
464
+ // Dusty green
465
+ dockerCount: rgb(148, 163, 184),
466
+ // Gray
467
+ dockerRunning: rgb(135, 145, 140),
468
+ // Subtle sage
469
+ dockerStopped: rgb(165, 175, 160)
470
+ // Light sage
397
471
  })
398
472
  };
399
473
  }
@@ -451,8 +525,22 @@ var init_github_dark_dimmed_theme = __esm({
451
525
  // GitHub blue
452
526
  toolsTarget: rgb(201, 209, 217),
453
527
  // Gray
454
- toolsCount: rgb(163, 113, 247)
528
+ toolsCount: rgb(163, 113, 247),
455
529
  // Purple
530
+ devServerName: rgb(35, 134, 54),
531
+ // GitHub green
532
+ devServerStatus: rgb(210, 153, 34),
533
+ // GitHub orange
534
+ devServerLabel: rgb(88, 166, 255),
535
+ // GitHub blue
536
+ dockerLabel: rgb(88, 166, 255),
537
+ // GitHub blue
538
+ dockerCount: rgb(163, 113, 247),
539
+ // Purple
540
+ dockerRunning: rgb(35, 134, 54),
541
+ // GitHub green
542
+ dockerStopped: rgb(248, 81, 73)
543
+ // GitHub red
456
544
  })
457
545
  };
458
546
  }
@@ -510,8 +598,22 @@ var init_monokai_theme = __esm({
510
598
  // Cyan
511
599
  toolsTarget: rgb(174, 129, 255),
512
600
  // Purple
513
- toolsCount: rgb(254, 128, 25)
601
+ toolsCount: rgb(254, 128, 25),
514
602
  // Bright orange
603
+ devServerName: rgb(166, 226, 46),
604
+ // Green
605
+ devServerStatus: rgb(253, 151, 31),
606
+ // Orange
607
+ devServerLabel: rgb(102, 217, 239),
608
+ // Cyan
609
+ dockerLabel: rgb(102, 217, 239),
610
+ // Cyan
611
+ dockerCount: rgb(174, 129, 255),
612
+ // Purple
613
+ dockerRunning: rgb(166, 226, 46),
614
+ // Green
615
+ dockerStopped: rgb(174, 129, 255)
616
+ // Purple
515
617
  })
516
618
  };
517
619
  }
@@ -558,8 +660,22 @@ var init_muted_gray_theme = __esm({
558
660
  // Slate gray
559
661
  toolsTarget: rgb(148, 163, 184),
560
662
  // Lighter slate
561
- toolsCount: rgb(156, 163, 175)
663
+ toolsCount: rgb(156, 163, 175),
664
+ // Slate gray
665
+ devServerName: rgb(148, 163, 184),
666
+ // Subtle gray
667
+ devServerStatus: rgb(160, 174, 192),
668
+ // Medium gray
669
+ devServerLabel: rgb(156, 163, 175),
670
+ // Slate gray
671
+ dockerLabel: rgb(156, 163, 175),
562
672
  // Slate gray
673
+ dockerCount: rgb(148, 163, 184),
674
+ // Lighter slate
675
+ dockerRunning: rgb(148, 163, 184),
676
+ // Subtle gray
677
+ dockerStopped: rgb(175, 188, 201)
678
+ // Light gray
563
679
  })
564
680
  };
565
681
  }
@@ -617,8 +733,22 @@ var init_nord_theme = __esm({
617
733
  // Nordic cyan
618
734
  toolsTarget: rgb(129, 161, 193),
619
735
  // Nordic blue
620
- toolsCount: rgb(216, 222, 233)
736
+ toolsCount: rgb(216, 222, 233),
621
737
  // Nordic white
738
+ devServerName: rgb(163, 190, 140),
739
+ // Nordic green
740
+ devServerStatus: rgb(235, 203, 139),
741
+ // Nordic yellow
742
+ devServerLabel: rgb(136, 192, 208),
743
+ // Nordic cyan
744
+ dockerLabel: rgb(136, 192, 208),
745
+ // Nordic cyan
746
+ dockerCount: rgb(216, 222, 233),
747
+ // Nordic white
748
+ dockerRunning: rgb(163, 190, 140),
749
+ // Nordic green
750
+ dockerStopped: rgb(191, 97, 106)
751
+ // Nordic red
622
752
  })
623
753
  };
624
754
  }
@@ -676,8 +806,22 @@ var init_one_dark_pro_theme = __esm({
676
806
  // Blue
677
807
  toolsTarget: rgb(171, 178, 191),
678
808
  // Gray
679
- toolsCount: rgb(209, 154, 102)
809
+ toolsCount: rgb(209, 154, 102),
680
810
  // Orange
811
+ devServerName: rgb(152, 195, 121),
812
+ // Green
813
+ devServerStatus: rgb(229, 192, 123),
814
+ // Yellow
815
+ devServerLabel: rgb(97, 175, 239),
816
+ // Blue
817
+ dockerLabel: rgb(97, 175, 239),
818
+ // Blue
819
+ dockerCount: rgb(209, 154, 102),
820
+ // Orange
821
+ dockerRunning: rgb(152, 195, 121),
822
+ // Green
823
+ dockerStopped: rgb(224, 108, 117)
824
+ // Red
681
825
  })
682
826
  };
683
827
  }
@@ -735,8 +879,22 @@ var init_professional_blue_theme = __esm({
735
879
  // Royal blue
736
880
  toolsTarget: rgb(148, 163, 184),
737
881
  // Slate gray
738
- toolsCount: rgb(167, 139, 250)
882
+ toolsCount: rgb(167, 139, 250),
883
+ // Purple
884
+ devServerName: rgb(74, 222, 128),
885
+ // Green
886
+ devServerStatus: rgb(251, 191, 36),
887
+ // Amber
888
+ devServerLabel: rgb(37, 99, 235),
889
+ // Royal blue
890
+ dockerLabel: rgb(37, 99, 235),
891
+ // Royal blue
892
+ dockerCount: rgb(167, 139, 250),
739
893
  // Purple
894
+ dockerRunning: rgb(74, 222, 128),
895
+ // Green
896
+ dockerStopped: rgb(248, 113, 113)
897
+ // Red
740
898
  })
741
899
  };
742
900
  }
@@ -794,8 +952,22 @@ var init_rose_pine_theme = __esm({
794
952
  // Pine cyan
795
953
  toolsTarget: rgb(224, 208, 245),
796
954
  // Pine violet
797
- toolsCount: rgb(226, 185, 218)
955
+ toolsCount: rgb(226, 185, 218),
956
+ // Pine pink
957
+ devServerName: rgb(156, 207, 216),
958
+ // Pine cyan
959
+ devServerStatus: rgb(233, 201, 176),
960
+ // Pine beige
961
+ devServerLabel: rgb(156, 207, 216),
962
+ // Pine cyan
963
+ dockerLabel: rgb(156, 207, 216),
964
+ // Pine cyan
965
+ dockerCount: rgb(226, 185, 218),
798
966
  // Pine pink
967
+ dockerRunning: rgb(156, 207, 216),
968
+ // Pine cyan
969
+ dockerStopped: rgb(235, 111, 146)
970
+ // Pine red
799
971
  })
800
972
  };
801
973
  }
@@ -853,8 +1025,22 @@ var init_semantic_classic_theme = __esm({
853
1025
  // Blue
854
1026
  toolsTarget: rgb(107, 114, 128),
855
1027
  // Gray
856
- toolsCount: rgb(99, 102, 241)
1028
+ toolsCount: rgb(99, 102, 241),
857
1029
  // Indigo
1030
+ devServerName: rgb(34, 197, 94),
1031
+ // Green
1032
+ devServerStatus: rgb(234, 179, 8),
1033
+ // Yellow
1034
+ devServerLabel: rgb(59, 130, 246),
1035
+ // Blue
1036
+ dockerLabel: rgb(59, 130, 246),
1037
+ // Blue
1038
+ dockerCount: rgb(99, 102, 241),
1039
+ // Indigo
1040
+ dockerRunning: rgb(34, 197, 94),
1041
+ // Green
1042
+ dockerStopped: rgb(239, 68, 68)
1043
+ // Red
858
1044
  })
859
1045
  };
860
1046
  }
@@ -901,7 +1087,21 @@ var init_slate_blue_theme = __esm({
901
1087
  // Cool slate
902
1088
  toolsTarget: rgb(148, 163, 184),
903
1089
  // Neutral slate
904
- toolsCount: rgb(156, 163, 175)
1090
+ toolsCount: rgb(156, 163, 175),
1091
+ // Light slate
1092
+ devServerName: rgb(148, 163, 184),
1093
+ // Subtle slate-blue
1094
+ devServerStatus: rgb(160, 174, 192),
1095
+ // Medium slate
1096
+ devServerLabel: rgb(100, 116, 139),
1097
+ // Cool slate
1098
+ dockerLabel: rgb(100, 116, 139),
1099
+ // Cool slate
1100
+ dockerCount: rgb(148, 163, 184),
1101
+ // Neutral slate
1102
+ dockerRunning: rgb(148, 163, 184),
1103
+ // Subtle slate-blue
1104
+ dockerStopped: rgb(175, 188, 201)
905
1105
  // Light slate
906
1106
  })
907
1107
  };
@@ -960,8 +1160,22 @@ var init_solarized_dark_theme = __esm({
960
1160
  // Blue
961
1161
  toolsTarget: rgb(131, 148, 150),
962
1162
  // Base0
963
- toolsCount: rgb(203, 75, 22)
1163
+ toolsCount: rgb(203, 75, 22),
1164
+ // Orange
1165
+ devServerName: rgb(133, 153, 0),
1166
+ // Olive
1167
+ devServerStatus: rgb(181, 137, 0),
1168
+ // Yellow
1169
+ devServerLabel: rgb(38, 139, 210),
1170
+ // Blue
1171
+ dockerLabel: rgb(38, 139, 210),
1172
+ // Blue
1173
+ dockerCount: rgb(203, 75, 22),
964
1174
  // Orange
1175
+ dockerRunning: rgb(133, 153, 0),
1176
+ // Olive
1177
+ dockerStopped: rgb(220, 50, 47)
1178
+ // Red
965
1179
  })
966
1180
  };
967
1181
  }
@@ -1019,8 +1233,22 @@ var init_tokyo_night_theme = __esm({
1019
1233
  // Blue
1020
1234
  toolsTarget: rgb(169, 177, 214),
1021
1235
  // White-ish
1022
- toolsCount: rgb(158, 206, 209)
1236
+ toolsCount: rgb(158, 206, 209),
1023
1237
  // Teal
1238
+ devServerName: rgb(146, 180, 203),
1239
+ // Cyan
1240
+ devServerStatus: rgb(232, 166, 162),
1241
+ // Pink-red
1242
+ devServerLabel: rgb(122, 132, 173),
1243
+ // Blue
1244
+ dockerLabel: rgb(122, 132, 173),
1245
+ // Blue
1246
+ dockerCount: rgb(158, 206, 209),
1247
+ // Teal
1248
+ dockerRunning: rgb(146, 180, 203),
1249
+ // Cyan
1250
+ dockerStopped: rgb(249, 86, 119)
1251
+ // Red
1024
1252
  })
1025
1253
  };
1026
1254
  }
@@ -1078,8 +1306,22 @@ var init_vscode_dark_plus_theme = __esm({
1078
1306
  // Blue
1079
1307
  toolsTarget: rgb(156, 163, 175),
1080
1308
  // Gray
1081
- toolsCount: rgb(167, 139, 250)
1309
+ toolsCount: rgb(167, 139, 250),
1082
1310
  // Purple
1311
+ devServerName: rgb(74, 222, 128),
1312
+ // Green
1313
+ devServerStatus: rgb(251, 191, 36),
1314
+ // Yellow
1315
+ devServerLabel: rgb(125, 148, 173),
1316
+ // Dark gray
1317
+ dockerLabel: rgb(125, 148, 173),
1318
+ // Dark gray
1319
+ dockerCount: rgb(96, 165, 250),
1320
+ // Blue
1321
+ dockerRunning: rgb(74, 222, 128),
1322
+ // Green
1323
+ dockerStopped: rgb(171, 178, 191)
1324
+ // Gray
1083
1325
  })
1084
1326
  };
1085
1327
  }
@@ -1618,6 +1860,17 @@ function getDefaultColors() {
1618
1860
  name: "\x1B[34m",
1619
1861
  target: "\x1B[90m",
1620
1862
  count: "\x1B[35m"
1863
+ },
1864
+ devServer: {
1865
+ name: "\x1B[36m",
1866
+ status: "\x1B[32m",
1867
+ label: "\x1B[90m"
1868
+ },
1869
+ docker: {
1870
+ label: "\x1B[90m",
1871
+ count: "\x1B[37m",
1872
+ running: "\x1B[32m",
1873
+ stopped: "\x1B[31m"
1621
1874
  }
1622
1875
  };
1623
1876
  }
@@ -7326,6 +7579,329 @@ init_cache_metrics();
7326
7579
  init_config_count_widget();
7327
7580
  init_context_widget();
7328
7581
  init_cost_widget();
7582
+
7583
+ // src/widgets/dev-server/dev-server-widget.ts
7584
+ var import_node_child_process2 = require("node:child_process");
7585
+ var import_node_util3 = require("node:util");
7586
+ init_widget_types();
7587
+ init_theme();
7588
+
7589
+ // src/widgets/dev-server/styles.ts
7590
+ init_colors();
7591
+ var devServerStyles = {
7592
+ balanced: (data, colors2) => {
7593
+ if (!data.server) return "";
7594
+ const { name, icon, isRunning, isBuilding } = data.server;
7595
+ const status = isRunning ? "running" : isBuilding ? "building" : "stopped";
7596
+ const coloredName = colors2 ? colorize(name, colors2.name) : name;
7597
+ const coloredStatus = colors2 ? colorize(`(${status})`, colors2.status) : `(${status})`;
7598
+ return `${icon} ${coloredName} ${coloredStatus}`;
7599
+ },
7600
+ compact: (data, colors2) => {
7601
+ if (!data.server) return "";
7602
+ const { name, icon, isRunning, isBuilding } = data.server;
7603
+ const statusIcon = isRunning ? "\u{1F680}" : isBuilding ? "\u{1F528}" : "\u{1F4A4}";
7604
+ const coloredName = colors2 ? colorize(name, colors2.name) : name;
7605
+ return `${icon} ${coloredName} ${statusIcon}`;
7606
+ },
7607
+ playful: (data, colors2) => {
7608
+ if (!data.server) return "";
7609
+ const { name, isRunning, isBuilding } = data.server;
7610
+ const emoji = isRunning ? "\u{1F3C3}" : isBuilding ? "\u{1F528}" : "\u{1F4A4}";
7611
+ const coloredName = colors2 ? colorize(name, colors2.name) : name;
7612
+ return `${emoji} ${coloredName}`;
7613
+ },
7614
+ verbose: (data, colors2) => {
7615
+ if (!data.server) return "";
7616
+ const { name, isRunning, isBuilding } = data.server;
7617
+ const status = isRunning ? "running" : isBuilding ? "building" : "stopped";
7618
+ const label = colors2 ? colorize("Dev Server:", colors2.label) : "Dev Server:";
7619
+ const coloredName = colors2 ? colorize(name, colors2.name) : name;
7620
+ const coloredStatus = colors2 ? colorize(`(${status})`, colors2.status) : `(${status})`;
7621
+ return `${label} ${coloredName} ${coloredStatus}`;
7622
+ },
7623
+ labeled: (data, colors2) => {
7624
+ if (!data.server) return "";
7625
+ const { name, icon, isRunning } = data.server;
7626
+ const status = isRunning ? "\u{1F7E2}" : "\u{1F534}";
7627
+ const label = colors2 ? colorize("Server:", colors2.label) : "Server:";
7628
+ const coloredName = colors2 ? colorize(name, colors2.name) : name;
7629
+ return `${label} ${icon} ${coloredName} ${status}`;
7630
+ },
7631
+ indicator: (data, colors2) => {
7632
+ if (!data.server) return "";
7633
+ const { name, icon } = data.server;
7634
+ const coloredName = colors2 ? colorize(name, colors2.name) : name;
7635
+ return `\u25CF ${icon} ${coloredName}`;
7636
+ }
7637
+ };
7638
+
7639
+ // src/widgets/dev-server/dev-server-widget.ts
7640
+ var execFileAsync2 = (0, import_node_util3.promisify)(import_node_child_process2.execFile);
7641
+ var DevServerWidget = class {
7642
+ id = "dev-server";
7643
+ metadata = createWidgetMetadata(
7644
+ "Dev Server",
7645
+ "Detects running dev server processes",
7646
+ "1.0.0",
7647
+ "claude-scope",
7648
+ 0
7649
+ );
7650
+ enabled = true;
7651
+ colors;
7652
+ _lineOverride;
7653
+ styleFn = devServerStyles.balanced;
7654
+ cwd = null;
7655
+ processPatterns = [
7656
+ { regex: /nuxt.*dev/i, name: "Nuxt", icon: "\u26A1" },
7657
+ { regex: /next.*dev/i, name: "Next.js", icon: "\u25B2" },
7658
+ { regex: /vite.*dev/i, name: "Vite", icon: "\u26A1" },
7659
+ { regex: /svelte.*dev/i, name: "Svelte", icon: "\u{1F525}" },
7660
+ { regex: /astro.*dev/i, name: "Astro", icon: "\u{1F680}" },
7661
+ { regex: /remix.*dev/i, name: "Remix", icon: "\u{1F4BF}" },
7662
+ { regex: /(npm|yarn|pnpm|bun).*run\s+dev/i, name: "Dev", icon: "\u{1F680}" },
7663
+ { regex: /(npm|yarn|pnpm|bun).*run\s+build/i, name: "Build", icon: "\u{1F528}" }
7664
+ ];
7665
+ constructor(colors2) {
7666
+ this.colors = colors2 ?? DEFAULT_THEME;
7667
+ }
7668
+ /**
7669
+ * Set display style
7670
+ * @param style - Style to use for rendering
7671
+ */
7672
+ setStyle(style = "balanced") {
7673
+ const fn = devServerStyles[style];
7674
+ if (fn) {
7675
+ this.styleFn = fn;
7676
+ }
7677
+ }
7678
+ /**
7679
+ * Set display line override
7680
+ * @param line - Line number (0-indexed)
7681
+ */
7682
+ setLine(line) {
7683
+ this._lineOverride = line;
7684
+ }
7685
+ /**
7686
+ * Get display line
7687
+ * @returns Line number (0-indexed)
7688
+ */
7689
+ getLine() {
7690
+ return this._lineOverride ?? this.metadata.line ?? 0;
7691
+ }
7692
+ /**
7693
+ * Initialize widget with context
7694
+ * @param context - Widget initialization context
7695
+ */
7696
+ async initialize(context) {
7697
+ this.enabled = context.config?.enabled !== false;
7698
+ }
7699
+ /**
7700
+ * Update widget with new stdin data
7701
+ * @param data - Stdin data from Claude Code
7702
+ */
7703
+ async update(data) {
7704
+ this.cwd = data.cwd;
7705
+ }
7706
+ /**
7707
+ * Check if widget is enabled
7708
+ * @returns true if widget should render
7709
+ */
7710
+ isEnabled() {
7711
+ return this.enabled;
7712
+ }
7713
+ /**
7714
+ * Cleanup resources
7715
+ */
7716
+ async cleanup() {
7717
+ }
7718
+ /**
7719
+ * Render widget output
7720
+ * @param context - Render context
7721
+ * @returns Rendered string, or null if no dev server detected
7722
+ */
7723
+ async render(_context) {
7724
+ if (!this.enabled || !this.cwd) {
7725
+ return null;
7726
+ }
7727
+ const server = await this.detectDevServer();
7728
+ if (!server) {
7729
+ return null;
7730
+ }
7731
+ const renderData = { server };
7732
+ return this.styleFn(renderData, this.colors.devServer);
7733
+ }
7734
+ /**
7735
+ * Detect running dev server by parsing system process list
7736
+ * @returns Detected server status or null
7737
+ */
7738
+ async detectDevServer() {
7739
+ try {
7740
+ const { stdout } = await execFileAsync2("ps", ["-aux"], {
7741
+ timeout: 1e3
7742
+ });
7743
+ for (const pattern of this.processPatterns) {
7744
+ if (pattern.regex.test(stdout)) {
7745
+ return {
7746
+ name: pattern.name,
7747
+ icon: pattern.icon,
7748
+ isRunning: /dev/i.test(stdout),
7749
+ isBuilding: /build/i.test(stdout)
7750
+ };
7751
+ }
7752
+ }
7753
+ } catch {
7754
+ }
7755
+ return null;
7756
+ }
7757
+ };
7758
+
7759
+ // src/widgets/docker/docker-widget.ts
7760
+ var import_node_child_process3 = require("node:child_process");
7761
+ var import_node_util4 = require("node:util");
7762
+ init_widget_types();
7763
+ init_theme();
7764
+
7765
+ // src/widgets/docker/styles.ts
7766
+ init_colors();
7767
+ var dockerStyles = {
7768
+ balanced: (data, colors2) => {
7769
+ const { running, total } = data.status;
7770
+ if (running === 0) return "";
7771
+ const status = running > 0 ? "\u{1F7E2}" : "\u26AA";
7772
+ const count = total > running ? `${running}/${total}` : `${running}`;
7773
+ const label = colors2 ? colorize("Docker:", colors2.label) : "Docker:";
7774
+ const coloredCount = colors2 ? colorize(count, colors2.count) : count;
7775
+ return `${label} ${coloredCount} ${status}`;
7776
+ },
7777
+ compact: (data, colors2) => {
7778
+ const { running, total } = data.status;
7779
+ if (running === 0) return "";
7780
+ const count = total > running ? `${running}/${total}` : `${running}`;
7781
+ const coloredCount = colors2 ? colorize(count, colors2.count) : count;
7782
+ return `\u{1F433} ${coloredCount}`;
7783
+ },
7784
+ playful: (data, colors2) => {
7785
+ const { running, total } = data.status;
7786
+ if (running === 0) return "\u{1F433} Docker: \u{1F4A4}";
7787
+ const status = running > 0 ? "\u{1F7E2}" : "\u26AA";
7788
+ const count = total > running ? `${running}/${total}` : `${running}`;
7789
+ const label = colors2 ? colorize("Docker:", colors2.label) : "Docker:";
7790
+ const coloredCount = colors2 ? colorize(count, colors2.count) : count;
7791
+ return `\u{1F433} ${label} ${coloredCount} ${status}`;
7792
+ },
7793
+ verbose: (data, colors2) => {
7794
+ const { running, total } = data.status;
7795
+ if (running === 0) {
7796
+ const label2 = colors2 ? colorize("Docker:", colors2.label) : "Docker:";
7797
+ return `${label2} no containers running`;
7798
+ }
7799
+ const label = colors2 ? colorize("Docker:", colors2.label) : "Docker:";
7800
+ const coloredRunning = colors2 ? colorize(String(running), colors2.count) : String(running);
7801
+ return `${label} ${coloredRunning} running${total > running ? ` / ${total} total` : ""}`;
7802
+ },
7803
+ labeled: (data, colors2) => {
7804
+ const { running, total } = data.status;
7805
+ if (running === 0) {
7806
+ const label2 = colors2 ? colorize("Docker:", colors2.label) : "Docker:";
7807
+ return `${label2} --`;
7808
+ }
7809
+ const count = total > running ? `${running}/${total}` : `${running}`;
7810
+ const label = colors2 ? colorize("Docker:", colors2.label) : "Docker:";
7811
+ const coloredCount = colors2 ? colorize(count, colors2.count) : count;
7812
+ return `${label} ${coloredCount}`;
7813
+ },
7814
+ indicator: (data, colors2) => {
7815
+ const { running, total } = data.status;
7816
+ if (running === 0) {
7817
+ const label2 = colors2 ? colorize("Docker:", colors2.label) : "Docker:";
7818
+ return `\u25CF ${label2} --`;
7819
+ }
7820
+ const count = total > running ? `${running}/${total}` : `${running}`;
7821
+ const label = colors2 ? colorize("Docker:", colors2.label) : "Docker:";
7822
+ const coloredCount = colors2 ? colorize(count, colors2.count) : count;
7823
+ return `\u25CF ${label} ${coloredCount}`;
7824
+ }
7825
+ };
7826
+
7827
+ // src/widgets/docker/docker-widget.ts
7828
+ var execFileAsync3 = (0, import_node_util4.promisify)(import_node_child_process3.execFile);
7829
+ var DockerWidget = class {
7830
+ id = "docker";
7831
+ metadata = createWidgetMetadata(
7832
+ "Docker",
7833
+ "Shows Docker container count and status",
7834
+ "1.0.0",
7835
+ "claude-scope",
7836
+ 0
7837
+ );
7838
+ enabled = true;
7839
+ colors;
7840
+ _lineOverride;
7841
+ styleFn = dockerStyles.balanced;
7842
+ cachedStatus = null;
7843
+ lastCheck = 0;
7844
+ CACHE_TTL = 5e3;
7845
+ constructor(colors2) {
7846
+ this.colors = colors2 ?? DEFAULT_THEME;
7847
+ }
7848
+ setStyle(style = "balanced") {
7849
+ const fn = dockerStyles[style];
7850
+ if (fn) {
7851
+ this.styleFn = fn;
7852
+ }
7853
+ }
7854
+ setLine(line) {
7855
+ this._lineOverride = line;
7856
+ }
7857
+ getLine() {
7858
+ return this._lineOverride ?? this.metadata.line ?? 0;
7859
+ }
7860
+ async initialize(context) {
7861
+ this.enabled = context.config?.enabled !== false;
7862
+ }
7863
+ async update(_data) {
7864
+ }
7865
+ isEnabled() {
7866
+ return this.enabled;
7867
+ }
7868
+ async cleanup() {
7869
+ }
7870
+ async render(_context) {
7871
+ if (!this.enabled) {
7872
+ return null;
7873
+ }
7874
+ const now = Date.now();
7875
+ if (this.cachedStatus && now - this.lastCheck < this.CACHE_TTL) {
7876
+ return this.styleFn({ status: this.cachedStatus }, this.colors.docker);
7877
+ }
7878
+ const status = await this.getDockerStatus();
7879
+ this.cachedStatus = status;
7880
+ this.lastCheck = now;
7881
+ if (!status.isAvailable) {
7882
+ return null;
7883
+ }
7884
+ return this.styleFn({ status }, this.colors.docker);
7885
+ }
7886
+ async getDockerStatus() {
7887
+ try {
7888
+ await execFileAsync3("docker", ["info"], { timeout: 2e3 });
7889
+ const { stdout: runningOutput } = await execFileAsync3("docker", ["ps", "-q"], {
7890
+ timeout: 1e3
7891
+ });
7892
+ const running = runningOutput.trim().split("\n").filter((line) => line).length;
7893
+ const { stdout: allOutput } = await execFileAsync3("docker", ["ps", "-aq"], {
7894
+ timeout: 1e3
7895
+ });
7896
+ const total = allOutput.trim().split("\n").filter((line) => line).length;
7897
+ return { running, total, isAvailable: true };
7898
+ } catch {
7899
+ return { running: 0, total: 0, isAvailable: false };
7900
+ }
7901
+ }
7902
+ };
7903
+
7904
+ // src/core/widget-factory.ts
7329
7905
  init_duration_widget();
7330
7906
  init_git_tag_widget();
7331
7907
  init_git_widget();
@@ -7363,6 +7939,10 @@ var WidgetFactory = class {
7363
7939
  return new CacheMetricsWidget(DEFAULT_THEME);
7364
7940
  case "active-tools":
7365
7941
  return new ActiveToolsWidget(DEFAULT_THEME, this.transcriptProvider);
7942
+ case "dev-server":
7943
+ return new DevServerWidget(DEFAULT_THEME);
7944
+ case "docker":
7945
+ return new DockerWidget(DEFAULT_THEME);
7366
7946
  default:
7367
7947
  return null;
7368
7948
  }
@@ -7381,7 +7961,9 @@ var WidgetFactory = class {
7381
7961
  "git-tag",
7382
7962
  "config-count",
7383
7963
  "cache-metrics",
7384
- "active-tools"
7964
+ "active-tools",
7965
+ "dev-server",
7966
+ "docker"
7385
7967
  ];
7386
7968
  }
7387
7969
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-scope",
3
- "version": "0.8.8",
3
+ "version": "0.8.11",
4
4
  "description": "Claude Code plugin for session status and analytics",
5
5
  "license": "MIT",
6
6
  "type": "module",