openapi.json 292 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555
  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. "output": {
  3576. "type": "number"
  3577. }
  3578. },
  3579. "required": ["context", "output"]
  3580. },
  3581. "modalities": {
  3582. "type": "object",
  3583. "properties": {
  3584. "input": {
  3585. "type": "array",
  3586. "items": {
  3587. "type": "string",
  3588. "enum": ["text", "audio", "image", "video", "pdf"]
  3589. }
  3590. },
  3591. "output": {
  3592. "type": "array",
  3593. "items": {
  3594. "type": "string",
  3595. "enum": ["text", "audio", "image", "video", "pdf"]
  3596. }
  3597. }
  3598. },
  3599. "required": ["input", "output"]
  3600. },
  3601. "experimental": {
  3602. "type": "boolean"
  3603. },
  3604. "status": {
  3605. "type": "string",
  3606. "enum": ["alpha", "beta", "deprecated"]
  3607. },
  3608. "options": {
  3609. "type": "object",
  3610. "propertyNames": {
  3611. "type": "string"
  3612. },
  3613. "additionalProperties": {}
  3614. },
  3615. "headers": {
  3616. "type": "object",
  3617. "propertyNames": {
  3618. "type": "string"
  3619. },
  3620. "additionalProperties": {
  3621. "type": "string"
  3622. }
  3623. },
  3624. "provider": {
  3625. "type": "object",
  3626. "properties": {
  3627. "npm": {
  3628. "type": "string"
  3629. }
  3630. },
  3631. "required": ["npm"]
  3632. },
  3633. "variants": {
  3634. "type": "object",
  3635. "propertyNames": {
  3636. "type": "string"
  3637. },
  3638. "additionalProperties": {
  3639. "type": "object",
  3640. "propertyNames": {
  3641. "type": "string"
  3642. },
  3643. "additionalProperties": {}
  3644. }
  3645. }
  3646. },
  3647. "required": [
  3648. "id",
  3649. "name",
  3650. "release_date",
  3651. "attachment",
  3652. "reasoning",
  3653. "temperature",
  3654. "tool_call",
  3655. "limit",
  3656. "options"
  3657. ]
  3658. }
  3659. }
  3660. },
  3661. "required": ["name", "env", "id", "models"]
  3662. }
  3663. },
  3664. "default": {
  3665. "type": "object",
  3666. "propertyNames": {
  3667. "type": "string"
  3668. },
  3669. "additionalProperties": {
  3670. "type": "string"
  3671. }
  3672. },
  3673. "connected": {
  3674. "type": "array",
  3675. "items": {
  3676. "type": "string"
  3677. }
  3678. }
  3679. },
  3680. "required": ["all", "default", "connected"]
  3681. }
  3682. }
  3683. }
  3684. }
  3685. },
  3686. "x-codeSamples": [
  3687. {
  3688. "lang": "js",
  3689. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  3690. }
  3691. ]
  3692. }
  3693. },
  3694. "/provider/auth": {
  3695. "get": {
  3696. "operationId": "provider.auth",
  3697. "parameters": [
  3698. {
  3699. "in": "query",
  3700. "name": "directory",
  3701. "schema": {
  3702. "type": "string"
  3703. }
  3704. }
  3705. ],
  3706. "summary": "Get provider auth methods",
  3707. "description": "Retrieve available authentication methods for all AI providers.",
  3708. "responses": {
  3709. "200": {
  3710. "description": "Provider auth methods",
  3711. "content": {
  3712. "application/json": {
  3713. "schema": {
  3714. "type": "object",
  3715. "propertyNames": {
  3716. "type": "string"
  3717. },
  3718. "additionalProperties": {
  3719. "type": "array",
  3720. "items": {
  3721. "$ref": "#/components/schemas/ProviderAuthMethod"
  3722. }
  3723. }
  3724. }
  3725. }
  3726. }
  3727. }
  3728. },
  3729. "x-codeSamples": [
  3730. {
  3731. "lang": "js",
  3732. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  3733. }
  3734. ]
  3735. }
  3736. },
  3737. "/provider/{providerID}/oauth/authorize": {
  3738. "post": {
  3739. "operationId": "provider.oauth.authorize",
  3740. "parameters": [
  3741. {
  3742. "in": "query",
  3743. "name": "directory",
  3744. "schema": {
  3745. "type": "string"
  3746. }
  3747. },
  3748. {
  3749. "in": "path",
  3750. "name": "providerID",
  3751. "schema": {
  3752. "type": "string"
  3753. },
  3754. "required": true,
  3755. "description": "Provider ID"
  3756. }
  3757. ],
  3758. "summary": "OAuth authorize",
  3759. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  3760. "responses": {
  3761. "200": {
  3762. "description": "Authorization URL and method",
  3763. "content": {
  3764. "application/json": {
  3765. "schema": {
  3766. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  3767. }
  3768. }
  3769. }
  3770. },
  3771. "400": {
  3772. "description": "Bad request",
  3773. "content": {
  3774. "application/json": {
  3775. "schema": {
  3776. "$ref": "#/components/schemas/BadRequestError"
  3777. }
  3778. }
  3779. }
  3780. }
  3781. },
  3782. "requestBody": {
  3783. "content": {
  3784. "application/json": {
  3785. "schema": {
  3786. "type": "object",
  3787. "properties": {
  3788. "method": {
  3789. "description": "Auth method index",
  3790. "type": "number"
  3791. }
  3792. },
  3793. "required": ["method"]
  3794. }
  3795. }
  3796. }
  3797. },
  3798. "x-codeSamples": [
  3799. {
  3800. "lang": "js",
  3801. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  3802. }
  3803. ]
  3804. }
  3805. },
  3806. "/provider/{providerID}/oauth/callback": {
  3807. "post": {
  3808. "operationId": "provider.oauth.callback",
  3809. "parameters": [
  3810. {
  3811. "in": "query",
  3812. "name": "directory",
  3813. "schema": {
  3814. "type": "string"
  3815. }
  3816. },
  3817. {
  3818. "in": "path",
  3819. "name": "providerID",
  3820. "schema": {
  3821. "type": "string"
  3822. },
  3823. "required": true,
  3824. "description": "Provider ID"
  3825. }
  3826. ],
  3827. "summary": "OAuth callback",
  3828. "description": "Handle the OAuth callback from a provider after user authorization.",
  3829. "responses": {
  3830. "200": {
  3831. "description": "OAuth callback processed successfully",
  3832. "content": {
  3833. "application/json": {
  3834. "schema": {
  3835. "type": "boolean"
  3836. }
  3837. }
  3838. }
  3839. },
  3840. "400": {
  3841. "description": "Bad request",
  3842. "content": {
  3843. "application/json": {
  3844. "schema": {
  3845. "$ref": "#/components/schemas/BadRequestError"
  3846. }
  3847. }
  3848. }
  3849. }
  3850. },
  3851. "requestBody": {
  3852. "content": {
  3853. "application/json": {
  3854. "schema": {
  3855. "type": "object",
  3856. "properties": {
  3857. "method": {
  3858. "description": "Auth method index",
  3859. "type": "number"
  3860. },
  3861. "code": {
  3862. "description": "OAuth authorization code",
  3863. "type": "string"
  3864. }
  3865. },
  3866. "required": ["method"]
  3867. }
  3868. }
  3869. }
  3870. },
  3871. "x-codeSamples": [
  3872. {
  3873. "lang": "js",
  3874. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  3875. }
  3876. ]
  3877. }
  3878. },
  3879. "/find": {
  3880. "get": {
  3881. "operationId": "find.text",
  3882. "parameters": [
  3883. {
  3884. "in": "query",
  3885. "name": "directory",
  3886. "schema": {
  3887. "type": "string"
  3888. }
  3889. },
  3890. {
  3891. "in": "query",
  3892. "name": "pattern",
  3893. "schema": {
  3894. "type": "string"
  3895. },
  3896. "required": true
  3897. }
  3898. ],
  3899. "summary": "Find text",
  3900. "description": "Search for text patterns across files in the project using ripgrep.",
  3901. "responses": {
  3902. "200": {
  3903. "description": "Matches",
  3904. "content": {
  3905. "application/json": {
  3906. "schema": {
  3907. "type": "array",
  3908. "items": {
  3909. "type": "object",
  3910. "properties": {
  3911. "path": {
  3912. "type": "object",
  3913. "properties": {
  3914. "text": {
  3915. "type": "string"
  3916. }
  3917. },
  3918. "required": ["text"]
  3919. },
  3920. "lines": {
  3921. "type": "object",
  3922. "properties": {
  3923. "text": {
  3924. "type": "string"
  3925. }
  3926. },
  3927. "required": ["text"]
  3928. },
  3929. "line_number": {
  3930. "type": "number"
  3931. },
  3932. "absolute_offset": {
  3933. "type": "number"
  3934. },
  3935. "submatches": {
  3936. "type": "array",
  3937. "items": {
  3938. "type": "object",
  3939. "properties": {
  3940. "match": {
  3941. "type": "object",
  3942. "properties": {
  3943. "text": {
  3944. "type": "string"
  3945. }
  3946. },
  3947. "required": ["text"]
  3948. },
  3949. "start": {
  3950. "type": "number"
  3951. },
  3952. "end": {
  3953. "type": "number"
  3954. }
  3955. },
  3956. "required": ["match", "start", "end"]
  3957. }
  3958. }
  3959. },
  3960. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  3961. }
  3962. }
  3963. }
  3964. }
  3965. }
  3966. },
  3967. "x-codeSamples": [
  3968. {
  3969. "lang": "js",
  3970. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  3971. }
  3972. ]
  3973. }
  3974. },
  3975. "/find/file": {
  3976. "get": {
  3977. "operationId": "find.files",
  3978. "parameters": [
  3979. {
  3980. "in": "query",
  3981. "name": "directory",
  3982. "schema": {
  3983. "type": "string"
  3984. }
  3985. },
  3986. {
  3987. "in": "query",
  3988. "name": "query",
  3989. "schema": {
  3990. "type": "string"
  3991. },
  3992. "required": true
  3993. },
  3994. {
  3995. "in": "query",
  3996. "name": "dirs",
  3997. "schema": {
  3998. "type": "string",
  3999. "enum": ["true", "false"]
  4000. }
  4001. },
  4002. {
  4003. "in": "query",
  4004. "name": "type",
  4005. "schema": {
  4006. "type": "string",
  4007. "enum": ["file", "directory"]
  4008. }
  4009. },
  4010. {
  4011. "in": "query",
  4012. "name": "limit",
  4013. "schema": {
  4014. "type": "integer",
  4015. "minimum": 1,
  4016. "maximum": 200
  4017. }
  4018. }
  4019. ],
  4020. "summary": "Find files",
  4021. "description": "Search for files or directories by name or pattern in the project directory.",
  4022. "responses": {
  4023. "200": {
  4024. "description": "File paths",
  4025. "content": {
  4026. "application/json": {
  4027. "schema": {
  4028. "type": "array",
  4029. "items": {
  4030. "type": "string"
  4031. }
  4032. }
  4033. }
  4034. }
  4035. }
  4036. },
  4037. "x-codeSamples": [
  4038. {
  4039. "lang": "js",
  4040. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  4041. }
  4042. ]
  4043. }
  4044. },
  4045. "/find/symbol": {
  4046. "get": {
  4047. "operationId": "find.symbols",
  4048. "parameters": [
  4049. {
  4050. "in": "query",
  4051. "name": "directory",
  4052. "schema": {
  4053. "type": "string"
  4054. }
  4055. },
  4056. {
  4057. "in": "query",
  4058. "name": "query",
  4059. "schema": {
  4060. "type": "string"
  4061. },
  4062. "required": true
  4063. }
  4064. ],
  4065. "summary": "Find symbols",
  4066. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  4067. "responses": {
  4068. "200": {
  4069. "description": "Symbols",
  4070. "content": {
  4071. "application/json": {
  4072. "schema": {
  4073. "type": "array",
  4074. "items": {
  4075. "$ref": "#/components/schemas/Symbol"
  4076. }
  4077. }
  4078. }
  4079. }
  4080. }
  4081. },
  4082. "x-codeSamples": [
  4083. {
  4084. "lang": "js",
  4085. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  4086. }
  4087. ]
  4088. }
  4089. },
  4090. "/file": {
  4091. "get": {
  4092. "operationId": "file.list",
  4093. "parameters": [
  4094. {
  4095. "in": "query",
  4096. "name": "directory",
  4097. "schema": {
  4098. "type": "string"
  4099. }
  4100. },
  4101. {
  4102. "in": "query",
  4103. "name": "path",
  4104. "schema": {
  4105. "type": "string"
  4106. },
  4107. "required": true
  4108. }
  4109. ],
  4110. "summary": "List files",
  4111. "description": "List files and directories in a specified path.",
  4112. "responses": {
  4113. "200": {
  4114. "description": "Files and directories",
  4115. "content": {
  4116. "application/json": {
  4117. "schema": {
  4118. "type": "array",
  4119. "items": {
  4120. "$ref": "#/components/schemas/FileNode"
  4121. }
  4122. }
  4123. }
  4124. }
  4125. }
  4126. },
  4127. "x-codeSamples": [
  4128. {
  4129. "lang": "js",
  4130. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  4131. }
  4132. ]
  4133. }
  4134. },
  4135. "/file/content": {
  4136. "get": {
  4137. "operationId": "file.read",
  4138. "parameters": [
  4139. {
  4140. "in": "query",
  4141. "name": "directory",
  4142. "schema": {
  4143. "type": "string"
  4144. }
  4145. },
  4146. {
  4147. "in": "query",
  4148. "name": "path",
  4149. "schema": {
  4150. "type": "string"
  4151. },
  4152. "required": true
  4153. }
  4154. ],
  4155. "summary": "Read file",
  4156. "description": "Read the content of a specified file.",
  4157. "responses": {
  4158. "200": {
  4159. "description": "File content",
  4160. "content": {
  4161. "application/json": {
  4162. "schema": {
  4163. "$ref": "#/components/schemas/FileContent"
  4164. }
  4165. }
  4166. }
  4167. }
  4168. },
  4169. "x-codeSamples": [
  4170. {
  4171. "lang": "js",
  4172. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  4173. }
  4174. ]
  4175. }
  4176. },
  4177. "/file/status": {
  4178. "get": {
  4179. "operationId": "file.status",
  4180. "parameters": [
  4181. {
  4182. "in": "query",
  4183. "name": "directory",
  4184. "schema": {
  4185. "type": "string"
  4186. }
  4187. }
  4188. ],
  4189. "summary": "Get file status",
  4190. "description": "Get the git status of all files in the project.",
  4191. "responses": {
  4192. "200": {
  4193. "description": "File status",
  4194. "content": {
  4195. "application/json": {
  4196. "schema": {
  4197. "type": "array",
  4198. "items": {
  4199. "$ref": "#/components/schemas/File"
  4200. }
  4201. }
  4202. }
  4203. }
  4204. }
  4205. },
  4206. "x-codeSamples": [
  4207. {
  4208. "lang": "js",
  4209. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  4210. }
  4211. ]
  4212. }
  4213. },
  4214. "/log": {
  4215. "post": {
  4216. "operationId": "app.log",
  4217. "parameters": [
  4218. {
  4219. "in": "query",
  4220. "name": "directory",
  4221. "schema": {
  4222. "type": "string"
  4223. }
  4224. }
  4225. ],
  4226. "summary": "Write log",
  4227. "description": "Write a log entry to the server logs with specified level and metadata.",
  4228. "responses": {
  4229. "200": {
  4230. "description": "Log entry written successfully",
  4231. "content": {
  4232. "application/json": {
  4233. "schema": {
  4234. "type": "boolean"
  4235. }
  4236. }
  4237. }
  4238. },
  4239. "400": {
  4240. "description": "Bad request",
  4241. "content": {
  4242. "application/json": {
  4243. "schema": {
  4244. "$ref": "#/components/schemas/BadRequestError"
  4245. }
  4246. }
  4247. }
  4248. }
  4249. },
  4250. "requestBody": {
  4251. "content": {
  4252. "application/json": {
  4253. "schema": {
  4254. "type": "object",
  4255. "properties": {
  4256. "service": {
  4257. "description": "Service name for the log entry",
  4258. "type": "string"
  4259. },
  4260. "level": {
  4261. "description": "Log level",
  4262. "type": "string",
  4263. "enum": ["debug", "info", "error", "warn"]
  4264. },
  4265. "message": {
  4266. "description": "Log message",
  4267. "type": "string"
  4268. },
  4269. "extra": {
  4270. "description": "Additional metadata for the log entry",
  4271. "type": "object",
  4272. "propertyNames": {
  4273. "type": "string"
  4274. },
  4275. "additionalProperties": {}
  4276. }
  4277. },
  4278. "required": ["service", "level", "message"]
  4279. }
  4280. }
  4281. }
  4282. },
  4283. "x-codeSamples": [
  4284. {
  4285. "lang": "js",
  4286. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  4287. }
  4288. ]
  4289. }
  4290. },
  4291. "/agent": {
  4292. "get": {
  4293. "operationId": "app.agents",
  4294. "parameters": [
  4295. {
  4296. "in": "query",
  4297. "name": "directory",
  4298. "schema": {
  4299. "type": "string"
  4300. }
  4301. }
  4302. ],
  4303. "summary": "List agents",
  4304. "description": "Get a list of all available AI agents in the OpenCode system.",
  4305. "responses": {
  4306. "200": {
  4307. "description": "List of agents",
  4308. "content": {
  4309. "application/json": {
  4310. "schema": {
  4311. "type": "array",
  4312. "items": {
  4313. "$ref": "#/components/schemas/Agent"
  4314. }
  4315. }
  4316. }
  4317. }
  4318. }
  4319. },
  4320. "x-codeSamples": [
  4321. {
  4322. "lang": "js",
  4323. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  4324. }
  4325. ]
  4326. }
  4327. },
  4328. "/mcp": {
  4329. "get": {
  4330. "operationId": "mcp.status",
  4331. "parameters": [
  4332. {
  4333. "in": "query",
  4334. "name": "directory",
  4335. "schema": {
  4336. "type": "string"
  4337. }
  4338. }
  4339. ],
  4340. "summary": "Get MCP status",
  4341. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  4342. "responses": {
  4343. "200": {
  4344. "description": "MCP server status",
  4345. "content": {
  4346. "application/json": {
  4347. "schema": {
  4348. "type": "object",
  4349. "propertyNames": {
  4350. "type": "string"
  4351. },
  4352. "additionalProperties": {
  4353. "$ref": "#/components/schemas/MCPStatus"
  4354. }
  4355. }
  4356. }
  4357. }
  4358. }
  4359. },
  4360. "x-codeSamples": [
  4361. {
  4362. "lang": "js",
  4363. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  4364. }
  4365. ]
  4366. },
  4367. "post": {
  4368. "operationId": "mcp.add",
  4369. "parameters": [
  4370. {
  4371. "in": "query",
  4372. "name": "directory",
  4373. "schema": {
  4374. "type": "string"
  4375. }
  4376. }
  4377. ],
  4378. "summary": "Add MCP server",
  4379. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  4380. "responses": {
  4381. "200": {
  4382. "description": "MCP server added successfully",
  4383. "content": {
  4384. "application/json": {
  4385. "schema": {
  4386. "type": "object",
  4387. "propertyNames": {
  4388. "type": "string"
  4389. },
  4390. "additionalProperties": {
  4391. "$ref": "#/components/schemas/MCPStatus"
  4392. }
  4393. }
  4394. }
  4395. }
  4396. },
  4397. "400": {
  4398. "description": "Bad request",
  4399. "content": {
  4400. "application/json": {
  4401. "schema": {
  4402. "$ref": "#/components/schemas/BadRequestError"
  4403. }
  4404. }
  4405. }
  4406. }
  4407. },
  4408. "requestBody": {
  4409. "content": {
  4410. "application/json": {
  4411. "schema": {
  4412. "type": "object",
  4413. "properties": {
  4414. "name": {
  4415. "type": "string"
  4416. },
  4417. "config": {
  4418. "anyOf": [
  4419. {
  4420. "$ref": "#/components/schemas/McpLocalConfig"
  4421. },
  4422. {
  4423. "$ref": "#/components/schemas/McpRemoteConfig"
  4424. }
  4425. ]
  4426. }
  4427. },
  4428. "required": ["name", "config"]
  4429. }
  4430. }
  4431. }
  4432. },
  4433. "x-codeSamples": [
  4434. {
  4435. "lang": "js",
  4436. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  4437. }
  4438. ]
  4439. }
  4440. },
  4441. "/mcp/{name}/auth": {
  4442. "post": {
  4443. "operationId": "mcp.auth.start",
  4444. "parameters": [
  4445. {
  4446. "in": "query",
  4447. "name": "directory",
  4448. "schema": {
  4449. "type": "string"
  4450. }
  4451. },
  4452. {
  4453. "schema": {
  4454. "type": "string"
  4455. },
  4456. "in": "path",
  4457. "name": "name",
  4458. "required": true
  4459. }
  4460. ],
  4461. "summary": "Start MCP OAuth",
  4462. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  4463. "responses": {
  4464. "200": {
  4465. "description": "OAuth flow started",
  4466. "content": {
  4467. "application/json": {
  4468. "schema": {
  4469. "type": "object",
  4470. "properties": {
  4471. "authorizationUrl": {
  4472. "description": "URL to open in browser for authorization",
  4473. "type": "string"
  4474. }
  4475. },
  4476. "required": ["authorizationUrl"]
  4477. }
  4478. }
  4479. }
  4480. },
  4481. "400": {
  4482. "description": "Bad request",
  4483. "content": {
  4484. "application/json": {
  4485. "schema": {
  4486. "$ref": "#/components/schemas/BadRequestError"
  4487. }
  4488. }
  4489. }
  4490. },
  4491. "404": {
  4492. "description": "Not found",
  4493. "content": {
  4494. "application/json": {
  4495. "schema": {
  4496. "$ref": "#/components/schemas/NotFoundError"
  4497. }
  4498. }
  4499. }
  4500. }
  4501. },
  4502. "x-codeSamples": [
  4503. {
  4504. "lang": "js",
  4505. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  4506. }
  4507. ]
  4508. },
  4509. "delete": {
  4510. "operationId": "mcp.auth.remove",
  4511. "parameters": [
  4512. {
  4513. "in": "query",
  4514. "name": "directory",
  4515. "schema": {
  4516. "type": "string"
  4517. }
  4518. },
  4519. {
  4520. "schema": {
  4521. "type": "string"
  4522. },
  4523. "in": "path",
  4524. "name": "name",
  4525. "required": true
  4526. }
  4527. ],
  4528. "summary": "Remove MCP OAuth",
  4529. "description": "Remove OAuth credentials for an MCP server",
  4530. "responses": {
  4531. "200": {
  4532. "description": "OAuth credentials removed",
  4533. "content": {
  4534. "application/json": {
  4535. "schema": {
  4536. "type": "object",
  4537. "properties": {
  4538. "success": {
  4539. "type": "boolean",
  4540. "const": true
  4541. }
  4542. },
  4543. "required": ["success"]
  4544. }
  4545. }
  4546. }
  4547. },
  4548. "404": {
  4549. "description": "Not found",
  4550. "content": {
  4551. "application/json": {
  4552. "schema": {
  4553. "$ref": "#/components/schemas/NotFoundError"
  4554. }
  4555. }
  4556. }
  4557. }
  4558. },
  4559. "x-codeSamples": [
  4560. {
  4561. "lang": "js",
  4562. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  4563. }
  4564. ]
  4565. }
  4566. },
  4567. "/mcp/{name}/auth/callback": {
  4568. "post": {
  4569. "operationId": "mcp.auth.callback",
  4570. "parameters": [
  4571. {
  4572. "in": "query",
  4573. "name": "directory",
  4574. "schema": {
  4575. "type": "string"
  4576. }
  4577. },
  4578. {
  4579. "schema": {
  4580. "type": "string"
  4581. },
  4582. "in": "path",
  4583. "name": "name",
  4584. "required": true
  4585. }
  4586. ],
  4587. "summary": "Complete MCP OAuth",
  4588. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  4589. "responses": {
  4590. "200": {
  4591. "description": "OAuth authentication completed",
  4592. "content": {
  4593. "application/json": {
  4594. "schema": {
  4595. "$ref": "#/components/schemas/MCPStatus"
  4596. }
  4597. }
  4598. }
  4599. },
  4600. "400": {
  4601. "description": "Bad request",
  4602. "content": {
  4603. "application/json": {
  4604. "schema": {
  4605. "$ref": "#/components/schemas/BadRequestError"
  4606. }
  4607. }
  4608. }
  4609. },
  4610. "404": {
  4611. "description": "Not found",
  4612. "content": {
  4613. "application/json": {
  4614. "schema": {
  4615. "$ref": "#/components/schemas/NotFoundError"
  4616. }
  4617. }
  4618. }
  4619. }
  4620. },
  4621. "requestBody": {
  4622. "content": {
  4623. "application/json": {
  4624. "schema": {
  4625. "type": "object",
  4626. "properties": {
  4627. "code": {
  4628. "description": "Authorization code from OAuth callback",
  4629. "type": "string"
  4630. }
  4631. },
  4632. "required": ["code"]
  4633. }
  4634. }
  4635. }
  4636. },
  4637. "x-codeSamples": [
  4638. {
  4639. "lang": "js",
  4640. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  4641. }
  4642. ]
  4643. }
  4644. },
  4645. "/mcp/{name}/auth/authenticate": {
  4646. "post": {
  4647. "operationId": "mcp.auth.authenticate",
  4648. "parameters": [
  4649. {
  4650. "in": "query",
  4651. "name": "directory",
  4652. "schema": {
  4653. "type": "string"
  4654. }
  4655. },
  4656. {
  4657. "schema": {
  4658. "type": "string"
  4659. },
  4660. "in": "path",
  4661. "name": "name",
  4662. "required": true
  4663. }
  4664. ],
  4665. "summary": "Authenticate MCP OAuth",
  4666. "description": "Start OAuth flow and wait for callback (opens browser)",
  4667. "responses": {
  4668. "200": {
  4669. "description": "OAuth authentication completed",
  4670. "content": {
  4671. "application/json": {
  4672. "schema": {
  4673. "$ref": "#/components/schemas/MCPStatus"
  4674. }
  4675. }
  4676. }
  4677. },
  4678. "400": {
  4679. "description": "Bad request",
  4680. "content": {
  4681. "application/json": {
  4682. "schema": {
  4683. "$ref": "#/components/schemas/BadRequestError"
  4684. }
  4685. }
  4686. }
  4687. },
  4688. "404": {
  4689. "description": "Not found",
  4690. "content": {
  4691. "application/json": {
  4692. "schema": {
  4693. "$ref": "#/components/schemas/NotFoundError"
  4694. }
  4695. }
  4696. }
  4697. }
  4698. },
  4699. "x-codeSamples": [
  4700. {
  4701. "lang": "js",
  4702. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  4703. }
  4704. ]
  4705. }
  4706. },
  4707. "/mcp/{name}/connect": {
  4708. "post": {
  4709. "operationId": "mcp.connect",
  4710. "parameters": [
  4711. {
  4712. "in": "query",
  4713. "name": "directory",
  4714. "schema": {
  4715. "type": "string"
  4716. }
  4717. },
  4718. {
  4719. "in": "path",
  4720. "name": "name",
  4721. "schema": {
  4722. "type": "string"
  4723. },
  4724. "required": true
  4725. }
  4726. ],
  4727. "description": "Connect an MCP server",
  4728. "responses": {
  4729. "200": {
  4730. "description": "MCP server connected successfully",
  4731. "content": {
  4732. "application/json": {
  4733. "schema": {
  4734. "type": "boolean"
  4735. }
  4736. }
  4737. }
  4738. }
  4739. },
  4740. "x-codeSamples": [
  4741. {
  4742. "lang": "js",
  4743. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  4744. }
  4745. ]
  4746. }
  4747. },
  4748. "/mcp/{name}/disconnect": {
  4749. "post": {
  4750. "operationId": "mcp.disconnect",
  4751. "parameters": [
  4752. {
  4753. "in": "query",
  4754. "name": "directory",
  4755. "schema": {
  4756. "type": "string"
  4757. }
  4758. },
  4759. {
  4760. "in": "path",
  4761. "name": "name",
  4762. "schema": {
  4763. "type": "string"
  4764. },
  4765. "required": true
  4766. }
  4767. ],
  4768. "description": "Disconnect an MCP server",
  4769. "responses": {
  4770. "200": {
  4771. "description": "MCP server disconnected successfully",
  4772. "content": {
  4773. "application/json": {
  4774. "schema": {
  4775. "type": "boolean"
  4776. }
  4777. }
  4778. }
  4779. }
  4780. },
  4781. "x-codeSamples": [
  4782. {
  4783. "lang": "js",
  4784. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  4785. }
  4786. ]
  4787. }
  4788. },
  4789. "/experimental/resource": {
  4790. "get": {
  4791. "operationId": "experimental.resource.list",
  4792. "parameters": [
  4793. {
  4794. "in": "query",
  4795. "name": "directory",
  4796. "schema": {
  4797. "type": "string"
  4798. }
  4799. }
  4800. ],
  4801. "summary": "Get MCP resources",
  4802. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  4803. "responses": {
  4804. "200": {
  4805. "description": "MCP resources",
  4806. "content": {
  4807. "application/json": {
  4808. "schema": {
  4809. "type": "object",
  4810. "propertyNames": {
  4811. "type": "string"
  4812. },
  4813. "additionalProperties": {
  4814. "$ref": "#/components/schemas/McpResource"
  4815. }
  4816. }
  4817. }
  4818. }
  4819. }
  4820. },
  4821. "x-codeSamples": [
  4822. {
  4823. "lang": "js",
  4824. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  4825. }
  4826. ]
  4827. }
  4828. },
  4829. "/lsp": {
  4830. "get": {
  4831. "operationId": "lsp.status",
  4832. "parameters": [
  4833. {
  4834. "in": "query",
  4835. "name": "directory",
  4836. "schema": {
  4837. "type": "string"
  4838. }
  4839. }
  4840. ],
  4841. "summary": "Get LSP status",
  4842. "description": "Get LSP server status",
  4843. "responses": {
  4844. "200": {
  4845. "description": "LSP server status",
  4846. "content": {
  4847. "application/json": {
  4848. "schema": {
  4849. "type": "array",
  4850. "items": {
  4851. "$ref": "#/components/schemas/LSPStatus"
  4852. }
  4853. }
  4854. }
  4855. }
  4856. }
  4857. },
  4858. "x-codeSamples": [
  4859. {
  4860. "lang": "js",
  4861. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  4862. }
  4863. ]
  4864. }
  4865. },
  4866. "/formatter": {
  4867. "get": {
  4868. "operationId": "formatter.status",
  4869. "parameters": [
  4870. {
  4871. "in": "query",
  4872. "name": "directory",
  4873. "schema": {
  4874. "type": "string"
  4875. }
  4876. }
  4877. ],
  4878. "summary": "Get formatter status",
  4879. "description": "Get formatter status",
  4880. "responses": {
  4881. "200": {
  4882. "description": "Formatter status",
  4883. "content": {
  4884. "application/json": {
  4885. "schema": {
  4886. "type": "array",
  4887. "items": {
  4888. "$ref": "#/components/schemas/FormatterStatus"
  4889. }
  4890. }
  4891. }
  4892. }
  4893. }
  4894. },
  4895. "x-codeSamples": [
  4896. {
  4897. "lang": "js",
  4898. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  4899. }
  4900. ]
  4901. }
  4902. },
  4903. "/tui/append-prompt": {
  4904. "post": {
  4905. "operationId": "tui.appendPrompt",
  4906. "parameters": [
  4907. {
  4908. "in": "query",
  4909. "name": "directory",
  4910. "schema": {
  4911. "type": "string"
  4912. }
  4913. }
  4914. ],
  4915. "summary": "Append TUI prompt",
  4916. "description": "Append prompt to the TUI",
  4917. "responses": {
  4918. "200": {
  4919. "description": "Prompt processed successfully",
  4920. "content": {
  4921. "application/json": {
  4922. "schema": {
  4923. "type": "boolean"
  4924. }
  4925. }
  4926. }
  4927. },
  4928. "400": {
  4929. "description": "Bad request",
  4930. "content": {
  4931. "application/json": {
  4932. "schema": {
  4933. "$ref": "#/components/schemas/BadRequestError"
  4934. }
  4935. }
  4936. }
  4937. }
  4938. },
  4939. "requestBody": {
  4940. "content": {
  4941. "application/json": {
  4942. "schema": {
  4943. "type": "object",
  4944. "properties": {
  4945. "text": {
  4946. "type": "string"
  4947. }
  4948. },
  4949. "required": ["text"]
  4950. }
  4951. }
  4952. }
  4953. },
  4954. "x-codeSamples": [
  4955. {
  4956. "lang": "js",
  4957. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  4958. }
  4959. ]
  4960. }
  4961. },
  4962. "/tui/open-help": {
  4963. "post": {
  4964. "operationId": "tui.openHelp",
  4965. "parameters": [
  4966. {
  4967. "in": "query",
  4968. "name": "directory",
  4969. "schema": {
  4970. "type": "string"
  4971. }
  4972. }
  4973. ],
  4974. "summary": "Open help dialog",
  4975. "description": "Open the help dialog in the TUI to display user assistance information.",
  4976. "responses": {
  4977. "200": {
  4978. "description": "Help dialog opened successfully",
  4979. "content": {
  4980. "application/json": {
  4981. "schema": {
  4982. "type": "boolean"
  4983. }
  4984. }
  4985. }
  4986. }
  4987. },
  4988. "x-codeSamples": [
  4989. {
  4990. "lang": "js",
  4991. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  4992. }
  4993. ]
  4994. }
  4995. },
  4996. "/tui/open-sessions": {
  4997. "post": {
  4998. "operationId": "tui.openSessions",
  4999. "parameters": [
  5000. {
  5001. "in": "query",
  5002. "name": "directory",
  5003. "schema": {
  5004. "type": "string"
  5005. }
  5006. }
  5007. ],
  5008. "summary": "Open sessions dialog",
  5009. "description": "Open the session dialog",
  5010. "responses": {
  5011. "200": {
  5012. "description": "Session dialog opened successfully",
  5013. "content": {
  5014. "application/json": {
  5015. "schema": {
  5016. "type": "boolean"
  5017. }
  5018. }
  5019. }
  5020. }
  5021. },
  5022. "x-codeSamples": [
  5023. {
  5024. "lang": "js",
  5025. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  5026. }
  5027. ]
  5028. }
  5029. },
  5030. "/tui/open-themes": {
  5031. "post": {
  5032. "operationId": "tui.openThemes",
  5033. "parameters": [
  5034. {
  5035. "in": "query",
  5036. "name": "directory",
  5037. "schema": {
  5038. "type": "string"
  5039. }
  5040. }
  5041. ],
  5042. "summary": "Open themes dialog",
  5043. "description": "Open the theme dialog",
  5044. "responses": {
  5045. "200": {
  5046. "description": "Theme dialog opened successfully",
  5047. "content": {
  5048. "application/json": {
  5049. "schema": {
  5050. "type": "boolean"
  5051. }
  5052. }
  5053. }
  5054. }
  5055. },
  5056. "x-codeSamples": [
  5057. {
  5058. "lang": "js",
  5059. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  5060. }
  5061. ]
  5062. }
  5063. },
  5064. "/tui/open-models": {
  5065. "post": {
  5066. "operationId": "tui.openModels",
  5067. "parameters": [
  5068. {
  5069. "in": "query",
  5070. "name": "directory",
  5071. "schema": {
  5072. "type": "string"
  5073. }
  5074. }
  5075. ],
  5076. "summary": "Open models dialog",
  5077. "description": "Open the model dialog",
  5078. "responses": {
  5079. "200": {
  5080. "description": "Model dialog opened successfully",
  5081. "content": {
  5082. "application/json": {
  5083. "schema": {
  5084. "type": "boolean"
  5085. }
  5086. }
  5087. }
  5088. }
  5089. },
  5090. "x-codeSamples": [
  5091. {
  5092. "lang": "js",
  5093. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  5094. }
  5095. ]
  5096. }
  5097. },
  5098. "/tui/submit-prompt": {
  5099. "post": {
  5100. "operationId": "tui.submitPrompt",
  5101. "parameters": [
  5102. {
  5103. "in": "query",
  5104. "name": "directory",
  5105. "schema": {
  5106. "type": "string"
  5107. }
  5108. }
  5109. ],
  5110. "summary": "Submit TUI prompt",
  5111. "description": "Submit the prompt",
  5112. "responses": {
  5113. "200": {
  5114. "description": "Prompt submitted successfully",
  5115. "content": {
  5116. "application/json": {
  5117. "schema": {
  5118. "type": "boolean"
  5119. }
  5120. }
  5121. }
  5122. }
  5123. },
  5124. "x-codeSamples": [
  5125. {
  5126. "lang": "js",
  5127. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  5128. }
  5129. ]
  5130. }
  5131. },
  5132. "/tui/clear-prompt": {
  5133. "post": {
  5134. "operationId": "tui.clearPrompt",
  5135. "parameters": [
  5136. {
  5137. "in": "query",
  5138. "name": "directory",
  5139. "schema": {
  5140. "type": "string"
  5141. }
  5142. }
  5143. ],
  5144. "summary": "Clear TUI prompt",
  5145. "description": "Clear the prompt",
  5146. "responses": {
  5147. "200": {
  5148. "description": "Prompt cleared successfully",
  5149. "content": {
  5150. "application/json": {
  5151. "schema": {
  5152. "type": "boolean"
  5153. }
  5154. }
  5155. }
  5156. }
  5157. },
  5158. "x-codeSamples": [
  5159. {
  5160. "lang": "js",
  5161. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  5162. }
  5163. ]
  5164. }
  5165. },
  5166. "/tui/execute-command": {
  5167. "post": {
  5168. "operationId": "tui.executeCommand",
  5169. "parameters": [
  5170. {
  5171. "in": "query",
  5172. "name": "directory",
  5173. "schema": {
  5174. "type": "string"
  5175. }
  5176. }
  5177. ],
  5178. "summary": "Execute TUI command",
  5179. "description": "Execute a TUI command (e.g. agent_cycle)",
  5180. "responses": {
  5181. "200": {
  5182. "description": "Command executed successfully",
  5183. "content": {
  5184. "application/json": {
  5185. "schema": {
  5186. "type": "boolean"
  5187. }
  5188. }
  5189. }
  5190. },
  5191. "400": {
  5192. "description": "Bad request",
  5193. "content": {
  5194. "application/json": {
  5195. "schema": {
  5196. "$ref": "#/components/schemas/BadRequestError"
  5197. }
  5198. }
  5199. }
  5200. }
  5201. },
  5202. "requestBody": {
  5203. "content": {
  5204. "application/json": {
  5205. "schema": {
  5206. "type": "object",
  5207. "properties": {
  5208. "command": {
  5209. "type": "string"
  5210. }
  5211. },
  5212. "required": ["command"]
  5213. }
  5214. }
  5215. }
  5216. },
  5217. "x-codeSamples": [
  5218. {
  5219. "lang": "js",
  5220. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  5221. }
  5222. ]
  5223. }
  5224. },
  5225. "/tui/show-toast": {
  5226. "post": {
  5227. "operationId": "tui.showToast",
  5228. "parameters": [
  5229. {
  5230. "in": "query",
  5231. "name": "directory",
  5232. "schema": {
  5233. "type": "string"
  5234. }
  5235. }
  5236. ],
  5237. "summary": "Show TUI toast",
  5238. "description": "Show a toast notification in the TUI",
  5239. "responses": {
  5240. "200": {
  5241. "description": "Toast notification shown successfully",
  5242. "content": {
  5243. "application/json": {
  5244. "schema": {
  5245. "type": "boolean"
  5246. }
  5247. }
  5248. }
  5249. }
  5250. },
  5251. "requestBody": {
  5252. "content": {
  5253. "application/json": {
  5254. "schema": {
  5255. "type": "object",
  5256. "properties": {
  5257. "title": {
  5258. "type": "string"
  5259. },
  5260. "message": {
  5261. "type": "string"
  5262. },
  5263. "variant": {
  5264. "type": "string",
  5265. "enum": ["info", "success", "warning", "error"]
  5266. },
  5267. "duration": {
  5268. "description": "Duration in milliseconds",
  5269. "default": 5000,
  5270. "type": "number"
  5271. }
  5272. },
  5273. "required": ["message", "variant"]
  5274. }
  5275. }
  5276. }
  5277. },
  5278. "x-codeSamples": [
  5279. {
  5280. "lang": "js",
  5281. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  5282. }
  5283. ]
  5284. }
  5285. },
  5286. "/tui/publish": {
  5287. "post": {
  5288. "operationId": "tui.publish",
  5289. "parameters": [
  5290. {
  5291. "in": "query",
  5292. "name": "directory",
  5293. "schema": {
  5294. "type": "string"
  5295. }
  5296. }
  5297. ],
  5298. "summary": "Publish TUI event",
  5299. "description": "Publish a TUI event",
  5300. "responses": {
  5301. "200": {
  5302. "description": "Event published successfully",
  5303. "content": {
  5304. "application/json": {
  5305. "schema": {
  5306. "type": "boolean"
  5307. }
  5308. }
  5309. }
  5310. },
  5311. "400": {
  5312. "description": "Bad request",
  5313. "content": {
  5314. "application/json": {
  5315. "schema": {
  5316. "$ref": "#/components/schemas/BadRequestError"
  5317. }
  5318. }
  5319. }
  5320. }
  5321. },
  5322. "requestBody": {
  5323. "content": {
  5324. "application/json": {
  5325. "schema": {
  5326. "anyOf": [
  5327. {
  5328. "$ref": "#/components/schemas/Event.tui.prompt.append"
  5329. },
  5330. {
  5331. "$ref": "#/components/schemas/Event.tui.command.execute"
  5332. },
  5333. {
  5334. "$ref": "#/components/schemas/Event.tui.toast.show"
  5335. },
  5336. {
  5337. "$ref": "#/components/schemas/Event.tui.session.select"
  5338. }
  5339. ]
  5340. }
  5341. }
  5342. }
  5343. },
  5344. "x-codeSamples": [
  5345. {
  5346. "lang": "js",
  5347. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  5348. }
  5349. ]
  5350. }
  5351. },
  5352. "/tui/select-session": {
  5353. "post": {
  5354. "operationId": "tui.selectSession",
  5355. "parameters": [
  5356. {
  5357. "in": "query",
  5358. "name": "directory",
  5359. "schema": {
  5360. "type": "string"
  5361. }
  5362. }
  5363. ],
  5364. "summary": "Select session",
  5365. "description": "Navigate the TUI to display the specified session.",
  5366. "responses": {
  5367. "200": {
  5368. "description": "Session selected successfully",
  5369. "content": {
  5370. "application/json": {
  5371. "schema": {
  5372. "type": "boolean"
  5373. }
  5374. }
  5375. }
  5376. },
  5377. "400": {
  5378. "description": "Bad request",
  5379. "content": {
  5380. "application/json": {
  5381. "schema": {
  5382. "$ref": "#/components/schemas/BadRequestError"
  5383. }
  5384. }
  5385. }
  5386. },
  5387. "404": {
  5388. "description": "Not found",
  5389. "content": {
  5390. "application/json": {
  5391. "schema": {
  5392. "$ref": "#/components/schemas/NotFoundError"
  5393. }
  5394. }
  5395. }
  5396. }
  5397. },
  5398. "requestBody": {
  5399. "content": {
  5400. "application/json": {
  5401. "schema": {
  5402. "type": "object",
  5403. "properties": {
  5404. "sessionID": {
  5405. "description": "Session ID to navigate to",
  5406. "type": "string",
  5407. "pattern": "^ses"
  5408. }
  5409. },
  5410. "required": ["sessionID"]
  5411. }
  5412. }
  5413. }
  5414. },
  5415. "x-codeSamples": [
  5416. {
  5417. "lang": "js",
  5418. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  5419. }
  5420. ]
  5421. }
  5422. },
  5423. "/tui/control/next": {
  5424. "get": {
  5425. "operationId": "tui.control.next",
  5426. "parameters": [
  5427. {
  5428. "in": "query",
  5429. "name": "directory",
  5430. "schema": {
  5431. "type": "string"
  5432. }
  5433. }
  5434. ],
  5435. "summary": "Get next TUI request",
  5436. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  5437. "responses": {
  5438. "200": {
  5439. "description": "Next TUI request",
  5440. "content": {
  5441. "application/json": {
  5442. "schema": {
  5443. "type": "object",
  5444. "properties": {
  5445. "path": {
  5446. "type": "string"
  5447. },
  5448. "body": {}
  5449. },
  5450. "required": ["path", "body"]
  5451. }
  5452. }
  5453. }
  5454. }
  5455. },
  5456. "x-codeSamples": [
  5457. {
  5458. "lang": "js",
  5459. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  5460. }
  5461. ]
  5462. }
  5463. },
  5464. "/tui/control/response": {
  5465. "post": {
  5466. "operationId": "tui.control.response",
  5467. "parameters": [
  5468. {
  5469. "in": "query",
  5470. "name": "directory",
  5471. "schema": {
  5472. "type": "string"
  5473. }
  5474. }
  5475. ],
  5476. "summary": "Submit TUI response",
  5477. "description": "Submit a response to the TUI request queue to complete a pending request.",
  5478. "responses": {
  5479. "200": {
  5480. "description": "Response submitted successfully",
  5481. "content": {
  5482. "application/json": {
  5483. "schema": {
  5484. "type": "boolean"
  5485. }
  5486. }
  5487. }
  5488. }
  5489. },
  5490. "requestBody": {
  5491. "content": {
  5492. "application/json": {
  5493. "schema": {}
  5494. }
  5495. }
  5496. },
  5497. "x-codeSamples": [
  5498. {
  5499. "lang": "js",
  5500. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  5501. }
  5502. ]
  5503. }
  5504. },
  5505. "/auth/{providerID}": {
  5506. "put": {
  5507. "operationId": "auth.set",
  5508. "parameters": [
  5509. {
  5510. "in": "query",
  5511. "name": "directory",
  5512. "schema": {
  5513. "type": "string"
  5514. }
  5515. },
  5516. {
  5517. "in": "path",
  5518. "name": "providerID",
  5519. "schema": {
  5520. "type": "string"
  5521. },
  5522. "required": true
  5523. }
  5524. ],
  5525. "summary": "Set auth credentials",
  5526. "description": "Set authentication credentials",
  5527. "responses": {
  5528. "200": {
  5529. "description": "Successfully set authentication credentials",
  5530. "content": {
  5531. "application/json": {
  5532. "schema": {
  5533. "type": "boolean"
  5534. }
  5535. }
  5536. }
  5537. },
  5538. "400": {
  5539. "description": "Bad request",
  5540. "content": {
  5541. "application/json": {
  5542. "schema": {
  5543. "$ref": "#/components/schemas/BadRequestError"
  5544. }
  5545. }
  5546. }
  5547. }
  5548. },
  5549. "requestBody": {
  5550. "content": {
  5551. "application/json": {
  5552. "schema": {
  5553. "$ref": "#/components/schemas/Auth"
  5554. }
  5555. }
  5556. }
  5557. },
  5558. "x-codeSamples": [
  5559. {
  5560. "lang": "js",
  5561. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  5562. }
  5563. ]
  5564. }
  5565. },
  5566. "/event": {
  5567. "get": {
  5568. "operationId": "event.subscribe",
  5569. "parameters": [
  5570. {
  5571. "in": "query",
  5572. "name": "directory",
  5573. "schema": {
  5574. "type": "string"
  5575. }
  5576. }
  5577. ],
  5578. "summary": "Subscribe to events",
  5579. "description": "Get events",
  5580. "responses": {
  5581. "200": {
  5582. "description": "Event stream",
  5583. "content": {
  5584. "text/event-stream": {
  5585. "schema": {
  5586. "$ref": "#/components/schemas/Event"
  5587. }
  5588. }
  5589. }
  5590. }
  5591. },
  5592. "x-codeSamples": [
  5593. {
  5594. "lang": "js",
  5595. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5596. }
  5597. ]
  5598. }
  5599. }
  5600. },
  5601. "components": {
  5602. "schemas": {
  5603. "Event.installation.updated": {
  5604. "type": "object",
  5605. "properties": {
  5606. "type": {
  5607. "type": "string",
  5608. "const": "installation.updated"
  5609. },
  5610. "properties": {
  5611. "type": "object",
  5612. "properties": {
  5613. "version": {
  5614. "type": "string"
  5615. }
  5616. },
  5617. "required": ["version"]
  5618. }
  5619. },
  5620. "required": ["type", "properties"]
  5621. },
  5622. "Event.installation.update-available": {
  5623. "type": "object",
  5624. "properties": {
  5625. "type": {
  5626. "type": "string",
  5627. "const": "installation.update-available"
  5628. },
  5629. "properties": {
  5630. "type": "object",
  5631. "properties": {
  5632. "version": {
  5633. "type": "string"
  5634. }
  5635. },
  5636. "required": ["version"]
  5637. }
  5638. },
  5639. "required": ["type", "properties"]
  5640. },
  5641. "Project": {
  5642. "type": "object",
  5643. "properties": {
  5644. "id": {
  5645. "type": "string"
  5646. },
  5647. "worktree": {
  5648. "type": "string"
  5649. },
  5650. "vcs": {
  5651. "type": "string",
  5652. "const": "git"
  5653. },
  5654. "name": {
  5655. "type": "string"
  5656. },
  5657. "icon": {
  5658. "type": "object",
  5659. "properties": {
  5660. "url": {
  5661. "type": "string"
  5662. },
  5663. "color": {
  5664. "type": "string"
  5665. }
  5666. }
  5667. },
  5668. "time": {
  5669. "type": "object",
  5670. "properties": {
  5671. "created": {
  5672. "type": "number"
  5673. },
  5674. "updated": {
  5675. "type": "number"
  5676. },
  5677. "initialized": {
  5678. "type": "number"
  5679. }
  5680. },
  5681. "required": ["created", "updated"]
  5682. },
  5683. "sandboxes": {
  5684. "type": "array",
  5685. "items": {
  5686. "type": "string"
  5687. }
  5688. }
  5689. },
  5690. "required": ["id", "worktree", "time", "sandboxes"]
  5691. },
  5692. "Event.project.updated": {
  5693. "type": "object",
  5694. "properties": {
  5695. "type": {
  5696. "type": "string",
  5697. "const": "project.updated"
  5698. },
  5699. "properties": {
  5700. "$ref": "#/components/schemas/Project"
  5701. }
  5702. },
  5703. "required": ["type", "properties"]
  5704. },
  5705. "Event.server.instance.disposed": {
  5706. "type": "object",
  5707. "properties": {
  5708. "type": {
  5709. "type": "string",
  5710. "const": "server.instance.disposed"
  5711. },
  5712. "properties": {
  5713. "type": "object",
  5714. "properties": {
  5715. "directory": {
  5716. "type": "string"
  5717. }
  5718. },
  5719. "required": ["directory"]
  5720. }
  5721. },
  5722. "required": ["type", "properties"]
  5723. },
  5724. "Event.lsp.client.diagnostics": {
  5725. "type": "object",
  5726. "properties": {
  5727. "type": {
  5728. "type": "string",
  5729. "const": "lsp.client.diagnostics"
  5730. },
  5731. "properties": {
  5732. "type": "object",
  5733. "properties": {
  5734. "serverID": {
  5735. "type": "string"
  5736. },
  5737. "path": {
  5738. "type": "string"
  5739. }
  5740. },
  5741. "required": ["serverID", "path"]
  5742. }
  5743. },
  5744. "required": ["type", "properties"]
  5745. },
  5746. "Event.lsp.updated": {
  5747. "type": "object",
  5748. "properties": {
  5749. "type": {
  5750. "type": "string",
  5751. "const": "lsp.updated"
  5752. },
  5753. "properties": {
  5754. "type": "object",
  5755. "properties": {}
  5756. }
  5757. },
  5758. "required": ["type", "properties"]
  5759. },
  5760. "FileDiff": {
  5761. "type": "object",
  5762. "properties": {
  5763. "file": {
  5764. "type": "string"
  5765. },
  5766. "before": {
  5767. "type": "string"
  5768. },
  5769. "after": {
  5770. "type": "string"
  5771. },
  5772. "additions": {
  5773. "type": "number"
  5774. },
  5775. "deletions": {
  5776. "type": "number"
  5777. }
  5778. },
  5779. "required": ["file", "before", "after", "additions", "deletions"]
  5780. },
  5781. "UserMessage": {
  5782. "type": "object",
  5783. "properties": {
  5784. "id": {
  5785. "type": "string"
  5786. },
  5787. "sessionID": {
  5788. "type": "string"
  5789. },
  5790. "role": {
  5791. "type": "string",
  5792. "const": "user"
  5793. },
  5794. "time": {
  5795. "type": "object",
  5796. "properties": {
  5797. "created": {
  5798. "type": "number"
  5799. }
  5800. },
  5801. "required": ["created"]
  5802. },
  5803. "summary": {
  5804. "type": "object",
  5805. "properties": {
  5806. "title": {
  5807. "type": "string"
  5808. },
  5809. "body": {
  5810. "type": "string"
  5811. },
  5812. "diffs": {
  5813. "type": "array",
  5814. "items": {
  5815. "$ref": "#/components/schemas/FileDiff"
  5816. }
  5817. }
  5818. },
  5819. "required": ["diffs"]
  5820. },
  5821. "agent": {
  5822. "type": "string"
  5823. },
  5824. "model": {
  5825. "type": "object",
  5826. "properties": {
  5827. "providerID": {
  5828. "type": "string"
  5829. },
  5830. "modelID": {
  5831. "type": "string"
  5832. }
  5833. },
  5834. "required": ["providerID", "modelID"]
  5835. },
  5836. "system": {
  5837. "type": "string"
  5838. },
  5839. "tools": {
  5840. "type": "object",
  5841. "propertyNames": {
  5842. "type": "string"
  5843. },
  5844. "additionalProperties": {
  5845. "type": "boolean"
  5846. }
  5847. },
  5848. "variant": {
  5849. "type": "string"
  5850. }
  5851. },
  5852. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  5853. },
  5854. "ProviderAuthError": {
  5855. "type": "object",
  5856. "properties": {
  5857. "name": {
  5858. "type": "string",
  5859. "const": "ProviderAuthError"
  5860. },
  5861. "data": {
  5862. "type": "object",
  5863. "properties": {
  5864. "providerID": {
  5865. "type": "string"
  5866. },
  5867. "message": {
  5868. "type": "string"
  5869. }
  5870. },
  5871. "required": ["providerID", "message"]
  5872. }
  5873. },
  5874. "required": ["name", "data"]
  5875. },
  5876. "UnknownError": {
  5877. "type": "object",
  5878. "properties": {
  5879. "name": {
  5880. "type": "string",
  5881. "const": "UnknownError"
  5882. },
  5883. "data": {
  5884. "type": "object",
  5885. "properties": {
  5886. "message": {
  5887. "type": "string"
  5888. }
  5889. },
  5890. "required": ["message"]
  5891. }
  5892. },
  5893. "required": ["name", "data"]
  5894. },
  5895. "MessageOutputLengthError": {
  5896. "type": "object",
  5897. "properties": {
  5898. "name": {
  5899. "type": "string",
  5900. "const": "MessageOutputLengthError"
  5901. },
  5902. "data": {
  5903. "type": "object",
  5904. "properties": {}
  5905. }
  5906. },
  5907. "required": ["name", "data"]
  5908. },
  5909. "MessageAbortedError": {
  5910. "type": "object",
  5911. "properties": {
  5912. "name": {
  5913. "type": "string",
  5914. "const": "MessageAbortedError"
  5915. },
  5916. "data": {
  5917. "type": "object",
  5918. "properties": {
  5919. "message": {
  5920. "type": "string"
  5921. }
  5922. },
  5923. "required": ["message"]
  5924. }
  5925. },
  5926. "required": ["name", "data"]
  5927. },
  5928. "APIError": {
  5929. "type": "object",
  5930. "properties": {
  5931. "name": {
  5932. "type": "string",
  5933. "const": "APIError"
  5934. },
  5935. "data": {
  5936. "type": "object",
  5937. "properties": {
  5938. "message": {
  5939. "type": "string"
  5940. },
  5941. "statusCode": {
  5942. "type": "number"
  5943. },
  5944. "isRetryable": {
  5945. "type": "boolean"
  5946. },
  5947. "responseHeaders": {
  5948. "type": "object",
  5949. "propertyNames": {
  5950. "type": "string"
  5951. },
  5952. "additionalProperties": {
  5953. "type": "string"
  5954. }
  5955. },
  5956. "responseBody": {
  5957. "type": "string"
  5958. },
  5959. "metadata": {
  5960. "type": "object",
  5961. "propertyNames": {
  5962. "type": "string"
  5963. },
  5964. "additionalProperties": {
  5965. "type": "string"
  5966. }
  5967. }
  5968. },
  5969. "required": ["message", "isRetryable"]
  5970. }
  5971. },
  5972. "required": ["name", "data"]
  5973. },
  5974. "AssistantMessage": {
  5975. "type": "object",
  5976. "properties": {
  5977. "id": {
  5978. "type": "string"
  5979. },
  5980. "sessionID": {
  5981. "type": "string"
  5982. },
  5983. "role": {
  5984. "type": "string",
  5985. "const": "assistant"
  5986. },
  5987. "time": {
  5988. "type": "object",
  5989. "properties": {
  5990. "created": {
  5991. "type": "number"
  5992. },
  5993. "completed": {
  5994. "type": "number"
  5995. }
  5996. },
  5997. "required": ["created"]
  5998. },
  5999. "error": {
  6000. "anyOf": [
  6001. {
  6002. "$ref": "#/components/schemas/ProviderAuthError"
  6003. },
  6004. {
  6005. "$ref": "#/components/schemas/UnknownError"
  6006. },
  6007. {
  6008. "$ref": "#/components/schemas/MessageOutputLengthError"
  6009. },
  6010. {
  6011. "$ref": "#/components/schemas/MessageAbortedError"
  6012. },
  6013. {
  6014. "$ref": "#/components/schemas/APIError"
  6015. }
  6016. ]
  6017. },
  6018. "parentID": {
  6019. "type": "string"
  6020. },
  6021. "modelID": {
  6022. "type": "string"
  6023. },
  6024. "providerID": {
  6025. "type": "string"
  6026. },
  6027. "mode": {
  6028. "type": "string"
  6029. },
  6030. "agent": {
  6031. "type": "string"
  6032. },
  6033. "path": {
  6034. "type": "object",
  6035. "properties": {
  6036. "cwd": {
  6037. "type": "string"
  6038. },
  6039. "root": {
  6040. "type": "string"
  6041. }
  6042. },
  6043. "required": ["cwd", "root"]
  6044. },
  6045. "summary": {
  6046. "type": "boolean"
  6047. },
  6048. "cost": {
  6049. "type": "number"
  6050. },
  6051. "tokens": {
  6052. "type": "object",
  6053. "properties": {
  6054. "input": {
  6055. "type": "number"
  6056. },
  6057. "output": {
  6058. "type": "number"
  6059. },
  6060. "reasoning": {
  6061. "type": "number"
  6062. },
  6063. "cache": {
  6064. "type": "object",
  6065. "properties": {
  6066. "read": {
  6067. "type": "number"
  6068. },
  6069. "write": {
  6070. "type": "number"
  6071. }
  6072. },
  6073. "required": ["read", "write"]
  6074. }
  6075. },
  6076. "required": ["input", "output", "reasoning", "cache"]
  6077. },
  6078. "finish": {
  6079. "type": "string"
  6080. }
  6081. },
  6082. "required": [
  6083. "id",
  6084. "sessionID",
  6085. "role",
  6086. "time",
  6087. "parentID",
  6088. "modelID",
  6089. "providerID",
  6090. "mode",
  6091. "agent",
  6092. "path",
  6093. "cost",
  6094. "tokens"
  6095. ]
  6096. },
  6097. "Message": {
  6098. "anyOf": [
  6099. {
  6100. "$ref": "#/components/schemas/UserMessage"
  6101. },
  6102. {
  6103. "$ref": "#/components/schemas/AssistantMessage"
  6104. }
  6105. ]
  6106. },
  6107. "Event.message.updated": {
  6108. "type": "object",
  6109. "properties": {
  6110. "type": {
  6111. "type": "string",
  6112. "const": "message.updated"
  6113. },
  6114. "properties": {
  6115. "type": "object",
  6116. "properties": {
  6117. "info": {
  6118. "$ref": "#/components/schemas/Message"
  6119. }
  6120. },
  6121. "required": ["info"]
  6122. }
  6123. },
  6124. "required": ["type", "properties"]
  6125. },
  6126. "Event.message.removed": {
  6127. "type": "object",
  6128. "properties": {
  6129. "type": {
  6130. "type": "string",
  6131. "const": "message.removed"
  6132. },
  6133. "properties": {
  6134. "type": "object",
  6135. "properties": {
  6136. "sessionID": {
  6137. "type": "string"
  6138. },
  6139. "messageID": {
  6140. "type": "string"
  6141. }
  6142. },
  6143. "required": ["sessionID", "messageID"]
  6144. }
  6145. },
  6146. "required": ["type", "properties"]
  6147. },
  6148. "TextPart": {
  6149. "type": "object",
  6150. "properties": {
  6151. "id": {
  6152. "type": "string"
  6153. },
  6154. "sessionID": {
  6155. "type": "string"
  6156. },
  6157. "messageID": {
  6158. "type": "string"
  6159. },
  6160. "type": {
  6161. "type": "string",
  6162. "const": "text"
  6163. },
  6164. "text": {
  6165. "type": "string"
  6166. },
  6167. "synthetic": {
  6168. "type": "boolean"
  6169. },
  6170. "ignored": {
  6171. "type": "boolean"
  6172. },
  6173. "time": {
  6174. "type": "object",
  6175. "properties": {
  6176. "start": {
  6177. "type": "number"
  6178. },
  6179. "end": {
  6180. "type": "number"
  6181. }
  6182. },
  6183. "required": ["start"]
  6184. },
  6185. "metadata": {
  6186. "type": "object",
  6187. "propertyNames": {
  6188. "type": "string"
  6189. },
  6190. "additionalProperties": {}
  6191. }
  6192. },
  6193. "required": ["id", "sessionID", "messageID", "type", "text"]
  6194. },
  6195. "ReasoningPart": {
  6196. "type": "object",
  6197. "properties": {
  6198. "id": {
  6199. "type": "string"
  6200. },
  6201. "sessionID": {
  6202. "type": "string"
  6203. },
  6204. "messageID": {
  6205. "type": "string"
  6206. },
  6207. "type": {
  6208. "type": "string",
  6209. "const": "reasoning"
  6210. },
  6211. "text": {
  6212. "type": "string"
  6213. },
  6214. "metadata": {
  6215. "type": "object",
  6216. "propertyNames": {
  6217. "type": "string"
  6218. },
  6219. "additionalProperties": {}
  6220. },
  6221. "time": {
  6222. "type": "object",
  6223. "properties": {
  6224. "start": {
  6225. "type": "number"
  6226. },
  6227. "end": {
  6228. "type": "number"
  6229. }
  6230. },
  6231. "required": ["start"]
  6232. }
  6233. },
  6234. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  6235. },
  6236. "FilePartSourceText": {
  6237. "type": "object",
  6238. "properties": {
  6239. "value": {
  6240. "type": "string"
  6241. },
  6242. "start": {
  6243. "type": "integer",
  6244. "minimum": -9007199254740991,
  6245. "maximum": 9007199254740991
  6246. },
  6247. "end": {
  6248. "type": "integer",
  6249. "minimum": -9007199254740991,
  6250. "maximum": 9007199254740991
  6251. }
  6252. },
  6253. "required": ["value", "start", "end"]
  6254. },
  6255. "FileSource": {
  6256. "type": "object",
  6257. "properties": {
  6258. "text": {
  6259. "$ref": "#/components/schemas/FilePartSourceText"
  6260. },
  6261. "type": {
  6262. "type": "string",
  6263. "const": "file"
  6264. },
  6265. "path": {
  6266. "type": "string"
  6267. }
  6268. },
  6269. "required": ["text", "type", "path"]
  6270. },
  6271. "Range": {
  6272. "type": "object",
  6273. "properties": {
  6274. "start": {
  6275. "type": "object",
  6276. "properties": {
  6277. "line": {
  6278. "type": "number"
  6279. },
  6280. "character": {
  6281. "type": "number"
  6282. }
  6283. },
  6284. "required": ["line", "character"]
  6285. },
  6286. "end": {
  6287. "type": "object",
  6288. "properties": {
  6289. "line": {
  6290. "type": "number"
  6291. },
  6292. "character": {
  6293. "type": "number"
  6294. }
  6295. },
  6296. "required": ["line", "character"]
  6297. }
  6298. },
  6299. "required": ["start", "end"]
  6300. },
  6301. "SymbolSource": {
  6302. "type": "object",
  6303. "properties": {
  6304. "text": {
  6305. "$ref": "#/components/schemas/FilePartSourceText"
  6306. },
  6307. "type": {
  6308. "type": "string",
  6309. "const": "symbol"
  6310. },
  6311. "path": {
  6312. "type": "string"
  6313. },
  6314. "range": {
  6315. "$ref": "#/components/schemas/Range"
  6316. },
  6317. "name": {
  6318. "type": "string"
  6319. },
  6320. "kind": {
  6321. "type": "integer",
  6322. "minimum": -9007199254740991,
  6323. "maximum": 9007199254740991
  6324. }
  6325. },
  6326. "required": ["text", "type", "path", "range", "name", "kind"]
  6327. },
  6328. "ResourceSource": {
  6329. "type": "object",
  6330. "properties": {
  6331. "text": {
  6332. "$ref": "#/components/schemas/FilePartSourceText"
  6333. },
  6334. "type": {
  6335. "type": "string",
  6336. "const": "resource"
  6337. },
  6338. "clientName": {
  6339. "type": "string"
  6340. },
  6341. "uri": {
  6342. "type": "string"
  6343. }
  6344. },
  6345. "required": ["text", "type", "clientName", "uri"]
  6346. },
  6347. "FilePartSource": {
  6348. "anyOf": [
  6349. {
  6350. "$ref": "#/components/schemas/FileSource"
  6351. },
  6352. {
  6353. "$ref": "#/components/schemas/SymbolSource"
  6354. },
  6355. {
  6356. "$ref": "#/components/schemas/ResourceSource"
  6357. }
  6358. ]
  6359. },
  6360. "FilePart": {
  6361. "type": "object",
  6362. "properties": {
  6363. "id": {
  6364. "type": "string"
  6365. },
  6366. "sessionID": {
  6367. "type": "string"
  6368. },
  6369. "messageID": {
  6370. "type": "string"
  6371. },
  6372. "type": {
  6373. "type": "string",
  6374. "const": "file"
  6375. },
  6376. "mime": {
  6377. "type": "string"
  6378. },
  6379. "filename": {
  6380. "type": "string"
  6381. },
  6382. "url": {
  6383. "type": "string"
  6384. },
  6385. "source": {
  6386. "$ref": "#/components/schemas/FilePartSource"
  6387. }
  6388. },
  6389. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  6390. },
  6391. "ToolStatePending": {
  6392. "type": "object",
  6393. "properties": {
  6394. "status": {
  6395. "type": "string",
  6396. "const": "pending"
  6397. },
  6398. "input": {
  6399. "type": "object",
  6400. "propertyNames": {
  6401. "type": "string"
  6402. },
  6403. "additionalProperties": {}
  6404. },
  6405. "raw": {
  6406. "type": "string"
  6407. }
  6408. },
  6409. "required": ["status", "input", "raw"]
  6410. },
  6411. "ToolStateRunning": {
  6412. "type": "object",
  6413. "properties": {
  6414. "status": {
  6415. "type": "string",
  6416. "const": "running"
  6417. },
  6418. "input": {
  6419. "type": "object",
  6420. "propertyNames": {
  6421. "type": "string"
  6422. },
  6423. "additionalProperties": {}
  6424. },
  6425. "title": {
  6426. "type": "string"
  6427. },
  6428. "metadata": {
  6429. "type": "object",
  6430. "propertyNames": {
  6431. "type": "string"
  6432. },
  6433. "additionalProperties": {}
  6434. },
  6435. "time": {
  6436. "type": "object",
  6437. "properties": {
  6438. "start": {
  6439. "type": "number"
  6440. }
  6441. },
  6442. "required": ["start"]
  6443. }
  6444. },
  6445. "required": ["status", "input", "time"]
  6446. },
  6447. "ToolStateCompleted": {
  6448. "type": "object",
  6449. "properties": {
  6450. "status": {
  6451. "type": "string",
  6452. "const": "completed"
  6453. },
  6454. "input": {
  6455. "type": "object",
  6456. "propertyNames": {
  6457. "type": "string"
  6458. },
  6459. "additionalProperties": {}
  6460. },
  6461. "output": {
  6462. "type": "string"
  6463. },
  6464. "title": {
  6465. "type": "string"
  6466. },
  6467. "metadata": {
  6468. "type": "object",
  6469. "propertyNames": {
  6470. "type": "string"
  6471. },
  6472. "additionalProperties": {}
  6473. },
  6474. "time": {
  6475. "type": "object",
  6476. "properties": {
  6477. "start": {
  6478. "type": "number"
  6479. },
  6480. "end": {
  6481. "type": "number"
  6482. },
  6483. "compacted": {
  6484. "type": "number"
  6485. }
  6486. },
  6487. "required": ["start", "end"]
  6488. },
  6489. "attachments": {
  6490. "type": "array",
  6491. "items": {
  6492. "$ref": "#/components/schemas/FilePart"
  6493. }
  6494. }
  6495. },
  6496. "required": ["status", "input", "output", "title", "metadata", "time"]
  6497. },
  6498. "ToolStateError": {
  6499. "type": "object",
  6500. "properties": {
  6501. "status": {
  6502. "type": "string",
  6503. "const": "error"
  6504. },
  6505. "input": {
  6506. "type": "object",
  6507. "propertyNames": {
  6508. "type": "string"
  6509. },
  6510. "additionalProperties": {}
  6511. },
  6512. "error": {
  6513. "type": "string"
  6514. },
  6515. "metadata": {
  6516. "type": "object",
  6517. "propertyNames": {
  6518. "type": "string"
  6519. },
  6520. "additionalProperties": {}
  6521. },
  6522. "time": {
  6523. "type": "object",
  6524. "properties": {
  6525. "start": {
  6526. "type": "number"
  6527. },
  6528. "end": {
  6529. "type": "number"
  6530. }
  6531. },
  6532. "required": ["start", "end"]
  6533. }
  6534. },
  6535. "required": ["status", "input", "error", "time"]
  6536. },
  6537. "ToolState": {
  6538. "anyOf": [
  6539. {
  6540. "$ref": "#/components/schemas/ToolStatePending"
  6541. },
  6542. {
  6543. "$ref": "#/components/schemas/ToolStateRunning"
  6544. },
  6545. {
  6546. "$ref": "#/components/schemas/ToolStateCompleted"
  6547. },
  6548. {
  6549. "$ref": "#/components/schemas/ToolStateError"
  6550. }
  6551. ]
  6552. },
  6553. "ToolPart": {
  6554. "type": "object",
  6555. "properties": {
  6556. "id": {
  6557. "type": "string"
  6558. },
  6559. "sessionID": {
  6560. "type": "string"
  6561. },
  6562. "messageID": {
  6563. "type": "string"
  6564. },
  6565. "type": {
  6566. "type": "string",
  6567. "const": "tool"
  6568. },
  6569. "callID": {
  6570. "type": "string"
  6571. },
  6572. "tool": {
  6573. "type": "string"
  6574. },
  6575. "state": {
  6576. "$ref": "#/components/schemas/ToolState"
  6577. },
  6578. "metadata": {
  6579. "type": "object",
  6580. "propertyNames": {
  6581. "type": "string"
  6582. },
  6583. "additionalProperties": {}
  6584. }
  6585. },
  6586. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  6587. },
  6588. "StepStartPart": {
  6589. "type": "object",
  6590. "properties": {
  6591. "id": {
  6592. "type": "string"
  6593. },
  6594. "sessionID": {
  6595. "type": "string"
  6596. },
  6597. "messageID": {
  6598. "type": "string"
  6599. },
  6600. "type": {
  6601. "type": "string",
  6602. "const": "step-start"
  6603. },
  6604. "snapshot": {
  6605. "type": "string"
  6606. }
  6607. },
  6608. "required": ["id", "sessionID", "messageID", "type"]
  6609. },
  6610. "StepFinishPart": {
  6611. "type": "object",
  6612. "properties": {
  6613. "id": {
  6614. "type": "string"
  6615. },
  6616. "sessionID": {
  6617. "type": "string"
  6618. },
  6619. "messageID": {
  6620. "type": "string"
  6621. },
  6622. "type": {
  6623. "type": "string",
  6624. "const": "step-finish"
  6625. },
  6626. "reason": {
  6627. "type": "string"
  6628. },
  6629. "snapshot": {
  6630. "type": "string"
  6631. },
  6632. "cost": {
  6633. "type": "number"
  6634. },
  6635. "tokens": {
  6636. "type": "object",
  6637. "properties": {
  6638. "input": {
  6639. "type": "number"
  6640. },
  6641. "output": {
  6642. "type": "number"
  6643. },
  6644. "reasoning": {
  6645. "type": "number"
  6646. },
  6647. "cache": {
  6648. "type": "object",
  6649. "properties": {
  6650. "read": {
  6651. "type": "number"
  6652. },
  6653. "write": {
  6654. "type": "number"
  6655. }
  6656. },
  6657. "required": ["read", "write"]
  6658. }
  6659. },
  6660. "required": ["input", "output", "reasoning", "cache"]
  6661. }
  6662. },
  6663. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  6664. },
  6665. "SnapshotPart": {
  6666. "type": "object",
  6667. "properties": {
  6668. "id": {
  6669. "type": "string"
  6670. },
  6671. "sessionID": {
  6672. "type": "string"
  6673. },
  6674. "messageID": {
  6675. "type": "string"
  6676. },
  6677. "type": {
  6678. "type": "string",
  6679. "const": "snapshot"
  6680. },
  6681. "snapshot": {
  6682. "type": "string"
  6683. }
  6684. },
  6685. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  6686. },
  6687. "PatchPart": {
  6688. "type": "object",
  6689. "properties": {
  6690. "id": {
  6691. "type": "string"
  6692. },
  6693. "sessionID": {
  6694. "type": "string"
  6695. },
  6696. "messageID": {
  6697. "type": "string"
  6698. },
  6699. "type": {
  6700. "type": "string",
  6701. "const": "patch"
  6702. },
  6703. "hash": {
  6704. "type": "string"
  6705. },
  6706. "files": {
  6707. "type": "array",
  6708. "items": {
  6709. "type": "string"
  6710. }
  6711. }
  6712. },
  6713. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  6714. },
  6715. "AgentPart": {
  6716. "type": "object",
  6717. "properties": {
  6718. "id": {
  6719. "type": "string"
  6720. },
  6721. "sessionID": {
  6722. "type": "string"
  6723. },
  6724. "messageID": {
  6725. "type": "string"
  6726. },
  6727. "type": {
  6728. "type": "string",
  6729. "const": "agent"
  6730. },
  6731. "name": {
  6732. "type": "string"
  6733. },
  6734. "source": {
  6735. "type": "object",
  6736. "properties": {
  6737. "value": {
  6738. "type": "string"
  6739. },
  6740. "start": {
  6741. "type": "integer",
  6742. "minimum": -9007199254740991,
  6743. "maximum": 9007199254740991
  6744. },
  6745. "end": {
  6746. "type": "integer",
  6747. "minimum": -9007199254740991,
  6748. "maximum": 9007199254740991
  6749. }
  6750. },
  6751. "required": ["value", "start", "end"]
  6752. }
  6753. },
  6754. "required": ["id", "sessionID", "messageID", "type", "name"]
  6755. },
  6756. "RetryPart": {
  6757. "type": "object",
  6758. "properties": {
  6759. "id": {
  6760. "type": "string"
  6761. },
  6762. "sessionID": {
  6763. "type": "string"
  6764. },
  6765. "messageID": {
  6766. "type": "string"
  6767. },
  6768. "type": {
  6769. "type": "string",
  6770. "const": "retry"
  6771. },
  6772. "attempt": {
  6773. "type": "number"
  6774. },
  6775. "error": {
  6776. "$ref": "#/components/schemas/APIError"
  6777. },
  6778. "time": {
  6779. "type": "object",
  6780. "properties": {
  6781. "created": {
  6782. "type": "number"
  6783. }
  6784. },
  6785. "required": ["created"]
  6786. }
  6787. },
  6788. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  6789. },
  6790. "CompactionPart": {
  6791. "type": "object",
  6792. "properties": {
  6793. "id": {
  6794. "type": "string"
  6795. },
  6796. "sessionID": {
  6797. "type": "string"
  6798. },
  6799. "messageID": {
  6800. "type": "string"
  6801. },
  6802. "type": {
  6803. "type": "string",
  6804. "const": "compaction"
  6805. },
  6806. "auto": {
  6807. "type": "boolean"
  6808. }
  6809. },
  6810. "required": ["id", "sessionID", "messageID", "type", "auto"]
  6811. },
  6812. "Part": {
  6813. "anyOf": [
  6814. {
  6815. "$ref": "#/components/schemas/TextPart"
  6816. },
  6817. {
  6818. "type": "object",
  6819. "properties": {
  6820. "id": {
  6821. "type": "string"
  6822. },
  6823. "sessionID": {
  6824. "type": "string"
  6825. },
  6826. "messageID": {
  6827. "type": "string"
  6828. },
  6829. "type": {
  6830. "type": "string",
  6831. "const": "subtask"
  6832. },
  6833. "prompt": {
  6834. "type": "string"
  6835. },
  6836. "description": {
  6837. "type": "string"
  6838. },
  6839. "agent": {
  6840. "type": "string"
  6841. },
  6842. "command": {
  6843. "type": "string"
  6844. }
  6845. },
  6846. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  6847. },
  6848. {
  6849. "$ref": "#/components/schemas/ReasoningPart"
  6850. },
  6851. {
  6852. "$ref": "#/components/schemas/FilePart"
  6853. },
  6854. {
  6855. "$ref": "#/components/schemas/ToolPart"
  6856. },
  6857. {
  6858. "$ref": "#/components/schemas/StepStartPart"
  6859. },
  6860. {
  6861. "$ref": "#/components/schemas/StepFinishPart"
  6862. },
  6863. {
  6864. "$ref": "#/components/schemas/SnapshotPart"
  6865. },
  6866. {
  6867. "$ref": "#/components/schemas/PatchPart"
  6868. },
  6869. {
  6870. "$ref": "#/components/schemas/AgentPart"
  6871. },
  6872. {
  6873. "$ref": "#/components/schemas/RetryPart"
  6874. },
  6875. {
  6876. "$ref": "#/components/schemas/CompactionPart"
  6877. }
  6878. ]
  6879. },
  6880. "Event.message.part.updated": {
  6881. "type": "object",
  6882. "properties": {
  6883. "type": {
  6884. "type": "string",
  6885. "const": "message.part.updated"
  6886. },
  6887. "properties": {
  6888. "type": "object",
  6889. "properties": {
  6890. "part": {
  6891. "$ref": "#/components/schemas/Part"
  6892. },
  6893. "delta": {
  6894. "type": "string"
  6895. }
  6896. },
  6897. "required": ["part"]
  6898. }
  6899. },
  6900. "required": ["type", "properties"]
  6901. },
  6902. "Event.message.part.removed": {
  6903. "type": "object",
  6904. "properties": {
  6905. "type": {
  6906. "type": "string",
  6907. "const": "message.part.removed"
  6908. },
  6909. "properties": {
  6910. "type": "object",
  6911. "properties": {
  6912. "sessionID": {
  6913. "type": "string"
  6914. },
  6915. "messageID": {
  6916. "type": "string"
  6917. },
  6918. "partID": {
  6919. "type": "string"
  6920. }
  6921. },
  6922. "required": ["sessionID", "messageID", "partID"]
  6923. }
  6924. },
  6925. "required": ["type", "properties"]
  6926. },
  6927. "PermissionRequest": {
  6928. "type": "object",
  6929. "properties": {
  6930. "id": {
  6931. "type": "string",
  6932. "pattern": "^per.*"
  6933. },
  6934. "sessionID": {
  6935. "type": "string",
  6936. "pattern": "^ses.*"
  6937. },
  6938. "permission": {
  6939. "type": "string"
  6940. },
  6941. "patterns": {
  6942. "type": "array",
  6943. "items": {
  6944. "type": "string"
  6945. }
  6946. },
  6947. "metadata": {
  6948. "type": "object",
  6949. "propertyNames": {
  6950. "type": "string"
  6951. },
  6952. "additionalProperties": {}
  6953. },
  6954. "always": {
  6955. "type": "array",
  6956. "items": {
  6957. "type": "string"
  6958. }
  6959. },
  6960. "tool": {
  6961. "type": "object",
  6962. "properties": {
  6963. "messageID": {
  6964. "type": "string"
  6965. },
  6966. "callID": {
  6967. "type": "string"
  6968. }
  6969. },
  6970. "required": ["messageID", "callID"]
  6971. }
  6972. },
  6973. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  6974. },
  6975. "Event.permission.asked": {
  6976. "type": "object",
  6977. "properties": {
  6978. "type": {
  6979. "type": "string",
  6980. "const": "permission.asked"
  6981. },
  6982. "properties": {
  6983. "$ref": "#/components/schemas/PermissionRequest"
  6984. }
  6985. },
  6986. "required": ["type", "properties"]
  6987. },
  6988. "Event.permission.replied": {
  6989. "type": "object",
  6990. "properties": {
  6991. "type": {
  6992. "type": "string",
  6993. "const": "permission.replied"
  6994. },
  6995. "properties": {
  6996. "type": "object",
  6997. "properties": {
  6998. "sessionID": {
  6999. "type": "string"
  7000. },
  7001. "requestID": {
  7002. "type": "string"
  7003. },
  7004. "reply": {
  7005. "type": "string",
  7006. "enum": ["once", "always", "reject"]
  7007. }
  7008. },
  7009. "required": ["sessionID", "requestID", "reply"]
  7010. }
  7011. },
  7012. "required": ["type", "properties"]
  7013. },
  7014. "SessionStatus": {
  7015. "anyOf": [
  7016. {
  7017. "type": "object",
  7018. "properties": {
  7019. "type": {
  7020. "type": "string",
  7021. "const": "idle"
  7022. }
  7023. },
  7024. "required": ["type"]
  7025. },
  7026. {
  7027. "type": "object",
  7028. "properties": {
  7029. "type": {
  7030. "type": "string",
  7031. "const": "retry"
  7032. },
  7033. "attempt": {
  7034. "type": "number"
  7035. },
  7036. "message": {
  7037. "type": "string"
  7038. },
  7039. "next": {
  7040. "type": "number"
  7041. }
  7042. },
  7043. "required": ["type", "attempt", "message", "next"]
  7044. },
  7045. {
  7046. "type": "object",
  7047. "properties": {
  7048. "type": {
  7049. "type": "string",
  7050. "const": "busy"
  7051. }
  7052. },
  7053. "required": ["type"]
  7054. }
  7055. ]
  7056. },
  7057. "Event.session.status": {
  7058. "type": "object",
  7059. "properties": {
  7060. "type": {
  7061. "type": "string",
  7062. "const": "session.status"
  7063. },
  7064. "properties": {
  7065. "type": "object",
  7066. "properties": {
  7067. "sessionID": {
  7068. "type": "string"
  7069. },
  7070. "status": {
  7071. "$ref": "#/components/schemas/SessionStatus"
  7072. }
  7073. },
  7074. "required": ["sessionID", "status"]
  7075. }
  7076. },
  7077. "required": ["type", "properties"]
  7078. },
  7079. "Event.session.idle": {
  7080. "type": "object",
  7081. "properties": {
  7082. "type": {
  7083. "type": "string",
  7084. "const": "session.idle"
  7085. },
  7086. "properties": {
  7087. "type": "object",
  7088. "properties": {
  7089. "sessionID": {
  7090. "type": "string"
  7091. }
  7092. },
  7093. "required": ["sessionID"]
  7094. }
  7095. },
  7096. "required": ["type", "properties"]
  7097. },
  7098. "QuestionOption": {
  7099. "type": "object",
  7100. "properties": {
  7101. "label": {
  7102. "description": "Display text (1-5 words, concise)",
  7103. "type": "string"
  7104. },
  7105. "description": {
  7106. "description": "Explanation of choice",
  7107. "type": "string"
  7108. }
  7109. },
  7110. "required": ["label", "description"]
  7111. },
  7112. "QuestionInfo": {
  7113. "type": "object",
  7114. "properties": {
  7115. "question": {
  7116. "description": "Complete question",
  7117. "type": "string"
  7118. },
  7119. "header": {
  7120. "description": "Very short label (max 12 chars)",
  7121. "type": "string",
  7122. "maxLength": 12
  7123. },
  7124. "options": {
  7125. "description": "Available choices",
  7126. "type": "array",
  7127. "items": {
  7128. "$ref": "#/components/schemas/QuestionOption"
  7129. }
  7130. },
  7131. "multiple": {
  7132. "description": "Allow selecting multiple choices",
  7133. "type": "boolean"
  7134. },
  7135. "custom": {
  7136. "description": "Allow typing a custom answer (default: true)",
  7137. "type": "boolean"
  7138. }
  7139. },
  7140. "required": ["question", "header", "options"]
  7141. },
  7142. "QuestionRequest": {
  7143. "type": "object",
  7144. "properties": {
  7145. "id": {
  7146. "type": "string",
  7147. "pattern": "^que.*"
  7148. },
  7149. "sessionID": {
  7150. "type": "string",
  7151. "pattern": "^ses.*"
  7152. },
  7153. "questions": {
  7154. "description": "Questions to ask",
  7155. "type": "array",
  7156. "items": {
  7157. "$ref": "#/components/schemas/QuestionInfo"
  7158. }
  7159. },
  7160. "tool": {
  7161. "type": "object",
  7162. "properties": {
  7163. "messageID": {
  7164. "type": "string"
  7165. },
  7166. "callID": {
  7167. "type": "string"
  7168. }
  7169. },
  7170. "required": ["messageID", "callID"]
  7171. }
  7172. },
  7173. "required": ["id", "sessionID", "questions"]
  7174. },
  7175. "Event.question.asked": {
  7176. "type": "object",
  7177. "properties": {
  7178. "type": {
  7179. "type": "string",
  7180. "const": "question.asked"
  7181. },
  7182. "properties": {
  7183. "$ref": "#/components/schemas/QuestionRequest"
  7184. }
  7185. },
  7186. "required": ["type", "properties"]
  7187. },
  7188. "QuestionAnswer": {
  7189. "type": "array",
  7190. "items": {
  7191. "type": "string"
  7192. }
  7193. },
  7194. "Event.question.replied": {
  7195. "type": "object",
  7196. "properties": {
  7197. "type": {
  7198. "type": "string",
  7199. "const": "question.replied"
  7200. },
  7201. "properties": {
  7202. "type": "object",
  7203. "properties": {
  7204. "sessionID": {
  7205. "type": "string"
  7206. },
  7207. "requestID": {
  7208. "type": "string"
  7209. },
  7210. "answers": {
  7211. "type": "array",
  7212. "items": {
  7213. "$ref": "#/components/schemas/QuestionAnswer"
  7214. }
  7215. }
  7216. },
  7217. "required": ["sessionID", "requestID", "answers"]
  7218. }
  7219. },
  7220. "required": ["type", "properties"]
  7221. },
  7222. "Event.question.rejected": {
  7223. "type": "object",
  7224. "properties": {
  7225. "type": {
  7226. "type": "string",
  7227. "const": "question.rejected"
  7228. },
  7229. "properties": {
  7230. "type": "object",
  7231. "properties": {
  7232. "sessionID": {
  7233. "type": "string"
  7234. },
  7235. "requestID": {
  7236. "type": "string"
  7237. }
  7238. },
  7239. "required": ["sessionID", "requestID"]
  7240. }
  7241. },
  7242. "required": ["type", "properties"]
  7243. },
  7244. "Event.session.compacted": {
  7245. "type": "object",
  7246. "properties": {
  7247. "type": {
  7248. "type": "string",
  7249. "const": "session.compacted"
  7250. },
  7251. "properties": {
  7252. "type": "object",
  7253. "properties": {
  7254. "sessionID": {
  7255. "type": "string"
  7256. }
  7257. },
  7258. "required": ["sessionID"]
  7259. }
  7260. },
  7261. "required": ["type", "properties"]
  7262. },
  7263. "Event.file.edited": {
  7264. "type": "object",
  7265. "properties": {
  7266. "type": {
  7267. "type": "string",
  7268. "const": "file.edited"
  7269. },
  7270. "properties": {
  7271. "type": "object",
  7272. "properties": {
  7273. "file": {
  7274. "type": "string"
  7275. }
  7276. },
  7277. "required": ["file"]
  7278. }
  7279. },
  7280. "required": ["type", "properties"]
  7281. },
  7282. "Todo": {
  7283. "type": "object",
  7284. "properties": {
  7285. "content": {
  7286. "description": "Brief description of the task",
  7287. "type": "string"
  7288. },
  7289. "status": {
  7290. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  7291. "type": "string"
  7292. },
  7293. "priority": {
  7294. "description": "Priority level of the task: high, medium, low",
  7295. "type": "string"
  7296. },
  7297. "id": {
  7298. "description": "Unique identifier for the todo item",
  7299. "type": "string"
  7300. }
  7301. },
  7302. "required": ["content", "status", "priority", "id"]
  7303. },
  7304. "Event.todo.updated": {
  7305. "type": "object",
  7306. "properties": {
  7307. "type": {
  7308. "type": "string",
  7309. "const": "todo.updated"
  7310. },
  7311. "properties": {
  7312. "type": "object",
  7313. "properties": {
  7314. "sessionID": {
  7315. "type": "string"
  7316. },
  7317. "todos": {
  7318. "type": "array",
  7319. "items": {
  7320. "$ref": "#/components/schemas/Todo"
  7321. }
  7322. }
  7323. },
  7324. "required": ["sessionID", "todos"]
  7325. }
  7326. },
  7327. "required": ["type", "properties"]
  7328. },
  7329. "Event.tui.prompt.append": {
  7330. "type": "object",
  7331. "properties": {
  7332. "type": {
  7333. "type": "string",
  7334. "const": "tui.prompt.append"
  7335. },
  7336. "properties": {
  7337. "type": "object",
  7338. "properties": {
  7339. "text": {
  7340. "type": "string"
  7341. }
  7342. },
  7343. "required": ["text"]
  7344. }
  7345. },
  7346. "required": ["type", "properties"]
  7347. },
  7348. "Event.tui.command.execute": {
  7349. "type": "object",
  7350. "properties": {
  7351. "type": {
  7352. "type": "string",
  7353. "const": "tui.command.execute"
  7354. },
  7355. "properties": {
  7356. "type": "object",
  7357. "properties": {
  7358. "command": {
  7359. "anyOf": [
  7360. {
  7361. "type": "string",
  7362. "enum": [
  7363. "session.list",
  7364. "session.new",
  7365. "session.share",
  7366. "session.interrupt",
  7367. "session.compact",
  7368. "session.page.up",
  7369. "session.page.down",
  7370. "session.half.page.up",
  7371. "session.half.page.down",
  7372. "session.first",
  7373. "session.last",
  7374. "prompt.clear",
  7375. "prompt.submit",
  7376. "agent.cycle"
  7377. ]
  7378. },
  7379. {
  7380. "type": "string"
  7381. }
  7382. ]
  7383. }
  7384. },
  7385. "required": ["command"]
  7386. }
  7387. },
  7388. "required": ["type", "properties"]
  7389. },
  7390. "Event.tui.toast.show": {
  7391. "type": "object",
  7392. "properties": {
  7393. "type": {
  7394. "type": "string",
  7395. "const": "tui.toast.show"
  7396. },
  7397. "properties": {
  7398. "type": "object",
  7399. "properties": {
  7400. "title": {
  7401. "type": "string"
  7402. },
  7403. "message": {
  7404. "type": "string"
  7405. },
  7406. "variant": {
  7407. "type": "string",
  7408. "enum": ["info", "success", "warning", "error"]
  7409. },
  7410. "duration": {
  7411. "description": "Duration in milliseconds",
  7412. "default": 5000,
  7413. "type": "number"
  7414. }
  7415. },
  7416. "required": ["message", "variant"]
  7417. }
  7418. },
  7419. "required": ["type", "properties"]
  7420. },
  7421. "Event.tui.session.select": {
  7422. "type": "object",
  7423. "properties": {
  7424. "type": {
  7425. "type": "string",
  7426. "const": "tui.session.select"
  7427. },
  7428. "properties": {
  7429. "type": "object",
  7430. "properties": {
  7431. "sessionID": {
  7432. "description": "Session ID to navigate to",
  7433. "type": "string",
  7434. "pattern": "^ses"
  7435. }
  7436. },
  7437. "required": ["sessionID"]
  7438. }
  7439. },
  7440. "required": ["type", "properties"]
  7441. },
  7442. "Event.mcp.tools.changed": {
  7443. "type": "object",
  7444. "properties": {
  7445. "type": {
  7446. "type": "string",
  7447. "const": "mcp.tools.changed"
  7448. },
  7449. "properties": {
  7450. "type": "object",
  7451. "properties": {
  7452. "server": {
  7453. "type": "string"
  7454. }
  7455. },
  7456. "required": ["server"]
  7457. }
  7458. },
  7459. "required": ["type", "properties"]
  7460. },
  7461. "Event.command.executed": {
  7462. "type": "object",
  7463. "properties": {
  7464. "type": {
  7465. "type": "string",
  7466. "const": "command.executed"
  7467. },
  7468. "properties": {
  7469. "type": "object",
  7470. "properties": {
  7471. "name": {
  7472. "type": "string"
  7473. },
  7474. "sessionID": {
  7475. "type": "string",
  7476. "pattern": "^ses.*"
  7477. },
  7478. "arguments": {
  7479. "type": "string"
  7480. },
  7481. "messageID": {
  7482. "type": "string",
  7483. "pattern": "^msg.*"
  7484. }
  7485. },
  7486. "required": ["name", "sessionID", "arguments", "messageID"]
  7487. }
  7488. },
  7489. "required": ["type", "properties"]
  7490. },
  7491. "PermissionAction": {
  7492. "type": "string",
  7493. "enum": ["allow", "deny", "ask"]
  7494. },
  7495. "PermissionRule": {
  7496. "type": "object",
  7497. "properties": {
  7498. "permission": {
  7499. "type": "string"
  7500. },
  7501. "pattern": {
  7502. "type": "string"
  7503. },
  7504. "action": {
  7505. "$ref": "#/components/schemas/PermissionAction"
  7506. }
  7507. },
  7508. "required": ["permission", "pattern", "action"]
  7509. },
  7510. "PermissionRuleset": {
  7511. "type": "array",
  7512. "items": {
  7513. "$ref": "#/components/schemas/PermissionRule"
  7514. }
  7515. },
  7516. "Session": {
  7517. "type": "object",
  7518. "properties": {
  7519. "id": {
  7520. "type": "string",
  7521. "pattern": "^ses.*"
  7522. },
  7523. "slug": {
  7524. "type": "string"
  7525. },
  7526. "projectID": {
  7527. "type": "string"
  7528. },
  7529. "directory": {
  7530. "type": "string"
  7531. },
  7532. "parentID": {
  7533. "type": "string",
  7534. "pattern": "^ses.*"
  7535. },
  7536. "summary": {
  7537. "type": "object",
  7538. "properties": {
  7539. "additions": {
  7540. "type": "number"
  7541. },
  7542. "deletions": {
  7543. "type": "number"
  7544. },
  7545. "files": {
  7546. "type": "number"
  7547. },
  7548. "diffs": {
  7549. "type": "array",
  7550. "items": {
  7551. "$ref": "#/components/schemas/FileDiff"
  7552. }
  7553. }
  7554. },
  7555. "required": ["additions", "deletions", "files"]
  7556. },
  7557. "share": {
  7558. "type": "object",
  7559. "properties": {
  7560. "url": {
  7561. "type": "string"
  7562. }
  7563. },
  7564. "required": ["url"]
  7565. },
  7566. "title": {
  7567. "type": "string"
  7568. },
  7569. "version": {
  7570. "type": "string"
  7571. },
  7572. "time": {
  7573. "type": "object",
  7574. "properties": {
  7575. "created": {
  7576. "type": "number"
  7577. },
  7578. "updated": {
  7579. "type": "number"
  7580. },
  7581. "compacting": {
  7582. "type": "number"
  7583. },
  7584. "archived": {
  7585. "type": "number"
  7586. }
  7587. },
  7588. "required": ["created", "updated"]
  7589. },
  7590. "permission": {
  7591. "$ref": "#/components/schemas/PermissionRuleset"
  7592. },
  7593. "revert": {
  7594. "type": "object",
  7595. "properties": {
  7596. "messageID": {
  7597. "type": "string"
  7598. },
  7599. "partID": {
  7600. "type": "string"
  7601. },
  7602. "snapshot": {
  7603. "type": "string"
  7604. },
  7605. "diff": {
  7606. "type": "string"
  7607. }
  7608. },
  7609. "required": ["messageID"]
  7610. }
  7611. },
  7612. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  7613. },
  7614. "Event.session.created": {
  7615. "type": "object",
  7616. "properties": {
  7617. "type": {
  7618. "type": "string",
  7619. "const": "session.created"
  7620. },
  7621. "properties": {
  7622. "type": "object",
  7623. "properties": {
  7624. "info": {
  7625. "$ref": "#/components/schemas/Session"
  7626. }
  7627. },
  7628. "required": ["info"]
  7629. }
  7630. },
  7631. "required": ["type", "properties"]
  7632. },
  7633. "Event.session.updated": {
  7634. "type": "object",
  7635. "properties": {
  7636. "type": {
  7637. "type": "string",
  7638. "const": "session.updated"
  7639. },
  7640. "properties": {
  7641. "type": "object",
  7642. "properties": {
  7643. "info": {
  7644. "$ref": "#/components/schemas/Session"
  7645. }
  7646. },
  7647. "required": ["info"]
  7648. }
  7649. },
  7650. "required": ["type", "properties"]
  7651. },
  7652. "Event.session.deleted": {
  7653. "type": "object",
  7654. "properties": {
  7655. "type": {
  7656. "type": "string",
  7657. "const": "session.deleted"
  7658. },
  7659. "properties": {
  7660. "type": "object",
  7661. "properties": {
  7662. "info": {
  7663. "$ref": "#/components/schemas/Session"
  7664. }
  7665. },
  7666. "required": ["info"]
  7667. }
  7668. },
  7669. "required": ["type", "properties"]
  7670. },
  7671. "Event.session.diff": {
  7672. "type": "object",
  7673. "properties": {
  7674. "type": {
  7675. "type": "string",
  7676. "const": "session.diff"
  7677. },
  7678. "properties": {
  7679. "type": "object",
  7680. "properties": {
  7681. "sessionID": {
  7682. "type": "string"
  7683. },
  7684. "diff": {
  7685. "type": "array",
  7686. "items": {
  7687. "$ref": "#/components/schemas/FileDiff"
  7688. }
  7689. }
  7690. },
  7691. "required": ["sessionID", "diff"]
  7692. }
  7693. },
  7694. "required": ["type", "properties"]
  7695. },
  7696. "Event.session.error": {
  7697. "type": "object",
  7698. "properties": {
  7699. "type": {
  7700. "type": "string",
  7701. "const": "session.error"
  7702. },
  7703. "properties": {
  7704. "type": "object",
  7705. "properties": {
  7706. "sessionID": {
  7707. "type": "string"
  7708. },
  7709. "error": {
  7710. "anyOf": [
  7711. {
  7712. "$ref": "#/components/schemas/ProviderAuthError"
  7713. },
  7714. {
  7715. "$ref": "#/components/schemas/UnknownError"
  7716. },
  7717. {
  7718. "$ref": "#/components/schemas/MessageOutputLengthError"
  7719. },
  7720. {
  7721. "$ref": "#/components/schemas/MessageAbortedError"
  7722. },
  7723. {
  7724. "$ref": "#/components/schemas/APIError"
  7725. }
  7726. ]
  7727. }
  7728. }
  7729. }
  7730. },
  7731. "required": ["type", "properties"]
  7732. },
  7733. "Event.file.watcher.updated": {
  7734. "type": "object",
  7735. "properties": {
  7736. "type": {
  7737. "type": "string",
  7738. "const": "file.watcher.updated"
  7739. },
  7740. "properties": {
  7741. "type": "object",
  7742. "properties": {
  7743. "file": {
  7744. "type": "string"
  7745. },
  7746. "event": {
  7747. "anyOf": [
  7748. {
  7749. "type": "string",
  7750. "const": "add"
  7751. },
  7752. {
  7753. "type": "string",
  7754. "const": "change"
  7755. },
  7756. {
  7757. "type": "string",
  7758. "const": "unlink"
  7759. }
  7760. ]
  7761. }
  7762. },
  7763. "required": ["file", "event"]
  7764. }
  7765. },
  7766. "required": ["type", "properties"]
  7767. },
  7768. "Event.vcs.branch.updated": {
  7769. "type": "object",
  7770. "properties": {
  7771. "type": {
  7772. "type": "string",
  7773. "const": "vcs.branch.updated"
  7774. },
  7775. "properties": {
  7776. "type": "object",
  7777. "properties": {
  7778. "branch": {
  7779. "type": "string"
  7780. }
  7781. }
  7782. }
  7783. },
  7784. "required": ["type", "properties"]
  7785. },
  7786. "Pty": {
  7787. "type": "object",
  7788. "properties": {
  7789. "id": {
  7790. "type": "string",
  7791. "pattern": "^pty.*"
  7792. },
  7793. "title": {
  7794. "type": "string"
  7795. },
  7796. "command": {
  7797. "type": "string"
  7798. },
  7799. "args": {
  7800. "type": "array",
  7801. "items": {
  7802. "type": "string"
  7803. }
  7804. },
  7805. "cwd": {
  7806. "type": "string"
  7807. },
  7808. "status": {
  7809. "type": "string",
  7810. "enum": ["running", "exited"]
  7811. },
  7812. "pid": {
  7813. "type": "number"
  7814. }
  7815. },
  7816. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  7817. },
  7818. "Event.pty.created": {
  7819. "type": "object",
  7820. "properties": {
  7821. "type": {
  7822. "type": "string",
  7823. "const": "pty.created"
  7824. },
  7825. "properties": {
  7826. "type": "object",
  7827. "properties": {
  7828. "info": {
  7829. "$ref": "#/components/schemas/Pty"
  7830. }
  7831. },
  7832. "required": ["info"]
  7833. }
  7834. },
  7835. "required": ["type", "properties"]
  7836. },
  7837. "Event.pty.updated": {
  7838. "type": "object",
  7839. "properties": {
  7840. "type": {
  7841. "type": "string",
  7842. "const": "pty.updated"
  7843. },
  7844. "properties": {
  7845. "type": "object",
  7846. "properties": {
  7847. "info": {
  7848. "$ref": "#/components/schemas/Pty"
  7849. }
  7850. },
  7851. "required": ["info"]
  7852. }
  7853. },
  7854. "required": ["type", "properties"]
  7855. },
  7856. "Event.pty.exited": {
  7857. "type": "object",
  7858. "properties": {
  7859. "type": {
  7860. "type": "string",
  7861. "const": "pty.exited"
  7862. },
  7863. "properties": {
  7864. "type": "object",
  7865. "properties": {
  7866. "id": {
  7867. "type": "string",
  7868. "pattern": "^pty.*"
  7869. },
  7870. "exitCode": {
  7871. "type": "number"
  7872. }
  7873. },
  7874. "required": ["id", "exitCode"]
  7875. }
  7876. },
  7877. "required": ["type", "properties"]
  7878. },
  7879. "Event.pty.deleted": {
  7880. "type": "object",
  7881. "properties": {
  7882. "type": {
  7883. "type": "string",
  7884. "const": "pty.deleted"
  7885. },
  7886. "properties": {
  7887. "type": "object",
  7888. "properties": {
  7889. "id": {
  7890. "type": "string",
  7891. "pattern": "^pty.*"
  7892. }
  7893. },
  7894. "required": ["id"]
  7895. }
  7896. },
  7897. "required": ["type", "properties"]
  7898. },
  7899. "Event.server.connected": {
  7900. "type": "object",
  7901. "properties": {
  7902. "type": {
  7903. "type": "string",
  7904. "const": "server.connected"
  7905. },
  7906. "properties": {
  7907. "type": "object",
  7908. "properties": {}
  7909. }
  7910. },
  7911. "required": ["type", "properties"]
  7912. },
  7913. "Event.global.disposed": {
  7914. "type": "object",
  7915. "properties": {
  7916. "type": {
  7917. "type": "string",
  7918. "const": "global.disposed"
  7919. },
  7920. "properties": {
  7921. "type": "object",
  7922. "properties": {}
  7923. }
  7924. },
  7925. "required": ["type", "properties"]
  7926. },
  7927. "Event": {
  7928. "anyOf": [
  7929. {
  7930. "$ref": "#/components/schemas/Event.installation.updated"
  7931. },
  7932. {
  7933. "$ref": "#/components/schemas/Event.installation.update-available"
  7934. },
  7935. {
  7936. "$ref": "#/components/schemas/Event.project.updated"
  7937. },
  7938. {
  7939. "$ref": "#/components/schemas/Event.server.instance.disposed"
  7940. },
  7941. {
  7942. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  7943. },
  7944. {
  7945. "$ref": "#/components/schemas/Event.lsp.updated"
  7946. },
  7947. {
  7948. "$ref": "#/components/schemas/Event.message.updated"
  7949. },
  7950. {
  7951. "$ref": "#/components/schemas/Event.message.removed"
  7952. },
  7953. {
  7954. "$ref": "#/components/schemas/Event.message.part.updated"
  7955. },
  7956. {
  7957. "$ref": "#/components/schemas/Event.message.part.removed"
  7958. },
  7959. {
  7960. "$ref": "#/components/schemas/Event.permission.asked"
  7961. },
  7962. {
  7963. "$ref": "#/components/schemas/Event.permission.replied"
  7964. },
  7965. {
  7966. "$ref": "#/components/schemas/Event.session.status"
  7967. },
  7968. {
  7969. "$ref": "#/components/schemas/Event.session.idle"
  7970. },
  7971. {
  7972. "$ref": "#/components/schemas/Event.question.asked"
  7973. },
  7974. {
  7975. "$ref": "#/components/schemas/Event.question.replied"
  7976. },
  7977. {
  7978. "$ref": "#/components/schemas/Event.question.rejected"
  7979. },
  7980. {
  7981. "$ref": "#/components/schemas/Event.session.compacted"
  7982. },
  7983. {
  7984. "$ref": "#/components/schemas/Event.file.edited"
  7985. },
  7986. {
  7987. "$ref": "#/components/schemas/Event.todo.updated"
  7988. },
  7989. {
  7990. "$ref": "#/components/schemas/Event.tui.prompt.append"
  7991. },
  7992. {
  7993. "$ref": "#/components/schemas/Event.tui.command.execute"
  7994. },
  7995. {
  7996. "$ref": "#/components/schemas/Event.tui.toast.show"
  7997. },
  7998. {
  7999. "$ref": "#/components/schemas/Event.tui.session.select"
  8000. },
  8001. {
  8002. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  8003. },
  8004. {
  8005. "$ref": "#/components/schemas/Event.command.executed"
  8006. },
  8007. {
  8008. "$ref": "#/components/schemas/Event.session.created"
  8009. },
  8010. {
  8011. "$ref": "#/components/schemas/Event.session.updated"
  8012. },
  8013. {
  8014. "$ref": "#/components/schemas/Event.session.deleted"
  8015. },
  8016. {
  8017. "$ref": "#/components/schemas/Event.session.diff"
  8018. },
  8019. {
  8020. "$ref": "#/components/schemas/Event.session.error"
  8021. },
  8022. {
  8023. "$ref": "#/components/schemas/Event.file.watcher.updated"
  8024. },
  8025. {
  8026. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  8027. },
  8028. {
  8029. "$ref": "#/components/schemas/Event.pty.created"
  8030. },
  8031. {
  8032. "$ref": "#/components/schemas/Event.pty.updated"
  8033. },
  8034. {
  8035. "$ref": "#/components/schemas/Event.pty.exited"
  8036. },
  8037. {
  8038. "$ref": "#/components/schemas/Event.pty.deleted"
  8039. },
  8040. {
  8041. "$ref": "#/components/schemas/Event.server.connected"
  8042. },
  8043. {
  8044. "$ref": "#/components/schemas/Event.global.disposed"
  8045. }
  8046. ]
  8047. },
  8048. "GlobalEvent": {
  8049. "type": "object",
  8050. "properties": {
  8051. "directory": {
  8052. "type": "string"
  8053. },
  8054. "payload": {
  8055. "$ref": "#/components/schemas/Event"
  8056. }
  8057. },
  8058. "required": ["directory", "payload"]
  8059. },
  8060. "BadRequestError": {
  8061. "type": "object",
  8062. "properties": {
  8063. "data": {},
  8064. "errors": {
  8065. "type": "array",
  8066. "items": {
  8067. "type": "object",
  8068. "propertyNames": {
  8069. "type": "string"
  8070. },
  8071. "additionalProperties": {}
  8072. }
  8073. },
  8074. "success": {
  8075. "type": "boolean",
  8076. "const": false
  8077. }
  8078. },
  8079. "required": ["data", "errors", "success"]
  8080. },
  8081. "NotFoundError": {
  8082. "type": "object",
  8083. "properties": {
  8084. "name": {
  8085. "type": "string",
  8086. "const": "NotFoundError"
  8087. },
  8088. "data": {
  8089. "type": "object",
  8090. "properties": {
  8091. "message": {
  8092. "type": "string"
  8093. }
  8094. },
  8095. "required": ["message"]
  8096. }
  8097. },
  8098. "required": ["name", "data"]
  8099. },
  8100. "KeybindsConfig": {
  8101. "description": "Custom keybind configurations",
  8102. "type": "object",
  8103. "properties": {
  8104. "leader": {
  8105. "description": "Leader key for keybind combinations",
  8106. "default": "ctrl+x",
  8107. "type": "string"
  8108. },
  8109. "app_exit": {
  8110. "description": "Exit the application",
  8111. "default": "ctrl+c,ctrl+d,<leader>q",
  8112. "type": "string"
  8113. },
  8114. "editor_open": {
  8115. "description": "Open external editor",
  8116. "default": "<leader>e",
  8117. "type": "string"
  8118. },
  8119. "theme_list": {
  8120. "description": "List available themes",
  8121. "default": "<leader>t",
  8122. "type": "string"
  8123. },
  8124. "sidebar_toggle": {
  8125. "description": "Toggle sidebar",
  8126. "default": "<leader>b",
  8127. "type": "string"
  8128. },
  8129. "scrollbar_toggle": {
  8130. "description": "Toggle session scrollbar",
  8131. "default": "none",
  8132. "type": "string"
  8133. },
  8134. "username_toggle": {
  8135. "description": "Toggle username visibility",
  8136. "default": "none",
  8137. "type": "string"
  8138. },
  8139. "status_view": {
  8140. "description": "View status",
  8141. "default": "<leader>s",
  8142. "type": "string"
  8143. },
  8144. "session_export": {
  8145. "description": "Export session to editor",
  8146. "default": "<leader>x",
  8147. "type": "string"
  8148. },
  8149. "session_new": {
  8150. "description": "Create a new session",
  8151. "default": "<leader>n",
  8152. "type": "string"
  8153. },
  8154. "session_list": {
  8155. "description": "List all sessions",
  8156. "default": "<leader>l",
  8157. "type": "string"
  8158. },
  8159. "session_timeline": {
  8160. "description": "Show session timeline",
  8161. "default": "<leader>g",
  8162. "type": "string"
  8163. },
  8164. "session_fork": {
  8165. "description": "Fork session from message",
  8166. "default": "none",
  8167. "type": "string"
  8168. },
  8169. "session_rename": {
  8170. "description": "Rename session",
  8171. "default": "ctrl+r",
  8172. "type": "string"
  8173. },
  8174. "session_delete": {
  8175. "description": "Delete session",
  8176. "default": "ctrl+d",
  8177. "type": "string"
  8178. },
  8179. "stash_delete": {
  8180. "description": "Delete stash entry",
  8181. "default": "ctrl+d",
  8182. "type": "string"
  8183. },
  8184. "model_provider_list": {
  8185. "description": "Open provider list from model dialog",
  8186. "default": "ctrl+a",
  8187. "type": "string"
  8188. },
  8189. "model_favorite_toggle": {
  8190. "description": "Toggle model favorite status",
  8191. "default": "ctrl+f",
  8192. "type": "string"
  8193. },
  8194. "session_share": {
  8195. "description": "Share current session",
  8196. "default": "none",
  8197. "type": "string"
  8198. },
  8199. "session_unshare": {
  8200. "description": "Unshare current session",
  8201. "default": "none",
  8202. "type": "string"
  8203. },
  8204. "session_interrupt": {
  8205. "description": "Interrupt current session",
  8206. "default": "escape",
  8207. "type": "string"
  8208. },
  8209. "session_compact": {
  8210. "description": "Compact the session",
  8211. "default": "<leader>c",
  8212. "type": "string"
  8213. },
  8214. "messages_page_up": {
  8215. "description": "Scroll messages up by one page",
  8216. "default": "pageup",
  8217. "type": "string"
  8218. },
  8219. "messages_page_down": {
  8220. "description": "Scroll messages down by one page",
  8221. "default": "pagedown",
  8222. "type": "string"
  8223. },
  8224. "messages_half_page_up": {
  8225. "description": "Scroll messages up by half page",
  8226. "default": "ctrl+alt+u",
  8227. "type": "string"
  8228. },
  8229. "messages_half_page_down": {
  8230. "description": "Scroll messages down by half page",
  8231. "default": "ctrl+alt+d",
  8232. "type": "string"
  8233. },
  8234. "messages_first": {
  8235. "description": "Navigate to first message",
  8236. "default": "ctrl+g,home",
  8237. "type": "string"
  8238. },
  8239. "messages_last": {
  8240. "description": "Navigate to last message",
  8241. "default": "ctrl+alt+g,end",
  8242. "type": "string"
  8243. },
  8244. "messages_next": {
  8245. "description": "Navigate to next message",
  8246. "default": "none",
  8247. "type": "string"
  8248. },
  8249. "messages_previous": {
  8250. "description": "Navigate to previous message",
  8251. "default": "none",
  8252. "type": "string"
  8253. },
  8254. "messages_last_user": {
  8255. "description": "Navigate to last user message",
  8256. "default": "none",
  8257. "type": "string"
  8258. },
  8259. "messages_copy": {
  8260. "description": "Copy message",
  8261. "default": "<leader>y",
  8262. "type": "string"
  8263. },
  8264. "messages_undo": {
  8265. "description": "Undo message",
  8266. "default": "<leader>u",
  8267. "type": "string"
  8268. },
  8269. "messages_redo": {
  8270. "description": "Redo message",
  8271. "default": "<leader>r",
  8272. "type": "string"
  8273. },
  8274. "messages_toggle_conceal": {
  8275. "description": "Toggle code block concealment in messages",
  8276. "default": "<leader>h",
  8277. "type": "string"
  8278. },
  8279. "tool_details": {
  8280. "description": "Toggle tool details visibility",
  8281. "default": "none",
  8282. "type": "string"
  8283. },
  8284. "model_list": {
  8285. "description": "List available models",
  8286. "default": "<leader>m",
  8287. "type": "string"
  8288. },
  8289. "model_cycle_recent": {
  8290. "description": "Next recently used model",
  8291. "default": "f2",
  8292. "type": "string"
  8293. },
  8294. "model_cycle_recent_reverse": {
  8295. "description": "Previous recently used model",
  8296. "default": "shift+f2",
  8297. "type": "string"
  8298. },
  8299. "model_cycle_favorite": {
  8300. "description": "Next favorite model",
  8301. "default": "none",
  8302. "type": "string"
  8303. },
  8304. "model_cycle_favorite_reverse": {
  8305. "description": "Previous favorite model",
  8306. "default": "none",
  8307. "type": "string"
  8308. },
  8309. "command_list": {
  8310. "description": "List available commands",
  8311. "default": "ctrl+p",
  8312. "type": "string"
  8313. },
  8314. "agent_list": {
  8315. "description": "List agents",
  8316. "default": "<leader>a",
  8317. "type": "string"
  8318. },
  8319. "agent_cycle": {
  8320. "description": "Next agent",
  8321. "default": "tab",
  8322. "type": "string"
  8323. },
  8324. "agent_cycle_reverse": {
  8325. "description": "Previous agent",
  8326. "default": "shift+tab",
  8327. "type": "string"
  8328. },
  8329. "variant_cycle": {
  8330. "description": "Cycle model variants",
  8331. "default": "ctrl+t",
  8332. "type": "string"
  8333. },
  8334. "input_clear": {
  8335. "description": "Clear input field",
  8336. "default": "ctrl+c",
  8337. "type": "string"
  8338. },
  8339. "input_paste": {
  8340. "description": "Paste from clipboard",
  8341. "default": "ctrl+v",
  8342. "type": "string"
  8343. },
  8344. "input_submit": {
  8345. "description": "Submit input",
  8346. "default": "return",
  8347. "type": "string"
  8348. },
  8349. "input_newline": {
  8350. "description": "Insert newline in input",
  8351. "default": "shift+return,ctrl+return,alt+return,ctrl+j",
  8352. "type": "string"
  8353. },
  8354. "input_move_left": {
  8355. "description": "Move cursor left in input",
  8356. "default": "left,ctrl+b",
  8357. "type": "string"
  8358. },
  8359. "input_move_right": {
  8360. "description": "Move cursor right in input",
  8361. "default": "right,ctrl+f",
  8362. "type": "string"
  8363. },
  8364. "input_move_up": {
  8365. "description": "Move cursor up in input",
  8366. "default": "up",
  8367. "type": "string"
  8368. },
  8369. "input_move_down": {
  8370. "description": "Move cursor down in input",
  8371. "default": "down",
  8372. "type": "string"
  8373. },
  8374. "input_select_left": {
  8375. "description": "Select left in input",
  8376. "default": "shift+left",
  8377. "type": "string"
  8378. },
  8379. "input_select_right": {
  8380. "description": "Select right in input",
  8381. "default": "shift+right",
  8382. "type": "string"
  8383. },
  8384. "input_select_up": {
  8385. "description": "Select up in input",
  8386. "default": "shift+up",
  8387. "type": "string"
  8388. },
  8389. "input_select_down": {
  8390. "description": "Select down in input",
  8391. "default": "shift+down",
  8392. "type": "string"
  8393. },
  8394. "input_line_home": {
  8395. "description": "Move to start of line in input",
  8396. "default": "ctrl+a",
  8397. "type": "string"
  8398. },
  8399. "input_line_end": {
  8400. "description": "Move to end of line in input",
  8401. "default": "ctrl+e",
  8402. "type": "string"
  8403. },
  8404. "input_select_line_home": {
  8405. "description": "Select to start of line in input",
  8406. "default": "ctrl+shift+a",
  8407. "type": "string"
  8408. },
  8409. "input_select_line_end": {
  8410. "description": "Select to end of line in input",
  8411. "default": "ctrl+shift+e",
  8412. "type": "string"
  8413. },
  8414. "input_visual_line_home": {
  8415. "description": "Move to start of visual line in input",
  8416. "default": "alt+a",
  8417. "type": "string"
  8418. },
  8419. "input_visual_line_end": {
  8420. "description": "Move to end of visual line in input",
  8421. "default": "alt+e",
  8422. "type": "string"
  8423. },
  8424. "input_select_visual_line_home": {
  8425. "description": "Select to start of visual line in input",
  8426. "default": "alt+shift+a",
  8427. "type": "string"
  8428. },
  8429. "input_select_visual_line_end": {
  8430. "description": "Select to end of visual line in input",
  8431. "default": "alt+shift+e",
  8432. "type": "string"
  8433. },
  8434. "input_buffer_home": {
  8435. "description": "Move to start of buffer in input",
  8436. "default": "home",
  8437. "type": "string"
  8438. },
  8439. "input_buffer_end": {
  8440. "description": "Move to end of buffer in input",
  8441. "default": "end",
  8442. "type": "string"
  8443. },
  8444. "input_select_buffer_home": {
  8445. "description": "Select to start of buffer in input",
  8446. "default": "shift+home",
  8447. "type": "string"
  8448. },
  8449. "input_select_buffer_end": {
  8450. "description": "Select to end of buffer in input",
  8451. "default": "shift+end",
  8452. "type": "string"
  8453. },
  8454. "input_delete_line": {
  8455. "description": "Delete line in input",
  8456. "default": "ctrl+shift+d",
  8457. "type": "string"
  8458. },
  8459. "input_delete_to_line_end": {
  8460. "description": "Delete to end of line in input",
  8461. "default": "ctrl+k",
  8462. "type": "string"
  8463. },
  8464. "input_delete_to_line_start": {
  8465. "description": "Delete to start of line in input",
  8466. "default": "ctrl+u",
  8467. "type": "string"
  8468. },
  8469. "input_backspace": {
  8470. "description": "Backspace in input",
  8471. "default": "backspace,shift+backspace",
  8472. "type": "string"
  8473. },
  8474. "input_delete": {
  8475. "description": "Delete character in input",
  8476. "default": "ctrl+d,delete,shift+delete",
  8477. "type": "string"
  8478. },
  8479. "input_undo": {
  8480. "description": "Undo in input",
  8481. "default": "ctrl+-,super+z",
  8482. "type": "string"
  8483. },
  8484. "input_redo": {
  8485. "description": "Redo in input",
  8486. "default": "ctrl+.,super+shift+z",
  8487. "type": "string"
  8488. },
  8489. "input_word_forward": {
  8490. "description": "Move word forward in input",
  8491. "default": "alt+f,alt+right,ctrl+right",
  8492. "type": "string"
  8493. },
  8494. "input_word_backward": {
  8495. "description": "Move word backward in input",
  8496. "default": "alt+b,alt+left,ctrl+left",
  8497. "type": "string"
  8498. },
  8499. "input_select_word_forward": {
  8500. "description": "Select word forward in input",
  8501. "default": "alt+shift+f,alt+shift+right",
  8502. "type": "string"
  8503. },
  8504. "input_select_word_backward": {
  8505. "description": "Select word backward in input",
  8506. "default": "alt+shift+b,alt+shift+left",
  8507. "type": "string"
  8508. },
  8509. "input_delete_word_forward": {
  8510. "description": "Delete word forward in input",
  8511. "default": "alt+d,alt+delete,ctrl+delete",
  8512. "type": "string"
  8513. },
  8514. "input_delete_word_backward": {
  8515. "description": "Delete word backward in input",
  8516. "default": "ctrl+w,ctrl+backspace,alt+backspace",
  8517. "type": "string"
  8518. },
  8519. "history_previous": {
  8520. "description": "Previous history item",
  8521. "default": "up",
  8522. "type": "string"
  8523. },
  8524. "history_next": {
  8525. "description": "Next history item",
  8526. "default": "down",
  8527. "type": "string"
  8528. },
  8529. "session_child_cycle": {
  8530. "description": "Next child session",
  8531. "default": "<leader>right",
  8532. "type": "string"
  8533. },
  8534. "session_child_cycle_reverse": {
  8535. "description": "Previous child session",
  8536. "default": "<leader>left",
  8537. "type": "string"
  8538. },
  8539. "session_parent": {
  8540. "description": "Go to parent session",
  8541. "default": "<leader>up",
  8542. "type": "string"
  8543. },
  8544. "terminal_suspend": {
  8545. "description": "Suspend terminal",
  8546. "default": "ctrl+z",
  8547. "type": "string"
  8548. },
  8549. "terminal_title_toggle": {
  8550. "description": "Toggle terminal title",
  8551. "default": "none",
  8552. "type": "string"
  8553. },
  8554. "tips_toggle": {
  8555. "description": "Toggle tips on home screen",
  8556. "default": "<leader>h",
  8557. "type": "string"
  8558. }
  8559. },
  8560. "additionalProperties": false
  8561. },
  8562. "LogLevel": {
  8563. "description": "Log level",
  8564. "type": "string",
  8565. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  8566. },
  8567. "ServerConfig": {
  8568. "description": "Server configuration for opencode serve and web commands",
  8569. "type": "object",
  8570. "properties": {
  8571. "port": {
  8572. "description": "Port to listen on",
  8573. "type": "integer",
  8574. "exclusiveMinimum": 0,
  8575. "maximum": 9007199254740991
  8576. },
  8577. "hostname": {
  8578. "description": "Hostname to listen on",
  8579. "type": "string"
  8580. },
  8581. "mdns": {
  8582. "description": "Enable mDNS service discovery",
  8583. "type": "boolean"
  8584. },
  8585. "cors": {
  8586. "description": "Additional domains to allow for CORS",
  8587. "type": "array",
  8588. "items": {
  8589. "type": "string"
  8590. }
  8591. }
  8592. },
  8593. "additionalProperties": false
  8594. },
  8595. "PermissionActionConfig": {
  8596. "type": "string",
  8597. "enum": ["ask", "allow", "deny"]
  8598. },
  8599. "PermissionObjectConfig": {
  8600. "type": "object",
  8601. "propertyNames": {
  8602. "type": "string"
  8603. },
  8604. "additionalProperties": {
  8605. "$ref": "#/components/schemas/PermissionActionConfig"
  8606. }
  8607. },
  8608. "PermissionRuleConfig": {
  8609. "anyOf": [
  8610. {
  8611. "$ref": "#/components/schemas/PermissionActionConfig"
  8612. },
  8613. {
  8614. "$ref": "#/components/schemas/PermissionObjectConfig"
  8615. }
  8616. ]
  8617. },
  8618. "PermissionConfig": {
  8619. "anyOf": [
  8620. {
  8621. "type": "object",
  8622. "properties": {
  8623. "__originalKeys": {
  8624. "type": "array",
  8625. "items": {
  8626. "type": "string"
  8627. }
  8628. },
  8629. "read": {
  8630. "$ref": "#/components/schemas/PermissionRuleConfig"
  8631. },
  8632. "edit": {
  8633. "$ref": "#/components/schemas/PermissionRuleConfig"
  8634. },
  8635. "glob": {
  8636. "$ref": "#/components/schemas/PermissionRuleConfig"
  8637. },
  8638. "grep": {
  8639. "$ref": "#/components/schemas/PermissionRuleConfig"
  8640. },
  8641. "list": {
  8642. "$ref": "#/components/schemas/PermissionRuleConfig"
  8643. },
  8644. "bash": {
  8645. "$ref": "#/components/schemas/PermissionRuleConfig"
  8646. },
  8647. "task": {
  8648. "$ref": "#/components/schemas/PermissionRuleConfig"
  8649. },
  8650. "external_directory": {
  8651. "$ref": "#/components/schemas/PermissionRuleConfig"
  8652. },
  8653. "todowrite": {
  8654. "$ref": "#/components/schemas/PermissionActionConfig"
  8655. },
  8656. "todoread": {
  8657. "$ref": "#/components/schemas/PermissionActionConfig"
  8658. },
  8659. "question": {
  8660. "$ref": "#/components/schemas/PermissionActionConfig"
  8661. },
  8662. "webfetch": {
  8663. "$ref": "#/components/schemas/PermissionActionConfig"
  8664. },
  8665. "websearch": {
  8666. "$ref": "#/components/schemas/PermissionActionConfig"
  8667. },
  8668. "codesearch": {
  8669. "$ref": "#/components/schemas/PermissionActionConfig"
  8670. },
  8671. "lsp": {
  8672. "$ref": "#/components/schemas/PermissionRuleConfig"
  8673. },
  8674. "doom_loop": {
  8675. "$ref": "#/components/schemas/PermissionActionConfig"
  8676. }
  8677. },
  8678. "additionalProperties": {
  8679. "$ref": "#/components/schemas/PermissionRuleConfig"
  8680. }
  8681. },
  8682. {
  8683. "$ref": "#/components/schemas/PermissionActionConfig"
  8684. }
  8685. ]
  8686. },
  8687. "AgentConfig": {
  8688. "type": "object",
  8689. "properties": {
  8690. "model": {
  8691. "type": "string"
  8692. },
  8693. "temperature": {
  8694. "type": "number"
  8695. },
  8696. "top_p": {
  8697. "type": "number"
  8698. },
  8699. "prompt": {
  8700. "type": "string"
  8701. },
  8702. "tools": {
  8703. "description": "@deprecated Use 'permission' field instead",
  8704. "type": "object",
  8705. "propertyNames": {
  8706. "type": "string"
  8707. },
  8708. "additionalProperties": {
  8709. "type": "boolean"
  8710. }
  8711. },
  8712. "disable": {
  8713. "type": "boolean"
  8714. },
  8715. "description": {
  8716. "description": "Description of when to use the agent",
  8717. "type": "string"
  8718. },
  8719. "mode": {
  8720. "type": "string",
  8721. "enum": ["subagent", "primary", "all"]
  8722. },
  8723. "hidden": {
  8724. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  8725. "type": "boolean"
  8726. },
  8727. "options": {
  8728. "type": "object",
  8729. "propertyNames": {
  8730. "type": "string"
  8731. },
  8732. "additionalProperties": {}
  8733. },
  8734. "color": {
  8735. "description": "Hex color code for the agent (e.g., #FF5733)",
  8736. "type": "string",
  8737. "pattern": "^#[0-9a-fA-F]{6}$"
  8738. },
  8739. "steps": {
  8740. "description": "Maximum number of agentic iterations before forcing text-only response",
  8741. "type": "integer",
  8742. "exclusiveMinimum": 0,
  8743. "maximum": 9007199254740991
  8744. },
  8745. "maxSteps": {
  8746. "description": "@deprecated Use 'steps' field instead.",
  8747. "type": "integer",
  8748. "exclusiveMinimum": 0,
  8749. "maximum": 9007199254740991
  8750. },
  8751. "permission": {
  8752. "$ref": "#/components/schemas/PermissionConfig"
  8753. }
  8754. },
  8755. "additionalProperties": {}
  8756. },
  8757. "ProviderConfig": {
  8758. "type": "object",
  8759. "properties": {
  8760. "api": {
  8761. "type": "string"
  8762. },
  8763. "name": {
  8764. "type": "string"
  8765. },
  8766. "env": {
  8767. "type": "array",
  8768. "items": {
  8769. "type": "string"
  8770. }
  8771. },
  8772. "id": {
  8773. "type": "string"
  8774. },
  8775. "npm": {
  8776. "type": "string"
  8777. },
  8778. "models": {
  8779. "type": "object",
  8780. "propertyNames": {
  8781. "type": "string"
  8782. },
  8783. "additionalProperties": {
  8784. "type": "object",
  8785. "properties": {
  8786. "id": {
  8787. "type": "string"
  8788. },
  8789. "name": {
  8790. "type": "string"
  8791. },
  8792. "family": {
  8793. "type": "string"
  8794. },
  8795. "release_date": {
  8796. "type": "string"
  8797. },
  8798. "attachment": {
  8799. "type": "boolean"
  8800. },
  8801. "reasoning": {
  8802. "type": "boolean"
  8803. },
  8804. "temperature": {
  8805. "type": "boolean"
  8806. },
  8807. "tool_call": {
  8808. "type": "boolean"
  8809. },
  8810. "interleaved": {
  8811. "anyOf": [
  8812. {
  8813. "type": "boolean",
  8814. "const": true
  8815. },
  8816. {
  8817. "type": "object",
  8818. "properties": {
  8819. "field": {
  8820. "type": "string",
  8821. "enum": ["reasoning_content", "reasoning_details"]
  8822. }
  8823. },
  8824. "required": ["field"],
  8825. "additionalProperties": false
  8826. }
  8827. ]
  8828. },
  8829. "cost": {
  8830. "type": "object",
  8831. "properties": {
  8832. "input": {
  8833. "type": "number"
  8834. },
  8835. "output": {
  8836. "type": "number"
  8837. },
  8838. "cache_read": {
  8839. "type": "number"
  8840. },
  8841. "cache_write": {
  8842. "type": "number"
  8843. },
  8844. "context_over_200k": {
  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. },
  8860. "required": ["input", "output"]
  8861. }
  8862. },
  8863. "required": ["input", "output"]
  8864. },
  8865. "limit": {
  8866. "type": "object",
  8867. "properties": {
  8868. "context": {
  8869. "type": "number"
  8870. },
  8871. "output": {
  8872. "type": "number"
  8873. }
  8874. },
  8875. "required": ["context", "output"]
  8876. },
  8877. "modalities": {
  8878. "type": "object",
  8879. "properties": {
  8880. "input": {
  8881. "type": "array",
  8882. "items": {
  8883. "type": "string",
  8884. "enum": ["text", "audio", "image", "video", "pdf"]
  8885. }
  8886. },
  8887. "output": {
  8888. "type": "array",
  8889. "items": {
  8890. "type": "string",
  8891. "enum": ["text", "audio", "image", "video", "pdf"]
  8892. }
  8893. }
  8894. },
  8895. "required": ["input", "output"]
  8896. },
  8897. "experimental": {
  8898. "type": "boolean"
  8899. },
  8900. "status": {
  8901. "type": "string",
  8902. "enum": ["alpha", "beta", "deprecated"]
  8903. },
  8904. "options": {
  8905. "type": "object",
  8906. "propertyNames": {
  8907. "type": "string"
  8908. },
  8909. "additionalProperties": {}
  8910. },
  8911. "headers": {
  8912. "type": "object",
  8913. "propertyNames": {
  8914. "type": "string"
  8915. },
  8916. "additionalProperties": {
  8917. "type": "string"
  8918. }
  8919. },
  8920. "provider": {
  8921. "type": "object",
  8922. "properties": {
  8923. "npm": {
  8924. "type": "string"
  8925. }
  8926. },
  8927. "required": ["npm"]
  8928. },
  8929. "variants": {
  8930. "description": "Variant-specific configuration",
  8931. "type": "object",
  8932. "propertyNames": {
  8933. "type": "string"
  8934. },
  8935. "additionalProperties": {
  8936. "type": "object",
  8937. "properties": {
  8938. "disabled": {
  8939. "description": "Disable this variant for the model",
  8940. "type": "boolean"
  8941. }
  8942. },
  8943. "additionalProperties": {}
  8944. }
  8945. }
  8946. }
  8947. }
  8948. },
  8949. "whitelist": {
  8950. "type": "array",
  8951. "items": {
  8952. "type": "string"
  8953. }
  8954. },
  8955. "blacklist": {
  8956. "type": "array",
  8957. "items": {
  8958. "type": "string"
  8959. }
  8960. },
  8961. "options": {
  8962. "type": "object",
  8963. "properties": {
  8964. "apiKey": {
  8965. "type": "string"
  8966. },
  8967. "baseURL": {
  8968. "type": "string"
  8969. },
  8970. "enterpriseUrl": {
  8971. "description": "GitHub Enterprise URL for copilot authentication",
  8972. "type": "string"
  8973. },
  8974. "setCacheKey": {
  8975. "description": "Enable promptCacheKey for this provider (default false)",
  8976. "type": "boolean"
  8977. },
  8978. "timeout": {
  8979. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  8980. "anyOf": [
  8981. {
  8982. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  8983. "type": "integer",
  8984. "exclusiveMinimum": 0,
  8985. "maximum": 9007199254740991
  8986. },
  8987. {
  8988. "description": "Disable timeout for this provider entirely.",
  8989. "type": "boolean",
  8990. "const": false
  8991. }
  8992. ]
  8993. }
  8994. },
  8995. "additionalProperties": {}
  8996. }
  8997. },
  8998. "additionalProperties": false
  8999. },
  9000. "McpLocalConfig": {
  9001. "type": "object",
  9002. "properties": {
  9003. "type": {
  9004. "description": "Type of MCP server connection",
  9005. "type": "string",
  9006. "const": "local"
  9007. },
  9008. "command": {
  9009. "description": "Command and arguments to run the MCP server",
  9010. "type": "array",
  9011. "items": {
  9012. "type": "string"
  9013. }
  9014. },
  9015. "environment": {
  9016. "description": "Environment variables to set when running the MCP server",
  9017. "type": "object",
  9018. "propertyNames": {
  9019. "type": "string"
  9020. },
  9021. "additionalProperties": {
  9022. "type": "string"
  9023. }
  9024. },
  9025. "enabled": {
  9026. "description": "Enable or disable the MCP server on startup",
  9027. "type": "boolean"
  9028. },
  9029. "timeout": {
  9030. "description": "Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.",
  9031. "type": "integer",
  9032. "exclusiveMinimum": 0,
  9033. "maximum": 9007199254740991
  9034. }
  9035. },
  9036. "required": ["type", "command"],
  9037. "additionalProperties": false
  9038. },
  9039. "McpOAuthConfig": {
  9040. "type": "object",
  9041. "properties": {
  9042. "clientId": {
  9043. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  9044. "type": "string"
  9045. },
  9046. "clientSecret": {
  9047. "description": "OAuth client secret (if required by the authorization server)",
  9048. "type": "string"
  9049. },
  9050. "scope": {
  9051. "description": "OAuth scopes to request during authorization",
  9052. "type": "string"
  9053. }
  9054. },
  9055. "additionalProperties": false
  9056. },
  9057. "McpRemoteConfig": {
  9058. "type": "object",
  9059. "properties": {
  9060. "type": {
  9061. "description": "Type of MCP server connection",
  9062. "type": "string",
  9063. "const": "remote"
  9064. },
  9065. "url": {
  9066. "description": "URL of the remote MCP server",
  9067. "type": "string"
  9068. },
  9069. "enabled": {
  9070. "description": "Enable or disable the MCP server on startup",
  9071. "type": "boolean"
  9072. },
  9073. "headers": {
  9074. "description": "Headers to send with the request",
  9075. "type": "object",
  9076. "propertyNames": {
  9077. "type": "string"
  9078. },
  9079. "additionalProperties": {
  9080. "type": "string"
  9081. }
  9082. },
  9083. "oauth": {
  9084. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  9085. "anyOf": [
  9086. {
  9087. "$ref": "#/components/schemas/McpOAuthConfig"
  9088. },
  9089. {
  9090. "type": "boolean",
  9091. "const": false
  9092. }
  9093. ]
  9094. },
  9095. "timeout": {
  9096. "description": "Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.",
  9097. "type": "integer",
  9098. "exclusiveMinimum": 0,
  9099. "maximum": 9007199254740991
  9100. }
  9101. },
  9102. "required": ["type", "url"],
  9103. "additionalProperties": false
  9104. },
  9105. "LayoutConfig": {
  9106. "description": "@deprecated Always uses stretch layout.",
  9107. "type": "string",
  9108. "enum": ["auto", "stretch"]
  9109. },
  9110. "Config": {
  9111. "type": "object",
  9112. "properties": {
  9113. "$schema": {
  9114. "description": "JSON schema reference for configuration validation",
  9115. "type": "string"
  9116. },
  9117. "theme": {
  9118. "description": "Theme name to use for the interface",
  9119. "type": "string"
  9120. },
  9121. "keybinds": {
  9122. "$ref": "#/components/schemas/KeybindsConfig"
  9123. },
  9124. "logLevel": {
  9125. "$ref": "#/components/schemas/LogLevel"
  9126. },
  9127. "tui": {
  9128. "description": "TUI specific settings",
  9129. "type": "object",
  9130. "properties": {
  9131. "scroll_speed": {
  9132. "description": "TUI scroll speed",
  9133. "type": "number",
  9134. "minimum": 0.001
  9135. },
  9136. "scroll_acceleration": {
  9137. "description": "Scroll acceleration settings",
  9138. "type": "object",
  9139. "properties": {
  9140. "enabled": {
  9141. "description": "Enable scroll acceleration",
  9142. "type": "boolean"
  9143. }
  9144. },
  9145. "required": ["enabled"]
  9146. },
  9147. "diff_style": {
  9148. "description": "Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column",
  9149. "type": "string",
  9150. "enum": ["auto", "stacked"]
  9151. }
  9152. }
  9153. },
  9154. "server": {
  9155. "$ref": "#/components/schemas/ServerConfig"
  9156. },
  9157. "command": {
  9158. "description": "Command configuration, see https://opencode.ai/docs/commands",
  9159. "type": "object",
  9160. "propertyNames": {
  9161. "type": "string"
  9162. },
  9163. "additionalProperties": {
  9164. "type": "object",
  9165. "properties": {
  9166. "template": {
  9167. "type": "string"
  9168. },
  9169. "description": {
  9170. "type": "string"
  9171. },
  9172. "agent": {
  9173. "type": "string"
  9174. },
  9175. "model": {
  9176. "type": "string"
  9177. },
  9178. "subtask": {
  9179. "type": "boolean"
  9180. }
  9181. },
  9182. "required": ["template"]
  9183. }
  9184. },
  9185. "watcher": {
  9186. "type": "object",
  9187. "properties": {
  9188. "ignore": {
  9189. "type": "array",
  9190. "items": {
  9191. "type": "string"
  9192. }
  9193. }
  9194. }
  9195. },
  9196. "plugin": {
  9197. "type": "array",
  9198. "items": {
  9199. "type": "string"
  9200. }
  9201. },
  9202. "snapshot": {
  9203. "type": "boolean"
  9204. },
  9205. "share": {
  9206. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  9207. "type": "string",
  9208. "enum": ["manual", "auto", "disabled"]
  9209. },
  9210. "autoshare": {
  9211. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  9212. "type": "boolean"
  9213. },
  9214. "autoupdate": {
  9215. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  9216. "anyOf": [
  9217. {
  9218. "type": "boolean"
  9219. },
  9220. {
  9221. "type": "string",
  9222. "const": "notify"
  9223. }
  9224. ]
  9225. },
  9226. "disabled_providers": {
  9227. "description": "Disable providers that are loaded automatically",
  9228. "type": "array",
  9229. "items": {
  9230. "type": "string"
  9231. }
  9232. },
  9233. "enabled_providers": {
  9234. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  9235. "type": "array",
  9236. "items": {
  9237. "type": "string"
  9238. }
  9239. },
  9240. "model": {
  9241. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  9242. "type": "string"
  9243. },
  9244. "small_model": {
  9245. "description": "Small model to use for tasks like title generation in the format of provider/model",
  9246. "type": "string"
  9247. },
  9248. "default_agent": {
  9249. "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.",
  9250. "type": "string"
  9251. },
  9252. "username": {
  9253. "description": "Custom username to display in conversations instead of system username",
  9254. "type": "string"
  9255. },
  9256. "mode": {
  9257. "description": "@deprecated Use `agent` field instead.",
  9258. "type": "object",
  9259. "properties": {
  9260. "build": {
  9261. "$ref": "#/components/schemas/AgentConfig"
  9262. },
  9263. "plan": {
  9264. "$ref": "#/components/schemas/AgentConfig"
  9265. }
  9266. },
  9267. "additionalProperties": {
  9268. "$ref": "#/components/schemas/AgentConfig"
  9269. }
  9270. },
  9271. "agent": {
  9272. "description": "Agent configuration, see https://opencode.ai/docs/agent",
  9273. "type": "object",
  9274. "properties": {
  9275. "plan": {
  9276. "$ref": "#/components/schemas/AgentConfig"
  9277. },
  9278. "build": {
  9279. "$ref": "#/components/schemas/AgentConfig"
  9280. },
  9281. "general": {
  9282. "$ref": "#/components/schemas/AgentConfig"
  9283. },
  9284. "explore": {
  9285. "$ref": "#/components/schemas/AgentConfig"
  9286. },
  9287. "title": {
  9288. "$ref": "#/components/schemas/AgentConfig"
  9289. },
  9290. "summary": {
  9291. "$ref": "#/components/schemas/AgentConfig"
  9292. },
  9293. "compaction": {
  9294. "$ref": "#/components/schemas/AgentConfig"
  9295. }
  9296. },
  9297. "additionalProperties": {
  9298. "$ref": "#/components/schemas/AgentConfig"
  9299. }
  9300. },
  9301. "provider": {
  9302. "description": "Custom provider configurations and model overrides",
  9303. "type": "object",
  9304. "propertyNames": {
  9305. "type": "string"
  9306. },
  9307. "additionalProperties": {
  9308. "$ref": "#/components/schemas/ProviderConfig"
  9309. }
  9310. },
  9311. "mcp": {
  9312. "description": "MCP (Model Context Protocol) server configurations",
  9313. "type": "object",
  9314. "propertyNames": {
  9315. "type": "string"
  9316. },
  9317. "additionalProperties": {
  9318. "anyOf": [
  9319. {
  9320. "anyOf": [
  9321. {
  9322. "$ref": "#/components/schemas/McpLocalConfig"
  9323. },
  9324. {
  9325. "$ref": "#/components/schemas/McpRemoteConfig"
  9326. }
  9327. ]
  9328. },
  9329. {
  9330. "type": "object",
  9331. "properties": {
  9332. "enabled": {
  9333. "type": "boolean"
  9334. }
  9335. },
  9336. "required": ["enabled"],
  9337. "additionalProperties": false
  9338. }
  9339. ]
  9340. }
  9341. },
  9342. "formatter": {
  9343. "anyOf": [
  9344. {
  9345. "type": "boolean",
  9346. "const": false
  9347. },
  9348. {
  9349. "type": "object",
  9350. "propertyNames": {
  9351. "type": "string"
  9352. },
  9353. "additionalProperties": {
  9354. "type": "object",
  9355. "properties": {
  9356. "disabled": {
  9357. "type": "boolean"
  9358. },
  9359. "command": {
  9360. "type": "array",
  9361. "items": {
  9362. "type": "string"
  9363. }
  9364. },
  9365. "environment": {
  9366. "type": "object",
  9367. "propertyNames": {
  9368. "type": "string"
  9369. },
  9370. "additionalProperties": {
  9371. "type": "string"
  9372. }
  9373. },
  9374. "extensions": {
  9375. "type": "array",
  9376. "items": {
  9377. "type": "string"
  9378. }
  9379. }
  9380. }
  9381. }
  9382. }
  9383. ]
  9384. },
  9385. "lsp": {
  9386. "anyOf": [
  9387. {
  9388. "type": "boolean",
  9389. "const": false
  9390. },
  9391. {
  9392. "type": "object",
  9393. "propertyNames": {
  9394. "type": "string"
  9395. },
  9396. "additionalProperties": {
  9397. "anyOf": [
  9398. {
  9399. "type": "object",
  9400. "properties": {
  9401. "disabled": {
  9402. "type": "boolean",
  9403. "const": true
  9404. }
  9405. },
  9406. "required": ["disabled"]
  9407. },
  9408. {
  9409. "type": "object",
  9410. "properties": {
  9411. "command": {
  9412. "type": "array",
  9413. "items": {
  9414. "type": "string"
  9415. }
  9416. },
  9417. "extensions": {
  9418. "type": "array",
  9419. "items": {
  9420. "type": "string"
  9421. }
  9422. },
  9423. "disabled": {
  9424. "type": "boolean"
  9425. },
  9426. "env": {
  9427. "type": "object",
  9428. "propertyNames": {
  9429. "type": "string"
  9430. },
  9431. "additionalProperties": {
  9432. "type": "string"
  9433. }
  9434. },
  9435. "initialization": {
  9436. "type": "object",
  9437. "propertyNames": {
  9438. "type": "string"
  9439. },
  9440. "additionalProperties": {}
  9441. }
  9442. },
  9443. "required": ["command"]
  9444. }
  9445. ]
  9446. }
  9447. }
  9448. ]
  9449. },
  9450. "instructions": {
  9451. "description": "Additional instruction files or patterns to include",
  9452. "type": "array",
  9453. "items": {
  9454. "type": "string"
  9455. }
  9456. },
  9457. "layout": {
  9458. "$ref": "#/components/schemas/LayoutConfig"
  9459. },
  9460. "permission": {
  9461. "$ref": "#/components/schemas/PermissionConfig"
  9462. },
  9463. "tools": {
  9464. "type": "object",
  9465. "propertyNames": {
  9466. "type": "string"
  9467. },
  9468. "additionalProperties": {
  9469. "type": "boolean"
  9470. }
  9471. },
  9472. "enterprise": {
  9473. "type": "object",
  9474. "properties": {
  9475. "url": {
  9476. "description": "Enterprise URL",
  9477. "type": "string"
  9478. }
  9479. }
  9480. },
  9481. "compaction": {
  9482. "type": "object",
  9483. "properties": {
  9484. "auto": {
  9485. "description": "Enable automatic compaction when context is full (default: true)",
  9486. "type": "boolean"
  9487. },
  9488. "prune": {
  9489. "description": "Enable pruning of old tool outputs (default: true)",
  9490. "type": "boolean"
  9491. }
  9492. }
  9493. },
  9494. "experimental": {
  9495. "type": "object",
  9496. "properties": {
  9497. "hook": {
  9498. "type": "object",
  9499. "properties": {
  9500. "file_edited": {
  9501. "type": "object",
  9502. "propertyNames": {
  9503. "type": "string"
  9504. },
  9505. "additionalProperties": {
  9506. "type": "array",
  9507. "items": {
  9508. "type": "object",
  9509. "properties": {
  9510. "command": {
  9511. "type": "array",
  9512. "items": {
  9513. "type": "string"
  9514. }
  9515. },
  9516. "environment": {
  9517. "type": "object",
  9518. "propertyNames": {
  9519. "type": "string"
  9520. },
  9521. "additionalProperties": {
  9522. "type": "string"
  9523. }
  9524. }
  9525. },
  9526. "required": ["command"]
  9527. }
  9528. }
  9529. },
  9530. "session_completed": {
  9531. "type": "array",
  9532. "items": {
  9533. "type": "object",
  9534. "properties": {
  9535. "command": {
  9536. "type": "array",
  9537. "items": {
  9538. "type": "string"
  9539. }
  9540. },
  9541. "environment": {
  9542. "type": "object",
  9543. "propertyNames": {
  9544. "type": "string"
  9545. },
  9546. "additionalProperties": {
  9547. "type": "string"
  9548. }
  9549. }
  9550. },
  9551. "required": ["command"]
  9552. }
  9553. }
  9554. }
  9555. },
  9556. "chatMaxRetries": {
  9557. "description": "Number of retries for chat completions on failure",
  9558. "type": "number"
  9559. },
  9560. "disable_paste_summary": {
  9561. "type": "boolean"
  9562. },
  9563. "batch_tool": {
  9564. "description": "Enable the batch tool",
  9565. "type": "boolean"
  9566. },
  9567. "openTelemetry": {
  9568. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  9569. "type": "boolean"
  9570. },
  9571. "primary_tools": {
  9572. "description": "Tools that should only be available to primary agents.",
  9573. "type": "array",
  9574. "items": {
  9575. "type": "string"
  9576. }
  9577. },
  9578. "continue_loop_on_deny": {
  9579. "description": "Continue the agent loop when a tool call is denied",
  9580. "type": "boolean"
  9581. },
  9582. "mcp_timeout": {
  9583. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  9584. "type": "integer",
  9585. "exclusiveMinimum": 0,
  9586. "maximum": 9007199254740991
  9587. }
  9588. }
  9589. }
  9590. },
  9591. "additionalProperties": false
  9592. },
  9593. "ToolIDs": {
  9594. "type": "array",
  9595. "items": {
  9596. "type": "string"
  9597. }
  9598. },
  9599. "ToolListItem": {
  9600. "type": "object",
  9601. "properties": {
  9602. "id": {
  9603. "type": "string"
  9604. },
  9605. "description": {
  9606. "type": "string"
  9607. },
  9608. "parameters": {}
  9609. },
  9610. "required": ["id", "description", "parameters"]
  9611. },
  9612. "ToolList": {
  9613. "type": "array",
  9614. "items": {
  9615. "$ref": "#/components/schemas/ToolListItem"
  9616. }
  9617. },
  9618. "Path": {
  9619. "type": "object",
  9620. "properties": {
  9621. "home": {
  9622. "type": "string"
  9623. },
  9624. "state": {
  9625. "type": "string"
  9626. },
  9627. "config": {
  9628. "type": "string"
  9629. },
  9630. "worktree": {
  9631. "type": "string"
  9632. },
  9633. "directory": {
  9634. "type": "string"
  9635. }
  9636. },
  9637. "required": ["home", "state", "config", "worktree", "directory"]
  9638. },
  9639. "Worktree": {
  9640. "type": "object",
  9641. "properties": {
  9642. "name": {
  9643. "type": "string"
  9644. },
  9645. "branch": {
  9646. "type": "string"
  9647. },
  9648. "directory": {
  9649. "type": "string"
  9650. }
  9651. },
  9652. "required": ["name", "branch", "directory"]
  9653. },
  9654. "WorktreeCreateInput": {
  9655. "type": "object",
  9656. "properties": {
  9657. "name": {
  9658. "type": "string"
  9659. },
  9660. "startCommand": {
  9661. "type": "string"
  9662. }
  9663. }
  9664. },
  9665. "VcsInfo": {
  9666. "type": "object",
  9667. "properties": {
  9668. "branch": {
  9669. "type": "string"
  9670. }
  9671. },
  9672. "required": ["branch"]
  9673. },
  9674. "TextPartInput": {
  9675. "type": "object",
  9676. "properties": {
  9677. "id": {
  9678. "type": "string"
  9679. },
  9680. "type": {
  9681. "type": "string",
  9682. "const": "text"
  9683. },
  9684. "text": {
  9685. "type": "string"
  9686. },
  9687. "synthetic": {
  9688. "type": "boolean"
  9689. },
  9690. "ignored": {
  9691. "type": "boolean"
  9692. },
  9693. "time": {
  9694. "type": "object",
  9695. "properties": {
  9696. "start": {
  9697. "type": "number"
  9698. },
  9699. "end": {
  9700. "type": "number"
  9701. }
  9702. },
  9703. "required": ["start"]
  9704. },
  9705. "metadata": {
  9706. "type": "object",
  9707. "propertyNames": {
  9708. "type": "string"
  9709. },
  9710. "additionalProperties": {}
  9711. }
  9712. },
  9713. "required": ["type", "text"]
  9714. },
  9715. "FilePartInput": {
  9716. "type": "object",
  9717. "properties": {
  9718. "id": {
  9719. "type": "string"
  9720. },
  9721. "type": {
  9722. "type": "string",
  9723. "const": "file"
  9724. },
  9725. "mime": {
  9726. "type": "string"
  9727. },
  9728. "filename": {
  9729. "type": "string"
  9730. },
  9731. "url": {
  9732. "type": "string"
  9733. },
  9734. "source": {
  9735. "$ref": "#/components/schemas/FilePartSource"
  9736. }
  9737. },
  9738. "required": ["type", "mime", "url"]
  9739. },
  9740. "AgentPartInput": {
  9741. "type": "object",
  9742. "properties": {
  9743. "id": {
  9744. "type": "string"
  9745. },
  9746. "type": {
  9747. "type": "string",
  9748. "const": "agent"
  9749. },
  9750. "name": {
  9751. "type": "string"
  9752. },
  9753. "source": {
  9754. "type": "object",
  9755. "properties": {
  9756. "value": {
  9757. "type": "string"
  9758. },
  9759. "start": {
  9760. "type": "integer",
  9761. "minimum": -9007199254740991,
  9762. "maximum": 9007199254740991
  9763. },
  9764. "end": {
  9765. "type": "integer",
  9766. "minimum": -9007199254740991,
  9767. "maximum": 9007199254740991
  9768. }
  9769. },
  9770. "required": ["value", "start", "end"]
  9771. }
  9772. },
  9773. "required": ["type", "name"]
  9774. },
  9775. "SubtaskPartInput": {
  9776. "type": "object",
  9777. "properties": {
  9778. "id": {
  9779. "type": "string"
  9780. },
  9781. "type": {
  9782. "type": "string",
  9783. "const": "subtask"
  9784. },
  9785. "prompt": {
  9786. "type": "string"
  9787. },
  9788. "description": {
  9789. "type": "string"
  9790. },
  9791. "agent": {
  9792. "type": "string"
  9793. },
  9794. "command": {
  9795. "type": "string"
  9796. }
  9797. },
  9798. "required": ["type", "prompt", "description", "agent"]
  9799. },
  9800. "Command": {
  9801. "type": "object",
  9802. "properties": {
  9803. "name": {
  9804. "type": "string"
  9805. },
  9806. "description": {
  9807. "type": "string"
  9808. },
  9809. "agent": {
  9810. "type": "string"
  9811. },
  9812. "model": {
  9813. "type": "string"
  9814. },
  9815. "mcp": {
  9816. "type": "boolean"
  9817. },
  9818. "template": {
  9819. "anyOf": [
  9820. {
  9821. "type": "string"
  9822. },
  9823. {
  9824. "type": "string"
  9825. }
  9826. ]
  9827. },
  9828. "subtask": {
  9829. "type": "boolean"
  9830. },
  9831. "hints": {
  9832. "type": "array",
  9833. "items": {
  9834. "type": "string"
  9835. }
  9836. }
  9837. },
  9838. "required": ["name", "template", "hints"]
  9839. },
  9840. "Model": {
  9841. "type": "object",
  9842. "properties": {
  9843. "id": {
  9844. "type": "string"
  9845. },
  9846. "providerID": {
  9847. "type": "string"
  9848. },
  9849. "api": {
  9850. "type": "object",
  9851. "properties": {
  9852. "id": {
  9853. "type": "string"
  9854. },
  9855. "url": {
  9856. "type": "string"
  9857. },
  9858. "npm": {
  9859. "type": "string"
  9860. }
  9861. },
  9862. "required": ["id", "url", "npm"]
  9863. },
  9864. "name": {
  9865. "type": "string"
  9866. },
  9867. "family": {
  9868. "type": "string"
  9869. },
  9870. "capabilities": {
  9871. "type": "object",
  9872. "properties": {
  9873. "temperature": {
  9874. "type": "boolean"
  9875. },
  9876. "reasoning": {
  9877. "type": "boolean"
  9878. },
  9879. "attachment": {
  9880. "type": "boolean"
  9881. },
  9882. "toolcall": {
  9883. "type": "boolean"
  9884. },
  9885. "input": {
  9886. "type": "object",
  9887. "properties": {
  9888. "text": {
  9889. "type": "boolean"
  9890. },
  9891. "audio": {
  9892. "type": "boolean"
  9893. },
  9894. "image": {
  9895. "type": "boolean"
  9896. },
  9897. "video": {
  9898. "type": "boolean"
  9899. },
  9900. "pdf": {
  9901. "type": "boolean"
  9902. }
  9903. },
  9904. "required": ["text", "audio", "image", "video", "pdf"]
  9905. },
  9906. "output": {
  9907. "type": "object",
  9908. "properties": {
  9909. "text": {
  9910. "type": "boolean"
  9911. },
  9912. "audio": {
  9913. "type": "boolean"
  9914. },
  9915. "image": {
  9916. "type": "boolean"
  9917. },
  9918. "video": {
  9919. "type": "boolean"
  9920. },
  9921. "pdf": {
  9922. "type": "boolean"
  9923. }
  9924. },
  9925. "required": ["text", "audio", "image", "video", "pdf"]
  9926. },
  9927. "interleaved": {
  9928. "anyOf": [
  9929. {
  9930. "type": "boolean"
  9931. },
  9932. {
  9933. "type": "object",
  9934. "properties": {
  9935. "field": {
  9936. "type": "string",
  9937. "enum": ["reasoning_content", "reasoning_details"]
  9938. }
  9939. },
  9940. "required": ["field"]
  9941. }
  9942. ]
  9943. }
  9944. },
  9945. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  9946. },
  9947. "cost": {
  9948. "type": "object",
  9949. "properties": {
  9950. "input": {
  9951. "type": "number"
  9952. },
  9953. "output": {
  9954. "type": "number"
  9955. },
  9956. "cache": {
  9957. "type": "object",
  9958. "properties": {
  9959. "read": {
  9960. "type": "number"
  9961. },
  9962. "write": {
  9963. "type": "number"
  9964. }
  9965. },
  9966. "required": ["read", "write"]
  9967. },
  9968. "experimentalOver200K": {
  9969. "type": "object",
  9970. "properties": {
  9971. "input": {
  9972. "type": "number"
  9973. },
  9974. "output": {
  9975. "type": "number"
  9976. },
  9977. "cache": {
  9978. "type": "object",
  9979. "properties": {
  9980. "read": {
  9981. "type": "number"
  9982. },
  9983. "write": {
  9984. "type": "number"
  9985. }
  9986. },
  9987. "required": ["read", "write"]
  9988. }
  9989. },
  9990. "required": ["input", "output", "cache"]
  9991. }
  9992. },
  9993. "required": ["input", "output", "cache"]
  9994. },
  9995. "limit": {
  9996. "type": "object",
  9997. "properties": {
  9998. "context": {
  9999. "type": "number"
  10000. },
  10001. "output": {
  10002. "type": "number"
  10003. }
  10004. },
  10005. "required": ["context", "output"]
  10006. },
  10007. "status": {
  10008. "type": "string",
  10009. "enum": ["alpha", "beta", "deprecated", "active"]
  10010. },
  10011. "options": {
  10012. "type": "object",
  10013. "propertyNames": {
  10014. "type": "string"
  10015. },
  10016. "additionalProperties": {}
  10017. },
  10018. "headers": {
  10019. "type": "object",
  10020. "propertyNames": {
  10021. "type": "string"
  10022. },
  10023. "additionalProperties": {
  10024. "type": "string"
  10025. }
  10026. },
  10027. "release_date": {
  10028. "type": "string"
  10029. },
  10030. "variants": {
  10031. "type": "object",
  10032. "propertyNames": {
  10033. "type": "string"
  10034. },
  10035. "additionalProperties": {
  10036. "type": "object",
  10037. "propertyNames": {
  10038. "type": "string"
  10039. },
  10040. "additionalProperties": {}
  10041. }
  10042. }
  10043. },
  10044. "required": [
  10045. "id",
  10046. "providerID",
  10047. "api",
  10048. "name",
  10049. "capabilities",
  10050. "cost",
  10051. "limit",
  10052. "status",
  10053. "options",
  10054. "headers",
  10055. "release_date"
  10056. ]
  10057. },
  10058. "Provider": {
  10059. "type": "object",
  10060. "properties": {
  10061. "id": {
  10062. "type": "string"
  10063. },
  10064. "name": {
  10065. "type": "string"
  10066. },
  10067. "source": {
  10068. "type": "string",
  10069. "enum": ["env", "config", "custom", "api"]
  10070. },
  10071. "env": {
  10072. "type": "array",
  10073. "items": {
  10074. "type": "string"
  10075. }
  10076. },
  10077. "key": {
  10078. "type": "string"
  10079. },
  10080. "options": {
  10081. "type": "object",
  10082. "propertyNames": {
  10083. "type": "string"
  10084. },
  10085. "additionalProperties": {}
  10086. },
  10087. "models": {
  10088. "type": "object",
  10089. "propertyNames": {
  10090. "type": "string"
  10091. },
  10092. "additionalProperties": {
  10093. "$ref": "#/components/schemas/Model"
  10094. }
  10095. }
  10096. },
  10097. "required": ["id", "name", "source", "env", "options", "models"]
  10098. },
  10099. "ProviderAuthMethod": {
  10100. "type": "object",
  10101. "properties": {
  10102. "type": {
  10103. "anyOf": [
  10104. {
  10105. "type": "string",
  10106. "const": "oauth"
  10107. },
  10108. {
  10109. "type": "string",
  10110. "const": "api"
  10111. }
  10112. ]
  10113. },
  10114. "label": {
  10115. "type": "string"
  10116. }
  10117. },
  10118. "required": ["type", "label"]
  10119. },
  10120. "ProviderAuthAuthorization": {
  10121. "type": "object",
  10122. "properties": {
  10123. "url": {
  10124. "type": "string"
  10125. },
  10126. "method": {
  10127. "anyOf": [
  10128. {
  10129. "type": "string",
  10130. "const": "auto"
  10131. },
  10132. {
  10133. "type": "string",
  10134. "const": "code"
  10135. }
  10136. ]
  10137. },
  10138. "instructions": {
  10139. "type": "string"
  10140. }
  10141. },
  10142. "required": ["url", "method", "instructions"]
  10143. },
  10144. "Symbol": {
  10145. "type": "object",
  10146. "properties": {
  10147. "name": {
  10148. "type": "string"
  10149. },
  10150. "kind": {
  10151. "type": "number"
  10152. },
  10153. "location": {
  10154. "type": "object",
  10155. "properties": {
  10156. "uri": {
  10157. "type": "string"
  10158. },
  10159. "range": {
  10160. "$ref": "#/components/schemas/Range"
  10161. }
  10162. },
  10163. "required": ["uri", "range"]
  10164. }
  10165. },
  10166. "required": ["name", "kind", "location"]
  10167. },
  10168. "FileNode": {
  10169. "type": "object",
  10170. "properties": {
  10171. "name": {
  10172. "type": "string"
  10173. },
  10174. "path": {
  10175. "type": "string"
  10176. },
  10177. "absolute": {
  10178. "type": "string"
  10179. },
  10180. "type": {
  10181. "type": "string",
  10182. "enum": ["file", "directory"]
  10183. },
  10184. "ignored": {
  10185. "type": "boolean"
  10186. }
  10187. },
  10188. "required": ["name", "path", "absolute", "type", "ignored"]
  10189. },
  10190. "FileContent": {
  10191. "type": "object",
  10192. "properties": {
  10193. "type": {
  10194. "type": "string",
  10195. "const": "text"
  10196. },
  10197. "content": {
  10198. "type": "string"
  10199. },
  10200. "diff": {
  10201. "type": "string"
  10202. },
  10203. "patch": {
  10204. "type": "object",
  10205. "properties": {
  10206. "oldFileName": {
  10207. "type": "string"
  10208. },
  10209. "newFileName": {
  10210. "type": "string"
  10211. },
  10212. "oldHeader": {
  10213. "type": "string"
  10214. },
  10215. "newHeader": {
  10216. "type": "string"
  10217. },
  10218. "hunks": {
  10219. "type": "array",
  10220. "items": {
  10221. "type": "object",
  10222. "properties": {
  10223. "oldStart": {
  10224. "type": "number"
  10225. },
  10226. "oldLines": {
  10227. "type": "number"
  10228. },
  10229. "newStart": {
  10230. "type": "number"
  10231. },
  10232. "newLines": {
  10233. "type": "number"
  10234. },
  10235. "lines": {
  10236. "type": "array",
  10237. "items": {
  10238. "type": "string"
  10239. }
  10240. }
  10241. },
  10242. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  10243. }
  10244. },
  10245. "index": {
  10246. "type": "string"
  10247. }
  10248. },
  10249. "required": ["oldFileName", "newFileName", "hunks"]
  10250. },
  10251. "encoding": {
  10252. "type": "string",
  10253. "const": "base64"
  10254. },
  10255. "mimeType": {
  10256. "type": "string"
  10257. }
  10258. },
  10259. "required": ["type", "content"]
  10260. },
  10261. "File": {
  10262. "type": "object",
  10263. "properties": {
  10264. "path": {
  10265. "type": "string"
  10266. },
  10267. "added": {
  10268. "type": "integer",
  10269. "minimum": -9007199254740991,
  10270. "maximum": 9007199254740991
  10271. },
  10272. "removed": {
  10273. "type": "integer",
  10274. "minimum": -9007199254740991,
  10275. "maximum": 9007199254740991
  10276. },
  10277. "status": {
  10278. "type": "string",
  10279. "enum": ["added", "deleted", "modified"]
  10280. }
  10281. },
  10282. "required": ["path", "added", "removed", "status"]
  10283. },
  10284. "Agent": {
  10285. "type": "object",
  10286. "properties": {
  10287. "name": {
  10288. "type": "string"
  10289. },
  10290. "description": {
  10291. "type": "string"
  10292. },
  10293. "mode": {
  10294. "type": "string",
  10295. "enum": ["subagent", "primary", "all"]
  10296. },
  10297. "native": {
  10298. "type": "boolean"
  10299. },
  10300. "hidden": {
  10301. "type": "boolean"
  10302. },
  10303. "topP": {
  10304. "type": "number"
  10305. },
  10306. "temperature": {
  10307. "type": "number"
  10308. },
  10309. "color": {
  10310. "type": "string"
  10311. },
  10312. "permission": {
  10313. "$ref": "#/components/schemas/PermissionRuleset"
  10314. },
  10315. "model": {
  10316. "type": "object",
  10317. "properties": {
  10318. "modelID": {
  10319. "type": "string"
  10320. },
  10321. "providerID": {
  10322. "type": "string"
  10323. }
  10324. },
  10325. "required": ["modelID", "providerID"]
  10326. },
  10327. "prompt": {
  10328. "type": "string"
  10329. },
  10330. "options": {
  10331. "type": "object",
  10332. "propertyNames": {
  10333. "type": "string"
  10334. },
  10335. "additionalProperties": {}
  10336. },
  10337. "steps": {
  10338. "type": "integer",
  10339. "exclusiveMinimum": 0,
  10340. "maximum": 9007199254740991
  10341. }
  10342. },
  10343. "required": ["name", "mode", "permission", "options"]
  10344. },
  10345. "MCPStatusConnected": {
  10346. "type": "object",
  10347. "properties": {
  10348. "status": {
  10349. "type": "string",
  10350. "const": "connected"
  10351. }
  10352. },
  10353. "required": ["status"]
  10354. },
  10355. "MCPStatusDisabled": {
  10356. "type": "object",
  10357. "properties": {
  10358. "status": {
  10359. "type": "string",
  10360. "const": "disabled"
  10361. }
  10362. },
  10363. "required": ["status"]
  10364. },
  10365. "MCPStatusFailed": {
  10366. "type": "object",
  10367. "properties": {
  10368. "status": {
  10369. "type": "string",
  10370. "const": "failed"
  10371. },
  10372. "error": {
  10373. "type": "string"
  10374. }
  10375. },
  10376. "required": ["status", "error"]
  10377. },
  10378. "MCPStatusNeedsAuth": {
  10379. "type": "object",
  10380. "properties": {
  10381. "status": {
  10382. "type": "string",
  10383. "const": "needs_auth"
  10384. }
  10385. },
  10386. "required": ["status"]
  10387. },
  10388. "MCPStatusNeedsClientRegistration": {
  10389. "type": "object",
  10390. "properties": {
  10391. "status": {
  10392. "type": "string",
  10393. "const": "needs_client_registration"
  10394. },
  10395. "error": {
  10396. "type": "string"
  10397. }
  10398. },
  10399. "required": ["status", "error"]
  10400. },
  10401. "MCPStatus": {
  10402. "anyOf": [
  10403. {
  10404. "$ref": "#/components/schemas/MCPStatusConnected"
  10405. },
  10406. {
  10407. "$ref": "#/components/schemas/MCPStatusDisabled"
  10408. },
  10409. {
  10410. "$ref": "#/components/schemas/MCPStatusFailed"
  10411. },
  10412. {
  10413. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  10414. },
  10415. {
  10416. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  10417. }
  10418. ]
  10419. },
  10420. "McpResource": {
  10421. "type": "object",
  10422. "properties": {
  10423. "name": {
  10424. "type": "string"
  10425. },
  10426. "uri": {
  10427. "type": "string"
  10428. },
  10429. "description": {
  10430. "type": "string"
  10431. },
  10432. "mimeType": {
  10433. "type": "string"
  10434. },
  10435. "client": {
  10436. "type": "string"
  10437. }
  10438. },
  10439. "required": ["name", "uri", "client"]
  10440. },
  10441. "LSPStatus": {
  10442. "type": "object",
  10443. "properties": {
  10444. "id": {
  10445. "type": "string"
  10446. },
  10447. "name": {
  10448. "type": "string"
  10449. },
  10450. "root": {
  10451. "type": "string"
  10452. },
  10453. "status": {
  10454. "anyOf": [
  10455. {
  10456. "type": "string",
  10457. "const": "connected"
  10458. },
  10459. {
  10460. "type": "string",
  10461. "const": "error"
  10462. }
  10463. ]
  10464. }
  10465. },
  10466. "required": ["id", "name", "root", "status"]
  10467. },
  10468. "FormatterStatus": {
  10469. "type": "object",
  10470. "properties": {
  10471. "name": {
  10472. "type": "string"
  10473. },
  10474. "extensions": {
  10475. "type": "array",
  10476. "items": {
  10477. "type": "string"
  10478. }
  10479. },
  10480. "enabled": {
  10481. "type": "boolean"
  10482. }
  10483. },
  10484. "required": ["name", "extensions", "enabled"]
  10485. },
  10486. "OAuth": {
  10487. "type": "object",
  10488. "properties": {
  10489. "type": {
  10490. "type": "string",
  10491. "const": "oauth"
  10492. },
  10493. "refresh": {
  10494. "type": "string"
  10495. },
  10496. "access": {
  10497. "type": "string"
  10498. },
  10499. "expires": {
  10500. "type": "number"
  10501. },
  10502. "accountId": {
  10503. "type": "string"
  10504. },
  10505. "enterpriseUrl": {
  10506. "type": "string"
  10507. }
  10508. },
  10509. "required": ["type", "refresh", "access", "expires"]
  10510. },
  10511. "ApiAuth": {
  10512. "type": "object",
  10513. "properties": {
  10514. "type": {
  10515. "type": "string",
  10516. "const": "api"
  10517. },
  10518. "key": {
  10519. "type": "string"
  10520. }
  10521. },
  10522. "required": ["type", "key"]
  10523. },
  10524. "WellKnownAuth": {
  10525. "type": "object",
  10526. "properties": {
  10527. "type": {
  10528. "type": "string",
  10529. "const": "wellknown"
  10530. },
  10531. "key": {
  10532. "type": "string"
  10533. },
  10534. "token": {
  10535. "type": "string"
  10536. }
  10537. },
  10538. "required": ["type", "key", "token"]
  10539. },
  10540. "Auth": {
  10541. "anyOf": [
  10542. {
  10543. "$ref": "#/components/schemas/OAuth"
  10544. },
  10545. {
  10546. "$ref": "#/components/schemas/ApiAuth"
  10547. },
  10548. {
  10549. "$ref": "#/components/schemas/WellKnownAuth"
  10550. }
  10551. ]
  10552. }
  10553. }
  10554. }
  10555. }