aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorkangal-bot <285672167+kangal-bot@users.noreply.github.com>2026-09-20 21:51:02 +0000
committerkangal-bot <285672167+kangal-bot@users.noreply.github.com>2026-09-20 21:51:02 +0000
commit95e97bff3ac090ffc71bf24174ccc2449e97bcc6 (patch)
treede2d7e900166b21ccdc4106ab96b59f92b619e00 /docs
parent0ff0f27e222633c97ba4291f6b9be4137002ca84 (diff)
docs: publish preview documentation
Diffstat (limited to 'docs')
-rw-r--r--docs/preview/website/src/content/docs/cli-reference.mdx2
-rw-r--r--docs/preview/website/src/content/docs/configuration.mdx2
-rw-r--r--docs/preview/website/src/content/docs/connecting-machines.mdx6
-rw-r--r--docs/preview/website/src/content/docs/integrations.mdx4
-rw-r--r--docs/preview/website/src/content/docs/ja/cli-reference.mdx12
-rw-r--r--docs/preview/website/src/content/docs/ja/configuration.mdx4
-rw-r--r--docs/preview/website/src/content/docs/ja/connecting-machines.mdx14
-rw-r--r--docs/preview/website/src/content/docs/ja/integrations.mdx2
-rw-r--r--docs/preview/website/src/content/docs/ja/keyboard.mdx20
-rw-r--r--docs/preview/website/src/content/docs/ja/persistence-remote.mdx6
-rw-r--r--docs/preview/website/src/content/docs/ja/quick-start.mdx4
-rw-r--r--docs/preview/website/src/content/docs/ja/session-state.mdx26
-rw-r--r--docs/preview/website/src/content/docs/ja/socket-api.mdx14
-rw-r--r--docs/preview/website/src/content/docs/ja/windows-beta.mdx7
-rw-r--r--docs/preview/website/src/content/docs/keyboard.mdx20
-rw-r--r--docs/preview/website/src/content/docs/session-state.mdx25
-rw-r--r--docs/preview/website/src/content/docs/socket-api.mdx48
-rw-r--r--docs/preview/website/src/content/docs/zh-cn/cli-reference.mdx12
-rw-r--r--docs/preview/website/src/content/docs/zh-cn/connecting-machines.mdx14
-rw-r--r--docs/preview/website/src/content/docs/zh-cn/integrations.mdx2
-rw-r--r--docs/preview/website/src/content/docs/zh-cn/keyboard.mdx20
-rw-r--r--docs/preview/website/src/content/docs/zh-cn/persistence-remote.mdx6
-rw-r--r--docs/preview/website/src/content/docs/zh-cn/quick-start.mdx4
-rw-r--r--docs/preview/website/src/content/docs/zh-cn/session-state.mdx26
-rw-r--r--docs/preview/website/src/content/docs/zh-cn/socket-api.mdx14
-rw-r--r--docs/preview/website/src/content/docs/zh-cn/windows-beta.mdx7
-rw-r--r--docs/preview/website/src/data/config-reference.json8
27 files changed, 276 insertions, 53 deletions
diff --git a/docs/preview/website/src/content/docs/cli-reference.mdx b/docs/preview/website/src/content/docs/cli-reference.mdx
index 9f61d02d..cf9b355f 100644
--- a/docs/preview/website/src/content/docs/cli-reference.mdx
+++ b/docs/preview/website/src/content/docs/cli-reference.mdx
@@ -197,6 +197,8 @@ herdr tab close <tab_id>
A tab is another terminal layout inside a workspace. Without `--workspace`, `tab create` uses the active workspace and fails if none exists. Its JSON response exposes `.result.tab.tab_id` and `.result.root_pane.pane_id`. Closing a workspace's last tab also closes the workspace, matching the TUI close-tab action. If `confirm_close` is enabled and closing the tab would also close a whole worktree group, `tab close` returns a `confirmation_required` error instead.
+With `ui.confirm_close` enabled, the TUI asks for confirmation before closing a workspace's last tab from a keybinding or the tab menu. Ordinary CLI/API tab closes remain immediate.
+
Workspace and tab creation, and pane splitting, leave focus unchanged by default. `--focus` selects the new layout; `--no-focus` states the default explicitly. Without `--cwd`, new terminals follow the configured `terminal.new_cwd` policy, which follows the source pane or workspace by default. Each `--env KEY=VALUE` adds or replaces that variable in the new root shell.
## Panes
diff --git a/docs/preview/website/src/content/docs/configuration.mdx b/docs/preview/website/src/content/docs/configuration.mdx
index 1975a43a..c54c79a9 100644
--- a/docs/preview/website/src/content/docs/configuration.mdx
+++ b/docs/preview/website/src/content/docs/configuration.mdx
@@ -73,7 +73,7 @@ Set the executable Herdr uses for newly created interactive panes:
default_shell = "nu"
```
-When unset or empty, Herdr uses `$SHELL`, then `/bin/sh` on Unix and PowerShell on Windows. This is an executable name or path, not a shell command line. Existing panes keep their current shell until they are recreated. Custom command keybinding strings run through `/bin/sh -c` for pane commands and `/bin/sh -lc` for detached commands on Unix; on Windows they run through `cmd.exe /d /c`.
+When unset or empty, Herdr uses `$SHELL`, then `/bin/sh` on Unix. On Windows it uses `pwsh.exe` (PowerShell 7) when it resolves on `PATH`, and otherwise the inbox `powershell.exe` (Windows PowerShell 5.1). This is an executable name or path, not a shell command line. Existing panes keep their current shell until they are recreated. Custom command keybinding strings run through `/bin/sh -c` for pane commands and `/bin/sh -lc` for detached commands on Unix; on Windows they run through `cmd.exe /d /c`.
Set how Herdr starts newly created interactive pane shells:
diff --git a/docs/preview/website/src/content/docs/connecting-machines.mdx b/docs/preview/website/src/content/docs/connecting-machines.mdx
index 3a31639d..3f7bcfe6 100644
--- a/docs/preview/website/src/content/docs/connecting-machines.mdx
+++ b/docs/preview/website/src/content/docs/connecting-machines.mdx
@@ -7,6 +7,8 @@ Keep your local work and remote agents in one Herdr window. Save an SSH machine
Each machine keeps its own Herdr server, sessions, and running processes. A lost connection to one machine does not disconnect the others.
+Herdr requests SSH compression to reduce screen-update traffic on limited connections. This works with older compatible Herdr servers and does not change how typing or other input is delivered. Herdr's `-C` option overrides `Compression no` in your SSH config. If SSH reuses an existing connection through an external ControlMaster, that connection keeps its original compression setting.
+
## Before you connect
You need normal SSH access to the remote machine. Verify it first:
@@ -17,7 +19,7 @@ ssh workbox
`workbox` can be a host from your SSH config. You can also use a target such as `ssh://you@server:2222`.
-Multi-machine connections are supported on Linux and macOS clients, connecting to Linux and macOS servers on x86_64 or aarch64. Multi-machine connections are not yet verified or supported on Windows; standalone `herdr --remote` remains supported on Windows. Native Windows servers are not supported as SSH targets. See [Remote attach over SSH](/docs/persistence-remote/#remote-attach-over-ssh) for SSH configuration, authentication, and custom binaries.
+Multi-machine connections support Linux, macOS, and Windows clients connecting to Linux or macOS servers on x86_64 or aarch64, or Windows servers on x86_64. Interactive setup can install or update the complete remote package after confirmation; background reconnects only discover installed packages. See [Remote attach over SSH](/docs/persistence-remote/#remote-attach-over-ssh) for SSH configuration, authentication, and custom binaries.
## Add a machine
@@ -101,6 +103,8 @@ Workspace, tab, pane IDs, and agent names are scoped to one server. Two machines
Saved profiles contain only an opaque ID, label, SSH target, explicit remote session, and enabled state. Herdr does not store passwords, private keys, agent tickets, or SSH control sockets in the catalog. Authentication stays with OpenSSH.
+Herdr separately remembers each machine's remote OS and resolved executable path so repeated `--machine` commands can skip discovery. Existing profiles learn missing information on first use. This cache is optional: missing, invalid, or unwritable cache files do not prevent commands from working. Commands still check live server compatibility. If a cached executable is missing or no longer supports API forwarding, Herdr rediscovers it during the initial read-only check; it never automatically repeats a command that may already have changed remote state.
+
The client and server negotiate compatibility rather than requiring identical versions. Saved-machine connections additionally need the server's `surface_interest` and `health_check` capabilities. Older servers without those capabilities show Attention until explicitly updated, even if a standalone attach works. Other missing server methods disable only their corresponding actions.
Updating a compatible client does not replace the running remote server or stop its agents. When you need new server-side behavior, update that server explicitly. Normal replacement asks before stopping the server and its pane processes.
diff --git a/docs/preview/website/src/content/docs/integrations.mdx b/docs/preview/website/src/content/docs/integrations.mdx
index 4516061f..7bca01e6 100644
--- a/docs/preview/website/src/content/docs/integrations.mdx
+++ b/docs/preview/website/src/content/docs/integrations.mdx
@@ -223,7 +223,7 @@ herdr integration install opencode
The integration supports OpenCode V1 `1.18.29` or later and OpenCode V2 (tested with beta `19242`). The OpenCode config directory must already exist. Herdr installs the server entrypoint at `~/.config/opencode/plugins/herdr-agent-state.js`, the shared TUI plugin at `herdr-tui-session.js`, and a V2 TUI entrypoint at `herdr-opencode/tui.js` in that config directory.
-Install registers the V1 TUI plugin in `tui.jsonc` and the V2 TUI plugin in `cli.json`, preserving other preferences and plugins. If OpenCode still has V1 TUI preferences to import (`tui.json` or `kv.json`), Herdr defers registration so the first-start migration can run; start `opencode2` once and reinstall the integration afterward. Otherwise Herdr creates `cli.json` with the plugin registration. Restart the OpenCode TUI after installation. Uninstall removes the managed plugin files and their configuration entries.
+Install registers the V1 TUI plugin in `tui.jsonc` and the V2 TUI plugin in `cli.json`, preserving other preferences and plugins. An existing V1 registration in `tui.json` also counts as installed and is reused without creating `tui.jsonc`. Uninstall removes the Herdr registration from both TUI config files while keeping the files and other preferences. If OpenCode still has V1 TUI preferences to import (`tui.json` or `kv.json`), Herdr defers registration so the first-start migration can run; start `opencode2` once and reinstall the integration afterward. Otherwise Herdr creates `cli.json` with the plugin registration. Restart the OpenCode TUI after installation. Uninstall removes the managed plugin files and their configuration entries.
V2 lifecycle reporting runs in the pane-local TUI, which associates events with its selected root session even when multiple panes share one OpenCode server. Completion and interruption clear the working state; pending permission requests, pending forms, and failed executions keep the pane blocked. V2 Mini and headless clients do not run the TUI plugin and therefore do not provide this lifecycle reporting.
@@ -285,6 +285,8 @@ Herdr resumes stored Qwen Code sessions with `qwen --resume <id>`.
## Letta Code
+Letta Code integration installation is experimental and CLI-only. It is not listed in the Settings integration screen or the JSON integration API. `herdr integration status` reports it as `letta (experimental)`. Agent detection and `herdr agent start --kind letta` are supported independently of this installation restriction.
+
Install the Letta Code hook:
```bash
diff --git a/docs/preview/website/src/content/docs/ja/cli-reference.mdx b/docs/preview/website/src/content/docs/ja/cli-reference.mdx
index 58cb3e9f..99a2e133 100644
--- a/docs/preview/website/src/content/docs/ja/cli-reference.mdx
+++ b/docs/preview/website/src/content/docs/ja/cli-reference.mdx
@@ -191,7 +191,9 @@ herdr tab rename <tab_id> <label>
herdr tab close <tab_id>
```
-タブはワークスペース内の別のターミナルレイアウトです。`--workspace` を省略すると、`tab create` はアクティブなワークスペースを使い、存在しなければ失敗します。JSON レスポンスの `.result.tab.tab_id` と `.result.root_pane.pane_id` から ID を取得できます。
+タブはワークスペース内の別のターミナルレイアウトです。`--workspace` を省略すると、`tab create` はアクティブなワークスペースを使い、存在しなければ失敗します。JSON レスポンスの `.result.tab.tab_id` と `.result.root_pane.pane_id` から ID を取得できます。ワークスペースの最後のタブを閉じると、そのワークスペースも閉じられます。`ui.confirm_close` が有効で、親ワークツリーの最後のタブを閉じるとワークツリーグループ全体が閉じられる場合、`tab close` は `confirmation_required` エラーを返します。
+
+`ui.confirm_close` が有効な場合、キーバインドやタブメニューからワークスペースの最後のタブを閉じる前に、TUI が確認を求めます。通常の CLI/API によるタブの終了は引き続き即座に実行されます。
ワークスペースとタブの作成、およびペインの分割は、デフォルトではフォーカスを変えません。`--focus` は新しいレイアウトを選択し、`--no-focus` はデフォルトを明示します。`--cwd` がない場合、新しいターミナルは `terminal.new_cwd` の設定に従い、デフォルトでは元のペインまたはワークスペースを引き継ぎます。各 `--env KEY=VALUE` は新しいルートシェルの環境変数を追加または置換します。
@@ -218,7 +220,7 @@ herdr pane move <pane_id> --new-workspace [--label TEXT] [--tab-label TEXT] [--f
herdr pane close <pane_id>
```
-`--current` を受け付けるペインコマンドは、Herdr ペイン内から実行した場合、呼び出し元の `HERDR_PANE_ID` を使います。`pane split` では、明示したペイン ID または `--pane ID` がそのペインを、`--current` が呼び出し元ペインを分割します。対象を省略すると UI でフォーカス中のペインを使います。分割レスポンスでは、新しいペイン ID は `.result.pane.pane_id` にあります。
+`--current` を受け付けるペインコマンドは、Herdr ペイン内から実行した場合、呼び出し元の `HERDR_PANE_ID` を使います。`pane split` では、明示したペイン ID または `--pane ID` がそのペインを分割します。対象を省略すると `HERDR_PANE_ID` があれば呼び出し元ペインを、なければフォーカス中のペインを使います。`--current` は呼び出し元ペインを必須とし、`HERDR_PANE_ID` がない場合はエラーになります。分割レスポンスでは、新しいペイン ID は `.result.pane.pane_id` にあります。
`pane move` の後続コマンドには `.result.move_result.pane.pane_id` を使います。別ワークスペースへの移動ではワークスペース修飾付きのペイン ID が変わり、以前の値は `.result.move_result.previous_pane_id` に残ります。実行中プロセスの `HERDR_PANE_ID`、`HERDR_TAB_ID`、`HERDR_WORKSPACE_ID` は起動時の値のままですが、Herdr は以前のペイン ID をそのターミナルの別名として保持するため、`--current` を使うペインコマンドは引き続き解決できます。ライブエージェント名もターミナルに追従します。
@@ -342,11 +344,17 @@ herdr agent explain --file PATH --agent LABEL [--json|--verbose]
```bash
herdr terminal attach <terminal_id> [--takeover]
+herdr terminal session control <target> [--takeover] [--cols N] [--rows N]
+herdr terminal session observe <target> [--cols N] [--rows N]
herdr terminal title set <title>
herdr terminal title clear
```
ダイレクトアタッチからは `ctrl+b q` でデタッチします。リテラルの `ctrl+b` は `ctrl+b ctrl+b` で送ります。
+`terminal session control` は、ペイン、ターミナル、エージェントを対象に書き込み可能なライブストリームを開きます。observe と同じ改行区切り JSON の `terminal.frame` と `terminal.closed` を出力し、標準入力から `terminal.input`、`terminal.resize`、`terminal.scroll`、`terminal.release` を受け取ります。制御クライアントは同時に 1 つだけで、`--takeover` で置き換えられます。
+
+`terminal session observe` は同じ対象の読み取り専用ストリームを開きます。base64 の ANSI バイト列を含む `terminal.frame` と、サーバー終了時の `terminal.closed` を改行区切り JSON で出力します。複数の観測クライアントは入力、リサイズ、スクロール、制御権を取得せずに同じターミナルを監視できます。Linux/macOS ではソケットへの書き込みが 30 秒間進まない観測クライアントを切断します。その場合は最後の `terminal.closed` が届かないことがありますが、ペインや他のクライアントは動き続けます。出力のない静かなペインはこのタイムアウトの対象ではありません。
+
`terminal title clear` は外側ターミナルウィンドウタイトルを `ui.window_title` に戻します。
## 出力待機
diff --git a/docs/preview/website/src/content/docs/ja/configuration.mdx b/docs/preview/website/src/content/docs/ja/configuration.mdx
index 7867e8c4..12802e84 100644
--- a/docs/preview/website/src/content/docs/ja/configuration.mdx
+++ b/docs/preview/website/src/content/docs/ja/configuration.mdx
@@ -508,7 +508,9 @@ claude = "on"
## Kitty graphics
-Herdr は、対応する外側のターミナルでペイン画像をデフォルトで描画します。グラフィックス描画とペイングラフィックス API を無効にするには、次のように設定します:
+Herdr は、対応する外側のターミナルでペイン画像をデフォルトで描画します。ポップアップ、メニュー、通知は、重なる画像の配置だけを一時的に隠します。重ならない画像は表示されたままで、隠れた配置は覆いがなくなると戻ります。画像はダイアログの背景と一緒に暗くなりません。
+
+グラフィックス描画とペイングラフィックス API を無効にするには、次のように設定します:
```toml
[terminal]
diff --git a/docs/preview/website/src/content/docs/ja/connecting-machines.mdx b/docs/preview/website/src/content/docs/ja/connecting-machines.mdx
index 014e670f..2c3a41cc 100644
--- a/docs/preview/website/src/content/docs/ja/connecting-machines.mdx
+++ b/docs/preview/website/src/content/docs/ja/connecting-machines.mdx
@@ -17,7 +17,7 @@ ssh workbox
`workbox` は SSH config のホスト名です。`ssh://you@server:2222` のような接続先も使えます。
-複数マシンへの接続は Linux と macOS のクライアントで対応しており、x86_64 または aarch64 の Linux と macOS サーバーに接続できます。Windows での複数マシンへの接続は未検証・未対応です。単独接続の `herdr --remote` は引き続き Windows でも対応しています。ネイティブ Windows サーバーは SSH 接続先として未対応です。SSH 設定、認証、カスタムバイナリについては [SSH 越しのリモートアタッチ](/ja/docs/persistence-remote/)を参照してください。
+複数マシンへの接続は Linux、macOS、Windows のクライアントに対応し、x86_64 または aarch64 の Linux と macOS サーバー、および x86_64 の Windows サーバーに接続できます。対話型セットアップでは確認後に完全なリモートパッケージをインストールまたは更新できます。バックグラウンド再接続ではインストール済みのパッケージだけを探します。SSH 設定、認証、カスタムバイナリについては [SSH 越しのリモートアタッチ](/ja/docs/persistence-remote/)を参照してください。
## マシンを追加する
@@ -43,7 +43,13 @@ Herdr はインストール済みバイナリと実行中サーバーをそれã�
サイドバーでマシンまたはそのワークスペースを選びます。選択中のマシンだけがペイン入力とターミナルサイズを受け取り、表示するターミナル内容とグラフィックスを送信します。ほかの接続済みマシンは、ペイン画面を送らずにワークスペース情報、エージェント状態、通知を更新し続けます。
-起動時は SSH 接続を待たずに Local を開きます。応答しないマシンがほかのマシンの入力を妨げることはありません。同じサーバーに接続した複数のクライアントは、それぞれ別のタブを表示できます。同じタブを表示した場合のサイズについては[クライアントとサーバー](/ja/docs/concepts/)を参照してください。
+各マシンの横の矢印をクリックすると、現在のワークスペースを切り替えずに一覧を折りたためます。再接続中のマシンでも操作できます。
+
+キーボードでは `prefix+w` を押し、ワークスペース移動キー(デフォルトは Up/Down)で接続済みマシンのワークスペースをサイドバー順に選びます。Enter で移動を確定し、Esc またはプレフィックスキーで切り替えずにキャンセルします。縮小・展開サイドバーとも、折りたたまれたマシン内の選択行を表示します。デスクトップでは両端で折り返し、モバイルの切り替え画面では先頭と末尾で止まります。切断中のマシンは飛ばします。
+
+別マシンのワークスペースをハイライトしたら、他のキー操作の前に Enter で切り替えてください。現在のマシンでペイン、タブ、ワークスペース、カスタムコマンドの操作が誤って実行されるのを防ぎます。クリックすると、デスクトップでのリモート移動のプレビューはキャンセルされます。展開サイドバーはマシンごとの worktree グループの折りたたみ状態を反映します。
+
+起動時は SSH 接続を待たずに Local を開きます。Local を選ぶと、リモートの応答を待たずに未完了の切り替えをキャンセルします。Local 自体が再接続中なら、準備ができた時点で選択を再開します。Local の新しい画面とターミナル設定が届くと入力できます。応答しないマシンがほかのマシンの入力を妨げることはありません。同じサーバーに接続した複数のクライアントは、それぞれ別のタブを表示できます。同じタブを表示した場合のサイズについては[クライアントとサーバー](/ja/docs/concepts/)を参照してください。
接続が切れると、最後のワークスペースとエージェント状態を暗く表示します。これはキャッシュであり、現在の状態ではありません。新しい接続と対応する画面が届くまで、そのペインへの入力や移動は無効です。再接続しても、使用中のマシンから選択を奪いません。
@@ -67,10 +73,12 @@ herdr machine remove <profile-id>
## 接続の問題
-- **Reconnecting:** ネットワーク中断、スリープ、SSH 障害の後は、上限のある待機間隔で再試行します。SSH 接続はアプリケーションの通信を監視し、通信がない間はヘルスチェックを行うため、切れた接続が Online のままになりません。Local はリモート用のプローブではなく、ネイティブ接続の終了や失敗を検知します。
+- **Reconnecting:** ネットワーク中断、スリープ、SSH 障害の後は自動で再試行します。失敗が続くと待機間隔は最大 2 分まで延び、短時間だけ接続に成功してもリセットされません。1 分間安定して接続できると、次の中断では再び短い間隔で再試行します。SSH 接続はアプリケーションの通信を監視し、通信がない間はヘルスチェックを行うため、切れた接続が Online のままになりません。Local はリモート用のプローブではなく、ネイティブ接続の終了や失敗を検知します。
- **Attention:** ホスト鍵の承認、認証、互換サーバーの準備など、バックグラウンドではできない操作が必要です。ほかのマシンは利用できます。
- **保存済みマシンのファイルエラー:** カタログを読み取れない、または内容が不正な場合、現在の接続は変更しません。通知を表示して自動で読み取りを再試行します。
+両端のインストールがブリッジのアイドル終了に対応している場合、Linux と macOS への保存済みマシン接続は、どちらの方向にも通信がない状態が 1 分続くとリモートブリッジを終了します。スリープ時間も含み、復帰時に期限を確認します。正常なアイドル接続ではヘルスチェックを交換するため、継続的な出力を見るためにキーを入力する必要はありません。ブリッジ終了後もリモートサーバー、セッション、ペインのプロセスは動き続けます。古いインストールとは、この追加機能なしで接続できます。
+
バックグラウンド接続がプロンプトに回答したり、サーバーのインストール、更新、再起動、ハンドオフを行ったりすることはありません。Attention の場合は、Herdr が表示する単独接続用のコマンドを対話型ターミナルで実行してください。例:
```bash
diff --git a/docs/preview/website/src/content/docs/ja/integrations.mdx b/docs/preview/website/src/content/docs/ja/integrations.mdx
index 75cebbe4..6086e6b6 100644
--- a/docs/preview/website/src/content/docs/ja/integrations.mdx
+++ b/docs/preview/website/src/content/docs/ja/integrations.mdx
@@ -287,6 +287,8 @@ Herdr は保存された Qwen Code セッションを `qwen --resume <id>` で r
## Letta Code
+Letta Code インテグレーションのインストールは実験的な CLI 専用機能です。Settings のインテグレーション一覧や JSON インテグレーション API には含まれません。`herdr integration status` では `letta (experimental)` と表示されます。エージェント検出と `herdr agent start --kind letta` は、このインストール方法の制限とは別にサポートされています。
+
Letta Code フックをインストールします:
```bash
diff --git a/docs/preview/website/src/content/docs/ja/keyboard.mdx b/docs/preview/website/src/content/docs/ja/keyboard.mdx
index 97ce6b5c..ef0dfc2a 100644
--- a/docs/preview/website/src/content/docs/ja/keyboard.mdx
+++ b/docs/preview/website/src/content/docs/ja/keyboard.mdx
@@ -62,6 +62,26 @@ Herdr はマウスネイティブです。キーバインドをひとつも覚ã�
完全なキーマップとバインドの構文は[キーバインドリファレンス](/ja/docs/configuration/#キーバインド)にあります。
+Goto ピッカー (`prefix+g`) は、各エージェントとターミナルをワークスペースごとに一行ずつ表示します。分割タブのペインも隠さず表示されます。行をクリックするか Enter を押すと、そのペインへ直接移動します。`/` で名前、エージェントの種類、タブ、ワークスペース、ブランチ、パスを検索できます。検索入力中でなければ上下矢印キーまたは `j/k` で行を移動します。左右矢印キーは前後のワークスペースの最初のエージェントまたはターミナルへ移動し、端では折り返しません。検索入力中は左右矢印キーでテキストカーソルを動かします。`b/w/i/d` で blocked、working、idle、done のエージェントに絞り込み、`a` ですべてのターミナルに戻します。選択した移動先の場所とパスは一覧の下に表示されます。一覧が収まらない場合は、マウスホイール、スクロールバーのトラックのクリック、つまみのドラッグで、移動先を開かずにスクロールできます。
+
+## テキスト欄の編集
+
+Herdr の名前入力、worktree のブランチ名、フィルター、コピーモードの検索欄では、カーソル位置で編集できます。以下は Herdr 自身の入力欄の操作であり、ペイン内のシェルやエージェントの操作は変わりません。
+
+| 操作 | キー |
+| --- | --- |
+| 1 文字移動 | Left / Right、Ctrl+B / Ctrl+F |
+| 先頭 / 末尾へ移動 | Home / End、Ctrl+A / Ctrl+E |
+| 1 単語移動 | Alt+B / Alt+F |
+| 前の文字を削除 | Backspace、Ctrl+H |
+| 次の文字を削除 | Delete、Ctrl+D |
+| 先頭 / 末尾まで切り取り | Ctrl+U / Ctrl+K |
+| 前の単語を切り取り | Ctrl+W、Alt+Backspace、Ctrl+Backspace |
+| 次の単語を切り取り | Alt+D |
+| 最後に切り取ったテキストを挿入 | Ctrl+Y |
+
+入力と貼り付けはカーソル位置に挿入されます。移動と削除は Unicode の書記素境界を尊重し、長い値は横にスクロールします。切り取ったテキストは現在の入力欄だけで保持し、システムのクリップボードは使いません。Alt ショートカットにはターミナルの Alt/Meta 報告が必要です。Enter と Esc は引き続きダイアログの確定とキャンセルに使います。
+
## コピーモード
`prefix+[` を押すと、フォーカス中のペインでコピーモードに入ります。`h/j/k/l`、tmux 形式の `w/b/e`、`{`/`}` で移動します。`/` または `?` で前方または後方のリテラル検索を開始し、`n` または `N` で同じ方向または逆方向に繰り返します。クエリに大文字が含まれる場合だけ大文字と小文字を区別します。`v` または Space で選択を開始し、`y` または Enter でコピーし、`q` または Esc でコピーせずに抜けます。Esc は終了する前に、アクティブな選択または検索を消します。コピーモードはペインのプロセスを停止しません。最下部では出力を追従し、履歴へ移動するとその位置を保ちます。マウスのドラッグ選択なら、コピーモードに入らずにそのままコピーできます。
diff --git a/docs/preview/website/src/content/docs/ja/persistence-remote.mdx b/docs/preview/website/src/content/docs/ja/persistence-remote.mdx
index acd75b86..94bffb8b 100644
--- a/docs/preview/website/src/content/docs/ja/persistence-remote.mdx
+++ b/docs/preview/website/src/content/docs/ja/persistence-remote.mdx
@@ -69,7 +69,7 @@ Host workbox
herdr --remote workbox
```
-リモートアタッチは、Linux、macOS、Windows のローカルクライアントから、x86_64 と aarch64 の Linux および macOS ホストへの接続をサポートします。Herdr はリモートのプラットフォームを確認し、リモートの `PATH` 上にある互換性のある `herdr` を優先してから、一般的な直接インストール、Homebrew、mise、Nix プロファイルのパスを確認します。両方が安定したエンドポイント世代に対応していれば、ローカルとリモートのバージョンは一致しなくても接続できます。互換性のあるバイナリがない場合、対話的な実行では `~/.local/bin/herdr` へのインストールを提案します。非対話的な実行はホストを変更せずに失敗します。`~/.local/bin` がリモートの `PATH` にない場合、Herdr はインストール後に警告します。Windows をリモートホストとして使うことはできません。
+リモートアタッチと保存済み SSH マシンは、Linux、macOS、Windows のクライアントから、x86_64 または aarch64 の Linux/macOS ホスト、および x86_64 の Windows ホストへの接続に対応します。両端が安定したエンドポイント世代に対応していれば、バージョンは一致しなくても構いません。Linux/macOS ではリモートの `PATH` 上の互換バイナリを優先し、次に一般的な直接インストール、Homebrew、mise、Nix のパスを確認します。Windows では `PATH` と現在有効な管理対象リリースを確認します。互換バイナリがなければ、対話的な実行はインストールや更新の確認を求め、非対話的な実行はホストを変更せず失敗します。Linux/macOS では `~/.local/bin/herdr` に、Windows ではアプリローカル ConPTY ランタイムを含む完全なパッケージをインストールします。リモートの `PATH` に `~/.local/bin` がない場合は警告します。
デフォルトでは、`herdr --remote` はユーザーの SSH config を最初に include し、その後にフォールバックのキープアライブ設定を加えた一時的な SSH config を通してリモートセットアップとブリッジを実行します。既存のユーザーのキープアライブ設定が優先されます。Linux と macOS クライアントは接続再利用用のプライベートなアタッチ単位コントロールソケットも使いますが、Windows OpenSSH では使いません。Herdr が生成する設定やコントロールソケットを使わず通常の `ssh` を使うには `[remote].manage_ssh_config = false` を設定してください。
@@ -90,9 +90,9 @@ herdr --remote workbox --handoff
先にサーバーへ SSH してそこで `herdr` を実行した場合、Herdr は完全にサーバー上で動きます。このモードは便利でシンプルですが、通常のターミナルテキスト貼り付けを超えてローカルデスクトップのクリップボードにはアクセスできません。
-ローカルとリモートのプラットフォームが一致する場合、直接インストールでは Herdr は現在のローカルバイナリをコピーできます。Homebrew、mise、Nix のインストールの場合、またはプラットフォームが異なる場合は、`https://herdr.dev/latest.json` から現在のクライアントバージョンに一致するリリースアセットをダウンロードします。
+Linux/macOS ホストでは、プラットフォームが一致する直接インストールなら現在のローカルバイナリをコピーできます。Homebrew、mise、Nix のインストール、異なるプラットフォーム、または Windows ホストの場合は、`https://herdr.dev/latest.json` から現在のクライアントバージョンに対応するリリースアセットをダウンロードします。
-ローカルビルドやカスタムバイナリの場合は、リモートアタッチの前に `HERDR_REMOTE_BINARY` にローカルファイルパスを設定してください。
+ローカルビルドやカスタムパッケージを使うには、リモートアタッチ前に `HERDR_REMOTE_BINARY` にローカルファイルパスを設定します。Linux/macOS 向けには実行ファイル、Windows 向けには完全な `herdr-windows-x86_64.zip` パッケージを指定してください。
```bash
HERDR_REMOTE_BINARY=target/release/herdr herdr --remote workbox
diff --git a/docs/preview/website/src/content/docs/ja/quick-start.mdx b/docs/preview/website/src/content/docs/ja/quick-start.mdx
index 4de15f61..e5e873ce 100644
--- a/docs/preview/website/src/content/docs/ja/quick-start.mdx
+++ b/docs/preview/website/src/content/docs/ja/quick-start.mdx
@@ -17,9 +17,9 @@ Herdr はデフォルトのバックグラウンドセッションを起動すã‚
## マウスを使う
-Herdr はマウスネイティブなので、まずはクリックから始めてください。ペイン、タブ、ワークスペース、エージェントをクリックしてフォーカスします。分割境界をドラッグしてリサイズします。右クリックでコンテキストメニューが開き、ペインの分割やタブの作成ができます。テキストをドラッグ選択するとクリップボードにコピーされます。トークンをダブルクリックすると直接コピーされます。コピーに Ctrl+C は不要です。
+Herdr はマウスネイティブなので、まずはクリックから始めてください。ペイン、タブ、ワークスペース、エージェントをクリックしてフォーカスします。分割境界をドラッグしてリサイズします。右クリックでコンテキストメニューが開き、ペインの分割やタブの作成ができます。テキストをドラッグ選択するとクリップボードにコピーされます。トークンをダブルクリックすると選択し、2 回目の押下を保持してドラッグすると単語単位で選択を広げられます。どちらもマウスを離すとコピーされます。コピーに Ctrl+C は不要です。
-ターミナルが修飾キー付きクリックを Herdr に渡す場合、Ctrl+クリックでペイン内のリンクを開けます。これは OSC 8 ハイパーリンクと、表示されている `http://` または `https://` の URL で機能します。macOS では、マウスキャプチャが有効な間は Herdr が処理するペインリンクに Ctrl+クリックを使ってください。Cmd+クリックは Shift+Cmd+クリックや `ui.mouse_capture = false` といったターミナルネイティブのバイパス経路でのみ使えます。
+ターミナルが修飾キー付きクリックを Herdr に渡す場合、Ctrl+クリックでペイン内のリンクを開けます。OSC 8 ハイパーリンクと `http://` または `https://` の URL に対応し、折り返されたリンクの先頭や末尾が表示範囲外でも開けます。Ctrl を押しながらリンク上にポインターを移動すると、表示中の部分に下線が付きます。ポインターを外す、ペイン内容が変わる、または Ctrl の解放イベントを受け取ると下線は消えます。一部のターミナルでは、修飾キーの変化はマウス移動時にだけ報告されます。macOS では、マウスキャプチャが有効な間は Herdr が処理するペインリンクに Ctrl+クリックを使ってください。Cmd+クリックは Shift+Cmd+クリックや `ui.mouse_capture = false` といったターミナルネイティブのバイパス経路でのみ使えます。
`ui.right_click_passthrough_modifier` を設定すると、その修飾キー + 右クリックで、右クリック・ホールド・ドラッグのジェスチャーがマウスレポーティング対応のペインアプリに送られます。
diff --git a/docs/preview/website/src/content/docs/ja/session-state.mdx b/docs/preview/website/src/content/docs/ja/session-state.mdx
index b2d182b0..4f16bda6 100644
--- a/docs/preview/website/src/content/docs/ja/session-state.mdx
+++ b/docs/preview/website/src/content/docs/ja/session-state.mdx
@@ -34,10 +34,29 @@ Herdr サーバーが停止して再起動すると、元のペインのプロã‚
スナップショット復元は、動作中のシェル、サーバー、テスト、その他任意のプロセスを保存しません。より強力な復元経路が使えないペインは、保存されたディレクトリで新しいシェルとして戻ってきます。
-`session.json` を読み込めない、解析できない、または新しい Herdr バージョンが必要な場合、読み込みに失敗した理由をログに記録します。新しいセッションを保存または削除する前に、元のファイルをそのまま `session.json` の隣の `session-backups/` に保存し、復旧用コピーのパスを `persist.backup` として記録します。起動時にファイルがなかった場合も、最初の保存または削除の前に再確認します。正常に読み込めた場合は復旧用コピーを作成しません。
+保存されたディレクトリが使えない場合やシェルを起動できない場合、ペインは消えたりホームディレクトリへ移動したりせず、エラーを表示してレイアウトに残ります。保存されたディレクトリとエージェントのセッション参照は保持されます。ディレクトリやシェル設定を修正してサーバーを再起動すると再試行できます。不要なペインは明示的に閉じて削除できます。
+
+保存時には、OS が取得をサポートしていれば、実行中のシェルのディレクトリを優先します。シェル終了後も最後に確認したディレクトリを保持します。それ以外の環境ではシェルが報告したディレクトリを使用します。
+
+`session.json` を読み込めない、解析できない、または新しい Herdr バージョンが必要な場合、読み込みに失敗した理由をログに記録します。新しいセッションを保存または削除する前に、元のファイルをそのまま `session.json` の隣の `session-backups/` に保存し、復旧用コピーのパスを `persist.backup` として記録します。起動時にファイルがなかった場合も、最初の保存または削除の前に再確認します。これらの読み込み失敗時の復旧用コピーは、通常のスナップショット履歴とは別に管理します。
復旧用コピーは最新の 3 個を保持し、新しいコピーの安全な保存が完了してから古いコピーを削除します。コピーに失敗すると、自動保存時も終了時も元のファイルを変更せず、失敗をログに記録し、次の保存要求時に再試行します。コピーが自動的に復元されることはありません。復旧するには、対象のサーバーを停止し、復旧用ファイルをそのサーバーの `session.json` にコピーしてから再起動します。復旧用コピーにペイン画面履歴は含まれません。
+## シャットダウンとスナップショットからの復旧
+
+systemd-logind を使う Linux では、Herdr はホストのシャットダウン予告を受け取り、保存して停止するまで短い遅延を要求します。その後 logind がシャットダウンを進めます。遅延には OS による上限があり、無期限にはブロックしません。logind がない環境、強制終了、電源断、予告前にプロセスが終了した場合には、この保護は使えません。
+
+全プラットフォームで、`session.json` の隣の `session-snapshots/` に最大 48 個のレイアウトスナップショットを保持します。最初に保存したレイアウトは直ちにコピーします。その後の保存や削除では、直前の保存済みレイアウトを最大 15 分に 1 回コピーします。同じ内容は重複保存しません。この間隔はサーバーの再起動後も維持されるため、連続したペイン終了や再起動で古いコピーがすべて押し出されることはありません。直近の変更がコピーに含まれない場合があります。
+
+通常のペイン終了は引き続き `session.json` に反映されます。復旧を促す通知や、古いスナップショットの自動復元はありません。手動で復旧するには:
+
+1. `herdr session list --json` で対象のセッションディレクトリを確認します。
+2. 対象サーバーを停止します。デフォルトは `herdr server stop`、名前付きセッションは `herdr session stop <name>` です。
+3. 現在の `session.json` を別にコピーしてから、`session-snapshots/` 内の選んだファイルを `session.json` にコピーします。ファイルの更新日時で保存時刻を確認できます。
+4. セッションを再起動します。
+
+コピーにはレイアウトとエージェントのセッション参照が含まれますが、実行中のプロセスやペイン画面履歴は含まれません。非公開のセッションデータとして扱ってください。コピーの書き込みに失敗するとログに記録しますが、通常のセッション保存は続行します。
+
## ペイン画面履歴のリプレイ
ペイン画面履歴は、サーバーの完全な再起動後に直近のターミナル内容を復元します。復元されるのは Herdr が表示できるものであって、元のプロセスではありません。
@@ -51,6 +70,8 @@ pane_history = true
有効にすると、Herdr は保存したペイン履歴を `session.json` の隣の `session-history.json` に保存します。Herdr の設定/セッションディレクトリはターミナル履歴と同じ感覚で扱ってください。
+履歴は、保存されたレイアウトと完全に一致する場合だけ再生されます。スナップショットを手動で復元した場合など、異なるレイアウトの履歴は無視されます。レイアウトを検証できない旧形式の履歴も無視されますが、新たに保存された履歴は次回の再起動で再生できます。
+
## エージェントネイティブのセッション復元
一部のエージェントは自分の会話セッションを resume できます。Herdr は、公式インテグレーションが報告したセッション参照を使って、Herdr サーバーの再起動後に対応エージェントのペインを再起動できます。
@@ -75,6 +96,7 @@ Herdr が resume するのは、現行の公式 Herdr インテグレーショãƒ
| Claude Code | `6` | `claude --resume <id>` |
| Codex | `5` | `codex resume <id>` |
| Cursor Agent CLI | `1` | `cursor-agent --resume <id>` |
+| Grok CLI | `2` | `grok --resume <id>` |
| GitHub Copilot CLI | `2` | `copilot --resume=<id>` |
| Devin CLI | `2` | `devin --resume <id>` |
| Droid | `2` | `droid --resume <id>` |
@@ -101,6 +123,8 @@ Herdr が resume するのは、現行の公式 Herdr インテグレーショãƒ
ハンドオフが保護するのは、ペインの PTY とプロセス、エージェントの識別情報と永続メタデータ、交換後のサーバーに必要なプラグイン/セッション状態など、サーバーが所有する長寿命のセッション状態です。交換境界をまたぐ一時的な協調状態は保持しません。処理中の CLI/API リクエスト、wait、購読ストリーム、クライアントソケット、ペイン間メッセージは中断される可能性があるため、クライアントは再接続して再試行してください。
+更新済みの Unix サーバーは、ペインを分割して転送することで 64 個を超えるペインを 1 回のハンドオフで送信できます。送信側サーバーがすでにこの機能を備えている必要があります。古いサーバーからの最初の更新では、引き続き 64 ペインの制限が適用されます。その場合は通常のサーバー再起動が必要になることがあり、ペインのプロセスは終了します。分割転送によって更新のインストール順序や他の互換性要件が変わるわけではありません。
+
ライブハンドオフは実験的機能で、オプトインです:
```bash
diff --git a/docs/preview/website/src/content/docs/ja/socket-api.mdx b/docs/preview/website/src/content/docs/ja/socket-api.mdx
index c57b3ace..09532d5e 100644
--- a/docs/preview/website/src/content/docs/ja/socket-api.mdx
+++ b/docs/preview/website/src/content/docs/ja/socket-api.mdx
@@ -111,7 +111,7 @@ herdr pane read w1:p2 --source recent --lines 50
`workspace.move_block` は、順序付きの `workspace_ids` を `before_workspace_id` の前へアトミックに移動します。アンカーを省略するとブロックを末尾へ移動します。id は一意である必要があり、アンカーをブロックに含めることはできません。レスポンスにはサーバーが確定した順序付きワークスペース一覧が含まれます。
-`session.snapshot` は、独自のローカルランタイムキャッシュを持つクライアント向けに、一度限りのブートストラップスナップショットを返します。レスポンスには、バージョン/プロトコルメタデータ、フォーカス中のワークスペース/タブ/ペイン id、ワークスペース、タブ、ペイン、タブレイアウト、エージェントの各レコードが含まれます。これは購読ではありません。ブートストラップ中のイベントを取りこぼさないよう、まず別の接続で `events.subscribe` を開いて確認応答を待ち、そのストリームをバッファしながら `session.snapshot` を呼び出します。スナップショットを適用してから、バッファしたイベントを順番に適用し、そのままストリーミングを続けます。再接続後やキャッシュが古い可能性がある場合は、`session.snapshot` を再度呼び出します。ワークスペースレコードには、関連付けられた worktree の出自情報も含まれます。リポジトリ全体の worktree 検出には引き続き `worktree.list` を使います。
+`session.snapshot` は、独自のローカルランタイムキャッシュを持つクライアント向けに、一度限りのブートストラップスナップショットを返します。レスポンスには、バージョン/プロトコルメタデータ、フォーカス中のワークスペース/タブ/ペイン id、ワークスペース、タブ、ペイン、タブレイアウト、エージェントの各レコードが含まれます。これは購読ではありません。キャッシュの初期化と復旧では、先に購読を開始し、後述のイベント購読セクションの手順でサーバーから現在の状態を読み取り、キャッシュを照合・更新します。イベントはキャッシュの無効化を知らせるものであり、スナップショットに無条件で再適用できるものではありません。再接続後やキャッシュが古い可能性がある場合は、`session.snapshot` を再度呼び出します。ワークスペースレコードには、関連付けられた worktree の出自情報も含まれます。リポジトリ全体の worktree 検出には引き続き `worktree.list` を使います。
CLI の `herdr api snapshot` は、クライアントやエージェントが簡単にブートストラップできるよう、現在の `session.snapshot` レスポンスを JSON で出力します。
@@ -348,7 +348,7 @@ worktree コマンドはライフサイクルイベントも発行します。`w
フィールドとして `{"token":"name"}` を使います。値には文字列、真偽値、符号なし整数、
またはコンテキストオブジェクトを指定できます。コンテキスト値は
`current_workspace_id` と `current_tab_id` で、対応する ID フィールドとの比較にだけ
-使えます。有効な status は `idle`、`working`、`blocked`、`done`、`unknown` です。
+使えます。保存済みマシンに接続するクライアントでは、選択中サーバーのビューを統合エージェント一覧に適用します。現在のワークスペースとタブのコンテキストには選択中のマシンも含まれるため、別マシンの同じ ID は一致しません。一方、`status` が `blocked` かどうかなど独立したフィルター条件は、接続中のすべてのマシンに一致できます。有効な status は `idle`、`working`、`blocked`、`done`、`unknown` です。
`done` は idle かつ未確認の状態を表します。
ソートフィールドは `workspace_order`、`tab_order`、`pane_order`、`attention`、
@@ -639,10 +639,16 @@ workspace の get/list 応答は結果の `tokens` マップを公開し、スãƒ
最初のレスポンスは購読の確認応答です。以降の行はプッシュされるイベントです。ライフサイクルイベントの購読はリクエストが受理された時点から始まり、それ以前に保持されていたイベントは再生しません。
+ライフサイクルとエージェント状態のイベントは、各購読内の順序を保った上限付きのバッチで送信されます。イベント履歴は永続ログではありません。購読の初期化中も含め、購読者が保持範囲より遅れた場合、サーバーは元のリクエスト `id` と `error.code: "events_lost"` を含むエラーレスポンスを送り、その購読接続を閉じます。欠落したイベントを通知せずに配信を続けることはありません。他のクライアント接続には影響しません。履歴はイベント種別間で共有されるため、失われたイベントが購読条件に一致しなかった可能性があっても、保持範囲を超えたことを通知します。
+
+`events_lost` を受け取ったら、キャッシュを古い状態として扱います。新しい購読を開始して `subscription_started` を待ち、読み取りを続けながら別の接続で `session.snapshot` を取得してください。サーバーの現在の状態でキャッシュを照合し、スナップショットでキャッシュ全体を置き換えます。イベントはキャッシュの無効化通知として扱い、再取得の契機にします。取得は直列に行い、取得中にイベントが届いた場合は完了後に再取得してください。
+
+スナップショットとイベントに共通のシーケンス境界はありません。順序が保証されるのは各購読項目内のみで、項目間やスナップショットとの前後関係は保証されません。バッファしたイベントの内容をスナップショットへ無条件に再適用しないでください。復旧できるのは現在の状態であり、失われたイベント履歴ではありません。再び `events_lost` を受け取った場合は、再購読して状態を照合し直します。読み取りが遅いクライアントでは、読み取り速度を上げるかイベントの負荷を減らす必要があります。
+
ワークスペースのイベント購読には `workspace.created`、`workspace.updated`、`workspace.metadata_updated`、`workspace.renamed`、`workspace.moved`、`workspace.reordered`、`workspace.closed`、`workspace.focused` があります。`workspace.metadata_updated` はプラグインイベントフックを実行せずにトークン変更と TTL 失効を報告します。その他のワークスペースイベントは Herdr の UI/ランタイムのライフサイクルを記述します。ワークスペースが worktree グループに属している場合、`workspace.created` は任意の `workspace.worktree` 出自情報を含みます。`workspace.moved` は、移動した `workspace_id`、要求された `insert_index`、更新済みの順序付き `workspaces` リストを含みます。`workspace.reordered` は、アトミックに移動した `workspace_ids`、省略可能な `before_workspace_id`、サーバーが確定した順序付き `workspaces` リストを含みます。削除前に Herdr がまだ識別できる場合、`workspace.closed` は最終的な `workspace` スナップショットを含みます。
タブのイベント購読には `tab.created`、`tab.closed`、`tab.focused`、`tab.renamed`、`tab.moved` があります。`tab.moved` は、移動した `tab_id`、`workspace_id`、要求された `insert_index`、そのワークスペースの更新済みの順序付き `tabs` リストを含みます。
-ペインのイベント購読には `pane.created`、`pane.updated`、`pane.closed`、`pane.focused`、`pane.moved`、`pane.exited`、`pane.agent_detected`、`pane.output_matched`、`pane.agent_status_changed`、`pane.scroll_changed` があります。ターミナルタイトルの変更は `pane.updated` を発行することがありますが、生のタイトルでスピナーだけが変化し、`terminal_title_stripped` が変わらない場合は発行しません。`pane.scroll_changed` は 1 つの `pane_id` を対象とし、Herdr がスクロールスナップショットの変化を検出するたびに `pane_id`、`workspace_id`、現在の `scroll` 情報を発行します。
-レイアウトのイベント購読には `layout.updated` があります。このイベントは 1 つのタブについて更新済みの `PaneLayoutSnapshot` を運びます。`session.snapshot` でブートストラップするクライアントは、同じ `workspace_id` と `tab_id` のキャッシュ済みレイアウトを置き換えてください。
+ペインのイベント購読には `pane.created`、`pane.updated`、`pane.closed`、`pane.focused`、`pane.moved`、`pane.exited`、`pane.agent_detected`、`pane.output_matched`、`pane.agent_status_changed`、`pane.scroll_changed` があります。`pane.focused` は、このサーバーに接続した任意のクライアントでの手動ペイン選択も報告します。他のクライアントの表示は移動させず、ペイロードにクライアントの識別情報は含みません。選択済みのペインを再度選んでも発行しません。ターミナルタイトルの変更は `pane.updated` を発行することがありますが、生のタイトルでスピナーだけが変化し、`terminal_title_stripped` が変わらない場合は発行しません。`pane.scroll_changed` は 1 つの `pane_id` を対象とし、Herdr がスクロールスナップショットの変化を検出するたびに `pane_id`、`workspace_id`、現在の `scroll` 情報を発行します。
+レイアウトのイベント購読には `layout.updated` があります。このイベントは 1 つのタブについて更新済みの `PaneLayoutSnapshot` を運びます。`session.snapshot` でキャッシュを管理するクライアントは、このイベントを契機にサーバーから対象のレイアウトを再取得してください。遅れて届いたペイロードは、最新のスナップショットより古い可能性があります。
worktree のイベント購読には `worktree.created`、`worktree.opened`、`worktree.removed` があります。worktree イベントは Git チェックアウトのライフサイクルを記述します。`worktree.created` は開かれた `workspace` と作成された `worktree` を含みます。`worktree.opened` は対象の `workspace`、開かれた `worktree`、`already_open` を含みます。`worktree.removed` は `workspace_id`、削除された `worktree`、`forced` を含みます。
diff --git a/docs/preview/website/src/content/docs/ja/windows-beta.mdx b/docs/preview/website/src/content/docs/ja/windows-beta.mdx
index 7d51fe0d..db708133 100644
--- a/docs/preview/website/src/content/docs/ja/windows-beta.mdx
+++ b/docs/preview/website/src/content/docs/ja/windows-beta.mdx
@@ -32,7 +32,7 @@ Windows ビルドは安定版とプレビューの両方のアップデートチ
| ローカル永続セッション | サポート済み |
| ConPTY によるネイティブペイン | サポート済み |
| Windows Terminal / PowerShell アプリからのアタッチ | サポート済み |
-| Linux/macOS ホストへの `herdr --remote` | サポート済み |
+| Linux/macOS/Windows ホストへの `herdr --remote` と保存済み SSH マシン | サポート済み。対話的なアタッチとマシン追加では確認後に Windows パッケージをインストール・更新できます。バックグラウンド再接続ではインストール済みパッケージだけを探します |
| リモートクリップボード画像と画像ファイルのドロップ | サポート済み |
| `cmd.exe` ペイン | サポート済み |
| ネイティブのキーボード/マウス入力 | サポート済み |
@@ -80,7 +80,7 @@ switch_ascii_input_source_in_prefix = true
その他の Windows IME はまだこのオプションに対応していません。[設定](/ja/docs/configuration/#プレフィックス入力ソースの切り替え)を参照してください。
-Windows 上の一部のエージェントは `ctrl+v` を受け取り、クリップボード画像を直接読み取れます。Herdr 自身のクリップボード画像リーダーはローカルのネイティブ Windows ペインには配線されていないため、エージェント自身による画像貼り付けはターミナルとエージェントに依存します。`alt+v` などエージェントの画像貼り付けショートカットによって、Herdr が管理するローカルクリップボードブリッジが追加されるわけではありません。リモートクリップボード画像ブリッジは、Linux/macOS ホストへの `herdr --remote` で別途サポートされます。
+Windows 上の一部のエージェントは `ctrl+v` を受け取り、クリップボード画像を直接読み取れます。Herdr 自身のクリップボード画像リーダーはローカルのネイティブ Windows ペインには配線されていないため、エージェント自身による画像貼り付けはターミナルとエージェントに依存します。`alt+v` などエージェントの画像貼り付けショートカットによって、Herdr が管理するローカルクリップボードブリッジが追加されるわけではありません。リモートクリップボード画像ブリッジは、Linux/macOS/Windows ホストへの `herdr --remote` で別途サポートされます。
Kitty graphics はデフォルトで有効で、外側のターミナルに依存します。Herdr は他のプラットフォームと同様に Windows でも Kitty graphics protocol の出力を送ります。この経路は Windows の WezTerm から WSL 内の Herdr をホストする構成で動作確認されていますが、ネイティブ Windows のターミナルと ConPTY の組み合わせはすべて検証済みではありません。Windows Terminal は Herdr が使う Kitty graphics 経路を提供しません。外側のターミナルがグラフィックス出力を正しく扱えない場合は、`[terminal].kitty_graphics = false` に設定してください。
@@ -118,7 +118,6 @@ Herdr のペインテキストコピーは Windows で動作します。ペイãƒ
| 機能 | 状況 |
| --- | --- |
| ダイレクトターミナルアタッチ (`herdr terminal attach`) | 未サポート |
-| `herdr --remote` の接続先としての Windows | 未サポート |
| ライブサーバーハンドオフ | 未サポート |
| Unix ファイルディスクリプタのハンドオフ | 未サポート |
| Unix フォアグラウンドプロセスグループ | 未サポート |
@@ -131,7 +130,7 @@ Windows Terminal からは、Linux や macOS と同じリモートコマンドã‚
herdr --remote workbox
```
-接続先ホストは Linux または macOS である必要があります。Herdr はインストール済みの Windows OpenSSH クライアントと SSH 設定を使います。Windows OpenSSH では Herdr の Unix コントロールソケットによる接続再利用を使わないため、セットアップ中の繰り返しプロンプトを避けるには Windows の `ssh-agent` による鍵認証を推奨します。
+接続先ホストは Linux、macOS、Windows に対応します。Windows ホストでは `PATH` または現在有効な管理対象リリースから互換パッケージを再利用します。対話的なアタッチと保存済みマシンのセットアップは、必要に応じて完全なパッケージをインストール・更新する前に確認します。バックグラウンド再接続ではインストール済みパッケージだけを探し、インストールや更新の確認は行いません。Herdr はインストール済みの Windows OpenSSH クライアントと SSH 設定を使います。Windows OpenSSH では Herdr の Unix コントロールソケットによる接続再利用を使わないため、セットアップ中の繰り返しプロンプトを避けるには Windows の `ssh-agent` による鍵認証を推奨します。
Windows のアップデートは Windows インストーラー経由で行われ、有効なバージョン付きリリースパスを更新します。新しいターミナルまたは再接続した SSH セッションはそのパスを受け取るため、そこで Herdr を起動すると更新済みクライアントを使えます。互換性のある実行中サーバーはペインを動かしたままにします。新しいリリースのサーバー側変更が必要になったときだけ、後からサーバーを再起動してください。ライブハンドオフは Unix 専用です。
diff --git a/docs/preview/website/src/content/docs/keyboard.mdx b/docs/preview/website/src/content/docs/keyboard.mdx
index d20b34b3..9e3a7053 100644
--- a/docs/preview/website/src/content/docs/keyboard.mdx
+++ b/docs/preview/website/src/content/docs/keyboard.mdx
@@ -62,6 +62,26 @@ Workspaces and session:
The full keymap and the binding syntax live in the [keybinding reference](/docs/configuration/#keybindings).
+The Goto picker (`prefix+g`) lists each agent or terminal on its own row, grouped by workspace. Split tabs never hide their panes behind another row. Click a row or press Enter to jump directly to it. Press `/` to search names, agent kinds, tabs, workspaces, branches, or paths; use Up/Down or `j/k` to move between rows when not typing a search. Left/Right jumps to the first agent or terminal in the previous/next workspace section, without wrapping. While editing a search, Left/Right moves the text cursor instead. Outside search, `b/w/i/d` filter blocked, working, idle, or done agents, and `a` shows all terminals again. The selected destination's location and path appear below the list. When the list overflows, use the mouse wheel, click the scrollbar track, or drag its thumb to scroll without opening a destination.
+
+## Editing text fields
+
+Herdr's naming dialogs, worktree branch fields, filters, and copy-mode search support editing at the cursor. These shortcuts apply to Herdr-owned fields, not to the shell or agent inside a pane.
+
+| Action | Keys |
+| --- | --- |
+| Move one character | Left / Right, Ctrl+B / Ctrl+F |
+| Move to the beginning / end | Home / End, Ctrl+A / Ctrl+E |
+| Move one word | Alt+B / Alt+F |
+| Delete the previous character | Backspace, Ctrl+H |
+| Delete the next character | Delete, Ctrl+D |
+| Cut to the beginning / end | Ctrl+U / Ctrl+K |
+| Cut the previous word | Ctrl+W, Alt+Backspace, Ctrl+Backspace |
+| Cut the next word | Alt+D |
+| Insert the last cut text | Ctrl+Y |
+
+Typing and paste insert at the cursor. Movement and deletion respect Unicode grapheme boundaries, and long values scroll horizontally. Cut text stays within the current field; it does not use the system clipboard. Alt shortcuts require the terminal to report Alt/Meta. Enter and Esc retain the dialog's confirm and cancel behavior.
+
## Copy mode
Press `prefix+[` to enter copy mode for the focused pane. Use `h/j/k/l`, tmux-style `w/b/e` and big-word `W/B/E`, `{`/`}`, `PageUp`/`PageDown`, `ctrl+b`/`ctrl+f`, and `ctrl+u`/`ctrl+d` to move. Press `/` or `?` for forward or backward literal search, then `n` or `N` to repeat in the same or opposite direction. Search is case-insensitive unless the query contains an uppercase letter. Use `v` or Space to start a selection, `y` or Enter to copy it, and `q` or Esc to leave without copying. Esc clears an active selection or search before exiting. Copy mode does not pause the pane process: output remains live, follows at the bottom, and stays pinned when you navigate into history. The configured prefix keeps its normal meaning in copy mode; with the default prefix, `ctrl+b` enters prefix mode instead of paging up, so use a different prefix if you want `ctrl+b` for copy-mode page-up. Mouse drag-select copies without entering copy mode at all.
diff --git a/docs/preview/website/src/content/docs/session-state.mdx b/docs/preview/website/src/content/docs/session-state.mdx
index 38712689..b8706cd5 100644
--- a/docs/preview/website/src/content/docs/session-state.mdx
+++ b/docs/preview/website/src/content/docs/session-state.mdx
@@ -32,10 +32,29 @@ If the Herdr server stops and starts again, the original pane processes are gone
Snapshot restore does not preserve running shells, servers, tests, or arbitrary processes. Panes that cannot use a stronger restore path come back as new shells in their saved directories.
-If `session.json` cannot be read or parsed, or requires a newer Herdr version, Herdr logs why loading failed. Before saving or clearing the replacement session, it preserves the original bytes in `session-backups/` beside `session.json` and logs the recovery path as `persist.backup`. A file missing at startup is checked again before the first save or clear. Healthy restores do not create recovery copies.
+If a saved directory is unavailable or the shell cannot start, the pane stays in the layout with an error instead of disappearing or moving to your home directory. Its saved directory and agent session reference remain intact. Fix the directory or shell configuration and restart the server to retry, or explicitly close the pane to remove it.
+
+When saving, Herdr prefers the live shell's directory where the operating system exposes it, and retains the last confirmed directory after the shell exits. Shell-reported directories remain the fallback on other platforms.
+
+If `session.json` cannot be read or parsed, or requires a newer Herdr version, Herdr logs why loading failed. Before saving or clearing the replacement session, it preserves the original bytes in `session-backups/` beside `session.json` and logs the recovery path as `persist.backup`. A file missing at startup is checked again before the first save or clear. These failed-load recovery copies are separate from normal snapshot history.
Herdr retains the three most recent recovery copies, pruning older copies only after a new copy is safely written. If preservation fails, autosave and shutdown leave the original untouched and log the failure; preservation is retried on the next save request. Copies are never restored automatically. To recover one, stop the affected server, copy the recovery file over its `session.json`, then restart. Recovery copies do not include pane screen history.
+## Shutdown and snapshot recovery
+
+On Linux systems with systemd-logind, Herdr listens for the host shutdown warning and requests a short delay while it saves and stops. This happens before logind proceeds with shutdown. The operating system limits the delay; Herdr does not block shutdown indefinitely. This protection is unavailable without logind and does not cover forced shutdown, power loss, or processes killed before the warning arrives.
+
+Herdr also keeps up to 48 layout snapshots in `session-snapshots/` beside `session.json`, on all platforms. The first saved layout is copied immediately. Later saves or clears can add a snapshot of the previous saved layout, at most once every 15 minutes. Unchanged snapshots are not duplicated. The interval survives server restarts, so a burst of pane exits or restarts cannot rotate away all older layouts. Recent changes may not be in the recovery snapshots.
+
+Normal pane closures still update `session.json`. There are no recovery prompts and no automatic restoration of older snapshots. To recover a layout:
+
+1. Find the affected session directory with `herdr session list --json`.
+2. Stop that server (`herdr server stop` for the default session, or `herdr session stop <name>` for a named session).
+3. Keep a copy of its current `session.json`, then copy the chosen file from `session-snapshots/` over `session.json`. File modification times identify when snapshots were taken.
+4. Start the session again.
+
+Snapshots contain layout and agent session references, not running processes or pane screen history. Treat them as private session data. A snapshot-write failure is logged but does not prevent the primary session from saving.
+
## Pane screen history replay
Pane screen history restores recent terminal contents after a full server restart without restoring the old process.
@@ -49,6 +68,8 @@ pane_history = true
When enabled, Herdr stores saved pane history in `session-history.json` next to `session.json`. Treat the Herdr config/session directory like terminal history.
+History is replayed only when it matches the exact saved layout. History from a different layout, including after manual snapshot recovery, is ignored. Older history files without layout verification are also ignored; newly saved history can be replayed on the next restart.
+
## Native agent session restore
Some agents can resume their own conversation sessions. Herdr can use official integration-reported session references to restart supported agent panes after a Herdr server restart.
@@ -101,6 +122,8 @@ Unlike snapshot restore, pane history replay, and native agent session restore,
A successful handoff preserves long-lived server-owned session state: pane PTYs and processes, agent identity and durable metadata, and plugin/session state needed by the replacement server. It does not preserve transient coordination across the replacement boundary. In-flight CLI or API requests, waits, subscription streams, client sockets, and pane-to-pane messages may be interrupted; clients should reconnect and retry them.
+Updated Unix servers can send more than 64 panes in one handoff by transferring them in batches. The sending server must already contain this support: an older running server still enforces its 64-pane limit on the first upgrade. That limit may require a normal server restart, which ends pane processes. Batching does not change update installation order or remove other handoff compatibility requirements.
+
Live handoff is experimental and opt-in:
```bash
diff --git a/docs/preview/website/src/content/docs/socket-api.mdx b/docs/preview/website/src/content/docs/socket-api.mdx
index 5bd933dd..e6ae6a57 100644
--- a/docs/preview/website/src/content/docs/socket-api.mdx
+++ b/docs/preview/website/src/content/docs/socket-api.mdx
@@ -118,12 +118,11 @@ Raw socket method names use dot notation:
`session.snapshot` returns a one-time bootstrap snapshot for clients that keep
their own local runtime cache. The response includes version/protocol metadata,
focused workspace/tab/pane ids, workspace records, tab records, pane records,
-tab layout snapshots, and agent records. It is not a subscription. To avoid a
-bootstrap gap, first open `events.subscribe` on another connection and wait for
-its acknowledgement. Buffer that stream while calling `session.snapshot`,
-install the snapshot, then apply the buffered events in order and continue
-streaming. Call `session.snapshot` again after reconnecting or when the local
-cache may be stale. Attached worktree provenance is included on workspace
+tab layout snapshots, and agent records. It is not a subscription. For cache
+bootstrap and recovery, subscribe first, then reconcile through authoritative
+reads as described under Event subscriptions below. Events invalidate cached state; they
+cannot be unconditionally replayed over a snapshot. Call `session.snapshot`
+again after reconnecting or when the local cache may be stale. Attached worktree provenance is included on workspace
records. Full repo worktree discovery remains `worktree.list`.
From the CLI, `herdr api snapshot` prints the live `session.snapshot` response
@@ -670,6 +669,11 @@ A successful response includes the same `id`:
{"id":"req_1","result":{"type":"pong"}}
```
+For request lines that reach JSON decoding, error responses also echo the request's
+`id`, including when the method or parameters are invalid. If the JSON is invalid
+or has no unambiguous top-level string `id`, the error response uses an empty `id`.
+Transport errors, such as invalid UTF-8, can close the connection without a response.
+
Event subscriptions keep the connection open after the initial response.
## Socket paths
@@ -814,9 +818,35 @@ Subscribe to events when you need a long-lived stream:
```
The first response acknowledges the subscription. Later lines are pushed events.
+All entries must be valid: if any referenced pane does not exist, Herdr rejects
+the entire request with an error and closes the connection. Refresh the pane list
+and retry rather than assuming the other entries were subscribed.
Lifecycle subscriptions start when the request is accepted and do not replay
events retained before that point.
+Lifecycle and agent-status events are drained in bounded batches, in order within
+each subscription. Event history is not durable. If a subscriber falls behind
+the retained history, including while its subscriptions are being initialized,
+the server sends an error response with the original request `id` and
+`error.code: "events_lost"`, then closes that subscription connection instead of
+silently continuing with missing events. Other clients remain connected.
+The history is shared across event types, so an overrun is reported even when
+the evicted events might not have matched this subscription's filters.
+
+On `events_lost`, treat the cached state as stale. Open a new subscription,
+wait for `subscription_started`, and keep reading while requesting
+`session.snapshot` on another connection. Use authoritative reads to reconcile
+current state: replace the cache with the snapshot, and treat incoming events
+as invalidation signals that trigger another read. Serialize refreshes and
+refresh again if events arrive while a read is in flight.
+
+Snapshots and events have no shared sequence boundary. Ordering is guaranteed
+within each subscription entry, not across entries or relative to a snapshot,
+so do not unconditionally replay buffered event payloads onto the snapshot.
+Recovery restores current state, not the missing event history. Another
+`events_lost` requires resubscribing and reconciling again. Slow readers may
+need to increase read throughput or reduce event load.
+
Workspace event subscriptions include `workspace.created`, `workspace.updated`, `workspace.metadata_updated`, `workspace.renamed`, `workspace.moved`, `workspace.reordered`, `workspace.closed`, and `workspace.focused`. `workspace.metadata_updated` reports token changes and TTL expiry without invoking plugin event hooks. Other workspace events describe Herdr UI/runtime lifecycle. `workspace.created` includes optional `workspace.worktree` provenance when the workspace belongs to a worktree group. `workspace.moved` includes the moved `workspace_id`, requested `insert_index`, and updated ordered `workspaces` list. `workspace.reordered` includes the atomically moved `workspace_ids`, optional `before_workspace_id`, and authoritative ordered `workspaces` list. `workspace.closed` includes a final `workspace` snapshot when Herdr can still identify it before removal.
Tab event subscriptions include `tab.created`, `tab.closed`, `tab.focused`,
`tab.renamed`, and `tab.moved`. `tab.moved` includes the moved `tab_id`,
@@ -833,9 +863,9 @@ Terminal-title changes can emit `pane.updated`, but spinner-only raw-title chang
`workspace_id`, and the current `scroll` metrics whenever Herdr observes a
changed scroll snapshot.
Layout event subscriptions include `layout.updated`. The event carries the
-updated `PaneLayoutSnapshot` for one tab. Clients that bootstrap with
-`session.snapshot` should replace the cached layout with the same
-`workspace_id` and `tab_id`.
+updated `PaneLayoutSnapshot` for one tab. Clients maintaining a cache with
+`session.snapshot` should use this event to refresh the affected layout through
+an authoritative read; a delayed payload may predate their latest snapshot.
Worktree event subscriptions include `worktree.created`, `worktree.opened`, and `worktree.removed`. Worktree events describe Git checkout lifecycle. `worktree.created` includes the opened `workspace` and created `worktree`. `worktree.opened` includes the target `workspace`, opened `worktree`, and `already_open`. `worktree.removed` includes the `workspace_id`, removed `worktree`, and `forced`.
diff --git a/docs/preview/website/src/content/docs/zh-cn/cli-reference.mdx b/docs/preview/website/src/content/docs/zh-cn/cli-reference.mdx
index 8795c45e..011efbd3 100644
--- a/docs/preview/website/src/content/docs/zh-cn/cli-reference.mdx
+++ b/docs/preview/website/src/content/docs/zh-cn/cli-reference.mdx
@@ -191,7 +191,9 @@ herdr tab rename <tab_id> <label>
herdr tab close <tab_id>
```
-标签页是工作区内的另一个终端布局。不指定 `--workspace` 时,`tab create` 使用活动工作区;如果没有活动工作区则失败。JSON 响应中的 `.result.tab.tab_id` 和 `.result.root_pane.pane_id` 是对应 ID。
+标签页是工作区内的另一个终端布局。不指定 `--workspace` 时,`tab create` 使用活动工作区;如果没有活动工作区则失败。JSON 响应中的 `.result.tab.tab_id` 和 `.result.root_pane.pane_id` 是对应 ID。关闭工作区的最后一个标签页也会关闭该工作区。启用 `ui.confirm_close` 时,如果关闭父工作树的最后一个标签页会连带关闭整个工作树组,`tab close` 会返回 `confirmation_required` 错误。
+
+启用 `ui.confirm_close` 时,通过快捷键或标签页菜单关闭工作区的最后一个标签页前,TUI 会要求确认。普通的 CLI/API 标签页关闭操作仍立即执行。
创建工作区、标签页和拆分窗格默认不改变焦点。`--focus` 选择新布局;`--no-focus` 显式表达默认行为。不指定 `--cwd` 时,新终端遵循 `terminal.new_cwd` 设置,默认跟随来源窗格或工作区。每个 `--env KEY=VALUE` 在新的根 shell 中添加或替换一个环境变量。
@@ -218,7 +220,7 @@ herdr pane move <pane_id> --new-workspace [--label TEXT] [--tab-label TEXT] [--f
herdr pane close <pane_id>
```
-接受 `--current` 的窗格命令在 Herdr 窗格内运行时使用调用方的 `HERDR_PANE_ID`。对 `pane split` 而言,显式窗格 ID 或 `--pane ID` 拆分该窗格,`--current` 拆分调用方窗格,省略目标则使用 UI 当前聚焦的窗格。拆分响应中的新窗格 ID 位于 `.result.pane.pane_id`。
+接受 `--current` 的窗格命令在 Herdr 窗格内运行时使用调用方的 `HERDR_PANE_ID`。对 `pane split` 而言,显式窗格 ID 或 `--pane ID` 拆分指定窗格。省略目标时,若存在 `HERDR_PANE_ID` 则拆分调用方窗格,否则使用当前聚焦的窗格。`--current` 必须有调用方窗格;缺少 `HERDR_PANE_ID` 时会报错。拆分响应中的新窗格 ID 位于 `.result.pane.pane_id`。
执行 `pane move` 后,后续命令应使用 `.result.move_result.pane.pane_id`。跨工作区移动会改变带工作区前缀的窗格 ID;旧值保留在 `.result.move_result.previous_pane_id`。运行中进程的 `HERDR_PANE_ID`、`HERDR_TAB_ID` 和 `HERDR_WORKSPACE_ID` 保持启动时的值,但 Herdr 会把旧窗格 ID 保留为该终端的别名,所以使用 `--current` 的窗格命令仍能解析它。实时智能体名称也会跟随终端。
@@ -342,11 +344,17 @@ herdr agent explain --file PATH --agent LABEL [--json|--verbose]
```bash
herdr terminal attach <terminal_id> [--takeover]
+herdr terminal session control <target> [--takeover] [--cols N] [--rows N]
+herdr terminal session observe <target> [--cols N] [--rows N]
herdr terminal title set <title>
herdr terminal title clear
```
从直接附加中用 `ctrl+b q` 分离。用 `ctrl+b ctrl+b` 发送字面的 `ctrl+b`。
+`terminal session control` 为窗格、终端或智能体打开可写的实时终端流,输出与 observe 相同的逐行 JSON `terminal.frame` 和 `terminal.closed`,并从标准输入读取 `terminal.input`、`terminal.resize`、`terminal.scroll`、`terminal.release` 命令。同一终端同时只能有一个控制方,可用 `--takeover` 接管。
+
+`terminal session observe` 为相同目标打开只读实时流,输出包含 base64 ANSI 字节的逐行 JSON `terminal.frame`,服务器关闭流时输出 `terminal.closed`。多个观察方可以同时查看终端,不获取输入、调整尺寸、滚动或接管权限。Linux/macOS 上,若套接字写入连续 30 秒没有进展,观察方会被断开;此时可能没有最后的 `terminal.closed` 记录,但窗格和其他客户端继续运行。安静、没有输出的窗格不会触发此超时。
+
`terminal title clear` 把外层终端窗口标题交还给 `ui.window_title`。
## 输出等待
diff --git a/docs/preview/website/src/content/docs/zh-cn/connecting-machines.mdx b/docs/preview/website/src/content/docs/zh-cn/connecting-machines.mdx
index 8180452b..4175d5ee 100644
--- a/docs/preview/website/src/content/docs/zh-cn/connecting-machines.mdx
+++ b/docs/preview/website/src/content/docs/zh-cn/connecting-machines.mdx
@@ -17,7 +17,7 @@ ssh workbox
`workbox` 可以是 SSH 配置中的主机名,也可以使用 `ssh://you@server:2222` 这样的目标。
-多机器连接支持 Linux 和 macOS 客户端,连接目标为 x86_64 或 aarch64 的 Linux 和 macOS 服务器。Windows 上的多机器连接尚未验证,也暂不受支持;独立连接命令 `herdr --remote` 仍支持 Windows。原生 Windows 服务器不能作为 SSH 目标。有关 SSH 配置、认证和自定义二进制文件,请参阅[通过 SSH 远程连接](/zh-cn/docs/persistence-remote/)。
+多机器连接支持 Linux、macOS 和 Windows 客户端,连接目标可以是 x86_64 或 aarch64 的 Linux/macOS 服务器,也可以是 x86_64 的 Windows 服务器。交互式设置可在确认后安装或更新完整的远程软件包;后台重连只查找已安装的软件包。有关 SSH 配置、认证和自定义二进制文件,请参阅[通过 SSH 远程连接](/zh-cn/docs/persistence-remote/)。
## 添加机器
@@ -43,7 +43,13 @@ Herdr 分别检查已安装的二进制文件和运行中的服务器,并在ä¿
在侧边栏选择机器或其工作区。只有选中的机器接收窗格输入和终端尺寸,并提供可见的终端内容和图形。其他已连接机器仍会更新工作区信息、智能体状态和通知,但不传输窗格画面。
-启动时会立即打开 Local,不等待 SSH 连接。一台机器无响应不会阻塞其他机器的输入。多个 Herdr 客户端也可以独立查看同一服务器上的不同标签页;共享标签页的尺寸规则见[客户端与服务器](/zh-cn/docs/concepts/)。
+点击任意机器旁的箭头,可以折叠或展开其工作区列表,而不切换当前工作区。机器正在重连时也可以操作。
+
+键盘导航先按 `prefix+w`,再使用工作区导航键(默认为 Up/Down),按侧边栏顺序高亮已连接机器上的工作区。Enter 确认切换;Esc 或前缀键取消,不切换机器。紧凑和展开的侧边栏都会显示高亮行,包括折叠机器内的行。桌面导航在两端循环,移动端切换器在首尾停止。已断开的机器会被跳过。
+
+高亮其他机器的工作区后,请先按 Enter 再使用其他键盘操作,避免误对当前机器执行窗格、标签页、工作区或自定义命令。点击会取消桌面上的远程键盘导航预览。展开的侧边栏会保留每台机器的 worktree 分组折叠状态。
+
+启动时会立即打开 Local,不等待 SSH 连接。选择 Local 也会立即取消尚未完成的远程切换,无需等待远程响应。如果 Local 自身正在重连,会在就绪后继续选中它。收到 Local 的新画面和终端设置后即可输入。一台机器无响应不会阻塞其他机器的输入。多个 Herdr 客户端也可以独立查看同一服务器上的不同标签页;共享标签页的尺寸规则见[客户端与服务器](/zh-cn/docs/concepts/)。
断线后,最后的工作区和智能体状态仍然可见,但会变暗。这是缓存,不是实时状态。在新连接和对应画面到达前,不能输入或导航到这些缓存窗格。重连不会从正在使用的机器抢走选择。
@@ -67,10 +73,12 @@ herdr machine remove <profile-id>
## 连接问题
-- **Reconnecting:** 网络中断、睡眠或 SSH 故障后,Herdr 会以有上限的退避间隔重试。SSH 连接会监测应用层活动并在空闲时探测,避免已断开的连接一直显示 Online。Local 使用本地连接关闭或失败来判断断线,而不是远程健康探测。
+- **Reconnecting:** 网络中断、睡眠或 SSH 故障后,Herdr 会自动重试。连续失败会将间隔增加到最多两分钟,短暂连接成功不会重置间隔。连接稳定一分钟后,下一次中断才会恢复快速重试。SSH 连接会监测应用层活动并在空闲时探测,避免已断开的连接一直显示 Online。Local 使用本地连接关闭或失败来判断断线,而不是远程健康探测。
- **Attention:** 目标需要无法在后台完成的操作,例如批准主机密钥、认证或准备兼容服务器。其他机器仍可使用。
- **保存机器文件错误:** 目录文件无法读取或内容无效时,当前连接保持不变。Herdr 会显示通知并自动重试读取。
+当两端都支持空闲桥接清理时,连接 Linux/macOS 的保存机器会在双向均无流量一分钟后关闭远程桥接。睡眠时间也计入期限,并在唤醒时检查。正常的空闲连接会交换健康检查,持续查看输出无需键盘输入。清理不会停止远程 Herdr 服务器、会话或窗格进程。旧安装仍可兼容连接,只是不使用这项可选清理功能。
+
后台连接不会回答提示,也不会安装、更新、重启或交接服务器。对于 Attention,请在交互式终端运行 Herdr 显示的独立设置命令,例如:
```bash
diff --git a/docs/preview/website/src/content/docs/zh-cn/integrations.mdx b/docs/preview/website/src/content/docs/zh-cn/integrations.mdx
index f6d7c1f3..5eb1f322 100644
--- a/docs/preview/website/src/content/docs/zh-cn/integrations.mdx
+++ b/docs/preview/website/src/content/docs/zh-cn/integrations.mdx
@@ -287,6 +287,8 @@ Herdr 用 `qwen --resume <id>` 恢复保存的 Qwen Code 会话。
## Letta Code
+Letta Code 集成安装是实验性的 CLI 专用功能,不在 Settings 的集成列表或 JSON 集成 API 中提供。`herdr integration status` 将其显示为 `letta (experimental)`。智能体检测和 `herdr agent start --kind letta` 不受此安装方式限制,均已支持。
+
安装 Letta Code 钩子:
```bash
diff --git a/docs/preview/website/src/content/docs/zh-cn/keyboard.mdx b/docs/preview/website/src/content/docs/zh-cn/keyboard.mdx
index da795378..486886f9 100644
--- a/docs/preview/website/src/content/docs/zh-cn/keyboard.mdx
+++ b/docs/preview/website/src/content/docs/zh-cn/keyboard.mdx
@@ -62,6 +62,26 @@ Herdr 是鼠标原生的。你可以点击窗格、标签页、工作区和智èƒ
完整键位和绑定语法见[按键绑定参考](/zh-cn/docs/configuration/#按键绑定)。
+Goto 选择器 (`prefix+g`) 按工作区分组,每个代理或终端各占一行,分割标签页中的窗格也会直接显示。点击一行或按回车即可跳转到对应窗格。按 `/` 搜索名称、代理类型、标签页、工作区、分支或路径;未输入搜索时,用上下方向键或 `j/k` 在各行之间移动,左右方向键跳到上一个或下一个工作区中的第一个代理或终端,到达两端后不会循环。编辑搜索内容时,左右方向键只移动文本光标。用 `b/w/i/d` 筛选 blocked、working、idle 或 done 状态的代理,按 `a` 重新显示所有终端。所选目标的位置和路径显示在列表下方。列表超出可视区域时,可以使用鼠标滚轮、点击滚动条轨道或拖动滑块来滚动,而不会打开目标。
+
+## 编辑文本输入框
+
+Herdr 的命名对话框、worktree 分支名、筛选框和复制模式搜索框支持在光标处编辑。以下快捷键适用于 Herdr 自己的输入框,不改变窗格内 shell 或智能体的按键行为。
+
+| 操作 | 按键 |
+| --- | --- |
+| 移动一个字符 | Left / Right、Ctrl+B / Ctrl+F |
+| 移到开头 / 末尾 | Home / End、Ctrl+A / Ctrl+E |
+| 移动一个词 | Alt+B / Alt+F |
+| 删除前一个字符 | Backspace、Ctrl+H |
+| 删除后一个字符 | Delete、Ctrl+D |
+| 剪切到开头 / 末尾 | Ctrl+U / Ctrl+K |
+| 剪切前一个词 | Ctrl+W、Alt+Backspace、Ctrl+Backspace |
+| 剪切后一个词 | Alt+D |
+| 插入上次剪切的文本 | Ctrl+Y |
+
+输入和粘贴会插入光标所在位置。移动和删除遵循 Unicode 字素边界,长内容会水平滚动。剪切的文本只保留在当前输入框中,不使用系统剪贴板。Alt 快捷键需要终端报告 Alt/Meta。Enter 和 Esc 仍用于对话框的确认和取消。
+
## 复制模式
按 `prefix+[` 让聚焦的窗格进入复制模式。用 `h/j/k/l`、tmux 风格的 `w/b/e` 和 `{`/`}` 移动。按 `/` 或 `?` 向前或向后进行文本搜索,再用 `n` 或 `N` 按相同或相反方向重复搜索。查询包含大写字母时区分大小写,否则不区分。用 `v` 或空格开始选择,用 `y` 或回车复制,用 `q` 或 Esc 不复制直接退出。Esc 会先清除当前选择或搜索,然后才退出。复制模式不会暂停窗格进程:停留在底部时继续跟随输出,进入历史记录后保持当前位置。鼠标拖选可以直接复制,完全不用进入复制模式。
diff --git a/docs/preview/website/src/content/docs/zh-cn/persistence-remote.mdx b/docs/preview/website/src/content/docs/zh-cn/persistence-remote.mdx
index 65567bc3..ddd0b0fb 100644
--- a/docs/preview/website/src/content/docs/zh-cn/persistence-remote.mdx
+++ b/docs/preview/website/src/content/docs/zh-cn/persistence-remote.mdx
@@ -69,7 +69,7 @@ Host workbox
herdr --remote workbox
```
-远程连接支持 Linux、macOS 和 Windows 本地客户端连接 x86_64 与 aarch64 的 Linux 和 macOS 主机。Herdr 会检查远程平台,优先使用远程 `PATH` 上兼容的 `herdr`,然后检查常见的直接安装、Homebrew、mise 和 Nix profile 路径。只要两端都支持稳定端点代数,客户端和服务器的发行版本就不必一致。如果没有兼容的二进制文件,交互式运行会询问是否安装到 `~/.local/bin/herdr`;非交互式运行则直接失败,不会修改主机。如果 `~/.local/bin` 不在远程 `PATH` 上,Herdr 会在安装后发出警告。Windows 不能作为远程主机。
+远程连接和已保存的 SSH 机器支持 Linux、macOS 和 Windows 客户端,目标可以是 x86_64 或 aarch64 的 Linux/macOS 主机,也可以是 x86_64 的 Windows 主机。只要两端支持稳定端点代数,版本就不必一致。Linux/macOS 上优先使用远程 `PATH` 中兼容的 `herdr`,再检查常见的直接安装、Homebrew、mise 和 Nix profile 路径。Windows 上检查 `PATH` 和当前有效的托管版本。如果没有兼容的二进制文件,交互式运行会询问是否安装或更新;非交互式运行直接失败,不修改主机。Linux/macOS 安装到 `~/.local/bin/herdr`,Windows 安装包含应用本地 ConPTY 运行时的完整软件包。如果 `~/.local/bin` 不在远程 `PATH` 中,Herdr 会发出警告。
默认情况下,`herdr --remote` 通过一个临时 SSH 配置运行远程设置和桥接: 先包含你的 SSH 配置,再补充兜底的保活设置。已有的用户保活设置优先。Linux 和 macOS 客户端还会添加一个私有的单次连接 control socket 来复用连接;Windows OpenSSH 不使用此方式。设置 `[remote].manage_ssh_config = false` 可以不用 Herdr 生成的配置或 control socket,而使用普通 `ssh`。
@@ -90,9 +90,9 @@ herdr --remote workbox --handoff
如果你先 SSH 到服务器再在那里运行 `herdr`,Herdr 就完全运行在服务器上。这种模式简单实用,但除了普通的终端文本粘贴之外,它无法访问你本地桌面的剪贴板。
-当本地和远程平台一致时,对于直接安装,Herdr 可以直接复制当前本地二进制文件。对于 Homebrew、mise 和 Nix 安装,或平台不一致时,它会从 `https://herdr.dev/latest.json` 下载与当前客户端版本匹配的发布产物。
+对于 Linux/macOS 主机,平台一致的直接安装可以复制当前本地二进制文件。Homebrew、mise、Nix 安装、平台不一致或目标为 Windows 时,会从 `https://herdr.dev/latest.json` 下载与当前客户端版本对应的发布产物。
-对于本地构建或自定义二进制文件,在远程连接前设置 `HERDR_REMOTE_BINARY` 指向本地文件路径。
+对于本地构建或自定义软件包,在远程连接前设置 `HERDR_REMOTE_BINARY` 指向本地文件。Linux/macOS 目标使用 Herdr 可执行文件,Windows 目标必须使用完整的 `herdr-windows-x86_64.zip` 软件包。
```bash
HERDR_REMOTE_BINARY=target/release/herdr herdr --remote workbox
diff --git a/docs/preview/website/src/content/docs/zh-cn/quick-start.mdx b/docs/preview/website/src/content/docs/zh-cn/quick-start.mdx
index 3f695d92..87211e28 100644
--- a/docs/preview/website/src/content/docs/zh-cn/quick-start.mdx
+++ b/docs/preview/website/src/content/docs/zh-cn/quick-start.mdx
@@ -17,9 +17,9 @@ Herdr 会启动或连接到你的默认后台会话。你不需要管理 socketã
## 使用鼠标
-Herdr 是鼠标原生的,所以从点击开始。点击窗格、标签页、工作区和智能体来聚焦它们。拖动分割边框来调整大小。右键打开上下文菜单,包括分割窗格和创建标签页。拖选文本即可复制到剪贴板;双击一个词直接复制它。复制不需要 Ctrl+C。
+Herdr 是鼠标原生的,所以从点击开始。点击窗格、标签页、工作区和智能体来聚焦它们。拖动分割边框来调整大小。右键打开上下文菜单,包括分割窗格和创建标签页。拖选文本即可复制到剪贴板。双击一个词可以选中它;按住第二次点击并拖动,会按整词扩展选择。两种操作都会在松开鼠标时复制。复制不需要 Ctrl+C。
-当终端把带修饰键的点击传给 Herdr 时,Ctrl+点击可以打开窗格内的链接。这对 OSC 8 超链接和可见的 `http://` 或 `https://` URL 有效。在 macOS 上,鼠标捕获开启时,请用 Ctrl+点击来触发 Herdr 处理的窗格链接;Cmd+点击只能通过终端原生的绕过路径使用,比如 Shift+Cmd+点击或 `ui.mouse_capture = false`。
+当终端把带修饰键的点击传给 Herdr 时,Ctrl+点击可以打开窗格内的链接。这适用于 OSC 8 超链接及 `http://` 或 `https://` URL,包括首尾部分位于可见区域之外的换行链接。按住 Ctrl 并将指针移到链接上,会为可见部分添加下划线。移开指针、窗格内容变化或收到 Ctrl 释放事件时,高亮会清除;部分终端只在鼠标移动时报告修饰键变化。在 macOS 上,鼠标捕获开启时,请用 Ctrl+点击来触发 Herdr 处理的窗格链接;Cmd+点击只能通过终端原生的绕过路径使用,比如 Shift+Cmd+点击或 `ui.mouse_capture = false`。
如果配置了 `ui.right_click_passthrough_modifier`,该修饰键加右键会把右键点击、按住和拖动手势发送给启用鼠标上报的窗格应用。
diff --git a/docs/preview/website/src/content/docs/zh-cn/session-state.mdx b/docs/preview/website/src/content/docs/zh-cn/session-state.mdx
index 9747e2b6..9be84060 100644
--- a/docs/preview/website/src/content/docs/zh-cn/session-state.mdx
+++ b/docs/preview/website/src/content/docs/zh-cn/session-state.mdx
@@ -34,10 +34,29 @@ herdr
快照恢复不会保留运行中的 shell、服务器、测试或任意进程。无法使用更强恢复路径的窗格,会在各自保存的目录中作为新 shell 回来。
-如果无法读取或解析 `session.json`,或该文件需要更新的 Herdr 版本,Herdr 会记录加载失败的原因。在保存或清除新会话之前,Herdr 会将原始文件逐字节保存到 `session.json` 旁的 `session-backups/` 中,并通过 `persist.backup` 记录恢复副本的路径。即使启动时文件不存在,也会在首次保存或清除前再次检查。正常加载的会话不会创建恢复副本。
+如果保存的目录不可用或 shell 无法启动,窗格会留在布局中并显示错误,而不是消失或切换到主目录。保存的目录和智能体会话引用仍会保留。修复目录或 shell 配置后,重启服务器即可重试;也可以明确关闭窗格将其移除。
+
+保存时,如果操作系统支持查询,Herdr 会优先使用正在运行的 shell 的目录,并在 shell 退出后保留最后确认的目录。在其他平台上,则使用 shell 报告的目录。
+
+如果无法读取或解析 `session.json`,或该文件需要更新的 Herdr 版本,Herdr 会记录加载失败的原因。在保存或清除新会话之前,Herdr 会将原始文件逐字节保存到 `session.json` 旁的 `session-backups/` 中,并通过 `persist.backup` 记录恢复副本的路径。即使启动时文件不存在,也会在首次保存或清除前再次检查。这些加载失败时的恢复副本与常规快照历史分开管理。
Herdr 保留最新的三个恢复副本,只有在新副本安全写入后才删除旧副本。如果无法保存副本,自动保存和退出保存都不会修改原始文件,并会记录错误,在下一次保存请求时重试。副本不会自动恢复。如需恢复,请停止对应的服务器,将恢复文件复制到该服务器的 `session.json`,然后重启。恢复副本不包含窗格屏幕历史。
+## 关机与快照恢复
+
+在使用 systemd-logind 的 Linux 系统上,Herdr 会监听主机关机预告,并请求短暂延迟,以便保存并停止服务器,随后 logind 才继续关机。延迟由操作系统限制,不会无限阻止关机。此保护不适用于没有 logind 的系统、强制关机、断电,或进程在预告到达前已被终止的情况。
+
+在所有平台上,Herdr 还会在 `session.json` 旁的 `session-snapshots/` 中保留最多 48 个布局快照。首次保存的布局会立即复制。之后的保存或清除操作会复制之前保存的布局,最多每 15 分钟一次,不重复保存相同内容。此间隔在服务器重启后仍然有效,因此连续的窗格退出或重启不会挤掉所有旧快照。最近的更改可能尚未包含在快照中。
+
+正常关闭窗格仍会更新 `session.json`,不会出现恢复提示,也不会自动恢复旧布局。如需手动恢复:
+
+1. 用 `herdr session list --json` 找到对应的会话目录。
+2. 停止对应的服务器:默认会话用 `herdr server stop`,命名会话用 `herdr session stop <name>`。
+3. 先另存当前的 `session.json`,再将 `session-snapshots/` 中选定的文件复制到 `session.json`。文件修改时间表示快照的保存时间。
+4. 重新启动该会话。
+
+快照包含布局和代理会话引用,不包含运行中的进程或窗格屏幕历史。请将其视为私密会话数据。快照写入失败会记录到日志,但不会阻止主会话文件的正常保存。
+
## 窗格屏幕历史回放
窗格屏幕历史在服务器完全重启后恢复最近的终端内容。它恢复的是 Herdr 能展示的内容,而不是原来的进程。
@@ -51,6 +70,8 @@ pane_history = true
开启后,Herdr 把保存的窗格历史存放在 `session.json` 旁边的 `session-history.json` 中。请像对待终端历史一样对待 Herdr 的配置/会话目录。
+只有与保存的布局完全匹配的历史才会回放。来自其他布局的历史,包括手动恢复快照后不再匹配的历史,都会被忽略。无法验证布局的旧版历史文件也会被忽略;新保存的历史可在下次重启时回放。
+
## 智能体原生会话恢复
一些智能体可以恢复它们自己的对话会话。Herdr 可以使用官方集成上报的会话引用,在 Herdr 服务器重启后重新启动受支持的智能体窗格。
@@ -75,6 +96,7 @@ Herdr 只会恢复那些通过当前官方 Herdr 集成上报了原生会话引ç
| Claude Code | `6` | `claude --resume <id>` |
| Codex | `5` | `codex resume <id>` |
| Cursor Agent CLI | `1` | `cursor-agent --resume <id>` |
+| Grok CLI | `2` | `grok --resume <id>` |
| GitHub Copilot CLI | `2` | `copilot --resume=<id>` |
| Devin CLI | `2` | `devin --resume <id>` |
| Droid | `2` | `droid --resume <id>` |
@@ -101,6 +123,8 @@ Herdr 只会恢复那些通过当前官方 Herdr 集成上报了原生会话引ç
交接保护的是由服务器拥有的长期会话状态:窗格 PTY 和进程、智能体身份与持久元数据,以及替换服务器所需的插件/会话状态。它不会跨替换边界保留临时协调状态。进行中的 CLI 或 API 请求、等待、订阅流、客户端套接字和窗格间消息可能会中断;客户端应重新连接并重试。
+更新后的 Unix 服务器可以分批传输,在一次交接中发送超过 64 个窗格。发送方服务器必须已经支持此功能;从旧服务器进行第一次升级时,仍受其原有的 64 窗格限制。此时可能需要正常重启服务器,这会结束窗格进程。分批传输不会改变更新的安装顺序,也不会取消其他交接兼容性要求。
+
实时交接是实验性功能,需要主动开启:
```bash
diff --git a/docs/preview/website/src/content/docs/zh-cn/socket-api.mdx b/docs/preview/website/src/content/docs/zh-cn/socket-api.mdx
index 9a2f5c4e..3aae7131 100644
--- a/docs/preview/website/src/content/docs/zh-cn/socket-api.mdx
+++ b/docs/preview/website/src/content/docs/zh-cn/socket-api.mdx
@@ -111,7 +111,7 @@ herdr pane read w1:p2 --source recent --lines 50
`workspace.move_block` 会将有序的 `workspace_ids` 原子地移动到 `before_workspace_id` 之前;省略锚点则将该块移动到末尾。id 必须唯一,且锚点不能属于被移动的块。响应包含服务器确认的有序工作区列表。
-`session.snapshot` 为维护本地运行时缓存的客户端返回一次性引导快照。响应包含版本/协议元数据、当前聚焦的工作区/标签页/窗格 id、工作区记录、标签页记录、窗格记录、标签页布局快照和智能体记录。它不是订阅。为避免引导期间漏掉事件,应先在另一个连接上打开 `events.subscribe` 并等待确认,在调用 `session.snapshot` 时缓冲该事件流,然后安装快照、按顺序应用缓冲的事件并继续接收事件。重新连接后或本地缓存可能已过期时,再次调用 `session.snapshot`。工作区记录也包含关联 worktree 的来源信息。完整的仓库 worktree 发现仍使用 `worktree.list`。
+`session.snapshot` 为维护本地运行时缓存的客户端返回一次性引导快照。响应包含版本/协议元数据、当前聚焦的工作区/标签页/窗格 id、工作区记录、标签页记录、窗格记录、标签页布局快照和智能体记录。它不是订阅。初始化或恢复缓存时,应先建立订阅,再按下文事件订阅部分的说明读取服务器当前状态并核对、更新缓存。事件表示缓存可能过期,不能无条件重放到快照上。重新连接后或本地缓存可能已过期时,再次调用 `session.snapshot`。工作区记录也包含关联 worktree 的来源信息。完整的仓库 worktree 发现仍使用 `worktree.list`。
CLI 的 `herdr api snapshot` 会把当前 `session.snapshot` 响应输出为 JSON,让客户端和智能体可以简单地完成引导。
@@ -345,7 +345,7 @@ UI 上下文变化时,该投影会重新求值。它控制展开和折叠的侧è
过滤字段是 `status`、`workspace_id`、`tab_id`、`pane_id`、`agent`、`seen`
和 `state_change_seq`。要过滤插件上报的窗格元数据,使用 `{"token":"name"}`
作为字段。值可以是字符串、布尔值、无符号整数或上下文对象。上下文值包括
-`current_workspace_id` 和 `current_tab_id`,并且只能与对应的 ID 字段比较。
+`current_workspace_id` 和 `current_tab_id`,并且只能与对应的 ID 字段比较。在保存机器客户端中,所选服务器的视图应用于合并后的智能体列表。当前工作区和标签页上下文也包含所选机器,因此其他机器上的相同 ID 不会匹配;而 `status` 为 `blocked` 等独立条件仍可匹配任意已连接机器上的智能体。
有效 status 值为 `idle`、`working`、`blocked`、`done` 和 `unknown`;`done`
表示 idle 且尚未查看。
@@ -635,10 +635,16 @@ workspace 的 get/list 响应会公开生成的 `tokens` 映射,空间侧边栏è
第一个响应确认订阅。之后的行是推送的事件。生命周期事件订阅从请求被接受时开始,不会重放在此之前保留的事件。
+生命周期和智能体状态事件按有界批次发送,每个订阅内保持事件顺序。事件历史不是持久日志。如果订阅者落后到保留范围之外,包括订阅初始化期间,服务器会发送包含原请求 `id` 和 `error.code: "events_lost"` 的错误响应,然后关闭该订阅连接,而不是静默跳过缺失事件后继续发送。其他客户端的连接不受影响。各类事件共享历史缓冲,因此即使被淘汰的事件可能不匹配此订阅的过滤条件,仍会报告溢出。
+
+收到 `events_lost` 后,将缓存状态视为过期。建立新订阅并等待 `subscription_started`,然后持续读取,同时在另一条连接上请求 `session.snapshot`。通过服务器返回的当前状态重新核对缓存:用快照整体替换缓存,将收到的事件作为缓存失效通知并触发再次读取。串行执行刷新;如果读取期间又收到事件,完成后再次刷新。
+
+快照和事件没有共同的序列边界。顺序仅在每个订阅条目内保证,不保证跨条目或相对于快照的顺序,因此不要把缓冲的事件载荷无条件重放到快照上。恢复得到的是当前状态,无法补回丢失的事件历史。再次收到 `events_lost` 时,需要重新订阅并核对状态。读取过慢的客户端可能需要提高读取速度或减少事件负载。
+
工作区事件订阅包括 `workspace.created`、`workspace.updated`、`workspace.metadata_updated`、`workspace.renamed`、`workspace.moved`、`workspace.reordered`、`workspace.closed` 和 `workspace.focused`。`workspace.metadata_updated` 报告令牌变更和 TTL 到期,但不会调用插件事件钩子。其他工作区事件描述 Herdr UI/运行时的生命周期。当工作区属于 worktree 组时,`workspace.created` 包含可选的 `workspace.worktree` 来源信息。`workspace.moved` 包含被移动的 `workspace_id`、请求的 `insert_index` 和更新后的有序 `workspaces` 列表。`workspace.reordered` 包含原子移动的 `workspace_ids`、可选的 `before_workspace_id` 和服务器确认的有序 `workspaces` 列表。在移除前 Herdr 仍能识别时,`workspace.closed` 包含最终的 `workspace` 快照。
标签页事件订阅包括 `tab.created`、`tab.closed`、`tab.focused`、`tab.renamed` 和 `tab.moved`。`tab.moved` 包含被移动的 `tab_id`、`workspace_id`、请求的 `insert_index` 和该工作区更新后的有序 `tabs` 列表。
-窗格事件订阅包括 `pane.created`、`pane.updated`、`pane.closed`、`pane.focused`、`pane.moved`、`pane.exited`、`pane.agent_detected`、`pane.output_matched`、`pane.agent_status_changed` 和 `pane.scroll_changed`。终端标题变化可能发出 `pane.updated`,但如果原始标题只有旋转指示符发生变化且 `terminal_title_stripped` 不变,则不会发出。`pane.scroll_changed` 只针对一个 `pane_id`,每当 Herdr 观察到滚动快照变化时,都会发出 `pane_id`、`workspace_id` 和当前 `scroll` 指标。
-布局事件订阅包括 `layout.updated`。该事件携带一个标签页更新后的 `PaneLayoutSnapshot`。使用 `session.snapshot` 引导的客户端应替换具有相同 `workspace_id` 和 `tab_id` 的缓存布局。
+窗格事件订阅包括 `pane.created`、`pane.updated`、`pane.closed`、`pane.focused`、`pane.moved`、`pane.exited`、`pane.agent_detected`、`pane.output_matched`、`pane.agent_status_changed` 和 `pane.scroll_changed`。`pane.focused` 也会上报任意连接到此服务器的客户端手动选择窗格的变化,不会移动其他客户端的视图,且载荷不包含客户端身份。重复选择已选中的窗格不会再次发出事件。终端标题变化可能发出 `pane.updated`,但如果原始标题只有旋转指示符发生变化且 `terminal_title_stripped` 不变,则不会发出。`pane.scroll_changed` 只针对一个 `pane_id`,每当 Herdr 观察到滚动快照变化时,都会发出 `pane_id`、`workspace_id` 和当前 `scroll` 指标。
+布局事件订阅包括 `layout.updated`。该事件携带一个标签页更新后的 `PaneLayoutSnapshot`。使用 `session.snapshot` 维护缓存的客户端应将该事件作为重新读取受影响布局的通知;延迟到达的载荷可能早于最新快照。
Worktree 事件订阅包括 `worktree.created`、`worktree.opened` 和 `worktree.removed`。Worktree 事件描述 Git 检出的生命周期。`worktree.created` 包含打开的 `workspace` 和创建的 `worktree`。`worktree.opened` 包含目标 `workspace`、打开的 `worktree` 和 `already_open`。`worktree.removed` 包含 `workspace_id`、被移除的 `worktree` 和 `forced`。
diff --git a/docs/preview/website/src/content/docs/zh-cn/windows-beta.mdx b/docs/preview/website/src/content/docs/zh-cn/windows-beta.mdx
index 35b1ff33..025f0f4d 100644
--- a/docs/preview/website/src/content/docs/zh-cn/windows-beta.mdx
+++ b/docs/preview/website/src/content/docs/zh-cn/windows-beta.mdx
@@ -32,7 +32,7 @@ Windows 构建同时通过稳定版和预览版更新通道提供。新安装默
| 本地持久会话 | 已支持 |
| 通过 ConPTY 的原生窗格 | 已支持 |
| Windows Terminal / PowerShell 应用连接 | 已支持 |
-| 连接 Linux/macOS 主机的 `herdr --remote` | 已支持 |
+| 连接 Linux/macOS/Windows 主机的 `herdr --remote` 和已保存 SSH 机器 | 已支持;交互式连接和机器设置可在确认后安装或更新 Windows 软件包,后台重连只查找已安装的软件包 |
| 远程剪贴板图像和图像文件拖放 | 已支持 |
| `cmd.exe` 窗格 | 已支持 |
| 原生键盘和鼠标输入 | 已支持 |
@@ -80,7 +80,7 @@ switch_ascii_input_source_in_prefix = true
此选项暂不支持其他 Windows 输入法。参见[配置](/zh-cn/docs/configuration/#前缀输入源切换)。
-Windows 上的部分智能体可以接收 `ctrl+v` 并直接读取剪贴板图像。Herdr 自己的剪贴板图像读取器尚未接入本地原生 Windows 窗格,因此智能体原生图像粘贴仍取决于终端和智能体。`alt+v` 等智能体图像粘贴快捷键不会增加由 Herdr 管理的本地剪贴板桥。远程剪贴板图像桥通过连接 Linux/macOS 主机的 `herdr --remote` 单独受支持。
+Windows 上的部分智能体可以接收 `ctrl+v` 并直接读取剪贴板图像。Herdr 自己的剪贴板图像读取器尚未接入本地原生 Windows 窗格,因此智能体原生图像粘贴仍取决于终端和智能体。`alt+v` 等智能体图像粘贴快捷键不会增加由 Herdr 管理的本地剪贴板桥。远程剪贴板图像桥通过连接 Linux/macOS/Windows 主机的 `herdr --remote` 单独受支持。
Kitty graphics 默认启用,并取决于外层终端。Herdr 会像在其他平台上一样在 Windows 上输出 Kitty graphics protocol。这个路径已在 Windows WezTerm 托管 WSL 中 Herdr 的配置下得到验证,但原生 Windows 的各种终端与 ConPTY 组合尚未全部验证。Windows Terminal 不提供 Herdr 使用的 Kitty graphics 路径。如果外层终端无法正确处理图形输出,请设置 `[terminal].kitty_graphics = false`。
@@ -118,7 +118,6 @@ Herdr 的窗格文本复制在 Windows 上可用。在窗格内拖选文本即å�
| 能力 | 状态 |
| --- | --- |
| 直接终端附加 (`herdr terminal attach`) | 不支持 |
-| Windows 作为 `herdr --remote` 的目标主机 | 不支持 |
| 实时服务器交接 | 不支持 |
| Unix 文件描述符交接 | 不支持 |
| Unix 前台进程组 | 不支持 |
@@ -131,7 +130,7 @@ Herdr 的窗格文本复制在 Windows 上可用。在窗格内拖选文本即å�
herdr --remote workbox
```
-目标主机必须运行 Linux 或 macOS。Herdr 使用已安装的 Windows OpenSSH 客户端和你的 SSH 配置。Windows OpenSSH 不使用 Herdr 的 Unix control socket 连接复用,因此建议通过 Windows `ssh-agent` 使用密钥认证,避免远程设置期间重复提示。
+目标主机可以运行 Linux、macOS 或 Windows。Windows 主机会复用 `PATH` 或当前有效的托管版本中的兼容软件包。交互式连接和保存机器设置会在安装或更新完整软件包前询问;后台重连只查找已安装的软件包,不会提示安装或更新。Herdr 使用已安装的 Windows OpenSSH 客户端和你的 SSH 配置。Windows OpenSSH 不使用 Herdr 的 Unix control socket 连接复用,因此建议通过 Windows `ssh-agent` 使用密钥认证,避免远程设置期间重复提示。
Windows 更新通过 Windows 安装器进行,并更新当前带版本号的发布路径。新终端和重新连接的 SSH 会话会获得该路径;在其中启动 Herdr 即可使用更新后的客户端。兼容的运行中服务器会让窗格继续运行。只有需要新版本的服务器端改动时,才稍后重启服务器。实时交接仅限 Unix。
diff --git a/docs/preview/website/src/data/config-reference.json b/docs/preview/website/src/data/config-reference.json
index 36afe337..ece9a833 100644
--- a/docs/preview/website/src/data/config-reference.json
+++ b/docs/preview/website/src/data/config-reference.json
@@ -410,7 +410,7 @@
"key": "terminal.default_shell",
"type": "string",
"default": "\"\"",
- "description": "Executable used for new interactive panes. Empty means SHELL, then /bin/sh."
+ "description": "Executable used for new interactive panes. Empty means SHELL, then /bin/sh; on Windows, pwsh.exe when present on PATH, otherwise powershell.exe."
},
{
"key": "terminal.shell_mode",
@@ -698,6 +698,12 @@
"description": "Open the focused pane scrollback in $EDITOR."
},
{
+ "key": "keys.clear_pane",
+ "type": "keybinding",
+ "default": "unset",
+ "description": "Clear the focused pane screen and scrollback, keeping the current cursor line and its visible soft-wrapped rows. Sends no input to the running program and does nothing on the alternate screen (for example, Vim). Unset by default; for example, clear_pane = \"prefix+ctrl+k\"."
+ },
+ {
"key": "keys.copy_mode",
"type": "keybinding",
"default": "\"prefix+[\"",