@deepseek-harness-tui/dsh-tui 0.7.0 → 0.7.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.
- package/README.md +9 -6
- package/bin/dsh-tui.js +67 -14
- package/cordis.patch.yml +10 -0
- package/lib/types/commands.js +1 -1
- package/lib/types/components/LoadedContextPanel.d.ts.map +1 -1
- package/lib/types/components/LoadedContextPanel.js +1 -1
- package/lib/types/components/design-system/ThemedText.d.ts +2 -2
- package/lib/types/components/design-system/ThemedText.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemedText.js +1 -3
- package/lib/types/components/sessions/SessionListRow.d.ts +26 -0
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -0
- package/lib/types/components/sessions/SessionListRow.js +35 -0
- package/lib/types/components/sessions/SessionPreview.d.ts +25 -0
- package/lib/types/components/sessions/SessionPreview.d.ts.map +1 -0
- package/lib/types/components/sessions/SessionPreview.js +60 -0
- package/lib/types/dsh-adapter/channel.d.ts +23 -4
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +190 -75
- package/lib/types/dsh-adapter/compat/index.d.ts +1 -1
- package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/index.js +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +8 -0
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.js +1 -1
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +10 -1
- package/lib/types/dsh-adapter/packaged-presets.d.ts +22 -0
- package/lib/types/dsh-adapter/packaged-presets.d.ts.map +1 -0
- package/lib/types/dsh-adapter/packaged-presets.js +90 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +60 -4
- package/lib/types/dsh-adapter/presets.d.ts +16 -0
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +23 -0
- package/lib/types/dsh-adapter/sessions/digest.d.ts +29 -0
- package/lib/types/dsh-adapter/sessions/digest.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessions/digest.js +224 -0
- package/lib/types/dsh-adapter/sessions/frames.d.ts +100 -0
- package/lib/types/dsh-adapter/sessions/frames.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessions/frames.js +246 -0
- package/lib/types/dsh-adapter/sessions/header.d.ts +50 -0
- package/lib/types/dsh-adapter/sessions/header.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessions/header.js +62 -0
- package/lib/types/dsh-adapter/sessions/index.d.ts +17 -0
- package/lib/types/dsh-adapter/sessions/index.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessions/index.js +15 -0
- package/lib/types/dsh-adapter/sessions/list.d.ts +41 -0
- package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessions/list.js +213 -0
- package/lib/types/dsh-adapter/sessions/store.d.ts +48 -0
- package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessions/store.js +164 -0
- package/lib/types/dsh-adapter/sessions/types.d.ts +142 -0
- package/lib/types/dsh-adapter/sessions/types.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessions/types.js +14 -0
- package/lib/types/i18n.d.ts +122 -14
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +37 -6
- package/lib/types/screens/Chat.d.ts +3 -2
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +28 -144
- package/lib/types/screens/SessionBrowser.d.ts +37 -0
- package/lib/types/screens/SessionBrowser.d.ts.map +1 -0
- package/lib/types/screens/SessionBrowser.js +437 -0
- package/lib/types/sessionHistory.d.ts +0 -8
- package/lib/types/sessionHistory.d.ts.map +1 -1
- package/lib/types/sessions/format.d.ts +117 -0
- package/lib/types/sessions/format.d.ts.map +1 -0
- package/lib/types/sessions/format.js +244 -0
- package/lib/types/sessions/view.d.ts +125 -0
- package/lib/types/sessions/view.d.ts.map +1 -0
- package/lib/types/sessions/view.js +222 -0
- package/package.json +12 -5
- package/presets/liangshen/.dsh-tui-managed.json +5 -0
- package/presets/liangshen/agent.cordis.yml +389 -0
- package/presets/liangshen/compaction-epoch.mjs +81 -0
- package/presets/liangshen/custom-bash.mjs +126 -0
- package/presets/liangshen/instruction-hint.mjs +181 -0
- package/presets/liangshen/preset.yml +3 -0
- package/presets/liangshen/skill-search.mjs +142 -0
- package/presets/liangshen/tool-bootstrap.mjs +300 -0
- package/lib/invariant.js +0 -28
- package/lib/types/components/ResumePicker.d.ts +0 -26
- package/lib/types/components/ResumePicker.d.ts.map +0 -1
- package/lib/types/components/ResumePicker.js +0 -50
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { SessionRecord } from '../sessionHistory.js';
|
|
3
|
-
/** Interaction mode of the `/resume` picker (issue #112). */
|
|
4
|
-
export type ResumePickerMode = 'list' | 'confirm-delete' | 'rename';
|
|
5
|
-
/**
|
|
6
|
-
* `/resume` session picker in the CC ModelPicker style: a Pane with the
|
|
7
|
-
* recent sessions as Select rows (title + time description, ✓ on the
|
|
8
|
-
* current session), plus the hint line. Only WINDOW rows render; the window
|
|
9
|
-
* follows the focused row, with `↑ N more` / `↓ N more` markers at the
|
|
10
|
-
* edges.
|
|
11
|
-
*
|
|
12
|
-
* Beyond plain selection (pi-tui style session management, issue #112):
|
|
13
|
-
* - `confirm-delete` replaces the hints with a delete confirmation for the
|
|
14
|
-
* focused session (Enter deletes, Esc backs out);
|
|
15
|
-
* - `rename` shows an inline SearchBox editing the focused session's title
|
|
16
|
-
* (Enter saves, Esc discards).
|
|
17
|
-
* Keyboard handling lives in the caller (Chat).
|
|
18
|
-
*/
|
|
19
|
-
export declare function ResumePicker({ sessions, focusIndex, currentSessionId, mode, renameText, }: {
|
|
20
|
-
sessions: readonly SessionRecord[];
|
|
21
|
-
focusIndex: number;
|
|
22
|
-
currentSessionId: string;
|
|
23
|
-
mode: ResumePickerMode;
|
|
24
|
-
renameText: string;
|
|
25
|
-
}): React.ReactNode;
|
|
26
|
-
//# sourceMappingURL=ResumePicker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResumePicker.d.ts","sourceRoot":"","sources":["../../../src/components/ResumePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAuBzD,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,gBAAgB,GAAG,QAAQ,CAAA;AAEnE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,IAAI,EACJ,UAAU,GACX,EAAE;IACD,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAA;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,IAAI,EAAE,gBAAgB,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;CACnB,GAAG,KAAK,CAAC,SAAS,CAsElB"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from '../ui.js';
|
|
3
|
-
import { useTerminalFocus } from '../ink/hooks/use-terminal-focus.js';
|
|
4
|
-
import { t, getLang } from '../i18n.js';
|
|
5
|
-
import { Pane } from './design-system/Pane.js';
|
|
6
|
-
import { ListItem } from './design-system/ListItem.js';
|
|
7
|
-
import { HintLine } from './design-system/HintLine.js';
|
|
8
|
-
import { SearchBox } from './SearchBox.js';
|
|
9
|
-
import { modLabel } from '../utils/modifiers.js';
|
|
10
|
-
/** Compact timestamp like `Jan 2, 03:04` (en) / `1月2日 03:04` (zh). */
|
|
11
|
-
function formatTimestamp(ms) {
|
|
12
|
-
const date = new Date(ms);
|
|
13
|
-
return date.toLocaleString(getLang() === 'zh' ? 'zh-CN' : 'en-US', {
|
|
14
|
-
month: 'short',
|
|
15
|
-
day: 'numeric',
|
|
16
|
-
hour: '2-digit',
|
|
17
|
-
minute: '2-digit',
|
|
18
|
-
hour12: false,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
/** Visible list window: the picker scrolls instead of dumping every session
|
|
22
|
-
* (long histories would fill the whole screen otherwise). */
|
|
23
|
-
const WINDOW = 8;
|
|
24
|
-
/**
|
|
25
|
-
* `/resume` session picker in the CC ModelPicker style: a Pane with the
|
|
26
|
-
* recent sessions as Select rows (title + time description, ✓ on the
|
|
27
|
-
* current session), plus the hint line. Only WINDOW rows render; the window
|
|
28
|
-
* follows the focused row, with `↑ N more` / `↓ N more` markers at the
|
|
29
|
-
* edges.
|
|
30
|
-
*
|
|
31
|
-
* Beyond plain selection (pi-tui style session management, issue #112):
|
|
32
|
-
* - `confirm-delete` replaces the hints with a delete confirmation for the
|
|
33
|
-
* focused session (Enter deletes, Esc backs out);
|
|
34
|
-
* - `rename` shows an inline SearchBox editing the focused session's title
|
|
35
|
-
* (Enter saves, Esc discards).
|
|
36
|
-
* Keyboard handling lives in the caller (Chat).
|
|
37
|
-
*/
|
|
38
|
-
export function ResumePicker({ sessions, focusIndex, currentSessionId, mode, renameText, }) {
|
|
39
|
-
const isTerminalFocused = useTerminalFocus();
|
|
40
|
-
const start = Math.max(0, Math.min(focusIndex - Math.floor(WINDOW / 2), sessions.length - WINDOW));
|
|
41
|
-
const visible = sessions.slice(start, start + WINDOW);
|
|
42
|
-
const above = start;
|
|
43
|
-
const below = Math.max(0, sessions.length - (start + WINDOW));
|
|
44
|
-
const focused = sessions[focusIndex];
|
|
45
|
-
return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: t('resume-title') }) }), above > 0 && (_jsx(Text, { dimColor: true, italic: true, children: t('resume-more-above', { n: above }) })), visible.map(session => (_jsx(ListItem, { isFocused: session.id === sessions[focusIndex]?.id, isSelected: session.id === currentSessionId, description: formatTimestamp(session.updatedAt), children: session.title || session.id }, session.id))), below > 0 && (_jsx(Text, { dimColor: true, italic: true, children: t('resume-more-below', { n: below }) })), mode === 'confirm-delete' && focused !== undefined && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "error", children: t('resume-delete-confirm', { name: focused.title || focused.id }) }) })), mode === 'rename' && (_jsx(Box, { marginTop: 1, children: _jsx(SearchBox, { query: renameText, isFocused: true, isTerminalFocused: isTerminalFocused, placeholder: t('resume-rename-placeholder'), prefix: "\u270E", borderless: true }) }))] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: mode === 'list'
|
|
46
|
-
? t('resume-hint-list', { mod: modLabel })
|
|
47
|
-
: mode === 'confirm-delete'
|
|
48
|
-
? t('resume-hint-delete')
|
|
49
|
-
: t('resume-hint-rename') }) })] }));
|
|
50
|
-
}
|