openapi.json 298 KB

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