@songtonyli/dsh-cli 0.1.27 → 0.1.28
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-conversation/lib/client.js +3 -2
- 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 +24 -19
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +24 -19
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +192 -36
- package/package.json +1 -1
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.28; `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.28 (deepseek-harness 0.1.6-alpha.2)')
|
|
22
22
|
process.exit(0)
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -16468,7 +16468,7 @@ window.__ModuleLoader__.load({
|
|
|
16468
16468
|
});
|
|
16469
16469
|
//#endregion
|
|
16470
16470
|
//#region \0dsh-css:/Users/songli/deepseek-harness/packages/client/ui-conversation/src/client/skeleton/TodoPanel.module.css.mjs
|
|
16471
|
-
const css = ".UWFBKq_root{box-sizing:border-box;width:calc(100% - var(--dsh-composer-side-clearance) - var(--dsh-composer-side-clearance) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset));max-width:calc(var(--dsh-composer-card-max-width) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset));border:.5px solid var(--dsw-alias-border-l1);background:var(--dsw-specific-tip);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:12px;flex:none;margin:0 auto;overflow:hidden}.UWFBKq_body{flex-direction:column;gap:8px;padding:6px 12px;display:flex}.UWFBKq_header{text-align:left;cursor:pointer;background:0 0;border:none;align-items:center;gap:10px;width:100%;padding:0;display:flex}.UWFBKq_lead{color:var(--dsw-alias-label-tertiary);flex:none;place-items:center;display:grid}.UWFBKq_title{color:var(--dsw-alias-label-primary);flex:none;font-size:13px;font-weight:500;line-height:24px}.UWFBKq_progress{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:auto;font-size:13px;font-weight:400;line-height:20px;overflow:hidden}.UWFBKq_chevron{color:var(--dsw-alias-label-tertiary);flex:none;place-items:center;display:grid}.UWFBKq_list{flex-direction:column;gap:8px;max-height:180px;margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.UWFBKq_item{min-width:0;color:var(--dsw-alias-label-secondary);align-items:center;gap:10px;font-size:13px;line-height:20px;display:flex}.UWFBKq_glyph{flex:none;place-items:center;width:16px;height:16px;display:grid}.UWFBKq_glyphCompleted{color:var(--dsw-alias-state-success-primary)}.UWFBKq_glyphPending{color:var(--dsw-alias-label-caption)}.UWFBKq_glyphProgress{color:var(--dsw-alias-state-business-primary);animation:1s linear infinite UWFBKq_todo-progress-spin}@keyframes UWFBKq_todo-progress-spin{to{transform:rotate(360deg)}}.UWFBKq_content{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}";
|
|
16471
|
+
const css = ".UWFBKq_root{box-sizing:border-box;width:calc(100% - var(--dsh-composer-side-clearance) - var(--dsh-composer-side-clearance) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset));max-width:calc(var(--dsh-composer-card-max-width) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset));border:.5px solid var(--dsw-alias-border-l1);background:var(--dsw-specific-tip);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:12px;flex:none;margin:0 auto;overflow:hidden}.UWFBKq_body{flex-direction:column;gap:8px;padding:6px 12px;display:flex}.UWFBKq_header{text-align:left;cursor:pointer;background:0 0;border:none;align-items:center;gap:10px;width:100%;padding:0;display:flex}.UWFBKq_lead{color:var(--dsw-alias-label-tertiary);flex:none;place-items:center;display:grid}.UWFBKq_title{color:var(--dsw-alias-label-primary);flex:none;font-size:13px;font-weight:500;line-height:24px}.UWFBKq_progress{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:auto;font-size:13px;font-weight:400;line-height:20px;overflow:hidden}.UWFBKq_chevron{color:var(--dsw-alias-label-tertiary);flex:none;place-items:center;display:grid}.UWFBKq_list{flex-direction:column;gap:8px;max-height:180px;margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.UWFBKq_item{min-width:0;color:var(--dsw-alias-label-secondary);align-items:center;gap:10px;font-size:13px;line-height:20px;display:flex}.UWFBKq_glyph{flex:none;place-items:center;width:16px;height:16px;display:grid}.UWFBKq_glyphCompleted{color:var(--dsw-alias-state-success-primary)}.UWFBKq_glyphPending{color:var(--dsw-alias-label-caption)}.UWFBKq_glyphProgress{color:var(--dsw-alias-state-business-primary);animation:1s linear infinite UWFBKq_todo-progress-spin}@keyframes UWFBKq_todo-progress-spin{to{transform:rotate(360deg)}}.UWFBKq_content{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.UWFBKq_contentCompleted{color:var(--dsw-alias-label-tertiary);text-decoration:line-through}";
|
|
16472
16472
|
const tagId = "@deepseek-ai/dsh-client-ui-conversation/TodoPanel.module.css";
|
|
16473
16473
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
16474
16474
|
const tag = document.createElement("style");
|
|
@@ -16481,6 +16481,7 @@ window.__ModuleLoader__.load({
|
|
|
16481
16481
|
"body": "UWFBKq_body",
|
|
16482
16482
|
"chevron": "UWFBKq_chevron",
|
|
16483
16483
|
"content": "UWFBKq_content",
|
|
16484
|
+
"contentCompleted": "UWFBKq_contentCompleted",
|
|
16484
16485
|
"glyph": "UWFBKq_glyph",
|
|
16485
16486
|
"glyphCompleted": "UWFBKq_glyphCompleted",
|
|
16486
16487
|
"glyphPending": "UWFBKq_glyphPending",
|
|
@@ -16638,7 +16639,7 @@ window.__ModuleLoader__.load({
|
|
|
16638
16639
|
"aria-hidden": true,
|
|
16639
16640
|
children: (0, react_jsx_runtime.jsx)(StatusGlyph, { status: item.status })
|
|
16640
16641
|
}), (0, react_jsx_runtime.jsx)("span", {
|
|
16641
|
-
className: TodoPanel_module_css_default.content,
|
|
16642
|
+
className: clsx(TodoPanel_module_css_default.content, item.status === "completed" && TodoPanel_module_css_default.contentCompleted),
|
|
16642
16643
|
children: item.content
|
|
16643
16644
|
})]
|
|
16644
16645
|
}, item.content))
|
|
@@ -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-b764393` + ({}.DSH_CLIENT_GIT_DIRTY === "true" ? "-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/dsh-client-store": "^0.1.6-alpha.2",
|
|
28
|
+
"@deepseek-ai/cordis": "^4.0.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: aa8b58adb4cf1e76bf811e4630b15bba6c1a3653
|
|
6
|
+
README.zh.md: bb19e39d7c185602a27debdd956406d422aec462
|
|
@@ -40,9 +40,9 @@ On quit the app prints `dsh: session <id> saved; resume with: dsh --profile tui
|
|
|
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 — 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.
|
|
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. Headings, links, list markers, quotes, and inline code share one cool dark-mode scale — a pale cyan, a deeper blue, and dim — so a reply sits beside a highlighted fence without contrasting hues. 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, a
|
|
45
|
+
Below the transcript sit a spinner while the agent works, any open prompt, a boxed follow-ups list 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, 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
|
|
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 follow-ups list 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 waits for the next turn in the
|
|
67
|
+
| `Enter` | Send the editor text; while a turn runs it waits for the next turn in the boxed follow-ups list above the editor until the loop claims it, entering the conversation then |
|
|
68
68
|
| `!command` / `!!command` | Run in this terminal; `!` is next-step context the next prompt can read, `!!` stays local |
|
|
69
69
|
| `Shift+Enter` | Insert a newline |
|
|
70
70
|
| `Ctrl+S` | While a turn runs, steer the editor text into the running turn's next step |
|
|
@@ -73,7 +73,7 @@ While the input has the keyboard:
|
|
|
73
73
|
| `Tab` | Take the completion the editor offers |
|
|
74
74
|
| `Shift+Tab` | Open the current model's reasoning-effort picker for the next request, the same picker as empty `/effort` |
|
|
75
75
|
| `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 |
|
|
76
|
-
| `Shift+Down` | Focus the
|
|
76
|
+
| `Shift+Down` | Focus the follow-ups list's first row while prompts wait, otherwise the subagent panel's first row while it is drawn, and the status bar otherwise |
|
|
77
77
|
| `Ctrl+G` | Read the conversation full screen, on its newest section |
|
|
78
78
|
| `Ctrl+O` | Expand or collapse every tool card and context row |
|
|
79
79
|
| `Esc` | Cancel a running `!`; with a leading `!` draft and no turn running, clear the editor; otherwise arm the stop, and a second press while that line is on screen stops the running turn |
|
|
@@ -82,16 +82,17 @@ While the input has the keyboard:
|
|
|
82
82
|
|
|
83
83
|
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, clears a draft that starts with `!`, 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.
|
|
84
84
|
|
|
85
|
-
While the
|
|
85
|
+
While the follow-ups panel has the keyboard:
|
|
86
86
|
|
|
87
87
|
| Key | Effect |
|
|
88
88
|
|---|---|
|
|
89
|
-
| `Up` / `Down`, `Home` / `End` | Select a pending
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
92
|
-
| `
|
|
89
|
+
| `Up` / `Down`, `Home` / `End` | Select a pending follow-up |
|
|
90
|
+
| `Enter` | Remove the selected follow-up from its queue and steer it into the nearest step, waking the Agent |
|
|
91
|
+
| `S` | The same steer as `Enter` |
|
|
92
|
+
| `I` | Move the selected follow-up to next-step injection without waking the Agent |
|
|
93
|
+
| `E` | Remove the selected follow-up into the editor; `Enter` sends the revision and `Ctrl+C` restores the original prompt to the next-turn queue |
|
|
93
94
|
| `Tab` / `Shift+Tab` | The next / previous region that is drawn |
|
|
94
|
-
| `Esc` |
|
|
95
|
+
| `Esc` | Cancel and return to the input |
|
|
95
96
|
| Any other printable key | Return to the input and type the character at the caret |
|
|
96
97
|
|
|
97
98
|
While the conversation has the keyboard:
|
|
@@ -153,7 +154,7 @@ While the reader is open:
|
|
|
153
154
|
|
|
154
155
|
Every other key reaching the reader is consumed, and closing it opens the same 750 ms handoff window, so no number of consecutive `Esc` presses reaches the input's stop.
|
|
155
156
|
|
|
156
|
-
Every focused segment expands its most important facts on the second line. `Enter` prints those facts into the transcript for every segment except `todo`, stating what they are and what changes them: the model segment names `/model`, the effort segment names the picker shared by `Shift+Tab` and `/effort`, and the permission segment names its preset, the `turn` segment — drawn as `turn <elapsed>` between the permission and usage segments, and only while a turn runs — gives the turn number, its start time, its elapsed time, and the queued-message counts, while the usage, context, goal, and plan segments print the matching sections of the `/status` report, the workspace segment the full path, and the attachments segment the pending attachments. The `todo` segment expands the counts by status and the item being worked on, or the next pending item when none is in progress, and `Enter` opens the agent's todo list, the same list `/todos` opens.
|
|
157
|
+
Every focused segment expands its most important facts on the second line. `Enter` prints those facts into the transcript for every segment except `todo`, stating what they are and what changes them: the model segment names `/model`, the effort segment names the picker shared by `Shift+Tab` and `/effort`, and the permission segment names its preset and the `/permission` picker, the `turn` segment — drawn as `turn <elapsed>` between the permission and usage segments, and only while a turn runs — gives the turn number, its start time, its elapsed time, and the queued-message counts, while the usage, context, goal, and plan segments print the matching sections of the `/status` report, the workspace segment the full path, and the attachments segment the pending attachments. The `todo` segment expands the counts by status and the item being worked on, or the next pending item when none is in progress, and `Enter` opens the agent's todo list, the same list `/todos` opens.
|
|
157
158
|
|
|
158
159
|
Typing `/` at the start of the editor completes the terminal's own commands and the shared registry's; `@` anywhere completes references. A nonempty `!command` or `!!command` line runs through `ctx.shell` in the session cwd at `danger-full-access`; the transcript shows `$ command` and the output. `!` injects a plugin notice for the next admitted step; `!!` does not. A lone `!` is an ordinary prompt.
|
|
159
160
|
|
|
@@ -162,6 +163,7 @@ Typing `/` at the start of the editor completes the terminal's own commands and
|
|
|
162
163
|
| `/help` | List the commands, and the keys each focus state answers |
|
|
163
164
|
| `/model` | Pick the model (type to filter the rows), then its reasoning effort when the model declares more than one, for the next request; `/model <provider>/<model>` selects directly, `/model save` stores the current selection as the default, and `Ctrl+S` in the model list stores the highlighted model as the default for the next launch without closing the list |
|
|
164
165
|
| `/effort [id]` | With no argument, open the current model's reasoning-effort picker for the next request, the same picker as editor `Shift+Tab`; an id selects directly and `/effort default` restores the provider default |
|
|
166
|
+
| `/permission [preset]` | With no argument, open the permission-preset picker; a preset selects directly |
|
|
165
167
|
| `/resume` | Open the same persisted-session picker as `/sessions` and resume the selected previous session |
|
|
166
168
|
| `/sessions` | Open the persisted-session picker and switch to the selected session |
|
|
167
169
|
| `/new` | Start a new session |
|
|
@@ -175,7 +177,7 @@ Typing `/` at the start of the editor completes the terminal's own commands and
|
|
|
175
177
|
| `/login` | Sign in with a provider subscription (hides key-collecting logins); `/login <key>` skips the picker |
|
|
176
178
|
| `/export [dir]` | Write this session's log ZIP (sub-sessions and attachments included) into `dir`, default the workspace |
|
|
177
179
|
| `/status` | Context window usage and breakdown, token totals with cache hit, session stats, todos, goal, plan mode, and permission |
|
|
178
|
-
| `/todos` | Browse the agent's todo list; `Enter` opens one item in full with its status, position, and turns |
|
|
180
|
+
| `/todos` | Browse the agent's todo list; completed rows are scratched out; `Enter` opens one item in full with its status, position, and turns |
|
|
179
181
|
| `/outline` | The turns of this session with their prompt and reply previews |
|
|
180
182
|
| `/deliverables` | The files the agent presented, grouped by turn |
|
|
181
183
|
| `/changes [turn]` | Browse the files the latest turn changed, or turn `turn`, with their line counts; `Enter` opens one file's turn-start to turn-end comparison |
|
|
@@ -186,9 +188,9 @@ Typing `/` at the start of the editor completes the terminal's own commands and
|
|
|
186
188
|
| `/turns` | Read the conversation full screen, turns side by side, like `Ctrl+G` |
|
|
187
189
|
| `/quit`, `/exit` | Save the session and exit |
|
|
188
190
|
|
|
189
|
-
Every other `/name` line goes to the shared command registry, so `/compact`, `/
|
|
191
|
+
Every other `/name` line goes to the shared command registry, so `/compact`, `/goal`, and plugin commands work as they do in the browser.
|
|
190
192
|
|
|
191
|
-
Every picker the terminal opens — `/model`'s model and reasoning-effort lists, the current-model effort list shared by empty `/effort` and editor `Shift+Tab`, the persisted-session list shared by `/resume` and `/sessions`, the `/subagents` and `/todos` lists, and the rows `/signin` and `/login` raise — filters its rows as you type: the query matches each row's label and description together, its whitespace- and slash-separated tokens must all match, and the rows are ordered best match first, so `dsk chat` and `deepseek/chat` both find `deepseek/deepseek-chat` and `gpt5` finds `gpt-5`. `Backspace` drops the last character, `Ctrl+U` clears the query, `Esc` clears a non-empty query and cancels the picker once the query is empty, `Up` / `Down` move within the matches, and `Enter` picks the highlighted row. The dim line above the rows reads `type to filter · Enter selects · Esc cancels` while the query is empty and `filter: <query> · <kept>/<total>` afterwards; a query nothing matches draws `no row matches "<query>"` in place of the rows, and the `✓` on the row in force — the row a picker opens on — shows only while the query is empty.
|
|
193
|
+
Every picker the terminal opens — `/model`'s model and reasoning-effort lists, the current-model effort list shared by empty `/effort` and editor `Shift+Tab`, the permission-preset list empty `/permission` opens, the persisted-session list shared by `/resume` and `/sessions`, the `/subagents` and `/todos` lists, and the rows `/signin` and `/login` raise — filters its rows as you type: the query matches each row's label and description together, its whitespace- and slash-separated tokens must all match, and the rows are ordered best match first, so `dsk chat` and `deepseek/chat` both find `deepseek/deepseek-chat` and `gpt5` finds `gpt-5`. `Backspace` drops the last character, `Ctrl+U` clears the query, `Esc` clears a non-empty query and cancels the picker once the query is empty, `Up` / `Down` move within the matches, and `Enter` picks the highlighted row. The dim line above the rows reads `type to filter · Enter selects · Esc cancels` while the query is empty and `filter: <query> · <kept>/<total>` afterwards; a query nothing matches draws `no row matches "<query>"` in place of the rows, and the `✓` on the row in force — the row a picker opens on — shows only while the query is empty.
|
|
192
194
|
|
|
193
195
|
`/subagents`, `/todos`, and the `todo` status-bar segment share one list-then-details interaction: the picker lists the entries, `Enter` opens the highlighted entry as a read-only page, `Up` / `Down` and `PageUp` / `PageDown` scroll that page, and `Enter`, `Esc`, or `Left` returns to the list on the entry just read, so walking several entries costs no retyped command; `Esc` at the list returns to the editor. An entry whose details cannot be read says so on its page instead of closing the list.
|
|
194
196
|
|
|
@@ -256,6 +258,7 @@ The patch rides over `dsh-base`: it sets the coding persona prefix and cwd suffi
|
|
|
256
258
|
| [`src/keys.ts`](src/keys.ts) | The key model: the focus regions, what one press means in each, the legends they degrade through, the entry keys, the `/help` lines, and the handoff window |
|
|
257
259
|
| [`src/sessions.ts`](src/sessions.ts) | The persisted-session list and picker rows shared by `/resume` and `/sessions` |
|
|
258
260
|
| [`src/effort.ts`](src/effort.ts) | Reasoning-effort names and picker rows shared by `/model`, `/effort`, and editor `Shift+Tab` |
|
|
261
|
+
| [`src/permission.ts`](src/permission.ts) | Permission-preset names and picker rows for `/permission` |
|
|
259
262
|
| [`src/attach.ts`](src/attach.ts) | `/attach`: local files into image or file blocks through the attachment store |
|
|
260
263
|
| [`src/export.ts`](src/export.ts) | `/export`: the session-log ZIP written through the export package's archive helpers |
|
|
261
264
|
| [`src/blocks.ts`](src/blocks.ts) | Transcript components: user prompt, assistant reply, tool card, system prompt and injected context, notice; the navigable blocks expose their sections and draw the focus gutter, and the foldable ones carry the marker both fold keys name. Each block keeps the lines it last drew and a reply keeps the coloured fences of its last Markdown parse, so a frame of a settled transcript costs one key comparison per block and a stream delta colours only the fence that changed |
|
|
@@ -273,7 +276,7 @@ The patch rides over `dsh-base`: it sets the coding persona prefix and cwd suffi
|
|
|
273
276
|
| [`src/toast.ts`](src/toast.ts) | The transient key-feedback line: its overlay, its clock, and the lines it carries |
|
|
274
277
|
| [`src/transcript.ts`](src/transcript.ts) | Pure text folding of presentation views, usage, and turn-end reasons, and the one fold grammar every marker is written in |
|
|
275
278
|
| [`src/diff.ts`](src/diff.ts) | Line diff and hunk selection for diff cards |
|
|
276
|
-
| [`src/style.ts`](src/style.ts) | The palette and the derived pi-tui themes |
|
|
279
|
+
| [`src/style.ts`](src/style.ts) | The palette, including the cool dark-mode heading and link hues a Markdown reply uses, the strikethrough role completed todo content uses, and the derived pi-tui themes |
|
|
277
280
|
| [`src/highlight.ts`](src/highlight.ts) | Syntax colour for fenced code: the grammars a fence may load, the theme the background picks, and the SGR one token is drawn with |
|
|
278
281
|
| [`src/completion.ts`](src/completion.ts) | Slash-command and `@`-reference completion for the editor |
|
|
279
282
|
| [`src/editor.ts`](src/editor.ts) | The prompt editor's terminal caret and its `Shift+Left` / `Shift+Right` mapping to pi-tui word navigation |
|
|
@@ -281,11 +284,12 @@ The patch rides over `dsh-base`: it sets the coding persona prefix and cwd suffi
|
|
|
281
284
|
| [`src/status.ts`](src/status.ts) | Projection-seam facts and the sections the `/status` report and the segment details share; compaction and retry notices |
|
|
282
285
|
| [`src/footer.ts`](src/footer.ts) | The status bar: the ordered segments, each segment's detail rows, the unfocused line built from both ends, and the focused sliding window |
|
|
283
286
|
| [`src/subagent-panel.ts`](src/subagent-panel.ts) | The live subagent panel: one descendant listing plus sampled live facts become its rows, the unfocused summary line, and the focused listing |
|
|
287
|
+
| [`src/queue-panel.ts`](src/queue-panel.ts) | The follow-ups list: pending-row glyphs, hanging wrap, and the enter-steer legend |
|
|
284
288
|
| [`src/catalog.ts`](src/catalog.ts) | Rows for `/settings`, `/plugins`, `/subagents`, `/deliverables`, `/changes`, and `/outline`, and the `/plugins` management verbs |
|
|
285
|
-
| [`src/todos.ts`](src/todos.ts) | The todo list: the status glyphs, the picker rows, and one item's detail rows |
|
|
289
|
+
| [`src/todos.ts`](src/todos.ts) | The todo list: the status glyphs, the picker rows with completed content scratched out, and one item's detail rows |
|
|
286
290
|
| [`cordis.patch.yml`](cordis.patch.yml) | The terminal patch over `dsh-base` |
|
|
287
291
|
| — | No runtime invariant companion is published; the app registers listeners on one Agent and holds no mutable relation another observer could contradict. |
|
|
288
|
-
| [`tests/app.spec.ts`](tests/app.spec.ts) | Rendering, keys, commands, the stop arm, the
|
|
292
|
+
| [`tests/app.spec.ts`](tests/app.spec.ts) | Rendering, keys, commands, the stop arm, the follow-ups rows above the editor, and both seams over a fake terminal |
|
|
289
293
|
| [`tests/keys.spec.ts`](tests/keys.spec.ts) | What each region claims for a key, the legend steps, and the text one press types |
|
|
290
294
|
| [`tests/editor.spec.ts`](tests/editor.spec.ts) | The terminal caret and `Shift+Left` / `Shift+Right` word navigation against pi-tui's editor behavior |
|
|
291
295
|
| [`tests/frame.spec.ts`](tests/frame.spec.ts) | The rules, the chip, the body rows, and the legend a width holds |
|
|
@@ -294,9 +298,10 @@ The patch rides over `dsh-base`: it sets the coding persona prefix and cwd suffi
|
|
|
294
298
|
| [`tests/reader.spec.ts`](tests/reader.spec.ts) | The reader's geometry, its state machine, its filter, and the rows it returns |
|
|
295
299
|
| [`tests/reader-screen.spec.ts`](tests/reader-screen.spec.ts) | The reader pane: its key map, the screen it fills, its re-anchoring, and its exit |
|
|
296
300
|
| [`tests/alt-screen.spec.ts`](tests/alt-screen.spec.ts) | The alternate screen: its balanced switches, its per-row drawing, and the rows a shorter frame clears |
|
|
297
|
-
| [`tests/commands.spec.ts`](tests/commands.spec.ts) | The `/resume` and `/sessions` picker, attachments, queues, skills, sign-in, export, references, the picker shared by `/effort` and `Shift+Tab`, and `Ctrl+S` in the model list over scripted services |
|
|
301
|
+
| [`tests/commands.spec.ts`](tests/commands.spec.ts) | The `/resume` and `/sessions` picker, attachments, queues, skills, sign-in, export, references, the picker shared by `/effort` and `Shift+Tab`, the `/permission` picker, and `Ctrl+S` in the model list over scripted services |
|
|
298
302
|
| [`tests/shell.spec.ts`](tests/shell.spec.ts) | Prefix-on-submit `!` / `!!` dispatch, next-step inject, Esc cancel, and the missing-shell notice |
|
|
299
303
|
| [`tests/effort.spec.ts`](tests/effort.spec.ts) | Shared effort names, picker rows, the current-effort hint, and typed argument matching |
|
|
304
|
+
| [`tests/permission.spec.ts`](tests/permission.spec.ts) | Shared permission names, picker rows, the current-preset hint, and typed argument matching |
|
|
300
305
|
| [`tests/panels.spec.ts`](tests/panels.spec.ts) | Status footer and report, the navigable subagent and todo lists, catalog commands, command hints, and the approval detail |
|
|
301
306
|
| [`tests/transcript-focus.spec.ts`](tests/transcript-focus.spec.ts) | Walking the conversation, the region stack, the inspector, the reader over a live session with the terminal it takes and gives back, and the in-place gutter inside the repaint window |
|
|
302
307
|
| [`tests/context.spec.ts`](tests/context.spec.ts) | Projection of system prompts and injected context into transcript sections |
|
|
@@ -40,9 +40,9 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
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 卡片的变更行——其中 `+` 新增项标为绿色、`-` 删除项标为红色,符号后的源文本按文件扩展名对应的语言绘制——都使用语法高亮,配色主题由终端自身的背景在明暗之间选定;某种语言的语法会在第一个用到它的代码块出现时才加载,因此该块先以纯文本绘制、随后被重绘为彩色;这里没有对应语法的语言、既不支持 24 位也不支持 256 色的终端,以及 `codeHighlight: false
|
|
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 工作时的旋转指示、任何打开的提示、有消息等待时的带框 follow-ups 列表、编辑器、子 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 面板与状态栏构成垂直方向键走查:在最新小节上按 `Down`、在子 agent 面板第一行上按 `Up`、在没有绘制子 agent 面板时于状态栏上按 `Up
|
|
61
|
+
对话记录、编辑器、子 agent 面板与状态栏构成垂直方向键走查:在最新小节上按 `Down`、在子 agent 面板第一行上按 `Up`、在没有绘制子 agent 面板时于状态栏上按 `Up`,都会落到光标处。follow-ups 列表位于输入框上方;绘制该列表时,`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` | 发送编辑器文本;轮次进行中时它在编辑器上方的带框 follow-ups 列表中等待下一轮次,直到循环领取它后才进入对话 |
|
|
68
68
|
| `!command` / `!!command` | 在本终端运行;`!` 会作为下一步上下文供下一条提示阅读,`!!` 只留在本地 |
|
|
69
69
|
| `Shift+Enter` | 插入换行 |
|
|
70
70
|
| `Ctrl+S` | 轮次进行中时,把编辑器文本引导(steer)进当前轮次的下一步 |
|
|
@@ -73,7 +73,7 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
73
73
|
| `Tab` | 采用编辑器给出的补全 |
|
|
74
74
|
| `Shift+Tab` | 打开当前模型的推理强度选择器,从下一次请求生效;与空参数 `/effort` 打开的是同一个选择器 |
|
|
75
75
|
| `Shift+Up` | 把焦点放到对话记录上、停在走查上次停下的小节;首次进入以及切换会话后的首次进入停在最新小节 |
|
|
76
|
-
| `Shift+Down` |
|
|
76
|
+
| `Shift+Down` | 有提示等待时把焦点放到 follow-ups 列表第一行,否则在子 agent 面板已绘制时放到其第一行,再否则放到状态栏 |
|
|
77
77
|
| `Ctrl+G` | 整屏读出对话记录,停在其最新小节 |
|
|
78
78
|
| `Ctrl+O` | 展开或折叠所有工具卡片与上下文行 |
|
|
79
79
|
| `Esc` | 取消正在运行的 `!`;在没有轮次进行且草稿以 `!` 开头时清空编辑器;否则装填停止,该提示仍在屏幕上时再按一次会停止正在进行的轮次 |
|
|
@@ -82,16 +82,17 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
82
82
|
|
|
83
83
|
仅仅交还了键盘的 `Esc`——离开某个区域、关闭页面、选择器或阅读器——会打开一个 750 ms 的窗口,其间到达编辑器的 `Esc` 完全不做任何事,因此习惯性的连按停不掉任何轮次。没有轮次进行时,`Esc` 在补全列表打开时关闭它,清空以 `!` 开头的草稿,其余情况保持沉默。尚无可读内容的会话对 `Shift+Up` 与 `Ctrl+G` 回以 `nothing in the transcript to read yet`,并把键盘留在编辑器。
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
follow-ups 面板持有键盘时:
|
|
86
86
|
|
|
87
87
|
| 按键 | 效果 |
|
|
88
88
|
|---|---|
|
|
89
|
-
| `Up` / `Down`、`Home` / `End` |
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
92
|
-
| `
|
|
89
|
+
| `Up` / `Down`、`Home` / `End` | 选择一条待处理 follow-up |
|
|
90
|
+
| `Enter` | 从队列移除所选 follow-up,并把它引导进最近的步骤,同时唤醒 Agent |
|
|
91
|
+
| `S` | 与 `Enter` 相同的引导 |
|
|
92
|
+
| `I` | 把所选 follow-up 移到下一步骤的注入队列,但不唤醒 Agent |
|
|
93
|
+
| `E` | 从队列移除所选 follow-up 并放入编辑器;`Enter` 发送修订内容,`Ctrl+C` 把原提示恢复到下一轮次队列 |
|
|
93
94
|
| `Tab` / `Shift+Tab` | 下一个 / 上一个已绘制区域 |
|
|
94
|
-
| `Esc` |
|
|
95
|
+
| `Esc` | 取消并返回输入框 |
|
|
95
96
|
| 任何其他可打印键 | 返回输入框并在光标处输入该字符 |
|
|
96
97
|
|
|
97
98
|
对话记录持有键盘时:
|
|
@@ -153,7 +154,7 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
153
154
|
|
|
154
155
|
到达阅读器的其他每个按键都被消费,而关闭它同样打开那 750 ms 的交接窗口,因此连按多少次 `Esc` 都到不了编辑器的停止。
|
|
155
156
|
|
|
156
|
-
每个聚焦的分段都在第二行展开其最重要的事实。除 `todo` 之外,`Enter` 把这些事实打印到对话记录,并指出改变它们的方式:模型分段指出 `/model`,推理强度分段指出 `Shift+Tab` 与 `/effort`
|
|
157
|
+
每个聚焦的分段都在第二行展开其最重要的事实。除 `todo` 之外,`Enter` 把这些事实打印到对话记录,并指出改变它们的方式:模型分段指出 `/model`,推理强度分段指出 `Shift+Tab` 与 `/effort` 共用的选择器,权限分段指出其预设以及 `/permission` 选择器;`turn` 分段——绘制在权限与用量分段之间、形如 `turn <elapsed>`,且只在轮次进行时出现——给出轮次编号、其开始时间、已用时间与排队消息数量;用量、上下文、目标与计划分段打印 `/status` 报告中对应的小节,workspace 分段显示完整路径,附件分段列出待发送的附件。`todo` 分段展开按状态统计的计数以及正在进行的条目(若无正在进行的条目则为下一条待办),`Enter` 打开 agent 的 todo 列表,与 `/todos` 打开的是同一个列表。
|
|
157
158
|
|
|
158
159
|
在编辑器开头输入 `/` 会补全终端自身的命令与共享注册表的命令;任意位置的 `@` 补全引用。非空的 `!command` 或 `!!command` 行经 `ctx.shell` 在会话 cwd 以 `danger-full-access` 运行;对话记录显示 `$ command` 与输出。`!` 会注入一条插件通知供下一步领取;`!!` 不会。单独的 `!` 仍是普通提示。
|
|
159
160
|
|
|
@@ -162,6 +163,7 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
162
163
|
| `/help` | 列出命令,以及每个焦点状态所应答的按键 |
|
|
163
164
|
| `/model` | 为下一次请求选择模型(输入即可过滤行),若模型声明多于一种推理强度则接着选择强度;`/model <provider>/<model>` 直接选择,`/model save` 把当前选择存为默认,在模型列表中按 `Ctrl+S` 则把高亮的模型存为下次启动的默认而不关闭列表 |
|
|
164
165
|
| `/effort [id]` | 不带参数时为下一次请求打开当前模型的推理强度选择器,与编辑器中的 `Shift+Tab` 打开的是同一个;id 直接选择,`/effort default` 恢复提供方默认值 |
|
|
166
|
+
| `/permission [preset]` | 不带参数时打开权限预设选择器;preset 直接选择 |
|
|
165
167
|
| `/resume` | 打开与 `/sessions` 相同的持久化会话选择器,并恢复选中的先前会话 |
|
|
166
168
|
| `/sessions` | 打开持久化会话选择器,并切换到选中的会话 |
|
|
167
169
|
| `/new` | 开始新会话 |
|
|
@@ -175,7 +177,7 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
175
177
|
| `/login` | 用提供方订阅登录(隐藏仅收集密钥的登录);`/login <key>` 跳过选择器 |
|
|
176
178
|
| `/export [dir]` | 把本会话的日志 ZIP(含子会话与附件)写入 `dir`,默认 workspace |
|
|
177
179
|
| `/status` | 上下文窗口用量与构成、含缓存命中的 token 总计、会话统计、todo、目标、计划模式与权限 |
|
|
178
|
-
| `/todos` | 浏览 agent 的 todo
|
|
180
|
+
| `/todos` | 浏览 agent 的 todo 列表;已完成行会被划掉;`Enter` 完整打开其中一条,含其状态、位置与轮次 |
|
|
179
181
|
| `/outline` | 本会话各轮次及其提示与回复预览 |
|
|
180
182
|
| `/deliverables` | agent 交付的文件,按轮次分组 |
|
|
181
183
|
| `/changes [turn]` | 浏览最近一轮(或第 `turn` 轮)改动的文件及其行数;`Enter` 打开某个文件从轮次开始到结束的对比 |
|
|
@@ -186,9 +188,9 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
186
188
|
| `/turns` | 像 `Ctrl+G` 一样整屏读出对话记录,各轮次并排 |
|
|
187
189
|
| `/quit`、`/exit` | 保存会话并退出 |
|
|
188
190
|
|
|
189
|
-
其他每条 `/name` 行都交给共享命令注册表,因此 `/compact`、`/
|
|
191
|
+
其他每条 `/name` 行都交给共享命令注册表,因此 `/compact`、`/goal` 与插件命令的行为和浏览器中一致。
|
|
190
192
|
|
|
191
|
-
终端打开的每个选择器——`/model` 的模型列表与推理强度列表、空参数 `/effort` 与编辑器 `Shift+Tab`
|
|
193
|
+
终端打开的每个选择器——`/model` 的模型列表与推理强度列表、空参数 `/effort` 与编辑器 `Shift+Tab` 共用的当前模型推理强度列表、空参数 `/permission` 打开的权限预设列表、`/resume` 与 `/sessions` 共用的持久化会话列表、`/subagents` 与 `/todos` 的列表,以及 `/signin` 与 `/login` 引出的各行——都随输入过滤其行:查询同时匹配每行的标签与描述,其以空白与斜杠分隔的各段必须全部匹配,各行按最佳匹配在前排序,因此 `dsk chat` 与 `deepseek/chat` 都能找到 `deepseek/deepseek-chat`,`gpt5` 能找到 `gpt-5`。`Backspace` 删除最后一个字符,`Ctrl+U` 清空查询,`Esc` 在查询非空时清空查询、在查询为空时取消选择器,`Up` / `Down` 在匹配行之间移动,`Enter` 选中高亮行。行上方的暗色行在查询为空时显示 `type to filter · Enter selects · Esc cancels`,此后显示 `filter: <query> · <kept>/<total>`;无任何行匹配的查询会以 `no row matches "<query>"` 取代这些行,而生效行上的 `✓`——也就是选择器打开时定位的那一行——只在查询为空时显示。
|
|
192
194
|
|
|
193
195
|
`/subagents`、`/todos` 与状态栏的 `todo` 分段共用同一套先列表、后详情的交互:选择器列出各条目,`Enter` 把高亮条目作为只读页面打开,`Up` / `Down` 与 `PageUp` / `PageDown` 滚动该页面,`Enter`、`Esc` 或 `Left` 返回列表并停在刚读过的条目上,因此连续查看多个条目无需重新输入命令;在列表上按 `Esc` 返回编辑器。详情无法读取的条目会在其页面上说明原因,而不会关闭列表。
|
|
194
196
|
|
|
@@ -256,6 +258,7 @@ runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心
|
|
|
256
258
|
| [`src/keys.ts`](src/keys.ts) | 按键模型:各焦点区域、一次按键在每个区域中的含义、它们逐级收缩的按键提示、进入用的按键、`/help` 的各行,以及交接窗口 |
|
|
257
259
|
| [`src/sessions.ts`](src/sessions.ts) | `/resume` 与 `/sessions` 共用的持久化会话列表及选择器行 |
|
|
258
260
|
| [`src/effort.ts`](src/effort.ts) | `/model`、`/effort` 与编辑器 `Shift+Tab` 共用的推理强度名称及选择器行 |
|
|
261
|
+
| [`src/permission.ts`](src/permission.ts) | `/permission` 的权限预设名称及选择器行 |
|
|
259
262
|
| [`src/attach.ts`](src/attach.ts) | `/attach`:本地文件经附件存储成为图片或文件块 |
|
|
260
263
|
| [`src/export.ts`](src/export.ts) | `/export`:通过导出包的归档辅助函数写出会话日志 ZIP |
|
|
261
264
|
| [`src/blocks.ts`](src/blocks.ts) | 对话记录组件:用户提示、assistant 回复、工具卡片、系统提示词与注入上下文、通知;可导航的块暴露其各小节并绘制焦点标记条,可折叠的块则承载两个折叠键共用的那条标记。每个块保留上次画出的行,回复还保留上次 Markdown 解析所着色的代码围栏,因此已稳定的对话记录每帧只花每块一次键比较,一次流式增量也只为发生变化的那个围栏着色 |
|
|
@@ -273,7 +276,7 @@ runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心
|
|
|
273
276
|
| [`src/toast.ts`](src/toast.ts) | 临时按键提示行:其浮层、其时钟,以及它承载的各条文字 |
|
|
274
277
|
| [`src/transcript.ts`](src/transcript.ts) | 呈现视图、用量与轮次结束原因的纯文本折叠,以及每条标记共用的那一套折叠措辞 |
|
|
275
278
|
| [`src/diff.ts`](src/diff.ts) | diff 卡片的行 diff 与 hunk 选择 |
|
|
276
|
-
| [`src/style.ts`](src/style.ts) |
|
|
279
|
+
| [`src/style.ts`](src/style.ts) | 调色板(含 Markdown 回复所用的暗色冷色阶标题与链接色、已完成 todo 内容所用的划线角色)与派生的 pi-tui 主题 |
|
|
277
280
|
| [`src/highlight.ts`](src/highlight.ts) | 围栏代码的语法高亮:某个围栏可能加载的语法、由背景选定的配色主题,以及一个 token 所用的 SGR |
|
|
278
281
|
| [`src/completion.ts`](src/completion.ts) | 编辑器的斜杠命令与 `@` 引用补全 |
|
|
279
282
|
| [`src/editor.ts`](src/editor.ts) | 提示编辑器的终端光标,以及把 `Shift+Left` / `Shift+Right` 映射到 pi-tui 词导航的逻辑 |
|
|
@@ -281,11 +284,12 @@ runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心
|
|
|
281
284
|
| [`src/status.ts`](src/status.ts) | 投影接缝的事实,以及 `/status` 报告与分段详情共享的小节;压缩与重试通知 |
|
|
282
285
|
| [`src/footer.ts`](src/footer.ts) | 状态栏:有序的各分段、每个分段的详情行、未聚焦时由两端向内构建的一行,以及聚焦时的滑动窗口 |
|
|
283
286
|
| [`src/subagent-panel.ts`](src/subagent-panel.ts) | 实时子 agent 面板:一次后代列表加上采样到的实时事实构成其各行、未聚焦时的摘要行,以及聚焦时的列表 |
|
|
287
|
+
| [`src/queue-panel.ts`](src/queue-panel.ts) | follow-ups 列表:待处理行符号、悬挂换行与 enter-steer 图例 |
|
|
284
288
|
| [`src/catalog.ts`](src/catalog.ts) | `/settings`、`/plugins`、`/subagents`、`/deliverables`、`/changes` 与 `/outline` 的行,以及 `/plugins` 的管理动作 |
|
|
285
|
-
| [`src/todos.ts`](src/todos.ts) | todo
|
|
289
|
+
| [`src/todos.ts`](src/todos.ts) | todo 列表:状态符号、已完成内容划掉的选择器行与单个条目的详情行 |
|
|
286
290
|
| [`cordis.patch.yml`](cordis.patch.yml) | 基于 `dsh-base` 的终端 patch |
|
|
287
291
|
| — | 不发布运行时不变量伴随模块;应用只在一个 Agent 上注册监听器,不持有其他观察者可能与之矛盾的可变关系。 |
|
|
288
|
-
| [`tests/app.spec.ts`](tests/app.spec.ts) |
|
|
292
|
+
| [`tests/app.spec.ts`](tests/app.spec.ts) | 基于伪终端的渲染、按键、命令、停止装填、编辑器上方的 follow-ups 行与两个接缝 |
|
|
289
293
|
| [`tests/keys.spec.ts`](tests/keys.spec.ts) | 每个区域为一个按键认领什么、按键提示的各级,以及一次按键输入的文字 |
|
|
290
294
|
| [`tests/editor.spec.ts`](tests/editor.spec.ts) | 对照 pi-tui 编辑器行为验证终端光标与 `Shift+Left` / `Shift+Right` 词导航 |
|
|
291
295
|
| [`tests/frame.spec.ts`](tests/frame.spec.ts) | 边框线、徽标、正文行,以及某个宽度容纳得下的按键提示 |
|
|
@@ -294,9 +298,10 @@ runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心
|
|
|
294
298
|
| [`tests/reader.spec.ts`](tests/reader.spec.ts) | 阅读器的几何布局、其状态机、其过滤,以及它返回的各行 |
|
|
295
299
|
| [`tests/reader-screen.spec.ts`](tests/reader-screen.spec.ts) | 阅读器面板:其按键映射、它铺满的屏幕、其重新锚定与其退出 |
|
|
296
300
|
| [`tests/alt-screen.spec.ts`](tests/alt-screen.spec.ts) | 备用屏幕:其成对的切换、其逐行绘制,以及更短的一帧所清除的行 |
|
|
297
|
-
| [`tests/commands.spec.ts`](tests/commands.spec.ts) | 基于脚本化服务的 `/resume` 与 `/sessions` 选择器、附件、队列、技能、登录、导出、引用、`/effort` 与 `Shift+Tab`
|
|
301
|
+
| [`tests/commands.spec.ts`](tests/commands.spec.ts) | 基于脚本化服务的 `/resume` 与 `/sessions` 选择器、附件、队列、技能、登录、导出、引用、`/effort` 与 `Shift+Tab` 共用的选择器、`/permission` 选择器,以及模型列表中的 `Ctrl+S` |
|
|
298
302
|
| [`tests/shell.spec.ts`](tests/shell.spec.ts) | 提交时解析的 `!` / `!!` 分发、下一步 inject、Esc 取消,以及缺少 shell 时的通知 |
|
|
299
303
|
| [`tests/effort.spec.ts`](tests/effort.spec.ts) | 共用的推理强度名称、选择器行、当前强度提示与输入参数匹配 |
|
|
304
|
+
| [`tests/permission.spec.ts`](tests/permission.spec.ts) | 共用的权限名称、选择器行、当前预设提示与输入参数匹配 |
|
|
300
305
|
| [`tests/panels.spec.ts`](tests/panels.spec.ts) | 状态页脚与报告、可导航的子 agent 与 todo 列表、目录命令、命令提示与审批详情 |
|
|
301
306
|
| [`tests/transcript-focus.spec.ts`](tests/transcript-focus.spec.ts) | 走遍对话记录、区域序列、检视面板、实时会话上的阅读器连同它接管与交还的终端,以及重绘窗口内的原地标记条 |
|
|
302
307
|
| [`tests/context.spec.ts`](tests/context.spec.ts) | 把系统提示词与注入上下文投影为对话记录小节 |
|
|
@@ -2239,7 +2239,10 @@ const SGR = {
|
|
|
2239
2239
|
bold: ["1", "22"],
|
|
2240
2240
|
italic: ["3", "23"],
|
|
2241
2241
|
underline: ["4", "24"],
|
|
2242
|
+
strikethrough: ["9", "29"],
|
|
2242
2243
|
accent: ["36", "39"],
|
|
2244
|
+
heading: ["38;5;117", "39"],
|
|
2245
|
+
link: ["38;5;75", "39"],
|
|
2243
2246
|
success: ["32", "39"],
|
|
2244
2247
|
warning: ["33", "39"],
|
|
2245
2248
|
error: ["31", "39"],
|
|
@@ -2260,7 +2263,10 @@ function createPalette(enabled) {
|
|
|
2260
2263
|
bold: role("bold"),
|
|
2261
2264
|
italic: role("italic"),
|
|
2262
2265
|
underline: role("underline"),
|
|
2266
|
+
strikethrough: role("strikethrough"),
|
|
2263
2267
|
accent: role("accent"),
|
|
2268
|
+
heading: role("heading"),
|
|
2269
|
+
link: role("link"),
|
|
2264
2270
|
success: role("success"),
|
|
2265
2271
|
warning: role("warning"),
|
|
2266
2272
|
error: role("error"),
|
|
@@ -2306,19 +2312,19 @@ function colorEnabled(env, isTty) {
|
|
|
2306
2312
|
function markdownTheme(palette, highlight) {
|
|
2307
2313
|
return {
|
|
2308
2314
|
highlightCode: (code, lang) => highlight?.lines(code, lang) ?? code.split("\n"),
|
|
2309
|
-
heading: (text) => palette.bold(palette.
|
|
2310
|
-
link: palette.
|
|
2315
|
+
heading: (text) => palette.bold(palette.heading(text)),
|
|
2316
|
+
link: (text) => palette.underline(palette.link(text)),
|
|
2311
2317
|
linkUrl: palette.dim,
|
|
2312
|
-
code: palette.
|
|
2318
|
+
code: palette.link,
|
|
2313
2319
|
codeBlock: (text) => text,
|
|
2314
2320
|
codeBlockBorder: palette.dim,
|
|
2315
|
-
quote: palette.italic,
|
|
2321
|
+
quote: (text) => palette.italic(palette.dim(text)),
|
|
2316
2322
|
quoteBorder: palette.dim,
|
|
2317
2323
|
hr: palette.dim,
|
|
2318
|
-
listBullet: palette.
|
|
2324
|
+
listBullet: palette.heading,
|
|
2319
2325
|
bold: palette.bold,
|
|
2320
2326
|
italic: palette.italic,
|
|
2321
|
-
strikethrough: palette.
|
|
2327
|
+
strikethrough: palette.strikethrough,
|
|
2322
2328
|
underline: palette.underline
|
|
2323
2329
|
};
|
|
2324
2330
|
}
|
|
@@ -3635,6 +3641,54 @@ function matchEffort(reasoning, typed) {
|
|
|
3635
3641
|
return wanted === DEFAULT_ARGUMENT ? void 0 : null;
|
|
3636
3642
|
}
|
|
3637
3643
|
//#endregion
|
|
3644
|
+
//#region lib/types/permission.js
|
|
3645
|
+
/**
|
|
3646
|
+
* Permission-preset rows and labels shared by `/permission` and the
|
|
3647
|
+
* permission status-bar hint.
|
|
3648
|
+
* @module @deepseek-ai/dsh-tui-app/permission
|
|
3649
|
+
*/
|
|
3650
|
+
/**
|
|
3651
|
+
* The display name of one preset.
|
|
3652
|
+
* @param options - the process catalog.
|
|
3653
|
+
* @param preset - the selected preset, including a derived `custom` value.
|
|
3654
|
+
* @returns the catalog label, or the raw id when the catalog no longer lists it.
|
|
3655
|
+
*/
|
|
3656
|
+
function permissionName(options, preset) {
|
|
3657
|
+
return options.find((option) => option.value === preset)?.name ?? preset;
|
|
3658
|
+
}
|
|
3659
|
+
/**
|
|
3660
|
+
* Picker rows for the process catalog, in contribution order.
|
|
3661
|
+
* @param options - the selectable presets.
|
|
3662
|
+
* @returns the rows.
|
|
3663
|
+
*/
|
|
3664
|
+
function permissionItems(options) {
|
|
3665
|
+
return options.map((option) => ({
|
|
3666
|
+
value: option.value,
|
|
3667
|
+
label: option.name,
|
|
3668
|
+
...option.description === void 0 ? {} : { description: option.description }
|
|
3669
|
+
}));
|
|
3670
|
+
}
|
|
3671
|
+
/**
|
|
3672
|
+
* The dim row under the picker heading.
|
|
3673
|
+
* @param options - the process catalog.
|
|
3674
|
+
* @param preset - the preset in force.
|
|
3675
|
+
* @returns one row naming the preset in force and how to dismiss the picker.
|
|
3676
|
+
*/
|
|
3677
|
+
function permissionHint(options, preset) {
|
|
3678
|
+
return `current: ${permissionName(options, preset)} · Esc keeps it`;
|
|
3679
|
+
}
|
|
3680
|
+
/**
|
|
3681
|
+
* The preset a typed `/permission` argument names. Matching is without case
|
|
3682
|
+
* so a typed id can follow the catalog's own casing.
|
|
3683
|
+
* @param options - the process catalog.
|
|
3684
|
+
* @param typed - the argument, matched against catalog values.
|
|
3685
|
+
* @returns the catalog value, or null when nothing matches.
|
|
3686
|
+
*/
|
|
3687
|
+
function matchPermission(options, typed) {
|
|
3688
|
+
const wanted = typed.toLowerCase();
|
|
3689
|
+
return options.find((option) => option.value.toLowerCase() === wanted)?.value ?? null;
|
|
3690
|
+
}
|
|
3691
|
+
//#endregion
|
|
3638
3692
|
//#region lib/types/export.js
|
|
3639
3693
|
/**
|
|
3640
3694
|
* `/export`: the same session-log ZIP the browser downloads, written to a
|
|
@@ -3829,9 +3883,9 @@ const HINTS = {
|
|
|
3829
3883
|
"Esc input"
|
|
3830
3884
|
],
|
|
3831
3885
|
queue: [
|
|
3832
|
-
"
|
|
3833
|
-
"
|
|
3834
|
-
"
|
|
3886
|
+
"enter steer · ↑ select/edit · esc cancel",
|
|
3887
|
+
"enter steer · esc cancel",
|
|
3888
|
+
"esc cancel"
|
|
3835
3889
|
],
|
|
3836
3890
|
panel: [
|
|
3837
3891
|
"↑↓ children · Enter details · Tab regions · Esc input",
|
|
@@ -3861,7 +3915,7 @@ const FOCUS_REGIONS = [
|
|
|
3861
3915
|
const REGION_LABELS = {
|
|
3862
3916
|
editor: "input",
|
|
3863
3917
|
transcript: "conversation",
|
|
3864
|
-
queue: "
|
|
3918
|
+
queue: "follow-ups",
|
|
3865
3919
|
panel: "subagent panel",
|
|
3866
3920
|
bar: "status bar"
|
|
3867
3921
|
};
|
|
@@ -4181,13 +4235,17 @@ function transcriptKey(data) {
|
|
|
4181
4235
|
return cycleKey(data) ?? typeKey(data);
|
|
4182
4236
|
}
|
|
4183
4237
|
/**
|
|
4184
|
-
* What one key means while the
|
|
4238
|
+
* What one key means while the follow-ups panel holds the keyboard.
|
|
4185
4239
|
* @param data - the raw key bytes.
|
|
4186
4240
|
* @returns the action, or undefined for a key the panel consumes without effect.
|
|
4187
4241
|
*/
|
|
4188
4242
|
function queueKey(data) {
|
|
4189
4243
|
const move = moveKey(data, QUEUE_MOVES);
|
|
4190
4244
|
if (move !== void 0) return move;
|
|
4245
|
+
if (matchesKey(data, "enter")) return {
|
|
4246
|
+
kind: "queue",
|
|
4247
|
+
action: "steer"
|
|
4248
|
+
};
|
|
4191
4249
|
if (data === "s" || data === "S") return {
|
|
4192
4250
|
kind: "queue",
|
|
4193
4251
|
action: "steer"
|
|
@@ -4846,9 +4904,10 @@ function partLabels(cursor, blocks) {
|
|
|
4846
4904
|
/**
|
|
4847
4905
|
* The agent's todo list as terminal rows: the status glyphs every todo surface
|
|
4848
4906
|
* of this terminal draws, the picker choices the list offers, and the detail
|
|
4849
|
-
* rows one entered item prints.
|
|
4850
|
-
*
|
|
4851
|
-
*
|
|
4907
|
+
* rows one entered item prints. Completed picker content can take a paint
|
|
4908
|
+
* function so the list scratches it out. Everything here is pure text work
|
|
4909
|
+
* over plain values; the single service touch is one optional read of the
|
|
4910
|
+
* `todos` session projection.
|
|
4852
4911
|
* @module @deepseek-ai/dsh-tui-app/todos
|
|
4853
4912
|
*/
|
|
4854
4913
|
/**
|
|
@@ -4891,22 +4950,34 @@ const TODO_STATUSES = [
|
|
|
4891
4950
|
"pending"
|
|
4892
4951
|
];
|
|
4893
4952
|
/**
|
|
4953
|
+
* The content a todo row shows: completed items take `paint` so the list can
|
|
4954
|
+
* scratch them out; every other status is the content unchanged.
|
|
4955
|
+
* @param content - the text after any row-length cut.
|
|
4956
|
+
* @param status - the item's status.
|
|
4957
|
+
* @param paint - how completed content is marked.
|
|
4958
|
+
* @returns the painted content, or `content` when the item is not completed or no paint was given.
|
|
4959
|
+
*/
|
|
4960
|
+
function paintTodoContent(content, status, paint) {
|
|
4961
|
+
return status === "completed" && paint !== void 0 ? paint(content) : content;
|
|
4962
|
+
}
|
|
4963
|
+
/**
|
|
4894
4964
|
* The agent's current todo list as picker rows, in write order.
|
|
4895
4965
|
* @param ctx - plugin context carrying the optional session-projection registry.
|
|
4896
4966
|
* @param session - the session whose todo list is read.
|
|
4967
|
+
* @param paint - how completed content is marked; omitted leaves it unmarked.
|
|
4897
4968
|
* @returns one choice per item. Empty in three cases: no projection registry
|
|
4898
4969
|
* is composed in this profile, the registry has no `todos` unit registered, or
|
|
4899
4970
|
* the value is `null` — which it is before the first `todo_write` of the
|
|
4900
4971
|
* current turn, since every `turn/start` clears the list.
|
|
4901
4972
|
*/
|
|
4902
|
-
function listTodoChoices(ctx, session) {
|
|
4973
|
+
function listTodoChoices(ctx, session, paint) {
|
|
4903
4974
|
const projections = ctx.get("sessionProjections");
|
|
4904
4975
|
if (projections === void 0) return [];
|
|
4905
4976
|
const items = projections.snapshot(session, ["todos"]).values.todos;
|
|
4906
4977
|
if (items === void 0 || items === null) return [];
|
|
4907
4978
|
return items.map((item, index) => ({
|
|
4908
4979
|
index,
|
|
4909
|
-
label: `${TODO_GLYPH[item.status]} ${labelContent(item.content)}`,
|
|
4980
|
+
label: `${TODO_GLYPH[item.status]} ${paintTodoContent(labelContent(item.content), item.status, paint)}`,
|
|
4910
4981
|
description: describeStatus(item.status),
|
|
4911
4982
|
status: item.status
|
|
4912
4983
|
}));
|
|
@@ -5391,7 +5462,7 @@ function buildFooterSegments(inputs) {
|
|
|
5391
5462
|
segments.push({
|
|
5392
5463
|
id: "permission",
|
|
5393
5464
|
label: `permission ${inputs.permission}`,
|
|
5394
|
-
detail: printed([...projected.length === 0 ? [`permission: ${inputs.permission}`] : projected, "/permission
|
|
5465
|
+
detail: printed([...projected.length === 0 ? [`permission: ${inputs.permission}`] : projected, "/permission opens the permission list"])
|
|
5395
5466
|
});
|
|
5396
5467
|
}
|
|
5397
5468
|
if (turn !== void 0) segments.push({
|
|
@@ -6248,11 +6319,26 @@ var ModalQueue = class {
|
|
|
6248
6319
|
//#endregion
|
|
6249
6320
|
//#region lib/types/queue-panel.js
|
|
6250
6321
|
/**
|
|
6251
|
-
* The
|
|
6252
|
-
*
|
|
6322
|
+
* The follow-up panel above the editor. It presents the Agent inbox as a
|
|
6323
|
+
* boxed pending-prompt list without mutating the messages it displays.
|
|
6253
6324
|
* @module @deepseek-ai/dsh-tui-app/queue-panel
|
|
6254
6325
|
*/
|
|
6255
6326
|
/**
|
|
6327
|
+
* The first content line a row shows.
|
|
6328
|
+
* @param content - the message's full text.
|
|
6329
|
+
* @returns the text before the first newline, or all of `content` when it is one line.
|
|
6330
|
+
*/
|
|
6331
|
+
function firstLine(content) {
|
|
6332
|
+
const breakAt = content.indexOf("\n");
|
|
6333
|
+
return breakAt === -1 ? content : content.slice(0, breakAt);
|
|
6334
|
+
}
|
|
6335
|
+
/** Pending-row marker; the same glyph the todo list uses for an unstarted item. */
|
|
6336
|
+
const FOLLOW_UP_GLYPH = "○";
|
|
6337
|
+
/** Columns the glyph and its trailing space occupy on the first wrapped line. */
|
|
6338
|
+
const FOLLOW_UP_PREFIX = `${FOLLOW_UP_GLYPH} `;
|
|
6339
|
+
/** Indent that lines up wrapped follow-up text under the first line's content. */
|
|
6340
|
+
const FOLLOW_UP_INDENT = " ";
|
|
6341
|
+
/**
|
|
6256
6342
|
* Build the panel rows in claim order: next-step input before ordinary turns.
|
|
6257
6343
|
* Messages whose source is not `user` are omitted: a `!` notice waiting for
|
|
6258
6344
|
* the next prompt is context, not a prompt the keyboard can steer or edit.
|
|
@@ -6264,14 +6350,26 @@ function queuePanelRows(nextStep, nextTurn) {
|
|
|
6264
6350
|
const row = (target, message) => ({
|
|
6265
6351
|
message,
|
|
6266
6352
|
target,
|
|
6267
|
-
text: contentText(message.content)
|
|
6353
|
+
text: firstLine(contentText(message.content))
|
|
6268
6354
|
});
|
|
6269
6355
|
const pending = (target, messages) => messages.filter((message) => message.source.kind === "user").map((message) => row(target, message));
|
|
6270
6356
|
return [...pending("next-step", nextStep), ...pending("next-turn", nextTurn)];
|
|
6271
6357
|
}
|
|
6272
6358
|
/**
|
|
6273
|
-
*
|
|
6274
|
-
*
|
|
6359
|
+
* One follow-up's text wrapped under the pending glyph, hanging the
|
|
6360
|
+
* continuation so it lines up with the first line's content.
|
|
6361
|
+
* @param text - the row's first content line.
|
|
6362
|
+
* @param room - columns inside the frame.
|
|
6363
|
+
* @param glyph - the pending marker, already styled.
|
|
6364
|
+
* @returns one or more body contents, never wider than `room`.
|
|
6365
|
+
*/
|
|
6366
|
+
function followUpLines(text, room, glyph) {
|
|
6367
|
+
return wrapTextWithAnsi(text, Math.max(1, room - visibleWidth(FOLLOW_UP_PREFIX))).map((line, index) => index === 0 ? `${glyph} ${line}` : `${FOLLOW_UP_INDENT}${line}`);
|
|
6368
|
+
}
|
|
6369
|
+
/**
|
|
6370
|
+
* Render the pending prompts as a boxed follow-ups list. A focused panel
|
|
6371
|
+
* accents its held row and names enter, select/edit, and cancel; an unfocused
|
|
6372
|
+
* panel names the key that enters it.
|
|
6275
6373
|
* @param rows - pending prompts in claim order.
|
|
6276
6374
|
* @param render - palette, terminal width, and optional selection.
|
|
6277
6375
|
* @returns panel text, or the empty string when no prompt waits.
|
|
@@ -6281,23 +6379,19 @@ function renderQueuePanel(rows, render) {
|
|
|
6281
6379
|
const { palette, selected } = render;
|
|
6282
6380
|
const width = Math.max(1, render.width);
|
|
6283
6381
|
const tone = selected === void 0 ? "muted" : "focus";
|
|
6284
|
-
const
|
|
6285
|
-
const lines = [topRule({
|
|
6286
|
-
chip: chip(palette, "QUEUE"),
|
|
6287
|
-
title: palette.bold(title),
|
|
6382
|
+
const lines = [tone === "focus" ? palette.accent("follow-ups") : palette.dim("follow-ups"), topRule({
|
|
6288
6383
|
width,
|
|
6289
6384
|
palette,
|
|
6290
6385
|
tone
|
|
6291
6386
|
})];
|
|
6292
6387
|
const room = Math.max(1, width - 2);
|
|
6293
6388
|
for (const [index, row] of rows.entries()) {
|
|
6294
|
-
const
|
|
6295
|
-
const
|
|
6296
|
-
for (const wrapped of wrapTextWithAnsi(text, room)) lines.push(bodyLine(wrapped, width, palette, tone));
|
|
6389
|
+
const glyph = selected === index ? palette.accent(FOLLOW_UP_GLYPH) : FOLLOW_UP_GLYPH;
|
|
6390
|
+
for (const content of followUpLines(row.text, room, glyph)) lines.push(bodyLine(content, width, palette, tone));
|
|
6297
6391
|
}
|
|
6298
|
-
const hints = selected === void 0 ? ["
|
|
6392
|
+
const hints = selected === void 0 ? ["shift+↓ select"] : HINTS.queue;
|
|
6393
|
+
lines.push(bodyLine(palette.dim(fitLegend(hints, room)), width, palette, tone));
|
|
6299
6394
|
lines.push(bottomRule({
|
|
6300
|
-
left: palette.dim(fitLegend(hints, ruleRoom(width))),
|
|
6301
6395
|
width,
|
|
6302
6396
|
palette,
|
|
6303
6397
|
tone
|
|
@@ -7260,8 +7354,8 @@ function paneIntent(data) {
|
|
|
7260
7354
|
* have, correct it when it lands" the rest of this surface uses.
|
|
7261
7355
|
*
|
|
7262
7356
|
* Colours come from a shiki theme rather than the palette: a theme
|
|
7263
|
-
* distinguishes a keyword from a type from a number, which the
|
|
7264
|
-
* roles cannot, and the transcript is where the model's code is read. The
|
|
7357
|
+
* distinguishes a keyword from a type from a number, which the palette's
|
|
7358
|
+
* structural roles cannot, and the transcript is where the model's code is read. The
|
|
7265
7359
|
* theme is chosen from the terminal's own background, so a light terminal is
|
|
7266
7360
|
* not given dark-theme colours, and a terminal that answers neither a colour
|
|
7267
7361
|
* depth nor a background gets no colour at all.
|
|
@@ -8218,6 +8312,11 @@ const LOCAL_COMMANDS = [
|
|
|
8218
8312
|
name: "effort",
|
|
8219
8313
|
description: "Pick the current model's reasoning effort for the next request (/effort <id>, /effort default)"
|
|
8220
8314
|
},
|
|
8315
|
+
{
|
|
8316
|
+
name: "permission",
|
|
8317
|
+
description: "Pick the permission preset (/permission <preset>)",
|
|
8318
|
+
hint: "<preset>"
|
|
8319
|
+
},
|
|
8221
8320
|
{
|
|
8222
8321
|
name: "sessions",
|
|
8223
8322
|
description: "Switch to another session"
|
|
@@ -8315,6 +8414,8 @@ const LOCAL_COMMANDS = [
|
|
|
8315
8414
|
description: "Same as /quit"
|
|
8316
8415
|
}
|
|
8317
8416
|
];
|
|
8417
|
+
/** Names the terminal handles before the shared registry, used to hide the matching catalog row. */
|
|
8418
|
+
const LOCAL_COMMAND_NAMES = new Set(LOCAL_COMMANDS.map((command) => command.name));
|
|
8318
8419
|
/**
|
|
8319
8420
|
* Whether a sign-in method is a provider subscription rather than a key field.
|
|
8320
8421
|
* `api-key` is the id a key-collecting login registers under; every other id
|
|
@@ -8725,7 +8826,7 @@ var TuiApp = class {
|
|
|
8725
8826
|
}
|
|
8726
8827
|
}
|
|
8727
8828
|
completableCommands() {
|
|
8728
|
-
const shared = this.deps.ctx.get("commands")?.list(this.agent) ?? [];
|
|
8829
|
+
const shared = (this.deps.ctx.get("commands")?.list(this.agent) ?? []).filter((command) => !LOCAL_COMMAND_NAMES.has(command.name));
|
|
8729
8830
|
return [...LOCAL_COMMANDS, ...shared.map((command) => ({
|
|
8730
8831
|
name: command.name,
|
|
8731
8832
|
description: command.description,
|
|
@@ -8815,7 +8916,7 @@ var TuiApp = class {
|
|
|
8815
8916
|
this.tui.requestRender();
|
|
8816
8917
|
}
|
|
8817
8918
|
/**
|
|
8818
|
-
* Redraw the
|
|
8919
|
+
* Redraw the follow-ups list above the editor from the bound Agent's inbox.
|
|
8819
8920
|
* The slot is mounted exactly while a prompt waits, so the editor sits
|
|
8820
8921
|
* directly under the conversation the rest of the time.
|
|
8821
8922
|
*/
|
|
@@ -9121,7 +9222,8 @@ var TuiApp = class {
|
|
|
9121
9222
|
*/
|
|
9122
9223
|
async browseTodos() {
|
|
9123
9224
|
const items = this.statusFacts().todos?.items ?? [];
|
|
9124
|
-
const
|
|
9225
|
+
const { palette } = this.deps;
|
|
9226
|
+
const choices = listTodoChoices(this.deps.ctx, this.agent.session, (content) => palette.dim(palette.strikethrough(content)));
|
|
9125
9227
|
if (choices.length === 0) {
|
|
9126
9228
|
this.notice("no todos yet");
|
|
9127
9229
|
return;
|
|
@@ -10193,6 +10295,9 @@ var TuiApp = class {
|
|
|
10193
10295
|
case "effort":
|
|
10194
10296
|
await this.runCurrentEffort(argument);
|
|
10195
10297
|
return;
|
|
10298
|
+
case "permission":
|
|
10299
|
+
await this.choosePermission(argument);
|
|
10300
|
+
return;
|
|
10196
10301
|
case "sessions":
|
|
10197
10302
|
case "resume":
|
|
10198
10303
|
await this.openSessionPicker();
|
|
@@ -10529,6 +10634,57 @@ var TuiApp = class {
|
|
|
10529
10634
|
this.notice(effort === void 0 ? "effort: provider default from the next request" : `effort ${effort} from the next request`, "success");
|
|
10530
10635
|
this.refreshFooter();
|
|
10531
10636
|
}
|
|
10637
|
+
/**
|
|
10638
|
+
* Choose the bound session's permission preset: an empty argument opens
|
|
10639
|
+
* the picker on the preset in force, and anything else names a catalog
|
|
10640
|
+
* value. A pick submits `/permission <preset>` when the shared command
|
|
10641
|
+
* exists, the same write path the browser uses.
|
|
10642
|
+
* @param argument - a catalog value, or empty for the picker.
|
|
10643
|
+
*/
|
|
10644
|
+
async choosePermission(argument) {
|
|
10645
|
+
const presets = this.deps.ctx.get("permissionPresets");
|
|
10646
|
+
if (presets === void 0) {
|
|
10647
|
+
this.notice("no permission service is composed", "error");
|
|
10648
|
+
return;
|
|
10649
|
+
}
|
|
10650
|
+
const options = presets.catalog().options;
|
|
10651
|
+
if (argument !== "") {
|
|
10652
|
+
const matched = matchPermission(options, argument);
|
|
10653
|
+
if (matched === null) {
|
|
10654
|
+
const available = options.map((option) => option.value).join(", ");
|
|
10655
|
+
this.notice(available === "" ? `unknown preset "${argument}"` : `unknown preset "${argument}" (available: ${available})`, "error");
|
|
10656
|
+
return;
|
|
10657
|
+
}
|
|
10658
|
+
await this.applyPermission(presets, matched);
|
|
10659
|
+
return;
|
|
10660
|
+
}
|
|
10661
|
+
if (options.length === 0) {
|
|
10662
|
+
this.notice("no selectable permission presets");
|
|
10663
|
+
return;
|
|
10664
|
+
}
|
|
10665
|
+
const current = presets.current(this.agent.session);
|
|
10666
|
+
const picked = await this.showModal(new PickPrompt(this.deps.palette, "Permission preset", permissionItems(options), {
|
|
10667
|
+
body: [permissionHint(options, current)],
|
|
10668
|
+
current
|
|
10669
|
+
}));
|
|
10670
|
+
if (picked === void 0) return;
|
|
10671
|
+
await this.applyPermission(presets, picked.value);
|
|
10672
|
+
}
|
|
10673
|
+
/**
|
|
10674
|
+
* Switch to `name` through the shared `/permission` command when a
|
|
10675
|
+
* registry is composed, otherwise through the permission service.
|
|
10676
|
+
* @param presets - the composed permission service.
|
|
10677
|
+
* @param name - a catalog value.
|
|
10678
|
+
*/
|
|
10679
|
+
async applyPermission(presets, name) {
|
|
10680
|
+
if (this.deps.ctx.get("commands") !== void 0) {
|
|
10681
|
+
await this.runSharedCommand(`/permission ${name}`, "permission");
|
|
10682
|
+
return;
|
|
10683
|
+
}
|
|
10684
|
+
presets.set(this.agent.session, name);
|
|
10685
|
+
this.notice(`preset ${name}`, "success");
|
|
10686
|
+
this.refreshFooter();
|
|
10687
|
+
}
|
|
10532
10688
|
async modelItems() {
|
|
10533
10689
|
const llm = this.deps.ctx.get("llm");
|
|
10534
10690
|
if (llm === void 0) return [];
|
package/package.json
CHANGED