重构: tool_registry拆分及多批改进
This commit is contained in:
@@ -46,7 +46,7 @@ function applyUiState(s: any) {
|
||||
}
|
||||
|
||||
// 启动恢复:从 appSettings(SQLite)读取上次的 UI 布局(模块级单例 state)
|
||||
export function restoreUiState() {
|
||||
function restoreUiState() {
|
||||
applyUiState(appSettings.get<any>('df-ai-ui', null))
|
||||
}
|
||||
restoreUiState()
|
||||
|
||||
@@ -22,13 +22,6 @@ export interface ConfirmState {
|
||||
resolve: null | ((v: boolean) => void)
|
||||
}
|
||||
|
||||
/** 弹出确认对话框,返回 Promise;resolve(true) 表示用户确认,resolve(false) 表示取消。
|
||||
* dangerLabel 可选:覆盖危险按钮文案(如「清空」),不传则回退组件兜底 common.confirm,保持旧行为。 */
|
||||
export type ConfirmFn = (msg: string, dangerLabel?: string) => Promise<boolean>
|
||||
|
||||
/** 关闭弹层并回传结果 */
|
||||
export type AnswerFn = (ok: boolean) => void
|
||||
|
||||
export function useConfirm() {
|
||||
const confirmState = ref<ConfirmState>({
|
||||
visible: false,
|
||||
|
||||
@@ -132,8 +132,6 @@ export function useMarkdown() {
|
||||
escapeFallback,
|
||||
getMarked: () => _marked,
|
||||
getPurify: () => _purify,
|
||||
// 仅 AiChat 流式块级 memo 用(独立缓存,不与历史 _mdCache 混)
|
||||
clearHistoryCache: () => _mdCache.clear(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user