claude-scope 0.8.48 → 0.8.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/claude-scope.cjs +152 -0
- package/package.json +1 -1
package/dist/claude-scope.cjs
CHANGED
|
@@ -152,6 +152,10 @@ function createThemeColors(params) {
|
|
|
152
152
|
configCount: {
|
|
153
153
|
label: params.configCountLabel ?? semantic.info,
|
|
154
154
|
separator: params.configCountSeparator ?? base.muted
|
|
155
|
+
},
|
|
156
|
+
cwd: {
|
|
157
|
+
name: params.cwdName ?? params.branch,
|
|
158
|
+
separator: params.cwdSeparator ?? params.duration
|
|
155
159
|
}
|
|
156
160
|
};
|
|
157
161
|
}
|
|
@@ -2100,6 +2104,10 @@ function getDefaultColors() {
|
|
|
2100
2104
|
configCount: {
|
|
2101
2105
|
label: "\x1B[36m",
|
|
2102
2106
|
separator: "\x1B[90m"
|
|
2107
|
+
},
|
|
2108
|
+
cwd: {
|
|
2109
|
+
name: "\x1B[36m",
|
|
2110
|
+
separator: "\x1B[90m"
|
|
2103
2111
|
}
|
|
2104
2112
|
};
|
|
2105
2113
|
}
|
|
@@ -26142,6 +26150,11 @@ function generateBalancedLayout(style, themeName) {
|
|
|
26142
26150
|
theme: themeName,
|
|
26143
26151
|
lines: {
|
|
26144
26152
|
"0": [
|
|
26153
|
+
{
|
|
26154
|
+
id: "cwd",
|
|
26155
|
+
style,
|
|
26156
|
+
colors: { name: theme.cwd.name, separator: theme.cwd.separator }
|
|
26157
|
+
},
|
|
26145
26158
|
{
|
|
26146
26159
|
id: "model",
|
|
26147
26160
|
style,
|
|
@@ -26212,6 +26225,11 @@ function generateCompactLayout(style, themeName) {
|
|
|
26212
26225
|
theme: themeName,
|
|
26213
26226
|
lines: {
|
|
26214
26227
|
"0": [
|
|
26228
|
+
{
|
|
26229
|
+
id: "cwd",
|
|
26230
|
+
style,
|
|
26231
|
+
colors: { name: theme.cwd.name, separator: theme.cwd.separator }
|
|
26232
|
+
},
|
|
26215
26233
|
{
|
|
26216
26234
|
id: "model",
|
|
26217
26235
|
style,
|
|
@@ -26254,6 +26272,11 @@ function generateRichLayout(style, themeName) {
|
|
|
26254
26272
|
theme: themeName,
|
|
26255
26273
|
lines: {
|
|
26256
26274
|
"0": [
|
|
26275
|
+
{
|
|
26276
|
+
id: "cwd",
|
|
26277
|
+
style,
|
|
26278
|
+
colors: { name: theme.cwd.name, separator: theme.cwd.separator }
|
|
26279
|
+
},
|
|
26257
26280
|
{
|
|
26258
26281
|
id: "model",
|
|
26259
26282
|
style,
|
|
@@ -26660,6 +26683,132 @@ init_cache_metrics();
|
|
|
26660
26683
|
init_config_count_widget();
|
|
26661
26684
|
init_context_widget();
|
|
26662
26685
|
init_cost_widget();
|
|
26686
|
+
|
|
26687
|
+
// src/widgets/cwd/cwd-widget.ts
|
|
26688
|
+
init_widget_types();
|
|
26689
|
+
init_theme();
|
|
26690
|
+
init_stdin_data_widget();
|
|
26691
|
+
|
|
26692
|
+
// src/widgets/cwd/styles.ts
|
|
26693
|
+
init_colors();
|
|
26694
|
+
init_style_utils();
|
|
26695
|
+
function shortenPath(path2) {
|
|
26696
|
+
const home = process.env.HOME || "";
|
|
26697
|
+
const result2 = home && path2.startsWith(home) ? "~" + path2.slice(home.length) : path2;
|
|
26698
|
+
const parts = result2.split("/").filter(Boolean);
|
|
26699
|
+
if (parts.length <= 2) return result2;
|
|
26700
|
+
const shortened = parts.map((p, i) => i === parts.length - 1 ? p : p[0] || p);
|
|
26701
|
+
const prefix = result2.startsWith("~") ? "~/" : result2.startsWith("/") ? "/" : "";
|
|
26702
|
+
const startIndex = result2.startsWith("~") ? 1 : 0;
|
|
26703
|
+
return prefix + shortened.slice(startIndex).join("/");
|
|
26704
|
+
}
|
|
26705
|
+
var cwdStyles = {
|
|
26706
|
+
/**
|
|
26707
|
+
* Minimal style (default): shortened path with ~
|
|
26708
|
+
* /Users/demo/projects/claude-scope -> ~/p/claude-scope
|
|
26709
|
+
*/
|
|
26710
|
+
minimal: (data, colors2) => {
|
|
26711
|
+
const short = shortenPath(data.fullPath);
|
|
26712
|
+
return colors2 ? colorize(short, colors2.name) : short;
|
|
26713
|
+
},
|
|
26714
|
+
/**
|
|
26715
|
+
* Balanced style: directory name only
|
|
26716
|
+
* /Users/demo/projects/claude-scope -> claude-scope
|
|
26717
|
+
*/
|
|
26718
|
+
balanced: (data, colors2) => {
|
|
26719
|
+
return colors2 ? colorize(data.dirName, colors2.name) : data.dirName;
|
|
26720
|
+
},
|
|
26721
|
+
/**
|
|
26722
|
+
* Compact style: same as balanced (directory name only)
|
|
26723
|
+
* /Users/demo/projects/claude-scope -> claude-scope
|
|
26724
|
+
*/
|
|
26725
|
+
compact: (data, colors2) => {
|
|
26726
|
+
return colors2 ? colorize(data.dirName, colors2.name) : data.dirName;
|
|
26727
|
+
},
|
|
26728
|
+
/**
|
|
26729
|
+
* Playful style: with folder emoji
|
|
26730
|
+
* /Users/demo/projects/claude-scope -> 📁 claude-scope
|
|
26731
|
+
*/
|
|
26732
|
+
playful: (data, colors2) => {
|
|
26733
|
+
const colored = colors2 ? colorize(data.dirName, colors2.name) : data.dirName;
|
|
26734
|
+
return `\u{1F4C1} ${colored}`;
|
|
26735
|
+
},
|
|
26736
|
+
/**
|
|
26737
|
+
* Technical style: full path with colored separators
|
|
26738
|
+
* /Users/demo/projects/claude-scope -> /Users/demo/projects/claude-scope
|
|
26739
|
+
*/
|
|
26740
|
+
technical: (data, colors2) => {
|
|
26741
|
+
if (!colors2) return data.fullPath;
|
|
26742
|
+
const parts = data.fullPath.split("/");
|
|
26743
|
+
return parts.map((p, i) => {
|
|
26744
|
+
if (p === "") return "";
|
|
26745
|
+
const color = i === parts.length - 1 ? colors2.name : colors2.separator;
|
|
26746
|
+
return colorize(p, color);
|
|
26747
|
+
}).join(colorize("/", colors2.separator));
|
|
26748
|
+
},
|
|
26749
|
+
/**
|
|
26750
|
+
* Symbolic style: with diamond symbol
|
|
26751
|
+
* /Users/demo/projects/claude-scope -> ◆ claude-scope
|
|
26752
|
+
*/
|
|
26753
|
+
symbolic: (data, colors2) => {
|
|
26754
|
+
const colored = colors2 ? colorize(data.dirName, colors2.name) : data.dirName;
|
|
26755
|
+
return `\u25C6 ${colored}`;
|
|
26756
|
+
},
|
|
26757
|
+
/**
|
|
26758
|
+
* Labeled style: with Dir: prefix
|
|
26759
|
+
* /Users/demo/projects/claude-scope -> Dir: claude-scope
|
|
26760
|
+
*/
|
|
26761
|
+
labeled: (data, colors2) => {
|
|
26762
|
+
const colored = colors2 ? colorize(data.dirName, colors2.name) : data.dirName;
|
|
26763
|
+
return withLabel("Dir", colored);
|
|
26764
|
+
},
|
|
26765
|
+
/**
|
|
26766
|
+
* Indicator style: with bullet indicator
|
|
26767
|
+
* /Users/demo/projects/claude-scope -> ● claude-scope
|
|
26768
|
+
*/
|
|
26769
|
+
indicator: (data, colors2) => {
|
|
26770
|
+
const colored = colors2 ? colorize(data.dirName, colors2.name) : data.dirName;
|
|
26771
|
+
return withIndicator(colored);
|
|
26772
|
+
}
|
|
26773
|
+
};
|
|
26774
|
+
|
|
26775
|
+
// src/widgets/cwd/cwd-widget.ts
|
|
26776
|
+
var CwdWidget = class extends StdinDataWidget {
|
|
26777
|
+
id = "cwd";
|
|
26778
|
+
metadata = createWidgetMetadata(
|
|
26779
|
+
"CWD",
|
|
26780
|
+
"Displays current working directory",
|
|
26781
|
+
"1.0.0",
|
|
26782
|
+
"claude-scope",
|
|
26783
|
+
0
|
|
26784
|
+
);
|
|
26785
|
+
colors;
|
|
26786
|
+
styleFn = cwdStyles.minimal;
|
|
26787
|
+
constructor(colors2) {
|
|
26788
|
+
super();
|
|
26789
|
+
this.colors = colors2 ?? DEFAULT_THEME;
|
|
26790
|
+
}
|
|
26791
|
+
setStyle(style = "minimal") {
|
|
26792
|
+
const fn = cwdStyles[style];
|
|
26793
|
+
if (fn) {
|
|
26794
|
+
this.styleFn = fn;
|
|
26795
|
+
}
|
|
26796
|
+
}
|
|
26797
|
+
renderWithData(data, _context) {
|
|
26798
|
+
if (!data.cwd) {
|
|
26799
|
+
return null;
|
|
26800
|
+
}
|
|
26801
|
+
const parts = data.cwd.split("/");
|
|
26802
|
+
const dirName = parts[parts.length - 1] || data.cwd;
|
|
26803
|
+
const renderData = {
|
|
26804
|
+
fullPath: data.cwd,
|
|
26805
|
+
dirName
|
|
26806
|
+
};
|
|
26807
|
+
return this.styleFn(renderData, this.colors.cwd);
|
|
26808
|
+
}
|
|
26809
|
+
};
|
|
26810
|
+
|
|
26811
|
+
// src/cli/commands/quick-config/preview.ts
|
|
26663
26812
|
init_duration_widget();
|
|
26664
26813
|
init_git_tag_widget();
|
|
26665
26814
|
init_git_widget();
|
|
@@ -27634,6 +27783,8 @@ var WidgetFactory = class {
|
|
|
27634
27783
|
*/
|
|
27635
27784
|
createWidget(widgetId) {
|
|
27636
27785
|
switch (widgetId) {
|
|
27786
|
+
case "cwd":
|
|
27787
|
+
return new CwdWidget(this.theme);
|
|
27637
27788
|
case "model":
|
|
27638
27789
|
return new ModelWidget(this.theme);
|
|
27639
27790
|
case "context":
|
|
@@ -27673,6 +27824,7 @@ var WidgetFactory = class {
|
|
|
27673
27824
|
*/
|
|
27674
27825
|
getSupportedWidgetIds() {
|
|
27675
27826
|
return [
|
|
27827
|
+
"cwd",
|
|
27676
27828
|
"model",
|
|
27677
27829
|
"context",
|
|
27678
27830
|
"cost",
|