openapi.json 293 KB

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