dsh-code 0.1.0 → 0.3.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.md +17 -4
- package/README.zh.md +17 -4
- package/cordis.patch.yml +22 -5
- package/lib/index.mjs +1888 -100
- package/lib/invariant.mjs +1 -1
- package/lib/startup.mjs +70 -0
- package/lib/types/app.d.ts +64 -9
- package/lib/types/approval.d.ts +57 -0
- package/lib/types/commands.d.ts +37 -0
- package/lib/types/index.d.ts +19 -7
- package/lib/types/invariant.d.ts +2 -2
- package/lib/types/mentions.d.ts +70 -0
- package/lib/types/models.d.ts +37 -0
- package/lib/types/questions.d.ts +48 -0
- package/lib/types/render/animations.d.ts +15 -0
- package/lib/types/render/markdown.d.ts +27 -0
- package/lib/types/render/projection.d.ts +37 -3
- package/lib/types/render/status.d.ts +4 -0
- package/lib/types/render/text.d.ts +18 -0
- package/lib/types/render/tool-preview.d.ts +15 -0
- package/lib/types/skills.d.ts +45 -0
- package/lib/types/startup.d.ts +44 -0
- package/lib/types/store.d.ts +8 -2
- package/lib/types/theme.d.ts +4 -0
- package/package.json +36 -3
- package/src/app.ts +971 -57
- package/src/approval.ts +126 -0
- package/src/commands.ts +71 -0
- package/src/index.ts +353 -40
- package/src/invariant.ts +3 -3
- package/src/mentions.ts +193 -0
- package/src/models.ts +66 -0
- package/src/questions.ts +143 -0
- package/src/render/animations.ts +22 -0
- package/src/render/markdown.ts +235 -0
- package/src/render/projection.ts +117 -10
- package/src/render/status.ts +14 -2
- package/src/render/text.ts +24 -0
- package/src/render/tool-preview.ts +34 -0
- package/src/skills.ts +104 -0
- package/src/startup.ts +91 -0
- package/src/store.ts +10 -4
- package/src/theme.ts +4 -0
package/README.md
CHANGED
|
@@ -7,9 +7,19 @@ A Claude-Code-style interactive terminal (TUI) bundle for [DeepSeek Harness](htt
|
|
|
7
7
|
## What you get
|
|
8
8
|
|
|
9
9
|
- DeepSeek-blue banner: the whale wordmark rasterized half-block from the exact FishLogo path, in a compact content-hugging header
|
|
10
|
-
- Live transcript streamed from the durable session log: user prompts, streaming assistant text, compact tool-call rows with running/done/error marks, todo snapshots
|
|
11
|
-
-
|
|
12
|
-
-
|
|
10
|
+
- Live transcript streamed from the durable session log: user prompts, streaming assistant text, compact tool-call and slash-command rows with running/done/error marks, todo snapshots
|
|
11
|
+
- **Tool approval y/n bar**: when the agent asks for permission (a sandbox escalation, a hook's `ask` decision), an amber bar shows the reason plus the paired command line; `y` allows once, `n` rejects
|
|
12
|
+
- **`/model` panel**: list every provider route the live `llm` registry advertises, switch the session's model for the next step; a resumed session restores its own last model
|
|
13
|
+
- **Session resume**: `--resume <id|prefix>` continues a persisted session, `--continue` picks the newest one for the working directory; the full transcript replays from the log and appends to the same durable session
|
|
14
|
+
- **Slash-command passthrough**: every command registered in the shared `ctx.commands` registry (the same surface the web composer dispatches) is executable from the terminal, with a completion menu on `/`; user-invocable skills join the same menu (marked `skill`), and an unknown `/name` falls through to the prompt so the host's skill injection picks it up
|
|
15
|
+
- **Todo panel**: the live todo list renders inline with done/active/pending counts and three-state markers, cleared at each fresh turn (mirroring the web TodoPanel)
|
|
16
|
+
- **Thinking lines**: model reasoning renders as a Claude-Code-style `✻` fold — collapsed to a dim marker with a character count, expanded to dim-italic text, live-streamed while the model thinks; Ctrl+R toggles globally
|
|
17
|
+
- **Terminal markdown**: assistant replies render through a pure GFM-subset renderer (headings, fenced/inline code, emphasis, lists, quotes, links) wrapped to the terminal width; streaming stays plain until the message settles
|
|
18
|
+
- **ask_user_question bar**: the model's questions appear as an option menu (↑/↓, space multi-select, `c` custom answer, Esc interrupts); plan reviews (`exit_plan_mode`) arrive through the same bar with the approve option highlighted
|
|
19
|
+
- **@ mentions**: `@` completion over workspace files and persisted sessions; session mentions expand into bounded read-only snapshots injected as sourced context before the prompt
|
|
20
|
+
- **Plan mode and permissions**: `⧉ plan` and `⛨ <preset>` badges in the status line; `/permission <name>` switches the session preset, Shift+Tab cycles through them (the registry's own `/plan` command enables plan mode)
|
|
21
|
+
- Input with history (↑/↓), cursor editing (←/→, Ctrl+A/E/U), Tab completion for slash commands, skills, and @ mentions; submitting while the agent runs steers the live turn (consumed at the next step boundary), `Esc` or Ctrl+C interrupts it, Ctrl+C on an empty idle input exits, Ctrl+D refuses to exit mid-turn
|
|
22
|
+
- A blended status line: Claude-Code-style identity facts (model, working directory, git branch, session, plan, permission preset) beside the web composer's figures (turns/steps, llm and tool wall time, cache hit, token totals)
|
|
13
23
|
|
|
14
24
|
## Install
|
|
15
25
|
|
|
@@ -24,7 +34,10 @@ dsh plugin --profile cli add file:C:/path/to/dsh-code # local checkout
|
|
|
24
34
|
Then:
|
|
25
35
|
|
|
26
36
|
```sh
|
|
27
|
-
dsh --profile cli
|
|
37
|
+
dsh --profile cli # fresh session
|
|
38
|
+
dsh --profile cli --continue # resume the newest session in this directory
|
|
39
|
+
dsh --profile cli --resume abc123 # resume by session id or unique prefix
|
|
40
|
+
dsh --profile cli --session my-id # fresh session under an explicit id
|
|
28
41
|
```
|
|
29
42
|
|
|
30
43
|
Set `DEEPSEEK_API_KEY` in your environment (or a `.env` in the launch directory or `$DSH_HOME`).
|
package/README.zh.md
CHANGED
|
@@ -7,9 +7,19 @@
|
|
|
7
7
|
## 功能
|
|
8
8
|
|
|
9
9
|
- DeepSeek 蓝横幅:鲸鱼字标由官方 FishLogo 精确路径半块栅格化,头部贴内容宽度、紧凑不占满
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
10
|
+
- 实时会话流:直接从持久会话日志投影——用户输入、流式助手文本、紧凑工具调用/斜杠命令行(运行/完成/出错标记)、todo 快照
|
|
11
|
+
- **工具审批 y/n 条**:agent 请求许可时(sandbox 升级、hook 的 ask 决策),琥珀色审批条显示原因与配对命令行;`y` 允许一次、`n` 拒绝
|
|
12
|
+
- **`/model` 面板**:列出 `llm` 注册表的全部 provider 路由,为下一步切换会话模型;恢复的会话自动还原其上次的模型
|
|
13
|
+
- **会话恢复**:`--resume <id|前缀>` 续接持久会话,`--continue` 取当前目录最新一个;完整转录从日志重放,续写同一持久会话
|
|
14
|
+
- **斜杠命令透传**:共享 `ctx.commands` 注册表(Web 作曲栏同一分发面)里的命令都可在终端执行,`/` 弹出补全菜单;用户可调用技能也进同一菜单(标注 `skill`),未知 `/name` 回退为普通提示词、由 host 的技能注入接管
|
|
15
|
+
- **todo 面板**:实时 todo 列表内联渲染,含 done/active/pending 计数与三态标记,每个新 turn 清空(对齐 Web TodoPanel)
|
|
16
|
+
- **思考行**:模型推理以 Claude Code 式 `✻` 折叠呈现——默认收起为 dim 标记 + 字符数,展开为 dim 斜体,模型思考时流式显示;Ctrl+R 全局切换
|
|
17
|
+
- **终端 markdown**:助手回复经纯 GFM 子集渲染器(标题/围栏与行内代码/强调/列表/引用/链接)按终端宽度排版;流式阶段保持纯文本直到消息落定
|
|
18
|
+
- **ask_user_question 问答条**:模型提问呈现为选项菜单(↑/↓ 移动、space 多选、`c` 自定义答案、Esc 中断);计划评审(exit_plan_mode)走同一条并高亮 approve 选项
|
|
19
|
+
- **@ 补全**:`@` 触发工作区文件与持久会话补全;会话引用展开为有界只读快照,以带来源的上下文注入到提示词之前
|
|
20
|
+
- **plan 与权限**:状态栏 `⧉ plan` 与 `⛨ <preset>` 徽章;`/permission <name>` 切换会话预设,Shift+Tab 循环切换(registry 自带的 `/plan` 命令启用 plan 模式)
|
|
21
|
+
- 输入组件:历史(↑/↓)、光标编辑(←/→、Ctrl+A/E/U)、斜杠命令/技能/@ 补全 Tab 补全;运行中提交即 steering(下一个 step 边界消费),`Esc` 或 Ctrl+C 中断本轮,Ctrl+C 在空闲空输入时退出,Ctrl+D 运行中拒绝退出
|
|
22
|
+
- 融合型状态栏:Claude Code 式身份信息(模型、工作目录、git 分支、会话、plan、权限预设)+ Web 作曲栏指标(轮数/步数、llm 与 tool 累计时长、缓存命中、token 总量)
|
|
13
23
|
|
|
14
24
|
## 安装
|
|
15
25
|
|
|
@@ -24,7 +34,10 @@ dsh plugin --profile cli add file:C:/path/to/dsh-code # 本地目录
|
|
|
24
34
|
然后:
|
|
25
35
|
|
|
26
36
|
```sh
|
|
27
|
-
dsh --profile cli
|
|
37
|
+
dsh --profile cli # 全新会话
|
|
38
|
+
dsh --profile cli --continue # 恢复本目录最新的会话
|
|
39
|
+
dsh --profile cli --resume abc123 # 按会话 id 或唯一前缀恢复
|
|
40
|
+
dsh --profile cli --session my-id # 以显式 id 建新会话
|
|
28
41
|
```
|
|
29
42
|
|
|
30
43
|
在环境变量(或启动目录 / `$DSH_HOME` 的 `.env`)里设置 `DEEPSEEK_API_KEY`。
|
package/cordis.patch.yml
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
# The dsh-
|
|
2
|
-
# It mounts no Host, HTTP server, or browser plugin.
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
1
|
+
# The dsh-code bundle patch: the interactive terminal app over dsh-base.
|
|
2
|
+
# It mounts no Host, HTTP server, or browser plugin. An ordinary provider
|
|
3
|
+
# plugin injects `cmdlineArgs`, parses this app's flags (`--resume`, `--continue`,
|
|
4
|
+
# `--session`) and its --help, then the runner creates (or resumes) one Agent
|
|
5
|
+
# through the core registry, renders the live session stream as an Ink TUI
|
|
6
|
+
# (DeepSeek blue, whale wordmark), answers approval asks with a y/n bar,
|
|
7
|
+
# dispatches slash commands through the shared registry, and folds submitted
|
|
8
|
+
# prompts back into the same durable session until the user quits.
|
|
6
9
|
|
|
7
10
|
- id: system-prompt
|
|
8
11
|
config:
|
|
@@ -24,5 +27,19 @@
|
|
|
24
27
|
- id: code-runtime
|
|
25
28
|
name: '@deepseek-ai/dsh-code-runtime-worker-thread'
|
|
26
29
|
|
|
30
|
+
# Cross-session @mentions: bounded read-only snapshots of other sessions
|
|
31
|
+
# as sourced model context. Opt-in upstream; the TUI's completion menu
|
|
32
|
+
# lists candidates and submission expands them through prepare().
|
|
33
|
+
- id: session-reference
|
|
34
|
+
name: '@deepseek-ai/dsh-session-reference'
|
|
35
|
+
|
|
36
|
+
- id: tui-startup
|
|
37
|
+
name: 'dsh-code/startup'
|
|
38
|
+
|
|
39
|
+
# Reads its startup through lazy config, which waits for the tuiStartup
|
|
40
|
+
# provider the row above publishes from the parsed command line.
|
|
27
41
|
- id: tui-runner
|
|
28
42
|
name: 'dsh-code'
|
|
43
|
+
inject: [tuiStartup]
|
|
44
|
+
config:
|
|
45
|
+
startup: !!js ctx.tuiStartup.startup
|