openapi.json 351 KB

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