@crazyhappyone/dsh-tui 0.1.0-alpha.48 → 0.1.0-alpha.49

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.md CHANGED
@@ -62,6 +62,10 @@ dsh-tui
62
62
 
63
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
64
 
65
+ Detection checks an absolute `DSH_BIN` override, PATH, npm and pnpm global packages, then packages resolvable from the working directory and launcher directory. Each probe subprocess has a three-second timeout. A broken explicit `DSH_BIN` is reported without selecting another installation. Package bin entries run through the launcher's Node executable; probing establishes executability, not compatibility with older Harness releases.
66
+
67
+ Lightweight launch uses `dsh --profile tui --patch <bundled-patch>` with a custom `tui` profile containing only `@deepseek-ai/dsh-base` and `patchReload: startup`. Existing profile manifests are preserved. The patch supplies the terminal runtime; the current `headless` profile adds its own runner and is not used. This release composition follows Harness `0.1.6-alpha.2`.
68
+
65
69
  ### Mode B: Source Mode (Developer / Debugging)
66
70
  To debug or hack on TUI or DSH source directly:
67
71
 
@@ -86,7 +90,7 @@ dsh-tui
86
90
 
87
91
  Run `dsh-tui update` when you want to refresh the dedicated runtime before launching it again.
88
92
 
89
- Ordinary arguments pass to the `deepseek-tui` profile unchanged:
93
+ Ordinary arguments pass unchanged to `tui` in lightweight mode or `deepseek-tui` in source mode:
90
94
 
91
95
  ```text
92
96
  dsh-tui "review this repository"
@@ -179,6 +183,8 @@ The proxy listens on `127.0.0.1:4097` only; remove the `zen-proxy` row from
179
183
  <a id="development-workflow"></a>
180
184
  ## Development workflow
181
185
 
186
+ With the matching `../deepseek-harness` checkout and its build dependencies installed, run `npm run build`. This invokes its supported `scripts/build-dsh-tui-bundle.ts`, mirrors the TUI sources, validates bundle imports, and generates both release patches from `packages/tui/tui/cordis.patch.yml`, changing only bundled plugin paths. Run `npm test` and `npm run pack:check` before release.
187
+
182
188
  Implement TUI behavior in the complete DSH checkout, run the checks selected by the changed behavior, and export the confirmed `packages/tui/` tree here. Develop the launcher in this repository with `npm test`; test installation through a packed tarball rather than a workspace link.
183
189
 
184
190
  The launcher runtime must remain separate from the development checkout. To test against another source safely, point `DSH_TUI_RUNTIME_DIR` at a temporary absolute directory and configure `DSH_TUI_SOURCE_URL` and `DSH_TUI_SOURCE_REF`.
package/README.zh.md CHANGED
@@ -178,6 +178,12 @@ llm-pi-ai:
178
178
  <a id="development-workflow"></a>
179
179
  ## 开发工作流
180
180
 
181
+ 在相邻的 `../deepseek-harness` checkout 安装构建依赖后,运行 `npm run build`。该命令调用现有 `scripts/build-dsh-tui-bundle.ts`,镜像 TUI 源码并检查 bundle 导入,再从 `packages/tui/tui/cordis.patch.yml` 生成两份发布 patch,仅替换预构建插件的路径。发布前运行 `npm test` 和 `npm run pack:check`。
182
+
183
+ 轻量启动按绝对路径 `DSH_BIN`、PATH、npm/pnpm 全局包、工作目录和 launcher 目录可解析的本地包依次探测,每个探测子进程限时三秒;显式 `DSH_BIN` 失败时不会选择其他安装。包内 bin 使用当前 Node 执行,探测成功仅表示可执行,不保证旧版 Harness 兼容。
184
+
185
+ 轻量模式执行 `dsh --profile tui --patch <bundled-patch>`;首次创建的 `tui` profile 仅含 `@deepseek-ai/dsh-base`,设置 `patchReload: startup`,已有 manifest 保持不变。发布 patch 提供终端运行时,并与 Harness `0.1.6-alpha.2` 对齐。当前 `headless` profile 会添加独立 runner,因此不用于轻量启动;源码模式继续使用 `deepseek-tui`。
186
+
181
187
  在完整 DSH checkout 中实现 TUI 行为,运行受变更行为影响的检查,并将确认后的 `packages/tui/` tree 导出到这里。在本仓库中使用 `npm test` 开发 launcher;通过 packed tarball 测试安装,不使用 workspace link。
182
188
 
183
189
  Launcher runtime 必须与开发 checkout 分离。要安全测试其他源码,请将 `DSH_TUI_RUNTIME_DIR` 指向临时绝对目录,并配置 `DSH_TUI_SOURCE_URL` 与 `DSH_TUI_SOURCE_REF`。
package/bin/dsh-tui.js CHANGED
@@ -5,6 +5,8 @@ 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'
8
+ import { createRequire } from 'node:module'
9
+ import { join } from 'node:path'
8
10
  import { parseLauncherInvocation, resolveLauncherSettings, runLauncher } from '../src/launcher.js'
9
11
 
10
12
  function inspectPath(path) {
@@ -28,6 +30,8 @@ function run(command, args, options = {}) {
28
30
  env: process.env,
29
31
  maxBuffer: capture ? 16 * 1024 * 1024 : undefined,
30
32
  shell: false,
33
+ timeout: options.timeoutMs,
34
+ killSignal: 'SIGKILL',
31
35
  stdio: options.stdio === 'inherit' ? 'inherit' : capture ? ['ignore', 'pipe', 'pipe'] : 'inherit',
32
36
  })
33
37
  if (result.error !== undefined) {
@@ -61,6 +65,16 @@ try {
61
65
  packageVersion: manifest.version,
62
66
  env: process.env,
63
67
  adapters: {
68
+ nodeExecutable: process.execPath,
69
+ currentDirectory: process.cwd(),
70
+ resolveDshPackage(directory) {
71
+ try {
72
+ return createRequire(join(directory, 'package.json')).resolve('@deepseek-ai/dsh/package.json')
73
+ } catch (error) {
74
+ if (error.code === 'MODULE_NOT_FOUND') return undefined
75
+ throw error
76
+ }
77
+ },
64
78
  inspectPath,
65
79
  makeDirectory: path => mkdirSync(path, { recursive: true, mode: 0o700 }),
66
80
  readText: path => readFileSync(path, 'utf8'),
package/cordis.patch.yml CHANGED
@@ -1,30 +1,40 @@
1
+ # yaml-language-server: $schema=none
1
2
  # The deepseek-tui bundle patch: terminal-surface mode directly over dsh-base.
2
3
  # It mounts no Host, HTTP server, Web runtime, or browser plugin. An ordinary
3
4
  # provider plugin parses --resume/--cwd and the task positional, then the
4
5
  # terminal driver creates an Agent through the core registry and prints its
5
6
  # durable result. Unlike the web surface, the agent plane stays process-wide:
6
7
  # 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
+ # single-session and composes its agent process-wide. Insert and config rows
9
+ # resolve through the 0.1.6-alpha.2 runtime Loader; this file is not a
10
+ # compile-time plugin graph.
8
11
 
9
12
  - id: system-prompt
10
13
  config:
11
14
  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.
15
+ You are a coding agent powered by the {{model}} model.
16
+ Your working directory is {{cwd}}.
17
+ You are interacting with the user through the deepseek-tui
18
+ terminal interface.
14
19
 
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.
20
+ # HMR stays disabled. Profile and home patch edits apply on the next
21
+ # process start; /reload restarts the terminal with the current session.
17
22
  - id: hmr
18
23
  disabled: true
19
24
 
20
25
  - id: tools
21
26
  config:
22
27
  # Keep the same temporary process-wide Code Mode opt-in as the Web surface.
28
+ # pi-lens-ignore: YAML:0
23
29
  mode: !!js process.env.DSH_TOOLS_MODE
24
30
 
25
31
  - id: approval
32
+ # pi-lens-ignore: YAML:0
26
33
  config:
27
- policy: !!js "(process.env.DSH_PERMISSION_MODE ?? 'workspace-write') === 'danger-full-access' ? 'never' : 'ask'"
34
+ policy: !!js >-
35
+ (process.env.DSH_PERMISSION_MODE ?? 'workspace-write')
36
+ === 'danger-full-access'
37
+ ? 'never' : 'ask'
28
38
 
29
39
  # Full-text session search stays disabled until the first Ctrl+K search (the
30
40
  # base row's `openAt: never`). The TUI has no browser-latency concern, so the
@@ -34,36 +44,60 @@
34
44
  path: ':memory:'
35
45
  openAt: first-search
36
46
 
47
+ # Inherit the 0.1.6-alpha.2 llm-deepseek DEFAULT_MODELS catalog
48
+ # (`deepseek-flash`, `deepseek-v4-pro`). Do not re-list removed V4 Flash
49
+ # / V4 Flash Vision Exp ids here. Protocol stays Messages unless a PTY
50
+ # snapshot sets DSH_LLM_PROTOCOL=chat-completions for the mock server.
37
51
  - id: llm-deepseek
38
52
  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]
53
+ # pi-lens-ignore: YAML:0
54
+ protocol: !!js "process.env.DSH_LLM_PROTOCOL ?? 'messages'"
57
55
 
58
56
  - id: agent-default-model
59
57
  config:
58
+ # pi-lens-ignore: YAML:0
60
59
  provider: deepseek-official
61
- model: !!js "process.env.DSH_MODEL ?? 'deepseek-v4-flash'"
60
+ # pi-lens-ignore: YAML:0
61
+ model: !!js "process.env.DSH_MODEL ?? 'deepseek-flash'"
62
+
63
+ # pi-lens-ignore: YAML:0
64
+ - id: session-title-llm
65
+ name: "@deepseek-ai/dsh-session-title-first-prompt-llm"
66
+ config:
67
+ targetWords: 5
68
+ targetCjkCharacters: 10
69
+ maxInputBytes: 16384
70
+ maxOutputTokens: 64
71
+ timeoutMs: 60000
62
72
 
63
73
  - insert:
74
+ # Per-round token/duration stats for the terminal status line.
75
+ - id: session-stats
76
+ name: "@deepseek-ai/dsh-session-stats"
77
+
78
+ # Base owns the shared storage/domain/projection-cache stack. This layer
79
+ # contributes only the TUI-facing feedback consumer over that stack.
80
+ - id: message-feedback
81
+ name: "@deepseek-ai/dsh-message-feedback"
82
+ config:
83
+ maxNoteBytes: 8192
84
+
64
85
  - id: tool-ask-user
65
86
  name: "@deepseek-ai/dsh-tool-ask-user"
66
87
 
88
+ - id: tui-startup
89
+ name: "./dist/startup.js"
90
+
91
+ # Zero-config official OpenAI/Anthropic routes. They register
92
+ # openai-official / anthropic-official so they do not collide with the
93
+ # dormant llm-pi-ai catalog keys openai / anthropic that the Web Models
94
+ # page already owns.
95
+ - id: llm-openai
96
+ name: "@deepseek-ai/dsh-llm-openai"
97
+
98
+ - id: llm-anthropic
99
+ name: "@deepseek-ai/dsh-llm-anthropic"
100
+
67
101
  # In-process OpenCode Zen header proxy (vendored from
68
102
  # zhangyang-crazy-one/dsh-zen-proxy, MIT). Listens on localhost
69
103
  # only; point an opencode provider baseURL at
@@ -75,20 +109,33 @@
75
109
  host: 127.0.0.1
76
110
  port: 4097
77
111
 
78
- - id: tui-startup
79
- name: "./dist/startup.js"
112
+ # Records each top-level turn's changed files from git working-tree
113
+ # snapshots; the TUI projects a bounded transcript card from Host
114
+ # summaries. Bounds match the plugin Config defaults.
115
+ - id: workspace-changes
116
+ name: '@deepseek-ai/dsh-workspace-changes'
117
+ config:
118
+ timeoutMs: 30000
119
+ outputMaxBytes: 8388608
120
+ maxFiles: 500
121
+ maxFileBytes: 2097152
122
+ diffTimeoutMs: 100
80
123
 
81
124
  # Reads its task from the ordinary tuiStartup provider.
82
125
  - id: tui-runtime
126
+ # pi-lens-ignore: YAML:0
83
127
  name: "./dist/index.js"
84
128
  inject: [tuiStartup]
129
+ # pi-lens-ignore: YAML:0
85
130
  config:
131
+ # pi-lens-ignore: YAML:0
86
132
  task: !!js ctx.tuiStartup.task
87
133
  resume: !!js ctx.tuiStartup.resume
134
+ # pi-lens-ignore: YAML:0
88
135
  cwd: !!js ctx.tuiStartup.cwd
89
136
  model: !!js ctx.tuiStartup.model
90
137
  frameStats: !!js ctx.tuiStartup.frameStats
91
- # Render policy (overscan + stream pacing + scroll pacing + cache budgets).
138
+ # Render policy (overscan, stream pacing, scroll pacing, cache).
92
139
  # Loaded by the runtime Config schema; the values below mirror the
93
140
  # schema defaults so the deployment layer owns the tunables. Override
94
141
  # here to retune without touching the plugin.