@aiwayds/dsh-opentui 0.22.0 → 0.23.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 CHANGED
@@ -5,6 +5,34 @@ 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.23.0] - 2026-11-19
9
+
10
+ ### Changed
11
+
12
+ - **The in-process bridge is now the default.** A plain `dsh-opentui` boot
13
+ provisions the `opentui-inproc` profile and drives the TUI through the bridge
14
+ seam — no flag or env var needed. `DSH_OPENTUI_INPROC=1` remains valid
15
+ (idempotent). Setting `DSH_OPENTUI_INPROC=0` is the escape hatch back to the
16
+ legacy remote thin-client seam. A failed bridge handshake / fingerprint check
17
+ still fails fast with a diagnosis, a repair command and a mode notice, and
18
+ never silently falls back.
19
+ - **`--remote` has been removed.** It is no longer accepted as a launch flag;
20
+ passing it exits with a usage error (exit 2). The legacy remote seam is now
21
+ reachable only through the `DSH_OPENTUI_INPROC=0` env escape hatch.
22
+
23
+ ### Fixed
24
+
25
+ - **Ghost subagent rows are swept at turn boundaries.** When a parent turn is
26
+ aborted the host never journals the subagent's settle notice, so the child
27
+ stayed `running` forever. The bridge seam now reconciles its catalog against
28
+ the host session list at every turn terminal and after session recovery, and
29
+ settles any child the host no longer reports as running. Best-effort and
30
+ idempotent; still no wall-clock fallback.
31
+ - **ctrl+g subagent views show real progress.** `rounds`, `lastLine` and
32
+ `model` are now read from each subagent's own journal (lazily, cached, and
33
+ re-read once the child settles), so the viewer no longer shows 0 rounds, an
34
+ empty last line, and a missing model.
35
+
8
36
  ## [0.22.0] - 2026-11-19
9
37
 
10
38
  ### Changed
package/README.md CHANGED
@@ -8,8 +8,9 @@ running on Bun.
8
8
  The repo's product is the **architecture**; the shipped Shell is a working
9
9
  chat agent TUI on top of it. By default it boots an in-process session bridge
10
10
  inside the dsh host and drives the OpenTUI client over a stdio JSON-lines
11
- channel; the legacy thin client over the host's remote API is retained behind
12
- `--remote` (deprecated, removed in 0.23.0).
11
+ channel; the legacy thin client over the host's remote API is retained only as
12
+ an escape hatch (`DSH_OPENTUI_INPROC=0`). The `--remote` flag was removed in
13
+ 0.23.0.
13
14
 
14
15
  | Package | What it is |
15
16
  |---|---|
@@ -38,7 +39,9 @@ dsh-opentui
38
39
 
39
40
  The first launch automatically provisions the `opentui-inproc` profile (bridge
40
41
  dependencies are symlinked from the dsh install, never copied). If that bridge
41
- install is damaged, rerun with `dsh-opentui --repair-bridge`.
42
+ install is damaged, rerun with `dsh-opentui --repair-bridge`. To fall back to
43
+ the legacy remote thin client for a launch, set `DSH_OPENTUI_INPROC=0` — that
44
+ skips in-process provisioning and selects the remote seam.
42
45
 
43
46
  Run `dsh-opentui --help` for the full list of launcher options.
44
47
 
@@ -105,13 +108,16 @@ confirmation prompt is refused.
105
108
 
106
109
  ## Client mode
107
110
 
108
- > The default TUI path since 0.22.0 is the in-process session bridge
111
+ > Since 0.23.0 the default TUI path is the in-process session bridge
109
112
  > (`opentui-inproc` profile, see ADR-0009). The thin-client topology below is
110
- > the retained `--remote` path, deprecated and removed in 0.23.0.
111
-
112
- With `--remote`, `dsh-opentui` starts a thin client TUI (`dist/client/index.js`
113
- under Bun) that connects to a resident `dsh --profile opentui` host process. The
114
- launcher handles everything on startup:
113
+ > the legacy path, reachable only through the `DSH_OPENTUI_INPROC=0` escape
114
+ > hatch. The old `--remote` flag was removed in 0.23.0; passing it is a usage
115
+ > error (exit 2).
116
+
117
+ With `DSH_OPENTUI_INPROC=0`, `dsh-opentui` starts a thin client TUI
118
+ (`dist/client/index.js` under Bun) that connects to a resident
119
+ `dsh --profile opentui` host process. The launcher handles everything on
120
+ startup:
115
121
 
116
122
  - **Profile bootstrap** — `$DSH_HOME/profiles/opentui` is provisioned on
117
123
  EVERY launch (idempotent; a no-op pass is sub-second). Pass `--provider` /
@@ -10,8 +10,8 @@
10
10
  * clients are connected; ADR-0009). `--repair-bridge` is a terminal
11
11
  * maintenance command: it clears this profile's stale instances (TERM
12
12
  * then KILL), runs the in-process bridge self-heal (T7), and exits before
13
- * any bun/dsh check, TUI launch, or default-seam change; it implicitly
14
- * enables in-process provisioning without needing DSH_OPENTUI_INPROC=1.
13
+ * any bun/dsh check, TUI launch, or default-seam change; it always runs
14
+ * full in-process provisioning (bridge is the default since 0.23.0).
15
15
  * All three are consumed by the bin and never forwarded to the client.
16
16
  * 1. bun check — the client bundle runs under bun (FFI, import attributes,
17
17
  * bun export conditions); no bun on PATH → install guidance, exit 1.
@@ -56,7 +56,7 @@ import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSyn
56
56
  import { constants as osConstants, homedir } from 'node:os'
57
57
  import { dirname, join } from 'node:path'
58
58
  import { fileURLToPath, pathToFileURL } from 'node:url'
59
- import { ancestorPids, emitRemoteDeprecation, formatUpgradeUsage, formatUsage, isRemoteRequested, killStaleProcesses, launcherFlagConflict, LAUNCHER_TIMEOUT_FLAGS, parseLauncherArgs, parseLauncherOptions, parseProcessHomes, parseProcessRows, parseUpgradeArgs, prelaunchFailurePolicy, readLauncherVersion, selectStaleProcesses, validateLauncherArgs } from './lib/launcher.mjs'
59
+ import { ancestorPids, formatUpgradeUsage, formatUsage, killStaleProcesses, launcherFlagConflict, LAUNCHER_TIMEOUT_FLAGS, parseLauncherArgs, parseLauncherOptions, parseProcessHomes, parseProcessRows, parseUpgradeArgs, prelaunchFailurePolicy, readLauncherVersion, selectStaleProcesses, validateLauncherArgs } from './lib/launcher.mjs'
60
60
 
61
61
  const pkgRoot = dirname(dirname(fileURLToPath(import.meta.url)))
62
62
  const dshHome = process.env.DSH_HOME || join(homedir(), '.dsh')
@@ -89,11 +89,7 @@ if (versionFlag) {
89
89
  // P3-3: make flag combinations that used to fall into dead corners explicit.
90
90
  // Checked here (before the upgrade/help/repair branches) so the same conflict
91
91
  // wins regardless of which branch a combination would otherwise reach.
92
- const remoteRequested = isRemoteRequested(userArgs, passthrough)
93
- const flagConflict = launcherFlagConflict(
94
- { force: forceFlag, repairBridge: repairBridgeFlag, yes: yesFlag },
95
- remoteRequested,
96
- )
92
+ const flagConflict = launcherFlagConflict({ force: forceFlag, repairBridge: repairBridgeFlag, yes: yesFlag })
97
93
  if (flagConflict === 'yes-without-force') {
98
94
  console.error('dsh-opentui: --yes is only meaningful together with --force.')
99
95
  process.exit(2)
@@ -102,17 +98,6 @@ if (flagConflict === 'repair-force') {
102
98
  console.error('dsh-opentui: --repair-bridge and --force are mutually exclusive; choose one.')
103
99
  process.exit(2)
104
100
  }
105
- if (flagConflict === 'repair-remote') {
106
- console.error('dsh-opentui: --repair-bridge cannot be combined with --remote (remote mode has no bridge to repair).')
107
- process.exit(2)
108
- }
109
-
110
- // --- 0.4 --remote deprecation (T10): one clear notice per launch -------------
111
- // Emitted after --version (whose short-circuit stays absolute) and before the
112
- // upgrade/help paths, so `--remote --help` also carries it. `emitRemoteDeprecation`
113
- // prints AT MOST ONCE even when the flag is repeated, and the notice names the
114
- // removal line (0.23.0) plus the replacement entry (inproc default, no flag).
115
- emitRemoteDeprecation([userArgs, passthrough])
116
101
 
117
102
  // --- 0.5 upgrade subcommand -------------------------------------------------
118
103
  // `upgrade` is a positional subcommand: only the first remaining argument may
@@ -204,6 +189,12 @@ const validation = validateLauncherArgs(userArgs, { skip: LAUNCHER_TIMEOUT_FLAGS
204
189
  if (validation.unknown.length > 0) {
205
190
  for (const flag of validation.unknown) {
206
191
  console.error(`dsh-opentui: unknown option '${flag}'`)
192
+ // P2-4b: the removed --remote flag has a launch-level replacement — point
193
+ // users at it instead of leaving a dead end. Other unknown flags get only
194
+ // the generic did-you-mean rule (no misleading migration advice).
195
+ if (flag === '--remote') {
196
+ console.error('dsh-opentui: use DSH_OPENTUI_INPROC=0 for the legacy remote seam')
197
+ }
207
198
  if (validation.suggestions[flag]) {
208
199
  console.error(`dsh-opentui: did you mean '${validation.suggestions[flag]}'?`)
209
200
  }
@@ -213,9 +204,8 @@ if (validation.unknown.length > 0) {
213
204
  }
214
205
 
215
206
  // --- 0.7 --repair-bridge: terminal in-process bridge self-heal (T7) ---------
216
- // This is a maintenance command, not a launch. It implicitly enables in-process
217
- // provisioning (no DSH_OPENTUI_INPROC=1 needed) by invoking the SAME provisioner
218
- // the opt-in startup path uses, in its repair mode. It deliberately exits here
207
+ // This is a maintenance command, not a launch. It invokes the SAME provisioner
208
+ // the default startup path uses, in its repair mode. It deliberately exits here
219
209
  // — before the bun/dsh checks, the default `opentui` profile bootstrap, the
220
210
  // client-connection link, and the bun client launch — so it never starts a TUI
221
211
  // and never changes the default seam (that is M2's job). The provisioner owns
@@ -315,14 +305,14 @@ const opentuiProfileDir = join(dshHome, 'profiles', 'opentui')
315
305
  }
316
306
  }
317
307
 
318
- // --- 3b. In-process bridge profile provisioning (opt-in, T3) ---------------
319
- // DSH_OPENTUI_INPROC=1 is the ONLY switch: without it nothing here runs and
320
- // production behavior (the `opentui` profile path above) is byte-for-byte
321
- // unchanged. The new script provisions ONLY the `opentui-inproc` profile:
322
- // bundle manifest + absolute symlink to the embedded dist/bridge artifact.
323
- // A non-zero exit is fatal in this mode (the profile cannot work without it),
324
- // unlike the best-effort default path above.
325
- if (process.env.DSH_OPENTUI_INPROC === '1') {
308
+ // --- 3b. In-process bridge profile provisioning (default since 0.23.0) -----
309
+ // The bridge is the default, so this runs on EVERY launch; only the explicit
310
+ // escape hatch DSH_OPENTUI_INPROC=0 skips it (legacy remote thin client). "1"
311
+ // is still accepted and is now a no-op-equivalent (idempotent). The script
312
+ // provisions ONLY the `opentui-inproc` profile: bundle manifest + absolute
313
+ // symlink to the embedded dist/bridge artifact. A non-zero exit is fatal here
314
+ // (the bridge cannot work without it), unlike the best-effort path above.
315
+ if (process.env.DSH_OPENTUI_INPROC !== '0') {
326
316
  const r = spawnSync(process.execPath, [join(pkgRoot, 'scripts', 'provision-inproc-profile.mjs')], {
327
317
  stdio: 'inherit',
328
318
  })
@@ -123,9 +123,6 @@ export const KNOWN_CLIENT_ARGS = [
123
123
  '--resume-last',
124
124
  '--session',
125
125
  '--session=',
126
- // T10: retained but deprecated; removed in 0.23.0. Still accepted so the
127
- // legacy thin-client seam remains selectable during phase one.
128
- '--remote',
129
126
  ]
130
127
 
131
128
  /**
@@ -290,50 +287,19 @@ export function validateLauncherArgs(rest, { skip = [] } = {}) {
290
287
  }
291
288
  }
292
289
 
293
- /**
294
- * T10 — the `--remote` deprecation notice. Names the removal line (0.23.0)
295
- * and the inproc migration path (set DSH_OPENTUI_INPROC=1, then drop the flag;
296
- * inproc becomes the default in 0.23.0). Kept here (pure)
297
- * so the "printed exactly once" contract is unit-testable without a TUI.
298
- */
299
- export const REMOTE_DEPRECATION_NOTICE =
300
- 'dsh-opentui: --remote is deprecated and will be removed in 0.23.0; ' +
301
- 'to move to the in-process bridge, set DSH_OPENTUI_INPROC=1 and drop the flag ' +
302
- '(inproc becomes the default in 0.23.0; the /resume, --session, --resume-last entries also use it).'
303
-
304
- /** True when `--remote` appears anywhere in the launch argv (before or after
305
- * a `--` separator). */
306
- export function isRemoteRequested(...argvLists) {
307
- return argvLists.some((list) => Array.isArray(list) && list.includes('--remote'))
308
- }
309
-
310
- /**
311
- * Emit the deprecation notice AT MOST ONCE per launch, even if `--remote`
312
- * appears multiple times. Returns the number of lines written (0 or 1) so
313
- * callers/tests can assert the "exactly once" contract. `sink` is injectable.
314
- */
315
- export function emitRemoteDeprecation(argvLists, sink = console.warn) {
316
- if (!argvLists.some((list) => Array.isArray(list) && list.includes('--remote'))) return 0
317
- sink(REMOTE_DEPRECATION_NOTICE)
318
- return 1
319
- }
320
-
321
290
  /**
322
291
  * P3-3 — explicit handling of launcher flag combinations that previously fell
323
292
  * into dead corners (silently ignored one flag or ran the wrong branch). Pure
324
293
  * so the bin's reject/notice decisions are unit-testable without spawning.
325
- * `remote` is precomputed via `isRemoteRequested(userArgs, passthrough)`.
326
294
  *
327
295
  * Returns a conflict code, or null when the combination is fine:
328
296
  * 'repair-force' --repair-bridge + --force → mutually exclusive
329
- * 'repair-remote' --repair-bridge + --remote → no bridge in remote mode
330
297
  * 'yes-without-force' --yes without --force/--repair-bridge (under
331
298
  * --repair-bridge, --yes is tolerated — the repair branch
332
299
  * never reads it — and is intentionally allowed through)
333
300
  */
334
- export function launcherFlagConflict({ force, repairBridge, yes } = {}, remote = false) {
301
+ export function launcherFlagConflict({ force, repairBridge, yes } = {}) {
335
302
  if (repairBridge && force) return 'repair-force'
336
- if (repairBridge && remote) return 'repair-remote'
337
303
  if (yes && !force && !repairBridge) return 'yes-without-force'
338
304
  return null
339
305
  }
@@ -361,6 +327,7 @@ export function formatUsage() {
361
327
  ' -h, --help print this help and exit',
362
328
  '',
363
329
  'Environment:',
330
+ ' DSH_OPENTUI_INPROC=0 use the legacy remote thin-client seam instead of the default in-process bridge (escape hatch); unset or 1 = bridge',
364
331
  ' DSH_OPENTUI_BOOT_TIMEOUT_MS host cold-start budget in ms (CLI flag wins)',
365
332
  ' DSH_OPENTUI_MUX_TIMEOUT_MS mux readiness budget in ms (CLI flag wins)',
366
333
  ' DSH_OPENTUI_CONNECT_TIMEOUT_MS first-connect budget in ms (CLI flag wins)',
@@ -368,7 +335,6 @@ export function formatUsage() {
368
335
  '',
369
336
  'Client options (passed through; put them after -- to skip validation):',
370
337
  ' --new, --resume-last, --session <id>',
371
- ' --remote (deprecated; removed in 0.23.0) force the legacy thin-client seam; default is the in-process bridge in inproc mode',
372
338
  '',
373
339
  'Exit codes:',
374
340
  ' 0 success, --version, or --help',