60 lines
1.6 KiB
TypeScript
60 lines
1.6 KiB
TypeScript
import type { ExtensionContext, ReadonlyFooterDataProvider } from "@mariozechner/pi-coding-agent";
|
|
import type { UsageLimit, UsageReport } from "./usage";
|
|
|
|
export type ModuleName = "directory" | "context" | "model" | "thinking" | "cost" | "usage";
|
|
export type UsageWindow = "current" | "week" | "both";
|
|
export type UsageStyle = "line" | "text" | "miniBar";
|
|
export type UsageTextPart = "percent" | "time" | "used" | "limit" | "remaining";
|
|
|
|
export type ModuleSpec = ModuleName | {
|
|
type: ModuleName;
|
|
window?: UsageWindow;
|
|
style?: UsageStyle;
|
|
grow?: number;
|
|
parts?: UsageTextPart[];
|
|
separator?: string;
|
|
};
|
|
|
|
export interface StatusbarRowConfig {
|
|
left?: ModuleSpec[];
|
|
center?: ModuleSpec[];
|
|
right?: ModuleSpec[];
|
|
}
|
|
|
|
export interface StatusbarConfig {
|
|
separator: string;
|
|
rows: StatusbarRowConfig[];
|
|
modules: {
|
|
directory?: { showGitBranch?: boolean; showSessionName?: boolean };
|
|
context?: { showWindow?: boolean };
|
|
model?: { showProvider?: boolean; showThinking?: boolean };
|
|
thinking?: { hideWhenOff?: boolean };
|
|
cost?: { showSubscription?: boolean };
|
|
usage?: { showText?: boolean; parts?: UsageTextPart[]; separator?: string; colorBars?: boolean };
|
|
};
|
|
}
|
|
|
|
export interface StatusbarState {
|
|
report?: UsageReport;
|
|
error?: string;
|
|
thinkingLevel?: string;
|
|
}
|
|
|
|
export interface ModuleContext {
|
|
ctx: ExtensionContext;
|
|
footerData: ReadonlyFooterDataProvider;
|
|
state: StatusbarState;
|
|
config: StatusbarConfig;
|
|
}
|
|
|
|
export interface RenderedModule {
|
|
text?: string;
|
|
grow?: number;
|
|
render?: (width: number, theme?: any) => string;
|
|
}
|
|
|
|
export interface UsageWindows {
|
|
current?: UsageLimit;
|
|
week?: UsageLimit;
|
|
}
|