@hasna/statusline 0.0.2 → 0.0.4

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.
@@ -14,12 +14,34 @@ export interface StatusContext {
14
14
  };
15
15
  transcriptPath?: string;
16
16
  sessionId?: string;
17
+ /** Thread title the user set with `/rename`; absent until they do. */
18
+ sessionName?: string;
17
19
  version?: string;
18
20
  outputStyle?: string;
21
+ /** Reasoning effort level, on models that expose one. */
22
+ effort?: string;
23
+ /** Whether extended thinking is on. */
24
+ thinking?: boolean;
25
+ /** Rate-limit windows, present only once the host reports limit data. */
26
+ rateLimits?: {
27
+ fiveHour?: {
28
+ usedPercentage?: number;
29
+ };
30
+ sevenDay?: {
31
+ usedPercentage?: number;
32
+ };
33
+ };
19
34
  }
35
+ /** ANSI hints a segment can ask the renderer for. */
36
+ export type SegmentColor = "cyan" | "magenta" | "blue" | "green" | "yellow" | "red" | "bold" | "dim";
20
37
  export interface Segment {
21
38
  id: string;
22
39
  description: string;
23
40
  defaultEnabled: boolean;
41
+ /**
42
+ * Colour applied by the renderer when colours are on. A function lets a
43
+ * segment escalate with its value (e.g. a limit gauge turning red).
44
+ */
45
+ color?: SegmentColor | ((ctx: StatusContext) => SegmentColor | null);
24
46
  render(ctx: StatusContext): Promise<string | null> | string | null;
25
47
  }
package/dist/render.d.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  import type { StatusContext } from "./providers/types.js";
2
2
  import type { StatuslineConfig } from "./config.js";
3
- /** Render the configured segments; a failing segment is dropped, never fatal. */
3
+ /**
4
+ * Render the configured segments; a failing segment is dropped, never fatal.
5
+ * A `newline` id starts a new row (hosts render each stdout line as its own
6
+ * row); rows that end up empty are dropped rather than rendered blank.
7
+ */
4
8
  export declare function renderLine(ctx: StatusContext, cfg: StatuslineConfig): Promise<string>;
@@ -0,0 +1,11 @@
1
+ type Env = Record<string, string | undefined>;
2
+ /**
3
+ * Fast mode is a per-config-dir agent setting (`fastMode` in that dir's
4
+ * `settings.json`, toggled with `/fast`). The statusline payload does not
5
+ * carry it, so it is read from the same config dir that names the session's
6
+ * account — per-process via `CLAUDE_CONFIG_DIR`, like everything in
7
+ * `accounts.ts`, so concurrent sessions under different profiles never
8
+ * report each other's toggle.
9
+ */
10
+ export declare function sessionFastMode(env?: Env): boolean;
11
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hasna/statusline",
3
- "version": "0.0.2",
4
- "description": "Tiny composable statusline CLI for AI coding agents — pre-built toggleable segments for Claude Code, with a provider model for others",
3
+ "version": "0.0.4",
4
+ "description": "Tiny composable statusline CLI for AI coding agents \u2014 pre-built toggleable segments for Claude Code, with a provider model for others",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
@@ -60,11 +60,11 @@
60
60
  "bun": ">=1.0.0"
61
61
  },
62
62
  "dependencies": {
63
- "@modelcontextprotocol/sdk": "^1.12.1",
64
- "zod": "^3.25.76"
63
+ "@modelcontextprotocol/sdk": "1.12.1",
64
+ "zod": "3.25.76"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@types/bun": "^1.2.4",
68
- "typescript": "^5.7.3"
68
+ "typescript": "5.9.3"
69
69
  }
70
70
  }