claude-scope 0.1.2 → 0.1.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.
Files changed (92) hide show
  1. package/dist/constants.d.ts +56 -0
  2. package/dist/constants.d.ts.map +1 -0
  3. package/dist/constants.js +57 -0
  4. package/dist/constants.js.map +1 -0
  5. package/dist/core/renderer.d.ts +33 -3
  6. package/dist/core/renderer.d.ts.map +1 -1
  7. package/dist/core/renderer.js +49 -7
  8. package/dist/core/renderer.js.map +1 -1
  9. package/dist/core/stdin-data-widget.d.ts +85 -0
  10. package/dist/core/stdin-data-widget.d.ts.map +1 -0
  11. package/dist/core/stdin-data-widget.js +75 -0
  12. package/dist/core/stdin-data-widget.js.map +1 -0
  13. package/dist/core/widget-types.d.ts +30 -0
  14. package/dist/core/widget-types.d.ts.map +1 -0
  15. package/dist/core/widget-types.js +30 -0
  16. package/dist/core/widget-types.js.map +1 -0
  17. package/dist/data/stdin-provider.d.ts +44 -0
  18. package/dist/data/stdin-provider.d.ts.map +1 -0
  19. package/dist/data/stdin-provider.js +83 -0
  20. package/dist/data/stdin-provider.js.map +1 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +64 -21
  23. package/dist/index.js.map +1 -1
  24. package/dist/providers/git-provider.d.ts +55 -32
  25. package/dist/providers/git-provider.d.ts.map +1 -1
  26. package/dist/providers/git-provider.js +63 -40
  27. package/dist/providers/git-provider.js.map +1 -1
  28. package/dist/providers/stdin-provider.d.ts +16 -15
  29. package/dist/providers/stdin-provider.d.ts.map +1 -1
  30. package/dist/providers/stdin-provider.js +35 -66
  31. package/dist/providers/stdin-provider.js.map +1 -1
  32. package/dist/schemas/stdin-schema.d.ts +123 -0
  33. package/dist/schemas/stdin-schema.d.ts.map +1 -0
  34. package/dist/schemas/stdin-schema.js +81 -0
  35. package/dist/schemas/stdin-schema.js.map +1 -0
  36. package/dist/types.d.ts +13 -15
  37. package/dist/types.d.ts.map +1 -1
  38. package/dist/types.js +3 -0
  39. package/dist/types.js.map +1 -1
  40. package/dist/ui/utils/colors.d.ts +52 -0
  41. package/dist/ui/utils/colors.d.ts.map +1 -0
  42. package/dist/ui/utils/colors.js +54 -0
  43. package/dist/ui/utils/colors.js.map +1 -0
  44. package/dist/ui/utils/formatters.d.ts +56 -0
  45. package/dist/ui/utils/formatters.d.ts.map +1 -0
  46. package/dist/ui/utils/formatters.js +114 -0
  47. package/dist/ui/utils/formatters.js.map +1 -0
  48. package/dist/utils/colors.d.ts +16 -0
  49. package/dist/utils/colors.d.ts.map +1 -1
  50. package/dist/utils/colors.js +18 -0
  51. package/dist/utils/colors.js.map +1 -1
  52. package/dist/utils/formatters.d.ts +56 -0
  53. package/dist/utils/formatters.d.ts.map +1 -0
  54. package/dist/utils/formatters.js +114 -0
  55. package/dist/utils/formatters.js.map +1 -0
  56. package/dist/widgets/context-widget.d.ts +13 -0
  57. package/dist/widgets/context-widget.d.ts.map +1 -0
  58. package/dist/widgets/context-widget.js +31 -0
  59. package/dist/widgets/context-widget.js.map +1 -0
  60. package/dist/widgets/core/stdin-data-widget.d.ts +93 -0
  61. package/dist/widgets/core/stdin-data-widget.d.ts.map +1 -0
  62. package/dist/widgets/core/stdin-data-widget.js +84 -0
  63. package/dist/widgets/core/stdin-data-widget.js.map +1 -0
  64. package/dist/widgets/cost-widget.d.ts +13 -0
  65. package/dist/widgets/cost-widget.d.ts.map +1 -0
  66. package/dist/widgets/cost-widget.js +18 -0
  67. package/dist/widgets/cost-widget.js.map +1 -0
  68. package/dist/widgets/duration-widget.d.ts +13 -0
  69. package/dist/widgets/duration-widget.d.ts.map +1 -0
  70. package/dist/widgets/duration-widget.js +18 -0
  71. package/dist/widgets/duration-widget.js.map +1 -0
  72. package/dist/widgets/git/git-changes-widget.d.ts +38 -0
  73. package/dist/widgets/git/git-changes-widget.d.ts.map +1 -0
  74. package/dist/widgets/git/git-changes-widget.js +91 -0
  75. package/dist/widgets/git/git-changes-widget.js.map +1 -0
  76. package/dist/widgets/git/git-widget.d.ts +37 -0
  77. package/dist/widgets/git/git-widget.d.ts.map +1 -0
  78. package/dist/widgets/git/git-widget.js +67 -0
  79. package/dist/widgets/git/git-widget.js.map +1 -0
  80. package/dist/widgets/git-changes-widget.d.ts +16 -0
  81. package/dist/widgets/git-changes-widget.d.ts.map +1 -0
  82. package/dist/widgets/git-changes-widget.js +37 -0
  83. package/dist/widgets/git-changes-widget.js.map +1 -0
  84. package/dist/widgets/git-widget.d.ts +8 -2
  85. package/dist/widgets/git-widget.d.ts.map +1 -1
  86. package/dist/widgets/git-widget.js +9 -9
  87. package/dist/widgets/git-widget.js.map +1 -1
  88. package/dist/widgets/model-widget.d.ts +13 -0
  89. package/dist/widgets/model-widget.d.ts.map +1 -0
  90. package/dist/widgets/model-widget.js +15 -0
  91. package/dist/widgets/model-widget.js.map +1 -0
  92. package/package.json +14 -6
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Runtime type-safe schema for Claude Code stdin data
3
+ *
4
+ * This schema validates incoming JSON from Claude Code statusline API
5
+ * and provides TypeScript types automatically via inference.
6
+ */
7
+ import { z } from 'zod';
8
+ /**
9
+ * Context usage schema
10
+ * Details about current token usage in the context window
11
+ */
12
+ export declare const ContextUsageSchema: z.ZodObject<{
13
+ input_tokens: z.ZodNumber;
14
+ output_tokens: z.ZodNumber;
15
+ cache_creation_input_tokens: z.ZodNumber;
16
+ cache_read_input_tokens: z.ZodNumber;
17
+ }, z.core.$strip>;
18
+ /**
19
+ * Cost info schema
20
+ * Details about session cost and duration
21
+ */
22
+ export declare const CostInfoSchema: z.ZodObject<{
23
+ total_cost_usd: z.ZodOptional<z.ZodNumber>;
24
+ total_duration_ms: z.ZodOptional<z.ZodNumber>;
25
+ total_api_duration_ms: z.ZodOptional<z.ZodNumber>;
26
+ total_lines_added: z.ZodOptional<z.ZodNumber>;
27
+ total_lines_removed: z.ZodOptional<z.ZodNumber>;
28
+ }, z.core.$strip>;
29
+ /**
30
+ * Context window schema
31
+ * Information about token usage and limits
32
+ */
33
+ export declare const ContextWindowSchema: z.ZodObject<{
34
+ total_input_tokens: z.ZodNumber;
35
+ total_output_tokens: z.ZodNumber;
36
+ context_window_size: z.ZodNumber;
37
+ current_usage: z.ZodNullable<z.ZodObject<{
38
+ input_tokens: z.ZodNumber;
39
+ output_tokens: z.ZodNumber;
40
+ cache_creation_input_tokens: z.ZodNumber;
41
+ cache_read_input_tokens: z.ZodNumber;
42
+ }, z.core.$strip>>;
43
+ }, z.core.$strip>;
44
+ /**
45
+ * Model info schema
46
+ * Information about the Claude model being used
47
+ */
48
+ export declare const ModelInfoSchema: z.ZodObject<{
49
+ id: z.ZodString;
50
+ display_name: z.ZodString;
51
+ }, z.core.$strip>;
52
+ /**
53
+ * Workspace schema
54
+ * Information about current working directory
55
+ */
56
+ export declare const WorkspaceSchema: z.ZodObject<{
57
+ current_dir: z.ZodString;
58
+ project_dir: z.ZodString;
59
+ }, z.core.$strip>;
60
+ /**
61
+ * Output style schema
62
+ * Information about current output style
63
+ */
64
+ export declare const OutputStyleSchema: z.ZodObject<{
65
+ name: z.ZodString;
66
+ }, z.core.$strip>;
67
+ /**
68
+ * Main stdin data schema
69
+ *
70
+ * This is the primary schema for validating Claude Code statusline data.
71
+ * All fields are validated at runtime, and TypeScript types are inferred
72
+ * automatically.
73
+ */
74
+ export declare const StdinDataSchema: z.ZodObject<{
75
+ hook_event_name: z.ZodLiteral<"Status">;
76
+ session_id: z.ZodString;
77
+ transcript_path: z.ZodString;
78
+ cwd: z.ZodString;
79
+ model: z.ZodObject<{
80
+ id: z.ZodString;
81
+ display_name: z.ZodString;
82
+ }, z.core.$strip>;
83
+ workspace: z.ZodObject<{
84
+ current_dir: z.ZodString;
85
+ project_dir: z.ZodString;
86
+ }, z.core.$strip>;
87
+ version: z.ZodString;
88
+ output_style: z.ZodObject<{
89
+ name: z.ZodString;
90
+ }, z.core.$strip>;
91
+ cost: z.ZodOptional<z.ZodObject<{
92
+ total_cost_usd: z.ZodOptional<z.ZodNumber>;
93
+ total_duration_ms: z.ZodOptional<z.ZodNumber>;
94
+ total_api_duration_ms: z.ZodOptional<z.ZodNumber>;
95
+ total_lines_added: z.ZodOptional<z.ZodNumber>;
96
+ total_lines_removed: z.ZodOptional<z.ZodNumber>;
97
+ }, z.core.$strip>>;
98
+ context_window: z.ZodObject<{
99
+ total_input_tokens: z.ZodNumber;
100
+ total_output_tokens: z.ZodNumber;
101
+ context_window_size: z.ZodNumber;
102
+ current_usage: z.ZodNullable<z.ZodObject<{
103
+ input_tokens: z.ZodNumber;
104
+ output_tokens: z.ZodNumber;
105
+ cache_creation_input_tokens: z.ZodNumber;
106
+ cache_read_input_tokens: z.ZodNumber;
107
+ }, z.core.$strip>>;
108
+ }, z.core.$strip>;
109
+ }, z.core.$strip>;
110
+ /**
111
+ * Type inference from schema
112
+ *
113
+ * These types are automatically inferred from the Zod schemas,
114
+ * ensuring compile-time and run-time type safety are in sync.
115
+ */
116
+ export type StdinData = z.infer<typeof StdinDataSchema>;
117
+ export type ContextUsage = z.infer<typeof ContextUsageSchema>;
118
+ export type CostInfo = z.infer<typeof CostInfoSchema>;
119
+ export type ContextWindow = z.infer<typeof ContextWindowSchema>;
120
+ export type ModelInfo = z.infer<typeof ModelInfoSchema>;
121
+ export type Workspace = z.infer<typeof WorkspaceSchema>;
122
+ export type OutputStyle = z.infer<typeof OutputStyleSchema>;
123
+ //# sourceMappingURL=stdin-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stdin-schema.d.ts","sourceRoot":"","sources":["../../src/schemas/stdin-schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;iBAK7B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;iBAMf,CAAC;AAEb;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;iBAK9B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,eAAe;;;iBAG1B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,eAAe;;;iBAG1B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;iBAE5B,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW1B,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Runtime type-safe schema for Claude Code stdin data
3
+ *
4
+ * This schema validates incoming JSON from Claude Code statusline API
5
+ * and provides TypeScript types automatically via inference.
6
+ */
7
+ import { z } from 'zod';
8
+ /**
9
+ * Context usage schema
10
+ * Details about current token usage in the context window
11
+ */
12
+ export const ContextUsageSchema = z.object({
13
+ input_tokens: z.number(),
14
+ output_tokens: z.number(),
15
+ cache_creation_input_tokens: z.number(),
16
+ cache_read_input_tokens: z.number()
17
+ });
18
+ /**
19
+ * Cost info schema
20
+ * Details about session cost and duration
21
+ */
22
+ export const CostInfoSchema = z.object({
23
+ total_cost_usd: z.number(),
24
+ total_duration_ms: z.number(),
25
+ total_api_duration_ms: z.number(),
26
+ total_lines_added: z.number(),
27
+ total_lines_removed: z.number()
28
+ }).partial(); // Make all fields optional for backwards compatibility
29
+ /**
30
+ * Context window schema
31
+ * Information about token usage and limits
32
+ */
33
+ export const ContextWindowSchema = z.object({
34
+ total_input_tokens: z.number(),
35
+ total_output_tokens: z.number(),
36
+ context_window_size: z.number(),
37
+ current_usage: ContextUsageSchema.nullable()
38
+ });
39
+ /**
40
+ * Model info schema
41
+ * Information about the Claude model being used
42
+ */
43
+ export const ModelInfoSchema = z.object({
44
+ id: z.string(),
45
+ display_name: z.string()
46
+ });
47
+ /**
48
+ * Workspace schema
49
+ * Information about current working directory
50
+ */
51
+ export const WorkspaceSchema = z.object({
52
+ current_dir: z.string(),
53
+ project_dir: z.string()
54
+ });
55
+ /**
56
+ * Output style schema
57
+ * Information about current output style
58
+ */
59
+ export const OutputStyleSchema = z.object({
60
+ name: z.string()
61
+ });
62
+ /**
63
+ * Main stdin data schema
64
+ *
65
+ * This is the primary schema for validating Claude Code statusline data.
66
+ * All fields are validated at runtime, and TypeScript types are inferred
67
+ * automatically.
68
+ */
69
+ export const StdinDataSchema = z.object({
70
+ hook_event_name: z.literal('Status'),
71
+ session_id: z.string(),
72
+ transcript_path: z.string(),
73
+ cwd: z.string(),
74
+ model: ModelInfoSchema,
75
+ workspace: WorkspaceSchema,
76
+ version: z.string(),
77
+ output_style: OutputStyleSchema,
78
+ cost: CostInfoSchema.optional(),
79
+ context_window: ContextWindowSchema
80
+ });
81
+ //# sourceMappingURL=stdin-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stdin-schema.js","sourceRoot":"","sources":["../../src/schemas/stdin-schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC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B,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACpC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,KAAK,EAAE,eAAe;IACtB,SAAS,EAAE,eAAe;IAC1B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,YAAY,EAAE,iBAAiB;IAC/B,IAAI,EAAE,cAAc,CAAC,QAAQ,EAAE;IAC/B,cAAc,EAAE,mBAAmB;CACpC,CAAC,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,21 +1,12 @@
1
1
  /**
2
2
  * Shared types used across the application
3
+ *
4
+ * This file re-exports types from the Zod schema (single source of truth)
5
+ * and defines additional types not related to stdin data validation.
3
6
  */
4
- /**
5
- * Model information from Claude Code
6
- */
7
- export interface ModelInfo {
8
- id: string;
9
- display_name: string;
10
- }
11
- /**
12
- * Data received from Claude Code via stdin
13
- */
14
- export interface StdinData {
15
- session_id: string;
16
- cwd: string;
17
- model: ModelInfo;
18
- }
7
+ import type { StdinData, ModelInfo, Workspace, OutputStyle, CostInfo, ContextWindow, ContextUsage } from './schemas/stdin-schema.js';
8
+ export type { StdinData, ModelInfo, Workspace, OutputStyle, CostInfo, ContextWindow, ContextUsage };
9
+ export type WorkspaceInfo = Workspace;
19
10
  /**
20
11
  * Git repository information
21
12
  */
@@ -23,6 +14,13 @@ export interface GitInfo {
23
14
  branch: string | null;
24
15
  isRepo: boolean;
25
16
  }
17
+ /**
18
+ * Git change statistics
19
+ */
20
+ export interface GitChanges {
21
+ insertions: number;
22
+ deletions: number;
23
+ }
26
24
  /**
27
25
  * Rendering context passed to widgets
28
26
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,SAAS,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,aAAa,EACb,YAAY,EACb,MAAM,2BAA2B,CAAC;AAGnC,YAAY,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,aAAa,EACb,YAAY,EACb,CAAC;AAGF,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB"}
package/dist/types.js CHANGED
@@ -1,5 +1,8 @@
1
1
  /**
2
2
  * Shared types used across the application
3
+ *
4
+ * This file re-exports types from the Zod schema (single source of truth)
5
+ * and defines additional types not related to stdin data validation.
3
6
  */
4
7
  export {};
5
8
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * ANSI color utilities for terminal output
3
+ *
4
+ * Provides ANSI escape codes for colors and text styling in terminal output.
5
+ * These codes work in most modern terminal emulators.
6
+ */
7
+ /**
8
+ * Reset all styles and colors
9
+ */
10
+ export declare const reset = "\u001B[0m";
11
+ /**
12
+ * Foreground colors (30-37, 90 for bright/bold variants)
13
+ */
14
+ export declare const red = "\u001B[31m";
15
+ export declare const green = "\u001B[32m";
16
+ export declare const yellow = "\u001B[33m";
17
+ export declare const blue = "\u001B[34m";
18
+ export declare const magenta = "\u001B[35m";
19
+ export declare const cyan = "\u001B[36m";
20
+ export declare const white = "\u001B[37m";
21
+ export declare const gray = "\u001B[90m";
22
+ /**
23
+ * Background colors (40-47)
24
+ */
25
+ export declare const bgRed = "\u001B[41m";
26
+ export declare const bgGreen = "\u001B[42m";
27
+ export declare const bgYellow = "\u001B[43m";
28
+ export declare const bgBlue = "\u001B[44m";
29
+ /**
30
+ * Text styles
31
+ */
32
+ export declare const bold = "\u001B[1m";
33
+ export declare const dim = "\u001B[2m";
34
+ export declare const italic = "\u001B[3m";
35
+ export declare const underline = "\u001B[4m";
36
+ /**
37
+ * Context usage colors
38
+ * Used for context progress bar based on usage percentage
39
+ */
40
+ export declare const contextColors: {
41
+ readonly low: "\u001B[32m";
42
+ readonly medium: "\u001B[33m";
43
+ readonly high: "\u001B[31m";
44
+ };
45
+ /**
46
+ * Wrap text in ANSI color
47
+ * @param text - Text to colorize
48
+ * @param color - ANSI color code
49
+ * @returns Colorized text with reset code
50
+ */
51
+ export declare function colorize(text: string, color: string): string;
52
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../src/ui/utils/colors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,KAAK,cAAY,CAAC;AAE/B;;GAEG;AACH,eAAO,MAAM,GAAG,eAAa,CAAC;AAC9B,eAAO,MAAM,KAAK,eAAa,CAAC;AAChC,eAAO,MAAM,MAAM,eAAa,CAAC;AACjC,eAAO,MAAM,IAAI,eAAa,CAAC;AAC/B,eAAO,MAAM,OAAO,eAAa,CAAC;AAClC,eAAO,MAAM,IAAI,eAAa,CAAC;AAC/B,eAAO,MAAM,KAAK,eAAa,CAAC;AAChC,eAAO,MAAM,IAAI,eAAa,CAAC;AAE/B;;GAEG;AACH,eAAO,MAAM,KAAK,eAAa,CAAC;AAChC,eAAO,MAAM,OAAO,eAAa,CAAC;AAClC,eAAO,MAAM,QAAQ,eAAa,CAAC;AACnC,eAAO,MAAM,MAAM,eAAa,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,IAAI,cAAY,CAAC;AAC9B,eAAO,MAAM,GAAG,cAAY,CAAC;AAC7B,eAAO,MAAM,MAAM,cAAY,CAAC;AAChC,eAAO,MAAM,SAAS,cAAY,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5D"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * ANSI color utilities for terminal output
3
+ *
4
+ * Provides ANSI escape codes for colors and text styling in terminal output.
5
+ * These codes work in most modern terminal emulators.
6
+ */
7
+ /**
8
+ * Reset all styles and colors
9
+ */
10
+ export const reset = '\x1b[0m';
11
+ /**
12
+ * Foreground colors (30-37, 90 for bright/bold variants)
13
+ */
14
+ export const red = '\x1b[31m';
15
+ export const green = '\x1b[32m';
16
+ export const yellow = '\x1b[33m';
17
+ export const blue = '\x1b[34m';
18
+ export const magenta = '\x1b[35m';
19
+ export const cyan = '\x1b[36m';
20
+ export const white = '\x1b[37m';
21
+ export const gray = '\x1b[90m';
22
+ /**
23
+ * Background colors (40-47)
24
+ */
25
+ export const bgRed = '\x1b[41m';
26
+ export const bgGreen = '\x1b[42m';
27
+ export const bgYellow = '\x1b[43m';
28
+ export const bgBlue = '\x1b[44m';
29
+ /**
30
+ * Text styles
31
+ */
32
+ export const bold = '\x1b[1m';
33
+ export const dim = '\x1b[2m';
34
+ export const italic = '\x1b[3m';
35
+ export const underline = '\x1b[4m';
36
+ /**
37
+ * Context usage colors
38
+ * Used for context progress bar based on usage percentage
39
+ */
40
+ export const contextColors = {
41
+ low: green, // <50% usage
42
+ medium: yellow, // 50-79% usage
43
+ high: red // >=80% usage
44
+ };
45
+ /**
46
+ * Wrap text in ANSI color
47
+ * @param text - Text to colorize
48
+ * @param color - ANSI color code
49
+ * @returns Colorized text with reset code
50
+ */
51
+ export function colorize(text, color) {
52
+ return `${color}${text}${reset}`;
53
+ }
54
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../../src/ui/utils/colors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,SAAS,CAAC;AAE/B;;GAEG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,UAAU,CAAC;AAC9B,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC;AAChC,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC;AACjC,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAAC;AAC/B,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;AAClC,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAAC;AAC/B,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC;AAChC,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAAC;AAE/B;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC;AAChC,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;AAClC,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;AACnC,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,SAAS,CAAC;AAC9B,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC;AAC7B,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC;AAChC,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,KAAK,EAAM,aAAa;IAC7B,MAAM,EAAE,MAAM,EAAE,eAAe;IAC/B,IAAI,EAAE,GAAG,CAAO,cAAc;CACtB,CAAC;AAEX;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,KAAa;IAClD,OAAO,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,EAAE,CAAC;AACnC,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Formatter utilities for displaying data in human-readable formats
3
+ */
4
+ /**
5
+ * Format milliseconds to human-readable duration
6
+ *
7
+ * Examples:
8
+ * - 45000 -> "45s"
9
+ * - 60000 -> "1m 0s"
10
+ * - 3600000 -> "1h 0m 0s"
11
+ * - 3665000 -> "1h 1m 5s"
12
+ *
13
+ * @param ms - Duration in milliseconds
14
+ * @returns Human-readable duration string
15
+ */
16
+ export declare function formatDuration(ms: number): string;
17
+ /**
18
+ * Format cost in USD with appropriate precision
19
+ *
20
+ * - Values < $0.01 (positive): 4 decimal places ($0.0012)
21
+ * - Values >= $0.01: 2 decimal places ($1.23)
22
+ * - Values >= $100: 0 decimal places ($123)
23
+ * - Negative values: 2 decimal places ($-1.23)
24
+ *
25
+ * @param usd - Cost in USD
26
+ * @returns Formatted cost string with $ prefix
27
+ */
28
+ export declare function formatCostUSD(usd: number): string;
29
+ /**
30
+ * Create a visual progress bar
31
+ *
32
+ * @param percent - Percentage (0-100)
33
+ * @param width - Bar width in characters (default: DEFAULTS.PROGRESS_BAR_WIDTH)
34
+ * @returns Progress bar string like "████████░░░░░░░░░░░░"
35
+ */
36
+ export declare function progressBar(percent: number, width?: number): string;
37
+ /**
38
+ * Get color code for context percentage
39
+ *
40
+ * - <50%: green (low usage)
41
+ * - 50-79%: yellow (medium usage)
42
+ * - >=80%: red (high usage)
43
+ *
44
+ * @param percent - Context usage percentage (0-100)
45
+ * @returns ANSI color code
46
+ */
47
+ export declare function getContextColor(percent: number): string;
48
+ /**
49
+ * Colorize text with ANSI color code
50
+ *
51
+ * @param text - Text to colorize
52
+ * @param color - ANSI color code
53
+ * @returns Colorized text with reset code
54
+ */
55
+ export declare function colorize(text: string, color: string): string;
56
+ //# sourceMappingURL=formatters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../src/ui/utils/formatters.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAsBjD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAgBjD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAoC,GAAG,MAAM,CAKhG;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAUvD;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5D"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Formatter utilities for displaying data in human-readable formats
3
+ */
4
+ import { TIME, COST_THRESHOLDS, CONTEXT_THRESHOLDS, ANSI_COLORS, DEFAULTS } from '../../constants.js';
5
+ /**
6
+ * Format milliseconds to human-readable duration
7
+ *
8
+ * Examples:
9
+ * - 45000 -> "45s"
10
+ * - 60000 -> "1m 0s"
11
+ * - 3600000 -> "1h 0m 0s"
12
+ * - 3665000 -> "1h 1m 5s"
13
+ *
14
+ * @param ms - Duration in milliseconds
15
+ * @returns Human-readable duration string
16
+ */
17
+ export function formatDuration(ms) {
18
+ if (ms <= 0)
19
+ return '0s';
20
+ const seconds = Math.floor(ms / TIME.MS_PER_SECOND);
21
+ const hours = Math.floor(seconds / TIME.SECONDS_PER_HOUR);
22
+ const minutes = Math.floor((seconds % TIME.SECONDS_PER_HOUR) / TIME.SECONDS_PER_MINUTE);
23
+ const secs = seconds % TIME.SECONDS_PER_MINUTE;
24
+ const parts = [];
25
+ if (hours > 0) {
26
+ parts.push(`${hours}h`);
27
+ parts.push(`${minutes}m`);
28
+ parts.push(`${secs}s`);
29
+ }
30
+ else if (minutes > 0) {
31
+ parts.push(`${minutes}m`);
32
+ parts.push(`${secs}s`);
33
+ }
34
+ else {
35
+ parts.push(`${secs}s`);
36
+ }
37
+ return parts.join(' ');
38
+ }
39
+ /**
40
+ * Format cost in USD with appropriate precision
41
+ *
42
+ * - Values < $0.01 (positive): 4 decimal places ($0.0012)
43
+ * - Values >= $0.01: 2 decimal places ($1.23)
44
+ * - Values >= $100: 0 decimal places ($123)
45
+ * - Negative values: 2 decimal places ($-1.23)
46
+ *
47
+ * @param usd - Cost in USD
48
+ * @returns Formatted cost string with $ prefix
49
+ */
50
+ export function formatCostUSD(usd) {
51
+ const absUsd = Math.abs(usd);
52
+ if (usd < 0) {
53
+ // Negative values: 2 decimal places
54
+ return `$${usd.toFixed(2)}`;
55
+ }
56
+ else if (absUsd < COST_THRESHOLDS.SMALL) {
57
+ // 4 decimal places for very small positive values
58
+ return `$${usd.toFixed(4)}`;
59
+ }
60
+ else if (absUsd < COST_THRESHOLDS.LARGE) {
61
+ // 2 decimal places for normal values
62
+ return `$${usd.toFixed(2)}`;
63
+ }
64
+ else {
65
+ // 0 decimal places for large values
66
+ return `$${Math.floor(usd).toFixed(0)}`;
67
+ }
68
+ }
69
+ /**
70
+ * Create a visual progress bar
71
+ *
72
+ * @param percent - Percentage (0-100)
73
+ * @param width - Bar width in characters (default: DEFAULTS.PROGRESS_BAR_WIDTH)
74
+ * @returns Progress bar string like "████████░░░░░░░░░░░░"
75
+ */
76
+ export function progressBar(percent, width = DEFAULTS.PROGRESS_BAR_WIDTH) {
77
+ const clampedPercent = Math.max(0, Math.min(100, percent));
78
+ const filled = Math.round((clampedPercent / 100) * width);
79
+ const empty = width - filled;
80
+ return '█'.repeat(filled) + '░'.repeat(empty);
81
+ }
82
+ /**
83
+ * Get color code for context percentage
84
+ *
85
+ * - <50%: green (low usage)
86
+ * - 50-79%: yellow (medium usage)
87
+ * - >=80%: red (high usage)
88
+ *
89
+ * @param percent - Context usage percentage (0-100)
90
+ * @returns ANSI color code
91
+ */
92
+ export function getContextColor(percent) {
93
+ const clampedPercent = Math.max(0, Math.min(100, percent));
94
+ if (clampedPercent < CONTEXT_THRESHOLDS.LOW_MEDIUM) {
95
+ return ANSI_COLORS.GREEN;
96
+ }
97
+ else if (clampedPercent < CONTEXT_THRESHOLDS.MEDIUM_HIGH) {
98
+ return ANSI_COLORS.YELLOW;
99
+ }
100
+ else {
101
+ return ANSI_COLORS.RED;
102
+ }
103
+ }
104
+ /**
105
+ * Colorize text with ANSI color code
106
+ *
107
+ * @param text - Text to colorize
108
+ * @param color - ANSI color code
109
+ * @returns Colorized text with reset code
110
+ */
111
+ export function colorize(text, color) {
112
+ return `${color}${text}${ANSI_COLORS.RESET}`;
113
+ }
114
+ //# sourceMappingURL=formatters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../src/ui/utils/formatters.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,kBAAkB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEtG;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,IAAI,EAAE,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACxF,MAAM,IAAI,GAAG,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC;IAE/C,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;IACzB,CAAC;SAAM,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG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AAC;IAC7B,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IAE3D,IAAI,cAAc,GAAG,kBAAkB,CAAC,UAAU,EAAE,CAAC;QACnD,OAAO,WAAW,CAAC,KAAK,CAAC;IAC3B,CAAC;SAAM,IAAI,cAAc,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;QAC3D,OAAO,WAAW,CAAC,MAAM,CAAC;IAC5B,CAAC;SAAM,CAAC;QACN,OAAO,WAAW,CAAC,GAAG,CAAC;IACzB,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,KAAa;IAClD,OAAO,GAAG,KAAK,GAAG,IAAI,GAAG,WAAW,CAAC,KAAK,EAAE,CAAC;AAC/C,CAAC"}
@@ -33,4 +33,20 @@ export declare const bold = "\u001B[1m";
33
33
  export declare const dim = "\u001B[2m";
34
34
  export declare const italic = "\u001B[3m";
35
35
  export declare const underline = "\u001B[4m";
36
+ /**
37
+ * Context usage colors
38
+ * Used for context progress bar based on usage percentage
39
+ */
40
+ export declare const contextColors: {
41
+ readonly low: "\u001B[32m";
42
+ readonly medium: "\u001B[33m";
43
+ readonly high: "\u001B[31m";
44
+ };
45
+ /**
46
+ * Wrap text in ANSI color
47
+ * @param text - Text to colorize
48
+ * @param color - ANSI color code
49
+ * @returns Colorized text with reset code
50
+ */
51
+ export declare function colorize(text: string, color: string): string;
36
52
  //# sourceMappingURL=colors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"m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AAO,MAAM,QAAQ,eAAa,CAAC;AACnC,eAAO,MAAM,MAAM,eAAa,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,IAAI,cAAY,CAAC;AAC9B,eAAO,MAAM,GAAG,cAAY,CAAC;AAC7B,eAAO,MAAM,MAAM,cAAY,CAAC;AAChC,eAAO,MAAM,SAAS,cAAY,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5D"}
@@ -33,4 +33,22 @@ export const bold = '\x1b[1m';
33
33
  export const dim = '\x1b[2m';
34
34
  export const italic = '\x1b[3m';
35
35
  export const underline = '\x1b[4m';
36
+ /**
37
+ * Context usage colors
38
+ * Used for context progress bar based on usage percentage
39
+ */
40
+ export const contextColors = {
41
+ low: green, // <50% usage
42
+ medium: yellow, // 50-79% usage
43
+ high: red // >=80% usage
44
+ };
45
+ /**
46
+ * Wrap text in ANSI color
47
+ * @param text - Text to colorize
48
+ * @param color - ANSI color code
49
+ * @returns Colorized text with reset code
50
+ */
51
+ export function colorize(text, color) {
52
+ return `${color}${text}${reset}`;
53
+ }
36
54
  //# sourceMappingURL=colors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,SAAS,CAAC;AAE/B;;GAEG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,UAAU,CAAC;AAC9B,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC;AAChC,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC;AACjC,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAAC;AAC/B,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;AAClC,M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