pi-cc-extensions 0.1.2 → 0.1.3

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.
@@ -1,109 +1,109 @@
1
- import type { ColorScheme, PresetDef, StatusLinePreset } from "./types.ts";
2
- import { getDefaultColors } from "./theme.ts";
3
-
4
- // Get base colors from theme.ts (single source of truth)
5
- const DEFAULT_COLORS: ColorScheme = getDefaultColors();
6
-
7
- // Minimal - more muted, less colorful
8
- const MINIMAL_COLORS: ColorScheme = {
9
- ...DEFAULT_COLORS,
10
- model: "text",
11
- path: "text",
12
- gitClean: "dim",
13
- };
14
-
15
- // Nerd - vibrant colors
16
- const NERD_COLORS: ColorScheme = {
17
- ...DEFAULT_COLORS,
18
- model: "accent",
19
- path: "success",
20
- tokens: "muted",
21
- cost: "warning",
22
- };
23
-
24
- export const PRESETS: Record<StatusLinePreset, PresetDef> = {
25
- default: {
26
- leftSegments: ["model", "thinking", "shell_mode", "path", "git", "context_pct", "cache_read", "cost"],
27
- rightSegments: [],
28
- secondarySegments: ["extension_statuses"],
29
- separator: "powerline-thin",
30
- colors: DEFAULT_COLORS,
31
- segmentOptions: {
32
- model: { showThinkingLevel: false },
33
- path: { mode: "basename" },
34
- git: { showBranch: true, showStaged: true, showUnstaged: true, showUntracked: true, showLines: true },
35
- },
36
- },
37
-
38
- minimal: {
39
- leftSegments: ["shell_mode", "path", "git"],
40
- rightSegments: ["context_pct"],
41
- separator: "slash",
42
- colors: MINIMAL_COLORS,
43
- segmentOptions: {
44
- path: { mode: "basename" },
45
- git: { showBranch: true, showStaged: false, showUnstaged: false, showUntracked: false, showLines: false },
46
- },
47
- },
48
-
49
- compact: {
50
- leftSegments: ["model", "shell_mode", "git"],
51
- rightSegments: ["cost", "context_pct"],
52
- separator: "pipe",
53
- colors: DEFAULT_COLORS,
54
- segmentOptions: {
55
- model: { showThinkingLevel: true },
56
- git: { showBranch: true, showStaged: true, showUnstaged: true, showUntracked: false, showLines: true },
57
- },
58
- },
59
-
60
- full: {
61
- leftSegments: ["hostname", "model", "thinking", "shell_mode", "path", "git", "subagents"],
62
- rightSegments: ["token_in", "token_out", "cache_read", "cost", "context_pct", "time_spent", "time", "extension_statuses"],
63
- separator: "powerline",
64
- colors: DEFAULT_COLORS,
65
- segmentOptions: {
66
- model: { showThinkingLevel: false },
67
- path: { mode: "abbreviated", maxLength: 50 },
68
- git: { showBranch: true, showStaged: true, showUnstaged: true, showUntracked: true, showLines: true },
69
- time: { format: "24h", showSeconds: false },
70
- },
71
- },
72
-
73
- nerd: {
74
- leftSegments: ["hostname", "model", "thinking", "shell_mode", "path", "git", "session", "subagents"],
75
- rightSegments: ["token_in", "token_out", "cache_read", "cache_write", "cost", "context_pct", "context_total", "time_spent", "time", "extension_statuses"],
76
- separator: "powerline",
77
- colors: NERD_COLORS,
78
- segmentOptions: {
79
- model: { showThinkingLevel: false },
80
- path: { mode: "abbreviated", maxLength: 60 },
81
- git: { showBranch: true, showStaged: true, showUnstaged: true, showUntracked: true, showLines: true },
82
- time: { format: "24h", showSeconds: true },
83
- },
84
- },
85
-
86
- ascii: {
87
- leftSegments: ["model", "shell_mode", "path", "git"],
88
- rightSegments: ["token_total", "cost", "context_pct"],
89
- separator: "ascii",
90
- colors: MINIMAL_COLORS,
91
- segmentOptions: {
92
- model: { showThinkingLevel: true },
93
- path: { mode: "abbreviated", maxLength: 40 },
94
- git: { showBranch: true, showStaged: true, showUnstaged: true, showUntracked: true, showLines: false },
95
- },
96
- },
97
-
98
- custom: {
99
- leftSegments: ["model", "shell_mode", "path", "git"],
100
- rightSegments: ["token_total", "cost", "context_pct"],
101
- separator: "pipe",
102
- colors: DEFAULT_COLORS,
103
- segmentOptions: {
104
- },
105
- };
106
-
107
- export function getPreset(name: StatusLinePreset): PresetDef {
108
- return PRESETS[name] ?? PRESETS.default;
109
- }
1
+ import type { ColorScheme, PresetDef, StatusLinePreset } from "./types.ts";
2
+ import { getDefaultColors } from "./theme.ts";
3
+
4
+ // Get base colors from theme.ts (single source of truth)
5
+ const DEFAULT_COLORS: ColorScheme = getDefaultColors();
6
+
7
+ // Minimal - more muted, less colorful
8
+ const MINIMAL_COLORS: ColorScheme = {
9
+ ...DEFAULT_COLORS,
10
+ model: "text",
11
+ path: "text",
12
+ gitClean: "dim",
13
+ };
14
+
15
+ // Nerd - vibrant colors
16
+ const NERD_COLORS: ColorScheme = {
17
+ ...DEFAULT_COLORS,
18
+ model: "accent",
19
+ path: "success",
20
+ tokens: "muted",
21
+ cost: "warning",
22
+ };
23
+
24
+ export const PRESETS: Record<StatusLinePreset, PresetDef> = {
25
+ default: {
26
+ leftSegments: ["model", "thinking", "shell_mode", "path", "git", "context_pct", "cache_read", "cost"],
27
+ rightSegments: [],
28
+ secondarySegments: ["extension_statuses"],
29
+ separator: "powerline-thin",
30
+ colors: DEFAULT_COLORS,
31
+ segmentOptions: {
32
+ model: { showThinkingLevel: false },
33
+ path: { mode: "basename" },
34
+ git: { showBranch: true, showStaged: true, showUnstaged: true, showUntracked: true, showLines: true },
35
+ },
36
+ },
37
+
38
+ minimal: {
39
+ leftSegments: ["shell_mode", "path", "git"],
40
+ rightSegments: ["context_pct"],
41
+ separator: "slash",
42
+ colors: MINIMAL_COLORS,
43
+ segmentOptions: {
44
+ path: { mode: "basename" },
45
+ git: { showBranch: true, showStaged: false, showUnstaged: false, showUntracked: false, showLines: false },
46
+ },
47
+ },
48
+
49
+ compact: {
50
+ leftSegments: ["model", "shell_mode", "git"],
51
+ rightSegments: ["cost", "context_pct"],
52
+ separator: "pipe",
53
+ colors: DEFAULT_COLORS,
54
+ segmentOptions: {
55
+ model: { showThinkingLevel: true },
56
+ git: { showBranch: true, showStaged: true, showUnstaged: true, showUntracked: false, showLines: true },
57
+ },
58
+ },
59
+
60
+ full: {
61
+ leftSegments: ["hostname", "model", "thinking", "shell_mode", "path", "git", "subagents"],
62
+ rightSegments: ["token_in", "token_out", "cache_read", "cost", "context_pct", "time_spent", "time", "extension_statuses"],
63
+ separator: "powerline",
64
+ colors: DEFAULT_COLORS,
65
+ segmentOptions: {
66
+ model: { showThinkingLevel: false },
67
+ path: { mode: "abbreviated", maxLength: 50 },
68
+ git: { showBranch: true, showStaged: true, showUnstaged: true, showUntracked: true, showLines: true },
69
+ time: { format: "24h", showSeconds: false },
70
+ },
71
+ },
72
+
73
+ nerd: {
74
+ leftSegments: ["hostname", "model", "thinking", "shell_mode", "path", "git", "session", "subagents"],
75
+ rightSegments: ["token_in", "token_out", "cache_read", "cache_write", "cost", "context_pct", "context_total", "time_spent", "time", "extension_statuses"],
76
+ separator: "powerline",
77
+ colors: NERD_COLORS,
78
+ segmentOptions: {
79
+ model: { showThinkingLevel: false },
80
+ path: { mode: "abbreviated", maxLength: 60 },
81
+ git: { showBranch: true, showStaged: true, showUnstaged: true, showUntracked: true, showLines: true },
82
+ time: { format: "24h", showSeconds: true },
83
+ },
84
+ },
85
+
86
+ ascii: {
87
+ leftSegments: ["model", "shell_mode", "path", "git"],
88
+ rightSegments: ["token_total", "cost", "context_pct"],
89
+ separator: "ascii",
90
+ colors: MINIMAL_COLORS,
91
+ segmentOptions: {
92
+ model: { showThinkingLevel: true },
93
+ path: { mode: "abbreviated", maxLength: 40 },
94
+ git: { showBranch: true, showStaged: true, showUnstaged: true, showUntracked: true, showLines: false },
95
+ },
96
+ },
97
+
98
+ custom: {
99
+ leftSegments: ["model", "shell_mode", "path", "git"],
100
+ rightSegments: ["token_total", "cost", "context_pct"],
101
+ separator: "pipe",
102
+ colors: DEFAULT_COLORS,
103
+ segmentOptions: {},
104
+ },
105
+ };
106
+
107
+ export function getPreset(name: StatusLinePreset): PresetDef {
108
+ return PRESETS[name] ?? PRESETS.default;
109
+ }
@@ -2,7 +2,7 @@
2
2
  // AI-generated contextual working messages that match a user's preferred theme/vibe.
3
3
  // Uses module-level state (matching powerline-footer pattern).
4
4
 
5
- import { complete, type Context } from "@earendil-works/pi-ai";
5
+ import { complete, type Context } from "@earendil-works/pi-ai/compat";
6
6
  import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
7
7
  import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
8
8
  import { join, dirname } from "node:path";
@@ -256,10 +256,13 @@ function isToolExpanded(options: any, context: any): boolean {
256
256
 
257
257
  /** Keep the guide aligned when long result lines wrap at the viewport edge. */
258
258
  class ExpandedToolResultText {
259
- constructor(
260
- private readonly text: string,
261
- private readonly prefix: string,
262
- ) {}
259
+ private readonly text: string;
260
+ private readonly prefix: string;
261
+
262
+ constructor(text: string, prefix: string) {
263
+ this.text = text;
264
+ this.prefix = prefix;
265
+ }
263
266
 
264
267
  render(width: number): string[] {
265
268
  const prefixWidth = visibleWidth(this.prefix);