openapi.json 354 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090
  1. {
  2. "openapi": "3.1.1",
  3. "info": {
  4. "title": "opencode",
  5. "description": "opencode api",
  6. "version": "1.0.0"
  7. },
  8. "paths": {
  9. "/global/health": {
  10. "get": {
  11. "operationId": "global.health",
  12. "summary": "Get health",
  13. "description": "Get health information about the OpenCode server.",
  14. "responses": {
  15. "200": {
  16. "description": "Health information",
  17. "content": {
  18. "application/json": {
  19. "schema": {
  20. "type": "object",
  21. "properties": {
  22. "healthy": {
  23. "type": "boolean",
  24. "const": true
  25. },
  26. "version": {
  27. "type": "string"
  28. }
  29. },
  30. "required": ["healthy", "version"]
  31. }
  32. }
  33. }
  34. }
  35. },
  36. "x-codeSamples": [
  37. {
  38. "lang": "js",
  39. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  40. }
  41. ]
  42. }
  43. },
  44. "/global/event": {
  45. "get": {
  46. "operationId": "global.event",
  47. "summary": "Get global events",
  48. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  49. "responses": {
  50. "200": {
  51. "description": "Event stream",
  52. "content": {
  53. "text/event-stream": {
  54. "schema": {
  55. "$ref": "#/components/schemas/GlobalEvent"
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "x-codeSamples": [
  62. {
  63. "lang": "js",
  64. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  65. }
  66. ]
  67. }
  68. },
  69. "/global/config": {
  70. "get": {
  71. "operationId": "global.config.get",
  72. "summary": "Get global configuration",
  73. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  74. "responses": {
  75. "200": {
  76. "description": "Get global config info",
  77. "content": {
  78. "application/json": {
  79. "schema": {
  80. "$ref": "#/components/schemas/Config"
  81. }
  82. }
  83. }
  84. }
  85. },
  86. "x-codeSamples": [
  87. {
  88. "lang": "js",
  89. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  90. }
  91. ]
  92. },
  93. "patch": {
  94. "operationId": "global.config.update",
  95. "summary": "Update global configuration",
  96. "description": "Update global OpenCode configuration settings and preferences.",
  97. "responses": {
  98. "200": {
  99. "description": "Successfully updated global config",
  100. "content": {
  101. "application/json": {
  102. "schema": {
  103. "$ref": "#/components/schemas/Config"
  104. }
  105. }
  106. }
  107. },
  108. "400": {
  109. "description": "Bad request",
  110. "content": {
  111. "application/json": {
  112. "schema": {
  113. "$ref": "#/components/schemas/BadRequestError"
  114. }
  115. }
  116. }
  117. }
  118. },
  119. "requestBody": {
  120. "content": {
  121. "application/json": {
  122. "schema": {
  123. "$ref": "#/components/schemas/Config"
  124. }
  125. }
  126. }
  127. },
  128. "x-codeSamples": [
  129. {
  130. "lang": "js",
  131. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  132. }
  133. ]
  134. }
  135. },
  136. "/global/dispose": {
  137. "post": {
  138. "operationId": "global.dispose",
  139. "summary": "Dispose instance",
  140. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  141. "responses": {
  142. "200": {
  143. "description": "Global disposed",
  144. "content": {
  145. "application/json": {
  146. "schema": {
  147. "type": "boolean"
  148. }
  149. }
  150. }
  151. }
  152. },
  153. "x-codeSamples": [
  154. {
  155. "lang": "js",
  156. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  157. }
  158. ]
  159. }
  160. },
  161. "/global/upgrade": {
  162. "post": {
  163. "operationId": "global.upgrade",
  164. "summary": "Upgrade opencode",
  165. "description": "Upgrade opencode to the specified version or latest if not specified.",
  166. "responses": {
  167. "200": {
  168. "description": "Upgrade result",
  169. "content": {
  170. "application/json": {
  171. "schema": {
  172. "anyOf": [
  173. {
  174. "type": "object",
  175. "properties": {
  176. "success": {
  177. "type": "boolean",
  178. "const": true
  179. },
  180. "version": {
  181. "type": "string"
  182. }
  183. },
  184. "required": ["success", "version"]
  185. },
  186. {
  187. "type": "object",
  188. "properties": {
  189. "success": {
  190. "type": "boolean",
  191. "const": false
  192. },
  193. "error": {
  194. "type": "string"
  195. }
  196. },
  197. "required": ["success", "error"]
  198. }
  199. ]
  200. }
  201. }
  202. }
  203. },
  204. "400": {
  205. "description": "Bad request",
  206. "content": {
  207. "application/json": {
  208. "schema": {
  209. "$ref": "#/components/schemas/BadRequestError"
  210. }
  211. }
  212. }
  213. }
  214. },
  215. "requestBody": {
  216. "content": {
  217. "application/json": {
  218. "schema": {
  219. "type": "object",
  220. "properties": {
  221. "target": {
  222. "type": "string"
  223. }
  224. }
  225. }
  226. }
  227. }
  228. },
  229. "x-codeSamples": [
  230. {
  231. "lang": "js",
  232. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  233. }
  234. ]
  235. }
  236. },
  237. "/auth/{providerID}": {
  238. "put": {
  239. "operationId": "auth.set",
  240. "summary": "Set auth credentials",
  241. "description": "Set authentication credentials",
  242. "responses": {
  243. "200": {
  244. "description": "Successfully set authentication credentials",
  245. "content": {
  246. "application/json": {
  247. "schema": {
  248. "type": "boolean"
  249. }
  250. }
  251. }
  252. },
  253. "400": {
  254. "description": "Bad request",
  255. "content": {
  256. "application/json": {
  257. "schema": {
  258. "$ref": "#/components/schemas/BadRequestError"
  259. }
  260. }
  261. }
  262. }
  263. },
  264. "parameters": [
  265. {
  266. "in": "path",
  267. "name": "providerID",
  268. "schema": {
  269. "type": "string"
  270. },
  271. "required": true
  272. }
  273. ],
  274. "requestBody": {
  275. "content": {
  276. "application/json": {
  277. "schema": {
  278. "$ref": "#/components/schemas/Auth"
  279. }
  280. }
  281. }
  282. },
  283. "x-codeSamples": [
  284. {
  285. "lang": "js",
  286. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  287. }
  288. ]
  289. },
  290. "delete": {
  291. "operationId": "auth.remove",
  292. "summary": "Remove auth credentials",
  293. "description": "Remove authentication credentials",
  294. "responses": {
  295. "200": {
  296. "description": "Successfully removed authentication credentials",
  297. "content": {
  298. "application/json": {
  299. "schema": {
  300. "type": "boolean"
  301. }
  302. }
  303. }
  304. },
  305. "400": {
  306. "description": "Bad request",
  307. "content": {
  308. "application/json": {
  309. "schema": {
  310. "$ref": "#/components/schemas/BadRequestError"
  311. }
  312. }
  313. }
  314. }
  315. },
  316. "parameters": [
  317. {
  318. "in": "path",
  319. "name": "providerID",
  320. "schema": {
  321. "type": "string"
  322. },
  323. "required": true
  324. }
  325. ],
  326. "x-codeSamples": [
  327. {
  328. "lang": "js",
  329. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  330. }
  331. ]
  332. }
  333. },
  334. "/log": {
  335. "post": {
  336. "operationId": "app.log",
  337. "parameters": [
  338. {
  339. "in": "query",
  340. "name": "directory",
  341. "schema": {
  342. "type": "string"
  343. }
  344. },
  345. {
  346. "in": "query",
  347. "name": "workspace",
  348. "schema": {
  349. "type": "string"
  350. }
  351. }
  352. ],
  353. "summary": "Write log",
  354. "description": "Write a log entry to the server logs with specified level and metadata.",
  355. "responses": {
  356. "200": {
  357. "description": "Log entry written successfully",
  358. "content": {
  359. "application/json": {
  360. "schema": {
  361. "type": "boolean"
  362. }
  363. }
  364. }
  365. },
  366. "400": {
  367. "description": "Bad request",
  368. "content": {
  369. "application/json": {
  370. "schema": {
  371. "$ref": "#/components/schemas/BadRequestError"
  372. }
  373. }
  374. }
  375. }
  376. },
  377. "requestBody": {
  378. "content": {
  379. "application/json": {
  380. "schema": {
  381. "type": "object",
  382. "properties": {
  383. "service": {
  384. "description": "Service name for the log entry",
  385. "type": "string"
  386. },
  387. "level": {
  388. "description": "Log level",
  389. "type": "string",
  390. "enum": ["debug", "info", "error", "warn"]
  391. },
  392. "message": {
  393. "description": "Log message",
  394. "type": "string"
  395. },
  396. "extra": {
  397. "description": "Additional metadata for the log entry",
  398. "type": "object",
  399. "propertyNames": {
  400. "type": "string"
  401. },
  402. "additionalProperties": {}
  403. }
  404. },
  405. "required": ["service", "level", "message"]
  406. }
  407. }
  408. }
  409. },
  410. "x-codeSamples": [
  411. {
  412. "lang": "js",
  413. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  414. }
  415. ]
  416. }
  417. },
  418. "/project": {
  419. "get": {
  420. "operationId": "project.list",
  421. "parameters": [
  422. {
  423. "in": "query",
  424. "name": "directory",
  425. "schema": {
  426. "type": "string"
  427. }
  428. },
  429. {
  430. "in": "query",
  431. "name": "workspace",
  432. "schema": {
  433. "type": "string"
  434. }
  435. }
  436. ],
  437. "summary": "List all projects",
  438. "description": "Get a list of projects that have been opened with OpenCode.",
  439. "responses": {
  440. "200": {
  441. "description": "List of projects",
  442. "content": {
  443. "application/json": {
  444. "schema": {
  445. "type": "array",
  446. "items": {
  447. "$ref": "#/components/schemas/Project"
  448. }
  449. }
  450. }
  451. }
  452. }
  453. },
  454. "x-codeSamples": [
  455. {
  456. "lang": "js",
  457. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  458. }
  459. ]
  460. }
  461. },
  462. "/project/current": {
  463. "get": {
  464. "operationId": "project.current",
  465. "parameters": [
  466. {
  467. "in": "query",
  468. "name": "directory",
  469. "schema": {
  470. "type": "string"
  471. }
  472. },
  473. {
  474. "in": "query",
  475. "name": "workspace",
  476. "schema": {
  477. "type": "string"
  478. }
  479. }
  480. ],
  481. "summary": "Get current project",
  482. "description": "Retrieve the currently active project that OpenCode is working with.",
  483. "responses": {
  484. "200": {
  485. "description": "Current project information",
  486. "content": {
  487. "application/json": {
  488. "schema": {
  489. "$ref": "#/components/schemas/Project"
  490. }
  491. }
  492. }
  493. }
  494. },
  495. "x-codeSamples": [
  496. {
  497. "lang": "js",
  498. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  499. }
  500. ]
  501. }
  502. },
  503. "/project/git/init": {
  504. "post": {
  505. "operationId": "project.initGit",
  506. "parameters": [
  507. {
  508. "in": "query",
  509. "name": "directory",
  510. "schema": {
  511. "type": "string"
  512. }
  513. },
  514. {
  515. "in": "query",
  516. "name": "workspace",
  517. "schema": {
  518. "type": "string"
  519. }
  520. }
  521. ],
  522. "summary": "Initialize git repository",
  523. "description": "Create a git repository for the current project and return the refreshed project info.",
  524. "responses": {
  525. "200": {
  526. "description": "Project information after git initialization",
  527. "content": {
  528. "application/json": {
  529. "schema": {
  530. "$ref": "#/components/schemas/Project"
  531. }
  532. }
  533. }
  534. }
  535. },
  536. "x-codeSamples": [
  537. {
  538. "lang": "js",
  539. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  540. }
  541. ]
  542. }
  543. },
  544. "/project/{projectID}": {
  545. "patch": {
  546. "operationId": "project.update",
  547. "parameters": [
  548. {
  549. "in": "query",
  550. "name": "directory",
  551. "schema": {
  552. "type": "string"
  553. }
  554. },
  555. {
  556. "in": "query",
  557. "name": "workspace",
  558. "schema": {
  559. "type": "string"
  560. }
  561. },
  562. {
  563. "in": "path",
  564. "name": "projectID",
  565. "schema": {
  566. "type": "string"
  567. },
  568. "required": true
  569. }
  570. ],
  571. "summary": "Update project",
  572. "description": "Update project properties such as name, icon, and commands.",
  573. "responses": {
  574. "200": {
  575. "description": "Updated project information",
  576. "content": {
  577. "application/json": {
  578. "schema": {
  579. "$ref": "#/components/schemas/Project"
  580. }
  581. }
  582. }
  583. },
  584. "400": {
  585. "description": "Bad request",
  586. "content": {
  587. "application/json": {
  588. "schema": {
  589. "$ref": "#/components/schemas/BadRequestError"
  590. }
  591. }
  592. }
  593. },
  594. "404": {
  595. "description": "Not found",
  596. "content": {
  597. "application/json": {
  598. "schema": {
  599. "$ref": "#/components/schemas/NotFoundError"
  600. }
  601. }
  602. }
  603. }
  604. },
  605. "requestBody": {
  606. "content": {
  607. "application/json": {
  608. "schema": {
  609. "type": "object",
  610. "properties": {
  611. "name": {
  612. "type": "string"
  613. },
  614. "icon": {
  615. "type": "object",
  616. "properties": {
  617. "url": {
  618. "type": "string"
  619. },
  620. "override": {
  621. "type": "string"
  622. },
  623. "color": {
  624. "type": "string"
  625. }
  626. }
  627. },
  628. "commands": {
  629. "type": "object",
  630. "properties": {
  631. "start": {
  632. "description": "Startup script to run when creating a new workspace (worktree)",
  633. "type": "string"
  634. }
  635. }
  636. }
  637. }
  638. }
  639. }
  640. }
  641. },
  642. "x-codeSamples": [
  643. {
  644. "lang": "js",
  645. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  646. }
  647. ]
  648. }
  649. },
  650. "/pty": {
  651. "get": {
  652. "operationId": "pty.list",
  653. "parameters": [
  654. {
  655. "in": "query",
  656. "name": "directory",
  657. "schema": {
  658. "type": "string"
  659. }
  660. },
  661. {
  662. "in": "query",
  663. "name": "workspace",
  664. "schema": {
  665. "type": "string"
  666. }
  667. }
  668. ],
  669. "summary": "List PTY sessions",
  670. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  671. "responses": {
  672. "200": {
  673. "description": "List of sessions",
  674. "content": {
  675. "application/json": {
  676. "schema": {
  677. "type": "array",
  678. "items": {
  679. "$ref": "#/components/schemas/Pty"
  680. }
  681. }
  682. }
  683. }
  684. }
  685. },
  686. "x-codeSamples": [
  687. {
  688. "lang": "js",
  689. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  690. }
  691. ]
  692. },
  693. "post": {
  694. "operationId": "pty.create",
  695. "parameters": [
  696. {
  697. "in": "query",
  698. "name": "directory",
  699. "schema": {
  700. "type": "string"
  701. }
  702. },
  703. {
  704. "in": "query",
  705. "name": "workspace",
  706. "schema": {
  707. "type": "string"
  708. }
  709. }
  710. ],
  711. "summary": "Create PTY session",
  712. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  713. "responses": {
  714. "200": {
  715. "description": "Created session",
  716. "content": {
  717. "application/json": {
  718. "schema": {
  719. "$ref": "#/components/schemas/Pty"
  720. }
  721. }
  722. }
  723. },
  724. "400": {
  725. "description": "Bad request",
  726. "content": {
  727. "application/json": {
  728. "schema": {
  729. "$ref": "#/components/schemas/BadRequestError"
  730. }
  731. }
  732. }
  733. }
  734. },
  735. "requestBody": {
  736. "content": {
  737. "application/json": {
  738. "schema": {
  739. "type": "object",
  740. "properties": {
  741. "command": {
  742. "type": "string"
  743. },
  744. "args": {
  745. "type": "array",
  746. "items": {
  747. "type": "string"
  748. }
  749. },
  750. "cwd": {
  751. "type": "string"
  752. },
  753. "title": {
  754. "type": "string"
  755. },
  756. "env": {
  757. "type": "object",
  758. "propertyNames": {
  759. "type": "string"
  760. },
  761. "additionalProperties": {
  762. "type": "string"
  763. }
  764. }
  765. }
  766. }
  767. }
  768. }
  769. },
  770. "x-codeSamples": [
  771. {
  772. "lang": "js",
  773. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  774. }
  775. ]
  776. }
  777. },
  778. "/pty/{ptyID}": {
  779. "get": {
  780. "operationId": "pty.get",
  781. "parameters": [
  782. {
  783. "in": "query",
  784. "name": "directory",
  785. "schema": {
  786. "type": "string"
  787. }
  788. },
  789. {
  790. "in": "query",
  791. "name": "workspace",
  792. "schema": {
  793. "type": "string"
  794. }
  795. },
  796. {
  797. "in": "path",
  798. "name": "ptyID",
  799. "schema": {
  800. "type": "string",
  801. "pattern": "^pty.*"
  802. },
  803. "required": true
  804. }
  805. ],
  806. "summary": "Get PTY session",
  807. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  808. "responses": {
  809. "200": {
  810. "description": "Session info",
  811. "content": {
  812. "application/json": {
  813. "schema": {
  814. "$ref": "#/components/schemas/Pty"
  815. }
  816. }
  817. }
  818. },
  819. "404": {
  820. "description": "Not found",
  821. "content": {
  822. "application/json": {
  823. "schema": {
  824. "$ref": "#/components/schemas/NotFoundError"
  825. }
  826. }
  827. }
  828. }
  829. },
  830. "x-codeSamples": [
  831. {
  832. "lang": "js",
  833. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  834. }
  835. ]
  836. },
  837. "put": {
  838. "operationId": "pty.update",
  839. "parameters": [
  840. {
  841. "in": "query",
  842. "name": "directory",
  843. "schema": {
  844. "type": "string"
  845. }
  846. },
  847. {
  848. "in": "query",
  849. "name": "workspace",
  850. "schema": {
  851. "type": "string"
  852. }
  853. },
  854. {
  855. "in": "path",
  856. "name": "ptyID",
  857. "schema": {
  858. "type": "string",
  859. "pattern": "^pty.*"
  860. },
  861. "required": true
  862. }
  863. ],
  864. "summary": "Update PTY session",
  865. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  866. "responses": {
  867. "200": {
  868. "description": "Updated session",
  869. "content": {
  870. "application/json": {
  871. "schema": {
  872. "$ref": "#/components/schemas/Pty"
  873. }
  874. }
  875. }
  876. },
  877. "400": {
  878. "description": "Bad request",
  879. "content": {
  880. "application/json": {
  881. "schema": {
  882. "$ref": "#/components/schemas/BadRequestError"
  883. }
  884. }
  885. }
  886. }
  887. },
  888. "requestBody": {
  889. "content": {
  890. "application/json": {
  891. "schema": {
  892. "type": "object",
  893. "properties": {
  894. "title": {
  895. "type": "string"
  896. },
  897. "size": {
  898. "type": "object",
  899. "properties": {
  900. "rows": {
  901. "type": "number"
  902. },
  903. "cols": {
  904. "type": "number"
  905. }
  906. },
  907. "required": ["rows", "cols"]
  908. }
  909. }
  910. }
  911. }
  912. }
  913. },
  914. "x-codeSamples": [
  915. {
  916. "lang": "js",
  917. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  918. }
  919. ]
  920. },
  921. "delete": {
  922. "operationId": "pty.remove",
  923. "parameters": [
  924. {
  925. "in": "query",
  926. "name": "directory",
  927. "schema": {
  928. "type": "string"
  929. }
  930. },
  931. {
  932. "in": "query",
  933. "name": "workspace",
  934. "schema": {
  935. "type": "string"
  936. }
  937. },
  938. {
  939. "in": "path",
  940. "name": "ptyID",
  941. "schema": {
  942. "type": "string",
  943. "pattern": "^pty.*"
  944. },
  945. "required": true
  946. }
  947. ],
  948. "summary": "Remove PTY session",
  949. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  950. "responses": {
  951. "200": {
  952. "description": "Session removed",
  953. "content": {
  954. "application/json": {
  955. "schema": {
  956. "type": "boolean"
  957. }
  958. }
  959. }
  960. },
  961. "404": {
  962. "description": "Not found",
  963. "content": {
  964. "application/json": {
  965. "schema": {
  966. "$ref": "#/components/schemas/NotFoundError"
  967. }
  968. }
  969. }
  970. }
  971. },
  972. "x-codeSamples": [
  973. {
  974. "lang": "js",
  975. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  976. }
  977. ]
  978. }
  979. },
  980. "/pty/{ptyID}/connect": {
  981. "get": {
  982. "operationId": "pty.connect",
  983. "parameters": [
  984. {
  985. "in": "query",
  986. "name": "directory",
  987. "schema": {
  988. "type": "string"
  989. }
  990. },
  991. {
  992. "in": "query",
  993. "name": "workspace",
  994. "schema": {
  995. "type": "string"
  996. }
  997. },
  998. {
  999. "in": "path",
  1000. "name": "ptyID",
  1001. "schema": {
  1002. "type": "string",
  1003. "pattern": "^pty.*"
  1004. },
  1005. "required": true
  1006. }
  1007. ],
  1008. "summary": "Connect to PTY session",
  1009. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  1010. "responses": {
  1011. "200": {
  1012. "description": "Connected session",
  1013. "content": {
  1014. "application/json": {
  1015. "schema": {
  1016. "type": "boolean"
  1017. }
  1018. }
  1019. }
  1020. },
  1021. "404": {
  1022. "description": "Not found",
  1023. "content": {
  1024. "application/json": {
  1025. "schema": {
  1026. "$ref": "#/components/schemas/NotFoundError"
  1027. }
  1028. }
  1029. }
  1030. }
  1031. },
  1032. "x-codeSamples": [
  1033. {
  1034. "lang": "js",
  1035. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  1036. }
  1037. ]
  1038. }
  1039. },
  1040. "/config": {
  1041. "get": {
  1042. "operationId": "config.get",
  1043. "parameters": [
  1044. {
  1045. "in": "query",
  1046. "name": "directory",
  1047. "schema": {
  1048. "type": "string"
  1049. }
  1050. },
  1051. {
  1052. "in": "query",
  1053. "name": "workspace",
  1054. "schema": {
  1055. "type": "string"
  1056. }
  1057. }
  1058. ],
  1059. "summary": "Get configuration",
  1060. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  1061. "responses": {
  1062. "200": {
  1063. "description": "Get config info",
  1064. "content": {
  1065. "application/json": {
  1066. "schema": {
  1067. "$ref": "#/components/schemas/Config"
  1068. }
  1069. }
  1070. }
  1071. }
  1072. },
  1073. "x-codeSamples": [
  1074. {
  1075. "lang": "js",
  1076. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  1077. }
  1078. ]
  1079. },
  1080. "patch": {
  1081. "operationId": "config.update",
  1082. "parameters": [
  1083. {
  1084. "in": "query",
  1085. "name": "directory",
  1086. "schema": {
  1087. "type": "string"
  1088. }
  1089. },
  1090. {
  1091. "in": "query",
  1092. "name": "workspace",
  1093. "schema": {
  1094. "type": "string"
  1095. }
  1096. }
  1097. ],
  1098. "summary": "Update configuration",
  1099. "description": "Update OpenCode configuration settings and preferences.",
  1100. "responses": {
  1101. "200": {
  1102. "description": "Successfully updated config",
  1103. "content": {
  1104. "application/json": {
  1105. "schema": {
  1106. "$ref": "#/components/schemas/Config"
  1107. }
  1108. }
  1109. }
  1110. },
  1111. "400": {
  1112. "description": "Bad request",
  1113. "content": {
  1114. "application/json": {
  1115. "schema": {
  1116. "$ref": "#/components/schemas/BadRequestError"
  1117. }
  1118. }
  1119. }
  1120. }
  1121. },
  1122. "requestBody": {
  1123. "content": {
  1124. "application/json": {
  1125. "schema": {
  1126. "$ref": "#/components/schemas/Config"
  1127. }
  1128. }
  1129. }
  1130. },
  1131. "x-codeSamples": [
  1132. {
  1133. "lang": "js",
  1134. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  1135. }
  1136. ]
  1137. }
  1138. },
  1139. "/config/providers": {
  1140. "get": {
  1141. "operationId": "config.providers",
  1142. "parameters": [
  1143. {
  1144. "in": "query",
  1145. "name": "directory",
  1146. "schema": {
  1147. "type": "string"
  1148. }
  1149. },
  1150. {
  1151. "in": "query",
  1152. "name": "workspace",
  1153. "schema": {
  1154. "type": "string"
  1155. }
  1156. }
  1157. ],
  1158. "summary": "List config providers",
  1159. "description": "Get a list of all configured AI providers and their default models.",
  1160. "responses": {
  1161. "200": {
  1162. "description": "List of providers",
  1163. "content": {
  1164. "application/json": {
  1165. "schema": {
  1166. "type": "object",
  1167. "properties": {
  1168. "providers": {
  1169. "type": "array",
  1170. "items": {
  1171. "$ref": "#/components/schemas/Provider"
  1172. }
  1173. },
  1174. "default": {
  1175. "type": "object",
  1176. "propertyNames": {
  1177. "type": "string"
  1178. },
  1179. "additionalProperties": {
  1180. "type": "string"
  1181. }
  1182. }
  1183. },
  1184. "required": ["providers", "default"]
  1185. }
  1186. }
  1187. }
  1188. }
  1189. },
  1190. "x-codeSamples": [
  1191. {
  1192. "lang": "js",
  1193. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  1194. }
  1195. ]
  1196. }
  1197. },
  1198. "/experimental/console": {
  1199. "get": {
  1200. "operationId": "experimental.console.get",
  1201. "parameters": [
  1202. {
  1203. "in": "query",
  1204. "name": "directory",
  1205. "schema": {
  1206. "type": "string"
  1207. }
  1208. },
  1209. {
  1210. "in": "query",
  1211. "name": "workspace",
  1212. "schema": {
  1213. "type": "string"
  1214. }
  1215. }
  1216. ],
  1217. "summary": "Get active Console provider metadata",
  1218. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  1219. "responses": {
  1220. "200": {
  1221. "description": "Active Console provider metadata",
  1222. "content": {
  1223. "application/json": {
  1224. "schema": {
  1225. "type": "object",
  1226. "properties": {
  1227. "consoleManagedProviders": {
  1228. "type": "array",
  1229. "items": {
  1230. "type": "string"
  1231. }
  1232. },
  1233. "activeOrgName": {
  1234. "type": "string"
  1235. },
  1236. "switchableOrgCount": {
  1237. "type": "integer",
  1238. "minimum": 0,
  1239. "maximum": 9007199254740991
  1240. }
  1241. },
  1242. "required": ["consoleManagedProviders", "switchableOrgCount"]
  1243. }
  1244. }
  1245. }
  1246. }
  1247. },
  1248. "x-codeSamples": [
  1249. {
  1250. "lang": "js",
  1251. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  1252. }
  1253. ]
  1254. }
  1255. },
  1256. "/experimental/console/orgs": {
  1257. "get": {
  1258. "operationId": "experimental.console.listOrgs",
  1259. "parameters": [
  1260. {
  1261. "in": "query",
  1262. "name": "directory",
  1263. "schema": {
  1264. "type": "string"
  1265. }
  1266. },
  1267. {
  1268. "in": "query",
  1269. "name": "workspace",
  1270. "schema": {
  1271. "type": "string"
  1272. }
  1273. }
  1274. ],
  1275. "summary": "List switchable Console orgs",
  1276. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  1277. "responses": {
  1278. "200": {
  1279. "description": "Switchable Console orgs",
  1280. "content": {
  1281. "application/json": {
  1282. "schema": {
  1283. "type": "object",
  1284. "properties": {
  1285. "orgs": {
  1286. "type": "array",
  1287. "items": {
  1288. "type": "object",
  1289. "properties": {
  1290. "accountID": {
  1291. "type": "string"
  1292. },
  1293. "accountEmail": {
  1294. "type": "string"
  1295. },
  1296. "accountUrl": {
  1297. "type": "string"
  1298. },
  1299. "orgID": {
  1300. "type": "string"
  1301. },
  1302. "orgName": {
  1303. "type": "string"
  1304. },
  1305. "active": {
  1306. "type": "boolean"
  1307. }
  1308. },
  1309. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"]
  1310. }
  1311. }
  1312. },
  1313. "required": ["orgs"]
  1314. }
  1315. }
  1316. }
  1317. }
  1318. },
  1319. "x-codeSamples": [
  1320. {
  1321. "lang": "js",
  1322. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  1323. }
  1324. ]
  1325. }
  1326. },
  1327. "/experimental/console/switch": {
  1328. "post": {
  1329. "operationId": "experimental.console.switchOrg",
  1330. "parameters": [
  1331. {
  1332. "in": "query",
  1333. "name": "directory",
  1334. "schema": {
  1335. "type": "string"
  1336. }
  1337. },
  1338. {
  1339. "in": "query",
  1340. "name": "workspace",
  1341. "schema": {
  1342. "type": "string"
  1343. }
  1344. }
  1345. ],
  1346. "summary": "Switch active Console org",
  1347. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  1348. "responses": {
  1349. "200": {
  1350. "description": "Switch success",
  1351. "content": {
  1352. "application/json": {
  1353. "schema": {
  1354. "type": "boolean"
  1355. }
  1356. }
  1357. }
  1358. }
  1359. },
  1360. "requestBody": {
  1361. "content": {
  1362. "application/json": {
  1363. "schema": {
  1364. "type": "object",
  1365. "properties": {
  1366. "accountID": {
  1367. "type": "string"
  1368. },
  1369. "orgID": {
  1370. "type": "string"
  1371. }
  1372. },
  1373. "required": ["accountID", "orgID"]
  1374. }
  1375. }
  1376. }
  1377. },
  1378. "x-codeSamples": [
  1379. {
  1380. "lang": "js",
  1381. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  1382. }
  1383. ]
  1384. }
  1385. },
  1386. "/experimental/tool/ids": {
  1387. "get": {
  1388. "operationId": "tool.ids",
  1389. "parameters": [
  1390. {
  1391. "in": "query",
  1392. "name": "directory",
  1393. "schema": {
  1394. "type": "string"
  1395. }
  1396. },
  1397. {
  1398. "in": "query",
  1399. "name": "workspace",
  1400. "schema": {
  1401. "type": "string"
  1402. }
  1403. }
  1404. ],
  1405. "summary": "List tool IDs",
  1406. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  1407. "responses": {
  1408. "200": {
  1409. "description": "Tool IDs",
  1410. "content": {
  1411. "application/json": {
  1412. "schema": {
  1413. "$ref": "#/components/schemas/ToolIDs"
  1414. }
  1415. }
  1416. }
  1417. },
  1418. "400": {
  1419. "description": "Bad request",
  1420. "content": {
  1421. "application/json": {
  1422. "schema": {
  1423. "$ref": "#/components/schemas/BadRequestError"
  1424. }
  1425. }
  1426. }
  1427. }
  1428. },
  1429. "x-codeSamples": [
  1430. {
  1431. "lang": "js",
  1432. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  1433. }
  1434. ]
  1435. }
  1436. },
  1437. "/experimental/tool": {
  1438. "get": {
  1439. "operationId": "tool.list",
  1440. "parameters": [
  1441. {
  1442. "in": "query",
  1443. "name": "directory",
  1444. "schema": {
  1445. "type": "string"
  1446. }
  1447. },
  1448. {
  1449. "in": "query",
  1450. "name": "workspace",
  1451. "schema": {
  1452. "type": "string"
  1453. }
  1454. },
  1455. {
  1456. "in": "query",
  1457. "name": "provider",
  1458. "schema": {
  1459. "type": "string"
  1460. },
  1461. "required": true
  1462. },
  1463. {
  1464. "in": "query",
  1465. "name": "model",
  1466. "schema": {
  1467. "type": "string"
  1468. },
  1469. "required": true
  1470. }
  1471. ],
  1472. "summary": "List tools",
  1473. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  1474. "responses": {
  1475. "200": {
  1476. "description": "Tools",
  1477. "content": {
  1478. "application/json": {
  1479. "schema": {
  1480. "$ref": "#/components/schemas/ToolList"
  1481. }
  1482. }
  1483. }
  1484. },
  1485. "400": {
  1486. "description": "Bad request",
  1487. "content": {
  1488. "application/json": {
  1489. "schema": {
  1490. "$ref": "#/components/schemas/BadRequestError"
  1491. }
  1492. }
  1493. }
  1494. }
  1495. },
  1496. "x-codeSamples": [
  1497. {
  1498. "lang": "js",
  1499. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  1500. }
  1501. ]
  1502. }
  1503. },
  1504. "/experimental/workspace/adaptor": {
  1505. "get": {
  1506. "operationId": "experimental.workspace.adaptor.list",
  1507. "parameters": [
  1508. {
  1509. "in": "query",
  1510. "name": "directory",
  1511. "schema": {
  1512. "type": "string"
  1513. }
  1514. },
  1515. {
  1516. "in": "query",
  1517. "name": "workspace",
  1518. "schema": {
  1519. "type": "string"
  1520. }
  1521. }
  1522. ],
  1523. "summary": "List workspace adaptors",
  1524. "description": "List all available workspace adaptors for the current project.",
  1525. "responses": {
  1526. "200": {
  1527. "description": "Workspace adaptors",
  1528. "content": {
  1529. "application/json": {
  1530. "schema": {
  1531. "type": "array",
  1532. "items": {
  1533. "type": "object",
  1534. "properties": {
  1535. "type": {
  1536. "type": "string"
  1537. },
  1538. "name": {
  1539. "type": "string"
  1540. },
  1541. "description": {
  1542. "type": "string"
  1543. }
  1544. },
  1545. "required": ["type", "name", "description"]
  1546. }
  1547. }
  1548. }
  1549. }
  1550. }
  1551. },
  1552. "x-codeSamples": [
  1553. {
  1554. "lang": "js",
  1555. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adaptor.list({\n ...\n})"
  1556. }
  1557. ]
  1558. }
  1559. },
  1560. "/experimental/workspace": {
  1561. "post": {
  1562. "operationId": "experimental.workspace.create",
  1563. "parameters": [
  1564. {
  1565. "in": "query",
  1566. "name": "directory",
  1567. "schema": {
  1568. "type": "string"
  1569. }
  1570. },
  1571. {
  1572. "in": "query",
  1573. "name": "workspace",
  1574. "schema": {
  1575. "type": "string"
  1576. }
  1577. }
  1578. ],
  1579. "summary": "Create workspace",
  1580. "description": "Create a workspace for the current project.",
  1581. "responses": {
  1582. "200": {
  1583. "description": "Workspace created",
  1584. "content": {
  1585. "application/json": {
  1586. "schema": {
  1587. "$ref": "#/components/schemas/Workspace"
  1588. }
  1589. }
  1590. }
  1591. },
  1592. "400": {
  1593. "description": "Bad request",
  1594. "content": {
  1595. "application/json": {
  1596. "schema": {
  1597. "$ref": "#/components/schemas/BadRequestError"
  1598. }
  1599. }
  1600. }
  1601. }
  1602. },
  1603. "requestBody": {
  1604. "content": {
  1605. "application/json": {
  1606. "schema": {
  1607. "type": "object",
  1608. "properties": {
  1609. "id": {
  1610. "type": "string",
  1611. "pattern": "^wrk.*"
  1612. },
  1613. "type": {
  1614. "type": "string"
  1615. },
  1616. "branch": {
  1617. "anyOf": [
  1618. {
  1619. "type": "string"
  1620. },
  1621. {
  1622. "type": "null"
  1623. }
  1624. ]
  1625. },
  1626. "extra": {
  1627. "anyOf": [
  1628. {},
  1629. {
  1630. "type": "null"
  1631. }
  1632. ]
  1633. }
  1634. },
  1635. "required": ["type", "branch", "extra"]
  1636. }
  1637. }
  1638. }
  1639. },
  1640. "x-codeSamples": [
  1641. {
  1642. "lang": "js",
  1643. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  1644. }
  1645. ]
  1646. },
  1647. "get": {
  1648. "operationId": "experimental.workspace.list",
  1649. "parameters": [
  1650. {
  1651. "in": "query",
  1652. "name": "directory",
  1653. "schema": {
  1654. "type": "string"
  1655. }
  1656. },
  1657. {
  1658. "in": "query",
  1659. "name": "workspace",
  1660. "schema": {
  1661. "type": "string"
  1662. }
  1663. }
  1664. ],
  1665. "summary": "List workspaces",
  1666. "description": "List all workspaces.",
  1667. "responses": {
  1668. "200": {
  1669. "description": "Workspaces",
  1670. "content": {
  1671. "application/json": {
  1672. "schema": {
  1673. "type": "array",
  1674. "items": {
  1675. "$ref": "#/components/schemas/Workspace"
  1676. }
  1677. }
  1678. }
  1679. }
  1680. }
  1681. },
  1682. "x-codeSamples": [
  1683. {
  1684. "lang": "js",
  1685. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  1686. }
  1687. ]
  1688. }
  1689. },
  1690. "/experimental/workspace/status": {
  1691. "get": {
  1692. "operationId": "experimental.workspace.status",
  1693. "parameters": [
  1694. {
  1695. "in": "query",
  1696. "name": "directory",
  1697. "schema": {
  1698. "type": "string"
  1699. }
  1700. },
  1701. {
  1702. "in": "query",
  1703. "name": "workspace",
  1704. "schema": {
  1705. "type": "string"
  1706. }
  1707. }
  1708. ],
  1709. "summary": "Workspace status",
  1710. "description": "Get connection status for workspaces in the current project.",
  1711. "responses": {
  1712. "200": {
  1713. "description": "Workspace status",
  1714. "content": {
  1715. "application/json": {
  1716. "schema": {
  1717. "type": "array",
  1718. "items": {
  1719. "type": "object",
  1720. "properties": {
  1721. "workspaceID": {
  1722. "type": "string",
  1723. "pattern": "^wrk.*"
  1724. },
  1725. "status": {
  1726. "type": "string",
  1727. "enum": ["connected", "connecting", "disconnected", "error"]
  1728. },
  1729. "error": {
  1730. "type": "string"
  1731. }
  1732. },
  1733. "required": ["workspaceID", "status"]
  1734. }
  1735. }
  1736. }
  1737. }
  1738. }
  1739. },
  1740. "x-codeSamples": [
  1741. {
  1742. "lang": "js",
  1743. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  1744. }
  1745. ]
  1746. }
  1747. },
  1748. "/experimental/workspace/{id}": {
  1749. "delete": {
  1750. "operationId": "experimental.workspace.remove",
  1751. "parameters": [
  1752. {
  1753. "in": "query",
  1754. "name": "directory",
  1755. "schema": {
  1756. "type": "string"
  1757. }
  1758. },
  1759. {
  1760. "in": "query",
  1761. "name": "workspace",
  1762. "schema": {
  1763. "type": "string"
  1764. }
  1765. },
  1766. {
  1767. "in": "path",
  1768. "name": "id",
  1769. "schema": {
  1770. "type": "string",
  1771. "pattern": "^wrk.*"
  1772. },
  1773. "required": true
  1774. }
  1775. ],
  1776. "summary": "Remove workspace",
  1777. "description": "Remove an existing workspace.",
  1778. "responses": {
  1779. "200": {
  1780. "description": "Workspace removed",
  1781. "content": {
  1782. "application/json": {
  1783. "schema": {
  1784. "$ref": "#/components/schemas/Workspace"
  1785. }
  1786. }
  1787. }
  1788. },
  1789. "400": {
  1790. "description": "Bad request",
  1791. "content": {
  1792. "application/json": {
  1793. "schema": {
  1794. "$ref": "#/components/schemas/BadRequestError"
  1795. }
  1796. }
  1797. }
  1798. }
  1799. },
  1800. "x-codeSamples": [
  1801. {
  1802. "lang": "js",
  1803. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  1804. }
  1805. ]
  1806. }
  1807. },
  1808. "/experimental/worktree": {
  1809. "post": {
  1810. "operationId": "worktree.create",
  1811. "parameters": [
  1812. {
  1813. "in": "query",
  1814. "name": "directory",
  1815. "schema": {
  1816. "type": "string"
  1817. }
  1818. },
  1819. {
  1820. "in": "query",
  1821. "name": "workspace",
  1822. "schema": {
  1823. "type": "string"
  1824. }
  1825. }
  1826. ],
  1827. "summary": "Create worktree",
  1828. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1829. "responses": {
  1830. "200": {
  1831. "description": "Worktree created",
  1832. "content": {
  1833. "application/json": {
  1834. "schema": {
  1835. "$ref": "#/components/schemas/Worktree"
  1836. }
  1837. }
  1838. }
  1839. },
  1840. "400": {
  1841. "description": "Bad request",
  1842. "content": {
  1843. "application/json": {
  1844. "schema": {
  1845. "$ref": "#/components/schemas/BadRequestError"
  1846. }
  1847. }
  1848. }
  1849. }
  1850. },
  1851. "requestBody": {
  1852. "content": {
  1853. "application/json": {
  1854. "schema": {
  1855. "$ref": "#/components/schemas/WorktreeCreateInput"
  1856. }
  1857. }
  1858. }
  1859. },
  1860. "x-codeSamples": [
  1861. {
  1862. "lang": "js",
  1863. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1864. }
  1865. ]
  1866. },
  1867. "get": {
  1868. "operationId": "worktree.list",
  1869. "parameters": [
  1870. {
  1871. "in": "query",
  1872. "name": "directory",
  1873. "schema": {
  1874. "type": "string"
  1875. }
  1876. },
  1877. {
  1878. "in": "query",
  1879. "name": "workspace",
  1880. "schema": {
  1881. "type": "string"
  1882. }
  1883. }
  1884. ],
  1885. "summary": "List worktrees",
  1886. "description": "List all sandbox worktrees for the current project.",
  1887. "responses": {
  1888. "200": {
  1889. "description": "List of worktree directories",
  1890. "content": {
  1891. "application/json": {
  1892. "schema": {
  1893. "type": "array",
  1894. "items": {
  1895. "type": "string"
  1896. }
  1897. }
  1898. }
  1899. }
  1900. }
  1901. },
  1902. "x-codeSamples": [
  1903. {
  1904. "lang": "js",
  1905. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1906. }
  1907. ]
  1908. },
  1909. "delete": {
  1910. "operationId": "worktree.remove",
  1911. "parameters": [
  1912. {
  1913. "in": "query",
  1914. "name": "directory",
  1915. "schema": {
  1916. "type": "string"
  1917. }
  1918. },
  1919. {
  1920. "in": "query",
  1921. "name": "workspace",
  1922. "schema": {
  1923. "type": "string"
  1924. }
  1925. }
  1926. ],
  1927. "summary": "Remove worktree",
  1928. "description": "Remove a git worktree and delete its branch.",
  1929. "responses": {
  1930. "200": {
  1931. "description": "Worktree removed",
  1932. "content": {
  1933. "application/json": {
  1934. "schema": {
  1935. "type": "boolean"
  1936. }
  1937. }
  1938. }
  1939. },
  1940. "400": {
  1941. "description": "Bad request",
  1942. "content": {
  1943. "application/json": {
  1944. "schema": {
  1945. "$ref": "#/components/schemas/BadRequestError"
  1946. }
  1947. }
  1948. }
  1949. }
  1950. },
  1951. "requestBody": {
  1952. "content": {
  1953. "application/json": {
  1954. "schema": {
  1955. "$ref": "#/components/schemas/WorktreeRemoveInput"
  1956. }
  1957. }
  1958. }
  1959. },
  1960. "x-codeSamples": [
  1961. {
  1962. "lang": "js",
  1963. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  1964. }
  1965. ]
  1966. }
  1967. },
  1968. "/experimental/worktree/reset": {
  1969. "post": {
  1970. "operationId": "worktree.reset",
  1971. "parameters": [
  1972. {
  1973. "in": "query",
  1974. "name": "directory",
  1975. "schema": {
  1976. "type": "string"
  1977. }
  1978. },
  1979. {
  1980. "in": "query",
  1981. "name": "workspace",
  1982. "schema": {
  1983. "type": "string"
  1984. }
  1985. }
  1986. ],
  1987. "summary": "Reset worktree",
  1988. "description": "Reset a worktree branch to the primary default branch.",
  1989. "responses": {
  1990. "200": {
  1991. "description": "Worktree reset",
  1992. "content": {
  1993. "application/json": {
  1994. "schema": {
  1995. "type": "boolean"
  1996. }
  1997. }
  1998. }
  1999. },
  2000. "400": {
  2001. "description": "Bad request",
  2002. "content": {
  2003. "application/json": {
  2004. "schema": {
  2005. "$ref": "#/components/schemas/BadRequestError"
  2006. }
  2007. }
  2008. }
  2009. }
  2010. },
  2011. "requestBody": {
  2012. "content": {
  2013. "application/json": {
  2014. "schema": {
  2015. "$ref": "#/components/schemas/WorktreeResetInput"
  2016. }
  2017. }
  2018. }
  2019. },
  2020. "x-codeSamples": [
  2021. {
  2022. "lang": "js",
  2023. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  2024. }
  2025. ]
  2026. }
  2027. },
  2028. "/experimental/session": {
  2029. "get": {
  2030. "operationId": "experimental.session.list",
  2031. "parameters": [
  2032. {
  2033. "in": "query",
  2034. "name": "directory",
  2035. "schema": {
  2036. "type": "string"
  2037. },
  2038. "description": "Filter sessions by project directory"
  2039. },
  2040. {
  2041. "in": "query",
  2042. "name": "workspace",
  2043. "schema": {
  2044. "type": "string"
  2045. }
  2046. },
  2047. {
  2048. "in": "query",
  2049. "name": "roots",
  2050. "schema": {
  2051. "type": "boolean"
  2052. },
  2053. "description": "Only return root sessions (no parentID)"
  2054. },
  2055. {
  2056. "in": "query",
  2057. "name": "start",
  2058. "schema": {
  2059. "type": "number"
  2060. },
  2061. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2062. },
  2063. {
  2064. "in": "query",
  2065. "name": "cursor",
  2066. "schema": {
  2067. "type": "number"
  2068. },
  2069. "description": "Return sessions updated before this timestamp (milliseconds since epoch)"
  2070. },
  2071. {
  2072. "in": "query",
  2073. "name": "search",
  2074. "schema": {
  2075. "type": "string"
  2076. },
  2077. "description": "Filter sessions by title (case-insensitive)"
  2078. },
  2079. {
  2080. "in": "query",
  2081. "name": "limit",
  2082. "schema": {
  2083. "type": "number"
  2084. },
  2085. "description": "Maximum number of sessions to return"
  2086. },
  2087. {
  2088. "in": "query",
  2089. "name": "archived",
  2090. "schema": {
  2091. "type": "boolean"
  2092. },
  2093. "description": "Include archived sessions (default false)"
  2094. }
  2095. ],
  2096. "summary": "List sessions",
  2097. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  2098. "responses": {
  2099. "200": {
  2100. "description": "List of sessions",
  2101. "content": {
  2102. "application/json": {
  2103. "schema": {
  2104. "type": "array",
  2105. "items": {
  2106. "$ref": "#/components/schemas/GlobalSession"
  2107. }
  2108. }
  2109. }
  2110. }
  2111. }
  2112. },
  2113. "x-codeSamples": [
  2114. {
  2115. "lang": "js",
  2116. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  2117. }
  2118. ]
  2119. }
  2120. },
  2121. "/experimental/resource": {
  2122. "get": {
  2123. "operationId": "experimental.resource.list",
  2124. "parameters": [
  2125. {
  2126. "in": "query",
  2127. "name": "directory",
  2128. "schema": {
  2129. "type": "string"
  2130. }
  2131. },
  2132. {
  2133. "in": "query",
  2134. "name": "workspace",
  2135. "schema": {
  2136. "type": "string"
  2137. }
  2138. }
  2139. ],
  2140. "summary": "Get MCP resources",
  2141. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  2142. "responses": {
  2143. "200": {
  2144. "description": "MCP resources",
  2145. "content": {
  2146. "application/json": {
  2147. "schema": {
  2148. "type": "object",
  2149. "propertyNames": {
  2150. "type": "string"
  2151. },
  2152. "additionalProperties": {
  2153. "$ref": "#/components/schemas/McpResource"
  2154. }
  2155. }
  2156. }
  2157. }
  2158. }
  2159. },
  2160. "x-codeSamples": [
  2161. {
  2162. "lang": "js",
  2163. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  2164. }
  2165. ]
  2166. }
  2167. },
  2168. "/session": {
  2169. "get": {
  2170. "operationId": "session.list",
  2171. "parameters": [
  2172. {
  2173. "in": "query",
  2174. "name": "directory",
  2175. "schema": {
  2176. "type": "string"
  2177. },
  2178. "description": "Filter sessions by project directory"
  2179. },
  2180. {
  2181. "in": "query",
  2182. "name": "workspace",
  2183. "schema": {
  2184. "type": "string"
  2185. }
  2186. },
  2187. {
  2188. "in": "query",
  2189. "name": "roots",
  2190. "schema": {
  2191. "type": "boolean"
  2192. },
  2193. "description": "Only return root sessions (no parentID)"
  2194. },
  2195. {
  2196. "in": "query",
  2197. "name": "start",
  2198. "schema": {
  2199. "type": "number"
  2200. },
  2201. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2202. },
  2203. {
  2204. "in": "query",
  2205. "name": "search",
  2206. "schema": {
  2207. "type": "string"
  2208. },
  2209. "description": "Filter sessions by title (case-insensitive)"
  2210. },
  2211. {
  2212. "in": "query",
  2213. "name": "limit",
  2214. "schema": {
  2215. "type": "number"
  2216. },
  2217. "description": "Maximum number of sessions to return"
  2218. }
  2219. ],
  2220. "summary": "List sessions",
  2221. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  2222. "responses": {
  2223. "200": {
  2224. "description": "List of sessions",
  2225. "content": {
  2226. "application/json": {
  2227. "schema": {
  2228. "type": "array",
  2229. "items": {
  2230. "$ref": "#/components/schemas/Session"
  2231. }
  2232. }
  2233. }
  2234. }
  2235. }
  2236. },
  2237. "x-codeSamples": [
  2238. {
  2239. "lang": "js",
  2240. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  2241. }
  2242. ]
  2243. },
  2244. "post": {
  2245. "operationId": "session.create",
  2246. "parameters": [
  2247. {
  2248. "in": "query",
  2249. "name": "directory",
  2250. "schema": {
  2251. "type": "string"
  2252. }
  2253. },
  2254. {
  2255. "in": "query",
  2256. "name": "workspace",
  2257. "schema": {
  2258. "type": "string"
  2259. }
  2260. }
  2261. ],
  2262. "summary": "Create session",
  2263. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  2264. "responses": {
  2265. "200": {
  2266. "description": "Successfully created session",
  2267. "content": {
  2268. "application/json": {
  2269. "schema": {
  2270. "$ref": "#/components/schemas/Session"
  2271. }
  2272. }
  2273. }
  2274. },
  2275. "400": {
  2276. "description": "Bad request",
  2277. "content": {
  2278. "application/json": {
  2279. "schema": {
  2280. "$ref": "#/components/schemas/BadRequestError"
  2281. }
  2282. }
  2283. }
  2284. }
  2285. },
  2286. "requestBody": {
  2287. "content": {
  2288. "application/json": {
  2289. "schema": {
  2290. "type": "object",
  2291. "properties": {
  2292. "parentID": {
  2293. "type": "string",
  2294. "pattern": "^ses.*"
  2295. },
  2296. "title": {
  2297. "type": "string"
  2298. },
  2299. "permission": {
  2300. "$ref": "#/components/schemas/PermissionRuleset"
  2301. },
  2302. "workspaceID": {
  2303. "type": "string",
  2304. "pattern": "^wrk.*"
  2305. }
  2306. }
  2307. }
  2308. }
  2309. }
  2310. },
  2311. "x-codeSamples": [
  2312. {
  2313. "lang": "js",
  2314. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  2315. }
  2316. ]
  2317. }
  2318. },
  2319. "/session/status": {
  2320. "get": {
  2321. "operationId": "session.status",
  2322. "parameters": [
  2323. {
  2324. "in": "query",
  2325. "name": "directory",
  2326. "schema": {
  2327. "type": "string"
  2328. }
  2329. },
  2330. {
  2331. "in": "query",
  2332. "name": "workspace",
  2333. "schema": {
  2334. "type": "string"
  2335. }
  2336. }
  2337. ],
  2338. "summary": "Get session status",
  2339. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  2340. "responses": {
  2341. "200": {
  2342. "description": "Get session status",
  2343. "content": {
  2344. "application/json": {
  2345. "schema": {
  2346. "type": "object",
  2347. "propertyNames": {
  2348. "type": "string"
  2349. },
  2350. "additionalProperties": {
  2351. "$ref": "#/components/schemas/SessionStatus"
  2352. }
  2353. }
  2354. }
  2355. }
  2356. },
  2357. "400": {
  2358. "description": "Bad request",
  2359. "content": {
  2360. "application/json": {
  2361. "schema": {
  2362. "$ref": "#/components/schemas/BadRequestError"
  2363. }
  2364. }
  2365. }
  2366. }
  2367. },
  2368. "x-codeSamples": [
  2369. {
  2370. "lang": "js",
  2371. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  2372. }
  2373. ]
  2374. }
  2375. },
  2376. "/session/{sessionID}": {
  2377. "get": {
  2378. "operationId": "session.get",
  2379. "parameters": [
  2380. {
  2381. "in": "query",
  2382. "name": "directory",
  2383. "schema": {
  2384. "type": "string"
  2385. }
  2386. },
  2387. {
  2388. "in": "query",
  2389. "name": "workspace",
  2390. "schema": {
  2391. "type": "string"
  2392. }
  2393. },
  2394. {
  2395. "in": "path",
  2396. "name": "sessionID",
  2397. "schema": {
  2398. "type": "string",
  2399. "pattern": "^ses.*"
  2400. },
  2401. "required": true
  2402. }
  2403. ],
  2404. "summary": "Get session",
  2405. "description": "Retrieve detailed information about a specific OpenCode session.",
  2406. "tags": ["Session"],
  2407. "responses": {
  2408. "200": {
  2409. "description": "Get session",
  2410. "content": {
  2411. "application/json": {
  2412. "schema": {
  2413. "$ref": "#/components/schemas/Session"
  2414. }
  2415. }
  2416. }
  2417. },
  2418. "400": {
  2419. "description": "Bad request",
  2420. "content": {
  2421. "application/json": {
  2422. "schema": {
  2423. "$ref": "#/components/schemas/BadRequestError"
  2424. }
  2425. }
  2426. }
  2427. },
  2428. "404": {
  2429. "description": "Not found",
  2430. "content": {
  2431. "application/json": {
  2432. "schema": {
  2433. "$ref": "#/components/schemas/NotFoundError"
  2434. }
  2435. }
  2436. }
  2437. }
  2438. },
  2439. "x-codeSamples": [
  2440. {
  2441. "lang": "js",
  2442. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  2443. }
  2444. ]
  2445. },
  2446. "delete": {
  2447. "operationId": "session.delete",
  2448. "parameters": [
  2449. {
  2450. "in": "query",
  2451. "name": "directory",
  2452. "schema": {
  2453. "type": "string"
  2454. }
  2455. },
  2456. {
  2457. "in": "query",
  2458. "name": "workspace",
  2459. "schema": {
  2460. "type": "string"
  2461. }
  2462. },
  2463. {
  2464. "in": "path",
  2465. "name": "sessionID",
  2466. "schema": {
  2467. "type": "string",
  2468. "pattern": "^ses.*"
  2469. },
  2470. "required": true
  2471. }
  2472. ],
  2473. "summary": "Delete session",
  2474. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  2475. "responses": {
  2476. "200": {
  2477. "description": "Successfully deleted session",
  2478. "content": {
  2479. "application/json": {
  2480. "schema": {
  2481. "type": "boolean"
  2482. }
  2483. }
  2484. }
  2485. },
  2486. "400": {
  2487. "description": "Bad request",
  2488. "content": {
  2489. "application/json": {
  2490. "schema": {
  2491. "$ref": "#/components/schemas/BadRequestError"
  2492. }
  2493. }
  2494. }
  2495. },
  2496. "404": {
  2497. "description": "Not found",
  2498. "content": {
  2499. "application/json": {
  2500. "schema": {
  2501. "$ref": "#/components/schemas/NotFoundError"
  2502. }
  2503. }
  2504. }
  2505. }
  2506. },
  2507. "x-codeSamples": [
  2508. {
  2509. "lang": "js",
  2510. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  2511. }
  2512. ]
  2513. },
  2514. "patch": {
  2515. "operationId": "session.update",
  2516. "parameters": [
  2517. {
  2518. "in": "query",
  2519. "name": "directory",
  2520. "schema": {
  2521. "type": "string"
  2522. }
  2523. },
  2524. {
  2525. "in": "query",
  2526. "name": "workspace",
  2527. "schema": {
  2528. "type": "string"
  2529. }
  2530. },
  2531. {
  2532. "in": "path",
  2533. "name": "sessionID",
  2534. "schema": {
  2535. "type": "string",
  2536. "pattern": "^ses.*"
  2537. },
  2538. "required": true
  2539. }
  2540. ],
  2541. "summary": "Update session",
  2542. "description": "Update properties of an existing session, such as title or other metadata.",
  2543. "responses": {
  2544. "200": {
  2545. "description": "Successfully updated session",
  2546. "content": {
  2547. "application/json": {
  2548. "schema": {
  2549. "$ref": "#/components/schemas/Session"
  2550. }
  2551. }
  2552. }
  2553. },
  2554. "400": {
  2555. "description": "Bad request",
  2556. "content": {
  2557. "application/json": {
  2558. "schema": {
  2559. "$ref": "#/components/schemas/BadRequestError"
  2560. }
  2561. }
  2562. }
  2563. },
  2564. "404": {
  2565. "description": "Not found",
  2566. "content": {
  2567. "application/json": {
  2568. "schema": {
  2569. "$ref": "#/components/schemas/NotFoundError"
  2570. }
  2571. }
  2572. }
  2573. }
  2574. },
  2575. "requestBody": {
  2576. "content": {
  2577. "application/json": {
  2578. "schema": {
  2579. "type": "object",
  2580. "properties": {
  2581. "title": {
  2582. "type": "string"
  2583. },
  2584. "permission": {
  2585. "$ref": "#/components/schemas/PermissionRuleset"
  2586. },
  2587. "time": {
  2588. "type": "object",
  2589. "properties": {
  2590. "archived": {
  2591. "type": "number"
  2592. }
  2593. }
  2594. }
  2595. }
  2596. }
  2597. }
  2598. }
  2599. },
  2600. "x-codeSamples": [
  2601. {
  2602. "lang": "js",
  2603. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  2604. }
  2605. ]
  2606. }
  2607. },
  2608. "/session/{sessionID}/children": {
  2609. "get": {
  2610. "operationId": "session.children",
  2611. "parameters": [
  2612. {
  2613. "in": "query",
  2614. "name": "directory",
  2615. "schema": {
  2616. "type": "string"
  2617. }
  2618. },
  2619. {
  2620. "in": "query",
  2621. "name": "workspace",
  2622. "schema": {
  2623. "type": "string"
  2624. }
  2625. },
  2626. {
  2627. "in": "path",
  2628. "name": "sessionID",
  2629. "schema": {
  2630. "type": "string",
  2631. "pattern": "^ses.*"
  2632. },
  2633. "required": true
  2634. }
  2635. ],
  2636. "summary": "Get session children",
  2637. "tags": ["Session"],
  2638. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  2639. "responses": {
  2640. "200": {
  2641. "description": "List of children",
  2642. "content": {
  2643. "application/json": {
  2644. "schema": {
  2645. "type": "array",
  2646. "items": {
  2647. "$ref": "#/components/schemas/Session"
  2648. }
  2649. }
  2650. }
  2651. }
  2652. },
  2653. "400": {
  2654. "description": "Bad request",
  2655. "content": {
  2656. "application/json": {
  2657. "schema": {
  2658. "$ref": "#/components/schemas/BadRequestError"
  2659. }
  2660. }
  2661. }
  2662. },
  2663. "404": {
  2664. "description": "Not found",
  2665. "content": {
  2666. "application/json": {
  2667. "schema": {
  2668. "$ref": "#/components/schemas/NotFoundError"
  2669. }
  2670. }
  2671. }
  2672. }
  2673. },
  2674. "x-codeSamples": [
  2675. {
  2676. "lang": "js",
  2677. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  2678. }
  2679. ]
  2680. }
  2681. },
  2682. "/session/{sessionID}/todo": {
  2683. "get": {
  2684. "operationId": "session.todo",
  2685. "parameters": [
  2686. {
  2687. "in": "query",
  2688. "name": "directory",
  2689. "schema": {
  2690. "type": "string"
  2691. }
  2692. },
  2693. {
  2694. "in": "query",
  2695. "name": "workspace",
  2696. "schema": {
  2697. "type": "string"
  2698. }
  2699. },
  2700. {
  2701. "in": "path",
  2702. "name": "sessionID",
  2703. "schema": {
  2704. "type": "string",
  2705. "pattern": "^ses.*"
  2706. },
  2707. "required": true
  2708. }
  2709. ],
  2710. "summary": "Get session todos",
  2711. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  2712. "responses": {
  2713. "200": {
  2714. "description": "Todo list",
  2715. "content": {
  2716. "application/json": {
  2717. "schema": {
  2718. "type": "array",
  2719. "items": {
  2720. "$ref": "#/components/schemas/Todo"
  2721. }
  2722. }
  2723. }
  2724. }
  2725. },
  2726. "400": {
  2727. "description": "Bad request",
  2728. "content": {
  2729. "application/json": {
  2730. "schema": {
  2731. "$ref": "#/components/schemas/BadRequestError"
  2732. }
  2733. }
  2734. }
  2735. },
  2736. "404": {
  2737. "description": "Not found",
  2738. "content": {
  2739. "application/json": {
  2740. "schema": {
  2741. "$ref": "#/components/schemas/NotFoundError"
  2742. }
  2743. }
  2744. }
  2745. }
  2746. },
  2747. "x-codeSamples": [
  2748. {
  2749. "lang": "js",
  2750. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  2751. }
  2752. ]
  2753. }
  2754. },
  2755. "/session/{sessionID}/init": {
  2756. "post": {
  2757. "operationId": "session.init",
  2758. "parameters": [
  2759. {
  2760. "in": "query",
  2761. "name": "directory",
  2762. "schema": {
  2763. "type": "string"
  2764. }
  2765. },
  2766. {
  2767. "in": "query",
  2768. "name": "workspace",
  2769. "schema": {
  2770. "type": "string"
  2771. }
  2772. },
  2773. {
  2774. "in": "path",
  2775. "name": "sessionID",
  2776. "schema": {
  2777. "type": "string",
  2778. "pattern": "^ses.*"
  2779. },
  2780. "required": true
  2781. }
  2782. ],
  2783. "summary": "Initialize session",
  2784. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  2785. "responses": {
  2786. "200": {
  2787. "description": "200",
  2788. "content": {
  2789. "application/json": {
  2790. "schema": {
  2791. "type": "boolean"
  2792. }
  2793. }
  2794. }
  2795. },
  2796. "400": {
  2797. "description": "Bad request",
  2798. "content": {
  2799. "application/json": {
  2800. "schema": {
  2801. "$ref": "#/components/schemas/BadRequestError"
  2802. }
  2803. }
  2804. }
  2805. },
  2806. "404": {
  2807. "description": "Not found",
  2808. "content": {
  2809. "application/json": {
  2810. "schema": {
  2811. "$ref": "#/components/schemas/NotFoundError"
  2812. }
  2813. }
  2814. }
  2815. }
  2816. },
  2817. "requestBody": {
  2818. "content": {
  2819. "application/json": {
  2820. "schema": {
  2821. "type": "object",
  2822. "properties": {
  2823. "modelID": {
  2824. "type": "string"
  2825. },
  2826. "providerID": {
  2827. "type": "string"
  2828. },
  2829. "messageID": {
  2830. "type": "string",
  2831. "pattern": "^msg.*"
  2832. }
  2833. },
  2834. "required": ["modelID", "providerID", "messageID"]
  2835. }
  2836. }
  2837. }
  2838. },
  2839. "x-codeSamples": [
  2840. {
  2841. "lang": "js",
  2842. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  2843. }
  2844. ]
  2845. }
  2846. },
  2847. "/session/{sessionID}/fork": {
  2848. "post": {
  2849. "operationId": "session.fork",
  2850. "parameters": [
  2851. {
  2852. "in": "query",
  2853. "name": "directory",
  2854. "schema": {
  2855. "type": "string"
  2856. }
  2857. },
  2858. {
  2859. "in": "query",
  2860. "name": "workspace",
  2861. "schema": {
  2862. "type": "string"
  2863. }
  2864. },
  2865. {
  2866. "in": "path",
  2867. "name": "sessionID",
  2868. "schema": {
  2869. "type": "string",
  2870. "pattern": "^ses.*"
  2871. },
  2872. "required": true
  2873. }
  2874. ],
  2875. "summary": "Fork session",
  2876. "description": "Create a new session by forking an existing session at a specific message point.",
  2877. "responses": {
  2878. "200": {
  2879. "description": "200",
  2880. "content": {
  2881. "application/json": {
  2882. "schema": {
  2883. "$ref": "#/components/schemas/Session"
  2884. }
  2885. }
  2886. }
  2887. }
  2888. },
  2889. "requestBody": {
  2890. "content": {
  2891. "application/json": {
  2892. "schema": {
  2893. "type": "object",
  2894. "properties": {
  2895. "messageID": {
  2896. "type": "string",
  2897. "pattern": "^msg.*"
  2898. }
  2899. }
  2900. }
  2901. }
  2902. }
  2903. },
  2904. "x-codeSamples": [
  2905. {
  2906. "lang": "js",
  2907. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  2908. }
  2909. ]
  2910. }
  2911. },
  2912. "/session/{sessionID}/abort": {
  2913. "post": {
  2914. "operationId": "session.abort",
  2915. "parameters": [
  2916. {
  2917. "in": "query",
  2918. "name": "directory",
  2919. "schema": {
  2920. "type": "string"
  2921. }
  2922. },
  2923. {
  2924. "in": "query",
  2925. "name": "workspace",
  2926. "schema": {
  2927. "type": "string"
  2928. }
  2929. },
  2930. {
  2931. "in": "path",
  2932. "name": "sessionID",
  2933. "schema": {
  2934. "type": "string",
  2935. "pattern": "^ses.*"
  2936. },
  2937. "required": true
  2938. }
  2939. ],
  2940. "summary": "Abort session",
  2941. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  2942. "responses": {
  2943. "200": {
  2944. "description": "Aborted session",
  2945. "content": {
  2946. "application/json": {
  2947. "schema": {
  2948. "type": "boolean"
  2949. }
  2950. }
  2951. }
  2952. },
  2953. "400": {
  2954. "description": "Bad request",
  2955. "content": {
  2956. "application/json": {
  2957. "schema": {
  2958. "$ref": "#/components/schemas/BadRequestError"
  2959. }
  2960. }
  2961. }
  2962. },
  2963. "404": {
  2964. "description": "Not found",
  2965. "content": {
  2966. "application/json": {
  2967. "schema": {
  2968. "$ref": "#/components/schemas/NotFoundError"
  2969. }
  2970. }
  2971. }
  2972. }
  2973. },
  2974. "x-codeSamples": [
  2975. {
  2976. "lang": "js",
  2977. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  2978. }
  2979. ]
  2980. }
  2981. },
  2982. "/session/{sessionID}/share": {
  2983. "post": {
  2984. "operationId": "session.share",
  2985. "parameters": [
  2986. {
  2987. "in": "query",
  2988. "name": "directory",
  2989. "schema": {
  2990. "type": "string"
  2991. }
  2992. },
  2993. {
  2994. "in": "query",
  2995. "name": "workspace",
  2996. "schema": {
  2997. "type": "string"
  2998. }
  2999. },
  3000. {
  3001. "in": "path",
  3002. "name": "sessionID",
  3003. "schema": {
  3004. "type": "string",
  3005. "pattern": "^ses.*"
  3006. },
  3007. "required": true
  3008. }
  3009. ],
  3010. "summary": "Share session",
  3011. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  3012. "responses": {
  3013. "200": {
  3014. "description": "Successfully shared session",
  3015. "content": {
  3016. "application/json": {
  3017. "schema": {
  3018. "$ref": "#/components/schemas/Session"
  3019. }
  3020. }
  3021. }
  3022. },
  3023. "400": {
  3024. "description": "Bad request",
  3025. "content": {
  3026. "application/json": {
  3027. "schema": {
  3028. "$ref": "#/components/schemas/BadRequestError"
  3029. }
  3030. }
  3031. }
  3032. },
  3033. "404": {
  3034. "description": "Not found",
  3035. "content": {
  3036. "application/json": {
  3037. "schema": {
  3038. "$ref": "#/components/schemas/NotFoundError"
  3039. }
  3040. }
  3041. }
  3042. }
  3043. },
  3044. "x-codeSamples": [
  3045. {
  3046. "lang": "js",
  3047. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  3048. }
  3049. ]
  3050. },
  3051. "delete": {
  3052. "operationId": "session.unshare",
  3053. "parameters": [
  3054. {
  3055. "in": "query",
  3056. "name": "directory",
  3057. "schema": {
  3058. "type": "string"
  3059. }
  3060. },
  3061. {
  3062. "in": "query",
  3063. "name": "workspace",
  3064. "schema": {
  3065. "type": "string"
  3066. }
  3067. },
  3068. {
  3069. "in": "path",
  3070. "name": "sessionID",
  3071. "schema": {
  3072. "type": "string",
  3073. "pattern": "^ses.*"
  3074. },
  3075. "required": true
  3076. }
  3077. ],
  3078. "summary": "Unshare session",
  3079. "description": "Remove the shareable link for a session, making it private again.",
  3080. "responses": {
  3081. "200": {
  3082. "description": "Successfully unshared session",
  3083. "content": {
  3084. "application/json": {
  3085. "schema": {
  3086. "$ref": "#/components/schemas/Session"
  3087. }
  3088. }
  3089. }
  3090. },
  3091. "400": {
  3092. "description": "Bad request",
  3093. "content": {
  3094. "application/json": {
  3095. "schema": {
  3096. "$ref": "#/components/schemas/BadRequestError"
  3097. }
  3098. }
  3099. }
  3100. },
  3101. "404": {
  3102. "description": "Not found",
  3103. "content": {
  3104. "application/json": {
  3105. "schema": {
  3106. "$ref": "#/components/schemas/NotFoundError"
  3107. }
  3108. }
  3109. }
  3110. }
  3111. },
  3112. "x-codeSamples": [
  3113. {
  3114. "lang": "js",
  3115. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  3116. }
  3117. ]
  3118. }
  3119. },
  3120. "/session/{sessionID}/diff": {
  3121. "get": {
  3122. "operationId": "session.diff",
  3123. "parameters": [
  3124. {
  3125. "in": "query",
  3126. "name": "directory",
  3127. "schema": {
  3128. "type": "string"
  3129. }
  3130. },
  3131. {
  3132. "in": "query",
  3133. "name": "workspace",
  3134. "schema": {
  3135. "type": "string"
  3136. }
  3137. },
  3138. {
  3139. "in": "path",
  3140. "name": "sessionID",
  3141. "schema": {
  3142. "type": "string",
  3143. "pattern": "^ses.*"
  3144. },
  3145. "required": true
  3146. },
  3147. {
  3148. "in": "query",
  3149. "name": "messageID",
  3150. "schema": {
  3151. "type": "string",
  3152. "pattern": "^msg.*"
  3153. }
  3154. }
  3155. ],
  3156. "summary": "Get message diff",
  3157. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  3158. "responses": {
  3159. "200": {
  3160. "description": "Successfully retrieved diff",
  3161. "content": {
  3162. "application/json": {
  3163. "schema": {
  3164. "type": "array",
  3165. "items": {
  3166. "$ref": "#/components/schemas/SnapshotFileDiff"
  3167. }
  3168. }
  3169. }
  3170. }
  3171. }
  3172. },
  3173. "x-codeSamples": [
  3174. {
  3175. "lang": "js",
  3176. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  3177. }
  3178. ]
  3179. }
  3180. },
  3181. "/session/{sessionID}/summarize": {
  3182. "post": {
  3183. "operationId": "session.summarize",
  3184. "parameters": [
  3185. {
  3186. "in": "query",
  3187. "name": "directory",
  3188. "schema": {
  3189. "type": "string"
  3190. }
  3191. },
  3192. {
  3193. "in": "query",
  3194. "name": "workspace",
  3195. "schema": {
  3196. "type": "string"
  3197. }
  3198. },
  3199. {
  3200. "in": "path",
  3201. "name": "sessionID",
  3202. "schema": {
  3203. "type": "string",
  3204. "pattern": "^ses.*"
  3205. },
  3206. "required": true
  3207. }
  3208. ],
  3209. "summary": "Summarize session",
  3210. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  3211. "responses": {
  3212. "200": {
  3213. "description": "Summarized session",
  3214. "content": {
  3215. "application/json": {
  3216. "schema": {
  3217. "type": "boolean"
  3218. }
  3219. }
  3220. }
  3221. },
  3222. "400": {
  3223. "description": "Bad request",
  3224. "content": {
  3225. "application/json": {
  3226. "schema": {
  3227. "$ref": "#/components/schemas/BadRequestError"
  3228. }
  3229. }
  3230. }
  3231. },
  3232. "404": {
  3233. "description": "Not found",
  3234. "content": {
  3235. "application/json": {
  3236. "schema": {
  3237. "$ref": "#/components/schemas/NotFoundError"
  3238. }
  3239. }
  3240. }
  3241. }
  3242. },
  3243. "requestBody": {
  3244. "content": {
  3245. "application/json": {
  3246. "schema": {
  3247. "type": "object",
  3248. "properties": {
  3249. "providerID": {
  3250. "type": "string"
  3251. },
  3252. "modelID": {
  3253. "type": "string"
  3254. },
  3255. "auto": {
  3256. "default": false,
  3257. "type": "boolean"
  3258. }
  3259. },
  3260. "required": ["providerID", "modelID"]
  3261. }
  3262. }
  3263. }
  3264. },
  3265. "x-codeSamples": [
  3266. {
  3267. "lang": "js",
  3268. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  3269. }
  3270. ]
  3271. }
  3272. },
  3273. "/session/{sessionID}/message": {
  3274. "get": {
  3275. "operationId": "session.messages",
  3276. "parameters": [
  3277. {
  3278. "in": "query",
  3279. "name": "directory",
  3280. "schema": {
  3281. "type": "string"
  3282. }
  3283. },
  3284. {
  3285. "in": "query",
  3286. "name": "workspace",
  3287. "schema": {
  3288. "type": "string"
  3289. }
  3290. },
  3291. {
  3292. "in": "path",
  3293. "name": "sessionID",
  3294. "schema": {
  3295. "type": "string",
  3296. "pattern": "^ses.*"
  3297. },
  3298. "required": true
  3299. },
  3300. {
  3301. "in": "query",
  3302. "name": "limit",
  3303. "schema": {
  3304. "type": "integer",
  3305. "minimum": 0,
  3306. "maximum": 9007199254740991
  3307. },
  3308. "description": "Maximum number of messages to return"
  3309. },
  3310. {
  3311. "in": "query",
  3312. "name": "before",
  3313. "schema": {
  3314. "type": "string"
  3315. }
  3316. }
  3317. ],
  3318. "summary": "Get session messages",
  3319. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  3320. "responses": {
  3321. "200": {
  3322. "description": "List of messages",
  3323. "content": {
  3324. "application/json": {
  3325. "schema": {
  3326. "type": "array",
  3327. "items": {
  3328. "type": "object",
  3329. "properties": {
  3330. "info": {
  3331. "$ref": "#/components/schemas/Message"
  3332. },
  3333. "parts": {
  3334. "type": "array",
  3335. "items": {
  3336. "$ref": "#/components/schemas/Part"
  3337. }
  3338. }
  3339. },
  3340. "required": ["info", "parts"]
  3341. }
  3342. }
  3343. }
  3344. }
  3345. },
  3346. "400": {
  3347. "description": "Bad request",
  3348. "content": {
  3349. "application/json": {
  3350. "schema": {
  3351. "$ref": "#/components/schemas/BadRequestError"
  3352. }
  3353. }
  3354. }
  3355. },
  3356. "404": {
  3357. "description": "Not found",
  3358. "content": {
  3359. "application/json": {
  3360. "schema": {
  3361. "$ref": "#/components/schemas/NotFoundError"
  3362. }
  3363. }
  3364. }
  3365. }
  3366. },
  3367. "x-codeSamples": [
  3368. {
  3369. "lang": "js",
  3370. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  3371. }
  3372. ]
  3373. },
  3374. "post": {
  3375. "operationId": "session.prompt",
  3376. "parameters": [
  3377. {
  3378. "in": "query",
  3379. "name": "directory",
  3380. "schema": {
  3381. "type": "string"
  3382. }
  3383. },
  3384. {
  3385. "in": "query",
  3386. "name": "workspace",
  3387. "schema": {
  3388. "type": "string"
  3389. }
  3390. },
  3391. {
  3392. "in": "path",
  3393. "name": "sessionID",
  3394. "schema": {
  3395. "type": "string",
  3396. "pattern": "^ses.*"
  3397. },
  3398. "required": true
  3399. }
  3400. ],
  3401. "summary": "Send message",
  3402. "description": "Create and send a new message to a session, streaming the AI response.",
  3403. "responses": {
  3404. "200": {
  3405. "description": "Created message",
  3406. "content": {
  3407. "application/json": {
  3408. "schema": {
  3409. "type": "object",
  3410. "properties": {
  3411. "info": {
  3412. "$ref": "#/components/schemas/AssistantMessage"
  3413. },
  3414. "parts": {
  3415. "type": "array",
  3416. "items": {
  3417. "$ref": "#/components/schemas/Part"
  3418. }
  3419. }
  3420. },
  3421. "required": ["info", "parts"]
  3422. }
  3423. }
  3424. }
  3425. },
  3426. "400": {
  3427. "description": "Bad request",
  3428. "content": {
  3429. "application/json": {
  3430. "schema": {
  3431. "$ref": "#/components/schemas/BadRequestError"
  3432. }
  3433. }
  3434. }
  3435. },
  3436. "404": {
  3437. "description": "Not found",
  3438. "content": {
  3439. "application/json": {
  3440. "schema": {
  3441. "$ref": "#/components/schemas/NotFoundError"
  3442. }
  3443. }
  3444. }
  3445. }
  3446. },
  3447. "requestBody": {
  3448. "content": {
  3449. "application/json": {
  3450. "schema": {
  3451. "type": "object",
  3452. "properties": {
  3453. "messageID": {
  3454. "type": "string",
  3455. "pattern": "^msg.*"
  3456. },
  3457. "model": {
  3458. "type": "object",
  3459. "properties": {
  3460. "providerID": {
  3461. "type": "string"
  3462. },
  3463. "modelID": {
  3464. "type": "string"
  3465. }
  3466. },
  3467. "required": ["providerID", "modelID"]
  3468. },
  3469. "agent": {
  3470. "type": "string"
  3471. },
  3472. "noReply": {
  3473. "type": "boolean"
  3474. },
  3475. "tools": {
  3476. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  3477. "type": "object",
  3478. "propertyNames": {
  3479. "type": "string"
  3480. },
  3481. "additionalProperties": {
  3482. "type": "boolean"
  3483. }
  3484. },
  3485. "format": {
  3486. "$ref": "#/components/schemas/OutputFormat"
  3487. },
  3488. "system": {
  3489. "type": "string"
  3490. },
  3491. "variant": {
  3492. "type": "string"
  3493. },
  3494. "parts": {
  3495. "type": "array",
  3496. "items": {
  3497. "anyOf": [
  3498. {
  3499. "$ref": "#/components/schemas/TextPartInput"
  3500. },
  3501. {
  3502. "$ref": "#/components/schemas/FilePartInput"
  3503. },
  3504. {
  3505. "$ref": "#/components/schemas/AgentPartInput"
  3506. },
  3507. {
  3508. "$ref": "#/components/schemas/SubtaskPartInput"
  3509. }
  3510. ]
  3511. }
  3512. }
  3513. },
  3514. "required": ["parts"]
  3515. }
  3516. }
  3517. }
  3518. },
  3519. "x-codeSamples": [
  3520. {
  3521. "lang": "js",
  3522. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  3523. }
  3524. ]
  3525. }
  3526. },
  3527. "/session/{sessionID}/message/{messageID}": {
  3528. "get": {
  3529. "operationId": "session.message",
  3530. "parameters": [
  3531. {
  3532. "in": "query",
  3533. "name": "directory",
  3534. "schema": {
  3535. "type": "string"
  3536. }
  3537. },
  3538. {
  3539. "in": "query",
  3540. "name": "workspace",
  3541. "schema": {
  3542. "type": "string"
  3543. }
  3544. },
  3545. {
  3546. "in": "path",
  3547. "name": "sessionID",
  3548. "schema": {
  3549. "type": "string",
  3550. "pattern": "^ses.*"
  3551. },
  3552. "required": true
  3553. },
  3554. {
  3555. "in": "path",
  3556. "name": "messageID",
  3557. "schema": {
  3558. "type": "string",
  3559. "pattern": "^msg.*"
  3560. },
  3561. "required": true
  3562. }
  3563. ],
  3564. "summary": "Get message",
  3565. "description": "Retrieve a specific message from a session by its message ID.",
  3566. "responses": {
  3567. "200": {
  3568. "description": "Message",
  3569. "content": {
  3570. "application/json": {
  3571. "schema": {
  3572. "type": "object",
  3573. "properties": {
  3574. "info": {
  3575. "$ref": "#/components/schemas/Message"
  3576. },
  3577. "parts": {
  3578. "type": "array",
  3579. "items": {
  3580. "$ref": "#/components/schemas/Part"
  3581. }
  3582. }
  3583. },
  3584. "required": ["info", "parts"]
  3585. }
  3586. }
  3587. }
  3588. },
  3589. "400": {
  3590. "description": "Bad request",
  3591. "content": {
  3592. "application/json": {
  3593. "schema": {
  3594. "$ref": "#/components/schemas/BadRequestError"
  3595. }
  3596. }
  3597. }
  3598. },
  3599. "404": {
  3600. "description": "Not found",
  3601. "content": {
  3602. "application/json": {
  3603. "schema": {
  3604. "$ref": "#/components/schemas/NotFoundError"
  3605. }
  3606. }
  3607. }
  3608. }
  3609. },
  3610. "x-codeSamples": [
  3611. {
  3612. "lang": "js",
  3613. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  3614. }
  3615. ]
  3616. },
  3617. "delete": {
  3618. "operationId": "session.deleteMessage",
  3619. "parameters": [
  3620. {
  3621. "in": "query",
  3622. "name": "directory",
  3623. "schema": {
  3624. "type": "string"
  3625. }
  3626. },
  3627. {
  3628. "in": "query",
  3629. "name": "workspace",
  3630. "schema": {
  3631. "type": "string"
  3632. }
  3633. },
  3634. {
  3635. "in": "path",
  3636. "name": "sessionID",
  3637. "schema": {
  3638. "type": "string",
  3639. "pattern": "^ses.*"
  3640. },
  3641. "required": true
  3642. },
  3643. {
  3644. "in": "path",
  3645. "name": "messageID",
  3646. "schema": {
  3647. "type": "string",
  3648. "pattern": "^msg.*"
  3649. },
  3650. "required": true
  3651. }
  3652. ],
  3653. "summary": "Delete message",
  3654. "description": "Permanently delete a specific message (and all of its parts) from a session. This does not revert any file changes that may have been made while processing the message.",
  3655. "responses": {
  3656. "200": {
  3657. "description": "Successfully deleted message",
  3658. "content": {
  3659. "application/json": {
  3660. "schema": {
  3661. "type": "boolean"
  3662. }
  3663. }
  3664. }
  3665. },
  3666. "400": {
  3667. "description": "Bad request",
  3668. "content": {
  3669. "application/json": {
  3670. "schema": {
  3671. "$ref": "#/components/schemas/BadRequestError"
  3672. }
  3673. }
  3674. }
  3675. },
  3676. "404": {
  3677. "description": "Not found",
  3678. "content": {
  3679. "application/json": {
  3680. "schema": {
  3681. "$ref": "#/components/schemas/NotFoundError"
  3682. }
  3683. }
  3684. }
  3685. }
  3686. },
  3687. "x-codeSamples": [
  3688. {
  3689. "lang": "js",
  3690. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  3691. }
  3692. ]
  3693. }
  3694. },
  3695. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  3696. "delete": {
  3697. "operationId": "part.delete",
  3698. "parameters": [
  3699. {
  3700. "in": "query",
  3701. "name": "directory",
  3702. "schema": {
  3703. "type": "string"
  3704. }
  3705. },
  3706. {
  3707. "in": "query",
  3708. "name": "workspace",
  3709. "schema": {
  3710. "type": "string"
  3711. }
  3712. },
  3713. {
  3714. "in": "path",
  3715. "name": "sessionID",
  3716. "schema": {
  3717. "type": "string",
  3718. "pattern": "^ses.*"
  3719. },
  3720. "required": true
  3721. },
  3722. {
  3723. "in": "path",
  3724. "name": "messageID",
  3725. "schema": {
  3726. "type": "string",
  3727. "pattern": "^msg.*"
  3728. },
  3729. "required": true
  3730. },
  3731. {
  3732. "in": "path",
  3733. "name": "partID",
  3734. "schema": {
  3735. "type": "string",
  3736. "pattern": "^prt.*"
  3737. },
  3738. "required": true
  3739. }
  3740. ],
  3741. "description": "Delete a part from a message",
  3742. "responses": {
  3743. "200": {
  3744. "description": "Successfully deleted part",
  3745. "content": {
  3746. "application/json": {
  3747. "schema": {
  3748. "type": "boolean"
  3749. }
  3750. }
  3751. }
  3752. },
  3753. "400": {
  3754. "description": "Bad request",
  3755. "content": {
  3756. "application/json": {
  3757. "schema": {
  3758. "$ref": "#/components/schemas/BadRequestError"
  3759. }
  3760. }
  3761. }
  3762. },
  3763. "404": {
  3764. "description": "Not found",
  3765. "content": {
  3766. "application/json": {
  3767. "schema": {
  3768. "$ref": "#/components/schemas/NotFoundError"
  3769. }
  3770. }
  3771. }
  3772. }
  3773. },
  3774. "x-codeSamples": [
  3775. {
  3776. "lang": "js",
  3777. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  3778. }
  3779. ]
  3780. },
  3781. "patch": {
  3782. "operationId": "part.update",
  3783. "parameters": [
  3784. {
  3785. "in": "query",
  3786. "name": "directory",
  3787. "schema": {
  3788. "type": "string"
  3789. }
  3790. },
  3791. {
  3792. "in": "query",
  3793. "name": "workspace",
  3794. "schema": {
  3795. "type": "string"
  3796. }
  3797. },
  3798. {
  3799. "in": "path",
  3800. "name": "sessionID",
  3801. "schema": {
  3802. "type": "string",
  3803. "pattern": "^ses.*"
  3804. },
  3805. "required": true
  3806. },
  3807. {
  3808. "in": "path",
  3809. "name": "messageID",
  3810. "schema": {
  3811. "type": "string",
  3812. "pattern": "^msg.*"
  3813. },
  3814. "required": true
  3815. },
  3816. {
  3817. "in": "path",
  3818. "name": "partID",
  3819. "schema": {
  3820. "type": "string",
  3821. "pattern": "^prt.*"
  3822. },
  3823. "required": true
  3824. }
  3825. ],
  3826. "description": "Update a part in a message",
  3827. "responses": {
  3828. "200": {
  3829. "description": "Successfully updated part",
  3830. "content": {
  3831. "application/json": {
  3832. "schema": {
  3833. "$ref": "#/components/schemas/Part"
  3834. }
  3835. }
  3836. }
  3837. },
  3838. "400": {
  3839. "description": "Bad request",
  3840. "content": {
  3841. "application/json": {
  3842. "schema": {
  3843. "$ref": "#/components/schemas/BadRequestError"
  3844. }
  3845. }
  3846. }
  3847. },
  3848. "404": {
  3849. "description": "Not found",
  3850. "content": {
  3851. "application/json": {
  3852. "schema": {
  3853. "$ref": "#/components/schemas/NotFoundError"
  3854. }
  3855. }
  3856. }
  3857. }
  3858. },
  3859. "requestBody": {
  3860. "content": {
  3861. "application/json": {
  3862. "schema": {
  3863. "$ref": "#/components/schemas/Part"
  3864. }
  3865. }
  3866. }
  3867. },
  3868. "x-codeSamples": [
  3869. {
  3870. "lang": "js",
  3871. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  3872. }
  3873. ]
  3874. }
  3875. },
  3876. "/session/{sessionID}/prompt_async": {
  3877. "post": {
  3878. "operationId": "session.prompt_async",
  3879. "parameters": [
  3880. {
  3881. "in": "query",
  3882. "name": "directory",
  3883. "schema": {
  3884. "type": "string"
  3885. }
  3886. },
  3887. {
  3888. "in": "query",
  3889. "name": "workspace",
  3890. "schema": {
  3891. "type": "string"
  3892. }
  3893. },
  3894. {
  3895. "in": "path",
  3896. "name": "sessionID",
  3897. "schema": {
  3898. "type": "string",
  3899. "pattern": "^ses.*"
  3900. },
  3901. "required": true
  3902. }
  3903. ],
  3904. "summary": "Send async message",
  3905. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  3906. "responses": {
  3907. "204": {
  3908. "description": "Prompt accepted"
  3909. },
  3910. "400": {
  3911. "description": "Bad request",
  3912. "content": {
  3913. "application/json": {
  3914. "schema": {
  3915. "$ref": "#/components/schemas/BadRequestError"
  3916. }
  3917. }
  3918. }
  3919. },
  3920. "404": {
  3921. "description": "Not found",
  3922. "content": {
  3923. "application/json": {
  3924. "schema": {
  3925. "$ref": "#/components/schemas/NotFoundError"
  3926. }
  3927. }
  3928. }
  3929. }
  3930. },
  3931. "requestBody": {
  3932. "content": {
  3933. "application/json": {
  3934. "schema": {
  3935. "type": "object",
  3936. "properties": {
  3937. "messageID": {
  3938. "type": "string",
  3939. "pattern": "^msg.*"
  3940. },
  3941. "model": {
  3942. "type": "object",
  3943. "properties": {
  3944. "providerID": {
  3945. "type": "string"
  3946. },
  3947. "modelID": {
  3948. "type": "string"
  3949. }
  3950. },
  3951. "required": ["providerID", "modelID"]
  3952. },
  3953. "agent": {
  3954. "type": "string"
  3955. },
  3956. "noReply": {
  3957. "type": "boolean"
  3958. },
  3959. "tools": {
  3960. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  3961. "type": "object",
  3962. "propertyNames": {
  3963. "type": "string"
  3964. },
  3965. "additionalProperties": {
  3966. "type": "boolean"
  3967. }
  3968. },
  3969. "format": {
  3970. "$ref": "#/components/schemas/OutputFormat"
  3971. },
  3972. "system": {
  3973. "type": "string"
  3974. },
  3975. "variant": {
  3976. "type": "string"
  3977. },
  3978. "parts": {
  3979. "type": "array",
  3980. "items": {
  3981. "anyOf": [
  3982. {
  3983. "$ref": "#/components/schemas/TextPartInput"
  3984. },
  3985. {
  3986. "$ref": "#/components/schemas/FilePartInput"
  3987. },
  3988. {
  3989. "$ref": "#/components/schemas/AgentPartInput"
  3990. },
  3991. {
  3992. "$ref": "#/components/schemas/SubtaskPartInput"
  3993. }
  3994. ]
  3995. }
  3996. }
  3997. },
  3998. "required": ["parts"]
  3999. }
  4000. }
  4001. }
  4002. },
  4003. "x-codeSamples": [
  4004. {
  4005. "lang": "js",
  4006. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  4007. }
  4008. ]
  4009. }
  4010. },
  4011. "/session/{sessionID}/command": {
  4012. "post": {
  4013. "operationId": "session.command",
  4014. "parameters": [
  4015. {
  4016. "in": "query",
  4017. "name": "directory",
  4018. "schema": {
  4019. "type": "string"
  4020. }
  4021. },
  4022. {
  4023. "in": "query",
  4024. "name": "workspace",
  4025. "schema": {
  4026. "type": "string"
  4027. }
  4028. },
  4029. {
  4030. "in": "path",
  4031. "name": "sessionID",
  4032. "schema": {
  4033. "type": "string",
  4034. "pattern": "^ses.*"
  4035. },
  4036. "required": true
  4037. }
  4038. ],
  4039. "summary": "Send command",
  4040. "description": "Send a new command to a session for execution by the AI assistant.",
  4041. "responses": {
  4042. "200": {
  4043. "description": "Created message",
  4044. "content": {
  4045. "application/json": {
  4046. "schema": {
  4047. "type": "object",
  4048. "properties": {
  4049. "info": {
  4050. "$ref": "#/components/schemas/AssistantMessage"
  4051. },
  4052. "parts": {
  4053. "type": "array",
  4054. "items": {
  4055. "$ref": "#/components/schemas/Part"
  4056. }
  4057. }
  4058. },
  4059. "required": ["info", "parts"]
  4060. }
  4061. }
  4062. }
  4063. },
  4064. "400": {
  4065. "description": "Bad request",
  4066. "content": {
  4067. "application/json": {
  4068. "schema": {
  4069. "$ref": "#/components/schemas/BadRequestError"
  4070. }
  4071. }
  4072. }
  4073. },
  4074. "404": {
  4075. "description": "Not found",
  4076. "content": {
  4077. "application/json": {
  4078. "schema": {
  4079. "$ref": "#/components/schemas/NotFoundError"
  4080. }
  4081. }
  4082. }
  4083. }
  4084. },
  4085. "requestBody": {
  4086. "content": {
  4087. "application/json": {
  4088. "schema": {
  4089. "type": "object",
  4090. "properties": {
  4091. "messageID": {
  4092. "type": "string",
  4093. "pattern": "^msg.*"
  4094. },
  4095. "agent": {
  4096. "type": "string"
  4097. },
  4098. "model": {
  4099. "type": "string"
  4100. },
  4101. "arguments": {
  4102. "type": "string"
  4103. },
  4104. "command": {
  4105. "type": "string"
  4106. },
  4107. "variant": {
  4108. "type": "string"
  4109. },
  4110. "parts": {
  4111. "type": "array",
  4112. "items": {
  4113. "anyOf": [
  4114. {
  4115. "type": "object",
  4116. "properties": {
  4117. "id": {
  4118. "type": "string",
  4119. "pattern": "^prt.*"
  4120. },
  4121. "type": {
  4122. "type": "string",
  4123. "const": "file"
  4124. },
  4125. "mime": {
  4126. "type": "string"
  4127. },
  4128. "filename": {
  4129. "type": "string"
  4130. },
  4131. "url": {
  4132. "type": "string"
  4133. },
  4134. "source": {
  4135. "$ref": "#/components/schemas/FilePartSource"
  4136. }
  4137. },
  4138. "required": ["type", "mime", "url"]
  4139. }
  4140. ]
  4141. }
  4142. }
  4143. },
  4144. "required": ["arguments", "command"]
  4145. }
  4146. }
  4147. }
  4148. },
  4149. "x-codeSamples": [
  4150. {
  4151. "lang": "js",
  4152. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  4153. }
  4154. ]
  4155. }
  4156. },
  4157. "/session/{sessionID}/shell": {
  4158. "post": {
  4159. "operationId": "session.shell",
  4160. "parameters": [
  4161. {
  4162. "in": "query",
  4163. "name": "directory",
  4164. "schema": {
  4165. "type": "string"
  4166. }
  4167. },
  4168. {
  4169. "in": "query",
  4170. "name": "workspace",
  4171. "schema": {
  4172. "type": "string"
  4173. }
  4174. },
  4175. {
  4176. "in": "path",
  4177. "name": "sessionID",
  4178. "schema": {
  4179. "type": "string",
  4180. "pattern": "^ses.*"
  4181. },
  4182. "required": true
  4183. }
  4184. ],
  4185. "summary": "Run shell command",
  4186. "description": "Execute a shell command within the session context and return the AI's response.",
  4187. "responses": {
  4188. "200": {
  4189. "description": "Created message",
  4190. "content": {
  4191. "application/json": {
  4192. "schema": {
  4193. "type": "object",
  4194. "properties": {
  4195. "info": {
  4196. "$ref": "#/components/schemas/Message"
  4197. },
  4198. "parts": {
  4199. "type": "array",
  4200. "items": {
  4201. "$ref": "#/components/schemas/Part"
  4202. }
  4203. }
  4204. },
  4205. "required": ["info", "parts"]
  4206. }
  4207. }
  4208. }
  4209. },
  4210. "400": {
  4211. "description": "Bad request",
  4212. "content": {
  4213. "application/json": {
  4214. "schema": {
  4215. "$ref": "#/components/schemas/BadRequestError"
  4216. }
  4217. }
  4218. }
  4219. },
  4220. "404": {
  4221. "description": "Not found",
  4222. "content": {
  4223. "application/json": {
  4224. "schema": {
  4225. "$ref": "#/components/schemas/NotFoundError"
  4226. }
  4227. }
  4228. }
  4229. }
  4230. },
  4231. "requestBody": {
  4232. "content": {
  4233. "application/json": {
  4234. "schema": {
  4235. "type": "object",
  4236. "properties": {
  4237. "messageID": {
  4238. "type": "string",
  4239. "pattern": "^msg.*"
  4240. },
  4241. "agent": {
  4242. "type": "string"
  4243. },
  4244. "model": {
  4245. "type": "object",
  4246. "properties": {
  4247. "providerID": {
  4248. "type": "string"
  4249. },
  4250. "modelID": {
  4251. "type": "string"
  4252. }
  4253. },
  4254. "required": ["providerID", "modelID"]
  4255. },
  4256. "command": {
  4257. "type": "string"
  4258. }
  4259. },
  4260. "required": ["agent", "command"]
  4261. }
  4262. }
  4263. }
  4264. },
  4265. "x-codeSamples": [
  4266. {
  4267. "lang": "js",
  4268. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  4269. }
  4270. ]
  4271. }
  4272. },
  4273. "/session/{sessionID}/revert": {
  4274. "post": {
  4275. "operationId": "session.revert",
  4276. "parameters": [
  4277. {
  4278. "in": "query",
  4279. "name": "directory",
  4280. "schema": {
  4281. "type": "string"
  4282. }
  4283. },
  4284. {
  4285. "in": "query",
  4286. "name": "workspace",
  4287. "schema": {
  4288. "type": "string"
  4289. }
  4290. },
  4291. {
  4292. "in": "path",
  4293. "name": "sessionID",
  4294. "schema": {
  4295. "type": "string",
  4296. "pattern": "^ses.*"
  4297. },
  4298. "required": true
  4299. }
  4300. ],
  4301. "summary": "Revert message",
  4302. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  4303. "responses": {
  4304. "200": {
  4305. "description": "Updated session",
  4306. "content": {
  4307. "application/json": {
  4308. "schema": {
  4309. "$ref": "#/components/schemas/Session"
  4310. }
  4311. }
  4312. }
  4313. },
  4314. "400": {
  4315. "description": "Bad request",
  4316. "content": {
  4317. "application/json": {
  4318. "schema": {
  4319. "$ref": "#/components/schemas/BadRequestError"
  4320. }
  4321. }
  4322. }
  4323. },
  4324. "404": {
  4325. "description": "Not found",
  4326. "content": {
  4327. "application/json": {
  4328. "schema": {
  4329. "$ref": "#/components/schemas/NotFoundError"
  4330. }
  4331. }
  4332. }
  4333. }
  4334. },
  4335. "requestBody": {
  4336. "content": {
  4337. "application/json": {
  4338. "schema": {
  4339. "type": "object",
  4340. "properties": {
  4341. "messageID": {
  4342. "type": "string",
  4343. "pattern": "^msg.*"
  4344. },
  4345. "partID": {
  4346. "type": "string",
  4347. "pattern": "^prt.*"
  4348. }
  4349. },
  4350. "required": ["messageID"]
  4351. }
  4352. }
  4353. }
  4354. },
  4355. "x-codeSamples": [
  4356. {
  4357. "lang": "js",
  4358. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  4359. }
  4360. ]
  4361. }
  4362. },
  4363. "/session/{sessionID}/unrevert": {
  4364. "post": {
  4365. "operationId": "session.unrevert",
  4366. "parameters": [
  4367. {
  4368. "in": "query",
  4369. "name": "directory",
  4370. "schema": {
  4371. "type": "string"
  4372. }
  4373. },
  4374. {
  4375. "in": "query",
  4376. "name": "workspace",
  4377. "schema": {
  4378. "type": "string"
  4379. }
  4380. },
  4381. {
  4382. "in": "path",
  4383. "name": "sessionID",
  4384. "schema": {
  4385. "type": "string",
  4386. "pattern": "^ses.*"
  4387. },
  4388. "required": true
  4389. }
  4390. ],
  4391. "summary": "Restore reverted messages",
  4392. "description": "Restore all previously reverted messages in a session.",
  4393. "responses": {
  4394. "200": {
  4395. "description": "Updated session",
  4396. "content": {
  4397. "application/json": {
  4398. "schema": {
  4399. "$ref": "#/components/schemas/Session"
  4400. }
  4401. }
  4402. }
  4403. },
  4404. "400": {
  4405. "description": "Bad request",
  4406. "content": {
  4407. "application/json": {
  4408. "schema": {
  4409. "$ref": "#/components/schemas/BadRequestError"
  4410. }
  4411. }
  4412. }
  4413. },
  4414. "404": {
  4415. "description": "Not found",
  4416. "content": {
  4417. "application/json": {
  4418. "schema": {
  4419. "$ref": "#/components/schemas/NotFoundError"
  4420. }
  4421. }
  4422. }
  4423. }
  4424. },
  4425. "x-codeSamples": [
  4426. {
  4427. "lang": "js",
  4428. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  4429. }
  4430. ]
  4431. }
  4432. },
  4433. "/session/{sessionID}/permissions/{permissionID}": {
  4434. "post": {
  4435. "operationId": "permission.respond",
  4436. "parameters": [
  4437. {
  4438. "in": "query",
  4439. "name": "directory",
  4440. "schema": {
  4441. "type": "string"
  4442. }
  4443. },
  4444. {
  4445. "in": "query",
  4446. "name": "workspace",
  4447. "schema": {
  4448. "type": "string"
  4449. }
  4450. },
  4451. {
  4452. "in": "path",
  4453. "name": "sessionID",
  4454. "schema": {
  4455. "type": "string",
  4456. "pattern": "^ses.*"
  4457. },
  4458. "required": true
  4459. },
  4460. {
  4461. "in": "path",
  4462. "name": "permissionID",
  4463. "schema": {
  4464. "type": "string",
  4465. "pattern": "^per.*"
  4466. },
  4467. "required": true
  4468. }
  4469. ],
  4470. "summary": "Respond to permission",
  4471. "deprecated": true,
  4472. "description": "Approve or deny a permission request from the AI assistant.",
  4473. "responses": {
  4474. "200": {
  4475. "description": "Permission processed successfully",
  4476. "content": {
  4477. "application/json": {
  4478. "schema": {
  4479. "type": "boolean"
  4480. }
  4481. }
  4482. }
  4483. },
  4484. "400": {
  4485. "description": "Bad request",
  4486. "content": {
  4487. "application/json": {
  4488. "schema": {
  4489. "$ref": "#/components/schemas/BadRequestError"
  4490. }
  4491. }
  4492. }
  4493. },
  4494. "404": {
  4495. "description": "Not found",
  4496. "content": {
  4497. "application/json": {
  4498. "schema": {
  4499. "$ref": "#/components/schemas/NotFoundError"
  4500. }
  4501. }
  4502. }
  4503. }
  4504. },
  4505. "requestBody": {
  4506. "content": {
  4507. "application/json": {
  4508. "schema": {
  4509. "type": "object",
  4510. "properties": {
  4511. "response": {
  4512. "type": "string",
  4513. "enum": ["once", "always", "reject"]
  4514. }
  4515. },
  4516. "required": ["response"]
  4517. }
  4518. }
  4519. }
  4520. },
  4521. "x-codeSamples": [
  4522. {
  4523. "lang": "js",
  4524. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  4525. }
  4526. ]
  4527. }
  4528. },
  4529. "/permission/{requestID}/reply": {
  4530. "post": {
  4531. "operationId": "permission.reply",
  4532. "parameters": [
  4533. {
  4534. "in": "query",
  4535. "name": "directory",
  4536. "schema": {
  4537. "type": "string"
  4538. }
  4539. },
  4540. {
  4541. "in": "query",
  4542. "name": "workspace",
  4543. "schema": {
  4544. "type": "string"
  4545. }
  4546. },
  4547. {
  4548. "in": "path",
  4549. "name": "requestID",
  4550. "schema": {
  4551. "type": "string",
  4552. "pattern": "^per.*"
  4553. },
  4554. "required": true
  4555. }
  4556. ],
  4557. "summary": "Respond to permission request",
  4558. "description": "Approve or deny a permission request from the AI assistant.",
  4559. "responses": {
  4560. "200": {
  4561. "description": "Permission processed successfully",
  4562. "content": {
  4563. "application/json": {
  4564. "schema": {
  4565. "type": "boolean"
  4566. }
  4567. }
  4568. }
  4569. },
  4570. "400": {
  4571. "description": "Bad request",
  4572. "content": {
  4573. "application/json": {
  4574. "schema": {
  4575. "$ref": "#/components/schemas/BadRequestError"
  4576. }
  4577. }
  4578. }
  4579. },
  4580. "404": {
  4581. "description": "Not found",
  4582. "content": {
  4583. "application/json": {
  4584. "schema": {
  4585. "$ref": "#/components/schemas/NotFoundError"
  4586. }
  4587. }
  4588. }
  4589. }
  4590. },
  4591. "requestBody": {
  4592. "content": {
  4593. "application/json": {
  4594. "schema": {
  4595. "type": "object",
  4596. "properties": {
  4597. "reply": {
  4598. "type": "string",
  4599. "enum": ["once", "always", "reject"]
  4600. },
  4601. "message": {
  4602. "type": "string"
  4603. }
  4604. },
  4605. "required": ["reply"]
  4606. }
  4607. }
  4608. }
  4609. },
  4610. "x-codeSamples": [
  4611. {
  4612. "lang": "js",
  4613. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4614. }
  4615. ]
  4616. }
  4617. },
  4618. "/permission": {
  4619. "get": {
  4620. "operationId": "permission.list",
  4621. "parameters": [
  4622. {
  4623. "in": "query",
  4624. "name": "directory",
  4625. "schema": {
  4626. "type": "string"
  4627. }
  4628. },
  4629. {
  4630. "in": "query",
  4631. "name": "workspace",
  4632. "schema": {
  4633. "type": "string"
  4634. }
  4635. }
  4636. ],
  4637. "summary": "List pending permissions",
  4638. "description": "Get all pending permission requests across all sessions.",
  4639. "responses": {
  4640. "200": {
  4641. "description": "List of pending permissions",
  4642. "content": {
  4643. "application/json": {
  4644. "schema": {
  4645. "type": "array",
  4646. "items": {
  4647. "$ref": "#/components/schemas/PermissionRequest"
  4648. }
  4649. }
  4650. }
  4651. }
  4652. }
  4653. },
  4654. "x-codeSamples": [
  4655. {
  4656. "lang": "js",
  4657. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  4658. }
  4659. ]
  4660. }
  4661. },
  4662. "/question": {
  4663. "get": {
  4664. "operationId": "question.list",
  4665. "parameters": [
  4666. {
  4667. "in": "query",
  4668. "name": "directory",
  4669. "schema": {
  4670. "type": "string"
  4671. }
  4672. },
  4673. {
  4674. "in": "query",
  4675. "name": "workspace",
  4676. "schema": {
  4677. "type": "string"
  4678. }
  4679. }
  4680. ],
  4681. "summary": "List pending questions",
  4682. "description": "Get all pending question requests across all sessions.",
  4683. "responses": {
  4684. "200": {
  4685. "description": "List of pending questions",
  4686. "content": {
  4687. "application/json": {
  4688. "schema": {
  4689. "type": "array",
  4690. "items": {
  4691. "$ref": "#/components/schemas/QuestionRequest"
  4692. }
  4693. }
  4694. }
  4695. }
  4696. }
  4697. },
  4698. "x-codeSamples": [
  4699. {
  4700. "lang": "js",
  4701. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  4702. }
  4703. ]
  4704. }
  4705. },
  4706. "/question/{requestID}/reply": {
  4707. "post": {
  4708. "operationId": "question.reply",
  4709. "parameters": [
  4710. {
  4711. "in": "query",
  4712. "name": "directory",
  4713. "schema": {
  4714. "type": "string"
  4715. }
  4716. },
  4717. {
  4718. "in": "query",
  4719. "name": "workspace",
  4720. "schema": {
  4721. "type": "string"
  4722. }
  4723. },
  4724. {
  4725. "in": "path",
  4726. "name": "requestID",
  4727. "schema": {
  4728. "type": "string",
  4729. "pattern": "^que.*"
  4730. },
  4731. "required": true
  4732. }
  4733. ],
  4734. "summary": "Reply to question request",
  4735. "description": "Provide answers to a question request from the AI assistant.",
  4736. "responses": {
  4737. "200": {
  4738. "description": "Question answered successfully",
  4739. "content": {
  4740. "application/json": {
  4741. "schema": {
  4742. "type": "boolean"
  4743. }
  4744. }
  4745. }
  4746. },
  4747. "400": {
  4748. "description": "Bad request",
  4749. "content": {
  4750. "application/json": {
  4751. "schema": {
  4752. "$ref": "#/components/schemas/BadRequestError"
  4753. }
  4754. }
  4755. }
  4756. },
  4757. "404": {
  4758. "description": "Not found",
  4759. "content": {
  4760. "application/json": {
  4761. "schema": {
  4762. "$ref": "#/components/schemas/NotFoundError"
  4763. }
  4764. }
  4765. }
  4766. }
  4767. },
  4768. "requestBody": {
  4769. "content": {
  4770. "application/json": {
  4771. "schema": {
  4772. "type": "object",
  4773. "properties": {
  4774. "answers": {
  4775. "description": "User answers in order of questions (each answer is an array of selected labels)",
  4776. "type": "array",
  4777. "items": {
  4778. "$ref": "#/components/schemas/QuestionAnswer"
  4779. }
  4780. }
  4781. },
  4782. "required": ["answers"]
  4783. }
  4784. }
  4785. }
  4786. },
  4787. "x-codeSamples": [
  4788. {
  4789. "lang": "js",
  4790. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  4791. }
  4792. ]
  4793. }
  4794. },
  4795. "/question/{requestID}/reject": {
  4796. "post": {
  4797. "operationId": "question.reject",
  4798. "parameters": [
  4799. {
  4800. "in": "query",
  4801. "name": "directory",
  4802. "schema": {
  4803. "type": "string"
  4804. }
  4805. },
  4806. {
  4807. "in": "query",
  4808. "name": "workspace",
  4809. "schema": {
  4810. "type": "string"
  4811. }
  4812. },
  4813. {
  4814. "in": "path",
  4815. "name": "requestID",
  4816. "schema": {
  4817. "type": "string",
  4818. "pattern": "^que.*"
  4819. },
  4820. "required": true
  4821. }
  4822. ],
  4823. "summary": "Reject question request",
  4824. "description": "Reject a question request from the AI assistant.",
  4825. "responses": {
  4826. "200": {
  4827. "description": "Question rejected successfully",
  4828. "content": {
  4829. "application/json": {
  4830. "schema": {
  4831. "type": "boolean"
  4832. }
  4833. }
  4834. }
  4835. },
  4836. "400": {
  4837. "description": "Bad request",
  4838. "content": {
  4839. "application/json": {
  4840. "schema": {
  4841. "$ref": "#/components/schemas/BadRequestError"
  4842. }
  4843. }
  4844. }
  4845. },
  4846. "404": {
  4847. "description": "Not found",
  4848. "content": {
  4849. "application/json": {
  4850. "schema": {
  4851. "$ref": "#/components/schemas/NotFoundError"
  4852. }
  4853. }
  4854. }
  4855. }
  4856. },
  4857. "x-codeSamples": [
  4858. {
  4859. "lang": "js",
  4860. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  4861. }
  4862. ]
  4863. }
  4864. },
  4865. "/provider": {
  4866. "get": {
  4867. "operationId": "provider.list",
  4868. "parameters": [
  4869. {
  4870. "in": "query",
  4871. "name": "directory",
  4872. "schema": {
  4873. "type": "string"
  4874. }
  4875. },
  4876. {
  4877. "in": "query",
  4878. "name": "workspace",
  4879. "schema": {
  4880. "type": "string"
  4881. }
  4882. }
  4883. ],
  4884. "summary": "List providers",
  4885. "description": "Get a list of all available AI providers, including both available and connected ones.",
  4886. "responses": {
  4887. "200": {
  4888. "description": "List of providers",
  4889. "content": {
  4890. "application/json": {
  4891. "schema": {
  4892. "type": "object",
  4893. "properties": {
  4894. "all": {
  4895. "type": "array",
  4896. "items": {
  4897. "$ref": "#/components/schemas/Provider"
  4898. }
  4899. },
  4900. "default": {
  4901. "type": "object",
  4902. "propertyNames": {
  4903. "type": "string"
  4904. },
  4905. "additionalProperties": {
  4906. "type": "string"
  4907. }
  4908. },
  4909. "connected": {
  4910. "type": "array",
  4911. "items": {
  4912. "type": "string"
  4913. }
  4914. }
  4915. },
  4916. "required": ["all", "default", "connected"]
  4917. }
  4918. }
  4919. }
  4920. }
  4921. },
  4922. "x-codeSamples": [
  4923. {
  4924. "lang": "js",
  4925. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  4926. }
  4927. ]
  4928. }
  4929. },
  4930. "/provider/auth": {
  4931. "get": {
  4932. "operationId": "provider.auth",
  4933. "parameters": [
  4934. {
  4935. "in": "query",
  4936. "name": "directory",
  4937. "schema": {
  4938. "type": "string"
  4939. }
  4940. },
  4941. {
  4942. "in": "query",
  4943. "name": "workspace",
  4944. "schema": {
  4945. "type": "string"
  4946. }
  4947. }
  4948. ],
  4949. "summary": "Get provider auth methods",
  4950. "description": "Retrieve available authentication methods for all AI providers.",
  4951. "responses": {
  4952. "200": {
  4953. "description": "Provider auth methods",
  4954. "content": {
  4955. "application/json": {
  4956. "schema": {
  4957. "type": "object",
  4958. "propertyNames": {
  4959. "type": "string"
  4960. },
  4961. "additionalProperties": {
  4962. "type": "array",
  4963. "items": {
  4964. "$ref": "#/components/schemas/ProviderAuthMethod"
  4965. }
  4966. }
  4967. }
  4968. }
  4969. }
  4970. }
  4971. },
  4972. "x-codeSamples": [
  4973. {
  4974. "lang": "js",
  4975. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  4976. }
  4977. ]
  4978. }
  4979. },
  4980. "/provider/{providerID}/oauth/authorize": {
  4981. "post": {
  4982. "operationId": "provider.oauth.authorize",
  4983. "parameters": [
  4984. {
  4985. "in": "query",
  4986. "name": "directory",
  4987. "schema": {
  4988. "type": "string"
  4989. }
  4990. },
  4991. {
  4992. "in": "query",
  4993. "name": "workspace",
  4994. "schema": {
  4995. "type": "string"
  4996. }
  4997. },
  4998. {
  4999. "in": "path",
  5000. "name": "providerID",
  5001. "schema": {
  5002. "type": "string"
  5003. },
  5004. "required": true,
  5005. "description": "Provider ID"
  5006. }
  5007. ],
  5008. "summary": "OAuth authorize",
  5009. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  5010. "responses": {
  5011. "200": {
  5012. "description": "Authorization URL and method",
  5013. "content": {
  5014. "application/json": {
  5015. "schema": {
  5016. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  5017. }
  5018. }
  5019. }
  5020. },
  5021. "400": {
  5022. "description": "Bad request",
  5023. "content": {
  5024. "application/json": {
  5025. "schema": {
  5026. "$ref": "#/components/schemas/BadRequestError"
  5027. }
  5028. }
  5029. }
  5030. }
  5031. },
  5032. "requestBody": {
  5033. "content": {
  5034. "application/json": {
  5035. "schema": {
  5036. "type": "object",
  5037. "properties": {
  5038. "method": {
  5039. "description": "Auth method index",
  5040. "type": "number"
  5041. },
  5042. "inputs": {
  5043. "description": "Prompt inputs",
  5044. "type": "object",
  5045. "propertyNames": {
  5046. "type": "string"
  5047. },
  5048. "additionalProperties": {
  5049. "type": "string"
  5050. }
  5051. }
  5052. },
  5053. "required": ["method"]
  5054. }
  5055. }
  5056. }
  5057. },
  5058. "x-codeSamples": [
  5059. {
  5060. "lang": "js",
  5061. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  5062. }
  5063. ]
  5064. }
  5065. },
  5066. "/provider/{providerID}/oauth/callback": {
  5067. "post": {
  5068. "operationId": "provider.oauth.callback",
  5069. "parameters": [
  5070. {
  5071. "in": "query",
  5072. "name": "directory",
  5073. "schema": {
  5074. "type": "string"
  5075. }
  5076. },
  5077. {
  5078. "in": "query",
  5079. "name": "workspace",
  5080. "schema": {
  5081. "type": "string"
  5082. }
  5083. },
  5084. {
  5085. "in": "path",
  5086. "name": "providerID",
  5087. "schema": {
  5088. "type": "string"
  5089. },
  5090. "required": true,
  5091. "description": "Provider ID"
  5092. }
  5093. ],
  5094. "summary": "OAuth callback",
  5095. "description": "Handle the OAuth callback from a provider after user authorization.",
  5096. "responses": {
  5097. "200": {
  5098. "description": "OAuth callback processed successfully",
  5099. "content": {
  5100. "application/json": {
  5101. "schema": {
  5102. "type": "boolean"
  5103. }
  5104. }
  5105. }
  5106. },
  5107. "400": {
  5108. "description": "Bad request",
  5109. "content": {
  5110. "application/json": {
  5111. "schema": {
  5112. "$ref": "#/components/schemas/BadRequestError"
  5113. }
  5114. }
  5115. }
  5116. }
  5117. },
  5118. "requestBody": {
  5119. "content": {
  5120. "application/json": {
  5121. "schema": {
  5122. "type": "object",
  5123. "properties": {
  5124. "method": {
  5125. "description": "Auth method index",
  5126. "type": "number"
  5127. },
  5128. "code": {
  5129. "description": "OAuth authorization code",
  5130. "type": "string"
  5131. }
  5132. },
  5133. "required": ["method"]
  5134. }
  5135. }
  5136. }
  5137. },
  5138. "x-codeSamples": [
  5139. {
  5140. "lang": "js",
  5141. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  5142. }
  5143. ]
  5144. }
  5145. },
  5146. "/find": {
  5147. "get": {
  5148. "operationId": "find.text",
  5149. "parameters": [
  5150. {
  5151. "in": "query",
  5152. "name": "directory",
  5153. "schema": {
  5154. "type": "string"
  5155. }
  5156. },
  5157. {
  5158. "in": "query",
  5159. "name": "workspace",
  5160. "schema": {
  5161. "type": "string"
  5162. }
  5163. },
  5164. {
  5165. "in": "query",
  5166. "name": "pattern",
  5167. "schema": {
  5168. "type": "string"
  5169. },
  5170. "required": true
  5171. }
  5172. ],
  5173. "summary": "Find text",
  5174. "description": "Search for text patterns across files in the project using ripgrep.",
  5175. "responses": {
  5176. "200": {
  5177. "description": "Matches",
  5178. "content": {
  5179. "application/json": {
  5180. "schema": {
  5181. "type": "array",
  5182. "items": {
  5183. "type": "object",
  5184. "properties": {
  5185. "path": {
  5186. "type": "object",
  5187. "properties": {
  5188. "text": {
  5189. "type": "string"
  5190. }
  5191. },
  5192. "required": ["text"]
  5193. },
  5194. "lines": {
  5195. "type": "object",
  5196. "properties": {
  5197. "text": {
  5198. "type": "string"
  5199. }
  5200. },
  5201. "required": ["text"]
  5202. },
  5203. "line_number": {
  5204. "type": "number"
  5205. },
  5206. "absolute_offset": {
  5207. "type": "number"
  5208. },
  5209. "submatches": {
  5210. "type": "array",
  5211. "items": {
  5212. "type": "object",
  5213. "properties": {
  5214. "match": {
  5215. "type": "object",
  5216. "properties": {
  5217. "text": {
  5218. "type": "string"
  5219. }
  5220. },
  5221. "required": ["text"]
  5222. },
  5223. "start": {
  5224. "type": "number"
  5225. },
  5226. "end": {
  5227. "type": "number"
  5228. }
  5229. },
  5230. "required": ["match", "start", "end"]
  5231. }
  5232. }
  5233. },
  5234. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  5235. }
  5236. }
  5237. }
  5238. }
  5239. }
  5240. },
  5241. "x-codeSamples": [
  5242. {
  5243. "lang": "js",
  5244. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  5245. }
  5246. ]
  5247. }
  5248. },
  5249. "/find/file": {
  5250. "get": {
  5251. "operationId": "find.files",
  5252. "parameters": [
  5253. {
  5254. "in": "query",
  5255. "name": "directory",
  5256. "schema": {
  5257. "type": "string"
  5258. }
  5259. },
  5260. {
  5261. "in": "query",
  5262. "name": "workspace",
  5263. "schema": {
  5264. "type": "string"
  5265. }
  5266. },
  5267. {
  5268. "in": "query",
  5269. "name": "query",
  5270. "schema": {
  5271. "type": "string"
  5272. },
  5273. "required": true
  5274. },
  5275. {
  5276. "in": "query",
  5277. "name": "dirs",
  5278. "schema": {
  5279. "type": "string",
  5280. "enum": ["true", "false"]
  5281. }
  5282. },
  5283. {
  5284. "in": "query",
  5285. "name": "type",
  5286. "schema": {
  5287. "type": "string",
  5288. "enum": ["file", "directory"]
  5289. }
  5290. },
  5291. {
  5292. "in": "query",
  5293. "name": "limit",
  5294. "schema": {
  5295. "type": "integer",
  5296. "minimum": 1,
  5297. "maximum": 200
  5298. }
  5299. }
  5300. ],
  5301. "summary": "Find files",
  5302. "description": "Search for files or directories by name or pattern in the project directory.",
  5303. "responses": {
  5304. "200": {
  5305. "description": "File paths",
  5306. "content": {
  5307. "application/json": {
  5308. "schema": {
  5309. "type": "array",
  5310. "items": {
  5311. "type": "string"
  5312. }
  5313. }
  5314. }
  5315. }
  5316. }
  5317. },
  5318. "x-codeSamples": [
  5319. {
  5320. "lang": "js",
  5321. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  5322. }
  5323. ]
  5324. }
  5325. },
  5326. "/find/symbol": {
  5327. "get": {
  5328. "operationId": "find.symbols",
  5329. "parameters": [
  5330. {
  5331. "in": "query",
  5332. "name": "directory",
  5333. "schema": {
  5334. "type": "string"
  5335. }
  5336. },
  5337. {
  5338. "in": "query",
  5339. "name": "workspace",
  5340. "schema": {
  5341. "type": "string"
  5342. }
  5343. },
  5344. {
  5345. "in": "query",
  5346. "name": "query",
  5347. "schema": {
  5348. "type": "string"
  5349. },
  5350. "required": true
  5351. }
  5352. ],
  5353. "summary": "Find symbols",
  5354. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  5355. "responses": {
  5356. "200": {
  5357. "description": "Symbols",
  5358. "content": {
  5359. "application/json": {
  5360. "schema": {
  5361. "type": "array",
  5362. "items": {
  5363. "$ref": "#/components/schemas/Symbol"
  5364. }
  5365. }
  5366. }
  5367. }
  5368. }
  5369. },
  5370. "x-codeSamples": [
  5371. {
  5372. "lang": "js",
  5373. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  5374. }
  5375. ]
  5376. }
  5377. },
  5378. "/file": {
  5379. "get": {
  5380. "operationId": "file.list",
  5381. "parameters": [
  5382. {
  5383. "in": "query",
  5384. "name": "directory",
  5385. "schema": {
  5386. "type": "string"
  5387. }
  5388. },
  5389. {
  5390. "in": "query",
  5391. "name": "workspace",
  5392. "schema": {
  5393. "type": "string"
  5394. }
  5395. },
  5396. {
  5397. "in": "query",
  5398. "name": "path",
  5399. "schema": {
  5400. "type": "string"
  5401. },
  5402. "required": true
  5403. }
  5404. ],
  5405. "summary": "List files",
  5406. "description": "List files and directories in a specified path.",
  5407. "responses": {
  5408. "200": {
  5409. "description": "Files and directories",
  5410. "content": {
  5411. "application/json": {
  5412. "schema": {
  5413. "type": "array",
  5414. "items": {
  5415. "$ref": "#/components/schemas/FileNode"
  5416. }
  5417. }
  5418. }
  5419. }
  5420. }
  5421. },
  5422. "x-codeSamples": [
  5423. {
  5424. "lang": "js",
  5425. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  5426. }
  5427. ]
  5428. }
  5429. },
  5430. "/file/content": {
  5431. "get": {
  5432. "operationId": "file.read",
  5433. "parameters": [
  5434. {
  5435. "in": "query",
  5436. "name": "directory",
  5437. "schema": {
  5438. "type": "string"
  5439. }
  5440. },
  5441. {
  5442. "in": "query",
  5443. "name": "workspace",
  5444. "schema": {
  5445. "type": "string"
  5446. }
  5447. },
  5448. {
  5449. "in": "query",
  5450. "name": "path",
  5451. "schema": {
  5452. "type": "string"
  5453. },
  5454. "required": true
  5455. }
  5456. ],
  5457. "summary": "Read file",
  5458. "description": "Read the content of a specified file.",
  5459. "responses": {
  5460. "200": {
  5461. "description": "File content",
  5462. "content": {
  5463. "application/json": {
  5464. "schema": {
  5465. "$ref": "#/components/schemas/FileContent"
  5466. }
  5467. }
  5468. }
  5469. }
  5470. },
  5471. "x-codeSamples": [
  5472. {
  5473. "lang": "js",
  5474. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  5475. }
  5476. ]
  5477. }
  5478. },
  5479. "/file/status": {
  5480. "get": {
  5481. "operationId": "file.status",
  5482. "parameters": [
  5483. {
  5484. "in": "query",
  5485. "name": "directory",
  5486. "schema": {
  5487. "type": "string"
  5488. }
  5489. },
  5490. {
  5491. "in": "query",
  5492. "name": "workspace",
  5493. "schema": {
  5494. "type": "string"
  5495. }
  5496. }
  5497. ],
  5498. "summary": "Get file status",
  5499. "description": "Get the git status of all files in the project.",
  5500. "responses": {
  5501. "200": {
  5502. "description": "File status",
  5503. "content": {
  5504. "application/json": {
  5505. "schema": {
  5506. "type": "array",
  5507. "items": {
  5508. "$ref": "#/components/schemas/File"
  5509. }
  5510. }
  5511. }
  5512. }
  5513. }
  5514. },
  5515. "x-codeSamples": [
  5516. {
  5517. "lang": "js",
  5518. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  5519. }
  5520. ]
  5521. }
  5522. },
  5523. "/event": {
  5524. "get": {
  5525. "operationId": "event.subscribe",
  5526. "parameters": [
  5527. {
  5528. "in": "query",
  5529. "name": "directory",
  5530. "schema": {
  5531. "type": "string"
  5532. }
  5533. },
  5534. {
  5535. "in": "query",
  5536. "name": "workspace",
  5537. "schema": {
  5538. "type": "string"
  5539. }
  5540. }
  5541. ],
  5542. "summary": "Subscribe to events",
  5543. "description": "Get events",
  5544. "responses": {
  5545. "200": {
  5546. "description": "Event stream",
  5547. "content": {
  5548. "text/event-stream": {
  5549. "schema": {
  5550. "$ref": "#/components/schemas/Event"
  5551. }
  5552. }
  5553. }
  5554. }
  5555. },
  5556. "x-codeSamples": [
  5557. {
  5558. "lang": "js",
  5559. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5560. }
  5561. ]
  5562. }
  5563. },
  5564. "/mcp": {
  5565. "get": {
  5566. "operationId": "mcp.status",
  5567. "parameters": [
  5568. {
  5569. "in": "query",
  5570. "name": "directory",
  5571. "schema": {
  5572. "type": "string"
  5573. }
  5574. },
  5575. {
  5576. "in": "query",
  5577. "name": "workspace",
  5578. "schema": {
  5579. "type": "string"
  5580. }
  5581. }
  5582. ],
  5583. "summary": "Get MCP status",
  5584. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  5585. "responses": {
  5586. "200": {
  5587. "description": "MCP server status",
  5588. "content": {
  5589. "application/json": {
  5590. "schema": {
  5591. "type": "object",
  5592. "propertyNames": {
  5593. "type": "string"
  5594. },
  5595. "additionalProperties": {
  5596. "$ref": "#/components/schemas/MCPStatus"
  5597. }
  5598. }
  5599. }
  5600. }
  5601. }
  5602. },
  5603. "x-codeSamples": [
  5604. {
  5605. "lang": "js",
  5606. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  5607. }
  5608. ]
  5609. },
  5610. "post": {
  5611. "operationId": "mcp.add",
  5612. "parameters": [
  5613. {
  5614. "in": "query",
  5615. "name": "directory",
  5616. "schema": {
  5617. "type": "string"
  5618. }
  5619. },
  5620. {
  5621. "in": "query",
  5622. "name": "workspace",
  5623. "schema": {
  5624. "type": "string"
  5625. }
  5626. }
  5627. ],
  5628. "summary": "Add MCP server",
  5629. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  5630. "responses": {
  5631. "200": {
  5632. "description": "MCP server added successfully",
  5633. "content": {
  5634. "application/json": {
  5635. "schema": {
  5636. "type": "object",
  5637. "propertyNames": {
  5638. "type": "string"
  5639. },
  5640. "additionalProperties": {
  5641. "$ref": "#/components/schemas/MCPStatus"
  5642. }
  5643. }
  5644. }
  5645. }
  5646. },
  5647. "400": {
  5648. "description": "Bad request",
  5649. "content": {
  5650. "application/json": {
  5651. "schema": {
  5652. "$ref": "#/components/schemas/BadRequestError"
  5653. }
  5654. }
  5655. }
  5656. }
  5657. },
  5658. "requestBody": {
  5659. "content": {
  5660. "application/json": {
  5661. "schema": {
  5662. "type": "object",
  5663. "properties": {
  5664. "name": {
  5665. "type": "string"
  5666. },
  5667. "config": {
  5668. "anyOf": [
  5669. {
  5670. "$ref": "#/components/schemas/McpLocalConfig"
  5671. },
  5672. {
  5673. "$ref": "#/components/schemas/McpRemoteConfig"
  5674. }
  5675. ]
  5676. }
  5677. },
  5678. "required": ["name", "config"]
  5679. }
  5680. }
  5681. }
  5682. },
  5683. "x-codeSamples": [
  5684. {
  5685. "lang": "js",
  5686. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  5687. }
  5688. ]
  5689. }
  5690. },
  5691. "/mcp/{name}/auth": {
  5692. "post": {
  5693. "operationId": "mcp.auth.start",
  5694. "parameters": [
  5695. {
  5696. "in": "query",
  5697. "name": "directory",
  5698. "schema": {
  5699. "type": "string"
  5700. }
  5701. },
  5702. {
  5703. "in": "query",
  5704. "name": "workspace",
  5705. "schema": {
  5706. "type": "string"
  5707. }
  5708. },
  5709. {
  5710. "schema": {
  5711. "type": "string"
  5712. },
  5713. "in": "path",
  5714. "name": "name",
  5715. "required": true
  5716. }
  5717. ],
  5718. "summary": "Start MCP OAuth",
  5719. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  5720. "responses": {
  5721. "200": {
  5722. "description": "OAuth flow started",
  5723. "content": {
  5724. "application/json": {
  5725. "schema": {
  5726. "type": "object",
  5727. "properties": {
  5728. "authorizationUrl": {
  5729. "description": "URL to open in browser for authorization",
  5730. "type": "string"
  5731. }
  5732. },
  5733. "required": ["authorizationUrl"]
  5734. }
  5735. }
  5736. }
  5737. },
  5738. "400": {
  5739. "description": "Bad request",
  5740. "content": {
  5741. "application/json": {
  5742. "schema": {
  5743. "$ref": "#/components/schemas/BadRequestError"
  5744. }
  5745. }
  5746. }
  5747. },
  5748. "404": {
  5749. "description": "Not found",
  5750. "content": {
  5751. "application/json": {
  5752. "schema": {
  5753. "$ref": "#/components/schemas/NotFoundError"
  5754. }
  5755. }
  5756. }
  5757. }
  5758. },
  5759. "x-codeSamples": [
  5760. {
  5761. "lang": "js",
  5762. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  5763. }
  5764. ]
  5765. },
  5766. "delete": {
  5767. "operationId": "mcp.auth.remove",
  5768. "parameters": [
  5769. {
  5770. "in": "query",
  5771. "name": "directory",
  5772. "schema": {
  5773. "type": "string"
  5774. }
  5775. },
  5776. {
  5777. "in": "query",
  5778. "name": "workspace",
  5779. "schema": {
  5780. "type": "string"
  5781. }
  5782. },
  5783. {
  5784. "schema": {
  5785. "type": "string"
  5786. },
  5787. "in": "path",
  5788. "name": "name",
  5789. "required": true
  5790. }
  5791. ],
  5792. "summary": "Remove MCP OAuth",
  5793. "description": "Remove OAuth credentials for an MCP server",
  5794. "responses": {
  5795. "200": {
  5796. "description": "OAuth credentials removed",
  5797. "content": {
  5798. "application/json": {
  5799. "schema": {
  5800. "type": "object",
  5801. "properties": {
  5802. "success": {
  5803. "type": "boolean",
  5804. "const": true
  5805. }
  5806. },
  5807. "required": ["success"]
  5808. }
  5809. }
  5810. }
  5811. },
  5812. "404": {
  5813. "description": "Not found",
  5814. "content": {
  5815. "application/json": {
  5816. "schema": {
  5817. "$ref": "#/components/schemas/NotFoundError"
  5818. }
  5819. }
  5820. }
  5821. }
  5822. },
  5823. "x-codeSamples": [
  5824. {
  5825. "lang": "js",
  5826. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  5827. }
  5828. ]
  5829. }
  5830. },
  5831. "/mcp/{name}/auth/callback": {
  5832. "post": {
  5833. "operationId": "mcp.auth.callback",
  5834. "parameters": [
  5835. {
  5836. "in": "query",
  5837. "name": "directory",
  5838. "schema": {
  5839. "type": "string"
  5840. }
  5841. },
  5842. {
  5843. "in": "query",
  5844. "name": "workspace",
  5845. "schema": {
  5846. "type": "string"
  5847. }
  5848. },
  5849. {
  5850. "schema": {
  5851. "type": "string"
  5852. },
  5853. "in": "path",
  5854. "name": "name",
  5855. "required": true
  5856. }
  5857. ],
  5858. "summary": "Complete MCP OAuth",
  5859. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  5860. "responses": {
  5861. "200": {
  5862. "description": "OAuth authentication completed",
  5863. "content": {
  5864. "application/json": {
  5865. "schema": {
  5866. "$ref": "#/components/schemas/MCPStatus"
  5867. }
  5868. }
  5869. }
  5870. },
  5871. "400": {
  5872. "description": "Bad request",
  5873. "content": {
  5874. "application/json": {
  5875. "schema": {
  5876. "$ref": "#/components/schemas/BadRequestError"
  5877. }
  5878. }
  5879. }
  5880. },
  5881. "404": {
  5882. "description": "Not found",
  5883. "content": {
  5884. "application/json": {
  5885. "schema": {
  5886. "$ref": "#/components/schemas/NotFoundError"
  5887. }
  5888. }
  5889. }
  5890. }
  5891. },
  5892. "requestBody": {
  5893. "content": {
  5894. "application/json": {
  5895. "schema": {
  5896. "type": "object",
  5897. "properties": {
  5898. "code": {
  5899. "description": "Authorization code from OAuth callback",
  5900. "type": "string"
  5901. }
  5902. },
  5903. "required": ["code"]
  5904. }
  5905. }
  5906. }
  5907. },
  5908. "x-codeSamples": [
  5909. {
  5910. "lang": "js",
  5911. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  5912. }
  5913. ]
  5914. }
  5915. },
  5916. "/mcp/{name}/auth/authenticate": {
  5917. "post": {
  5918. "operationId": "mcp.auth.authenticate",
  5919. "parameters": [
  5920. {
  5921. "in": "query",
  5922. "name": "directory",
  5923. "schema": {
  5924. "type": "string"
  5925. }
  5926. },
  5927. {
  5928. "in": "query",
  5929. "name": "workspace",
  5930. "schema": {
  5931. "type": "string"
  5932. }
  5933. },
  5934. {
  5935. "schema": {
  5936. "type": "string"
  5937. },
  5938. "in": "path",
  5939. "name": "name",
  5940. "required": true
  5941. }
  5942. ],
  5943. "summary": "Authenticate MCP OAuth",
  5944. "description": "Start OAuth flow and wait for callback (opens browser)",
  5945. "responses": {
  5946. "200": {
  5947. "description": "OAuth authentication completed",
  5948. "content": {
  5949. "application/json": {
  5950. "schema": {
  5951. "$ref": "#/components/schemas/MCPStatus"
  5952. }
  5953. }
  5954. }
  5955. },
  5956. "400": {
  5957. "description": "Bad request",
  5958. "content": {
  5959. "application/json": {
  5960. "schema": {
  5961. "$ref": "#/components/schemas/BadRequestError"
  5962. }
  5963. }
  5964. }
  5965. },
  5966. "404": {
  5967. "description": "Not found",
  5968. "content": {
  5969. "application/json": {
  5970. "schema": {
  5971. "$ref": "#/components/schemas/NotFoundError"
  5972. }
  5973. }
  5974. }
  5975. }
  5976. },
  5977. "x-codeSamples": [
  5978. {
  5979. "lang": "js",
  5980. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  5981. }
  5982. ]
  5983. }
  5984. },
  5985. "/mcp/{name}/connect": {
  5986. "post": {
  5987. "operationId": "mcp.connect",
  5988. "parameters": [
  5989. {
  5990. "in": "query",
  5991. "name": "directory",
  5992. "schema": {
  5993. "type": "string"
  5994. }
  5995. },
  5996. {
  5997. "in": "query",
  5998. "name": "workspace",
  5999. "schema": {
  6000. "type": "string"
  6001. }
  6002. },
  6003. {
  6004. "in": "path",
  6005. "name": "name",
  6006. "schema": {
  6007. "type": "string"
  6008. },
  6009. "required": true
  6010. }
  6011. ],
  6012. "description": "Connect an MCP server",
  6013. "responses": {
  6014. "200": {
  6015. "description": "MCP server connected successfully",
  6016. "content": {
  6017. "application/json": {
  6018. "schema": {
  6019. "type": "boolean"
  6020. }
  6021. }
  6022. }
  6023. }
  6024. },
  6025. "x-codeSamples": [
  6026. {
  6027. "lang": "js",
  6028. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  6029. }
  6030. ]
  6031. }
  6032. },
  6033. "/mcp/{name}/disconnect": {
  6034. "post": {
  6035. "operationId": "mcp.disconnect",
  6036. "parameters": [
  6037. {
  6038. "in": "query",
  6039. "name": "directory",
  6040. "schema": {
  6041. "type": "string"
  6042. }
  6043. },
  6044. {
  6045. "in": "query",
  6046. "name": "workspace",
  6047. "schema": {
  6048. "type": "string"
  6049. }
  6050. },
  6051. {
  6052. "in": "path",
  6053. "name": "name",
  6054. "schema": {
  6055. "type": "string"
  6056. },
  6057. "required": true
  6058. }
  6059. ],
  6060. "description": "Disconnect an MCP server",
  6061. "responses": {
  6062. "200": {
  6063. "description": "MCP server disconnected successfully",
  6064. "content": {
  6065. "application/json": {
  6066. "schema": {
  6067. "type": "boolean"
  6068. }
  6069. }
  6070. }
  6071. }
  6072. },
  6073. "x-codeSamples": [
  6074. {
  6075. "lang": "js",
  6076. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  6077. }
  6078. ]
  6079. }
  6080. },
  6081. "/tui/append-prompt": {
  6082. "post": {
  6083. "operationId": "tui.appendPrompt",
  6084. "parameters": [
  6085. {
  6086. "in": "query",
  6087. "name": "directory",
  6088. "schema": {
  6089. "type": "string"
  6090. }
  6091. },
  6092. {
  6093. "in": "query",
  6094. "name": "workspace",
  6095. "schema": {
  6096. "type": "string"
  6097. }
  6098. }
  6099. ],
  6100. "summary": "Append TUI prompt",
  6101. "description": "Append prompt to the TUI",
  6102. "responses": {
  6103. "200": {
  6104. "description": "Prompt processed successfully",
  6105. "content": {
  6106. "application/json": {
  6107. "schema": {
  6108. "type": "boolean"
  6109. }
  6110. }
  6111. }
  6112. },
  6113. "400": {
  6114. "description": "Bad request",
  6115. "content": {
  6116. "application/json": {
  6117. "schema": {
  6118. "$ref": "#/components/schemas/BadRequestError"
  6119. }
  6120. }
  6121. }
  6122. }
  6123. },
  6124. "requestBody": {
  6125. "content": {
  6126. "application/json": {
  6127. "schema": {
  6128. "type": "object",
  6129. "properties": {
  6130. "text": {
  6131. "type": "string"
  6132. }
  6133. },
  6134. "required": ["text"]
  6135. }
  6136. }
  6137. }
  6138. },
  6139. "x-codeSamples": [
  6140. {
  6141. "lang": "js",
  6142. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  6143. }
  6144. ]
  6145. }
  6146. },
  6147. "/tui/open-help": {
  6148. "post": {
  6149. "operationId": "tui.openHelp",
  6150. "parameters": [
  6151. {
  6152. "in": "query",
  6153. "name": "directory",
  6154. "schema": {
  6155. "type": "string"
  6156. }
  6157. },
  6158. {
  6159. "in": "query",
  6160. "name": "workspace",
  6161. "schema": {
  6162. "type": "string"
  6163. }
  6164. }
  6165. ],
  6166. "summary": "Open help dialog",
  6167. "description": "Open the help dialog in the TUI to display user assistance information.",
  6168. "responses": {
  6169. "200": {
  6170. "description": "Help dialog opened successfully",
  6171. "content": {
  6172. "application/json": {
  6173. "schema": {
  6174. "type": "boolean"
  6175. }
  6176. }
  6177. }
  6178. }
  6179. },
  6180. "x-codeSamples": [
  6181. {
  6182. "lang": "js",
  6183. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  6184. }
  6185. ]
  6186. }
  6187. },
  6188. "/tui/open-sessions": {
  6189. "post": {
  6190. "operationId": "tui.openSessions",
  6191. "parameters": [
  6192. {
  6193. "in": "query",
  6194. "name": "directory",
  6195. "schema": {
  6196. "type": "string"
  6197. }
  6198. },
  6199. {
  6200. "in": "query",
  6201. "name": "workspace",
  6202. "schema": {
  6203. "type": "string"
  6204. }
  6205. }
  6206. ],
  6207. "summary": "Open sessions dialog",
  6208. "description": "Open the session dialog",
  6209. "responses": {
  6210. "200": {
  6211. "description": "Session dialog opened successfully",
  6212. "content": {
  6213. "application/json": {
  6214. "schema": {
  6215. "type": "boolean"
  6216. }
  6217. }
  6218. }
  6219. }
  6220. },
  6221. "x-codeSamples": [
  6222. {
  6223. "lang": "js",
  6224. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  6225. }
  6226. ]
  6227. }
  6228. },
  6229. "/tui/open-themes": {
  6230. "post": {
  6231. "operationId": "tui.openThemes",
  6232. "parameters": [
  6233. {
  6234. "in": "query",
  6235. "name": "directory",
  6236. "schema": {
  6237. "type": "string"
  6238. }
  6239. },
  6240. {
  6241. "in": "query",
  6242. "name": "workspace",
  6243. "schema": {
  6244. "type": "string"
  6245. }
  6246. }
  6247. ],
  6248. "summary": "Open themes dialog",
  6249. "description": "Open the theme dialog",
  6250. "responses": {
  6251. "200": {
  6252. "description": "Theme dialog opened successfully",
  6253. "content": {
  6254. "application/json": {
  6255. "schema": {
  6256. "type": "boolean"
  6257. }
  6258. }
  6259. }
  6260. }
  6261. },
  6262. "x-codeSamples": [
  6263. {
  6264. "lang": "js",
  6265. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  6266. }
  6267. ]
  6268. }
  6269. },
  6270. "/tui/open-models": {
  6271. "post": {
  6272. "operationId": "tui.openModels",
  6273. "parameters": [
  6274. {
  6275. "in": "query",
  6276. "name": "directory",
  6277. "schema": {
  6278. "type": "string"
  6279. }
  6280. },
  6281. {
  6282. "in": "query",
  6283. "name": "workspace",
  6284. "schema": {
  6285. "type": "string"
  6286. }
  6287. }
  6288. ],
  6289. "summary": "Open models dialog",
  6290. "description": "Open the model dialog",
  6291. "responses": {
  6292. "200": {
  6293. "description": "Model dialog opened successfully",
  6294. "content": {
  6295. "application/json": {
  6296. "schema": {
  6297. "type": "boolean"
  6298. }
  6299. }
  6300. }
  6301. }
  6302. },
  6303. "x-codeSamples": [
  6304. {
  6305. "lang": "js",
  6306. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  6307. }
  6308. ]
  6309. }
  6310. },
  6311. "/tui/submit-prompt": {
  6312. "post": {
  6313. "operationId": "tui.submitPrompt",
  6314. "parameters": [
  6315. {
  6316. "in": "query",
  6317. "name": "directory",
  6318. "schema": {
  6319. "type": "string"
  6320. }
  6321. },
  6322. {
  6323. "in": "query",
  6324. "name": "workspace",
  6325. "schema": {
  6326. "type": "string"
  6327. }
  6328. }
  6329. ],
  6330. "summary": "Submit TUI prompt",
  6331. "description": "Submit the prompt",
  6332. "responses": {
  6333. "200": {
  6334. "description": "Prompt submitted successfully",
  6335. "content": {
  6336. "application/json": {
  6337. "schema": {
  6338. "type": "boolean"
  6339. }
  6340. }
  6341. }
  6342. }
  6343. },
  6344. "x-codeSamples": [
  6345. {
  6346. "lang": "js",
  6347. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  6348. }
  6349. ]
  6350. }
  6351. },
  6352. "/tui/clear-prompt": {
  6353. "post": {
  6354. "operationId": "tui.clearPrompt",
  6355. "parameters": [
  6356. {
  6357. "in": "query",
  6358. "name": "directory",
  6359. "schema": {
  6360. "type": "string"
  6361. }
  6362. },
  6363. {
  6364. "in": "query",
  6365. "name": "workspace",
  6366. "schema": {
  6367. "type": "string"
  6368. }
  6369. }
  6370. ],
  6371. "summary": "Clear TUI prompt",
  6372. "description": "Clear the prompt",
  6373. "responses": {
  6374. "200": {
  6375. "description": "Prompt cleared successfully",
  6376. "content": {
  6377. "application/json": {
  6378. "schema": {
  6379. "type": "boolean"
  6380. }
  6381. }
  6382. }
  6383. }
  6384. },
  6385. "x-codeSamples": [
  6386. {
  6387. "lang": "js",
  6388. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  6389. }
  6390. ]
  6391. }
  6392. },
  6393. "/tui/execute-command": {
  6394. "post": {
  6395. "operationId": "tui.executeCommand",
  6396. "parameters": [
  6397. {
  6398. "in": "query",
  6399. "name": "directory",
  6400. "schema": {
  6401. "type": "string"
  6402. }
  6403. },
  6404. {
  6405. "in": "query",
  6406. "name": "workspace",
  6407. "schema": {
  6408. "type": "string"
  6409. }
  6410. }
  6411. ],
  6412. "summary": "Execute TUI command",
  6413. "description": "Execute a TUI command (e.g. agent_cycle)",
  6414. "responses": {
  6415. "200": {
  6416. "description": "Command executed successfully",
  6417. "content": {
  6418. "application/json": {
  6419. "schema": {
  6420. "type": "boolean"
  6421. }
  6422. }
  6423. }
  6424. },
  6425. "400": {
  6426. "description": "Bad request",
  6427. "content": {
  6428. "application/json": {
  6429. "schema": {
  6430. "$ref": "#/components/schemas/BadRequestError"
  6431. }
  6432. }
  6433. }
  6434. }
  6435. },
  6436. "requestBody": {
  6437. "content": {
  6438. "application/json": {
  6439. "schema": {
  6440. "type": "object",
  6441. "properties": {
  6442. "command": {
  6443. "type": "string"
  6444. }
  6445. },
  6446. "required": ["command"]
  6447. }
  6448. }
  6449. }
  6450. },
  6451. "x-codeSamples": [
  6452. {
  6453. "lang": "js",
  6454. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  6455. }
  6456. ]
  6457. }
  6458. },
  6459. "/tui/show-toast": {
  6460. "post": {
  6461. "operationId": "tui.showToast",
  6462. "parameters": [
  6463. {
  6464. "in": "query",
  6465. "name": "directory",
  6466. "schema": {
  6467. "type": "string"
  6468. }
  6469. },
  6470. {
  6471. "in": "query",
  6472. "name": "workspace",
  6473. "schema": {
  6474. "type": "string"
  6475. }
  6476. }
  6477. ],
  6478. "summary": "Show TUI toast",
  6479. "description": "Show a toast notification in the TUI",
  6480. "responses": {
  6481. "200": {
  6482. "description": "Toast notification shown successfully",
  6483. "content": {
  6484. "application/json": {
  6485. "schema": {
  6486. "type": "boolean"
  6487. }
  6488. }
  6489. }
  6490. }
  6491. },
  6492. "requestBody": {
  6493. "content": {
  6494. "application/json": {
  6495. "schema": {
  6496. "type": "object",
  6497. "properties": {
  6498. "title": {
  6499. "type": "string"
  6500. },
  6501. "message": {
  6502. "type": "string"
  6503. },
  6504. "variant": {
  6505. "type": "string",
  6506. "enum": ["info", "success", "warning", "error"]
  6507. },
  6508. "duration": {
  6509. "description": "Duration in milliseconds",
  6510. "default": 5000,
  6511. "type": "number"
  6512. }
  6513. },
  6514. "required": ["message", "variant"]
  6515. }
  6516. }
  6517. }
  6518. },
  6519. "x-codeSamples": [
  6520. {
  6521. "lang": "js",
  6522. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  6523. }
  6524. ]
  6525. }
  6526. },
  6527. "/tui/publish": {
  6528. "post": {
  6529. "operationId": "tui.publish",
  6530. "parameters": [
  6531. {
  6532. "in": "query",
  6533. "name": "directory",
  6534. "schema": {
  6535. "type": "string"
  6536. }
  6537. },
  6538. {
  6539. "in": "query",
  6540. "name": "workspace",
  6541. "schema": {
  6542. "type": "string"
  6543. }
  6544. }
  6545. ],
  6546. "summary": "Publish TUI event",
  6547. "description": "Publish a TUI event",
  6548. "responses": {
  6549. "200": {
  6550. "description": "Event published successfully",
  6551. "content": {
  6552. "application/json": {
  6553. "schema": {
  6554. "type": "boolean"
  6555. }
  6556. }
  6557. }
  6558. },
  6559. "400": {
  6560. "description": "Bad request",
  6561. "content": {
  6562. "application/json": {
  6563. "schema": {
  6564. "$ref": "#/components/schemas/BadRequestError"
  6565. }
  6566. }
  6567. }
  6568. }
  6569. },
  6570. "requestBody": {
  6571. "content": {
  6572. "application/json": {
  6573. "schema": {
  6574. "anyOf": [
  6575. {
  6576. "$ref": "#/components/schemas/Event.tui.prompt.append"
  6577. },
  6578. {
  6579. "$ref": "#/components/schemas/Event.tui.command.execute"
  6580. },
  6581. {
  6582. "$ref": "#/components/schemas/Event.tui.toast.show"
  6583. },
  6584. {
  6585. "$ref": "#/components/schemas/Event.tui.session.select"
  6586. }
  6587. ]
  6588. }
  6589. }
  6590. }
  6591. },
  6592. "x-codeSamples": [
  6593. {
  6594. "lang": "js",
  6595. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  6596. }
  6597. ]
  6598. }
  6599. },
  6600. "/tui/select-session": {
  6601. "post": {
  6602. "operationId": "tui.selectSession",
  6603. "parameters": [
  6604. {
  6605. "in": "query",
  6606. "name": "directory",
  6607. "schema": {
  6608. "type": "string"
  6609. }
  6610. },
  6611. {
  6612. "in": "query",
  6613. "name": "workspace",
  6614. "schema": {
  6615. "type": "string"
  6616. }
  6617. }
  6618. ],
  6619. "summary": "Select session",
  6620. "description": "Navigate the TUI to display the specified session.",
  6621. "responses": {
  6622. "200": {
  6623. "description": "Session selected successfully",
  6624. "content": {
  6625. "application/json": {
  6626. "schema": {
  6627. "type": "boolean"
  6628. }
  6629. }
  6630. }
  6631. },
  6632. "400": {
  6633. "description": "Bad request",
  6634. "content": {
  6635. "application/json": {
  6636. "schema": {
  6637. "$ref": "#/components/schemas/BadRequestError"
  6638. }
  6639. }
  6640. }
  6641. },
  6642. "404": {
  6643. "description": "Not found",
  6644. "content": {
  6645. "application/json": {
  6646. "schema": {
  6647. "$ref": "#/components/schemas/NotFoundError"
  6648. }
  6649. }
  6650. }
  6651. }
  6652. },
  6653. "requestBody": {
  6654. "content": {
  6655. "application/json": {
  6656. "schema": {
  6657. "type": "object",
  6658. "properties": {
  6659. "sessionID": {
  6660. "description": "Session ID to navigate to",
  6661. "type": "string",
  6662. "pattern": "^ses.*"
  6663. }
  6664. },
  6665. "required": ["sessionID"]
  6666. }
  6667. }
  6668. }
  6669. },
  6670. "x-codeSamples": [
  6671. {
  6672. "lang": "js",
  6673. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  6674. }
  6675. ]
  6676. }
  6677. },
  6678. "/tui/control/next": {
  6679. "get": {
  6680. "operationId": "tui.control.next",
  6681. "parameters": [
  6682. {
  6683. "in": "query",
  6684. "name": "directory",
  6685. "schema": {
  6686. "type": "string"
  6687. }
  6688. },
  6689. {
  6690. "in": "query",
  6691. "name": "workspace",
  6692. "schema": {
  6693. "type": "string"
  6694. }
  6695. }
  6696. ],
  6697. "summary": "Get next TUI request",
  6698. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  6699. "responses": {
  6700. "200": {
  6701. "description": "Next TUI request",
  6702. "content": {
  6703. "application/json": {
  6704. "schema": {
  6705. "type": "object",
  6706. "properties": {
  6707. "path": {
  6708. "type": "string"
  6709. },
  6710. "body": {}
  6711. },
  6712. "required": ["path", "body"]
  6713. }
  6714. }
  6715. }
  6716. }
  6717. },
  6718. "x-codeSamples": [
  6719. {
  6720. "lang": "js",
  6721. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  6722. }
  6723. ]
  6724. }
  6725. },
  6726. "/tui/control/response": {
  6727. "post": {
  6728. "operationId": "tui.control.response",
  6729. "parameters": [
  6730. {
  6731. "in": "query",
  6732. "name": "directory",
  6733. "schema": {
  6734. "type": "string"
  6735. }
  6736. },
  6737. {
  6738. "in": "query",
  6739. "name": "workspace",
  6740. "schema": {
  6741. "type": "string"
  6742. }
  6743. }
  6744. ],
  6745. "summary": "Submit TUI response",
  6746. "description": "Submit a response to the TUI request queue to complete a pending request.",
  6747. "responses": {
  6748. "200": {
  6749. "description": "Response submitted successfully",
  6750. "content": {
  6751. "application/json": {
  6752. "schema": {
  6753. "type": "boolean"
  6754. }
  6755. }
  6756. }
  6757. }
  6758. },
  6759. "requestBody": {
  6760. "content": {
  6761. "application/json": {
  6762. "schema": {}
  6763. }
  6764. }
  6765. },
  6766. "x-codeSamples": [
  6767. {
  6768. "lang": "js",
  6769. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  6770. }
  6771. ]
  6772. }
  6773. },
  6774. "/instance/dispose": {
  6775. "post": {
  6776. "operationId": "instance.dispose",
  6777. "parameters": [
  6778. {
  6779. "in": "query",
  6780. "name": "directory",
  6781. "schema": {
  6782. "type": "string"
  6783. }
  6784. },
  6785. {
  6786. "in": "query",
  6787. "name": "workspace",
  6788. "schema": {
  6789. "type": "string"
  6790. }
  6791. }
  6792. ],
  6793. "summary": "Dispose instance",
  6794. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  6795. "responses": {
  6796. "200": {
  6797. "description": "Instance disposed",
  6798. "content": {
  6799. "application/json": {
  6800. "schema": {
  6801. "type": "boolean"
  6802. }
  6803. }
  6804. }
  6805. }
  6806. },
  6807. "x-codeSamples": [
  6808. {
  6809. "lang": "js",
  6810. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  6811. }
  6812. ]
  6813. }
  6814. },
  6815. "/path": {
  6816. "get": {
  6817. "operationId": "path.get",
  6818. "parameters": [
  6819. {
  6820. "in": "query",
  6821. "name": "directory",
  6822. "schema": {
  6823. "type": "string"
  6824. }
  6825. },
  6826. {
  6827. "in": "query",
  6828. "name": "workspace",
  6829. "schema": {
  6830. "type": "string"
  6831. }
  6832. }
  6833. ],
  6834. "summary": "Get paths",
  6835. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  6836. "responses": {
  6837. "200": {
  6838. "description": "Path",
  6839. "content": {
  6840. "application/json": {
  6841. "schema": {
  6842. "$ref": "#/components/schemas/Path"
  6843. }
  6844. }
  6845. }
  6846. }
  6847. },
  6848. "x-codeSamples": [
  6849. {
  6850. "lang": "js",
  6851. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  6852. }
  6853. ]
  6854. }
  6855. },
  6856. "/vcs": {
  6857. "get": {
  6858. "operationId": "vcs.get",
  6859. "parameters": [
  6860. {
  6861. "in": "query",
  6862. "name": "directory",
  6863. "schema": {
  6864. "type": "string"
  6865. }
  6866. },
  6867. {
  6868. "in": "query",
  6869. "name": "workspace",
  6870. "schema": {
  6871. "type": "string"
  6872. }
  6873. }
  6874. ],
  6875. "summary": "Get VCS info",
  6876. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  6877. "responses": {
  6878. "200": {
  6879. "description": "VCS info",
  6880. "content": {
  6881. "application/json": {
  6882. "schema": {
  6883. "$ref": "#/components/schemas/VcsInfo"
  6884. }
  6885. }
  6886. }
  6887. }
  6888. },
  6889. "x-codeSamples": [
  6890. {
  6891. "lang": "js",
  6892. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  6893. }
  6894. ]
  6895. }
  6896. },
  6897. "/vcs/diff": {
  6898. "get": {
  6899. "operationId": "vcs.diff",
  6900. "parameters": [
  6901. {
  6902. "in": "query",
  6903. "name": "directory",
  6904. "schema": {
  6905. "type": "string"
  6906. }
  6907. },
  6908. {
  6909. "in": "query",
  6910. "name": "workspace",
  6911. "schema": {
  6912. "type": "string"
  6913. }
  6914. },
  6915. {
  6916. "in": "query",
  6917. "name": "mode",
  6918. "schema": {
  6919. "type": "string",
  6920. "enum": ["git", "branch"]
  6921. },
  6922. "required": true
  6923. }
  6924. ],
  6925. "summary": "Get VCS diff",
  6926. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  6927. "responses": {
  6928. "200": {
  6929. "description": "VCS diff",
  6930. "content": {
  6931. "application/json": {
  6932. "schema": {
  6933. "type": "array",
  6934. "items": {
  6935. "$ref": "#/components/schemas/VcsFileDiff"
  6936. }
  6937. }
  6938. }
  6939. }
  6940. }
  6941. },
  6942. "x-codeSamples": [
  6943. {
  6944. "lang": "js",
  6945. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  6946. }
  6947. ]
  6948. }
  6949. },
  6950. "/command": {
  6951. "get": {
  6952. "operationId": "command.list",
  6953. "parameters": [
  6954. {
  6955. "in": "query",
  6956. "name": "directory",
  6957. "schema": {
  6958. "type": "string"
  6959. }
  6960. },
  6961. {
  6962. "in": "query",
  6963. "name": "workspace",
  6964. "schema": {
  6965. "type": "string"
  6966. }
  6967. }
  6968. ],
  6969. "summary": "List commands",
  6970. "description": "Get a list of all available commands in the OpenCode system.",
  6971. "responses": {
  6972. "200": {
  6973. "description": "List of commands",
  6974. "content": {
  6975. "application/json": {
  6976. "schema": {
  6977. "type": "array",
  6978. "items": {
  6979. "$ref": "#/components/schemas/Command"
  6980. }
  6981. }
  6982. }
  6983. }
  6984. }
  6985. },
  6986. "x-codeSamples": [
  6987. {
  6988. "lang": "js",
  6989. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  6990. }
  6991. ]
  6992. }
  6993. },
  6994. "/agent": {
  6995. "get": {
  6996. "operationId": "app.agents",
  6997. "parameters": [
  6998. {
  6999. "in": "query",
  7000. "name": "directory",
  7001. "schema": {
  7002. "type": "string"
  7003. }
  7004. },
  7005. {
  7006. "in": "query",
  7007. "name": "workspace",
  7008. "schema": {
  7009. "type": "string"
  7010. }
  7011. }
  7012. ],
  7013. "summary": "List agents",
  7014. "description": "Get a list of all available AI agents in the OpenCode system.",
  7015. "responses": {
  7016. "200": {
  7017. "description": "List of agents",
  7018. "content": {
  7019. "application/json": {
  7020. "schema": {
  7021. "type": "array",
  7022. "items": {
  7023. "$ref": "#/components/schemas/Agent"
  7024. }
  7025. }
  7026. }
  7027. }
  7028. }
  7029. },
  7030. "x-codeSamples": [
  7031. {
  7032. "lang": "js",
  7033. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  7034. }
  7035. ]
  7036. }
  7037. },
  7038. "/skill": {
  7039. "get": {
  7040. "operationId": "app.skills",
  7041. "parameters": [
  7042. {
  7043. "in": "query",
  7044. "name": "directory",
  7045. "schema": {
  7046. "type": "string"
  7047. }
  7048. },
  7049. {
  7050. "in": "query",
  7051. "name": "workspace",
  7052. "schema": {
  7053. "type": "string"
  7054. }
  7055. }
  7056. ],
  7057. "summary": "List skills",
  7058. "description": "Get a list of all available skills in the OpenCode system.",
  7059. "responses": {
  7060. "200": {
  7061. "description": "List of skills",
  7062. "content": {
  7063. "application/json": {
  7064. "schema": {
  7065. "type": "array",
  7066. "items": {
  7067. "type": "object",
  7068. "properties": {
  7069. "name": {
  7070. "type": "string"
  7071. },
  7072. "description": {
  7073. "type": "string"
  7074. },
  7075. "location": {
  7076. "type": "string"
  7077. },
  7078. "content": {
  7079. "type": "string"
  7080. }
  7081. },
  7082. "required": ["name", "description", "location", "content"]
  7083. }
  7084. }
  7085. }
  7086. }
  7087. }
  7088. },
  7089. "x-codeSamples": [
  7090. {
  7091. "lang": "js",
  7092. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  7093. }
  7094. ]
  7095. }
  7096. },
  7097. "/lsp": {
  7098. "get": {
  7099. "operationId": "lsp.status",
  7100. "parameters": [
  7101. {
  7102. "in": "query",
  7103. "name": "directory",
  7104. "schema": {
  7105. "type": "string"
  7106. }
  7107. },
  7108. {
  7109. "in": "query",
  7110. "name": "workspace",
  7111. "schema": {
  7112. "type": "string"
  7113. }
  7114. }
  7115. ],
  7116. "summary": "Get LSP status",
  7117. "description": "Get LSP server status",
  7118. "responses": {
  7119. "200": {
  7120. "description": "LSP server status",
  7121. "content": {
  7122. "application/json": {
  7123. "schema": {
  7124. "type": "array",
  7125. "items": {
  7126. "$ref": "#/components/schemas/LSPStatus"
  7127. }
  7128. }
  7129. }
  7130. }
  7131. }
  7132. },
  7133. "x-codeSamples": [
  7134. {
  7135. "lang": "js",
  7136. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  7137. }
  7138. ]
  7139. }
  7140. },
  7141. "/formatter": {
  7142. "get": {
  7143. "operationId": "formatter.status",
  7144. "parameters": [
  7145. {
  7146. "in": "query",
  7147. "name": "directory",
  7148. "schema": {
  7149. "type": "string"
  7150. }
  7151. },
  7152. {
  7153. "in": "query",
  7154. "name": "workspace",
  7155. "schema": {
  7156. "type": "string"
  7157. }
  7158. }
  7159. ],
  7160. "summary": "Get formatter status",
  7161. "description": "Get formatter status",
  7162. "responses": {
  7163. "200": {
  7164. "description": "Formatter status",
  7165. "content": {
  7166. "application/json": {
  7167. "schema": {
  7168. "type": "array",
  7169. "items": {
  7170. "$ref": "#/components/schemas/FormatterStatus"
  7171. }
  7172. }
  7173. }
  7174. }
  7175. }
  7176. },
  7177. "x-codeSamples": [
  7178. {
  7179. "lang": "js",
  7180. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  7181. }
  7182. ]
  7183. }
  7184. }
  7185. },
  7186. "components": {
  7187. "schemas": {
  7188. "Project": {
  7189. "type": "object",
  7190. "properties": {
  7191. "id": {
  7192. "type": "string"
  7193. },
  7194. "worktree": {
  7195. "type": "string"
  7196. },
  7197. "vcs": {
  7198. "type": "string",
  7199. "const": "git"
  7200. },
  7201. "name": {
  7202. "type": "string"
  7203. },
  7204. "icon": {
  7205. "type": "object",
  7206. "properties": {
  7207. "url": {
  7208. "type": "string"
  7209. },
  7210. "override": {
  7211. "type": "string"
  7212. },
  7213. "color": {
  7214. "type": "string"
  7215. }
  7216. }
  7217. },
  7218. "commands": {
  7219. "type": "object",
  7220. "properties": {
  7221. "start": {
  7222. "description": "Startup script to run when creating a new workspace (worktree)",
  7223. "type": "string"
  7224. }
  7225. }
  7226. },
  7227. "time": {
  7228. "type": "object",
  7229. "properties": {
  7230. "created": {
  7231. "type": "number"
  7232. },
  7233. "updated": {
  7234. "type": "number"
  7235. },
  7236. "initialized": {
  7237. "type": "number"
  7238. }
  7239. },
  7240. "required": ["created", "updated"]
  7241. },
  7242. "sandboxes": {
  7243. "type": "array",
  7244. "items": {
  7245. "type": "string"
  7246. }
  7247. }
  7248. },
  7249. "required": ["id", "worktree", "time", "sandboxes"]
  7250. },
  7251. "Event.project.updated": {
  7252. "type": "object",
  7253. "properties": {
  7254. "type": {
  7255. "type": "string",
  7256. "const": "project.updated"
  7257. },
  7258. "properties": {
  7259. "$ref": "#/components/schemas/Project"
  7260. }
  7261. },
  7262. "required": ["type", "properties"]
  7263. },
  7264. "Event.server.instance.disposed": {
  7265. "type": "object",
  7266. "properties": {
  7267. "type": {
  7268. "type": "string",
  7269. "const": "server.instance.disposed"
  7270. },
  7271. "properties": {
  7272. "type": "object",
  7273. "properties": {
  7274. "directory": {
  7275. "type": "string"
  7276. }
  7277. },
  7278. "required": ["directory"]
  7279. }
  7280. },
  7281. "required": ["type", "properties"]
  7282. },
  7283. "Event.installation.updated": {
  7284. "type": "object",
  7285. "properties": {
  7286. "type": {
  7287. "type": "string",
  7288. "const": "installation.updated"
  7289. },
  7290. "properties": {
  7291. "type": "object",
  7292. "properties": {
  7293. "version": {
  7294. "type": "string"
  7295. }
  7296. },
  7297. "required": ["version"]
  7298. }
  7299. },
  7300. "required": ["type", "properties"]
  7301. },
  7302. "Event.installation.update-available": {
  7303. "type": "object",
  7304. "properties": {
  7305. "type": {
  7306. "type": "string",
  7307. "const": "installation.update-available"
  7308. },
  7309. "properties": {
  7310. "type": "object",
  7311. "properties": {
  7312. "version": {
  7313. "type": "string"
  7314. }
  7315. },
  7316. "required": ["version"]
  7317. }
  7318. },
  7319. "required": ["type", "properties"]
  7320. },
  7321. "Event.server.connected": {
  7322. "type": "object",
  7323. "properties": {
  7324. "type": {
  7325. "type": "string",
  7326. "const": "server.connected"
  7327. },
  7328. "properties": {
  7329. "type": "object",
  7330. "properties": {}
  7331. }
  7332. },
  7333. "required": ["type", "properties"]
  7334. },
  7335. "Event.global.disposed": {
  7336. "type": "object",
  7337. "properties": {
  7338. "type": {
  7339. "type": "string",
  7340. "const": "global.disposed"
  7341. },
  7342. "properties": {
  7343. "type": "object",
  7344. "properties": {}
  7345. }
  7346. },
  7347. "required": ["type", "properties"]
  7348. },
  7349. "Event.file.edited": {
  7350. "type": "object",
  7351. "properties": {
  7352. "type": {
  7353. "type": "string",
  7354. "const": "file.edited"
  7355. },
  7356. "properties": {
  7357. "type": "object",
  7358. "properties": {
  7359. "file": {
  7360. "type": "string"
  7361. }
  7362. },
  7363. "required": ["file"]
  7364. }
  7365. },
  7366. "required": ["type", "properties"]
  7367. },
  7368. "Event.file.watcher.updated": {
  7369. "type": "object",
  7370. "properties": {
  7371. "type": {
  7372. "type": "string",
  7373. "const": "file.watcher.updated"
  7374. },
  7375. "properties": {
  7376. "type": "object",
  7377. "properties": {
  7378. "file": {
  7379. "type": "string"
  7380. },
  7381. "event": {
  7382. "anyOf": [
  7383. {
  7384. "type": "string",
  7385. "const": "add"
  7386. },
  7387. {
  7388. "type": "string",
  7389. "const": "change"
  7390. },
  7391. {
  7392. "type": "string",
  7393. "const": "unlink"
  7394. }
  7395. ]
  7396. }
  7397. },
  7398. "required": ["file", "event"]
  7399. }
  7400. },
  7401. "required": ["type", "properties"]
  7402. },
  7403. "Event.lsp.client.diagnostics": {
  7404. "type": "object",
  7405. "properties": {
  7406. "type": {
  7407. "type": "string",
  7408. "const": "lsp.client.diagnostics"
  7409. },
  7410. "properties": {
  7411. "type": "object",
  7412. "properties": {
  7413. "serverID": {
  7414. "type": "string"
  7415. },
  7416. "path": {
  7417. "type": "string"
  7418. }
  7419. },
  7420. "required": ["serverID", "path"]
  7421. }
  7422. },
  7423. "required": ["type", "properties"]
  7424. },
  7425. "Event.lsp.updated": {
  7426. "type": "object",
  7427. "properties": {
  7428. "type": {
  7429. "type": "string",
  7430. "const": "lsp.updated"
  7431. },
  7432. "properties": {
  7433. "type": "object",
  7434. "properties": {}
  7435. }
  7436. },
  7437. "required": ["type", "properties"]
  7438. },
  7439. "Event.message.part.delta": {
  7440. "type": "object",
  7441. "properties": {
  7442. "type": {
  7443. "type": "string",
  7444. "const": "message.part.delta"
  7445. },
  7446. "properties": {
  7447. "type": "object",
  7448. "properties": {
  7449. "sessionID": {
  7450. "type": "string",
  7451. "pattern": "^ses.*"
  7452. },
  7453. "messageID": {
  7454. "type": "string",
  7455. "pattern": "^msg.*"
  7456. },
  7457. "partID": {
  7458. "type": "string",
  7459. "pattern": "^prt.*"
  7460. },
  7461. "field": {
  7462. "type": "string"
  7463. },
  7464. "delta": {
  7465. "type": "string"
  7466. }
  7467. },
  7468. "required": ["sessionID", "messageID", "partID", "field", "delta"]
  7469. }
  7470. },
  7471. "required": ["type", "properties"]
  7472. },
  7473. "PermissionRequest": {
  7474. "type": "object",
  7475. "properties": {
  7476. "id": {
  7477. "type": "string",
  7478. "pattern": "^per.*"
  7479. },
  7480. "sessionID": {
  7481. "type": "string",
  7482. "pattern": "^ses.*"
  7483. },
  7484. "permission": {
  7485. "type": "string"
  7486. },
  7487. "patterns": {
  7488. "type": "array",
  7489. "items": {
  7490. "type": "string"
  7491. }
  7492. },
  7493. "metadata": {
  7494. "type": "object",
  7495. "propertyNames": {
  7496. "type": "string"
  7497. },
  7498. "additionalProperties": {}
  7499. },
  7500. "always": {
  7501. "type": "array",
  7502. "items": {
  7503. "type": "string"
  7504. }
  7505. },
  7506. "tool": {
  7507. "type": "object",
  7508. "properties": {
  7509. "messageID": {
  7510. "type": "string",
  7511. "pattern": "^msg.*"
  7512. },
  7513. "callID": {
  7514. "type": "string"
  7515. }
  7516. },
  7517. "required": ["messageID", "callID"]
  7518. }
  7519. },
  7520. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  7521. },
  7522. "Event.permission.asked": {
  7523. "type": "object",
  7524. "properties": {
  7525. "type": {
  7526. "type": "string",
  7527. "const": "permission.asked"
  7528. },
  7529. "properties": {
  7530. "$ref": "#/components/schemas/PermissionRequest"
  7531. }
  7532. },
  7533. "required": ["type", "properties"]
  7534. },
  7535. "Event.permission.replied": {
  7536. "type": "object",
  7537. "properties": {
  7538. "type": {
  7539. "type": "string",
  7540. "const": "permission.replied"
  7541. },
  7542. "properties": {
  7543. "type": "object",
  7544. "properties": {
  7545. "sessionID": {
  7546. "type": "string",
  7547. "pattern": "^ses.*"
  7548. },
  7549. "requestID": {
  7550. "type": "string",
  7551. "pattern": "^per.*"
  7552. },
  7553. "reply": {
  7554. "type": "string",
  7555. "enum": ["once", "always", "reject"]
  7556. }
  7557. },
  7558. "required": ["sessionID", "requestID", "reply"]
  7559. }
  7560. },
  7561. "required": ["type", "properties"]
  7562. },
  7563. "SnapshotFileDiff": {
  7564. "type": "object",
  7565. "properties": {
  7566. "file": {
  7567. "type": "string"
  7568. },
  7569. "patch": {
  7570. "type": "string"
  7571. },
  7572. "additions": {
  7573. "type": "number"
  7574. },
  7575. "deletions": {
  7576. "type": "number"
  7577. },
  7578. "status": {
  7579. "type": "string",
  7580. "enum": ["added", "deleted", "modified"]
  7581. }
  7582. },
  7583. "required": ["file", "patch", "additions", "deletions"]
  7584. },
  7585. "Event.session.diff": {
  7586. "type": "object",
  7587. "properties": {
  7588. "type": {
  7589. "type": "string",
  7590. "const": "session.diff"
  7591. },
  7592. "properties": {
  7593. "type": "object",
  7594. "properties": {
  7595. "sessionID": {
  7596. "type": "string",
  7597. "pattern": "^ses.*"
  7598. },
  7599. "diff": {
  7600. "type": "array",
  7601. "items": {
  7602. "$ref": "#/components/schemas/SnapshotFileDiff"
  7603. }
  7604. }
  7605. },
  7606. "required": ["sessionID", "diff"]
  7607. }
  7608. },
  7609. "required": ["type", "properties"]
  7610. },
  7611. "ProviderAuthError": {
  7612. "type": "object",
  7613. "properties": {
  7614. "name": {
  7615. "type": "string",
  7616. "const": "ProviderAuthError"
  7617. },
  7618. "data": {
  7619. "type": "object",
  7620. "properties": {
  7621. "providerID": {
  7622. "type": "string"
  7623. },
  7624. "message": {
  7625. "type": "string"
  7626. }
  7627. },
  7628. "required": ["providerID", "message"]
  7629. }
  7630. },
  7631. "required": ["name", "data"]
  7632. },
  7633. "UnknownError": {
  7634. "type": "object",
  7635. "properties": {
  7636. "name": {
  7637. "type": "string",
  7638. "const": "UnknownError"
  7639. },
  7640. "data": {
  7641. "type": "object",
  7642. "properties": {
  7643. "message": {
  7644. "type": "string"
  7645. }
  7646. },
  7647. "required": ["message"]
  7648. }
  7649. },
  7650. "required": ["name", "data"]
  7651. },
  7652. "MessageOutputLengthError": {
  7653. "type": "object",
  7654. "properties": {
  7655. "name": {
  7656. "type": "string",
  7657. "const": "MessageOutputLengthError"
  7658. },
  7659. "data": {
  7660. "type": "object",
  7661. "properties": {}
  7662. }
  7663. },
  7664. "required": ["name", "data"]
  7665. },
  7666. "MessageAbortedError": {
  7667. "type": "object",
  7668. "properties": {
  7669. "name": {
  7670. "type": "string",
  7671. "const": "MessageAbortedError"
  7672. },
  7673. "data": {
  7674. "type": "object",
  7675. "properties": {
  7676. "message": {
  7677. "type": "string"
  7678. }
  7679. },
  7680. "required": ["message"]
  7681. }
  7682. },
  7683. "required": ["name", "data"]
  7684. },
  7685. "StructuredOutputError": {
  7686. "type": "object",
  7687. "properties": {
  7688. "name": {
  7689. "type": "string",
  7690. "const": "StructuredOutputError"
  7691. },
  7692. "data": {
  7693. "type": "object",
  7694. "properties": {
  7695. "message": {
  7696. "type": "string"
  7697. },
  7698. "retries": {
  7699. "type": "number"
  7700. }
  7701. },
  7702. "required": ["message", "retries"]
  7703. }
  7704. },
  7705. "required": ["name", "data"]
  7706. },
  7707. "ContextOverflowError": {
  7708. "type": "object",
  7709. "properties": {
  7710. "name": {
  7711. "type": "string",
  7712. "const": "ContextOverflowError"
  7713. },
  7714. "data": {
  7715. "type": "object",
  7716. "properties": {
  7717. "message": {
  7718. "type": "string"
  7719. },
  7720. "responseBody": {
  7721. "type": "string"
  7722. }
  7723. },
  7724. "required": ["message"]
  7725. }
  7726. },
  7727. "required": ["name", "data"]
  7728. },
  7729. "APIError": {
  7730. "type": "object",
  7731. "properties": {
  7732. "name": {
  7733. "type": "string",
  7734. "const": "APIError"
  7735. },
  7736. "data": {
  7737. "type": "object",
  7738. "properties": {
  7739. "message": {
  7740. "type": "string"
  7741. },
  7742. "statusCode": {
  7743. "type": "number"
  7744. },
  7745. "isRetryable": {
  7746. "type": "boolean"
  7747. },
  7748. "responseHeaders": {
  7749. "type": "object",
  7750. "propertyNames": {
  7751. "type": "string"
  7752. },
  7753. "additionalProperties": {
  7754. "type": "string"
  7755. }
  7756. },
  7757. "responseBody": {
  7758. "type": "string"
  7759. },
  7760. "metadata": {
  7761. "type": "object",
  7762. "propertyNames": {
  7763. "type": "string"
  7764. },
  7765. "additionalProperties": {
  7766. "type": "string"
  7767. }
  7768. }
  7769. },
  7770. "required": ["message", "isRetryable"]
  7771. }
  7772. },
  7773. "required": ["name", "data"]
  7774. },
  7775. "Event.session.error": {
  7776. "type": "object",
  7777. "properties": {
  7778. "type": {
  7779. "type": "string",
  7780. "const": "session.error"
  7781. },
  7782. "properties": {
  7783. "type": "object",
  7784. "properties": {
  7785. "sessionID": {
  7786. "type": "string",
  7787. "pattern": "^ses.*"
  7788. },
  7789. "error": {
  7790. "anyOf": [
  7791. {
  7792. "$ref": "#/components/schemas/ProviderAuthError"
  7793. },
  7794. {
  7795. "$ref": "#/components/schemas/UnknownError"
  7796. },
  7797. {
  7798. "$ref": "#/components/schemas/MessageOutputLengthError"
  7799. },
  7800. {
  7801. "$ref": "#/components/schemas/MessageAbortedError"
  7802. },
  7803. {
  7804. "$ref": "#/components/schemas/StructuredOutputError"
  7805. },
  7806. {
  7807. "$ref": "#/components/schemas/ContextOverflowError"
  7808. },
  7809. {
  7810. "$ref": "#/components/schemas/APIError"
  7811. }
  7812. ]
  7813. }
  7814. }
  7815. }
  7816. },
  7817. "required": ["type", "properties"]
  7818. },
  7819. "QuestionOption": {
  7820. "type": "object",
  7821. "properties": {
  7822. "label": {
  7823. "description": "Display text (1-5 words, concise)",
  7824. "type": "string"
  7825. },
  7826. "description": {
  7827. "description": "Explanation of choice",
  7828. "type": "string"
  7829. }
  7830. },
  7831. "required": ["label", "description"]
  7832. },
  7833. "QuestionInfo": {
  7834. "type": "object",
  7835. "properties": {
  7836. "question": {
  7837. "description": "Complete question",
  7838. "type": "string"
  7839. },
  7840. "header": {
  7841. "description": "Very short label (max 30 chars)",
  7842. "type": "string"
  7843. },
  7844. "options": {
  7845. "description": "Available choices",
  7846. "type": "array",
  7847. "items": {
  7848. "$ref": "#/components/schemas/QuestionOption"
  7849. }
  7850. },
  7851. "multiple": {
  7852. "description": "Allow selecting multiple choices",
  7853. "type": "boolean"
  7854. },
  7855. "custom": {
  7856. "description": "Allow typing a custom answer (default: true)",
  7857. "type": "boolean"
  7858. }
  7859. },
  7860. "required": ["question", "header", "options"]
  7861. },
  7862. "QuestionTool": {
  7863. "type": "object",
  7864. "properties": {
  7865. "messageID": {
  7866. "type": "string"
  7867. },
  7868. "callID": {
  7869. "type": "string"
  7870. }
  7871. },
  7872. "required": ["messageID", "callID"]
  7873. },
  7874. "QuestionRequest": {
  7875. "type": "object",
  7876. "properties": {
  7877. "id": {
  7878. "type": "string"
  7879. },
  7880. "sessionID": {
  7881. "type": "string"
  7882. },
  7883. "questions": {
  7884. "description": "Questions to ask",
  7885. "type": "array",
  7886. "items": {
  7887. "$ref": "#/components/schemas/QuestionInfo"
  7888. }
  7889. },
  7890. "tool": {
  7891. "$ref": "#/components/schemas/QuestionTool"
  7892. }
  7893. },
  7894. "required": ["id", "sessionID", "questions"]
  7895. },
  7896. "Event.question.asked": {
  7897. "type": "object",
  7898. "properties": {
  7899. "type": {
  7900. "type": "string",
  7901. "const": "question.asked"
  7902. },
  7903. "properties": {
  7904. "$ref": "#/components/schemas/QuestionRequest"
  7905. }
  7906. },
  7907. "required": ["type", "properties"]
  7908. },
  7909. "QuestionAnswer": {
  7910. "type": "array",
  7911. "items": {
  7912. "type": "string"
  7913. }
  7914. },
  7915. "QuestionReplied": {
  7916. "type": "object",
  7917. "properties": {
  7918. "sessionID": {
  7919. "type": "string"
  7920. },
  7921. "requestID": {
  7922. "type": "string"
  7923. },
  7924. "answers": {
  7925. "type": "array",
  7926. "items": {
  7927. "$ref": "#/components/schemas/QuestionAnswer"
  7928. }
  7929. }
  7930. },
  7931. "required": ["sessionID", "requestID", "answers"]
  7932. },
  7933. "Event.question.replied": {
  7934. "type": "object",
  7935. "properties": {
  7936. "type": {
  7937. "type": "string",
  7938. "const": "question.replied"
  7939. },
  7940. "properties": {
  7941. "$ref": "#/components/schemas/QuestionReplied"
  7942. }
  7943. },
  7944. "required": ["type", "properties"]
  7945. },
  7946. "QuestionRejected": {
  7947. "type": "object",
  7948. "properties": {
  7949. "sessionID": {
  7950. "type": "string"
  7951. },
  7952. "requestID": {
  7953. "type": "string"
  7954. }
  7955. },
  7956. "required": ["sessionID", "requestID"]
  7957. },
  7958. "Event.question.rejected": {
  7959. "type": "object",
  7960. "properties": {
  7961. "type": {
  7962. "type": "string",
  7963. "const": "question.rejected"
  7964. },
  7965. "properties": {
  7966. "$ref": "#/components/schemas/QuestionRejected"
  7967. }
  7968. },
  7969. "required": ["type", "properties"]
  7970. },
  7971. "Todo": {
  7972. "type": "object",
  7973. "properties": {
  7974. "content": {
  7975. "description": "Brief description of the task",
  7976. "type": "string"
  7977. },
  7978. "status": {
  7979. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  7980. "type": "string"
  7981. },
  7982. "priority": {
  7983. "description": "Priority level of the task: high, medium, low",
  7984. "type": "string"
  7985. }
  7986. },
  7987. "required": ["content", "status", "priority"]
  7988. },
  7989. "Event.todo.updated": {
  7990. "type": "object",
  7991. "properties": {
  7992. "type": {
  7993. "type": "string",
  7994. "const": "todo.updated"
  7995. },
  7996. "properties": {
  7997. "type": "object",
  7998. "properties": {
  7999. "sessionID": {
  8000. "type": "string",
  8001. "pattern": "^ses.*"
  8002. },
  8003. "todos": {
  8004. "type": "array",
  8005. "items": {
  8006. "$ref": "#/components/schemas/Todo"
  8007. }
  8008. }
  8009. },
  8010. "required": ["sessionID", "todos"]
  8011. }
  8012. },
  8013. "required": ["type", "properties"]
  8014. },
  8015. "SessionStatus": {
  8016. "anyOf": [
  8017. {
  8018. "type": "object",
  8019. "properties": {
  8020. "type": {
  8021. "type": "string",
  8022. "const": "idle"
  8023. }
  8024. },
  8025. "required": ["type"]
  8026. },
  8027. {
  8028. "type": "object",
  8029. "properties": {
  8030. "type": {
  8031. "type": "string",
  8032. "const": "retry"
  8033. },
  8034. "attempt": {
  8035. "type": "number"
  8036. },
  8037. "message": {
  8038. "type": "string"
  8039. },
  8040. "next": {
  8041. "type": "number"
  8042. }
  8043. },
  8044. "required": ["type", "attempt", "message", "next"]
  8045. },
  8046. {
  8047. "type": "object",
  8048. "properties": {
  8049. "type": {
  8050. "type": "string",
  8051. "const": "busy"
  8052. }
  8053. },
  8054. "required": ["type"]
  8055. }
  8056. ]
  8057. },
  8058. "Event.session.status": {
  8059. "type": "object",
  8060. "properties": {
  8061. "type": {
  8062. "type": "string",
  8063. "const": "session.status"
  8064. },
  8065. "properties": {
  8066. "type": "object",
  8067. "properties": {
  8068. "sessionID": {
  8069. "type": "string",
  8070. "pattern": "^ses.*"
  8071. },
  8072. "status": {
  8073. "$ref": "#/components/schemas/SessionStatus"
  8074. }
  8075. },
  8076. "required": ["sessionID", "status"]
  8077. }
  8078. },
  8079. "required": ["type", "properties"]
  8080. },
  8081. "Event.session.idle": {
  8082. "type": "object",
  8083. "properties": {
  8084. "type": {
  8085. "type": "string",
  8086. "const": "session.idle"
  8087. },
  8088. "properties": {
  8089. "type": "object",
  8090. "properties": {
  8091. "sessionID": {
  8092. "type": "string",
  8093. "pattern": "^ses.*"
  8094. }
  8095. },
  8096. "required": ["sessionID"]
  8097. }
  8098. },
  8099. "required": ["type", "properties"]
  8100. },
  8101. "Event.session.compacted": {
  8102. "type": "object",
  8103. "properties": {
  8104. "type": {
  8105. "type": "string",
  8106. "const": "session.compacted"
  8107. },
  8108. "properties": {
  8109. "type": "object",
  8110. "properties": {
  8111. "sessionID": {
  8112. "type": "string",
  8113. "pattern": "^ses.*"
  8114. }
  8115. },
  8116. "required": ["sessionID"]
  8117. }
  8118. },
  8119. "required": ["type", "properties"]
  8120. },
  8121. "Event.tui.prompt.append": {
  8122. "type": "object",
  8123. "properties": {
  8124. "type": {
  8125. "type": "string",
  8126. "const": "tui.prompt.append"
  8127. },
  8128. "properties": {
  8129. "type": "object",
  8130. "properties": {
  8131. "text": {
  8132. "type": "string"
  8133. }
  8134. },
  8135. "required": ["text"]
  8136. }
  8137. },
  8138. "required": ["type", "properties"]
  8139. },
  8140. "Event.tui.command.execute": {
  8141. "type": "object",
  8142. "properties": {
  8143. "type": {
  8144. "type": "string",
  8145. "const": "tui.command.execute"
  8146. },
  8147. "properties": {
  8148. "type": "object",
  8149. "properties": {
  8150. "command": {
  8151. "anyOf": [
  8152. {
  8153. "type": "string",
  8154. "enum": [
  8155. "session.list",
  8156. "session.new",
  8157. "session.share",
  8158. "session.interrupt",
  8159. "session.compact",
  8160. "session.page.up",
  8161. "session.page.down",
  8162. "session.line.up",
  8163. "session.line.down",
  8164. "session.half.page.up",
  8165. "session.half.page.down",
  8166. "session.first",
  8167. "session.last",
  8168. "prompt.clear",
  8169. "prompt.submit",
  8170. "agent.cycle"
  8171. ]
  8172. },
  8173. {
  8174. "type": "string"
  8175. }
  8176. ]
  8177. }
  8178. },
  8179. "required": ["command"]
  8180. }
  8181. },
  8182. "required": ["type", "properties"]
  8183. },
  8184. "Event.tui.toast.show": {
  8185. "type": "object",
  8186. "properties": {
  8187. "type": {
  8188. "type": "string",
  8189. "const": "tui.toast.show"
  8190. },
  8191. "properties": {
  8192. "type": "object",
  8193. "properties": {
  8194. "title": {
  8195. "type": "string"
  8196. },
  8197. "message": {
  8198. "type": "string"
  8199. },
  8200. "variant": {
  8201. "type": "string",
  8202. "enum": ["info", "success", "warning", "error"]
  8203. },
  8204. "duration": {
  8205. "description": "Duration in milliseconds",
  8206. "default": 5000,
  8207. "type": "number"
  8208. }
  8209. },
  8210. "required": ["message", "variant"]
  8211. }
  8212. },
  8213. "required": ["type", "properties"]
  8214. },
  8215. "Event.tui.session.select": {
  8216. "type": "object",
  8217. "properties": {
  8218. "type": {
  8219. "type": "string",
  8220. "const": "tui.session.select"
  8221. },
  8222. "properties": {
  8223. "type": "object",
  8224. "properties": {
  8225. "sessionID": {
  8226. "description": "Session ID to navigate to",
  8227. "type": "string",
  8228. "pattern": "^ses.*"
  8229. }
  8230. },
  8231. "required": ["sessionID"]
  8232. }
  8233. },
  8234. "required": ["type", "properties"]
  8235. },
  8236. "Event.mcp.tools.changed": {
  8237. "type": "object",
  8238. "properties": {
  8239. "type": {
  8240. "type": "string",
  8241. "const": "mcp.tools.changed"
  8242. },
  8243. "properties": {
  8244. "type": "object",
  8245. "properties": {
  8246. "server": {
  8247. "type": "string"
  8248. }
  8249. },
  8250. "required": ["server"]
  8251. }
  8252. },
  8253. "required": ["type", "properties"]
  8254. },
  8255. "Event.mcp.browser.open.failed": {
  8256. "type": "object",
  8257. "properties": {
  8258. "type": {
  8259. "type": "string",
  8260. "const": "mcp.browser.open.failed"
  8261. },
  8262. "properties": {
  8263. "type": "object",
  8264. "properties": {
  8265. "mcpName": {
  8266. "type": "string"
  8267. },
  8268. "url": {
  8269. "type": "string"
  8270. }
  8271. },
  8272. "required": ["mcpName", "url"]
  8273. }
  8274. },
  8275. "required": ["type", "properties"]
  8276. },
  8277. "Event.command.executed": {
  8278. "type": "object",
  8279. "properties": {
  8280. "type": {
  8281. "type": "string",
  8282. "const": "command.executed"
  8283. },
  8284. "properties": {
  8285. "type": "object",
  8286. "properties": {
  8287. "name": {
  8288. "type": "string"
  8289. },
  8290. "sessionID": {
  8291. "type": "string",
  8292. "pattern": "^ses.*"
  8293. },
  8294. "arguments": {
  8295. "type": "string"
  8296. },
  8297. "messageID": {
  8298. "type": "string",
  8299. "pattern": "^msg.*"
  8300. }
  8301. },
  8302. "required": ["name", "sessionID", "arguments", "messageID"]
  8303. }
  8304. },
  8305. "required": ["type", "properties"]
  8306. },
  8307. "Event.vcs.branch.updated": {
  8308. "type": "object",
  8309. "properties": {
  8310. "type": {
  8311. "type": "string",
  8312. "const": "vcs.branch.updated"
  8313. },
  8314. "properties": {
  8315. "type": "object",
  8316. "properties": {
  8317. "branch": {
  8318. "type": "string"
  8319. }
  8320. }
  8321. }
  8322. },
  8323. "required": ["type", "properties"]
  8324. },
  8325. "Event.worktree.ready": {
  8326. "type": "object",
  8327. "properties": {
  8328. "type": {
  8329. "type": "string",
  8330. "const": "worktree.ready"
  8331. },
  8332. "properties": {
  8333. "type": "object",
  8334. "properties": {
  8335. "name": {
  8336. "type": "string"
  8337. },
  8338. "branch": {
  8339. "type": "string"
  8340. }
  8341. },
  8342. "required": ["name", "branch"]
  8343. }
  8344. },
  8345. "required": ["type", "properties"]
  8346. },
  8347. "Event.worktree.failed": {
  8348. "type": "object",
  8349. "properties": {
  8350. "type": {
  8351. "type": "string",
  8352. "const": "worktree.failed"
  8353. },
  8354. "properties": {
  8355. "type": "object",
  8356. "properties": {
  8357. "message": {
  8358. "type": "string"
  8359. }
  8360. },
  8361. "required": ["message"]
  8362. }
  8363. },
  8364. "required": ["type", "properties"]
  8365. },
  8366. "Pty": {
  8367. "type": "object",
  8368. "properties": {
  8369. "id": {
  8370. "type": "string",
  8371. "pattern": "^pty.*"
  8372. },
  8373. "title": {
  8374. "type": "string"
  8375. },
  8376. "command": {
  8377. "type": "string"
  8378. },
  8379. "args": {
  8380. "type": "array",
  8381. "items": {
  8382. "type": "string"
  8383. }
  8384. },
  8385. "cwd": {
  8386. "type": "string"
  8387. },
  8388. "status": {
  8389. "type": "string",
  8390. "enum": ["running", "exited"]
  8391. },
  8392. "pid": {
  8393. "type": "number"
  8394. }
  8395. },
  8396. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  8397. },
  8398. "Event.pty.created": {
  8399. "type": "object",
  8400. "properties": {
  8401. "type": {
  8402. "type": "string",
  8403. "const": "pty.created"
  8404. },
  8405. "properties": {
  8406. "type": "object",
  8407. "properties": {
  8408. "info": {
  8409. "$ref": "#/components/schemas/Pty"
  8410. }
  8411. },
  8412. "required": ["info"]
  8413. }
  8414. },
  8415. "required": ["type", "properties"]
  8416. },
  8417. "Event.pty.updated": {
  8418. "type": "object",
  8419. "properties": {
  8420. "type": {
  8421. "type": "string",
  8422. "const": "pty.updated"
  8423. },
  8424. "properties": {
  8425. "type": "object",
  8426. "properties": {
  8427. "info": {
  8428. "$ref": "#/components/schemas/Pty"
  8429. }
  8430. },
  8431. "required": ["info"]
  8432. }
  8433. },
  8434. "required": ["type", "properties"]
  8435. },
  8436. "Event.pty.exited": {
  8437. "type": "object",
  8438. "properties": {
  8439. "type": {
  8440. "type": "string",
  8441. "const": "pty.exited"
  8442. },
  8443. "properties": {
  8444. "type": "object",
  8445. "properties": {
  8446. "id": {
  8447. "type": "string",
  8448. "pattern": "^pty.*"
  8449. },
  8450. "exitCode": {
  8451. "type": "number"
  8452. }
  8453. },
  8454. "required": ["id", "exitCode"]
  8455. }
  8456. },
  8457. "required": ["type", "properties"]
  8458. },
  8459. "Event.pty.deleted": {
  8460. "type": "object",
  8461. "properties": {
  8462. "type": {
  8463. "type": "string",
  8464. "const": "pty.deleted"
  8465. },
  8466. "properties": {
  8467. "type": "object",
  8468. "properties": {
  8469. "id": {
  8470. "type": "string",
  8471. "pattern": "^pty.*"
  8472. }
  8473. },
  8474. "required": ["id"]
  8475. }
  8476. },
  8477. "required": ["type", "properties"]
  8478. },
  8479. "Event.workspace.ready": {
  8480. "type": "object",
  8481. "properties": {
  8482. "type": {
  8483. "type": "string",
  8484. "const": "workspace.ready"
  8485. },
  8486. "properties": {
  8487. "type": "object",
  8488. "properties": {
  8489. "name": {
  8490. "type": "string"
  8491. }
  8492. },
  8493. "required": ["name"]
  8494. }
  8495. },
  8496. "required": ["type", "properties"]
  8497. },
  8498. "Event.workspace.failed": {
  8499. "type": "object",
  8500. "properties": {
  8501. "type": {
  8502. "type": "string",
  8503. "const": "workspace.failed"
  8504. },
  8505. "properties": {
  8506. "type": "object",
  8507. "properties": {
  8508. "message": {
  8509. "type": "string"
  8510. }
  8511. },
  8512. "required": ["message"]
  8513. }
  8514. },
  8515. "required": ["type", "properties"]
  8516. },
  8517. "Event.workspace.status": {
  8518. "type": "object",
  8519. "properties": {
  8520. "type": {
  8521. "type": "string",
  8522. "const": "workspace.status"
  8523. },
  8524. "properties": {
  8525. "type": "object",
  8526. "properties": {
  8527. "workspaceID": {
  8528. "type": "string",
  8529. "pattern": "^wrk.*"
  8530. },
  8531. "status": {
  8532. "type": "string",
  8533. "enum": ["connected", "connecting", "disconnected", "error"]
  8534. },
  8535. "error": {
  8536. "type": "string"
  8537. }
  8538. },
  8539. "required": ["workspaceID", "status"]
  8540. }
  8541. },
  8542. "required": ["type", "properties"]
  8543. },
  8544. "OutputFormatText": {
  8545. "type": "object",
  8546. "properties": {
  8547. "type": {
  8548. "type": "string",
  8549. "const": "text"
  8550. }
  8551. },
  8552. "required": ["type"]
  8553. },
  8554. "JSONSchema": {
  8555. "type": "object",
  8556. "propertyNames": {
  8557. "type": "string"
  8558. },
  8559. "additionalProperties": {}
  8560. },
  8561. "OutputFormatJsonSchema": {
  8562. "type": "object",
  8563. "properties": {
  8564. "type": {
  8565. "type": "string",
  8566. "const": "json_schema"
  8567. },
  8568. "schema": {
  8569. "$ref": "#/components/schemas/JSONSchema"
  8570. },
  8571. "retryCount": {
  8572. "default": 2,
  8573. "type": "integer",
  8574. "minimum": 0,
  8575. "maximum": 9007199254740991
  8576. }
  8577. },
  8578. "required": ["type", "schema"]
  8579. },
  8580. "OutputFormat": {
  8581. "anyOf": [
  8582. {
  8583. "$ref": "#/components/schemas/OutputFormatText"
  8584. },
  8585. {
  8586. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  8587. }
  8588. ]
  8589. },
  8590. "UserMessage": {
  8591. "type": "object",
  8592. "properties": {
  8593. "id": {
  8594. "type": "string",
  8595. "pattern": "^msg.*"
  8596. },
  8597. "sessionID": {
  8598. "type": "string",
  8599. "pattern": "^ses.*"
  8600. },
  8601. "role": {
  8602. "type": "string",
  8603. "const": "user"
  8604. },
  8605. "time": {
  8606. "type": "object",
  8607. "properties": {
  8608. "created": {
  8609. "type": "number"
  8610. }
  8611. },
  8612. "required": ["created"]
  8613. },
  8614. "format": {
  8615. "$ref": "#/components/schemas/OutputFormat"
  8616. },
  8617. "summary": {
  8618. "type": "object",
  8619. "properties": {
  8620. "title": {
  8621. "type": "string"
  8622. },
  8623. "body": {
  8624. "type": "string"
  8625. },
  8626. "diffs": {
  8627. "type": "array",
  8628. "items": {
  8629. "$ref": "#/components/schemas/SnapshotFileDiff"
  8630. }
  8631. }
  8632. },
  8633. "required": ["diffs"]
  8634. },
  8635. "agent": {
  8636. "type": "string"
  8637. },
  8638. "model": {
  8639. "type": "object",
  8640. "properties": {
  8641. "providerID": {
  8642. "type": "string"
  8643. },
  8644. "modelID": {
  8645. "type": "string"
  8646. },
  8647. "variant": {
  8648. "type": "string"
  8649. }
  8650. },
  8651. "required": ["providerID", "modelID"]
  8652. },
  8653. "system": {
  8654. "type": "string"
  8655. },
  8656. "tools": {
  8657. "type": "object",
  8658. "propertyNames": {
  8659. "type": "string"
  8660. },
  8661. "additionalProperties": {
  8662. "type": "boolean"
  8663. }
  8664. }
  8665. },
  8666. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  8667. },
  8668. "AssistantMessage": {
  8669. "type": "object",
  8670. "properties": {
  8671. "id": {
  8672. "type": "string",
  8673. "pattern": "^msg.*"
  8674. },
  8675. "sessionID": {
  8676. "type": "string",
  8677. "pattern": "^ses.*"
  8678. },
  8679. "role": {
  8680. "type": "string",
  8681. "const": "assistant"
  8682. },
  8683. "time": {
  8684. "type": "object",
  8685. "properties": {
  8686. "created": {
  8687. "type": "number"
  8688. },
  8689. "completed": {
  8690. "type": "number"
  8691. }
  8692. },
  8693. "required": ["created"]
  8694. },
  8695. "error": {
  8696. "anyOf": [
  8697. {
  8698. "$ref": "#/components/schemas/ProviderAuthError"
  8699. },
  8700. {
  8701. "$ref": "#/components/schemas/UnknownError"
  8702. },
  8703. {
  8704. "$ref": "#/components/schemas/MessageOutputLengthError"
  8705. },
  8706. {
  8707. "$ref": "#/components/schemas/MessageAbortedError"
  8708. },
  8709. {
  8710. "$ref": "#/components/schemas/StructuredOutputError"
  8711. },
  8712. {
  8713. "$ref": "#/components/schemas/ContextOverflowError"
  8714. },
  8715. {
  8716. "$ref": "#/components/schemas/APIError"
  8717. }
  8718. ]
  8719. },
  8720. "parentID": {
  8721. "type": "string",
  8722. "pattern": "^msg.*"
  8723. },
  8724. "modelID": {
  8725. "type": "string"
  8726. },
  8727. "providerID": {
  8728. "type": "string"
  8729. },
  8730. "mode": {
  8731. "type": "string"
  8732. },
  8733. "agent": {
  8734. "type": "string"
  8735. },
  8736. "path": {
  8737. "type": "object",
  8738. "properties": {
  8739. "cwd": {
  8740. "type": "string"
  8741. },
  8742. "root": {
  8743. "type": "string"
  8744. }
  8745. },
  8746. "required": ["cwd", "root"]
  8747. },
  8748. "summary": {
  8749. "type": "boolean"
  8750. },
  8751. "cost": {
  8752. "type": "number"
  8753. },
  8754. "tokens": {
  8755. "type": "object",
  8756. "properties": {
  8757. "total": {
  8758. "type": "number"
  8759. },
  8760. "input": {
  8761. "type": "number"
  8762. },
  8763. "output": {
  8764. "type": "number"
  8765. },
  8766. "reasoning": {
  8767. "type": "number"
  8768. },
  8769. "cache": {
  8770. "type": "object",
  8771. "properties": {
  8772. "read": {
  8773. "type": "number"
  8774. },
  8775. "write": {
  8776. "type": "number"
  8777. }
  8778. },
  8779. "required": ["read", "write"]
  8780. }
  8781. },
  8782. "required": ["input", "output", "reasoning", "cache"]
  8783. },
  8784. "structured": {},
  8785. "variant": {
  8786. "type": "string"
  8787. },
  8788. "finish": {
  8789. "type": "string"
  8790. }
  8791. },
  8792. "required": [
  8793. "id",
  8794. "sessionID",
  8795. "role",
  8796. "time",
  8797. "parentID",
  8798. "modelID",
  8799. "providerID",
  8800. "mode",
  8801. "agent",
  8802. "path",
  8803. "cost",
  8804. "tokens"
  8805. ]
  8806. },
  8807. "Message": {
  8808. "anyOf": [
  8809. {
  8810. "$ref": "#/components/schemas/UserMessage"
  8811. },
  8812. {
  8813. "$ref": "#/components/schemas/AssistantMessage"
  8814. }
  8815. ]
  8816. },
  8817. "Event.message.updated": {
  8818. "type": "object",
  8819. "properties": {
  8820. "type": {
  8821. "type": "string",
  8822. "const": "message.updated"
  8823. },
  8824. "properties": {
  8825. "type": "object",
  8826. "properties": {
  8827. "sessionID": {
  8828. "type": "string",
  8829. "pattern": "^ses.*"
  8830. },
  8831. "info": {
  8832. "$ref": "#/components/schemas/Message"
  8833. }
  8834. },
  8835. "required": ["sessionID", "info"]
  8836. }
  8837. },
  8838. "required": ["type", "properties"]
  8839. },
  8840. "Event.message.removed": {
  8841. "type": "object",
  8842. "properties": {
  8843. "type": {
  8844. "type": "string",
  8845. "const": "message.removed"
  8846. },
  8847. "properties": {
  8848. "type": "object",
  8849. "properties": {
  8850. "sessionID": {
  8851. "type": "string",
  8852. "pattern": "^ses.*"
  8853. },
  8854. "messageID": {
  8855. "type": "string",
  8856. "pattern": "^msg.*"
  8857. }
  8858. },
  8859. "required": ["sessionID", "messageID"]
  8860. }
  8861. },
  8862. "required": ["type", "properties"]
  8863. },
  8864. "TextPart": {
  8865. "type": "object",
  8866. "properties": {
  8867. "id": {
  8868. "type": "string",
  8869. "pattern": "^prt.*"
  8870. },
  8871. "sessionID": {
  8872. "type": "string",
  8873. "pattern": "^ses.*"
  8874. },
  8875. "messageID": {
  8876. "type": "string",
  8877. "pattern": "^msg.*"
  8878. },
  8879. "type": {
  8880. "type": "string",
  8881. "const": "text"
  8882. },
  8883. "text": {
  8884. "type": "string"
  8885. },
  8886. "synthetic": {
  8887. "type": "boolean"
  8888. },
  8889. "ignored": {
  8890. "type": "boolean"
  8891. },
  8892. "time": {
  8893. "type": "object",
  8894. "properties": {
  8895. "start": {
  8896. "type": "number"
  8897. },
  8898. "end": {
  8899. "type": "number"
  8900. }
  8901. },
  8902. "required": ["start"]
  8903. },
  8904. "metadata": {
  8905. "type": "object",
  8906. "propertyNames": {
  8907. "type": "string"
  8908. },
  8909. "additionalProperties": {}
  8910. }
  8911. },
  8912. "required": ["id", "sessionID", "messageID", "type", "text"]
  8913. },
  8914. "SubtaskPart": {
  8915. "type": "object",
  8916. "properties": {
  8917. "id": {
  8918. "type": "string",
  8919. "pattern": "^prt.*"
  8920. },
  8921. "sessionID": {
  8922. "type": "string",
  8923. "pattern": "^ses.*"
  8924. },
  8925. "messageID": {
  8926. "type": "string",
  8927. "pattern": "^msg.*"
  8928. },
  8929. "type": {
  8930. "type": "string",
  8931. "const": "subtask"
  8932. },
  8933. "prompt": {
  8934. "type": "string"
  8935. },
  8936. "description": {
  8937. "type": "string"
  8938. },
  8939. "agent": {
  8940. "type": "string"
  8941. },
  8942. "model": {
  8943. "type": "object",
  8944. "properties": {
  8945. "providerID": {
  8946. "type": "string"
  8947. },
  8948. "modelID": {
  8949. "type": "string"
  8950. }
  8951. },
  8952. "required": ["providerID", "modelID"]
  8953. },
  8954. "command": {
  8955. "type": "string"
  8956. }
  8957. },
  8958. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  8959. },
  8960. "ReasoningPart": {
  8961. "type": "object",
  8962. "properties": {
  8963. "id": {
  8964. "type": "string",
  8965. "pattern": "^prt.*"
  8966. },
  8967. "sessionID": {
  8968. "type": "string",
  8969. "pattern": "^ses.*"
  8970. },
  8971. "messageID": {
  8972. "type": "string",
  8973. "pattern": "^msg.*"
  8974. },
  8975. "type": {
  8976. "type": "string",
  8977. "const": "reasoning"
  8978. },
  8979. "text": {
  8980. "type": "string"
  8981. },
  8982. "metadata": {
  8983. "type": "object",
  8984. "propertyNames": {
  8985. "type": "string"
  8986. },
  8987. "additionalProperties": {}
  8988. },
  8989. "time": {
  8990. "type": "object",
  8991. "properties": {
  8992. "start": {
  8993. "type": "number"
  8994. },
  8995. "end": {
  8996. "type": "number"
  8997. }
  8998. },
  8999. "required": ["start"]
  9000. }
  9001. },
  9002. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  9003. },
  9004. "FilePartSourceText": {
  9005. "type": "object",
  9006. "properties": {
  9007. "value": {
  9008. "type": "string"
  9009. },
  9010. "start": {
  9011. "type": "integer",
  9012. "minimum": -9007199254740991,
  9013. "maximum": 9007199254740991
  9014. },
  9015. "end": {
  9016. "type": "integer",
  9017. "minimum": -9007199254740991,
  9018. "maximum": 9007199254740991
  9019. }
  9020. },
  9021. "required": ["value", "start", "end"]
  9022. },
  9023. "FileSource": {
  9024. "type": "object",
  9025. "properties": {
  9026. "text": {
  9027. "$ref": "#/components/schemas/FilePartSourceText"
  9028. },
  9029. "type": {
  9030. "type": "string",
  9031. "const": "file"
  9032. },
  9033. "path": {
  9034. "type": "string"
  9035. }
  9036. },
  9037. "required": ["text", "type", "path"]
  9038. },
  9039. "Range": {
  9040. "type": "object",
  9041. "properties": {
  9042. "start": {
  9043. "type": "object",
  9044. "properties": {
  9045. "line": {
  9046. "type": "number"
  9047. },
  9048. "character": {
  9049. "type": "number"
  9050. }
  9051. },
  9052. "required": ["line", "character"]
  9053. },
  9054. "end": {
  9055. "type": "object",
  9056. "properties": {
  9057. "line": {
  9058. "type": "number"
  9059. },
  9060. "character": {
  9061. "type": "number"
  9062. }
  9063. },
  9064. "required": ["line", "character"]
  9065. }
  9066. },
  9067. "required": ["start", "end"]
  9068. },
  9069. "SymbolSource": {
  9070. "type": "object",
  9071. "properties": {
  9072. "text": {
  9073. "$ref": "#/components/schemas/FilePartSourceText"
  9074. },
  9075. "type": {
  9076. "type": "string",
  9077. "const": "symbol"
  9078. },
  9079. "path": {
  9080. "type": "string"
  9081. },
  9082. "range": {
  9083. "$ref": "#/components/schemas/Range"
  9084. },
  9085. "name": {
  9086. "type": "string"
  9087. },
  9088. "kind": {
  9089. "type": "integer",
  9090. "minimum": -9007199254740991,
  9091. "maximum": 9007199254740991
  9092. }
  9093. },
  9094. "required": ["text", "type", "path", "range", "name", "kind"]
  9095. },
  9096. "ResourceSource": {
  9097. "type": "object",
  9098. "properties": {
  9099. "text": {
  9100. "$ref": "#/components/schemas/FilePartSourceText"
  9101. },
  9102. "type": {
  9103. "type": "string",
  9104. "const": "resource"
  9105. },
  9106. "clientName": {
  9107. "type": "string"
  9108. },
  9109. "uri": {
  9110. "type": "string"
  9111. }
  9112. },
  9113. "required": ["text", "type", "clientName", "uri"]
  9114. },
  9115. "FilePartSource": {
  9116. "anyOf": [
  9117. {
  9118. "$ref": "#/components/schemas/FileSource"
  9119. },
  9120. {
  9121. "$ref": "#/components/schemas/SymbolSource"
  9122. },
  9123. {
  9124. "$ref": "#/components/schemas/ResourceSource"
  9125. }
  9126. ]
  9127. },
  9128. "FilePart": {
  9129. "type": "object",
  9130. "properties": {
  9131. "id": {
  9132. "type": "string",
  9133. "pattern": "^prt.*"
  9134. },
  9135. "sessionID": {
  9136. "type": "string",
  9137. "pattern": "^ses.*"
  9138. },
  9139. "messageID": {
  9140. "type": "string",
  9141. "pattern": "^msg.*"
  9142. },
  9143. "type": {
  9144. "type": "string",
  9145. "const": "file"
  9146. },
  9147. "mime": {
  9148. "type": "string"
  9149. },
  9150. "filename": {
  9151. "type": "string"
  9152. },
  9153. "url": {
  9154. "type": "string"
  9155. },
  9156. "source": {
  9157. "$ref": "#/components/schemas/FilePartSource"
  9158. }
  9159. },
  9160. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  9161. },
  9162. "ToolStatePending": {
  9163. "type": "object",
  9164. "properties": {
  9165. "status": {
  9166. "type": "string",
  9167. "const": "pending"
  9168. },
  9169. "input": {
  9170. "type": "object",
  9171. "propertyNames": {
  9172. "type": "string"
  9173. },
  9174. "additionalProperties": {}
  9175. },
  9176. "raw": {
  9177. "type": "string"
  9178. }
  9179. },
  9180. "required": ["status", "input", "raw"]
  9181. },
  9182. "ToolStateRunning": {
  9183. "type": "object",
  9184. "properties": {
  9185. "status": {
  9186. "type": "string",
  9187. "const": "running"
  9188. },
  9189. "input": {
  9190. "type": "object",
  9191. "propertyNames": {
  9192. "type": "string"
  9193. },
  9194. "additionalProperties": {}
  9195. },
  9196. "title": {
  9197. "type": "string"
  9198. },
  9199. "metadata": {
  9200. "type": "object",
  9201. "propertyNames": {
  9202. "type": "string"
  9203. },
  9204. "additionalProperties": {}
  9205. },
  9206. "time": {
  9207. "type": "object",
  9208. "properties": {
  9209. "start": {
  9210. "type": "number"
  9211. }
  9212. },
  9213. "required": ["start"]
  9214. }
  9215. },
  9216. "required": ["status", "input", "time"]
  9217. },
  9218. "ToolStateCompleted": {
  9219. "type": "object",
  9220. "properties": {
  9221. "status": {
  9222. "type": "string",
  9223. "const": "completed"
  9224. },
  9225. "input": {
  9226. "type": "object",
  9227. "propertyNames": {
  9228. "type": "string"
  9229. },
  9230. "additionalProperties": {}
  9231. },
  9232. "output": {
  9233. "type": "string"
  9234. },
  9235. "title": {
  9236. "type": "string"
  9237. },
  9238. "metadata": {
  9239. "type": "object",
  9240. "propertyNames": {
  9241. "type": "string"
  9242. },
  9243. "additionalProperties": {}
  9244. },
  9245. "time": {
  9246. "type": "object",
  9247. "properties": {
  9248. "start": {
  9249. "type": "number"
  9250. },
  9251. "end": {
  9252. "type": "number"
  9253. },
  9254. "compacted": {
  9255. "type": "number"
  9256. }
  9257. },
  9258. "required": ["start", "end"]
  9259. },
  9260. "attachments": {
  9261. "type": "array",
  9262. "items": {
  9263. "$ref": "#/components/schemas/FilePart"
  9264. }
  9265. }
  9266. },
  9267. "required": ["status", "input", "output", "title", "metadata", "time"]
  9268. },
  9269. "ToolStateError": {
  9270. "type": "object",
  9271. "properties": {
  9272. "status": {
  9273. "type": "string",
  9274. "const": "error"
  9275. },
  9276. "input": {
  9277. "type": "object",
  9278. "propertyNames": {
  9279. "type": "string"
  9280. },
  9281. "additionalProperties": {}
  9282. },
  9283. "error": {
  9284. "type": "string"
  9285. },
  9286. "metadata": {
  9287. "type": "object",
  9288. "propertyNames": {
  9289. "type": "string"
  9290. },
  9291. "additionalProperties": {}
  9292. },
  9293. "time": {
  9294. "type": "object",
  9295. "properties": {
  9296. "start": {
  9297. "type": "number"
  9298. },
  9299. "end": {
  9300. "type": "number"
  9301. }
  9302. },
  9303. "required": ["start", "end"]
  9304. }
  9305. },
  9306. "required": ["status", "input", "error", "time"]
  9307. },
  9308. "ToolState": {
  9309. "anyOf": [
  9310. {
  9311. "$ref": "#/components/schemas/ToolStatePending"
  9312. },
  9313. {
  9314. "$ref": "#/components/schemas/ToolStateRunning"
  9315. },
  9316. {
  9317. "$ref": "#/components/schemas/ToolStateCompleted"
  9318. },
  9319. {
  9320. "$ref": "#/components/schemas/ToolStateError"
  9321. }
  9322. ]
  9323. },
  9324. "ToolPart": {
  9325. "type": "object",
  9326. "properties": {
  9327. "id": {
  9328. "type": "string",
  9329. "pattern": "^prt.*"
  9330. },
  9331. "sessionID": {
  9332. "type": "string",
  9333. "pattern": "^ses.*"
  9334. },
  9335. "messageID": {
  9336. "type": "string",
  9337. "pattern": "^msg.*"
  9338. },
  9339. "type": {
  9340. "type": "string",
  9341. "const": "tool"
  9342. },
  9343. "callID": {
  9344. "type": "string"
  9345. },
  9346. "tool": {
  9347. "type": "string"
  9348. },
  9349. "state": {
  9350. "$ref": "#/components/schemas/ToolState"
  9351. },
  9352. "metadata": {
  9353. "type": "object",
  9354. "propertyNames": {
  9355. "type": "string"
  9356. },
  9357. "additionalProperties": {}
  9358. }
  9359. },
  9360. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  9361. },
  9362. "StepStartPart": {
  9363. "type": "object",
  9364. "properties": {
  9365. "id": {
  9366. "type": "string",
  9367. "pattern": "^prt.*"
  9368. },
  9369. "sessionID": {
  9370. "type": "string",
  9371. "pattern": "^ses.*"
  9372. },
  9373. "messageID": {
  9374. "type": "string",
  9375. "pattern": "^msg.*"
  9376. },
  9377. "type": {
  9378. "type": "string",
  9379. "const": "step-start"
  9380. },
  9381. "snapshot": {
  9382. "type": "string"
  9383. }
  9384. },
  9385. "required": ["id", "sessionID", "messageID", "type"]
  9386. },
  9387. "StepFinishPart": {
  9388. "type": "object",
  9389. "properties": {
  9390. "id": {
  9391. "type": "string",
  9392. "pattern": "^prt.*"
  9393. },
  9394. "sessionID": {
  9395. "type": "string",
  9396. "pattern": "^ses.*"
  9397. },
  9398. "messageID": {
  9399. "type": "string",
  9400. "pattern": "^msg.*"
  9401. },
  9402. "type": {
  9403. "type": "string",
  9404. "const": "step-finish"
  9405. },
  9406. "reason": {
  9407. "type": "string"
  9408. },
  9409. "snapshot": {
  9410. "type": "string"
  9411. },
  9412. "cost": {
  9413. "type": "number"
  9414. },
  9415. "tokens": {
  9416. "type": "object",
  9417. "properties": {
  9418. "total": {
  9419. "type": "number"
  9420. },
  9421. "input": {
  9422. "type": "number"
  9423. },
  9424. "output": {
  9425. "type": "number"
  9426. },
  9427. "reasoning": {
  9428. "type": "number"
  9429. },
  9430. "cache": {
  9431. "type": "object",
  9432. "properties": {
  9433. "read": {
  9434. "type": "number"
  9435. },
  9436. "write": {
  9437. "type": "number"
  9438. }
  9439. },
  9440. "required": ["read", "write"]
  9441. }
  9442. },
  9443. "required": ["input", "output", "reasoning", "cache"]
  9444. }
  9445. },
  9446. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  9447. },
  9448. "SnapshotPart": {
  9449. "type": "object",
  9450. "properties": {
  9451. "id": {
  9452. "type": "string",
  9453. "pattern": "^prt.*"
  9454. },
  9455. "sessionID": {
  9456. "type": "string",
  9457. "pattern": "^ses.*"
  9458. },
  9459. "messageID": {
  9460. "type": "string",
  9461. "pattern": "^msg.*"
  9462. },
  9463. "type": {
  9464. "type": "string",
  9465. "const": "snapshot"
  9466. },
  9467. "snapshot": {
  9468. "type": "string"
  9469. }
  9470. },
  9471. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  9472. },
  9473. "PatchPart": {
  9474. "type": "object",
  9475. "properties": {
  9476. "id": {
  9477. "type": "string",
  9478. "pattern": "^prt.*"
  9479. },
  9480. "sessionID": {
  9481. "type": "string",
  9482. "pattern": "^ses.*"
  9483. },
  9484. "messageID": {
  9485. "type": "string",
  9486. "pattern": "^msg.*"
  9487. },
  9488. "type": {
  9489. "type": "string",
  9490. "const": "patch"
  9491. },
  9492. "hash": {
  9493. "type": "string"
  9494. },
  9495. "files": {
  9496. "type": "array",
  9497. "items": {
  9498. "type": "string"
  9499. }
  9500. }
  9501. },
  9502. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  9503. },
  9504. "AgentPart": {
  9505. "type": "object",
  9506. "properties": {
  9507. "id": {
  9508. "type": "string",
  9509. "pattern": "^prt.*"
  9510. },
  9511. "sessionID": {
  9512. "type": "string",
  9513. "pattern": "^ses.*"
  9514. },
  9515. "messageID": {
  9516. "type": "string",
  9517. "pattern": "^msg.*"
  9518. },
  9519. "type": {
  9520. "type": "string",
  9521. "const": "agent"
  9522. },
  9523. "name": {
  9524. "type": "string"
  9525. },
  9526. "source": {
  9527. "type": "object",
  9528. "properties": {
  9529. "value": {
  9530. "type": "string"
  9531. },
  9532. "start": {
  9533. "type": "integer",
  9534. "minimum": -9007199254740991,
  9535. "maximum": 9007199254740991
  9536. },
  9537. "end": {
  9538. "type": "integer",
  9539. "minimum": -9007199254740991,
  9540. "maximum": 9007199254740991
  9541. }
  9542. },
  9543. "required": ["value", "start", "end"]
  9544. }
  9545. },
  9546. "required": ["id", "sessionID", "messageID", "type", "name"]
  9547. },
  9548. "RetryPart": {
  9549. "type": "object",
  9550. "properties": {
  9551. "id": {
  9552. "type": "string",
  9553. "pattern": "^prt.*"
  9554. },
  9555. "sessionID": {
  9556. "type": "string",
  9557. "pattern": "^ses.*"
  9558. },
  9559. "messageID": {
  9560. "type": "string",
  9561. "pattern": "^msg.*"
  9562. },
  9563. "type": {
  9564. "type": "string",
  9565. "const": "retry"
  9566. },
  9567. "attempt": {
  9568. "type": "number"
  9569. },
  9570. "error": {
  9571. "$ref": "#/components/schemas/APIError"
  9572. },
  9573. "time": {
  9574. "type": "object",
  9575. "properties": {
  9576. "created": {
  9577. "type": "number"
  9578. }
  9579. },
  9580. "required": ["created"]
  9581. }
  9582. },
  9583. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  9584. },
  9585. "CompactionPart": {
  9586. "type": "object",
  9587. "properties": {
  9588. "id": {
  9589. "type": "string",
  9590. "pattern": "^prt.*"
  9591. },
  9592. "sessionID": {
  9593. "type": "string",
  9594. "pattern": "^ses.*"
  9595. },
  9596. "messageID": {
  9597. "type": "string",
  9598. "pattern": "^msg.*"
  9599. },
  9600. "type": {
  9601. "type": "string",
  9602. "const": "compaction"
  9603. },
  9604. "auto": {
  9605. "type": "boolean"
  9606. },
  9607. "overflow": {
  9608. "type": "boolean"
  9609. }
  9610. },
  9611. "required": ["id", "sessionID", "messageID", "type", "auto"]
  9612. },
  9613. "Part": {
  9614. "anyOf": [
  9615. {
  9616. "$ref": "#/components/schemas/TextPart"
  9617. },
  9618. {
  9619. "$ref": "#/components/schemas/SubtaskPart"
  9620. },
  9621. {
  9622. "$ref": "#/components/schemas/ReasoningPart"
  9623. },
  9624. {
  9625. "$ref": "#/components/schemas/FilePart"
  9626. },
  9627. {
  9628. "$ref": "#/components/schemas/ToolPart"
  9629. },
  9630. {
  9631. "$ref": "#/components/schemas/StepStartPart"
  9632. },
  9633. {
  9634. "$ref": "#/components/schemas/StepFinishPart"
  9635. },
  9636. {
  9637. "$ref": "#/components/schemas/SnapshotPart"
  9638. },
  9639. {
  9640. "$ref": "#/components/schemas/PatchPart"
  9641. },
  9642. {
  9643. "$ref": "#/components/schemas/AgentPart"
  9644. },
  9645. {
  9646. "$ref": "#/components/schemas/RetryPart"
  9647. },
  9648. {
  9649. "$ref": "#/components/schemas/CompactionPart"
  9650. }
  9651. ]
  9652. },
  9653. "Event.message.part.updated": {
  9654. "type": "object",
  9655. "properties": {
  9656. "type": {
  9657. "type": "string",
  9658. "const": "message.part.updated"
  9659. },
  9660. "properties": {
  9661. "type": "object",
  9662. "properties": {
  9663. "sessionID": {
  9664. "type": "string",
  9665. "pattern": "^ses.*"
  9666. },
  9667. "part": {
  9668. "$ref": "#/components/schemas/Part"
  9669. },
  9670. "time": {
  9671. "type": "number"
  9672. }
  9673. },
  9674. "required": ["sessionID", "part", "time"]
  9675. }
  9676. },
  9677. "required": ["type", "properties"]
  9678. },
  9679. "Event.message.part.removed": {
  9680. "type": "object",
  9681. "properties": {
  9682. "type": {
  9683. "type": "string",
  9684. "const": "message.part.removed"
  9685. },
  9686. "properties": {
  9687. "type": "object",
  9688. "properties": {
  9689. "sessionID": {
  9690. "type": "string",
  9691. "pattern": "^ses.*"
  9692. },
  9693. "messageID": {
  9694. "type": "string",
  9695. "pattern": "^msg.*"
  9696. },
  9697. "partID": {
  9698. "type": "string",
  9699. "pattern": "^prt.*"
  9700. }
  9701. },
  9702. "required": ["sessionID", "messageID", "partID"]
  9703. }
  9704. },
  9705. "required": ["type", "properties"]
  9706. },
  9707. "PermissionAction": {
  9708. "type": "string",
  9709. "enum": ["allow", "deny", "ask"]
  9710. },
  9711. "PermissionRule": {
  9712. "type": "object",
  9713. "properties": {
  9714. "permission": {
  9715. "type": "string"
  9716. },
  9717. "pattern": {
  9718. "type": "string"
  9719. },
  9720. "action": {
  9721. "$ref": "#/components/schemas/PermissionAction"
  9722. }
  9723. },
  9724. "required": ["permission", "pattern", "action"]
  9725. },
  9726. "PermissionRuleset": {
  9727. "type": "array",
  9728. "items": {
  9729. "$ref": "#/components/schemas/PermissionRule"
  9730. }
  9731. },
  9732. "Session": {
  9733. "type": "object",
  9734. "properties": {
  9735. "id": {
  9736. "type": "string",
  9737. "pattern": "^ses.*"
  9738. },
  9739. "slug": {
  9740. "type": "string"
  9741. },
  9742. "projectID": {
  9743. "type": "string"
  9744. },
  9745. "workspaceID": {
  9746. "type": "string",
  9747. "pattern": "^wrk.*"
  9748. },
  9749. "directory": {
  9750. "type": "string"
  9751. },
  9752. "parentID": {
  9753. "type": "string",
  9754. "pattern": "^ses.*"
  9755. },
  9756. "summary": {
  9757. "type": "object",
  9758. "properties": {
  9759. "additions": {
  9760. "type": "number"
  9761. },
  9762. "deletions": {
  9763. "type": "number"
  9764. },
  9765. "files": {
  9766. "type": "number"
  9767. },
  9768. "diffs": {
  9769. "type": "array",
  9770. "items": {
  9771. "$ref": "#/components/schemas/SnapshotFileDiff"
  9772. }
  9773. }
  9774. },
  9775. "required": ["additions", "deletions", "files"]
  9776. },
  9777. "share": {
  9778. "type": "object",
  9779. "properties": {
  9780. "url": {
  9781. "type": "string"
  9782. }
  9783. },
  9784. "required": ["url"]
  9785. },
  9786. "title": {
  9787. "type": "string"
  9788. },
  9789. "version": {
  9790. "type": "string"
  9791. },
  9792. "time": {
  9793. "type": "object",
  9794. "properties": {
  9795. "created": {
  9796. "type": "number"
  9797. },
  9798. "updated": {
  9799. "type": "number"
  9800. },
  9801. "compacting": {
  9802. "type": "number"
  9803. },
  9804. "archived": {
  9805. "type": "number"
  9806. }
  9807. },
  9808. "required": ["created", "updated"]
  9809. },
  9810. "permission": {
  9811. "$ref": "#/components/schemas/PermissionRuleset"
  9812. },
  9813. "revert": {
  9814. "type": "object",
  9815. "properties": {
  9816. "messageID": {
  9817. "type": "string",
  9818. "pattern": "^msg.*"
  9819. },
  9820. "partID": {
  9821. "type": "string",
  9822. "pattern": "^prt.*"
  9823. },
  9824. "snapshot": {
  9825. "type": "string"
  9826. },
  9827. "diff": {
  9828. "type": "string"
  9829. }
  9830. },
  9831. "required": ["messageID"]
  9832. }
  9833. },
  9834. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  9835. },
  9836. "Event.session.created": {
  9837. "type": "object",
  9838. "properties": {
  9839. "type": {
  9840. "type": "string",
  9841. "const": "session.created"
  9842. },
  9843. "properties": {
  9844. "type": "object",
  9845. "properties": {
  9846. "sessionID": {
  9847. "type": "string",
  9848. "pattern": "^ses.*"
  9849. },
  9850. "info": {
  9851. "$ref": "#/components/schemas/Session"
  9852. }
  9853. },
  9854. "required": ["sessionID", "info"]
  9855. }
  9856. },
  9857. "required": ["type", "properties"]
  9858. },
  9859. "Event.session.updated": {
  9860. "type": "object",
  9861. "properties": {
  9862. "type": {
  9863. "type": "string",
  9864. "const": "session.updated"
  9865. },
  9866. "properties": {
  9867. "type": "object",
  9868. "properties": {
  9869. "sessionID": {
  9870. "type": "string",
  9871. "pattern": "^ses.*"
  9872. },
  9873. "info": {
  9874. "$ref": "#/components/schemas/Session"
  9875. }
  9876. },
  9877. "required": ["sessionID", "info"]
  9878. }
  9879. },
  9880. "required": ["type", "properties"]
  9881. },
  9882. "Event.session.deleted": {
  9883. "type": "object",
  9884. "properties": {
  9885. "type": {
  9886. "type": "string",
  9887. "const": "session.deleted"
  9888. },
  9889. "properties": {
  9890. "type": "object",
  9891. "properties": {
  9892. "sessionID": {
  9893. "type": "string",
  9894. "pattern": "^ses.*"
  9895. },
  9896. "info": {
  9897. "$ref": "#/components/schemas/Session"
  9898. }
  9899. },
  9900. "required": ["sessionID", "info"]
  9901. }
  9902. },
  9903. "required": ["type", "properties"]
  9904. },
  9905. "SyncEvent.message.updated": {
  9906. "type": "object",
  9907. "properties": {
  9908. "type": {
  9909. "type": "string",
  9910. "const": "sync"
  9911. },
  9912. "name": {
  9913. "type": "string",
  9914. "const": "message.updated.1"
  9915. },
  9916. "id": {
  9917. "type": "string"
  9918. },
  9919. "seq": {
  9920. "type": "number"
  9921. },
  9922. "aggregateID": {
  9923. "type": "string",
  9924. "const": "sessionID"
  9925. },
  9926. "data": {
  9927. "type": "object",
  9928. "properties": {
  9929. "sessionID": {
  9930. "type": "string",
  9931. "pattern": "^ses.*"
  9932. },
  9933. "info": {
  9934. "$ref": "#/components/schemas/Message"
  9935. }
  9936. },
  9937. "required": ["sessionID", "info"]
  9938. }
  9939. },
  9940. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  9941. },
  9942. "SyncEvent.message.removed": {
  9943. "type": "object",
  9944. "properties": {
  9945. "type": {
  9946. "type": "string",
  9947. "const": "sync"
  9948. },
  9949. "name": {
  9950. "type": "string",
  9951. "const": "message.removed.1"
  9952. },
  9953. "id": {
  9954. "type": "string"
  9955. },
  9956. "seq": {
  9957. "type": "number"
  9958. },
  9959. "aggregateID": {
  9960. "type": "string",
  9961. "const": "sessionID"
  9962. },
  9963. "data": {
  9964. "type": "object",
  9965. "properties": {
  9966. "sessionID": {
  9967. "type": "string",
  9968. "pattern": "^ses.*"
  9969. },
  9970. "messageID": {
  9971. "type": "string",
  9972. "pattern": "^msg.*"
  9973. }
  9974. },
  9975. "required": ["sessionID", "messageID"]
  9976. }
  9977. },
  9978. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  9979. },
  9980. "SyncEvent.message.part.updated": {
  9981. "type": "object",
  9982. "properties": {
  9983. "type": {
  9984. "type": "string",
  9985. "const": "sync"
  9986. },
  9987. "name": {
  9988. "type": "string",
  9989. "const": "message.part.updated.1"
  9990. },
  9991. "id": {
  9992. "type": "string"
  9993. },
  9994. "seq": {
  9995. "type": "number"
  9996. },
  9997. "aggregateID": {
  9998. "type": "string",
  9999. "const": "sessionID"
  10000. },
  10001. "data": {
  10002. "type": "object",
  10003. "properties": {
  10004. "sessionID": {
  10005. "type": "string",
  10006. "pattern": "^ses.*"
  10007. },
  10008. "part": {
  10009. "$ref": "#/components/schemas/Part"
  10010. },
  10011. "time": {
  10012. "type": "number"
  10013. }
  10014. },
  10015. "required": ["sessionID", "part", "time"]
  10016. }
  10017. },
  10018. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10019. },
  10020. "SyncEvent.message.part.removed": {
  10021. "type": "object",
  10022. "properties": {
  10023. "type": {
  10024. "type": "string",
  10025. "const": "sync"
  10026. },
  10027. "name": {
  10028. "type": "string",
  10029. "const": "message.part.removed.1"
  10030. },
  10031. "id": {
  10032. "type": "string"
  10033. },
  10034. "seq": {
  10035. "type": "number"
  10036. },
  10037. "aggregateID": {
  10038. "type": "string",
  10039. "const": "sessionID"
  10040. },
  10041. "data": {
  10042. "type": "object",
  10043. "properties": {
  10044. "sessionID": {
  10045. "type": "string",
  10046. "pattern": "^ses.*"
  10047. },
  10048. "messageID": {
  10049. "type": "string",
  10050. "pattern": "^msg.*"
  10051. },
  10052. "partID": {
  10053. "type": "string",
  10054. "pattern": "^prt.*"
  10055. }
  10056. },
  10057. "required": ["sessionID", "messageID", "partID"]
  10058. }
  10059. },
  10060. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10061. },
  10062. "SyncEvent.session.created": {
  10063. "type": "object",
  10064. "properties": {
  10065. "type": {
  10066. "type": "string",
  10067. "const": "sync"
  10068. },
  10069. "name": {
  10070. "type": "string",
  10071. "const": "session.created.1"
  10072. },
  10073. "id": {
  10074. "type": "string"
  10075. },
  10076. "seq": {
  10077. "type": "number"
  10078. },
  10079. "aggregateID": {
  10080. "type": "string",
  10081. "const": "sessionID"
  10082. },
  10083. "data": {
  10084. "type": "object",
  10085. "properties": {
  10086. "sessionID": {
  10087. "type": "string",
  10088. "pattern": "^ses.*"
  10089. },
  10090. "info": {
  10091. "$ref": "#/components/schemas/Session"
  10092. }
  10093. },
  10094. "required": ["sessionID", "info"]
  10095. }
  10096. },
  10097. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10098. },
  10099. "SyncEvent.session.updated": {
  10100. "type": "object",
  10101. "properties": {
  10102. "type": {
  10103. "type": "string",
  10104. "const": "sync"
  10105. },
  10106. "name": {
  10107. "type": "string",
  10108. "const": "session.updated.1"
  10109. },
  10110. "id": {
  10111. "type": "string"
  10112. },
  10113. "seq": {
  10114. "type": "number"
  10115. },
  10116. "aggregateID": {
  10117. "type": "string",
  10118. "const": "sessionID"
  10119. },
  10120. "data": {
  10121. "type": "object",
  10122. "properties": {
  10123. "sessionID": {
  10124. "type": "string",
  10125. "pattern": "^ses.*"
  10126. },
  10127. "info": {
  10128. "type": "object",
  10129. "properties": {
  10130. "id": {
  10131. "anyOf": [
  10132. {
  10133. "type": "string",
  10134. "pattern": "^ses.*"
  10135. },
  10136. {
  10137. "type": "null"
  10138. }
  10139. ]
  10140. },
  10141. "slug": {
  10142. "anyOf": [
  10143. {
  10144. "type": "string"
  10145. },
  10146. {
  10147. "type": "null"
  10148. }
  10149. ]
  10150. },
  10151. "projectID": {
  10152. "anyOf": [
  10153. {
  10154. "type": "string"
  10155. },
  10156. {
  10157. "type": "null"
  10158. }
  10159. ]
  10160. },
  10161. "workspaceID": {
  10162. "anyOf": [
  10163. {
  10164. "type": "string",
  10165. "pattern": "^wrk.*"
  10166. },
  10167. {
  10168. "type": "null"
  10169. }
  10170. ]
  10171. },
  10172. "directory": {
  10173. "anyOf": [
  10174. {
  10175. "type": "string"
  10176. },
  10177. {
  10178. "type": "null"
  10179. }
  10180. ]
  10181. },
  10182. "parentID": {
  10183. "anyOf": [
  10184. {
  10185. "type": "string",
  10186. "pattern": "^ses.*"
  10187. },
  10188. {
  10189. "type": "null"
  10190. }
  10191. ]
  10192. },
  10193. "summary": {
  10194. "anyOf": [
  10195. {
  10196. "type": "object",
  10197. "properties": {
  10198. "additions": {
  10199. "type": "number"
  10200. },
  10201. "deletions": {
  10202. "type": "number"
  10203. },
  10204. "files": {
  10205. "type": "number"
  10206. },
  10207. "diffs": {
  10208. "type": "array",
  10209. "items": {
  10210. "$ref": "#/components/schemas/SnapshotFileDiff"
  10211. }
  10212. }
  10213. },
  10214. "required": ["additions", "deletions", "files"]
  10215. },
  10216. {
  10217. "type": "null"
  10218. }
  10219. ]
  10220. },
  10221. "share": {
  10222. "type": "object",
  10223. "properties": {
  10224. "url": {
  10225. "anyOf": [
  10226. {
  10227. "type": "string"
  10228. },
  10229. {
  10230. "type": "null"
  10231. }
  10232. ]
  10233. }
  10234. },
  10235. "required": ["url"]
  10236. },
  10237. "title": {
  10238. "anyOf": [
  10239. {
  10240. "type": "string"
  10241. },
  10242. {
  10243. "type": "null"
  10244. }
  10245. ]
  10246. },
  10247. "version": {
  10248. "anyOf": [
  10249. {
  10250. "type": "string"
  10251. },
  10252. {
  10253. "type": "null"
  10254. }
  10255. ]
  10256. },
  10257. "time": {
  10258. "type": "object",
  10259. "properties": {
  10260. "created": {
  10261. "anyOf": [
  10262. {
  10263. "type": "number"
  10264. },
  10265. {
  10266. "type": "null"
  10267. }
  10268. ]
  10269. },
  10270. "updated": {
  10271. "anyOf": [
  10272. {
  10273. "type": "number"
  10274. },
  10275. {
  10276. "type": "null"
  10277. }
  10278. ]
  10279. },
  10280. "compacting": {
  10281. "anyOf": [
  10282. {
  10283. "type": "number"
  10284. },
  10285. {
  10286. "type": "null"
  10287. }
  10288. ]
  10289. },
  10290. "archived": {
  10291. "anyOf": [
  10292. {
  10293. "type": "number"
  10294. },
  10295. {
  10296. "type": "null"
  10297. }
  10298. ]
  10299. }
  10300. },
  10301. "required": ["created", "updated", "compacting", "archived"]
  10302. },
  10303. "permission": {
  10304. "anyOf": [
  10305. {
  10306. "$ref": "#/components/schemas/PermissionRuleset"
  10307. },
  10308. {
  10309. "type": "null"
  10310. }
  10311. ]
  10312. },
  10313. "revert": {
  10314. "anyOf": [
  10315. {
  10316. "type": "object",
  10317. "properties": {
  10318. "messageID": {
  10319. "type": "string",
  10320. "pattern": "^msg.*"
  10321. },
  10322. "partID": {
  10323. "type": "string",
  10324. "pattern": "^prt.*"
  10325. },
  10326. "snapshot": {
  10327. "type": "string"
  10328. },
  10329. "diff": {
  10330. "type": "string"
  10331. }
  10332. },
  10333. "required": ["messageID"]
  10334. },
  10335. {
  10336. "type": "null"
  10337. }
  10338. ]
  10339. }
  10340. },
  10341. "required": [
  10342. "id",
  10343. "slug",
  10344. "projectID",
  10345. "workspaceID",
  10346. "directory",
  10347. "parentID",
  10348. "summary",
  10349. "title",
  10350. "version",
  10351. "permission",
  10352. "revert"
  10353. ]
  10354. }
  10355. },
  10356. "required": ["sessionID", "info"]
  10357. }
  10358. },
  10359. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10360. },
  10361. "SyncEvent.session.deleted": {
  10362. "type": "object",
  10363. "properties": {
  10364. "type": {
  10365. "type": "string",
  10366. "const": "sync"
  10367. },
  10368. "name": {
  10369. "type": "string",
  10370. "const": "session.deleted.1"
  10371. },
  10372. "id": {
  10373. "type": "string"
  10374. },
  10375. "seq": {
  10376. "type": "number"
  10377. },
  10378. "aggregateID": {
  10379. "type": "string",
  10380. "const": "sessionID"
  10381. },
  10382. "data": {
  10383. "type": "object",
  10384. "properties": {
  10385. "sessionID": {
  10386. "type": "string",
  10387. "pattern": "^ses.*"
  10388. },
  10389. "info": {
  10390. "$ref": "#/components/schemas/Session"
  10391. }
  10392. },
  10393. "required": ["sessionID", "info"]
  10394. }
  10395. },
  10396. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10397. },
  10398. "GlobalEvent": {
  10399. "type": "object",
  10400. "properties": {
  10401. "directory": {
  10402. "type": "string"
  10403. },
  10404. "project": {
  10405. "type": "string"
  10406. },
  10407. "workspace": {
  10408. "type": "string"
  10409. },
  10410. "payload": {
  10411. "anyOf": [
  10412. {
  10413. "$ref": "#/components/schemas/Event.project.updated"
  10414. },
  10415. {
  10416. "$ref": "#/components/schemas/Event.server.instance.disposed"
  10417. },
  10418. {
  10419. "$ref": "#/components/schemas/Event.installation.updated"
  10420. },
  10421. {
  10422. "$ref": "#/components/schemas/Event.installation.update-available"
  10423. },
  10424. {
  10425. "$ref": "#/components/schemas/Event.server.connected"
  10426. },
  10427. {
  10428. "$ref": "#/components/schemas/Event.global.disposed"
  10429. },
  10430. {
  10431. "$ref": "#/components/schemas/Event.file.edited"
  10432. },
  10433. {
  10434. "$ref": "#/components/schemas/Event.file.watcher.updated"
  10435. },
  10436. {
  10437. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  10438. },
  10439. {
  10440. "$ref": "#/components/schemas/Event.lsp.updated"
  10441. },
  10442. {
  10443. "$ref": "#/components/schemas/Event.message.part.delta"
  10444. },
  10445. {
  10446. "$ref": "#/components/schemas/Event.permission.asked"
  10447. },
  10448. {
  10449. "$ref": "#/components/schemas/Event.permission.replied"
  10450. },
  10451. {
  10452. "$ref": "#/components/schemas/Event.session.diff"
  10453. },
  10454. {
  10455. "$ref": "#/components/schemas/Event.session.error"
  10456. },
  10457. {
  10458. "$ref": "#/components/schemas/Event.question.asked"
  10459. },
  10460. {
  10461. "$ref": "#/components/schemas/Event.question.replied"
  10462. },
  10463. {
  10464. "$ref": "#/components/schemas/Event.question.rejected"
  10465. },
  10466. {
  10467. "$ref": "#/components/schemas/Event.todo.updated"
  10468. },
  10469. {
  10470. "$ref": "#/components/schemas/Event.session.status"
  10471. },
  10472. {
  10473. "$ref": "#/components/schemas/Event.session.idle"
  10474. },
  10475. {
  10476. "$ref": "#/components/schemas/Event.session.compacted"
  10477. },
  10478. {
  10479. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10480. },
  10481. {
  10482. "$ref": "#/components/schemas/Event.tui.command.execute"
  10483. },
  10484. {
  10485. "$ref": "#/components/schemas/Event.tui.toast.show"
  10486. },
  10487. {
  10488. "$ref": "#/components/schemas/Event.tui.session.select"
  10489. },
  10490. {
  10491. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  10492. },
  10493. {
  10494. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  10495. },
  10496. {
  10497. "$ref": "#/components/schemas/Event.command.executed"
  10498. },
  10499. {
  10500. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  10501. },
  10502. {
  10503. "$ref": "#/components/schemas/Event.worktree.ready"
  10504. },
  10505. {
  10506. "$ref": "#/components/schemas/Event.worktree.failed"
  10507. },
  10508. {
  10509. "$ref": "#/components/schemas/Event.pty.created"
  10510. },
  10511. {
  10512. "$ref": "#/components/schemas/Event.pty.updated"
  10513. },
  10514. {
  10515. "$ref": "#/components/schemas/Event.pty.exited"
  10516. },
  10517. {
  10518. "$ref": "#/components/schemas/Event.pty.deleted"
  10519. },
  10520. {
  10521. "$ref": "#/components/schemas/Event.workspace.ready"
  10522. },
  10523. {
  10524. "$ref": "#/components/schemas/Event.workspace.failed"
  10525. },
  10526. {
  10527. "$ref": "#/components/schemas/Event.workspace.status"
  10528. },
  10529. {
  10530. "$ref": "#/components/schemas/Event.message.updated"
  10531. },
  10532. {
  10533. "$ref": "#/components/schemas/Event.message.removed"
  10534. },
  10535. {
  10536. "$ref": "#/components/schemas/Event.message.part.updated"
  10537. },
  10538. {
  10539. "$ref": "#/components/schemas/Event.message.part.removed"
  10540. },
  10541. {
  10542. "$ref": "#/components/schemas/Event.session.created"
  10543. },
  10544. {
  10545. "$ref": "#/components/schemas/Event.session.updated"
  10546. },
  10547. {
  10548. "$ref": "#/components/schemas/Event.session.deleted"
  10549. },
  10550. {
  10551. "$ref": "#/components/schemas/SyncEvent.message.updated"
  10552. },
  10553. {
  10554. "$ref": "#/components/schemas/SyncEvent.message.removed"
  10555. },
  10556. {
  10557. "$ref": "#/components/schemas/SyncEvent.message.part.updated"
  10558. },
  10559. {
  10560. "$ref": "#/components/schemas/SyncEvent.message.part.removed"
  10561. },
  10562. {
  10563. "$ref": "#/components/schemas/SyncEvent.session.created"
  10564. },
  10565. {
  10566. "$ref": "#/components/schemas/SyncEvent.session.updated"
  10567. },
  10568. {
  10569. "$ref": "#/components/schemas/SyncEvent.session.deleted"
  10570. }
  10571. ]
  10572. }
  10573. },
  10574. "required": ["directory", "payload"]
  10575. },
  10576. "LogLevel": {
  10577. "description": "Log level",
  10578. "type": "string",
  10579. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  10580. },
  10581. "ServerConfig": {
  10582. "description": "Server configuration for opencode serve and web commands",
  10583. "type": "object",
  10584. "properties": {
  10585. "port": {
  10586. "description": "Port to listen on",
  10587. "type": "integer",
  10588. "exclusiveMinimum": 0,
  10589. "maximum": 9007199254740991
  10590. },
  10591. "hostname": {
  10592. "description": "Hostname to listen on",
  10593. "type": "string"
  10594. },
  10595. "mdns": {
  10596. "description": "Enable mDNS service discovery",
  10597. "type": "boolean"
  10598. },
  10599. "mdnsDomain": {
  10600. "description": "Custom domain name for mDNS service (default: opencode.local)",
  10601. "type": "string"
  10602. },
  10603. "cors": {
  10604. "description": "Additional domains to allow for CORS",
  10605. "type": "array",
  10606. "items": {
  10607. "type": "string"
  10608. }
  10609. }
  10610. },
  10611. "additionalProperties": false
  10612. },
  10613. "PermissionActionConfig": {
  10614. "type": "string",
  10615. "enum": ["ask", "allow", "deny"]
  10616. },
  10617. "PermissionObjectConfig": {
  10618. "type": "object",
  10619. "propertyNames": {
  10620. "type": "string"
  10621. },
  10622. "additionalProperties": {
  10623. "$ref": "#/components/schemas/PermissionActionConfig"
  10624. }
  10625. },
  10626. "PermissionRuleConfig": {
  10627. "anyOf": [
  10628. {
  10629. "$ref": "#/components/schemas/PermissionActionConfig"
  10630. },
  10631. {
  10632. "$ref": "#/components/schemas/PermissionObjectConfig"
  10633. }
  10634. ]
  10635. },
  10636. "PermissionConfig": {
  10637. "anyOf": [
  10638. {
  10639. "type": "object",
  10640. "properties": {
  10641. "__originalKeys": {
  10642. "type": "array",
  10643. "items": {
  10644. "type": "string"
  10645. }
  10646. },
  10647. "read": {
  10648. "$ref": "#/components/schemas/PermissionRuleConfig"
  10649. },
  10650. "edit": {
  10651. "$ref": "#/components/schemas/PermissionRuleConfig"
  10652. },
  10653. "glob": {
  10654. "$ref": "#/components/schemas/PermissionRuleConfig"
  10655. },
  10656. "grep": {
  10657. "$ref": "#/components/schemas/PermissionRuleConfig"
  10658. },
  10659. "list": {
  10660. "$ref": "#/components/schemas/PermissionRuleConfig"
  10661. },
  10662. "bash": {
  10663. "$ref": "#/components/schemas/PermissionRuleConfig"
  10664. },
  10665. "task": {
  10666. "$ref": "#/components/schemas/PermissionRuleConfig"
  10667. },
  10668. "external_directory": {
  10669. "$ref": "#/components/schemas/PermissionRuleConfig"
  10670. },
  10671. "todowrite": {
  10672. "$ref": "#/components/schemas/PermissionActionConfig"
  10673. },
  10674. "question": {
  10675. "$ref": "#/components/schemas/PermissionActionConfig"
  10676. },
  10677. "webfetch": {
  10678. "$ref": "#/components/schemas/PermissionActionConfig"
  10679. },
  10680. "websearch": {
  10681. "$ref": "#/components/schemas/PermissionActionConfig"
  10682. },
  10683. "codesearch": {
  10684. "$ref": "#/components/schemas/PermissionActionConfig"
  10685. },
  10686. "lsp": {
  10687. "$ref": "#/components/schemas/PermissionRuleConfig"
  10688. },
  10689. "doom_loop": {
  10690. "$ref": "#/components/schemas/PermissionActionConfig"
  10691. },
  10692. "skill": {
  10693. "$ref": "#/components/schemas/PermissionRuleConfig"
  10694. }
  10695. },
  10696. "additionalProperties": {
  10697. "$ref": "#/components/schemas/PermissionRuleConfig"
  10698. }
  10699. },
  10700. {
  10701. "$ref": "#/components/schemas/PermissionActionConfig"
  10702. }
  10703. ]
  10704. },
  10705. "AgentConfig": {
  10706. "type": "object",
  10707. "properties": {
  10708. "model": {
  10709. "type": "string"
  10710. },
  10711. "variant": {
  10712. "description": "Default model variant for this agent (applies only when using the agent's configured model).",
  10713. "type": "string"
  10714. },
  10715. "temperature": {
  10716. "type": "number"
  10717. },
  10718. "top_p": {
  10719. "type": "number"
  10720. },
  10721. "prompt": {
  10722. "type": "string"
  10723. },
  10724. "tools": {
  10725. "description": "@deprecated Use 'permission' field instead",
  10726. "type": "object",
  10727. "propertyNames": {
  10728. "type": "string"
  10729. },
  10730. "additionalProperties": {
  10731. "type": "boolean"
  10732. }
  10733. },
  10734. "disable": {
  10735. "type": "boolean"
  10736. },
  10737. "description": {
  10738. "description": "Description of when to use the agent",
  10739. "type": "string"
  10740. },
  10741. "mode": {
  10742. "type": "string",
  10743. "enum": ["subagent", "primary", "all"]
  10744. },
  10745. "hidden": {
  10746. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  10747. "type": "boolean"
  10748. },
  10749. "options": {
  10750. "type": "object",
  10751. "propertyNames": {
  10752. "type": "string"
  10753. },
  10754. "additionalProperties": {}
  10755. },
  10756. "color": {
  10757. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)",
  10758. "anyOf": [
  10759. {
  10760. "type": "string",
  10761. "pattern": "^#[0-9a-fA-F]{6}$"
  10762. },
  10763. {
  10764. "type": "string",
  10765. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  10766. }
  10767. ]
  10768. },
  10769. "steps": {
  10770. "description": "Maximum number of agentic iterations before forcing text-only response",
  10771. "type": "integer",
  10772. "exclusiveMinimum": 0,
  10773. "maximum": 9007199254740991
  10774. },
  10775. "maxSteps": {
  10776. "description": "@deprecated Use 'steps' field instead.",
  10777. "type": "integer",
  10778. "exclusiveMinimum": 0,
  10779. "maximum": 9007199254740991
  10780. },
  10781. "permission": {
  10782. "$ref": "#/components/schemas/PermissionConfig"
  10783. }
  10784. },
  10785. "additionalProperties": {}
  10786. },
  10787. "ProviderConfig": {
  10788. "type": "object",
  10789. "properties": {
  10790. "api": {
  10791. "type": "string"
  10792. },
  10793. "name": {
  10794. "type": "string"
  10795. },
  10796. "env": {
  10797. "type": "array",
  10798. "items": {
  10799. "type": "string"
  10800. }
  10801. },
  10802. "id": {
  10803. "type": "string"
  10804. },
  10805. "npm": {
  10806. "type": "string"
  10807. },
  10808. "whitelist": {
  10809. "type": "array",
  10810. "items": {
  10811. "type": "string"
  10812. }
  10813. },
  10814. "blacklist": {
  10815. "type": "array",
  10816. "items": {
  10817. "type": "string"
  10818. }
  10819. },
  10820. "options": {
  10821. "type": "object",
  10822. "properties": {
  10823. "apiKey": {
  10824. "type": "string"
  10825. },
  10826. "baseURL": {
  10827. "type": "string"
  10828. },
  10829. "enterpriseUrl": {
  10830. "description": "GitHub Enterprise URL for copilot authentication",
  10831. "type": "string"
  10832. },
  10833. "setCacheKey": {
  10834. "description": "Enable promptCacheKey for this provider (default false)",
  10835. "type": "boolean"
  10836. },
  10837. "timeout": {
  10838. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  10839. "anyOf": [
  10840. {
  10841. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  10842. "type": "integer",
  10843. "exclusiveMinimum": 0,
  10844. "maximum": 9007199254740991
  10845. },
  10846. {
  10847. "description": "Disable timeout for this provider entirely.",
  10848. "type": "boolean",
  10849. "const": false
  10850. }
  10851. ]
  10852. },
  10853. "chunkTimeout": {
  10854. "description": "Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted.",
  10855. "type": "integer",
  10856. "exclusiveMinimum": 0,
  10857. "maximum": 9007199254740991
  10858. }
  10859. },
  10860. "additionalProperties": {}
  10861. },
  10862. "models": {
  10863. "type": "object",
  10864. "propertyNames": {
  10865. "type": "string"
  10866. },
  10867. "additionalProperties": {
  10868. "type": "object",
  10869. "properties": {
  10870. "id": {
  10871. "type": "string"
  10872. },
  10873. "name": {
  10874. "type": "string"
  10875. },
  10876. "family": {
  10877. "type": "string"
  10878. },
  10879. "release_date": {
  10880. "type": "string"
  10881. },
  10882. "attachment": {
  10883. "type": "boolean"
  10884. },
  10885. "reasoning": {
  10886. "type": "boolean"
  10887. },
  10888. "temperature": {
  10889. "type": "boolean"
  10890. },
  10891. "tool_call": {
  10892. "type": "boolean"
  10893. },
  10894. "interleaved": {
  10895. "anyOf": [
  10896. {
  10897. "type": "boolean",
  10898. "const": true
  10899. },
  10900. {
  10901. "type": "object",
  10902. "properties": {
  10903. "field": {
  10904. "type": "string",
  10905. "enum": ["reasoning_content", "reasoning_details"]
  10906. }
  10907. },
  10908. "required": ["field"],
  10909. "additionalProperties": false
  10910. }
  10911. ]
  10912. },
  10913. "cost": {
  10914. "type": "object",
  10915. "properties": {
  10916. "input": {
  10917. "type": "number"
  10918. },
  10919. "output": {
  10920. "type": "number"
  10921. },
  10922. "cache_read": {
  10923. "type": "number"
  10924. },
  10925. "cache_write": {
  10926. "type": "number"
  10927. },
  10928. "context_over_200k": {
  10929. "type": "object",
  10930. "properties": {
  10931. "input": {
  10932. "type": "number"
  10933. },
  10934. "output": {
  10935. "type": "number"
  10936. },
  10937. "cache_read": {
  10938. "type": "number"
  10939. },
  10940. "cache_write": {
  10941. "type": "number"
  10942. }
  10943. },
  10944. "required": ["input", "output"]
  10945. }
  10946. },
  10947. "required": ["input", "output"]
  10948. },
  10949. "limit": {
  10950. "type": "object",
  10951. "properties": {
  10952. "context": {
  10953. "type": "number"
  10954. },
  10955. "input": {
  10956. "type": "number"
  10957. },
  10958. "output": {
  10959. "type": "number"
  10960. }
  10961. },
  10962. "required": ["context", "output"]
  10963. },
  10964. "modalities": {
  10965. "type": "object",
  10966. "properties": {
  10967. "input": {
  10968. "type": "array",
  10969. "items": {
  10970. "type": "string",
  10971. "enum": ["text", "audio", "image", "video", "pdf"]
  10972. }
  10973. },
  10974. "output": {
  10975. "type": "array",
  10976. "items": {
  10977. "type": "string",
  10978. "enum": ["text", "audio", "image", "video", "pdf"]
  10979. }
  10980. }
  10981. },
  10982. "required": ["input", "output"]
  10983. },
  10984. "experimental": {
  10985. "type": "boolean"
  10986. },
  10987. "status": {
  10988. "type": "string",
  10989. "enum": ["alpha", "beta", "deprecated"]
  10990. },
  10991. "provider": {
  10992. "type": "object",
  10993. "properties": {
  10994. "npm": {
  10995. "type": "string"
  10996. },
  10997. "api": {
  10998. "type": "string"
  10999. }
  11000. }
  11001. },
  11002. "options": {
  11003. "type": "object",
  11004. "propertyNames": {
  11005. "type": "string"
  11006. },
  11007. "additionalProperties": {}
  11008. },
  11009. "headers": {
  11010. "type": "object",
  11011. "propertyNames": {
  11012. "type": "string"
  11013. },
  11014. "additionalProperties": {
  11015. "type": "string"
  11016. }
  11017. },
  11018. "variants": {
  11019. "description": "Variant-specific configuration",
  11020. "type": "object",
  11021. "propertyNames": {
  11022. "type": "string"
  11023. },
  11024. "additionalProperties": {
  11025. "type": "object",
  11026. "properties": {
  11027. "disabled": {
  11028. "description": "Disable this variant for the model",
  11029. "type": "boolean"
  11030. }
  11031. },
  11032. "additionalProperties": {}
  11033. }
  11034. }
  11035. }
  11036. }
  11037. }
  11038. },
  11039. "additionalProperties": false
  11040. },
  11041. "McpLocalConfig": {
  11042. "type": "object",
  11043. "properties": {
  11044. "type": {
  11045. "description": "Type of MCP server connection",
  11046. "type": "string",
  11047. "const": "local"
  11048. },
  11049. "command": {
  11050. "description": "Command and arguments to run the MCP server",
  11051. "type": "array",
  11052. "items": {
  11053. "type": "string"
  11054. }
  11055. },
  11056. "environment": {
  11057. "description": "Environment variables to set when running the MCP server",
  11058. "type": "object",
  11059. "propertyNames": {
  11060. "type": "string"
  11061. },
  11062. "additionalProperties": {
  11063. "type": "string"
  11064. }
  11065. },
  11066. "enabled": {
  11067. "description": "Enable or disable the MCP server on startup",
  11068. "type": "boolean"
  11069. },
  11070. "timeout": {
  11071. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11072. "type": "integer",
  11073. "exclusiveMinimum": 0,
  11074. "maximum": 9007199254740991
  11075. }
  11076. },
  11077. "required": ["type", "command"],
  11078. "additionalProperties": false
  11079. },
  11080. "McpOAuthConfig": {
  11081. "type": "object",
  11082. "properties": {
  11083. "clientId": {
  11084. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  11085. "type": "string"
  11086. },
  11087. "clientSecret": {
  11088. "description": "OAuth client secret (if required by the authorization server)",
  11089. "type": "string"
  11090. },
  11091. "scope": {
  11092. "description": "OAuth scopes to request during authorization",
  11093. "type": "string"
  11094. },
  11095. "redirectUri": {
  11096. "description": "OAuth redirect URI (default: http://127.0.0.1:19876/mcp/oauth/callback).",
  11097. "type": "string"
  11098. }
  11099. },
  11100. "additionalProperties": false
  11101. },
  11102. "McpRemoteConfig": {
  11103. "type": "object",
  11104. "properties": {
  11105. "type": {
  11106. "description": "Type of MCP server connection",
  11107. "type": "string",
  11108. "const": "remote"
  11109. },
  11110. "url": {
  11111. "description": "URL of the remote MCP server",
  11112. "type": "string"
  11113. },
  11114. "enabled": {
  11115. "description": "Enable or disable the MCP server on startup",
  11116. "type": "boolean"
  11117. },
  11118. "headers": {
  11119. "description": "Headers to send with the request",
  11120. "type": "object",
  11121. "propertyNames": {
  11122. "type": "string"
  11123. },
  11124. "additionalProperties": {
  11125. "type": "string"
  11126. }
  11127. },
  11128. "oauth": {
  11129. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  11130. "anyOf": [
  11131. {
  11132. "$ref": "#/components/schemas/McpOAuthConfig"
  11133. },
  11134. {
  11135. "type": "boolean",
  11136. "const": false
  11137. }
  11138. ]
  11139. },
  11140. "timeout": {
  11141. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11142. "type": "integer",
  11143. "exclusiveMinimum": 0,
  11144. "maximum": 9007199254740991
  11145. }
  11146. },
  11147. "required": ["type", "url"],
  11148. "additionalProperties": false
  11149. },
  11150. "LayoutConfig": {
  11151. "description": "@deprecated Always uses stretch layout.",
  11152. "type": "string",
  11153. "enum": ["auto", "stretch"]
  11154. },
  11155. "Config": {
  11156. "type": "object",
  11157. "properties": {
  11158. "$schema": {
  11159. "description": "JSON schema reference for configuration validation",
  11160. "type": "string"
  11161. },
  11162. "logLevel": {
  11163. "$ref": "#/components/schemas/LogLevel"
  11164. },
  11165. "server": {
  11166. "$ref": "#/components/schemas/ServerConfig"
  11167. },
  11168. "command": {
  11169. "description": "Command configuration, see https://opencode.ai/docs/commands",
  11170. "type": "object",
  11171. "propertyNames": {
  11172. "type": "string"
  11173. },
  11174. "additionalProperties": {
  11175. "type": "object",
  11176. "properties": {
  11177. "template": {
  11178. "type": "string"
  11179. },
  11180. "description": {
  11181. "type": "string"
  11182. },
  11183. "agent": {
  11184. "type": "string"
  11185. },
  11186. "model": {
  11187. "type": "string"
  11188. },
  11189. "subtask": {
  11190. "type": "boolean"
  11191. }
  11192. },
  11193. "required": ["template"]
  11194. }
  11195. },
  11196. "skills": {
  11197. "description": "Additional skill folder paths",
  11198. "type": "object",
  11199. "properties": {
  11200. "paths": {
  11201. "description": "Additional paths to skill folders",
  11202. "type": "array",
  11203. "items": {
  11204. "type": "string"
  11205. }
  11206. },
  11207. "urls": {
  11208. "description": "URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)",
  11209. "type": "array",
  11210. "items": {
  11211. "type": "string"
  11212. }
  11213. }
  11214. }
  11215. },
  11216. "watcher": {
  11217. "type": "object",
  11218. "properties": {
  11219. "ignore": {
  11220. "type": "array",
  11221. "items": {
  11222. "type": "string"
  11223. }
  11224. }
  11225. }
  11226. },
  11227. "snapshot": {
  11228. "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.",
  11229. "type": "boolean"
  11230. },
  11231. "plugin": {
  11232. "type": "array",
  11233. "items": {
  11234. "anyOf": [
  11235. {
  11236. "type": "string"
  11237. },
  11238. {
  11239. "type": "array",
  11240. "prefixItems": [
  11241. {
  11242. "type": "string"
  11243. },
  11244. {
  11245. "type": "object",
  11246. "propertyNames": {
  11247. "type": "string"
  11248. },
  11249. "additionalProperties": {}
  11250. }
  11251. ]
  11252. }
  11253. ]
  11254. }
  11255. },
  11256. "share": {
  11257. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  11258. "type": "string",
  11259. "enum": ["manual", "auto", "disabled"]
  11260. },
  11261. "autoshare": {
  11262. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  11263. "type": "boolean"
  11264. },
  11265. "autoupdate": {
  11266. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  11267. "anyOf": [
  11268. {
  11269. "type": "boolean"
  11270. },
  11271. {
  11272. "type": "string",
  11273. "const": "notify"
  11274. }
  11275. ]
  11276. },
  11277. "disabled_providers": {
  11278. "description": "Disable providers that are loaded automatically",
  11279. "type": "array",
  11280. "items": {
  11281. "type": "string"
  11282. }
  11283. },
  11284. "enabled_providers": {
  11285. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  11286. "type": "array",
  11287. "items": {
  11288. "type": "string"
  11289. }
  11290. },
  11291. "model": {
  11292. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  11293. "type": "string"
  11294. },
  11295. "small_model": {
  11296. "description": "Small model to use for tasks like title generation in the format of provider/model",
  11297. "type": "string"
  11298. },
  11299. "default_agent": {
  11300. "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.",
  11301. "type": "string"
  11302. },
  11303. "username": {
  11304. "description": "Custom username to display in conversations instead of system username",
  11305. "type": "string"
  11306. },
  11307. "mode": {
  11308. "description": "@deprecated Use `agent` field instead.",
  11309. "type": "object",
  11310. "properties": {
  11311. "build": {
  11312. "$ref": "#/components/schemas/AgentConfig"
  11313. },
  11314. "plan": {
  11315. "$ref": "#/components/schemas/AgentConfig"
  11316. }
  11317. },
  11318. "additionalProperties": {
  11319. "$ref": "#/components/schemas/AgentConfig"
  11320. }
  11321. },
  11322. "agent": {
  11323. "description": "Agent configuration, see https://opencode.ai/docs/agents",
  11324. "type": "object",
  11325. "properties": {
  11326. "plan": {
  11327. "$ref": "#/components/schemas/AgentConfig"
  11328. },
  11329. "build": {
  11330. "$ref": "#/components/schemas/AgentConfig"
  11331. },
  11332. "general": {
  11333. "$ref": "#/components/schemas/AgentConfig"
  11334. },
  11335. "explore": {
  11336. "$ref": "#/components/schemas/AgentConfig"
  11337. },
  11338. "title": {
  11339. "$ref": "#/components/schemas/AgentConfig"
  11340. },
  11341. "summary": {
  11342. "$ref": "#/components/schemas/AgentConfig"
  11343. },
  11344. "compaction": {
  11345. "$ref": "#/components/schemas/AgentConfig"
  11346. }
  11347. },
  11348. "additionalProperties": {
  11349. "$ref": "#/components/schemas/AgentConfig"
  11350. }
  11351. },
  11352. "provider": {
  11353. "description": "Custom provider configurations and model overrides",
  11354. "type": "object",
  11355. "propertyNames": {
  11356. "type": "string"
  11357. },
  11358. "additionalProperties": {
  11359. "$ref": "#/components/schemas/ProviderConfig"
  11360. }
  11361. },
  11362. "mcp": {
  11363. "description": "MCP (Model Context Protocol) server configurations",
  11364. "type": "object",
  11365. "propertyNames": {
  11366. "type": "string"
  11367. },
  11368. "additionalProperties": {
  11369. "anyOf": [
  11370. {
  11371. "anyOf": [
  11372. {
  11373. "$ref": "#/components/schemas/McpLocalConfig"
  11374. },
  11375. {
  11376. "$ref": "#/components/schemas/McpRemoteConfig"
  11377. }
  11378. ]
  11379. },
  11380. {
  11381. "type": "object",
  11382. "properties": {
  11383. "enabled": {
  11384. "type": "boolean"
  11385. }
  11386. },
  11387. "required": ["enabled"],
  11388. "additionalProperties": false
  11389. }
  11390. ]
  11391. }
  11392. },
  11393. "formatter": {
  11394. "anyOf": [
  11395. {
  11396. "type": "boolean",
  11397. "const": false
  11398. },
  11399. {
  11400. "type": "object",
  11401. "propertyNames": {
  11402. "type": "string"
  11403. },
  11404. "additionalProperties": {
  11405. "type": "object",
  11406. "properties": {
  11407. "disabled": {
  11408. "type": "boolean"
  11409. },
  11410. "command": {
  11411. "type": "array",
  11412. "items": {
  11413. "type": "string"
  11414. }
  11415. },
  11416. "environment": {
  11417. "type": "object",
  11418. "propertyNames": {
  11419. "type": "string"
  11420. },
  11421. "additionalProperties": {
  11422. "type": "string"
  11423. }
  11424. },
  11425. "extensions": {
  11426. "type": "array",
  11427. "items": {
  11428. "type": "string"
  11429. }
  11430. }
  11431. }
  11432. }
  11433. }
  11434. ]
  11435. },
  11436. "lsp": {
  11437. "anyOf": [
  11438. {
  11439. "type": "boolean",
  11440. "const": false
  11441. },
  11442. {
  11443. "type": "object",
  11444. "propertyNames": {
  11445. "type": "string"
  11446. },
  11447. "additionalProperties": {
  11448. "anyOf": [
  11449. {
  11450. "type": "object",
  11451. "properties": {
  11452. "disabled": {
  11453. "type": "boolean",
  11454. "const": true
  11455. }
  11456. },
  11457. "required": ["disabled"]
  11458. },
  11459. {
  11460. "type": "object",
  11461. "properties": {
  11462. "command": {
  11463. "type": "array",
  11464. "items": {
  11465. "type": "string"
  11466. }
  11467. },
  11468. "extensions": {
  11469. "type": "array",
  11470. "items": {
  11471. "type": "string"
  11472. }
  11473. },
  11474. "disabled": {
  11475. "type": "boolean"
  11476. },
  11477. "env": {
  11478. "type": "object",
  11479. "propertyNames": {
  11480. "type": "string"
  11481. },
  11482. "additionalProperties": {
  11483. "type": "string"
  11484. }
  11485. },
  11486. "initialization": {
  11487. "type": "object",
  11488. "propertyNames": {
  11489. "type": "string"
  11490. },
  11491. "additionalProperties": {}
  11492. }
  11493. },
  11494. "required": ["command"]
  11495. }
  11496. ]
  11497. }
  11498. }
  11499. ]
  11500. },
  11501. "instructions": {
  11502. "description": "Additional instruction files or patterns to include",
  11503. "type": "array",
  11504. "items": {
  11505. "type": "string"
  11506. }
  11507. },
  11508. "layout": {
  11509. "$ref": "#/components/schemas/LayoutConfig"
  11510. },
  11511. "permission": {
  11512. "$ref": "#/components/schemas/PermissionConfig"
  11513. },
  11514. "tools": {
  11515. "type": "object",
  11516. "propertyNames": {
  11517. "type": "string"
  11518. },
  11519. "additionalProperties": {
  11520. "type": "boolean"
  11521. }
  11522. },
  11523. "enterprise": {
  11524. "type": "object",
  11525. "properties": {
  11526. "url": {
  11527. "description": "Enterprise URL",
  11528. "type": "string"
  11529. }
  11530. }
  11531. },
  11532. "compaction": {
  11533. "type": "object",
  11534. "properties": {
  11535. "auto": {
  11536. "description": "Enable automatic compaction when context is full (default: true)",
  11537. "type": "boolean"
  11538. },
  11539. "prune": {
  11540. "description": "Enable pruning of old tool outputs (default: true)",
  11541. "type": "boolean"
  11542. },
  11543. "reserved": {
  11544. "description": "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.",
  11545. "type": "integer",
  11546. "minimum": 0,
  11547. "maximum": 9007199254740991
  11548. }
  11549. }
  11550. },
  11551. "experimental": {
  11552. "type": "object",
  11553. "properties": {
  11554. "disable_paste_summary": {
  11555. "type": "boolean"
  11556. },
  11557. "batch_tool": {
  11558. "description": "Enable the batch tool",
  11559. "type": "boolean"
  11560. },
  11561. "openTelemetry": {
  11562. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  11563. "type": "boolean"
  11564. },
  11565. "primary_tools": {
  11566. "description": "Tools that should only be available to primary agents.",
  11567. "type": "array",
  11568. "items": {
  11569. "type": "string"
  11570. }
  11571. },
  11572. "continue_loop_on_deny": {
  11573. "description": "Continue the agent loop when a tool call is denied",
  11574. "type": "boolean"
  11575. },
  11576. "mcp_timeout": {
  11577. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  11578. "type": "integer",
  11579. "exclusiveMinimum": 0,
  11580. "maximum": 9007199254740991
  11581. }
  11582. }
  11583. }
  11584. },
  11585. "additionalProperties": false
  11586. },
  11587. "BadRequestError": {
  11588. "type": "object",
  11589. "properties": {
  11590. "data": {},
  11591. "errors": {
  11592. "type": "array",
  11593. "items": {
  11594. "type": "object",
  11595. "propertyNames": {
  11596. "type": "string"
  11597. },
  11598. "additionalProperties": {}
  11599. }
  11600. },
  11601. "success": {
  11602. "type": "boolean",
  11603. "const": false
  11604. }
  11605. },
  11606. "required": ["data", "errors", "success"]
  11607. },
  11608. "OAuth": {
  11609. "type": "object",
  11610. "properties": {
  11611. "type": {
  11612. "type": "string",
  11613. "const": "oauth"
  11614. },
  11615. "refresh": {
  11616. "type": "string"
  11617. },
  11618. "access": {
  11619. "type": "string"
  11620. },
  11621. "expires": {
  11622. "type": "number"
  11623. },
  11624. "accountId": {
  11625. "type": "string"
  11626. },
  11627. "enterpriseUrl": {
  11628. "type": "string"
  11629. }
  11630. },
  11631. "required": ["type", "refresh", "access", "expires"]
  11632. },
  11633. "ApiAuth": {
  11634. "type": "object",
  11635. "properties": {
  11636. "type": {
  11637. "type": "string",
  11638. "const": "api"
  11639. },
  11640. "key": {
  11641. "type": "string"
  11642. },
  11643. "metadata": {
  11644. "type": "object",
  11645. "propertyNames": {
  11646. "type": "string"
  11647. },
  11648. "additionalProperties": {
  11649. "type": "string"
  11650. }
  11651. }
  11652. },
  11653. "required": ["type", "key"]
  11654. },
  11655. "WellKnownAuth": {
  11656. "type": "object",
  11657. "properties": {
  11658. "type": {
  11659. "type": "string",
  11660. "const": "wellknown"
  11661. },
  11662. "key": {
  11663. "type": "string"
  11664. },
  11665. "token": {
  11666. "type": "string"
  11667. }
  11668. },
  11669. "required": ["type", "key", "token"]
  11670. },
  11671. "Auth": {
  11672. "anyOf": [
  11673. {
  11674. "$ref": "#/components/schemas/OAuth"
  11675. },
  11676. {
  11677. "$ref": "#/components/schemas/ApiAuth"
  11678. },
  11679. {
  11680. "$ref": "#/components/schemas/WellKnownAuth"
  11681. }
  11682. ]
  11683. },
  11684. "NotFoundError": {
  11685. "type": "object",
  11686. "properties": {
  11687. "name": {
  11688. "type": "string",
  11689. "const": "NotFoundError"
  11690. },
  11691. "data": {
  11692. "type": "object",
  11693. "properties": {
  11694. "message": {
  11695. "type": "string"
  11696. }
  11697. },
  11698. "required": ["message"]
  11699. }
  11700. },
  11701. "required": ["name", "data"]
  11702. },
  11703. "Model": {
  11704. "type": "object",
  11705. "properties": {
  11706. "id": {
  11707. "type": "string"
  11708. },
  11709. "providerID": {
  11710. "type": "string"
  11711. },
  11712. "api": {
  11713. "type": "object",
  11714. "properties": {
  11715. "id": {
  11716. "type": "string"
  11717. },
  11718. "url": {
  11719. "type": "string"
  11720. },
  11721. "npm": {
  11722. "type": "string"
  11723. }
  11724. },
  11725. "required": ["id", "url", "npm"]
  11726. },
  11727. "name": {
  11728. "type": "string"
  11729. },
  11730. "family": {
  11731. "type": "string"
  11732. },
  11733. "capabilities": {
  11734. "type": "object",
  11735. "properties": {
  11736. "temperature": {
  11737. "type": "boolean"
  11738. },
  11739. "reasoning": {
  11740. "type": "boolean"
  11741. },
  11742. "attachment": {
  11743. "type": "boolean"
  11744. },
  11745. "toolcall": {
  11746. "type": "boolean"
  11747. },
  11748. "input": {
  11749. "type": "object",
  11750. "properties": {
  11751. "text": {
  11752. "type": "boolean"
  11753. },
  11754. "audio": {
  11755. "type": "boolean"
  11756. },
  11757. "image": {
  11758. "type": "boolean"
  11759. },
  11760. "video": {
  11761. "type": "boolean"
  11762. },
  11763. "pdf": {
  11764. "type": "boolean"
  11765. }
  11766. },
  11767. "required": ["text", "audio", "image", "video", "pdf"]
  11768. },
  11769. "output": {
  11770. "type": "object",
  11771. "properties": {
  11772. "text": {
  11773. "type": "boolean"
  11774. },
  11775. "audio": {
  11776. "type": "boolean"
  11777. },
  11778. "image": {
  11779. "type": "boolean"
  11780. },
  11781. "video": {
  11782. "type": "boolean"
  11783. },
  11784. "pdf": {
  11785. "type": "boolean"
  11786. }
  11787. },
  11788. "required": ["text", "audio", "image", "video", "pdf"]
  11789. },
  11790. "interleaved": {
  11791. "anyOf": [
  11792. {
  11793. "type": "boolean"
  11794. },
  11795. {
  11796. "type": "object",
  11797. "properties": {
  11798. "field": {
  11799. "type": "string",
  11800. "enum": ["reasoning_content", "reasoning_details"]
  11801. }
  11802. },
  11803. "required": ["field"]
  11804. }
  11805. ]
  11806. }
  11807. },
  11808. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  11809. },
  11810. "cost": {
  11811. "type": "object",
  11812. "properties": {
  11813. "input": {
  11814. "type": "number"
  11815. },
  11816. "output": {
  11817. "type": "number"
  11818. },
  11819. "cache": {
  11820. "type": "object",
  11821. "properties": {
  11822. "read": {
  11823. "type": "number"
  11824. },
  11825. "write": {
  11826. "type": "number"
  11827. }
  11828. },
  11829. "required": ["read", "write"]
  11830. },
  11831. "experimentalOver200K": {
  11832. "type": "object",
  11833. "properties": {
  11834. "input": {
  11835. "type": "number"
  11836. },
  11837. "output": {
  11838. "type": "number"
  11839. },
  11840. "cache": {
  11841. "type": "object",
  11842. "properties": {
  11843. "read": {
  11844. "type": "number"
  11845. },
  11846. "write": {
  11847. "type": "number"
  11848. }
  11849. },
  11850. "required": ["read", "write"]
  11851. }
  11852. },
  11853. "required": ["input", "output", "cache"]
  11854. }
  11855. },
  11856. "required": ["input", "output", "cache"]
  11857. },
  11858. "limit": {
  11859. "type": "object",
  11860. "properties": {
  11861. "context": {
  11862. "type": "number"
  11863. },
  11864. "input": {
  11865. "type": "number"
  11866. },
  11867. "output": {
  11868. "type": "number"
  11869. }
  11870. },
  11871. "required": ["context", "output"]
  11872. },
  11873. "status": {
  11874. "type": "string",
  11875. "enum": ["alpha", "beta", "deprecated", "active"]
  11876. },
  11877. "options": {
  11878. "type": "object",
  11879. "propertyNames": {
  11880. "type": "string"
  11881. },
  11882. "additionalProperties": {}
  11883. },
  11884. "headers": {
  11885. "type": "object",
  11886. "propertyNames": {
  11887. "type": "string"
  11888. },
  11889. "additionalProperties": {
  11890. "type": "string"
  11891. }
  11892. },
  11893. "release_date": {
  11894. "type": "string"
  11895. },
  11896. "variants": {
  11897. "type": "object",
  11898. "propertyNames": {
  11899. "type": "string"
  11900. },
  11901. "additionalProperties": {
  11902. "type": "object",
  11903. "propertyNames": {
  11904. "type": "string"
  11905. },
  11906. "additionalProperties": {}
  11907. }
  11908. }
  11909. },
  11910. "required": [
  11911. "id",
  11912. "providerID",
  11913. "api",
  11914. "name",
  11915. "capabilities",
  11916. "cost",
  11917. "limit",
  11918. "status",
  11919. "options",
  11920. "headers",
  11921. "release_date"
  11922. ]
  11923. },
  11924. "Provider": {
  11925. "type": "object",
  11926. "properties": {
  11927. "id": {
  11928. "type": "string"
  11929. },
  11930. "name": {
  11931. "type": "string"
  11932. },
  11933. "source": {
  11934. "type": "string",
  11935. "enum": ["env", "config", "custom", "api"]
  11936. },
  11937. "env": {
  11938. "type": "array",
  11939. "items": {
  11940. "type": "string"
  11941. }
  11942. },
  11943. "key": {
  11944. "type": "string"
  11945. },
  11946. "options": {
  11947. "type": "object",
  11948. "propertyNames": {
  11949. "type": "string"
  11950. },
  11951. "additionalProperties": {}
  11952. },
  11953. "models": {
  11954. "type": "object",
  11955. "propertyNames": {
  11956. "type": "string"
  11957. },
  11958. "additionalProperties": {
  11959. "$ref": "#/components/schemas/Model"
  11960. }
  11961. }
  11962. },
  11963. "required": ["id", "name", "source", "env", "options", "models"]
  11964. },
  11965. "ToolIDs": {
  11966. "type": "array",
  11967. "items": {
  11968. "type": "string"
  11969. }
  11970. },
  11971. "ToolListItem": {
  11972. "type": "object",
  11973. "properties": {
  11974. "id": {
  11975. "type": "string"
  11976. },
  11977. "description": {
  11978. "type": "string"
  11979. },
  11980. "parameters": {}
  11981. },
  11982. "required": ["id", "description", "parameters"]
  11983. },
  11984. "ToolList": {
  11985. "type": "array",
  11986. "items": {
  11987. "$ref": "#/components/schemas/ToolListItem"
  11988. }
  11989. },
  11990. "Workspace": {
  11991. "type": "object",
  11992. "properties": {
  11993. "id": {
  11994. "type": "string",
  11995. "pattern": "^wrk.*"
  11996. },
  11997. "type": {
  11998. "type": "string"
  11999. },
  12000. "name": {
  12001. "type": "string"
  12002. },
  12003. "branch": {
  12004. "anyOf": [
  12005. {
  12006. "type": "string"
  12007. },
  12008. {
  12009. "type": "null"
  12010. }
  12011. ]
  12012. },
  12013. "directory": {
  12014. "anyOf": [
  12015. {
  12016. "type": "string"
  12017. },
  12018. {
  12019. "type": "null"
  12020. }
  12021. ]
  12022. },
  12023. "extra": {
  12024. "anyOf": [
  12025. {},
  12026. {
  12027. "type": "null"
  12028. }
  12029. ]
  12030. },
  12031. "projectID": {
  12032. "type": "string"
  12033. }
  12034. },
  12035. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"]
  12036. },
  12037. "Worktree": {
  12038. "type": "object",
  12039. "properties": {
  12040. "name": {
  12041. "type": "string"
  12042. },
  12043. "branch": {
  12044. "type": "string"
  12045. },
  12046. "directory": {
  12047. "type": "string"
  12048. }
  12049. },
  12050. "required": ["name", "branch", "directory"]
  12051. },
  12052. "WorktreeCreateInput": {
  12053. "type": "object",
  12054. "properties": {
  12055. "name": {
  12056. "type": "string"
  12057. },
  12058. "startCommand": {
  12059. "description": "Additional startup script to run after the project's start command",
  12060. "type": "string"
  12061. }
  12062. }
  12063. },
  12064. "WorktreeRemoveInput": {
  12065. "type": "object",
  12066. "properties": {
  12067. "directory": {
  12068. "type": "string"
  12069. }
  12070. },
  12071. "required": ["directory"]
  12072. },
  12073. "WorktreeResetInput": {
  12074. "type": "object",
  12075. "properties": {
  12076. "directory": {
  12077. "type": "string"
  12078. }
  12079. },
  12080. "required": ["directory"]
  12081. },
  12082. "ProjectSummary": {
  12083. "type": "object",
  12084. "properties": {
  12085. "id": {
  12086. "type": "string"
  12087. },
  12088. "name": {
  12089. "type": "string"
  12090. },
  12091. "worktree": {
  12092. "type": "string"
  12093. }
  12094. },
  12095. "required": ["id", "worktree"]
  12096. },
  12097. "GlobalSession": {
  12098. "type": "object",
  12099. "properties": {
  12100. "id": {
  12101. "type": "string",
  12102. "pattern": "^ses.*"
  12103. },
  12104. "slug": {
  12105. "type": "string"
  12106. },
  12107. "projectID": {
  12108. "type": "string"
  12109. },
  12110. "workspaceID": {
  12111. "type": "string",
  12112. "pattern": "^wrk.*"
  12113. },
  12114. "directory": {
  12115. "type": "string"
  12116. },
  12117. "parentID": {
  12118. "type": "string",
  12119. "pattern": "^ses.*"
  12120. },
  12121. "summary": {
  12122. "type": "object",
  12123. "properties": {
  12124. "additions": {
  12125. "type": "number"
  12126. },
  12127. "deletions": {
  12128. "type": "number"
  12129. },
  12130. "files": {
  12131. "type": "number"
  12132. },
  12133. "diffs": {
  12134. "type": "array",
  12135. "items": {
  12136. "$ref": "#/components/schemas/SnapshotFileDiff"
  12137. }
  12138. }
  12139. },
  12140. "required": ["additions", "deletions", "files"]
  12141. },
  12142. "share": {
  12143. "type": "object",
  12144. "properties": {
  12145. "url": {
  12146. "type": "string"
  12147. }
  12148. },
  12149. "required": ["url"]
  12150. },
  12151. "title": {
  12152. "type": "string"
  12153. },
  12154. "version": {
  12155. "type": "string"
  12156. },
  12157. "time": {
  12158. "type": "object",
  12159. "properties": {
  12160. "created": {
  12161. "type": "number"
  12162. },
  12163. "updated": {
  12164. "type": "number"
  12165. },
  12166. "compacting": {
  12167. "type": "number"
  12168. },
  12169. "archived": {
  12170. "type": "number"
  12171. }
  12172. },
  12173. "required": ["created", "updated"]
  12174. },
  12175. "permission": {
  12176. "$ref": "#/components/schemas/PermissionRuleset"
  12177. },
  12178. "revert": {
  12179. "type": "object",
  12180. "properties": {
  12181. "messageID": {
  12182. "type": "string",
  12183. "pattern": "^msg.*"
  12184. },
  12185. "partID": {
  12186. "type": "string",
  12187. "pattern": "^prt.*"
  12188. },
  12189. "snapshot": {
  12190. "type": "string"
  12191. },
  12192. "diff": {
  12193. "type": "string"
  12194. }
  12195. },
  12196. "required": ["messageID"]
  12197. },
  12198. "project": {
  12199. "anyOf": [
  12200. {
  12201. "$ref": "#/components/schemas/ProjectSummary"
  12202. },
  12203. {
  12204. "type": "null"
  12205. }
  12206. ]
  12207. }
  12208. },
  12209. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"]
  12210. },
  12211. "McpResource": {
  12212. "type": "object",
  12213. "properties": {
  12214. "name": {
  12215. "type": "string"
  12216. },
  12217. "uri": {
  12218. "type": "string"
  12219. },
  12220. "description": {
  12221. "type": "string"
  12222. },
  12223. "mimeType": {
  12224. "type": "string"
  12225. },
  12226. "client": {
  12227. "type": "string"
  12228. }
  12229. },
  12230. "required": ["name", "uri", "client"]
  12231. },
  12232. "TextPartInput": {
  12233. "type": "object",
  12234. "properties": {
  12235. "id": {
  12236. "type": "string",
  12237. "pattern": "^prt.*"
  12238. },
  12239. "type": {
  12240. "type": "string",
  12241. "const": "text"
  12242. },
  12243. "text": {
  12244. "type": "string"
  12245. },
  12246. "synthetic": {
  12247. "type": "boolean"
  12248. },
  12249. "ignored": {
  12250. "type": "boolean"
  12251. },
  12252. "time": {
  12253. "type": "object",
  12254. "properties": {
  12255. "start": {
  12256. "type": "number"
  12257. },
  12258. "end": {
  12259. "type": "number"
  12260. }
  12261. },
  12262. "required": ["start"]
  12263. },
  12264. "metadata": {
  12265. "type": "object",
  12266. "propertyNames": {
  12267. "type": "string"
  12268. },
  12269. "additionalProperties": {}
  12270. }
  12271. },
  12272. "required": ["type", "text"]
  12273. },
  12274. "FilePartInput": {
  12275. "type": "object",
  12276. "properties": {
  12277. "id": {
  12278. "type": "string",
  12279. "pattern": "^prt.*"
  12280. },
  12281. "type": {
  12282. "type": "string",
  12283. "const": "file"
  12284. },
  12285. "mime": {
  12286. "type": "string"
  12287. },
  12288. "filename": {
  12289. "type": "string"
  12290. },
  12291. "url": {
  12292. "type": "string"
  12293. },
  12294. "source": {
  12295. "$ref": "#/components/schemas/FilePartSource"
  12296. }
  12297. },
  12298. "required": ["type", "mime", "url"]
  12299. },
  12300. "AgentPartInput": {
  12301. "type": "object",
  12302. "properties": {
  12303. "id": {
  12304. "type": "string",
  12305. "pattern": "^prt.*"
  12306. },
  12307. "type": {
  12308. "type": "string",
  12309. "const": "agent"
  12310. },
  12311. "name": {
  12312. "type": "string"
  12313. },
  12314. "source": {
  12315. "type": "object",
  12316. "properties": {
  12317. "value": {
  12318. "type": "string"
  12319. },
  12320. "start": {
  12321. "type": "integer",
  12322. "minimum": -9007199254740991,
  12323. "maximum": 9007199254740991
  12324. },
  12325. "end": {
  12326. "type": "integer",
  12327. "minimum": -9007199254740991,
  12328. "maximum": 9007199254740991
  12329. }
  12330. },
  12331. "required": ["value", "start", "end"]
  12332. }
  12333. },
  12334. "required": ["type", "name"]
  12335. },
  12336. "SubtaskPartInput": {
  12337. "type": "object",
  12338. "properties": {
  12339. "id": {
  12340. "type": "string",
  12341. "pattern": "^prt.*"
  12342. },
  12343. "type": {
  12344. "type": "string",
  12345. "const": "subtask"
  12346. },
  12347. "prompt": {
  12348. "type": "string"
  12349. },
  12350. "description": {
  12351. "type": "string"
  12352. },
  12353. "agent": {
  12354. "type": "string"
  12355. },
  12356. "model": {
  12357. "type": "object",
  12358. "properties": {
  12359. "providerID": {
  12360. "type": "string"
  12361. },
  12362. "modelID": {
  12363. "type": "string"
  12364. }
  12365. },
  12366. "required": ["providerID", "modelID"]
  12367. },
  12368. "command": {
  12369. "type": "string"
  12370. }
  12371. },
  12372. "required": ["type", "prompt", "description", "agent"]
  12373. },
  12374. "ProviderAuthMethod": {
  12375. "type": "object",
  12376. "properties": {
  12377. "type": {
  12378. "anyOf": [
  12379. {
  12380. "type": "string",
  12381. "const": "oauth"
  12382. },
  12383. {
  12384. "type": "string",
  12385. "const": "api"
  12386. }
  12387. ]
  12388. },
  12389. "label": {
  12390. "type": "string"
  12391. },
  12392. "prompts": {
  12393. "type": "array",
  12394. "items": {
  12395. "anyOf": [
  12396. {
  12397. "type": "object",
  12398. "properties": {
  12399. "type": {
  12400. "type": "string",
  12401. "const": "text"
  12402. },
  12403. "key": {
  12404. "type": "string"
  12405. },
  12406. "message": {
  12407. "type": "string"
  12408. },
  12409. "placeholder": {
  12410. "type": "string"
  12411. },
  12412. "when": {
  12413. "type": "object",
  12414. "properties": {
  12415. "key": {
  12416. "type": "string"
  12417. },
  12418. "op": {
  12419. "anyOf": [
  12420. {
  12421. "type": "string",
  12422. "const": "eq"
  12423. },
  12424. {
  12425. "type": "string",
  12426. "const": "neq"
  12427. }
  12428. ]
  12429. },
  12430. "value": {
  12431. "type": "string"
  12432. }
  12433. },
  12434. "required": ["key", "op", "value"]
  12435. }
  12436. },
  12437. "required": ["type", "key", "message"]
  12438. },
  12439. {
  12440. "type": "object",
  12441. "properties": {
  12442. "type": {
  12443. "type": "string",
  12444. "const": "select"
  12445. },
  12446. "key": {
  12447. "type": "string"
  12448. },
  12449. "message": {
  12450. "type": "string"
  12451. },
  12452. "options": {
  12453. "type": "array",
  12454. "items": {
  12455. "type": "object",
  12456. "properties": {
  12457. "label": {
  12458. "type": "string"
  12459. },
  12460. "value": {
  12461. "type": "string"
  12462. },
  12463. "hint": {
  12464. "type": "string"
  12465. }
  12466. },
  12467. "required": ["label", "value"]
  12468. }
  12469. },
  12470. "when": {
  12471. "type": "object",
  12472. "properties": {
  12473. "key": {
  12474. "type": "string"
  12475. },
  12476. "op": {
  12477. "anyOf": [
  12478. {
  12479. "type": "string",
  12480. "const": "eq"
  12481. },
  12482. {
  12483. "type": "string",
  12484. "const": "neq"
  12485. }
  12486. ]
  12487. },
  12488. "value": {
  12489. "type": "string"
  12490. }
  12491. },
  12492. "required": ["key", "op", "value"]
  12493. }
  12494. },
  12495. "required": ["type", "key", "message", "options"]
  12496. }
  12497. ]
  12498. }
  12499. }
  12500. },
  12501. "required": ["type", "label"]
  12502. },
  12503. "ProviderAuthAuthorization": {
  12504. "type": "object",
  12505. "properties": {
  12506. "url": {
  12507. "type": "string"
  12508. },
  12509. "method": {
  12510. "anyOf": [
  12511. {
  12512. "type": "string",
  12513. "const": "auto"
  12514. },
  12515. {
  12516. "type": "string",
  12517. "const": "code"
  12518. }
  12519. ]
  12520. },
  12521. "instructions": {
  12522. "type": "string"
  12523. }
  12524. },
  12525. "required": ["url", "method", "instructions"]
  12526. },
  12527. "Symbol": {
  12528. "type": "object",
  12529. "properties": {
  12530. "name": {
  12531. "type": "string"
  12532. },
  12533. "kind": {
  12534. "type": "number"
  12535. },
  12536. "location": {
  12537. "type": "object",
  12538. "properties": {
  12539. "uri": {
  12540. "type": "string"
  12541. },
  12542. "range": {
  12543. "$ref": "#/components/schemas/Range"
  12544. }
  12545. },
  12546. "required": ["uri", "range"]
  12547. }
  12548. },
  12549. "required": ["name", "kind", "location"]
  12550. },
  12551. "FileNode": {
  12552. "type": "object",
  12553. "properties": {
  12554. "name": {
  12555. "type": "string"
  12556. },
  12557. "path": {
  12558. "type": "string"
  12559. },
  12560. "absolute": {
  12561. "type": "string"
  12562. },
  12563. "type": {
  12564. "type": "string",
  12565. "enum": ["file", "directory"]
  12566. },
  12567. "ignored": {
  12568. "type": "boolean"
  12569. }
  12570. },
  12571. "required": ["name", "path", "absolute", "type", "ignored"]
  12572. },
  12573. "FileContent": {
  12574. "type": "object",
  12575. "properties": {
  12576. "type": {
  12577. "type": "string",
  12578. "enum": ["text", "binary"]
  12579. },
  12580. "content": {
  12581. "type": "string"
  12582. },
  12583. "diff": {
  12584. "type": "string"
  12585. },
  12586. "patch": {
  12587. "type": "object",
  12588. "properties": {
  12589. "oldFileName": {
  12590. "type": "string"
  12591. },
  12592. "newFileName": {
  12593. "type": "string"
  12594. },
  12595. "oldHeader": {
  12596. "type": "string"
  12597. },
  12598. "newHeader": {
  12599. "type": "string"
  12600. },
  12601. "hunks": {
  12602. "type": "array",
  12603. "items": {
  12604. "type": "object",
  12605. "properties": {
  12606. "oldStart": {
  12607. "type": "number"
  12608. },
  12609. "oldLines": {
  12610. "type": "number"
  12611. },
  12612. "newStart": {
  12613. "type": "number"
  12614. },
  12615. "newLines": {
  12616. "type": "number"
  12617. },
  12618. "lines": {
  12619. "type": "array",
  12620. "items": {
  12621. "type": "string"
  12622. }
  12623. }
  12624. },
  12625. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  12626. }
  12627. },
  12628. "index": {
  12629. "type": "string"
  12630. }
  12631. },
  12632. "required": ["oldFileName", "newFileName", "hunks"]
  12633. },
  12634. "encoding": {
  12635. "type": "string",
  12636. "const": "base64"
  12637. },
  12638. "mimeType": {
  12639. "type": "string"
  12640. }
  12641. },
  12642. "required": ["type", "content"]
  12643. },
  12644. "File": {
  12645. "type": "object",
  12646. "properties": {
  12647. "path": {
  12648. "type": "string"
  12649. },
  12650. "added": {
  12651. "type": "integer",
  12652. "minimum": -9007199254740991,
  12653. "maximum": 9007199254740991
  12654. },
  12655. "removed": {
  12656. "type": "integer",
  12657. "minimum": -9007199254740991,
  12658. "maximum": 9007199254740991
  12659. },
  12660. "status": {
  12661. "type": "string",
  12662. "enum": ["added", "deleted", "modified"]
  12663. }
  12664. },
  12665. "required": ["path", "added", "removed", "status"]
  12666. },
  12667. "Event": {
  12668. "anyOf": [
  12669. {
  12670. "$ref": "#/components/schemas/Event.project.updated"
  12671. },
  12672. {
  12673. "$ref": "#/components/schemas/Event.server.instance.disposed"
  12674. },
  12675. {
  12676. "$ref": "#/components/schemas/Event.installation.updated"
  12677. },
  12678. {
  12679. "$ref": "#/components/schemas/Event.installation.update-available"
  12680. },
  12681. {
  12682. "$ref": "#/components/schemas/Event.server.connected"
  12683. },
  12684. {
  12685. "$ref": "#/components/schemas/Event.global.disposed"
  12686. },
  12687. {
  12688. "$ref": "#/components/schemas/Event.file.edited"
  12689. },
  12690. {
  12691. "$ref": "#/components/schemas/Event.file.watcher.updated"
  12692. },
  12693. {
  12694. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  12695. },
  12696. {
  12697. "$ref": "#/components/schemas/Event.lsp.updated"
  12698. },
  12699. {
  12700. "$ref": "#/components/schemas/Event.message.part.delta"
  12701. },
  12702. {
  12703. "$ref": "#/components/schemas/Event.permission.asked"
  12704. },
  12705. {
  12706. "$ref": "#/components/schemas/Event.permission.replied"
  12707. },
  12708. {
  12709. "$ref": "#/components/schemas/Event.session.diff"
  12710. },
  12711. {
  12712. "$ref": "#/components/schemas/Event.session.error"
  12713. },
  12714. {
  12715. "$ref": "#/components/schemas/Event.question.asked"
  12716. },
  12717. {
  12718. "$ref": "#/components/schemas/Event.question.replied"
  12719. },
  12720. {
  12721. "$ref": "#/components/schemas/Event.question.rejected"
  12722. },
  12723. {
  12724. "$ref": "#/components/schemas/Event.todo.updated"
  12725. },
  12726. {
  12727. "$ref": "#/components/schemas/Event.session.status"
  12728. },
  12729. {
  12730. "$ref": "#/components/schemas/Event.session.idle"
  12731. },
  12732. {
  12733. "$ref": "#/components/schemas/Event.session.compacted"
  12734. },
  12735. {
  12736. "$ref": "#/components/schemas/Event.tui.prompt.append"
  12737. },
  12738. {
  12739. "$ref": "#/components/schemas/Event.tui.command.execute"
  12740. },
  12741. {
  12742. "$ref": "#/components/schemas/Event.tui.toast.show"
  12743. },
  12744. {
  12745. "$ref": "#/components/schemas/Event.tui.session.select"
  12746. },
  12747. {
  12748. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  12749. },
  12750. {
  12751. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  12752. },
  12753. {
  12754. "$ref": "#/components/schemas/Event.command.executed"
  12755. },
  12756. {
  12757. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  12758. },
  12759. {
  12760. "$ref": "#/components/schemas/Event.worktree.ready"
  12761. },
  12762. {
  12763. "$ref": "#/components/schemas/Event.worktree.failed"
  12764. },
  12765. {
  12766. "$ref": "#/components/schemas/Event.pty.created"
  12767. },
  12768. {
  12769. "$ref": "#/components/schemas/Event.pty.updated"
  12770. },
  12771. {
  12772. "$ref": "#/components/schemas/Event.pty.exited"
  12773. },
  12774. {
  12775. "$ref": "#/components/schemas/Event.pty.deleted"
  12776. },
  12777. {
  12778. "$ref": "#/components/schemas/Event.workspace.ready"
  12779. },
  12780. {
  12781. "$ref": "#/components/schemas/Event.workspace.failed"
  12782. },
  12783. {
  12784. "$ref": "#/components/schemas/Event.workspace.status"
  12785. },
  12786. {
  12787. "$ref": "#/components/schemas/Event.message.updated"
  12788. },
  12789. {
  12790. "$ref": "#/components/schemas/Event.message.removed"
  12791. },
  12792. {
  12793. "$ref": "#/components/schemas/Event.message.part.updated"
  12794. },
  12795. {
  12796. "$ref": "#/components/schemas/Event.message.part.removed"
  12797. },
  12798. {
  12799. "$ref": "#/components/schemas/Event.session.created"
  12800. },
  12801. {
  12802. "$ref": "#/components/schemas/Event.session.updated"
  12803. },
  12804. {
  12805. "$ref": "#/components/schemas/Event.session.deleted"
  12806. }
  12807. ]
  12808. },
  12809. "MCPStatusConnected": {
  12810. "type": "object",
  12811. "properties": {
  12812. "status": {
  12813. "type": "string",
  12814. "const": "connected"
  12815. }
  12816. },
  12817. "required": ["status"]
  12818. },
  12819. "MCPStatusDisabled": {
  12820. "type": "object",
  12821. "properties": {
  12822. "status": {
  12823. "type": "string",
  12824. "const": "disabled"
  12825. }
  12826. },
  12827. "required": ["status"]
  12828. },
  12829. "MCPStatusFailed": {
  12830. "type": "object",
  12831. "properties": {
  12832. "status": {
  12833. "type": "string",
  12834. "const": "failed"
  12835. },
  12836. "error": {
  12837. "type": "string"
  12838. }
  12839. },
  12840. "required": ["status", "error"]
  12841. },
  12842. "MCPStatusNeedsAuth": {
  12843. "type": "object",
  12844. "properties": {
  12845. "status": {
  12846. "type": "string",
  12847. "const": "needs_auth"
  12848. }
  12849. },
  12850. "required": ["status"]
  12851. },
  12852. "MCPStatusNeedsClientRegistration": {
  12853. "type": "object",
  12854. "properties": {
  12855. "status": {
  12856. "type": "string",
  12857. "const": "needs_client_registration"
  12858. },
  12859. "error": {
  12860. "type": "string"
  12861. }
  12862. },
  12863. "required": ["status", "error"]
  12864. },
  12865. "MCPStatus": {
  12866. "anyOf": [
  12867. {
  12868. "$ref": "#/components/schemas/MCPStatusConnected"
  12869. },
  12870. {
  12871. "$ref": "#/components/schemas/MCPStatusDisabled"
  12872. },
  12873. {
  12874. "$ref": "#/components/schemas/MCPStatusFailed"
  12875. },
  12876. {
  12877. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  12878. },
  12879. {
  12880. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  12881. }
  12882. ]
  12883. },
  12884. "Path": {
  12885. "type": "object",
  12886. "properties": {
  12887. "home": {
  12888. "type": "string"
  12889. },
  12890. "state": {
  12891. "type": "string"
  12892. },
  12893. "config": {
  12894. "type": "string"
  12895. },
  12896. "worktree": {
  12897. "type": "string"
  12898. },
  12899. "directory": {
  12900. "type": "string"
  12901. }
  12902. },
  12903. "required": ["home", "state", "config", "worktree", "directory"]
  12904. },
  12905. "VcsInfo": {
  12906. "type": "object",
  12907. "properties": {
  12908. "branch": {
  12909. "type": "string"
  12910. },
  12911. "default_branch": {
  12912. "type": "string"
  12913. }
  12914. }
  12915. },
  12916. "VcsFileDiff": {
  12917. "type": "object",
  12918. "properties": {
  12919. "file": {
  12920. "type": "string"
  12921. },
  12922. "patch": {
  12923. "type": "string"
  12924. },
  12925. "additions": {
  12926. "type": "number"
  12927. },
  12928. "deletions": {
  12929. "type": "number"
  12930. },
  12931. "status": {
  12932. "type": "string",
  12933. "enum": ["added", "deleted", "modified"]
  12934. }
  12935. },
  12936. "required": ["file", "patch", "additions", "deletions"]
  12937. },
  12938. "Command": {
  12939. "type": "object",
  12940. "properties": {
  12941. "name": {
  12942. "type": "string"
  12943. },
  12944. "description": {
  12945. "type": "string"
  12946. },
  12947. "agent": {
  12948. "type": "string"
  12949. },
  12950. "model": {
  12951. "type": "string"
  12952. },
  12953. "source": {
  12954. "type": "string",
  12955. "enum": ["command", "mcp", "skill"]
  12956. },
  12957. "template": {
  12958. "anyOf": [
  12959. {
  12960. "type": "string"
  12961. },
  12962. {
  12963. "type": "string"
  12964. }
  12965. ]
  12966. },
  12967. "subtask": {
  12968. "type": "boolean"
  12969. },
  12970. "hints": {
  12971. "type": "array",
  12972. "items": {
  12973. "type": "string"
  12974. }
  12975. }
  12976. },
  12977. "required": ["name", "template", "hints"]
  12978. },
  12979. "Agent": {
  12980. "type": "object",
  12981. "properties": {
  12982. "name": {
  12983. "type": "string"
  12984. },
  12985. "description": {
  12986. "type": "string"
  12987. },
  12988. "mode": {
  12989. "type": "string",
  12990. "enum": ["subagent", "primary", "all"]
  12991. },
  12992. "native": {
  12993. "type": "boolean"
  12994. },
  12995. "hidden": {
  12996. "type": "boolean"
  12997. },
  12998. "topP": {
  12999. "type": "number"
  13000. },
  13001. "temperature": {
  13002. "type": "number"
  13003. },
  13004. "color": {
  13005. "type": "string"
  13006. },
  13007. "permission": {
  13008. "$ref": "#/components/schemas/PermissionRuleset"
  13009. },
  13010. "model": {
  13011. "type": "object",
  13012. "properties": {
  13013. "modelID": {
  13014. "type": "string"
  13015. },
  13016. "providerID": {
  13017. "type": "string"
  13018. }
  13019. },
  13020. "required": ["modelID", "providerID"]
  13021. },
  13022. "variant": {
  13023. "type": "string"
  13024. },
  13025. "prompt": {
  13026. "type": "string"
  13027. },
  13028. "options": {
  13029. "type": "object",
  13030. "propertyNames": {
  13031. "type": "string"
  13032. },
  13033. "additionalProperties": {}
  13034. },
  13035. "steps": {
  13036. "type": "integer",
  13037. "exclusiveMinimum": 0,
  13038. "maximum": 9007199254740991
  13039. }
  13040. },
  13041. "required": ["name", "mode", "permission", "options"]
  13042. },
  13043. "LSPStatus": {
  13044. "type": "object",
  13045. "properties": {
  13046. "id": {
  13047. "type": "string"
  13048. },
  13049. "name": {
  13050. "type": "string"
  13051. },
  13052. "root": {
  13053. "type": "string"
  13054. },
  13055. "status": {
  13056. "anyOf": [
  13057. {
  13058. "type": "string",
  13059. "const": "connected"
  13060. },
  13061. {
  13062. "type": "string",
  13063. "const": "error"
  13064. }
  13065. ]
  13066. }
  13067. },
  13068. "required": ["id", "name", "root", "status"]
  13069. },
  13070. "FormatterStatus": {
  13071. "type": "object",
  13072. "properties": {
  13073. "name": {
  13074. "type": "string"
  13075. },
  13076. "extensions": {
  13077. "type": "array",
  13078. "items": {
  13079. "type": "string"
  13080. }
  13081. },
  13082. "enabled": {
  13083. "type": "boolean"
  13084. }
  13085. },
  13086. "required": ["name", "extensions", "enabled"]
  13087. }
  13088. }
  13089. }
  13090. }