@aiwayds/dsh-opentui 0.27.1 → 0.28.0
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/CHANGELOG.md +38 -15
- package/README.md +38 -182
- package/bin/dsh-opentui.mjs +54 -258
- package/bin/lib/launcher.mjs +29 -187
- package/dist/client/index.js +7585 -16584
- package/dist/client/index.js.map +26 -51
- package/dist/locales/en.json +21 -8
- package/dist/locales/zh-CN.json +21 -8
- package/package.json +7 -11
- package/scripts/lib/companion-policy.mjs +16 -0
- package/scripts/lib/inproc-companions.mjs +128 -38
- package/scripts/lib/migration-io.mjs +231 -0
- package/scripts/lib/migration.mjs +724 -0
- package/scripts/lib/patch-ownership-state.mjs +42 -0
- package/scripts/lib/patch-ownership.mjs +1428 -0
- package/scripts/lib/profile-lock.mjs +185 -0
- package/scripts/lib/profile-name.d.mts +1 -0
- package/scripts/lib/profile-name.mjs +2 -0
- package/scripts/lib/provision-run-lock.mjs +223 -0
- package/scripts/provision-inproc-profile.mjs +601 -286
- package/dist/host-launch.mjs +0 -1293
- package/dist/host-launch.mjs.map +0 -19
- package/dist/scripts/idle-reaper.mjs +0 -173
- package/dist/watchdog.mjs +0 -476
- package/dist/watchdog.mjs.map +0 -16
- package/scripts/e2e-client.mjs +0 -1122
- package/scripts/e2e-sweep.mjs +0 -932
- package/scripts/idle-reaper.mjs +0 -173
- package/scripts/lib/provision-plan.mjs +0 -899
- package/scripts/lib/provision-state.mjs +0 -294
- package/scripts/lib/upgrade-plan.mjs +0 -489
- package/scripts/provision-opentui-profile.mjs +0 -806
- package/scripts/upgrade.mjs +0 -1149
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.28.0] - 2026-11-25
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **`--force` and `--yes` are deprecated no-ops.** The in-process-only launcher
|
|
13
|
+
does not kill processes or clear markers with these legacy flags; use
|
|
14
|
+
`--repair-bridge` to clear stale instances and repair the bridge. Both flags
|
|
15
|
+
will be removed in the next minor release.
|
|
16
|
+
|
|
17
|
+
## [0.27.2] - 2026-11-24
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- **All three confirmation dialogs now answer Yes / No (是 / 否).** The quit,
|
|
22
|
+
stop-turn and settings-exit confirmations use the same question-and-answer
|
|
23
|
+
buttons instead of Quit/Cancel, Stop/keep running and Exit/Back, so the
|
|
24
|
+
button text always answers the question in the title. Escape always cancels.
|
|
25
|
+
In the quit and stop-turn dialogs Enter confirms; the settings-exit dialog is
|
|
26
|
+
destructive, so focus starts on No and Enter cancels — move to Yes with Tab
|
|
27
|
+
(or ←/→) first, then press Enter to exit. Trade-off: the initially focused
|
|
28
|
+
button now carries an answer word instead of an action name, so the
|
|
29
|
+
consequence of Enter / the highlighted button has to be read from the title.
|
|
30
|
+
|
|
8
31
|
## [0.27.0] - 2026-11-23
|
|
9
32
|
|
|
10
33
|
### Added
|
|
@@ -481,7 +504,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
481
504
|
config plane (`configSave`, theme/skin persistence, profile/workspace overlay
|
|
482
505
|
reads) because `BridgeSessionSeam` has no config frame, while the bridge host
|
|
483
506
|
owns the session plane. 0.23.0 folds config into the bridge (or local files)
|
|
484
|
-
and removes the `
|
|
507
|
+
and removes the `legacy host bootstrap`/`HTTP session facade` path.
|
|
485
508
|
- The old automatic reconnect (backoff retry) is not implemented; recovery in
|
|
486
509
|
0.22.0 is manual (`R`, with a 5s cooldown) only.
|
|
487
510
|
- The inproc bridge's `subagentViews` field set matches the remote seam's, but
|
|
@@ -1158,21 +1181,21 @@ it is deprecated in favour of 0.19.0.
|
|
|
1158
1181
|
|
|
1159
1182
|
- **Turn-end paint-corruption DETECTION infrastructure (Batch B mitigation for the confirmed OpenTUI 0.7.0 engine bug).** A long streaming turn corrupts the native diff-paint state — reply rows bleed into the input box and SIGWINCH does NOT heal it (only a renderer state reset does; 0.8.2 tried and reverted). `packages/shell/src/client/turn-heal.ts` lands the detection half only: `createTurnHeal` wraps the client entry's session surface (same Proxy pattern as `aggregateTurnContext`, real-target accessors), churn-tracks every turn (content deltas + streamed chars + streaming seconds) and schedules exactly ONE deferred heal per threshold trip at turn end (settle delay 1000ms; a newer `turn()` voids a pending heal — never bounce the terminal mid-turn; the settlement `finally` anchor also covers error endings without `onTurnEnd`, idempotent per turn seq). Thresholds `maxChars 2000 / maxDeltas 400 / maxSecs 120` are tuned from the deterministic tear repro (60-sentence weather prompt: ~299 torn frames over ~150s, ~2.7k streamed chars — trips all three; an ordinary short turn ~<500 chars, <30s trips none). The heal ACTION is a deliberate no-op stub via the `heal` factory seam: the cheapest API candidate, `renderer.suspend()` → `resume()` (native terminal transition cycle + forceFullRepaint on resume), was FALSIFIED by the live tear repro (2026-11-05) — the turn froze at end, screen static and torn from the turn-end frame onward, idle placeholder never returned, subsequent input dead (suspend halts the render loop and its native transition never completes in this configuration, so resume is impossible). DO NOT RETRY the suspend/resume bounce. The remaining mechanism, threshold-based renderer recreation at turn end, needs ShellHost state (input buffer, transcript, dock, focus) externalized first — a ShellHost edit would break the dist-host zero-diff gate, so it is out of this batch's scope; the seam makes recreation a one-line swap once that refactor lands. Tests: `test/turn-heal.test.ts` (10 tests — threshold trips per counter, one-heal-per-turn, newer-turn voiding, error-path settlement, heal-factory-null skip, proxy pass-through). 10 tests ride the shell suite (277 ran / 3 skip / 0 fail); dist-host rebuild verified byte-identical (client modules not bundled).
|
|
1160
1183
|
|
|
1161
|
-
- **
|
|
1184
|
+
- **legacy command-surface sweep (retired) hardened to the 68-item gate + a `KNOWN_STALL` annotation.** The sweep's own false-PASS/false-FAIL classes are closed: the `/preset` probe now waits for the picker's real anchors (its dispatch is ASYNC via the host `listPresets` RPC — the old wait returned on a stale `/config` frame whose "minimal" text collided with the marker, then escaped at nothing and the late picker leaked into `/model`: a recorded false-PASS), and the pane settles (stable-frame poll) BEFORE the close esc fires so a late-opening picker is actually up; first-key-drop guards generalize — `submit()`'s verify/clean/retype (now RAW-verified; `flat()` strips the leading `/` and would pass the broken state) plus a new `typeVerified` for raw bursts (a dropped `/` turned `/login` into the plain prompt "login", a REAL turn); a vacuous `/search` anchor is dropped (`search:` matched the `/hotkeys` keybinding row under `flat()`, passing frames where the response row never painted); `settlePane` polls until two consecutive captures agree (digits stripped — the powerline clock ticks every second) instead of fixed sleeps; `ensureIdle` declines a pending ask overlay / disarms a stray stop-confirm before waiting; `cleanBuffer` verifies the idle row and re-sweeps once (full-load render stalls drop BACKSPACES too, leaking half-cleared buffers into the next command). The two render-paint stall items (`palette filter /lo`, `alt+enter newline` — both verified correct in isolation) print as `KNOWN-STALL` in the summary while still COUNTING as failures in the RESULT/exit gate. Validation run (batch D): 65 PASS / 2 KNOWN-STALL / 1 CHECK — the cleanest recorded sweep.
|
|
1162
1185
|
|
|
1163
1186
|
- **`DSH_OPENTUI_DEBUG` input-line trace layer.** kit `InputLine`'s key path appends per-event JSON lines to `/tmp/host-inputline.log` (same env-gate + lazy-fs pattern as ShellHost's `/tmp/host-keys.log`; no-op when unset): every key event (name/sequence/modifiers), whether the slash palette's `onKeyFilter` consumed it or it passed to the editor, history-nav up/down with the consumed verdict, and each `onContentChange`/`onSubmit` — the handler→textarea bisect for stall incidents.
|
|
1164
1187
|
|
|
1165
|
-
- **`
|
|
1188
|
+
- **`legacy command-surface sweep (retired)` — the full command-surface sweep gate (client mode).** Drives EVERY slash command and keyboard surface through the real client topology in tmux 120x34 (one char per send-keys, ~60ms gap — burst writes drop keys in OpenTUI's input parser): the read-only commands, every overlay picker with item-text anchors (kit Select title rows paint blank — anchor on items), `/config` bare/set/invalid forms, the `/login` panel + headless REF forms, the slash palette (filter ↑↓ tab enter), input history recall (↑↑ across `/`-entries — the palette must NOT own the arrows), alt+enter newline, bracketed paste, PgUp/PgDn scroll, ctrl+t/ctrl+o dock toggles, and the esc stop-confirm arm→resume/abort — plus the keystroke-leak regressions (modal-consumed keys must never type into the blurred editor; see Fixed below). Runs under a scratch `DSH_HOME` (temp dir, mode 700) seeded from the real profile so login/logout/config/preset writes never touch the user's home; real turns only where a surface needs one, via the workingRoute pattern (no route → those items report BLOCKED loudly and everything else still gates); per-item captures land in a temp caps dir; self-skips (exit 0) when `dsh`/`tmux`/`bun` are missing so CI stays green. README documents the four live verification gates.
|
|
1166
1189
|
|
|
1167
|
-
- **Client-mode gate hardening: full accessor audit through the real session wrapper (77 members) +
|
|
1190
|
+
- **Client-mode gate hardening: full accessor audit through the real session wrapper (77 members) + legacy client-topology gate (retired) scenario h.** Closes the fake-coverage hole that shipped the `/login` crash (3dec270): until now the client-mode tests drove FAKE sessions through the `aggregateTurnContext` wrapper, so the proxy/accessor seam — the wrapper's `this` binding against the real class's `#field`-backed getters — had zero coverage, and the `Cannot access private method or accessor` crash reached a live TUI. (1) Accessor audit (`test/client-entry.test.ts`, +18 tests): EVERY public member of `HTTP session facade` (77) is now driven through a REAL instance wrapped by the REAL `aggregateTurnContext` — the exact object ShellHost receives in client mode. The contract under test: behavior is IDENTICAL through the wrapper — no accessor error anywhere, and every documented result shape holds (the fake connection answers `{}` per RPC and the socket factory throws a business error, so degraded members surface their documented degradation: `[]` / error string / business-error rejection, the same shapes the raw instance produces). Coverage spans all surfaces: fields (identity — `usage`/`lastTurnStats` pass through as the same references, `remoteTailSink` SETS land on the real target for the ShellHost wiring), `status`, `settingsSeam` (the `/login` crash path: `describe()`/`mutate()` drive `#settingsClient`), lifecycle + turn control (start/turn/steer/abort/newSession/resumeSession/dispose — dispose is clean and idempotent through the wrapper), telemetry, model/session-ops/preset/settings-credentials/push-listener/config/wave-3-local (agents, repair, git)/plugins-skills-reload/tail-attachments/subagent surfaces, cold-guard sync-throw parity, the deep chain (failed turn adopts the session id → session-bound members run → abort clears), and the exit-path routing (shutdown, then the real `process.exit`). (2) `legacy client-topology gate (retired)` scenario h — `/login` provider directory: bare `/login` opens the provider picker through the aggregateTurnContext proxy (`settingsSeam` → `#settingsClient`), known provider names render, esc closes cleanly with the editor back to idle and the powerline intact (twice, for proxy state-machine stability), and no TypeError/crash markers appear in the pane scrollback or the exit; no credential writes (opening the picker touches nothing). The gate suite is now 8 scenarios (a–h); live run 8/8.
|
|
1168
1191
|
|
|
1169
1192
|
- **`ask_user_question` Q&A transcript block.** The model's ask now leaves a readable record in the message flow instead of evaporating with the ephemeral overlay: the durable `tool/call` (questions + options, the dsh-user-questions wire schema) pairs with its `tool/result` (the answer batch; declined arrives as `{selected: [], custom: "declined"}`) into ONE `ask` transcript item — question pops in accent, options sit dimmed, the user's pick is marked ✓ in the user color, and a declined question renders honestly as "declined" (kit `askLines` shared by the rich JSX path and the scrollback line window; the `ask` kind is additive — persisted items without it keep rendering). Live turn: ShellHost parses the call args at `onToolStart` and, because the live pipeline caps the result brief at 300 chars (multi-question batches truncate), the ask overlay stashes its own picks — `buildAskTranscriptItem` prefers the parsed result and falls back to the stash; with NEITHER available the block is skipped entirely (no fabricated answers; a hard-failed result renders declined, the honest outcome). Replay parity (client mode): `journalToTranscriptRows` folds the durable tool pair into `ask` rows, so resume, fork-at-turn and the re-attach wake rebuild the Q&A block from the journal — `StoredTranscriptRow` widens the seam end to end (the `shell-session.ts` compile-time conformance guard, `client-entry` drops its `as unknown as HostSession` cast, `model-select`/`history-fork` ride the surface). Known limitation: in PLUGIN mode the host's `storedTranscript` still returns user/assistant rows only, so the block paints live but does not replay on resume there. An ask call with no settled result renders nothing (mid-turn replay / errored read). Tests: `test/ask-transcript.test.ts` + the `remote-host-session` tool-pair→dock-callbacks test over the shared `client-fakes.ts` builders, plus kit `test/frames/ask-block.test.tsx`.
|
|
1170
1193
|
|
|
1171
|
-
- **Client-mode two-process E2E gate (`
|
|
1194
|
+
- **Client-mode two-process E2E gate (`legacy client-topology gate (retired)`, ADR-0005 P6).** The release gate drives the REAL topology end to end: `./dsh-opentui --client` inside tmux 120x34 panes, the resident `dsh --profile opentui` host it spawns, and real model turns. Seven scenarios: (a) boot + turn with the status-bar route/context assertions, (b) multi-TUI attach (second client JOINS the same host pid; both quit → the detached idle-reaper idles the host out), (c) crash-recovery adoption (SIGKILL the client → the host survives → the next client adopts it, no respawn), (d) `/reload` same-port restart (carrier reconnect + wave-2 re-attach; acceptance: transcript rows single-painted and the restarted host MANAGED — lockfile rewritten with the new listener pid), (e) host-death recovery (SIGKILL the host mid-turn → reconnecting state → a fresh client respawns and continues; also surfaced a renderer sampling gap in the reconnecting label swap, recorded for the UI follow-up), (f) THE ORIGINAL acceptance scenario — `用一个markdown表格列出两种语言和创建年份,再写一句总结` renders a real bordered table + summary + bottom anchor (capture to `/tmp/p6-mdtable.txt`, PNG via `/tmp/tmux2png.py`), (g) workspace config effect (dracula theme + model preference from `./.dsh/config.yml` verified through truecolor SGR capture). Every real-turn scenario rides the wave-3 workingRoute discovery (probe `session/modelCatalog` + turns until a route answers, export via `DSH_OPENTUI_MODEL`); when no route answers the non-turn assertions still run and the turn parts are marked BLOCKED loudly instead of hacked. Typing is one char per tmux `send-keys` (~60ms gap, burst writes drop keys); the script skips (exit 0) on CI-unfriendly environments (no global dsh/tmux/bun/profile). The scenario-d listener probe is LISTEN-only (`lsof -sTCP:LISTEN`): unfiltered `-ti tcp:N` also lists the client's ESTABLISHED sockets, which produced a false oldfox-P1#2 reproduction in the first gate run. Gate evidence at flip time: 7 pass / 0 blocked, zero oldfox-P1 reproductions. The known-P1 watch list it enforces doubles as the oldfox review summary (see Fixed below).
|
|
1172
1195
|
|
|
1173
1196
|
- **Launcher default flipped to client mode; `--plugin` is the transitional escape hatch.** Root `./dsh-opentui` now execs the bun thin client (`src/client-entry.tsx` with the solid-js preload) by DEFAULT — per ADR-0005, gated on exactly this P6 E2E gate passing 7/7 including the scenario-d single-paint + managed-host acceptance. `--plugin` keeps the OLD in-process plugin-mode boot (`dsh --profile dsh-opentui` + `NODE_OPTIONS=--experimental-ffi`) as a documented transitional escape hatch; `--client` is accepted as a no-op alias. Plugin path re-verified post-flip: boots in tmux, status bar renders (`dsh(native) · zai-coding-cn · glm-5.3-flash · 🧠 · ⎇ main`), clean quit.
|
|
1174
1197
|
|
|
1175
|
-
- **Transport lazy-import (self-contained test graph).** `
|
|
1198
|
+
- **Transport lazy-import (self-contained test graph).** `retired HTTP transport module` no longer imports `@deepseek-ai/dsh-client-connection` at module top level — the SDK is loaded lazily inside connect, so the unit-test graph (and CI) runs without the global dsh closure installed; CI stubs the closure packages anyway.
|
|
1176
1199
|
|
|
1177
1200
|
### Changed
|
|
1178
1201
|
|
|
@@ -1195,7 +1218,7 @@ it is deprecated in favour of 0.19.0.
|
|
|
1195
1218
|
|
|
1196
1219
|
- **Installer broke on 0.4.3-era profiles: duplicate `patchedDependencies:` blocks (pnpm ERR duplicate mapping key) and a stale direct `solid-js` dep winning the root hoist.** Both defects surfaced in the live profile migration (backups `pnpm-workspace.yaml.bak-1793930433-dupfix` / `package.json.bak-1793930690-stale-solid`). (1) `ensureSolidPatch`'s `stripStale` line-filter never stripped a well-formed other-version key (`solid-js@1.9.12: …` — the negative lookahead `\d+\.\d+\.\d+:` matches it, so the `!test` guard kept the line) and then APPENDED a second top-level `patchedDependencies:` block; pnpm rejects the yaml outright ("duplicate mapping key") and the profile would not install. It is now a YAML-aware merge of pnpm's flat string map (`scripts/solid-js-pin.mjs`): every top-level block is parsed into its entries, any `solid-js@<≠current>` key is dropped, every other package's patch key is kept verbatim, and ONE merged block is written back at the first block's position — duplicate headers collapse, non-patch top-level keys are preserved byte-for-byte, a block the reader cannot parse is left untouched rather than half-rewritten, and a re-run is byte-idempotent. (2) The installer's dependency-unfold kept a 0.4.3-era `"solid-js": "1.9.12"` direct dep from the profile's package.json, which hoisted 1.9.12 (SSR build) over the patchedDependencies fix until hand-removed; `pinSolidJsDependency` (same module, wired into `scripts/install-profile.mjs`) now replaces any existing solid-js spec ≠ 1.9.17 in the unfold — an absent dep stays absent, the patch key alone owns the pin. Tests: `test/solid-js-pin.test.ts` (9 — fresh workspace, stale-key merge, unrelated patch key preserved, the exact live duplicate-block backup shape collapsed + idempotence, append-when-missing, dep replace/absent/kept, installer wiring source guard). Scratch round-trip from the live pre-state (published 0.4.3 closure really hoisting solid-js@1.9.12 + the real 1.9.12 patch from git history + the exact duplicate-block workspace backup + the stale direct dep): installer exits 0 with no ERR, one merged block, `"solid-js": "1.9.17"` in the profile, solid-js@1.9.17 client build hoisted, dsh-llm linked, real `dsh --profile` boot renders with zero hand fixes.
|
|
1197
1220
|
|
|
1198
|
-
- **Login/logout panel boxes collapsed under a content-bearing transcript, and dock-adjacent cards clipped or grew unbounded (auto-height boxes in a flex column).** Root cause: once the `flexGrow` transcript holds rows, auto-height sibling boxes collapse inside the flex column — the `/login` entry, confirm and notice boxes overpainted onto a single mangled line (title/hint interleaved; the same kit-Select constraint, documented there). Every dock-adjacent card now pins explicit `width: "100%"` + a height computed from its rendered rows: login entry 7 / confirm 6 / notice 5 (border 2 + padding 2 + content rows, `login.tsx`); ShellHost stop-confirm 6, steer 5, subagent viewer 12 (was 10 — the last viewer rows clipped), the btw box sized to its content (5 + per-pair Q + up-to-4 A rows, last 2 pairs) instead of `maxHeight: 10`, and the queue box bounded to its LAST 6 messages with computed height instead of `maxHeight: 8` (unbounded growth clipped mid-list). Plus the empty-commit guard on the login entry stage: Enter on an empty buffer used to register a garbage route (writeRoute runs before the credential write) AND fire `credentials.set` with `""` — the host rejects it ("invalid payload for credentials.set") and the panel closed, so a re-sent Enter (dropped-keypress retry) destroyed the open stage with no user input; an empty buffer is now a swallowed no-op, esc stays the cancel path. Regression-covered by `scripts/ft-paste.tsx` §5 (three Enters keep the stage open, zero login calls, esc still cancels) and the
|
|
1221
|
+
- **Login/logout panel boxes collapsed under a content-bearing transcript, and dock-adjacent cards clipped or grew unbounded (auto-height boxes in a flex column).** Root cause: once the `flexGrow` transcript holds rows, auto-height sibling boxes collapse inside the flex column — the `/login` entry, confirm and notice boxes overpainted onto a single mangled line (title/hint interleaved; the same kit-Select constraint, documented there). Every dock-adjacent card now pins explicit `width: "100%"` + a height computed from its rendered rows: login entry 7 / confirm 6 / notice 5 (border 2 + padding 2 + content rows, `login.tsx`); ShellHost stop-confirm 6, steer 5, subagent viewer 12 (was 10 — the last viewer rows clipped), the btw box sized to its content (5 + per-pair Q + up-to-4 A rows, last 2 pairs) instead of `maxHeight: 10`, and the queue box bounded to its LAST 6 messages with computed height instead of `maxHeight: 8` (unbounded growth clipped mid-list). Plus the empty-commit guard on the login entry stage: Enter on an empty buffer used to register a garbage route (writeRoute runs before the credential write) AND fire `credentials.set` with `""` — the host rejects it ("invalid payload for credentials.set") and the panel closed, so a re-sent Enter (dropped-keypress retry) destroyed the open stage with no user input; an empty buffer is now a swallowed no-op, esc stays the cancel path. Regression-covered by `scripts/ft-paste.tsx` §5 (three Enters keep the stage open, zero login calls, esc still cancels) and the legacy command-surface sweep (retired) login/logout/stop sections against the live panel. `dist-host/index.js` rebuilt from source.
|
|
1199
1222
|
|
|
1200
1223
|
- **Consumed modal keys typed into the blurred editor (engine-focus ghost double delivery), and history recall left the palette owning the arrows.** Four related ghosts in `ShellHost.tsx`: (1) every modal key handler (stop-confirm, approval card, subagent viewer + steer entry, login panel stages, dock toggles, picker hotkeys, scroll keys) now `preventDefault()`s the keys it consumes — a consumed key was ALSO delivered to the editor holding the ghost engine focus, so the login confirm "y" typed itself into the input line and the next submit rode the residue (`/model` went out as the prompt "y/model"); (2) login panel close reclaims the focus imperatively via a `createEffect(on(panelOpen))` flip of the focus key (the same teardown guard the overlay paths run — the panel's menu Select holds the engine focus while mounted and its unmount can leave it on the blurred editor; the focused-prop flip alone does not reclaim the singleton); (3) history recall closes the slash palette — recalling a `/`-entry re-arms it, and up/down then moved the menu highlight instead of walking history; (4) the textarea's own `onContentChange` echo of programmatic writes (history recall, setValue) no longer re-opens the palette the recall just closed (echo skipped when the value equals the current signal — a typed edit never matches). `dist-host/index.js` rebuilt from the source (added `preventDefault` lines match the source diff 17 = 17). Verified: `bun run typecheck` (`tsc --noEmit`) exit 0 in `packages/shell`; the sweep harness (Added above) is the live regression gate for the leak scenarios. UI fixes unrelated to the 0.2.2-rc.1 closure ride — landed after it as their own commits.
|
|
1201
1224
|
|
|
@@ -1205,9 +1228,9 @@ it is deprecated in favour of 0.19.0.
|
|
|
1205
1228
|
|
|
1206
1229
|
- **Client-mode `/login` crash (Proxy wrapper accessors).** The `aggregateTurnContext` Proxy wrapper computed accessors on the proxy receiver (`Reflect.get(target, prop, receiver)`), so private-field getters threw `Cannot access private method or accessor` the moment they touched a `#field` — `/login` crashed reading `settingsSeam` → `#settingsClient` (features/login.tsx). The `get` trap now resolves every property on the real target (`Reflect.get(target, prop, target)`) with functions still bound to it, so getters and methods uniformly run with the real target as `this`. Regression test drives the real instance through the real wrapper (`settingsSeam` shape + pass-through members) in `test/client-entry.test.ts`. Live evidence: `/login` provider directory renders, esc exits clean.
|
|
1207
1230
|
|
|
1208
|
-
- **oldfox review P1×4** (client-mode review watch list, enshrined as the e2e gate's P1 watches). (1) Re-attach seq-baseline dedup: `RemoteFollowSession.attach` takes the last durable seq painted before the gap (`sinceSeq`) and skips every snapshot record at/below it whole — no re-journal, no re-fold, no re-announce — so reconnect/restart replays never double-paint transcript rows; a belt-and-braces `#announcedToolCalls` set stops duplicate `onToolStart` even for above-baseline replays (scenario d: `"❯ say ok"` rows=1, `"turns 0"` rows=1 after a live `/reload`). (2) `/reload` lockfile rewrite: `restartSamePortHost` re-writes the single-instance lockfile (lifecycle `writeLock` shape, atomic tmp+rename) with the NEW pid + same port after the respawn — the restarted host stays MANAGED, so the next `
|
|
1231
|
+
- **oldfox review P1×4** (client-mode review watch list, enshrined as the e2e gate's P1 watches). (1) Re-attach seq-baseline dedup: `RemoteFollowSession.attach` takes the last durable seq painted before the gap (`sinceSeq`) and skips every snapshot record at/below it whole — no re-journal, no re-fold, no re-announce — so reconnect/restart replays never double-paint transcript rows; a belt-and-braces `#announcedToolCalls` set stops duplicate `onToolStart` even for above-baseline replays (scenario d: `"❯ say ok"` rows=1, `"turns 0"` rows=1 after a live `/reload`). (2) `/reload` lockfile rewrite: `restartSamePortHost` re-writes the single-instance lockfile (lifecycle `writeLock` shape, atomic tmp+rename) with the NEW pid + same port after the respawn — the restarted host stays MANAGED, so the next `legacy host bootstrap` adopts it instead of double-booting on the port and the idle reaper holds the right pid (scenario d: lockfile pid = live listener pid). (3) Concurrent cold-boot mutual exclusion: the booter claims the lockfile as an atomic `booting` placeholder (pid = booter, port 0, create-if-absent via `link(2)`); a rival waits out the foreign claim (join on completion, takeover when the booter dies or the join budget lapses — foreign pid never signaled) and a superseded booter kills its own child (`HostBootSupersededError`) instead of clobbering the winner's lock — two simultaneously launched TUIs can no longer spawn dual hosts. (4) Events-source close-guard: closing a still-CONNECTING mux socket emits `'error'` asynchronously AFTER the pump listeners are removed; a noop handler stays attached so it can never surface as an uncaught exception (same fix pattern as remote-stream.ts).
|
|
1209
1232
|
|
|
1210
|
-
- **oldfox review P2×2.** (1) Reaper adoption liveness bump: `adoptHost` touches the lockfile (fresh `startedAt`/mtime) and the detached idle reaper spares a lock touched within the last 30s even without an ESTABLISHED connection — a client that adopted at the grace edge can still be inside its ~15s cookie-mint budget when the reaper fires. (2) Re-attach budget aligned to the restart budget: `
|
|
1233
|
+
- **oldfox review P2×2.** (1) Reaper adoption liveness bump: `adoptHost` touches the lockfile (fresh `startedAt`/mtime) and the detached idle reaper spares a lock touched within the last 30s even without an ESTABLISHED connection — a client that adopted at the grace edge can still be inside its ~15s cookie-mint budget when the reaper fires. (2) Re-attach budget aligned to the restart budget: `reattach attempt cap` 10 → 30 (30×1s ≈ the `/reload` readiness budget of 30s) — the re-attach no longer gives up (erroring the awaited turn) ~20s before the restarted host can even listen again; cadence and cap are injectable for tests.
|
|
1211
1234
|
|
|
1212
1235
|
- **Seam: `/reload` never acts on a `booting` placeholder.** With cold-boot mutual exclusion in place (P1#3), the lifecycle lockfile can transiently be a booting claim naming the BOOTER's pid with port 0; `restartSamePortHost` now parses `booting` and refuses with a typed `HostRestartError` (`code: "host-booting"`) instead of SIGTERMing the booting client, and its stale-lock clear step never deletes a rival's placeholder. Tested in `test/remote-btw-restart.test.ts` (booter pid stays alive, placeholder untouched).
|
|
1213
1236
|
|
|
@@ -1219,23 +1242,23 @@ it is deprecated in favour of 0.19.0.
|
|
|
1219
1242
|
|
|
1220
1243
|
### Added
|
|
1221
1244
|
|
|
1222
|
-
- **Client-mode foundations (ADR-0005 P1/P5).** The TUI-as-thin-client path gets its four base layers. `src/client/cookie-mint.ts` mints the Host API cookie from the persisted `client-connection/browser-session` grant in `$DSH_HOME/.credentials.yaml`, reproducing the Host's own recipe byte-for-byte (BrowserAuth/dsh-credentials: cookie name `dsh-auth-` + base64url(sha256(authority)); value `v1.<body>.<base64url(HMAC-SHA256(secret, body))>`), fail-closed on non-owner-only credentials and with no secret/cookie material in any thrown error. `src/client/mux-frame.ts` + `events-source.ts` + `transport
|
|
1245
|
+
- **Client-mode foundations (ADR-0005 P1/P5).** The TUI-as-thin-client path gets its four base layers. `src/client/cookie-mint.ts` mints the Host API cookie from the persisted `client-connection/browser-session` grant in `$DSH_HOME/.credentials.yaml`, reproducing the Host's own recipe byte-for-byte (BrowserAuth/dsh-credentials: cookie name `dsh-auth-` + base64url(sha256(authority)); value `v1.<body>.<base64url(HMAC-SHA256(secret, body))>`), fail-closed on non-owner-only credentials and with no secret/cookie material in any thrown error. `src/client/mux-frame.ts` + `events-source.ts` + `retired HTTP transport module` give a `HTTP client carrier` carrier over one authenticated `/api/remote.mux` WebSocket (`ws`, cookie on the upgrade — the global WebSocket cannot send headers): unary RPC via `POST /api`, and the `$events` mux pump behind `dsh-client-connection`'s `ConnectionGenerationSource` — the pump is deliberately chosen over the gateway-native `ClientRemoteEvents` client because waterfall frames must reach the consumer's `onEvent` (v1 answers them in-process), while the gateway source intercepts waterfall frames and auto-answers them itself with a stub typert service. `retired HTTP lifecycle module` is the host lifecycle manager `legacy host bootstrap`: first-TUI spawn, single-instance lock with stale-lock takeover, refcounted attach/detach, idle exit after `idleExitSec` (default 60s, `0` = resident), respawn crash cap. `scripts/provision-opentui-profile.mjs` idempotently bootstraps the fixed `opentui` host profile via `dsh opentui --from-default-profile web --dump-config` (compose-and-exit, no boot; touches only that one profile). 64 green tests in `packages/shell`; design background in `docs/adr/0005-client-mode.md` and `docs/client-mode-protocol-audit.md`.
|
|
1223
1246
|
|
|
1224
|
-
- **Client-mode session core + workspace config overlay (ADR-0005 P2 wave 1 / P4).** `
|
|
1247
|
+
- **Client-mode session core + workspace config overlay (ADR-0005 P2 wave 1 / P4).** `legacy HTTP session facade` is `HTTP session facade` — the HostSession-shaped session facade the rendering layer consumes, driven over P1's `HTTP client carrier` (unary Remote RPC + raw `$events` pump). Wave-1 audit rows: turn lifecycle (`session/create` + `session/prompt`, `mode:'queue'` for fresh sends and `mode:'steer'` mirroring `agent.steer`; the message queue stays client-side), `session/follow({assistantStream:true})` consumption (`remote-follow.ts`: text/thinking deltas, usage, tool call/result frames with image-path extraction parity, durable turn/end + error mapping, `todo/write`), `session/cancel` abort, and generation re-attach — the follow stream re-opens on reconnect, the opening snapshot replays missed transcript rows through `onReattachedMissed` and an active turn's compact stream replays as deltas under a "reconnecting…" label. Waterfalls (`remote-waterfall.ts`): forwarded `$events` `approval/request` + `user-questions/request` frames are claimed by `frame.agentId === sessionId` and answered through the unary `$events/result` RPC with the host verdict payloads — `"allowed-once"` / `"rejected"` (+ `"unavailable"` fail-closed with no callbacks) for approvals, `{answers:[{id, selected[], custom?}]}` (declined envelope on UI throw) for questions — the waterfall route rather than `userQuestions/answer` + `attachWait`, since the TUI modal has no detach window and the waterfall is the exact-parity answerer chain the in-process TUI joins today. `src/client/workspace-config.ts` is the workspace-local config overlay (bucket d, decision 4): `./.dsh/config.yml` holds only theme + model preferences, precedence environment (`DSH_OPENTUI_THEME` / `DSH_OPENTUI_MODEL`) > workspace > global base, model subfields merge partially, unknown keys ignored on load and preserved verbatim on save, credential-shaped keys rejected on load AND save (denylist, fail closed), 0600/0700 atomic same-dir rename writes, and a strict no-dependency YAML subset that refuses to rewrite a file it cannot fully parse. `remote-host-session` plugs into the same `TurnCallbacks` seam as the in-process `HostSession`, so the UI swap is zero-change. Rest of the audit surface (rows 12–28, 30–33, 35–37) ships as HostSession-shaped wave-2/3 stubs. 116 green tests in `packages/shell` (116 pass / 1 env-gated live smoke skip); contract background in `docs/adr/0005-client-mode.md` and `docs/client-mode-protocol-audit.md`.
|
|
1225
1248
|
|
|
1226
1249
|
- **Model route provisioning for the `opentui` profile.** The shipped web template mounts no provider route, so a freshly provisioned `opentui` profile could not complete a real model turn. `scripts/provision-opentui-profile.mjs` now writes/merges the route into the profile's `cordis.patch.yml` after (re)creation: `--provider` / `--model` / `--reasoning-effort` flags (defaults `zai-coding-cn` / `glm-5.3-flash` / `high`, matching `scripts/install-profile.mjs`), same patch-body shape (an `llm-pi-ai` provider entry whose `apiKeyEnv` is derived the dsh way — uppercased, non-alnum → underscore, `+_API_KEY` — plus an `agent-default-model` row). Merge is per-entry idempotent following the installer's convention: an entry already present in the patch layer is left untouched (a re-run never duplicates and never downgrades a model the user edited), missing entries are appended after a backup (`*.bak-<ts>`) so template/user entries survive, and an entry-less document (the template's bare `[]`) is replaced instead of appended to — appending after the `[]` document terminator yields an invalid two-document YAML stream the host rejects at boot. The hard guard stands: only the one `opentui` profile is ever touched. The env-gated remote live smoke gained a `DSH_SMOKE_PROFILE` knob (default `web`); against the provisioned `opentui` profile it now completes a REAL assistant turn (`MODEL_CALL ok`, text `"ok"`, `turnEnd prompt=13734 completion=19` in ~4s) instead of settling on the provider auth error — the provider key needs no environment plumbing: the host resolves `ZAI_CODING_CN_API_KEY` through its credentials service (`$DSH_HOME/.credentials.yaml` refs), shared by every profile.
|
|
1227
1250
|
|
|
1228
|
-
- **Client-mode
|
|
1251
|
+
- **Client-mode HTTP session facade wave 2 — session ops + peripheral clusters (ADR-0005 bucket (b) P2 wave 2; audit rows 12–28 + 17 + 22).** `HTTP session facade` grows from the wave-1 turn core to nearly the full HostSession surface via three new modules. `src/client/remote-session-ops.ts` is the session ops cluster: `listSessions` (`session/list` + the client-side retention filter of host-session.ts:208-240 parity — subagent rows out, retention-days cutoff by updatedAt, newest first, capped), `storedTranscript` (the `session/follow` opening snapshot replayed on a SECOND facade, with backwards `session/page` fills), `renameSession` (`session/rename`), `forkAtTurn` (`session/fork {atSeq?}` — omission = latest completed-turn prefix — plus facade switch onto the host-minted fork id), `searchSessions` (`session/search` → items {sessionId, snippet} + hasMore; OPT-IN on the wire and disabled on this deployment — the index is `openAt: never`, so the facade degrades to the exact HostSession `[]` parity), `listSkills`/`refreshSkills` (`skills/list`, the session-composed human-invocable catalog, non-activating), `listHostCommands`/`executeHostCommand` (`commands/list` / `commands/execute`, agent-scoped), and `RemoteTailSession` — the read-only foreign-id tail (row 17) riding a non-activating `session/follow` with `session/page` gap repair, plus the client-side turn grouping (`historyTurns`) from the follow record ledger. `src/client/remote-model.ts` is the model cluster: `modelCatalog` (`session/modelCatalog` — provider groups with models/reasoning efforts, failures, and `default`, which IS the row-22 cold-boot label source; the in-process `agentDefaultModel.currentSelection()` one-shot has no 1:1 remote), `selectModel` (`session/selectModel` round-trip — the host-resolved selection is durable per SESSION and applies to its NEXT request; the facade applies it to the live session when one exists, else stages it onto the session the next turn creates, unlike in-process `switchModel` which only affected the NEXT session), and the provider catalog (`llm/listConfigurableProviders` / `llm/listProviders`). `src/client/remote-settings.ts` is settings + credentials (rows 24–25): `settingsDescribe`/`settingsMutate`/`settingsUpdate`/`settingsReplace` — `settings/describe` returns the DOCUMENT view ({writable, hasDocument, namespaces[]}) on the wire and is shaped client-side to the flat rows the /login route-registration double-write and the /settings browser consume; `mutate`/`update`/`replace` take the revision seen at read time as `expectedRevision` (a stale editor is refused, not silently overwritten); credentials cross the wire value-free (`credentials/describe(refs)` → {configured, source?, writable}, writes via `credentials/set`/`unset`; the /login registration double-write stays client-side), exposed as `credentialStatus`/`login`/`logout`; presets round it out (`agentPresets/list|read|select`). Facade polish on the wave-1 core: the mid-turn compact-stream replay now dedupes at the dense index already streamed (clean replay after reconnect, no doubled deltas), a journal gap the snapshot window cannot reach is repaired from `session/page` before the live frames resume, a fuller `status` surface ({connection, turn: idle|starting|running|reconnecting, sessionAttached, tailActive}), and wire-verified usage assignment semantics (row 5): every usage chunk ASSIGNS the fields it reports, completion accumulates over the session, and the context size is prompt + cacheRead + cacheWrite on cache-splitting adapters (their `prompt` is uncached input only). `$events` push frames route to facade listeners: `settings/document-updated` (ns, revision), `commands/change`, `plugin-manager/changed` (auto-refreshes the plugins cache), `credentials/reference-updated`; `listPlugins`/`refreshPlugins` ride `pluginManager/listPlugins` (+`listBundles` versions, built-ins out). Idle-release (row 16) is HOST-NATIVE — the host owns the writer lock and the follow read needs none, so there is no client-side lease machinery. Tests: `test/remote-session-ops.test.ts` + `test/remote-model-settings.test.ts` over the shared `test/client-fakes.ts` fakes, plus the extended env-gated live smoke (wave-2 capability sweep: list/replay/rename/fork/search/model/presets/commands/skills/plugins/tail, 2/2 with real model calls); 152 green tests in `packages/shell` (2 env-gated live-smoke skips); contract background in `docs/adr/0005-client-mode.md` and `docs/client-mode-protocol-audit.md`.
|
|
1229
1252
|
|
|
1230
|
-
- **Client-mode entry — `--client` boots the end-to-end bun TUI client (ADR-0005 P3, bucket (c)).** `src/client-entry.tsx` chains the boot behind injectable seams (`bootClient()`, faked in `test/client-entry.test.ts`): `
|
|
1253
|
+
- **Client-mode entry — `--client` boots the end-to-end bun TUI client (ADR-0005 P3, bucket (c)).** `src/client-entry.tsx` chains the boot behind injectable seams (`bootClient()`, faked in `test/client-entry.test.ts`): `legacy host bootstrap({profile:'opentui', idleExitSec:60})` → `HTTP client carrier({authority, cookieHeader})` → `HTTP session facade` → `bootRuntime` render of ShellHost — with ZERO ShellHost edits: the remote session rides the HostSession type under the compile-time `ShellSessionSurface` conformance guard (`src/client/shell-session.ts`, fails tsc on surface drift instead of surfacing as a boot crash), and the turn-end hand-off is wrapped client-side (`aggregateTurnContext`) so the 🧠 status-bar context percent reads `prompt + cacheRead + cacheWrite` (the wave-2 row-5 wire finding) while the plugin bundle stays byte-identical (dist-host zero-diff gate). Workspace is the launch cwd (decision 1 — session/create cwd, welcome banner, powerline git probe, workspace overlay all key off it); theme comes from `configLoad().theme` read AFTER `session.start()` (overlay cache warm; `DSH_OPENTUI_THEME` still wins in ShellHost); the render waits (bounded) for the cold-boot model label so the powerline paints the real provider/model from first paint. Every exit path (`/quit`, Ctrl+C, renderer exit, SIGINT/SIGTERM/SIGHUP) funnels through `dispose()` → `host.release()` — never `host.dispose()` — and a LAST-REF release spawns the DETACHED idle reaper (`scripts/idle-reaper.mjs`): the lifecycle's idle timer is `unref()`ed and would die with the quitting client, orphaning the resident host forever; the reaper idles the host out after the grace window (SIGTERM→SIGKILL) and clears the lockfile, unless a fresh boot replaced the host or a client re-attached inside the window (established connections to the host port = the adoption liveness marker; behavioral tests in `test/idle-reaper.test.ts`). The jsx preload lesson: bun transpiles the whole import graph before executing, so a runtime-only transform registration is too late for kit's .tsx modules — the `@opentui/solid/preload` import stays FIRST in the entry AND the launcher passes `bun --preload …/preload.js` explicitly (bunfig.toml only applies from packages/shell's cwd, while the client launches from arbitrary workspaces). Launcher `./dsh-opentui --client`: the DEFAULT stays plugin mode until P6 (E2E topology gates) flips it. Evidence (tmux captures): boot shows the provisioned profile's real model label (`zai-coding-cn/glm-5.3-flash`), workspace prompt and themed welcome from the first paint; a real turn ("say ok" → "ok") lands with the aggregated `🧠 13.7k(11%)` context segment plus `⎇ main` / `💬 2` on the status bar. 205 pass / 3 env-gated live-smoke skips in `packages/shell` (kit 12, runtime 5); contract background in `docs/adr/0005-client-mode.md` and `docs/client-mode-protocol-audit.md`.
|
|
1231
1254
|
|
|
1232
1255
|
### Changed
|
|
1233
1256
|
|
|
1234
1257
|
- **License switched from MIT to Apache-2.0.** The repo ports component-level code from MIT-licensed projects (opencode, `@opentui/solid`); their original MIT statements are preserved in the root `NOTICE` file, which also ships inside the npm package. Previously published versions remain MIT-licensed as released.
|
|
1235
1258
|
|
|
1236
|
-
- **Client-mode
|
|
1259
|
+
- **Client-mode HTTP session facade wave 3 — full parity, no degradations (stub promotion).** The audit rows the wave-1 facade shipped as HostSession-shaped stubs (30–33, 35–37) are now real implementations, and the facade's config seam is no longer a passthrough: `configLoad()` reports the merged view (profile config.json base ⊕ workspace config.yml ⊕ environment) instead of the bare profile file, and `configSave()` splits the patch — overlay-managed keys (`theme`, `model`) route into the workspace `./.dsh/config.yml` (frozen `saveWorkspaceConfig` API: atomic 0600, credential guard), plugin keys (`retentionDays`, favorites, …) persist into the profile config.json — HostSession persistence parity on the same files plugin mode used (single machine). The v1-full-parity consequence stands: every in-process HostSession consumer seam behaves identically over the wire, with the only degradations being the audit-documented ones (search opt-out, exec-mode default not wire-visible), each with its client-side parity answer.
|
|
1237
1260
|
|
|
1238
|
-
- **Client-mode
|
|
1261
|
+
- **Client-mode HTTP session facade wave 3 — full parity, no degradations (ADR-0005 bucket (b) P2 wave 3; audit rows 29–30, 35–39, 41 + gaps 2/4).** Five new modules close the last audit rows; the clusters: `src/client/remote-local-fs.ts` gives /agents read/write + the /repair scan over `<dshHome>/agents/*.md` client-locally (single-machine topology, no Remote FS namespace), with ONE deliberate divergence from host-session.ts: the host copy's "insert into existing frontmatter" branch is dead (its regex never matches), so adding a field to a file that already had frontmatter prepended a SECOND frontmatter block — the client copy fixes the regex and documents the bug in its header. `src/client/remote-restart.ts` is /reload (audit row 29 + gap 2 — no remote live-plugin reload exists): per the ADR-0005 user decision the host restarts in place on the SAME authority — lifecycle lockfile (pid + port), SIGTERM with SIGKILL escalation, stale-lockfile removal, detached respawn `--no-open --port <same>`, a port-quiet gate (the old listener must actually release before the wait-for-listener probe), then cookie re-mint with the first-boot retry window; P1's carrier keeps retrying its authority forever and wave-2's re-attach replays the missed durable rows, so the restart is invisible beyond the reconnect label. The narrow SIGTERM→fresh-listener port-reuse race window is documented and accepted for v1; the full lifecycle-managed restart lives behind the `restartHost` override seam (P3 rendering-decouple path). `src/client/remote-btw.ts` is /btw: no one-shot throwaway-agent RPC exists on the wire, so the client mints a real throwaway session (durable marker title prefix, main session's context untouched) and REUSES the previous throwaway id for back-to-back questions — a one-session pollution cap instead of one session per question — with client-side filtering keeping throwaways out of session lists. `src/client/remote-subagents.ts` is the subagent panel aggregation: adoption of in-flight children, child follow, and steer/interrupt, with a typed `subagent/not-resumable` error surface (one-shot/non-continuable children refuse remote resume instead of failing opaquely). `src/client/remote-attachments.ts` is /attach + tool-result images (audit rows 35–36): the audit offered receipts OR inline image parts, and the receipt route is rejected on live-verified evidence — a `{type:'file', receiptId}` prompt part answers `session/attachment-invalid` (ATTACHMENT_NOT_REFERENCED) on read-back because `session/attachment` serves admitted IMAGE references only, and a staged receipt goes stale across /new/abort; the chosen route is the inline image part (`{type:'image', mediaType, data}` admitted by the host BEFORE message creation into the durable ImageAttachmentRef, extension allowlist + leaf display name parity), with admitted ids read from the follow journal for the round-trip surface; tool-result image bytes ride the authenticated `GET /api/file?path=…` (cookie-authed, 20 MiB cap → 413). Plus two seams: `src/client/remote-exec-mode.ts` (audit row 37) drives executionMode from the preset document — the deployment default is NOT wire-queryable (audit §4 candidate), and the plugin-inventory route carries no config; `src/client/remote-git.ts` (audit row 39 + gap 4) keeps the powerline git segment on its client-local `git branch --show-current` probe (ShellHost.tsx:277-295 semantics: workspace cwd, 3s timeout, silent "" on non-repos). Tests: `test/remote-wave3-local.test.ts` + `test/remote-btw-restart.test.ts` + `test/remote-subagents.test.ts` over the shared fakes, plus the wave-3 live-smoke sweep (agents/repair/attach/btw/reload/git on a scratch DSH_HOME — 3/3 previously run); 192 green tests in `packages/shell` (3 env-gated live-smoke skips); contract background in `docs/adr/0005-client-mode.md` and `docs/client-mode-protocol-audit.md`.
|
|
1239
1262
|
|
|
1240
1263
|
### Fixed
|
|
1241
1264
|
|
package/README.md
CHANGED
|
@@ -39,82 +39,34 @@ npm i -g @aiwayds/dsh-opentui
|
|
|
39
39
|
dsh-opentui
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
The first launch automatically provisions the `opentui-
|
|
42
|
+
The first launch automatically provisions the `opentui-monday` profile: the
|
|
43
43
|
shipped bridge bundle is materialized as a real directory copy of this
|
|
44
44
|
installation (no symlink, no copy of any `@deepseek-ai/*` package into the
|
|
45
45
|
profile) and checked against a build-time fingerprint. The copy converges
|
|
46
46
|
idempotently on every launch, so a damaged or stale bridge is replaced on the
|
|
47
|
-
next start
|
|
48
|
-
|
|
47
|
+
next start. `--repair-bridge` is a terminal maintenance command: it kills this
|
|
48
|
+
profile's stale instances (SIGTERM, then SIGKILL for survivors), reruns the
|
|
49
|
+
provisioner in repair mode, and exits without launching the TUI. A fingerprint
|
|
50
|
+
mismatch still fails loud.
|
|
51
|
+
|
|
52
|
+
The legacy `--force` and `--yes` launcher flags are deprecated no-ops in this
|
|
53
|
+
in-process-only build: `--yes` is accepted only alongside `--force`, and neither
|
|
54
|
+
kills processes nor clears markers. Use `--repair-bridge` to clear stale
|
|
55
|
+
instances and repair the bridge. Both flags will be removed in the next minor
|
|
56
|
+
release.
|
|
49
57
|
|
|
50
58
|
Run `dsh-opentui --help` for the full list of launcher options.
|
|
51
59
|
|
|
52
60
|
## Upgrading
|
|
53
61
|
|
|
54
|
-
`dsh-opentui upgrade`
|
|
55
|
-
|
|
56
|
-
already installed in the `opentui` profile to their latest versions. It does
|
|
57
|
-
**not** upgrade the dsh host: the host is a separate global install.
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
dsh-opentui upgrade --dry-run # print the plan table, write nothing
|
|
61
|
-
dsh-opentui upgrade # confirm, then apply
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
| Flag | Effect |
|
|
65
|
-
|---|---|
|
|
66
|
-
| `--dry-run` | Print the plan table and exit; nothing is installed or written. |
|
|
67
|
-
| `-y`, `--yes` | Skip the confirmation prompt. Required when stdin is not a TTY. |
|
|
68
|
-
| `--tag <name>` | Resolve a dist-tag other than `latest` (`next`, for example). |
|
|
69
|
-
| `--no-self` | Skip the launcher; upgrade profile plugins only. |
|
|
70
|
-
| `--no-plugins` | Skip profile plugins; upgrade the launcher only. |
|
|
71
|
-
| `--reset-overrides` | Delete `upgrade-overrides.json` and exit (terminal; cannot be combined with `--no-self` / `--no-plugins`). |
|
|
72
|
-
| `-h`, `--help` | Print usage and exit. |
|
|
73
|
-
|
|
74
|
-
| Exit code | Meaning |
|
|
75
|
-
|---|---|
|
|
76
|
-
| `0` | Completed, nothing to upgrade, or `--dry-run` / `--help`. |
|
|
77
|
-
| `1` | Hard failure, already rolled back; a target version that cannot be resolved writes nothing. |
|
|
78
|
-
| `2` | Usage error. |
|
|
79
|
-
| `3` | Partial: some packages did not reach the target version, or overrides could not be recorded. |
|
|
80
|
-
|
|
81
|
-
### Why upgrades stick (upgrade-overrides)
|
|
82
|
-
|
|
83
|
-
Provisioning runs on every launch and converges the profile to the shipped
|
|
84
|
-
pins, so a plain upgrade would be undone on the next start. After a successful
|
|
85
|
-
upgrade the command records the new versions in
|
|
86
|
-
`$DSH_HOME/profiles/opentui/upgrade-overrides.json`, and provisioning honors
|
|
87
|
-
each entry instead of the pin. An entry applies only while it is **strictly
|
|
88
|
-
newer** than the built-in pin, so a later release that raises the pin past it
|
|
89
|
-
invalidates the entry by itself.
|
|
90
|
-
|
|
91
|
-
`--reset-overrides` deletes that file and exits. The next launch provisions
|
|
92
|
-
from the shipped pins again, which can **downgrade** a package the override
|
|
93
|
-
was holding above them.
|
|
94
|
-
|
|
95
|
-
### Mirrors
|
|
96
|
-
|
|
97
|
-
Queries go to `DSH_UPGRADE_REGISTRY` when set, otherwise the profile
|
|
98
|
-
`.npmrc`, `~/.npmrc`, or the public npm registry, always with
|
|
99
|
-
`--prefer-online`. A mirror's `latest` can lag behind npmjs; the command
|
|
100
|
-
prints a note when it resolves through one.
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
DSH_UPGRADE_REGISTRY=https://registry.npmmirror.com dsh-opentui upgrade --dry-run
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### After upgrading
|
|
107
|
-
|
|
108
|
-
Quit the TUI and run `dsh-opentui` again. The host is a long-running process
|
|
109
|
-
and keeps the plugin set it booted with, so a plugin upgrade never applies to
|
|
110
|
-
the current one. CI and scripted runs must pass `--yes` — without a TTY the
|
|
111
|
-
confirmation prompt is refused.
|
|
62
|
+
The `dsh-opentui upgrade` subcommand is retired; reinstall the package with the
|
|
63
|
+
install command above to update the launcher.
|
|
112
64
|
|
|
113
65
|
## Session topology
|
|
114
66
|
|
|
115
|
-
> Since 0.24.0 the in-process session bridge (`opentui-
|
|
67
|
+
> Since 0.24.0 the in-process session bridge (`opentui-monday` profile, see
|
|
116
68
|
> ADR-0009) is the **only** session seam: the Bun TUI talks stdio JSON-lines to
|
|
117
|
-
> a bridge loaded inside a `dsh --profile opentui-
|
|
69
|
+
> a bridge loaded inside a `dsh --profile opentui-monday` host process. The
|
|
118
70
|
> legacy remote thin-client seam, its `DSH_OPENTUI_INPROC=0` escape hatch and
|
|
119
71
|
> the `--remote` flag are all gone (the flag has been a usage error, exit 2,
|
|
120
72
|
> since 0.23.0).
|
|
@@ -124,106 +76,29 @@ SIGINT/SIGTERM/SIGHUP); the TUI starts the dsh host, which loads the bridge
|
|
|
124
76
|
in-process. A boot handshake compares the client's expected capability surface
|
|
125
77
|
with the bridge and degrades honestly on a mismatch.
|
|
126
78
|
|
|
127
|
-
Every launch provisions
|
|
79
|
+
Every launch provisions one profile:
|
|
128
80
|
|
|
129
|
-
- **`opentui-
|
|
81
|
+
- **`opentui-monday`** — the only session host, provisioned synchronously (a
|
|
130
82
|
failure here is fatal): a real directory copy of this installation's bundled
|
|
131
83
|
bridge, the session shim, a host-version compatibility exemption, the
|
|
132
|
-
approval gate
|
|
133
|
-
|
|
134
|
-
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
globally-installed dsh's own `node_modules` closure, and the launcher
|
|
151
|
-
symlinks it into the installed package's `node_modules` (idempotent). This
|
|
152
|
-
is why the dsh CLI is a hard prerequisite.
|
|
153
|
-
|
|
154
|
-
### Default plugins
|
|
155
|
-
|
|
156
|
-
The live session runs on the `opentui-inproc` profile, whose cordis patch
|
|
157
|
-
registers the tool, ask-user and MCP rows directly. The `opentui` profile below
|
|
158
|
-
is still provisioned on every launch and is what `upgrade` targets, but its
|
|
159
|
-
plugin set is not loaded by the in-process host. Every launch converges it to
|
|
160
|
-
this set (pinned versions):
|
|
161
|
-
|
|
162
|
-
| Tier | Package | Why |
|
|
163
|
-
|---|---|---|
|
|
164
|
-
| core | `@aiwayds/dsh-ask-router` | owns the ask surface; loads before every other UI/ask bundle |
|
|
165
|
-
| core | `@aiwayds/dsh-subagent-registry` | subagent discovery and registration |
|
|
166
|
-
| core | `@aiwayds/dsh-llm-net-retry` | retries transient provider/network failures |
|
|
167
|
-
| core | `@aiwayds/dsh-web-search-anysearch` | web search without a per-provider key |
|
|
168
|
-
| core | `@aiwayds/dsh-mcp-adapter` | MCP catalog/dispatch meta-tools (`mcp_list` / `mcp_call`) |
|
|
169
|
-
| core | `@aiwayds/dsh-approval-policy` | tool-approval policy |
|
|
170
|
-
| core | `@aiwayds/dsh-model-sync` | keeps the model list in sync with the provider catalog |
|
|
171
|
-
| recommended | `@aiwayds/dsh-llm-stats` | token/cost accounting (usage limits) |
|
|
172
|
-
| recommended | `@aiwayds/dsh-topics-memory` | cross-session topic memory |
|
|
173
|
-
| recommended | `@aiwayds/dsh-cron` | scheduled prompts |
|
|
174
|
-
| recommended | `@aiwayds/dsh-workflow` | dynamic workflow runs |
|
|
175
|
-
| recommended | `@aiwayds/dsh-vault` | secret storage used by the companions |
|
|
176
|
-
|
|
177
|
-
`recommended` is the default and includes `core`. Use `--plugins=core` to
|
|
178
|
-
install only the core set. These are deliberately not installed:
|
|
179
|
-
`dsh-tui-pi` (takes over stdout/stdin), `dcp` (web-app-preset isolated),
|
|
180
|
-
`feishu` (claims the ask surface), `web-search-tavily` (needs a key),
|
|
181
|
-
`agent-dispatch`, `self-improve`, `llm-proxy`, `profile-switch`.
|
|
182
|
-
|
|
183
|
-
`anysearch` needs no API key: provisioning also re-enables the `tool-web` row
|
|
184
|
-
(the `dsh-web-app` bundle ships it `disabled: true`) and pins
|
|
185
|
-
`web.searchProvider` to `anysearch`, so the model gets `web_search`/`web_fetch`
|
|
186
|
-
on a fresh profile. Both rows are written for every tier — including
|
|
187
|
-
`--plugins=none`, because the tools must be visible regardless of whether the
|
|
188
|
-
anysearch bundle is installed.
|
|
189
|
-
|
|
190
|
-
MCP ships as a pair: the adapter above only catalogs tools that the official
|
|
191
|
-
`@deepseek-ai/dsh-mcp-client` registered, so provisioning also inserts one
|
|
192
|
-
client row (`mcp-context7`, transport `streamable-http`, endpoint
|
|
193
|
-
`https://mcp.context7.com/mcp`). `context7` is read-only documentation lookup,
|
|
194
|
-
needs no API key, and starts fast over HTTP. `mcp_list` / `mcp_call` then
|
|
195
|
-
appear in the model tool catalog, and `/mcp` shows the same catalog. A failed
|
|
196
|
-
or offline connection is non-fatal: `mcp-client` logs the error, the host
|
|
197
|
-
still boots, and the server's tools are simply absent until it reconnects.
|
|
198
|
-
An existing `mcp-context7` row (for example one the user edited) is never
|
|
199
|
-
rewritten or duplicated. Under `--plugins=none` neither the adapter nor this
|
|
200
|
-
row is written — the client alone would expose unfolded `mcp__*` schemas,
|
|
201
|
-
which is not the promised setup.
|
|
202
|
-
|
|
203
|
-
A plugin counts as installed only when all three agree: it is in the profile
|
|
204
|
-
`dependencies`, the installed `node_modules` version satisfies the pin, and its
|
|
205
|
-
name is in `dsh.profile.bundles`. Missing pieces are repaired with one
|
|
206
|
-
`dsh plugin --profile opentui add …`; a failing package is retried once on its
|
|
207
|
-
own after approving pnpm's build scripts, then reported as a WARN without
|
|
208
|
-
blocking the launch. The retired `@aiwayds/dsh-opentui` plugin entry is removed
|
|
209
|
-
from existing profiles (it has no `dsh.bundle` and only produced boot warnings).
|
|
210
|
-
|
|
211
|
-
### Skipping the default plugins
|
|
212
|
-
|
|
213
|
-
Pass `--plugins=none` on launch to provision the profile without installing any
|
|
214
|
-
plugin (`--plugins=core` narrows the set instead). To make that permanent for
|
|
215
|
-
every launch, set it in the environment:
|
|
216
|
-
|
|
217
|
-
```bash
|
|
218
|
-
DSH_OPENTUI_PLUGINS=none dsh-opentui
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
The profile is still created/kept, the model route still written (including the
|
|
222
|
-
`tool-web` / `web` rows), and the retired-entry cleanup still runs; only plugin
|
|
223
|
-
installation, managed-bundle appends and the default MCP server row are
|
|
224
|
-
skipped (an existing `mcp-context7` row is left untouched). You can always manage
|
|
225
|
-
plugins yourself afterwards with `dsh plugin --profile opentui add <pkg>`.
|
|
226
|
-
`--dry-run` prints every command provisioning would run without executing it.
|
|
84
|
+
approval gate, the inproc-only cordis patch and the companion set declared by
|
|
85
|
+
`scripts/lib/companion-policy.mjs`. The bridge copy converges on every launch;
|
|
86
|
+
`--repair-bridge` clears this profile's stale instances, reruns provisioning
|
|
87
|
+
in repair mode, and exits without launching the TUI. Companion versions
|
|
88
|
+
resolve to the registry `latest` within each catalog range and are never
|
|
89
|
+
downgraded.
|
|
90
|
+
- **SDK closure link** — the client still imports
|
|
91
|
+
`@deepseek-ai/dsh-client-connection` at runtime (host label/lifecycle). That
|
|
92
|
+
SDK is not on the public npm registry; it ships inside the globally-installed
|
|
93
|
+
dsh's own `node_modules` closure, and the launcher symlinks it into the
|
|
94
|
+
installed package's `node_modules` (idempotent). This is why the dsh CLI is a
|
|
95
|
+
hard prerequisite.
|
|
96
|
+
|
|
97
|
+
The retired `opentui` profile is no longer provisioned or seeded. Existing
|
|
98
|
+
`opentui` / `opentui-inproc` directories remain untouched as migration sources
|
|
99
|
+
and rollback material. The old `--provider`, `--model`, `--reasoning-effort`,
|
|
100
|
+
`--plugins` and `--dry-run` launcher options are retired; manage companions with
|
|
101
|
+
`dsh plugin --profile opentui-monday` when manual intervention is needed.
|
|
227
102
|
|
|
228
103
|
**Config reuse**: the Shell reads your existing dsh config — model defaults
|
|
229
104
|
from the host, provider baseUrls and API keys from `$DSH_HOME`. A
|
|
@@ -265,7 +140,7 @@ that variable for normal use. See `docs/adr/0011-ask-permission-bridge-channel.m
|
|
|
265
140
|
session. To reopen the newest non-empty session from the launch workspace that
|
|
266
141
|
was active within the last 7 days — with a `resumed <title> · <time ago>`
|
|
267
142
|
notice — set `"autoResume": "last"` in
|
|
268
|
-
`$DSH_HOME/profiles/opentui/config.json` (change the window with
|
|
143
|
+
`$DSH_HOME/profiles/opentui-monday/config.json` (change the window with
|
|
269
144
|
`"autoResumeDays": N`), or pass `--resume-last` for one launch (it overrides
|
|
270
145
|
the config). `--new` always starts fresh and wins over both; `--session <id>`
|
|
271
146
|
pins a specific session.
|
|
@@ -356,27 +231,8 @@ required before keymap/panel/command-surface changes. The legacy podman
|
|
|
356
231
|
assertions moved to the host families, verify70, unit tests and the
|
|
357
232
|
`pack-cold-start` gate.
|
|
358
233
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
```bash
|
|
362
|
-
node packages/shell/scripts/e2e-sweep.mjs # full command-surface sweep
|
|
363
|
-
node packages/shell/scripts/e2e-client.mjs # two-process topology gate (attach/adopt/reload)
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
`e2e-sweep.mjs` drives EVERY slash command + keyboard surface through the
|
|
367
|
-
real client topology in tmux 120x34 (slow typing, per-item capture): the
|
|
368
|
-
read-only commands, every overlay picker, `/config` forms, the `/login`
|
|
369
|
-
panel + headless forms, the palette / history-recall / alt+enter / paste /
|
|
370
|
-
scroll / dock-toggle / esc stop-confirm keys — and the keystroke-leak
|
|
371
|
-
regressions (modal-consumed keys must never type into the blurred editor).
|
|
372
|
-
`e2e-client.mjs` gates the two-process topology itself: multi-client attach,
|
|
373
|
-
crash adoption, same-port `/reload`, host-death recovery, markdown-table
|
|
374
|
-
rendering. Both run under a scratch `DSH_HOME` (temp dir, mode 700) seeded
|
|
375
|
-
from the real profile, so login/logout/config/preset writes never touch the
|
|
376
|
-
user's home. Real turns ride the workingRoute pattern: the catalog is probed,
|
|
377
|
-
a route is selected, and when no route answers the turn items report BLOCKED
|
|
378
|
-
loudly while everything else still gates. Requires `dsh`, `tmux`, `bun` on
|
|
379
|
-
PATH; otherwise the scripts self-skip (exit 0) so CI runs green.
|
|
234
|
+
The legacy HTTP client-topology and command-surface gates were retired with
|
|
235
|
+
the HTTP host. They are no longer available as local verification commands.
|
|
380
236
|
|
|
381
237
|
## Status
|
|
382
238
|
|