feat(history): add unified MCP execution history
This commit is contained in:
39 files changed
+1261
-87
No files matched your search
@@ -380,6 +380,8 @@ export const saveSqlFileUploadMaxMb = forward("saveSqlFileUploadMaxMb");
|
||||
export const saveMaxAgentTurns = forward("saveMaxAgentTurns");
|
||||
export const loadHistoryRetentionLimit = forward("loadHistoryRetentionLimit");
|
||||
export const saveHistoryRetentionLimit = forward("saveHistoryRetentionLimit");
|
||||
export const loadMcpHistoryRetentionLimit = forward("loadMcpHistoryRetentionLimit");
|
||||
export const saveMcpHistoryRetentionLimit = forward("saveMcpHistoryRetentionLimit");
|
||||
export const loadMaxRetries = forward("loadMaxRetries");
|
||||
export const saveMaxRetries = forward("saveMaxRetries");
|
||||
export const completeAppClose = forward("completeAppClose");
|
||||
@@ -916,6 +918,8 @@ export const searchHistory = forward("searchHistory");
|
||||
export const loadHistoryConnectionOptions = forward("loadHistoryConnectionOptions");
|
||||
export const loadRedisHistory = forward("loadRedisHistory");
|
||||
export const clearHistory = forward("clearHistory");
|
||||
export const clearHistoryBySource = forward("clearHistoryBySource");
|
||||
export const cleanupMcpHistoryRetention = forward("cleanupMcpHistoryRetention");
|
||||
export const clearRedisHistory = forward("clearRedisHistory");
|
||||
export const deleteHistoryEntry = forward("deleteHistoryEntry");
|
||||
|
||||
|
||||
@@ -2277,6 +2277,19 @@ export async function saveHistoryRetentionLimit(limit: number): Promise<void> {
|
||||
if (!res.ok) throw await backendResponseError(res);
|
||||
}
|
||||
|
||||
export async function loadMcpHistoryRetentionLimit(): Promise<number> {
|
||||
return get("/api/app-settings/mcp-history-retention-limit");
|
||||
}
|
||||
|
||||
export async function saveMcpHistoryRetentionLimit(limit: number): Promise<void> {
|
||||
const res = await fetch(apiUrl("/api/app-settings/mcp-history-retention-limit"), {
|
||||
method: "PUT",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ limit }),
|
||||
});
|
||||
if (!res.ok) throw await backendResponseError(res);
|
||||
}
|
||||
|
||||
export async function loadMaxRetries(): Promise<number> {
|
||||
return get("/api/app-settings/max-retries");
|
||||
}
|
||||
@@ -5197,6 +5210,14 @@ export async function clearHistory(): Promise<void> {
|
||||
return del("/api/history");
|
||||
}
|
||||
|
||||
export async function clearHistoryBySource(source: string): Promise<void> {
|
||||
return del(`/api/history?source=${encodeURIComponent(source)}`);
|
||||
}
|
||||
|
||||
export async function cleanupMcpHistoryRetention(): Promise<number> {
|
||||
return post("/api/app-settings/mcp-history-retention-cleanup", {});
|
||||
}
|
||||
|
||||
export async function clearRedisHistory(): Promise<void> {
|
||||
const entries = await loadRedisHistory(1000, 0);
|
||||
await Promise.all(entries.map((e) => deleteHistoryEntry(e.id)));
|
||||
|
||||
@@ -882,6 +882,14 @@ export async function saveHistoryRetentionLimit(limit: number): Promise<void> {
|
||||
return invoke("save_history_retention_limit", { limit });
|
||||
}
|
||||
|
||||
export async function loadMcpHistoryRetentionLimit(): Promise<number> {
|
||||
return invoke("load_mcp_history_retention_limit");
|
||||
}
|
||||
|
||||
export async function saveMcpHistoryRetentionLimit(limit: number): Promise<void> {
|
||||
return invoke("save_mcp_history_retention_limit", { limit });
|
||||
}
|
||||
|
||||
export async function loadMaxRetries(): Promise<number> {
|
||||
return invoke("load_max_retries");
|
||||
}
|
||||
@@ -5086,6 +5094,11 @@ export interface HistoryEntry {
|
||||
affected_rows?: number | null;
|
||||
rollback_sql?: string | null;
|
||||
details_json?: string | null;
|
||||
source?: "sql" | "mcp" | "other";
|
||||
mcp_tool_name?: string | null;
|
||||
mcp_request_json?: string | null;
|
||||
mcp_response_json?: string | null;
|
||||
mcp_session_id?: string | null;
|
||||
}
|
||||
|
||||
export interface HistoryConnectionFilter {
|
||||
@@ -5112,6 +5125,8 @@ export interface HistorySearchRequest {
|
||||
ended_at?: string;
|
||||
cursor?: HistoryCursor;
|
||||
limit: number;
|
||||
source?: "sql" | "mcp" | "other";
|
||||
mcp_tool_name?: string;
|
||||
}
|
||||
|
||||
export interface HistorySearchResult {
|
||||
@@ -5152,6 +5167,14 @@ export async function clearHistory(): Promise<void> {
|
||||
return invoke("clear_history");
|
||||
}
|
||||
|
||||
export async function clearHistoryBySource(source: string): Promise<void> {
|
||||
return invoke("clear_history_by_source", { source });
|
||||
}
|
||||
|
||||
export async function cleanupMcpHistoryRetention(): Promise<number> {
|
||||
return invoke("cleanup_mcp_history_retention");
|
||||
}
|
||||
|
||||
export async function clearRedisHistory(): Promise<void> {
|
||||
const entries = await loadRedisHistory(1000, 0);
|
||||
await Promise.all(entries.map((e) => deleteHistoryEntry(e.id)));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export type HistoryActivityKind = "query" | "data_change" | "schema_change" | "import" | "transfer" | "redis_command";
|
||||
export type HistoryActivityKind = "query" | "data_change" | "schema_change" | "import" | "transfer" | "redis_command" | "mcp";
|
||||
|
||||
export type HistoryActivitySource = {
|
||||
activity_kind?: HistoryActivityKind;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export const HISTORY_ROW_HEIGHT = 72;
|
||||
export const HISTORY_ROW_HEIGHT = 80;
|
||||
export const HISTORY_SCROLL_BUFFER = 600;
|
||||
|
||||
export function shouldVirtualizeHistory(count: number): boolean {
|
||||
|
||||
@@ -207,6 +207,7 @@ export const SETTINGS_SEARCH_DEFINITIONS: readonly SettingsSearchDefinition[] =
|
||||
{ id: "navigation-sidebar-font-size", category: "navigation", titleKey: "settings.sidebarFontSize", descriptionKey: "settings.sidebarFontSizeDescription", targetId: "navigation" },
|
||||
{ id: "navigation-hidden-tables", category: "navigation", titleKey: "settings.sidebarHiddenTablePrefixes", descriptionKey: "settings.sidebarHiddenTablePrefixesDescription", targetId: "navigation" },
|
||||
{ id: "history-retention", category: "data", titleKey: "settings.historyRetentionLimit", descriptionKey: "settings.historyRetentionDescription", targetId: "history-retention" },
|
||||
{ id: "mcp-history-retention", category: "data", titleKey: "settings.mcpHistoryRetentionLimit", descriptionKey: "settings.mcpHistoryRetentionDescription", targetId: "mcp-history-retention" },
|
||||
{ id: "navigation-table-page-size", category: "navigation", titleKey: "settings.sidebarTablePageSize", descriptionKey: "settings.sidebarTablePageSizeDescription", targetId: "navigation" },
|
||||
{ id: "navigation-disconnect-tabs", category: "navigation", titleKey: "settings.disconnectTabHandlingMode", descriptionKey: "settings.disconnectTabHandlingModeDescription", targetId: "navigation" },
|
||||
{ id: "navigation-delete-connection-tabs", category: "navigation", titleKey: "settings.deleteConnectionTabHandlingMode", descriptionKey: "settings.deleteConnectionTabHandlingModeDescription", targetId: "navigation" },
|
||||
|
||||
Reference in new issue
Block a user