@songtonyli/dsh-cli 0.1.43 → 0.1.44

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
@@ -26,7 +26,7 @@ workspace and no build step. Native packages that ship one build per platform
26
26
  ripgrep, the PTY backend's addons, sharp, koffi, and the Landlock launcher — are
27
27
  ordinary optional dependencies, so npm resolves the right one for your machine.
28
28
 
29
- Requires Node `^22.19.0 || >=24.0.0`. Version 0.1.43; `dsh --version`
29
+ Requires Node `^22.19.0 || >=24.0.0`. Version 0.1.44; `dsh --version`
30
30
  also reports the harness build the package was assembled from.
31
31
 
32
32
  ## License
package/bin/dsh.mjs CHANGED
@@ -18,7 +18,7 @@ const argv = process.argv.slice(2)
18
18
  // version this package publishes. Reporting only one of the two would make an
19
19
  // ordinary `npm install @songtonyli/dsh-cli@x` look like it installed something else.
20
20
  if (argv.length === 1 && (argv[0] === '--version' || argv[0] === '-V')) {
21
- console.log('@songtonyli/dsh-cli 0.1.43 (deepseek-harness 0.1.7-rc.2)')
21
+ console.log('@songtonyli/dsh-cli 0.1.44 (deepseek-harness 0.1.7-rc.2)')
22
22
  process.exit(0)
23
23
  }
24
24
 
@@ -47,10 +47,10 @@
47
47
  "micromark-extension-gfm": "^3.0.0",
48
48
  "micromark-util-sanitize-uri": "^2.0.1",
49
49
  "simple-icons": "16.31.0",
50
- "@deepseek-ai/dsh-util-code-language": "0.1.7-rc.2",
51
- "@deepseek-ai/dsh-util-workspace-path": "0.1.7-rc.2",
52
50
  "@deepseek-ai/dsh-client-store": "0.1.7-rc.2",
53
- "@deepseek-ai/cordis": "~4.0.4"
51
+ "@deepseek-ai/dsh-util-code-language": "0.1.7-rc.2",
52
+ "@deepseek-ai/cordis": "~4.0.4",
53
+ "@deepseek-ai/dsh-util-workspace-path": "0.1.7-rc.2"
54
54
  },
55
55
  "files": [
56
56
  "lib/index.js",
@@ -167,7 +167,7 @@ window.__ModuleLoader__.load({
167
167
  const SCROLLBAR_LINGER_MS = 2e3;
168
168
  /** Format complete-build metadata for the local brand badge. */
169
169
  function localBuildVersion() {
170
- return `0.1.7-rc.2-67d7f99` + ({}.DSH_CLIENT_GIT_DIRTY === "true" ? "-dirty" : "");
170
+ return `0.1.7-rc.2-c9b1f41` + ({}.DSH_CLIENT_GIT_DIRTY === "true" ? "-dirty" : "");
171
171
  }
172
172
  /** Each panel row subscribes only to its own selection state. */
173
173
  function PanelRow({ id, label, wide, usePanelInfo, selectPanel, renderSlot }) {
@@ -193,6 +193,7 @@ Typing `/` at the start of the editor completes the terminal's own commands and
193
193
  | `/plugins` | The composed plugins with enablement and lifecycle phase; `/plugins bundles` lists the profile's bundles, `/plugins enable <id>` and `/plugins disable <id>` switch a plugin entry or a bundle, `/plugins add <spec>` installs a bundle, `/plugins remove <name>` removes one |
194
194
  | `/tools` | Expand or collapse every tool card and context row, like `Ctrl+O` |
195
195
  | `/turns` | Read the conversation full screen, turns side by side, like `Ctrl+G` |
196
+ | `/btw <question>` | Ask one side question about this session. The answer opens on its own page and is not added to the conversation; the running turn keeps going, and the question cannot use tools |
196
197
  | `/quit`, `/exit` | Save the session and exit |
197
198
 
198
199
  Every other `/name` line goes to the shared command registry, so `/compact`, `/goal`, and plugin commands work as they do in the browser.
@@ -277,6 +278,8 @@ The patch rides over `dsh-base`: it sets the coding persona prefix and cwd suffi
277
278
  | [`src/frame.ts`](src/frame.ts) | Pure box drawing: the rounded rules, the inverse mode chip, body rows, and the legend step a width holds |
278
279
  | [`src/reader.ts`](src/reader.ts) | The reader as plain data: its state, the intents keys become, its geometry, and the lines it draws |
279
280
  | [`src/reader-screen.ts`](src/reader-screen.ts) | The reader pane drawn on the alternate screen: its key map, and where it leaves the keyboard |
281
+ | [`src/btw.ts`](src/btw.ts) | `/btw`: one tool-free request built from the bound session's derived history, never logged |
282
+ | [`src/btw-screen.ts`](src/btw-screen.ts) | The `/btw` answer page drawn on the alternate screen |
280
283
  | [`src/screen.ts`](src/screen.ts) | The main screen with the page margins every frame is laid out and drawn inside, the settle passes between building a frame and writing it, the repaint window each pass is judged against, the per-block repaint floor, and the suspension that holds the conversation off the terminal |
281
284
  | [`src/alt-screen.ts`](src/alt-screen.ts) | The terminal's alternate screen: taking it, drawing absolutely addressed rows on it, and giving the conversation's own screen back |
282
285
  | [`src/fade.ts`](src/fade.ts) | The streamed-text fade: the wall-clock tail tracker, the block-fade clock and registry, the fade-in ramp, the float-out mix, and the recolor of rendered lines |
@@ -375,6 +378,20 @@ Conditional and retained: each `!` notice stays in conversation history for late
375
378
 
376
379
  Append-only conversation growth after the reusable request prefix. The notice does not change the system prompt or tool catalog. A `/model` switch starts a new request series exactly as it does from the browser.
377
380
 
381
+ ### Side question
382
+
383
+ #### What the model sees
384
+
385
+ `/btw <question>` sends one extra request through `ctx.llm.stream` and does not append it to the session. The system text is fixed: the model answers one side question, is not the agent in the conversation, and cannot call tools or continue that agent's task. The messages are the bound session's derived history, the visible reply still streaming when there is one, and the question as the last user message. No tools are declared. The running turn is not steered, queued, or cancelled. The answer is drawn on the alternate screen. Text the main agent sees on its next step is unchanged.
386
+
387
+ #### Token effect
388
+
389
+ One additional model request per `/btw`. Nothing from that request or its answer is retained in later agent requests.
390
+
391
+ #### KV Cache effect
392
+
393
+ The side request does not change the agent loop's system prompt, tool catalog, or conversation prefix.
394
+
378
395
  ## Known Limitations and Deferred Work
379
396
 
380
397
  <a id="known-limitations-and-deferred-work"></a>
@@ -398,6 +415,7 @@ These limits describe the terminal surface as shipped; they are not a general CL
398
415
  - **The fade needs an answer from the terminal** — its ramp is built from the background color the terminal reports to the query sent at startup, so a terminal that stays silent, or that encodes neither truecolor nor 256 colors, gets the two-level faint mode instead; `NO_COLOR`, a disabled palette, `TERM=dumb`, and `reducedMotion` turn every fade and every chrome lift off entirely, and a transient line then disappears at the end of its hold instead of fading out.
399
416
  - **The terminal's own caret can flicker** — the editor draws no caret of its own and the app turns the terminal cursor on, which pi-tui then moves across the lines it repaints; a terminal that does not honor the synchronized-output sequences pi-tui wraps a frame in can show that movement.
400
417
  - **Runs through the `dsh` launcher** — starting the profile another way fails at startup, because only the launcher can request the process exit.
418
+ - **`/btw` is a terminal page, not a turn** — the answer is not stored in the session, Web has no `/btw`, and the request sees derived history plus the visible reply still streaming. Tool arguments that are not logged yet are absent. The page cannot run tools.
401
419
  - **`!` is one-shot and not a TTY** — each line is a fresh `ctx.shell.run`; there is no persistent shell or interactive program. The Web composer does not intercept `!`. An optional first prompt on the command line is always a user message.
402
420
 
403
421
  <a id="dev-note"></a>
@@ -193,6 +193,7 @@ follow-ups 面板持有键盘时:
193
193
  | `/plugins` | 已组合的插件及其启用状态与生命周期阶段;`/plugins bundles` 列出 profile 的组合包,`/plugins enable <id>` 与 `/plugins disable <id>` 切换某个插件条目或组合包,`/plugins add <spec>` 安装组合包,`/plugins remove <name>` 移除组合包 |
194
194
  | `/tools` | 像 `Ctrl+O` 一样展开或折叠所有工具卡片与上下文行 |
195
195
  | `/turns` | 像 `Ctrl+G` 一样整屏读出对话记录,各轮次并排 |
196
+ | `/btw <question>` | 就本会话提一个旁边问题。答案打开在自己的页面上,不进入对话记录;正在进行的轮次继续,该问题也不能使用工具 |
196
197
  | `/quit`、`/exit` | 保存会话并退出 |
197
198
 
198
199
  其他每条 `/name` 行都交给共享命令注册表,因此 `/compact`、`/goal` 与插件命令的行为和浏览器中一致。
@@ -277,6 +278,8 @@ runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心
277
278
  | [`src/frame.ts`](src/frame.ts) | 纯粹的画框:圆角边框线、反白的模式徽标、正文行,以及某个宽度容纳得下的按键提示级别 |
278
279
  | [`src/reader.ts`](src/reader.ts) | 作为纯数据的阅读器:其状态、按键变成的各个意图、其几何布局,以及它画出的各行 |
279
280
  | [`src/reader-screen.ts`](src/reader-screen.ts) | 画在备用屏幕上的阅读器面板:其按键映射,以及它把键盘留在何处 |
281
+ | [`src/btw.ts`](src/btw.ts) | `/btw`:用已绑定会话的派生历史构造一次不带工具的请求,且不写入日志 |
282
+ | [`src/btw-screen.ts`](src/btw-screen.ts) | 画在备用屏幕上的 `/btw` 答案页 |
280
283
  | [`src/screen.ts`](src/screen.ts) | 每一帧据以排版与绘制的页边距、在构建一帧与写出该帧之间带若干次结算的主屏幕、每次结算所依据的重绘窗口、每个块的重绘下界,以及把对话记录挡在终端之外的挂起 |
281
284
  | [`src/alt-screen.ts`](src/alt-screen.ts) | 终端的备用屏幕:接管它、在其上按绝对行址绘制,以及把对话记录自己的屏幕交还 |
282
285
  | [`src/fade.ts`](src/fade.ts) | 流式文本淡入与浮出:基于挂钟的尾部追踪器、块时钟与注册表、淡入亮度级别、浮出混合,以及对已渲染行的重新着色 |
@@ -375,6 +378,20 @@ The user ran `<command>` in the terminal.
375
378
 
376
379
  在可复用的请求前缀之后只做追加式增长。该通知不改变系统提示或工具目录。`/model` 切换像在浏览器中一样开始新的请求序列。
377
380
 
381
+ ### 旁边问题
382
+
383
+ #### 模型看到什么
384
+
385
+ `/btw <question>` 经 `ctx.llm.stream` 多发一次请求,且不写入会话。系统文本是固定的:模型回答一个旁边问题,不是对话里的那个 agent,也不能调用工具或继续该 agent 的任务。消息是已绑定会话的派生历史、仍在流式输出的可见回复(若有),以及作为最后一条用户消息的问题。不声明工具。正在进行的轮次不会被导向、入队或取消。答案画在备用屏幕上。主 agent 下一步看到的文本不变。
386
+
387
+ #### Token 影响
388
+
389
+ 每次 `/btw` 多一次模型请求。该请求及其答案都不会留在之后的 agent 请求中。
390
+
391
+ #### KV Cache 影响
392
+
393
+ 旁边请求不改变 agent 循环的系统提示、工具目录或对话前缀。
394
+
378
395
  ## 已知限制与延期工作
379
396
 
380
397
  <a id="known-limitations-and-deferred-work"></a>
@@ -398,6 +415,7 @@ The user ran `<command>` in the terminal.
398
415
  - **淡入需要终端的应答**——其亮度级别由终端对启动时发出的查询所报告的背景色构建,因此保持沉默、或既不编码真彩色也不编码 256 色的终端只会得到两级的暗淡模式;`NO_COLOR`、被禁用的调色板、`TERM=dumb` 与 `reducedMotion` 会完全关闭每一种淡入与每一种边框抬亮,临时提示行届时在保持结束时直接消失,而不是淡出。
399
416
  - **终端自身的光标可能闪烁**——编辑器不绘制自己的光标,应用打开终端光标,而 pi-tui 会在其重绘的各行之间移动它;不支持 pi-tui 为一帧包裹的同步输出序列的终端可能显示出这种移动。
400
417
  - **通过 `dsh` 启动器运行**——以其他方式启动该 profile 会在启动时失败,因为只有启动器能请求进程退出。
418
+ - **`/btw` 是终端页面,不是一轮**——答案不写入会话,Web 没有 `/btw`,请求看到的是派生历史加上仍在流式输出的可见回复。尚未写入日志的工具参数不在其中。该页面不能运行工具。
401
419
  - **`!` 是一次性的,也不是 TTY**——每一行都是一次新的 `ctx.shell.run`;没有持久 shell,也不能跑交互式程序。Web 编辑器不拦截 `!`。命令行上的可选首条提示始终是用户消息。
402
420
 
403
421
  <a id="dev-note"></a>