@aiwayds/dsh-opentui 0.9.2 → 0.9.4
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 +64 -0
- package/README.md +106 -10
- package/bin/dsh-opentui.mjs +21 -7
- package/dist/client/index.js +13410 -8654
- package/dist/scripts/idle-reaper.mjs +107 -38
- package/package.json +1 -1
- package/scripts/e2e-client.mjs +1 -1
- package/scripts/e2e-sweep.mjs +9 -9
- package/scripts/idle-reaper.mjs +107 -38
- package/scripts/lib/provision-plan.mjs +518 -0
- package/scripts/provision-opentui-profile.mjs +371 -107
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,70 @@ 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.9.4] - 2026-11-10
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **MCP by default** — the core plugin set now installs `@aiwayds/dsh-mcp-adapter`, and provisioning inserts a `mcp-context7` client row (streamable HTTP, no API key) so `mcp_list` / `mcp_call` have a server to catalog on a fresh profile. An existing row is never rewritten or duplicated; `--plugins=none` writes neither.
|
|
13
|
+
- **Steer or queue on a busy submit** — Enter on a busy turn opens a two-row choice (Steer is the default highlight; `esc` keeps the typed text). Queueing is client-side: one prompt per turn end in submission order. Failed or aborted turns pause the queue and notify; the next successful turn end resumes it. The transcript shows muted `⏸ 排队等待 #N` queue rows and `⤵ 已注入当前回合` steer receipts that flip to `✓ 已投递` at turn end.
|
|
14
|
+
- **cwd · git branch row** — one muted row directly above the composer with the workspace directory (`~/…` abbreviation, left-clipped tail) and the git branch (short SHA on a detached HEAD). Probed on mount and on each session switch; non-repos and probe failures degrade silently to the directory only.
|
|
15
|
+
- **Session restore on launch** — a fresh client reopens the newest non-empty session from the launch workspace that was active within the last 7 days and prints one `resumed <title> · <time ago>` notice. `--new` starts fresh, `--session <id>` pins a session, `autoResume: "off"` disables the restore, and `autoResumeDays` changes the window.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **Footer context percent is compact** — the value uses its own digit width, so `(5.9%)` replaces `( 5.9%)` and the rolling leaf agrees with the static text at rest.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- **Transcript loss on `/resume` and after a host reconnect** — the reload carried the live session id instead of the picked one, so the read failed and the empty result was hydrated as history; and `storedTranscript` answered `[]` for any failed journal read, making "no history" indistinguishable from a transient host/RPC error. Reload now passes the picked id, errors propagate (callers keep their rows), and `/new` clears explicitly. Disk data was never affected.
|
|
24
|
+
|
|
25
|
+
### Known Issues
|
|
26
|
+
|
|
27
|
+
- Engine paint defects remain: streaming diff-paint row loss, and wide-glyph loss under translucent overlays (upstream).
|
|
28
|
+
- Skills are a boot-time snapshot of local directories; plugin-provided skills are not listed.
|
|
29
|
+
- `permission.defaultPreset` has no options in the current host schema.
|
|
30
|
+
- Input history is in-memory only.
|
|
31
|
+
- CI cannot run the real-client tmux gate (no tmux/dsh on hosted runners).
|
|
32
|
+
|
|
33
|
+
## [0.9.3] - 2026-11-10
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- **Slash palette upgrades** — Tab completion, a 10-row window with a `… N more` overflow row, skills listed as `/skill-name` entries in italic with Tab completion, and usage-frequency ranking persisted to the profile `config.json`.
|
|
38
|
+
- **`/agents`** — an agent definition manager with table / fields / limits layers aligned with `dsh-tui-pi`; it writes the frontmatter the registry consumes (`model`, `thinking`, `deep`, `maxRounds`, `background`).
|
|
39
|
+
- **`/settings`** — a panel with local preferences, host settings (subagent caps, permission preset, session log), and read-only namespaces.
|
|
40
|
+
- **Pane focus** — `F6` or a click switches between transcript and composer; the transcript scrolls and draws focused/unfocused frames; the mouse is enabled (`Shift`+drag for native selection).
|
|
41
|
+
- **Dock** — think/tool blocks show 3 lines, linger for 2s, then fade over 0.3s, and are replaced by newer content within the window.
|
|
42
|
+
- **Provisioning** — the default plugin set (10) is installed on first launch with `[n/5]` progress; `tool-web` is enabled with the anysearch provider (keyless search); the legacy `@aiwayds/dsh-opentui` bundle entry was removed.
|
|
43
|
+
- **Host idle exit** — the resident host exits 5s after the last client disconnects (`DSH_OPENTUI_HOST_IDLE_MS`).
|
|
44
|
+
- **Verification gates** — `typecheck:entry`, `verify:assembly`, and a 42-check real-client tmux script.
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
|
|
48
|
+
- **`/sessions` renamed to `/resume`** — no alias.
|
|
49
|
+
- **`/motion` bare output** — shows the configured preference and the effective tier (`auto → reduced`).
|
|
50
|
+
- **Default plugin provisioning runs on every launch** — idempotent, a no-op when already satisfied.
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- **`PgUp`/`PgDn`/`Home`/`End` swallowed by the transcript and textarea layers** — the slash palette could not scroll past 6 rows.
|
|
55
|
+
- **Panel/command wiring** — `openAgents` never reached the command context, so `/agents` reported "not mounted".
|
|
56
|
+
- **Editing one frontmatter field deleted another** — model was lost on thinking-only edits.
|
|
57
|
+
- **Empty-corpus landing state** and **overlay open-state never reset on unmount** — the sidebar `Esc` stopped working.
|
|
58
|
+
- **`web_search` unavailable** — the web-app disables `tool-web` and the opentui patch never re-enabled it.
|
|
59
|
+
- **Copy-on-select used a no-op clipboard stub** — search no longer restored `stickyScroll`.
|
|
60
|
+
- **Idle reaper script path resolution in the source tree** — hosts were never reaped.
|
|
61
|
+
- **Think-only turns never painted the fade frames** — the clock signal was not consumed when collapsed.
|
|
62
|
+
- **Stale fade anchor on resumed thinking lines.**
|
|
63
|
+
|
|
64
|
+
### Known Issues
|
|
65
|
+
|
|
66
|
+
- Engine paint defects remain: streaming diff-paint row loss, and wide-glyph loss under translucent overlays (upstream).
|
|
67
|
+
- Skills are a boot-time snapshot of local directories; plugin-provided skills are not listed.
|
|
68
|
+
- `permission.defaultPreset` has no options in the current host schema.
|
|
69
|
+
- Input history is in-memory only.
|
|
70
|
+
- CI cannot run the real-client tmux gate (no tmux/dsh on hosted runners).
|
|
71
|
+
|
|
8
72
|
## [0.9.2] - 2026-11-09
|
|
9
73
|
|
|
10
74
|
### Added
|
package/README.md
CHANGED
|
@@ -37,12 +37,17 @@ dsh-opentui
|
|
|
37
37
|
|
|
38
38
|
`dsh-opentui` starts a thin client TUI (`dist/client/index.js` under Bun) that
|
|
39
39
|
connects to a resident `dsh --profile opentui` host process. The launcher
|
|
40
|
-
handles everything on
|
|
41
|
-
|
|
42
|
-
- **Profile bootstrap** —
|
|
43
|
-
|
|
44
|
-
`--reasoning-effort`
|
|
45
|
-
|
|
40
|
+
handles everything on startup:
|
|
41
|
+
|
|
42
|
+
- **Profile bootstrap** — `$DSH_HOME/profiles/opentui` is provisioned on
|
|
43
|
+
EVERY launch (idempotent; a no-op pass is sub-second). Pass `--provider` /
|
|
44
|
+
`--model` / `--reasoning-effort` to pin a different default model (default
|
|
45
|
+
`zai-coding-cn/glm-5.3-flash/high`).
|
|
46
|
+
- **Default plugins** — the first run installs the plugin set below into the
|
|
47
|
+
profile and prints its progress (`[3/5] plugins …`). Later runs only repair
|
|
48
|
+
what is missing: nothing is reinstalled when the dependency, the installed
|
|
49
|
+
version and the bundle entry already agree. `--dry-run` (or
|
|
50
|
+
`DSH_PROVISION_DRY_RUN=1`) prints the commands without executing them.
|
|
46
51
|
- **Legacy migration** — a pre-retirement `profiles/dsh-opentui` profile is
|
|
47
52
|
detected once and its theme / config preferences are conservatively copied
|
|
48
53
|
into the `opentui` profile (only keys the target does not already have).
|
|
@@ -57,17 +62,101 @@ re-attaches (or a fresh one adopts) the running host; `/reload` restarts the
|
|
|
57
62
|
host on the same port without losing the session. Multiple clients can attach
|
|
58
63
|
to the same host.
|
|
59
64
|
|
|
65
|
+
### Default plugins
|
|
66
|
+
|
|
67
|
+
Every launch converges the `opentui` profile to this set (pinned versions):
|
|
68
|
+
|
|
69
|
+
| Tier | Package | Why |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| core | `@aiwayds/dsh-ask-router` | owns the ask surface; loads before every other UI/ask bundle |
|
|
72
|
+
| core | `@aiwayds/dsh-subagent-registry` | subagent discovery and registration |
|
|
73
|
+
| core | `@aiwayds/dsh-llm-net-retry` | retries transient provider/network failures |
|
|
74
|
+
| core | `@aiwayds/dsh-web-search-anysearch` | web search without a per-provider key |
|
|
75
|
+
| core | `@aiwayds/dsh-mcp-adapter` | MCP catalog/dispatch meta-tools (`mcp_list` / `mcp_call`) |
|
|
76
|
+
| core | `@aiwayds/dsh-approval-policy` | tool-approval policy |
|
|
77
|
+
| core | `@aiwayds/dsh-model-sync` | keeps the model list in sync with the provider catalog |
|
|
78
|
+
| recommended | `@aiwayds/dsh-llm-stats` | token/cost accounting behind `/usage` |
|
|
79
|
+
| recommended | `@aiwayds/dsh-topics-memory` | cross-session topic memory |
|
|
80
|
+
| recommended | `@aiwayds/dsh-cron` | scheduled prompts |
|
|
81
|
+
| recommended | `@aiwayds/dsh-workflow` | dynamic workflow runs |
|
|
82
|
+
| recommended | `@aiwayds/dsh-vault` | secret storage used by the companions |
|
|
83
|
+
|
|
84
|
+
`recommended` is the default and includes `core`. Use `--plugins=core` to
|
|
85
|
+
install only the core set. These are deliberately not installed:
|
|
86
|
+
`dsh-tui-pi` (takes over stdout/stdin), `dcp` (web-app-preset isolated),
|
|
87
|
+
`feishu` (claims the ask surface), `web-search-tavily` (needs a key),
|
|
88
|
+
`agent-dispatch`, `self-improve`, `llm-proxy`, `profile-switch`.
|
|
89
|
+
|
|
90
|
+
`anysearch` needs no API key: provisioning also re-enables the `tool-web` row
|
|
91
|
+
(the `dsh-web-app` bundle ships it `disabled: true`) and pins
|
|
92
|
+
`web.searchProvider` to `anysearch`, so the model gets `web_search`/`web_fetch`
|
|
93
|
+
on a fresh profile. Both rows are written for every tier — including
|
|
94
|
+
`--plugins=none`, because the tools must be visible regardless of whether the
|
|
95
|
+
anysearch bundle is installed.
|
|
96
|
+
|
|
97
|
+
MCP ships as a pair: the adapter above only catalogs tools that the official
|
|
98
|
+
`@deepseek-ai/dsh-mcp-client` registered, so provisioning also inserts one
|
|
99
|
+
client row (`mcp-context7`, transport `streamable-http`, endpoint
|
|
100
|
+
`https://mcp.context7.com/mcp`). `context7` is read-only documentation lookup,
|
|
101
|
+
needs no API key, and starts fast over HTTP. `mcp_list` / `mcp_call` then
|
|
102
|
+
appear in the model tool catalog, and `/mcp` shows the same catalog. A failed
|
|
103
|
+
or offline connection is non-fatal: `mcp-client` logs the error, the host
|
|
104
|
+
still boots, and the server's tools are simply absent until it reconnects.
|
|
105
|
+
An existing `mcp-context7` row (for example one the user edited) is never
|
|
106
|
+
rewritten or duplicated. Under `--plugins=none` neither the adapter nor this
|
|
107
|
+
row is written — the client alone would expose unfolded `mcp__*` schemas,
|
|
108
|
+
which is not the promised setup.
|
|
109
|
+
|
|
110
|
+
A plugin counts as installed only when all three agree: it is in the profile
|
|
111
|
+
`dependencies`, the installed `node_modules` version satisfies the pin, and its
|
|
112
|
+
name is in `dsh.profile.bundles`. Missing pieces are repaired with one
|
|
113
|
+
`dsh plugin --profile opentui add …`; a failing package is retried once on its
|
|
114
|
+
own after approving pnpm's build scripts, then reported as a WARN without
|
|
115
|
+
blocking the launch. The retired `@aiwayds/dsh-opentui` plugin entry is removed
|
|
116
|
+
from existing profiles (it has no `dsh.bundle` and only produced boot warnings).
|
|
117
|
+
|
|
118
|
+
### Skipping the default plugins
|
|
119
|
+
|
|
120
|
+
Pass `--plugins=none` on launch to provision the profile without installing any
|
|
121
|
+
plugin (`--plugins=core` narrows the set instead). To make that permanent for
|
|
122
|
+
every launch, set it in the environment:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
DSH_OPENTUI_PLUGINS=none dsh-opentui
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The profile is still created/kept, the model route still written (including the
|
|
129
|
+
`tool-web` / `web` rows), and the retired-entry cleanup still runs; only plugin
|
|
130
|
+
installation, managed-bundle appends and the default MCP server row are
|
|
131
|
+
skipped (an existing `mcp-context7` row is left untouched). You can always manage
|
|
132
|
+
plugins yourself afterwards with `dsh plugin --profile opentui add <pkg>`.
|
|
133
|
+
`--dry-run` prints every command provisioning would run without executing it.
|
|
134
|
+
|
|
60
135
|
**Config reuse**: the Shell reads your existing dsh config — model defaults
|
|
61
136
|
from the host, provider baseUrls and API keys from `$DSH_HOME`. A
|
|
62
137
|
workspace-local `./.dsh/config.yml` overlays theme + model preferences on top;
|
|
63
138
|
environment (`DSH_OPENTUI_THEME` / `DSH_OPENTUI_MODEL`) wins over the file.
|
|
64
139
|
|
|
65
|
-
**In the TUI**: type a question, Enter to send.
|
|
140
|
+
**In the TUI**: type a question, Enter to send. `F6` (or a click) moves focus
|
|
141
|
+
between the transcript and the composer; while the transcript is focused, ↑/↓
|
|
142
|
+
scroll a line, PgUp/PgDn a page, Home/End jump to the top/bottom, and Tab or
|
|
143
|
+
Esc returns to the composer (Esc still stops a running turn). The focused pane
|
|
144
|
+
carries a heavy accent frame; the unfocused one dims. Mouse reporting is on, so
|
|
145
|
+
hold **Shift** while dragging for the terminal's native selection (then
|
|
146
|
+
Cmd/Ctrl+C copies it); a plain drag is copied on release per `terminal.copy`.
|
|
147
|
+
The model's thinking streams
|
|
66
148
|
dim; tool calls (bash / read_file / write_file) pop an approval card — `y`
|
|
67
149
|
allow, `n` decline; `esc` aborts a running turn. Ctrl+C twice quits. Commands:
|
|
68
150
|
`/help` `/model [provider/id]` `/usage` `/clear` `/login` `/logout` `/resume`
|
|
69
151
|
`/search` `/new` `/quit` and more — see `/help` inside the TUI.
|
|
70
152
|
|
|
153
|
+
**Session restore on launch**: the client reopens the newest non-empty session
|
|
154
|
+
from the launch workspace that was active within the last 7 days, with a
|
|
155
|
+
`resumed <title> · <time ago>` notice. Disable it with `"autoResume": "off"` in
|
|
156
|
+
`$DSH_HOME/profiles/opentui/config.json` (change the window with
|
|
157
|
+
`"autoResumeDays": N`), or skip it for one launch with `--new`; `--session <id>`
|
|
158
|
+
pins a specific session.
|
|
159
|
+
|
|
71
160
|
## Develop
|
|
72
161
|
|
|
73
162
|
```bash
|
|
@@ -119,12 +208,19 @@ PATH; otherwise the scripts self-skip (exit 0) so CI runs green.
|
|
|
119
208
|
|
|
120
209
|
## Status
|
|
121
210
|
|
|
122
|
-
v0.9.
|
|
211
|
+
v0.9.4: published as `@aiwayds/dsh-opentui` — client-only distribution
|
|
123
212
|
(npm bin → client chain; the in-process plugin mode was retired). New
|
|
124
|
-
default theme dsh-blue (dark/light, auto-selected
|
|
213
|
+
default theme dsh-blue (dark/light, auto-selected from terminal background,
|
|
125
214
|
`/theme` to pin) with focus visuals, framed composer/messages/code blocks,
|
|
126
215
|
and a motion system (`/motion`, `DSH_OPENTUI_MOTION`) that reduces on
|
|
127
216
|
tmux/SSH/non-truecolor. 0.9.2 aligns the footer with `dsh-tui-pi`
|
|
128
217
|
(provider icon, effort ladder, context usage, counters, tok/s, subagent
|
|
129
218
|
lines), adds shell-style input history recall, and fixes palette/dialog
|
|
130
|
-
contrast and footer refresh.
|
|
219
|
+
contrast and footer refresh. 0.9.3 adds slash-palette Tab completion with
|
|
220
|
+
a 10-row window and skills, the `/agents` and `/settings` panels, F6 /
|
|
221
|
+
click pane focus with a scrollable transcript, the dock fade, and default
|
|
222
|
+
plugin provisioning with keyless `web_search`. 0.9.4 ships MCP by default
|
|
223
|
+
(`dsh-mcp-adapter` plus a keyless context7 server), a steer-or-queue choice
|
|
224
|
+
on a busy submit, the cwd · git branch composer row, session restore on
|
|
225
|
+
launch, a compact footer context percent, and a fix for transcript loss on
|
|
226
|
+
`/resume`. Roadmap: platform + Kit polish.
|
package/bin/dsh-opentui.mjs
CHANGED
|
@@ -8,9 +8,14 @@
|
|
|
8
8
|
* bun export conditions); no bun on PATH → install guidance, exit 1.
|
|
9
9
|
* 2. dsh check — the host CLI is the session carrier (profile storage,
|
|
10
10
|
* config load); no `dsh` on PATH → install guidance, exit 1.
|
|
11
|
-
* 3. Profile bootstrap —
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* 3. Profile bootstrap — runs scripts/provision-opentui-profile.mjs on
|
|
12
|
+
* EVERY start. The script is idempotent and prints five progress steps
|
|
13
|
+
* (profile, model route, plugins, bundles, verify); with nothing to do
|
|
14
|
+
* it is a sub-second local pass. It transparently forwards
|
|
15
|
+
* --provider/--model/--reasoning-effort and
|
|
16
|
+
* --plugins=core|recommended|none (--dry-run prints the commands without
|
|
17
|
+
* executing them). A non-zero exit is a WARN: the client still starts
|
|
18
|
+
* with the profile as-is.
|
|
14
19
|
* 4. One-time migration notice — a pre-retirement profile at
|
|
15
20
|
* $DSH_HOME/profiles/dsh-opentui is detected once, its theme /
|
|
16
21
|
* config.json preferences are conservatively copied into the opentui
|
|
@@ -62,17 +67,26 @@ if (!spawnSync('which', ['dsh'], { encoding: 'utf8' }).stdout.trim()) {
|
|
|
62
67
|
exitWithGuidance('the dsh CLI', 'npm i -g @deepseek-ai/dsh')
|
|
63
68
|
}
|
|
64
69
|
|
|
65
|
-
// --- 3. Profile bootstrap (best effort, idempotent)
|
|
70
|
+
// --- 3. Profile bootstrap (every start, best effort, idempotent) -----------
|
|
71
|
+
// provision-opentui-profile.mjs is idempotent and understands
|
|
72
|
+
// --provider/--model/--reasoning-effort --plugins/--dry-run; forward those,
|
|
73
|
+
// ignore the rest. With nothing to do this is a local, sub-second pass.
|
|
66
74
|
const opentuiProfileDir = join(dshHome, 'profiles', 'opentui')
|
|
67
|
-
|
|
68
|
-
// provision-opentui-profile.mjs is idempotent and understands
|
|
69
|
-
// --provider/--model/--reasoning-effort; forward those, ignore the rest.
|
|
75
|
+
{
|
|
70
76
|
const userArgs = process.argv.slice(2)
|
|
71
77
|
const provisionFlags = []
|
|
72
78
|
for (const name of ['provider', 'model', 'reasoning-effort']) {
|
|
73
79
|
const i = userArgs.indexOf(`--${name}`)
|
|
74
80
|
if (i >= 0 && userArgs[i + 1]) provisionFlags.push(`--${name}`, userArgs[i + 1])
|
|
75
81
|
}
|
|
82
|
+
const pluginsInline = userArgs.find((arg) => arg.startsWith('--plugins='))
|
|
83
|
+
if (pluginsInline) {
|
|
84
|
+
provisionFlags.push(pluginsInline)
|
|
85
|
+
} else {
|
|
86
|
+
const i = userArgs.indexOf('--plugins')
|
|
87
|
+
if (i >= 0 && userArgs[i + 1]) provisionFlags.push('--plugins', userArgs[i + 1])
|
|
88
|
+
}
|
|
89
|
+
if (userArgs.includes('--dry-run')) provisionFlags.push('--dry-run')
|
|
76
90
|
const r = spawnSync(process.execPath, [join(pkgRoot, 'scripts', 'provision-opentui-profile.mjs'), ...provisionFlags], {
|
|
77
91
|
stdio: 'inherit',
|
|
78
92
|
})
|