@cocorograph/hub-agent 0.5.10 → 0.5.11

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/src/tmux.mjs +13 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocorograph/hub-agent",
3
- "version": "0.5.10",
3
+ "version": "0.5.11",
4
4
  "description": "Hub Hosted Cockpit のローカル常駐 agent。Hub と outbound WSS で接続し、ローカルの tmux/pty を中継する。",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
package/src/tmux.mjs CHANGED
@@ -366,6 +366,19 @@ export async function createSession(name, cwd, opts = {}) {
366
366
  // has-session が非 0 = セッション無し
367
367
  }
368
368
  await execFileP(tmuxBin(opts), ["new-session", "-d", "-s", name, "-c", resolvedCwd])
369
+ // Cockpit web UI からの touch swipe (= SGR wheel escape) を tmux に拾わせるため、
370
+ // 当該 session で mouse mode を ON にする。tmux 2.1+ で `mouse` option は
371
+ // session-scoped、`-t <session>` 指定で他 session への副作用なし。
372
+ // ユーザーの ~/.tmux.conf を編集せずに済む方式。失敗してもセッション起動自体は
373
+ // 妨げないように warn のみで握り潰す。
374
+ try {
375
+ await execFileP(tmuxBin(opts), ["set-option", "-t", name, "mouse", "on"])
376
+ } catch (err) {
377
+ opts.logger?.warn?.(
378
+ { session: name, err: err?.message || String(err) },
379
+ "tmux set-option mouse on failed (cockpit touch scroll may not work in this session)",
380
+ )
381
+ }
369
382
  // 起動直後 pane の current_path を確認し、想定 cwd と異なれば WARN ログを残す
370
383
  // (Phase 3: 任意検証。tmux 側のクオート / 権限問題で fallback した場合を検知する)
371
384
  if (opts.logger) {