[{"data":1,"prerenderedAt":1546},["ShallowReactive",2],{"navigation_docs":3,"-examples-chat-sdk-issue-triage-bot":125,"-examples-chat-sdk-issue-triage-bot-surround":1541},[4,26,49,81,105,117],{"title":5,"path":6,"stem":7,"children":8,"page":25},"Getting Started","\u002Fgetting-started","docs",[9,13,17,21],{"title":10,"path":11,"stem":12},"Introduction","\u002Fgetting-started\u002Fintroduction","docs\u002F1.getting-started\u002F1.introduction",{"title":14,"path":15,"stem":16},"Installation","\u002Fgetting-started\u002Finstallation","docs\u002F1.getting-started\u002F2.installation",{"title":18,"path":19,"stem":20},"Quick Start","\u002Fgetting-started\u002Fquick-start","docs\u002F1.getting-started\u002F3.quick-start",{"title":22,"path":23,"stem":24},"Agent Skills","\u002Fgetting-started\u002Fagent-skills","docs\u002F1.getting-started\u002F4.agent-skills",false,{"title":27,"path":28,"stem":7,"children":29,"page":25},"Frameworks","\u002Fframeworks",[30,35,40,44],{"title":31,"path":32,"stem":33,"icon":34},"eve extension","\u002Fframeworks\u002Feve-extension","docs\u002F2.frameworks\u002F1.eve-extension","i-custom:eve",{"title":36,"path":37,"stem":38,"icon":39},"AI SDK","\u002Fframeworks\u002Fai-sdk","docs\u002F2.frameworks\u002F2.ai-sdk","i-simple-icons-vercel",{"title":41,"path":42,"stem":43,"icon":39},"Vercel Workflow","\u002Fframeworks\u002Fvercel-workflow","docs\u002F2.frameworks\u002F3.vercel-workflow",{"title":45,"path":46,"stem":47,"icon":48},"Chat SDK","\u002Fframeworks\u002Fchat-sdk","docs\u002F2.frameworks\u002F4.chat-sdk","i-lucide-message-square",{"title":50,"path":51,"stem":7,"children":52,"page":25},"Examples","\u002Fexamples",[53,57,61,65,69,73,77],{"title":54,"path":55,"stem":56},"Overview","\u002Fexamples\u002Foverview","docs\u002F3.examples\u002F1.overview",{"title":58,"path":59,"stem":60,"icon":34},"Stale issue triager","\u002Fexamples\u002Feve-stale-issue-triager","docs\u002F3.examples\u002F2.eve-stale-issue-triager",{"title":62,"path":63,"stem":64,"icon":39},"Release notes generator","\u002Fexamples\u002Fai-sdk-release-notes-generator","docs\u002F3.examples\u002F3.ai-sdk-release-notes-generator",{"title":66,"path":67,"stem":68,"icon":39},"CI failure bot","\u002Fexamples\u002Fvercel-workflow-ci-failure-bot","docs\u002F3.examples\u002F4.vercel-workflow-ci-failure-bot",{"title":70,"path":71,"stem":72,"icon":48},"Issue triage bot","\u002Fexamples\u002Fchat-sdk-issue-triage-bot","docs\u002F3.examples\u002F5.chat-sdk-issue-triage-bot",{"title":74,"path":75,"stem":76,"icon":34},"Manager & sub-agents","\u002Fexamples\u002Fmanager-agent-with-subagents","docs\u002F3.examples\u002F6.manager-agent-with-subagents",{"title":78,"path":79,"stem":80},"Recipes","\u002Fexamples\u002Frecipes","docs\u002F3.examples\u002F7.recipes",{"title":82,"path":83,"stem":7,"children":84,"page":25},"Guide","\u002Fguide",[85,89,93,97,101],{"title":86,"path":87,"stem":88},"Scope with Presets","\u002Fguide\u002Fpresets","docs\u002F4.guide\u002F1.presets",{"title":90,"path":91,"stem":92},"Control Write Safety","\u002Fguide\u002Fapproval-control","docs\u002F4.guide\u002F2.approval-control",{"title":94,"path":95,"stem":96},"Commit Attribution","\u002Fguide\u002Fcommit-attribution","docs\u002F4.guide\u002F3.commit-attribution",{"title":98,"path":99,"stem":100},"Tokens & Auth","\u002Fguide\u002Ftokens-and-auth","docs\u002F4.guide\u002F4.tokens-and-auth",{"title":102,"path":103,"stem":104},"Vercel Connect","\u002Fguide\u002Fvercel-connect","docs\u002F4.guide\u002F5.vercel-connect",{"title":106,"path":107,"stem":7,"children":108,"page":25},"Api","\u002Fapi",[109,113],{"title":110,"path":111,"stem":112},"Tools Catalog","\u002Fapi\u002Ftools-catalog","docs\u002F5.api\u002F1.tools-catalog",{"title":114,"path":115,"stem":116},"API Reference","\u002Fapi\u002Freference","docs\u002F5.api\u002F2.reference",{"title":118,"path":119,"stem":7,"children":120,"page":25},"Deprecated","\u002Fdeprecated",[121],{"title":122,"path":123,"stem":124,"icon":34},"eve (direct import)","\u002Fdeprecated\u002Feve","docs\u002F6.deprecated\u002F1.eve",{"id":126,"title":127,"body":128,"description":1524,"extension":1525,"links":1526,"meta":1536,"navigation":1537,"path":71,"seo":1538,"stem":72,"__hash__":1540},"docs\u002Fdocs\u002F3.examples\u002F5.chat-sdk-issue-triage-bot.md","Example: an issue triage bot with Chat SDK",{"type":129,"value":130,"toc":1513},"minimark",[131,163,170,175,614,939,1167,1229,1233,1358,1362,1436,1448,1452,1464,1475,1479,1509],[132,133,136,140],"prompt",{":actions":134,"description":135,"icon":48},"[\"copy\",\"cursor\",\"windsurf\"]","Build an issue triage bot with Chat SDK",[137,138,139],"p",{},"Build a durable GitHub issue triage bot with @github-tools\u002Fsdk, Chat SDK, and Vercel Workflow.",[141,142,143,147,150,153],"ul",{},[144,145,146],"li",{},"Install chat, @chat-adapter\u002Fgithub, @chat-adapter\u002Fstate-memory, workflow, plus @github-tools\u002Fsdk, @vercel\u002Fconnect, ai, zod",[144,148,149],{},"Create a Chat agent with createGitHubAdapter, onNewMention starting a \"use workflow\" triage workflow",[144,151,152],{},"Run the agent turn with createGithubAgent({ preset: 'issue-triage' }) inside a \"use step\" function, token from connectGithubToken",[144,154,155,156,162],{},"Use ",[157,158,159],"a",{"href":159,"rel":160},"https:\u002F\u002Fgithub.com\u002Fvercel-labs\u002Fgithub-tools\u002Ftree\u002Fmain\u002Fexamples\u002Fpr-review-agent",[161],"nofollow"," as the reference project layout",[137,164,165,166,169],{},"@mention the bot on an issue and it classifies it (bug, feature, or question), applies a matching label, and posts a short triage note. Same shape as the ",[157,167,168],{"href":46},"PR review bot"," example, different preset and a different job.",[171,172,174],"h2",{"id":173},"files","Files",[176,177,183],"pre",{"className":178,"code":179,"filename":180,"language":181,"meta":182,"style":182},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { Chat, emoji, type Message, type Thread } from 'chat'\nimport { createGitHubAdapter } from '@chat-adapter\u002Fgithub'\nimport { createMemoryState } from '@chat-adapter\u002Fstate-memory'\nimport { start } from 'workflow\u002Fapi'\nimport { triageWorkflow } from '..\u002Fworkflows\u002Ftriage'\n\nconst adapters = { github: createGitHubAdapter() }\n\nexport const agent = new Chat\u003Ctypeof adapters>({\n  userName: process.env.GITHUB_AGENT_USERNAME || 'triage-bot',\n  adapters,\n  state: createMemoryState(),\n}).registerSingleton()\n\nagent.onNewMention(async (thread: Thread, message: Message) => {\n  const sent = thread.createSentMessageFromMessage(message)\n  await sent.addReaction(emoji.eyes)\n  await start(triageWorkflow, [message.text])\n})\n","server\u002Flib\u002Fagent.ts","ts","",[184,185,186,240,261,282,303,324,331,362,367,401,437,445,460,477,482,527,555,580,607],"code",{"__ignoreMap":182},[187,188,191,195,199,203,206,209,211,214,217,219,221,224,227,230,233,237],"span",{"class":189,"line":190},"line",1,[187,192,194],{"class":193},"s7zQu","import",[187,196,198],{"class":197},"sMK4o"," {",[187,200,202],{"class":201},"sTEyZ"," Chat",[187,204,205],{"class":197},",",[187,207,208],{"class":201}," emoji",[187,210,205],{"class":197},[187,212,213],{"class":193}," type",[187,215,216],{"class":201}," Message",[187,218,205],{"class":197},[187,220,213],{"class":193},[187,222,223],{"class":201}," Thread",[187,225,226],{"class":197}," }",[187,228,229],{"class":193}," from",[187,231,232],{"class":197}," '",[187,234,236],{"class":235},"sfazB","chat",[187,238,239],{"class":197},"'\n",[187,241,243,245,247,250,252,254,256,259],{"class":189,"line":242},2,[187,244,194],{"class":193},[187,246,198],{"class":197},[187,248,249],{"class":201}," createGitHubAdapter",[187,251,226],{"class":197},[187,253,229],{"class":193},[187,255,232],{"class":197},[187,257,258],{"class":235},"@chat-adapter\u002Fgithub",[187,260,239],{"class":197},[187,262,264,266,268,271,273,275,277,280],{"class":189,"line":263},3,[187,265,194],{"class":193},[187,267,198],{"class":197},[187,269,270],{"class":201}," createMemoryState",[187,272,226],{"class":197},[187,274,229],{"class":193},[187,276,232],{"class":197},[187,278,279],{"class":235},"@chat-adapter\u002Fstate-memory",[187,281,239],{"class":197},[187,283,285,287,289,292,294,296,298,301],{"class":189,"line":284},4,[187,286,194],{"class":193},[187,288,198],{"class":197},[187,290,291],{"class":201}," start",[187,293,226],{"class":197},[187,295,229],{"class":193},[187,297,232],{"class":197},[187,299,300],{"class":235},"workflow\u002Fapi",[187,302,239],{"class":197},[187,304,306,308,310,313,315,317,319,322],{"class":189,"line":305},5,[187,307,194],{"class":193},[187,309,198],{"class":197},[187,311,312],{"class":201}," triageWorkflow",[187,314,226],{"class":197},[187,316,229],{"class":193},[187,318,232],{"class":197},[187,320,321],{"class":235},"..\u002Fworkflows\u002Ftriage",[187,323,239],{"class":197},[187,325,327],{"class":189,"line":326},6,[187,328,330],{"emptyLinePlaceholder":329},true,"\n",[187,332,334,338,341,344,346,350,353,356,359],{"class":189,"line":333},7,[187,335,337],{"class":336},"spNyl","const",[187,339,340],{"class":201}," adapters ",[187,342,343],{"class":197},"=",[187,345,198],{"class":197},[187,347,349],{"class":348},"swJcz"," github",[187,351,352],{"class":197},":",[187,354,249],{"class":355},"s2Zo4",[187,357,358],{"class":201},"() ",[187,360,361],{"class":197},"}\n",[187,363,365],{"class":189,"line":364},8,[187,366,330],{"emptyLinePlaceholder":329},[187,368,370,373,376,379,381,384,386,389,392,395,398],{"class":189,"line":369},9,[187,371,372],{"class":193},"export",[187,374,375],{"class":336}," const",[187,377,378],{"class":201}," agent ",[187,380,343],{"class":197},[187,382,383],{"class":197}," new",[187,385,202],{"class":355},[187,387,388],{"class":197},"\u003Ctypeof",[187,390,391],{"class":201}," adapters",[187,393,394],{"class":197},">",[187,396,397],{"class":201},"(",[187,399,400],{"class":197},"{\n",[187,402,404,407,409,412,415,418,420,423,426,428,431,434],{"class":189,"line":403},10,[187,405,406],{"class":348},"  userName",[187,408,352],{"class":197},[187,410,411],{"class":201}," process",[187,413,414],{"class":197},".",[187,416,417],{"class":201},"env",[187,419,414],{"class":197},[187,421,422],{"class":201},"GITHUB_AGENT_USERNAME ",[187,424,425],{"class":197},"||",[187,427,232],{"class":197},[187,429,430],{"class":235},"triage-bot",[187,432,433],{"class":197},"'",[187,435,436],{"class":197},",\n",[187,438,440,443],{"class":189,"line":439},11,[187,441,442],{"class":201},"  adapters",[187,444,436],{"class":197},[187,446,448,451,453,455,458],{"class":189,"line":447},12,[187,449,450],{"class":348},"  state",[187,452,352],{"class":197},[187,454,270],{"class":355},[187,456,457],{"class":201},"()",[187,459,436],{"class":197},[187,461,463,466,469,471,474],{"class":189,"line":462},13,[187,464,465],{"class":197},"}",[187,467,468],{"class":201},")",[187,470,414],{"class":197},[187,472,473],{"class":355},"registerSingleton",[187,475,476],{"class":201},"()\n",[187,478,480],{"class":189,"line":479},14,[187,481,330],{"emptyLinePlaceholder":329},[187,483,485,488,490,493,495,498,501,505,507,510,512,515,517,519,521,524],{"class":189,"line":484},15,[187,486,487],{"class":201},"agent",[187,489,414],{"class":197},[187,491,492],{"class":355},"onNewMention",[187,494,397],{"class":201},[187,496,497],{"class":336},"async",[187,499,500],{"class":197}," (",[187,502,504],{"class":503},"sHdIc","thread",[187,506,352],{"class":197},[187,508,223],{"class":509},"sBMFI",[187,511,205],{"class":197},[187,513,514],{"class":503}," message",[187,516,352],{"class":197},[187,518,216],{"class":509},[187,520,468],{"class":197},[187,522,523],{"class":336}," =>",[187,525,526],{"class":197}," {\n",[187,528,530,533,536,539,542,544,547,549,552],{"class":189,"line":529},16,[187,531,532],{"class":336},"  const",[187,534,535],{"class":201}," sent",[187,537,538],{"class":197}," =",[187,540,541],{"class":201}," thread",[187,543,414],{"class":197},[187,545,546],{"class":355},"createSentMessageFromMessage",[187,548,397],{"class":348},[187,550,551],{"class":201},"message",[187,553,554],{"class":348},")\n",[187,556,558,561,563,565,568,570,573,575,578],{"class":189,"line":557},17,[187,559,560],{"class":193},"  await",[187,562,535],{"class":201},[187,564,414],{"class":197},[187,566,567],{"class":355},"addReaction",[187,569,397],{"class":348},[187,571,572],{"class":201},"emoji",[187,574,414],{"class":197},[187,576,577],{"class":201},"eyes",[187,579,554],{"class":348},[187,581,583,585,587,589,592,594,597,599,601,604],{"class":189,"line":582},18,[187,584,560],{"class":193},[187,586,291],{"class":355},[187,588,397],{"class":348},[187,590,591],{"class":201},"triageWorkflow",[187,593,205],{"class":197},[187,595,596],{"class":348}," [",[187,598,551],{"class":201},[187,600,414],{"class":197},[187,602,603],{"class":201},"text",[187,605,606],{"class":348},"])\n",[187,608,610,612],{"class":189,"line":609},19,[187,611,465],{"class":197},[187,613,554],{"class":201},[176,615,618],{"className":178,"code":616,"filename":617,"language":181,"meta":182,"style":182},"import { createGithubAgent } from '@github-tools\u002Fsdk'\nimport { connectGithubToken } from '@github-tools\u002Fsdk\u002Fconnect'\n\nasync function runTriageTurn(prompt: string) {\n  'use step'\n  const agent = createGithubAgent({\n    model: 'anthropic\u002Fclaude-sonnet-4.6',\n    token: connectGithubToken('github\u002Fmy-connector', { preset: 'issue-triage' }),\n    preset: 'issue-triage',\n    requireApproval: false,\n    additionalInstructions: `\n      Classify the issue as bug, feature, or question.\n      Apply the matching label with addLabels, then post one comment with the\n      classification and a one-line suggested next step. Do not close anything.\n    `,\n  })\n  const { text } = await agent.generate({ prompt })\n  return text\n}\n\nexport async function triageWorkflow(prompt: string) {\n  'use workflow'\n  await runTriageTurn(prompt)\n}\n","server\u002Fworkflows\u002Ftriage.ts",[184,619,620,640,660,664,687,697,712,728,768,783,796,806,811,816,821,828,835,870,878,882,887,911,921,934],{"__ignoreMap":182},[187,621,622,624,626,629,631,633,635,638],{"class":189,"line":190},[187,623,194],{"class":193},[187,625,198],{"class":197},[187,627,628],{"class":201}," createGithubAgent",[187,630,226],{"class":197},[187,632,229],{"class":193},[187,634,232],{"class":197},[187,636,637],{"class":235},"@github-tools\u002Fsdk",[187,639,239],{"class":197},[187,641,642,644,646,649,651,653,655,658],{"class":189,"line":242},[187,643,194],{"class":193},[187,645,198],{"class":197},[187,647,648],{"class":201}," connectGithubToken",[187,650,226],{"class":197},[187,652,229],{"class":193},[187,654,232],{"class":197},[187,656,657],{"class":235},"@github-tools\u002Fsdk\u002Fconnect",[187,659,239],{"class":197},[187,661,662],{"class":189,"line":263},[187,663,330],{"emptyLinePlaceholder":329},[187,665,666,668,671,674,676,678,680,683,685],{"class":189,"line":284},[187,667,497],{"class":336},[187,669,670],{"class":336}," function",[187,672,673],{"class":355}," runTriageTurn",[187,675,397],{"class":197},[187,677,132],{"class":503},[187,679,352],{"class":197},[187,681,682],{"class":509}," string",[187,684,468],{"class":197},[187,686,526],{"class":197},[187,688,689,692,695],{"class":189,"line":305},[187,690,691],{"class":197},"  '",[187,693,694],{"class":235},"use step",[187,696,239],{"class":197},[187,698,699,701,704,706,708,710],{"class":189,"line":326},[187,700,532],{"class":336},[187,702,703],{"class":201}," agent",[187,705,538],{"class":197},[187,707,628],{"class":355},[187,709,397],{"class":348},[187,711,400],{"class":197},[187,713,714,717,719,721,724,726],{"class":189,"line":333},[187,715,716],{"class":348},"    model",[187,718,352],{"class":197},[187,720,232],{"class":197},[187,722,723],{"class":235},"anthropic\u002Fclaude-sonnet-4.6",[187,725,433],{"class":197},[187,727,436],{"class":197},[187,729,730,733,735,737,739,741,744,746,748,750,753,755,757,760,762,764,766],{"class":189,"line":364},[187,731,732],{"class":348},"    token",[187,734,352],{"class":197},[187,736,648],{"class":355},[187,738,397],{"class":348},[187,740,433],{"class":197},[187,742,743],{"class":235},"github\u002Fmy-connector",[187,745,433],{"class":197},[187,747,205],{"class":197},[187,749,198],{"class":197},[187,751,752],{"class":348}," preset",[187,754,352],{"class":197},[187,756,232],{"class":197},[187,758,759],{"class":235},"issue-triage",[187,761,433],{"class":197},[187,763,226],{"class":197},[187,765,468],{"class":348},[187,767,436],{"class":197},[187,769,770,773,775,777,779,781],{"class":189,"line":369},[187,771,772],{"class":348},"    preset",[187,774,352],{"class":197},[187,776,232],{"class":197},[187,778,759],{"class":235},[187,780,433],{"class":197},[187,782,436],{"class":197},[187,784,785,788,790,794],{"class":189,"line":403},[187,786,787],{"class":348},"    requireApproval",[187,789,352],{"class":197},[187,791,793],{"class":792},"sfNiH"," false",[187,795,436],{"class":197},[187,797,798,801,803],{"class":189,"line":439},[187,799,800],{"class":348},"    additionalInstructions",[187,802,352],{"class":197},[187,804,805],{"class":197}," `\n",[187,807,808],{"class":189,"line":447},[187,809,810],{"class":235},"      Classify the issue as bug, feature, or question.\n",[187,812,813],{"class":189,"line":462},[187,814,815],{"class":235},"      Apply the matching label with addLabels, then post one comment with the\n",[187,817,818],{"class":189,"line":479},[187,819,820],{"class":235},"      classification and a one-line suggested next step. Do not close anything.\n",[187,822,823,826],{"class":189,"line":484},[187,824,825],{"class":197},"    `",[187,827,436],{"class":197},[187,829,830,833],{"class":189,"line":529},[187,831,832],{"class":197},"  }",[187,834,554],{"class":348},[187,836,837,839,841,844,846,848,851,853,855,858,860,863,866,868],{"class":189,"line":557},[187,838,532],{"class":336},[187,840,198],{"class":197},[187,842,843],{"class":201}," text",[187,845,226],{"class":197},[187,847,538],{"class":197},[187,849,850],{"class":193}," await",[187,852,703],{"class":201},[187,854,414],{"class":197},[187,856,857],{"class":355},"generate",[187,859,397],{"class":348},[187,861,862],{"class":197},"{",[187,864,865],{"class":201}," prompt",[187,867,226],{"class":197},[187,869,554],{"class":348},[187,871,872,875],{"class":189,"line":582},[187,873,874],{"class":193},"  return",[187,876,877],{"class":201}," text\n",[187,879,880],{"class":189,"line":609},[187,881,361],{"class":197},[187,883,885],{"class":189,"line":884},20,[187,886,330],{"emptyLinePlaceholder":329},[187,888,890,892,895,897,899,901,903,905,907,909],{"class":189,"line":889},21,[187,891,372],{"class":193},[187,893,894],{"class":336}," async",[187,896,670],{"class":336},[187,898,312],{"class":355},[187,900,397],{"class":197},[187,902,132],{"class":503},[187,904,352],{"class":197},[187,906,682],{"class":509},[187,908,468],{"class":197},[187,910,526],{"class":197},[187,912,914,916,919],{"class":189,"line":913},22,[187,915,691],{"class":197},[187,917,918],{"class":235},"use workflow",[187,920,239],{"class":197},[187,922,924,926,928,930,932],{"class":189,"line":923},23,[187,925,560],{"class":193},[187,927,673],{"class":355},[187,929,397],{"class":348},[187,931,132],{"class":201},[187,933,554],{"class":348},[187,935,937],{"class":189,"line":936},24,[187,938,361],{"class":197},[176,940,943],{"className":178,"code":941,"filename":942,"language":181,"meta":182,"style":182},"import { defineHandler } from 'nitro\u002Fh3'\nimport { agent } from '..\u002F..\u002Flib\u002Fagent'\n\nexport default defineHandler(async (event) => {\n  const handler = agent.webhooks.github\n  if (!handler) {\n    return new Response('GitHub adapter not configured', { status: 404 })\n  }\n  return handler(event.req, {\n    waitUntil: (task: Promise\u003Cunknown>) => event.waitUntil(task),\n  })\n})\n","server\u002Froutes\u002Fwebhooks\u002Fgithub.post.ts",[184,944,945,965,984,988,1012,1033,1051,1087,1092,1111,1155,1161],{"__ignoreMap":182},[187,946,947,949,951,954,956,958,960,963],{"class":189,"line":190},[187,948,194],{"class":193},[187,950,198],{"class":197},[187,952,953],{"class":201}," defineHandler",[187,955,226],{"class":197},[187,957,229],{"class":193},[187,959,232],{"class":197},[187,961,962],{"class":235},"nitro\u002Fh3",[187,964,239],{"class":197},[187,966,967,969,971,973,975,977,979,982],{"class":189,"line":242},[187,968,194],{"class":193},[187,970,198],{"class":197},[187,972,703],{"class":201},[187,974,226],{"class":197},[187,976,229],{"class":193},[187,978,232],{"class":197},[187,980,981],{"class":235},"..\u002F..\u002Flib\u002Fagent",[187,983,239],{"class":197},[187,985,986],{"class":189,"line":263},[187,987,330],{"emptyLinePlaceholder":329},[187,989,990,992,995,997,999,1001,1003,1006,1008,1010],{"class":189,"line":284},[187,991,372],{"class":193},[187,993,994],{"class":193}," default",[187,996,953],{"class":355},[187,998,397],{"class":201},[187,1000,497],{"class":336},[187,1002,500],{"class":197},[187,1004,1005],{"class":503},"event",[187,1007,468],{"class":197},[187,1009,523],{"class":336},[187,1011,526],{"class":197},[187,1013,1014,1016,1019,1021,1023,1025,1028,1030],{"class":189,"line":305},[187,1015,532],{"class":336},[187,1017,1018],{"class":201}," handler",[187,1020,538],{"class":197},[187,1022,703],{"class":201},[187,1024,414],{"class":197},[187,1026,1027],{"class":201},"webhooks",[187,1029,414],{"class":197},[187,1031,1032],{"class":201},"github\n",[187,1034,1035,1038,1040,1043,1046,1049],{"class":189,"line":326},[187,1036,1037],{"class":193},"  if",[187,1039,500],{"class":348},[187,1041,1042],{"class":197},"!",[187,1044,1045],{"class":201},"handler",[187,1047,1048],{"class":348},") ",[187,1050,400],{"class":197},[187,1052,1053,1056,1058,1061,1063,1065,1068,1070,1072,1074,1077,1079,1083,1085],{"class":189,"line":333},[187,1054,1055],{"class":193},"    return",[187,1057,383],{"class":197},[187,1059,1060],{"class":355}," Response",[187,1062,397],{"class":348},[187,1064,433],{"class":197},[187,1066,1067],{"class":235},"GitHub adapter not configured",[187,1069,433],{"class":197},[187,1071,205],{"class":197},[187,1073,198],{"class":197},[187,1075,1076],{"class":348}," status",[187,1078,352],{"class":197},[187,1080,1082],{"class":1081},"sbssI"," 404",[187,1084,226],{"class":197},[187,1086,554],{"class":348},[187,1088,1089],{"class":189,"line":364},[187,1090,1091],{"class":197},"  }\n",[187,1093,1094,1096,1098,1100,1102,1104,1107,1109],{"class":189,"line":369},[187,1095,874],{"class":193},[187,1097,1018],{"class":355},[187,1099,397],{"class":348},[187,1101,1005],{"class":201},[187,1103,414],{"class":197},[187,1105,1106],{"class":201},"req",[187,1108,205],{"class":197},[187,1110,526],{"class":197},[187,1112,1113,1116,1118,1120,1123,1125,1128,1131,1134,1137,1139,1142,1144,1147,1149,1151,1153],{"class":189,"line":403},[187,1114,1115],{"class":355},"    waitUntil",[187,1117,352],{"class":197},[187,1119,500],{"class":197},[187,1121,1122],{"class":503},"task",[187,1124,352],{"class":197},[187,1126,1127],{"class":509}," Promise",[187,1129,1130],{"class":197},"\u003C",[187,1132,1133],{"class":509},"unknown",[187,1135,1136],{"class":197},">)",[187,1138,523],{"class":336},[187,1140,1141],{"class":201}," event",[187,1143,414],{"class":197},[187,1145,1146],{"class":355},"waitUntil",[187,1148,397],{"class":348},[187,1150,1122],{"class":201},[187,1152,468],{"class":348},[187,1154,436],{"class":197},[187,1156,1157,1159],{"class":189,"line":439},[187,1158,832],{"class":197},[187,1160,554],{"class":348},[187,1162,1163,1165],{"class":189,"line":447},[187,1164,465],{"class":197},[187,1166,554],{"class":201},[176,1168,1173],{"className":1169,"code":1170,"filename":1171,"language":1172,"meta":182,"style":182},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Vercel Connect OIDC token, required by the \"github\u002Fmy-connector\" connector.\n# vercel link && vercel env pull\nVERCEL_OIDC_TOKEN=\n\n# Webhook secret (must match your GitHub webhook config)\nGITHUB_WEBHOOK_SECRET=\n\n# Bot account username, for @mention detection\nGITHUB_AGENT_USERNAME=triage-bot\n",".env","bash",[184,1174,1175,1181,1186,1194,1198,1203,1210,1214,1219],{"__ignoreMap":182},[187,1176,1177],{"class":189,"line":190},[187,1178,1180],{"class":1179},"sHwdD","# Vercel Connect OIDC token, required by the \"github\u002Fmy-connector\" connector.\n",[187,1182,1183],{"class":189,"line":242},[187,1184,1185],{"class":1179},"# vercel link && vercel env pull\n",[187,1187,1188,1191],{"class":189,"line":263},[187,1189,1190],{"class":201},"VERCEL_OIDC_TOKEN",[187,1192,1193],{"class":197},"=\n",[187,1195,1196],{"class":189,"line":284},[187,1197,330],{"emptyLinePlaceholder":329},[187,1199,1200],{"class":189,"line":305},[187,1201,1202],{"class":1179},"# Webhook secret (must match your GitHub webhook config)\n",[187,1204,1205,1208],{"class":189,"line":326},[187,1206,1207],{"class":201},"GITHUB_WEBHOOK_SECRET",[187,1209,1193],{"class":197},[187,1211,1212],{"class":189,"line":333},[187,1213,330],{"emptyLinePlaceholder":329},[187,1215,1216],{"class":189,"line":364},[187,1217,1218],{"class":1179},"# Bot account username, for @mention detection\n",[187,1220,1221,1224,1226],{"class":189,"line":369},[187,1222,1223],{"class":201},"GITHUB_AGENT_USERNAME",[187,1225,343],{"class":197},[187,1227,1228],{"class":235},"triage-bot\n",[171,1230,1232],{"id":1231},"install","Install",[1234,1235,1236,1273,1302,1330],"code-group",{},[176,1237,1240],{"className":1169,"code":1238,"filename":1239,"language":1172,"meta":182,"style":182},"pnpm add @github-tools\u002Fsdk @vercel\u002Fconnect chat @chat-adapter\u002Fgithub @chat-adapter\u002Fstate-memory workflow ai zod\n","pnpm",[184,1241,1242],{"__ignoreMap":182},[187,1243,1244,1246,1249,1252,1255,1258,1261,1264,1267,1270],{"class":189,"line":190},[187,1245,1239],{"class":509},[187,1247,1248],{"class":235}," add",[187,1250,1251],{"class":235}," @github-tools\u002Fsdk",[187,1253,1254],{"class":235}," @vercel\u002Fconnect",[187,1256,1257],{"class":235}," chat",[187,1259,1260],{"class":235}," @chat-adapter\u002Fgithub",[187,1262,1263],{"class":235}," @chat-adapter\u002Fstate-memory",[187,1265,1266],{"class":235}," workflow",[187,1268,1269],{"class":235}," ai",[187,1271,1272],{"class":235}," zod\n",[176,1274,1277],{"className":1169,"code":1275,"filename":1276,"language":1172,"meta":182,"style":182},"npm install @github-tools\u002Fsdk @vercel\u002Fconnect chat @chat-adapter\u002Fgithub @chat-adapter\u002Fstate-memory workflow ai zod\n","npm",[184,1278,1279],{"__ignoreMap":182},[187,1280,1281,1283,1286,1288,1290,1292,1294,1296,1298,1300],{"class":189,"line":190},[187,1282,1276],{"class":509},[187,1284,1285],{"class":235}," install",[187,1287,1251],{"class":235},[187,1289,1254],{"class":235},[187,1291,1257],{"class":235},[187,1293,1260],{"class":235},[187,1295,1263],{"class":235},[187,1297,1266],{"class":235},[187,1299,1269],{"class":235},[187,1301,1272],{"class":235},[176,1303,1306],{"className":1169,"code":1304,"filename":1305,"language":1172,"meta":182,"style":182},"yarn add @github-tools\u002Fsdk @vercel\u002Fconnect chat @chat-adapter\u002Fgithub @chat-adapter\u002Fstate-memory workflow ai zod\n","yarn",[184,1307,1308],{"__ignoreMap":182},[187,1309,1310,1312,1314,1316,1318,1320,1322,1324,1326,1328],{"class":189,"line":190},[187,1311,1305],{"class":509},[187,1313,1248],{"class":235},[187,1315,1251],{"class":235},[187,1317,1254],{"class":235},[187,1319,1257],{"class":235},[187,1321,1260],{"class":235},[187,1323,1263],{"class":235},[187,1325,1266],{"class":235},[187,1327,1269],{"class":235},[187,1329,1272],{"class":235},[176,1331,1334],{"className":1169,"code":1332,"filename":1333,"language":1172,"meta":182,"style":182},"bun add @github-tools\u002Fsdk @vercel\u002Fconnect chat @chat-adapter\u002Fgithub @chat-adapter\u002Fstate-memory workflow ai zod\n","bun",[184,1335,1336],{"__ignoreMap":182},[187,1337,1338,1340,1342,1344,1346,1348,1350,1352,1354,1356],{"class":189,"line":190},[187,1339,1333],{"class":509},[187,1341,1248],{"class":235},[187,1343,1251],{"class":235},[187,1345,1254],{"class":235},[187,1347,1257],{"class":235},[187,1349,1260],{"class":235},[187,1351,1263],{"class":235},[187,1353,1266],{"class":235},[187,1355,1269],{"class":235},[187,1357,1272],{"class":235},[171,1359,1361],{"id":1360},"set-up-the-connector-and-webhook","Set up the connector and webhook",[1363,1364,1366,1371,1381,1385,1409,1413],"steps",{"level":1365},"3",[1367,1368,1370],"h3",{"id":1369},"create-a-github-connector","Create a GitHub connector",[137,1372,1373,1374,1376,1377,1380],{},"Create a ",[184,1375,743],{}," connector installed on the repositories this bot triages. See ",[157,1378,102],{"href":1379},"\u002Fguide\u002Fvercel-connect#setup-checklist"," for the full checklist.",[1367,1382,1384],{"id":1383},"pull-a-local-oidc-token","Pull a local OIDC token",[176,1386,1389],{"className":1169,"code":1387,"filename":1388,"language":1172,"meta":182,"style":182},"vercel link\nvercel env pull\n","Terminal",[184,1390,1391,1399],{"__ignoreMap":182},[187,1392,1393,1396],{"class":189,"line":190},[187,1394,1395],{"class":509},"vercel",[187,1397,1398],{"class":235}," link\n",[187,1400,1401,1403,1406],{"class":189,"line":242},[187,1402,1395],{"class":509},[187,1404,1405],{"class":235}," env",[187,1407,1408],{"class":235}," pull\n",[1367,1410,1412],{"id":1411},"configure-the-github-webhook","Configure the GitHub webhook",[137,1414,1415,1416,1420,1421,1424,1425,1428,1429,1431,1432,1435],{},"In ",[1417,1418,1419],"strong",{},"Settings → Webhooks",", point a webhook at ",[184,1422,1423],{},"\u002Fwebhooks\u002Fgithub"," with content type ",[184,1426,1427],{},"application\u002Fjson",", the same secret as ",[184,1430,1207],{},", and the ",[1417,1433,1434],{},"Issue comments"," event.",[1437,1438,1439,1440,1444,1445,1447],"warning",{},"Use a different GitHub account for the bot than the one commenting, ",[157,1441,45],{"href":1442,"rel":1443},"https:\u002F\u002Fchat-sdk.dev",[161]," filters self-messages to prevent loops. Set ",[184,1446,1223],{}," to that account.",[171,1449,1451],{"id":1450},"run-it","Run it",[176,1453,1455],{"className":1169,"code":1454,"filename":1388,"language":1172,"meta":182,"style":182},"pnpm dev\n",[184,1456,1457],{"__ignoreMap":182},[187,1458,1459,1461],{"class":189,"line":190},[187,1460,1239],{"class":509},[187,1462,1463],{"class":235}," dev\n",[137,1465,1466,1467,1470,1471,1474],{},"Comment ",[184,1468,1469],{},"@triage-bot triage this"," on an issue. The bot reacts, labels the issue, and posts its classification, no approval prompt, since ",[184,1472,1473],{},"requireApproval: false"," and this job never closes or deletes anything.",[171,1476,1478],{"id":1477},"go-further","Go further",[141,1480,1481,1488,1503],{},[144,1482,1483,1484,1487],{},"Set ",[184,1485,1486],{},"requireApproval: { closeIssue: true }"," and let the bot close issues once the author confirms it's resolved, instead of leaving that to a human every time",[144,1489,1490,1491,1494,1495,1498,1499],{},"Reuse the same ",[184,1492,1493],{},"agent.ts"," shape with ",[184,1496,1497],{},"@chat-adapter\u002Fslack"," to triage from a Slack channel instead of GitHub comments, see ",[157,1500,1502],{"href":1501},"\u002Fframeworks\u002Fchat-sdk#beyond-github","Beyond GitHub",[144,1504,1505,1506,1508],{},"Compare with the ",[157,1507,168],{"href":46}," to see the same architecture applied to a different preset and prompt",[1510,1511,1512],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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);}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":182,"searchDepth":242,"depth":242,"links":1514},[1515,1516,1517,1522,1523],{"id":173,"depth":242,"text":174},{"id":1231,"depth":242,"text":1232},{"id":1360,"depth":242,"text":1361,"children":1518},[1519,1520,1521],{"id":1369,"depth":263,"text":1370},{"id":1383,"depth":263,"text":1384},{"id":1411,"depth":263,"text":1412},{"id":1450,"depth":242,"text":1451},{"id":1477,"depth":242,"text":1478},"A durable GitHub bot that triages @mentioned issues, classifies them, and labels them, built with Chat SDK, Vercel Workflow, the issue-triage preset, and Vercel Connect.","md",[1527,1531,1534],{"label":1528,"icon":48,"to":46,"color":1529,"variant":1530},"Chat SDK guide","neutral","subtle",{"label":1532,"icon":1533,"to":87,"color":1529,"variant":1530},"Scope with presets","i-lucide-layers",{"label":102,"icon":1535,"to":103,"color":1529,"variant":1530},"i-lucide-plug",{},{"title":70,"icon":48},{"title":127,"description":1539},"A durable issue triage bot built with @github-tools\u002Fsdk, Chat SDK, Vercel Workflow, and Vercel Connect.","FJLjYmm46YEEu0gzcVPRtnXh9jysZ_VAhI38icHPBSo",[1542,1544],{"title":66,"path":67,"stem":68,"description":1543,"icon":39,"children":-1},"A durable chat backend that diagnoses failing GitHub Actions runs, built with createDurableGithubAgent, the ci-ops preset, and Vercel Connect.",{"title":74,"path":75,"stem":76,"description":1545,"icon":34,"children":-1},"A broadly-capable GitHub manager agent that delegates to specialist eve sub-agents, each scoped to one preset (code-review, issue-triage, release-manager), instead of one agent holding every tool.",1786010333212]