From 49dd307dc6648510b17fd2a630853c8a1f491dda Mon Sep 17 00:00:00 2001
From: HeftyKoo
Date: Tue, 13 Oct 2026 18:29:20 +0800
Subject: [PATCH] feat(terminal): add safe updates and release host 0.4.1
---
.github/workflows/release.yml | 2 +-
CHANGELOG.md | 10 ++
README.md | 2 +
README.zh-CN.md | 2 +
apps/terminal-surface/src/index.html | 1 +
apps/terminal-surface/src/main.ts | 15 +++
apps/terminal-surface/src/style.css | 2 +-
docs/one-command-setup.md | 15 ++-
docs/releasing.md | 18 ++--
docs/store-site/privacy.md | 6 +-
docs/store-site/support.md | 4 +-
packages/terminal-host/README.md | 20 +++-
packages/terminal-host/package.json | 4 +-
packages/terminal-host/src/cli.ts | 74 +++++++++++++-
.../src/host.integration.test.ts | 50 +++++++++-
packages/terminal-host/src/management.test.ts | 22 +++++
packages/terminal-host/src/management.ts | 56 +++++++++++
packages/terminal-host/src/service.test.ts | 45 ++++++++-
packages/terminal-host/src/service.ts | 54 +++++++++-
packages/terminal-host/src/updates.test.ts | 72 ++++++++++++++
packages/terminal-host/src/updates.ts | 98 +++++++++++++++++++
packages/terminal-host/src/upgrade.test.ts | 63 ++++++++++++
packages/terminal-host/src/upgrade.ts | 69 +++++++++++++
packages/terminal-host/src/version.ts | 9 ++
pnpm-lock.yaml | 18 ++++
release-contract.json | 4 +-
scripts/install.sh | 2 +-
scripts/install.test.mjs | 2 +-
28 files changed, 709 insertions(+), 30 deletions(-)
create mode 100644 packages/terminal-host/src/management.test.ts
create mode 100644 packages/terminal-host/src/management.ts
create mode 100644 packages/terminal-host/src/updates.test.ts
create mode 100644 packages/terminal-host/src/updates.ts
create mode 100644 packages/terminal-host/src/upgrade.test.ts
create mode 100644 packages/terminal-host/src/upgrade.ts
create mode 100644 packages/terminal-host/src/version.ts
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 22d3a69..f92836a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -7,7 +7,7 @@ on:
description: Existing release tag to publish or retry
required: true
type: choice
- options: [dsh-v0.4.0, terminal-v0.4.0, ext-v0.4.0, dsh-v0.3.0, terminal-v0.3.0, ext-v0.3.0, dsh-v0.2.0, terminal-v0.2.0, terminal-v0.2.1, ext-v0.2.0, ext-v0.2.1]
+ options: [terminal-v0.4.1, dsh-v0.4.0, terminal-v0.4.0, ext-v0.4.0, dsh-v0.3.0, terminal-v0.3.0, ext-v0.3.0, dsh-v0.2.0, terminal-v0.2.0, terminal-v0.2.1, ext-v0.2.0, ext-v0.2.1]
push:
tags: ["ext-v*", "dsh-v*", "terminal-v*"]
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e2e3d8e..56c9364 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,15 @@
# Changelog
+## Terminal host 0.4.1 — 2026-10-13
+
+- Add terminal-host version reporting, daily asynchronous npm update checks with caching/backoff, persistent opt-out, and reminders in the private management page and service log.
+- Add `aow update` for explicit global npm upgrades in the original prefix, retaining CLI integrations and enrolled browser origins. Add `aow service restart` and running-version verification. Both protect live shells unless `--force` is explicit and pause new shells during maintenance.
+- Keep automatic checks separate from installation; version-pinned release installers and the extension/DSH update paths remain independent.
+
+### Upgrade
+
+For the first upgrade from 0.4.0 or earlier, finish terminal work, run `aow service uninstall`, and rerun the installer. This installs 0.4.1 and starts the update-capable host. Subsequent upgrades use `aow update` in a separate macOS Terminal after exiting or closing live shells. `aow service restart` reloads already-installed code; explicit `--force` ends live tasks. Chrome/Firefox/Safari extensions and the DSH plugin remain at 0.4.0 with connector protocol 1.
+
## 0.4.0 — 2026-10-13
- Add Pi session status, approval and completion notifications alongside Codex and Claude Code.
diff --git a/README.md b/README.md
index 68564b7..9f873fd 100644
--- a/README.md
+++ b/README.md
@@ -71,6 +71,8 @@ For Pi 1.1+, run `pi` in the same terminal. Setup adds `extensions/agentonweb.ts
Use **+** in the terminal tab bar to open another project, click a tab to switch, double-click its name to rename it, or click **×** to close it. Hiding the workspace or refreshing the page keeps your sessions running.
+Terminal host 0.4.1 checks for stable npm updates daily and shows reminders in its private management page. Use `aow check-update` to check now or `aow check-update --disable` to turn automatic checks off. After closing live terminals, run `aow update` in a separate macOS Terminal; `aow service restart` reloads already-installed code. For the first upgrade from 0.4.0 or earlier, finish terminal work, run `aow service uninstall`, then rerun the installer.
+
[Setup and troubleshooting](docs/one-command-setup.md) · [Terminal guide](packages/terminal-host/README.md)
## Use DeepSeek Harness
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 2d3dd46..7079c40 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -71,6 +71,8 @@ codex
点击终端标签栏的 **+** 打开另一个项目,点击标签切换,双击名称重命名,点击 **×** 关闭。隐藏工作区或刷新网页不会中断正在运行的会话。
+终端主机 0.4.1 每天检查 npm 正式版,并在本地管理页显示更新提醒。运行 `aow check-update` 可立即检查,`aow check-update --disable` 可关闭自动检查。退出或关闭所有终端后,在 Mac 的独立“终端”窗口运行 `aow update` 升级;`aow service restart` 用于加载已安装的新代码。从 0.4.0 或更早版本首次升级时,请先完成终端任务,运行 `aow service uninstall`,再重新运行安装命令。
+
[安装与常见问题](docs/one-command-setup.md) · [终端指南](packages/terminal-host/README.md)
## 使用 DeepSeek Harness
diff --git a/apps/terminal-surface/src/index.html b/apps/terminal-surface/src/index.html
index e042ccd..7c675aa 100644
--- a/apps/terminal-surface/src/index.html
+++ b/apps/terminal-surface/src/index.html
@@ -25,6 +25,7 @@
+