codex specify

This commit is contained in:
2026-02-25 21:19:48 +03:00
parent 8731343e52
commit a8ccf6cb79
40 changed files with 3535 additions and 238 deletions

View File

@@ -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) =>