openapi.json 243 KB

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