openapi.json 363 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411
  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. "/global/upgrade": {
  162. "post": {
  163. "operationId": "global.upgrade",
  164. "summary": "Upgrade opencode",
  165. "description": "Upgrade opencode to the specified version or latest if not specified.",
  166. "responses": {
  167. "200": {
  168. "description": "Upgrade result",
  169. "content": {
  170. "application/json": {
  171. "schema": {
  172. "anyOf": [
  173. {
  174. "type": "object",
  175. "properties": {
  176. "success": {
  177. "type": "boolean",
  178. "const": true
  179. },
  180. "version": {
  181. "type": "string"
  182. }
  183. },
  184. "required": ["success", "version"]
  185. },
  186. {
  187. "type": "object",
  188. "properties": {
  189. "success": {
  190. "type": "boolean",
  191. "const": false
  192. },
  193. "error": {
  194. "type": "string"
  195. }
  196. },
  197. "required": ["success", "error"]
  198. }
  199. ]
  200. }
  201. }
  202. }
  203. },
  204. "400": {
  205. "description": "Bad request",
  206. "content": {
  207. "application/json": {
  208. "schema": {
  209. "$ref": "#/components/schemas/BadRequestError"
  210. }
  211. }
  212. }
  213. }
  214. },
  215. "requestBody": {
  216. "content": {
  217. "application/json": {
  218. "schema": {
  219. "type": "object",
  220. "properties": {
  221. "target": {
  222. "type": "string"
  223. }
  224. }
  225. }
  226. }
  227. }
  228. },
  229. "x-codeSamples": [
  230. {
  231. "lang": "js",
  232. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  233. }
  234. ]
  235. }
  236. },
  237. "/auth/{providerID}": {
  238. "put": {
  239. "operationId": "auth.set",
  240. "summary": "Set auth credentials",
  241. "description": "Set authentication credentials",
  242. "responses": {
  243. "200": {
  244. "description": "Successfully set authentication credentials",
  245. "content": {
  246. "application/json": {
  247. "schema": {
  248. "type": "boolean"
  249. }
  250. }
  251. }
  252. },
  253. "400": {
  254. "description": "Bad request",
  255. "content": {
  256. "application/json": {
  257. "schema": {
  258. "$ref": "#/components/schemas/BadRequestError"
  259. }
  260. }
  261. }
  262. }
  263. },
  264. "parameters": [
  265. {
  266. "in": "path",
  267. "name": "providerID",
  268. "schema": {
  269. "type": "string"
  270. },
  271. "required": true
  272. }
  273. ],
  274. "requestBody": {
  275. "content": {
  276. "application/json": {
  277. "schema": {
  278. "$ref": "#/components/schemas/Auth"
  279. }
  280. }
  281. }
  282. },
  283. "x-codeSamples": [
  284. {
  285. "lang": "js",
  286. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  287. }
  288. ]
  289. },
  290. "delete": {
  291. "operationId": "auth.remove",
  292. "summary": "Remove auth credentials",
  293. "description": "Remove authentication credentials",
  294. "responses": {
  295. "200": {
  296. "description": "Successfully removed authentication credentials",
  297. "content": {
  298. "application/json": {
  299. "schema": {
  300. "type": "boolean"
  301. }
  302. }
  303. }
  304. },
  305. "400": {
  306. "description": "Bad request",
  307. "content": {
  308. "application/json": {
  309. "schema": {
  310. "$ref": "#/components/schemas/BadRequestError"
  311. }
  312. }
  313. }
  314. }
  315. },
  316. "parameters": [
  317. {
  318. "in": "path",
  319. "name": "providerID",
  320. "schema": {
  321. "type": "string"
  322. },
  323. "required": true
  324. }
  325. ],
  326. "x-codeSamples": [
  327. {
  328. "lang": "js",
  329. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  330. }
  331. ]
  332. }
  333. },
  334. "/log": {
  335. "post": {
  336. "operationId": "app.log",
  337. "parameters": [
  338. {
  339. "in": "query",
  340. "name": "directory",
  341. "schema": {
  342. "type": "string"
  343. }
  344. },
  345. {
  346. "in": "query",
  347. "name": "workspace",
  348. "schema": {
  349. "type": "string"
  350. }
  351. }
  352. ],
  353. "summary": "Write log",
  354. "description": "Write a log entry to the server logs with specified level and metadata.",
  355. "responses": {
  356. "200": {
  357. "description": "Log entry written successfully",
  358. "content": {
  359. "application/json": {
  360. "schema": {
  361. "type": "boolean"
  362. }
  363. }
  364. }
  365. },
  366. "400": {
  367. "description": "Bad request",
  368. "content": {
  369. "application/json": {
  370. "schema": {
  371. "$ref": "#/components/schemas/BadRequestError"
  372. }
  373. }
  374. }
  375. }
  376. },
  377. "requestBody": {
  378. "content": {
  379. "application/json": {
  380. "schema": {
  381. "type": "object",
  382. "properties": {
  383. "service": {
  384. "description": "Service name for the log entry",
  385. "type": "string"
  386. },
  387. "level": {
  388. "description": "Log level",
  389. "type": "string",
  390. "enum": ["debug", "info", "error", "warn"]
  391. },
  392. "message": {
  393. "description": "Log message",
  394. "type": "string"
  395. },
  396. "extra": {
  397. "description": "Additional metadata for the log entry",
  398. "type": "object",
  399. "propertyNames": {
  400. "type": "string"
  401. },
  402. "additionalProperties": {}
  403. }
  404. },
  405. "required": ["service", "level", "message"]
  406. }
  407. }
  408. }
  409. },
  410. "x-codeSamples": [
  411. {
  412. "lang": "js",
  413. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  414. }
  415. ]
  416. }
  417. },
  418. "/experimental/workspace/adaptor": {
  419. "get": {
  420. "operationId": "experimental.workspace.adaptor.list",
  421. "parameters": [
  422. {
  423. "in": "query",
  424. "name": "directory",
  425. "schema": {
  426. "type": "string"
  427. }
  428. },
  429. {
  430. "in": "query",
  431. "name": "workspace",
  432. "schema": {
  433. "type": "string"
  434. }
  435. }
  436. ],
  437. "summary": "List workspace adaptors",
  438. "description": "List all available workspace adaptors for the current project.",
  439. "responses": {
  440. "200": {
  441. "description": "Workspace adaptors",
  442. "content": {
  443. "application/json": {
  444. "schema": {
  445. "type": "array",
  446. "items": {
  447. "type": "object",
  448. "properties": {
  449. "type": {
  450. "type": "string"
  451. },
  452. "name": {
  453. "type": "string"
  454. },
  455. "description": {
  456. "type": "string"
  457. }
  458. },
  459. "required": ["type", "name", "description"]
  460. }
  461. }
  462. }
  463. }
  464. }
  465. },
  466. "x-codeSamples": [
  467. {
  468. "lang": "js",
  469. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adaptor.list({\n ...\n})"
  470. }
  471. ]
  472. }
  473. },
  474. "/experimental/workspace": {
  475. "post": {
  476. "operationId": "experimental.workspace.create",
  477. "parameters": [
  478. {
  479. "in": "query",
  480. "name": "directory",
  481. "schema": {
  482. "type": "string"
  483. }
  484. },
  485. {
  486. "in": "query",
  487. "name": "workspace",
  488. "schema": {
  489. "type": "string"
  490. }
  491. }
  492. ],
  493. "summary": "Create workspace",
  494. "description": "Create a workspace for the current project.",
  495. "responses": {
  496. "200": {
  497. "description": "Workspace created",
  498. "content": {
  499. "application/json": {
  500. "schema": {
  501. "$ref": "#/components/schemas/Workspace"
  502. }
  503. }
  504. }
  505. },
  506. "400": {
  507. "description": "Bad request",
  508. "content": {
  509. "application/json": {
  510. "schema": {
  511. "$ref": "#/components/schemas/BadRequestError"
  512. }
  513. }
  514. }
  515. }
  516. },
  517. "requestBody": {
  518. "content": {
  519. "application/json": {
  520. "schema": {
  521. "type": "object",
  522. "properties": {
  523. "id": {
  524. "type": "string",
  525. "pattern": "^wrk.*"
  526. },
  527. "type": {
  528. "type": "string"
  529. },
  530. "branch": {
  531. "anyOf": [
  532. {
  533. "type": "string"
  534. },
  535. {
  536. "type": "null"
  537. }
  538. ]
  539. },
  540. "extra": {
  541. "anyOf": [
  542. {},
  543. {
  544. "type": "null"
  545. }
  546. ]
  547. }
  548. },
  549. "required": ["type", "branch", "extra"]
  550. }
  551. }
  552. }
  553. },
  554. "x-codeSamples": [
  555. {
  556. "lang": "js",
  557. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  558. }
  559. ]
  560. },
  561. "get": {
  562. "operationId": "experimental.workspace.list",
  563. "parameters": [
  564. {
  565. "in": "query",
  566. "name": "directory",
  567. "schema": {
  568. "type": "string"
  569. }
  570. },
  571. {
  572. "in": "query",
  573. "name": "workspace",
  574. "schema": {
  575. "type": "string"
  576. }
  577. }
  578. ],
  579. "summary": "List workspaces",
  580. "description": "List all workspaces.",
  581. "responses": {
  582. "200": {
  583. "description": "Workspaces",
  584. "content": {
  585. "application/json": {
  586. "schema": {
  587. "type": "array",
  588. "items": {
  589. "$ref": "#/components/schemas/Workspace"
  590. }
  591. }
  592. }
  593. }
  594. }
  595. },
  596. "x-codeSamples": [
  597. {
  598. "lang": "js",
  599. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  600. }
  601. ]
  602. }
  603. },
  604. "/experimental/workspace/status": {
  605. "get": {
  606. "operationId": "experimental.workspace.status",
  607. "parameters": [
  608. {
  609. "in": "query",
  610. "name": "directory",
  611. "schema": {
  612. "type": "string"
  613. }
  614. },
  615. {
  616. "in": "query",
  617. "name": "workspace",
  618. "schema": {
  619. "type": "string"
  620. }
  621. }
  622. ],
  623. "summary": "Workspace status",
  624. "description": "Get connection status for workspaces in the current project.",
  625. "responses": {
  626. "200": {
  627. "description": "Workspace status",
  628. "content": {
  629. "application/json": {
  630. "schema": {
  631. "type": "array",
  632. "items": {
  633. "type": "object",
  634. "properties": {
  635. "workspaceID": {
  636. "type": "string",
  637. "pattern": "^wrk.*"
  638. },
  639. "status": {
  640. "type": "string",
  641. "enum": ["connected", "connecting", "disconnected", "error"]
  642. }
  643. },
  644. "required": ["workspaceID", "status"]
  645. }
  646. }
  647. }
  648. }
  649. }
  650. },
  651. "x-codeSamples": [
  652. {
  653. "lang": "js",
  654. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  655. }
  656. ]
  657. }
  658. },
  659. "/experimental/workspace/{id}": {
  660. "delete": {
  661. "operationId": "experimental.workspace.remove",
  662. "parameters": [
  663. {
  664. "in": "query",
  665. "name": "directory",
  666. "schema": {
  667. "type": "string"
  668. }
  669. },
  670. {
  671. "in": "query",
  672. "name": "workspace",
  673. "schema": {
  674. "type": "string"
  675. }
  676. },
  677. {
  678. "in": "path",
  679. "name": "id",
  680. "schema": {
  681. "type": "string",
  682. "pattern": "^wrk.*"
  683. },
  684. "required": true
  685. }
  686. ],
  687. "summary": "Remove workspace",
  688. "description": "Remove an existing workspace.",
  689. "responses": {
  690. "200": {
  691. "description": "Workspace removed",
  692. "content": {
  693. "application/json": {
  694. "schema": {
  695. "$ref": "#/components/schemas/Workspace"
  696. }
  697. }
  698. }
  699. },
  700. "400": {
  701. "description": "Bad request",
  702. "content": {
  703. "application/json": {
  704. "schema": {
  705. "$ref": "#/components/schemas/BadRequestError"
  706. }
  707. }
  708. }
  709. }
  710. },
  711. "x-codeSamples": [
  712. {
  713. "lang": "js",
  714. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  715. }
  716. ]
  717. }
  718. },
  719. "/experimental/workspace/{id}/session-restore": {
  720. "post": {
  721. "operationId": "experimental.workspace.sessionRestore",
  722. "parameters": [
  723. {
  724. "in": "query",
  725. "name": "directory",
  726. "schema": {
  727. "type": "string"
  728. }
  729. },
  730. {
  731. "in": "query",
  732. "name": "workspace",
  733. "schema": {
  734. "type": "string"
  735. }
  736. },
  737. {
  738. "in": "path",
  739. "name": "id",
  740. "schema": {
  741. "type": "string",
  742. "pattern": "^wrk.*"
  743. },
  744. "required": true
  745. }
  746. ],
  747. "summary": "Restore session into workspace",
  748. "description": "Replay a session's sync events into the target workspace in batches.",
  749. "responses": {
  750. "200": {
  751. "description": "Session replay started",
  752. "content": {
  753. "application/json": {
  754. "schema": {
  755. "type": "object",
  756. "properties": {
  757. "total": {
  758. "type": "integer",
  759. "minimum": 0,
  760. "maximum": 9007199254740991
  761. }
  762. },
  763. "required": ["total"]
  764. }
  765. }
  766. }
  767. },
  768. "400": {
  769. "description": "Bad request",
  770. "content": {
  771. "application/json": {
  772. "schema": {
  773. "$ref": "#/components/schemas/BadRequestError"
  774. }
  775. }
  776. }
  777. }
  778. },
  779. "requestBody": {
  780. "content": {
  781. "application/json": {
  782. "schema": {
  783. "type": "object",
  784. "properties": {
  785. "sessionID": {
  786. "type": "string",
  787. "pattern": "^ses.*"
  788. }
  789. },
  790. "required": ["sessionID"]
  791. }
  792. }
  793. }
  794. },
  795. "x-codeSamples": [
  796. {
  797. "lang": "js",
  798. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.sessionRestore({\n ...\n})"
  799. }
  800. ]
  801. }
  802. },
  803. "/project": {
  804. "get": {
  805. "operationId": "project.list",
  806. "parameters": [
  807. {
  808. "in": "query",
  809. "name": "directory",
  810. "schema": {
  811. "type": "string"
  812. }
  813. },
  814. {
  815. "in": "query",
  816. "name": "workspace",
  817. "schema": {
  818. "type": "string"
  819. }
  820. }
  821. ],
  822. "summary": "List all projects",
  823. "description": "Get a list of projects that have been opened with OpenCode.",
  824. "responses": {
  825. "200": {
  826. "description": "List of projects",
  827. "content": {
  828. "application/json": {
  829. "schema": {
  830. "type": "array",
  831. "items": {
  832. "$ref": "#/components/schemas/Project"
  833. }
  834. }
  835. }
  836. }
  837. }
  838. },
  839. "x-codeSamples": [
  840. {
  841. "lang": "js",
  842. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  843. }
  844. ]
  845. }
  846. },
  847. "/project/current": {
  848. "get": {
  849. "operationId": "project.current",
  850. "parameters": [
  851. {
  852. "in": "query",
  853. "name": "directory",
  854. "schema": {
  855. "type": "string"
  856. }
  857. },
  858. {
  859. "in": "query",
  860. "name": "workspace",
  861. "schema": {
  862. "type": "string"
  863. }
  864. }
  865. ],
  866. "summary": "Get current project",
  867. "description": "Retrieve the currently active project that OpenCode is working with.",
  868. "responses": {
  869. "200": {
  870. "description": "Current project information",
  871. "content": {
  872. "application/json": {
  873. "schema": {
  874. "$ref": "#/components/schemas/Project"
  875. }
  876. }
  877. }
  878. }
  879. },
  880. "x-codeSamples": [
  881. {
  882. "lang": "js",
  883. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  884. }
  885. ]
  886. }
  887. },
  888. "/project/git/init": {
  889. "post": {
  890. "operationId": "project.initGit",
  891. "parameters": [
  892. {
  893. "in": "query",
  894. "name": "directory",
  895. "schema": {
  896. "type": "string"
  897. }
  898. },
  899. {
  900. "in": "query",
  901. "name": "workspace",
  902. "schema": {
  903. "type": "string"
  904. }
  905. }
  906. ],
  907. "summary": "Initialize git repository",
  908. "description": "Create a git repository for the current project and return the refreshed project info.",
  909. "responses": {
  910. "200": {
  911. "description": "Project information after git initialization",
  912. "content": {
  913. "application/json": {
  914. "schema": {
  915. "$ref": "#/components/schemas/Project"
  916. }
  917. }
  918. }
  919. }
  920. },
  921. "x-codeSamples": [
  922. {
  923. "lang": "js",
  924. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  925. }
  926. ]
  927. }
  928. },
  929. "/project/{projectID}": {
  930. "patch": {
  931. "operationId": "project.update",
  932. "parameters": [
  933. {
  934. "in": "query",
  935. "name": "directory",
  936. "schema": {
  937. "type": "string"
  938. }
  939. },
  940. {
  941. "in": "query",
  942. "name": "workspace",
  943. "schema": {
  944. "type": "string"
  945. }
  946. },
  947. {
  948. "in": "path",
  949. "name": "projectID",
  950. "schema": {
  951. "type": "string"
  952. },
  953. "required": true
  954. }
  955. ],
  956. "summary": "Update project",
  957. "description": "Update project properties such as name, icon, and commands.",
  958. "responses": {
  959. "200": {
  960. "description": "Updated project information",
  961. "content": {
  962. "application/json": {
  963. "schema": {
  964. "$ref": "#/components/schemas/Project"
  965. }
  966. }
  967. }
  968. },
  969. "400": {
  970. "description": "Bad request",
  971. "content": {
  972. "application/json": {
  973. "schema": {
  974. "$ref": "#/components/schemas/BadRequestError"
  975. }
  976. }
  977. }
  978. },
  979. "404": {
  980. "description": "Not found",
  981. "content": {
  982. "application/json": {
  983. "schema": {
  984. "$ref": "#/components/schemas/NotFoundError"
  985. }
  986. }
  987. }
  988. }
  989. },
  990. "requestBody": {
  991. "content": {
  992. "application/json": {
  993. "schema": {
  994. "type": "object",
  995. "properties": {
  996. "name": {
  997. "type": "string"
  998. },
  999. "icon": {
  1000. "type": "object",
  1001. "properties": {
  1002. "url": {
  1003. "type": "string"
  1004. },
  1005. "override": {
  1006. "type": "string"
  1007. },
  1008. "color": {
  1009. "type": "string"
  1010. }
  1011. }
  1012. },
  1013. "commands": {
  1014. "type": "object",
  1015. "properties": {
  1016. "start": {
  1017. "description": "Startup script to run when creating a new workspace (worktree)",
  1018. "type": "string"
  1019. }
  1020. }
  1021. }
  1022. }
  1023. }
  1024. }
  1025. }
  1026. },
  1027. "x-codeSamples": [
  1028. {
  1029. "lang": "js",
  1030. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  1031. }
  1032. ]
  1033. }
  1034. },
  1035. "/pty": {
  1036. "get": {
  1037. "operationId": "pty.list",
  1038. "parameters": [
  1039. {
  1040. "in": "query",
  1041. "name": "directory",
  1042. "schema": {
  1043. "type": "string"
  1044. }
  1045. },
  1046. {
  1047. "in": "query",
  1048. "name": "workspace",
  1049. "schema": {
  1050. "type": "string"
  1051. }
  1052. }
  1053. ],
  1054. "summary": "List PTY sessions",
  1055. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  1056. "responses": {
  1057. "200": {
  1058. "description": "List of sessions",
  1059. "content": {
  1060. "application/json": {
  1061. "schema": {
  1062. "type": "array",
  1063. "items": {
  1064. "$ref": "#/components/schemas/Pty"
  1065. }
  1066. }
  1067. }
  1068. }
  1069. }
  1070. },
  1071. "x-codeSamples": [
  1072. {
  1073. "lang": "js",
  1074. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  1075. }
  1076. ]
  1077. },
  1078. "post": {
  1079. "operationId": "pty.create",
  1080. "parameters": [
  1081. {
  1082. "in": "query",
  1083. "name": "directory",
  1084. "schema": {
  1085. "type": "string"
  1086. }
  1087. },
  1088. {
  1089. "in": "query",
  1090. "name": "workspace",
  1091. "schema": {
  1092. "type": "string"
  1093. }
  1094. }
  1095. ],
  1096. "summary": "Create PTY session",
  1097. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  1098. "responses": {
  1099. "200": {
  1100. "description": "Created session",
  1101. "content": {
  1102. "application/json": {
  1103. "schema": {
  1104. "$ref": "#/components/schemas/Pty"
  1105. }
  1106. }
  1107. }
  1108. },
  1109. "400": {
  1110. "description": "Bad request",
  1111. "content": {
  1112. "application/json": {
  1113. "schema": {
  1114. "$ref": "#/components/schemas/BadRequestError"
  1115. }
  1116. }
  1117. }
  1118. }
  1119. },
  1120. "requestBody": {
  1121. "content": {
  1122. "application/json": {
  1123. "schema": {
  1124. "type": "object",
  1125. "properties": {
  1126. "command": {
  1127. "type": "string"
  1128. },
  1129. "args": {
  1130. "type": "array",
  1131. "items": {
  1132. "type": "string"
  1133. }
  1134. },
  1135. "cwd": {
  1136. "type": "string"
  1137. },
  1138. "title": {
  1139. "type": "string"
  1140. },
  1141. "env": {
  1142. "type": "object",
  1143. "propertyNames": {
  1144. "type": "string"
  1145. },
  1146. "additionalProperties": {
  1147. "type": "string"
  1148. }
  1149. }
  1150. }
  1151. }
  1152. }
  1153. }
  1154. },
  1155. "x-codeSamples": [
  1156. {
  1157. "lang": "js",
  1158. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  1159. }
  1160. ]
  1161. }
  1162. },
  1163. "/pty/{ptyID}": {
  1164. "get": {
  1165. "operationId": "pty.get",
  1166. "parameters": [
  1167. {
  1168. "in": "query",
  1169. "name": "directory",
  1170. "schema": {
  1171. "type": "string"
  1172. }
  1173. },
  1174. {
  1175. "in": "query",
  1176. "name": "workspace",
  1177. "schema": {
  1178. "type": "string"
  1179. }
  1180. },
  1181. {
  1182. "in": "path",
  1183. "name": "ptyID",
  1184. "schema": {
  1185. "type": "string",
  1186. "pattern": "^pty.*"
  1187. },
  1188. "required": true
  1189. }
  1190. ],
  1191. "summary": "Get PTY session",
  1192. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  1193. "responses": {
  1194. "200": {
  1195. "description": "Session info",
  1196. "content": {
  1197. "application/json": {
  1198. "schema": {
  1199. "$ref": "#/components/schemas/Pty"
  1200. }
  1201. }
  1202. }
  1203. },
  1204. "404": {
  1205. "description": "Not found",
  1206. "content": {
  1207. "application/json": {
  1208. "schema": {
  1209. "$ref": "#/components/schemas/NotFoundError"
  1210. }
  1211. }
  1212. }
  1213. }
  1214. },
  1215. "x-codeSamples": [
  1216. {
  1217. "lang": "js",
  1218. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  1219. }
  1220. ]
  1221. },
  1222. "put": {
  1223. "operationId": "pty.update",
  1224. "parameters": [
  1225. {
  1226. "in": "query",
  1227. "name": "directory",
  1228. "schema": {
  1229. "type": "string"
  1230. }
  1231. },
  1232. {
  1233. "in": "query",
  1234. "name": "workspace",
  1235. "schema": {
  1236. "type": "string"
  1237. }
  1238. },
  1239. {
  1240. "in": "path",
  1241. "name": "ptyID",
  1242. "schema": {
  1243. "type": "string",
  1244. "pattern": "^pty.*"
  1245. },
  1246. "required": true
  1247. }
  1248. ],
  1249. "summary": "Update PTY session",
  1250. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  1251. "responses": {
  1252. "200": {
  1253. "description": "Updated session",
  1254. "content": {
  1255. "application/json": {
  1256. "schema": {
  1257. "$ref": "#/components/schemas/Pty"
  1258. }
  1259. }
  1260. }
  1261. },
  1262. "400": {
  1263. "description": "Bad request",
  1264. "content": {
  1265. "application/json": {
  1266. "schema": {
  1267. "$ref": "#/components/schemas/BadRequestError"
  1268. }
  1269. }
  1270. }
  1271. }
  1272. },
  1273. "requestBody": {
  1274. "content": {
  1275. "application/json": {
  1276. "schema": {
  1277. "type": "object",
  1278. "properties": {
  1279. "title": {
  1280. "type": "string"
  1281. },
  1282. "size": {
  1283. "type": "object",
  1284. "properties": {
  1285. "rows": {
  1286. "type": "number"
  1287. },
  1288. "cols": {
  1289. "type": "number"
  1290. }
  1291. },
  1292. "required": ["rows", "cols"]
  1293. }
  1294. }
  1295. }
  1296. }
  1297. }
  1298. },
  1299. "x-codeSamples": [
  1300. {
  1301. "lang": "js",
  1302. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  1303. }
  1304. ]
  1305. },
  1306. "delete": {
  1307. "operationId": "pty.remove",
  1308. "parameters": [
  1309. {
  1310. "in": "query",
  1311. "name": "directory",
  1312. "schema": {
  1313. "type": "string"
  1314. }
  1315. },
  1316. {
  1317. "in": "query",
  1318. "name": "workspace",
  1319. "schema": {
  1320. "type": "string"
  1321. }
  1322. },
  1323. {
  1324. "in": "path",
  1325. "name": "ptyID",
  1326. "schema": {
  1327. "type": "string",
  1328. "pattern": "^pty.*"
  1329. },
  1330. "required": true
  1331. }
  1332. ],
  1333. "summary": "Remove PTY session",
  1334. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  1335. "responses": {
  1336. "200": {
  1337. "description": "Session removed",
  1338. "content": {
  1339. "application/json": {
  1340. "schema": {
  1341. "type": "boolean"
  1342. }
  1343. }
  1344. }
  1345. },
  1346. "404": {
  1347. "description": "Not found",
  1348. "content": {
  1349. "application/json": {
  1350. "schema": {
  1351. "$ref": "#/components/schemas/NotFoundError"
  1352. }
  1353. }
  1354. }
  1355. }
  1356. },
  1357. "x-codeSamples": [
  1358. {
  1359. "lang": "js",
  1360. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  1361. }
  1362. ]
  1363. }
  1364. },
  1365. "/pty/{ptyID}/connect": {
  1366. "get": {
  1367. "operationId": "pty.connect",
  1368. "parameters": [
  1369. {
  1370. "in": "query",
  1371. "name": "directory",
  1372. "schema": {
  1373. "type": "string"
  1374. }
  1375. },
  1376. {
  1377. "in": "query",
  1378. "name": "workspace",
  1379. "schema": {
  1380. "type": "string"
  1381. }
  1382. },
  1383. {
  1384. "in": "path",
  1385. "name": "ptyID",
  1386. "schema": {
  1387. "type": "string",
  1388. "pattern": "^pty.*"
  1389. },
  1390. "required": true
  1391. }
  1392. ],
  1393. "summary": "Connect to PTY session",
  1394. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  1395. "responses": {
  1396. "200": {
  1397. "description": "Connected session",
  1398. "content": {
  1399. "application/json": {
  1400. "schema": {
  1401. "type": "boolean"
  1402. }
  1403. }
  1404. }
  1405. },
  1406. "404": {
  1407. "description": "Not found",
  1408. "content": {
  1409. "application/json": {
  1410. "schema": {
  1411. "$ref": "#/components/schemas/NotFoundError"
  1412. }
  1413. }
  1414. }
  1415. }
  1416. },
  1417. "x-codeSamples": [
  1418. {
  1419. "lang": "js",
  1420. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  1421. }
  1422. ]
  1423. }
  1424. },
  1425. "/config": {
  1426. "get": {
  1427. "operationId": "config.get",
  1428. "parameters": [
  1429. {
  1430. "in": "query",
  1431. "name": "directory",
  1432. "schema": {
  1433. "type": "string"
  1434. }
  1435. },
  1436. {
  1437. "in": "query",
  1438. "name": "workspace",
  1439. "schema": {
  1440. "type": "string"
  1441. }
  1442. }
  1443. ],
  1444. "summary": "Get configuration",
  1445. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  1446. "responses": {
  1447. "200": {
  1448. "description": "Get config info",
  1449. "content": {
  1450. "application/json": {
  1451. "schema": {
  1452. "$ref": "#/components/schemas/Config"
  1453. }
  1454. }
  1455. }
  1456. }
  1457. },
  1458. "x-codeSamples": [
  1459. {
  1460. "lang": "js",
  1461. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  1462. }
  1463. ]
  1464. },
  1465. "patch": {
  1466. "operationId": "config.update",
  1467. "parameters": [
  1468. {
  1469. "in": "query",
  1470. "name": "directory",
  1471. "schema": {
  1472. "type": "string"
  1473. }
  1474. },
  1475. {
  1476. "in": "query",
  1477. "name": "workspace",
  1478. "schema": {
  1479. "type": "string"
  1480. }
  1481. }
  1482. ],
  1483. "summary": "Update configuration",
  1484. "description": "Update OpenCode configuration settings and preferences.",
  1485. "responses": {
  1486. "200": {
  1487. "description": "Successfully updated config",
  1488. "content": {
  1489. "application/json": {
  1490. "schema": {
  1491. "$ref": "#/components/schemas/Config"
  1492. }
  1493. }
  1494. }
  1495. },
  1496. "400": {
  1497. "description": "Bad request",
  1498. "content": {
  1499. "application/json": {
  1500. "schema": {
  1501. "$ref": "#/components/schemas/BadRequestError"
  1502. }
  1503. }
  1504. }
  1505. }
  1506. },
  1507. "requestBody": {
  1508. "content": {
  1509. "application/json": {
  1510. "schema": {
  1511. "$ref": "#/components/schemas/Config"
  1512. }
  1513. }
  1514. }
  1515. },
  1516. "x-codeSamples": [
  1517. {
  1518. "lang": "js",
  1519. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  1520. }
  1521. ]
  1522. }
  1523. },
  1524. "/config/providers": {
  1525. "get": {
  1526. "operationId": "config.providers",
  1527. "parameters": [
  1528. {
  1529. "in": "query",
  1530. "name": "directory",
  1531. "schema": {
  1532. "type": "string"
  1533. }
  1534. },
  1535. {
  1536. "in": "query",
  1537. "name": "workspace",
  1538. "schema": {
  1539. "type": "string"
  1540. }
  1541. }
  1542. ],
  1543. "summary": "List config providers",
  1544. "description": "Get a list of all configured AI providers and their default models.",
  1545. "responses": {
  1546. "200": {
  1547. "description": "List of providers",
  1548. "content": {
  1549. "application/json": {
  1550. "schema": {
  1551. "type": "object",
  1552. "properties": {
  1553. "providers": {
  1554. "type": "array",
  1555. "items": {
  1556. "$ref": "#/components/schemas/Provider"
  1557. }
  1558. },
  1559. "default": {
  1560. "type": "object",
  1561. "propertyNames": {
  1562. "type": "string"
  1563. },
  1564. "additionalProperties": {
  1565. "type": "string"
  1566. }
  1567. }
  1568. },
  1569. "required": ["providers", "default"]
  1570. }
  1571. }
  1572. }
  1573. }
  1574. },
  1575. "x-codeSamples": [
  1576. {
  1577. "lang": "js",
  1578. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  1579. }
  1580. ]
  1581. }
  1582. },
  1583. "/experimental/console": {
  1584. "get": {
  1585. "operationId": "experimental.console.get",
  1586. "parameters": [
  1587. {
  1588. "in": "query",
  1589. "name": "directory",
  1590. "schema": {
  1591. "type": "string"
  1592. }
  1593. },
  1594. {
  1595. "in": "query",
  1596. "name": "workspace",
  1597. "schema": {
  1598. "type": "string"
  1599. }
  1600. }
  1601. ],
  1602. "summary": "Get active Console provider metadata",
  1603. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  1604. "responses": {
  1605. "200": {
  1606. "description": "Active Console provider metadata",
  1607. "content": {
  1608. "application/json": {
  1609. "schema": {
  1610. "type": "object",
  1611. "properties": {
  1612. "consoleManagedProviders": {
  1613. "type": "array",
  1614. "items": {
  1615. "type": "string"
  1616. }
  1617. },
  1618. "activeOrgName": {
  1619. "type": "string"
  1620. },
  1621. "switchableOrgCount": {
  1622. "type": "integer",
  1623. "minimum": 0,
  1624. "maximum": 9007199254740991
  1625. }
  1626. },
  1627. "required": ["consoleManagedProviders", "switchableOrgCount"]
  1628. }
  1629. }
  1630. }
  1631. }
  1632. },
  1633. "x-codeSamples": [
  1634. {
  1635. "lang": "js",
  1636. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  1637. }
  1638. ]
  1639. }
  1640. },
  1641. "/experimental/console/orgs": {
  1642. "get": {
  1643. "operationId": "experimental.console.listOrgs",
  1644. "parameters": [
  1645. {
  1646. "in": "query",
  1647. "name": "directory",
  1648. "schema": {
  1649. "type": "string"
  1650. }
  1651. },
  1652. {
  1653. "in": "query",
  1654. "name": "workspace",
  1655. "schema": {
  1656. "type": "string"
  1657. }
  1658. }
  1659. ],
  1660. "summary": "List switchable Console orgs",
  1661. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  1662. "responses": {
  1663. "200": {
  1664. "description": "Switchable Console orgs",
  1665. "content": {
  1666. "application/json": {
  1667. "schema": {
  1668. "type": "object",
  1669. "properties": {
  1670. "orgs": {
  1671. "type": "array",
  1672. "items": {
  1673. "type": "object",
  1674. "properties": {
  1675. "accountID": {
  1676. "type": "string"
  1677. },
  1678. "accountEmail": {
  1679. "type": "string"
  1680. },
  1681. "accountUrl": {
  1682. "type": "string"
  1683. },
  1684. "orgID": {
  1685. "type": "string"
  1686. },
  1687. "orgName": {
  1688. "type": "string"
  1689. },
  1690. "active": {
  1691. "type": "boolean"
  1692. }
  1693. },
  1694. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"]
  1695. }
  1696. }
  1697. },
  1698. "required": ["orgs"]
  1699. }
  1700. }
  1701. }
  1702. }
  1703. },
  1704. "x-codeSamples": [
  1705. {
  1706. "lang": "js",
  1707. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  1708. }
  1709. ]
  1710. }
  1711. },
  1712. "/experimental/console/switch": {
  1713. "post": {
  1714. "operationId": "experimental.console.switchOrg",
  1715. "parameters": [
  1716. {
  1717. "in": "query",
  1718. "name": "directory",
  1719. "schema": {
  1720. "type": "string"
  1721. }
  1722. },
  1723. {
  1724. "in": "query",
  1725. "name": "workspace",
  1726. "schema": {
  1727. "type": "string"
  1728. }
  1729. }
  1730. ],
  1731. "summary": "Switch active Console org",
  1732. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  1733. "responses": {
  1734. "200": {
  1735. "description": "Switch success",
  1736. "content": {
  1737. "application/json": {
  1738. "schema": {
  1739. "type": "boolean"
  1740. }
  1741. }
  1742. }
  1743. }
  1744. },
  1745. "requestBody": {
  1746. "content": {
  1747. "application/json": {
  1748. "schema": {
  1749. "type": "object",
  1750. "properties": {
  1751. "accountID": {
  1752. "type": "string"
  1753. },
  1754. "orgID": {
  1755. "type": "string"
  1756. }
  1757. },
  1758. "required": ["accountID", "orgID"]
  1759. }
  1760. }
  1761. }
  1762. },
  1763. "x-codeSamples": [
  1764. {
  1765. "lang": "js",
  1766. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  1767. }
  1768. ]
  1769. }
  1770. },
  1771. "/experimental/tool/ids": {
  1772. "get": {
  1773. "operationId": "tool.ids",
  1774. "parameters": [
  1775. {
  1776. "in": "query",
  1777. "name": "directory",
  1778. "schema": {
  1779. "type": "string"
  1780. }
  1781. },
  1782. {
  1783. "in": "query",
  1784. "name": "workspace",
  1785. "schema": {
  1786. "type": "string"
  1787. }
  1788. }
  1789. ],
  1790. "summary": "List tool IDs",
  1791. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  1792. "responses": {
  1793. "200": {
  1794. "description": "Tool IDs",
  1795. "content": {
  1796. "application/json": {
  1797. "schema": {
  1798. "$ref": "#/components/schemas/ToolIDs"
  1799. }
  1800. }
  1801. }
  1802. },
  1803. "400": {
  1804. "description": "Bad request",
  1805. "content": {
  1806. "application/json": {
  1807. "schema": {
  1808. "$ref": "#/components/schemas/BadRequestError"
  1809. }
  1810. }
  1811. }
  1812. }
  1813. },
  1814. "x-codeSamples": [
  1815. {
  1816. "lang": "js",
  1817. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  1818. }
  1819. ]
  1820. }
  1821. },
  1822. "/experimental/tool": {
  1823. "get": {
  1824. "operationId": "tool.list",
  1825. "parameters": [
  1826. {
  1827. "in": "query",
  1828. "name": "directory",
  1829. "schema": {
  1830. "type": "string"
  1831. }
  1832. },
  1833. {
  1834. "in": "query",
  1835. "name": "workspace",
  1836. "schema": {
  1837. "type": "string"
  1838. }
  1839. },
  1840. {
  1841. "in": "query",
  1842. "name": "provider",
  1843. "schema": {
  1844. "type": "string"
  1845. },
  1846. "required": true
  1847. },
  1848. {
  1849. "in": "query",
  1850. "name": "model",
  1851. "schema": {
  1852. "type": "string"
  1853. },
  1854. "required": true
  1855. }
  1856. ],
  1857. "summary": "List tools",
  1858. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  1859. "responses": {
  1860. "200": {
  1861. "description": "Tools",
  1862. "content": {
  1863. "application/json": {
  1864. "schema": {
  1865. "$ref": "#/components/schemas/ToolList"
  1866. }
  1867. }
  1868. }
  1869. },
  1870. "400": {
  1871. "description": "Bad request",
  1872. "content": {
  1873. "application/json": {
  1874. "schema": {
  1875. "$ref": "#/components/schemas/BadRequestError"
  1876. }
  1877. }
  1878. }
  1879. }
  1880. },
  1881. "x-codeSamples": [
  1882. {
  1883. "lang": "js",
  1884. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  1885. }
  1886. ]
  1887. }
  1888. },
  1889. "/experimental/worktree": {
  1890. "post": {
  1891. "operationId": "worktree.create",
  1892. "parameters": [
  1893. {
  1894. "in": "query",
  1895. "name": "directory",
  1896. "schema": {
  1897. "type": "string"
  1898. }
  1899. },
  1900. {
  1901. "in": "query",
  1902. "name": "workspace",
  1903. "schema": {
  1904. "type": "string"
  1905. }
  1906. }
  1907. ],
  1908. "summary": "Create worktree",
  1909. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1910. "responses": {
  1911. "200": {
  1912. "description": "Worktree created",
  1913. "content": {
  1914. "application/json": {
  1915. "schema": {
  1916. "$ref": "#/components/schemas/Worktree"
  1917. }
  1918. }
  1919. }
  1920. },
  1921. "400": {
  1922. "description": "Bad request",
  1923. "content": {
  1924. "application/json": {
  1925. "schema": {
  1926. "$ref": "#/components/schemas/BadRequestError"
  1927. }
  1928. }
  1929. }
  1930. }
  1931. },
  1932. "requestBody": {
  1933. "content": {
  1934. "application/json": {
  1935. "schema": {
  1936. "$ref": "#/components/schemas/WorktreeCreateInput"
  1937. }
  1938. }
  1939. }
  1940. },
  1941. "x-codeSamples": [
  1942. {
  1943. "lang": "js",
  1944. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1945. }
  1946. ]
  1947. },
  1948. "get": {
  1949. "operationId": "worktree.list",
  1950. "parameters": [
  1951. {
  1952. "in": "query",
  1953. "name": "directory",
  1954. "schema": {
  1955. "type": "string"
  1956. }
  1957. },
  1958. {
  1959. "in": "query",
  1960. "name": "workspace",
  1961. "schema": {
  1962. "type": "string"
  1963. }
  1964. }
  1965. ],
  1966. "summary": "List worktrees",
  1967. "description": "List all sandbox worktrees for the current project.",
  1968. "responses": {
  1969. "200": {
  1970. "description": "List of worktree directories",
  1971. "content": {
  1972. "application/json": {
  1973. "schema": {
  1974. "type": "array",
  1975. "items": {
  1976. "type": "string"
  1977. }
  1978. }
  1979. }
  1980. }
  1981. }
  1982. },
  1983. "x-codeSamples": [
  1984. {
  1985. "lang": "js",
  1986. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1987. }
  1988. ]
  1989. },
  1990. "delete": {
  1991. "operationId": "worktree.remove",
  1992. "parameters": [
  1993. {
  1994. "in": "query",
  1995. "name": "directory",
  1996. "schema": {
  1997. "type": "string"
  1998. }
  1999. },
  2000. {
  2001. "in": "query",
  2002. "name": "workspace",
  2003. "schema": {
  2004. "type": "string"
  2005. }
  2006. }
  2007. ],
  2008. "summary": "Remove worktree",
  2009. "description": "Remove a git worktree and delete its branch.",
  2010. "responses": {
  2011. "200": {
  2012. "description": "Worktree removed",
  2013. "content": {
  2014. "application/json": {
  2015. "schema": {
  2016. "type": "boolean"
  2017. }
  2018. }
  2019. }
  2020. },
  2021. "400": {
  2022. "description": "Bad request",
  2023. "content": {
  2024. "application/json": {
  2025. "schema": {
  2026. "$ref": "#/components/schemas/BadRequestError"
  2027. }
  2028. }
  2029. }
  2030. }
  2031. },
  2032. "requestBody": {
  2033. "content": {
  2034. "application/json": {
  2035. "schema": {
  2036. "$ref": "#/components/schemas/WorktreeRemoveInput"
  2037. }
  2038. }
  2039. }
  2040. },
  2041. "x-codeSamples": [
  2042. {
  2043. "lang": "js",
  2044. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  2045. }
  2046. ]
  2047. }
  2048. },
  2049. "/experimental/worktree/reset": {
  2050. "post": {
  2051. "operationId": "worktree.reset",
  2052. "parameters": [
  2053. {
  2054. "in": "query",
  2055. "name": "directory",
  2056. "schema": {
  2057. "type": "string"
  2058. }
  2059. },
  2060. {
  2061. "in": "query",
  2062. "name": "workspace",
  2063. "schema": {
  2064. "type": "string"
  2065. }
  2066. }
  2067. ],
  2068. "summary": "Reset worktree",
  2069. "description": "Reset a worktree branch to the primary default branch.",
  2070. "responses": {
  2071. "200": {
  2072. "description": "Worktree reset",
  2073. "content": {
  2074. "application/json": {
  2075. "schema": {
  2076. "type": "boolean"
  2077. }
  2078. }
  2079. }
  2080. },
  2081. "400": {
  2082. "description": "Bad request",
  2083. "content": {
  2084. "application/json": {
  2085. "schema": {
  2086. "$ref": "#/components/schemas/BadRequestError"
  2087. }
  2088. }
  2089. }
  2090. }
  2091. },
  2092. "requestBody": {
  2093. "content": {
  2094. "application/json": {
  2095. "schema": {
  2096. "$ref": "#/components/schemas/WorktreeResetInput"
  2097. }
  2098. }
  2099. }
  2100. },
  2101. "x-codeSamples": [
  2102. {
  2103. "lang": "js",
  2104. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  2105. }
  2106. ]
  2107. }
  2108. },
  2109. "/experimental/session": {
  2110. "get": {
  2111. "operationId": "experimental.session.list",
  2112. "parameters": [
  2113. {
  2114. "in": "query",
  2115. "name": "directory",
  2116. "schema": {
  2117. "type": "string"
  2118. },
  2119. "description": "Filter sessions by project directory"
  2120. },
  2121. {
  2122. "in": "query",
  2123. "name": "workspace",
  2124. "schema": {
  2125. "type": "string"
  2126. }
  2127. },
  2128. {
  2129. "in": "query",
  2130. "name": "roots",
  2131. "schema": {
  2132. "type": "boolean"
  2133. },
  2134. "description": "Only return root sessions (no parentID)"
  2135. },
  2136. {
  2137. "in": "query",
  2138. "name": "start",
  2139. "schema": {
  2140. "type": "number"
  2141. },
  2142. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2143. },
  2144. {
  2145. "in": "query",
  2146. "name": "cursor",
  2147. "schema": {
  2148. "type": "number"
  2149. },
  2150. "description": "Return sessions updated before this timestamp (milliseconds since epoch)"
  2151. },
  2152. {
  2153. "in": "query",
  2154. "name": "search",
  2155. "schema": {
  2156. "type": "string"
  2157. },
  2158. "description": "Filter sessions by title (case-insensitive)"
  2159. },
  2160. {
  2161. "in": "query",
  2162. "name": "limit",
  2163. "schema": {
  2164. "type": "number"
  2165. },
  2166. "description": "Maximum number of sessions to return"
  2167. },
  2168. {
  2169. "in": "query",
  2170. "name": "archived",
  2171. "schema": {
  2172. "type": "boolean"
  2173. },
  2174. "description": "Include archived sessions (default false)"
  2175. }
  2176. ],
  2177. "summary": "List sessions",
  2178. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  2179. "responses": {
  2180. "200": {
  2181. "description": "List of sessions",
  2182. "content": {
  2183. "application/json": {
  2184. "schema": {
  2185. "type": "array",
  2186. "items": {
  2187. "$ref": "#/components/schemas/GlobalSession"
  2188. }
  2189. }
  2190. }
  2191. }
  2192. }
  2193. },
  2194. "x-codeSamples": [
  2195. {
  2196. "lang": "js",
  2197. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  2198. }
  2199. ]
  2200. }
  2201. },
  2202. "/experimental/resource": {
  2203. "get": {
  2204. "operationId": "experimental.resource.list",
  2205. "parameters": [
  2206. {
  2207. "in": "query",
  2208. "name": "directory",
  2209. "schema": {
  2210. "type": "string"
  2211. }
  2212. },
  2213. {
  2214. "in": "query",
  2215. "name": "workspace",
  2216. "schema": {
  2217. "type": "string"
  2218. }
  2219. }
  2220. ],
  2221. "summary": "Get MCP resources",
  2222. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  2223. "responses": {
  2224. "200": {
  2225. "description": "MCP resources",
  2226. "content": {
  2227. "application/json": {
  2228. "schema": {
  2229. "type": "object",
  2230. "propertyNames": {
  2231. "type": "string"
  2232. },
  2233. "additionalProperties": {
  2234. "$ref": "#/components/schemas/McpResource"
  2235. }
  2236. }
  2237. }
  2238. }
  2239. }
  2240. },
  2241. "x-codeSamples": [
  2242. {
  2243. "lang": "js",
  2244. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  2245. }
  2246. ]
  2247. }
  2248. },
  2249. "/session": {
  2250. "get": {
  2251. "operationId": "session.list",
  2252. "parameters": [
  2253. {
  2254. "in": "query",
  2255. "name": "directory",
  2256. "schema": {
  2257. "type": "string"
  2258. },
  2259. "description": "Filter sessions by project directory"
  2260. },
  2261. {
  2262. "in": "query",
  2263. "name": "workspace",
  2264. "schema": {
  2265. "type": "string"
  2266. }
  2267. },
  2268. {
  2269. "in": "query",
  2270. "name": "roots",
  2271. "schema": {
  2272. "type": "boolean"
  2273. },
  2274. "description": "Only return root sessions (no parentID)"
  2275. },
  2276. {
  2277. "in": "query",
  2278. "name": "start",
  2279. "schema": {
  2280. "type": "number"
  2281. },
  2282. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2283. },
  2284. {
  2285. "in": "query",
  2286. "name": "search",
  2287. "schema": {
  2288. "type": "string"
  2289. },
  2290. "description": "Filter sessions by title (case-insensitive)"
  2291. },
  2292. {
  2293. "in": "query",
  2294. "name": "limit",
  2295. "schema": {
  2296. "type": "number"
  2297. },
  2298. "description": "Maximum number of sessions to return"
  2299. }
  2300. ],
  2301. "summary": "List sessions",
  2302. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  2303. "responses": {
  2304. "200": {
  2305. "description": "List of sessions",
  2306. "content": {
  2307. "application/json": {
  2308. "schema": {
  2309. "type": "array",
  2310. "items": {
  2311. "$ref": "#/components/schemas/Session"
  2312. }
  2313. }
  2314. }
  2315. }
  2316. }
  2317. },
  2318. "x-codeSamples": [
  2319. {
  2320. "lang": "js",
  2321. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  2322. }
  2323. ]
  2324. },
  2325. "post": {
  2326. "operationId": "session.create",
  2327. "parameters": [
  2328. {
  2329. "in": "query",
  2330. "name": "directory",
  2331. "schema": {
  2332. "type": "string"
  2333. }
  2334. },
  2335. {
  2336. "in": "query",
  2337. "name": "workspace",
  2338. "schema": {
  2339. "type": "string"
  2340. }
  2341. }
  2342. ],
  2343. "summary": "Create session",
  2344. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  2345. "responses": {
  2346. "200": {
  2347. "description": "Successfully created session",
  2348. "content": {
  2349. "application/json": {
  2350. "schema": {
  2351. "$ref": "#/components/schemas/Session"
  2352. }
  2353. }
  2354. }
  2355. },
  2356. "400": {
  2357. "description": "Bad request",
  2358. "content": {
  2359. "application/json": {
  2360. "schema": {
  2361. "$ref": "#/components/schemas/BadRequestError"
  2362. }
  2363. }
  2364. }
  2365. }
  2366. },
  2367. "requestBody": {
  2368. "content": {
  2369. "application/json": {
  2370. "schema": {
  2371. "type": "object",
  2372. "properties": {
  2373. "parentID": {
  2374. "type": "string",
  2375. "pattern": "^ses.*"
  2376. },
  2377. "title": {
  2378. "type": "string"
  2379. },
  2380. "permission": {
  2381. "$ref": "#/components/schemas/PermissionRuleset"
  2382. },
  2383. "workspaceID": {
  2384. "type": "string",
  2385. "pattern": "^wrk.*"
  2386. }
  2387. }
  2388. }
  2389. }
  2390. }
  2391. },
  2392. "x-codeSamples": [
  2393. {
  2394. "lang": "js",
  2395. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  2396. }
  2397. ]
  2398. }
  2399. },
  2400. "/session/status": {
  2401. "get": {
  2402. "operationId": "session.status",
  2403. "parameters": [
  2404. {
  2405. "in": "query",
  2406. "name": "directory",
  2407. "schema": {
  2408. "type": "string"
  2409. }
  2410. },
  2411. {
  2412. "in": "query",
  2413. "name": "workspace",
  2414. "schema": {
  2415. "type": "string"
  2416. }
  2417. }
  2418. ],
  2419. "summary": "Get session status",
  2420. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  2421. "responses": {
  2422. "200": {
  2423. "description": "Get session status",
  2424. "content": {
  2425. "application/json": {
  2426. "schema": {
  2427. "type": "object",
  2428. "propertyNames": {
  2429. "type": "string"
  2430. },
  2431. "additionalProperties": {
  2432. "$ref": "#/components/schemas/SessionStatus"
  2433. }
  2434. }
  2435. }
  2436. }
  2437. },
  2438. "400": {
  2439. "description": "Bad request",
  2440. "content": {
  2441. "application/json": {
  2442. "schema": {
  2443. "$ref": "#/components/schemas/BadRequestError"
  2444. }
  2445. }
  2446. }
  2447. }
  2448. },
  2449. "x-codeSamples": [
  2450. {
  2451. "lang": "js",
  2452. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  2453. }
  2454. ]
  2455. }
  2456. },
  2457. "/session/{sessionID}": {
  2458. "get": {
  2459. "operationId": "session.get",
  2460. "parameters": [
  2461. {
  2462. "in": "query",
  2463. "name": "directory",
  2464. "schema": {
  2465. "type": "string"
  2466. }
  2467. },
  2468. {
  2469. "in": "query",
  2470. "name": "workspace",
  2471. "schema": {
  2472. "type": "string"
  2473. }
  2474. },
  2475. {
  2476. "in": "path",
  2477. "name": "sessionID",
  2478. "schema": {
  2479. "type": "string",
  2480. "pattern": "^ses.*"
  2481. },
  2482. "required": true
  2483. }
  2484. ],
  2485. "summary": "Get session",
  2486. "description": "Retrieve detailed information about a specific OpenCode session.",
  2487. "tags": ["Session"],
  2488. "responses": {
  2489. "200": {
  2490. "description": "Get session",
  2491. "content": {
  2492. "application/json": {
  2493. "schema": {
  2494. "$ref": "#/components/schemas/Session"
  2495. }
  2496. }
  2497. }
  2498. },
  2499. "400": {
  2500. "description": "Bad request",
  2501. "content": {
  2502. "application/json": {
  2503. "schema": {
  2504. "$ref": "#/components/schemas/BadRequestError"
  2505. }
  2506. }
  2507. }
  2508. },
  2509. "404": {
  2510. "description": "Not found",
  2511. "content": {
  2512. "application/json": {
  2513. "schema": {
  2514. "$ref": "#/components/schemas/NotFoundError"
  2515. }
  2516. }
  2517. }
  2518. }
  2519. },
  2520. "x-codeSamples": [
  2521. {
  2522. "lang": "js",
  2523. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  2524. }
  2525. ]
  2526. },
  2527. "delete": {
  2528. "operationId": "session.delete",
  2529. "parameters": [
  2530. {
  2531. "in": "query",
  2532. "name": "directory",
  2533. "schema": {
  2534. "type": "string"
  2535. }
  2536. },
  2537. {
  2538. "in": "query",
  2539. "name": "workspace",
  2540. "schema": {
  2541. "type": "string"
  2542. }
  2543. },
  2544. {
  2545. "in": "path",
  2546. "name": "sessionID",
  2547. "schema": {
  2548. "type": "string",
  2549. "pattern": "^ses.*"
  2550. },
  2551. "required": true
  2552. }
  2553. ],
  2554. "summary": "Delete session",
  2555. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  2556. "responses": {
  2557. "200": {
  2558. "description": "Successfully deleted session",
  2559. "content": {
  2560. "application/json": {
  2561. "schema": {
  2562. "type": "boolean"
  2563. }
  2564. }
  2565. }
  2566. },
  2567. "400": {
  2568. "description": "Bad request",
  2569. "content": {
  2570. "application/json": {
  2571. "schema": {
  2572. "$ref": "#/components/schemas/BadRequestError"
  2573. }
  2574. }
  2575. }
  2576. },
  2577. "404": {
  2578. "description": "Not found",
  2579. "content": {
  2580. "application/json": {
  2581. "schema": {
  2582. "$ref": "#/components/schemas/NotFoundError"
  2583. }
  2584. }
  2585. }
  2586. }
  2587. },
  2588. "x-codeSamples": [
  2589. {
  2590. "lang": "js",
  2591. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  2592. }
  2593. ]
  2594. },
  2595. "patch": {
  2596. "operationId": "session.update",
  2597. "parameters": [
  2598. {
  2599. "in": "query",
  2600. "name": "directory",
  2601. "schema": {
  2602. "type": "string"
  2603. }
  2604. },
  2605. {
  2606. "in": "query",
  2607. "name": "workspace",
  2608. "schema": {
  2609. "type": "string"
  2610. }
  2611. },
  2612. {
  2613. "in": "path",
  2614. "name": "sessionID",
  2615. "schema": {
  2616. "type": "string",
  2617. "pattern": "^ses.*"
  2618. },
  2619. "required": true
  2620. }
  2621. ],
  2622. "summary": "Update session",
  2623. "description": "Update properties of an existing session, such as title or other metadata.",
  2624. "responses": {
  2625. "200": {
  2626. "description": "Successfully updated session",
  2627. "content": {
  2628. "application/json": {
  2629. "schema": {
  2630. "$ref": "#/components/schemas/Session"
  2631. }
  2632. }
  2633. }
  2634. },
  2635. "400": {
  2636. "description": "Bad request",
  2637. "content": {
  2638. "application/json": {
  2639. "schema": {
  2640. "$ref": "#/components/schemas/BadRequestError"
  2641. }
  2642. }
  2643. }
  2644. },
  2645. "404": {
  2646. "description": "Not found",
  2647. "content": {
  2648. "application/json": {
  2649. "schema": {
  2650. "$ref": "#/components/schemas/NotFoundError"
  2651. }
  2652. }
  2653. }
  2654. }
  2655. },
  2656. "requestBody": {
  2657. "content": {
  2658. "application/json": {
  2659. "schema": {
  2660. "type": "object",
  2661. "properties": {
  2662. "title": {
  2663. "type": "string"
  2664. },
  2665. "permission": {
  2666. "$ref": "#/components/schemas/PermissionRuleset"
  2667. },
  2668. "time": {
  2669. "type": "object",
  2670. "properties": {
  2671. "archived": {
  2672. "type": "number"
  2673. }
  2674. }
  2675. }
  2676. }
  2677. }
  2678. }
  2679. }
  2680. },
  2681. "x-codeSamples": [
  2682. {
  2683. "lang": "js",
  2684. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  2685. }
  2686. ]
  2687. }
  2688. },
  2689. "/session/{sessionID}/children": {
  2690. "get": {
  2691. "operationId": "session.children",
  2692. "parameters": [
  2693. {
  2694. "in": "query",
  2695. "name": "directory",
  2696. "schema": {
  2697. "type": "string"
  2698. }
  2699. },
  2700. {
  2701. "in": "query",
  2702. "name": "workspace",
  2703. "schema": {
  2704. "type": "string"
  2705. }
  2706. },
  2707. {
  2708. "in": "path",
  2709. "name": "sessionID",
  2710. "schema": {
  2711. "type": "string",
  2712. "pattern": "^ses.*"
  2713. },
  2714. "required": true
  2715. }
  2716. ],
  2717. "summary": "Get session children",
  2718. "tags": ["Session"],
  2719. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  2720. "responses": {
  2721. "200": {
  2722. "description": "List of children",
  2723. "content": {
  2724. "application/json": {
  2725. "schema": {
  2726. "type": "array",
  2727. "items": {
  2728. "$ref": "#/components/schemas/Session"
  2729. }
  2730. }
  2731. }
  2732. }
  2733. },
  2734. "400": {
  2735. "description": "Bad request",
  2736. "content": {
  2737. "application/json": {
  2738. "schema": {
  2739. "$ref": "#/components/schemas/BadRequestError"
  2740. }
  2741. }
  2742. }
  2743. },
  2744. "404": {
  2745. "description": "Not found",
  2746. "content": {
  2747. "application/json": {
  2748. "schema": {
  2749. "$ref": "#/components/schemas/NotFoundError"
  2750. }
  2751. }
  2752. }
  2753. }
  2754. },
  2755. "x-codeSamples": [
  2756. {
  2757. "lang": "js",
  2758. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  2759. }
  2760. ]
  2761. }
  2762. },
  2763. "/session/{sessionID}/todo": {
  2764. "get": {
  2765. "operationId": "session.todo",
  2766. "parameters": [
  2767. {
  2768. "in": "query",
  2769. "name": "directory",
  2770. "schema": {
  2771. "type": "string"
  2772. }
  2773. },
  2774. {
  2775. "in": "query",
  2776. "name": "workspace",
  2777. "schema": {
  2778. "type": "string"
  2779. }
  2780. },
  2781. {
  2782. "in": "path",
  2783. "name": "sessionID",
  2784. "schema": {
  2785. "type": "string",
  2786. "pattern": "^ses.*"
  2787. },
  2788. "required": true
  2789. }
  2790. ],
  2791. "summary": "Get session todos",
  2792. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  2793. "responses": {
  2794. "200": {
  2795. "description": "Todo list",
  2796. "content": {
  2797. "application/json": {
  2798. "schema": {
  2799. "type": "array",
  2800. "items": {
  2801. "$ref": "#/components/schemas/Todo"
  2802. }
  2803. }
  2804. }
  2805. }
  2806. },
  2807. "400": {
  2808. "description": "Bad request",
  2809. "content": {
  2810. "application/json": {
  2811. "schema": {
  2812. "$ref": "#/components/schemas/BadRequestError"
  2813. }
  2814. }
  2815. }
  2816. },
  2817. "404": {
  2818. "description": "Not found",
  2819. "content": {
  2820. "application/json": {
  2821. "schema": {
  2822. "$ref": "#/components/schemas/NotFoundError"
  2823. }
  2824. }
  2825. }
  2826. }
  2827. },
  2828. "x-codeSamples": [
  2829. {
  2830. "lang": "js",
  2831. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  2832. }
  2833. ]
  2834. }
  2835. },
  2836. "/session/{sessionID}/init": {
  2837. "post": {
  2838. "operationId": "session.init",
  2839. "parameters": [
  2840. {
  2841. "in": "query",
  2842. "name": "directory",
  2843. "schema": {
  2844. "type": "string"
  2845. }
  2846. },
  2847. {
  2848. "in": "query",
  2849. "name": "workspace",
  2850. "schema": {
  2851. "type": "string"
  2852. }
  2853. },
  2854. {
  2855. "in": "path",
  2856. "name": "sessionID",
  2857. "schema": {
  2858. "type": "string",
  2859. "pattern": "^ses.*"
  2860. },
  2861. "required": true
  2862. }
  2863. ],
  2864. "summary": "Initialize session",
  2865. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  2866. "responses": {
  2867. "200": {
  2868. "description": "200",
  2869. "content": {
  2870. "application/json": {
  2871. "schema": {
  2872. "type": "boolean"
  2873. }
  2874. }
  2875. }
  2876. },
  2877. "400": {
  2878. "description": "Bad request",
  2879. "content": {
  2880. "application/json": {
  2881. "schema": {
  2882. "$ref": "#/components/schemas/BadRequestError"
  2883. }
  2884. }
  2885. }
  2886. },
  2887. "404": {
  2888. "description": "Not found",
  2889. "content": {
  2890. "application/json": {
  2891. "schema": {
  2892. "$ref": "#/components/schemas/NotFoundError"
  2893. }
  2894. }
  2895. }
  2896. }
  2897. },
  2898. "requestBody": {
  2899. "content": {
  2900. "application/json": {
  2901. "schema": {
  2902. "type": "object",
  2903. "properties": {
  2904. "modelID": {
  2905. "type": "string"
  2906. },
  2907. "providerID": {
  2908. "type": "string"
  2909. },
  2910. "messageID": {
  2911. "type": "string",
  2912. "pattern": "^msg.*"
  2913. }
  2914. },
  2915. "required": ["modelID", "providerID", "messageID"]
  2916. }
  2917. }
  2918. }
  2919. },
  2920. "x-codeSamples": [
  2921. {
  2922. "lang": "js",
  2923. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  2924. }
  2925. ]
  2926. }
  2927. },
  2928. "/session/{sessionID}/fork": {
  2929. "post": {
  2930. "operationId": "session.fork",
  2931. "parameters": [
  2932. {
  2933. "in": "query",
  2934. "name": "directory",
  2935. "schema": {
  2936. "type": "string"
  2937. }
  2938. },
  2939. {
  2940. "in": "query",
  2941. "name": "workspace",
  2942. "schema": {
  2943. "type": "string"
  2944. }
  2945. },
  2946. {
  2947. "in": "path",
  2948. "name": "sessionID",
  2949. "schema": {
  2950. "type": "string",
  2951. "pattern": "^ses.*"
  2952. },
  2953. "required": true
  2954. }
  2955. ],
  2956. "summary": "Fork session",
  2957. "description": "Create a new session by forking an existing session at a specific message point.",
  2958. "responses": {
  2959. "200": {
  2960. "description": "200",
  2961. "content": {
  2962. "application/json": {
  2963. "schema": {
  2964. "$ref": "#/components/schemas/Session"
  2965. }
  2966. }
  2967. }
  2968. }
  2969. },
  2970. "requestBody": {
  2971. "content": {
  2972. "application/json": {
  2973. "schema": {
  2974. "type": "object",
  2975. "properties": {
  2976. "messageID": {
  2977. "type": "string",
  2978. "pattern": "^msg.*"
  2979. }
  2980. }
  2981. }
  2982. }
  2983. }
  2984. },
  2985. "x-codeSamples": [
  2986. {
  2987. "lang": "js",
  2988. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  2989. }
  2990. ]
  2991. }
  2992. },
  2993. "/session/{sessionID}/abort": {
  2994. "post": {
  2995. "operationId": "session.abort",
  2996. "parameters": [
  2997. {
  2998. "in": "query",
  2999. "name": "directory",
  3000. "schema": {
  3001. "type": "string"
  3002. }
  3003. },
  3004. {
  3005. "in": "query",
  3006. "name": "workspace",
  3007. "schema": {
  3008. "type": "string"
  3009. }
  3010. },
  3011. {
  3012. "in": "path",
  3013. "name": "sessionID",
  3014. "schema": {
  3015. "type": "string",
  3016. "pattern": "^ses.*"
  3017. },
  3018. "required": true
  3019. }
  3020. ],
  3021. "summary": "Abort session",
  3022. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  3023. "responses": {
  3024. "200": {
  3025. "description": "Aborted session",
  3026. "content": {
  3027. "application/json": {
  3028. "schema": {
  3029. "type": "boolean"
  3030. }
  3031. }
  3032. }
  3033. },
  3034. "400": {
  3035. "description": "Bad request",
  3036. "content": {
  3037. "application/json": {
  3038. "schema": {
  3039. "$ref": "#/components/schemas/BadRequestError"
  3040. }
  3041. }
  3042. }
  3043. },
  3044. "404": {
  3045. "description": "Not found",
  3046. "content": {
  3047. "application/json": {
  3048. "schema": {
  3049. "$ref": "#/components/schemas/NotFoundError"
  3050. }
  3051. }
  3052. }
  3053. }
  3054. },
  3055. "x-codeSamples": [
  3056. {
  3057. "lang": "js",
  3058. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  3059. }
  3060. ]
  3061. }
  3062. },
  3063. "/session/{sessionID}/share": {
  3064. "post": {
  3065. "operationId": "session.share",
  3066. "parameters": [
  3067. {
  3068. "in": "query",
  3069. "name": "directory",
  3070. "schema": {
  3071. "type": "string"
  3072. }
  3073. },
  3074. {
  3075. "in": "query",
  3076. "name": "workspace",
  3077. "schema": {
  3078. "type": "string"
  3079. }
  3080. },
  3081. {
  3082. "in": "path",
  3083. "name": "sessionID",
  3084. "schema": {
  3085. "type": "string",
  3086. "pattern": "^ses.*"
  3087. },
  3088. "required": true
  3089. }
  3090. ],
  3091. "summary": "Share session",
  3092. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  3093. "responses": {
  3094. "200": {
  3095. "description": "Successfully shared session",
  3096. "content": {
  3097. "application/json": {
  3098. "schema": {
  3099. "$ref": "#/components/schemas/Session"
  3100. }
  3101. }
  3102. }
  3103. },
  3104. "400": {
  3105. "description": "Bad request",
  3106. "content": {
  3107. "application/json": {
  3108. "schema": {
  3109. "$ref": "#/components/schemas/BadRequestError"
  3110. }
  3111. }
  3112. }
  3113. },
  3114. "404": {
  3115. "description": "Not found",
  3116. "content": {
  3117. "application/json": {
  3118. "schema": {
  3119. "$ref": "#/components/schemas/NotFoundError"
  3120. }
  3121. }
  3122. }
  3123. }
  3124. },
  3125. "x-codeSamples": [
  3126. {
  3127. "lang": "js",
  3128. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  3129. }
  3130. ]
  3131. },
  3132. "delete": {
  3133. "operationId": "session.unshare",
  3134. "parameters": [
  3135. {
  3136. "in": "query",
  3137. "name": "directory",
  3138. "schema": {
  3139. "type": "string"
  3140. }
  3141. },
  3142. {
  3143. "in": "query",
  3144. "name": "workspace",
  3145. "schema": {
  3146. "type": "string"
  3147. }
  3148. },
  3149. {
  3150. "in": "path",
  3151. "name": "sessionID",
  3152. "schema": {
  3153. "type": "string",
  3154. "pattern": "^ses.*"
  3155. },
  3156. "required": true
  3157. }
  3158. ],
  3159. "summary": "Unshare session",
  3160. "description": "Remove the shareable link for a session, making it private again.",
  3161. "responses": {
  3162. "200": {
  3163. "description": "Successfully unshared session",
  3164. "content": {
  3165. "application/json": {
  3166. "schema": {
  3167. "$ref": "#/components/schemas/Session"
  3168. }
  3169. }
  3170. }
  3171. },
  3172. "400": {
  3173. "description": "Bad request",
  3174. "content": {
  3175. "application/json": {
  3176. "schema": {
  3177. "$ref": "#/components/schemas/BadRequestError"
  3178. }
  3179. }
  3180. }
  3181. },
  3182. "404": {
  3183. "description": "Not found",
  3184. "content": {
  3185. "application/json": {
  3186. "schema": {
  3187. "$ref": "#/components/schemas/NotFoundError"
  3188. }
  3189. }
  3190. }
  3191. }
  3192. },
  3193. "x-codeSamples": [
  3194. {
  3195. "lang": "js",
  3196. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  3197. }
  3198. ]
  3199. }
  3200. },
  3201. "/session/{sessionID}/diff": {
  3202. "get": {
  3203. "operationId": "session.diff",
  3204. "parameters": [
  3205. {
  3206. "in": "query",
  3207. "name": "directory",
  3208. "schema": {
  3209. "type": "string"
  3210. }
  3211. },
  3212. {
  3213. "in": "query",
  3214. "name": "workspace",
  3215. "schema": {
  3216. "type": "string"
  3217. }
  3218. },
  3219. {
  3220. "in": "path",
  3221. "name": "sessionID",
  3222. "schema": {
  3223. "type": "string",
  3224. "pattern": "^ses.*"
  3225. },
  3226. "required": true
  3227. },
  3228. {
  3229. "in": "query",
  3230. "name": "messageID",
  3231. "schema": {
  3232. "type": "string",
  3233. "pattern": "^msg.*"
  3234. }
  3235. }
  3236. ],
  3237. "summary": "Get message diff",
  3238. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  3239. "responses": {
  3240. "200": {
  3241. "description": "Successfully retrieved diff",
  3242. "content": {
  3243. "application/json": {
  3244. "schema": {
  3245. "type": "array",
  3246. "items": {
  3247. "$ref": "#/components/schemas/SnapshotFileDiff"
  3248. }
  3249. }
  3250. }
  3251. }
  3252. }
  3253. },
  3254. "x-codeSamples": [
  3255. {
  3256. "lang": "js",
  3257. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  3258. }
  3259. ]
  3260. }
  3261. },
  3262. "/session/{sessionID}/summarize": {
  3263. "post": {
  3264. "operationId": "session.summarize",
  3265. "parameters": [
  3266. {
  3267. "in": "query",
  3268. "name": "directory",
  3269. "schema": {
  3270. "type": "string"
  3271. }
  3272. },
  3273. {
  3274. "in": "query",
  3275. "name": "workspace",
  3276. "schema": {
  3277. "type": "string"
  3278. }
  3279. },
  3280. {
  3281. "in": "path",
  3282. "name": "sessionID",
  3283. "schema": {
  3284. "type": "string",
  3285. "pattern": "^ses.*"
  3286. },
  3287. "required": true
  3288. }
  3289. ],
  3290. "summary": "Summarize session",
  3291. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  3292. "responses": {
  3293. "200": {
  3294. "description": "Summarized session",
  3295. "content": {
  3296. "application/json": {
  3297. "schema": {
  3298. "type": "boolean"
  3299. }
  3300. }
  3301. }
  3302. },
  3303. "400": {
  3304. "description": "Bad request",
  3305. "content": {
  3306. "application/json": {
  3307. "schema": {
  3308. "$ref": "#/components/schemas/BadRequestError"
  3309. }
  3310. }
  3311. }
  3312. },
  3313. "404": {
  3314. "description": "Not found",
  3315. "content": {
  3316. "application/json": {
  3317. "schema": {
  3318. "$ref": "#/components/schemas/NotFoundError"
  3319. }
  3320. }
  3321. }
  3322. }
  3323. },
  3324. "requestBody": {
  3325. "content": {
  3326. "application/json": {
  3327. "schema": {
  3328. "type": "object",
  3329. "properties": {
  3330. "providerID": {
  3331. "type": "string"
  3332. },
  3333. "modelID": {
  3334. "type": "string"
  3335. },
  3336. "auto": {
  3337. "default": false,
  3338. "type": "boolean"
  3339. }
  3340. },
  3341. "required": ["providerID", "modelID"]
  3342. }
  3343. }
  3344. }
  3345. },
  3346. "x-codeSamples": [
  3347. {
  3348. "lang": "js",
  3349. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  3350. }
  3351. ]
  3352. }
  3353. },
  3354. "/session/{sessionID}/message": {
  3355. "get": {
  3356. "operationId": "session.messages",
  3357. "parameters": [
  3358. {
  3359. "in": "query",
  3360. "name": "directory",
  3361. "schema": {
  3362. "type": "string"
  3363. }
  3364. },
  3365. {
  3366. "in": "query",
  3367. "name": "workspace",
  3368. "schema": {
  3369. "type": "string"
  3370. }
  3371. },
  3372. {
  3373. "in": "path",
  3374. "name": "sessionID",
  3375. "schema": {
  3376. "type": "string",
  3377. "pattern": "^ses.*"
  3378. },
  3379. "required": true
  3380. },
  3381. {
  3382. "in": "query",
  3383. "name": "limit",
  3384. "schema": {
  3385. "type": "integer",
  3386. "minimum": 0,
  3387. "maximum": 9007199254740991
  3388. },
  3389. "description": "Maximum number of messages to return"
  3390. },
  3391. {
  3392. "in": "query",
  3393. "name": "before",
  3394. "schema": {
  3395. "type": "string"
  3396. }
  3397. }
  3398. ],
  3399. "summary": "Get session messages",
  3400. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  3401. "responses": {
  3402. "200": {
  3403. "description": "List of messages",
  3404. "content": {
  3405. "application/json": {
  3406. "schema": {
  3407. "type": "array",
  3408. "items": {
  3409. "type": "object",
  3410. "properties": {
  3411. "info": {
  3412. "$ref": "#/components/schemas/Message"
  3413. },
  3414. "parts": {
  3415. "type": "array",
  3416. "items": {
  3417. "$ref": "#/components/schemas/Part"
  3418. }
  3419. }
  3420. },
  3421. "required": ["info", "parts"]
  3422. }
  3423. }
  3424. }
  3425. }
  3426. },
  3427. "400": {
  3428. "description": "Bad request",
  3429. "content": {
  3430. "application/json": {
  3431. "schema": {
  3432. "$ref": "#/components/schemas/BadRequestError"
  3433. }
  3434. }
  3435. }
  3436. },
  3437. "404": {
  3438. "description": "Not found",
  3439. "content": {
  3440. "application/json": {
  3441. "schema": {
  3442. "$ref": "#/components/schemas/NotFoundError"
  3443. }
  3444. }
  3445. }
  3446. }
  3447. },
  3448. "x-codeSamples": [
  3449. {
  3450. "lang": "js",
  3451. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  3452. }
  3453. ]
  3454. },
  3455. "post": {
  3456. "operationId": "session.prompt",
  3457. "parameters": [
  3458. {
  3459. "in": "query",
  3460. "name": "directory",
  3461. "schema": {
  3462. "type": "string"
  3463. }
  3464. },
  3465. {
  3466. "in": "query",
  3467. "name": "workspace",
  3468. "schema": {
  3469. "type": "string"
  3470. }
  3471. },
  3472. {
  3473. "in": "path",
  3474. "name": "sessionID",
  3475. "schema": {
  3476. "type": "string",
  3477. "pattern": "^ses.*"
  3478. },
  3479. "required": true
  3480. }
  3481. ],
  3482. "summary": "Send message",
  3483. "description": "Create and send a new message to a session, streaming the AI response.",
  3484. "responses": {
  3485. "200": {
  3486. "description": "Created message",
  3487. "content": {
  3488. "application/json": {
  3489. "schema": {
  3490. "type": "object",
  3491. "properties": {
  3492. "info": {
  3493. "$ref": "#/components/schemas/AssistantMessage"
  3494. },
  3495. "parts": {
  3496. "type": "array",
  3497. "items": {
  3498. "$ref": "#/components/schemas/Part"
  3499. }
  3500. }
  3501. },
  3502. "required": ["info", "parts"]
  3503. }
  3504. }
  3505. }
  3506. },
  3507. "400": {
  3508. "description": "Bad request",
  3509. "content": {
  3510. "application/json": {
  3511. "schema": {
  3512. "$ref": "#/components/schemas/BadRequestError"
  3513. }
  3514. }
  3515. }
  3516. },
  3517. "404": {
  3518. "description": "Not found",
  3519. "content": {
  3520. "application/json": {
  3521. "schema": {
  3522. "$ref": "#/components/schemas/NotFoundError"
  3523. }
  3524. }
  3525. }
  3526. }
  3527. },
  3528. "requestBody": {
  3529. "content": {
  3530. "application/json": {
  3531. "schema": {
  3532. "type": "object",
  3533. "properties": {
  3534. "messageID": {
  3535. "type": "string",
  3536. "pattern": "^msg.*"
  3537. },
  3538. "model": {
  3539. "type": "object",
  3540. "properties": {
  3541. "providerID": {
  3542. "type": "string"
  3543. },
  3544. "modelID": {
  3545. "type": "string"
  3546. }
  3547. },
  3548. "required": ["providerID", "modelID"]
  3549. },
  3550. "agent": {
  3551. "type": "string"
  3552. },
  3553. "noReply": {
  3554. "type": "boolean"
  3555. },
  3556. "tools": {
  3557. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  3558. "type": "object",
  3559. "propertyNames": {
  3560. "type": "string"
  3561. },
  3562. "additionalProperties": {
  3563. "type": "boolean"
  3564. }
  3565. },
  3566. "format": {
  3567. "$ref": "#/components/schemas/OutputFormat"
  3568. },
  3569. "system": {
  3570. "type": "string"
  3571. },
  3572. "variant": {
  3573. "type": "string"
  3574. },
  3575. "parts": {
  3576. "type": "array",
  3577. "items": {
  3578. "anyOf": [
  3579. {
  3580. "$ref": "#/components/schemas/TextPartInput"
  3581. },
  3582. {
  3583. "$ref": "#/components/schemas/FilePartInput"
  3584. },
  3585. {
  3586. "$ref": "#/components/schemas/AgentPartInput"
  3587. },
  3588. {
  3589. "$ref": "#/components/schemas/SubtaskPartInput"
  3590. }
  3591. ]
  3592. }
  3593. }
  3594. },
  3595. "required": ["parts"]
  3596. }
  3597. }
  3598. }
  3599. },
  3600. "x-codeSamples": [
  3601. {
  3602. "lang": "js",
  3603. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  3604. }
  3605. ]
  3606. }
  3607. },
  3608. "/session/{sessionID}/message/{messageID}": {
  3609. "get": {
  3610. "operationId": "session.message",
  3611. "parameters": [
  3612. {
  3613. "in": "query",
  3614. "name": "directory",
  3615. "schema": {
  3616. "type": "string"
  3617. }
  3618. },
  3619. {
  3620. "in": "query",
  3621. "name": "workspace",
  3622. "schema": {
  3623. "type": "string"
  3624. }
  3625. },
  3626. {
  3627. "in": "path",
  3628. "name": "sessionID",
  3629. "schema": {
  3630. "type": "string",
  3631. "pattern": "^ses.*"
  3632. },
  3633. "required": true
  3634. },
  3635. {
  3636. "in": "path",
  3637. "name": "messageID",
  3638. "schema": {
  3639. "type": "string",
  3640. "pattern": "^msg.*"
  3641. },
  3642. "required": true
  3643. }
  3644. ],
  3645. "summary": "Get message",
  3646. "description": "Retrieve a specific message from a session by its message ID.",
  3647. "responses": {
  3648. "200": {
  3649. "description": "Message",
  3650. "content": {
  3651. "application/json": {
  3652. "schema": {
  3653. "type": "object",
  3654. "properties": {
  3655. "info": {
  3656. "$ref": "#/components/schemas/Message"
  3657. },
  3658. "parts": {
  3659. "type": "array",
  3660. "items": {
  3661. "$ref": "#/components/schemas/Part"
  3662. }
  3663. }
  3664. },
  3665. "required": ["info", "parts"]
  3666. }
  3667. }
  3668. }
  3669. },
  3670. "400": {
  3671. "description": "Bad request",
  3672. "content": {
  3673. "application/json": {
  3674. "schema": {
  3675. "$ref": "#/components/schemas/BadRequestError"
  3676. }
  3677. }
  3678. }
  3679. },
  3680. "404": {
  3681. "description": "Not found",
  3682. "content": {
  3683. "application/json": {
  3684. "schema": {
  3685. "$ref": "#/components/schemas/NotFoundError"
  3686. }
  3687. }
  3688. }
  3689. }
  3690. },
  3691. "x-codeSamples": [
  3692. {
  3693. "lang": "js",
  3694. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  3695. }
  3696. ]
  3697. },
  3698. "delete": {
  3699. "operationId": "session.deleteMessage",
  3700. "parameters": [
  3701. {
  3702. "in": "query",
  3703. "name": "directory",
  3704. "schema": {
  3705. "type": "string"
  3706. }
  3707. },
  3708. {
  3709. "in": "query",
  3710. "name": "workspace",
  3711. "schema": {
  3712. "type": "string"
  3713. }
  3714. },
  3715. {
  3716. "in": "path",
  3717. "name": "sessionID",
  3718. "schema": {
  3719. "type": "string",
  3720. "pattern": "^ses.*"
  3721. },
  3722. "required": true
  3723. },
  3724. {
  3725. "in": "path",
  3726. "name": "messageID",
  3727. "schema": {
  3728. "type": "string",
  3729. "pattern": "^msg.*"
  3730. },
  3731. "required": true
  3732. }
  3733. ],
  3734. "summary": "Delete message",
  3735. "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.",
  3736. "responses": {
  3737. "200": {
  3738. "description": "Successfully deleted message",
  3739. "content": {
  3740. "application/json": {
  3741. "schema": {
  3742. "type": "boolean"
  3743. }
  3744. }
  3745. }
  3746. },
  3747. "400": {
  3748. "description": "Bad request",
  3749. "content": {
  3750. "application/json": {
  3751. "schema": {
  3752. "$ref": "#/components/schemas/BadRequestError"
  3753. }
  3754. }
  3755. }
  3756. },
  3757. "404": {
  3758. "description": "Not found",
  3759. "content": {
  3760. "application/json": {
  3761. "schema": {
  3762. "$ref": "#/components/schemas/NotFoundError"
  3763. }
  3764. }
  3765. }
  3766. }
  3767. },
  3768. "x-codeSamples": [
  3769. {
  3770. "lang": "js",
  3771. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  3772. }
  3773. ]
  3774. }
  3775. },
  3776. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  3777. "delete": {
  3778. "operationId": "part.delete",
  3779. "parameters": [
  3780. {
  3781. "in": "query",
  3782. "name": "directory",
  3783. "schema": {
  3784. "type": "string"
  3785. }
  3786. },
  3787. {
  3788. "in": "query",
  3789. "name": "workspace",
  3790. "schema": {
  3791. "type": "string"
  3792. }
  3793. },
  3794. {
  3795. "in": "path",
  3796. "name": "sessionID",
  3797. "schema": {
  3798. "type": "string",
  3799. "pattern": "^ses.*"
  3800. },
  3801. "required": true
  3802. },
  3803. {
  3804. "in": "path",
  3805. "name": "messageID",
  3806. "schema": {
  3807. "type": "string",
  3808. "pattern": "^msg.*"
  3809. },
  3810. "required": true
  3811. },
  3812. {
  3813. "in": "path",
  3814. "name": "partID",
  3815. "schema": {
  3816. "type": "string",
  3817. "pattern": "^prt.*"
  3818. },
  3819. "required": true
  3820. }
  3821. ],
  3822. "description": "Delete a part from a message",
  3823. "responses": {
  3824. "200": {
  3825. "description": "Successfully deleted part",
  3826. "content": {
  3827. "application/json": {
  3828. "schema": {
  3829. "type": "boolean"
  3830. }
  3831. }
  3832. }
  3833. },
  3834. "400": {
  3835. "description": "Bad request",
  3836. "content": {
  3837. "application/json": {
  3838. "schema": {
  3839. "$ref": "#/components/schemas/BadRequestError"
  3840. }
  3841. }
  3842. }
  3843. },
  3844. "404": {
  3845. "description": "Not found",
  3846. "content": {
  3847. "application/json": {
  3848. "schema": {
  3849. "$ref": "#/components/schemas/NotFoundError"
  3850. }
  3851. }
  3852. }
  3853. }
  3854. },
  3855. "x-codeSamples": [
  3856. {
  3857. "lang": "js",
  3858. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  3859. }
  3860. ]
  3861. },
  3862. "patch": {
  3863. "operationId": "part.update",
  3864. "parameters": [
  3865. {
  3866. "in": "query",
  3867. "name": "directory",
  3868. "schema": {
  3869. "type": "string"
  3870. }
  3871. },
  3872. {
  3873. "in": "query",
  3874. "name": "workspace",
  3875. "schema": {
  3876. "type": "string"
  3877. }
  3878. },
  3879. {
  3880. "in": "path",
  3881. "name": "sessionID",
  3882. "schema": {
  3883. "type": "string",
  3884. "pattern": "^ses.*"
  3885. },
  3886. "required": true
  3887. },
  3888. {
  3889. "in": "path",
  3890. "name": "messageID",
  3891. "schema": {
  3892. "type": "string",
  3893. "pattern": "^msg.*"
  3894. },
  3895. "required": true
  3896. },
  3897. {
  3898. "in": "path",
  3899. "name": "partID",
  3900. "schema": {
  3901. "type": "string",
  3902. "pattern": "^prt.*"
  3903. },
  3904. "required": true
  3905. }
  3906. ],
  3907. "description": "Update a part in a message",
  3908. "responses": {
  3909. "200": {
  3910. "description": "Successfully updated part",
  3911. "content": {
  3912. "application/json": {
  3913. "schema": {
  3914. "$ref": "#/components/schemas/Part"
  3915. }
  3916. }
  3917. }
  3918. },
  3919. "400": {
  3920. "description": "Bad request",
  3921. "content": {
  3922. "application/json": {
  3923. "schema": {
  3924. "$ref": "#/components/schemas/BadRequestError"
  3925. }
  3926. }
  3927. }
  3928. },
  3929. "404": {
  3930. "description": "Not found",
  3931. "content": {
  3932. "application/json": {
  3933. "schema": {
  3934. "$ref": "#/components/schemas/NotFoundError"
  3935. }
  3936. }
  3937. }
  3938. }
  3939. },
  3940. "requestBody": {
  3941. "content": {
  3942. "application/json": {
  3943. "schema": {
  3944. "$ref": "#/components/schemas/Part"
  3945. }
  3946. }
  3947. }
  3948. },
  3949. "x-codeSamples": [
  3950. {
  3951. "lang": "js",
  3952. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  3953. }
  3954. ]
  3955. }
  3956. },
  3957. "/session/{sessionID}/prompt_async": {
  3958. "post": {
  3959. "operationId": "session.prompt_async",
  3960. "parameters": [
  3961. {
  3962. "in": "query",
  3963. "name": "directory",
  3964. "schema": {
  3965. "type": "string"
  3966. }
  3967. },
  3968. {
  3969. "in": "query",
  3970. "name": "workspace",
  3971. "schema": {
  3972. "type": "string"
  3973. }
  3974. },
  3975. {
  3976. "in": "path",
  3977. "name": "sessionID",
  3978. "schema": {
  3979. "type": "string",
  3980. "pattern": "^ses.*"
  3981. },
  3982. "required": true
  3983. }
  3984. ],
  3985. "summary": "Send async message",
  3986. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  3987. "responses": {
  3988. "204": {
  3989. "description": "Prompt accepted"
  3990. },
  3991. "400": {
  3992. "description": "Bad request",
  3993. "content": {
  3994. "application/json": {
  3995. "schema": {
  3996. "$ref": "#/components/schemas/BadRequestError"
  3997. }
  3998. }
  3999. }
  4000. },
  4001. "404": {
  4002. "description": "Not found",
  4003. "content": {
  4004. "application/json": {
  4005. "schema": {
  4006. "$ref": "#/components/schemas/NotFoundError"
  4007. }
  4008. }
  4009. }
  4010. }
  4011. },
  4012. "requestBody": {
  4013. "content": {
  4014. "application/json": {
  4015. "schema": {
  4016. "type": "object",
  4017. "properties": {
  4018. "messageID": {
  4019. "type": "string",
  4020. "pattern": "^msg.*"
  4021. },
  4022. "model": {
  4023. "type": "object",
  4024. "properties": {
  4025. "providerID": {
  4026. "type": "string"
  4027. },
  4028. "modelID": {
  4029. "type": "string"
  4030. }
  4031. },
  4032. "required": ["providerID", "modelID"]
  4033. },
  4034. "agent": {
  4035. "type": "string"
  4036. },
  4037. "noReply": {
  4038. "type": "boolean"
  4039. },
  4040. "tools": {
  4041. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  4042. "type": "object",
  4043. "propertyNames": {
  4044. "type": "string"
  4045. },
  4046. "additionalProperties": {
  4047. "type": "boolean"
  4048. }
  4049. },
  4050. "format": {
  4051. "$ref": "#/components/schemas/OutputFormat"
  4052. },
  4053. "system": {
  4054. "type": "string"
  4055. },
  4056. "variant": {
  4057. "type": "string"
  4058. },
  4059. "parts": {
  4060. "type": "array",
  4061. "items": {
  4062. "anyOf": [
  4063. {
  4064. "$ref": "#/components/schemas/TextPartInput"
  4065. },
  4066. {
  4067. "$ref": "#/components/schemas/FilePartInput"
  4068. },
  4069. {
  4070. "$ref": "#/components/schemas/AgentPartInput"
  4071. },
  4072. {
  4073. "$ref": "#/components/schemas/SubtaskPartInput"
  4074. }
  4075. ]
  4076. }
  4077. }
  4078. },
  4079. "required": ["parts"]
  4080. }
  4081. }
  4082. }
  4083. },
  4084. "x-codeSamples": [
  4085. {
  4086. "lang": "js",
  4087. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  4088. }
  4089. ]
  4090. }
  4091. },
  4092. "/session/{sessionID}/command": {
  4093. "post": {
  4094. "operationId": "session.command",
  4095. "parameters": [
  4096. {
  4097. "in": "query",
  4098. "name": "directory",
  4099. "schema": {
  4100. "type": "string"
  4101. }
  4102. },
  4103. {
  4104. "in": "query",
  4105. "name": "workspace",
  4106. "schema": {
  4107. "type": "string"
  4108. }
  4109. },
  4110. {
  4111. "in": "path",
  4112. "name": "sessionID",
  4113. "schema": {
  4114. "type": "string",
  4115. "pattern": "^ses.*"
  4116. },
  4117. "required": true
  4118. }
  4119. ],
  4120. "summary": "Send command",
  4121. "description": "Send a new command to a session for execution by the AI assistant.",
  4122. "responses": {
  4123. "200": {
  4124. "description": "Created message",
  4125. "content": {
  4126. "application/json": {
  4127. "schema": {
  4128. "type": "object",
  4129. "properties": {
  4130. "info": {
  4131. "$ref": "#/components/schemas/AssistantMessage"
  4132. },
  4133. "parts": {
  4134. "type": "array",
  4135. "items": {
  4136. "$ref": "#/components/schemas/Part"
  4137. }
  4138. }
  4139. },
  4140. "required": ["info", "parts"]
  4141. }
  4142. }
  4143. }
  4144. },
  4145. "400": {
  4146. "description": "Bad request",
  4147. "content": {
  4148. "application/json": {
  4149. "schema": {
  4150. "$ref": "#/components/schemas/BadRequestError"
  4151. }
  4152. }
  4153. }
  4154. },
  4155. "404": {
  4156. "description": "Not found",
  4157. "content": {
  4158. "application/json": {
  4159. "schema": {
  4160. "$ref": "#/components/schemas/NotFoundError"
  4161. }
  4162. }
  4163. }
  4164. }
  4165. },
  4166. "requestBody": {
  4167. "content": {
  4168. "application/json": {
  4169. "schema": {
  4170. "type": "object",
  4171. "properties": {
  4172. "messageID": {
  4173. "type": "string",
  4174. "pattern": "^msg.*"
  4175. },
  4176. "agent": {
  4177. "type": "string"
  4178. },
  4179. "model": {
  4180. "type": "string"
  4181. },
  4182. "arguments": {
  4183. "type": "string"
  4184. },
  4185. "command": {
  4186. "type": "string"
  4187. },
  4188. "variant": {
  4189. "type": "string"
  4190. },
  4191. "parts": {
  4192. "type": "array",
  4193. "items": {
  4194. "anyOf": [
  4195. {
  4196. "type": "object",
  4197. "properties": {
  4198. "id": {
  4199. "type": "string",
  4200. "pattern": "^prt.*"
  4201. },
  4202. "type": {
  4203. "type": "string",
  4204. "const": "file"
  4205. },
  4206. "mime": {
  4207. "type": "string"
  4208. },
  4209. "filename": {
  4210. "type": "string"
  4211. },
  4212. "url": {
  4213. "type": "string"
  4214. },
  4215. "source": {
  4216. "$ref": "#/components/schemas/FilePartSource"
  4217. }
  4218. },
  4219. "required": ["type", "mime", "url"]
  4220. }
  4221. ]
  4222. }
  4223. }
  4224. },
  4225. "required": ["arguments", "command"]
  4226. }
  4227. }
  4228. }
  4229. },
  4230. "x-codeSamples": [
  4231. {
  4232. "lang": "js",
  4233. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  4234. }
  4235. ]
  4236. }
  4237. },
  4238. "/session/{sessionID}/shell": {
  4239. "post": {
  4240. "operationId": "session.shell",
  4241. "parameters": [
  4242. {
  4243. "in": "query",
  4244. "name": "directory",
  4245. "schema": {
  4246. "type": "string"
  4247. }
  4248. },
  4249. {
  4250. "in": "query",
  4251. "name": "workspace",
  4252. "schema": {
  4253. "type": "string"
  4254. }
  4255. },
  4256. {
  4257. "in": "path",
  4258. "name": "sessionID",
  4259. "schema": {
  4260. "type": "string",
  4261. "pattern": "^ses.*"
  4262. },
  4263. "required": true
  4264. }
  4265. ],
  4266. "summary": "Run shell command",
  4267. "description": "Execute a shell command within the session context and return the AI's response.",
  4268. "responses": {
  4269. "200": {
  4270. "description": "Created message",
  4271. "content": {
  4272. "application/json": {
  4273. "schema": {
  4274. "type": "object",
  4275. "properties": {
  4276. "info": {
  4277. "$ref": "#/components/schemas/Message"
  4278. },
  4279. "parts": {
  4280. "type": "array",
  4281. "items": {
  4282. "$ref": "#/components/schemas/Part"
  4283. }
  4284. }
  4285. },
  4286. "required": ["info", "parts"]
  4287. }
  4288. }
  4289. }
  4290. },
  4291. "400": {
  4292. "description": "Bad request",
  4293. "content": {
  4294. "application/json": {
  4295. "schema": {
  4296. "$ref": "#/components/schemas/BadRequestError"
  4297. }
  4298. }
  4299. }
  4300. },
  4301. "404": {
  4302. "description": "Not found",
  4303. "content": {
  4304. "application/json": {
  4305. "schema": {
  4306. "$ref": "#/components/schemas/NotFoundError"
  4307. }
  4308. }
  4309. }
  4310. }
  4311. },
  4312. "requestBody": {
  4313. "content": {
  4314. "application/json": {
  4315. "schema": {
  4316. "type": "object",
  4317. "properties": {
  4318. "messageID": {
  4319. "type": "string",
  4320. "pattern": "^msg.*"
  4321. },
  4322. "agent": {
  4323. "type": "string"
  4324. },
  4325. "model": {
  4326. "type": "object",
  4327. "properties": {
  4328. "providerID": {
  4329. "type": "string"
  4330. },
  4331. "modelID": {
  4332. "type": "string"
  4333. }
  4334. },
  4335. "required": ["providerID", "modelID"]
  4336. },
  4337. "command": {
  4338. "type": "string"
  4339. }
  4340. },
  4341. "required": ["agent", "command"]
  4342. }
  4343. }
  4344. }
  4345. },
  4346. "x-codeSamples": [
  4347. {
  4348. "lang": "js",
  4349. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  4350. }
  4351. ]
  4352. }
  4353. },
  4354. "/session/{sessionID}/revert": {
  4355. "post": {
  4356. "operationId": "session.revert",
  4357. "parameters": [
  4358. {
  4359. "in": "query",
  4360. "name": "directory",
  4361. "schema": {
  4362. "type": "string"
  4363. }
  4364. },
  4365. {
  4366. "in": "query",
  4367. "name": "workspace",
  4368. "schema": {
  4369. "type": "string"
  4370. }
  4371. },
  4372. {
  4373. "in": "path",
  4374. "name": "sessionID",
  4375. "schema": {
  4376. "type": "string",
  4377. "pattern": "^ses.*"
  4378. },
  4379. "required": true
  4380. }
  4381. ],
  4382. "summary": "Revert message",
  4383. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  4384. "responses": {
  4385. "200": {
  4386. "description": "Updated session",
  4387. "content": {
  4388. "application/json": {
  4389. "schema": {
  4390. "$ref": "#/components/schemas/Session"
  4391. }
  4392. }
  4393. }
  4394. },
  4395. "400": {
  4396. "description": "Bad request",
  4397. "content": {
  4398. "application/json": {
  4399. "schema": {
  4400. "$ref": "#/components/schemas/BadRequestError"
  4401. }
  4402. }
  4403. }
  4404. },
  4405. "404": {
  4406. "description": "Not found",
  4407. "content": {
  4408. "application/json": {
  4409. "schema": {
  4410. "$ref": "#/components/schemas/NotFoundError"
  4411. }
  4412. }
  4413. }
  4414. }
  4415. },
  4416. "requestBody": {
  4417. "content": {
  4418. "application/json": {
  4419. "schema": {
  4420. "type": "object",
  4421. "properties": {
  4422. "messageID": {
  4423. "type": "string",
  4424. "pattern": "^msg.*"
  4425. },
  4426. "partID": {
  4427. "type": "string",
  4428. "pattern": "^prt.*"
  4429. }
  4430. },
  4431. "required": ["messageID"]
  4432. }
  4433. }
  4434. }
  4435. },
  4436. "x-codeSamples": [
  4437. {
  4438. "lang": "js",
  4439. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  4440. }
  4441. ]
  4442. }
  4443. },
  4444. "/session/{sessionID}/unrevert": {
  4445. "post": {
  4446. "operationId": "session.unrevert",
  4447. "parameters": [
  4448. {
  4449. "in": "query",
  4450. "name": "directory",
  4451. "schema": {
  4452. "type": "string"
  4453. }
  4454. },
  4455. {
  4456. "in": "query",
  4457. "name": "workspace",
  4458. "schema": {
  4459. "type": "string"
  4460. }
  4461. },
  4462. {
  4463. "in": "path",
  4464. "name": "sessionID",
  4465. "schema": {
  4466. "type": "string",
  4467. "pattern": "^ses.*"
  4468. },
  4469. "required": true
  4470. }
  4471. ],
  4472. "summary": "Restore reverted messages",
  4473. "description": "Restore all previously reverted messages in a session.",
  4474. "responses": {
  4475. "200": {
  4476. "description": "Updated session",
  4477. "content": {
  4478. "application/json": {
  4479. "schema": {
  4480. "$ref": "#/components/schemas/Session"
  4481. }
  4482. }
  4483. }
  4484. },
  4485. "400": {
  4486. "description": "Bad request",
  4487. "content": {
  4488. "application/json": {
  4489. "schema": {
  4490. "$ref": "#/components/schemas/BadRequestError"
  4491. }
  4492. }
  4493. }
  4494. },
  4495. "404": {
  4496. "description": "Not found",
  4497. "content": {
  4498. "application/json": {
  4499. "schema": {
  4500. "$ref": "#/components/schemas/NotFoundError"
  4501. }
  4502. }
  4503. }
  4504. }
  4505. },
  4506. "x-codeSamples": [
  4507. {
  4508. "lang": "js",
  4509. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  4510. }
  4511. ]
  4512. }
  4513. },
  4514. "/session/{sessionID}/permissions/{permissionID}": {
  4515. "post": {
  4516. "operationId": "permission.respond",
  4517. "parameters": [
  4518. {
  4519. "in": "query",
  4520. "name": "directory",
  4521. "schema": {
  4522. "type": "string"
  4523. }
  4524. },
  4525. {
  4526. "in": "query",
  4527. "name": "workspace",
  4528. "schema": {
  4529. "type": "string"
  4530. }
  4531. },
  4532. {
  4533. "in": "path",
  4534. "name": "sessionID",
  4535. "schema": {
  4536. "type": "string",
  4537. "pattern": "^ses.*"
  4538. },
  4539. "required": true
  4540. },
  4541. {
  4542. "in": "path",
  4543. "name": "permissionID",
  4544. "schema": {
  4545. "type": "string",
  4546. "pattern": "^per.*"
  4547. },
  4548. "required": true
  4549. }
  4550. ],
  4551. "summary": "Respond to permission",
  4552. "deprecated": true,
  4553. "description": "Approve or deny a permission request from the AI assistant.",
  4554. "responses": {
  4555. "200": {
  4556. "description": "Permission processed successfully",
  4557. "content": {
  4558. "application/json": {
  4559. "schema": {
  4560. "type": "boolean"
  4561. }
  4562. }
  4563. }
  4564. },
  4565. "400": {
  4566. "description": "Bad request",
  4567. "content": {
  4568. "application/json": {
  4569. "schema": {
  4570. "$ref": "#/components/schemas/BadRequestError"
  4571. }
  4572. }
  4573. }
  4574. },
  4575. "404": {
  4576. "description": "Not found",
  4577. "content": {
  4578. "application/json": {
  4579. "schema": {
  4580. "$ref": "#/components/schemas/NotFoundError"
  4581. }
  4582. }
  4583. }
  4584. }
  4585. },
  4586. "requestBody": {
  4587. "content": {
  4588. "application/json": {
  4589. "schema": {
  4590. "type": "object",
  4591. "properties": {
  4592. "response": {
  4593. "type": "string",
  4594. "enum": ["once", "always", "reject"]
  4595. }
  4596. },
  4597. "required": ["response"]
  4598. }
  4599. }
  4600. }
  4601. },
  4602. "x-codeSamples": [
  4603. {
  4604. "lang": "js",
  4605. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  4606. }
  4607. ]
  4608. }
  4609. },
  4610. "/permission/{requestID}/reply": {
  4611. "post": {
  4612. "operationId": "permission.reply",
  4613. "parameters": [
  4614. {
  4615. "in": "query",
  4616. "name": "directory",
  4617. "schema": {
  4618. "type": "string"
  4619. }
  4620. },
  4621. {
  4622. "in": "query",
  4623. "name": "workspace",
  4624. "schema": {
  4625. "type": "string"
  4626. }
  4627. },
  4628. {
  4629. "in": "path",
  4630. "name": "requestID",
  4631. "schema": {
  4632. "type": "string",
  4633. "pattern": "^per.*"
  4634. },
  4635. "required": true
  4636. }
  4637. ],
  4638. "summary": "Respond to permission request",
  4639. "description": "Approve or deny a permission request from the AI assistant.",
  4640. "responses": {
  4641. "200": {
  4642. "description": "Permission processed successfully",
  4643. "content": {
  4644. "application/json": {
  4645. "schema": {
  4646. "type": "boolean"
  4647. }
  4648. }
  4649. }
  4650. },
  4651. "400": {
  4652. "description": "Bad request",
  4653. "content": {
  4654. "application/json": {
  4655. "schema": {
  4656. "$ref": "#/components/schemas/BadRequestError"
  4657. }
  4658. }
  4659. }
  4660. },
  4661. "404": {
  4662. "description": "Not found",
  4663. "content": {
  4664. "application/json": {
  4665. "schema": {
  4666. "$ref": "#/components/schemas/NotFoundError"
  4667. }
  4668. }
  4669. }
  4670. }
  4671. },
  4672. "requestBody": {
  4673. "content": {
  4674. "application/json": {
  4675. "schema": {
  4676. "type": "object",
  4677. "properties": {
  4678. "reply": {
  4679. "type": "string",
  4680. "enum": ["once", "always", "reject"]
  4681. },
  4682. "message": {
  4683. "type": "string"
  4684. }
  4685. },
  4686. "required": ["reply"]
  4687. }
  4688. }
  4689. }
  4690. },
  4691. "x-codeSamples": [
  4692. {
  4693. "lang": "js",
  4694. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4695. }
  4696. ]
  4697. }
  4698. },
  4699. "/permission": {
  4700. "get": {
  4701. "operationId": "permission.list",
  4702. "parameters": [
  4703. {
  4704. "in": "query",
  4705. "name": "directory",
  4706. "schema": {
  4707. "type": "string"
  4708. }
  4709. },
  4710. {
  4711. "in": "query",
  4712. "name": "workspace",
  4713. "schema": {
  4714. "type": "string"
  4715. }
  4716. }
  4717. ],
  4718. "summary": "List pending permissions",
  4719. "description": "Get all pending permission requests across all sessions.",
  4720. "responses": {
  4721. "200": {
  4722. "description": "List of pending permissions",
  4723. "content": {
  4724. "application/json": {
  4725. "schema": {
  4726. "type": "array",
  4727. "items": {
  4728. "$ref": "#/components/schemas/PermissionRequest"
  4729. }
  4730. }
  4731. }
  4732. }
  4733. }
  4734. },
  4735. "x-codeSamples": [
  4736. {
  4737. "lang": "js",
  4738. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  4739. }
  4740. ]
  4741. }
  4742. },
  4743. "/question": {
  4744. "get": {
  4745. "operationId": "question.list",
  4746. "parameters": [
  4747. {
  4748. "in": "query",
  4749. "name": "directory",
  4750. "schema": {
  4751. "type": "string"
  4752. }
  4753. },
  4754. {
  4755. "in": "query",
  4756. "name": "workspace",
  4757. "schema": {
  4758. "type": "string"
  4759. }
  4760. }
  4761. ],
  4762. "summary": "List pending questions",
  4763. "description": "Get all pending question requests across all sessions.",
  4764. "responses": {
  4765. "200": {
  4766. "description": "List of pending questions",
  4767. "content": {
  4768. "application/json": {
  4769. "schema": {
  4770. "type": "array",
  4771. "items": {
  4772. "$ref": "#/components/schemas/QuestionRequest"
  4773. }
  4774. }
  4775. }
  4776. }
  4777. }
  4778. },
  4779. "x-codeSamples": [
  4780. {
  4781. "lang": "js",
  4782. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  4783. }
  4784. ]
  4785. }
  4786. },
  4787. "/question/{requestID}/reply": {
  4788. "post": {
  4789. "operationId": "question.reply",
  4790. "parameters": [
  4791. {
  4792. "in": "query",
  4793. "name": "directory",
  4794. "schema": {
  4795. "type": "string"
  4796. }
  4797. },
  4798. {
  4799. "in": "query",
  4800. "name": "workspace",
  4801. "schema": {
  4802. "type": "string"
  4803. }
  4804. },
  4805. {
  4806. "in": "path",
  4807. "name": "requestID",
  4808. "schema": {
  4809. "type": "string",
  4810. "pattern": "^que.*"
  4811. },
  4812. "required": true
  4813. }
  4814. ],
  4815. "summary": "Reply to question request",
  4816. "description": "Provide answers to a question request from the AI assistant.",
  4817. "responses": {
  4818. "200": {
  4819. "description": "Question answered successfully",
  4820. "content": {
  4821. "application/json": {
  4822. "schema": {
  4823. "type": "boolean"
  4824. }
  4825. }
  4826. }
  4827. },
  4828. "400": {
  4829. "description": "Bad request",
  4830. "content": {
  4831. "application/json": {
  4832. "schema": {
  4833. "$ref": "#/components/schemas/BadRequestError"
  4834. }
  4835. }
  4836. }
  4837. },
  4838. "404": {
  4839. "description": "Not found",
  4840. "content": {
  4841. "application/json": {
  4842. "schema": {
  4843. "$ref": "#/components/schemas/NotFoundError"
  4844. }
  4845. }
  4846. }
  4847. }
  4848. },
  4849. "requestBody": {
  4850. "content": {
  4851. "application/json": {
  4852. "schema": {
  4853. "type": "object",
  4854. "properties": {
  4855. "answers": {
  4856. "description": "User answers in order of questions (each answer is an array of selected labels)",
  4857. "type": "array",
  4858. "items": {
  4859. "$ref": "#/components/schemas/QuestionAnswer"
  4860. }
  4861. }
  4862. },
  4863. "required": ["answers"]
  4864. }
  4865. }
  4866. }
  4867. },
  4868. "x-codeSamples": [
  4869. {
  4870. "lang": "js",
  4871. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  4872. }
  4873. ]
  4874. }
  4875. },
  4876. "/question/{requestID}/reject": {
  4877. "post": {
  4878. "operationId": "question.reject",
  4879. "parameters": [
  4880. {
  4881. "in": "query",
  4882. "name": "directory",
  4883. "schema": {
  4884. "type": "string"
  4885. }
  4886. },
  4887. {
  4888. "in": "query",
  4889. "name": "workspace",
  4890. "schema": {
  4891. "type": "string"
  4892. }
  4893. },
  4894. {
  4895. "in": "path",
  4896. "name": "requestID",
  4897. "schema": {
  4898. "type": "string",
  4899. "pattern": "^que.*"
  4900. },
  4901. "required": true
  4902. }
  4903. ],
  4904. "summary": "Reject question request",
  4905. "description": "Reject a question request from the AI assistant.",
  4906. "responses": {
  4907. "200": {
  4908. "description": "Question rejected successfully",
  4909. "content": {
  4910. "application/json": {
  4911. "schema": {
  4912. "type": "boolean"
  4913. }
  4914. }
  4915. }
  4916. },
  4917. "400": {
  4918. "description": "Bad request",
  4919. "content": {
  4920. "application/json": {
  4921. "schema": {
  4922. "$ref": "#/components/schemas/BadRequestError"
  4923. }
  4924. }
  4925. }
  4926. },
  4927. "404": {
  4928. "description": "Not found",
  4929. "content": {
  4930. "application/json": {
  4931. "schema": {
  4932. "$ref": "#/components/schemas/NotFoundError"
  4933. }
  4934. }
  4935. }
  4936. }
  4937. },
  4938. "x-codeSamples": [
  4939. {
  4940. "lang": "js",
  4941. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  4942. }
  4943. ]
  4944. }
  4945. },
  4946. "/provider": {
  4947. "get": {
  4948. "operationId": "provider.list",
  4949. "parameters": [
  4950. {
  4951. "in": "query",
  4952. "name": "directory",
  4953. "schema": {
  4954. "type": "string"
  4955. }
  4956. },
  4957. {
  4958. "in": "query",
  4959. "name": "workspace",
  4960. "schema": {
  4961. "type": "string"
  4962. }
  4963. }
  4964. ],
  4965. "summary": "List providers",
  4966. "description": "Get a list of all available AI providers, including both available and connected ones.",
  4967. "responses": {
  4968. "200": {
  4969. "description": "List of providers",
  4970. "content": {
  4971. "application/json": {
  4972. "schema": {
  4973. "type": "object",
  4974. "properties": {
  4975. "all": {
  4976. "type": "array",
  4977. "items": {
  4978. "$ref": "#/components/schemas/Provider"
  4979. }
  4980. },
  4981. "default": {
  4982. "type": "object",
  4983. "propertyNames": {
  4984. "type": "string"
  4985. },
  4986. "additionalProperties": {
  4987. "type": "string"
  4988. }
  4989. },
  4990. "connected": {
  4991. "type": "array",
  4992. "items": {
  4993. "type": "string"
  4994. }
  4995. }
  4996. },
  4997. "required": ["all", "default", "connected"]
  4998. }
  4999. }
  5000. }
  5001. }
  5002. },
  5003. "x-codeSamples": [
  5004. {
  5005. "lang": "js",
  5006. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  5007. }
  5008. ]
  5009. }
  5010. },
  5011. "/provider/auth": {
  5012. "get": {
  5013. "operationId": "provider.auth",
  5014. "parameters": [
  5015. {
  5016. "in": "query",
  5017. "name": "directory",
  5018. "schema": {
  5019. "type": "string"
  5020. }
  5021. },
  5022. {
  5023. "in": "query",
  5024. "name": "workspace",
  5025. "schema": {
  5026. "type": "string"
  5027. }
  5028. }
  5029. ],
  5030. "summary": "Get provider auth methods",
  5031. "description": "Retrieve available authentication methods for all AI providers.",
  5032. "responses": {
  5033. "200": {
  5034. "description": "Provider auth methods",
  5035. "content": {
  5036. "application/json": {
  5037. "schema": {
  5038. "type": "object",
  5039. "propertyNames": {
  5040. "type": "string"
  5041. },
  5042. "additionalProperties": {
  5043. "type": "array",
  5044. "items": {
  5045. "$ref": "#/components/schemas/ProviderAuthMethod"
  5046. }
  5047. }
  5048. }
  5049. }
  5050. }
  5051. }
  5052. },
  5053. "x-codeSamples": [
  5054. {
  5055. "lang": "js",
  5056. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  5057. }
  5058. ]
  5059. }
  5060. },
  5061. "/provider/{providerID}/oauth/authorize": {
  5062. "post": {
  5063. "operationId": "provider.oauth.authorize",
  5064. "parameters": [
  5065. {
  5066. "in": "query",
  5067. "name": "directory",
  5068. "schema": {
  5069. "type": "string"
  5070. }
  5071. },
  5072. {
  5073. "in": "query",
  5074. "name": "workspace",
  5075. "schema": {
  5076. "type": "string"
  5077. }
  5078. },
  5079. {
  5080. "in": "path",
  5081. "name": "providerID",
  5082. "schema": {
  5083. "type": "string"
  5084. },
  5085. "required": true,
  5086. "description": "Provider ID"
  5087. }
  5088. ],
  5089. "summary": "OAuth authorize",
  5090. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  5091. "responses": {
  5092. "200": {
  5093. "description": "Authorization URL and method",
  5094. "content": {
  5095. "application/json": {
  5096. "schema": {
  5097. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  5098. }
  5099. }
  5100. }
  5101. },
  5102. "400": {
  5103. "description": "Bad request",
  5104. "content": {
  5105. "application/json": {
  5106. "schema": {
  5107. "$ref": "#/components/schemas/BadRequestError"
  5108. }
  5109. }
  5110. }
  5111. }
  5112. },
  5113. "requestBody": {
  5114. "content": {
  5115. "application/json": {
  5116. "schema": {
  5117. "type": "object",
  5118. "properties": {
  5119. "method": {
  5120. "description": "Auth method index",
  5121. "type": "number"
  5122. },
  5123. "inputs": {
  5124. "description": "Prompt inputs",
  5125. "type": "object",
  5126. "propertyNames": {
  5127. "type": "string"
  5128. },
  5129. "additionalProperties": {
  5130. "type": "string"
  5131. }
  5132. }
  5133. },
  5134. "required": ["method"]
  5135. }
  5136. }
  5137. }
  5138. },
  5139. "x-codeSamples": [
  5140. {
  5141. "lang": "js",
  5142. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  5143. }
  5144. ]
  5145. }
  5146. },
  5147. "/provider/{providerID}/oauth/callback": {
  5148. "post": {
  5149. "operationId": "provider.oauth.callback",
  5150. "parameters": [
  5151. {
  5152. "in": "query",
  5153. "name": "directory",
  5154. "schema": {
  5155. "type": "string"
  5156. }
  5157. },
  5158. {
  5159. "in": "query",
  5160. "name": "workspace",
  5161. "schema": {
  5162. "type": "string"
  5163. }
  5164. },
  5165. {
  5166. "in": "path",
  5167. "name": "providerID",
  5168. "schema": {
  5169. "type": "string"
  5170. },
  5171. "required": true,
  5172. "description": "Provider ID"
  5173. }
  5174. ],
  5175. "summary": "OAuth callback",
  5176. "description": "Handle the OAuth callback from a provider after user authorization.",
  5177. "responses": {
  5178. "200": {
  5179. "description": "OAuth callback processed successfully",
  5180. "content": {
  5181. "application/json": {
  5182. "schema": {
  5183. "type": "boolean"
  5184. }
  5185. }
  5186. }
  5187. },
  5188. "400": {
  5189. "description": "Bad request",
  5190. "content": {
  5191. "application/json": {
  5192. "schema": {
  5193. "$ref": "#/components/schemas/BadRequestError"
  5194. }
  5195. }
  5196. }
  5197. }
  5198. },
  5199. "requestBody": {
  5200. "content": {
  5201. "application/json": {
  5202. "schema": {
  5203. "type": "object",
  5204. "properties": {
  5205. "method": {
  5206. "description": "Auth method index",
  5207. "type": "number"
  5208. },
  5209. "code": {
  5210. "description": "OAuth authorization code",
  5211. "type": "string"
  5212. }
  5213. },
  5214. "required": ["method"]
  5215. }
  5216. }
  5217. }
  5218. },
  5219. "x-codeSamples": [
  5220. {
  5221. "lang": "js",
  5222. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  5223. }
  5224. ]
  5225. }
  5226. },
  5227. "/sync/start": {
  5228. "post": {
  5229. "operationId": "sync.start",
  5230. "parameters": [
  5231. {
  5232. "in": "query",
  5233. "name": "directory",
  5234. "schema": {
  5235. "type": "string"
  5236. }
  5237. },
  5238. {
  5239. "in": "query",
  5240. "name": "workspace",
  5241. "schema": {
  5242. "type": "string"
  5243. }
  5244. }
  5245. ],
  5246. "summary": "Start workspace sync",
  5247. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  5248. "responses": {
  5249. "200": {
  5250. "description": "Workspace sync started",
  5251. "content": {
  5252. "application/json": {
  5253. "schema": {
  5254. "type": "boolean"
  5255. }
  5256. }
  5257. }
  5258. }
  5259. },
  5260. "x-codeSamples": [
  5261. {
  5262. "lang": "js",
  5263. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  5264. }
  5265. ]
  5266. }
  5267. },
  5268. "/sync/replay": {
  5269. "post": {
  5270. "operationId": "sync.replay",
  5271. "parameters": [
  5272. {
  5273. "in": "query",
  5274. "name": "directory",
  5275. "schema": {
  5276. "type": "string"
  5277. }
  5278. },
  5279. {
  5280. "in": "query",
  5281. "name": "workspace",
  5282. "schema": {
  5283. "type": "string"
  5284. }
  5285. }
  5286. ],
  5287. "summary": "Replay sync events",
  5288. "description": "Validate and replay a complete sync event history.",
  5289. "responses": {
  5290. "200": {
  5291. "description": "Replayed sync events",
  5292. "content": {
  5293. "application/json": {
  5294. "schema": {
  5295. "type": "object",
  5296. "properties": {
  5297. "sessionID": {
  5298. "type": "string"
  5299. }
  5300. },
  5301. "required": ["sessionID"]
  5302. }
  5303. }
  5304. }
  5305. },
  5306. "400": {
  5307. "description": "Bad request",
  5308. "content": {
  5309. "application/json": {
  5310. "schema": {
  5311. "$ref": "#/components/schemas/BadRequestError"
  5312. }
  5313. }
  5314. }
  5315. }
  5316. },
  5317. "requestBody": {
  5318. "content": {
  5319. "application/json": {
  5320. "schema": {
  5321. "type": "object",
  5322. "properties": {
  5323. "directory": {
  5324. "type": "string"
  5325. },
  5326. "events": {
  5327. "minItems": 1,
  5328. "type": "array",
  5329. "items": {
  5330. "type": "object",
  5331. "properties": {
  5332. "id": {
  5333. "type": "string"
  5334. },
  5335. "aggregateID": {
  5336. "type": "string"
  5337. },
  5338. "seq": {
  5339. "type": "integer",
  5340. "minimum": 0,
  5341. "maximum": 9007199254740991
  5342. },
  5343. "type": {
  5344. "type": "string"
  5345. },
  5346. "data": {
  5347. "type": "object",
  5348. "propertyNames": {
  5349. "type": "string"
  5350. },
  5351. "additionalProperties": {}
  5352. }
  5353. },
  5354. "required": ["id", "aggregateID", "seq", "type", "data"]
  5355. }
  5356. }
  5357. },
  5358. "required": ["directory", "events"]
  5359. }
  5360. }
  5361. }
  5362. },
  5363. "x-codeSamples": [
  5364. {
  5365. "lang": "js",
  5366. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  5367. }
  5368. ]
  5369. }
  5370. },
  5371. "/sync/history": {
  5372. "post": {
  5373. "operationId": "sync.history.list",
  5374. "parameters": [
  5375. {
  5376. "in": "query",
  5377. "name": "directory",
  5378. "schema": {
  5379. "type": "string"
  5380. }
  5381. },
  5382. {
  5383. "in": "query",
  5384. "name": "workspace",
  5385. "schema": {
  5386. "type": "string"
  5387. }
  5388. }
  5389. ],
  5390. "summary": "List sync events",
  5391. "description": "List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.",
  5392. "responses": {
  5393. "200": {
  5394. "description": "Sync events",
  5395. "content": {
  5396. "application/json": {
  5397. "schema": {
  5398. "type": "array",
  5399. "items": {
  5400. "type": "object",
  5401. "properties": {
  5402. "id": {
  5403. "type": "string"
  5404. },
  5405. "aggregate_id": {
  5406. "type": "string"
  5407. },
  5408. "seq": {
  5409. "type": "number"
  5410. },
  5411. "type": {
  5412. "type": "string"
  5413. },
  5414. "data": {
  5415. "type": "object",
  5416. "propertyNames": {
  5417. "type": "string"
  5418. },
  5419. "additionalProperties": {}
  5420. }
  5421. },
  5422. "required": ["id", "aggregate_id", "seq", "type", "data"]
  5423. }
  5424. }
  5425. }
  5426. }
  5427. },
  5428. "400": {
  5429. "description": "Bad request",
  5430. "content": {
  5431. "application/json": {
  5432. "schema": {
  5433. "$ref": "#/components/schemas/BadRequestError"
  5434. }
  5435. }
  5436. }
  5437. }
  5438. },
  5439. "requestBody": {
  5440. "content": {
  5441. "application/json": {
  5442. "schema": {
  5443. "type": "object",
  5444. "propertyNames": {
  5445. "type": "string"
  5446. },
  5447. "additionalProperties": {
  5448. "type": "integer",
  5449. "minimum": 0,
  5450. "maximum": 9007199254740991
  5451. }
  5452. }
  5453. }
  5454. }
  5455. },
  5456. "x-codeSamples": [
  5457. {
  5458. "lang": "js",
  5459. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  5460. }
  5461. ]
  5462. }
  5463. },
  5464. "/find": {
  5465. "get": {
  5466. "operationId": "find.text",
  5467. "parameters": [
  5468. {
  5469. "in": "query",
  5470. "name": "directory",
  5471. "schema": {
  5472. "type": "string"
  5473. }
  5474. },
  5475. {
  5476. "in": "query",
  5477. "name": "workspace",
  5478. "schema": {
  5479. "type": "string"
  5480. }
  5481. },
  5482. {
  5483. "in": "query",
  5484. "name": "pattern",
  5485. "schema": {
  5486. "type": "string"
  5487. },
  5488. "required": true
  5489. }
  5490. ],
  5491. "summary": "Find text",
  5492. "description": "Search for text patterns across files in the project using ripgrep.",
  5493. "responses": {
  5494. "200": {
  5495. "description": "Matches",
  5496. "content": {
  5497. "application/json": {
  5498. "schema": {
  5499. "type": "array",
  5500. "items": {
  5501. "type": "object",
  5502. "properties": {
  5503. "path": {
  5504. "type": "object",
  5505. "properties": {
  5506. "text": {
  5507. "type": "string"
  5508. }
  5509. },
  5510. "required": ["text"]
  5511. },
  5512. "lines": {
  5513. "type": "object",
  5514. "properties": {
  5515. "text": {
  5516. "type": "string"
  5517. }
  5518. },
  5519. "required": ["text"]
  5520. },
  5521. "line_number": {
  5522. "type": "number"
  5523. },
  5524. "absolute_offset": {
  5525. "type": "number"
  5526. },
  5527. "submatches": {
  5528. "type": "array",
  5529. "items": {
  5530. "type": "object",
  5531. "properties": {
  5532. "match": {
  5533. "type": "object",
  5534. "properties": {
  5535. "text": {
  5536. "type": "string"
  5537. }
  5538. },
  5539. "required": ["text"]
  5540. },
  5541. "start": {
  5542. "type": "number"
  5543. },
  5544. "end": {
  5545. "type": "number"
  5546. }
  5547. },
  5548. "required": ["match", "start", "end"]
  5549. }
  5550. }
  5551. },
  5552. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  5553. }
  5554. }
  5555. }
  5556. }
  5557. }
  5558. },
  5559. "x-codeSamples": [
  5560. {
  5561. "lang": "js",
  5562. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  5563. }
  5564. ]
  5565. }
  5566. },
  5567. "/find/file": {
  5568. "get": {
  5569. "operationId": "find.files",
  5570. "parameters": [
  5571. {
  5572. "in": "query",
  5573. "name": "directory",
  5574. "schema": {
  5575. "type": "string"
  5576. }
  5577. },
  5578. {
  5579. "in": "query",
  5580. "name": "workspace",
  5581. "schema": {
  5582. "type": "string"
  5583. }
  5584. },
  5585. {
  5586. "in": "query",
  5587. "name": "query",
  5588. "schema": {
  5589. "type": "string"
  5590. },
  5591. "required": true
  5592. },
  5593. {
  5594. "in": "query",
  5595. "name": "dirs",
  5596. "schema": {
  5597. "type": "string",
  5598. "enum": ["true", "false"]
  5599. }
  5600. },
  5601. {
  5602. "in": "query",
  5603. "name": "type",
  5604. "schema": {
  5605. "type": "string",
  5606. "enum": ["file", "directory"]
  5607. }
  5608. },
  5609. {
  5610. "in": "query",
  5611. "name": "limit",
  5612. "schema": {
  5613. "type": "integer",
  5614. "minimum": 1,
  5615. "maximum": 200
  5616. }
  5617. }
  5618. ],
  5619. "summary": "Find files",
  5620. "description": "Search for files or directories by name or pattern in the project directory.",
  5621. "responses": {
  5622. "200": {
  5623. "description": "File paths",
  5624. "content": {
  5625. "application/json": {
  5626. "schema": {
  5627. "type": "array",
  5628. "items": {
  5629. "type": "string"
  5630. }
  5631. }
  5632. }
  5633. }
  5634. }
  5635. },
  5636. "x-codeSamples": [
  5637. {
  5638. "lang": "js",
  5639. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  5640. }
  5641. ]
  5642. }
  5643. },
  5644. "/find/symbol": {
  5645. "get": {
  5646. "operationId": "find.symbols",
  5647. "parameters": [
  5648. {
  5649. "in": "query",
  5650. "name": "directory",
  5651. "schema": {
  5652. "type": "string"
  5653. }
  5654. },
  5655. {
  5656. "in": "query",
  5657. "name": "workspace",
  5658. "schema": {
  5659. "type": "string"
  5660. }
  5661. },
  5662. {
  5663. "in": "query",
  5664. "name": "query",
  5665. "schema": {
  5666. "type": "string"
  5667. },
  5668. "required": true
  5669. }
  5670. ],
  5671. "summary": "Find symbols",
  5672. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  5673. "responses": {
  5674. "200": {
  5675. "description": "Symbols",
  5676. "content": {
  5677. "application/json": {
  5678. "schema": {
  5679. "type": "array",
  5680. "items": {
  5681. "$ref": "#/components/schemas/Symbol"
  5682. }
  5683. }
  5684. }
  5685. }
  5686. }
  5687. },
  5688. "x-codeSamples": [
  5689. {
  5690. "lang": "js",
  5691. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  5692. }
  5693. ]
  5694. }
  5695. },
  5696. "/file": {
  5697. "get": {
  5698. "operationId": "file.list",
  5699. "parameters": [
  5700. {
  5701. "in": "query",
  5702. "name": "directory",
  5703. "schema": {
  5704. "type": "string"
  5705. }
  5706. },
  5707. {
  5708. "in": "query",
  5709. "name": "workspace",
  5710. "schema": {
  5711. "type": "string"
  5712. }
  5713. },
  5714. {
  5715. "in": "query",
  5716. "name": "path",
  5717. "schema": {
  5718. "type": "string"
  5719. },
  5720. "required": true
  5721. }
  5722. ],
  5723. "summary": "List files",
  5724. "description": "List files and directories in a specified path.",
  5725. "responses": {
  5726. "200": {
  5727. "description": "Files and directories",
  5728. "content": {
  5729. "application/json": {
  5730. "schema": {
  5731. "type": "array",
  5732. "items": {
  5733. "$ref": "#/components/schemas/FileNode"
  5734. }
  5735. }
  5736. }
  5737. }
  5738. }
  5739. },
  5740. "x-codeSamples": [
  5741. {
  5742. "lang": "js",
  5743. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  5744. }
  5745. ]
  5746. }
  5747. },
  5748. "/file/content": {
  5749. "get": {
  5750. "operationId": "file.read",
  5751. "parameters": [
  5752. {
  5753. "in": "query",
  5754. "name": "directory",
  5755. "schema": {
  5756. "type": "string"
  5757. }
  5758. },
  5759. {
  5760. "in": "query",
  5761. "name": "workspace",
  5762. "schema": {
  5763. "type": "string"
  5764. }
  5765. },
  5766. {
  5767. "in": "query",
  5768. "name": "path",
  5769. "schema": {
  5770. "type": "string"
  5771. },
  5772. "required": true
  5773. }
  5774. ],
  5775. "summary": "Read file",
  5776. "description": "Read the content of a specified file.",
  5777. "responses": {
  5778. "200": {
  5779. "description": "File content",
  5780. "content": {
  5781. "application/json": {
  5782. "schema": {
  5783. "$ref": "#/components/schemas/FileContent"
  5784. }
  5785. }
  5786. }
  5787. }
  5788. },
  5789. "x-codeSamples": [
  5790. {
  5791. "lang": "js",
  5792. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  5793. }
  5794. ]
  5795. }
  5796. },
  5797. "/file/status": {
  5798. "get": {
  5799. "operationId": "file.status",
  5800. "parameters": [
  5801. {
  5802. "in": "query",
  5803. "name": "directory",
  5804. "schema": {
  5805. "type": "string"
  5806. }
  5807. },
  5808. {
  5809. "in": "query",
  5810. "name": "workspace",
  5811. "schema": {
  5812. "type": "string"
  5813. }
  5814. }
  5815. ],
  5816. "summary": "Get file status",
  5817. "description": "Get the git status of all files in the project.",
  5818. "responses": {
  5819. "200": {
  5820. "description": "File status",
  5821. "content": {
  5822. "application/json": {
  5823. "schema": {
  5824. "type": "array",
  5825. "items": {
  5826. "$ref": "#/components/schemas/File"
  5827. }
  5828. }
  5829. }
  5830. }
  5831. }
  5832. },
  5833. "x-codeSamples": [
  5834. {
  5835. "lang": "js",
  5836. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  5837. }
  5838. ]
  5839. }
  5840. },
  5841. "/event": {
  5842. "get": {
  5843. "operationId": "event.subscribe",
  5844. "parameters": [
  5845. {
  5846. "in": "query",
  5847. "name": "directory",
  5848. "schema": {
  5849. "type": "string"
  5850. }
  5851. },
  5852. {
  5853. "in": "query",
  5854. "name": "workspace",
  5855. "schema": {
  5856. "type": "string"
  5857. }
  5858. }
  5859. ],
  5860. "summary": "Subscribe to events",
  5861. "description": "Get events",
  5862. "responses": {
  5863. "200": {
  5864. "description": "Event stream",
  5865. "content": {
  5866. "text/event-stream": {
  5867. "schema": {
  5868. "$ref": "#/components/schemas/Event"
  5869. }
  5870. }
  5871. }
  5872. }
  5873. },
  5874. "x-codeSamples": [
  5875. {
  5876. "lang": "js",
  5877. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5878. }
  5879. ]
  5880. }
  5881. },
  5882. "/mcp": {
  5883. "get": {
  5884. "operationId": "mcp.status",
  5885. "parameters": [
  5886. {
  5887. "in": "query",
  5888. "name": "directory",
  5889. "schema": {
  5890. "type": "string"
  5891. }
  5892. },
  5893. {
  5894. "in": "query",
  5895. "name": "workspace",
  5896. "schema": {
  5897. "type": "string"
  5898. }
  5899. }
  5900. ],
  5901. "summary": "Get MCP status",
  5902. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  5903. "responses": {
  5904. "200": {
  5905. "description": "MCP server status",
  5906. "content": {
  5907. "application/json": {
  5908. "schema": {
  5909. "type": "object",
  5910. "propertyNames": {
  5911. "type": "string"
  5912. },
  5913. "additionalProperties": {
  5914. "$ref": "#/components/schemas/MCPStatus"
  5915. }
  5916. }
  5917. }
  5918. }
  5919. }
  5920. },
  5921. "x-codeSamples": [
  5922. {
  5923. "lang": "js",
  5924. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  5925. }
  5926. ]
  5927. },
  5928. "post": {
  5929. "operationId": "mcp.add",
  5930. "parameters": [
  5931. {
  5932. "in": "query",
  5933. "name": "directory",
  5934. "schema": {
  5935. "type": "string"
  5936. }
  5937. },
  5938. {
  5939. "in": "query",
  5940. "name": "workspace",
  5941. "schema": {
  5942. "type": "string"
  5943. }
  5944. }
  5945. ],
  5946. "summary": "Add MCP server",
  5947. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  5948. "responses": {
  5949. "200": {
  5950. "description": "MCP server added successfully",
  5951. "content": {
  5952. "application/json": {
  5953. "schema": {
  5954. "type": "object",
  5955. "propertyNames": {
  5956. "type": "string"
  5957. },
  5958. "additionalProperties": {
  5959. "$ref": "#/components/schemas/MCPStatus"
  5960. }
  5961. }
  5962. }
  5963. }
  5964. },
  5965. "400": {
  5966. "description": "Bad request",
  5967. "content": {
  5968. "application/json": {
  5969. "schema": {
  5970. "$ref": "#/components/schemas/BadRequestError"
  5971. }
  5972. }
  5973. }
  5974. }
  5975. },
  5976. "requestBody": {
  5977. "content": {
  5978. "application/json": {
  5979. "schema": {
  5980. "type": "object",
  5981. "properties": {
  5982. "name": {
  5983. "type": "string"
  5984. },
  5985. "config": {
  5986. "anyOf": [
  5987. {
  5988. "$ref": "#/components/schemas/McpLocalConfig"
  5989. },
  5990. {
  5991. "$ref": "#/components/schemas/McpRemoteConfig"
  5992. }
  5993. ]
  5994. }
  5995. },
  5996. "required": ["name", "config"]
  5997. }
  5998. }
  5999. }
  6000. },
  6001. "x-codeSamples": [
  6002. {
  6003. "lang": "js",
  6004. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  6005. }
  6006. ]
  6007. }
  6008. },
  6009. "/mcp/{name}/auth": {
  6010. "post": {
  6011. "operationId": "mcp.auth.start",
  6012. "parameters": [
  6013. {
  6014. "in": "query",
  6015. "name": "directory",
  6016. "schema": {
  6017. "type": "string"
  6018. }
  6019. },
  6020. {
  6021. "in": "query",
  6022. "name": "workspace",
  6023. "schema": {
  6024. "type": "string"
  6025. }
  6026. },
  6027. {
  6028. "schema": {
  6029. "type": "string"
  6030. },
  6031. "in": "path",
  6032. "name": "name",
  6033. "required": true
  6034. }
  6035. ],
  6036. "summary": "Start MCP OAuth",
  6037. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  6038. "responses": {
  6039. "200": {
  6040. "description": "OAuth flow started",
  6041. "content": {
  6042. "application/json": {
  6043. "schema": {
  6044. "type": "object",
  6045. "properties": {
  6046. "authorizationUrl": {
  6047. "description": "URL to open in browser for authorization",
  6048. "type": "string"
  6049. }
  6050. },
  6051. "required": ["authorizationUrl"]
  6052. }
  6053. }
  6054. }
  6055. },
  6056. "400": {
  6057. "description": "Bad request",
  6058. "content": {
  6059. "application/json": {
  6060. "schema": {
  6061. "$ref": "#/components/schemas/BadRequestError"
  6062. }
  6063. }
  6064. }
  6065. },
  6066. "404": {
  6067. "description": "Not found",
  6068. "content": {
  6069. "application/json": {
  6070. "schema": {
  6071. "$ref": "#/components/schemas/NotFoundError"
  6072. }
  6073. }
  6074. }
  6075. }
  6076. },
  6077. "x-codeSamples": [
  6078. {
  6079. "lang": "js",
  6080. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  6081. }
  6082. ]
  6083. },
  6084. "delete": {
  6085. "operationId": "mcp.auth.remove",
  6086. "parameters": [
  6087. {
  6088. "in": "query",
  6089. "name": "directory",
  6090. "schema": {
  6091. "type": "string"
  6092. }
  6093. },
  6094. {
  6095. "in": "query",
  6096. "name": "workspace",
  6097. "schema": {
  6098. "type": "string"
  6099. }
  6100. },
  6101. {
  6102. "schema": {
  6103. "type": "string"
  6104. },
  6105. "in": "path",
  6106. "name": "name",
  6107. "required": true
  6108. }
  6109. ],
  6110. "summary": "Remove MCP OAuth",
  6111. "description": "Remove OAuth credentials for an MCP server",
  6112. "responses": {
  6113. "200": {
  6114. "description": "OAuth credentials removed",
  6115. "content": {
  6116. "application/json": {
  6117. "schema": {
  6118. "type": "object",
  6119. "properties": {
  6120. "success": {
  6121. "type": "boolean",
  6122. "const": true
  6123. }
  6124. },
  6125. "required": ["success"]
  6126. }
  6127. }
  6128. }
  6129. },
  6130. "404": {
  6131. "description": "Not found",
  6132. "content": {
  6133. "application/json": {
  6134. "schema": {
  6135. "$ref": "#/components/schemas/NotFoundError"
  6136. }
  6137. }
  6138. }
  6139. }
  6140. },
  6141. "x-codeSamples": [
  6142. {
  6143. "lang": "js",
  6144. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  6145. }
  6146. ]
  6147. }
  6148. },
  6149. "/mcp/{name}/auth/callback": {
  6150. "post": {
  6151. "operationId": "mcp.auth.callback",
  6152. "parameters": [
  6153. {
  6154. "in": "query",
  6155. "name": "directory",
  6156. "schema": {
  6157. "type": "string"
  6158. }
  6159. },
  6160. {
  6161. "in": "query",
  6162. "name": "workspace",
  6163. "schema": {
  6164. "type": "string"
  6165. }
  6166. },
  6167. {
  6168. "schema": {
  6169. "type": "string"
  6170. },
  6171. "in": "path",
  6172. "name": "name",
  6173. "required": true
  6174. }
  6175. ],
  6176. "summary": "Complete MCP OAuth",
  6177. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  6178. "responses": {
  6179. "200": {
  6180. "description": "OAuth authentication completed",
  6181. "content": {
  6182. "application/json": {
  6183. "schema": {
  6184. "$ref": "#/components/schemas/MCPStatus"
  6185. }
  6186. }
  6187. }
  6188. },
  6189. "400": {
  6190. "description": "Bad request",
  6191. "content": {
  6192. "application/json": {
  6193. "schema": {
  6194. "$ref": "#/components/schemas/BadRequestError"
  6195. }
  6196. }
  6197. }
  6198. },
  6199. "404": {
  6200. "description": "Not found",
  6201. "content": {
  6202. "application/json": {
  6203. "schema": {
  6204. "$ref": "#/components/schemas/NotFoundError"
  6205. }
  6206. }
  6207. }
  6208. }
  6209. },
  6210. "requestBody": {
  6211. "content": {
  6212. "application/json": {
  6213. "schema": {
  6214. "type": "object",
  6215. "properties": {
  6216. "code": {
  6217. "description": "Authorization code from OAuth callback",
  6218. "type": "string"
  6219. }
  6220. },
  6221. "required": ["code"]
  6222. }
  6223. }
  6224. }
  6225. },
  6226. "x-codeSamples": [
  6227. {
  6228. "lang": "js",
  6229. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  6230. }
  6231. ]
  6232. }
  6233. },
  6234. "/mcp/{name}/auth/authenticate": {
  6235. "post": {
  6236. "operationId": "mcp.auth.authenticate",
  6237. "parameters": [
  6238. {
  6239. "in": "query",
  6240. "name": "directory",
  6241. "schema": {
  6242. "type": "string"
  6243. }
  6244. },
  6245. {
  6246. "in": "query",
  6247. "name": "workspace",
  6248. "schema": {
  6249. "type": "string"
  6250. }
  6251. },
  6252. {
  6253. "schema": {
  6254. "type": "string"
  6255. },
  6256. "in": "path",
  6257. "name": "name",
  6258. "required": true
  6259. }
  6260. ],
  6261. "summary": "Authenticate MCP OAuth",
  6262. "description": "Start OAuth flow and wait for callback (opens browser)",
  6263. "responses": {
  6264. "200": {
  6265. "description": "OAuth authentication completed",
  6266. "content": {
  6267. "application/json": {
  6268. "schema": {
  6269. "$ref": "#/components/schemas/MCPStatus"
  6270. }
  6271. }
  6272. }
  6273. },
  6274. "400": {
  6275. "description": "Bad request",
  6276. "content": {
  6277. "application/json": {
  6278. "schema": {
  6279. "$ref": "#/components/schemas/BadRequestError"
  6280. }
  6281. }
  6282. }
  6283. },
  6284. "404": {
  6285. "description": "Not found",
  6286. "content": {
  6287. "application/json": {
  6288. "schema": {
  6289. "$ref": "#/components/schemas/NotFoundError"
  6290. }
  6291. }
  6292. }
  6293. }
  6294. },
  6295. "x-codeSamples": [
  6296. {
  6297. "lang": "js",
  6298. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  6299. }
  6300. ]
  6301. }
  6302. },
  6303. "/mcp/{name}/connect": {
  6304. "post": {
  6305. "operationId": "mcp.connect",
  6306. "parameters": [
  6307. {
  6308. "in": "query",
  6309. "name": "directory",
  6310. "schema": {
  6311. "type": "string"
  6312. }
  6313. },
  6314. {
  6315. "in": "query",
  6316. "name": "workspace",
  6317. "schema": {
  6318. "type": "string"
  6319. }
  6320. },
  6321. {
  6322. "in": "path",
  6323. "name": "name",
  6324. "schema": {
  6325. "type": "string"
  6326. },
  6327. "required": true
  6328. }
  6329. ],
  6330. "description": "Connect an MCP server",
  6331. "responses": {
  6332. "200": {
  6333. "description": "MCP server connected successfully",
  6334. "content": {
  6335. "application/json": {
  6336. "schema": {
  6337. "type": "boolean"
  6338. }
  6339. }
  6340. }
  6341. }
  6342. },
  6343. "x-codeSamples": [
  6344. {
  6345. "lang": "js",
  6346. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  6347. }
  6348. ]
  6349. }
  6350. },
  6351. "/mcp/{name}/disconnect": {
  6352. "post": {
  6353. "operationId": "mcp.disconnect",
  6354. "parameters": [
  6355. {
  6356. "in": "query",
  6357. "name": "directory",
  6358. "schema": {
  6359. "type": "string"
  6360. }
  6361. },
  6362. {
  6363. "in": "query",
  6364. "name": "workspace",
  6365. "schema": {
  6366. "type": "string"
  6367. }
  6368. },
  6369. {
  6370. "in": "path",
  6371. "name": "name",
  6372. "schema": {
  6373. "type": "string"
  6374. },
  6375. "required": true
  6376. }
  6377. ],
  6378. "description": "Disconnect an MCP server",
  6379. "responses": {
  6380. "200": {
  6381. "description": "MCP server disconnected successfully",
  6382. "content": {
  6383. "application/json": {
  6384. "schema": {
  6385. "type": "boolean"
  6386. }
  6387. }
  6388. }
  6389. }
  6390. },
  6391. "x-codeSamples": [
  6392. {
  6393. "lang": "js",
  6394. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  6395. }
  6396. ]
  6397. }
  6398. },
  6399. "/tui/append-prompt": {
  6400. "post": {
  6401. "operationId": "tui.appendPrompt",
  6402. "parameters": [
  6403. {
  6404. "in": "query",
  6405. "name": "directory",
  6406. "schema": {
  6407. "type": "string"
  6408. }
  6409. },
  6410. {
  6411. "in": "query",
  6412. "name": "workspace",
  6413. "schema": {
  6414. "type": "string"
  6415. }
  6416. }
  6417. ],
  6418. "summary": "Append TUI prompt",
  6419. "description": "Append prompt to the TUI",
  6420. "responses": {
  6421. "200": {
  6422. "description": "Prompt processed successfully",
  6423. "content": {
  6424. "application/json": {
  6425. "schema": {
  6426. "type": "boolean"
  6427. }
  6428. }
  6429. }
  6430. },
  6431. "400": {
  6432. "description": "Bad request",
  6433. "content": {
  6434. "application/json": {
  6435. "schema": {
  6436. "$ref": "#/components/schemas/BadRequestError"
  6437. }
  6438. }
  6439. }
  6440. }
  6441. },
  6442. "requestBody": {
  6443. "content": {
  6444. "application/json": {
  6445. "schema": {
  6446. "type": "object",
  6447. "properties": {
  6448. "text": {
  6449. "type": "string"
  6450. }
  6451. },
  6452. "required": ["text"]
  6453. }
  6454. }
  6455. }
  6456. },
  6457. "x-codeSamples": [
  6458. {
  6459. "lang": "js",
  6460. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  6461. }
  6462. ]
  6463. }
  6464. },
  6465. "/tui/open-help": {
  6466. "post": {
  6467. "operationId": "tui.openHelp",
  6468. "parameters": [
  6469. {
  6470. "in": "query",
  6471. "name": "directory",
  6472. "schema": {
  6473. "type": "string"
  6474. }
  6475. },
  6476. {
  6477. "in": "query",
  6478. "name": "workspace",
  6479. "schema": {
  6480. "type": "string"
  6481. }
  6482. }
  6483. ],
  6484. "summary": "Open help dialog",
  6485. "description": "Open the help dialog in the TUI to display user assistance information.",
  6486. "responses": {
  6487. "200": {
  6488. "description": "Help dialog opened successfully",
  6489. "content": {
  6490. "application/json": {
  6491. "schema": {
  6492. "type": "boolean"
  6493. }
  6494. }
  6495. }
  6496. }
  6497. },
  6498. "x-codeSamples": [
  6499. {
  6500. "lang": "js",
  6501. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  6502. }
  6503. ]
  6504. }
  6505. },
  6506. "/tui/open-sessions": {
  6507. "post": {
  6508. "operationId": "tui.openSessions",
  6509. "parameters": [
  6510. {
  6511. "in": "query",
  6512. "name": "directory",
  6513. "schema": {
  6514. "type": "string"
  6515. }
  6516. },
  6517. {
  6518. "in": "query",
  6519. "name": "workspace",
  6520. "schema": {
  6521. "type": "string"
  6522. }
  6523. }
  6524. ],
  6525. "summary": "Open sessions dialog",
  6526. "description": "Open the session dialog",
  6527. "responses": {
  6528. "200": {
  6529. "description": "Session dialog opened successfully",
  6530. "content": {
  6531. "application/json": {
  6532. "schema": {
  6533. "type": "boolean"
  6534. }
  6535. }
  6536. }
  6537. }
  6538. },
  6539. "x-codeSamples": [
  6540. {
  6541. "lang": "js",
  6542. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  6543. }
  6544. ]
  6545. }
  6546. },
  6547. "/tui/open-themes": {
  6548. "post": {
  6549. "operationId": "tui.openThemes",
  6550. "parameters": [
  6551. {
  6552. "in": "query",
  6553. "name": "directory",
  6554. "schema": {
  6555. "type": "string"
  6556. }
  6557. },
  6558. {
  6559. "in": "query",
  6560. "name": "workspace",
  6561. "schema": {
  6562. "type": "string"
  6563. }
  6564. }
  6565. ],
  6566. "summary": "Open themes dialog",
  6567. "description": "Open the theme dialog",
  6568. "responses": {
  6569. "200": {
  6570. "description": "Theme dialog opened successfully",
  6571. "content": {
  6572. "application/json": {
  6573. "schema": {
  6574. "type": "boolean"
  6575. }
  6576. }
  6577. }
  6578. }
  6579. },
  6580. "x-codeSamples": [
  6581. {
  6582. "lang": "js",
  6583. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  6584. }
  6585. ]
  6586. }
  6587. },
  6588. "/tui/open-models": {
  6589. "post": {
  6590. "operationId": "tui.openModels",
  6591. "parameters": [
  6592. {
  6593. "in": "query",
  6594. "name": "directory",
  6595. "schema": {
  6596. "type": "string"
  6597. }
  6598. },
  6599. {
  6600. "in": "query",
  6601. "name": "workspace",
  6602. "schema": {
  6603. "type": "string"
  6604. }
  6605. }
  6606. ],
  6607. "summary": "Open models dialog",
  6608. "description": "Open the model dialog",
  6609. "responses": {
  6610. "200": {
  6611. "description": "Model dialog opened successfully",
  6612. "content": {
  6613. "application/json": {
  6614. "schema": {
  6615. "type": "boolean"
  6616. }
  6617. }
  6618. }
  6619. }
  6620. },
  6621. "x-codeSamples": [
  6622. {
  6623. "lang": "js",
  6624. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  6625. }
  6626. ]
  6627. }
  6628. },
  6629. "/tui/submit-prompt": {
  6630. "post": {
  6631. "operationId": "tui.submitPrompt",
  6632. "parameters": [
  6633. {
  6634. "in": "query",
  6635. "name": "directory",
  6636. "schema": {
  6637. "type": "string"
  6638. }
  6639. },
  6640. {
  6641. "in": "query",
  6642. "name": "workspace",
  6643. "schema": {
  6644. "type": "string"
  6645. }
  6646. }
  6647. ],
  6648. "summary": "Submit TUI prompt",
  6649. "description": "Submit the prompt",
  6650. "responses": {
  6651. "200": {
  6652. "description": "Prompt submitted successfully",
  6653. "content": {
  6654. "application/json": {
  6655. "schema": {
  6656. "type": "boolean"
  6657. }
  6658. }
  6659. }
  6660. }
  6661. },
  6662. "x-codeSamples": [
  6663. {
  6664. "lang": "js",
  6665. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  6666. }
  6667. ]
  6668. }
  6669. },
  6670. "/tui/clear-prompt": {
  6671. "post": {
  6672. "operationId": "tui.clearPrompt",
  6673. "parameters": [
  6674. {
  6675. "in": "query",
  6676. "name": "directory",
  6677. "schema": {
  6678. "type": "string"
  6679. }
  6680. },
  6681. {
  6682. "in": "query",
  6683. "name": "workspace",
  6684. "schema": {
  6685. "type": "string"
  6686. }
  6687. }
  6688. ],
  6689. "summary": "Clear TUI prompt",
  6690. "description": "Clear the prompt",
  6691. "responses": {
  6692. "200": {
  6693. "description": "Prompt cleared successfully",
  6694. "content": {
  6695. "application/json": {
  6696. "schema": {
  6697. "type": "boolean"
  6698. }
  6699. }
  6700. }
  6701. }
  6702. },
  6703. "x-codeSamples": [
  6704. {
  6705. "lang": "js",
  6706. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  6707. }
  6708. ]
  6709. }
  6710. },
  6711. "/tui/execute-command": {
  6712. "post": {
  6713. "operationId": "tui.executeCommand",
  6714. "parameters": [
  6715. {
  6716. "in": "query",
  6717. "name": "directory",
  6718. "schema": {
  6719. "type": "string"
  6720. }
  6721. },
  6722. {
  6723. "in": "query",
  6724. "name": "workspace",
  6725. "schema": {
  6726. "type": "string"
  6727. }
  6728. }
  6729. ],
  6730. "summary": "Execute TUI command",
  6731. "description": "Execute a TUI command (e.g. agent_cycle)",
  6732. "responses": {
  6733. "200": {
  6734. "description": "Command executed successfully",
  6735. "content": {
  6736. "application/json": {
  6737. "schema": {
  6738. "type": "boolean"
  6739. }
  6740. }
  6741. }
  6742. },
  6743. "400": {
  6744. "description": "Bad request",
  6745. "content": {
  6746. "application/json": {
  6747. "schema": {
  6748. "$ref": "#/components/schemas/BadRequestError"
  6749. }
  6750. }
  6751. }
  6752. }
  6753. },
  6754. "requestBody": {
  6755. "content": {
  6756. "application/json": {
  6757. "schema": {
  6758. "type": "object",
  6759. "properties": {
  6760. "command": {
  6761. "type": "string"
  6762. }
  6763. },
  6764. "required": ["command"]
  6765. }
  6766. }
  6767. }
  6768. },
  6769. "x-codeSamples": [
  6770. {
  6771. "lang": "js",
  6772. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  6773. }
  6774. ]
  6775. }
  6776. },
  6777. "/tui/show-toast": {
  6778. "post": {
  6779. "operationId": "tui.showToast",
  6780. "parameters": [
  6781. {
  6782. "in": "query",
  6783. "name": "directory",
  6784. "schema": {
  6785. "type": "string"
  6786. }
  6787. },
  6788. {
  6789. "in": "query",
  6790. "name": "workspace",
  6791. "schema": {
  6792. "type": "string"
  6793. }
  6794. }
  6795. ],
  6796. "summary": "Show TUI toast",
  6797. "description": "Show a toast notification in the TUI",
  6798. "responses": {
  6799. "200": {
  6800. "description": "Toast notification shown successfully",
  6801. "content": {
  6802. "application/json": {
  6803. "schema": {
  6804. "type": "boolean"
  6805. }
  6806. }
  6807. }
  6808. }
  6809. },
  6810. "requestBody": {
  6811. "content": {
  6812. "application/json": {
  6813. "schema": {
  6814. "type": "object",
  6815. "properties": {
  6816. "title": {
  6817. "type": "string"
  6818. },
  6819. "message": {
  6820. "type": "string"
  6821. },
  6822. "variant": {
  6823. "type": "string",
  6824. "enum": ["info", "success", "warning", "error"]
  6825. },
  6826. "duration": {
  6827. "description": "Duration in milliseconds",
  6828. "default": 5000,
  6829. "type": "number"
  6830. }
  6831. },
  6832. "required": ["message", "variant"]
  6833. }
  6834. }
  6835. }
  6836. },
  6837. "x-codeSamples": [
  6838. {
  6839. "lang": "js",
  6840. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  6841. }
  6842. ]
  6843. }
  6844. },
  6845. "/tui/publish": {
  6846. "post": {
  6847. "operationId": "tui.publish",
  6848. "parameters": [
  6849. {
  6850. "in": "query",
  6851. "name": "directory",
  6852. "schema": {
  6853. "type": "string"
  6854. }
  6855. },
  6856. {
  6857. "in": "query",
  6858. "name": "workspace",
  6859. "schema": {
  6860. "type": "string"
  6861. }
  6862. }
  6863. ],
  6864. "summary": "Publish TUI event",
  6865. "description": "Publish a TUI event",
  6866. "responses": {
  6867. "200": {
  6868. "description": "Event published successfully",
  6869. "content": {
  6870. "application/json": {
  6871. "schema": {
  6872. "type": "boolean"
  6873. }
  6874. }
  6875. }
  6876. },
  6877. "400": {
  6878. "description": "Bad request",
  6879. "content": {
  6880. "application/json": {
  6881. "schema": {
  6882. "$ref": "#/components/schemas/BadRequestError"
  6883. }
  6884. }
  6885. }
  6886. }
  6887. },
  6888. "requestBody": {
  6889. "content": {
  6890. "application/json": {
  6891. "schema": {
  6892. "anyOf": [
  6893. {
  6894. "$ref": "#/components/schemas/Event.tui.prompt.append"
  6895. },
  6896. {
  6897. "$ref": "#/components/schemas/Event.tui.command.execute"
  6898. },
  6899. {
  6900. "$ref": "#/components/schemas/Event.tui.toast.show"
  6901. },
  6902. {
  6903. "$ref": "#/components/schemas/Event.tui.session.select"
  6904. }
  6905. ]
  6906. }
  6907. }
  6908. }
  6909. },
  6910. "x-codeSamples": [
  6911. {
  6912. "lang": "js",
  6913. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  6914. }
  6915. ]
  6916. }
  6917. },
  6918. "/tui/select-session": {
  6919. "post": {
  6920. "operationId": "tui.selectSession",
  6921. "parameters": [
  6922. {
  6923. "in": "query",
  6924. "name": "directory",
  6925. "schema": {
  6926. "type": "string"
  6927. }
  6928. },
  6929. {
  6930. "in": "query",
  6931. "name": "workspace",
  6932. "schema": {
  6933. "type": "string"
  6934. }
  6935. }
  6936. ],
  6937. "summary": "Select session",
  6938. "description": "Navigate the TUI to display the specified session.",
  6939. "responses": {
  6940. "200": {
  6941. "description": "Session selected successfully",
  6942. "content": {
  6943. "application/json": {
  6944. "schema": {
  6945. "type": "boolean"
  6946. }
  6947. }
  6948. }
  6949. },
  6950. "400": {
  6951. "description": "Bad request",
  6952. "content": {
  6953. "application/json": {
  6954. "schema": {
  6955. "$ref": "#/components/schemas/BadRequestError"
  6956. }
  6957. }
  6958. }
  6959. },
  6960. "404": {
  6961. "description": "Not found",
  6962. "content": {
  6963. "application/json": {
  6964. "schema": {
  6965. "$ref": "#/components/schemas/NotFoundError"
  6966. }
  6967. }
  6968. }
  6969. }
  6970. },
  6971. "requestBody": {
  6972. "content": {
  6973. "application/json": {
  6974. "schema": {
  6975. "type": "object",
  6976. "properties": {
  6977. "sessionID": {
  6978. "description": "Session ID to navigate to",
  6979. "type": "string",
  6980. "pattern": "^ses.*"
  6981. }
  6982. },
  6983. "required": ["sessionID"]
  6984. }
  6985. }
  6986. }
  6987. },
  6988. "x-codeSamples": [
  6989. {
  6990. "lang": "js",
  6991. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  6992. }
  6993. ]
  6994. }
  6995. },
  6996. "/tui/control/next": {
  6997. "get": {
  6998. "operationId": "tui.control.next",
  6999. "parameters": [
  7000. {
  7001. "in": "query",
  7002. "name": "directory",
  7003. "schema": {
  7004. "type": "string"
  7005. }
  7006. },
  7007. {
  7008. "in": "query",
  7009. "name": "workspace",
  7010. "schema": {
  7011. "type": "string"
  7012. }
  7013. }
  7014. ],
  7015. "summary": "Get next TUI request",
  7016. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  7017. "responses": {
  7018. "200": {
  7019. "description": "Next TUI request",
  7020. "content": {
  7021. "application/json": {
  7022. "schema": {
  7023. "type": "object",
  7024. "properties": {
  7025. "path": {
  7026. "type": "string"
  7027. },
  7028. "body": {}
  7029. },
  7030. "required": ["path", "body"]
  7031. }
  7032. }
  7033. }
  7034. }
  7035. },
  7036. "x-codeSamples": [
  7037. {
  7038. "lang": "js",
  7039. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  7040. }
  7041. ]
  7042. }
  7043. },
  7044. "/tui/control/response": {
  7045. "post": {
  7046. "operationId": "tui.control.response",
  7047. "parameters": [
  7048. {
  7049. "in": "query",
  7050. "name": "directory",
  7051. "schema": {
  7052. "type": "string"
  7053. }
  7054. },
  7055. {
  7056. "in": "query",
  7057. "name": "workspace",
  7058. "schema": {
  7059. "type": "string"
  7060. }
  7061. }
  7062. ],
  7063. "summary": "Submit TUI response",
  7064. "description": "Submit a response to the TUI request queue to complete a pending request.",
  7065. "responses": {
  7066. "200": {
  7067. "description": "Response submitted successfully",
  7068. "content": {
  7069. "application/json": {
  7070. "schema": {
  7071. "type": "boolean"
  7072. }
  7073. }
  7074. }
  7075. }
  7076. },
  7077. "requestBody": {
  7078. "content": {
  7079. "application/json": {
  7080. "schema": {}
  7081. }
  7082. }
  7083. },
  7084. "x-codeSamples": [
  7085. {
  7086. "lang": "js",
  7087. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  7088. }
  7089. ]
  7090. }
  7091. },
  7092. "/instance/dispose": {
  7093. "post": {
  7094. "operationId": "instance.dispose",
  7095. "parameters": [
  7096. {
  7097. "in": "query",
  7098. "name": "directory",
  7099. "schema": {
  7100. "type": "string"
  7101. }
  7102. },
  7103. {
  7104. "in": "query",
  7105. "name": "workspace",
  7106. "schema": {
  7107. "type": "string"
  7108. }
  7109. }
  7110. ],
  7111. "summary": "Dispose instance",
  7112. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  7113. "responses": {
  7114. "200": {
  7115. "description": "Instance disposed",
  7116. "content": {
  7117. "application/json": {
  7118. "schema": {
  7119. "type": "boolean"
  7120. }
  7121. }
  7122. }
  7123. }
  7124. },
  7125. "x-codeSamples": [
  7126. {
  7127. "lang": "js",
  7128. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  7129. }
  7130. ]
  7131. }
  7132. },
  7133. "/path": {
  7134. "get": {
  7135. "operationId": "path.get",
  7136. "parameters": [
  7137. {
  7138. "in": "query",
  7139. "name": "directory",
  7140. "schema": {
  7141. "type": "string"
  7142. }
  7143. },
  7144. {
  7145. "in": "query",
  7146. "name": "workspace",
  7147. "schema": {
  7148. "type": "string"
  7149. }
  7150. }
  7151. ],
  7152. "summary": "Get paths",
  7153. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  7154. "responses": {
  7155. "200": {
  7156. "description": "Path",
  7157. "content": {
  7158. "application/json": {
  7159. "schema": {
  7160. "$ref": "#/components/schemas/Path"
  7161. }
  7162. }
  7163. }
  7164. }
  7165. },
  7166. "x-codeSamples": [
  7167. {
  7168. "lang": "js",
  7169. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  7170. }
  7171. ]
  7172. }
  7173. },
  7174. "/vcs": {
  7175. "get": {
  7176. "operationId": "vcs.get",
  7177. "parameters": [
  7178. {
  7179. "in": "query",
  7180. "name": "directory",
  7181. "schema": {
  7182. "type": "string"
  7183. }
  7184. },
  7185. {
  7186. "in": "query",
  7187. "name": "workspace",
  7188. "schema": {
  7189. "type": "string"
  7190. }
  7191. }
  7192. ],
  7193. "summary": "Get VCS info",
  7194. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  7195. "responses": {
  7196. "200": {
  7197. "description": "VCS info",
  7198. "content": {
  7199. "application/json": {
  7200. "schema": {
  7201. "$ref": "#/components/schemas/VcsInfo"
  7202. }
  7203. }
  7204. }
  7205. }
  7206. },
  7207. "x-codeSamples": [
  7208. {
  7209. "lang": "js",
  7210. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  7211. }
  7212. ]
  7213. }
  7214. },
  7215. "/vcs/diff": {
  7216. "get": {
  7217. "operationId": "vcs.diff",
  7218. "parameters": [
  7219. {
  7220. "in": "query",
  7221. "name": "directory",
  7222. "schema": {
  7223. "type": "string"
  7224. }
  7225. },
  7226. {
  7227. "in": "query",
  7228. "name": "workspace",
  7229. "schema": {
  7230. "type": "string"
  7231. }
  7232. },
  7233. {
  7234. "in": "query",
  7235. "name": "mode",
  7236. "schema": {
  7237. "type": "string",
  7238. "enum": ["git", "branch"]
  7239. },
  7240. "required": true
  7241. }
  7242. ],
  7243. "summary": "Get VCS diff",
  7244. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  7245. "responses": {
  7246. "200": {
  7247. "description": "VCS diff",
  7248. "content": {
  7249. "application/json": {
  7250. "schema": {
  7251. "type": "array",
  7252. "items": {
  7253. "$ref": "#/components/schemas/VcsFileDiff"
  7254. }
  7255. }
  7256. }
  7257. }
  7258. }
  7259. },
  7260. "x-codeSamples": [
  7261. {
  7262. "lang": "js",
  7263. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  7264. }
  7265. ]
  7266. }
  7267. },
  7268. "/command": {
  7269. "get": {
  7270. "operationId": "command.list",
  7271. "parameters": [
  7272. {
  7273. "in": "query",
  7274. "name": "directory",
  7275. "schema": {
  7276. "type": "string"
  7277. }
  7278. },
  7279. {
  7280. "in": "query",
  7281. "name": "workspace",
  7282. "schema": {
  7283. "type": "string"
  7284. }
  7285. }
  7286. ],
  7287. "summary": "List commands",
  7288. "description": "Get a list of all available commands in the OpenCode system.",
  7289. "responses": {
  7290. "200": {
  7291. "description": "List of commands",
  7292. "content": {
  7293. "application/json": {
  7294. "schema": {
  7295. "type": "array",
  7296. "items": {
  7297. "$ref": "#/components/schemas/Command"
  7298. }
  7299. }
  7300. }
  7301. }
  7302. }
  7303. },
  7304. "x-codeSamples": [
  7305. {
  7306. "lang": "js",
  7307. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  7308. }
  7309. ]
  7310. }
  7311. },
  7312. "/agent": {
  7313. "get": {
  7314. "operationId": "app.agents",
  7315. "parameters": [
  7316. {
  7317. "in": "query",
  7318. "name": "directory",
  7319. "schema": {
  7320. "type": "string"
  7321. }
  7322. },
  7323. {
  7324. "in": "query",
  7325. "name": "workspace",
  7326. "schema": {
  7327. "type": "string"
  7328. }
  7329. }
  7330. ],
  7331. "summary": "List agents",
  7332. "description": "Get a list of all available AI agents in the OpenCode system.",
  7333. "responses": {
  7334. "200": {
  7335. "description": "List of agents",
  7336. "content": {
  7337. "application/json": {
  7338. "schema": {
  7339. "type": "array",
  7340. "items": {
  7341. "$ref": "#/components/schemas/Agent"
  7342. }
  7343. }
  7344. }
  7345. }
  7346. }
  7347. },
  7348. "x-codeSamples": [
  7349. {
  7350. "lang": "js",
  7351. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  7352. }
  7353. ]
  7354. }
  7355. },
  7356. "/skill": {
  7357. "get": {
  7358. "operationId": "app.skills",
  7359. "parameters": [
  7360. {
  7361. "in": "query",
  7362. "name": "directory",
  7363. "schema": {
  7364. "type": "string"
  7365. }
  7366. },
  7367. {
  7368. "in": "query",
  7369. "name": "workspace",
  7370. "schema": {
  7371. "type": "string"
  7372. }
  7373. }
  7374. ],
  7375. "summary": "List skills",
  7376. "description": "Get a list of all available skills in the OpenCode system.",
  7377. "responses": {
  7378. "200": {
  7379. "description": "List of skills",
  7380. "content": {
  7381. "application/json": {
  7382. "schema": {
  7383. "type": "array",
  7384. "items": {
  7385. "type": "object",
  7386. "properties": {
  7387. "name": {
  7388. "type": "string"
  7389. },
  7390. "description": {
  7391. "type": "string"
  7392. },
  7393. "location": {
  7394. "type": "string"
  7395. },
  7396. "content": {
  7397. "type": "string"
  7398. }
  7399. },
  7400. "required": ["name", "description", "location", "content"]
  7401. }
  7402. }
  7403. }
  7404. }
  7405. }
  7406. },
  7407. "x-codeSamples": [
  7408. {
  7409. "lang": "js",
  7410. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  7411. }
  7412. ]
  7413. }
  7414. },
  7415. "/lsp": {
  7416. "get": {
  7417. "operationId": "lsp.status",
  7418. "parameters": [
  7419. {
  7420. "in": "query",
  7421. "name": "directory",
  7422. "schema": {
  7423. "type": "string"
  7424. }
  7425. },
  7426. {
  7427. "in": "query",
  7428. "name": "workspace",
  7429. "schema": {
  7430. "type": "string"
  7431. }
  7432. }
  7433. ],
  7434. "summary": "Get LSP status",
  7435. "description": "Get LSP server status",
  7436. "responses": {
  7437. "200": {
  7438. "description": "LSP server status",
  7439. "content": {
  7440. "application/json": {
  7441. "schema": {
  7442. "type": "array",
  7443. "items": {
  7444. "$ref": "#/components/schemas/LSPStatus"
  7445. }
  7446. }
  7447. }
  7448. }
  7449. }
  7450. },
  7451. "x-codeSamples": [
  7452. {
  7453. "lang": "js",
  7454. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  7455. }
  7456. ]
  7457. }
  7458. },
  7459. "/formatter": {
  7460. "get": {
  7461. "operationId": "formatter.status",
  7462. "parameters": [
  7463. {
  7464. "in": "query",
  7465. "name": "directory",
  7466. "schema": {
  7467. "type": "string"
  7468. }
  7469. },
  7470. {
  7471. "in": "query",
  7472. "name": "workspace",
  7473. "schema": {
  7474. "type": "string"
  7475. }
  7476. }
  7477. ],
  7478. "summary": "Get formatter status",
  7479. "description": "Get formatter status",
  7480. "responses": {
  7481. "200": {
  7482. "description": "Formatter status",
  7483. "content": {
  7484. "application/json": {
  7485. "schema": {
  7486. "type": "array",
  7487. "items": {
  7488. "$ref": "#/components/schemas/FormatterStatus"
  7489. }
  7490. }
  7491. }
  7492. }
  7493. }
  7494. },
  7495. "x-codeSamples": [
  7496. {
  7497. "lang": "js",
  7498. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  7499. }
  7500. ]
  7501. }
  7502. }
  7503. },
  7504. "components": {
  7505. "schemas": {
  7506. "Project": {
  7507. "type": "object",
  7508. "properties": {
  7509. "id": {
  7510. "type": "string"
  7511. },
  7512. "worktree": {
  7513. "type": "string"
  7514. },
  7515. "vcs": {
  7516. "type": "string",
  7517. "const": "git"
  7518. },
  7519. "name": {
  7520. "type": "string"
  7521. },
  7522. "icon": {
  7523. "type": "object",
  7524. "properties": {
  7525. "url": {
  7526. "type": "string"
  7527. },
  7528. "override": {
  7529. "type": "string"
  7530. },
  7531. "color": {
  7532. "type": "string"
  7533. }
  7534. }
  7535. },
  7536. "commands": {
  7537. "type": "object",
  7538. "properties": {
  7539. "start": {
  7540. "description": "Startup script to run when creating a new workspace (worktree)",
  7541. "type": "string"
  7542. }
  7543. }
  7544. },
  7545. "time": {
  7546. "type": "object",
  7547. "properties": {
  7548. "created": {
  7549. "type": "number"
  7550. },
  7551. "updated": {
  7552. "type": "number"
  7553. },
  7554. "initialized": {
  7555. "type": "number"
  7556. }
  7557. },
  7558. "required": ["created", "updated"]
  7559. },
  7560. "sandboxes": {
  7561. "type": "array",
  7562. "items": {
  7563. "type": "string"
  7564. }
  7565. }
  7566. },
  7567. "required": ["id", "worktree", "time", "sandboxes"]
  7568. },
  7569. "Event.project.updated": {
  7570. "type": "object",
  7571. "properties": {
  7572. "type": {
  7573. "type": "string",
  7574. "const": "project.updated"
  7575. },
  7576. "properties": {
  7577. "$ref": "#/components/schemas/Project"
  7578. }
  7579. },
  7580. "required": ["type", "properties"]
  7581. },
  7582. "Event.server.instance.disposed": {
  7583. "type": "object",
  7584. "properties": {
  7585. "type": {
  7586. "type": "string",
  7587. "const": "server.instance.disposed"
  7588. },
  7589. "properties": {
  7590. "type": "object",
  7591. "properties": {
  7592. "directory": {
  7593. "type": "string"
  7594. }
  7595. },
  7596. "required": ["directory"]
  7597. }
  7598. },
  7599. "required": ["type", "properties"]
  7600. },
  7601. "Event.server.connected": {
  7602. "type": "object",
  7603. "properties": {
  7604. "type": {
  7605. "type": "string",
  7606. "const": "server.connected"
  7607. },
  7608. "properties": {
  7609. "type": "object",
  7610. "properties": {}
  7611. }
  7612. },
  7613. "required": ["type", "properties"]
  7614. },
  7615. "Event.global.disposed": {
  7616. "type": "object",
  7617. "properties": {
  7618. "type": {
  7619. "type": "string",
  7620. "const": "global.disposed"
  7621. },
  7622. "properties": {
  7623. "type": "object",
  7624. "properties": {}
  7625. }
  7626. },
  7627. "required": ["type", "properties"]
  7628. },
  7629. "Event.file.edited": {
  7630. "type": "object",
  7631. "properties": {
  7632. "type": {
  7633. "type": "string",
  7634. "const": "file.edited"
  7635. },
  7636. "properties": {
  7637. "type": "object",
  7638. "properties": {
  7639. "file": {
  7640. "type": "string"
  7641. }
  7642. },
  7643. "required": ["file"]
  7644. }
  7645. },
  7646. "required": ["type", "properties"]
  7647. },
  7648. "Event.file.watcher.updated": {
  7649. "type": "object",
  7650. "properties": {
  7651. "type": {
  7652. "type": "string",
  7653. "const": "file.watcher.updated"
  7654. },
  7655. "properties": {
  7656. "type": "object",
  7657. "properties": {
  7658. "file": {
  7659. "type": "string"
  7660. },
  7661. "event": {
  7662. "anyOf": [
  7663. {
  7664. "type": "string",
  7665. "const": "add"
  7666. },
  7667. {
  7668. "type": "string",
  7669. "const": "change"
  7670. },
  7671. {
  7672. "type": "string",
  7673. "const": "unlink"
  7674. }
  7675. ]
  7676. }
  7677. },
  7678. "required": ["file", "event"]
  7679. }
  7680. },
  7681. "required": ["type", "properties"]
  7682. },
  7683. "Event.lsp.client.diagnostics": {
  7684. "type": "object",
  7685. "properties": {
  7686. "type": {
  7687. "type": "string",
  7688. "const": "lsp.client.diagnostics"
  7689. },
  7690. "properties": {
  7691. "type": "object",
  7692. "properties": {
  7693. "serverID": {
  7694. "type": "string"
  7695. },
  7696. "path": {
  7697. "type": "string"
  7698. }
  7699. },
  7700. "required": ["serverID", "path"]
  7701. }
  7702. },
  7703. "required": ["type", "properties"]
  7704. },
  7705. "Event.lsp.updated": {
  7706. "type": "object",
  7707. "properties": {
  7708. "type": {
  7709. "type": "string",
  7710. "const": "lsp.updated"
  7711. },
  7712. "properties": {
  7713. "type": "object",
  7714. "properties": {}
  7715. }
  7716. },
  7717. "required": ["type", "properties"]
  7718. },
  7719. "Event.installation.updated": {
  7720. "type": "object",
  7721. "properties": {
  7722. "type": {
  7723. "type": "string",
  7724. "const": "installation.updated"
  7725. },
  7726. "properties": {
  7727. "type": "object",
  7728. "properties": {
  7729. "version": {
  7730. "type": "string"
  7731. }
  7732. },
  7733. "required": ["version"]
  7734. }
  7735. },
  7736. "required": ["type", "properties"]
  7737. },
  7738. "Event.installation.update-available": {
  7739. "type": "object",
  7740. "properties": {
  7741. "type": {
  7742. "type": "string",
  7743. "const": "installation.update-available"
  7744. },
  7745. "properties": {
  7746. "type": "object",
  7747. "properties": {
  7748. "version": {
  7749. "type": "string"
  7750. }
  7751. },
  7752. "required": ["version"]
  7753. }
  7754. },
  7755. "required": ["type", "properties"]
  7756. },
  7757. "Event.message.part.delta": {
  7758. "type": "object",
  7759. "properties": {
  7760. "type": {
  7761. "type": "string",
  7762. "const": "message.part.delta"
  7763. },
  7764. "properties": {
  7765. "type": "object",
  7766. "properties": {
  7767. "sessionID": {
  7768. "type": "string",
  7769. "pattern": "^ses.*"
  7770. },
  7771. "messageID": {
  7772. "type": "string",
  7773. "pattern": "^msg.*"
  7774. },
  7775. "partID": {
  7776. "type": "string",
  7777. "pattern": "^prt.*"
  7778. },
  7779. "field": {
  7780. "type": "string"
  7781. },
  7782. "delta": {
  7783. "type": "string"
  7784. }
  7785. },
  7786. "required": ["sessionID", "messageID", "partID", "field", "delta"]
  7787. }
  7788. },
  7789. "required": ["type", "properties"]
  7790. },
  7791. "PermissionRequest": {
  7792. "type": "object",
  7793. "properties": {
  7794. "id": {
  7795. "type": "string",
  7796. "pattern": "^per.*"
  7797. },
  7798. "sessionID": {
  7799. "type": "string",
  7800. "pattern": "^ses.*"
  7801. },
  7802. "permission": {
  7803. "type": "string"
  7804. },
  7805. "patterns": {
  7806. "type": "array",
  7807. "items": {
  7808. "type": "string"
  7809. }
  7810. },
  7811. "metadata": {
  7812. "type": "object",
  7813. "propertyNames": {
  7814. "type": "string"
  7815. },
  7816. "additionalProperties": {}
  7817. },
  7818. "always": {
  7819. "type": "array",
  7820. "items": {
  7821. "type": "string"
  7822. }
  7823. },
  7824. "tool": {
  7825. "type": "object",
  7826. "properties": {
  7827. "messageID": {
  7828. "type": "string",
  7829. "pattern": "^msg.*"
  7830. },
  7831. "callID": {
  7832. "type": "string"
  7833. }
  7834. },
  7835. "required": ["messageID", "callID"]
  7836. }
  7837. },
  7838. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  7839. },
  7840. "Event.permission.asked": {
  7841. "type": "object",
  7842. "properties": {
  7843. "type": {
  7844. "type": "string",
  7845. "const": "permission.asked"
  7846. },
  7847. "properties": {
  7848. "$ref": "#/components/schemas/PermissionRequest"
  7849. }
  7850. },
  7851. "required": ["type", "properties"]
  7852. },
  7853. "Event.permission.replied": {
  7854. "type": "object",
  7855. "properties": {
  7856. "type": {
  7857. "type": "string",
  7858. "const": "permission.replied"
  7859. },
  7860. "properties": {
  7861. "type": "object",
  7862. "properties": {
  7863. "sessionID": {
  7864. "type": "string",
  7865. "pattern": "^ses.*"
  7866. },
  7867. "requestID": {
  7868. "type": "string",
  7869. "pattern": "^per.*"
  7870. },
  7871. "reply": {
  7872. "type": "string",
  7873. "enum": ["once", "always", "reject"]
  7874. }
  7875. },
  7876. "required": ["sessionID", "requestID", "reply"]
  7877. }
  7878. },
  7879. "required": ["type", "properties"]
  7880. },
  7881. "SnapshotFileDiff": {
  7882. "type": "object",
  7883. "properties": {
  7884. "file": {
  7885. "type": "string"
  7886. },
  7887. "patch": {
  7888. "type": "string"
  7889. },
  7890. "additions": {
  7891. "type": "number"
  7892. },
  7893. "deletions": {
  7894. "type": "number"
  7895. },
  7896. "status": {
  7897. "type": "string",
  7898. "enum": ["added", "deleted", "modified"]
  7899. }
  7900. },
  7901. "required": ["file", "patch", "additions", "deletions"]
  7902. },
  7903. "Event.session.diff": {
  7904. "type": "object",
  7905. "properties": {
  7906. "type": {
  7907. "type": "string",
  7908. "const": "session.diff"
  7909. },
  7910. "properties": {
  7911. "type": "object",
  7912. "properties": {
  7913. "sessionID": {
  7914. "type": "string",
  7915. "pattern": "^ses.*"
  7916. },
  7917. "diff": {
  7918. "type": "array",
  7919. "items": {
  7920. "$ref": "#/components/schemas/SnapshotFileDiff"
  7921. }
  7922. }
  7923. },
  7924. "required": ["sessionID", "diff"]
  7925. }
  7926. },
  7927. "required": ["type", "properties"]
  7928. },
  7929. "ProviderAuthError": {
  7930. "type": "object",
  7931. "properties": {
  7932. "name": {
  7933. "type": "string",
  7934. "const": "ProviderAuthError"
  7935. },
  7936. "data": {
  7937. "type": "object",
  7938. "properties": {
  7939. "providerID": {
  7940. "type": "string"
  7941. },
  7942. "message": {
  7943. "type": "string"
  7944. }
  7945. },
  7946. "required": ["providerID", "message"]
  7947. }
  7948. },
  7949. "required": ["name", "data"]
  7950. },
  7951. "UnknownError": {
  7952. "type": "object",
  7953. "properties": {
  7954. "name": {
  7955. "type": "string",
  7956. "const": "UnknownError"
  7957. },
  7958. "data": {
  7959. "type": "object",
  7960. "properties": {
  7961. "message": {
  7962. "type": "string"
  7963. }
  7964. },
  7965. "required": ["message"]
  7966. }
  7967. },
  7968. "required": ["name", "data"]
  7969. },
  7970. "MessageOutputLengthError": {
  7971. "type": "object",
  7972. "properties": {
  7973. "name": {
  7974. "type": "string",
  7975. "const": "MessageOutputLengthError"
  7976. },
  7977. "data": {
  7978. "type": "object",
  7979. "properties": {}
  7980. }
  7981. },
  7982. "required": ["name", "data"]
  7983. },
  7984. "MessageAbortedError": {
  7985. "type": "object",
  7986. "properties": {
  7987. "name": {
  7988. "type": "string",
  7989. "const": "MessageAbortedError"
  7990. },
  7991. "data": {
  7992. "type": "object",
  7993. "properties": {
  7994. "message": {
  7995. "type": "string"
  7996. }
  7997. },
  7998. "required": ["message"]
  7999. }
  8000. },
  8001. "required": ["name", "data"]
  8002. },
  8003. "StructuredOutputError": {
  8004. "type": "object",
  8005. "properties": {
  8006. "name": {
  8007. "type": "string",
  8008. "const": "StructuredOutputError"
  8009. },
  8010. "data": {
  8011. "type": "object",
  8012. "properties": {
  8013. "message": {
  8014. "type": "string"
  8015. },
  8016. "retries": {
  8017. "type": "number"
  8018. }
  8019. },
  8020. "required": ["message", "retries"]
  8021. }
  8022. },
  8023. "required": ["name", "data"]
  8024. },
  8025. "ContextOverflowError": {
  8026. "type": "object",
  8027. "properties": {
  8028. "name": {
  8029. "type": "string",
  8030. "const": "ContextOverflowError"
  8031. },
  8032. "data": {
  8033. "type": "object",
  8034. "properties": {
  8035. "message": {
  8036. "type": "string"
  8037. },
  8038. "responseBody": {
  8039. "type": "string"
  8040. }
  8041. },
  8042. "required": ["message"]
  8043. }
  8044. },
  8045. "required": ["name", "data"]
  8046. },
  8047. "APIError": {
  8048. "type": "object",
  8049. "properties": {
  8050. "name": {
  8051. "type": "string",
  8052. "const": "APIError"
  8053. },
  8054. "data": {
  8055. "type": "object",
  8056. "properties": {
  8057. "message": {
  8058. "type": "string"
  8059. },
  8060. "statusCode": {
  8061. "type": "number"
  8062. },
  8063. "isRetryable": {
  8064. "type": "boolean"
  8065. },
  8066. "responseHeaders": {
  8067. "type": "object",
  8068. "propertyNames": {
  8069. "type": "string"
  8070. },
  8071. "additionalProperties": {
  8072. "type": "string"
  8073. }
  8074. },
  8075. "responseBody": {
  8076. "type": "string"
  8077. },
  8078. "metadata": {
  8079. "type": "object",
  8080. "propertyNames": {
  8081. "type": "string"
  8082. },
  8083. "additionalProperties": {
  8084. "type": "string"
  8085. }
  8086. }
  8087. },
  8088. "required": ["message", "isRetryable"]
  8089. }
  8090. },
  8091. "required": ["name", "data"]
  8092. },
  8093. "Event.session.error": {
  8094. "type": "object",
  8095. "properties": {
  8096. "type": {
  8097. "type": "string",
  8098. "const": "session.error"
  8099. },
  8100. "properties": {
  8101. "type": "object",
  8102. "properties": {
  8103. "sessionID": {
  8104. "type": "string",
  8105. "pattern": "^ses.*"
  8106. },
  8107. "error": {
  8108. "anyOf": [
  8109. {
  8110. "$ref": "#/components/schemas/ProviderAuthError"
  8111. },
  8112. {
  8113. "$ref": "#/components/schemas/UnknownError"
  8114. },
  8115. {
  8116. "$ref": "#/components/schemas/MessageOutputLengthError"
  8117. },
  8118. {
  8119. "$ref": "#/components/schemas/MessageAbortedError"
  8120. },
  8121. {
  8122. "$ref": "#/components/schemas/StructuredOutputError"
  8123. },
  8124. {
  8125. "$ref": "#/components/schemas/ContextOverflowError"
  8126. },
  8127. {
  8128. "$ref": "#/components/schemas/APIError"
  8129. }
  8130. ]
  8131. }
  8132. }
  8133. }
  8134. },
  8135. "required": ["type", "properties"]
  8136. },
  8137. "QuestionOption": {
  8138. "type": "object",
  8139. "properties": {
  8140. "label": {
  8141. "description": "Display text (1-5 words, concise)",
  8142. "type": "string"
  8143. },
  8144. "description": {
  8145. "description": "Explanation of choice",
  8146. "type": "string"
  8147. }
  8148. },
  8149. "required": ["label", "description"]
  8150. },
  8151. "QuestionInfo": {
  8152. "type": "object",
  8153. "properties": {
  8154. "question": {
  8155. "description": "Complete question",
  8156. "type": "string"
  8157. },
  8158. "header": {
  8159. "description": "Very short label (max 30 chars)",
  8160. "type": "string"
  8161. },
  8162. "options": {
  8163. "description": "Available choices",
  8164. "type": "array",
  8165. "items": {
  8166. "$ref": "#/components/schemas/QuestionOption"
  8167. }
  8168. },
  8169. "multiple": {
  8170. "description": "Allow selecting multiple choices",
  8171. "type": "boolean"
  8172. },
  8173. "custom": {
  8174. "description": "Allow typing a custom answer (default: true)",
  8175. "type": "boolean"
  8176. }
  8177. },
  8178. "required": ["question", "header", "options"]
  8179. },
  8180. "QuestionTool": {
  8181. "type": "object",
  8182. "properties": {
  8183. "messageID": {
  8184. "type": "string",
  8185. "pattern": "^msg.*"
  8186. },
  8187. "callID": {
  8188. "type": "string"
  8189. }
  8190. },
  8191. "required": ["messageID", "callID"]
  8192. },
  8193. "QuestionRequest": {
  8194. "type": "object",
  8195. "properties": {
  8196. "id": {
  8197. "type": "string",
  8198. "pattern": "^que.*"
  8199. },
  8200. "sessionID": {
  8201. "type": "string",
  8202. "pattern": "^ses.*"
  8203. },
  8204. "questions": {
  8205. "description": "Questions to ask",
  8206. "type": "array",
  8207. "items": {
  8208. "$ref": "#/components/schemas/QuestionInfo"
  8209. }
  8210. },
  8211. "tool": {
  8212. "$ref": "#/components/schemas/QuestionTool"
  8213. }
  8214. },
  8215. "required": ["id", "sessionID", "questions"]
  8216. },
  8217. "Event.question.asked": {
  8218. "type": "object",
  8219. "properties": {
  8220. "type": {
  8221. "type": "string",
  8222. "const": "question.asked"
  8223. },
  8224. "properties": {
  8225. "$ref": "#/components/schemas/QuestionRequest"
  8226. }
  8227. },
  8228. "required": ["type", "properties"]
  8229. },
  8230. "QuestionAnswer": {
  8231. "type": "array",
  8232. "items": {
  8233. "type": "string"
  8234. }
  8235. },
  8236. "QuestionReplied": {
  8237. "type": "object",
  8238. "properties": {
  8239. "sessionID": {
  8240. "type": "string",
  8241. "pattern": "^ses.*"
  8242. },
  8243. "requestID": {
  8244. "type": "string",
  8245. "pattern": "^que.*"
  8246. },
  8247. "answers": {
  8248. "type": "array",
  8249. "items": {
  8250. "$ref": "#/components/schemas/QuestionAnswer"
  8251. }
  8252. }
  8253. },
  8254. "required": ["sessionID", "requestID", "answers"]
  8255. },
  8256. "Event.question.replied": {
  8257. "type": "object",
  8258. "properties": {
  8259. "type": {
  8260. "type": "string",
  8261. "const": "question.replied"
  8262. },
  8263. "properties": {
  8264. "$ref": "#/components/schemas/QuestionReplied"
  8265. }
  8266. },
  8267. "required": ["type", "properties"]
  8268. },
  8269. "QuestionRejected": {
  8270. "type": "object",
  8271. "properties": {
  8272. "sessionID": {
  8273. "type": "string",
  8274. "pattern": "^ses.*"
  8275. },
  8276. "requestID": {
  8277. "type": "string",
  8278. "pattern": "^que.*"
  8279. }
  8280. },
  8281. "required": ["sessionID", "requestID"]
  8282. },
  8283. "Event.question.rejected": {
  8284. "type": "object",
  8285. "properties": {
  8286. "type": {
  8287. "type": "string",
  8288. "const": "question.rejected"
  8289. },
  8290. "properties": {
  8291. "$ref": "#/components/schemas/QuestionRejected"
  8292. }
  8293. },
  8294. "required": ["type", "properties"]
  8295. },
  8296. "Todo": {
  8297. "type": "object",
  8298. "properties": {
  8299. "content": {
  8300. "description": "Brief description of the task",
  8301. "type": "string"
  8302. },
  8303. "status": {
  8304. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  8305. "type": "string"
  8306. },
  8307. "priority": {
  8308. "description": "Priority level of the task: high, medium, low",
  8309. "type": "string"
  8310. }
  8311. },
  8312. "required": ["content", "status", "priority"]
  8313. },
  8314. "Event.todo.updated": {
  8315. "type": "object",
  8316. "properties": {
  8317. "type": {
  8318. "type": "string",
  8319. "const": "todo.updated"
  8320. },
  8321. "properties": {
  8322. "type": "object",
  8323. "properties": {
  8324. "sessionID": {
  8325. "type": "string",
  8326. "pattern": "^ses.*"
  8327. },
  8328. "todos": {
  8329. "type": "array",
  8330. "items": {
  8331. "$ref": "#/components/schemas/Todo"
  8332. }
  8333. }
  8334. },
  8335. "required": ["sessionID", "todos"]
  8336. }
  8337. },
  8338. "required": ["type", "properties"]
  8339. },
  8340. "SessionStatus": {
  8341. "anyOf": [
  8342. {
  8343. "type": "object",
  8344. "properties": {
  8345. "type": {
  8346. "type": "string",
  8347. "const": "idle"
  8348. }
  8349. },
  8350. "required": ["type"]
  8351. },
  8352. {
  8353. "type": "object",
  8354. "properties": {
  8355. "type": {
  8356. "type": "string",
  8357. "const": "retry"
  8358. },
  8359. "attempt": {
  8360. "type": "number"
  8361. },
  8362. "message": {
  8363. "type": "string"
  8364. },
  8365. "next": {
  8366. "type": "number"
  8367. }
  8368. },
  8369. "required": ["type", "attempt", "message", "next"]
  8370. },
  8371. {
  8372. "type": "object",
  8373. "properties": {
  8374. "type": {
  8375. "type": "string",
  8376. "const": "busy"
  8377. }
  8378. },
  8379. "required": ["type"]
  8380. }
  8381. ]
  8382. },
  8383. "Event.session.status": {
  8384. "type": "object",
  8385. "properties": {
  8386. "type": {
  8387. "type": "string",
  8388. "const": "session.status"
  8389. },
  8390. "properties": {
  8391. "type": "object",
  8392. "properties": {
  8393. "sessionID": {
  8394. "type": "string",
  8395. "pattern": "^ses.*"
  8396. },
  8397. "status": {
  8398. "$ref": "#/components/schemas/SessionStatus"
  8399. }
  8400. },
  8401. "required": ["sessionID", "status"]
  8402. }
  8403. },
  8404. "required": ["type", "properties"]
  8405. },
  8406. "Event.session.idle": {
  8407. "type": "object",
  8408. "properties": {
  8409. "type": {
  8410. "type": "string",
  8411. "const": "session.idle"
  8412. },
  8413. "properties": {
  8414. "type": "object",
  8415. "properties": {
  8416. "sessionID": {
  8417. "type": "string",
  8418. "pattern": "^ses.*"
  8419. }
  8420. },
  8421. "required": ["sessionID"]
  8422. }
  8423. },
  8424. "required": ["type", "properties"]
  8425. },
  8426. "Event.session.compacted": {
  8427. "type": "object",
  8428. "properties": {
  8429. "type": {
  8430. "type": "string",
  8431. "const": "session.compacted"
  8432. },
  8433. "properties": {
  8434. "type": "object",
  8435. "properties": {
  8436. "sessionID": {
  8437. "type": "string",
  8438. "pattern": "^ses.*"
  8439. }
  8440. },
  8441. "required": ["sessionID"]
  8442. }
  8443. },
  8444. "required": ["type", "properties"]
  8445. },
  8446. "Event.tui.prompt.append": {
  8447. "type": "object",
  8448. "properties": {
  8449. "type": {
  8450. "type": "string",
  8451. "const": "tui.prompt.append"
  8452. },
  8453. "properties": {
  8454. "type": "object",
  8455. "properties": {
  8456. "text": {
  8457. "type": "string"
  8458. }
  8459. },
  8460. "required": ["text"]
  8461. }
  8462. },
  8463. "required": ["type", "properties"]
  8464. },
  8465. "Event.tui.command.execute": {
  8466. "type": "object",
  8467. "properties": {
  8468. "type": {
  8469. "type": "string",
  8470. "const": "tui.command.execute"
  8471. },
  8472. "properties": {
  8473. "type": "object",
  8474. "properties": {
  8475. "command": {
  8476. "anyOf": [
  8477. {
  8478. "type": "string",
  8479. "enum": [
  8480. "session.list",
  8481. "session.new",
  8482. "session.share",
  8483. "session.interrupt",
  8484. "session.compact",
  8485. "session.page.up",
  8486. "session.page.down",
  8487. "session.line.up",
  8488. "session.line.down",
  8489. "session.half.page.up",
  8490. "session.half.page.down",
  8491. "session.first",
  8492. "session.last",
  8493. "prompt.clear",
  8494. "prompt.submit",
  8495. "agent.cycle"
  8496. ]
  8497. },
  8498. {
  8499. "type": "string"
  8500. }
  8501. ]
  8502. }
  8503. },
  8504. "required": ["command"]
  8505. }
  8506. },
  8507. "required": ["type", "properties"]
  8508. },
  8509. "Event.tui.toast.show": {
  8510. "type": "object",
  8511. "properties": {
  8512. "type": {
  8513. "type": "string",
  8514. "const": "tui.toast.show"
  8515. },
  8516. "properties": {
  8517. "type": "object",
  8518. "properties": {
  8519. "title": {
  8520. "type": "string"
  8521. },
  8522. "message": {
  8523. "type": "string"
  8524. },
  8525. "variant": {
  8526. "type": "string",
  8527. "enum": ["info", "success", "warning", "error"]
  8528. },
  8529. "duration": {
  8530. "description": "Duration in milliseconds",
  8531. "default": 5000,
  8532. "type": "number"
  8533. }
  8534. },
  8535. "required": ["message", "variant"]
  8536. }
  8537. },
  8538. "required": ["type", "properties"]
  8539. },
  8540. "Event.tui.session.select": {
  8541. "type": "object",
  8542. "properties": {
  8543. "type": {
  8544. "type": "string",
  8545. "const": "tui.session.select"
  8546. },
  8547. "properties": {
  8548. "type": "object",
  8549. "properties": {
  8550. "sessionID": {
  8551. "description": "Session ID to navigate to",
  8552. "type": "string",
  8553. "pattern": "^ses.*"
  8554. }
  8555. },
  8556. "required": ["sessionID"]
  8557. }
  8558. },
  8559. "required": ["type", "properties"]
  8560. },
  8561. "Event.mcp.tools.changed": {
  8562. "type": "object",
  8563. "properties": {
  8564. "type": {
  8565. "type": "string",
  8566. "const": "mcp.tools.changed"
  8567. },
  8568. "properties": {
  8569. "type": "object",
  8570. "properties": {
  8571. "server": {
  8572. "type": "string"
  8573. }
  8574. },
  8575. "required": ["server"]
  8576. }
  8577. },
  8578. "required": ["type", "properties"]
  8579. },
  8580. "Event.mcp.browser.open.failed": {
  8581. "type": "object",
  8582. "properties": {
  8583. "type": {
  8584. "type": "string",
  8585. "const": "mcp.browser.open.failed"
  8586. },
  8587. "properties": {
  8588. "type": "object",
  8589. "properties": {
  8590. "mcpName": {
  8591. "type": "string"
  8592. },
  8593. "url": {
  8594. "type": "string"
  8595. }
  8596. },
  8597. "required": ["mcpName", "url"]
  8598. }
  8599. },
  8600. "required": ["type", "properties"]
  8601. },
  8602. "Event.command.executed": {
  8603. "type": "object",
  8604. "properties": {
  8605. "type": {
  8606. "type": "string",
  8607. "const": "command.executed"
  8608. },
  8609. "properties": {
  8610. "type": "object",
  8611. "properties": {
  8612. "name": {
  8613. "type": "string"
  8614. },
  8615. "sessionID": {
  8616. "type": "string",
  8617. "pattern": "^ses.*"
  8618. },
  8619. "arguments": {
  8620. "type": "string"
  8621. },
  8622. "messageID": {
  8623. "type": "string",
  8624. "pattern": "^msg.*"
  8625. }
  8626. },
  8627. "required": ["name", "sessionID", "arguments", "messageID"]
  8628. }
  8629. },
  8630. "required": ["type", "properties"]
  8631. },
  8632. "Event.vcs.branch.updated": {
  8633. "type": "object",
  8634. "properties": {
  8635. "type": {
  8636. "type": "string",
  8637. "const": "vcs.branch.updated"
  8638. },
  8639. "properties": {
  8640. "type": "object",
  8641. "properties": {
  8642. "branch": {
  8643. "type": "string"
  8644. }
  8645. }
  8646. }
  8647. },
  8648. "required": ["type", "properties"]
  8649. },
  8650. "Event.worktree.ready": {
  8651. "type": "object",
  8652. "properties": {
  8653. "type": {
  8654. "type": "string",
  8655. "const": "worktree.ready"
  8656. },
  8657. "properties": {
  8658. "type": "object",
  8659. "properties": {
  8660. "name": {
  8661. "type": "string"
  8662. },
  8663. "branch": {
  8664. "type": "string"
  8665. }
  8666. },
  8667. "required": ["name", "branch"]
  8668. }
  8669. },
  8670. "required": ["type", "properties"]
  8671. },
  8672. "Event.worktree.failed": {
  8673. "type": "object",
  8674. "properties": {
  8675. "type": {
  8676. "type": "string",
  8677. "const": "worktree.failed"
  8678. },
  8679. "properties": {
  8680. "type": "object",
  8681. "properties": {
  8682. "message": {
  8683. "type": "string"
  8684. }
  8685. },
  8686. "required": ["message"]
  8687. }
  8688. },
  8689. "required": ["type", "properties"]
  8690. },
  8691. "Pty": {
  8692. "type": "object",
  8693. "properties": {
  8694. "id": {
  8695. "type": "string",
  8696. "pattern": "^pty.*"
  8697. },
  8698. "title": {
  8699. "type": "string"
  8700. },
  8701. "command": {
  8702. "type": "string"
  8703. },
  8704. "args": {
  8705. "type": "array",
  8706. "items": {
  8707. "type": "string"
  8708. }
  8709. },
  8710. "cwd": {
  8711. "type": "string"
  8712. },
  8713. "status": {
  8714. "type": "string",
  8715. "enum": ["running", "exited"]
  8716. },
  8717. "pid": {
  8718. "type": "number"
  8719. }
  8720. },
  8721. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  8722. },
  8723. "Event.pty.created": {
  8724. "type": "object",
  8725. "properties": {
  8726. "type": {
  8727. "type": "string",
  8728. "const": "pty.created"
  8729. },
  8730. "properties": {
  8731. "type": "object",
  8732. "properties": {
  8733. "info": {
  8734. "$ref": "#/components/schemas/Pty"
  8735. }
  8736. },
  8737. "required": ["info"]
  8738. }
  8739. },
  8740. "required": ["type", "properties"]
  8741. },
  8742. "Event.pty.updated": {
  8743. "type": "object",
  8744. "properties": {
  8745. "type": {
  8746. "type": "string",
  8747. "const": "pty.updated"
  8748. },
  8749. "properties": {
  8750. "type": "object",
  8751. "properties": {
  8752. "info": {
  8753. "$ref": "#/components/schemas/Pty"
  8754. }
  8755. },
  8756. "required": ["info"]
  8757. }
  8758. },
  8759. "required": ["type", "properties"]
  8760. },
  8761. "Event.pty.exited": {
  8762. "type": "object",
  8763. "properties": {
  8764. "type": {
  8765. "type": "string",
  8766. "const": "pty.exited"
  8767. },
  8768. "properties": {
  8769. "type": "object",
  8770. "properties": {
  8771. "id": {
  8772. "type": "string",
  8773. "pattern": "^pty.*"
  8774. },
  8775. "exitCode": {
  8776. "type": "number"
  8777. }
  8778. },
  8779. "required": ["id", "exitCode"]
  8780. }
  8781. },
  8782. "required": ["type", "properties"]
  8783. },
  8784. "Event.pty.deleted": {
  8785. "type": "object",
  8786. "properties": {
  8787. "type": {
  8788. "type": "string",
  8789. "const": "pty.deleted"
  8790. },
  8791. "properties": {
  8792. "type": "object",
  8793. "properties": {
  8794. "id": {
  8795. "type": "string",
  8796. "pattern": "^pty.*"
  8797. }
  8798. },
  8799. "required": ["id"]
  8800. }
  8801. },
  8802. "required": ["type", "properties"]
  8803. },
  8804. "Event.workspace.ready": {
  8805. "type": "object",
  8806. "properties": {
  8807. "type": {
  8808. "type": "string",
  8809. "const": "workspace.ready"
  8810. },
  8811. "properties": {
  8812. "type": "object",
  8813. "properties": {
  8814. "name": {
  8815. "type": "string"
  8816. }
  8817. },
  8818. "required": ["name"]
  8819. }
  8820. },
  8821. "required": ["type", "properties"]
  8822. },
  8823. "Event.workspace.failed": {
  8824. "type": "object",
  8825. "properties": {
  8826. "type": {
  8827. "type": "string",
  8828. "const": "workspace.failed"
  8829. },
  8830. "properties": {
  8831. "type": "object",
  8832. "properties": {
  8833. "message": {
  8834. "type": "string"
  8835. }
  8836. },
  8837. "required": ["message"]
  8838. }
  8839. },
  8840. "required": ["type", "properties"]
  8841. },
  8842. "Event.workspace.restore": {
  8843. "type": "object",
  8844. "properties": {
  8845. "type": {
  8846. "type": "string",
  8847. "const": "workspace.restore"
  8848. },
  8849. "properties": {
  8850. "type": "object",
  8851. "properties": {
  8852. "workspaceID": {
  8853. "type": "string",
  8854. "pattern": "^wrk.*"
  8855. },
  8856. "sessionID": {
  8857. "type": "string",
  8858. "pattern": "^ses.*"
  8859. },
  8860. "total": {
  8861. "type": "integer",
  8862. "minimum": 0,
  8863. "maximum": 9007199254740991
  8864. },
  8865. "step": {
  8866. "type": "integer",
  8867. "minimum": 0,
  8868. "maximum": 9007199254740991
  8869. }
  8870. },
  8871. "required": ["workspaceID", "sessionID", "total", "step"]
  8872. }
  8873. },
  8874. "required": ["type", "properties"]
  8875. },
  8876. "Event.workspace.status": {
  8877. "type": "object",
  8878. "properties": {
  8879. "type": {
  8880. "type": "string",
  8881. "const": "workspace.status"
  8882. },
  8883. "properties": {
  8884. "type": "object",
  8885. "properties": {
  8886. "workspaceID": {
  8887. "type": "string",
  8888. "pattern": "^wrk.*"
  8889. },
  8890. "status": {
  8891. "type": "string",
  8892. "enum": ["connected", "connecting", "disconnected", "error"]
  8893. }
  8894. },
  8895. "required": ["workspaceID", "status"]
  8896. }
  8897. },
  8898. "required": ["type", "properties"]
  8899. },
  8900. "OutputFormatText": {
  8901. "type": "object",
  8902. "properties": {
  8903. "type": {
  8904. "type": "string",
  8905. "const": "text"
  8906. }
  8907. },
  8908. "required": ["type"]
  8909. },
  8910. "JSONSchema": {
  8911. "type": "object",
  8912. "propertyNames": {
  8913. "type": "string"
  8914. },
  8915. "additionalProperties": {}
  8916. },
  8917. "OutputFormatJsonSchema": {
  8918. "type": "object",
  8919. "properties": {
  8920. "type": {
  8921. "type": "string",
  8922. "const": "json_schema"
  8923. },
  8924. "schema": {
  8925. "$ref": "#/components/schemas/JSONSchema"
  8926. },
  8927. "retryCount": {
  8928. "default": 2,
  8929. "type": "integer",
  8930. "minimum": 0,
  8931. "maximum": 9007199254740991
  8932. }
  8933. },
  8934. "required": ["type", "schema"]
  8935. },
  8936. "OutputFormat": {
  8937. "anyOf": [
  8938. {
  8939. "$ref": "#/components/schemas/OutputFormatText"
  8940. },
  8941. {
  8942. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  8943. }
  8944. ]
  8945. },
  8946. "UserMessage": {
  8947. "type": "object",
  8948. "properties": {
  8949. "id": {
  8950. "type": "string",
  8951. "pattern": "^msg.*"
  8952. },
  8953. "sessionID": {
  8954. "type": "string",
  8955. "pattern": "^ses.*"
  8956. },
  8957. "role": {
  8958. "type": "string",
  8959. "const": "user"
  8960. },
  8961. "time": {
  8962. "type": "object",
  8963. "properties": {
  8964. "created": {
  8965. "type": "number"
  8966. }
  8967. },
  8968. "required": ["created"]
  8969. },
  8970. "format": {
  8971. "$ref": "#/components/schemas/OutputFormat"
  8972. },
  8973. "summary": {
  8974. "type": "object",
  8975. "properties": {
  8976. "title": {
  8977. "type": "string"
  8978. },
  8979. "body": {
  8980. "type": "string"
  8981. },
  8982. "diffs": {
  8983. "type": "array",
  8984. "items": {
  8985. "$ref": "#/components/schemas/SnapshotFileDiff"
  8986. }
  8987. }
  8988. },
  8989. "required": ["diffs"]
  8990. },
  8991. "agent": {
  8992. "type": "string"
  8993. },
  8994. "model": {
  8995. "type": "object",
  8996. "properties": {
  8997. "providerID": {
  8998. "type": "string"
  8999. },
  9000. "modelID": {
  9001. "type": "string"
  9002. },
  9003. "variant": {
  9004. "type": "string"
  9005. }
  9006. },
  9007. "required": ["providerID", "modelID"]
  9008. },
  9009. "system": {
  9010. "type": "string"
  9011. },
  9012. "tools": {
  9013. "type": "object",
  9014. "propertyNames": {
  9015. "type": "string"
  9016. },
  9017. "additionalProperties": {
  9018. "type": "boolean"
  9019. }
  9020. }
  9021. },
  9022. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  9023. },
  9024. "AssistantMessage": {
  9025. "type": "object",
  9026. "properties": {
  9027. "id": {
  9028. "type": "string",
  9029. "pattern": "^msg.*"
  9030. },
  9031. "sessionID": {
  9032. "type": "string",
  9033. "pattern": "^ses.*"
  9034. },
  9035. "role": {
  9036. "type": "string",
  9037. "const": "assistant"
  9038. },
  9039. "time": {
  9040. "type": "object",
  9041. "properties": {
  9042. "created": {
  9043. "type": "number"
  9044. },
  9045. "completed": {
  9046. "type": "number"
  9047. }
  9048. },
  9049. "required": ["created"]
  9050. },
  9051. "error": {
  9052. "anyOf": [
  9053. {
  9054. "$ref": "#/components/schemas/ProviderAuthError"
  9055. },
  9056. {
  9057. "$ref": "#/components/schemas/UnknownError"
  9058. },
  9059. {
  9060. "$ref": "#/components/schemas/MessageOutputLengthError"
  9061. },
  9062. {
  9063. "$ref": "#/components/schemas/MessageAbortedError"
  9064. },
  9065. {
  9066. "$ref": "#/components/schemas/StructuredOutputError"
  9067. },
  9068. {
  9069. "$ref": "#/components/schemas/ContextOverflowError"
  9070. },
  9071. {
  9072. "$ref": "#/components/schemas/APIError"
  9073. }
  9074. ]
  9075. },
  9076. "parentID": {
  9077. "type": "string",
  9078. "pattern": "^msg.*"
  9079. },
  9080. "modelID": {
  9081. "type": "string"
  9082. },
  9083. "providerID": {
  9084. "type": "string"
  9085. },
  9086. "mode": {
  9087. "type": "string"
  9088. },
  9089. "agent": {
  9090. "type": "string"
  9091. },
  9092. "path": {
  9093. "type": "object",
  9094. "properties": {
  9095. "cwd": {
  9096. "type": "string"
  9097. },
  9098. "root": {
  9099. "type": "string"
  9100. }
  9101. },
  9102. "required": ["cwd", "root"]
  9103. },
  9104. "summary": {
  9105. "type": "boolean"
  9106. },
  9107. "cost": {
  9108. "type": "number"
  9109. },
  9110. "tokens": {
  9111. "type": "object",
  9112. "properties": {
  9113. "total": {
  9114. "type": "number"
  9115. },
  9116. "input": {
  9117. "type": "number"
  9118. },
  9119. "output": {
  9120. "type": "number"
  9121. },
  9122. "reasoning": {
  9123. "type": "number"
  9124. },
  9125. "cache": {
  9126. "type": "object",
  9127. "properties": {
  9128. "read": {
  9129. "type": "number"
  9130. },
  9131. "write": {
  9132. "type": "number"
  9133. }
  9134. },
  9135. "required": ["read", "write"]
  9136. }
  9137. },
  9138. "required": ["input", "output", "reasoning", "cache"]
  9139. },
  9140. "structured": {},
  9141. "variant": {
  9142. "type": "string"
  9143. },
  9144. "finish": {
  9145. "type": "string"
  9146. }
  9147. },
  9148. "required": [
  9149. "id",
  9150. "sessionID",
  9151. "role",
  9152. "time",
  9153. "parentID",
  9154. "modelID",
  9155. "providerID",
  9156. "mode",
  9157. "agent",
  9158. "path",
  9159. "cost",
  9160. "tokens"
  9161. ]
  9162. },
  9163. "Message": {
  9164. "anyOf": [
  9165. {
  9166. "$ref": "#/components/schemas/UserMessage"
  9167. },
  9168. {
  9169. "$ref": "#/components/schemas/AssistantMessage"
  9170. }
  9171. ]
  9172. },
  9173. "Event.message.updated": {
  9174. "type": "object",
  9175. "properties": {
  9176. "type": {
  9177. "type": "string",
  9178. "const": "message.updated"
  9179. },
  9180. "properties": {
  9181. "type": "object",
  9182. "properties": {
  9183. "sessionID": {
  9184. "type": "string",
  9185. "pattern": "^ses.*"
  9186. },
  9187. "info": {
  9188. "$ref": "#/components/schemas/Message"
  9189. }
  9190. },
  9191. "required": ["sessionID", "info"]
  9192. }
  9193. },
  9194. "required": ["type", "properties"]
  9195. },
  9196. "Event.message.removed": {
  9197. "type": "object",
  9198. "properties": {
  9199. "type": {
  9200. "type": "string",
  9201. "const": "message.removed"
  9202. },
  9203. "properties": {
  9204. "type": "object",
  9205. "properties": {
  9206. "sessionID": {
  9207. "type": "string",
  9208. "pattern": "^ses.*"
  9209. },
  9210. "messageID": {
  9211. "type": "string",
  9212. "pattern": "^msg.*"
  9213. }
  9214. },
  9215. "required": ["sessionID", "messageID"]
  9216. }
  9217. },
  9218. "required": ["type", "properties"]
  9219. },
  9220. "TextPart": {
  9221. "type": "object",
  9222. "properties": {
  9223. "id": {
  9224. "type": "string",
  9225. "pattern": "^prt.*"
  9226. },
  9227. "sessionID": {
  9228. "type": "string",
  9229. "pattern": "^ses.*"
  9230. },
  9231. "messageID": {
  9232. "type": "string",
  9233. "pattern": "^msg.*"
  9234. },
  9235. "type": {
  9236. "type": "string",
  9237. "const": "text"
  9238. },
  9239. "text": {
  9240. "type": "string"
  9241. },
  9242. "synthetic": {
  9243. "type": "boolean"
  9244. },
  9245. "ignored": {
  9246. "type": "boolean"
  9247. },
  9248. "time": {
  9249. "type": "object",
  9250. "properties": {
  9251. "start": {
  9252. "type": "number"
  9253. },
  9254. "end": {
  9255. "type": "number"
  9256. }
  9257. },
  9258. "required": ["start"]
  9259. },
  9260. "metadata": {
  9261. "type": "object",
  9262. "propertyNames": {
  9263. "type": "string"
  9264. },
  9265. "additionalProperties": {}
  9266. }
  9267. },
  9268. "required": ["id", "sessionID", "messageID", "type", "text"]
  9269. },
  9270. "SubtaskPart": {
  9271. "type": "object",
  9272. "properties": {
  9273. "id": {
  9274. "type": "string",
  9275. "pattern": "^prt.*"
  9276. },
  9277. "sessionID": {
  9278. "type": "string",
  9279. "pattern": "^ses.*"
  9280. },
  9281. "messageID": {
  9282. "type": "string",
  9283. "pattern": "^msg.*"
  9284. },
  9285. "type": {
  9286. "type": "string",
  9287. "const": "subtask"
  9288. },
  9289. "prompt": {
  9290. "type": "string"
  9291. },
  9292. "description": {
  9293. "type": "string"
  9294. },
  9295. "agent": {
  9296. "type": "string"
  9297. },
  9298. "model": {
  9299. "type": "object",
  9300. "properties": {
  9301. "providerID": {
  9302. "type": "string"
  9303. },
  9304. "modelID": {
  9305. "type": "string"
  9306. }
  9307. },
  9308. "required": ["providerID", "modelID"]
  9309. },
  9310. "command": {
  9311. "type": "string"
  9312. }
  9313. },
  9314. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  9315. },
  9316. "ReasoningPart": {
  9317. "type": "object",
  9318. "properties": {
  9319. "id": {
  9320. "type": "string",
  9321. "pattern": "^prt.*"
  9322. },
  9323. "sessionID": {
  9324. "type": "string",
  9325. "pattern": "^ses.*"
  9326. },
  9327. "messageID": {
  9328. "type": "string",
  9329. "pattern": "^msg.*"
  9330. },
  9331. "type": {
  9332. "type": "string",
  9333. "const": "reasoning"
  9334. },
  9335. "text": {
  9336. "type": "string"
  9337. },
  9338. "metadata": {
  9339. "type": "object",
  9340. "propertyNames": {
  9341. "type": "string"
  9342. },
  9343. "additionalProperties": {}
  9344. },
  9345. "time": {
  9346. "type": "object",
  9347. "properties": {
  9348. "start": {
  9349. "type": "number"
  9350. },
  9351. "end": {
  9352. "type": "number"
  9353. }
  9354. },
  9355. "required": ["start"]
  9356. }
  9357. },
  9358. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  9359. },
  9360. "FilePartSourceText": {
  9361. "type": "object",
  9362. "properties": {
  9363. "value": {
  9364. "type": "string"
  9365. },
  9366. "start": {
  9367. "type": "integer",
  9368. "minimum": -9007199254740991,
  9369. "maximum": 9007199254740991
  9370. },
  9371. "end": {
  9372. "type": "integer",
  9373. "minimum": -9007199254740991,
  9374. "maximum": 9007199254740991
  9375. }
  9376. },
  9377. "required": ["value", "start", "end"]
  9378. },
  9379. "FileSource": {
  9380. "type": "object",
  9381. "properties": {
  9382. "text": {
  9383. "$ref": "#/components/schemas/FilePartSourceText"
  9384. },
  9385. "type": {
  9386. "type": "string",
  9387. "const": "file"
  9388. },
  9389. "path": {
  9390. "type": "string"
  9391. }
  9392. },
  9393. "required": ["text", "type", "path"]
  9394. },
  9395. "Range": {
  9396. "type": "object",
  9397. "properties": {
  9398. "start": {
  9399. "type": "object",
  9400. "properties": {
  9401. "line": {
  9402. "type": "number"
  9403. },
  9404. "character": {
  9405. "type": "number"
  9406. }
  9407. },
  9408. "required": ["line", "character"]
  9409. },
  9410. "end": {
  9411. "type": "object",
  9412. "properties": {
  9413. "line": {
  9414. "type": "number"
  9415. },
  9416. "character": {
  9417. "type": "number"
  9418. }
  9419. },
  9420. "required": ["line", "character"]
  9421. }
  9422. },
  9423. "required": ["start", "end"]
  9424. },
  9425. "SymbolSource": {
  9426. "type": "object",
  9427. "properties": {
  9428. "text": {
  9429. "$ref": "#/components/schemas/FilePartSourceText"
  9430. },
  9431. "type": {
  9432. "type": "string",
  9433. "const": "symbol"
  9434. },
  9435. "path": {
  9436. "type": "string"
  9437. },
  9438. "range": {
  9439. "$ref": "#/components/schemas/Range"
  9440. },
  9441. "name": {
  9442. "type": "string"
  9443. },
  9444. "kind": {
  9445. "type": "integer",
  9446. "minimum": -9007199254740991,
  9447. "maximum": 9007199254740991
  9448. }
  9449. },
  9450. "required": ["text", "type", "path", "range", "name", "kind"]
  9451. },
  9452. "ResourceSource": {
  9453. "type": "object",
  9454. "properties": {
  9455. "text": {
  9456. "$ref": "#/components/schemas/FilePartSourceText"
  9457. },
  9458. "type": {
  9459. "type": "string",
  9460. "const": "resource"
  9461. },
  9462. "clientName": {
  9463. "type": "string"
  9464. },
  9465. "uri": {
  9466. "type": "string"
  9467. }
  9468. },
  9469. "required": ["text", "type", "clientName", "uri"]
  9470. },
  9471. "FilePartSource": {
  9472. "anyOf": [
  9473. {
  9474. "$ref": "#/components/schemas/FileSource"
  9475. },
  9476. {
  9477. "$ref": "#/components/schemas/SymbolSource"
  9478. },
  9479. {
  9480. "$ref": "#/components/schemas/ResourceSource"
  9481. }
  9482. ]
  9483. },
  9484. "FilePart": {
  9485. "type": "object",
  9486. "properties": {
  9487. "id": {
  9488. "type": "string",
  9489. "pattern": "^prt.*"
  9490. },
  9491. "sessionID": {
  9492. "type": "string",
  9493. "pattern": "^ses.*"
  9494. },
  9495. "messageID": {
  9496. "type": "string",
  9497. "pattern": "^msg.*"
  9498. },
  9499. "type": {
  9500. "type": "string",
  9501. "const": "file"
  9502. },
  9503. "mime": {
  9504. "type": "string"
  9505. },
  9506. "filename": {
  9507. "type": "string"
  9508. },
  9509. "url": {
  9510. "type": "string"
  9511. },
  9512. "source": {
  9513. "$ref": "#/components/schemas/FilePartSource"
  9514. }
  9515. },
  9516. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  9517. },
  9518. "ToolStatePending": {
  9519. "type": "object",
  9520. "properties": {
  9521. "status": {
  9522. "type": "string",
  9523. "const": "pending"
  9524. },
  9525. "input": {
  9526. "type": "object",
  9527. "propertyNames": {
  9528. "type": "string"
  9529. },
  9530. "additionalProperties": {}
  9531. },
  9532. "raw": {
  9533. "type": "string"
  9534. }
  9535. },
  9536. "required": ["status", "input", "raw"]
  9537. },
  9538. "ToolStateRunning": {
  9539. "type": "object",
  9540. "properties": {
  9541. "status": {
  9542. "type": "string",
  9543. "const": "running"
  9544. },
  9545. "input": {
  9546. "type": "object",
  9547. "propertyNames": {
  9548. "type": "string"
  9549. },
  9550. "additionalProperties": {}
  9551. },
  9552. "title": {
  9553. "type": "string"
  9554. },
  9555. "metadata": {
  9556. "type": "object",
  9557. "propertyNames": {
  9558. "type": "string"
  9559. },
  9560. "additionalProperties": {}
  9561. },
  9562. "time": {
  9563. "type": "object",
  9564. "properties": {
  9565. "start": {
  9566. "type": "number"
  9567. }
  9568. },
  9569. "required": ["start"]
  9570. }
  9571. },
  9572. "required": ["status", "input", "time"]
  9573. },
  9574. "ToolStateCompleted": {
  9575. "type": "object",
  9576. "properties": {
  9577. "status": {
  9578. "type": "string",
  9579. "const": "completed"
  9580. },
  9581. "input": {
  9582. "type": "object",
  9583. "propertyNames": {
  9584. "type": "string"
  9585. },
  9586. "additionalProperties": {}
  9587. },
  9588. "output": {
  9589. "type": "string"
  9590. },
  9591. "title": {
  9592. "type": "string"
  9593. },
  9594. "metadata": {
  9595. "type": "object",
  9596. "propertyNames": {
  9597. "type": "string"
  9598. },
  9599. "additionalProperties": {}
  9600. },
  9601. "time": {
  9602. "type": "object",
  9603. "properties": {
  9604. "start": {
  9605. "type": "number"
  9606. },
  9607. "end": {
  9608. "type": "number"
  9609. },
  9610. "compacted": {
  9611. "type": "number"
  9612. }
  9613. },
  9614. "required": ["start", "end"]
  9615. },
  9616. "attachments": {
  9617. "type": "array",
  9618. "items": {
  9619. "$ref": "#/components/schemas/FilePart"
  9620. }
  9621. }
  9622. },
  9623. "required": ["status", "input", "output", "title", "metadata", "time"]
  9624. },
  9625. "ToolStateError": {
  9626. "type": "object",
  9627. "properties": {
  9628. "status": {
  9629. "type": "string",
  9630. "const": "error"
  9631. },
  9632. "input": {
  9633. "type": "object",
  9634. "propertyNames": {
  9635. "type": "string"
  9636. },
  9637. "additionalProperties": {}
  9638. },
  9639. "error": {
  9640. "type": "string"
  9641. },
  9642. "metadata": {
  9643. "type": "object",
  9644. "propertyNames": {
  9645. "type": "string"
  9646. },
  9647. "additionalProperties": {}
  9648. },
  9649. "time": {
  9650. "type": "object",
  9651. "properties": {
  9652. "start": {
  9653. "type": "number"
  9654. },
  9655. "end": {
  9656. "type": "number"
  9657. }
  9658. },
  9659. "required": ["start", "end"]
  9660. }
  9661. },
  9662. "required": ["status", "input", "error", "time"]
  9663. },
  9664. "ToolState": {
  9665. "anyOf": [
  9666. {
  9667. "$ref": "#/components/schemas/ToolStatePending"
  9668. },
  9669. {
  9670. "$ref": "#/components/schemas/ToolStateRunning"
  9671. },
  9672. {
  9673. "$ref": "#/components/schemas/ToolStateCompleted"
  9674. },
  9675. {
  9676. "$ref": "#/components/schemas/ToolStateError"
  9677. }
  9678. ]
  9679. },
  9680. "ToolPart": {
  9681. "type": "object",
  9682. "properties": {
  9683. "id": {
  9684. "type": "string",
  9685. "pattern": "^prt.*"
  9686. },
  9687. "sessionID": {
  9688. "type": "string",
  9689. "pattern": "^ses.*"
  9690. },
  9691. "messageID": {
  9692. "type": "string",
  9693. "pattern": "^msg.*"
  9694. },
  9695. "type": {
  9696. "type": "string",
  9697. "const": "tool"
  9698. },
  9699. "callID": {
  9700. "type": "string"
  9701. },
  9702. "tool": {
  9703. "type": "string"
  9704. },
  9705. "state": {
  9706. "$ref": "#/components/schemas/ToolState"
  9707. },
  9708. "metadata": {
  9709. "type": "object",
  9710. "propertyNames": {
  9711. "type": "string"
  9712. },
  9713. "additionalProperties": {}
  9714. }
  9715. },
  9716. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  9717. },
  9718. "StepStartPart": {
  9719. "type": "object",
  9720. "properties": {
  9721. "id": {
  9722. "type": "string",
  9723. "pattern": "^prt.*"
  9724. },
  9725. "sessionID": {
  9726. "type": "string",
  9727. "pattern": "^ses.*"
  9728. },
  9729. "messageID": {
  9730. "type": "string",
  9731. "pattern": "^msg.*"
  9732. },
  9733. "type": {
  9734. "type": "string",
  9735. "const": "step-start"
  9736. },
  9737. "snapshot": {
  9738. "type": "string"
  9739. }
  9740. },
  9741. "required": ["id", "sessionID", "messageID", "type"]
  9742. },
  9743. "StepFinishPart": {
  9744. "type": "object",
  9745. "properties": {
  9746. "id": {
  9747. "type": "string",
  9748. "pattern": "^prt.*"
  9749. },
  9750. "sessionID": {
  9751. "type": "string",
  9752. "pattern": "^ses.*"
  9753. },
  9754. "messageID": {
  9755. "type": "string",
  9756. "pattern": "^msg.*"
  9757. },
  9758. "type": {
  9759. "type": "string",
  9760. "const": "step-finish"
  9761. },
  9762. "reason": {
  9763. "type": "string"
  9764. },
  9765. "snapshot": {
  9766. "type": "string"
  9767. },
  9768. "cost": {
  9769. "type": "number"
  9770. },
  9771. "tokens": {
  9772. "type": "object",
  9773. "properties": {
  9774. "total": {
  9775. "type": "number"
  9776. },
  9777. "input": {
  9778. "type": "number"
  9779. },
  9780. "output": {
  9781. "type": "number"
  9782. },
  9783. "reasoning": {
  9784. "type": "number"
  9785. },
  9786. "cache": {
  9787. "type": "object",
  9788. "properties": {
  9789. "read": {
  9790. "type": "number"
  9791. },
  9792. "write": {
  9793. "type": "number"
  9794. }
  9795. },
  9796. "required": ["read", "write"]
  9797. }
  9798. },
  9799. "required": ["input", "output", "reasoning", "cache"]
  9800. }
  9801. },
  9802. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  9803. },
  9804. "SnapshotPart": {
  9805. "type": "object",
  9806. "properties": {
  9807. "id": {
  9808. "type": "string",
  9809. "pattern": "^prt.*"
  9810. },
  9811. "sessionID": {
  9812. "type": "string",
  9813. "pattern": "^ses.*"
  9814. },
  9815. "messageID": {
  9816. "type": "string",
  9817. "pattern": "^msg.*"
  9818. },
  9819. "type": {
  9820. "type": "string",
  9821. "const": "snapshot"
  9822. },
  9823. "snapshot": {
  9824. "type": "string"
  9825. }
  9826. },
  9827. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  9828. },
  9829. "PatchPart": {
  9830. "type": "object",
  9831. "properties": {
  9832. "id": {
  9833. "type": "string",
  9834. "pattern": "^prt.*"
  9835. },
  9836. "sessionID": {
  9837. "type": "string",
  9838. "pattern": "^ses.*"
  9839. },
  9840. "messageID": {
  9841. "type": "string",
  9842. "pattern": "^msg.*"
  9843. },
  9844. "type": {
  9845. "type": "string",
  9846. "const": "patch"
  9847. },
  9848. "hash": {
  9849. "type": "string"
  9850. },
  9851. "files": {
  9852. "type": "array",
  9853. "items": {
  9854. "type": "string"
  9855. }
  9856. }
  9857. },
  9858. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  9859. },
  9860. "AgentPart": {
  9861. "type": "object",
  9862. "properties": {
  9863. "id": {
  9864. "type": "string",
  9865. "pattern": "^prt.*"
  9866. },
  9867. "sessionID": {
  9868. "type": "string",
  9869. "pattern": "^ses.*"
  9870. },
  9871. "messageID": {
  9872. "type": "string",
  9873. "pattern": "^msg.*"
  9874. },
  9875. "type": {
  9876. "type": "string",
  9877. "const": "agent"
  9878. },
  9879. "name": {
  9880. "type": "string"
  9881. },
  9882. "source": {
  9883. "type": "object",
  9884. "properties": {
  9885. "value": {
  9886. "type": "string"
  9887. },
  9888. "start": {
  9889. "type": "integer",
  9890. "minimum": -9007199254740991,
  9891. "maximum": 9007199254740991
  9892. },
  9893. "end": {
  9894. "type": "integer",
  9895. "minimum": -9007199254740991,
  9896. "maximum": 9007199254740991
  9897. }
  9898. },
  9899. "required": ["value", "start", "end"]
  9900. }
  9901. },
  9902. "required": ["id", "sessionID", "messageID", "type", "name"]
  9903. },
  9904. "RetryPart": {
  9905. "type": "object",
  9906. "properties": {
  9907. "id": {
  9908. "type": "string",
  9909. "pattern": "^prt.*"
  9910. },
  9911. "sessionID": {
  9912. "type": "string",
  9913. "pattern": "^ses.*"
  9914. },
  9915. "messageID": {
  9916. "type": "string",
  9917. "pattern": "^msg.*"
  9918. },
  9919. "type": {
  9920. "type": "string",
  9921. "const": "retry"
  9922. },
  9923. "attempt": {
  9924. "type": "number"
  9925. },
  9926. "error": {
  9927. "$ref": "#/components/schemas/APIError"
  9928. },
  9929. "time": {
  9930. "type": "object",
  9931. "properties": {
  9932. "created": {
  9933. "type": "number"
  9934. }
  9935. },
  9936. "required": ["created"]
  9937. }
  9938. },
  9939. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  9940. },
  9941. "CompactionPart": {
  9942. "type": "object",
  9943. "properties": {
  9944. "id": {
  9945. "type": "string",
  9946. "pattern": "^prt.*"
  9947. },
  9948. "sessionID": {
  9949. "type": "string",
  9950. "pattern": "^ses.*"
  9951. },
  9952. "messageID": {
  9953. "type": "string",
  9954. "pattern": "^msg.*"
  9955. },
  9956. "type": {
  9957. "type": "string",
  9958. "const": "compaction"
  9959. },
  9960. "auto": {
  9961. "type": "boolean"
  9962. },
  9963. "overflow": {
  9964. "type": "boolean"
  9965. }
  9966. },
  9967. "required": ["id", "sessionID", "messageID", "type", "auto"]
  9968. },
  9969. "Part": {
  9970. "anyOf": [
  9971. {
  9972. "$ref": "#/components/schemas/TextPart"
  9973. },
  9974. {
  9975. "$ref": "#/components/schemas/SubtaskPart"
  9976. },
  9977. {
  9978. "$ref": "#/components/schemas/ReasoningPart"
  9979. },
  9980. {
  9981. "$ref": "#/components/schemas/FilePart"
  9982. },
  9983. {
  9984. "$ref": "#/components/schemas/ToolPart"
  9985. },
  9986. {
  9987. "$ref": "#/components/schemas/StepStartPart"
  9988. },
  9989. {
  9990. "$ref": "#/components/schemas/StepFinishPart"
  9991. },
  9992. {
  9993. "$ref": "#/components/schemas/SnapshotPart"
  9994. },
  9995. {
  9996. "$ref": "#/components/schemas/PatchPart"
  9997. },
  9998. {
  9999. "$ref": "#/components/schemas/AgentPart"
  10000. },
  10001. {
  10002. "$ref": "#/components/schemas/RetryPart"
  10003. },
  10004. {
  10005. "$ref": "#/components/schemas/CompactionPart"
  10006. }
  10007. ]
  10008. },
  10009. "Event.message.part.updated": {
  10010. "type": "object",
  10011. "properties": {
  10012. "type": {
  10013. "type": "string",
  10014. "const": "message.part.updated"
  10015. },
  10016. "properties": {
  10017. "type": "object",
  10018. "properties": {
  10019. "sessionID": {
  10020. "type": "string",
  10021. "pattern": "^ses.*"
  10022. },
  10023. "part": {
  10024. "$ref": "#/components/schemas/Part"
  10025. },
  10026. "time": {
  10027. "type": "number"
  10028. }
  10029. },
  10030. "required": ["sessionID", "part", "time"]
  10031. }
  10032. },
  10033. "required": ["type", "properties"]
  10034. },
  10035. "Event.message.part.removed": {
  10036. "type": "object",
  10037. "properties": {
  10038. "type": {
  10039. "type": "string",
  10040. "const": "message.part.removed"
  10041. },
  10042. "properties": {
  10043. "type": "object",
  10044. "properties": {
  10045. "sessionID": {
  10046. "type": "string",
  10047. "pattern": "^ses.*"
  10048. },
  10049. "messageID": {
  10050. "type": "string",
  10051. "pattern": "^msg.*"
  10052. },
  10053. "partID": {
  10054. "type": "string",
  10055. "pattern": "^prt.*"
  10056. }
  10057. },
  10058. "required": ["sessionID", "messageID", "partID"]
  10059. }
  10060. },
  10061. "required": ["type", "properties"]
  10062. },
  10063. "PermissionAction": {
  10064. "type": "string",
  10065. "enum": ["allow", "deny", "ask"]
  10066. },
  10067. "PermissionRule": {
  10068. "type": "object",
  10069. "properties": {
  10070. "permission": {
  10071. "type": "string"
  10072. },
  10073. "pattern": {
  10074. "type": "string"
  10075. },
  10076. "action": {
  10077. "$ref": "#/components/schemas/PermissionAction"
  10078. }
  10079. },
  10080. "required": ["permission", "pattern", "action"]
  10081. },
  10082. "PermissionRuleset": {
  10083. "type": "array",
  10084. "items": {
  10085. "$ref": "#/components/schemas/PermissionRule"
  10086. }
  10087. },
  10088. "Session": {
  10089. "type": "object",
  10090. "properties": {
  10091. "id": {
  10092. "type": "string",
  10093. "pattern": "^ses.*"
  10094. },
  10095. "slug": {
  10096. "type": "string"
  10097. },
  10098. "projectID": {
  10099. "type": "string"
  10100. },
  10101. "workspaceID": {
  10102. "type": "string",
  10103. "pattern": "^wrk.*"
  10104. },
  10105. "directory": {
  10106. "type": "string"
  10107. },
  10108. "parentID": {
  10109. "type": "string",
  10110. "pattern": "^ses.*"
  10111. },
  10112. "summary": {
  10113. "type": "object",
  10114. "properties": {
  10115. "additions": {
  10116. "type": "number"
  10117. },
  10118. "deletions": {
  10119. "type": "number"
  10120. },
  10121. "files": {
  10122. "type": "number"
  10123. },
  10124. "diffs": {
  10125. "type": "array",
  10126. "items": {
  10127. "$ref": "#/components/schemas/SnapshotFileDiff"
  10128. }
  10129. }
  10130. },
  10131. "required": ["additions", "deletions", "files"]
  10132. },
  10133. "share": {
  10134. "type": "object",
  10135. "properties": {
  10136. "url": {
  10137. "type": "string"
  10138. }
  10139. },
  10140. "required": ["url"]
  10141. },
  10142. "title": {
  10143. "type": "string"
  10144. },
  10145. "version": {
  10146. "type": "string"
  10147. },
  10148. "time": {
  10149. "type": "object",
  10150. "properties": {
  10151. "created": {
  10152. "type": "number"
  10153. },
  10154. "updated": {
  10155. "type": "number"
  10156. },
  10157. "compacting": {
  10158. "type": "number"
  10159. },
  10160. "archived": {
  10161. "type": "number"
  10162. }
  10163. },
  10164. "required": ["created", "updated"]
  10165. },
  10166. "permission": {
  10167. "$ref": "#/components/schemas/PermissionRuleset"
  10168. },
  10169. "revert": {
  10170. "type": "object",
  10171. "properties": {
  10172. "messageID": {
  10173. "type": "string",
  10174. "pattern": "^msg.*"
  10175. },
  10176. "partID": {
  10177. "type": "string",
  10178. "pattern": "^prt.*"
  10179. },
  10180. "snapshot": {
  10181. "type": "string"
  10182. },
  10183. "diff": {
  10184. "type": "string"
  10185. }
  10186. },
  10187. "required": ["messageID"]
  10188. }
  10189. },
  10190. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  10191. },
  10192. "Event.session.created": {
  10193. "type": "object",
  10194. "properties": {
  10195. "type": {
  10196. "type": "string",
  10197. "const": "session.created"
  10198. },
  10199. "properties": {
  10200. "type": "object",
  10201. "properties": {
  10202. "sessionID": {
  10203. "type": "string",
  10204. "pattern": "^ses.*"
  10205. },
  10206. "info": {
  10207. "$ref": "#/components/schemas/Session"
  10208. }
  10209. },
  10210. "required": ["sessionID", "info"]
  10211. }
  10212. },
  10213. "required": ["type", "properties"]
  10214. },
  10215. "Event.session.updated": {
  10216. "type": "object",
  10217. "properties": {
  10218. "type": {
  10219. "type": "string",
  10220. "const": "session.updated"
  10221. },
  10222. "properties": {
  10223. "type": "object",
  10224. "properties": {
  10225. "sessionID": {
  10226. "type": "string",
  10227. "pattern": "^ses.*"
  10228. },
  10229. "info": {
  10230. "$ref": "#/components/schemas/Session"
  10231. }
  10232. },
  10233. "required": ["sessionID", "info"]
  10234. }
  10235. },
  10236. "required": ["type", "properties"]
  10237. },
  10238. "Event.session.deleted": {
  10239. "type": "object",
  10240. "properties": {
  10241. "type": {
  10242. "type": "string",
  10243. "const": "session.deleted"
  10244. },
  10245. "properties": {
  10246. "type": "object",
  10247. "properties": {
  10248. "sessionID": {
  10249. "type": "string",
  10250. "pattern": "^ses.*"
  10251. },
  10252. "info": {
  10253. "$ref": "#/components/schemas/Session"
  10254. }
  10255. },
  10256. "required": ["sessionID", "info"]
  10257. }
  10258. },
  10259. "required": ["type", "properties"]
  10260. },
  10261. "SyncEvent.message.updated": {
  10262. "type": "object",
  10263. "properties": {
  10264. "type": {
  10265. "type": "string",
  10266. "const": "sync"
  10267. },
  10268. "name": {
  10269. "type": "string",
  10270. "const": "message.updated.1"
  10271. },
  10272. "id": {
  10273. "type": "string"
  10274. },
  10275. "seq": {
  10276. "type": "number"
  10277. },
  10278. "aggregateID": {
  10279. "type": "string",
  10280. "const": "sessionID"
  10281. },
  10282. "data": {
  10283. "type": "object",
  10284. "properties": {
  10285. "sessionID": {
  10286. "type": "string",
  10287. "pattern": "^ses.*"
  10288. },
  10289. "info": {
  10290. "$ref": "#/components/schemas/Message"
  10291. }
  10292. },
  10293. "required": ["sessionID", "info"]
  10294. }
  10295. },
  10296. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10297. },
  10298. "SyncEvent.message.removed": {
  10299. "type": "object",
  10300. "properties": {
  10301. "type": {
  10302. "type": "string",
  10303. "const": "sync"
  10304. },
  10305. "name": {
  10306. "type": "string",
  10307. "const": "message.removed.1"
  10308. },
  10309. "id": {
  10310. "type": "string"
  10311. },
  10312. "seq": {
  10313. "type": "number"
  10314. },
  10315. "aggregateID": {
  10316. "type": "string",
  10317. "const": "sessionID"
  10318. },
  10319. "data": {
  10320. "type": "object",
  10321. "properties": {
  10322. "sessionID": {
  10323. "type": "string",
  10324. "pattern": "^ses.*"
  10325. },
  10326. "messageID": {
  10327. "type": "string",
  10328. "pattern": "^msg.*"
  10329. }
  10330. },
  10331. "required": ["sessionID", "messageID"]
  10332. }
  10333. },
  10334. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10335. },
  10336. "SyncEvent.message.part.updated": {
  10337. "type": "object",
  10338. "properties": {
  10339. "type": {
  10340. "type": "string",
  10341. "const": "sync"
  10342. },
  10343. "name": {
  10344. "type": "string",
  10345. "const": "message.part.updated.1"
  10346. },
  10347. "id": {
  10348. "type": "string"
  10349. },
  10350. "seq": {
  10351. "type": "number"
  10352. },
  10353. "aggregateID": {
  10354. "type": "string",
  10355. "const": "sessionID"
  10356. },
  10357. "data": {
  10358. "type": "object",
  10359. "properties": {
  10360. "sessionID": {
  10361. "type": "string",
  10362. "pattern": "^ses.*"
  10363. },
  10364. "part": {
  10365. "$ref": "#/components/schemas/Part"
  10366. },
  10367. "time": {
  10368. "type": "number"
  10369. }
  10370. },
  10371. "required": ["sessionID", "part", "time"]
  10372. }
  10373. },
  10374. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10375. },
  10376. "SyncEvent.message.part.removed": {
  10377. "type": "object",
  10378. "properties": {
  10379. "type": {
  10380. "type": "string",
  10381. "const": "sync"
  10382. },
  10383. "name": {
  10384. "type": "string",
  10385. "const": "message.part.removed.1"
  10386. },
  10387. "id": {
  10388. "type": "string"
  10389. },
  10390. "seq": {
  10391. "type": "number"
  10392. },
  10393. "aggregateID": {
  10394. "type": "string",
  10395. "const": "sessionID"
  10396. },
  10397. "data": {
  10398. "type": "object",
  10399. "properties": {
  10400. "sessionID": {
  10401. "type": "string",
  10402. "pattern": "^ses.*"
  10403. },
  10404. "messageID": {
  10405. "type": "string",
  10406. "pattern": "^msg.*"
  10407. },
  10408. "partID": {
  10409. "type": "string",
  10410. "pattern": "^prt.*"
  10411. }
  10412. },
  10413. "required": ["sessionID", "messageID", "partID"]
  10414. }
  10415. },
  10416. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10417. },
  10418. "SyncEvent.session.created": {
  10419. "type": "object",
  10420. "properties": {
  10421. "type": {
  10422. "type": "string",
  10423. "const": "sync"
  10424. },
  10425. "name": {
  10426. "type": "string",
  10427. "const": "session.created.1"
  10428. },
  10429. "id": {
  10430. "type": "string"
  10431. },
  10432. "seq": {
  10433. "type": "number"
  10434. },
  10435. "aggregateID": {
  10436. "type": "string",
  10437. "const": "sessionID"
  10438. },
  10439. "data": {
  10440. "type": "object",
  10441. "properties": {
  10442. "sessionID": {
  10443. "type": "string",
  10444. "pattern": "^ses.*"
  10445. },
  10446. "info": {
  10447. "$ref": "#/components/schemas/Session"
  10448. }
  10449. },
  10450. "required": ["sessionID", "info"]
  10451. }
  10452. },
  10453. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10454. },
  10455. "SyncEvent.session.updated": {
  10456. "type": "object",
  10457. "properties": {
  10458. "type": {
  10459. "type": "string",
  10460. "const": "sync"
  10461. },
  10462. "name": {
  10463. "type": "string",
  10464. "const": "session.updated.1"
  10465. },
  10466. "id": {
  10467. "type": "string"
  10468. },
  10469. "seq": {
  10470. "type": "number"
  10471. },
  10472. "aggregateID": {
  10473. "type": "string",
  10474. "const": "sessionID"
  10475. },
  10476. "data": {
  10477. "type": "object",
  10478. "properties": {
  10479. "sessionID": {
  10480. "type": "string",
  10481. "pattern": "^ses.*"
  10482. },
  10483. "info": {
  10484. "type": "object",
  10485. "properties": {
  10486. "id": {
  10487. "anyOf": [
  10488. {
  10489. "type": "string",
  10490. "pattern": "^ses.*"
  10491. },
  10492. {
  10493. "type": "null"
  10494. }
  10495. ]
  10496. },
  10497. "slug": {
  10498. "anyOf": [
  10499. {
  10500. "type": "string"
  10501. },
  10502. {
  10503. "type": "null"
  10504. }
  10505. ]
  10506. },
  10507. "projectID": {
  10508. "anyOf": [
  10509. {
  10510. "type": "string"
  10511. },
  10512. {
  10513. "type": "null"
  10514. }
  10515. ]
  10516. },
  10517. "workspaceID": {
  10518. "anyOf": [
  10519. {
  10520. "type": "string",
  10521. "pattern": "^wrk.*"
  10522. },
  10523. {
  10524. "type": "null"
  10525. }
  10526. ]
  10527. },
  10528. "directory": {
  10529. "anyOf": [
  10530. {
  10531. "type": "string"
  10532. },
  10533. {
  10534. "type": "null"
  10535. }
  10536. ]
  10537. },
  10538. "parentID": {
  10539. "anyOf": [
  10540. {
  10541. "type": "string",
  10542. "pattern": "^ses.*"
  10543. },
  10544. {
  10545. "type": "null"
  10546. }
  10547. ]
  10548. },
  10549. "summary": {
  10550. "anyOf": [
  10551. {
  10552. "type": "object",
  10553. "properties": {
  10554. "additions": {
  10555. "type": "number"
  10556. },
  10557. "deletions": {
  10558. "type": "number"
  10559. },
  10560. "files": {
  10561. "type": "number"
  10562. },
  10563. "diffs": {
  10564. "type": "array",
  10565. "items": {
  10566. "$ref": "#/components/schemas/SnapshotFileDiff"
  10567. }
  10568. }
  10569. },
  10570. "required": ["additions", "deletions", "files"]
  10571. },
  10572. {
  10573. "type": "null"
  10574. }
  10575. ]
  10576. },
  10577. "share": {
  10578. "type": "object",
  10579. "properties": {
  10580. "url": {
  10581. "anyOf": [
  10582. {
  10583. "type": "string"
  10584. },
  10585. {
  10586. "type": "null"
  10587. }
  10588. ]
  10589. }
  10590. },
  10591. "required": ["url"]
  10592. },
  10593. "title": {
  10594. "anyOf": [
  10595. {
  10596. "type": "string"
  10597. },
  10598. {
  10599. "type": "null"
  10600. }
  10601. ]
  10602. },
  10603. "version": {
  10604. "anyOf": [
  10605. {
  10606. "type": "string"
  10607. },
  10608. {
  10609. "type": "null"
  10610. }
  10611. ]
  10612. },
  10613. "time": {
  10614. "type": "object",
  10615. "properties": {
  10616. "created": {
  10617. "anyOf": [
  10618. {
  10619. "type": "number"
  10620. },
  10621. {
  10622. "type": "null"
  10623. }
  10624. ]
  10625. },
  10626. "updated": {
  10627. "anyOf": [
  10628. {
  10629. "type": "number"
  10630. },
  10631. {
  10632. "type": "null"
  10633. }
  10634. ]
  10635. },
  10636. "compacting": {
  10637. "anyOf": [
  10638. {
  10639. "type": "number"
  10640. },
  10641. {
  10642. "type": "null"
  10643. }
  10644. ]
  10645. },
  10646. "archived": {
  10647. "anyOf": [
  10648. {
  10649. "type": "number"
  10650. },
  10651. {
  10652. "type": "null"
  10653. }
  10654. ]
  10655. }
  10656. },
  10657. "required": ["created", "updated", "compacting", "archived"]
  10658. },
  10659. "permission": {
  10660. "anyOf": [
  10661. {
  10662. "$ref": "#/components/schemas/PermissionRuleset"
  10663. },
  10664. {
  10665. "type": "null"
  10666. }
  10667. ]
  10668. },
  10669. "revert": {
  10670. "anyOf": [
  10671. {
  10672. "type": "object",
  10673. "properties": {
  10674. "messageID": {
  10675. "type": "string",
  10676. "pattern": "^msg.*"
  10677. },
  10678. "partID": {
  10679. "type": "string",
  10680. "pattern": "^prt.*"
  10681. },
  10682. "snapshot": {
  10683. "type": "string"
  10684. },
  10685. "diff": {
  10686. "type": "string"
  10687. }
  10688. },
  10689. "required": ["messageID"]
  10690. },
  10691. {
  10692. "type": "null"
  10693. }
  10694. ]
  10695. }
  10696. },
  10697. "required": [
  10698. "id",
  10699. "slug",
  10700. "projectID",
  10701. "workspaceID",
  10702. "directory",
  10703. "parentID",
  10704. "summary",
  10705. "title",
  10706. "version",
  10707. "permission",
  10708. "revert"
  10709. ]
  10710. }
  10711. },
  10712. "required": ["sessionID", "info"]
  10713. }
  10714. },
  10715. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10716. },
  10717. "SyncEvent.session.deleted": {
  10718. "type": "object",
  10719. "properties": {
  10720. "type": {
  10721. "type": "string",
  10722. "const": "sync"
  10723. },
  10724. "name": {
  10725. "type": "string",
  10726. "const": "session.deleted.1"
  10727. },
  10728. "id": {
  10729. "type": "string"
  10730. },
  10731. "seq": {
  10732. "type": "number"
  10733. },
  10734. "aggregateID": {
  10735. "type": "string",
  10736. "const": "sessionID"
  10737. },
  10738. "data": {
  10739. "type": "object",
  10740. "properties": {
  10741. "sessionID": {
  10742. "type": "string",
  10743. "pattern": "^ses.*"
  10744. },
  10745. "info": {
  10746. "$ref": "#/components/schemas/Session"
  10747. }
  10748. },
  10749. "required": ["sessionID", "info"]
  10750. }
  10751. },
  10752. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10753. },
  10754. "GlobalEvent": {
  10755. "type": "object",
  10756. "properties": {
  10757. "directory": {
  10758. "type": "string"
  10759. },
  10760. "project": {
  10761. "type": "string"
  10762. },
  10763. "workspace": {
  10764. "type": "string"
  10765. },
  10766. "payload": {
  10767. "anyOf": [
  10768. {
  10769. "$ref": "#/components/schemas/Event.project.updated"
  10770. },
  10771. {
  10772. "$ref": "#/components/schemas/Event.server.instance.disposed"
  10773. },
  10774. {
  10775. "$ref": "#/components/schemas/Event.server.connected"
  10776. },
  10777. {
  10778. "$ref": "#/components/schemas/Event.global.disposed"
  10779. },
  10780. {
  10781. "$ref": "#/components/schemas/Event.file.edited"
  10782. },
  10783. {
  10784. "$ref": "#/components/schemas/Event.file.watcher.updated"
  10785. },
  10786. {
  10787. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  10788. },
  10789. {
  10790. "$ref": "#/components/schemas/Event.lsp.updated"
  10791. },
  10792. {
  10793. "$ref": "#/components/schemas/Event.installation.updated"
  10794. },
  10795. {
  10796. "$ref": "#/components/schemas/Event.installation.update-available"
  10797. },
  10798. {
  10799. "$ref": "#/components/schemas/Event.message.part.delta"
  10800. },
  10801. {
  10802. "$ref": "#/components/schemas/Event.permission.asked"
  10803. },
  10804. {
  10805. "$ref": "#/components/schemas/Event.permission.replied"
  10806. },
  10807. {
  10808. "$ref": "#/components/schemas/Event.session.diff"
  10809. },
  10810. {
  10811. "$ref": "#/components/schemas/Event.session.error"
  10812. },
  10813. {
  10814. "$ref": "#/components/schemas/Event.question.asked"
  10815. },
  10816. {
  10817. "$ref": "#/components/schemas/Event.question.replied"
  10818. },
  10819. {
  10820. "$ref": "#/components/schemas/Event.question.rejected"
  10821. },
  10822. {
  10823. "$ref": "#/components/schemas/Event.todo.updated"
  10824. },
  10825. {
  10826. "$ref": "#/components/schemas/Event.session.status"
  10827. },
  10828. {
  10829. "$ref": "#/components/schemas/Event.session.idle"
  10830. },
  10831. {
  10832. "$ref": "#/components/schemas/Event.session.compacted"
  10833. },
  10834. {
  10835. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10836. },
  10837. {
  10838. "$ref": "#/components/schemas/Event.tui.command.execute"
  10839. },
  10840. {
  10841. "$ref": "#/components/schemas/Event.tui.toast.show"
  10842. },
  10843. {
  10844. "$ref": "#/components/schemas/Event.tui.session.select"
  10845. },
  10846. {
  10847. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  10848. },
  10849. {
  10850. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  10851. },
  10852. {
  10853. "$ref": "#/components/schemas/Event.command.executed"
  10854. },
  10855. {
  10856. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  10857. },
  10858. {
  10859. "$ref": "#/components/schemas/Event.worktree.ready"
  10860. },
  10861. {
  10862. "$ref": "#/components/schemas/Event.worktree.failed"
  10863. },
  10864. {
  10865. "$ref": "#/components/schemas/Event.pty.created"
  10866. },
  10867. {
  10868. "$ref": "#/components/schemas/Event.pty.updated"
  10869. },
  10870. {
  10871. "$ref": "#/components/schemas/Event.pty.exited"
  10872. },
  10873. {
  10874. "$ref": "#/components/schemas/Event.pty.deleted"
  10875. },
  10876. {
  10877. "$ref": "#/components/schemas/Event.workspace.ready"
  10878. },
  10879. {
  10880. "$ref": "#/components/schemas/Event.workspace.failed"
  10881. },
  10882. {
  10883. "$ref": "#/components/schemas/Event.workspace.restore"
  10884. },
  10885. {
  10886. "$ref": "#/components/schemas/Event.workspace.status"
  10887. },
  10888. {
  10889. "$ref": "#/components/schemas/Event.message.updated"
  10890. },
  10891. {
  10892. "$ref": "#/components/schemas/Event.message.removed"
  10893. },
  10894. {
  10895. "$ref": "#/components/schemas/Event.message.part.updated"
  10896. },
  10897. {
  10898. "$ref": "#/components/schemas/Event.message.part.removed"
  10899. },
  10900. {
  10901. "$ref": "#/components/schemas/Event.session.created"
  10902. },
  10903. {
  10904. "$ref": "#/components/schemas/Event.session.updated"
  10905. },
  10906. {
  10907. "$ref": "#/components/schemas/Event.session.deleted"
  10908. },
  10909. {
  10910. "$ref": "#/components/schemas/SyncEvent.message.updated"
  10911. },
  10912. {
  10913. "$ref": "#/components/schemas/SyncEvent.message.removed"
  10914. },
  10915. {
  10916. "$ref": "#/components/schemas/SyncEvent.message.part.updated"
  10917. },
  10918. {
  10919. "$ref": "#/components/schemas/SyncEvent.message.part.removed"
  10920. },
  10921. {
  10922. "$ref": "#/components/schemas/SyncEvent.session.created"
  10923. },
  10924. {
  10925. "$ref": "#/components/schemas/SyncEvent.session.updated"
  10926. },
  10927. {
  10928. "$ref": "#/components/schemas/SyncEvent.session.deleted"
  10929. }
  10930. ]
  10931. }
  10932. },
  10933. "required": ["directory", "payload"]
  10934. },
  10935. "LogLevel": {
  10936. "description": "Log level",
  10937. "type": "string",
  10938. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  10939. },
  10940. "ServerConfig": {
  10941. "description": "Server configuration for opencode serve and web commands",
  10942. "type": "object",
  10943. "properties": {
  10944. "port": {
  10945. "description": "Port to listen on",
  10946. "type": "integer",
  10947. "exclusiveMinimum": 0,
  10948. "maximum": 9007199254740991
  10949. },
  10950. "hostname": {
  10951. "description": "Hostname to listen on",
  10952. "type": "string"
  10953. },
  10954. "mdns": {
  10955. "description": "Enable mDNS service discovery",
  10956. "type": "boolean"
  10957. },
  10958. "mdnsDomain": {
  10959. "description": "Custom domain name for mDNS service (default: opencode.local)",
  10960. "type": "string"
  10961. },
  10962. "cors": {
  10963. "description": "Additional domains to allow for CORS",
  10964. "type": "array",
  10965. "items": {
  10966. "type": "string"
  10967. }
  10968. }
  10969. },
  10970. "additionalProperties": false
  10971. },
  10972. "PermissionActionConfig": {
  10973. "type": "string",
  10974. "enum": ["ask", "allow", "deny"]
  10975. },
  10976. "PermissionObjectConfig": {
  10977. "type": "object",
  10978. "propertyNames": {
  10979. "type": "string"
  10980. },
  10981. "additionalProperties": {
  10982. "$ref": "#/components/schemas/PermissionActionConfig"
  10983. }
  10984. },
  10985. "PermissionRuleConfig": {
  10986. "anyOf": [
  10987. {
  10988. "$ref": "#/components/schemas/PermissionActionConfig"
  10989. },
  10990. {
  10991. "$ref": "#/components/schemas/PermissionObjectConfig"
  10992. }
  10993. ]
  10994. },
  10995. "PermissionConfig": {
  10996. "anyOf": [
  10997. {
  10998. "type": "object",
  10999. "properties": {
  11000. "__originalKeys": {
  11001. "type": "array",
  11002. "items": {
  11003. "type": "string"
  11004. }
  11005. },
  11006. "read": {
  11007. "$ref": "#/components/schemas/PermissionRuleConfig"
  11008. },
  11009. "edit": {
  11010. "$ref": "#/components/schemas/PermissionRuleConfig"
  11011. },
  11012. "glob": {
  11013. "$ref": "#/components/schemas/PermissionRuleConfig"
  11014. },
  11015. "grep": {
  11016. "$ref": "#/components/schemas/PermissionRuleConfig"
  11017. },
  11018. "list": {
  11019. "$ref": "#/components/schemas/PermissionRuleConfig"
  11020. },
  11021. "bash": {
  11022. "$ref": "#/components/schemas/PermissionRuleConfig"
  11023. },
  11024. "task": {
  11025. "$ref": "#/components/schemas/PermissionRuleConfig"
  11026. },
  11027. "external_directory": {
  11028. "$ref": "#/components/schemas/PermissionRuleConfig"
  11029. },
  11030. "todowrite": {
  11031. "$ref": "#/components/schemas/PermissionActionConfig"
  11032. },
  11033. "question": {
  11034. "$ref": "#/components/schemas/PermissionActionConfig"
  11035. },
  11036. "webfetch": {
  11037. "$ref": "#/components/schemas/PermissionActionConfig"
  11038. },
  11039. "websearch": {
  11040. "$ref": "#/components/schemas/PermissionActionConfig"
  11041. },
  11042. "codesearch": {
  11043. "$ref": "#/components/schemas/PermissionActionConfig"
  11044. },
  11045. "lsp": {
  11046. "$ref": "#/components/schemas/PermissionRuleConfig"
  11047. },
  11048. "doom_loop": {
  11049. "$ref": "#/components/schemas/PermissionActionConfig"
  11050. },
  11051. "skill": {
  11052. "$ref": "#/components/schemas/PermissionRuleConfig"
  11053. }
  11054. },
  11055. "additionalProperties": {
  11056. "$ref": "#/components/schemas/PermissionRuleConfig"
  11057. }
  11058. },
  11059. {
  11060. "$ref": "#/components/schemas/PermissionActionConfig"
  11061. }
  11062. ]
  11063. },
  11064. "AgentConfig": {
  11065. "type": "object",
  11066. "properties": {
  11067. "model": {
  11068. "type": "string"
  11069. },
  11070. "variant": {
  11071. "description": "Default model variant for this agent (applies only when using the agent's configured model).",
  11072. "type": "string"
  11073. },
  11074. "temperature": {
  11075. "type": "number"
  11076. },
  11077. "top_p": {
  11078. "type": "number"
  11079. },
  11080. "prompt": {
  11081. "type": "string"
  11082. },
  11083. "tools": {
  11084. "description": "@deprecated Use 'permission' field instead",
  11085. "type": "object",
  11086. "propertyNames": {
  11087. "type": "string"
  11088. },
  11089. "additionalProperties": {
  11090. "type": "boolean"
  11091. }
  11092. },
  11093. "disable": {
  11094. "type": "boolean"
  11095. },
  11096. "description": {
  11097. "description": "Description of when to use the agent",
  11098. "type": "string"
  11099. },
  11100. "mode": {
  11101. "type": "string",
  11102. "enum": ["subagent", "primary", "all"]
  11103. },
  11104. "hidden": {
  11105. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  11106. "type": "boolean"
  11107. },
  11108. "options": {
  11109. "type": "object",
  11110. "propertyNames": {
  11111. "type": "string"
  11112. },
  11113. "additionalProperties": {}
  11114. },
  11115. "color": {
  11116. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)",
  11117. "anyOf": [
  11118. {
  11119. "type": "string",
  11120. "pattern": "^#[0-9a-fA-F]{6}$"
  11121. },
  11122. {
  11123. "type": "string",
  11124. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11125. }
  11126. ]
  11127. },
  11128. "steps": {
  11129. "description": "Maximum number of agentic iterations before forcing text-only response",
  11130. "type": "integer",
  11131. "exclusiveMinimum": 0,
  11132. "maximum": 9007199254740991
  11133. },
  11134. "maxSteps": {
  11135. "description": "@deprecated Use 'steps' field instead.",
  11136. "type": "integer",
  11137. "exclusiveMinimum": 0,
  11138. "maximum": 9007199254740991
  11139. },
  11140. "permission": {
  11141. "$ref": "#/components/schemas/PermissionConfig"
  11142. }
  11143. },
  11144. "additionalProperties": {}
  11145. },
  11146. "ProviderConfig": {
  11147. "type": "object",
  11148. "properties": {
  11149. "api": {
  11150. "type": "string"
  11151. },
  11152. "name": {
  11153. "type": "string"
  11154. },
  11155. "env": {
  11156. "type": "array",
  11157. "items": {
  11158. "type": "string"
  11159. }
  11160. },
  11161. "id": {
  11162. "type": "string"
  11163. },
  11164. "npm": {
  11165. "type": "string"
  11166. },
  11167. "whitelist": {
  11168. "type": "array",
  11169. "items": {
  11170. "type": "string"
  11171. }
  11172. },
  11173. "blacklist": {
  11174. "type": "array",
  11175. "items": {
  11176. "type": "string"
  11177. }
  11178. },
  11179. "options": {
  11180. "type": "object",
  11181. "properties": {
  11182. "apiKey": {
  11183. "type": "string"
  11184. },
  11185. "baseURL": {
  11186. "type": "string"
  11187. },
  11188. "enterpriseUrl": {
  11189. "description": "GitHub Enterprise URL for copilot authentication",
  11190. "type": "string"
  11191. },
  11192. "setCacheKey": {
  11193. "description": "Enable promptCacheKey for this provider (default false)",
  11194. "type": "boolean"
  11195. },
  11196. "timeout": {
  11197. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  11198. "anyOf": [
  11199. {
  11200. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  11201. "type": "integer",
  11202. "exclusiveMinimum": 0,
  11203. "maximum": 9007199254740991
  11204. },
  11205. {
  11206. "description": "Disable timeout for this provider entirely.",
  11207. "type": "boolean",
  11208. "const": false
  11209. }
  11210. ]
  11211. },
  11212. "chunkTimeout": {
  11213. "description": "Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted.",
  11214. "type": "integer",
  11215. "exclusiveMinimum": 0,
  11216. "maximum": 9007199254740991
  11217. }
  11218. },
  11219. "additionalProperties": {}
  11220. },
  11221. "models": {
  11222. "type": "object",
  11223. "propertyNames": {
  11224. "type": "string"
  11225. },
  11226. "additionalProperties": {
  11227. "type": "object",
  11228. "properties": {
  11229. "id": {
  11230. "type": "string"
  11231. },
  11232. "name": {
  11233. "type": "string"
  11234. },
  11235. "family": {
  11236. "type": "string"
  11237. },
  11238. "release_date": {
  11239. "type": "string"
  11240. },
  11241. "attachment": {
  11242. "type": "boolean"
  11243. },
  11244. "reasoning": {
  11245. "type": "boolean"
  11246. },
  11247. "temperature": {
  11248. "type": "boolean"
  11249. },
  11250. "tool_call": {
  11251. "type": "boolean"
  11252. },
  11253. "interleaved": {
  11254. "anyOf": [
  11255. {
  11256. "type": "boolean",
  11257. "const": true
  11258. },
  11259. {
  11260. "type": "object",
  11261. "properties": {
  11262. "field": {
  11263. "type": "string",
  11264. "enum": ["reasoning_content", "reasoning_details"]
  11265. }
  11266. },
  11267. "required": ["field"],
  11268. "additionalProperties": false
  11269. }
  11270. ]
  11271. },
  11272. "cost": {
  11273. "type": "object",
  11274. "properties": {
  11275. "input": {
  11276. "type": "number"
  11277. },
  11278. "output": {
  11279. "type": "number"
  11280. },
  11281. "cache_read": {
  11282. "type": "number"
  11283. },
  11284. "cache_write": {
  11285. "type": "number"
  11286. },
  11287. "context_over_200k": {
  11288. "type": "object",
  11289. "properties": {
  11290. "input": {
  11291. "type": "number"
  11292. },
  11293. "output": {
  11294. "type": "number"
  11295. },
  11296. "cache_read": {
  11297. "type": "number"
  11298. },
  11299. "cache_write": {
  11300. "type": "number"
  11301. }
  11302. },
  11303. "required": ["input", "output"]
  11304. }
  11305. },
  11306. "required": ["input", "output"]
  11307. },
  11308. "limit": {
  11309. "type": "object",
  11310. "properties": {
  11311. "context": {
  11312. "type": "number"
  11313. },
  11314. "input": {
  11315. "type": "number"
  11316. },
  11317. "output": {
  11318. "type": "number"
  11319. }
  11320. },
  11321. "required": ["context", "output"]
  11322. },
  11323. "modalities": {
  11324. "type": "object",
  11325. "properties": {
  11326. "input": {
  11327. "type": "array",
  11328. "items": {
  11329. "type": "string",
  11330. "enum": ["text", "audio", "image", "video", "pdf"]
  11331. }
  11332. },
  11333. "output": {
  11334. "type": "array",
  11335. "items": {
  11336. "type": "string",
  11337. "enum": ["text", "audio", "image", "video", "pdf"]
  11338. }
  11339. }
  11340. },
  11341. "required": ["input", "output"]
  11342. },
  11343. "experimental": {
  11344. "type": "boolean"
  11345. },
  11346. "status": {
  11347. "type": "string",
  11348. "enum": ["alpha", "beta", "deprecated"]
  11349. },
  11350. "provider": {
  11351. "type": "object",
  11352. "properties": {
  11353. "npm": {
  11354. "type": "string"
  11355. },
  11356. "api": {
  11357. "type": "string"
  11358. }
  11359. }
  11360. },
  11361. "options": {
  11362. "type": "object",
  11363. "propertyNames": {
  11364. "type": "string"
  11365. },
  11366. "additionalProperties": {}
  11367. },
  11368. "headers": {
  11369. "type": "object",
  11370. "propertyNames": {
  11371. "type": "string"
  11372. },
  11373. "additionalProperties": {
  11374. "type": "string"
  11375. }
  11376. },
  11377. "variants": {
  11378. "description": "Variant-specific configuration",
  11379. "type": "object",
  11380. "propertyNames": {
  11381. "type": "string"
  11382. },
  11383. "additionalProperties": {
  11384. "type": "object",
  11385. "properties": {
  11386. "disabled": {
  11387. "description": "Disable this variant for the model",
  11388. "type": "boolean"
  11389. }
  11390. },
  11391. "additionalProperties": {}
  11392. }
  11393. }
  11394. }
  11395. }
  11396. }
  11397. },
  11398. "additionalProperties": false
  11399. },
  11400. "McpLocalConfig": {
  11401. "type": "object",
  11402. "properties": {
  11403. "type": {
  11404. "description": "Type of MCP server connection",
  11405. "type": "string",
  11406. "const": "local"
  11407. },
  11408. "command": {
  11409. "description": "Command and arguments to run the MCP server",
  11410. "type": "array",
  11411. "items": {
  11412. "type": "string"
  11413. }
  11414. },
  11415. "environment": {
  11416. "description": "Environment variables to set when running the MCP server",
  11417. "type": "object",
  11418. "propertyNames": {
  11419. "type": "string"
  11420. },
  11421. "additionalProperties": {
  11422. "type": "string"
  11423. }
  11424. },
  11425. "enabled": {
  11426. "description": "Enable or disable the MCP server on startup",
  11427. "type": "boolean"
  11428. },
  11429. "timeout": {
  11430. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11431. "type": "number"
  11432. }
  11433. },
  11434. "required": ["type", "command"]
  11435. },
  11436. "McpOAuthConfig": {
  11437. "type": "object",
  11438. "properties": {
  11439. "clientId": {
  11440. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  11441. "type": "string"
  11442. },
  11443. "clientSecret": {
  11444. "description": "OAuth client secret (if required by the authorization server)",
  11445. "type": "string"
  11446. },
  11447. "scope": {
  11448. "description": "OAuth scopes to request during authorization",
  11449. "type": "string"
  11450. },
  11451. "redirectUri": {
  11452. "description": "OAuth redirect URI (default: http://127.0.0.1:19876/mcp/oauth/callback).",
  11453. "type": "string"
  11454. }
  11455. }
  11456. },
  11457. "McpRemoteConfig": {
  11458. "type": "object",
  11459. "properties": {
  11460. "type": {
  11461. "description": "Type of MCP server connection",
  11462. "type": "string",
  11463. "const": "remote"
  11464. },
  11465. "url": {
  11466. "description": "URL of the remote MCP server",
  11467. "type": "string"
  11468. },
  11469. "enabled": {
  11470. "description": "Enable or disable the MCP server on startup",
  11471. "type": "boolean"
  11472. },
  11473. "headers": {
  11474. "description": "Headers to send with the request",
  11475. "type": "object",
  11476. "propertyNames": {
  11477. "type": "string"
  11478. },
  11479. "additionalProperties": {
  11480. "type": "string"
  11481. }
  11482. },
  11483. "oauth": {
  11484. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  11485. "anyOf": [
  11486. {
  11487. "$ref": "#/components/schemas/McpOAuthConfig"
  11488. },
  11489. {
  11490. "type": "boolean",
  11491. "const": false
  11492. }
  11493. ]
  11494. },
  11495. "timeout": {
  11496. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11497. "type": "number"
  11498. }
  11499. },
  11500. "required": ["type", "url"]
  11501. },
  11502. "LayoutConfig": {
  11503. "description": "@deprecated Always uses stretch layout.",
  11504. "type": "string",
  11505. "enum": ["auto", "stretch"]
  11506. },
  11507. "Config": {
  11508. "type": "object",
  11509. "properties": {
  11510. "$schema": {
  11511. "description": "JSON schema reference for configuration validation",
  11512. "type": "string"
  11513. },
  11514. "logLevel": {
  11515. "$ref": "#/components/schemas/LogLevel"
  11516. },
  11517. "server": {
  11518. "$ref": "#/components/schemas/ServerConfig"
  11519. },
  11520. "command": {
  11521. "description": "Command configuration, see https://opencode.ai/docs/commands",
  11522. "type": "object",
  11523. "propertyNames": {
  11524. "type": "string"
  11525. },
  11526. "additionalProperties": {
  11527. "type": "object",
  11528. "properties": {
  11529. "template": {
  11530. "type": "string"
  11531. },
  11532. "description": {
  11533. "type": "string"
  11534. },
  11535. "agent": {
  11536. "type": "string"
  11537. },
  11538. "model": {
  11539. "type": "string"
  11540. },
  11541. "subtask": {
  11542. "type": "boolean"
  11543. }
  11544. },
  11545. "required": ["template"]
  11546. }
  11547. },
  11548. "skills": {
  11549. "description": "Additional skill folder paths",
  11550. "type": "object",
  11551. "properties": {
  11552. "paths": {
  11553. "description": "Additional paths to skill folders",
  11554. "type": "array",
  11555. "items": {
  11556. "type": "string"
  11557. }
  11558. },
  11559. "urls": {
  11560. "description": "URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)",
  11561. "type": "array",
  11562. "items": {
  11563. "type": "string"
  11564. }
  11565. }
  11566. }
  11567. },
  11568. "watcher": {
  11569. "type": "object",
  11570. "properties": {
  11571. "ignore": {
  11572. "type": "array",
  11573. "items": {
  11574. "type": "string"
  11575. }
  11576. }
  11577. }
  11578. },
  11579. "snapshot": {
  11580. "description": "Enable or disable snapshot tracking. When false, filesystem snapshots are not recorded and undoing or reverting will not undo/redo file changes. Defaults to true.",
  11581. "type": "boolean"
  11582. },
  11583. "plugin": {
  11584. "type": "array",
  11585. "items": {
  11586. "anyOf": [
  11587. {
  11588. "type": "string"
  11589. },
  11590. {
  11591. "type": "array",
  11592. "prefixItems": [
  11593. {
  11594. "type": "string"
  11595. },
  11596. {
  11597. "type": "object",
  11598. "propertyNames": {
  11599. "type": "string"
  11600. },
  11601. "additionalProperties": {}
  11602. }
  11603. ]
  11604. }
  11605. ]
  11606. }
  11607. },
  11608. "share": {
  11609. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  11610. "type": "string",
  11611. "enum": ["manual", "auto", "disabled"]
  11612. },
  11613. "autoshare": {
  11614. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  11615. "type": "boolean"
  11616. },
  11617. "autoupdate": {
  11618. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  11619. "anyOf": [
  11620. {
  11621. "type": "boolean"
  11622. },
  11623. {
  11624. "type": "string",
  11625. "const": "notify"
  11626. }
  11627. ]
  11628. },
  11629. "disabled_providers": {
  11630. "description": "Disable providers that are loaded automatically",
  11631. "type": "array",
  11632. "items": {
  11633. "type": "string"
  11634. }
  11635. },
  11636. "enabled_providers": {
  11637. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  11638. "type": "array",
  11639. "items": {
  11640. "type": "string"
  11641. }
  11642. },
  11643. "model": {
  11644. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  11645. "type": "string"
  11646. },
  11647. "small_model": {
  11648. "description": "Small model to use for tasks like title generation in the format of provider/model",
  11649. "type": "string"
  11650. },
  11651. "default_agent": {
  11652. "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.",
  11653. "type": "string"
  11654. },
  11655. "username": {
  11656. "description": "Custom username to display in conversations instead of system username",
  11657. "type": "string"
  11658. },
  11659. "mode": {
  11660. "description": "@deprecated Use `agent` field instead.",
  11661. "type": "object",
  11662. "properties": {
  11663. "build": {
  11664. "$ref": "#/components/schemas/AgentConfig"
  11665. },
  11666. "plan": {
  11667. "$ref": "#/components/schemas/AgentConfig"
  11668. }
  11669. },
  11670. "additionalProperties": {
  11671. "$ref": "#/components/schemas/AgentConfig"
  11672. }
  11673. },
  11674. "agent": {
  11675. "description": "Agent configuration, see https://opencode.ai/docs/agents",
  11676. "type": "object",
  11677. "properties": {
  11678. "plan": {
  11679. "$ref": "#/components/schemas/AgentConfig"
  11680. },
  11681. "build": {
  11682. "$ref": "#/components/schemas/AgentConfig"
  11683. },
  11684. "general": {
  11685. "$ref": "#/components/schemas/AgentConfig"
  11686. },
  11687. "explore": {
  11688. "$ref": "#/components/schemas/AgentConfig"
  11689. },
  11690. "title": {
  11691. "$ref": "#/components/schemas/AgentConfig"
  11692. },
  11693. "summary": {
  11694. "$ref": "#/components/schemas/AgentConfig"
  11695. },
  11696. "compaction": {
  11697. "$ref": "#/components/schemas/AgentConfig"
  11698. }
  11699. },
  11700. "additionalProperties": {
  11701. "$ref": "#/components/schemas/AgentConfig"
  11702. }
  11703. },
  11704. "provider": {
  11705. "description": "Custom provider configurations and model overrides",
  11706. "type": "object",
  11707. "propertyNames": {
  11708. "type": "string"
  11709. },
  11710. "additionalProperties": {
  11711. "$ref": "#/components/schemas/ProviderConfig"
  11712. }
  11713. },
  11714. "mcp": {
  11715. "description": "MCP (Model Context Protocol) server configurations",
  11716. "type": "object",
  11717. "propertyNames": {
  11718. "type": "string"
  11719. },
  11720. "additionalProperties": {
  11721. "anyOf": [
  11722. {
  11723. "anyOf": [
  11724. {
  11725. "$ref": "#/components/schemas/McpLocalConfig"
  11726. },
  11727. {
  11728. "$ref": "#/components/schemas/McpRemoteConfig"
  11729. }
  11730. ]
  11731. },
  11732. {
  11733. "type": "object",
  11734. "properties": {
  11735. "enabled": {
  11736. "type": "boolean"
  11737. }
  11738. },
  11739. "required": ["enabled"],
  11740. "additionalProperties": false
  11741. }
  11742. ]
  11743. }
  11744. },
  11745. "formatter": {
  11746. "anyOf": [
  11747. {
  11748. "type": "boolean"
  11749. },
  11750. {
  11751. "type": "object",
  11752. "propertyNames": {
  11753. "type": "string"
  11754. },
  11755. "additionalProperties": {
  11756. "type": "object",
  11757. "properties": {
  11758. "disabled": {
  11759. "type": "boolean"
  11760. },
  11761. "command": {
  11762. "type": "array",
  11763. "items": {
  11764. "type": "string"
  11765. }
  11766. },
  11767. "environment": {
  11768. "type": "object",
  11769. "propertyNames": {
  11770. "type": "string"
  11771. },
  11772. "additionalProperties": {
  11773. "type": "string"
  11774. }
  11775. },
  11776. "extensions": {
  11777. "type": "array",
  11778. "items": {
  11779. "type": "string"
  11780. }
  11781. }
  11782. }
  11783. }
  11784. }
  11785. ]
  11786. },
  11787. "lsp": {
  11788. "anyOf": [
  11789. {
  11790. "type": "boolean"
  11791. },
  11792. {
  11793. "type": "object",
  11794. "propertyNames": {
  11795. "type": "string"
  11796. },
  11797. "additionalProperties": {
  11798. "anyOf": [
  11799. {
  11800. "type": "object",
  11801. "properties": {
  11802. "disabled": {
  11803. "type": "boolean",
  11804. "const": true
  11805. }
  11806. },
  11807. "required": ["disabled"]
  11808. },
  11809. {
  11810. "type": "object",
  11811. "properties": {
  11812. "command": {
  11813. "type": "array",
  11814. "items": {
  11815. "type": "string"
  11816. }
  11817. },
  11818. "extensions": {
  11819. "type": "array",
  11820. "items": {
  11821. "type": "string"
  11822. }
  11823. },
  11824. "disabled": {
  11825. "type": "boolean"
  11826. },
  11827. "env": {
  11828. "type": "object",
  11829. "propertyNames": {
  11830. "type": "string"
  11831. },
  11832. "additionalProperties": {
  11833. "type": "string"
  11834. }
  11835. },
  11836. "initialization": {
  11837. "type": "object",
  11838. "propertyNames": {
  11839. "type": "string"
  11840. },
  11841. "additionalProperties": {}
  11842. }
  11843. },
  11844. "required": ["command"]
  11845. }
  11846. ]
  11847. }
  11848. }
  11849. ]
  11850. },
  11851. "instructions": {
  11852. "description": "Additional instruction files or patterns to include",
  11853. "type": "array",
  11854. "items": {
  11855. "type": "string"
  11856. }
  11857. },
  11858. "layout": {
  11859. "$ref": "#/components/schemas/LayoutConfig"
  11860. },
  11861. "permission": {
  11862. "$ref": "#/components/schemas/PermissionConfig"
  11863. },
  11864. "tools": {
  11865. "type": "object",
  11866. "propertyNames": {
  11867. "type": "string"
  11868. },
  11869. "additionalProperties": {
  11870. "type": "boolean"
  11871. }
  11872. },
  11873. "enterprise": {
  11874. "type": "object",
  11875. "properties": {
  11876. "url": {
  11877. "description": "Enterprise URL",
  11878. "type": "string"
  11879. }
  11880. }
  11881. },
  11882. "compaction": {
  11883. "type": "object",
  11884. "properties": {
  11885. "auto": {
  11886. "description": "Enable automatic compaction when context is full (default: true)",
  11887. "type": "boolean"
  11888. },
  11889. "prune": {
  11890. "description": "Enable pruning of old tool outputs (default: true)",
  11891. "type": "boolean"
  11892. },
  11893. "reserved": {
  11894. "description": "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.",
  11895. "type": "integer",
  11896. "minimum": 0,
  11897. "maximum": 9007199254740991
  11898. }
  11899. }
  11900. },
  11901. "experimental": {
  11902. "type": "object",
  11903. "properties": {
  11904. "disable_paste_summary": {
  11905. "type": "boolean"
  11906. },
  11907. "batch_tool": {
  11908. "description": "Enable the batch tool",
  11909. "type": "boolean"
  11910. },
  11911. "openTelemetry": {
  11912. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  11913. "type": "boolean"
  11914. },
  11915. "primary_tools": {
  11916. "description": "Tools that should only be available to primary agents.",
  11917. "type": "array",
  11918. "items": {
  11919. "type": "string"
  11920. }
  11921. },
  11922. "continue_loop_on_deny": {
  11923. "description": "Continue the agent loop when a tool call is denied",
  11924. "type": "boolean"
  11925. },
  11926. "mcp_timeout": {
  11927. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  11928. "type": "integer",
  11929. "exclusiveMinimum": 0,
  11930. "maximum": 9007199254740991
  11931. }
  11932. }
  11933. }
  11934. },
  11935. "additionalProperties": false
  11936. },
  11937. "BadRequestError": {
  11938. "type": "object",
  11939. "properties": {
  11940. "data": {},
  11941. "errors": {
  11942. "type": "array",
  11943. "items": {
  11944. "type": "object",
  11945. "propertyNames": {
  11946. "type": "string"
  11947. },
  11948. "additionalProperties": {}
  11949. }
  11950. },
  11951. "success": {
  11952. "type": "boolean",
  11953. "const": false
  11954. }
  11955. },
  11956. "required": ["data", "errors", "success"]
  11957. },
  11958. "OAuth": {
  11959. "type": "object",
  11960. "properties": {
  11961. "type": {
  11962. "type": "string",
  11963. "const": "oauth"
  11964. },
  11965. "refresh": {
  11966. "type": "string"
  11967. },
  11968. "access": {
  11969. "type": "string"
  11970. },
  11971. "expires": {
  11972. "type": "number"
  11973. },
  11974. "accountId": {
  11975. "type": "string"
  11976. },
  11977. "enterpriseUrl": {
  11978. "type": "string"
  11979. }
  11980. },
  11981. "required": ["type", "refresh", "access", "expires"]
  11982. },
  11983. "ApiAuth": {
  11984. "type": "object",
  11985. "properties": {
  11986. "type": {
  11987. "type": "string",
  11988. "const": "api"
  11989. },
  11990. "key": {
  11991. "type": "string"
  11992. },
  11993. "metadata": {
  11994. "type": "object",
  11995. "propertyNames": {
  11996. "type": "string"
  11997. },
  11998. "additionalProperties": {
  11999. "type": "string"
  12000. }
  12001. }
  12002. },
  12003. "required": ["type", "key"]
  12004. },
  12005. "WellKnownAuth": {
  12006. "type": "object",
  12007. "properties": {
  12008. "type": {
  12009. "type": "string",
  12010. "const": "wellknown"
  12011. },
  12012. "key": {
  12013. "type": "string"
  12014. },
  12015. "token": {
  12016. "type": "string"
  12017. }
  12018. },
  12019. "required": ["type", "key", "token"]
  12020. },
  12021. "Auth": {
  12022. "anyOf": [
  12023. {
  12024. "$ref": "#/components/schemas/OAuth"
  12025. },
  12026. {
  12027. "$ref": "#/components/schemas/ApiAuth"
  12028. },
  12029. {
  12030. "$ref": "#/components/schemas/WellKnownAuth"
  12031. }
  12032. ]
  12033. },
  12034. "Workspace": {
  12035. "type": "object",
  12036. "properties": {
  12037. "id": {
  12038. "type": "string",
  12039. "pattern": "^wrk.*"
  12040. },
  12041. "type": {
  12042. "type": "string"
  12043. },
  12044. "name": {
  12045. "type": "string"
  12046. },
  12047. "branch": {
  12048. "anyOf": [
  12049. {
  12050. "type": "string"
  12051. },
  12052. {
  12053. "type": "null"
  12054. }
  12055. ]
  12056. },
  12057. "directory": {
  12058. "anyOf": [
  12059. {
  12060. "type": "string"
  12061. },
  12062. {
  12063. "type": "null"
  12064. }
  12065. ]
  12066. },
  12067. "extra": {
  12068. "anyOf": [
  12069. {},
  12070. {
  12071. "type": "null"
  12072. }
  12073. ]
  12074. },
  12075. "projectID": {
  12076. "type": "string"
  12077. }
  12078. },
  12079. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"]
  12080. },
  12081. "NotFoundError": {
  12082. "type": "object",
  12083. "properties": {
  12084. "name": {
  12085. "type": "string",
  12086. "const": "NotFoundError"
  12087. },
  12088. "data": {
  12089. "type": "object",
  12090. "properties": {
  12091. "message": {
  12092. "type": "string"
  12093. }
  12094. },
  12095. "required": ["message"]
  12096. }
  12097. },
  12098. "required": ["name", "data"]
  12099. },
  12100. "Model": {
  12101. "type": "object",
  12102. "properties": {
  12103. "id": {
  12104. "type": "string"
  12105. },
  12106. "providerID": {
  12107. "type": "string"
  12108. },
  12109. "api": {
  12110. "type": "object",
  12111. "properties": {
  12112. "id": {
  12113. "type": "string"
  12114. },
  12115. "url": {
  12116. "type": "string"
  12117. },
  12118. "npm": {
  12119. "type": "string"
  12120. }
  12121. },
  12122. "required": ["id", "url", "npm"]
  12123. },
  12124. "name": {
  12125. "type": "string"
  12126. },
  12127. "family": {
  12128. "type": "string"
  12129. },
  12130. "capabilities": {
  12131. "type": "object",
  12132. "properties": {
  12133. "temperature": {
  12134. "type": "boolean"
  12135. },
  12136. "reasoning": {
  12137. "type": "boolean"
  12138. },
  12139. "attachment": {
  12140. "type": "boolean"
  12141. },
  12142. "toolcall": {
  12143. "type": "boolean"
  12144. },
  12145. "input": {
  12146. "type": "object",
  12147. "properties": {
  12148. "text": {
  12149. "type": "boolean"
  12150. },
  12151. "audio": {
  12152. "type": "boolean"
  12153. },
  12154. "image": {
  12155. "type": "boolean"
  12156. },
  12157. "video": {
  12158. "type": "boolean"
  12159. },
  12160. "pdf": {
  12161. "type": "boolean"
  12162. }
  12163. },
  12164. "required": ["text", "audio", "image", "video", "pdf"]
  12165. },
  12166. "output": {
  12167. "type": "object",
  12168. "properties": {
  12169. "text": {
  12170. "type": "boolean"
  12171. },
  12172. "audio": {
  12173. "type": "boolean"
  12174. },
  12175. "image": {
  12176. "type": "boolean"
  12177. },
  12178. "video": {
  12179. "type": "boolean"
  12180. },
  12181. "pdf": {
  12182. "type": "boolean"
  12183. }
  12184. },
  12185. "required": ["text", "audio", "image", "video", "pdf"]
  12186. },
  12187. "interleaved": {
  12188. "anyOf": [
  12189. {
  12190. "type": "boolean"
  12191. },
  12192. {
  12193. "type": "object",
  12194. "properties": {
  12195. "field": {
  12196. "type": "string",
  12197. "enum": ["reasoning_content", "reasoning_details"]
  12198. }
  12199. },
  12200. "required": ["field"]
  12201. }
  12202. ]
  12203. }
  12204. },
  12205. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  12206. },
  12207. "cost": {
  12208. "type": "object",
  12209. "properties": {
  12210. "input": {
  12211. "type": "number"
  12212. },
  12213. "output": {
  12214. "type": "number"
  12215. },
  12216. "cache": {
  12217. "type": "object",
  12218. "properties": {
  12219. "read": {
  12220. "type": "number"
  12221. },
  12222. "write": {
  12223. "type": "number"
  12224. }
  12225. },
  12226. "required": ["read", "write"]
  12227. },
  12228. "experimentalOver200K": {
  12229. "type": "object",
  12230. "properties": {
  12231. "input": {
  12232. "type": "number"
  12233. },
  12234. "output": {
  12235. "type": "number"
  12236. },
  12237. "cache": {
  12238. "type": "object",
  12239. "properties": {
  12240. "read": {
  12241. "type": "number"
  12242. },
  12243. "write": {
  12244. "type": "number"
  12245. }
  12246. },
  12247. "required": ["read", "write"]
  12248. }
  12249. },
  12250. "required": ["input", "output", "cache"]
  12251. }
  12252. },
  12253. "required": ["input", "output", "cache"]
  12254. },
  12255. "limit": {
  12256. "type": "object",
  12257. "properties": {
  12258. "context": {
  12259. "type": "number"
  12260. },
  12261. "input": {
  12262. "type": "number"
  12263. },
  12264. "output": {
  12265. "type": "number"
  12266. }
  12267. },
  12268. "required": ["context", "output"]
  12269. },
  12270. "status": {
  12271. "type": "string",
  12272. "enum": ["alpha", "beta", "deprecated", "active"]
  12273. },
  12274. "options": {
  12275. "type": "object",
  12276. "propertyNames": {
  12277. "type": "string"
  12278. },
  12279. "additionalProperties": {}
  12280. },
  12281. "headers": {
  12282. "type": "object",
  12283. "propertyNames": {
  12284. "type": "string"
  12285. },
  12286. "additionalProperties": {
  12287. "type": "string"
  12288. }
  12289. },
  12290. "release_date": {
  12291. "type": "string"
  12292. },
  12293. "variants": {
  12294. "type": "object",
  12295. "propertyNames": {
  12296. "type": "string"
  12297. },
  12298. "additionalProperties": {
  12299. "type": "object",
  12300. "propertyNames": {
  12301. "type": "string"
  12302. },
  12303. "additionalProperties": {}
  12304. }
  12305. }
  12306. },
  12307. "required": [
  12308. "id",
  12309. "providerID",
  12310. "api",
  12311. "name",
  12312. "capabilities",
  12313. "cost",
  12314. "limit",
  12315. "status",
  12316. "options",
  12317. "headers",
  12318. "release_date"
  12319. ]
  12320. },
  12321. "Provider": {
  12322. "type": "object",
  12323. "properties": {
  12324. "id": {
  12325. "type": "string"
  12326. },
  12327. "name": {
  12328. "type": "string"
  12329. },
  12330. "source": {
  12331. "type": "string",
  12332. "enum": ["env", "config", "custom", "api"]
  12333. },
  12334. "env": {
  12335. "type": "array",
  12336. "items": {
  12337. "type": "string"
  12338. }
  12339. },
  12340. "key": {
  12341. "type": "string"
  12342. },
  12343. "options": {
  12344. "type": "object",
  12345. "propertyNames": {
  12346. "type": "string"
  12347. },
  12348. "additionalProperties": {}
  12349. },
  12350. "models": {
  12351. "type": "object",
  12352. "propertyNames": {
  12353. "type": "string"
  12354. },
  12355. "additionalProperties": {
  12356. "$ref": "#/components/schemas/Model"
  12357. }
  12358. }
  12359. },
  12360. "required": ["id", "name", "source", "env", "options", "models"]
  12361. },
  12362. "ToolIDs": {
  12363. "type": "array",
  12364. "items": {
  12365. "type": "string"
  12366. }
  12367. },
  12368. "ToolListItem": {
  12369. "type": "object",
  12370. "properties": {
  12371. "id": {
  12372. "type": "string"
  12373. },
  12374. "description": {
  12375. "type": "string"
  12376. },
  12377. "parameters": {}
  12378. },
  12379. "required": ["id", "description", "parameters"]
  12380. },
  12381. "ToolList": {
  12382. "type": "array",
  12383. "items": {
  12384. "$ref": "#/components/schemas/ToolListItem"
  12385. }
  12386. },
  12387. "Worktree": {
  12388. "type": "object",
  12389. "properties": {
  12390. "name": {
  12391. "type": "string"
  12392. },
  12393. "branch": {
  12394. "type": "string"
  12395. },
  12396. "directory": {
  12397. "type": "string"
  12398. }
  12399. },
  12400. "required": ["name", "branch", "directory"]
  12401. },
  12402. "WorktreeCreateInput": {
  12403. "type": "object",
  12404. "properties": {
  12405. "name": {
  12406. "type": "string"
  12407. },
  12408. "startCommand": {
  12409. "description": "Additional startup script to run after the project's start command",
  12410. "type": "string"
  12411. }
  12412. }
  12413. },
  12414. "WorktreeRemoveInput": {
  12415. "type": "object",
  12416. "properties": {
  12417. "directory": {
  12418. "type": "string"
  12419. }
  12420. },
  12421. "required": ["directory"]
  12422. },
  12423. "WorktreeResetInput": {
  12424. "type": "object",
  12425. "properties": {
  12426. "directory": {
  12427. "type": "string"
  12428. }
  12429. },
  12430. "required": ["directory"]
  12431. },
  12432. "ProjectSummary": {
  12433. "type": "object",
  12434. "properties": {
  12435. "id": {
  12436. "type": "string"
  12437. },
  12438. "name": {
  12439. "type": "string"
  12440. },
  12441. "worktree": {
  12442. "type": "string"
  12443. }
  12444. },
  12445. "required": ["id", "worktree"]
  12446. },
  12447. "GlobalSession": {
  12448. "type": "object",
  12449. "properties": {
  12450. "id": {
  12451. "type": "string",
  12452. "pattern": "^ses.*"
  12453. },
  12454. "slug": {
  12455. "type": "string"
  12456. },
  12457. "projectID": {
  12458. "type": "string"
  12459. },
  12460. "workspaceID": {
  12461. "type": "string",
  12462. "pattern": "^wrk.*"
  12463. },
  12464. "directory": {
  12465. "type": "string"
  12466. },
  12467. "parentID": {
  12468. "type": "string",
  12469. "pattern": "^ses.*"
  12470. },
  12471. "summary": {
  12472. "type": "object",
  12473. "properties": {
  12474. "additions": {
  12475. "type": "number"
  12476. },
  12477. "deletions": {
  12478. "type": "number"
  12479. },
  12480. "files": {
  12481. "type": "number"
  12482. },
  12483. "diffs": {
  12484. "type": "array",
  12485. "items": {
  12486. "$ref": "#/components/schemas/SnapshotFileDiff"
  12487. }
  12488. }
  12489. },
  12490. "required": ["additions", "deletions", "files"]
  12491. },
  12492. "share": {
  12493. "type": "object",
  12494. "properties": {
  12495. "url": {
  12496. "type": "string"
  12497. }
  12498. },
  12499. "required": ["url"]
  12500. },
  12501. "title": {
  12502. "type": "string"
  12503. },
  12504. "version": {
  12505. "type": "string"
  12506. },
  12507. "time": {
  12508. "type": "object",
  12509. "properties": {
  12510. "created": {
  12511. "type": "number"
  12512. },
  12513. "updated": {
  12514. "type": "number"
  12515. },
  12516. "compacting": {
  12517. "type": "number"
  12518. },
  12519. "archived": {
  12520. "type": "number"
  12521. }
  12522. },
  12523. "required": ["created", "updated"]
  12524. },
  12525. "permission": {
  12526. "$ref": "#/components/schemas/PermissionRuleset"
  12527. },
  12528. "revert": {
  12529. "type": "object",
  12530. "properties": {
  12531. "messageID": {
  12532. "type": "string",
  12533. "pattern": "^msg.*"
  12534. },
  12535. "partID": {
  12536. "type": "string",
  12537. "pattern": "^prt.*"
  12538. },
  12539. "snapshot": {
  12540. "type": "string"
  12541. },
  12542. "diff": {
  12543. "type": "string"
  12544. }
  12545. },
  12546. "required": ["messageID"]
  12547. },
  12548. "project": {
  12549. "anyOf": [
  12550. {
  12551. "$ref": "#/components/schemas/ProjectSummary"
  12552. },
  12553. {
  12554. "type": "null"
  12555. }
  12556. ]
  12557. }
  12558. },
  12559. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"]
  12560. },
  12561. "McpResource": {
  12562. "type": "object",
  12563. "properties": {
  12564. "name": {
  12565. "type": "string"
  12566. },
  12567. "uri": {
  12568. "type": "string"
  12569. },
  12570. "description": {
  12571. "type": "string"
  12572. },
  12573. "mimeType": {
  12574. "type": "string"
  12575. },
  12576. "client": {
  12577. "type": "string"
  12578. }
  12579. },
  12580. "required": ["name", "uri", "client"]
  12581. },
  12582. "TextPartInput": {
  12583. "type": "object",
  12584. "properties": {
  12585. "id": {
  12586. "type": "string",
  12587. "pattern": "^prt.*"
  12588. },
  12589. "type": {
  12590. "type": "string",
  12591. "const": "text"
  12592. },
  12593. "text": {
  12594. "type": "string"
  12595. },
  12596. "synthetic": {
  12597. "type": "boolean"
  12598. },
  12599. "ignored": {
  12600. "type": "boolean"
  12601. },
  12602. "time": {
  12603. "type": "object",
  12604. "properties": {
  12605. "start": {
  12606. "type": "number"
  12607. },
  12608. "end": {
  12609. "type": "number"
  12610. }
  12611. },
  12612. "required": ["start"]
  12613. },
  12614. "metadata": {
  12615. "type": "object",
  12616. "propertyNames": {
  12617. "type": "string"
  12618. },
  12619. "additionalProperties": {}
  12620. }
  12621. },
  12622. "required": ["type", "text"]
  12623. },
  12624. "FilePartInput": {
  12625. "type": "object",
  12626. "properties": {
  12627. "id": {
  12628. "type": "string",
  12629. "pattern": "^prt.*"
  12630. },
  12631. "type": {
  12632. "type": "string",
  12633. "const": "file"
  12634. },
  12635. "mime": {
  12636. "type": "string"
  12637. },
  12638. "filename": {
  12639. "type": "string"
  12640. },
  12641. "url": {
  12642. "type": "string"
  12643. },
  12644. "source": {
  12645. "$ref": "#/components/schemas/FilePartSource"
  12646. }
  12647. },
  12648. "required": ["type", "mime", "url"]
  12649. },
  12650. "AgentPartInput": {
  12651. "type": "object",
  12652. "properties": {
  12653. "id": {
  12654. "type": "string",
  12655. "pattern": "^prt.*"
  12656. },
  12657. "type": {
  12658. "type": "string",
  12659. "const": "agent"
  12660. },
  12661. "name": {
  12662. "type": "string"
  12663. },
  12664. "source": {
  12665. "type": "object",
  12666. "properties": {
  12667. "value": {
  12668. "type": "string"
  12669. },
  12670. "start": {
  12671. "type": "integer",
  12672. "minimum": -9007199254740991,
  12673. "maximum": 9007199254740991
  12674. },
  12675. "end": {
  12676. "type": "integer",
  12677. "minimum": -9007199254740991,
  12678. "maximum": 9007199254740991
  12679. }
  12680. },
  12681. "required": ["value", "start", "end"]
  12682. }
  12683. },
  12684. "required": ["type", "name"]
  12685. },
  12686. "SubtaskPartInput": {
  12687. "type": "object",
  12688. "properties": {
  12689. "id": {
  12690. "type": "string",
  12691. "pattern": "^prt.*"
  12692. },
  12693. "type": {
  12694. "type": "string",
  12695. "const": "subtask"
  12696. },
  12697. "prompt": {
  12698. "type": "string"
  12699. },
  12700. "description": {
  12701. "type": "string"
  12702. },
  12703. "agent": {
  12704. "type": "string"
  12705. },
  12706. "model": {
  12707. "type": "object",
  12708. "properties": {
  12709. "providerID": {
  12710. "type": "string"
  12711. },
  12712. "modelID": {
  12713. "type": "string"
  12714. }
  12715. },
  12716. "required": ["providerID", "modelID"]
  12717. },
  12718. "command": {
  12719. "type": "string"
  12720. }
  12721. },
  12722. "required": ["type", "prompt", "description", "agent"]
  12723. },
  12724. "ProviderAuthMethod": {
  12725. "type": "object",
  12726. "properties": {
  12727. "type": {
  12728. "type": "string",
  12729. "enum": ["oauth", "api"]
  12730. },
  12731. "label": {
  12732. "type": "string"
  12733. },
  12734. "prompts": {
  12735. "type": "array",
  12736. "items": {
  12737. "anyOf": [
  12738. {
  12739. "type": "object",
  12740. "properties": {
  12741. "type": {
  12742. "type": "string",
  12743. "const": "text"
  12744. },
  12745. "key": {
  12746. "type": "string"
  12747. },
  12748. "message": {
  12749. "type": "string"
  12750. },
  12751. "placeholder": {
  12752. "type": "string"
  12753. },
  12754. "when": {
  12755. "type": "object",
  12756. "properties": {
  12757. "key": {
  12758. "type": "string"
  12759. },
  12760. "op": {
  12761. "type": "string",
  12762. "enum": ["eq", "neq"]
  12763. },
  12764. "value": {
  12765. "type": "string"
  12766. }
  12767. },
  12768. "required": ["key", "op", "value"]
  12769. }
  12770. },
  12771. "required": ["type", "key", "message"]
  12772. },
  12773. {
  12774. "type": "object",
  12775. "properties": {
  12776. "type": {
  12777. "type": "string",
  12778. "const": "select"
  12779. },
  12780. "key": {
  12781. "type": "string"
  12782. },
  12783. "message": {
  12784. "type": "string"
  12785. },
  12786. "options": {
  12787. "type": "array",
  12788. "items": {
  12789. "type": "object",
  12790. "properties": {
  12791. "label": {
  12792. "type": "string"
  12793. },
  12794. "value": {
  12795. "type": "string"
  12796. },
  12797. "hint": {
  12798. "type": "string"
  12799. }
  12800. },
  12801. "required": ["label", "value"]
  12802. }
  12803. },
  12804. "when": {
  12805. "type": "object",
  12806. "properties": {
  12807. "key": {
  12808. "type": "string"
  12809. },
  12810. "op": {
  12811. "type": "string",
  12812. "enum": ["eq", "neq"]
  12813. },
  12814. "value": {
  12815. "type": "string"
  12816. }
  12817. },
  12818. "required": ["key", "op", "value"]
  12819. }
  12820. },
  12821. "required": ["type", "key", "message", "options"]
  12822. }
  12823. ]
  12824. }
  12825. }
  12826. },
  12827. "required": ["type", "label"]
  12828. },
  12829. "ProviderAuthAuthorization": {
  12830. "type": "object",
  12831. "properties": {
  12832. "url": {
  12833. "type": "string"
  12834. },
  12835. "method": {
  12836. "type": "string",
  12837. "enum": ["auto", "code"]
  12838. },
  12839. "instructions": {
  12840. "type": "string"
  12841. }
  12842. },
  12843. "required": ["url", "method", "instructions"]
  12844. },
  12845. "Symbol": {
  12846. "type": "object",
  12847. "properties": {
  12848. "name": {
  12849. "type": "string"
  12850. },
  12851. "kind": {
  12852. "type": "number"
  12853. },
  12854. "location": {
  12855. "type": "object",
  12856. "properties": {
  12857. "uri": {
  12858. "type": "string"
  12859. },
  12860. "range": {
  12861. "$ref": "#/components/schemas/Range"
  12862. }
  12863. },
  12864. "required": ["uri", "range"]
  12865. }
  12866. },
  12867. "required": ["name", "kind", "location"]
  12868. },
  12869. "FileNode": {
  12870. "type": "object",
  12871. "properties": {
  12872. "name": {
  12873. "type": "string"
  12874. },
  12875. "path": {
  12876. "type": "string"
  12877. },
  12878. "absolute": {
  12879. "type": "string"
  12880. },
  12881. "type": {
  12882. "type": "string",
  12883. "enum": ["file", "directory"]
  12884. },
  12885. "ignored": {
  12886. "type": "boolean"
  12887. }
  12888. },
  12889. "required": ["name", "path", "absolute", "type", "ignored"]
  12890. },
  12891. "FileContent": {
  12892. "type": "object",
  12893. "properties": {
  12894. "type": {
  12895. "type": "string",
  12896. "enum": ["text", "binary"]
  12897. },
  12898. "content": {
  12899. "type": "string"
  12900. },
  12901. "diff": {
  12902. "type": "string"
  12903. },
  12904. "patch": {
  12905. "type": "object",
  12906. "properties": {
  12907. "oldFileName": {
  12908. "type": "string"
  12909. },
  12910. "newFileName": {
  12911. "type": "string"
  12912. },
  12913. "oldHeader": {
  12914. "type": "string"
  12915. },
  12916. "newHeader": {
  12917. "type": "string"
  12918. },
  12919. "hunks": {
  12920. "type": "array",
  12921. "items": {
  12922. "type": "object",
  12923. "properties": {
  12924. "oldStart": {
  12925. "type": "number"
  12926. },
  12927. "oldLines": {
  12928. "type": "number"
  12929. },
  12930. "newStart": {
  12931. "type": "number"
  12932. },
  12933. "newLines": {
  12934. "type": "number"
  12935. },
  12936. "lines": {
  12937. "type": "array",
  12938. "items": {
  12939. "type": "string"
  12940. }
  12941. }
  12942. },
  12943. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  12944. }
  12945. },
  12946. "index": {
  12947. "type": "string"
  12948. }
  12949. },
  12950. "required": ["oldFileName", "newFileName", "hunks"]
  12951. },
  12952. "encoding": {
  12953. "type": "string",
  12954. "const": "base64"
  12955. },
  12956. "mimeType": {
  12957. "type": "string"
  12958. }
  12959. },
  12960. "required": ["type", "content"]
  12961. },
  12962. "File": {
  12963. "type": "object",
  12964. "properties": {
  12965. "path": {
  12966. "type": "string"
  12967. },
  12968. "added": {
  12969. "type": "integer",
  12970. "minimum": -9007199254740991,
  12971. "maximum": 9007199254740991
  12972. },
  12973. "removed": {
  12974. "type": "integer",
  12975. "minimum": -9007199254740991,
  12976. "maximum": 9007199254740991
  12977. },
  12978. "status": {
  12979. "type": "string",
  12980. "enum": ["added", "deleted", "modified"]
  12981. }
  12982. },
  12983. "required": ["path", "added", "removed", "status"]
  12984. },
  12985. "Event": {
  12986. "anyOf": [
  12987. {
  12988. "$ref": "#/components/schemas/Event.project.updated"
  12989. },
  12990. {
  12991. "$ref": "#/components/schemas/Event.server.instance.disposed"
  12992. },
  12993. {
  12994. "$ref": "#/components/schemas/Event.server.connected"
  12995. },
  12996. {
  12997. "$ref": "#/components/schemas/Event.global.disposed"
  12998. },
  12999. {
  13000. "$ref": "#/components/schemas/Event.file.edited"
  13001. },
  13002. {
  13003. "$ref": "#/components/schemas/Event.file.watcher.updated"
  13004. },
  13005. {
  13006. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  13007. },
  13008. {
  13009. "$ref": "#/components/schemas/Event.lsp.updated"
  13010. },
  13011. {
  13012. "$ref": "#/components/schemas/Event.installation.updated"
  13013. },
  13014. {
  13015. "$ref": "#/components/schemas/Event.installation.update-available"
  13016. },
  13017. {
  13018. "$ref": "#/components/schemas/Event.message.part.delta"
  13019. },
  13020. {
  13021. "$ref": "#/components/schemas/Event.permission.asked"
  13022. },
  13023. {
  13024. "$ref": "#/components/schemas/Event.permission.replied"
  13025. },
  13026. {
  13027. "$ref": "#/components/schemas/Event.session.diff"
  13028. },
  13029. {
  13030. "$ref": "#/components/schemas/Event.session.error"
  13031. },
  13032. {
  13033. "$ref": "#/components/schemas/Event.question.asked"
  13034. },
  13035. {
  13036. "$ref": "#/components/schemas/Event.question.replied"
  13037. },
  13038. {
  13039. "$ref": "#/components/schemas/Event.question.rejected"
  13040. },
  13041. {
  13042. "$ref": "#/components/schemas/Event.todo.updated"
  13043. },
  13044. {
  13045. "$ref": "#/components/schemas/Event.session.status"
  13046. },
  13047. {
  13048. "$ref": "#/components/schemas/Event.session.idle"
  13049. },
  13050. {
  13051. "$ref": "#/components/schemas/Event.session.compacted"
  13052. },
  13053. {
  13054. "$ref": "#/components/schemas/Event.tui.prompt.append"
  13055. },
  13056. {
  13057. "$ref": "#/components/schemas/Event.tui.command.execute"
  13058. },
  13059. {
  13060. "$ref": "#/components/schemas/Event.tui.toast.show"
  13061. },
  13062. {
  13063. "$ref": "#/components/schemas/Event.tui.session.select"
  13064. },
  13065. {
  13066. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  13067. },
  13068. {
  13069. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  13070. },
  13071. {
  13072. "$ref": "#/components/schemas/Event.command.executed"
  13073. },
  13074. {
  13075. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  13076. },
  13077. {
  13078. "$ref": "#/components/schemas/Event.worktree.ready"
  13079. },
  13080. {
  13081. "$ref": "#/components/schemas/Event.worktree.failed"
  13082. },
  13083. {
  13084. "$ref": "#/components/schemas/Event.pty.created"
  13085. },
  13086. {
  13087. "$ref": "#/components/schemas/Event.pty.updated"
  13088. },
  13089. {
  13090. "$ref": "#/components/schemas/Event.pty.exited"
  13091. },
  13092. {
  13093. "$ref": "#/components/schemas/Event.pty.deleted"
  13094. },
  13095. {
  13096. "$ref": "#/components/schemas/Event.workspace.ready"
  13097. },
  13098. {
  13099. "$ref": "#/components/schemas/Event.workspace.failed"
  13100. },
  13101. {
  13102. "$ref": "#/components/schemas/Event.workspace.restore"
  13103. },
  13104. {
  13105. "$ref": "#/components/schemas/Event.workspace.status"
  13106. },
  13107. {
  13108. "$ref": "#/components/schemas/Event.message.updated"
  13109. },
  13110. {
  13111. "$ref": "#/components/schemas/Event.message.removed"
  13112. },
  13113. {
  13114. "$ref": "#/components/schemas/Event.message.part.updated"
  13115. },
  13116. {
  13117. "$ref": "#/components/schemas/Event.message.part.removed"
  13118. },
  13119. {
  13120. "$ref": "#/components/schemas/Event.session.created"
  13121. },
  13122. {
  13123. "$ref": "#/components/schemas/Event.session.updated"
  13124. },
  13125. {
  13126. "$ref": "#/components/schemas/Event.session.deleted"
  13127. }
  13128. ]
  13129. },
  13130. "MCPStatusConnected": {
  13131. "type": "object",
  13132. "properties": {
  13133. "status": {
  13134. "type": "string",
  13135. "const": "connected"
  13136. }
  13137. },
  13138. "required": ["status"]
  13139. },
  13140. "MCPStatusDisabled": {
  13141. "type": "object",
  13142. "properties": {
  13143. "status": {
  13144. "type": "string",
  13145. "const": "disabled"
  13146. }
  13147. },
  13148. "required": ["status"]
  13149. },
  13150. "MCPStatusFailed": {
  13151. "type": "object",
  13152. "properties": {
  13153. "status": {
  13154. "type": "string",
  13155. "const": "failed"
  13156. },
  13157. "error": {
  13158. "type": "string"
  13159. }
  13160. },
  13161. "required": ["status", "error"]
  13162. },
  13163. "MCPStatusNeedsAuth": {
  13164. "type": "object",
  13165. "properties": {
  13166. "status": {
  13167. "type": "string",
  13168. "const": "needs_auth"
  13169. }
  13170. },
  13171. "required": ["status"]
  13172. },
  13173. "MCPStatusNeedsClientRegistration": {
  13174. "type": "object",
  13175. "properties": {
  13176. "status": {
  13177. "type": "string",
  13178. "const": "needs_client_registration"
  13179. },
  13180. "error": {
  13181. "type": "string"
  13182. }
  13183. },
  13184. "required": ["status", "error"]
  13185. },
  13186. "MCPStatus": {
  13187. "anyOf": [
  13188. {
  13189. "$ref": "#/components/schemas/MCPStatusConnected"
  13190. },
  13191. {
  13192. "$ref": "#/components/schemas/MCPStatusDisabled"
  13193. },
  13194. {
  13195. "$ref": "#/components/schemas/MCPStatusFailed"
  13196. },
  13197. {
  13198. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  13199. },
  13200. {
  13201. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  13202. }
  13203. ]
  13204. },
  13205. "Path": {
  13206. "type": "object",
  13207. "properties": {
  13208. "home": {
  13209. "type": "string"
  13210. },
  13211. "state": {
  13212. "type": "string"
  13213. },
  13214. "config": {
  13215. "type": "string"
  13216. },
  13217. "worktree": {
  13218. "type": "string"
  13219. },
  13220. "directory": {
  13221. "type": "string"
  13222. }
  13223. },
  13224. "required": ["home", "state", "config", "worktree", "directory"]
  13225. },
  13226. "VcsInfo": {
  13227. "type": "object",
  13228. "properties": {
  13229. "branch": {
  13230. "type": "string"
  13231. },
  13232. "default_branch": {
  13233. "type": "string"
  13234. }
  13235. }
  13236. },
  13237. "VcsFileDiff": {
  13238. "type": "object",
  13239. "properties": {
  13240. "file": {
  13241. "type": "string"
  13242. },
  13243. "patch": {
  13244. "type": "string"
  13245. },
  13246. "additions": {
  13247. "type": "number"
  13248. },
  13249. "deletions": {
  13250. "type": "number"
  13251. },
  13252. "status": {
  13253. "type": "string",
  13254. "enum": ["added", "deleted", "modified"]
  13255. }
  13256. },
  13257. "required": ["file", "patch", "additions", "deletions"]
  13258. },
  13259. "Command": {
  13260. "type": "object",
  13261. "properties": {
  13262. "name": {
  13263. "type": "string"
  13264. },
  13265. "description": {
  13266. "type": "string"
  13267. },
  13268. "agent": {
  13269. "type": "string"
  13270. },
  13271. "model": {
  13272. "type": "string"
  13273. },
  13274. "source": {
  13275. "type": "string",
  13276. "enum": ["command", "mcp", "skill"]
  13277. },
  13278. "template": {
  13279. "anyOf": [
  13280. {
  13281. "type": "string"
  13282. },
  13283. {
  13284. "type": "string"
  13285. }
  13286. ]
  13287. },
  13288. "subtask": {
  13289. "type": "boolean"
  13290. },
  13291. "hints": {
  13292. "type": "array",
  13293. "items": {
  13294. "type": "string"
  13295. }
  13296. }
  13297. },
  13298. "required": ["name", "template", "hints"]
  13299. },
  13300. "Agent": {
  13301. "type": "object",
  13302. "properties": {
  13303. "name": {
  13304. "type": "string"
  13305. },
  13306. "description": {
  13307. "type": "string"
  13308. },
  13309. "mode": {
  13310. "type": "string",
  13311. "enum": ["subagent", "primary", "all"]
  13312. },
  13313. "native": {
  13314. "type": "boolean"
  13315. },
  13316. "hidden": {
  13317. "type": "boolean"
  13318. },
  13319. "topP": {
  13320. "type": "number"
  13321. },
  13322. "temperature": {
  13323. "type": "number"
  13324. },
  13325. "color": {
  13326. "type": "string"
  13327. },
  13328. "permission": {
  13329. "$ref": "#/components/schemas/PermissionRuleset"
  13330. },
  13331. "model": {
  13332. "type": "object",
  13333. "properties": {
  13334. "modelID": {
  13335. "type": "string"
  13336. },
  13337. "providerID": {
  13338. "type": "string"
  13339. }
  13340. },
  13341. "required": ["modelID", "providerID"]
  13342. },
  13343. "variant": {
  13344. "type": "string"
  13345. },
  13346. "prompt": {
  13347. "type": "string"
  13348. },
  13349. "options": {
  13350. "type": "object",
  13351. "propertyNames": {
  13352. "type": "string"
  13353. },
  13354. "additionalProperties": {}
  13355. },
  13356. "steps": {
  13357. "type": "integer",
  13358. "exclusiveMinimum": 0,
  13359. "maximum": 9007199254740991
  13360. }
  13361. },
  13362. "required": ["name", "mode", "permission", "options"]
  13363. },
  13364. "LSPStatus": {
  13365. "type": "object",
  13366. "properties": {
  13367. "id": {
  13368. "type": "string"
  13369. },
  13370. "name": {
  13371. "type": "string"
  13372. },
  13373. "root": {
  13374. "type": "string"
  13375. },
  13376. "status": {
  13377. "anyOf": [
  13378. {
  13379. "type": "string",
  13380. "const": "connected"
  13381. },
  13382. {
  13383. "type": "string",
  13384. "const": "error"
  13385. }
  13386. ]
  13387. }
  13388. },
  13389. "required": ["id", "name", "root", "status"]
  13390. },
  13391. "FormatterStatus": {
  13392. "type": "object",
  13393. "properties": {
  13394. "name": {
  13395. "type": "string"
  13396. },
  13397. "extensions": {
  13398. "type": "array",
  13399. "items": {
  13400. "type": "string"
  13401. }
  13402. },
  13403. "enabled": {
  13404. "type": "boolean"
  13405. }
  13406. },
  13407. "required": ["name", "extensions", "enabled"]
  13408. }
  13409. }
  13410. }
  13411. }