@hasna/statusline 0.0.8 → 0.0.9
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 +13 -1
- package/dist/cli.js +122 -5
- package/dist/disk.d.ts +51 -0
- package/dist/format.d.ts +7 -0
- package/dist/index.js +122 -5
- package/dist/mcp/index.js +273 -156
- package/dist/providers/types.d.ts +9 -2
- package/package.json +1 -1
|
@@ -34,6 +34,13 @@ export interface StatusContext {
|
|
|
34
34
|
}
|
|
35
35
|
/** ANSI hints a segment can ask the renderer for. */
|
|
36
36
|
export type SegmentColor = "cyan" | "magenta" | "blue" | "green" | "yellow" | "red" | "bold" | "dim";
|
|
37
|
+
/**
|
|
38
|
+
* Scratch belonging to one `renderLine` call. It is passed to a segment's
|
|
39
|
+
* `render` and to its `color`, so a value read once can colour the text it
|
|
40
|
+
* produced without a second read. It dies with that render: there is no
|
|
41
|
+
* cross-render cache and no stale figure to show.
|
|
42
|
+
*/
|
|
43
|
+
export type RenderMemo = Map<symbol, unknown>;
|
|
37
44
|
export interface Segment {
|
|
38
45
|
id: string;
|
|
39
46
|
description: string;
|
|
@@ -42,6 +49,6 @@ export interface Segment {
|
|
|
42
49
|
* Colour applied by the renderer when colours are on. A function lets a
|
|
43
50
|
* segment escalate with its value (e.g. a limit gauge turning red).
|
|
44
51
|
*/
|
|
45
|
-
color?: SegmentColor | ((ctx: StatusContext) => SegmentColor | null);
|
|
46
|
-
render(ctx: StatusContext): Promise<string | null> | string | null;
|
|
52
|
+
color?: SegmentColor | ((ctx: StatusContext, memo?: RenderMemo) => SegmentColor | null);
|
|
53
|
+
render(ctx: StatusContext, memo?: RenderMemo): Promise<string | null> | string | null;
|
|
47
54
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/statusline",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Tiny composable statusline CLI for AI coding agents — pre-built toggleable segments for Claude Code, with a provider model for others",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|