@crazyhappyone/dsh-tui 0.1.0-alpha.13 → 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.
Files changed (2) hide show
  1. package/dist/index.js +91 -26
  2. 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" });
@@ -71655,14 +71688,17 @@ function transcriptOverlay(tier, synchronizedFrameEnded) {
71655
71688
  }
71656
71689
  return cells === "" ? "" : `\x1B7${cells}\x1B8`;
71657
71690
  }
71691
+ const railCol = next.geometry.rail?.col ?? next.geometry.columns;
71692
+ const guardCol = railCol > 1 ? railCol - 1 : railCol;
71658
71693
  for (const change of diff2.changes) {
71659
71694
  const nextWidth = change.line === void 0 ? 0 : change.line.backgroundColumns ?? change.line.displayWidth;
71660
- const staleColumns = change.clearColumns - nextWidth;
71695
+ const targetColumns = Math.max(change.clearColumns, guardCol - change.col);
71696
+ const padColumns = targetColumns - nextWidth;
71661
71697
  if (change.line !== void 0) {
71662
71698
  cells += `\x1B[${String(change.row)};${String(change.col)}H` + paintPhysicalLine(change.line, tier);
71663
71699
  }
71664
- if (staleColumns > 0) {
71665
- cells += `\x1B[${String(change.row)};${String(change.col + nextWidth)}H` + styled(" ".repeat(staleColumns), "bg", tier);
71700
+ if (padColumns > 0) {
71701
+ cells += `\x1B[${String(change.row)};${String(change.col + nextWidth)}H` + styled(" ".repeat(padColumns), "bg", tier);
71666
71702
  }
71667
71703
  }
71668
71704
  return cells === "" ? "" : `\x1B7${cells}\x1B8`;
@@ -73089,9 +73125,11 @@ function projectToolSummaryEntry(entry, scope) {
73089
73125
  }
73090
73126
  function projectActivePlaceholderEntry(entry) {
73091
73127
  const text4 = entry.meta?.activePlaceholder ?? "\u25CF \u6B63\u5728\u601D\u8003\u2026";
73092
- const segments = text4.startsWith("\u25CF ") ? [
73128
+ const dotIndex = text4.indexOf("\u25CF ");
73129
+ const segments = dotIndex >= 0 ? [
73130
+ ...dotIndex > 0 ? [{ text: text4.slice(0, dotIndex), token: "accentText", bold: true }] : [],
73093
73131
  { text: "\u25CF ", token: "accentText", bold: true },
73094
- { text: text4.slice(2), token: "fg", bold: false }
73132
+ { text: text4.slice(dotIndex + 2), token: "fg", bold: false }
73095
73133
  ] : [
73096
73134
  { text: text4, token: "fg", bold: false }
73097
73135
  ];
@@ -74800,13 +74838,15 @@ function StreamView({
74800
74838
  const rawParts = partsFromTurn(activeTurn);
74801
74839
  const visibleParts = displayedParts(rawParts, reasoningExpanded);
74802
74840
  if (status === "generating" && visibleParts.length === 0) {
74841
+ const liveMs = liveDurationMs ?? activeTurn.reasoningDurationMs;
74842
+ const fish = getSwimmingFishFrame(liveMs);
74803
74843
  map2.set(id, project(id, {
74804
74844
  id,
74805
74845
  kind: "active-placeholder",
74806
74846
  source: "",
74807
74847
  meta: {
74808
- activePlaceholder: `\u25CF \u6B63\u5728\u5904\u7406\u2026 (${formatSeconds(
74809
- liveDurationMs ?? activeTurn.reasoningDurationMs
74848
+ activePlaceholder: `${fish} \u25CF \u6B63\u5728\u5904\u7406\u2026 (${formatSeconds(
74849
+ liveMs
74810
74850
  )}s)`
74811
74851
  }
74812
74852
  }, blockRowsScope, void 0, true).lines);
@@ -75588,15 +75628,22 @@ function StreamView({
75588
75628
  const rawParts = partsFromTurn(turn);
75589
75629
  const visibleParts = displayedParts(rawParts, reasoningExpanded);
75590
75630
  if (generating && visibleParts.length === 0) {
75591
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { flexDirection: "column", width: "100%", flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { children: paintRow([
75592
- styled("\u25CF ", "accentText", void 0, true),
75593
- styled(
75594
- `\u6B63\u5728\u5904\u7406\u2026 (${formatSeconds(
75595
- liveDurationMs ?? turn.reasoningDurationMs
75596
- )}s)`,
75597
- "fg"
75598
- )
75599
- ]) }) });
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
+ ] });
75600
75647
  }
75601
75648
  const parts = displayedParts(compactToolParts(rawParts, toolCardsExpanded, presenters, mode, presenterCache), reasoningExpanded);
75602
75649
  let lastVisiblePart = -1;
@@ -75994,7 +76041,6 @@ function HelpPane({ lines, offset }) {
75994
76041
 
75995
76042
  // ../deepseek-harness/packages/tui/tui-render/src/approval-pane.tsx
75996
76043
  var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
75997
- var PROMPT_OPTIONS = "[Y] \u5141\u8BB8 \xB7 [n] \u62D2\u7EDD \xB7 [a] \u672C\u4F1A\u8BDD\u603B\u662F";
75998
76044
  var DELIVERY_NEXT = "\u5F53\u524D\u5DE5\u5177\u672A\u6267\u884C \xB7 \u53EF\u91CD\u8BD5\u8BE5\u8F6E";
75999
76045
  var EMPTY_APPROVAL_PANE = {
76000
76046
  open: false,
@@ -76034,11 +76080,30 @@ function ApprovalPane({
76034
76080
  line(DELIVERY_NEXT, "fgDim")
76035
76081
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
76036
76082
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { children: paintRow([
76037
- styled(`\u5141\u8BB8\u6267\u884C ${target} \u5417\uFF1F `, "fg", void 0, true),
76038
- styled(PROMPT_OPTIONS, "fgDim"),
76039
- ...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)
76040
76084
  ]) }),
76041
- detailsOpen ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
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: [
76042
76107
  reason !== "" ? line(reason, "fg") : null,
76043
76108
  extra2 !== void 0 ? line(extra2, "fg") : null
76044
76109
  ] }) : null
@@ -76441,15 +76506,15 @@ function AskUserPane({
76441
76506
  const footnote = FOOTNOTE5;
76442
76507
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
76443
76508
  header !== "" ? line7(header, "fg", true) : null,
76444
- 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) => {
76445
76510
  const selected = index2 === selectedIndex;
76446
76511
  const numbered = `${index2 + 1} ${label}`;
76447
76512
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { width: "100%", children: [
76448
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { children: selected ? styled(escapeContent("\u203A "), "accent", void 0, true) : " " }),
76449
- /* @__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)]) })
76450
76515
  ] }, `${index2}:${label}`);
76451
- }),
76452
- line7(footnote, "fgDim")
76516
+ }) }),
76517
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { marginTop: 1, width: "100%", children: line7(footnote, "fgDim") })
76453
76518
  ] });
76454
76519
  }
76455
76520
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crazyhappyone/dsh-tui",
3
- "version": "0.1.0-alpha.13",
3
+ "version": "0.1.0-alpha.15",
4
4
  "description": "Source-runtime launcher for the DeepSeek Harness terminal interface",
5
5
  "type": "module",
6
6
  "license": "MIT",