@deepseek-harness-tui/dsh-tui 0.7.2 → 0.8.0
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 +3 -3
- package/bin/dsh-tui.js +24 -3
- package/cordis.patch.yml +24 -11
- package/cordis.yml +9 -1
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +2 -1
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +6 -1
- package/lib/types/components/HistorySearchDialog.d.ts.map +1 -1
- package/lib/types/components/HistorySearchDialog.js +5 -1
- package/lib/types/components/MessageList.d.ts +3 -1
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +9 -5
- package/lib/types/components/PluginSceneBoundary.d.ts +31 -0
- package/lib/types/components/PluginSceneBoundary.d.ts.map +1 -0
- package/lib/types/components/PluginSceneBoundary.js +29 -0
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +52 -74
- package/lib/types/components/SearchBox.d.ts +4 -0
- package/lib/types/components/SearchBox.d.ts.map +1 -1
- package/lib/types/components/SearchBox.js +101 -2
- package/lib/types/components/SkillsPicker.d.ts +18 -0
- package/lib/types/components/SkillsPicker.d.ts.map +1 -0
- package/lib/types/components/SkillsPicker.js +50 -0
- package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +4 -1
- package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts.map +1 -1
- package/lib/types/components/Spinner/SpinnerAnimationRow.js +10 -5
- package/lib/types/components/SplitDiffView.d.ts +28 -0
- package/lib/types/components/SplitDiffView.d.ts.map +1 -0
- package/lib/types/components/SplitDiffView.js +417 -0
- package/lib/types/components/WorkingSpinner.d.ts +3 -1
- package/lib/types/components/WorkingSpinner.d.ts.map +1 -1
- package/lib/types/components/WorkingSpinner.js +2 -2
- package/lib/types/components/design-system/ThemedText.d.ts +7 -1
- package/lib/types/components/design-system/ThemedText.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemedText.js +2 -2
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +3 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +17 -7
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +52 -8
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +12 -3
- package/lib/types/dsh-adapter/channel.d.ts +78 -0
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +165 -14
- package/lib/types/dsh-adapter/contract.d.ts +1 -1
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +1 -0
- package/lib/types/dsh-adapter/index.d.ts +4 -0
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +1 -0
- package/lib/types/dsh-adapter/packaged-presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/packaged-presets.js +5 -2
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +66 -3
- package/lib/types/dsh-adapter/promptDebug.d.ts +10 -0
- package/lib/types/dsh-adapter/promptDebug.d.ts.map +1 -0
- package/lib/types/dsh-adapter/promptDebug.js +148 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +3 -1
- package/lib/types/dsh-adapter/scenes.d.ts +75 -0
- package/lib/types/dsh-adapter/scenes.d.ts.map +1 -0
- package/lib/types/dsh-adapter/scenes.js +78 -0
- package/lib/types/dsh-adapter/settings-sections.d.ts +116 -0
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -0
- package/lib/types/dsh-adapter/settings-sections.js +63 -0
- package/lib/types/dsh-adapter/settingsEditor.d.ts +128 -0
- package/lib/types/dsh-adapter/settingsEditor.d.ts.map +1 -0
- package/lib/types/dsh-adapter/settingsEditor.js +244 -0
- package/lib/types/i18n.d.ts +169 -18
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +45 -6
- package/lib/types/ink/components/Text.d.ts +9 -1
- package/lib/types/ink/components/Text.d.ts.map +1 -1
- package/lib/types/ink/components/Text.js +7 -6
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +4 -2
- package/lib/types/ink/log-update.d.ts.map +1 -1
- package/lib/types/ink/log-update.js +76 -9
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +4 -1
- package/lib/types/ink/terminal.d.ts +40 -4
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +57 -5
- package/lib/types/ink/termio/tokenize.d.ts +6 -0
- package/lib/types/ink/termio/tokenize.d.ts.map +1 -1
- package/lib/types/ink/termio/tokenize.js +18 -4
- package/lib/types/jsx-runtime.d.ts +2 -0
- package/lib/types/jsx-runtime.d.ts.map +1 -0
- package/lib/types/jsx-runtime.js +13 -0
- package/lib/types/modelRoute.d.ts +10 -2
- package/lib/types/modelRoute.d.ts.map +1 -1
- package/lib/types/modelRoute.js +33 -4
- package/lib/types/scenes.d.ts +3 -0
- package/lib/types/scenes.d.ts.map +1 -0
- package/lib/types/scenes.js +4 -0
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +182 -26
- package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
- package/lib/types/screens/SessionBrowser.js +30 -15
- package/lib/types/screens/Settings.d.ts +20 -0
- package/lib/types/screens/Settings.d.ts.map +1 -0
- package/lib/types/screens/Settings.js +333 -0
- package/lib/types/screens/StatusLine.js +1 -1
- package/lib/types/sessions/view.d.ts.map +1 -1
- package/lib/types/sessions/view.js +13 -1
- package/lib/types/settings-sections.d.ts +3 -0
- package/lib/types/settings-sections.d.ts.map +1 -0
- package/lib/types/settings-sections.js +4 -0
- package/lib/types/theme.d.ts +12 -0
- package/lib/types/theme.d.ts.map +1 -1
- package/lib/types/theme.js +36 -0
- package/lib/types/update.d.ts +21 -7
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +66 -16
- package/lib/types/utils/paths.d.ts.map +1 -1
- package/lib/types/utils/paths.js +4 -1
- package/package.json +49 -9
|
@@ -54,8 +54,8 @@ const memoizedStylesForWrap = {
|
|
|
54
54
|
* This component can display text, and change its style to make it colorful, bold, underline, italic or strikethrough.
|
|
55
55
|
*/
|
|
56
56
|
export default function Text(t0) {
|
|
57
|
-
const $ = _c(
|
|
58
|
-
const { color, backgroundColor, bold, dim, italic: t1, underline: t2, strikethrough: t3, inverse: t4, wrap: t5, children } = t0;
|
|
57
|
+
const $ = _c(30);
|
|
58
|
+
const { color, backgroundColor, bold, dim, italic: t1, underline: t2, strikethrough: t3, inverse: t4, wrap: t5, children, ref } = t0;
|
|
59
59
|
const italic = t1 === undefined ? false : t1;
|
|
60
60
|
const underline = t2 === undefined ? false : t2;
|
|
61
61
|
const strikethrough = t3 === undefined ? false : t3;
|
|
@@ -180,15 +180,16 @@ export default function Text(t0) {
|
|
|
180
180
|
const textStyles = t14;
|
|
181
181
|
const t15 = memoizedStylesForWrap[wrap];
|
|
182
182
|
let t16;
|
|
183
|
-
if ($[25] !== children || $[26] !== t15 || $[27] !== textStyles) {
|
|
184
|
-
t16 = _jsx("ink-text", { style: t15, textStyles: textStyles, children: children });
|
|
183
|
+
if ($[25] !== children || $[26] !== t15 || $[27] !== textStyles || $[28] !== ref) {
|
|
184
|
+
t16 = _jsx("ink-text", { ref: ref, style: t15, textStyles: textStyles, children: children });
|
|
185
185
|
$[25] = children;
|
|
186
186
|
$[26] = t15;
|
|
187
187
|
$[27] = textStyles;
|
|
188
|
-
$[28] =
|
|
188
|
+
$[28] = ref;
|
|
189
|
+
$[29] = t16;
|
|
189
190
|
}
|
|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AK,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI;IAc9D;;;;;OAKG;IACH,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAanD,OAAO,CAAC,cAAc,CAGd;IACR,OAAO,CAAC,UAAU,CAAS;IAC3B,YAAY,IAAI,IAAI;IA8BpB,WAAW,IAAI,IAAI;IAoDnB,OAAO,CAAC,QAAQ;IAGhB,OAAO,CAAC,oBAAoB,CAK1B;IACF,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAa7B,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI;IAiFtC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAOpC,cAAc,IAAI,IAAI;IAYtB;;;;;;;OAOG;IACH,UAAU,IAAI,IAAI;IAUlB,YAAY,IAAI,MAAM,IAAI;IAqB1B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,WAAW;CAoCpB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,wBAAgB,UAAU,CAAC,KAAK,GAAE,MAAM,CAAC,UAA0B,GAAG,IAAI,CAsDzE"}
|
package/lib/types/ink/ink.js
CHANGED
|
@@ -31,7 +31,7 @@ import createRenderer from './renderer.js';
|
|
|
31
31
|
import { CharPool, cellAt, createScreen, HyperlinkPool, isEmptyCellAt, migrateScreenPools, StylePool } from './screen.js';
|
|
32
32
|
import { applySearchHighlight } from './searchHighlight.js';
|
|
33
33
|
import { applySelectionOverlay, captureScrolledRows, clearSelection, createSelectionState, extendSelection, findPlainTextUrlAt, getSelectedText, hasSelection, moveFocus, selectLineAt, selectWordAt, shiftAnchor, shiftSelection, shiftSelectionForFollow, startSelection, updateSelection } from './selection.js';
|
|
34
|
-
import { SYNC_OUTPUT_SUPPORTED, supportsExtendedKeys, supportsWin32InputMode, writeDiffToTerminal } from './terminal.js';
|
|
34
|
+
import { isDecstbmSafe, SYNC_OUTPUT_SUPPORTED, supportsExtendedKeys, supportsWin32InputMode, writeDiffToTerminal } from './terminal.js';
|
|
35
35
|
import { CURSOR_HOME, cursorMove, cursorPosition, DISABLE_KITTY_KEYBOARD, DISABLE_MODIFY_OTHER_KEYS, DISABLE_WIN32_INPUT_MODE, ENABLE_KITTY_KEYBOARD, ENABLE_MODIFY_OTHER_KEYS, ENABLE_WIN32_INPUT_MODE, ERASE_SCREEN, SGR_RESET } from './termio/csi.js';
|
|
36
36
|
import { DBP, DFE, DISABLE_MOUSE_TRACKING, ENABLE_MOUSE_TRACKING, ENTER_ALT_SCREEN, EXIT_ALT_SCREEN, SHOW_CURSOR } from './termio/dec.js';
|
|
37
37
|
import { CLEAR_ITERM2_PROGRESS, CLEAR_TAB_STATUS, setClipboard, supportsTabStatus, wrapForMultiplexer } from './termio/osc.js';
|
|
@@ -582,7 +582,9 @@ export default class Ink {
|
|
|
582
582
|
// renders the scrolled-but-not-yet-repainted intermediate state.
|
|
583
583
|
// tmux is the main case (re-emits DECSTBM with its own timing and
|
|
584
584
|
// doesn't implement DEC 2026, so SYNC_OUTPUT_SUPPORTED is false).
|
|
585
|
-
|
|
585
|
+
// JediTerm is separately excluded in isDecstbmSafe(): its DECSTBM
|
|
586
|
+
// implementation deviates from xterm and garbles scrolling content.
|
|
587
|
+
isDecstbmSafe());
|
|
586
588
|
const diffMs = performance.now() - tDiff;
|
|
587
589
|
// Swap buffers
|
|
588
590
|
this.backFrame = this.frontFrame;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-update.d.ts","sourceRoot":"","sources":["../../../src/ink/log-update.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAiB,KAAK,EAAE,MAAM,YAAY,CAAA;AAE5D,OAAO,EASL,KAAK,SAAS,EAGf,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"log-update.d.ts","sourceRoot":"","sources":["../../../src/ink/log-update.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAiB,KAAK,EAAE,MAAM,YAAY,CAAA;AAE5D,OAAO,EASL,KAAK,SAAS,EAGf,MAAM,aAAa,CAAA;AAsBpB,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AAKD;;;GAGG;AACH,qBAAa,SAAS;IAGR,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,KAAK,CAAO;gBAES,OAAO,EAAE,OAAO;IAO7C;;;;;;;;;;;;;;;;;OAiBG;IACH,uBAAuB,IAAI,IAAI;IAI/B;;;;;OAKG;IACH,+BAA+B,CAAC,SAAS,EAAE,KAAK,GAAG,IAAI;IASvD,+HAA+H;IAC/H,KAAK,IAAI,IAAI;IAIb,OAAO,CAAC,eAAe;IAiDvB,OAAO,CAAC,mBAAmB;IAS3B;;;;;;;;OAQG;IACH,MAAM,CACJ,IAAI,EAAE,KAAK,EACX,IAAI,EAAE,KAAK,EACX,SAAS,UAAQ,EACjB,WAAW,UAAO,GACjB,IAAI;CAgbR"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ansiCodesToString, diffAnsiCodes, } from '@alcalzone/ansi-tokenize';
|
|
2
2
|
import { logForDebugging } from '../utils/debug.js';
|
|
3
3
|
import { cellAt, charInCellAt, diffEach, isEmptyCellAt, shiftRows, visibleCellAtIndex, } from './screen.js';
|
|
4
|
-
import { CURSOR_HOME, cursorUp, eraseToEndOfScreen, scrollDown as csiScrollDown, scrollUp as csiScrollUp, RESET_SCROLL_REGION, setScrollRegion, } from './termio/csi.js';
|
|
4
|
+
import { CURSOR_HOME, cursorUp, eraseToEndOfScreen, scrollDown as csiScrollDown, scrollUp as csiScrollUp, RESET_SCROLL_REGION, SGR_RESET, setScrollRegion, } from './termio/csi.js';
|
|
5
|
+
import { isJetBrainsIdeTerminal } from './terminal.js';
|
|
5
6
|
import { LINK_END, link as oscLink } from './termio/osc.js';
|
|
6
7
|
const CARRIAGE_RETURN = { type: 'carriageReturn' };
|
|
7
8
|
const NEWLINE = { type: 'stdout', content: '\n' };
|
|
@@ -425,9 +426,54 @@ export class LogUpdate {
|
|
|
425
426
|
: 'none';
|
|
426
427
|
logForDebugging(`Slow render: ${elapsed.toFixed(1)}ms, screen: ${next.screen.height}x${next.screen.width}, damage: ${damageInfo}, changes: ${screen.diff.length}`);
|
|
427
428
|
}
|
|
428
|
-
|
|
429
|
+
let result = scrollPatch.length > 0
|
|
429
430
|
? [...scrollPatch, ...screen.diff]
|
|
430
431
|
: screen.diff;
|
|
432
|
+
// JetBrains IDE terminals (JediTerm) in main-screen (inline) mode:
|
|
433
|
+
// append a visible-frame rewrite to the incremental diff.
|
|
434
|
+
//
|
|
435
|
+
// JediTerm's reworked block renderer (the default terminal in JetBrains
|
|
436
|
+
// IDEs 2025.2+) repaints a view row only when its model cells change,
|
|
437
|
+
// and it re-renders between writes. The incremental diff above writes
|
|
438
|
+
// only the cells that changed since the previous frame — so a row the
|
|
439
|
+
// block renderer misrendered mid-frame (partial reflow) is never
|
|
440
|
+
// touched again, and the garbage persists and accumulates as the
|
|
441
|
+
// transcript streams and scrolls: the "works in VS Code, slowly garbles
|
|
442
|
+
// in JetBrains" symptom. xterm.js-family terminals (VS Code) repaint
|
|
443
|
+
// the fixed grid on every write, so the same byte stream is clean
|
|
444
|
+
// there; the model-level state is identical on both (verified by
|
|
445
|
+
// replaying captured frame bytes through the IDE's bundled JediTerm
|
|
446
|
+
// emulator against xterm.js) — the divergence is purely the view
|
|
447
|
+
// layer's incremental repaint.
|
|
448
|
+
//
|
|
449
|
+
// The rewrite runs AFTER the incremental writes instead of replacing
|
|
450
|
+
// them: the growth path's CR+LF writes are what scroll scrolled-off
|
|
451
|
+
// rows into the terminal's native scrollback (inline mode's whole
|
|
452
|
+
// point). A pure full-repaint mode would never emit those scrolls and
|
|
453
|
+
// the transcript above the viewport would vanish. Appending a repaint
|
|
454
|
+
// anchored at the visible frame start (CR + CUU(visibleRows) + ED0 +
|
|
455
|
+
// frame tail) overwrites every application cell, forcing the block
|
|
456
|
+
// renderer to a correct full repaint without touching scrollback or
|
|
457
|
+
// shell output above a short frame. The appended slice lands its
|
|
458
|
+
// row-ending CR+LFs inside the viewport so nothing extra scrolls. The
|
|
459
|
+
// anchor prefixes SGR_RESET + link('') so the ED0's BCE fill uses the
|
|
460
|
+
// default background and any hyperlink the incremental writes left open
|
|
461
|
+
// is closed first. Frames that took a full-reset path already repaint
|
|
462
|
+
// everything and are skipped. A one-row viewport has no separate park
|
|
463
|
+
// row, so it keeps the original incremental output. Alt-screen is
|
|
464
|
+
// unaffected: its per-frame CSI H anchor + BSU/ESU atomic frames already
|
|
465
|
+
// keep the block renderer consistent.
|
|
466
|
+
if (!altScreen &&
|
|
467
|
+
isJetBrainsIdeTerminal() &&
|
|
468
|
+
prev.viewport.height > 1 &&
|
|
469
|
+
!result.some(patch => patch.type === 'clearTerminal')) {
|
|
470
|
+
logForDebugging(`JetBrains inline frame: append viewport repaint (height=${next.screen.height}, viewport=${prev.viewport.height})`);
|
|
471
|
+
result = [
|
|
472
|
+
...result,
|
|
473
|
+
...viewportRepaintPatches(prev, next, stylePool, true, 'frame-end'),
|
|
474
|
+
];
|
|
475
|
+
}
|
|
476
|
+
return result;
|
|
431
477
|
}
|
|
432
478
|
}
|
|
433
479
|
function transitionHyperlink(diff, current, target) {
|
|
@@ -507,6 +553,22 @@ function fullResetSequence_CAUSES_FLICKER(frame, reason, stylePool, debug) {
|
|
|
507
553
|
* bottom row, which no known writer produces.)
|
|
508
554
|
*/
|
|
509
555
|
function repaintViewportInPlace(prev, next, stylePool) {
|
|
556
|
+
return viewportRepaintPatches(prev, next, stylePool, false, 'viewport-bottom');
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Patches that rewrite the visible viewport in place, then paint the frame
|
|
560
|
+
* tail top-to-bottom. See repaintViewportInPlace for the layout rationale.
|
|
561
|
+
*
|
|
562
|
+
* When these patches are APPENDED to an incremental diff (rather than being
|
|
563
|
+
* the whole frame), the incremental writes may have left an SGR style and/or
|
|
564
|
+
* an OSC 8 hyperlink open; `resetPrefix` then prepends SGR_RESET + link('')
|
|
565
|
+
* so the ED0 BCE fill and the slice's style/hyperlink transitions start from
|
|
566
|
+
* a clean state. In that path the physical cursor is at the frame end, so a
|
|
567
|
+
* short frame must move up only its visible row count. Moving up V-1 rows
|
|
568
|
+
* would clamp at the terminal top, erase shell history above the application,
|
|
569
|
+
* and relocate the application to the top of the viewport.
|
|
570
|
+
*/
|
|
571
|
+
function viewportRepaintPatches(prev, next, stylePool, resetPrefix, origin) {
|
|
510
572
|
const viewportHeight = prev.viewport.height;
|
|
511
573
|
const height = next.screen.height;
|
|
512
574
|
// The bottom viewport row stays reserved for the cursor park; content
|
|
@@ -514,13 +576,18 @@ function repaintViewportInPlace(prev, next, stylePool) {
|
|
|
514
576
|
// steady state, where the park LF materializes one row below the frame).
|
|
515
577
|
const contentRows = Math.min(height, viewportHeight - 1);
|
|
516
578
|
const startY = height - contentRows;
|
|
517
|
-
//
|
|
518
|
-
//
|
|
519
|
-
//
|
|
520
|
-
//
|
|
521
|
-
//
|
|
522
|
-
//
|
|
523
|
-
|
|
579
|
+
// A standalone recovery starts at the parked physical bottom row and must
|
|
580
|
+
// reach the viewport top. An appended repaint starts at next.cursor (the
|
|
581
|
+
// frame end), so moving up contentRows reaches the actual visible-frame
|
|
582
|
+
// start for both short and overflowing frames without crossing into shell
|
|
583
|
+
// history. Erase down from there (BCE fill — the SGR reset guarantees the
|
|
584
|
+
// default background). The erase also blanks the park row, so no stale
|
|
585
|
+
// prompt/status pixels survive below short content.
|
|
586
|
+
const rowsToStart = origin === 'viewport-bottom' ? viewportHeight - 1 : contentRows;
|
|
587
|
+
const anchor = (resetPrefix ? SGR_RESET + LINK_END : '') +
|
|
588
|
+
'\r' +
|
|
589
|
+
cursorUp(rowsToStart) +
|
|
590
|
+
eraseToEndOfScreen();
|
|
524
591
|
const screen = new VirtualScreen({ x: 0, y: startY }, next.viewport.width);
|
|
525
592
|
renderFrameSlice(screen, next, startY, height, stylePool);
|
|
526
593
|
return [{ type: 'stdout', content: anchor }, ...screen.diff];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-keypress.d.ts","sourceRoot":"","sources":["../../../src/ink/parse-keypress.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAkJtE,gDAAgD;AAChD,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAA;AAEV;;;GAGG;AACH,MAAM,MAAM,gBAAgB;AAC1B,iEAAiE;AAC/D;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAClD,oEAAoE;GAClE;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE;AACnC,+DAA+D;GAC7D;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE;AACnC,iEAAiE;GAC/D;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AAC1C,sDAAsD;GACpD;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE;AACtD,kFAAkF;GAChF;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AAC7C;wEACwE;GACtE;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAyTvC,iEAAiE;AACjE,MAAM,MAAM,eA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Ac,CAAA"}
|
|
@@ -542,7 +542,10 @@ export function parseMultipleKeypresses(prevState, input = '') {
|
|
|
542
542
|
const isFlush = input === null;
|
|
543
543
|
const inputString = isFlush ? '' : inputToString(input);
|
|
544
544
|
// Get or create tokenizer
|
|
545
|
-
const tokenizer = prevState._tokenizer ?? createTokenizer({
|
|
545
|
+
const tokenizer = prevState._tokenizer ?? createTokenizer({
|
|
546
|
+
x10Mouse: true,
|
|
547
|
+
splitInputControls: true,
|
|
548
|
+
});
|
|
546
549
|
// Tokenize the input
|
|
547
550
|
const tokens = isFlush ? tokenizer.flush() : tokenizer.feed(inputString);
|
|
548
551
|
// Convert tokens to parsed keys, handling paste mode
|
|
@@ -18,6 +18,20 @@ export type Progress = {
|
|
|
18
18
|
* @returns true when the terminal supports OSC 9;4 progress reporting.
|
|
19
19
|
*/
|
|
20
20
|
export declare function isProgressReportingAvailable(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* True when running inside a JetBrains IDE terminal (JediTerm). The IDE
|
|
23
|
+
* injects `TERMINAL_EMULATOR=JetBrains-JediTerm` into the pty environment of
|
|
24
|
+
* its local terminal sessions and sets no TERM_PROGRAM, so this is the only
|
|
25
|
+
* reliable local-JediTerm marker; it is also not forwarded over SSH by
|
|
26
|
+
* default (sshd only sends TERM), matching the local-terminal scope of the
|
|
27
|
+
* behaviors it gates.
|
|
28
|
+
*
|
|
29
|
+
* JediTerm's emulation diverges from xterm.js in exactly the places the
|
|
30
|
+
* renderer cares about (DEC 2026 support, DECSTBM semantics), so it is
|
|
31
|
+
* detected explicitly rather than left to TERM/TERM_PROGRAM fallbacks.
|
|
32
|
+
* @returns true when the process runs in a JetBrains IDE terminal.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isJetBrainsIdeTerminal(): boolean;
|
|
21
35
|
/**
|
|
22
36
|
* Checks if the terminal supports DEC mode 2026 (synchronized output).
|
|
23
37
|
* When supported, BSU/ESU sequences prevent visible flicker during redraws.
|
|
@@ -53,16 +67,23 @@ export declare function supportsExtendedKeys(): boolean;
|
|
|
53
67
|
/**
|
|
54
68
|
* True when win32-input-mode (DECSET 9001, `CSI ? 9001 h`) should drive
|
|
55
69
|
* keyboard input. This is a ConPTY feature — both Windows Terminal and
|
|
56
|
-
* classic conhost switch into it when the app emits the sequence
|
|
57
|
-
*
|
|
58
|
-
*
|
|
70
|
+
* classic conhost switch into it when the app emits the sequence. In this
|
|
71
|
+
* mode every key arrives as a full INPUT_RECORD
|
|
72
|
+
* (`CSI Vk;Sc;Uc;Kd;Cs;Rc _`), the only encoding that
|
|
59
73
|
* preserves Enter's Shift/Ctrl bits on Windows (issue #147). It replaces
|
|
60
74
|
* the kitty/modifyOtherKeys push — callers must treat them as mutually
|
|
61
75
|
* exclusive. Non-ConPTY Windows terminals (mintty via winpty) ignore the
|
|
62
76
|
* unknown private mode and fall back to classic VT input unchanged.
|
|
77
|
+
*
|
|
78
|
+
* Embedded xterm.js hosts may identify as `TERM_PROGRAM=vscode` while using
|
|
79
|
+
* the xterm.js engine version as TERM_PROGRAM_VERSION (Termy 1.4.1 reports
|
|
80
|
+
* 6.0.0). They do not provide native ConPTY's input-mode contract: enabling
|
|
81
|
+
* 9001 can reduce arrows/mouse sequences to their trailing A-D/M bytes and
|
|
82
|
+
* interfere with IME commits (issue #215). Native VS Code reports its own
|
|
83
|
+
* 1.x application version and retains win32-input-mode support.
|
|
63
84
|
* @returns true on native Windows (never in WSL — platform is linux there).
|
|
64
85
|
*/
|
|
65
|
-
export declare function supportsWin32InputMode(): boolean;
|
|
86
|
+
export declare function supportsWin32InputMode(platform?: NodeJS.Platform, termProgram?: string | undefined, termProgramVersion?: string | undefined): boolean;
|
|
66
87
|
/**
|
|
67
88
|
* True if the terminal scrolls the viewport when it receives cursor-up
|
|
68
89
|
* sequences that reach above the visible area. On Windows, conhost's
|
|
@@ -79,6 +100,21 @@ export declare function hasCursorUpViewportYankBug(): boolean;
|
|
|
79
100
|
* so callers can pass a sync-skip hint gated to specific modes.
|
|
80
101
|
*/
|
|
81
102
|
export declare const SYNC_OUTPUT_SUPPORTED: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Whether the DECSTBM hardware-scroll optimization may be used to paint
|
|
105
|
+
* ScrollBox scrolls. Called once per frame — the same env reads as the
|
|
106
|
+
* SYNC_OUTPUT_SUPPORTED gate, so the extra cost is a single comparison.
|
|
107
|
+
*
|
|
108
|
+
* JediTerm is explicitly excluded even though it implements DEC 2026: its
|
|
109
|
+
* scroll-region (DECSTBM) + CSI S/T handling deviates from xterm and, when
|
|
110
|
+
* driven per-frame by a diffing renderer, corrupts the screen progressively
|
|
111
|
+
* as content scrolls (the "JetBrains terminal slowly garbles" bug class).
|
|
112
|
+
* The diff engine falls back to repainting the shifted rows cell-by-cell,
|
|
113
|
+
* which every terminal renders identically. Same gate as upstream Claude
|
|
114
|
+
* Code, which hard-disables DECSTBM on JetBrains terminals.
|
|
115
|
+
* @returns true when DECSTBM scroll optimization is safe on this terminal.
|
|
116
|
+
*/
|
|
117
|
+
export declare function isDecstbmSafe(): boolean;
|
|
82
118
|
/**
|
|
83
119
|
* The output streams a terminal renders to.
|
|
84
120
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../../src/ink/terminal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAKtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAKtC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,eAAe,CAAA;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,IAAI,OAAO,CAuCtD;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"terminal.d.ts","s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C,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,eAAe,UAAQ,GACtB,IAAI,CAqEN"}
|
|
@@ -48,6 +48,22 @@ export function isProgressReportingAvailable() {
|
|
|
48
48
|
}
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* True when running inside a JetBrains IDE terminal (JediTerm). The IDE
|
|
53
|
+
* injects `TERMINAL_EMULATOR=JetBrains-JediTerm` into the pty environment of
|
|
54
|
+
* its local terminal sessions and sets no TERM_PROGRAM, so this is the only
|
|
55
|
+
* reliable local-JediTerm marker; it is also not forwarded over SSH by
|
|
56
|
+
* default (sshd only sends TERM), matching the local-terminal scope of the
|
|
57
|
+
* behaviors it gates.
|
|
58
|
+
*
|
|
59
|
+
* JediTerm's emulation diverges from xterm.js in exactly the places the
|
|
60
|
+
* renderer cares about (DEC 2026 support, DECSTBM semantics), so it is
|
|
61
|
+
* detected explicitly rather than left to TERM/TERM_PROGRAM fallbacks.
|
|
62
|
+
* @returns true when the process runs in a JetBrains IDE terminal.
|
|
63
|
+
*/
|
|
64
|
+
export function isJetBrainsIdeTerminal() {
|
|
65
|
+
return process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
|
|
66
|
+
}
|
|
51
67
|
/**
|
|
52
68
|
* Checks if the terminal supports DEC mode 2026 (synchronized output).
|
|
53
69
|
* When supported, BSU/ESU sequences prevent visible flicker during redraws.
|
|
@@ -71,6 +87,14 @@ export function isSynchronizedOutputSupported() {
|
|
|
71
87
|
termProgram === 'alacritty') {
|
|
72
88
|
return true;
|
|
73
89
|
}
|
|
90
|
+
// JetBrains IDE terminals (JediTerm) implement DEC 2026 synchronized
|
|
91
|
+
// output; TERM_PROGRAM is unset there (only TERMINAL_EMULATOR is), so the
|
|
92
|
+
// env list above never matches. Frames wrapped in BSU/ESU land atomically
|
|
93
|
+
// in JediTerm's reworked block renderer — the same guarantee VS Code gets
|
|
94
|
+
// via TERM_PROGRAM=vscode — which keeps its partial-update reflow from
|
|
95
|
+
// scrambling continuously-updated screens.
|
|
96
|
+
if (isJetBrainsIdeTerminal())
|
|
97
|
+
return true;
|
|
74
98
|
// kitty sets TERM=xterm-kitty or KITTY_WINDOW_ID
|
|
75
99
|
if (term?.includes('kitty') || process.env.KITTY_WINDOW_ID)
|
|
76
100
|
return true;
|
|
@@ -170,17 +194,28 @@ export function supportsExtendedKeys() {
|
|
|
170
194
|
/**
|
|
171
195
|
* True when win32-input-mode (DECSET 9001, `CSI ? 9001 h`) should drive
|
|
172
196
|
* keyboard input. This is a ConPTY feature — both Windows Terminal and
|
|
173
|
-
* classic conhost switch into it when the app emits the sequence
|
|
174
|
-
*
|
|
175
|
-
*
|
|
197
|
+
* classic conhost switch into it when the app emits the sequence. In this
|
|
198
|
+
* mode every key arrives as a full INPUT_RECORD
|
|
199
|
+
* (`CSI Vk;Sc;Uc;Kd;Cs;Rc _`), the only encoding that
|
|
176
200
|
* preserves Enter's Shift/Ctrl bits on Windows (issue #147). It replaces
|
|
177
201
|
* the kitty/modifyOtherKeys push — callers must treat them as mutually
|
|
178
202
|
* exclusive. Non-ConPTY Windows terminals (mintty via winpty) ignore the
|
|
179
203
|
* unknown private mode and fall back to classic VT input unchanged.
|
|
204
|
+
*
|
|
205
|
+
* Embedded xterm.js hosts may identify as `TERM_PROGRAM=vscode` while using
|
|
206
|
+
* the xterm.js engine version as TERM_PROGRAM_VERSION (Termy 1.4.1 reports
|
|
207
|
+
* 6.0.0). They do not provide native ConPTY's input-mode contract: enabling
|
|
208
|
+
* 9001 can reduce arrows/mouse sequences to their trailing A-D/M bytes and
|
|
209
|
+
* interfere with IME commits (issue #215). Native VS Code reports its own
|
|
210
|
+
* 1.x application version and retains win32-input-mode support.
|
|
180
211
|
* @returns true on native Windows (never in WSL — platform is linux there).
|
|
181
212
|
*/
|
|
182
|
-
export function supportsWin32InputMode() {
|
|
183
|
-
|
|
213
|
+
export function supportsWin32InputMode(platform = process.platform, termProgram = process.env.TERM_PROGRAM, termProgramVersion = process.env.TERM_PROGRAM_VERSION) {
|
|
214
|
+
if (platform !== 'win32')
|
|
215
|
+
return false;
|
|
216
|
+
const version = coerce(termProgramVersion);
|
|
217
|
+
const isEmbeddedXtermJs = termProgram === 'vscode' && version !== null && version.major >= 5;
|
|
218
|
+
return !isEmbeddedXtermJs;
|
|
184
219
|
}
|
|
185
220
|
/**
|
|
186
221
|
* True if the terminal scrolls the viewport when it receives cursor-up
|
|
@@ -200,6 +235,23 @@ export function hasCursorUpViewportYankBug() {
|
|
|
200
235
|
* so callers can pass a sync-skip hint gated to specific modes.
|
|
201
236
|
*/
|
|
202
237
|
export const SYNC_OUTPUT_SUPPORTED = isSynchronizedOutputSupported();
|
|
238
|
+
/**
|
|
239
|
+
* Whether the DECSTBM hardware-scroll optimization may be used to paint
|
|
240
|
+
* ScrollBox scrolls. Called once per frame — the same env reads as the
|
|
241
|
+
* SYNC_OUTPUT_SUPPORTED gate, so the extra cost is a single comparison.
|
|
242
|
+
*
|
|
243
|
+
* JediTerm is explicitly excluded even though it implements DEC 2026: its
|
|
244
|
+
* scroll-region (DECSTBM) + CSI S/T handling deviates from xterm and, when
|
|
245
|
+
* driven per-frame by a diffing renderer, corrupts the screen progressively
|
|
246
|
+
* as content scrolls (the "JetBrains terminal slowly garbles" bug class).
|
|
247
|
+
* The diff engine falls back to repainting the shifted rows cell-by-cell,
|
|
248
|
+
* which every terminal renders identically. Same gate as upstream Claude
|
|
249
|
+
* Code, which hard-disables DECSTBM on JetBrains terminals.
|
|
250
|
+
* @returns true when DECSTBM scroll optimization is safe on this terminal.
|
|
251
|
+
*/
|
|
252
|
+
export function isDecstbmSafe() {
|
|
253
|
+
return SYNC_OUTPUT_SUPPORTED && !isJetBrainsIdeTerminal();
|
|
254
|
+
}
|
|
203
255
|
/**
|
|
204
256
|
* Render forensics: when DSH_TUI_RENDER_LOG names a file path, every painted
|
|
205
257
|
* frame's raw ANSI bytes append to it (one JSON-escaped line per frame,
|
|
@@ -31,6 +31,12 @@ type TokenizerOptions = {
|
|
|
31
31
|
* output streams, and enabling this there swallows display text. Default false.
|
|
32
32
|
*/
|
|
33
33
|
x10Mouse?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Emit standalone C0/DEL input controls as sequence tokens instead of
|
|
36
|
+
* merging them with adjacent text. Intended for stdin key parsing; output
|
|
37
|
+
* parsers leave this disabled so controls such as BEL and Tab remain text.
|
|
38
|
+
*/
|
|
39
|
+
splitInputControls?: boolean;
|
|
34
40
|
};
|
|
35
41
|
/**
|
|
36
42
|
* Create a streaming tokenizer for terminal input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenize.d.ts","sourceRoot":"","sources":["../../../../src/ink/termio/tokenize.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,sEAAsE;AACtE,MAAM,MAAM,KAAK,GACb;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAYvC,8EAA8E;AAC9E,MAAM,MAAM,SAAS,GAAG;IACtB,0CAA0C;IAC1C,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,CAAA;IAC5B,8CAA8C;IAC9C,KAAK,IAAI,KAAK,EAAE,CAAA;IAChB,4BAA4B;IAC5B,KAAK,IAAI,IAAI,CAAA;IACb,2CAA2C;IAC3C,MAAM,IAAI,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,gBAAgB,GAAG;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"tokenize.d.ts","sourceRoot":"","sources":["../../../../src/ink/termio/tokenize.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,sEAAsE;AACtE,MAAM,MAAM,KAAK,GACb;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAYvC,8EAA8E;AAC9E,MAAM,MAAM,SAAS,GAAG;IACtB,0CAA0C;IAC1C,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,CAAA;IAC5B,8CAA8C;IAC9C,KAAK,IAAI,KAAK,EAAE,CAAA;IAChB,4BAA4B;IAC5B,KAAK,IAAI,IAAI,CAAA;IACb,2CAA2C;IAC3C,MAAM,IAAI,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,gBAAgB,GAAG;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS,CA4CrE"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Unlike the Parser which interprets sequences semantically, this just
|
|
6
6
|
* identifies boundaries for use by keyboard input parsing.
|
|
7
7
|
*/
|
|
8
|
-
import { C0, ESC_TYPE, isEscFinal } from './ansi.js';
|
|
8
|
+
import { C0, ESC_TYPE, isC0, isEscFinal } from './ansi.js';
|
|
9
9
|
import { isCSIFinal, isCSIIntermediate, isCSIParam } from './csi.js';
|
|
10
10
|
/**
|
|
11
11
|
* Create a streaming tokenizer for terminal input.
|
|
@@ -24,15 +24,16 @@ export function createTokenizer(options) {
|
|
|
24
24
|
let currentState = 'ground';
|
|
25
25
|
let currentBuffer = '';
|
|
26
26
|
const x10Mouse = options?.x10Mouse ?? false;
|
|
27
|
+
const splitInputControls = options?.splitInputControls ?? false;
|
|
27
28
|
return {
|
|
28
29
|
feed(input) {
|
|
29
|
-
const result = tokenize(input, currentState, currentBuffer, false, x10Mouse);
|
|
30
|
+
const result = tokenize(input, currentState, currentBuffer, false, x10Mouse, splitInputControls);
|
|
30
31
|
currentState = result.state.state;
|
|
31
32
|
currentBuffer = result.state.buffer;
|
|
32
33
|
return result.tokens;
|
|
33
34
|
},
|
|
34
35
|
flush() {
|
|
35
|
-
const result = tokenize('', currentState, currentBuffer, true, x10Mouse);
|
|
36
|
+
const result = tokenize('', currentState, currentBuffer, true, x10Mouse, splitInputControls);
|
|
36
37
|
currentState = result.state.state;
|
|
37
38
|
currentBuffer = result.state.buffer;
|
|
38
39
|
return result.tokens;
|
|
@@ -46,7 +47,7 @@ export function createTokenizer(options) {
|
|
|
46
47
|
},
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
|
-
function tokenize(input, initialState, initialBuffer, flush, x10Mouse) {
|
|
50
|
+
function tokenize(input, initialState, initialBuffer, flush, x10Mouse, splitInputControls) {
|
|
50
51
|
const tokens = [];
|
|
51
52
|
const result = {
|
|
52
53
|
state: initialState,
|
|
@@ -82,6 +83,19 @@ function tokenize(input, initialState, initialBuffer, flush, x10Mouse) {
|
|
|
82
83
|
result.state = 'escape';
|
|
83
84
|
i++;
|
|
84
85
|
}
|
|
86
|
+
else if (splitInputControls &&
|
|
87
|
+
isC0(code) &&
|
|
88
|
+
code !== C0.CR &&
|
|
89
|
+
code !== C0.LF) {
|
|
90
|
+
// stdin.read() can coalesce printable text and interactive control
|
|
91
|
+
// keys into one chunk. Keep Backspace, Tab, Ctrl+C, etc. as their
|
|
92
|
+
// own tokens so parseKeypress can expose the corresponding key
|
|
93
|
+
// flags instead of leaking the control byte into prompt text.
|
|
94
|
+
// CR/LF stay in text chunks for the Windows piped-line fallback.
|
|
95
|
+
flushText();
|
|
96
|
+
i++;
|
|
97
|
+
emitSequence(data.slice(i - 1, i));
|
|
98
|
+
}
|
|
85
99
|
else {
|
|
86
100
|
i++;
|
|
87
101
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../../src/jsx-runtime.ts"],"names":[],"mappings":"AAYA,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Host JSX factory for plugin scenes: re-exports the TUI's OWN
|
|
2
|
+
// react/jsx-runtime, so JSX a plugin compiles against this subpath produces
|
|
3
|
+
// React 19 elements (`Symbol.for('react.transitional.element')`) — the only
|
|
4
|
+
// element flavor this app's reconciler accepts. A plugin bundling its own
|
|
5
|
+
// older React emits `Symbol.for('react.element')` and dies on first render.
|
|
6
|
+
//
|
|
7
|
+
// Plugin tsconfig:
|
|
8
|
+
// "jsx": "react-jsx",
|
|
9
|
+
// "jsxImportSource": "@deepseek-harness-tui/dsh-tui"
|
|
10
|
+
//
|
|
11
|
+
// Hooks still come from the scene props' injected `React` — this module
|
|
12
|
+
// covers element creation only.
|
|
13
|
+
export * from 'react/jsx-runtime';
|
|
@@ -61,8 +61,16 @@ export declare function recordedModelRoute(events: readonly {
|
|
|
61
61
|
* Best-effort combination check (issue #67): when the llm runtime advertises
|
|
62
62
|
* a non-empty catalog for the route's provider and the model is not in it,
|
|
63
63
|
* reject the whole route in favor of `fallback` so a stale persisted choice
|
|
64
|
-
* surfaces at startup instead of as a server-side model-name error.
|
|
65
|
-
*
|
|
64
|
+
* surfaces at startup instead of as a server-side model-name error.
|
|
65
|
+
*
|
|
66
|
+
* Uncertainty trusts the route — no llm service, an empty catalog, a catalog
|
|
67
|
+
* read that failed for transport or adapter-internal reasons. An unregistered
|
|
68
|
+
* PROVIDER is not uncertainty: no adapter owns the name, so the route is
|
|
69
|
+
* proven unusable and falls back exactly like an unknown model does. Trusting
|
|
70
|
+
* it does not keep startup alive either — agent creation dies a few frames
|
|
71
|
+
* later inside the preset setup hook, reported as `refusing to compose an
|
|
72
|
+
* unscoped context`, which names neither the provider nor the stale
|
|
73
|
+
* preference that chose it.
|
|
66
74
|
* @param llm - The llm runtime seam, when mounted.
|
|
67
75
|
* @param route - The resolved route to check.
|
|
68
76
|
* @param fallback - Route to adopt when the check rejects.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modelRoute.d.ts","sourceRoot":"","sources":["../../src/modelRoute.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,gCAAgC;AAChC,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,wHAAwH;AACxH,eAAO,MAAM,mBAAmB,EAAE,UAGjC,CAAA;AAID;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,GAAG,SAAS,CAI5G;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EACjD,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,QAAQ,GAAE,UAAgC,GACzC,UAAU,CAKZ;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,GAClD,UAAU,GAAG,SAAS,CAWxB;
|
|
1
|
+
{"version":3,"file":"modelRoute.d.ts","sourceRoot":"","sources":["../../src/modelRoute.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,gCAAgC;AAChC,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,wHAAwH;AACxH,eAAO,MAAM,mBAAmB,EAAE,UAGjC,CAAA;AAID;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,GAAG,SAAS,CAI5G;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EACjD,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,QAAQ,GAAE,UAAgC,GACzC,UAAU,CAKZ;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,GAClD,UAAU,GAAG,SAAS,CAWxB;AAyBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE;IAAE,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC,CAAA;CAAE,GAAG,SAAS,EACrF,KAAK,EAAE,UAAU,EACjB,QAAQ,GAAE,UAAgC,GACzC,OAAO,CAAC;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC,CAWvD"}
|
package/lib/types/modelRoute.js
CHANGED
|
@@ -69,12 +69,39 @@ export function recordedModelRoute(events) {
|
|
|
69
69
|
}
|
|
70
70
|
return undefined;
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* `LlmError` code the adapter registry raises for a provider nobody
|
|
74
|
+
* registered. Matched on the code rather than `instanceof LlmError`: a profile
|
|
75
|
+
* that resolves two copies of the llm package would fail the identity check
|
|
76
|
+
* while the code stays stable, and this module deliberately carries no llm
|
|
77
|
+
* import.
|
|
78
|
+
*/
|
|
79
|
+
const NO_ADAPTER_CODE = 'NO_ADAPTER';
|
|
80
|
+
/**
|
|
81
|
+
* Whether a catalog read failed because the provider itself is unregistered,
|
|
82
|
+
* as opposed to a transport or adapter-internal failure.
|
|
83
|
+
* @param error - The value `listModels` rejected with.
|
|
84
|
+
* @returns True when no adapter owns the queried provider.
|
|
85
|
+
*/
|
|
86
|
+
function isUnregisteredProvider(error) {
|
|
87
|
+
return (typeof error === 'object'
|
|
88
|
+
&& error !== null
|
|
89
|
+
&& error.code === NO_ADAPTER_CODE);
|
|
90
|
+
}
|
|
72
91
|
/**
|
|
73
92
|
* Best-effort combination check (issue #67): when the llm runtime advertises
|
|
74
93
|
* a non-empty catalog for the route's provider and the model is not in it,
|
|
75
94
|
* reject the whole route in favor of `fallback` so a stale persisted choice
|
|
76
|
-
* surfaces at startup instead of as a server-side model-name error.
|
|
77
|
-
*
|
|
95
|
+
* surfaces at startup instead of as a server-side model-name error.
|
|
96
|
+
*
|
|
97
|
+
* Uncertainty trusts the route — no llm service, an empty catalog, a catalog
|
|
98
|
+
* read that failed for transport or adapter-internal reasons. An unregistered
|
|
99
|
+
* PROVIDER is not uncertainty: no adapter owns the name, so the route is
|
|
100
|
+
* proven unusable and falls back exactly like an unknown model does. Trusting
|
|
101
|
+
* it does not keep startup alive either — agent creation dies a few frames
|
|
102
|
+
* later inside the preset setup hook, reported as `refusing to compose an
|
|
103
|
+
* unscoped context`, which names neither the provider nor the stale
|
|
104
|
+
* preference that chose it.
|
|
78
105
|
* @param llm - The llm runtime seam, when mounted.
|
|
79
106
|
* @param route - The resolved route to check.
|
|
80
107
|
* @param fallback - Route to adopt when the check rejects.
|
|
@@ -87,8 +114,10 @@ export async function validateModelRoute(llm, route, fallback = DEFAULT_MODEL_RO
|
|
|
87
114
|
try {
|
|
88
115
|
models = await llm.listModels(route.provider);
|
|
89
116
|
}
|
|
90
|
-
catch {
|
|
91
|
-
|
|
117
|
+
catch (error) {
|
|
118
|
+
if (!isUnregisteredProvider(error))
|
|
119
|
+
return { route };
|
|
120
|
+
return { route: fallback, rejected: route };
|
|
92
121
|
}
|
|
93
122
|
if (models.length === 0 || models.some(model => model.id === route.model))
|
|
94
123
|
return { route };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenes.d.ts","sourceRoot":"","sources":["../../src/scenes.ts"],"names":[],"mappings":"AAEA,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/screens/Chat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/screens/Chat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,OAAO,EAAqB,KAAK,OAAO,EAAsE,MAAM,2BAA2B,CAAA;AAC/I,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AA6H3D,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,aAAa,EACb,aAAa,EACb,MAAM,EACN,QAAQ,EACR,UAAkB,EAClB,cAAc,EAAE,kBAAkB,GACnC,EAAE;IACD,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,aAAa,CAAA;IAC5B;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,qBAq9DA"}
|