openapi.json 294 KB

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