ccstatusline 2.0.26 → 2.0.27
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 +13 -0
- package/dist/ccstatusline.js +94 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -46,6 +46,19 @@
|
|
|
46
46
|
|
|
47
47
|
## 🆕 Recent Updates
|
|
48
48
|
|
|
49
|
+
### v2.0.27 - Git Root Dir widget and raw-mode editor guardrails
|
|
50
|
+
|
|
51
|
+
- **📁 Git Root Dir widget** - Added a new Git widget that shows the repository root directory name.
|
|
52
|
+
|
|
53
|
+
### v2.0.26 - Session naming, CWD options, and TUI workflow improvements
|
|
54
|
+
|
|
55
|
+
- **🏷️ Session Name widget** - Added a new widget that shows the current Claude Code session name from `/rename`.
|
|
56
|
+
- **🏠 Current Working Directory home abbreviation** - Added a `~` abbreviation option for CWD display in both preview and live rendering.
|
|
57
|
+
- **🧠 Context model suffix fix** - Context widgets now recognize the `[1m]` suffix across models, not just a single model path.
|
|
58
|
+
- **🧭 Widget picker UX updates** - Improved widget discovery/navigation and added clearer, safer clear-line behavior.
|
|
59
|
+
- **⌨️ TUI editor input fix** - Prevented shortcut/input leakage into widget editor flows.
|
|
60
|
+
- **📄 Repo docs update** - Migrated guidance from `CLAUDE.md` to `AGENTS.md` (with symlink compatibility).
|
|
61
|
+
|
|
49
62
|
### v2.0.16 - Add fish style path abbreviation toggle to Current Working Directory widget
|
|
50
63
|
|
|
51
64
|
### v2.0.15 - Block Timer calculation fixes
|
package/dist/ccstatusline.js
CHANGED
|
@@ -51405,7 +51405,7 @@ import { execSync as execSync3 } from "child_process";
|
|
|
51405
51405
|
import * as fs5 from "fs";
|
|
51406
51406
|
import * as path4 from "path";
|
|
51407
51407
|
var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils";
|
|
51408
|
-
var PACKAGE_VERSION = "2.0.
|
|
51408
|
+
var PACKAGE_VERSION = "2.0.27";
|
|
51409
51409
|
function getPackageVersion() {
|
|
51410
51410
|
if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
|
|
51411
51411
|
return PACKAGE_VERSION;
|
|
@@ -52478,9 +52478,90 @@ class GitChangesWidget {
|
|
|
52478
52478
|
return true;
|
|
52479
52479
|
}
|
|
52480
52480
|
}
|
|
52481
|
-
// src/widgets/
|
|
52481
|
+
// src/widgets/GitRootDir.ts
|
|
52482
52482
|
import { execSync as execSync6 } from "child_process";
|
|
52483
52483
|
|
|
52484
|
+
class GitRootDirWidget {
|
|
52485
|
+
getDefaultColor() {
|
|
52486
|
+
return "cyan";
|
|
52487
|
+
}
|
|
52488
|
+
getDescription() {
|
|
52489
|
+
return "Shows the git repository root directory name";
|
|
52490
|
+
}
|
|
52491
|
+
getDisplayName() {
|
|
52492
|
+
return "Git Root Dir";
|
|
52493
|
+
}
|
|
52494
|
+
getCategory() {
|
|
52495
|
+
return "Git";
|
|
52496
|
+
}
|
|
52497
|
+
getEditorDisplay(item) {
|
|
52498
|
+
const hideNoGit = item.metadata?.hideNoGit === "true";
|
|
52499
|
+
const modifiers = [];
|
|
52500
|
+
if (hideNoGit) {
|
|
52501
|
+
modifiers.push("hide 'no git'");
|
|
52502
|
+
}
|
|
52503
|
+
return {
|
|
52504
|
+
displayText: this.getDisplayName(),
|
|
52505
|
+
modifierText: modifiers.length > 0 ? `(${modifiers.join(", ")})` : undefined
|
|
52506
|
+
};
|
|
52507
|
+
}
|
|
52508
|
+
handleEditorAction(action, item) {
|
|
52509
|
+
if (action === "toggle-nogit") {
|
|
52510
|
+
const currentState = item.metadata?.hideNoGit === "true";
|
|
52511
|
+
return {
|
|
52512
|
+
...item,
|
|
52513
|
+
metadata: {
|
|
52514
|
+
...item.metadata,
|
|
52515
|
+
hideNoGit: (!currentState).toString()
|
|
52516
|
+
}
|
|
52517
|
+
};
|
|
52518
|
+
}
|
|
52519
|
+
return null;
|
|
52520
|
+
}
|
|
52521
|
+
render(item, context, _settings) {
|
|
52522
|
+
const hideNoGit = item.metadata?.hideNoGit === "true";
|
|
52523
|
+
if (context.isPreview) {
|
|
52524
|
+
return "my-repo";
|
|
52525
|
+
}
|
|
52526
|
+
const rootDir = this.getGitRootDir();
|
|
52527
|
+
if (rootDir) {
|
|
52528
|
+
return this.getRootDirName(rootDir);
|
|
52529
|
+
}
|
|
52530
|
+
return hideNoGit ? null : "no git";
|
|
52531
|
+
}
|
|
52532
|
+
getGitRootDir() {
|
|
52533
|
+
try {
|
|
52534
|
+
const rootDir = execSync6("git rev-parse --show-toplevel", {
|
|
52535
|
+
encoding: "utf8",
|
|
52536
|
+
stdio: ["pipe", "pipe", "ignore"]
|
|
52537
|
+
}).trim();
|
|
52538
|
+
return rootDir || null;
|
|
52539
|
+
} catch {
|
|
52540
|
+
return null;
|
|
52541
|
+
}
|
|
52542
|
+
}
|
|
52543
|
+
getRootDirName(rootDir) {
|
|
52544
|
+
const trimmedRootDir = rootDir.replace(/[\\/]+$/, "");
|
|
52545
|
+
const normalizedRootDir = trimmedRootDir.length > 0 ? trimmedRootDir : rootDir;
|
|
52546
|
+
const parts = normalizedRootDir.split(/[\\/]/).filter(Boolean);
|
|
52547
|
+
const lastPart = parts[parts.length - 1];
|
|
52548
|
+
return lastPart && lastPart.length > 0 ? lastPart : normalizedRootDir;
|
|
52549
|
+
}
|
|
52550
|
+
getCustomKeybinds() {
|
|
52551
|
+
return [
|
|
52552
|
+
{ key: "h", label: "(h)ide 'no git' message", action: "toggle-nogit" }
|
|
52553
|
+
];
|
|
52554
|
+
}
|
|
52555
|
+
supportsRawValue() {
|
|
52556
|
+
return false;
|
|
52557
|
+
}
|
|
52558
|
+
supportsColors(item) {
|
|
52559
|
+
return true;
|
|
52560
|
+
}
|
|
52561
|
+
}
|
|
52562
|
+
// src/widgets/GitWorktree.ts
|
|
52563
|
+
import { execSync as execSync7 } from "child_process";
|
|
52564
|
+
|
|
52484
52565
|
class GitWorktreeWidget {
|
|
52485
52566
|
getDefaultColor() {
|
|
52486
52567
|
return "blue";
|
|
@@ -52529,7 +52610,7 @@ class GitWorktreeWidget {
|
|
|
52529
52610
|
}
|
|
52530
52611
|
getGitWorktree() {
|
|
52531
52612
|
try {
|
|
52532
|
-
const worktreeDir =
|
|
52613
|
+
const worktreeDir = execSync7("git rev-parse --git-dir", {
|
|
52533
52614
|
encoding: "utf8",
|
|
52534
52615
|
stdio: ["pipe", "pipe", "ignore"]
|
|
52535
52616
|
}).trim();
|
|
@@ -53823,7 +53904,7 @@ var CustomTextEditor = ({ widget, onComplete, onCancel }) => {
|
|
|
53823
53904
|
}, undefined, true, undefined, this);
|
|
53824
53905
|
};
|
|
53825
53906
|
// src/widgets/CustomCommand.tsx
|
|
53826
|
-
import { execSync as
|
|
53907
|
+
import { execSync as execSync8 } from "child_process";
|
|
53827
53908
|
var import_react30 = __toESM(require_react(), 1);
|
|
53828
53909
|
var jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
|
|
53829
53910
|
|
|
@@ -53872,7 +53953,7 @@ class CustomCommandWidget {
|
|
|
53872
53953
|
try {
|
|
53873
53954
|
const timeout = item.timeout ?? 1000;
|
|
53874
53955
|
const jsonInput = JSON.stringify(context.data);
|
|
53875
|
-
let output =
|
|
53956
|
+
let output = execSync8(item.commandPath, {
|
|
53876
53957
|
encoding: "utf8",
|
|
53877
53958
|
input: jsonInput,
|
|
53878
53959
|
timeout,
|
|
@@ -54533,6 +54614,7 @@ var widgetRegistry = new Map([
|
|
|
54533
54614
|
["output-style", new OutputStyleWidget],
|
|
54534
54615
|
["git-branch", new GitBranchWidget],
|
|
54535
54616
|
["git-changes", new GitChangesWidget],
|
|
54617
|
+
["git-root-dir", new GitRootDirWidget],
|
|
54536
54618
|
["git-worktree", new GitWorktreeWidget],
|
|
54537
54619
|
["current-working-dir", new CurrentWorkingDirWidget],
|
|
54538
54620
|
["tokens-input", new TokensInputWidget],
|
|
@@ -56046,7 +56128,11 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56046
56128
|
}
|
|
56047
56129
|
} else if (input === "r" && widgets.length > 0) {
|
|
56048
56130
|
const currentWidget2 = widgets[selectedIndex];
|
|
56049
|
-
if (currentWidget2 && currentWidget2.type !== "separator" && currentWidget2.type !== "flex-separator"
|
|
56131
|
+
if (currentWidget2 && currentWidget2.type !== "separator" && currentWidget2.type !== "flex-separator") {
|
|
56132
|
+
const widgetImpl = getWidget(currentWidget2.type);
|
|
56133
|
+
if (!widgetImpl?.supportsRawValue()) {
|
|
56134
|
+
return;
|
|
56135
|
+
}
|
|
56050
56136
|
const newWidgets = [...widgets];
|
|
56051
56137
|
newWidgets[selectedIndex] = { ...currentWidget2, rawValue: !currentWidget2.rawValue };
|
|
56052
56138
|
onUpdate(newWidgets);
|
|
@@ -56455,6 +56541,7 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56455
56541
|
const isSelected = index === selectedIndex;
|
|
56456
56542
|
const widgetImpl = widget.type !== "separator" && widget.type !== "flex-separator" ? getWidget(widget.type) : null;
|
|
56457
56543
|
const { displayText, modifierText } = widgetImpl?.getEditorDisplay(widget) ?? { displayText: getWidgetDisplay(widget) };
|
|
56544
|
+
const supportsRawValue = widgetImpl?.supportsRawValue() ?? false;
|
|
56458
56545
|
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56459
56546
|
flexDirection: "row",
|
|
56460
56547
|
flexWrap: "nowrap",
|
|
@@ -56477,7 +56564,7 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56477
56564
|
modifierText
|
|
56478
56565
|
]
|
|
56479
56566
|
}, undefined, true, undefined, this),
|
|
56480
|
-
widget.rawValue && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56567
|
+
supportsRawValue && widget.rawValue && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56481
56568
|
dimColor: true,
|
|
56482
56569
|
children: " (raw value)"
|
|
56483
56570
|
}, undefined, false, undefined, this),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccstatusline",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.27",
|
|
4
4
|
"description": "A customizable status line formatter for Claude Code CLI",
|
|
5
5
|
"module": "src/ccstatusline.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -70,4 +70,4 @@
|
|
|
70
70
|
"patchedDependencies": {
|
|
71
71
|
"ink@6.2.0": "patches/ink@6.2.0.patch"
|
|
72
72
|
}
|
|
73
|
-
}
|
|
73
|
+
}
|