openapi.json 300 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849
  1. {
  2. "openapi": "3.1.1",
  3. "info": {
  4. "title": "opencode",
  5. "description": "opencode api",
  6. "version": "1.0.0"
  7. },
  8. "paths": {
  9. "/global/health": {
  10. "get": {
  11. "operationId": "global.health",
  12. "summary": "Get health",
  13. "description": "Get health information about the OpenCode server.",
  14. "responses": {
  15. "200": {
  16. "description": "Health information",
  17. "content": {
  18. "application/json": {
  19. "schema": {
  20. "type": "object",
  21. "properties": {
  22. "healthy": {
  23. "type": "boolean",
  24. "const": true
  25. },
  26. "version": {
  27. "type": "string"
  28. }
  29. },
  30. "required": ["healthy", "version"]
  31. }
  32. }
  33. }
  34. }
  35. },
  36. "x-codeSamples": [
  37. {
  38. "lang": "js",
  39. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  40. }
  41. ]
  42. }
  43. },
  44. "/global/event": {
  45. "get": {
  46. "operationId": "global.event",
  47. "summary": "Get global events",
  48. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  49. "responses": {
  50. "200": {
  51. "description": "Event stream",
  52. "content": {
  53. "text/event-stream": {
  54. "schema": {
  55. "$ref": "#/components/schemas/GlobalEvent"
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "x-codeSamples": [
  62. {
  63. "lang": "js",
  64. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  65. }
  66. ]
  67. }
  68. },
  69. "/global/dispose": {
  70. "post": {
  71. "operationId": "global.dispose",
  72. "summary": "Dispose instance",
  73. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  74. "responses": {
  75. "200": {
  76. "description": "Global disposed",
  77. "content": {
  78. "application/json": {
  79. "schema": {
  80. "type": "boolean"
  81. }
  82. }
  83. }
  84. }
  85. },
  86. "x-codeSamples": [
  87. {
  88. "lang": "js",
  89. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  90. }
  91. ]
  92. }
  93. },
  94. "/project": {
  95. "get": {
  96. "operationId": "project.list",
  97. "parameters": [
  98. {
  99. "in": "query",
  100. "name": "directory",
  101. "schema": {
  102. "type": "string"
  103. }
  104. }
  105. ],
  106. "summary": "List all projects",
  107. "description": "Get a list of projects that have been opened with OpenCode.",
  108. "responses": {
  109. "200": {
  110. "description": "List of projects",
  111. "content": {
  112. "application/json": {
  113. "schema": {
  114. "type": "array",
  115. "items": {
  116. "$ref": "#/components/schemas/Project"
  117. }
  118. }
  119. }
  120. }
  121. }
  122. },
  123. "x-codeSamples": [
  124. {
  125. "lang": "js",
  126. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  127. }
  128. ]
  129. }
  130. },
  131. "/project/current": {
  132. "get": {
  133. "operationId": "project.current",
  134. "parameters": [
  135. {
  136. "in": "query",
  137. "name": "directory",
  138. "schema": {
  139. "type": "string"
  140. }
  141. }
  142. ],
  143. "summary": "Get current project",
  144. "description": "Retrieve the currently active project that OpenCode is working with.",
  145. "responses": {
  146. "200": {
  147. "description": "Current project information",
  148. "content": {
  149. "application/json": {
  150. "schema": {
  151. "$ref": "#/components/schemas/Project"
  152. }
  153. }
  154. }
  155. }
  156. },
  157. "x-codeSamples": [
  158. {
  159. "lang": "js",
  160. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  161. }
  162. ]
  163. }
  164. },
  165. "/project/{projectID}": {
  166. "patch": {
  167. "operationId": "project.update",
  168. "parameters": [
  169. {
  170. "in": "query",
  171. "name": "directory",
  172. "schema": {
  173. "type": "string"
  174. }
  175. },
  176. {
  177. "in": "path",
  178. "name": "projectID",
  179. "schema": {
  180. "type": "string"
  181. },
  182. "required": true
  183. }
  184. ],
  185. "summary": "Update project",
  186. "description": "Update project properties such as name, icon, and commands.",
  187. "responses": {
  188. "200": {
  189. "description": "Updated project information",
  190. "content": {
  191. "application/json": {
  192. "schema": {
  193. "$ref": "#/components/schemas/Project"
  194. }
  195. }
  196. }
  197. },
  198. "400": {
  199. "description": "Bad request",
  200. "content": {
  201. "application/json": {
  202. "schema": {
  203. "$ref": "#/components/schemas/BadRequestError"
  204. }
  205. }
  206. }
  207. },
  208. "404": {
  209. "description": "Not found",
  210. "content": {
  211. "application/json": {
  212. "schema": {
  213. "$ref": "#/components/schemas/NotFoundError"
  214. }
  215. }
  216. }
  217. }
  218. },
  219. "requestBody": {
  220. "content": {
  221. "application/json": {
  222. "schema": {
  223. "type": "object",
  224. "properties": {
  225. "name": {
  226. "type": "string"
  227. },
  228. "icon": {
  229. "type": "object",
  230. "properties": {
  231. "url": {
  232. "type": "string"
  233. },
  234. "override": {
  235. "type": "string"
  236. },
  237. "color": {
  238. "type": "string"
  239. }
  240. }
  241. },
  242. "commands": {
  243. "type": "object",
  244. "properties": {
  245. "start": {
  246. "description": "Startup script to run when creating a new workspace (worktree)",
  247. "type": "string"
  248. }
  249. }
  250. }
  251. }
  252. }
  253. }
  254. }
  255. },
  256. "x-codeSamples": [
  257. {
  258. "lang": "js",
  259. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  260. }
  261. ]
  262. }
  263. },
  264. "/pty": {
  265. "get": {
  266. "operationId": "pty.list",
  267. "parameters": [
  268. {
  269. "in": "query",
  270. "name": "directory",
  271. "schema": {
  272. "type": "string"
  273. }
  274. }
  275. ],
  276. "summary": "List PTY sessions",
  277. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  278. "responses": {
  279. "200": {
  280. "description": "List of sessions",
  281. "content": {
  282. "application/json": {
  283. "schema": {
  284. "type": "array",
  285. "items": {
  286. "$ref": "#/components/schemas/Pty"
  287. }
  288. }
  289. }
  290. }
  291. }
  292. },
  293. "x-codeSamples": [
  294. {
  295. "lang": "js",
  296. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  297. }
  298. ]
  299. },
  300. "post": {
  301. "operationId": "pty.create",
  302. "parameters": [
  303. {
  304. "in": "query",
  305. "name": "directory",
  306. "schema": {
  307. "type": "string"
  308. }
  309. }
  310. ],
  311. "summary": "Create PTY session",
  312. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  313. "responses": {
  314. "200": {
  315. "description": "Created session",
  316. "content": {
  317. "application/json": {
  318. "schema": {
  319. "$ref": "#/components/schemas/Pty"
  320. }
  321. }
  322. }
  323. },
  324. "400": {
  325. "description": "Bad request",
  326. "content": {
  327. "application/json": {
  328. "schema": {
  329. "$ref": "#/components/schemas/BadRequestError"
  330. }
  331. }
  332. }
  333. }
  334. },
  335. "requestBody": {
  336. "content": {
  337. "application/json": {
  338. "schema": {
  339. "type": "object",
  340. "properties": {
  341. "command": {
  342. "type": "string"
  343. },
  344. "args": {
  345. "type": "array",
  346. "items": {
  347. "type": "string"
  348. }
  349. },
  350. "cwd": {
  351. "type": "string"
  352. },
  353. "title": {
  354. "type": "string"
  355. },
  356. "env": {
  357. "type": "object",
  358. "propertyNames": {
  359. "type": "string"
  360. },
  361. "additionalProperties": {
  362. "type": "string"
  363. }
  364. }
  365. }
  366. }
  367. }
  368. }
  369. },
  370. "x-codeSamples": [
  371. {
  372. "lang": "js",
  373. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  374. }
  375. ]
  376. }
  377. },
  378. "/pty/{ptyID}": {
  379. "get": {
  380. "operationId": "pty.get",
  381. "parameters": [
  382. {
  383. "in": "query",
  384. "name": "directory",
  385. "schema": {
  386. "type": "string"
  387. }
  388. },
  389. {
  390. "in": "path",
  391. "name": "ptyID",
  392. "schema": {
  393. "type": "string"
  394. },
  395. "required": true
  396. }
  397. ],
  398. "summary": "Get PTY session",
  399. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  400. "responses": {
  401. "200": {
  402. "description": "Session info",
  403. "content": {
  404. "application/json": {
  405. "schema": {
  406. "$ref": "#/components/schemas/Pty"
  407. }
  408. }
  409. }
  410. },
  411. "404": {
  412. "description": "Not found",
  413. "content": {
  414. "application/json": {
  415. "schema": {
  416. "$ref": "#/components/schemas/NotFoundError"
  417. }
  418. }
  419. }
  420. }
  421. },
  422. "x-codeSamples": [
  423. {
  424. "lang": "js",
  425. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  426. }
  427. ]
  428. },
  429. "put": {
  430. "operationId": "pty.update",
  431. "parameters": [
  432. {
  433. "in": "query",
  434. "name": "directory",
  435. "schema": {
  436. "type": "string"
  437. }
  438. },
  439. {
  440. "in": "path",
  441. "name": "ptyID",
  442. "schema": {
  443. "type": "string"
  444. },
  445. "required": true
  446. }
  447. ],
  448. "summary": "Update PTY session",
  449. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  450. "responses": {
  451. "200": {
  452. "description": "Updated session",
  453. "content": {
  454. "application/json": {
  455. "schema": {
  456. "$ref": "#/components/schemas/Pty"
  457. }
  458. }
  459. }
  460. },
  461. "400": {
  462. "description": "Bad request",
  463. "content": {
  464. "application/json": {
  465. "schema": {
  466. "$ref": "#/components/schemas/BadRequestError"
  467. }
  468. }
  469. }
  470. }
  471. },
  472. "requestBody": {
  473. "content": {
  474. "application/json": {
  475. "schema": {
  476. "type": "object",
  477. "properties": {
  478. "title": {
  479. "type": "string"
  480. },
  481. "size": {
  482. "type": "object",
  483. "properties": {
  484. "rows": {
  485. "type": "number"
  486. },
  487. "cols": {
  488. "type": "number"
  489. }
  490. },
  491. "required": ["rows", "cols"]
  492. }
  493. }
  494. }
  495. }
  496. }
  497. },
  498. "x-codeSamples": [
  499. {
  500. "lang": "js",
  501. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  502. }
  503. ]
  504. },
  505. "delete": {
  506. "operationId": "pty.remove",
  507. "parameters": [
  508. {
  509. "in": "query",
  510. "name": "directory",
  511. "schema": {
  512. "type": "string"
  513. }
  514. },
  515. {
  516. "in": "path",
  517. "name": "ptyID",
  518. "schema": {
  519. "type": "string"
  520. },
  521. "required": true
  522. }
  523. ],
  524. "summary": "Remove PTY session",
  525. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  526. "responses": {
  527. "200": {
  528. "description": "Session removed",
  529. "content": {
  530. "application/json": {
  531. "schema": {
  532. "type": "boolean"
  533. }
  534. }
  535. }
  536. },
  537. "404": {
  538. "description": "Not found",
  539. "content": {
  540. "application/json": {
  541. "schema": {
  542. "$ref": "#/components/schemas/NotFoundError"
  543. }
  544. }
  545. }
  546. }
  547. },
  548. "x-codeSamples": [
  549. {
  550. "lang": "js",
  551. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  552. }
  553. ]
  554. }
  555. },
  556. "/pty/{ptyID}/connect": {
  557. "get": {
  558. "operationId": "pty.connect",
  559. "parameters": [
  560. {
  561. "in": "query",
  562. "name": "directory",
  563. "schema": {
  564. "type": "string"
  565. }
  566. },
  567. {
  568. "in": "path",
  569. "name": "ptyID",
  570. "schema": {
  571. "type": "string"
  572. },
  573. "required": true
  574. }
  575. ],
  576. "summary": "Connect to PTY session",
  577. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  578. "responses": {
  579. "200": {
  580. "description": "Connected session",
  581. "content": {
  582. "application/json": {
  583. "schema": {
  584. "type": "boolean"
  585. }
  586. }
  587. }
  588. },
  589. "404": {
  590. "description": "Not found",
  591. "content": {
  592. "application/json": {
  593. "schema": {
  594. "$ref": "#/components/schemas/NotFoundError"
  595. }
  596. }
  597. }
  598. }
  599. },
  600. "x-codeSamples": [
  601. {
  602. "lang": "js",
  603. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  604. }
  605. ]
  606. }
  607. },
  608. "/config": {
  609. "get": {
  610. "operationId": "config.get",
  611. "parameters": [
  612. {
  613. "in": "query",
  614. "name": "directory",
  615. "schema": {
  616. "type": "string"
  617. }
  618. }
  619. ],
  620. "summary": "Get configuration",
  621. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  622. "responses": {
  623. "200": {
  624. "description": "Get config info",
  625. "content": {
  626. "application/json": {
  627. "schema": {
  628. "$ref": "#/components/schemas/Config"
  629. }
  630. }
  631. }
  632. }
  633. },
  634. "x-codeSamples": [
  635. {
  636. "lang": "js",
  637. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  638. }
  639. ]
  640. },
  641. "patch": {
  642. "operationId": "config.update",
  643. "parameters": [
  644. {
  645. "in": "query",
  646. "name": "directory",
  647. "schema": {
  648. "type": "string"
  649. }
  650. }
  651. ],
  652. "summary": "Update configuration",
  653. "description": "Update OpenCode configuration settings and preferences.",
  654. "responses": {
  655. "200": {
  656. "description": "Successfully updated config",
  657. "content": {
  658. "application/json": {
  659. "schema": {
  660. "$ref": "#/components/schemas/Config"
  661. }
  662. }
  663. }
  664. },
  665. "400": {
  666. "description": "Bad request",
  667. "content": {
  668. "application/json": {
  669. "schema": {
  670. "$ref": "#/components/schemas/BadRequestError"
  671. }
  672. }
  673. }
  674. }
  675. },
  676. "requestBody": {
  677. "content": {
  678. "application/json": {
  679. "schema": {
  680. "$ref": "#/components/schemas/Config"
  681. }
  682. }
  683. }
  684. },
  685. "x-codeSamples": [
  686. {
  687. "lang": "js",
  688. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  689. }
  690. ]
  691. }
  692. },
  693. "/config/providers": {
  694. "get": {
  695. "operationId": "config.providers",
  696. "parameters": [
  697. {
  698. "in": "query",
  699. "name": "directory",
  700. "schema": {
  701. "type": "string"
  702. }
  703. }
  704. ],
  705. "summary": "List config providers",
  706. "description": "Get a list of all configured AI providers and their default models.",
  707. "responses": {
  708. "200": {
  709. "description": "List of providers",
  710. "content": {
  711. "application/json": {
  712. "schema": {
  713. "type": "object",
  714. "properties": {
  715. "providers": {
  716. "type": "array",
  717. "items": {
  718. "$ref": "#/components/schemas/Provider"
  719. }
  720. },
  721. "default": {
  722. "type": "object",
  723. "propertyNames": {
  724. "type": "string"
  725. },
  726. "additionalProperties": {
  727. "type": "string"
  728. }
  729. }
  730. },
  731. "required": ["providers", "default"]
  732. }
  733. }
  734. }
  735. }
  736. },
  737. "x-codeSamples": [
  738. {
  739. "lang": "js",
  740. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  741. }
  742. ]
  743. }
  744. },
  745. "/experimental/tool/ids": {
  746. "get": {
  747. "operationId": "tool.ids",
  748. "parameters": [
  749. {
  750. "in": "query",
  751. "name": "directory",
  752. "schema": {
  753. "type": "string"
  754. }
  755. }
  756. ],
  757. "summary": "List tool IDs",
  758. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  759. "responses": {
  760. "200": {
  761. "description": "Tool IDs",
  762. "content": {
  763. "application/json": {
  764. "schema": {
  765. "$ref": "#/components/schemas/ToolIDs"
  766. }
  767. }
  768. }
  769. },
  770. "400": {
  771. "description": "Bad request",
  772. "content": {
  773. "application/json": {
  774. "schema": {
  775. "$ref": "#/components/schemas/BadRequestError"
  776. }
  777. }
  778. }
  779. }
  780. },
  781. "x-codeSamples": [
  782. {
  783. "lang": "js",
  784. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  785. }
  786. ]
  787. }
  788. },
  789. "/experimental/tool": {
  790. "get": {
  791. "operationId": "tool.list",
  792. "parameters": [
  793. {
  794. "in": "query",
  795. "name": "directory",
  796. "schema": {
  797. "type": "string"
  798. }
  799. },
  800. {
  801. "in": "query",
  802. "name": "provider",
  803. "schema": {
  804. "type": "string"
  805. },
  806. "required": true
  807. },
  808. {
  809. "in": "query",
  810. "name": "model",
  811. "schema": {
  812. "type": "string"
  813. },
  814. "required": true
  815. }
  816. ],
  817. "summary": "List tools",
  818. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  819. "responses": {
  820. "200": {
  821. "description": "Tools",
  822. "content": {
  823. "application/json": {
  824. "schema": {
  825. "$ref": "#/components/schemas/ToolList"
  826. }
  827. }
  828. }
  829. },
  830. "400": {
  831. "description": "Bad request",
  832. "content": {
  833. "application/json": {
  834. "schema": {
  835. "$ref": "#/components/schemas/BadRequestError"
  836. }
  837. }
  838. }
  839. }
  840. },
  841. "x-codeSamples": [
  842. {
  843. "lang": "js",
  844. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  845. }
  846. ]
  847. }
  848. },
  849. "/experimental/worktree": {
  850. "post": {
  851. "operationId": "worktree.create",
  852. "parameters": [
  853. {
  854. "in": "query",
  855. "name": "directory",
  856. "schema": {
  857. "type": "string"
  858. }
  859. }
  860. ],
  861. "summary": "Create worktree",
  862. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  863. "responses": {
  864. "200": {
  865. "description": "Worktree created",
  866. "content": {
  867. "application/json": {
  868. "schema": {
  869. "$ref": "#/components/schemas/Worktree"
  870. }
  871. }
  872. }
  873. },
  874. "400": {
  875. "description": "Bad request",
  876. "content": {
  877. "application/json": {
  878. "schema": {
  879. "$ref": "#/components/schemas/BadRequestError"
  880. }
  881. }
  882. }
  883. }
  884. },
  885. "requestBody": {
  886. "content": {
  887. "application/json": {
  888. "schema": {
  889. "$ref": "#/components/schemas/WorktreeCreateInput"
  890. }
  891. }
  892. }
  893. },
  894. "x-codeSamples": [
  895. {
  896. "lang": "js",
  897. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  898. }
  899. ]
  900. },
  901. "get": {
  902. "operationId": "worktree.list",
  903. "parameters": [
  904. {
  905. "in": "query",
  906. "name": "directory",
  907. "schema": {
  908. "type": "string"
  909. }
  910. }
  911. ],
  912. "summary": "List worktrees",
  913. "description": "List all sandbox worktrees for the current project.",
  914. "responses": {
  915. "200": {
  916. "description": "List of worktree directories",
  917. "content": {
  918. "application/json": {
  919. "schema": {
  920. "type": "array",
  921. "items": {
  922. "type": "string"
  923. }
  924. }
  925. }
  926. }
  927. }
  928. },
  929. "x-codeSamples": [
  930. {
  931. "lang": "js",
  932. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  933. }
  934. ]
  935. },
  936. "delete": {
  937. "operationId": "worktree.remove",
  938. "parameters": [
  939. {
  940. "in": "query",
  941. "name": "directory",
  942. "schema": {
  943. "type": "string"
  944. }
  945. }
  946. ],
  947. "summary": "Remove worktree",
  948. "description": "Remove a git worktree and delete its branch.",
  949. "responses": {
  950. "200": {
  951. "description": "Worktree removed",
  952. "content": {
  953. "application/json": {
  954. "schema": {
  955. "type": "boolean"
  956. }
  957. }
  958. }
  959. },
  960. "400": {
  961. "description": "Bad request",
  962. "content": {
  963. "application/json": {
  964. "schema": {
  965. "$ref": "#/components/schemas/BadRequestError"
  966. }
  967. }
  968. }
  969. }
  970. },
  971. "requestBody": {
  972. "content": {
  973. "application/json": {
  974. "schema": {
  975. "$ref": "#/components/schemas/WorktreeRemoveInput"
  976. }
  977. }
  978. }
  979. },
  980. "x-codeSamples": [
  981. {
  982. "lang": "js",
  983. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  984. }
  985. ]
  986. }
  987. },
  988. "/experimental/worktree/reset": {
  989. "post": {
  990. "operationId": "worktree.reset",
  991. "parameters": [
  992. {
  993. "in": "query",
  994. "name": "directory",
  995. "schema": {
  996. "type": "string"
  997. }
  998. }
  999. ],
  1000. "summary": "Reset worktree",
  1001. "description": "Reset a worktree branch to the primary default branch.",
  1002. "responses": {
  1003. "200": {
  1004. "description": "Worktree reset",
  1005. "content": {
  1006. "application/json": {
  1007. "schema": {
  1008. "type": "boolean"
  1009. }
  1010. }
  1011. }
  1012. },
  1013. "400": {
  1014. "description": "Bad request",
  1015. "content": {
  1016. "application/json": {
  1017. "schema": {
  1018. "$ref": "#/components/schemas/BadRequestError"
  1019. }
  1020. }
  1021. }
  1022. }
  1023. },
  1024. "requestBody": {
  1025. "content": {
  1026. "application/json": {
  1027. "schema": {
  1028. "$ref": "#/components/schemas/WorktreeResetInput"
  1029. }
  1030. }
  1031. }
  1032. },
  1033. "x-codeSamples": [
  1034. {
  1035. "lang": "js",
  1036. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  1037. }
  1038. ]
  1039. }
  1040. },
  1041. "/experimental/resource": {
  1042. "get": {
  1043. "operationId": "experimental.resource.list",
  1044. "parameters": [
  1045. {
  1046. "in": "query",
  1047. "name": "directory",
  1048. "schema": {
  1049. "type": "string"
  1050. }
  1051. }
  1052. ],
  1053. "summary": "Get MCP resources",
  1054. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  1055. "responses": {
  1056. "200": {
  1057. "description": "MCP resources",
  1058. "content": {
  1059. "application/json": {
  1060. "schema": {
  1061. "type": "object",
  1062. "propertyNames": {
  1063. "type": "string"
  1064. },
  1065. "additionalProperties": {
  1066. "$ref": "#/components/schemas/McpResource"
  1067. }
  1068. }
  1069. }
  1070. }
  1071. }
  1072. },
  1073. "x-codeSamples": [
  1074. {
  1075. "lang": "js",
  1076. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  1077. }
  1078. ]
  1079. }
  1080. },
  1081. "/session": {
  1082. "get": {
  1083. "operationId": "session.list",
  1084. "parameters": [
  1085. {
  1086. "in": "query",
  1087. "name": "directory",
  1088. "schema": {
  1089. "type": "string"
  1090. },
  1091. "description": "Filter sessions by project directory"
  1092. },
  1093. {
  1094. "in": "query",
  1095. "name": "roots",
  1096. "schema": {
  1097. "type": "boolean"
  1098. },
  1099. "description": "Only return root sessions (no parentID)"
  1100. },
  1101. {
  1102. "in": "query",
  1103. "name": "start",
  1104. "schema": {
  1105. "type": "number"
  1106. },
  1107. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  1108. },
  1109. {
  1110. "in": "query",
  1111. "name": "search",
  1112. "schema": {
  1113. "type": "string"
  1114. },
  1115. "description": "Filter sessions by title (case-insensitive)"
  1116. },
  1117. {
  1118. "in": "query",
  1119. "name": "limit",
  1120. "schema": {
  1121. "type": "number"
  1122. },
  1123. "description": "Maximum number of sessions to return"
  1124. }
  1125. ],
  1126. "summary": "List sessions",
  1127. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  1128. "responses": {
  1129. "200": {
  1130. "description": "List of sessions",
  1131. "content": {
  1132. "application/json": {
  1133. "schema": {
  1134. "type": "array",
  1135. "items": {
  1136. "$ref": "#/components/schemas/Session"
  1137. }
  1138. }
  1139. }
  1140. }
  1141. }
  1142. },
  1143. "x-codeSamples": [
  1144. {
  1145. "lang": "js",
  1146. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  1147. }
  1148. ]
  1149. },
  1150. "post": {
  1151. "operationId": "session.create",
  1152. "parameters": [
  1153. {
  1154. "in": "query",
  1155. "name": "directory",
  1156. "schema": {
  1157. "type": "string"
  1158. }
  1159. }
  1160. ],
  1161. "summary": "Create session",
  1162. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  1163. "responses": {
  1164. "200": {
  1165. "description": "Successfully created session",
  1166. "content": {
  1167. "application/json": {
  1168. "schema": {
  1169. "$ref": "#/components/schemas/Session"
  1170. }
  1171. }
  1172. }
  1173. },
  1174. "400": {
  1175. "description": "Bad request",
  1176. "content": {
  1177. "application/json": {
  1178. "schema": {
  1179. "$ref": "#/components/schemas/BadRequestError"
  1180. }
  1181. }
  1182. }
  1183. }
  1184. },
  1185. "requestBody": {
  1186. "content": {
  1187. "application/json": {
  1188. "schema": {
  1189. "type": "object",
  1190. "properties": {
  1191. "parentID": {
  1192. "type": "string",
  1193. "pattern": "^ses.*"
  1194. },
  1195. "title": {
  1196. "type": "string"
  1197. },
  1198. "permission": {
  1199. "$ref": "#/components/schemas/PermissionRuleset"
  1200. }
  1201. }
  1202. }
  1203. }
  1204. }
  1205. },
  1206. "x-codeSamples": [
  1207. {
  1208. "lang": "js",
  1209. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  1210. }
  1211. ]
  1212. }
  1213. },
  1214. "/session/status": {
  1215. "get": {
  1216. "operationId": "session.status",
  1217. "parameters": [
  1218. {
  1219. "in": "query",
  1220. "name": "directory",
  1221. "schema": {
  1222. "type": "string"
  1223. }
  1224. }
  1225. ],
  1226. "summary": "Get session status",
  1227. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  1228. "responses": {
  1229. "200": {
  1230. "description": "Get session status",
  1231. "content": {
  1232. "application/json": {
  1233. "schema": {
  1234. "type": "object",
  1235. "propertyNames": {
  1236. "type": "string"
  1237. },
  1238. "additionalProperties": {
  1239. "$ref": "#/components/schemas/SessionStatus"
  1240. }
  1241. }
  1242. }
  1243. }
  1244. },
  1245. "400": {
  1246. "description": "Bad request",
  1247. "content": {
  1248. "application/json": {
  1249. "schema": {
  1250. "$ref": "#/components/schemas/BadRequestError"
  1251. }
  1252. }
  1253. }
  1254. }
  1255. },
  1256. "x-codeSamples": [
  1257. {
  1258. "lang": "js",
  1259. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  1260. }
  1261. ]
  1262. }
  1263. },
  1264. "/session/{sessionID}": {
  1265. "get": {
  1266. "operationId": "session.get",
  1267. "parameters": [
  1268. {
  1269. "in": "query",
  1270. "name": "directory",
  1271. "schema": {
  1272. "type": "string"
  1273. }
  1274. },
  1275. {
  1276. "in": "path",
  1277. "name": "sessionID",
  1278. "schema": {
  1279. "type": "string",
  1280. "pattern": "^ses.*"
  1281. },
  1282. "required": true
  1283. }
  1284. ],
  1285. "summary": "Get session",
  1286. "description": "Retrieve detailed information about a specific OpenCode session.",
  1287. "tags": ["Session"],
  1288. "responses": {
  1289. "200": {
  1290. "description": "Get session",
  1291. "content": {
  1292. "application/json": {
  1293. "schema": {
  1294. "$ref": "#/components/schemas/Session"
  1295. }
  1296. }
  1297. }
  1298. },
  1299. "400": {
  1300. "description": "Bad request",
  1301. "content": {
  1302. "application/json": {
  1303. "schema": {
  1304. "$ref": "#/components/schemas/BadRequestError"
  1305. }
  1306. }
  1307. }
  1308. },
  1309. "404": {
  1310. "description": "Not found",
  1311. "content": {
  1312. "application/json": {
  1313. "schema": {
  1314. "$ref": "#/components/schemas/NotFoundError"
  1315. }
  1316. }
  1317. }
  1318. }
  1319. },
  1320. "x-codeSamples": [
  1321. {
  1322. "lang": "js",
  1323. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  1324. }
  1325. ]
  1326. },
  1327. "delete": {
  1328. "operationId": "session.delete",
  1329. "parameters": [
  1330. {
  1331. "in": "query",
  1332. "name": "directory",
  1333. "schema": {
  1334. "type": "string"
  1335. }
  1336. },
  1337. {
  1338. "in": "path",
  1339. "name": "sessionID",
  1340. "schema": {
  1341. "type": "string",
  1342. "pattern": "^ses.*"
  1343. },
  1344. "required": true
  1345. }
  1346. ],
  1347. "summary": "Delete session",
  1348. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  1349. "responses": {
  1350. "200": {
  1351. "description": "Successfully deleted session",
  1352. "content": {
  1353. "application/json": {
  1354. "schema": {
  1355. "type": "boolean"
  1356. }
  1357. }
  1358. }
  1359. },
  1360. "400": {
  1361. "description": "Bad request",
  1362. "content": {
  1363. "application/json": {
  1364. "schema": {
  1365. "$ref": "#/components/schemas/BadRequestError"
  1366. }
  1367. }
  1368. }
  1369. },
  1370. "404": {
  1371. "description": "Not found",
  1372. "content": {
  1373. "application/json": {
  1374. "schema": {
  1375. "$ref": "#/components/schemas/NotFoundError"
  1376. }
  1377. }
  1378. }
  1379. }
  1380. },
  1381. "x-codeSamples": [
  1382. {
  1383. "lang": "js",
  1384. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  1385. }
  1386. ]
  1387. },
  1388. "patch": {
  1389. "operationId": "session.update",
  1390. "parameters": [
  1391. {
  1392. "in": "query",
  1393. "name": "directory",
  1394. "schema": {
  1395. "type": "string"
  1396. }
  1397. },
  1398. {
  1399. "in": "path",
  1400. "name": "sessionID",
  1401. "schema": {
  1402. "type": "string"
  1403. },
  1404. "required": true
  1405. }
  1406. ],
  1407. "summary": "Update session",
  1408. "description": "Update properties of an existing session, such as title or other metadata.",
  1409. "responses": {
  1410. "200": {
  1411. "description": "Successfully updated session",
  1412. "content": {
  1413. "application/json": {
  1414. "schema": {
  1415. "$ref": "#/components/schemas/Session"
  1416. }
  1417. }
  1418. }
  1419. },
  1420. "400": {
  1421. "description": "Bad request",
  1422. "content": {
  1423. "application/json": {
  1424. "schema": {
  1425. "$ref": "#/components/schemas/BadRequestError"
  1426. }
  1427. }
  1428. }
  1429. },
  1430. "404": {
  1431. "description": "Not found",
  1432. "content": {
  1433. "application/json": {
  1434. "schema": {
  1435. "$ref": "#/components/schemas/NotFoundError"
  1436. }
  1437. }
  1438. }
  1439. }
  1440. },
  1441. "requestBody": {
  1442. "content": {
  1443. "application/json": {
  1444. "schema": {
  1445. "type": "object",
  1446. "properties": {
  1447. "title": {
  1448. "type": "string"
  1449. },
  1450. "time": {
  1451. "type": "object",
  1452. "properties": {
  1453. "archived": {
  1454. "type": "number"
  1455. }
  1456. }
  1457. }
  1458. }
  1459. }
  1460. }
  1461. }
  1462. },
  1463. "x-codeSamples": [
  1464. {
  1465. "lang": "js",
  1466. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  1467. }
  1468. ]
  1469. }
  1470. },
  1471. "/session/{sessionID}/children": {
  1472. "get": {
  1473. "operationId": "session.children",
  1474. "parameters": [
  1475. {
  1476. "in": "query",
  1477. "name": "directory",
  1478. "schema": {
  1479. "type": "string"
  1480. }
  1481. },
  1482. {
  1483. "in": "path",
  1484. "name": "sessionID",
  1485. "schema": {
  1486. "type": "string",
  1487. "pattern": "^ses.*"
  1488. },
  1489. "required": true
  1490. }
  1491. ],
  1492. "summary": "Get session children",
  1493. "tags": ["Session"],
  1494. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  1495. "responses": {
  1496. "200": {
  1497. "description": "List of children",
  1498. "content": {
  1499. "application/json": {
  1500. "schema": {
  1501. "type": "array",
  1502. "items": {
  1503. "$ref": "#/components/schemas/Session"
  1504. }
  1505. }
  1506. }
  1507. }
  1508. },
  1509. "400": {
  1510. "description": "Bad request",
  1511. "content": {
  1512. "application/json": {
  1513. "schema": {
  1514. "$ref": "#/components/schemas/BadRequestError"
  1515. }
  1516. }
  1517. }
  1518. },
  1519. "404": {
  1520. "description": "Not found",
  1521. "content": {
  1522. "application/json": {
  1523. "schema": {
  1524. "$ref": "#/components/schemas/NotFoundError"
  1525. }
  1526. }
  1527. }
  1528. }
  1529. },
  1530. "x-codeSamples": [
  1531. {
  1532. "lang": "js",
  1533. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  1534. }
  1535. ]
  1536. }
  1537. },
  1538. "/session/{sessionID}/todo": {
  1539. "get": {
  1540. "operationId": "session.todo",
  1541. "parameters": [
  1542. {
  1543. "in": "query",
  1544. "name": "directory",
  1545. "schema": {
  1546. "type": "string"
  1547. }
  1548. },
  1549. {
  1550. "in": "path",
  1551. "name": "sessionID",
  1552. "schema": {
  1553. "type": "string"
  1554. },
  1555. "required": true,
  1556. "description": "Session ID"
  1557. }
  1558. ],
  1559. "summary": "Get session todos",
  1560. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  1561. "responses": {
  1562. "200": {
  1563. "description": "Todo list",
  1564. "content": {
  1565. "application/json": {
  1566. "schema": {
  1567. "type": "array",
  1568. "items": {
  1569. "$ref": "#/components/schemas/Todo"
  1570. }
  1571. }
  1572. }
  1573. }
  1574. },
  1575. "400": {
  1576. "description": "Bad request",
  1577. "content": {
  1578. "application/json": {
  1579. "schema": {
  1580. "$ref": "#/components/schemas/BadRequestError"
  1581. }
  1582. }
  1583. }
  1584. },
  1585. "404": {
  1586. "description": "Not found",
  1587. "content": {
  1588. "application/json": {
  1589. "schema": {
  1590. "$ref": "#/components/schemas/NotFoundError"
  1591. }
  1592. }
  1593. }
  1594. }
  1595. },
  1596. "x-codeSamples": [
  1597. {
  1598. "lang": "js",
  1599. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  1600. }
  1601. ]
  1602. }
  1603. },
  1604. "/session/{sessionID}/init": {
  1605. "post": {
  1606. "operationId": "session.init",
  1607. "parameters": [
  1608. {
  1609. "in": "query",
  1610. "name": "directory",
  1611. "schema": {
  1612. "type": "string"
  1613. }
  1614. },
  1615. {
  1616. "in": "path",
  1617. "name": "sessionID",
  1618. "schema": {
  1619. "type": "string"
  1620. },
  1621. "required": true,
  1622. "description": "Session ID"
  1623. }
  1624. ],
  1625. "summary": "Initialize session",
  1626. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  1627. "responses": {
  1628. "200": {
  1629. "description": "200",
  1630. "content": {
  1631. "application/json": {
  1632. "schema": {
  1633. "type": "boolean"
  1634. }
  1635. }
  1636. }
  1637. },
  1638. "400": {
  1639. "description": "Bad request",
  1640. "content": {
  1641. "application/json": {
  1642. "schema": {
  1643. "$ref": "#/components/schemas/BadRequestError"
  1644. }
  1645. }
  1646. }
  1647. },
  1648. "404": {
  1649. "description": "Not found",
  1650. "content": {
  1651. "application/json": {
  1652. "schema": {
  1653. "$ref": "#/components/schemas/NotFoundError"
  1654. }
  1655. }
  1656. }
  1657. }
  1658. },
  1659. "requestBody": {
  1660. "content": {
  1661. "application/json": {
  1662. "schema": {
  1663. "type": "object",
  1664. "properties": {
  1665. "modelID": {
  1666. "type": "string"
  1667. },
  1668. "providerID": {
  1669. "type": "string"
  1670. },
  1671. "messageID": {
  1672. "type": "string",
  1673. "pattern": "^msg.*"
  1674. }
  1675. },
  1676. "required": ["modelID", "providerID", "messageID"]
  1677. }
  1678. }
  1679. }
  1680. },
  1681. "x-codeSamples": [
  1682. {
  1683. "lang": "js",
  1684. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  1685. }
  1686. ]
  1687. }
  1688. },
  1689. "/session/{sessionID}/fork": {
  1690. "post": {
  1691. "operationId": "session.fork",
  1692. "parameters": [
  1693. {
  1694. "in": "query",
  1695. "name": "directory",
  1696. "schema": {
  1697. "type": "string"
  1698. }
  1699. },
  1700. {
  1701. "in": "path",
  1702. "name": "sessionID",
  1703. "schema": {
  1704. "type": "string",
  1705. "pattern": "^ses.*"
  1706. },
  1707. "required": true
  1708. }
  1709. ],
  1710. "summary": "Fork session",
  1711. "description": "Create a new session by forking an existing session at a specific message point.",
  1712. "responses": {
  1713. "200": {
  1714. "description": "200",
  1715. "content": {
  1716. "application/json": {
  1717. "schema": {
  1718. "$ref": "#/components/schemas/Session"
  1719. }
  1720. }
  1721. }
  1722. }
  1723. },
  1724. "requestBody": {
  1725. "content": {
  1726. "application/json": {
  1727. "schema": {
  1728. "type": "object",
  1729. "properties": {
  1730. "messageID": {
  1731. "type": "string",
  1732. "pattern": "^msg.*"
  1733. }
  1734. }
  1735. }
  1736. }
  1737. }
  1738. },
  1739. "x-codeSamples": [
  1740. {
  1741. "lang": "js",
  1742. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  1743. }
  1744. ]
  1745. }
  1746. },
  1747. "/session/{sessionID}/abort": {
  1748. "post": {
  1749. "operationId": "session.abort",
  1750. "parameters": [
  1751. {
  1752. "in": "query",
  1753. "name": "directory",
  1754. "schema": {
  1755. "type": "string"
  1756. }
  1757. },
  1758. {
  1759. "in": "path",
  1760. "name": "sessionID",
  1761. "schema": {
  1762. "type": "string"
  1763. },
  1764. "required": true
  1765. }
  1766. ],
  1767. "summary": "Abort session",
  1768. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  1769. "responses": {
  1770. "200": {
  1771. "description": "Aborted session",
  1772. "content": {
  1773. "application/json": {
  1774. "schema": {
  1775. "type": "boolean"
  1776. }
  1777. }
  1778. }
  1779. },
  1780. "400": {
  1781. "description": "Bad request",
  1782. "content": {
  1783. "application/json": {
  1784. "schema": {
  1785. "$ref": "#/components/schemas/BadRequestError"
  1786. }
  1787. }
  1788. }
  1789. },
  1790. "404": {
  1791. "description": "Not found",
  1792. "content": {
  1793. "application/json": {
  1794. "schema": {
  1795. "$ref": "#/components/schemas/NotFoundError"
  1796. }
  1797. }
  1798. }
  1799. }
  1800. },
  1801. "x-codeSamples": [
  1802. {
  1803. "lang": "js",
  1804. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  1805. }
  1806. ]
  1807. }
  1808. },
  1809. "/session/{sessionID}/share": {
  1810. "post": {
  1811. "operationId": "session.share",
  1812. "parameters": [
  1813. {
  1814. "in": "query",
  1815. "name": "directory",
  1816. "schema": {
  1817. "type": "string"
  1818. }
  1819. },
  1820. {
  1821. "in": "path",
  1822. "name": "sessionID",
  1823. "schema": {
  1824. "type": "string"
  1825. },
  1826. "required": true
  1827. }
  1828. ],
  1829. "summary": "Share session",
  1830. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  1831. "responses": {
  1832. "200": {
  1833. "description": "Successfully shared session",
  1834. "content": {
  1835. "application/json": {
  1836. "schema": {
  1837. "$ref": "#/components/schemas/Session"
  1838. }
  1839. }
  1840. }
  1841. },
  1842. "400": {
  1843. "description": "Bad request",
  1844. "content": {
  1845. "application/json": {
  1846. "schema": {
  1847. "$ref": "#/components/schemas/BadRequestError"
  1848. }
  1849. }
  1850. }
  1851. },
  1852. "404": {
  1853. "description": "Not found",
  1854. "content": {
  1855. "application/json": {
  1856. "schema": {
  1857. "$ref": "#/components/schemas/NotFoundError"
  1858. }
  1859. }
  1860. }
  1861. }
  1862. },
  1863. "x-codeSamples": [
  1864. {
  1865. "lang": "js",
  1866. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  1867. }
  1868. ]
  1869. },
  1870. "delete": {
  1871. "operationId": "session.unshare",
  1872. "parameters": [
  1873. {
  1874. "in": "query",
  1875. "name": "directory",
  1876. "schema": {
  1877. "type": "string"
  1878. }
  1879. },
  1880. {
  1881. "in": "path",
  1882. "name": "sessionID",
  1883. "schema": {
  1884. "type": "string",
  1885. "pattern": "^ses.*"
  1886. },
  1887. "required": true
  1888. }
  1889. ],
  1890. "summary": "Unshare session",
  1891. "description": "Remove the shareable link for a session, making it private again.",
  1892. "responses": {
  1893. "200": {
  1894. "description": "Successfully unshared session",
  1895. "content": {
  1896. "application/json": {
  1897. "schema": {
  1898. "$ref": "#/components/schemas/Session"
  1899. }
  1900. }
  1901. }
  1902. },
  1903. "400": {
  1904. "description": "Bad request",
  1905. "content": {
  1906. "application/json": {
  1907. "schema": {
  1908. "$ref": "#/components/schemas/BadRequestError"
  1909. }
  1910. }
  1911. }
  1912. },
  1913. "404": {
  1914. "description": "Not found",
  1915. "content": {
  1916. "application/json": {
  1917. "schema": {
  1918. "$ref": "#/components/schemas/NotFoundError"
  1919. }
  1920. }
  1921. }
  1922. }
  1923. },
  1924. "x-codeSamples": [
  1925. {
  1926. "lang": "js",
  1927. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  1928. }
  1929. ]
  1930. }
  1931. },
  1932. "/session/{sessionID}/diff": {
  1933. "get": {
  1934. "operationId": "session.diff",
  1935. "parameters": [
  1936. {
  1937. "in": "query",
  1938. "name": "directory",
  1939. "schema": {
  1940. "type": "string"
  1941. }
  1942. },
  1943. {
  1944. "in": "path",
  1945. "name": "sessionID",
  1946. "schema": {
  1947. "type": "string",
  1948. "pattern": "^ses.*"
  1949. },
  1950. "required": true
  1951. },
  1952. {
  1953. "in": "query",
  1954. "name": "messageID",
  1955. "schema": {
  1956. "type": "string",
  1957. "pattern": "^msg.*"
  1958. }
  1959. }
  1960. ],
  1961. "summary": "Get message diff",
  1962. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  1963. "responses": {
  1964. "200": {
  1965. "description": "Successfully retrieved diff",
  1966. "content": {
  1967. "application/json": {
  1968. "schema": {
  1969. "type": "array",
  1970. "items": {
  1971. "$ref": "#/components/schemas/FileDiff"
  1972. }
  1973. }
  1974. }
  1975. }
  1976. }
  1977. },
  1978. "x-codeSamples": [
  1979. {
  1980. "lang": "js",
  1981. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  1982. }
  1983. ]
  1984. }
  1985. },
  1986. "/session/{sessionID}/summarize": {
  1987. "post": {
  1988. "operationId": "session.summarize",
  1989. "parameters": [
  1990. {
  1991. "in": "query",
  1992. "name": "directory",
  1993. "schema": {
  1994. "type": "string"
  1995. }
  1996. },
  1997. {
  1998. "in": "path",
  1999. "name": "sessionID",
  2000. "schema": {
  2001. "type": "string"
  2002. },
  2003. "required": true,
  2004. "description": "Session ID"
  2005. }
  2006. ],
  2007. "summary": "Summarize session",
  2008. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  2009. "responses": {
  2010. "200": {
  2011. "description": "Summarized session",
  2012. "content": {
  2013. "application/json": {
  2014. "schema": {
  2015. "type": "boolean"
  2016. }
  2017. }
  2018. }
  2019. },
  2020. "400": {
  2021. "description": "Bad request",
  2022. "content": {
  2023. "application/json": {
  2024. "schema": {
  2025. "$ref": "#/components/schemas/BadRequestError"
  2026. }
  2027. }
  2028. }
  2029. },
  2030. "404": {
  2031. "description": "Not found",
  2032. "content": {
  2033. "application/json": {
  2034. "schema": {
  2035. "$ref": "#/components/schemas/NotFoundError"
  2036. }
  2037. }
  2038. }
  2039. }
  2040. },
  2041. "requestBody": {
  2042. "content": {
  2043. "application/json": {
  2044. "schema": {
  2045. "type": "object",
  2046. "properties": {
  2047. "providerID": {
  2048. "type": "string"
  2049. },
  2050. "modelID": {
  2051. "type": "string"
  2052. },
  2053. "auto": {
  2054. "default": false,
  2055. "type": "boolean"
  2056. }
  2057. },
  2058. "required": ["providerID", "modelID"]
  2059. }
  2060. }
  2061. }
  2062. },
  2063. "x-codeSamples": [
  2064. {
  2065. "lang": "js",
  2066. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  2067. }
  2068. ]
  2069. }
  2070. },
  2071. "/session/{sessionID}/message": {
  2072. "get": {
  2073. "operationId": "session.messages",
  2074. "parameters": [
  2075. {
  2076. "in": "query",
  2077. "name": "directory",
  2078. "schema": {
  2079. "type": "string"
  2080. }
  2081. },
  2082. {
  2083. "in": "path",
  2084. "name": "sessionID",
  2085. "schema": {
  2086. "type": "string"
  2087. },
  2088. "required": true,
  2089. "description": "Session ID"
  2090. },
  2091. {
  2092. "in": "query",
  2093. "name": "limit",
  2094. "schema": {
  2095. "type": "number"
  2096. }
  2097. }
  2098. ],
  2099. "summary": "Get session messages",
  2100. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  2101. "responses": {
  2102. "200": {
  2103. "description": "List of messages",
  2104. "content": {
  2105. "application/json": {
  2106. "schema": {
  2107. "type": "array",
  2108. "items": {
  2109. "type": "object",
  2110. "properties": {
  2111. "info": {
  2112. "$ref": "#/components/schemas/Message"
  2113. },
  2114. "parts": {
  2115. "type": "array",
  2116. "items": {
  2117. "$ref": "#/components/schemas/Part"
  2118. }
  2119. }
  2120. },
  2121. "required": ["info", "parts"]
  2122. }
  2123. }
  2124. }
  2125. }
  2126. },
  2127. "400": {
  2128. "description": "Bad request",
  2129. "content": {
  2130. "application/json": {
  2131. "schema": {
  2132. "$ref": "#/components/schemas/BadRequestError"
  2133. }
  2134. }
  2135. }
  2136. },
  2137. "404": {
  2138. "description": "Not found",
  2139. "content": {
  2140. "application/json": {
  2141. "schema": {
  2142. "$ref": "#/components/schemas/NotFoundError"
  2143. }
  2144. }
  2145. }
  2146. }
  2147. },
  2148. "x-codeSamples": [
  2149. {
  2150. "lang": "js",
  2151. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  2152. }
  2153. ]
  2154. },
  2155. "post": {
  2156. "operationId": "session.prompt",
  2157. "parameters": [
  2158. {
  2159. "in": "query",
  2160. "name": "directory",
  2161. "schema": {
  2162. "type": "string"
  2163. }
  2164. },
  2165. {
  2166. "in": "path",
  2167. "name": "sessionID",
  2168. "schema": {
  2169. "type": "string"
  2170. },
  2171. "required": true,
  2172. "description": "Session ID"
  2173. }
  2174. ],
  2175. "summary": "Send message",
  2176. "description": "Create and send a new message to a session, streaming the AI response.",
  2177. "responses": {
  2178. "200": {
  2179. "description": "Created message",
  2180. "content": {
  2181. "application/json": {
  2182. "schema": {
  2183. "type": "object",
  2184. "properties": {
  2185. "info": {
  2186. "$ref": "#/components/schemas/AssistantMessage"
  2187. },
  2188. "parts": {
  2189. "type": "array",
  2190. "items": {
  2191. "$ref": "#/components/schemas/Part"
  2192. }
  2193. }
  2194. },
  2195. "required": ["info", "parts"]
  2196. }
  2197. }
  2198. }
  2199. },
  2200. "400": {
  2201. "description": "Bad request",
  2202. "content": {
  2203. "application/json": {
  2204. "schema": {
  2205. "$ref": "#/components/schemas/BadRequestError"
  2206. }
  2207. }
  2208. }
  2209. },
  2210. "404": {
  2211. "description": "Not found",
  2212. "content": {
  2213. "application/json": {
  2214. "schema": {
  2215. "$ref": "#/components/schemas/NotFoundError"
  2216. }
  2217. }
  2218. }
  2219. }
  2220. },
  2221. "requestBody": {
  2222. "content": {
  2223. "application/json": {
  2224. "schema": {
  2225. "type": "object",
  2226. "properties": {
  2227. "messageID": {
  2228. "type": "string",
  2229. "pattern": "^msg.*"
  2230. },
  2231. "model": {
  2232. "type": "object",
  2233. "properties": {
  2234. "providerID": {
  2235. "type": "string"
  2236. },
  2237. "modelID": {
  2238. "type": "string"
  2239. }
  2240. },
  2241. "required": ["providerID", "modelID"]
  2242. },
  2243. "agent": {
  2244. "type": "string"
  2245. },
  2246. "noReply": {
  2247. "type": "boolean"
  2248. },
  2249. "tools": {
  2250. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  2251. "type": "object",
  2252. "propertyNames": {
  2253. "type": "string"
  2254. },
  2255. "additionalProperties": {
  2256. "type": "boolean"
  2257. }
  2258. },
  2259. "system": {
  2260. "type": "string"
  2261. },
  2262. "variant": {
  2263. "type": "string"
  2264. },
  2265. "parts": {
  2266. "type": "array",
  2267. "items": {
  2268. "anyOf": [
  2269. {
  2270. "$ref": "#/components/schemas/TextPartInput"
  2271. },
  2272. {
  2273. "$ref": "#/components/schemas/FilePartInput"
  2274. },
  2275. {
  2276. "$ref": "#/components/schemas/AgentPartInput"
  2277. },
  2278. {
  2279. "$ref": "#/components/schemas/SubtaskPartInput"
  2280. }
  2281. ]
  2282. }
  2283. }
  2284. },
  2285. "required": ["parts"]
  2286. }
  2287. }
  2288. }
  2289. },
  2290. "x-codeSamples": [
  2291. {
  2292. "lang": "js",
  2293. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  2294. }
  2295. ]
  2296. }
  2297. },
  2298. "/session/{sessionID}/message/{messageID}": {
  2299. "get": {
  2300. "operationId": "session.message",
  2301. "parameters": [
  2302. {
  2303. "in": "query",
  2304. "name": "directory",
  2305. "schema": {
  2306. "type": "string"
  2307. }
  2308. },
  2309. {
  2310. "in": "path",
  2311. "name": "sessionID",
  2312. "schema": {
  2313. "type": "string"
  2314. },
  2315. "required": true,
  2316. "description": "Session ID"
  2317. },
  2318. {
  2319. "in": "path",
  2320. "name": "messageID",
  2321. "schema": {
  2322. "type": "string"
  2323. },
  2324. "required": true,
  2325. "description": "Message ID"
  2326. }
  2327. ],
  2328. "summary": "Get message",
  2329. "description": "Retrieve a specific message from a session by its message ID.",
  2330. "responses": {
  2331. "200": {
  2332. "description": "Message",
  2333. "content": {
  2334. "application/json": {
  2335. "schema": {
  2336. "type": "object",
  2337. "properties": {
  2338. "info": {
  2339. "$ref": "#/components/schemas/Message"
  2340. },
  2341. "parts": {
  2342. "type": "array",
  2343. "items": {
  2344. "$ref": "#/components/schemas/Part"
  2345. }
  2346. }
  2347. },
  2348. "required": ["info", "parts"]
  2349. }
  2350. }
  2351. }
  2352. },
  2353. "400": {
  2354. "description": "Bad request",
  2355. "content": {
  2356. "application/json": {
  2357. "schema": {
  2358. "$ref": "#/components/schemas/BadRequestError"
  2359. }
  2360. }
  2361. }
  2362. },
  2363. "404": {
  2364. "description": "Not found",
  2365. "content": {
  2366. "application/json": {
  2367. "schema": {
  2368. "$ref": "#/components/schemas/NotFoundError"
  2369. }
  2370. }
  2371. }
  2372. }
  2373. },
  2374. "x-codeSamples": [
  2375. {
  2376. "lang": "js",
  2377. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  2378. }
  2379. ]
  2380. }
  2381. },
  2382. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  2383. "delete": {
  2384. "operationId": "part.delete",
  2385. "parameters": [
  2386. {
  2387. "in": "query",
  2388. "name": "directory",
  2389. "schema": {
  2390. "type": "string"
  2391. }
  2392. },
  2393. {
  2394. "in": "path",
  2395. "name": "sessionID",
  2396. "schema": {
  2397. "type": "string"
  2398. },
  2399. "required": true,
  2400. "description": "Session ID"
  2401. },
  2402. {
  2403. "in": "path",
  2404. "name": "messageID",
  2405. "schema": {
  2406. "type": "string"
  2407. },
  2408. "required": true,
  2409. "description": "Message ID"
  2410. },
  2411. {
  2412. "in": "path",
  2413. "name": "partID",
  2414. "schema": {
  2415. "type": "string"
  2416. },
  2417. "required": true,
  2418. "description": "Part ID"
  2419. }
  2420. ],
  2421. "description": "Delete a part from a message",
  2422. "responses": {
  2423. "200": {
  2424. "description": "Successfully deleted part",
  2425. "content": {
  2426. "application/json": {
  2427. "schema": {
  2428. "type": "boolean"
  2429. }
  2430. }
  2431. }
  2432. },
  2433. "400": {
  2434. "description": "Bad request",
  2435. "content": {
  2436. "application/json": {
  2437. "schema": {
  2438. "$ref": "#/components/schemas/BadRequestError"
  2439. }
  2440. }
  2441. }
  2442. },
  2443. "404": {
  2444. "description": "Not found",
  2445. "content": {
  2446. "application/json": {
  2447. "schema": {
  2448. "$ref": "#/components/schemas/NotFoundError"
  2449. }
  2450. }
  2451. }
  2452. }
  2453. },
  2454. "x-codeSamples": [
  2455. {
  2456. "lang": "js",
  2457. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  2458. }
  2459. ]
  2460. },
  2461. "patch": {
  2462. "operationId": "part.update",
  2463. "parameters": [
  2464. {
  2465. "in": "query",
  2466. "name": "directory",
  2467. "schema": {
  2468. "type": "string"
  2469. }
  2470. },
  2471. {
  2472. "in": "path",
  2473. "name": "sessionID",
  2474. "schema": {
  2475. "type": "string"
  2476. },
  2477. "required": true,
  2478. "description": "Session ID"
  2479. },
  2480. {
  2481. "in": "path",
  2482. "name": "messageID",
  2483. "schema": {
  2484. "type": "string"
  2485. },
  2486. "required": true,
  2487. "description": "Message ID"
  2488. },
  2489. {
  2490. "in": "path",
  2491. "name": "partID",
  2492. "schema": {
  2493. "type": "string"
  2494. },
  2495. "required": true,
  2496. "description": "Part ID"
  2497. }
  2498. ],
  2499. "description": "Update a part in a message",
  2500. "responses": {
  2501. "200": {
  2502. "description": "Successfully updated part",
  2503. "content": {
  2504. "application/json": {
  2505. "schema": {
  2506. "$ref": "#/components/schemas/Part"
  2507. }
  2508. }
  2509. }
  2510. },
  2511. "400": {
  2512. "description": "Bad request",
  2513. "content": {
  2514. "application/json": {
  2515. "schema": {
  2516. "$ref": "#/components/schemas/BadRequestError"
  2517. }
  2518. }
  2519. }
  2520. },
  2521. "404": {
  2522. "description": "Not found",
  2523. "content": {
  2524. "application/json": {
  2525. "schema": {
  2526. "$ref": "#/components/schemas/NotFoundError"
  2527. }
  2528. }
  2529. }
  2530. }
  2531. },
  2532. "requestBody": {
  2533. "content": {
  2534. "application/json": {
  2535. "schema": {
  2536. "$ref": "#/components/schemas/Part"
  2537. }
  2538. }
  2539. }
  2540. },
  2541. "x-codeSamples": [
  2542. {
  2543. "lang": "js",
  2544. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  2545. }
  2546. ]
  2547. }
  2548. },
  2549. "/session/{sessionID}/prompt_async": {
  2550. "post": {
  2551. "operationId": "session.prompt_async",
  2552. "parameters": [
  2553. {
  2554. "in": "query",
  2555. "name": "directory",
  2556. "schema": {
  2557. "type": "string"
  2558. }
  2559. },
  2560. {
  2561. "in": "path",
  2562. "name": "sessionID",
  2563. "schema": {
  2564. "type": "string"
  2565. },
  2566. "required": true,
  2567. "description": "Session ID"
  2568. }
  2569. ],
  2570. "summary": "Send async message",
  2571. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  2572. "responses": {
  2573. "204": {
  2574. "description": "Prompt accepted"
  2575. },
  2576. "400": {
  2577. "description": "Bad request",
  2578. "content": {
  2579. "application/json": {
  2580. "schema": {
  2581. "$ref": "#/components/schemas/BadRequestError"
  2582. }
  2583. }
  2584. }
  2585. },
  2586. "404": {
  2587. "description": "Not found",
  2588. "content": {
  2589. "application/json": {
  2590. "schema": {
  2591. "$ref": "#/components/schemas/NotFoundError"
  2592. }
  2593. }
  2594. }
  2595. }
  2596. },
  2597. "requestBody": {
  2598. "content": {
  2599. "application/json": {
  2600. "schema": {
  2601. "type": "object",
  2602. "properties": {
  2603. "messageID": {
  2604. "type": "string",
  2605. "pattern": "^msg.*"
  2606. },
  2607. "model": {
  2608. "type": "object",
  2609. "properties": {
  2610. "providerID": {
  2611. "type": "string"
  2612. },
  2613. "modelID": {
  2614. "type": "string"
  2615. }
  2616. },
  2617. "required": ["providerID", "modelID"]
  2618. },
  2619. "agent": {
  2620. "type": "string"
  2621. },
  2622. "noReply": {
  2623. "type": "boolean"
  2624. },
  2625. "tools": {
  2626. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  2627. "type": "object",
  2628. "propertyNames": {
  2629. "type": "string"
  2630. },
  2631. "additionalProperties": {
  2632. "type": "boolean"
  2633. }
  2634. },
  2635. "system": {
  2636. "type": "string"
  2637. },
  2638. "variant": {
  2639. "type": "string"
  2640. },
  2641. "parts": {
  2642. "type": "array",
  2643. "items": {
  2644. "anyOf": [
  2645. {
  2646. "$ref": "#/components/schemas/TextPartInput"
  2647. },
  2648. {
  2649. "$ref": "#/components/schemas/FilePartInput"
  2650. },
  2651. {
  2652. "$ref": "#/components/schemas/AgentPartInput"
  2653. },
  2654. {
  2655. "$ref": "#/components/schemas/SubtaskPartInput"
  2656. }
  2657. ]
  2658. }
  2659. }
  2660. },
  2661. "required": ["parts"]
  2662. }
  2663. }
  2664. }
  2665. },
  2666. "x-codeSamples": [
  2667. {
  2668. "lang": "js",
  2669. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  2670. }
  2671. ]
  2672. }
  2673. },
  2674. "/session/{sessionID}/command": {
  2675. "post": {
  2676. "operationId": "session.command",
  2677. "parameters": [
  2678. {
  2679. "in": "query",
  2680. "name": "directory",
  2681. "schema": {
  2682. "type": "string"
  2683. }
  2684. },
  2685. {
  2686. "in": "path",
  2687. "name": "sessionID",
  2688. "schema": {
  2689. "type": "string"
  2690. },
  2691. "required": true,
  2692. "description": "Session ID"
  2693. }
  2694. ],
  2695. "summary": "Send command",
  2696. "description": "Send a new command to a session for execution by the AI assistant.",
  2697. "responses": {
  2698. "200": {
  2699. "description": "Created message",
  2700. "content": {
  2701. "application/json": {
  2702. "schema": {
  2703. "type": "object",
  2704. "properties": {
  2705. "info": {
  2706. "$ref": "#/components/schemas/AssistantMessage"
  2707. },
  2708. "parts": {
  2709. "type": "array",
  2710. "items": {
  2711. "$ref": "#/components/schemas/Part"
  2712. }
  2713. }
  2714. },
  2715. "required": ["info", "parts"]
  2716. }
  2717. }
  2718. }
  2719. },
  2720. "400": {
  2721. "description": "Bad request",
  2722. "content": {
  2723. "application/json": {
  2724. "schema": {
  2725. "$ref": "#/components/schemas/BadRequestError"
  2726. }
  2727. }
  2728. }
  2729. },
  2730. "404": {
  2731. "description": "Not found",
  2732. "content": {
  2733. "application/json": {
  2734. "schema": {
  2735. "$ref": "#/components/schemas/NotFoundError"
  2736. }
  2737. }
  2738. }
  2739. }
  2740. },
  2741. "requestBody": {
  2742. "content": {
  2743. "application/json": {
  2744. "schema": {
  2745. "type": "object",
  2746. "properties": {
  2747. "messageID": {
  2748. "type": "string",
  2749. "pattern": "^msg.*"
  2750. },
  2751. "agent": {
  2752. "type": "string"
  2753. },
  2754. "model": {
  2755. "type": "string"
  2756. },
  2757. "arguments": {
  2758. "type": "string"
  2759. },
  2760. "command": {
  2761. "type": "string"
  2762. },
  2763. "variant": {
  2764. "type": "string"
  2765. },
  2766. "parts": {
  2767. "type": "array",
  2768. "items": {
  2769. "anyOf": [
  2770. {
  2771. "type": "object",
  2772. "properties": {
  2773. "id": {
  2774. "type": "string"
  2775. },
  2776. "type": {
  2777. "type": "string",
  2778. "const": "file"
  2779. },
  2780. "mime": {
  2781. "type": "string"
  2782. },
  2783. "filename": {
  2784. "type": "string"
  2785. },
  2786. "url": {
  2787. "type": "string"
  2788. },
  2789. "source": {
  2790. "$ref": "#/components/schemas/FilePartSource"
  2791. }
  2792. },
  2793. "required": ["type", "mime", "url"]
  2794. }
  2795. ]
  2796. }
  2797. }
  2798. },
  2799. "required": ["arguments", "command"]
  2800. }
  2801. }
  2802. }
  2803. },
  2804. "x-codeSamples": [
  2805. {
  2806. "lang": "js",
  2807. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  2808. }
  2809. ]
  2810. }
  2811. },
  2812. "/session/{sessionID}/shell": {
  2813. "post": {
  2814. "operationId": "session.shell",
  2815. "parameters": [
  2816. {
  2817. "in": "query",
  2818. "name": "directory",
  2819. "schema": {
  2820. "type": "string"
  2821. }
  2822. },
  2823. {
  2824. "in": "path",
  2825. "name": "sessionID",
  2826. "schema": {
  2827. "type": "string"
  2828. },
  2829. "required": true,
  2830. "description": "Session ID"
  2831. }
  2832. ],
  2833. "summary": "Run shell command",
  2834. "description": "Execute a shell command within the session context and return the AI's response.",
  2835. "responses": {
  2836. "200": {
  2837. "description": "Created message",
  2838. "content": {
  2839. "application/json": {
  2840. "schema": {
  2841. "$ref": "#/components/schemas/AssistantMessage"
  2842. }
  2843. }
  2844. }
  2845. },
  2846. "400": {
  2847. "description": "Bad request",
  2848. "content": {
  2849. "application/json": {
  2850. "schema": {
  2851. "$ref": "#/components/schemas/BadRequestError"
  2852. }
  2853. }
  2854. }
  2855. },
  2856. "404": {
  2857. "description": "Not found",
  2858. "content": {
  2859. "application/json": {
  2860. "schema": {
  2861. "$ref": "#/components/schemas/NotFoundError"
  2862. }
  2863. }
  2864. }
  2865. }
  2866. },
  2867. "requestBody": {
  2868. "content": {
  2869. "application/json": {
  2870. "schema": {
  2871. "type": "object",
  2872. "properties": {
  2873. "agent": {
  2874. "type": "string"
  2875. },
  2876. "model": {
  2877. "type": "object",
  2878. "properties": {
  2879. "providerID": {
  2880. "type": "string"
  2881. },
  2882. "modelID": {
  2883. "type": "string"
  2884. }
  2885. },
  2886. "required": ["providerID", "modelID"]
  2887. },
  2888. "command": {
  2889. "type": "string"
  2890. }
  2891. },
  2892. "required": ["agent", "command"]
  2893. }
  2894. }
  2895. }
  2896. },
  2897. "x-codeSamples": [
  2898. {
  2899. "lang": "js",
  2900. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  2901. }
  2902. ]
  2903. }
  2904. },
  2905. "/session/{sessionID}/revert": {
  2906. "post": {
  2907. "operationId": "session.revert",
  2908. "parameters": [
  2909. {
  2910. "in": "query",
  2911. "name": "directory",
  2912. "schema": {
  2913. "type": "string"
  2914. }
  2915. },
  2916. {
  2917. "in": "path",
  2918. "name": "sessionID",
  2919. "schema": {
  2920. "type": "string"
  2921. },
  2922. "required": true
  2923. }
  2924. ],
  2925. "summary": "Revert message",
  2926. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  2927. "responses": {
  2928. "200": {
  2929. "description": "Updated session",
  2930. "content": {
  2931. "application/json": {
  2932. "schema": {
  2933. "$ref": "#/components/schemas/Session"
  2934. }
  2935. }
  2936. }
  2937. },
  2938. "400": {
  2939. "description": "Bad request",
  2940. "content": {
  2941. "application/json": {
  2942. "schema": {
  2943. "$ref": "#/components/schemas/BadRequestError"
  2944. }
  2945. }
  2946. }
  2947. },
  2948. "404": {
  2949. "description": "Not found",
  2950. "content": {
  2951. "application/json": {
  2952. "schema": {
  2953. "$ref": "#/components/schemas/NotFoundError"
  2954. }
  2955. }
  2956. }
  2957. }
  2958. },
  2959. "requestBody": {
  2960. "content": {
  2961. "application/json": {
  2962. "schema": {
  2963. "type": "object",
  2964. "properties": {
  2965. "messageID": {
  2966. "type": "string",
  2967. "pattern": "^msg.*"
  2968. },
  2969. "partID": {
  2970. "type": "string",
  2971. "pattern": "^prt.*"
  2972. }
  2973. },
  2974. "required": ["messageID"]
  2975. }
  2976. }
  2977. }
  2978. },
  2979. "x-codeSamples": [
  2980. {
  2981. "lang": "js",
  2982. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  2983. }
  2984. ]
  2985. }
  2986. },
  2987. "/session/{sessionID}/unrevert": {
  2988. "post": {
  2989. "operationId": "session.unrevert",
  2990. "parameters": [
  2991. {
  2992. "in": "query",
  2993. "name": "directory",
  2994. "schema": {
  2995. "type": "string"
  2996. }
  2997. },
  2998. {
  2999. "in": "path",
  3000. "name": "sessionID",
  3001. "schema": {
  3002. "type": "string"
  3003. },
  3004. "required": true
  3005. }
  3006. ],
  3007. "summary": "Restore reverted messages",
  3008. "description": "Restore all previously reverted messages in a session.",
  3009. "responses": {
  3010. "200": {
  3011. "description": "Updated session",
  3012. "content": {
  3013. "application/json": {
  3014. "schema": {
  3015. "$ref": "#/components/schemas/Session"
  3016. }
  3017. }
  3018. }
  3019. },
  3020. "400": {
  3021. "description": "Bad request",
  3022. "content": {
  3023. "application/json": {
  3024. "schema": {
  3025. "$ref": "#/components/schemas/BadRequestError"
  3026. }
  3027. }
  3028. }
  3029. },
  3030. "404": {
  3031. "description": "Not found",
  3032. "content": {
  3033. "application/json": {
  3034. "schema": {
  3035. "$ref": "#/components/schemas/NotFoundError"
  3036. }
  3037. }
  3038. }
  3039. }
  3040. },
  3041. "x-codeSamples": [
  3042. {
  3043. "lang": "js",
  3044. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  3045. }
  3046. ]
  3047. }
  3048. },
  3049. "/session/{sessionID}/permissions/{permissionID}": {
  3050. "post": {
  3051. "operationId": "permission.respond",
  3052. "parameters": [
  3053. {
  3054. "in": "query",
  3055. "name": "directory",
  3056. "schema": {
  3057. "type": "string"
  3058. }
  3059. },
  3060. {
  3061. "in": "path",
  3062. "name": "sessionID",
  3063. "schema": {
  3064. "type": "string"
  3065. },
  3066. "required": true
  3067. },
  3068. {
  3069. "in": "path",
  3070. "name": "permissionID",
  3071. "schema": {
  3072. "type": "string"
  3073. },
  3074. "required": true
  3075. }
  3076. ],
  3077. "summary": "Respond to permission",
  3078. "deprecated": true,
  3079. "description": "Approve or deny a permission request from the AI assistant.",
  3080. "responses": {
  3081. "200": {
  3082. "description": "Permission processed successfully",
  3083. "content": {
  3084. "application/json": {
  3085. "schema": {
  3086. "type": "boolean"
  3087. }
  3088. }
  3089. }
  3090. },
  3091. "400": {
  3092. "description": "Bad request",
  3093. "content": {
  3094. "application/json": {
  3095. "schema": {
  3096. "$ref": "#/components/schemas/BadRequestError"
  3097. }
  3098. }
  3099. }
  3100. },
  3101. "404": {
  3102. "description": "Not found",
  3103. "content": {
  3104. "application/json": {
  3105. "schema": {
  3106. "$ref": "#/components/schemas/NotFoundError"
  3107. }
  3108. }
  3109. }
  3110. }
  3111. },
  3112. "requestBody": {
  3113. "content": {
  3114. "application/json": {
  3115. "schema": {
  3116. "type": "object",
  3117. "properties": {
  3118. "response": {
  3119. "type": "string",
  3120. "enum": ["once", "always", "reject"]
  3121. }
  3122. },
  3123. "required": ["response"]
  3124. }
  3125. }
  3126. }
  3127. },
  3128. "x-codeSamples": [
  3129. {
  3130. "lang": "js",
  3131. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  3132. }
  3133. ]
  3134. }
  3135. },
  3136. "/permission/{requestID}/reply": {
  3137. "post": {
  3138. "operationId": "permission.reply",
  3139. "parameters": [
  3140. {
  3141. "in": "query",
  3142. "name": "directory",
  3143. "schema": {
  3144. "type": "string"
  3145. }
  3146. },
  3147. {
  3148. "in": "path",
  3149. "name": "requestID",
  3150. "schema": {
  3151. "type": "string"
  3152. },
  3153. "required": true
  3154. }
  3155. ],
  3156. "summary": "Respond to permission request",
  3157. "description": "Approve or deny a permission request from the AI assistant.",
  3158. "responses": {
  3159. "200": {
  3160. "description": "Permission processed successfully",
  3161. "content": {
  3162. "application/json": {
  3163. "schema": {
  3164. "type": "boolean"
  3165. }
  3166. }
  3167. }
  3168. },
  3169. "400": {
  3170. "description": "Bad request",
  3171. "content": {
  3172. "application/json": {
  3173. "schema": {
  3174. "$ref": "#/components/schemas/BadRequestError"
  3175. }
  3176. }
  3177. }
  3178. },
  3179. "404": {
  3180. "description": "Not found",
  3181. "content": {
  3182. "application/json": {
  3183. "schema": {
  3184. "$ref": "#/components/schemas/NotFoundError"
  3185. }
  3186. }
  3187. }
  3188. }
  3189. },
  3190. "requestBody": {
  3191. "content": {
  3192. "application/json": {
  3193. "schema": {
  3194. "type": "object",
  3195. "properties": {
  3196. "reply": {
  3197. "type": "string",
  3198. "enum": ["once", "always", "reject"]
  3199. },
  3200. "message": {
  3201. "type": "string"
  3202. }
  3203. },
  3204. "required": ["reply"]
  3205. }
  3206. }
  3207. }
  3208. },
  3209. "x-codeSamples": [
  3210. {
  3211. "lang": "js",
  3212. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  3213. }
  3214. ]
  3215. }
  3216. },
  3217. "/permission": {
  3218. "get": {
  3219. "operationId": "permission.list",
  3220. "parameters": [
  3221. {
  3222. "in": "query",
  3223. "name": "directory",
  3224. "schema": {
  3225. "type": "string"
  3226. }
  3227. }
  3228. ],
  3229. "summary": "List pending permissions",
  3230. "description": "Get all pending permission requests across all sessions.",
  3231. "responses": {
  3232. "200": {
  3233. "description": "List of pending permissions",
  3234. "content": {
  3235. "application/json": {
  3236. "schema": {
  3237. "type": "array",
  3238. "items": {
  3239. "$ref": "#/components/schemas/PermissionRequest"
  3240. }
  3241. }
  3242. }
  3243. }
  3244. }
  3245. },
  3246. "x-codeSamples": [
  3247. {
  3248. "lang": "js",
  3249. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  3250. }
  3251. ]
  3252. }
  3253. },
  3254. "/question": {
  3255. "get": {
  3256. "operationId": "question.list",
  3257. "parameters": [
  3258. {
  3259. "in": "query",
  3260. "name": "directory",
  3261. "schema": {
  3262. "type": "string"
  3263. }
  3264. }
  3265. ],
  3266. "summary": "List pending questions",
  3267. "description": "Get all pending question requests across all sessions.",
  3268. "responses": {
  3269. "200": {
  3270. "description": "List of pending questions",
  3271. "content": {
  3272. "application/json": {
  3273. "schema": {
  3274. "type": "array",
  3275. "items": {
  3276. "$ref": "#/components/schemas/QuestionRequest"
  3277. }
  3278. }
  3279. }
  3280. }
  3281. }
  3282. },
  3283. "x-codeSamples": [
  3284. {
  3285. "lang": "js",
  3286. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  3287. }
  3288. ]
  3289. }
  3290. },
  3291. "/question/{requestID}/reply": {
  3292. "post": {
  3293. "operationId": "question.reply",
  3294. "parameters": [
  3295. {
  3296. "in": "query",
  3297. "name": "directory",
  3298. "schema": {
  3299. "type": "string"
  3300. }
  3301. },
  3302. {
  3303. "in": "path",
  3304. "name": "requestID",
  3305. "schema": {
  3306. "type": "string"
  3307. },
  3308. "required": true
  3309. }
  3310. ],
  3311. "summary": "Reply to question request",
  3312. "description": "Provide answers to a question request from the AI assistant.",
  3313. "responses": {
  3314. "200": {
  3315. "description": "Question answered successfully",
  3316. "content": {
  3317. "application/json": {
  3318. "schema": {
  3319. "type": "boolean"
  3320. }
  3321. }
  3322. }
  3323. },
  3324. "400": {
  3325. "description": "Bad request",
  3326. "content": {
  3327. "application/json": {
  3328. "schema": {
  3329. "$ref": "#/components/schemas/BadRequestError"
  3330. }
  3331. }
  3332. }
  3333. },
  3334. "404": {
  3335. "description": "Not found",
  3336. "content": {
  3337. "application/json": {
  3338. "schema": {
  3339. "$ref": "#/components/schemas/NotFoundError"
  3340. }
  3341. }
  3342. }
  3343. }
  3344. },
  3345. "requestBody": {
  3346. "content": {
  3347. "application/json": {
  3348. "schema": {
  3349. "type": "object",
  3350. "properties": {
  3351. "answers": {
  3352. "description": "User answers in order of questions (each answer is an array of selected labels)",
  3353. "type": "array",
  3354. "items": {
  3355. "$ref": "#/components/schemas/QuestionAnswer"
  3356. }
  3357. }
  3358. },
  3359. "required": ["answers"]
  3360. }
  3361. }
  3362. }
  3363. },
  3364. "x-codeSamples": [
  3365. {
  3366. "lang": "js",
  3367. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  3368. }
  3369. ]
  3370. }
  3371. },
  3372. "/question/{requestID}/reject": {
  3373. "post": {
  3374. "operationId": "question.reject",
  3375. "parameters": [
  3376. {
  3377. "in": "query",
  3378. "name": "directory",
  3379. "schema": {
  3380. "type": "string"
  3381. }
  3382. },
  3383. {
  3384. "in": "path",
  3385. "name": "requestID",
  3386. "schema": {
  3387. "type": "string"
  3388. },
  3389. "required": true
  3390. }
  3391. ],
  3392. "summary": "Reject question request",
  3393. "description": "Reject a question request from the AI assistant.",
  3394. "responses": {
  3395. "200": {
  3396. "description": "Question rejected successfully",
  3397. "content": {
  3398. "application/json": {
  3399. "schema": {
  3400. "type": "boolean"
  3401. }
  3402. }
  3403. }
  3404. },
  3405. "400": {
  3406. "description": "Bad request",
  3407. "content": {
  3408. "application/json": {
  3409. "schema": {
  3410. "$ref": "#/components/schemas/BadRequestError"
  3411. }
  3412. }
  3413. }
  3414. },
  3415. "404": {
  3416. "description": "Not found",
  3417. "content": {
  3418. "application/json": {
  3419. "schema": {
  3420. "$ref": "#/components/schemas/NotFoundError"
  3421. }
  3422. }
  3423. }
  3424. }
  3425. },
  3426. "x-codeSamples": [
  3427. {
  3428. "lang": "js",
  3429. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  3430. }
  3431. ]
  3432. }
  3433. },
  3434. "/provider": {
  3435. "get": {
  3436. "operationId": "provider.list",
  3437. "parameters": [
  3438. {
  3439. "in": "query",
  3440. "name": "directory",
  3441. "schema": {
  3442. "type": "string"
  3443. }
  3444. }
  3445. ],
  3446. "summary": "List providers",
  3447. "description": "Get a list of all available AI providers, including both available and connected ones.",
  3448. "responses": {
  3449. "200": {
  3450. "description": "List of providers",
  3451. "content": {
  3452. "application/json": {
  3453. "schema": {
  3454. "type": "object",
  3455. "properties": {
  3456. "all": {
  3457. "type": "array",
  3458. "items": {
  3459. "type": "object",
  3460. "properties": {
  3461. "api": {
  3462. "type": "string"
  3463. },
  3464. "name": {
  3465. "type": "string"
  3466. },
  3467. "env": {
  3468. "type": "array",
  3469. "items": {
  3470. "type": "string"
  3471. }
  3472. },
  3473. "id": {
  3474. "type": "string"
  3475. },
  3476. "npm": {
  3477. "type": "string"
  3478. },
  3479. "models": {
  3480. "type": "object",
  3481. "propertyNames": {
  3482. "type": "string"
  3483. },
  3484. "additionalProperties": {
  3485. "type": "object",
  3486. "properties": {
  3487. "id": {
  3488. "type": "string"
  3489. },
  3490. "name": {
  3491. "type": "string"
  3492. },
  3493. "family": {
  3494. "type": "string"
  3495. },
  3496. "release_date": {
  3497. "type": "string"
  3498. },
  3499. "attachment": {
  3500. "type": "boolean"
  3501. },
  3502. "reasoning": {
  3503. "type": "boolean"
  3504. },
  3505. "temperature": {
  3506. "type": "boolean"
  3507. },
  3508. "tool_call": {
  3509. "type": "boolean"
  3510. },
  3511. "interleaved": {
  3512. "anyOf": [
  3513. {
  3514. "type": "boolean",
  3515. "const": true
  3516. },
  3517. {
  3518. "type": "object",
  3519. "properties": {
  3520. "field": {
  3521. "type": "string",
  3522. "enum": ["reasoning_content", "reasoning_details"]
  3523. }
  3524. },
  3525. "required": ["field"],
  3526. "additionalProperties": false
  3527. }
  3528. ]
  3529. },
  3530. "cost": {
  3531. "type": "object",
  3532. "properties": {
  3533. "input": {
  3534. "type": "number"
  3535. },
  3536. "output": {
  3537. "type": "number"
  3538. },
  3539. "cache_read": {
  3540. "type": "number"
  3541. },
  3542. "cache_write": {
  3543. "type": "number"
  3544. },
  3545. "context_over_200k": {
  3546. "type": "object",
  3547. "properties": {
  3548. "input": {
  3549. "type": "number"
  3550. },
  3551. "output": {
  3552. "type": "number"
  3553. },
  3554. "cache_read": {
  3555. "type": "number"
  3556. },
  3557. "cache_write": {
  3558. "type": "number"
  3559. }
  3560. },
  3561. "required": ["input", "output"]
  3562. }
  3563. },
  3564. "required": ["input", "output"]
  3565. },
  3566. "limit": {
  3567. "type": "object",
  3568. "properties": {
  3569. "context": {
  3570. "type": "number"
  3571. },
  3572. "input": {
  3573. "type": "number"
  3574. },
  3575. "output": {
  3576. "type": "number"
  3577. }
  3578. },
  3579. "required": ["context", "output"]
  3580. },
  3581. "modalities": {
  3582. "type": "object",
  3583. "properties": {
  3584. "input": {
  3585. "type": "array",
  3586. "items": {
  3587. "type": "string",
  3588. "enum": ["text", "audio", "image", "video", "pdf"]
  3589. }
  3590. },
  3591. "output": {
  3592. "type": "array",
  3593. "items": {
  3594. "type": "string",
  3595. "enum": ["text", "audio", "image", "video", "pdf"]
  3596. }
  3597. }
  3598. },
  3599. "required": ["input", "output"]
  3600. },
  3601. "experimental": {
  3602. "type": "boolean"
  3603. },
  3604. "status": {
  3605. "type": "string",
  3606. "enum": ["alpha", "beta", "deprecated"]
  3607. },
  3608. "options": {
  3609. "type": "object",
  3610. "propertyNames": {
  3611. "type": "string"
  3612. },
  3613. "additionalProperties": {}
  3614. },
  3615. "headers": {
  3616. "type": "object",
  3617. "propertyNames": {
  3618. "type": "string"
  3619. },
  3620. "additionalProperties": {
  3621. "type": "string"
  3622. }
  3623. },
  3624. "provider": {
  3625. "type": "object",
  3626. "properties": {
  3627. "npm": {
  3628. "type": "string"
  3629. }
  3630. },
  3631. "required": ["npm"]
  3632. },
  3633. "variants": {
  3634. "type": "object",
  3635. "propertyNames": {
  3636. "type": "string"
  3637. },
  3638. "additionalProperties": {
  3639. "type": "object",
  3640. "propertyNames": {
  3641. "type": "string"
  3642. },
  3643. "additionalProperties": {}
  3644. }
  3645. }
  3646. },
  3647. "required": [
  3648. "id",
  3649. "name",
  3650. "release_date",
  3651. "attachment",
  3652. "reasoning",
  3653. "temperature",
  3654. "tool_call",
  3655. "limit",
  3656. "options"
  3657. ]
  3658. }
  3659. }
  3660. },
  3661. "required": ["name", "env", "id", "models"]
  3662. }
  3663. },
  3664. "default": {
  3665. "type": "object",
  3666. "propertyNames": {
  3667. "type": "string"
  3668. },
  3669. "additionalProperties": {
  3670. "type": "string"
  3671. }
  3672. },
  3673. "connected": {
  3674. "type": "array",
  3675. "items": {
  3676. "type": "string"
  3677. }
  3678. }
  3679. },
  3680. "required": ["all", "default", "connected"]
  3681. }
  3682. }
  3683. }
  3684. }
  3685. },
  3686. "x-codeSamples": [
  3687. {
  3688. "lang": "js",
  3689. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  3690. }
  3691. ]
  3692. }
  3693. },
  3694. "/provider/auth": {
  3695. "get": {
  3696. "operationId": "provider.auth",
  3697. "parameters": [
  3698. {
  3699. "in": "query",
  3700. "name": "directory",
  3701. "schema": {
  3702. "type": "string"
  3703. }
  3704. }
  3705. ],
  3706. "summary": "Get provider auth methods",
  3707. "description": "Retrieve available authentication methods for all AI providers.",
  3708. "responses": {
  3709. "200": {
  3710. "description": "Provider auth methods",
  3711. "content": {
  3712. "application/json": {
  3713. "schema": {
  3714. "type": "object",
  3715. "propertyNames": {
  3716. "type": "string"
  3717. },
  3718. "additionalProperties": {
  3719. "type": "array",
  3720. "items": {
  3721. "$ref": "#/components/schemas/ProviderAuthMethod"
  3722. }
  3723. }
  3724. }
  3725. }
  3726. }
  3727. }
  3728. },
  3729. "x-codeSamples": [
  3730. {
  3731. "lang": "js",
  3732. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  3733. }
  3734. ]
  3735. }
  3736. },
  3737. "/provider/{providerID}/oauth/authorize": {
  3738. "post": {
  3739. "operationId": "provider.oauth.authorize",
  3740. "parameters": [
  3741. {
  3742. "in": "query",
  3743. "name": "directory",
  3744. "schema": {
  3745. "type": "string"
  3746. }
  3747. },
  3748. {
  3749. "in": "path",
  3750. "name": "providerID",
  3751. "schema": {
  3752. "type": "string"
  3753. },
  3754. "required": true,
  3755. "description": "Provider ID"
  3756. }
  3757. ],
  3758. "summary": "OAuth authorize",
  3759. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  3760. "responses": {
  3761. "200": {
  3762. "description": "Authorization URL and method",
  3763. "content": {
  3764. "application/json": {
  3765. "schema": {
  3766. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  3767. }
  3768. }
  3769. }
  3770. },
  3771. "400": {
  3772. "description": "Bad request",
  3773. "content": {
  3774. "application/json": {
  3775. "schema": {
  3776. "$ref": "#/components/schemas/BadRequestError"
  3777. }
  3778. }
  3779. }
  3780. }
  3781. },
  3782. "requestBody": {
  3783. "content": {
  3784. "application/json": {
  3785. "schema": {
  3786. "type": "object",
  3787. "properties": {
  3788. "method": {
  3789. "description": "Auth method index",
  3790. "type": "number"
  3791. }
  3792. },
  3793. "required": ["method"]
  3794. }
  3795. }
  3796. }
  3797. },
  3798. "x-codeSamples": [
  3799. {
  3800. "lang": "js",
  3801. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  3802. }
  3803. ]
  3804. }
  3805. },
  3806. "/provider/{providerID}/oauth/callback": {
  3807. "post": {
  3808. "operationId": "provider.oauth.callback",
  3809. "parameters": [
  3810. {
  3811. "in": "query",
  3812. "name": "directory",
  3813. "schema": {
  3814. "type": "string"
  3815. }
  3816. },
  3817. {
  3818. "in": "path",
  3819. "name": "providerID",
  3820. "schema": {
  3821. "type": "string"
  3822. },
  3823. "required": true,
  3824. "description": "Provider ID"
  3825. }
  3826. ],
  3827. "summary": "OAuth callback",
  3828. "description": "Handle the OAuth callback from a provider after user authorization.",
  3829. "responses": {
  3830. "200": {
  3831. "description": "OAuth callback processed successfully",
  3832. "content": {
  3833. "application/json": {
  3834. "schema": {
  3835. "type": "boolean"
  3836. }
  3837. }
  3838. }
  3839. },
  3840. "400": {
  3841. "description": "Bad request",
  3842. "content": {
  3843. "application/json": {
  3844. "schema": {
  3845. "$ref": "#/components/schemas/BadRequestError"
  3846. }
  3847. }
  3848. }
  3849. }
  3850. },
  3851. "requestBody": {
  3852. "content": {
  3853. "application/json": {
  3854. "schema": {
  3855. "type": "object",
  3856. "properties": {
  3857. "method": {
  3858. "description": "Auth method index",
  3859. "type": "number"
  3860. },
  3861. "code": {
  3862. "description": "OAuth authorization code",
  3863. "type": "string"
  3864. }
  3865. },
  3866. "required": ["method"]
  3867. }
  3868. }
  3869. }
  3870. },
  3871. "x-codeSamples": [
  3872. {
  3873. "lang": "js",
  3874. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  3875. }
  3876. ]
  3877. }
  3878. },
  3879. "/find": {
  3880. "get": {
  3881. "operationId": "find.text",
  3882. "parameters": [
  3883. {
  3884. "in": "query",
  3885. "name": "directory",
  3886. "schema": {
  3887. "type": "string"
  3888. }
  3889. },
  3890. {
  3891. "in": "query",
  3892. "name": "pattern",
  3893. "schema": {
  3894. "type": "string"
  3895. },
  3896. "required": true
  3897. }
  3898. ],
  3899. "summary": "Find text",
  3900. "description": "Search for text patterns across files in the project using ripgrep.",
  3901. "responses": {
  3902. "200": {
  3903. "description": "Matches",
  3904. "content": {
  3905. "application/json": {
  3906. "schema": {
  3907. "type": "array",
  3908. "items": {
  3909. "type": "object",
  3910. "properties": {
  3911. "path": {
  3912. "type": "object",
  3913. "properties": {
  3914. "text": {
  3915. "type": "string"
  3916. }
  3917. },
  3918. "required": ["text"]
  3919. },
  3920. "lines": {
  3921. "type": "object",
  3922. "properties": {
  3923. "text": {
  3924. "type": "string"
  3925. }
  3926. },
  3927. "required": ["text"]
  3928. },
  3929. "line_number": {
  3930. "type": "number"
  3931. },
  3932. "absolute_offset": {
  3933. "type": "number"
  3934. },
  3935. "submatches": {
  3936. "type": "array",
  3937. "items": {
  3938. "type": "object",
  3939. "properties": {
  3940. "match": {
  3941. "type": "object",
  3942. "properties": {
  3943. "text": {
  3944. "type": "string"
  3945. }
  3946. },
  3947. "required": ["text"]
  3948. },
  3949. "start": {
  3950. "type": "number"
  3951. },
  3952. "end": {
  3953. "type": "number"
  3954. }
  3955. },
  3956. "required": ["match", "start", "end"]
  3957. }
  3958. }
  3959. },
  3960. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  3961. }
  3962. }
  3963. }
  3964. }
  3965. }
  3966. },
  3967. "x-codeSamples": [
  3968. {
  3969. "lang": "js",
  3970. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  3971. }
  3972. ]
  3973. }
  3974. },
  3975. "/find/file": {
  3976. "get": {
  3977. "operationId": "find.files",
  3978. "parameters": [
  3979. {
  3980. "in": "query",
  3981. "name": "directory",
  3982. "schema": {
  3983. "type": "string"
  3984. }
  3985. },
  3986. {
  3987. "in": "query",
  3988. "name": "query",
  3989. "schema": {
  3990. "type": "string"
  3991. },
  3992. "required": true
  3993. },
  3994. {
  3995. "in": "query",
  3996. "name": "dirs",
  3997. "schema": {
  3998. "type": "string",
  3999. "enum": ["true", "false"]
  4000. }
  4001. },
  4002. {
  4003. "in": "query",
  4004. "name": "type",
  4005. "schema": {
  4006. "type": "string",
  4007. "enum": ["file", "directory"]
  4008. }
  4009. },
  4010. {
  4011. "in": "query",
  4012. "name": "limit",
  4013. "schema": {
  4014. "type": "integer",
  4015. "minimum": 1,
  4016. "maximum": 200
  4017. }
  4018. }
  4019. ],
  4020. "summary": "Find files",
  4021. "description": "Search for files or directories by name or pattern in the project directory.",
  4022. "responses": {
  4023. "200": {
  4024. "description": "File paths",
  4025. "content": {
  4026. "application/json": {
  4027. "schema": {
  4028. "type": "array",
  4029. "items": {
  4030. "type": "string"
  4031. }
  4032. }
  4033. }
  4034. }
  4035. }
  4036. },
  4037. "x-codeSamples": [
  4038. {
  4039. "lang": "js",
  4040. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  4041. }
  4042. ]
  4043. }
  4044. },
  4045. "/find/symbol": {
  4046. "get": {
  4047. "operationId": "find.symbols",
  4048. "parameters": [
  4049. {
  4050. "in": "query",
  4051. "name": "directory",
  4052. "schema": {
  4053. "type": "string"
  4054. }
  4055. },
  4056. {
  4057. "in": "query",
  4058. "name": "query",
  4059. "schema": {
  4060. "type": "string"
  4061. },
  4062. "required": true
  4063. }
  4064. ],
  4065. "summary": "Find symbols",
  4066. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  4067. "responses": {
  4068. "200": {
  4069. "description": "Symbols",
  4070. "content": {
  4071. "application/json": {
  4072. "schema": {
  4073. "type": "array",
  4074. "items": {
  4075. "$ref": "#/components/schemas/Symbol"
  4076. }
  4077. }
  4078. }
  4079. }
  4080. }
  4081. },
  4082. "x-codeSamples": [
  4083. {
  4084. "lang": "js",
  4085. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  4086. }
  4087. ]
  4088. }
  4089. },
  4090. "/file": {
  4091. "get": {
  4092. "operationId": "file.list",
  4093. "parameters": [
  4094. {
  4095. "in": "query",
  4096. "name": "directory",
  4097. "schema": {
  4098. "type": "string"
  4099. }
  4100. },
  4101. {
  4102. "in": "query",
  4103. "name": "path",
  4104. "schema": {
  4105. "type": "string"
  4106. },
  4107. "required": true
  4108. }
  4109. ],
  4110. "summary": "List files",
  4111. "description": "List files and directories in a specified path.",
  4112. "responses": {
  4113. "200": {
  4114. "description": "Files and directories",
  4115. "content": {
  4116. "application/json": {
  4117. "schema": {
  4118. "type": "array",
  4119. "items": {
  4120. "$ref": "#/components/schemas/FileNode"
  4121. }
  4122. }
  4123. }
  4124. }
  4125. }
  4126. },
  4127. "x-codeSamples": [
  4128. {
  4129. "lang": "js",
  4130. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  4131. }
  4132. ]
  4133. }
  4134. },
  4135. "/file/content": {
  4136. "get": {
  4137. "operationId": "file.read",
  4138. "parameters": [
  4139. {
  4140. "in": "query",
  4141. "name": "directory",
  4142. "schema": {
  4143. "type": "string"
  4144. }
  4145. },
  4146. {
  4147. "in": "query",
  4148. "name": "path",
  4149. "schema": {
  4150. "type": "string"
  4151. },
  4152. "required": true
  4153. }
  4154. ],
  4155. "summary": "Read file",
  4156. "description": "Read the content of a specified file.",
  4157. "responses": {
  4158. "200": {
  4159. "description": "File content",
  4160. "content": {
  4161. "application/json": {
  4162. "schema": {
  4163. "$ref": "#/components/schemas/FileContent"
  4164. }
  4165. }
  4166. }
  4167. }
  4168. },
  4169. "x-codeSamples": [
  4170. {
  4171. "lang": "js",
  4172. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  4173. }
  4174. ]
  4175. }
  4176. },
  4177. "/file/status": {
  4178. "get": {
  4179. "operationId": "file.status",
  4180. "parameters": [
  4181. {
  4182. "in": "query",
  4183. "name": "directory",
  4184. "schema": {
  4185. "type": "string"
  4186. }
  4187. }
  4188. ],
  4189. "summary": "Get file status",
  4190. "description": "Get the git status of all files in the project.",
  4191. "responses": {
  4192. "200": {
  4193. "description": "File status",
  4194. "content": {
  4195. "application/json": {
  4196. "schema": {
  4197. "type": "array",
  4198. "items": {
  4199. "$ref": "#/components/schemas/File"
  4200. }
  4201. }
  4202. }
  4203. }
  4204. }
  4205. },
  4206. "x-codeSamples": [
  4207. {
  4208. "lang": "js",
  4209. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  4210. }
  4211. ]
  4212. }
  4213. },
  4214. "/mcp": {
  4215. "get": {
  4216. "operationId": "mcp.status",
  4217. "parameters": [
  4218. {
  4219. "in": "query",
  4220. "name": "directory",
  4221. "schema": {
  4222. "type": "string"
  4223. }
  4224. }
  4225. ],
  4226. "summary": "Get MCP status",
  4227. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  4228. "responses": {
  4229. "200": {
  4230. "description": "MCP server status",
  4231. "content": {
  4232. "application/json": {
  4233. "schema": {
  4234. "type": "object",
  4235. "propertyNames": {
  4236. "type": "string"
  4237. },
  4238. "additionalProperties": {
  4239. "$ref": "#/components/schemas/MCPStatus"
  4240. }
  4241. }
  4242. }
  4243. }
  4244. }
  4245. },
  4246. "x-codeSamples": [
  4247. {
  4248. "lang": "js",
  4249. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  4250. }
  4251. ]
  4252. },
  4253. "post": {
  4254. "operationId": "mcp.add",
  4255. "parameters": [
  4256. {
  4257. "in": "query",
  4258. "name": "directory",
  4259. "schema": {
  4260. "type": "string"
  4261. }
  4262. }
  4263. ],
  4264. "summary": "Add MCP server",
  4265. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  4266. "responses": {
  4267. "200": {
  4268. "description": "MCP server added successfully",
  4269. "content": {
  4270. "application/json": {
  4271. "schema": {
  4272. "type": "object",
  4273. "propertyNames": {
  4274. "type": "string"
  4275. },
  4276. "additionalProperties": {
  4277. "$ref": "#/components/schemas/MCPStatus"
  4278. }
  4279. }
  4280. }
  4281. }
  4282. },
  4283. "400": {
  4284. "description": "Bad request",
  4285. "content": {
  4286. "application/json": {
  4287. "schema": {
  4288. "$ref": "#/components/schemas/BadRequestError"
  4289. }
  4290. }
  4291. }
  4292. }
  4293. },
  4294. "requestBody": {
  4295. "content": {
  4296. "application/json": {
  4297. "schema": {
  4298. "type": "object",
  4299. "properties": {
  4300. "name": {
  4301. "type": "string"
  4302. },
  4303. "config": {
  4304. "anyOf": [
  4305. {
  4306. "$ref": "#/components/schemas/McpLocalConfig"
  4307. },
  4308. {
  4309. "$ref": "#/components/schemas/McpRemoteConfig"
  4310. }
  4311. ]
  4312. }
  4313. },
  4314. "required": ["name", "config"]
  4315. }
  4316. }
  4317. }
  4318. },
  4319. "x-codeSamples": [
  4320. {
  4321. "lang": "js",
  4322. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  4323. }
  4324. ]
  4325. }
  4326. },
  4327. "/mcp/{name}/auth": {
  4328. "post": {
  4329. "operationId": "mcp.auth.start",
  4330. "parameters": [
  4331. {
  4332. "in": "query",
  4333. "name": "directory",
  4334. "schema": {
  4335. "type": "string"
  4336. }
  4337. },
  4338. {
  4339. "schema": {
  4340. "type": "string"
  4341. },
  4342. "in": "path",
  4343. "name": "name",
  4344. "required": true
  4345. }
  4346. ],
  4347. "summary": "Start MCP OAuth",
  4348. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  4349. "responses": {
  4350. "200": {
  4351. "description": "OAuth flow started",
  4352. "content": {
  4353. "application/json": {
  4354. "schema": {
  4355. "type": "object",
  4356. "properties": {
  4357. "authorizationUrl": {
  4358. "description": "URL to open in browser for authorization",
  4359. "type": "string"
  4360. }
  4361. },
  4362. "required": ["authorizationUrl"]
  4363. }
  4364. }
  4365. }
  4366. },
  4367. "400": {
  4368. "description": "Bad request",
  4369. "content": {
  4370. "application/json": {
  4371. "schema": {
  4372. "$ref": "#/components/schemas/BadRequestError"
  4373. }
  4374. }
  4375. }
  4376. },
  4377. "404": {
  4378. "description": "Not found",
  4379. "content": {
  4380. "application/json": {
  4381. "schema": {
  4382. "$ref": "#/components/schemas/NotFoundError"
  4383. }
  4384. }
  4385. }
  4386. }
  4387. },
  4388. "x-codeSamples": [
  4389. {
  4390. "lang": "js",
  4391. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  4392. }
  4393. ]
  4394. },
  4395. "delete": {
  4396. "operationId": "mcp.auth.remove",
  4397. "parameters": [
  4398. {
  4399. "in": "query",
  4400. "name": "directory",
  4401. "schema": {
  4402. "type": "string"
  4403. }
  4404. },
  4405. {
  4406. "schema": {
  4407. "type": "string"
  4408. },
  4409. "in": "path",
  4410. "name": "name",
  4411. "required": true
  4412. }
  4413. ],
  4414. "summary": "Remove MCP OAuth",
  4415. "description": "Remove OAuth credentials for an MCP server",
  4416. "responses": {
  4417. "200": {
  4418. "description": "OAuth credentials removed",
  4419. "content": {
  4420. "application/json": {
  4421. "schema": {
  4422. "type": "object",
  4423. "properties": {
  4424. "success": {
  4425. "type": "boolean",
  4426. "const": true
  4427. }
  4428. },
  4429. "required": ["success"]
  4430. }
  4431. }
  4432. }
  4433. },
  4434. "404": {
  4435. "description": "Not found",
  4436. "content": {
  4437. "application/json": {
  4438. "schema": {
  4439. "$ref": "#/components/schemas/NotFoundError"
  4440. }
  4441. }
  4442. }
  4443. }
  4444. },
  4445. "x-codeSamples": [
  4446. {
  4447. "lang": "js",
  4448. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  4449. }
  4450. ]
  4451. }
  4452. },
  4453. "/mcp/{name}/auth/callback": {
  4454. "post": {
  4455. "operationId": "mcp.auth.callback",
  4456. "parameters": [
  4457. {
  4458. "in": "query",
  4459. "name": "directory",
  4460. "schema": {
  4461. "type": "string"
  4462. }
  4463. },
  4464. {
  4465. "schema": {
  4466. "type": "string"
  4467. },
  4468. "in": "path",
  4469. "name": "name",
  4470. "required": true
  4471. }
  4472. ],
  4473. "summary": "Complete MCP OAuth",
  4474. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  4475. "responses": {
  4476. "200": {
  4477. "description": "OAuth authentication completed",
  4478. "content": {
  4479. "application/json": {
  4480. "schema": {
  4481. "$ref": "#/components/schemas/MCPStatus"
  4482. }
  4483. }
  4484. }
  4485. },
  4486. "400": {
  4487. "description": "Bad request",
  4488. "content": {
  4489. "application/json": {
  4490. "schema": {
  4491. "$ref": "#/components/schemas/BadRequestError"
  4492. }
  4493. }
  4494. }
  4495. },
  4496. "404": {
  4497. "description": "Not found",
  4498. "content": {
  4499. "application/json": {
  4500. "schema": {
  4501. "$ref": "#/components/schemas/NotFoundError"
  4502. }
  4503. }
  4504. }
  4505. }
  4506. },
  4507. "requestBody": {
  4508. "content": {
  4509. "application/json": {
  4510. "schema": {
  4511. "type": "object",
  4512. "properties": {
  4513. "code": {
  4514. "description": "Authorization code from OAuth callback",
  4515. "type": "string"
  4516. }
  4517. },
  4518. "required": ["code"]
  4519. }
  4520. }
  4521. }
  4522. },
  4523. "x-codeSamples": [
  4524. {
  4525. "lang": "js",
  4526. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  4527. }
  4528. ]
  4529. }
  4530. },
  4531. "/mcp/{name}/auth/authenticate": {
  4532. "post": {
  4533. "operationId": "mcp.auth.authenticate",
  4534. "parameters": [
  4535. {
  4536. "in": "query",
  4537. "name": "directory",
  4538. "schema": {
  4539. "type": "string"
  4540. }
  4541. },
  4542. {
  4543. "schema": {
  4544. "type": "string"
  4545. },
  4546. "in": "path",
  4547. "name": "name",
  4548. "required": true
  4549. }
  4550. ],
  4551. "summary": "Authenticate MCP OAuth",
  4552. "description": "Start OAuth flow and wait for callback (opens browser)",
  4553. "responses": {
  4554. "200": {
  4555. "description": "OAuth authentication completed",
  4556. "content": {
  4557. "application/json": {
  4558. "schema": {
  4559. "$ref": "#/components/schemas/MCPStatus"
  4560. }
  4561. }
  4562. }
  4563. },
  4564. "400": {
  4565. "description": "Bad request",
  4566. "content": {
  4567. "application/json": {
  4568. "schema": {
  4569. "$ref": "#/components/schemas/BadRequestError"
  4570. }
  4571. }
  4572. }
  4573. },
  4574. "404": {
  4575. "description": "Not found",
  4576. "content": {
  4577. "application/json": {
  4578. "schema": {
  4579. "$ref": "#/components/schemas/NotFoundError"
  4580. }
  4581. }
  4582. }
  4583. }
  4584. },
  4585. "x-codeSamples": [
  4586. {
  4587. "lang": "js",
  4588. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  4589. }
  4590. ]
  4591. }
  4592. },
  4593. "/mcp/{name}/connect": {
  4594. "post": {
  4595. "operationId": "mcp.connect",
  4596. "parameters": [
  4597. {
  4598. "in": "query",
  4599. "name": "directory",
  4600. "schema": {
  4601. "type": "string"
  4602. }
  4603. },
  4604. {
  4605. "in": "path",
  4606. "name": "name",
  4607. "schema": {
  4608. "type": "string"
  4609. },
  4610. "required": true
  4611. }
  4612. ],
  4613. "description": "Connect an MCP server",
  4614. "responses": {
  4615. "200": {
  4616. "description": "MCP server connected successfully",
  4617. "content": {
  4618. "application/json": {
  4619. "schema": {
  4620. "type": "boolean"
  4621. }
  4622. }
  4623. }
  4624. }
  4625. },
  4626. "x-codeSamples": [
  4627. {
  4628. "lang": "js",
  4629. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  4630. }
  4631. ]
  4632. }
  4633. },
  4634. "/mcp/{name}/disconnect": {
  4635. "post": {
  4636. "operationId": "mcp.disconnect",
  4637. "parameters": [
  4638. {
  4639. "in": "query",
  4640. "name": "directory",
  4641. "schema": {
  4642. "type": "string"
  4643. }
  4644. },
  4645. {
  4646. "in": "path",
  4647. "name": "name",
  4648. "schema": {
  4649. "type": "string"
  4650. },
  4651. "required": true
  4652. }
  4653. ],
  4654. "description": "Disconnect an MCP server",
  4655. "responses": {
  4656. "200": {
  4657. "description": "MCP server disconnected successfully",
  4658. "content": {
  4659. "application/json": {
  4660. "schema": {
  4661. "type": "boolean"
  4662. }
  4663. }
  4664. }
  4665. }
  4666. },
  4667. "x-codeSamples": [
  4668. {
  4669. "lang": "js",
  4670. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  4671. }
  4672. ]
  4673. }
  4674. },
  4675. "/tui/append-prompt": {
  4676. "post": {
  4677. "operationId": "tui.appendPrompt",
  4678. "parameters": [
  4679. {
  4680. "in": "query",
  4681. "name": "directory",
  4682. "schema": {
  4683. "type": "string"
  4684. }
  4685. }
  4686. ],
  4687. "summary": "Append TUI prompt",
  4688. "description": "Append prompt to the TUI",
  4689. "responses": {
  4690. "200": {
  4691. "description": "Prompt processed successfully",
  4692. "content": {
  4693. "application/json": {
  4694. "schema": {
  4695. "type": "boolean"
  4696. }
  4697. }
  4698. }
  4699. },
  4700. "400": {
  4701. "description": "Bad request",
  4702. "content": {
  4703. "application/json": {
  4704. "schema": {
  4705. "$ref": "#/components/schemas/BadRequestError"
  4706. }
  4707. }
  4708. }
  4709. }
  4710. },
  4711. "requestBody": {
  4712. "content": {
  4713. "application/json": {
  4714. "schema": {
  4715. "type": "object",
  4716. "properties": {
  4717. "text": {
  4718. "type": "string"
  4719. }
  4720. },
  4721. "required": ["text"]
  4722. }
  4723. }
  4724. }
  4725. },
  4726. "x-codeSamples": [
  4727. {
  4728. "lang": "js",
  4729. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  4730. }
  4731. ]
  4732. }
  4733. },
  4734. "/tui/open-help": {
  4735. "post": {
  4736. "operationId": "tui.openHelp",
  4737. "parameters": [
  4738. {
  4739. "in": "query",
  4740. "name": "directory",
  4741. "schema": {
  4742. "type": "string"
  4743. }
  4744. }
  4745. ],
  4746. "summary": "Open help dialog",
  4747. "description": "Open the help dialog in the TUI to display user assistance information.",
  4748. "responses": {
  4749. "200": {
  4750. "description": "Help dialog opened successfully",
  4751. "content": {
  4752. "application/json": {
  4753. "schema": {
  4754. "type": "boolean"
  4755. }
  4756. }
  4757. }
  4758. }
  4759. },
  4760. "x-codeSamples": [
  4761. {
  4762. "lang": "js",
  4763. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  4764. }
  4765. ]
  4766. }
  4767. },
  4768. "/tui/open-sessions": {
  4769. "post": {
  4770. "operationId": "tui.openSessions",
  4771. "parameters": [
  4772. {
  4773. "in": "query",
  4774. "name": "directory",
  4775. "schema": {
  4776. "type": "string"
  4777. }
  4778. }
  4779. ],
  4780. "summary": "Open sessions dialog",
  4781. "description": "Open the session dialog",
  4782. "responses": {
  4783. "200": {
  4784. "description": "Session dialog opened successfully",
  4785. "content": {
  4786. "application/json": {
  4787. "schema": {
  4788. "type": "boolean"
  4789. }
  4790. }
  4791. }
  4792. }
  4793. },
  4794. "x-codeSamples": [
  4795. {
  4796. "lang": "js",
  4797. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  4798. }
  4799. ]
  4800. }
  4801. },
  4802. "/tui/open-themes": {
  4803. "post": {
  4804. "operationId": "tui.openThemes",
  4805. "parameters": [
  4806. {
  4807. "in": "query",
  4808. "name": "directory",
  4809. "schema": {
  4810. "type": "string"
  4811. }
  4812. }
  4813. ],
  4814. "summary": "Open themes dialog",
  4815. "description": "Open the theme dialog",
  4816. "responses": {
  4817. "200": {
  4818. "description": "Theme dialog opened successfully",
  4819. "content": {
  4820. "application/json": {
  4821. "schema": {
  4822. "type": "boolean"
  4823. }
  4824. }
  4825. }
  4826. }
  4827. },
  4828. "x-codeSamples": [
  4829. {
  4830. "lang": "js",
  4831. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  4832. }
  4833. ]
  4834. }
  4835. },
  4836. "/tui/open-models": {
  4837. "post": {
  4838. "operationId": "tui.openModels",
  4839. "parameters": [
  4840. {
  4841. "in": "query",
  4842. "name": "directory",
  4843. "schema": {
  4844. "type": "string"
  4845. }
  4846. }
  4847. ],
  4848. "summary": "Open models dialog",
  4849. "description": "Open the model dialog",
  4850. "responses": {
  4851. "200": {
  4852. "description": "Model dialog opened successfully",
  4853. "content": {
  4854. "application/json": {
  4855. "schema": {
  4856. "type": "boolean"
  4857. }
  4858. }
  4859. }
  4860. }
  4861. },
  4862. "x-codeSamples": [
  4863. {
  4864. "lang": "js",
  4865. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  4866. }
  4867. ]
  4868. }
  4869. },
  4870. "/tui/submit-prompt": {
  4871. "post": {
  4872. "operationId": "tui.submitPrompt",
  4873. "parameters": [
  4874. {
  4875. "in": "query",
  4876. "name": "directory",
  4877. "schema": {
  4878. "type": "string"
  4879. }
  4880. }
  4881. ],
  4882. "summary": "Submit TUI prompt",
  4883. "description": "Submit the prompt",
  4884. "responses": {
  4885. "200": {
  4886. "description": "Prompt submitted successfully",
  4887. "content": {
  4888. "application/json": {
  4889. "schema": {
  4890. "type": "boolean"
  4891. }
  4892. }
  4893. }
  4894. }
  4895. },
  4896. "x-codeSamples": [
  4897. {
  4898. "lang": "js",
  4899. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  4900. }
  4901. ]
  4902. }
  4903. },
  4904. "/tui/clear-prompt": {
  4905. "post": {
  4906. "operationId": "tui.clearPrompt",
  4907. "parameters": [
  4908. {
  4909. "in": "query",
  4910. "name": "directory",
  4911. "schema": {
  4912. "type": "string"
  4913. }
  4914. }
  4915. ],
  4916. "summary": "Clear TUI prompt",
  4917. "description": "Clear the prompt",
  4918. "responses": {
  4919. "200": {
  4920. "description": "Prompt cleared successfully",
  4921. "content": {
  4922. "application/json": {
  4923. "schema": {
  4924. "type": "boolean"
  4925. }
  4926. }
  4927. }
  4928. }
  4929. },
  4930. "x-codeSamples": [
  4931. {
  4932. "lang": "js",
  4933. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  4934. }
  4935. ]
  4936. }
  4937. },
  4938. "/tui/execute-command": {
  4939. "post": {
  4940. "operationId": "tui.executeCommand",
  4941. "parameters": [
  4942. {
  4943. "in": "query",
  4944. "name": "directory",
  4945. "schema": {
  4946. "type": "string"
  4947. }
  4948. }
  4949. ],
  4950. "summary": "Execute TUI command",
  4951. "description": "Execute a TUI command (e.g. agent_cycle)",
  4952. "responses": {
  4953. "200": {
  4954. "description": "Command executed successfully",
  4955. "content": {
  4956. "application/json": {
  4957. "schema": {
  4958. "type": "boolean"
  4959. }
  4960. }
  4961. }
  4962. },
  4963. "400": {
  4964. "description": "Bad request",
  4965. "content": {
  4966. "application/json": {
  4967. "schema": {
  4968. "$ref": "#/components/schemas/BadRequestError"
  4969. }
  4970. }
  4971. }
  4972. }
  4973. },
  4974. "requestBody": {
  4975. "content": {
  4976. "application/json": {
  4977. "schema": {
  4978. "type": "object",
  4979. "properties": {
  4980. "command": {
  4981. "type": "string"
  4982. }
  4983. },
  4984. "required": ["command"]
  4985. }
  4986. }
  4987. }
  4988. },
  4989. "x-codeSamples": [
  4990. {
  4991. "lang": "js",
  4992. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  4993. }
  4994. ]
  4995. }
  4996. },
  4997. "/tui/show-toast": {
  4998. "post": {
  4999. "operationId": "tui.showToast",
  5000. "parameters": [
  5001. {
  5002. "in": "query",
  5003. "name": "directory",
  5004. "schema": {
  5005. "type": "string"
  5006. }
  5007. }
  5008. ],
  5009. "summary": "Show TUI toast",
  5010. "description": "Show a toast notification in the TUI",
  5011. "responses": {
  5012. "200": {
  5013. "description": "Toast notification shown successfully",
  5014. "content": {
  5015. "application/json": {
  5016. "schema": {
  5017. "type": "boolean"
  5018. }
  5019. }
  5020. }
  5021. }
  5022. },
  5023. "requestBody": {
  5024. "content": {
  5025. "application/json": {
  5026. "schema": {
  5027. "type": "object",
  5028. "properties": {
  5029. "title": {
  5030. "type": "string"
  5031. },
  5032. "message": {
  5033. "type": "string"
  5034. },
  5035. "variant": {
  5036. "type": "string",
  5037. "enum": ["info", "success", "warning", "error"]
  5038. },
  5039. "duration": {
  5040. "description": "Duration in milliseconds",
  5041. "default": 5000,
  5042. "type": "number"
  5043. }
  5044. },
  5045. "required": ["message", "variant"]
  5046. }
  5047. }
  5048. }
  5049. },
  5050. "x-codeSamples": [
  5051. {
  5052. "lang": "js",
  5053. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  5054. }
  5055. ]
  5056. }
  5057. },
  5058. "/tui/publish": {
  5059. "post": {
  5060. "operationId": "tui.publish",
  5061. "parameters": [
  5062. {
  5063. "in": "query",
  5064. "name": "directory",
  5065. "schema": {
  5066. "type": "string"
  5067. }
  5068. }
  5069. ],
  5070. "summary": "Publish TUI event",
  5071. "description": "Publish a TUI event",
  5072. "responses": {
  5073. "200": {
  5074. "description": "Event published successfully",
  5075. "content": {
  5076. "application/json": {
  5077. "schema": {
  5078. "type": "boolean"
  5079. }
  5080. }
  5081. }
  5082. },
  5083. "400": {
  5084. "description": "Bad request",
  5085. "content": {
  5086. "application/json": {
  5087. "schema": {
  5088. "$ref": "#/components/schemas/BadRequestError"
  5089. }
  5090. }
  5091. }
  5092. }
  5093. },
  5094. "requestBody": {
  5095. "content": {
  5096. "application/json": {
  5097. "schema": {
  5098. "anyOf": [
  5099. {
  5100. "$ref": "#/components/schemas/Event.tui.prompt.append"
  5101. },
  5102. {
  5103. "$ref": "#/components/schemas/Event.tui.command.execute"
  5104. },
  5105. {
  5106. "$ref": "#/components/schemas/Event.tui.toast.show"
  5107. },
  5108. {
  5109. "$ref": "#/components/schemas/Event.tui.session.select"
  5110. }
  5111. ]
  5112. }
  5113. }
  5114. }
  5115. },
  5116. "x-codeSamples": [
  5117. {
  5118. "lang": "js",
  5119. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  5120. }
  5121. ]
  5122. }
  5123. },
  5124. "/tui/select-session": {
  5125. "post": {
  5126. "operationId": "tui.selectSession",
  5127. "parameters": [
  5128. {
  5129. "in": "query",
  5130. "name": "directory",
  5131. "schema": {
  5132. "type": "string"
  5133. }
  5134. }
  5135. ],
  5136. "summary": "Select session",
  5137. "description": "Navigate the TUI to display the specified session.",
  5138. "responses": {
  5139. "200": {
  5140. "description": "Session selected successfully",
  5141. "content": {
  5142. "application/json": {
  5143. "schema": {
  5144. "type": "boolean"
  5145. }
  5146. }
  5147. }
  5148. },
  5149. "400": {
  5150. "description": "Bad request",
  5151. "content": {
  5152. "application/json": {
  5153. "schema": {
  5154. "$ref": "#/components/schemas/BadRequestError"
  5155. }
  5156. }
  5157. }
  5158. },
  5159. "404": {
  5160. "description": "Not found",
  5161. "content": {
  5162. "application/json": {
  5163. "schema": {
  5164. "$ref": "#/components/schemas/NotFoundError"
  5165. }
  5166. }
  5167. }
  5168. }
  5169. },
  5170. "requestBody": {
  5171. "content": {
  5172. "application/json": {
  5173. "schema": {
  5174. "type": "object",
  5175. "properties": {
  5176. "sessionID": {
  5177. "description": "Session ID to navigate to",
  5178. "type": "string",
  5179. "pattern": "^ses"
  5180. }
  5181. },
  5182. "required": ["sessionID"]
  5183. }
  5184. }
  5185. }
  5186. },
  5187. "x-codeSamples": [
  5188. {
  5189. "lang": "js",
  5190. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  5191. }
  5192. ]
  5193. }
  5194. },
  5195. "/tui/control/next": {
  5196. "get": {
  5197. "operationId": "tui.control.next",
  5198. "parameters": [
  5199. {
  5200. "in": "query",
  5201. "name": "directory",
  5202. "schema": {
  5203. "type": "string"
  5204. }
  5205. }
  5206. ],
  5207. "summary": "Get next TUI request",
  5208. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  5209. "responses": {
  5210. "200": {
  5211. "description": "Next TUI request",
  5212. "content": {
  5213. "application/json": {
  5214. "schema": {
  5215. "type": "object",
  5216. "properties": {
  5217. "path": {
  5218. "type": "string"
  5219. },
  5220. "body": {}
  5221. },
  5222. "required": ["path", "body"]
  5223. }
  5224. }
  5225. }
  5226. }
  5227. },
  5228. "x-codeSamples": [
  5229. {
  5230. "lang": "js",
  5231. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  5232. }
  5233. ]
  5234. }
  5235. },
  5236. "/tui/control/response": {
  5237. "post": {
  5238. "operationId": "tui.control.response",
  5239. "parameters": [
  5240. {
  5241. "in": "query",
  5242. "name": "directory",
  5243. "schema": {
  5244. "type": "string"
  5245. }
  5246. }
  5247. ],
  5248. "summary": "Submit TUI response",
  5249. "description": "Submit a response to the TUI request queue to complete a pending request.",
  5250. "responses": {
  5251. "200": {
  5252. "description": "Response submitted successfully",
  5253. "content": {
  5254. "application/json": {
  5255. "schema": {
  5256. "type": "boolean"
  5257. }
  5258. }
  5259. }
  5260. }
  5261. },
  5262. "requestBody": {
  5263. "content": {
  5264. "application/json": {
  5265. "schema": {}
  5266. }
  5267. }
  5268. },
  5269. "x-codeSamples": [
  5270. {
  5271. "lang": "js",
  5272. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  5273. }
  5274. ]
  5275. }
  5276. },
  5277. "/instance/dispose": {
  5278. "post": {
  5279. "operationId": "instance.dispose",
  5280. "parameters": [
  5281. {
  5282. "in": "query",
  5283. "name": "directory",
  5284. "schema": {
  5285. "type": "string"
  5286. }
  5287. }
  5288. ],
  5289. "summary": "Dispose instance",
  5290. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  5291. "responses": {
  5292. "200": {
  5293. "description": "Instance disposed",
  5294. "content": {
  5295. "application/json": {
  5296. "schema": {
  5297. "type": "boolean"
  5298. }
  5299. }
  5300. }
  5301. }
  5302. },
  5303. "x-codeSamples": [
  5304. {
  5305. "lang": "js",
  5306. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  5307. }
  5308. ]
  5309. }
  5310. },
  5311. "/path": {
  5312. "get": {
  5313. "operationId": "path.get",
  5314. "parameters": [
  5315. {
  5316. "in": "query",
  5317. "name": "directory",
  5318. "schema": {
  5319. "type": "string"
  5320. }
  5321. }
  5322. ],
  5323. "summary": "Get paths",
  5324. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  5325. "responses": {
  5326. "200": {
  5327. "description": "Path",
  5328. "content": {
  5329. "application/json": {
  5330. "schema": {
  5331. "$ref": "#/components/schemas/Path"
  5332. }
  5333. }
  5334. }
  5335. }
  5336. },
  5337. "x-codeSamples": [
  5338. {
  5339. "lang": "js",
  5340. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  5341. }
  5342. ]
  5343. }
  5344. },
  5345. "/vcs": {
  5346. "get": {
  5347. "operationId": "vcs.get",
  5348. "parameters": [
  5349. {
  5350. "in": "query",
  5351. "name": "directory",
  5352. "schema": {
  5353. "type": "string"
  5354. }
  5355. }
  5356. ],
  5357. "summary": "Get VCS info",
  5358. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  5359. "responses": {
  5360. "200": {
  5361. "description": "VCS info",
  5362. "content": {
  5363. "application/json": {
  5364. "schema": {
  5365. "$ref": "#/components/schemas/VcsInfo"
  5366. }
  5367. }
  5368. }
  5369. }
  5370. },
  5371. "x-codeSamples": [
  5372. {
  5373. "lang": "js",
  5374. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  5375. }
  5376. ]
  5377. }
  5378. },
  5379. "/command": {
  5380. "get": {
  5381. "operationId": "command.list",
  5382. "parameters": [
  5383. {
  5384. "in": "query",
  5385. "name": "directory",
  5386. "schema": {
  5387. "type": "string"
  5388. }
  5389. }
  5390. ],
  5391. "summary": "List commands",
  5392. "description": "Get a list of all available commands in the OpenCode system.",
  5393. "responses": {
  5394. "200": {
  5395. "description": "List of commands",
  5396. "content": {
  5397. "application/json": {
  5398. "schema": {
  5399. "type": "array",
  5400. "items": {
  5401. "$ref": "#/components/schemas/Command"
  5402. }
  5403. }
  5404. }
  5405. }
  5406. }
  5407. },
  5408. "x-codeSamples": [
  5409. {
  5410. "lang": "js",
  5411. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  5412. }
  5413. ]
  5414. }
  5415. },
  5416. "/log": {
  5417. "post": {
  5418. "operationId": "app.log",
  5419. "parameters": [
  5420. {
  5421. "in": "query",
  5422. "name": "directory",
  5423. "schema": {
  5424. "type": "string"
  5425. }
  5426. }
  5427. ],
  5428. "summary": "Write log",
  5429. "description": "Write a log entry to the server logs with specified level and metadata.",
  5430. "responses": {
  5431. "200": {
  5432. "description": "Log entry written successfully",
  5433. "content": {
  5434. "application/json": {
  5435. "schema": {
  5436. "type": "boolean"
  5437. }
  5438. }
  5439. }
  5440. },
  5441. "400": {
  5442. "description": "Bad request",
  5443. "content": {
  5444. "application/json": {
  5445. "schema": {
  5446. "$ref": "#/components/schemas/BadRequestError"
  5447. }
  5448. }
  5449. }
  5450. }
  5451. },
  5452. "requestBody": {
  5453. "content": {
  5454. "application/json": {
  5455. "schema": {
  5456. "type": "object",
  5457. "properties": {
  5458. "service": {
  5459. "description": "Service name for the log entry",
  5460. "type": "string"
  5461. },
  5462. "level": {
  5463. "description": "Log level",
  5464. "type": "string",
  5465. "enum": ["debug", "info", "error", "warn"]
  5466. },
  5467. "message": {
  5468. "description": "Log message",
  5469. "type": "string"
  5470. },
  5471. "extra": {
  5472. "description": "Additional metadata for the log entry",
  5473. "type": "object",
  5474. "propertyNames": {
  5475. "type": "string"
  5476. },
  5477. "additionalProperties": {}
  5478. }
  5479. },
  5480. "required": ["service", "level", "message"]
  5481. }
  5482. }
  5483. }
  5484. },
  5485. "x-codeSamples": [
  5486. {
  5487. "lang": "js",
  5488. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  5489. }
  5490. ]
  5491. }
  5492. },
  5493. "/agent": {
  5494. "get": {
  5495. "operationId": "app.agents",
  5496. "parameters": [
  5497. {
  5498. "in": "query",
  5499. "name": "directory",
  5500. "schema": {
  5501. "type": "string"
  5502. }
  5503. }
  5504. ],
  5505. "summary": "List agents",
  5506. "description": "Get a list of all available AI agents in the OpenCode system.",
  5507. "responses": {
  5508. "200": {
  5509. "description": "List of agents",
  5510. "content": {
  5511. "application/json": {
  5512. "schema": {
  5513. "type": "array",
  5514. "items": {
  5515. "$ref": "#/components/schemas/Agent"
  5516. }
  5517. }
  5518. }
  5519. }
  5520. }
  5521. },
  5522. "x-codeSamples": [
  5523. {
  5524. "lang": "js",
  5525. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  5526. }
  5527. ]
  5528. }
  5529. },
  5530. "/skill": {
  5531. "get": {
  5532. "operationId": "app.skills",
  5533. "parameters": [
  5534. {
  5535. "in": "query",
  5536. "name": "directory",
  5537. "schema": {
  5538. "type": "string"
  5539. }
  5540. }
  5541. ],
  5542. "summary": "List skills",
  5543. "description": "Get a list of all available skills in the OpenCode system.",
  5544. "responses": {
  5545. "200": {
  5546. "description": "List of skills",
  5547. "content": {
  5548. "application/json": {
  5549. "schema": {
  5550. "type": "array",
  5551. "items": {
  5552. "type": "object",
  5553. "properties": {
  5554. "name": {
  5555. "type": "string"
  5556. },
  5557. "description": {
  5558. "type": "string"
  5559. },
  5560. "location": {
  5561. "type": "string"
  5562. }
  5563. },
  5564. "required": ["name", "description", "location"]
  5565. }
  5566. }
  5567. }
  5568. }
  5569. }
  5570. },
  5571. "x-codeSamples": [
  5572. {
  5573. "lang": "js",
  5574. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  5575. }
  5576. ]
  5577. }
  5578. },
  5579. "/lsp": {
  5580. "get": {
  5581. "operationId": "lsp.status",
  5582. "parameters": [
  5583. {
  5584. "in": "query",
  5585. "name": "directory",
  5586. "schema": {
  5587. "type": "string"
  5588. }
  5589. }
  5590. ],
  5591. "summary": "Get LSP status",
  5592. "description": "Get LSP server status",
  5593. "responses": {
  5594. "200": {
  5595. "description": "LSP server status",
  5596. "content": {
  5597. "application/json": {
  5598. "schema": {
  5599. "type": "array",
  5600. "items": {
  5601. "$ref": "#/components/schemas/LSPStatus"
  5602. }
  5603. }
  5604. }
  5605. }
  5606. }
  5607. },
  5608. "x-codeSamples": [
  5609. {
  5610. "lang": "js",
  5611. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  5612. }
  5613. ]
  5614. }
  5615. },
  5616. "/formatter": {
  5617. "get": {
  5618. "operationId": "formatter.status",
  5619. "parameters": [
  5620. {
  5621. "in": "query",
  5622. "name": "directory",
  5623. "schema": {
  5624. "type": "string"
  5625. }
  5626. }
  5627. ],
  5628. "summary": "Get formatter status",
  5629. "description": "Get formatter status",
  5630. "responses": {
  5631. "200": {
  5632. "description": "Formatter status",
  5633. "content": {
  5634. "application/json": {
  5635. "schema": {
  5636. "type": "array",
  5637. "items": {
  5638. "$ref": "#/components/schemas/FormatterStatus"
  5639. }
  5640. }
  5641. }
  5642. }
  5643. }
  5644. },
  5645. "x-codeSamples": [
  5646. {
  5647. "lang": "js",
  5648. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  5649. }
  5650. ]
  5651. }
  5652. },
  5653. "/auth/{providerID}": {
  5654. "put": {
  5655. "operationId": "auth.set",
  5656. "parameters": [
  5657. {
  5658. "in": "query",
  5659. "name": "directory",
  5660. "schema": {
  5661. "type": "string"
  5662. }
  5663. },
  5664. {
  5665. "in": "path",
  5666. "name": "providerID",
  5667. "schema": {
  5668. "type": "string"
  5669. },
  5670. "required": true
  5671. }
  5672. ],
  5673. "summary": "Set auth credentials",
  5674. "description": "Set authentication credentials",
  5675. "responses": {
  5676. "200": {
  5677. "description": "Successfully set authentication credentials",
  5678. "content": {
  5679. "application/json": {
  5680. "schema": {
  5681. "type": "boolean"
  5682. }
  5683. }
  5684. }
  5685. },
  5686. "400": {
  5687. "description": "Bad request",
  5688. "content": {
  5689. "application/json": {
  5690. "schema": {
  5691. "$ref": "#/components/schemas/BadRequestError"
  5692. }
  5693. }
  5694. }
  5695. }
  5696. },
  5697. "requestBody": {
  5698. "content": {
  5699. "application/json": {
  5700. "schema": {
  5701. "$ref": "#/components/schemas/Auth"
  5702. }
  5703. }
  5704. }
  5705. },
  5706. "x-codeSamples": [
  5707. {
  5708. "lang": "js",
  5709. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  5710. }
  5711. ]
  5712. }
  5713. },
  5714. "/event": {
  5715. "get": {
  5716. "operationId": "event.subscribe",
  5717. "parameters": [
  5718. {
  5719. "in": "query",
  5720. "name": "directory",
  5721. "schema": {
  5722. "type": "string"
  5723. }
  5724. }
  5725. ],
  5726. "summary": "Subscribe to events",
  5727. "description": "Get events",
  5728. "responses": {
  5729. "200": {
  5730. "description": "Event stream",
  5731. "content": {
  5732. "text/event-stream": {
  5733. "schema": {
  5734. "$ref": "#/components/schemas/Event"
  5735. }
  5736. }
  5737. }
  5738. }
  5739. },
  5740. "x-codeSamples": [
  5741. {
  5742. "lang": "js",
  5743. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5744. }
  5745. ]
  5746. }
  5747. }
  5748. },
  5749. "components": {
  5750. "schemas": {
  5751. "Event.installation.updated": {
  5752. "type": "object",
  5753. "properties": {
  5754. "type": {
  5755. "type": "string",
  5756. "const": "installation.updated"
  5757. },
  5758. "properties": {
  5759. "type": "object",
  5760. "properties": {
  5761. "version": {
  5762. "type": "string"
  5763. }
  5764. },
  5765. "required": ["version"]
  5766. }
  5767. },
  5768. "required": ["type", "properties"]
  5769. },
  5770. "Event.installation.update-available": {
  5771. "type": "object",
  5772. "properties": {
  5773. "type": {
  5774. "type": "string",
  5775. "const": "installation.update-available"
  5776. },
  5777. "properties": {
  5778. "type": "object",
  5779. "properties": {
  5780. "version": {
  5781. "type": "string"
  5782. }
  5783. },
  5784. "required": ["version"]
  5785. }
  5786. },
  5787. "required": ["type", "properties"]
  5788. },
  5789. "Project": {
  5790. "type": "object",
  5791. "properties": {
  5792. "id": {
  5793. "type": "string"
  5794. },
  5795. "worktree": {
  5796. "type": "string"
  5797. },
  5798. "vcs": {
  5799. "type": "string",
  5800. "const": "git"
  5801. },
  5802. "name": {
  5803. "type": "string"
  5804. },
  5805. "icon": {
  5806. "type": "object",
  5807. "properties": {
  5808. "url": {
  5809. "type": "string"
  5810. },
  5811. "override": {
  5812. "type": "string"
  5813. },
  5814. "color": {
  5815. "type": "string"
  5816. }
  5817. }
  5818. },
  5819. "commands": {
  5820. "type": "object",
  5821. "properties": {
  5822. "start": {
  5823. "description": "Startup script to run when creating a new workspace (worktree)",
  5824. "type": "string"
  5825. }
  5826. }
  5827. },
  5828. "time": {
  5829. "type": "object",
  5830. "properties": {
  5831. "created": {
  5832. "type": "number"
  5833. },
  5834. "updated": {
  5835. "type": "number"
  5836. },
  5837. "initialized": {
  5838. "type": "number"
  5839. }
  5840. },
  5841. "required": ["created", "updated"]
  5842. },
  5843. "sandboxes": {
  5844. "type": "array",
  5845. "items": {
  5846. "type": "string"
  5847. }
  5848. }
  5849. },
  5850. "required": ["id", "worktree", "time", "sandboxes"]
  5851. },
  5852. "Event.project.updated": {
  5853. "type": "object",
  5854. "properties": {
  5855. "type": {
  5856. "type": "string",
  5857. "const": "project.updated"
  5858. },
  5859. "properties": {
  5860. "$ref": "#/components/schemas/Project"
  5861. }
  5862. },
  5863. "required": ["type", "properties"]
  5864. },
  5865. "Event.server.instance.disposed": {
  5866. "type": "object",
  5867. "properties": {
  5868. "type": {
  5869. "type": "string",
  5870. "const": "server.instance.disposed"
  5871. },
  5872. "properties": {
  5873. "type": "object",
  5874. "properties": {
  5875. "directory": {
  5876. "type": "string"
  5877. }
  5878. },
  5879. "required": ["directory"]
  5880. }
  5881. },
  5882. "required": ["type", "properties"]
  5883. },
  5884. "Event.server.connected": {
  5885. "type": "object",
  5886. "properties": {
  5887. "type": {
  5888. "type": "string",
  5889. "const": "server.connected"
  5890. },
  5891. "properties": {
  5892. "type": "object",
  5893. "properties": {}
  5894. }
  5895. },
  5896. "required": ["type", "properties"]
  5897. },
  5898. "Event.global.disposed": {
  5899. "type": "object",
  5900. "properties": {
  5901. "type": {
  5902. "type": "string",
  5903. "const": "global.disposed"
  5904. },
  5905. "properties": {
  5906. "type": "object",
  5907. "properties": {}
  5908. }
  5909. },
  5910. "required": ["type", "properties"]
  5911. },
  5912. "Event.lsp.client.diagnostics": {
  5913. "type": "object",
  5914. "properties": {
  5915. "type": {
  5916. "type": "string",
  5917. "const": "lsp.client.diagnostics"
  5918. },
  5919. "properties": {
  5920. "type": "object",
  5921. "properties": {
  5922. "serverID": {
  5923. "type": "string"
  5924. },
  5925. "path": {
  5926. "type": "string"
  5927. }
  5928. },
  5929. "required": ["serverID", "path"]
  5930. }
  5931. },
  5932. "required": ["type", "properties"]
  5933. },
  5934. "Event.lsp.updated": {
  5935. "type": "object",
  5936. "properties": {
  5937. "type": {
  5938. "type": "string",
  5939. "const": "lsp.updated"
  5940. },
  5941. "properties": {
  5942. "type": "object",
  5943. "properties": {}
  5944. }
  5945. },
  5946. "required": ["type", "properties"]
  5947. },
  5948. "Event.file.edited": {
  5949. "type": "object",
  5950. "properties": {
  5951. "type": {
  5952. "type": "string",
  5953. "const": "file.edited"
  5954. },
  5955. "properties": {
  5956. "type": "object",
  5957. "properties": {
  5958. "file": {
  5959. "type": "string"
  5960. }
  5961. },
  5962. "required": ["file"]
  5963. }
  5964. },
  5965. "required": ["type", "properties"]
  5966. },
  5967. "FileDiff": {
  5968. "type": "object",
  5969. "properties": {
  5970. "file": {
  5971. "type": "string"
  5972. },
  5973. "before": {
  5974. "type": "string"
  5975. },
  5976. "after": {
  5977. "type": "string"
  5978. },
  5979. "additions": {
  5980. "type": "number"
  5981. },
  5982. "deletions": {
  5983. "type": "number"
  5984. }
  5985. },
  5986. "required": ["file", "before", "after", "additions", "deletions"]
  5987. },
  5988. "UserMessage": {
  5989. "type": "object",
  5990. "properties": {
  5991. "id": {
  5992. "type": "string"
  5993. },
  5994. "sessionID": {
  5995. "type": "string"
  5996. },
  5997. "role": {
  5998. "type": "string",
  5999. "const": "user"
  6000. },
  6001. "time": {
  6002. "type": "object",
  6003. "properties": {
  6004. "created": {
  6005. "type": "number"
  6006. }
  6007. },
  6008. "required": ["created"]
  6009. },
  6010. "summary": {
  6011. "type": "object",
  6012. "properties": {
  6013. "title": {
  6014. "type": "string"
  6015. },
  6016. "body": {
  6017. "type": "string"
  6018. },
  6019. "diffs": {
  6020. "type": "array",
  6021. "items": {
  6022. "$ref": "#/components/schemas/FileDiff"
  6023. }
  6024. }
  6025. },
  6026. "required": ["diffs"]
  6027. },
  6028. "agent": {
  6029. "type": "string"
  6030. },
  6031. "model": {
  6032. "type": "object",
  6033. "properties": {
  6034. "providerID": {
  6035. "type": "string"
  6036. },
  6037. "modelID": {
  6038. "type": "string"
  6039. }
  6040. },
  6041. "required": ["providerID", "modelID"]
  6042. },
  6043. "system": {
  6044. "type": "string"
  6045. },
  6046. "tools": {
  6047. "type": "object",
  6048. "propertyNames": {
  6049. "type": "string"
  6050. },
  6051. "additionalProperties": {
  6052. "type": "boolean"
  6053. }
  6054. },
  6055. "variant": {
  6056. "type": "string"
  6057. }
  6058. },
  6059. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  6060. },
  6061. "ProviderAuthError": {
  6062. "type": "object",
  6063. "properties": {
  6064. "name": {
  6065. "type": "string",
  6066. "const": "ProviderAuthError"
  6067. },
  6068. "data": {
  6069. "type": "object",
  6070. "properties": {
  6071. "providerID": {
  6072. "type": "string"
  6073. },
  6074. "message": {
  6075. "type": "string"
  6076. }
  6077. },
  6078. "required": ["providerID", "message"]
  6079. }
  6080. },
  6081. "required": ["name", "data"]
  6082. },
  6083. "UnknownError": {
  6084. "type": "object",
  6085. "properties": {
  6086. "name": {
  6087. "type": "string",
  6088. "const": "UnknownError"
  6089. },
  6090. "data": {
  6091. "type": "object",
  6092. "properties": {
  6093. "message": {
  6094. "type": "string"
  6095. }
  6096. },
  6097. "required": ["message"]
  6098. }
  6099. },
  6100. "required": ["name", "data"]
  6101. },
  6102. "MessageOutputLengthError": {
  6103. "type": "object",
  6104. "properties": {
  6105. "name": {
  6106. "type": "string",
  6107. "const": "MessageOutputLengthError"
  6108. },
  6109. "data": {
  6110. "type": "object",
  6111. "properties": {}
  6112. }
  6113. },
  6114. "required": ["name", "data"]
  6115. },
  6116. "MessageAbortedError": {
  6117. "type": "object",
  6118. "properties": {
  6119. "name": {
  6120. "type": "string",
  6121. "const": "MessageAbortedError"
  6122. },
  6123. "data": {
  6124. "type": "object",
  6125. "properties": {
  6126. "message": {
  6127. "type": "string"
  6128. }
  6129. },
  6130. "required": ["message"]
  6131. }
  6132. },
  6133. "required": ["name", "data"]
  6134. },
  6135. "APIError": {
  6136. "type": "object",
  6137. "properties": {
  6138. "name": {
  6139. "type": "string",
  6140. "const": "APIError"
  6141. },
  6142. "data": {
  6143. "type": "object",
  6144. "properties": {
  6145. "message": {
  6146. "type": "string"
  6147. },
  6148. "statusCode": {
  6149. "type": "number"
  6150. },
  6151. "isRetryable": {
  6152. "type": "boolean"
  6153. },
  6154. "responseHeaders": {
  6155. "type": "object",
  6156. "propertyNames": {
  6157. "type": "string"
  6158. },
  6159. "additionalProperties": {
  6160. "type": "string"
  6161. }
  6162. },
  6163. "responseBody": {
  6164. "type": "string"
  6165. },
  6166. "metadata": {
  6167. "type": "object",
  6168. "propertyNames": {
  6169. "type": "string"
  6170. },
  6171. "additionalProperties": {
  6172. "type": "string"
  6173. }
  6174. }
  6175. },
  6176. "required": ["message", "isRetryable"]
  6177. }
  6178. },
  6179. "required": ["name", "data"]
  6180. },
  6181. "AssistantMessage": {
  6182. "type": "object",
  6183. "properties": {
  6184. "id": {
  6185. "type": "string"
  6186. },
  6187. "sessionID": {
  6188. "type": "string"
  6189. },
  6190. "role": {
  6191. "type": "string",
  6192. "const": "assistant"
  6193. },
  6194. "time": {
  6195. "type": "object",
  6196. "properties": {
  6197. "created": {
  6198. "type": "number"
  6199. },
  6200. "completed": {
  6201. "type": "number"
  6202. }
  6203. },
  6204. "required": ["created"]
  6205. },
  6206. "error": {
  6207. "anyOf": [
  6208. {
  6209. "$ref": "#/components/schemas/ProviderAuthError"
  6210. },
  6211. {
  6212. "$ref": "#/components/schemas/UnknownError"
  6213. },
  6214. {
  6215. "$ref": "#/components/schemas/MessageOutputLengthError"
  6216. },
  6217. {
  6218. "$ref": "#/components/schemas/MessageAbortedError"
  6219. },
  6220. {
  6221. "$ref": "#/components/schemas/APIError"
  6222. }
  6223. ]
  6224. },
  6225. "parentID": {
  6226. "type": "string"
  6227. },
  6228. "modelID": {
  6229. "type": "string"
  6230. },
  6231. "providerID": {
  6232. "type": "string"
  6233. },
  6234. "mode": {
  6235. "type": "string"
  6236. },
  6237. "agent": {
  6238. "type": "string"
  6239. },
  6240. "path": {
  6241. "type": "object",
  6242. "properties": {
  6243. "cwd": {
  6244. "type": "string"
  6245. },
  6246. "root": {
  6247. "type": "string"
  6248. }
  6249. },
  6250. "required": ["cwd", "root"]
  6251. },
  6252. "summary": {
  6253. "type": "boolean"
  6254. },
  6255. "cost": {
  6256. "type": "number"
  6257. },
  6258. "tokens": {
  6259. "type": "object",
  6260. "properties": {
  6261. "input": {
  6262. "type": "number"
  6263. },
  6264. "output": {
  6265. "type": "number"
  6266. },
  6267. "reasoning": {
  6268. "type": "number"
  6269. },
  6270. "cache": {
  6271. "type": "object",
  6272. "properties": {
  6273. "read": {
  6274. "type": "number"
  6275. },
  6276. "write": {
  6277. "type": "number"
  6278. }
  6279. },
  6280. "required": ["read", "write"]
  6281. }
  6282. },
  6283. "required": ["input", "output", "reasoning", "cache"]
  6284. },
  6285. "finish": {
  6286. "type": "string"
  6287. }
  6288. },
  6289. "required": [
  6290. "id",
  6291. "sessionID",
  6292. "role",
  6293. "time",
  6294. "parentID",
  6295. "modelID",
  6296. "providerID",
  6297. "mode",
  6298. "agent",
  6299. "path",
  6300. "cost",
  6301. "tokens"
  6302. ]
  6303. },
  6304. "Message": {
  6305. "anyOf": [
  6306. {
  6307. "$ref": "#/components/schemas/UserMessage"
  6308. },
  6309. {
  6310. "$ref": "#/components/schemas/AssistantMessage"
  6311. }
  6312. ]
  6313. },
  6314. "Event.message.updated": {
  6315. "type": "object",
  6316. "properties": {
  6317. "type": {
  6318. "type": "string",
  6319. "const": "message.updated"
  6320. },
  6321. "properties": {
  6322. "type": "object",
  6323. "properties": {
  6324. "info": {
  6325. "$ref": "#/components/schemas/Message"
  6326. }
  6327. },
  6328. "required": ["info"]
  6329. }
  6330. },
  6331. "required": ["type", "properties"]
  6332. },
  6333. "Event.message.removed": {
  6334. "type": "object",
  6335. "properties": {
  6336. "type": {
  6337. "type": "string",
  6338. "const": "message.removed"
  6339. },
  6340. "properties": {
  6341. "type": "object",
  6342. "properties": {
  6343. "sessionID": {
  6344. "type": "string"
  6345. },
  6346. "messageID": {
  6347. "type": "string"
  6348. }
  6349. },
  6350. "required": ["sessionID", "messageID"]
  6351. }
  6352. },
  6353. "required": ["type", "properties"]
  6354. },
  6355. "TextPart": {
  6356. "type": "object",
  6357. "properties": {
  6358. "id": {
  6359. "type": "string"
  6360. },
  6361. "sessionID": {
  6362. "type": "string"
  6363. },
  6364. "messageID": {
  6365. "type": "string"
  6366. },
  6367. "type": {
  6368. "type": "string",
  6369. "const": "text"
  6370. },
  6371. "text": {
  6372. "type": "string"
  6373. },
  6374. "synthetic": {
  6375. "type": "boolean"
  6376. },
  6377. "ignored": {
  6378. "type": "boolean"
  6379. },
  6380. "time": {
  6381. "type": "object",
  6382. "properties": {
  6383. "start": {
  6384. "type": "number"
  6385. },
  6386. "end": {
  6387. "type": "number"
  6388. }
  6389. },
  6390. "required": ["start"]
  6391. },
  6392. "metadata": {
  6393. "type": "object",
  6394. "propertyNames": {
  6395. "type": "string"
  6396. },
  6397. "additionalProperties": {}
  6398. }
  6399. },
  6400. "required": ["id", "sessionID", "messageID", "type", "text"]
  6401. },
  6402. "ReasoningPart": {
  6403. "type": "object",
  6404. "properties": {
  6405. "id": {
  6406. "type": "string"
  6407. },
  6408. "sessionID": {
  6409. "type": "string"
  6410. },
  6411. "messageID": {
  6412. "type": "string"
  6413. },
  6414. "type": {
  6415. "type": "string",
  6416. "const": "reasoning"
  6417. },
  6418. "text": {
  6419. "type": "string"
  6420. },
  6421. "metadata": {
  6422. "type": "object",
  6423. "propertyNames": {
  6424. "type": "string"
  6425. },
  6426. "additionalProperties": {}
  6427. },
  6428. "time": {
  6429. "type": "object",
  6430. "properties": {
  6431. "start": {
  6432. "type": "number"
  6433. },
  6434. "end": {
  6435. "type": "number"
  6436. }
  6437. },
  6438. "required": ["start"]
  6439. }
  6440. },
  6441. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  6442. },
  6443. "FilePartSourceText": {
  6444. "type": "object",
  6445. "properties": {
  6446. "value": {
  6447. "type": "string"
  6448. },
  6449. "start": {
  6450. "type": "integer",
  6451. "minimum": -9007199254740991,
  6452. "maximum": 9007199254740991
  6453. },
  6454. "end": {
  6455. "type": "integer",
  6456. "minimum": -9007199254740991,
  6457. "maximum": 9007199254740991
  6458. }
  6459. },
  6460. "required": ["value", "start", "end"]
  6461. },
  6462. "FileSource": {
  6463. "type": "object",
  6464. "properties": {
  6465. "text": {
  6466. "$ref": "#/components/schemas/FilePartSourceText"
  6467. },
  6468. "type": {
  6469. "type": "string",
  6470. "const": "file"
  6471. },
  6472. "path": {
  6473. "type": "string"
  6474. }
  6475. },
  6476. "required": ["text", "type", "path"]
  6477. },
  6478. "Range": {
  6479. "type": "object",
  6480. "properties": {
  6481. "start": {
  6482. "type": "object",
  6483. "properties": {
  6484. "line": {
  6485. "type": "number"
  6486. },
  6487. "character": {
  6488. "type": "number"
  6489. }
  6490. },
  6491. "required": ["line", "character"]
  6492. },
  6493. "end": {
  6494. "type": "object",
  6495. "properties": {
  6496. "line": {
  6497. "type": "number"
  6498. },
  6499. "character": {
  6500. "type": "number"
  6501. }
  6502. },
  6503. "required": ["line", "character"]
  6504. }
  6505. },
  6506. "required": ["start", "end"]
  6507. },
  6508. "SymbolSource": {
  6509. "type": "object",
  6510. "properties": {
  6511. "text": {
  6512. "$ref": "#/components/schemas/FilePartSourceText"
  6513. },
  6514. "type": {
  6515. "type": "string",
  6516. "const": "symbol"
  6517. },
  6518. "path": {
  6519. "type": "string"
  6520. },
  6521. "range": {
  6522. "$ref": "#/components/schemas/Range"
  6523. },
  6524. "name": {
  6525. "type": "string"
  6526. },
  6527. "kind": {
  6528. "type": "integer",
  6529. "minimum": -9007199254740991,
  6530. "maximum": 9007199254740991
  6531. }
  6532. },
  6533. "required": ["text", "type", "path", "range", "name", "kind"]
  6534. },
  6535. "ResourceSource": {
  6536. "type": "object",
  6537. "properties": {
  6538. "text": {
  6539. "$ref": "#/components/schemas/FilePartSourceText"
  6540. },
  6541. "type": {
  6542. "type": "string",
  6543. "const": "resource"
  6544. },
  6545. "clientName": {
  6546. "type": "string"
  6547. },
  6548. "uri": {
  6549. "type": "string"
  6550. }
  6551. },
  6552. "required": ["text", "type", "clientName", "uri"]
  6553. },
  6554. "FilePartSource": {
  6555. "anyOf": [
  6556. {
  6557. "$ref": "#/components/schemas/FileSource"
  6558. },
  6559. {
  6560. "$ref": "#/components/schemas/SymbolSource"
  6561. },
  6562. {
  6563. "$ref": "#/components/schemas/ResourceSource"
  6564. }
  6565. ]
  6566. },
  6567. "FilePart": {
  6568. "type": "object",
  6569. "properties": {
  6570. "id": {
  6571. "type": "string"
  6572. },
  6573. "sessionID": {
  6574. "type": "string"
  6575. },
  6576. "messageID": {
  6577. "type": "string"
  6578. },
  6579. "type": {
  6580. "type": "string",
  6581. "const": "file"
  6582. },
  6583. "mime": {
  6584. "type": "string"
  6585. },
  6586. "filename": {
  6587. "type": "string"
  6588. },
  6589. "url": {
  6590. "type": "string"
  6591. },
  6592. "source": {
  6593. "$ref": "#/components/schemas/FilePartSource"
  6594. }
  6595. },
  6596. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  6597. },
  6598. "ToolStatePending": {
  6599. "type": "object",
  6600. "properties": {
  6601. "status": {
  6602. "type": "string",
  6603. "const": "pending"
  6604. },
  6605. "input": {
  6606. "type": "object",
  6607. "propertyNames": {
  6608. "type": "string"
  6609. },
  6610. "additionalProperties": {}
  6611. },
  6612. "raw": {
  6613. "type": "string"
  6614. }
  6615. },
  6616. "required": ["status", "input", "raw"]
  6617. },
  6618. "ToolStateRunning": {
  6619. "type": "object",
  6620. "properties": {
  6621. "status": {
  6622. "type": "string",
  6623. "const": "running"
  6624. },
  6625. "input": {
  6626. "type": "object",
  6627. "propertyNames": {
  6628. "type": "string"
  6629. },
  6630. "additionalProperties": {}
  6631. },
  6632. "title": {
  6633. "type": "string"
  6634. },
  6635. "metadata": {
  6636. "type": "object",
  6637. "propertyNames": {
  6638. "type": "string"
  6639. },
  6640. "additionalProperties": {}
  6641. },
  6642. "time": {
  6643. "type": "object",
  6644. "properties": {
  6645. "start": {
  6646. "type": "number"
  6647. }
  6648. },
  6649. "required": ["start"]
  6650. }
  6651. },
  6652. "required": ["status", "input", "time"]
  6653. },
  6654. "ToolStateCompleted": {
  6655. "type": "object",
  6656. "properties": {
  6657. "status": {
  6658. "type": "string",
  6659. "const": "completed"
  6660. },
  6661. "input": {
  6662. "type": "object",
  6663. "propertyNames": {
  6664. "type": "string"
  6665. },
  6666. "additionalProperties": {}
  6667. },
  6668. "output": {
  6669. "type": "string"
  6670. },
  6671. "title": {
  6672. "type": "string"
  6673. },
  6674. "metadata": {
  6675. "type": "object",
  6676. "propertyNames": {
  6677. "type": "string"
  6678. },
  6679. "additionalProperties": {}
  6680. },
  6681. "time": {
  6682. "type": "object",
  6683. "properties": {
  6684. "start": {
  6685. "type": "number"
  6686. },
  6687. "end": {
  6688. "type": "number"
  6689. },
  6690. "compacted": {
  6691. "type": "number"
  6692. }
  6693. },
  6694. "required": ["start", "end"]
  6695. },
  6696. "attachments": {
  6697. "type": "array",
  6698. "items": {
  6699. "$ref": "#/components/schemas/FilePart"
  6700. }
  6701. }
  6702. },
  6703. "required": ["status", "input", "output", "title", "metadata", "time"]
  6704. },
  6705. "ToolStateError": {
  6706. "type": "object",
  6707. "properties": {
  6708. "status": {
  6709. "type": "string",
  6710. "const": "error"
  6711. },
  6712. "input": {
  6713. "type": "object",
  6714. "propertyNames": {
  6715. "type": "string"
  6716. },
  6717. "additionalProperties": {}
  6718. },
  6719. "error": {
  6720. "type": "string"
  6721. },
  6722. "metadata": {
  6723. "type": "object",
  6724. "propertyNames": {
  6725. "type": "string"
  6726. },
  6727. "additionalProperties": {}
  6728. },
  6729. "time": {
  6730. "type": "object",
  6731. "properties": {
  6732. "start": {
  6733. "type": "number"
  6734. },
  6735. "end": {
  6736. "type": "number"
  6737. }
  6738. },
  6739. "required": ["start", "end"]
  6740. }
  6741. },
  6742. "required": ["status", "input", "error", "time"]
  6743. },
  6744. "ToolState": {
  6745. "anyOf": [
  6746. {
  6747. "$ref": "#/components/schemas/ToolStatePending"
  6748. },
  6749. {
  6750. "$ref": "#/components/schemas/ToolStateRunning"
  6751. },
  6752. {
  6753. "$ref": "#/components/schemas/ToolStateCompleted"
  6754. },
  6755. {
  6756. "$ref": "#/components/schemas/ToolStateError"
  6757. }
  6758. ]
  6759. },
  6760. "ToolPart": {
  6761. "type": "object",
  6762. "properties": {
  6763. "id": {
  6764. "type": "string"
  6765. },
  6766. "sessionID": {
  6767. "type": "string"
  6768. },
  6769. "messageID": {
  6770. "type": "string"
  6771. },
  6772. "type": {
  6773. "type": "string",
  6774. "const": "tool"
  6775. },
  6776. "callID": {
  6777. "type": "string"
  6778. },
  6779. "tool": {
  6780. "type": "string"
  6781. },
  6782. "state": {
  6783. "$ref": "#/components/schemas/ToolState"
  6784. },
  6785. "metadata": {
  6786. "type": "object",
  6787. "propertyNames": {
  6788. "type": "string"
  6789. },
  6790. "additionalProperties": {}
  6791. }
  6792. },
  6793. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  6794. },
  6795. "StepStartPart": {
  6796. "type": "object",
  6797. "properties": {
  6798. "id": {
  6799. "type": "string"
  6800. },
  6801. "sessionID": {
  6802. "type": "string"
  6803. },
  6804. "messageID": {
  6805. "type": "string"
  6806. },
  6807. "type": {
  6808. "type": "string",
  6809. "const": "step-start"
  6810. },
  6811. "snapshot": {
  6812. "type": "string"
  6813. }
  6814. },
  6815. "required": ["id", "sessionID", "messageID", "type"]
  6816. },
  6817. "StepFinishPart": {
  6818. "type": "object",
  6819. "properties": {
  6820. "id": {
  6821. "type": "string"
  6822. },
  6823. "sessionID": {
  6824. "type": "string"
  6825. },
  6826. "messageID": {
  6827. "type": "string"
  6828. },
  6829. "type": {
  6830. "type": "string",
  6831. "const": "step-finish"
  6832. },
  6833. "reason": {
  6834. "type": "string"
  6835. },
  6836. "snapshot": {
  6837. "type": "string"
  6838. },
  6839. "cost": {
  6840. "type": "number"
  6841. },
  6842. "tokens": {
  6843. "type": "object",
  6844. "properties": {
  6845. "input": {
  6846. "type": "number"
  6847. },
  6848. "output": {
  6849. "type": "number"
  6850. },
  6851. "reasoning": {
  6852. "type": "number"
  6853. },
  6854. "cache": {
  6855. "type": "object",
  6856. "properties": {
  6857. "read": {
  6858. "type": "number"
  6859. },
  6860. "write": {
  6861. "type": "number"
  6862. }
  6863. },
  6864. "required": ["read", "write"]
  6865. }
  6866. },
  6867. "required": ["input", "output", "reasoning", "cache"]
  6868. }
  6869. },
  6870. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  6871. },
  6872. "SnapshotPart": {
  6873. "type": "object",
  6874. "properties": {
  6875. "id": {
  6876. "type": "string"
  6877. },
  6878. "sessionID": {
  6879. "type": "string"
  6880. },
  6881. "messageID": {
  6882. "type": "string"
  6883. },
  6884. "type": {
  6885. "type": "string",
  6886. "const": "snapshot"
  6887. },
  6888. "snapshot": {
  6889. "type": "string"
  6890. }
  6891. },
  6892. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  6893. },
  6894. "PatchPart": {
  6895. "type": "object",
  6896. "properties": {
  6897. "id": {
  6898. "type": "string"
  6899. },
  6900. "sessionID": {
  6901. "type": "string"
  6902. },
  6903. "messageID": {
  6904. "type": "string"
  6905. },
  6906. "type": {
  6907. "type": "string",
  6908. "const": "patch"
  6909. },
  6910. "hash": {
  6911. "type": "string"
  6912. },
  6913. "files": {
  6914. "type": "array",
  6915. "items": {
  6916. "type": "string"
  6917. }
  6918. }
  6919. },
  6920. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  6921. },
  6922. "AgentPart": {
  6923. "type": "object",
  6924. "properties": {
  6925. "id": {
  6926. "type": "string"
  6927. },
  6928. "sessionID": {
  6929. "type": "string"
  6930. },
  6931. "messageID": {
  6932. "type": "string"
  6933. },
  6934. "type": {
  6935. "type": "string",
  6936. "const": "agent"
  6937. },
  6938. "name": {
  6939. "type": "string"
  6940. },
  6941. "source": {
  6942. "type": "object",
  6943. "properties": {
  6944. "value": {
  6945. "type": "string"
  6946. },
  6947. "start": {
  6948. "type": "integer",
  6949. "minimum": -9007199254740991,
  6950. "maximum": 9007199254740991
  6951. },
  6952. "end": {
  6953. "type": "integer",
  6954. "minimum": -9007199254740991,
  6955. "maximum": 9007199254740991
  6956. }
  6957. },
  6958. "required": ["value", "start", "end"]
  6959. }
  6960. },
  6961. "required": ["id", "sessionID", "messageID", "type", "name"]
  6962. },
  6963. "RetryPart": {
  6964. "type": "object",
  6965. "properties": {
  6966. "id": {
  6967. "type": "string"
  6968. },
  6969. "sessionID": {
  6970. "type": "string"
  6971. },
  6972. "messageID": {
  6973. "type": "string"
  6974. },
  6975. "type": {
  6976. "type": "string",
  6977. "const": "retry"
  6978. },
  6979. "attempt": {
  6980. "type": "number"
  6981. },
  6982. "error": {
  6983. "$ref": "#/components/schemas/APIError"
  6984. },
  6985. "time": {
  6986. "type": "object",
  6987. "properties": {
  6988. "created": {
  6989. "type": "number"
  6990. }
  6991. },
  6992. "required": ["created"]
  6993. }
  6994. },
  6995. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  6996. },
  6997. "CompactionPart": {
  6998. "type": "object",
  6999. "properties": {
  7000. "id": {
  7001. "type": "string"
  7002. },
  7003. "sessionID": {
  7004. "type": "string"
  7005. },
  7006. "messageID": {
  7007. "type": "string"
  7008. },
  7009. "type": {
  7010. "type": "string",
  7011. "const": "compaction"
  7012. },
  7013. "auto": {
  7014. "type": "boolean"
  7015. }
  7016. },
  7017. "required": ["id", "sessionID", "messageID", "type", "auto"]
  7018. },
  7019. "Part": {
  7020. "anyOf": [
  7021. {
  7022. "$ref": "#/components/schemas/TextPart"
  7023. },
  7024. {
  7025. "type": "object",
  7026. "properties": {
  7027. "id": {
  7028. "type": "string"
  7029. },
  7030. "sessionID": {
  7031. "type": "string"
  7032. },
  7033. "messageID": {
  7034. "type": "string"
  7035. },
  7036. "type": {
  7037. "type": "string",
  7038. "const": "subtask"
  7039. },
  7040. "prompt": {
  7041. "type": "string"
  7042. },
  7043. "description": {
  7044. "type": "string"
  7045. },
  7046. "agent": {
  7047. "type": "string"
  7048. },
  7049. "model": {
  7050. "type": "object",
  7051. "properties": {
  7052. "providerID": {
  7053. "type": "string"
  7054. },
  7055. "modelID": {
  7056. "type": "string"
  7057. }
  7058. },
  7059. "required": ["providerID", "modelID"]
  7060. },
  7061. "command": {
  7062. "type": "string"
  7063. }
  7064. },
  7065. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  7066. },
  7067. {
  7068. "$ref": "#/components/schemas/ReasoningPart"
  7069. },
  7070. {
  7071. "$ref": "#/components/schemas/FilePart"
  7072. },
  7073. {
  7074. "$ref": "#/components/schemas/ToolPart"
  7075. },
  7076. {
  7077. "$ref": "#/components/schemas/StepStartPart"
  7078. },
  7079. {
  7080. "$ref": "#/components/schemas/StepFinishPart"
  7081. },
  7082. {
  7083. "$ref": "#/components/schemas/SnapshotPart"
  7084. },
  7085. {
  7086. "$ref": "#/components/schemas/PatchPart"
  7087. },
  7088. {
  7089. "$ref": "#/components/schemas/AgentPart"
  7090. },
  7091. {
  7092. "$ref": "#/components/schemas/RetryPart"
  7093. },
  7094. {
  7095. "$ref": "#/components/schemas/CompactionPart"
  7096. }
  7097. ]
  7098. },
  7099. "Event.message.part.updated": {
  7100. "type": "object",
  7101. "properties": {
  7102. "type": {
  7103. "type": "string",
  7104. "const": "message.part.updated"
  7105. },
  7106. "properties": {
  7107. "type": "object",
  7108. "properties": {
  7109. "part": {
  7110. "$ref": "#/components/schemas/Part"
  7111. },
  7112. "delta": {
  7113. "type": "string"
  7114. }
  7115. },
  7116. "required": ["part"]
  7117. }
  7118. },
  7119. "required": ["type", "properties"]
  7120. },
  7121. "Event.message.part.removed": {
  7122. "type": "object",
  7123. "properties": {
  7124. "type": {
  7125. "type": "string",
  7126. "const": "message.part.removed"
  7127. },
  7128. "properties": {
  7129. "type": "object",
  7130. "properties": {
  7131. "sessionID": {
  7132. "type": "string"
  7133. },
  7134. "messageID": {
  7135. "type": "string"
  7136. },
  7137. "partID": {
  7138. "type": "string"
  7139. }
  7140. },
  7141. "required": ["sessionID", "messageID", "partID"]
  7142. }
  7143. },
  7144. "required": ["type", "properties"]
  7145. },
  7146. "PermissionRequest": {
  7147. "type": "object",
  7148. "properties": {
  7149. "id": {
  7150. "type": "string",
  7151. "pattern": "^per.*"
  7152. },
  7153. "sessionID": {
  7154. "type": "string",
  7155. "pattern": "^ses.*"
  7156. },
  7157. "permission": {
  7158. "type": "string"
  7159. },
  7160. "patterns": {
  7161. "type": "array",
  7162. "items": {
  7163. "type": "string"
  7164. }
  7165. },
  7166. "metadata": {
  7167. "type": "object",
  7168. "propertyNames": {
  7169. "type": "string"
  7170. },
  7171. "additionalProperties": {}
  7172. },
  7173. "always": {
  7174. "type": "array",
  7175. "items": {
  7176. "type": "string"
  7177. }
  7178. },
  7179. "tool": {
  7180. "type": "object",
  7181. "properties": {
  7182. "messageID": {
  7183. "type": "string"
  7184. },
  7185. "callID": {
  7186. "type": "string"
  7187. }
  7188. },
  7189. "required": ["messageID", "callID"]
  7190. }
  7191. },
  7192. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  7193. },
  7194. "Event.permission.asked": {
  7195. "type": "object",
  7196. "properties": {
  7197. "type": {
  7198. "type": "string",
  7199. "const": "permission.asked"
  7200. },
  7201. "properties": {
  7202. "$ref": "#/components/schemas/PermissionRequest"
  7203. }
  7204. },
  7205. "required": ["type", "properties"]
  7206. },
  7207. "Event.permission.replied": {
  7208. "type": "object",
  7209. "properties": {
  7210. "type": {
  7211. "type": "string",
  7212. "const": "permission.replied"
  7213. },
  7214. "properties": {
  7215. "type": "object",
  7216. "properties": {
  7217. "sessionID": {
  7218. "type": "string"
  7219. },
  7220. "requestID": {
  7221. "type": "string"
  7222. },
  7223. "reply": {
  7224. "type": "string",
  7225. "enum": ["once", "always", "reject"]
  7226. }
  7227. },
  7228. "required": ["sessionID", "requestID", "reply"]
  7229. }
  7230. },
  7231. "required": ["type", "properties"]
  7232. },
  7233. "SessionStatus": {
  7234. "anyOf": [
  7235. {
  7236. "type": "object",
  7237. "properties": {
  7238. "type": {
  7239. "type": "string",
  7240. "const": "idle"
  7241. }
  7242. },
  7243. "required": ["type"]
  7244. },
  7245. {
  7246. "type": "object",
  7247. "properties": {
  7248. "type": {
  7249. "type": "string",
  7250. "const": "retry"
  7251. },
  7252. "attempt": {
  7253. "type": "number"
  7254. },
  7255. "message": {
  7256. "type": "string"
  7257. },
  7258. "next": {
  7259. "type": "number"
  7260. }
  7261. },
  7262. "required": ["type", "attempt", "message", "next"]
  7263. },
  7264. {
  7265. "type": "object",
  7266. "properties": {
  7267. "type": {
  7268. "type": "string",
  7269. "const": "busy"
  7270. }
  7271. },
  7272. "required": ["type"]
  7273. }
  7274. ]
  7275. },
  7276. "Event.session.status": {
  7277. "type": "object",
  7278. "properties": {
  7279. "type": {
  7280. "type": "string",
  7281. "const": "session.status"
  7282. },
  7283. "properties": {
  7284. "type": "object",
  7285. "properties": {
  7286. "sessionID": {
  7287. "type": "string"
  7288. },
  7289. "status": {
  7290. "$ref": "#/components/schemas/SessionStatus"
  7291. }
  7292. },
  7293. "required": ["sessionID", "status"]
  7294. }
  7295. },
  7296. "required": ["type", "properties"]
  7297. },
  7298. "Event.session.idle": {
  7299. "type": "object",
  7300. "properties": {
  7301. "type": {
  7302. "type": "string",
  7303. "const": "session.idle"
  7304. },
  7305. "properties": {
  7306. "type": "object",
  7307. "properties": {
  7308. "sessionID": {
  7309. "type": "string"
  7310. }
  7311. },
  7312. "required": ["sessionID"]
  7313. }
  7314. },
  7315. "required": ["type", "properties"]
  7316. },
  7317. "QuestionOption": {
  7318. "type": "object",
  7319. "properties": {
  7320. "label": {
  7321. "description": "Display text (1-5 words, concise)",
  7322. "type": "string",
  7323. "maxLength": 30
  7324. },
  7325. "description": {
  7326. "description": "Explanation of choice",
  7327. "type": "string"
  7328. }
  7329. },
  7330. "required": ["label", "description"]
  7331. },
  7332. "QuestionInfo": {
  7333. "type": "object",
  7334. "properties": {
  7335. "question": {
  7336. "description": "Complete question",
  7337. "type": "string"
  7338. },
  7339. "header": {
  7340. "description": "Very short label (max 30 chars)",
  7341. "type": "string",
  7342. "maxLength": 30
  7343. },
  7344. "options": {
  7345. "description": "Available choices",
  7346. "type": "array",
  7347. "items": {
  7348. "$ref": "#/components/schemas/QuestionOption"
  7349. }
  7350. },
  7351. "multiple": {
  7352. "description": "Allow selecting multiple choices",
  7353. "type": "boolean"
  7354. },
  7355. "custom": {
  7356. "description": "Allow typing a custom answer (default: true)",
  7357. "type": "boolean"
  7358. }
  7359. },
  7360. "required": ["question", "header", "options"]
  7361. },
  7362. "QuestionRequest": {
  7363. "type": "object",
  7364. "properties": {
  7365. "id": {
  7366. "type": "string",
  7367. "pattern": "^que.*"
  7368. },
  7369. "sessionID": {
  7370. "type": "string",
  7371. "pattern": "^ses.*"
  7372. },
  7373. "questions": {
  7374. "description": "Questions to ask",
  7375. "type": "array",
  7376. "items": {
  7377. "$ref": "#/components/schemas/QuestionInfo"
  7378. }
  7379. },
  7380. "tool": {
  7381. "type": "object",
  7382. "properties": {
  7383. "messageID": {
  7384. "type": "string"
  7385. },
  7386. "callID": {
  7387. "type": "string"
  7388. }
  7389. },
  7390. "required": ["messageID", "callID"]
  7391. }
  7392. },
  7393. "required": ["id", "sessionID", "questions"]
  7394. },
  7395. "Event.question.asked": {
  7396. "type": "object",
  7397. "properties": {
  7398. "type": {
  7399. "type": "string",
  7400. "const": "question.asked"
  7401. },
  7402. "properties": {
  7403. "$ref": "#/components/schemas/QuestionRequest"
  7404. }
  7405. },
  7406. "required": ["type", "properties"]
  7407. },
  7408. "QuestionAnswer": {
  7409. "type": "array",
  7410. "items": {
  7411. "type": "string"
  7412. }
  7413. },
  7414. "Event.question.replied": {
  7415. "type": "object",
  7416. "properties": {
  7417. "type": {
  7418. "type": "string",
  7419. "const": "question.replied"
  7420. },
  7421. "properties": {
  7422. "type": "object",
  7423. "properties": {
  7424. "sessionID": {
  7425. "type": "string"
  7426. },
  7427. "requestID": {
  7428. "type": "string"
  7429. },
  7430. "answers": {
  7431. "type": "array",
  7432. "items": {
  7433. "$ref": "#/components/schemas/QuestionAnswer"
  7434. }
  7435. }
  7436. },
  7437. "required": ["sessionID", "requestID", "answers"]
  7438. }
  7439. },
  7440. "required": ["type", "properties"]
  7441. },
  7442. "Event.question.rejected": {
  7443. "type": "object",
  7444. "properties": {
  7445. "type": {
  7446. "type": "string",
  7447. "const": "question.rejected"
  7448. },
  7449. "properties": {
  7450. "type": "object",
  7451. "properties": {
  7452. "sessionID": {
  7453. "type": "string"
  7454. },
  7455. "requestID": {
  7456. "type": "string"
  7457. }
  7458. },
  7459. "required": ["sessionID", "requestID"]
  7460. }
  7461. },
  7462. "required": ["type", "properties"]
  7463. },
  7464. "Event.session.compacted": {
  7465. "type": "object",
  7466. "properties": {
  7467. "type": {
  7468. "type": "string",
  7469. "const": "session.compacted"
  7470. },
  7471. "properties": {
  7472. "type": "object",
  7473. "properties": {
  7474. "sessionID": {
  7475. "type": "string"
  7476. }
  7477. },
  7478. "required": ["sessionID"]
  7479. }
  7480. },
  7481. "required": ["type", "properties"]
  7482. },
  7483. "Todo": {
  7484. "type": "object",
  7485. "properties": {
  7486. "content": {
  7487. "description": "Brief description of the task",
  7488. "type": "string"
  7489. },
  7490. "status": {
  7491. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  7492. "type": "string"
  7493. },
  7494. "priority": {
  7495. "description": "Priority level of the task: high, medium, low",
  7496. "type": "string"
  7497. },
  7498. "id": {
  7499. "description": "Unique identifier for the todo item",
  7500. "type": "string"
  7501. }
  7502. },
  7503. "required": ["content", "status", "priority", "id"]
  7504. },
  7505. "Event.todo.updated": {
  7506. "type": "object",
  7507. "properties": {
  7508. "type": {
  7509. "type": "string",
  7510. "const": "todo.updated"
  7511. },
  7512. "properties": {
  7513. "type": "object",
  7514. "properties": {
  7515. "sessionID": {
  7516. "type": "string"
  7517. },
  7518. "todos": {
  7519. "type": "array",
  7520. "items": {
  7521. "$ref": "#/components/schemas/Todo"
  7522. }
  7523. }
  7524. },
  7525. "required": ["sessionID", "todos"]
  7526. }
  7527. },
  7528. "required": ["type", "properties"]
  7529. },
  7530. "Event.file.watcher.updated": {
  7531. "type": "object",
  7532. "properties": {
  7533. "type": {
  7534. "type": "string",
  7535. "const": "file.watcher.updated"
  7536. },
  7537. "properties": {
  7538. "type": "object",
  7539. "properties": {
  7540. "file": {
  7541. "type": "string"
  7542. },
  7543. "event": {
  7544. "anyOf": [
  7545. {
  7546. "type": "string",
  7547. "const": "add"
  7548. },
  7549. {
  7550. "type": "string",
  7551. "const": "change"
  7552. },
  7553. {
  7554. "type": "string",
  7555. "const": "unlink"
  7556. }
  7557. ]
  7558. }
  7559. },
  7560. "required": ["file", "event"]
  7561. }
  7562. },
  7563. "required": ["type", "properties"]
  7564. },
  7565. "Event.tui.prompt.append": {
  7566. "type": "object",
  7567. "properties": {
  7568. "type": {
  7569. "type": "string",
  7570. "const": "tui.prompt.append"
  7571. },
  7572. "properties": {
  7573. "type": "object",
  7574. "properties": {
  7575. "text": {
  7576. "type": "string"
  7577. }
  7578. },
  7579. "required": ["text"]
  7580. }
  7581. },
  7582. "required": ["type", "properties"]
  7583. },
  7584. "Event.tui.command.execute": {
  7585. "type": "object",
  7586. "properties": {
  7587. "type": {
  7588. "type": "string",
  7589. "const": "tui.command.execute"
  7590. },
  7591. "properties": {
  7592. "type": "object",
  7593. "properties": {
  7594. "command": {
  7595. "anyOf": [
  7596. {
  7597. "type": "string",
  7598. "enum": [
  7599. "session.list",
  7600. "session.new",
  7601. "session.share",
  7602. "session.interrupt",
  7603. "session.compact",
  7604. "session.page.up",
  7605. "session.page.down",
  7606. "session.line.up",
  7607. "session.line.down",
  7608. "session.half.page.up",
  7609. "session.half.page.down",
  7610. "session.first",
  7611. "session.last",
  7612. "prompt.clear",
  7613. "prompt.submit",
  7614. "agent.cycle"
  7615. ]
  7616. },
  7617. {
  7618. "type": "string"
  7619. }
  7620. ]
  7621. }
  7622. },
  7623. "required": ["command"]
  7624. }
  7625. },
  7626. "required": ["type", "properties"]
  7627. },
  7628. "Event.tui.toast.show": {
  7629. "type": "object",
  7630. "properties": {
  7631. "type": {
  7632. "type": "string",
  7633. "const": "tui.toast.show"
  7634. },
  7635. "properties": {
  7636. "type": "object",
  7637. "properties": {
  7638. "title": {
  7639. "type": "string"
  7640. },
  7641. "message": {
  7642. "type": "string"
  7643. },
  7644. "variant": {
  7645. "type": "string",
  7646. "enum": ["info", "success", "warning", "error"]
  7647. },
  7648. "duration": {
  7649. "description": "Duration in milliseconds",
  7650. "default": 5000,
  7651. "type": "number"
  7652. }
  7653. },
  7654. "required": ["message", "variant"]
  7655. }
  7656. },
  7657. "required": ["type", "properties"]
  7658. },
  7659. "Event.tui.session.select": {
  7660. "type": "object",
  7661. "properties": {
  7662. "type": {
  7663. "type": "string",
  7664. "const": "tui.session.select"
  7665. },
  7666. "properties": {
  7667. "type": "object",
  7668. "properties": {
  7669. "sessionID": {
  7670. "description": "Session ID to navigate to",
  7671. "type": "string",
  7672. "pattern": "^ses"
  7673. }
  7674. },
  7675. "required": ["sessionID"]
  7676. }
  7677. },
  7678. "required": ["type", "properties"]
  7679. },
  7680. "Event.mcp.tools.changed": {
  7681. "type": "object",
  7682. "properties": {
  7683. "type": {
  7684. "type": "string",
  7685. "const": "mcp.tools.changed"
  7686. },
  7687. "properties": {
  7688. "type": "object",
  7689. "properties": {
  7690. "server": {
  7691. "type": "string"
  7692. }
  7693. },
  7694. "required": ["server"]
  7695. }
  7696. },
  7697. "required": ["type", "properties"]
  7698. },
  7699. "Event.mcp.browser.open.failed": {
  7700. "type": "object",
  7701. "properties": {
  7702. "type": {
  7703. "type": "string",
  7704. "const": "mcp.browser.open.failed"
  7705. },
  7706. "properties": {
  7707. "type": "object",
  7708. "properties": {
  7709. "mcpName": {
  7710. "type": "string"
  7711. },
  7712. "url": {
  7713. "type": "string"
  7714. }
  7715. },
  7716. "required": ["mcpName", "url"]
  7717. }
  7718. },
  7719. "required": ["type", "properties"]
  7720. },
  7721. "Event.command.executed": {
  7722. "type": "object",
  7723. "properties": {
  7724. "type": {
  7725. "type": "string",
  7726. "const": "command.executed"
  7727. },
  7728. "properties": {
  7729. "type": "object",
  7730. "properties": {
  7731. "name": {
  7732. "type": "string"
  7733. },
  7734. "sessionID": {
  7735. "type": "string",
  7736. "pattern": "^ses.*"
  7737. },
  7738. "arguments": {
  7739. "type": "string"
  7740. },
  7741. "messageID": {
  7742. "type": "string",
  7743. "pattern": "^msg.*"
  7744. }
  7745. },
  7746. "required": ["name", "sessionID", "arguments", "messageID"]
  7747. }
  7748. },
  7749. "required": ["type", "properties"]
  7750. },
  7751. "PermissionAction": {
  7752. "type": "string",
  7753. "enum": ["allow", "deny", "ask"]
  7754. },
  7755. "PermissionRule": {
  7756. "type": "object",
  7757. "properties": {
  7758. "permission": {
  7759. "type": "string"
  7760. },
  7761. "pattern": {
  7762. "type": "string"
  7763. },
  7764. "action": {
  7765. "$ref": "#/components/schemas/PermissionAction"
  7766. }
  7767. },
  7768. "required": ["permission", "pattern", "action"]
  7769. },
  7770. "PermissionRuleset": {
  7771. "type": "array",
  7772. "items": {
  7773. "$ref": "#/components/schemas/PermissionRule"
  7774. }
  7775. },
  7776. "Session": {
  7777. "type": "object",
  7778. "properties": {
  7779. "id": {
  7780. "type": "string",
  7781. "pattern": "^ses.*"
  7782. },
  7783. "slug": {
  7784. "type": "string"
  7785. },
  7786. "projectID": {
  7787. "type": "string"
  7788. },
  7789. "directory": {
  7790. "type": "string"
  7791. },
  7792. "parentID": {
  7793. "type": "string",
  7794. "pattern": "^ses.*"
  7795. },
  7796. "summary": {
  7797. "type": "object",
  7798. "properties": {
  7799. "additions": {
  7800. "type": "number"
  7801. },
  7802. "deletions": {
  7803. "type": "number"
  7804. },
  7805. "files": {
  7806. "type": "number"
  7807. },
  7808. "diffs": {
  7809. "type": "array",
  7810. "items": {
  7811. "$ref": "#/components/schemas/FileDiff"
  7812. }
  7813. }
  7814. },
  7815. "required": ["additions", "deletions", "files"]
  7816. },
  7817. "share": {
  7818. "type": "object",
  7819. "properties": {
  7820. "url": {
  7821. "type": "string"
  7822. }
  7823. },
  7824. "required": ["url"]
  7825. },
  7826. "title": {
  7827. "type": "string"
  7828. },
  7829. "version": {
  7830. "type": "string"
  7831. },
  7832. "time": {
  7833. "type": "object",
  7834. "properties": {
  7835. "created": {
  7836. "type": "number"
  7837. },
  7838. "updated": {
  7839. "type": "number"
  7840. },
  7841. "compacting": {
  7842. "type": "number"
  7843. },
  7844. "archived": {
  7845. "type": "number"
  7846. }
  7847. },
  7848. "required": ["created", "updated"]
  7849. },
  7850. "permission": {
  7851. "$ref": "#/components/schemas/PermissionRuleset"
  7852. },
  7853. "revert": {
  7854. "type": "object",
  7855. "properties": {
  7856. "messageID": {
  7857. "type": "string"
  7858. },
  7859. "partID": {
  7860. "type": "string"
  7861. },
  7862. "snapshot": {
  7863. "type": "string"
  7864. },
  7865. "diff": {
  7866. "type": "string"
  7867. }
  7868. },
  7869. "required": ["messageID"]
  7870. }
  7871. },
  7872. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  7873. },
  7874. "Event.session.created": {
  7875. "type": "object",
  7876. "properties": {
  7877. "type": {
  7878. "type": "string",
  7879. "const": "session.created"
  7880. },
  7881. "properties": {
  7882. "type": "object",
  7883. "properties": {
  7884. "info": {
  7885. "$ref": "#/components/schemas/Session"
  7886. }
  7887. },
  7888. "required": ["info"]
  7889. }
  7890. },
  7891. "required": ["type", "properties"]
  7892. },
  7893. "Event.session.updated": {
  7894. "type": "object",
  7895. "properties": {
  7896. "type": {
  7897. "type": "string",
  7898. "const": "session.updated"
  7899. },
  7900. "properties": {
  7901. "type": "object",
  7902. "properties": {
  7903. "info": {
  7904. "$ref": "#/components/schemas/Session"
  7905. }
  7906. },
  7907. "required": ["info"]
  7908. }
  7909. },
  7910. "required": ["type", "properties"]
  7911. },
  7912. "Event.session.deleted": {
  7913. "type": "object",
  7914. "properties": {
  7915. "type": {
  7916. "type": "string",
  7917. "const": "session.deleted"
  7918. },
  7919. "properties": {
  7920. "type": "object",
  7921. "properties": {
  7922. "info": {
  7923. "$ref": "#/components/schemas/Session"
  7924. }
  7925. },
  7926. "required": ["info"]
  7927. }
  7928. },
  7929. "required": ["type", "properties"]
  7930. },
  7931. "Event.session.diff": {
  7932. "type": "object",
  7933. "properties": {
  7934. "type": {
  7935. "type": "string",
  7936. "const": "session.diff"
  7937. },
  7938. "properties": {
  7939. "type": "object",
  7940. "properties": {
  7941. "sessionID": {
  7942. "type": "string"
  7943. },
  7944. "diff": {
  7945. "type": "array",
  7946. "items": {
  7947. "$ref": "#/components/schemas/FileDiff"
  7948. }
  7949. }
  7950. },
  7951. "required": ["sessionID", "diff"]
  7952. }
  7953. },
  7954. "required": ["type", "properties"]
  7955. },
  7956. "Event.session.error": {
  7957. "type": "object",
  7958. "properties": {
  7959. "type": {
  7960. "type": "string",
  7961. "const": "session.error"
  7962. },
  7963. "properties": {
  7964. "type": "object",
  7965. "properties": {
  7966. "sessionID": {
  7967. "type": "string"
  7968. },
  7969. "error": {
  7970. "anyOf": [
  7971. {
  7972. "$ref": "#/components/schemas/ProviderAuthError"
  7973. },
  7974. {
  7975. "$ref": "#/components/schemas/UnknownError"
  7976. },
  7977. {
  7978. "$ref": "#/components/schemas/MessageOutputLengthError"
  7979. },
  7980. {
  7981. "$ref": "#/components/schemas/MessageAbortedError"
  7982. },
  7983. {
  7984. "$ref": "#/components/schemas/APIError"
  7985. }
  7986. ]
  7987. }
  7988. }
  7989. }
  7990. },
  7991. "required": ["type", "properties"]
  7992. },
  7993. "Event.vcs.branch.updated": {
  7994. "type": "object",
  7995. "properties": {
  7996. "type": {
  7997. "type": "string",
  7998. "const": "vcs.branch.updated"
  7999. },
  8000. "properties": {
  8001. "type": "object",
  8002. "properties": {
  8003. "branch": {
  8004. "type": "string"
  8005. }
  8006. }
  8007. }
  8008. },
  8009. "required": ["type", "properties"]
  8010. },
  8011. "Pty": {
  8012. "type": "object",
  8013. "properties": {
  8014. "id": {
  8015. "type": "string",
  8016. "pattern": "^pty.*"
  8017. },
  8018. "title": {
  8019. "type": "string"
  8020. },
  8021. "command": {
  8022. "type": "string"
  8023. },
  8024. "args": {
  8025. "type": "array",
  8026. "items": {
  8027. "type": "string"
  8028. }
  8029. },
  8030. "cwd": {
  8031. "type": "string"
  8032. },
  8033. "status": {
  8034. "type": "string",
  8035. "enum": ["running", "exited"]
  8036. },
  8037. "pid": {
  8038. "type": "number"
  8039. }
  8040. },
  8041. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  8042. },
  8043. "Event.pty.created": {
  8044. "type": "object",
  8045. "properties": {
  8046. "type": {
  8047. "type": "string",
  8048. "const": "pty.created"
  8049. },
  8050. "properties": {
  8051. "type": "object",
  8052. "properties": {
  8053. "info": {
  8054. "$ref": "#/components/schemas/Pty"
  8055. }
  8056. },
  8057. "required": ["info"]
  8058. }
  8059. },
  8060. "required": ["type", "properties"]
  8061. },
  8062. "Event.pty.updated": {
  8063. "type": "object",
  8064. "properties": {
  8065. "type": {
  8066. "type": "string",
  8067. "const": "pty.updated"
  8068. },
  8069. "properties": {
  8070. "type": "object",
  8071. "properties": {
  8072. "info": {
  8073. "$ref": "#/components/schemas/Pty"
  8074. }
  8075. },
  8076. "required": ["info"]
  8077. }
  8078. },
  8079. "required": ["type", "properties"]
  8080. },
  8081. "Event.pty.exited": {
  8082. "type": "object",
  8083. "properties": {
  8084. "type": {
  8085. "type": "string",
  8086. "const": "pty.exited"
  8087. },
  8088. "properties": {
  8089. "type": "object",
  8090. "properties": {
  8091. "id": {
  8092. "type": "string",
  8093. "pattern": "^pty.*"
  8094. },
  8095. "exitCode": {
  8096. "type": "number"
  8097. }
  8098. },
  8099. "required": ["id", "exitCode"]
  8100. }
  8101. },
  8102. "required": ["type", "properties"]
  8103. },
  8104. "Event.pty.deleted": {
  8105. "type": "object",
  8106. "properties": {
  8107. "type": {
  8108. "type": "string",
  8109. "const": "pty.deleted"
  8110. },
  8111. "properties": {
  8112. "type": "object",
  8113. "properties": {
  8114. "id": {
  8115. "type": "string",
  8116. "pattern": "^pty.*"
  8117. }
  8118. },
  8119. "required": ["id"]
  8120. }
  8121. },
  8122. "required": ["type", "properties"]
  8123. },
  8124. "Event.worktree.ready": {
  8125. "type": "object",
  8126. "properties": {
  8127. "type": {
  8128. "type": "string",
  8129. "const": "worktree.ready"
  8130. },
  8131. "properties": {
  8132. "type": "object",
  8133. "properties": {
  8134. "name": {
  8135. "type": "string"
  8136. },
  8137. "branch": {
  8138. "type": "string"
  8139. }
  8140. },
  8141. "required": ["name", "branch"]
  8142. }
  8143. },
  8144. "required": ["type", "properties"]
  8145. },
  8146. "Event.worktree.failed": {
  8147. "type": "object",
  8148. "properties": {
  8149. "type": {
  8150. "type": "string",
  8151. "const": "worktree.failed"
  8152. },
  8153. "properties": {
  8154. "type": "object",
  8155. "properties": {
  8156. "message": {
  8157. "type": "string"
  8158. }
  8159. },
  8160. "required": ["message"]
  8161. }
  8162. },
  8163. "required": ["type", "properties"]
  8164. },
  8165. "Event": {
  8166. "anyOf": [
  8167. {
  8168. "$ref": "#/components/schemas/Event.installation.updated"
  8169. },
  8170. {
  8171. "$ref": "#/components/schemas/Event.installation.update-available"
  8172. },
  8173. {
  8174. "$ref": "#/components/schemas/Event.project.updated"
  8175. },
  8176. {
  8177. "$ref": "#/components/schemas/Event.server.instance.disposed"
  8178. },
  8179. {
  8180. "$ref": "#/components/schemas/Event.server.connected"
  8181. },
  8182. {
  8183. "$ref": "#/components/schemas/Event.global.disposed"
  8184. },
  8185. {
  8186. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  8187. },
  8188. {
  8189. "$ref": "#/components/schemas/Event.lsp.updated"
  8190. },
  8191. {
  8192. "$ref": "#/components/schemas/Event.file.edited"
  8193. },
  8194. {
  8195. "$ref": "#/components/schemas/Event.message.updated"
  8196. },
  8197. {
  8198. "$ref": "#/components/schemas/Event.message.removed"
  8199. },
  8200. {
  8201. "$ref": "#/components/schemas/Event.message.part.updated"
  8202. },
  8203. {
  8204. "$ref": "#/components/schemas/Event.message.part.removed"
  8205. },
  8206. {
  8207. "$ref": "#/components/schemas/Event.permission.asked"
  8208. },
  8209. {
  8210. "$ref": "#/components/schemas/Event.permission.replied"
  8211. },
  8212. {
  8213. "$ref": "#/components/schemas/Event.session.status"
  8214. },
  8215. {
  8216. "$ref": "#/components/schemas/Event.session.idle"
  8217. },
  8218. {
  8219. "$ref": "#/components/schemas/Event.question.asked"
  8220. },
  8221. {
  8222. "$ref": "#/components/schemas/Event.question.replied"
  8223. },
  8224. {
  8225. "$ref": "#/components/schemas/Event.question.rejected"
  8226. },
  8227. {
  8228. "$ref": "#/components/schemas/Event.session.compacted"
  8229. },
  8230. {
  8231. "$ref": "#/components/schemas/Event.todo.updated"
  8232. },
  8233. {
  8234. "$ref": "#/components/schemas/Event.file.watcher.updated"
  8235. },
  8236. {
  8237. "$ref": "#/components/schemas/Event.tui.prompt.append"
  8238. },
  8239. {
  8240. "$ref": "#/components/schemas/Event.tui.command.execute"
  8241. },
  8242. {
  8243. "$ref": "#/components/schemas/Event.tui.toast.show"
  8244. },
  8245. {
  8246. "$ref": "#/components/schemas/Event.tui.session.select"
  8247. },
  8248. {
  8249. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  8250. },
  8251. {
  8252. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  8253. },
  8254. {
  8255. "$ref": "#/components/schemas/Event.command.executed"
  8256. },
  8257. {
  8258. "$ref": "#/components/schemas/Event.session.created"
  8259. },
  8260. {
  8261. "$ref": "#/components/schemas/Event.session.updated"
  8262. },
  8263. {
  8264. "$ref": "#/components/schemas/Event.session.deleted"
  8265. },
  8266. {
  8267. "$ref": "#/components/schemas/Event.session.diff"
  8268. },
  8269. {
  8270. "$ref": "#/components/schemas/Event.session.error"
  8271. },
  8272. {
  8273. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  8274. },
  8275. {
  8276. "$ref": "#/components/schemas/Event.pty.created"
  8277. },
  8278. {
  8279. "$ref": "#/components/schemas/Event.pty.updated"
  8280. },
  8281. {
  8282. "$ref": "#/components/schemas/Event.pty.exited"
  8283. },
  8284. {
  8285. "$ref": "#/components/schemas/Event.pty.deleted"
  8286. },
  8287. {
  8288. "$ref": "#/components/schemas/Event.worktree.ready"
  8289. },
  8290. {
  8291. "$ref": "#/components/schemas/Event.worktree.failed"
  8292. }
  8293. ]
  8294. },
  8295. "GlobalEvent": {
  8296. "type": "object",
  8297. "properties": {
  8298. "directory": {
  8299. "type": "string"
  8300. },
  8301. "payload": {
  8302. "$ref": "#/components/schemas/Event"
  8303. }
  8304. },
  8305. "required": ["directory", "payload"]
  8306. },
  8307. "BadRequestError": {
  8308. "type": "object",
  8309. "properties": {
  8310. "data": {},
  8311. "errors": {
  8312. "type": "array",
  8313. "items": {
  8314. "type": "object",
  8315. "propertyNames": {
  8316. "type": "string"
  8317. },
  8318. "additionalProperties": {}
  8319. }
  8320. },
  8321. "success": {
  8322. "type": "boolean",
  8323. "const": false
  8324. }
  8325. },
  8326. "required": ["data", "errors", "success"]
  8327. },
  8328. "NotFoundError": {
  8329. "type": "object",
  8330. "properties": {
  8331. "name": {
  8332. "type": "string",
  8333. "const": "NotFoundError"
  8334. },
  8335. "data": {
  8336. "type": "object",
  8337. "properties": {
  8338. "message": {
  8339. "type": "string"
  8340. }
  8341. },
  8342. "required": ["message"]
  8343. }
  8344. },
  8345. "required": ["name", "data"]
  8346. },
  8347. "KeybindsConfig": {
  8348. "description": "Custom keybind configurations",
  8349. "type": "object",
  8350. "properties": {
  8351. "leader": {
  8352. "description": "Leader key for keybind combinations",
  8353. "default": "ctrl+x",
  8354. "type": "string"
  8355. },
  8356. "app_exit": {
  8357. "description": "Exit the application",
  8358. "default": "ctrl+c,ctrl+d,<leader>q",
  8359. "type": "string"
  8360. },
  8361. "editor_open": {
  8362. "description": "Open external editor",
  8363. "default": "<leader>e",
  8364. "type": "string"
  8365. },
  8366. "theme_list": {
  8367. "description": "List available themes",
  8368. "default": "<leader>t",
  8369. "type": "string"
  8370. },
  8371. "sidebar_toggle": {
  8372. "description": "Toggle sidebar",
  8373. "default": "<leader>b",
  8374. "type": "string"
  8375. },
  8376. "scrollbar_toggle": {
  8377. "description": "Toggle session scrollbar",
  8378. "default": "none",
  8379. "type": "string"
  8380. },
  8381. "username_toggle": {
  8382. "description": "Toggle username visibility",
  8383. "default": "none",
  8384. "type": "string"
  8385. },
  8386. "status_view": {
  8387. "description": "View status",
  8388. "default": "<leader>s",
  8389. "type": "string"
  8390. },
  8391. "session_export": {
  8392. "description": "Export session to editor",
  8393. "default": "<leader>x",
  8394. "type": "string"
  8395. },
  8396. "session_new": {
  8397. "description": "Create a new session",
  8398. "default": "<leader>n",
  8399. "type": "string"
  8400. },
  8401. "session_list": {
  8402. "description": "List all sessions",
  8403. "default": "<leader>l",
  8404. "type": "string"
  8405. },
  8406. "session_timeline": {
  8407. "description": "Show session timeline",
  8408. "default": "<leader>g",
  8409. "type": "string"
  8410. },
  8411. "session_fork": {
  8412. "description": "Fork session from message",
  8413. "default": "none",
  8414. "type": "string"
  8415. },
  8416. "session_rename": {
  8417. "description": "Rename session",
  8418. "default": "ctrl+r",
  8419. "type": "string"
  8420. },
  8421. "session_delete": {
  8422. "description": "Delete session",
  8423. "default": "ctrl+d",
  8424. "type": "string"
  8425. },
  8426. "stash_delete": {
  8427. "description": "Delete stash entry",
  8428. "default": "ctrl+d",
  8429. "type": "string"
  8430. },
  8431. "model_provider_list": {
  8432. "description": "Open provider list from model dialog",
  8433. "default": "ctrl+a",
  8434. "type": "string"
  8435. },
  8436. "model_favorite_toggle": {
  8437. "description": "Toggle model favorite status",
  8438. "default": "ctrl+f",
  8439. "type": "string"
  8440. },
  8441. "session_share": {
  8442. "description": "Share current session",
  8443. "default": "none",
  8444. "type": "string"
  8445. },
  8446. "session_unshare": {
  8447. "description": "Unshare current session",
  8448. "default": "none",
  8449. "type": "string"
  8450. },
  8451. "session_interrupt": {
  8452. "description": "Interrupt current session",
  8453. "default": "escape",
  8454. "type": "string"
  8455. },
  8456. "session_compact": {
  8457. "description": "Compact the session",
  8458. "default": "<leader>c",
  8459. "type": "string"
  8460. },
  8461. "messages_page_up": {
  8462. "description": "Scroll messages up by one page",
  8463. "default": "pageup,ctrl+alt+b",
  8464. "type": "string"
  8465. },
  8466. "messages_page_down": {
  8467. "description": "Scroll messages down by one page",
  8468. "default": "pagedown,ctrl+alt+f",
  8469. "type": "string"
  8470. },
  8471. "messages_line_up": {
  8472. "description": "Scroll messages up by one line",
  8473. "default": "ctrl+alt+y",
  8474. "type": "string"
  8475. },
  8476. "messages_line_down": {
  8477. "description": "Scroll messages down by one line",
  8478. "default": "ctrl+alt+e",
  8479. "type": "string"
  8480. },
  8481. "messages_half_page_up": {
  8482. "description": "Scroll messages up by half page",
  8483. "default": "ctrl+alt+u",
  8484. "type": "string"
  8485. },
  8486. "messages_half_page_down": {
  8487. "description": "Scroll messages down by half page",
  8488. "default": "ctrl+alt+d",
  8489. "type": "string"
  8490. },
  8491. "messages_first": {
  8492. "description": "Navigate to first message",
  8493. "default": "ctrl+g,home",
  8494. "type": "string"
  8495. },
  8496. "messages_last": {
  8497. "description": "Navigate to last message",
  8498. "default": "ctrl+alt+g,end",
  8499. "type": "string"
  8500. },
  8501. "messages_next": {
  8502. "description": "Navigate to next message",
  8503. "default": "none",
  8504. "type": "string"
  8505. },
  8506. "messages_previous": {
  8507. "description": "Navigate to previous message",
  8508. "default": "none",
  8509. "type": "string"
  8510. },
  8511. "messages_last_user": {
  8512. "description": "Navigate to last user message",
  8513. "default": "none",
  8514. "type": "string"
  8515. },
  8516. "messages_copy": {
  8517. "description": "Copy message",
  8518. "default": "<leader>y",
  8519. "type": "string"
  8520. },
  8521. "messages_undo": {
  8522. "description": "Undo message",
  8523. "default": "<leader>u",
  8524. "type": "string"
  8525. },
  8526. "messages_redo": {
  8527. "description": "Redo message",
  8528. "default": "<leader>r",
  8529. "type": "string"
  8530. },
  8531. "messages_toggle_conceal": {
  8532. "description": "Toggle code block concealment in messages",
  8533. "default": "<leader>h",
  8534. "type": "string"
  8535. },
  8536. "tool_details": {
  8537. "description": "Toggle tool details visibility",
  8538. "default": "none",
  8539. "type": "string"
  8540. },
  8541. "model_list": {
  8542. "description": "List available models",
  8543. "default": "<leader>m",
  8544. "type": "string"
  8545. },
  8546. "model_cycle_recent": {
  8547. "description": "Next recently used model",
  8548. "default": "f2",
  8549. "type": "string"
  8550. },
  8551. "model_cycle_recent_reverse": {
  8552. "description": "Previous recently used model",
  8553. "default": "shift+f2",
  8554. "type": "string"
  8555. },
  8556. "model_cycle_favorite": {
  8557. "description": "Next favorite model",
  8558. "default": "none",
  8559. "type": "string"
  8560. },
  8561. "model_cycle_favorite_reverse": {
  8562. "description": "Previous favorite model",
  8563. "default": "none",
  8564. "type": "string"
  8565. },
  8566. "command_list": {
  8567. "description": "List available commands",
  8568. "default": "ctrl+p",
  8569. "type": "string"
  8570. },
  8571. "agent_list": {
  8572. "description": "List agents",
  8573. "default": "<leader>a",
  8574. "type": "string"
  8575. },
  8576. "agent_cycle": {
  8577. "description": "Next agent",
  8578. "default": "tab",
  8579. "type": "string"
  8580. },
  8581. "agent_cycle_reverse": {
  8582. "description": "Previous agent",
  8583. "default": "shift+tab",
  8584. "type": "string"
  8585. },
  8586. "variant_cycle": {
  8587. "description": "Cycle model variants",
  8588. "default": "ctrl+t",
  8589. "type": "string"
  8590. },
  8591. "input_clear": {
  8592. "description": "Clear input field",
  8593. "default": "ctrl+c",
  8594. "type": "string"
  8595. },
  8596. "input_paste": {
  8597. "description": "Paste from clipboard",
  8598. "default": "ctrl+v",
  8599. "type": "string"
  8600. },
  8601. "input_submit": {
  8602. "description": "Submit input",
  8603. "default": "return",
  8604. "type": "string"
  8605. },
  8606. "input_newline": {
  8607. "description": "Insert newline in input",
  8608. "default": "shift+return,ctrl+return,alt+return,ctrl+j",
  8609. "type": "string"
  8610. },
  8611. "input_move_left": {
  8612. "description": "Move cursor left in input",
  8613. "default": "left,ctrl+b",
  8614. "type": "string"
  8615. },
  8616. "input_move_right": {
  8617. "description": "Move cursor right in input",
  8618. "default": "right,ctrl+f",
  8619. "type": "string"
  8620. },
  8621. "input_move_up": {
  8622. "description": "Move cursor up in input",
  8623. "default": "up",
  8624. "type": "string"
  8625. },
  8626. "input_move_down": {
  8627. "description": "Move cursor down in input",
  8628. "default": "down",
  8629. "type": "string"
  8630. },
  8631. "input_select_left": {
  8632. "description": "Select left in input",
  8633. "default": "shift+left",
  8634. "type": "string"
  8635. },
  8636. "input_select_right": {
  8637. "description": "Select right in input",
  8638. "default": "shift+right",
  8639. "type": "string"
  8640. },
  8641. "input_select_up": {
  8642. "description": "Select up in input",
  8643. "default": "shift+up",
  8644. "type": "string"
  8645. },
  8646. "input_select_down": {
  8647. "description": "Select down in input",
  8648. "default": "shift+down",
  8649. "type": "string"
  8650. },
  8651. "input_line_home": {
  8652. "description": "Move to start of line in input",
  8653. "default": "ctrl+a",
  8654. "type": "string"
  8655. },
  8656. "input_line_end": {
  8657. "description": "Move to end of line in input",
  8658. "default": "ctrl+e",
  8659. "type": "string"
  8660. },
  8661. "input_select_line_home": {
  8662. "description": "Select to start of line in input",
  8663. "default": "ctrl+shift+a",
  8664. "type": "string"
  8665. },
  8666. "input_select_line_end": {
  8667. "description": "Select to end of line in input",
  8668. "default": "ctrl+shift+e",
  8669. "type": "string"
  8670. },
  8671. "input_visual_line_home": {
  8672. "description": "Move to start of visual line in input",
  8673. "default": "alt+a",
  8674. "type": "string"
  8675. },
  8676. "input_visual_line_end": {
  8677. "description": "Move to end of visual line in input",
  8678. "default": "alt+e",
  8679. "type": "string"
  8680. },
  8681. "input_select_visual_line_home": {
  8682. "description": "Select to start of visual line in input",
  8683. "default": "alt+shift+a",
  8684. "type": "string"
  8685. },
  8686. "input_select_visual_line_end": {
  8687. "description": "Select to end of visual line in input",
  8688. "default": "alt+shift+e",
  8689. "type": "string"
  8690. },
  8691. "input_buffer_home": {
  8692. "description": "Move to start of buffer in input",
  8693. "default": "home",
  8694. "type": "string"
  8695. },
  8696. "input_buffer_end": {
  8697. "description": "Move to end of buffer in input",
  8698. "default": "end",
  8699. "type": "string"
  8700. },
  8701. "input_select_buffer_home": {
  8702. "description": "Select to start of buffer in input",
  8703. "default": "shift+home",
  8704. "type": "string"
  8705. },
  8706. "input_select_buffer_end": {
  8707. "description": "Select to end of buffer in input",
  8708. "default": "shift+end",
  8709. "type": "string"
  8710. },
  8711. "input_delete_line": {
  8712. "description": "Delete line in input",
  8713. "default": "ctrl+shift+d",
  8714. "type": "string"
  8715. },
  8716. "input_delete_to_line_end": {
  8717. "description": "Delete to end of line in input",
  8718. "default": "ctrl+k",
  8719. "type": "string"
  8720. },
  8721. "input_delete_to_line_start": {
  8722. "description": "Delete to start of line in input",
  8723. "default": "ctrl+u",
  8724. "type": "string"
  8725. },
  8726. "input_backspace": {
  8727. "description": "Backspace in input",
  8728. "default": "backspace,shift+backspace",
  8729. "type": "string"
  8730. },
  8731. "input_delete": {
  8732. "description": "Delete character in input",
  8733. "default": "ctrl+d,delete,shift+delete",
  8734. "type": "string"
  8735. },
  8736. "input_undo": {
  8737. "description": "Undo in input",
  8738. "default": "ctrl+-,super+z",
  8739. "type": "string"
  8740. },
  8741. "input_redo": {
  8742. "description": "Redo in input",
  8743. "default": "ctrl+.,super+shift+z",
  8744. "type": "string"
  8745. },
  8746. "input_word_forward": {
  8747. "description": "Move word forward in input",
  8748. "default": "alt+f,alt+right,ctrl+right",
  8749. "type": "string"
  8750. },
  8751. "input_word_backward": {
  8752. "description": "Move word backward in input",
  8753. "default": "alt+b,alt+left,ctrl+left",
  8754. "type": "string"
  8755. },
  8756. "input_select_word_forward": {
  8757. "description": "Select word forward in input",
  8758. "default": "alt+shift+f,alt+shift+right",
  8759. "type": "string"
  8760. },
  8761. "input_select_word_backward": {
  8762. "description": "Select word backward in input",
  8763. "default": "alt+shift+b,alt+shift+left",
  8764. "type": "string"
  8765. },
  8766. "input_delete_word_forward": {
  8767. "description": "Delete word forward in input",
  8768. "default": "alt+d,alt+delete,ctrl+delete",
  8769. "type": "string"
  8770. },
  8771. "input_delete_word_backward": {
  8772. "description": "Delete word backward in input",
  8773. "default": "ctrl+w,ctrl+backspace,alt+backspace",
  8774. "type": "string"
  8775. },
  8776. "history_previous": {
  8777. "description": "Previous history item",
  8778. "default": "up",
  8779. "type": "string"
  8780. },
  8781. "history_next": {
  8782. "description": "Next history item",
  8783. "default": "down",
  8784. "type": "string"
  8785. },
  8786. "session_child_cycle": {
  8787. "description": "Next child session",
  8788. "default": "<leader>right",
  8789. "type": "string"
  8790. },
  8791. "session_child_cycle_reverse": {
  8792. "description": "Previous child session",
  8793. "default": "<leader>left",
  8794. "type": "string"
  8795. },
  8796. "session_parent": {
  8797. "description": "Go to parent session",
  8798. "default": "<leader>up",
  8799. "type": "string"
  8800. },
  8801. "terminal_suspend": {
  8802. "description": "Suspend terminal",
  8803. "default": "ctrl+z",
  8804. "type": "string"
  8805. },
  8806. "terminal_title_toggle": {
  8807. "description": "Toggle terminal title",
  8808. "default": "none",
  8809. "type": "string"
  8810. },
  8811. "tips_toggle": {
  8812. "description": "Toggle tips on home screen",
  8813. "default": "<leader>h",
  8814. "type": "string"
  8815. }
  8816. },
  8817. "additionalProperties": false
  8818. },
  8819. "LogLevel": {
  8820. "description": "Log level",
  8821. "type": "string",
  8822. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  8823. },
  8824. "ServerConfig": {
  8825. "description": "Server configuration for opencode serve and web commands",
  8826. "type": "object",
  8827. "properties": {
  8828. "port": {
  8829. "description": "Port to listen on",
  8830. "type": "integer",
  8831. "exclusiveMinimum": 0,
  8832. "maximum": 9007199254740991
  8833. },
  8834. "hostname": {
  8835. "description": "Hostname to listen on",
  8836. "type": "string"
  8837. },
  8838. "mdns": {
  8839. "description": "Enable mDNS service discovery",
  8840. "type": "boolean"
  8841. },
  8842. "cors": {
  8843. "description": "Additional domains to allow for CORS",
  8844. "type": "array",
  8845. "items": {
  8846. "type": "string"
  8847. }
  8848. }
  8849. },
  8850. "additionalProperties": false
  8851. },
  8852. "PermissionActionConfig": {
  8853. "type": "string",
  8854. "enum": ["ask", "allow", "deny"]
  8855. },
  8856. "PermissionObjectConfig": {
  8857. "type": "object",
  8858. "propertyNames": {
  8859. "type": "string"
  8860. },
  8861. "additionalProperties": {
  8862. "$ref": "#/components/schemas/PermissionActionConfig"
  8863. }
  8864. },
  8865. "PermissionRuleConfig": {
  8866. "anyOf": [
  8867. {
  8868. "$ref": "#/components/schemas/PermissionActionConfig"
  8869. },
  8870. {
  8871. "$ref": "#/components/schemas/PermissionObjectConfig"
  8872. }
  8873. ]
  8874. },
  8875. "PermissionConfig": {
  8876. "anyOf": [
  8877. {
  8878. "type": "object",
  8879. "properties": {
  8880. "__originalKeys": {
  8881. "type": "array",
  8882. "items": {
  8883. "type": "string"
  8884. }
  8885. },
  8886. "read": {
  8887. "$ref": "#/components/schemas/PermissionRuleConfig"
  8888. },
  8889. "edit": {
  8890. "$ref": "#/components/schemas/PermissionRuleConfig"
  8891. },
  8892. "glob": {
  8893. "$ref": "#/components/schemas/PermissionRuleConfig"
  8894. },
  8895. "grep": {
  8896. "$ref": "#/components/schemas/PermissionRuleConfig"
  8897. },
  8898. "list": {
  8899. "$ref": "#/components/schemas/PermissionRuleConfig"
  8900. },
  8901. "bash": {
  8902. "$ref": "#/components/schemas/PermissionRuleConfig"
  8903. },
  8904. "task": {
  8905. "$ref": "#/components/schemas/PermissionRuleConfig"
  8906. },
  8907. "external_directory": {
  8908. "$ref": "#/components/schemas/PermissionRuleConfig"
  8909. },
  8910. "todowrite": {
  8911. "$ref": "#/components/schemas/PermissionActionConfig"
  8912. },
  8913. "todoread": {
  8914. "$ref": "#/components/schemas/PermissionActionConfig"
  8915. },
  8916. "question": {
  8917. "$ref": "#/components/schemas/PermissionActionConfig"
  8918. },
  8919. "webfetch": {
  8920. "$ref": "#/components/schemas/PermissionActionConfig"
  8921. },
  8922. "websearch": {
  8923. "$ref": "#/components/schemas/PermissionActionConfig"
  8924. },
  8925. "codesearch": {
  8926. "$ref": "#/components/schemas/PermissionActionConfig"
  8927. },
  8928. "lsp": {
  8929. "$ref": "#/components/schemas/PermissionRuleConfig"
  8930. },
  8931. "doom_loop": {
  8932. "$ref": "#/components/schemas/PermissionActionConfig"
  8933. }
  8934. },
  8935. "additionalProperties": {
  8936. "$ref": "#/components/schemas/PermissionRuleConfig"
  8937. }
  8938. },
  8939. {
  8940. "$ref": "#/components/schemas/PermissionActionConfig"
  8941. }
  8942. ]
  8943. },
  8944. "AgentConfig": {
  8945. "type": "object",
  8946. "properties": {
  8947. "model": {
  8948. "type": "string"
  8949. },
  8950. "temperature": {
  8951. "type": "number"
  8952. },
  8953. "top_p": {
  8954. "type": "number"
  8955. },
  8956. "prompt": {
  8957. "type": "string"
  8958. },
  8959. "tools": {
  8960. "description": "@deprecated Use 'permission' field instead",
  8961. "type": "object",
  8962. "propertyNames": {
  8963. "type": "string"
  8964. },
  8965. "additionalProperties": {
  8966. "type": "boolean"
  8967. }
  8968. },
  8969. "disable": {
  8970. "type": "boolean"
  8971. },
  8972. "description": {
  8973. "description": "Description of when to use the agent",
  8974. "type": "string"
  8975. },
  8976. "mode": {
  8977. "type": "string",
  8978. "enum": ["subagent", "primary", "all"]
  8979. },
  8980. "hidden": {
  8981. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  8982. "type": "boolean"
  8983. },
  8984. "options": {
  8985. "type": "object",
  8986. "propertyNames": {
  8987. "type": "string"
  8988. },
  8989. "additionalProperties": {}
  8990. },
  8991. "color": {
  8992. "description": "Hex color code for the agent (e.g., #FF5733)",
  8993. "type": "string",
  8994. "pattern": "^#[0-9a-fA-F]{6}$"
  8995. },
  8996. "steps": {
  8997. "description": "Maximum number of agentic iterations before forcing text-only response",
  8998. "type": "integer",
  8999. "exclusiveMinimum": 0,
  9000. "maximum": 9007199254740991
  9001. },
  9002. "maxSteps": {
  9003. "description": "@deprecated Use 'steps' field instead.",
  9004. "type": "integer",
  9005. "exclusiveMinimum": 0,
  9006. "maximum": 9007199254740991
  9007. },
  9008. "permission": {
  9009. "$ref": "#/components/schemas/PermissionConfig"
  9010. }
  9011. },
  9012. "additionalProperties": {}
  9013. },
  9014. "ProviderConfig": {
  9015. "type": "object",
  9016. "properties": {
  9017. "api": {
  9018. "type": "string"
  9019. },
  9020. "name": {
  9021. "type": "string"
  9022. },
  9023. "env": {
  9024. "type": "array",
  9025. "items": {
  9026. "type": "string"
  9027. }
  9028. },
  9029. "id": {
  9030. "type": "string"
  9031. },
  9032. "npm": {
  9033. "type": "string"
  9034. },
  9035. "models": {
  9036. "type": "object",
  9037. "propertyNames": {
  9038. "type": "string"
  9039. },
  9040. "additionalProperties": {
  9041. "type": "object",
  9042. "properties": {
  9043. "id": {
  9044. "type": "string"
  9045. },
  9046. "name": {
  9047. "type": "string"
  9048. },
  9049. "family": {
  9050. "type": "string"
  9051. },
  9052. "release_date": {
  9053. "type": "string"
  9054. },
  9055. "attachment": {
  9056. "type": "boolean"
  9057. },
  9058. "reasoning": {
  9059. "type": "boolean"
  9060. },
  9061. "temperature": {
  9062. "type": "boolean"
  9063. },
  9064. "tool_call": {
  9065. "type": "boolean"
  9066. },
  9067. "interleaved": {
  9068. "anyOf": [
  9069. {
  9070. "type": "boolean",
  9071. "const": true
  9072. },
  9073. {
  9074. "type": "object",
  9075. "properties": {
  9076. "field": {
  9077. "type": "string",
  9078. "enum": ["reasoning_content", "reasoning_details"]
  9079. }
  9080. },
  9081. "required": ["field"],
  9082. "additionalProperties": false
  9083. }
  9084. ]
  9085. },
  9086. "cost": {
  9087. "type": "object",
  9088. "properties": {
  9089. "input": {
  9090. "type": "number"
  9091. },
  9092. "output": {
  9093. "type": "number"
  9094. },
  9095. "cache_read": {
  9096. "type": "number"
  9097. },
  9098. "cache_write": {
  9099. "type": "number"
  9100. },
  9101. "context_over_200k": {
  9102. "type": "object",
  9103. "properties": {
  9104. "input": {
  9105. "type": "number"
  9106. },
  9107. "output": {
  9108. "type": "number"
  9109. },
  9110. "cache_read": {
  9111. "type": "number"
  9112. },
  9113. "cache_write": {
  9114. "type": "number"
  9115. }
  9116. },
  9117. "required": ["input", "output"]
  9118. }
  9119. },
  9120. "required": ["input", "output"]
  9121. },
  9122. "limit": {
  9123. "type": "object",
  9124. "properties": {
  9125. "context": {
  9126. "type": "number"
  9127. },
  9128. "input": {
  9129. "type": "number"
  9130. },
  9131. "output": {
  9132. "type": "number"
  9133. }
  9134. },
  9135. "required": ["context", "output"]
  9136. },
  9137. "modalities": {
  9138. "type": "object",
  9139. "properties": {
  9140. "input": {
  9141. "type": "array",
  9142. "items": {
  9143. "type": "string",
  9144. "enum": ["text", "audio", "image", "video", "pdf"]
  9145. }
  9146. },
  9147. "output": {
  9148. "type": "array",
  9149. "items": {
  9150. "type": "string",
  9151. "enum": ["text", "audio", "image", "video", "pdf"]
  9152. }
  9153. }
  9154. },
  9155. "required": ["input", "output"]
  9156. },
  9157. "experimental": {
  9158. "type": "boolean"
  9159. },
  9160. "status": {
  9161. "type": "string",
  9162. "enum": ["alpha", "beta", "deprecated"]
  9163. },
  9164. "options": {
  9165. "type": "object",
  9166. "propertyNames": {
  9167. "type": "string"
  9168. },
  9169. "additionalProperties": {}
  9170. },
  9171. "headers": {
  9172. "type": "object",
  9173. "propertyNames": {
  9174. "type": "string"
  9175. },
  9176. "additionalProperties": {
  9177. "type": "string"
  9178. }
  9179. },
  9180. "provider": {
  9181. "type": "object",
  9182. "properties": {
  9183. "npm": {
  9184. "type": "string"
  9185. }
  9186. },
  9187. "required": ["npm"]
  9188. },
  9189. "variants": {
  9190. "description": "Variant-specific configuration",
  9191. "type": "object",
  9192. "propertyNames": {
  9193. "type": "string"
  9194. },
  9195. "additionalProperties": {
  9196. "type": "object",
  9197. "properties": {
  9198. "disabled": {
  9199. "description": "Disable this variant for the model",
  9200. "type": "boolean"
  9201. }
  9202. },
  9203. "additionalProperties": {}
  9204. }
  9205. }
  9206. }
  9207. }
  9208. },
  9209. "whitelist": {
  9210. "type": "array",
  9211. "items": {
  9212. "type": "string"
  9213. }
  9214. },
  9215. "blacklist": {
  9216. "type": "array",
  9217. "items": {
  9218. "type": "string"
  9219. }
  9220. },
  9221. "options": {
  9222. "type": "object",
  9223. "properties": {
  9224. "apiKey": {
  9225. "type": "string"
  9226. },
  9227. "baseURL": {
  9228. "type": "string"
  9229. },
  9230. "enterpriseUrl": {
  9231. "description": "GitHub Enterprise URL for copilot authentication",
  9232. "type": "string"
  9233. },
  9234. "setCacheKey": {
  9235. "description": "Enable promptCacheKey for this provider (default false)",
  9236. "type": "boolean"
  9237. },
  9238. "timeout": {
  9239. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  9240. "anyOf": [
  9241. {
  9242. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  9243. "type": "integer",
  9244. "exclusiveMinimum": 0,
  9245. "maximum": 9007199254740991
  9246. },
  9247. {
  9248. "description": "Disable timeout for this provider entirely.",
  9249. "type": "boolean",
  9250. "const": false
  9251. }
  9252. ]
  9253. }
  9254. },
  9255. "additionalProperties": {}
  9256. }
  9257. },
  9258. "additionalProperties": false
  9259. },
  9260. "McpLocalConfig": {
  9261. "type": "object",
  9262. "properties": {
  9263. "type": {
  9264. "description": "Type of MCP server connection",
  9265. "type": "string",
  9266. "const": "local"
  9267. },
  9268. "command": {
  9269. "description": "Command and arguments to run the MCP server",
  9270. "type": "array",
  9271. "items": {
  9272. "type": "string"
  9273. }
  9274. },
  9275. "environment": {
  9276. "description": "Environment variables to set when running the MCP server",
  9277. "type": "object",
  9278. "propertyNames": {
  9279. "type": "string"
  9280. },
  9281. "additionalProperties": {
  9282. "type": "string"
  9283. }
  9284. },
  9285. "enabled": {
  9286. "description": "Enable or disable the MCP server on startup",
  9287. "type": "boolean"
  9288. },
  9289. "timeout": {
  9290. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  9291. "type": "integer",
  9292. "exclusiveMinimum": 0,
  9293. "maximum": 9007199254740991
  9294. }
  9295. },
  9296. "required": ["type", "command"],
  9297. "additionalProperties": false
  9298. },
  9299. "McpOAuthConfig": {
  9300. "type": "object",
  9301. "properties": {
  9302. "clientId": {
  9303. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  9304. "type": "string"
  9305. },
  9306. "clientSecret": {
  9307. "description": "OAuth client secret (if required by the authorization server)",
  9308. "type": "string"
  9309. },
  9310. "scope": {
  9311. "description": "OAuth scopes to request during authorization",
  9312. "type": "string"
  9313. }
  9314. },
  9315. "additionalProperties": false
  9316. },
  9317. "McpRemoteConfig": {
  9318. "type": "object",
  9319. "properties": {
  9320. "type": {
  9321. "description": "Type of MCP server connection",
  9322. "type": "string",
  9323. "const": "remote"
  9324. },
  9325. "url": {
  9326. "description": "URL of the remote MCP server",
  9327. "type": "string"
  9328. },
  9329. "enabled": {
  9330. "description": "Enable or disable the MCP server on startup",
  9331. "type": "boolean"
  9332. },
  9333. "headers": {
  9334. "description": "Headers to send with the request",
  9335. "type": "object",
  9336. "propertyNames": {
  9337. "type": "string"
  9338. },
  9339. "additionalProperties": {
  9340. "type": "string"
  9341. }
  9342. },
  9343. "oauth": {
  9344. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  9345. "anyOf": [
  9346. {
  9347. "$ref": "#/components/schemas/McpOAuthConfig"
  9348. },
  9349. {
  9350. "type": "boolean",
  9351. "const": false
  9352. }
  9353. ]
  9354. },
  9355. "timeout": {
  9356. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  9357. "type": "integer",
  9358. "exclusiveMinimum": 0,
  9359. "maximum": 9007199254740991
  9360. }
  9361. },
  9362. "required": ["type", "url"],
  9363. "additionalProperties": false
  9364. },
  9365. "LayoutConfig": {
  9366. "description": "@deprecated Always uses stretch layout.",
  9367. "type": "string",
  9368. "enum": ["auto", "stretch"]
  9369. },
  9370. "Config": {
  9371. "type": "object",
  9372. "properties": {
  9373. "$schema": {
  9374. "description": "JSON schema reference for configuration validation",
  9375. "type": "string"
  9376. },
  9377. "theme": {
  9378. "description": "Theme name to use for the interface",
  9379. "type": "string"
  9380. },
  9381. "keybinds": {
  9382. "$ref": "#/components/schemas/KeybindsConfig"
  9383. },
  9384. "logLevel": {
  9385. "$ref": "#/components/schemas/LogLevel"
  9386. },
  9387. "tui": {
  9388. "description": "TUI specific settings",
  9389. "type": "object",
  9390. "properties": {
  9391. "scroll_speed": {
  9392. "description": "TUI scroll speed",
  9393. "type": "number",
  9394. "minimum": 0.001
  9395. },
  9396. "scroll_acceleration": {
  9397. "description": "Scroll acceleration settings",
  9398. "type": "object",
  9399. "properties": {
  9400. "enabled": {
  9401. "description": "Enable scroll acceleration",
  9402. "type": "boolean"
  9403. }
  9404. },
  9405. "required": ["enabled"]
  9406. },
  9407. "diff_style": {
  9408. "description": "Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column",
  9409. "type": "string",
  9410. "enum": ["auto", "stacked"]
  9411. }
  9412. }
  9413. },
  9414. "server": {
  9415. "$ref": "#/components/schemas/ServerConfig"
  9416. },
  9417. "command": {
  9418. "description": "Command configuration, see https://opencode.ai/docs/commands",
  9419. "type": "object",
  9420. "propertyNames": {
  9421. "type": "string"
  9422. },
  9423. "additionalProperties": {
  9424. "type": "object",
  9425. "properties": {
  9426. "template": {
  9427. "type": "string"
  9428. },
  9429. "description": {
  9430. "type": "string"
  9431. },
  9432. "agent": {
  9433. "type": "string"
  9434. },
  9435. "model": {
  9436. "type": "string"
  9437. },
  9438. "subtask": {
  9439. "type": "boolean"
  9440. }
  9441. },
  9442. "required": ["template"]
  9443. }
  9444. },
  9445. "watcher": {
  9446. "type": "object",
  9447. "properties": {
  9448. "ignore": {
  9449. "type": "array",
  9450. "items": {
  9451. "type": "string"
  9452. }
  9453. }
  9454. }
  9455. },
  9456. "plugin": {
  9457. "type": "array",
  9458. "items": {
  9459. "type": "string"
  9460. }
  9461. },
  9462. "snapshot": {
  9463. "type": "boolean"
  9464. },
  9465. "share": {
  9466. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  9467. "type": "string",
  9468. "enum": ["manual", "auto", "disabled"]
  9469. },
  9470. "autoshare": {
  9471. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  9472. "type": "boolean"
  9473. },
  9474. "autoupdate": {
  9475. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  9476. "anyOf": [
  9477. {
  9478. "type": "boolean"
  9479. },
  9480. {
  9481. "type": "string",
  9482. "const": "notify"
  9483. }
  9484. ]
  9485. },
  9486. "disabled_providers": {
  9487. "description": "Disable providers that are loaded automatically",
  9488. "type": "array",
  9489. "items": {
  9490. "type": "string"
  9491. }
  9492. },
  9493. "enabled_providers": {
  9494. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  9495. "type": "array",
  9496. "items": {
  9497. "type": "string"
  9498. }
  9499. },
  9500. "model": {
  9501. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  9502. "type": "string"
  9503. },
  9504. "small_model": {
  9505. "description": "Small model to use for tasks like title generation in the format of provider/model",
  9506. "type": "string"
  9507. },
  9508. "default_agent": {
  9509. "description": "Default agent to use when none is specified. Must be a primary agent. Falls back to 'build' if not set or if the specified agent is invalid.",
  9510. "type": "string"
  9511. },
  9512. "username": {
  9513. "description": "Custom username to display in conversations instead of system username",
  9514. "type": "string"
  9515. },
  9516. "mode": {
  9517. "description": "@deprecated Use `agent` field instead.",
  9518. "type": "object",
  9519. "properties": {
  9520. "build": {
  9521. "$ref": "#/components/schemas/AgentConfig"
  9522. },
  9523. "plan": {
  9524. "$ref": "#/components/schemas/AgentConfig"
  9525. }
  9526. },
  9527. "additionalProperties": {
  9528. "$ref": "#/components/schemas/AgentConfig"
  9529. }
  9530. },
  9531. "agent": {
  9532. "description": "Agent configuration, see https://opencode.ai/docs/agents",
  9533. "type": "object",
  9534. "properties": {
  9535. "plan": {
  9536. "$ref": "#/components/schemas/AgentConfig"
  9537. },
  9538. "build": {
  9539. "$ref": "#/components/schemas/AgentConfig"
  9540. },
  9541. "general": {
  9542. "$ref": "#/components/schemas/AgentConfig"
  9543. },
  9544. "explore": {
  9545. "$ref": "#/components/schemas/AgentConfig"
  9546. },
  9547. "title": {
  9548. "$ref": "#/components/schemas/AgentConfig"
  9549. },
  9550. "summary": {
  9551. "$ref": "#/components/schemas/AgentConfig"
  9552. },
  9553. "compaction": {
  9554. "$ref": "#/components/schemas/AgentConfig"
  9555. }
  9556. },
  9557. "additionalProperties": {
  9558. "$ref": "#/components/schemas/AgentConfig"
  9559. }
  9560. },
  9561. "provider": {
  9562. "description": "Custom provider configurations and model overrides",
  9563. "type": "object",
  9564. "propertyNames": {
  9565. "type": "string"
  9566. },
  9567. "additionalProperties": {
  9568. "$ref": "#/components/schemas/ProviderConfig"
  9569. }
  9570. },
  9571. "mcp": {
  9572. "description": "MCP (Model Context Protocol) server configurations",
  9573. "type": "object",
  9574. "propertyNames": {
  9575. "type": "string"
  9576. },
  9577. "additionalProperties": {
  9578. "anyOf": [
  9579. {
  9580. "anyOf": [
  9581. {
  9582. "$ref": "#/components/schemas/McpLocalConfig"
  9583. },
  9584. {
  9585. "$ref": "#/components/schemas/McpRemoteConfig"
  9586. }
  9587. ]
  9588. },
  9589. {
  9590. "type": "object",
  9591. "properties": {
  9592. "enabled": {
  9593. "type": "boolean"
  9594. }
  9595. },
  9596. "required": ["enabled"],
  9597. "additionalProperties": false
  9598. }
  9599. ]
  9600. }
  9601. },
  9602. "formatter": {
  9603. "anyOf": [
  9604. {
  9605. "type": "boolean",
  9606. "const": false
  9607. },
  9608. {
  9609. "type": "object",
  9610. "propertyNames": {
  9611. "type": "string"
  9612. },
  9613. "additionalProperties": {
  9614. "type": "object",
  9615. "properties": {
  9616. "disabled": {
  9617. "type": "boolean"
  9618. },
  9619. "command": {
  9620. "type": "array",
  9621. "items": {
  9622. "type": "string"
  9623. }
  9624. },
  9625. "environment": {
  9626. "type": "object",
  9627. "propertyNames": {
  9628. "type": "string"
  9629. },
  9630. "additionalProperties": {
  9631. "type": "string"
  9632. }
  9633. },
  9634. "extensions": {
  9635. "type": "array",
  9636. "items": {
  9637. "type": "string"
  9638. }
  9639. }
  9640. }
  9641. }
  9642. }
  9643. ]
  9644. },
  9645. "lsp": {
  9646. "anyOf": [
  9647. {
  9648. "type": "boolean",
  9649. "const": false
  9650. },
  9651. {
  9652. "type": "object",
  9653. "propertyNames": {
  9654. "type": "string"
  9655. },
  9656. "additionalProperties": {
  9657. "anyOf": [
  9658. {
  9659. "type": "object",
  9660. "properties": {
  9661. "disabled": {
  9662. "type": "boolean",
  9663. "const": true
  9664. }
  9665. },
  9666. "required": ["disabled"]
  9667. },
  9668. {
  9669. "type": "object",
  9670. "properties": {
  9671. "command": {
  9672. "type": "array",
  9673. "items": {
  9674. "type": "string"
  9675. }
  9676. },
  9677. "extensions": {
  9678. "type": "array",
  9679. "items": {
  9680. "type": "string"
  9681. }
  9682. },
  9683. "disabled": {
  9684. "type": "boolean"
  9685. },
  9686. "env": {
  9687. "type": "object",
  9688. "propertyNames": {
  9689. "type": "string"
  9690. },
  9691. "additionalProperties": {
  9692. "type": "string"
  9693. }
  9694. },
  9695. "initialization": {
  9696. "type": "object",
  9697. "propertyNames": {
  9698. "type": "string"
  9699. },
  9700. "additionalProperties": {}
  9701. }
  9702. },
  9703. "required": ["command"]
  9704. }
  9705. ]
  9706. }
  9707. }
  9708. ]
  9709. },
  9710. "instructions": {
  9711. "description": "Additional instruction files or patterns to include",
  9712. "type": "array",
  9713. "items": {
  9714. "type": "string"
  9715. }
  9716. },
  9717. "layout": {
  9718. "$ref": "#/components/schemas/LayoutConfig"
  9719. },
  9720. "permission": {
  9721. "$ref": "#/components/schemas/PermissionConfig"
  9722. },
  9723. "tools": {
  9724. "type": "object",
  9725. "propertyNames": {
  9726. "type": "string"
  9727. },
  9728. "additionalProperties": {
  9729. "type": "boolean"
  9730. }
  9731. },
  9732. "enterprise": {
  9733. "type": "object",
  9734. "properties": {
  9735. "url": {
  9736. "description": "Enterprise URL",
  9737. "type": "string"
  9738. }
  9739. }
  9740. },
  9741. "compaction": {
  9742. "type": "object",
  9743. "properties": {
  9744. "auto": {
  9745. "description": "Enable automatic compaction when context is full (default: true)",
  9746. "type": "boolean"
  9747. },
  9748. "prune": {
  9749. "description": "Enable pruning of old tool outputs (default: true)",
  9750. "type": "boolean"
  9751. }
  9752. }
  9753. },
  9754. "experimental": {
  9755. "type": "object",
  9756. "properties": {
  9757. "hook": {
  9758. "type": "object",
  9759. "properties": {
  9760. "file_edited": {
  9761. "type": "object",
  9762. "propertyNames": {
  9763. "type": "string"
  9764. },
  9765. "additionalProperties": {
  9766. "type": "array",
  9767. "items": {
  9768. "type": "object",
  9769. "properties": {
  9770. "command": {
  9771. "type": "array",
  9772. "items": {
  9773. "type": "string"
  9774. }
  9775. },
  9776. "environment": {
  9777. "type": "object",
  9778. "propertyNames": {
  9779. "type": "string"
  9780. },
  9781. "additionalProperties": {
  9782. "type": "string"
  9783. }
  9784. }
  9785. },
  9786. "required": ["command"]
  9787. }
  9788. }
  9789. },
  9790. "session_completed": {
  9791. "type": "array",
  9792. "items": {
  9793. "type": "object",
  9794. "properties": {
  9795. "command": {
  9796. "type": "array",
  9797. "items": {
  9798. "type": "string"
  9799. }
  9800. },
  9801. "environment": {
  9802. "type": "object",
  9803. "propertyNames": {
  9804. "type": "string"
  9805. },
  9806. "additionalProperties": {
  9807. "type": "string"
  9808. }
  9809. }
  9810. },
  9811. "required": ["command"]
  9812. }
  9813. }
  9814. }
  9815. },
  9816. "chatMaxRetries": {
  9817. "description": "Number of retries for chat completions on failure",
  9818. "type": "number"
  9819. },
  9820. "disable_paste_summary": {
  9821. "type": "boolean"
  9822. },
  9823. "batch_tool": {
  9824. "description": "Enable the batch tool",
  9825. "type": "boolean"
  9826. },
  9827. "openTelemetry": {
  9828. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  9829. "type": "boolean"
  9830. },
  9831. "primary_tools": {
  9832. "description": "Tools that should only be available to primary agents.",
  9833. "type": "array",
  9834. "items": {
  9835. "type": "string"
  9836. }
  9837. },
  9838. "continue_loop_on_deny": {
  9839. "description": "Continue the agent loop when a tool call is denied",
  9840. "type": "boolean"
  9841. },
  9842. "mcp_timeout": {
  9843. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  9844. "type": "integer",
  9845. "exclusiveMinimum": 0,
  9846. "maximum": 9007199254740991
  9847. }
  9848. }
  9849. }
  9850. },
  9851. "additionalProperties": false
  9852. },
  9853. "Model": {
  9854. "type": "object",
  9855. "properties": {
  9856. "id": {
  9857. "type": "string"
  9858. },
  9859. "providerID": {
  9860. "type": "string"
  9861. },
  9862. "api": {
  9863. "type": "object",
  9864. "properties": {
  9865. "id": {
  9866. "type": "string"
  9867. },
  9868. "url": {
  9869. "type": "string"
  9870. },
  9871. "npm": {
  9872. "type": "string"
  9873. }
  9874. },
  9875. "required": ["id", "url", "npm"]
  9876. },
  9877. "name": {
  9878. "type": "string"
  9879. },
  9880. "family": {
  9881. "type": "string"
  9882. },
  9883. "capabilities": {
  9884. "type": "object",
  9885. "properties": {
  9886. "temperature": {
  9887. "type": "boolean"
  9888. },
  9889. "reasoning": {
  9890. "type": "boolean"
  9891. },
  9892. "attachment": {
  9893. "type": "boolean"
  9894. },
  9895. "toolcall": {
  9896. "type": "boolean"
  9897. },
  9898. "input": {
  9899. "type": "object",
  9900. "properties": {
  9901. "text": {
  9902. "type": "boolean"
  9903. },
  9904. "audio": {
  9905. "type": "boolean"
  9906. },
  9907. "image": {
  9908. "type": "boolean"
  9909. },
  9910. "video": {
  9911. "type": "boolean"
  9912. },
  9913. "pdf": {
  9914. "type": "boolean"
  9915. }
  9916. },
  9917. "required": ["text", "audio", "image", "video", "pdf"]
  9918. },
  9919. "output": {
  9920. "type": "object",
  9921. "properties": {
  9922. "text": {
  9923. "type": "boolean"
  9924. },
  9925. "audio": {
  9926. "type": "boolean"
  9927. },
  9928. "image": {
  9929. "type": "boolean"
  9930. },
  9931. "video": {
  9932. "type": "boolean"
  9933. },
  9934. "pdf": {
  9935. "type": "boolean"
  9936. }
  9937. },
  9938. "required": ["text", "audio", "image", "video", "pdf"]
  9939. },
  9940. "interleaved": {
  9941. "anyOf": [
  9942. {
  9943. "type": "boolean"
  9944. },
  9945. {
  9946. "type": "object",
  9947. "properties": {
  9948. "field": {
  9949. "type": "string",
  9950. "enum": ["reasoning_content", "reasoning_details"]
  9951. }
  9952. },
  9953. "required": ["field"]
  9954. }
  9955. ]
  9956. }
  9957. },
  9958. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  9959. },
  9960. "cost": {
  9961. "type": "object",
  9962. "properties": {
  9963. "input": {
  9964. "type": "number"
  9965. },
  9966. "output": {
  9967. "type": "number"
  9968. },
  9969. "cache": {
  9970. "type": "object",
  9971. "properties": {
  9972. "read": {
  9973. "type": "number"
  9974. },
  9975. "write": {
  9976. "type": "number"
  9977. }
  9978. },
  9979. "required": ["read", "write"]
  9980. },
  9981. "experimentalOver200K": {
  9982. "type": "object",
  9983. "properties": {
  9984. "input": {
  9985. "type": "number"
  9986. },
  9987. "output": {
  9988. "type": "number"
  9989. },
  9990. "cache": {
  9991. "type": "object",
  9992. "properties": {
  9993. "read": {
  9994. "type": "number"
  9995. },
  9996. "write": {
  9997. "type": "number"
  9998. }
  9999. },
  10000. "required": ["read", "write"]
  10001. }
  10002. },
  10003. "required": ["input", "output", "cache"]
  10004. }
  10005. },
  10006. "required": ["input", "output", "cache"]
  10007. },
  10008. "limit": {
  10009. "type": "object",
  10010. "properties": {
  10011. "context": {
  10012. "type": "number"
  10013. },
  10014. "input": {
  10015. "type": "number"
  10016. },
  10017. "output": {
  10018. "type": "number"
  10019. }
  10020. },
  10021. "required": ["context", "output"]
  10022. },
  10023. "status": {
  10024. "type": "string",
  10025. "enum": ["alpha", "beta", "deprecated", "active"]
  10026. },
  10027. "options": {
  10028. "type": "object",
  10029. "propertyNames": {
  10030. "type": "string"
  10031. },
  10032. "additionalProperties": {}
  10033. },
  10034. "headers": {
  10035. "type": "object",
  10036. "propertyNames": {
  10037. "type": "string"
  10038. },
  10039. "additionalProperties": {
  10040. "type": "string"
  10041. }
  10042. },
  10043. "release_date": {
  10044. "type": "string"
  10045. },
  10046. "variants": {
  10047. "type": "object",
  10048. "propertyNames": {
  10049. "type": "string"
  10050. },
  10051. "additionalProperties": {
  10052. "type": "object",
  10053. "propertyNames": {
  10054. "type": "string"
  10055. },
  10056. "additionalProperties": {}
  10057. }
  10058. }
  10059. },
  10060. "required": [
  10061. "id",
  10062. "providerID",
  10063. "api",
  10064. "name",
  10065. "capabilities",
  10066. "cost",
  10067. "limit",
  10068. "status",
  10069. "options",
  10070. "headers",
  10071. "release_date"
  10072. ]
  10073. },
  10074. "Provider": {
  10075. "type": "object",
  10076. "properties": {
  10077. "id": {
  10078. "type": "string"
  10079. },
  10080. "name": {
  10081. "type": "string"
  10082. },
  10083. "source": {
  10084. "type": "string",
  10085. "enum": ["env", "config", "custom", "api"]
  10086. },
  10087. "env": {
  10088. "type": "array",
  10089. "items": {
  10090. "type": "string"
  10091. }
  10092. },
  10093. "key": {
  10094. "type": "string"
  10095. },
  10096. "options": {
  10097. "type": "object",
  10098. "propertyNames": {
  10099. "type": "string"
  10100. },
  10101. "additionalProperties": {}
  10102. },
  10103. "models": {
  10104. "type": "object",
  10105. "propertyNames": {
  10106. "type": "string"
  10107. },
  10108. "additionalProperties": {
  10109. "$ref": "#/components/schemas/Model"
  10110. }
  10111. }
  10112. },
  10113. "required": ["id", "name", "source", "env", "options", "models"]
  10114. },
  10115. "ToolIDs": {
  10116. "type": "array",
  10117. "items": {
  10118. "type": "string"
  10119. }
  10120. },
  10121. "ToolListItem": {
  10122. "type": "object",
  10123. "properties": {
  10124. "id": {
  10125. "type": "string"
  10126. },
  10127. "description": {
  10128. "type": "string"
  10129. },
  10130. "parameters": {}
  10131. },
  10132. "required": ["id", "description", "parameters"]
  10133. },
  10134. "ToolList": {
  10135. "type": "array",
  10136. "items": {
  10137. "$ref": "#/components/schemas/ToolListItem"
  10138. }
  10139. },
  10140. "Worktree": {
  10141. "type": "object",
  10142. "properties": {
  10143. "name": {
  10144. "type": "string"
  10145. },
  10146. "branch": {
  10147. "type": "string"
  10148. },
  10149. "directory": {
  10150. "type": "string"
  10151. }
  10152. },
  10153. "required": ["name", "branch", "directory"]
  10154. },
  10155. "WorktreeCreateInput": {
  10156. "type": "object",
  10157. "properties": {
  10158. "name": {
  10159. "type": "string"
  10160. },
  10161. "startCommand": {
  10162. "description": "Additional startup script to run after the project's start command",
  10163. "type": "string"
  10164. }
  10165. }
  10166. },
  10167. "WorktreeRemoveInput": {
  10168. "type": "object",
  10169. "properties": {
  10170. "directory": {
  10171. "type": "string"
  10172. }
  10173. },
  10174. "required": ["directory"]
  10175. },
  10176. "WorktreeResetInput": {
  10177. "type": "object",
  10178. "properties": {
  10179. "directory": {
  10180. "type": "string"
  10181. }
  10182. },
  10183. "required": ["directory"]
  10184. },
  10185. "McpResource": {
  10186. "type": "object",
  10187. "properties": {
  10188. "name": {
  10189. "type": "string"
  10190. },
  10191. "uri": {
  10192. "type": "string"
  10193. },
  10194. "description": {
  10195. "type": "string"
  10196. },
  10197. "mimeType": {
  10198. "type": "string"
  10199. },
  10200. "client": {
  10201. "type": "string"
  10202. }
  10203. },
  10204. "required": ["name", "uri", "client"]
  10205. },
  10206. "TextPartInput": {
  10207. "type": "object",
  10208. "properties": {
  10209. "id": {
  10210. "type": "string"
  10211. },
  10212. "type": {
  10213. "type": "string",
  10214. "const": "text"
  10215. },
  10216. "text": {
  10217. "type": "string"
  10218. },
  10219. "synthetic": {
  10220. "type": "boolean"
  10221. },
  10222. "ignored": {
  10223. "type": "boolean"
  10224. },
  10225. "time": {
  10226. "type": "object",
  10227. "properties": {
  10228. "start": {
  10229. "type": "number"
  10230. },
  10231. "end": {
  10232. "type": "number"
  10233. }
  10234. },
  10235. "required": ["start"]
  10236. },
  10237. "metadata": {
  10238. "type": "object",
  10239. "propertyNames": {
  10240. "type": "string"
  10241. },
  10242. "additionalProperties": {}
  10243. }
  10244. },
  10245. "required": ["type", "text"]
  10246. },
  10247. "FilePartInput": {
  10248. "type": "object",
  10249. "properties": {
  10250. "id": {
  10251. "type": "string"
  10252. },
  10253. "type": {
  10254. "type": "string",
  10255. "const": "file"
  10256. },
  10257. "mime": {
  10258. "type": "string"
  10259. },
  10260. "filename": {
  10261. "type": "string"
  10262. },
  10263. "url": {
  10264. "type": "string"
  10265. },
  10266. "source": {
  10267. "$ref": "#/components/schemas/FilePartSource"
  10268. }
  10269. },
  10270. "required": ["type", "mime", "url"]
  10271. },
  10272. "AgentPartInput": {
  10273. "type": "object",
  10274. "properties": {
  10275. "id": {
  10276. "type": "string"
  10277. },
  10278. "type": {
  10279. "type": "string",
  10280. "const": "agent"
  10281. },
  10282. "name": {
  10283. "type": "string"
  10284. },
  10285. "source": {
  10286. "type": "object",
  10287. "properties": {
  10288. "value": {
  10289. "type": "string"
  10290. },
  10291. "start": {
  10292. "type": "integer",
  10293. "minimum": -9007199254740991,
  10294. "maximum": 9007199254740991
  10295. },
  10296. "end": {
  10297. "type": "integer",
  10298. "minimum": -9007199254740991,
  10299. "maximum": 9007199254740991
  10300. }
  10301. },
  10302. "required": ["value", "start", "end"]
  10303. }
  10304. },
  10305. "required": ["type", "name"]
  10306. },
  10307. "SubtaskPartInput": {
  10308. "type": "object",
  10309. "properties": {
  10310. "id": {
  10311. "type": "string"
  10312. },
  10313. "type": {
  10314. "type": "string",
  10315. "const": "subtask"
  10316. },
  10317. "prompt": {
  10318. "type": "string"
  10319. },
  10320. "description": {
  10321. "type": "string"
  10322. },
  10323. "agent": {
  10324. "type": "string"
  10325. },
  10326. "model": {
  10327. "type": "object",
  10328. "properties": {
  10329. "providerID": {
  10330. "type": "string"
  10331. },
  10332. "modelID": {
  10333. "type": "string"
  10334. }
  10335. },
  10336. "required": ["providerID", "modelID"]
  10337. },
  10338. "command": {
  10339. "type": "string"
  10340. }
  10341. },
  10342. "required": ["type", "prompt", "description", "agent"]
  10343. },
  10344. "ProviderAuthMethod": {
  10345. "type": "object",
  10346. "properties": {
  10347. "type": {
  10348. "anyOf": [
  10349. {
  10350. "type": "string",
  10351. "const": "oauth"
  10352. },
  10353. {
  10354. "type": "string",
  10355. "const": "api"
  10356. }
  10357. ]
  10358. },
  10359. "label": {
  10360. "type": "string"
  10361. }
  10362. },
  10363. "required": ["type", "label"]
  10364. },
  10365. "ProviderAuthAuthorization": {
  10366. "type": "object",
  10367. "properties": {
  10368. "url": {
  10369. "type": "string"
  10370. },
  10371. "method": {
  10372. "anyOf": [
  10373. {
  10374. "type": "string",
  10375. "const": "auto"
  10376. },
  10377. {
  10378. "type": "string",
  10379. "const": "code"
  10380. }
  10381. ]
  10382. },
  10383. "instructions": {
  10384. "type": "string"
  10385. }
  10386. },
  10387. "required": ["url", "method", "instructions"]
  10388. },
  10389. "Symbol": {
  10390. "type": "object",
  10391. "properties": {
  10392. "name": {
  10393. "type": "string"
  10394. },
  10395. "kind": {
  10396. "type": "number"
  10397. },
  10398. "location": {
  10399. "type": "object",
  10400. "properties": {
  10401. "uri": {
  10402. "type": "string"
  10403. },
  10404. "range": {
  10405. "$ref": "#/components/schemas/Range"
  10406. }
  10407. },
  10408. "required": ["uri", "range"]
  10409. }
  10410. },
  10411. "required": ["name", "kind", "location"]
  10412. },
  10413. "FileNode": {
  10414. "type": "object",
  10415. "properties": {
  10416. "name": {
  10417. "type": "string"
  10418. },
  10419. "path": {
  10420. "type": "string"
  10421. },
  10422. "absolute": {
  10423. "type": "string"
  10424. },
  10425. "type": {
  10426. "type": "string",
  10427. "enum": ["file", "directory"]
  10428. },
  10429. "ignored": {
  10430. "type": "boolean"
  10431. }
  10432. },
  10433. "required": ["name", "path", "absolute", "type", "ignored"]
  10434. },
  10435. "FileContent": {
  10436. "type": "object",
  10437. "properties": {
  10438. "type": {
  10439. "type": "string",
  10440. "const": "text"
  10441. },
  10442. "content": {
  10443. "type": "string"
  10444. },
  10445. "diff": {
  10446. "type": "string"
  10447. },
  10448. "patch": {
  10449. "type": "object",
  10450. "properties": {
  10451. "oldFileName": {
  10452. "type": "string"
  10453. },
  10454. "newFileName": {
  10455. "type": "string"
  10456. },
  10457. "oldHeader": {
  10458. "type": "string"
  10459. },
  10460. "newHeader": {
  10461. "type": "string"
  10462. },
  10463. "hunks": {
  10464. "type": "array",
  10465. "items": {
  10466. "type": "object",
  10467. "properties": {
  10468. "oldStart": {
  10469. "type": "number"
  10470. },
  10471. "oldLines": {
  10472. "type": "number"
  10473. },
  10474. "newStart": {
  10475. "type": "number"
  10476. },
  10477. "newLines": {
  10478. "type": "number"
  10479. },
  10480. "lines": {
  10481. "type": "array",
  10482. "items": {
  10483. "type": "string"
  10484. }
  10485. }
  10486. },
  10487. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  10488. }
  10489. },
  10490. "index": {
  10491. "type": "string"
  10492. }
  10493. },
  10494. "required": ["oldFileName", "newFileName", "hunks"]
  10495. },
  10496. "encoding": {
  10497. "type": "string",
  10498. "const": "base64"
  10499. },
  10500. "mimeType": {
  10501. "type": "string"
  10502. }
  10503. },
  10504. "required": ["type", "content"]
  10505. },
  10506. "File": {
  10507. "type": "object",
  10508. "properties": {
  10509. "path": {
  10510. "type": "string"
  10511. },
  10512. "added": {
  10513. "type": "integer",
  10514. "minimum": -9007199254740991,
  10515. "maximum": 9007199254740991
  10516. },
  10517. "removed": {
  10518. "type": "integer",
  10519. "minimum": -9007199254740991,
  10520. "maximum": 9007199254740991
  10521. },
  10522. "status": {
  10523. "type": "string",
  10524. "enum": ["added", "deleted", "modified"]
  10525. }
  10526. },
  10527. "required": ["path", "added", "removed", "status"]
  10528. },
  10529. "MCPStatusConnected": {
  10530. "type": "object",
  10531. "properties": {
  10532. "status": {
  10533. "type": "string",
  10534. "const": "connected"
  10535. }
  10536. },
  10537. "required": ["status"]
  10538. },
  10539. "MCPStatusDisabled": {
  10540. "type": "object",
  10541. "properties": {
  10542. "status": {
  10543. "type": "string",
  10544. "const": "disabled"
  10545. }
  10546. },
  10547. "required": ["status"]
  10548. },
  10549. "MCPStatusFailed": {
  10550. "type": "object",
  10551. "properties": {
  10552. "status": {
  10553. "type": "string",
  10554. "const": "failed"
  10555. },
  10556. "error": {
  10557. "type": "string"
  10558. }
  10559. },
  10560. "required": ["status", "error"]
  10561. },
  10562. "MCPStatusNeedsAuth": {
  10563. "type": "object",
  10564. "properties": {
  10565. "status": {
  10566. "type": "string",
  10567. "const": "needs_auth"
  10568. }
  10569. },
  10570. "required": ["status"]
  10571. },
  10572. "MCPStatusNeedsClientRegistration": {
  10573. "type": "object",
  10574. "properties": {
  10575. "status": {
  10576. "type": "string",
  10577. "const": "needs_client_registration"
  10578. },
  10579. "error": {
  10580. "type": "string"
  10581. }
  10582. },
  10583. "required": ["status", "error"]
  10584. },
  10585. "MCPStatus": {
  10586. "anyOf": [
  10587. {
  10588. "$ref": "#/components/schemas/MCPStatusConnected"
  10589. },
  10590. {
  10591. "$ref": "#/components/schemas/MCPStatusDisabled"
  10592. },
  10593. {
  10594. "$ref": "#/components/schemas/MCPStatusFailed"
  10595. },
  10596. {
  10597. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  10598. },
  10599. {
  10600. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  10601. }
  10602. ]
  10603. },
  10604. "Path": {
  10605. "type": "object",
  10606. "properties": {
  10607. "home": {
  10608. "type": "string"
  10609. },
  10610. "state": {
  10611. "type": "string"
  10612. },
  10613. "config": {
  10614. "type": "string"
  10615. },
  10616. "worktree": {
  10617. "type": "string"
  10618. },
  10619. "directory": {
  10620. "type": "string"
  10621. }
  10622. },
  10623. "required": ["home", "state", "config", "worktree", "directory"]
  10624. },
  10625. "VcsInfo": {
  10626. "type": "object",
  10627. "properties": {
  10628. "branch": {
  10629. "type": "string"
  10630. }
  10631. },
  10632. "required": ["branch"]
  10633. },
  10634. "Command": {
  10635. "type": "object",
  10636. "properties": {
  10637. "name": {
  10638. "type": "string"
  10639. },
  10640. "description": {
  10641. "type": "string"
  10642. },
  10643. "agent": {
  10644. "type": "string"
  10645. },
  10646. "model": {
  10647. "type": "string"
  10648. },
  10649. "mcp": {
  10650. "type": "boolean"
  10651. },
  10652. "template": {
  10653. "anyOf": [
  10654. {
  10655. "type": "string"
  10656. },
  10657. {
  10658. "type": "string"
  10659. }
  10660. ]
  10661. },
  10662. "subtask": {
  10663. "type": "boolean"
  10664. },
  10665. "hints": {
  10666. "type": "array",
  10667. "items": {
  10668. "type": "string"
  10669. }
  10670. }
  10671. },
  10672. "required": ["name", "template", "hints"]
  10673. },
  10674. "Agent": {
  10675. "type": "object",
  10676. "properties": {
  10677. "name": {
  10678. "type": "string"
  10679. },
  10680. "description": {
  10681. "type": "string"
  10682. },
  10683. "mode": {
  10684. "type": "string",
  10685. "enum": ["subagent", "primary", "all"]
  10686. },
  10687. "native": {
  10688. "type": "boolean"
  10689. },
  10690. "hidden": {
  10691. "type": "boolean"
  10692. },
  10693. "topP": {
  10694. "type": "number"
  10695. },
  10696. "temperature": {
  10697. "type": "number"
  10698. },
  10699. "color": {
  10700. "type": "string"
  10701. },
  10702. "permission": {
  10703. "$ref": "#/components/schemas/PermissionRuleset"
  10704. },
  10705. "model": {
  10706. "type": "object",
  10707. "properties": {
  10708. "modelID": {
  10709. "type": "string"
  10710. },
  10711. "providerID": {
  10712. "type": "string"
  10713. }
  10714. },
  10715. "required": ["modelID", "providerID"]
  10716. },
  10717. "prompt": {
  10718. "type": "string"
  10719. },
  10720. "options": {
  10721. "type": "object",
  10722. "propertyNames": {
  10723. "type": "string"
  10724. },
  10725. "additionalProperties": {}
  10726. },
  10727. "steps": {
  10728. "type": "integer",
  10729. "exclusiveMinimum": 0,
  10730. "maximum": 9007199254740991
  10731. }
  10732. },
  10733. "required": ["name", "mode", "permission", "options"]
  10734. },
  10735. "LSPStatus": {
  10736. "type": "object",
  10737. "properties": {
  10738. "id": {
  10739. "type": "string"
  10740. },
  10741. "name": {
  10742. "type": "string"
  10743. },
  10744. "root": {
  10745. "type": "string"
  10746. },
  10747. "status": {
  10748. "anyOf": [
  10749. {
  10750. "type": "string",
  10751. "const": "connected"
  10752. },
  10753. {
  10754. "type": "string",
  10755. "const": "error"
  10756. }
  10757. ]
  10758. }
  10759. },
  10760. "required": ["id", "name", "root", "status"]
  10761. },
  10762. "FormatterStatus": {
  10763. "type": "object",
  10764. "properties": {
  10765. "name": {
  10766. "type": "string"
  10767. },
  10768. "extensions": {
  10769. "type": "array",
  10770. "items": {
  10771. "type": "string"
  10772. }
  10773. },
  10774. "enabled": {
  10775. "type": "boolean"
  10776. }
  10777. },
  10778. "required": ["name", "extensions", "enabled"]
  10779. },
  10780. "OAuth": {
  10781. "type": "object",
  10782. "properties": {
  10783. "type": {
  10784. "type": "string",
  10785. "const": "oauth"
  10786. },
  10787. "refresh": {
  10788. "type": "string"
  10789. },
  10790. "access": {
  10791. "type": "string"
  10792. },
  10793. "expires": {
  10794. "type": "number"
  10795. },
  10796. "accountId": {
  10797. "type": "string"
  10798. },
  10799. "enterpriseUrl": {
  10800. "type": "string"
  10801. }
  10802. },
  10803. "required": ["type", "refresh", "access", "expires"]
  10804. },
  10805. "ApiAuth": {
  10806. "type": "object",
  10807. "properties": {
  10808. "type": {
  10809. "type": "string",
  10810. "const": "api"
  10811. },
  10812. "key": {
  10813. "type": "string"
  10814. }
  10815. },
  10816. "required": ["type", "key"]
  10817. },
  10818. "WellKnownAuth": {
  10819. "type": "object",
  10820. "properties": {
  10821. "type": {
  10822. "type": "string",
  10823. "const": "wellknown"
  10824. },
  10825. "key": {
  10826. "type": "string"
  10827. },
  10828. "token": {
  10829. "type": "string"
  10830. }
  10831. },
  10832. "required": ["type", "key", "token"]
  10833. },
  10834. "Auth": {
  10835. "anyOf": [
  10836. {
  10837. "$ref": "#/components/schemas/OAuth"
  10838. },
  10839. {
  10840. "$ref": "#/components/schemas/ApiAuth"
  10841. },
  10842. {
  10843. "$ref": "#/components/schemas/WellKnownAuth"
  10844. }
  10845. ]
  10846. }
  10847. }
  10848. }
  10849. }