devflow-kit 1.7.0 → 1.8.1

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.
Files changed (197) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +31 -1
  3. package/dist/cli.js +3 -1
  4. package/dist/commands/hud.d.ts +22 -0
  5. package/dist/commands/hud.js +180 -0
  6. package/dist/commands/init.d.ts +2 -12
  7. package/dist/commands/init.js +362 -181
  8. package/dist/commands/list.js +1 -0
  9. package/dist/commands/uninstall.js +9 -16
  10. package/dist/hud/cache.d.ts +14 -0
  11. package/dist/hud/cache.js +54 -0
  12. package/dist/hud/colors.d.ts +23 -0
  13. package/dist/hud/colors.js +62 -0
  14. package/dist/hud/components/config-counts.d.ts +8 -0
  15. package/dist/hud/components/config-counts.js +91 -0
  16. package/dist/hud/components/context-usage.d.ts +8 -0
  17. package/dist/hud/components/context-usage.js +49 -0
  18. package/dist/hud/components/diff-stats.d.ts +3 -0
  19. package/dist/hud/components/diff-stats.js +36 -0
  20. package/dist/hud/components/directory.d.ts +3 -0
  21. package/dist/hud/components/directory.js +10 -0
  22. package/dist/hud/components/git-ahead-behind.d.ts +3 -0
  23. package/dist/hud/components/git-ahead-behind.js +16 -0
  24. package/dist/hud/components/git-branch.d.ts +3 -0
  25. package/dist/hud/components/git-branch.js +14 -0
  26. package/dist/hud/components/model.d.ts +3 -0
  27. package/dist/hud/components/model.js +21 -0
  28. package/dist/hud/components/release-info.d.ts +3 -0
  29. package/dist/hud/components/release-info.js +9 -0
  30. package/dist/hud/components/session-cost.d.ts +3 -0
  31. package/dist/hud/components/session-cost.js +9 -0
  32. package/dist/hud/components/session-duration.d.ts +3 -0
  33. package/dist/hud/components/session-duration.js +18 -0
  34. package/dist/hud/components/todo-progress.d.ts +3 -0
  35. package/dist/hud/components/todo-progress.js +11 -0
  36. package/dist/hud/components/usage-quota.d.ts +3 -0
  37. package/dist/hud/components/usage-quota.js +45 -0
  38. package/dist/hud/components/version-badge.d.ts +3 -0
  39. package/dist/hud/components/version-badge.js +80 -0
  40. package/dist/hud/components/worktree-count.d.ts +3 -0
  41. package/dist/hud/components/worktree-count.js +8 -0
  42. package/dist/hud/config.d.ts +10 -0
  43. package/dist/hud/config.js +55 -0
  44. package/dist/hud/credentials.d.ts +17 -0
  45. package/dist/hud/credentials.js +99 -0
  46. package/dist/hud/git.d.ts +7 -0
  47. package/dist/hud/git.js +153 -0
  48. package/dist/hud/index.d.ts +2 -0
  49. package/dist/hud/index.js +81 -0
  50. package/dist/hud/render.d.ts +7 -0
  51. package/dist/hud/render.js +111 -0
  52. package/dist/hud/stdin.d.ts +6 -0
  53. package/dist/hud/stdin.js +25 -0
  54. package/dist/hud/transcript.d.ts +7 -0
  55. package/dist/hud/transcript.js +130 -0
  56. package/dist/hud/types.d.ts +116 -0
  57. package/dist/hud/types.js +2 -0
  58. package/dist/hud/usage-api.d.ts +7 -0
  59. package/dist/hud/usage-api.js +84 -0
  60. package/dist/utils/manifest.d.ts +1 -0
  61. package/dist/utils/post-install.d.ts +8 -1
  62. package/dist/utils/post-install.js +41 -0
  63. package/package.json +5 -2
  64. package/plugins/devflow-accessibility/.claude-plugin/plugin.json +1 -1
  65. package/plugins/devflow-ambient/.claude-plugin/plugin.json +1 -1
  66. package/plugins/devflow-ambient/agents/scrutinizer.md +6 -4
  67. package/plugins/devflow-ambient/agents/shepherd.md +26 -12
  68. package/plugins/devflow-ambient/agents/simplifier.md +24 -15
  69. package/plugins/devflow-audit-claude/.claude-plugin/plugin.json +1 -1
  70. package/plugins/devflow-code-review/.claude-plugin/plugin.json +1 -1
  71. package/plugins/devflow-core-skills/.claude-plugin/plugin.json +1 -1
  72. package/plugins/devflow-debug/.claude-plugin/plugin.json +1 -1
  73. package/plugins/devflow-frontend-design/.claude-plugin/plugin.json +1 -1
  74. package/plugins/devflow-go/.claude-plugin/plugin.json +1 -1
  75. package/plugins/devflow-implement/.claude-plugin/plugin.json +1 -1
  76. package/plugins/devflow-implement/agents/scrutinizer.md +6 -4
  77. package/plugins/devflow-implement/agents/shepherd.md +26 -12
  78. package/plugins/devflow-implement/agents/simplifier.md +24 -15
  79. package/plugins/devflow-implement/skills/self-review/references/stub-detection.md +135 -0
  80. package/plugins/devflow-java/.claude-plugin/plugin.json +1 -1
  81. package/plugins/devflow-python/.claude-plugin/plugin.json +1 -1
  82. package/plugins/devflow-react/.claude-plugin/plugin.json +1 -1
  83. package/plugins/devflow-resolve/.claude-plugin/plugin.json +1 -1
  84. package/plugins/devflow-resolve/agents/simplifier.md +24 -15
  85. package/plugins/devflow-rust/.claude-plugin/plugin.json +1 -1
  86. package/plugins/devflow-self-review/.claude-plugin/plugin.json +1 -1
  87. package/plugins/devflow-self-review/agents/scrutinizer.md +6 -4
  88. package/plugins/devflow-self-review/agents/simplifier.md +24 -15
  89. package/plugins/devflow-self-review/skills/self-review/references/stub-detection.md +135 -0
  90. package/plugins/devflow-specify/.claude-plugin/plugin.json +1 -1
  91. package/plugins/devflow-typescript/.claude-plugin/plugin.json +1 -1
  92. package/scripts/hud/cache.d.ts +14 -0
  93. package/scripts/hud/cache.d.ts.map +1 -0
  94. package/scripts/hud/cache.js +54 -0
  95. package/scripts/hud/cache.js.map +1 -0
  96. package/scripts/hud/colors.d.ts +23 -0
  97. package/scripts/hud/colors.d.ts.map +1 -0
  98. package/scripts/hud/colors.js +62 -0
  99. package/scripts/hud/colors.js.map +1 -0
  100. package/scripts/hud/components/config-counts.d.ts +8 -0
  101. package/scripts/hud/components/config-counts.d.ts.map +1 -0
  102. package/scripts/hud/components/config-counts.js +91 -0
  103. package/scripts/hud/components/config-counts.js.map +1 -0
  104. package/scripts/hud/components/context-usage.d.ts +8 -0
  105. package/scripts/hud/components/context-usage.d.ts.map +1 -0
  106. package/scripts/hud/components/context-usage.js +49 -0
  107. package/scripts/hud/components/context-usage.js.map +1 -0
  108. package/scripts/hud/components/diff-stats.d.ts +3 -0
  109. package/scripts/hud/components/diff-stats.d.ts.map +1 -0
  110. package/scripts/hud/components/diff-stats.js +36 -0
  111. package/scripts/hud/components/diff-stats.js.map +1 -0
  112. package/scripts/hud/components/directory.d.ts +3 -0
  113. package/scripts/hud/components/directory.d.ts.map +1 -0
  114. package/scripts/hud/components/directory.js +10 -0
  115. package/scripts/hud/components/directory.js.map +1 -0
  116. package/scripts/hud/components/git-ahead-behind.d.ts +3 -0
  117. package/scripts/hud/components/git-ahead-behind.d.ts.map +1 -0
  118. package/scripts/hud/components/git-ahead-behind.js +16 -0
  119. package/scripts/hud/components/git-ahead-behind.js.map +1 -0
  120. package/scripts/hud/components/git-branch.d.ts +3 -0
  121. package/scripts/hud/components/git-branch.d.ts.map +1 -0
  122. package/scripts/hud/components/git-branch.js +14 -0
  123. package/scripts/hud/components/git-branch.js.map +1 -0
  124. package/scripts/hud/components/model.d.ts +3 -0
  125. package/scripts/hud/components/model.d.ts.map +1 -0
  126. package/scripts/hud/components/model.js +21 -0
  127. package/scripts/hud/components/model.js.map +1 -0
  128. package/scripts/hud/components/release-info.d.ts +3 -0
  129. package/scripts/hud/components/release-info.d.ts.map +1 -0
  130. package/scripts/hud/components/release-info.js +9 -0
  131. package/scripts/hud/components/release-info.js.map +1 -0
  132. package/scripts/hud/components/session-cost.d.ts +3 -0
  133. package/scripts/hud/components/session-cost.d.ts.map +1 -0
  134. package/scripts/hud/components/session-cost.js +9 -0
  135. package/scripts/hud/components/session-cost.js.map +1 -0
  136. package/scripts/hud/components/session-duration.d.ts +3 -0
  137. package/scripts/hud/components/session-duration.d.ts.map +1 -0
  138. package/scripts/hud/components/session-duration.js +18 -0
  139. package/scripts/hud/components/session-duration.js.map +1 -0
  140. package/scripts/hud/components/todo-progress.d.ts +3 -0
  141. package/scripts/hud/components/todo-progress.d.ts.map +1 -0
  142. package/scripts/hud/components/todo-progress.js +11 -0
  143. package/scripts/hud/components/todo-progress.js.map +1 -0
  144. package/scripts/hud/components/usage-quota.d.ts +3 -0
  145. package/scripts/hud/components/usage-quota.d.ts.map +1 -0
  146. package/scripts/hud/components/usage-quota.js +45 -0
  147. package/scripts/hud/components/usage-quota.js.map +1 -0
  148. package/scripts/hud/components/version-badge.d.ts +3 -0
  149. package/scripts/hud/components/version-badge.d.ts.map +1 -0
  150. package/scripts/hud/components/version-badge.js +80 -0
  151. package/scripts/hud/components/version-badge.js.map +1 -0
  152. package/scripts/hud/components/worktree-count.d.ts +3 -0
  153. package/scripts/hud/components/worktree-count.d.ts.map +1 -0
  154. package/scripts/hud/components/worktree-count.js +8 -0
  155. package/scripts/hud/components/worktree-count.js.map +1 -0
  156. package/scripts/hud/config.d.ts +10 -0
  157. package/scripts/hud/config.d.ts.map +1 -0
  158. package/scripts/hud/config.js +55 -0
  159. package/scripts/hud/config.js.map +1 -0
  160. package/scripts/hud/credentials.d.ts +17 -0
  161. package/scripts/hud/credentials.d.ts.map +1 -0
  162. package/scripts/hud/credentials.js +99 -0
  163. package/scripts/hud/credentials.js.map +1 -0
  164. package/scripts/hud/git.d.ts +7 -0
  165. package/scripts/hud/git.d.ts.map +1 -0
  166. package/scripts/hud/git.js +153 -0
  167. package/scripts/hud/git.js.map +1 -0
  168. package/scripts/hud/index.d.ts +2 -0
  169. package/scripts/hud/index.d.ts.map +1 -0
  170. package/scripts/hud/index.js +81 -0
  171. package/scripts/hud/index.js.map +1 -0
  172. package/scripts/hud/render.d.ts +7 -0
  173. package/scripts/hud/render.d.ts.map +1 -0
  174. package/scripts/hud/render.js +111 -0
  175. package/scripts/hud/render.js.map +1 -0
  176. package/scripts/hud/stdin.d.ts +6 -0
  177. package/scripts/hud/stdin.d.ts.map +1 -0
  178. package/scripts/hud/stdin.js +25 -0
  179. package/scripts/hud/stdin.js.map +1 -0
  180. package/scripts/hud/transcript.d.ts +7 -0
  181. package/scripts/hud/transcript.d.ts.map +1 -0
  182. package/scripts/hud/transcript.js +130 -0
  183. package/scripts/hud/transcript.js.map +1 -0
  184. package/scripts/hud/types.d.ts +116 -0
  185. package/scripts/hud/types.d.ts.map +1 -0
  186. package/scripts/hud/types.js +2 -0
  187. package/scripts/hud/types.js.map +1 -0
  188. package/scripts/hud/usage-api.d.ts +7 -0
  189. package/scripts/hud/usage-api.d.ts.map +1 -0
  190. package/scripts/hud/usage-api.js +84 -0
  191. package/scripts/hud/usage-api.js.map +1 -0
  192. package/scripts/hud.sh +5 -0
  193. package/shared/agents/scrutinizer.md +6 -4
  194. package/shared/agents/shepherd.md +26 -12
  195. package/shared/agents/simplifier.md +24 -15
  196. package/shared/skills/self-review/references/stub-detection.md +135 -0
  197. package/src/templates/settings.json +1 -1
@@ -0,0 +1,135 @@
1
+ # Stub Detection Patterns
2
+
3
+ Placeholder implementations that compile but don't deliver real functionality. Flag as **P0-Functionality** issues.
4
+
5
+ Cross-reference: `core-patterns/references/code-smell-violations.md` covers hardcoded data and fake functionality labeling. This file focuses on structural stub patterns.
6
+
7
+ ---
8
+
9
+ ## 1. Component Stubs
10
+
11
+ Render nothing meaningful or return placeholder markup.
12
+
13
+ ```tsx
14
+ // STUB — returns static text, no real rendering
15
+ function UserProfile({ userId }: Props) {
16
+ return <div>Name</div>;
17
+ }
18
+
19
+ // REAL — fetches and renders actual data
20
+ function UserProfile({ userId }: Props) {
21
+ const user = useUser(userId);
22
+ if (!user) return <Skeleton />;
23
+ return <div><h2>{user.name}</h2><p>{user.email}</p></div>;
24
+ }
25
+ ```
26
+
27
+ **Patterns to flag:**
28
+ - `return null` / `return <></>` in components that should render content
29
+ - Empty function bodies (`{}`) for handlers or lifecycle methods
30
+ - Components returning only hardcoded strings with no data binding
31
+
32
+ ---
33
+
34
+ ## 2. API / Service Stubs
35
+
36
+ Functions that exist in signature but throw, return hardcoded values, or do nothing.
37
+
38
+ ```typescript
39
+ // STUB — throws instead of implementing
40
+ async function createOrder(items: CartItem[]): Promise<Order> {
41
+ throw new Error("TODO: implement");
42
+ }
43
+
44
+ // STUB — hardcoded return, no real logic
45
+ async function getUser(id: string): Promise<User> {
46
+ return { id, name: "Test User", email: "test@test.com" };
47
+ }
48
+
49
+ // REAL — actual implementation
50
+ async function createOrder(items: CartItem[]): Promise<Result<Order, OrderError>> {
51
+ const validated = validateItems(items);
52
+ if (!validated.ok) return validated;
53
+ const order = await db.orders.create({ items: validated.value });
54
+ await queue.publish("order.created", order);
55
+ return { ok: true, value: order };
56
+ }
57
+ ```
58
+
59
+ **Patterns to flag:**
60
+ - `throw new Error("TODO")` / `throw new Error("Not implemented")`
61
+ - Functions returning hardcoded objects (no DB/API/computation)
62
+ - `"Not implemented"` strings in response bodies
63
+ - Empty async functions (`async function foo() {}`)
64
+
65
+ ---
66
+
67
+ ## 3. Hook / Effect Stubs
68
+
69
+ State and effects declared but not wired to behavior.
70
+
71
+ ```typescript
72
+ // STUB — effect does nothing
73
+ useEffect(() => {}, [userId]);
74
+
75
+ // STUB — state declared, setter never called
76
+ const [items, setItems] = useState<Item[]>([]);
77
+ // ... setItems never appears in the component
78
+
79
+ // STUB — custom hook returns static value
80
+ function usePermissions(): Permissions {
81
+ return { canEdit: true, canDelete: false };
82
+ }
83
+
84
+ // REAL — custom hook with actual logic
85
+ function usePermissions(): Permissions {
86
+ const { user } = useAuth();
87
+ const { data } = useQuery(["permissions", user.role], fetchPermissions);
88
+ return data ?? DEFAULT_PERMISSIONS;
89
+ }
90
+ ```
91
+
92
+ **Patterns to flag:**
93
+ - `useEffect(() => {}, [...])` — empty effect body
94
+ - `useState` where the setter is never called in the component
95
+ - Custom hooks returning static/hardcoded values
96
+ - `useMemo`/`useCallback` wrapping static values
97
+
98
+ ---
99
+
100
+ ## 4. Wiring Gaps
101
+
102
+ Individual pieces exist but aren't connected to the running application. **Highest-value detection** — these pass compilation and individual tests but the feature doesn't work end-to-end.
103
+
104
+ ```typescript
105
+ // GAP — fetch without await (result discarded)
106
+ function loadDashboard() {
107
+ fetchMetrics(); // Promise floats, never awaited
108
+ return <Dashboard />;
109
+ }
110
+
111
+ // GAP — state declared but never rendered
112
+ const [error, setError] = useState<string | null>(null);
113
+ // ... error never appears in JSX
114
+
115
+ // GAP — handler defined but not bound
116
+ function handleSubmit(data: FormData) { /* real logic */ }
117
+ // ... <form onSubmit={handleSubmit}> never appears
118
+
119
+ // GAP — route defined with no-op handler
120
+ app.post("/api/orders", (_req, res) => {
121
+ res.status(200).json({ ok: true });
122
+ });
123
+
124
+ // GAP — env var read but unused
125
+ const API_KEY = process.env.STRIPE_API_KEY;
126
+ // ... API_KEY never passed to any client or fetch call
127
+ ```
128
+
129
+ **Patterns to flag:**
130
+ - `fetch`/`axios`/API call without `await` or `.then` (result discarded)
131
+ - State variable (`useState`, `useRef`) never rendered or read in output
132
+ - Event handler defined but not bound to any element/listener
133
+ - Route/endpoint registered with empty or no-op handler
134
+ - Environment variable or config read but never used downstream
135
+ - Import used only in type position but imported as value (in non-type-only import)
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Dean0x"
6
6
  },
7
- "version": "1.7.0",
7
+ "version": "1.8.1",
8
8
  "homepage": "https://github.com/dean0x/devflow",
9
9
  "repository": "https://github.com/dean0x/devflow",
10
10
  "license": "MIT",
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Dean0x"
6
6
  },
7
- "version": "1.7.0",
7
+ "version": "1.8.1",
8
8
  "homepage": "https://github.com/dean0x/devflow",
9
9
  "repository": "https://github.com/dean0x/devflow",
10
10
  "license": "MIT",
@@ -0,0 +1,14 @@
1
+ export declare function getCacheDir(): string;
2
+ /**
3
+ * Read a cached value. Returns null if missing or expired.
4
+ */
5
+ export declare function readCache<T>(key: string): T | null;
6
+ /**
7
+ * Read a cached value regardless of TTL (stale data). Returns null if missing.
8
+ */
9
+ export declare function readCacheStale<T>(key: string): T | null;
10
+ /**
11
+ * Write a value to cache with a TTL in milliseconds.
12
+ */
13
+ export declare function writeCache<T>(key: string, data: T, ttlMs: number): void;
14
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/cli/hud/cache.ts"],"names":[],"mappings":"AAUA,wBAAgB,WAAW,IAAI,MAAM,CAIpC;AAoBD;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAElD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAEvD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAWvE"}
@@ -0,0 +1,54 @@
1
+ import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import { homedir } from 'node:os';
4
+ export function getCacheDir() {
5
+ const devflowDir = process.env.DEVFLOW_DIR || path.join(process.env.HOME || homedir(), '.devflow');
6
+ return path.join(devflowDir, 'cache');
7
+ }
8
+ /**
9
+ * Read a cached value. Returns null if missing or expired.
10
+ * When `ignoreExpiry` is true, returns data regardless of TTL (stale read).
11
+ */
12
+ function readCacheEntry(key, ignoreExpiry) {
13
+ try {
14
+ const filePath = path.join(getCacheDir(), `${key}.json`);
15
+ const raw = fs.readFileSync(filePath, 'utf-8');
16
+ const entry = JSON.parse(raw);
17
+ if (ignoreExpiry || Date.now() - entry.timestamp < entry.ttl) {
18
+ return entry.data;
19
+ }
20
+ return null;
21
+ }
22
+ catch {
23
+ return null;
24
+ }
25
+ }
26
+ /**
27
+ * Read a cached value. Returns null if missing or expired.
28
+ */
29
+ export function readCache(key) {
30
+ return readCacheEntry(key, false);
31
+ }
32
+ /**
33
+ * Read a cached value regardless of TTL (stale data). Returns null if missing.
34
+ */
35
+ export function readCacheStale(key) {
36
+ return readCacheEntry(key, true);
37
+ }
38
+ /**
39
+ * Write a value to cache with a TTL in milliseconds.
40
+ */
41
+ export function writeCache(key, data, ttlMs) {
42
+ try {
43
+ const dir = getCacheDir();
44
+ if (!fs.existsSync(dir)) {
45
+ fs.mkdirSync(dir, { recursive: true });
46
+ }
47
+ const entry = { data, timestamp: Date.now(), ttl: ttlMs };
48
+ fs.writeFileSync(path.join(dir, `${key}.json`), JSON.stringify(entry));
49
+ }
50
+ catch {
51
+ // Cache write failure is non-fatal
52
+ }
53
+ }
54
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/cli/hud/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAQlC,MAAM,UAAU,WAAW;IACzB,MAAM,UAAU,GACd,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,EAAE,EAAE,UAAU,CAAC,CAAC;IAClF,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAI,GAAW,EAAE,YAAqB;IAC3D,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC;QACzD,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB,CAAC;QAC/C,IAAI,YAAY,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;YAC7D,OAAO,KAAK,CAAC,IAAI,CAAC;QACpB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAI,GAAW;IACtC,OAAO,cAAc,CAAI,GAAG,EAAE,KAAK,CAAC,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAI,GAAW;IAC3C,OAAO,cAAc,CAAI,GAAG,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAI,GAAW,EAAE,IAAO,EAAE,KAAa;IAC/D,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,WAAW,EAAE,CAAC;QAC1B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,CAAC;QACD,MAAM,KAAK,GAAkB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;QACzE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,mCAAmC;IACrC,CAAC;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * ANSI color helpers — no dependencies, precompiled escape sequences.
3
+ * Used by HUD components for direct terminal output (not @clack/prompts).
4
+ */
5
+ export declare function bold(s: string): string;
6
+ export declare function dim(s: string): string;
7
+ export declare function red(s: string): string;
8
+ export declare function green(s: string): string;
9
+ export declare function yellow(s: string): string;
10
+ export declare function blue(s: string): string;
11
+ export declare function magenta(s: string): string;
12
+ export declare function cyan(s: string): string;
13
+ export declare function gray(s: string): string;
14
+ export declare function white(s: string): string;
15
+ export declare function orange(s: string): string;
16
+ export declare function brightRed(s: string): string;
17
+ export declare function boldRed(s: string): string;
18
+ export declare function bgGreen(s: string): string;
19
+ export declare function bgYellow(s: string): string;
20
+ export declare function bgRed(s: string): string;
21
+ export declare function truncate(s: string, max: number): string;
22
+ export declare function stripAnsi(s: string): string;
23
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/cli/hud/colors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtC;AACD,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAErC;AACD,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAErC;AACD,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvC;AACD,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAExC;AACD,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtC;AACD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC;AACD,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtC;AACD,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtC;AACD,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvC;AACD,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAExC;AACD,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3C;AACD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC;AACD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC;AACD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1C;AACD,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvC;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD;AAID,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3C"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * ANSI color helpers — no dependencies, precompiled escape sequences.
3
+ * Used by HUD components for direct terminal output (not @clack/prompts).
4
+ */
5
+ const ESC = '\x1b[';
6
+ const RESET = `${ESC}0m`;
7
+ export function bold(s) {
8
+ return `${ESC}1m${s}${RESET}`;
9
+ }
10
+ export function dim(s) {
11
+ return `${ESC}2m${s}${RESET}`;
12
+ }
13
+ export function red(s) {
14
+ return `${ESC}31m${s}${RESET}`;
15
+ }
16
+ export function green(s) {
17
+ return `${ESC}32m${s}${RESET}`;
18
+ }
19
+ export function yellow(s) {
20
+ return `${ESC}33m${s}${RESET}`;
21
+ }
22
+ export function blue(s) {
23
+ return `${ESC}34m${s}${RESET}`;
24
+ }
25
+ export function magenta(s) {
26
+ return `${ESC}35m${s}${RESET}`;
27
+ }
28
+ export function cyan(s) {
29
+ return `${ESC}36m${s}${RESET}`;
30
+ }
31
+ export function gray(s) {
32
+ return `${ESC}90m${s}${RESET}`;
33
+ }
34
+ export function white(s) {
35
+ return `${ESC}37m${s}${RESET}`;
36
+ }
37
+ export function orange(s) {
38
+ return `${ESC}38;5;208m${s}${RESET}`;
39
+ }
40
+ export function brightRed(s) {
41
+ return `${ESC}91m${s}${RESET}`;
42
+ }
43
+ export function boldRed(s) {
44
+ return `${ESC}1;31m${s}${RESET}`;
45
+ }
46
+ export function bgGreen(s) {
47
+ return `${ESC}42m${s}${RESET}`;
48
+ }
49
+ export function bgYellow(s) {
50
+ return `${ESC}43m${s}${RESET}`;
51
+ }
52
+ export function bgRed(s) {
53
+ return `${ESC}41m${s}${RESET}`;
54
+ }
55
+ export function truncate(s, max) {
56
+ return s.length > max ? s.slice(0, max - 1) + '\u2026' : s;
57
+ }
58
+ const ANSI_PATTERN = /\x1b\[[0-9;]*m/g;
59
+ export function stripAnsi(s) {
60
+ return s.replace(ANSI_PATTERN, '');
61
+ }
62
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/cli/hud/colors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,GAAG,GAAG,OAAO,CAAC;AACpB,MAAM,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC;AAEzB,MAAM,UAAU,IAAI,CAAC,CAAS;IAC5B,OAAO,GAAG,GAAG,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC;AAChC,CAAC;AACD,MAAM,UAAU,GAAG,CAAC,CAAS;IAC3B,OAAO,GAAG,GAAG,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC;AAChC,CAAC;AACD,MAAM,UAAU,GAAG,CAAC,CAAS;IAC3B,OAAO,GAAG,GAAG,MAAM,CAAC,GAAG,KAAK,EAAE,CAAC;AACjC,CAAC;AACD,MAAM,UAAU,KAAK,CAAC,CAAS;IAC7B,OAAO,GAAG,GAAG,MAAM,CAAC,GAAG,KAAK,EAAE,CAAC;AACjC,CAAC;AACD,MAAM,UAAU,MAAM,CAAC,CAAS;IAC9B,OAAO,GAAG,GAAG,MAAM,CAAC,GAAG,KAAK,EAAE,CAAC;AACjC,CAAC;AACD,MAAM,UAAU,IAAI,CAAC,CAAS;IAC5B,OAAO,GAAG,GAAG,MAAM,CAAC,GAAG,KAAK,EAAE,CAAC;AACjC,CAAC;AACD,MAAM,UAAU,OAAO,CAAC,CAAS;IAC/B,OAAO,GAAG,GAAG,MAAM,CAAC,GAAG,KAAK,EAAE,CAAC;AACjC,CAAC;AACD,MAAM,UAAU,IAAI,CAAC,CAAS;IAC5B,OAAO,GAAG,GAAG,MAAM,CAAC,GAAG,KAAK,EAAE,CAA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AE,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ComponentResult, GatherContext, ConfigCountsData } from '../types.js';
2
+ /**
3
+ * Gather configuration counts for the configCounts component.
4
+ * Exported for use by the main HUD entry point.
5
+ */
6
+ export declare function gatherConfigCounts(cwd: string): ConfigCountsData;
7
+ export default function configCounts(ctx: GatherContext): Promise<ComponentResult | null>;
8
+ //# sourceMappingURL=config-counts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-counts.d.ts","sourceRoot":"","sources":["../../../src/cli/hud/components/config-counts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAqCpF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAoChE;AAED,wBAA8B,YAAY,CACxC,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAejC"}
@@ -0,0 +1,91 @@
1
+ import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import { homedir } from 'node:os';
4
+ import { dim } from '../colors.js';
5
+ function countClaudeMdFiles(cwd) {
6
+ let count = 0;
7
+ // Check project CLAUDE.md
8
+ if (fs.existsSync(path.join(cwd, 'CLAUDE.md')))
9
+ count++;
10
+ // Check user CLAUDE.md
11
+ const claudeDir = process.env.CLAUDE_CONFIG_DIR ||
12
+ path.join(process.env.HOME || homedir(), '.claude');
13
+ if (fs.existsSync(path.join(claudeDir, 'CLAUDE.md')))
14
+ count++;
15
+ return count;
16
+ }
17
+ function countFromSettings(settingsPath) {
18
+ try {
19
+ const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
20
+ const mcpServers = settings.mcpServers
21
+ ? Object.keys(settings.mcpServers).length
22
+ : 0;
23
+ let hooks = 0;
24
+ if (settings.hooks) {
25
+ const hooksObj = settings.hooks;
26
+ for (const event of Object.values(hooksObj)) {
27
+ if (Array.isArray(event))
28
+ hooks += event.length;
29
+ }
30
+ }
31
+ return { mcpServers, hooks };
32
+ }
33
+ catch {
34
+ return { mcpServers: 0, hooks: 0 };
35
+ }
36
+ }
37
+ /**
38
+ * Gather configuration counts for the configCounts component.
39
+ * Exported for use by the main HUD entry point.
40
+ */
41
+ export function gatherConfigCounts(cwd) {
42
+ const claudeDir = process.env.CLAUDE_CONFIG_DIR ||
43
+ path.join(process.env.HOME || homedir(), '.claude');
44
+ const claudeMdFiles = countClaudeMdFiles(cwd);
45
+ // Count rules (.md/.mdc files in .claude/rules)
46
+ let rules = 0;
47
+ for (const rulesDir of [
48
+ path.join(cwd, '.claude', 'rules'),
49
+ path.join(claudeDir, 'rules'),
50
+ ]) {
51
+ try {
52
+ const files = fs.readdirSync(rulesDir);
53
+ rules += files.filter((f) => f.endsWith('.md') || f.endsWith('.mdc')).length;
54
+ }
55
+ catch {
56
+ /* ignore */
57
+ }
58
+ }
59
+ // Aggregate settings from user and project
60
+ const userSettings = countFromSettings(path.join(claudeDir, 'settings.json'));
61
+ const projectSettings = countFromSettings(path.join(cwd, '.claude', 'settings.json'));
62
+ return {
63
+ claudeMdFiles,
64
+ rules,
65
+ mcpServers: userSettings.mcpServers + projectSettings.mcpServers,
66
+ hooks: userSettings.hooks + projectSettings.hooks,
67
+ };
68
+ }
69
+ export default async function configCounts(ctx) {
70
+ if (!ctx.configCounts)
71
+ return null;
72
+ const { claudeMdFiles, rules: ruleCount, mcpServers, hooks: hookCount } = ctx.configCounts;
73
+ const skillCount = ctx.transcript?.skills.length ?? 0;
74
+ const parts = [];
75
+ if (claudeMdFiles > 0)
76
+ parts.push(`${claudeMdFiles} CLAUDE.md`);
77
+ if (ruleCount > 0)
78
+ parts.push(`${ruleCount} rules`);
79
+ if (mcpServers > 0)
80
+ parts.push(`${mcpServers} MCPs`);
81
+ if (hookCount > 0)
82
+ parts.push(`${hookCount} hooks`);
83
+ if (skillCount > 0)
84
+ parts.push(`${skillCount} skills`);
85
+ if (parts.length === 0)
86
+ return null;
87
+ const raw = parts.join(' \u00B7 ');
88
+ const text = parts.map((p) => dim(p)).join(dim(' \u00B7 '));
89
+ return { text, raw };
90
+ }
91
+ //# sourceMappingURL=config-counts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-counts.js","sourceRoot":"","sources":["../../../src/cli/hud/components/config-counts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,SAAS,kBAAkB,CAAC,GAAW;IACrC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,0BAA0B;IAC1B,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAAE,KAAK,EAAE,CAAC;IACxD,uBAAuB;IACvB,MAAM,SAAS,GACb,OAAO,CAAC,GAAG,CAAC,iBAAiB;QAC7B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IACtD,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAAE,KAAK,EAAE,CAAC;IAC9D,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,iBAAiB,CAAC,YAAoB;IAI7C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAA4B,CAAC;QAC/F,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU;YACpC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAq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S,QAAQ,CAAC,CAAC;IACpD,IAAI,UAAU,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,UAAU,SAAS,CAAC,CAAC;IACvD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5D,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AACvB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ComponentResult, GatherContext } from '../types.js';
2
+ /**
3
+ * Context window usage component.
4
+ * Visual bar with 3-tier color gradient matching usage-quota: green / yellow / red.
5
+ * At >85% appends token breakdown: (in: Nk).
6
+ */
7
+ export default function contextUsage(ctx: GatherContext): Promise<ComponentResult | null>;
8
+ //# sourceMappingURL=context-usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-usage.d.ts","sourceRoot":"","sources":["../../../src/cli/hud/components/context-usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKlE;;;;GAIG;AACH,wBAA8B,YAAY,CACxC,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CA4CjC"}
@@ -0,0 +1,49 @@
1
+ import { dim, green, yellow, red } from '../colors.js';
2
+ const BAR_WIDTH = 8;
3
+ /**
4
+ * Context window usage component.
5
+ * Visual bar with 3-tier color gradient matching usage-quota: green / yellow / red.
6
+ * At >85% appends token breakdown: (in: Nk).
7
+ */
8
+ export default async function contextUsage(ctx) {
9
+ const cw = ctx.stdin.context_window;
10
+ if (!cw)
11
+ return null;
12
+ let pct = null;
13
+ if (cw.used_percentage !== undefined) {
14
+ pct = Math.round(cw.used_percentage);
15
+ }
16
+ else if (cw.context_window_size && cw.current_usage?.input_tokens !== undefined) {
17
+ pct = Math.round((cw.current_usage.input_tokens / cw.context_window_size) * 100);
18
+ }
19
+ if (pct === null)
20
+ return null;
21
+ const filled = Math.round((pct / 100) * BAR_WIDTH);
22
+ const empty = BAR_WIDTH - filled;
23
+ let colorFn;
24
+ if (pct < 50) {
25
+ colorFn = green;
26
+ }
27
+ else if (pct < 80) {
28
+ colorFn = yellow;
29
+ }
30
+ else {
31
+ colorFn = red;
32
+ }
33
+ const filledBar = '\u2588'.repeat(filled);
34
+ const emptyBar = '\u2591'.repeat(empty);
35
+ let suffix = '';
36
+ if (pct > 85 && cw.current_usage?.input_tokens !== undefined) {
37
+ const inK = Math.round(cw.current_usage.input_tokens / 1000);
38
+ suffix = ` (in: ${inK}k)`;
39
+ }
40
+ const raw = `Current Session ${filledBar}${emptyBar} ${pct}%${suffix}`;
41
+ const text = dim('Current Session ') +
42
+ colorFn(filledBar) +
43
+ dim(emptyBar) +
44
+ ' ' +
45
+ colorFn(`${pct}%`) +
46
+ (suffix ? dim(suffix) : '');
47
+ return { text, raw };
48
+ }
49
+ //# sourceMappingURL=context-usage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-usage.js","sourceRoot":"","sources":["../../../src/cli/hud/components/context-usage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB;;;;GAIG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,YAAY,CACxC,GAAkB;IAElB,MAAM,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC;IACpC,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IAErB,IAAI,GAAG,GAAkB,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,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED,MAAM,GAAG,GAAG,mBAAmB,SAAS,GAAG,QAAQ,IAAI,GAAG,IAAI,MAAM,EAAE,CAAC;IACvE,MAAM,IAAI,GACR,GAAG,CAAC,kBAAkB,CAAC;QACvB,OAAO,CAAC,SAAS,CAAC;QAClB,GAAG,CAAC,QAAQ,CAAC;QACb,GAAG;QACH,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;QAClB,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAE9B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AACvB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ComponentResult, GatherContext } from '../types.js';
2
+ export default function diffStats(ctx: GatherContext): Promise<ComponentResult | null>;
3
+ //# sourceMappingURL=diff-stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-stats.d.ts","sourceRoot":"","sources":["../../../src/cli/hud/components/diff-stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGlE,wBAA8B,SAAS,CACrC,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CA+BjC"}
@@ -0,0 +1,36 @@
1
+ import { dim, green, red } from '../colors.js';
2
+ export default async function diffStats(ctx) {
3
+ if (!ctx.git)
4
+ return null;
5
+ const { filesChanged, additions, deletions } = ctx.git;
6
+ if (filesChanged === 0 && additions === 0 && deletions === 0)
7
+ return null;
8
+ const filePart = filesChanged > 0
9
+ ? `${filesChanged} file${filesChanged === 1 ? '' : 's'}`
10
+ : '';
11
+ const lineParts = [];
12
+ if (additions > 0)
13
+ lineParts.push(`+${additions}`);
14
+ if (deletions > 0)
15
+ lineParts.push(`-${deletions}`);
16
+ const sections = [];
17
+ const rawSections = [];
18
+ if (filePart) {
19
+ sections.push(dim(filePart));
20
+ rawSections.push(filePart);
21
+ }
22
+ if (lineParts.length > 0) {
23
+ const lineText = lineParts
24
+ .map((p) => (p.startsWith('+') ? green(p) : red(p)))
25
+ .join(' ');
26
+ sections.push(lineText);
27
+ rawSections.push(lineParts.join(' '));
28
+ }
29
+ if (sections.length === 0)
30
+ return null;
31
+ return {
32
+ text: sections.join(dim(' \u00B7 ')),
33
+ raw: rawSections.join(' \u00B7 '),
34
+ };
35
+ }
36
+ //# sourceMappingURL=diff-stats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-stats.js","sourceRoot":"","sources":["../../../src/cli/hud/components/diff-stats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS,CACrC,GAAkB;IAElB,IAAI,CAAC,GAAG,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IAC1B,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC;IACvD,IAAI,YAAY,KAAK,CAAC,IAAI,SAAS,KAAK,CAAC,IAAI,SAAS,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1E,MAAM,QAAQ,GAAG,YAAY,GAAG,CAAC;QAC/B,CAAC,CAAC,GAAG,YAAY,QAAQ,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE;QACxD,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,IAAI,SAAS,GAAG,CAAC;QAAE,SAAS,CAAC,IAAI,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC;IACnD,IAAI,SAAS,GAAG,CAAC;QAAE,SAAS,CAAC,IAAI,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC;IAEnD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,IAAI,QAAQ,EAAE,CAAC;QACb,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7B,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,SAAS;aACvB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aACnD,IAAI,CAAC,GAAG,CAAC,CAAC;QACb,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxB,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACxC,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO;QACL,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACpC,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC;KAClC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ComponentResult, GatherContext } from '../types.js';
2
+ export default function directory(ctx: GatherContext): Promise<ComponentResult | null>;
3
+ //# sourceMappingURL=directory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../../../src/cli/hud/components/directory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIlE,wBAA8B,SAAS,CACrC,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAKjC"}
@@ -0,0 +1,10 @@
1
+ import { bold, white } from '../colors.js';
2
+ import * as path from 'node:path';
3
+ export default async function directory(ctx) {
4
+ const cwd = ctx.stdin.cwd;
5
+ if (!cwd)
6
+ return null;
7
+ const name = path.basename(cwd);
8
+ return { text: bold(white(name)), raw: name };
9
+ }
10
+ //# sourceMappingURL=directory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directory.js","sourceRoot":"","sources":["../../../src/cli/hud/components/directory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS,CACrC,GAAkB;IAElB,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;IAC1B,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAChC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAChD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ComponentResult, GatherContext } from '../types.js';
2
+ export default function gitAheadBehind(ctx: GatherContext): Promise<ComponentResult | null>;
3
+ //# sourceMappingURL=git-ahead-behind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-ahead-behind.d.ts","sourceRoot":"","sources":["../../../src/cli/hud/components/git-ahead-behind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGlE,wBAA8B,cAAc,CAC1C,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CASjC"}
@@ -0,0 +1,16 @@
1
+ import { dim } from '../colors.js';
2
+ export default async function gitAheadBehind(ctx) {
3
+ if (!ctx.git)
4
+ return null;
5
+ const { ahead, behind } = ctx.git;
6
+ if (ahead === 0 && behind === 0)
7
+ return null;
8
+ const rawParts = [];
9
+ if (ahead > 0)
10
+ rawParts.push(`${ahead}\u2191`);
11
+ if (behind > 0)
12
+ rawParts.push(`${behind}\u2193`);
13
+ const raw = rawParts.join(' ');
14
+ return { text: dim(raw), raw };
15
+ }
16
+ //# sourceMappingURL=git-ahead-behind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-ahead-behind.js","sourceRoot":"","sources":["../../../src/cli/hud/components/git-ahead-behind.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,cAAc,CAC1C,GAAkB;IAElB,IAAI,CAAC,GAAG,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IAC1B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC;IAClC,IAAI,KAAK,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7C,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,KAAK,GAAG,CAAC;QAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC;IAC/C,IAAI,MAAM,GAAG,CAAC;QAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC;IACjD,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ComponentResult, GatherContext } from '../types.js';
2
+ export default function gitBranch(ctx: GatherContext): Promise<ComponentResult | null>;
3
+ //# sourceMappingURL=git-branch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-branch.d.ts","sourceRoot":"","sources":["../../../src/cli/hud/components/git-branch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGlE,wBAA8B,SAAS,CACrC,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAWjC"}
@@ -0,0 +1,14 @@
1
+ import { white, yellow, green } from '../colors.js';
2
+ export default async function gitBranch(ctx) {
3
+ if (!ctx.git)
4
+ return null;
5
+ const dirtyMark = ctx.git.dirty ? '*' : '';
6
+ const stagedMark = ctx.git.staged ? '+' : '';
7
+ const indicator = dirtyMark + stagedMark;
8
+ const text = white(ctx.git.branch) +
9
+ (dirtyMark ? yellow(dirtyMark) : '') +
10
+ (stagedMark ? green(stagedMark) : '');
11
+ const raw = ctx.git.branch + indicator;
12
+ return { text, raw };
13
+ }
14
+ //# sourceMappingURL=git-branch.js.map