@crazyhappyone/dsh-tui 0.1.0-alpha.4 → 0.1.0-alpha.40

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: 496d812168deb2af7d4a933f961b58c1cfd814cd
5
- README.zh.md: 8474c7be4cf16c0d5123222bab95b5231f34e185
4
+ README.md: 9edd0d7b9c067fc810fa59fc53525eed8be07dd9
5
+ README.zh.md: 9f4e419aeb64eb7e676b7763caa9b69e835cf0dd
package/README.md CHANGED
@@ -33,9 +33,9 @@ English | [中文](README.zh.md)
33
33
  <a id="screenshots"></a>
34
34
  ## Screenshots
35
35
 
36
- Idle home:
36
+ Interactive settings pane (`/settings`):
37
37
 
38
- ![dsh-tui idle home](assets/screenshots/dsh-tui-home.png)
38
+ ![dsh-tui settings pane](assets/screenshots/dsh-tui-settings.png)
39
39
 
40
40
  After sending `你好`:
41
41
 
@@ -44,22 +44,34 @@ After sending `你好`:
44
44
  -----
45
45
 
46
46
  <a id="install-the-launcher"></a>
47
- ## Install the launcher
47
+ ## Install the launcher and runtime modes
48
48
 
49
49
  The unscoped `dsh-tui` package belongs to another maintainer. This project publishes only under the authenticated `crazyhappyone` npm scope.
50
50
 
51
- 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:
52
52
 
53
- 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):
54
55
 
55
56
  ```text
57
+ npm install --global @deepseek-ai/dsh
56
58
  npm install --global @crazyhappyone/dsh-tui@next
57
- dsh-tui version
58
- dsh-tui update
59
+ dsh-tui probe
59
60
  dsh-tui
60
61
  ```
61
62
 
62
- 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.
63
75
 
64
76
  -----
65
77
 
package/README.zh.md CHANGED
@@ -33,9 +33,9 @@ kind: "package-group"
33
33
  <a id="screenshots"></a>
34
34
  ## 截图
35
35
 
36
- 空闲首页:
36
+ 交互式设置面板(`/settings`):
37
37
 
38
- ![dsh-tui 空闲首页](assets/screenshots/dsh-tui-home.png)
38
+ ![dsh-tui 设置面板](assets/screenshots/dsh-tui-settings.png)
39
39
 
40
40
  发送 `你好` 后:
41
41
 
@@ -44,22 +44,34 @@ kind: "package-group"
44
44
  -----
45
45
 
46
46
  <a id="install-the-launcher"></a>
47
- ## 安装 launcher
47
+ ## 安装 launcher 与运行模式
48
48
 
49
49
  无 scope 的 `dsh-tui` 包属于另一位 maintainer。本项目只在已认证的 `crazyhappyone` npm scope 下发布。
50
50
 
51
- Launcher 需要 Git、pnpm 与 DSH 支持的 Node 版本。无需单独安装 `@deepseek-ai/dsh`,launcher 也不会使用它:`dsh-tui` 始终从专用源码 checkout 运行 `deepseek-tui` profile。
51
+ `dsh-tui` 支持两种运行模式:
52
52
 
53
- 安装 prerelease 并完成首次启动:
53
+ ### 模式 A:轻量模式(推荐,零 Clone 秒开)
54
+ 只需通过 npm 全局安装官方核心引擎与 TUI launcher(仅数十 MB),即可直接运行:
54
55
 
55
56
  ```text
57
+ npm install --global @deepseek-ai/dsh
56
58
  npm install --global @crazyhappyone/dsh-tui@next
57
- dsh-tui version
58
- dsh-tui update
59
+ dsh-tui probe
59
60
  dsh-tui
60
61
  ```
61
62
 
62
- 安装 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` 查看当前探测到的运行引擎。
63
75
 
64
76
  -----
65
77
 
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,103 @@
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
+ - id: llm-deepseek
38
+ config:
39
+ models:
40
+ - id: deepseek-v4-flash
41
+ name: DeepSeek-V4-Flash
42
+ description: Fast, efficient, and economical; suited to focused, routine, or parallel tasks.
43
+ contextWindow: 1000000
44
+ - id: deepseek-v4-pro
45
+ name: DeepSeek-V4-Pro
46
+ description: Stronger agentic coding, knowledge, and difficult reasoning; suited to complex or quality-critical tasks at higher cost.
47
+ contextWindow: 1000000
48
+ - id: deepseek-v4-flash-vision-exp
49
+ name: DeepSeek-V4-Flash-Vision-Exp
50
+ contextWindow: 1000000
51
+ inputModalities: [text, image]
52
+ - id: deepseek-v4.1-flash-expires-on-0910
53
+ name: DeepSeek-V4.1-Flash
54
+ description: DeepSeek V4.1 Flash intermediate beta with native multimodal support, higher capability, faster speed, and lower cost.
55
+ contextWindow: 1000000
56
+ inputModalities: [text, image]
57
+
58
+ - id: agent-default-model
59
+ config:
60
+ provider: deepseek-official
61
+ model: !!js "process.env.DSH_MODEL ?? 'deepseek-v4-flash'"
62
+
63
+ - insert:
64
+ - id: tool-ask-user
65
+ name: "@deepseek-ai/dsh-tool-ask-user"
66
+
67
+ - id: tui-startup
68
+ name: "./dist/startup.js"
69
+
70
+ # Reads its task from the ordinary tuiStartup provider.
71
+ - id: tui-runtime
72
+ name: "./dist/index.js"
73
+ inject: [tuiStartup]
74
+ config:
75
+ task: !!js ctx.tuiStartup.task
76
+ resume: !!js ctx.tuiStartup.resume
77
+ cwd: !!js ctx.tuiStartup.cwd
78
+ model: !!js ctx.tuiStartup.model
79
+ frameStats: !!js ctx.tuiStartup.frameStats
80
+ # Render policy (overscan + stream pacing + scroll pacing + cache budgets).
81
+ # Loaded by the runtime Config schema; the values below mirror the
82
+ # schema defaults so the deployment layer owns the tunables. Override
83
+ # here to retune without touching the plugin.
84
+ renderPolicy:
85
+ transcriptOverscan: 16
86
+ stream:
87
+ frameIntervalMs: 16
88
+ entryDepth: 64
89
+ exitDepth: 32
90
+ entryOldestAgeMs: 500
91
+ exitOldestAgeMs: 250
92
+ entryDrainBackpressureMs: 100
93
+ exitDrainBackpressureMs: 50
94
+ catchUpRowsPerFrame: 16
95
+ scroll:
96
+ frameIntervalMs: 16
97
+ stepPerFrame: 1
98
+ wheelRows: 3
99
+ catchUpThreshold: 10
100
+ maxCatchUpStep: 8
101
+ cache:
102
+ maxRows: 4096
103
+ maxBytes: 4194304