@askdkc/dsh-cli 0.11.3 → 0.11.5

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 (37) hide show
  1. package/README.md +77 -81
  2. package/bin/dsh-tui.js +88 -88
  3. package/cordis.patch.yml +9 -9
  4. package/cordis.yml +8 -8
  5. package/lib/types/adapter/standard/descriptor.js +2 -2
  6. package/lib/types/components/LogoV2.d.ts +1 -1
  7. package/lib/types/components/LogoV2.js +2 -2
  8. package/lib/types/components/ModelPicker.d.ts +6 -0
  9. package/lib/types/components/ModelPicker.d.ts.map +1 -1
  10. package/lib/types/components/ModelPicker.js +9 -6
  11. package/lib/types/dsh-adapter/cli-registration.d.ts +17 -0
  12. package/lib/types/dsh-adapter/cli-registration.d.ts.map +1 -0
  13. package/lib/types/dsh-adapter/cli-registration.js +157 -0
  14. package/lib/types/dsh-adapter/invariant.js +1 -1
  15. package/lib/types/dsh-adapter/migrate/cli.js +9 -9
  16. package/lib/types/dsh-adapter/packaged-presets.d.ts.map +1 -1
  17. package/lib/types/dsh-adapter/packaged-presets.js +3 -2
  18. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  19. package/lib/types/dsh-adapter/plugin.js +16 -0
  20. package/lib/types/i18n.d.ts +20 -4
  21. package/lib/types/i18n.d.ts.map +1 -1
  22. package/lib/types/i18n.js +5 -1
  23. package/lib/types/modelGroups.d.ts +2 -0
  24. package/lib/types/modelGroups.d.ts.map +1 -1
  25. package/lib/types/modelGroups.js +11 -0
  26. package/lib/types/screens/Chat.d.ts.map +1 -1
  27. package/lib/types/screens/Chat.js +147 -39
  28. package/lib/types/screens/chatOverlay.d.ts +6 -0
  29. package/lib/types/screens/chatOverlay.d.ts.map +1 -1
  30. package/lib/types/screens/chatOverlay.js +4 -0
  31. package/lib/types/screens/modelSearchInput.d.ts +4 -0
  32. package/lib/types/screens/modelSearchInput.d.ts.map +1 -0
  33. package/lib/types/screens/modelSearchInput.js +19 -0
  34. package/lib/types/update.d.ts +2 -2
  35. package/lib/types/update.d.ts.map +1 -1
  36. package/lib/types/update.js +33 -32
  37. package/package.json +5 -4
@@ -24,6 +24,9 @@ export declare function ModelPicker(props: {
24
24
  /** Current route key — its group row carries the ✓ marker. */
25
25
  currentProvider: string;
26
26
  onPick?: (index: number) => void;
27
+ query?: string;
28
+ cursor?: number;
29
+ emptyReason?: 'loading' | 'empty' | 'no-match' | 'error';
27
30
  } | {
28
31
  /** Second level (or single-group fast path): one provider's models —
29
32
  * or the mixed-provider recents list (`showProviderPrefix`). */
@@ -38,5 +41,8 @@ export declare function ModelPicker(props: {
38
41
  /** `provider/model` of the current model — its row carries the ✓ marker. */
39
42
  currentModel: string;
40
43
  onPick?: (index: number) => void;
44
+ query?: string;
45
+ cursor?: number;
46
+ emptyReason?: 'loading' | 'empty' | 'no-match' | 'error';
41
47
  }): React.ReactNode;
42
48
  //# sourceMappingURL=ModelPicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModelPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ModelPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAQtD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAC7B;IACA,+DAA+D;IAC/D,MAAM,EAAE,SAAS,aAAa,EAAE,CAAA;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,8DAA8D;IAC9D,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC,GACC;IACA;qEACiE;IACjE,MAAM,EAAE,SAAS,YAAY,EAAE,CAAA;IAC/B,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kFAA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,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,CAAA;CACzD,GAAG,KAAK,CAAC,SAAS,CA4EpB"}
@@ -7,6 +7,8 @@ import { ListItem } from './design-system/ListItem.js';
7
7
  import { HintLine } from './design-system/HintLine.js';
8
8
  import { listWindow } from './listWindow.js';
9
9
  import { useOverlayListRows } from './OverlayAbove.js';
10
+ import { SearchBox } from './SearchBox.js';
11
+ import { useTerminalFocus } from '../ink/hooks/use-terminal-focus.js';
10
12
  /**
11
13
  * Model picker: a permission-colored Pane with
12
14
  * the rows as Select entries (❯ focus pointer, ✓ on the active row,
@@ -25,27 +27,28 @@ import { useOverlayListRows } from './OverlayAbove.js';
25
27
  */
26
28
  export function ModelPicker(props) {
27
29
  const inGroups = 'groups' in props;
30
+ const terminalFocused = useTerminalFocus();
28
31
  // Captured before the map: union narrowing does not survive into closures.
29
32
  const onPick = props.onPick;
30
33
  // 焦点窗口化按行预算:ListItem 带 description 时占 2 行(正文+描述,均
31
34
  // truncate 成单行),只数项数会把焦点裁出浮层(二次审查实证)。
32
35
  // 预算来自最近一层 OverlayAbove 的有效高度(已钳到输入簇上方的真实空间——
33
36
  // 按 terminalRows 预算在短会话 + 高终端下窗口高过浮层、顶部整行被裁、
34
- // 焦点行不可见,#493/#698),减去本面板框架行:Pane 2 + 标题 2 + 页脚 1
35
- // + 挂载包裹 marginTop 1 = 6。
37
+ // 焦点行不可见,#493/#698),减去本面板框架行:Pane 2 + 标题 2 +
38
+ // 搜索栏 1 + 结果数 1 + 页脚 1 + 挂载包裹 marginTop 1 = 8。
36
39
  const rowHeights = inGroups
37
40
  ? props.groups.map(() => 2)
38
41
  : props.models.map(m => (m.description ? 2 : 1));
39
42
  const rows = inGroups ? props.groups : props.models;
40
- const listRows = useOverlayListRows(6);
43
+ const listRows = useOverlayListRows(8);
41
44
  const { start, end } = listWindow(rowHeights, props.focusIndex, listRows);
42
45
  const hint = inGroups
43
46
  ? t('hint-model-groups')
44
47
  : props.showBack ? t('hint-model-back') : t('hint-confirm-exit');
45
- return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: inGroups || props.groupLabel === undefined ? t('picker-title-model') : props.groupLabel }) }), rows.slice(start, end).map((row, index) => {
48
+ return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: inGroups || props.groupLabel === undefined ? t('picker-title-model') : props.groupLabel }) }), _jsx(SearchBox, { query: props.query ?? '', cursorOffset: props.cursor ?? 0, isFocused: true, isTerminalFocused: terminalFocused, borderless: true, placeholder: t('picker-model-search') }), _jsx(Text, { dimColor: true, children: t('picker-model-results', { count: rows.length }) }), rows.length === 0 && _jsx(Text, { dimColor: true, children: t(props.emptyReason === 'loading' ? 'model-loading' : props.emptyReason === 'error' ? 'picker-model-error' : props.emptyReason === 'no-match' ? 'picker-model-no-match' : 'picker-model-empty') }), rows.slice(start, end).map((row, index) => {
46
49
  const absoluteIndex = start + index;
47
- return inGroups ? (_jsx(ListItem, { isFocused: absoluteIndex === props.focusIndex, isSelected: row.provider === props.currentProvider, description: t('picker-group-count', { count: row.count }), showScrollUp: absoluteIndex === start && start > 0, showScrollDown: absoluteIndex === end - 1 && end < rows.length, onClick: onPick ? () => onPick(absoluteIndex) : undefined, children: row.label === RECENTS_LABEL_PLACEHOLDER && row.provider === RECENTS_GROUP_PROVIDER
50
+ return inGroups ? (_jsx(ListItem, { isFocused: absoluteIndex === props.focusIndex, declareCursor: false, isSelected: row.provider === props.currentProvider, description: t('picker-group-count', { count: row.count }), showScrollUp: absoluteIndex === start && start > 0, showScrollDown: absoluteIndex === end - 1 && end < rows.length, onClick: onPick ? () => onPick(absoluteIndex) : undefined, children: row.label === RECENTS_LABEL_PLACEHOLDER && row.provider === RECENTS_GROUP_PROVIDER
48
51
  ? t('picker-group-recent')
49
- : row.label }, row.provider)) : (_jsx(ListItem, { isFocused: absoluteIndex === props.focusIndex, isSelected: `${row.provider}/${row.id}` === props.currentModel, description: row.description, showScrollUp: absoluteIndex === start && start > 0, showScrollDown: absoluteIndex === end - 1 && end < rows.length, onClick: onPick ? () => onPick(absoluteIndex) : undefined, children: props.showProviderPrefix === true ? `${row.provider} / ${row.name}` : row.name }, `${row.provider}/${row.id}`));
52
+ : row.label }, row.provider)) : (_jsx(ListItem, { isFocused: absoluteIndex === props.focusIndex, declareCursor: false, isSelected: `${row.provider}/${row.id}` === props.currentModel, description: row.description, showScrollUp: absoluteIndex === start && start > 0, showScrollDown: absoluteIndex === end - 1 && end < rows.length, onClick: onPick ? () => onPick(absoluteIndex) : undefined, children: props.showProviderPrefix === true ? `${row.provider} / ${row.name}` : row.name }, `${row.provider}/${row.id}`));
50
53
  })] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: hint }) })] }));
51
54
  }
@@ -0,0 +1,17 @@
1
+ export interface CliRegistrationOptions {
2
+ home?: string;
3
+ dshHome?: string;
4
+ path?: string;
5
+ shell?: string;
6
+ platform?: NodeJS.Platform;
7
+ zdotdir?: string;
8
+ xdgConfigHome?: string;
9
+ localAppData?: string;
10
+ windowsUserPath?: {
11
+ read(): string;
12
+ write(value: string): void;
13
+ };
14
+ }
15
+ /** Register a user-owned launcher for the existing dsh-cli profile. No DSH state is changed. */
16
+ export declare function ensureCliRegistered(options?: CliRegistrationOptions): string;
17
+ //# sourceMappingURL=cli-registration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-registration.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/cli-registration.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,eAAe,CAAC,EAAE;QAAE,IAAI,IAAI,MAAM,CAAC;QAAC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;CACjE;AA4DD,gGAAgG;AAChG,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,sBAA2B,GAAG,MAAM,CA0EhF"}
@@ -0,0 +1,157 @@
1
+ import { execFileSync } from 'node:child_process';
2
+ import { closeSync, existsSync, lstatSync, mkdirSync, openSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
3
+ import { homedir } from 'node:os';
4
+ import { basename, dirname, join } from 'node:path';
5
+ const begin = '# BEGIN dsh-cli managed PATH';
6
+ const end = '# END dsh-cli managed PATH';
7
+ const marker = '# dsh-cli managed launcher';
8
+ function pathExists(path) {
9
+ try {
10
+ lstatSync(path);
11
+ return true;
12
+ }
13
+ catch {
14
+ return false;
15
+ }
16
+ }
17
+ function quoted(value) {
18
+ return `'${value.replace(/'/g, `'\\''`)}'`;
19
+ }
20
+ function atomicWrite(path, content, mode) {
21
+ const temporary = `${path}.${process.pid}.${Math.random().toString(16).slice(2)}.tmp`;
22
+ try {
23
+ writeFileSync(temporary, content, { flag: 'wx', mode });
24
+ renameSync(temporary, path);
25
+ }
26
+ finally {
27
+ if (existsSync(temporary))
28
+ rmSync(temporary);
29
+ }
30
+ }
31
+ function updateOwnedFile(path, content, mode) {
32
+ const target = pathExists(path) && lstatSync(path).isSymbolicLink() ? realpathSync(path) : path;
33
+ if (pathExists(target)) {
34
+ const current = readFileSync(target, 'utf8');
35
+ if (current === content)
36
+ return false;
37
+ if (!current.startsWith(`#!/bin/sh\n${marker}`) && !current.startsWith('@echo off\r\nrem dsh-cli managed launcher\r\n')) {
38
+ throw new Error(`${path} already belongs to another command`);
39
+ }
40
+ }
41
+ mkdirSync(dirname(target), { recursive: true });
42
+ atomicWrite(target, content, mode);
43
+ return true;
44
+ }
45
+ function updateShellFile(path, line) {
46
+ const target = pathExists(path) && lstatSync(path).isSymbolicLink() ? realpathSync(path) : path;
47
+ const current = pathExists(target) ? readFileSync(target, 'utf8') : '';
48
+ const first = current.indexOf(begin);
49
+ const last = current.indexOf(end);
50
+ if ((first < 0) !== (last < 0) || (first >= 0 && (last < first || current.indexOf(begin, first + begin.length) >= 0 || current.indexOf(end, last + end.length) >= 0))) {
51
+ throw new Error(`malformed dsh-cli PATH block in ${path}`);
52
+ }
53
+ const block = `${begin}\n${line}\n${end}`;
54
+ const next = first < 0
55
+ ? `${current}${current !== '' && !current.endsWith('\n') ? '\n' : ''}${block}\n`
56
+ : current.slice(0, first) + block + current.slice(last + end.length);
57
+ if (next === current)
58
+ return false;
59
+ mkdirSync(dirname(target), { recursive: true });
60
+ atomicWrite(target, next, pathExists(target) ? statSync(target).mode : 0o600);
61
+ return true;
62
+ }
63
+ function posixShellFiles(home, shell, zdotdir, xdg) {
64
+ switch (basename(shell)) {
65
+ case 'zsh': return [join(zdotdir || home, '.zshrc')];
66
+ case 'fish': return [join(xdg || join(home, '.config'), 'fish', 'conf.d', 'dsh-cli.fish')];
67
+ case 'bash': {
68
+ const login = ['.bash_profile', '.bash_login', '.profile'].map(name => join(home, name));
69
+ return [join(home, '.bashrc'), login.find(existsSync) ?? login[0]];
70
+ }
71
+ default: throw new Error(`unsupported shell ${shell}; add ~/.local/bin to PATH manually`);
72
+ }
73
+ }
74
+ /** Register a user-owned launcher for the existing dsh-cli profile. No DSH state is changed. */
75
+ export function ensureCliRegistered(options = {}) {
76
+ const home = options.home ?? homedir();
77
+ const dshHome = options.dshHome ?? process.env.DSH_HOME ?? join(home, '.dsh');
78
+ const platform = options.platform ?? process.platform;
79
+ const shell = options.shell ?? process.env.SHELL ?? '';
80
+ const pathValue = options.path ?? process.env.PATH ?? '';
81
+ const binDir = platform === 'win32'
82
+ ? join(options.localAppData ?? process.env.LOCALAPPDATA ?? join(home, 'AppData', 'Local'), 'dsh-cli', 'bin')
83
+ : join(home, '.local', 'bin');
84
+ const command = join(binDir, platform === 'win32' ? 'dsh-cli.cmd' : 'dsh-cli');
85
+ const profilePackage = join(dshHome, 'profiles', 'dsh-cli', 'node_modules', '@askdkc', 'dsh-cli');
86
+ try {
87
+ if (JSON.parse(readFileSync(join(profilePackage, 'package.json'), 'utf8')).name !== '@askdkc/dsh-cli') {
88
+ throw new Error('unexpected package identity');
89
+ }
90
+ }
91
+ catch {
92
+ throw new Error(`dsh-cli profile package is missing or unreadable at ${profilePackage}`);
93
+ }
94
+ const currentCommand = pathValue.split(platform === 'win32' ? ';' : ':')
95
+ .map(dir => join(dir, platform === 'win32' ? 'dsh-cli.cmd' : 'dsh-cli'))
96
+ .find(candidate => candidate !== command && pathExists(candidate) && !candidate.includes(`${join('node_modules', '.bin')}`));
97
+ if (currentCommand !== undefined)
98
+ return `Existing dsh-cli command at ${currentCommand} was kept; automatic registration skipped.`;
99
+ mkdirSync(binDir, { recursive: true });
100
+ const lock = join(binDir, '.dsh-cli-registration.lock');
101
+ let handle;
102
+ try {
103
+ handle = openSync(lock, 'wx');
104
+ }
105
+ catch {
106
+ if (pathExists(lock) && Date.now() - statSync(lock).mtimeMs > 120000) {
107
+ rmSync(lock, { force: true });
108
+ handle = openSync(lock, 'wx');
109
+ }
110
+ else {
111
+ throw new Error(`registration is already running (${lock}); retry on next TUI start`);
112
+ }
113
+ }
114
+ try {
115
+ const target = join('profiles', 'dsh-cli', 'node_modules', '@askdkc', 'dsh-cli', 'bin', 'dsh-tui.js');
116
+ const content = platform === 'win32'
117
+ ? `@echo off\r\nrem dsh-cli managed launcher\r\nsetlocal DisableDelayedExpansion\r\nif not defined DSH_HOME set "DSH_HOME=${dshHome.replace(/%/g, '%%')}"\r\nnode "%DSH_HOME%\\${target.replace(/\//g, '\\')}" %*\r\nexit /b %ERRORLEVEL%\r\n`
118
+ : `#!/bin/sh\n${marker}\nDEFAULT_DSH_HOME=${quoted(dshHome)}\n: "\${DSH_HOME:=$DEFAULT_DSH_HOME}"\nexport DSH_HOME\nexec node "$DSH_HOME/${target}" "$@"\n`;
119
+ let keepExistingDefault = false;
120
+ if (pathExists(command)) {
121
+ const existing = readFileSync(command, 'utf8');
122
+ keepExistingDefault = existing.startsWith(platform === 'win32' ? '@echo off\r\nrem dsh-cli managed launcher\r\n' : `#!/bin/sh\n${marker}\n`)
123
+ && existing !== content;
124
+ }
125
+ const changed = keepExistingDefault ? false : updateOwnedFile(command, content, 0o755);
126
+ if (platform === 'win32') {
127
+ const userPath = options.windowsUserPath ?? {
128
+ read: () => execFileSync('powershell.exe', ['-NoProfile', '-NonInteractive', '-Command', '[Environment]::GetEnvironmentVariable("Path", "User")'], { encoding: 'utf8', timeout: 5000 }).trim(),
129
+ write: (value) => {
130
+ execFileSync('powershell.exe', ['-NoProfile', '-NonInteractive', '-Command', '[Environment]::SetEnvironmentVariable("Path", $env:DSH_CLI_USER_PATH, "User")'], {
131
+ env: { ...process.env, DSH_CLI_USER_PATH: value }, timeout: 5000,
132
+ });
133
+ },
134
+ };
135
+ const current = userPath.read();
136
+ if (!current.split(';').some(part => part.toLowerCase() === binDir.toLowerCase())) {
137
+ const next = current ? `${current};${binDir}` : binDir;
138
+ userPath.write(next);
139
+ }
140
+ }
141
+ else {
142
+ const files = posixShellFiles(home, shell, options.zdotdir ?? process.env.ZDOTDIR, options.xdgConfigHome ?? process.env.XDG_CONFIG_HOME);
143
+ const line = basename(shell) === 'fish'
144
+ ? `contains -- ${quoted(binDir)} $PATH; or set -gx PATH ${quoted(binDir)} $PATH`
145
+ : `case ":$PATH:" in *:${quoted(binDir)}:*) ;; *) export PATH=${quoted(binDir)}:"$PATH" ;; esac`;
146
+ for (const file of files)
147
+ updateShellFile(file, line);
148
+ }
149
+ return keepExistingDefault
150
+ ? `Kept ${command} with its original DSH_HOME default. Open a new shell to use dsh-cli; set DSH_HOME explicitly to use another installation.`
151
+ : changed ? `Registered ${command}. Open a new shell to use dsh-cli.` : `dsh-cli registration is current at ${command}.`;
152
+ }
153
+ finally {
154
+ closeSync(handle);
155
+ rmSync(lock, { force: true });
156
+ }
157
+ }
@@ -6,7 +6,7 @@
6
6
  * subtree and must not spread to new code.
7
7
  * @module dsh-cli/invariant
8
8
  */
9
- const PACKAGE_NAME = 'dsh-cli';
9
+ const PACKAGE_NAME = '@askdkc/dsh-cli';
10
10
  /** Cordis companion plugin name. */
11
11
  export const name = 'dsh-tui-invariant';
12
12
  /** Service required before the companion can reserve package ownership. */
@@ -1,12 +1,12 @@
1
1
  /**
2
- * CLI surface for migration, reached via `dsh-tui migrate ...` (the bin
2
+ * CLI surface for migration, reached via `dsh-cli migrate ...` (the bin
3
3
  * launcher delegates here exactly like it delegates `update`; the TUI's
4
4
  * `/migrate` command spawns this same CLI in a child process).
5
5
  *
6
6
  * Usage:
7
- * dsh-tui migrate # list agents and discoverable counts (writes nothing)
8
- * dsh-tui migrate <agent> # import every conversation found from that agent
9
- * dsh-tui migrate <agent> --dry-run # show what would land, write nothing
7
+ * dsh-cli migrate # list agents and discoverable counts (writes nothing)
8
+ * dsh-cli migrate <agent> # import every conversation found from that agent
9
+ * dsh-cli migrate <agent> --dry-run # show what would land, write nothing
10
10
  *
11
11
  * One agent per run, and `--dry-run` always names one: both are usage errors
12
12
  * rather than silent fallbacks, matching the TUI's `/migrate` entry points.
@@ -39,7 +39,7 @@ export async function cliMigrate(argv) {
39
39
  // A top-level failure (e.g. persistence never becomes ready because the
40
40
  // target root is unwritable) must land as one CLI-style summary line,
41
41
  // not a bare Node stack trace (deep-review i1).
42
- process.stderr.write(`dsh-tui migrate: ${error instanceof Error ? safe(error.message) : String(error)}\n`);
42
+ process.stderr.write(`dsh-cli migrate: ${error instanceof Error ? safe(error.message) : String(error)}\n`);
43
43
  return 1;
44
44
  }
45
45
  }
@@ -47,7 +47,7 @@ async function cliMigrateInner(argv) {
47
47
  const dryRun = argv.includes('--dry-run');
48
48
  const words = argv.filter(word => word !== '--dry-run');
49
49
  if (words.length > 1) {
50
- process.stderr.write('usage: dsh-tui migrate [<agent>] [--dry-run]\n');
50
+ process.stderr.write('usage: dsh-cli migrate [<agent>] [--dry-run]\n');
51
51
  return MIGRATE_CLI_USAGE_EXIT;
52
52
  }
53
53
  const wanted = words[0];
@@ -56,7 +56,7 @@ async function cliMigrateInner(argv) {
56
56
  // flag fell through to the listing below and was silently ignored (the
57
57
  // TUI's `/migrate --dry-run` says the same thing).
58
58
  if (dryRun) {
59
- process.stderr.write('usage: dsh-tui migrate <agent> --dry-run\n');
59
+ process.stderr.write('usage: dsh-cli migrate <agent> --dry-run\n');
60
60
  return MIGRATE_CLI_USAGE_EXIT;
61
61
  }
62
62
  // Bare `migrate` only reports; importing requires an explicit agent.
@@ -66,13 +66,13 @@ async function cliMigrateInner(argv) {
66
66
  // scan candidates; import filters unreadable/empty ones, so it may
67
67
  // land slightly above the imported total.
68
68
  const available = adapter.count !== undefined ? adapter.count() : adapter.discover().sessions.length;
69
- console.log(`[${adapter.id}] ${available} session file(s) to scan (run \`dsh-tui migrate ${adapter.id}\` to import)`);
69
+ console.log(`[${adapter.id}] ${available} session file(s) to scan (run \`dsh-cli migrate ${adapter.id}\` to import)`);
70
70
  }
71
71
  return 0;
72
72
  }
73
73
  const agent = MIGRATION_ADAPTERS.find(adapter => adapter.id === wanted);
74
74
  if (agent === undefined) {
75
- process.stderr.write(`dsh-tui migrate: unknown agent "${safe(wanted)}"; known: ${MIGRATION_ADAPTERS.map(adapter => adapter.id).join(', ')}\n`);
75
+ process.stderr.write(`dsh-cli migrate: unknown agent "${safe(wanted)}"; known: ${MIGRATION_ADAPTERS.map(adapter => adapter.id).join(', ')}\n`);
76
76
  return MIGRATE_CLI_USAGE_EXIT;
77
77
  }
78
78
  const found = agent.discover();
@@ -1 +1 @@
1
- {"version":3,"file":"packaged-presets.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/packaged-presets.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;CACzD;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAmBD,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,SAAS,GAAE,MAAwB,GAAG,MAAM,CAQ9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,qBAA0B,GAAG,oBAAoB,EAAE,CAqDjG"}
1
+ {"version":3,"file":"packaged-presets.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/packaged-presets.ts"],"names":[],"mappings":"AAyBA,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;CACzD;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAmBD,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,SAAS,GAAE,MAAwB,GAAG,MAAM,CAQ9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,qBAA0B,GAAG,oBAAoB,EAAE,CAqDjG"}
@@ -3,13 +3,14 @@ import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, renameSync, r
3
3
  import { homedir } from 'node:os';
4
4
  import { dirname, join } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
- const OWNER = 'dsh-cli';
6
+ const OWNER = '@askdkc/dsh-cli';
7
+ const PREVIOUS_OWNER = 'dsh-cli';
7
8
  const LEGACY_OWNER = '@deepseek-harness-tui/dsh-tui';
8
9
  const MARKER = '.dsh-tui-managed.json';
9
10
  function readMarker(directory) {
10
11
  try {
11
12
  const value = JSON.parse(readFileSync(join(directory, MARKER), 'utf8'));
12
- if ((value.owner === OWNER || value.owner === LEGACY_OWNER)
13
+ if ((value.owner === OWNER || value.owner === PREVIOUS_OWNER || value.owner === LEGACY_OWNER)
13
14
  && typeof value.preset === 'string'
14
15
  && typeof value.revision === 'string'
15
16
  && value.revision.length > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAA;AAGhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAA+D,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAwDtH,OAAO,EAAE,MAAM,EAAkC,MAAM,UAAU,CAAA;AAgCjE;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,CAcxF;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,yBAAyB,GAAG,eAAe,CAAA;AAErF,wBAAgB,kBAAkB,CAChC,WAAW,UAAgC,EAC3C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,WAAW,CASb;AAED,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,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AAI,CAAC,CAmFf;AA4HD,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAIrE"}
@@ -46,6 +46,7 @@ import { reserveMount } from '../sessionMounts.js';
46
46
  import { getHostDialogStore } from './dialogs.js';
47
47
  import { getHostStatusStore } from './status.js';
48
48
  import { createActivityStore } from './activity-store.js';
49
+ import { ensureCliRegistered } from './cli-registration.js';
49
50
  import { getHostToastStore } from './toast.js';
50
51
  import { getHostShortcuts } from './shortcuts.js';
51
52
  import { getHostThemes } from './themes.js';
@@ -210,6 +211,21 @@ export async function apply(ctx, runtimeConfig, configOwner = ctx) {
210
211
  // render so every module resolves strings in the same language.
211
212
  const envLang = process.env.DSH_TUI_LANG;
212
213
  setLang(isLang(envLang) ? envLang : isLang(config.lang) ? config.lang : resolveStartupLang());
214
+ if (resolveDshProfileName() === 'dsh-cli'
215
+ && !isStandaloneRuntime()
216
+ && !process.env.CI
217
+ && process.env.DSH_TUI_AUTO_REGISTER_CLI !== '0') {
218
+ try {
219
+ const result = ensureCliRegistered();
220
+ if (result.startsWith('Registered ') || result.startsWith('Kept '))
221
+ ctx.logger.info(`dsh-tui: ${result}`);
222
+ else if (result.startsWith('Existing '))
223
+ ctx.logger.warn(`dsh-tui: ${result} Remove the conflicting command or adjust PATH, then restart the TUI.`);
224
+ }
225
+ catch (error) {
226
+ ctx.logger.warn(`dsh-tui: dsh-cli command registration failed: ${error instanceof Error ? error.message : String(error)}. Resolve the reported path or permission issue, then restart the TUI; set DSH_TUI_AUTO_REGISTER_CLI=0 to disable registration.`);
227
+ }
228
+ }
213
229
  // /update restart verification: the pre-update process stamps the version
214
230
  // it was leaving behind; if the freshly loaded one is not newer, the
215
231
  // package manager "succeeded" without actually moving the version (mirror
@@ -2884,6 +2884,26 @@ declare const dict: {
2884
2884
  readonly zh: "{{count}} 个模型";
2885
2885
  readonly en: "{{count}} models";
2886
2886
  };
2887
+ readonly 'picker-model-search': {
2888
+ readonly zh: "输入关键词筛选模型";
2889
+ readonly en: "Type keywords to filter models";
2890
+ };
2891
+ readonly 'picker-model-results': {
2892
+ readonly zh: "{{count}} 个结果";
2893
+ readonly en: "{{count}} results";
2894
+ };
2895
+ readonly 'picker-model-empty': {
2896
+ readonly zh: "没有可用模型";
2897
+ readonly en: "No models available";
2898
+ };
2899
+ readonly 'picker-model-no-match': {
2900
+ readonly zh: "没有匹配的模型";
2901
+ readonly en: "No matching models";
2902
+ };
2903
+ readonly 'picker-model-error': {
2904
+ readonly zh: "模型列表获取失败,请重新打开 /model";
2905
+ readonly en: "Could not load models; reopen /model to retry";
2906
+ };
2887
2907
  readonly 'hint-model-groups': {
2888
2908
  readonly zh: "**Enter** 查看模型 · Esc 退出";
2889
2909
  readonly en: "**Enter** to view models · Esc to exit";
@@ -2964,10 +2984,6 @@ declare const dict: {
2964
2984
  readonly zh: "正在加载模型";
2965
2985
  readonly en: "Loading models";
2966
2986
  };
2967
- readonly 'model-loading-subtitle': {
2968
- readonly zh: "正在查询 provider…";
2969
- readonly en: "Querying the provider…";
2970
- };
2971
2987
  readonly 'model-switching': {
2972
2988
  readonly zh: "正在切换模型到 {{name}}…";
2973
2989
  readonly en: "Switching model to {{name}}…";
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAMH,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAI9B,+DAA+D;AAC/D,eAAO,MAAM,KAAK,uBAAwB,CAAA;AAE1C;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAE9D,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;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picker-title-model': { zh: '模型', en: 'Model' },
901
901
  'picker-group-recent': { zh: '最近使用', en: 'Recently used' },
902
902
  'picker-group-count': { zh: '{{count}} 个模型', en: '{{count}} models' },
903
+ 'picker-model-search': { zh: '输入关键词筛选模型', en: 'Type keywords to filter models' },
904
+ 'picker-model-results': { zh: '{{count}} 个结果', en: '{{count}} results' },
905
+ 'picker-model-empty': { zh: '没有可用模型', en: 'No models available' },
906
+ 'picker-model-no-match': { zh: '没有匹配的模型', en: 'No matching models' },
907
+ 'picker-model-error': { zh: '模型列表获取失败,请重新打开 /model', en: 'Could not load models; reopen /model to retry' },
903
908
  'hint-model-groups': { zh: '**Enter** 查看模型 · Esc 退出', en: '**Enter** to view models · Esc to exit' },
904
909
  'hint-model-back': { zh: '**Enter** 切换模型 · Esc/⌫ 返回上级', en: '**Enter** to switch · Esc/⌫ to go back' },
905
910
  'picker-title-skills': { zh: '技能', en: 'Skills' },
@@ -920,7 +925,6 @@ const dict = {
920
925
  'picker-title-color': { zh: '会话强调色', en: 'Session accent color' },
921
926
  'picker-title-effort': { zh: '推理强度', en: 'Reasoning effort' },
922
927
  'model-loading': { zh: '正在加载模型', en: 'Loading models' },
923
- 'model-loading-subtitle': { zh: '正在查询 provider…', en: 'Querying the provider…' },
924
928
  'model-switching': { zh: '正在切换模型到 {{name}}…', en: 'Switching model to {{name}}…' },
925
929
  'model-switched': { zh: '模型已切换为 {{name}}', en: 'Model switched to {{name}}' },
926
930
  // ── components/RewindPicker.tsx ─────────────────────────────────────
@@ -31,6 +31,8 @@ export interface ModelGroupRow {
31
31
  /** How many of the listed models belong to this provider. */
32
32
  readonly count: number;
33
33
  }
34
+ /** Literal, case-insensitive AND matching across a model's identifying fields. */
35
+ export declare function filterModels(models: readonly LlmModelInfo[], query: string, providers: readonly LlmProviderInfo[]): readonly LlmModelInfo[];
34
36
  /**
35
37
  * The recent refs that the current catalog still lists, most-recent-first —
36
38
  * the second level of the recents group. Refs whose model vanished from the
@@ -1 +1 @@
1
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AAS,aAAa,EAAE,CAsB1B;AAED,+EAA+E;AAC/E,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,OAAO,CAAC,EAAE,SAAS,QAAQ,EAAE,GAC5B,kBAAkB,CAiBpB"}
@@ -16,6 +16,17 @@
16
16
  export const RECENTS_GROUP_PROVIDER = '__recents__';
17
17
  /** The recents row's raw label; renderers replace it with the localized one. */
18
18
  export const RECENTS_LABEL_PLACEHOLDER = '__recent__';
19
+ /** Literal, case-insensitive AND matching across a model's identifying fields. */
20
+ export function filterModels(models, query, providers) {
21
+ const terms = query.trim().toLowerCase().split(/\s+/u).filter(Boolean);
22
+ if (terms.length === 0)
23
+ return models;
24
+ return models.filter(model => {
25
+ const providerName = providers.find(provider => provider.id === model.provider)?.name ?? '';
26
+ const fields = [model.name, model.id, model.provider, providerName].map(value => value.toLowerCase());
27
+ return terms.every(term => fields.some(field => field.includes(term)));
28
+ });
29
+ }
19
30
  /**
20
31
  * The recent refs that the current catalog still lists, most-recent-first —
21
32
  * the second level of the recents group. Refs whose model vanished from the
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/screens/Chat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AA2BzB,OAAO,KAAK,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAE3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;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