@crazyhappyone/dsh-tui 0.1.0-alpha.14 → 0.1.0-alpha.15
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/dist/index.js +85 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -70202,6 +70202,39 @@ var dictionaries = { "zh-CN": zh, "en-US": en };
|
|
|
70202
70202
|
function tuiCopy(key, locale = "zh-CN") {
|
|
70203
70203
|
return dictionaries[locale][key];
|
|
70204
70204
|
}
|
|
70205
|
+
var SWIMMING_FISH_FRAMES = [
|
|
70206
|
+
">o ",
|
|
70207
|
+
" >o ",
|
|
70208
|
+
" >o ",
|
|
70209
|
+
" >o",
|
|
70210
|
+
" >",
|
|
70211
|
+
" ",
|
|
70212
|
+
" \xB7 ",
|
|
70213
|
+
"o "
|
|
70214
|
+
];
|
|
70215
|
+
function getSwimmingFishFrame(liveMs) {
|
|
70216
|
+
const index2 = Math.floor(Math.max(0, liveMs ?? 0) / 150) % SWIMMING_FISH_FRAMES.length;
|
|
70217
|
+
return SWIMMING_FISH_FRAMES[index2] ?? SWIMMING_FISH_FRAMES[0];
|
|
70218
|
+
}
|
|
70219
|
+
var GENERATION_TIPS_ZH = [
|
|
70220
|
+
"\u63D0\u793A\uFF1ACtrl+E \u5C55\u5F00\u5DE5\u5177\u5361 \xB7 /tools \u67E5\u770B\u5B8C\u6574\u8F93\u51FA",
|
|
70221
|
+
"\u63D0\u793A\uFF1ACtrl+O \u5C55\u5F00/\u6536\u8D77\u601D\u8003\u8FC7\u7A0B \xB7 \u968F\u65F6\u8DDF\u8FDB\u63A8\u7406",
|
|
70222
|
+
"\u63D0\u793A\uFF1AShift+Tab \u5207\u6362\u591A\u884C\u8F93\u5165 \xB7 \u2191/\u2193 \u6D4F\u89C8\u5386\u53F2\u6D88\u606F",
|
|
70223
|
+
"\u63D0\u793A\uFF1A\u8F93\u5165 / \u6253\u5F00\u5FEB\u6377\u547D\u4EE4 \xB7 \u8F93\u5165 @ \u63D0\u53CA\u6587\u4EF6\u4E0E\u4E0A\u4E0B\u6587",
|
|
70224
|
+
"\u63D0\u793A\uFF1ACtrl+C \u4E2D\u65AD\u5F53\u524D\u751F\u6210 \xB7 \u968F\u65F6\u5B89\u5168\u505C\u6B62"
|
|
70225
|
+
];
|
|
70226
|
+
var GENERATION_TIPS_EN = [
|
|
70227
|
+
"Tip: Ctrl+E to expand tool cards \xB7 /tools for full output",
|
|
70228
|
+
"Tip: Ctrl+O to toggle thinking process \xB7 follow reasoning",
|
|
70229
|
+
"Tip: Shift+Tab for multiline input \xB7 \u2191/\u2193 browse history",
|
|
70230
|
+
"Tip: Type / for slash commands \xB7 type @ to mention context",
|
|
70231
|
+
"Tip: Ctrl+C to stop generation safely at any time"
|
|
70232
|
+
];
|
|
70233
|
+
function getBilingualTip(liveMs, locale = "zh-CN") {
|
|
70234
|
+
const tips = locale === "en-US" ? GENERATION_TIPS_EN : GENERATION_TIPS_ZH;
|
|
70235
|
+
const index2 = Math.floor(Math.max(0, liveMs ?? 0) / 4e3) % tips.length;
|
|
70236
|
+
return tips[index2] ?? tips[0];
|
|
70237
|
+
}
|
|
70205
70238
|
|
|
70206
70239
|
// ../deepseek-harness/packages/tui/tui-render/src/tool-body.ts
|
|
70207
70240
|
var graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
@@ -73092,9 +73125,11 @@ function projectToolSummaryEntry(entry, scope) {
|
|
|
73092
73125
|
}
|
|
73093
73126
|
function projectActivePlaceholderEntry(entry) {
|
|
73094
73127
|
const text4 = entry.meta?.activePlaceholder ?? "\u25CF \u6B63\u5728\u601D\u8003\u2026";
|
|
73095
|
-
const
|
|
73128
|
+
const dotIndex = text4.indexOf("\u25CF ");
|
|
73129
|
+
const segments = dotIndex >= 0 ? [
|
|
73130
|
+
...dotIndex > 0 ? [{ text: text4.slice(0, dotIndex), token: "accentText", bold: true }] : [],
|
|
73096
73131
|
{ text: "\u25CF ", token: "accentText", bold: true },
|
|
73097
|
-
{ text: text4.slice(2), token: "fg", bold: false }
|
|
73132
|
+
{ text: text4.slice(dotIndex + 2), token: "fg", bold: false }
|
|
73098
73133
|
] : [
|
|
73099
73134
|
{ text: text4, token: "fg", bold: false }
|
|
73100
73135
|
];
|
|
@@ -74803,13 +74838,15 @@ function StreamView({
|
|
|
74803
74838
|
const rawParts = partsFromTurn(activeTurn);
|
|
74804
74839
|
const visibleParts = displayedParts(rawParts, reasoningExpanded);
|
|
74805
74840
|
if (status === "generating" && visibleParts.length === 0) {
|
|
74841
|
+
const liveMs = liveDurationMs ?? activeTurn.reasoningDurationMs;
|
|
74842
|
+
const fish = getSwimmingFishFrame(liveMs);
|
|
74806
74843
|
map2.set(id, project(id, {
|
|
74807
74844
|
id,
|
|
74808
74845
|
kind: "active-placeholder",
|
|
74809
74846
|
source: "",
|
|
74810
74847
|
meta: {
|
|
74811
|
-
activePlaceholder:
|
|
74812
|
-
|
|
74848
|
+
activePlaceholder: `${fish} \u25CF \u6B63\u5728\u5904\u7406\u2026 (${formatSeconds(
|
|
74849
|
+
liveMs
|
|
74813
74850
|
)}s)`
|
|
74814
74851
|
}
|
|
74815
74852
|
}, blockRowsScope, void 0, true).lines);
|
|
@@ -75591,15 +75628,22 @@ function StreamView({
|
|
|
75591
75628
|
const rawParts = partsFromTurn(turn);
|
|
75592
75629
|
const visibleParts = displayedParts(rawParts, reasoningExpanded);
|
|
75593
75630
|
if (generating && visibleParts.length === 0) {
|
|
75594
|
-
|
|
75595
|
-
|
|
75596
|
-
|
|
75597
|
-
|
|
75598
|
-
|
|
75599
|
-
)
|
|
75600
|
-
"
|
|
75601
|
-
|
|
75602
|
-
|
|
75631
|
+
const liveMs = liveDurationMs ?? turn.reasoningDurationMs;
|
|
75632
|
+
const fish = getSwimmingFishFrame(liveMs);
|
|
75633
|
+
const tip = getBilingualTip(liveMs, locale);
|
|
75634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", width: "100%", flexShrink: 0, children: [
|
|
75635
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { children: paintRow([
|
|
75636
|
+
styled(fish, "accentText", void 0, true),
|
|
75637
|
+
styled(" \u25CF ", "accentText", void 0, true),
|
|
75638
|
+
styled(
|
|
75639
|
+
`\u6B63\u5728\u5904\u7406\u2026 (${formatSeconds(liveMs)}s)`,
|
|
75640
|
+
"fg"
|
|
75641
|
+
)
|
|
75642
|
+
]) }),
|
|
75643
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { children: paintRow([
|
|
75644
|
+
styled(` \u2514 ${tip}`, "fgDim")
|
|
75645
|
+
]) })
|
|
75646
|
+
] });
|
|
75603
75647
|
}
|
|
75604
75648
|
const parts = displayedParts(compactToolParts(rawParts, toolCardsExpanded, presenters, mode, presenterCache), reasoningExpanded);
|
|
75605
75649
|
let lastVisiblePart = -1;
|
|
@@ -75997,7 +76041,6 @@ function HelpPane({ lines, offset }) {
|
|
|
75997
76041
|
|
|
75998
76042
|
// ../deepseek-harness/packages/tui/tui-render/src/approval-pane.tsx
|
|
75999
76043
|
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
|
|
76000
|
-
var PROMPT_OPTIONS = "[Y] \u5141\u8BB8 \xB7 [n] \u62D2\u7EDD \xB7 [a] \u672C\u4F1A\u8BDD\u603B\u662F";
|
|
76001
76044
|
var DELIVERY_NEXT = "\u5F53\u524D\u5DE5\u5177\u672A\u6267\u884C \xB7 \u53EF\u91CD\u8BD5\u8BE5\u8F6E";
|
|
76002
76045
|
var EMPTY_APPROVAL_PANE = {
|
|
76003
76046
|
open: false,
|
|
@@ -76037,11 +76080,30 @@ function ApprovalPane({
|
|
|
76037
76080
|
line(DELIVERY_NEXT, "fgDim")
|
|
76038
76081
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
|
|
76039
76082
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { children: paintRow([
|
|
76040
|
-
styled(`\u5141\u8BB8\u6267\u884C ${target} \u5417\uFF1F
|
|
76041
|
-
styled(PROMPT_OPTIONS, "fgDim"),
|
|
76042
|
-
...detailsOpen ? [styled(" \xB7 [i] \u6536\u8D77", "fgDim")] : [styled(" \xB7 [i] \u8BE6\u60C5", "fgDim")]
|
|
76083
|
+
styled(`\u5141\u8BB8\u6267\u884C ${target} \u5417\uFF1F`, "fg", void 0, true)
|
|
76043
76084
|
]) }),
|
|
76044
|
-
|
|
76085
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, width: "100%", children: [
|
|
76086
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { children: paintRow([
|
|
76087
|
+
styled(" [Y] ", "success", void 0, true),
|
|
76088
|
+
styled("\u5141\u8BB8", "fg", void 0, true),
|
|
76089
|
+
styled(" (\u6267\u884C\u4E00\u6B21)", "fgDim")
|
|
76090
|
+
]) }),
|
|
76091
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { children: paintRow([
|
|
76092
|
+
styled(" [n] ", "error", void 0, true),
|
|
76093
|
+
styled("\u62D2\u7EDD", "fg", void 0, true),
|
|
76094
|
+
styled(" (\u53D6\u6D88\u6267\u884C)", "fgDim")
|
|
76095
|
+
]) }),
|
|
76096
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { children: paintRow([
|
|
76097
|
+
styled(" [a] ", "warning", void 0, true),
|
|
76098
|
+
styled("\u672C\u4F1A\u8BDD\u603B\u662F", "fg", void 0, true),
|
|
76099
|
+
styled(" (\u4E0D\u518D\u8BE2\u95EE)", "fgDim")
|
|
76100
|
+
]) }),
|
|
76101
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { children: paintRow([
|
|
76102
|
+
styled(" [i] ", "accent", void 0, true),
|
|
76103
|
+
styled(detailsOpen ? "\u6536\u8D77\u8BE6\u60C5" : "\u8BE6\u60C5 (\u67E5\u770B\u5B8C\u6574\u53C2\u6570)", "fgDim")
|
|
76104
|
+
]) })
|
|
76105
|
+
] }),
|
|
76106
|
+
detailsOpen ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, width: "100%", children: [
|
|
76045
76107
|
reason !== "" ? line(reason, "fg") : null,
|
|
76046
76108
|
extra2 !== void 0 ? line(extra2, "fg") : null
|
|
76047
76109
|
] }) : null
|
|
@@ -76444,15 +76506,15 @@ function AskUserPane({
|
|
|
76444
76506
|
const footnote = FOOTNOTE5;
|
|
76445
76507
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
|
|
76446
76508
|
header !== "" ? line7(header, "fg", true) : null,
|
|
76447
|
-
options.map((label, index2) => {
|
|
76509
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { flexDirection: "column", marginTop: header !== "" ? 1 : 0, width: "100%", children: options.map((label, index2) => {
|
|
76448
76510
|
const selected = index2 === selectedIndex;
|
|
76449
76511
|
const numbered = `${index2 + 1} ${label}`;
|
|
76450
76512
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { width: "100%", children: [
|
|
76451
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { children: selected ? styled(
|
|
76452
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { children: paintRow([styled(escapeContent(numbered), selected ? "fg" : "fgDim")]) })
|
|
76513
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { children: selected ? paintRow([styled("\u203A ", "accent", void 0, true)]) : " " }),
|
|
76514
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { children: paintRow([styled(escapeContent(numbered), selected ? "fg" : "fgDim", void 0, selected)]) })
|
|
76453
76515
|
] }, `${index2}:${label}`);
|
|
76454
|
-
}),
|
|
76455
|
-
line7(footnote, "fgDim")
|
|
76516
|
+
}) }),
|
|
76517
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { marginTop: 1, width: "100%", children: line7(footnote, "fgDim") })
|
|
76456
76518
|
] });
|
|
76457
76519
|
}
|
|
76458
76520
|
|