{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "agent-task-progress",
  "title": "Agent Task Progress Block",
  "description": "A live view of an AI agent working through a task: goal, status, gradient progress bar, elapsed time and tokens, a step timeline with tool chips and streaming logs, an automatic retry after a failure, a step that waits for your approval, pause and stop controls, and downloadable files at the end.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/agent-task-progress/agent-task-progress.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport interface AgentStep {\n  id: string;\n  title: string;\n  /** Tool label shown as a chip, e.g. Search, Browser, Code. */\n  tool: string;\n  /** Simulated run time in ms. */\n  duration: number;\n  /** Log lines revealed while the step runs. */\n  logs: string[];\n  /** One-line result shown once done. */\n  output?: string;\n  /** Fail the first attempt at this many ms with this error, then retry automatically. */\n  fail?: { at: number; error: string };\n  /** Pause and ask the user before running. */\n  approval?: string;\n}\n\nexport interface AgentArtifact {\n  name: string;\n  /** File contents for the download. */\n  content: string;\n  type?: string;\n}\n\nexport interface AgentTaskProgressProps {\n  goal?: string;\n  agentName?: string;\n  steps?: AgentStep[];\n  artifacts?: AgentArtifact[];\n  /** Start running on mount. */\n  autoStart?: boolean;\n  /** Playback speed multiplier for the simulation. */\n  speed?: number;\n  onApprove?: (stepId: string) => void;\n  onStop?: () => void;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { bg: \"#0A0A0A\", text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.62)\", faint: \"rgba(245,244,241,0.38)\", card: \"#121212\", border: \"rgba(255,255,255,0.09)\", chip: \"rgba(255,255,255,0.06)\", code: \"#0C0C0C\", on: \"#F5F4F1\", onText: \"#0A0A0A\", accent: \"#FB923C\", ok: \"#4ADE80\", err: \"#F87171\", warn: \"#FBBF24\", ring: \"rgba(245,244,241,0.6)\", track: \"rgba(255,255,255,0.08)\" },\n  light: { bg: \"#FAFAF8\", text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.62)\", faint: \"rgba(10,10,10,0.42)\", card: \"#FFFFFF\", border: \"rgba(10,10,10,0.09)\", chip: \"rgba(10,10,10,0.05)\", code: \"#F6F6F3\", on: \"#0A0A0A\", onText: \"#FAFAF8\", accent: \"#EA580C\", ok: \"#15803D\", err: \"#DC2626\", warn: \"#B45309\", ring: \"rgba(10,10,10,0.5)\", track: \"rgba(10,10,10,0.08)\" },\n};\nconst GRADIENT = \"linear-gradient(90deg,#FB923C,#EC4899,#8B5CF6,#3B82F6)\";\n\nconst DEFAULT_STEPS: AgentStep[] = [\n  { id: \"plan\", title: \"Plan the work\", tool: \"Think\", duration: 1600, logs: [\"Goal: compare pricing of 5 tools in our category\", \"Plan: search → read pages → extract → compare → draft → share\"], output: \"6 steps planned\" },\n  { id: \"search\", title: \"Find pricing pages\", tool: \"Search\", duration: 2400, logs: ['search(\"project management software pricing 2026\")', \"12 results · kept 5 vendors with public pricing\", \"halcyon.app · lumen.so · tessellate.io · kestrel.dev · fieldnote.co\"], output: \"5 pricing pages found\" },\n  { id: \"browse\", title: \"Read 5 pricing pages\", tool: \"Browser\", duration: 3400, logs: [\"open halcyon.app/pricing ✓\", \"open lumen.so/pricing ✓\", \"open tessellate.io/pricing ✓\", \"open kestrel.dev/pricing ✓\", \"open fieldnote.co/pricing ✓\"], output: \"5 pages read · 23 plans\", fail: { at: 1500, error: \"Timed out loading tessellate.io/pricing after 10s\" } },\n  { id: \"extract\", title: \"Extract plans into a table\", tool: \"Code\", duration: 2400, logs: [\"parse 23 plans from 5 pages\", \"normalise to USD per seat per month\", \"write comparison.csv (23 rows)\"], output: \"comparison.csv\" },\n  { id: \"draft\", title: \"Draft the summary\", tool: \"Write\", duration: 2800, logs: [\"median Team plan: $12 per seat\", \"we are 18% above median · 2 of 5 have a free tier\", \"write pricing-summary.md (412 words)\"], output: \"pricing-summary.md\" },\n  { id: \"share\", title: \"Share in #pricing\", tool: \"Message\", duration: 1000, logs: [\"post pricing-summary.md to #pricing\"], output: \"Posted to #pricing\", approval: \"Post the summary to #pricing? 14 people will see it.\" },\n];\nconst DEFAULT_ARTIFACTS: AgentArtifact[] = [\n  { name: \"pricing-summary.md\", type: \"text/markdown\", content: \"# Competitor pricing\\n\\n- Median Team plan: $12 per seat per month\\n- We are 18% above the median\\n- 2 of 5 competitors offer a free tier\\n\\nRecommendation: add a free tier for up to 3 seats.\\n\" },\n  { name: \"comparison.csv\", type: \"text/csv\", content: \"vendor,plan,usd_per_seat\\nhalcyon,Team,12\\nlumen,Pro,10\\ntessellate,Business,16\\nkestrel,Team,11\\nfieldnote,Plus,9\\n\" },\n];\n\ntype Status = \"idle\" | \"running\" | \"paused\" | \"waiting\" | \"done\" | \"stopped\";\ntype StepState = \"todo\" | \"running\" | \"retrying\" | \"done\" | \"failed\" | \"skipped\" | \"cancelled\";\ninterface Run {\n  status: Status;\n  i: number;\n  t: number;\n  wait: number;\n  attempt: number;\n  elapsed: number;\n  states: StepState[];\n  errors: string[];\n}\ntype Act = { type: \"tick\"; dt: number; steps: AgentStep[] } | { type: \"start\"; steps: AgentStep[] } | { type: \"pause\" } | { type: \"resume\" } | { type: \"stop\" } | { type: \"approve\" } | { type: \"skip\"; steps: AgentStep[] };\n\nconst fresh = (steps: AgentStep[]): Run => ({ status: \"idle\", i: 0, t: 0, wait: 0, attempt: 1, elapsed: 0, states: steps.map(() => \"todo\"), errors: steps.map(() => \"\") });\n\nfunction advance(r: Run, steps: AgentStep[], from: number): Run {\n  const next = from + 1;\n  if (next >= steps.length) return { ...r, i: steps.length, t: 0, status: \"done\" };\n  const states = [...r.states];\n  if (steps[next].approval) return { ...r, i: next, t: 0, attempt: 1, status: \"waiting\", states };\n  states[next] = \"running\";\n  return { ...r, i: next, t: 0, attempt: 1, states };\n}\n\nfunction reducer(r: Run, a: Act): Run {\n  switch (a.type) {\n    case \"start\": {\n      const base = fresh(a.steps);\n      if (a.steps[0]?.approval) return { ...base, status: \"waiting\" };\n      base.states[0] = \"running\";\n      return { ...base, status: \"running\" };\n    }\n    case \"pause\":\n      return r.status === \"running\" ? { ...r, status: \"paused\" } : r;\n    case \"resume\":\n      return r.status === \"paused\" ? { ...r, status: \"running\" } : r;\n    case \"stop\": {\n      const states = r.states.map((s) => (s === \"running\" || s === \"retrying\" ? \"cancelled\" : s));\n      if (r.status === \"waiting\") states[r.i] = \"cancelled\";\n      return { ...r, status: \"stopped\", states };\n    }\n    case \"approve\": {\n      if (r.status !== \"waiting\") return r;\n      const states = [...r.states];\n      states[r.i] = \"running\";\n      return { ...r, status: \"running\", states, t: 0 };\n    }\n    case \"skip\": {\n      if (r.status !== \"waiting\") return r;\n      const states = [...r.states];\n      states[r.i] = \"skipped\";\n      return advance({ ...r, status: \"running\", states }, a.steps, r.i);\n    }\n    case \"tick\": {\n      if (r.status !== \"running\") return r;\n      const steps = a.steps;\n      const s = steps[r.i];\n      if (!s) return { ...r, status: \"done\" };\n      const elapsed = r.elapsed + a.dt;\n      if (r.wait > 0) {\n        const wait = r.wait - a.dt;\n        if (wait > 0) return { ...r, elapsed, wait };\n        const states = [...r.states];\n        states[r.i] = \"running\";\n        return { ...r, elapsed, wait: 0, t: 0, attempt: r.attempt + 1, states };\n      }\n      const t = r.t + a.dt;\n      if (s.fail && r.attempt === 1 && t >= s.fail.at) {\n        const states = [...r.states];\n        const errors = [...r.errors];\n        states[r.i] = \"retrying\";\n        errors[r.i] = s.fail.error;\n        return { ...r, elapsed, t, wait: 1400, states, errors };\n      }\n      if (t >= s.duration) {\n        const states = [...r.states];\n        states[r.i] = \"done\";\n        return advance({ ...r, elapsed, states }, steps, r.i);\n      }\n      return { ...r, elapsed, t };\n    }\n  }\n}\n\nconst mmss = (ms: number) => `${String(Math.floor(ms / 60000)).padStart(2, \"0\")}:${String(Math.floor(ms / 1000) % 60).padStart(2, \"0\")}`;\n\nexport function AgentTaskProgress({ goal = \"Compare competitor pricing and draft a summary for the team\", agentName = \"Research agent\", steps = DEFAULT_STEPS, artifacts = DEFAULT_ARTIFACTS, autoStart = true, speed = 1, onApprove, onStop, theme = \"dark\", className }: AgentTaskProgressProps) {\n  const p = PALETTES[theme];\n  const reduce = !!useReducedMotion();\n  const uid = React.useId();\n  const [run, dispatch] = React.useReducer(reducer, steps, fresh);\n  const [open, setOpen] = React.useState<string[]>([]);\n  const started = React.useRef(false);\n  // Move focus to Approve when the agent stops to ask, so keyboard users can answer right away.\n  const focusApprove = React.useCallback((el: HTMLButtonElement | null) => el?.focus({ preventScroll: true }), []);\n\n  React.useEffect(() => {\n    if (run.status !== \"running\") return;\n    const t = setInterval(() => dispatch({ type: \"tick\", dt: 100 * speed, steps }), 100);\n    return () => clearInterval(t);\n  }, [run.status, speed, steps]);\n\n  const kickoff = (el: HTMLElement | null) => {\n    if (!el || started.current || !autoStart) return;\n    started.current = true;\n    setTimeout(() => dispatch({ type: \"start\", steps }), 500);\n  };\n\n  const doneCount = run.states.filter((s) => s === \"done\" || s === \"skipped\").length;\n  const pct = run.status === \"done\" ? 100 : ((doneCount + (steps[run.i] && run.states[run.i] === \"running\" ? Math.min(1, run.t / steps[run.i].duration) : 0)) / steps.length) * 100;\n  const tokens = Math.round(run.elapsed * 1.37 + doneCount * 820);\n  const label: Record<Status, { text: string; color: string }> = {\n    idle: { text: \"Ready\", color: p.faint },\n    running: { text: \"Running\", color: p.accent },\n    paused: { text: \"Paused\", color: p.warn },\n    waiting: { text: \"Needs approval\", color: p.warn },\n    done: { text: \"Completed\", color: p.ok },\n    stopped: { text: \"Stopped\", color: p.err },\n  };\n  const download = (a: AgentArtifact) => {\n    const url = URL.createObjectURL(new Blob([a.content], { type: a.type ?? \"text/plain\" }));\n    const link = document.createElement(\"a\");\n    link.href = url;\n    link.download = a.name;\n    link.click();\n    setTimeout(() => URL.revokeObjectURL(url), 1000);\n  };\n\n  const ring = { [\"--tw-ring-color\" as string]: p.ring, [\"--tw-ring-offset-color\" as string]: p.card } as React.CSSProperties;\n  const focus = \"outline-none focus-visible:ring-2 focus-visible:ring-offset-2\";\n  const btn = cn(\"flex h-8 cursor-pointer items-center gap-1.5 rounded-lg border px-3 text-[13px] disabled:cursor-not-allowed disabled:opacity-40\", focus);\n  const stepIcon = (st: StepState, waiting: boolean) => {\n    if (st === \"done\")\n      return (\n        <svg width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" fill=\"none\" stroke={p.onText} strokeWidth=\"2.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n          <path d=\"m3 8.5 3 3 7-7\" />\n        </svg>\n      );\n    if (st === \"running\" || st === \"retrying\") return <motion.span className=\"h-3 w-3 rounded-full border-2\" style={{ borderTopColor: \"transparent\", borderRightColor: st === \"retrying\" ? p.warn : p.accent, borderBottomColor: st === \"retrying\" ? p.warn : p.accent, borderLeftColor: st === \"retrying\" ? p.warn : p.accent }} animate={reduce ? undefined : { rotate: 360 }} transition={{ duration: 0.8, repeat: Infinity, ease: \"linear\" }} aria-hidden=\"true\" />;\n    if (st === \"skipped\" || st === \"cancelled\")\n      return (\n        <svg width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\">\n          <path d=\"M4 8h8\" />\n        </svg>\n      );\n    if (waiting)\n      return (\n        <svg width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" fill=\"none\" stroke={p.warn} strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\">\n          <path d=\"M8 4.5V9M8 11.5v.01\" />\n        </svg>\n      );\n    return null;\n  };\n  const stateText: Record<StepState, string> = { todo: \"Queued\", running: \"Running\", retrying: \"Retrying\", done: \"Done\", failed: \"Failed\", skipped: \"Skipped\", cancelled: \"Cancelled\" };\n\n  return (\n    <section ref={kickoff} className={cn(\"@container w-full\", className)} style={{ background: p.bg, color: p.text }}>\n      <div className=\"mx-auto max-w-3xl px-4 py-10 @[640px]:px-6 @[640px]:py-14\">\n        <div className=\"overflow-hidden rounded-2xl border\" style={{ background: p.card, borderColor: p.border }}>\n          {/* Header */}\n          <div className=\"p-5 @[640px]:p-6\">\n            <div className=\"flex flex-wrap items-center justify-between gap-3\">\n              <span className=\"flex items-center gap-2 text-[13px]\" style={{ color: p.muted }}>\n                <span className=\"flex h-6 w-6 items-center justify-center rounded-full\" style={{ background: p.chip, color: p.accent }} aria-hidden=\"true\">\n                  ✦\n                </span>\n                {agentName}\n                <span className=\"flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[12px] font-medium\" style={{ background: p.chip, color: label[run.status].color }} role=\"status\">\n                  <span className=\"relative flex h-1.5 w-1.5\">\n                    {run.status === \"running\" && !reduce && <span className=\"absolute inline-flex h-full w-full animate-ping rounded-full opacity-70\" style={{ background: p.accent }} />}\n                    <span className=\"relative h-1.5 w-1.5 rounded-full\" style={{ background: label[run.status].color }} />\n                  </span>\n                  {label[run.status].text}\n                </span>\n              </span>\n              <div className=\"flex gap-1.5\">\n                {run.status === \"running\" || run.status === \"paused\" ? (\n                  <button type=\"button\" onClick={() => dispatch({ type: run.status === \"running\" ? \"pause\" : \"resume\" })} className={btn} style={{ borderColor: p.border, background: \"transparent\", color: p.text, ...ring }}>\n                    {run.status === \"running\" ? (\n                      <>\n                        <svg width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n                          <path d=\"M4 3h3v10H4zM9 3h3v10H9z\" />\n                        </svg>\n                        Pause\n                      </>\n                    ) : (\n                      <>\n                        <svg width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n                          <path d=\"M4 2.5v11l9-5.5z\" />\n                        </svg>\n                        Resume\n                      </>\n                    )}\n                  </button>\n                ) : null}\n                {run.status === \"running\" || run.status === \"paused\" || run.status === \"waiting\" ? (\n                  <button\n                    type=\"button\"\n                    onClick={() => {\n                      dispatch({ type: \"stop\" });\n                      onStop?.();\n                    }}\n                    className={btn}\n                    style={{ borderColor: p.border, background: \"transparent\", color: p.err, ...ring }}\n                  >\n                    <svg width=\"11\" height=\"11\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n                      <rect x=\"3\" y=\"3\" width=\"10\" height=\"10\" rx=\"2\" />\n                    </svg>\n                    Stop\n                  </button>\n                ) : (\n                  <button type=\"button\" onClick={() => dispatch({ type: \"start\", steps })} className={btn} style={{ borderColor: \"transparent\", background: p.on, color: p.onText, ...ring }}>\n                    <svg width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\">\n                      {run.status === \"idle\" ? <path d=\"M4 2.5v11l9-5.5z\" fill=\"currentColor\" stroke=\"none\" /> : <path d=\"M13 8a5 5 0 1 1-1.5-3.5M13 3v3h-3\" />}\n                    </svg>\n                    {run.status === \"idle\" ? \"Start\" : \"Run again\"}\n                  </button>\n                )}\n              </div>\n            </div>\n            <h2 className=\"m-0 mt-4 text-[19px] leading-snug font-semibold tracking-[-0.015em] @[640px]:text-[21px]\">{goal}</h2>\n            <div className=\"mt-4 h-1.5 overflow-hidden rounded-full\" style={{ background: p.track }} role=\"progressbar\" aria-label=\"Task progress\" aria-valuenow={Math.round(pct)} aria-valuemin={0} aria-valuemax={100}>\n              <motion.div className=\"h-full rounded-full\" style={{ background: run.status === \"stopped\" ? p.err : GRADIENT }} initial={false} animate={{ width: `${pct}%` }} transition={{ duration: reduce ? 0 : 0.25, ease: \"linear\" }} />\n            </div>\n            <dl className=\"m-0 mt-3 flex flex-wrap gap-x-5 gap-y-1 text-[12.5px] tabular-nums\" style={{ color: p.faint }}>\n              {[\n                [\"Steps\", `${doneCount} of ${steps.length}`],\n                [\"Elapsed\", mmss(run.elapsed)],\n                [\"Tokens\", tokens >= 1000 ? `${(tokens / 1000).toFixed(1)}k` : String(tokens)],\n              ].map(([k, v]) => (\n                <div key={k} className=\"flex gap-1.5\">\n                  <dt>{k}</dt>\n                  <dd className=\"m-0\" style={{ color: p.muted }}>\n                    {v}\n                  </dd>\n                </div>\n              ))}\n            </dl>\n          </div>\n\n          {/* Steps */}\n          <ol className=\"m-0 list-none border-t px-5 py-4 @[640px]:px-6\" style={{ borderColor: p.border }} aria-label=\"Steps\">\n            {steps.map((s, i) => {\n              const st = run.states[i];\n              const waiting = run.status === \"waiting\" && run.i === i;\n              const active = st === \"running\" || st === \"retrying\" || waiting;\n              const expanded = active || open.includes(s.id);\n              const canToggle = !active && (st === \"done\" || st === \"cancelled\" || st === \"skipped\");\n              const shownLogs = st === \"done\" ? s.logs.length : st === \"running\" ? Math.min(s.logs.length, Math.floor((run.t / s.duration) * s.logs.length) + 1) : st === \"retrying\" ? Math.max(1, Math.floor(((s.fail?.at ?? 0) / s.duration) * s.logs.length)) : 0;\n              const last = i === steps.length - 1;\n              return (\n                <li key={s.id} className=\"relative flex gap-3.5\">\n                  {!last && <span className=\"absolute top-7 bottom-0 left-[11px] w-px\" style={{ background: st === \"done\" || st === \"skipped\" ? p.faint : p.track }} aria-hidden=\"true\" />}\n                  <span className=\"relative z-10 mt-1 flex h-[23px] w-[23px] shrink-0 items-center justify-center rounded-full border\" style={{ borderColor: st === \"done\" ? p.ok : active ? (waiting || st === \"retrying\" ? p.warn : p.accent) : p.border, background: st === \"done\" ? p.ok : p.card, color: p.faint }}>\n                    {stepIcon(st, waiting)}\n                  </span>\n                  <div className={cn(\"min-w-0 flex-1\", !last && \"pb-5\")}>\n                    <div className=\"flex items-start justify-between gap-3\">\n                      <button\n                        type=\"button\"\n                        disabled={!canToggle}\n                        aria-expanded={canToggle ? expanded : undefined}\n                        aria-controls={`${uid}-${s.id}`}\n                        onClick={() => setOpen((v) => (v.includes(s.id) ? v.filter((x) => x !== s.id) : [...v, s.id]))}\n                        className={cn(\"min-w-0 cursor-pointer rounded-md border-0 bg-transparent p-0 text-left disabled:cursor-default\", focus)}\n                        style={{ color: st === \"todo\" && !waiting ? p.faint : p.text, ...ring }}\n                      >\n                        <span className=\"block text-[14.5px] font-medium\">{s.title}</span>\n                        <span className=\"sr-only\">, {waiting ? \"Needs approval\" : stateText[st]}</span>\n                        <span className=\"mt-1 flex flex-wrap items-center gap-2 text-[12px]\" style={{ color: p.faint }}>\n                          <span className=\"rounded px-1.5 py-px font-mono text-[11px]\" style={{ background: p.chip, color: p.muted }}>\n                            {s.tool}\n                          </span>\n                          {st === \"done\" && s.output && <span style={{ color: p.muted }}>{s.output}</span>}\n                          {st === \"retrying\" && <span style={{ color: p.warn }}>Retrying, attempt 2 of 3</span>}\n                          {run.attempt > 1 && run.i === i && st === \"running\" && <span style={{ color: p.muted }}>Attempt {run.attempt}</span>}\n                          {st === \"skipped\" && <span>Skipped</span>}\n                          {st === \"cancelled\" && <span style={{ color: p.err }}>Cancelled</span>}\n                        </span>\n                      </button>\n                      {canToggle && (\n                        <motion.svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" className=\"mt-1 shrink-0\" style={{ color: p.faint }} animate={{ rotate: expanded ? 180 : 0 }} aria-hidden=\"true\">\n                          <path d=\"m4 6 4 4 4-4\" />\n                        </motion.svg>\n                      )}\n                    </div>\n                    <AnimatePresence initial={false}>\n                      {expanded && (shownLogs > 0 || waiting || run.errors[i]) && (\n                        <motion.div id={`${uid}-${s.id}`} initial={reduce ? false : { height: 0, opacity: 0 }} animate={{ height: \"auto\", opacity: 1 }} exit={reduce ? undefined : { height: 0, opacity: 0 }} transition={{ duration: 0.22 }} className=\"overflow-hidden\">\n                          {waiting ? (\n                            <div className=\"mt-3 rounded-xl border p-3.5\" style={{ borderColor: p.warn, background: p.chip }}>\n                              <p className=\"m-0 text-[13.5px]\">{s.approval}</p>\n                              <div className=\"mt-3 flex gap-2\">\n                                <button\n                                  type=\"button\"\n                                  ref={focusApprove}\n                                  onClick={() => {\n                                    dispatch({ type: \"approve\" });\n                                    onApprove?.(s.id);\n                                  }}\n                                  className={btn}\n                                  style={{ borderColor: \"transparent\", background: p.on, color: p.onText, ...ring }}\n                                >\n                                  Approve\n                                </button>\n                                <button type=\"button\" onClick={() => dispatch({ type: \"skip\", steps })} className={btn} style={{ borderColor: p.border, background: \"transparent\", color: p.text, ...ring }}>\n                                  Skip step\n                                </button>\n                              </div>\n                            </div>\n                          ) : (\n                            <div className=\"mt-2.5 overflow-x-auto rounded-lg border px-3 py-2 font-mono text-[12px] leading-[1.75]\" style={{ borderColor: p.border, background: p.code, color: p.muted }} aria-live={active ? \"polite\" : undefined}>\n                              {run.errors[i] && (\n                                <div style={{ color: p.err }}>\n                                  <span aria-hidden=\"true\">✕ </span>\n                                  {run.errors[i]}\n                                </div>\n                              )}\n                              {s.logs.slice(0, shownLogs).map((l, k) => (\n                                <motion.div key={`${run.attempt}-${k}`} initial={reduce ? false : { opacity: 0, x: -4 }} animate={{ opacity: 1, x: 0 }} className=\"break-words whitespace-pre-wrap\">\n                                  <span style={{ color: p.faint }} aria-hidden=\"true\">\n                                    ›{\" \"}\n                                  </span>\n                                  {l}\n                                </motion.div>\n                              ))}\n                              {st === \"running\" && (\n                                <motion.span className=\"inline-block h-3 w-1.5 align-middle\" style={{ background: p.accent }} animate={reduce ? undefined : { opacity: [1, 0, 1] }} transition={{ duration: 0.9, repeat: Infinity }} aria-hidden=\"true\" />\n                              )}\n                            </div>\n                          )}\n                        </motion.div>\n                      )}\n                    </AnimatePresence>\n                  </div>\n                </li>\n              );\n            })}\n          </ol>\n\n          {/* Artifacts */}\n          <AnimatePresence>\n            {run.status === \"done\" && artifacts.length > 0 && (\n              <motion.div initial={reduce ? false : { opacity: 0, height: 0 }} animate={{ opacity: 1, height: \"auto\" }} className=\"overflow-hidden border-t\" style={{ borderColor: p.border }}>\n                <div className=\"px-5 py-4 @[640px]:px-6\">\n                  <p className=\"m-0 mb-2.5 text-[12.5px]\" style={{ color: p.faint }}>\n                    Files created\n                  </p>\n                  <ul className=\"m-0 grid list-none gap-2 p-0 @[480px]:grid-cols-2\">\n                    {artifacts.map((a) => (\n                      <li key={a.name}>\n                        <button type=\"button\" onClick={() => download(a)} className={cn(\"flex w-full cursor-pointer items-center gap-3 rounded-xl border px-3 py-2.5 text-left\", focus)} style={{ borderColor: p.border, background: \"transparent\", color: p.text, ...ring }} aria-label={`Download ${a.name}`}>\n                          <span className=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg font-mono text-[10px] font-bold uppercase\" style={{ background: p.chip, color: p.accent }} aria-hidden=\"true\">\n                            {a.name.split(\".\").pop()}\n                          </span>\n                          <span className=\"min-w-0 flex-1\">\n                            <span className=\"block truncate text-[13.5px] font-medium\">{a.name}</span>\n                            <span className=\"block text-[12px]\" style={{ color: p.faint }}>\n                              {(new Blob([a.content]).size / 1024).toFixed(1)} KB\n                            </span>\n                          </span>\n                          <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" style={{ color: p.muted }}>\n                            <path d=\"M12 4v11m0 0-4-4m4 4 4-4M5 20h14\" />\n                          </svg>\n                        </button>\n                      </li>\n                    ))}\n                  </ul>\n                </div>\n              </motion.div>\n            )}\n          </AnimatePresence>\n        </div>\n      </div>\n    </section>\n  );\n}\n\nexport default AgentTaskProgress;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}