/* Helper tạo câu nhiệm vụ tiếng Việt cho AI Agent theo từng bài. */ const VIDEO_AGENT_TASKS = { "agent-video-voice-library": { title: "Chọn giọng Việt cho video", label: "Copy nhiệm vụ chọn giọng", desc: "Agent giúp nghe thử, chọn giọng phù hợp, lưu lựa chọn và tạo báo cáo dễ đọc.", trigger: "video-voice-library" }, "agent-video-html": { title: "Dựng video HTML đầu tiên", label: "Copy nhiệm vụ dựng video HTML", desc: "Agent dùng template HTML hạt giống DeChePro để tạo bản video nháp tiếng Việt.", trigger: "video-html" }, "agent-video-rough-edit": { title: "Cắt thô video quay thật", label: "Copy nhiệm vụ cắt video thô", desc: "Agent tạo folder, nhận video gốc, cắt đoạn im lặng rõ và xuất bản nháp để duyệt.", trigger: "video-rough-edit" } }; function agentTaskForLesson(lesson) { const task = VIDEO_AGENT_TASKS[(lesson && lesson.exercise_id) || ""]; if (!task) return null; return Object.assign({}, task, { links(url) { const accessKey = taskToken(url); const journal = accessKey ? location.origin + "/agent/api/xuong-video/journal?t=" + accessKey : ""; const sample = accessKey && task.trigger === "video-rough-edit" ? location.origin + "/agent/api/xuong-video/download?t=" + accessKey + "&name=video_tho_mau.mp4" : ""; return { journal, sample }; }, copy(url) { const links = this.links(url); return [ "Em muốn làm bài: " + task.title + ".", "Link nhiệm vụ AI: " + url, links.journal ? "Link xem Nhật Ký Xưởng Video: " + links.journal : "", links.sample ? "Video thô mẫu để chạy thử: " + links.sample : "", "Hãy mở link, đọc đúng hướng dẫn bài này, dùng action nội bộ trigger `" + task.trigger + "` nếu cần.", "Nếu chạy Web LMS thì dùng link nhật ký/tải file ở trên; nếu chạy local thì mở folder Desktop.", "Làm bằng tiếng Việt, mở file/báo cáo cho em xem, chỉ tự nộp khi em đã ưng ý." ].filter(Boolean).join("\n"); } }); } function taskToken(url) { try { return new URL(url, location.origin).searchParams.get("t") || ""; } catch (e) { return ""; } } Object.assign(window, { agentTaskForLesson });