@xmoon76/dsh-pi-tui 0.4.8 → 0.5.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/README.en.md +41 -15
- package/README.md +19 -11
- package/cordis.patch.yml +49 -1
- package/dist/builtins.mjs +3 -2
- package/dist/dsh-version-V0exEv9O.mjs +76 -0
- package/dist/extensions-Dg1qhjUi.mjs +39850 -0
- package/dist/extensions.mjs +1 -1
- package/dist/index.d.mts +299 -251
- package/dist/index.mjs +46296 -2
- package/dist/{startup-Cd07dCyh.mjs → startup-DM-xxzcX.mjs} +24 -11
- package/dist/startup.d.mts +6 -5
- package/dist/startup.mjs +1 -1
- package/generated/dsh-presets/README.md +1 -1
- package/package.json +133 -115
- package/dist/src-R8SVGB-L.mjs +0 -81251
package/README.en.md
CHANGED
|
@@ -19,7 +19,7 @@ Stable releases are recommended for ordinary users. Install DSH first, then add
|
|
|
19
19
|
the TUI to the `pi-tui` profile:
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
|
-
npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty
|
|
22
|
+
npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty @deepseek-ai/dsh@latest
|
|
23
23
|
dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@latest
|
|
24
24
|
dsh --profile pi-tui
|
|
25
25
|
```
|
|
@@ -30,7 +30,7 @@ Preview installation uses the DSH `alpha` channel and the TUI `next` channel.
|
|
|
30
30
|
The DSH native install scripts must be explicitly allowed:
|
|
31
31
|
|
|
32
32
|
```sh
|
|
33
|
-
npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty
|
|
33
|
+
npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty @deepseek-ai/dsh@alpha
|
|
34
34
|
dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@next
|
|
35
35
|
dsh --profile pi-tui
|
|
36
36
|
```
|
|
@@ -54,15 +54,19 @@ next compatibility range, and fallback paths.
|
|
|
54
54
|
|
|
55
55
|
| TUI package line | Official DSH tags for the pairing | Notes |
|
|
56
56
|
|---|---|---|
|
|
57
|
-
| `0.
|
|
57
|
+
| `0.5.0` (stable / `@latest`) | `dsh-v0.1.7-rc.2`, `dsh-v0.2.0-rc.1` | Current stable line; 0.1.7-rc.2 minimum, exact validation target 0.2.0-rc.1 |
|
|
58
|
+
| `0.4.9` (stable, previous) | `dsh-v0.1.7-rc.2` | Previous stable; the compatible TUI for a 0.1.7-rc.2 runtime |
|
|
59
|
+
| `0.4.8` (stable, previous) | `dsh-v0.1.7-rc.1` | Previous stable; the compatible TUI for a 0.1.7-rc.1 runtime |
|
|
58
60
|
| `0.4.6` (stable, previous) | `dsh-v0.1.5-rc.1`, `dsh-v0.1.5-rc.2` | Previous stable; the compatible TUI for a 0.1.5 runtime |
|
|
59
61
|
| `0.4.7-alpha.2` (next, previous) | `dsh-v0.1.6-alpha.2` | Previous next line; the compatible TUI for a 0.1.6-alpha.2 runtime |
|
|
60
62
|
|
|
61
|
-
Do not mix the stable and `@next` prerelease lines. The `0.
|
|
62
|
-
whole DSH peer floor at `>=0.1.7-rc.
|
|
63
|
+
Do not mix the stable and `@next` prerelease lines. The `0.5.0` line unifies its
|
|
64
|
+
whole DSH peer floor at `>=0.1.7-rc.2` (the rc.2 preset registry peers
|
|
63
65
|
`dsh-agent` exactly, so a wider legacy floor no longer satisfies a standalone
|
|
64
|
-
tarball install)
|
|
65
|
-
|
|
66
|
+
tarball install), while its exact validation and recommended upgrade target is
|
|
67
|
+
the published `0.2.0-rc.1` family; older runtimes fail at the normal
|
|
68
|
+
incompatible-runtime boundary, so install the paired TUI line from the table
|
|
69
|
+
above. The startup notice
|
|
66
70
|
is best-effort rather than a Loader startup-order guarantee. See the [full
|
|
67
71
|
historical compatibility matrix](docs/dsh-compatibility.md) for official-tag
|
|
68
72
|
pairings and fallback commands, and see the [latest `next`
|
|
@@ -174,10 +178,31 @@ History results include the Prompt, working directory, timestamp, and Session in
|
|
|
174
178
|
|
|
175
179
|
Regular `↑` / `↓` history recall is still available for recent input.
|
|
176
180
|
|
|
177
|
-
### Subagents and
|
|
178
|
-
|
|
179
|
-
`/tasks` opens the full Task Center
|
|
180
|
-
|
|
181
|
+
### Subagents and the Task Center
|
|
182
|
+
|
|
183
|
+
`/tasks` opens the full Task Center, showing the work the current Session's
|
|
184
|
+
Job Registry / Subagent catalog still tracks; the Footer's `↓` opens the
|
|
185
|
+
lightweight Quick Tasks view for the current active work. Selecting a Job
|
|
186
|
+
opens a detail with the official non-consuming live
|
|
187
|
+
output preview (status, progress and the retained output tail); it never consumes
|
|
188
|
+
the model's `job_output` cursor and never becomes session history.
|
|
189
|
+
|
|
190
|
+
Task Center is a live tracked/control projection, not an execution-history
|
|
191
|
+
list. `ACTIVE` / `TRACKED` are presentation scopes: `ACTIVE` shows only the
|
|
192
|
+
currently active items, `TRACKED` shows everything the current authority
|
|
193
|
+
still lists. DSH `0.1.7` temporarily registers a Job while an ordinary
|
|
194
|
+
foreground `bash` / `pwsh` command runs, so it can be observed and stopped
|
|
195
|
+
from the Task Center; if the command finishes inside the foreground wait,
|
|
196
|
+
DSH removes that temporary record and the final result stays in the
|
|
197
|
+
Transcript's tool card. Explicit `run_in_background: true` jobs (and jobs
|
|
198
|
+
promoted to the background after a foreground timeout) remain visible in
|
|
199
|
+
`TRACKED` after completion as long as the Job Registry keeps their record.
|
|
200
|
+
|
|
201
|
+
`/plugins` opens the active profile's Plugin Manager: installed bundles and
|
|
202
|
+
plugins are grouped into Current TUI / TUI Extensions / DSH Plugins, with
|
|
203
|
+
enable/disable, remove and install; the `dsh-pi-tui` bundle currently providing
|
|
204
|
+
the surface is read-only and cannot be disabled or removed from its own screen.
|
|
205
|
+
The `Plugins Manage…` row in `/settings` opens the same surface on demand.
|
|
181
206
|
|
|
182
207
|
Subagents are shown using their complete lineage, including nested descendants:
|
|
183
208
|
|
|
@@ -194,14 +219,14 @@ The browser distinguishes:
|
|
|
194
219
|
* `one-shot`
|
|
195
220
|
* running / inactive
|
|
196
221
|
* nested descendants
|
|
197
|
-
*
|
|
222
|
+
* Job Registry rows (including running foreground shell work)
|
|
198
223
|
|
|
199
224
|
The Footer's `↓` opens Quick Tasks as a lightweight browsing view: it only
|
|
200
225
|
supports arrow navigation, left/right expand/collapse, `Tab` type cycling,
|
|
201
226
|
`Enter` open, and `Esc` close. The bottom “Open Task Center” row opens the full
|
|
202
227
|
Task Center.
|
|
203
228
|
|
|
204
|
-
The full Task Center additionally offers `A` to toggle Active /
|
|
229
|
+
The full Task Center additionally offers `A` to toggle Active / Tracked, `/` search,
|
|
205
230
|
`Tab` / `Shift+Tab` to cycle types in both directions, `S` to stop the selected
|
|
206
231
|
task after confirmation, and `R` to refresh/retry. Quick Tasks consumes only the
|
|
207
232
|
whitelist above; every other keystroke is a no-op that never enters search, stop
|
|
@@ -573,8 +598,9 @@ This section contains DSH compatibility and CI validation details only; ordinary
|
|
|
573
598
|
### npm mode (current `next`)
|
|
574
599
|
|
|
575
600
|
The current compatibility-train line is npm mode: it targets the published
|
|
576
|
-
`dsh-v0.
|
|
577
|
-
resolved by its lockfile
|
|
601
|
+
`dsh-v0.2.0-rc.1` family declared by this checkout's `package.json` and
|
|
602
|
+
resolved by its lockfile (the runtime peer floor stays `>=0.1.7-rc.2`). The
|
|
603
|
+
isolated npm driver installs that exact
|
|
578
604
|
family from the public registry and exercises the TUI build/test/package path:
|
|
579
605
|
|
|
580
606
|
```sh
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
稳定版是普通用户的推荐渠道。请先安装 DSH,再将 TUI 添加到 `pi-tui` profile:
|
|
19
19
|
|
|
20
20
|
```sh
|
|
21
|
-
npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty
|
|
21
|
+
npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty @deepseek-ai/dsh@latest
|
|
22
22
|
dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@latest
|
|
23
23
|
dsh --profile pi-tui
|
|
24
24
|
```
|
|
@@ -29,7 +29,7 @@ dsh --profile pi-tui
|
|
|
29
29
|
时需要显式允许其原生安装脚本:
|
|
30
30
|
|
|
31
31
|
```sh
|
|
32
|
-
npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty
|
|
32
|
+
npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty @deepseek-ai/dsh@alpha
|
|
33
33
|
dsh plugin --profile pi-tui -- add @xmoon76/dsh-pi-tui@next
|
|
34
34
|
dsh --profile pi-tui
|
|
35
35
|
```
|
|
@@ -52,13 +52,16 @@ pnpm compat:dsh:npm
|
|
|
52
52
|
|
|
53
53
|
| TUI 包版本 | 对应的官方 DSH tags | 说明 |
|
|
54
54
|
|---|---|---|
|
|
55
|
-
| `0.
|
|
55
|
+
| `0.5.0`(stable / `@latest`) | `dsh-v0.1.7-rc.2`、`dsh-v0.2.0-rc.1` | 当前稳定版;最低 0.1.7-rc.2,精确验证目标 0.2.0-rc.1 |
|
|
56
|
+
| `0.4.9`(stable,历史) | `dsh-v0.1.7-rc.2` | 上一稳定版;0.1.7-rc.2 runtime 的兼容 TUI |
|
|
57
|
+
| `0.4.8`(stable,历史) | `dsh-v0.1.7-rc.1` | 上一稳定版;0.1.7-rc.1 runtime 的兼容 TUI |
|
|
56
58
|
| `0.4.6`(stable,历史) | `dsh-v0.1.5-rc.1`、`dsh-v0.1.5-rc.2` | 上一稳定版;0.1.5 runtime 的兼容 TUI |
|
|
57
59
|
| `0.4.7-alpha.2`(next,历史) | `dsh-v0.1.6-alpha.2` | 上一条 next 线;0.1.6-alpha.2 runtime 的兼容 TUI |
|
|
58
60
|
|
|
59
|
-
不要把稳定线与 `@next` 预发布线混装。`0.
|
|
60
|
-
`>=0.1.7-rc.
|
|
61
|
-
floor 已无法满足独立 tarball
|
|
61
|
+
不要把稳定线与 `@next` 预发布线混装。`0.5.0` 的整个 DSH peer floor 统一为
|
|
62
|
+
`>=0.1.7-rc.2`(rc.2 的 preset registry 精确 peer `dsh-agent`,更宽的旧
|
|
63
|
+
floor 已无法满足独立 tarball 安装),精确验证与推荐升级目标是已发布的
|
|
64
|
+
`0.2.0-rc.1` family;旧 runtime 会在正常的不兼容边界以非零状态失败,
|
|
62
65
|
请按上表安装配对的 TUI 线。完整的历史兼容矩阵和 fallback 命令见
|
|
63
66
|
[兼容性文档](docs/dsh-compatibility.md);要查看 `@next` 的最新集成状态,请看
|
|
64
67
|
[next 分支 README](https://github.com/XMoon/dsh-pi-tui/blob/next/README.md)。
|
|
@@ -167,9 +170,13 @@ Rewind 会从选中的历史 User Turn 创建新的 Child Session,并把对应
|
|
|
167
170
|
|
|
168
171
|
普通的 `↑` / `↓` 仍用于快速浏览最近输入。
|
|
169
172
|
|
|
170
|
-
### Subagent
|
|
173
|
+
### Subagent 与 Task Center
|
|
171
174
|
|
|
172
|
-
`/tasks` 打开完整 Task Center
|
|
175
|
+
`/tasks` 打开完整 Task Center,显示当前 Session 中仍由 Job Registry / Subagent catalog 跟踪的工作;Footer 的 `↓` 打开轻量 Quick Tasks,只看当前活动(active)工作。选中 Job 后,详情会显示官方非消耗式的实时输出预览(状态、进度与保留的输出尾部),不会消耗模型的 `job_output` 游标,也不写入会话历史。
|
|
176
|
+
|
|
177
|
+
Task Center 的 `ACTIVE` / `TRACKED` 是展示范围:`ACTIVE` 只显示当前活动项,`TRACKED` 显示当前跟踪源(Job Registry / Subagent catalog)仍列出的全部项;`TRACKED` 不是 Session 执行历史。DSH `0.1.7` 会在普通前台 `bash` / `pwsh` 执行期间临时注册 Job,使其可以在 Task Center 中观察和停止;如果命令在前台等待内完成,DSH 会移除该临时记录,最终结果仍保留在 Transcript 的 tool card 中。显式 `run_in_background: true` 或被提升为后台的 Job 在完成后,只要 Job Registry 继续保留其记录,就仍可在 `TRACKED` 中查看。
|
|
178
|
+
|
|
179
|
+
`/plugins` 打开当前 profile 的 Plugin Manager:按 Current TUI / TUI Extensions / DSH Plugins 分区查看已安装的 bundle 与插件,并执行启用/禁用、删除与安装;正在提供当前界面的 `dsh-pi-tui` 只读且不可从自身界面禁用或移除。`/settings` 中的 `Plugins Manage…` 按需打开同一界面。
|
|
173
180
|
|
|
174
181
|
Subagent 按完整 lineage 显示,包括嵌套创建的 descendant:
|
|
175
182
|
|
|
@@ -186,11 +193,11 @@ main
|
|
|
186
193
|
* `one-shot`
|
|
187
194
|
* running / inactive
|
|
188
195
|
* nested descendant
|
|
189
|
-
*
|
|
196
|
+
* Job Registry 跟踪的 Job(含运行中的前台 shell)
|
|
190
197
|
|
|
191
198
|
Footer `↓` 打开的 Quick Tasks 是轻量浏览视图,只提供方向键导航、左右展开/折叠、`Tab` 类型过滤、`Enter` 打开和 `Esc` 关闭。底部 “Open Task Center” 行可进入完整 Task Center。
|
|
192
199
|
|
|
193
|
-
完整 Task Center 额外提供 `A` 切换 Active /
|
|
200
|
+
完整 Task Center 额外提供 `A` 切换 Active / Tracked、`/` 搜索、`Tab` / `Shift+Tab` 双向切换类型、`S`(确认后)停止所选任务以及 `R` 刷新 / 重试。Quick Tasks 只消费上述白名单按键,其余输入一律 no-op,不会进入搜索、停止确认或任务管理状态,因此 `Esc` 始终一层关闭。
|
|
194
201
|
|
|
195
202
|
已经结束的 one-shot Subagent 仍可以打开并查看持久化 Transcript。
|
|
196
203
|
|
|
@@ -544,7 +551,8 @@ dsh --profile pi-tui-dev
|
|
|
544
551
|
### npm 模式(当前 `next`)
|
|
545
552
|
|
|
546
553
|
当前兼容列车线是 npm 模式:以本 checkout 的 `package.json` 声明、
|
|
547
|
-
lockfile 解析的已发布 `dsh-v0.
|
|
554
|
+
lockfile 解析的已发布 `dsh-v0.2.0-rc.1` family 为精确验证目标(运行时
|
|
555
|
+
peer floor 保持 `>=0.1.7-rc.2`)。隔离的 npm
|
|
548
556
|
驱动从公共 registry 安装该精确 family,并跑完整 build/test/package 路径:
|
|
549
557
|
|
|
550
558
|
```sh
|
package/cordis.patch.yml
CHANGED
|
@@ -32,10 +32,25 @@
|
|
|
32
32
|
# can fork. The row below is this bundle's own, so the dependency is
|
|
33
33
|
# self-contained and a profile that disables it fails loud instead of
|
|
34
34
|
# silently forking without workspace inheritance.
|
|
35
|
-
|
|
35
|
+
# `pluginManager` is injected for the P1-A Plugin Manager surface: the
|
|
36
|
+
# dsh-base layer already mounts it (disabled only without a profile),
|
|
37
|
+
# so this is an explicit lifecycle ordering dependency, never a second
|
|
38
|
+
# package-manager row.
|
|
39
|
+
inject: [tuiStartup, piTuiExtensions, authorization, workspaceRegistry, pluginManager, jobController]
|
|
36
40
|
config:
|
|
37
41
|
sessionId: ''
|
|
38
42
|
|
|
43
|
+
# One background Job's observation stream (P1-B): the official Host
|
|
44
|
+
# controller wraps `jobs.events` + `jobs.readAt()` into a
|
|
45
|
+
# NON-CONSUMING follow stream (never `jobs.read()`), so the selected Job
|
|
46
|
+
# detail can render a live retained-output tail without touching the
|
|
47
|
+
# model's `job_output` cursor or completion notices. The rc.1 web bundle
|
|
48
|
+
# mounts this same row; the dsh-base layer does not, so the TUI inserts
|
|
49
|
+
# it. This is NOT M3: same process, same Host Context, no Client Context,
|
|
50
|
+
# no Connection, no transport.
|
|
51
|
+
- id: job-controller
|
|
52
|
+
name: '@deepseek-ai/dsh-api-job-controller'
|
|
53
|
+
|
|
39
54
|
# Host-owned workspace membership (`ctx.workspaceRegistry`): D2.4 Direct
|
|
40
55
|
# fork mirrors the official Host rule (use the source's directly owning
|
|
41
56
|
# workspace, else the nearest ancestor workspace of a subagent source) and
|
|
@@ -74,6 +89,39 @@
|
|
|
74
89
|
config:
|
|
75
90
|
default: standard
|
|
76
91
|
|
|
92
|
+
# Production hardening for per-session preset composition. A live Agent
|
|
93
|
+
# whose standing preset generation disappears (the DSH registry owns that
|
|
94
|
+
# lifetime; the TUI must not remount/reparent/recreate an Agent) would
|
|
95
|
+
# otherwise keep addressing the model with only its Agent-own rows — the
|
|
96
|
+
# observed failure mode was a request whose tool list had collapsed to
|
|
97
|
+
# `subagent` alone, with no error anywhere. This official companion turns
|
|
98
|
+
# that into a loud, early failure at the next prompt assembly instead.
|
|
99
|
+
#
|
|
100
|
+
# The allowlist is deliberate and minimal: this bundle introduces exactly
|
|
101
|
+
# ONE production invariant, so a future layer shipping another invariant
|
|
102
|
+
# companion cannot silently enable itself here. The companion's own
|
|
103
|
+
# `/invariant` entry declares `inject = ['invariants']`; no second
|
|
104
|
+
# dependency management is written here.
|
|
105
|
+
#
|
|
106
|
+
# DEPENDENCY CONTRACT: `@deepseek-ai/dsh-invariants` is a COMPOSITION row
|
|
107
|
+
# resolved by the dsh Host (the package ships inside the dsh installation),
|
|
108
|
+
# not a module-graph peer — exactly like `@deepseek-ai/dsh-agent-preset`,
|
|
109
|
+
# which the same rule keeps in devDependencies. It therefore carries an
|
|
110
|
+
# exact devDependency pin for the real-mount tests and deliberately NO
|
|
111
|
+
# peerDependency: `scripts/naming-gate.mjs` rejects a `@deepseek-ai/*` peer
|
|
112
|
+
# that `src/` never imports as a dead peer, and a phantom peer would invite
|
|
113
|
+
# duplicate in-box copies in the profile. The companion subpath below is
|
|
114
|
+
# covered by the registry's own runtime peer.
|
|
115
|
+
- id: invariants
|
|
116
|
+
name: '@deepseek-ai/dsh-invariants'
|
|
117
|
+
config:
|
|
118
|
+
enabled: true
|
|
119
|
+
package_allowlist:
|
|
120
|
+
- '^@deepseek-ai/dsh-agent-preset-registry$'
|
|
121
|
+
|
|
122
|
+
- id: agent-preset-registry-invariant
|
|
123
|
+
name: '@deepseek-ai/dsh-agent-preset-registry/invariant'
|
|
124
|
+
|
|
77
125
|
# The official standard preset composes its `subagent` tool with
|
|
78
126
|
# `modelSelectionSettings: true`, which injects this Host-owned setting
|
|
79
127
|
# service — the row is required for the standard composition to mount.
|
package/dist/builtins.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as TUI_STARTUP_SERVICE } from "./startup-DM-xxzcX.mjs";
|
|
2
|
+
import { i as PI_TUI_EXTENSIONS_SERVICE } from "./extensions-Dg1qhjUi.mjs";
|
|
3
|
+
import { n as dshVersion } from "./dsh-version-V0exEv9O.mjs";
|
|
3
4
|
import { readFileSync } from "node:fs";
|
|
4
5
|
import { join } from "node:path";
|
|
5
6
|
//#region src/builtins.ts
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
//#region src/dsh-version.ts
|
|
4
|
+
/**
|
|
5
|
+
* The installed dsh (DeepSeek Harness CLI) version, resolved from the
|
|
6
|
+
* launcher's real path: `process.argv[1]` is the `dsh` bin, whose realpath
|
|
7
|
+
* walks up to the `@deepseek-ai/dsh/package.json` that owns it. The header
|
|
8
|
+
* and the welcome card show the harness the TUI runs on, not this bundle's
|
|
9
|
+
* own patch level. Undefined when the launcher path is unreadable.
|
|
10
|
+
*
|
|
11
|
+
* The module also owns the bundle's OWN version reads (`bundleVersion`) and
|
|
12
|
+
* the combined welcome-card display line (`versionDisplay`).
|
|
13
|
+
* @module @xmoon76/dsh-pi-tui/dsh-version
|
|
14
|
+
*/
|
|
15
|
+
/** @returns the installed dsh version string, or undefined. */
|
|
16
|
+
function dshVersion() {
|
|
17
|
+
const bin = process.argv[1];
|
|
18
|
+
if (bin === void 0) return void 0;
|
|
19
|
+
try {
|
|
20
|
+
let dir = dirname(realpathSync(bin));
|
|
21
|
+
for (let depth = 0; depth < 8; depth += 1) {
|
|
22
|
+
try {
|
|
23
|
+
const pkg = JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
|
|
24
|
+
if (pkg.name === "@deepseek-ai/dsh" && typeof pkg.version === "string") return pkg.version;
|
|
25
|
+
} catch {}
|
|
26
|
+
const parent = dirname(dir);
|
|
27
|
+
if (parent === dir) return void 0;
|
|
28
|
+
dir = parent;
|
|
29
|
+
}
|
|
30
|
+
} catch {}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The bundle's own version, read from package.json at runtime so the welcome
|
|
34
|
+
* card never drifts from the shipped version. The DISPLAYED version prefers
|
|
35
|
+
* the installed dsh version (`dshVersion` — shared with the header badge
|
|
36
|
+
* via src/dsh-version.ts), falling back to this one.
|
|
37
|
+
* @returns the version string, or a fallback when the file is unreadable.
|
|
38
|
+
*/
|
|
39
|
+
function packageVersion() {
|
|
40
|
+
try {
|
|
41
|
+
const pkg = JSON.parse(readFileSync(join(import.meta.dirname, "..", "package.json"), "utf8"));
|
|
42
|
+
return dshVersion() ?? pkg.version ?? "0.0.0";
|
|
43
|
+
} catch {
|
|
44
|
+
return dshVersion() ?? "0.0.0";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The welcome card's version line: the installed dsh version plus the
|
|
49
|
+
* bundle's own version (header-badge parity — `dsh-0.1.7-rc.2 ·
|
|
50
|
+
* tui-v0.4.9`). Without a resolvable dsh launcher it degrades to
|
|
51
|
+
* the bundle version alone.
|
|
52
|
+
* @returns the combined version string.
|
|
53
|
+
*/
|
|
54
|
+
function versionDisplay() {
|
|
55
|
+
const dsh = dshVersion();
|
|
56
|
+
return dsh === void 0 ? `tui-v${bundleVersion()}` : `dsh-${dsh} · tui-v${bundleVersion()}`;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The BUNDLE's OWN version (`@xmoon76/dsh-pi-tui`'s package.json),
|
|
60
|
+
* INDEPENDENT of the installed dsh version. The status snapshot's
|
|
61
|
+
* host.tuiVersion and the footer's `version(format=tui)` item must report
|
|
62
|
+
* the TUI's own patch level — the welcome-card helper above deliberately
|
|
63
|
+
* prefers the dsh version for display, so reusing it made `tui` show the
|
|
64
|
+
* harness version (and `both` show the dsh version twice) inside a real
|
|
65
|
+
* dsh installation (the review's P2).
|
|
66
|
+
* @returns the bundle version string, or a fallback when the file is unreadable.
|
|
67
|
+
*/
|
|
68
|
+
function bundleVersion() {
|
|
69
|
+
try {
|
|
70
|
+
return JSON.parse(readFileSync(join(import.meta.dirname, "..", "package.json"), "utf8")).version ?? "0.0.0";
|
|
71
|
+
} catch {
|
|
72
|
+
return "0.0.0";
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { versionDisplay as i, dshVersion as n, packageVersion as r, bundleVersion as t };
|