@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.
- package/README.md +2 -0
- package/dist/chunks/{chunk-UX6PBXVK.js → chunk-SD7TUSSU.js} +113 -113
- package/dist/chunks/chunk-SD7TUSSU.js.map +7 -0
- package/dist/chunks/{chunk-P4XMFSQW.js → chunk-YWY5RIDQ.js} +3 -7
- package/dist/chunks/chunk-YWY5RIDQ.js.map +7 -0
- package/dist/chunks/{chunk-EOGXAMTA.js → chunk-ZQZSXXPI.js} +1 -1
- package/dist/chunks/chunk-ZQZSXXPI.js.map +7 -0
- package/dist/chunks/{cloud-BKHYWCTA.js → cloud-C4VU3TX3.js} +7 -14
- package/dist/chunks/cloud-C4VU3TX3.js.map +7 -0
- package/dist/chunks/{commands-53ZO2JUK.js → commands-MJCAK6JL.js} +18 -42
- package/dist/chunks/commands-MJCAK6JL.js.map +7 -0
- package/dist/chunks/{deployment-RKKOEQQ2.js → deployment-FMNTYRBW.js} +6 -21
- package/dist/chunks/deployment-FMNTYRBW.js.map +7 -0
- package/dist/chunks/{development-BERD42HW.js → development-OUYXDPBS.js} +4 -8
- package/dist/chunks/development-OUYXDPBS.js.map +7 -0
- package/dist/chunks/{execution-42JTEY3N.js → execution-HJOGLMWD.js} +3 -3
- package/dist/chunks/execution-HJOGLMWD.js.map +7 -0
- package/dist/chunks/{languages-RMP6DW7H.js → languages-WXMF4GOF.js} +6 -22
- package/dist/chunks/languages-WXMF4GOF.js.map +7 -0
- package/dist/chunks/{package-LG5H7BBM.js → package-YXRZQAOV.js} +5 -14
- package/dist/chunks/package-YXRZQAOV.js.map +7 -0
- package/dist/index.ts +20 -55
- package/dist/index.ts.map +2 -2
- package/package.json +60 -61
- package/skills/configuring-pi-starship/SKILL.md +18 -4
- package/skills/configuring-pi-starship/references/configuration.md +70 -2
- package/skills/configuring-pi-starship/references/module-catalog.md +21 -0
- package/skills/configuring-pi-starship/references/modules.md +2 -0
- package/skills/configuring-pi-starship/scripts/apply.mjs +48 -47
- package/skills/configuring-pi-starship/scripts/backup.mjs +118 -0
- package/skills/configuring-pi-starship/scripts/config-path.mjs +3 -3
- package/skills/configuring-pi-starship/scripts/script-support.mjs +6 -6
- package/skills/configuring-pi-starship/scripts/validate.mjs +18 -18
- package/src/command-configuration.ts +267 -286
- package/src/command-contract.ts +6 -6
- package/src/command-inspector.ts +27 -27
- package/src/command-preset-picker.ts +45 -50
- package/src/command-preview.ts +153 -166
- package/src/commands.ts +590 -618
- package/src/config.ts +635 -660
- package/src/effective-config.ts +49 -48
- package/src/format/formatter.ts +211 -227
- package/src/format/style.ts +205 -216
- package/src/modules/activity.ts +74 -74
- package/src/modules/brand.ts +9 -9
- package/src/modules/cache.ts +18 -18
- package/src/modules/catalog.ts +79 -83
- package/src/modules/cloud.ts +54 -54
- package/src/modules/context.ts +27 -27
- package/src/modules/cost.ts +23 -23
- package/src/modules/deployment.ts +45 -45
- package/src/modules/development.ts +80 -81
- package/src/modules/directory.ts +89 -113
- package/src/modules/display.ts +9 -9
- package/src/modules/execution.ts +62 -69
- package/src/modules/extension-status.ts +59 -64
- package/src/modules/fill.ts +10 -10
- package/src/modules/git/branch.ts +26 -26
- package/src/modules/git/commit.ts +21 -23
- package/src/modules/git/metrics.ts +22 -22
- package/src/modules/git/runtime.ts +299 -334
- package/src/modules/git/state.ts +17 -17
- package/src/modules/git/status.ts +77 -79
- package/src/modules/git/worktree.ts +10 -12
- package/src/modules/github-pr.ts +20 -20
- package/src/modules/helpers.ts +3 -3
- package/src/modules/index.ts +21 -21
- package/src/modules/inspection.ts +105 -108
- package/src/modules/languages.ts +52 -59
- package/src/modules/model.ts +61 -67
- package/src/modules/package.ts +12 -12
- package/src/modules/provider.ts +25 -24
- package/src/modules/render.ts +131 -141
- package/src/modules/style-rules.ts +21 -0
- package/src/modules/thinking.ts +31 -26
- package/src/modules/time.ts +10 -13
- package/src/modules/tokens.ts +13 -13
- package/src/modules/truncation.ts +14 -17
- package/src/modules/turn.ts +9 -9
- package/src/modules/types.ts +133 -132
- package/src/modules/workspace-helpers.ts +4 -7
- package/src/pi-starship.ts +567 -603
- package/src/presets/catalog.ts +113 -113
- package/src/runtime/cloud.ts +122 -150
- package/src/runtime/command.ts +106 -108
- package/src/runtime/deployment.ts +150 -179
- package/src/runtime/development.ts +107 -124
- package/src/runtime/execution.ts +110 -124
- package/src/runtime/github-pr.ts +223 -252
- package/src/runtime/helpers.ts +186 -199
- package/src/runtime/languages.ts +149 -180
- package/src/runtime/package.ts +74 -87
- package/src/runtime/refresh-controller.ts +82 -86
- package/src/runtime/types.ts +38 -38
- package/src/runtime/workspace.ts +108 -116
- package/src/usage.ts +40 -40
- package/dist/chunks/chunk-EOGXAMTA.js.map +0 -7
- package/dist/chunks/chunk-P4XMFSQW.js.map +0 -7
- package/dist/chunks/chunk-UX6PBXVK.js.map +0 -7
- package/dist/chunks/cloud-BKHYWCTA.js.map +0 -7
- package/dist/chunks/commands-53ZO2JUK.js.map +0 -7
- package/dist/chunks/deployment-RKKOEQQ2.js.map +0 -7
- package/dist/chunks/development-BERD42HW.js.map +0 -7
- package/dist/chunks/execution-42JTEY3N.js.map +0 -7
- package/dist/chunks/languages-RMP6DW7H.js.map +0 -7
- package/dist/chunks/package-LG5H7BBM.js.map +0 -7
package/src/modules/types.ts
CHANGED
|
@@ -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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
name: string;
|
|
6
|
+
remoteName?: string;
|
|
7
|
+
remoteBranch?: string;
|
|
8
|
+
detached: boolean;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export interface GitCommitSnapshot {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
hash: string;
|
|
13
|
+
tag?: string;
|
|
14
|
+
detached: boolean;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface GitStateSnapshot {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
state: string;
|
|
19
|
+
progressCurrent?: number;
|
|
20
|
+
progressTotal?: number;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export interface GitMetricsSnapshot {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
added: number;
|
|
25
|
+
deleted: number;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export interface GitStatusSnapshot {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
51
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
78
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
format: string;
|
|
155
|
+
symbol: string;
|
|
156
|
+
style: string;
|
|
157
|
+
disabled: boolean;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
export interface ModuleStyleContext {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
-
|
|
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
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
}
|