@crazyhappyone/dsh-tui 0.1.0-alpha.2 → 0.1.0-alpha.22

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.i18n.yaml CHANGED
@@ -1,5 +1,5 @@
1
1
  # Bilingual-pair consistency record: both languages carry equal authority.
2
2
  # This source-only mirror has no DSH pairing runner. Recompute with:
3
3
  # git hash-object README.md README.zh.md
4
- README.md: 2732b96d4d727ea1ebc8f01fe60b7d5d433799b3
5
- README.zh.md: dedd7687b52c3e9b853edf10848333949bb0087b
4
+ README.md: 496d812168deb2af7d4a933f961b58c1cfd814cd
5
+ README.zh.md: 8474c7be4cf16c0d5123222bab95b5231f34e185
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Installable source-runtime launcher and private source mirror for the DeepSeek Harness terminal interface."
2
+ description: "Installable source-runtime launcher and public source mirror for the DeepSeek Harness terminal interface."
3
3
  kind: "package-group"
4
4
  ---
5
5
 
@@ -7,12 +7,17 @@ kind: "package-group"
7
7
 
8
8
  English | [中文](README.zh.md)
9
9
 
10
+ [![CI](https://github.com/zhangyang-crazy-one/dsh-tui/actions/workflows/ci.yml/badge.svg)](https://github.com/zhangyang-crazy-one/dsh-tui/actions/workflows/ci.yml)
11
+ [![GitHub release](https://img.shields.io/github/v/release/zhangyang-crazy-one/dsh-tui?include_prereleases)](https://github.com/zhangyang-crazy-one/dsh-tui/releases)
12
+ [![npm next](https://img.shields.io/npm/v/%40crazyhappyone%2Fdsh-tui/next?label=npm%40next)](https://www.npmjs.com/package/@crazyhappyone/dsh-tui)
13
+
10
14
  ## Summary
11
15
 
12
- `@crazyhappyone/dsh-tui` provides the `dsh-tui` command for running and safely updating the DeepSeek Harness terminal interface. The launcher manages a dedicated DSH source checkout, so it never pulls, resets, stashes, or cleans a contributor's development checkout. This repository also mirrors the `packages/tui/` bundle and renderer sources for review. DSH continues to own agents, sessions, tools, persistence, providers, permissions, and profile assembly.
16
+ `@crazyhappyone/dsh-tui` provides the `dsh-tui` command for running and safely updating the DeepSeek Harness terminal interface. The launcher manages a dedicated DSH source checkout, so it never pulls, resets, stashes, or cleans a contributor's development checkout. This public repository also mirrors the `packages/tui/` bundle and renderer sources for review. DSH continues to own agents, sessions, tools, persistence, providers, permissions, and profile assembly.
13
17
 
14
18
  ## Table of Contents
15
19
 
20
+ - [Screenshots](#screenshots)
16
21
  - [Install the launcher](#install-the-launcher)
17
22
  - [Run and update](#run-and-update)
18
23
  - [Configure the source runtime](#configure-the-source-runtime)
@@ -25,23 +30,48 @@ English | [中文](README.zh.md)
25
30
 
26
31
  -----
27
32
 
33
+ <a id="screenshots"></a>
34
+ ## Screenshots
35
+
36
+ Idle home:
37
+
38
+ ![dsh-tui idle home](assets/screenshots/dsh-tui-home.png)
39
+
40
+ After sending `你好`:
41
+
42
+ ![dsh-tui response after sending hello](assets/screenshots/dsh-tui-hello.png)
43
+
44
+ -----
45
+
28
46
  <a id="install-the-launcher"></a>
29
- ## Install the launcher
47
+ ## Install the launcher and runtime modes
30
48
 
31
49
  The unscoped `dsh-tui` package belongs to another maintainer. This project publishes only under the authenticated `crazyhappyone` npm scope.
32
50
 
33
- The launcher requires Git, pnpm, and a DSH-supported Node version. Installing `@deepseek-ai/dsh` separately is neither required nor used: `dsh-tui` always runs the `deepseek-tui` profile from its dedicated source checkout.
51
+ `dsh-tui` supports two runtime modes:
34
52
 
35
- Install the prerelease and complete the first launch:
53
+ ### Mode A: Lightweight Mode (Recommended, Zero-Clone)
54
+ Install the official core engine and the TUI launcher globally (dozens of MB):
36
55
 
37
56
  ```text
57
+ npm install --global @deepseek-ai/dsh
38
58
  npm install --global @crazyhappyone/dsh-tui@next
39
- dsh-tui version
40
- dsh-tui update
59
+ dsh-tui probe
41
60
  dsh-tui
42
61
  ```
43
62
 
44
- Package installation creates only the launcher. It does not clone DSH, run `pnpm install`, prompt for Git credentials, or execute a postinstall script. The explicit `dsh-tui update` command creates the source runtime; its default private source requires repository authorization.
63
+ In this mode, the launcher automatically detects the installed `dsh` executable and mounts the bundled prebuilt TUI extension without cloning the 2GB monorepo.
64
+
65
+ ### Mode B: Source Mode (Developer / Debugging)
66
+ To debug or hack on TUI or DSH source directly:
67
+
68
+ ```text
69
+ npm install --global @crazyhappyone/dsh-tui@next
70
+ dsh-tui update
71
+ dsh-tui --source
72
+ ```
73
+
74
+ The explicit `dsh-tui update` command clones the monorepo via Git and runs `pnpm install`. You can use `dsh-tui probe` anytime to inspect the detected engine.
45
75
 
46
76
  -----
47
77
 
@@ -132,30 +162,26 @@ The launcher runtime must remain separate from the development checkout. To test
132
162
  <a id="publish-the-npm-package"></a>
133
163
  ## Publish the npm package
134
164
 
135
- The operator authenticates through npm's browser flow and verifies the selected account:
165
+ GitHub Actions tests every pull request and push to `main` on Node 22.19 and 24. Publishing starts only when a GitHub Release is published. The workflow rejects a release tag unless it equals `v` followed by the version in `package.json`; prereleases publish to npm's `next` tag and stable releases publish to `latest`.
136
166
 
137
- ```text
138
- npm config delete //registry.npmjs.org/:_authToken
139
- npm config set registry https://registry.npmjs.org/
140
- npm login --registry=https://registry.npmjs.org/ --auth-type=web
141
- npm whoami
142
- ```
143
-
144
- `npm whoami` must print `crazyhappyone`. Never place the password, OTP, or npm token in this repository, an issue, command output captured for review, or an AI conversation.
145
-
146
- After tests and packed-install verification pass, publish a prerelease only with explicit operator approval:
167
+ Configure npm Trusted Publishing once after `publish.yml` is present on the default branch. npm CLI 11.5.1 or newer can register the GitHub workflow through an authenticated browser session. The command below runs a compatible npm 11 temporarily and does not replace the globally installed npm:
147
168
 
148
169
  ```text
149
- npm publish --access public --tag next
170
+ npx --yes npm@11 trust github @crazyhappyone/dsh-tui \
171
+ --file publish.yml \
172
+ --repository zhangyang-crazy-one/dsh-tui \
173
+ --allow-publish
150
174
  ```
151
175
 
152
- When npm requires two-factor authentication, the operator supplies the current code locally:
176
+ The equivalent npm website settings are organization or user `zhangyang-crazy-one`, repository `dsh-tui`, workflow filename `publish.yml`, with no environment restriction. The workflow uses GitHub OIDC and stores no npm token, password, or OTP.
177
+
178
+ For each release, bump `package.json`, merge the change after CI passes, then create a GitHub Release whose tag matches the package version:
153
179
 
154
180
  ```text
155
- npm publish --access public --tag next --otp=<six-digit-code>
181
+ gh release create v0.1.0-alpha.4 --prerelease --generate-notes
156
182
  ```
157
183
 
158
- Promotion to `latest` is a separate release decision. Local implementation and verification never create or change a registry package automatically.
184
+ The `Publish npm` workflow runs tests and packed-package verification again before publishing. Do not rerun an old release tag: npm versions are immutable. Promotion to stable is a new version and a non-prerelease GitHub Release.
159
185
 
160
186
  -----
161
187
 
package/README.zh.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "DeepSeek Harness 终端界面的可安装源码运行时 launcher 与 private 源码镜像。"
2
+ description: "DeepSeek Harness 终端界面的可安装源码运行时 launcher 与公开源码镜像。"
3
3
  kind: "package-group"
4
4
  ---
5
5
 
@@ -7,12 +7,17 @@ kind: "package-group"
7
7
 
8
8
  [English](README.md) | 中文
9
9
 
10
+ [![CI](https://github.com/zhangyang-crazy-one/dsh-tui/actions/workflows/ci.yml/badge.svg)](https://github.com/zhangyang-crazy-one/dsh-tui/actions/workflows/ci.yml)
11
+ [![GitHub release](https://img.shields.io/github/v/release/zhangyang-crazy-one/dsh-tui?include_prereleases)](https://github.com/zhangyang-crazy-one/dsh-tui/releases)
12
+ [![npm next](https://img.shields.io/npm/v/%40crazyhappyone%2Fdsh-tui/next?label=npm%40next)](https://www.npmjs.com/package/@crazyhappyone/dsh-tui)
13
+
10
14
  ## 概述
11
15
 
12
- `@crazyhappyone/dsh-tui` 提供 `dsh-tui` 命令,用于运行和安全更新 DeepSeek Harness 终端界面。Launcher 管理专用 DSH 源码 checkout,因此不会 pull、reset、stash 或 clean 贡献者的开发 checkout。本仓库还镜像 `packages/tui/` bundle 与 renderer 源码以供审查。Agent、会话、工具、持久化、provider、权限与 profile 组装仍由 DSH 拥有。
16
+ `@crazyhappyone/dsh-tui` 提供 `dsh-tui` 命令,用于运行和安全更新 DeepSeek Harness 终端界面。Launcher 管理专用 DSH 源码 checkout,因此不会 pull、reset、stash 或 clean 贡献者的开发 checkout。本公开仓库还镜像 `packages/tui/` bundle 与 renderer 源码以供审查。Agent、会话、工具、持久化、provider、权限与 profile 组装仍由 DSH 拥有。
13
17
 
14
18
  ## 目录
15
19
 
20
+ - [截图](#screenshots)
16
21
  - [安装 launcher](#install-the-launcher)
17
22
  - [运行与更新](#run-and-update)
18
23
  - [配置源码运行时](#configure-the-source-runtime)
@@ -25,23 +30,48 @@ kind: "package-group"
25
30
 
26
31
  -----
27
32
 
33
+ <a id="screenshots"></a>
34
+ ## 截图
35
+
36
+ 空闲首页:
37
+
38
+ ![dsh-tui 空闲首页](assets/screenshots/dsh-tui-home.png)
39
+
40
+ 发送 `你好` 后:
41
+
42
+ ![dsh-tui 发送你好后的响应](assets/screenshots/dsh-tui-hello.png)
43
+
44
+ -----
45
+
28
46
  <a id="install-the-launcher"></a>
29
- ## 安装 launcher
47
+ ## 安装 launcher 与运行模式
30
48
 
31
49
  无 scope 的 `dsh-tui` 包属于另一位 maintainer。本项目只在已认证的 `crazyhappyone` npm scope 下发布。
32
50
 
33
- Launcher 需要 Git、pnpm 与 DSH 支持的 Node 版本。无需单独安装 `@deepseek-ai/dsh`,launcher 也不会使用它:`dsh-tui` 始终从专用源码 checkout 运行 `deepseek-tui` profile。
51
+ `dsh-tui` 支持两种运行模式:
34
52
 
35
- 安装 prerelease 并完成首次启动:
53
+ ### 模式 A:轻量模式(推荐,零 Clone 秒开)
54
+ 只需通过 npm 全局安装官方核心引擎与 TUI launcher(仅数十 MB),即可直接运行:
36
55
 
37
56
  ```text
57
+ npm install --global @deepseek-ai/dsh
38
58
  npm install --global @crazyhappyone/dsh-tui@next
39
- dsh-tui version
40
- dsh-tui update
59
+ dsh-tui probe
41
60
  dsh-tui
42
61
  ```
43
62
 
44
- 安装 npm 包只会创建 launcher。它不会 clone DSH、运行 `pnpm install`、请求 Git 凭据或执行 postinstall script。显式执行 `dsh-tui update` 才会创建源码运行时;其默认 private 源码需要仓库授权。
63
+ 在此模式下,launcher 会自动探测全局 `dsh`,并挂载预构建的 TUI 扩展,无需克隆 2GB 的 monorepo 仓库。
64
+
65
+ ### 模式 B:源码模式(开发者调试)
66
+ 若需对 TUI 或 DSH 底层代码进行修改与调试:
67
+
68
+ ```text
69
+ npm install --global @crazyhappyone/dsh-tui@next
70
+ dsh-tui update
71
+ dsh-tui --source
72
+ ```
73
+
74
+ 显式执行 `dsh-tui update` 才会通过 Git 克隆源码并执行 `pnpm install`。可通过 `dsh-tui probe` 查看当前探测到的运行引擎。
45
75
 
46
76
  -----
47
77
 
@@ -132,30 +162,26 @@ Launcher runtime 必须与开发 checkout 分离。要安全测试其他源码
132
162
  <a id="publish-the-npm-package"></a>
133
163
  ## 发布 npm 包
134
164
 
135
- Operator 通过 npm browser flow 认证,并验证所选账号:
165
+ GitHub Actions 会在每个 pull request 和向 `main` 的 push 上使用 Node 22.19 与 24 运行测试。只有发布 GitHub Release 才会启动 npm 发布。工作流要求 Release tag 等于 `v` 加 `package.json` 中的版本;prerelease 发布到 npm `next` tag,stable release 发布到 `latest`。
136
166
 
137
- ```text
138
- npm config delete //registry.npmjs.org/:_authToken
139
- npm config set registry https://registry.npmjs.org/
140
- npm login --registry=https://registry.npmjs.org/ --auth-type=web
141
- npm whoami
142
- ```
143
-
144
- `npm whoami` 必须打印 `crazyhappyone`。绝不要把密码、OTP 或 npm token 放入本仓库、issue、供审查捕获的命令输出或 AI conversation。
145
-
146
- 测试与 packed-install 验证通过后,仅在 operator 显式批准时发布 prerelease:
167
+ 在 `publish.yml` 进入默认分支后,一次性配置 npm Trusted Publishing。npm CLI 11.5.1 或更高版本可以通过已认证的 browser session 注册 GitHub workflow。下面的命令会临时运行兼容的 npm 11,不替换全局安装的 npm:
147
168
 
148
169
  ```text
149
- npm publish --access public --tag next
170
+ npx --yes npm@11 trust github @crazyhappyone/dsh-tui \
171
+ --file publish.yml \
172
+ --repository zhangyang-crazy-one/dsh-tui \
173
+ --allow-publish
150
174
  ```
151
175
 
152
- npm 要求双因素认证时,operator 在本地提供当前验证码:
176
+ 对应的 npm 网站配置为:organization or user 填 `zhangyang-crazy-one`,repository 填 `dsh-tui`,workflow filename 填 `publish.yml`,environment 留空。工作流使用 GitHub OIDC,不保存 npm token、密码或 OTP。
177
+
178
+ 每次发布时,先提升 `package.json` 版本,等待 CI 通过并合并,然后创建 tag 与 package version 一致的 GitHub Release:
153
179
 
154
180
  ```text
155
- npm publish --access public --tag next --otp=<six-digit-code>
181
+ gh release create v0.1.0-alpha.4 --prerelease --generate-notes
156
182
  ```
157
183
 
158
- 提升到 `latest` 是单独的 release 决策。本地实现与验证绝不会自动创建或更改 registry package。
184
+ `Publish npm` workflow 会在发布前再次运行测试与 packed-package 验证。不要重新运行旧的 release tag:npm version 不可覆盖。提升到 stable 必须使用新版本并发布 non-prerelease GitHub Release。
159
185
 
160
186
  -----
161
187
 
package/bin/dsh-tui.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /** Command-line entry for the dsh-tui source-runtime launcher. */
3
3
 
4
- import { lstatSync, mkdirSync, readFileSync } from 'node:fs'
4
+ import { lstatSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
5
5
  import { constants, homedir } from 'node:os'
6
6
  import { fileURLToPath } from 'node:url'
7
7
  import { spawnSync } from 'node:child_process'
@@ -50,17 +50,21 @@ function signalOutcome(signal) {
50
50
 
51
51
  const manifest = JSON.parse(readFileSync(fileURLToPath(new URL('../package.json', import.meta.url)), 'utf8'))
52
52
 
53
+ const packageRoot = fileURLToPath(new URL('..', import.meta.url))
54
+
53
55
  try {
54
56
  const invocation = parseLauncherInvocation(process.argv.slice(2))
55
- const settings = resolveLauncherSettings({ env: process.env, homeDirectory: homedir() })
57
+ const settings = resolveLauncherSettings({ env: process.env, homeDirectory: homedir(), packageRoot })
56
58
  process.exitCode = runLauncher({
57
59
  invocation,
58
60
  settings,
59
61
  packageVersion: manifest.version,
62
+ env: process.env,
60
63
  adapters: {
61
64
  inspectPath,
62
65
  makeDirectory: path => mkdirSync(path, { recursive: true, mode: 0o700 }),
63
66
  readText: path => readFileSync(path, 'utf8'),
67
+ writeText: (path, content) => writeFileSync(path, content, 'utf8'),
64
68
  run,
65
69
  writeOut: text => process.stdout.write(text),
66
70
  writeError: text => process.stderr.write(text),
@@ -0,0 +1,91 @@
1
+ # The deepseek-tui bundle patch: terminal-surface mode directly over dsh-base.
2
+ # It mounts no Host, HTTP server, Web runtime, or browser plugin. An ordinary
3
+ # provider plugin parses --resume/--cwd and the task positional, then the
4
+ # terminal driver creates an Agent through the core registry and prints its
5
+ # durable result. Unlike the web surface, the agent plane stays process-wide:
6
+ # dsh-base keeps tool-bash/tool-fs/tool-todo and friends because the TUI is
7
+ # single-session and composes its agent process-wide.
8
+
9
+ - id: system-prompt
10
+ config:
11
+ persona: >-
12
+ You are a coding agent powered by the {{model}} model. Your working directory is {{cwd}}.
13
+ You are interacting with the user through the deepseek-tui terminal interface.
14
+
15
+ # The shared module-reload HMR row stays off; the launcher's watch-only
16
+ # fallback still keeps the user patch layers live until the run exits.
17
+ - id: hmr
18
+ disabled: true
19
+
20
+ - id: tools
21
+ config:
22
+ # Keep the same temporary process-wide Code Mode opt-in as the Web surface.
23
+ mode: !!js process.env.DSH_TOOLS_MODE
24
+
25
+ - id: approval
26
+ config:
27
+ policy: !!js "(process.env.DSH_PERMISSION_MODE ?? 'workspace-write') === 'danger-full-access' ? 'never' : 'ask'"
28
+
29
+ # Full-text session search stays disabled until the first Ctrl+K search (the
30
+ # base row's `openAt: never`). The TUI has no browser-latency concern, so the
31
+ # node:sqlite import and in-memory handle open lazily on first search.
32
+ - id: session-query-sqlite
33
+ config:
34
+ path: ':memory:'
35
+ openAt: first-search
36
+
37
+ - insert:
38
+ # Code Mode is a core execution capability, not a Web component.
39
+ - id: code-runtime
40
+ name: "@deepseek-ai/dsh-code-runtime-worker-thread"
41
+
42
+ # Per-round token/duration stats for the terminal status line.
43
+ - id: session-stats
44
+ name: "@deepseek-ai/dsh-session-stats"
45
+
46
+ # Base owns the shared storage/domain/projection-cache stack. This layer
47
+ # contributes only the TUI-facing feedback consumer over that stack.
48
+ - id: message-feedback
49
+ name: "@deepseek-ai/dsh-message-feedback"
50
+ config:
51
+ maxNoteBytes: 8192
52
+
53
+ - id: tool-ask-user
54
+ name: "@deepseek-ai/dsh-tool-ask-user"
55
+
56
+ - id: tui-startup
57
+ name: "@deepseek-ai/dsh-tui/startup"
58
+
59
+ # Reads its task from the ordinary tuiStartup provider.
60
+ - id: tui-runtime
61
+ name: "@deepseek-ai/dsh-tui"
62
+ inject: [tuiStartup]
63
+ config:
64
+ task: !!js ctx.tuiStartup.task
65
+ resume: !!js ctx.tuiStartup.resume
66
+ cwd: !!js ctx.tuiStartup.cwd
67
+ frameStats: !!js ctx.tuiStartup.frameStats
68
+ # Render policy (overscan + stream pacing + scroll pacing + cache budgets).
69
+ # Loaded by the runtime Config schema; the values below mirror the
70
+ # schema defaults so the deployment layer owns the tunables. Override
71
+ # here to retune without touching the plugin.
72
+ renderPolicy:
73
+ transcriptOverscan: 16
74
+ stream:
75
+ frameIntervalMs: 16
76
+ entryDepth: 64
77
+ exitDepth: 32
78
+ entryOldestAgeMs: 500
79
+ exitOldestAgeMs: 250
80
+ entryDrainBackpressureMs: 100
81
+ exitDrainBackpressureMs: 50
82
+ catchUpRowsPerFrame: 16
83
+ scroll:
84
+ frameIntervalMs: 16
85
+ stepPerFrame: 1
86
+ wheelRows: 3
87
+ catchUpThreshold: 10
88
+ maxCatchUpStep: 8
89
+ cache:
90
+ maxRows: 4096
91
+ maxBytes: 4194304