openapi.json 365 KB

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