dsh-ssh-tui 0.7.0-rc.2 → 0.7.1

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.en.md CHANGED
@@ -66,6 +66,16 @@ Reproducible, no model in the loop: `npm run screenshots:slow` writes
66
66
  `docs/screenshots/slow-link.json`. This capture is 14 paints, about
67
67
  **18.0 KB**, **8.8 s** at 2 kB/s. Byte ledger for this event sequence.
68
68
 
69
+ 0.7 highlights: drag-select any part of a model reply to copy it (OSC 52 into your local
70
+ clipboard; a tool card still expands on click) · the footer is one priority-ordered chip
71
+ strip, and `⚠` opens `/doctor` · the quota bar is on screen from the first frame and names
72
+ its window (`5Hr`/`1Wk`/`1Mo`, smallest window by default, `?%` with a 15-second retry until
73
+ a reading arrives) · `/mode` groups presets and filters with `/` · the compact view names
74
+ every changed file · tool diffs are line-level, emphasise only what changed, and go
75
+ side-by-side at 100 columns or more · `DSH_TUI_LINE_MODE=1` appends plain lines for screen
76
+ readers and `tee` · `ssh-tui.keys` rebinds keys, refusing conflicts · `DSH_TUI_COLOR_DEPTH`
77
+ pins the palette (truecolor / 256 / 8 / none).
78
+
69
79
  ## Requirements
70
80
 
71
81
  - Node.js >= 22.19
@@ -286,68 +296,28 @@ You can reopen the wizard at any time with:
286
296
 
287
297
  ## Cross-platform support
288
298
 
289
- The plugin runs on Linux, macOS, and Windows (Node ≥ 22.19):
290
-
291
- - Linux/macOS: same command as above; the wizard persists credentials in
292
- `~/.dsh/.credentials.yaml`, or `~/.dsh/env.sh` when a system-injected
293
- environment variable must be overridden.
294
- - Windows (PowerShell or Windows Terminal): install with the same npm/dsh
295
- commands `dsh` is on PATH via npm's global bin. The wizard stores the key
296
- through the dsh credential store, or runs `setx` (plus `env.cmd`) when an
297
- environment variable shadows the store. Agent shell tools automatically use
298
- PowerShell on Windows (the harness disables bash there).
299
- - Windows display channel: the Host/Display link is a named pipe
300
- (`\\.\pipe\dsh-tui-<8-hex DSH_HOME>-<session name>-<8-hex session id>`), not a
301
- `.sock` file a named pipe is the only local socket Windows can listen on,
302
- and it is reclaimed when the Host exits. Both digests are part of the name so
303
- two homes or two sessions can never share one machine-wide pipe. Because `fs.access()` cannot see the pipe namespace, readiness is
304
- probed with a real connect, and a Host that exits early is reported at once
305
- with its stderr (kept in `%USERPROFILE%\.dsh\tui-socks\<session>.err`).
306
- - Windows session locks: with no `/proc`, a live pid is checked with
307
- `Get-Process` (image name plus creation time), so a pid recycled by an
308
- unrelated process is recognised as stale and the session resumes instead of
309
- reporting a phantom zombie Host.
310
- - Footer speed (`135 tok/s`): measured from the first token the model emits
311
- (reasoning or tool-call fragments included) to the settled step, and rebuilt
312
- when a session is replayed on `--resume` — from the durable `assistant/chunk`
313
- events on 0.1.2 hosts, or from the packed stream inside `assistant/message`
314
- on 0.1.5. Steps with no usable timing fall back to `首字 1.2s`.
315
- - Emoji width: BMP symbols carrying the Unicode `Emoji` property are budgeted two cells. When the monospace font lacks the glyph, the terminal falls back to a colour emoji about 1.6 cells wide that still advances one cell — it covers its neighbours, and the second budgeted cell goes unspent so the row comes up short. `pinEmojiCells()` does both halves at paint time: VS15 asks for the narrow text form, and a reserving space spends the second cell (emitted unconditionally, so "two cells plus every space in the text" equals "one cell of glyph advance, one reserving space, and those same spaces" for every shape). Symbols that already default to emoji presentation (`✅` `⚡` …) and astral emoji (`😀` …) advance two cells and are left alone.
316
- - Reconnect: channel readiness is a real connect, so a `.sock` file left behind by a killed Host is no longer listed as attachable (it used to fail the first attach with `write EPIPE`); a Host still cancelling/flushing keeps itself alive when a relay HELLOs mid-hangup; a launcher that hits a vanished peer retries once automatically — silently, with the TTY kept in raw mode and queued bytes dropped so a stale cursor reply is never echoed as `^[[17;1R`; and a probe that misses its window is retried while the Host keeps the last measurement, so the footer chip does not fall back to four hollow circles.
317
- - Reporting a problem: `/diag` prints a local, read-only snapshot — plugin/dsh/node
318
- versions, platform, session id, whether this process is the launcher or the detached
319
- Host, `DSH_HOME`, the display channel address and whether it answers (including the
320
- leftover-socket-file verdict), the Host pid/identity/lock state, the lock file path, link
321
- RTT and paint interval, the session log format and size, other locks on the machine, and
322
- a **verdict chain** ("attaches to the leftover Host (pid N), do not open a second
323
- window", "the pid was recycled", "a leftover socket file that does not answer — the
324
- source of the first-attach EPIPE"). Nothing leaves the machine; paste it into an issue.
325
- - When `/mode` reports a missing service or the preset tools vanish after an upgrade
326
- (the 0.6.3 class of configuration regression), run `/doctor`. It judges the
327
- **deployment composition** item by item: whether the profile patch parses, whether the
328
- agent-presets roster and code-runtime are composed (naming the missing row), whether the
329
- subagent model-selection settings row is mounted, whether any row is mounted twice (with
330
- its line), whether the profile layer and the bundle layer both mount a row, whether the
331
- host version is in the plugin's declared compatibility table, whether two
332
- `@deepseek-ai/dsh-scope` installs exist (the nested-install copy trap), and whether the
333
- default route and the subagent model are self-consistent. Every item carries its evidence
334
- and the command that acts on it. `/doctor --fix` mounts the missing rows and merges
335
- duplicates into `cordis.patch.yml`, keeping a `.bak-<timestamp>` beside it and never
336
- touching an override or disable you wrote; `/fix code-runtime` repairs one row. A restart
337
- picks it up, and like `/diag` nothing leaves the machine.
338
- - Leftover Host lifetime: the write lock a dropped-but-still-running Host holds is what makes the Web UI refuse the same session (`resume failed for session … is already owned by an active write handle`), and a drop that raced a reattach used to leave the honored-reattach flag set, so the *next* drop was ignored and the session lock kept its stale state. The flag is cleared once a turn runs again, and once the turn the Host stayed for settles it exits within `DSH_TUI_IDLE_EXIT_MS` (default 60s, `0` disables) instead of holding the session for six hours.
339
- - Subagent route: the identity row always carries `sub:<model>` — the route
340
- every child inherits — suffixed with the effort when `/subeffort` set one,
341
- and prefixed with the provider when `settings.yaml` pinned one
342
- (`ssh-tui-subagent.provider`), e.g. `sub:xai/grok-4.5(xhigh)`.
343
- - Resize: the launcher picker unregisters its own `resize` listener when it
344
- settles and refuses to paint afterwards, so resizing the window can no longer
345
- redraw the finished picker over the running TUI (the launcher process keeps
346
- owning the TTY as the display relay for the whole session).
347
- - Legacy Windows consoles without VT support: set `DSH_TUI_NO_ALT_SCREEN=1`
348
- (and `--no-color` if needed) to skip the alternate-screen escape sequences.
349
- - Keyboard input accepts both `\x7f` and `\x08` backspace, and both `\r` /
350
- `\r\n` line endings.
299
+ - **Windows**: the display channel is a named pipe
300
+ (`\\.\pipe\dsh-tui-<8-hex DSH_HOME>-<session name>-<8-hex session id>`) — the only
301
+ local socket Windows can listen on — and it is reclaimed when the Host exits. Readiness
302
+ is probed with a real connect, and a Host that exits early is reported at once with its
303
+ stderr (`%USERPROFILE%\.dsh\tui-socks\<session>.err`). Session locks check a live pid
304
+ with `Get-Process` (image name plus creation time), so a recycled pid is recognised as
305
+ stale instead of reported as a phantom zombie Host.
306
+ - **Legacy Windows consoles without VT support**: set `DSH_TUI_NO_ALT_SCREEN=1` (and
307
+ `--no-color` if needed) to skip the alternate-screen escape sequences.
308
+ - **Footer speed** (`135 tok/s`) is measured from the first token the model emits to the
309
+ settled step, and is rebuilt when a session is replayed with `--resume`. A step with no
310
+ usable timing shows `首字 1.2s` instead.
311
+ - **Emoji / CJK width**: BMP symbols carrying the Unicode `Emoji` property are budgeted two
312
+ cells, and the painter asks for the narrow text form (VS15) plus a reserving space. A
313
+ monospace font that lacks the glyph still makes the terminal fall back to a wider colour
314
+ emoji, so pick a font that covers what you use (Noto Sans Mono CJK, for instance).
315
+ - **Keyboard input** accepts both `\x7f` and `\x08` backspace, and both `\r` / `\r\n`
316
+ line endings.
317
+ - **Subagent route**: the identity row always carries `sub:<model>` the route every child
318
+ inherits with the effort in parentheses when `/subeffort` set one, e.g.
319
+ `sub:grok-4.5(xhigh)`. Only the model name is shown; the provider and the full route are
320
+ in `/status`.
351
321
 
352
322
  ## Usage
353
323
 
@@ -507,8 +477,8 @@ completion (`DSH_TUI_NO_BELL=1` disables it).
507
477
 
508
478
  Tool calls render as compact cards instead of raw argument JSON. The title
509
479
  stays the default foreground; the status dot is yellow / green / red for
510
- running / ok / error. Success no longer repeats `[ok]` next to the green
511
- dot; failures still show `[error]`, and in-flight calls still show
480
+ running / ok / error. A successful call shows the dot alone — no `[ok]`
481
+ suffix while a failure still carries `[error]` and an in-flight call
512
482
  `[running…]` (plus `[退出码 N]` / `[信号 X]` when a shell exits). Consecutive
513
483
  reads or edits of the same path fold into one card (`×N`, cumulative
514
484
  chars/lines, appended diffs, a brief flip animation).
@@ -598,8 +568,121 @@ does not write into the transcript.
598
568
  Idle hangup exits the Host. A busy turn keeps it; `--resume` attaches to that
599
569
  process. Do not start a second Host.
600
570
 
571
+ ## Troubleshooting (Q&A)
572
+
573
+ Find your symptom; each answer is what to do, not a change log.
574
+
575
+ ### Start-up and install
576
+
577
+ - **`dsh-ssh-tui: both stdin and stdout must be TTYs`** — start it from a real terminal or
578
+ SSH session; a pipe, CI, or `&` background job will not do.
579
+ - **Windows: `host display socket did not appear`** — upgrade
580
+ (`dsh plugin --profile tui add dsh-ssh-tui@latest`); older builds waited 15 seconds and
581
+ timed out on the named pipe. If it still fails, attach `/diag` to an issue.
582
+ - **Windows: the in-app update reports `spawn dsh ENOENT`** — an older updater spawned a
583
+ bare `dsh`, which on Windows is a `dsh.cmd` shim. Run the same upgrade once from the
584
+ command line (`dsh plugin --profile tui add dsh-ssh-tui@latest`); the in-app update works
585
+ from then on.
586
+ - **pnpm refuses to run the build script of a git dependency** — add the key pnpm prints to
587
+ `allowBuilds` in the profile's `pnpm-workspace.yaml`, then reinstall.
588
+ - **After an upgrade `/mode` reports a missing service, or the preset tools vanish** — run
589
+ `/doctor`: it judges the deployment composition item by item (patch parses, roster and
590
+ code-runtime composed, no row mounted twice, host version inside the compatibility table,
591
+ two `@deepseek-ai/dsh-scope` installs) and gives a verdict, its evidence and the command
592
+ that acts on it. `/doctor --fix` writes the missing rows into `cordis.patch.yml`, keeping
593
+ a `.bak-<timestamp>`; a restart picks it up.
594
+ - **"session is already running on pid N / attachable"** — that Host is alive: attach with
595
+ `dsh --profile tui --resume`. Do not open a second window; clear `$DSH_HOME/tui-locks/`
596
+ only once the pid is really gone.
597
+
598
+ ### Sessions and locks
599
+
600
+ - **The Web UI refuses a session (`already owned by an active write handle`)** — the Host
601
+ left over from an SSH drop still holds the write lock; it exits within a minute of the
602
+ turn settling (`DSH_TUI_IDLE_EXIT_MS` / `ssh-tui.idleExit`). You can also attach to it
603
+ with `--resume` and keep working.
604
+ - **The first `--resume` fails with `write EPIPE`, the second works** — the launcher waits
605
+ and retries once by itself. If it keeps failing, `/diag` prints the channel and lock
606
+ verdict chain, including the leftover-socket-file case.
607
+ - **Too many history sessions to tell apart** — filter the `--resume` picker by title,
608
+ session id or working directory (`/` or `Ctrl+F`); older history is read on demand when
609
+ you filter or page to the end, and the counter shows how many are still unloaded.
610
+
611
+ ### Display and terminal
612
+
613
+ - **Windows: no colour at all, just black and white** — 0.7.0 read the unset `TERM` of a
614
+ Windows session as "no terminal". Pin the palette to recover it:
615
+ `set DSH_TUI_COLOR_DEPTH=8` (or `256` / `truecolor`); `/diag` prints the resolved palette
616
+ and the hints behind it.
617
+ - **Colours look wrong, or a diff is one solid block you cannot read** — pin the palette
618
+ with `DSH_TUI_COLOR_DEPTH=truecolor|256|8|none`. At `256` a diff is dark grey with green
619
+ or red text; at `none` there is no colour at all, but `+`/`-`, `●`, `⚠` and `✖` remain —
620
+ status is never carried by colour alone.
621
+ - **CJK or emoji crowd the characters next to them** — use a monospace font that covers
622
+ them (Noto Sans Mono CJK, for instance). Those symbols are budgeted two cells and the
623
+ painter asks for the narrow text form; a font without the glyph still makes the terminal
624
+ fall back to a wider colour emoji.
625
+ - **The screen cannot keep up on a slow link** — `DSH_TUI_PAINT_MS` sets the paint interval
626
+ (40–1000 ms: smaller is snappier and sends more); unset, it follows the round-trip
627
+ measured at start-up (80 / 160 / 250 / 400 ms).
628
+ - **Screen reader, or you want a log** — start with `DSH_TUI_LINE_MODE=1`: plain appended
629
+ lines, no cursor control, safe to `tee`.
630
+ - **Title bar or bell does nothing** — the terminal needs OSC 0 and BEL; `DSH_TUI_NO_BELL=1`
631
+ turns the bell off.
632
+ - **Whole-row backgrounds are too loud on a dark terminal** — `DSH_TUI_COLOR_DEPTH=none`
633
+ drops them; diffs still read through `+`/`-`.
634
+
635
+ ### Status line and quota
636
+
637
+ - **The quota widget shows `░░░░░░░░ ?%`** — no reading has arrived yet (the API is slow or
638
+ unreachable). It is not `0%`. The TUI asks again every 15 seconds and replaces it with the
639
+ real number and window; if it never does, `/quota` reports the error.
640
+ - **There is no quota widget** — only SuperGrok, OpenCode Go and Command Code report quota;
641
+ DeepSeek shows a balance line and a metered Zen route shows none.
642
+ - **What do `5Hr` / `1Wk` / `1Mo` mean?** — the window the number belongs to. The smallest
643
+ window is shown by default (5-hour → weekly → monthly); `/quota` lists every window with
644
+ its remaining share and reset time. Threshold alerts still fire on the tightest window.
645
+ - **The model name has no provider prefix** — the status line shows the model alone
646
+ (`provider/model` is truncated to the model); the full route is in the header and
647
+ `/status`, and a `sub:` chip shows the child's model the same way.
648
+ - **The subagent model is not what you want** — `/submodel` picks the model, `/subeffort`
649
+ the reasoning effort, `/status` shows the current pair.
650
+ - **No `tok/s`** — that turn had no measurable model tokens; a step with only a first-token
651
+ time shows `首字 1.2s`.
652
+ - **The plan strip asked for leftover todos only once** — that is deliberate: one reminder
653
+ per open list, so a turn end never spawns another turn forever. To see it again, complete
654
+ the list and start a new one.
655
+
656
+ ### Drops and proxies
657
+
658
+ - **What happens when SSH drops** — idle: flush and exit. Busy (thinking, replying, a tool,
659
+ a subagent): the turn is cancelled by default and the Host stays, so
660
+ `dsh --profile tui --resume` attaches to it; `/disconnect continue` lets it run to
661
+ completion instead. Do not start a second Host.
662
+ - **After reconnecting there is an extra notice line, `^[[17;1R` flashes, and the link chip
663
+ goes hollow** — upgrade; the automatic retry stays in raw mode and drops queued bytes, so
664
+ those replies are no longer echoed.
665
+ - **Model requests must go through a proxy** — start dsh with `--use-env-proxy` (not via
666
+ `NODE_OPTIONS`) and split by domain with `NO_PROXY`, keeping domestic hosts that are faster
667
+ direct and every local/intranet address in the list. The recipe and its revert are in
668
+ [docs/remote-ops.md §4.7](docs/remote-ops.md).
669
+
670
+ ### Asking for help
671
+
672
+ - **You need a readable report for a supporter** — type **`/diag`** in the session (local and
673
+ read-only): versions, platform, session id, `DSH_HOME`, the display channel and whether it
674
+ answers, the Host pid and lock state, link RTT, log format and size, and a verdict chain
675
+ ("attaches to the leftover Host (pid N), do not open a second window"). Deployment
676
+ questions go to **`/doctor`**. Paste both into an issue.
677
+
601
678
  ## Development
602
679
 
680
+ Platform-sensitive changes (environment variables, child processes, paths, terminal
681
+ capability) have their own note: [docs/platform.md](docs/platform.md). The rule is to put the
682
+ platform decision in an injectable pure function and assert the Windows branch in a test, so
683
+ it reddens on Linux too; `tests/platform-guards.test.mjs` statically rejects a new bare
684
+ `spawn('name')`, and CI's `test-windows` leg runs the same suite on a real Windows runner.
685
+
603
686
  ```text
604
687
  src/picker.ts launch history picker (9-row page, uncapped list, filter)
605
688
  src/tui.ts SshTui (re-exports leaf helpers)
package/README.md CHANGED
@@ -67,8 +67,8 @@ dsh --profile tui
67
67
  - 转录区滚动回看(`PgUp`/`PgDn`、鼠标滚轮),点击思考/工具标题行直接展开收起;
68
68
  - 输入框下方两行底栏:第一行链路芯片 + 按宽度丢组的会话数字(轮次、入/出 token、速度);
69
69
  第二行只留一个活动词(运行中 / 工具 N / 子代理 N / 压缩中…),身份收到右侧(含 `目录:srv`;点击打印完整工作目录);
70
- 身份里始终带 `sub:<子代理模型>`:`/submodel` 选模型、`/subeffort` 选档位(带括号后缀);提供商前缀只在
71
- 设置里固定过子代理提供商时出现(如 `sub:xai/grok-4.5(xhigh)`,`settings.yaml` 的 `ssh-tui-subagent.provider`);
70
+ 身份里始终带 `sub:<子代理模型>`(如 `sub:grok-4.5(xhigh)`):`/submodel` 选模型、`/subeffort` 选档位(带括号后缀);
71
+ 只显示模型名——提供商与完整路由在顶栏与 `/status`;
72
72
  - 恢复旧会话会切到该会话记录的工作目录;新建会话用启动时的当前目录;
73
73
  - 历史会话启动选择器:`dsh --profile tui --resume`(或 `resume`)先选会话再进入;
74
74
  - 终端窗口标题栏:运行中旋转图标 + `运行中 · 工具 N`,完成后 `✓ 已完成`,并响
@@ -87,6 +87,13 @@ dsh --profile tui
87
87
  标题(还没出现就保持「处理中」),运行中的工具摘要在 `└` 下自动折行(最多 3 行,末行
88
88
  加省略号),带计时和 Esc 中断;回复开始流式输出时自动让位。
89
89
 
90
+ - 0.7 起:模型回复可**拖选自由复制**(按住拖过一段,走 OSC 52 写回本机剪贴板;工具卡仍是点击展开);
91
+ 底栏收敛成一条带优先级的芯片带(先丢文字后丢组,`⚠` 可点击打开 `/doctor`);**额度条常驻**并标注窗口
92
+ (`5Hr`/`1Wk`/`1Mo`,默认显示最小窗口,未取到时显示 `?%` 并每 15 秒重试);`/mode` 分组显示并可用 `/` 过滤;
93
+ 极简视图逐文件列 `+/-`;工具 diff 为**行级**、只高亮变化字符、≥100 列时并排显示;
94
+ `DSH_TUI_LINE_MODE=1` 纯行模式(屏幕阅读器 / `tee`);`ssh-tui.keys` 可改键位(冲突会明确拒绝);
95
+ `DSH_TUI_COLOR_DEPTH` 指定色深(truecolor / 256 / 8 / none)。
96
+
90
97
  ## 环境要求
91
98
 
92
99
  - Node.js ≥ 22.19
@@ -506,79 +513,80 @@ npm run typecheck
506
513
  npm run build
507
514
  ```
508
515
 
509
- ## 常见问题
510
-
511
- - **`dsh-ssh-tui: both stdin and stdout must be TTYs`**:必须从真实终端/SSH 会话启动。
512
- - **Windows 报 `dsh-ssh-tui: host display socket did not appear`**:0.5.7 及更早版本把显示通道
513
- 当成 Unix socket(`$DSH_HOME/tui-socks/*.sock`),而 Windows 只能监听 `\\.\pipe\` 命名管道,
514
- Host 进程绑定失败;旧版本还用 `fs.access()` 判断通道是否就绪,而 Windows 的文件 API 看不到
515
- 命名管道,所以即使 Host 已经起来也只会等到 15 秒超时。0.5.8 起 Windows 自动改用命名管道
516
- (按 `DSH_HOME` + 会话 id 生成唯一管道名),就绪判断改为真实连接探测,并在 Host 提前退出时
517
- 立即报错并附带其 stderr。升级到 0.5.8 即可:`dsh plugin --profile tui add dsh-ssh-tui@latest`。
518
- - **pnpm 拒绝 git 依赖的构建脚本**:git 安装的插件需要把 pnpm 打印的 key 加入
519
- profile 的 `pnpm-workspace.yaml` `allowBuilds`。
520
- - **标题栏或铃声不生效**:确认终端支持 OSC 0 BEL;铃声可用
521
- `DSH_TUI_NO_BELL=1` 关闭。
522
- - **滚轮误触取消**:已加入转义序列缓冲,网络拆包也不会把 `ESC` 当取消。
523
- - **emoji 宽度**:带 Unicode `Emoji` 属性的 BMP 符号按 **2 格**预算。等宽字体缺字形时终端会回退到彩色 emoji 字形——它比所在单元格宽(实测约 1.6 格)却只前进 1 格,于是压住相邻字符;而预算的第二格没人用,整行又比终端宽度少算格子。绘制时 `pinEmojiCells()` 两件事一起做:补 **VS15** 请终端改用窄的文本字形;再补一个**占位空格**把第二格真正用掉(**无条件补**,即使后面本来就有空格——这样"预算 = 符号 2 格 + 文本里每个空格"与"终端实际 = 字形 1 格 + 占位 1 格 + 每个空格"在每种情况下都相等)。字形 1 格 + 占位 1 格正好等于预算的 2 格,所以既不压字也不会短算;已带 VS15/VS16 的会归一成一个 VS15,本就默认 emoji 呈现的符号(`✅` `⚡` 等)和星号区 emoji(`😀` 等)本来就走 2 格,不动。
524
- - **跳板机 / 多层代理 SSH 发画**:每一帧只发脏行,并且拼成一次 `stdout.write`。本机 80 ms;SSH 启动时用 CSI 6n 测往返,按 RTT 选 80/160/250/400 ms。`DSH_TUI_PAINT_MS` 始终优先(40–1000)。统计行最左是 `SSH ●●●○ 90ms`(一格红、两格黄、三格及以上绿)。探测不写进转录。
525
- - **SSH 断了**:空闲则 flush 后退出(不保活)。忙碌(思考/回复/工具/子代理)则默认取消当前轮次、flush 日志,Host 留下。`/disconnect continue` 则不取消,后台跑完。回来 `--resume` 会接入那个进程(见上文)。不要再开第二份 Host。
526
- - **提示会话已在 pid 运行 / 可接入**:那份 Host 还活着。用 `--resume` 接入;只有 pid 已死、显示通道也连不上时才删 `$DSH_HOME/tui-locks/` 再从日志恢复。
527
- Windows 没有 `/proc`,0.5.8 起会用 `Get-Process` 核对 pid 的镜像名与创建时间:pid 被系统回收给
528
- 别的进程时会被判定为陈旧并自动接管,不再出现「明明没有 Host 却报 zombie」。
529
- - **状态栏没有速度指标(`tok/s`)**:第一行统计里的速度只在该轮有模型 token 时出现;只有首字耗时可算
530
- 时显示 `首字 1.2s`。0.5.8 修复了两处:实时流的 chunk 帧不带 turn/step,旧版会把它们归到第 0 步
531
- 导致速度永远是 0(顺带把 token 数重复计了一次);`--resume` 重放日志时也不再用实时增量,而是从
532
- 日志里的 `assistant/chunk`(0.1.2)或消息内嵌的打包流(0.1.5)重建首字时间,恢复会话同样显示速度。
533
- - **断线后第一次 `--resume` `write EPIPE`、第二次才接上**:三处互相叠加。其一,Host 掉线时按"掉线那一刻"的状态
534
- 决定去留,若它正在取消/落盘收尾,这时重连进来的显示端会被连同进程一起 dispose(表现就是第一次接入 EPIPE);
535
- 现在收尾期间若有新 relay 完成 HELLO,就保留 Host 不退出。其二,就绪判断过去用 `fs.access` `.sock` 文件在不在——
536
- 被杀的 Host 留下的空文件也算"就绪",relay 往死 socket 写 HELLO 就 EPIPE,而且这种条目会被选择器当成
537
- 「可接入」优先排在最前面;现在就绪一律以真实连接探测为准,死会话判陈旧并连残留文件一起清掉。
538
- 其三,launcher 首次接入若立刻 EPIPE/ECONNRESET,会自动等待并重试一次,不必手动再跑一遍。
539
- - **断线重连会多出一行提示、还会闪出 `^[[17;1R` 之类的字符、延迟芯片变四个空心圆**:0.5.9 的自动重试会把
540
- "正在收尾,稍候重试"打到屏幕上,而两次尝试之间终端回到 cooked 模式,上一次探测的 DSR 回复正好被回显;
541
- 同时重连时的整屏重绘会让终端的回复错过探测窗口,Host 收到"未知"就把已有测量擦成 `SSH ○○○○`。
542
- 现在:自动重试默认**静默**(`DSH_TUI_DEBUG=1` 才打印);重试/等 Host 启动期间保持 raw 模式并丢弃排队字节,
543
- 不再回显;探测失败会自动补测一次,Host 侧也不会用"未知"覆盖已知测量。
544
- - **resume 选择器第一批列表出现不认识的会话 / 会话一多就要等很久**:早期版本第一轮画的是"骨架"
545
- (活着的 Host 只拿会话 id 当标题),而为了不闪出裸 id 又得等标题;等于把一次全量扫描的时间摆在用户面前。
546
- 现在首批固定 9 条、**全部读到标题后才上屏**(期间显示「正在读取历史会话…」,屏幕上不会出现先裸 id、
547
- 一秒后变标题的行),更早的会话按需读取:在最后一条继续按 `↓`/`PgDn`、按 `End`,或直接输入筛选
548
- (筛选会自己往更早历史里找,凑够一页就停)。计数行会显示还有多少条未加载。
549
- - **要给支持者一份可读的排障信息**:在会话里敲 `/diag`。它只读本地信息、不外传,输出
550
- 插件/dsh/node 版本、平台、会话 id、当前进程是启动器还是后台 Host、`DSH_HOME`、显示通道地址与
551
- 可连接性(含"残留 socket 文件"判定)、Host pid/身份核对/锁状态/agent 状态、锁文件路径、
552
- 链路 RTT 与绘制间隔、会话日志格式与大小、本机其它会话的锁,最后是**判定链**——例如
553
- "会接入后台 Host(pid N),不要另起第二个窗口"、"pid 被回收成别的程序"、
554
- "通道上留着不响应的 socket 文件,这正是第一次接 EPIPE 的来源"。报 issue 时贴这段即可。
555
- - **升级后 `/mode` 报「服务不可用」、preset 工具消失**:敲 `/doctor`。它在 `/diag` 的会话事实之外
556
- 把**部署组合**逐项判定:profile 补丁能否解析、agent-presets 名单与 code-runtime 是否组合
557
- (缺哪一行直接点名)、子代理模型选择设置行在不在、有没有行被挂载两次(带行号)、profile 层与
558
- bundle 层是否重复挂载、dsh 版本是否在插件声明的兼容表内、是否装着两份 `@deepseek-ai/dsh-scope`
559
- (npm 嵌套安装的副本陷阱),以及默认路由与子代理模型是否自洽。每项给「结论 + 证据 + 修复命令」。
560
- `/doctor --fix` 会把缺的行补进 `cordis.patch.yml`、把重复的挂载合并掉,写前留
561
- `.bak-<时间戳>` 备份,**不动你自己写的 override/disable**,重启 TUI 后生效;只想修一行时用
562
- `/fix code-runtime`。与 `/diag` 一样只读本地信息、不外传。
563
- - **TUI 里进得去、Web 里打不开同一个会话**:会话的写锁(`session.lock`)是内核锁,同时只允许一个写者。
564
- SSH 断开时那个还在跑轮的 Host 会留着锁,于是 Web 端打开时报
565
- `resume failed for session "" is already owned by an active write handle`——从 0.5.10 起
566
- 该 Host 在轮次结束后最多再等 1 分钟就退出并放锁(`DSH_TUI_IDLE_EXIT_MS`/`ssh-tui.idleExit`)。
567
- 若锁仍被某个 Host 占着,`--resume` 接入它即可正常继续(选择器里那条会话会标「可接入」)。
568
- - **断线重连后锁被标成「已暂停」/「接入中」,但窗口其实已经关了**:0.5.10 修掉了一个状态机 bug。
569
- 重连接的 relay 在 hangup 收尾期间 HELLO 后,Host 会记下"这次 hangup 要采纳它"的标记;但 hangup
570
- 走保留 Host 分支时没有清掉这个标记,于是**下一次真实掉线整个被忽略**:锁仍写着上一个状态
571
- (例如「已暂停」),空闲退出计时器也不会武装。现在只要轮次重新开始(说明那场竞争早已结束),
572
- 标记就会归零,掉线、锁状态与空闲退出都以真实事件为准。
573
- - **状态栏看不到子代理模型**:0.3.6 起 `sub:<模型>` 只在子代理模型与父模型不同时才拼进身份行,
574
- 而默认子代理模型就是 `deepseek-v4-flash`,父模型也是它时整段消失;0.5.8 起恢复为始终显示,
575
- 并找回提供商前缀与 `/subeffort` 的括号后缀(提供商要先在 `settings.yaml` 的 `ssh-tui-subagent.provider`
576
- 里固定过)。查看或修改:`/status`、`/submodel`、`/subeffort`。
577
- - **缩放终端窗口时整屏闪烁、还闪出历史会话选择器**:启动选择器注册 `resize` 监听时用的是匿名函数,
578
- 退出时却按 `render` 这个引用去注销,于是监听器一直留在中继进程里(中继要活整个会话)。之后每次
579
- 缩放终端,那张已经结束的选择器都会被整屏重画一遍(`\x1b[H\x1b[J` + 整屏内容),紧接着再被 TUI
580
- 的整屏重画覆盖——看起来就是闪两下并闪出选择器内容。0.5.8 起改用命名监听器注销,并给已结束的
581
- 选择器加 `done` 守卫:结算后再触发 `resize` 一个字节都不会写(有回归测试)。
516
+ 改到环境变量、子进程、路径或终端能力时,先读 [docs/platform.md](docs/platform.md):平台判断要写成可注入的纯函数并在用例里
517
+ 显式跑 Windows 分支(`tests/platform-guards.test.mjs` 会静态拦住新的裸名 `spawn`),真实 Windows 由 CI 的
518
+ `test-windows` 腿覆盖。
519
+
520
+ ## 常见问题(QA)
521
+
522
+ 按现象查;每条只讲怎么办,不讲版本历史。
523
+
524
+ ### 启动与安装
525
+
526
+ - **`dsh-ssh-tui: both stdin and stdout must be TTYs`**:必须在真实终端 / SSH 会话里启动;管道、CI、`&` 后台都不行。
527
+ - **Windows `host display socket did not appear`**:升级到最新版:
528
+ `dsh plugin --profile tui add dsh-ssh-tui@latest`。仍失败请附 `/diag` 输出提 issue。
529
+ - **Windows 上应用内更新报 `spawn dsh ENOENT`**:旧的更新器直接 `spawn dsh`,而 Windows 上装的是 `dsh.cmd` 垫片;
530
+ 在命令行跑一次同样的升级即可(`dsh plugin --profile tui add dsh-ssh-tui@latest`),之后应用内更新正常。
531
+ - **pnpm 拒绝 git 依赖的构建脚本**:把 pnpm 打印的 key 加进 profile `pnpm-workspace.yaml` `allowBuilds`,再重装。
532
+ - **升级后 `/mode` 报「服务不可用」、preset 工具消失**:敲 `/doctor`。它逐项判定部署组合(补丁能否解析、
533
+ 名单与 code-runtime 是否组合、有没有行被挂载两次、dsh 版本是否在兼容表内、是否装着两份 `@deepseek-ai/dsh-scope`),
534
+ 每项给「结论 + 证据 + 修复命令」;`/doctor --fix` 会补齐 patch、写前留 `.bak-<时间戳>` 备份,重启 TUI 生效。
535
+ - **提示「会话已在 pid 运行 / 可接入」**:那个 Host 还活着,用 `dsh --profile tui --resume` 接入。
536
+ **不要**再开第二个窗口;只有 pid 确实已死时才清 `$DSH_HOME/tui-locks/` 再从日志恢复。
537
+
538
+ ### 会话与锁
539
+
540
+ - **Web 端打不开同一会话(`already owned by an active write handle`)**:SSH 断开时仍在跑轮的 Host 会持有写锁,
541
+ 轮次结束后最多 1 分钟自动退出并放锁(`DSH_TUI_IDLE_EXIT_MS` / `ssh-tui.idleExit` 可调);也可以直接 `--resume` 接入它继续。
542
+ - **`--resume` 第一次报 `write EPIPE`、第二次才接上**:launcher 会自动等待并重试一次。若持续失败,
543
+ `/diag` 看显示通道与锁的判定链(含"残留 socket 文件"这一常见来源)。
544
+ - **历史会话太多、认不出哪条是哪个**:在 `--resume` 选择器里按标题 / session id / 工作目录筛选(`/` 或 `Ctrl+F`),
545
+ 更早的历史会在筛选或翻到末尾时按需读取;计数行会显示还有多少条未加载。
546
+
547
+ ### 显示与终端
548
+
549
+ - **Windows 下完全没有颜色(只有黑白)**:0.7.0 Windows 上把"未设置 `TERM`"误判为无终端。指定色深即可恢复:
550
+ `set DSH_TUI_COLOR_DEPTH=8`(或 `256` / `truecolor`),也可以先看 `/diag` 的**配色**一行确认判定结果。
551
+ - **颜色不对,或 diff 整块一个颜色、看不清字**:显式指定色深 `DSH_TUI_COLOR_DEPTH=truecolor|256|8|none`。
552
+ `256` diff 是深灰底 + 绿/红字;`none` 完全没有颜色,但 `+`/`-`、`●`、`⚠`、`✖` 仍在,状态不只靠颜色表达。
553
+ - **中文 / emoji 挤压相邻字符**:换一款覆盖这些字形的等宽字体(如 Noto Sans Mono CJK)。程序按 2 格预算这些符号
554
+ 并请求文本字形;字体缺字时终端会回退到彩色 emoji 字形,视觉上仍可能偏宽。
555
+ - **弱网下画面跟不上**:`DSH_TUI_PAINT_MS` 控制发画间隔(40–1000 ms,越小越快也越费流量);
556
+ 不设时按启动测得的 RTT 自动取 80 / 160 / 250 / 400 ms。
557
+ - **要给屏幕阅读器或日志用**:`DSH_TUI_LINE_MODE=1` 启动纯行模式——只追加纯文本行、不发光标控制,可直接 `tee` 存档。
558
+ - **标题栏 / 铃声不生效**:终端需支持 OSC 0 与 BEL;`DSH_TUI_NO_BELL=1` 可关闭铃声。
559
+ - **深色终端下整行底色太抢眼**:`DSH_TUI_COLOR_DEPTH=none` 去掉底色,diff 仍用 `+`/`-` 区分。
560
+
561
+ ### 状态栏与额度
562
+
563
+ - **额度条显示 `░░░░░░░░ ?%`**:**还没拿到读数**(接口慢或不通),不是 0%。TUI 每 15 秒重试一次,拿到后自动替换成
564
+ 真实数值与窗口;一直不变成数值时用 `/quota` 看具体报错。
565
+ - **没有额度条**:只有 SuperGrok / OpenCode Go / Command Code 有额度;DeepSeek 显示的是余额行,Zen 是计量制。
566
+ - **`5Hr` / `1Wk` / `1Mo` 是什么**:该数值所属的额度窗口。默认显示**最小窗口**(5 小时 → 周 → 月),
567
+ `/quota` 列出全部窗口、剩余比例与重置时间。告警仍按"最紧的那个窗口"触发。
568
+ - **状态栏模型名没有提供商前缀**:状态行只显示模型名(`provider/model` 会截断成模型名),完整路由在顶栏与 `/status`;
569
+ `sub:` 子代理同理,只显示模型名。
570
+ - **看不到子代理模型 / 想换子代理**:`/submodel` 选模型、`/subeffort` 选思考档位,`/status` 查看当前值。
571
+ - **没有 `tok/s`**:该轮没有可统计的模型 token;只有首字耗时时显示 `首字 1.2s`。
572
+ - **计划条只提醒一次"补待办"**:有意如此——一条待办列表只问一次,避免每轮结束都开一个新回合。
573
+ 想再次触发,先把列表全部标成完成,再新开一列待办。
574
+
575
+ ### 断线与代理
576
+
577
+ - **SSH 断了会怎样**:空闲则落盘后退出;忙碌(思考 / 回复 / 工具 / 子代理)默认取消当轮、保留 Host
578
+ 回来 `dsh --profile tui --resume` 接入;`/disconnect continue` 则让它在后台跑完当前轮。**不要**再开第二个 Host。
579
+ - **重连后多出一行提示、闪出 `^[[17;1R` 之类的字符、链路芯片变空心**:升级到最新版;自动重试期间保持 raw 模式
580
+ 并丢弃排队字节,这些字符不会再被回显。
581
+ - **模型请求要走公司 / 本机代理**:给 dsh 进程加 `--use-env-proxy`(不要用 `NODE_OPTIONS`),并用 `NO_PROXY`
582
+ 按域名分流——国内直连更快的域名放进去,本地 / 内网地址务必保留在列表里。做法与回退见
583
+ [docs/remote-ops.md §4.7](docs/remote-ops.md)。
584
+
585
+ ### 排障入口
586
+
587
+ - **要给支持者一份可读的排障信息**:在会话里敲 **`/diag`**(只读本地信息、不外传):版本、平台、会话 id、
588
+ `DSH_HOME`、显示通道与可连接性、Host pid / 锁状态、链路 RTT、日志格式与大小,最后是**判定链**
589
+ (例如"会接入后台 Host(pid N),不要另起第二个窗口")。部署组合问题用 **`/doctor`**。报 issue 时贴这两段即可。
582
590
 
583
591
  ## License
584
592
 
@@ -116,6 +116,27 @@ DSH_TUI_LINE_MODE=1 ssh host 'dsh --profile tui --resume' | tee session.log
116
116
  状态符号(● ⚠ ✖、diff 的 `+`/`-`)仍然保留,语义不依赖颜色。全屏交互(鼠标拖选、卡片展开、
117
117
  `/find` 高亮)在行模式下不可用——那是画帧的代价,需要时用普通模式。
118
118
 
119
+ ## 4.7 让 dsh 自己走网络代理
120
+
121
+ 插件跑在 dsh 进程里,所以"TUI 的网络"就是"dsh 的网络"。Node **不会**自动读 `HTTP_PROXY` /
122
+ `HTTPS_PROXY`:`NODE_USE_ENV_PROXY=1` 单独在 v24.19 上不生效,必须给 Node 传
123
+ **`--use-env-proxy`**(启动包装脚本里加,别用 `NODE_OPTIONS`——那会把模型跑测试、跑工具的
124
+ 每个 Node 子进程也一起塞进代理)。
125
+
126
+ 按域名分流用 `NO_PROXY`(后缀匹配,`deepseek.com` 覆盖整域)。国内直连更快、或直连比代理更稳的域名放这里,
127
+ 例如:
128
+
129
+ ```bash
130
+ export NO_PROXY="${NO_PROXY:+$NO_PROXY,}deepseek.com,api.deepseek.com,commandcode.ai,api.commandcode.ai"
131
+ exec /path/to/node --use-env-proxy /path/to/@deepseek-ai/dsh/lib/bin.js "$@"
132
+ ```
133
+
134
+ `cli-chat-proxy.grok.com` / `api.x.ai` / `auth.x.ai` **不要**放进 `NO_PROXY`:这台机器上 Grok 直连会被 RST,必须走代理。
135
+
136
+ 容器/沙箱里如果只有代理出口,直连会成片超时——那种"直连失败"是出口的噪音,不能当成
137
+ "某家必须走代理"的证据;判断标准应该是**该域名直连是否稳定**,而不是一次超时。
138
+ `127.0.0.1` / 本机网段务必留在 `NO_PROXY` 里:显示通道虽然走 AF_UNIX,但别把本地流量也绕出去。
139
+
119
140
  ## 5. 明确不做(以及为什么)
120
141
 
121
142
  - **内置 `--daemon` 常驻模式**:Host 不是服务。它是"某个会话的写者",靠 idle-exit 把写锁交还;把它变成常驻服务会让 Web UI 与其它窗口长期打不开同一会话。
@@ -23,7 +23,7 @@
23
23
  * @param env - the environment to read (tests pass their own).
24
24
  * @returns the palette to paint with.
25
25
  */
26
- export function colorDepth(env = process.env) {
26
+ export function colorDepth(env = process.env, platform = process.platform) {
27
27
  const forced = (env.DSH_TUI_COLOR_DEPTH ?? '').trim().toLowerCase();
28
28
  if (forced === 'truecolor' || forced === '24bit' || forced === '16m')
29
29
  return 'truecolor';
@@ -37,8 +37,18 @@ export function colorDepth(env = process.env) {
37
37
  if (noColor !== '')
38
38
  return 'none';
39
39
  const term = (env.TERM ?? '').trim().toLowerCase();
40
- if (term === '' || term === 'dumb' || term === 'linux' || term === 'vt100' || term === 'vt220')
40
+ // What an empty TERM means depends on the platform. On POSIX it is the pipe /
41
+ // CI case and there is nothing to paint with. On Windows it is simply the
42
+ // normal state — PowerShell, ConHost and Windows Terminal all leave TERM unset
43
+ // — and reading it as "no colour" is what turned a Windows session black and
44
+ // white. The explicit markers below still decide the palette there.
45
+ if (term === '') {
46
+ if (platform !== 'win32')
47
+ return 'none';
48
+ }
49
+ else if (term === 'dumb' || term === 'linux' || term === 'vt100' || term === 'vt220') {
41
50
  return 'none';
51
+ }
42
52
  const colorTerm = (env.COLORTERM ?? '').trim().toLowerCase();
43
53
  if (colorTerm === 'truecolor' || colorTerm === '24bit')
44
54
  return 'truecolor';
@@ -46,6 +56,11 @@ export function colorDepth(env = process.env) {
46
56
  return '256';
47
57
  if (term.startsWith('screen') || term.startsWith('tmux'))
48
58
  return '256';
59
+ // Windows Terminal sets WT_SESSION and paints 24-bit colour; a plain Windows
60
+ // console falls through to the 16-colour palette, which still carries the
61
+ // diff colours (and `DSH_TUI_COLOR_DEPTH` overrides either way).
62
+ if (platform === 'win32' && (env.WT_SESSION ?? '').trim() !== '')
63
+ return 'truecolor';
49
64
  return '8';
50
65
  }
51
66
  /** The 16 standard colours, as the RGB a terminal roughly paints them with. */
@@ -102,6 +117,34 @@ export function basicSgrFor(r, g, b) {
102
117
  return bright ? 94 : 34;
103
118
  return bright ? 97 : 90;
104
119
  }
120
+ /** Cube axis step nearest to one channel value (the cube's 0/95/135/175/215/255). */
121
+ function cubeAxis(value) {
122
+ const steps = [0, 95, 135, 175, 215, 255];
123
+ let best = 0;
124
+ for (let at = 1; at < steps.length; at += 1) {
125
+ if (Math.abs((steps[at] ?? 0) - value) < Math.abs((steps[best] ?? 0) - value))
126
+ best = at;
127
+ }
128
+ return best;
129
+ }
130
+ /**
131
+ * The nearest 256-cube colour. Unlike the 16-colour mapping this keeps
132
+ * brightness, which is what the text of a diff row needs to stay readable.
133
+ */
134
+ function nearestCubeIndex(r, g, b) {
135
+ return 16 + cubeAxis(r) * 36 + cubeAxis(g) * 6 + cubeAxis(b);
136
+ }
137
+ /**
138
+ * The row background at 256 colours: the ramp's dark grey (`#1c1c1c`).
139
+ *
140
+ * The cube's darkest step is `#005f00` / `#5f0000`, and the muted diff text on
141
+ * that measures 3.2:1 — below the 4.5:1 a row of code needs. A tinted row is not
142
+ * worth unreadable text, so the row goes neutral and the *hue* stays in the
143
+ * foreground, which is also what the 8-colour path does (black background, green
144
+ * or red text). Two consequences worth stating: a background can never equal its
145
+ * own foreground, and the tint is the one thing a 256-colour terminal loses.
146
+ */
147
+ const DIFF_BACKGROUND_INDEX = 234;
105
148
  /**
106
149
  * Rewrite one SGR parameter list for the palette in use.
107
150
  *
@@ -130,6 +173,12 @@ export function downgradeSgr(code, depth) {
130
173
  index += 4;
131
174
  if (depth === 'none' || rgb.some(channel => !Number.isFinite(channel)))
132
175
  continue;
176
+ if (depth === '256') {
177
+ // Truecolor keeps its brightness here, and a background is never the
178
+ // colour of its own foreground (green on green hid a `write` preview).
179
+ out.push(String(background ? 48 : 38), '5', String(background ? DIFF_BACKGROUND_INDEX : nearestCubeIndex(rgb[0], rgb[1], rgb[2])));
180
+ continue;
181
+ }
133
182
  out.push(...paintColour(basicSgrFor(rgb[0], rgb[1], rgb[2]), background, depth));
134
183
  continue;
135
184
  }
@@ -1 +1 @@
1
- {"version":3,"file":"color-depth.js","sourceRoot":"","sources":["../src/color-depth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CAAC,MAAyB,OAAO,CAAC,GAAG;IAC7D,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IACnE,IAAI,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,OAAO,IAAI,MAAM,KAAK,KAAK;QAAE,OAAO,WAAW,CAAA;IACxF,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,UAAU;QAAE,OAAO,KAAK,CAAA;IAC3D,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,OAAO;QAAE,OAAO,GAAG,CAAA;IAC3E,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,MAAM,CAAA;IAE7F,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC3C,IAAI,OAAO,KAAK,EAAE;QAAE,OAAO,MAAM,CAAA;IACjC,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,E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