about-system 0.10.8 → 0.10.10

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 (50) hide show
  1. package/dist/about-system-cli.d.ts.map +1 -0
  2. package/dist/about-system-cli.js +1 -1
  3. package/dist/cache/cache-config.d.ts +62 -0
  4. package/dist/cache/cache-config.d.ts.map +1 -0
  5. package/dist/cache/cache.d.ts +53 -0
  6. package/dist/cache/cache.d.ts.map +1 -0
  7. package/dist/index.d.ts +18 -52
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +1 -1
  10. package/dist/info/hardware.d.ts +76 -0
  11. package/dist/info/hardware.d.ts.map +1 -0
  12. package/dist/info/memory.d.ts +59 -0
  13. package/dist/info/memory.d.ts.map +1 -0
  14. package/dist/info/network.d.ts +54 -0
  15. package/dist/info/network.d.ts.map +1 -0
  16. package/dist/info/platform.d.ts +36 -0
  17. package/dist/info/platform.d.ts.map +1 -0
  18. package/dist/info/process.d.ts +23 -0
  19. package/dist/info/process.d.ts.map +1 -0
  20. package/dist/info/settings.d.ts +185 -0
  21. package/dist/info/settings.d.ts.map +1 -0
  22. package/dist/info/software.d.ts +33 -0
  23. package/dist/info/software.d.ts.map +1 -0
  24. package/dist/info/system-status.d.ts +36 -0
  25. package/dist/info/system-status.d.ts.map +1 -0
  26. package/dist/{system-info-api-NgTm8Gzo.js → system-info-api-ByXoHI0m.js} +314 -278
  27. package/dist/system-info-api-ByXoHI0m.js.map +1 -0
  28. package/dist/system-info-api.d.ts +62 -442
  29. package/dist/system-info-api.d.ts.map +1 -0
  30. package/dist/system-info-api.js +4 -5
  31. package/dist/system-info-api.js.map +1 -1
  32. package/dist/types/internal-types.d.ts +14 -0
  33. package/dist/types/internal-types.d.ts.map +1 -0
  34. package/dist/utils/command.d.ts +18 -0
  35. package/dist/utils/command.d.ts.map +1 -0
  36. package/dist/utils/network.d.ts +27 -0
  37. package/dist/utils/network.d.ts.map +1 -0
  38. package/dist/utils/platform.d.ts +11 -0
  39. package/dist/utils/platform.d.ts.map +1 -0
  40. package/dist/web-server.d.ts +21 -0
  41. package/dist/web-server.d.ts.map +1 -0
  42. package/package.json +1 -1
  43. package/src/cache/cache-config.ts +2 -2
  44. package/src/system-info-api.ts +2 -67
  45. package/src/utils/network.ts +104 -4
  46. package/src/utils/utils.test.ts +105 -38
  47. package/dist/system-info-api-NgTm8Gzo.js.map +0 -1
  48. package/dist/web/assets/index--HOsj3jw.js +0 -14
  49. package/dist/web/assets/index-BU_blZyu.css +0 -1
  50. package/dist/web/index.html +0 -13
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Settings configuration and management
3
+ * @module info/settings
4
+ */
5
+ export declare const SETTINGS_FILE: string;
6
+ export declare const CACHE_FILE: string;
7
+ export declare const colors: {
8
+ reset: string;
9
+ red: string;
10
+ orange: string;
11
+ yellow: string;
12
+ green: string;
13
+ blue: string;
14
+ cyan: string;
15
+ purple: string;
16
+ magenta: string;
17
+ gray: string;
18
+ lightblue: string;
19
+ };
20
+ export declare const backgrounds: {
21
+ red: string;
22
+ orange: string;
23
+ yellow: string;
24
+ green: string;
25
+ blue: string;
26
+ cyan: string;
27
+ purple: string;
28
+ magenta: string;
29
+ gray: string;
30
+ lightblue: string;
31
+ };
32
+ export declare const DEFAULT_SETTINGS: {
33
+ display_order: string[][];
34
+ colors: {
35
+ user: string;
36
+ hostname: string;
37
+ disk_used: string;
38
+ disk_size: string;
39
+ ram_used: string;
40
+ top_process: string;
41
+ uptime: string;
42
+ ip: string;
43
+ iplocal: string;
44
+ city: string;
45
+ domain: string;
46
+ isp: string;
47
+ os: string;
48
+ cpu: string;
49
+ gpu: string;
50
+ bench: string;
51
+ gpu_bench: string;
52
+ device: string;
53
+ kernel: string;
54
+ shell: string;
55
+ pacman: string;
56
+ ports: string;
57
+ containers: string;
58
+ memory_available: string;
59
+ swap_used: string;
60
+ load_average: string;
61
+ users_logged_in: string;
62
+ network_interfaces: string;
63
+ mount_points: string;
64
+ services_running: string;
65
+ temperature: string;
66
+ battery: string;
67
+ screen_resolution: string;
68
+ };
69
+ emojis: {
70
+ user: string;
71
+ hostname: string;
72
+ ip: string;
73
+ iplocal: string;
74
+ city: string;
75
+ domain: string;
76
+ isp: string;
77
+ os: string;
78
+ cpu: string;
79
+ gpu: string;
80
+ bench: string;
81
+ gpu_bench: string;
82
+ device: string;
83
+ kernel: string;
84
+ shell: string;
85
+ pacman: string;
86
+ disk_used: string;
87
+ disk_size: string;
88
+ ram_used: string;
89
+ top_process: string;
90
+ uptime: string;
91
+ ports: string;
92
+ containers: string;
93
+ memory_available: string;
94
+ swap_used: string;
95
+ load_average: string;
96
+ users_logged_in: string;
97
+ network_interfaces: string;
98
+ mount_points: string;
99
+ services_running: string;
100
+ temperature: string;
101
+ battery_charging: string;
102
+ battery: string;
103
+ screen_resolution: string;
104
+ };
105
+ labels: {
106
+ user: string;
107
+ hostname: string;
108
+ ip: string;
109
+ iplocal: string;
110
+ city: string;
111
+ domain: string;
112
+ isp: string;
113
+ os: string;
114
+ cpu: string;
115
+ gpu: string;
116
+ bench: string;
117
+ gpu_bench: string;
118
+ device: string;
119
+ kernel: string;
120
+ shell: string;
121
+ pacman: string;
122
+ disk_used: string;
123
+ disk_size: string;
124
+ ram_used: string;
125
+ top_process: string;
126
+ uptime: string;
127
+ ports: string;
128
+ containers: string;
129
+ memory_available: string;
130
+ swap_used: string;
131
+ load_average: string;
132
+ users_logged_in: string;
133
+ network_interfaces: string;
134
+ mount_points: string;
135
+ services_running: string;
136
+ temperature: string;
137
+ battery_charging: string;
138
+ battery: string;
139
+ screen_resolution: string;
140
+ };
141
+ display: {
142
+ show_emojis: boolean;
143
+ show_backgrounds: boolean;
144
+ single_line: boolean;
145
+ line_wrap_length: number;
146
+ };
147
+ network: {
148
+ show_offline_message: boolean;
149
+ };
150
+ advanced: {
151
+ debug: boolean;
152
+ };
153
+ };
154
+ export interface Settings {
155
+ display_order: string[][];
156
+ colors: Record<string, string>;
157
+ emojis: Record<string, string>;
158
+ labels: Record<string, string>;
159
+ display: {
160
+ show_emojis: boolean;
161
+ /** true (default): give every item its own background color block, so it stays legible regardless of the terminal's background */
162
+ show_backgrounds: boolean;
163
+ /** true: print one continuous line and let the terminal soft-wrap it; false: hard-wrap at line_wrap_length */
164
+ single_line: boolean;
165
+ line_wrap_length: number;
166
+ };
167
+ network: {
168
+ show_offline_message: boolean;
169
+ };
170
+ advanced: {
171
+ debug: boolean;
172
+ };
173
+ }
174
+ /**
175
+ * Loads settings from the configuration file
176
+ * @returns Settings object (defaults merged with user settings)
177
+ */
178
+ export declare function loadSettings(): Settings;
179
+ /**
180
+ * Saves settings to the configuration file
181
+ * @param settings - The settings object to save
182
+ * @returns True if successful, false otherwise
183
+ */
184
+ export declare function saveSettings(settings: Settings): boolean;
185
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/info/settings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,eAAO,MAAM,aAAa,QAIzB,CAAC;AACF,eAAO,MAAM,UAAU,QAAkD,CAAC;AAU1E,eAAO,MAAM,MAAM;;;;;;;;;;;;CAYlB,CAAC;AAOF,eAAO,MAAM,WAAW;;;;;;;;;;;CAWvB,CAAC;AAGF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiJ5B,CAAC;AAEF,MAAM,WAAW,QAAQ;IACvB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,EAAE;QACP,WAAW,EAAE,OAAO,CAAC;QACrB,kIAAkI;QAClI,gBAAgB,EAAE,OAAO,CAAC;QAC1B,8GAA8G;QAC9G,WAAW,EAAE,OAAO,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,OAAO,EAAE;QACP,oBAAoB,EAAE,OAAO,CAAC;KAC/B,CAAC;IACF,QAAQ,EAAE;QACR,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;CACH;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,QAAQ,CAQvC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAWxD"}
@@ -0,0 +1,33 @@
1
+ import { InfoContext } from '../types/internal-types';
2
+ /**
3
+ * Gets the current shell name
4
+ * Uses the user's login shell (macOS/Linux), falls back to ps for the
5
+ * parent process shell
6
+ * @returns Shell name or empty string on Windows
7
+ * @example "bash", "zsh", "fish", "nu"
8
+ */
9
+ export declare function shell(context: InfoContext): string;
10
+ /**
11
+ * Gets available package managers and development tools
12
+ * Checks for package managers (apt, yum, npm, etc.) and editors (nvim, hx)
13
+ * @param context - Info context with cache
14
+ * @returns Space-separated list of available commands
15
+ * @example "apt npm docker nvim", "yay pacman bun hx"
16
+ */
17
+ export declare function packages(context: InfoContext): string;
18
+ /**
19
+ * Gets versions of common software tools
20
+ * @param context - Info context with cache
21
+ * @returns Formatted string of tool versions
22
+ * @example "node:20.1.0 git:2.34.1"
23
+ */
24
+ export declare function common_versions(context: InfoContext): string;
25
+ /**
26
+ * Gets running Docker container names
27
+ * Lists active Docker containers with their names
28
+ * @param context - Info context with cache
29
+ * @returns Space-separated container names or empty string
30
+ * @example "nginx redis postgres", "web-app db-server"
31
+ */
32
+ export declare function containers(context: InfoContext): string;
33
+ //# sourceMappingURL=software.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"software.d.ts","sourceRoot":"","sources":["../../src/info/software.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK3D;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA0BlD;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA4BrD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAsD5D;AACD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAmDvD"}
@@ -0,0 +1,36 @@
1
+ import { InfoContext } from '../types/internal-types';
2
+ /**
3
+ * Gets system load averages
4
+ * Reads 1, 5, and 15 minute load averages from /proc/loadavg (Linux) or
5
+ * os.loadavg() (macOS)
6
+ * @returns Space-separated load averages (1m 5m 15m) or empty string
7
+ * @example "0.52 0.58 0.59", "2.10 1.95 1.88"
8
+ */
9
+ export declare function load_average(context: InfoContext): string;
10
+ /**
11
+ * Gets battery charge level and charging status
12
+ * Reads from /sys/class/power_supply/BAT0 (Linux laptops only)
13
+ * @param context - Info context with cache
14
+ * @returns Battery percentage with optional + for charging, or empty string
15
+ * @example "85%", "42%+", "100%"
16
+ */
17
+ export declare function battery(context: InfoContext): string;
18
+ /**
19
+ * Gets system temperature in Celsius
20
+ * Reads from thermal zone or hwmon sensors (Linux), or from the
21
+ * `osx-cpu-temp` CLI (macOS, if installed via `brew install osx-cpu-temp`) -
22
+ * macOS has no unprivileged API for this, so nothing is reported without it
23
+ * @param context - Info context with cache
24
+ * @returns Temperature with °C suffix or empty string
25
+ * @example "45°C", "62°C"
26
+ */
27
+ export declare function temperature(context: InfoContext): string;
28
+ /**
29
+ * Gets count of running system services
30
+ * Uses systemctl or service command (Linux only)
31
+ * @param context - Info context with cache
32
+ * @returns Service count with "services" suffix or empty string
33
+ * @example "125 services", "89 services"
34
+ */
35
+ export declare function services_running(context: InfoContext): string;
36
+ //# sourceMappingURL=system-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-status.d.ts","sourceRoot":"","sources":["../../src/info/system-status.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK3D;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAgBzD;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA8CpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAoDxD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAqD7D"}