openapi.json 363 KB

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