[{"data":1,"prerenderedAt":1106},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fv2\u002Ffleet\u002Fcode":3},{"id":4,"title":5,"body":6,"description":1099,"extension":1100,"meta":1101,"navigation":92,"path":1102,"seo":1103,"stem":1104,"__hash__":1105},"docs\u002Fdocs\u002Fv2\u002Ffleet\u002Fcode.md","Agents in Code",{"type":7,"value":8,"toc":1090},"minimark",[9,13,26,145,162,185,190,199,256,262,450,453,463,466,472,541,544,557,561,564,606,609,621,625,628,633,718,724,730,733,737,895,901,904,908,915,935,942,946,963,1057,1066,1075,1078,1086],[10,11,5],"h1",{"id":12},"agents-in-code",[14,15,16,17,21,22,25],"p",{},"A file ending ",[18,19,20],"code",{},".axon.ts"," is a global script — an ordinary TypeScript program that boots\nits own agents. It lives wherever you put it: a repo root, a scratch directory, ",[18,23,24],{},"~\u002Fbin",".",[27,28,33],"pre",{"className":29,"code":30,"language":31,"meta":32,"style":32},"language-ts shiki shiki-themes dark-plus","\u002F\u002F ~\u002Fscripts\u002Fstandup.axon.ts\nconst { axon: barry } = await Axon(\"~\u002Fagents\u002Fbarry\")\n\nconst summary = await barry.request(\"summarise yesterday's commits\")\nconsole.log(summary.text)\n","ts","",[18,34,35,44,87,94,122],{"__ignoreMap":32},[36,37,40],"span",{"class":38,"line":39},"line",1,[36,41,43],{"class":42},"sOLPB","\u002F\u002F ~\u002Fscripts\u002Fstandup.axon.ts\n",[36,45,47,51,55,59,62,66,69,73,77,80,84],{"class":38,"line":46},2,[36,48,50],{"class":49},"scz_3","const",[36,52,54],{"class":53},"sTNBD"," { ",[36,56,58],{"class":57},"s3F5K","axon",[36,60,61],{"class":53},": ",[36,63,65],{"class":64},"s9McN","barry",[36,67,68],{"class":53}," } = ",[36,70,72],{"class":71},"sYbnZ","await",[36,74,76],{"class":75},"sCudf"," Axon",[36,78,79],{"class":53},"(",[36,81,83],{"class":82},"sKc5r","\"~\u002Fagents\u002Fbarry\"",[36,85,86],{"class":53},")\n",[36,88,90],{"class":38,"line":89},3,[36,91,93],{"emptyLinePlaceholder":92},true,"\n",[36,95,97,99,102,105,107,110,112,115,117,120],{"class":38,"line":96},4,[36,98,50],{"class":49},[36,100,101],{"class":64}," summary",[36,103,104],{"class":53}," = ",[36,106,72],{"class":71},[36,108,109],{"class":57}," barry",[36,111,25],{"class":53},[36,113,114],{"class":75},"request",[36,116,79],{"class":53},[36,118,119],{"class":82},"\"summarise yesterday's commits\"",[36,121,86],{"class":53},[36,123,125,128,130,133,135,138,140,143],{"class":38,"line":124},5,[36,126,127],{"class":57},"console",[36,129,25],{"class":53},[36,131,132],{"class":75},"log",[36,134,79],{"class":53},[36,136,137],{"class":57},"summary",[36,139,25],{"class":53},[36,141,142],{"class":57},"text",[36,144,86],{"class":53},[27,146,150],{"className":147,"code":148,"language":149,"meta":32,"style":32},"language-bash shiki shiki-themes dark-plus","axon exec standup.axon.ts\n","bash",[18,151,152],{"__ignoreMap":32},[36,153,154,156,159],{"class":38,"line":39},[36,155,58],{"class":75},[36,157,158],{"class":82}," exec",[36,160,161],{"class":82}," standup.axon.ts\n",[14,163,164,165,168,169,172,173,180,181,184],{},"No agent folder, no config, no imports. ",[18,166,167],{},"Axon"," and ",[18,170,171],{},"Fleet"," are globals that\n",[174,175,177],"a",{"href":176},"\u002Fdocs\u002Fv2\u002Fcli\u002Fexec",[18,178,179],{},"axon exec"," binds for the run — a script that must run from anywhere\ncan't rely on a ",[18,182,183],{},"node_modules"," being nearby.",[186,187,189],"h2",{"id":188},"the-handle","The handle",[14,191,192,195,196,198],{},[18,193,194],{},"Axon()"," resolves an agent, boots it, and returns its runtime. ",[18,197,58],{}," is the handle;\nrename it on the way out so a script with three agents reads clearly.",[27,200,202],{"className":29,"code":201,"language":31,"meta":32,"style":32},"const { axon: barry } = await Axon(\"..\u002Fbarry\")\nconst { axon: dave }  = await Axon(\"..\u002Fdave\")\n",[18,203,204,229],{"__ignoreMap":32},[36,205,206,208,210,212,214,216,218,220,222,224,227],{"class":38,"line":39},[36,207,50],{"class":49},[36,209,54],{"class":53},[36,211,58],{"class":57},[36,213,61],{"class":53},[36,215,65],{"class":64},[36,217,68],{"class":53},[36,219,72],{"class":71},[36,221,76],{"class":75},[36,223,79],{"class":53},[36,225,226],{"class":82},"\"..\u002Fbarry\"",[36,228,86],{"class":53},[36,230,231,233,235,237,239,242,245,247,249,251,254],{"class":38,"line":46},[36,232,50],{"class":49},[36,234,54],{"class":53},[36,236,58],{"class":57},[36,238,61],{"class":53},[36,240,241],{"class":64},"dave",[36,243,244],{"class":53}," }  = ",[36,246,72],{"class":71},[36,248,76],{"class":75},[36,250,79],{"class":53},[36,252,253],{"class":82},"\"..\u002Fdave\"",[36,255,86],{"class":53},[14,257,258,259,261],{},"The handle is complete — anything you can do to a running agent, you can do here. It is\nthe same one an agent-scoped script has as its ",[18,260,58],{}," global.",[27,263,265],{"className":29,"code":264,"language":31,"meta":32,"style":32},"await barry.request(input)       \u002F\u002F run to completion → { text, entries }\nbarry.stream(input)              \u002F\u002F live entries as they arrive\nawait barry.prompt(name, vars)   \u002F\u002F render one of this agent's prompts\nawait barry.tools.ns.fn(args)    \u002F\u002F call one of this agent's tools\nbarry.session.id                 \u002F\u002F this instance's trace, and its correlation key\nbarry.on(type, handler)          \u002F\u002F observe what it emits\nawait barry.update(blueprint)    \u002F\u002F hot-reload it\nawait barry.shutdown()           \u002F\u002F tear it down\n",[18,266,267,288,307,335,367,384,410,432],{"__ignoreMap":32},[36,268,269,271,273,275,277,279,282,285],{"class":38,"line":39},[36,270,72],{"class":71},[36,272,109],{"class":57},[36,274,25],{"class":53},[36,276,114],{"class":75},[36,278,79],{"class":53},[36,280,281],{"class":57},"input",[36,283,284],{"class":53},")       ",[36,286,287],{"class":42},"\u002F\u002F run to completion → { text, entries }\n",[36,289,290,292,294,297,299,301,304],{"class":38,"line":46},[36,291,65],{"class":57},[36,293,25],{"class":53},[36,295,296],{"class":75},"stream",[36,298,79],{"class":53},[36,300,281],{"class":57},[36,302,303],{"class":53},")              ",[36,305,306],{"class":42},"\u002F\u002F live entries as they arrive\n",[36,308,309,311,313,315,318,320,323,326,329,332],{"class":38,"line":89},[36,310,72],{"class":71},[36,312,109],{"class":57},[36,314,25],{"class":53},[36,316,317],{"class":75},"prompt",[36,319,79],{"class":53},[36,321,322],{"class":57},"name",[36,324,325],{"class":53},", ",[36,327,328],{"class":57},"vars",[36,330,331],{"class":53},")   ",[36,333,334],{"class":42},"\u002F\u002F render one of this agent's prompts\n",[36,336,337,339,341,343,346,348,351,353,356,358,361,364],{"class":38,"line":96},[36,338,72],{"class":71},[36,340,109],{"class":57},[36,342,25],{"class":53},[36,344,345],{"class":57},"tools",[36,347,25],{"class":53},[36,349,350],{"class":57},"ns",[36,352,25],{"class":53},[36,354,355],{"class":75},"fn",[36,357,79],{"class":53},[36,359,360],{"class":57},"args",[36,362,363],{"class":53},")    ",[36,365,366],{"class":42},"\u002F\u002F call one of this agent's tools\n",[36,368,369,371,373,376,378,381],{"class":38,"line":124},[36,370,65],{"class":57},[36,372,25],{"class":53},[36,374,375],{"class":57},"session",[36,377,25],{"class":53},[36,379,380],{"class":57},"id",[36,382,383],{"class":42},"                 \u002F\u002F this instance's trace, and its correlation key\n",[36,385,387,389,391,394,396,399,401,404,407],{"class":38,"line":386},6,[36,388,65],{"class":57},[36,390,25],{"class":53},[36,392,393],{"class":75},"on",[36,395,79],{"class":53},[36,397,398],{"class":57},"type",[36,400,325],{"class":53},[36,402,403],{"class":57},"handler",[36,405,406],{"class":53},")          ",[36,408,409],{"class":42},"\u002F\u002F observe what it emits\n",[36,411,413,415,417,419,422,424,427,429],{"class":38,"line":412},7,[36,414,72],{"class":71},[36,416,109],{"class":57},[36,418,25],{"class":53},[36,420,421],{"class":75},"update",[36,423,79],{"class":53},[36,425,426],{"class":57},"blueprint",[36,428,363],{"class":53},[36,430,431],{"class":42},"\u002F\u002F hot-reload it\n",[36,433,435,437,439,441,444,447],{"class":38,"line":434},8,[36,436,72],{"class":71},[36,438,109],{"class":57},[36,440,25],{"class":53},[36,442,443],{"class":75},"shutdown",[36,445,446],{"class":53},"()           ",[36,448,449],{"class":42},"\u002F\u002F tear it down\n",[14,451,452],{},"That completeness is the point: a pipeline, a pool, a state machine or a graph engine is\nsomething you write over this handle, not something the platform has to provide.",[14,454,455,456,168,459,462],{},"Two handles share nothing — separate tools, policy, session, capsule, and memory.\n",[18,457,458],{},"barry.prompt(\"review\")",[18,460,461],{},"dave.prompt(\"review\")"," are different files. Results cross\nonly when you put them in a prompt.",[186,464,171],{"id":465},"fleet",[14,467,468,471],{},[18,469,470],{},"Fleet()"," boots several at once, named:",[27,473,475],{"className":29,"code":474,"language":31,"meta":32,"style":32},"const { barry, checker, zeno } = await Fleet({\n    barry:   \"..\u002Fbarry\",\n    checker: \"..\u002Fchecker\",\n    zeno:    \"@axon\u002Fzeno\",\n})\n",[18,476,477,505,516,526,536],{"__ignoreMap":32},[36,478,479,481,483,485,487,490,492,495,497,499,502],{"class":38,"line":39},[36,480,50],{"class":49},[36,482,54],{"class":53},[36,484,65],{"class":64},[36,486,325],{"class":53},[36,488,489],{"class":64},"checker",[36,491,325],{"class":53},[36,493,494],{"class":64},"zeno",[36,496,68],{"class":53},[36,498,72],{"class":71},[36,500,501],{"class":75}," Fleet",[36,503,504],{"class":53},"({\n",[36,506,507,510,513],{"class":38,"line":46},[36,508,509],{"class":57},"    barry:",[36,511,512],{"class":82},"   \"..\u002Fbarry\"",[36,514,515],{"class":53},",\n",[36,517,518,521,524],{"class":38,"line":89},[36,519,520],{"class":57},"    checker:",[36,522,523],{"class":82}," \"..\u002Fchecker\"",[36,525,515],{"class":53},[36,527,528,531,534],{"class":38,"line":96},[36,529,530],{"class":57},"    zeno:",[36,532,533],{"class":82},"    \"@axon\u002Fzeno\"",[36,535,515],{"class":53},[36,537,538],{"class":38,"line":124},[36,539,540],{"class":53},"})\n",[14,542,543],{},"It resolves every reference before booting any of them — so a typo in the fourth name\nfails before the first capsule exists — then boots them together, costing the slowest\nagent rather than the sum.",[14,545,546,547,550,551,553,554,556],{},"It is a convenience, not a layer: ",[18,548,549],{},"Promise.all"," over ",[18,552,194],{}," calls with the names\nattached. Use it when the cast is known at the top of the script. Reach for ",[18,555,194],{},"\ndirectly when it isn't — agents chosen at runtime, booted in a loop, or held by something\nyou built.",[186,558,560],{"id":559},"one-handle-is-one-conversation","One handle is one conversation",[14,562,563],{},"Consecutive calls share full context:",[27,565,567],{"className":29,"code":566,"language":31,"meta":32,"style":32},"await barry.request(\"we're refactoring the auth module\")\nawait barry.request(\"start with the token parser\")   \u002F\u002F barry remembers\n",[18,568,569,586],{"__ignoreMap":32},[36,570,571,573,575,577,579,581,584],{"class":38,"line":39},[36,572,72],{"class":71},[36,574,109],{"class":57},[36,576,25],{"class":53},[36,578,114],{"class":75},[36,580,79],{"class":53},[36,582,583],{"class":82},"\"we're refactoring the auth module\"",[36,585,86],{"class":53},[36,587,588,590,592,594,596,598,601,603],{"class":38,"line":46},[36,589,72],{"class":71},[36,591,109],{"class":57},[36,593,25],{"class":53},[36,595,114],{"class":75},[36,597,79],{"class":53},[36,599,600],{"class":82},"\"start with the token parser\"",[36,602,331],{"class":53},[36,604,605],{"class":42},"\u002F\u002F barry remembers\n",[14,607,608],{},"There is no sub-context inside an instance — no threads, no named conversations.\nIsolation comes from booting another instance, which is a real boundary rather than a\npartition inside one. To reset an agent, shut it down and boot it again.",[14,610,611,612,616,617,620],{},"Two names may point at one folder, and sometimes that is what you want — two independent\nconversations with the same agent. It boots twice, which is cheap for a request-response\nagent and the way to fan work out. Two caveats: ",[613,614,615],"strong",{},"module setup runs per instance",", so an\nagent holding an external connection opens two of them, and ",[613,618,619],{},"continuous-mode agents are\nnot cheap"," — one running a live cognitive loop works whether or not you are talking to\nit.",[186,622,624],{"id":623},"knowing-when-to-split","Knowing when to split",[14,626,627],{},"Two questions decide whether work belongs to one agent or several.",[14,629,630],{},[613,631,632],{},"Does the second step need to be uncontaminated by the first?",[27,634,636],{"className":29,"code":635,"language":31,"meta":32,"style":32},"const review = await barry.request(\"review the changes on this branch\")\n\nconst verdict = await checker.request(\n    `A reviewer produced the following. Is it fair, specific, and actionable?\\n\\n${review.text}`,\n)\n",[18,637,638,662,666,687,714],{"__ignoreMap":32},[36,639,640,642,645,647,649,651,653,655,657,660],{"class":38,"line":39},[36,641,50],{"class":49},[36,643,644],{"class":64}," review",[36,646,104],{"class":53},[36,648,72],{"class":71},[36,650,109],{"class":57},[36,652,25],{"class":53},[36,654,114],{"class":75},[36,656,79],{"class":53},[36,658,659],{"class":82},"\"review the changes on this branch\"",[36,661,86],{"class":53},[36,663,664],{"class":38,"line":46},[36,665,93],{"emptyLinePlaceholder":92},[36,667,668,670,673,675,677,680,682,684],{"class":38,"line":89},[36,669,50],{"class":49},[36,671,672],{"class":64}," verdict",[36,674,104],{"class":53},[36,676,72],{"class":71},[36,678,679],{"class":57}," checker",[36,681,25],{"class":53},[36,683,114],{"class":75},[36,685,686],{"class":53},"(\n",[36,688,689,692,696,699,702,704,706,709,712],{"class":38,"line":96},[36,690,691],{"class":82},"    `A reviewer produced the following. Is it fair, specific, and actionable?",[36,693,695],{"class":694},"svVle","\\n\\n",[36,697,698],{"class":49},"${",[36,700,701],{"class":57},"review",[36,703,25],{"class":53},[36,705,142],{"class":57},[36,707,708],{"class":49},"}",[36,710,711],{"class":82},"`",[36,713,515],{"class":53},[36,715,716],{"class":38,"line":124},[36,717,86],{"class":53},[14,719,720,721,723],{},"The check is worth something precisely because ",[18,722,489],{}," never saw the diff, the tool\ncalls, or the reasoning — only the output. An agent grading its own work grades a\nconclusion it is already committed to.",[14,725,726,729],{},[613,727,728],{},"Do the steps need different permissions or different tools?"," An agent that reads the\ncodebase and an agent that opens pull requests should not be the same agent. Policy is\nper-agent, so splitting is how you narrow what each part can reach.",[14,731,732],{},"If neither applies, one agent and consecutive calls is the simpler program — and it keeps\ncontext across the steps, which is usually what you want.",[186,734,736],{"id":735},"independent-work-runs-at-once","Independent work runs at once",[27,738,740],{"className":29,"code":739,"language":31,"meta":32,"style":32},"const [sec, prf] = await Promise.all([\n    security.request(\"audit this service for vulnerabilities\"),\n    perf.request(\"profile this service and find the hot paths\"),\n])\n\nconst plan = await lead.request(\n    `Two audits completed.\\n\\nSecurity:\\n${sec.text}\\n\\nPerformance:\\n${prf.text}\\n\\n` +\n    `Produce a single prioritised plan. Call out anything where the two conflict.`,\n)\n",[18,741,742,774,791,807,812,816,836,883,890],{"__ignoreMap":32},[36,743,744,746,749,752,754,757,760,762,766,768,771],{"class":38,"line":39},[36,745,50],{"class":49},[36,747,748],{"class":53}," [",[36,750,751],{"class":64},"sec",[36,753,325],{"class":53},[36,755,756],{"class":64},"prf",[36,758,759],{"class":53},"] = ",[36,761,72],{"class":71},[36,763,765],{"class":764},"sNl3T"," Promise",[36,767,25],{"class":53},[36,769,770],{"class":75},"all",[36,772,773],{"class":53},"([\n",[36,775,776,779,781,783,785,788],{"class":38,"line":46},[36,777,778],{"class":57},"    security",[36,780,25],{"class":53},[36,782,114],{"class":75},[36,784,79],{"class":53},[36,786,787],{"class":82},"\"audit this service for vulnerabilities\"",[36,789,790],{"class":53},"),\n",[36,792,793,796,798,800,802,805],{"class":38,"line":89},[36,794,795],{"class":57},"    perf",[36,797,25],{"class":53},[36,799,114],{"class":75},[36,801,79],{"class":53},[36,803,804],{"class":82},"\"profile this service and find the hot paths\"",[36,806,790],{"class":53},[36,808,809],{"class":38,"line":96},[36,810,811],{"class":53},"])\n",[36,813,814],{"class":38,"line":124},[36,815,93],{"emptyLinePlaceholder":92},[36,817,818,820,823,825,827,830,832,834],{"class":38,"line":386},[36,819,50],{"class":49},[36,821,822],{"class":64}," plan",[36,824,104],{"class":53},[36,826,72],{"class":71},[36,828,829],{"class":57}," lead",[36,831,25],{"class":53},[36,833,114],{"class":75},[36,835,686],{"class":53},[36,837,838,841,843,846,849,851,853,855,857,859,861,864,866,868,870,872,874,876,878,880],{"class":38,"line":412},[36,839,840],{"class":82},"    `Two audits completed.",[36,842,695],{"class":694},[36,844,845],{"class":82},"Security:",[36,847,848],{"class":694},"\\n",[36,850,698],{"class":49},[36,852,751],{"class":57},[36,854,25],{"class":53},[36,856,142],{"class":57},[36,858,708],{"class":49},[36,860,695],{"class":694},[36,862,863],{"class":82},"Performance:",[36,865,848],{"class":694},[36,867,698],{"class":49},[36,869,756],{"class":57},[36,871,25],{"class":53},[36,873,142],{"class":57},[36,875,708],{"class":49},[36,877,695],{"class":694},[36,879,711],{"class":82},[36,881,882],{"class":53}," +\n",[36,884,885,888],{"class":38,"line":434},[36,886,887],{"class":82},"    `Produce a single prioritised plan. Call out anything where the two conflict.`",[36,889,515],{"class":53},[36,891,893],{"class":38,"line":892},9,[36,894,86],{"class":53},[14,896,897,900],{},[18,898,899],{},"lead"," sees two finished analyses rather than two agents' worth of intermediate work,\nwhich is what makes the synthesis useful rather than overwhelming.",[14,902,903],{},"An agent is not obligatory, either. Fetch and transform with plain TypeScript; bring in an\nagent for the step that needs judgment, and exit before booting anything when there is\nnothing to do.",[186,905,907],{"id":906},"arguments","Arguments",[14,909,910,911,914],{},"Everything after the file arrives as ",[18,912,913],{},"process.argv",":",[27,916,918],{"className":147,"code":917,"language":149,"meta":32,"style":32},"axon exec review.axon.ts --file src\u002Findex.ts\n",[18,919,920],{"__ignoreMap":32},[36,921,922,924,926,929,932],{"class":38,"line":39},[36,923,58],{"class":75},[36,925,158],{"class":82},[36,927,928],{"class":82}," review.axon.ts",[36,930,931],{"class":49}," --file",[36,933,934],{"class":82}," src\u002Findex.ts\n",[14,936,937,938,941],{},"There is no ",[18,939,940],{},"defineArgs"," — that belongs to agent-scoped scripts, where the runtime parses\narguments before invoking them. A global script is started by a shell and reads its\narguments like one.",[186,943,945],{"id":944},"agent-scoped-scripts","Agent-scoped scripts",[14,947,948,949,952,953,957,958,325,960,962],{},"A script in ",[18,950,951],{},"src\u002Fscripts\u002F"," is the other kind. It runs ",[954,955,956],"em",{},"inside"," an agent that is already\nbooted, so it gets ",[18,959,58],{},[18,961,360],{}," and its tools as globals and owns no lifetime.",[27,964,966],{"className":29,"code":965,"language":31,"meta":32,"style":32},"\u002F\u002F src\u002Fscripts\u002Freview.ts — inside an agent\nconst content = await axon.tools.fs.readFile(file)\nconst { stream } = axon.stream({ prompt: await axon.prompt(\"review\", { file, content }) })\n",[18,967,968,973,1008],{"__ignoreMap":32},[36,969,970],{"class":38,"line":39},[36,971,972],{"class":42},"\u002F\u002F src\u002Fscripts\u002Freview.ts — inside an agent\n",[36,974,975,977,980,982,984,987,989,991,993,996,998,1001,1003,1006],{"class":38,"line":46},[36,976,50],{"class":49},[36,978,979],{"class":64}," content",[36,981,104],{"class":53},[36,983,72],{"class":71},[36,985,986],{"class":57}," axon",[36,988,25],{"class":53},[36,990,345],{"class":57},[36,992,25],{"class":53},[36,994,995],{"class":57},"fs",[36,997,25],{"class":53},[36,999,1000],{"class":75},"readFile",[36,1002,79],{"class":53},[36,1004,1005],{"class":57},"file",[36,1007,86],{"class":53},[36,1009,1010,1012,1014,1016,1018,1020,1022,1024,1027,1030,1033,1035,1037,1039,1041,1044,1047,1049,1051,1054],{"class":38,"line":89},[36,1011,50],{"class":49},[36,1013,54],{"class":53},[36,1015,296],{"class":64},[36,1017,68],{"class":53},[36,1019,58],{"class":57},[36,1021,25],{"class":53},[36,1023,296],{"class":75},[36,1025,1026],{"class":53},"({ ",[36,1028,1029],{"class":57},"prompt:",[36,1031,1032],{"class":71}," await",[36,1034,986],{"class":57},[36,1036,25],{"class":53},[36,1038,317],{"class":75},[36,1040,79],{"class":53},[36,1042,1043],{"class":82},"\"review\"",[36,1045,1046],{"class":53},", { ",[36,1048,1005],{"class":57},[36,1050,325],{"class":53},[36,1052,1053],{"class":57},"content",[36,1055,1056],{"class":53}," }) })\n",[14,1058,1059,1060,1062,1063],{},"The bodies are otherwise identical — ",[18,1061,65],{}," is the same handle with a name you chose. The\nquestion that picks between them is one sentence: ",[613,1064,1065],{},"does this need more than one agent?",[14,1067,1068,1071,1072,1074],{},[18,1069,1070],{},"await Axon()"," with no argument works in both. In a global script it walks up from the\nfile and boots what it finds; inside ",[18,1073,951],{}," it returns the already-running\ninstance. Useful when a script wants boot to be explicit — do work first, exit early, and\nonly then pay for an agent.",[1076,1077],"hr",{},[14,1079,1080,1081,1085],{},"Next: ",[174,1082,1084],{"href":1083},"\u002Fdocs\u002Fv2\u002Ffleet\u002Flifecycle","Lifecycle"," — resolution, teardown, and what survives.",[1087,1088,1089],"style",{},"html pre.shiki code .sOLPB, html code.shiki .sOLPB{--shiki-default:#6A9955}html pre.shiki code .scz_3, html code.shiki .scz_3{--shiki-default:#569CD6}html pre.shiki code .sTNBD, html code.shiki .sTNBD{--shiki-default:#D4D4D4}html pre.shiki code .s3F5K, html code.shiki .s3F5K{--shiki-default:#9CDCFE}html pre.shiki code .s9McN, html code.shiki .s9McN{--shiki-default:#4FC1FF}html pre.shiki code .sYbnZ, html code.shiki .sYbnZ{--shiki-default:#C586C0}html pre.shiki code .sCudf, html code.shiki .sCudf{--shiki-default:#DCDCAA}html pre.shiki code .sKc5r, html code.shiki .sKc5r{--shiki-default:#CE9178}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 .svVle, html code.shiki .svVle{--shiki-default:#D7BA7D}html pre.shiki code .sNl3T, html code.shiki .sNl3T{--shiki-default:#4EC9B0}",{"title":32,"searchDepth":46,"depth":46,"links":1091},[1092,1093,1094,1095,1096,1097,1098],{"id":188,"depth":46,"text":189},{"id":465,"depth":46,"text":171},{"id":559,"depth":46,"text":560},{"id":623,"depth":46,"text":624},{"id":735,"depth":46,"text":736},{"id":906,"depth":46,"text":907},{"id":944,"depth":46,"text":945},"A file ending .axon.ts is a global script — an ordinary TypeScript program that boots\nits own agents. It lives wherever you put it: a repo root, a scratch directory, ~\u002Fbin.","md",{},"\u002Fdocs\u002Fv2\u002Ffleet\u002Fcode",{"title":5,"description":1099},"docs\u002Fv2\u002Ffleet\u002Fcode","jY6akTE-4y8GfQ4bpWlNl_coC3Xf3L3-LifgUA4aHoQ",1786104361089]