import { esc, fmt } from "./util.js"; import { value } from "./render.js"; // Keep the task's actual inputs visible; hashes and bookkeeping belong in an // expandable record. All content still passes through the shared safe renderer. export function taskContent(task) { const primary = /^(prompt|instruction|instructions|question|description|messages|input|inputs|content|text|audio|audio_url|image|image_url|video_url|context|tools)$/i; const entries = Object.entries(task); const inputs = entries.filter(([key, v]) => primary.test(key) && v != null && v !== ""); const metadata = Object.fromEntries(entries.filter(([key]) => !primary.test(key))); return `${task.media_ready === false ? `
This task exposes structured fields. Open its record below to inspect them.
`}