@narumitw/pi-statusline 0.49.3 → 0.49.5
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 +4 -7
- package/package.json +4 -8
- package/src/ansi.ts +26 -0
- package/src/command-contract.ts +13 -0
- package/src/commands.ts +925 -0
- package/src/directory.ts +54 -0
- package/src/extension-status.ts +321 -0
- package/src/git-status.ts +148 -0
- package/src/index.ts +1 -1
- package/src/information-profiles.ts +40 -0
- package/src/powerline.ts +170 -0
- package/src/presets/candy.ts +9 -0
- package/src/presets/create-ramp.ts +41 -0
- package/src/presets/custom.ts +11 -0
- package/src/presets/forest.ts +9 -0
- package/src/presets/index.ts +55 -0
- package/src/presets/mono.ts +9 -0
- package/src/presets/neon.ts +9 -0
- package/src/presets/ocean.ts +9 -0
- package/src/presets/sunset.ts +9 -0
- package/src/presets/tokyo-night.ts +13 -0
- package/src/presets/types.ts +12 -0
- package/src/render.ts +357 -0
- package/src/settings.ts +702 -0
- package/src/statusline.ts +376 -0
- package/src/terminal.ts +60 -0
- package/src/types.ts +88 -0
- package/src/usage.ts +53 -0
- package/dist/chunks/chunk-6BDIM4OT.ts +0 -776
- package/dist/chunks/chunk-6BDIM4OT.ts.map +0 -7
- package/dist/chunks/commands-FUT5RTFK.ts +0 -774
- package/dist/chunks/commands-FUT5RTFK.ts.map +0 -7
- package/dist/statusline.ts +0 -1144
- package/dist/statusline.ts.map +0 -7
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ A representative uncolored layout:
|
|
|
35
35
|
pi install npm:@narumitw/pi-statusline
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Try the published package without installing, or
|
|
38
|
+
Try the published package without installing, or load it directly from this repository:
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
41
|
pi -e npm:@narumitw/pi-statusline
|
|
@@ -335,11 +335,8 @@ Put transient activity in the value and always clear the same complete key.
|
|
|
335
335
|
|
|
336
336
|
```text
|
|
337
337
|
extensions/pi-statusline/
|
|
338
|
-
├── dist/ # generated split runtime and source maps
|
|
339
|
-
├── scripts/
|
|
340
|
-
│ └── build-runtime.mjs # deterministic bundler and eager-import validator
|
|
341
338
|
├── src/
|
|
342
|
-
│ ├── index.ts # thin entrypoint forwarding to
|
|
339
|
+
│ ├── index.ts # thin entrypoint forwarding to the source runtime
|
|
343
340
|
│ ├── statusline.ts # authoritative lifecycle implementation
|
|
344
341
|
│ ├── command-contract.ts
|
|
345
342
|
│ ├── render.ts
|
|
@@ -361,8 +358,8 @@ extensions/pi-statusline/
|
|
|
361
358
|
└── package.json
|
|
362
359
|
```
|
|
363
360
|
|
|
364
|
-
`src/`
|
|
365
|
-
|
|
361
|
+
`src/` is the authoritative published implementation, and `src/index.ts` remains the sole declared
|
|
362
|
+
Pi entrypoint.
|
|
366
363
|
|
|
367
364
|
## 🔎 Keywords
|
|
368
365
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narumitw/pi-statusline",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.5",
|
|
4
4
|
"description": "Pi extension that replaces the footer with an information-rich statusline.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
"footer"
|
|
14
14
|
],
|
|
15
15
|
"files": [
|
|
16
|
-
"src
|
|
17
|
-
"dist",
|
|
16
|
+
"src",
|
|
18
17
|
"README.md",
|
|
19
18
|
"LICENSE"
|
|
20
19
|
],
|
|
@@ -24,10 +23,8 @@
|
|
|
24
23
|
]
|
|
25
24
|
},
|
|
26
25
|
"scripts": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"format": "biome check --write --vcs-use-ignore-file=false src test scripts package.json tsconfig.json README.md",
|
|
30
|
-
"prepack": "npm run build",
|
|
26
|
+
"check": "biome check --vcs-use-ignore-file=false src test package.json tsconfig.json README.md && npm run typecheck",
|
|
27
|
+
"format": "biome check --write --vcs-use-ignore-file=false src test package.json tsconfig.json README.md",
|
|
31
28
|
"typecheck": "tsc --noEmit"
|
|
32
29
|
},
|
|
33
30
|
"peerDependencies": {
|
|
@@ -39,7 +36,6 @@
|
|
|
39
36
|
"@earendil-works/pi-coding-agent": "0.83.0",
|
|
40
37
|
"@earendil-works/pi-tui": "0.83.0",
|
|
41
38
|
"@types/node": "26.1.2",
|
|
42
|
-
"esbuild": "0.28.1",
|
|
43
39
|
"typescript": "7.0.2"
|
|
44
40
|
},
|
|
45
41
|
"repository": {
|
package/src/ansi.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function ansiStyle(text: string, colors: { fg?: string; bg?: string }): string {
|
|
2
|
+
const codes = [
|
|
3
|
+
colors.fg ? truecolorCode("38", colors.fg) : undefined,
|
|
4
|
+
colors.bg ? truecolorCode("48", colors.bg) : undefined,
|
|
5
|
+
].filter((code): code is string => code !== undefined);
|
|
6
|
+
if (codes.length === 0) return text;
|
|
7
|
+
return `\u001b[${codes.join(";")}m${text}\u001b[0m`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function ansiFg(hex: string, text: string): string {
|
|
11
|
+
return ansiStyle(text, { fg: hex });
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function truecolorCode(prefix: "38" | "48", hex: string): string {
|
|
15
|
+
const { red, green, blue } = hexToRgb(hex);
|
|
16
|
+
return `${prefix};2;${red};${green};${blue}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function hexToRgb(hex: string): { red: number; green: number; blue: number } {
|
|
20
|
+
const normalized = hex.replace(/^#/, "");
|
|
21
|
+
return {
|
|
22
|
+
red: Number.parseInt(normalized.slice(0, 2), 16),
|
|
23
|
+
green: Number.parseInt(normalized.slice(2, 4), 16),
|
|
24
|
+
blue: Number.parseInt(normalized.slice(4, 6), 16),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AutocompleteItem } from "@earendil-works/pi-tui";
|
|
2
|
+
|
|
3
|
+
export const STATUSLINE_SUBCOMMANDS: readonly AutocompleteItem[] = [
|
|
4
|
+
{ value: "settings", label: "settings", description: "Edit pi-statusline.json" },
|
|
5
|
+
{ value: "status", label: "status", description: "Show effective statusline settings" },
|
|
6
|
+
{ value: "help", label: "help", description: "Show configuration help" },
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
export function completeStatuslineArguments(prefix: string): AutocompleteItem[] | null {
|
|
10
|
+
const normalized = prefix.trim().toLowerCase();
|
|
11
|
+
const matches = STATUSLINE_SUBCOMMANDS.filter((item) => item.value.startsWith(normalized));
|
|
12
|
+
return matches.length > 0 ? [...matches] : null;
|
|
13
|
+
}
|