openapi.json 291 KB

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