openapi.json 273 KB

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