@cocorograph/hub-agent 0.7.65 → 0.7.66

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 (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/install.ps1 +13 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocorograph/hub-agent",
3
- "version": "0.7.65",
3
+ "version": "0.7.66",
4
4
  "description": "Hub Hosted Cockpit のローカル常駐 agent。Hub と outbound WSS で接続し、ローカルの tmux/pty を中継する。",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -240,23 +240,23 @@ function Set-Systemd($distro) {
240
240
  # Register a logon task that keeps the distro ALIVE (so its systemd --user
241
241
  # hub-agent stays online).
242
242
  #
243
- # 旧実装は `wsl ... /bin/true` で distro を一瞬起こすだけだった。これだと WSL2 の
244
- # アイドルシャットダウンが数十秒で distro ごと畳んでしまい (agent.log に
245
- # `SIGTERM shutting down` が出て `wsl -l -v` が Stopped になる)、hub-agent も停止して
246
- # オフラインに戻る。systemd --user + linger は「distro が起動している間」しか効かない
247
- # ため、distro 自体を起こし続ける常駐プロセスが必要。
243
+ # The old impl used `wsl ... /bin/true` to wake the distro only briefly. WSL2's
244
+ # idle shutdown then collapsed the whole distro within tens of seconds (agent.log
245
+ # shows `SIGTERM shutting down` and `wsl -l -v` goes Stopped), so hub-agent also
246
+ # stopped and went offline. systemd --user + linger only works "while the distro
247
+ # is running", so we need a resident process that keeps the distro awake.
248
248
  #
249
- # 対策: ログオン中ずっと `sleep infinity` を WSL 内で走らせて distro を起動状態に保つ。
250
- # 併せて hub-agent.service を start しておく (enable + linger 済みなら冪等)。
249
+ # Fix: run `sleep infinity` inside WSL for the whole logon session to keep the
250
+ # distro up. Also start hub-agent.service (idempotent when already enabled+linger).
251
251
  function Register-BootTask($distro, $user) {
252
252
  Write-Step "Registering autostart on logon (Task Scheduler, keep-alive)"
253
- # distro を起動し続ける keep-alive。systemctl start は冪等 (既に active なら no-op)。
253
+ # keep-alive that holds the distro up. systemctl start is idempotent (no-op if active).
254
254
  $keepalive = "systemctl --user start hub-agent.service 2>/dev/null; exec sleep infinity"
255
255
  $action = New-ScheduledTaskAction -Execute "wsl.exe" `
256
256
  -Argument "-d $distro -u $user -- bash -lc `"$keepalive`""
257
257
  $trigger = New-ScheduledTaskTrigger -AtLogOn
258
- # ExecutionTimeLimit=0 で無制限 (既定 72h で停止されると distro が落ちる)。
259
- # keep-alive が万一終了したら 1 分後に最大 3 回まで再起動。多重起動は抑止。
258
+ # ExecutionTimeLimit=0 for unlimited (default 72h would stop it and drop the distro).
259
+ # If the keep-alive ever exits, restart after 1 min up to 3 times. Multiple instances suppressed.
260
260
  $set = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries `
261
261
  -StartWhenAvailable -MultipleInstances IgnoreNew `
262
262
  -RestartInterval (New-TimeSpan -Minutes 1) -RestartCount 3 `
@@ -333,14 +333,14 @@ function Main {
333
333
  # --- autostart ---
334
334
  Register-BootTask $distro $user
335
335
 
336
- # セットアップ完了時点でオンライン化まで完結させる: keep-alive タスクを今すぐ起動し、
337
- # distro を起動状態に保つ (再ログオンを待たずに hub-agent が常駐する)。
336
+ # Finish onlining at setup time: start the keep-alive task now and keep the
337
+ # distro up (hub-agent goes resident without waiting for re-logon).
338
338
  Write-Step "Starting keep-alive now (online without re-logon)"
339
339
  try {
340
340
  Start-ScheduledTask -TaskName $TASK_NAME
341
341
  Write-Ok "Keep-alive started; hub-agent should come online shortly"
342
342
  } catch {
343
- Write-Warn "Start-ScheduledTask failed ($($_.Exception.Message)); ログオンし直すと起動します"
343
+ Write-Warn "Start-ScheduledTask failed ($($_.Exception.Message)); re-logon to start it"
344
344
  }
345
345
 
346
346
  Write-Host ""