aiblueprint-cli 1.4.81 → 1.4.83

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 (90) hide show
  1. package/README.md +25 -18
  2. package/agents-config/claude-config/scripts/statusline/data/.gitignore +8 -0
  3. package/agents-config/claude-config/scripts/statusline/data/.gitkeep +0 -0
  4. package/agents-config/claude-config/scripts/statusline/defaults.json +10 -10
  5. package/agents-config/claude-config/scripts/statusline/src/commands/interactive-config.ts +118 -6
  6. package/agents-config/claude-config/scripts/statusline/src/index.ts +100 -9
  7. package/agents-config/claude-config/scripts/statusline/src/lib/config.ts +28 -2
  8. package/agents-config/claude-config/scripts/statusline/src/lib/features/limits/commands/weekly-analysis.ts +108 -0
  9. package/agents-config/claude-config/scripts/statusline/src/lib/features/limits/index.ts +164 -0
  10. package/agents-config/claude-config/scripts/statusline/src/lib/features/limits/types.ts +15 -0
  11. package/agents-config/claude-config/scripts/statusline/src/lib/features/spend/commands/migrate-to-sqlite.ts +136 -0
  12. package/agents-config/claude-config/scripts/statusline/src/lib/features/spend/commands/spend-day.ts +79 -0
  13. package/agents-config/claude-config/scripts/statusline/src/lib/features/spend/commands/spend-month.ts +66 -0
  14. package/agents-config/claude-config/scripts/statusline/src/lib/features/spend/commands/spend-project.ts +85 -0
  15. package/agents-config/claude-config/scripts/statusline/src/lib/features/spend/database.ts +395 -0
  16. package/agents-config/claude-config/scripts/statusline/src/lib/features/spend/index.ts +178 -0
  17. package/agents-config/claude-config/scripts/statusline/src/lib/features/spend/payload-logger.ts +163 -0
  18. package/agents-config/claude-config/scripts/statusline/src/lib/features/spend/types.ts +37 -0
  19. package/agents-config/claude-config/scripts/statusline/src/lib/presets.ts +13 -13
  20. package/agents-config/claude-config/scripts/statusline/statusline.config.free.json +4 -1
  21. package/agents-config/claude-config/scripts/statusline/statusline.config.json +44 -23
  22. package/agents-config/scripts/statusline/data/.gitignore +8 -0
  23. package/agents-config/scripts/statusline/data/.gitkeep +0 -0
  24. package/agents-config/scripts/statusline/defaults.json +10 -10
  25. package/agents-config/scripts/statusline/src/commands/interactive-config.ts +118 -6
  26. package/agents-config/scripts/statusline/src/index.ts +100 -9
  27. package/agents-config/scripts/statusline/src/lib/config.ts +28 -2
  28. package/agents-config/scripts/statusline/src/lib/features/limits/commands/weekly-analysis.ts +108 -0
  29. package/agents-config/scripts/statusline/src/lib/features/limits/index.ts +164 -0
  30. package/agents-config/scripts/statusline/src/lib/features/limits/types.ts +15 -0
  31. package/agents-config/scripts/statusline/src/lib/features/spend/commands/migrate-to-sqlite.ts +136 -0
  32. package/agents-config/scripts/statusline/src/lib/features/spend/commands/spend-day.ts +79 -0
  33. package/agents-config/scripts/statusline/src/lib/features/spend/commands/spend-month.ts +66 -0
  34. package/agents-config/scripts/statusline/src/lib/features/spend/commands/spend-project.ts +85 -0
  35. package/agents-config/scripts/statusline/src/lib/features/spend/database.ts +395 -0
  36. package/agents-config/scripts/statusline/src/lib/features/spend/index.ts +178 -0
  37. package/agents-config/scripts/statusline/src/lib/features/spend/payload-logger.ts +163 -0
  38. package/agents-config/scripts/statusline/src/lib/features/spend/types.ts +37 -0
  39. package/agents-config/scripts/statusline/src/lib/presets.ts +13 -13
  40. package/agents-config/scripts/statusline/statusline.config.free.json +4 -1
  41. package/agents-config/scripts/statusline/statusline.config.json +44 -23
  42. package/agents-config/skills/{agents-managers → agents-manager}/SKILL.md +1 -1
  43. package/agents-config/skills/{agents-managers → agents-manager}/references/writing-agent-prompts.md +1 -1
  44. package/agents-config/skills/apex/SKILL.md +61 -0
  45. package/agents-config/skills/appstore-connect/SKILL.md +2 -2
  46. package/agents-config/skills/{appstore-connect-setup/SKILL.md → appstore-connect/references/setup.md} +3 -6
  47. package/agents-config/skills/environments-manager/SKILL.md +6 -6
  48. package/agents-config/skills/environments-manager/examples/{claude/commands/dev.md → skills/dev/SKILL.md} +2 -1
  49. package/agents-config/skills/environments-manager/examples/{claude/commands/lint.md → skills/lint/SKILL.md} +2 -1
  50. package/agents-config/skills/environments-manager/examples/{claude/commands/test.md → skills/test/SKILL.md} +2 -1
  51. package/agents-config/skills/environments-manager/examples/{claude/commands/typecheck.md → skills/typecheck/SKILL.md} +2 -1
  52. package/agents-config/skills/environments-manager/references/claude.md +13 -9
  53. package/agents-config/skills/environments-manager/references/cursor.md +2 -2
  54. package/agents-config/skills/ios-testflight/SKILL.md +2 -2
  55. package/agents-config/{commands/prompts/prompt.md → skills/prompt/SKILL.md} +5 -0
  56. package/agents-config/{commands/prompts/tools.md → skills/tools/SKILL.md} +1 -0
  57. package/agents-config/skills/ultrathink/SKILL.md +1 -1
  58. package/agents-config/skills/use-style/SKILL.md +7 -4
  59. package/agents-config/skills/use-style/examples/luma.html +221 -0
  60. package/agents-config/skills/use-style/examples/testspirite.html +340 -0
  61. package/agents-config/skills/use-style/styles/ios-app.md +350 -0
  62. package/agents-config/skills/use-style/styles/luma.md +422 -0
  63. package/agents-config/skills/use-style/styles/new-york-times.md +1 -1
  64. package/agents-config/skills/use-style/styles/split-auth.md +2 -2
  65. package/agents-config/skills/use-style/styles/testspirite.md +397 -0
  66. package/dist/cli.js +56 -118
  67. package/package.json +1 -1
  68. package/agents-config/claude-config/scripts/.claude/commands/fix-on-my-computer.md +0 -87
  69. package/agents-config/commands/prompts/create-vitejs-app.md +0 -272
  70. package/agents-config/commands/prompts/nextjs-add-prisma-db.md +0 -136
  71. package/agents-config/commands/prompts/nextjs-setup-better-auth.md +0 -173
  72. package/agents-config/commands/prompts/nextjs-setup-project.md +0 -200
  73. package/agents-config/commands/prompts/saas-challenge-idea.md +0 -135
  74. package/agents-config/commands/prompts/saas-create-architecture.md +0 -242
  75. package/agents-config/commands/prompts/saas-create-headline.md +0 -132
  76. package/agents-config/commands/prompts/saas-create-landing-copywritting.md +0 -267
  77. package/agents-config/commands/prompts/saas-create-legals-docs.md +0 -176
  78. package/agents-config/commands/prompts/saas-create-logos.md +0 -240
  79. package/agents-config/commands/prompts/saas-create-prd.md +0 -195
  80. package/agents-config/commands/prompts/saas-create-tasks.md +0 -240
  81. package/agents-config/commands/prompts/saas-define-pricing.md +0 -293
  82. package/agents-config/commands/prompts/saas-find-domain-name.md +0 -190
  83. package/agents-config/commands/prompts/saas-implement-landing-page.md +0 -257
  84. package/agents-config/commands/prompts/setup-tmux.md +0 -160
  85. /package/agents-config/skills/{agents-managers → agents-manager}/references/agents.md +0 -0
  86. /package/agents-config/skills/{agents-managers → agents-manager}/references/context-management.md +0 -0
  87. /package/agents-config/skills/{agents-managers → agents-manager}/references/debugging-agents.md +0 -0
  88. /package/agents-config/skills/{agents-managers → agents-manager}/references/error-handling-and-recovery.md +0 -0
  89. /package/agents-config/skills/{agents-managers → agents-manager}/references/evaluation-and-testing.md +0 -0
  90. /package/agents-config/skills/{agents-managers → agents-manager}/references/orchestration-patterns.md +0 -0
@@ -0,0 +1,163 @@
1
+ import {
2
+ appendFileSync,
3
+ existsSync,
4
+ mkdirSync,
5
+ readFileSync,
6
+ writeFileSync,
7
+ } from "node:fs";
8
+ import { join } from "node:path";
9
+ import type { HookInput } from "../../types";
10
+
11
+ const DATA_DIR = join(import.meta.dir, "..", "..", "..", "..", "data");
12
+ const PAYLOADS_FILE = join(DATA_DIR, "payloads.jsonl");
13
+ const MAX_ENTRIES = 10000;
14
+
15
+ // Enable payload logging with: STATUSLINE_DEBUG=1
16
+ const DEBUG_ENABLED = process.env.STATUSLINE_DEBUG === "1";
17
+
18
+ export interface PayloadLogEntry {
19
+ event_id: string;
20
+ timestamp: string;
21
+ session_id: string;
22
+ cwd: string;
23
+ total_cost_usd: number;
24
+ total_duration_ms: number;
25
+ lines_added: number;
26
+ lines_removed: number;
27
+ model_id: string;
28
+ transcript_path: string;
29
+ context?: {
30
+ existing_session_cost?: number;
31
+ session_cumulative_counted?: number;
32
+ delta_cost?: number;
33
+ is_new_session?: boolean;
34
+ is_clear_continuation?: boolean;
35
+ is_billing_reset?: boolean;
36
+ project_max_cost?: number;
37
+ };
38
+ }
39
+
40
+ function generateEventId(): string {
41
+ return `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
42
+ }
43
+
44
+ export function appendPayloadLog(
45
+ input: HookInput,
46
+ context?: PayloadLogEntry["context"],
47
+ ): void {
48
+ if (!DEBUG_ENABLED) {
49
+ return;
50
+ }
51
+
52
+ if (!existsSync(DATA_DIR)) {
53
+ mkdirSync(DATA_DIR, { recursive: true });
54
+ }
55
+
56
+ const entry: PayloadLogEntry = {
57
+ event_id: generateEventId(),
58
+ timestamp: new Date().toISOString(),
59
+ session_id: input.session_id,
60
+ cwd: input.cwd,
61
+ total_cost_usd: input.cost.total_cost_usd,
62
+ total_duration_ms: input.cost.total_duration_ms,
63
+ lines_added: input.cost.total_lines_added,
64
+ lines_removed: input.cost.total_lines_removed,
65
+ model_id: input.model.id,
66
+ transcript_path: input.transcript_path,
67
+ ...(context && { context }),
68
+ };
69
+
70
+ const line = JSON.stringify(entry) + "\n";
71
+ appendFileSync(PAYLOADS_FILE, line);
72
+ }
73
+
74
+ export function appendPayloadLogWithContext(
75
+ input: HookInput,
76
+ existingSessionCost: number,
77
+ sessionCumulativeCounted: number,
78
+ deltaCost: number,
79
+ isNewSession: boolean,
80
+ isClearContinuation: boolean,
81
+ isBillingReset: boolean,
82
+ projectMaxCost: number,
83
+ ): void {
84
+ appendPayloadLog(input, {
85
+ existing_session_cost: existingSessionCost,
86
+ session_cumulative_counted: sessionCumulativeCounted,
87
+ delta_cost: deltaCost,
88
+ is_new_session: isNewSession,
89
+ is_clear_continuation: isClearContinuation,
90
+ is_billing_reset: isBillingReset,
91
+ project_max_cost: projectMaxCost,
92
+ });
93
+ }
94
+
95
+ export function readPayloadLogs(): PayloadLogEntry[] {
96
+ if (!existsSync(PAYLOADS_FILE)) {
97
+ return [];
98
+ }
99
+
100
+ const content = readFileSync(PAYLOADS_FILE, "utf-8");
101
+ const lines = content.trim().split("\n").filter(Boolean);
102
+
103
+ return lines.map((line) => JSON.parse(line) as PayloadLogEntry);
104
+ }
105
+
106
+ export function rotatePayloadLogs(): void {
107
+ const entries = readPayloadLogs();
108
+
109
+ if (entries.length <= MAX_ENTRIES) {
110
+ return;
111
+ }
112
+
113
+ const toKeep = entries.slice(-MAX_ENTRIES);
114
+ const content = toKeep.map((e) => JSON.stringify(e)).join("\n") + "\n";
115
+ writeFileSync(PAYLOADS_FILE, content);
116
+ }
117
+
118
+ export function getPayloadsGroupedBySession(): Map<string, PayloadLogEntry[]> {
119
+ const entries = readPayloadLogs();
120
+ const grouped = new Map<string, PayloadLogEntry[]>();
121
+
122
+ for (const entry of entries) {
123
+ const existing = grouped.get(entry.session_id) || [];
124
+ existing.push(entry);
125
+ grouped.set(entry.session_id, existing);
126
+ }
127
+
128
+ return grouped;
129
+ }
130
+
131
+ export function getTodayPayloads(): PayloadLogEntry[] {
132
+ const today = new Date().toISOString().split("T")[0];
133
+ const entries = readPayloadLogs();
134
+
135
+ return entries.filter((e) => e.timestamp.startsWith(today));
136
+ }
137
+
138
+ export function getTodayRealCost(): number {
139
+ const todayEntries = getTodayPayloads();
140
+ if (todayEntries.length === 0) return 0;
141
+
142
+ // Group by session
143
+ const sessions = new Map<string, PayloadLogEntry[]>();
144
+ for (const entry of todayEntries) {
145
+ const existing = sessions.get(entry.session_id) || [];
146
+ existing.push(entry);
147
+ sessions.set(entry.session_id, existing);
148
+ }
149
+
150
+ // Calculate real delta per session (last_cost - first_cost)
151
+ let totalRealCost = 0;
152
+ for (const [, entries] of sessions) {
153
+ const sorted = entries.sort(
154
+ (a, b) =>
155
+ new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime(),
156
+ );
157
+ const realDelta =
158
+ sorted[sorted.length - 1].total_cost_usd - sorted[0].total_cost_usd;
159
+ totalRealCost += Math.max(0, realDelta);
160
+ }
161
+
162
+ return totalRealCost;
163
+ }
@@ -0,0 +1,37 @@
1
+ export interface SessionRow {
2
+ session_id: string;
3
+ total_cost: number;
4
+ cwd: string;
5
+ date: string;
6
+ duration_ms: number;
7
+ lines_added: number;
8
+ lines_removed: number;
9
+ last_resets_at: string | null;
10
+ cumulative_counted: number;
11
+ }
12
+
13
+ export interface PeriodRow {
14
+ period_id: string;
15
+ total_cost: number;
16
+ utilization: number;
17
+ date: string;
18
+ }
19
+
20
+ export interface TrackingRow {
21
+ session_id: string;
22
+ period_id: string;
23
+ counted_cost: number;
24
+ last_session_cost: number;
25
+ }
26
+
27
+ export interface SpendSessionV2 {
28
+ session_id: string;
29
+ total_cost: number;
30
+ cwd: string;
31
+ date: string;
32
+ duration_ms: number;
33
+ lines_added: number;
34
+ lines_removed: number;
35
+ last_resets_at: string | null;
36
+ cumulative_counted: number;
37
+ }
@@ -21,7 +21,7 @@ const minimalConfig: StatuslineConfig = {
21
21
  },
22
22
  session: {
23
23
  infoSeparator: null,
24
- cost: { enabled: false, format: "decimal1" },
24
+ cost: { enabled: true, format: "decimal1" },
25
25
  duration: { enabled: false },
26
26
  tokens: { enabled: false, showMax: false, showDecimals: false },
27
27
  percentage: {
@@ -37,7 +37,7 @@ const minimalConfig: StatuslineConfig = {
37
37
  },
38
38
  },
39
39
  limits: {
40
- enabled: false,
40
+ enabled: true,
41
41
  showTimeLeft: false,
42
42
  showPacingDelta: false,
43
43
  cost: { enabled: false, format: "decimal1" },
@@ -93,7 +93,7 @@ const fullConfig: StatuslineConfig = {
93
93
  },
94
94
  session: {
95
95
  infoSeparator: null,
96
- cost: { enabled: false, format: "decimal2" },
96
+ cost: { enabled: true, format: "decimal2" },
97
97
  duration: { enabled: true },
98
98
  tokens: { enabled: true, showMax: true, showDecimals: true },
99
99
  percentage: {
@@ -109,10 +109,10 @@ const fullConfig: StatuslineConfig = {
109
109
  },
110
110
  },
111
111
  limits: {
112
- enabled: false,
113
- showTimeLeft: false,
114
- showPacingDelta: false,
115
- cost: { enabled: false, format: "decimal1" },
112
+ enabled: true,
113
+ showTimeLeft: true,
114
+ showPacingDelta: true,
115
+ cost: { enabled: true, format: "decimal1" },
116
116
  percentage: {
117
117
  enabled: true,
118
118
  showValue: true,
@@ -126,10 +126,10 @@ const fullConfig: StatuslineConfig = {
126
126
  },
127
127
  },
128
128
  weeklyUsage: {
129
- enabled: false,
130
- showTimeLeft: false,
131
- showPacingDelta: false,
132
- cost: { enabled: false, format: "decimal1" },
129
+ enabled: true,
130
+ showTimeLeft: true,
131
+ showPacingDelta: true,
132
+ cost: { enabled: true, format: "decimal1" },
133
133
  percentage: {
134
134
  enabled: true,
135
135
  showValue: true,
@@ -143,7 +143,7 @@ const fullConfig: StatuslineConfig = {
143
143
  },
144
144
  },
145
145
  dailySpend: {
146
- cost: { enabled: false, format: "decimal1" },
146
+ cost: { enabled: true, format: "decimal1" },
147
147
  },
148
148
  context: {
149
149
  ...defaultConfig.context,
@@ -153,7 +153,7 @@ const fullConfig: StatuslineConfig = {
153
153
  export const PRESETS: Preset[] = [
154
154
  {
155
155
  name: "Minimal",
156
- description: "Essential info only: percentage and branch",
156
+ description: "Essential info only: cost, percentage, branch",
157
157
  config: minimalConfig,
158
158
  },
159
159
  {
@@ -17,7 +17,7 @@
17
17
  "separator": "•",
18
18
  "session": {
19
19
  "infoSeparator": null,
20
- "cost": { "enabled": false, "format": "decimal1" },
20
+ "cost": { "enabled": true, "format": "decimal1" },
21
21
  "duration": { "enabled": true },
22
22
  "tokens": { "enabled": true, "showMax": false, "showDecimals": false },
23
23
  "percentage": {
@@ -75,5 +75,8 @@
75
75
  },
76
76
  "dailySpend": {
77
77
  "cost": { "enabled": false, "format": "decimal1" }
78
+ },
79
+ "thinking": {
80
+ "showDisabledWarning": true
78
81
  }
79
82
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "features": {
3
- "usageLimits": false,
4
- "spendTracking": false
3
+ "usageLimits": true,
4
+ "spendTracking": true
5
5
  },
6
6
  "oneLine": true,
7
7
  "showSonnetModel": false,
@@ -11,22 +11,31 @@
11
11
  "showBranch": true,
12
12
  "showDirtyIndicator": true,
13
13
  "showChanges": false,
14
- "showStaged": true,
14
+ "showStaged": false,
15
15
  "showUnstaged": true
16
16
  },
17
17
  "separator": "•",
18
18
  "session": {
19
19
  "infoSeparator": null,
20
- "cost": { "enabled": false, "format": "decimal1" },
21
- "duration": { "enabled": true },
22
- "tokens": { "enabled": true, "showMax": false, "showDecimals": false },
20
+ "cost": {
21
+ "enabled": true,
22
+ "format": "decimal1"
23
+ },
24
+ "duration": {
25
+ "enabled": false
26
+ },
27
+ "tokens": {
28
+ "enabled": false,
29
+ "showMax": false,
30
+ "showDecimals": false
31
+ },
23
32
  "percentage": {
24
33
  "enabled": true,
25
34
  "showValue": true,
26
35
  "progressBar": {
27
36
  "enabled": true,
28
- "length": 10,
29
- "style": "braille",
37
+ "length": 5,
38
+ "style": "filled",
30
39
  "color": "progressive",
31
40
  "background": "none"
32
41
  }
@@ -41,29 +50,35 @@
41
50
  },
42
51
  "limits": {
43
52
  "enabled": false,
44
- "showTimeLeft": false,
45
- "showPacingDelta": false,
46
- "cost": { "enabled": false, "format": "decimal1" },
53
+ "showTimeLeft": true,
54
+ "showPacingDelta": true,
55
+ "cost": {
56
+ "enabled": true,
57
+ "format": "decimal1"
58
+ },
47
59
  "percentage": {
48
- "enabled": false,
49
- "showValue": false,
60
+ "enabled": true,
61
+ "showValue": true,
50
62
  "progressBar": {
51
- "enabled": false,
52
- "length": 10,
53
- "style": "braille",
63
+ "enabled": true,
64
+ "length": 5,
65
+ "style": "filled",
54
66
  "color": "progressive",
55
67
  "background": "none"
56
68
  }
57
69
  }
58
70
  },
59
71
  "weeklyUsage": {
60
- "enabled": false,
61
- "showTimeLeft": false,
62
- "showPacingDelta": false,
63
- "cost": { "enabled": false, "format": "decimal1" },
64
- "percentage": {
72
+ "enabled": true,
73
+ "showTimeLeft": true,
74
+ "showPacingDelta": true,
75
+ "cost": {
65
76
  "enabled": false,
66
- "showValue": false,
77
+ "format": "decimal1"
78
+ },
79
+ "percentage": {
80
+ "enabled": true,
81
+ "showValue": true,
67
82
  "progressBar": {
68
83
  "enabled": false,
69
84
  "length": 10,
@@ -74,6 +89,12 @@
74
89
  }
75
90
  },
76
91
  "dailySpend": {
77
- "cost": { "enabled": false, "format": "decimal1" }
92
+ "cost": {
93
+ "enabled": false,
94
+ "format": "decimal1"
95
+ }
96
+ },
97
+ "thinking": {
98
+ "showDisabledWarning": true
78
99
  }
79
100
  }
@@ -0,0 +1,8 @@
1
+ # Ignore all data files
2
+ *.db
3
+ *.json
4
+
5
+ # But keep this .gitignore
6
+ !.gitignore
7
+
8
+ last_payload.txt
File without changes
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "features": {
3
- "usageLimits": false,
4
- "spendTracking": false
3
+ "usageLimits": true,
4
+ "spendTracking": true
5
5
  },
6
6
  "oneLine": true,
7
7
  "showSonnetModel": false,
@@ -17,7 +17,7 @@
17
17
  "separator": "•",
18
18
  "session": {
19
19
  "infoSeparator": null,
20
- "cost": { "enabled": false, "format": "decimal1" },
20
+ "cost": { "enabled": true, "format": "decimal1" },
21
21
  "duration": { "enabled": true },
22
22
  "tokens": { "enabled": true, "showMax": false, "showDecimals": false },
23
23
  "percentage": {
@@ -40,9 +40,9 @@
40
40
  "overheadTokens": 0
41
41
  },
42
42
  "limits": {
43
- "enabled": false,
44
- "showTimeLeft": false,
45
- "showPacingDelta": false,
43
+ "enabled": true,
44
+ "showTimeLeft": true,
45
+ "showPacingDelta": true,
46
46
  "cost": { "enabled": false, "format": "decimal1" },
47
47
  "percentage": {
48
48
  "enabled": true,
@@ -57,9 +57,9 @@
57
57
  }
58
58
  },
59
59
  "weeklyUsage": {
60
- "enabled": false,
61
- "showTimeLeft": false,
62
- "showPacingDelta": false,
60
+ "enabled": "90%",
61
+ "showTimeLeft": true,
62
+ "showPacingDelta": true,
63
63
  "cost": { "enabled": false, "format": "decimal1" },
64
64
  "percentage": {
65
65
  "enabled": true,
@@ -74,7 +74,7 @@
74
74
  }
75
75
  },
76
76
  "dailySpend": {
77
- "cost": { "enabled": false, "format": "decimal1" }
77
+ "cost": { "enabled": true, "format": "decimal1" }
78
78
  },
79
79
  "thinking": {
80
80
  "showDisabledWarning": true
@@ -2,7 +2,11 @@
2
2
 
3
3
  import { readFileSync, writeFileSync } from "node:fs";
4
4
  import { join } from "node:path";
5
- import { defaultConfig, type StatuslineConfig } from "../lib/config";
5
+ import {
6
+ defaultConfig,
7
+ loadConfig as loadStatuslineConfig,
8
+ type StatuslineConfig,
9
+ } from "../lib/config";
6
10
  import { colors } from "../lib/formatters";
7
11
  import {
8
12
  cycle,
@@ -161,6 +165,7 @@ const tabs: Tab[] = [
161
165
  id: "session",
162
166
  label: "SESSION",
163
167
  options: [
168
+ toggle("session.cost.enabled", "Cost display"),
164
169
  toggle("session.duration.enabled", "Duration"),
165
170
  toggle("session.tokens.enabled", "Token count"),
166
171
  toggle("session.tokens.showMax", " Show max", {
@@ -200,6 +205,116 @@ const tabs: Tab[] = [
200
205
  toggle("context.useUsableContextOnly", "45k buffer"),
201
206
  ],
202
207
  },
208
+ {
209
+ id: "limits",
210
+ label: "5-HOUR",
211
+ options: [
212
+ {
213
+ path: "limits.enabled",
214
+ label: "5-hour limit",
215
+ type: "cycle" as const,
216
+ choices: ["Enabled", "Disabled"],
217
+ getValue: (c) => (c.limits.enabled ? "Enabled" : "Disabled"),
218
+ cycle: (c) => {
219
+ c.limits.enabled = !c.limits.enabled;
220
+ },
221
+ },
222
+ toggle("limits.showTimeLeft", " Time remaining", {
223
+ hidden: (c) => !c.limits.enabled,
224
+ }),
225
+ toggle("limits.showPacingDelta", " Pacing delta", {
226
+ hidden: (c) => !c.limits.enabled,
227
+ }),
228
+ toggle("limits.cost.enabled", " Period cost", {
229
+ hidden: (c) => !c.limits.enabled,
230
+ }),
231
+ toggle("limits.percentage.showValue", " Show % value", {
232
+ hidden: (c) => !c.limits.enabled,
233
+ }),
234
+ progressStyleCycle("limits.percentage", (c) => !c.limits.enabled),
235
+ cycle(
236
+ "limits.percentage.progressBar.length",
237
+ " Length",
238
+ PROGRESS_BAR_LENGTHS,
239
+ {
240
+ hidden: (c) =>
241
+ !c.limits.enabled || !c.limits.percentage.progressBar.enabled,
242
+ },
243
+ ),
244
+ cycle(
245
+ "limits.percentage.progressBar.color",
246
+ " Color",
247
+ PROGRESS_BAR_COLORS,
248
+ {
249
+ hidden: (c) =>
250
+ !c.limits.enabled || !c.limits.percentage.progressBar.enabled,
251
+ },
252
+ ),
253
+ ],
254
+ },
255
+ {
256
+ id: "weekly",
257
+ label: "WEEKLY",
258
+ options: [
259
+ {
260
+ path: "weeklyUsage.enabled",
261
+ label: "Weekly limit",
262
+ type: "cycle" as const,
263
+ choices: ["Always", "At 90%", "Never"],
264
+ getValue: (c) => {
265
+ if (c.weeklyUsage.enabled === true) return "Always";
266
+ if (c.weeklyUsage.enabled === "90%") return "At 90%";
267
+ return "Never";
268
+ },
269
+ cycle: (c, dir) => {
270
+ const modes = [true, "90%", false] as const;
271
+ const idx =
272
+ c.weeklyUsage.enabled === true
273
+ ? 0
274
+ : c.weeklyUsage.enabled === "90%"
275
+ ? 1
276
+ : 2;
277
+ c.weeklyUsage.enabled = modes[(idx + dir + 3) % 3];
278
+ },
279
+ },
280
+ toggle("weeklyUsage.showTimeLeft", " Time remaining", {
281
+ hidden: (c) => c.weeklyUsage.enabled === false,
282
+ }),
283
+ toggle("weeklyUsage.showPacingDelta", " Pacing delta", {
284
+ hidden: (c) => c.weeklyUsage.enabled === false,
285
+ }),
286
+ toggle("weeklyUsage.cost.enabled", " Cost", {
287
+ hidden: (c) => c.weeklyUsage.enabled === false,
288
+ }),
289
+ toggle("weeklyUsage.percentage.showValue", " Show % value", {
290
+ hidden: (c) => c.weeklyUsage.enabled === false,
291
+ }),
292
+ progressStyleCycle(
293
+ "weeklyUsage.percentage",
294
+ (c) => c.weeklyUsage.enabled === false,
295
+ ),
296
+ cycle(
297
+ "weeklyUsage.percentage.progressBar.length",
298
+ " Length",
299
+ PROGRESS_BAR_LENGTHS,
300
+ {
301
+ hidden: (c) =>
302
+ c.weeklyUsage.enabled === false ||
303
+ !c.weeklyUsage.percentage.progressBar.enabled,
304
+ },
305
+ ),
306
+ cycle(
307
+ "weeklyUsage.percentage.progressBar.color",
308
+ " Color",
309
+ PROGRESS_BAR_COLORS,
310
+ {
311
+ hidden: (c) =>
312
+ c.weeklyUsage.enabled === false ||
313
+ !c.weeklyUsage.percentage.progressBar.enabled,
314
+ },
315
+ ),
316
+ ],
317
+ },
203
318
  {
204
319
  id: "git",
205
320
  label: "GIT",
@@ -239,6 +354,7 @@ const tabs: Tab[] = [
239
354
  cycle("pathDisplayMode", "Path display", PATH_DISPLAY_MODES),
240
355
  toggle("showSonnetModel", "Show Sonnet model"),
241
356
  toggle("oneLine", "Single line mode"),
357
+ toggle("dailySpend.cost.enabled", "Daily spend"),
242
358
  ],
243
359
  },
244
360
  ];
@@ -248,11 +364,7 @@ const tabs: Tab[] = [
248
364
  // ─────────────────────────────────────────────────────────────
249
365
 
250
366
  function loadConfig(): StatuslineConfig {
251
- try {
252
- return JSON.parse(readFileSync(CONFIG_FILE_PATH, "utf-8"));
253
- } catch {
254
- return JSON.parse(JSON.stringify(defaultConfig));
255
- }
367
+ return loadStatuslineConfig();
256
368
  }
257
369
 
258
370
  function saveConfig(config: StatuslineConfig): void {