// The generation tasks (release 27, S5), and one dispatcher the editor's // `report-draft` job runs (S6). import type { MediaStepTask } from "../../../generationSettings"; import type { MediaTaskInput } from "./media"; import { cut, type CutInput } from "./cut"; import { flips } from "./flips"; import { narrate, type NarrateInput } from "./narrate"; import { onscreen, type OnscreenInput } from "./onscreen"; import { teaser, type TeaserInput } from "./teaser"; import { research, type ResearchInput } from "./research"; import { reviseReport, type ReviseReportInput } from "./revise-report"; import { reviseVideo, type ReviseVideoInput } from "./revise-video"; import { sweepAgent, type SweepAgentInput } from "./sweep-agent"; import { sweepPipeline, type SweepPipelineInput } from "./sweep-pipeline"; import { TaskInputError, runOnIteration } from "./run"; import { threads } from "./threads"; import { TASK_NAMES, type TaskDeps, type TaskName, type TaskResult } from "./types"; import { youtube } from "./youtube"; import { social } from "./social"; import { refresh, type RefreshInput } from "../refresh/task"; export * from "./types"; export { TaskInputError, runOnIteration, usageOf } from "./run"; export { sweepAgent, SWEEP_READ_TOOLS, type SweepAgentInput } from "./sweep-agent"; export { sweepPipeline, type SweepPipelineInput } from "./sweep-pipeline"; export { reviseReport, type ReviseReportInput } from "./revise-report"; export { reviseVideo, type ReviseVideoInput } from "./revise-video"; export { narrate, NARRATE_SPEC, type NarrateInput } from "./narrate"; export { cut, CUT_SPEC, CUT_MIN_CLIPS, DEFAULT_MAX_CLIPS, buildCut, cutCandidates, isConverterOrder, type CutInput } from "./cut"; export { loadDeckChecks, type DeckChecks } from "./deckChecks"; export { teaser, TEASER_SPEC, TEASER_MIN_LINES, TEASER_MAX_LINES, TEASER_LINE_MAX, checkTeaser, type TeaserInput } from "./teaser"; export { onscreen, ONSCREEN_SPEC, ONSCREEN_TITLE_MAX, ONSCREEN_SUBTITLE_MAX, checkOnscreen, type OnscreenInput } from "./onscreen"; // The media task scaffold (release 28, M0): what every media task is. export { ALTERNATIVES_PER_FIELD, defaultScore, draftFileName, isSkip, loadMediaContext, mergeAlternatives, rankAttempts, readDraftFile, runMediaTask, type DraftAlternative, type DraftFile, type MediaAttempt, type MediaContext, type MediaReport, type MediaSkip, type MediaTaskInput, type MediaTaskSpec, type MediaUnit, } from "./media"; // Release 28 M4–M6: the left panel (flips or threads) and the upload's text. export { flips, FLIPS_SPEC, planFlips, sideWords, swapEntries, type FlipsInput, type FlipsPlan, type FlipsValue } from "./flips"; export { threads, THREADS_SPEC, THREADS_TASK_COUNT, planThreads, type ThreadsInput, type ThreadsPlan, type ThreadsValue } from "./threads"; export { youtube, YOUTUBE_SPEC, YOUTUBE_SUMMARY_MAX, type YoutubeInput, type YoutubeValue } from "./youtube"; // Release 29 G2: the promotion text for X and Bluesky. export { social, SOCIAL_SPEC, postBudget, postProblems, type SocialInput, type SocialValue } from "./social"; export { checkLine, clipFacts, whenOf, type ClipFact } from "./clipEvidence"; export { research, RESEARCH_READ_TOOLS, type ResearchInput } from "./research"; export { pickCorpusBuild, listCorpusBuilds, siteOriginOf, NoCorpusBuildError, type CorpusBuild } from "./corpusSource"; export { momentHref, rewriteLinks, rewriteMomentBases, slugResolver } from "./links"; export { checkQuotes, convertSweepText, dropFailedFindings, type QuoteProblem } from "./quotes"; export { projectDirOf } from "./project"; // Release 29 M8: verdict proposals (a job of their own, no iteration: controller/reportVerdicts.ts). export { proposeVerdicts, verdictsModelOf, VerdictsRefusal, VERDICTS_TASK, type VerdictsDeps, type VerdictsInput, type VerdictsOutcome } from "./verdicts"; // umtool R4: the sweep's `ids` restriction (a general sweep option). export { restrictEnumerateText, restrictTools } from "./restrict"; // umtool R3: a sweep's trace (trace.jsonl). export { TRACE_FILE, enumerateOf, openTrace, runStartsOf, type TraceCite, type TraceEvent, type TraceInput } from "./trace"; export type TaskInput = | ({ task: "sweep-agent" } & SweepAgentInput) | ({ task: "sweep-pipeline" } & SweepPipelineInput) | ({ task: "revise-report" } & ReviseReportInput) | ({ task: "revise-video" } & ReviseVideoInput) | ({ task: "narrate" } & NarrateInput) | ({ task: "research" } & ResearchInput) | ({ task: "refresh" } & RefreshInput) | ({ task: "cut" } & CutInput) | ({ task: "onscreen" } & OnscreenInput) | ({ task: "teaser" } & TeaserInput) | ({ task: Exclude } & MediaTaskInput); export function runTask(input: TaskInput, deps: TaskDeps): Promise { switch (input.task) { case "sweep-agent": return sweepAgent(input, deps); case "sweep-pipeline": return sweepPipeline(input, deps); case "revise-report": return reviseReport(input, deps); case "revise-video": return reviseVideo(input, deps); case "narrate": return narrate(input, deps); case "research": return research(input, deps); case "refresh": return refresh(input, deps); case "flips": return flips(input, deps); case "threads": return threads(input, deps); case "youtube": return youtube(input, deps); case "social": return social(input, deps); case "cut": return cut(input, deps); case "onscreen": return onscreen(input, deps); case "teaser": return teaser(input, deps); } } export const isTaskName = (v: unknown): v is TaskName => typeof v === "string" && (TASK_NAMES as readonly string[]).includes(v);