about-system 0.10.6 → 0.10.7
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 +2 -0
- package/dist/about-system-cli.js +14 -14
- package/dist/about-system-cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/system-info-api-NgTm8Gzo.js +2428 -0
- package/dist/system-info-api-NgTm8Gzo.js.map +1 -0
- package/dist/system-info-api.d.ts +4 -4
- package/dist/system-info-api.js +1 -1
- package/package.json +1 -1
- package/src/about-system-cli.ts +1 -1
- package/src/info/hardware.test.ts +28 -0
- package/src/info/hardware.ts +36 -14
- package/src/info/settings.ts +14 -1
- package/src/systeminfo-types.d.ts +9 -9
- package/dist/system-info-api-C_y-O4VW.js +0 -2409
- package/dist/system-info-api-C_y-O4VW.js.map +0 -1
package/README.md
CHANGED
|
@@ -202,7 +202,9 @@ async function getBasicInfo() {
|
|
|
202
202
|
| `isp` | Internet service provider | `👮 Verizon Business` |
|
|
203
203
|
| `os` | Operating system | `⚡ Ubuntu 22.04` |
|
|
204
204
|
| `cpu` | CPU information | `📈 Intel Core i7-8700K` |
|
|
205
|
+
| `bench` | CPU Geekbench 6 multi-core, rank, top percentile | `💪 7k #612 top 62%` |
|
|
205
206
|
| `gpu` | Graphics card | `🎮 NVIDIA GeForce RTX 3080` |
|
|
207
|
+
| `gpu_bench` | GPU Geekbench 6 OpenCL, rank, top percentile | `🏎️ 175k #140 top 14%` |
|
|
206
208
|
| `disk_used` | Disk usage percentage | `📁 75%` |
|
|
207
209
|
| `disk_size` | Disk size per real disk | `💽 256/512GB` |
|
|
208
210
|
| `ram_used` | Memory usage | `💾 8/16GB` |
|
package/dist/about-system-cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import S from "os";
|
|
|
3
3
|
import c from "fs";
|
|
4
4
|
import u from "path";
|
|
5
5
|
import { fileURLToPath as O } from "url";
|
|
6
|
-
import { g as $, a as T, b, C as j, S as k, c as g, d as B, D as I } from "./system-info-api-
|
|
6
|
+
import { g as $, a as T, b, C as j, S as k, c as g, d as B, D as I } from "./system-info-api-NgTm8Gzo.js";
|
|
7
7
|
import A from "http";
|
|
8
8
|
const C = 3777, _ = "127.0.0.1", w = {
|
|
9
9
|
".html": "text/html; charset=utf-8",
|
|
@@ -31,7 +31,7 @@ function U(e, o) {
|
|
|
31
31
|
const l = u.join(s, "index.html");
|
|
32
32
|
return c.existsSync(l) ? l : null;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function m(e, o, t, s) {
|
|
35
35
|
e.writeHead(o, {
|
|
36
36
|
"Content-Type": t,
|
|
37
37
|
"Cache-Control": "no-store",
|
|
@@ -43,21 +43,21 @@ function R(e = {}) {
|
|
|
43
43
|
return A.createServer(async (t, s) => {
|
|
44
44
|
const n = t.url ?? "/";
|
|
45
45
|
if (t.method !== "GET" && t.method !== "HEAD") {
|
|
46
|
-
|
|
46
|
+
m(s, 405, "text/plain; charset=utf-8", "Method Not Allowed");
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
if (n === "/api/info" || n.startsWith("/api/info?")) {
|
|
50
50
|
try {
|
|
51
51
|
const r = await $();
|
|
52
|
-
|
|
52
|
+
m(s, 200, w[".json"], JSON.stringify(r));
|
|
53
53
|
} catch (r) {
|
|
54
|
-
|
|
54
|
+
m(s, 500, w[".json"], JSON.stringify({ error: r.message }));
|
|
55
55
|
}
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
const l = U(o, n);
|
|
59
59
|
if (!l) {
|
|
60
|
-
|
|
60
|
+
m(
|
|
61
61
|
s,
|
|
62
62
|
404,
|
|
63
63
|
"text/plain; charset=utf-8",
|
|
@@ -66,7 +66,7 @@ function R(e = {}) {
|
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
const i = w[u.extname(l)] ?? "application/octet-stream";
|
|
69
|
-
|
|
69
|
+
m(s, 200, i, c.readFileSync(l));
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
function H(e = {}) {
|
|
@@ -101,9 +101,9 @@ function E(e, o, t) {
|
|
|
101
101
|
}
|
|
102
102
|
if (e === "ports" && t.colors[e] === "multicolor" && o) {
|
|
103
103
|
let h = ` ${t.display.show_emojis ? t.emojis.ports : ""}`;
|
|
104
|
-
const d = o.split(" "),
|
|
104
|
+
const d = o.split(" "), p = [31, 32, 33, 34, 35, 36];
|
|
105
105
|
return d.forEach((v, L) => {
|
|
106
|
-
const x =
|
|
106
|
+
const x = p[L % p.length];
|
|
107
107
|
if (s) {
|
|
108
108
|
const [W, N] = J[x];
|
|
109
109
|
h += `\x1B[${W}m\x1B[${N}m${v}\x1B[0m `;
|
|
@@ -124,10 +124,10 @@ function G(e, o) {
|
|
|
124
124
|
for (let i = 0; i < e.length; i++) {
|
|
125
125
|
const r = e[i];
|
|
126
126
|
if (r === "\x1B" && e[i + 1] === "[") {
|
|
127
|
-
let d = r,
|
|
128
|
-
for (;
|
|
129
|
-
d += e[
|
|
130
|
-
|
|
127
|
+
let d = r, p = i + 1;
|
|
128
|
+
for (; p < e.length && e[p] !== "m"; )
|
|
129
|
+
d += e[p], p++;
|
|
130
|
+
p < e.length && (d += e[p]), s += d, l = /\x1b\[0m/.test(d) ? "" : d, i = p;
|
|
131
131
|
continue;
|
|
132
132
|
}
|
|
133
133
|
let a = r, f = 1;
|
|
@@ -317,7 +317,7 @@ Available display blocks:
|
|
|
317
317
|
Basic: user, hostname, uptime, shell, os, kernel, device
|
|
318
318
|
Resources: disk_used, ram_used, memory_available, swap_used, top_process
|
|
319
319
|
Network: ip, iplocal, city, domain, isp, network_interfaces
|
|
320
|
-
Hardware: cpu, gpu, temperature, battery, screen_resolution
|
|
320
|
+
Hardware: cpu, bench, gpu, gpu_bench, temperature, battery, screen_resolution
|
|
321
321
|
System: load_average, users_logged_in, mount_points, services_running
|
|
322
322
|
Tools: pacman, ports, containers
|
|
323
323
|
`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"about-system-cli.js","sources":["../src/web-server.ts","../src/about-system-cli.ts"],"sourcesContent":["/**\n * @fileoverview `about-system web` — serves the React dashboard and a JSON API.\n *\n * The dashboard is prebuilt into dist/web by `vite build --config web/vite.config.ts`\n * and served as static files; the only dynamic route is GET /api/info, which\n * returns the same object as `about-system --json`.\n */\n\nimport http from \"http\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { getSystemInfo } from \"./system-info-api\";\n\nexport interface WebServerOptions {\n port?: number;\n host?: string;\n /** Directory holding the built dashboard. Defaults to dist/web next to this file. */\n webRoot?: string;\n}\n\nexport const DEFAULT_WEB_PORT = 3777;\nexport const DEFAULT_WEB_HOST = \"127.0.0.1\";\n\nconst MIME_TYPES: Record<string, string> = {\n \".html\": \"text/html; charset=utf-8\",\n \".js\": \"text/javascript; charset=utf-8\",\n \".css\": \"text/css; charset=utf-8\",\n \".json\": \"application/json; charset=utf-8\",\n \".svg\": \"image/svg+xml\",\n \".png\": \"image/png\",\n \".ico\": \"image/x-icon\",\n \".woff2\": \"font/woff2\",\n};\n\nfunction defaultWebRoot(): string {\n return path.join(path.dirname(fileURLToPath(import.meta.url)), \"web\");\n}\n\n/**\n * Resolves a request path to a file inside webRoot, or null if it escapes the\n * root or does not exist. Unknown paths fall back to index.html (SPA routing).\n */\nexport function resolveStaticFile(webRoot: string, urlPath: string): string | null {\n let decoded: string;\n try {\n decoded = decodeURIComponent(urlPath.split(\"?\")[0]);\n } catch {\n return null;\n }\n const root = path.resolve(webRoot);\n const candidate = path.resolve(root, \".\" + path.posix.normalize(\"/\" + decoded));\n if (candidate !== root && !candidate.startsWith(root + path.sep)) return null;\n\n if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) return candidate;\n const index = path.join(root, \"index.html\");\n return fs.existsSync(index) ? index : null;\n}\n\nfunction send(res: http.ServerResponse, status: number, type: string, body: string | Buffer): void {\n res.writeHead(status, {\n \"Content-Type\": type,\n \"Cache-Control\": \"no-store\",\n \"X-Content-Type-Options\": \"nosniff\",\n });\n res.end(body);\n}\n\nexport function createWebServer(options: WebServerOptions = {}): http.Server {\n const webRoot = options.webRoot ?? defaultWebRoot();\n\n return http.createServer(async (req, res) => {\n const url = req.url ?? \"/\";\n\n if (req.method !== \"GET\" && req.method !== \"HEAD\") {\n send(res, 405, \"text/plain; charset=utf-8\", \"Method Not Allowed\");\n return;\n }\n\n if (url === \"/api/info\" || url.startsWith(\"/api/info?\")) {\n try {\n const info = await getSystemInfo();\n send(res, 200, MIME_TYPES[\".json\"], JSON.stringify(info));\n } catch (error) {\n send(res, 500, MIME_TYPES[\".json\"], JSON.stringify({ error: (error as Error).message }));\n }\n return;\n }\n\n const file = resolveStaticFile(webRoot, url);\n if (!file) {\n send(\n res,\n 404,\n \"text/plain; charset=utf-8\",\n \"Dashboard not found. Build it with: npm run build:web\"\n );\n return;\n }\n const type = MIME_TYPES[path.extname(file)] ?? \"application/octet-stream\";\n send(res, 200, type, fs.readFileSync(file));\n });\n}\n\n/** Starts the dashboard server and resolves with the URL it is listening on. */\nexport function startWebServer(options: WebServerOptions = {}): Promise<{ server: http.Server; url: string }> {\n const port = options.port ?? DEFAULT_WEB_PORT;\n const host = options.host ?? DEFAULT_WEB_HOST;\n const server = createWebServer(options);\n\n return new Promise((resolve, reject) => {\n server.once(\"error\", reject);\n server.listen(port, host, () => {\n const address = server.address();\n const actualPort = typeof address === \"object\" && address ? address.port : port;\n const shownHost = host === \"0.0.0.0\" || host === \"::\" ? \"localhost\" : host;\n resolve({ server, url: `http://${shownHost}:${actualPort}` });\n });\n });\n}\n","#!/usr/bin/env node\nimport os from \"os\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { getSystemInfo } from \"./system-info-api\";\nimport type { SystemInfo, SystemInfoOptions } from \"./systeminfo-types\";\nimport { startWebServer, DEFAULT_WEB_PORT, DEFAULT_WEB_HOST } from \"./web-server\";\n\nconst __filename = fileURLToPath(import.meta.url);\n\nimport {\n Settings,\n DEFAULT_SETTINGS,\n colors,\n backgrounds,\n SETTINGS_FILE,\n CACHE_FILE,\n loadSettings,\n saveSettings,\n} from \"./info/settings\";\n\n// Platform detection\nconst IS_WINDOWS = os.platform() === \"win32\";\n\n// Foreground code -> [background code, contrasting text code] for the\n// legacy 8-color multicolor rotation (ports/pacman rainbow mode).\nconst MULTICOLOR_BG: Record<number, [number, number]> = {\n 31: [41, 97], // red\n 32: [42, 30], // green\n 33: [43, 30], // yellow\n 34: [44, 97], // blue\n 35: [45, 97], // magenta\n 36: [46, 30], // cyan\n};\n\nfunction formatValue(key: string, value: string, settings: Settings): string {\n if (!value || value.trim() === \"\") return \"\";\n\n const showBackgrounds = settings.display.show_backgrounds !== false;\n const colorName = settings.colors[key] as keyof typeof colors;\n const bg = backgrounds[colorName as keyof typeof backgrounds];\n const style = (showBackgrounds && bg) || colors[colorName] || colors.reset;\n const suffix = showBackgrounds ? colors.reset : \"\";\n const emoji = settings.display.show_emojis ? settings.emojis[key] || \"\" : \"\";\n\n // Special handling for battery emoji\n if (key === \"battery\" && settings.display.show_emojis) {\n const batteryEmoji = value.includes(\"+\")\n ? settings.emojis.battery_charging\n : settings.emojis.battery;\n return `${style}${batteryEmoji}${value}${suffix}`;\n }\n\n // Multicolor handling for ports\n if (key === \"ports\" && settings.colors[key] === \"multicolor\" && value) {\n const emoji = settings.display.show_emojis ? settings.emojis.ports : \"\";\n let output = ` ${emoji}`;\n const ports = value.split(\" \");\n const colorCodes = [31, 32, 33, 34, 35, 36];\n ports.forEach((port, index) => {\n const colorCode = colorCodes[index % colorCodes.length];\n if (showBackgrounds) {\n const [bgCode, textCode] = MULTICOLOR_BG[colorCode];\n output += `\\x1b[${bgCode}m\\x1b[${textCode}m${port}\\x1b[0m `;\n } else {\n output += `\\x1b[${colorCode}m${port}\\x1b[0m `;\n }\n });\n return output.trim();\n }\n\n // Multicolor handling for pacman\n if (key === \"pacman\" && settings.colors[key] === \"multicolor\" && value) {\n const emoji = settings.display.show_emojis ? settings.emojis.pacman : \"\";\n return `${style}${emoji}${value}${suffix}`;\n }\n\n return `${style}${emoji}${value}${suffix}`;\n}\n\n/**\n * Wraps text to a maximum visible width, filling each line completely with\n * characters before moving on. Unlike block-boundary wrapping, this breaks in\n * the middle of an info block when it doesn't fit, so no visible space is left\n * unused at the end of a line.\n *\n * ANSI color codes are copied verbatim and never counted toward the width, and\n * the active color is re-applied at the start of each wrapped line so colors\n * survive a mid-block break. Emoji surrogate pairs are kept intact.\n *\n * @param text - The text to wrap (may contain ANSI escape sequences)\n * @param maxLength - Maximum visible characters per line\n * @returns Array of wrapped lines\n */\nfunction wrapAnsiText(text: string, maxLength: number): string[] {\n if (maxLength <= 0) return text ? [text] : [];\n\n const lines: string[] = [];\n let currentLine = \"\";\n let visibleCount = 0;\n let activeAnsi = \"\";\n\n for (let i = 0; i < text.length; i++) {\n const char = text[i];\n\n // Copy ANSI escape sequences verbatim without counting them.\n if (char === \"\\x1b\" && text[i + 1] === \"[\") {\n let seq = char;\n let j = i + 1;\n while (j < text.length && text[j] !== \"m\") {\n seq += text[j];\n j++;\n }\n if (j < text.length) seq += text[j]; // include the trailing \"m\"\n currentLine += seq;\n // Track the active color so wrapped lines keep it; a reset clears it.\n activeAnsi = /\\x1b\\[0m/.test(seq) ? \"\" : seq;\n i = j;\n continue;\n }\n\n // Keep an emoji (surrogate pair) together and count it as width 2.\n let unit = char;\n let width = 1;\n const code = text.charCodeAt(i);\n if (code >= 0xd800 && code <= 0xdbff && i + 1 < text.length) {\n unit = char + text[i + 1];\n width = 2;\n i++;\n }\n\n // Line is full: break here, even in the middle of an info block.\n if (visibleCount >= maxLength) {\n lines.push(currentLine);\n currentLine = activeAnsi;\n visibleCount = 0;\n }\n\n currentLine += unit;\n visibleCount += width;\n }\n\n if (currentLine) lines.push(currentLine);\n\n return lines;\n}\n\nasync function displaySystemInfo(\n customDisplayOrder: string[][] | null = null\n): Promise<void> {\n const settings = loadSettings();\n const displayOrder = customDisplayOrder || settings.display_order;\n\n // Get system info\n const info = await getSystemInfo();\n\n // Single line mode\n if (settings.display.single_line) {\n const allItems: string[] = [];\n\n for (const group of displayOrder) {\n for (const key of group) {\n const value = info[key as keyof SystemInfo] as string;\n const formatted = formatValue(key, value, settings);\n if (formatted && formatted.trim()) {\n allItems.push(formatted);\n }\n }\n }\n\n if (allItems.length > 0) {\n console.log(allItems.join(\" \") + colors.reset);\n }\n return;\n }\n\n // Multi-line mode: fill each line completely with characters, wrapping in\n // the middle of an info block when it no longer fits.\n const maxLineLength = settings.display.line_wrap_length;\n const allItems: string[] = [];\n\n for (const group of displayOrder) {\n for (const key of group) {\n const value = info[key as keyof SystemInfo] as string;\n const formatted = formatValue(key, value, settings);\n\n if (formatted && formatted.trim()) {\n allItems.push(formatted);\n }\n }\n }\n\n const lines = wrapAnsiText(allItems.join(\" \"), maxLineLength);\n\n // Output\n if (lines.length > 0) {\n lines.forEach((line) => {\n console.log(line + colors.reset);\n });\n } else if (settings.advanced.debug) {\n console.log(\"No system information could be displayed\");\n }\n}\n\nfunction handleSettingsCommand(args: string[]): boolean {\n const settings = loadSettings();\n\n if (args.includes(\"--settings-init\")) {\n if (saveSettings(DEFAULT_SETTINGS)) {\n console.log(\"Settings initialized with defaults\");\n } else {\n console.log(\"Failed to initialize settings\");\n }\n return true;\n }\n\n if (args.includes(\"--settings-show\")) {\n console.log(\"Current settings:\");\n console.log(JSON.stringify(settings, null, 2));\n return true;\n }\n\n if (args.includes(\"--settings-reset\")) {\n if (saveSettings(DEFAULT_SETTINGS)) {\n console.log(\"Settings reset to defaults\");\n } else {\n console.log(\"Failed to reset settings\");\n }\n return true;\n }\n\n if (args.includes(\"--refresh\")) {\n try {\n if (fs.existsSync(CACHE_FILE)) {\n fs.unlinkSync(CACHE_FILE);\n console.log(\"Cache cleared\");\n }\n } catch (error) {\n console.error(\"Error clearing cache:\", (error as Error).message);\n }\n return true;\n }\n\n const setIndex = args.indexOf(\"--set\");\n if (setIndex !== -1 && args[setIndex + 1] && args[setIndex + 2]) {\n const key = args[setIndex + 1];\n const value = args[setIndex + 2];\n\n try {\n const parsedValue =\n value.startsWith(\"{\") || value.startsWith(\"[\")\n ? JSON.parse(value)\n : value === \"true\"\n ? true\n : value === \"false\"\n ? false\n : value;\n\n const keys = key.split(\".\");\n let current: any = settings;\n for (let i = 0; i < keys.length - 1; i++) {\n if (!current[keys[i]]) current[keys[i]] = {};\n current = current[keys[i]];\n }\n current[keys[keys.length - 1]] = parsedValue;\n\n if (saveSettings(settings)) {\n console.log(`Setting ${key} = ${value}`);\n } else {\n console.log(\"Failed to save settings\");\n }\n } catch (error) {\n console.error(\"Error setting value:\", (error as Error).message);\n }\n return true;\n }\n\n return false;\n}\n\nfunction installShellGreeting(): void {\n const homeDir = os.homedir();\n\n let configDir: string, scriptPath: string;\n if (IS_WINDOWS) {\n configDir = path.join(homeDir, \"AppData\", \"Local\");\n scriptPath = path.join(configDir, \"systeminfo\");\n } else {\n configDir = path.join(homeDir, \".config\");\n scriptPath = path.join(configDir, \"systeminfo\");\n }\n\n const currentScript = path.resolve(__filename);\n\n try {\n if (!fs.existsSync(configDir)) {\n fs.mkdirSync(configDir, { recursive: true });\n }\n\n fs.copyFileSync(currentScript, scriptPath);\n if (!IS_WINDOWS) {\n fs.chmodSync(scriptPath, \"755\");\n }\n\n if (IS_WINDOWS) {\n console.log(\"Windows installation:\");\n console.log(\"1. Script copied to:\", scriptPath);\n console.log(\"2. To add to PowerShell profile, run:\");\n console.log(` Add-Content $PROFILE \"node '${scriptPath}'\"`);\n console.log(\n \"3. To add to Command Prompt, create a batch file in your startup folder\"\n );\n\n const startupBat = path.join(configDir, \"systeminfo-startup.bat\");\n fs.writeFileSync(startupBat, `@echo off\\nnode \"${scriptPath}\"\\n`);\n console.log(\"4. Batch file created:\", startupBat);\n } else {\n try {\n const hushLoginPath = path.join(homeDir, \".hushlogin\");\n fs.writeFileSync(hushLoginPath, \"\");\n } catch {}\n\n const bashrcPath = path.join(homeDir, \".bashrc\");\n const bashLine = `node ${scriptPath}`;\n\n if (fs.existsSync(bashrcPath)) {\n const bashrc = fs.readFileSync(bashrcPath, \"utf8\");\n if (!bashrc.includes(\"systeminfo\")) {\n fs.appendFileSync(bashrcPath, `\\n${bashLine}\\n`);\n }\n } else {\n fs.writeFileSync(bashrcPath, `${bashLine}\\n`);\n }\n\n const zshrcPath = path.join(homeDir, \".zshrc\");\n if (fs.existsSync(zshrcPath)) {\n const zshrc = fs.readFileSync(zshrcPath, \"utf8\");\n if (!zshrc.includes(\"systeminfo\")) {\n fs.appendFileSync(zshrcPath, `\\n${bashLine}\\n`);\n }\n }\n\n const fishConfigPath = path.join(\n homeDir,\n \".config\",\n \"fish\",\n \"config.fish\"\n );\n if (fs.existsSync(fishConfigPath)) {\n const fishConfig = fs.readFileSync(fishConfigPath, \"utf8\");\n if (!fishConfig.includes(\"systeminfo\")) {\n fs.appendFileSync(\n fishConfigPath,\n `\\nset -U fish_greeting \"\"\\n${bashLine}\\n`\n );\n }\n }\n\n const nushellConfigPath = path.join(\n homeDir,\n \".config\",\n \"nushell\",\n \"config.nu\"\n );\n if (fs.existsSync(nushellConfigPath)) {\n const nushellConfig = fs.readFileSync(nushellConfigPath, \"utf8\");\n if (!nushellConfig.includes(\"systeminfo\")) {\n fs.appendFileSync(\n nushellConfigPath,\n `\\n$env.config.show_banner = false\\n${bashLine}\\n`\n );\n }\n }\n }\n\n console.log(\"Shell greeting installation completed!\");\n } catch (error) {\n console.error(\"Error installing shell greeting:\", (error as Error).message);\n process.exit(1);\n }\n}\n\n/** Reads `--flag value` or `--flag=value` from args. */\nfunction flagValue(args: string[], flag: string): string | undefined {\n for (let i = 0; i < args.length; i++) {\n if (args[i] === flag) return args[i + 1];\n if (args[i].startsWith(flag + \"=\")) return args[i].slice(flag.length + 1);\n }\n return undefined;\n}\n\nasync function runWebServer(args: string[]): Promise<void> {\n const rawPort = flagValue(args, \"--port\") ?? process.env.PORT;\n const port = rawPort === undefined ? DEFAULT_WEB_PORT : Number(rawPort);\n if (!Number.isInteger(port) || port < 0 || port > 65535) {\n throw new Error(`Invalid port: ${rawPort}`);\n }\n const host = flagValue(args, \"--host\") ?? DEFAULT_WEB_HOST;\n\n const { url } = await startWebServer({ port, host });\n console.log(`About System web UI running at ${url}`);\n if (host === DEFAULT_WEB_HOST) {\n console.log(\"Listening on localhost only. Use --host 0.0.0.0 to expose it on the network.\");\n } else {\n console.log(\"Warning: system details (public IP, ports, processes) are visible to anyone who can reach this port.\");\n }\n console.log(\"Press Ctrl+C to stop.\");\n}\n\nfunction parseCLIMode(args: string[]): string[] | null {\n for (const arg of args) {\n if (!arg.startsWith(\"--\") && arg.includes(\",\")) {\n return arg\n .split(\",\")\n .map((part) => part.trim())\n .filter((part) => part.length > 0);\n }\n }\n\n for (const arg of args) {\n if (!arg.startsWith(\"--\") && !arg.includes(\"=\") && arg.length > 0) {\n return [arg.trim()];\n }\n }\n\n return null;\n}\n\nasync function showHelp(): Promise<void> {\n console.log(`\nSystem Info Script - TypeScript Version\n\nUsage:\n about-system [options]\n about-system <part1,part2,...> # CLI mode: show specific parts only\n about-system web [--port N] [--host H] # Serve the web dashboard\n\nOptions:\n --help, -h Show this help message\n --install Install as shell greeting\n --settings-init Initialize settings file with defaults\n --settings-show Display current settings\n --settings-reset Reset settings to defaults\n --refresh Clear the cache file\n --set <key> <value> Set a configuration value (use dot notation)\n --json Output as JSON\n\nExamples:\n about-system # Show all info (default)\n about-system cpu,os # Show only CPU and OS info\n about-system user,hostname,ip # Show user, hostname, and IP\n about-system disk_used # Show only disk usage\n about-system --install\n about-system --set display.show_emojis false\n about-system --set display.show_backgrounds false\n about-system --set colors.user blue\n about-system --set emojis.cpu \"🚀 \"\n about-system --set labels.cpu \"Processor\"\n about-system --json\n about-system web # http://127.0.0.1:${DEFAULT_WEB_PORT}\n about-system web --port 8080 --host 0.0.0.0\n\nSettings file: ${SETTINGS_FILE}\nCache file: ${CACHE_FILE}\n\nPlatform: ${\n IS_WINDOWS\n ? \"Windows\"\n : os.platform() === \"darwin\"\n ? \"macOS\"\n : os.platform() === \"linux\"\n ? \"Linux\"\n : \"Unknown\"\n }\n\nAvailable display blocks:\n Basic: user, hostname, uptime, shell, os, kernel, device\n Resources: disk_used, ram_used, memory_available, swap_used, top_process\n Network: ip, iplocal, city, domain, isp, network_interfaces\n Hardware: cpu, gpu, temperature, battery, screen_resolution\n System: load_average, users_logged_in, mount_points, services_running\n Tools: pacman, ports, containers\n`);\n}\n\nasync function main(): Promise<void> {\n const args = process.argv.slice(2);\n\n if (handleSettingsCommand(args)) {\n return;\n }\n\n if (args.includes(\"--help\") || args.includes(\"-h\")) {\n await showHelp();\n return;\n }\n\n if (args.includes(\"--install\")) {\n installShellGreeting();\n return;\n }\n\n if (args[0] === \"web\" || args.includes(\"--web\")) {\n await runWebServer(args);\n return;\n }\n\n if (args.includes(\"--json\")) {\n const info = await getSystemInfo();\n console.log(JSON.stringify(info, null, 2));\n return;\n }\n\n const cliParts = parseCLIMode(args);\n if (cliParts) {\n const customDisplayOrder = [cliParts];\n await displaySystemInfo(customDisplayOrder);\n return;\n }\n\n await displaySystemInfo();\n}\n\nmain().catch((error) => {\n console.error(\"Error:\", error.message);\n process.exit(1);\n});\n\nexport { displaySystemInfo, installShellGreeting };\n"],"names":["DEFAULT_WEB_PORT","DEFAULT_WEB_HOST","MIME_TYPES","defaultWebRoot","path","fileURLToPath","resolveStaticFile","webRoot","urlPath","decoded","root","candidate","fs","index","send","res","status","type","body","createWebServer","options","http","req","url","info","getSystemInfo","error","file","startWebServer","port","host","server","resolve","reject","address","actualPort","__filename","IS_WINDOWS","os","MULTICOLOR_BG","formatValue","key","value","settings","showBackgrounds","colorName","bg","backgrounds","style","colors","suffix","emoji","batteryEmoji","output","ports","colorCodes","colorCode","bgCode","textCode","wrapAnsiText","text","maxLength","lines","currentLine","visibleCount","activeAnsi","char","seq","j","unit","width","code","displaySystemInfo","customDisplayOrder","loadSettings","displayOrder","allItems","group","formatted","maxLineLength","line","handleSettingsCommand","args","saveSettings","DEFAULT_SETTINGS","CACHE_FILE","setIndex","parsedValue","keys","current","i","installShellGreeting","homeDir","configDir","scriptPath","currentScript","startupBat","hushLoginPath","bashrcPath","bashLine","zshrcPath","fishConfigPath","nushellConfigPath","flagValue","flag","runWebServer","rawPort","parseCLIMode","arg","part","showHelp","SETTINGS_FILE","main","cliParts"],"mappings":";;;;;;;AAqBO,MAAMA,IAAmB,MACnBC,IAAmB,aAE1BC,IAAqC;AAAA,EACzC,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AACZ;AAEA,SAASC,IAAyB;AAChC,SAAOC,EAAK,KAAKA,EAAK,QAAQC,EAAc,YAAY,GAAG,CAAC,GAAG,KAAK;AACtE;AAMO,SAASC,EAAkBC,GAAiBC,GAAgC;AACjF,MAAIC;AACJ,MAAI;AACF,IAAAA,IAAU,mBAAmBD,EAAQ,MAAM,GAAG,EAAE,CAAC,CAAC;AAAA,EACpD,QAAQ;AACN,WAAO;AAAA,EACT;AACA,QAAME,IAAON,EAAK,QAAQG,CAAO,GAC3BI,IAAYP,EAAK,QAAQM,GAAM,MAAMN,EAAK,MAAM,UAAU,MAAMK,CAAO,CAAC;AAC9E,MAAIE,MAAcD,KAAQ,CAACC,EAAU,WAAWD,IAAON,EAAK,GAAG,EAAG,QAAO;AAEzE,MAAIQ,EAAG,WAAWD,CAAS,KAAKC,EAAG,SAASD,CAAS,EAAE,OAAA,EAAU,QAAOA;AACxE,QAAME,IAAQT,EAAK,KAAKM,GAAM,YAAY;AAC1C,SAAOE,EAAG,WAAWC,CAAK,IAAIA,IAAQ;AACxC;AAEA,SAASC,EAAKC,GAA0BC,GAAgBC,GAAcC,GAA6B;AACjG,EAAAH,EAAI,UAAUC,GAAQ;AAAA,IACpB,gBAAgBC;AAAA,IAChB,iBAAiB;AAAA,IACjB,0BAA0B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Q,CACM;AAC1C;AAAA,EACF;AAEA,QAAMzC,EAAA;AACR;AAEAwC,IAAO,MAAM,CAACtF,MAAU;AACtB,UAAQ,MAAM,UAAUA,EAAM,OAAO,GACrC,QAAQ,KAAK,CAAC;AAChB,CAAC;"}
|
|
1
|
+
{"version":3,"file":"about-system-cli.js","sources":["../src/web-server.ts","../src/about-system-cli.ts"],"sourcesContent":["/**\n * @fileoverview `about-system web` — serves the React dashboard and a JSON API.\n *\n * The dashboard is prebuilt into dist/web by `vite build --config web/vite.config.ts`\n * and served as static files; the only dynamic route is GET /api/info, which\n * returns the same object as `about-system --json`.\n */\n\nimport http from \"http\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { getSystemInfo } from \"./system-info-api\";\n\nexport interface WebServerOptions {\n port?: number;\n host?: string;\n /** Directory holding the built dashboard. Defaults to dist/web next to this file. */\n webRoot?: string;\n}\n\nexport const DEFAULT_WEB_PORT = 3777;\nexport const DEFAULT_WEB_HOST = \"127.0.0.1\";\n\nconst MIME_TYPES: Record<string, string> = {\n \".html\": \"text/html; charset=utf-8\",\n \".js\": \"text/javascript; charset=utf-8\",\n \".css\": \"text/css; charset=utf-8\",\n \".json\": \"application/json; charset=utf-8\",\n \".svg\": \"image/svg+xml\",\n \".png\": \"image/png\",\n \".ico\": \"image/x-icon\",\n \".woff2\": \"font/woff2\",\n};\n\nfunction defaultWebRoot(): string {\n return path.join(path.dirname(fileURLToPath(import.meta.url)), \"web\");\n}\n\n/**\n * Resolves a request path to a file inside webRoot, or null if it escapes the\n * root or does not exist. Unknown paths fall back to index.html (SPA routing).\n */\nexport function resolveStaticFile(webRoot: string, urlPath: string): string | null {\n let decoded: string;\n try {\n decoded = decodeURIComponent(urlPath.split(\"?\")[0]);\n } catch {\n return null;\n }\n const root = path.resolve(webRoot);\n const candidate = path.resolve(root, \".\" + path.posix.normalize(\"/\" + decoded));\n if (candidate !== root && !candidate.startsWith(root + path.sep)) return null;\n\n if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) return candidate;\n const index = path.join(root, \"index.html\");\n return fs.existsSync(index) ? index : null;\n}\n\nfunction send(res: http.ServerResponse, status: number, type: string, body: string | Buffer): void {\n res.writeHead(status, {\n \"Content-Type\": type,\n \"Cache-Control\": \"no-store\",\n \"X-Content-Type-Options\": \"nosniff\",\n });\n res.end(body);\n}\n\nexport function createWebServer(options: WebServerOptions = {}): http.Server {\n const webRoot = options.webRoot ?? defaultWebRoot();\n\n return http.createServer(async (req, res) => {\n const url = req.url ?? \"/\";\n\n if (req.method !== \"GET\" && req.method !== \"HEAD\") {\n send(res, 405, \"text/plain; charset=utf-8\", \"Method Not Allowed\");\n return;\n }\n\n if (url === \"/api/info\" || url.startsWith(\"/api/info?\")) {\n try {\n const info = await getSystemInfo();\n send(res, 200, MIME_TYPES[\".json\"], JSON.stringify(info));\n } catch (error) {\n send(res, 500, MIME_TYPES[\".json\"], JSON.stringify({ error: (error as Error).message }));\n }\n return;\n }\n\n const file = resolveStaticFile(webRoot, url);\n if (!file) {\n send(\n res,\n 404,\n \"text/plain; charset=utf-8\",\n \"Dashboard not found. Build it with: npm run build:web\"\n );\n return;\n }\n const type = MIME_TYPES[path.extname(file)] ?? \"application/octet-stream\";\n send(res, 200, type, fs.readFileSync(file));\n });\n}\n\n/** Starts the dashboard server and resolves with the URL it is listening on. */\nexport function startWebServer(options: WebServerOptions = {}): Promise<{ server: http.Server; url: string }> {\n const port = options.port ?? DEFAULT_WEB_PORT;\n const host = options.host ?? DEFAULT_WEB_HOST;\n const server = createWebServer(options);\n\n return new Promise((resolve, reject) => {\n server.once(\"error\", reject);\n server.listen(port, host, () => {\n const address = server.address();\n const actualPort = typeof address === \"object\" && address ? address.port : port;\n const shownHost = host === \"0.0.0.0\" || host === \"::\" ? \"localhost\" : host;\n resolve({ server, url: `http://${shownHost}:${actualPort}` });\n });\n });\n}\n","#!/usr/bin/env node\nimport os from \"os\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { getSystemInfo } from \"./system-info-api\";\nimport type { SystemInfo, SystemInfoOptions } from \"./systeminfo-types\";\nimport { startWebServer, DEFAULT_WEB_PORT, DEFAULT_WEB_HOST } from \"./web-server\";\n\nconst __filename = fileURLToPath(import.meta.url);\n\nimport {\n Settings,\n DEFAULT_SETTINGS,\n colors,\n backgrounds,\n SETTINGS_FILE,\n CACHE_FILE,\n loadSettings,\n saveSettings,\n} from \"./info/settings\";\n\n// Platform detection\nconst IS_WINDOWS = os.platform() === \"win32\";\n\n// Foreground code -> [background code, contrasting text code] for the\n// legacy 8-color multicolor rotation (ports/pacman rainbow mode).\nconst MULTICOLOR_BG: Record<number, [number, number]> = {\n 31: [41, 97], // red\n 32: [42, 30], // green\n 33: [43, 30], // yellow\n 34: [44, 97], // blue\n 35: [45, 97], // magenta\n 36: [46, 30], // cyan\n};\n\nfunction formatValue(key: string, value: string, settings: Settings): string {\n if (!value || value.trim() === \"\") return \"\";\n\n const showBackgrounds = settings.display.show_backgrounds !== false;\n const colorName = settings.colors[key] as keyof typeof colors;\n const bg = backgrounds[colorName as keyof typeof backgrounds];\n const style = (showBackgrounds && bg) || colors[colorName] || colors.reset;\n const suffix = showBackgrounds ? colors.reset : \"\";\n const emoji = settings.display.show_emojis ? settings.emojis[key] || \"\" : \"\";\n\n // Special handling for battery emoji\n if (key === \"battery\" && settings.display.show_emojis) {\n const batteryEmoji = value.includes(\"+\")\n ? settings.emojis.battery_charging\n : settings.emojis.battery;\n return `${style}${batteryEmoji}${value}${suffix}`;\n }\n\n // Multicolor handling for ports\n if (key === \"ports\" && settings.colors[key] === \"multicolor\" && value) {\n const emoji = settings.display.show_emojis ? settings.emojis.ports : \"\";\n let output = ` ${emoji}`;\n const ports = value.split(\" \");\n const colorCodes = [31, 32, 33, 34, 35, 36];\n ports.forEach((port, index) => {\n const colorCode = colorCodes[index % colorCodes.length];\n if (showBackgrounds) {\n const [bgCode, textCode] = MULTICOLOR_BG[colorCode];\n output += `\\x1b[${bgCode}m\\x1b[${textCode}m${port}\\x1b[0m `;\n } else {\n output += `\\x1b[${colorCode}m${port}\\x1b[0m `;\n }\n });\n return output.trim();\n }\n\n // Multicolor handling for pacman\n if (key === \"pacman\" && settings.colors[key] === \"multicolor\" && value) {\n const emoji = settings.display.show_emojis ? settings.emojis.pacman : \"\";\n return `${style}${emoji}${value}${suffix}`;\n }\n\n return `${style}${emoji}${value}${suffix}`;\n}\n\n/**\n * Wraps text to a maximum visible width, filling each line completely with\n * characters before moving on. Unlike block-boundary wrapping, this breaks in\n * the middle of an info block when it doesn't fit, so no visible space is left\n * unused at the end of a line.\n *\n * ANSI color codes are copied verbatim and never counted toward the width, and\n * the active color is re-applied at the start of each wrapped line so colors\n * survive a mid-block break. Emoji surrogate pairs are kept intact.\n *\n * @param text - The text to wrap (may contain ANSI escape sequences)\n * @param maxLength - Maximum visible characters per line\n * @returns Array of wrapped lines\n */\nfunction wrapAnsiText(text: string, maxLength: number): string[] {\n if (maxLength <= 0) return text ? [text] : [];\n\n const lines: string[] = [];\n let currentLine = \"\";\n let visibleCount = 0;\n let activeAnsi = \"\";\n\n for (let i = 0; i < text.length; i++) {\n const char = text[i];\n\n // Copy ANSI escape sequences verbatim without counting them.\n if (char === \"\\x1b\" && text[i + 1] === \"[\") {\n let seq = char;\n let j = i + 1;\n while (j < text.length && text[j] !== \"m\") {\n seq += text[j];\n j++;\n }\n if (j < text.length) seq += text[j]; // include the trailing \"m\"\n currentLine += seq;\n // Track the active color so wrapped lines keep it; a reset clears it.\n activeAnsi = /\\x1b\\[0m/.test(seq) ? \"\" : seq;\n i = j;\n continue;\n }\n\n // Keep an emoji (surrogate pair) together and count it as width 2.\n let unit = char;\n let width = 1;\n const code = text.charCodeAt(i);\n if (code >= 0xd800 && code <= 0xdbff && i + 1 < text.length) {\n unit = char + text[i + 1];\n width = 2;\n i++;\n }\n\n // Line is full: break here, even in the middle of an info block.\n if (visibleCount >= maxLength) {\n lines.push(currentLine);\n currentLine = activeAnsi;\n visibleCount = 0;\n }\n\n currentLine += unit;\n visibleCount += width;\n }\n\n if (currentLine) lines.push(currentLine);\n\n return lines;\n}\n\nasync function displaySystemInfo(\n customDisplayOrder: string[][] | null = null\n): Promise<void> {\n const settings = loadSettings();\n const displayOrder = customDisplayOrder || settings.display_order;\n\n // Get system info\n const info = await getSystemInfo();\n\n // Single line mode\n if (settings.display.single_line) {\n const allItems: string[] = [];\n\n for (const group of displayOrder) {\n for (const key of group) {\n const value = info[key as keyof SystemInfo] as string;\n const formatted = formatValue(key, value, settings);\n if (formatted && formatted.trim()) {\n allItems.push(formatted);\n }\n }\n }\n\n if (allItems.length > 0) {\n console.log(allItems.join(\" \") + colors.reset);\n }\n return;\n }\n\n // Multi-line mode: fill each line completely with characters, wrapping in\n // the middle of an info block when it no longer fits.\n const maxLineLength = settings.display.line_wrap_length;\n const allItems: string[] = [];\n\n for (const group of displayOrder) {\n for (const key of group) {\n const value = info[key as keyof SystemInfo] as string;\n const formatted = formatValue(key, value, settings);\n\n if (formatted && formatted.trim()) {\n allItems.push(formatted);\n }\n }\n }\n\n const lines = wrapAnsiText(allItems.join(\" \"), maxLineLength);\n\n // Output\n if (lines.length > 0) {\n lines.forEach((line) => {\n console.log(line + colors.reset);\n });\n } else if (settings.advanced.debug) {\n console.log(\"No system information could be displayed\");\n }\n}\n\nfunction handleSettingsCommand(args: string[]): boolean {\n const settings = loadSettings();\n\n if (args.includes(\"--settings-init\")) {\n if (saveSettings(DEFAULT_SETTINGS)) {\n console.log(\"Settings initialized with defaults\");\n } else {\n console.log(\"Failed to initialize settings\");\n }\n return true;\n }\n\n if (args.includes(\"--settings-show\")) {\n console.log(\"Current settings:\");\n console.log(JSON.stringify(settings, null, 2));\n return true;\n }\n\n if (args.includes(\"--settings-reset\")) {\n if (saveSettings(DEFAULT_SETTINGS)) {\n console.log(\"Settings reset to defaults\");\n } else {\n console.log(\"Failed to reset settings\");\n }\n return true;\n }\n\n if (args.includes(\"--refresh\")) {\n try {\n if (fs.existsSync(CACHE_FILE)) {\n fs.unlinkSync(CACHE_FILE);\n console.log(\"Cache cleared\");\n }\n } catch (error) {\n console.error(\"Error clearing cache:\", (error as Error).message);\n }\n return true;\n }\n\n const setIndex = args.indexOf(\"--set\");\n if (setIndex !== -1 && args[setIndex + 1] && args[setIndex + 2]) {\n const key = args[setIndex + 1];\n const value = args[setIndex + 2];\n\n try {\n const parsedValue =\n value.startsWith(\"{\") || value.startsWith(\"[\")\n ? JSON.parse(value)\n : value === \"true\"\n ? true\n : value === \"false\"\n ? false\n : value;\n\n const keys = key.split(\".\");\n let current: any = settings;\n for (let i = 0; i < keys.length - 1; i++) {\n if (!current[keys[i]]) current[keys[i]] = {};\n current = current[keys[i]];\n }\n current[keys[keys.length - 1]] = parsedValue;\n\n if (saveSettings(settings)) {\n console.log(`Setting ${key} = ${value}`);\n } else {\n console.log(\"Failed to save settings\");\n }\n } catch (error) {\n console.error(\"Error setting value:\", (error as Error).message);\n }\n return true;\n }\n\n return false;\n}\n\nfunction installShellGreeting(): void {\n const homeDir = os.homedir();\n\n let configDir: string, scriptPath: string;\n if (IS_WINDOWS) {\n configDir = path.join(homeDir, \"AppData\", \"Local\");\n scriptPath = path.join(configDir, \"systeminfo\");\n } else {\n configDir = path.join(homeDir, \".config\");\n scriptPath = path.join(configDir, \"systeminfo\");\n }\n\n const currentScript = path.resolve(__filename);\n\n try {\n if (!fs.existsSync(configDir)) {\n fs.mkdirSync(configDir, { recursive: true });\n }\n\n fs.copyFileSync(currentScript, scriptPath);\n if (!IS_WINDOWS) {\n fs.chmodSync(scriptPath, \"755\");\n }\n\n if (IS_WINDOWS) {\n console.log(\"Windows installation:\");\n console.log(\"1. Script copied to:\", scriptPath);\n console.log(\"2. To add to PowerShell profile, run:\");\n console.log(` Add-Content $PROFILE \"node '${scriptPath}'\"`);\n console.log(\n \"3. To add to Command Prompt, create a batch file in your startup folder\"\n );\n\n const startupBat = path.join(configDir, \"systeminfo-startup.bat\");\n fs.writeFileSync(startupBat, `@echo off\\nnode \"${scriptPath}\"\\n`);\n console.log(\"4. Batch file created:\", startupBat);\n } else {\n try {\n const hushLoginPath = path.join(homeDir, \".hushlogin\");\n fs.writeFileSync(hushLoginPath, \"\");\n } catch {}\n\n const bashrcPath = path.join(homeDir, \".bashrc\");\n const bashLine = `node ${scriptPath}`;\n\n if (fs.existsSync(bashrcPath)) {\n const bashrc = fs.readFileSync(bashrcPath, \"utf8\");\n if (!bashrc.includes(\"systeminfo\")) {\n fs.appendFileSync(bashrcPath, `\\n${bashLine}\\n`);\n }\n } else {\n fs.writeFileSync(bashrcPath, `${bashLine}\\n`);\n }\n\n const zshrcPath = path.join(homeDir, \".zshrc\");\n if (fs.existsSync(zshrcPath)) {\n const zshrc = fs.readFileSync(zshrcPath, \"utf8\");\n if (!zshrc.includes(\"systeminfo\")) {\n fs.appendFileSync(zshrcPath, `\\n${bashLine}\\n`);\n }\n }\n\n const fishConfigPath = path.join(\n homeDir,\n \".config\",\n \"fish\",\n \"config.fish\"\n );\n if (fs.existsSync(fishConfigPath)) {\n const fishConfig = fs.readFileSync(fishConfigPath, \"utf8\");\n if (!fishConfig.includes(\"systeminfo\")) {\n fs.appendFileSync(\n fishConfigPath,\n `\\nset -U fish_greeting \"\"\\n${bashLine}\\n`\n );\n }\n }\n\n const nushellConfigPath = path.join(\n homeDir,\n \".config\",\n \"nushell\",\n \"config.nu\"\n );\n if (fs.existsSync(nushellConfigPath)) {\n const nushellConfig = fs.readFileSync(nushellConfigPath, \"utf8\");\n if (!nushellConfig.includes(\"systeminfo\")) {\n fs.appendFileSync(\n nushellConfigPath,\n `\\n$env.config.show_banner = false\\n${bashLine}\\n`\n );\n }\n }\n }\n\n console.log(\"Shell greeting installation completed!\");\n } catch (error) {\n console.error(\"Error installing shell greeting:\", (error as Error).message);\n process.exit(1);\n }\n}\n\n/** Reads `--flag value` or `--flag=value` from args. */\nfunction flagValue(args: string[], flag: string): string | undefined {\n for (let i = 0; i < args.length; i++) {\n if (args[i] === flag) return args[i + 1];\n if (args[i].startsWith(flag + \"=\")) return args[i].slice(flag.length + 1);\n }\n return undefined;\n}\n\nasync function runWebServer(args: string[]): Promise<void> {\n const rawPort = flagValue(args, \"--port\") ?? process.env.PORT;\n const port = rawPort === undefined ? DEFAULT_WEB_PORT : Number(rawPort);\n if (!Number.isInteger(port) || port < 0 || port > 65535) {\n throw new Error(`Invalid port: ${rawPort}`);\n }\n const host = flagValue(args, \"--host\") ?? DEFAULT_WEB_HOST;\n\n const { url } = await startWebServer({ port, host });\n console.log(`About System web UI running at ${url}`);\n if (host === DEFAULT_WEB_HOST) {\n console.log(\"Listening on localhost only. Use --host 0.0.0.0 to expose it on the network.\");\n } else {\n console.log(\"Warning: system details (public IP, ports, processes) are visible to anyone who can reach this port.\");\n }\n console.log(\"Press Ctrl+C to stop.\");\n}\n\nfunction parseCLIMode(args: string[]): string[] | null {\n for (const arg of args) {\n if (!arg.startsWith(\"--\") && arg.includes(\",\")) {\n return arg\n .split(\",\")\n .map((part) => part.trim())\n .filter((part) => part.length > 0);\n }\n }\n\n for (const arg of args) {\n if (!arg.startsWith(\"--\") && !arg.includes(\"=\") && arg.length > 0) {\n return [arg.trim()];\n }\n }\n\n return null;\n}\n\nasync function showHelp(): Promise<void> {\n console.log(`\nSystem Info Script - TypeScript Version\n\nUsage:\n about-system [options]\n about-system <part1,part2,...> # CLI mode: show specific parts only\n about-system web [--port N] [--host H] # Serve the web dashboard\n\nOptions:\n --help, -h Show this help message\n --install Install as shell greeting\n --settings-init Initialize settings file with defaults\n --settings-show Display current settings\n --settings-reset Reset settings to defaults\n --refresh Clear the cache file\n --set <key> <value> Set a configuration value (use dot notation)\n --json Output as JSON\n\nExamples:\n about-system # Show all info (default)\n about-system cpu,os # Show only CPU and OS info\n about-system user,hostname,ip # Show user, hostname, and IP\n about-system disk_used # Show only disk usage\n about-system --install\n about-system --set display.show_emojis false\n about-system --set display.show_backgrounds false\n about-system --set colors.user blue\n about-system --set emojis.cpu \"🚀 \"\n about-system --set labels.cpu \"Processor\"\n about-system --json\n about-system web # http://127.0.0.1:${DEFAULT_WEB_PORT}\n about-system web --port 8080 --host 0.0.0.0\n\nSettings file: ${SETTINGS_FILE}\nCache file: ${CACHE_FILE}\n\nPlatform: ${\n IS_WINDOWS\n ? \"Windows\"\n : os.platform() === \"darwin\"\n ? \"macOS\"\n : os.platform() === \"linux\"\n ? \"Linux\"\n : \"Unknown\"\n }\n\nAvailable display blocks:\n Basic: user, hostname, uptime, shell, os, kernel, device\n Resources: disk_used, ram_used, memory_available, swap_used, top_process\n Network: ip, iplocal, city, domain, isp, network_interfaces\n Hardware: cpu, bench, gpu, gpu_bench, temperature, battery, screen_resolution\n System: load_average, users_logged_in, mount_points, services_running\n Tools: pacman, ports, containers\n`);\n}\n\nasync function main(): Promise<void> {\n const args = process.argv.slice(2);\n\n if (handleSettingsCommand(args)) {\n return;\n }\n\n if (args.includes(\"--help\") || args.includes(\"-h\")) {\n await showHelp();\n return;\n }\n\n if (args.includes(\"--install\")) {\n installShellGreeting();\n return;\n }\n\n if (args[0] === \"web\" || args.includes(\"--web\")) {\n await runWebServer(args);\n return;\n }\n\n if (args.includes(\"--json\")) {\n const info = await getSystemInfo();\n console.log(JSON.stringify(info, null, 2));\n return;\n }\n\n const cliParts = parseCLIMode(args);\n if (cliParts) {\n const customDisplayOrder = [cliParts];\n await displaySystemInfo(customDisplayOrder);\n return;\n }\n\n await displaySystemInfo();\n}\n\nmain().catch((error) => {\n console.error(\"Error:\", error.message);\n process.exit(1);\n});\n\nexport { displaySystemInfo, installShellGreeting };\n"],"names":["DEFAULT_WEB_PORT","DEFAULT_WEB_HOST","MIME_TYPES","defaultWebRoot","path","fileURLToPath","resolveStaticFile","webRoot","urlPath","decoded","root","candidate","fs","index","send","res","status","type","body","createWebServer","options","http","req","url","info","getSystemInfo","error","file","startWebServer","port","host","server","resolve","reject","address","actualPort","__filename","IS_WINDOWS","os","MULTICOLOR_BG","formatValue","key","value","settings","showBackgrounds","colorName","bg","backgrounds","style","colors","suffix","emoji","batteryEmoji","output","ports","colorCodes","colorCode","bgCode","textCode","wrapAnsiText","text","maxLength","lines","currentLine","visibleCount","activeAnsi","char","seq","j","unit","width","code","displaySystemInfo","customDisplayOrder","loadSettings","displayOrder","allItems","group","formatted","maxLineLength","line","handleSettingsCommand","args","saveSettings","DEFAULT_SETTINGS","CACHE_FILE","setIndex","parsedValue","keys","current","i","installShellGreeting","homeDir","configDir","scriptPath","currentScript","startupBat","hushLoginPath","bashrcPath","bashLine","zshrcPath","fishConfigPath","nushellConfigPath","flagValue","flag","runWebServer","rawPort","parseCLIMode","arg","part","showHelp","SETTINGS_FILE","main","cliParts"],"mappings":";;;;;;;AAqBO,MAAMA,IAAmB,MACnBC,IAAmB,aAE1BC,IAAqC;AAAA,EACzC,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AACZ;AAEA,SAASC,IAAyB;AAChC,SAAOC,EAAK,KAAKA,EAAK,QAAQC,EAAc,YAAY,GAAG,CAAC,GAAG,KAAK;AACtE;AAMO,SAASC,EAAkBC,GAAiBC,GAAgC;AACjF,MAAIC;AACJ,MAAI;AACF,IAAAA,IAAU,mBAAmBD,EAAQ,MAAM,GAAG,EAAE,CAAC,CAAC;AAAA,EACpD,QAAQ;AACN,WAAO;AAAA,EACT;AACA,QAAME,IAAON,EAAK,QAAQG,CAAO,GAC3BI,IAAYP,EAAK,QAAQM,GAAM,MAAMN,EAAK,MAAM,UAAU,MAAMK,CAAO,CAAC;AAC9E,MAAIE,MAAcD,KAAQ,CAACC,EAAU,WAAWD,IAAON,EAAK,GAAG,EAAG,QAAO;AAEzE,MAAIQ,EAAG,WAAWD,CAAS,KAAKC,EAAG,SAASD,CAAS,EAAE,OAAA,EAAU,QAAOA;AACxE,QAAME,IAAQT,EAAK,KAAKM,GAAM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