about-system 0.10.10 → 0.10.12
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.
- package/README.md +5 -3
- package/dist/about-system-cli.js +69 -54
- package/dist/about-system-cli.js.map +1 -1
- package/dist/index.d.ts +64 -18
- package/dist/index.js +1 -1
- package/dist/system-info-api-7iy1ZV2o.js +2475 -0
- package/dist/system-info-api-7iy1ZV2o.js.map +1 -0
- package/dist/system-info-api.d.ts +432 -62
- package/dist/system-info-api.js +1 -1
- package/dist/web/assets/index--HOsj3jw.js +14 -0
- package/dist/web/assets/index-BU_blZyu.css +1 -0
- package/dist/web/index.html +13 -0
- package/package.json +1 -1
- package/src/about-system-cli.ts +42 -3
- package/src/cache/cache-config.ts +3 -3
- package/src/info/hardware.test.ts +27 -12
- package/src/info/hardware.ts +25 -22
- package/src/info/network.ts +14 -47
- package/src/system-info-api.test.ts +106 -0
- package/src/system-info-api.ts +67 -28
- package/src/systeminfo-types.d.ts +16 -10
- package/src/utils/network.ts +113 -94
- package/src/utils/utils.test.ts +84 -75
- package/dist/about-system-cli.d.ts.map +0 -1
- package/dist/cache/cache-config.d.ts +0 -62
- package/dist/cache/cache-config.d.ts.map +0 -1
- package/dist/cache/cache.d.ts +0 -53
- package/dist/cache/cache.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/info/hardware.d.ts +0 -76
- package/dist/info/hardware.d.ts.map +0 -1
- package/dist/info/memory.d.ts +0 -59
- package/dist/info/memory.d.ts.map +0 -1
- package/dist/info/network.d.ts +0 -54
- package/dist/info/network.d.ts.map +0 -1
- package/dist/info/platform.d.ts +0 -36
- package/dist/info/platform.d.ts.map +0 -1
- package/dist/info/process.d.ts +0 -23
- package/dist/info/process.d.ts.map +0 -1
- package/dist/info/settings.d.ts +0 -185
- package/dist/info/settings.d.ts.map +0 -1
- package/dist/info/software.d.ts +0 -33
- package/dist/info/software.d.ts.map +0 -1
- package/dist/info/system-status.d.ts +0 -36
- package/dist/info/system-status.d.ts.map +0 -1
- package/dist/system-info-api-ByXoHI0m.js +0 -2464
- package/dist/system-info-api-ByXoHI0m.js.map +0 -1
- package/dist/system-info-api.d.ts.map +0 -1
- package/dist/types/internal-types.d.ts +0 -14
- package/dist/types/internal-types.d.ts.map +0 -1
- package/dist/utils/command.d.ts +0 -18
- package/dist/utils/command.d.ts.map +0 -1
- package/dist/utils/network.d.ts +0 -27
- package/dist/utils/network.d.ts.map +0 -1
- package/dist/utils/platform.d.ts +0 -11
- package/dist/utils/platform.d.ts.map +0 -1
- package/dist/web-server.d.ts +0 -21
- package/dist/web-server.d.ts.map +0 -1
|
@@ -1,62 +1,432 @@
|
|
|
1
|
-
import { SystemInfo
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
import { SystemInfo } from './systeminfo-types';
|
|
2
|
+
import { SystemInfoOptions } from './systeminfo-types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Gets battery charge level and charging status
|
|
6
|
+
* Reads from /sys/class/power_supply/BAT0 (Linux laptops only)
|
|
7
|
+
* @param context - Info context with cache
|
|
8
|
+
* @returns Battery percentage with optional + for charging, or empty string
|
|
9
|
+
* @example "85%", "42%+", "100%"
|
|
10
|
+
*/
|
|
11
|
+
declare function battery(context: InfoContext): string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Gets CPU benchmark score and rank from Geekbench 6 data
|
|
15
|
+
* Uses fuzzy matching to find similar CPU models
|
|
16
|
+
* @param context - Info context with cache
|
|
17
|
+
* @returns Benchmark info with score and rank, or empty string
|
|
18
|
+
* @example "38k #1 Top 1%", "21k #68 Top 7%"
|
|
19
|
+
*/
|
|
20
|
+
declare function bench(context: InfoContext): string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Cache storage structure
|
|
24
|
+
* @interface Cache
|
|
25
|
+
*/
|
|
26
|
+
declare interface Cache {
|
|
27
|
+
[key: string]: CacheEntry;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Cache management utilities
|
|
32
|
+
* @module cache
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Represents a cached value with timestamp
|
|
36
|
+
* @interface CacheEntry
|
|
37
|
+
*/
|
|
38
|
+
declare interface CacheEntry {
|
|
39
|
+
/** The cached value */
|
|
40
|
+
value: any;
|
|
41
|
+
/** Unix timestamp when the value was cached */
|
|
42
|
+
timestamp: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Gets geographic city based on public IP
|
|
47
|
+
* @param context - Info context with IP geolocation data
|
|
48
|
+
* @returns City name or empty string
|
|
49
|
+
* @example "San Francisco", "New York", "London"
|
|
50
|
+
*/
|
|
51
|
+
declare function city(context: InfoContext): string;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Gets running Docker container names
|
|
55
|
+
* Lists active Docker containers with their names
|
|
56
|
+
* @param context - Info context with cache
|
|
57
|
+
* @returns Space-separated container names or empty string
|
|
58
|
+
* @example "nginx redis postgres", "web-app db-server"
|
|
59
|
+
*/
|
|
60
|
+
declare function containers(context: InfoContext): string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Gets CPU model name and specifications
|
|
64
|
+
* Uses platform-specific commands (wmic/lscpu/cpuinfo)
|
|
65
|
+
* Automatically strips "with Radeon Graphics" and similar suffixes
|
|
66
|
+
* @param context - Info context with cache
|
|
67
|
+
* @returns CPU model string or empty string
|
|
68
|
+
* @example "Intel Core i7-12700K", "AMD Ryzen 9 5900HX", "Apple M2 Pro"
|
|
69
|
+
*/
|
|
70
|
+
declare function cpu(context: InfoContext): string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Gets detailed CPU benchmark information from Geekbench 6 data
|
|
74
|
+
* Includes score, rank, and architecture type (ARM/Intel/AMD)
|
|
75
|
+
* @param context - Info context with cache
|
|
76
|
+
* @returns Detailed benchmark info with architecture, or empty string
|
|
77
|
+
* @example "Geekbench 6: 38k (Rank #1, Top 1%) - ARM", "Geekbench 6: 21k (Rank #68, Top 7%) - Intel"
|
|
78
|
+
*/
|
|
79
|
+
declare function cpu_bench_info(context: InfoContext): string;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Gets device or computer model name
|
|
83
|
+
* Uses WMI on Windows, DMI on Linux, getprop on Android
|
|
84
|
+
* @param context - Info context with cache
|
|
85
|
+
* @returns Device model name or empty string
|
|
86
|
+
* @example "Dell OptiPlex 7090", "MacBook Pro 16-inch", "Valve Steam Deck"
|
|
87
|
+
*/
|
|
88
|
+
declare function device(context: InfoContext): string;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Gets disk size (used/total) for each real disk
|
|
92
|
+
* Uses `df -k` on Linux/macOS, filtering out pseudo filesystems, system/boot
|
|
93
|
+
* partitions (e.g. /boot, /System/Volumes/*), and anything under 10GB, since
|
|
94
|
+
* those aren't disks a user would care about. When exactly one real disk is
|
|
95
|
+
* found (the common case) the result omits the mount point; when multiple
|
|
96
|
+
* real disks are found (e.g. a data drive or external volume), each is
|
|
97
|
+
* labeled by its mount point.
|
|
98
|
+
* @param context - Info context with cache
|
|
99
|
+
* @returns Disk size as "used/total GB" or "mount(used/total GB) ..." or empty string
|
|
100
|
+
* @example "256/512GB", "/(100/500GB) /Volumes/Backup(900/2000GB)"
|
|
101
|
+
*/
|
|
102
|
+
declare function disk_size(context: InfoContext): string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Gets root filesystem disk usage percentage
|
|
106
|
+
* Uses df command on Linux/Android/macOS
|
|
107
|
+
* @param context - Info context with cache
|
|
108
|
+
* @returns Percentage string or empty string
|
|
109
|
+
* @example "45%", "78%"
|
|
110
|
+
*/
|
|
111
|
+
declare function disk_used(context: InfoContext): string;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Gets reverse DNS hostname with HTTP prefix
|
|
115
|
+
* @param context - Info context with IP info
|
|
116
|
+
* @returns Domain with http:// prefix or empty string
|
|
117
|
+
* @example "http://example.com", "http://host-203-0-113-42.example.net"
|
|
118
|
+
*/
|
|
119
|
+
declare function domain(context: InfoContext): string;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Get system information as a clean JSON object.
|
|
123
|
+
*
|
|
124
|
+
* `options.keys` limits collection to those blocks (all by default).
|
|
125
|
+
* `options.signal` stops collection early: whatever was gathered before the
|
|
126
|
+
* abort is returned, and the remaining blocks are left out.
|
|
127
|
+
*/
|
|
128
|
+
export declare function getSystemInfo(options?: SystemInfoOptions): Promise<SystemInfo>;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Gets graphics card model name
|
|
132
|
+
* Extracts GPU info from lspci (Linux) or WMI (Windows)
|
|
133
|
+
* Filters out basic/generic display adapters
|
|
134
|
+
* @param context - Info context with cache
|
|
135
|
+
* @returns GPU model string or empty string
|
|
136
|
+
* @example "NVIDIA GeForce RTX 4070", "AMD Radeon RX 6800 XT"
|
|
137
|
+
*/
|
|
138
|
+
declare function gpu(context: InfoContext): string;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Gets GPU benchmark score and rank from Geekbench 6 data
|
|
142
|
+
* Uses fuzzy matching to find similar GPU models
|
|
143
|
+
* @param context - Info context with cache
|
|
144
|
+
* @returns Benchmark info with score and rank, or empty string
|
|
145
|
+
* @example "38k #1 Top 1%", "21k #68 Top 7%"
|
|
146
|
+
*/
|
|
147
|
+
declare function gpu_bench(context: InfoContext): string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Gets detailed GPU benchmark information from Geekbench 6 data
|
|
151
|
+
* Includes score, rank, and vendor detection
|
|
152
|
+
* @param context - Info context with cache
|
|
153
|
+
* @returns Detailed benchmark info with vendor, or empty string
|
|
154
|
+
* @example "Geekbench 6: 38k (Rank #1, Top 1%) - NVIDIA", "Geekbench 6: 21k (Rank #68, Top 7%) - AMD"
|
|
155
|
+
*/
|
|
156
|
+
declare function gpu_bench_info(context: InfoContext): string;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Gets the system hostname
|
|
160
|
+
* @returns Computer hostname/network name
|
|
161
|
+
*/
|
|
162
|
+
declare function hostname(): string;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Context object passed to info collection functions
|
|
166
|
+
* @interface InfoContext
|
|
167
|
+
*/
|
|
168
|
+
declare interface InfoContext {
|
|
169
|
+
/** Cache storage */
|
|
170
|
+
cache: Cache;
|
|
171
|
+
/** IP information from external API */
|
|
172
|
+
ipInfo?: IPInfo;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* System information collection functions map
|
|
177
|
+
*/
|
|
178
|
+
export declare const infoFunctions: {
|
|
179
|
+
user: typeof user;
|
|
180
|
+
hostname: typeof hostname;
|
|
181
|
+
ip: typeof ip;
|
|
182
|
+
iplocal: typeof iplocal;
|
|
183
|
+
city: typeof city;
|
|
184
|
+
domain: typeof domain;
|
|
185
|
+
isp: typeof isp;
|
|
186
|
+
os: typeof os_info;
|
|
187
|
+
cpu: typeof cpu;
|
|
188
|
+
gpu: typeof gpu;
|
|
189
|
+
bench: typeof bench;
|
|
190
|
+
cpu_bench_info: typeof cpu_bench_info;
|
|
191
|
+
gpu_bench: typeof gpu_bench;
|
|
192
|
+
gpu_bench_info: typeof gpu_bench_info;
|
|
193
|
+
disk_used: typeof disk_used;
|
|
194
|
+
disk_size: typeof disk_size;
|
|
195
|
+
ram_used: typeof ram_used;
|
|
196
|
+
top_process: typeof top_process;
|
|
197
|
+
uptime: typeof uptime;
|
|
198
|
+
device: typeof device;
|
|
199
|
+
kernel: typeof kernel;
|
|
200
|
+
shell: typeof shell;
|
|
201
|
+
pacman: typeof packages;
|
|
202
|
+
ports: typeof ports;
|
|
203
|
+
containers: typeof containers;
|
|
204
|
+
memory_available: typeof memory_available;
|
|
205
|
+
swap_used: typeof swap_used;
|
|
206
|
+
load_average: typeof load_average;
|
|
207
|
+
users_logged_in: typeof users_logged_in;
|
|
208
|
+
network_interfaces: typeof network_interfaces;
|
|
209
|
+
mount_points: typeof mount_points;
|
|
210
|
+
services_running: typeof services_running;
|
|
211
|
+
temperature: typeof temperature;
|
|
212
|
+
battery: typeof battery;
|
|
213
|
+
screen_resolution: typeof screen_resolution;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Gets public IP address. The ip, city, domain and isp blocks all read the one
|
|
218
|
+
* shared lookup in `context.ipInfo`, which `getSystemInfo` caches for 10 minutes.
|
|
219
|
+
* @param context - Info context with IP info
|
|
220
|
+
* @returns Public IP address or empty string
|
|
221
|
+
* @example "203.0.113.42"
|
|
222
|
+
*/
|
|
223
|
+
declare function ip(context: InfoContext): string;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Network utilities for IP information fetching
|
|
227
|
+
* @module network
|
|
228
|
+
*/
|
|
229
|
+
/**
|
|
230
|
+
* IP information from ipinfo.io API
|
|
231
|
+
* @interface IPInfo
|
|
232
|
+
*/
|
|
233
|
+
declare interface IPInfo {
|
|
234
|
+
/** Public IP address */
|
|
235
|
+
ip?: string;
|
|
236
|
+
/** City location */
|
|
237
|
+
city?: string;
|
|
238
|
+
/** Reverse DNS hostname */
|
|
239
|
+
hostname?: string;
|
|
240
|
+
/** ISP organization string (includes AS number) */
|
|
241
|
+
org?: string;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Gets local/private IP address(es)
|
|
246
|
+
* Tries ifconfig and ip commands on Linux, falls back to Node.js API
|
|
247
|
+
* @returns Space-separated local IP addresses (RFC 1918 ranges)
|
|
248
|
+
* @example "192.168.1.100" or "10.0.0.50 192.168.1.100"
|
|
249
|
+
*/
|
|
250
|
+
declare function iplocal(): string;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Gets Internet Service Provider name
|
|
254
|
+
* Strips AS number prefix from organization string
|
|
255
|
+
* @param context - Info context with IP info
|
|
256
|
+
* @returns ISP name or empty string
|
|
257
|
+
* @example "Comcast Cable", "Verizon Business", "Cloudflare Inc"
|
|
258
|
+
*/
|
|
259
|
+
declare function isp(context: InfoContext): string;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Gets kernel version string
|
|
263
|
+
* Returns the operating system kernel version from os.release()
|
|
264
|
+
* @param context - Info context with cache
|
|
265
|
+
* @returns Kernel version string
|
|
266
|
+
* @example "5.15.0-56-generic", "6.11.11-valve12-1-neptune"
|
|
267
|
+
*/
|
|
268
|
+
declare function kernel(context: InfoContext): string;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Gets system load averages
|
|
272
|
+
* Reads 1, 5, and 15 minute load averages from /proc/loadavg (Linux) or
|
|
273
|
+
* os.loadavg() (macOS)
|
|
274
|
+
* @returns Space-separated load averages (1m 5m 15m) or empty string
|
|
275
|
+
* @example "0.52 0.58 0.59", "2.10 1.95 1.88"
|
|
276
|
+
*/
|
|
277
|
+
declare function load_average(context: InfoContext): string;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Loads cache from disk
|
|
281
|
+
*/
|
|
282
|
+
export declare function loadCache(): Cache;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Gets available memory in gigabytes
|
|
286
|
+
* Reads MemAvailable from /proc/meminfo (Linux) or derives it from
|
|
287
|
+
* vm_stat's free+inactive pages (macOS)
|
|
288
|
+
* @returns Available memory with "GB available" suffix or empty string
|
|
289
|
+
* @example "12GB available", "4GB available"
|
|
290
|
+
*/
|
|
291
|
+
declare function memory_available(): string;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Gets mounted filesystem information
|
|
295
|
+
* Lists non-system mount points with usage from df (Linux/macOS)
|
|
296
|
+
* On Linux, excludes /, /dev, /proc, /sys and internal /System/Volumes mounts.
|
|
297
|
+
* On macOS, APFS internal volumes (Data, VM, Preboot, Update, ...) all live
|
|
298
|
+
* under /System/Volumes and are not user-relevant, so only /Volumes (external
|
|
299
|
+
* disks, network shares, disk images) are reported.
|
|
300
|
+
* @param context - Info context with cache
|
|
301
|
+
* @returns Space-separated mount points with usage or empty string
|
|
302
|
+
* @example "/home(45%) /mnt/data(78%)", "/Volumes/Backup(78%)"
|
|
303
|
+
*/
|
|
304
|
+
declare function mount_points(context: InfoContext): string;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Gets active network interface names
|
|
308
|
+
* Lists non-loopback interfaces with IPv4 addresses (Linux/macOS only)
|
|
309
|
+
* @param context - Info context with cache
|
|
310
|
+
* @returns Space-separated interface names or empty string
|
|
311
|
+
* @example "eth0 wlan0", "en0 en1"
|
|
312
|
+
*/
|
|
313
|
+
declare function network_interfaces(context: InfoContext): string;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Gets operating system name and version
|
|
317
|
+
* Platform-specific detection for Windows, macOS, and Linux
|
|
318
|
+
* @param context - Info context with cache
|
|
319
|
+
* @returns OS name and version string
|
|
320
|
+
* @example "Windows 11 Pro", "macOS Ventura 13.2.1", "Ubuntu 22.04.3 LTS"
|
|
321
|
+
*/
|
|
322
|
+
declare function os_info(context: InfoContext): string;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Gets available package managers and development tools
|
|
326
|
+
* Checks for package managers (apt, yum, npm, etc.) and editors (nvim, hx)
|
|
327
|
+
* @param context - Info context with cache
|
|
328
|
+
* @returns Space-separated list of available commands
|
|
329
|
+
* @example "apt npm docker nvim", "yay pacman bun hx"
|
|
330
|
+
*/
|
|
331
|
+
declare function packages(context: InfoContext): string;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Gets open TCP ports with service names
|
|
335
|
+
* Uses lsof to find listening TCP ports (Linux/macOS only)
|
|
336
|
+
* @param context - Info context with cache
|
|
337
|
+
* @returns Space-separated port+process pairs or empty string
|
|
338
|
+
* @example "80http 443http 22ssh", "3000node 5432post"
|
|
339
|
+
*/
|
|
340
|
+
declare function ports(context: InfoContext): string;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Gets memory usage in gigabytes
|
|
344
|
+
* Reads from /proc/meminfo on Linux, falls back to os.totalmem()
|
|
345
|
+
* @param context - Info context with cache
|
|
346
|
+
* @returns Memory usage as "used/total GB"
|
|
347
|
+
* @example "12/32GB", "6/16GB"
|
|
348
|
+
*/
|
|
349
|
+
declare function ram_used(context: InfoContext): string;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Saves cache to disk
|
|
353
|
+
*/
|
|
354
|
+
export declare function saveCache(cache: Cache): void;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Gets screen resolution
|
|
358
|
+
* Uses xrandr on Linux (X11/Xorg only) or system_profiler on macOS
|
|
359
|
+
* @returns Resolution in WIDTHxHEIGHT format or empty string
|
|
360
|
+
* @example "1920x1080", "2560x1440", "3840x2160"
|
|
361
|
+
*/
|
|
362
|
+
declare function screen_resolution(): string;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Gets count of running system services
|
|
366
|
+
* Uses systemctl or service command (Linux only)
|
|
367
|
+
* @param context - Info context with cache
|
|
368
|
+
* @returns Service count with "services" suffix or empty string
|
|
369
|
+
* @example "125 services", "89 services"
|
|
370
|
+
*/
|
|
371
|
+
declare function services_running(context: InfoContext): string;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Gets the current shell name
|
|
375
|
+
* Uses the user's login shell (macOS/Linux), falls back to ps for the
|
|
376
|
+
* parent process shell
|
|
377
|
+
* @returns Shell name or empty string on Windows
|
|
378
|
+
* @example "bash", "zsh", "fish", "nu"
|
|
379
|
+
*/
|
|
380
|
+
declare function shell(context: InfoContext): string;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Gets swap memory usage
|
|
384
|
+
* Calculates swap usage from /proc/meminfo (Linux) or `sysctl vm.swapusage`
|
|
385
|
+
* (macOS)
|
|
386
|
+
* @returns Swap usage as "percentage (size MB) swap" or empty string
|
|
387
|
+
* @example "15% (512MB) swap", "0% (0MB) swap"
|
|
388
|
+
*/
|
|
389
|
+
declare function swap_used(): string;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Gets system temperature in Celsius
|
|
393
|
+
* Reads from thermal zone or hwmon sensors (Linux), or from the
|
|
394
|
+
* `osx-cpu-temp` CLI (macOS, if installed via `brew install osx-cpu-temp`) -
|
|
395
|
+
* macOS has no unprivileged API for this, so nothing is reported without it
|
|
396
|
+
* @param context - Info context with cache
|
|
397
|
+
* @returns Temperature with °C suffix or empty string
|
|
398
|
+
* @example "45°C", "62°C"
|
|
399
|
+
*/
|
|
400
|
+
declare function temperature(context: InfoContext): string;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Gets the highest CPU-consuming process
|
|
404
|
+
* Uses ps command to find top process by CPU usage (Linux/macOS only)
|
|
405
|
+
* @param context - Info context with cache
|
|
406
|
+
* @returns Process info as "percentage processname" or empty string
|
|
407
|
+
* @example "8% firefox", "15% chrome", "3% systemd"
|
|
408
|
+
*/
|
|
409
|
+
declare function top_process(context: InfoContext): string;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Gets system uptime since last boot
|
|
413
|
+
* @returns Uptime formatted as "Xd Yh Zm"
|
|
414
|
+
* @example "2d 14h 23m", "0d 3h 45m"
|
|
415
|
+
*/
|
|
416
|
+
declare function uptime(): string;
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Gets the current username
|
|
420
|
+
* @returns Current system username
|
|
421
|
+
*/
|
|
422
|
+
declare function user(): string;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Gets number of logged in users
|
|
426
|
+
* Uses who command to count active user sessions (Linux/macOS only)
|
|
427
|
+
* @returns User count with "users" suffix or empty string
|
|
428
|
+
* @example "3 users", "1 users"
|
|
429
|
+
*/
|
|
430
|
+
declare function users_logged_in(): string;
|
|
431
|
+
|
|
432
|
+
export { }
|
package/dist/system-info-api.js
CHANGED