@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwayds/dsh-opentui",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -4,6 +4,7 @@
4
4
 
5
5
  export declare const BRIDGE_REPAIR_COMMAND: string
6
6
  export declare const BRIDGE_APPEND_PRESET_NOTICE: string
7
+ export declare const BRIDGE_LEGACY_REMOTE_HINT: string
7
8
  export declare const BRIDGE_REPAIR_HINT: string
8
9
 
9
10
  export declare function formatBridgeFailFastMessage(
@@ -34,9 +34,15 @@ export const BRIDGE_REPAIR_COMMAND = 'dsh-opentui --repair-bridge'
34
34
  export const BRIDGE_APPEND_PRESET_NOTICE =
35
35
  'inproc bridge mode injects append-system via the bridge section; presets are standard only.'
36
36
 
37
+ /** The escape-hatch line carried by EVERY bridge failure: a launch-level opt
38
+ * out of the default inproc bridge back to the legacy remote thin client. Kept
39
+ * as its own constant so the host gate and the shared repair hint cannot drift. */
40
+ export const BRIDGE_LEGACY_REMOTE_HINT =
41
+ 'To keep the legacy remote thin client for this launch: DSH_OPENTUI_INPROC=0'
42
+
37
43
  /** The repair element with the link-vs-content caveat (provision-script wording). */
38
44
  export const BRIDGE_REPAIR_HINT =
39
- `Run \`${BRIDGE_REPAIR_COMMAND}\` to rebuild the bridge symlink / manifest (it fixes links, not corrupted artifact contents).`
45
+ `Run \`${BRIDGE_REPAIR_COMMAND}\` to rebuild the bridge symlink / manifest (it fixes links, not corrupted artifact contents).\n${BRIDGE_LEGACY_REMOTE_HINT}`
40
46
 
41
47
  /**
42
48
  * Compose the three elements into one copy-pasteable, self-contained message.
@@ -3,8 +3,9 @@
3
3
  // `opentui-inproc` host profile (ADR-0009 decision 3; T3 of the in-process
4
4
  // bridge plan).
5
5
  //
6
- // Invoked by the launcher ONLY when DSH_OPENTUI_INPROC=1
7
- // (bin/dsh-opentui.mjs); the default `opentui` profile path is untouched.
6
+ // Invoked by the launcher on EVERY start since 0.23.0 (bridge is the default);
7
+ // only DSH_OPENTUI_INPROC=0 skips it (legacy `opentui` remote thin-client path).
8
+ // The default `opentui` profile path is otherwise untouched.
8
9
  // Seven local-FS steps (the first is the host-version gate), no pnpm/npm, no install scripts:
9
10
  //
10
11
  // [1/7] host — detect the running dsh version. OUTSIDE the supported
@@ -32,19 +33,20 @@
32
33
  // with the build-time fingerprint shipped in THIS
33
34
  // installation's dist/bridge/bundle-fingerprint.json, plus
34
35
  // name / version. No realpath-prefix hard binding.
35
- // [6/7] patch — ONLY when DSH_OPENTUI_INPROC=1: generate
36
- // $DSH_HOME/profiles/opentui-inproc/cordis.patch.yml from
37
- // the embedded inproc-only template (web-app compensation
38
- // rows removed, profileRevision stamped). The template also
39
- // registers the standalone sessionController shim plus the
40
- // real @deepseek-ai/dsh-api-session-controller plugin — no
41
- // dsh-web-app bundle is pulled in. Without the env this step
42
- // is skipped entirely — old behavior unchanged.
43
- // [7/7] shim — ONLY when DSH_OPENTUI_INPROC=1: generate the local shim
44
- // package under the profile's node_modules (@aiwayds scope)
45
- // that the patch row above resolves. Its @deepseek-ai/cordis
46
- // import is resolved by the host against the profile scope,
47
- // exactly like the bridge. revision + backup converge it.
36
+ // [6/7] patch — skipped ONLY by the DSH_OPENTUI_INPROC=0 escape hatch:
37
+ // generate $DSH_HOME/profiles/opentui-inproc/cordis.patch.yml
38
+ // from the embedded inproc-only template (web-app
39
+ // compensation rows removed, profileRevision stamped). The
40
+ // template also registers the standalone sessionController
41
+ // shim plus the real @deepseek-ai/dsh-api-session-controller
42
+ // plugin — no dsh-web-app bundle is pulled in. The escape
43
+ // hatch skips this step entirely.
44
+ // [7/7] shim — skipped ONLY by DSH_OPENTUI_INPROC=0: generate the local
45
+ // shim package under the profile's node_modules (@aiwayds
46
+ // scope) that the patch row above resolves. Its
47
+ // @deepseek-ai/cordis import is resolved by the host against
48
+ // the profile scope, exactly like the bridge. revision +
49
+ // backup converge it.
48
50
  //
49
51
  // T4 — cross-instance mutual exclusion:
50
52
  // The whole provisioning run is serialized by `.provision.lock` in the
@@ -97,6 +99,7 @@ import { fileURLToPath } from 'node:url'
97
99
  // BridgeBootstrapError (handshake) now carry the same three elements.
98
100
  import {
99
101
  BRIDGE_APPEND_PRESET_NOTICE,
102
+ BRIDGE_LEGACY_REMOTE_HINT,
100
103
  BRIDGE_REPAIR_HINT,
101
104
  } from './lib/bridge-failfast-text.mjs'
102
105
  // Host-version gate. The host only records an incompatible profile bundle in
@@ -131,11 +134,12 @@ const manifestPath = join(profileDir, 'package.json')
131
134
  const linkPath = join(profileDir, 'node_modules', ...BRIDGE_NAME.split('/'))
132
135
  const lockPath = join(profileDir, LOCK_NAME)
133
136
 
134
- // --- Inproc patch ownership (gated by DSH_OPENTUI_INPROC=1) -----------------
135
- // The launcher sets this on the opt-in startup path; --repair-bridge and direct
136
- // invocation do not. Keeping the gate HERE makes those paths byte-for-byte
137
- // identical to the pre-patch behavior.
138
- const INPROC_MODE = process.env.DSH_OPENTUI_INPROC === '1'
137
+ // --- Inproc patch ownership (escape hatch: DSH_OPENTUI_INPROC=0) ------------
138
+ // Bridge is the default since 0.23.0: the launcher runs this script on every
139
+ // start, so the patch/shim steps are ON unless the explicit escape hatch
140
+ // DSH_OPENTUI_INPROC=0 is set. "1" stays valid (idempotent); --repair-bridge
141
+ // and direct invocation now converge on the same full-inproc output.
142
+ const INPROC_MODE = process.env.DSH_OPENTUI_INPROC !== '0'
139
143
  const TOTAL_STEPS = INPROC_MODE ? 7 : 5
140
144
  const PATCH_NAME = 'cordis.patch.yml'
141
145
  const patchPath = join(profileDir, PATCH_NAME)
@@ -925,7 +929,7 @@ function verifyHostCompatibility(bridgeDir) {
925
929
  } catch (error) {
926
930
  fail(
927
931
  'cannot verify the dsh host version before loading the bridge',
928
- `${error instanceof Error ? error.message : String(error)}\nDetected with \`dsh --version\` (override: ${HOST_VERSION_ENV}=<exact version>).`,
932
+ `${error instanceof Error ? error.message : String(error)}\nDetected with \`dsh --version\` (override: ${HOST_VERSION_ENV}=<exact version>).\n${BRIDGE_LEGACY_REMOTE_HINT}`,
929
933
  )
930
934
  }
931
935
 
@@ -934,7 +938,8 @@ function verifyHostCompatibility(bridgeDir) {
934
938
  `dsh host version is outside the bridge support window — expected ${HOST_PEER_RANGE}, actual ${hostVersion}`,
935
939
  `The host would skip ${BRIDGE_NAME} without a usable error and bridge.hello would time out (BRIDGE_TIMEOUT). `
936
940
  + `Install a dsh host in ${HOST_PEER_RANGE}, or upgrade dsh-opentui. `
937
- + `Detection override: ${HOST_VERSION_ENV}=${process.env[HOST_VERSION_ENV] ?? '(unset)'}.`,
941
+ + `Detection override: ${HOST_VERSION_ENV}=${process.env[HOST_VERSION_ENV] ?? '(unset)'}.`
942
+ + `\n${BRIDGE_LEGACY_REMOTE_HINT}`,
938
943
  )
939
944
  }
940
945