@songtonyli/dsh-cli 0.1.36 → 0.1.38
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/@aws-sdk/core/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-http/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
- package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -6
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-websocket/package.json +7 -7
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +14 -11
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/schemas/schemas_0.js +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/schemas/schemas_0.js +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js +13 -10
- package/node_modules/@aws-sdk/nested-clients/package.json +8 -8
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +4 -4
- package/node_modules/@aws-sdk/types/package.json +2 -2
- package/node_modules/@aws-sdk/xml-builder/package.json +2 -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 +3 -3
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +100 -42
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +22 -37
- package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +26 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +49 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +12 -7
- package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +22 -22
- package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +0 -15
- package/node_modules/@smithy/core/dist-es/submodules/client/index.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js +8 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js +18 -3
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +49 -8
- package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +12 -7
- package/node_modules/@smithy/core/package.json +2 -2
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/undici/docs/docs/api/Agent.md +8 -8
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
- package/node_modules/undici/docs/docs/api/Errors.md +25 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
- package/node_modules/undici/docs/docs/api/Pool.md +5 -6
- package/node_modules/undici/lib/api/readable.js +1 -2
- package/node_modules/undici/lib/core/request.js +23 -2
- package/node_modules/undici/lib/core/util.js +0 -39
- package/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
- package/node_modules/undici/lib/dispatcher/client.js +1 -1
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -2
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
- package/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
- package/node_modules/undici/lib/dispatcher/pool.js +90 -7
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
- package/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
- package/node_modules/undici/lib/handler/redirect-handler.js +5 -0
- package/node_modules/undici/lib/handler/retry-handler.js +72 -13
- package/node_modules/undici/lib/interceptor/cache.js +4 -1
- package/node_modules/undici/lib/interceptor/decompress.js +236 -69
- package/node_modules/undici/lib/web/cache/cache.js +17 -8
- package/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
- package/node_modules/undici/lib/web/cookies/index.js +19 -7
- package/node_modules/undici/lib/web/cookies/util.js +3 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
- package/node_modules/undici/lib/web/fetch/body.js +22 -15
- package/node_modules/undici/lib/web/fetch/data-url.js +6 -6
- package/node_modules/undici/lib/web/fetch/formdata.js +30 -36
- package/node_modules/undici/lib/web/fetch/headers.js +34 -31
- package/node_modules/undici/lib/web/fetch/index.js +38 -14
- package/node_modules/undici/lib/web/fetch/request.js +74 -79
- package/node_modules/undici/lib/web/fetch/response.js +43 -44
- package/node_modules/undici/lib/web/fetch/util.js +7 -7
- package/node_modules/undici/lib/web/infra/index.js +16 -1
- package/node_modules/undici/lib/web/webidl/index.js +2 -14
- package/node_modules/undici/lib/web/websocket/events.js +43 -26
- package/node_modules/undici/lib/web/websocket/receiver.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
- package/node_modules/undici/lib/web/websocket/websocket.js +44 -41
- package/node_modules/undici/package.json +1 -1
- package/package.json +20 -20
|
@@ -20,6 +20,7 @@ const _IDPRCE = "IDPRejectedClaimException";
|
|
|
20
20
|
const _IITE = "InvalidIdentityTokenException";
|
|
21
21
|
const _K = "Key";
|
|
22
22
|
const _MPDE = "MalformedPolicyDocumentException";
|
|
23
|
+
const _MSTS = "MinimumSessionTokenSize";
|
|
23
24
|
const _P = "Policy";
|
|
24
25
|
const _PA = "PolicyArns";
|
|
25
26
|
const _PAr = "ProviderArn";
|
|
@@ -39,6 +40,8 @@ const _SFWIT = "SubjectFromWebIdentityToken";
|
|
|
39
40
|
const _SI = "SourceIdentity";
|
|
40
41
|
const _SN = "SerialNumber";
|
|
41
42
|
const _ST = "SessionToken";
|
|
43
|
+
const _STS = "SessionTokenSize";
|
|
44
|
+
const _STU = "SessionTokenUtilization";
|
|
42
45
|
const _T = "Tags";
|
|
43
46
|
const _TC = "TokenCode";
|
|
44
47
|
const _TTK = "TransitiveTagKeys";
|
|
@@ -60,10 +63,10 @@ const n0 = "com.amazonaws.sts";
|
|
|
60
63
|
import { TypeRegistry } from "@smithy/core/schema";
|
|
61
64
|
import { ExpiredTokenException, IDPCommunicationErrorException, IDPRejectedClaimException, InvalidIdentityTokenException, MalformedPolicyDocumentException, PackedPolicyTooLargeException, RegionDisabledException, } from "../models/errors";
|
|
62
65
|
import { STSServiceException } from "../models/STSServiceException";
|
|
63
|
-
const _s_registry = TypeRegistry
|
|
66
|
+
const _s_registry = new TypeRegistry(_s);
|
|
64
67
|
export var STSServiceException$ = [-3, _s, "STSServiceException", 0, [], []];
|
|
65
68
|
_s_registry.registerError(STSServiceException$, STSServiceException);
|
|
66
|
-
const n0_registry = TypeRegistry
|
|
69
|
+
const n0_registry = new TypeRegistry(n0);
|
|
67
70
|
export var ExpiredTokenException$ = [-3, n0, _ETE,
|
|
68
71
|
{ [_aQE]: [`ExpiredTokenException`, 400], [_e]: _c, [_hE]: 400 },
|
|
69
72
|
[_m],
|
|
@@ -119,23 +122,23 @@ export var AssumedRoleUser$ = [3, n0, _ARU,
|
|
|
119
122
|
];
|
|
120
123
|
export var AssumeRoleRequest$ = [3, n0, _ARR,
|
|
121
124
|
0,
|
|
122
|
-
[_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC],
|
|
123
|
-
[0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType], 2
|
|
125
|
+
[_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC, _MSTS],
|
|
126
|
+
[0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType, 1], 2
|
|
124
127
|
];
|
|
125
128
|
export var AssumeRoleResponse$ = [3, n0, _ARRs,
|
|
126
129
|
0,
|
|
127
|
-
[_C, _ARU, _PPS, _SI],
|
|
128
|
-
[[() => Credentials$, 0], () => AssumedRoleUser$, 1, 0]
|
|
130
|
+
[_C, _ARU, _PPS, _SI, _STU, _STS],
|
|
131
|
+
[[() => Credentials$, 0], () => AssumedRoleUser$, 1, 0, 1, 1]
|
|
129
132
|
];
|
|
130
133
|
export var AssumeRoleWithWebIdentityRequest$ = [3, n0, _ARWWIR,
|
|
131
134
|
0,
|
|
132
|
-
[_RA, _RSN, _WIT, _PI, _PA, _P, _DS],
|
|
133
|
-
[0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1], 3
|
|
135
|
+
[_RA, _RSN, _WIT, _PI, _PA, _P, _DS, _MSTS],
|
|
136
|
+
[0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1, 1], 3
|
|
134
137
|
];
|
|
135
138
|
export var AssumeRoleWithWebIdentityResponse$ = [3, n0, _ARWWIRs,
|
|
136
139
|
0,
|
|
137
|
-
[_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI],
|
|
138
|
-
[[() => Credentials$, 0], 0, () => AssumedRoleUser$, 1, 0, 0, 0]
|
|
140
|
+
[_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI, _STU, _STS],
|
|
141
|
+
[[() => Credentials$, 0], 0, () => AssumedRoleUser$, 1, 0, 0, 0, 1, 1]
|
|
139
142
|
];
|
|
140
143
|
export var Credentials$ = [3, n0, _C,
|
|
141
144
|
0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/nested-clients",
|
|
3
|
-
"version": "3.997.
|
|
3
|
+
"version": "3.997.46",
|
|
4
4
|
"description": "Nested clients for AWS SDK packages.",
|
|
5
5
|
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -87,13 +87,13 @@
|
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@aws-sdk/core": "^3.978.
|
|
91
|
-
"@aws-sdk/signature-v4-multi-region": "^3.996.
|
|
92
|
-
"@aws-sdk/types": "^3.974.
|
|
93
|
-
"@smithy/core": "^3.
|
|
94
|
-
"@smithy/fetch-http-handler": "^5.
|
|
95
|
-
"@smithy/node-http-handler": "^4.
|
|
96
|
-
"@smithy/types": "^4.
|
|
90
|
+
"@aws-sdk/core": "^3.978.1",
|
|
91
|
+
"@aws-sdk/signature-v4-multi-region": "^3.996.47",
|
|
92
|
+
"@aws-sdk/types": "^3.974.6",
|
|
93
|
+
"@smithy/core": "^3.35.0",
|
|
94
|
+
"@smithy/fetch-http-handler": "^5.8.0",
|
|
95
|
+
"@smithy/node-http-handler": "^4.12.1",
|
|
96
|
+
"@smithy/types": "^4.19.0",
|
|
97
97
|
"tslib": "^2.6.2"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/signature-v4-multi-region",
|
|
3
|
-
"version": "3.996.
|
|
3
|
+
"version": "3.996.47",
|
|
4
4
|
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/signature-v4-multi-region",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@aws-sdk/types": "^3.974.
|
|
31
|
-
"@smithy/signature-v4": "^5.
|
|
32
|
-
"@smithy/types": "^4.
|
|
30
|
+
"@aws-sdk/types": "^3.974.6",
|
|
31
|
+
"@smithy/signature-v4": "^5.7.3",
|
|
32
|
+
"@smithy/types": "^4.19.0",
|
|
33
33
|
"tslib": "^2.6.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/types",
|
|
3
|
-
"version": "3.974.
|
|
3
|
+
"version": "3.974.6",
|
|
4
4
|
"description": "Types for the AWS SDK",
|
|
5
5
|
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages-internal/types",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"react-native": {},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@smithy/types": "^4.
|
|
33
|
+
"@smithy/types": "^4.19.0",
|
|
34
34
|
"tslib": "^2.6.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/xml-builder",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.41",
|
|
4
4
|
"description": "XML utilities for the AWS SDK",
|
|
5
5
|
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages-internal/xml-builder",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"./dist-es/xml-parser": "./dist-es/xml-parser.browser"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@smithy/types": "^4.
|
|
37
|
+
"@smithy/types": "^4.19.0",
|
|
38
38
|
"tslib": "^2.6.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -158,7 +158,7 @@ window.__ModuleLoader__.load({
|
|
|
158
158
|
const SCROLLBAR_LINGER_MS = 2e3;
|
|
159
159
|
/** Format complete-build metadata for the local brand badge. */
|
|
160
160
|
function localBuildVersion() {
|
|
161
|
-
return `0.1.7-alpha.1-
|
|
161
|
+
return `0.1.7-alpha.1-520bcb7` + ({}.DSH_CLIENT_GIT_DIRTY === "true" ? "-dirty" : "");
|
|
162
162
|
}
|
|
163
163
|
/** Each panel row subscribes only to its own selection state. */
|
|
164
164
|
function PanelRow({ id, label, wide, usePanelInfo, selectPanel, renderSlot }) {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/react": "~18.3.1",
|
|
27
|
-
"@deepseek-ai/
|
|
28
|
-
"@deepseek-ai/
|
|
27
|
+
"@deepseek-ai/cordis": "^4.0.3",
|
|
28
|
+
"@deepseek-ai/dsh-client-store": "^0.1.7-alpha.1"
|
|
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: 7ca6c87f5f29b0d69d3c6d0740e606bdca735047
|
|
6
|
+
README.zh.md: e251b01bacf00a7671aeb0d00713e7a2285d557b
|
|
@@ -40,15 +40,15 @@ 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 `❯` on a tinted full-width band while colour is on (attachments listed under them), assistant reasoning is dim italic under a `✻ Thinking` header above the Markdown reply, and each tool call is a card with a `◆` glyph coloured by status — yellow while it runs, green once done, red on failure — the bold tool name, the presenter headline in
|
|
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 `❯` on a tinted full-width band while colour is on (attachments listed under them), assistant reasoning is dim italic under a `✻ Thinking` header above the Markdown reply, and each tool call is a card with a `◆` glyph coloured by status — yellow while it runs, green once done, red on failure — the bold tool name, the presenter headline in violet, a loading row while it runs, and a body folded to `toolPreviewLines` rows. The card appears when the model starts the call; the result rows float out when the tool answers. An `edit` or `write` diff card frames each run of consecutive additions in a green rounded box and each run of removals in a red one, the removed rows above the added ones. A `subagent` or `subagent_*` card draws folded as one row behind the same status-coloured `◆`, dim for a child handed to the background: while it runs, the tool name, the task description, and the requested model and `background` when the call names them; once settled, the description dimmed with `[done]`, `[started]` for a child handed to the background, or `[failed]` at the right edge. `Space` on the marked row, or `Ctrl+O`, unfolds the full card. 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, 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 — and the shell command of a `!` / `!!` draft, a `$ command` user-shell row (its `$` in the accent colour), and a terminal tool card, 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 and list markers use warm orange, links and inline code use violet, and quotes stay dim. Streamed reasoning, reply text, and tool arguments are queued as they arrive and drawn a share per frame, about 60 frames per second by default, so a network burst spreads over `streamPaceFrames` frames instead of landing at once, and the queue never holds the model call back. 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 — its label is `thinking` while the model reasons, `writing` while visible text arrives, or `calling <tool>` while a tool is streamed or still running, plus live `↑` send and `↓` receive tokens for the current model call, as compact `k` / `M` / `B` counts, growing as the stream arrives and settling on the provider usage chunk — any open prompt, a boxed follow-ups list while messages wait, an activity board of the open turn's todos and latest descendant line while either has a row — completed todo content scratched out, at most four todo rows then `+<n> more`, not a focus region, gone on `turn/end` and bind — 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`, or `Shift+↑ select · Shift+↓ status` while follow-ups wait, 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, token usage (session totals plus the in-flight call), the goal and plan-mode markers from the projection seam, and the count of pending attachments. Compaction and model-request retries appear as notices, the same facts the browser's markers carry.
|
|
45
|
+
Below the transcript sit a spinner while the agent works — its label is `thinking` while the model reasons, `writing` while visible text arrives, or `calling <tool>` while a tool is streamed or still running, plus live `↑` send and `↓` receive tokens for the current model call, as compact `k` / `M` / `B` counts, growing as the stream arrives and settling on the provider usage chunk — any open prompt, a boxed follow-ups list while messages wait, an activity board of the open turn's todos and latest descendant line while either has a row — completed todo content scratched out and status glyphs colored green, yellow, or cyan, at most four todo rows then `+<n> more`, not a focus region, gone on `turn/end` and bind — 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 and entry keys are colored; live turn, context, and todo facts use yellow, violet, and green. 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`, or `Shift+↑ select · Shift+↓ status` while follow-ups wait, 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, token usage (session totals plus the in-flight call), 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
|
|
|
49
49
|
The focused block is also marked where it stands, with a two-column gutter that is dim beside the block's other lines and accented beside the focused section's own — or beside the fold marker, when the fold left that section out of the drawn rows entirely — and its content wraps two columns narrower while the mark is drawn. That mark reaches only the lines pi-tui still repaints differentially — the last `rows` lines of the last frame it wrote, a window a taller frame raises and a shorter one never lowers — because changing anything above them would clear the terminal's scrollback. A block that has scrolled past that point keeps no gutter, the inspector heading appends ` · off screen`, and the frame's own rules draw dim instead of accent, so the frame itself reports that the mark cannot be drawn where the block stands. A fade whose rows reach that edge settles them to their final colors in the frame that writes them, so nothing stays dim in the scrollback.
|
|
50
50
|
|
|
51
|
-
`Ctrl+G` from any region, `Enter` on a conversation section, and `/turns` read the conversation full screen, one turn at a time. The reader takes the terminal rather than drawing over the conversation: it runs on the terminal's alternate screen, the screen a pager runs on, and the conversation's own screen is held off the terminal for as long as it is up. So it costs the conversation no line, leaves the repaint window where it was, fills the screen on every terminal, and cannot leave a row of itself in your scrollback; closing it restores the conversation exactly as you left it, with whatever landed meanwhile drawn underneath. Under a top rule carrying a ` ● READER ` chip and `turn <n> of <total>`, the turn being read takes most of the screen and a narrow turn list sits to its left. The list has one row per turn — `❯` on the turn being read, the turn number, the first line of its prompt, and right-aligned markers, `⬡<n>` injected context blocks, `✻` any reasoning, `¶` any reply, `◆<n>` tool calls — with the sections of the turn being read listed under it, `▸` on the one the reader holds, so any turn's own context is one step away. The turn panel scrolls that turn end to end in the conversation's own glyphs, a blank row between each two sections: the prompt opens it behind `❯` on a shaded band, then `✻ Thinking` dim, `¶ Reply`
|
|
51
|
+
`Ctrl+G` from any region, `Enter` on a conversation section, and `/turns` read the conversation full screen, one turn at a time. The reader takes the terminal rather than drawing over the conversation: it runs on the terminal's alternate screen, the screen a pager runs on, and the conversation's own screen is held off the terminal for as long as it is up. So it costs the conversation no line, leaves the repaint window where it was, fills the screen on every terminal, and cannot leave a row of itself in your scrollback; closing it restores the conversation exactly as you left it, with whatever landed meanwhile drawn underneath. Under a top rule carrying a ` ● READER ` chip and `turn <n> of <total>`, the turn being read takes most of the screen and a narrow turn list sits to its left, every body row closed by a right border. The list has one row per turn — `❯` on the turn being read, the turn number, the first line of its prompt, and right-aligned markers, `⬡<n>` injected context blocks, `✻` any reasoning, `¶` any reply, `◆<n>` tool calls — with the sections of the turn being read listed under it, `▸` on the one the reader holds, so any turn's own context is one step away. The turn panel scrolls that turn end to end in the conversation's own glyphs, a blank row between each two sections: the prompt opens it behind `❯` on a shaded band, then `✻ Thinking` in dim italic, `¶ Reply` rendered as the conversation renders Markdown — headings, emphasis, inline code, and fenced code in syntax colour — except that unordered bullets are drawn as `•`, a call's `◆` — green once its result landed, yellow while it runs — with the tool name in bold and its headline in the link blue, `⎿ Result` indented under its call with a diff's `+ ` rows green and `- ` rows red on shaded bands and a `read` card's file rows in syntax colour, and `⬡` with the label of an injected context. The section the top row belongs to is accented and carries the conversation walk's `┃` gutter on every row, which reads with no color at all. The bands are mixed from the background color the terminal reports, so a terminal that reports none, or draws no color, draws the panel without them. Rows are never folded there: the reader is where the full model-facing text of a system prompt, an injected snapshot, a long reply, or a tool result is read. `Right` opens the selected turn and `Left` goes back to the list; in the list `Up` / `Down` step one section at a time and cross into the turn either side while `PageUp` / `PageDown` step a whole turn, in the turn they scroll one row at a time, and the section the top row belongs to is where the conversation resumes when the reader closes. `/` opens a query line in place of the legend and narrows the list to the turns whose prompt or text matches, with the readout reading `<kept>/<total> turns`; otherwise the legend rule reports `turn 3/12 · row 14/212` at its right, which no width drops. Below `readerMinColumns` the body draws one panel at a time — the list, or the turn `Right` opens from it — and below 24 columns or 8 rows it draws one dim line, `terminal too small for the reader (needs 24×8)`, and answers only `Esc`, `Ctrl+G`, and `Ctrl+C`. It re-reads the conversation on every render, so a streaming reply grows inside it, a landing tool result appears, and a new turn joins the list; a rewrap re-anchors on the section being read rather than on a row number; an approval or a question steps it aside for that prompt's lifetime; and a session switch takes it down with the notice `the transcript changed · reader closed`.
|
|
52
52
|
|
|
53
53
|
Transient key feedback floats as a dim framed line in the top-right corner of the viewport: `press Esc again to stop turn <n>`, `press Ctrl+C again to quit`, and `nothing in the transcript to read yet`. It holds at full strength for `toastMs`, fades out, costs the conversation no row of its own, and takes no keyboard; where the renderer can no longer repaint the top of the viewport it is printed into the conversation instead, which keeps it. Facts worth keeping are notices in the conversation: `stopping the turn…`, `wait for the session switch to finish`, `above the repaint window · opened in the reader`, and every command result.
|
|
54
54
|
|
|
@@ -40,15 +40,15 @@ dsh tui --no-open # print sign-in URLs without opening a
|
|
|
40
40
|
|
|
41
41
|
### 屏幕布局
|
|
42
42
|
|
|
43
|
-
页眉在标题生成或设置后以标题命名会话,并在旁边显示 id。对话记录在终端自身的回滚区中增长:你的提示以 `❯` 开头,启用颜色时铺在一条通栏的着色背景带上(附件列在其下),assistant 的推理以暗色斜体显示在 `✻ Thinking` 标题之下、Markdown 回复上方,每次工具调用是一张卡片,含按状态着色的 `◆`
|
|
43
|
+
页眉在标题生成或设置后以标题命名会话,并在旁边显示 id。对话记录在终端自身的回滚区中增长:你的提示以 `❯` 开头,启用颜色时铺在一条通栏的着色背景带上(附件列在其下),assistant 的推理以暗色斜体显示在 `✻ Thinking` 标题之下、Markdown 回复上方,每次工具调用是一张卡片,含按状态着色的 `◆` 符号(运行中为黄色、完成为绿色、失败为红色)、粗体工具名、以紫色显示的呈现器标题、运行中的一行加载标记,以及折叠到 `toolPreviewLines` 行的正文。卡片在模型开始调用时出现;结果行在工具回答后浮出。`edit` 或 `write` diff 卡片把每一段连续新增行框进绿色圆角框、每一段连续删除行框进红色圆角框,删除的旧行在上、新增的新行在下。`subagent` 与 `subagent_*` 卡片折叠时只画一行,行首是同样按状态着色的 `◆`,交给后台的子 agent 则为暗色:运行中显示工具名、任务描述,以及调用指定的模型与 `background`;结束后描述变暗,右端标出 `[done]`,交给后台的子 agent 标 `[started]`,失败标 `[failed]`。在被标记的行上按 `Space`,或按 `Ctrl+O`,即可展开完整卡片。非空的系统提示词与每一条注入的上下文——instructions、catalogs、snapshots、notices、relays 与 recalls——绘制为暗色 `⬡` 标题,其下是面向模型文本的前 `contextPreviewLines` 行,快照的每一份贡献具名写在其自身各行上方;空的系统提示词与压缩替换则省略。承载的行数多于其绘制行数的工具卡片与上下文块,结尾都是同一条标记:该块被对话记录的焦点持有时为 `… <n> more rows · Space expands`,否则为 `… <n> more rows · Ctrl+O expands`。回复中的围栏代码、`read` 卡片的文件行、`edit` 或 `write` diff 卡片的变更行——其中 `+` 新增项标为绿色、`-` 删除项标为红色,符号后的源文本按文件扩展名对应的语言绘制——以及 `!` / `!!` 草稿、用户 shell 的 `$ command` 行(其 `$` 用强调色)与终端工具卡片中的 shell 命令,都使用语法高亮,配色主题由终端自身的背景在明暗之间选定;某种语言的语法会在第一个用到它的代码块出现时才加载,因此该块先以纯文本绘制、随后被重绘为彩色;这里没有对应语法的语言、既不支持 24 位也不支持 256 色的终端,以及 `codeHighlight: false`,都会把每个代码块画成纯文本。标题与列表标记使用暖橙色,链接与行内代码使用紫色,引用保持暗色。流式推理、回复文字与工具参数到达时先入队,再按帧(默认约每秒 60 帧)分批绘制,因此一次网络突发会分摊到 `streamPaceFrames` 帧里,而不是一次落下,队列也从不拖慢模型调用。流式回复文字会淡入,而且每个词各走各的时钟:一个词以接近终端背景色的亮度出现,并经 `streamFadeSteps` 次、每次 `streamFadeStepMs` 提亮到它最终稳定的颜色,因此流得更快只会留下更长的一串正在提亮的词,而不会更暗。流式推理与工具卡片在同一时长内浮出:它们以抬高的颜色出现,再退回到稳定时的暗色斜体或调色板颜色;从持久化历史重绘的卡片不带淡入,已经稳定下来的文字也不会再被调暗。
|
|
44
44
|
|
|
45
|
-
对话记录下方依次是 agent 工作时的旋转指示——其标签在模型推理时为 `thinking`,可见文本到达时为 `writing`,工具正在流出或仍在执行时为 `calling <tool>`,并带着当前这次模型调用的实时 `↑` 发送与 `↓` 接收 token,以紧凑的 `k` / `M` / `B` 计数,随数据流入增长,并在提供方的 usage 块到达后落定——任何打开的提示、有消息等待时的带框 follow-ups 列表、本轮 todo 与最新后代行的 activity board
|
|
45
|
+
对话记录下方依次是 agent 工作时的旋转指示——其标签在模型推理时为 `thinking`,可见文本到达时为 `writing`,工具正在流出或仍在执行时为 `calling <tool>`,并带着当前这次模型调用的实时 `↑` 发送与 `↓` 接收 token,以紧凑的 `k` / `M` / `B` 计数,随数据流入增长,并在提供方的 usage 块到达后落定——任何打开的提示、有消息等待时的带框 follow-ups 列表、本轮 todo 与最新后代行的 activity board(有行时才绘制;已完成内容划掉,状态符号以绿色、黄色或青色显示,todo 最多四行其后 `+<n> more`,不是焦点区域,在 `turn/end` 与 bind 时消失)、编辑器、子 agent 面板,以及页脚:未聚焦时是一行由两端向内构建的状态栏。编辑器的光标是终端自身的闪烁竖条:应用在启动时请求这一形状,退出时把你的默认形状还回去,而状态栏或面板持有键盘期间完全不绘制光标。模型与入口按键带有颜色;进行中的轮次、上下文与 todo 信息分别使用黄色、紫色与绿色。模型锚定在左端且永不丢弃——超过 20 列时退回到裸模型名,只有仍然过宽的标签才会被省略号截断——离开编辑器的那两个按键则锚定在右端,写作 `Shift+↑ read · Shift+↓ status`,有 follow-ups 等待时则写作 `Shift+↑ select · 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
|
|
|
49
49
|
被聚焦的块也会在原地被标记:一条两列宽的标记条,在块的其他行旁为暗色、在被聚焦小节自身的行旁为强调色——若折叠把该小节整个留在了绘出的行之外,强调色便落在那一行折叠标记旁——标记绘制期间该块的内容按窄两列换行。这个标记只能落在 pi-tui 仍以差分方式重绘的行上——也就是它写出的上一帧的最后 `rows` 行,这条边界只会被更高的帧抬高、不会被更矮的帧降低——因为改动其上方的任何一行都会清空终端的回滚区。已经滚过该位置的块不带标记条,检视面板的标题追加 ` · off screen`,其边框线也改画暗色而非强调色,于是边框本身就报告出标记无法画在该块所在之处。淡入中的各行抵达这一边界时,会在写出它们的同一帧内被结算为最终颜色,因此回滚区里不会留下暗色文字。
|
|
50
50
|
|
|
51
|
-
在任一区域按 `Ctrl+G`、在对话记录的某个小节上按 `Enter`,以及 `/turns`,都会整屏读出对话记录,一次读一个轮次。阅读器并不画在对话记录之上,而是接管终端:它运行在终端的备用屏幕(alternate screen,分页器所用的那块屏幕)上,只要它还开着,对话记录自己的屏幕就被挡在终端之外。因此它不占用对话记录的任何一行,让重绘边界保持原位,在任何终端上都铺满整屏,也不可能把自己的任何一行留在你的回滚缓冲里;关闭它会把对话记录原样恢复成你离开时的样子,期间落地的内容则绘制在其下方。在带有 ` ● READER ` 徽标与 `turn <n> of <total>`
|
|
51
|
+
在任一区域按 `Ctrl+G`、在对话记录的某个小节上按 `Enter`,以及 `/turns`,都会整屏读出对话记录,一次读一个轮次。阅读器并不画在对话记录之上,而是接管终端:它运行在终端的备用屏幕(alternate screen,分页器所用的那块屏幕)上,只要它还开着,对话记录自己的屏幕就被挡在终端之外。因此它不占用对话记录的任何一行,让重绘边界保持原位,在任何终端上都铺满整屏,也不可能把自己的任何一行留在你的回滚缓冲里;关闭它会把对话记录原样恢复成你离开时的样子,期间落地的内容则绘制在其下方。在带有 ` ● READER ` 徽标与 `turn <n> of <total>` 的顶边线之下,正在阅读的轮次占据屏幕的大部分,左侧是一列窄的轮次列表,每个正文行都以右边框收口。列表每个轮次一行——正在阅读的轮次带 `❯`、轮次编号、其提示的首行,以及右对齐的标记 `⬡<n>` 注入上下文块数、`✻` 有推理、`¶` 有回复、`◆<n>` 工具调用数——并在正在阅读的那个轮次之下列出它的各小节,`▸` 落在阅读器所持的那一个上,因此任何轮次自己的上下文都只有一步之遥。轮次面板用对话记录自己的符号把该轮次从头到尾滚动读出,相邻两个小节之间隔一空行:提示以 `❯` 开头、铺在着色背景带上,其后是暗色斜体的 `✻ Thinking`、按对话记录的方式渲染 Markdown(标题、强调、行内代码,以及带语法着色的围栏代码)但无序列表符号画成 `•` 的 `¶ Reply`、工具调用的 `◆`(结果落地后为绿色、运行中为黄色)连同粗体工具名与链接蓝色的标题、缩进在调用之下的 `⎿ Result`(diff 的 `+ ` 行为绿色、`- ` 行为红色,各铺在着色背景带上;`read` 卡片的文件行带语法着色),以及带注入上下文标签的 `⬡`。顶行所属的小节带强调色,并在每一行带上对话记录走查所用的 `┃` 标记条,无色时也能辨认。背景带由终端报告的背景色混合而成,因此没有报告背景色、或不绘制颜色的终端画出的面板不带背景带。那里的行从不折叠:阅读器正是读取系统提示词、注入快照、长回复或工具结果完整面向模型文本的地方。`Right` 打开被选中的轮次,`Left` 回到轮次列表;在列表中 `Up` / `Down` 每次步进一个小节并跨入相邻的轮次,而 `PageUp` / `PageDown` 步进整个轮次;在轮次面板中它们逐行滚动,而顶行所属的小节就是阅读器关闭后对话记录恢复到的位置。`/` 在按键提示的位置打开一行查询,把轮次列表收窄到提示或文本匹配的轮次,读数写作 `<kept>/<total> turns`;其余时候提示边线在右端报告 `turn 3/12 · row 14/212`,任何宽度都不会丢弃它。列数不足 `readerMinColumns` 时正文一次只画一个面板——轮次列表,或由 `Right` 从中打开的那个轮次——不足 24 列或 8 行时只画一行暗色文字 `terminal too small for the reader (needs 24×8)`,并且只应答 `Esc`、`Ctrl+G` 与 `Ctrl+C`。它在每一帧都重新读取对话记录,因此流式回复会在其中增长、落地的工具结果会出现、新轮次会加入轮次列表;重新换行时它按正在阅读的小节重新锚定,而不是按行号;审批或提问出现时它在该提示存续期间让位;切换会话会让它随通知 `the transcript changed · reader closed` 一同关闭。
|
|
52
52
|
|
|
53
53
|
临时按键反馈以一行暗色带框文字浮在视口右上角:`press Esc again to stop turn <n>`、`press Ctrl+C again to quit` 与 `nothing in the transcript to read yet`。它以全亮度保持 `toastMs`、随后淡出,不占用对话记录自身的任何一行,也不接管键盘;渲染器已无法重绘视口顶部时,它改为打印进对话记录,从而被保留下来。值得留存的事实则是对话记录中的通知:`stopping the turn…`、`wait for the session switch to finish`、`above the repaint window · opened in the reader` 以及每一条命令结果。
|
|
54
54
|
|
|
@@ -2391,8 +2391,8 @@ const SGR = {
|
|
|
2391
2391
|
underline: ["4", "24"],
|
|
2392
2392
|
strikethrough: ["9", "29"],
|
|
2393
2393
|
accent: ["36", "39"],
|
|
2394
|
-
heading: ["38;5;
|
|
2395
|
-
link: ["38;5;
|
|
2394
|
+
heading: ["38;5;215", "39"],
|
|
2395
|
+
link: ["38;5;141", "39"],
|
|
2396
2396
|
success: ["32", "39"],
|
|
2397
2397
|
warning: ["33", "39"],
|
|
2398
2398
|
error: ["31", "39"],
|
|
@@ -3373,14 +3373,23 @@ var ToolBlock = class {
|
|
|
3373
3373
|
* @returns the call section, then the result section once the tool answered.
|
|
3374
3374
|
*/
|
|
3375
3375
|
parts() {
|
|
3376
|
-
const
|
|
3377
|
-
const
|
|
3376
|
+
const title = this.call.title === "" ? [] : [this.call.title];
|
|
3377
|
+
const call = [...title, ...this.call.lines];
|
|
3378
|
+
const parts = [call.length === 0 ? {
|
|
3378
3379
|
kind: "call",
|
|
3379
|
-
rows:
|
|
3380
|
+
rows: [NO_ARGUMENTS]
|
|
3381
|
+
} : {
|
|
3382
|
+
kind: "call",
|
|
3383
|
+
rows: call,
|
|
3384
|
+
...this.call.code === void 0 ? {} : { code: [...title.map(() => void 0), ...this.call.code] }
|
|
3380
3385
|
}];
|
|
3381
|
-
if (this.status !== "running") parts.push({
|
|
3386
|
+
if (this.status !== "running") parts.push(this.resultLines.length === 0 ? {
|
|
3387
|
+
kind: "result",
|
|
3388
|
+
rows: [NO_OUTPUT]
|
|
3389
|
+
} : {
|
|
3382
3390
|
kind: "result",
|
|
3383
|
-
rows: this.resultLines
|
|
3391
|
+
rows: this.resultLines,
|
|
3392
|
+
...this.resultCode === void 0 ? {} : { code: this.resultCode }
|
|
3384
3393
|
});
|
|
3385
3394
|
return parts;
|
|
3386
3395
|
}
|
|
@@ -6529,21 +6538,26 @@ function middleFacts(facts, hidden, room) {
|
|
|
6529
6538
|
* the entry keys reserved at the right edge, and the key facts filling
|
|
6530
6539
|
* whatever middle is left, every segment they cannot hold folded into `+N`.
|
|
6531
6540
|
* @param segments - the segments in bar order.
|
|
6532
|
-
* @param palette - the palette the
|
|
6541
|
+
* @param palette - the palette that distinguishes the model, live facts, and entry keys.
|
|
6533
6542
|
* @param width - terminal columns the line must fit.
|
|
6534
6543
|
* @param queue - whether follow-ups are drawn, which rewrites Shift+↑.
|
|
6535
|
-
* @returns one dim
|
|
6544
|
+
* @returns one line with colored key facts and dim secondary facts.
|
|
6536
6545
|
*/
|
|
6537
6546
|
function unfocusedLine(segments, palette, width, queue) {
|
|
6538
6547
|
const [anchor, ...rest] = segments;
|
|
6539
6548
|
const model = anchorLabel(anchor);
|
|
6540
6549
|
const hint = entryHint(width, queue);
|
|
6541
6550
|
const reserved = hint === "" ? 0 : visibleWidth(hint) + HINT_GAP;
|
|
6542
|
-
const facts = rest.filter((segment) => KEY_SEGMENT_IDS.has(segment.id)).map((segment) =>
|
|
6551
|
+
const facts = rest.filter((segment) => KEY_SEGMENT_IDS.has(segment.id)).map((segment) => {
|
|
6552
|
+
if (segment.id === "turn") return palette.warning(segment.label);
|
|
6553
|
+
if (segment.id === "context") return palette.link(segment.label);
|
|
6554
|
+
if (segment.id === "todo") return palette.success(segment.label);
|
|
6555
|
+
return palette.dim(segment.label);
|
|
6556
|
+
});
|
|
6543
6557
|
const drawn = middleFacts(facts, rest.length - facts.length, width - visibleWidth(model) - reserved);
|
|
6544
|
-
const left = palette.
|
|
6558
|
+
const left = [model === "" ? "" : palette.accent(model), ...drawn].filter((token) => token !== "").join(palette.dim(SEPARATOR$2));
|
|
6545
6559
|
if (hint === "") return fitLine(left, width);
|
|
6546
|
-
return fitLine(`${left}${" ".repeat(Math.max(1, width - visibleWidth(left) - visibleWidth(hint)))}${palette.
|
|
6560
|
+
return fitLine(`${left}${" ".repeat(Math.max(1, width - visibleWidth(left) - visibleWidth(hint)))}${palette.link(hint)}`, width);
|
|
6547
6561
|
}
|
|
6548
6562
|
/**
|
|
6549
6563
|
* The first detail row of a printed segment, or the summary of a page segment.
|
|
@@ -7287,7 +7301,7 @@ function activityTurnEndStatus(reason) {
|
|
|
7287
7301
|
return turnEndNotice(reason) ?? "done";
|
|
7288
7302
|
}
|
|
7289
7303
|
/**
|
|
7290
|
-
* Render the board. Todo rows lead with
|
|
7304
|
+
* Render the board. Todo rows lead with status-colored glyphs; completed
|
|
7291
7305
|
* content is dim and scratched out. A list past the cap ends on `+<n> more`.
|
|
7292
7306
|
* The descendant line is last. An empty view returns the empty string so the
|
|
7293
7307
|
* slot can unmount.
|
|
@@ -7300,7 +7314,8 @@ function renderActivityBoard(view, render) {
|
|
|
7300
7314
|
const lines = [];
|
|
7301
7315
|
for (const row of view.todos) {
|
|
7302
7316
|
const content = paintTodoContent(row.content, row.status, (text) => palette.dim(palette.strikethrough(text)));
|
|
7303
|
-
|
|
7317
|
+
const paint = row.status === "completed" ? palette.success : row.status === "in_progress" ? palette.warning : palette.accent;
|
|
7318
|
+
lines.push(fadedLine(`${paint(TODO_GLYPH[row.status])} ${content}`, render.todoFades?.get(row.content)));
|
|
7304
7319
|
}
|
|
7305
7320
|
if (view.hidden > 0) lines.push(palette.dim(`+${String(view.hidden)} more`));
|
|
7306
7321
|
if (view.subagent !== void 0) lines.push(fadedLine(palette.dim(view.subagent), render.subagentFade));
|
|
@@ -7410,11 +7425,13 @@ const LIST_SHARE = .25;
|
|
|
7410
7425
|
const CHROME_ROWS = 3;
|
|
7411
7426
|
/** Columns one body column spends on the border before it and the space after it. */
|
|
7412
7427
|
const COLUMN_MARGIN = 2;
|
|
7428
|
+
/** Columns a body row spends closing the frame: the space and the right border. */
|
|
7429
|
+
const CLOSE_MARGIN = 2;
|
|
7413
7430
|
/** What the chip names this mode. */
|
|
7414
7431
|
const READER_CHIP = "READER";
|
|
7415
7432
|
/** What ends a line the width cut short; one column, so the mark itself fits. */
|
|
7416
7433
|
const ELLIPSIS$1 = "…";
|
|
7417
|
-
/** The left
|
|
7434
|
+
/** The left and right borders of a body row and the border between the two panels. */
|
|
7418
7435
|
const SIDE = "│";
|
|
7419
7436
|
/** Marks the listed section the keyboard holds. */
|
|
7420
7437
|
const LIST_MARK = "▸";
|
|
@@ -7430,8 +7447,8 @@ const BODY_INDENT = " ";
|
|
|
7430
7447
|
const RESULT_INDENT = " ";
|
|
7431
7448
|
/** What a Markdown bullet of a reply is drawn as. */
|
|
7432
7449
|
const BULLET = "• ";
|
|
7433
|
-
/**
|
|
7434
|
-
const MARKDOWN_BULLET =
|
|
7450
|
+
/** The marker pi-tui's Markdown draws an unordered list item with. */
|
|
7451
|
+
const MARKDOWN_BULLET = "- ";
|
|
7435
7452
|
/** What opens a source row a diff adds. */
|
|
7436
7453
|
const ADDED_PREFIX = "+ ";
|
|
7437
7454
|
/** What opens a source row a diff removes. */
|
|
@@ -7657,20 +7674,57 @@ function rowTone(block, part, row) {
|
|
|
7657
7674
|
if (row.startsWith(ADDED_PREFIX)) return "added";
|
|
7658
7675
|
if (row.startsWith(REMOVED_PREFIX)) return "removed";
|
|
7659
7676
|
}
|
|
7660
|
-
|
|
7677
|
+
if (part.kind === "reasoning") return "thought";
|
|
7678
|
+
return part.kind === "call" ? "dim" : "plain";
|
|
7661
7679
|
}
|
|
7680
|
+
/** An unstyled palette, which is all measuring needs: styling never changes a row count. */
|
|
7681
|
+
const MEASURING = createPalette(false);
|
|
7682
|
+
/** Replies whose measured rows {@link measuredReplies} keeps before it starts over. */
|
|
7683
|
+
const MEASURED_REPLIES = 256;
|
|
7684
|
+
/** Measured reply rows, by width and text. */
|
|
7685
|
+
const measuredReplies = /* @__PURE__ */ new Map();
|
|
7662
7686
|
/**
|
|
7663
7687
|
* The source rows a section's body draws. A call whose first row repeats the
|
|
7664
|
-
* headline the header already names starts after it
|
|
7665
|
-
*
|
|
7688
|
+
* headline the header already names starts after it; every other row is the
|
|
7689
|
+
* model-facing text as is.
|
|
7666
7690
|
* @param block - the block the section belongs to.
|
|
7667
7691
|
* @param part - the section.
|
|
7668
|
-
* @returns the rows, unwrapped.
|
|
7692
|
+
* @returns the rows, unwrapped, with their code spans.
|
|
7669
7693
|
*/
|
|
7670
7694
|
function bodySource(block, part) {
|
|
7671
|
-
if (block.blockKind === "tool" && part.kind === "call" && block.title !== "" && part.rows[0] === block.title) return
|
|
7672
|
-
|
|
7673
|
-
|
|
7695
|
+
if (block.blockKind === "tool" && part.kind === "call" && block.title !== "" && part.rows[0] === block.title) return {
|
|
7696
|
+
rows: part.rows.slice(1),
|
|
7697
|
+
code: part.code?.slice(1)
|
|
7698
|
+
};
|
|
7699
|
+
return {
|
|
7700
|
+
rows: part.rows,
|
|
7701
|
+
code: part.code
|
|
7702
|
+
};
|
|
7703
|
+
}
|
|
7704
|
+
/**
|
|
7705
|
+
* A reply drawn as the conversation draws it: Markdown, with fenced code in
|
|
7706
|
+
* syntax colour, except that an unordered list item is marked `•`. The rows
|
|
7707
|
+
* depend on the text and the width alone, since every theme role keeps the
|
|
7708
|
+
* text it is given.
|
|
7709
|
+
* @param rows - the reply's source rows.
|
|
7710
|
+
* @param width - the columns the reply lays out in.
|
|
7711
|
+
* @param look - the palette and the highlighter.
|
|
7712
|
+
* @returns the rows, trailing padding removed.
|
|
7713
|
+
*/
|
|
7714
|
+
function replyRows(rows, width, look) {
|
|
7715
|
+
const text = rows.join("\n");
|
|
7716
|
+
const key = look.palette === MEASURING ? `${String(width)}\n${text}` : void 0;
|
|
7717
|
+
const known = key === void 0 ? void 0 : measuredReplies.get(key);
|
|
7718
|
+
if (known !== void 0) return known;
|
|
7719
|
+
const theme = markdownTheme(look.palette, look.highlight);
|
|
7720
|
+
const listBullet = theme.listBullet;
|
|
7721
|
+
theme.listBullet = (marker) => listBullet(marker === MARKDOWN_BULLET ? BULLET : marker);
|
|
7722
|
+
const lines = new Markdown(text, 0, 0, theme).render(width).map((line) => line.trimEnd());
|
|
7723
|
+
if (key !== void 0) {
|
|
7724
|
+
if (measuredReplies.size >= MEASURED_REPLIES) measuredReplies.clear();
|
|
7725
|
+
measuredReplies.set(key, lines);
|
|
7726
|
+
}
|
|
7727
|
+
return lines;
|
|
7674
7728
|
}
|
|
7675
7729
|
/**
|
|
7676
7730
|
* Fit one styled text to an exact number of columns.
|
|
@@ -7726,6 +7780,7 @@ function bodyRow(line, tone, indent, width, look) {
|
|
|
7726
7780
|
switch (tone) {
|
|
7727
7781
|
case "plain": return `${indent}${line}`;
|
|
7728
7782
|
case "dim": return `${indent}${palette.dim(line)}`;
|
|
7783
|
+
case "thought": return `${indent}${palette.dim(palette.italic(line))}`;
|
|
7729
7784
|
case "added":
|
|
7730
7785
|
case "removed": {
|
|
7731
7786
|
const paint = tone === "added" ? palette.success : palette.error;
|
|
@@ -7748,7 +7803,7 @@ function bodyRow(line, tone, indent, width, look) {
|
|
|
7748
7803
|
* @param cursor - the section.
|
|
7749
7804
|
* @param blocks - the navigable blocks.
|
|
7750
7805
|
* @param width - the panel's columns, the gutter included.
|
|
7751
|
-
* @param look - the palette, the bands, and whether the reader holds the section.
|
|
7806
|
+
* @param look - the palette, the bands, the highlighter, and whether the reader holds the section.
|
|
7752
7807
|
* @returns the rows, or none for a section the transcript no longer carries.
|
|
7753
7808
|
*/
|
|
7754
7809
|
function sectionRows(cursor, blocks, width, look) {
|
|
@@ -7761,10 +7816,15 @@ function sectionRows(cursor, blocks, width, look) {
|
|
|
7761
7816
|
else {
|
|
7762
7817
|
const indent = part.kind === "result" ? `${RESULT_INDENT}${BODY_INDENT}` : BODY_INDENT;
|
|
7763
7818
|
const room = Math.max(1, content - visibleWidth(indent));
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7819
|
+
const header = headerRow(block, part, content, look);
|
|
7820
|
+
if (block.blockKind === "assistant" && part.kind === "reply") rows = [header, ...replyRows(part.rows, room, look).map((line) => `${indent}${line}`)];
|
|
7821
|
+
else {
|
|
7822
|
+
const source = bodySource(block, part);
|
|
7823
|
+
rows = [header, ...paintCodeRows(source.rows, source.code, look.highlight).flatMap((row, index) => {
|
|
7824
|
+
const tone = rowTone(block, part, source.rows[index]);
|
|
7825
|
+
return wrapTextWithAnsi(row, room).map((line) => bodyRow(line, tone, indent, content, look));
|
|
7826
|
+
})];
|
|
7827
|
+
}
|
|
7768
7828
|
}
|
|
7769
7829
|
const gutter = look.held ? look.palette.accent(HELD_GUTTER) : GUTTER;
|
|
7770
7830
|
return rows.map((row) => `${gutter}${row}`);
|
|
@@ -7784,13 +7844,12 @@ function turnLayout(group, blocks, width, look) {
|
|
|
7784
7844
|
const rows = sectionRows(section, blocks, width, {
|
|
7785
7845
|
palette: look.palette,
|
|
7786
7846
|
tints: look.tints,
|
|
7847
|
+
highlight: look.highlight,
|
|
7787
7848
|
held
|
|
7788
7849
|
});
|
|
7789
7850
|
return index === last || rows.length === 0 ? rows : [...rows, ""];
|
|
7790
7851
|
});
|
|
7791
7852
|
}
|
|
7792
|
-
/** An unstyled palette, which is all measuring needs: styling never changes a row count. */
|
|
7793
|
-
const MEASURING = createPalette(false);
|
|
7794
7853
|
/**
|
|
7795
7854
|
* Measure the turn panel, which is what the scroll keys move over.
|
|
7796
7855
|
* @param group - the turn the panel shows.
|
|
@@ -7835,17 +7894,17 @@ function readerGeometry(width, rows, state, minColumns) {
|
|
|
7835
7894
|
if (width < minColumns) return state.column === "pane" ? {
|
|
7836
7895
|
...base,
|
|
7837
7896
|
list: 0,
|
|
7838
|
-
pane: width - COLUMN_MARGIN
|
|
7897
|
+
pane: width - COLUMN_MARGIN - CLOSE_MARGIN
|
|
7839
7898
|
} : {
|
|
7840
7899
|
...base,
|
|
7841
|
-
list: width - COLUMN_MARGIN,
|
|
7900
|
+
list: width - COLUMN_MARGIN - CLOSE_MARGIN,
|
|
7842
7901
|
pane: 0
|
|
7843
7902
|
};
|
|
7844
7903
|
const list = clamp(Math.floor(width * LIST_SHARE), LIST_MIN_WIDTH, LIST_MAX_WIDTH);
|
|
7845
7904
|
return {
|
|
7846
7905
|
...base,
|
|
7847
7906
|
list,
|
|
7848
|
-
pane: width - list - 2 * COLUMN_MARGIN
|
|
7907
|
+
pane: width - list - 2 * COLUMN_MARGIN - CLOSE_MARGIN
|
|
7849
7908
|
};
|
|
7850
7909
|
}
|
|
7851
7910
|
/**
|
|
@@ -8210,10 +8269,11 @@ function listColumn(rows, blocks, look, body) {
|
|
|
8210
8269
|
* @returns the rows, before the scroll window is applied.
|
|
8211
8270
|
*/
|
|
8212
8271
|
function paneColumn(group, blocks, cursor, render, width) {
|
|
8213
|
-
const { palette, tints, reveal } = render;
|
|
8272
|
+
const { palette, tints, reveal, highlight } = render;
|
|
8214
8273
|
return turnLayout(group, blocks, width, {
|
|
8215
8274
|
palette,
|
|
8216
8275
|
tints,
|
|
8276
|
+
highlight,
|
|
8217
8277
|
cursor
|
|
8218
8278
|
}).flatMap((rows, index) => {
|
|
8219
8279
|
const section = group.sections[index];
|
|
@@ -8229,12 +8289,8 @@ function paneColumn(group, blocks, cursor, render, width) {
|
|
|
8229
8289
|
* @returns the row, no wider than `width`.
|
|
8230
8290
|
*/
|
|
8231
8291
|
function frameRow(columns, row, palette, width) {
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
const text = column.rows[row] ?? "";
|
|
8235
|
-
line += index === columns.length - 1 ? truncateToWidth(text, Math.max(1, column.width), ELLIPSIS$1) : `${cell(text, column.width)}${palette.dim(SIDE)} `;
|
|
8236
|
-
}
|
|
8237
|
-
return truncateToWidth(line, Math.max(1, width), ELLIPSIS$1);
|
|
8292
|
+
const inner = columns.map((column) => cell(column.rows[row] ?? "", column.width)).join(`${palette.dim(SIDE)} `);
|
|
8293
|
+
return truncateToWidth(`${palette.accent(SIDE)} ${inner} ${palette.accent(SIDE)}`, Math.max(1, width), ELLIPSIS$1);
|
|
8238
8294
|
}
|
|
8239
8295
|
/**
|
|
8240
8296
|
* What the legend rule says on its left: the query line while one is open, or
|
|
@@ -8498,7 +8554,8 @@ var ReaderPane = class {
|
|
|
8498
8554
|
minColumns: this.options.minColumns,
|
|
8499
8555
|
totalTurns: groups.length,
|
|
8500
8556
|
tints: effects === void 0 ? void 0 : readerTints(effects.style(), effects.background()),
|
|
8501
|
-
reveal: this.revealNow()
|
|
8557
|
+
reveal: this.revealNow(),
|
|
8558
|
+
highlight: this.options.highlight
|
|
8502
8559
|
});
|
|
8503
8560
|
}
|
|
8504
8561
|
/**
|
|
@@ -11345,6 +11402,7 @@ var TuiApp = class {
|
|
|
11345
11402
|
rows: () => Math.max(1, this.deps.terminal.rows),
|
|
11346
11403
|
minColumns: this.deps.readerMinColumns,
|
|
11347
11404
|
cursor,
|
|
11405
|
+
highlight: this.codeHighlight,
|
|
11348
11406
|
effects: {
|
|
11349
11407
|
style: () => this.fadeStyle,
|
|
11350
11408
|
background: () => this.background,
|