Commit 01dd610
refactor(statusline): convert fetch-rate-limits.sh to TypeScript
Consolidate all rate limit fetching logic into format-status.ts, eliminating
the separate bash script. The TypeScript file now operates in dual mode:
1. As a library (exported functions) for import by other modules
2. As a CLI (when executed directly) for the session-start.sh hook
Key improvements:
- Single language (TypeScript) instead of bash/TS hybrid
- Native fetch API (Node 18+) instead of curl + jq
- Type-safe JSON parsing with proper interfaces
- Better error handling with try/catch
- No external jq dependency
The file includes CLI mode detection at the bottom to enable JSON output
when called directly from the bash hook.
Co-Authored-By: duyetbot <duyetbot@users.noreply.github.com>1 parent 7d04cc3 commit 01dd610
3 files changed
Lines changed: 306 additions & 332 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
This file was deleted.
0 commit comments