openapi.json 246 KB

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