@hasna/statusline 0.0.1 → 0.0.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.
- package/README.md +199 -22
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1025 -0
- package/dist/config.d.ts +9 -0
- package/dist/context-window.d.ts +14 -0
- package/dist/format.d.ts +4 -0
- package/dist/git.d.ts +6 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +646 -0
- package/dist/install.d.ts +5 -0
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.js +20313 -0
- package/dist/providers/claude.d.ts +7 -0
- package/dist/providers/types.d.ts +25 -0
- package/dist/render.d.ts +4 -0
- package/dist/segments/index.d.ts +3 -0
- package/package.json +34 -4
- package/src/config.ts +0 -53
- package/src/context-window.ts +0 -51
- package/src/format.ts +0 -36
- package/src/git.ts +0 -55
- package/src/index.ts +0 -143
- package/src/install.ts +0 -20
- package/src/providers/claude.ts +0 -35
- package/src/providers/types.ts +0 -23
- package/src/render.ts +0 -19
- package/src/segments/index.ts +0 -187
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface StatuslineConfig {
|
|
2
|
+
separator: string;
|
|
3
|
+
/** Ordered list of enabled segment ids. */
|
|
4
|
+
segments: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function defaultConfig(): StatuslineConfig;
|
|
7
|
+
export declare function configPath(path?: string): string;
|
|
8
|
+
export declare function loadConfig(path?: string): StatuslineConfig;
|
|
9
|
+
export declare function saveConfig(cfg: StatuslineConfig, path?: string): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StatusContext } from "./providers/types.js";
|
|
2
|
+
export interface ContextUsage {
|
|
3
|
+
/** Tokens currently occupying the context window (input side). */
|
|
4
|
+
used: number;
|
|
5
|
+
/** Output tokens of the latest assistant turn. */
|
|
6
|
+
output: number;
|
|
7
|
+
/** Context window size in tokens. */
|
|
8
|
+
window: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Derive context usage from the session transcript (JSONL). The last
|
|
12
|
+
* assistant entry's usage block reflects what the context window holds.
|
|
13
|
+
*/
|
|
14
|
+
export declare function contextUsage(ctx: StatusContext): ContextUsage | null;
|
package/dist/format.d.ts
ADDED
package/dist/git.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Minimal git helpers — every call degrades to null outside a repo. */
|
|
2
|
+
export declare function gitRoot(cwd: string): string | null;
|
|
3
|
+
export declare function gitBranch(cwd: string): string | null;
|
|
4
|
+
export declare function gitProjectName(cwd: string): string | null;
|
|
5
|
+
export declare function lastCommitEpoch(cwd: string): number | null;
|
|
6
|
+
export declare function trackedLineCount(cwd: string): number | null;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type StatuslineConfig } from "./config.js";
|
|
2
|
+
export { defaultConfig, loadConfig, saveConfig, configPath, type StatuslineConfig } from "./config.js";
|
|
3
|
+
export { contextUsage, type ContextUsage } from "./context-window.js";
|
|
4
|
+
export { compactAge, compactDuration, compactNum, money } from "./format.js";
|
|
5
|
+
export { gitBranch, gitProjectName, gitRoot, lastCommitEpoch, trackedLineCount } from "./git.js";
|
|
6
|
+
export { installClaude } from "./install.js";
|
|
7
|
+
export { parseClaudeInput } from "./providers/claude.js";
|
|
8
|
+
export type { Segment, StatusContext } from "./providers/types.js";
|
|
9
|
+
export { renderLine } from "./render.js";
|
|
10
|
+
export { getSegment, segments } from "./segments/index.js";
|
|
11
|
+
export declare const statuslineVersion: string;
|
|
12
|
+
export type SegmentInfo = {
|
|
13
|
+
id: string;
|
|
14
|
+
description: string;
|
|
15
|
+
defaultEnabled: boolean;
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type ConfigUpdateResult = {
|
|
19
|
+
config: StatuslineConfig;
|
|
20
|
+
changed: string[];
|
|
21
|
+
};
|
|
22
|
+
export declare function listSegments(config?: StatuslineConfig): SegmentInfo[];
|
|
23
|
+
export declare function requireKnownSegments(ids: string[]): string[];
|
|
24
|
+
export declare function enableSegments(ids: string[], config?: StatuslineConfig): ConfigUpdateResult;
|
|
25
|
+
export declare function disableSegments(ids: string[], config?: StatuslineConfig): ConfigUpdateResult;
|
|
26
|
+
export declare function orderSegments(ids: string[], config?: StatuslineConfig): ConfigUpdateResult;
|
|
27
|
+
export declare function setSeparator(separator: string, config?: StatuslineConfig): ConfigUpdateResult;
|
|
28
|
+
export declare function resetStatuslineConfig(): StatuslineConfig;
|
|
29
|
+
export declare function renderStatusline(input?: Record<string, unknown>, config?: StatuslineConfig): Promise<string>;
|
|
30
|
+
export declare function sampleClaudeInput(cwd?: string): Record<string, unknown>;
|
|
31
|
+
export declare function previewStatusline(config?: StatuslineConfig, cwd?: string): Promise<string>;
|
|
32
|
+
export declare function saveUpdatedConfig(result: ConfigUpdateResult, path?: string): StatuslineConfig;
|