openapi.json 352 KB

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