codex specify
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
getAssistantHistory,
|
||||
getAssistantConversations,
|
||||
} from "$lib/api/assistant.js";
|
||||
import { gitService } from "../../../services/gitService.js";
|
||||
|
||||
const HISTORY_PAGE_SIZE = 30;
|
||||
const CONVERSATIONS_PAGE_SIZE = 20;
|
||||
@@ -385,6 +386,33 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (action.type === "open_route" && action.target) {
|
||||
goto(action.target);
|
||||
return;
|
||||
}
|
||||
|
||||
if (action.type === "open_diff" && action.target) {
|
||||
const dashboardId = Number(action.target);
|
||||
if (!Number.isFinite(dashboardId) || dashboardId <= 0) {
|
||||
throw new Error("Invalid dashboard id for diff");
|
||||
}
|
||||
const diffPayload = await gitService.getDiff(dashboardId);
|
||||
const diffText =
|
||||
typeof diffPayload === "string"
|
||||
? diffPayload
|
||||
: diffPayload?.diff || JSON.stringify(diffPayload, null, 2);
|
||||
appendAssistantResponse({
|
||||
response_id: `diff-${Date.now()}`,
|
||||
text: diffText
|
||||
? `Diff для дашборда ${dashboardId}:\n\n${diffText}`
|
||||
: `Diff для дашборда ${dashboardId} пуст.`,
|
||||
state: "success",
|
||||
created_at: new Date().toISOString(),
|
||||
actions: [],
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (action.type === "confirm" && message.confirmation_id) {
|
||||
// Hide buttons immediately to prevent repeated clicks
|
||||
messages = messages.map((m) =>
|
||||
|
||||
Reference in New Issue
Block a user