opencode-system-metrics-tui 0.1.8 → 0.1.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.
- package/README.md +13 -12
- package/dist/tui.js +18 -7
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## Install globally in OpenCode
|
|
4
4
|
|
|
5
5
|
```powershell
|
|
6
|
-
opencode plugin -g opencode-system-metrics-tui@0.1.
|
|
6
|
+
opencode plugin -g opencode-system-metrics-tui@0.1.10 --force
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
This is the primary installation path. The version must match `package.json`; `--force` asks OpenCode to refresh its package cache. The helper below skips OpenCode when the expected artifact is already current. Verify the actual installed artifact afterward:
|
|
@@ -31,7 +31,7 @@ The README is available in **Español**, **English**, and **Português**.
|
|
|
31
31
|
- RAM: memoria usada, total y porcentaje.
|
|
32
32
|
- GPU: utilización y temperatura.
|
|
33
33
|
- GPU VRAM: memoria usada, total y porcentaje.
|
|
34
|
-
- En Apple Silicon, la fila se muestra como **
|
|
34
|
+
- En Apple Silicon, la fila se muestra como **RAM** y usa los contadores generales de memoria del sistema.
|
|
35
35
|
- Red: velocidad de descarga y subida en tiempo real.
|
|
36
36
|
- CPU, RAM y red se consultan con una cadencia general de 2 segundos; GPU, VRAM y temperaturas usan una caché expirable de 10 segundos para reducir el coste sin congelar los sensores.
|
|
37
37
|
- Colores compatibles con el tema activo de OpenCode.
|
|
@@ -93,7 +93,7 @@ npm publish --access public
|
|
|
93
93
|
En otro equipo:
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
|
-
opencode plugin opencode-system-metrics-tui@0.1.
|
|
96
|
+
opencode plugin opencode-system-metrics-tui@0.1.10
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
El paquete exporta tanto la raíz (`opencode-system-metrics-tui`) como `./tui`; ambas rutas cargan el mismo bundle TUI.
|
|
@@ -103,8 +103,8 @@ El instalador de OpenCode configura el plugin TUI automáticamente. Reinicia Ope
|
|
|
103
103
|
Publicar en npm e instalar en OpenCode son pasos distintos:
|
|
104
104
|
|
|
105
105
|
- `npm publish --access public` publica el paquete en npm.
|
|
106
|
-
- `opencode plugin opencode-system-metrics-tui@0.1.
|
|
107
|
-
- `opencode plugin -g opencode-system-metrics-tui@0.1.
|
|
106
|
+
- `opencode plugin opencode-system-metrics-tui@0.1.10` lo instala solo en el proyecto actual.
|
|
107
|
+
- `opencode plugin -g opencode-system-metrics-tui@0.1.10 --force` lo instala globalmente para todos los proyectos.
|
|
108
108
|
|
|
109
109
|
### Verificación
|
|
110
110
|
|
|
@@ -126,7 +126,7 @@ npm run build
|
|
|
126
126
|
- RAM: used memory, total memory, and percentage.
|
|
127
127
|
- GPU: utilization and temperature.
|
|
128
128
|
- GPU VRAM: used memory, total memory, and percentage.
|
|
129
|
-
- On Apple Silicon, the row is labeled **
|
|
129
|
+
- On Apple Silicon, the row is labeled **RAM** and uses the system-wide memory counters.
|
|
130
130
|
- Network: live download and upload speeds.
|
|
131
131
|
- CPU, RAM, and network use the 2-second general cadence; GPU, VRAM, and temperatures use an expiring 10-second cache to reduce cost without freezing sensors.
|
|
132
132
|
- Uses the active OpenCode theme colors.
|
|
@@ -188,7 +188,7 @@ npm publish --access public
|
|
|
188
188
|
On another machine:
|
|
189
189
|
|
|
190
190
|
```bash
|
|
191
|
-
opencode plugin opencode-system-metrics-tui@0.1.
|
|
191
|
+
opencode plugin opencode-system-metrics-tui@0.1.10
|
|
192
192
|
```
|
|
193
193
|
|
|
194
194
|
The package exports both the root (`opencode-system-metrics-tui`) and `./tui`; both paths load the same TUI bundle.
|
|
@@ -198,8 +198,8 @@ The OpenCode installer configures the TUI plugin automatically. Restart OpenCode
|
|
|
198
198
|
Publishing to npm and installing in OpenCode are separate steps:
|
|
199
199
|
|
|
200
200
|
- `npm publish --access public` publishes the package to npm.
|
|
201
|
-
- `opencode plugin opencode-system-metrics-tui@0.1.
|
|
202
|
-
- `opencode plugin -g opencode-system-metrics-tui@0.1.
|
|
201
|
+
- `opencode plugin opencode-system-metrics-tui@0.1.10` installs it for the current project only.
|
|
202
|
+
- `opencode plugin -g opencode-system-metrics-tui@0.1.10 --force` installs it globally for all projects.
|
|
203
203
|
|
|
204
204
|
### Verification
|
|
205
205
|
|
|
@@ -221,6 +221,7 @@ npm run build
|
|
|
221
221
|
- RAM: memória usada, total e porcentagem.
|
|
222
222
|
- GPU: utilização e temperatura.
|
|
223
223
|
- GPU VRAM: memória usada, total e porcentagem.
|
|
224
|
+
- No Apple Silicon, a linha de memória compartilhada é exibida como **RAM** e usa os contadores gerais de memória do sistema.
|
|
224
225
|
- Rede: velocidades de download e upload em tempo real.
|
|
225
226
|
- CPU, RAM e rede usam a cadência geral de 2 segundos; GPU, VRAM e temperaturas usam uma cache expirável de 10 segundos para reduzir o custo sem congelar os sensores.
|
|
226
227
|
- Usa as cores do tema ativo do OpenCode.
|
|
@@ -281,7 +282,7 @@ npm publish --access public
|
|
|
281
282
|
Em outro computador:
|
|
282
283
|
|
|
283
284
|
```bash
|
|
284
|
-
opencode plugin opencode-system-metrics-tui@0.1.
|
|
285
|
+
opencode plugin opencode-system-metrics-tui@0.1.10
|
|
285
286
|
```
|
|
286
287
|
|
|
287
288
|
O pacote exporta tanto a raiz (`opencode-system-metrics-tui`) quanto `./tui`; os dois caminhos carregam o mesmo bundle TUI.
|
|
@@ -291,8 +292,8 @@ O instalador do OpenCode configura o plugin TUI automaticamente. Reinicie o Open
|
|
|
291
292
|
Publicar no npm e instalar no OpenCode são etapas diferentes:
|
|
292
293
|
|
|
293
294
|
- `npm publish --access public` publica o pacote no npm.
|
|
294
|
-
- `opencode plugin opencode-system-metrics-tui@0.1.
|
|
295
|
-
- `opencode plugin -g opencode-system-metrics-tui@0.1.
|
|
295
|
+
- `opencode plugin opencode-system-metrics-tui@0.1.10` instala o plugin apenas no projeto atual.
|
|
296
|
+
- `opencode plugin -g opencode-system-metrics-tui@0.1.10 --force` instala o plugin globalmente para todos os projetos.
|
|
296
297
|
|
|
297
298
|
### Verificação
|
|
298
299
|
|
package/dist/tui.js
CHANGED
|
@@ -6,7 +6,7 @@ import { insertNode as _$insertNode } from "@opentui/solid";
|
|
|
6
6
|
import { insert as _$insert } from "@opentui/solid";
|
|
7
7
|
import { setProp as _$setProp } from "@opentui/solid";
|
|
8
8
|
import { createElement as _$createElement } from "@opentui/solid";
|
|
9
|
-
import { createSignal, onCleanup, onMount } from "solid-js";
|
|
9
|
+
import { createMemo, createSignal, onCleanup, onMount } from "solid-js";
|
|
10
10
|
import { TextAttributes } from "@opentui/core";
|
|
11
11
|
|
|
12
12
|
// src/format.ts
|
|
@@ -64,7 +64,7 @@ function gpuMemoryLabel(architecture, platform = process.platform) {
|
|
|
64
64
|
if (platform !== "darwin")
|
|
65
65
|
return "GPU VRAM";
|
|
66
66
|
if (architecture === "arm64")
|
|
67
|
-
return "
|
|
67
|
+
return "RAM";
|
|
68
68
|
if (architecture === "x86_64")
|
|
69
69
|
return "GPU VRAM";
|
|
70
70
|
return "Memory";
|
|
@@ -515,6 +515,17 @@ function systemMetricsTitle() {
|
|
|
515
515
|
function MetricsPanel(props) {
|
|
516
516
|
onMount(startMetricsPolling);
|
|
517
517
|
onCleanup(stopMetricsPolling);
|
|
518
|
+
const gpuMemory = createMemo(() => {
|
|
519
|
+
const metrics = metricsState.sharedMetrics();
|
|
520
|
+
const unified = metrics.gpuMemoryIsUnified === true;
|
|
521
|
+
return {
|
|
522
|
+
icon: unified ? icons.ram : icons.vram,
|
|
523
|
+
label: gpuMemoryLabel(unified ? "arm64" : metrics.gpuMemoryIsUnified === false ? "x86_64" : undefined),
|
|
524
|
+
usedBytes: unified ? metrics.memoryUsedBytes : metrics.gpuMemoryUsedBytes,
|
|
525
|
+
totalBytes: unified ? metrics.memoryTotalBytes : metrics.gpuMemoryTotalBytes,
|
|
526
|
+
percent: unified ? metrics.memoryPercent : metrics.gpuMemoryPercent
|
|
527
|
+
};
|
|
528
|
+
});
|
|
518
529
|
return (() => {
|
|
519
530
|
var _el$ = _$createElement("box"), _el$2 = _$createElement("text"), _el$3 = _$createTextNode(` `), _el$4 = _$createElement("box"), _el$5 = _$createElement("text"), _el$6 = _$createElement("text"), _el$8 = _$createElement("text"), _el$9 = _$createTextNode(` · `), _el$0 = _$createTextNode(` `), _el$1 = _$createElement("box"), _el$10 = _$createElement("text"), _el$11 = _$createElement("text"), _el$13 = _$createElement("text"), _el$14 = _$createTextNode(` / `), _el$15 = _$createTextNode(` (`), _el$16 = _$createTextNode(`)`), _el$17 = _$createElement("box"), _el$18 = _$createElement("text"), _el$19 = _$createElement("text"), _el$21 = _$createElement("text"), _el$22 = _$createTextNode(` · `), _el$23 = _$createTextNode(` `), _el$24 = _$createElement("box"), _el$25 = _$createElement("text"), _el$26 = _$createElement("text"), _el$27 = _$createTextNode(` `), _el$28 = _$createTextNode(` `), _el$29 = _$createElement("text"), _el$30 = _$createTextNode(` / `), _el$31 = _$createTextNode(` (`), _el$32 = _$createTextNode(`)`), _el$33 = _$createElement("box"), _el$34 = _$createElement("text"), _el$35 = _$createElement("text"), _el$37 = _$createElement("text"), _el$38 = _$createTextNode(`↓ `), _el$39 = _$createTextNode(` ↑ `);
|
|
520
531
|
_$insertNode(_el$, _el$2);
|
|
@@ -567,16 +578,16 @@ function MetricsPanel(props) {
|
|
|
567
578
|
_$insertNode(_el$24, _el$26);
|
|
568
579
|
_$insertNode(_el$24, _el$29);
|
|
569
580
|
_$setProp(_el$24, "flexDirection", "row");
|
|
570
|
-
_$insert(_el$25, () =>
|
|
581
|
+
_$insert(_el$25, () => gpuMemory().icon);
|
|
571
582
|
_$insertNode(_el$26, _el$27);
|
|
572
583
|
_$insertNode(_el$26, _el$28);
|
|
573
|
-
_$insert(_el$26, () =>
|
|
584
|
+
_$insert(_el$26, () => gpuMemory().label, _el$28);
|
|
574
585
|
_$insertNode(_el$29, _el$30);
|
|
575
586
|
_$insertNode(_el$29, _el$31);
|
|
576
587
|
_$insertNode(_el$29, _el$32);
|
|
577
|
-
_$insert(_el$29, () => formatGiB(
|
|
578
|
-
_$insert(_el$29, () => formatGiB(
|
|
579
|
-
_$insert(_el$29, () => formatPercent(
|
|
588
|
+
_$insert(_el$29, () => formatGiB(gpuMemory().usedBytes), _el$30);
|
|
589
|
+
_$insert(_el$29, () => formatGiB(gpuMemory().totalBytes), _el$31);
|
|
590
|
+
_$insert(_el$29, () => formatPercent(gpuMemory().percent), _el$32);
|
|
580
591
|
_$insertNode(_el$33, _el$34);
|
|
581
592
|
_$insertNode(_el$33, _el$35);
|
|
582
593
|
_$insertNode(_el$33, _el$37);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-system-metrics-tui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "OpenCode TUI sidebar plugin for live system metrics",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@opentui/core": "^0.5.10",
|
|
35
35
|
"@opentui/solid": "^0.5.10",
|
|
36
|
+
"opencode-system-metrics-tui": "^0.1.8",
|
|
36
37
|
"solid-js": "^1.9.12",
|
|
37
38
|
"systeminformation": "^5.33.8"
|
|
38
39
|
},
|