ai-battery 0.1.15 → 0.1.16

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 CHANGED
@@ -1,5 +1,7 @@
1
1
  # AI Battery
2
2
 
3
+ [한국어](README.md) · [English](docs/i18n/en/) · [日本語](docs/i18n/ja/) · [中文](docs/i18n/zh/) · [Español](docs/i18n/es/)
4
+
3
5
  Codex and Claude Usage Battery Meter
4
6
 
5
7
  Codex와 Claude Code의 남은 사용량을 배터리처럼 확인하는 터미널 상태 표시 도구입니다.
@@ -661,6 +661,20 @@ function runPowerShell(command) {
661
661
  });
662
662
  }
663
663
 
664
+ function refreshWslHudScriptCopy() {
665
+ if (!useWsl) return null;
666
+ const result = runPowerShell([
667
+ "$dir = Join-Path $env:LOCALAPPDATA 'ai-battery'",
668
+ "New-Item -ItemType Directory -Force -Path $dir | Out-Null",
669
+ "$hud = Join-Path $dir 'ai-battery-hud.ps1'",
670
+ `Copy-Item ${psSingleQuote(hudScript)} $hud -Force -ErrorAction Stop`,
671
+ "Write-Output $hud"
672
+ ].join("; "));
673
+ if (result.status !== 0) return null;
674
+ const output = (result.stdout || "").trim().split(/\r?\n/).filter(Boolean).pop();
675
+ return output || null;
676
+ }
677
+
664
678
  function hudProcessStatus() {
665
679
  const query = "$hud = Get-CimInstance Win32_Process | Where-Object { "
666
680
  + "$_.ProcessId -ne $PID -and "
@@ -756,6 +770,7 @@ if (subcommand === "autostart") {
756
770
  process.exit(0);
757
771
  }
758
772
 
773
+ const launchHudScript = stop ? hudScript : (refreshWslHudScriptCopy() || hudScript);
759
774
  const wasRunning = (!foreground && !once && !stop)
760
775
  ? hudProcessStatus().startsWith("running ")
761
776
  : false;
@@ -782,7 +797,7 @@ if (useWsl) {
782
797
  hudScriptArgs.push("-UseWsl");
783
798
  }
784
799
 
785
- const psArgs = powerShellCommandArgs(hudScript, hudScriptArgs);
800
+ const psArgs = powerShellCommandArgs(launchHudScript, hudScriptArgs);
786
801
 
787
802
  if (foreground || once || stop) {
788
803
  const result = spawnSync(powershell, psArgs, { stdio: "inherit", windowsHide: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-battery",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Tiny terminal battery meter for local Codex and Claude Code usage.",
5
5
  "type": "module",
6
6
  "keywords": [