@songtonyli/dsh-cli 0.1.26 → 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-tui-app/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tui-app/README.md +50 -27
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +50 -27
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +397 -43
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/startup.js +4 -3
- package/node_modules/@deepseek-ai/dsh-tui-app/package.json +2 -0
- 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 }) {
|
|
@@ -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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Interactive terminal mode for dsh: talk to the agent in your terminal with streamed replies, tool cards, keyboard navigation over the conversation, a full-screen two-panel reader for turns, approvals, questions, slash commands, @-references, attachments, and session switching."
|
|
2
|
+
description: "Interactive terminal mode for dsh: talk to the agent in your terminal with streamed replies, tool cards, keyboard navigation over the conversation, a full-screen two-panel reader for turns, approvals, questions, slash commands, ! shell lines, @-references, attachments, and session switching."
|
|
3
3
|
kind: "package-bundle"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -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,14 @@ 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
|
+
| `!command` / `!!command` | Run in this terminal; `!` is next-step context the next prompt can read, `!!` stays local |
|
|
68
69
|
| `Shift+Enter` | Insert a newline |
|
|
69
70
|
| `Ctrl+S` | While a turn runs, steer the editor text into the running turn's next step |
|
|
70
71
|
| `Up` / `Down` | Recall earlier prompts |
|
|
@@ -72,25 +73,26 @@ While the input has the keyboard:
|
|
|
72
73
|
| `Tab` | Take the completion the editor offers |
|
|
73
74
|
| `Shift+Tab` | Open the current model's reasoning-effort picker for the next request, the same picker as empty `/effort` |
|
|
74
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 |
|
|
75
|
-
| `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 |
|
|
76
77
|
| `Ctrl+G` | Read the conversation full screen, on its newest section |
|
|
77
78
|
| `Ctrl+O` | Expand or collapse every tool card and context row |
|
|
78
|
-
| `Esc` |
|
|
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 |
|
|
79
80
|
| `Ctrl+C` | Clear the editor; a second press within 600 ms quits |
|
|
80
81
|
| `Ctrl+D` | Quit when the editor is empty |
|
|
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
|
+
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.
|
|
83
84
|
|
|
84
|
-
While the
|
|
85
|
+
While the follow-ups panel has the keyboard:
|
|
85
86
|
|
|
86
87
|
| Key | Effect |
|
|
87
88
|
|---|---|
|
|
88
|
-
| `Up` / `Down`, `Home` / `End` | Select a pending
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
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 |
|
|
92
94
|
| `Tab` / `Shift+Tab` | The next / previous region that is drawn |
|
|
93
|
-
| `Esc` |
|
|
95
|
+
| `Esc` | Cancel and return to the input |
|
|
94
96
|
| Any other printable key | Return to the input and type the character at the caret |
|
|
95
97
|
|
|
96
98
|
While the conversation has the keyboard:
|
|
@@ -152,15 +154,16 @@ While the reader is open:
|
|
|
152
154
|
|
|
153
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.
|
|
154
156
|
|
|
155
|
-
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.
|
|
156
158
|
|
|
157
|
-
Typing `/` at the start of the editor completes the terminal's own commands and the shared registry's; `@` anywhere completes references.
|
|
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.
|
|
158
160
|
|
|
159
161
|
| Command | Effect |
|
|
160
162
|
|---|---|
|
|
161
163
|
| `/help` | List the commands, and the keys each focus state answers |
|
|
162
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 |
|
|
163
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 |
|
|
164
167
|
| `/resume` | Open the same persisted-session picker as `/sessions` and resume the selected previous session |
|
|
165
168
|
| `/sessions` | Open the persisted-session picker and switch to the selected session |
|
|
166
169
|
| `/new` | Start a new session |
|
|
@@ -174,7 +177,7 @@ Typing `/` at the start of the editor completes the terminal's own commands and
|
|
|
174
177
|
| `/login` | Sign in with a provider subscription (hides key-collecting logins); `/login <key>` skips the picker |
|
|
175
178
|
| `/export [dir]` | Write this session's log ZIP (sub-sessions and attachments included) into `dir`, default the workspace |
|
|
176
179
|
| `/status` | Context window usage and breakdown, token totals with cache hit, session stats, todos, goal, plan mode, and permission |
|
|
177
|
-
| `/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 |
|
|
178
181
|
| `/outline` | The turns of this session with their prompt and reply previews |
|
|
179
182
|
| `/deliverables` | The files the agent presented, grouped by turn |
|
|
180
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 |
|
|
@@ -185,9 +188,9 @@ Typing `/` at the start of the editor completes the terminal's own commands and
|
|
|
185
188
|
| `/turns` | Read the conversation full screen, turns side by side, like `Ctrl+G` |
|
|
186
189
|
| `/quit`, `/exit` | Save the session and exit |
|
|
187
190
|
|
|
188
|
-
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.
|
|
189
192
|
|
|
190
|
-
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.
|
|
191
194
|
|
|
192
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.
|
|
193
196
|
|
|
@@ -235,7 +238,7 @@ The runner is a direct driver over the core API carrier, like `dsh-headless`, th
|
|
|
235
238
|
|
|
236
239
|
### Run flow
|
|
237
240
|
|
|
238
|
-
The runner awaits the complete application (`ctx.get('loader')?.await()`) and builds a session host over the core registry with three operations: `create` makes one fresh persisted Agent with the shared [`agentDefaultModel`](../../core/agent-default-model/README.md) selection, `resume` reads the persisted log in pages through a read handle of `ctx.sessionPersistence` and resumes the Agent through the registry, and `fork` observes the source through `ctx.sessionQuery`, cuts after the chosen (by default the last) `turn/end` up to the next `turn/start`, and creates a seeded Agent with `parentSession` and `isSeeded` metadata. Every operation installs a `ModelSelectionRef` in the Agent's scoped setup so `/model` changes the next request. The terminal application starts on the session `--resume` or a fresh `create` yields, subscribes to `session/event`, `agent/assistant-stream`, and `agent/status`, answers the `approval/request` and `user-questions/request` waterfalls for the bound Agent only, and switches sessions by binding the next one and disposing the previous handle; while the host opens the next session the editor refuses input, and a quit during that wait releases the session that arrives afterwards. Quitting cancels any running turn, waits for quiescence, flushes the bound Session, disposes its handle, and requests exit 0; a driver failure writes `dsh: <message>` to stderr and requests exit 1. `/resume` and `/sessions` share the persisted-session chooser. Editor `Shift+Tab` dispatches empty `/effort` to open its current-model picker, and editor `Shift+Left` / `Shift+Right` use pi-tui's word navigation. `/login` starts `authorization.begin` with only subscription methods (every method except a key-collecting `api-key` login). A notice the flow marks with `openInBrowser` is handed to the default browser through `dsh-native-command`'s credential-scrubbed helper while the URL stays printed; the handoff is suppressed when `openBrowser` is false, the launch came through SSH, or the host has no desktop, and an opener failure becomes a notice beside the URL rather than a sign-in failure.
|
|
241
|
+
The runner awaits the complete application (`ctx.get('loader')?.await()`) and builds a session host over the core registry with three operations: `create` makes one fresh persisted Agent with the shared [`agentDefaultModel`](../../core/agent-default-model/README.md) selection, `resume` reads the persisted log in pages through a read handle of `ctx.sessionPersistence` and resumes the Agent through the registry, and `fork` observes the source through `ctx.sessionQuery`, cuts after the chosen (by default the last) `turn/end` up to the next `turn/start`, and creates a seeded Agent with `parentSession` and `isSeeded` metadata. Every operation installs a `ModelSelectionRef` in the Agent's scoped setup so `/model` changes the next request. The terminal application starts on the session `--resume` or a fresh `create` yields, subscribes to `session/event`, `agent/assistant-stream`, and `agent/status`, answers the `approval/request` and `user-questions/request` waterfalls for the bound Agent only, and switches sessions by binding the next one and disposing the previous handle; while the host opens the next session the editor refuses input, and a quit during that wait releases the session that arrives afterwards. Quitting cancels any running turn, waits for quiescence, flushes the bound Session, disposes its handle, and requests exit 0; a driver failure writes `dsh: <message>` to stderr and requests exit 1. `/resume` and `/sessions` share the persisted-session chooser. Editor `Shift+Tab` dispatches empty `/effort` to open its current-model picker, and editor `Shift+Left` / `Shift+Right` use pi-tui's word navigation. `/login` starts `authorization.begin` with only subscription methods (every method except a key-collecting `api-key` login). A notice the flow marks with `openInBrowser` is handed to the default browser through `dsh-native-command`'s credential-scrubbed helper while the URL stays printed; the handoff is suppressed when `openBrowser` is false, the launch came through SSH, or the host has no desktop, and an opener failure becomes a notice beside the URL rather than a sign-in failure. A nonempty `!` or `!!` line submitted in the editor runs through `ctx.shell` in this process; `!` injects a next-step notice and `!!` stays local.
|
|
239
242
|
|
|
240
243
|
### Rendering model
|
|
241
244
|
|
|
@@ -251,10 +254,11 @@ The patch rides over `dsh-base`: it sets the coding persona prefix and cwd suffi
|
|
|
251
254
|
|---|---|
|
|
252
255
|
| [`src/index.ts`](src/index.ts) | The `tui-app` plugin: the session host (create, resume, fork), history read, quit flow, exit mapping |
|
|
253
256
|
| [`src/startup.ts`](src/startup.ts) | The `tui-app-startup` provider: prompt positional, `--resume`, `--no-open`, and `--help` |
|
|
254
|
-
| [`src/app.ts`](src/app.ts) | The terminal application: layout, the key router, commands, session binding, seams, log and stream folding, the stop arm, the transient line it mounts,
|
|
257
|
+
| [`src/app.ts`](src/app.ts) | The terminal application: layout, the key router, commands, session binding, seams, log and stream folding, the stop arm, the transient line it mounts, the terminal handover the reader runs on, and prefix-on-submit `!` / `!!` |
|
|
255
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 |
|
|
256
259
|
| [`src/sessions.ts`](src/sessions.ts) | The persisted-session list and picker rows shared by `/resume` and `/sessions` |
|
|
257
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` |
|
|
258
262
|
| [`src/attach.ts`](src/attach.ts) | `/attach`: local files into image or file blocks through the attachment store |
|
|
259
263
|
| [`src/export.ts`](src/export.ts) | `/export`: the session-log ZIP written through the export package's archive helpers |
|
|
260
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 |
|
|
@@ -272,18 +276,20 @@ The patch rides over `dsh-base`: it sets the coding persona prefix and cwd suffi
|
|
|
272
276
|
| [`src/toast.ts`](src/toast.ts) | The transient key-feedback line: its overlay, its clock, and the lines it carries |
|
|
273
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 |
|
|
274
278
|
| [`src/diff.ts`](src/diff.ts) | Line diff and hunk selection for diff cards |
|
|
275
|
-
| [`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 |
|
|
276
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 |
|
|
277
281
|
| [`src/completion.ts`](src/completion.ts) | Slash-command and `@`-reference completion for the editor |
|
|
278
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 |
|
|
283
|
+
| [`src/shell-line.ts`](src/shell-line.ts) | Parse a `!` / `!!` line and format the transcript rows and model-facing notice |
|
|
279
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 |
|
|
280
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 |
|
|
281
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 |
|
|
282
288
|
| [`src/catalog.ts`](src/catalog.ts) | Rows for `/settings`, `/plugins`, `/subagents`, `/deliverables`, `/changes`, and `/outline`, and the `/plugins` management verbs |
|
|
283
|
-
| [`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 |
|
|
284
290
|
| [`cordis.patch.yml`](cordis.patch.yml) | The terminal patch over `dsh-base` |
|
|
285
291
|
| — | No runtime invariant companion is published; the app registers listeners on one Agent and holds no mutable relation another observer could contradict. |
|
|
286
|
-
| [`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 |
|
|
287
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 |
|
|
288
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 |
|
|
289
295
|
| [`tests/frame.spec.ts`](tests/frame.spec.ts) | The rules, the chip, the body rows, and the legend a width holds |
|
|
@@ -292,8 +298,10 @@ The patch rides over `dsh-base`: it sets the coding persona prefix and cwd suffi
|
|
|
292
298
|
| [`tests/reader.spec.ts`](tests/reader.spec.ts) | The reader's geometry, its state machine, its filter, and the rows it returns |
|
|
293
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 |
|
|
294
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 |
|
|
295
|
-
| [`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 |
|
|
302
|
+
| [`tests/shell.spec.ts`](tests/shell.spec.ts) | Prefix-on-submit `!` / `!!` dispatch, next-step inject, Esc cancel, and the missing-shell notice |
|
|
296
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 |
|
|
297
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 |
|
|
298
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 |
|
|
299
307
|
| [`tests/context.spec.ts`](tests/context.spec.ts) | Projection of system prompts and injected context into transcript sections |
|
|
@@ -329,11 +337,25 @@ Read these pages when you want to go deeper into the shared core, the sibling su
|
|
|
329
337
|
<a id="model-experience"></a>
|
|
330
338
|
## Model Experience
|
|
331
339
|
|
|
332
|
-
|
|
340
|
+
### User-typed shell command
|
|
341
|
+
|
|
342
|
+
#### What the model sees
|
|
343
|
+
|
|
344
|
+
A nonempty `!command` line injects one plugin notice after the command finishes (`source.kind: plugin`, `plugin: tui-app`, `form: notice`). The next admitted step includes this wrapper; `<command>` and the fenced body are data-dependent. An empty run uses the exact line `(no output)` instead of a fence. A cancelled run appends a blank line and `(command cancelled)`. A nonzero exit appends a blank line and `Command exited with code <n>`. `!!command` and a lone `!` add no notice.
|
|
345
|
+
|
|
346
|
+
##### User shell notice prefix
|
|
347
|
+
|
|
348
|
+
```markdown
|
|
349
|
+
The user ran `<command>` in the terminal.
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
#### Token effect
|
|
353
|
+
|
|
354
|
+
Conditional and retained: each `!` notice stays in conversation history for later requests; `!!` and a lone `!` add none.
|
|
333
355
|
|
|
334
356
|
#### KV Cache effect
|
|
335
357
|
|
|
336
|
-
|
|
358
|
+
Append-only conversation growth after the reusable request prefix. The notice does not change the system prompt or tool catalog. A `/model` switch starts a new request series exactly as it does from the browser.
|
|
337
359
|
|
|
338
360
|
## Known Limitations and Deferred Work
|
|
339
361
|
|
|
@@ -358,6 +380,7 @@ These limits describe the terminal surface as shipped; they are not a general CL
|
|
|
358
380
|
- **The fade needs an answer from the terminal** — its ramp is built from the background color the terminal reports to the query sent at startup, so a terminal that stays silent, or that encodes neither truecolor nor 256 colors, gets the two-level faint mode instead; `NO_COLOR`, a disabled palette, `TERM=dumb`, and `reducedMotion` turn every fade and every chrome lift off entirely, and a transient line then disappears at the end of its hold instead of fading out.
|
|
359
381
|
- **The terminal's own caret can flicker** — the editor draws no caret of its own and the app turns the terminal cursor on, which pi-tui then moves across the lines it repaints; a terminal that does not honor the synchronized-output sequences pi-tui wraps a frame in can show that movement.
|
|
360
382
|
- **Runs through the `dsh` launcher** — starting the profile another way fails at startup, because only the launcher can request the process exit.
|
|
383
|
+
- **`!` is one-shot and not a TTY** — each line is a fresh `ctx.shell.run`; there is no persistent shell or interactive program. The Web composer does not intercept `!`. An optional first prompt on the command line is always a user message.
|
|
361
384
|
|
|
362
385
|
<a id="dev-note"></a>
|
|
363
386
|
### Dev Note
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "dsh 的交互式终端模式:在你的终端里与 agent
|
|
2
|
+
description: "dsh 的交互式终端模式:在你的终端里与 agent(智能体)对话,带流式回复、工具卡片、用键盘浏览对话记录、双面板全屏阅读器、审批、提问、斜杠命令、! 本地命令、@ 引用、附件与会话切换。"
|
|
3
3
|
kind: "package-bundle"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -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,14 @@ 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
|
+
| `!command` / `!!command` | 在本终端运行;`!` 会作为下一步上下文供下一条提示阅读,`!!` 只留在本地 |
|
|
68
69
|
| `Shift+Enter` | 插入换行 |
|
|
69
70
|
| `Ctrl+S` | 轮次进行中时,把编辑器文本引导(steer)进当前轮次的下一步 |
|
|
70
71
|
| `Up` / `Down` | 调出先前的提示 |
|
|
@@ -72,25 +73,26 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
72
73
|
| `Tab` | 采用编辑器给出的补全 |
|
|
73
74
|
| `Shift+Tab` | 打开当前模型的推理强度选择器,从下一次请求生效;与空参数 `/effort` 打开的是同一个选择器 |
|
|
74
75
|
| `Shift+Up` | 把焦点放到对话记录上、停在走查上次停下的小节;首次进入以及切换会话后的首次进入停在最新小节 |
|
|
75
|
-
| `Shift+Down` |
|
|
76
|
+
| `Shift+Down` | 有提示等待时把焦点放到 follow-ups 列表第一行,否则在子 agent 面板已绘制时放到其第一行,再否则放到状态栏 |
|
|
76
77
|
| `Ctrl+G` | 整屏读出对话记录,停在其最新小节 |
|
|
77
78
|
| `Ctrl+O` | 展开或折叠所有工具卡片与上下文行 |
|
|
78
|
-
| `Esc` |
|
|
79
|
+
| `Esc` | 取消正在运行的 `!`;在没有轮次进行且草稿以 `!` 开头时清空编辑器;否则装填停止,该提示仍在屏幕上时再按一次会停止正在进行的轮次 |
|
|
79
80
|
| `Ctrl+C` | 清空编辑器;600 ms 内再按一次则退出 |
|
|
80
81
|
| `Ctrl+D` | 编辑器为空时退出 |
|
|
81
82
|
|
|
82
|
-
仅仅交还了键盘的 `Esc`——离开某个区域、关闭页面、选择器或阅读器——会打开一个 750 ms 的窗口,其间到达编辑器的 `Esc` 完全不做任何事,因此习惯性的连按停不掉任何轮次。没有轮次进行时,`Esc`
|
|
83
|
+
仅仅交还了键盘的 `Esc`——离开某个区域、关闭页面、选择器或阅读器——会打开一个 750 ms 的窗口,其间到达编辑器的 `Esc` 完全不做任何事,因此习惯性的连按停不掉任何轮次。没有轮次进行时,`Esc` 在补全列表打开时关闭它,清空以 `!` 开头的草稿,其余情况保持沉默。尚无可读内容的会话对 `Shift+Up` 与 `Ctrl+G` 回以 `nothing in the transcript to read yet`,并把键盘留在编辑器。
|
|
83
84
|
|
|
84
|
-
|
|
85
|
+
follow-ups 面板持有键盘时:
|
|
85
86
|
|
|
86
87
|
| 按键 | 效果 |
|
|
87
88
|
|---|---|
|
|
88
|
-
| `Up` / `Down`、`Home` / `End` |
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
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` 把原提示恢复到下一轮次队列 |
|
|
92
94
|
| `Tab` / `Shift+Tab` | 下一个 / 上一个已绘制区域 |
|
|
93
|
-
| `Esc` |
|
|
95
|
+
| `Esc` | 取消并返回输入框 |
|
|
94
96
|
| 任何其他可打印键 | 返回输入框并在光标处输入该字符 |
|
|
95
97
|
|
|
96
98
|
对话记录持有键盘时:
|
|
@@ -152,15 +154,16 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
152
154
|
|
|
153
155
|
到达阅读器的其他每个按键都被消费,而关闭它同样打开那 750 ms 的交接窗口,因此连按多少次 `Esc` 都到不了编辑器的停止。
|
|
154
156
|
|
|
155
|
-
每个聚焦的分段都在第二行展开其最重要的事实。除 `todo` 之外,`Enter` 把这些事实打印到对话记录,并指出改变它们的方式:模型分段指出 `/model`,推理强度分段指出 `Shift+Tab` 与 `/effort`
|
|
157
|
+
每个聚焦的分段都在第二行展开其最重要的事实。除 `todo` 之外,`Enter` 把这些事实打印到对话记录,并指出改变它们的方式:模型分段指出 `/model`,推理强度分段指出 `Shift+Tab` 与 `/effort` 共用的选择器,权限分段指出其预设以及 `/permission` 选择器;`turn` 分段——绘制在权限与用量分段之间、形如 `turn <elapsed>`,且只在轮次进行时出现——给出轮次编号、其开始时间、已用时间与排队消息数量;用量、上下文、目标与计划分段打印 `/status` 报告中对应的小节,workspace 分段显示完整路径,附件分段列出待发送的附件。`todo` 分段展开按状态统计的计数以及正在进行的条目(若无正在进行的条目则为下一条待办),`Enter` 打开 agent 的 todo 列表,与 `/todos` 打开的是同一个列表。
|
|
156
158
|
|
|
157
|
-
在编辑器开头输入 `/` 会补全终端自身的命令与共享注册表的命令;任意位置的 `@`
|
|
159
|
+
在编辑器开头输入 `/` 会补全终端自身的命令与共享注册表的命令;任意位置的 `@` 补全引用。非空的 `!command` 或 `!!command` 行经 `ctx.shell` 在会话 cwd 以 `danger-full-access` 运行;对话记录显示 `$ command` 与输出。`!` 会注入一条插件通知供下一步领取;`!!` 不会。单独的 `!` 仍是普通提示。
|
|
158
160
|
|
|
159
161
|
| 命令 | 效果 |
|
|
160
162
|
|---|---|
|
|
161
163
|
| `/help` | 列出命令,以及每个焦点状态所应答的按键 |
|
|
162
164
|
| `/model` | 为下一次请求选择模型(输入即可过滤行),若模型声明多于一种推理强度则接着选择强度;`/model <provider>/<model>` 直接选择,`/model save` 把当前选择存为默认,在模型列表中按 `Ctrl+S` 则把高亮的模型存为下次启动的默认而不关闭列表 |
|
|
163
165
|
| `/effort [id]` | 不带参数时为下一次请求打开当前模型的推理强度选择器,与编辑器中的 `Shift+Tab` 打开的是同一个;id 直接选择,`/effort default` 恢复提供方默认值 |
|
|
166
|
+
| `/permission [preset]` | 不带参数时打开权限预设选择器;preset 直接选择 |
|
|
164
167
|
| `/resume` | 打开与 `/sessions` 相同的持久化会话选择器,并恢复选中的先前会话 |
|
|
165
168
|
| `/sessions` | 打开持久化会话选择器,并切换到选中的会话 |
|
|
166
169
|
| `/new` | 开始新会话 |
|
|
@@ -174,7 +177,7 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
174
177
|
| `/login` | 用提供方订阅登录(隐藏仅收集密钥的登录);`/login <key>` 跳过选择器 |
|
|
175
178
|
| `/export [dir]` | 把本会话的日志 ZIP(含子会话与附件)写入 `dir`,默认 workspace |
|
|
176
179
|
| `/status` | 上下文窗口用量与构成、含缓存命中的 token 总计、会话统计、todo、目标、计划模式与权限 |
|
|
177
|
-
| `/todos` | 浏览 agent 的 todo
|
|
180
|
+
| `/todos` | 浏览 agent 的 todo 列表;已完成行会被划掉;`Enter` 完整打开其中一条,含其状态、位置与轮次 |
|
|
178
181
|
| `/outline` | 本会话各轮次及其提示与回复预览 |
|
|
179
182
|
| `/deliverables` | agent 交付的文件,按轮次分组 |
|
|
180
183
|
| `/changes [turn]` | 浏览最近一轮(或第 `turn` 轮)改动的文件及其行数;`Enter` 打开某个文件从轮次开始到结束的对比 |
|
|
@@ -185,9 +188,9 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
185
188
|
| `/turns` | 像 `Ctrl+G` 一样整屏读出对话记录,各轮次并排 |
|
|
186
189
|
| `/quit`、`/exit` | 保存会话并退出 |
|
|
187
190
|
|
|
188
|
-
其他每条 `/name` 行都交给共享命令注册表,因此 `/compact`、`/
|
|
191
|
+
其他每条 `/name` 行都交给共享命令注册表,因此 `/compact`、`/goal` 与插件命令的行为和浏览器中一致。
|
|
189
192
|
|
|
190
|
-
终端打开的每个选择器——`/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>"` 取代这些行,而生效行上的 `✓`——也就是选择器打开时定位的那一行——只在查询为空时显示。
|
|
191
194
|
|
|
192
195
|
`/subagents`、`/todos` 与状态栏的 `todo` 分段共用同一套先列表、后详情的交互:选择器列出各条目,`Enter` 把高亮条目作为只读页面打开,`Up` / `Down` 与 `PageUp` / `PageDown` 滚动该页面,`Enter`、`Esc` 或 `Left` 返回列表并停在刚读过的条目上,因此连续查看多个条目无需重新输入命令;在列表上按 `Esc` 返回编辑器。详情无法读取的条目会在其页面上说明原因,而不会关闭列表。
|
|
193
196
|
|
|
@@ -235,7 +238,7 @@ runner 与 `dsh-headless` 一样是核心 API 载体之上的直接驱动器,
|
|
|
235
238
|
|
|
236
239
|
### 运行流程
|
|
237
240
|
|
|
238
|
-
runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心注册表之上构建含三个操作的会话宿主:`create` 用共享的 [`agentDefaultModel`](../../core/agent-default-model/README.zh.md) 选择创建一个全新的持久化 Agent,`resume` 通过 `ctx.sessionPersistence` 的只读句柄分页读取持久化日志并经注册表恢复 Agent,`fork` 通过 `ctx.sessionQuery` 观察源会话、在所选(默认最后一个)`turn/end` 之后直到下一个 `turn/start` 处切割,并创建带 `parentSession` 与 `isSeeded` 元数据的种子 Agent。每个操作都在 Agent 的作用域 setup 中安装 `ModelSelectionRef`,因此 `/model` 会改变下一次请求。终端应用从 `--resume` 或一次新的 `create` 产生的会话开始,订阅 `session/event`、`agent/assistant-stream` 与 `agent/status`,只为绑定的 Agent 应答 `approval/request` 与 `user-questions/request` waterfall,并通过绑定下一个会话、dispose 先前句柄来切换会话;宿主打开下一个会话期间编辑器拒绝输入,等待期间退出会释放随后到达的会话。退出时取消任何进行中的轮次、等待完全停稳、flush 绑定的会话、dispose 其句柄并请求以 0 退出;驱动器失败会向 stderr 写入 `dsh: <message>` 并请求以 1 退出。`/resume` 与 `/sessions` 共用持久化会话选择器。编辑器中的 `Shift+Tab` 会派发空参数 `/effort` 以打开当前模型的推理强度选择器,而编辑器中的 `Shift+Left` / `Shift+Right` 使用 pi-tui 的词导航。`/login` 只带着订阅方法(除收集密钥的 `api-key` 登录外的每一种方法)启动 `authorization.begin`。flow 用 `openInBrowser` 标记的 notice 会经 `dsh-native-command` 的凭据擦除辅助进程交给默认浏览器,URL 同时保持打印;当 `openBrowser` 为 false、启动经过 SSH 或宿主没有桌面时抑制该交接,打开器失败则成为 URL
|
|
241
|
+
runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心注册表之上构建含三个操作的会话宿主:`create` 用共享的 [`agentDefaultModel`](../../core/agent-default-model/README.zh.md) 选择创建一个全新的持久化 Agent,`resume` 通过 `ctx.sessionPersistence` 的只读句柄分页读取持久化日志并经注册表恢复 Agent,`fork` 通过 `ctx.sessionQuery` 观察源会话、在所选(默认最后一个)`turn/end` 之后直到下一个 `turn/start` 处切割,并创建带 `parentSession` 与 `isSeeded` 元数据的种子 Agent。每个操作都在 Agent 的作用域 setup 中安装 `ModelSelectionRef`,因此 `/model` 会改变下一次请求。终端应用从 `--resume` 或一次新的 `create` 产生的会话开始,订阅 `session/event`、`agent/assistant-stream` 与 `agent/status`,只为绑定的 Agent 应答 `approval/request` 与 `user-questions/request` waterfall,并通过绑定下一个会话、dispose 先前句柄来切换会话;宿主打开下一个会话期间编辑器拒绝输入,等待期间退出会释放随后到达的会话。退出时取消任何进行中的轮次、等待完全停稳、flush 绑定的会话、dispose 其句柄并请求以 0 退出;驱动器失败会向 stderr 写入 `dsh: <message>` 并请求以 1 退出。`/resume` 与 `/sessions` 共用持久化会话选择器。编辑器中的 `Shift+Tab` 会派发空参数 `/effort` 以打开当前模型的推理强度选择器,而编辑器中的 `Shift+Left` / `Shift+Right` 使用 pi-tui 的词导航。`/login` 只带着订阅方法(除收集密钥的 `api-key` 登录外的每一种方法)启动 `authorization.begin`。flow 用 `openInBrowser` 标记的 notice 会经 `dsh-native-command` 的凭据擦除辅助进程交给默认浏览器,URL 同时保持打印;当 `openBrowser` 为 false、启动经过 SSH 或宿主没有桌面时抑制该交接,打开器失败则成为 URL 旁的一条通知,而非登录失败。编辑器里提交的非空 `!` 或 `!!` 行经本进程的 `ctx.shell` 运行;`!` 注入一条下一步通知,`!!` 只留在本地。
|
|
239
242
|
|
|
240
243
|
### 渲染模型
|
|
241
244
|
|
|
@@ -251,10 +254,11 @@ runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心
|
|
|
251
254
|
|---|---|
|
|
252
255
|
| [`src/index.ts`](src/index.ts) | `tui-app` 插件:会话宿主(创建、恢复、fork)、历史读取、退出流程、退出码映射 |
|
|
253
256
|
| [`src/startup.ts`](src/startup.ts) | `tui-app-startup` 提供方:提示位置参数、`--resume`、`--no-open` 与 `--help` |
|
|
254
|
-
| [`src/app.ts`](src/app.ts) |
|
|
257
|
+
| [`src/app.ts`](src/app.ts) | 终端应用:布局、按键路由、命令、会话绑定、接缝、日志与流的折叠、停止装填、它挂载的临时提示行、阅读器所依托的终端交接,以及提交时解析的 `!` / `!!` |
|
|
255
258
|
| [`src/keys.ts`](src/keys.ts) | 按键模型:各焦点区域、一次按键在每个区域中的含义、它们逐级收缩的按键提示、进入用的按键、`/help` 的各行,以及交接窗口 |
|
|
256
259
|
| [`src/sessions.ts`](src/sessions.ts) | `/resume` 与 `/sessions` 共用的持久化会话列表及选择器行 |
|
|
257
260
|
| [`src/effort.ts`](src/effort.ts) | `/model`、`/effort` 与编辑器 `Shift+Tab` 共用的推理强度名称及选择器行 |
|
|
261
|
+
| [`src/permission.ts`](src/permission.ts) | `/permission` 的权限预设名称及选择器行 |
|
|
258
262
|
| [`src/attach.ts`](src/attach.ts) | `/attach`:本地文件经附件存储成为图片或文件块 |
|
|
259
263
|
| [`src/export.ts`](src/export.ts) | `/export`:通过导出包的归档辅助函数写出会话日志 ZIP |
|
|
260
264
|
| [`src/blocks.ts`](src/blocks.ts) | 对话记录组件:用户提示、assistant 回复、工具卡片、系统提示词与注入上下文、通知;可导航的块暴露其各小节并绘制焦点标记条,可折叠的块则承载两个折叠键共用的那条标记。每个块保留上次画出的行,回复还保留上次 Markdown 解析所着色的代码围栏,因此已稳定的对话记录每帧只花每块一次键比较,一次流式增量也只为发生变化的那个围栏着色 |
|
|
@@ -272,18 +276,20 @@ runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心
|
|
|
272
276
|
| [`src/toast.ts`](src/toast.ts) | 临时按键提示行:其浮层、其时钟,以及它承载的各条文字 |
|
|
273
277
|
| [`src/transcript.ts`](src/transcript.ts) | 呈现视图、用量与轮次结束原因的纯文本折叠,以及每条标记共用的那一套折叠措辞 |
|
|
274
278
|
| [`src/diff.ts`](src/diff.ts) | diff 卡片的行 diff 与 hunk 选择 |
|
|
275
|
-
| [`src/style.ts`](src/style.ts) |
|
|
279
|
+
| [`src/style.ts`](src/style.ts) | 调色板(含 Markdown 回复所用的暗色冷色阶标题与链接色、已完成 todo 内容所用的划线角色)与派生的 pi-tui 主题 |
|
|
276
280
|
| [`src/highlight.ts`](src/highlight.ts) | 围栏代码的语法高亮:某个围栏可能加载的语法、由背景选定的配色主题,以及一个 token 所用的 SGR |
|
|
277
281
|
| [`src/completion.ts`](src/completion.ts) | 编辑器的斜杠命令与 `@` 引用补全 |
|
|
278
282
|
| [`src/editor.ts`](src/editor.ts) | 提示编辑器的终端光标,以及把 `Shift+Left` / `Shift+Right` 映射到 pi-tui 词导航的逻辑 |
|
|
283
|
+
| [`src/shell-line.ts`](src/shell-line.ts) | 解析 `!` / `!!` 行,并格式化对话记录行与面向模型的通知 |
|
|
279
284
|
| [`src/status.ts`](src/status.ts) | 投影接缝的事实,以及 `/status` 报告与分段详情共享的小节;压缩与重试通知 |
|
|
280
285
|
| [`src/footer.ts`](src/footer.ts) | 状态栏:有序的各分段、每个分段的详情行、未聚焦时由两端向内构建的一行,以及聚焦时的滑动窗口 |
|
|
281
286
|
| [`src/subagent-panel.ts`](src/subagent-panel.ts) | 实时子 agent 面板:一次后代列表加上采样到的实时事实构成其各行、未聚焦时的摘要行,以及聚焦时的列表 |
|
|
287
|
+
| [`src/queue-panel.ts`](src/queue-panel.ts) | follow-ups 列表:待处理行符号、悬挂换行与 enter-steer 图例 |
|
|
282
288
|
| [`src/catalog.ts`](src/catalog.ts) | `/settings`、`/plugins`、`/subagents`、`/deliverables`、`/changes` 与 `/outline` 的行,以及 `/plugins` 的管理动作 |
|
|
283
|
-
| [`src/todos.ts`](src/todos.ts) | todo
|
|
289
|
+
| [`src/todos.ts`](src/todos.ts) | todo 列表:状态符号、已完成内容划掉的选择器行与单个条目的详情行 |
|
|
284
290
|
| [`cordis.patch.yml`](cordis.patch.yml) | 基于 `dsh-base` 的终端 patch |
|
|
285
291
|
| — | 不发布运行时不变量伴随模块;应用只在一个 Agent 上注册监听器,不持有其他观察者可能与之矛盾的可变关系。 |
|
|
286
|
-
| [`tests/app.spec.ts`](tests/app.spec.ts) |
|
|
292
|
+
| [`tests/app.spec.ts`](tests/app.spec.ts) | 基于伪终端的渲染、按键、命令、停止装填、编辑器上方的 follow-ups 行与两个接缝 |
|
|
287
293
|
| [`tests/keys.spec.ts`](tests/keys.spec.ts) | 每个区域为一个按键认领什么、按键提示的各级,以及一次按键输入的文字 |
|
|
288
294
|
| [`tests/editor.spec.ts`](tests/editor.spec.ts) | 对照 pi-tui 编辑器行为验证终端光标与 `Shift+Left` / `Shift+Right` 词导航 |
|
|
289
295
|
| [`tests/frame.spec.ts`](tests/frame.spec.ts) | 边框线、徽标、正文行,以及某个宽度容纳得下的按键提示 |
|
|
@@ -292,8 +298,10 @@ runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心
|
|
|
292
298
|
| [`tests/reader.spec.ts`](tests/reader.spec.ts) | 阅读器的几何布局、其状态机、其过滤,以及它返回的各行 |
|
|
293
299
|
| [`tests/reader-screen.spec.ts`](tests/reader-screen.spec.ts) | 阅读器面板:其按键映射、它铺满的屏幕、其重新锚定与其退出 |
|
|
294
300
|
| [`tests/alt-screen.spec.ts`](tests/alt-screen.spec.ts) | 备用屏幕:其成对的切换、其逐行绘制,以及更短的一帧所清除的行 |
|
|
295
|
-
| [`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` |
|
|
302
|
+
| [`tests/shell.spec.ts`](tests/shell.spec.ts) | 提交时解析的 `!` / `!!` 分发、下一步 inject、Esc 取消,以及缺少 shell 时的通知 |
|
|
296
303
|
| [`tests/effort.spec.ts`](tests/effort.spec.ts) | 共用的推理强度名称、选择器行、当前强度提示与输入参数匹配 |
|
|
304
|
+
| [`tests/permission.spec.ts`](tests/permission.spec.ts) | 共用的权限名称、选择器行、当前预设提示与输入参数匹配 |
|
|
297
305
|
| [`tests/panels.spec.ts`](tests/panels.spec.ts) | 状态页脚与报告、可导航的子 agent 与 todo 列表、目录命令、命令提示与审批详情 |
|
|
298
306
|
| [`tests/transcript-focus.spec.ts`](tests/transcript-focus.spec.ts) | 走遍对话记录、区域序列、检视面板、实时会话上的阅读器连同它接管与交还的终端,以及重绘窗口内的原地标记条 |
|
|
299
307
|
| [`tests/context.spec.ts`](tests/context.spec.ts) | 把系统提示词与注入上下文投影为对话记录小节 |
|
|
@@ -329,11 +337,25 @@ runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心
|
|
|
329
337
|
<a id="model-experience"></a>
|
|
330
338
|
## 模型体验
|
|
331
339
|
|
|
332
|
-
|
|
340
|
+
### 用户键入的 shell 命令
|
|
341
|
+
|
|
342
|
+
#### 模型看到什么
|
|
343
|
+
|
|
344
|
+
非空的 `!command` 行在命令结束后注入一条插件通知(`source.kind: plugin`,`plugin: tui-app`,`form: notice`)。下一步领取时会带上此包装;`<command>` 与围栏正文依数据而定。没有输出时使用精确一行 `(no output)` 而不是围栏。取消的运行会再追加一个空行和 `(command cancelled)`。非零退出会再追加一个空行和 `Command exited with code <n>`。`!!command` 与单独的 `!` 不添加通知。
|
|
345
|
+
|
|
346
|
+
##### 用户 shell 通知前缀
|
|
347
|
+
|
|
348
|
+
```markdown
|
|
349
|
+
The user ran `<command>` in the terminal.
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
#### Token 影响
|
|
353
|
+
|
|
354
|
+
有条件且保留:每条 `!` 通知留在之后请求的对话历史中;`!!` 与单独的 `!` 不增加任何内容。
|
|
333
355
|
|
|
334
356
|
#### KV Cache 影响
|
|
335
357
|
|
|
336
|
-
|
|
358
|
+
在可复用的请求前缀之后只做追加式增长。该通知不改变系统提示或工具目录。`/model` 切换像在浏览器中一样开始新的请求序列。
|
|
337
359
|
|
|
338
360
|
## 已知限制与延期工作
|
|
339
361
|
|
|
@@ -358,6 +380,7 @@ runner 不向请求前缀添加任何内容;`/model` 切换像在浏览器中
|
|
|
358
380
|
- **淡入需要终端的应答**——其亮度级别由终端对启动时发出的查询所报告的背景色构建,因此保持沉默、或既不编码真彩色也不编码 256 色的终端只会得到两级的暗淡模式;`NO_COLOR`、被禁用的调色板、`TERM=dumb` 与 `reducedMotion` 会完全关闭每一种淡入与每一种边框抬亮,临时提示行届时在保持结束时直接消失,而不是淡出。
|
|
359
381
|
- **终端自身的光标可能闪烁**——编辑器不绘制自己的光标,应用打开终端光标,而 pi-tui 会在其重绘的各行之间移动它;不支持 pi-tui 为一帧包裹的同步输出序列的终端可能显示出这种移动。
|
|
360
382
|
- **通过 `dsh` 启动器运行**——以其他方式启动该 profile 会在启动时失败,因为只有启动器能请求进程退出。
|
|
383
|
+
- **`!` 是一次性的,也不是 TTY**——每一行都是一次新的 `ctx.shell.run`;没有持久 shell,也不能跑交互式程序。Web 编辑器不拦截 `!`。命令行上的可选首条提示始终是用户消息。
|
|
361
384
|
|
|
362
385
|
<a id="dev-note"></a>
|
|
363
386
|
### 开发备注
|