openapi.json 320 KB

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