openapi.json 253 KB

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