openapi.json 344 KB

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