openapi.json 277 KB

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