openapi.json 373 KB

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