@narumitw/pi-statusline 0.49.15 → 0.50.1
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 +47 -222
- package/dist/chunks/{chunk-74QZGJ7L.js → chunk-J2ZSGEDQ.js} +18 -97
- package/dist/chunks/chunk-J2ZSGEDQ.js.map +7 -0
- package/dist/chunks/{commands-C2G2G7C6.js → commands-PPT3AJTL.js} +14 -58
- package/dist/chunks/commands-PPT3AJTL.js.map +7 -0
- package/dist/index.ts +101 -89
- package/dist/index.ts.map +3 -3
- package/docs/configuration.md +194 -0
- package/package.json +51 -54
- package/src/ansi.ts +23 -18
- package/src/command-contract.ts +6 -6
- package/src/commands.ts +759 -818
- package/src/directory.ts +27 -31
- package/src/extension-status.ts +186 -214
- package/src/git-status.ts +103 -111
- package/src/information-profiles.ts +12 -31
- package/src/powerline.ts +120 -121
- package/src/presets/candy.ts +1 -7
- package/src/presets/create-ramp.ts +21 -23
- package/src/presets/custom.ts +7 -7
- package/src/presets/forest.ts +1 -7
- package/src/presets/index.ts +30 -32
- package/src/presets/mono.ts +1 -7
- package/src/presets/neon.ts +1 -7
- package/src/presets/ocean.ts +1 -7
- package/src/presets/sunset.ts +1 -7
- package/src/presets/tokyo-night.ts +9 -9
- package/src/presets/types.ts +5 -5
- package/src/render.ts +291 -280
- package/src/settings.ts +516 -568
- package/src/statusline.ts +348 -341
- package/src/types.ts +34 -42
- package/src/usage.ts +40 -40
- package/dist/chunks/chunk-74QZGJ7L.js.map +0 -7
- package/dist/chunks/commands-C2G2G7C6.js.map +0 -7
package/src/presets/custom.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { PowerlinePreset } from "./types.js";
|
|
2
2
|
|
|
3
3
|
export const CUSTOM_PRESET: PowerlinePreset = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
blocks: {
|
|
5
|
+
header: {},
|
|
6
|
+
directory: {},
|
|
7
|
+
git: {},
|
|
8
|
+
runtime: {},
|
|
9
|
+
meter: {},
|
|
10
|
+
},
|
|
11
11
|
};
|
package/src/presets/forest.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import { createRampPreset } from "./create-ramp.js";
|
|
2
2
|
|
|
3
|
-
export const FOREST_PRESET = createRampPreset([
|
|
4
|
-
"#a7c080",
|
|
5
|
-
"#83c092",
|
|
6
|
-
"#5f9f75",
|
|
7
|
-
"#3f6f55",
|
|
8
|
-
"#293f35",
|
|
9
|
-
]);
|
|
3
|
+
export const FOREST_PRESET = createRampPreset(["#a7c080", "#83c092", "#5f9f75", "#3f6f55", "#293f35"]);
|
package/src/presets/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
type PaletteName,
|
|
3
|
+
type PalettePreset,
|
|
4
|
+
type PowerlineBlockName,
|
|
5
|
+
SEGMENT_NAMES,
|
|
6
|
+
type SegmentName,
|
|
7
|
+
type SegmentPalette,
|
|
8
8
|
} from "../types.js";
|
|
9
9
|
import { CANDY_PRESET } from "./candy.js";
|
|
10
10
|
import { CUSTOM_PRESET } from "./custom.js";
|
|
@@ -17,39 +17,37 @@ import { TOKYO_NIGHT_PRESET } from "./tokyo-night.js";
|
|
|
17
17
|
import type { PowerlinePreset } from "./types.js";
|
|
18
18
|
|
|
19
19
|
const PRESETS = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
"tokyo-night": TOKYO_NIGHT_PRESET,
|
|
21
|
+
ocean: OCEAN_PRESET,
|
|
22
|
+
sunset: SUNSET_PRESET,
|
|
23
|
+
forest: FOREST_PRESET,
|
|
24
|
+
candy: CANDY_PRESET,
|
|
25
|
+
neon: NEON_PRESET,
|
|
26
|
+
mono: MONO_PRESET,
|
|
27
|
+
custom: CUSTOM_PRESET,
|
|
28
28
|
} satisfies Record<PalettePreset, PowerlinePreset>;
|
|
29
29
|
|
|
30
30
|
const SEGMENT_BLOCKS: Record<SegmentName, PowerlineBlockName> = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
brand: "header",
|
|
32
|
+
provider: "header",
|
|
33
|
+
model: "header",
|
|
34
|
+
thinking: "header",
|
|
35
|
+
cwd: "directory",
|
|
36
|
+
branch: "git",
|
|
37
|
+
tools: "runtime",
|
|
38
|
+
context: "runtime",
|
|
39
|
+
tokens: "runtime",
|
|
40
|
+
cache: "runtime",
|
|
41
|
+
cost: "meter",
|
|
42
|
+
time: "meter",
|
|
43
|
+
turn: "meter",
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
export function resolvePreset(preset: PalettePreset): PowerlinePreset {
|
|
47
|
-
|
|
47
|
+
return PRESETS[preset];
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export function segmentPaletteForPreset(preset: PaletteName): SegmentPalette {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
SEGMENT_NAMES.map((name) => [name, { ...blocks[SEGMENT_BLOCKS[name]] }]),
|
|
54
|
-
) as SegmentPalette;
|
|
51
|
+
const blocks = PRESETS[preset].blocks;
|
|
52
|
+
return Object.fromEntries(SEGMENT_NAMES.map((name) => [name, { ...blocks[SEGMENT_BLOCKS[name]] }])) as SegmentPalette;
|
|
55
53
|
}
|
package/src/presets/mono.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import { createRampPreset } from "./create-ramp.js";
|
|
2
2
|
|
|
3
|
-
export const MONO_PRESET = createRampPreset([
|
|
4
|
-
"#d4d4d4",
|
|
5
|
-
"#a3a3a3",
|
|
6
|
-
"#686868",
|
|
7
|
-
"#404040",
|
|
8
|
-
"#262626",
|
|
9
|
-
]);
|
|
3
|
+
export const MONO_PRESET = createRampPreset(["#d4d4d4", "#a3a3a3", "#686868", "#404040", "#262626"]);
|
package/src/presets/neon.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import { createRampPreset } from "./create-ramp.js";
|
|
2
2
|
|
|
3
|
-
export const NEON_PRESET = createRampPreset([
|
|
4
|
-
"#39ff14",
|
|
5
|
-
"#00f5ff",
|
|
6
|
-
"#ff4fd8",
|
|
7
|
-
"#7a2cf3",
|
|
8
|
-
"#29134f",
|
|
9
|
-
]);
|
|
3
|
+
export const NEON_PRESET = createRampPreset(["#39ff14", "#00f5ff", "#ff4fd8", "#7a2cf3", "#29134f"]);
|
package/src/presets/ocean.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import { createRampPreset } from "./create-ramp.js";
|
|
2
2
|
|
|
3
|
-
export const OCEAN_PRESET = createRampPreset([
|
|
4
|
-
"#7dcfff",
|
|
5
|
-
"#4f9fba",
|
|
6
|
-
"#2d6f88",
|
|
7
|
-
"#23475b",
|
|
8
|
-
"#182b3a",
|
|
9
|
-
]);
|
|
3
|
+
export const OCEAN_PRESET = createRampPreset(["#7dcfff", "#4f9fba", "#2d6f88", "#23475b", "#182b3a"]);
|
package/src/presets/sunset.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import { createRampPreset } from "./create-ramp.js";
|
|
2
2
|
|
|
3
|
-
export const SUNSET_PRESET = createRampPreset([
|
|
4
|
-
"#ffcf70",
|
|
5
|
-
"#f59e6f",
|
|
6
|
-
"#dc718a",
|
|
7
|
-
"#8f5b78",
|
|
8
|
-
"#493447",
|
|
9
|
-
]);
|
|
3
|
+
export const SUNSET_PRESET = createRampPreset(["#ffcf70", "#f59e6f", "#dc718a", "#8f5b78", "#493447"]);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { PowerlinePreset } from "./types.js";
|
|
2
2
|
|
|
3
3
|
export const TOKYO_NIGHT_PRESET: PowerlinePreset = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
lead: "#a3aed2",
|
|
5
|
+
blocks: {
|
|
6
|
+
header: { fg: "#090c0c", bg: "#a3aed2" },
|
|
7
|
+
directory: { fg: "#e3e5e5", bg: "#769ff0" },
|
|
8
|
+
git: { fg: "#769ff0", bg: "#394260" },
|
|
9
|
+
runtime: { fg: "#769ff0", bg: "#212736" },
|
|
10
|
+
meter: { fg: "#a0a9cb", bg: "#1d2230" },
|
|
11
|
+
},
|
|
12
|
+
extensionSeparator: "#394260",
|
|
13
13
|
};
|
package/src/presets/types.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { PowerlineBlockName } from "../types.js";
|
|
2
2
|
|
|
3
3
|
export interface BlockColors {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
fg?: string;
|
|
5
|
+
bg?: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export interface PowerlinePreset {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
lead?: string;
|
|
10
|
+
blocks: Record<PowerlineBlockName, BlockColors>;
|
|
11
|
+
extensionSeparator?: string;
|
|
12
12
|
}
|