@narumitw/pi-starship 0.55.1 → 0.55.2

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.
Files changed (99) hide show
  1. package/dist/chunks/{chunk-UX6PBXVK.js → chunk-JO5PH6FN.js} +28 -110
  2. package/dist/chunks/chunk-JO5PH6FN.js.map +7 -0
  3. package/dist/chunks/{chunk-P4XMFSQW.js → chunk-YWY5RIDQ.js} +3 -7
  4. package/dist/chunks/chunk-YWY5RIDQ.js.map +7 -0
  5. package/dist/chunks/{chunk-EOGXAMTA.js → chunk-ZQZSXXPI.js} +1 -1
  6. package/dist/chunks/chunk-ZQZSXXPI.js.map +7 -0
  7. package/dist/chunks/{cloud-BKHYWCTA.js → cloud-C4VU3TX3.js} +7 -14
  8. package/dist/chunks/cloud-C4VU3TX3.js.map +7 -0
  9. package/dist/chunks/{commands-53ZO2JUK.js → commands-ATILSUVK.js} +13 -42
  10. package/dist/chunks/commands-ATILSUVK.js.map +7 -0
  11. package/dist/chunks/{deployment-RKKOEQQ2.js → deployment-FMNTYRBW.js} +6 -21
  12. package/dist/chunks/deployment-FMNTYRBW.js.map +7 -0
  13. package/dist/chunks/{development-BERD42HW.js → development-OUYXDPBS.js} +4 -8
  14. package/dist/chunks/development-OUYXDPBS.js.map +7 -0
  15. package/dist/chunks/{execution-42JTEY3N.js → execution-HJOGLMWD.js} +3 -3
  16. package/dist/chunks/execution-HJOGLMWD.js.map +7 -0
  17. package/dist/chunks/{languages-RMP6DW7H.js → languages-WXMF4GOF.js} +6 -22
  18. package/dist/chunks/languages-WXMF4GOF.js.map +7 -0
  19. package/dist/chunks/{package-LG5H7BBM.js → package-YXRZQAOV.js} +5 -14
  20. package/dist/chunks/package-YXRZQAOV.js.map +7 -0
  21. package/dist/index.ts +20 -55
  22. package/dist/index.ts.map +2 -2
  23. package/package.json +60 -61
  24. package/skills/configuring-pi-starship/scripts/apply.mjs +43 -47
  25. package/skills/configuring-pi-starship/scripts/config-path.mjs +3 -3
  26. package/skills/configuring-pi-starship/scripts/script-support.mjs +6 -6
  27. package/skills/configuring-pi-starship/scripts/validate.mjs +18 -18
  28. package/src/command-configuration.ts +267 -286
  29. package/src/command-contract.ts +6 -6
  30. package/src/command-inspector.ts +27 -27
  31. package/src/command-preset-picker.ts +45 -50
  32. package/src/command-preview.ts +153 -166
  33. package/src/commands.ts +588 -618
  34. package/src/config.ts +580 -660
  35. package/src/effective-config.ts +46 -48
  36. package/src/format/formatter.ts +211 -227
  37. package/src/format/style.ts +205 -216
  38. package/src/modules/activity.ts +74 -74
  39. package/src/modules/brand.ts +9 -9
  40. package/src/modules/cache.ts +18 -18
  41. package/src/modules/catalog.ts +79 -83
  42. package/src/modules/cloud.ts +54 -54
  43. package/src/modules/context.ts +27 -27
  44. package/src/modules/cost.ts +23 -23
  45. package/src/modules/deployment.ts +45 -45
  46. package/src/modules/development.ts +80 -81
  47. package/src/modules/directory.ts +89 -113
  48. package/src/modules/display.ts +9 -9
  49. package/src/modules/execution.ts +62 -69
  50. package/src/modules/extension-status.ts +59 -64
  51. package/src/modules/fill.ts +10 -10
  52. package/src/modules/git/branch.ts +26 -26
  53. package/src/modules/git/commit.ts +21 -23
  54. package/src/modules/git/metrics.ts +22 -22
  55. package/src/modules/git/runtime.ts +299 -334
  56. package/src/modules/git/state.ts +17 -17
  57. package/src/modules/git/status.ts +77 -79
  58. package/src/modules/git/worktree.ts +10 -12
  59. package/src/modules/github-pr.ts +20 -20
  60. package/src/modules/helpers.ts +3 -3
  61. package/src/modules/index.ts +21 -21
  62. package/src/modules/inspection.ts +101 -108
  63. package/src/modules/languages.ts +52 -59
  64. package/src/modules/model.ts +57 -67
  65. package/src/modules/package.ts +12 -12
  66. package/src/modules/provider.ts +22 -24
  67. package/src/modules/render.ts +124 -140
  68. package/src/modules/thinking.ts +27 -26
  69. package/src/modules/time.ts +10 -13
  70. package/src/modules/tokens.ts +13 -13
  71. package/src/modules/truncation.ts +14 -17
  72. package/src/modules/turn.ts +9 -9
  73. package/src/modules/types.ts +125 -132
  74. package/src/modules/workspace-helpers.ts +4 -7
  75. package/src/pi-starship.ts +567 -603
  76. package/src/presets/catalog.ts +113 -113
  77. package/src/runtime/cloud.ts +122 -150
  78. package/src/runtime/command.ts +106 -108
  79. package/src/runtime/deployment.ts +150 -179
  80. package/src/runtime/development.ts +107 -124
  81. package/src/runtime/execution.ts +110 -124
  82. package/src/runtime/github-pr.ts +223 -252
  83. package/src/runtime/helpers.ts +186 -199
  84. package/src/runtime/languages.ts +149 -180
  85. package/src/runtime/package.ts +74 -87
  86. package/src/runtime/refresh-controller.ts +82 -86
  87. package/src/runtime/types.ts +38 -38
  88. package/src/runtime/workspace.ts +108 -116
  89. package/src/usage.ts +40 -40
  90. package/dist/chunks/chunk-EOGXAMTA.js.map +0 -7
  91. package/dist/chunks/chunk-P4XMFSQW.js.map +0 -7
  92. package/dist/chunks/chunk-UX6PBXVK.js.map +0 -7
  93. package/dist/chunks/cloud-BKHYWCTA.js.map +0 -7
  94. package/dist/chunks/commands-53ZO2JUK.js.map +0 -7
  95. package/dist/chunks/deployment-RKKOEQQ2.js.map +0 -7
  96. package/dist/chunks/development-BERD42HW.js.map +0 -7
  97. package/dist/chunks/execution-42JTEY3N.js.map +0 -7
  98. package/dist/chunks/languages-RMP6DW7H.js.map +0 -7
  99. package/dist/chunks/package-LG5H7BBM.js.map +0 -7
@@ -2,36 +2,37 @@ import type { ThinkingLevel } from "@earendil-works/pi-agent-core";
2
2
  import { defineModule } from "./types.js";
3
3
 
4
4
  const THINKING_LEVELS = [
5
- "off",
6
- "minimal",
7
- "low",
8
- "medium",
9
- "high",
10
- "xhigh",
11
- "max",
5
+ "off",
6
+ "minimal",
7
+ "low",
8
+ "medium",
9
+ "high",
10
+ "xhigh",
11
+ "max",
12
12
  ] as const satisfies readonly ThinkingLevel[];
13
13
 
14
14
  function thinkingLevelOf(value: string): ThinkingLevel | undefined {
15
- return THINKING_LEVELS.find((level) => level === value);
15
+ return THINKING_LEVELS.find((level) => level === value);
16
16
  }
17
17
 
18
18
  export const thinkingModule = defineModule({
19
- name: "thinking",
20
- variables: ["symbol", "level"],
21
- defaults: {
22
- format: "[$symbol $level ]($style)",
23
- symbol: "🧠",
24
- style: "bold purple",
25
- disabled: false,
26
- },
27
- styleDefaults: Object.fromEntries(
28
- THINKING_LEVELS.map((level) => [`style_${level}`, ""]),
29
- ) as Record<`style_${ThinkingLevel}`, string>,
30
- fallbackStyle: true,
31
- styleVariables: ["style"],
32
- resolveStyleVariables: ({ runtime, styles, style }) => {
33
- const level = thinkingLevelOf(runtime.thinkingLevel);
34
- return { style: (level && styles[`style_${level}`]) || style };
35
- },
36
- values: ({ runtime }) => ({ level: runtime.thinkingLevel }),
19
+ name: "thinking",
20
+ variables: ["symbol", "level"],
21
+ defaults: {
22
+ format: "[$symbol $level ]($style)",
23
+ symbol: "🧠",
24
+ style: "bold purple",
25
+ disabled: false,
26
+ },
27
+ styleDefaults: Object.fromEntries(THINKING_LEVELS.map((level) => [`style_${level}`, ""])) as Record<
28
+ `style_${ThinkingLevel}`,
29
+ string
30
+ >,
31
+ fallbackStyle: true,
32
+ styleVariables: ["style"],
33
+ resolveStyleVariables: ({ runtime, styles, style }) => {
34
+ const level = thinkingLevelOf(runtime.thinkingLevel);
35
+ return { style: (level && styles[`style_${level}`]) || style };
36
+ },
37
+ values: ({ runtime }) => ({ level: runtime.thinkingLevel }),
37
38
  });
@@ -1,20 +1,17 @@
1
1
  import { defineModule } from "./types.js";
2
2
 
3
3
  export const timeModule = defineModule({
4
- name: "time",
5
- variables: ["symbol", "time"],
6
- defaults: {
7
- format: "[$symbol $time ]($style)",
8
- symbol: "🕒",
9
- style: "bold yellow",
10
- disabled: false,
11
- },
12
- values: ({ runtime }) => ({ time: formatTime(runtime.now) }),
4
+ name: "time",
5
+ variables: ["symbol", "time"],
6
+ defaults: {
7
+ format: "[$symbol $time ]($style)",
8
+ symbol: "🕒",
9
+ style: "bold yellow",
10
+ disabled: false,
11
+ },
12
+ values: ({ runtime }) => ({ time: formatTime(runtime.now) }),
13
13
  });
14
14
 
15
15
  function formatTime(now: Date): string {
16
- return `${now.getHours().toString().padStart(2, "0")}:${now
17
- .getMinutes()
18
- .toString()
19
- .padStart(2, "0")}`;
16
+ return `${now.getHours().toString().padStart(2, "0")}:${now.getMinutes().toString().padStart(2, "0")}`;
20
17
  }
@@ -2,17 +2,17 @@ import { formatCount } from "./helpers.js";
2
2
  import { defineModule } from "./types.js";
3
3
 
4
4
  export const tokensModule = defineModule({
5
- name: "tokens",
6
- variables: ["symbol", "input", "output", "total"],
7
- defaults: {
8
- format: "[$symbol ↑$input ↓$output ]($style)",
9
- symbol: "🔢",
10
- style: "bold cyan",
11
- disabled: false,
12
- },
13
- values: ({ runtime }) => ({
14
- input: formatCount(runtime.tokenTotals.input),
15
- output: formatCount(runtime.tokenTotals.output),
16
- total: formatCount(runtime.tokenTotals.input + runtime.tokenTotals.output),
17
- }),
5
+ name: "tokens",
6
+ variables: ["symbol", "input", "output", "total"],
7
+ defaults: {
8
+ format: "[$symbol ↑$input ↓$output ]($style)",
9
+ symbol: "🔢",
10
+ style: "bold cyan",
11
+ disabled: false,
12
+ },
13
+ values: ({ runtime }) => ({
14
+ input: formatCount(runtime.tokenTotals.input),
15
+ output: formatCount(runtime.tokenTotals.output),
16
+ total: formatCount(runtime.tokenTotals.input + runtime.tokenTotals.output),
17
+ }),
18
18
  });
@@ -3,35 +3,32 @@ import { sep } from "node:path";
3
3
  const graphemeSegmenter = new Intl.Segmenter(undefined, { granularity: "grapheme" });
4
4
 
5
5
  export function graphemes(value: string): string[] {
6
- return [...graphemeSegmenter.segment(value)].map(({ segment }) => segment);
6
+ return [...graphemeSegmenter.segment(value)].map(({ segment }) => segment);
7
7
  }
8
8
 
9
9
  export function firstGrapheme(value: string): string {
10
- return graphemes(value)[0] ?? "";
10
+ return graphemes(value)[0] ?? "";
11
11
  }
12
12
 
13
13
  export function truncateLeadingGraphemes(value: string, length: number, symbol: string): string {
14
- if (length <= 0) return value;
15
- const parts = graphemes(value);
16
- if (parts.length <= length) return value;
17
- return `${parts.slice(0, length).join("")}${firstGrapheme(symbol)}`;
14
+ if (length <= 0) return value;
15
+ const parts = graphemes(value);
16
+ if (parts.length <= length) return value;
17
+ return `${parts.slice(0, length).join("")}${firstGrapheme(symbol)}`;
18
18
  }
19
19
 
20
20
  export function toSlashPath(value: string): string {
21
- return sep === "\\" ? value.replaceAll("\\", "/") : value;
21
+ return sep === "\\" ? value.replaceAll("\\", "/") : value;
22
22
  }
23
23
 
24
- export function truncatePathComponents(
25
- value: string,
26
- length: number,
27
- ): { value: string; truncated: boolean } {
28
- if (length <= 0) return { value, truncated: false };
29
- const normalized = toSlashPath(value);
30
- const components = normalized.split("/").filter((component) => component.length > 0);
31
- if (components.length <= length) return { value: normalized, truncated: false };
32
- return { value: components.slice(-length).join("/"), truncated: true };
24
+ export function truncatePathComponents(value: string, length: number): { value: string; truncated: boolean } {
25
+ if (length <= 0) return { value, truncated: false };
26
+ const normalized = toSlashPath(value);
27
+ const components = normalized.split("/").filter((component) => component.length > 0);
28
+ if (components.length <= length) return { value: normalized, truncated: false };
29
+ return { value: components.slice(-length).join("/"), truncated: true };
33
30
  }
34
31
 
35
32
  export function useNativePathSeparator(value: string): string {
36
- return sep === "/" ? value : value.replaceAll("/", sep);
33
+ return sep === "/" ? value : value.replaceAll("/", sep);
37
34
  }
@@ -1,13 +1,13 @@
1
1
  import { defineModule } from "./types.js";
2
2
 
3
3
  export const turnModule = defineModule({
4
- name: "turn",
5
- variables: ["symbol", "count"],
6
- defaults: {
7
- format: "[$symbol #$count ]($style)",
8
- symbol: "🔁",
9
- style: "bold purple",
10
- disabled: false,
11
- },
12
- values: ({ runtime }) => ({ count: `${runtime.turnCount}` }),
4
+ name: "turn",
5
+ variables: ["symbol", "count"],
6
+ defaults: {
7
+ format: "[$symbol #$count ]($style)",
8
+ symbol: "🔁",
9
+ style: "bold purple",
10
+ disabled: false,
11
+ },
12
+ values: ({ runtime }) => ({ count: `${runtime.turnCount}` }),
13
13
  });
@@ -2,191 +2,184 @@ import type { UIPromptKind } from "@earendil-works/pi-coding-agent";
2
2
  import type { StyledChunk } from "../format/style.js";
3
3
 
4
4
  export interface GitBranchSnapshot {
5
- name: string;
6
- remoteName?: string;
7
- remoteBranch?: string;
8
- detached: boolean;
5
+ name: string;
6
+ remoteName?: string;
7
+ remoteBranch?: string;
8
+ detached: boolean;
9
9
  }
10
10
 
11
11
  export interface GitCommitSnapshot {
12
- hash: string;
13
- tag?: string;
14
- detached: boolean;
12
+ hash: string;
13
+ tag?: string;
14
+ detached: boolean;
15
15
  }
16
16
 
17
17
  export interface GitStateSnapshot {
18
- state: string;
19
- progressCurrent?: number;
20
- progressTotal?: number;
18
+ state: string;
19
+ progressCurrent?: number;
20
+ progressTotal?: number;
21
21
  }
22
22
 
23
23
  export interface GitMetricsSnapshot {
24
- added: number;
25
- deleted: number;
24
+ added: number;
25
+ deleted: number;
26
26
  }
27
27
 
28
28
  export interface GitStatusSnapshot {
29
- ahead: number;
30
- behind: number;
31
- stashed: number;
32
- conflicted: number;
33
- deleted: number;
34
- renamed: number;
35
- modified: number;
36
- staged: number;
37
- typechanged: number;
38
- untracked: number;
39
- worktreeAdded: number;
40
- worktreeDeleted: number;
41
- worktreeModified: number;
42
- worktreeTypechanged: number;
43
- indexAdded: number;
44
- indexDeleted: number;
45
- indexModified: number;
46
- indexTypechanged: number;
29
+ ahead: number;
30
+ behind: number;
31
+ stashed: number;
32
+ conflicted: number;
33
+ deleted: number;
34
+ renamed: number;
35
+ modified: number;
36
+ staged: number;
37
+ typechanged: number;
38
+ untracked: number;
39
+ worktreeAdded: number;
40
+ worktreeDeleted: number;
41
+ worktreeModified: number;
42
+ worktreeTypechanged: number;
43
+ indexAdded: number;
44
+ indexDeleted: number;
45
+ indexModified: number;
46
+ indexTypechanged: number;
47
47
  }
48
48
 
49
49
  export interface GitWorktreeSnapshot {
50
- name: string;
51
- path: string;
50
+ name: string;
51
+ path: string;
52
52
  }
53
53
 
54
54
  export type GithubPrState = "open" | "draft" | "merged" | "closed";
55
55
 
56
56
  export interface GithubPrSnapshot {
57
- readonly number: string;
58
- readonly link: string;
59
- readonly state: GithubPrState;
60
- readonly checks: string;
61
- readonly review: string;
62
- readonly status: string;
63
- readonly expiresAt?: number;
57
+ readonly number: string;
58
+ readonly link: string;
59
+ readonly state: GithubPrState;
60
+ readonly checks: string;
61
+ readonly review: string;
62
+ readonly status: string;
63
+ readonly expiresAt?: number;
64
64
  }
65
65
 
66
66
  export interface GitSnapshot {
67
- root?: string;
68
- branch?: GitBranchSnapshot;
69
- commit?: GitCommitSnapshot;
70
- state?: GitStateSnapshot;
71
- metrics?: GitMetricsSnapshot;
72
- status: GitStatusSnapshot;
73
- worktree?: GitWorktreeSnapshot;
67
+ root?: string;
68
+ branch?: GitBranchSnapshot;
69
+ commit?: GitCommitSnapshot;
70
+ state?: GitStateSnapshot;
71
+ metrics?: GitMetricsSnapshot;
72
+ status: GitStatusSnapshot;
73
+ worktree?: GitWorktreeSnapshot;
74
74
  }
75
75
 
76
76
  export interface WorkspaceSnapshot {
77
- modules: Readonly<Record<string, Readonly<Record<string, string>>>>;
78
- styleSelectors?: Readonly<Record<string, string>>;
77
+ modules: Readonly<Record<string, Readonly<Record<string, string>>>>;
78
+ styleSelectors?: Readonly<Record<string, string>>;
79
79
  }
80
80
 
81
81
  export interface StarshipRuntimeSnapshot {
82
- cwd: string;
83
- homeDir?: string;
84
- gitRoot?: string;
85
- model?: { provider: string; id: string };
86
- thinkingLevel: string;
87
- turnCount: number;
88
- activeTools: ReadonlyMap<string, number>;
89
- isStreaming: boolean;
90
- uiPrompt?: { kind: UIPromptKind; title?: string };
91
- lastCompletedTool?: string;
92
- contextUsage?: {
93
- percent?: number | null;
94
- tokens?: number | null;
95
- contextWindow?: number | null;
96
- };
97
- tokenTotals: {
98
- input: number;
99
- output: number;
100
- cacheRead: number;
101
- cacheWrite: number;
102
- cost: number;
103
- latestCacheHitRate?: number;
104
- };
105
- usingSubscription: boolean;
106
- gitBranch: string | null;
107
- gitBranchDetails?: GitBranchSnapshot;
108
- gitCommit?: GitCommitSnapshot;
109
- gitState?: GitStateSnapshot;
110
- gitMetrics?: GitMetricsSnapshot;
111
- gitStatus?: GitStatusSnapshot;
112
- gitWorktree?: GitWorktreeSnapshot;
113
- githubPr?: GithubPrSnapshot;
114
- extensionStatuses: ReadonlyMap<string, string>;
115
- now: Date;
116
- workspace?: WorkspaceSnapshot;
82
+ cwd: string;
83
+ homeDir?: string;
84
+ gitRoot?: string;
85
+ model?: { provider: string; id: string };
86
+ thinkingLevel: string;
87
+ turnCount: number;
88
+ activeTools: ReadonlyMap<string, number>;
89
+ isStreaming: boolean;
90
+ uiPrompt?: { kind: UIPromptKind; title?: string };
91
+ lastCompletedTool?: string;
92
+ contextUsage?: {
93
+ percent?: number | null;
94
+ tokens?: number | null;
95
+ contextWindow?: number | null;
96
+ };
97
+ tokenTotals: {
98
+ input: number;
99
+ output: number;
100
+ cacheRead: number;
101
+ cacheWrite: number;
102
+ cost: number;
103
+ latestCacheHitRate?: number;
104
+ };
105
+ usingSubscription: boolean;
106
+ gitBranch: string | null;
107
+ gitBranchDetails?: GitBranchSnapshot;
108
+ gitCommit?: GitCommitSnapshot;
109
+ gitState?: GitStateSnapshot;
110
+ gitMetrics?: GitMetricsSnapshot;
111
+ gitStatus?: GitStatusSnapshot;
112
+ gitWorktree?: GitWorktreeSnapshot;
113
+ githubPr?: GithubPrSnapshot;
114
+ extensionStatuses: ReadonlyMap<string, string>;
115
+ now: Date;
116
+ workspace?: WorkspaceSnapshot;
117
117
  }
118
118
 
119
119
  export interface ExtensionStatusPresentation {
120
- separator: string;
121
- maxStatuses: number;
122
- icons: Readonly<Record<string, string>>;
120
+ separator: string;
121
+ maxStatuses: number;
122
+ icons: Readonly<Record<string, string>>;
123
123
  }
124
124
 
125
- export type ModuleOptionValue =
126
- | string
127
- | boolean
128
- | number
129
- | readonly string[]
130
- | Readonly<Record<string, string>>;
125
+ export type ModuleOptionValue = string | boolean | number | readonly string[] | Readonly<Record<string, string>>;
131
126
 
132
127
  export interface ModuleValueContext {
133
- runtime: StarshipRuntimeSnapshot;
134
- symbol: string;
135
- options: Readonly<Record<string, ModuleOptionValue>>;
136
- extensionStatus: ExtensionStatusPresentation;
128
+ runtime: StarshipRuntimeSnapshot;
129
+ symbol: string;
130
+ options: Readonly<Record<string, ModuleOptionValue>>;
131
+ extensionStatus: ExtensionStatusPresentation;
137
132
  }
138
133
 
139
134
  export type ModuleOptionSchema =
140
- | { kind: "string"; default: string; allowEmpty?: boolean }
141
- | { kind: "string-enum"; default: string; values: readonly string[] }
142
- | { kind: "boolean"; default: boolean }
143
- | { kind: "integer"; default: number; minimum: number; maximum: number }
144
- | { kind: "string-array"; default: readonly string[]; allowNegative?: boolean }
145
- | { kind: "string-map"; default: Readonly<Record<string, string>> };
135
+ | { kind: "string"; default: string; allowEmpty?: boolean }
136
+ | { kind: "string-enum"; default: string; values: readonly string[] }
137
+ | { kind: "boolean"; default: boolean }
138
+ | { kind: "integer"; default: number; minimum: number; maximum: number }
139
+ | { kind: "string-array"; default: readonly string[]; allowNegative?: boolean }
140
+ | { kind: "string-map"; default: Readonly<Record<string, string>> };
146
141
 
147
142
  export interface ModuleDisplayConfig {
148
- threshold: number;
149
- style: string;
150
- hidden: boolean;
143
+ threshold: number;
144
+ style: string;
145
+ hidden: boolean;
151
146
  }
152
147
 
153
148
  export interface ModuleDefaults {
154
- format: string;
155
- symbol: string;
156
- style: string;
157
- disabled: boolean;
149
+ format: string;
150
+ symbol: string;
151
+ style: string;
152
+ disabled: boolean;
158
153
  }
159
154
 
160
155
  export interface ModuleStyleContext {
161
- runtime: StarshipRuntimeSnapshot;
162
- values: Readonly<Record<string, string>>;
163
- style: string;
164
- styles: Readonly<Record<string, string>>;
165
- display: readonly ModuleDisplayConfig[];
156
+ runtime: StarshipRuntimeSnapshot;
157
+ values: Readonly<Record<string, string>>;
158
+ style: string;
159
+ styles: Readonly<Record<string, string>>;
160
+ display: readonly ModuleDisplayConfig[];
166
161
  }
167
162
 
168
163
  export interface ModuleDefinition<Name extends string> {
169
- name: Name;
170
- variables: readonly string[];
171
- defaults: ModuleDefaults;
172
- styleDefaults?: Readonly<Record<string, string>>;
173
- fallbackStyle?: boolean;
174
- displayDefaults?: readonly ModuleDisplayConfig[];
175
- styleVariables?: readonly string[];
176
- resolveStyleVariables?(context: ModuleStyleContext): Readonly<Record<string, string>> | undefined;
177
- options?: Readonly<Record<string, ModuleOptionSchema>>;
178
- layout?: "fill";
179
- values(context: ModuleValueContext): Record<string, string> | undefined;
164
+ name: Name;
165
+ variables: readonly string[];
166
+ defaults: ModuleDefaults;
167
+ styleDefaults?: Readonly<Record<string, string>>;
168
+ fallbackStyle?: boolean;
169
+ displayDefaults?: readonly ModuleDisplayConfig[];
170
+ styleVariables?: readonly string[];
171
+ resolveStyleVariables?(context: ModuleStyleContext): Readonly<Record<string, string>> | undefined;
172
+ options?: Readonly<Record<string, ModuleOptionSchema>>;
173
+ layout?: "fill";
174
+ values(context: ModuleValueContext): Record<string, string> | undefined;
180
175
  }
181
176
 
182
- export function defineModule<const Name extends string>(
183
- definition: ModuleDefinition<Name>,
184
- ): ModuleDefinition<Name> {
185
- return definition;
177
+ export function defineModule<const Name extends string>(definition: ModuleDefinition<Name>): ModuleDefinition<Name> {
178
+ return definition;
186
179
  }
187
180
 
188
181
  export interface RenderedStatusline<Name extends string = string> {
189
- ansi: string;
190
- chunks: StyledChunk[];
191
- modules: Record<Name, StyledChunk[]>;
182
+ ansi: string;
183
+ chunks: StyledChunk[];
184
+ modules: Record<Name, StyledChunk[]>;
192
185
  }
@@ -1,10 +1,7 @@
1
1
  import type { ModuleValueContext } from "./types.js";
2
2
 
3
- export function workspaceModuleValues(
4
- name: string,
5
- context: ModuleValueContext,
6
- ): Record<string, string> | undefined {
7
- const values = context.runtime.workspace?.modules[name];
8
- if (!values) return undefined;
9
- return { ...values };
3
+ export function workspaceModuleValues(name: string, context: ModuleValueContext): Record<string, string> | undefined {
4
+ const values = context.runtime.workspace?.modules[name];
5
+ if (!values) return undefined;
6
+ return { ...values };
10
7
  }