[{"data":1,"prerenderedAt":392,"buildId":393},["ShallowReactive",2],{"docs-surround:\u002Fdocs\u002Fagents\u002Fscripts-and-http":3,"docs:\u002Fdocs\u002Fagents\u002Fscripts-and-http":12,"i-lucide:menu":279,"i-lucide:search":284,"navigation":286,"source":380},[4,8],{"title":5,"path":6,"stem":7,"children":-1},"Cursor","\u002Fdocs\u002Fagents\u002Fcursor","docs\u002F3.agents\u002F5.cursor",{"title":9,"path":10,"stem":11,"children":-1},"Settings","\u002Fdocs\u002Freference\u002Fsettings","docs\u002F4.reference\u002F1.settings",{"id":13,"title":14,"body":15,"description":271,"extension":272,"meta":273,"navigation":274,"path":275,"seo":276,"stem":277,"__hash__":278},"docs\u002Fdocs\u002F3.agents\u002F6.scripts-and-http.md","Scripts and HTTP",{"type":16,"value":17,"toc":264},"minimark",[18,22,27,47,50,69,72,143,172,176,193,222,248,251,257,261],[19,20,21],"p",{},"These two adapters let an agent be your own code. Neither needs a vendor tool. Both have run only against a test agent and a test server on one machine.",[23,24,26],"h2",{"id":25},"process-a-program-or-script","Process: a program or script",[19,28,29,30,34,35,38,39,42,43,46],{},"Choose ",[31,32,33],"strong",{},"Process"," as the ",[31,36,37],{},"Adapter",". Its settings are ",[31,40,41],{},"Command",", which is required, and ",[31,44,45],{},"Environment",".",[19,48,49],{},"zerohead runs the command once for each run.",[51,52,53,57,60,63,66],"ul",{},[54,55,56],"li",{},"The command takes no arguments. Wrap arguments in a script.",[54,58,59],{},"The prompt, with the agent's added instructions, arrives on standard input.",[54,61,62],{},"The working folder is the run's folder.",[54,64,65],{},"Each line the program prints is logged. Lines on standard error are logged too.",[54,67,68],{},"Exit code 0 is a success. The last non-empty line it printed is the run's result. Any other exit code is a failure.",[19,70,71],{},"The program starts with these environment variables:",[73,74,75,88],"table",{},[76,77,78],"thead",{},[79,80,81,85],"tr",{},[82,83,84],"th",{},"Variable",[82,86,87],{},"Value",[89,90,91,103,113,123,133],"tbody",{},[79,92,93,100],{},[94,95,96],"td",{},[97,98,99],"code",{},"ZEROHEAD_RUN_ID",[94,101,102],{},"The run's ID.",[79,104,105,110],{},[94,106,107],{},[97,108,109],{},"ZEROHEAD_AGENT_ID",[94,111,112],{},"The agent's ID.",[79,114,115,120],{},[94,116,117],{},[97,118,119],{},"ZEROHEAD_TASK_ID",[94,121,122],{},"The task's ID. Set only when the run has a task.",[79,124,125,130],{},[94,126,127],{},[97,128,129],{},"ZEROHEAD_MCP_URL",[94,131,132],{},"The address of zerohead's tool endpoint.",[79,134,135,140],{},[94,136,137],{},[97,138,139],{},"ZEROHEAD_MCP_TOKEN_FILE",[94,141,142],{},"A private file holding the run's token. It is removed before the run ends.",[19,144,145,146,149,150,152,153,156,157,160,161,160,164,167,168,171],{},"To use zerohead's tools, send JSON-RPC 2.0 requests with ",[97,147,148],{},"POST"," to ",[97,151,129],{},". Put the token from the file in an ",[97,154,155],{},"Authorization: Bearer"," header. The endpoint answers ",[97,158,159],{},"initialize",", ",[97,162,163],{},"ping",[97,165,166],{},"tools\u002Flist"," and ",[97,169,170],{},"tools\u002Fcall",", and keeps no session. The token works only while the run lasts.",[23,173,175],{"id":174},"http-a-web-service","HTTP: a web service",[19,177,29,178,34,181,38,183,42,186,189,190,192],{},[31,179,180],{},"HTTP",[31,182,37],{},[31,184,185],{},"Address",[31,187,188],{},"Headers",". The address is shown on every paired device and is not a secret. Put keys in ",[31,191,188],{},", not in the address. An address with a user name or password is refused.",[19,194,195,196,198,199,160,202,160,205,160,208,160,211,160,214,217,218,221],{},"For each run zerohead sends one JSON ",[97,197,148],{}," to the address. The body holds ",[97,200,201],{},"run_id",[97,203,204],{},"agent_id",[97,206,207],{},"prompt",[97,209,210],{},"system_append",[97,212,213],{},"cwd",[97,215,216],{},"task_id"," when the run has a task, and ",[97,219,220],{},"mcp",", the tool endpoint's address and token.",[51,223,224,231,234,237],{},[54,225,226,227,230],{},"A 2xx reply is a success. The result is the JSON ",[97,228,229],{},"result"," field when it is a string, or the raw text. The reply may be up to 1 MiB.",[54,232,233],{},"Anything else fails the run: a redirect, another status, a longer reply or a transport error.",[54,235,236],{},"zerohead never follows redirects and never uses a proxy from your environment.",[54,238,239,240,243,244,247],{},"The tool token is sent only to an ",[97,241,242],{},"https"," address or to this computer. For any other ",[97,245,246],{},"http"," address the run still happens, without the token, and the log shows a warning.",[19,249,250],{},"If you can reach your service only through a proxy, you cannot use this adapter yet.",[252,253,254],"note",{},[19,255,256],{},"A script or service runs with your user's permissions and zerohead adds no sandbox around it. Run only code you trust.",[23,258,260],{"id":259},"timeouts-and-cancel","Timeouts and cancel",[19,262,263],{},"A timeout or cancel stops the program and its child processes, or aborts the request in flight. The run still ends with one result.",{"title":265,"searchDepth":266,"depth":266,"links":267},"",2,[268,269,270],{"id":25,"depth":266,"text":26},{"id":174,"depth":266,"text":175},{"id":259,"depth":266,"text":260},"Use any program or web service as an agent, with the Process and HTTP adapters.","md",{},true,"\u002Fdocs\u002Fagents\u002Fscripts-and-http",{"title":14,"description":271},"docs\u002F3.agents\u002F6.scripts-and-http","WVmJKzSFXgCzfndX7tx8NAQxtLSwhFqztzcDyNp9234",{"left":280,"top":280,"width":281,"height":281,"rotate":280,"vFlip":282,"hFlip":282,"body":283},0,24,false,"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 5h16M4 12h16M4 19h16\"\u002F>",{"left":280,"top":280,"width":281,"height":281,"rotate":280,"vFlip":282,"hFlip":282,"body":285},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Cpath d=\"m21 21l-4.34-4.34\"\u002F>\u003Ccircle cx=\"11\" cy=\"11\" r=\"8\"\u002F>\u003C\u002Fg>",[287],{"title":288,"path":289,"stem":290,"children":291,"page":282},"Docs","\u002Fdocs","docs",[292,309,338,361,371],{"title":293,"path":294,"stem":295,"children":296,"page":282},"Get started","\u002Fdocs\u002Fget-started","docs\u002F1.get-started",[297,301,305],{"title":298,"path":299,"stem":300},"Install","\u002Fdocs\u002Fget-started\u002Finstall","docs\u002F1.get-started\u002F1.install",{"title":302,"path":303,"stem":304},"Pair a browser","\u002Fdocs\u002Fget-started\u002Fpair-a-browser","docs\u002F1.get-started\u002F2.pair-a-browser",{"title":306,"path":307,"stem":308},"Your first task","\u002Fdocs\u002Fget-started\u002Fyour-first-task","docs\u002F1.get-started\u002F3.your-first-task",{"title":310,"path":311,"stem":312,"children":313,"page":282},"Using zerohead","\u002Fdocs\u002Fusing-zerohead","docs\u002F2.using-zerohead",[314,318,322,326,330,334],{"title":315,"path":316,"stem":317},"Companies and agents","\u002Fdocs\u002Fusing-zerohead\u002Fcompanies-and-agents","docs\u002F2.using-zerohead\u002F1.companies-and-agents",{"title":319,"path":320,"stem":321},"Tasks and runs","\u002Fdocs\u002Fusing-zerohead\u002Ftasks-and-runs","docs\u002F2.using-zerohead\u002F2.tasks-and-runs",{"title":323,"path":324,"stem":325},"Company memory","\u002Fdocs\u002Fusing-zerohead\u002Fcompany-memory","docs\u002F2.using-zerohead\u002F3.company-memory",{"title":327,"path":328,"stem":329},"Budgets and approvals","\u002Fdocs\u002Fusing-zerohead\u002Fbudgets-and-approvals","docs\u002F2.using-zerohead\u002F4.budgets-and-approvals",{"title":331,"path":332,"stem":333},"Connectors","\u002Fdocs\u002Fusing-zerohead\u002Fconnectors","docs\u002F2.using-zerohead\u002F5.connectors",{"title":335,"path":336,"stem":337},"Remote access","\u002Fdocs\u002Fusing-zerohead\u002Fremote-access","docs\u002F2.using-zerohead\u002F6.remote-access",{"title":339,"path":340,"stem":341,"children":342,"page":282},"Agents","\u002Fdocs\u002Fagents","docs\u002F3.agents",[343,347,351,355,359,360],{"title":344,"path":345,"stem":346},"Claude Code","\u002Fdocs\u002Fagents\u002Fclaude-code","docs\u002F3.agents\u002F1.claude-code",{"title":348,"path":349,"stem":350},"Codex","\u002Fdocs\u002Fagents\u002Fcodex","docs\u002F3.agents\u002F2.codex",{"title":352,"path":353,"stem":354},"OpenCode","\u002Fdocs\u002Fagents\u002Fopencode","docs\u002F3.agents\u002F3.opencode",{"title":356,"path":357,"stem":358},"Pi","\u002Fdocs\u002Fagents\u002Fpi","docs\u002F3.agents\u002F4.pi",{"title":5,"path":6,"stem":7},{"title":14,"path":275,"stem":277},{"title":362,"path":363,"stem":364,"children":365,"page":282},"Reference","\u002Fdocs\u002Freference","docs\u002F4.reference",[366,367],{"title":9,"path":10,"stem":11},{"title":368,"path":369,"stem":370},"Command line","\u002Fdocs\u002Freference\u002Fcommand-line","docs\u002F4.reference\u002F2.command-line",{"title":372,"path":373,"stem":374,"children":375,"page":282},"Contributing","\u002Fdocs\u002Fcontributing","docs\u002F5.contributing",[376],{"title":377,"path":378,"stem":379},"Build from source","\u002Fdocs\u002Fcontributing\u002Fbuild-from-source","docs\u002F5.contributing\u002F1.build-from-source",{"id":381,"clone":382,"description":383,"docsNotice":384,"extension":385,"meta":386,"status":387,"stem":390,"__hash__":391},"source\u002Fsource\u002Fprivate.yml",null,"Run a company of AI agents on your own computer. The source will be published under MIT.","The source is not public yet. It will be published under MIT. The pages under Contributing describe working on it once it is.","yml",{},{"lead":388,"text":389},"Early.","The source is not public yet. It will be published under MIT.","source\u002Fprivate","ZIRSRgoDOBHkU54QRPpdRltyFcq_DTWub-4p70w1DaY",1796109414181,"515e4a29-51e4-43d8-b774-a8b94f7dc369"]