opencode-system-metrics-tui 0.1.13 → 0.1.14

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 (3) hide show
  1. package/README.md +10 -10
  2. package/dist/tui.js +7 -0
  3. package/package.json +1 -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.13 --force
6
+ opencode plugin -g opencode-system-metrics-tui@0.1.14 --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:
@@ -120,7 +120,7 @@ npm publish --access public
120
120
  En otro equipo:
121
121
 
122
122
  ```bash
123
- opencode plugin opencode-system-metrics-tui@0.1.13
123
+ opencode plugin opencode-system-metrics-tui@0.1.14
124
124
  ```
125
125
 
126
126
  El paquete exporta tanto la raíz (`opencode-system-metrics-tui`) como `./tui`; ambas rutas cargan el mismo bundle TUI.
@@ -130,8 +130,8 @@ El instalador de OpenCode configura el plugin TUI automáticamente. Reinicia Ope
130
130
  Publicar en npm e instalar en OpenCode son pasos distintos:
131
131
 
132
132
  - `npm publish --access public` publica el paquete en npm.
133
- - `opencode plugin opencode-system-metrics-tui@0.1.13` lo instala solo en el proyecto actual.
134
- - `opencode plugin -g opencode-system-metrics-tui@0.1.13 --force` lo instala globalmente para todos los proyectos.
133
+ - `opencode plugin opencode-system-metrics-tui@0.1.14` lo instala solo en el proyecto actual.
134
+ - `opencode plugin -g opencode-system-metrics-tui@0.1.14 --force` lo instala globalmente para todos los proyectos.
135
135
 
136
136
  ### Verificación
137
137
 
@@ -231,7 +231,7 @@ npm publish --access public
231
231
  On another machine:
232
232
 
233
233
  ```bash
234
- opencode plugin opencode-system-metrics-tui@0.1.13
234
+ opencode plugin opencode-system-metrics-tui@0.1.14
235
235
  ```
236
236
 
237
237
  The package exports both the root (`opencode-system-metrics-tui`) and `./tui`; both paths load the same TUI bundle.
@@ -241,8 +241,8 @@ The OpenCode installer configures the TUI plugin automatically. Restart OpenCode
241
241
  Publishing to npm and installing in OpenCode are separate steps:
242
242
 
243
243
  - `npm publish --access public` publishes the package to npm.
244
- - `opencode plugin opencode-system-metrics-tui@0.1.13` installs it for the current project only.
245
- - `opencode plugin -g opencode-system-metrics-tui@0.1.13 --force` installs it globally for all projects.
244
+ - `opencode plugin opencode-system-metrics-tui@0.1.14` installs it for the current project only.
245
+ - `opencode plugin -g opencode-system-metrics-tui@0.1.14 --force` installs it globally for all projects.
246
246
 
247
247
  ### Verification
248
248
 
@@ -339,7 +339,7 @@ npm publish --access public
339
339
  Em outro computador:
340
340
 
341
341
  ```bash
342
- opencode plugin opencode-system-metrics-tui@0.1.13
342
+ opencode plugin opencode-system-metrics-tui@0.1.14
343
343
  ```
344
344
 
345
345
  O pacote exporta tanto a raiz (`opencode-system-metrics-tui`) quanto `./tui`; os dois caminhos carregam o mesmo bundle TUI.
@@ -349,8 +349,8 @@ O instalador do OpenCode configura o plugin TUI automaticamente. Reinicie o Open
349
349
  Publicar no npm e instalar no OpenCode são etapas diferentes:
350
350
 
351
351
  - `npm publish --access public` publica o pacote no npm.
352
- - `opencode plugin opencode-system-metrics-tui@0.1.13` instala o plugin apenas no projeto atual.
353
- - `opencode plugin -g opencode-system-metrics-tui@0.1.13 --force` instala o plugin globalmente para todos os projetos.
352
+ - `opencode plugin opencode-system-metrics-tui@0.1.14` instala o plugin apenas no projeto atual.
353
+ - `opencode plugin -g opencode-system-metrics-tui@0.1.14 --force` instala o plugin globalmente para todos os projetos.
354
354
 
355
355
  ### Verificação
356
356
 
package/dist/tui.js CHANGED
@@ -211,7 +211,14 @@ function mapMemoryBytes(totalBytes, availableBytes) {
211
211
  return { memoryTotalBytes: totalBytes, memoryAvailableBytes: Math.min(totalBytes, availableBytes) };
212
212
  }
213
213
  var reader;
214
+ function isNativeReaderAvailable(platform, bunVersion) {
215
+ return bunVersion === undefined && (platform === "linux" || platform === "win32" || platform === "darwin");
216
+ }
214
217
  async function readNativeMetrics() {
218
+ const bunVersion = process.versions.bun;
219
+ if (!isNativeReaderAvailable(process.platform, bunVersion)) {
220
+ throw new Error("Native CPU/RAM metrics are unavailable on Bun");
221
+ }
215
222
  reader ??= (async () => {
216
223
  if (process.platform === "linux")
217
224
  return createLinuxReader();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-system-metrics-tui",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "OpenCode TUI sidebar plugin for live system metrics",
5
5
  "license": "MIT",
6
6
  "type": "module",