@songtonyli/dsh-cli 0.1.23 → 0.1.24
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 +1 -1
- package/bin/dsh.mjs +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/package.json +2 -2
- package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tui-app/README.md +21 -8
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +21 -8
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +265 -20
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/package.json +2 -17
- package/package.json +2 -2
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.
|
|
29
|
+
Requires Node `^22.19.0 || >=24.0.0`. Version 0.1.24; `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.
|
|
21
|
+
console.log('@songtonyli/dsh-cli 0.1.24 (deepseek-harness 0.1.6-alpha.2)')
|
|
22
22
|
process.exit(0)
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -160,7 +160,7 @@ window.__ModuleLoader__.load({
|
|
|
160
160
|
const SCROLLBAR_LINGER_MS = 2e3;
|
|
161
161
|
/** Format complete-build metadata for the local brand badge. */
|
|
162
162
|
function localBuildVersion() {
|
|
163
|
-
return `0.1.6-alpha.2-
|
|
163
|
+
return `0.1.6-alpha.2-5f4682c-dirty`;
|
|
164
164
|
}
|
|
165
165
|
/** Each panel row subscribes only to its own selection state. */
|
|
166
166
|
function PanelRow({ id, label, wide, usePanelInfo, selectPanel, renderSlot }) {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/react": "~18.3.1",
|
|
27
|
-
"@deepseek-ai/
|
|
28
|
-
"@deepseek-ai/
|
|
27
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
28
|
+
"@deepseek-ai/dsh-client-store": "^0.1.6-alpha.2"
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
31
|
"lib/index.js",
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/bundle/tui-app/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 11567568640439cc4ecb48ce7aa37c31615e58c1
|
|
6
|
+
README.zh.md: 85d202e1ca040030921db665b0b5bc44b8ce83ed
|
|
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
`dsh-tui-app` is the terminal surface of dsh: `dsh tui` starts a multi-turn session in your terminal, with no browser and no server. Replies stream, tool calls become foldable cards, approvals and `ask_user_question` questions appear above the input, `@` completes paths and sessions, and `/`-commands share the Web registry. Arrow keys walk the conversation through a docked inspector; `Ctrl+G` reads it full screen, turns side by side. Persisted sessions reopen through `/resume`, `/sessions`, or startup `--resume`; `/new
|
|
12
|
+
`dsh-tui-app` is the terminal surface of dsh: `dsh tui` starts a multi-turn session in your terminal, with no browser and no server. Replies stream, tool calls become foldable cards, approvals and `ask_user_question` questions appear above the input, `@` completes paths and sessions, and `/`-commands share the Web registry. Arrow keys walk the conversation through a docked inspector; `Ctrl+G` reads it full screen, turns side by side. Persisted sessions reopen through `/resume`, `/sessions`, or startup `--resume`; `/new`, `/clear`, and `/fork` create them, and `/export` writes ZIPs. It runs `dsh web`'s model, tools, and safety defaults, one session at a time.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
|
@@ -36,13 +36,13 @@ dsh tui --resume <session-id> # continue an earlier session
|
|
|
36
36
|
dsh tui --no-open # print sign-in URLs without opening a browser
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
On quit the app prints `dsh: session <id> saved; resume with: dsh --profile tui --resume <id>` on stderr for the session bound at that moment. A resumed session redraws its persisted history before accepting input; inside the terminal, `/resume` and `/sessions` open the same picker over every persisted root session and resume the selected previous session, `/new`
|
|
39
|
+
On quit the app prints `dsh: session <id> saved; resume with: dsh --profile tui --resume <id>` on stderr for the session bound at that moment. A resumed session redraws its persisted history before accepting input; inside the terminal, `/resume` and `/sessions` open the same picker over every persisted root session and resume the selected previous session, `/new` and `/clear` each start a fresh empty one while the previous session stays on disk for `/resume`, and `/fork` copies the current session up to its last completed turn into a new one, the same cut the browser's fork takes. Switching releases the previous Agent and redraws the transcript of the next.
|
|
40
40
|
|
|
41
41
|
### The screen
|
|
42
42
|
|
|
43
|
-
The header names the session by its title once one is generated or set, with the id beside it. The transcript grows in the terminal's own scrollback: your prompts start with `›` (attachments listed under them), assistant reasoning is dim above the Markdown reply, and each tool call is a card with a status glyph, the tool name, the presenter headline, and a body folded to `toolPreviewLines` rows. A nonempty system prompt and each injected context — instructions, catalogs, snapshots, notices, relays, and recalls — draw as a dim `⬡` title over the first `contextPreviewLines` rows of their model-facing text, with each snapshot contribution named above its own rows; an empty system prompt and a compaction replacement are omitted. A tool card and a context block that carry more rows than they draw end on one marker: `… <n> more rows · Space expands` while the conversation's focus holds that block, and `… <n> more rows · Ctrl+O expands` otherwise. Fenced code in a reply, the file rows of a `read` card, and the changed rows of an `edit` or `write` diff card —
|
|
43
|
+
The header names the session by its title once one is generated or set, with the id beside it. The transcript grows in the terminal's own scrollback: your prompts start with `›` (attachments listed under them), assistant reasoning is dim above the Markdown reply, and each tool call is a card with a status glyph, the tool name, the presenter headline, and a body folded to `toolPreviewLines` rows. A nonempty system prompt and each injected context — instructions, catalogs, snapshots, notices, relays, and recalls — draw as a dim `⬡` title over the first `contextPreviewLines` rows of their model-facing text, with each snapshot contribution named above its own rows; an empty system prompt and a compaction replacement are omitted. A tool card and a context block that carry more rows than they draw end on one marker: `… <n> more rows · Space expands` while the conversation's focus holds that block, and `… <n> more rows · Ctrl+O expands` otherwise. Fenced code in a reply, the file rows of a `read` card, and the changed rows of an `edit` or `write` diff card — with `+` additions marked green, `-` removals red, and source text behind those signs drawn in the language the file's extension names — use syntax colours from a theme the terminal's own background picks, light or dark; the grammar of a language loads on the first block that asks for it, so that block draws plain and is repainted in colour a moment later, and a language with no grammar here, a terminal that reports neither 24-bit nor 256 colours, and `codeHighlight: false` each draw every block plain. Streamed reply text fades in and every word keeps its own clock: a word enters near the terminal's background color and brightens to the color it settles in over `streamFadeSteps` ticks of `streamFadeStepMs` each, so a fast stream leaves a longer trail of brightening words rather than a darker one. Streamed reasoning and a tool card float out over the same duration: they appear at a lifted color and recede to the dim italic or palette colors they settle in; a card redrawn from persisted history carries no fade, and text that has settled is never dimmed again.
|
|
44
44
|
|
|
45
|
-
Below the transcript sit a spinner while the agent works, any open prompt, the editor, the subagent panel, and the footer: a status bar that, unfocused, is one line built from both ends inward. The editor's caret is the terminal's own blinking bar: the app asks for that shape at start, gives your default back on quit, and draws no caret at all while the status bar or the panel holds the keyboard. The model is anchored at the left edge and is never dropped — past 20 columns it falls back to the bare model name, and only a label still too wide for that is ellipsized — and the two keys that leave the input are anchored at the right edge as `Shift+↑ read · Shift+↓ status`, narrowing to `Shift+↑↓ nav` and dropped below 40 columns. The key facts fill whatever middle is left, in bar order: effort (`effort default` when the selection leaves reasoning to the model), the running turn's elapsed time, the context window percentage, the todo counts, and the workspace path (shortened with `~` and `…/` when long). Every segment that middle cannot hold folds into a trailing `+N`, together with the segments the unfocused line never draws — the permission preset, cumulative token usage, the goal and plan-mode markers from the projection seam, and the count of pending attachments. Compaction and model-request retries appear as notices, the same facts the browser's markers carry.
|
|
45
|
+
Below the transcript sit a spinner while the agent works, any open prompt, a framed pending-prompt panel while messages wait, the editor, the subagent panel, and the footer: a status bar that, unfocused, is one line built from both ends inward. The editor's caret is the terminal's own blinking bar: the app asks for that shape at start, gives your default back on quit, and draws no caret at all while the status bar or the panel holds the keyboard. The model is anchored at the left edge and is never dropped — past 20 columns it falls back to the bare model name, and only a label still too wide for that is ellipsized — and the two keys that leave the input are anchored at the right edge as `Shift+↑ read · Shift+↓ status`, narrowing to `Shift+↑↓ nav` and dropped below 40 columns. The key facts fill whatever middle is left, in bar order: effort (`effort default` when the selection leaves reasoning to the model), the running turn's elapsed time, the context window percentage, the todo counts, and the workspace path (shortened with `~` and `…/` when long). Every segment that middle cannot hold folds into a trailing `+N`, together with the segments the unfocused line never draws — the permission preset, cumulative token usage, the goal and plan-mode markers from the projection seam, and the count of pending attachments. Compaction and model-request retries appear as notices, the same facts the browser's markers carry.
|
|
46
46
|
|
|
47
47
|
While the keyboard walks the conversation a framed inspector is docked directly above the editor, and the frame is the mode: it is drawn exactly while the conversation holds the keyboard. Its top rule carries an inverse ` ● READ ` chip and the focused section's heading — the section's position among the navigable blocks, the turn it belongs to, and what the section is — as in `╭ ● READ ─ 3/12 · turn 2 · bash git status · result ─╮`. Under it the block's parts draw as a numbered wrapping strip like `← 1 call · [2 result] →` when the block has more than one, the held label bracketed as well as accented so the selection is legible with no color at all; then the section's own source rows, each prefixed with `│ ` and wrapped two columns narrower, folded at `focusPreviewLines` for every section kind — a system prompt and an injected context included — with `… <n> more rows · Ctrl+G reads it` under them. The bottom rule carries the keys the conversation answers, `↑↓ sections · ←→ parts · Space folds · Ctrl+G reader · Esc input`, narrowed to `↑↓ ←→ · Space folds · Esc input` and then to `Esc input` as the terminal loses columns.
|
|
48
48
|
|
|
@@ -58,13 +58,13 @@ The subagent panel is drawn while a subagent session under the bound one is resi
|
|
|
58
58
|
|
|
59
59
|
### Keys and commands
|
|
60
60
|
|
|
61
|
-
The conversation,
|
|
61
|
+
The conversation, input, subagent panel, and status bar form the vertical arrow-key walk: `Down` at the newest section, `Up` on the subagent panel's first row, and `Up` on the status bar with no subagent panel drawn all land at the caret. The queued-prompt panel sits above the input; `Shift+Down` enters it while it is drawn, and it joins the `Tab` walk. While a region other than the editor has the keyboard, `Tab` and `Shift+Tab` walk the regions that are drawn, wrapping at both ends; in the editor, `Tab` takes the offered completion and `Shift+Tab` opens the reasoning-effort picker. A printable key pressed in any of them returns to the input and types there, so a sentence started while reading lands where it was aimed; `Space` in the conversation is the one exception, and folds the marked tool card or context block. `Ctrl+G` and `Ctrl+O` mean the same thing in every one of those regions, and `Ctrl+C` and `Ctrl+D` return the keyboard to the input before they act. A prompt and the reader own their whole key stream instead, and answer `Ctrl+C` by giving the keyboard back.
|
|
62
62
|
|
|
63
63
|
While the input has the keyboard:
|
|
64
64
|
|
|
65
65
|
| Key | Effect |
|
|
66
66
|
|---|---|
|
|
67
|
-
| `Enter` | Send the editor text; while a turn runs it
|
|
67
|
+
| `Enter` | Send the editor text; while a turn runs it waits for the next turn in the framed `QUEUE` panel above the editor until the loop claims it, entering the conversation then |
|
|
68
68
|
| `Shift+Enter` | Insert a newline |
|
|
69
69
|
| `Ctrl+S` | While a turn runs, steer the editor text into the running turn's next step |
|
|
70
70
|
| `Up` / `Down` | Recall earlier prompts |
|
|
@@ -72,7 +72,7 @@ While the input has the keyboard:
|
|
|
72
72
|
| `Tab` | Take the completion the editor offers |
|
|
73
73
|
| `Shift+Tab` | Open the current model's reasoning-effort picker for the next request, the same picker as empty `/effort` |
|
|
74
74
|
| `Shift+Up` | Focus the conversation on the section the walk stopped at; a first entry, and the entry after a session switch, land on the newest section |
|
|
75
|
-
| `Shift+Down` | Focus the subagent panel's first row while it is drawn, and the status bar otherwise |
|
|
75
|
+
| `Shift+Down` | Focus the queued-prompt panel's first row while prompts wait, otherwise the subagent panel's first row while it is drawn, and the status bar otherwise |
|
|
76
76
|
| `Ctrl+G` | Read the conversation full screen, on its newest section |
|
|
77
77
|
| `Ctrl+O` | Expand or collapse every tool card and context row |
|
|
78
78
|
| `Esc` | Arm the stop and say so; a second press while that line is on screen stops the running turn, and queued messages stay queued |
|
|
@@ -81,6 +81,18 @@ While the input has the keyboard:
|
|
|
81
81
|
|
|
82
82
|
An `Esc` that only handed the keyboard back — leaving a region, closing a page, a picker, or the reader — opens a 750 ms window in which an `Esc` reaching the input does nothing at all, so a habitual double press stops no turn. With no turn running, `Esc` closes the completion list while one is open and is silent otherwise. A session with nothing to read yet answers `Shift+Up` and `Ctrl+G` with `nothing in the transcript to read yet` and leaves the keyboard in the input.
|
|
83
83
|
|
|
84
|
+
While the queued-prompt panel has the keyboard:
|
|
85
|
+
|
|
86
|
+
| Key | Effect |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `Up` / `Down`, `Home` / `End` | Select a pending prompt |
|
|
89
|
+
| `S` | Remove the selected prompt from its queue and steer it into the nearest step, waking the Agent |
|
|
90
|
+
| `I` | Move the selected prompt to next-step injection without waking the Agent |
|
|
91
|
+
| `E` | Remove the selected prompt into the editor; `Enter` sends the revision and `Ctrl+C` restores the original prompt to the next-turn queue |
|
|
92
|
+
| `Tab` / `Shift+Tab` | The next / previous region that is drawn |
|
|
93
|
+
| `Esc` | Return to the input |
|
|
94
|
+
| Any other printable key | Return to the input and type the character at the caret |
|
|
95
|
+
|
|
84
96
|
While the conversation has the keyboard:
|
|
85
97
|
|
|
86
98
|
| Key | Effect |
|
|
@@ -152,6 +164,7 @@ Typing `/` at the start of the editor completes the terminal's own commands and
|
|
|
152
164
|
| `/resume` | Open the same persisted-session picker as `/sessions` and resume the selected previous session |
|
|
153
165
|
| `/sessions` | Open the persisted-session picker and switch to the selected session |
|
|
154
166
|
| `/new` | Start a new session |
|
|
167
|
+
| `/clear` | Start a new session with empty context; the previous session stays on disk and is resumable with `/resume` |
|
|
155
168
|
| `/fork [turn]` | Fork this session at its last completed turn, or after turn `turn` |
|
|
156
169
|
| `/title <text>` | Rename this session; alone it shows the current title |
|
|
157
170
|
| `/attach <path>` | Attach an image or file to the next prompt; `/attach` lists, `/attach clear` drops them |
|
|
@@ -327,7 +340,7 @@ The runner adds nothing to the request prefix; a `/model` switch starts a new re
|
|
|
327
340
|
|
|
328
341
|
These limits describe the terminal surface as shipped; they are not a general CLI comparison or a task backlog.
|
|
329
342
|
|
|
330
|
-
- **One session at a time** — `/resume`, `/sessions`, `/new`, and `/fork` move the terminal between sessions, but only the bound Agent streams; the browser shows several sessions side by side.
|
|
343
|
+
- **One session at a time** — `/resume`, `/sessions`, `/new`, `/clear`, and `/fork` move the terminal between sessions, but only the bound Agent streams; the browser shows several sessions side by side.
|
|
331
344
|
- **Approvals are one-shot** — the prompt offers allow once or reject, matching the approval seam's vocabulary; there is no remembered grant.
|
|
332
345
|
- **Browser-only pages stay in the browser** — workspace and directory pickers, open-in-app links, the trajectory ledger, and per-message like/dislike have no terminal counterpart; `/settings`, `/plugins`, `/subagents`, `/outline`, and the shared `/feedback` cover their facts as text, and subagent transcripts are read by switching to the child session.
|
|
333
346
|
- **Deliverables are named, not opened** — `/deliverables` lists the presented paths and `/changes` shows line comparisons; the browser previews the files.
|
|
@@ -9,7 +9,7 @@ kind: "package-bundle"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
`dsh-tui-app` 是 dsh 的终端表层:`dsh tui` 在你的终端里启动一个多轮会话,没有浏览器、也没有服务器。回复流式显示,工具调用变成可折叠的卡片,审批与 `ask_user_question` 的问题出现在输入框上方,`@` 补全路径与会话,`/` 命令与 Web 共用注册表。方向键在停靠的检视面板中走遍对话记录;`Ctrl+G` 把它整屏读出、各轮次并排。持久化会话可通过 `/resume`、`/sessions` 或启动参数 `--resume` 恢复;`/new` 与 `/fork` 创建会话,`/export` 写出 ZIP。它运行 `dsh web` 的模型、工具与安全默认值,同一时间一个会话。
|
|
12
|
+
`dsh-tui-app` 是 dsh 的终端表层:`dsh tui` 在你的终端里启动一个多轮会话,没有浏览器、也没有服务器。回复流式显示,工具调用变成可折叠的卡片,审批与 `ask_user_question` 的问题出现在输入框上方,`@` 补全路径与会话,`/` 命令与 Web 共用注册表。方向键在停靠的检视面板中走遍对话记录;`Ctrl+G` 把它整屏读出、各轮次并排。持久化会话可通过 `/resume`、`/sessions` 或启动参数 `--resume` 恢复;`/new`、`/clear` 与 `/fork` 创建会话,`/export` 写出 ZIP。它运行 `dsh web` 的模型、工具与安全默认值,同一时间一个会话。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -36,13 +36,13 @@ dsh tui --resume <session-id> # continue an earlier session
|
|
|
36
36
|
dsh tui --no-open # print sign-in URLs without opening a browser
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
退出时应用在 stderr 为当时绑定的会话打印 `dsh: session <id> saved; resume with: dsh --profile tui --resume <id>`。恢复的会话会在接受输入前先重绘其持久化历史;在终端内,`/resume` 与 `/sessions` 打开覆盖所有持久化根会话的同一个选择器,并恢复选中的先前会话,`/new`
|
|
39
|
+
退出时应用在 stderr 为当时绑定的会话打印 `dsh: session <id> saved; resume with: dsh --profile tui --resume <id>`。恢复的会话会在接受输入前先重绘其持久化历史;在终端内,`/resume` 与 `/sessions` 打开覆盖所有持久化根会话的同一个选择器,并恢复选中的先前会话,`/new` 与 `/clear` 都会开始一个空的新会话且先前会话仍留在磁盘上可用 `/resume` 恢复,`/fork` 把当前会话复制到其最后一个完成轮次并作为新会话,切割点与浏览器的 fork 相同。切换会释放先前的 Agent 并重绘下一个会话的对话记录。
|
|
40
40
|
|
|
41
41
|
### 屏幕布局
|
|
42
42
|
|
|
43
|
-
页眉在标题生成或设置后以标题命名会话,并在旁边显示 id。对话记录在终端自身的回滚区中增长:你的提示以 `›` 开头(附件列在其下),assistant 的推理以暗色显示在 Markdown 回复上方,每次工具调用是一张卡片,含状态符号、工具名、呈现器标题,以及折叠到 `toolPreviewLines` 行的正文。非空的系统提示词与每一条注入的上下文——instructions、catalogs、snapshots、notices、relays 与 recalls——绘制为暗色 `⬡` 标题,其下是面向模型文本的前 `contextPreviewLines` 行,快照的每一份贡献具名写在其自身各行上方;空的系统提示词与压缩替换则省略。承载的行数多于其绘制行数的工具卡片与上下文块,结尾都是同一条标记:该块被对话记录的焦点持有时为 `… <n> more rows · Space expands`,否则为 `… <n> more rows · Ctrl+O expands`。回复中的围栏代码、`read` 卡片的文件行,以及 `edit` 或 `write` diff
|
|
43
|
+
页眉在标题生成或设置后以标题命名会话,并在旁边显示 id。对话记录在终端自身的回滚区中增长:你的提示以 `›` 开头(附件列在其下),assistant 的推理以暗色显示在 Markdown 回复上方,每次工具调用是一张卡片,含状态符号、工具名、呈现器标题,以及折叠到 `toolPreviewLines` 行的正文。非空的系统提示词与每一条注入的上下文——instructions、catalogs、snapshots、notices、relays 与 recalls——绘制为暗色 `⬡` 标题,其下是面向模型文本的前 `contextPreviewLines` 行,快照的每一份贡献具名写在其自身各行上方;空的系统提示词与压缩替换则省略。承载的行数多于其绘制行数的工具卡片与上下文块,结尾都是同一条标记:该块被对话记录的焦点持有时为 `… <n> more rows · Space expands`,否则为 `… <n> more rows · Ctrl+O expands`。回复中的围栏代码、`read` 卡片的文件行,以及 `edit` 或 `write` diff 卡片的变更行——其中 `+` 新增项标为绿色、`-` 删除项标为红色,符号后的源文本按文件扩展名对应的语言绘制——都使用语法高亮,配色主题由终端自身的背景在明暗之间选定;某种语言的语法会在第一个用到它的代码块出现时才加载,因此该块先以纯文本绘制、随后被重绘为彩色;这里没有对应语法的语言、既不支持 24 位也不支持 256 色的终端,以及 `codeHighlight: false`,都会把每个代码块画成纯文本。流式回复文字会淡入,而且每个词各走各的时钟:一个词以接近终端背景色的亮度出现,并经 `streamFadeSteps` 次、每次 `streamFadeStepMs` 提亮到它最终稳定的颜色,因此流得更快只会留下更长的一串正在提亮的词,而不会更暗。流式推理与工具卡片在同一时长内浮出:它们以抬高的颜色出现,再退回到稳定时的暗色斜体或调色板颜色;从持久化历史重绘的卡片不带淡入,已经稳定下来的文字也不会再被调暗。
|
|
44
44
|
|
|
45
|
-
对话记录下方依次是 agent
|
|
45
|
+
对话记录下方依次是 agent 工作时的旋转指示、任何打开的提示、有消息等待时的带框待处理提示面板、编辑器、子 agent 面板,以及页脚:未聚焦时是一行由两端向内构建的状态栏。编辑器的光标是终端自身的闪烁竖条:应用在启动时请求这一形状,退出时把你的默认形状还回去,而状态栏或面板持有键盘期间完全不绘制光标。模型锚定在左端且永不丢弃——超过 20 列时退回到裸模型名,只有仍然过宽的标签才会被省略号截断——离开编辑器的那两个按键则锚定在右端,写作 `Shift+↑ read · Shift+↓ status`,窄到一定程度收缩为 `Shift+↑↓ nav`,不足 40 列时整体丢弃。关键事实填满剩下的中间部分,按状态栏顺序排列:推理强度(选择把推理交给模型时标为 `effort default`)、进行中轮次的已用时间、上下文窗口百分比、todo 计数,以及 workspace 路径(过长时以 `~` 与 `…/` 缩短)。中间部分容纳不下的每个分段都折进末尾的 `+N`,未聚焦行从不绘制的那些分段也一并折入——权限预设、累计 token 用量、来自投影接缝的目标与计划模式标记,以及待发送附件的数量。压缩与模型请求重试以通知形式出现,与浏览器标记承载的事实相同。
|
|
46
46
|
|
|
47
47
|
键盘在对话记录中移动时,编辑器正上方停靠着一个带边框的检视面板,边框即模式:它恰好在对话记录持有键盘时绘制。其顶边线带有一个反白的 ` ● READ ` 徽标与当前聚焦小节的标题——该小节在可导航块中的位置、所属轮次,以及这是哪一种小节——例如 `╭ ● READ ─ 3/12 · turn 2 · bash git status · result ─╮`。其下在块含多个部分时,把这些部分绘制成形如 `← 1 call · [2 result] →` 的带编号、会折行的选择行,被持有的标签除强调色外还加上方括号,因此完全无颜色时选择仍然可读;再往下是该小节自身的源文本行,每行以 `│ ` 起头并按窄两列换行,对每一种小节——含系统提示词与注入的上下文——都折叠到 `focusPreviewLines` 行,其下写出 `… <n> more rows · Ctrl+G reads it`。底边线列出对话记录所应答的按键 `↑↓ sections · ←→ parts · Space folds · Ctrl+G reader · Esc input`,随着终端列数减少收缩为 `↑↓ ←→ · Space folds · Esc input`,再收缩为 `Esc input`。
|
|
48
48
|
|
|
@@ -58,13 +58,13 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
58
58
|
|
|
59
59
|
### 按键与命令
|
|
60
60
|
|
|
61
|
-
对话记录、编辑器、子 agent
|
|
61
|
+
对话记录、编辑器、子 agent 面板与状态栏构成垂直方向键走查:在最新小节上按 `Down`、在子 agent 面板第一行上按 `Up`、在没有绘制子 agent 面板时于状态栏上按 `Up`,都会落到光标处。待处理提示面板位于输入框上方;绘制该面板时,`Shift+Down` 会进入它,它也加入 `Tab` 走查。编辑器以外的区域持有键盘时,`Tab` 与 `Shift+Tab` 走遍已绘制的各区域,并在两端环绕;在编辑器中,`Tab` 采用给出的补全,`Shift+Tab` 打开推理强度选择器。在其中任何一个区域按下可打印键都会回到编辑器并在那里输入,因此在阅读时开始写的句子会落在它所指向的地方;对话记录中的 `Space` 是唯一的例外,它折叠被标记的工具卡片或上下文块。`Ctrl+G` 与 `Ctrl+O` 在这些区域中含义完全相同,而 `Ctrl+C` 与 `Ctrl+D` 会先把键盘交还编辑器再行动。提示与阅读器则各自持有整条按键流,并以交还键盘的方式应答 `Ctrl+C`。
|
|
62
62
|
|
|
63
63
|
编辑器持有键盘时:
|
|
64
64
|
|
|
65
65
|
| 按键 | 效果 |
|
|
66
66
|
|---|---|
|
|
67
|
-
| `Enter` |
|
|
67
|
+
| `Enter` | 发送编辑器文本;轮次进行中时它在编辑器上方的带框 `QUEUE` 面板中等待下一轮次,直到循环领取它后才进入对话 |
|
|
68
68
|
| `Shift+Enter` | 插入换行 |
|
|
69
69
|
| `Ctrl+S` | 轮次进行中时,把编辑器文本引导(steer)进当前轮次的下一步 |
|
|
70
70
|
| `Up` / `Down` | 调出先前的提示 |
|
|
@@ -72,7 +72,7 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
72
72
|
| `Tab` | 采用编辑器给出的补全 |
|
|
73
73
|
| `Shift+Tab` | 打开当前模型的推理强度选择器,从下一次请求生效;与空参数 `/effort` 打开的是同一个选择器 |
|
|
74
74
|
| `Shift+Up` | 把焦点放到对话记录上、停在走查上次停下的小节;首次进入以及切换会话后的首次进入停在最新小节 |
|
|
75
|
-
| `Shift+Down` |
|
|
75
|
+
| `Shift+Down` | 有提示等待时把焦点放到待处理提示面板第一行,否则在子 agent 面板已绘制时放到其第一行,再否则放到状态栏 |
|
|
76
76
|
| `Ctrl+G` | 整屏读出对话记录,停在其最新小节 |
|
|
77
77
|
| `Ctrl+O` | 展开或折叠所有工具卡片与上下文行 |
|
|
78
78
|
| `Esc` | 装填停止并给出提示;该提示仍在屏幕上时再按一次会停止正在进行的轮次,已排队的消息保持排队 |
|
|
@@ -81,6 +81,18 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
81
81
|
|
|
82
82
|
仅仅交还了键盘的 `Esc`——离开某个区域、关闭页面、选择器或阅读器——会打开一个 750 ms 的窗口,其间到达编辑器的 `Esc` 完全不做任何事,因此习惯性的连按停不掉任何轮次。没有轮次进行时,`Esc` 在补全列表打开时关闭它,其余情况保持沉默。尚无可读内容的会话对 `Shift+Up` 与 `Ctrl+G` 回以 `nothing in the transcript to read yet`,并把键盘留在编辑器。
|
|
83
83
|
|
|
84
|
+
待处理提示面板持有键盘时:
|
|
85
|
+
|
|
86
|
+
| 按键 | 效果 |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `Up` / `Down`、`Home` / `End` | 选择一条待处理提示 |
|
|
89
|
+
| `S` | 从队列移除所选提示,并把它引导进最近的步骤,同时唤醒 Agent |
|
|
90
|
+
| `I` | 把所选提示移到下一步骤的注入队列,但不唤醒 Agent |
|
|
91
|
+
| `E` | 从队列移除所选提示并放入编辑器;`Enter` 发送修订内容,`Ctrl+C` 把原提示恢复到下一轮次队列 |
|
|
92
|
+
| `Tab` / `Shift+Tab` | 下一个 / 上一个已绘制区域 |
|
|
93
|
+
| `Esc` | 返回输入框 |
|
|
94
|
+
| 任何其他可打印键 | 返回输入框并在光标处输入该字符 |
|
|
95
|
+
|
|
84
96
|
对话记录持有键盘时:
|
|
85
97
|
|
|
86
98
|
| 按键 | 效果 |
|
|
@@ -152,6 +164,7 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
152
164
|
| `/resume` | 打开与 `/sessions` 相同的持久化会话选择器,并恢复选中的先前会话 |
|
|
153
165
|
| `/sessions` | 打开持久化会话选择器,并切换到选中的会话 |
|
|
154
166
|
| `/new` | 开始新会话 |
|
|
167
|
+
| `/clear` | 开始一个空上下文的新会话;先前会话仍留在磁盘上,可用 `/resume` 恢复 |
|
|
155
168
|
| `/fork [turn]` | 在本会话最后一个完成轮次处 fork,或在第 `turn` 轮之后 fork |
|
|
156
169
|
| `/title <text>` | 重命名本会话;单独使用时显示当前标题 |
|
|
157
170
|
| `/attach <path>` | 把图片或文件附加到下一条提示;`/attach` 列出,`/attach clear` 丢弃 |
|
|
@@ -327,7 +340,7 @@ runner 不向请求前缀添加任何内容;`/model` 切换像在浏览器中
|
|
|
327
340
|
|
|
328
341
|
这些限制描述随发行版交付的终端表层;它们不是一般的 CLI 比较,也不是任务积压。
|
|
329
342
|
|
|
330
|
-
- **同一时间一个会话**——`/resume`、`/sessions`、`/new` 与 `/fork` 在会话间移动终端,但只有绑定的 Agent 流式显示;浏览器可并排展示多个会话。
|
|
343
|
+
- **同一时间一个会话**——`/resume`、`/sessions`、`/new`、`/clear` 与 `/fork` 在会话间移动终端,但只有绑定的 Agent 流式显示;浏览器可并排展示多个会话。
|
|
331
344
|
- **审批为一次性**——提示只提供允许一次或拒绝,与审批接缝的词汇一致;没有记忆的授权。
|
|
332
345
|
- **仅浏览器的页面留在浏览器**——workspace 与目录选择器、在应用中打开的链接、轨迹账本与逐条消息的点赞/点踩没有终端对应物;`/settings`、`/plugins`、`/subagents`、`/outline` 与共享的 `/feedback` 以文本覆盖其事实,子 agent 的对话记录通过切换到子会话来阅读。
|
|
333
346
|
- **交付物只列名、不打开**——`/deliverables` 列出交付路径,`/changes` 显示逐行对比;浏览器会预览这些文件。
|
|
@@ -2146,6 +2146,22 @@ function createPalette(enabled) {
|
|
|
2146
2146
|
};
|
|
2147
2147
|
}
|
|
2148
2148
|
/**
|
|
2149
|
+
* Paint added and removed diff rows while leaving context and metadata rows
|
|
2150
|
+
* unchanged. `source` stays plain so syntax-colored rows can be classified.
|
|
2151
|
+
* @param rows - rows after optional syntax highlighting.
|
|
2152
|
+
* @param source - corresponding plain rows carrying the diff prefixes.
|
|
2153
|
+
* @param palette - active terminal palette.
|
|
2154
|
+
* @returns the rows with additions green and removals red.
|
|
2155
|
+
*/
|
|
2156
|
+
function paintDiffRows(rows, source, palette) {
|
|
2157
|
+
return rows.map((row, index) => {
|
|
2158
|
+
const plain = source[index];
|
|
2159
|
+
if (plain?.startsWith("+ ") === true) return palette.success(row);
|
|
2160
|
+
if (plain?.startsWith("- ") === true) return palette.error(row);
|
|
2161
|
+
return row;
|
|
2162
|
+
});
|
|
2163
|
+
}
|
|
2164
|
+
/**
|
|
2149
2165
|
* Decide whether the terminal gets color: `NO_COLOR` (any non-empty value)
|
|
2150
2166
|
* wins, then a non-empty non-zero `FORCE_COLOR`, then whether stdout is a TTY.
|
|
2151
2167
|
* @param env - the process environment.
|
|
@@ -2762,7 +2778,8 @@ var ToolBlock = class {
|
|
|
2762
2778
|
const header = `${this.status === "running" ? palette.warning("●") : this.status === "done" ? palette.success("●") : palette.error("●")} ${palette.bold(this.name)}${this.call.title === "" ? "" : ` ${palette.dim(this.call.title)}`}`;
|
|
2763
2779
|
const body = [...this.call.lines, ...this.resultLines];
|
|
2764
2780
|
const code = this.call.code === void 0 && this.resultCode === void 0 ? void 0 : [...this.call.code ?? new Array(this.call.lines.length).fill(void 0), ...this.resultCode ?? new Array(this.resultLines.length).fill(void 0)];
|
|
2765
|
-
const
|
|
2781
|
+
const kept = this.expanded ? body : foldRows(body, this.theme.toolPreviewLines, (hidden) => foldMarker(hidden, marked ? "marked" : "transcript"));
|
|
2782
|
+
const shown = paintDiffRows(paintCodeRows(kept, code, this.theme.codeHighlight), kept, palette);
|
|
2766
2783
|
const callCount = Math.min(this.call.lines.length, shown.length);
|
|
2767
2784
|
const inner = Math.max(1, outer - 4);
|
|
2768
2785
|
const rows = (lines) => lines.flatMap((line) => wrapTextWithAnsi(line, inner).map((part) => ` ${palette.dim("│")} ${part}`));
|
|
@@ -3443,6 +3460,11 @@ const HINTS = {
|
|
|
3443
3460
|
"↑↓ ←→ · Space folds · Esc input",
|
|
3444
3461
|
"Esc input"
|
|
3445
3462
|
],
|
|
3463
|
+
queue: [
|
|
3464
|
+
"↑↓ prompts · S steer · I inject · E edit · Esc input",
|
|
3465
|
+
"S steer · I inject · E edit · Esc input",
|
|
3466
|
+
"Esc input"
|
|
3467
|
+
],
|
|
3446
3468
|
panel: [
|
|
3447
3469
|
"↑↓ children · Enter details · Tab regions · Esc input",
|
|
3448
3470
|
"↑↓ children · Esc input",
|
|
@@ -3463,6 +3485,7 @@ const HINTS = {
|
|
|
3463
3485
|
const FOCUS_REGIONS = [
|
|
3464
3486
|
"editor",
|
|
3465
3487
|
"transcript",
|
|
3488
|
+
"queue",
|
|
3466
3489
|
"panel",
|
|
3467
3490
|
"bar"
|
|
3468
3491
|
];
|
|
@@ -3470,6 +3493,7 @@ const FOCUS_REGIONS = [
|
|
|
3470
3493
|
const REGION_LABELS = {
|
|
3471
3494
|
editor: "input",
|
|
3472
3495
|
transcript: "conversation",
|
|
3496
|
+
queue: "queued prompts",
|
|
3473
3497
|
panel: "subagent panel",
|
|
3474
3498
|
bar: "status bar"
|
|
3475
3499
|
};
|
|
@@ -3510,6 +3534,7 @@ const KEY_LINES = {
|
|
|
3510
3534
|
"Ctrl+C clears the input, twice quits · Ctrl+D quits an empty input"
|
|
3511
3535
|
],
|
|
3512
3536
|
transcript: [widestHint("transcript"), "Shift+↑↓ blocks · PgUp PgDn turns · Home End ends · Tab regions · Enter reads"],
|
|
3537
|
+
queue: [widestHint("queue")],
|
|
3513
3538
|
panel: [widestHint("panel")],
|
|
3514
3539
|
bar: [widestHint("bar")]
|
|
3515
3540
|
};
|
|
@@ -3539,6 +3564,7 @@ function resolveKey(region, data) {
|
|
|
3539
3564
|
switch (region) {
|
|
3540
3565
|
case "editor": return editorKey(data);
|
|
3541
3566
|
case "transcript": return transcriptKey(data);
|
|
3567
|
+
case "queue": return queueKey(data);
|
|
3542
3568
|
case "panel": return panelKey(data);
|
|
3543
3569
|
case "bar": return barKey(data);
|
|
3544
3570
|
/* v8 ignore next 2 -- closed-union exhaustiveness guard */
|
|
@@ -3629,6 +3655,29 @@ const TRANSCRIPT_MOVES = [
|
|
|
3629
3655
|
to: "last"
|
|
3630
3656
|
}
|
|
3631
3657
|
];
|
|
3658
|
+
/** The pending-prompt panel's movement keys. */
|
|
3659
|
+
const QUEUE_MOVES = [
|
|
3660
|
+
{
|
|
3661
|
+
key: "up",
|
|
3662
|
+
axis: "prompt",
|
|
3663
|
+
to: "previous"
|
|
3664
|
+
},
|
|
3665
|
+
{
|
|
3666
|
+
key: "down",
|
|
3667
|
+
axis: "prompt",
|
|
3668
|
+
to: "next"
|
|
3669
|
+
},
|
|
3670
|
+
{
|
|
3671
|
+
key: "home",
|
|
3672
|
+
axis: "prompt",
|
|
3673
|
+
to: "first"
|
|
3674
|
+
},
|
|
3675
|
+
{
|
|
3676
|
+
key: "end",
|
|
3677
|
+
axis: "prompt",
|
|
3678
|
+
to: "last"
|
|
3679
|
+
}
|
|
3680
|
+
];
|
|
3632
3681
|
/**
|
|
3633
3682
|
* The subagent panel's movement keys. The panel lists at most six rows, so
|
|
3634
3683
|
* every coarse key means the same thing there: its first row or its last.
|
|
@@ -3763,6 +3812,28 @@ function transcriptKey(data) {
|
|
|
3763
3812
|
return cycleKey(data) ?? typeKey(data);
|
|
3764
3813
|
}
|
|
3765
3814
|
/**
|
|
3815
|
+
* What one key means while the pending-prompt panel holds the keyboard.
|
|
3816
|
+
* @param data - the raw key bytes.
|
|
3817
|
+
* @returns the action, or undefined for a key the panel consumes without effect.
|
|
3818
|
+
*/
|
|
3819
|
+
function queueKey(data) {
|
|
3820
|
+
const move = moveKey(data, QUEUE_MOVES);
|
|
3821
|
+
if (move !== void 0) return move;
|
|
3822
|
+
if (data === "s" || data === "S") return {
|
|
3823
|
+
kind: "queue",
|
|
3824
|
+
action: "steer"
|
|
3825
|
+
};
|
|
3826
|
+
if (data === "i" || data === "I") return {
|
|
3827
|
+
kind: "queue",
|
|
3828
|
+
action: "inject"
|
|
3829
|
+
};
|
|
3830
|
+
if (data === "e" || data === "E") return {
|
|
3831
|
+
kind: "queue",
|
|
3832
|
+
action: "edit"
|
|
3833
|
+
};
|
|
3834
|
+
return cycleKey(data) ?? typeKey(data);
|
|
3835
|
+
}
|
|
3836
|
+
/**
|
|
3766
3837
|
* What one key means while the subagent panel holds the keyboard.
|
|
3767
3838
|
* @param data - the raw key bytes.
|
|
3768
3839
|
* @returns the action, or undefined for a key the panel consumes without effect.
|
|
@@ -5805,6 +5876,62 @@ var ModalQueue = class {
|
|
|
5805
5876
|
this.active?.withdraw();
|
|
5806
5877
|
}
|
|
5807
5878
|
};
|
|
5879
|
+
//#endregion
|
|
5880
|
+
//#region lib/types/queue-panel.js
|
|
5881
|
+
/**
|
|
5882
|
+
* The pending-prompt panel above the editor. It presents the Agent inbox as a
|
|
5883
|
+
* framed, selectable list without mutating the messages it displays.
|
|
5884
|
+
* @module @deepseek-ai/dsh-tui-app/queue-panel
|
|
5885
|
+
*/
|
|
5886
|
+
/**
|
|
5887
|
+
* Build the panel rows in claim order: next-step input before ordinary turns.
|
|
5888
|
+
* @param nextStep - messages waiting for the nearest step boundary.
|
|
5889
|
+
* @param nextTurn - messages waiting for separate turns.
|
|
5890
|
+
* @returns selectable pending-prompt rows.
|
|
5891
|
+
*/
|
|
5892
|
+
function queuePanelRows(nextStep, nextTurn) {
|
|
5893
|
+
const row = (target, message) => ({
|
|
5894
|
+
message,
|
|
5895
|
+
target,
|
|
5896
|
+
text: contentText(message.content).split("\n", 1)[0] ?? ""
|
|
5897
|
+
});
|
|
5898
|
+
return [...nextStep.map((message) => row("next-step", message)), ...nextTurn.map((message) => row("next-turn", message))];
|
|
5899
|
+
}
|
|
5900
|
+
/**
|
|
5901
|
+
* Render the pending prompts inside a frame. A focused panel accents its held
|
|
5902
|
+
* row and names its actions; an unfocused panel names the key that enters it.
|
|
5903
|
+
* @param rows - pending prompts in claim order.
|
|
5904
|
+
* @param render - palette, terminal width, and optional selection.
|
|
5905
|
+
* @returns panel text, or the empty string when no prompt waits.
|
|
5906
|
+
*/
|
|
5907
|
+
function renderQueuePanel(rows, render) {
|
|
5908
|
+
if (rows.length === 0) return "";
|
|
5909
|
+
const { palette, selected } = render;
|
|
5910
|
+
const width = Math.max(1, render.width);
|
|
5911
|
+
const tone = selected === void 0 ? "muted" : "focus";
|
|
5912
|
+
const title = `${String(rows.length)} pending`;
|
|
5913
|
+
const lines = [topRule({
|
|
5914
|
+
chip: chip(palette, "QUEUE"),
|
|
5915
|
+
title: palette.bold(title),
|
|
5916
|
+
width,
|
|
5917
|
+
palette,
|
|
5918
|
+
tone
|
|
5919
|
+
})];
|
|
5920
|
+
const room = Math.max(1, width - 2);
|
|
5921
|
+
for (const [index, row] of rows.entries()) {
|
|
5922
|
+
const label = row.target === "next-step" ? "next step" : "next turn";
|
|
5923
|
+
const text = `${selected === index ? palette.accent("▸ ") : " "}${palette.dim(`${label} ·`)} ${row.text}`;
|
|
5924
|
+
for (const wrapped of wrapTextWithAnsi(text, room)) lines.push(bodyLine(wrapped, width, palette, tone));
|
|
5925
|
+
}
|
|
5926
|
+
const hints = selected === void 0 ? ["Shift+↓ manages"] : HINTS.queue;
|
|
5927
|
+
lines.push(bottomRule({
|
|
5928
|
+
left: palette.dim(fitLegend(hints, ruleRoom(width))),
|
|
5929
|
+
width,
|
|
5930
|
+
palette,
|
|
5931
|
+
tone
|
|
5932
|
+
}));
|
|
5933
|
+
return lines.join("\n");
|
|
5934
|
+
}
|
|
5808
5935
|
/** Narrowest turn list. */
|
|
5809
5936
|
const LIST_MIN_WIDTH = 18;
|
|
5810
5937
|
/** Widest turn list. */
|
|
@@ -7744,6 +7871,10 @@ const LOCAL_COMMANDS = [
|
|
|
7744
7871
|
name: "new",
|
|
7745
7872
|
description: "Start a new session"
|
|
7746
7873
|
},
|
|
7874
|
+
{
|
|
7875
|
+
name: "clear",
|
|
7876
|
+
description: "Start a new session with empty context; previous session stays on disk (resumable with /resume)"
|
|
7877
|
+
},
|
|
7747
7878
|
{
|
|
7748
7879
|
name: "fork",
|
|
7749
7880
|
description: "Fork this session at its last completed turn (/fork <turn> for an earlier one)"
|
|
@@ -7849,6 +7980,14 @@ var TuiApp = class {
|
|
|
7849
7980
|
queueSlot = new Container();
|
|
7850
7981
|
/** The prompts queued for the next turn or step, drawn above the editor until the loop claims them. */
|
|
7851
7982
|
queue;
|
|
7983
|
+
/** Rows of the last queued-prompt draw, in claim order. */
|
|
7984
|
+
queueView = [];
|
|
7985
|
+
/** Pending prompt held while the queue panel owns the keyboard. */
|
|
7986
|
+
queueSelection;
|
|
7987
|
+
/** A removed queued prompt whose text is being revised in the editor. */
|
|
7988
|
+
queueDraft;
|
|
7989
|
+
/** Suppresses the empty-queue focus handoff during a synchronous inbox transfer. */
|
|
7990
|
+
transferringQueue = false;
|
|
7852
7991
|
/** Holds {@link panel} exactly while the bound session has subagent rows. */
|
|
7853
7992
|
panelSlot = new Container();
|
|
7854
7993
|
/** Blank rows that give the mounted reader the whole viewport; see {@link ViewportPad}. */
|
|
@@ -8126,6 +8265,7 @@ var TuiApp = class {
|
|
|
8126
8265
|
/** Release the terminal and tell the host to exit; later calls are no-ops. */
|
|
8127
8266
|
stop() {
|
|
8128
8267
|
if (this.stopped) return;
|
|
8268
|
+
this.restoreQueueDraft();
|
|
8129
8269
|
this.stopped = true;
|
|
8130
8270
|
this.updateTicker();
|
|
8131
8271
|
this.updateFadeTicker();
|
|
@@ -8142,6 +8282,10 @@ var TuiApp = class {
|
|
|
8142
8282
|
}
|
|
8143
8283
|
/** Draw `next` as the terminal's session: clear the transcript and replay its history. */
|
|
8144
8284
|
bind(next) {
|
|
8285
|
+
if (this.queueDraft !== void 0) {
|
|
8286
|
+
this.restoreQueueDraft();
|
|
8287
|
+
this.editor.setText("");
|
|
8288
|
+
}
|
|
8145
8289
|
this.bound = next;
|
|
8146
8290
|
const reading = this.dropReader();
|
|
8147
8291
|
this.focusEditor();
|
|
@@ -8160,6 +8304,8 @@ var TuiApp = class {
|
|
|
8160
8304
|
this.blockFades.clear();
|
|
8161
8305
|
this.usage = EMPTY_USAGE;
|
|
8162
8306
|
this.pending = [];
|
|
8307
|
+
this.queueView = [];
|
|
8308
|
+
this.queueSelection = void 0;
|
|
8163
8309
|
this.subagentEntries = [];
|
|
8164
8310
|
this.panelSelection = void 0;
|
|
8165
8311
|
this.listingFailure = void 0;
|
|
@@ -8307,20 +8453,36 @@ var TuiApp = class {
|
|
|
8307
8453
|
* directly under the conversation the rest of the time.
|
|
8308
8454
|
*/
|
|
8309
8455
|
refreshQueue() {
|
|
8310
|
-
const palette = this.deps.palette;
|
|
8311
8456
|
const inbox = this.agent.inbox;
|
|
8312
|
-
const
|
|
8313
|
-
|
|
8457
|
+
const rows = queuePanelRows(inbox.nextStep, inbox.nextTurn);
|
|
8458
|
+
this.queueView = rows;
|
|
8314
8459
|
const mounted = this.queueSlot.children.length > 0;
|
|
8315
8460
|
if (rows.length === 0) {
|
|
8461
|
+
this.queueSelection = void 0;
|
|
8462
|
+
if (this.focus === "queue" && !this.transferringQueue) this.focusEditor();
|
|
8316
8463
|
if (mounted) this.queueSlot.removeChild(this.queue);
|
|
8317
8464
|
} else {
|
|
8318
|
-
this.queue.setText(rows.join("\n"));
|
|
8319
8465
|
if (!mounted) this.queueSlot.addChild(this.queue);
|
|
8466
|
+
const selected = this.queueSelectionIndex(rows);
|
|
8467
|
+
this.queueSelection = rows[selected]?.message.id;
|
|
8468
|
+
this.queue.setText(renderQueuePanel(rows, {
|
|
8469
|
+
palette: this.deps.palette,
|
|
8470
|
+
width: this.deps.terminal.columns,
|
|
8471
|
+
...this.focus === "queue" ? { selected } : {}
|
|
8472
|
+
}));
|
|
8320
8473
|
}
|
|
8321
8474
|
this.tui.requestRender();
|
|
8322
8475
|
}
|
|
8323
8476
|
/**
|
|
8477
|
+
* Locate the held pending prompt after inbox insertions and claims.
|
|
8478
|
+
* @param rows - current queue rows.
|
|
8479
|
+
* @returns the selected index, or 0 when the prior row left.
|
|
8480
|
+
*/
|
|
8481
|
+
queueSelectionIndex(rows) {
|
|
8482
|
+
const index = rows.findIndex((row) => row.message.id === this.queueSelection);
|
|
8483
|
+
return index === -1 ? 0 : index;
|
|
8484
|
+
}
|
|
8485
|
+
/**
|
|
8324
8486
|
* Redraw the panel from the last listing and a fresh sample of the live
|
|
8325
8487
|
* facts. The panel is mounted exactly while it has a row, so the last
|
|
8326
8488
|
* resident child leaving takes the panel with it — and the keyboard back to
|
|
@@ -8630,7 +8792,10 @@ var TuiApp = class {
|
|
|
8630
8792
|
description: choice.description
|
|
8631
8793
|
},
|
|
8632
8794
|
heading: choice.label,
|
|
8633
|
-
detail: () =>
|
|
8795
|
+
detail: async () => {
|
|
8796
|
+
const rows = await changeDiffRows(this.deps.ctx, sessionId, choice, signal);
|
|
8797
|
+
return paintDiffRows(rows, rows, this.deps.palette);
|
|
8798
|
+
}
|
|
8634
8799
|
})));
|
|
8635
8800
|
}
|
|
8636
8801
|
/**
|
|
@@ -8770,6 +8935,12 @@ var TuiApp = class {
|
|
|
8770
8935
|
if (this.focus === "editor" && !matchesKey(data, "escape")) this.disarmStop();
|
|
8771
8936
|
if (matchesKey(data, "ctrl+c")) {
|
|
8772
8937
|
this.focusEditor();
|
|
8938
|
+
if (this.queueDraft !== void 0) {
|
|
8939
|
+
this.restoreQueueDraft();
|
|
8940
|
+
this.editor.setText("");
|
|
8941
|
+
this.notice("queued prompt edit canceled");
|
|
8942
|
+
return { consume: true };
|
|
8943
|
+
}
|
|
8773
8944
|
const now = Date.now();
|
|
8774
8945
|
if (now - this.lastCtrlC < QUIT_DOUBLE_PRESS_MS) {
|
|
8775
8946
|
this.stop();
|
|
@@ -8830,6 +9001,9 @@ var TuiApp = class {
|
|
|
8830
9001
|
case "steer":
|
|
8831
9002
|
this.onSubmit(this.editor.getText(), "steer");
|
|
8832
9003
|
return { consume: true };
|
|
9004
|
+
case "queue":
|
|
9005
|
+
this.actOnQueuedPrompt(action.action);
|
|
9006
|
+
return { consume: true };
|
|
8833
9007
|
case "effort":
|
|
8834
9008
|
if (this.switching) {
|
|
8835
9009
|
this.notice(SESSION_SWITCH_WAIT, "error");
|
|
@@ -8984,6 +9158,7 @@ var TuiApp = class {
|
|
|
8984
9158
|
this.readerOpening = void 0;
|
|
8985
9159
|
this.cursor = exit.cursor;
|
|
8986
9160
|
this.setFocus(exit.target);
|
|
9161
|
+
this.refreshQueue();
|
|
8987
9162
|
this.refreshSubagentPanel();
|
|
8988
9163
|
this.armEscapeHandoff();
|
|
8989
9164
|
const motion = this.startMotion(4);
|
|
@@ -9023,6 +9198,9 @@ var TuiApp = class {
|
|
|
9023
9198
|
case "part":
|
|
9024
9199
|
this.moveTranscript(axis, to);
|
|
9025
9200
|
return;
|
|
9201
|
+
case "prompt":
|
|
9202
|
+
this.moveQueueBy(to);
|
|
9203
|
+
return;
|
|
9026
9204
|
case "row":
|
|
9027
9205
|
this.movePanelBy(to);
|
|
9028
9206
|
return;
|
|
@@ -9055,6 +9233,49 @@ var TuiApp = class {
|
|
|
9055
9233
|
else this.moveCursor(next);
|
|
9056
9234
|
}
|
|
9057
9235
|
/**
|
|
9236
|
+
* Walk the queued-prompt selection, stopping at both ends.
|
|
9237
|
+
* @param to - which way along the pending prompts.
|
|
9238
|
+
*/
|
|
9239
|
+
moveQueueBy(to) {
|
|
9240
|
+
const rows = this.queueView;
|
|
9241
|
+
const index = this.queueSelectionIndex(rows);
|
|
9242
|
+
const last = Math.max(0, rows.length - 1);
|
|
9243
|
+
const selected = to === "first" ? 0 : to === "last" ? last : to === "previous" ? Math.max(0, index - 1) : Math.min(last, index + 1);
|
|
9244
|
+
this.queueSelection = rows[selected]?.message.id;
|
|
9245
|
+
this.refreshQueue();
|
|
9246
|
+
}
|
|
9247
|
+
/** Apply one focused queue-panel command to the selected pending prompt. */
|
|
9248
|
+
actOnQueuedPrompt(action) {
|
|
9249
|
+
const row = this.queueView[this.queueSelectionIndex(this.queueView)];
|
|
9250
|
+
if (row === void 0) return;
|
|
9251
|
+
if (action === "edit") {
|
|
9252
|
+
if (!this.agent.inbox.remove(row.message.id)) {
|
|
9253
|
+
this.notice("that queued prompt was already claimed", "error");
|
|
9254
|
+
this.refreshQueue();
|
|
9255
|
+
return;
|
|
9256
|
+
}
|
|
9257
|
+
this.queueDraft = row.message;
|
|
9258
|
+
this.editor.setText(contentText(row.message.content));
|
|
9259
|
+
this.focusEditor();
|
|
9260
|
+
this.notice("editing queued prompt; Enter sends the revision");
|
|
9261
|
+
return;
|
|
9262
|
+
}
|
|
9263
|
+
this.transferringQueue = true;
|
|
9264
|
+
try {
|
|
9265
|
+
if (!this.agent.inbox.remove(row.message.id)) {
|
|
9266
|
+
this.notice("that queued prompt was already claimed", "error");
|
|
9267
|
+
return;
|
|
9268
|
+
}
|
|
9269
|
+
if (action === "steer") this.agent.steer(row.message);
|
|
9270
|
+
else this.agent.inject(row.message);
|
|
9271
|
+
} finally {
|
|
9272
|
+
this.transferringQueue = false;
|
|
9273
|
+
this.refreshQueue();
|
|
9274
|
+
this.refreshFooter();
|
|
9275
|
+
}
|
|
9276
|
+
this.notice(action === "steer" ? "queued prompt is steering the nearest step" : "queued prompt will be injected at the nearest step without waking the Agent");
|
|
9277
|
+
}
|
|
9278
|
+
/**
|
|
9058
9279
|
* Walk the subagent panel's selection. Above the first row the walk
|
|
9059
9280
|
* continues in the editor, below the last one at the status bar.
|
|
9060
9281
|
* @param to - which way along the drawn rows.
|
|
@@ -9160,6 +9381,11 @@ var TuiApp = class {
|
|
|
9160
9381
|
this.startChrome("selection", 4);
|
|
9161
9382
|
this.refreshFooter();
|
|
9162
9383
|
}
|
|
9384
|
+
/** Give the keyboard to the queued-prompt panel on one of its rows. */
|
|
9385
|
+
focusQueue(index) {
|
|
9386
|
+
this.queueSelection = this.queueView[index]?.message.id;
|
|
9387
|
+
this.focusRegion("queue");
|
|
9388
|
+
}
|
|
9163
9389
|
/**
|
|
9164
9390
|
* Give the keyboard to the subagent panel on one of its rows.
|
|
9165
9391
|
* @param index - the row the selection lands on.
|
|
@@ -9169,11 +9395,12 @@ var TuiApp = class {
|
|
|
9169
9395
|
this.focusRegion("panel");
|
|
9170
9396
|
}
|
|
9171
9397
|
/**
|
|
9172
|
-
* Give
|
|
9173
|
-
* first
|
|
9398
|
+
* Give `Shift+Down` to the pending-prompt panel when it is drawn, then the
|
|
9399
|
+
* first region below the editor.
|
|
9174
9400
|
*/
|
|
9175
9401
|
focusBelowEditor() {
|
|
9176
|
-
if (this.
|
|
9402
|
+
if (this.queueView.length > 0) this.focusQueue(0);
|
|
9403
|
+
else if (this.panelView.rows.length > 0) this.focusPanel(0);
|
|
9177
9404
|
else this.focusBar();
|
|
9178
9405
|
}
|
|
9179
9406
|
/**
|
|
@@ -9211,14 +9438,14 @@ var TuiApp = class {
|
|
|
9211
9438
|
this.tui.requestRender();
|
|
9212
9439
|
}
|
|
9213
9440
|
/**
|
|
9214
|
-
* The regions drawn around the editor right now, in
|
|
9215
|
-
*
|
|
9216
|
-
* rows, and the status bar, which is always drawn.
|
|
9441
|
+
* The regions drawn around the editor right now, in screen order, except
|
|
9442
|
+
* that the editor itself is not part of the `Tab` walk.
|
|
9217
9443
|
* @returns the regions `Tab` walks.
|
|
9218
9444
|
*/
|
|
9219
9445
|
drawnRegions() {
|
|
9220
9446
|
const drawn = [];
|
|
9221
9447
|
if (this.transcriptEntry() !== void 0) drawn.push("transcript");
|
|
9448
|
+
if (this.queueView.length > 0) drawn.push("queue");
|
|
9222
9449
|
if (this.panelView.rows.length > 0) drawn.push("panel");
|
|
9223
9450
|
drawn.push("bar");
|
|
9224
9451
|
return drawn;
|
|
@@ -9235,6 +9462,7 @@ var TuiApp = class {
|
|
|
9235
9462
|
/* v8 ignore next -- the status bar is always drawn, so the wrapped index names a region */
|
|
9236
9463
|
if (next === void 0) return;
|
|
9237
9464
|
if (next === "transcript") this.focusTranscript();
|
|
9465
|
+
else if (next === "queue") this.focusQueue(this.queueSelectionIndex(this.queueView));
|
|
9238
9466
|
else if (next === "panel") this.focusPanel(this.panelSelectionIndex(this.panelView.rows));
|
|
9239
9467
|
else this.focusBar();
|
|
9240
9468
|
}
|
|
@@ -9300,6 +9528,7 @@ var TuiApp = class {
|
|
|
9300
9528
|
focusRegion(region) {
|
|
9301
9529
|
if (this.focus === region) return;
|
|
9302
9530
|
this.setFocus(region);
|
|
9531
|
+
this.refreshQueue();
|
|
9303
9532
|
this.refreshSubagentPanel();
|
|
9304
9533
|
}
|
|
9305
9534
|
/**
|
|
@@ -9371,11 +9600,13 @@ var TuiApp = class {
|
|
|
9371
9600
|
}
|
|
9372
9601
|
this.editor.setText("");
|
|
9373
9602
|
this.editor.addToHistory(text);
|
|
9374
|
-
|
|
9603
|
+
const draft = this.queueDraft;
|
|
9604
|
+
this.queueDraft = void 0;
|
|
9605
|
+
if (draft === void 0 && text.startsWith("/")) {
|
|
9375
9606
|
this.dispatchCommand(text);
|
|
9376
9607
|
return;
|
|
9377
9608
|
}
|
|
9378
|
-
this.submit(text, mode);
|
|
9609
|
+
this.submit(text, mode, draft);
|
|
9379
9610
|
}
|
|
9380
9611
|
/**
|
|
9381
9612
|
* Run one slash command and turn a rejection into a terminal notice.
|
|
@@ -9388,15 +9619,28 @@ var TuiApp = class {
|
|
|
9388
9619
|
this.notice(`${name} failed: ${describeFailure(error)}`, "error");
|
|
9389
9620
|
});
|
|
9390
9621
|
}
|
|
9391
|
-
|
|
9622
|
+
/** Return an abandoned edit to the ordinary-turn inbox without waking the Agent. */
|
|
9623
|
+
restoreQueueDraft() {
|
|
9624
|
+
const draft = this.queueDraft;
|
|
9625
|
+
if (draft === void 0) return;
|
|
9626
|
+
this.queueDraft = void 0;
|
|
9627
|
+
this.agent.inbox.append("next-turn", draft);
|
|
9628
|
+
this.refreshQueue();
|
|
9629
|
+
this.refreshFooter();
|
|
9630
|
+
}
|
|
9631
|
+
submit(text, mode = "queue", draft) {
|
|
9392
9632
|
const agent = this.agent;
|
|
9393
9633
|
const attachments = this.pending.splice(0);
|
|
9394
9634
|
const message = createUserMessage({
|
|
9395
|
-
content: [
|
|
9396
|
-
type
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9635
|
+
content: [
|
|
9636
|
+
...draft?.content.filter((block) => block.type !== "text") ?? [],
|
|
9637
|
+
...attachments.map((attachment) => attachment.block),
|
|
9638
|
+
{
|
|
9639
|
+
type: "text",
|
|
9640
|
+
text
|
|
9641
|
+
}
|
|
9642
|
+
],
|
|
9643
|
+
source: draft?.source ?? { kind: "user" }
|
|
9400
9644
|
});
|
|
9401
9645
|
if (agent.status !== "running") {
|
|
9402
9646
|
this.submittedIds.add(message.id);
|
|
@@ -9443,6 +9687,7 @@ var TuiApp = class {
|
|
|
9443
9687
|
await this.openSessionPicker();
|
|
9444
9688
|
return;
|
|
9445
9689
|
case "new":
|
|
9690
|
+
case "clear":
|
|
9446
9691
|
await this.switchSession(() => this.deps.host.create(), "new session");
|
|
9447
9692
|
return;
|
|
9448
9693
|
case "fork": {
|
|
@@ -8,8 +8,8 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v22.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Sat, 19 Sep 2026 00:09:37 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
15
|
-
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [
|
|
15
|
+
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), and [René](https://github.com/Renegade334).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "22.20.
|
|
3
|
+
"version": "22.20.4",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,11 +50,6 @@
|
|
|
50
50
|
"githubUsername": "WilcoBakker",
|
|
51
51
|
"url": "https://github.com/WilcoBakker"
|
|
52
52
|
},
|
|
53
|
-
{
|
|
54
|
-
"name": "Marcin Kopacz",
|
|
55
|
-
"githubUsername": "chyzwar",
|
|
56
|
-
"url": "https://github.com/chyzwar"
|
|
57
|
-
},
|
|
58
53
|
{
|
|
59
54
|
"name": "Trivikram Kamat",
|
|
60
55
|
"githubUsername": "trivikr",
|
|
@@ -65,11 +60,6 @@
|
|
|
65
60
|
"githubUsername": "yoursunny",
|
|
66
61
|
"url": "https://github.com/yoursunny"
|
|
67
62
|
},
|
|
68
|
-
{
|
|
69
|
-
"name": "Ilia Baryshnikov",
|
|
70
|
-
"githubUsername": "qwelias",
|
|
71
|
-
"url": "https://github.com/qwelias"
|
|
72
|
-
},
|
|
73
63
|
{
|
|
74
64
|
"name": "ExE Boss",
|
|
75
65
|
"githubUsername": "ExE-Boss",
|
|
@@ -85,11 +75,6 @@
|
|
|
85
75
|
"githubUsername": "addaleax",
|
|
86
76
|
"url": "https://github.com/addaleax"
|
|
87
77
|
},
|
|
88
|
-
{
|
|
89
|
-
"name": "Victor Perin",
|
|
90
|
-
"githubUsername": "victorperin",
|
|
91
|
-
"url": "https://github.com/victorperin"
|
|
92
|
-
},
|
|
93
78
|
{
|
|
94
79
|
"name": "NodeJS Contributors",
|
|
95
80
|
"githubUsername": "NodeJS",
|
|
@@ -139,6 +124,6 @@
|
|
|
139
124
|
"undici-types": "~6.21.0"
|
|
140
125
|
},
|
|
141
126
|
"peerDependencies": {},
|
|
142
|
-
"typesPublisherContentHash": "
|
|
127
|
+
"typesPublisherContentHash": "05f54235bb066f4e83979e69cde16a4f509085e0d5636acc15e9f31672f72e74",
|
|
143
128
|
"typeScriptVersion": "5.6"
|
|
144
129
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@songtonyli/dsh-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"description": "The dsh terminal agent: an interactive TUI over the DeepSeek Harness, with its whole Node runtime bundled in one install.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -370,7 +370,7 @@
|
|
|
370
370
|
"@swc/helpers": "0.5.23",
|
|
371
371
|
"@types/hast": "3.0.5",
|
|
372
372
|
"@types/mdast": "4.0.4",
|
|
373
|
-
"@types/node": "22.20.
|
|
373
|
+
"@types/node": "22.20.4",
|
|
374
374
|
"@types/retry": "0.12.0",
|
|
375
375
|
"@types/unist": "3.0.3",
|
|
376
376
|
"@ungap/structured-clone": "1.4.0",
|