feat(ai): 新会话/清屏 + 工作中转圈 + 可编辑单槽排队

对标 opsxshell/aiops 契约 14 与附图 UX:顶栏新会话与清屏;
忙时「工作中 N 秒」;排队卡支持立即/编辑/删除;Ask 亦单槽排队;
run 世代防停止后旧 finally 清 busy。
This commit is contained in:
logan committed 2026-10-15 14:28:57 +08:00
1 parent d543f3b924
commit 9c2b623ce4
4 files changed
+318 -77

No files matched your search

+15 -12
View File
@@ -511,18 +511,21 @@ export type AiAction =
| "dialect"
| "sample";
export async function callAi(payload: {
action: AiAction;
prompt?: string;
sql?: string;
driver?: string;
database?: string;
error?: string;
/** C4/C8:前端注入的库表列上下文(截断 4000 字符) */
schema?: string;
model?: string;
}) {
return post<{ content: string; sql?: string }>("/api/ai/chat", payload);
export async function callAi(
payload: {
action: AiAction;
prompt?: string;
sql?: string;
driver?: string;
database?: string;
error?: string;
/** C4/C8:前端注入的库表列上下文(截断 4000 字符) */
schema?: string;
model?: string;
},
signal?: AbortSignal,
) {
return post<{ content: string; sql?: string }>("/api/ai/chat", payload, signal);
}
/** 阶段 2:Agent 模式 — 服务端多轮调同一 aitools Runtime(Ask 仍用 callAi) */