bingocode 1.0.13 → 1.0.14
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/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import { LogoV2 } from '../components/LogoV2/LogoV2.tsx';
|
|
|
8
8
|
import { CondensedLogo } from '../components/LogoV2/CondensedLogo.tsx';
|
|
9
9
|
import fs from 'fs';
|
|
10
10
|
import path from 'path';
|
|
11
|
+
import os from 'os';
|
|
11
12
|
import { ensureSingletonLocalServer } from '../server/ensureSingletonLocalServer.ts';
|
|
12
13
|
// 新增:通用 UI 元素与顶部工具栏
|
|
13
14
|
import { TopBar, BottomBar, Panel, Hint, Kbd, SecondaryMenu } from '../manager/CliMenuUi.tsx';
|
|
@@ -20,7 +21,8 @@ import { useTheme } from '../components/design-system/ThemeProvider.js';
|
|
|
20
21
|
// 配置相关(仅使用可用接口)
|
|
21
22
|
import { getGlobalConfig, saveGlobalConfig } from '../utils/config.ts';
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
// markedSessions 存到 ~/.claude-cli/ 固定目录,不受 cwd 影响
|
|
25
|
+
const MARKED_FILE = path.join(os.homedir(), '.claude-cli', 'markedSessions.json');
|
|
24
26
|
|
|
25
27
|
// 固定尺寸视口(可用环境变量覆盖)
|
|
26
28
|
const VIEW_W = Number(process.env.CLI_VIEW_W || 96);
|
|
@@ -182,7 +184,7 @@ export const CliMenuManager: React.FC = () => {
|
|
|
182
184
|
(async () => {
|
|
183
185
|
try {
|
|
184
186
|
if (apiUrl) return;
|
|
185
|
-
const entry = path.resolve(
|
|
187
|
+
const entry = path.resolve(import.meta.dir, '../server/index.ts');
|
|
186
188
|
const handle = await ensureSingletonLocalServer({ serverEntry: entry });
|
|
187
189
|
if (!mounted) { await handle.stopIfLast(); return; }
|
|
188
190
|
setApiUrl(handle.baseUrl);
|
|
@@ -678,24 +680,7 @@ export const CliMenuManager: React.FC = () => {
|
|
|
678
680
|
setSelectedHistory(null);
|
|
679
681
|
setMsgsPage(0);
|
|
680
682
|
} else if (item.value === '__continue') {
|
|
681
|
-
|
|
682
|
-
const fsReq = require('fs');
|
|
683
|
-
const pathReq = require('path');
|
|
684
|
-
const { spawn } = require('child_process');
|
|
685
|
-
const pkgPath = pathReq.resolve(process.cwd(), 'package.json');
|
|
686
|
-
const pkgJson = JSON.parse(fsReq.readFileSync(pkgPath, 'utf-8'));
|
|
687
|
-
const bins = pkgJson.bin || {};
|
|
688
|
-
const isWin = process.platform === 'win32';
|
|
689
|
-
let binName = isWin
|
|
690
|
-
? bins['claude-haha'] ? 'claude-haha' : bins['claude'] ? 'claude' : Object.keys(bins)[0]
|
|
691
|
-
: bins['claude-linux'] ? 'claude-linux' : bins['claude'] ? 'claude' : Object.keys(bins)[0];
|
|
692
|
-
const spawnCmd = isWin ? 'cmd' : 'sh';
|
|
693
|
-
const spawnArgs = isWin
|
|
694
|
-
? ['/c', binName, '--resume', selectedHistory.id]
|
|
695
|
-
: ['-c', `./${binName} --resume ${selectedHistory.id}`];
|
|
696
|
-
// 静默启动继续会话
|
|
697
|
-
resumeSession(selectedHistory.id);
|
|
698
|
-
} catch { }
|
|
683
|
+
resumeSession(selectedHistory.id);
|
|
699
684
|
} else if (item.value === '__delete') {
|
|
700
685
|
setHistoryMenuStage('deleteConfirm');
|
|
701
686
|
} else if (item.value === '__toggle_mark') {
|