2026-02-08 16:20:52 +09:00
|
|
|
import { randomUUID } from "crypto"
|
|
|
|
|
import type { BackgroundTask, LaunchInput } from "../types"
|
|
|
|
|
|
|
|
|
|
export function createTask(input: LaunchInput): BackgroundTask {
|
|
|
|
|
return {
|
|
|
|
|
id: `bg_${randomUUID().slice(0, 8)}`,
|
|
|
|
|
status: "pending",
|
|
|
|
|
queuedAt: new Date(),
|
|
|
|
|
description: input.description,
|
|
|
|
|
prompt: input.prompt,
|
|
|
|
|
agent: input.agent,
|
|
|
|
|
parentSessionID: input.parentSessionID,
|
|
|
|
|
parentMessageID: input.parentMessageID,
|
|
|
|
|
parentModel: input.parentModel,
|
|
|
|
|
parentAgent: input.parentAgent,
|
2026-02-14 14:30:30 +09:00
|
|
|
parentTools: input.parentTools,
|
2026-02-08 16:20:52 +09:00
|
|
|
model: input.model,
|
|
|
|
|
}
|
|
|
|
|
}
|