@narumitw/pi-starship 0.55.1 → 0.56.0

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 (106) hide show
  1. package/README.md +2 -0
  2. package/dist/chunks/{chunk-UX6PBXVK.js → chunk-SD7TUSSU.js} +113 -113
  3. package/dist/chunks/chunk-SD7TUSSU.js.map +7 -0
  4. package/dist/chunks/{chunk-P4XMFSQW.js → chunk-YWY5RIDQ.js} +3 -7
  5. package/dist/chunks/chunk-YWY5RIDQ.js.map +7 -0
  6. package/dist/chunks/{chunk-EOGXAMTA.js → chunk-ZQZSXXPI.js} +1 -1
  7. package/dist/chunks/chunk-ZQZSXXPI.js.map +7 -0
  8. package/dist/chunks/{cloud-BKHYWCTA.js → cloud-C4VU3TX3.js} +7 -14
  9. package/dist/chunks/cloud-C4VU3TX3.js.map +7 -0
  10. package/dist/chunks/{commands-53ZO2JUK.js → commands-MJCAK6JL.js} +18 -42
  11. package/dist/chunks/commands-MJCAK6JL.js.map +7 -0
  12. package/dist/chunks/{deployment-RKKOEQQ2.js → deployment-FMNTYRBW.js} +6 -21
  13. package/dist/chunks/deployment-FMNTYRBW.js.map +7 -0
  14. package/dist/chunks/{development-BERD42HW.js → development-OUYXDPBS.js} +4 -8
  15. package/dist/chunks/development-OUYXDPBS.js.map +7 -0
  16. package/dist/chunks/{execution-42JTEY3N.js → execution-HJOGLMWD.js} +3 -3
  17. package/dist/chunks/execution-HJOGLMWD.js.map +7 -0
  18. package/dist/chunks/{languages-RMP6DW7H.js → languages-WXMF4GOF.js} +6 -22
  19. package/dist/chunks/languages-WXMF4GOF.js.map +7 -0
  20. package/dist/chunks/{package-LG5H7BBM.js → package-YXRZQAOV.js} +5 -14
  21. package/dist/chunks/package-YXRZQAOV.js.map +7 -0
  22. package/dist/index.ts +20 -55
  23. package/dist/index.ts.map +2 -2
  24. package/package.json +60 -61
  25. package/skills/configuring-pi-starship/SKILL.md +18 -4
  26. package/skills/configuring-pi-starship/references/configuration.md +70 -2
  27. package/skills/configuring-pi-starship/references/module-catalog.md +21 -0
  28. package/skills/configuring-pi-starship/references/modules.md +2 -0
  29. package/skills/configuring-pi-starship/scripts/apply.mjs +48 -47
  30. package/skills/configuring-pi-starship/scripts/backup.mjs +118 -0
  31. package/skills/configuring-pi-starship/scripts/config-path.mjs +3 -3
  32. package/skills/configuring-pi-starship/scripts/script-support.mjs +6 -6
  33. package/skills/configuring-pi-starship/scripts/validate.mjs +18 -18
  34. package/src/command-configuration.ts +267 -286
  35. package/src/command-contract.ts +6 -6
  36. package/src/command-inspector.ts +27 -27
  37. package/src/command-preset-picker.ts +45 -50
  38. package/src/command-preview.ts +153 -166
  39. package/src/commands.ts +590 -618
  40. package/src/config.ts +635 -660
  41. package/src/effective-config.ts +49 -48
  42. package/src/format/formatter.ts +211 -227
  43. package/src/format/style.ts +205 -216
  44. package/src/modules/activity.ts +74 -74
  45. package/src/modules/brand.ts +9 -9
  46. package/src/modules/cache.ts +18 -18
  47. package/src/modules/catalog.ts +79 -83
  48. package/src/modules/cloud.ts +54 -54
  49. package/src/modules/context.ts +27 -27
  50. package/src/modules/cost.ts +23 -23
  51. package/src/modules/deployment.ts +45 -45
  52. package/src/modules/development.ts +80 -81
  53. package/src/modules/directory.ts +89 -113
  54. package/src/modules/display.ts +9 -9
  55. package/src/modules/execution.ts +62 -69
  56. package/src/modules/extension-status.ts +59 -64
  57. package/src/modules/fill.ts +10 -10
  58. package/src/modules/git/branch.ts +26 -26
  59. package/src/modules/git/commit.ts +21 -23
  60. package/src/modules/git/metrics.ts +22 -22
  61. package/src/modules/git/runtime.ts +299 -334
  62. package/src/modules/git/state.ts +17 -17
  63. package/src/modules/git/status.ts +77 -79
  64. package/src/modules/git/worktree.ts +10 -12
  65. package/src/modules/github-pr.ts +20 -20
  66. package/src/modules/helpers.ts +3 -3
  67. package/src/modules/index.ts +21 -21
  68. package/src/modules/inspection.ts +105 -108
  69. package/src/modules/languages.ts +52 -59
  70. package/src/modules/model.ts +61 -67
  71. package/src/modules/package.ts +12 -12
  72. package/src/modules/provider.ts +25 -24
  73. package/src/modules/render.ts +131 -141
  74. package/src/modules/style-rules.ts +21 -0
  75. package/src/modules/thinking.ts +31 -26
  76. package/src/modules/time.ts +10 -13
  77. package/src/modules/tokens.ts +13 -13
  78. package/src/modules/truncation.ts +14 -17
  79. package/src/modules/turn.ts +9 -9
  80. package/src/modules/types.ts +133 -132
  81. package/src/modules/workspace-helpers.ts +4 -7
  82. package/src/pi-starship.ts +567 -603
  83. package/src/presets/catalog.ts +113 -113
  84. package/src/runtime/cloud.ts +122 -150
  85. package/src/runtime/command.ts +106 -108
  86. package/src/runtime/deployment.ts +150 -179
  87. package/src/runtime/development.ts +107 -124
  88. package/src/runtime/execution.ts +110 -124
  89. package/src/runtime/github-pr.ts +223 -252
  90. package/src/runtime/helpers.ts +186 -199
  91. package/src/runtime/languages.ts +149 -180
  92. package/src/runtime/package.ts +74 -87
  93. package/src/runtime/refresh-controller.ts +82 -86
  94. package/src/runtime/types.ts +38 -38
  95. package/src/runtime/workspace.ts +108 -116
  96. package/src/usage.ts +40 -40
  97. package/dist/chunks/chunk-EOGXAMTA.js.map +0 -7
  98. package/dist/chunks/chunk-P4XMFSQW.js.map +0 -7
  99. package/dist/chunks/chunk-UX6PBXVK.js.map +0 -7
  100. package/dist/chunks/cloud-BKHYWCTA.js.map +0 -7
  101. package/dist/chunks/commands-53ZO2JUK.js.map +0 -7
  102. package/dist/chunks/deployment-RKKOEQQ2.js.map +0 -7
  103. package/dist/chunks/development-BERD42HW.js.map +0 -7
  104. package/dist/chunks/execution-42JTEY3N.js.map +0 -7
  105. package/dist/chunks/languages-RMP6DW7H.js.map +0 -7
  106. package/dist/chunks/package-LG5H7BBM.js.map +0 -7
@@ -2,191 +2,192 @@ 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;
146
+ }
147
+
148
+ export interface ModuleStyleRule {
149
+ style: string;
150
+ selectors: Readonly<Record<string, string>>;
151
151
  }
152
152
 
153
153
  export interface ModuleDefaults {
154
- format: string;
155
- symbol: string;
156
- style: string;
157
- disabled: boolean;
154
+ format: string;
155
+ symbol: string;
156
+ style: string;
157
+ disabled: boolean;
158
158
  }
159
159
 
160
160
  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[];
161
+ runtime: StarshipRuntimeSnapshot;
162
+ values: Readonly<Record<string, string>>;
163
+ style: string;
164
+ styles: Readonly<Record<string, string>>;
165
+ display: readonly ModuleDisplayConfig[];
166
166
  }
167
167
 
168
+ export type ModuleStyleSelector = (context: ModuleStyleContext) => string | undefined;
169
+
168
170
  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;
171
+ name: Name;
172
+ variables: readonly string[];
173
+ defaults: ModuleDefaults;
174
+ styleDefaults?: Readonly<Record<string, string>>;
175
+ fallbackStyle?: boolean;
176
+ displayDefaults?: readonly ModuleDisplayConfig[];
177
+ styleVariables?: readonly string[];
178
+ styleRuleSelectors?: Readonly<Record<string, ModuleStyleSelector>>;
179
+ resolveStyleVariables?(context: ModuleStyleContext): Readonly<Record<string, string>> | undefined;
180
+ options?: Readonly<Record<string, ModuleOptionSchema>>;
181
+ layout?: "fill";
182
+ values(context: ModuleValueContext): Record<string, string> | undefined;
180
183
  }
181
184
 
182
- export function defineModule<const Name extends string>(
183
- definition: ModuleDefinition<Name>,
184
- ): ModuleDefinition<Name> {
185
- return definition;
185
+ export function defineModule<const Name extends string>(definition: ModuleDefinition<Name>): ModuleDefinition<Name> {
186
+ return definition;
186
187
  }
187
188
 
188
189
  export interface RenderedStatusline<Name extends string = string> {
189
- ansi: string;
190
- chunks: StyledChunk[];
191
- modules: Record<Name, StyledChunk[]>;
190
+ ansi: string;
191
+ chunks: StyledChunk[];
192
+ modules: Record<Name, StyledChunk[]>;
192
193
  }
@@ -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
  }