openapi.json 298 KB

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