refactor: 全面清理死代码 — 删除 348 行无用代码

删除文件:
- training-export.ts: 训练数据导出(零引用,UI 已移除)

删除函数:
- workspace.ts: isProcessAlive, getActiveProcessCount, execWorkspaceCommand, terminateWorkspaceCommand
- sqlite.ts: deleteMessagesBySession, getSkill, closeDatabase
- tool-registry.ts: isToolEnabled
- cron-manager.ts: clearAllTimers
- workspace-panel.ts: setOnToolTerminated, setWorkspaceDirPath

删除 UI:
- index.html: 训练数据导出按钮及说明
- settings-modal.ts: 训练数据导出事件绑定
This commit is contained in:
thzxx
2026-04-18 10:08:01 +08:00
parent 6c9ffa5135
commit d2468cd6fc
8 changed files with 0 additions and 348 deletions
-16
View File
@@ -377,10 +377,6 @@ export function getMessagesBySession(sessionId: string): MessageRow[] {
return queryAll(getDb(), 'SELECT * FROM messages WHERE session_id = ? ORDER BY created_at ASC', [sessionId]) as unknown as MessageRow[];
}
export function deleteMessagesBySession(sessionId: string): void {
runExec(getDb(), 'DELETE FROM messages WHERE session_id = ?', [sessionId]);
persist();
}
// ─── Memories CRUD ───
@@ -531,9 +527,6 @@ export function saveSkill(skill: SkillRow): string {
return skill.id;
}
export function getSkill(id: string): SkillRow | null {
return queryOne(getDb(), 'SELECT * FROM skills WHERE id = ?', [id]) as unknown as SkillRow | null;
}
export function getAllSkills(): SkillRow[] {
return queryAll(getDb(), 'SELECT * FROM skills ORDER BY success_count DESC, updated_at DESC') as unknown as SkillRow[];
@@ -626,12 +619,3 @@ export function importSessions(data: ExportData): { imported: number; skipped: n
return { imported, skipped };
}
// ─── Close ───
export function closeDatabase(): void {
if (db) {
persist();
db.close();
db = null;
}
}