[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-trigger-dev-trigger-realtime":3,"mdc--dp6i8g-key":35,"related-org-trigger-dev-trigger-realtime":5837,"related-repo-trigger-dev-trigger-realtime":5997},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":24,"repoUrl":25,"updatedAt":26,"license":27,"forks":28,"topics":29,"repo":30,"sourceUrl":33,"mdContent":34},"trigger-realtime","monitor Trigger.dev tasks in real-time","Subscribe to Trigger.dev task runs in real-time from frontend and backend. Use when building progress indicators, live dashboards, streaming AI\u002FLLM responses, or React components that display task status.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"trigger-dev","Trigger.dev","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftrigger-dev.jpg","triggerdotdev",[13,17,18,21],{"name":14,"slug":15,"type":16},"Observability","observability","tag",{"name":9,"slug":8,"type":16},{"name":19,"slug":20,"type":16},"Real-time","real-time",{"name":22,"slug":23,"type":16},"Frontend","frontend",30,"https:\u002F\u002Fgithub.com\u002Ftriggerdotdev\u002Fskills","2026-04-06T18:54:47.293822",null,5,[],{"repoUrl":25,"stars":24,"forks":28,"topics":31,"description":32},[],"Best practices for building AI agents and background jobs with Trigger.dev. Use when creating durable tasks, scheduling workflows, or integrating with the Trigger.dev SDK.","https:\u002F\u002Fgithub.com\u002Ftriggerdotdev\u002Fskills\u002Ftree\u002FHEAD\u002Ftrigger-realtime","---\nname: trigger-realtime\ndescription: Subscribe to Trigger.dev task runs in real-time from frontend and backend. Use when building progress indicators, live dashboards, streaming AI\u002FLLM responses, or React components that display task status.\n---\n\n# Trigger.dev Realtime\n\nSubscribe to task runs and stream data in real-time from frontend and backend.\n\n## When to Use\n\n- Building progress indicators for long-running tasks\n- Creating live dashboards showing task status\n- Streaming AI\u002FLLM responses to the UI\n- React components that trigger and monitor tasks\n- Waiting for user approval in tasks\n\n## Authentication\n\n### Create Public Access Token (Backend)\n\n```ts\nimport { auth } from \"@trigger.dev\u002Fsdk\";\n\n\u002F\u002F Read-only token for specific runs\nconst publicToken = await auth.createPublicToken({\n  scopes: {\n    read: {\n      runs: [\"run_123\"],\n      tasks: [\"my-task\"],\n    },\n  },\n  expirationTime: \"1h\",\n});\n\n\u002F\u002F Pass this token to your frontend\n```\n\n### Create Trigger Token (for frontend triggering)\n\n```ts\nconst triggerToken = await auth.createTriggerPublicToken(\"my-task\", {\n  expirationTime: \"30m\",\n});\n```\n\n## Backend Subscriptions\n\n```ts\nimport { runs, tasks } from \"@trigger.dev\u002Fsdk\";\n\n\u002F\u002F Trigger and subscribe\nconst handle = await tasks.trigger(\"my-task\", { data: \"value\" });\n\nfor await (const run of runs.subscribeToRun(handle.id)) {\n  console.log(`Status: ${run.status}`);\n  console.log(`Progress: ${run.metadata?.progress}`);\n  \n  if (run.status === \"COMPLETED\") {\n    console.log(\"Output:\", run.output);\n    break;\n  }\n}\n\n\u002F\u002F Subscribe to tagged runs\nfor await (const run of runs.subscribeToRunsWithTag(\"user-123\")) {\n  console.log(`Run ${run.id}: ${run.status}`);\n}\n\n\u002F\u002F Subscribe to batch\nfor await (const run of runs.subscribeToBatch(batchId)) {\n  console.log(`Batch run ${run.id}: ${run.status}`);\n}\n```\n\n## React Hooks\n\n### Installation\n\n```bash\nnpm add @trigger.dev\u002Freact-hooks\n```\n\n### Trigger Task from React\n\n```tsx\n\"use client\";\nimport { useRealtimeTaskTrigger } from \"@trigger.dev\u002Freact-hooks\";\nimport type { myTask } from \"..\u002Ftrigger\u002Ftasks\";\n\nfunction TaskTrigger({ accessToken }: { accessToken: string }) {\n  const { submit, run, isLoading } = useRealtimeTaskTrigger\u003Ctypeof myTask>(\n    \"my-task\",\n    { accessToken }\n  );\n\n  return (\n    \u003Cdiv>\n      \u003Cbutton \n        onClick={() => submit({ data: \"value\" })} \n        disabled={isLoading}\n      >\n        Start Task\n      \u003C\u002Fbutton>\n      \n      {run && (\n        \u003Cdiv>\n          \u003Cp>Status: {run.status}\u003C\u002Fp>\n          \u003Cp>Progress: {run.metadata?.progress}%\u003C\u002Fp>\n          {run.output && \u003Cp>Result: {JSON.stringify(run.output)}\u003C\u002Fp>}\n        \u003C\u002Fdiv>\n      )}\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n### Subscribe to Existing Run\n\n```tsx\n\"use client\";\nimport { useRealtimeRun } from \"@trigger.dev\u002Freact-hooks\";\nimport type { myTask } from \"..\u002Ftrigger\u002Ftasks\";\n\nfunction RunStatus({ runId, accessToken }: { runId: string; accessToken: string }) {\n  const { run, error } = useRealtimeRun\u003Ctypeof myTask>(runId, {\n    accessToken,\n    onComplete: (run) => {\n      console.log(\"Completed:\", run.output);\n    },\n  });\n\n  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n  if (!run) return \u003Cdiv>Loading...\u003C\u002Fdiv>;\n\n  return (\n    \u003Cdiv>\n      \u003Cp>Status: {run.status}\u003C\u002Fp>\n      \u003Cp>Progress: {run.metadata?.progress || 0}%\u003C\u002Fp>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n### Subscribe to Tagged Runs\n\n```tsx\n\"use client\";\nimport { useRealtimeRunsWithTag } from \"@trigger.dev\u002Freact-hooks\";\n\nfunction UserTasks({ userId, accessToken }: { userId: string; accessToken: string }) {\n  const { runs } = useRealtimeRunsWithTag(`user-${userId}`, { accessToken });\n\n  return (\n    \u003Cul>\n      {runs.map((run) => (\n        \u003Cli key={run.id}>{run.id}: {run.status}\u003C\u002Fli>\n      ))}\n    \u003C\u002Ful>\n  );\n}\n```\n\n## Realtime Streams (AI\u002FLLM)\n\n### Define Stream (shared location)\n\n```ts\n\u002F\u002F trigger\u002Fstreams.ts\nimport { streams } from \"@trigger.dev\u002Fsdk\";\n\nexport const aiStream = streams.define\u003Cstring>({\n  id: \"ai-output\",\n});\n```\n\n### Pipe Stream in Task\n\n```ts\nimport { task } from \"@trigger.dev\u002Fsdk\";\nimport { aiStream } from \".\u002Fstreams\";\n\nexport const streamingTask = task({\n  id: \"streaming-task\",\n  run: async (payload: { prompt: string }) => {\n    const completion = await openai.chat.completions.create({\n      model: \"gpt-4\",\n      messages: [{ role: \"user\", content: payload.prompt }],\n      stream: true,\n    });\n\n    const { waitUntilComplete } = aiStream.pipe(completion);\n    await waitUntilComplete();\n  },\n});\n```\n\n### Read Stream in React\n\n```tsx\n\"use client\";\nimport { useRealtimeStream } from \"@trigger.dev\u002Freact-hooks\";\nimport { aiStream } from \"..\u002Ftrigger\u002Fstreams\";\n\nfunction AIResponse({ runId, accessToken }: { runId: string; accessToken: string }) {\n  const { parts, error } = useRealtimeStream(aiStream, runId, {\n    accessToken,\n    throttleInMs: 50,\n  });\n\n  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n  if (!parts) return \u003Cdiv>Waiting for response...\u003C\u002Fdiv>;\n\n  return \u003Cdiv>{parts.join(\"\")}\u003C\u002Fdiv>;\n}\n```\n\n## Wait Tokens (Human-in-the-loop)\n\n### In Task\n\n```ts\nimport { task, wait } from \"@trigger.dev\u002Fsdk\";\n\nexport const approvalTask = task({\n  id: \"approval-task\",\n  run: async (payload) => {\n    \u002F\u002F Process initial data\n    const processed = await processData(payload);\n\n    \u002F\u002F Wait for human approval\n    const approval = await wait.forToken\u003C{ approved: boolean }>({\n      token: `approval-${payload.id}`,\n      timeoutInSeconds: 86400, \u002F\u002F 24 hours\n    });\n\n    if (approval.approved) {\n      return await finalizeData(processed);\n    }\n    \n    throw new Error(\"Not approved\");\n  },\n});\n```\n\n### Complete Token from React\n\n```tsx\n\"use client\";\nimport { useWaitToken } from \"@trigger.dev\u002Freact-hooks\";\n\nfunction ApprovalButton({ tokenId, accessToken }: { tokenId: string; accessToken: string }) {\n  const { complete } = useWaitToken(tokenId, { accessToken });\n\n  return (\n    \u003Cdiv>\n      \u003Cbutton onClick={() => complete({ approved: true })}>\n        Approve\n      \u003C\u002Fbutton>\n      \u003Cbutton onClick={() => complete({ approved: false })}>\n        Reject\n      \u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Run Object Properties\n\n| Property | Description |\n|----------|-------------|\n| `id` | Unique run identifier |\n| `status` | `QUEUED`, `EXECUTING`, `COMPLETED`, `FAILED`, `CANCELED` |\n| `payload` | Task input (typed) |\n| `output` | Task result (typed, when completed) |\n| `metadata` | Real-time updatable data |\n| `createdAt` | Start timestamp |\n| `costInCents` | Execution cost |\n\n## Best Practices\n\n1. **Scope tokens narrowly** — only grant necessary permissions\n2. **Set expiration times** — don't use long-lived tokens\n3. **Use typed hooks** — pass task types for proper inference\n4. **Handle errors** — always check for errors in hooks\n5. **Throttle streams** — use `throttleInMs` to control re-renders\n\nSee `references\u002Frealtime.md` for complete documentation.\n",{"data":36,"body":37},{"name":4,"description":6},{"type":38,"children":39},"root",[40,49,55,62,92,98,105,440,446,554,560,1398,1404,1410,1438,1444,2226,2232,2935,2941,3372,3378,3384,3547,3553,4080,4086,4582,4588,4594,5123,5129,5569,5575,5749,5755,5818,5831],{"type":41,"tag":42,"props":43,"children":45},"element","h1",{"id":44},"triggerdev-realtime",[46],{"type":47,"value":48},"text","Trigger.dev Realtime",{"type":41,"tag":50,"props":51,"children":52},"p",{},[53],{"type":47,"value":54},"Subscribe to task runs and stream data in real-time from frontend and backend.",{"type":41,"tag":56,"props":57,"children":59},"h2",{"id":58},"when-to-use",[60],{"type":47,"value":61},"When to Use",{"type":41,"tag":63,"props":64,"children":65},"ul",{},[66,72,77,82,87],{"type":41,"tag":67,"props":68,"children":69},"li",{},[70],{"type":47,"value":71},"Building progress indicators for long-running tasks",{"type":41,"tag":67,"props":73,"children":74},{},[75],{"type":47,"value":76},"Creating live dashboards showing task status",{"type":41,"tag":67,"props":78,"children":79},{},[80],{"type":47,"value":81},"Streaming AI\u002FLLM responses to the UI",{"type":41,"tag":67,"props":83,"children":84},{},[85],{"type":47,"value":86},"React components that trigger and monitor tasks",{"type":41,"tag":67,"props":88,"children":89},{},[90],{"type":47,"value":91},"Waiting for user approval in tasks",{"type":41,"tag":56,"props":93,"children":95},{"id":94},"authentication",[96],{"type":47,"value":97},"Authentication",{"type":41,"tag":99,"props":100,"children":102},"h3",{"id":101},"create-public-access-token-backend",[103],{"type":47,"value":104},"Create Public Access Token (Backend)",{"type":41,"tag":106,"props":107,"children":112},"pre",{"className":108,"code":109,"language":110,"meta":111,"style":111},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { auth } from \"@trigger.dev\u002Fsdk\";\n\n\u002F\u002F Read-only token for specific runs\nconst publicToken = await auth.createPublicToken({\n  scopes: {\n    read: {\n      runs: [\"run_123\"],\n      tasks: [\"my-task\"],\n    },\n  },\n  expirationTime: \"1h\",\n});\n\n\u002F\u002F Pass this token to your frontend\n","ts","",[113],{"type":41,"tag":114,"props":115,"children":116},"code",{"__ignoreMap":111},[117,172,182,192,242,261,278,319,357,366,375,405,423,431],{"type":41,"tag":118,"props":119,"children":122},"span",{"class":120,"line":121},"line",1,[123,129,135,141,146,151,156,162,167],{"type":41,"tag":118,"props":124,"children":126},{"style":125},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[127],{"type":47,"value":128},"import",{"type":41,"tag":118,"props":130,"children":132},{"style":131},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[133],{"type":47,"value":134}," {",{"type":41,"tag":118,"props":136,"children":138},{"style":137},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[139],{"type":47,"value":140}," auth",{"type":41,"tag":118,"props":142,"children":143},{"style":131},[144],{"type":47,"value":145}," }",{"type":41,"tag":118,"props":147,"children":148},{"style":125},[149],{"type":47,"value":150}," from",{"type":41,"tag":118,"props":152,"children":153},{"style":131},[154],{"type":47,"value":155}," \"",{"type":41,"tag":118,"props":157,"children":159},{"style":158},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[160],{"type":47,"value":161},"@trigger.dev\u002Fsdk",{"type":41,"tag":118,"props":163,"children":164},{"style":131},[165],{"type":47,"value":166},"\"",{"type":41,"tag":118,"props":168,"children":169},{"style":131},[170],{"type":47,"value":171},";\n",{"type":41,"tag":118,"props":173,"children":175},{"class":120,"line":174},2,[176],{"type":41,"tag":118,"props":177,"children":179},{"emptyLinePlaceholder":178},true,[180],{"type":47,"value":181},"\n",{"type":41,"tag":118,"props":183,"children":185},{"class":120,"line":184},3,[186],{"type":41,"tag":118,"props":187,"children":189},{"style":188},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[190],{"type":47,"value":191},"\u002F\u002F Read-only token for specific runs\n",{"type":41,"tag":118,"props":193,"children":195},{"class":120,"line":194},4,[196,202,207,212,217,221,226,232,237],{"type":41,"tag":118,"props":197,"children":199},{"style":198},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[200],{"type":47,"value":201},"const",{"type":41,"tag":118,"props":203,"children":204},{"style":137},[205],{"type":47,"value":206}," publicToken ",{"type":41,"tag":118,"props":208,"children":209},{"style":131},[210],{"type":47,"value":211},"=",{"type":41,"tag":118,"props":213,"children":214},{"style":125},[215],{"type":47,"value":216}," await",{"type":41,"tag":118,"props":218,"children":219},{"style":137},[220],{"type":47,"value":140},{"type":41,"tag":118,"props":222,"children":223},{"style":131},[224],{"type":47,"value":225},".",{"type":41,"tag":118,"props":227,"children":229},{"style":228},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[230],{"type":47,"value":231},"createPublicToken",{"type":41,"tag":118,"props":233,"children":234},{"style":137},[235],{"type":47,"value":236},"(",{"type":41,"tag":118,"props":238,"children":239},{"style":131},[240],{"type":47,"value":241},"{\n",{"type":41,"tag":118,"props":243,"children":244},{"class":120,"line":28},[245,251,256],{"type":41,"tag":118,"props":246,"children":248},{"style":247},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[249],{"type":47,"value":250},"  scopes",{"type":41,"tag":118,"props":252,"children":253},{"style":131},[254],{"type":47,"value":255},":",{"type":41,"tag":118,"props":257,"children":258},{"style":131},[259],{"type":47,"value":260}," {\n",{"type":41,"tag":118,"props":262,"children":264},{"class":120,"line":263},6,[265,270,274],{"type":41,"tag":118,"props":266,"children":267},{"style":247},[268],{"type":47,"value":269},"    read",{"type":41,"tag":118,"props":271,"children":272},{"style":131},[273],{"type":47,"value":255},{"type":41,"tag":118,"props":275,"children":276},{"style":131},[277],{"type":47,"value":260},{"type":41,"tag":118,"props":279,"children":281},{"class":120,"line":280},7,[282,287,291,296,300,305,309,314],{"type":41,"tag":118,"props":283,"children":284},{"style":247},[285],{"type":47,"value":286},"      runs",{"type":41,"tag":118,"props":288,"children":289},{"style":131},[290],{"type":47,"value":255},{"type":41,"tag":118,"props":292,"children":293},{"style":137},[294],{"type":47,"value":295}," [",{"type":41,"tag":118,"props":297,"children":298},{"style":131},[299],{"type":47,"value":166},{"type":41,"tag":118,"props":301,"children":302},{"style":158},[303],{"type":47,"value":304},"run_123",{"type":41,"tag":118,"props":306,"children":307},{"style":131},[308],{"type":47,"value":166},{"type":41,"tag":118,"props":310,"children":311},{"style":137},[312],{"type":47,"value":313},"]",{"type":41,"tag":118,"props":315,"children":316},{"style":131},[317],{"type":47,"value":318},",\n",{"type":41,"tag":118,"props":320,"children":322},{"class":120,"line":321},8,[323,328,332,336,340,345,349,353],{"type":41,"tag":118,"props":324,"children":325},{"style":247},[326],{"type":47,"value":327},"      tasks",{"type":41,"tag":118,"props":329,"children":330},{"style":131},[331],{"type":47,"value":255},{"type":41,"tag":118,"props":333,"children":334},{"style":137},[335],{"type":47,"value":295},{"type":41,"tag":118,"props":337,"children":338},{"style":131},[339],{"type":47,"value":166},{"type":41,"tag":118,"props":341,"children":342},{"style":158},[343],{"type":47,"value":344},"my-task",{"type":41,"tag":118,"props":346,"children":347},{"style":131},[348],{"type":47,"value":166},{"type":41,"tag":118,"props":350,"children":351},{"style":137},[352],{"type":47,"value":313},{"type":41,"tag":118,"props":354,"children":355},{"style":131},[356],{"type":47,"value":318},{"type":41,"tag":118,"props":358,"children":360},{"class":120,"line":359},9,[361],{"type":41,"tag":118,"props":362,"children":363},{"style":131},[364],{"type":47,"value":365},"    },\n",{"type":41,"tag":118,"props":367,"children":369},{"class":120,"line":368},10,[370],{"type":41,"tag":118,"props":371,"children":372},{"style":131},[373],{"type":47,"value":374},"  },\n",{"type":41,"tag":118,"props":376,"children":378},{"class":120,"line":377},11,[379,384,388,392,397,401],{"type":41,"tag":118,"props":380,"children":381},{"style":247},[382],{"type":47,"value":383},"  expirationTime",{"type":41,"tag":118,"props":385,"children":386},{"style":131},[387],{"type":47,"value":255},{"type":41,"tag":118,"props":389,"children":390},{"style":131},[391],{"type":47,"value":155},{"type":41,"tag":118,"props":393,"children":394},{"style":158},[395],{"type":47,"value":396},"1h",{"type":41,"tag":118,"props":398,"children":399},{"style":131},[400],{"type":47,"value":166},{"type":41,"tag":118,"props":402,"children":403},{"style":131},[404],{"type":47,"value":318},{"type":41,"tag":118,"props":406,"children":408},{"class":120,"line":407},12,[409,414,419],{"type":41,"tag":118,"props":410,"children":411},{"style":131},[412],{"type":47,"value":413},"}",{"type":41,"tag":118,"props":415,"children":416},{"style":137},[417],{"type":47,"value":418},")",{"type":41,"tag":118,"props":420,"children":421},{"style":131},[422],{"type":47,"value":171},{"type":41,"tag":118,"props":424,"children":426},{"class":120,"line":425},13,[427],{"type":41,"tag":118,"props":428,"children":429},{"emptyLinePlaceholder":178},[430],{"type":47,"value":181},{"type":41,"tag":118,"props":432,"children":434},{"class":120,"line":433},14,[435],{"type":41,"tag":118,"props":436,"children":437},{"style":188},[438],{"type":47,"value":439},"\u002F\u002F Pass this token to your frontend\n",{"type":41,"tag":99,"props":441,"children":443},{"id":442},"create-trigger-token-for-frontend-triggering",[444],{"type":47,"value":445},"Create Trigger Token (for frontend triggering)",{"type":41,"tag":106,"props":447,"children":449},{"className":108,"code":448,"language":110,"meta":111,"style":111},"const triggerToken = await auth.createTriggerPublicToken(\"my-task\", {\n  expirationTime: \"30m\",\n});\n",[450],{"type":41,"tag":114,"props":451,"children":452},{"__ignoreMap":111},[453,511,539],{"type":41,"tag":118,"props":454,"children":455},{"class":120,"line":121},[456,460,465,469,473,477,481,486,490,494,498,502,507],{"type":41,"tag":118,"props":457,"children":458},{"style":198},[459],{"type":47,"value":201},{"type":41,"tag":118,"props":461,"children":462},{"style":137},[463],{"type":47,"value":464}," triggerToken ",{"type":41,"tag":118,"props":466,"children":467},{"style":131},[468],{"type":47,"value":211},{"type":41,"tag":118,"props":470,"children":471},{"style":125},[472],{"type":47,"value":216},{"type":41,"tag":118,"props":474,"children":475},{"style":137},[476],{"type":47,"value":140},{"type":41,"tag":118,"props":478,"children":479},{"style":131},[480],{"type":47,"value":225},{"type":41,"tag":118,"props":482,"children":483},{"style":228},[484],{"type":47,"value":485},"createTriggerPublicToken",{"type":41,"tag":118,"props":487,"children":488},{"style":137},[489],{"type":47,"value":236},{"type":41,"tag":118,"props":491,"children":492},{"style":131},[493],{"type":47,"value":166},{"type":41,"tag":118,"props":495,"children":496},{"style":158},[497],{"type":47,"value":344},{"type":41,"tag":118,"props":499,"children":500},{"style":131},[501],{"type":47,"value":166},{"type":41,"tag":118,"props":503,"children":504},{"style":131},[505],{"type":47,"value":506},",",{"type":41,"tag":118,"props":508,"children":509},{"style":131},[510],{"type":47,"value":260},{"type":41,"tag":118,"props":512,"children":513},{"class":120,"line":174},[514,518,522,526,531,535],{"type":41,"tag":118,"props":515,"children":516},{"style":247},[517],{"type":47,"value":383},{"type":41,"tag":118,"props":519,"children":520},{"style":131},[521],{"type":47,"value":255},{"type":41,"tag":118,"props":523,"children":524},{"style":131},[525],{"type":47,"value":155},{"type":41,"tag":118,"props":527,"children":528},{"style":158},[529],{"type":47,"value":530},"30m",{"type":41,"tag":118,"props":532,"children":533},{"style":131},[534],{"type":47,"value":166},{"type":41,"tag":118,"props":536,"children":537},{"style":131},[538],{"type":47,"value":318},{"type":41,"tag":118,"props":540,"children":541},{"class":120,"line":184},[542,546,550],{"type":41,"tag":118,"props":543,"children":544},{"style":131},[545],{"type":47,"value":413},{"type":41,"tag":118,"props":547,"children":548},{"style":137},[549],{"type":47,"value":418},{"type":41,"tag":118,"props":551,"children":552},{"style":131},[553],{"type":47,"value":171},{"type":41,"tag":56,"props":555,"children":557},{"id":556},"backend-subscriptions",[558],{"type":47,"value":559},"Backend Subscriptions",{"type":41,"tag":106,"props":561,"children":563},{"className":108,"code":562,"language":110,"meta":111,"style":111},"import { runs, tasks } from \"@trigger.dev\u002Fsdk\";\n\n\u002F\u002F Trigger and subscribe\nconst handle = await tasks.trigger(\"my-task\", { data: \"value\" });\n\nfor await (const run of runs.subscribeToRun(handle.id)) {\n  console.log(`Status: ${run.status}`);\n  console.log(`Progress: ${run.metadata?.progress}`);\n  \n  if (run.status === \"COMPLETED\") {\n    console.log(\"Output:\", run.output);\n    break;\n  }\n}\n\n\u002F\u002F Subscribe to tagged runs\nfor await (const run of runs.subscribeToRunsWithTag(\"user-123\")) {\n  console.log(`Run ${run.id}: ${run.status}`);\n}\n\n\u002F\u002F Subscribe to batch\nfor await (const run of runs.subscribeToBatch(batchId)) {\n  console.log(`Batch run ${run.id}: ${run.status}`);\n}\n",[564],{"type":41,"tag":114,"props":565,"children":566},{"__ignoreMap":111},[567,616,623,631,722,729,791,854,921,929,980,1039,1051,1059,1067,1075,1084,1151,1234,1242,1250,1259,1309,1390],{"type":41,"tag":118,"props":568,"children":569},{"class":120,"line":121},[570,574,578,583,587,592,596,600,604,608,612],{"type":41,"tag":118,"props":571,"children":572},{"style":125},[573],{"type":47,"value":128},{"type":41,"tag":118,"props":575,"children":576},{"style":131},[577],{"type":47,"value":134},{"type":41,"tag":118,"props":579,"children":580},{"style":137},[581],{"type":47,"value":582}," runs",{"type":41,"tag":118,"props":584,"children":585},{"style":131},[586],{"type":47,"value":506},{"type":41,"tag":118,"props":588,"children":589},{"style":137},[590],{"type":47,"value":591}," tasks",{"type":41,"tag":118,"props":593,"children":594},{"style":131},[595],{"type":47,"value":145},{"type":41,"tag":118,"props":597,"children":598},{"style":125},[599],{"type":47,"value":150},{"type":41,"tag":118,"props":601,"children":602},{"style":131},[603],{"type":47,"value":155},{"type":41,"tag":118,"props":605,"children":606},{"style":158},[607],{"type":47,"value":161},{"type":41,"tag":118,"props":609,"children":610},{"style":131},[611],{"type":47,"value":166},{"type":41,"tag":118,"props":613,"children":614},{"style":131},[615],{"type":47,"value":171},{"type":41,"tag":118,"props":617,"children":618},{"class":120,"line":174},[619],{"type":41,"tag":118,"props":620,"children":621},{"emptyLinePlaceholder":178},[622],{"type":47,"value":181},{"type":41,"tag":118,"props":624,"children":625},{"class":120,"line":184},[626],{"type":41,"tag":118,"props":627,"children":628},{"style":188},[629],{"type":47,"value":630},"\u002F\u002F Trigger and subscribe\n",{"type":41,"tag":118,"props":632,"children":633},{"class":120,"line":194},[634,638,643,647,651,655,659,664,668,672,676,680,684,688,693,697,701,706,710,714,718],{"type":41,"tag":118,"props":635,"children":636},{"style":198},[637],{"type":47,"value":201},{"type":41,"tag":118,"props":639,"children":640},{"style":137},[641],{"type":47,"value":642}," handle ",{"type":41,"tag":118,"props":644,"children":645},{"style":131},[646],{"type":47,"value":211},{"type":41,"tag":118,"props":648,"children":649},{"style":125},[650],{"type":47,"value":216},{"type":41,"tag":118,"props":652,"children":653},{"style":137},[654],{"type":47,"value":591},{"type":41,"tag":118,"props":656,"children":657},{"style":131},[658],{"type":47,"value":225},{"type":41,"tag":118,"props":660,"children":661},{"style":228},[662],{"type":47,"value":663},"trigger",{"type":41,"tag":118,"props":665,"children":666},{"style":137},[667],{"type":47,"value":236},{"type":41,"tag":118,"props":669,"children":670},{"style":131},[671],{"type":47,"value":166},{"type":41,"tag":118,"props":673,"children":674},{"style":158},[675],{"type":47,"value":344},{"type":41,"tag":118,"props":677,"children":678},{"style":131},[679],{"type":47,"value":166},{"type":41,"tag":118,"props":681,"children":682},{"style":131},[683],{"type":47,"value":506},{"type":41,"tag":118,"props":685,"children":686},{"style":131},[687],{"type":47,"value":134},{"type":41,"tag":118,"props":689,"children":690},{"style":247},[691],{"type":47,"value":692}," data",{"type":41,"tag":118,"props":694,"children":695},{"style":131},[696],{"type":47,"value":255},{"type":41,"tag":118,"props":698,"children":699},{"style":131},[700],{"type":47,"value":155},{"type":41,"tag":118,"props":702,"children":703},{"style":158},[704],{"type":47,"value":705},"value",{"type":41,"tag":118,"props":707,"children":708},{"style":131},[709],{"type":47,"value":166},{"type":41,"tag":118,"props":711,"children":712},{"style":131},[713],{"type":47,"value":145},{"type":41,"tag":118,"props":715,"children":716},{"style":137},[717],{"type":47,"value":418},{"type":41,"tag":118,"props":719,"children":720},{"style":131},[721],{"type":47,"value":171},{"type":41,"tag":118,"props":723,"children":724},{"class":120,"line":28},[725],{"type":41,"tag":118,"props":726,"children":727},{"emptyLinePlaceholder":178},[728],{"type":47,"value":181},{"type":41,"tag":118,"props":730,"children":731},{"class":120,"line":263},[732,737,741,746,750,755,760,764,768,773,778,782,787],{"type":41,"tag":118,"props":733,"children":734},{"style":125},[735],{"type":47,"value":736},"for",{"type":41,"tag":118,"props":738,"children":739},{"style":125},[740],{"type":47,"value":216},{"type":41,"tag":118,"props":742,"children":743},{"style":137},[744],{"type":47,"value":745}," (",{"type":41,"tag":118,"props":747,"children":748},{"style":198},[749],{"type":47,"value":201},{"type":41,"tag":118,"props":751,"children":752},{"style":137},[753],{"type":47,"value":754}," run ",{"type":41,"tag":118,"props":756,"children":757},{"style":131},[758],{"type":47,"value":759},"of",{"type":41,"tag":118,"props":761,"children":762},{"style":137},[763],{"type":47,"value":582},{"type":41,"tag":118,"props":765,"children":766},{"style":131},[767],{"type":47,"value":225},{"type":41,"tag":118,"props":769,"children":770},{"style":228},[771],{"type":47,"value":772},"subscribeToRun",{"type":41,"tag":118,"props":774,"children":775},{"style":137},[776],{"type":47,"value":777},"(handle",{"type":41,"tag":118,"props":779,"children":780},{"style":131},[781],{"type":47,"value":225},{"type":41,"tag":118,"props":783,"children":784},{"style":137},[785],{"type":47,"value":786},"id)) ",{"type":41,"tag":118,"props":788,"children":789},{"style":131},[790],{"type":47,"value":241},{"type":41,"tag":118,"props":792,"children":793},{"class":120,"line":280},[794,799,803,808,812,817,822,827,832,836,841,846,850],{"type":41,"tag":118,"props":795,"children":796},{"style":137},[797],{"type":47,"value":798},"  console",{"type":41,"tag":118,"props":800,"children":801},{"style":131},[802],{"type":47,"value":225},{"type":41,"tag":118,"props":804,"children":805},{"style":228},[806],{"type":47,"value":807},"log",{"type":41,"tag":118,"props":809,"children":810},{"style":247},[811],{"type":47,"value":236},{"type":41,"tag":118,"props":813,"children":814},{"style":131},[815],{"type":47,"value":816},"`",{"type":41,"tag":118,"props":818,"children":819},{"style":158},[820],{"type":47,"value":821},"Status: ",{"type":41,"tag":118,"props":823,"children":824},{"style":131},[825],{"type":47,"value":826},"${",{"type":41,"tag":118,"props":828,"children":829},{"style":137},[830],{"type":47,"value":831},"run",{"type":41,"tag":118,"props":833,"children":834},{"style":131},[835],{"type":47,"value":225},{"type":41,"tag":118,"props":837,"children":838},{"style":137},[839],{"type":47,"value":840},"status",{"type":41,"tag":118,"props":842,"children":843},{"style":131},[844],{"type":47,"value":845},"}`",{"type":41,"tag":118,"props":847,"children":848},{"style":247},[849],{"type":47,"value":418},{"type":41,"tag":118,"props":851,"children":852},{"style":131},[853],{"type":47,"value":171},{"type":41,"tag":118,"props":855,"children":856},{"class":120,"line":321},[857,861,865,869,873,877,882,886,890,894,899,904,909,913,917],{"type":41,"tag":118,"props":858,"children":859},{"style":137},[860],{"type":47,"value":798},{"type":41,"tag":118,"props":862,"children":863},{"style":131},[864],{"type":47,"value":225},{"type":41,"tag":118,"props":866,"children":867},{"style":228},[868],{"type":47,"value":807},{"type":41,"tag":118,"props":870,"children":871},{"style":247},[872],{"type":47,"value":236},{"type":41,"tag":118,"props":874,"children":875},{"style":131},[876],{"type":47,"value":816},{"type":41,"tag":118,"props":878,"children":879},{"style":158},[880],{"type":47,"value":881},"Progress: ",{"type":41,"tag":118,"props":883,"children":884},{"style":131},[885],{"type":47,"value":826},{"type":41,"tag":118,"props":887,"children":888},{"style":137},[889],{"type":47,"value":831},{"type":41,"tag":118,"props":891,"children":892},{"style":131},[893],{"type":47,"value":225},{"type":41,"tag":118,"props":895,"children":896},{"style":137},[897],{"type":47,"value":898},"metadata",{"type":41,"tag":118,"props":900,"children":901},{"style":131},[902],{"type":47,"value":903},"?.",{"type":41,"tag":118,"props":905,"children":906},{"style":137},[907],{"type":47,"value":908},"progress",{"type":41,"tag":118,"props":910,"children":911},{"style":131},[912],{"type":47,"value":845},{"type":41,"tag":118,"props":914,"children":915},{"style":247},[916],{"type":47,"value":418},{"type":41,"tag":118,"props":918,"children":919},{"style":131},[920],{"type":47,"value":171},{"type":41,"tag":118,"props":922,"children":923},{"class":120,"line":359},[924],{"type":41,"tag":118,"props":925,"children":926},{"style":247},[927],{"type":47,"value":928},"  \n",{"type":41,"tag":118,"props":930,"children":931},{"class":120,"line":368},[932,937,941,945,949,953,958,962,967,971,976],{"type":41,"tag":118,"props":933,"children":934},{"style":125},[935],{"type":47,"value":936},"  if",{"type":41,"tag":118,"props":938,"children":939},{"style":247},[940],{"type":47,"value":745},{"type":41,"tag":118,"props":942,"children":943},{"style":137},[944],{"type":47,"value":831},{"type":41,"tag":118,"props":946,"children":947},{"style":131},[948],{"type":47,"value":225},{"type":41,"tag":118,"props":950,"children":951},{"style":137},[952],{"type":47,"value":840},{"type":41,"tag":118,"props":954,"children":955},{"style":131},[956],{"type":47,"value":957}," ===",{"type":41,"tag":118,"props":959,"children":960},{"style":131},[961],{"type":47,"value":155},{"type":41,"tag":118,"props":963,"children":964},{"style":158},[965],{"type":47,"value":966},"COMPLETED",{"type":41,"tag":118,"props":968,"children":969},{"style":131},[970],{"type":47,"value":166},{"type":41,"tag":118,"props":972,"children":973},{"style":247},[974],{"type":47,"value":975},") ",{"type":41,"tag":118,"props":977,"children":978},{"style":131},[979],{"type":47,"value":241},{"type":41,"tag":118,"props":981,"children":982},{"class":120,"line":377},[983,988,992,996,1000,1004,1009,1013,1017,1022,1026,1031,1035],{"type":41,"tag":118,"props":984,"children":985},{"style":137},[986],{"type":47,"value":987},"    console",{"type":41,"tag":118,"props":989,"children":990},{"style":131},[991],{"type":47,"value":225},{"type":41,"tag":118,"props":993,"children":994},{"style":228},[995],{"type":47,"value":807},{"type":41,"tag":118,"props":997,"children":998},{"style":247},[999],{"type":47,"value":236},{"type":41,"tag":118,"props":1001,"children":1002},{"style":131},[1003],{"type":47,"value":166},{"type":41,"tag":118,"props":1005,"children":1006},{"style":158},[1007],{"type":47,"value":1008},"Output:",{"type":41,"tag":118,"props":1010,"children":1011},{"style":131},[1012],{"type":47,"value":166},{"type":41,"tag":118,"props":1014,"children":1015},{"style":131},[1016],{"type":47,"value":506},{"type":41,"tag":118,"props":1018,"children":1019},{"style":137},[1020],{"type":47,"value":1021}," run",{"type":41,"tag":118,"props":1023,"children":1024},{"style":131},[1025],{"type":47,"value":225},{"type":41,"tag":118,"props":1027,"children":1028},{"style":137},[1029],{"type":47,"value":1030},"output",{"type":41,"tag":118,"props":1032,"children":1033},{"style":247},[1034],{"type":47,"value":418},{"type":41,"tag":118,"props":1036,"children":1037},{"style":131},[1038],{"type":47,"value":171},{"type":41,"tag":118,"props":1040,"children":1041},{"class":120,"line":407},[1042,1047],{"type":41,"tag":118,"props":1043,"children":1044},{"style":125},[1045],{"type":47,"value":1046},"    break",{"type":41,"tag":118,"props":1048,"children":1049},{"style":131},[1050],{"type":47,"value":171},{"type":41,"tag":118,"props":1052,"children":1053},{"class":120,"line":425},[1054],{"type":41,"tag":118,"props":1055,"children":1056},{"style":131},[1057],{"type":47,"value":1058},"  }\n",{"type":41,"tag":118,"props":1060,"children":1061},{"class":120,"line":433},[1062],{"type":41,"tag":118,"props":1063,"children":1064},{"style":131},[1065],{"type":47,"value":1066},"}\n",{"type":41,"tag":118,"props":1068,"children":1070},{"class":120,"line":1069},15,[1071],{"type":41,"tag":118,"props":1072,"children":1073},{"emptyLinePlaceholder":178},[1074],{"type":47,"value":181},{"type":41,"tag":118,"props":1076,"children":1078},{"class":120,"line":1077},16,[1079],{"type":41,"tag":118,"props":1080,"children":1081},{"style":188},[1082],{"type":47,"value":1083},"\u002F\u002F Subscribe to tagged runs\n",{"type":41,"tag":118,"props":1085,"children":1087},{"class":120,"line":1086},17,[1088,1092,1096,1100,1104,1108,1112,1116,1120,1125,1129,1133,1138,1142,1147],{"type":41,"tag":118,"props":1089,"children":1090},{"style":125},[1091],{"type":47,"value":736},{"type":41,"tag":118,"props":1093,"children":1094},{"style":125},[1095],{"type":47,"value":216},{"type":41,"tag":118,"props":1097,"children":1098},{"style":137},[1099],{"type":47,"value":745},{"type":41,"tag":118,"props":1101,"children":1102},{"style":198},[1103],{"type":47,"value":201},{"type":41,"tag":118,"props":1105,"children":1106},{"style":137},[1107],{"type":47,"value":754},{"type":41,"tag":118,"props":1109,"children":1110},{"style":131},[1111],{"type":47,"value":759},{"type":41,"tag":118,"props":1113,"children":1114},{"style":137},[1115],{"type":47,"value":582},{"type":41,"tag":118,"props":1117,"children":1118},{"style":131},[1119],{"type":47,"value":225},{"type":41,"tag":118,"props":1121,"children":1122},{"style":228},[1123],{"type":47,"value":1124},"subscribeToRunsWithTag",{"type":41,"tag":118,"props":1126,"children":1127},{"style":137},[1128],{"type":47,"value":236},{"type":41,"tag":118,"props":1130,"children":1131},{"style":131},[1132],{"type":47,"value":166},{"type":41,"tag":118,"props":1134,"children":1135},{"style":158},[1136],{"type":47,"value":1137},"user-123",{"type":41,"tag":118,"props":1139,"children":1140},{"style":131},[1141],{"type":47,"value":166},{"type":41,"tag":118,"props":1143,"children":1144},{"style":137},[1145],{"type":47,"value":1146},")) ",{"type":41,"tag":118,"props":1148,"children":1149},{"style":131},[1150],{"type":47,"value":241},{"type":41,"tag":118,"props":1152,"children":1154},{"class":120,"line":1153},18,[1155,1159,1163,1167,1171,1175,1180,1184,1188,1192,1197,1201,1206,1210,1214,1218,1222,1226,1230],{"type":41,"tag":118,"props":1156,"children":1157},{"style":137},[1158],{"type":47,"value":798},{"type":41,"tag":118,"props":1160,"children":1161},{"style":131},[1162],{"type":47,"value":225},{"type":41,"tag":118,"props":1164,"children":1165},{"style":228},[1166],{"type":47,"value":807},{"type":41,"tag":118,"props":1168,"children":1169},{"style":247},[1170],{"type":47,"value":236},{"type":41,"tag":118,"props":1172,"children":1173},{"style":131},[1174],{"type":47,"value":816},{"type":41,"tag":118,"props":1176,"children":1177},{"style":158},[1178],{"type":47,"value":1179},"Run ",{"type":41,"tag":118,"props":1181,"children":1182},{"style":131},[1183],{"type":47,"value":826},{"type":41,"tag":118,"props":1185,"children":1186},{"style":137},[1187],{"type":47,"value":831},{"type":41,"tag":118,"props":1189,"children":1190},{"style":131},[1191],{"type":47,"value":225},{"type":41,"tag":118,"props":1193,"children":1194},{"style":137},[1195],{"type":47,"value":1196},"id",{"type":41,"tag":118,"props":1198,"children":1199},{"style":131},[1200],{"type":47,"value":413},{"type":41,"tag":118,"props":1202,"children":1203},{"style":158},[1204],{"type":47,"value":1205},": ",{"type":41,"tag":118,"props":1207,"children":1208},{"style":131},[1209],{"type":47,"value":826},{"type":41,"tag":118,"props":1211,"children":1212},{"style":137},[1213],{"type":47,"value":831},{"type":41,"tag":118,"props":1215,"children":1216},{"style":131},[1217],{"type":47,"value":225},{"type":41,"tag":118,"props":1219,"children":1220},{"style":137},[1221],{"type":47,"value":840},{"type":41,"tag":118,"props":1223,"children":1224},{"style":131},[1225],{"type":47,"value":845},{"type":41,"tag":118,"props":1227,"children":1228},{"style":247},[1229],{"type":47,"value":418},{"type":41,"tag":118,"props":1231,"children":1232},{"style":131},[1233],{"type":47,"value":171},{"type":41,"tag":118,"props":1235,"children":1237},{"class":120,"line":1236},19,[1238],{"type":41,"tag":118,"props":1239,"children":1240},{"style":131},[1241],{"type":47,"value":1066},{"type":41,"tag":118,"props":1243,"children":1245},{"class":120,"line":1244},20,[1246],{"type":41,"tag":118,"props":1247,"children":1248},{"emptyLinePlaceholder":178},[1249],{"type":47,"value":181},{"type":41,"tag":118,"props":1251,"children":1253},{"class":120,"line":1252},21,[1254],{"type":41,"tag":118,"props":1255,"children":1256},{"style":188},[1257],{"type":47,"value":1258},"\u002F\u002F Subscribe to batch\n",{"type":41,"tag":118,"props":1260,"children":1262},{"class":120,"line":1261},22,[1263,1267,1271,1275,1279,1283,1287,1291,1295,1300,1305],{"type":41,"tag":118,"props":1264,"children":1265},{"style":125},[1266],{"type":47,"value":736},{"type":41,"tag":118,"props":1268,"children":1269},{"style":125},[1270],{"type":47,"value":216},{"type":41,"tag":118,"props":1272,"children":1273},{"style":137},[1274],{"type":47,"value":745},{"type":41,"tag":118,"props":1276,"children":1277},{"style":198},[1278],{"type":47,"value":201},{"type":41,"tag":118,"props":1280,"children":1281},{"style":137},[1282],{"type":47,"value":754},{"type":41,"tag":118,"props":1284,"children":1285},{"style":131},[1286],{"type":47,"value":759},{"type":41,"tag":118,"props":1288,"children":1289},{"style":137},[1290],{"type":47,"value":582},{"type":41,"tag":118,"props":1292,"children":1293},{"style":131},[1294],{"type":47,"value":225},{"type":41,"tag":118,"props":1296,"children":1297},{"style":228},[1298],{"type":47,"value":1299},"subscribeToBatch",{"type":41,"tag":118,"props":1301,"children":1302},{"style":137},[1303],{"type":47,"value":1304},"(batchId)) ",{"type":41,"tag":118,"props":1306,"children":1307},{"style":131},[1308],{"type":47,"value":241},{"type":41,"tag":118,"props":1310,"children":1312},{"class":120,"line":1311},23,[1313,1317,1321,1325,1329,1333,1338,1342,1346,1350,1354,1358,1362,1366,1370,1374,1378,1382,1386],{"type":41,"tag":118,"props":1314,"children":1315},{"style":137},[1316],{"type":47,"value":798},{"type":41,"tag":118,"props":1318,"children":1319},{"style":131},[1320],{"type":47,"value":225},{"type":41,"tag":118,"props":1322,"children":1323},{"style":228},[1324],{"type":47,"value":807},{"type":41,"tag":118,"props":1326,"children":1327},{"style":247},[1328],{"type":47,"value":236},{"type":41,"tag":118,"props":1330,"children":1331},{"style":131},[1332],{"type":47,"value":816},{"type":41,"tag":118,"props":1334,"children":1335},{"style":158},[1336],{"type":47,"value":1337},"Batch run ",{"type":41,"tag":118,"props":1339,"children":1340},{"style":131},[1341],{"type":47,"value":826},{"type":41,"tag":118,"props":1343,"children":1344},{"style":137},[1345],{"type":47,"value":831},{"type":41,"tag":118,"props":1347,"children":1348},{"style":131},[1349],{"type":47,"value":225},{"type":41,"tag":118,"props":1351,"children":1352},{"style":137},[1353],{"type":47,"value":1196},{"type":41,"tag":118,"props":1355,"children":1356},{"style":131},[1357],{"type":47,"value":413},{"type":41,"tag":118,"props":1359,"children":1360},{"style":158},[1361],{"type":47,"value":1205},{"type":41,"tag":118,"props":1363,"children":1364},{"style":131},[1365],{"type":47,"value":826},{"type":41,"tag":118,"props":1367,"children":1368},{"style":137},[1369],{"type":47,"value":831},{"type":41,"tag":118,"props":1371,"children":1372},{"style":131},[1373],{"type":47,"value":225},{"type":41,"tag":118,"props":1375,"children":1376},{"style":137},[1377],{"type":47,"value":840},{"type":41,"tag":118,"props":1379,"children":1380},{"style":131},[1381],{"type":47,"value":845},{"type":41,"tag":118,"props":1383,"children":1384},{"style":247},[1385],{"type":47,"value":418},{"type":41,"tag":118,"props":1387,"children":1388},{"style":131},[1389],{"type":47,"value":171},{"type":41,"tag":118,"props":1391,"children":1393},{"class":120,"line":1392},24,[1394],{"type":41,"tag":118,"props":1395,"children":1396},{"style":131},[1397],{"type":47,"value":1066},{"type":41,"tag":56,"props":1399,"children":1401},{"id":1400},"react-hooks",[1402],{"type":47,"value":1403},"React Hooks",{"type":41,"tag":99,"props":1405,"children":1407},{"id":1406},"installation",[1408],{"type":47,"value":1409},"Installation",{"type":41,"tag":106,"props":1411,"children":1415},{"className":1412,"code":1413,"language":1414,"meta":111,"style":111},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npm add @trigger.dev\u002Freact-hooks\n","bash",[1416],{"type":41,"tag":114,"props":1417,"children":1418},{"__ignoreMap":111},[1419],{"type":41,"tag":118,"props":1420,"children":1421},{"class":120,"line":121},[1422,1428,1433],{"type":41,"tag":118,"props":1423,"children":1425},{"style":1424},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[1426],{"type":47,"value":1427},"npm",{"type":41,"tag":118,"props":1429,"children":1430},{"style":158},[1431],{"type":47,"value":1432}," add",{"type":41,"tag":118,"props":1434,"children":1435},{"style":158},[1436],{"type":47,"value":1437}," @trigger.dev\u002Freact-hooks\n",{"type":41,"tag":99,"props":1439,"children":1441},{"id":1440},"trigger-task-from-react",[1442],{"type":47,"value":1443},"Trigger Task from React",{"type":41,"tag":106,"props":1445,"children":1449},{"className":1446,"code":1447,"language":1448,"meta":111,"style":111},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\"use client\";\nimport { useRealtimeTaskTrigger } from \"@trigger.dev\u002Freact-hooks\";\nimport type { myTask } from \"..\u002Ftrigger\u002Ftasks\";\n\nfunction TaskTrigger({ accessToken }: { accessToken: string }) {\n  const { submit, run, isLoading } = useRealtimeTaskTrigger\u003Ctypeof myTask>(\n    \"my-task\",\n    { accessToken }\n  );\n\n  return (\n    \u003Cdiv>\n      \u003Cbutton \n        onClick={() => submit({ data: \"value\" })} \n        disabled={isLoading}\n      >\n        Start Task\n      \u003C\u002Fbutton>\n      \n      {run && (\n        \u003Cdiv>\n          \u003Cp>Status: {run.status}\u003C\u002Fp>\n          \u003Cp>Progress: {run.metadata?.progress}%\u003C\u002Fp>\n          {run.output && \u003Cp>Result: {JSON.stringify(run.output)}\u003C\u002Fp>}\n        \u003C\u002Fdiv>\n      )}\n    \u003C\u002Fdiv>\n  );\n}\n","tsx",[1450],{"type":41,"tag":114,"props":1451,"children":1452},{"__ignoreMap":111},[1453,1473,1514,1560,1567,1622,1688,1708,1725,1737,1744,1757,1775,1793,1857,1879,1887,1895,1911,1919,1941,1957,2006,2071,2159,2176,2189,2206,2218],{"type":41,"tag":118,"props":1454,"children":1455},{"class":120,"line":121},[1456,1460,1465,1469],{"type":41,"tag":118,"props":1457,"children":1458},{"style":131},[1459],{"type":47,"value":166},{"type":41,"tag":118,"props":1461,"children":1462},{"style":158},[1463],{"type":47,"value":1464},"use client",{"type":41,"tag":118,"props":1466,"children":1467},{"style":131},[1468],{"type":47,"value":166},{"type":41,"tag":118,"props":1470,"children":1471},{"style":131},[1472],{"type":47,"value":171},{"type":41,"tag":118,"props":1474,"children":1475},{"class":120,"line":174},[1476,1480,1484,1489,1493,1497,1501,1506,1510],{"type":41,"tag":118,"props":1477,"children":1478},{"style":125},[1479],{"type":47,"value":128},{"type":41,"tag":118,"props":1481,"children":1482},{"style":131},[1483],{"type":47,"value":134},{"type":41,"tag":118,"props":1485,"children":1486},{"style":137},[1487],{"type":47,"value":1488}," useRealtimeTaskTrigger",{"type":41,"tag":118,"props":1490,"children":1491},{"style":131},[1492],{"type":47,"value":145},{"type":41,"tag":118,"props":1494,"children":1495},{"style":125},[1496],{"type":47,"value":150},{"type":41,"tag":118,"props":1498,"children":1499},{"style":131},[1500],{"type":47,"value":155},{"type":41,"tag":118,"props":1502,"children":1503},{"style":158},[1504],{"type":47,"value":1505},"@trigger.dev\u002Freact-hooks",{"type":41,"tag":118,"props":1507,"children":1508},{"style":131},[1509],{"type":47,"value":166},{"type":41,"tag":118,"props":1511,"children":1512},{"style":131},[1513],{"type":47,"value":171},{"type":41,"tag":118,"props":1515,"children":1516},{"class":120,"line":184},[1517,1521,1526,1530,1535,1539,1543,1547,1552,1556],{"type":41,"tag":118,"props":1518,"children":1519},{"style":125},[1520],{"type":47,"value":128},{"type":41,"tag":118,"props":1522,"children":1523},{"style":125},[1524],{"type":47,"value":1525}," type",{"type":41,"tag":118,"props":1527,"children":1528},{"style":131},[1529],{"type":47,"value":134},{"type":41,"tag":118,"props":1531,"children":1532},{"style":137},[1533],{"type":47,"value":1534}," myTask",{"type":41,"tag":118,"props":1536,"children":1537},{"style":131},[1538],{"type":47,"value":145},{"type":41,"tag":118,"props":1540,"children":1541},{"style":125},[1542],{"type":47,"value":150},{"type":41,"tag":118,"props":1544,"children":1545},{"style":131},[1546],{"type":47,"value":155},{"type":41,"tag":118,"props":1548,"children":1549},{"style":158},[1550],{"type":47,"value":1551},"..\u002Ftrigger\u002Ftasks",{"type":41,"tag":118,"props":1553,"children":1554},{"style":131},[1555],{"type":47,"value":166},{"type":41,"tag":118,"props":1557,"children":1558},{"style":131},[1559],{"type":47,"value":171},{"type":41,"tag":118,"props":1561,"children":1562},{"class":120,"line":194},[1563],{"type":41,"tag":118,"props":1564,"children":1565},{"emptyLinePlaceholder":178},[1566],{"type":47,"value":181},{"type":41,"tag":118,"props":1568,"children":1569},{"class":120,"line":28},[1570,1575,1580,1585,1591,1596,1600,1604,1608,1613,1618],{"type":41,"tag":118,"props":1571,"children":1572},{"style":198},[1573],{"type":47,"value":1574},"function",{"type":41,"tag":118,"props":1576,"children":1577},{"style":228},[1578],{"type":47,"value":1579}," TaskTrigger",{"type":41,"tag":118,"props":1581,"children":1582},{"style":131},[1583],{"type":47,"value":1584},"({",{"type":41,"tag":118,"props":1586,"children":1588},{"style":1587},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[1589],{"type":47,"value":1590}," accessToken",{"type":41,"tag":118,"props":1592,"children":1593},{"style":131},[1594],{"type":47,"value":1595}," }:",{"type":41,"tag":118,"props":1597,"children":1598},{"style":131},[1599],{"type":47,"value":134},{"type":41,"tag":118,"props":1601,"children":1602},{"style":247},[1603],{"type":47,"value":1590},{"type":41,"tag":118,"props":1605,"children":1606},{"style":131},[1607],{"type":47,"value":255},{"type":41,"tag":118,"props":1609,"children":1610},{"style":1424},[1611],{"type":47,"value":1612}," string",{"type":41,"tag":118,"props":1614,"children":1615},{"style":131},[1616],{"type":47,"value":1617}," })",{"type":41,"tag":118,"props":1619,"children":1620},{"style":131},[1621],{"type":47,"value":260},{"type":41,"tag":118,"props":1623,"children":1624},{"class":120,"line":263},[1625,1630,1634,1639,1643,1647,1651,1656,1660,1665,1669,1674,1678,1683],{"type":41,"tag":118,"props":1626,"children":1627},{"style":198},[1628],{"type":47,"value":1629},"  const",{"type":41,"tag":118,"props":1631,"children":1632},{"style":131},[1633],{"type":47,"value":134},{"type":41,"tag":118,"props":1635,"children":1636},{"style":137},[1637],{"type":47,"value":1638}," submit",{"type":41,"tag":118,"props":1640,"children":1641},{"style":131},[1642],{"type":47,"value":506},{"type":41,"tag":118,"props":1644,"children":1645},{"style":137},[1646],{"type":47,"value":1021},{"type":41,"tag":118,"props":1648,"children":1649},{"style":131},[1650],{"type":47,"value":506},{"type":41,"tag":118,"props":1652,"children":1653},{"style":137},[1654],{"type":47,"value":1655}," isLoading",{"type":41,"tag":118,"props":1657,"children":1658},{"style":131},[1659],{"type":47,"value":145},{"type":41,"tag":118,"props":1661,"children":1662},{"style":131},[1663],{"type":47,"value":1664}," =",{"type":41,"tag":118,"props":1666,"children":1667},{"style":228},[1668],{"type":47,"value":1488},{"type":41,"tag":118,"props":1670,"children":1671},{"style":131},[1672],{"type":47,"value":1673},"\u003Ctypeof",{"type":41,"tag":118,"props":1675,"children":1676},{"style":137},[1677],{"type":47,"value":1534},{"type":41,"tag":118,"props":1679,"children":1680},{"style":131},[1681],{"type":47,"value":1682},">",{"type":41,"tag":118,"props":1684,"children":1685},{"style":247},[1686],{"type":47,"value":1687},"(\n",{"type":41,"tag":118,"props":1689,"children":1690},{"class":120,"line":280},[1691,1696,1700,1704],{"type":41,"tag":118,"props":1692,"children":1693},{"style":131},[1694],{"type":47,"value":1695},"    \"",{"type":41,"tag":118,"props":1697,"children":1698},{"style":158},[1699],{"type":47,"value":344},{"type":41,"tag":118,"props":1701,"children":1702},{"style":131},[1703],{"type":47,"value":166},{"type":41,"tag":118,"props":1705,"children":1706},{"style":131},[1707],{"type":47,"value":318},{"type":41,"tag":118,"props":1709,"children":1710},{"class":120,"line":321},[1711,1716,1720],{"type":41,"tag":118,"props":1712,"children":1713},{"style":131},[1714],{"type":47,"value":1715},"    {",{"type":41,"tag":118,"props":1717,"children":1718},{"style":137},[1719],{"type":47,"value":1590},{"type":41,"tag":118,"props":1721,"children":1722},{"style":131},[1723],{"type":47,"value":1724}," }\n",{"type":41,"tag":118,"props":1726,"children":1727},{"class":120,"line":359},[1728,1733],{"type":41,"tag":118,"props":1729,"children":1730},{"style":247},[1731],{"type":47,"value":1732},"  )",{"type":41,"tag":118,"props":1734,"children":1735},{"style":131},[1736],{"type":47,"value":171},{"type":41,"tag":118,"props":1738,"children":1739},{"class":120,"line":368},[1740],{"type":41,"tag":118,"props":1741,"children":1742},{"emptyLinePlaceholder":178},[1743],{"type":47,"value":181},{"type":41,"tag":118,"props":1745,"children":1746},{"class":120,"line":377},[1747,1752],{"type":41,"tag":118,"props":1748,"children":1749},{"style":125},[1750],{"type":47,"value":1751},"  return",{"type":41,"tag":118,"props":1753,"children":1754},{"style":247},[1755],{"type":47,"value":1756}," (\n",{"type":41,"tag":118,"props":1758,"children":1759},{"class":120,"line":407},[1760,1765,1770],{"type":41,"tag":118,"props":1761,"children":1762},{"style":131},[1763],{"type":47,"value":1764},"    \u003C",{"type":41,"tag":118,"props":1766,"children":1767},{"style":247},[1768],{"type":47,"value":1769},"div",{"type":41,"tag":118,"props":1771,"children":1772},{"style":131},[1773],{"type":47,"value":1774},">\n",{"type":41,"tag":118,"props":1776,"children":1777},{"class":120,"line":425},[1778,1783,1788],{"type":41,"tag":118,"props":1779,"children":1780},{"style":131},[1781],{"type":47,"value":1782},"      \u003C",{"type":41,"tag":118,"props":1784,"children":1785},{"style":247},[1786],{"type":47,"value":1787},"button",{"type":41,"tag":118,"props":1789,"children":1790},{"style":131},[1791],{"type":47,"value":1792}," \n",{"type":41,"tag":118,"props":1794,"children":1795},{"class":120,"line":433},[1796,1801,1806,1811,1815,1819,1824,1828,1832,1836,1840,1844,1848,1852],{"type":41,"tag":118,"props":1797,"children":1798},{"style":198},[1799],{"type":47,"value":1800},"        onClick",{"type":41,"tag":118,"props":1802,"children":1803},{"style":131},[1804],{"type":47,"value":1805},"={()",{"type":41,"tag":118,"props":1807,"children":1808},{"style":198},[1809],{"type":47,"value":1810}," =>",{"type":41,"tag":118,"props":1812,"children":1813},{"style":228},[1814],{"type":47,"value":1638},{"type":41,"tag":118,"props":1816,"children":1817},{"style":137},[1818],{"type":47,"value":236},{"type":41,"tag":118,"props":1820,"children":1821},{"style":131},[1822],{"type":47,"value":1823},"{",{"type":41,"tag":118,"props":1825,"children":1826},{"style":247},[1827],{"type":47,"value":692},{"type":41,"tag":118,"props":1829,"children":1830},{"style":131},[1831],{"type":47,"value":255},{"type":41,"tag":118,"props":1833,"children":1834},{"style":131},[1835],{"type":47,"value":155},{"type":41,"tag":118,"props":1837,"children":1838},{"style":158},[1839],{"type":47,"value":705},{"type":41,"tag":118,"props":1841,"children":1842},{"style":131},[1843],{"type":47,"value":166},{"type":41,"tag":118,"props":1845,"children":1846},{"style":131},[1847],{"type":47,"value":145},{"type":41,"tag":118,"props":1849,"children":1850},{"style":137},[1851],{"type":47,"value":418},{"type":41,"tag":118,"props":1853,"children":1854},{"style":131},[1855],{"type":47,"value":1856},"} \n",{"type":41,"tag":118,"props":1858,"children":1859},{"class":120,"line":1069},[1860,1865,1870,1875],{"type":41,"tag":118,"props":1861,"children":1862},{"style":198},[1863],{"type":47,"value":1864},"        disabled",{"type":41,"tag":118,"props":1866,"children":1867},{"style":131},[1868],{"type":47,"value":1869},"={",{"type":41,"tag":118,"props":1871,"children":1872},{"style":137},[1873],{"type":47,"value":1874},"isLoading",{"type":41,"tag":118,"props":1876,"children":1877},{"style":131},[1878],{"type":47,"value":1066},{"type":41,"tag":118,"props":1880,"children":1881},{"class":120,"line":1077},[1882],{"type":41,"tag":118,"props":1883,"children":1884},{"style":131},[1885],{"type":47,"value":1886},"      >\n",{"type":41,"tag":118,"props":1888,"children":1889},{"class":120,"line":1086},[1890],{"type":41,"tag":118,"props":1891,"children":1892},{"style":137},[1893],{"type":47,"value":1894},"        Start Task\n",{"type":41,"tag":118,"props":1896,"children":1897},{"class":120,"line":1153},[1898,1903,1907],{"type":41,"tag":118,"props":1899,"children":1900},{"style":131},[1901],{"type":47,"value":1902},"      \u003C\u002F",{"type":41,"tag":118,"props":1904,"children":1905},{"style":247},[1906],{"type":47,"value":1787},{"type":41,"tag":118,"props":1908,"children":1909},{"style":131},[1910],{"type":47,"value":1774},{"type":41,"tag":118,"props":1912,"children":1913},{"class":120,"line":1236},[1914],{"type":41,"tag":118,"props":1915,"children":1916},{"style":137},[1917],{"type":47,"value":1918},"      \n",{"type":41,"tag":118,"props":1920,"children":1921},{"class":120,"line":1244},[1922,1927,1932,1937],{"type":41,"tag":118,"props":1923,"children":1924},{"style":131},[1925],{"type":47,"value":1926},"      {",{"type":41,"tag":118,"props":1928,"children":1929},{"style":137},[1930],{"type":47,"value":1931},"run ",{"type":41,"tag":118,"props":1933,"children":1934},{"style":131},[1935],{"type":47,"value":1936},"&&",{"type":41,"tag":118,"props":1938,"children":1939},{"style":137},[1940],{"type":47,"value":1756},{"type":41,"tag":118,"props":1942,"children":1943},{"class":120,"line":1252},[1944,1949,1953],{"type":41,"tag":118,"props":1945,"children":1946},{"style":131},[1947],{"type":47,"value":1948},"        \u003C",{"type":41,"tag":118,"props":1950,"children":1951},{"style":247},[1952],{"type":47,"value":1769},{"type":41,"tag":118,"props":1954,"children":1955},{"style":131},[1956],{"type":47,"value":1774},{"type":41,"tag":118,"props":1958,"children":1959},{"class":120,"line":1261},[1960,1965,1969,1973,1977,1981,1985,1989,1993,1998,2002],{"type":41,"tag":118,"props":1961,"children":1962},{"style":131},[1963],{"type":47,"value":1964},"          \u003C",{"type":41,"tag":118,"props":1966,"children":1967},{"style":247},[1968],{"type":47,"value":50},{"type":41,"tag":118,"props":1970,"children":1971},{"style":131},[1972],{"type":47,"value":1682},{"type":41,"tag":118,"props":1974,"children":1975},{"style":137},[1976],{"type":47,"value":821},{"type":41,"tag":118,"props":1978,"children":1979},{"style":131},[1980],{"type":47,"value":1823},{"type":41,"tag":118,"props":1982,"children":1983},{"style":137},[1984],{"type":47,"value":831},{"type":41,"tag":118,"props":1986,"children":1987},{"style":131},[1988],{"type":47,"value":225},{"type":41,"tag":118,"props":1990,"children":1991},{"style":137},[1992],{"type":47,"value":840},{"type":41,"tag":118,"props":1994,"children":1995},{"style":131},[1996],{"type":47,"value":1997},"}\u003C\u002F",{"type":41,"tag":118,"props":1999,"children":2000},{"style":247},[2001],{"type":47,"value":50},{"type":41,"tag":118,"props":2003,"children":2004},{"style":131},[2005],{"type":47,"value":1774},{"type":41,"tag":118,"props":2007,"children":2008},{"class":120,"line":1311},[2009,2013,2017,2021,2025,2029,2033,2037,2041,2045,2049,2053,2058,2063,2067],{"type":41,"tag":118,"props":2010,"children":2011},{"style":131},[2012],{"type":47,"value":1964},{"type":41,"tag":118,"props":2014,"children":2015},{"style":247},[2016],{"type":47,"value":50},{"type":41,"tag":118,"props":2018,"children":2019},{"style":131},[2020],{"type":47,"value":1682},{"type":41,"tag":118,"props":2022,"children":2023},{"style":137},[2024],{"type":47,"value":881},{"type":41,"tag":118,"props":2026,"children":2027},{"style":131},[2028],{"type":47,"value":1823},{"type":41,"tag":118,"props":2030,"children":2031},{"style":137},[2032],{"type":47,"value":831},{"type":41,"tag":118,"props":2034,"children":2035},{"style":131},[2036],{"type":47,"value":225},{"type":41,"tag":118,"props":2038,"children":2039},{"style":137},[2040],{"type":47,"value":898},{"type":41,"tag":118,"props":2042,"children":2043},{"style":131},[2044],{"type":47,"value":903},{"type":41,"tag":118,"props":2046,"children":2047},{"style":137},[2048],{"type":47,"value":908},{"type":41,"tag":118,"props":2050,"children":2051},{"style":131},[2052],{"type":47,"value":413},{"type":41,"tag":118,"props":2054,"children":2055},{"style":137},[2056],{"type":47,"value":2057},"%",{"type":41,"tag":118,"props":2059,"children":2060},{"style":131},[2061],{"type":47,"value":2062},"\u003C\u002F",{"type":41,"tag":118,"props":2064,"children":2065},{"style":247},[2066],{"type":47,"value":50},{"type":41,"tag":118,"props":2068,"children":2069},{"style":131},[2070],{"type":47,"value":1774},{"type":41,"tag":118,"props":2072,"children":2073},{"class":120,"line":1392},[2074,2079,2083,2087,2092,2096,2101,2105,2109,2114,2118,2123,2127,2132,2137,2141,2146,2150,2154],{"type":41,"tag":118,"props":2075,"children":2076},{"style":131},[2077],{"type":47,"value":2078},"          {",{"type":41,"tag":118,"props":2080,"children":2081},{"style":137},[2082],{"type":47,"value":831},{"type":41,"tag":118,"props":2084,"children":2085},{"style":131},[2086],{"type":47,"value":225},{"type":41,"tag":118,"props":2088,"children":2089},{"style":137},[2090],{"type":47,"value":2091},"output ",{"type":41,"tag":118,"props":2093,"children":2094},{"style":131},[2095],{"type":47,"value":1936},{"type":41,"tag":118,"props":2097,"children":2098},{"style":131},[2099],{"type":47,"value":2100}," \u003C",{"type":41,"tag":118,"props":2102,"children":2103},{"style":247},[2104],{"type":47,"value":50},{"type":41,"tag":118,"props":2106,"children":2107},{"style":131},[2108],{"type":47,"value":1682},{"type":41,"tag":118,"props":2110,"children":2111},{"style":137},[2112],{"type":47,"value":2113},"Result: ",{"type":41,"tag":118,"props":2115,"children":2116},{"style":131},[2117],{"type":47,"value":1823},{"type":41,"tag":118,"props":2119,"children":2120},{"style":137},[2121],{"type":47,"value":2122},"JSON",{"type":41,"tag":118,"props":2124,"children":2125},{"style":131},[2126],{"type":47,"value":225},{"type":41,"tag":118,"props":2128,"children":2129},{"style":228},[2130],{"type":47,"value":2131},"stringify",{"type":41,"tag":118,"props":2133,"children":2134},{"style":137},[2135],{"type":47,"value":2136},"(run",{"type":41,"tag":118,"props":2138,"children":2139},{"style":131},[2140],{"type":47,"value":225},{"type":41,"tag":118,"props":2142,"children":2143},{"style":137},[2144],{"type":47,"value":2145},"output)",{"type":41,"tag":118,"props":2147,"children":2148},{"style":131},[2149],{"type":47,"value":1997},{"type":41,"tag":118,"props":2151,"children":2152},{"style":247},[2153],{"type":47,"value":50},{"type":41,"tag":118,"props":2155,"children":2156},{"style":131},[2157],{"type":47,"value":2158},">}\n",{"type":41,"tag":118,"props":2160,"children":2162},{"class":120,"line":2161},25,[2163,2168,2172],{"type":41,"tag":118,"props":2164,"children":2165},{"style":131},[2166],{"type":47,"value":2167},"        \u003C\u002F",{"type":41,"tag":118,"props":2169,"children":2170},{"style":247},[2171],{"type":47,"value":1769},{"type":41,"tag":118,"props":2173,"children":2174},{"style":131},[2175],{"type":47,"value":1774},{"type":41,"tag":118,"props":2177,"children":2179},{"class":120,"line":2178},26,[2180,2185],{"type":41,"tag":118,"props":2181,"children":2182},{"style":137},[2183],{"type":47,"value":2184},"      )",{"type":41,"tag":118,"props":2186,"children":2187},{"style":131},[2188],{"type":47,"value":1066},{"type":41,"tag":118,"props":2190,"children":2192},{"class":120,"line":2191},27,[2193,2198,2202],{"type":41,"tag":118,"props":2194,"children":2195},{"style":131},[2196],{"type":47,"value":2197},"    \u003C\u002F",{"type":41,"tag":118,"props":2199,"children":2200},{"style":247},[2201],{"type":47,"value":1769},{"type":41,"tag":118,"props":2203,"children":2204},{"style":131},[2205],{"type":47,"value":1774},{"type":41,"tag":118,"props":2207,"children":2209},{"class":120,"line":2208},28,[2210,2214],{"type":41,"tag":118,"props":2211,"children":2212},{"style":247},[2213],{"type":47,"value":1732},{"type":41,"tag":118,"props":2215,"children":2216},{"style":131},[2217],{"type":47,"value":171},{"type":41,"tag":118,"props":2219,"children":2221},{"class":120,"line":2220},29,[2222],{"type":41,"tag":118,"props":2223,"children":2224},{"style":131},[2225],{"type":47,"value":1066},{"type":41,"tag":99,"props":2227,"children":2229},{"id":2228},"subscribe-to-existing-run",[2230],{"type":47,"value":2231},"Subscribe to Existing Run",{"type":41,"tag":106,"props":2233,"children":2235},{"className":1446,"code":2234,"language":1448,"meta":111,"style":111},"\"use client\";\nimport { useRealtimeRun } from \"@trigger.dev\u002Freact-hooks\";\nimport type { myTask } from \"..\u002Ftrigger\u002Ftasks\";\n\nfunction RunStatus({ runId, accessToken }: { runId: string; accessToken: string }) {\n  const { run, error } = useRealtimeRun\u003Ctypeof myTask>(runId, {\n    accessToken,\n    onComplete: (run) => {\n      console.log(\"Completed:\", run.output);\n    },\n  });\n\n  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n  if (!run) return \u003Cdiv>Loading...\u003C\u002Fdiv>;\n\n  return (\n    \u003Cdiv>\n      \u003Cp>Status: {run.status}\u003C\u002Fp>\n      \u003Cp>Progress: {run.metadata?.progress || 0}%\u003C\u002Fp>\n    \u003C\u002Fdiv>\n  );\n}\n",[2236],{"type":41,"tag":114,"props":2237,"children":2238},{"__ignoreMap":111},[2239,2258,2298,2341,2348,2422,2487,2499,2531,2588,2595,2611,2618,2690,2747,2754,2765,2780,2827,2902,2917,2928],{"type":41,"tag":118,"props":2240,"children":2241},{"class":120,"line":121},[2242,2246,2250,2254],{"type":41,"tag":118,"props":2243,"children":2244},{"style":131},[2245],{"type":47,"value":166},{"type":41,"tag":118,"props":2247,"children":2248},{"style":158},[2249],{"type":47,"value":1464},{"type":41,"tag":118,"props":2251,"children":2252},{"style":131},[2253],{"type":47,"value":166},{"type":41,"tag":118,"props":2255,"children":2256},{"style":131},[2257],{"type":47,"value":171},{"type":41,"tag":118,"props":2259,"children":2260},{"class":120,"line":174},[2261,2265,2269,2274,2278,2282,2286,2290,2294],{"type":41,"tag":118,"props":2262,"children":2263},{"style":125},[2264],{"type":47,"value":128},{"type":41,"tag":118,"props":2266,"children":2267},{"style":131},[2268],{"type":47,"value":134},{"type":41,"tag":118,"props":2270,"children":2271},{"style":137},[2272],{"type":47,"value":2273}," useRealtimeRun",{"type":41,"tag":118,"props":2275,"children":2276},{"style":131},[2277],{"type":47,"value":145},{"type":41,"tag":118,"props":2279,"children":2280},{"style":125},[2281],{"type":47,"value":150},{"type":41,"tag":118,"props":2283,"children":2284},{"style":131},[2285],{"type":47,"value":155},{"type":41,"tag":118,"props":2287,"children":2288},{"style":158},[2289],{"type":47,"value":1505},{"type":41,"tag":118,"props":2291,"children":2292},{"style":131},[2293],{"type":47,"value":166},{"type":41,"tag":118,"props":2295,"children":2296},{"style":131},[2297],{"type":47,"value":171},{"type":41,"tag":118,"props":2299,"children":2300},{"class":120,"line":184},[2301,2305,2309,2313,2317,2321,2325,2329,2333,2337],{"type":41,"tag":118,"props":2302,"children":2303},{"style":125},[2304],{"type":47,"value":128},{"type":41,"tag":118,"props":2306,"children":2307},{"style":125},[2308],{"type":47,"value":1525},{"type":41,"tag":118,"props":2310,"children":2311},{"style":131},[2312],{"type":47,"value":134},{"type":41,"tag":118,"props":2314,"children":2315},{"style":137},[2316],{"type":47,"value":1534},{"type":41,"tag":118,"props":2318,"children":2319},{"style":131},[2320],{"type":47,"value":145},{"type":41,"tag":118,"props":2322,"children":2323},{"style":125},[2324],{"type":47,"value":150},{"type":41,"tag":118,"props":2326,"children":2327},{"style":131},[2328],{"type":47,"value":155},{"type":41,"tag":118,"props":2330,"children":2331},{"style":158},[2332],{"type":47,"value":1551},{"type":41,"tag":118,"props":2334,"children":2335},{"style":131},[2336],{"type":47,"value":166},{"type":41,"tag":118,"props":2338,"children":2339},{"style":131},[2340],{"type":47,"value":171},{"type":41,"tag":118,"props":2342,"children":2343},{"class":120,"line":194},[2344],{"type":41,"tag":118,"props":2345,"children":2346},{"emptyLinePlaceholder":178},[2347],{"type":47,"value":181},{"type":41,"tag":118,"props":2349,"children":2350},{"class":120,"line":28},[2351,2355,2360,2364,2369,2373,2377,2381,2385,2389,2393,2397,2402,2406,2410,2414,2418],{"type":41,"tag":118,"props":2352,"children":2353},{"style":198},[2354],{"type":47,"value":1574},{"type":41,"tag":118,"props":2356,"children":2357},{"style":228},[2358],{"type":47,"value":2359}," RunStatus",{"type":41,"tag":118,"props":2361,"children":2362},{"style":131},[2363],{"type":47,"value":1584},{"type":41,"tag":118,"props":2365,"children":2366},{"style":1587},[2367],{"type":47,"value":2368}," runId",{"type":41,"tag":118,"props":2370,"children":2371},{"style":131},[2372],{"type":47,"value":506},{"type":41,"tag":118,"props":2374,"children":2375},{"style":1587},[2376],{"type":47,"value":1590},{"type":41,"tag":118,"props":2378,"children":2379},{"style":131},[2380],{"type":47,"value":1595},{"type":41,"tag":118,"props":2382,"children":2383},{"style":131},[2384],{"type":47,"value":134},{"type":41,"tag":118,"props":2386,"children":2387},{"style":247},[2388],{"type":47,"value":2368},{"type":41,"tag":118,"props":2390,"children":2391},{"style":131},[2392],{"type":47,"value":255},{"type":41,"tag":118,"props":2394,"children":2395},{"style":1424},[2396],{"type":47,"value":1612},{"type":41,"tag":118,"props":2398,"children":2399},{"style":131},[2400],{"type":47,"value":2401},";",{"type":41,"tag":118,"props":2403,"children":2404},{"style":247},[2405],{"type":47,"value":1590},{"type":41,"tag":118,"props":2407,"children":2408},{"style":131},[2409],{"type":47,"value":255},{"type":41,"tag":118,"props":2411,"children":2412},{"style":1424},[2413],{"type":47,"value":1612},{"type":41,"tag":118,"props":2415,"children":2416},{"style":131},[2417],{"type":47,"value":1617},{"type":41,"tag":118,"props":2419,"children":2420},{"style":131},[2421],{"type":47,"value":260},{"type":41,"tag":118,"props":2423,"children":2424},{"class":120,"line":263},[2425,2429,2433,2437,2441,2446,2450,2454,2458,2462,2466,2470,2474,2479,2483],{"type":41,"tag":118,"props":2426,"children":2427},{"style":198},[2428],{"type":47,"value":1629},{"type":41,"tag":118,"props":2430,"children":2431},{"style":131},[2432],{"type":47,"value":134},{"type":41,"tag":118,"props":2434,"children":2435},{"style":137},[2436],{"type":47,"value":1021},{"type":41,"tag":118,"props":2438,"children":2439},{"style":131},[2440],{"type":47,"value":506},{"type":41,"tag":118,"props":2442,"children":2443},{"style":137},[2444],{"type":47,"value":2445}," error",{"type":41,"tag":118,"props":2447,"children":2448},{"style":131},[2449],{"type":47,"value":145},{"type":41,"tag":118,"props":2451,"children":2452},{"style":131},[2453],{"type":47,"value":1664},{"type":41,"tag":118,"props":2455,"children":2456},{"style":228},[2457],{"type":47,"value":2273},{"type":41,"tag":118,"props":2459,"children":2460},{"style":131},[2461],{"type":47,"value":1673},{"type":41,"tag":118,"props":2463,"children":2464},{"style":137},[2465],{"type":47,"value":1534},{"type":41,"tag":118,"props":2467,"children":2468},{"style":131},[2469],{"type":47,"value":1682},{"type":41,"tag":118,"props":2471,"children":2472},{"style":247},[2473],{"type":47,"value":236},{"type":41,"tag":118,"props":2475,"children":2476},{"style":137},[2477],{"type":47,"value":2478},"runId",{"type":41,"tag":118,"props":2480,"children":2481},{"style":131},[2482],{"type":47,"value":506},{"type":41,"tag":118,"props":2484,"children":2485},{"style":131},[2486],{"type":47,"value":260},{"type":41,"tag":118,"props":2488,"children":2489},{"class":120,"line":280},[2490,2495],{"type":41,"tag":118,"props":2491,"children":2492},{"style":137},[2493],{"type":47,"value":2494},"    accessToken",{"type":41,"tag":118,"props":2496,"children":2497},{"style":131},[2498],{"type":47,"value":318},{"type":41,"tag":118,"props":2500,"children":2501},{"class":120,"line":321},[2502,2507,2511,2515,2519,2523,2527],{"type":41,"tag":118,"props":2503,"children":2504},{"style":228},[2505],{"type":47,"value":2506},"    onComplete",{"type":41,"tag":118,"props":2508,"children":2509},{"style":131},[2510],{"type":47,"value":255},{"type":41,"tag":118,"props":2512,"children":2513},{"style":131},[2514],{"type":47,"value":745},{"type":41,"tag":118,"props":2516,"children":2517},{"style":1587},[2518],{"type":47,"value":831},{"type":41,"tag":118,"props":2520,"children":2521},{"style":131},[2522],{"type":47,"value":418},{"type":41,"tag":118,"props":2524,"children":2525},{"style":198},[2526],{"type":47,"value":1810},{"type":41,"tag":118,"props":2528,"children":2529},{"style":131},[2530],{"type":47,"value":260},{"type":41,"tag":118,"props":2532,"children":2533},{"class":120,"line":359},[2534,2539,2543,2547,2551,2555,2560,2564,2568,2572,2576,2580,2584],{"type":41,"tag":118,"props":2535,"children":2536},{"style":137},[2537],{"type":47,"value":2538},"      console",{"type":41,"tag":118,"props":2540,"children":2541},{"style":131},[2542],{"type":47,"value":225},{"type":41,"tag":118,"props":2544,"children":2545},{"style":228},[2546],{"type":47,"value":807},{"type":41,"tag":118,"props":2548,"children":2549},{"style":247},[2550],{"type":47,"value":236},{"type":41,"tag":118,"props":2552,"children":2553},{"style":131},[2554],{"type":47,"value":166},{"type":41,"tag":118,"props":2556,"children":2557},{"style":158},[2558],{"type":47,"value":2559},"Completed:",{"type":41,"tag":118,"props":2561,"children":2562},{"style":131},[2563],{"type":47,"value":166},{"type":41,"tag":118,"props":2565,"children":2566},{"style":131},[2567],{"type":47,"value":506},{"type":41,"tag":118,"props":2569,"children":2570},{"style":137},[2571],{"type":47,"value":1021},{"type":41,"tag":118,"props":2573,"children":2574},{"style":131},[2575],{"type":47,"value":225},{"type":41,"tag":118,"props":2577,"children":2578},{"style":137},[2579],{"type":47,"value":1030},{"type":41,"tag":118,"props":2581,"children":2582},{"style":247},[2583],{"type":47,"value":418},{"type":41,"tag":118,"props":2585,"children":2586},{"style":131},[2587],{"type":47,"value":171},{"type":41,"tag":118,"props":2589,"children":2590},{"class":120,"line":368},[2591],{"type":41,"tag":118,"props":2592,"children":2593},{"style":131},[2594],{"type":47,"value":365},{"type":41,"tag":118,"props":2596,"children":2597},{"class":120,"line":377},[2598,2603,2607],{"type":41,"tag":118,"props":2599,"children":2600},{"style":131},[2601],{"type":47,"value":2602},"  }",{"type":41,"tag":118,"props":2604,"children":2605},{"style":247},[2606],{"type":47,"value":418},{"type":41,"tag":118,"props":2608,"children":2609},{"style":131},[2610],{"type":47,"value":171},{"type":41,"tag":118,"props":2612,"children":2613},{"class":120,"line":407},[2614],{"type":41,"tag":118,"props":2615,"children":2616},{"emptyLinePlaceholder":178},[2617],{"type":47,"value":181},{"type":41,"tag":118,"props":2619,"children":2620},{"class":120,"line":425},[2621,2625,2629,2634,2638,2643,2647,2651,2655,2660,2664,2668,2672,2677,2681,2685],{"type":41,"tag":118,"props":2622,"children":2623},{"style":125},[2624],{"type":47,"value":936},{"type":41,"tag":118,"props":2626,"children":2627},{"style":247},[2628],{"type":47,"value":745},{"type":41,"tag":118,"props":2630,"children":2631},{"style":137},[2632],{"type":47,"value":2633},"error",{"type":41,"tag":118,"props":2635,"children":2636},{"style":247},[2637],{"type":47,"value":975},{"type":41,"tag":118,"props":2639,"children":2640},{"style":125},[2641],{"type":47,"value":2642},"return",{"type":41,"tag":118,"props":2644,"children":2645},{"style":131},[2646],{"type":47,"value":2100},{"type":41,"tag":118,"props":2648,"children":2649},{"style":247},[2650],{"type":47,"value":1769},{"type":41,"tag":118,"props":2652,"children":2653},{"style":131},[2654],{"type":47,"value":1682},{"type":41,"tag":118,"props":2656,"children":2657},{"style":137},[2658],{"type":47,"value":2659},"Error: ",{"type":41,"tag":118,"props":2661,"children":2662},{"style":131},[2663],{"type":47,"value":1823},{"type":41,"tag":118,"props":2665,"children":2666},{"style":137},[2667],{"type":47,"value":2633},{"type":41,"tag":118,"props":2669,"children":2670},{"style":131},[2671],{"type":47,"value":225},{"type":41,"tag":118,"props":2673,"children":2674},{"style":137},[2675],{"type":47,"value":2676},"message",{"type":41,"tag":118,"props":2678,"children":2679},{"style":131},[2680],{"type":47,"value":1997},{"type":41,"tag":118,"props":2682,"children":2683},{"style":247},[2684],{"type":47,"value":1769},{"type":41,"tag":118,"props":2686,"children":2687},{"style":131},[2688],{"type":47,"value":2689},">;\n",{"type":41,"tag":118,"props":2691,"children":2692},{"class":120,"line":433},[2693,2697,2701,2706,2710,2714,2718,2722,2726,2730,2735,2739,2743],{"type":41,"tag":118,"props":2694,"children":2695},{"style":125},[2696],{"type":47,"value":936},{"type":41,"tag":118,"props":2698,"children":2699},{"style":247},[2700],{"type":47,"value":745},{"type":41,"tag":118,"props":2702,"children":2703},{"style":131},[2704],{"type":47,"value":2705},"!",{"type":41,"tag":118,"props":2707,"children":2708},{"style":137},[2709],{"type":47,"value":831},{"type":41,"tag":118,"props":2711,"children":2712},{"style":247},[2713],{"type":47,"value":975},{"type":41,"tag":118,"props":2715,"children":2716},{"style":125},[2717],{"type":47,"value":2642},{"type":41,"tag":118,"props":2719,"children":2720},{"style":131},[2721],{"type":47,"value":2100},{"type":41,"tag":118,"props":2723,"children":2724},{"style":247},[2725],{"type":47,"value":1769},{"type":41,"tag":118,"props":2727,"children":2728},{"style":131},[2729],{"type":47,"value":1682},{"type":41,"tag":118,"props":2731,"children":2732},{"style":137},[2733],{"type":47,"value":2734},"Loading...",{"type":41,"tag":118,"props":2736,"children":2737},{"style":131},[2738],{"type":47,"value":2062},{"type":41,"tag":118,"props":2740,"children":2741},{"style":247},[2742],{"type":47,"value":1769},{"type":41,"tag":118,"props":2744,"children":2745},{"style":131},[2746],{"type":47,"value":2689},{"type":41,"tag":118,"props":2748,"children":2749},{"class":120,"line":1069},[2750],{"type":41,"tag":118,"props":2751,"children":2752},{"emptyLinePlaceholder":178},[2753],{"type":47,"value":181},{"type":41,"tag":118,"props":2755,"children":2756},{"class":120,"line":1077},[2757,2761],{"type":41,"tag":118,"props":2758,"children":2759},{"style":125},[2760],{"type":47,"value":1751},{"type":41,"tag":118,"props":2762,"children":2763},{"style":247},[2764],{"type":47,"value":1756},{"type":41,"tag":118,"props":2766,"children":2767},{"class":120,"line":1086},[2768,2772,2776],{"type":41,"tag":118,"props":2769,"children":2770},{"style":131},[2771],{"type":47,"value":1764},{"type":41,"tag":118,"props":2773,"children":2774},{"style":247},[2775],{"type":47,"value":1769},{"type":41,"tag":118,"props":2777,"children":2778},{"style":131},[2779],{"type":47,"value":1774},{"type":41,"tag":118,"props":2781,"children":2782},{"class":120,"line":1153},[2783,2787,2791,2795,2799,2803,2807,2811,2815,2819,2823],{"type":41,"tag":118,"props":2784,"children":2785},{"style":131},[2786],{"type":47,"value":1782},{"type":41,"tag":118,"props":2788,"children":2789},{"style":247},[2790],{"type":47,"value":50},{"type":41,"tag":118,"props":2792,"children":2793},{"style":131},[2794],{"type":47,"value":1682},{"type":41,"tag":118,"props":2796,"children":2797},{"style":137},[2798],{"type":47,"value":821},{"type":41,"tag":118,"props":2800,"children":2801},{"style":131},[2802],{"type":47,"value":1823},{"type":41,"tag":118,"props":2804,"children":2805},{"style":137},[2806],{"type":47,"value":831},{"type":41,"tag":118,"props":2808,"children":2809},{"style":131},[2810],{"type":47,"value":225},{"type":41,"tag":118,"props":2812,"children":2813},{"style":137},[2814],{"type":47,"value":840},{"type":41,"tag":118,"props":2816,"children":2817},{"style":131},[2818],{"type":47,"value":1997},{"type":41,"tag":118,"props":2820,"children":2821},{"style":247},[2822],{"type":47,"value":50},{"type":41,"tag":118,"props":2824,"children":2825},{"style":131},[2826],{"type":47,"value":1774},{"type":41,"tag":118,"props":2828,"children":2829},{"class":120,"line":1236},[2830,2834,2838,2842,2846,2850,2854,2858,2862,2866,2871,2876,2882,2886,2890,2894,2898],{"type":41,"tag":118,"props":2831,"children":2832},{"style":131},[2833],{"type":47,"value":1782},{"type":41,"tag":118,"props":2835,"children":2836},{"style":247},[2837],{"type":47,"value":50},{"type":41,"tag":118,"props":2839,"children":2840},{"style":131},[2841],{"type":47,"value":1682},{"type":41,"tag":118,"props":2843,"children":2844},{"style":137},[2845],{"type":47,"value":881},{"type":41,"tag":118,"props":2847,"children":2848},{"style":131},[2849],{"type":47,"value":1823},{"type":41,"tag":118,"props":2851,"children":2852},{"style":137},[2853],{"type":47,"value":831},{"type":41,"tag":118,"props":2855,"children":2856},{"style":131},[2857],{"type":47,"value":225},{"type":41,"tag":118,"props":2859,"children":2860},{"style":137},[2861],{"type":47,"value":898},{"type":41,"tag":118,"props":2863,"children":2864},{"style":131},[2865],{"type":47,"value":903},{"type":41,"tag":118,"props":2867,"children":2868},{"style":137},[2869],{"type":47,"value":2870},"progress ",{"type":41,"tag":118,"props":2872,"children":2873},{"style":131},[2874],{"type":47,"value":2875},"||",{"type":41,"tag":118,"props":2877,"children":2879},{"style":2878},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[2880],{"type":47,"value":2881}," 0",{"type":41,"tag":118,"props":2883,"children":2884},{"style":131},[2885],{"type":47,"value":413},{"type":41,"tag":118,"props":2887,"children":2888},{"style":137},[2889],{"type":47,"value":2057},{"type":41,"tag":118,"props":2891,"children":2892},{"style":131},[2893],{"type":47,"value":2062},{"type":41,"tag":118,"props":2895,"children":2896},{"style":247},[2897],{"type":47,"value":50},{"type":41,"tag":118,"props":2899,"children":2900},{"style":131},[2901],{"type":47,"value":1774},{"type":41,"tag":118,"props":2903,"children":2904},{"class":120,"line":1244},[2905,2909,2913],{"type":41,"tag":118,"props":2906,"children":2907},{"style":131},[2908],{"type":47,"value":2197},{"type":41,"tag":118,"props":2910,"children":2911},{"style":247},[2912],{"type":47,"value":1769},{"type":41,"tag":118,"props":2914,"children":2915},{"style":131},[2916],{"type":47,"value":1774},{"type":41,"tag":118,"props":2918,"children":2919},{"class":120,"line":1252},[2920,2924],{"type":41,"tag":118,"props":2921,"children":2922},{"style":247},[2923],{"type":47,"value":1732},{"type":41,"tag":118,"props":2925,"children":2926},{"style":131},[2927],{"type":47,"value":171},{"type":41,"tag":118,"props":2929,"children":2930},{"class":120,"line":1261},[2931],{"type":41,"tag":118,"props":2932,"children":2933},{"style":131},[2934],{"type":47,"value":1066},{"type":41,"tag":99,"props":2936,"children":2938},{"id":2937},"subscribe-to-tagged-runs",[2939],{"type":47,"value":2940},"Subscribe to Tagged Runs",{"type":41,"tag":106,"props":2942,"children":2944},{"className":1446,"code":2943,"language":1448,"meta":111,"style":111},"\"use client\";\nimport { useRealtimeRunsWithTag } from \"@trigger.dev\u002Freact-hooks\";\n\nfunction UserTasks({ userId, accessToken }: { userId: string; accessToken: string }) {\n  const { runs } = useRealtimeRunsWithTag(`user-${userId}`, { accessToken });\n\n  return (\n    \u003Cul>\n      {runs.map((run) => (\n        \u003Cli key={run.id}>{run.id}: {run.status}\u003C\u002Fli>\n      ))}\n    \u003C\u002Ful>\n  );\n}\n",[2945],{"type":41,"tag":114,"props":2946,"children":2947},{"__ignoreMap":111},[2948,2967,3007,3014,3087,3164,3171,3182,3197,3242,3327,3339,3354,3365],{"type":41,"tag":118,"props":2949,"children":2950},{"class":120,"line":121},[2951,2955,2959,2963],{"type":41,"tag":118,"props":2952,"children":2953},{"style":131},[2954],{"type":47,"value":166},{"type":41,"tag":118,"props":2956,"children":2957},{"style":158},[2958],{"type":47,"value":1464},{"type":41,"tag":118,"props":2960,"children":2961},{"style":131},[2962],{"type":47,"value":166},{"type":41,"tag":118,"props":2964,"children":2965},{"style":131},[2966],{"type":47,"value":171},{"type":41,"tag":118,"props":2968,"children":2969},{"class":120,"line":174},[2970,2974,2978,2983,2987,2991,2995,2999,3003],{"type":41,"tag":118,"props":2971,"children":2972},{"style":125},[2973],{"type":47,"value":128},{"type":41,"tag":118,"props":2975,"children":2976},{"style":131},[2977],{"type":47,"value":134},{"type":41,"tag":118,"props":2979,"children":2980},{"style":137},[2981],{"type":47,"value":2982}," useRealtimeRunsWithTag",{"type":41,"tag":118,"props":2984,"children":2985},{"style":131},[2986],{"type":47,"value":145},{"type":41,"tag":118,"props":2988,"children":2989},{"style":125},[2990],{"type":47,"value":150},{"type":41,"tag":118,"props":2992,"children":2993},{"style":131},[2994],{"type":47,"value":155},{"type":41,"tag":118,"props":2996,"children":2997},{"style":158},[2998],{"type":47,"value":1505},{"type":41,"tag":118,"props":3000,"children":3001},{"style":131},[3002],{"type":47,"value":166},{"type":41,"tag":118,"props":3004,"children":3005},{"style":131},[3006],{"type":47,"value":171},{"type":41,"tag":118,"props":3008,"children":3009},{"class":120,"line":184},[3010],{"type":41,"tag":118,"props":3011,"children":3012},{"emptyLinePlaceholder":178},[3013],{"type":47,"value":181},{"type":41,"tag":118,"props":3015,"children":3016},{"class":120,"line":194},[3017,3021,3026,3030,3035,3039,3043,3047,3051,3055,3059,3063,3067,3071,3075,3079,3083],{"type":41,"tag":118,"props":3018,"children":3019},{"style":198},[3020],{"type":47,"value":1574},{"type":41,"tag":118,"props":3022,"children":3023},{"style":228},[3024],{"type":47,"value":3025}," UserTasks",{"type":41,"tag":118,"props":3027,"children":3028},{"style":131},[3029],{"type":47,"value":1584},{"type":41,"tag":118,"props":3031,"children":3032},{"style":1587},[3033],{"type":47,"value":3034}," userId",{"type":41,"tag":118,"props":3036,"children":3037},{"style":131},[3038],{"type":47,"value":506},{"type":41,"tag":118,"props":3040,"children":3041},{"style":1587},[3042],{"type":47,"value":1590},{"type":41,"tag":118,"props":3044,"children":3045},{"style":131},[3046],{"type":47,"value":1595},{"type":41,"tag":118,"props":3048,"children":3049},{"style":131},[3050],{"type":47,"value":134},{"type":41,"tag":118,"props":3052,"children":3053},{"style":247},[3054],{"type":47,"value":3034},{"type":41,"tag":118,"props":3056,"children":3057},{"style":131},[3058],{"type":47,"value":255},{"type":41,"tag":118,"props":3060,"children":3061},{"style":1424},[3062],{"type":47,"value":1612},{"type":41,"tag":118,"props":3064,"children":3065},{"style":131},[3066],{"type":47,"value":2401},{"type":41,"tag":118,"props":3068,"children":3069},{"style":247},[3070],{"type":47,"value":1590},{"type":41,"tag":118,"props":3072,"children":3073},{"style":131},[3074],{"type":47,"value":255},{"type":41,"tag":118,"props":3076,"children":3077},{"style":1424},[3078],{"type":47,"value":1612},{"type":41,"tag":118,"props":3080,"children":3081},{"style":131},[3082],{"type":47,"value":1617},{"type":41,"tag":118,"props":3084,"children":3085},{"style":131},[3086],{"type":47,"value":260},{"type":41,"tag":118,"props":3088,"children":3089},{"class":120,"line":28},[3090,3094,3098,3102,3106,3110,3114,3118,3122,3127,3131,3136,3140,3144,3148,3152,3156,3160],{"type":41,"tag":118,"props":3091,"children":3092},{"style":198},[3093],{"type":47,"value":1629},{"type":41,"tag":118,"props":3095,"children":3096},{"style":131},[3097],{"type":47,"value":134},{"type":41,"tag":118,"props":3099,"children":3100},{"style":137},[3101],{"type":47,"value":582},{"type":41,"tag":118,"props":3103,"children":3104},{"style":131},[3105],{"type":47,"value":145},{"type":41,"tag":118,"props":3107,"children":3108},{"style":131},[3109],{"type":47,"value":1664},{"type":41,"tag":118,"props":3111,"children":3112},{"style":228},[3113],{"type":47,"value":2982},{"type":41,"tag":118,"props":3115,"children":3116},{"style":247},[3117],{"type":47,"value":236},{"type":41,"tag":118,"props":3119,"children":3120},{"style":131},[3121],{"type":47,"value":816},{"type":41,"tag":118,"props":3123,"children":3124},{"style":158},[3125],{"type":47,"value":3126},"user-",{"type":41,"tag":118,"props":3128,"children":3129},{"style":131},[3130],{"type":47,"value":826},{"type":41,"tag":118,"props":3132,"children":3133},{"style":137},[3134],{"type":47,"value":3135},"userId",{"type":41,"tag":118,"props":3137,"children":3138},{"style":131},[3139],{"type":47,"value":845},{"type":41,"tag":118,"props":3141,"children":3142},{"style":131},[3143],{"type":47,"value":506},{"type":41,"tag":118,"props":3145,"children":3146},{"style":131},[3147],{"type":47,"value":134},{"type":41,"tag":118,"props":3149,"children":3150},{"style":137},[3151],{"type":47,"value":1590},{"type":41,"tag":118,"props":3153,"children":3154},{"style":131},[3155],{"type":47,"value":145},{"type":41,"tag":118,"props":3157,"children":3158},{"style":247},[3159],{"type":47,"value":418},{"type":41,"tag":118,"props":3161,"children":3162},{"style":131},[3163],{"type":47,"value":171},{"type":41,"tag":118,"props":3165,"children":3166},{"class":120,"line":263},[3167],{"type":41,"tag":118,"props":3168,"children":3169},{"emptyLinePlaceholder":178},[3170],{"type":47,"value":181},{"type":41,"tag":118,"props":3172,"children":3173},{"class":120,"line":280},[3174,3178],{"type":41,"tag":118,"props":3175,"children":3176},{"style":125},[3177],{"type":47,"value":1751},{"type":41,"tag":118,"props":3179,"children":3180},{"style":247},[3181],{"type":47,"value":1756},{"type":41,"tag":118,"props":3183,"children":3184},{"class":120,"line":321},[3185,3189,3193],{"type":41,"tag":118,"props":3186,"children":3187},{"style":131},[3188],{"type":47,"value":1764},{"type":41,"tag":118,"props":3190,"children":3191},{"style":247},[3192],{"type":47,"value":63},{"type":41,"tag":118,"props":3194,"children":3195},{"style":131},[3196],{"type":47,"value":1774},{"type":41,"tag":118,"props":3198,"children":3199},{"class":120,"line":359},[3200,3204,3209,3213,3218,3222,3226,3230,3234,3238],{"type":41,"tag":118,"props":3201,"children":3202},{"style":131},[3203],{"type":47,"value":1926},{"type":41,"tag":118,"props":3205,"children":3206},{"style":137},[3207],{"type":47,"value":3208},"runs",{"type":41,"tag":118,"props":3210,"children":3211},{"style":131},[3212],{"type":47,"value":225},{"type":41,"tag":118,"props":3214,"children":3215},{"style":228},[3216],{"type":47,"value":3217},"map",{"type":41,"tag":118,"props":3219,"children":3220},{"style":137},[3221],{"type":47,"value":236},{"type":41,"tag":118,"props":3223,"children":3224},{"style":131},[3225],{"type":47,"value":236},{"type":41,"tag":118,"props":3227,"children":3228},{"style":1587},[3229],{"type":47,"value":831},{"type":41,"tag":118,"props":3231,"children":3232},{"style":131},[3233],{"type":47,"value":418},{"type":41,"tag":118,"props":3235,"children":3236},{"style":198},[3237],{"type":47,"value":1810},{"type":41,"tag":118,"props":3239,"children":3240},{"style":137},[3241],{"type":47,"value":1756},{"type":41,"tag":118,"props":3243,"children":3244},{"class":120,"line":368},[3245,3249,3253,3258,3262,3266,3270,3274,3279,3283,3287,3291,3295,3299,3303,3307,3311,3315,3319,3323],{"type":41,"tag":118,"props":3246,"children":3247},{"style":131},[3248],{"type":47,"value":1948},{"type":41,"tag":118,"props":3250,"children":3251},{"style":247},[3252],{"type":47,"value":67},{"type":41,"tag":118,"props":3254,"children":3255},{"style":198},[3256],{"type":47,"value":3257}," key",{"type":41,"tag":118,"props":3259,"children":3260},{"style":131},[3261],{"type":47,"value":1869},{"type":41,"tag":118,"props":3263,"children":3264},{"style":137},[3265],{"type":47,"value":831},{"type":41,"tag":118,"props":3267,"children":3268},{"style":131},[3269],{"type":47,"value":225},{"type":41,"tag":118,"props":3271,"children":3272},{"style":137},[3273],{"type":47,"value":1196},{"type":41,"tag":118,"props":3275,"children":3276},{"style":131},[3277],{"type":47,"value":3278},"}>{",{"type":41,"tag":118,"props":3280,"children":3281},{"style":137},[3282],{"type":47,"value":831},{"type":41,"tag":118,"props":3284,"children":3285},{"style":131},[3286],{"type":47,"value":225},{"type":41,"tag":118,"props":3288,"children":3289},{"style":137},[3290],{"type":47,"value":1196},{"type":41,"tag":118,"props":3292,"children":3293},{"style":131},[3294],{"type":47,"value":413},{"type":41,"tag":118,"props":3296,"children":3297},{"style":137},[3298],{"type":47,"value":1205},{"type":41,"tag":118,"props":3300,"children":3301},{"style":131},[3302],{"type":47,"value":1823},{"type":41,"tag":118,"props":3304,"children":3305},{"style":137},[3306],{"type":47,"value":831},{"type":41,"tag":118,"props":3308,"children":3309},{"style":131},[3310],{"type":47,"value":225},{"type":41,"tag":118,"props":3312,"children":3313},{"style":137},[3314],{"type":47,"value":840},{"type":41,"tag":118,"props":3316,"children":3317},{"style":131},[3318],{"type":47,"value":1997},{"type":41,"tag":118,"props":3320,"children":3321},{"style":247},[3322],{"type":47,"value":67},{"type":41,"tag":118,"props":3324,"children":3325},{"style":131},[3326],{"type":47,"value":1774},{"type":41,"tag":118,"props":3328,"children":3329},{"class":120,"line":377},[3330,3335],{"type":41,"tag":118,"props":3331,"children":3332},{"style":137},[3333],{"type":47,"value":3334},"      ))",{"type":41,"tag":118,"props":3336,"children":3337},{"style":131},[3338],{"type":47,"value":1066},{"type":41,"tag":118,"props":3340,"children":3341},{"class":120,"line":407},[3342,3346,3350],{"type":41,"tag":118,"props":3343,"children":3344},{"style":131},[3345],{"type":47,"value":2197},{"type":41,"tag":118,"props":3347,"children":3348},{"style":247},[3349],{"type":47,"value":63},{"type":41,"tag":118,"props":3351,"children":3352},{"style":131},[3353],{"type":47,"value":1774},{"type":41,"tag":118,"props":3355,"children":3356},{"class":120,"line":425},[3357,3361],{"type":41,"tag":118,"props":3358,"children":3359},{"style":247},[3360],{"type":47,"value":1732},{"type":41,"tag":118,"props":3362,"children":3363},{"style":131},[3364],{"type":47,"value":171},{"type":41,"tag":118,"props":3366,"children":3367},{"class":120,"line":433},[3368],{"type":41,"tag":118,"props":3369,"children":3370},{"style":131},[3371],{"type":47,"value":1066},{"type":41,"tag":56,"props":3373,"children":3375},{"id":3374},"realtime-streams-aillm",[3376],{"type":47,"value":3377},"Realtime Streams (AI\u002FLLM)",{"type":41,"tag":99,"props":3379,"children":3381},{"id":3380},"define-stream-shared-location",[3382],{"type":47,"value":3383},"Define Stream (shared location)",{"type":41,"tag":106,"props":3385,"children":3387},{"className":108,"code":3386,"language":110,"meta":111,"style":111},"\u002F\u002F trigger\u002Fstreams.ts\nimport { streams } from \"@trigger.dev\u002Fsdk\";\n\nexport const aiStream = streams.define\u003Cstring>({\n  id: \"ai-output\",\n});\n",[3388],{"type":41,"tag":114,"props":3389,"children":3390},{"__ignoreMap":111},[3391,3399,3439,3446,3503,3532],{"type":41,"tag":118,"props":3392,"children":3393},{"class":120,"line":121},[3394],{"type":41,"tag":118,"props":3395,"children":3396},{"style":188},[3397],{"type":47,"value":3398},"\u002F\u002F trigger\u002Fstreams.ts\n",{"type":41,"tag":118,"props":3400,"children":3401},{"class":120,"line":174},[3402,3406,3410,3415,3419,3423,3427,3431,3435],{"type":41,"tag":118,"props":3403,"children":3404},{"style":125},[3405],{"type":47,"value":128},{"type":41,"tag":118,"props":3407,"children":3408},{"style":131},[3409],{"type":47,"value":134},{"type":41,"tag":118,"props":3411,"children":3412},{"style":137},[3413],{"type":47,"value":3414}," streams",{"type":41,"tag":118,"props":3416,"children":3417},{"style":131},[3418],{"type":47,"value":145},{"type":41,"tag":118,"props":3420,"children":3421},{"style":125},[3422],{"type":47,"value":150},{"type":41,"tag":118,"props":3424,"children":3425},{"style":131},[3426],{"type":47,"value":155},{"type":41,"tag":118,"props":3428,"children":3429},{"style":158},[3430],{"type":47,"value":161},{"type":41,"tag":118,"props":3432,"children":3433},{"style":131},[3434],{"type":47,"value":166},{"type":41,"tag":118,"props":3436,"children":3437},{"style":131},[3438],{"type":47,"value":171},{"type":41,"tag":118,"props":3440,"children":3441},{"class":120,"line":184},[3442],{"type":41,"tag":118,"props":3443,"children":3444},{"emptyLinePlaceholder":178},[3445],{"type":47,"value":181},{"type":41,"tag":118,"props":3447,"children":3448},{"class":120,"line":194},[3449,3454,3459,3464,3468,3472,3476,3481,3486,3491,3495,3499],{"type":41,"tag":118,"props":3450,"children":3451},{"style":125},[3452],{"type":47,"value":3453},"export",{"type":41,"tag":118,"props":3455,"children":3456},{"style":198},[3457],{"type":47,"value":3458}," const",{"type":41,"tag":118,"props":3460,"children":3461},{"style":137},[3462],{"type":47,"value":3463}," aiStream ",{"type":41,"tag":118,"props":3465,"children":3466},{"style":131},[3467],{"type":47,"value":211},{"type":41,"tag":118,"props":3469,"children":3470},{"style":137},[3471],{"type":47,"value":3414},{"type":41,"tag":118,"props":3473,"children":3474},{"style":131},[3475],{"type":47,"value":225},{"type":41,"tag":118,"props":3477,"children":3478},{"style":228},[3479],{"type":47,"value":3480},"define",{"type":41,"tag":118,"props":3482,"children":3483},{"style":131},[3484],{"type":47,"value":3485},"\u003C",{"type":41,"tag":118,"props":3487,"children":3488},{"style":1424},[3489],{"type":47,"value":3490},"string",{"type":41,"tag":118,"props":3492,"children":3493},{"style":131},[3494],{"type":47,"value":1682},{"type":41,"tag":118,"props":3496,"children":3497},{"style":137},[3498],{"type":47,"value":236},{"type":41,"tag":118,"props":3500,"children":3501},{"style":131},[3502],{"type":47,"value":241},{"type":41,"tag":118,"props":3504,"children":3505},{"class":120,"line":28},[3506,3511,3515,3519,3524,3528],{"type":41,"tag":118,"props":3507,"children":3508},{"style":247},[3509],{"type":47,"value":3510},"  id",{"type":41,"tag":118,"props":3512,"children":3513},{"style":131},[3514],{"type":47,"value":255},{"type":41,"tag":118,"props":3516,"children":3517},{"style":131},[3518],{"type":47,"value":155},{"type":41,"tag":118,"props":3520,"children":3521},{"style":158},[3522],{"type":47,"value":3523},"ai-output",{"type":41,"tag":118,"props":3525,"children":3526},{"style":131},[3527],{"type":47,"value":166},{"type":41,"tag":118,"props":3529,"children":3530},{"style":131},[3531],{"type":47,"value":318},{"type":41,"tag":118,"props":3533,"children":3534},{"class":120,"line":263},[3535,3539,3543],{"type":41,"tag":118,"props":3536,"children":3537},{"style":131},[3538],{"type":47,"value":413},{"type":41,"tag":118,"props":3540,"children":3541},{"style":137},[3542],{"type":47,"value":418},{"type":41,"tag":118,"props":3544,"children":3545},{"style":131},[3546],{"type":47,"value":171},{"type":41,"tag":99,"props":3548,"children":3550},{"id":3549},"pipe-stream-in-task",[3551],{"type":47,"value":3552},"Pipe Stream in Task",{"type":41,"tag":106,"props":3554,"children":3556},{"className":108,"code":3555,"language":110,"meta":111,"style":111},"import { task } from \"@trigger.dev\u002Fsdk\";\nimport { aiStream } from \".\u002Fstreams\";\n\nexport const streamingTask = task({\n  id: \"streaming-task\",\n  run: async (payload: { prompt: string }) => {\n    const completion = await openai.chat.completions.create({\n      model: \"gpt-4\",\n      messages: [{ role: \"user\", content: payload.prompt }],\n      stream: true,\n    });\n\n    const { waitUntilComplete } = aiStream.pipe(completion);\n    await waitUntilComplete();\n  },\n});\n",[3557],{"type":41,"tag":114,"props":3558,"children":3559},{"__ignoreMap":111},[3560,3600,3641,3648,3680,3708,3767,3828,3857,3938,3960,3976,3983,4037,4058,4065],{"type":41,"tag":118,"props":3561,"children":3562},{"class":120,"line":121},[3563,3567,3571,3576,3580,3584,3588,3592,3596],{"type":41,"tag":118,"props":3564,"children":3565},{"style":125},[3566],{"type":47,"value":128},{"type":41,"tag":118,"props":3568,"children":3569},{"style":131},[3570],{"type":47,"value":134},{"type":41,"tag":118,"props":3572,"children":3573},{"style":137},[3574],{"type":47,"value":3575}," task",{"type":41,"tag":118,"props":3577,"children":3578},{"style":131},[3579],{"type":47,"value":145},{"type":41,"tag":118,"props":3581,"children":3582},{"style":125},[3583],{"type":47,"value":150},{"type":41,"tag":118,"props":3585,"children":3586},{"style":131},[3587],{"type":47,"value":155},{"type":41,"tag":118,"props":3589,"children":3590},{"style":158},[3591],{"type":47,"value":161},{"type":41,"tag":118,"props":3593,"children":3594},{"style":131},[3595],{"type":47,"value":166},{"type":41,"tag":118,"props":3597,"children":3598},{"style":131},[3599],{"type":47,"value":171},{"type":41,"tag":118,"props":3601,"children":3602},{"class":120,"line":174},[3603,3607,3611,3616,3620,3624,3628,3633,3637],{"type":41,"tag":118,"props":3604,"children":3605},{"style":125},[3606],{"type":47,"value":128},{"type":41,"tag":118,"props":3608,"children":3609},{"style":131},[3610],{"type":47,"value":134},{"type":41,"tag":118,"props":3612,"children":3613},{"style":137},[3614],{"type":47,"value":3615}," aiStream",{"type":41,"tag":118,"props":3617,"children":3618},{"style":131},[3619],{"type":47,"value":145},{"type":41,"tag":118,"props":3621,"children":3622},{"style":125},[3623],{"type":47,"value":150},{"type":41,"tag":118,"props":3625,"children":3626},{"style":131},[3627],{"type":47,"value":155},{"type":41,"tag":118,"props":3629,"children":3630},{"style":158},[3631],{"type":47,"value":3632},".\u002Fstreams",{"type":41,"tag":118,"props":3634,"children":3635},{"style":131},[3636],{"type":47,"value":166},{"type":41,"tag":118,"props":3638,"children":3639},{"style":131},[3640],{"type":47,"value":171},{"type":41,"tag":118,"props":3642,"children":3643},{"class":120,"line":184},[3644],{"type":41,"tag":118,"props":3645,"children":3646},{"emptyLinePlaceholder":178},[3647],{"type":47,"value":181},{"type":41,"tag":118,"props":3649,"children":3650},{"class":120,"line":194},[3651,3655,3659,3664,3668,3672,3676],{"type":41,"tag":118,"props":3652,"children":3653},{"style":125},[3654],{"type":47,"value":3453},{"type":41,"tag":118,"props":3656,"children":3657},{"style":198},[3658],{"type":47,"value":3458},{"type":41,"tag":118,"props":3660,"children":3661},{"style":137},[3662],{"type":47,"value":3663}," streamingTask ",{"type":41,"tag":118,"props":3665,"children":3666},{"style":131},[3667],{"type":47,"value":211},{"type":41,"tag":118,"props":3669,"children":3670},{"style":228},[3671],{"type":47,"value":3575},{"type":41,"tag":118,"props":3673,"children":3674},{"style":137},[3675],{"type":47,"value":236},{"type":41,"tag":118,"props":3677,"children":3678},{"style":131},[3679],{"type":47,"value":241},{"type":41,"tag":118,"props":3681,"children":3682},{"class":120,"line":28},[3683,3687,3691,3695,3700,3704],{"type":41,"tag":118,"props":3684,"children":3685},{"style":247},[3686],{"type":47,"value":3510},{"type":41,"tag":118,"props":3688,"children":3689},{"style":131},[3690],{"type":47,"value":255},{"type":41,"tag":118,"props":3692,"children":3693},{"style":131},[3694],{"type":47,"value":155},{"type":41,"tag":118,"props":3696,"children":3697},{"style":158},[3698],{"type":47,"value":3699},"streaming-task",{"type":41,"tag":118,"props":3701,"children":3702},{"style":131},[3703],{"type":47,"value":166},{"type":41,"tag":118,"props":3705,"children":3706},{"style":131},[3707],{"type":47,"value":318},{"type":41,"tag":118,"props":3709,"children":3710},{"class":120,"line":263},[3711,3716,3720,3725,3729,3734,3738,3742,3747,3751,3755,3759,3763],{"type":41,"tag":118,"props":3712,"children":3713},{"style":228},[3714],{"type":47,"value":3715},"  run",{"type":41,"tag":118,"props":3717,"children":3718},{"style":131},[3719],{"type":47,"value":255},{"type":41,"tag":118,"props":3721,"children":3722},{"style":198},[3723],{"type":47,"value":3724}," async",{"type":41,"tag":118,"props":3726,"children":3727},{"style":131},[3728],{"type":47,"value":745},{"type":41,"tag":118,"props":3730,"children":3731},{"style":1587},[3732],{"type":47,"value":3733},"payload",{"type":41,"tag":118,"props":3735,"children":3736},{"style":131},[3737],{"type":47,"value":255},{"type":41,"tag":118,"props":3739,"children":3740},{"style":131},[3741],{"type":47,"value":134},{"type":41,"tag":118,"props":3743,"children":3744},{"style":247},[3745],{"type":47,"value":3746}," prompt",{"type":41,"tag":118,"props":3748,"children":3749},{"style":131},[3750],{"type":47,"value":255},{"type":41,"tag":118,"props":3752,"children":3753},{"style":1424},[3754],{"type":47,"value":1612},{"type":41,"tag":118,"props":3756,"children":3757},{"style":131},[3758],{"type":47,"value":1617},{"type":41,"tag":118,"props":3760,"children":3761},{"style":198},[3762],{"type":47,"value":1810},{"type":41,"tag":118,"props":3764,"children":3765},{"style":131},[3766],{"type":47,"value":260},{"type":41,"tag":118,"props":3768,"children":3769},{"class":120,"line":280},[3770,3775,3780,3784,3788,3793,3797,3802,3806,3811,3815,3820,3824],{"type":41,"tag":118,"props":3771,"children":3772},{"style":198},[3773],{"type":47,"value":3774},"    const",{"type":41,"tag":118,"props":3776,"children":3777},{"style":137},[3778],{"type":47,"value":3779}," completion",{"type":41,"tag":118,"props":3781,"children":3782},{"style":131},[3783],{"type":47,"value":1664},{"type":41,"tag":118,"props":3785,"children":3786},{"style":125},[3787],{"type":47,"value":216},{"type":41,"tag":118,"props":3789,"children":3790},{"style":137},[3791],{"type":47,"value":3792}," openai",{"type":41,"tag":118,"props":3794,"children":3795},{"style":131},[3796],{"type":47,"value":225},{"type":41,"tag":118,"props":3798,"children":3799},{"style":137},[3800],{"type":47,"value":3801},"chat",{"type":41,"tag":118,"props":3803,"children":3804},{"style":131},[3805],{"type":47,"value":225},{"type":41,"tag":118,"props":3807,"children":3808},{"style":137},[3809],{"type":47,"value":3810},"completions",{"type":41,"tag":118,"props":3812,"children":3813},{"style":131},[3814],{"type":47,"value":225},{"type":41,"tag":118,"props":3816,"children":3817},{"style":228},[3818],{"type":47,"value":3819},"create",{"type":41,"tag":118,"props":3821,"children":3822},{"style":247},[3823],{"type":47,"value":236},{"type":41,"tag":118,"props":3825,"children":3826},{"style":131},[3827],{"type":47,"value":241},{"type":41,"tag":118,"props":3829,"children":3830},{"class":120,"line":321},[3831,3836,3840,3844,3849,3853],{"type":41,"tag":118,"props":3832,"children":3833},{"style":247},[3834],{"type":47,"value":3835},"      model",{"type":41,"tag":118,"props":3837,"children":3838},{"style":131},[3839],{"type":47,"value":255},{"type":41,"tag":118,"props":3841,"children":3842},{"style":131},[3843],{"type":47,"value":155},{"type":41,"tag":118,"props":3845,"children":3846},{"style":158},[3847],{"type":47,"value":3848},"gpt-4",{"type":41,"tag":118,"props":3850,"children":3851},{"style":131},[3852],{"type":47,"value":166},{"type":41,"tag":118,"props":3854,"children":3855},{"style":131},[3856],{"type":47,"value":318},{"type":41,"tag":118,"props":3858,"children":3859},{"class":120,"line":359},[3860,3865,3869,3873,3877,3882,3886,3890,3895,3899,3903,3908,3912,3917,3921,3926,3930,3934],{"type":41,"tag":118,"props":3861,"children":3862},{"style":247},[3863],{"type":47,"value":3864},"      messages",{"type":41,"tag":118,"props":3866,"children":3867},{"style":131},[3868],{"type":47,"value":255},{"type":41,"tag":118,"props":3870,"children":3871},{"style":247},[3872],{"type":47,"value":295},{"type":41,"tag":118,"props":3874,"children":3875},{"style":131},[3876],{"type":47,"value":1823},{"type":41,"tag":118,"props":3878,"children":3879},{"style":247},[3880],{"type":47,"value":3881}," role",{"type":41,"tag":118,"props":3883,"children":3884},{"style":131},[3885],{"type":47,"value":255},{"type":41,"tag":118,"props":3887,"children":3888},{"style":131},[3889],{"type":47,"value":155},{"type":41,"tag":118,"props":3891,"children":3892},{"style":158},[3893],{"type":47,"value":3894},"user",{"type":41,"tag":118,"props":3896,"children":3897},{"style":131},[3898],{"type":47,"value":166},{"type":41,"tag":118,"props":3900,"children":3901},{"style":131},[3902],{"type":47,"value":506},{"type":41,"tag":118,"props":3904,"children":3905},{"style":247},[3906],{"type":47,"value":3907}," content",{"type":41,"tag":118,"props":3909,"children":3910},{"style":131},[3911],{"type":47,"value":255},{"type":41,"tag":118,"props":3913,"children":3914},{"style":137},[3915],{"type":47,"value":3916}," payload",{"type":41,"tag":118,"props":3918,"children":3919},{"style":131},[3920],{"type":47,"value":225},{"type":41,"tag":118,"props":3922,"children":3923},{"style":137},[3924],{"type":47,"value":3925},"prompt",{"type":41,"tag":118,"props":3927,"children":3928},{"style":131},[3929],{"type":47,"value":145},{"type":41,"tag":118,"props":3931,"children":3932},{"style":247},[3933],{"type":47,"value":313},{"type":41,"tag":118,"props":3935,"children":3936},{"style":131},[3937],{"type":47,"value":318},{"type":41,"tag":118,"props":3939,"children":3940},{"class":120,"line":368},[3941,3946,3950,3956],{"type":41,"tag":118,"props":3942,"children":3943},{"style":247},[3944],{"type":47,"value":3945},"      stream",{"type":41,"tag":118,"props":3947,"children":3948},{"style":131},[3949],{"type":47,"value":255},{"type":41,"tag":118,"props":3951,"children":3953},{"style":3952},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[3954],{"type":47,"value":3955}," true",{"type":41,"tag":118,"props":3957,"children":3958},{"style":131},[3959],{"type":47,"value":318},{"type":41,"tag":118,"props":3961,"children":3962},{"class":120,"line":377},[3963,3968,3972],{"type":41,"tag":118,"props":3964,"children":3965},{"style":131},[3966],{"type":47,"value":3967},"    }",{"type":41,"tag":118,"props":3969,"children":3970},{"style":247},[3971],{"type":47,"value":418},{"type":41,"tag":118,"props":3973,"children":3974},{"style":131},[3975],{"type":47,"value":171},{"type":41,"tag":118,"props":3977,"children":3978},{"class":120,"line":407},[3979],{"type":41,"tag":118,"props":3980,"children":3981},{"emptyLinePlaceholder":178},[3982],{"type":47,"value":181},{"type":41,"tag":118,"props":3984,"children":3985},{"class":120,"line":425},[3986,3990,3994,3999,4003,4007,4011,4015,4020,4024,4029,4033],{"type":41,"tag":118,"props":3987,"children":3988},{"style":198},[3989],{"type":47,"value":3774},{"type":41,"tag":118,"props":3991,"children":3992},{"style":131},[3993],{"type":47,"value":134},{"type":41,"tag":118,"props":3995,"children":3996},{"style":137},[3997],{"type":47,"value":3998}," waitUntilComplete",{"type":41,"tag":118,"props":4000,"children":4001},{"style":131},[4002],{"type":47,"value":145},{"type":41,"tag":118,"props":4004,"children":4005},{"style":131},[4006],{"type":47,"value":1664},{"type":41,"tag":118,"props":4008,"children":4009},{"style":137},[4010],{"type":47,"value":3615},{"type":41,"tag":118,"props":4012,"children":4013},{"style":131},[4014],{"type":47,"value":225},{"type":41,"tag":118,"props":4016,"children":4017},{"style":228},[4018],{"type":47,"value":4019},"pipe",{"type":41,"tag":118,"props":4021,"children":4022},{"style":247},[4023],{"type":47,"value":236},{"type":41,"tag":118,"props":4025,"children":4026},{"style":137},[4027],{"type":47,"value":4028},"completion",{"type":41,"tag":118,"props":4030,"children":4031},{"style":247},[4032],{"type":47,"value":418},{"type":41,"tag":118,"props":4034,"children":4035},{"style":131},[4036],{"type":47,"value":171},{"type":41,"tag":118,"props":4038,"children":4039},{"class":120,"line":433},[4040,4045,4049,4054],{"type":41,"tag":118,"props":4041,"children":4042},{"style":125},[4043],{"type":47,"value":4044},"    await",{"type":41,"tag":118,"props":4046,"children":4047},{"style":228},[4048],{"type":47,"value":3998},{"type":41,"tag":118,"props":4050,"children":4051},{"style":247},[4052],{"type":47,"value":4053},"()",{"type":41,"tag":118,"props":4055,"children":4056},{"style":131},[4057],{"type":47,"value":171},{"type":41,"tag":118,"props":4059,"children":4060},{"class":120,"line":1069},[4061],{"type":41,"tag":118,"props":4062,"children":4063},{"style":131},[4064],{"type":47,"value":374},{"type":41,"tag":118,"props":4066,"children":4067},{"class":120,"line":1077},[4068,4072,4076],{"type":41,"tag":118,"props":4069,"children":4070},{"style":131},[4071],{"type":47,"value":413},{"type":41,"tag":118,"props":4073,"children":4074},{"style":137},[4075],{"type":47,"value":418},{"type":41,"tag":118,"props":4077,"children":4078},{"style":131},[4079],{"type":47,"value":171},{"type":41,"tag":99,"props":4081,"children":4083},{"id":4082},"read-stream-in-react",[4084],{"type":47,"value":4085},"Read Stream in React",{"type":41,"tag":106,"props":4087,"children":4089},{"className":1446,"code":4088,"language":1448,"meta":111,"style":111},"\"use client\";\nimport { useRealtimeStream } from \"@trigger.dev\u002Freact-hooks\";\nimport { aiStream } from \"..\u002Ftrigger\u002Fstreams\";\n\nfunction AIResponse({ runId, accessToken }: { runId: string; accessToken: string }) {\n  const { parts, error } = useRealtimeStream(aiStream, runId, {\n    accessToken,\n    throttleInMs: 50,\n  });\n\n  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n  if (!parts) return \u003Cdiv>Waiting for response...\u003C\u002Fdiv>;\n\n  return \u003Cdiv>{parts.join(\"\")}\u003C\u002Fdiv>;\n}\n",[4090],{"type":41,"tag":114,"props":4091,"children":4092},{"__ignoreMap":111},[4093,4112,4152,4192,4199,4271,4332,4343,4364,4379,4386,4453,4510,4517,4575],{"type":41,"tag":118,"props":4094,"children":4095},{"class":120,"line":121},[4096,4100,4104,4108],{"type":41,"tag":118,"props":4097,"children":4098},{"style":131},[4099],{"type":47,"value":166},{"type":41,"tag":118,"props":4101,"children":4102},{"style":158},[4103],{"type":47,"value":1464},{"type":41,"tag":118,"props":4105,"children":4106},{"style":131},[4107],{"type":47,"value":166},{"type":41,"tag":118,"props":4109,"children":4110},{"style":131},[4111],{"type":47,"value":171},{"type":41,"tag":118,"props":4113,"children":4114},{"class":120,"line":174},[4115,4119,4123,4128,4132,4136,4140,4144,4148],{"type":41,"tag":118,"props":4116,"children":4117},{"style":125},[4118],{"type":47,"value":128},{"type":41,"tag":118,"props":4120,"children":4121},{"style":131},[4122],{"type":47,"value":134},{"type":41,"tag":118,"props":4124,"children":4125},{"style":137},[4126],{"type":47,"value":4127}," useRealtimeStream",{"type":41,"tag":118,"props":4129,"children":4130},{"style":131},[4131],{"type":47,"value":145},{"type":41,"tag":118,"props":4133,"children":4134},{"style":125},[4135],{"type":47,"value":150},{"type":41,"tag":118,"props":4137,"children":4138},{"style":131},[4139],{"type":47,"value":155},{"type":41,"tag":118,"props":4141,"children":4142},{"style":158},[4143],{"type":47,"value":1505},{"type":41,"tag":118,"props":4145,"children":4146},{"style":131},[4147],{"type":47,"value":166},{"type":41,"tag":118,"props":4149,"children":4150},{"style":131},[4151],{"type":47,"value":171},{"type":41,"tag":118,"props":4153,"children":4154},{"class":120,"line":184},[4155,4159,4163,4167,4171,4175,4179,4184,4188],{"type":41,"tag":118,"props":4156,"children":4157},{"style":125},[4158],{"type":47,"value":128},{"type":41,"tag":118,"props":4160,"children":4161},{"style":131},[4162],{"type":47,"value":134},{"type":41,"tag":118,"props":4164,"children":4165},{"style":137},[4166],{"type":47,"value":3615},{"type":41,"tag":118,"props":4168,"children":4169},{"style":131},[4170],{"type":47,"value":145},{"type":41,"tag":118,"props":4172,"children":4173},{"style":125},[4174],{"type":47,"value":150},{"type":41,"tag":118,"props":4176,"children":4177},{"style":131},[4178],{"type":47,"value":155},{"type":41,"tag":118,"props":4180,"children":4181},{"style":158},[4182],{"type":47,"value":4183},"..\u002Ftrigger\u002Fstreams",{"type":41,"tag":118,"props":4185,"children":4186},{"style":131},[4187],{"type":47,"value":166},{"type":41,"tag":118,"props":4189,"children":4190},{"style":131},[4191],{"type":47,"value":171},{"type":41,"tag":118,"props":4193,"children":4194},{"class":120,"line":194},[4195],{"type":41,"tag":118,"props":4196,"children":4197},{"emptyLinePlaceholder":178},[4198],{"type":47,"value":181},{"type":41,"tag":118,"props":4200,"children":4201},{"class":120,"line":28},[4202,4206,4211,4215,4219,4223,4227,4231,4235,4239,4243,4247,4251,4255,4259,4263,4267],{"type":41,"tag":118,"props":4203,"children":4204},{"style":198},[4205],{"type":47,"value":1574},{"type":41,"tag":118,"props":4207,"children":4208},{"style":228},[4209],{"type":47,"value":4210}," AIResponse",{"type":41,"tag":118,"props":4212,"children":4213},{"style":131},[4214],{"type":47,"value":1584},{"type":41,"tag":118,"props":4216,"children":4217},{"style":1587},[4218],{"type":47,"value":2368},{"type":41,"tag":118,"props":4220,"children":4221},{"style":131},[4222],{"type":47,"value":506},{"type":41,"tag":118,"props":4224,"children":4225},{"style":1587},[4226],{"type":47,"value":1590},{"type":41,"tag":118,"props":4228,"children":4229},{"style":131},[4230],{"type":47,"value":1595},{"type":41,"tag":118,"props":4232,"children":4233},{"style":131},[4234],{"type":47,"value":134},{"type":41,"tag":118,"props":4236,"children":4237},{"style":247},[4238],{"type":47,"value":2368},{"type":41,"tag":118,"props":4240,"children":4241},{"style":131},[4242],{"type":47,"value":255},{"type":41,"tag":118,"props":4244,"children":4245},{"style":1424},[4246],{"type":47,"value":1612},{"type":41,"tag":118,"props":4248,"children":4249},{"style":131},[4250],{"type":47,"value":2401},{"type":41,"tag":118,"props":4252,"children":4253},{"style":247},[4254],{"type":47,"value":1590},{"type":41,"tag":118,"props":4256,"children":4257},{"style":131},[4258],{"type":47,"value":255},{"type":41,"tag":118,"props":4260,"children":4261},{"style":1424},[4262],{"type":47,"value":1612},{"type":41,"tag":118,"props":4264,"children":4265},{"style":131},[4266],{"type":47,"value":1617},{"type":41,"tag":118,"props":4268,"children":4269},{"style":131},[4270],{"type":47,"value":260},{"type":41,"tag":118,"props":4272,"children":4273},{"class":120,"line":263},[4274,4278,4282,4287,4291,4295,4299,4303,4307,4311,4316,4320,4324,4328],{"type":41,"tag":118,"props":4275,"children":4276},{"style":198},[4277],{"type":47,"value":1629},{"type":41,"tag":118,"props":4279,"children":4280},{"style":131},[4281],{"type":47,"value":134},{"type":41,"tag":118,"props":4283,"children":4284},{"style":137},[4285],{"type":47,"value":4286}," parts",{"type":41,"tag":118,"props":4288,"children":4289},{"style":131},[4290],{"type":47,"value":506},{"type":41,"tag":118,"props":4292,"children":4293},{"style":137},[4294],{"type":47,"value":2445},{"type":41,"tag":118,"props":4296,"children":4297},{"style":131},[4298],{"type":47,"value":145},{"type":41,"tag":118,"props":4300,"children":4301},{"style":131},[4302],{"type":47,"value":1664},{"type":41,"tag":118,"props":4304,"children":4305},{"style":228},[4306],{"type":47,"value":4127},{"type":41,"tag":118,"props":4308,"children":4309},{"style":247},[4310],{"type":47,"value":236},{"type":41,"tag":118,"props":4312,"children":4313},{"style":137},[4314],{"type":47,"value":4315},"aiStream",{"type":41,"tag":118,"props":4317,"children":4318},{"style":131},[4319],{"type":47,"value":506},{"type":41,"tag":118,"props":4321,"children":4322},{"style":137},[4323],{"type":47,"value":2368},{"type":41,"tag":118,"props":4325,"children":4326},{"style":131},[4327],{"type":47,"value":506},{"type":41,"tag":118,"props":4329,"children":4330},{"style":131},[4331],{"type":47,"value":260},{"type":41,"tag":118,"props":4333,"children":4334},{"class":120,"line":280},[4335,4339],{"type":41,"tag":118,"props":4336,"children":4337},{"style":137},[4338],{"type":47,"value":2494},{"type":41,"tag":118,"props":4340,"children":4341},{"style":131},[4342],{"type":47,"value":318},{"type":41,"tag":118,"props":4344,"children":4345},{"class":120,"line":321},[4346,4351,4355,4360],{"type":41,"tag":118,"props":4347,"children":4348},{"style":247},[4349],{"type":47,"value":4350},"    throttleInMs",{"type":41,"tag":118,"props":4352,"children":4353},{"style":131},[4354],{"type":47,"value":255},{"type":41,"tag":118,"props":4356,"children":4357},{"style":2878},[4358],{"type":47,"value":4359}," 50",{"type":41,"tag":118,"props":4361,"children":4362},{"style":131},[4363],{"type":47,"value":318},{"type":41,"tag":118,"props":4365,"children":4366},{"class":120,"line":359},[4367,4371,4375],{"type":41,"tag":118,"props":4368,"children":4369},{"style":131},[4370],{"type":47,"value":2602},{"type":41,"tag":118,"props":4372,"children":4373},{"style":247},[4374],{"type":47,"value":418},{"type":41,"tag":118,"props":4376,"children":4377},{"style":131},[4378],{"type":47,"value":171},{"type":41,"tag":118,"props":4380,"children":4381},{"class":120,"line":368},[4382],{"type":41,"tag":118,"props":4383,"children":4384},{"emptyLinePlaceholder":178},[4385],{"type":47,"value":181},{"type":41,"tag":118,"props":4387,"children":4388},{"class":120,"line":377},[4389,4393,4397,4401,4405,4409,4413,4417,4421,4425,4429,4433,4437,4441,4445,4449],{"type":41,"tag":118,"props":4390,"children":4391},{"style":125},[4392],{"type":47,"value":936},{"type":41,"tag":118,"props":4394,"children":4395},{"style":247},[4396],{"type":47,"value":745},{"type":41,"tag":118,"props":4398,"children":4399},{"style":137},[4400],{"type":47,"value":2633},{"type":41,"tag":118,"props":4402,"children":4403},{"style":247},[4404],{"type":47,"value":975},{"type":41,"tag":118,"props":4406,"children":4407},{"style":125},[4408],{"type":47,"value":2642},{"type":41,"tag":118,"props":4410,"children":4411},{"style":131},[4412],{"type":47,"value":2100},{"type":41,"tag":118,"props":4414,"children":4415},{"style":247},[4416],{"type":47,"value":1769},{"type":41,"tag":118,"props":4418,"children":4419},{"style":131},[4420],{"type":47,"value":1682},{"type":41,"tag":118,"props":4422,"children":4423},{"style":137},[4424],{"type":47,"value":2659},{"type":41,"tag":118,"props":4426,"children":4427},{"style":131},[4428],{"type":47,"value":1823},{"type":41,"tag":118,"props":4430,"children":4431},{"style":137},[4432],{"type":47,"value":2633},{"type":41,"tag":118,"props":4434,"children":4435},{"style":131},[4436],{"type":47,"value":225},{"type":41,"tag":118,"props":4438,"children":4439},{"style":137},[4440],{"type":47,"value":2676},{"type":41,"tag":118,"props":4442,"children":4443},{"style":131},[4444],{"type":47,"value":1997},{"type":41,"tag":118,"props":4446,"children":4447},{"style":247},[4448],{"type":47,"value":1769},{"type":41,"tag":118,"props":4450,"children":4451},{"style":131},[4452],{"type":47,"value":2689},{"type":41,"tag":118,"props":4454,"children":4455},{"class":120,"line":407},[4456,4460,4464,4468,4473,4477,4481,4485,4489,4493,4498,4502,4506],{"type":41,"tag":118,"props":4457,"children":4458},{"style":125},[4459],{"type":47,"value":936},{"type":41,"tag":118,"props":4461,"children":4462},{"style":247},[4463],{"type":47,"value":745},{"type":41,"tag":118,"props":4465,"children":4466},{"style":131},[4467],{"type":47,"value":2705},{"type":41,"tag":118,"props":4469,"children":4470},{"style":137},[4471],{"type":47,"value":4472},"parts",{"type":41,"tag":118,"props":4474,"children":4475},{"style":247},[4476],{"type":47,"value":975},{"type":41,"tag":118,"props":4478,"children":4479},{"style":125},[4480],{"type":47,"value":2642},{"type":41,"tag":118,"props":4482,"children":4483},{"style":131},[4484],{"type":47,"value":2100},{"type":41,"tag":118,"props":4486,"children":4487},{"style":247},[4488],{"type":47,"value":1769},{"type":41,"tag":118,"props":4490,"children":4491},{"style":131},[4492],{"type":47,"value":1682},{"type":41,"tag":118,"props":4494,"children":4495},{"style":137},[4496],{"type":47,"value":4497},"Waiting for response...",{"type":41,"tag":118,"props":4499,"children":4500},{"style":131},[4501],{"type":47,"value":2062},{"type":41,"tag":118,"props":4503,"children":4504},{"style":247},[4505],{"type":47,"value":1769},{"type":41,"tag":118,"props":4507,"children":4508},{"style":131},[4509],{"type":47,"value":2689},{"type":41,"tag":118,"props":4511,"children":4512},{"class":120,"line":425},[4513],{"type":41,"tag":118,"props":4514,"children":4515},{"emptyLinePlaceholder":178},[4516],{"type":47,"value":181},{"type":41,"tag":118,"props":4518,"children":4519},{"class":120,"line":433},[4520,4524,4528,4532,4537,4541,4545,4550,4554,4559,4563,4567,4571],{"type":41,"tag":118,"props":4521,"children":4522},{"style":125},[4523],{"type":47,"value":1751},{"type":41,"tag":118,"props":4525,"children":4526},{"style":131},[4527],{"type":47,"value":2100},{"type":41,"tag":118,"props":4529,"children":4530},{"style":247},[4531],{"type":47,"value":1769},{"type":41,"tag":118,"props":4533,"children":4534},{"style":131},[4535],{"type":47,"value":4536},">{",{"type":41,"tag":118,"props":4538,"children":4539},{"style":137},[4540],{"type":47,"value":4472},{"type":41,"tag":118,"props":4542,"children":4543},{"style":131},[4544],{"type":47,"value":225},{"type":41,"tag":118,"props":4546,"children":4547},{"style":228},[4548],{"type":47,"value":4549},"join",{"type":41,"tag":118,"props":4551,"children":4552},{"style":137},[4553],{"type":47,"value":236},{"type":41,"tag":118,"props":4555,"children":4556},{"style":131},[4557],{"type":47,"value":4558},"\"\"",{"type":41,"tag":118,"props":4560,"children":4561},{"style":137},[4562],{"type":47,"value":418},{"type":41,"tag":118,"props":4564,"children":4565},{"style":131},[4566],{"type":47,"value":1997},{"type":41,"tag":118,"props":4568,"children":4569},{"style":247},[4570],{"type":47,"value":1769},{"type":41,"tag":118,"props":4572,"children":4573},{"style":131},[4574],{"type":47,"value":2689},{"type":41,"tag":118,"props":4576,"children":4577},{"class":120,"line":1069},[4578],{"type":41,"tag":118,"props":4579,"children":4580},{"style":131},[4581],{"type":47,"value":1066},{"type":41,"tag":56,"props":4583,"children":4585},{"id":4584},"wait-tokens-human-in-the-loop",[4586],{"type":47,"value":4587},"Wait Tokens (Human-in-the-loop)",{"type":41,"tag":99,"props":4589,"children":4591},{"id":4590},"in-task",[4592],{"type":47,"value":4593},"In Task",{"type":41,"tag":106,"props":4595,"children":4597},{"className":108,"code":4596,"language":110,"meta":111,"style":111},"import { task, wait } from \"@trigger.dev\u002Fsdk\";\n\nexport const approvalTask = task({\n  id: \"approval-task\",\n  run: async (payload) => {\n    \u002F\u002F Process initial data\n    const processed = await processData(payload);\n\n    \u002F\u002F Wait for human approval\n    const approval = await wait.forToken\u003C{ approved: boolean }>({\n      token: `approval-${payload.id}`,\n      timeoutInSeconds: 86400, \u002F\u002F 24 hours\n    });\n\n    if (approval.approved) {\n      return await finalizeData(processed);\n    }\n    \n    throw new Error(\"Not approved\");\n  },\n});\n",[4598],{"type":41,"tag":114,"props":4599,"children":4600},{"__ignoreMap":111},[4601,4649,4656,4688,4716,4751,4759,4800,4807,4815,4880,4926,4952,4967,4974,5008,5042,5050,5058,5101,5108],{"type":41,"tag":118,"props":4602,"children":4603},{"class":120,"line":121},[4604,4608,4612,4616,4620,4625,4629,4633,4637,4641,4645],{"type":41,"tag":118,"props":4605,"children":4606},{"style":125},[4607],{"type":47,"value":128},{"type":41,"tag":118,"props":4609,"children":4610},{"style":131},[4611],{"type":47,"value":134},{"type":41,"tag":118,"props":4613,"children":4614},{"style":137},[4615],{"type":47,"value":3575},{"type":41,"tag":118,"props":4617,"children":4618},{"style":131},[4619],{"type":47,"value":506},{"type":41,"tag":118,"props":4621,"children":4622},{"style":137},[4623],{"type":47,"value":4624}," wait",{"type":41,"tag":118,"props":4626,"children":4627},{"style":131},[4628],{"type":47,"value":145},{"type":41,"tag":118,"props":4630,"children":4631},{"style":125},[4632],{"type":47,"value":150},{"type":41,"tag":118,"props":4634,"children":4635},{"style":131},[4636],{"type":47,"value":155},{"type":41,"tag":118,"props":4638,"children":4639},{"style":158},[4640],{"type":47,"value":161},{"type":41,"tag":118,"props":4642,"children":4643},{"style":131},[4644],{"type":47,"value":166},{"type":41,"tag":118,"props":4646,"children":4647},{"style":131},[4648],{"type":47,"value":171},{"type":41,"tag":118,"props":4650,"children":4651},{"class":120,"line":174},[4652],{"type":41,"tag":118,"props":4653,"children":4654},{"emptyLinePlaceholder":178},[4655],{"type":47,"value":181},{"type":41,"tag":118,"props":4657,"children":4658},{"class":120,"line":184},[4659,4663,4667,4672,4676,4680,4684],{"type":41,"tag":118,"props":4660,"children":4661},{"style":125},[4662],{"type":47,"value":3453},{"type":41,"tag":118,"props":4664,"children":4665},{"style":198},[4666],{"type":47,"value":3458},{"type":41,"tag":118,"props":4668,"children":4669},{"style":137},[4670],{"type":47,"value":4671}," approvalTask ",{"type":41,"tag":118,"props":4673,"children":4674},{"style":131},[4675],{"type":47,"value":211},{"type":41,"tag":118,"props":4677,"children":4678},{"style":228},[4679],{"type":47,"value":3575},{"type":41,"tag":118,"props":4681,"children":4682},{"style":137},[4683],{"type":47,"value":236},{"type":41,"tag":118,"props":4685,"children":4686},{"style":131},[4687],{"type":47,"value":241},{"type":41,"tag":118,"props":4689,"children":4690},{"class":120,"line":194},[4691,4695,4699,4703,4708,4712],{"type":41,"tag":118,"props":4692,"children":4693},{"style":247},[4694],{"type":47,"value":3510},{"type":41,"tag":118,"props":4696,"children":4697},{"style":131},[4698],{"type":47,"value":255},{"type":41,"tag":118,"props":4700,"children":4701},{"style":131},[4702],{"type":47,"value":155},{"type":41,"tag":118,"props":4704,"children":4705},{"style":158},[4706],{"type":47,"value":4707},"approval-task",{"type":41,"tag":118,"props":4709,"children":4710},{"style":131},[4711],{"type":47,"value":166},{"type":41,"tag":118,"props":4713,"children":4714},{"style":131},[4715],{"type":47,"value":318},{"type":41,"tag":118,"props":4717,"children":4718},{"class":120,"line":28},[4719,4723,4727,4731,4735,4739,4743,4747],{"type":41,"tag":118,"props":4720,"children":4721},{"style":228},[4722],{"type":47,"value":3715},{"type":41,"tag":118,"props":4724,"children":4725},{"style":131},[4726],{"type":47,"value":255},{"type":41,"tag":118,"props":4728,"children":4729},{"style":198},[4730],{"type":47,"value":3724},{"type":41,"tag":118,"props":4732,"children":4733},{"style":131},[4734],{"type":47,"value":745},{"type":41,"tag":118,"props":4736,"children":4737},{"style":1587},[4738],{"type":47,"value":3733},{"type":41,"tag":118,"props":4740,"children":4741},{"style":131},[4742],{"type":47,"value":418},{"type":41,"tag":118,"props":4744,"children":4745},{"style":198},[4746],{"type":47,"value":1810},{"type":41,"tag":118,"props":4748,"children":4749},{"style":131},[4750],{"type":47,"value":260},{"type":41,"tag":118,"props":4752,"children":4753},{"class":120,"line":263},[4754],{"type":41,"tag":118,"props":4755,"children":4756},{"style":188},[4757],{"type":47,"value":4758},"    \u002F\u002F Process initial data\n",{"type":41,"tag":118,"props":4760,"children":4761},{"class":120,"line":280},[4762,4766,4771,4775,4779,4784,4788,4792,4796],{"type":41,"tag":118,"props":4763,"children":4764},{"style":198},[4765],{"type":47,"value":3774},{"type":41,"tag":118,"props":4767,"children":4768},{"style":137},[4769],{"type":47,"value":4770}," processed",{"type":41,"tag":118,"props":4772,"children":4773},{"style":131},[4774],{"type":47,"value":1664},{"type":41,"tag":118,"props":4776,"children":4777},{"style":125},[4778],{"type":47,"value":216},{"type":41,"tag":118,"props":4780,"children":4781},{"style":228},[4782],{"type":47,"value":4783}," processData",{"type":41,"tag":118,"props":4785,"children":4786},{"style":247},[4787],{"type":47,"value":236},{"type":41,"tag":118,"props":4789,"children":4790},{"style":137},[4791],{"type":47,"value":3733},{"type":41,"tag":118,"props":4793,"children":4794},{"style":247},[4795],{"type":47,"value":418},{"type":41,"tag":118,"props":4797,"children":4798},{"style":131},[4799],{"type":47,"value":171},{"type":41,"tag":118,"props":4801,"children":4802},{"class":120,"line":321},[4803],{"type":41,"tag":118,"props":4804,"children":4805},{"emptyLinePlaceholder":178},[4806],{"type":47,"value":181},{"type":41,"tag":118,"props":4808,"children":4809},{"class":120,"line":359},[4810],{"type":41,"tag":118,"props":4811,"children":4812},{"style":188},[4813],{"type":47,"value":4814},"    \u002F\u002F Wait for human approval\n",{"type":41,"tag":118,"props":4816,"children":4817},{"class":120,"line":368},[4818,4822,4827,4831,4835,4839,4843,4848,4853,4858,4862,4867,4872,4876],{"type":41,"tag":118,"props":4819,"children":4820},{"style":198},[4821],{"type":47,"value":3774},{"type":41,"tag":118,"props":4823,"children":4824},{"style":137},[4825],{"type":47,"value":4826}," approval",{"type":41,"tag":118,"props":4828,"children":4829},{"style":131},[4830],{"type":47,"value":1664},{"type":41,"tag":118,"props":4832,"children":4833},{"style":125},[4834],{"type":47,"value":216},{"type":41,"tag":118,"props":4836,"children":4837},{"style":137},[4838],{"type":47,"value":4624},{"type":41,"tag":118,"props":4840,"children":4841},{"style":131},[4842],{"type":47,"value":225},{"type":41,"tag":118,"props":4844,"children":4845},{"style":228},[4846],{"type":47,"value":4847},"forToken",{"type":41,"tag":118,"props":4849,"children":4850},{"style":131},[4851],{"type":47,"value":4852},"\u003C{",{"type":41,"tag":118,"props":4854,"children":4855},{"style":247},[4856],{"type":47,"value":4857}," approved",{"type":41,"tag":118,"props":4859,"children":4860},{"style":131},[4861],{"type":47,"value":255},{"type":41,"tag":118,"props":4863,"children":4864},{"style":1424},[4865],{"type":47,"value":4866}," boolean",{"type":41,"tag":118,"props":4868,"children":4869},{"style":131},[4870],{"type":47,"value":4871}," }>",{"type":41,"tag":118,"props":4873,"children":4874},{"style":247},[4875],{"type":47,"value":236},{"type":41,"tag":118,"props":4877,"children":4878},{"style":131},[4879],{"type":47,"value":241},{"type":41,"tag":118,"props":4881,"children":4882},{"class":120,"line":377},[4883,4888,4892,4897,4902,4906,4910,4914,4918,4922],{"type":41,"tag":118,"props":4884,"children":4885},{"style":247},[4886],{"type":47,"value":4887},"      token",{"type":41,"tag":118,"props":4889,"children":4890},{"style":131},[4891],{"type":47,"value":255},{"type":41,"tag":118,"props":4893,"children":4894},{"style":131},[4895],{"type":47,"value":4896}," `",{"type":41,"tag":118,"props":4898,"children":4899},{"style":158},[4900],{"type":47,"value":4901},"approval-",{"type":41,"tag":118,"props":4903,"children":4904},{"style":131},[4905],{"type":47,"value":826},{"type":41,"tag":118,"props":4907,"children":4908},{"style":137},[4909],{"type":47,"value":3733},{"type":41,"tag":118,"props":4911,"children":4912},{"style":131},[4913],{"type":47,"value":225},{"type":41,"tag":118,"props":4915,"children":4916},{"style":137},[4917],{"type":47,"value":1196},{"type":41,"tag":118,"props":4919,"children":4920},{"style":131},[4921],{"type":47,"value":845},{"type":41,"tag":118,"props":4923,"children":4924},{"style":131},[4925],{"type":47,"value":318},{"type":41,"tag":118,"props":4927,"children":4928},{"class":120,"line":407},[4929,4934,4938,4943,4947],{"type":41,"tag":118,"props":4930,"children":4931},{"style":247},[4932],{"type":47,"value":4933},"      timeoutInSeconds",{"type":41,"tag":118,"props":4935,"children":4936},{"style":131},[4937],{"type":47,"value":255},{"type":41,"tag":118,"props":4939,"children":4940},{"style":2878},[4941],{"type":47,"value":4942}," 86400",{"type":41,"tag":118,"props":4944,"children":4945},{"style":131},[4946],{"type":47,"value":506},{"type":41,"tag":118,"props":4948,"children":4949},{"style":188},[4950],{"type":47,"value":4951}," \u002F\u002F 24 hours\n",{"type":41,"tag":118,"props":4953,"children":4954},{"class":120,"line":425},[4955,4959,4963],{"type":41,"tag":118,"props":4956,"children":4957},{"style":131},[4958],{"type":47,"value":3967},{"type":41,"tag":118,"props":4960,"children":4961},{"style":247},[4962],{"type":47,"value":418},{"type":41,"tag":118,"props":4964,"children":4965},{"style":131},[4966],{"type":47,"value":171},{"type":41,"tag":118,"props":4968,"children":4969},{"class":120,"line":433},[4970],{"type":41,"tag":118,"props":4971,"children":4972},{"emptyLinePlaceholder":178},[4973],{"type":47,"value":181},{"type":41,"tag":118,"props":4975,"children":4976},{"class":120,"line":1069},[4977,4982,4986,4991,4995,5000,5004],{"type":41,"tag":118,"props":4978,"children":4979},{"style":125},[4980],{"type":47,"value":4981},"    if",{"type":41,"tag":118,"props":4983,"children":4984},{"style":247},[4985],{"type":47,"value":745},{"type":41,"tag":118,"props":4987,"children":4988},{"style":137},[4989],{"type":47,"value":4990},"approval",{"type":41,"tag":118,"props":4992,"children":4993},{"style":131},[4994],{"type":47,"value":225},{"type":41,"tag":118,"props":4996,"children":4997},{"style":137},[4998],{"type":47,"value":4999},"approved",{"type":41,"tag":118,"props":5001,"children":5002},{"style":247},[5003],{"type":47,"value":975},{"type":41,"tag":118,"props":5005,"children":5006},{"style":131},[5007],{"type":47,"value":241},{"type":41,"tag":118,"props":5009,"children":5010},{"class":120,"line":1077},[5011,5016,5020,5025,5029,5034,5038],{"type":41,"tag":118,"props":5012,"children":5013},{"style":125},[5014],{"type":47,"value":5015},"      return",{"type":41,"tag":118,"props":5017,"children":5018},{"style":125},[5019],{"type":47,"value":216},{"type":41,"tag":118,"props":5021,"children":5022},{"style":228},[5023],{"type":47,"value":5024}," finalizeData",{"type":41,"tag":118,"props":5026,"children":5027},{"style":247},[5028],{"type":47,"value":236},{"type":41,"tag":118,"props":5030,"children":5031},{"style":137},[5032],{"type":47,"value":5033},"processed",{"type":41,"tag":118,"props":5035,"children":5036},{"style":247},[5037],{"type":47,"value":418},{"type":41,"tag":118,"props":5039,"children":5040},{"style":131},[5041],{"type":47,"value":171},{"type":41,"tag":118,"props":5043,"children":5044},{"class":120,"line":1086},[5045],{"type":41,"tag":118,"props":5046,"children":5047},{"style":131},[5048],{"type":47,"value":5049},"    }\n",{"type":41,"tag":118,"props":5051,"children":5052},{"class":120,"line":1153},[5053],{"type":41,"tag":118,"props":5054,"children":5055},{"style":247},[5056],{"type":47,"value":5057},"    \n",{"type":41,"tag":118,"props":5059,"children":5060},{"class":120,"line":1236},[5061,5066,5071,5076,5080,5084,5089,5093,5097],{"type":41,"tag":118,"props":5062,"children":5063},{"style":125},[5064],{"type":47,"value":5065},"    throw",{"type":41,"tag":118,"props":5067,"children":5068},{"style":131},[5069],{"type":47,"value":5070}," new",{"type":41,"tag":118,"props":5072,"children":5073},{"style":228},[5074],{"type":47,"value":5075}," Error",{"type":41,"tag":118,"props":5077,"children":5078},{"style":247},[5079],{"type":47,"value":236},{"type":41,"tag":118,"props":5081,"children":5082},{"style":131},[5083],{"type":47,"value":166},{"type":41,"tag":118,"props":5085,"children":5086},{"style":158},[5087],{"type":47,"value":5088},"Not approved",{"type":41,"tag":118,"props":5090,"children":5091},{"style":131},[5092],{"type":47,"value":166},{"type":41,"tag":118,"props":5094,"children":5095},{"style":247},[5096],{"type":47,"value":418},{"type":41,"tag":118,"props":5098,"children":5099},{"style":131},[5100],{"type":47,"value":171},{"type":41,"tag":118,"props":5102,"children":5103},{"class":120,"line":1244},[5104],{"type":41,"tag":118,"props":5105,"children":5106},{"style":131},[5107],{"type":47,"value":374},{"type":41,"tag":118,"props":5109,"children":5110},{"class":120,"line":1252},[5111,5115,5119],{"type":41,"tag":118,"props":5112,"children":5113},{"style":131},[5114],{"type":47,"value":413},{"type":41,"tag":118,"props":5116,"children":5117},{"style":137},[5118],{"type":47,"value":418},{"type":41,"tag":118,"props":5120,"children":5121},{"style":131},[5122],{"type":47,"value":171},{"type":41,"tag":99,"props":5124,"children":5126},{"id":5125},"complete-token-from-react",[5127],{"type":47,"value":5128},"Complete Token from React",{"type":41,"tag":106,"props":5130,"children":5132},{"className":1446,"code":5131,"language":1448,"meta":111,"style":111},"\"use client\";\nimport { useWaitToken } from \"@trigger.dev\u002Freact-hooks\";\n\nfunction ApprovalButton({ tokenId, accessToken }: { tokenId: string; accessToken: string }) {\n  const { complete } = useWaitToken(tokenId, { accessToken });\n\n  return (\n    \u003Cdiv>\n      \u003Cbutton onClick={() => complete({ approved: true })}>\n        Approve\n      \u003C\u002Fbutton>\n      \u003Cbutton onClick={() => complete({ approved: false })}>\n        Reject\n      \u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  );\n}\n",[5133],{"type":41,"tag":114,"props":5134,"children":5135},{"__ignoreMap":111},[5136,5155,5195,5202,5275,5336,5343,5354,5369,5430,5438,5453,5513,5521,5536,5551,5562],{"type":41,"tag":118,"props":5137,"children":5138},{"class":120,"line":121},[5139,5143,5147,5151],{"type":41,"tag":118,"props":5140,"children":5141},{"style":131},[5142],{"type":47,"value":166},{"type":41,"tag":118,"props":5144,"children":5145},{"style":158},[5146],{"type":47,"value":1464},{"type":41,"tag":118,"props":5148,"children":5149},{"style":131},[5150],{"type":47,"value":166},{"type":41,"tag":118,"props":5152,"children":5153},{"style":131},[5154],{"type":47,"value":171},{"type":41,"tag":118,"props":5156,"children":5157},{"class":120,"line":174},[5158,5162,5166,5171,5175,5179,5183,5187,5191],{"type":41,"tag":118,"props":5159,"children":5160},{"style":125},[5161],{"type":47,"value":128},{"type":41,"tag":118,"props":5163,"children":5164},{"style":131},[5165],{"type":47,"value":134},{"type":41,"tag":118,"props":5167,"children":5168},{"style":137},[5169],{"type":47,"value":5170}," useWaitToken",{"type":41,"tag":118,"props":5172,"children":5173},{"style":131},[5174],{"type":47,"value":145},{"type":41,"tag":118,"props":5176,"children":5177},{"style":125},[5178],{"type":47,"value":150},{"type":41,"tag":118,"props":5180,"children":5181},{"style":131},[5182],{"type":47,"value":155},{"type":41,"tag":118,"props":5184,"children":5185},{"style":158},[5186],{"type":47,"value":1505},{"type":41,"tag":118,"props":5188,"children":5189},{"style":131},[5190],{"type":47,"value":166},{"type":41,"tag":118,"props":5192,"children":5193},{"style":131},[5194],{"type":47,"value":171},{"type":41,"tag":118,"props":5196,"children":5197},{"class":120,"line":184},[5198],{"type":41,"tag":118,"props":5199,"children":5200},{"emptyLinePlaceholder":178},[5201],{"type":47,"value":181},{"type":41,"tag":118,"props":5203,"children":5204},{"class":120,"line":194},[5205,5209,5214,5218,5223,5227,5231,5235,5239,5243,5247,5251,5255,5259,5263,5267,5271],{"type":41,"tag":118,"props":5206,"children":5207},{"style":198},[5208],{"type":47,"value":1574},{"type":41,"tag":118,"props":5210,"children":5211},{"style":228},[5212],{"type":47,"value":5213}," ApprovalButton",{"type":41,"tag":118,"props":5215,"children":5216},{"style":131},[5217],{"type":47,"value":1584},{"type":41,"tag":118,"props":5219,"children":5220},{"style":1587},[5221],{"type":47,"value":5222}," tokenId",{"type":41,"tag":118,"props":5224,"children":5225},{"style":131},[5226],{"type":47,"value":506},{"type":41,"tag":118,"props":5228,"children":5229},{"style":1587},[5230],{"type":47,"value":1590},{"type":41,"tag":118,"props":5232,"children":5233},{"style":131},[5234],{"type":47,"value":1595},{"type":41,"tag":118,"props":5236,"children":5237},{"style":131},[5238],{"type":47,"value":134},{"type":41,"tag":118,"props":5240,"children":5241},{"style":247},[5242],{"type":47,"value":5222},{"type":41,"tag":118,"props":5244,"children":5245},{"style":131},[5246],{"type":47,"value":255},{"type":41,"tag":118,"props":5248,"children":5249},{"style":1424},[5250],{"type":47,"value":1612},{"type":41,"tag":118,"props":5252,"children":5253},{"style":131},[5254],{"type":47,"value":2401},{"type":41,"tag":118,"props":5256,"children":5257},{"style":247},[5258],{"type":47,"value":1590},{"type":41,"tag":118,"props":5260,"children":5261},{"style":131},[5262],{"type":47,"value":255},{"type":41,"tag":118,"props":5264,"children":5265},{"style":1424},[5266],{"type":47,"value":1612},{"type":41,"tag":118,"props":5268,"children":5269},{"style":131},[5270],{"type":47,"value":1617},{"type":41,"tag":118,"props":5272,"children":5273},{"style":131},[5274],{"type":47,"value":260},{"type":41,"tag":118,"props":5276,"children":5277},{"class":120,"line":28},[5278,5282,5286,5291,5295,5299,5303,5307,5312,5316,5320,5324,5328,5332],{"type":41,"tag":118,"props":5279,"children":5280},{"style":198},[5281],{"type":47,"value":1629},{"type":41,"tag":118,"props":5283,"children":5284},{"style":131},[5285],{"type":47,"value":134},{"type":41,"tag":118,"props":5287,"children":5288},{"style":137},[5289],{"type":47,"value":5290}," complete",{"type":41,"tag":118,"props":5292,"children":5293},{"style":131},[5294],{"type":47,"value":145},{"type":41,"tag":118,"props":5296,"children":5297},{"style":131},[5298],{"type":47,"value":1664},{"type":41,"tag":118,"props":5300,"children":5301},{"style":228},[5302],{"type":47,"value":5170},{"type":41,"tag":118,"props":5304,"children":5305},{"style":247},[5306],{"type":47,"value":236},{"type":41,"tag":118,"props":5308,"children":5309},{"style":137},[5310],{"type":47,"value":5311},"tokenId",{"type":41,"tag":118,"props":5313,"children":5314},{"style":131},[5315],{"type":47,"value":506},{"type":41,"tag":118,"props":5317,"children":5318},{"style":131},[5319],{"type":47,"value":134},{"type":41,"tag":118,"props":5321,"children":5322},{"style":137},[5323],{"type":47,"value":1590},{"type":41,"tag":118,"props":5325,"children":5326},{"style":131},[5327],{"type":47,"value":145},{"type":41,"tag":118,"props":5329,"children":5330},{"style":247},[5331],{"type":47,"value":418},{"type":41,"tag":118,"props":5333,"children":5334},{"style":131},[5335],{"type":47,"value":171},{"type":41,"tag":118,"props":5337,"children":5338},{"class":120,"line":263},[5339],{"type":41,"tag":118,"props":5340,"children":5341},{"emptyLinePlaceholder":178},[5342],{"type":47,"value":181},{"type":41,"tag":118,"props":5344,"children":5345},{"class":120,"line":280},[5346,5350],{"type":41,"tag":118,"props":5347,"children":5348},{"style":125},[5349],{"type":47,"value":1751},{"type":41,"tag":118,"props":5351,"children":5352},{"style":247},[5353],{"type":47,"value":1756},{"type":41,"tag":118,"props":5355,"children":5356},{"class":120,"line":321},[5357,5361,5365],{"type":41,"tag":118,"props":5358,"children":5359},{"style":131},[5360],{"type":47,"value":1764},{"type":41,"tag":118,"props":5362,"children":5363},{"style":247},[5364],{"type":47,"value":1769},{"type":41,"tag":118,"props":5366,"children":5367},{"style":131},[5368],{"type":47,"value":1774},{"type":41,"tag":118,"props":5370,"children":5371},{"class":120,"line":359},[5372,5376,5380,5385,5389,5393,5397,5401,5405,5409,5413,5417,5421,5425],{"type":41,"tag":118,"props":5373,"children":5374},{"style":131},[5375],{"type":47,"value":1782},{"type":41,"tag":118,"props":5377,"children":5378},{"style":247},[5379],{"type":47,"value":1787},{"type":41,"tag":118,"props":5381,"children":5382},{"style":198},[5383],{"type":47,"value":5384}," onClick",{"type":41,"tag":118,"props":5386,"children":5387},{"style":131},[5388],{"type":47,"value":1805},{"type":41,"tag":118,"props":5390,"children":5391},{"style":198},[5392],{"type":47,"value":1810},{"type":41,"tag":118,"props":5394,"children":5395},{"style":228},[5396],{"type":47,"value":5290},{"type":41,"tag":118,"props":5398,"children":5399},{"style":137},[5400],{"type":47,"value":236},{"type":41,"tag":118,"props":5402,"children":5403},{"style":131},[5404],{"type":47,"value":1823},{"type":41,"tag":118,"props":5406,"children":5407},{"style":247},[5408],{"type":47,"value":4857},{"type":41,"tag":118,"props":5410,"children":5411},{"style":131},[5412],{"type":47,"value":255},{"type":41,"tag":118,"props":5414,"children":5415},{"style":3952},[5416],{"type":47,"value":3955},{"type":41,"tag":118,"props":5418,"children":5419},{"style":131},[5420],{"type":47,"value":145},{"type":41,"tag":118,"props":5422,"children":5423},{"style":137},[5424],{"type":47,"value":418},{"type":41,"tag":118,"props":5426,"children":5427},{"style":131},[5428],{"type":47,"value":5429},"}>\n",{"type":41,"tag":118,"props":5431,"children":5432},{"class":120,"line":368},[5433],{"type":41,"tag":118,"props":5434,"children":5435},{"style":137},[5436],{"type":47,"value":5437},"        Approve\n",{"type":41,"tag":118,"props":5439,"children":5440},{"class":120,"line":377},[5441,5445,5449],{"type":41,"tag":118,"props":5442,"children":5443},{"style":131},[5444],{"type":47,"value":1902},{"type":41,"tag":118,"props":5446,"children":5447},{"style":247},[5448],{"type":47,"value":1787},{"type":41,"tag":118,"props":5450,"children":5451},{"style":131},[5452],{"type":47,"value":1774},{"type":41,"tag":118,"props":5454,"children":5455},{"class":120,"line":407},[5456,5460,5464,5468,5472,5476,5480,5484,5488,5492,5496,5501,5505,5509],{"type":41,"tag":118,"props":5457,"children":5458},{"style":131},[5459],{"type":47,"value":1782},{"type":41,"tag":118,"props":5461,"children":5462},{"style":247},[5463],{"type":47,"value":1787},{"type":41,"tag":118,"props":5465,"children":5466},{"style":198},[5467],{"type":47,"value":5384},{"type":41,"tag":118,"props":5469,"children":5470},{"style":131},[5471],{"type":47,"value":1805},{"type":41,"tag":118,"props":5473,"children":5474},{"style":198},[5475],{"type":47,"value":1810},{"type":41,"tag":118,"props":5477,"children":5478},{"style":228},[5479],{"type":47,"value":5290},{"type":41,"tag":118,"props":5481,"children":5482},{"style":137},[5483],{"type":47,"value":236},{"type":41,"tag":118,"props":5485,"children":5486},{"style":131},[5487],{"type":47,"value":1823},{"type":41,"tag":118,"props":5489,"children":5490},{"style":247},[5491],{"type":47,"value":4857},{"type":41,"tag":118,"props":5493,"children":5494},{"style":131},[5495],{"type":47,"value":255},{"type":41,"tag":118,"props":5497,"children":5498},{"style":3952},[5499],{"type":47,"value":5500}," false",{"type":41,"tag":118,"props":5502,"children":5503},{"style":131},[5504],{"type":47,"value":145},{"type":41,"tag":118,"props":5506,"children":5507},{"style":137},[5508],{"type":47,"value":418},{"type":41,"tag":118,"props":5510,"children":5511},{"style":131},[5512],{"type":47,"value":5429},{"type":41,"tag":118,"props":5514,"children":5515},{"class":120,"line":425},[5516],{"type":41,"tag":118,"props":5517,"children":5518},{"style":137},[5519],{"type":47,"value":5520},"        Reject\n",{"type":41,"tag":118,"props":5522,"children":5523},{"class":120,"line":433},[5524,5528,5532],{"type":41,"tag":118,"props":5525,"children":5526},{"style":131},[5527],{"type":47,"value":1902},{"type":41,"tag":118,"props":5529,"children":5530},{"style":247},[5531],{"type":47,"value":1787},{"type":41,"tag":118,"props":5533,"children":5534},{"style":131},[5535],{"type":47,"value":1774},{"type":41,"tag":118,"props":5537,"children":5538},{"class":120,"line":1069},[5539,5543,5547],{"type":41,"tag":118,"props":5540,"children":5541},{"style":131},[5542],{"type":47,"value":2197},{"type":41,"tag":118,"props":5544,"children":5545},{"style":247},[5546],{"type":47,"value":1769},{"type":41,"tag":118,"props":5548,"children":5549},{"style":131},[5550],{"type":47,"value":1774},{"type":41,"tag":118,"props":5552,"children":5553},{"class":120,"line":1077},[5554,5558],{"type":41,"tag":118,"props":5555,"children":5556},{"style":247},[5557],{"type":47,"value":1732},{"type":41,"tag":118,"props":5559,"children":5560},{"style":131},[5561],{"type":47,"value":171},{"type":41,"tag":118,"props":5563,"children":5564},{"class":120,"line":1086},[5565],{"type":41,"tag":118,"props":5566,"children":5567},{"style":131},[5568],{"type":47,"value":1066},{"type":41,"tag":56,"props":5570,"children":5572},{"id":5571},"run-object-properties",[5573],{"type":47,"value":5574},"Run Object Properties",{"type":41,"tag":5576,"props":5577,"children":5578},"table",{},[5579,5598],{"type":41,"tag":5580,"props":5581,"children":5582},"thead",{},[5583],{"type":41,"tag":5584,"props":5585,"children":5586},"tr",{},[5587,5593],{"type":41,"tag":5588,"props":5589,"children":5590},"th",{},[5591],{"type":47,"value":5592},"Property",{"type":41,"tag":5588,"props":5594,"children":5595},{},[5596],{"type":47,"value":5597},"Description",{"type":41,"tag":5599,"props":5600,"children":5601},"tbody",{},[5602,5619,5667,5683,5699,5715,5732],{"type":41,"tag":5584,"props":5603,"children":5604},{},[5605,5614],{"type":41,"tag":5606,"props":5607,"children":5608},"td",{},[5609],{"type":41,"tag":114,"props":5610,"children":5612},{"className":5611},[],[5613],{"type":47,"value":1196},{"type":41,"tag":5606,"props":5615,"children":5616},{},[5617],{"type":47,"value":5618},"Unique run identifier",{"type":41,"tag":5584,"props":5620,"children":5621},{},[5622,5630],{"type":41,"tag":5606,"props":5623,"children":5624},{},[5625],{"type":41,"tag":114,"props":5626,"children":5628},{"className":5627},[],[5629],{"type":47,"value":840},{"type":41,"tag":5606,"props":5631,"children":5632},{},[5633,5639,5641,5647,5648,5653,5654,5660,5661],{"type":41,"tag":114,"props":5634,"children":5636},{"className":5635},[],[5637],{"type":47,"value":5638},"QUEUED",{"type":47,"value":5640},", ",{"type":41,"tag":114,"props":5642,"children":5644},{"className":5643},[],[5645],{"type":47,"value":5646},"EXECUTING",{"type":47,"value":5640},{"type":41,"tag":114,"props":5649,"children":5651},{"className":5650},[],[5652],{"type":47,"value":966},{"type":47,"value":5640},{"type":41,"tag":114,"props":5655,"children":5657},{"className":5656},[],[5658],{"type":47,"value":5659},"FAILED",{"type":47,"value":5640},{"type":41,"tag":114,"props":5662,"children":5664},{"className":5663},[],[5665],{"type":47,"value":5666},"CANCELED",{"type":41,"tag":5584,"props":5668,"children":5669},{},[5670,5678],{"type":41,"tag":5606,"props":5671,"children":5672},{},[5673],{"type":41,"tag":114,"props":5674,"children":5676},{"className":5675},[],[5677],{"type":47,"value":3733},{"type":41,"tag":5606,"props":5679,"children":5680},{},[5681],{"type":47,"value":5682},"Task input (typed)",{"type":41,"tag":5584,"props":5684,"children":5685},{},[5686,5694],{"type":41,"tag":5606,"props":5687,"children":5688},{},[5689],{"type":41,"tag":114,"props":5690,"children":5692},{"className":5691},[],[5693],{"type":47,"value":1030},{"type":41,"tag":5606,"props":5695,"children":5696},{},[5697],{"type":47,"value":5698},"Task result (typed, when completed)",{"type":41,"tag":5584,"props":5700,"children":5701},{},[5702,5710],{"type":41,"tag":5606,"props":5703,"children":5704},{},[5705],{"type":41,"tag":114,"props":5706,"children":5708},{"className":5707},[],[5709],{"type":47,"value":898},{"type":41,"tag":5606,"props":5711,"children":5712},{},[5713],{"type":47,"value":5714},"Real-time updatable data",{"type":41,"tag":5584,"props":5716,"children":5717},{},[5718,5727],{"type":41,"tag":5606,"props":5719,"children":5720},{},[5721],{"type":41,"tag":114,"props":5722,"children":5724},{"className":5723},[],[5725],{"type":47,"value":5726},"createdAt",{"type":41,"tag":5606,"props":5728,"children":5729},{},[5730],{"type":47,"value":5731},"Start timestamp",{"type":41,"tag":5584,"props":5733,"children":5734},{},[5735,5744],{"type":41,"tag":5606,"props":5736,"children":5737},{},[5738],{"type":41,"tag":114,"props":5739,"children":5741},{"className":5740},[],[5742],{"type":47,"value":5743},"costInCents",{"type":41,"tag":5606,"props":5745,"children":5746},{},[5747],{"type":47,"value":5748},"Execution cost",{"type":41,"tag":56,"props":5750,"children":5752},{"id":5751},"best-practices",[5753],{"type":47,"value":5754},"Best Practices",{"type":41,"tag":5756,"props":5757,"children":5758},"ol",{},[5759,5770,5780,5790,5800],{"type":41,"tag":67,"props":5760,"children":5761},{},[5762,5768],{"type":41,"tag":5763,"props":5764,"children":5765},"strong",{},[5766],{"type":47,"value":5767},"Scope tokens narrowly",{"type":47,"value":5769}," — only grant necessary permissions",{"type":41,"tag":67,"props":5771,"children":5772},{},[5773,5778],{"type":41,"tag":5763,"props":5774,"children":5775},{},[5776],{"type":47,"value":5777},"Set expiration times",{"type":47,"value":5779}," — don't use long-lived tokens",{"type":41,"tag":67,"props":5781,"children":5782},{},[5783,5788],{"type":41,"tag":5763,"props":5784,"children":5785},{},[5786],{"type":47,"value":5787},"Use typed hooks",{"type":47,"value":5789}," — pass task types for proper inference",{"type":41,"tag":67,"props":5791,"children":5792},{},[5793,5798],{"type":41,"tag":5763,"props":5794,"children":5795},{},[5796],{"type":47,"value":5797},"Handle errors",{"type":47,"value":5799}," — always check for errors in hooks",{"type":41,"tag":67,"props":5801,"children":5802},{},[5803,5808,5810,5816],{"type":41,"tag":5763,"props":5804,"children":5805},{},[5806],{"type":47,"value":5807},"Throttle streams",{"type":47,"value":5809}," — use ",{"type":41,"tag":114,"props":5811,"children":5813},{"className":5812},[],[5814],{"type":47,"value":5815},"throttleInMs",{"type":47,"value":5817}," to control re-renders",{"type":41,"tag":50,"props":5819,"children":5820},{},[5821,5823,5829],{"type":47,"value":5822},"See ",{"type":41,"tag":114,"props":5824,"children":5826},{"className":5825},[],[5827],{"type":47,"value":5828},"references\u002Frealtime.md",{"type":47,"value":5830}," for complete documentation.",{"type":41,"tag":5832,"props":5833,"children":5834},"style",{},[5835],{"type":47,"value":5836},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":5838,"total":2178},[5839,5858,5871,5881,5894,5907,5921,5938,5945,5957,5968,5982],{"slug":5840,"name":5840,"fn":5841,"description":5842,"org":5843,"tags":5844,"stars":5855,"repoUrl":5856,"updatedAt":5857},"trigger-authoring-chat-agent","author durable AI chat agents with Trigger.dev","Author and run a durable AI chat agent with chat.agent from @trigger.dev\u002Fsdk\u002Fai: the per-turn run loop, why you MUST spread ...chat.toStreamTextOptions() first, returning a StreamTextResult vs calling chat.pipe(), the two server actions (chat.createStartSessionAction + auth.createPublicToken), and wiring useChat to useTriggerChatTransport. Load this when building, modifying, or debugging a chat backend (the agent task or its lifecycle hooks) or its React transport, when declaring typed tools or custom data parts, or when migrating a plain AI SDK streamText route to chat.agent.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5845,5848,5851,5852],{"name":5846,"slug":5847,"type":16},"Agents","agents",{"name":5849,"slug":5850,"type":16},"SDK","sdk",{"name":9,"slug":8,"type":16},{"name":5853,"slug":5854,"type":16},"Workflow Automation","workflow-automation",14401,"https:\u002F\u002Fgithub.com\u002Ftriggerdotdev\u002Ftrigger.dev","2026-07-02T17:12:52.307135",{"slug":5859,"name":5859,"fn":5860,"description":5861,"org":5862,"tags":5863,"stars":5855,"repoUrl":5856,"updatedAt":5870},"trigger-authoring-tasks","author backend Trigger.dev tasks","Covers writing backend Trigger.dev tasks with @trigger.dev\u002Fsdk: defining task() and schemaTask(), the run function and its ctx, retries, waits, queues and concurrency, idempotency keys, run metadata, logging, triggering other tasks (and the Result shape), scheduled\u002Fcron tasks, and the essentials of trigger.config.ts. Load this whenever you are authoring or editing code inside a \u002Ftrigger directory, defining a task, or writing backend code that triggers tasks. Realtime\u002FReact hooks and AI chat are covered by separate skills.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5864,5867,5868,5869],{"name":5865,"slug":5866,"type":16},"Backend","backend",{"name":5849,"slug":5850,"type":16},{"name":9,"slug":8,"type":16},{"name":5853,"slug":5854,"type":16},"2026-07-02T17:12:48.396964",{"slug":5872,"name":5872,"fn":5873,"description":5874,"org":5875,"tags":5876,"stars":5855,"repoUrl":5856,"updatedAt":5880},"trigger-chat-agent-advanced","manage Trigger.dev chat sessions and transports","Advanced and operational chat.agent capabilities for Trigger.dev, loaded on demand. Load this when working on the raw Sessions primitive (sessions \u002F SessionHandle), a custom chat transport or the realtime wire protocol, durable sub-agents (AgentChat, chat.stream.writer), human-in-the-loop, steering, actions, background injection (chat.defer \u002F chat.inject), fast starts (preload, Head Start via @trigger.dev\u002Fsdk\u002Fchat-server), context resilience (compaction, recovery boot, OOM, large payloads), chat.local run-scoped state, offline testing with mockChatAgent, or prerelease\u002Fversion upgrades. For the everyday chat.agent({...}) definition and the useTriggerChatTransport happy path, use the trigger-authoring-chat-agent skill instead.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5877,5878,5879],{"name":5846,"slug":5847,"type":16},{"name":9,"slug":8,"type":16},{"name":5853,"slug":5854,"type":16},"2026-07-02T17:12:51.03018",{"slug":5882,"name":5882,"fn":5883,"description":5884,"org":5885,"tags":5886,"stars":5855,"repoUrl":5856,"updatedAt":5893},"trigger-realtime-and-frontend","subscribe to Trigger.dev runs in realtime","Trigger.dev client\u002Ffrontend surface: subscribe to runs in realtime (runs.subscribeToRun and the @trigger.dev\u002Freact-hooks hook useRealtimeRun), consume metadata and AI\u002Ftext streams in React (useRealtimeStream), trigger tasks from the browser (useTaskTrigger, useRealtimeTaskTrigger), and mint scoped frontend credentials with auth.createPublicToken \u002F auth.createTriggerPublicToken. Load when wiring a frontend (React\u002FNext.js\u002FRemix) or backend-for-frontend to show live run progress, status badges, token streams, trigger buttons, or wait-token approval UIs. NOT for writing the backend task itself (streams.define \u002F metadata.set is trigger-authoring-tasks territory); this is the consumer side.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5887,5888,5891,5892],{"name":22,"slug":23,"type":16},{"name":5889,"slug":5890,"type":16},"React","react",{"name":19,"slug":20,"type":16},{"name":9,"slug":8,"type":16},"2026-07-02T17:12:49.717706",{"slug":5895,"name":5895,"fn":5896,"description":5897,"org":5898,"tags":5899,"stars":24,"repoUrl":25,"updatedAt":5906},"trigger-agents","orchestrate AI agents with Trigger.dev","AI agent patterns with Trigger.dev - orchestration, parallelization, routing, evaluator-optimizer, and human-in-the-loop. Use when building LLM-powered tasks that need parallel workers, approval gates, tool calling, or multi-step agent workflows.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5900,5901,5904,5905],{"name":5846,"slug":5847,"type":16},{"name":5902,"slug":5903,"type":16},"Multi-Agent","multi-agent",{"name":9,"slug":8,"type":16},{"name":5853,"slug":5854,"type":16},"2026-04-06T18:54:46.023553",{"slug":5908,"name":5908,"fn":5909,"description":5910,"org":5911,"tags":5912,"stars":24,"repoUrl":25,"updatedAt":5920},"trigger-config","configure Trigger.dev project settings","Configure Trigger.dev projects with trigger.config.ts. Use when setting up build extensions for Prisma, Playwright, FFmpeg, Python, or customizing deployment settings.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5913,5916,5919],{"name":5914,"slug":5915,"type":16},"Configuration","configuration",{"name":5917,"slug":5918,"type":16},"Deployment","deployment",{"name":9,"slug":8,"type":16},"2026-04-06T18:54:44.764258",{"slug":5922,"name":5922,"fn":5923,"description":5924,"org":5925,"tags":5926,"stars":24,"repoUrl":25,"updatedAt":5937},"trigger-cost-savings","optimize Trigger.dev task costs","Analyze Trigger.dev tasks, schedules, and runs for cost optimization opportunities. Use when asked to reduce spend, optimize costs, audit usage, right-size machines, or review task efficiency. Requires Trigger.dev MCP tools for run analysis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5927,5930,5933,5936],{"name":5928,"slug":5929,"type":16},"Analytics","analytics",{"name":5931,"slug":5932,"type":16},"Cost Optimization","cost-optimization",{"name":5934,"slug":5935,"type":16},"Operations","operations",{"name":9,"slug":8,"type":16},"2026-04-06T18:54:48.555552",{"slug":4,"name":4,"fn":5,"description":6,"org":5939,"tags":5940,"stars":24,"repoUrl":25,"updatedAt":26},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5941,5942,5943,5944],{"name":22,"slug":23,"type":16},{"name":14,"slug":15,"type":16},{"name":19,"slug":20,"type":16},{"name":9,"slug":8,"type":16},{"slug":5946,"name":5946,"fn":5947,"description":5948,"org":5949,"tags":5950,"stars":24,"repoUrl":25,"updatedAt":5956},"trigger-setup","set up Trigger.dev in projects","Set up Trigger.dev in your project. Use when adding Trigger.dev for the first time, creating trigger.config.ts, or initializing the trigger directory.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5951,5952,5955],{"name":5914,"slug":5915,"type":16},{"name":5953,"slug":5954,"type":16},"Local Development","local-development",{"name":9,"slug":8,"type":16},"2026-04-06T18:54:42.280816",{"slug":5958,"name":5958,"fn":5959,"description":5960,"org":5961,"tags":5962,"stars":24,"repoUrl":25,"updatedAt":5967},"trigger-tasks","build durable background tasks with Trigger.dev","Build AI agents, workflows and durable background tasks with Trigger.dev. Use when creating tasks, triggering jobs, handling retries, scheduling cron jobs, or implementing queues and concurrency control.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5963,5964,5965,5966],{"name":5846,"slug":5847,"type":16},{"name":5865,"slug":5866,"type":16},{"name":9,"slug":8,"type":16},{"name":5853,"slug":5854,"type":16},"2026-04-06T18:54:43.514369",{"slug":5969,"name":5969,"fn":5970,"description":5971,"org":5972,"tags":5973,"stars":184,"repoUrl":5980,"updatedAt":5981},"staff-engineering-skills-backpressure","implement backpressure in streaming pipelines","Prevent unbounded resource growth when producers outpace consumers. Use when writing producer-consumer code, queue processing, batch operations, fan-out patterns, streaming pipelines, or any code where work is generated faster than it can be processed. Activates on patterns like Promise.all on dynamic-sized arrays, unbounded in-memory queues, producer loops without depth checks, fire-and-forget async calls in loops, or any buffer between a producer and consumer without a size limit.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5974,5977],{"name":5975,"slug":5976,"type":16},"Architecture","architecture",{"name":5978,"slug":5979,"type":16},"Performance","performance","https:\u002F\u002Fgithub.com\u002Ftriggerdotdev\u002Fstaff-engineering-skills","2026-06-17T08:40:42.723559",{"slug":5983,"name":5983,"fn":5984,"description":5985,"org":5986,"tags":5987,"stars":184,"repoUrl":5980,"updatedAt":5996},"staff-engineering-skills-cache-invalidation","implement cache invalidation strategies","Prevent stale data bugs caused by missing or incomplete cache invalidation. Use when adding caching layers (Redis, in-memory Map, CDN, HTTP cache headers), optimizing read performance, or reviewing code that caches query results, API responses, or computed values. Activates on patterns like cache.set without cache.delete on write paths, unbounded Map\u002Fobject caches, TTL-only invalidation on security-sensitive data, Cache-Control headers on mutable content, or any caching where the write path doesn't invalidate the read cache.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5988,5989,5992,5995],{"name":5975,"slug":5976,"type":16},{"name":5990,"slug":5991,"type":16},"Caching","caching",{"name":5993,"slug":5994,"type":16},"Engineering","engineering",{"name":5978,"slug":5979,"type":16},"2026-06-17T08:40:45.194583",{"items":5998,"total":263},[5999,6006,6012,6019,6026,6032],{"slug":5895,"name":5895,"fn":5896,"description":5897,"org":6000,"tags":6001,"stars":24,"repoUrl":25,"updatedAt":5906},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[6002,6003,6004,6005],{"name":5846,"slug":5847,"type":16},{"name":5902,"slug":5903,"type":16},{"name":9,"slug":8,"type":16},{"name":5853,"slug":5854,"type":16},{"slug":5908,"name":5908,"fn":5909,"description":5910,"org":6007,"tags":6008,"stars":24,"repoUrl":25,"updatedAt":5920},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[6009,6010,6011],{"name":5914,"slug":5915,"type":16},{"name":5917,"slug":5918,"type":16},{"name":9,"slug":8,"type":16},{"slug":5922,"name":5922,"fn":5923,"description":5924,"org":6013,"tags":6014,"stars":24,"repoUrl":25,"updatedAt":5937},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[6015,6016,6017,6018],{"name":5928,"slug":5929,"type":16},{"name":5931,"slug":5932,"type":16},{"name":5934,"slug":5935,"type":16},{"name":9,"slug":8,"type":16},{"slug":4,"name":4,"fn":5,"description":6,"org":6020,"tags":6021,"stars":24,"repoUrl":25,"updatedAt":26},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[6022,6023,6024,6025],{"name":22,"slug":23,"type":16},{"name":14,"slug":15,"type":16},{"name":19,"slug":20,"type":16},{"name":9,"slug":8,"type":16},{"slug":5946,"name":5946,"fn":5947,"description":5948,"org":6027,"tags":6028,"stars":24,"repoUrl":25,"updatedAt":5956},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[6029,6030,6031],{"name":5914,"slug":5915,"type":16},{"name":5953,"slug":5954,"type":16},{"name":9,"slug":8,"type":16},{"slug":5958,"name":5958,"fn":5959,"description":5960,"org":6033,"tags":6034,"stars":24,"repoUrl":25,"updatedAt":5967},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[6035,6036,6037,6038],{"name":5846,"slug":5847,"type":16},{"name":5865,"slug":5866,"type":16},{"name":9,"slug":8,"type":16},{"name":5853,"slug":5854,"type":16}]