@deepseek-harness-tui/dsh-tui 0.20.1 → 0.20.2

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 (116) hide show
  1. package/README.md +14 -3
  2. package/guide/dsh-tui-guide/configuration.en.md +26 -12
  3. package/guide/dsh-tui-guide/configuration.md +18 -9
  4. package/guide/dsh-tui-guide/getting-started.en.md +17 -9
  5. package/guide/dsh-tui-guide/getting-started.md +11 -7
  6. package/guide/dsh-tui-guide/interaction.en.md +1 -0
  7. package/guide/dsh-tui-guide/interaction.md +1 -0
  8. package/guide/dsh-tui-guide/themes.en.md +1 -1
  9. package/guide/dsh-tui-guide/themes.md +1 -1
  10. package/guide/dsh-tui-guide/user-guide.en.md +8 -2
  11. package/guide/dsh-tui-guide/user-guide.md +8 -2
  12. package/lib/settings.json +19 -3
  13. package/lib/types/adapter/ports/channel-settings.d.ts +6 -0
  14. package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
  15. package/lib/types/adapter/ports/channel-view.d.ts +28 -2
  16. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  17. package/lib/types/backends/claude/session/lifecycle.d.ts.map +1 -1
  18. package/lib/types/backends/claude/session/lifecycle.js +11 -9
  19. package/lib/types/backends/claude/side-query.d.ts +2 -0
  20. package/lib/types/backends/claude/side-query.d.ts.map +1 -1
  21. package/lib/types/backends/claude/side-query.js +30 -13
  22. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +1 -1
  23. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  24. package/lib/types/components/messages/AssistantToolUseMessage.js +228 -27
  25. package/lib/types/components/messages/presentCardBackground.d.ts +28 -0
  26. package/lib/types/components/messages/presentCardBackground.d.ts.map +1 -0
  27. package/lib/types/components/messages/presentCardBackground.js +23 -0
  28. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  29. package/lib/types/dsh-adapter/backend/translate.js +28 -1
  30. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  31. package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
  32. package/lib/types/dsh-adapter/channel/file-actions.d.ts +1 -1
  33. package/lib/types/dsh-adapter/channel/file-actions.d.ts.map +1 -1
  34. package/lib/types/dsh-adapter/channel/file-actions.js +11 -4
  35. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  36. package/lib/types/dsh-adapter/channel/settings-host.js +78 -12
  37. package/lib/types/dsh-adapter/channel/state.d.ts +4 -3
  38. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
  39. package/lib/types/dsh-adapter/channel/state.js +4 -3
  40. package/lib/types/dsh-adapter/channel/types.d.ts +1 -1
  41. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  42. package/lib/types/dsh-adapter/channel.d.ts +1 -1
  43. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  44. package/lib/types/dsh-adapter/contract.d.ts +18 -7
  45. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  46. package/lib/types/dsh-adapter/contract.js +20 -7
  47. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  48. package/lib/types/dsh-adapter/host-contract.js +1 -1
  49. package/lib/types/dsh-adapter/host-entry.js +4 -2
  50. package/lib/types/dsh-adapter/host-service-diagnostics.d.ts +61 -0
  51. package/lib/types/dsh-adapter/host-service-diagnostics.d.ts.map +1 -0
  52. package/lib/types/dsh-adapter/host-service-diagnostics.js +103 -0
  53. package/lib/types/dsh-adapter/index.d.ts +5 -0
  54. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  55. package/lib/types/dsh-adapter/index.js +1 -0
  56. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  57. package/lib/types/dsh-adapter/plugin.js +39 -2
  58. package/lib/types/dsh-adapter/present-tool.d.ts +20 -0
  59. package/lib/types/dsh-adapter/present-tool.d.ts.map +1 -0
  60. package/lib/types/dsh-adapter/present-tool.js +96 -0
  61. package/lib/types/i18n.d.ts +15 -0
  62. package/lib/types/i18n.d.ts.map +1 -1
  63. package/lib/types/i18n.js +6 -0
  64. package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
  65. package/lib/types/ink/components/ScrollBox.js +13 -0
  66. package/lib/types/ink/dom.d.ts +3 -0
  67. package/lib/types/ink/dom.d.ts.map +1 -1
  68. package/lib/types/ink/ink.d.ts.map +1 -1
  69. package/lib/types/ink/ink.js +30 -34
  70. package/lib/types/ink/render-node-to-output.d.ts +3 -0
  71. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  72. package/lib/types/ink/render-node-to-output.js +54 -40
  73. package/lib/types/ink/selection.d.ts +38 -28
  74. package/lib/types/ink/selection.d.ts.map +1 -1
  75. package/lib/types/ink/selection.js +201 -130
  76. package/lib/types/kernelPrefs.d.ts +5 -2
  77. package/lib/types/kernelPrefs.d.ts.map +1 -1
  78. package/lib/types/kernelPrefs.js +5 -2
  79. package/lib/types/settings/definitions.d.ts +12 -0
  80. package/lib/types/settings/definitions.d.ts.map +1 -1
  81. package/lib/types/settings/definitions.js +10 -2
  82. package/lib/types/theme.d.ts +4 -0
  83. package/lib/types/theme.d.ts.map +1 -1
  84. package/lib/types/theme.js +20 -2
  85. package/lib/types/tuiDisplayPrefs.d.ts +3 -0
  86. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
  87. package/lib/types/tuiDisplayPrefs.js +10 -0
  88. package/lib/types/update.d.ts +74 -5
  89. package/lib/types/update.d.ts.map +1 -1
  90. package/lib/types/update.js +297 -46
  91. package/lib/types/updateHost.d.ts.map +1 -1
  92. package/lib/types/updateHost.js +16 -5
  93. package/lib/types/usageStats.d.ts +6 -0
  94. package/lib/types/usageStats.d.ts.map +1 -1
  95. package/lib/types/usageStats.js +8 -0
  96. package/lib/types/utils/colorMix.d.ts +19 -0
  97. package/lib/types/utils/colorMix.d.ts.map +1 -0
  98. package/lib/types/utils/colorMix.js +51 -0
  99. package/lib/types/utils/commandLine.d.ts +8 -0
  100. package/lib/types/utils/commandLine.d.ts.map +1 -0
  101. package/lib/types/utils/commandLine.js +37 -0
  102. package/lib/types/utils/desktopEntry.d.ts +32 -0
  103. package/lib/types/utils/desktopEntry.d.ts.map +1 -0
  104. package/lib/types/utils/desktopEntry.js +302 -0
  105. package/lib/types/utils/externalEditor.d.ts +2 -5
  106. package/lib/types/utils/externalEditor.d.ts.map +1 -1
  107. package/lib/types/utils/externalEditor.js +4 -36
  108. package/lib/types/utils/openExternal.d.ts +9 -0
  109. package/lib/types/utils/openExternal.d.ts.map +1 -1
  110. package/lib/types/utils/openExternal.js +87 -3
  111. package/lib/types/utils/terminalLaunch.d.ts +16 -0
  112. package/lib/types/utils/terminalLaunch.d.ts.map +1 -0
  113. package/lib/types/utils/terminalLaunch.js +121 -0
  114. package/package.json +112 -111
  115. package/tui-profile/feed/README.md +1 -1
  116. package/tui-profile/feed/first-party.json +1 -1
@@ -95,6 +95,9 @@ export function startSelection(s, col, row, screen) {
95
95
  s.scrolledOffBelow = [];
96
96
  s.virtualAnchorRow = undefined;
97
97
  s.virtualFocusRow = undefined;
98
+ s.virtualAnchorCol = undefined;
99
+ s.virtualFocusCol = undefined;
100
+ s.offScreen = undefined;
98
101
  s.dragBounds = undefined;
99
102
  s.lastPressHadAlt = false;
100
103
  s.coveredFingerprint = null;
@@ -126,6 +129,8 @@ export function updateSelection(s, col, row) {
126
129
  // the same reset moveFocus does. Without this, the next shift computes
127
130
  // rawFocus from a stale pre-motion row.
128
131
  s.virtualFocusRow = undefined;
132
+ s.virtualFocusCol = undefined;
133
+ s.offScreen = undefined;
129
134
  }
130
135
  /**
131
136
  * End a drag: clear the dragging flag while keeping anchor/focus so the
@@ -167,6 +172,9 @@ export function clearSelection(s) {
167
172
  s.scrolledOffBelow = [];
168
173
  s.virtualAnchorRow = undefined;
169
174
  s.virtualFocusRow = undefined;
175
+ s.virtualAnchorCol = undefined;
176
+ s.virtualFocusCol = undefined;
177
+ s.offScreen = undefined;
170
178
  s.dragBounds = undefined;
171
179
  s.lastPressHadAlt = false;
172
180
  s.coveredFingerprint = null;
@@ -448,6 +456,8 @@ export function extendSelection(s, screen, col, row) {
448
456
  return;
449
457
  const span = s.anchorSpan;
450
458
  s.virtualFocusRow = undefined;
459
+ s.virtualFocusCol = undefined;
460
+ s.offScreen = undefined;
451
461
  let mLo;
452
462
  let mHi;
453
463
  if (span.kind === 'word') {
@@ -497,95 +507,121 @@ export function moveFocus(s, col, row) {
497
507
  // shiftSelection clamp) no longer reflects intent. Anchor stays put so
498
508
  // virtualAnchorRow is still valid for its own round-trip.
499
509
  s.virtualFocusRow = undefined;
510
+ s.virtualFocusCol = undefined;
511
+ s.offScreen = undefined;
500
512
  s.settledRevision += 1;
501
513
  }
502
514
  /**
503
- * Shift anchor AND focus by dRow, clamped to [minRow, maxRow]. Used for
504
- * keyboard scroll (PgUp/PgDn/ctrl+u/d/b/f): the whole selection must track
505
- * the content, unlike drag-to-scroll where focus stays at the mouse. Any
506
- * point that hits a clamp bound gets its col reset to the full-width edge —
507
- * its original content scrolled off-screen and was captured by
508
- * captureScrolledRows, so the col constraint was already consumed. Keeping
509
- * it would truncate the NEW content now at that screen row. Clamp col is 0
510
- * for dRow<0 (scrolling down, top leaves, 'above' semantics) or width-1 for
511
- * dRow>0 (scrolling up, bottom leaves, 'below' semantics).
515
+ * Shift the selection by dRow, clamped to [minRow, maxRow]. Used by keyboard
516
+ * scroll (PgUp/PgDn/ctrl+u/d/b/f) and by the renderer's selection-follow
517
+ * pass. A released selection moves BOTH ends (text-anchored); a live drag
518
+ * passes moveFocus=false so only the anchor tracks the text and the focus
519
+ * stays under the held pointer. Any point that hits a clamp bound gets its
520
+ * col reset to the full-width edge — its original content scrolled off-screen
521
+ * and was captured by captureScrolledRows. The original column is kept in
522
+ * virtualAnchorCol/virtualFocusCol and restored when a reverse scroll brings
523
+ * that row back.
524
+ *
525
+ * allowClear=false keeps a selection that scrolled fully off-screen: the
526
+ * captured rows stay copyable and a reverse scroll restores the endpoints.
527
+ * The live-drag path uses it so a wheel cannot kill the gesture; the
528
+ * released path also uses it so the user can copy after scrolling away.
512
529
  *
513
- * If both ends overshoot the SAME viewport edge (select text → Home/End/g/G
514
- * jumps far enough that both are out of view), clear — otherwise both clamp
515
- * to the same corner cell and a ghost 1-cell highlight lingers, and
516
- * getSelectedText returns one unrelated char from that corner. Symmetric
517
- * with shiftSelectionForFollow's top-edge check, but bidirectional: keyboard
518
- * scroll can jump either way.
519
530
  * @param s - the selection state to mutate.
520
531
  * @param dRow - signed row offset to shift by.
521
532
  * @param minRow - lowest allowed row (viewport top).
522
533
  * @param maxRow - highest allowed row (viewport bottom).
523
534
  * @param width - screen width, used for the clamp-edge column.
535
+ * @param allowClear - clear when both ends leave the same edge (default true).
536
+ * @param moveFocus - also move focus (false for a live drag).
524
537
  */
525
- export function shiftSelection(s, dRow, minRow, maxRow, width) {
526
- if (!s.anchor || !s.focus)
538
+ export function shiftSelection(s, dRow, minRow, maxRow, width, allowClear = true, moveFocus = true) {
539
+ if (!s.anchor)
540
+ return;
541
+ if (!s.focus) {
542
+ // A held press has no focus until the first motion, but its text anchor
543
+ // must already follow scrolling without turning a click into a selection.
544
+ shiftAnchor(s, dRow, minRow, maxRow);
527
545
  return;
546
+ }
528
547
  // Virtual rows track pre-clamp positions so reverse scrolls restore
529
548
  // correctly. Without this, clamp(5→0) + shift(+10) = 10, not the true 5,
530
549
  // and scrolledOffAbove stays stale (highlight ≠ copy).
531
550
  const vAnchor = (s.virtualAnchorRow ?? s.anchor.row) + dRow;
532
- const vFocus = (s.virtualFocusRow ?? s.focus.row) + dRow;
533
- if ((vAnchor < minRow && vFocus < minRow) ||
534
- (vAnchor > maxRow && vFocus > maxRow)) {
551
+ // A live drag keeps focus at the mouse: only the anchor tracks the text.
552
+ const vFocus = moveFocus
553
+ ? (s.virtualFocusRow ?? s.focus.row) + dRow
554
+ : s.focus.row;
555
+ if (allowClear &&
556
+ ((vAnchor < minRow && vFocus < minRow) ||
557
+ (vAnchor > maxRow && vFocus > maxRow))) {
535
558
  clearSelection(s);
536
559
  return;
537
560
  }
538
- // Debt = how far the nearer endpoint overshoots each edge. When debt
539
- // shrinks (reverse scroll), those rows are back on-screen — pop from
540
- // the accumulator so getSelectedText doesn't double-count them.
541
- const oldMin = Math.min(s.virtualAnchorRow ?? s.anchor.row, s.virtualFocusRow ?? s.focus.row);
542
- const oldMax = Math.max(s.virtualAnchorRow ?? s.anchor.row, s.virtualFocusRow ?? s.focus.row);
543
- const oldAboveDebt = Math.max(0, minRow - oldMin);
544
- const oldBelowDebt = Math.max(0, oldMax - maxRow);
545
- const newAboveDebt = Math.max(0, minRow - Math.min(vAnchor, vFocus));
546
- const newBelowDebt = Math.max(0, Math.max(vAnchor, vFocus) - maxRow);
547
- if (newAboveDebt < oldAboveDebt) {
548
- // scrolledOffAbove pushes newest at the end (closest to on-screen).
549
- const drop = oldAboveDebt - newAboveDebt;
550
- s.scrolledOffAbove.length -= drop;
551
- }
552
- if (newBelowDebt < oldBelowDebt) {
553
- // scrolledOffBelow unshifts newest at the front (closest to on-screen).
554
- const drop = oldBelowDebt - newBelowDebt;
555
- s.scrolledOffBelow.splice(0, drop);
556
- }
557
- // Invariant: accumulator length ≤ debt. If the accumulator exceeds debt,
558
- // the excess is stale — e.g., moveFocus cleared virtualFocusRow without
559
- // trimming the accumulator, orphaning entries the pop above can never
560
- // reach because oldDebt was ALREADY 0. Truncate to debt (keeping the
561
- // newest = closest-to-on-screen entries). Check newDebt (not oldDebt):
562
- // captureScrolledRows runs BEFORE this shift in the real flow (ink.tsx),
563
- // so at entry the accumulator is populated but oldDebt is still 0 —
564
- // that's the normal establish-debt path, not stale.
565
- if (s.scrolledOffAbove.length > newAboveDebt) {
566
- // Above pushes newest at END → keep END.
561
+ s.offScreen =
562
+ vAnchor < minRow && vFocus < minRow
563
+ ? 'above'
564
+ : vAnchor > maxRow && vFocus > maxRow
565
+ ? 'below'
566
+ : undefined;
567
+ // Number of SELECTED rows currently above/below the viewport. The old
568
+ // endpoint-overshoot debt overcounted whenever the selection was shorter
569
+ // than the scroll distance (both endpoints far off-screen), so a reverse
570
+ // scroll popped every captured row even though the selected rows had not
571
+ // re-entered yet. Count the selected span instead.
572
+ const selStart = Math.min(vAnchor, vFocus);
573
+ const selEnd = Math.max(vAnchor, vFocus);
574
+ const aboveRows = Math.max(0, Math.min(selEnd, minRow - 1) - selStart + 1);
575
+ const belowRows = Math.max(0, selEnd - Math.max(selStart, maxRow + 1) + 1);
576
+ // Rows re-enter from the viewport edge in reverse capture order: the
577
+ // NEWEST above entry (END) comes back first, so keep the oldest FRONT
578
+ // rows. Below is symmetric: newest at the FRONT, keep the oldest END.
579
+ if (aboveRows < s.scrolledOffAbove.length) {
567
580
  s.scrolledOffAbove =
568
- newAboveDebt > 0 ? s.scrolledOffAbove.slice(-newAboveDebt) : [];
569
- }
570
- if (s.scrolledOffBelow.length > newBelowDebt) {
571
- // Below unshifts newest at FRONT → keep FRONT.
572
- s.scrolledOffBelow = s.scrolledOffBelow.slice(0, newBelowDebt);
581
+ aboveRows > 0 ? s.scrolledOffAbove.slice(0, aboveRows) : [];
582
+ }
583
+ if (belowRows < s.scrolledOffBelow.length) {
584
+ s.scrolledOffBelow =
585
+ belowRows > 0 ? s.scrolledOffBelow.slice(-belowRows) : [];
586
+ }
587
+ // Restore the pre-clamp column when a reverse scroll brings the point
588
+ // back into the viewport; store it the first time it leaves. Without
589
+ // this, a selection that scrolled fully off and back keeps the edge
590
+ // column and truncates the first/last copied line.
591
+ if (vAnchor < minRow || vAnchor > maxRow) {
592
+ s.virtualAnchorCol ??= s.anchor.col;
593
+ }
594
+ else if (s.virtualAnchorCol !== undefined) {
595
+ s.anchor.col = s.virtualAnchorCol;
596
+ s.virtualAnchorCol = undefined;
597
+ }
598
+ if (moveFocus) {
599
+ if (vFocus < minRow || vFocus > maxRow) {
600
+ s.virtualFocusCol ??= s.focus.col;
601
+ }
602
+ else if (s.virtualFocusCol !== undefined) {
603
+ s.focus.col = s.virtualFocusCol;
604
+ s.virtualFocusCol = undefined;
605
+ }
573
606
  }
574
607
  // Clamp col depends on which EDGE (not dRow direction): virtual tracking
575
608
  // means a top-clamped point can stay top-clamped during a dRow>0 reverse
576
609
  // shift — dRow-based clampCol would give it the bottom col.
577
610
  const shift = (p, vRow) => {
578
611
  if (vRow < minRow)
579
- return { col: 0, row: minRow };
612
+ return { col: s.fence?.colStart ?? 0, row: minRow };
580
613
  if (vRow > maxRow)
581
- return { col: width - 1, row: maxRow };
614
+ return { col: s.fence?.colEnd ?? width - 1, row: maxRow };
582
615
  return { col: p.col, row: vRow };
583
616
  };
584
617
  s.anchor = shift(s.anchor, vAnchor);
585
- s.focus = shift(s.focus, vFocus);
618
+ if (moveFocus) {
619
+ s.focus = shift(s.focus, vFocus);
620
+ s.virtualFocusRow =
621
+ vFocus < minRow || vFocus > maxRow ? vFocus : undefined;
622
+ }
586
623
  s.virtualAnchorRow =
587
624
  vAnchor < minRow || vAnchor > maxRow ? vAnchor : undefined;
588
- s.virtualFocusRow = vFocus < minRow || vFocus > maxRow ? vFocus : undefined;
589
625
  // anchorSpan not virtual-tracked: it's for word/line extend-on-drag,
590
626
  // irrelevant to the keyboard-scroll round-trip case.
591
627
  if (s.anchorSpan) {
@@ -789,8 +825,9 @@ export function shiftSelectionForViewportTranslation(s, rowDelta, oldTop, oldBot
789
825
  }
790
826
  const rawAnchor = (s.virtualAnchorRow ?? s.anchor.row) + dRow;
791
827
  const rawFocus = (s.virtualFocusRow ?? s.focus.row) + dRow;
792
- if ((rawAnchor < newTop && rawFocus < newTop) ||
793
- (rawAnchor > newBottom && rawFocus > newBottom)) {
828
+ if (s.offScreen === undefined &&
829
+ ((rawAnchor < newTop && rawFocus < newTop) ||
830
+ (rawAnchor > newBottom && rawFocus > newBottom))) {
794
831
  clearSelection(s);
795
832
  return true;
796
833
  }
@@ -835,16 +872,12 @@ export function shiftSelectionForViewportTranslation(s, rowDelta, oldTop, oldBot
835
872
  * before this frame's paint overwrites it with chrome cells. Growth edges
836
873
  * have no band to capture; the shift below just re-widens the clamp.
837
874
  *
838
- * shiftSelection(dRow=0) then re-derives the endpoints: clamps stragglers
839
- * into the new bounds (virtual-row tracked, so a later re-widening restores
840
- * the true position and pops the accumulator), pops captured rows whose
841
- * debt a re-widening returned to the viewport, and clears when BOTH ends
842
- * land under the same band (the whole selection is under chrome). Unlike
843
- * the follow path's shiftAnchor/shiftSelectionForFollow split, this uses
844
- * shiftSelection for BOTH drag and released states: with dRow=0 a live drag
845
- * focus stays at the mouse unless the chrome covered it too, and
846
- * shiftSelection is the only shift that pops debt on re-widening — the
847
- * follow path never re-widens, a resize does (pill unmount).
875
+ * shiftSelection then re-clamps the logical endpoints to the new bounds.
876
+ * A box move translates the text anchor; a live focus stays at the pointer
877
+ * unless chrome covered its row. Captured rows are popped only as their
878
+ * selected span actually re-enters. A released, previously visible selection
879
+ * wholly covered by chrome still clears; an already retained off-screen
880
+ * selection survives valid geometry changes.
848
881
  *
849
882
  * Degenerate bounds are handled explicitly: a collapsed new viewport
850
883
  * (innerHeight 0 — chrome taller than the box) clears the selection, an
@@ -858,7 +891,7 @@ export function shiftSelectionForViewportTranslation(s, rowDelta, oldTop, oldBot
858
891
  * @param newTop - viewport top after this frame's layout.
859
892
  * @param newBottom - viewport bottom after this frame's layout.
860
893
  */
861
- export function shiftSelectionForViewportResize(s, screen, oldTop, oldBottom, newTop, newBottom) {
894
+ export function shiftSelectionForViewportResize(s, screen, oldTop, oldBottom, newTop, newBottom, boxDeltaY = 0) {
862
895
  if (!s.anchor)
863
896
  return;
864
897
  // Degenerate ranges. A ScrollBox can fully collapse — chrome taller than
@@ -875,35 +908,28 @@ export function shiftSelectionForViewportResize(s, screen, oldTop, oldBottom, ne
875
908
  }
876
909
  if (oldTop > oldBottom)
877
910
  return;
878
- // Re-widening edges (chrome unmounted): rows the chrome previously
879
- // covered return to the viewport. shiftSelection measures debt against
880
- // the NEW bounds only — correct for keyboard scroll, whose bounds stay
881
- // fixed across the shift, but a resize CHANGES the bounds, so the
882
- // returned rows are popped HERE by pure geometry: the g rows closest to
883
- // the viewport re-enter, i.e. the FRONT of scrolledOffBelow (newest
884
- // unshifted there) and the END of scrolledOffAbove (newest pushed there).
885
- if (newBottom > oldBottom && s.scrolledOffBelow.length > 0) {
886
- const drop = Math.min(newBottom - oldBottom, s.scrolledOffBelow.length);
887
- s.scrolledOffBelow.splice(0, drop);
888
- }
889
- if (newTop < oldTop && s.scrolledOffAbove.length > 0) {
890
- const drop = Math.min(oldTop - newTop, s.scrolledOffAbove.length);
891
- s.scrolledOffAbove.length -= drop;
892
- }
893
- if (newTop > oldTop)
894
- captureScrolledRows(s, screen, oldTop, newTop - 1, 'above');
895
- if (newBottom < oldBottom)
896
- captureScrolledRows(s, screen, newBottom + 1, oldBottom, 'below');
897
- if (!s.focus) {
898
- // Bare press (no drag motion yet, focus still null): shiftSelection
899
- // needs both ends — clamp the anchor alone so a chrome mount can't
900
- // strand it before the first motion sets focus.
901
- const raw = s.virtualAnchorRow ?? s.anchor.row;
902
- s.anchor = { col: s.anchor.col, row: clamp(raw, newTop, newBottom) };
903
- s.virtualAnchorRow = raw < newTop || raw > newBottom ? raw : undefined;
904
- return;
905
- }
906
- shiftSelection(s, 0, newTop, newBottom, screen.width);
911
+ // The new viewport expressed in PREVIOUS-frame coordinates. A box move
912
+ // can cover a bottom row even when its screen-space bottom did not move.
913
+ const visibleTop = newTop - boxDeltaY;
914
+ const visibleBottom = newBottom - boxDeltaY;
915
+ const focusOffset = s.isDragging ? -boxDeltaY : 0;
916
+ if (visibleTop > oldTop) {
917
+ captureScrolledRows(s, screen, oldTop, Math.min(oldBottom, visibleTop - 1), 'above', 0, focusOffset);
918
+ }
919
+ if (visibleBottom < oldBottom) {
920
+ captureScrolledRows(s, screen, Math.max(oldTop, visibleBottom + 1), oldBottom, 'below', 0, focusOffset);
921
+ }
922
+ // Only the text origin moves with the box; a live focus remains at the
923
+ // pointer. Feed its untranslated raw row through the same clamp pass so
924
+ // chrome that covers the pointer still cannot enter the copied range.
925
+ if (s.isDragging && s.focus) {
926
+ s.virtualFocusRow = (s.virtualFocusRow ?? s.focus.row) - boxDeltaY;
927
+ }
928
+ // Previously captured, fully off-screen selections survive chrome changes.
929
+ // Keep the existing clear for a released on-screen selection wholly covered
930
+ // by chrome. Re-entering selected rows are popped by shiftSelection's debt,
931
+ // not by viewport growth alone (a far-off selection may not have returned).
932
+ shiftSelection(s, boxDeltaY, newTop, newBottom, screen.width, !s.isDragging && s.offScreen === undefined);
907
933
  }
908
934
  /**
909
935
  * Pick which scroll event a selection belongs to when several ScrollBoxes
@@ -979,6 +1005,8 @@ export function selectionBounds(s) {
979
1005
  * @returns true when the cell lies inside the selection range.
980
1006
  */
981
1007
  export function isCellSelected(s, col, row) {
1008
+ if (s.offScreen !== undefined)
1009
+ return false;
982
1010
  const b = selectionBounds(s);
983
1011
  if (!b)
984
1012
  return false;
@@ -1069,6 +1097,12 @@ export function refreshSelectionPane(s, screen, previous) {
1069
1097
  const reverse = comparePoints(s.anchor, s.focus) > 0;
1070
1098
  s.anchor = { ...after.points[reverse ? last : first] };
1071
1099
  s.focus = { ...after.points[reverse ? first : last] };
1100
+ // The remapped points are visible again: old clamp columns would
1101
+ // restore a stale column from the pre-resize pane. Rows stay tracked
1102
+ // for the off-screen captured range.
1103
+ s.virtualAnchorCol = undefined;
1104
+ s.virtualFocusCol = undefined;
1105
+ s.offScreen = undefined;
1072
1106
  // A completed word/line selection no longer needs the old screen span.
1073
1107
  s.anchorSpan = null;
1074
1108
  }
@@ -1086,6 +1120,12 @@ export function refreshSelectionPane(s, screen, previous) {
1086
1120
  if (point)
1087
1121
  point.col = clamp(point.col + delta, span.start, span.end - 1);
1088
1122
  }
1123
+ if (s.virtualAnchorCol !== undefined) {
1124
+ s.virtualAnchorCol = clamp(s.virtualAnchorCol + delta, span.start, span.end - 1);
1125
+ }
1126
+ if (s.virtualFocusCol !== undefined) {
1127
+ s.virtualFocusCol = clamp(s.virtualFocusCol + delta, span.start, span.end - 1);
1128
+ }
1089
1129
  }
1090
1130
  s.fence = { colStart: span.start, colEnd: span.end - 1 };
1091
1131
  return changed;
@@ -1436,30 +1476,41 @@ export function getSelectedText(s, screen) {
1436
1476
  const { start, end } = b;
1437
1477
  const lines = [];
1438
1478
  const rows = [];
1439
- for (let i = 0; i < s.scrolledOffAbove.length; i++) {
1440
- rows.push(s.scrolledOffAbove[i]);
1441
- }
1442
- for (let row = start.row; row <= end.row; row++) {
1443
- let rowStart = row === start.row ? start.col : 0;
1444
- let rowEnd = row === end.row ? end.col : screen.width - 1;
1445
- // Fence (panel-origin gestures) applies to EVERY row, not just the
1446
- // endpoints: intermediate rows must not span into the chat column.
1447
- const pane = paneSpan(s, screen, row);
1448
- if (s.paneId !== undefined && !pane)
1449
- continue;
1450
- const fence = pane ? { colStart: pane.start, colEnd: pane.end - 1 } : s.fence;
1451
- if (fence !== undefined) {
1452
- rowStart = Math.max(rowStart, fence.colStart);
1453
- rowEnd = Math.min(rowEnd, fence.colEnd);
1454
- if (rowStart > rowEnd)
1479
+ // When both endpoints left the same edge, the clamped start/end are NOT
1480
+ // selected: they now point at new content. The accumulators already hold
1481
+ // the whole selection, so skip the visible read entirely.
1482
+ if (s.offScreen === 'above') {
1483
+ rows.push(...s.scrolledOffAbove);
1484
+ }
1485
+ else if (s.offScreen === 'below') {
1486
+ rows.push(...s.scrolledOffBelow);
1487
+ }
1488
+ else {
1489
+ for (let i = 0; i < s.scrolledOffAbove.length; i++) {
1490
+ rows.push(s.scrolledOffAbove[i]);
1491
+ }
1492
+ for (let row = start.row; row <= end.row; row++) {
1493
+ let rowStart = row === start.row ? start.col : 0;
1494
+ let rowEnd = row === end.row ? end.col : screen.width - 1;
1495
+ // Fence (panel-origin gestures) applies to EVERY row, not just the
1496
+ // endpoints: intermediate rows must not span into the chat column.
1497
+ const pane = paneSpan(s, screen, row);
1498
+ if (s.paneId !== undefined && !pane)
1499
+ continue;
1500
+ const fence = pane ? { colStart: pane.start, colEnd: pane.end - 1 } : s.fence;
1501
+ if (fence !== undefined) {
1502
+ rowStart = Math.max(rowStart, fence.colStart);
1503
+ rowEnd = Math.min(rowEnd, fence.colEnd);
1504
+ if (rowStart > rowEnd)
1505
+ continue;
1506
+ }
1507
+ if (s.paneId !== undefined && (screen.noSelect.subarray(row * screen.width + rowStart, row * screen.width + rowEnd + 1).every(bit => bit === 1) || pane?.excluded?.some(range => range.start <= rowStart && range.end > rowEnd)))
1455
1508
  continue;
1509
+ rows.push(extractRowText(screen, row, rowStart, rowEnd, row < end.row || s.scrolledOffBelow.length > 0, s.includeNoSelectCells, s));
1510
+ }
1511
+ for (let i = 0; i < s.scrolledOffBelow.length; i++) {
1512
+ rows.push(s.scrolledOffBelow[i]);
1456
1513
  }
1457
- if (s.paneId !== undefined && (screen.noSelect.subarray(row * screen.width + rowStart, row * screen.width + rowEnd + 1).every(bit => bit === 1) || pane?.excluded?.some(range => range.start <= rowStart && range.end > rowEnd)))
1458
- continue;
1459
- rows.push(extractRowText(screen, row, rowStart, rowEnd, row < end.row || s.scrolledOffBelow.length > 0, s.includeNoSelectCells, s));
1460
- }
1461
- for (let i = 0; i < s.scrolledOffBelow.length; i++) {
1462
- rows.push(s.scrolledOffBelow[i]);
1463
1514
  }
1464
1515
  for (const row of resolveCopyRegions(rows))
1465
1516
  joinRows(lines, row.text, row.sw);
@@ -1485,14 +1536,28 @@ export function getSelectedText(s, screen) {
1485
1536
  * @param firstRow - first viewport row that is about to scroll out.
1486
1537
  * @param lastRow - last viewport row that is about to scroll out.
1487
1538
  * @param side - which viewport edge the rows scroll out of.
1539
+ * @param screenRowOffset - capture rows minus this offset index the previous screen.
1540
+ * @param focusRowOffset - map a screen-local drag focus back across the pending shift.
1488
1541
  */
1489
- export function captureScrolledRows(s, screen, firstRow, lastRow, side, screenRowOffset = 0) {
1490
- const b = selectionBounds(s);
1491
- if (!b || firstRow > lastRow)
1542
+ export function captureScrolledRows(s, screen, firstRow, lastRow, side, screenRowOffset = 0, focusRowOffset = 0) {
1543
+ if (!s.anchor || !s.focus || firstRow > lastRow)
1492
1544
  return;
1493
- const { start, end } = b;
1494
- // Intersect [firstRow, lastRow] with [start.row, end.row]. Rows outside
1495
- // the selection aren't captured — they weren't selected.
1545
+ // Capture the logical endpoints, not their viewport-edge placeholders.
1546
+ // A live drag keeps focus screen-local: mapping its NEW extent back to
1547
+ // this frame's outgoing rows also includes content past the old focus.
1548
+ const anchor = {
1549
+ col: s.virtualAnchorCol ?? s.anchor.col,
1550
+ row: s.virtualAnchorRow ?? s.anchor.row,
1551
+ };
1552
+ const focus = {
1553
+ col: s.virtualFocusCol ?? s.focus.col,
1554
+ row: (s.virtualFocusRow ?? s.focus.row) + focusRowOffset,
1555
+ };
1556
+ const forward = comparePoints(anchor, focus) <= 0;
1557
+ const start = forward ? anchor : focus;
1558
+ const end = forward ? focus : anchor;
1559
+ // Only rows selected AFTER the movement belong in the outgoing capture.
1560
+ // This also handles a live drag reversing direction across its anchor.
1496
1561
  const lo = Math.max(firstRow, start.row);
1497
1562
  const hi = Math.min(lastRow, end.row);
1498
1563
  if (lo > hi)
@@ -1520,7 +1585,8 @@ export function captureScrolledRows(s, screen, firstRow, lastRow, side, screenRo
1520
1585
  // dragging down) is now pointing at content that will scroll out; its
1521
1586
  // col constraint was applied to the captured row. Reset to the pane edge so
1522
1587
  // the NEXT tick and the final getSelectedText read the full row.
1523
- if (s.anchor && s.anchor.row === start.row && lo === start.row) {
1588
+ if (anchor.row === start.row && lo === start.row) {
1589
+ s.virtualAnchorCol ??= anchor.col;
1524
1590
  s.anchor = { col: edgeLo, row: s.anchor.row };
1525
1591
  if (s.anchorSpan) {
1526
1592
  s.anchorSpan = {
@@ -1535,7 +1601,8 @@ export function captureScrolledRows(s, screen, firstRow, lastRow, side, screenRo
1535
1601
  // Newest rows go at the TOP of the below-accumulator — they're
1536
1602
  // closest to the on-screen content.
1537
1603
  s.scrolledOffBelow.unshift(...captured);
1538
- if (s.anchor && s.anchor.row === end.row && hi === end.row) {
1604
+ if (anchor.row === end.row && hi === end.row) {
1605
+ s.virtualAnchorCol ??= anchor.col;
1539
1606
  s.anchor = { col: edgeHi, row: s.anchor.row };
1540
1607
  if (s.anchorSpan) {
1541
1608
  s.anchorSpan = {
@@ -1594,6 +1661,8 @@ function selectedRowColumns(screen, selection, row, start, end) {
1594
1661
  * content is found. Wide glyphs use their head cell, as text copying does.
1595
1662
  */
1596
1663
  export function getSelectionCursor(screen, selection) {
1664
+ if (selection.offScreen !== undefined)
1665
+ return null;
1597
1666
  const bounds = selectionBounds(selection);
1598
1667
  if (bounds === null)
1599
1668
  return null;
@@ -1637,6 +1706,8 @@ export function getSelectionCursor(screen, selection) {
1637
1706
  * @param stylePool - the style pool providing the selection background.
1638
1707
  */
1639
1708
  export function applySelectionOverlay(screen, selection, stylePool, images = []) {
1709
+ if (selection.offScreen !== undefined)
1710
+ return;
1640
1711
  const b = selectionBounds(selection);
1641
1712
  if (!b)
1642
1713
  return;
@@ -47,9 +47,12 @@ export declare function writeKernelPrefs(data: KernelPrefsData, file?: string, d
47
47
  * config > env > remembered choice.
48
48
  */
49
49
  export declare const KERNEL_SWITCH_HANDOFF_ENV = "DSH_TUI_BACKEND_HANDOFF";
50
- /** The entry's path, set by the launcher: every replacement
51
- * relaunches through it (src/update.ts restartArgv). */
50
+ /** The entry's path, set by the launcher: replacements relaunch through it
51
+ * unless an ordinary restart stays on the entry's delegated DSH path. */
52
52
  export declare const HOST_ENTRY_PATH_ENV = "DSH_TUI_HOST_ENTRY_PATH";
53
+ /** The entry delegated to DSH: /restart replays that process directly rather
54
+ * than accumulating an entry supervisor that would delegate again. */
55
+ export declare const HOST_ENTRY_DELEGATED_ENV = "DSH_TUI_HOST_DELEGATED";
53
56
  export declare function hostEntryDisabled(env?: NodeJS.ProcessEnv): boolean;
54
57
  /** Why the entry could not use the installed dsh; set by the entry, read and
55
58
  * cleared once by the runtime (plugin.ts), also in a delegated `dsh --profile`. */
@@ -1 +1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ANDOFF_ENV = 'DSH_TUI_BACKEND_HANDOFF';
109
109
  * `DSH_TUI_HOST_ENTRY=0` keeps every kernel on `dsh --profile`.
110
110
  */
111
111
  const HOST_ENTRY_ENV = 'DSH_TUI_HOST_ENTRY';
112
- /** The entry's path, set by the launcher: every replacement
113
- * relaunches through it (src/update.ts restartArgv). */
112
+ /** The entry's path, set by the launcher: replacements relaunch through it
113
+ * unless an ordinary restart stays on the entry's delegated DSH path. */
114
114
  export const HOST_ENTRY_PATH_ENV = 'DSH_TUI_HOST_ENTRY_PATH';
115
+ /** The entry delegated to DSH: /restart replays that process directly rather
116
+ * than accumulating an entry supervisor that would delegate again. */
117
+ export const HOST_ENTRY_DELEGATED_ENV = 'DSH_TUI_HOST_DELEGATED';
115
118
  export function hostEntryDisabled(env = process.env) {
116
119
  return env[HOST_ENTRY_ENV] === '0';
117
120
  }
@@ -330,6 +330,18 @@ export declare const SETTING_DEFINITIONS: {
330
330
  };
331
331
  kind: "boolean";
332
332
  };
333
+ nerdFontIcons: {
334
+ label: string;
335
+ descriptions: {
336
+ zh: string;
337
+ };
338
+ group: string;
339
+ hint: string;
340
+ hintDescriptions: {
341
+ zh: string;
342
+ };
343
+ kind: "boolean";
344
+ };
333
345
  notificationMethod: {
334
346
  label: string;
335
347
  descriptions: {
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/settings/definitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAG5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,GAAG,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAA;AAE7I,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;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EAAE,MAAM,KAAK,MAAM,CAAA;CAAE,CAmHnK,CAAA"}
@@ -207,6 +207,14 @@ export const SETTING_DEFINITIONS = {
207
207
  hintDescriptions: { zh: '只精简界面:隐藏开屏头部、emoji 状态符与装饰性配色,底栏只留模型与目录;代码高亮与工具配色保留。这是界面开关,不是 Agent 预设——模型能用哪些工具由内核预设决定(见 /preset)。' },
208
208
  kind: 'boolean',
209
209
  },
210
+ 'nerdFontIcons': {
211
+ label: 'Nerd Font file icons',
212
+ descriptions: { zh: 'Nerd Font 文件图标' },
213
+ group: 'appearance',
214
+ hint: 'Show file-type icons in the `present` delivery card instead of four-cell type badges (PDF, XLS, PPT…). Requires a Nerd Font Mono in the terminal: without one the glyphs render as boxes. Off by default; the card keeps the font-safe badges. Applies immediately.',
215
+ hintDescriptions: { zh: '在 `present` 交付卡里用文件类型图标代替四格徽章(PDF、XLS、PPT…)。需要终端使用 Nerd Font Mono;没装时图标会变成方框。默认关闭,卡片继续用与字体无关的徽章。立即生效。' },
216
+ kind: 'boolean',
217
+ },
210
218
  'notificationMethod': {
211
219
  label: 'Notification method',
212
220
  descriptions: { zh: '通知方式' },
@@ -510,8 +518,8 @@ export const SETTING_DEFINITIONS = {
510
518
  label: 'Tool background',
511
519
  descriptions: { zh: '工具卡背景' },
512
520
  group: 'appearance',
513
- hint: 'Choose whether tool-call cards add no, subtle, or strong background emphasis; also applies when expanded.',
514
- hintDescriptions: { zh: '选择工具调用卡片不添加、轻微或明显的背景强调;展开后也生效。' },
521
+ hint: 'Choose whether tool-call cards add no, subtle, or strong background emphasis; also applies when expanded. A `present` delivery card always keeps its own face — warm when None, violet when Subtle/Strong — except in the Minimal UI.',
522
+ hintDescriptions: { zh: '选择工具调用卡片不添加、轻微或明显的背景强调;展开后也生效。`present` 交付卡始终保留自己的底色——无背景时暖橙,轻微/明显时紫罗兰——极简界面除外。' },
515
523
  kind: 'select',
516
524
  options: [
517
525
  { value: 'none', label: 'None', descriptions: { zh: '无' } },
@@ -75,6 +75,10 @@ export type Theme = {
75
75
  diffRemovedWord: string;
76
76
  toolCardBackground: string;
77
77
  toolCardBackgroundDim: string;
78
+ /** Warm face a `present` delivery card keeps when tool backgrounds are off. */
79
+ presentCardWarm: string;
80
+ /** Tint for the delivery face: deep violet on dark palettes, lavender on light. */
81
+ presentCardTint: string;
78
82
  toolDotExec: string;
79
83
  toolDotRead: string;
80
84
  toolDotWrite: string;