@linxiraos/pi-stats 1.4.1 → 1.4.3
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/CHANGELOG.md +8 -0
- package/package.json +4 -4
- package/src/index.ts +10 -4
- package/src/server.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.4.3] - 2026-10-25
|
|
4
|
+
|
|
5
|
+
- Released as part of Zeta 1.4.3; no package-specific user-visible changes.
|
|
6
|
+
|
|
7
|
+
## [1.4.2] - 2026-10-24
|
|
8
|
+
|
|
9
|
+
- The standalone stats dashboard now defaults to port `43147` from `@linxiraos/pi-utils` instead of `3847`, avoiding OMP and common developer-tool ports
|
|
10
|
+
|
|
3
11
|
## [1.4.1] - 2026-10-23
|
|
4
12
|
|
|
5
13
|
- The dashboard is fully translated (English / Simplified Chinese) with an EN ⇄ 中文 switch in the top-right corner; the choice is remembered in the browser
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@linxiraos/pi-stats",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.3",
|
|
5
5
|
"description": "Local observability dashboard for omp AI usage statistics",
|
|
6
6
|
"homepage": "https://linxira-os.github.io/zeta/",
|
|
7
7
|
"author": "Linxira-OS",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@linxiraos/pi-ai": "1.4.
|
|
43
|
-
"@linxiraos/pi-catalog": "1.4.
|
|
44
|
-
"@linxiraos/pi-utils": "1.4.
|
|
42
|
+
"@linxiraos/pi-ai": "1.4.3",
|
|
43
|
+
"@linxiraos/pi-catalog": "1.4.3",
|
|
44
|
+
"@linxiraos/pi-utils": "1.4.3",
|
|
45
45
|
"lucide-react": "^1.24.0",
|
|
46
46
|
"react": "19.2.7",
|
|
47
47
|
"react-dom": "19.2.7"
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
3
|
import { parseArgs } from "node:util";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
formatDuration,
|
|
6
|
+
formatNumber,
|
|
7
|
+
formatPercent,
|
|
8
|
+
normalizePremiumRequests,
|
|
9
|
+
ZETA_STATS_PORT,
|
|
10
|
+
} from "@linxiraos/pi-utils";
|
|
5
11
|
import chalk from "@linxiraos/pi-utils/chalk";
|
|
6
12
|
import { formatErrorRate } from "./client/data/formatters";
|
|
7
13
|
import { getDashboardStats, getTotalMessageCount, syncAllSessions } from "./aggregator";
|
|
@@ -108,7 +114,7 @@ export function parseStandaloneStatsArgs(args: string[]): StandaloneStatsArgs {
|
|
|
108
114
|
const { values } = parseArgs({
|
|
109
115
|
args,
|
|
110
116
|
options: {
|
|
111
|
-
port: { type: "string", short: "p", default:
|
|
117
|
+
port: { type: "string", short: "p", default: String(ZETA_STATS_PORT) },
|
|
112
118
|
host: { type: "string", default: "127.0.0.1" },
|
|
113
119
|
json: { type: "boolean", short: "j", default: false },
|
|
114
120
|
sync: { type: "boolean", short: "s", default: false },
|
|
@@ -117,7 +123,7 @@ export function parseStandaloneStatsArgs(args: string[]): StandaloneStatsArgs {
|
|
|
117
123
|
allowPositionals: true,
|
|
118
124
|
});
|
|
119
125
|
return {
|
|
120
|
-
port: parseInt(values.port ||
|
|
126
|
+
port: parseInt(values.port || String(ZETA_STATS_PORT), 10),
|
|
121
127
|
host: values.host || "127.0.0.1",
|
|
122
128
|
json: values.json ?? false,
|
|
123
129
|
sync: values.sync ?? false,
|
|
@@ -139,7 +145,7 @@ Usage:
|
|
|
139
145
|
zeta-stats [options]
|
|
140
146
|
|
|
141
147
|
Options:
|
|
142
|
-
-p, --port <port> Port for the dashboard server (default:
|
|
148
|
+
-p, --port <port> Port for the dashboard server (default: ${ZETA_STATS_PORT})
|
|
143
149
|
--host <host> Host to bind (default: 127.0.0.1)
|
|
144
150
|
-j, --json Output stats as JSON and exit
|
|
145
151
|
-s, --sync Sync session files and show summary
|
package/src/server.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Dirent } from "node:fs";
|
|
2
2
|
import * as fs from "node:fs/promises";
|
|
3
3
|
import * as path from "node:path";
|
|
4
|
-
import { isEnoent, logger } from "@linxiraos/pi-utils";
|
|
4
|
+
import { isEnoent, logger, ZETA_STATS_PORT } from "@linxiraos/pi-utils";
|
|
5
5
|
import { $, type Server } from "bun";
|
|
6
6
|
import {
|
|
7
7
|
getCostDashboardStats,
|
|
@@ -522,7 +522,7 @@ export interface StartServerOptions {
|
|
|
522
522
|
}
|
|
523
523
|
|
|
524
524
|
export async function startServer(
|
|
525
|
-
port =
|
|
525
|
+
port = ZETA_STATS_PORT,
|
|
526
526
|
hostname = STATS_DASHBOARD_HOSTNAME,
|
|
527
527
|
options: StartServerOptions = {},
|
|
528
528
|
): Promise<StatsServerHandle> {
|