openapi.json 354 KB

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