openapi.json 348 KB

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