[{"data":1,"prerenderedAt":898},["ShallowReactive",2],{"docs:\u002Fdocs\u002Fguides\u002Fagents":3,"docs:navigation":776,"docs:surround:\u002Fdocs\u002Fguides\u002Fagents":893},{"id":4,"title":5,"body":6,"description":769,"extension":32,"meta":770,"navigation":74,"navigationTitle":771,"path":772,"seo":773,"stem":774,"__hash__":775},"docs\u002Fdocs\u002F3.guides\u002F1.agents.md","Agents",{"type":7,"value":8,"toc":761},"minimark",[9,13,18,26,127,296,303,310,314,321,325,331,410,426,445,452,456,459,575,586,590,593,637,647,719,723,741,757],[10,11,12],"p",{},"An agent is a set of instructions, a provider and model, and the tools it may call. You write the\nagents your app depends on as files, so they are reviewed and versioned with your code. Your users\nbuild their own agents in the dashboard.",[14,15,17],"h2",{"id":16},"writing-an-agent-in-code","Writing an Agent in Code",[10,19,20,21,25],{},"Each Markdown file in ",[22,23,24],"code",{},"server\u002Fagents"," is an agent. The file name is its slug, the first heading is\nits name, and the rest is its instructions:",[27,28,34],"pre",{"className":29,"code":30,"filename":31,"language":32,"meta":33,"style":33},"language-md shiki shiki-themes github-dark-default","---\nprovider: 'anthropic'\nmodel: 'claude-sonnet-5-5'\ntools: ['customer_list', 'customer_get', 'web_fetch']\n---\n\n# Support\n\nAnswer questions about customers and their plans, clearly and briefly.\n\n## Boundaries\n\n- Never change customer records. Hand changes to the account manager.\n- Say so when you cannot find a customer instead of guessing.\n","server\u002Fagents\u002Fsupport.md","md","",[22,35,36,45,52,58,64,69,76,82,87,93,98,104,109,119],{"__ignoreMap":33},[37,38,41],"span",{"class":39,"line":40},"line",1,[37,42,44],{"class":43},"sp6Gy","---\n",[37,46,48],{"class":39,"line":47},2,[37,49,51],{"class":50},"sZEs4","provider: 'anthropic'\n",[37,53,55],{"class":39,"line":54},3,[37,56,57],{"class":50},"model: 'claude-sonnet-5-5'\n",[37,59,61],{"class":39,"line":60},4,[37,62,63],{"class":50},"tools: ['customer_list', 'customer_get', 'web_fetch']\n",[37,65,67],{"class":39,"line":66},5,[37,68,44],{"class":43},[37,70,72],{"class":39,"line":71},6,[37,73,75],{"emptyLinePlaceholder":74},true,"\n",[37,77,79],{"class":39,"line":78},7,[37,80,81],{"class":43},"# Support\n",[37,83,85],{"class":39,"line":84},8,[37,86,75],{"emptyLinePlaceholder":74},[37,88,90],{"class":39,"line":89},9,[37,91,92],{"class":50},"Answer questions about customers and their plans, clearly and briefly.\n",[37,94,96],{"class":39,"line":95},10,[37,97,75],{"emptyLinePlaceholder":74},[37,99,101],{"class":39,"line":100},11,[37,102,103],{"class":43},"## Boundaries\n",[37,105,107],{"class":39,"line":106},12,[37,108,75],{"emptyLinePlaceholder":74},[37,110,112,116],{"class":39,"line":111},13,[37,113,115],{"class":114},"sQhOw","-",[37,117,118],{"class":50}," Never change customer records. Hand changes to the account manager.\n",[37,120,122,124],{"class":39,"line":121},14,[37,123,115],{"class":114},[37,125,126],{"class":50}," Say so when you cannot find a customer instead of guessing.\n",[128,129,130,146],"table",{},[131,132,133],"thead",{},[134,135,136,140,143],"tr",{},[137,138,139],"th",{},"Setting",[137,141,142],{},"Values",[137,144,145],{},"Default",[147,148,149,177,192,208,229,258,277],"tbody",{},[134,150,151,157,173],{},[152,153,154],"td",{},[22,155,156],{},"provider",[152,158,159,162,163,162,166,169,170],{},[22,160,161],{},"openai",", ",[22,164,165],{},"anthropic",[22,167,168],{},"google",", or ",[22,171,172],{},"mock",[152,174,175],{},[22,176,165],{},[134,178,179,184,187],{},[152,180,181],{},[22,182,183],{},"model",[152,185,186],{},"The provider's model ID",[152,188,189],{},[22,190,191],{},"claude-sonnet-5-5",[134,193,194,199,205],{},[152,195,196],{},[22,197,198],{},"tools",[152,200,201,202],{},"Tool names: your tools, model tools, integration actions, and ",[22,203,204],{},"web_fetch",[152,206,207],{},"none",[134,209,210,215,225],{},[152,211,212],{},[22,213,214],{},"tool_choice",[152,216,217,162,220,169,223],{},[22,218,219],{},"auto",[22,221,222],{},"required",[22,224,207],{},[152,226,227],{},[22,228,219],{},[134,230,231,236,254],{},[152,232,233],{},[22,234,235],{},"runtime",[152,237,238,169,241,244,245,248,249],{},[22,239,240],{},"api",[22,242,243],{},"codex"," or ",[22,246,247],{},"claude"," for ",[250,251,253],"a",{"href":252},"#running-on-codex-or-claude-locally","local CLIs",[152,255,256],{},[22,257,240],{},[134,259,260,265,272],{},[152,261,262],{},[22,263,264],{},"local_model",[152,266,267,268,271],{},"Model name for the local CLI, such as ",[22,269,270],{},"sonnet","; empty uses the CLI's default",[152,273,274],{},[22,275,276],{},"''",[134,278,279,284,292],{},[152,280,281],{},[22,282,283],{},"status",[152,285,286,244,289],{},[22,287,288],{},"active",[22,290,291],{},"draft",[152,293,294],{},[22,295,288],{},[10,297,298,299,302],{},"Invalid tool names and settings fail at startup. The error includes the file path, such as\n",[22,300,301],{},"server\u002Fagents\u002Fsupport.md:",". Code agents are read-only in the dashboard. Each workspace gets its\nown copy and run history; the copy updates when the source file changes.",[10,304,305,306,309],{},"The Nuxt layer generates types from these files, so ",[22,307,308],{},"useDurableAgent('support')"," accepts only\nslugs that exist.",[14,311,313],{"id":312},"letting-users-build-agents","Letting Users Build Agents",[10,315,316,317,320],{},"Users create agents at ",[22,318,319],{},"\u002Fdashboard\u002Fagents",": name, instructions, model, and tools, with autosave\nand a test run panel. They can enable integration actions that the workspace has connected and\ngranted.",[14,322,324],{"id":323},"running-an-agent-from-your-own-page","Running an Agent from Your Own Page",[10,326,327,330],{},[22,328,329],{},"useDurableAgent()"," starts a run and follows it live:",[27,332,336],{"className":333,"code":334,"language":335,"meta":33,"style":33},"language-ts shiki shiki-themes github-dark-default","const { agent, start, output, status, error, cancel } = useDurableAgent('support')\nawait start('Which customers are on the pro plan?')\n","ts",[22,337,338,395],{"__ignoreMap":33},[37,339,340,344,347,351,353,356,358,361,363,365,367,370,372,375,378,381,385,388,392],{"class":39,"line":40},[37,341,343],{"class":342},"suJrU","const",[37,345,346],{"class":50}," { ",[37,348,350],{"class":349},"sFSAA","agent",[37,352,162],{"class":50},[37,354,355],{"class":349},"start",[37,357,162],{"class":50},[37,359,360],{"class":349},"output",[37,362,162],{"class":50},[37,364,283],{"class":349},[37,366,162],{"class":50},[37,368,369],{"class":349},"error",[37,371,162],{"class":50},[37,373,374],{"class":349},"cancel",[37,376,377],{"class":50}," } ",[37,379,380],{"class":342},"=",[37,382,384],{"class":383},"sc3cj"," useDurableAgent",[37,386,387],{"class":50},"(",[37,389,391],{"class":390},"s9uIt","'support'",[37,393,394],{"class":50},")\n",[37,396,397,400,403,405,408],{"class":39,"line":47},[37,398,399],{"class":342},"await",[37,401,402],{"class":383}," start",[37,404,387],{"class":50},[37,406,407],{"class":390},"'Which customers are on the pro plan?'",[37,409,394],{"class":50},[10,411,412,415,416,418,419,421,422,425],{},[22,413,414],{},"start()"," resolves when the run is accepted. Read ",[22,417,283],{}," and ",[22,420,360],{}," for progress. Durable runs\ncontinue after the tab closes and pause at ",[22,423,424],{},"waiting"," for approval.",[10,427,428,429,432,433,436,437,440,441,444],{},"To follow a run selected elsewhere, call ",[22,430,431],{},"useAgentRun(agentId, runId)"," and invoke ",[22,434,435],{},"follow()"," from\nyour selection handler. When the selected agent or workspace changes, call ",[22,438,439],{},"refresh()"," before\nshowing its data. See ",[22,442,443],{},"app\u002Fpages\u002Fsupport.vue"," in the starter for a complete example.",[10,446,447,448,451],{},"For a quick answer inside one request, ",[22,449,450],{},"useAgent('support')"," from the free module streams a run\nfrom the same agent and tools without storing it. Under Pro, it runs as the signed-in user.",[14,453,455],{"id":454},"running-an-agent-from-the-server","Running an Agent from the Server",[10,457,458],{},"Your own server routes start runs through the services:",[27,460,463],{"className":333,"code":461,"filename":462,"language":335,"meta":33,"style":33},"export default defineEventHandler(async (event) => {\n  const { agents, runs } = await useAgentic(event)\n  const support = await agents.code('support')\n  return runs.start(support.id, { runId: crypto.randomUUID(), payload: await readBody(event) })\n})\n","server\u002Fapi\u002Fsummaries.post.ts",[22,464,465,490,518,541,568],{"__ignoreMap":33},[37,466,467,470,473,476,478,481,484,487],{"class":39,"line":40},[37,468,469],{"class":342},"export",[37,471,472],{"class":342}," default",[37,474,475],{"class":383}," defineEventHandler",[37,477,387],{"class":114},[37,479,480],{"class":342},"async",[37,482,483],{"class":114}," (event) ",[37,485,486],{"class":342},"=>",[37,488,489],{"class":50}," {\n",[37,491,492,495,497,500,502,505,507,509,512,515],{"class":39,"line":47},[37,493,494],{"class":342},"  const",[37,496,346],{"class":50},[37,498,499],{"class":349},"agents",[37,501,162],{"class":50},[37,503,504],{"class":349},"runs",[37,506,377],{"class":50},[37,508,380],{"class":342},[37,510,511],{"class":342}," await",[37,513,514],{"class":383}," useAgentic",[37,516,517],{"class":50},"(event)\n",[37,519,520,522,525,528,530,533,535,537,539],{"class":39,"line":54},[37,521,494],{"class":342},[37,523,524],{"class":349}," support",[37,526,527],{"class":342}," =",[37,529,511],{"class":342},[37,531,532],{"class":50}," agents.",[37,534,22],{"class":383},[37,536,387],{"class":50},[37,538,391],{"class":390},[37,540,394],{"class":50},[37,542,543,546,549,551,554,557,560,562,565],{"class":39,"line":60},[37,544,545],{"class":342},"  return",[37,547,548],{"class":50}," runs.",[37,550,355],{"class":383},[37,552,553],{"class":50},"(support.id, { runId: crypto.",[37,555,556],{"class":383},"randomUUID",[37,558,559],{"class":50},"(), payload: ",[37,561,399],{"class":342},[37,563,564],{"class":383}," readBody",[37,566,567],{"class":50},"(event) })\n",[37,569,570,573],{"class":39,"line":66},[37,571,572],{"class":50},"}",[37,574,394],{"class":114},[10,576,577,580,581,585],{},[22,578,579],{},"runId"," names the run: up to 100 letters, digits, hyphens, or underscores. See\n",[250,582,584],{"href":583},"\u002Fdocs\u002Fguides\u002Fserver-logic","Server Logic"," for the other services.",[14,587,589],{"id":588},"setting-provider-keys","Setting Provider Keys",[10,591,592],{},"Each provider reads its key from an environment variable:",[128,594,595,605],{},[131,596,597],{},[134,598,599,602],{},[137,600,601],{},"Provider",[137,603,604],{},"Environment variable",[147,606,607,617,627],{},[134,608,609,612],{},[152,610,611],{},"OpenAI",[152,613,614],{},[22,615,616],{},"OPENAI_API_KEY",[134,618,619,622],{},[152,620,621],{},"Anthropic",[152,623,624],{},[22,625,626],{},"ANTHROPIC_API_KEY",[134,628,629,632],{},[152,630,631],{},"Google",[152,633,634],{},[22,635,636],{},"GOOGLE_AI_API_KEY",[10,638,639,640,642,643,646],{},"The ",[22,641,172],{}," provider needs no key. It replies ",[22,644,645],{},"Mock response: \u003Cpayload>",", or follows a script in\nthe run payload, so tool calls and approvals work in tests and demos:",[27,648,652],{"className":649,"code":650,"language":651,"meta":33,"style":33},"language-json shiki shiki-themes github-dark-default","{\n  \"mock\": {\n    \"turns\": [{ \"calls\": [{ \"name\": \"customer_list\", \"input\": {} }] }, { \"text\": \"Done.\" }]\n  }\n}\n","json",[22,653,654,659,668,709,714],{"__ignoreMap":33},[37,655,656],{"class":39,"line":40},[37,657,658],{"class":50},"{\n",[37,660,661,665],{"class":39,"line":47},[37,662,664],{"class":663},"sPWt5","  \"mock\"",[37,666,667],{"class":50},": {\n",[37,669,670,673,676,679,681,684,687,690,692,695,698,701,703,706],{"class":39,"line":54},[37,671,672],{"class":663},"    \"turns\"",[37,674,675],{"class":50},": [{ ",[37,677,678],{"class":663},"\"calls\"",[37,680,675],{"class":50},[37,682,683],{"class":663},"\"name\"",[37,685,686],{"class":50},": ",[37,688,689],{"class":390},"\"customer_list\"",[37,691,162],{"class":50},[37,693,694],{"class":663},"\"input\"",[37,696,697],{"class":50},": {} }] }, { ",[37,699,700],{"class":663},"\"text\"",[37,702,686],{"class":50},[37,704,705],{"class":390},"\"Done.\"",[37,707,708],{"class":50}," }]\n",[37,710,711],{"class":39,"line":60},[37,712,713],{"class":50},"  }\n",[37,715,716],{"class":39,"line":66},[37,717,718],{"class":50},"}\n",[14,720,722],{"id":721},"running-on-codex-or-claude-locally","Running on Codex or Claude Locally",[10,724,725,726,244,730,733,734,737,738,740],{},"To test without a provider API key, select ",[727,728,729],"strong",{},"Codex CLI",[727,731,732],{},"Claude Code"," in the model picker\nduring ",[22,735,736],{},"pnpm dev",". For a code agent, set ",[22,739,235],{}," to the CLI name instead.",[10,742,743,744,747,748,751,752,756],{},"These runs use your CLI login, with tools, plugins, web search, and shell access disabled. The\nbridge runs only on localhost during development. Configure it with ",[22,745,746],{},"agentic.localRuntimes"," (Nuxt)\nor ",[22,749,750],{},"voidAgentic({ localRuntimes })"," (Void), or disable it. See\n",[250,753,755],{"href":754},"\u002Fdocs\u002Freference\u002Fconfiguration","Configuration",".",[758,759,760],"style",{},"html pre.shiki code .sp6Gy, html code.shiki .sp6Gy{--shiki-default:#79C0FF;--shiki-default-font-weight:bold}html pre.shiki code .sZEs4, html code.shiki .sZEs4{--shiki-default:#E6EDF3}html pre.shiki code .sQhOw, html code.shiki .sQhOw{--shiki-default:#FFA657}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 pre.shiki code .suJrU, html code.shiki .suJrU{--shiki-default:#FF7B72}html pre.shiki code .sFSAA, html code.shiki .sFSAA{--shiki-default:#79C0FF}html pre.shiki code .sc3cj, html code.shiki .sc3cj{--shiki-default:#D2A8FF}html pre.shiki code .s9uIt, html code.shiki .s9uIt{--shiki-default:#A5D6FF}html pre.shiki code .sPWt5, html code.shiki .sPWt5{--shiki-default:#7EE787}",{"title":33,"searchDepth":47,"depth":47,"links":762},[763,764,765,766,767,768],{"id":16,"depth":47,"text":17},{"id":312,"depth":47,"text":313},{"id":323,"depth":47,"text":324},{"id":454,"depth":47,"text":455},{"id":588,"depth":47,"text":589},{"id":721,"depth":47,"text":722},"Write agents as Markdown files or let your users build them in the dashboard.",{},null,"\u002Fdocs\u002Fguides\u002Fagents",{"title":5,"description":769},"docs\u002F3.guides\u002F1.agents","t_oCF7wNuDLJmGzYLqfQJPb9DPGDIsWNs2GkLYIKkyM",[777],{"title":778,"path":779,"stem":780,"children":781,"navigationTitle":771},"Introduction","\u002Fdocs","docs\u002F0.index",[782,783,801,805,854,858,862,889],{"title":778,"path":779,"stem":780,"navigationTitle":771},{"title":784,"path":785,"stem":786,"children":787,"page":800},"Getting Started","\u002Fdocs\u002Fgetting-started","docs\u002F1.getting-started",[788,792,796],{"title":789,"path":790,"stem":791,"navigationTitle":771},"Free module","\u002Fdocs\u002Fgetting-started\u002Ffree","docs\u002F1.getting-started\u002F1.free",{"title":793,"path":794,"stem":795,"navigationTitle":771},"Pro on Nuxt","\u002Fdocs\u002Fgetting-started\u002Fnuxt","docs\u002F1.getting-started\u002F2.nuxt",{"title":797,"path":798,"stem":799,"navigationTitle":771},"Pro on Void","\u002Fdocs\u002Fgetting-started\u002Fvoid","docs\u002F1.getting-started\u002F3.void",false,{"title":802,"path":803,"stem":804,"navigationTitle":771},"Concepts","\u002Fdocs\u002Fconcepts","docs\u002F2.concepts",{"title":806,"path":807,"stem":808,"children":809,"page":800},"Guides","\u002Fdocs\u002Fguides","docs\u002F3.guides",[810,811,815,819,823,827,831,835,839,843,847,850],{"title":5,"path":772,"stem":774,"navigationTitle":771},{"title":812,"path":813,"stem":814,"navigationTitle":771},"Events","\u002Fdocs\u002Fguides\u002Fevents","docs\u002F3.guides\u002F10.events",{"title":816,"path":817,"stem":818,"navigationTitle":771},"Features","\u002Fdocs\u002Fguides\u002Ffeatures","docs\u002F3.guides\u002F11.features",{"title":820,"path":821,"stem":822,"navigationTitle":771},"Coding agents","\u002Fdocs\u002Fguides\u002Fcoding-agents","docs\u002F3.guides\u002F12.coding-agents",{"title":824,"path":825,"stem":826,"navigationTitle":771},"Tools","\u002Fdocs\u002Fguides\u002Ftools","docs\u002F3.guides\u002F2.tools",{"title":828,"path":829,"stem":830,"navigationTitle":771},"Automations","\u002Fdocs\u002Fguides\u002Fautomations","docs\u002F3.guides\u002F3.automations",{"title":832,"path":833,"stem":834,"navigationTitle":771},"Agentic Models","\u002Fdocs\u002Fguides\u002Fagentic-models","docs\u002F3.guides\u002F4.agentic-models",{"title":836,"path":837,"stem":838,"navigationTitle":771},"Outcomes","\u002Fdocs\u002Fguides\u002Foutcomes","docs\u002F3.guides\u002F5.outcomes",{"title":840,"path":841,"stem":842,"navigationTitle":771},"Integrations","\u002Fdocs\u002Fguides\u002Fintegrations","docs\u002F3.guides\u002F6.integrations",{"title":844,"path":845,"stem":846,"navigationTitle":771},"Prompt","\u002Fdocs\u002Fguides\u002Fprompt","docs\u002F3.guides\u002F7.prompt",{"title":848,"path":583,"stem":849,"navigationTitle":771},"Server logic","docs\u002F3.guides\u002F8.server-logic",{"title":851,"path":852,"stem":853,"navigationTitle":771},"Dashboard UI","\u002Fdocs\u002Fguides\u002Fui","docs\u002F3.guides\u002F9.ui",{"title":855,"path":856,"stem":857,"navigationTitle":771},"Deploy to Cloudflare","\u002Fdocs\u002Fdeploy","docs\u002F4.deploy",{"title":859,"path":860,"stem":861,"navigationTitle":771},"Upgrading","\u002Fdocs\u002Fupgrade","docs\u002F5.upgrade",{"title":863,"path":864,"stem":865,"children":866,"page":800},"Reference","\u002Fdocs\u002Freference","docs\u002F6.reference",[867,869,873,877,881,885],{"title":755,"path":754,"stem":868,"navigationTitle":771},"docs\u002F6.reference\u002F1.configuration",{"title":870,"path":871,"stem":872,"navigationTitle":771},"Composables","\u002Fdocs\u002Freference\u002Fcomposables","docs\u002F6.reference\u002F2.composables",{"title":874,"path":875,"stem":876,"navigationTitle":771},"Server utilities","\u002Fdocs\u002Freference\u002Fserver-utils","docs\u002F6.reference\u002F3.server-utils",{"title":878,"path":879,"stem":880,"navigationTitle":771},"Services","\u002Fdocs\u002Freference\u002Fservices","docs\u002F6.reference\u002F4.services",{"title":882,"path":883,"stem":884,"navigationTitle":771},"REST API","\u002Fdocs\u002Freference\u002Frest-api","docs\u002F6.reference\u002F5.rest-api",{"title":886,"path":887,"stem":888,"navigationTitle":771},"CLI","\u002Fdocs\u002Freference\u002Fcli","docs\u002F6.reference\u002F6.cli",{"title":890,"path":891,"stem":892,"navigationTitle":771},"Licensing & FAQ","\u002Fdocs\u002Flicensing","docs\u002F8.licensing",[894,896],{"title":802,"path":803,"stem":804,"description":895,"children":-1},"Workspaces, agents, runs, approvals, automations, integrations, models and features in one page.",{"title":812,"path":813,"stem":814,"description":897,"children":-1},"Observe agent runs, tool calls and approvals for logs, analytics and alerts.",1792672479671]