openapi.json 365 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492
  1. {
  2. "openapi": "3.1.1",
  3. "info": {
  4. "title": "opencode",
  5. "description": "opencode api",
  6. "version": "1.0.0"
  7. },
  8. "paths": {
  9. "/global/health": {
  10. "get": {
  11. "operationId": "global.health",
  12. "summary": "Get health",
  13. "description": "Get health information about the OpenCode server.",
  14. "responses": {
  15. "200": {
  16. "description": "Health information",
  17. "content": {
  18. "application/json": {
  19. "schema": {
  20. "type": "object",
  21. "properties": {
  22. "healthy": {
  23. "type": "boolean",
  24. "const": true
  25. },
  26. "version": {
  27. "type": "string"
  28. }
  29. },
  30. "required": ["healthy", "version"]
  31. }
  32. }
  33. }
  34. }
  35. },
  36. "x-codeSamples": [
  37. {
  38. "lang": "js",
  39. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  40. }
  41. ]
  42. }
  43. },
  44. "/global/event": {
  45. "get": {
  46. "operationId": "global.event",
  47. "summary": "Get global events",
  48. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  49. "responses": {
  50. "200": {
  51. "description": "Event stream",
  52. "content": {
  53. "text/event-stream": {
  54. "schema": {
  55. "$ref": "#/components/schemas/GlobalEvent"
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "x-codeSamples": [
  62. {
  63. "lang": "js",
  64. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  65. }
  66. ]
  67. }
  68. },
  69. "/global/config": {
  70. "get": {
  71. "operationId": "global.config.get",
  72. "summary": "Get global configuration",
  73. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  74. "responses": {
  75. "200": {
  76. "description": "Get global config info",
  77. "content": {
  78. "application/json": {
  79. "schema": {
  80. "$ref": "#/components/schemas/Config"
  81. }
  82. }
  83. }
  84. }
  85. },
  86. "x-codeSamples": [
  87. {
  88. "lang": "js",
  89. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  90. }
  91. ]
  92. },
  93. "patch": {
  94. "operationId": "global.config.update",
  95. "summary": "Update global configuration",
  96. "description": "Update global OpenCode configuration settings and preferences.",
  97. "responses": {
  98. "200": {
  99. "description": "Successfully updated global config",
  100. "content": {
  101. "application/json": {
  102. "schema": {
  103. "$ref": "#/components/schemas/Config"
  104. }
  105. }
  106. }
  107. },
  108. "400": {
  109. "description": "Bad request",
  110. "content": {
  111. "application/json": {
  112. "schema": {
  113. "$ref": "#/components/schemas/BadRequestError"
  114. }
  115. }
  116. }
  117. }
  118. },
  119. "requestBody": {
  120. "content": {
  121. "application/json": {
  122. "schema": {
  123. "$ref": "#/components/schemas/Config"
  124. }
  125. }
  126. }
  127. },
  128. "x-codeSamples": [
  129. {
  130. "lang": "js",
  131. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  132. }
  133. ]
  134. }
  135. },
  136. "/global/dispose": {
  137. "post": {
  138. "operationId": "global.dispose",
  139. "summary": "Dispose instance",
  140. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  141. "responses": {
  142. "200": {
  143. "description": "Global disposed",
  144. "content": {
  145. "application/json": {
  146. "schema": {
  147. "type": "boolean"
  148. }
  149. }
  150. }
  151. }
  152. },
  153. "x-codeSamples": [
  154. {
  155. "lang": "js",
  156. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  157. }
  158. ]
  159. }
  160. },
  161. "/global/upgrade": {
  162. "post": {
  163. "operationId": "global.upgrade",
  164. "summary": "Upgrade opencode",
  165. "description": "Upgrade opencode to the specified version or latest if not specified.",
  166. "responses": {
  167. "200": {
  168. "description": "Upgrade result",
  169. "content": {
  170. "application/json": {
  171. "schema": {
  172. "anyOf": [
  173. {
  174. "type": "object",
  175. "properties": {
  176. "success": {
  177. "type": "boolean",
  178. "const": true
  179. },
  180. "version": {
  181. "type": "string"
  182. }
  183. },
  184. "required": ["success", "version"]
  185. },
  186. {
  187. "type": "object",
  188. "properties": {
  189. "success": {
  190. "type": "boolean",
  191. "const": false
  192. },
  193. "error": {
  194. "type": "string"
  195. }
  196. },
  197. "required": ["success", "error"]
  198. }
  199. ]
  200. }
  201. }
  202. }
  203. },
  204. "400": {
  205. "description": "Bad request",
  206. "content": {
  207. "application/json": {
  208. "schema": {
  209. "$ref": "#/components/schemas/BadRequestError"
  210. }
  211. }
  212. }
  213. }
  214. },
  215. "requestBody": {
  216. "content": {
  217. "application/json": {
  218. "schema": {
  219. "type": "object",
  220. "properties": {
  221. "target": {
  222. "type": "string"
  223. }
  224. }
  225. }
  226. }
  227. }
  228. },
  229. "x-codeSamples": [
  230. {
  231. "lang": "js",
  232. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  233. }
  234. ]
  235. }
  236. },
  237. "/auth/{providerID}": {
  238. "put": {
  239. "operationId": "auth.set",
  240. "summary": "Set auth credentials",
  241. "description": "Set authentication credentials",
  242. "responses": {
  243. "200": {
  244. "description": "Successfully set authentication credentials",
  245. "content": {
  246. "application/json": {
  247. "schema": {
  248. "type": "boolean"
  249. }
  250. }
  251. }
  252. },
  253. "400": {
  254. "description": "Bad request",
  255. "content": {
  256. "application/json": {
  257. "schema": {
  258. "$ref": "#/components/schemas/BadRequestError"
  259. }
  260. }
  261. }
  262. }
  263. },
  264. "parameters": [
  265. {
  266. "in": "path",
  267. "name": "providerID",
  268. "schema": {
  269. "type": "string"
  270. },
  271. "required": true
  272. }
  273. ],
  274. "requestBody": {
  275. "content": {
  276. "application/json": {
  277. "schema": {
  278. "$ref": "#/components/schemas/Auth"
  279. }
  280. }
  281. }
  282. },
  283. "x-codeSamples": [
  284. {
  285. "lang": "js",
  286. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  287. }
  288. ]
  289. },
  290. "delete": {
  291. "operationId": "auth.remove",
  292. "summary": "Remove auth credentials",
  293. "description": "Remove authentication credentials",
  294. "responses": {
  295. "200": {
  296. "description": "Successfully removed authentication credentials",
  297. "content": {
  298. "application/json": {
  299. "schema": {
  300. "type": "boolean"
  301. }
  302. }
  303. }
  304. },
  305. "400": {
  306. "description": "Bad request",
  307. "content": {
  308. "application/json": {
  309. "schema": {
  310. "$ref": "#/components/schemas/BadRequestError"
  311. }
  312. }
  313. }
  314. }
  315. },
  316. "parameters": [
  317. {
  318. "in": "path",
  319. "name": "providerID",
  320. "schema": {
  321. "type": "string"
  322. },
  323. "required": true
  324. }
  325. ],
  326. "x-codeSamples": [
  327. {
  328. "lang": "js",
  329. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  330. }
  331. ]
  332. }
  333. },
  334. "/log": {
  335. "post": {
  336. "operationId": "app.log",
  337. "parameters": [
  338. {
  339. "in": "query",
  340. "name": "directory",
  341. "schema": {
  342. "type": "string"
  343. }
  344. },
  345. {
  346. "in": "query",
  347. "name": "workspace",
  348. "schema": {
  349. "type": "string"
  350. }
  351. }
  352. ],
  353. "summary": "Write log",
  354. "description": "Write a log entry to the server logs with specified level and metadata.",
  355. "responses": {
  356. "200": {
  357. "description": "Log entry written successfully",
  358. "content": {
  359. "application/json": {
  360. "schema": {
  361. "type": "boolean"
  362. }
  363. }
  364. }
  365. },
  366. "400": {
  367. "description": "Bad request",
  368. "content": {
  369. "application/json": {
  370. "schema": {
  371. "$ref": "#/components/schemas/BadRequestError"
  372. }
  373. }
  374. }
  375. }
  376. },
  377. "requestBody": {
  378. "content": {
  379. "application/json": {
  380. "schema": {
  381. "type": "object",
  382. "properties": {
  383. "service": {
  384. "description": "Service name for the log entry",
  385. "type": "string"
  386. },
  387. "level": {
  388. "description": "Log level",
  389. "type": "string",
  390. "enum": ["debug", "info", "error", "warn"]
  391. },
  392. "message": {
  393. "description": "Log message",
  394. "type": "string"
  395. },
  396. "extra": {
  397. "description": "Additional metadata for the log entry",
  398. "type": "object",
  399. "propertyNames": {
  400. "type": "string"
  401. },
  402. "additionalProperties": {}
  403. }
  404. },
  405. "required": ["service", "level", "message"]
  406. }
  407. }
  408. }
  409. },
  410. "x-codeSamples": [
  411. {
  412. "lang": "js",
  413. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  414. }
  415. ]
  416. }
  417. },
  418. "/experimental/workspace/adaptor": {
  419. "get": {
  420. "operationId": "experimental.workspace.adaptor.list",
  421. "parameters": [
  422. {
  423. "in": "query",
  424. "name": "directory",
  425. "schema": {
  426. "type": "string"
  427. }
  428. },
  429. {
  430. "in": "query",
  431. "name": "workspace",
  432. "schema": {
  433. "type": "string"
  434. }
  435. }
  436. ],
  437. "summary": "List workspace adaptors",
  438. "description": "List all available workspace adaptors for the current project.",
  439. "responses": {
  440. "200": {
  441. "description": "Workspace adaptors",
  442. "content": {
  443. "application/json": {
  444. "schema": {
  445. "type": "array",
  446. "items": {
  447. "type": "object",
  448. "properties": {
  449. "type": {
  450. "type": "string"
  451. },
  452. "name": {
  453. "type": "string"
  454. },
  455. "description": {
  456. "type": "string"
  457. }
  458. },
  459. "required": ["type", "name", "description"]
  460. }
  461. }
  462. }
  463. }
  464. }
  465. },
  466. "x-codeSamples": [
  467. {
  468. "lang": "js",
  469. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adaptor.list({\n ...\n})"
  470. }
  471. ]
  472. }
  473. },
  474. "/experimental/workspace": {
  475. "post": {
  476. "operationId": "experimental.workspace.create",
  477. "parameters": [
  478. {
  479. "in": "query",
  480. "name": "directory",
  481. "schema": {
  482. "type": "string"
  483. }
  484. },
  485. {
  486. "in": "query",
  487. "name": "workspace",
  488. "schema": {
  489. "type": "string"
  490. }
  491. }
  492. ],
  493. "summary": "Create workspace",
  494. "description": "Create a workspace for the current project.",
  495. "responses": {
  496. "200": {
  497. "description": "Workspace created",
  498. "content": {
  499. "application/json": {
  500. "schema": {
  501. "$ref": "#/components/schemas/Workspace"
  502. }
  503. }
  504. }
  505. },
  506. "400": {
  507. "description": "Bad request",
  508. "content": {
  509. "application/json": {
  510. "schema": {
  511. "$ref": "#/components/schemas/BadRequestError"
  512. }
  513. }
  514. }
  515. }
  516. },
  517. "requestBody": {
  518. "content": {
  519. "application/json": {
  520. "schema": {
  521. "type": "object",
  522. "properties": {
  523. "id": {
  524. "type": "string",
  525. "pattern": "^wrk.*"
  526. },
  527. "type": {
  528. "type": "string"
  529. },
  530. "branch": {
  531. "anyOf": [
  532. {
  533. "type": "string"
  534. },
  535. {
  536. "type": "null"
  537. }
  538. ]
  539. },
  540. "extra": {
  541. "anyOf": [
  542. {},
  543. {
  544. "type": "null"
  545. }
  546. ]
  547. }
  548. },
  549. "required": ["type", "branch", "extra"]
  550. }
  551. }
  552. }
  553. },
  554. "x-codeSamples": [
  555. {
  556. "lang": "js",
  557. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  558. }
  559. ]
  560. },
  561. "get": {
  562. "operationId": "experimental.workspace.list",
  563. "parameters": [
  564. {
  565. "in": "query",
  566. "name": "directory",
  567. "schema": {
  568. "type": "string"
  569. }
  570. },
  571. {
  572. "in": "query",
  573. "name": "workspace",
  574. "schema": {
  575. "type": "string"
  576. }
  577. }
  578. ],
  579. "summary": "List workspaces",
  580. "description": "List all workspaces.",
  581. "responses": {
  582. "200": {
  583. "description": "Workspaces",
  584. "content": {
  585. "application/json": {
  586. "schema": {
  587. "type": "array",
  588. "items": {
  589. "$ref": "#/components/schemas/Workspace"
  590. }
  591. }
  592. }
  593. }
  594. }
  595. },
  596. "x-codeSamples": [
  597. {
  598. "lang": "js",
  599. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  600. }
  601. ]
  602. }
  603. },
  604. "/experimental/workspace/status": {
  605. "get": {
  606. "operationId": "experimental.workspace.status",
  607. "parameters": [
  608. {
  609. "in": "query",
  610. "name": "directory",
  611. "schema": {
  612. "type": "string"
  613. }
  614. },
  615. {
  616. "in": "query",
  617. "name": "workspace",
  618. "schema": {
  619. "type": "string"
  620. }
  621. }
  622. ],
  623. "summary": "Workspace status",
  624. "description": "Get connection status for workspaces in the current project.",
  625. "responses": {
  626. "200": {
  627. "description": "Workspace status",
  628. "content": {
  629. "application/json": {
  630. "schema": {
  631. "type": "array",
  632. "items": {
  633. "type": "object",
  634. "properties": {
  635. "workspaceID": {
  636. "type": "string",
  637. "pattern": "^wrk.*"
  638. },
  639. "status": {
  640. "type": "string",
  641. "enum": ["connected", "connecting", "disconnected", "error"]
  642. }
  643. },
  644. "required": ["workspaceID", "status"]
  645. }
  646. }
  647. }
  648. }
  649. }
  650. },
  651. "x-codeSamples": [
  652. {
  653. "lang": "js",
  654. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  655. }
  656. ]
  657. }
  658. },
  659. "/experimental/workspace/{id}": {
  660. "delete": {
  661. "operationId": "experimental.workspace.remove",
  662. "parameters": [
  663. {
  664. "in": "query",
  665. "name": "directory",
  666. "schema": {
  667. "type": "string"
  668. }
  669. },
  670. {
  671. "in": "query",
  672. "name": "workspace",
  673. "schema": {
  674. "type": "string"
  675. }
  676. },
  677. {
  678. "in": "path",
  679. "name": "id",
  680. "schema": {
  681. "type": "string",
  682. "pattern": "^wrk.*"
  683. },
  684. "required": true
  685. }
  686. ],
  687. "summary": "Remove workspace",
  688. "description": "Remove an existing workspace.",
  689. "responses": {
  690. "200": {
  691. "description": "Workspace removed",
  692. "content": {
  693. "application/json": {
  694. "schema": {
  695. "$ref": "#/components/schemas/Workspace"
  696. }
  697. }
  698. }
  699. },
  700. "400": {
  701. "description": "Bad request",
  702. "content": {
  703. "application/json": {
  704. "schema": {
  705. "$ref": "#/components/schemas/BadRequestError"
  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.experimental.workspace.remove({\n ...\n})"
  715. }
  716. ]
  717. }
  718. },
  719. "/experimental/workspace/{id}/session-restore": {
  720. "post": {
  721. "operationId": "experimental.workspace.sessionRestore",
  722. "parameters": [
  723. {
  724. "in": "query",
  725. "name": "directory",
  726. "schema": {
  727. "type": "string"
  728. }
  729. },
  730. {
  731. "in": "query",
  732. "name": "workspace",
  733. "schema": {
  734. "type": "string"
  735. }
  736. },
  737. {
  738. "in": "path",
  739. "name": "id",
  740. "schema": {
  741. "type": "string",
  742. "pattern": "^wrk.*"
  743. },
  744. "required": true
  745. }
  746. ],
  747. "summary": "Restore session into workspace",
  748. "description": "Replay a session's sync events into the target workspace in batches.",
  749. "responses": {
  750. "200": {
  751. "description": "Session replay started",
  752. "content": {
  753. "application/json": {
  754. "schema": {
  755. "type": "object",
  756. "properties": {
  757. "total": {
  758. "type": "integer",
  759. "minimum": 0,
  760. "maximum": 9007199254740991
  761. }
  762. },
  763. "required": ["total"]
  764. }
  765. }
  766. }
  767. },
  768. "400": {
  769. "description": "Bad request",
  770. "content": {
  771. "application/json": {
  772. "schema": {
  773. "$ref": "#/components/schemas/BadRequestError"
  774. }
  775. }
  776. }
  777. }
  778. },
  779. "requestBody": {
  780. "content": {
  781. "application/json": {
  782. "schema": {
  783. "type": "object",
  784. "properties": {
  785. "sessionID": {
  786. "type": "string",
  787. "pattern": "^ses.*"
  788. }
  789. },
  790. "required": ["sessionID"]
  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.experimental.workspace.sessionRestore({\n ...\n})"
  799. }
  800. ]
  801. }
  802. },
  803. "/project": {
  804. "get": {
  805. "operationId": "project.list",
  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. "summary": "List all projects",
  823. "description": "Get a list of projects that have been opened with OpenCode.",
  824. "responses": {
  825. "200": {
  826. "description": "List of projects",
  827. "content": {
  828. "application/json": {
  829. "schema": {
  830. "type": "array",
  831. "items": {
  832. "$ref": "#/components/schemas/Project"
  833. }
  834. }
  835. }
  836. }
  837. }
  838. },
  839. "x-codeSamples": [
  840. {
  841. "lang": "js",
  842. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  843. }
  844. ]
  845. }
  846. },
  847. "/project/current": {
  848. "get": {
  849. "operationId": "project.current",
  850. "parameters": [
  851. {
  852. "in": "query",
  853. "name": "directory",
  854. "schema": {
  855. "type": "string"
  856. }
  857. },
  858. {
  859. "in": "query",
  860. "name": "workspace",
  861. "schema": {
  862. "type": "string"
  863. }
  864. }
  865. ],
  866. "summary": "Get current project",
  867. "description": "Retrieve the currently active project that OpenCode is working with.",
  868. "responses": {
  869. "200": {
  870. "description": "Current project information",
  871. "content": {
  872. "application/json": {
  873. "schema": {
  874. "$ref": "#/components/schemas/Project"
  875. }
  876. }
  877. }
  878. }
  879. },
  880. "x-codeSamples": [
  881. {
  882. "lang": "js",
  883. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  884. }
  885. ]
  886. }
  887. },
  888. "/project/git/init": {
  889. "post": {
  890. "operationId": "project.initGit",
  891. "parameters": [
  892. {
  893. "in": "query",
  894. "name": "directory",
  895. "schema": {
  896. "type": "string"
  897. }
  898. },
  899. {
  900. "in": "query",
  901. "name": "workspace",
  902. "schema": {
  903. "type": "string"
  904. }
  905. }
  906. ],
  907. "summary": "Initialize git repository",
  908. "description": "Create a git repository for the current project and return the refreshed project info.",
  909. "responses": {
  910. "200": {
  911. "description": "Project information after git initialization",
  912. "content": {
  913. "application/json": {
  914. "schema": {
  915. "$ref": "#/components/schemas/Project"
  916. }
  917. }
  918. }
  919. }
  920. },
  921. "x-codeSamples": [
  922. {
  923. "lang": "js",
  924. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  925. }
  926. ]
  927. }
  928. },
  929. "/project/{projectID}": {
  930. "patch": {
  931. "operationId": "project.update",
  932. "parameters": [
  933. {
  934. "in": "query",
  935. "name": "directory",
  936. "schema": {
  937. "type": "string"
  938. }
  939. },
  940. {
  941. "in": "query",
  942. "name": "workspace",
  943. "schema": {
  944. "type": "string"
  945. }
  946. },
  947. {
  948. "in": "path",
  949. "name": "projectID",
  950. "schema": {
  951. "type": "string"
  952. },
  953. "required": true
  954. }
  955. ],
  956. "summary": "Update project",
  957. "description": "Update project properties such as name, icon, and commands.",
  958. "responses": {
  959. "200": {
  960. "description": "Updated project information",
  961. "content": {
  962. "application/json": {
  963. "schema": {
  964. "$ref": "#/components/schemas/Project"
  965. }
  966. }
  967. }
  968. },
  969. "400": {
  970. "description": "Bad request",
  971. "content": {
  972. "application/json": {
  973. "schema": {
  974. "$ref": "#/components/schemas/BadRequestError"
  975. }
  976. }
  977. }
  978. },
  979. "404": {
  980. "description": "Not found",
  981. "content": {
  982. "application/json": {
  983. "schema": {
  984. "$ref": "#/components/schemas/NotFoundError"
  985. }
  986. }
  987. }
  988. }
  989. },
  990. "requestBody": {
  991. "content": {
  992. "application/json": {
  993. "schema": {
  994. "type": "object",
  995. "properties": {
  996. "name": {
  997. "type": "string"
  998. },
  999. "icon": {
  1000. "type": "object",
  1001. "properties": {
  1002. "url": {
  1003. "type": "string"
  1004. },
  1005. "override": {
  1006. "type": "string"
  1007. },
  1008. "color": {
  1009. "type": "string"
  1010. }
  1011. }
  1012. },
  1013. "commands": {
  1014. "type": "object",
  1015. "properties": {
  1016. "start": {
  1017. "description": "Startup script to run when creating a new workspace (worktree)",
  1018. "type": "string"
  1019. }
  1020. }
  1021. }
  1022. }
  1023. }
  1024. }
  1025. }
  1026. },
  1027. "x-codeSamples": [
  1028. {
  1029. "lang": "js",
  1030. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  1031. }
  1032. ]
  1033. }
  1034. },
  1035. "/pty/shells": {
  1036. "get": {
  1037. "operationId": "pty.shells",
  1038. "parameters": [
  1039. {
  1040. "in": "query",
  1041. "name": "directory",
  1042. "schema": {
  1043. "type": "string"
  1044. }
  1045. },
  1046. {
  1047. "in": "query",
  1048. "name": "workspace",
  1049. "schema": {
  1050. "type": "string"
  1051. }
  1052. }
  1053. ],
  1054. "summary": "List available shells",
  1055. "description": "Get a list of available shells on the system.",
  1056. "responses": {
  1057. "200": {
  1058. "description": "List of shells",
  1059. "content": {
  1060. "application/json": {
  1061. "schema": {
  1062. "type": "array",
  1063. "items": {
  1064. "type": "object",
  1065. "properties": {
  1066. "path": {
  1067. "type": "string"
  1068. },
  1069. "name": {
  1070. "type": "string"
  1071. },
  1072. "acceptable": {
  1073. "type": "boolean"
  1074. }
  1075. },
  1076. "required": ["path", "name", "acceptable"]
  1077. }
  1078. }
  1079. }
  1080. }
  1081. }
  1082. },
  1083. "x-codeSamples": [
  1084. {
  1085. "lang": "js",
  1086. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n ...\n})"
  1087. }
  1088. ]
  1089. }
  1090. },
  1091. "/pty": {
  1092. "get": {
  1093. "operationId": "pty.list",
  1094. "parameters": [
  1095. {
  1096. "in": "query",
  1097. "name": "directory",
  1098. "schema": {
  1099. "type": "string"
  1100. }
  1101. },
  1102. {
  1103. "in": "query",
  1104. "name": "workspace",
  1105. "schema": {
  1106. "type": "string"
  1107. }
  1108. }
  1109. ],
  1110. "summary": "List PTY sessions",
  1111. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  1112. "responses": {
  1113. "200": {
  1114. "description": "List of sessions",
  1115. "content": {
  1116. "application/json": {
  1117. "schema": {
  1118. "type": "array",
  1119. "items": {
  1120. "$ref": "#/components/schemas/Pty"
  1121. }
  1122. }
  1123. }
  1124. }
  1125. }
  1126. },
  1127. "x-codeSamples": [
  1128. {
  1129. "lang": "js",
  1130. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  1131. }
  1132. ]
  1133. },
  1134. "post": {
  1135. "operationId": "pty.create",
  1136. "parameters": [
  1137. {
  1138. "in": "query",
  1139. "name": "directory",
  1140. "schema": {
  1141. "type": "string"
  1142. }
  1143. },
  1144. {
  1145. "in": "query",
  1146. "name": "workspace",
  1147. "schema": {
  1148. "type": "string"
  1149. }
  1150. }
  1151. ],
  1152. "summary": "Create PTY session",
  1153. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  1154. "responses": {
  1155. "200": {
  1156. "description": "Created session",
  1157. "content": {
  1158. "application/json": {
  1159. "schema": {
  1160. "$ref": "#/components/schemas/Pty"
  1161. }
  1162. }
  1163. }
  1164. },
  1165. "400": {
  1166. "description": "Bad request",
  1167. "content": {
  1168. "application/json": {
  1169. "schema": {
  1170. "$ref": "#/components/schemas/BadRequestError"
  1171. }
  1172. }
  1173. }
  1174. }
  1175. },
  1176. "requestBody": {
  1177. "content": {
  1178. "application/json": {
  1179. "schema": {
  1180. "type": "object",
  1181. "properties": {
  1182. "command": {
  1183. "type": "string"
  1184. },
  1185. "args": {
  1186. "type": "array",
  1187. "items": {
  1188. "type": "string"
  1189. }
  1190. },
  1191. "cwd": {
  1192. "type": "string"
  1193. },
  1194. "title": {
  1195. "type": "string"
  1196. },
  1197. "env": {
  1198. "type": "object",
  1199. "propertyNames": {
  1200. "type": "string"
  1201. },
  1202. "additionalProperties": {
  1203. "type": "string"
  1204. }
  1205. }
  1206. }
  1207. }
  1208. }
  1209. }
  1210. },
  1211. "x-codeSamples": [
  1212. {
  1213. "lang": "js",
  1214. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  1215. }
  1216. ]
  1217. }
  1218. },
  1219. "/pty/{ptyID}": {
  1220. "get": {
  1221. "operationId": "pty.get",
  1222. "parameters": [
  1223. {
  1224. "in": "query",
  1225. "name": "directory",
  1226. "schema": {
  1227. "type": "string"
  1228. }
  1229. },
  1230. {
  1231. "in": "query",
  1232. "name": "workspace",
  1233. "schema": {
  1234. "type": "string"
  1235. }
  1236. },
  1237. {
  1238. "in": "path",
  1239. "name": "ptyID",
  1240. "schema": {
  1241. "type": "string",
  1242. "pattern": "^pty.*"
  1243. },
  1244. "required": true
  1245. }
  1246. ],
  1247. "summary": "Get PTY session",
  1248. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  1249. "responses": {
  1250. "200": {
  1251. "description": "Session info",
  1252. "content": {
  1253. "application/json": {
  1254. "schema": {
  1255. "$ref": "#/components/schemas/Pty"
  1256. }
  1257. }
  1258. }
  1259. },
  1260. "404": {
  1261. "description": "Not found",
  1262. "content": {
  1263. "application/json": {
  1264. "schema": {
  1265. "$ref": "#/components/schemas/NotFoundError"
  1266. }
  1267. }
  1268. }
  1269. }
  1270. },
  1271. "x-codeSamples": [
  1272. {
  1273. "lang": "js",
  1274. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  1275. }
  1276. ]
  1277. },
  1278. "put": {
  1279. "operationId": "pty.update",
  1280. "parameters": [
  1281. {
  1282. "in": "query",
  1283. "name": "directory",
  1284. "schema": {
  1285. "type": "string"
  1286. }
  1287. },
  1288. {
  1289. "in": "query",
  1290. "name": "workspace",
  1291. "schema": {
  1292. "type": "string"
  1293. }
  1294. },
  1295. {
  1296. "in": "path",
  1297. "name": "ptyID",
  1298. "schema": {
  1299. "type": "string",
  1300. "pattern": "^pty.*"
  1301. },
  1302. "required": true
  1303. }
  1304. ],
  1305. "summary": "Update PTY session",
  1306. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  1307. "responses": {
  1308. "200": {
  1309. "description": "Updated session",
  1310. "content": {
  1311. "application/json": {
  1312. "schema": {
  1313. "$ref": "#/components/schemas/Pty"
  1314. }
  1315. }
  1316. }
  1317. },
  1318. "400": {
  1319. "description": "Bad request",
  1320. "content": {
  1321. "application/json": {
  1322. "schema": {
  1323. "$ref": "#/components/schemas/BadRequestError"
  1324. }
  1325. }
  1326. }
  1327. }
  1328. },
  1329. "requestBody": {
  1330. "content": {
  1331. "application/json": {
  1332. "schema": {
  1333. "type": "object",
  1334. "properties": {
  1335. "title": {
  1336. "type": "string"
  1337. },
  1338. "size": {
  1339. "type": "object",
  1340. "properties": {
  1341. "rows": {
  1342. "type": "number"
  1343. },
  1344. "cols": {
  1345. "type": "number"
  1346. }
  1347. },
  1348. "required": ["rows", "cols"]
  1349. }
  1350. }
  1351. }
  1352. }
  1353. }
  1354. },
  1355. "x-codeSamples": [
  1356. {
  1357. "lang": "js",
  1358. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  1359. }
  1360. ]
  1361. },
  1362. "delete": {
  1363. "operationId": "pty.remove",
  1364. "parameters": [
  1365. {
  1366. "in": "query",
  1367. "name": "directory",
  1368. "schema": {
  1369. "type": "string"
  1370. }
  1371. },
  1372. {
  1373. "in": "query",
  1374. "name": "workspace",
  1375. "schema": {
  1376. "type": "string"
  1377. }
  1378. },
  1379. {
  1380. "in": "path",
  1381. "name": "ptyID",
  1382. "schema": {
  1383. "type": "string",
  1384. "pattern": "^pty.*"
  1385. },
  1386. "required": true
  1387. }
  1388. ],
  1389. "summary": "Remove PTY session",
  1390. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  1391. "responses": {
  1392. "200": {
  1393. "description": "Session removed",
  1394. "content": {
  1395. "application/json": {
  1396. "schema": {
  1397. "type": "boolean"
  1398. }
  1399. }
  1400. }
  1401. },
  1402. "404": {
  1403. "description": "Not found",
  1404. "content": {
  1405. "application/json": {
  1406. "schema": {
  1407. "$ref": "#/components/schemas/NotFoundError"
  1408. }
  1409. }
  1410. }
  1411. }
  1412. },
  1413. "x-codeSamples": [
  1414. {
  1415. "lang": "js",
  1416. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  1417. }
  1418. ]
  1419. }
  1420. },
  1421. "/pty/{ptyID}/connect": {
  1422. "get": {
  1423. "operationId": "pty.connect",
  1424. "parameters": [
  1425. {
  1426. "in": "query",
  1427. "name": "directory",
  1428. "schema": {
  1429. "type": "string"
  1430. }
  1431. },
  1432. {
  1433. "in": "query",
  1434. "name": "workspace",
  1435. "schema": {
  1436. "type": "string"
  1437. }
  1438. },
  1439. {
  1440. "in": "path",
  1441. "name": "ptyID",
  1442. "schema": {
  1443. "type": "string",
  1444. "pattern": "^pty.*"
  1445. },
  1446. "required": true
  1447. }
  1448. ],
  1449. "summary": "Connect to PTY session",
  1450. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  1451. "responses": {
  1452. "200": {
  1453. "description": "Connected session",
  1454. "content": {
  1455. "application/json": {
  1456. "schema": {
  1457. "type": "boolean"
  1458. }
  1459. }
  1460. }
  1461. },
  1462. "404": {
  1463. "description": "Not found",
  1464. "content": {
  1465. "application/json": {
  1466. "schema": {
  1467. "$ref": "#/components/schemas/NotFoundError"
  1468. }
  1469. }
  1470. }
  1471. }
  1472. },
  1473. "x-codeSamples": [
  1474. {
  1475. "lang": "js",
  1476. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  1477. }
  1478. ]
  1479. }
  1480. },
  1481. "/config": {
  1482. "get": {
  1483. "operationId": "config.get",
  1484. "parameters": [
  1485. {
  1486. "in": "query",
  1487. "name": "directory",
  1488. "schema": {
  1489. "type": "string"
  1490. }
  1491. },
  1492. {
  1493. "in": "query",
  1494. "name": "workspace",
  1495. "schema": {
  1496. "type": "string"
  1497. }
  1498. }
  1499. ],
  1500. "summary": "Get configuration",
  1501. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  1502. "responses": {
  1503. "200": {
  1504. "description": "Get config info",
  1505. "content": {
  1506. "application/json": {
  1507. "schema": {
  1508. "$ref": "#/components/schemas/Config"
  1509. }
  1510. }
  1511. }
  1512. }
  1513. },
  1514. "x-codeSamples": [
  1515. {
  1516. "lang": "js",
  1517. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  1518. }
  1519. ]
  1520. },
  1521. "patch": {
  1522. "operationId": "config.update",
  1523. "parameters": [
  1524. {
  1525. "in": "query",
  1526. "name": "directory",
  1527. "schema": {
  1528. "type": "string"
  1529. }
  1530. },
  1531. {
  1532. "in": "query",
  1533. "name": "workspace",
  1534. "schema": {
  1535. "type": "string"
  1536. }
  1537. }
  1538. ],
  1539. "summary": "Update configuration",
  1540. "description": "Update OpenCode configuration settings and preferences.",
  1541. "responses": {
  1542. "200": {
  1543. "description": "Successfully updated config",
  1544. "content": {
  1545. "application/json": {
  1546. "schema": {
  1547. "$ref": "#/components/schemas/Config"
  1548. }
  1549. }
  1550. }
  1551. },
  1552. "400": {
  1553. "description": "Bad request",
  1554. "content": {
  1555. "application/json": {
  1556. "schema": {
  1557. "$ref": "#/components/schemas/BadRequestError"
  1558. }
  1559. }
  1560. }
  1561. }
  1562. },
  1563. "requestBody": {
  1564. "content": {
  1565. "application/json": {
  1566. "schema": {
  1567. "$ref": "#/components/schemas/Config"
  1568. }
  1569. }
  1570. }
  1571. },
  1572. "x-codeSamples": [
  1573. {
  1574. "lang": "js",
  1575. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  1576. }
  1577. ]
  1578. }
  1579. },
  1580. "/config/providers": {
  1581. "get": {
  1582. "operationId": "config.providers",
  1583. "parameters": [
  1584. {
  1585. "in": "query",
  1586. "name": "directory",
  1587. "schema": {
  1588. "type": "string"
  1589. }
  1590. },
  1591. {
  1592. "in": "query",
  1593. "name": "workspace",
  1594. "schema": {
  1595. "type": "string"
  1596. }
  1597. }
  1598. ],
  1599. "summary": "List config providers",
  1600. "description": "Get a list of all configured AI providers and their default models.",
  1601. "responses": {
  1602. "200": {
  1603. "description": "List of providers",
  1604. "content": {
  1605. "application/json": {
  1606. "schema": {
  1607. "type": "object",
  1608. "properties": {
  1609. "providers": {
  1610. "type": "array",
  1611. "items": {
  1612. "$ref": "#/components/schemas/Provider"
  1613. }
  1614. },
  1615. "default": {
  1616. "type": "object",
  1617. "propertyNames": {
  1618. "type": "string"
  1619. },
  1620. "additionalProperties": {
  1621. "type": "string"
  1622. }
  1623. }
  1624. },
  1625. "required": ["providers", "default"]
  1626. }
  1627. }
  1628. }
  1629. }
  1630. },
  1631. "x-codeSamples": [
  1632. {
  1633. "lang": "js",
  1634. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  1635. }
  1636. ]
  1637. }
  1638. },
  1639. "/experimental/console": {
  1640. "get": {
  1641. "operationId": "experimental.console.get",
  1642. "parameters": [
  1643. {
  1644. "in": "query",
  1645. "name": "directory",
  1646. "schema": {
  1647. "type": "string"
  1648. }
  1649. },
  1650. {
  1651. "in": "query",
  1652. "name": "workspace",
  1653. "schema": {
  1654. "type": "string"
  1655. }
  1656. }
  1657. ],
  1658. "summary": "Get active Console provider metadata",
  1659. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  1660. "responses": {
  1661. "200": {
  1662. "description": "Active Console provider metadata",
  1663. "content": {
  1664. "application/json": {
  1665. "schema": {
  1666. "$ref": "#/components/schemas/ConsoleState"
  1667. }
  1668. }
  1669. }
  1670. }
  1671. },
  1672. "x-codeSamples": [
  1673. {
  1674. "lang": "js",
  1675. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  1676. }
  1677. ]
  1678. }
  1679. },
  1680. "/experimental/console/orgs": {
  1681. "get": {
  1682. "operationId": "experimental.console.listOrgs",
  1683. "parameters": [
  1684. {
  1685. "in": "query",
  1686. "name": "directory",
  1687. "schema": {
  1688. "type": "string"
  1689. }
  1690. },
  1691. {
  1692. "in": "query",
  1693. "name": "workspace",
  1694. "schema": {
  1695. "type": "string"
  1696. }
  1697. }
  1698. ],
  1699. "summary": "List switchable Console orgs",
  1700. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  1701. "responses": {
  1702. "200": {
  1703. "description": "Switchable Console orgs",
  1704. "content": {
  1705. "application/json": {
  1706. "schema": {
  1707. "type": "object",
  1708. "properties": {
  1709. "orgs": {
  1710. "type": "array",
  1711. "items": {
  1712. "type": "object",
  1713. "properties": {
  1714. "accountID": {
  1715. "type": "string"
  1716. },
  1717. "accountEmail": {
  1718. "type": "string"
  1719. },
  1720. "accountUrl": {
  1721. "type": "string"
  1722. },
  1723. "orgID": {
  1724. "type": "string"
  1725. },
  1726. "orgName": {
  1727. "type": "string"
  1728. },
  1729. "active": {
  1730. "type": "boolean"
  1731. }
  1732. },
  1733. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"]
  1734. }
  1735. }
  1736. },
  1737. "required": ["orgs"]
  1738. }
  1739. }
  1740. }
  1741. }
  1742. },
  1743. "x-codeSamples": [
  1744. {
  1745. "lang": "js",
  1746. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  1747. }
  1748. ]
  1749. }
  1750. },
  1751. "/experimental/console/switch": {
  1752. "post": {
  1753. "operationId": "experimental.console.switchOrg",
  1754. "parameters": [
  1755. {
  1756. "in": "query",
  1757. "name": "directory",
  1758. "schema": {
  1759. "type": "string"
  1760. }
  1761. },
  1762. {
  1763. "in": "query",
  1764. "name": "workspace",
  1765. "schema": {
  1766. "type": "string"
  1767. }
  1768. }
  1769. ],
  1770. "summary": "Switch active Console org",
  1771. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  1772. "responses": {
  1773. "200": {
  1774. "description": "Switch success",
  1775. "content": {
  1776. "application/json": {
  1777. "schema": {
  1778. "type": "boolean"
  1779. }
  1780. }
  1781. }
  1782. }
  1783. },
  1784. "requestBody": {
  1785. "content": {
  1786. "application/json": {
  1787. "schema": {
  1788. "type": "object",
  1789. "properties": {
  1790. "accountID": {
  1791. "type": "string"
  1792. },
  1793. "orgID": {
  1794. "type": "string"
  1795. }
  1796. },
  1797. "required": ["accountID", "orgID"]
  1798. }
  1799. }
  1800. }
  1801. },
  1802. "x-codeSamples": [
  1803. {
  1804. "lang": "js",
  1805. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  1806. }
  1807. ]
  1808. }
  1809. },
  1810. "/experimental/tool/ids": {
  1811. "get": {
  1812. "operationId": "tool.ids",
  1813. "parameters": [
  1814. {
  1815. "in": "query",
  1816. "name": "directory",
  1817. "schema": {
  1818. "type": "string"
  1819. }
  1820. },
  1821. {
  1822. "in": "query",
  1823. "name": "workspace",
  1824. "schema": {
  1825. "type": "string"
  1826. }
  1827. }
  1828. ],
  1829. "summary": "List tool IDs",
  1830. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  1831. "responses": {
  1832. "200": {
  1833. "description": "Tool IDs",
  1834. "content": {
  1835. "application/json": {
  1836. "schema": {
  1837. "$ref": "#/components/schemas/ToolIDs"
  1838. }
  1839. }
  1840. }
  1841. },
  1842. "400": {
  1843. "description": "Bad request",
  1844. "content": {
  1845. "application/json": {
  1846. "schema": {
  1847. "$ref": "#/components/schemas/BadRequestError"
  1848. }
  1849. }
  1850. }
  1851. }
  1852. },
  1853. "x-codeSamples": [
  1854. {
  1855. "lang": "js",
  1856. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  1857. }
  1858. ]
  1859. }
  1860. },
  1861. "/experimental/tool": {
  1862. "get": {
  1863. "operationId": "tool.list",
  1864. "parameters": [
  1865. {
  1866. "in": "query",
  1867. "name": "directory",
  1868. "schema": {
  1869. "type": "string"
  1870. }
  1871. },
  1872. {
  1873. "in": "query",
  1874. "name": "workspace",
  1875. "schema": {
  1876. "type": "string"
  1877. }
  1878. },
  1879. {
  1880. "in": "query",
  1881. "name": "provider",
  1882. "schema": {
  1883. "type": "string"
  1884. },
  1885. "required": true
  1886. },
  1887. {
  1888. "in": "query",
  1889. "name": "model",
  1890. "schema": {
  1891. "type": "string"
  1892. },
  1893. "required": true
  1894. }
  1895. ],
  1896. "summary": "List tools",
  1897. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  1898. "responses": {
  1899. "200": {
  1900. "description": "Tools",
  1901. "content": {
  1902. "application/json": {
  1903. "schema": {
  1904. "$ref": "#/components/schemas/ToolList"
  1905. }
  1906. }
  1907. }
  1908. },
  1909. "400": {
  1910. "description": "Bad request",
  1911. "content": {
  1912. "application/json": {
  1913. "schema": {
  1914. "$ref": "#/components/schemas/BadRequestError"
  1915. }
  1916. }
  1917. }
  1918. }
  1919. },
  1920. "x-codeSamples": [
  1921. {
  1922. "lang": "js",
  1923. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  1924. }
  1925. ]
  1926. }
  1927. },
  1928. "/experimental/worktree": {
  1929. "post": {
  1930. "operationId": "worktree.create",
  1931. "parameters": [
  1932. {
  1933. "in": "query",
  1934. "name": "directory",
  1935. "schema": {
  1936. "type": "string"
  1937. }
  1938. },
  1939. {
  1940. "in": "query",
  1941. "name": "workspace",
  1942. "schema": {
  1943. "type": "string"
  1944. }
  1945. }
  1946. ],
  1947. "summary": "Create worktree",
  1948. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1949. "responses": {
  1950. "200": {
  1951. "description": "Worktree created",
  1952. "content": {
  1953. "application/json": {
  1954. "schema": {
  1955. "$ref": "#/components/schemas/Worktree"
  1956. }
  1957. }
  1958. }
  1959. },
  1960. "400": {
  1961. "description": "Bad request",
  1962. "content": {
  1963. "application/json": {
  1964. "schema": {
  1965. "$ref": "#/components/schemas/BadRequestError"
  1966. }
  1967. }
  1968. }
  1969. }
  1970. },
  1971. "requestBody": {
  1972. "content": {
  1973. "application/json": {
  1974. "schema": {
  1975. "$ref": "#/components/schemas/WorktreeCreateInput"
  1976. }
  1977. }
  1978. }
  1979. },
  1980. "x-codeSamples": [
  1981. {
  1982. "lang": "js",
  1983. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1984. }
  1985. ]
  1986. },
  1987. "get": {
  1988. "operationId": "worktree.list",
  1989. "parameters": [
  1990. {
  1991. "in": "query",
  1992. "name": "directory",
  1993. "schema": {
  1994. "type": "string"
  1995. }
  1996. },
  1997. {
  1998. "in": "query",
  1999. "name": "workspace",
  2000. "schema": {
  2001. "type": "string"
  2002. }
  2003. }
  2004. ],
  2005. "summary": "List worktrees",
  2006. "description": "List all sandbox worktrees for the current project.",
  2007. "responses": {
  2008. "200": {
  2009. "description": "List of worktree directories",
  2010. "content": {
  2011. "application/json": {
  2012. "schema": {
  2013. "type": "array",
  2014. "items": {
  2015. "type": "string"
  2016. }
  2017. }
  2018. }
  2019. }
  2020. }
  2021. },
  2022. "x-codeSamples": [
  2023. {
  2024. "lang": "js",
  2025. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  2026. }
  2027. ]
  2028. },
  2029. "delete": {
  2030. "operationId": "worktree.remove",
  2031. "parameters": [
  2032. {
  2033. "in": "query",
  2034. "name": "directory",
  2035. "schema": {
  2036. "type": "string"
  2037. }
  2038. },
  2039. {
  2040. "in": "query",
  2041. "name": "workspace",
  2042. "schema": {
  2043. "type": "string"
  2044. }
  2045. }
  2046. ],
  2047. "summary": "Remove worktree",
  2048. "description": "Remove a git worktree and delete its branch.",
  2049. "responses": {
  2050. "200": {
  2051. "description": "Worktree removed",
  2052. "content": {
  2053. "application/json": {
  2054. "schema": {
  2055. "type": "boolean"
  2056. }
  2057. }
  2058. }
  2059. },
  2060. "400": {
  2061. "description": "Bad request",
  2062. "content": {
  2063. "application/json": {
  2064. "schema": {
  2065. "$ref": "#/components/schemas/BadRequestError"
  2066. }
  2067. }
  2068. }
  2069. }
  2070. },
  2071. "requestBody": {
  2072. "content": {
  2073. "application/json": {
  2074. "schema": {
  2075. "$ref": "#/components/schemas/WorktreeRemoveInput"
  2076. }
  2077. }
  2078. }
  2079. },
  2080. "x-codeSamples": [
  2081. {
  2082. "lang": "js",
  2083. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  2084. }
  2085. ]
  2086. }
  2087. },
  2088. "/experimental/worktree/reset": {
  2089. "post": {
  2090. "operationId": "worktree.reset",
  2091. "parameters": [
  2092. {
  2093. "in": "query",
  2094. "name": "directory",
  2095. "schema": {
  2096. "type": "string"
  2097. }
  2098. },
  2099. {
  2100. "in": "query",
  2101. "name": "workspace",
  2102. "schema": {
  2103. "type": "string"
  2104. }
  2105. }
  2106. ],
  2107. "summary": "Reset worktree",
  2108. "description": "Reset a worktree branch to the primary default branch.",
  2109. "responses": {
  2110. "200": {
  2111. "description": "Worktree reset",
  2112. "content": {
  2113. "application/json": {
  2114. "schema": {
  2115. "type": "boolean"
  2116. }
  2117. }
  2118. }
  2119. },
  2120. "400": {
  2121. "description": "Bad request",
  2122. "content": {
  2123. "application/json": {
  2124. "schema": {
  2125. "$ref": "#/components/schemas/BadRequestError"
  2126. }
  2127. }
  2128. }
  2129. }
  2130. },
  2131. "requestBody": {
  2132. "content": {
  2133. "application/json": {
  2134. "schema": {
  2135. "$ref": "#/components/schemas/WorktreeResetInput"
  2136. }
  2137. }
  2138. }
  2139. },
  2140. "x-codeSamples": [
  2141. {
  2142. "lang": "js",
  2143. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  2144. }
  2145. ]
  2146. }
  2147. },
  2148. "/experimental/session": {
  2149. "get": {
  2150. "operationId": "experimental.session.list",
  2151. "parameters": [
  2152. {
  2153. "in": "query",
  2154. "name": "directory",
  2155. "schema": {
  2156. "type": "string"
  2157. },
  2158. "description": "Filter sessions by project directory"
  2159. },
  2160. {
  2161. "in": "query",
  2162. "name": "workspace",
  2163. "schema": {
  2164. "type": "string"
  2165. }
  2166. },
  2167. {
  2168. "in": "query",
  2169. "name": "roots",
  2170. "schema": {
  2171. "anyOf": [
  2172. {
  2173. "type": "boolean"
  2174. },
  2175. {
  2176. "type": "string",
  2177. "enum": ["true", "false"]
  2178. }
  2179. ]
  2180. },
  2181. "description": "Only return root sessions (no parentID)"
  2182. },
  2183. {
  2184. "in": "query",
  2185. "name": "start",
  2186. "schema": {
  2187. "type": "number"
  2188. },
  2189. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2190. },
  2191. {
  2192. "in": "query",
  2193. "name": "cursor",
  2194. "schema": {
  2195. "type": "number"
  2196. },
  2197. "description": "Return sessions updated before this timestamp (milliseconds since epoch)"
  2198. },
  2199. {
  2200. "in": "query",
  2201. "name": "search",
  2202. "schema": {
  2203. "type": "string"
  2204. },
  2205. "description": "Filter sessions by title (case-insensitive)"
  2206. },
  2207. {
  2208. "in": "query",
  2209. "name": "limit",
  2210. "schema": {
  2211. "type": "number"
  2212. },
  2213. "description": "Maximum number of sessions to return"
  2214. },
  2215. {
  2216. "in": "query",
  2217. "name": "archived",
  2218. "schema": {
  2219. "anyOf": [
  2220. {
  2221. "type": "boolean"
  2222. },
  2223. {
  2224. "type": "string",
  2225. "enum": ["true", "false"]
  2226. }
  2227. ]
  2228. },
  2229. "description": "Include archived sessions (default false)"
  2230. }
  2231. ],
  2232. "summary": "List sessions",
  2233. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  2234. "responses": {
  2235. "200": {
  2236. "description": "List of sessions",
  2237. "content": {
  2238. "application/json": {
  2239. "schema": {
  2240. "type": "array",
  2241. "items": {
  2242. "$ref": "#/components/schemas/GlobalSession"
  2243. }
  2244. }
  2245. }
  2246. }
  2247. }
  2248. },
  2249. "x-codeSamples": [
  2250. {
  2251. "lang": "js",
  2252. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  2253. }
  2254. ]
  2255. }
  2256. },
  2257. "/experimental/resource": {
  2258. "get": {
  2259. "operationId": "experimental.resource.list",
  2260. "parameters": [
  2261. {
  2262. "in": "query",
  2263. "name": "directory",
  2264. "schema": {
  2265. "type": "string"
  2266. }
  2267. },
  2268. {
  2269. "in": "query",
  2270. "name": "workspace",
  2271. "schema": {
  2272. "type": "string"
  2273. }
  2274. }
  2275. ],
  2276. "summary": "Get MCP resources",
  2277. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  2278. "responses": {
  2279. "200": {
  2280. "description": "MCP resources",
  2281. "content": {
  2282. "application/json": {
  2283. "schema": {
  2284. "type": "object",
  2285. "propertyNames": {
  2286. "type": "string"
  2287. },
  2288. "additionalProperties": {
  2289. "$ref": "#/components/schemas/McpResource"
  2290. }
  2291. }
  2292. }
  2293. }
  2294. }
  2295. },
  2296. "x-codeSamples": [
  2297. {
  2298. "lang": "js",
  2299. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  2300. }
  2301. ]
  2302. }
  2303. },
  2304. "/session": {
  2305. "get": {
  2306. "operationId": "session.list",
  2307. "parameters": [
  2308. {
  2309. "in": "query",
  2310. "name": "directory",
  2311. "schema": {
  2312. "type": "string"
  2313. },
  2314. "description": "Filter sessions by project directory"
  2315. },
  2316. {
  2317. "in": "query",
  2318. "name": "workspace",
  2319. "schema": {
  2320. "type": "string"
  2321. }
  2322. },
  2323. {
  2324. "in": "query",
  2325. "name": "roots",
  2326. "schema": {
  2327. "anyOf": [
  2328. {
  2329. "type": "boolean"
  2330. },
  2331. {
  2332. "type": "string",
  2333. "enum": ["true", "false"]
  2334. }
  2335. ]
  2336. },
  2337. "description": "Only return root sessions (no parentID)"
  2338. },
  2339. {
  2340. "in": "query",
  2341. "name": "start",
  2342. "schema": {
  2343. "type": "number"
  2344. },
  2345. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2346. },
  2347. {
  2348. "in": "query",
  2349. "name": "search",
  2350. "schema": {
  2351. "type": "string"
  2352. },
  2353. "description": "Filter sessions by title (case-insensitive)"
  2354. },
  2355. {
  2356. "in": "query",
  2357. "name": "limit",
  2358. "schema": {
  2359. "type": "number"
  2360. },
  2361. "description": "Maximum number of sessions to return"
  2362. }
  2363. ],
  2364. "summary": "List sessions",
  2365. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  2366. "responses": {
  2367. "200": {
  2368. "description": "List of sessions",
  2369. "content": {
  2370. "application/json": {
  2371. "schema": {
  2372. "type": "array",
  2373. "items": {
  2374. "$ref": "#/components/schemas/Session"
  2375. }
  2376. }
  2377. }
  2378. }
  2379. }
  2380. },
  2381. "x-codeSamples": [
  2382. {
  2383. "lang": "js",
  2384. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  2385. }
  2386. ]
  2387. },
  2388. "post": {
  2389. "operationId": "session.create",
  2390. "parameters": [
  2391. {
  2392. "in": "query",
  2393. "name": "directory",
  2394. "schema": {
  2395. "type": "string"
  2396. }
  2397. },
  2398. {
  2399. "in": "query",
  2400. "name": "workspace",
  2401. "schema": {
  2402. "type": "string"
  2403. }
  2404. }
  2405. ],
  2406. "summary": "Create session",
  2407. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  2408. "responses": {
  2409. "200": {
  2410. "description": "Successfully created session",
  2411. "content": {
  2412. "application/json": {
  2413. "schema": {
  2414. "$ref": "#/components/schemas/Session"
  2415. }
  2416. }
  2417. }
  2418. },
  2419. "400": {
  2420. "description": "Bad request",
  2421. "content": {
  2422. "application/json": {
  2423. "schema": {
  2424. "$ref": "#/components/schemas/BadRequestError"
  2425. }
  2426. }
  2427. }
  2428. }
  2429. },
  2430. "requestBody": {
  2431. "content": {
  2432. "application/json": {
  2433. "schema": {
  2434. "type": "object",
  2435. "properties": {
  2436. "parentID": {
  2437. "type": "string",
  2438. "pattern": "^ses.*"
  2439. },
  2440. "title": {
  2441. "type": "string"
  2442. },
  2443. "permission": {
  2444. "$ref": "#/components/schemas/PermissionRuleset"
  2445. },
  2446. "workspaceID": {
  2447. "type": "string",
  2448. "pattern": "^wrk.*"
  2449. }
  2450. }
  2451. }
  2452. }
  2453. }
  2454. },
  2455. "x-codeSamples": [
  2456. {
  2457. "lang": "js",
  2458. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  2459. }
  2460. ]
  2461. }
  2462. },
  2463. "/session/status": {
  2464. "get": {
  2465. "operationId": "session.status",
  2466. "parameters": [
  2467. {
  2468. "in": "query",
  2469. "name": "directory",
  2470. "schema": {
  2471. "type": "string"
  2472. }
  2473. },
  2474. {
  2475. "in": "query",
  2476. "name": "workspace",
  2477. "schema": {
  2478. "type": "string"
  2479. }
  2480. }
  2481. ],
  2482. "summary": "Get session status",
  2483. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  2484. "responses": {
  2485. "200": {
  2486. "description": "Get session status",
  2487. "content": {
  2488. "application/json": {
  2489. "schema": {
  2490. "type": "object",
  2491. "propertyNames": {
  2492. "type": "string"
  2493. },
  2494. "additionalProperties": {
  2495. "$ref": "#/components/schemas/SessionStatus"
  2496. }
  2497. }
  2498. }
  2499. }
  2500. },
  2501. "400": {
  2502. "description": "Bad request",
  2503. "content": {
  2504. "application/json": {
  2505. "schema": {
  2506. "$ref": "#/components/schemas/BadRequestError"
  2507. }
  2508. }
  2509. }
  2510. }
  2511. },
  2512. "x-codeSamples": [
  2513. {
  2514. "lang": "js",
  2515. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  2516. }
  2517. ]
  2518. }
  2519. },
  2520. "/session/{sessionID}": {
  2521. "get": {
  2522. "operationId": "session.get",
  2523. "parameters": [
  2524. {
  2525. "in": "query",
  2526. "name": "directory",
  2527. "schema": {
  2528. "type": "string"
  2529. }
  2530. },
  2531. {
  2532. "in": "query",
  2533. "name": "workspace",
  2534. "schema": {
  2535. "type": "string"
  2536. }
  2537. },
  2538. {
  2539. "in": "path",
  2540. "name": "sessionID",
  2541. "schema": {
  2542. "type": "string",
  2543. "pattern": "^ses.*"
  2544. },
  2545. "required": true
  2546. }
  2547. ],
  2548. "summary": "Get session",
  2549. "description": "Retrieve detailed information about a specific OpenCode session.",
  2550. "tags": ["Session"],
  2551. "responses": {
  2552. "200": {
  2553. "description": "Get session",
  2554. "content": {
  2555. "application/json": {
  2556. "schema": {
  2557. "$ref": "#/components/schemas/Session"
  2558. }
  2559. }
  2560. }
  2561. },
  2562. "400": {
  2563. "description": "Bad request",
  2564. "content": {
  2565. "application/json": {
  2566. "schema": {
  2567. "$ref": "#/components/schemas/BadRequestError"
  2568. }
  2569. }
  2570. }
  2571. },
  2572. "404": {
  2573. "description": "Not found",
  2574. "content": {
  2575. "application/json": {
  2576. "schema": {
  2577. "$ref": "#/components/schemas/NotFoundError"
  2578. }
  2579. }
  2580. }
  2581. }
  2582. },
  2583. "x-codeSamples": [
  2584. {
  2585. "lang": "js",
  2586. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  2587. }
  2588. ]
  2589. },
  2590. "delete": {
  2591. "operationId": "session.delete",
  2592. "parameters": [
  2593. {
  2594. "in": "query",
  2595. "name": "directory",
  2596. "schema": {
  2597. "type": "string"
  2598. }
  2599. },
  2600. {
  2601. "in": "query",
  2602. "name": "workspace",
  2603. "schema": {
  2604. "type": "string"
  2605. }
  2606. },
  2607. {
  2608. "in": "path",
  2609. "name": "sessionID",
  2610. "schema": {
  2611. "type": "string",
  2612. "pattern": "^ses.*"
  2613. },
  2614. "required": true
  2615. }
  2616. ],
  2617. "summary": "Delete session",
  2618. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  2619. "responses": {
  2620. "200": {
  2621. "description": "Successfully deleted session",
  2622. "content": {
  2623. "application/json": {
  2624. "schema": {
  2625. "type": "boolean"
  2626. }
  2627. }
  2628. }
  2629. },
  2630. "400": {
  2631. "description": "Bad request",
  2632. "content": {
  2633. "application/json": {
  2634. "schema": {
  2635. "$ref": "#/components/schemas/BadRequestError"
  2636. }
  2637. }
  2638. }
  2639. },
  2640. "404": {
  2641. "description": "Not found",
  2642. "content": {
  2643. "application/json": {
  2644. "schema": {
  2645. "$ref": "#/components/schemas/NotFoundError"
  2646. }
  2647. }
  2648. }
  2649. }
  2650. },
  2651. "x-codeSamples": [
  2652. {
  2653. "lang": "js",
  2654. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  2655. }
  2656. ]
  2657. },
  2658. "patch": {
  2659. "operationId": "session.update",
  2660. "parameters": [
  2661. {
  2662. "in": "query",
  2663. "name": "directory",
  2664. "schema": {
  2665. "type": "string"
  2666. }
  2667. },
  2668. {
  2669. "in": "query",
  2670. "name": "workspace",
  2671. "schema": {
  2672. "type": "string"
  2673. }
  2674. },
  2675. {
  2676. "in": "path",
  2677. "name": "sessionID",
  2678. "schema": {
  2679. "type": "string",
  2680. "pattern": "^ses.*"
  2681. },
  2682. "required": true
  2683. }
  2684. ],
  2685. "summary": "Update session",
  2686. "description": "Update properties of an existing session, such as title or other metadata.",
  2687. "responses": {
  2688. "200": {
  2689. "description": "Successfully updated session",
  2690. "content": {
  2691. "application/json": {
  2692. "schema": {
  2693. "$ref": "#/components/schemas/Session"
  2694. }
  2695. }
  2696. }
  2697. },
  2698. "400": {
  2699. "description": "Bad request",
  2700. "content": {
  2701. "application/json": {
  2702. "schema": {
  2703. "$ref": "#/components/schemas/BadRequestError"
  2704. }
  2705. }
  2706. }
  2707. },
  2708. "404": {
  2709. "description": "Not found",
  2710. "content": {
  2711. "application/json": {
  2712. "schema": {
  2713. "$ref": "#/components/schemas/NotFoundError"
  2714. }
  2715. }
  2716. }
  2717. }
  2718. },
  2719. "requestBody": {
  2720. "content": {
  2721. "application/json": {
  2722. "schema": {
  2723. "type": "object",
  2724. "properties": {
  2725. "title": {
  2726. "type": "string"
  2727. },
  2728. "permission": {
  2729. "$ref": "#/components/schemas/PermissionRuleset"
  2730. },
  2731. "time": {
  2732. "type": "object",
  2733. "properties": {
  2734. "archived": {
  2735. "type": "number"
  2736. }
  2737. }
  2738. }
  2739. }
  2740. }
  2741. }
  2742. }
  2743. },
  2744. "x-codeSamples": [
  2745. {
  2746. "lang": "js",
  2747. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  2748. }
  2749. ]
  2750. }
  2751. },
  2752. "/session/{sessionID}/children": {
  2753. "get": {
  2754. "operationId": "session.children",
  2755. "parameters": [
  2756. {
  2757. "in": "query",
  2758. "name": "directory",
  2759. "schema": {
  2760. "type": "string"
  2761. }
  2762. },
  2763. {
  2764. "in": "query",
  2765. "name": "workspace",
  2766. "schema": {
  2767. "type": "string"
  2768. }
  2769. },
  2770. {
  2771. "in": "path",
  2772. "name": "sessionID",
  2773. "schema": {
  2774. "type": "string",
  2775. "pattern": "^ses.*"
  2776. },
  2777. "required": true
  2778. }
  2779. ],
  2780. "summary": "Get session children",
  2781. "tags": ["Session"],
  2782. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  2783. "responses": {
  2784. "200": {
  2785. "description": "List of children",
  2786. "content": {
  2787. "application/json": {
  2788. "schema": {
  2789. "type": "array",
  2790. "items": {
  2791. "$ref": "#/components/schemas/Session"
  2792. }
  2793. }
  2794. }
  2795. }
  2796. },
  2797. "400": {
  2798. "description": "Bad request",
  2799. "content": {
  2800. "application/json": {
  2801. "schema": {
  2802. "$ref": "#/components/schemas/BadRequestError"
  2803. }
  2804. }
  2805. }
  2806. },
  2807. "404": {
  2808. "description": "Not found",
  2809. "content": {
  2810. "application/json": {
  2811. "schema": {
  2812. "$ref": "#/components/schemas/NotFoundError"
  2813. }
  2814. }
  2815. }
  2816. }
  2817. },
  2818. "x-codeSamples": [
  2819. {
  2820. "lang": "js",
  2821. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  2822. }
  2823. ]
  2824. }
  2825. },
  2826. "/session/{sessionID}/todo": {
  2827. "get": {
  2828. "operationId": "session.todo",
  2829. "parameters": [
  2830. {
  2831. "in": "query",
  2832. "name": "directory",
  2833. "schema": {
  2834. "type": "string"
  2835. }
  2836. },
  2837. {
  2838. "in": "query",
  2839. "name": "workspace",
  2840. "schema": {
  2841. "type": "string"
  2842. }
  2843. },
  2844. {
  2845. "in": "path",
  2846. "name": "sessionID",
  2847. "schema": {
  2848. "type": "string",
  2849. "pattern": "^ses.*"
  2850. },
  2851. "required": true
  2852. }
  2853. ],
  2854. "summary": "Get session todos",
  2855. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  2856. "responses": {
  2857. "200": {
  2858. "description": "Todo list",
  2859. "content": {
  2860. "application/json": {
  2861. "schema": {
  2862. "type": "array",
  2863. "items": {
  2864. "$ref": "#/components/schemas/Todo"
  2865. }
  2866. }
  2867. }
  2868. }
  2869. },
  2870. "400": {
  2871. "description": "Bad request",
  2872. "content": {
  2873. "application/json": {
  2874. "schema": {
  2875. "$ref": "#/components/schemas/BadRequestError"
  2876. }
  2877. }
  2878. }
  2879. },
  2880. "404": {
  2881. "description": "Not found",
  2882. "content": {
  2883. "application/json": {
  2884. "schema": {
  2885. "$ref": "#/components/schemas/NotFoundError"
  2886. }
  2887. }
  2888. }
  2889. }
  2890. },
  2891. "x-codeSamples": [
  2892. {
  2893. "lang": "js",
  2894. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  2895. }
  2896. ]
  2897. }
  2898. },
  2899. "/session/{sessionID}/init": {
  2900. "post": {
  2901. "operationId": "session.init",
  2902. "parameters": [
  2903. {
  2904. "in": "query",
  2905. "name": "directory",
  2906. "schema": {
  2907. "type": "string"
  2908. }
  2909. },
  2910. {
  2911. "in": "query",
  2912. "name": "workspace",
  2913. "schema": {
  2914. "type": "string"
  2915. }
  2916. },
  2917. {
  2918. "in": "path",
  2919. "name": "sessionID",
  2920. "schema": {
  2921. "type": "string",
  2922. "pattern": "^ses.*"
  2923. },
  2924. "required": true
  2925. }
  2926. ],
  2927. "summary": "Initialize session",
  2928. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  2929. "responses": {
  2930. "200": {
  2931. "description": "200",
  2932. "content": {
  2933. "application/json": {
  2934. "schema": {
  2935. "type": "boolean"
  2936. }
  2937. }
  2938. }
  2939. },
  2940. "400": {
  2941. "description": "Bad request",
  2942. "content": {
  2943. "application/json": {
  2944. "schema": {
  2945. "$ref": "#/components/schemas/BadRequestError"
  2946. }
  2947. }
  2948. }
  2949. },
  2950. "404": {
  2951. "description": "Not found",
  2952. "content": {
  2953. "application/json": {
  2954. "schema": {
  2955. "$ref": "#/components/schemas/NotFoundError"
  2956. }
  2957. }
  2958. }
  2959. }
  2960. },
  2961. "requestBody": {
  2962. "content": {
  2963. "application/json": {
  2964. "schema": {
  2965. "type": "object",
  2966. "properties": {
  2967. "modelID": {
  2968. "type": "string"
  2969. },
  2970. "providerID": {
  2971. "type": "string"
  2972. },
  2973. "messageID": {
  2974. "type": "string",
  2975. "pattern": "^msg.*"
  2976. }
  2977. },
  2978. "required": ["modelID", "providerID", "messageID"]
  2979. }
  2980. }
  2981. }
  2982. },
  2983. "x-codeSamples": [
  2984. {
  2985. "lang": "js",
  2986. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  2987. }
  2988. ]
  2989. }
  2990. },
  2991. "/session/{sessionID}/fork": {
  2992. "post": {
  2993. "operationId": "session.fork",
  2994. "parameters": [
  2995. {
  2996. "in": "query",
  2997. "name": "directory",
  2998. "schema": {
  2999. "type": "string"
  3000. }
  3001. },
  3002. {
  3003. "in": "query",
  3004. "name": "workspace",
  3005. "schema": {
  3006. "type": "string"
  3007. }
  3008. },
  3009. {
  3010. "in": "path",
  3011. "name": "sessionID",
  3012. "schema": {
  3013. "type": "string",
  3014. "pattern": "^ses.*"
  3015. },
  3016. "required": true
  3017. }
  3018. ],
  3019. "summary": "Fork session",
  3020. "description": "Create a new session by forking an existing session at a specific message point.",
  3021. "responses": {
  3022. "200": {
  3023. "description": "200",
  3024. "content": {
  3025. "application/json": {
  3026. "schema": {
  3027. "$ref": "#/components/schemas/Session"
  3028. }
  3029. }
  3030. }
  3031. }
  3032. },
  3033. "requestBody": {
  3034. "content": {
  3035. "application/json": {
  3036. "schema": {
  3037. "type": "object",
  3038. "properties": {
  3039. "messageID": {
  3040. "type": "string",
  3041. "pattern": "^msg.*"
  3042. }
  3043. }
  3044. }
  3045. }
  3046. }
  3047. },
  3048. "x-codeSamples": [
  3049. {
  3050. "lang": "js",
  3051. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  3052. }
  3053. ]
  3054. }
  3055. },
  3056. "/session/{sessionID}/abort": {
  3057. "post": {
  3058. "operationId": "session.abort",
  3059. "parameters": [
  3060. {
  3061. "in": "query",
  3062. "name": "directory",
  3063. "schema": {
  3064. "type": "string"
  3065. }
  3066. },
  3067. {
  3068. "in": "query",
  3069. "name": "workspace",
  3070. "schema": {
  3071. "type": "string"
  3072. }
  3073. },
  3074. {
  3075. "in": "path",
  3076. "name": "sessionID",
  3077. "schema": {
  3078. "type": "string",
  3079. "pattern": "^ses.*"
  3080. },
  3081. "required": true
  3082. }
  3083. ],
  3084. "summary": "Abort session",
  3085. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  3086. "responses": {
  3087. "200": {
  3088. "description": "Aborted session",
  3089. "content": {
  3090. "application/json": {
  3091. "schema": {
  3092. "type": "boolean"
  3093. }
  3094. }
  3095. }
  3096. },
  3097. "400": {
  3098. "description": "Bad request",
  3099. "content": {
  3100. "application/json": {
  3101. "schema": {
  3102. "$ref": "#/components/schemas/BadRequestError"
  3103. }
  3104. }
  3105. }
  3106. },
  3107. "404": {
  3108. "description": "Not found",
  3109. "content": {
  3110. "application/json": {
  3111. "schema": {
  3112. "$ref": "#/components/schemas/NotFoundError"
  3113. }
  3114. }
  3115. }
  3116. }
  3117. },
  3118. "x-codeSamples": [
  3119. {
  3120. "lang": "js",
  3121. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  3122. }
  3123. ]
  3124. }
  3125. },
  3126. "/session/{sessionID}/share": {
  3127. "post": {
  3128. "operationId": "session.share",
  3129. "parameters": [
  3130. {
  3131. "in": "query",
  3132. "name": "directory",
  3133. "schema": {
  3134. "type": "string"
  3135. }
  3136. },
  3137. {
  3138. "in": "query",
  3139. "name": "workspace",
  3140. "schema": {
  3141. "type": "string"
  3142. }
  3143. },
  3144. {
  3145. "in": "path",
  3146. "name": "sessionID",
  3147. "schema": {
  3148. "type": "string",
  3149. "pattern": "^ses.*"
  3150. },
  3151. "required": true
  3152. }
  3153. ],
  3154. "summary": "Share session",
  3155. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  3156. "responses": {
  3157. "200": {
  3158. "description": "Successfully shared session",
  3159. "content": {
  3160. "application/json": {
  3161. "schema": {
  3162. "$ref": "#/components/schemas/Session"
  3163. }
  3164. }
  3165. }
  3166. },
  3167. "400": {
  3168. "description": "Bad request",
  3169. "content": {
  3170. "application/json": {
  3171. "schema": {
  3172. "$ref": "#/components/schemas/BadRequestError"
  3173. }
  3174. }
  3175. }
  3176. },
  3177. "404": {
  3178. "description": "Not found",
  3179. "content": {
  3180. "application/json": {
  3181. "schema": {
  3182. "$ref": "#/components/schemas/NotFoundError"
  3183. }
  3184. }
  3185. }
  3186. }
  3187. },
  3188. "x-codeSamples": [
  3189. {
  3190. "lang": "js",
  3191. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  3192. }
  3193. ]
  3194. },
  3195. "delete": {
  3196. "operationId": "session.unshare",
  3197. "parameters": [
  3198. {
  3199. "in": "query",
  3200. "name": "directory",
  3201. "schema": {
  3202. "type": "string"
  3203. }
  3204. },
  3205. {
  3206. "in": "query",
  3207. "name": "workspace",
  3208. "schema": {
  3209. "type": "string"
  3210. }
  3211. },
  3212. {
  3213. "in": "path",
  3214. "name": "sessionID",
  3215. "schema": {
  3216. "type": "string",
  3217. "pattern": "^ses.*"
  3218. },
  3219. "required": true
  3220. }
  3221. ],
  3222. "summary": "Unshare session",
  3223. "description": "Remove the shareable link for a session, making it private again.",
  3224. "responses": {
  3225. "200": {
  3226. "description": "Successfully unshared session",
  3227. "content": {
  3228. "application/json": {
  3229. "schema": {
  3230. "$ref": "#/components/schemas/Session"
  3231. }
  3232. }
  3233. }
  3234. },
  3235. "400": {
  3236. "description": "Bad request",
  3237. "content": {
  3238. "application/json": {
  3239. "schema": {
  3240. "$ref": "#/components/schemas/BadRequestError"
  3241. }
  3242. }
  3243. }
  3244. },
  3245. "404": {
  3246. "description": "Not found",
  3247. "content": {
  3248. "application/json": {
  3249. "schema": {
  3250. "$ref": "#/components/schemas/NotFoundError"
  3251. }
  3252. }
  3253. }
  3254. }
  3255. },
  3256. "x-codeSamples": [
  3257. {
  3258. "lang": "js",
  3259. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  3260. }
  3261. ]
  3262. }
  3263. },
  3264. "/session/{sessionID}/diff": {
  3265. "get": {
  3266. "operationId": "session.diff",
  3267. "parameters": [
  3268. {
  3269. "in": "query",
  3270. "name": "directory",
  3271. "schema": {
  3272. "type": "string"
  3273. }
  3274. },
  3275. {
  3276. "in": "query",
  3277. "name": "workspace",
  3278. "schema": {
  3279. "type": "string"
  3280. }
  3281. },
  3282. {
  3283. "in": "path",
  3284. "name": "sessionID",
  3285. "schema": {
  3286. "type": "string",
  3287. "pattern": "^ses.*"
  3288. },
  3289. "required": true
  3290. },
  3291. {
  3292. "in": "query",
  3293. "name": "messageID",
  3294. "schema": {
  3295. "type": "string",
  3296. "pattern": "^msg.*"
  3297. }
  3298. }
  3299. ],
  3300. "summary": "Get message diff",
  3301. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  3302. "responses": {
  3303. "200": {
  3304. "description": "Successfully retrieved diff",
  3305. "content": {
  3306. "application/json": {
  3307. "schema": {
  3308. "type": "array",
  3309. "items": {
  3310. "$ref": "#/components/schemas/SnapshotFileDiff"
  3311. }
  3312. }
  3313. }
  3314. }
  3315. }
  3316. },
  3317. "x-codeSamples": [
  3318. {
  3319. "lang": "js",
  3320. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  3321. }
  3322. ]
  3323. }
  3324. },
  3325. "/session/{sessionID}/summarize": {
  3326. "post": {
  3327. "operationId": "session.summarize",
  3328. "parameters": [
  3329. {
  3330. "in": "query",
  3331. "name": "directory",
  3332. "schema": {
  3333. "type": "string"
  3334. }
  3335. },
  3336. {
  3337. "in": "query",
  3338. "name": "workspace",
  3339. "schema": {
  3340. "type": "string"
  3341. }
  3342. },
  3343. {
  3344. "in": "path",
  3345. "name": "sessionID",
  3346. "schema": {
  3347. "type": "string",
  3348. "pattern": "^ses.*"
  3349. },
  3350. "required": true
  3351. }
  3352. ],
  3353. "summary": "Summarize session",
  3354. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  3355. "responses": {
  3356. "200": {
  3357. "description": "Summarized session",
  3358. "content": {
  3359. "application/json": {
  3360. "schema": {
  3361. "type": "boolean"
  3362. }
  3363. }
  3364. }
  3365. },
  3366. "400": {
  3367. "description": "Bad request",
  3368. "content": {
  3369. "application/json": {
  3370. "schema": {
  3371. "$ref": "#/components/schemas/BadRequestError"
  3372. }
  3373. }
  3374. }
  3375. },
  3376. "404": {
  3377. "description": "Not found",
  3378. "content": {
  3379. "application/json": {
  3380. "schema": {
  3381. "$ref": "#/components/schemas/NotFoundError"
  3382. }
  3383. }
  3384. }
  3385. }
  3386. },
  3387. "requestBody": {
  3388. "content": {
  3389. "application/json": {
  3390. "schema": {
  3391. "type": "object",
  3392. "properties": {
  3393. "providerID": {
  3394. "type": "string"
  3395. },
  3396. "modelID": {
  3397. "type": "string"
  3398. },
  3399. "auto": {
  3400. "default": false,
  3401. "type": "boolean"
  3402. }
  3403. },
  3404. "required": ["providerID", "modelID"]
  3405. }
  3406. }
  3407. }
  3408. },
  3409. "x-codeSamples": [
  3410. {
  3411. "lang": "js",
  3412. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  3413. }
  3414. ]
  3415. }
  3416. },
  3417. "/session/{sessionID}/message": {
  3418. "get": {
  3419. "operationId": "session.messages",
  3420. "parameters": [
  3421. {
  3422. "in": "query",
  3423. "name": "directory",
  3424. "schema": {
  3425. "type": "string"
  3426. }
  3427. },
  3428. {
  3429. "in": "query",
  3430. "name": "workspace",
  3431. "schema": {
  3432. "type": "string"
  3433. }
  3434. },
  3435. {
  3436. "in": "path",
  3437. "name": "sessionID",
  3438. "schema": {
  3439. "type": "string",
  3440. "pattern": "^ses.*"
  3441. },
  3442. "required": true
  3443. },
  3444. {
  3445. "in": "query",
  3446. "name": "limit",
  3447. "schema": {
  3448. "type": "integer",
  3449. "minimum": 0,
  3450. "maximum": 9007199254740991
  3451. },
  3452. "description": "Maximum number of messages to return"
  3453. },
  3454. {
  3455. "in": "query",
  3456. "name": "before",
  3457. "schema": {
  3458. "type": "string"
  3459. }
  3460. }
  3461. ],
  3462. "summary": "Get session messages",
  3463. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  3464. "responses": {
  3465. "200": {
  3466. "description": "List of messages",
  3467. "content": {
  3468. "application/json": {
  3469. "schema": {
  3470. "type": "array",
  3471. "items": {
  3472. "type": "object",
  3473. "properties": {
  3474. "info": {
  3475. "$ref": "#/components/schemas/Message"
  3476. },
  3477. "parts": {
  3478. "type": "array",
  3479. "items": {
  3480. "$ref": "#/components/schemas/Part"
  3481. }
  3482. }
  3483. },
  3484. "required": ["info", "parts"]
  3485. }
  3486. }
  3487. }
  3488. }
  3489. },
  3490. "400": {
  3491. "description": "Bad request",
  3492. "content": {
  3493. "application/json": {
  3494. "schema": {
  3495. "$ref": "#/components/schemas/BadRequestError"
  3496. }
  3497. }
  3498. }
  3499. },
  3500. "404": {
  3501. "description": "Not found",
  3502. "content": {
  3503. "application/json": {
  3504. "schema": {
  3505. "$ref": "#/components/schemas/NotFoundError"
  3506. }
  3507. }
  3508. }
  3509. }
  3510. },
  3511. "x-codeSamples": [
  3512. {
  3513. "lang": "js",
  3514. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  3515. }
  3516. ]
  3517. },
  3518. "post": {
  3519. "operationId": "session.prompt",
  3520. "parameters": [
  3521. {
  3522. "in": "query",
  3523. "name": "directory",
  3524. "schema": {
  3525. "type": "string"
  3526. }
  3527. },
  3528. {
  3529. "in": "query",
  3530. "name": "workspace",
  3531. "schema": {
  3532. "type": "string"
  3533. }
  3534. },
  3535. {
  3536. "in": "path",
  3537. "name": "sessionID",
  3538. "schema": {
  3539. "type": "string",
  3540. "pattern": "^ses.*"
  3541. },
  3542. "required": true
  3543. }
  3544. ],
  3545. "summary": "Send message",
  3546. "description": "Create and send a new message to a session, streaming the AI response.",
  3547. "responses": {
  3548. "200": {
  3549. "description": "Created message",
  3550. "content": {
  3551. "application/json": {
  3552. "schema": {
  3553. "type": "object",
  3554. "properties": {
  3555. "info": {
  3556. "$ref": "#/components/schemas/AssistantMessage"
  3557. },
  3558. "parts": {
  3559. "type": "array",
  3560. "items": {
  3561. "$ref": "#/components/schemas/Part"
  3562. }
  3563. }
  3564. },
  3565. "required": ["info", "parts"]
  3566. }
  3567. }
  3568. }
  3569. },
  3570. "400": {
  3571. "description": "Bad request",
  3572. "content": {
  3573. "application/json": {
  3574. "schema": {
  3575. "$ref": "#/components/schemas/BadRequestError"
  3576. }
  3577. }
  3578. }
  3579. },
  3580. "404": {
  3581. "description": "Not found",
  3582. "content": {
  3583. "application/json": {
  3584. "schema": {
  3585. "$ref": "#/components/schemas/NotFoundError"
  3586. }
  3587. }
  3588. }
  3589. }
  3590. },
  3591. "requestBody": {
  3592. "content": {
  3593. "application/json": {
  3594. "schema": {
  3595. "type": "object",
  3596. "properties": {
  3597. "messageID": {
  3598. "type": "string",
  3599. "pattern": "^msg.*"
  3600. },
  3601. "model": {
  3602. "type": "object",
  3603. "properties": {
  3604. "providerID": {
  3605. "type": "string"
  3606. },
  3607. "modelID": {
  3608. "type": "string"
  3609. }
  3610. },
  3611. "required": ["providerID", "modelID"]
  3612. },
  3613. "agent": {
  3614. "type": "string"
  3615. },
  3616. "noReply": {
  3617. "type": "boolean"
  3618. },
  3619. "tools": {
  3620. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  3621. "type": "object",
  3622. "propertyNames": {
  3623. "type": "string"
  3624. },
  3625. "additionalProperties": {
  3626. "type": "boolean"
  3627. }
  3628. },
  3629. "format": {
  3630. "$ref": "#/components/schemas/OutputFormat"
  3631. },
  3632. "system": {
  3633. "type": "string"
  3634. },
  3635. "variant": {
  3636. "type": "string"
  3637. },
  3638. "parts": {
  3639. "type": "array",
  3640. "items": {
  3641. "anyOf": [
  3642. {
  3643. "$ref": "#/components/schemas/TextPartInput"
  3644. },
  3645. {
  3646. "$ref": "#/components/schemas/FilePartInput"
  3647. },
  3648. {
  3649. "$ref": "#/components/schemas/AgentPartInput"
  3650. },
  3651. {
  3652. "$ref": "#/components/schemas/SubtaskPartInput"
  3653. }
  3654. ]
  3655. }
  3656. }
  3657. },
  3658. "required": ["parts"]
  3659. }
  3660. }
  3661. }
  3662. },
  3663. "x-codeSamples": [
  3664. {
  3665. "lang": "js",
  3666. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  3667. }
  3668. ]
  3669. }
  3670. },
  3671. "/session/{sessionID}/message/{messageID}": {
  3672. "get": {
  3673. "operationId": "session.message",
  3674. "parameters": [
  3675. {
  3676. "in": "query",
  3677. "name": "directory",
  3678. "schema": {
  3679. "type": "string"
  3680. }
  3681. },
  3682. {
  3683. "in": "query",
  3684. "name": "workspace",
  3685. "schema": {
  3686. "type": "string"
  3687. }
  3688. },
  3689. {
  3690. "in": "path",
  3691. "name": "sessionID",
  3692. "schema": {
  3693. "type": "string",
  3694. "pattern": "^ses.*"
  3695. },
  3696. "required": true
  3697. },
  3698. {
  3699. "in": "path",
  3700. "name": "messageID",
  3701. "schema": {
  3702. "type": "string",
  3703. "pattern": "^msg.*"
  3704. },
  3705. "required": true
  3706. }
  3707. ],
  3708. "summary": "Get message",
  3709. "description": "Retrieve a specific message from a session by its message ID.",
  3710. "responses": {
  3711. "200": {
  3712. "description": "Message",
  3713. "content": {
  3714. "application/json": {
  3715. "schema": {
  3716. "type": "object",
  3717. "properties": {
  3718. "info": {
  3719. "$ref": "#/components/schemas/Message"
  3720. },
  3721. "parts": {
  3722. "type": "array",
  3723. "items": {
  3724. "$ref": "#/components/schemas/Part"
  3725. }
  3726. }
  3727. },
  3728. "required": ["info", "parts"]
  3729. }
  3730. }
  3731. }
  3732. },
  3733. "400": {
  3734. "description": "Bad request",
  3735. "content": {
  3736. "application/json": {
  3737. "schema": {
  3738. "$ref": "#/components/schemas/BadRequestError"
  3739. }
  3740. }
  3741. }
  3742. },
  3743. "404": {
  3744. "description": "Not found",
  3745. "content": {
  3746. "application/json": {
  3747. "schema": {
  3748. "$ref": "#/components/schemas/NotFoundError"
  3749. }
  3750. }
  3751. }
  3752. }
  3753. },
  3754. "x-codeSamples": [
  3755. {
  3756. "lang": "js",
  3757. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  3758. }
  3759. ]
  3760. },
  3761. "delete": {
  3762. "operationId": "session.deleteMessage",
  3763. "parameters": [
  3764. {
  3765. "in": "query",
  3766. "name": "directory",
  3767. "schema": {
  3768. "type": "string"
  3769. }
  3770. },
  3771. {
  3772. "in": "query",
  3773. "name": "workspace",
  3774. "schema": {
  3775. "type": "string"
  3776. }
  3777. },
  3778. {
  3779. "in": "path",
  3780. "name": "sessionID",
  3781. "schema": {
  3782. "type": "string",
  3783. "pattern": "^ses.*"
  3784. },
  3785. "required": true
  3786. },
  3787. {
  3788. "in": "path",
  3789. "name": "messageID",
  3790. "schema": {
  3791. "type": "string",
  3792. "pattern": "^msg.*"
  3793. },
  3794. "required": true
  3795. }
  3796. ],
  3797. "summary": "Delete message",
  3798. "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.",
  3799. "responses": {
  3800. "200": {
  3801. "description": "Successfully deleted message",
  3802. "content": {
  3803. "application/json": {
  3804. "schema": {
  3805. "type": "boolean"
  3806. }
  3807. }
  3808. }
  3809. },
  3810. "400": {
  3811. "description": "Bad request",
  3812. "content": {
  3813. "application/json": {
  3814. "schema": {
  3815. "$ref": "#/components/schemas/BadRequestError"
  3816. }
  3817. }
  3818. }
  3819. },
  3820. "404": {
  3821. "description": "Not found",
  3822. "content": {
  3823. "application/json": {
  3824. "schema": {
  3825. "$ref": "#/components/schemas/NotFoundError"
  3826. }
  3827. }
  3828. }
  3829. }
  3830. },
  3831. "x-codeSamples": [
  3832. {
  3833. "lang": "js",
  3834. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  3835. }
  3836. ]
  3837. }
  3838. },
  3839. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  3840. "delete": {
  3841. "operationId": "part.delete",
  3842. "parameters": [
  3843. {
  3844. "in": "query",
  3845. "name": "directory",
  3846. "schema": {
  3847. "type": "string"
  3848. }
  3849. },
  3850. {
  3851. "in": "query",
  3852. "name": "workspace",
  3853. "schema": {
  3854. "type": "string"
  3855. }
  3856. },
  3857. {
  3858. "in": "path",
  3859. "name": "sessionID",
  3860. "schema": {
  3861. "type": "string",
  3862. "pattern": "^ses.*"
  3863. },
  3864. "required": true
  3865. },
  3866. {
  3867. "in": "path",
  3868. "name": "messageID",
  3869. "schema": {
  3870. "type": "string",
  3871. "pattern": "^msg.*"
  3872. },
  3873. "required": true
  3874. },
  3875. {
  3876. "in": "path",
  3877. "name": "partID",
  3878. "schema": {
  3879. "type": "string",
  3880. "pattern": "^prt.*"
  3881. },
  3882. "required": true
  3883. }
  3884. ],
  3885. "description": "Delete a part from a message",
  3886. "responses": {
  3887. "200": {
  3888. "description": "Successfully deleted part",
  3889. "content": {
  3890. "application/json": {
  3891. "schema": {
  3892. "type": "boolean"
  3893. }
  3894. }
  3895. }
  3896. },
  3897. "400": {
  3898. "description": "Bad request",
  3899. "content": {
  3900. "application/json": {
  3901. "schema": {
  3902. "$ref": "#/components/schemas/BadRequestError"
  3903. }
  3904. }
  3905. }
  3906. },
  3907. "404": {
  3908. "description": "Not found",
  3909. "content": {
  3910. "application/json": {
  3911. "schema": {
  3912. "$ref": "#/components/schemas/NotFoundError"
  3913. }
  3914. }
  3915. }
  3916. }
  3917. },
  3918. "x-codeSamples": [
  3919. {
  3920. "lang": "js",
  3921. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  3922. }
  3923. ]
  3924. },
  3925. "patch": {
  3926. "operationId": "part.update",
  3927. "parameters": [
  3928. {
  3929. "in": "query",
  3930. "name": "directory",
  3931. "schema": {
  3932. "type": "string"
  3933. }
  3934. },
  3935. {
  3936. "in": "query",
  3937. "name": "workspace",
  3938. "schema": {
  3939. "type": "string"
  3940. }
  3941. },
  3942. {
  3943. "in": "path",
  3944. "name": "sessionID",
  3945. "schema": {
  3946. "type": "string",
  3947. "pattern": "^ses.*"
  3948. },
  3949. "required": true
  3950. },
  3951. {
  3952. "in": "path",
  3953. "name": "messageID",
  3954. "schema": {
  3955. "type": "string",
  3956. "pattern": "^msg.*"
  3957. },
  3958. "required": true
  3959. },
  3960. {
  3961. "in": "path",
  3962. "name": "partID",
  3963. "schema": {
  3964. "type": "string",
  3965. "pattern": "^prt.*"
  3966. },
  3967. "required": true
  3968. }
  3969. ],
  3970. "description": "Update a part in a message",
  3971. "responses": {
  3972. "200": {
  3973. "description": "Successfully updated part",
  3974. "content": {
  3975. "application/json": {
  3976. "schema": {
  3977. "$ref": "#/components/schemas/Part"
  3978. }
  3979. }
  3980. }
  3981. },
  3982. "400": {
  3983. "description": "Bad request",
  3984. "content": {
  3985. "application/json": {
  3986. "schema": {
  3987. "$ref": "#/components/schemas/BadRequestError"
  3988. }
  3989. }
  3990. }
  3991. },
  3992. "404": {
  3993. "description": "Not found",
  3994. "content": {
  3995. "application/json": {
  3996. "schema": {
  3997. "$ref": "#/components/schemas/NotFoundError"
  3998. }
  3999. }
  4000. }
  4001. }
  4002. },
  4003. "requestBody": {
  4004. "content": {
  4005. "application/json": {
  4006. "schema": {
  4007. "$ref": "#/components/schemas/Part"
  4008. }
  4009. }
  4010. }
  4011. },
  4012. "x-codeSamples": [
  4013. {
  4014. "lang": "js",
  4015. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  4016. }
  4017. ]
  4018. }
  4019. },
  4020. "/session/{sessionID}/prompt_async": {
  4021. "post": {
  4022. "operationId": "session.prompt_async",
  4023. "parameters": [
  4024. {
  4025. "in": "query",
  4026. "name": "directory",
  4027. "schema": {
  4028. "type": "string"
  4029. }
  4030. },
  4031. {
  4032. "in": "query",
  4033. "name": "workspace",
  4034. "schema": {
  4035. "type": "string"
  4036. }
  4037. },
  4038. {
  4039. "in": "path",
  4040. "name": "sessionID",
  4041. "schema": {
  4042. "type": "string",
  4043. "pattern": "^ses.*"
  4044. },
  4045. "required": true
  4046. }
  4047. ],
  4048. "summary": "Send async message",
  4049. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  4050. "responses": {
  4051. "204": {
  4052. "description": "Prompt accepted"
  4053. },
  4054. "400": {
  4055. "description": "Bad request",
  4056. "content": {
  4057. "application/json": {
  4058. "schema": {
  4059. "$ref": "#/components/schemas/BadRequestError"
  4060. }
  4061. }
  4062. }
  4063. },
  4064. "404": {
  4065. "description": "Not found",
  4066. "content": {
  4067. "application/json": {
  4068. "schema": {
  4069. "$ref": "#/components/schemas/NotFoundError"
  4070. }
  4071. }
  4072. }
  4073. }
  4074. },
  4075. "requestBody": {
  4076. "content": {
  4077. "application/json": {
  4078. "schema": {
  4079. "type": "object",
  4080. "properties": {
  4081. "messageID": {
  4082. "type": "string",
  4083. "pattern": "^msg.*"
  4084. },
  4085. "model": {
  4086. "type": "object",
  4087. "properties": {
  4088. "providerID": {
  4089. "type": "string"
  4090. },
  4091. "modelID": {
  4092. "type": "string"
  4093. }
  4094. },
  4095. "required": ["providerID", "modelID"]
  4096. },
  4097. "agent": {
  4098. "type": "string"
  4099. },
  4100. "noReply": {
  4101. "type": "boolean"
  4102. },
  4103. "tools": {
  4104. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  4105. "type": "object",
  4106. "propertyNames": {
  4107. "type": "string"
  4108. },
  4109. "additionalProperties": {
  4110. "type": "boolean"
  4111. }
  4112. },
  4113. "format": {
  4114. "$ref": "#/components/schemas/OutputFormat"
  4115. },
  4116. "system": {
  4117. "type": "string"
  4118. },
  4119. "variant": {
  4120. "type": "string"
  4121. },
  4122. "parts": {
  4123. "type": "array",
  4124. "items": {
  4125. "anyOf": [
  4126. {
  4127. "$ref": "#/components/schemas/TextPartInput"
  4128. },
  4129. {
  4130. "$ref": "#/components/schemas/FilePartInput"
  4131. },
  4132. {
  4133. "$ref": "#/components/schemas/AgentPartInput"
  4134. },
  4135. {
  4136. "$ref": "#/components/schemas/SubtaskPartInput"
  4137. }
  4138. ]
  4139. }
  4140. }
  4141. },
  4142. "required": ["parts"]
  4143. }
  4144. }
  4145. }
  4146. },
  4147. "x-codeSamples": [
  4148. {
  4149. "lang": "js",
  4150. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  4151. }
  4152. ]
  4153. }
  4154. },
  4155. "/session/{sessionID}/command": {
  4156. "post": {
  4157. "operationId": "session.command",
  4158. "parameters": [
  4159. {
  4160. "in": "query",
  4161. "name": "directory",
  4162. "schema": {
  4163. "type": "string"
  4164. }
  4165. },
  4166. {
  4167. "in": "query",
  4168. "name": "workspace",
  4169. "schema": {
  4170. "type": "string"
  4171. }
  4172. },
  4173. {
  4174. "in": "path",
  4175. "name": "sessionID",
  4176. "schema": {
  4177. "type": "string",
  4178. "pattern": "^ses.*"
  4179. },
  4180. "required": true
  4181. }
  4182. ],
  4183. "summary": "Send command",
  4184. "description": "Send a new command to a session for execution by the AI assistant.",
  4185. "responses": {
  4186. "200": {
  4187. "description": "Created message",
  4188. "content": {
  4189. "application/json": {
  4190. "schema": {
  4191. "type": "object",
  4192. "properties": {
  4193. "info": {
  4194. "$ref": "#/components/schemas/AssistantMessage"
  4195. },
  4196. "parts": {
  4197. "type": "array",
  4198. "items": {
  4199. "$ref": "#/components/schemas/Part"
  4200. }
  4201. }
  4202. },
  4203. "required": ["info", "parts"]
  4204. }
  4205. }
  4206. }
  4207. },
  4208. "400": {
  4209. "description": "Bad request",
  4210. "content": {
  4211. "application/json": {
  4212. "schema": {
  4213. "$ref": "#/components/schemas/BadRequestError"
  4214. }
  4215. }
  4216. }
  4217. },
  4218. "404": {
  4219. "description": "Not found",
  4220. "content": {
  4221. "application/json": {
  4222. "schema": {
  4223. "$ref": "#/components/schemas/NotFoundError"
  4224. }
  4225. }
  4226. }
  4227. }
  4228. },
  4229. "requestBody": {
  4230. "content": {
  4231. "application/json": {
  4232. "schema": {
  4233. "type": "object",
  4234. "properties": {
  4235. "messageID": {
  4236. "type": "string",
  4237. "pattern": "^msg.*"
  4238. },
  4239. "agent": {
  4240. "type": "string"
  4241. },
  4242. "model": {
  4243. "type": "string"
  4244. },
  4245. "arguments": {
  4246. "type": "string"
  4247. },
  4248. "command": {
  4249. "type": "string"
  4250. },
  4251. "variant": {
  4252. "type": "string"
  4253. },
  4254. "parts": {
  4255. "type": "array",
  4256. "items": {
  4257. "type": "object",
  4258. "properties": {
  4259. "id": {
  4260. "type": "string",
  4261. "pattern": "^prt.*"
  4262. },
  4263. "type": {
  4264. "type": "string",
  4265. "const": "file"
  4266. },
  4267. "mime": {
  4268. "type": "string"
  4269. },
  4270. "filename": {
  4271. "type": "string"
  4272. },
  4273. "url": {
  4274. "type": "string"
  4275. },
  4276. "source": {
  4277. "$ref": "#/components/schemas/FilePartSource"
  4278. }
  4279. },
  4280. "required": ["type", "mime", "url"]
  4281. }
  4282. }
  4283. },
  4284. "required": ["arguments", "command"]
  4285. }
  4286. }
  4287. }
  4288. },
  4289. "x-codeSamples": [
  4290. {
  4291. "lang": "js",
  4292. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  4293. }
  4294. ]
  4295. }
  4296. },
  4297. "/session/{sessionID}/shell": {
  4298. "post": {
  4299. "operationId": "session.shell",
  4300. "parameters": [
  4301. {
  4302. "in": "query",
  4303. "name": "directory",
  4304. "schema": {
  4305. "type": "string"
  4306. }
  4307. },
  4308. {
  4309. "in": "query",
  4310. "name": "workspace",
  4311. "schema": {
  4312. "type": "string"
  4313. }
  4314. },
  4315. {
  4316. "in": "path",
  4317. "name": "sessionID",
  4318. "schema": {
  4319. "type": "string",
  4320. "pattern": "^ses.*"
  4321. },
  4322. "required": true
  4323. }
  4324. ],
  4325. "summary": "Run shell command",
  4326. "description": "Execute a shell command within the session context and return the AI's response.",
  4327. "responses": {
  4328. "200": {
  4329. "description": "Created message",
  4330. "content": {
  4331. "application/json": {
  4332. "schema": {
  4333. "type": "object",
  4334. "properties": {
  4335. "info": {
  4336. "$ref": "#/components/schemas/Message"
  4337. },
  4338. "parts": {
  4339. "type": "array",
  4340. "items": {
  4341. "$ref": "#/components/schemas/Part"
  4342. }
  4343. }
  4344. },
  4345. "required": ["info", "parts"]
  4346. }
  4347. }
  4348. }
  4349. },
  4350. "400": {
  4351. "description": "Bad request",
  4352. "content": {
  4353. "application/json": {
  4354. "schema": {
  4355. "$ref": "#/components/schemas/BadRequestError"
  4356. }
  4357. }
  4358. }
  4359. },
  4360. "404": {
  4361. "description": "Not found",
  4362. "content": {
  4363. "application/json": {
  4364. "schema": {
  4365. "$ref": "#/components/schemas/NotFoundError"
  4366. }
  4367. }
  4368. }
  4369. }
  4370. },
  4371. "requestBody": {
  4372. "content": {
  4373. "application/json": {
  4374. "schema": {
  4375. "type": "object",
  4376. "properties": {
  4377. "messageID": {
  4378. "type": "string",
  4379. "pattern": "^msg.*"
  4380. },
  4381. "agent": {
  4382. "type": "string"
  4383. },
  4384. "model": {
  4385. "type": "object",
  4386. "properties": {
  4387. "providerID": {
  4388. "type": "string"
  4389. },
  4390. "modelID": {
  4391. "type": "string"
  4392. }
  4393. },
  4394. "required": ["providerID", "modelID"]
  4395. },
  4396. "command": {
  4397. "type": "string"
  4398. }
  4399. },
  4400. "required": ["agent", "command"]
  4401. }
  4402. }
  4403. }
  4404. },
  4405. "x-codeSamples": [
  4406. {
  4407. "lang": "js",
  4408. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  4409. }
  4410. ]
  4411. }
  4412. },
  4413. "/session/{sessionID}/revert": {
  4414. "post": {
  4415. "operationId": "session.revert",
  4416. "parameters": [
  4417. {
  4418. "in": "query",
  4419. "name": "directory",
  4420. "schema": {
  4421. "type": "string"
  4422. }
  4423. },
  4424. {
  4425. "in": "query",
  4426. "name": "workspace",
  4427. "schema": {
  4428. "type": "string"
  4429. }
  4430. },
  4431. {
  4432. "in": "path",
  4433. "name": "sessionID",
  4434. "schema": {
  4435. "type": "string",
  4436. "pattern": "^ses.*"
  4437. },
  4438. "required": true
  4439. }
  4440. ],
  4441. "summary": "Revert message",
  4442. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  4443. "responses": {
  4444. "200": {
  4445. "description": "Updated session",
  4446. "content": {
  4447. "application/json": {
  4448. "schema": {
  4449. "$ref": "#/components/schemas/Session"
  4450. }
  4451. }
  4452. }
  4453. },
  4454. "400": {
  4455. "description": "Bad request",
  4456. "content": {
  4457. "application/json": {
  4458. "schema": {
  4459. "$ref": "#/components/schemas/BadRequestError"
  4460. }
  4461. }
  4462. }
  4463. },
  4464. "404": {
  4465. "description": "Not found",
  4466. "content": {
  4467. "application/json": {
  4468. "schema": {
  4469. "$ref": "#/components/schemas/NotFoundError"
  4470. }
  4471. }
  4472. }
  4473. }
  4474. },
  4475. "requestBody": {
  4476. "content": {
  4477. "application/json": {
  4478. "schema": {
  4479. "type": "object",
  4480. "properties": {
  4481. "messageID": {
  4482. "type": "string",
  4483. "pattern": "^msg.*"
  4484. },
  4485. "partID": {
  4486. "type": "string",
  4487. "pattern": "^prt.*"
  4488. }
  4489. },
  4490. "required": ["messageID"]
  4491. }
  4492. }
  4493. }
  4494. },
  4495. "x-codeSamples": [
  4496. {
  4497. "lang": "js",
  4498. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  4499. }
  4500. ]
  4501. }
  4502. },
  4503. "/session/{sessionID}/unrevert": {
  4504. "post": {
  4505. "operationId": "session.unrevert",
  4506. "parameters": [
  4507. {
  4508. "in": "query",
  4509. "name": "directory",
  4510. "schema": {
  4511. "type": "string"
  4512. }
  4513. },
  4514. {
  4515. "in": "query",
  4516. "name": "workspace",
  4517. "schema": {
  4518. "type": "string"
  4519. }
  4520. },
  4521. {
  4522. "in": "path",
  4523. "name": "sessionID",
  4524. "schema": {
  4525. "type": "string",
  4526. "pattern": "^ses.*"
  4527. },
  4528. "required": true
  4529. }
  4530. ],
  4531. "summary": "Restore reverted messages",
  4532. "description": "Restore all previously reverted messages in a session.",
  4533. "responses": {
  4534. "200": {
  4535. "description": "Updated session",
  4536. "content": {
  4537. "application/json": {
  4538. "schema": {
  4539. "$ref": "#/components/schemas/Session"
  4540. }
  4541. }
  4542. }
  4543. },
  4544. "400": {
  4545. "description": "Bad request",
  4546. "content": {
  4547. "application/json": {
  4548. "schema": {
  4549. "$ref": "#/components/schemas/BadRequestError"
  4550. }
  4551. }
  4552. }
  4553. },
  4554. "404": {
  4555. "description": "Not found",
  4556. "content": {
  4557. "application/json": {
  4558. "schema": {
  4559. "$ref": "#/components/schemas/NotFoundError"
  4560. }
  4561. }
  4562. }
  4563. }
  4564. },
  4565. "x-codeSamples": [
  4566. {
  4567. "lang": "js",
  4568. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  4569. }
  4570. ]
  4571. }
  4572. },
  4573. "/session/{sessionID}/permissions/{permissionID}": {
  4574. "post": {
  4575. "operationId": "permission.respond",
  4576. "parameters": [
  4577. {
  4578. "in": "query",
  4579. "name": "directory",
  4580. "schema": {
  4581. "type": "string"
  4582. }
  4583. },
  4584. {
  4585. "in": "query",
  4586. "name": "workspace",
  4587. "schema": {
  4588. "type": "string"
  4589. }
  4590. },
  4591. {
  4592. "in": "path",
  4593. "name": "sessionID",
  4594. "schema": {
  4595. "type": "string",
  4596. "pattern": "^ses.*"
  4597. },
  4598. "required": true
  4599. },
  4600. {
  4601. "in": "path",
  4602. "name": "permissionID",
  4603. "schema": {
  4604. "type": "string",
  4605. "pattern": "^per.*"
  4606. },
  4607. "required": true
  4608. }
  4609. ],
  4610. "summary": "Respond to permission",
  4611. "deprecated": true,
  4612. "description": "Approve or deny a permission request from the AI assistant.",
  4613. "responses": {
  4614. "200": {
  4615. "description": "Permission processed successfully",
  4616. "content": {
  4617. "application/json": {
  4618. "schema": {
  4619. "type": "boolean"
  4620. }
  4621. }
  4622. }
  4623. },
  4624. "400": {
  4625. "description": "Bad request",
  4626. "content": {
  4627. "application/json": {
  4628. "schema": {
  4629. "$ref": "#/components/schemas/BadRequestError"
  4630. }
  4631. }
  4632. }
  4633. },
  4634. "404": {
  4635. "description": "Not found",
  4636. "content": {
  4637. "application/json": {
  4638. "schema": {
  4639. "$ref": "#/components/schemas/NotFoundError"
  4640. }
  4641. }
  4642. }
  4643. }
  4644. },
  4645. "requestBody": {
  4646. "content": {
  4647. "application/json": {
  4648. "schema": {
  4649. "type": "object",
  4650. "properties": {
  4651. "response": {
  4652. "type": "string",
  4653. "enum": ["once", "always", "reject"]
  4654. }
  4655. },
  4656. "required": ["response"]
  4657. }
  4658. }
  4659. }
  4660. },
  4661. "x-codeSamples": [
  4662. {
  4663. "lang": "js",
  4664. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  4665. }
  4666. ]
  4667. }
  4668. },
  4669. "/permission/{requestID}/reply": {
  4670. "post": {
  4671. "operationId": "permission.reply",
  4672. "parameters": [
  4673. {
  4674. "in": "query",
  4675. "name": "directory",
  4676. "schema": {
  4677. "type": "string"
  4678. }
  4679. },
  4680. {
  4681. "in": "query",
  4682. "name": "workspace",
  4683. "schema": {
  4684. "type": "string"
  4685. }
  4686. },
  4687. {
  4688. "in": "path",
  4689. "name": "requestID",
  4690. "schema": {
  4691. "type": "string",
  4692. "pattern": "^per.*"
  4693. },
  4694. "required": true
  4695. }
  4696. ],
  4697. "summary": "Respond to permission request",
  4698. "description": "Approve or deny a permission request from the AI assistant.",
  4699. "responses": {
  4700. "200": {
  4701. "description": "Permission processed successfully",
  4702. "content": {
  4703. "application/json": {
  4704. "schema": {
  4705. "type": "boolean"
  4706. }
  4707. }
  4708. }
  4709. },
  4710. "400": {
  4711. "description": "Bad request",
  4712. "content": {
  4713. "application/json": {
  4714. "schema": {
  4715. "$ref": "#/components/schemas/BadRequestError"
  4716. }
  4717. }
  4718. }
  4719. },
  4720. "404": {
  4721. "description": "Not found",
  4722. "content": {
  4723. "application/json": {
  4724. "schema": {
  4725. "$ref": "#/components/schemas/NotFoundError"
  4726. }
  4727. }
  4728. }
  4729. }
  4730. },
  4731. "requestBody": {
  4732. "content": {
  4733. "application/json": {
  4734. "schema": {
  4735. "type": "object",
  4736. "properties": {
  4737. "reply": {
  4738. "type": "string",
  4739. "enum": ["once", "always", "reject"]
  4740. },
  4741. "message": {
  4742. "type": "string"
  4743. }
  4744. },
  4745. "required": ["reply"]
  4746. }
  4747. }
  4748. }
  4749. },
  4750. "x-codeSamples": [
  4751. {
  4752. "lang": "js",
  4753. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4754. }
  4755. ]
  4756. }
  4757. },
  4758. "/permission": {
  4759. "get": {
  4760. "operationId": "permission.list",
  4761. "parameters": [
  4762. {
  4763. "in": "query",
  4764. "name": "directory",
  4765. "schema": {
  4766. "type": "string"
  4767. }
  4768. },
  4769. {
  4770. "in": "query",
  4771. "name": "workspace",
  4772. "schema": {
  4773. "type": "string"
  4774. }
  4775. }
  4776. ],
  4777. "summary": "List pending permissions",
  4778. "description": "Get all pending permission requests across all sessions.",
  4779. "responses": {
  4780. "200": {
  4781. "description": "List of pending permissions",
  4782. "content": {
  4783. "application/json": {
  4784. "schema": {
  4785. "type": "array",
  4786. "items": {
  4787. "$ref": "#/components/schemas/PermissionRequest"
  4788. }
  4789. }
  4790. }
  4791. }
  4792. }
  4793. },
  4794. "x-codeSamples": [
  4795. {
  4796. "lang": "js",
  4797. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  4798. }
  4799. ]
  4800. }
  4801. },
  4802. "/question": {
  4803. "get": {
  4804. "operationId": "question.list",
  4805. "parameters": [
  4806. {
  4807. "in": "query",
  4808. "name": "directory",
  4809. "schema": {
  4810. "type": "string"
  4811. }
  4812. },
  4813. {
  4814. "in": "query",
  4815. "name": "workspace",
  4816. "schema": {
  4817. "type": "string"
  4818. }
  4819. }
  4820. ],
  4821. "summary": "List pending questions",
  4822. "description": "Get all pending question requests across all sessions.",
  4823. "responses": {
  4824. "200": {
  4825. "description": "List of pending questions",
  4826. "content": {
  4827. "application/json": {
  4828. "schema": {
  4829. "type": "array",
  4830. "items": {
  4831. "$ref": "#/components/schemas/QuestionRequest"
  4832. }
  4833. }
  4834. }
  4835. }
  4836. }
  4837. },
  4838. "x-codeSamples": [
  4839. {
  4840. "lang": "js",
  4841. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  4842. }
  4843. ]
  4844. }
  4845. },
  4846. "/question/{requestID}/reply": {
  4847. "post": {
  4848. "operationId": "question.reply",
  4849. "parameters": [
  4850. {
  4851. "in": "query",
  4852. "name": "directory",
  4853. "schema": {
  4854. "type": "string"
  4855. }
  4856. },
  4857. {
  4858. "in": "query",
  4859. "name": "workspace",
  4860. "schema": {
  4861. "type": "string"
  4862. }
  4863. },
  4864. {
  4865. "in": "path",
  4866. "name": "requestID",
  4867. "schema": {
  4868. "type": "string",
  4869. "pattern": "^que.*"
  4870. },
  4871. "required": true
  4872. }
  4873. ],
  4874. "summary": "Reply to question request",
  4875. "description": "Provide answers to a question request from the AI assistant.",
  4876. "responses": {
  4877. "200": {
  4878. "description": "Question answered successfully",
  4879. "content": {
  4880. "application/json": {
  4881. "schema": {
  4882. "type": "boolean"
  4883. }
  4884. }
  4885. }
  4886. },
  4887. "400": {
  4888. "description": "Bad request",
  4889. "content": {
  4890. "application/json": {
  4891. "schema": {
  4892. "$ref": "#/components/schemas/BadRequestError"
  4893. }
  4894. }
  4895. }
  4896. },
  4897. "404": {
  4898. "description": "Not found",
  4899. "content": {
  4900. "application/json": {
  4901. "schema": {
  4902. "$ref": "#/components/schemas/NotFoundError"
  4903. }
  4904. }
  4905. }
  4906. }
  4907. },
  4908. "requestBody": {
  4909. "content": {
  4910. "application/json": {
  4911. "schema": {
  4912. "type": "object",
  4913. "properties": {
  4914. "answers": {
  4915. "description": "User answers in order of questions (each answer is an array of selected labels)",
  4916. "type": "array",
  4917. "items": {
  4918. "$ref": "#/components/schemas/QuestionAnswer"
  4919. }
  4920. }
  4921. },
  4922. "required": ["answers"]
  4923. }
  4924. }
  4925. }
  4926. },
  4927. "x-codeSamples": [
  4928. {
  4929. "lang": "js",
  4930. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  4931. }
  4932. ]
  4933. }
  4934. },
  4935. "/question/{requestID}/reject": {
  4936. "post": {
  4937. "operationId": "question.reject",
  4938. "parameters": [
  4939. {
  4940. "in": "query",
  4941. "name": "directory",
  4942. "schema": {
  4943. "type": "string"
  4944. }
  4945. },
  4946. {
  4947. "in": "query",
  4948. "name": "workspace",
  4949. "schema": {
  4950. "type": "string"
  4951. }
  4952. },
  4953. {
  4954. "in": "path",
  4955. "name": "requestID",
  4956. "schema": {
  4957. "type": "string",
  4958. "pattern": "^que.*"
  4959. },
  4960. "required": true
  4961. }
  4962. ],
  4963. "summary": "Reject question request",
  4964. "description": "Reject a question request from the AI assistant.",
  4965. "responses": {
  4966. "200": {
  4967. "description": "Question rejected successfully",
  4968. "content": {
  4969. "application/json": {
  4970. "schema": {
  4971. "type": "boolean"
  4972. }
  4973. }
  4974. }
  4975. },
  4976. "400": {
  4977. "description": "Bad request",
  4978. "content": {
  4979. "application/json": {
  4980. "schema": {
  4981. "$ref": "#/components/schemas/BadRequestError"
  4982. }
  4983. }
  4984. }
  4985. },
  4986. "404": {
  4987. "description": "Not found",
  4988. "content": {
  4989. "application/json": {
  4990. "schema": {
  4991. "$ref": "#/components/schemas/NotFoundError"
  4992. }
  4993. }
  4994. }
  4995. }
  4996. },
  4997. "x-codeSamples": [
  4998. {
  4999. "lang": "js",
  5000. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  5001. }
  5002. ]
  5003. }
  5004. },
  5005. "/provider": {
  5006. "get": {
  5007. "operationId": "provider.list",
  5008. "parameters": [
  5009. {
  5010. "in": "query",
  5011. "name": "directory",
  5012. "schema": {
  5013. "type": "string"
  5014. }
  5015. },
  5016. {
  5017. "in": "query",
  5018. "name": "workspace",
  5019. "schema": {
  5020. "type": "string"
  5021. }
  5022. }
  5023. ],
  5024. "summary": "List providers",
  5025. "description": "Get a list of all available AI providers, including both available and connected ones.",
  5026. "responses": {
  5027. "200": {
  5028. "description": "List of providers",
  5029. "content": {
  5030. "application/json": {
  5031. "schema": {
  5032. "type": "object",
  5033. "properties": {
  5034. "all": {
  5035. "type": "array",
  5036. "items": {
  5037. "$ref": "#/components/schemas/Provider"
  5038. }
  5039. },
  5040. "default": {
  5041. "type": "object",
  5042. "propertyNames": {
  5043. "type": "string"
  5044. },
  5045. "additionalProperties": {
  5046. "type": "string"
  5047. }
  5048. },
  5049. "connected": {
  5050. "type": "array",
  5051. "items": {
  5052. "type": "string"
  5053. }
  5054. }
  5055. },
  5056. "required": ["all", "default", "connected"]
  5057. }
  5058. }
  5059. }
  5060. }
  5061. },
  5062. "x-codeSamples": [
  5063. {
  5064. "lang": "js",
  5065. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  5066. }
  5067. ]
  5068. }
  5069. },
  5070. "/provider/auth": {
  5071. "get": {
  5072. "operationId": "provider.auth",
  5073. "parameters": [
  5074. {
  5075. "in": "query",
  5076. "name": "directory",
  5077. "schema": {
  5078. "type": "string"
  5079. }
  5080. },
  5081. {
  5082. "in": "query",
  5083. "name": "workspace",
  5084. "schema": {
  5085. "type": "string"
  5086. }
  5087. }
  5088. ],
  5089. "summary": "Get provider auth methods",
  5090. "description": "Retrieve available authentication methods for all AI providers.",
  5091. "responses": {
  5092. "200": {
  5093. "description": "Provider auth methods",
  5094. "content": {
  5095. "application/json": {
  5096. "schema": {
  5097. "type": "object",
  5098. "propertyNames": {
  5099. "type": "string"
  5100. },
  5101. "additionalProperties": {
  5102. "type": "array",
  5103. "items": {
  5104. "$ref": "#/components/schemas/ProviderAuthMethod"
  5105. }
  5106. }
  5107. }
  5108. }
  5109. }
  5110. }
  5111. },
  5112. "x-codeSamples": [
  5113. {
  5114. "lang": "js",
  5115. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  5116. }
  5117. ]
  5118. }
  5119. },
  5120. "/provider/{providerID}/oauth/authorize": {
  5121. "post": {
  5122. "operationId": "provider.oauth.authorize",
  5123. "parameters": [
  5124. {
  5125. "in": "query",
  5126. "name": "directory",
  5127. "schema": {
  5128. "type": "string"
  5129. }
  5130. },
  5131. {
  5132. "in": "query",
  5133. "name": "workspace",
  5134. "schema": {
  5135. "type": "string"
  5136. }
  5137. },
  5138. {
  5139. "in": "path",
  5140. "name": "providerID",
  5141. "schema": {
  5142. "type": "string"
  5143. },
  5144. "required": true,
  5145. "description": "Provider ID"
  5146. }
  5147. ],
  5148. "summary": "OAuth authorize",
  5149. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  5150. "responses": {
  5151. "200": {
  5152. "description": "Authorization URL and method",
  5153. "content": {
  5154. "application/json": {
  5155. "schema": {
  5156. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  5157. }
  5158. }
  5159. }
  5160. },
  5161. "400": {
  5162. "description": "Bad request",
  5163. "content": {
  5164. "application/json": {
  5165. "schema": {
  5166. "$ref": "#/components/schemas/BadRequestError"
  5167. }
  5168. }
  5169. }
  5170. }
  5171. },
  5172. "requestBody": {
  5173. "content": {
  5174. "application/json": {
  5175. "schema": {
  5176. "type": "object",
  5177. "properties": {
  5178. "method": {
  5179. "description": "Auth method index",
  5180. "type": "number"
  5181. },
  5182. "inputs": {
  5183. "description": "Prompt inputs",
  5184. "type": "object",
  5185. "propertyNames": {
  5186. "type": "string"
  5187. },
  5188. "additionalProperties": {
  5189. "type": "string"
  5190. }
  5191. }
  5192. },
  5193. "required": ["method"]
  5194. }
  5195. }
  5196. }
  5197. },
  5198. "x-codeSamples": [
  5199. {
  5200. "lang": "js",
  5201. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  5202. }
  5203. ]
  5204. }
  5205. },
  5206. "/provider/{providerID}/oauth/callback": {
  5207. "post": {
  5208. "operationId": "provider.oauth.callback",
  5209. "parameters": [
  5210. {
  5211. "in": "query",
  5212. "name": "directory",
  5213. "schema": {
  5214. "type": "string"
  5215. }
  5216. },
  5217. {
  5218. "in": "query",
  5219. "name": "workspace",
  5220. "schema": {
  5221. "type": "string"
  5222. }
  5223. },
  5224. {
  5225. "in": "path",
  5226. "name": "providerID",
  5227. "schema": {
  5228. "type": "string"
  5229. },
  5230. "required": true,
  5231. "description": "Provider ID"
  5232. }
  5233. ],
  5234. "summary": "OAuth callback",
  5235. "description": "Handle the OAuth callback from a provider after user authorization.",
  5236. "responses": {
  5237. "200": {
  5238. "description": "OAuth callback processed successfully",
  5239. "content": {
  5240. "application/json": {
  5241. "schema": {
  5242. "type": "boolean"
  5243. }
  5244. }
  5245. }
  5246. },
  5247. "400": {
  5248. "description": "Bad request",
  5249. "content": {
  5250. "application/json": {
  5251. "schema": {
  5252. "$ref": "#/components/schemas/BadRequestError"
  5253. }
  5254. }
  5255. }
  5256. }
  5257. },
  5258. "requestBody": {
  5259. "content": {
  5260. "application/json": {
  5261. "schema": {
  5262. "type": "object",
  5263. "properties": {
  5264. "method": {
  5265. "description": "Auth method index",
  5266. "type": "number"
  5267. },
  5268. "code": {
  5269. "description": "OAuth authorization code",
  5270. "type": "string"
  5271. }
  5272. },
  5273. "required": ["method"]
  5274. }
  5275. }
  5276. }
  5277. },
  5278. "x-codeSamples": [
  5279. {
  5280. "lang": "js",
  5281. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  5282. }
  5283. ]
  5284. }
  5285. },
  5286. "/sync/start": {
  5287. "post": {
  5288. "operationId": "sync.start",
  5289. "parameters": [
  5290. {
  5291. "in": "query",
  5292. "name": "directory",
  5293. "schema": {
  5294. "type": "string"
  5295. }
  5296. },
  5297. {
  5298. "in": "query",
  5299. "name": "workspace",
  5300. "schema": {
  5301. "type": "string"
  5302. }
  5303. }
  5304. ],
  5305. "summary": "Start workspace sync",
  5306. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  5307. "responses": {
  5308. "200": {
  5309. "description": "Workspace sync started",
  5310. "content": {
  5311. "application/json": {
  5312. "schema": {
  5313. "type": "boolean"
  5314. }
  5315. }
  5316. }
  5317. }
  5318. },
  5319. "x-codeSamples": [
  5320. {
  5321. "lang": "js",
  5322. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  5323. }
  5324. ]
  5325. }
  5326. },
  5327. "/sync/replay": {
  5328. "post": {
  5329. "operationId": "sync.replay",
  5330. "parameters": [
  5331. {
  5332. "in": "query",
  5333. "name": "directory",
  5334. "schema": {
  5335. "type": "string"
  5336. }
  5337. },
  5338. {
  5339. "in": "query",
  5340. "name": "workspace",
  5341. "schema": {
  5342. "type": "string"
  5343. }
  5344. }
  5345. ],
  5346. "summary": "Replay sync events",
  5347. "description": "Validate and replay a complete sync event history.",
  5348. "responses": {
  5349. "200": {
  5350. "description": "Replayed sync events",
  5351. "content": {
  5352. "application/json": {
  5353. "schema": {
  5354. "type": "object",
  5355. "properties": {
  5356. "sessionID": {
  5357. "type": "string"
  5358. }
  5359. },
  5360. "required": ["sessionID"]
  5361. }
  5362. }
  5363. }
  5364. },
  5365. "400": {
  5366. "description": "Bad request",
  5367. "content": {
  5368. "application/json": {
  5369. "schema": {
  5370. "$ref": "#/components/schemas/BadRequestError"
  5371. }
  5372. }
  5373. }
  5374. }
  5375. },
  5376. "requestBody": {
  5377. "content": {
  5378. "application/json": {
  5379. "schema": {
  5380. "type": "object",
  5381. "properties": {
  5382. "directory": {
  5383. "type": "string"
  5384. },
  5385. "events": {
  5386. "minItems": 1,
  5387. "type": "array",
  5388. "items": {
  5389. "type": "object",
  5390. "properties": {
  5391. "id": {
  5392. "type": "string"
  5393. },
  5394. "aggregateID": {
  5395. "type": "string"
  5396. },
  5397. "seq": {
  5398. "type": "integer",
  5399. "minimum": 0,
  5400. "maximum": 9007199254740991
  5401. },
  5402. "type": {
  5403. "type": "string"
  5404. },
  5405. "data": {
  5406. "type": "object",
  5407. "propertyNames": {
  5408. "type": "string"
  5409. },
  5410. "additionalProperties": {}
  5411. }
  5412. },
  5413. "required": ["id", "aggregateID", "seq", "type", "data"]
  5414. }
  5415. }
  5416. },
  5417. "required": ["directory", "events"]
  5418. }
  5419. }
  5420. }
  5421. },
  5422. "x-codeSamples": [
  5423. {
  5424. "lang": "js",
  5425. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  5426. }
  5427. ]
  5428. }
  5429. },
  5430. "/sync/history": {
  5431. "post": {
  5432. "operationId": "sync.history.list",
  5433. "parameters": [
  5434. {
  5435. "in": "query",
  5436. "name": "directory",
  5437. "schema": {
  5438. "type": "string"
  5439. }
  5440. },
  5441. {
  5442. "in": "query",
  5443. "name": "workspace",
  5444. "schema": {
  5445. "type": "string"
  5446. }
  5447. }
  5448. ],
  5449. "summary": "List sync events",
  5450. "description": "List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.",
  5451. "responses": {
  5452. "200": {
  5453. "description": "Sync events",
  5454. "content": {
  5455. "application/json": {
  5456. "schema": {
  5457. "type": "array",
  5458. "items": {
  5459. "type": "object",
  5460. "properties": {
  5461. "id": {
  5462. "type": "string"
  5463. },
  5464. "aggregate_id": {
  5465. "type": "string"
  5466. },
  5467. "seq": {
  5468. "type": "number"
  5469. },
  5470. "type": {
  5471. "type": "string"
  5472. },
  5473. "data": {
  5474. "type": "object",
  5475. "propertyNames": {
  5476. "type": "string"
  5477. },
  5478. "additionalProperties": {}
  5479. }
  5480. },
  5481. "required": ["id", "aggregate_id", "seq", "type", "data"]
  5482. }
  5483. }
  5484. }
  5485. }
  5486. },
  5487. "400": {
  5488. "description": "Bad request",
  5489. "content": {
  5490. "application/json": {
  5491. "schema": {
  5492. "$ref": "#/components/schemas/BadRequestError"
  5493. }
  5494. }
  5495. }
  5496. }
  5497. },
  5498. "requestBody": {
  5499. "content": {
  5500. "application/json": {
  5501. "schema": {
  5502. "type": "object",
  5503. "propertyNames": {
  5504. "type": "string"
  5505. },
  5506. "additionalProperties": {
  5507. "type": "integer",
  5508. "minimum": 0,
  5509. "maximum": 9007199254740991
  5510. }
  5511. }
  5512. }
  5513. }
  5514. },
  5515. "x-codeSamples": [
  5516. {
  5517. "lang": "js",
  5518. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  5519. }
  5520. ]
  5521. }
  5522. },
  5523. "/find": {
  5524. "get": {
  5525. "operationId": "find.text",
  5526. "parameters": [
  5527. {
  5528. "in": "query",
  5529. "name": "directory",
  5530. "schema": {
  5531. "type": "string"
  5532. }
  5533. },
  5534. {
  5535. "in": "query",
  5536. "name": "workspace",
  5537. "schema": {
  5538. "type": "string"
  5539. }
  5540. },
  5541. {
  5542. "in": "query",
  5543. "name": "pattern",
  5544. "schema": {
  5545. "type": "string"
  5546. },
  5547. "required": true
  5548. }
  5549. ],
  5550. "summary": "Find text",
  5551. "description": "Search for text patterns across files in the project using ripgrep.",
  5552. "responses": {
  5553. "200": {
  5554. "description": "Matches",
  5555. "content": {
  5556. "application/json": {
  5557. "schema": {
  5558. "type": "array",
  5559. "items": {
  5560. "type": "object",
  5561. "properties": {
  5562. "path": {
  5563. "type": "object",
  5564. "properties": {
  5565. "text": {
  5566. "type": "string"
  5567. }
  5568. },
  5569. "required": ["text"]
  5570. },
  5571. "lines": {
  5572. "type": "object",
  5573. "properties": {
  5574. "text": {
  5575. "type": "string"
  5576. }
  5577. },
  5578. "required": ["text"]
  5579. },
  5580. "line_number": {
  5581. "type": "number"
  5582. },
  5583. "absolute_offset": {
  5584. "type": "number"
  5585. },
  5586. "submatches": {
  5587. "type": "array",
  5588. "items": {
  5589. "type": "object",
  5590. "properties": {
  5591. "match": {
  5592. "type": "object",
  5593. "properties": {
  5594. "text": {
  5595. "type": "string"
  5596. }
  5597. },
  5598. "required": ["text"]
  5599. },
  5600. "start": {
  5601. "type": "number"
  5602. },
  5603. "end": {
  5604. "type": "number"
  5605. }
  5606. },
  5607. "required": ["match", "start", "end"]
  5608. }
  5609. }
  5610. },
  5611. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  5612. }
  5613. }
  5614. }
  5615. }
  5616. }
  5617. },
  5618. "x-codeSamples": [
  5619. {
  5620. "lang": "js",
  5621. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  5622. }
  5623. ]
  5624. }
  5625. },
  5626. "/find/file": {
  5627. "get": {
  5628. "operationId": "find.files",
  5629. "parameters": [
  5630. {
  5631. "in": "query",
  5632. "name": "directory",
  5633. "schema": {
  5634. "type": "string"
  5635. }
  5636. },
  5637. {
  5638. "in": "query",
  5639. "name": "workspace",
  5640. "schema": {
  5641. "type": "string"
  5642. }
  5643. },
  5644. {
  5645. "in": "query",
  5646. "name": "query",
  5647. "schema": {
  5648. "type": "string"
  5649. },
  5650. "required": true
  5651. },
  5652. {
  5653. "in": "query",
  5654. "name": "dirs",
  5655. "schema": {
  5656. "type": "string",
  5657. "enum": ["true", "false"]
  5658. }
  5659. },
  5660. {
  5661. "in": "query",
  5662. "name": "type",
  5663. "schema": {
  5664. "type": "string",
  5665. "enum": ["file", "directory"]
  5666. }
  5667. },
  5668. {
  5669. "in": "query",
  5670. "name": "limit",
  5671. "schema": {
  5672. "type": "integer",
  5673. "minimum": 1,
  5674. "maximum": 200
  5675. }
  5676. }
  5677. ],
  5678. "summary": "Find files",
  5679. "description": "Search for files or directories by name or pattern in the project directory.",
  5680. "responses": {
  5681. "200": {
  5682. "description": "File paths",
  5683. "content": {
  5684. "application/json": {
  5685. "schema": {
  5686. "type": "array",
  5687. "items": {
  5688. "type": "string"
  5689. }
  5690. }
  5691. }
  5692. }
  5693. }
  5694. },
  5695. "x-codeSamples": [
  5696. {
  5697. "lang": "js",
  5698. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  5699. }
  5700. ]
  5701. }
  5702. },
  5703. "/find/symbol": {
  5704. "get": {
  5705. "operationId": "find.symbols",
  5706. "parameters": [
  5707. {
  5708. "in": "query",
  5709. "name": "directory",
  5710. "schema": {
  5711. "type": "string"
  5712. }
  5713. },
  5714. {
  5715. "in": "query",
  5716. "name": "workspace",
  5717. "schema": {
  5718. "type": "string"
  5719. }
  5720. },
  5721. {
  5722. "in": "query",
  5723. "name": "query",
  5724. "schema": {
  5725. "type": "string"
  5726. },
  5727. "required": true
  5728. }
  5729. ],
  5730. "summary": "Find symbols",
  5731. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  5732. "responses": {
  5733. "200": {
  5734. "description": "Symbols",
  5735. "content": {
  5736. "application/json": {
  5737. "schema": {
  5738. "type": "array",
  5739. "items": {
  5740. "$ref": "#/components/schemas/Symbol"
  5741. }
  5742. }
  5743. }
  5744. }
  5745. }
  5746. },
  5747. "x-codeSamples": [
  5748. {
  5749. "lang": "js",
  5750. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  5751. }
  5752. ]
  5753. }
  5754. },
  5755. "/file": {
  5756. "get": {
  5757. "operationId": "file.list",
  5758. "parameters": [
  5759. {
  5760. "in": "query",
  5761. "name": "directory",
  5762. "schema": {
  5763. "type": "string"
  5764. }
  5765. },
  5766. {
  5767. "in": "query",
  5768. "name": "workspace",
  5769. "schema": {
  5770. "type": "string"
  5771. }
  5772. },
  5773. {
  5774. "in": "query",
  5775. "name": "path",
  5776. "schema": {
  5777. "type": "string"
  5778. },
  5779. "required": true
  5780. }
  5781. ],
  5782. "summary": "List files",
  5783. "description": "List files and directories in a specified path.",
  5784. "responses": {
  5785. "200": {
  5786. "description": "Files and directories",
  5787. "content": {
  5788. "application/json": {
  5789. "schema": {
  5790. "type": "array",
  5791. "items": {
  5792. "$ref": "#/components/schemas/FileNode"
  5793. }
  5794. }
  5795. }
  5796. }
  5797. }
  5798. },
  5799. "x-codeSamples": [
  5800. {
  5801. "lang": "js",
  5802. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  5803. }
  5804. ]
  5805. }
  5806. },
  5807. "/file/content": {
  5808. "get": {
  5809. "operationId": "file.read",
  5810. "parameters": [
  5811. {
  5812. "in": "query",
  5813. "name": "directory",
  5814. "schema": {
  5815. "type": "string"
  5816. }
  5817. },
  5818. {
  5819. "in": "query",
  5820. "name": "workspace",
  5821. "schema": {
  5822. "type": "string"
  5823. }
  5824. },
  5825. {
  5826. "in": "query",
  5827. "name": "path",
  5828. "schema": {
  5829. "type": "string"
  5830. },
  5831. "required": true
  5832. }
  5833. ],
  5834. "summary": "Read file",
  5835. "description": "Read the content of a specified file.",
  5836. "responses": {
  5837. "200": {
  5838. "description": "File content",
  5839. "content": {
  5840. "application/json": {
  5841. "schema": {
  5842. "$ref": "#/components/schemas/FileContent"
  5843. }
  5844. }
  5845. }
  5846. }
  5847. },
  5848. "x-codeSamples": [
  5849. {
  5850. "lang": "js",
  5851. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  5852. }
  5853. ]
  5854. }
  5855. },
  5856. "/file/status": {
  5857. "get": {
  5858. "operationId": "file.status",
  5859. "parameters": [
  5860. {
  5861. "in": "query",
  5862. "name": "directory",
  5863. "schema": {
  5864. "type": "string"
  5865. }
  5866. },
  5867. {
  5868. "in": "query",
  5869. "name": "workspace",
  5870. "schema": {
  5871. "type": "string"
  5872. }
  5873. }
  5874. ],
  5875. "summary": "Get file status",
  5876. "description": "Get the git status of all files in the project.",
  5877. "responses": {
  5878. "200": {
  5879. "description": "File status",
  5880. "content": {
  5881. "application/json": {
  5882. "schema": {
  5883. "type": "array",
  5884. "items": {
  5885. "$ref": "#/components/schemas/File"
  5886. }
  5887. }
  5888. }
  5889. }
  5890. }
  5891. },
  5892. "x-codeSamples": [
  5893. {
  5894. "lang": "js",
  5895. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  5896. }
  5897. ]
  5898. }
  5899. },
  5900. "/event": {
  5901. "get": {
  5902. "operationId": "event.subscribe",
  5903. "parameters": [
  5904. {
  5905. "in": "query",
  5906. "name": "directory",
  5907. "schema": {
  5908. "type": "string"
  5909. }
  5910. },
  5911. {
  5912. "in": "query",
  5913. "name": "workspace",
  5914. "schema": {
  5915. "type": "string"
  5916. }
  5917. }
  5918. ],
  5919. "summary": "Subscribe to events",
  5920. "description": "Get events",
  5921. "responses": {
  5922. "200": {
  5923. "description": "Event stream",
  5924. "content": {
  5925. "text/event-stream": {
  5926. "schema": {
  5927. "$ref": "#/components/schemas/Event"
  5928. }
  5929. }
  5930. }
  5931. }
  5932. },
  5933. "x-codeSamples": [
  5934. {
  5935. "lang": "js",
  5936. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5937. }
  5938. ]
  5939. }
  5940. },
  5941. "/mcp": {
  5942. "get": {
  5943. "operationId": "mcp.status",
  5944. "parameters": [
  5945. {
  5946. "in": "query",
  5947. "name": "directory",
  5948. "schema": {
  5949. "type": "string"
  5950. }
  5951. },
  5952. {
  5953. "in": "query",
  5954. "name": "workspace",
  5955. "schema": {
  5956. "type": "string"
  5957. }
  5958. }
  5959. ],
  5960. "summary": "Get MCP status",
  5961. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  5962. "responses": {
  5963. "200": {
  5964. "description": "MCP server status",
  5965. "content": {
  5966. "application/json": {
  5967. "schema": {
  5968. "type": "object",
  5969. "propertyNames": {
  5970. "type": "string"
  5971. },
  5972. "additionalProperties": {
  5973. "$ref": "#/components/schemas/MCPStatus"
  5974. }
  5975. }
  5976. }
  5977. }
  5978. }
  5979. },
  5980. "x-codeSamples": [
  5981. {
  5982. "lang": "js",
  5983. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  5984. }
  5985. ]
  5986. },
  5987. "post": {
  5988. "operationId": "mcp.add",
  5989. "parameters": [
  5990. {
  5991. "in": "query",
  5992. "name": "directory",
  5993. "schema": {
  5994. "type": "string"
  5995. }
  5996. },
  5997. {
  5998. "in": "query",
  5999. "name": "workspace",
  6000. "schema": {
  6001. "type": "string"
  6002. }
  6003. }
  6004. ],
  6005. "summary": "Add MCP server",
  6006. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  6007. "responses": {
  6008. "200": {
  6009. "description": "MCP server added successfully",
  6010. "content": {
  6011. "application/json": {
  6012. "schema": {
  6013. "type": "object",
  6014. "propertyNames": {
  6015. "type": "string"
  6016. },
  6017. "additionalProperties": {
  6018. "$ref": "#/components/schemas/MCPStatus"
  6019. }
  6020. }
  6021. }
  6022. }
  6023. },
  6024. "400": {
  6025. "description": "Bad request",
  6026. "content": {
  6027. "application/json": {
  6028. "schema": {
  6029. "$ref": "#/components/schemas/BadRequestError"
  6030. }
  6031. }
  6032. }
  6033. }
  6034. },
  6035. "requestBody": {
  6036. "content": {
  6037. "application/json": {
  6038. "schema": {
  6039. "type": "object",
  6040. "properties": {
  6041. "name": {
  6042. "type": "string"
  6043. },
  6044. "config": {
  6045. "anyOf": [
  6046. {
  6047. "$ref": "#/components/schemas/McpLocalConfig"
  6048. },
  6049. {
  6050. "$ref": "#/components/schemas/McpRemoteConfig"
  6051. }
  6052. ]
  6053. }
  6054. },
  6055. "required": ["name", "config"]
  6056. }
  6057. }
  6058. }
  6059. },
  6060. "x-codeSamples": [
  6061. {
  6062. "lang": "js",
  6063. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  6064. }
  6065. ]
  6066. }
  6067. },
  6068. "/mcp/{name}/auth": {
  6069. "post": {
  6070. "operationId": "mcp.auth.start",
  6071. "parameters": [
  6072. {
  6073. "in": "query",
  6074. "name": "directory",
  6075. "schema": {
  6076. "type": "string"
  6077. }
  6078. },
  6079. {
  6080. "in": "query",
  6081. "name": "workspace",
  6082. "schema": {
  6083. "type": "string"
  6084. }
  6085. },
  6086. {
  6087. "schema": {
  6088. "type": "string"
  6089. },
  6090. "in": "path",
  6091. "name": "name",
  6092. "required": true
  6093. }
  6094. ],
  6095. "summary": "Start MCP OAuth",
  6096. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  6097. "responses": {
  6098. "200": {
  6099. "description": "OAuth flow started",
  6100. "content": {
  6101. "application/json": {
  6102. "schema": {
  6103. "type": "object",
  6104. "properties": {
  6105. "authorizationUrl": {
  6106. "description": "URL to open in browser for authorization",
  6107. "type": "string"
  6108. }
  6109. },
  6110. "required": ["authorizationUrl"]
  6111. }
  6112. }
  6113. }
  6114. },
  6115. "400": {
  6116. "description": "MCP server does not support OAuth",
  6117. "content": {
  6118. "application/json": {
  6119. "schema": {
  6120. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  6121. }
  6122. }
  6123. }
  6124. },
  6125. "404": {
  6126. "description": "Not found",
  6127. "content": {
  6128. "application/json": {
  6129. "schema": {
  6130. "$ref": "#/components/schemas/NotFoundError"
  6131. }
  6132. }
  6133. }
  6134. }
  6135. },
  6136. "x-codeSamples": [
  6137. {
  6138. "lang": "js",
  6139. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  6140. }
  6141. ]
  6142. },
  6143. "delete": {
  6144. "operationId": "mcp.auth.remove",
  6145. "parameters": [
  6146. {
  6147. "in": "query",
  6148. "name": "directory",
  6149. "schema": {
  6150. "type": "string"
  6151. }
  6152. },
  6153. {
  6154. "in": "query",
  6155. "name": "workspace",
  6156. "schema": {
  6157. "type": "string"
  6158. }
  6159. },
  6160. {
  6161. "schema": {
  6162. "type": "string"
  6163. },
  6164. "in": "path",
  6165. "name": "name",
  6166. "required": true
  6167. }
  6168. ],
  6169. "summary": "Remove MCP OAuth",
  6170. "description": "Remove OAuth credentials for an MCP server",
  6171. "responses": {
  6172. "200": {
  6173. "description": "OAuth credentials removed",
  6174. "content": {
  6175. "application/json": {
  6176. "schema": {
  6177. "type": "object",
  6178. "properties": {
  6179. "success": {
  6180. "type": "boolean",
  6181. "const": true
  6182. }
  6183. },
  6184. "required": ["success"]
  6185. }
  6186. }
  6187. }
  6188. },
  6189. "404": {
  6190. "description": "Not found",
  6191. "content": {
  6192. "application/json": {
  6193. "schema": {
  6194. "$ref": "#/components/schemas/NotFoundError"
  6195. }
  6196. }
  6197. }
  6198. }
  6199. },
  6200. "x-codeSamples": [
  6201. {
  6202. "lang": "js",
  6203. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  6204. }
  6205. ]
  6206. }
  6207. },
  6208. "/mcp/{name}/auth/callback": {
  6209. "post": {
  6210. "operationId": "mcp.auth.callback",
  6211. "parameters": [
  6212. {
  6213. "in": "query",
  6214. "name": "directory",
  6215. "schema": {
  6216. "type": "string"
  6217. }
  6218. },
  6219. {
  6220. "in": "query",
  6221. "name": "workspace",
  6222. "schema": {
  6223. "type": "string"
  6224. }
  6225. },
  6226. {
  6227. "schema": {
  6228. "type": "string"
  6229. },
  6230. "in": "path",
  6231. "name": "name",
  6232. "required": true
  6233. }
  6234. ],
  6235. "summary": "Complete MCP OAuth",
  6236. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  6237. "responses": {
  6238. "200": {
  6239. "description": "OAuth authentication completed",
  6240. "content": {
  6241. "application/json": {
  6242. "schema": {
  6243. "$ref": "#/components/schemas/MCPStatus"
  6244. }
  6245. }
  6246. }
  6247. },
  6248. "400": {
  6249. "description": "Bad request",
  6250. "content": {
  6251. "application/json": {
  6252. "schema": {
  6253. "$ref": "#/components/schemas/BadRequestError"
  6254. }
  6255. }
  6256. }
  6257. },
  6258. "404": {
  6259. "description": "Not found",
  6260. "content": {
  6261. "application/json": {
  6262. "schema": {
  6263. "$ref": "#/components/schemas/NotFoundError"
  6264. }
  6265. }
  6266. }
  6267. }
  6268. },
  6269. "requestBody": {
  6270. "content": {
  6271. "application/json": {
  6272. "schema": {
  6273. "type": "object",
  6274. "properties": {
  6275. "code": {
  6276. "description": "Authorization code from OAuth callback",
  6277. "type": "string"
  6278. }
  6279. },
  6280. "required": ["code"]
  6281. }
  6282. }
  6283. }
  6284. },
  6285. "x-codeSamples": [
  6286. {
  6287. "lang": "js",
  6288. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  6289. }
  6290. ]
  6291. }
  6292. },
  6293. "/mcp/{name}/auth/authenticate": {
  6294. "post": {
  6295. "operationId": "mcp.auth.authenticate",
  6296. "parameters": [
  6297. {
  6298. "in": "query",
  6299. "name": "directory",
  6300. "schema": {
  6301. "type": "string"
  6302. }
  6303. },
  6304. {
  6305. "in": "query",
  6306. "name": "workspace",
  6307. "schema": {
  6308. "type": "string"
  6309. }
  6310. },
  6311. {
  6312. "schema": {
  6313. "type": "string"
  6314. },
  6315. "in": "path",
  6316. "name": "name",
  6317. "required": true
  6318. }
  6319. ],
  6320. "summary": "Authenticate MCP OAuth",
  6321. "description": "Start OAuth flow and wait for callback (opens browser)",
  6322. "responses": {
  6323. "200": {
  6324. "description": "OAuth authentication completed",
  6325. "content": {
  6326. "application/json": {
  6327. "schema": {
  6328. "$ref": "#/components/schemas/MCPStatus"
  6329. }
  6330. }
  6331. }
  6332. },
  6333. "400": {
  6334. "description": "MCP server does not support OAuth",
  6335. "content": {
  6336. "application/json": {
  6337. "schema": {
  6338. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  6339. }
  6340. }
  6341. }
  6342. },
  6343. "404": {
  6344. "description": "Not found",
  6345. "content": {
  6346. "application/json": {
  6347. "schema": {
  6348. "$ref": "#/components/schemas/NotFoundError"
  6349. }
  6350. }
  6351. }
  6352. }
  6353. },
  6354. "x-codeSamples": [
  6355. {
  6356. "lang": "js",
  6357. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  6358. }
  6359. ]
  6360. }
  6361. },
  6362. "/mcp/{name}/connect": {
  6363. "post": {
  6364. "operationId": "mcp.connect",
  6365. "parameters": [
  6366. {
  6367. "in": "query",
  6368. "name": "directory",
  6369. "schema": {
  6370. "type": "string"
  6371. }
  6372. },
  6373. {
  6374. "in": "query",
  6375. "name": "workspace",
  6376. "schema": {
  6377. "type": "string"
  6378. }
  6379. },
  6380. {
  6381. "in": "path",
  6382. "name": "name",
  6383. "schema": {
  6384. "type": "string"
  6385. },
  6386. "required": true
  6387. }
  6388. ],
  6389. "description": "Connect an MCP server",
  6390. "responses": {
  6391. "200": {
  6392. "description": "MCP server connected successfully",
  6393. "content": {
  6394. "application/json": {
  6395. "schema": {
  6396. "type": "boolean"
  6397. }
  6398. }
  6399. }
  6400. }
  6401. },
  6402. "x-codeSamples": [
  6403. {
  6404. "lang": "js",
  6405. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  6406. }
  6407. ]
  6408. }
  6409. },
  6410. "/mcp/{name}/disconnect": {
  6411. "post": {
  6412. "operationId": "mcp.disconnect",
  6413. "parameters": [
  6414. {
  6415. "in": "query",
  6416. "name": "directory",
  6417. "schema": {
  6418. "type": "string"
  6419. }
  6420. },
  6421. {
  6422. "in": "query",
  6423. "name": "workspace",
  6424. "schema": {
  6425. "type": "string"
  6426. }
  6427. },
  6428. {
  6429. "in": "path",
  6430. "name": "name",
  6431. "schema": {
  6432. "type": "string"
  6433. },
  6434. "required": true
  6435. }
  6436. ],
  6437. "description": "Disconnect an MCP server",
  6438. "responses": {
  6439. "200": {
  6440. "description": "MCP server disconnected successfully",
  6441. "content": {
  6442. "application/json": {
  6443. "schema": {
  6444. "type": "boolean"
  6445. }
  6446. }
  6447. }
  6448. }
  6449. },
  6450. "x-codeSamples": [
  6451. {
  6452. "lang": "js",
  6453. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  6454. }
  6455. ]
  6456. }
  6457. },
  6458. "/tui/append-prompt": {
  6459. "post": {
  6460. "operationId": "tui.appendPrompt",
  6461. "parameters": [
  6462. {
  6463. "in": "query",
  6464. "name": "directory",
  6465. "schema": {
  6466. "type": "string"
  6467. }
  6468. },
  6469. {
  6470. "in": "query",
  6471. "name": "workspace",
  6472. "schema": {
  6473. "type": "string"
  6474. }
  6475. }
  6476. ],
  6477. "summary": "Append TUI prompt",
  6478. "description": "Append prompt to the TUI",
  6479. "responses": {
  6480. "200": {
  6481. "description": "Prompt processed successfully",
  6482. "content": {
  6483. "application/json": {
  6484. "schema": {
  6485. "type": "boolean"
  6486. }
  6487. }
  6488. }
  6489. },
  6490. "400": {
  6491. "description": "Bad request",
  6492. "content": {
  6493. "application/json": {
  6494. "schema": {
  6495. "$ref": "#/components/schemas/BadRequestError"
  6496. }
  6497. }
  6498. }
  6499. }
  6500. },
  6501. "requestBody": {
  6502. "content": {
  6503. "application/json": {
  6504. "schema": {
  6505. "type": "object",
  6506. "properties": {
  6507. "text": {
  6508. "type": "string"
  6509. }
  6510. },
  6511. "required": ["text"]
  6512. }
  6513. }
  6514. }
  6515. },
  6516. "x-codeSamples": [
  6517. {
  6518. "lang": "js",
  6519. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  6520. }
  6521. ]
  6522. }
  6523. },
  6524. "/tui/open-help": {
  6525. "post": {
  6526. "operationId": "tui.openHelp",
  6527. "parameters": [
  6528. {
  6529. "in": "query",
  6530. "name": "directory",
  6531. "schema": {
  6532. "type": "string"
  6533. }
  6534. },
  6535. {
  6536. "in": "query",
  6537. "name": "workspace",
  6538. "schema": {
  6539. "type": "string"
  6540. }
  6541. }
  6542. ],
  6543. "summary": "Open help dialog",
  6544. "description": "Open the help dialog in the TUI to display user assistance information.",
  6545. "responses": {
  6546. "200": {
  6547. "description": "Help dialog opened successfully",
  6548. "content": {
  6549. "application/json": {
  6550. "schema": {
  6551. "type": "boolean"
  6552. }
  6553. }
  6554. }
  6555. }
  6556. },
  6557. "x-codeSamples": [
  6558. {
  6559. "lang": "js",
  6560. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  6561. }
  6562. ]
  6563. }
  6564. },
  6565. "/tui/open-sessions": {
  6566. "post": {
  6567. "operationId": "tui.openSessions",
  6568. "parameters": [
  6569. {
  6570. "in": "query",
  6571. "name": "directory",
  6572. "schema": {
  6573. "type": "string"
  6574. }
  6575. },
  6576. {
  6577. "in": "query",
  6578. "name": "workspace",
  6579. "schema": {
  6580. "type": "string"
  6581. }
  6582. }
  6583. ],
  6584. "summary": "Open sessions dialog",
  6585. "description": "Open the session dialog",
  6586. "responses": {
  6587. "200": {
  6588. "description": "Session dialog opened successfully",
  6589. "content": {
  6590. "application/json": {
  6591. "schema": {
  6592. "type": "boolean"
  6593. }
  6594. }
  6595. }
  6596. }
  6597. },
  6598. "x-codeSamples": [
  6599. {
  6600. "lang": "js",
  6601. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  6602. }
  6603. ]
  6604. }
  6605. },
  6606. "/tui/open-themes": {
  6607. "post": {
  6608. "operationId": "tui.openThemes",
  6609. "parameters": [
  6610. {
  6611. "in": "query",
  6612. "name": "directory",
  6613. "schema": {
  6614. "type": "string"
  6615. }
  6616. },
  6617. {
  6618. "in": "query",
  6619. "name": "workspace",
  6620. "schema": {
  6621. "type": "string"
  6622. }
  6623. }
  6624. ],
  6625. "summary": "Open themes dialog",
  6626. "description": "Open the theme dialog",
  6627. "responses": {
  6628. "200": {
  6629. "description": "Theme dialog opened successfully",
  6630. "content": {
  6631. "application/json": {
  6632. "schema": {
  6633. "type": "boolean"
  6634. }
  6635. }
  6636. }
  6637. }
  6638. },
  6639. "x-codeSamples": [
  6640. {
  6641. "lang": "js",
  6642. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  6643. }
  6644. ]
  6645. }
  6646. },
  6647. "/tui/open-models": {
  6648. "post": {
  6649. "operationId": "tui.openModels",
  6650. "parameters": [
  6651. {
  6652. "in": "query",
  6653. "name": "directory",
  6654. "schema": {
  6655. "type": "string"
  6656. }
  6657. },
  6658. {
  6659. "in": "query",
  6660. "name": "workspace",
  6661. "schema": {
  6662. "type": "string"
  6663. }
  6664. }
  6665. ],
  6666. "summary": "Open models dialog",
  6667. "description": "Open the model dialog",
  6668. "responses": {
  6669. "200": {
  6670. "description": "Model dialog opened successfully",
  6671. "content": {
  6672. "application/json": {
  6673. "schema": {
  6674. "type": "boolean"
  6675. }
  6676. }
  6677. }
  6678. }
  6679. },
  6680. "x-codeSamples": [
  6681. {
  6682. "lang": "js",
  6683. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  6684. }
  6685. ]
  6686. }
  6687. },
  6688. "/tui/submit-prompt": {
  6689. "post": {
  6690. "operationId": "tui.submitPrompt",
  6691. "parameters": [
  6692. {
  6693. "in": "query",
  6694. "name": "directory",
  6695. "schema": {
  6696. "type": "string"
  6697. }
  6698. },
  6699. {
  6700. "in": "query",
  6701. "name": "workspace",
  6702. "schema": {
  6703. "type": "string"
  6704. }
  6705. }
  6706. ],
  6707. "summary": "Submit TUI prompt",
  6708. "description": "Submit the prompt",
  6709. "responses": {
  6710. "200": {
  6711. "description": "Prompt submitted successfully",
  6712. "content": {
  6713. "application/json": {
  6714. "schema": {
  6715. "type": "boolean"
  6716. }
  6717. }
  6718. }
  6719. }
  6720. },
  6721. "x-codeSamples": [
  6722. {
  6723. "lang": "js",
  6724. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  6725. }
  6726. ]
  6727. }
  6728. },
  6729. "/tui/clear-prompt": {
  6730. "post": {
  6731. "operationId": "tui.clearPrompt",
  6732. "parameters": [
  6733. {
  6734. "in": "query",
  6735. "name": "directory",
  6736. "schema": {
  6737. "type": "string"
  6738. }
  6739. },
  6740. {
  6741. "in": "query",
  6742. "name": "workspace",
  6743. "schema": {
  6744. "type": "string"
  6745. }
  6746. }
  6747. ],
  6748. "summary": "Clear TUI prompt",
  6749. "description": "Clear the prompt",
  6750. "responses": {
  6751. "200": {
  6752. "description": "Prompt cleared successfully",
  6753. "content": {
  6754. "application/json": {
  6755. "schema": {
  6756. "type": "boolean"
  6757. }
  6758. }
  6759. }
  6760. }
  6761. },
  6762. "x-codeSamples": [
  6763. {
  6764. "lang": "js",
  6765. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  6766. }
  6767. ]
  6768. }
  6769. },
  6770. "/tui/execute-command": {
  6771. "post": {
  6772. "operationId": "tui.executeCommand",
  6773. "parameters": [
  6774. {
  6775. "in": "query",
  6776. "name": "directory",
  6777. "schema": {
  6778. "type": "string"
  6779. }
  6780. },
  6781. {
  6782. "in": "query",
  6783. "name": "workspace",
  6784. "schema": {
  6785. "type": "string"
  6786. }
  6787. }
  6788. ],
  6789. "summary": "Execute TUI command",
  6790. "description": "Execute a TUI command (e.g. agent_cycle)",
  6791. "responses": {
  6792. "200": {
  6793. "description": "Command executed successfully",
  6794. "content": {
  6795. "application/json": {
  6796. "schema": {
  6797. "type": "boolean"
  6798. }
  6799. }
  6800. }
  6801. },
  6802. "400": {
  6803. "description": "Bad request",
  6804. "content": {
  6805. "application/json": {
  6806. "schema": {
  6807. "$ref": "#/components/schemas/BadRequestError"
  6808. }
  6809. }
  6810. }
  6811. }
  6812. },
  6813. "requestBody": {
  6814. "content": {
  6815. "application/json": {
  6816. "schema": {
  6817. "type": "object",
  6818. "properties": {
  6819. "command": {
  6820. "type": "string"
  6821. }
  6822. },
  6823. "required": ["command"]
  6824. }
  6825. }
  6826. }
  6827. },
  6828. "x-codeSamples": [
  6829. {
  6830. "lang": "js",
  6831. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  6832. }
  6833. ]
  6834. }
  6835. },
  6836. "/tui/show-toast": {
  6837. "post": {
  6838. "operationId": "tui.showToast",
  6839. "parameters": [
  6840. {
  6841. "in": "query",
  6842. "name": "directory",
  6843. "schema": {
  6844. "type": "string"
  6845. }
  6846. },
  6847. {
  6848. "in": "query",
  6849. "name": "workspace",
  6850. "schema": {
  6851. "type": "string"
  6852. }
  6853. }
  6854. ],
  6855. "summary": "Show TUI toast",
  6856. "description": "Show a toast notification in the TUI",
  6857. "responses": {
  6858. "200": {
  6859. "description": "Toast notification shown successfully",
  6860. "content": {
  6861. "application/json": {
  6862. "schema": {
  6863. "type": "boolean"
  6864. }
  6865. }
  6866. }
  6867. }
  6868. },
  6869. "requestBody": {
  6870. "content": {
  6871. "application/json": {
  6872. "schema": {
  6873. "type": "object",
  6874. "properties": {
  6875. "title": {
  6876. "type": "string"
  6877. },
  6878. "message": {
  6879. "type": "string"
  6880. },
  6881. "variant": {
  6882. "type": "string",
  6883. "enum": ["info", "success", "warning", "error"]
  6884. },
  6885. "duration": {
  6886. "description": "Duration in milliseconds",
  6887. "type": "number"
  6888. }
  6889. },
  6890. "required": ["message", "variant"]
  6891. }
  6892. }
  6893. }
  6894. },
  6895. "x-codeSamples": [
  6896. {
  6897. "lang": "js",
  6898. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  6899. }
  6900. ]
  6901. }
  6902. },
  6903. "/tui/publish": {
  6904. "post": {
  6905. "operationId": "tui.publish",
  6906. "parameters": [
  6907. {
  6908. "in": "query",
  6909. "name": "directory",
  6910. "schema": {
  6911. "type": "string"
  6912. }
  6913. },
  6914. {
  6915. "in": "query",
  6916. "name": "workspace",
  6917. "schema": {
  6918. "type": "string"
  6919. }
  6920. }
  6921. ],
  6922. "summary": "Publish TUI event",
  6923. "description": "Publish a TUI event",
  6924. "responses": {
  6925. "200": {
  6926. "description": "Event published successfully",
  6927. "content": {
  6928. "application/json": {
  6929. "schema": {
  6930. "type": "boolean"
  6931. }
  6932. }
  6933. }
  6934. },
  6935. "400": {
  6936. "description": "Bad request",
  6937. "content": {
  6938. "application/json": {
  6939. "schema": {
  6940. "$ref": "#/components/schemas/BadRequestError"
  6941. }
  6942. }
  6943. }
  6944. }
  6945. },
  6946. "requestBody": {
  6947. "content": {
  6948. "application/json": {
  6949. "schema": {
  6950. "anyOf": [
  6951. {
  6952. "$ref": "#/components/schemas/Event.tui.prompt.append"
  6953. },
  6954. {
  6955. "$ref": "#/components/schemas/Event.tui.command.execute"
  6956. },
  6957. {
  6958. "$ref": "#/components/schemas/Event.tui.toast.show"
  6959. },
  6960. {
  6961. "$ref": "#/components/schemas/Event.tui.session.select"
  6962. }
  6963. ]
  6964. }
  6965. }
  6966. }
  6967. },
  6968. "x-codeSamples": [
  6969. {
  6970. "lang": "js",
  6971. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  6972. }
  6973. ]
  6974. }
  6975. },
  6976. "/tui/select-session": {
  6977. "post": {
  6978. "operationId": "tui.selectSession",
  6979. "parameters": [
  6980. {
  6981. "in": "query",
  6982. "name": "directory",
  6983. "schema": {
  6984. "type": "string"
  6985. }
  6986. },
  6987. {
  6988. "in": "query",
  6989. "name": "workspace",
  6990. "schema": {
  6991. "type": "string"
  6992. }
  6993. }
  6994. ],
  6995. "summary": "Select session",
  6996. "description": "Navigate the TUI to display the specified session.",
  6997. "responses": {
  6998. "200": {
  6999. "description": "Session selected successfully",
  7000. "content": {
  7001. "application/json": {
  7002. "schema": {
  7003. "type": "boolean"
  7004. }
  7005. }
  7006. }
  7007. },
  7008. "400": {
  7009. "description": "Bad request",
  7010. "content": {
  7011. "application/json": {
  7012. "schema": {
  7013. "$ref": "#/components/schemas/BadRequestError"
  7014. }
  7015. }
  7016. }
  7017. },
  7018. "404": {
  7019. "description": "Not found",
  7020. "content": {
  7021. "application/json": {
  7022. "schema": {
  7023. "$ref": "#/components/schemas/NotFoundError"
  7024. }
  7025. }
  7026. }
  7027. }
  7028. },
  7029. "requestBody": {
  7030. "content": {
  7031. "application/json": {
  7032. "schema": {
  7033. "type": "object",
  7034. "properties": {
  7035. "sessionID": {
  7036. "description": "Session ID to navigate to",
  7037. "type": "string",
  7038. "pattern": "^ses.*"
  7039. }
  7040. },
  7041. "required": ["sessionID"]
  7042. }
  7043. }
  7044. }
  7045. },
  7046. "x-codeSamples": [
  7047. {
  7048. "lang": "js",
  7049. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  7050. }
  7051. ]
  7052. }
  7053. },
  7054. "/tui/control/next": {
  7055. "get": {
  7056. "operationId": "tui.control.next",
  7057. "parameters": [
  7058. {
  7059. "in": "query",
  7060. "name": "directory",
  7061. "schema": {
  7062. "type": "string"
  7063. }
  7064. },
  7065. {
  7066. "in": "query",
  7067. "name": "workspace",
  7068. "schema": {
  7069. "type": "string"
  7070. }
  7071. }
  7072. ],
  7073. "summary": "Get next TUI request",
  7074. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  7075. "responses": {
  7076. "200": {
  7077. "description": "Next TUI request",
  7078. "content": {
  7079. "application/json": {
  7080. "schema": {
  7081. "type": "object",
  7082. "properties": {
  7083. "path": {
  7084. "type": "string"
  7085. },
  7086. "body": {}
  7087. },
  7088. "required": ["path", "body"]
  7089. }
  7090. }
  7091. }
  7092. }
  7093. },
  7094. "x-codeSamples": [
  7095. {
  7096. "lang": "js",
  7097. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  7098. }
  7099. ]
  7100. }
  7101. },
  7102. "/tui/control/response": {
  7103. "post": {
  7104. "operationId": "tui.control.response",
  7105. "parameters": [
  7106. {
  7107. "in": "query",
  7108. "name": "directory",
  7109. "schema": {
  7110. "type": "string"
  7111. }
  7112. },
  7113. {
  7114. "in": "query",
  7115. "name": "workspace",
  7116. "schema": {
  7117. "type": "string"
  7118. }
  7119. }
  7120. ],
  7121. "summary": "Submit TUI response",
  7122. "description": "Submit a response to the TUI request queue to complete a pending request.",
  7123. "responses": {
  7124. "200": {
  7125. "description": "Response submitted successfully",
  7126. "content": {
  7127. "application/json": {
  7128. "schema": {
  7129. "type": "boolean"
  7130. }
  7131. }
  7132. }
  7133. }
  7134. },
  7135. "requestBody": {
  7136. "content": {
  7137. "application/json": {
  7138. "schema": {}
  7139. }
  7140. }
  7141. },
  7142. "x-codeSamples": [
  7143. {
  7144. "lang": "js",
  7145. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  7146. }
  7147. ]
  7148. }
  7149. },
  7150. "/instance/dispose": {
  7151. "post": {
  7152. "operationId": "instance.dispose",
  7153. "parameters": [
  7154. {
  7155. "in": "query",
  7156. "name": "directory",
  7157. "schema": {
  7158. "type": "string"
  7159. }
  7160. },
  7161. {
  7162. "in": "query",
  7163. "name": "workspace",
  7164. "schema": {
  7165. "type": "string"
  7166. }
  7167. }
  7168. ],
  7169. "summary": "Dispose instance",
  7170. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  7171. "responses": {
  7172. "200": {
  7173. "description": "Instance disposed",
  7174. "content": {
  7175. "application/json": {
  7176. "schema": {
  7177. "type": "boolean"
  7178. }
  7179. }
  7180. }
  7181. }
  7182. },
  7183. "x-codeSamples": [
  7184. {
  7185. "lang": "js",
  7186. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  7187. }
  7188. ]
  7189. }
  7190. },
  7191. "/path": {
  7192. "get": {
  7193. "operationId": "path.get",
  7194. "parameters": [
  7195. {
  7196. "in": "query",
  7197. "name": "directory",
  7198. "schema": {
  7199. "type": "string"
  7200. }
  7201. },
  7202. {
  7203. "in": "query",
  7204. "name": "workspace",
  7205. "schema": {
  7206. "type": "string"
  7207. }
  7208. }
  7209. ],
  7210. "summary": "Get paths",
  7211. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  7212. "responses": {
  7213. "200": {
  7214. "description": "Path",
  7215. "content": {
  7216. "application/json": {
  7217. "schema": {
  7218. "$ref": "#/components/schemas/Path"
  7219. }
  7220. }
  7221. }
  7222. }
  7223. },
  7224. "x-codeSamples": [
  7225. {
  7226. "lang": "js",
  7227. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  7228. }
  7229. ]
  7230. }
  7231. },
  7232. "/vcs": {
  7233. "get": {
  7234. "operationId": "vcs.get",
  7235. "parameters": [
  7236. {
  7237. "in": "query",
  7238. "name": "directory",
  7239. "schema": {
  7240. "type": "string"
  7241. }
  7242. },
  7243. {
  7244. "in": "query",
  7245. "name": "workspace",
  7246. "schema": {
  7247. "type": "string"
  7248. }
  7249. }
  7250. ],
  7251. "summary": "Get VCS info",
  7252. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  7253. "responses": {
  7254. "200": {
  7255. "description": "VCS info",
  7256. "content": {
  7257. "application/json": {
  7258. "schema": {
  7259. "$ref": "#/components/schemas/VcsInfo"
  7260. }
  7261. }
  7262. }
  7263. }
  7264. },
  7265. "x-codeSamples": [
  7266. {
  7267. "lang": "js",
  7268. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  7269. }
  7270. ]
  7271. }
  7272. },
  7273. "/vcs/diff": {
  7274. "get": {
  7275. "operationId": "vcs.diff",
  7276. "parameters": [
  7277. {
  7278. "in": "query",
  7279. "name": "directory",
  7280. "schema": {
  7281. "type": "string"
  7282. }
  7283. },
  7284. {
  7285. "in": "query",
  7286. "name": "workspace",
  7287. "schema": {
  7288. "type": "string"
  7289. }
  7290. },
  7291. {
  7292. "in": "query",
  7293. "name": "mode",
  7294. "schema": {
  7295. "type": "string",
  7296. "enum": ["git", "branch"]
  7297. },
  7298. "required": true
  7299. }
  7300. ],
  7301. "summary": "Get VCS diff",
  7302. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  7303. "responses": {
  7304. "200": {
  7305. "description": "VCS diff",
  7306. "content": {
  7307. "application/json": {
  7308. "schema": {
  7309. "type": "array",
  7310. "items": {
  7311. "$ref": "#/components/schemas/VcsFileDiff"
  7312. }
  7313. }
  7314. }
  7315. }
  7316. }
  7317. },
  7318. "x-codeSamples": [
  7319. {
  7320. "lang": "js",
  7321. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  7322. }
  7323. ]
  7324. }
  7325. },
  7326. "/command": {
  7327. "get": {
  7328. "operationId": "command.list",
  7329. "parameters": [
  7330. {
  7331. "in": "query",
  7332. "name": "directory",
  7333. "schema": {
  7334. "type": "string"
  7335. }
  7336. },
  7337. {
  7338. "in": "query",
  7339. "name": "workspace",
  7340. "schema": {
  7341. "type": "string"
  7342. }
  7343. }
  7344. ],
  7345. "summary": "List commands",
  7346. "description": "Get a list of all available commands in the OpenCode system.",
  7347. "responses": {
  7348. "200": {
  7349. "description": "List of commands",
  7350. "content": {
  7351. "application/json": {
  7352. "schema": {
  7353. "type": "array",
  7354. "items": {
  7355. "$ref": "#/components/schemas/Command"
  7356. }
  7357. }
  7358. }
  7359. }
  7360. }
  7361. },
  7362. "x-codeSamples": [
  7363. {
  7364. "lang": "js",
  7365. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  7366. }
  7367. ]
  7368. }
  7369. },
  7370. "/agent": {
  7371. "get": {
  7372. "operationId": "app.agents",
  7373. "parameters": [
  7374. {
  7375. "in": "query",
  7376. "name": "directory",
  7377. "schema": {
  7378. "type": "string"
  7379. }
  7380. },
  7381. {
  7382. "in": "query",
  7383. "name": "workspace",
  7384. "schema": {
  7385. "type": "string"
  7386. }
  7387. }
  7388. ],
  7389. "summary": "List agents",
  7390. "description": "Get a list of all available AI agents in the OpenCode system.",
  7391. "responses": {
  7392. "200": {
  7393. "description": "List of agents",
  7394. "content": {
  7395. "application/json": {
  7396. "schema": {
  7397. "type": "array",
  7398. "items": {
  7399. "$ref": "#/components/schemas/Agent"
  7400. }
  7401. }
  7402. }
  7403. }
  7404. }
  7405. },
  7406. "x-codeSamples": [
  7407. {
  7408. "lang": "js",
  7409. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  7410. }
  7411. ]
  7412. }
  7413. },
  7414. "/skill": {
  7415. "get": {
  7416. "operationId": "app.skills",
  7417. "parameters": [
  7418. {
  7419. "in": "query",
  7420. "name": "directory",
  7421. "schema": {
  7422. "type": "string"
  7423. }
  7424. },
  7425. {
  7426. "in": "query",
  7427. "name": "workspace",
  7428. "schema": {
  7429. "type": "string"
  7430. }
  7431. }
  7432. ],
  7433. "summary": "List skills",
  7434. "description": "Get a list of all available skills in the OpenCode system.",
  7435. "responses": {
  7436. "200": {
  7437. "description": "List of skills",
  7438. "content": {
  7439. "application/json": {
  7440. "schema": {
  7441. "type": "array",
  7442. "items": {
  7443. "type": "object",
  7444. "properties": {
  7445. "name": {
  7446. "type": "string"
  7447. },
  7448. "description": {
  7449. "type": "string"
  7450. },
  7451. "location": {
  7452. "type": "string"
  7453. },
  7454. "content": {
  7455. "type": "string"
  7456. }
  7457. },
  7458. "required": ["name", "description", "location", "content"]
  7459. }
  7460. }
  7461. }
  7462. }
  7463. }
  7464. },
  7465. "x-codeSamples": [
  7466. {
  7467. "lang": "js",
  7468. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  7469. }
  7470. ]
  7471. }
  7472. },
  7473. "/lsp": {
  7474. "get": {
  7475. "operationId": "lsp.status",
  7476. "parameters": [
  7477. {
  7478. "in": "query",
  7479. "name": "directory",
  7480. "schema": {
  7481. "type": "string"
  7482. }
  7483. },
  7484. {
  7485. "in": "query",
  7486. "name": "workspace",
  7487. "schema": {
  7488. "type": "string"
  7489. }
  7490. }
  7491. ],
  7492. "summary": "Get LSP status",
  7493. "description": "Get LSP server status",
  7494. "responses": {
  7495. "200": {
  7496. "description": "LSP server status",
  7497. "content": {
  7498. "application/json": {
  7499. "schema": {
  7500. "type": "array",
  7501. "items": {
  7502. "$ref": "#/components/schemas/LSPStatus"
  7503. }
  7504. }
  7505. }
  7506. }
  7507. }
  7508. },
  7509. "x-codeSamples": [
  7510. {
  7511. "lang": "js",
  7512. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  7513. }
  7514. ]
  7515. }
  7516. },
  7517. "/formatter": {
  7518. "get": {
  7519. "operationId": "formatter.status",
  7520. "parameters": [
  7521. {
  7522. "in": "query",
  7523. "name": "directory",
  7524. "schema": {
  7525. "type": "string"
  7526. }
  7527. },
  7528. {
  7529. "in": "query",
  7530. "name": "workspace",
  7531. "schema": {
  7532. "type": "string"
  7533. }
  7534. }
  7535. ],
  7536. "summary": "Get formatter status",
  7537. "description": "Get formatter status",
  7538. "responses": {
  7539. "200": {
  7540. "description": "Formatter status",
  7541. "content": {
  7542. "application/json": {
  7543. "schema": {
  7544. "type": "array",
  7545. "items": {
  7546. "$ref": "#/components/schemas/FormatterStatus"
  7547. }
  7548. }
  7549. }
  7550. }
  7551. }
  7552. },
  7553. "x-codeSamples": [
  7554. {
  7555. "lang": "js",
  7556. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  7557. }
  7558. ]
  7559. }
  7560. }
  7561. },
  7562. "components": {
  7563. "schemas": {
  7564. "Project": {
  7565. "type": "object",
  7566. "properties": {
  7567. "id": {
  7568. "type": "string"
  7569. },
  7570. "worktree": {
  7571. "type": "string"
  7572. },
  7573. "vcs": {
  7574. "type": "string",
  7575. "const": "git"
  7576. },
  7577. "name": {
  7578. "type": "string"
  7579. },
  7580. "icon": {
  7581. "type": "object",
  7582. "properties": {
  7583. "url": {
  7584. "type": "string"
  7585. },
  7586. "override": {
  7587. "type": "string"
  7588. },
  7589. "color": {
  7590. "type": "string"
  7591. }
  7592. }
  7593. },
  7594. "commands": {
  7595. "type": "object",
  7596. "properties": {
  7597. "start": {
  7598. "description": "Startup script to run when creating a new workspace (worktree)",
  7599. "type": "string"
  7600. }
  7601. }
  7602. },
  7603. "time": {
  7604. "type": "object",
  7605. "properties": {
  7606. "created": {
  7607. "type": "number"
  7608. },
  7609. "updated": {
  7610. "type": "number"
  7611. },
  7612. "initialized": {
  7613. "type": "number"
  7614. }
  7615. },
  7616. "required": ["created", "updated"]
  7617. },
  7618. "sandboxes": {
  7619. "type": "array",
  7620. "items": {
  7621. "type": "string"
  7622. }
  7623. }
  7624. },
  7625. "required": ["id", "worktree", "time", "sandboxes"]
  7626. },
  7627. "Event.project.updated": {
  7628. "type": "object",
  7629. "properties": {
  7630. "type": {
  7631. "type": "string",
  7632. "const": "project.updated"
  7633. },
  7634. "properties": {
  7635. "$ref": "#/components/schemas/Project"
  7636. }
  7637. },
  7638. "required": ["type", "properties"]
  7639. },
  7640. "Event.server.instance.disposed": {
  7641. "type": "object",
  7642. "properties": {
  7643. "type": {
  7644. "type": "string",
  7645. "const": "server.instance.disposed"
  7646. },
  7647. "properties": {
  7648. "type": "object",
  7649. "properties": {
  7650. "directory": {
  7651. "type": "string"
  7652. }
  7653. },
  7654. "required": ["directory"]
  7655. }
  7656. },
  7657. "required": ["type", "properties"]
  7658. },
  7659. "Event.server.connected": {
  7660. "type": "object",
  7661. "properties": {
  7662. "type": {
  7663. "type": "string",
  7664. "const": "server.connected"
  7665. },
  7666. "properties": {
  7667. "type": "object",
  7668. "properties": {}
  7669. }
  7670. },
  7671. "required": ["type", "properties"]
  7672. },
  7673. "Event.global.disposed": {
  7674. "type": "object",
  7675. "properties": {
  7676. "type": {
  7677. "type": "string",
  7678. "const": "global.disposed"
  7679. },
  7680. "properties": {
  7681. "type": "object",
  7682. "properties": {}
  7683. }
  7684. },
  7685. "required": ["type", "properties"]
  7686. },
  7687. "Event.file.edited": {
  7688. "type": "object",
  7689. "properties": {
  7690. "type": {
  7691. "type": "string",
  7692. "const": "file.edited"
  7693. },
  7694. "properties": {
  7695. "type": "object",
  7696. "properties": {
  7697. "file": {
  7698. "type": "string"
  7699. }
  7700. },
  7701. "required": ["file"]
  7702. }
  7703. },
  7704. "required": ["type", "properties"]
  7705. },
  7706. "Event.file.watcher.updated": {
  7707. "type": "object",
  7708. "properties": {
  7709. "type": {
  7710. "type": "string",
  7711. "const": "file.watcher.updated"
  7712. },
  7713. "properties": {
  7714. "type": "object",
  7715. "properties": {
  7716. "file": {
  7717. "type": "string"
  7718. },
  7719. "event": {
  7720. "type": "string",
  7721. "enum": ["add", "change", "unlink"]
  7722. }
  7723. },
  7724. "required": ["file", "event"]
  7725. }
  7726. },
  7727. "required": ["type", "properties"]
  7728. },
  7729. "Event.lsp.client.diagnostics": {
  7730. "type": "object",
  7731. "properties": {
  7732. "type": {
  7733. "type": "string",
  7734. "const": "lsp.client.diagnostics"
  7735. },
  7736. "properties": {
  7737. "type": "object",
  7738. "properties": {
  7739. "serverID": {
  7740. "type": "string"
  7741. },
  7742. "path": {
  7743. "type": "string"
  7744. }
  7745. },
  7746. "required": ["serverID", "path"]
  7747. }
  7748. },
  7749. "required": ["type", "properties"]
  7750. },
  7751. "Event.lsp.updated": {
  7752. "type": "object",
  7753. "properties": {
  7754. "type": {
  7755. "type": "string",
  7756. "const": "lsp.updated"
  7757. },
  7758. "properties": {
  7759. "type": "object",
  7760. "properties": {}
  7761. }
  7762. },
  7763. "required": ["type", "properties"]
  7764. },
  7765. "Event.message.part.delta": {
  7766. "type": "object",
  7767. "properties": {
  7768. "type": {
  7769. "type": "string",
  7770. "const": "message.part.delta"
  7771. },
  7772. "properties": {
  7773. "type": "object",
  7774. "properties": {
  7775. "sessionID": {
  7776. "type": "string",
  7777. "pattern": "^ses.*"
  7778. },
  7779. "messageID": {
  7780. "type": "string",
  7781. "pattern": "^msg.*"
  7782. },
  7783. "partID": {
  7784. "type": "string",
  7785. "pattern": "^prt.*"
  7786. },
  7787. "field": {
  7788. "type": "string"
  7789. },
  7790. "delta": {
  7791. "type": "string"
  7792. }
  7793. },
  7794. "required": ["sessionID", "messageID", "partID", "field", "delta"]
  7795. }
  7796. },
  7797. "required": ["type", "properties"]
  7798. },
  7799. "PermissionRequest": {
  7800. "type": "object",
  7801. "properties": {
  7802. "id": {
  7803. "type": "string",
  7804. "pattern": "^per.*"
  7805. },
  7806. "sessionID": {
  7807. "type": "string",
  7808. "pattern": "^ses.*"
  7809. },
  7810. "permission": {
  7811. "type": "string"
  7812. },
  7813. "patterns": {
  7814. "type": "array",
  7815. "items": {
  7816. "type": "string"
  7817. }
  7818. },
  7819. "metadata": {
  7820. "type": "object",
  7821. "propertyNames": {
  7822. "type": "string"
  7823. },
  7824. "additionalProperties": {}
  7825. },
  7826. "always": {
  7827. "type": "array",
  7828. "items": {
  7829. "type": "string"
  7830. }
  7831. },
  7832. "tool": {
  7833. "type": "object",
  7834. "properties": {
  7835. "messageID": {
  7836. "type": "string",
  7837. "pattern": "^msg.*"
  7838. },
  7839. "callID": {
  7840. "type": "string"
  7841. }
  7842. },
  7843. "required": ["messageID", "callID"]
  7844. }
  7845. },
  7846. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  7847. },
  7848. "Event.permission.asked": {
  7849. "type": "object",
  7850. "properties": {
  7851. "type": {
  7852. "type": "string",
  7853. "const": "permission.asked"
  7854. },
  7855. "properties": {
  7856. "$ref": "#/components/schemas/PermissionRequest"
  7857. }
  7858. },
  7859. "required": ["type", "properties"]
  7860. },
  7861. "Event.permission.replied": {
  7862. "type": "object",
  7863. "properties": {
  7864. "type": {
  7865. "type": "string",
  7866. "const": "permission.replied"
  7867. },
  7868. "properties": {
  7869. "type": "object",
  7870. "properties": {
  7871. "sessionID": {
  7872. "type": "string",
  7873. "pattern": "^ses.*"
  7874. },
  7875. "requestID": {
  7876. "type": "string",
  7877. "pattern": "^per.*"
  7878. },
  7879. "reply": {
  7880. "type": "string",
  7881. "enum": ["once", "always", "reject"]
  7882. }
  7883. },
  7884. "required": ["sessionID", "requestID", "reply"]
  7885. }
  7886. },
  7887. "required": ["type", "properties"]
  7888. },
  7889. "SnapshotFileDiff": {
  7890. "type": "object",
  7891. "properties": {
  7892. "file": {
  7893. "type": "string"
  7894. },
  7895. "patch": {
  7896. "type": "string"
  7897. },
  7898. "additions": {
  7899. "type": "number"
  7900. },
  7901. "deletions": {
  7902. "type": "number"
  7903. },
  7904. "status": {
  7905. "type": "string",
  7906. "enum": ["added", "deleted", "modified"]
  7907. }
  7908. },
  7909. "required": ["file", "patch", "additions", "deletions"]
  7910. },
  7911. "Event.session.diff": {
  7912. "type": "object",
  7913. "properties": {
  7914. "type": {
  7915. "type": "string",
  7916. "const": "session.diff"
  7917. },
  7918. "properties": {
  7919. "type": "object",
  7920. "properties": {
  7921. "sessionID": {
  7922. "type": "string",
  7923. "pattern": "^ses.*"
  7924. },
  7925. "diff": {
  7926. "type": "array",
  7927. "items": {
  7928. "$ref": "#/components/schemas/SnapshotFileDiff"
  7929. }
  7930. }
  7931. },
  7932. "required": ["sessionID", "diff"]
  7933. }
  7934. },
  7935. "required": ["type", "properties"]
  7936. },
  7937. "ProviderAuthError": {
  7938. "type": "object",
  7939. "properties": {
  7940. "name": {
  7941. "type": "string",
  7942. "const": "ProviderAuthError"
  7943. },
  7944. "data": {
  7945. "type": "object",
  7946. "properties": {
  7947. "providerID": {
  7948. "type": "string"
  7949. },
  7950. "message": {
  7951. "type": "string"
  7952. }
  7953. },
  7954. "required": ["providerID", "message"]
  7955. }
  7956. },
  7957. "required": ["name", "data"]
  7958. },
  7959. "UnknownError": {
  7960. "type": "object",
  7961. "properties": {
  7962. "name": {
  7963. "type": "string",
  7964. "const": "UnknownError"
  7965. },
  7966. "data": {
  7967. "type": "object",
  7968. "properties": {
  7969. "message": {
  7970. "type": "string"
  7971. }
  7972. },
  7973. "required": ["message"]
  7974. }
  7975. },
  7976. "required": ["name", "data"]
  7977. },
  7978. "MessageOutputLengthError": {
  7979. "type": "object",
  7980. "properties": {
  7981. "name": {
  7982. "type": "string",
  7983. "const": "MessageOutputLengthError"
  7984. },
  7985. "data": {
  7986. "type": "object",
  7987. "properties": {}
  7988. }
  7989. },
  7990. "required": ["name", "data"]
  7991. },
  7992. "MessageAbortedError": {
  7993. "type": "object",
  7994. "properties": {
  7995. "name": {
  7996. "type": "string",
  7997. "const": "MessageAbortedError"
  7998. },
  7999. "data": {
  8000. "type": "object",
  8001. "properties": {
  8002. "message": {
  8003. "type": "string"
  8004. }
  8005. },
  8006. "required": ["message"]
  8007. }
  8008. },
  8009. "required": ["name", "data"]
  8010. },
  8011. "StructuredOutputError": {
  8012. "type": "object",
  8013. "properties": {
  8014. "name": {
  8015. "type": "string",
  8016. "const": "StructuredOutputError"
  8017. },
  8018. "data": {
  8019. "type": "object",
  8020. "properties": {
  8021. "message": {
  8022. "type": "string"
  8023. },
  8024. "retries": {
  8025. "type": "number"
  8026. }
  8027. },
  8028. "required": ["message", "retries"]
  8029. }
  8030. },
  8031. "required": ["name", "data"]
  8032. },
  8033. "ContextOverflowError": {
  8034. "type": "object",
  8035. "properties": {
  8036. "name": {
  8037. "type": "string",
  8038. "const": "ContextOverflowError"
  8039. },
  8040. "data": {
  8041. "type": "object",
  8042. "properties": {
  8043. "message": {
  8044. "type": "string"
  8045. },
  8046. "responseBody": {
  8047. "type": "string"
  8048. }
  8049. },
  8050. "required": ["message"]
  8051. }
  8052. },
  8053. "required": ["name", "data"]
  8054. },
  8055. "APIError": {
  8056. "type": "object",
  8057. "properties": {
  8058. "name": {
  8059. "type": "string",
  8060. "const": "APIError"
  8061. },
  8062. "data": {
  8063. "type": "object",
  8064. "properties": {
  8065. "message": {
  8066. "type": "string"
  8067. },
  8068. "statusCode": {
  8069. "type": "number"
  8070. },
  8071. "isRetryable": {
  8072. "type": "boolean"
  8073. },
  8074. "responseHeaders": {
  8075. "type": "object",
  8076. "propertyNames": {
  8077. "type": "string"
  8078. },
  8079. "additionalProperties": {
  8080. "type": "string"
  8081. }
  8082. },
  8083. "responseBody": {
  8084. "type": "string"
  8085. },
  8086. "metadata": {
  8087. "type": "object",
  8088. "propertyNames": {
  8089. "type": "string"
  8090. },
  8091. "additionalProperties": {
  8092. "type": "string"
  8093. }
  8094. }
  8095. },
  8096. "required": ["message", "isRetryable"]
  8097. }
  8098. },
  8099. "required": ["name", "data"]
  8100. },
  8101. "Event.session.error": {
  8102. "type": "object",
  8103. "properties": {
  8104. "type": {
  8105. "type": "string",
  8106. "const": "session.error"
  8107. },
  8108. "properties": {
  8109. "type": "object",
  8110. "properties": {
  8111. "sessionID": {
  8112. "type": "string",
  8113. "pattern": "^ses.*"
  8114. },
  8115. "error": {
  8116. "anyOf": [
  8117. {
  8118. "$ref": "#/components/schemas/ProviderAuthError"
  8119. },
  8120. {
  8121. "$ref": "#/components/schemas/UnknownError"
  8122. },
  8123. {
  8124. "$ref": "#/components/schemas/MessageOutputLengthError"
  8125. },
  8126. {
  8127. "$ref": "#/components/schemas/MessageAbortedError"
  8128. },
  8129. {
  8130. "$ref": "#/components/schemas/StructuredOutputError"
  8131. },
  8132. {
  8133. "$ref": "#/components/schemas/ContextOverflowError"
  8134. },
  8135. {
  8136. "$ref": "#/components/schemas/APIError"
  8137. }
  8138. ]
  8139. }
  8140. }
  8141. }
  8142. },
  8143. "required": ["type", "properties"]
  8144. },
  8145. "Event.installation.updated": {
  8146. "type": "object",
  8147. "properties": {
  8148. "type": {
  8149. "type": "string",
  8150. "const": "installation.updated"
  8151. },
  8152. "properties": {
  8153. "type": "object",
  8154. "properties": {
  8155. "version": {
  8156. "type": "string"
  8157. }
  8158. },
  8159. "required": ["version"]
  8160. }
  8161. },
  8162. "required": ["type", "properties"]
  8163. },
  8164. "Event.installation.update-available": {
  8165. "type": "object",
  8166. "properties": {
  8167. "type": {
  8168. "type": "string",
  8169. "const": "installation.update-available"
  8170. },
  8171. "properties": {
  8172. "type": "object",
  8173. "properties": {
  8174. "version": {
  8175. "type": "string"
  8176. }
  8177. },
  8178. "required": ["version"]
  8179. }
  8180. },
  8181. "required": ["type", "properties"]
  8182. },
  8183. "QuestionOption": {
  8184. "type": "object",
  8185. "properties": {
  8186. "label": {
  8187. "description": "Display text (1-5 words, concise)",
  8188. "type": "string"
  8189. },
  8190. "description": {
  8191. "description": "Explanation of choice",
  8192. "type": "string"
  8193. }
  8194. },
  8195. "required": ["label", "description"]
  8196. },
  8197. "QuestionInfo": {
  8198. "type": "object",
  8199. "properties": {
  8200. "question": {
  8201. "description": "Complete question",
  8202. "type": "string"
  8203. },
  8204. "header": {
  8205. "description": "Very short label (max 30 chars)",
  8206. "type": "string"
  8207. },
  8208. "options": {
  8209. "description": "Available choices",
  8210. "type": "array",
  8211. "items": {
  8212. "$ref": "#/components/schemas/QuestionOption"
  8213. }
  8214. },
  8215. "multiple": {
  8216. "description": "Allow selecting multiple choices",
  8217. "type": "boolean"
  8218. },
  8219. "custom": {
  8220. "description": "Allow typing a custom answer (default: true)",
  8221. "type": "boolean"
  8222. }
  8223. },
  8224. "required": ["question", "header", "options"]
  8225. },
  8226. "QuestionTool": {
  8227. "type": "object",
  8228. "properties": {
  8229. "messageID": {
  8230. "type": "string",
  8231. "pattern": "^msg.*"
  8232. },
  8233. "callID": {
  8234. "type": "string"
  8235. }
  8236. },
  8237. "required": ["messageID", "callID"]
  8238. },
  8239. "QuestionRequest": {
  8240. "type": "object",
  8241. "properties": {
  8242. "id": {
  8243. "type": "string",
  8244. "pattern": "^que.*"
  8245. },
  8246. "sessionID": {
  8247. "type": "string",
  8248. "pattern": "^ses.*"
  8249. },
  8250. "questions": {
  8251. "description": "Questions to ask",
  8252. "type": "array",
  8253. "items": {
  8254. "$ref": "#/components/schemas/QuestionInfo"
  8255. }
  8256. },
  8257. "tool": {
  8258. "$ref": "#/components/schemas/QuestionTool"
  8259. }
  8260. },
  8261. "required": ["id", "sessionID", "questions"]
  8262. },
  8263. "Event.question.asked": {
  8264. "type": "object",
  8265. "properties": {
  8266. "type": {
  8267. "type": "string",
  8268. "const": "question.asked"
  8269. },
  8270. "properties": {
  8271. "$ref": "#/components/schemas/QuestionRequest"
  8272. }
  8273. },
  8274. "required": ["type", "properties"]
  8275. },
  8276. "QuestionAnswer": {
  8277. "type": "array",
  8278. "items": {
  8279. "type": "string"
  8280. }
  8281. },
  8282. "QuestionReplied": {
  8283. "type": "object",
  8284. "properties": {
  8285. "sessionID": {
  8286. "type": "string",
  8287. "pattern": "^ses.*"
  8288. },
  8289. "requestID": {
  8290. "type": "string",
  8291. "pattern": "^que.*"
  8292. },
  8293. "answers": {
  8294. "type": "array",
  8295. "items": {
  8296. "$ref": "#/components/schemas/QuestionAnswer"
  8297. }
  8298. }
  8299. },
  8300. "required": ["sessionID", "requestID", "answers"]
  8301. },
  8302. "Event.question.replied": {
  8303. "type": "object",
  8304. "properties": {
  8305. "type": {
  8306. "type": "string",
  8307. "const": "question.replied"
  8308. },
  8309. "properties": {
  8310. "$ref": "#/components/schemas/QuestionReplied"
  8311. }
  8312. },
  8313. "required": ["type", "properties"]
  8314. },
  8315. "QuestionRejected": {
  8316. "type": "object",
  8317. "properties": {
  8318. "sessionID": {
  8319. "type": "string",
  8320. "pattern": "^ses.*"
  8321. },
  8322. "requestID": {
  8323. "type": "string",
  8324. "pattern": "^que.*"
  8325. }
  8326. },
  8327. "required": ["sessionID", "requestID"]
  8328. },
  8329. "Event.question.rejected": {
  8330. "type": "object",
  8331. "properties": {
  8332. "type": {
  8333. "type": "string",
  8334. "const": "question.rejected"
  8335. },
  8336. "properties": {
  8337. "$ref": "#/components/schemas/QuestionRejected"
  8338. }
  8339. },
  8340. "required": ["type", "properties"]
  8341. },
  8342. "Todo": {
  8343. "type": "object",
  8344. "properties": {
  8345. "content": {
  8346. "description": "Brief description of the task",
  8347. "type": "string"
  8348. },
  8349. "status": {
  8350. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  8351. "type": "string"
  8352. },
  8353. "priority": {
  8354. "description": "Priority level of the task: high, medium, low",
  8355. "type": "string"
  8356. }
  8357. },
  8358. "required": ["content", "status", "priority"]
  8359. },
  8360. "Event.todo.updated": {
  8361. "type": "object",
  8362. "properties": {
  8363. "type": {
  8364. "type": "string",
  8365. "const": "todo.updated"
  8366. },
  8367. "properties": {
  8368. "type": "object",
  8369. "properties": {
  8370. "sessionID": {
  8371. "type": "string",
  8372. "pattern": "^ses.*"
  8373. },
  8374. "todos": {
  8375. "type": "array",
  8376. "items": {
  8377. "$ref": "#/components/schemas/Todo"
  8378. }
  8379. }
  8380. },
  8381. "required": ["sessionID", "todos"]
  8382. }
  8383. },
  8384. "required": ["type", "properties"]
  8385. },
  8386. "SessionStatus": {
  8387. "anyOf": [
  8388. {
  8389. "type": "object",
  8390. "properties": {
  8391. "type": {
  8392. "type": "string",
  8393. "const": "idle"
  8394. }
  8395. },
  8396. "required": ["type"]
  8397. },
  8398. {
  8399. "type": "object",
  8400. "properties": {
  8401. "type": {
  8402. "type": "string",
  8403. "const": "retry"
  8404. },
  8405. "attempt": {
  8406. "type": "number"
  8407. },
  8408. "message": {
  8409. "type": "string"
  8410. },
  8411. "next": {
  8412. "type": "number"
  8413. }
  8414. },
  8415. "required": ["type", "attempt", "message", "next"]
  8416. },
  8417. {
  8418. "type": "object",
  8419. "properties": {
  8420. "type": {
  8421. "type": "string",
  8422. "const": "busy"
  8423. }
  8424. },
  8425. "required": ["type"]
  8426. }
  8427. ]
  8428. },
  8429. "Event.session.status": {
  8430. "type": "object",
  8431. "properties": {
  8432. "type": {
  8433. "type": "string",
  8434. "const": "session.status"
  8435. },
  8436. "properties": {
  8437. "type": "object",
  8438. "properties": {
  8439. "sessionID": {
  8440. "type": "string",
  8441. "pattern": "^ses.*"
  8442. },
  8443. "status": {
  8444. "$ref": "#/components/schemas/SessionStatus"
  8445. }
  8446. },
  8447. "required": ["sessionID", "status"]
  8448. }
  8449. },
  8450. "required": ["type", "properties"]
  8451. },
  8452. "Event.session.idle": {
  8453. "type": "object",
  8454. "properties": {
  8455. "type": {
  8456. "type": "string",
  8457. "const": "session.idle"
  8458. },
  8459. "properties": {
  8460. "type": "object",
  8461. "properties": {
  8462. "sessionID": {
  8463. "type": "string",
  8464. "pattern": "^ses.*"
  8465. }
  8466. },
  8467. "required": ["sessionID"]
  8468. }
  8469. },
  8470. "required": ["type", "properties"]
  8471. },
  8472. "Event.session.compacted": {
  8473. "type": "object",
  8474. "properties": {
  8475. "type": {
  8476. "type": "string",
  8477. "const": "session.compacted"
  8478. },
  8479. "properties": {
  8480. "type": "object",
  8481. "properties": {
  8482. "sessionID": {
  8483. "type": "string",
  8484. "pattern": "^ses.*"
  8485. }
  8486. },
  8487. "required": ["sessionID"]
  8488. }
  8489. },
  8490. "required": ["type", "properties"]
  8491. },
  8492. "Event.tui.prompt.append": {
  8493. "type": "object",
  8494. "properties": {
  8495. "type": {
  8496. "type": "string",
  8497. "const": "tui.prompt.append"
  8498. },
  8499. "properties": {
  8500. "type": "object",
  8501. "properties": {
  8502. "text": {
  8503. "type": "string"
  8504. }
  8505. },
  8506. "required": ["text"]
  8507. }
  8508. },
  8509. "required": ["type", "properties"]
  8510. },
  8511. "Event.tui.command.execute": {
  8512. "type": "object",
  8513. "properties": {
  8514. "type": {
  8515. "type": "string",
  8516. "const": "tui.command.execute"
  8517. },
  8518. "properties": {
  8519. "type": "object",
  8520. "properties": {
  8521. "command": {
  8522. "anyOf": [
  8523. {
  8524. "type": "string",
  8525. "enum": [
  8526. "session.list",
  8527. "session.new",
  8528. "session.share",
  8529. "session.interrupt",
  8530. "session.compact",
  8531. "session.page.up",
  8532. "session.page.down",
  8533. "session.line.up",
  8534. "session.line.down",
  8535. "session.half.page.up",
  8536. "session.half.page.down",
  8537. "session.first",
  8538. "session.last",
  8539. "prompt.clear",
  8540. "prompt.submit",
  8541. "agent.cycle"
  8542. ]
  8543. },
  8544. {
  8545. "type": "string"
  8546. }
  8547. ]
  8548. }
  8549. },
  8550. "required": ["command"]
  8551. }
  8552. },
  8553. "required": ["type", "properties"]
  8554. },
  8555. "Event.tui.toast.show": {
  8556. "type": "object",
  8557. "properties": {
  8558. "type": {
  8559. "type": "string",
  8560. "const": "tui.toast.show"
  8561. },
  8562. "properties": {
  8563. "type": "object",
  8564. "properties": {
  8565. "title": {
  8566. "type": "string"
  8567. },
  8568. "message": {
  8569. "type": "string"
  8570. },
  8571. "variant": {
  8572. "type": "string",
  8573. "enum": ["info", "success", "warning", "error"]
  8574. },
  8575. "duration": {
  8576. "description": "Duration in milliseconds",
  8577. "type": "number"
  8578. }
  8579. },
  8580. "required": ["message", "variant"]
  8581. }
  8582. },
  8583. "required": ["type", "properties"]
  8584. },
  8585. "Event.tui.session.select": {
  8586. "type": "object",
  8587. "properties": {
  8588. "type": {
  8589. "type": "string",
  8590. "const": "tui.session.select"
  8591. },
  8592. "properties": {
  8593. "type": "object",
  8594. "properties": {
  8595. "sessionID": {
  8596. "description": "Session ID to navigate to",
  8597. "type": "string",
  8598. "pattern": "^ses.*"
  8599. }
  8600. },
  8601. "required": ["sessionID"]
  8602. }
  8603. },
  8604. "required": ["type", "properties"]
  8605. },
  8606. "Event.mcp.tools.changed": {
  8607. "type": "object",
  8608. "properties": {
  8609. "type": {
  8610. "type": "string",
  8611. "const": "mcp.tools.changed"
  8612. },
  8613. "properties": {
  8614. "type": "object",
  8615. "properties": {
  8616. "server": {
  8617. "type": "string"
  8618. }
  8619. },
  8620. "required": ["server"]
  8621. }
  8622. },
  8623. "required": ["type", "properties"]
  8624. },
  8625. "Event.mcp.browser.open.failed": {
  8626. "type": "object",
  8627. "properties": {
  8628. "type": {
  8629. "type": "string",
  8630. "const": "mcp.browser.open.failed"
  8631. },
  8632. "properties": {
  8633. "type": "object",
  8634. "properties": {
  8635. "mcpName": {
  8636. "type": "string"
  8637. },
  8638. "url": {
  8639. "type": "string"
  8640. }
  8641. },
  8642. "required": ["mcpName", "url"]
  8643. }
  8644. },
  8645. "required": ["type", "properties"]
  8646. },
  8647. "Event.command.executed": {
  8648. "type": "object",
  8649. "properties": {
  8650. "type": {
  8651. "type": "string",
  8652. "const": "command.executed"
  8653. },
  8654. "properties": {
  8655. "type": "object",
  8656. "properties": {
  8657. "name": {
  8658. "type": "string"
  8659. },
  8660. "sessionID": {
  8661. "type": "string",
  8662. "pattern": "^ses.*"
  8663. },
  8664. "arguments": {
  8665. "type": "string"
  8666. },
  8667. "messageID": {
  8668. "type": "string",
  8669. "pattern": "^msg.*"
  8670. }
  8671. },
  8672. "required": ["name", "sessionID", "arguments", "messageID"]
  8673. }
  8674. },
  8675. "required": ["type", "properties"]
  8676. },
  8677. "Event.vcs.branch.updated": {
  8678. "type": "object",
  8679. "properties": {
  8680. "type": {
  8681. "type": "string",
  8682. "const": "vcs.branch.updated"
  8683. },
  8684. "properties": {
  8685. "type": "object",
  8686. "properties": {
  8687. "branch": {
  8688. "type": "string"
  8689. }
  8690. }
  8691. }
  8692. },
  8693. "required": ["type", "properties"]
  8694. },
  8695. "Event.worktree.ready": {
  8696. "type": "object",
  8697. "properties": {
  8698. "type": {
  8699. "type": "string",
  8700. "const": "worktree.ready"
  8701. },
  8702. "properties": {
  8703. "type": "object",
  8704. "properties": {
  8705. "name": {
  8706. "type": "string"
  8707. },
  8708. "branch": {
  8709. "type": "string"
  8710. }
  8711. },
  8712. "required": ["name", "branch"]
  8713. }
  8714. },
  8715. "required": ["type", "properties"]
  8716. },
  8717. "Event.worktree.failed": {
  8718. "type": "object",
  8719. "properties": {
  8720. "type": {
  8721. "type": "string",
  8722. "const": "worktree.failed"
  8723. },
  8724. "properties": {
  8725. "type": "object",
  8726. "properties": {
  8727. "message": {
  8728. "type": "string"
  8729. }
  8730. },
  8731. "required": ["message"]
  8732. }
  8733. },
  8734. "required": ["type", "properties"]
  8735. },
  8736. "Pty": {
  8737. "type": "object",
  8738. "properties": {
  8739. "id": {
  8740. "type": "string",
  8741. "pattern": "^pty.*"
  8742. },
  8743. "title": {
  8744. "type": "string"
  8745. },
  8746. "command": {
  8747. "type": "string"
  8748. },
  8749. "args": {
  8750. "type": "array",
  8751. "items": {
  8752. "type": "string"
  8753. }
  8754. },
  8755. "cwd": {
  8756. "type": "string"
  8757. },
  8758. "status": {
  8759. "type": "string",
  8760. "enum": ["running", "exited"]
  8761. },
  8762. "pid": {
  8763. "type": "number"
  8764. }
  8765. },
  8766. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  8767. },
  8768. "Event.pty.created": {
  8769. "type": "object",
  8770. "properties": {
  8771. "type": {
  8772. "type": "string",
  8773. "const": "pty.created"
  8774. },
  8775. "properties": {
  8776. "type": "object",
  8777. "properties": {
  8778. "info": {
  8779. "$ref": "#/components/schemas/Pty"
  8780. }
  8781. },
  8782. "required": ["info"]
  8783. }
  8784. },
  8785. "required": ["type", "properties"]
  8786. },
  8787. "Event.pty.updated": {
  8788. "type": "object",
  8789. "properties": {
  8790. "type": {
  8791. "type": "string",
  8792. "const": "pty.updated"
  8793. },
  8794. "properties": {
  8795. "type": "object",
  8796. "properties": {
  8797. "info": {
  8798. "$ref": "#/components/schemas/Pty"
  8799. }
  8800. },
  8801. "required": ["info"]
  8802. }
  8803. },
  8804. "required": ["type", "properties"]
  8805. },
  8806. "Event.pty.exited": {
  8807. "type": "object",
  8808. "properties": {
  8809. "type": {
  8810. "type": "string",
  8811. "const": "pty.exited"
  8812. },
  8813. "properties": {
  8814. "type": "object",
  8815. "properties": {
  8816. "id": {
  8817. "type": "string",
  8818. "pattern": "^pty.*"
  8819. },
  8820. "exitCode": {
  8821. "type": "number"
  8822. }
  8823. },
  8824. "required": ["id", "exitCode"]
  8825. }
  8826. },
  8827. "required": ["type", "properties"]
  8828. },
  8829. "Event.pty.deleted": {
  8830. "type": "object",
  8831. "properties": {
  8832. "type": {
  8833. "type": "string",
  8834. "const": "pty.deleted"
  8835. },
  8836. "properties": {
  8837. "type": "object",
  8838. "properties": {
  8839. "id": {
  8840. "type": "string",
  8841. "pattern": "^pty.*"
  8842. }
  8843. },
  8844. "required": ["id"]
  8845. }
  8846. },
  8847. "required": ["type", "properties"]
  8848. },
  8849. "Event.workspace.ready": {
  8850. "type": "object",
  8851. "properties": {
  8852. "type": {
  8853. "type": "string",
  8854. "const": "workspace.ready"
  8855. },
  8856. "properties": {
  8857. "type": "object",
  8858. "properties": {
  8859. "name": {
  8860. "type": "string"
  8861. }
  8862. },
  8863. "required": ["name"]
  8864. }
  8865. },
  8866. "required": ["type", "properties"]
  8867. },
  8868. "Event.workspace.failed": {
  8869. "type": "object",
  8870. "properties": {
  8871. "type": {
  8872. "type": "string",
  8873. "const": "workspace.failed"
  8874. },
  8875. "properties": {
  8876. "type": "object",
  8877. "properties": {
  8878. "message": {
  8879. "type": "string"
  8880. }
  8881. },
  8882. "required": ["message"]
  8883. }
  8884. },
  8885. "required": ["type", "properties"]
  8886. },
  8887. "Event.workspace.restore": {
  8888. "type": "object",
  8889. "properties": {
  8890. "type": {
  8891. "type": "string",
  8892. "const": "workspace.restore"
  8893. },
  8894. "properties": {
  8895. "type": "object",
  8896. "properties": {
  8897. "workspaceID": {
  8898. "type": "string",
  8899. "pattern": "^wrk.*"
  8900. },
  8901. "sessionID": {
  8902. "type": "string",
  8903. "pattern": "^ses.*"
  8904. },
  8905. "total": {
  8906. "type": "integer",
  8907. "minimum": 0,
  8908. "maximum": 9007199254740991
  8909. },
  8910. "step": {
  8911. "type": "integer",
  8912. "minimum": 0,
  8913. "maximum": 9007199254740991
  8914. }
  8915. },
  8916. "required": ["workspaceID", "sessionID", "total", "step"]
  8917. }
  8918. },
  8919. "required": ["type", "properties"]
  8920. },
  8921. "Event.workspace.status": {
  8922. "type": "object",
  8923. "properties": {
  8924. "type": {
  8925. "type": "string",
  8926. "const": "workspace.status"
  8927. },
  8928. "properties": {
  8929. "type": "object",
  8930. "properties": {
  8931. "workspaceID": {
  8932. "type": "string",
  8933. "pattern": "^wrk.*"
  8934. },
  8935. "status": {
  8936. "type": "string",
  8937. "enum": ["connected", "connecting", "disconnected", "error"]
  8938. }
  8939. },
  8940. "required": ["workspaceID", "status"]
  8941. }
  8942. },
  8943. "required": ["type", "properties"]
  8944. },
  8945. "OutputFormatText": {
  8946. "type": "object",
  8947. "properties": {
  8948. "type": {
  8949. "type": "string",
  8950. "const": "text"
  8951. }
  8952. },
  8953. "required": ["type"]
  8954. },
  8955. "JSONSchema": {
  8956. "type": "object",
  8957. "propertyNames": {
  8958. "type": "string"
  8959. },
  8960. "additionalProperties": {}
  8961. },
  8962. "OutputFormatJsonSchema": {
  8963. "type": "object",
  8964. "properties": {
  8965. "type": {
  8966. "type": "string",
  8967. "const": "json_schema"
  8968. },
  8969. "schema": {
  8970. "$ref": "#/components/schemas/JSONSchema"
  8971. },
  8972. "retryCount": {
  8973. "default": 2,
  8974. "type": "integer",
  8975. "minimum": 0,
  8976. "maximum": 9007199254740991
  8977. }
  8978. },
  8979. "required": ["type", "schema"]
  8980. },
  8981. "OutputFormat": {
  8982. "anyOf": [
  8983. {
  8984. "$ref": "#/components/schemas/OutputFormatText"
  8985. },
  8986. {
  8987. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  8988. }
  8989. ]
  8990. },
  8991. "UserMessage": {
  8992. "type": "object",
  8993. "properties": {
  8994. "id": {
  8995. "type": "string",
  8996. "pattern": "^msg.*"
  8997. },
  8998. "sessionID": {
  8999. "type": "string",
  9000. "pattern": "^ses.*"
  9001. },
  9002. "role": {
  9003. "type": "string",
  9004. "const": "user"
  9005. },
  9006. "time": {
  9007. "type": "object",
  9008. "properties": {
  9009. "created": {
  9010. "type": "number"
  9011. }
  9012. },
  9013. "required": ["created"]
  9014. },
  9015. "format": {
  9016. "$ref": "#/components/schemas/OutputFormat"
  9017. },
  9018. "summary": {
  9019. "type": "object",
  9020. "properties": {
  9021. "title": {
  9022. "type": "string"
  9023. },
  9024. "body": {
  9025. "type": "string"
  9026. },
  9027. "diffs": {
  9028. "type": "array",
  9029. "items": {
  9030. "$ref": "#/components/schemas/SnapshotFileDiff"
  9031. }
  9032. }
  9033. },
  9034. "required": ["diffs"]
  9035. },
  9036. "agent": {
  9037. "type": "string"
  9038. },
  9039. "model": {
  9040. "type": "object",
  9041. "properties": {
  9042. "providerID": {
  9043. "type": "string"
  9044. },
  9045. "modelID": {
  9046. "type": "string"
  9047. },
  9048. "variant": {
  9049. "type": "string"
  9050. }
  9051. },
  9052. "required": ["providerID", "modelID"]
  9053. },
  9054. "system": {
  9055. "type": "string"
  9056. },
  9057. "tools": {
  9058. "type": "object",
  9059. "propertyNames": {
  9060. "type": "string"
  9061. },
  9062. "additionalProperties": {
  9063. "type": "boolean"
  9064. }
  9065. }
  9066. },
  9067. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  9068. },
  9069. "AssistantMessage": {
  9070. "type": "object",
  9071. "properties": {
  9072. "id": {
  9073. "type": "string",
  9074. "pattern": "^msg.*"
  9075. },
  9076. "sessionID": {
  9077. "type": "string",
  9078. "pattern": "^ses.*"
  9079. },
  9080. "role": {
  9081. "type": "string",
  9082. "const": "assistant"
  9083. },
  9084. "time": {
  9085. "type": "object",
  9086. "properties": {
  9087. "created": {
  9088. "type": "number"
  9089. },
  9090. "completed": {
  9091. "type": "number"
  9092. }
  9093. },
  9094. "required": ["created"]
  9095. },
  9096. "error": {
  9097. "anyOf": [
  9098. {
  9099. "$ref": "#/components/schemas/ProviderAuthError"
  9100. },
  9101. {
  9102. "$ref": "#/components/schemas/UnknownError"
  9103. },
  9104. {
  9105. "$ref": "#/components/schemas/MessageOutputLengthError"
  9106. },
  9107. {
  9108. "$ref": "#/components/schemas/MessageAbortedError"
  9109. },
  9110. {
  9111. "$ref": "#/components/schemas/StructuredOutputError"
  9112. },
  9113. {
  9114. "$ref": "#/components/schemas/ContextOverflowError"
  9115. },
  9116. {
  9117. "$ref": "#/components/schemas/APIError"
  9118. }
  9119. ]
  9120. },
  9121. "parentID": {
  9122. "type": "string",
  9123. "pattern": "^msg.*"
  9124. },
  9125. "modelID": {
  9126. "type": "string"
  9127. },
  9128. "providerID": {
  9129. "type": "string"
  9130. },
  9131. "mode": {
  9132. "type": "string"
  9133. },
  9134. "agent": {
  9135. "type": "string"
  9136. },
  9137. "path": {
  9138. "type": "object",
  9139. "properties": {
  9140. "cwd": {
  9141. "type": "string"
  9142. },
  9143. "root": {
  9144. "type": "string"
  9145. }
  9146. },
  9147. "required": ["cwd", "root"]
  9148. },
  9149. "summary": {
  9150. "type": "boolean"
  9151. },
  9152. "cost": {
  9153. "type": "number"
  9154. },
  9155. "tokens": {
  9156. "type": "object",
  9157. "properties": {
  9158. "total": {
  9159. "type": "number"
  9160. },
  9161. "input": {
  9162. "type": "number"
  9163. },
  9164. "output": {
  9165. "type": "number"
  9166. },
  9167. "reasoning": {
  9168. "type": "number"
  9169. },
  9170. "cache": {
  9171. "type": "object",
  9172. "properties": {
  9173. "read": {
  9174. "type": "number"
  9175. },
  9176. "write": {
  9177. "type": "number"
  9178. }
  9179. },
  9180. "required": ["read", "write"]
  9181. }
  9182. },
  9183. "required": ["input", "output", "reasoning", "cache"]
  9184. },
  9185. "structured": {},
  9186. "variant": {
  9187. "type": "string"
  9188. },
  9189. "finish": {
  9190. "type": "string"
  9191. }
  9192. },
  9193. "required": [
  9194. "id",
  9195. "sessionID",
  9196. "role",
  9197. "time",
  9198. "parentID",
  9199. "modelID",
  9200. "providerID",
  9201. "mode",
  9202. "agent",
  9203. "path",
  9204. "cost",
  9205. "tokens"
  9206. ]
  9207. },
  9208. "Message": {
  9209. "anyOf": [
  9210. {
  9211. "$ref": "#/components/schemas/UserMessage"
  9212. },
  9213. {
  9214. "$ref": "#/components/schemas/AssistantMessage"
  9215. }
  9216. ]
  9217. },
  9218. "Event.message.updated": {
  9219. "type": "object",
  9220. "properties": {
  9221. "type": {
  9222. "type": "string",
  9223. "const": "message.updated"
  9224. },
  9225. "properties": {
  9226. "type": "object",
  9227. "properties": {
  9228. "sessionID": {
  9229. "type": "string",
  9230. "pattern": "^ses.*"
  9231. },
  9232. "info": {
  9233. "$ref": "#/components/schemas/Message"
  9234. }
  9235. },
  9236. "required": ["sessionID", "info"]
  9237. }
  9238. },
  9239. "required": ["type", "properties"]
  9240. },
  9241. "Event.message.removed": {
  9242. "type": "object",
  9243. "properties": {
  9244. "type": {
  9245. "type": "string",
  9246. "const": "message.removed"
  9247. },
  9248. "properties": {
  9249. "type": "object",
  9250. "properties": {
  9251. "sessionID": {
  9252. "type": "string",
  9253. "pattern": "^ses.*"
  9254. },
  9255. "messageID": {
  9256. "type": "string",
  9257. "pattern": "^msg.*"
  9258. }
  9259. },
  9260. "required": ["sessionID", "messageID"]
  9261. }
  9262. },
  9263. "required": ["type", "properties"]
  9264. },
  9265. "TextPart": {
  9266. "type": "object",
  9267. "properties": {
  9268. "id": {
  9269. "type": "string",
  9270. "pattern": "^prt.*"
  9271. },
  9272. "sessionID": {
  9273. "type": "string",
  9274. "pattern": "^ses.*"
  9275. },
  9276. "messageID": {
  9277. "type": "string",
  9278. "pattern": "^msg.*"
  9279. },
  9280. "type": {
  9281. "type": "string",
  9282. "const": "text"
  9283. },
  9284. "text": {
  9285. "type": "string"
  9286. },
  9287. "synthetic": {
  9288. "type": "boolean"
  9289. },
  9290. "ignored": {
  9291. "type": "boolean"
  9292. },
  9293. "time": {
  9294. "type": "object",
  9295. "properties": {
  9296. "start": {
  9297. "type": "number"
  9298. },
  9299. "end": {
  9300. "type": "number"
  9301. }
  9302. },
  9303. "required": ["start"]
  9304. },
  9305. "metadata": {
  9306. "type": "object",
  9307. "propertyNames": {
  9308. "type": "string"
  9309. },
  9310. "additionalProperties": {}
  9311. }
  9312. },
  9313. "required": ["id", "sessionID", "messageID", "type", "text"]
  9314. },
  9315. "SubtaskPart": {
  9316. "type": "object",
  9317. "properties": {
  9318. "id": {
  9319. "type": "string",
  9320. "pattern": "^prt.*"
  9321. },
  9322. "sessionID": {
  9323. "type": "string",
  9324. "pattern": "^ses.*"
  9325. },
  9326. "messageID": {
  9327. "type": "string",
  9328. "pattern": "^msg.*"
  9329. },
  9330. "type": {
  9331. "type": "string",
  9332. "const": "subtask"
  9333. },
  9334. "prompt": {
  9335. "type": "string"
  9336. },
  9337. "description": {
  9338. "type": "string"
  9339. },
  9340. "agent": {
  9341. "type": "string"
  9342. },
  9343. "model": {
  9344. "type": "object",
  9345. "properties": {
  9346. "providerID": {
  9347. "type": "string"
  9348. },
  9349. "modelID": {
  9350. "type": "string"
  9351. }
  9352. },
  9353. "required": ["providerID", "modelID"]
  9354. },
  9355. "command": {
  9356. "type": "string"
  9357. }
  9358. },
  9359. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  9360. },
  9361. "ReasoningPart": {
  9362. "type": "object",
  9363. "properties": {
  9364. "id": {
  9365. "type": "string",
  9366. "pattern": "^prt.*"
  9367. },
  9368. "sessionID": {
  9369. "type": "string",
  9370. "pattern": "^ses.*"
  9371. },
  9372. "messageID": {
  9373. "type": "string",
  9374. "pattern": "^msg.*"
  9375. },
  9376. "type": {
  9377. "type": "string",
  9378. "const": "reasoning"
  9379. },
  9380. "text": {
  9381. "type": "string"
  9382. },
  9383. "metadata": {
  9384. "type": "object",
  9385. "propertyNames": {
  9386. "type": "string"
  9387. },
  9388. "additionalProperties": {}
  9389. },
  9390. "time": {
  9391. "type": "object",
  9392. "properties": {
  9393. "start": {
  9394. "type": "number"
  9395. },
  9396. "end": {
  9397. "type": "number"
  9398. }
  9399. },
  9400. "required": ["start"]
  9401. }
  9402. },
  9403. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  9404. },
  9405. "FilePartSourceText": {
  9406. "type": "object",
  9407. "properties": {
  9408. "value": {
  9409. "type": "string"
  9410. },
  9411. "start": {
  9412. "type": "integer",
  9413. "minimum": -9007199254740991,
  9414. "maximum": 9007199254740991
  9415. },
  9416. "end": {
  9417. "type": "integer",
  9418. "minimum": -9007199254740991,
  9419. "maximum": 9007199254740991
  9420. }
  9421. },
  9422. "required": ["value", "start", "end"]
  9423. },
  9424. "FileSource": {
  9425. "type": "object",
  9426. "properties": {
  9427. "text": {
  9428. "$ref": "#/components/schemas/FilePartSourceText"
  9429. },
  9430. "type": {
  9431. "type": "string",
  9432. "const": "file"
  9433. },
  9434. "path": {
  9435. "type": "string"
  9436. }
  9437. },
  9438. "required": ["text", "type", "path"]
  9439. },
  9440. "Range": {
  9441. "type": "object",
  9442. "properties": {
  9443. "start": {
  9444. "type": "object",
  9445. "properties": {
  9446. "line": {
  9447. "type": "number"
  9448. },
  9449. "character": {
  9450. "type": "number"
  9451. }
  9452. },
  9453. "required": ["line", "character"]
  9454. },
  9455. "end": {
  9456. "type": "object",
  9457. "properties": {
  9458. "line": {
  9459. "type": "number"
  9460. },
  9461. "character": {
  9462. "type": "number"
  9463. }
  9464. },
  9465. "required": ["line", "character"]
  9466. }
  9467. },
  9468. "required": ["start", "end"]
  9469. },
  9470. "SymbolSource": {
  9471. "type": "object",
  9472. "properties": {
  9473. "text": {
  9474. "$ref": "#/components/schemas/FilePartSourceText"
  9475. },
  9476. "type": {
  9477. "type": "string",
  9478. "const": "symbol"
  9479. },
  9480. "path": {
  9481. "type": "string"
  9482. },
  9483. "range": {
  9484. "$ref": "#/components/schemas/Range"
  9485. },
  9486. "name": {
  9487. "type": "string"
  9488. },
  9489. "kind": {
  9490. "type": "integer",
  9491. "minimum": -9007199254740991,
  9492. "maximum": 9007199254740991
  9493. }
  9494. },
  9495. "required": ["text", "type", "path", "range", "name", "kind"]
  9496. },
  9497. "ResourceSource": {
  9498. "type": "object",
  9499. "properties": {
  9500. "text": {
  9501. "$ref": "#/components/schemas/FilePartSourceText"
  9502. },
  9503. "type": {
  9504. "type": "string",
  9505. "const": "resource"
  9506. },
  9507. "clientName": {
  9508. "type": "string"
  9509. },
  9510. "uri": {
  9511. "type": "string"
  9512. }
  9513. },
  9514. "required": ["text", "type", "clientName", "uri"]
  9515. },
  9516. "FilePartSource": {
  9517. "anyOf": [
  9518. {
  9519. "$ref": "#/components/schemas/FileSource"
  9520. },
  9521. {
  9522. "$ref": "#/components/schemas/SymbolSource"
  9523. },
  9524. {
  9525. "$ref": "#/components/schemas/ResourceSource"
  9526. }
  9527. ]
  9528. },
  9529. "FilePart": {
  9530. "type": "object",
  9531. "properties": {
  9532. "id": {
  9533. "type": "string",
  9534. "pattern": "^prt.*"
  9535. },
  9536. "sessionID": {
  9537. "type": "string",
  9538. "pattern": "^ses.*"
  9539. },
  9540. "messageID": {
  9541. "type": "string",
  9542. "pattern": "^msg.*"
  9543. },
  9544. "type": {
  9545. "type": "string",
  9546. "const": "file"
  9547. },
  9548. "mime": {
  9549. "type": "string"
  9550. },
  9551. "filename": {
  9552. "type": "string"
  9553. },
  9554. "url": {
  9555. "type": "string"
  9556. },
  9557. "source": {
  9558. "$ref": "#/components/schemas/FilePartSource"
  9559. }
  9560. },
  9561. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  9562. },
  9563. "ToolStatePending": {
  9564. "type": "object",
  9565. "properties": {
  9566. "status": {
  9567. "type": "string",
  9568. "const": "pending"
  9569. },
  9570. "input": {
  9571. "type": "object",
  9572. "propertyNames": {
  9573. "type": "string"
  9574. },
  9575. "additionalProperties": {}
  9576. },
  9577. "raw": {
  9578. "type": "string"
  9579. }
  9580. },
  9581. "required": ["status", "input", "raw"]
  9582. },
  9583. "ToolStateRunning": {
  9584. "type": "object",
  9585. "properties": {
  9586. "status": {
  9587. "type": "string",
  9588. "const": "running"
  9589. },
  9590. "input": {
  9591. "type": "object",
  9592. "propertyNames": {
  9593. "type": "string"
  9594. },
  9595. "additionalProperties": {}
  9596. },
  9597. "title": {
  9598. "type": "string"
  9599. },
  9600. "metadata": {
  9601. "type": "object",
  9602. "propertyNames": {
  9603. "type": "string"
  9604. },
  9605. "additionalProperties": {}
  9606. },
  9607. "time": {
  9608. "type": "object",
  9609. "properties": {
  9610. "start": {
  9611. "type": "number"
  9612. }
  9613. },
  9614. "required": ["start"]
  9615. }
  9616. },
  9617. "required": ["status", "input", "time"]
  9618. },
  9619. "ToolStateCompleted": {
  9620. "type": "object",
  9621. "properties": {
  9622. "status": {
  9623. "type": "string",
  9624. "const": "completed"
  9625. },
  9626. "input": {
  9627. "type": "object",
  9628. "propertyNames": {
  9629. "type": "string"
  9630. },
  9631. "additionalProperties": {}
  9632. },
  9633. "output": {
  9634. "type": "string"
  9635. },
  9636. "title": {
  9637. "type": "string"
  9638. },
  9639. "metadata": {
  9640. "type": "object",
  9641. "propertyNames": {
  9642. "type": "string"
  9643. },
  9644. "additionalProperties": {}
  9645. },
  9646. "time": {
  9647. "type": "object",
  9648. "properties": {
  9649. "start": {
  9650. "type": "number"
  9651. },
  9652. "end": {
  9653. "type": "number"
  9654. },
  9655. "compacted": {
  9656. "type": "number"
  9657. }
  9658. },
  9659. "required": ["start", "end"]
  9660. },
  9661. "attachments": {
  9662. "type": "array",
  9663. "items": {
  9664. "$ref": "#/components/schemas/FilePart"
  9665. }
  9666. }
  9667. },
  9668. "required": ["status", "input", "output", "title", "metadata", "time"]
  9669. },
  9670. "ToolStateError": {
  9671. "type": "object",
  9672. "properties": {
  9673. "status": {
  9674. "type": "string",
  9675. "const": "error"
  9676. },
  9677. "input": {
  9678. "type": "object",
  9679. "propertyNames": {
  9680. "type": "string"
  9681. },
  9682. "additionalProperties": {}
  9683. },
  9684. "error": {
  9685. "type": "string"
  9686. },
  9687. "metadata": {
  9688. "type": "object",
  9689. "propertyNames": {
  9690. "type": "string"
  9691. },
  9692. "additionalProperties": {}
  9693. },
  9694. "time": {
  9695. "type": "object",
  9696. "properties": {
  9697. "start": {
  9698. "type": "number"
  9699. },
  9700. "end": {
  9701. "type": "number"
  9702. }
  9703. },
  9704. "required": ["start", "end"]
  9705. }
  9706. },
  9707. "required": ["status", "input", "error", "time"]
  9708. },
  9709. "ToolState": {
  9710. "anyOf": [
  9711. {
  9712. "$ref": "#/components/schemas/ToolStatePending"
  9713. },
  9714. {
  9715. "$ref": "#/components/schemas/ToolStateRunning"
  9716. },
  9717. {
  9718. "$ref": "#/components/schemas/ToolStateCompleted"
  9719. },
  9720. {
  9721. "$ref": "#/components/schemas/ToolStateError"
  9722. }
  9723. ]
  9724. },
  9725. "ToolPart": {
  9726. "type": "object",
  9727. "properties": {
  9728. "id": {
  9729. "type": "string",
  9730. "pattern": "^prt.*"
  9731. },
  9732. "sessionID": {
  9733. "type": "string",
  9734. "pattern": "^ses.*"
  9735. },
  9736. "messageID": {
  9737. "type": "string",
  9738. "pattern": "^msg.*"
  9739. },
  9740. "type": {
  9741. "type": "string",
  9742. "const": "tool"
  9743. },
  9744. "callID": {
  9745. "type": "string"
  9746. },
  9747. "tool": {
  9748. "type": "string"
  9749. },
  9750. "state": {
  9751. "$ref": "#/components/schemas/ToolState"
  9752. },
  9753. "metadata": {
  9754. "type": "object",
  9755. "propertyNames": {
  9756. "type": "string"
  9757. },
  9758. "additionalProperties": {}
  9759. }
  9760. },
  9761. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  9762. },
  9763. "StepStartPart": {
  9764. "type": "object",
  9765. "properties": {
  9766. "id": {
  9767. "type": "string",
  9768. "pattern": "^prt.*"
  9769. },
  9770. "sessionID": {
  9771. "type": "string",
  9772. "pattern": "^ses.*"
  9773. },
  9774. "messageID": {
  9775. "type": "string",
  9776. "pattern": "^msg.*"
  9777. },
  9778. "type": {
  9779. "type": "string",
  9780. "const": "step-start"
  9781. },
  9782. "snapshot": {
  9783. "type": "string"
  9784. }
  9785. },
  9786. "required": ["id", "sessionID", "messageID", "type"]
  9787. },
  9788. "StepFinishPart": {
  9789. "type": "object",
  9790. "properties": {
  9791. "id": {
  9792. "type": "string",
  9793. "pattern": "^prt.*"
  9794. },
  9795. "sessionID": {
  9796. "type": "string",
  9797. "pattern": "^ses.*"
  9798. },
  9799. "messageID": {
  9800. "type": "string",
  9801. "pattern": "^msg.*"
  9802. },
  9803. "type": {
  9804. "type": "string",
  9805. "const": "step-finish"
  9806. },
  9807. "reason": {
  9808. "type": "string"
  9809. },
  9810. "snapshot": {
  9811. "type": "string"
  9812. },
  9813. "cost": {
  9814. "type": "number"
  9815. },
  9816. "tokens": {
  9817. "type": "object",
  9818. "properties": {
  9819. "total": {
  9820. "type": "number"
  9821. },
  9822. "input": {
  9823. "type": "number"
  9824. },
  9825. "output": {
  9826. "type": "number"
  9827. },
  9828. "reasoning": {
  9829. "type": "number"
  9830. },
  9831. "cache": {
  9832. "type": "object",
  9833. "properties": {
  9834. "read": {
  9835. "type": "number"
  9836. },
  9837. "write": {
  9838. "type": "number"
  9839. }
  9840. },
  9841. "required": ["read", "write"]
  9842. }
  9843. },
  9844. "required": ["input", "output", "reasoning", "cache"]
  9845. }
  9846. },
  9847. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  9848. },
  9849. "SnapshotPart": {
  9850. "type": "object",
  9851. "properties": {
  9852. "id": {
  9853. "type": "string",
  9854. "pattern": "^prt.*"
  9855. },
  9856. "sessionID": {
  9857. "type": "string",
  9858. "pattern": "^ses.*"
  9859. },
  9860. "messageID": {
  9861. "type": "string",
  9862. "pattern": "^msg.*"
  9863. },
  9864. "type": {
  9865. "type": "string",
  9866. "const": "snapshot"
  9867. },
  9868. "snapshot": {
  9869. "type": "string"
  9870. }
  9871. },
  9872. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  9873. },
  9874. "PatchPart": {
  9875. "type": "object",
  9876. "properties": {
  9877. "id": {
  9878. "type": "string",
  9879. "pattern": "^prt.*"
  9880. },
  9881. "sessionID": {
  9882. "type": "string",
  9883. "pattern": "^ses.*"
  9884. },
  9885. "messageID": {
  9886. "type": "string",
  9887. "pattern": "^msg.*"
  9888. },
  9889. "type": {
  9890. "type": "string",
  9891. "const": "patch"
  9892. },
  9893. "hash": {
  9894. "type": "string"
  9895. },
  9896. "files": {
  9897. "type": "array",
  9898. "items": {
  9899. "type": "string"
  9900. }
  9901. }
  9902. },
  9903. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  9904. },
  9905. "AgentPart": {
  9906. "type": "object",
  9907. "properties": {
  9908. "id": {
  9909. "type": "string",
  9910. "pattern": "^prt.*"
  9911. },
  9912. "sessionID": {
  9913. "type": "string",
  9914. "pattern": "^ses.*"
  9915. },
  9916. "messageID": {
  9917. "type": "string",
  9918. "pattern": "^msg.*"
  9919. },
  9920. "type": {
  9921. "type": "string",
  9922. "const": "agent"
  9923. },
  9924. "name": {
  9925. "type": "string"
  9926. },
  9927. "source": {
  9928. "type": "object",
  9929. "properties": {
  9930. "value": {
  9931. "type": "string"
  9932. },
  9933. "start": {
  9934. "type": "integer",
  9935. "minimum": -9007199254740991,
  9936. "maximum": 9007199254740991
  9937. },
  9938. "end": {
  9939. "type": "integer",
  9940. "minimum": -9007199254740991,
  9941. "maximum": 9007199254740991
  9942. }
  9943. },
  9944. "required": ["value", "start", "end"]
  9945. }
  9946. },
  9947. "required": ["id", "sessionID", "messageID", "type", "name"]
  9948. },
  9949. "RetryPart": {
  9950. "type": "object",
  9951. "properties": {
  9952. "id": {
  9953. "type": "string",
  9954. "pattern": "^prt.*"
  9955. },
  9956. "sessionID": {
  9957. "type": "string",
  9958. "pattern": "^ses.*"
  9959. },
  9960. "messageID": {
  9961. "type": "string",
  9962. "pattern": "^msg.*"
  9963. },
  9964. "type": {
  9965. "type": "string",
  9966. "const": "retry"
  9967. },
  9968. "attempt": {
  9969. "type": "number"
  9970. },
  9971. "error": {
  9972. "$ref": "#/components/schemas/APIError"
  9973. },
  9974. "time": {
  9975. "type": "object",
  9976. "properties": {
  9977. "created": {
  9978. "type": "number"
  9979. }
  9980. },
  9981. "required": ["created"]
  9982. }
  9983. },
  9984. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  9985. },
  9986. "CompactionPart": {
  9987. "type": "object",
  9988. "properties": {
  9989. "id": {
  9990. "type": "string",
  9991. "pattern": "^prt.*"
  9992. },
  9993. "sessionID": {
  9994. "type": "string",
  9995. "pattern": "^ses.*"
  9996. },
  9997. "messageID": {
  9998. "type": "string",
  9999. "pattern": "^msg.*"
  10000. },
  10001. "type": {
  10002. "type": "string",
  10003. "const": "compaction"
  10004. },
  10005. "auto": {
  10006. "type": "boolean"
  10007. },
  10008. "overflow": {
  10009. "type": "boolean"
  10010. },
  10011. "tail_start_id": {
  10012. "type": "string",
  10013. "pattern": "^msg.*"
  10014. }
  10015. },
  10016. "required": ["id", "sessionID", "messageID", "type", "auto"]
  10017. },
  10018. "Part": {
  10019. "anyOf": [
  10020. {
  10021. "$ref": "#/components/schemas/TextPart"
  10022. },
  10023. {
  10024. "$ref": "#/components/schemas/SubtaskPart"
  10025. },
  10026. {
  10027. "$ref": "#/components/schemas/ReasoningPart"
  10028. },
  10029. {
  10030. "$ref": "#/components/schemas/FilePart"
  10031. },
  10032. {
  10033. "$ref": "#/components/schemas/ToolPart"
  10034. },
  10035. {
  10036. "$ref": "#/components/schemas/StepStartPart"
  10037. },
  10038. {
  10039. "$ref": "#/components/schemas/StepFinishPart"
  10040. },
  10041. {
  10042. "$ref": "#/components/schemas/SnapshotPart"
  10043. },
  10044. {
  10045. "$ref": "#/components/schemas/PatchPart"
  10046. },
  10047. {
  10048. "$ref": "#/components/schemas/AgentPart"
  10049. },
  10050. {
  10051. "$ref": "#/components/schemas/RetryPart"
  10052. },
  10053. {
  10054. "$ref": "#/components/schemas/CompactionPart"
  10055. }
  10056. ]
  10057. },
  10058. "Event.message.part.updated": {
  10059. "type": "object",
  10060. "properties": {
  10061. "type": {
  10062. "type": "string",
  10063. "const": "message.part.updated"
  10064. },
  10065. "properties": {
  10066. "type": "object",
  10067. "properties": {
  10068. "sessionID": {
  10069. "type": "string",
  10070. "pattern": "^ses.*"
  10071. },
  10072. "part": {
  10073. "$ref": "#/components/schemas/Part"
  10074. },
  10075. "time": {
  10076. "type": "number"
  10077. }
  10078. },
  10079. "required": ["sessionID", "part", "time"]
  10080. }
  10081. },
  10082. "required": ["type", "properties"]
  10083. },
  10084. "Event.message.part.removed": {
  10085. "type": "object",
  10086. "properties": {
  10087. "type": {
  10088. "type": "string",
  10089. "const": "message.part.removed"
  10090. },
  10091. "properties": {
  10092. "type": "object",
  10093. "properties": {
  10094. "sessionID": {
  10095. "type": "string",
  10096. "pattern": "^ses.*"
  10097. },
  10098. "messageID": {
  10099. "type": "string",
  10100. "pattern": "^msg.*"
  10101. },
  10102. "partID": {
  10103. "type": "string",
  10104. "pattern": "^prt.*"
  10105. }
  10106. },
  10107. "required": ["sessionID", "messageID", "partID"]
  10108. }
  10109. },
  10110. "required": ["type", "properties"]
  10111. },
  10112. "PermissionAction": {
  10113. "type": "string",
  10114. "enum": ["allow", "deny", "ask"]
  10115. },
  10116. "PermissionRule": {
  10117. "type": "object",
  10118. "properties": {
  10119. "permission": {
  10120. "type": "string"
  10121. },
  10122. "pattern": {
  10123. "type": "string"
  10124. },
  10125. "action": {
  10126. "$ref": "#/components/schemas/PermissionAction"
  10127. }
  10128. },
  10129. "required": ["permission", "pattern", "action"]
  10130. },
  10131. "PermissionRuleset": {
  10132. "type": "array",
  10133. "items": {
  10134. "$ref": "#/components/schemas/PermissionRule"
  10135. }
  10136. },
  10137. "Session": {
  10138. "type": "object",
  10139. "properties": {
  10140. "id": {
  10141. "type": "string",
  10142. "pattern": "^ses.*"
  10143. },
  10144. "slug": {
  10145. "type": "string"
  10146. },
  10147. "projectID": {
  10148. "type": "string"
  10149. },
  10150. "workspaceID": {
  10151. "type": "string",
  10152. "pattern": "^wrk.*"
  10153. },
  10154. "directory": {
  10155. "type": "string"
  10156. },
  10157. "parentID": {
  10158. "type": "string",
  10159. "pattern": "^ses.*"
  10160. },
  10161. "summary": {
  10162. "type": "object",
  10163. "properties": {
  10164. "additions": {
  10165. "type": "number"
  10166. },
  10167. "deletions": {
  10168. "type": "number"
  10169. },
  10170. "files": {
  10171. "type": "number"
  10172. },
  10173. "diffs": {
  10174. "type": "array",
  10175. "items": {
  10176. "$ref": "#/components/schemas/SnapshotFileDiff"
  10177. }
  10178. }
  10179. },
  10180. "required": ["additions", "deletions", "files"]
  10181. },
  10182. "share": {
  10183. "type": "object",
  10184. "properties": {
  10185. "url": {
  10186. "type": "string"
  10187. }
  10188. },
  10189. "required": ["url"]
  10190. },
  10191. "title": {
  10192. "type": "string"
  10193. },
  10194. "version": {
  10195. "type": "string"
  10196. },
  10197. "time": {
  10198. "type": "object",
  10199. "properties": {
  10200. "created": {
  10201. "type": "number"
  10202. },
  10203. "updated": {
  10204. "type": "number"
  10205. },
  10206. "compacting": {
  10207. "type": "number"
  10208. },
  10209. "archived": {
  10210. "type": "number"
  10211. }
  10212. },
  10213. "required": ["created", "updated"]
  10214. },
  10215. "permission": {
  10216. "$ref": "#/components/schemas/PermissionRuleset"
  10217. },
  10218. "revert": {
  10219. "type": "object",
  10220. "properties": {
  10221. "messageID": {
  10222. "type": "string",
  10223. "pattern": "^msg.*"
  10224. },
  10225. "partID": {
  10226. "type": "string",
  10227. "pattern": "^prt.*"
  10228. },
  10229. "snapshot": {
  10230. "type": "string"
  10231. },
  10232. "diff": {
  10233. "type": "string"
  10234. }
  10235. },
  10236. "required": ["messageID"]
  10237. }
  10238. },
  10239. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  10240. },
  10241. "Event.session.created": {
  10242. "type": "object",
  10243. "properties": {
  10244. "type": {
  10245. "type": "string",
  10246. "const": "session.created"
  10247. },
  10248. "properties": {
  10249. "type": "object",
  10250. "properties": {
  10251. "sessionID": {
  10252. "type": "string",
  10253. "pattern": "^ses.*"
  10254. },
  10255. "info": {
  10256. "$ref": "#/components/schemas/Session"
  10257. }
  10258. },
  10259. "required": ["sessionID", "info"]
  10260. }
  10261. },
  10262. "required": ["type", "properties"]
  10263. },
  10264. "Event.session.updated": {
  10265. "type": "object",
  10266. "properties": {
  10267. "type": {
  10268. "type": "string",
  10269. "const": "session.updated"
  10270. },
  10271. "properties": {
  10272. "type": "object",
  10273. "properties": {
  10274. "sessionID": {
  10275. "type": "string",
  10276. "pattern": "^ses.*"
  10277. },
  10278. "info": {
  10279. "$ref": "#/components/schemas/Session"
  10280. }
  10281. },
  10282. "required": ["sessionID", "info"]
  10283. }
  10284. },
  10285. "required": ["type", "properties"]
  10286. },
  10287. "Event.session.deleted": {
  10288. "type": "object",
  10289. "properties": {
  10290. "type": {
  10291. "type": "string",
  10292. "const": "session.deleted"
  10293. },
  10294. "properties": {
  10295. "type": "object",
  10296. "properties": {
  10297. "sessionID": {
  10298. "type": "string",
  10299. "pattern": "^ses.*"
  10300. },
  10301. "info": {
  10302. "$ref": "#/components/schemas/Session"
  10303. }
  10304. },
  10305. "required": ["sessionID", "info"]
  10306. }
  10307. },
  10308. "required": ["type", "properties"]
  10309. },
  10310. "SyncEvent.message.updated": {
  10311. "type": "object",
  10312. "properties": {
  10313. "type": {
  10314. "type": "string",
  10315. "const": "sync"
  10316. },
  10317. "name": {
  10318. "type": "string",
  10319. "const": "message.updated.1"
  10320. },
  10321. "id": {
  10322. "type": "string"
  10323. },
  10324. "seq": {
  10325. "type": "number"
  10326. },
  10327. "aggregateID": {
  10328. "type": "string",
  10329. "const": "sessionID"
  10330. },
  10331. "data": {
  10332. "type": "object",
  10333. "properties": {
  10334. "sessionID": {
  10335. "type": "string",
  10336. "pattern": "^ses.*"
  10337. },
  10338. "info": {
  10339. "$ref": "#/components/schemas/Message"
  10340. }
  10341. },
  10342. "required": ["sessionID", "info"]
  10343. }
  10344. },
  10345. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10346. },
  10347. "SyncEvent.message.removed": {
  10348. "type": "object",
  10349. "properties": {
  10350. "type": {
  10351. "type": "string",
  10352. "const": "sync"
  10353. },
  10354. "name": {
  10355. "type": "string",
  10356. "const": "message.removed.1"
  10357. },
  10358. "id": {
  10359. "type": "string"
  10360. },
  10361. "seq": {
  10362. "type": "number"
  10363. },
  10364. "aggregateID": {
  10365. "type": "string",
  10366. "const": "sessionID"
  10367. },
  10368. "data": {
  10369. "type": "object",
  10370. "properties": {
  10371. "sessionID": {
  10372. "type": "string",
  10373. "pattern": "^ses.*"
  10374. },
  10375. "messageID": {
  10376. "type": "string",
  10377. "pattern": "^msg.*"
  10378. }
  10379. },
  10380. "required": ["sessionID", "messageID"]
  10381. }
  10382. },
  10383. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10384. },
  10385. "SyncEvent.message.part.updated": {
  10386. "type": "object",
  10387. "properties": {
  10388. "type": {
  10389. "type": "string",
  10390. "const": "sync"
  10391. },
  10392. "name": {
  10393. "type": "string",
  10394. "const": "message.part.updated.1"
  10395. },
  10396. "id": {
  10397. "type": "string"
  10398. },
  10399. "seq": {
  10400. "type": "number"
  10401. },
  10402. "aggregateID": {
  10403. "type": "string",
  10404. "const": "sessionID"
  10405. },
  10406. "data": {
  10407. "type": "object",
  10408. "properties": {
  10409. "sessionID": {
  10410. "type": "string",
  10411. "pattern": "^ses.*"
  10412. },
  10413. "part": {
  10414. "$ref": "#/components/schemas/Part"
  10415. },
  10416. "time": {
  10417. "type": "number"
  10418. }
  10419. },
  10420. "required": ["sessionID", "part", "time"]
  10421. }
  10422. },
  10423. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10424. },
  10425. "SyncEvent.message.part.removed": {
  10426. "type": "object",
  10427. "properties": {
  10428. "type": {
  10429. "type": "string",
  10430. "const": "sync"
  10431. },
  10432. "name": {
  10433. "type": "string",
  10434. "const": "message.part.removed.1"
  10435. },
  10436. "id": {
  10437. "type": "string"
  10438. },
  10439. "seq": {
  10440. "type": "number"
  10441. },
  10442. "aggregateID": {
  10443. "type": "string",
  10444. "const": "sessionID"
  10445. },
  10446. "data": {
  10447. "type": "object",
  10448. "properties": {
  10449. "sessionID": {
  10450. "type": "string",
  10451. "pattern": "^ses.*"
  10452. },
  10453. "messageID": {
  10454. "type": "string",
  10455. "pattern": "^msg.*"
  10456. },
  10457. "partID": {
  10458. "type": "string",
  10459. "pattern": "^prt.*"
  10460. }
  10461. },
  10462. "required": ["sessionID", "messageID", "partID"]
  10463. }
  10464. },
  10465. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10466. },
  10467. "SyncEvent.session.created": {
  10468. "type": "object",
  10469. "properties": {
  10470. "type": {
  10471. "type": "string",
  10472. "const": "sync"
  10473. },
  10474. "name": {
  10475. "type": "string",
  10476. "const": "session.created.1"
  10477. },
  10478. "id": {
  10479. "type": "string"
  10480. },
  10481. "seq": {
  10482. "type": "number"
  10483. },
  10484. "aggregateID": {
  10485. "type": "string",
  10486. "const": "sessionID"
  10487. },
  10488. "data": {
  10489. "type": "object",
  10490. "properties": {
  10491. "sessionID": {
  10492. "type": "string",
  10493. "pattern": "^ses.*"
  10494. },
  10495. "info": {
  10496. "$ref": "#/components/schemas/Session"
  10497. }
  10498. },
  10499. "required": ["sessionID", "info"]
  10500. }
  10501. },
  10502. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10503. },
  10504. "SyncEvent.session.updated": {
  10505. "type": "object",
  10506. "properties": {
  10507. "type": {
  10508. "type": "string",
  10509. "const": "sync"
  10510. },
  10511. "name": {
  10512. "type": "string",
  10513. "const": "session.updated.1"
  10514. },
  10515. "id": {
  10516. "type": "string"
  10517. },
  10518. "seq": {
  10519. "type": "number"
  10520. },
  10521. "aggregateID": {
  10522. "type": "string",
  10523. "const": "sessionID"
  10524. },
  10525. "data": {
  10526. "type": "object",
  10527. "properties": {
  10528. "sessionID": {
  10529. "type": "string",
  10530. "pattern": "^ses.*"
  10531. },
  10532. "info": {
  10533. "type": "object",
  10534. "properties": {
  10535. "id": {
  10536. "anyOf": [
  10537. {
  10538. "type": "string",
  10539. "pattern": "^ses.*"
  10540. },
  10541. {
  10542. "type": "null"
  10543. }
  10544. ]
  10545. },
  10546. "slug": {
  10547. "anyOf": [
  10548. {
  10549. "type": "string"
  10550. },
  10551. {
  10552. "type": "null"
  10553. }
  10554. ]
  10555. },
  10556. "projectID": {
  10557. "anyOf": [
  10558. {
  10559. "type": "string"
  10560. },
  10561. {
  10562. "type": "null"
  10563. }
  10564. ]
  10565. },
  10566. "workspaceID": {
  10567. "anyOf": [
  10568. {
  10569. "type": "string",
  10570. "pattern": "^wrk.*"
  10571. },
  10572. {
  10573. "type": "null"
  10574. }
  10575. ]
  10576. },
  10577. "directory": {
  10578. "anyOf": [
  10579. {
  10580. "type": "string"
  10581. },
  10582. {
  10583. "type": "null"
  10584. }
  10585. ]
  10586. },
  10587. "parentID": {
  10588. "anyOf": [
  10589. {
  10590. "type": "string",
  10591. "pattern": "^ses.*"
  10592. },
  10593. {
  10594. "type": "null"
  10595. }
  10596. ]
  10597. },
  10598. "summary": {
  10599. "anyOf": [
  10600. {
  10601. "type": "object",
  10602. "properties": {
  10603. "additions": {
  10604. "type": "number"
  10605. },
  10606. "deletions": {
  10607. "type": "number"
  10608. },
  10609. "files": {
  10610. "type": "number"
  10611. },
  10612. "diffs": {
  10613. "type": "array",
  10614. "items": {
  10615. "$ref": "#/components/schemas/SnapshotFileDiff"
  10616. }
  10617. }
  10618. },
  10619. "required": ["additions", "deletions", "files"]
  10620. },
  10621. {
  10622. "type": "null"
  10623. }
  10624. ]
  10625. },
  10626. "share": {
  10627. "type": "object",
  10628. "properties": {
  10629. "url": {
  10630. "anyOf": [
  10631. {
  10632. "type": "string"
  10633. },
  10634. {
  10635. "type": "null"
  10636. }
  10637. ]
  10638. }
  10639. }
  10640. },
  10641. "title": {
  10642. "anyOf": [
  10643. {
  10644. "type": "string"
  10645. },
  10646. {
  10647. "type": "null"
  10648. }
  10649. ]
  10650. },
  10651. "version": {
  10652. "anyOf": [
  10653. {
  10654. "type": "string"
  10655. },
  10656. {
  10657. "type": "null"
  10658. }
  10659. ]
  10660. },
  10661. "time": {
  10662. "type": "object",
  10663. "properties": {
  10664. "created": {
  10665. "anyOf": [
  10666. {
  10667. "type": "number"
  10668. },
  10669. {
  10670. "type": "null"
  10671. }
  10672. ]
  10673. },
  10674. "updated": {
  10675. "anyOf": [
  10676. {
  10677. "type": "number"
  10678. },
  10679. {
  10680. "type": "null"
  10681. }
  10682. ]
  10683. },
  10684. "compacting": {
  10685. "anyOf": [
  10686. {
  10687. "type": "number"
  10688. },
  10689. {
  10690. "type": "null"
  10691. }
  10692. ]
  10693. },
  10694. "archived": {
  10695. "anyOf": [
  10696. {
  10697. "type": "number"
  10698. },
  10699. {
  10700. "type": "null"
  10701. }
  10702. ]
  10703. }
  10704. }
  10705. },
  10706. "permission": {
  10707. "anyOf": [
  10708. {
  10709. "$ref": "#/components/schemas/PermissionRuleset"
  10710. },
  10711. {
  10712. "type": "null"
  10713. }
  10714. ]
  10715. },
  10716. "revert": {
  10717. "anyOf": [
  10718. {
  10719. "type": "object",
  10720. "properties": {
  10721. "messageID": {
  10722. "type": "string",
  10723. "pattern": "^msg.*"
  10724. },
  10725. "partID": {
  10726. "type": "string",
  10727. "pattern": "^prt.*"
  10728. },
  10729. "snapshot": {
  10730. "type": "string"
  10731. },
  10732. "diff": {
  10733. "type": "string"
  10734. }
  10735. },
  10736. "required": ["messageID"]
  10737. },
  10738. {
  10739. "type": "null"
  10740. }
  10741. ]
  10742. }
  10743. }
  10744. }
  10745. },
  10746. "required": ["sessionID", "info"]
  10747. }
  10748. },
  10749. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10750. },
  10751. "SyncEvent.session.deleted": {
  10752. "type": "object",
  10753. "properties": {
  10754. "type": {
  10755. "type": "string",
  10756. "const": "sync"
  10757. },
  10758. "name": {
  10759. "type": "string",
  10760. "const": "session.deleted.1"
  10761. },
  10762. "id": {
  10763. "type": "string"
  10764. },
  10765. "seq": {
  10766. "type": "number"
  10767. },
  10768. "aggregateID": {
  10769. "type": "string",
  10770. "const": "sessionID"
  10771. },
  10772. "data": {
  10773. "type": "object",
  10774. "properties": {
  10775. "sessionID": {
  10776. "type": "string",
  10777. "pattern": "^ses.*"
  10778. },
  10779. "info": {
  10780. "$ref": "#/components/schemas/Session"
  10781. }
  10782. },
  10783. "required": ["sessionID", "info"]
  10784. }
  10785. },
  10786. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10787. },
  10788. "GlobalEvent": {
  10789. "type": "object",
  10790. "properties": {
  10791. "directory": {
  10792. "type": "string"
  10793. },
  10794. "project": {
  10795. "type": "string"
  10796. },
  10797. "workspace": {
  10798. "type": "string"
  10799. },
  10800. "payload": {
  10801. "anyOf": [
  10802. {
  10803. "$ref": "#/components/schemas/Event.project.updated"
  10804. },
  10805. {
  10806. "$ref": "#/components/schemas/Event.server.instance.disposed"
  10807. },
  10808. {
  10809. "$ref": "#/components/schemas/Event.server.connected"
  10810. },
  10811. {
  10812. "$ref": "#/components/schemas/Event.global.disposed"
  10813. },
  10814. {
  10815. "$ref": "#/components/schemas/Event.file.edited"
  10816. },
  10817. {
  10818. "$ref": "#/components/schemas/Event.file.watcher.updated"
  10819. },
  10820. {
  10821. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  10822. },
  10823. {
  10824. "$ref": "#/components/schemas/Event.lsp.updated"
  10825. },
  10826. {
  10827. "$ref": "#/components/schemas/Event.message.part.delta"
  10828. },
  10829. {
  10830. "$ref": "#/components/schemas/Event.permission.asked"
  10831. },
  10832. {
  10833. "$ref": "#/components/schemas/Event.permission.replied"
  10834. },
  10835. {
  10836. "$ref": "#/components/schemas/Event.session.diff"
  10837. },
  10838. {
  10839. "$ref": "#/components/schemas/Event.session.error"
  10840. },
  10841. {
  10842. "$ref": "#/components/schemas/Event.installation.updated"
  10843. },
  10844. {
  10845. "$ref": "#/components/schemas/Event.installation.update-available"
  10846. },
  10847. {
  10848. "$ref": "#/components/schemas/Event.question.asked"
  10849. },
  10850. {
  10851. "$ref": "#/components/schemas/Event.question.replied"
  10852. },
  10853. {
  10854. "$ref": "#/components/schemas/Event.question.rejected"
  10855. },
  10856. {
  10857. "$ref": "#/components/schemas/Event.todo.updated"
  10858. },
  10859. {
  10860. "$ref": "#/components/schemas/Event.session.status"
  10861. },
  10862. {
  10863. "$ref": "#/components/schemas/Event.session.idle"
  10864. },
  10865. {
  10866. "$ref": "#/components/schemas/Event.session.compacted"
  10867. },
  10868. {
  10869. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10870. },
  10871. {
  10872. "$ref": "#/components/schemas/Event.tui.command.execute"
  10873. },
  10874. {
  10875. "$ref": "#/components/schemas/Event.tui.toast.show"
  10876. },
  10877. {
  10878. "$ref": "#/components/schemas/Event.tui.session.select"
  10879. },
  10880. {
  10881. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  10882. },
  10883. {
  10884. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  10885. },
  10886. {
  10887. "$ref": "#/components/schemas/Event.command.executed"
  10888. },
  10889. {
  10890. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  10891. },
  10892. {
  10893. "$ref": "#/components/schemas/Event.worktree.ready"
  10894. },
  10895. {
  10896. "$ref": "#/components/schemas/Event.worktree.failed"
  10897. },
  10898. {
  10899. "$ref": "#/components/schemas/Event.pty.created"
  10900. },
  10901. {
  10902. "$ref": "#/components/schemas/Event.pty.updated"
  10903. },
  10904. {
  10905. "$ref": "#/components/schemas/Event.pty.exited"
  10906. },
  10907. {
  10908. "$ref": "#/components/schemas/Event.pty.deleted"
  10909. },
  10910. {
  10911. "$ref": "#/components/schemas/Event.workspace.ready"
  10912. },
  10913. {
  10914. "$ref": "#/components/schemas/Event.workspace.failed"
  10915. },
  10916. {
  10917. "$ref": "#/components/schemas/Event.workspace.restore"
  10918. },
  10919. {
  10920. "$ref": "#/components/schemas/Event.workspace.status"
  10921. },
  10922. {
  10923. "$ref": "#/components/schemas/Event.message.updated"
  10924. },
  10925. {
  10926. "$ref": "#/components/schemas/Event.message.removed"
  10927. },
  10928. {
  10929. "$ref": "#/components/schemas/Event.message.part.updated"
  10930. },
  10931. {
  10932. "$ref": "#/components/schemas/Event.message.part.removed"
  10933. },
  10934. {
  10935. "$ref": "#/components/schemas/Event.session.created"
  10936. },
  10937. {
  10938. "$ref": "#/components/schemas/Event.session.updated"
  10939. },
  10940. {
  10941. "$ref": "#/components/schemas/Event.session.deleted"
  10942. },
  10943. {
  10944. "$ref": "#/components/schemas/SyncEvent.message.updated"
  10945. },
  10946. {
  10947. "$ref": "#/components/schemas/SyncEvent.message.removed"
  10948. },
  10949. {
  10950. "$ref": "#/components/schemas/SyncEvent.message.part.updated"
  10951. },
  10952. {
  10953. "$ref": "#/components/schemas/SyncEvent.message.part.removed"
  10954. },
  10955. {
  10956. "$ref": "#/components/schemas/SyncEvent.session.created"
  10957. },
  10958. {
  10959. "$ref": "#/components/schemas/SyncEvent.session.updated"
  10960. },
  10961. {
  10962. "$ref": "#/components/schemas/SyncEvent.session.deleted"
  10963. }
  10964. ]
  10965. }
  10966. },
  10967. "required": ["directory", "payload"]
  10968. },
  10969. "LogLevel": {
  10970. "description": "Log level",
  10971. "type": "string",
  10972. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  10973. },
  10974. "ServerConfig": {
  10975. "description": "Server configuration for opencode serve and web commands",
  10976. "type": "object",
  10977. "properties": {
  10978. "port": {
  10979. "description": "Port to listen on",
  10980. "type": "integer",
  10981. "exclusiveMinimum": 0,
  10982. "maximum": 9007199254740991
  10983. },
  10984. "hostname": {
  10985. "description": "Hostname to listen on",
  10986. "type": "string"
  10987. },
  10988. "mdns": {
  10989. "description": "Enable mDNS service discovery",
  10990. "type": "boolean"
  10991. },
  10992. "mdnsDomain": {
  10993. "description": "Custom domain name for mDNS service (default: opencode.local)",
  10994. "type": "string"
  10995. },
  10996. "cors": {
  10997. "description": "Additional domains to allow for CORS",
  10998. "type": "array",
  10999. "items": {
  11000. "type": "string"
  11001. }
  11002. }
  11003. }
  11004. },
  11005. "PermissionActionConfig": {
  11006. "type": "string",
  11007. "enum": ["ask", "allow", "deny"]
  11008. },
  11009. "PermissionObjectConfig": {
  11010. "type": "object",
  11011. "propertyNames": {
  11012. "type": "string"
  11013. },
  11014. "additionalProperties": {
  11015. "$ref": "#/components/schemas/PermissionActionConfig"
  11016. }
  11017. },
  11018. "PermissionRuleConfig": {
  11019. "anyOf": [
  11020. {
  11021. "$ref": "#/components/schemas/PermissionActionConfig"
  11022. },
  11023. {
  11024. "$ref": "#/components/schemas/PermissionObjectConfig"
  11025. }
  11026. ]
  11027. },
  11028. "PermissionConfig": {
  11029. "anyOf": [
  11030. {
  11031. "$ref": "#/components/schemas/PermissionActionConfig"
  11032. },
  11033. {
  11034. "type": "object",
  11035. "properties": {
  11036. "read": {
  11037. "$ref": "#/components/schemas/PermissionRuleConfig"
  11038. },
  11039. "edit": {
  11040. "$ref": "#/components/schemas/PermissionRuleConfig"
  11041. },
  11042. "glob": {
  11043. "$ref": "#/components/schemas/PermissionRuleConfig"
  11044. },
  11045. "grep": {
  11046. "$ref": "#/components/schemas/PermissionRuleConfig"
  11047. },
  11048. "list": {
  11049. "$ref": "#/components/schemas/PermissionRuleConfig"
  11050. },
  11051. "bash": {
  11052. "$ref": "#/components/schemas/PermissionRuleConfig"
  11053. },
  11054. "task": {
  11055. "$ref": "#/components/schemas/PermissionRuleConfig"
  11056. },
  11057. "external_directory": {
  11058. "$ref": "#/components/schemas/PermissionRuleConfig"
  11059. },
  11060. "todowrite": {
  11061. "$ref": "#/components/schemas/PermissionActionConfig"
  11062. },
  11063. "question": {
  11064. "$ref": "#/components/schemas/PermissionActionConfig"
  11065. },
  11066. "webfetch": {
  11067. "$ref": "#/components/schemas/PermissionActionConfig"
  11068. },
  11069. "websearch": {
  11070. "$ref": "#/components/schemas/PermissionActionConfig"
  11071. },
  11072. "codesearch": {
  11073. "$ref": "#/components/schemas/PermissionActionConfig"
  11074. },
  11075. "lsp": {
  11076. "$ref": "#/components/schemas/PermissionRuleConfig"
  11077. },
  11078. "doom_loop": {
  11079. "$ref": "#/components/schemas/PermissionActionConfig"
  11080. },
  11081. "skill": {
  11082. "$ref": "#/components/schemas/PermissionRuleConfig"
  11083. }
  11084. },
  11085. "additionalProperties": {
  11086. "$ref": "#/components/schemas/PermissionRuleConfig"
  11087. }
  11088. }
  11089. ]
  11090. },
  11091. "AgentConfig": {
  11092. "type": "object",
  11093. "properties": {
  11094. "model": {
  11095. "type": "string"
  11096. },
  11097. "variant": {
  11098. "description": "Default model variant for this agent (applies only when using the agent's configured model).",
  11099. "type": "string"
  11100. },
  11101. "temperature": {
  11102. "type": "number"
  11103. },
  11104. "top_p": {
  11105. "type": "number"
  11106. },
  11107. "prompt": {
  11108. "type": "string"
  11109. },
  11110. "tools": {
  11111. "description": "@deprecated Use 'permission' field instead",
  11112. "type": "object",
  11113. "propertyNames": {
  11114. "type": "string"
  11115. },
  11116. "additionalProperties": {
  11117. "type": "boolean"
  11118. }
  11119. },
  11120. "disable": {
  11121. "type": "boolean"
  11122. },
  11123. "description": {
  11124. "description": "Description of when to use the agent",
  11125. "type": "string"
  11126. },
  11127. "mode": {
  11128. "type": "string",
  11129. "enum": ["subagent", "primary", "all"]
  11130. },
  11131. "hidden": {
  11132. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  11133. "type": "boolean"
  11134. },
  11135. "options": {
  11136. "type": "object",
  11137. "propertyNames": {
  11138. "type": "string"
  11139. },
  11140. "additionalProperties": {}
  11141. },
  11142. "color": {
  11143. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)",
  11144. "anyOf": [
  11145. {
  11146. "type": "string",
  11147. "pattern": "^#[0-9a-fA-F]{6}$"
  11148. },
  11149. {
  11150. "type": "string",
  11151. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11152. }
  11153. ]
  11154. },
  11155. "steps": {
  11156. "description": "Maximum number of agentic iterations before forcing text-only response",
  11157. "type": "integer",
  11158. "exclusiveMinimum": 0,
  11159. "maximum": 9007199254740991
  11160. },
  11161. "maxSteps": {
  11162. "description": "@deprecated Use 'steps' field instead.",
  11163. "type": "integer",
  11164. "exclusiveMinimum": 0,
  11165. "maximum": 9007199254740991
  11166. },
  11167. "permission": {
  11168. "$ref": "#/components/schemas/PermissionConfig"
  11169. }
  11170. },
  11171. "additionalProperties": {}
  11172. },
  11173. "ProviderConfig": {
  11174. "type": "object",
  11175. "properties": {
  11176. "api": {
  11177. "type": "string"
  11178. },
  11179. "name": {
  11180. "type": "string"
  11181. },
  11182. "env": {
  11183. "type": "array",
  11184. "items": {
  11185. "type": "string"
  11186. }
  11187. },
  11188. "id": {
  11189. "type": "string"
  11190. },
  11191. "npm": {
  11192. "type": "string"
  11193. },
  11194. "whitelist": {
  11195. "type": "array",
  11196. "items": {
  11197. "type": "string"
  11198. }
  11199. },
  11200. "blacklist": {
  11201. "type": "array",
  11202. "items": {
  11203. "type": "string"
  11204. }
  11205. },
  11206. "options": {
  11207. "type": "object",
  11208. "properties": {
  11209. "apiKey": {
  11210. "type": "string"
  11211. },
  11212. "baseURL": {
  11213. "type": "string"
  11214. },
  11215. "enterpriseUrl": {
  11216. "description": "GitHub Enterprise URL for copilot authentication",
  11217. "type": "string"
  11218. },
  11219. "setCacheKey": {
  11220. "description": "Enable promptCacheKey for this provider (default false)",
  11221. "type": "boolean"
  11222. },
  11223. "timeout": {
  11224. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  11225. "anyOf": [
  11226. {
  11227. "type": "integer",
  11228. "exclusiveMinimum": 0,
  11229. "maximum": 9007199254740991
  11230. },
  11231. {
  11232. "type": "boolean",
  11233. "const": false
  11234. }
  11235. ]
  11236. },
  11237. "chunkTimeout": {
  11238. "description": "Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted.",
  11239. "type": "integer",
  11240. "exclusiveMinimum": 0,
  11241. "maximum": 9007199254740991
  11242. }
  11243. },
  11244. "additionalProperties": {}
  11245. },
  11246. "models": {
  11247. "type": "object",
  11248. "propertyNames": {
  11249. "type": "string"
  11250. },
  11251. "additionalProperties": {
  11252. "type": "object",
  11253. "properties": {
  11254. "id": {
  11255. "type": "string"
  11256. },
  11257. "name": {
  11258. "type": "string"
  11259. },
  11260. "family": {
  11261. "type": "string"
  11262. },
  11263. "release_date": {
  11264. "type": "string"
  11265. },
  11266. "attachment": {
  11267. "type": "boolean"
  11268. },
  11269. "reasoning": {
  11270. "type": "boolean"
  11271. },
  11272. "temperature": {
  11273. "type": "boolean"
  11274. },
  11275. "tool_call": {
  11276. "type": "boolean"
  11277. },
  11278. "interleaved": {
  11279. "anyOf": [
  11280. {
  11281. "type": "boolean",
  11282. "const": true
  11283. },
  11284. {
  11285. "type": "object",
  11286. "properties": {
  11287. "field": {
  11288. "type": "string",
  11289. "enum": ["reasoning_content", "reasoning_details"]
  11290. }
  11291. },
  11292. "required": ["field"]
  11293. }
  11294. ]
  11295. },
  11296. "cost": {
  11297. "type": "object",
  11298. "properties": {
  11299. "input": {
  11300. "type": "number"
  11301. },
  11302. "output": {
  11303. "type": "number"
  11304. },
  11305. "cache_read": {
  11306. "type": "number"
  11307. },
  11308. "cache_write": {
  11309. "type": "number"
  11310. },
  11311. "context_over_200k": {
  11312. "type": "object",
  11313. "properties": {
  11314. "input": {
  11315. "type": "number"
  11316. },
  11317. "output": {
  11318. "type": "number"
  11319. },
  11320. "cache_read": {
  11321. "type": "number"
  11322. },
  11323. "cache_write": {
  11324. "type": "number"
  11325. }
  11326. },
  11327. "required": ["input", "output"]
  11328. }
  11329. },
  11330. "required": ["input", "output"]
  11331. },
  11332. "limit": {
  11333. "type": "object",
  11334. "properties": {
  11335. "context": {
  11336. "type": "number"
  11337. },
  11338. "input": {
  11339. "type": "number"
  11340. },
  11341. "output": {
  11342. "type": "number"
  11343. }
  11344. },
  11345. "required": ["context", "output"]
  11346. },
  11347. "modalities": {
  11348. "type": "object",
  11349. "properties": {
  11350. "input": {
  11351. "type": "array",
  11352. "items": {
  11353. "type": "string",
  11354. "enum": ["text", "audio", "image", "video", "pdf"]
  11355. }
  11356. },
  11357. "output": {
  11358. "type": "array",
  11359. "items": {
  11360. "type": "string",
  11361. "enum": ["text", "audio", "image", "video", "pdf"]
  11362. }
  11363. }
  11364. },
  11365. "required": ["input", "output"]
  11366. },
  11367. "experimental": {
  11368. "type": "boolean"
  11369. },
  11370. "status": {
  11371. "type": "string",
  11372. "enum": ["alpha", "beta", "deprecated"]
  11373. },
  11374. "provider": {
  11375. "type": "object",
  11376. "properties": {
  11377. "npm": {
  11378. "type": "string"
  11379. },
  11380. "api": {
  11381. "type": "string"
  11382. }
  11383. }
  11384. },
  11385. "options": {
  11386. "type": "object",
  11387. "propertyNames": {
  11388. "type": "string"
  11389. },
  11390. "additionalProperties": {}
  11391. },
  11392. "headers": {
  11393. "type": "object",
  11394. "propertyNames": {
  11395. "type": "string"
  11396. },
  11397. "additionalProperties": {
  11398. "type": "string"
  11399. }
  11400. },
  11401. "variants": {
  11402. "description": "Variant-specific configuration",
  11403. "type": "object",
  11404. "propertyNames": {
  11405. "type": "string"
  11406. },
  11407. "additionalProperties": {
  11408. "type": "object",
  11409. "properties": {
  11410. "disabled": {
  11411. "description": "Disable this variant for the model",
  11412. "type": "boolean"
  11413. }
  11414. },
  11415. "additionalProperties": {}
  11416. }
  11417. }
  11418. }
  11419. }
  11420. }
  11421. }
  11422. },
  11423. "McpLocalConfig": {
  11424. "type": "object",
  11425. "properties": {
  11426. "type": {
  11427. "description": "Type of MCP server connection",
  11428. "type": "string",
  11429. "const": "local"
  11430. },
  11431. "command": {
  11432. "description": "Command and arguments to run the MCP server",
  11433. "type": "array",
  11434. "items": {
  11435. "type": "string"
  11436. }
  11437. },
  11438. "environment": {
  11439. "description": "Environment variables to set when running the MCP server",
  11440. "type": "object",
  11441. "propertyNames": {
  11442. "type": "string"
  11443. },
  11444. "additionalProperties": {
  11445. "type": "string"
  11446. }
  11447. },
  11448. "enabled": {
  11449. "description": "Enable or disable the MCP server on startup",
  11450. "type": "boolean"
  11451. },
  11452. "timeout": {
  11453. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11454. "type": "number"
  11455. }
  11456. },
  11457. "required": ["type", "command"]
  11458. },
  11459. "McpOAuthConfig": {
  11460. "type": "object",
  11461. "properties": {
  11462. "clientId": {
  11463. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  11464. "type": "string"
  11465. },
  11466. "clientSecret": {
  11467. "description": "OAuth client secret (if required by the authorization server)",
  11468. "type": "string"
  11469. },
  11470. "scope": {
  11471. "description": "OAuth scopes to request during authorization",
  11472. "type": "string"
  11473. },
  11474. "redirectUri": {
  11475. "description": "OAuth redirect URI (default: http://127.0.0.1:19876/mcp/oauth/callback).",
  11476. "type": "string"
  11477. }
  11478. }
  11479. },
  11480. "McpRemoteConfig": {
  11481. "type": "object",
  11482. "properties": {
  11483. "type": {
  11484. "description": "Type of MCP server connection",
  11485. "type": "string",
  11486. "const": "remote"
  11487. },
  11488. "url": {
  11489. "description": "URL of the remote MCP server",
  11490. "type": "string"
  11491. },
  11492. "enabled": {
  11493. "description": "Enable or disable the MCP server on startup",
  11494. "type": "boolean"
  11495. },
  11496. "headers": {
  11497. "description": "Headers to send with the request",
  11498. "type": "object",
  11499. "propertyNames": {
  11500. "type": "string"
  11501. },
  11502. "additionalProperties": {
  11503. "type": "string"
  11504. }
  11505. },
  11506. "oauth": {
  11507. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  11508. "anyOf": [
  11509. {
  11510. "$ref": "#/components/schemas/McpOAuthConfig"
  11511. },
  11512. {
  11513. "type": "boolean",
  11514. "const": false
  11515. }
  11516. ]
  11517. },
  11518. "timeout": {
  11519. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11520. "type": "number"
  11521. }
  11522. },
  11523. "required": ["type", "url"]
  11524. },
  11525. "LayoutConfig": {
  11526. "description": "@deprecated Always uses stretch layout.",
  11527. "type": "string",
  11528. "enum": ["auto", "stretch"]
  11529. },
  11530. "Config": {
  11531. "type": "object",
  11532. "properties": {
  11533. "$schema": {
  11534. "description": "JSON schema reference for configuration validation",
  11535. "type": "string"
  11536. },
  11537. "shell": {
  11538. "description": "Default shell to use for terminal and bash tool",
  11539. "type": "string"
  11540. },
  11541. "logLevel": {
  11542. "$ref": "#/components/schemas/LogLevel"
  11543. },
  11544. "server": {
  11545. "$ref": "#/components/schemas/ServerConfig"
  11546. },
  11547. "command": {
  11548. "description": "Command configuration, see https://opencode.ai/docs/commands",
  11549. "type": "object",
  11550. "propertyNames": {
  11551. "type": "string"
  11552. },
  11553. "additionalProperties": {
  11554. "type": "object",
  11555. "properties": {
  11556. "template": {
  11557. "type": "string"
  11558. },
  11559. "description": {
  11560. "type": "string"
  11561. },
  11562. "agent": {
  11563. "type": "string"
  11564. },
  11565. "model": {
  11566. "type": "string"
  11567. },
  11568. "subtask": {
  11569. "type": "boolean"
  11570. }
  11571. },
  11572. "required": ["template"]
  11573. }
  11574. },
  11575. "skills": {
  11576. "description": "Additional skill folder paths",
  11577. "type": "object",
  11578. "properties": {
  11579. "paths": {
  11580. "description": "Additional paths to skill folders",
  11581. "type": "array",
  11582. "items": {
  11583. "type": "string"
  11584. }
  11585. },
  11586. "urls": {
  11587. "description": "URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)",
  11588. "type": "array",
  11589. "items": {
  11590. "type": "string"
  11591. }
  11592. }
  11593. }
  11594. },
  11595. "watcher": {
  11596. "type": "object",
  11597. "properties": {
  11598. "ignore": {
  11599. "type": "array",
  11600. "items": {
  11601. "type": "string"
  11602. }
  11603. }
  11604. }
  11605. },
  11606. "snapshot": {
  11607. "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.",
  11608. "type": "boolean"
  11609. },
  11610. "plugin": {
  11611. "type": "array",
  11612. "items": {
  11613. "anyOf": [
  11614. {
  11615. "type": "string"
  11616. },
  11617. {
  11618. "type": "array",
  11619. "prefixItems": [
  11620. {
  11621. "type": "string"
  11622. },
  11623. {
  11624. "type": "object",
  11625. "propertyNames": {
  11626. "type": "string"
  11627. },
  11628. "additionalProperties": {}
  11629. }
  11630. ]
  11631. }
  11632. ]
  11633. }
  11634. },
  11635. "share": {
  11636. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  11637. "type": "string",
  11638. "enum": ["manual", "auto", "disabled"]
  11639. },
  11640. "autoshare": {
  11641. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  11642. "type": "boolean"
  11643. },
  11644. "autoupdate": {
  11645. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  11646. "anyOf": [
  11647. {
  11648. "type": "boolean"
  11649. },
  11650. {
  11651. "type": "string",
  11652. "const": "notify"
  11653. }
  11654. ]
  11655. },
  11656. "disabled_providers": {
  11657. "description": "Disable providers that are loaded automatically",
  11658. "type": "array",
  11659. "items": {
  11660. "type": "string"
  11661. }
  11662. },
  11663. "enabled_providers": {
  11664. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  11665. "type": "array",
  11666. "items": {
  11667. "type": "string"
  11668. }
  11669. },
  11670. "model": {
  11671. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  11672. "type": "string"
  11673. },
  11674. "small_model": {
  11675. "description": "Small model to use for tasks like title generation in the format of provider/model",
  11676. "type": "string"
  11677. },
  11678. "default_agent": {
  11679. "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.",
  11680. "type": "string"
  11681. },
  11682. "username": {
  11683. "description": "Custom username to display in conversations instead of system username",
  11684. "type": "string"
  11685. },
  11686. "mode": {
  11687. "description": "@deprecated Use `agent` field instead.",
  11688. "type": "object",
  11689. "properties": {
  11690. "build": {
  11691. "$ref": "#/components/schemas/AgentConfig"
  11692. },
  11693. "plan": {
  11694. "$ref": "#/components/schemas/AgentConfig"
  11695. }
  11696. },
  11697. "additionalProperties": {
  11698. "$ref": "#/components/schemas/AgentConfig"
  11699. }
  11700. },
  11701. "agent": {
  11702. "description": "Agent configuration, see https://opencode.ai/docs/agents",
  11703. "type": "object",
  11704. "properties": {
  11705. "plan": {
  11706. "$ref": "#/components/schemas/AgentConfig"
  11707. },
  11708. "build": {
  11709. "$ref": "#/components/schemas/AgentConfig"
  11710. },
  11711. "general": {
  11712. "$ref": "#/components/schemas/AgentConfig"
  11713. },
  11714. "explore": {
  11715. "$ref": "#/components/schemas/AgentConfig"
  11716. },
  11717. "title": {
  11718. "$ref": "#/components/schemas/AgentConfig"
  11719. },
  11720. "summary": {
  11721. "$ref": "#/components/schemas/AgentConfig"
  11722. },
  11723. "compaction": {
  11724. "$ref": "#/components/schemas/AgentConfig"
  11725. }
  11726. },
  11727. "additionalProperties": {
  11728. "$ref": "#/components/schemas/AgentConfig"
  11729. }
  11730. },
  11731. "provider": {
  11732. "description": "Custom provider configurations and model overrides",
  11733. "type": "object",
  11734. "propertyNames": {
  11735. "type": "string"
  11736. },
  11737. "additionalProperties": {
  11738. "$ref": "#/components/schemas/ProviderConfig"
  11739. }
  11740. },
  11741. "mcp": {
  11742. "description": "MCP (Model Context Protocol) server configurations",
  11743. "type": "object",
  11744. "propertyNames": {
  11745. "type": "string"
  11746. },
  11747. "additionalProperties": {
  11748. "anyOf": [
  11749. {
  11750. "anyOf": [
  11751. {
  11752. "$ref": "#/components/schemas/McpLocalConfig"
  11753. },
  11754. {
  11755. "$ref": "#/components/schemas/McpRemoteConfig"
  11756. }
  11757. ]
  11758. },
  11759. {
  11760. "type": "object",
  11761. "properties": {
  11762. "enabled": {
  11763. "type": "boolean"
  11764. }
  11765. },
  11766. "required": ["enabled"]
  11767. }
  11768. ]
  11769. }
  11770. },
  11771. "formatter": {
  11772. "anyOf": [
  11773. {
  11774. "type": "boolean"
  11775. },
  11776. {
  11777. "type": "object",
  11778. "propertyNames": {
  11779. "type": "string"
  11780. },
  11781. "additionalProperties": {
  11782. "type": "object",
  11783. "properties": {
  11784. "disabled": {
  11785. "type": "boolean"
  11786. },
  11787. "command": {
  11788. "type": "array",
  11789. "items": {
  11790. "type": "string"
  11791. }
  11792. },
  11793. "environment": {
  11794. "type": "object",
  11795. "propertyNames": {
  11796. "type": "string"
  11797. },
  11798. "additionalProperties": {
  11799. "type": "string"
  11800. }
  11801. },
  11802. "extensions": {
  11803. "type": "array",
  11804. "items": {
  11805. "type": "string"
  11806. }
  11807. }
  11808. }
  11809. }
  11810. }
  11811. ]
  11812. },
  11813. "lsp": {
  11814. "anyOf": [
  11815. {
  11816. "type": "boolean"
  11817. },
  11818. {
  11819. "type": "object",
  11820. "propertyNames": {
  11821. "type": "string"
  11822. },
  11823. "additionalProperties": {
  11824. "anyOf": [
  11825. {
  11826. "type": "object",
  11827. "properties": {
  11828. "disabled": {
  11829. "type": "boolean",
  11830. "const": true
  11831. }
  11832. },
  11833. "required": ["disabled"]
  11834. },
  11835. {
  11836. "type": "object",
  11837. "properties": {
  11838. "command": {
  11839. "type": "array",
  11840. "items": {
  11841. "type": "string"
  11842. }
  11843. },
  11844. "extensions": {
  11845. "type": "array",
  11846. "items": {
  11847. "type": "string"
  11848. }
  11849. },
  11850. "disabled": {
  11851. "type": "boolean"
  11852. },
  11853. "env": {
  11854. "type": "object",
  11855. "propertyNames": {
  11856. "type": "string"
  11857. },
  11858. "additionalProperties": {
  11859. "type": "string"
  11860. }
  11861. },
  11862. "initialization": {
  11863. "type": "object",
  11864. "propertyNames": {
  11865. "type": "string"
  11866. },
  11867. "additionalProperties": {}
  11868. }
  11869. },
  11870. "required": ["command"]
  11871. }
  11872. ]
  11873. }
  11874. }
  11875. ]
  11876. },
  11877. "instructions": {
  11878. "description": "Additional instruction files or patterns to include",
  11879. "type": "array",
  11880. "items": {
  11881. "type": "string"
  11882. }
  11883. },
  11884. "layout": {
  11885. "$ref": "#/components/schemas/LayoutConfig"
  11886. },
  11887. "permission": {
  11888. "$ref": "#/components/schemas/PermissionConfig"
  11889. },
  11890. "tools": {
  11891. "type": "object",
  11892. "propertyNames": {
  11893. "type": "string"
  11894. },
  11895. "additionalProperties": {
  11896. "type": "boolean"
  11897. }
  11898. },
  11899. "enterprise": {
  11900. "type": "object",
  11901. "properties": {
  11902. "url": {
  11903. "description": "Enterprise URL",
  11904. "type": "string"
  11905. }
  11906. }
  11907. },
  11908. "tool_output": {
  11909. "description": "Thresholds for truncating tool output. When output exceeds either limit, the full text is written to the truncation directory and a preview is returned.",
  11910. "type": "object",
  11911. "properties": {
  11912. "max_lines": {
  11913. "description": "Maximum lines of tool output before it is truncated and saved to disk (default: 2000)",
  11914. "type": "integer",
  11915. "exclusiveMinimum": 0,
  11916. "maximum": 9007199254740991
  11917. },
  11918. "max_bytes": {
  11919. "description": "Maximum bytes of tool output before it is truncated and saved to disk (default: 51200)",
  11920. "type": "integer",
  11921. "exclusiveMinimum": 0,
  11922. "maximum": 9007199254740991
  11923. }
  11924. }
  11925. },
  11926. "compaction": {
  11927. "type": "object",
  11928. "properties": {
  11929. "auto": {
  11930. "description": "Enable automatic compaction when context is full (default: true)",
  11931. "type": "boolean"
  11932. },
  11933. "prune": {
  11934. "description": "Enable pruning of old tool outputs (default: true)",
  11935. "type": "boolean"
  11936. },
  11937. "tail_turns": {
  11938. "description": "Number of recent user turns, including their following assistant/tool responses, to keep verbatim during compaction (default: 2)",
  11939. "type": "integer",
  11940. "minimum": 0,
  11941. "maximum": 9007199254740991
  11942. },
  11943. "preserve_recent_tokens": {
  11944. "description": "Maximum number of tokens from recent turns to preserve verbatim after compaction",
  11945. "type": "integer",
  11946. "minimum": 0,
  11947. "maximum": 9007199254740991
  11948. },
  11949. "reserved": {
  11950. "description": "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.",
  11951. "type": "integer",
  11952. "minimum": 0,
  11953. "maximum": 9007199254740991
  11954. }
  11955. }
  11956. },
  11957. "experimental": {
  11958. "type": "object",
  11959. "properties": {
  11960. "disable_paste_summary": {
  11961. "type": "boolean"
  11962. },
  11963. "batch_tool": {
  11964. "description": "Enable the batch tool",
  11965. "type": "boolean"
  11966. },
  11967. "openTelemetry": {
  11968. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  11969. "type": "boolean"
  11970. },
  11971. "primary_tools": {
  11972. "description": "Tools that should only be available to primary agents.",
  11973. "type": "array",
  11974. "items": {
  11975. "type": "string"
  11976. }
  11977. },
  11978. "continue_loop_on_deny": {
  11979. "description": "Continue the agent loop when a tool call is denied",
  11980. "type": "boolean"
  11981. },
  11982. "mcp_timeout": {
  11983. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  11984. "type": "integer",
  11985. "exclusiveMinimum": 0,
  11986. "maximum": 9007199254740991
  11987. }
  11988. }
  11989. }
  11990. },
  11991. "additionalProperties": false
  11992. },
  11993. "BadRequestError": {
  11994. "type": "object",
  11995. "properties": {
  11996. "data": {},
  11997. "errors": {
  11998. "type": "array",
  11999. "items": {
  12000. "type": "object",
  12001. "propertyNames": {
  12002. "type": "string"
  12003. },
  12004. "additionalProperties": {}
  12005. }
  12006. },
  12007. "success": {
  12008. "type": "boolean",
  12009. "const": false
  12010. }
  12011. },
  12012. "required": ["data", "errors", "success"]
  12013. },
  12014. "OAuth": {
  12015. "type": "object",
  12016. "properties": {
  12017. "type": {
  12018. "type": "string",
  12019. "const": "oauth"
  12020. },
  12021. "refresh": {
  12022. "type": "string"
  12023. },
  12024. "access": {
  12025. "type": "string"
  12026. },
  12027. "expires": {
  12028. "type": "number"
  12029. },
  12030. "accountId": {
  12031. "type": "string"
  12032. },
  12033. "enterpriseUrl": {
  12034. "type": "string"
  12035. }
  12036. },
  12037. "required": ["type", "refresh", "access", "expires"]
  12038. },
  12039. "ApiAuth": {
  12040. "type": "object",
  12041. "properties": {
  12042. "type": {
  12043. "type": "string",
  12044. "const": "api"
  12045. },
  12046. "key": {
  12047. "type": "string"
  12048. },
  12049. "metadata": {
  12050. "type": "object",
  12051. "propertyNames": {
  12052. "type": "string"
  12053. },
  12054. "additionalProperties": {
  12055. "type": "string"
  12056. }
  12057. }
  12058. },
  12059. "required": ["type", "key"]
  12060. },
  12061. "WellKnownAuth": {
  12062. "type": "object",
  12063. "properties": {
  12064. "type": {
  12065. "type": "string",
  12066. "const": "wellknown"
  12067. },
  12068. "key": {
  12069. "type": "string"
  12070. },
  12071. "token": {
  12072. "type": "string"
  12073. }
  12074. },
  12075. "required": ["type", "key", "token"]
  12076. },
  12077. "Auth": {
  12078. "anyOf": [
  12079. {
  12080. "$ref": "#/components/schemas/OAuth"
  12081. },
  12082. {
  12083. "$ref": "#/components/schemas/ApiAuth"
  12084. },
  12085. {
  12086. "$ref": "#/components/schemas/WellKnownAuth"
  12087. }
  12088. ]
  12089. },
  12090. "Workspace": {
  12091. "type": "object",
  12092. "properties": {
  12093. "id": {
  12094. "type": "string",
  12095. "pattern": "^wrk.*"
  12096. },
  12097. "type": {
  12098. "type": "string"
  12099. },
  12100. "name": {
  12101. "type": "string"
  12102. },
  12103. "branch": {
  12104. "anyOf": [
  12105. {
  12106. "type": "string"
  12107. },
  12108. {
  12109. "type": "null"
  12110. }
  12111. ]
  12112. },
  12113. "directory": {
  12114. "anyOf": [
  12115. {
  12116. "type": "string"
  12117. },
  12118. {
  12119. "type": "null"
  12120. }
  12121. ]
  12122. },
  12123. "extra": {
  12124. "anyOf": [
  12125. {},
  12126. {
  12127. "type": "null"
  12128. }
  12129. ]
  12130. },
  12131. "projectID": {
  12132. "type": "string"
  12133. }
  12134. },
  12135. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"]
  12136. },
  12137. "NotFoundError": {
  12138. "type": "object",
  12139. "properties": {
  12140. "name": {
  12141. "type": "string",
  12142. "const": "NotFoundError"
  12143. },
  12144. "data": {
  12145. "type": "object",
  12146. "properties": {
  12147. "message": {
  12148. "type": "string"
  12149. }
  12150. },
  12151. "required": ["message"]
  12152. }
  12153. },
  12154. "required": ["name", "data"]
  12155. },
  12156. "Model": {
  12157. "type": "object",
  12158. "properties": {
  12159. "id": {
  12160. "type": "string"
  12161. },
  12162. "providerID": {
  12163. "type": "string"
  12164. },
  12165. "api": {
  12166. "type": "object",
  12167. "properties": {
  12168. "id": {
  12169. "type": "string"
  12170. },
  12171. "url": {
  12172. "type": "string"
  12173. },
  12174. "npm": {
  12175. "type": "string"
  12176. }
  12177. },
  12178. "required": ["id", "url", "npm"]
  12179. },
  12180. "name": {
  12181. "type": "string"
  12182. },
  12183. "family": {
  12184. "type": "string"
  12185. },
  12186. "capabilities": {
  12187. "type": "object",
  12188. "properties": {
  12189. "temperature": {
  12190. "type": "boolean"
  12191. },
  12192. "reasoning": {
  12193. "type": "boolean"
  12194. },
  12195. "attachment": {
  12196. "type": "boolean"
  12197. },
  12198. "toolcall": {
  12199. "type": "boolean"
  12200. },
  12201. "input": {
  12202. "type": "object",
  12203. "properties": {
  12204. "text": {
  12205. "type": "boolean"
  12206. },
  12207. "audio": {
  12208. "type": "boolean"
  12209. },
  12210. "image": {
  12211. "type": "boolean"
  12212. },
  12213. "video": {
  12214. "type": "boolean"
  12215. },
  12216. "pdf": {
  12217. "type": "boolean"
  12218. }
  12219. },
  12220. "required": ["text", "audio", "image", "video", "pdf"]
  12221. },
  12222. "output": {
  12223. "type": "object",
  12224. "properties": {
  12225. "text": {
  12226. "type": "boolean"
  12227. },
  12228. "audio": {
  12229. "type": "boolean"
  12230. },
  12231. "image": {
  12232. "type": "boolean"
  12233. },
  12234. "video": {
  12235. "type": "boolean"
  12236. },
  12237. "pdf": {
  12238. "type": "boolean"
  12239. }
  12240. },
  12241. "required": ["text", "audio", "image", "video", "pdf"]
  12242. },
  12243. "interleaved": {
  12244. "anyOf": [
  12245. {
  12246. "type": "boolean"
  12247. },
  12248. {
  12249. "type": "object",
  12250. "properties": {
  12251. "field": {
  12252. "type": "string",
  12253. "enum": ["reasoning_content", "reasoning_details"]
  12254. }
  12255. },
  12256. "required": ["field"]
  12257. }
  12258. ]
  12259. }
  12260. },
  12261. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  12262. },
  12263. "cost": {
  12264. "type": "object",
  12265. "properties": {
  12266. "input": {
  12267. "type": "number"
  12268. },
  12269. "output": {
  12270. "type": "number"
  12271. },
  12272. "cache": {
  12273. "type": "object",
  12274. "properties": {
  12275. "read": {
  12276. "type": "number"
  12277. },
  12278. "write": {
  12279. "type": "number"
  12280. }
  12281. },
  12282. "required": ["read", "write"]
  12283. },
  12284. "experimentalOver200K": {
  12285. "type": "object",
  12286. "properties": {
  12287. "input": {
  12288. "type": "number"
  12289. },
  12290. "output": {
  12291. "type": "number"
  12292. },
  12293. "cache": {
  12294. "type": "object",
  12295. "properties": {
  12296. "read": {
  12297. "type": "number"
  12298. },
  12299. "write": {
  12300. "type": "number"
  12301. }
  12302. },
  12303. "required": ["read", "write"]
  12304. }
  12305. },
  12306. "required": ["input", "output", "cache"]
  12307. }
  12308. },
  12309. "required": ["input", "output", "cache"]
  12310. },
  12311. "limit": {
  12312. "type": "object",
  12313. "properties": {
  12314. "context": {
  12315. "type": "number"
  12316. },
  12317. "input": {
  12318. "type": "number"
  12319. },
  12320. "output": {
  12321. "type": "number"
  12322. }
  12323. },
  12324. "required": ["context", "output"]
  12325. },
  12326. "status": {
  12327. "type": "string",
  12328. "enum": ["alpha", "beta", "deprecated", "active"]
  12329. },
  12330. "options": {
  12331. "type": "object",
  12332. "propertyNames": {
  12333. "type": "string"
  12334. },
  12335. "additionalProperties": {}
  12336. },
  12337. "headers": {
  12338. "type": "object",
  12339. "propertyNames": {
  12340. "type": "string"
  12341. },
  12342. "additionalProperties": {
  12343. "type": "string"
  12344. }
  12345. },
  12346. "release_date": {
  12347. "type": "string"
  12348. },
  12349. "variants": {
  12350. "type": "object",
  12351. "propertyNames": {
  12352. "type": "string"
  12353. },
  12354. "additionalProperties": {
  12355. "type": "object",
  12356. "propertyNames": {
  12357. "type": "string"
  12358. },
  12359. "additionalProperties": {}
  12360. }
  12361. }
  12362. },
  12363. "required": [
  12364. "id",
  12365. "providerID",
  12366. "api",
  12367. "name",
  12368. "capabilities",
  12369. "cost",
  12370. "limit",
  12371. "status",
  12372. "options",
  12373. "headers",
  12374. "release_date"
  12375. ]
  12376. },
  12377. "Provider": {
  12378. "type": "object",
  12379. "properties": {
  12380. "id": {
  12381. "type": "string"
  12382. },
  12383. "name": {
  12384. "type": "string"
  12385. },
  12386. "source": {
  12387. "type": "string",
  12388. "enum": ["env", "config", "custom", "api"]
  12389. },
  12390. "env": {
  12391. "type": "array",
  12392. "items": {
  12393. "type": "string"
  12394. }
  12395. },
  12396. "key": {
  12397. "type": "string"
  12398. },
  12399. "options": {
  12400. "type": "object",
  12401. "propertyNames": {
  12402. "type": "string"
  12403. },
  12404. "additionalProperties": {}
  12405. },
  12406. "models": {
  12407. "type": "object",
  12408. "propertyNames": {
  12409. "type": "string"
  12410. },
  12411. "additionalProperties": {
  12412. "$ref": "#/components/schemas/Model"
  12413. }
  12414. }
  12415. },
  12416. "required": ["id", "name", "source", "env", "options", "models"]
  12417. },
  12418. "ConsoleState": {
  12419. "type": "object",
  12420. "properties": {
  12421. "consoleManagedProviders": {
  12422. "type": "array",
  12423. "items": {
  12424. "type": "string"
  12425. }
  12426. },
  12427. "activeOrgName": {
  12428. "type": "string"
  12429. },
  12430. "switchableOrgCount": {
  12431. "type": "number"
  12432. }
  12433. },
  12434. "required": ["consoleManagedProviders", "switchableOrgCount"]
  12435. },
  12436. "ToolIDs": {
  12437. "type": "array",
  12438. "items": {
  12439. "type": "string"
  12440. }
  12441. },
  12442. "ToolListItem": {
  12443. "type": "object",
  12444. "properties": {
  12445. "id": {
  12446. "type": "string"
  12447. },
  12448. "description": {
  12449. "type": "string"
  12450. },
  12451. "parameters": {}
  12452. },
  12453. "required": ["id", "description", "parameters"]
  12454. },
  12455. "ToolList": {
  12456. "type": "array",
  12457. "items": {
  12458. "$ref": "#/components/schemas/ToolListItem"
  12459. }
  12460. },
  12461. "Worktree": {
  12462. "type": "object",
  12463. "properties": {
  12464. "name": {
  12465. "type": "string"
  12466. },
  12467. "branch": {
  12468. "type": "string"
  12469. },
  12470. "directory": {
  12471. "type": "string"
  12472. }
  12473. },
  12474. "required": ["name", "branch", "directory"]
  12475. },
  12476. "WorktreeCreateInput": {
  12477. "type": "object",
  12478. "properties": {
  12479. "name": {
  12480. "type": "string"
  12481. },
  12482. "startCommand": {
  12483. "description": "Additional startup script to run after the project's start command",
  12484. "type": "string"
  12485. }
  12486. }
  12487. },
  12488. "WorktreeRemoveInput": {
  12489. "type": "object",
  12490. "properties": {
  12491. "directory": {
  12492. "type": "string"
  12493. }
  12494. },
  12495. "required": ["directory"]
  12496. },
  12497. "WorktreeResetInput": {
  12498. "type": "object",
  12499. "properties": {
  12500. "directory": {
  12501. "type": "string"
  12502. }
  12503. },
  12504. "required": ["directory"]
  12505. },
  12506. "ProjectSummary": {
  12507. "type": "object",
  12508. "properties": {
  12509. "id": {
  12510. "type": "string"
  12511. },
  12512. "name": {
  12513. "type": "string"
  12514. },
  12515. "worktree": {
  12516. "type": "string"
  12517. }
  12518. },
  12519. "required": ["id", "worktree"]
  12520. },
  12521. "GlobalSession": {
  12522. "type": "object",
  12523. "properties": {
  12524. "id": {
  12525. "type": "string",
  12526. "pattern": "^ses.*"
  12527. },
  12528. "slug": {
  12529. "type": "string"
  12530. },
  12531. "projectID": {
  12532. "type": "string"
  12533. },
  12534. "workspaceID": {
  12535. "type": "string",
  12536. "pattern": "^wrk.*"
  12537. },
  12538. "directory": {
  12539. "type": "string"
  12540. },
  12541. "parentID": {
  12542. "type": "string",
  12543. "pattern": "^ses.*"
  12544. },
  12545. "summary": {
  12546. "type": "object",
  12547. "properties": {
  12548. "additions": {
  12549. "type": "number"
  12550. },
  12551. "deletions": {
  12552. "type": "number"
  12553. },
  12554. "files": {
  12555. "type": "number"
  12556. },
  12557. "diffs": {
  12558. "type": "array",
  12559. "items": {
  12560. "$ref": "#/components/schemas/SnapshotFileDiff"
  12561. }
  12562. }
  12563. },
  12564. "required": ["additions", "deletions", "files"]
  12565. },
  12566. "share": {
  12567. "type": "object",
  12568. "properties": {
  12569. "url": {
  12570. "type": "string"
  12571. }
  12572. },
  12573. "required": ["url"]
  12574. },
  12575. "title": {
  12576. "type": "string"
  12577. },
  12578. "version": {
  12579. "type": "string"
  12580. },
  12581. "time": {
  12582. "type": "object",
  12583. "properties": {
  12584. "created": {
  12585. "type": "number"
  12586. },
  12587. "updated": {
  12588. "type": "number"
  12589. },
  12590. "compacting": {
  12591. "type": "number"
  12592. },
  12593. "archived": {
  12594. "type": "number"
  12595. }
  12596. },
  12597. "required": ["created", "updated"]
  12598. },
  12599. "permission": {
  12600. "$ref": "#/components/schemas/PermissionRuleset"
  12601. },
  12602. "revert": {
  12603. "type": "object",
  12604. "properties": {
  12605. "messageID": {
  12606. "type": "string",
  12607. "pattern": "^msg.*"
  12608. },
  12609. "partID": {
  12610. "type": "string",
  12611. "pattern": "^prt.*"
  12612. },
  12613. "snapshot": {
  12614. "type": "string"
  12615. },
  12616. "diff": {
  12617. "type": "string"
  12618. }
  12619. },
  12620. "required": ["messageID"]
  12621. },
  12622. "project": {
  12623. "anyOf": [
  12624. {
  12625. "$ref": "#/components/schemas/ProjectSummary"
  12626. },
  12627. {
  12628. "type": "null"
  12629. }
  12630. ]
  12631. }
  12632. },
  12633. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"]
  12634. },
  12635. "McpResource": {
  12636. "type": "object",
  12637. "properties": {
  12638. "name": {
  12639. "type": "string"
  12640. },
  12641. "uri": {
  12642. "type": "string"
  12643. },
  12644. "description": {
  12645. "type": "string"
  12646. },
  12647. "mimeType": {
  12648. "type": "string"
  12649. },
  12650. "client": {
  12651. "type": "string"
  12652. }
  12653. },
  12654. "required": ["name", "uri", "client"]
  12655. },
  12656. "TextPartInput": {
  12657. "type": "object",
  12658. "properties": {
  12659. "id": {
  12660. "type": "string",
  12661. "pattern": "^prt.*"
  12662. },
  12663. "type": {
  12664. "type": "string",
  12665. "const": "text"
  12666. },
  12667. "text": {
  12668. "type": "string"
  12669. },
  12670. "synthetic": {
  12671. "type": "boolean"
  12672. },
  12673. "ignored": {
  12674. "type": "boolean"
  12675. },
  12676. "time": {
  12677. "type": "object",
  12678. "properties": {
  12679. "start": {
  12680. "type": "number"
  12681. },
  12682. "end": {
  12683. "type": "number"
  12684. }
  12685. },
  12686. "required": ["start"]
  12687. },
  12688. "metadata": {
  12689. "type": "object",
  12690. "propertyNames": {
  12691. "type": "string"
  12692. },
  12693. "additionalProperties": {}
  12694. }
  12695. },
  12696. "required": ["type", "text"]
  12697. },
  12698. "FilePartInput": {
  12699. "type": "object",
  12700. "properties": {
  12701. "id": {
  12702. "type": "string",
  12703. "pattern": "^prt.*"
  12704. },
  12705. "type": {
  12706. "type": "string",
  12707. "const": "file"
  12708. },
  12709. "mime": {
  12710. "type": "string"
  12711. },
  12712. "filename": {
  12713. "type": "string"
  12714. },
  12715. "url": {
  12716. "type": "string"
  12717. },
  12718. "source": {
  12719. "$ref": "#/components/schemas/FilePartSource"
  12720. }
  12721. },
  12722. "required": ["type", "mime", "url"]
  12723. },
  12724. "AgentPartInput": {
  12725. "type": "object",
  12726. "properties": {
  12727. "id": {
  12728. "type": "string",
  12729. "pattern": "^prt.*"
  12730. },
  12731. "type": {
  12732. "type": "string",
  12733. "const": "agent"
  12734. },
  12735. "name": {
  12736. "type": "string"
  12737. },
  12738. "source": {
  12739. "type": "object",
  12740. "properties": {
  12741. "value": {
  12742. "type": "string"
  12743. },
  12744. "start": {
  12745. "type": "integer",
  12746. "minimum": -9007199254740991,
  12747. "maximum": 9007199254740991
  12748. },
  12749. "end": {
  12750. "type": "integer",
  12751. "minimum": -9007199254740991,
  12752. "maximum": 9007199254740991
  12753. }
  12754. },
  12755. "required": ["value", "start", "end"]
  12756. }
  12757. },
  12758. "required": ["type", "name"]
  12759. },
  12760. "SubtaskPartInput": {
  12761. "type": "object",
  12762. "properties": {
  12763. "id": {
  12764. "type": "string",
  12765. "pattern": "^prt.*"
  12766. },
  12767. "type": {
  12768. "type": "string",
  12769. "const": "subtask"
  12770. },
  12771. "prompt": {
  12772. "type": "string"
  12773. },
  12774. "description": {
  12775. "type": "string"
  12776. },
  12777. "agent": {
  12778. "type": "string"
  12779. },
  12780. "model": {
  12781. "type": "object",
  12782. "properties": {
  12783. "providerID": {
  12784. "type": "string"
  12785. },
  12786. "modelID": {
  12787. "type": "string"
  12788. }
  12789. },
  12790. "required": ["providerID", "modelID"]
  12791. },
  12792. "command": {
  12793. "type": "string"
  12794. }
  12795. },
  12796. "required": ["type", "prompt", "description", "agent"]
  12797. },
  12798. "ProviderAuthMethod": {
  12799. "type": "object",
  12800. "properties": {
  12801. "type": {
  12802. "type": "string",
  12803. "enum": ["oauth", "api"]
  12804. },
  12805. "label": {
  12806. "type": "string"
  12807. },
  12808. "prompts": {
  12809. "type": "array",
  12810. "items": {
  12811. "anyOf": [
  12812. {
  12813. "type": "object",
  12814. "properties": {
  12815. "type": {
  12816. "type": "string",
  12817. "const": "text"
  12818. },
  12819. "key": {
  12820. "type": "string"
  12821. },
  12822. "message": {
  12823. "type": "string"
  12824. },
  12825. "placeholder": {
  12826. "type": "string"
  12827. },
  12828. "when": {
  12829. "type": "object",
  12830. "properties": {
  12831. "key": {
  12832. "type": "string"
  12833. },
  12834. "op": {
  12835. "type": "string",
  12836. "enum": ["eq", "neq"]
  12837. },
  12838. "value": {
  12839. "type": "string"
  12840. }
  12841. },
  12842. "required": ["key", "op", "value"]
  12843. }
  12844. },
  12845. "required": ["type", "key", "message"]
  12846. },
  12847. {
  12848. "type": "object",
  12849. "properties": {
  12850. "type": {
  12851. "type": "string",
  12852. "const": "select"
  12853. },
  12854. "key": {
  12855. "type": "string"
  12856. },
  12857. "message": {
  12858. "type": "string"
  12859. },
  12860. "options": {
  12861. "type": "array",
  12862. "items": {
  12863. "type": "object",
  12864. "properties": {
  12865. "label": {
  12866. "type": "string"
  12867. },
  12868. "value": {
  12869. "type": "string"
  12870. },
  12871. "hint": {
  12872. "type": "string"
  12873. }
  12874. },
  12875. "required": ["label", "value"]
  12876. }
  12877. },
  12878. "when": {
  12879. "type": "object",
  12880. "properties": {
  12881. "key": {
  12882. "type": "string"
  12883. },
  12884. "op": {
  12885. "type": "string",
  12886. "enum": ["eq", "neq"]
  12887. },
  12888. "value": {
  12889. "type": "string"
  12890. }
  12891. },
  12892. "required": ["key", "op", "value"]
  12893. }
  12894. },
  12895. "required": ["type", "key", "message", "options"]
  12896. }
  12897. ]
  12898. }
  12899. }
  12900. },
  12901. "required": ["type", "label"]
  12902. },
  12903. "ProviderAuthAuthorization": {
  12904. "type": "object",
  12905. "properties": {
  12906. "url": {
  12907. "type": "string"
  12908. },
  12909. "method": {
  12910. "type": "string",
  12911. "enum": ["auto", "code"]
  12912. },
  12913. "instructions": {
  12914. "type": "string"
  12915. }
  12916. },
  12917. "required": ["url", "method", "instructions"]
  12918. },
  12919. "Symbol": {
  12920. "type": "object",
  12921. "properties": {
  12922. "name": {
  12923. "type": "string"
  12924. },
  12925. "kind": {
  12926. "type": "number"
  12927. },
  12928. "location": {
  12929. "type": "object",
  12930. "properties": {
  12931. "uri": {
  12932. "type": "string"
  12933. },
  12934. "range": {
  12935. "$ref": "#/components/schemas/Range"
  12936. }
  12937. },
  12938. "required": ["uri", "range"]
  12939. }
  12940. },
  12941. "required": ["name", "kind", "location"]
  12942. },
  12943. "FileNode": {
  12944. "type": "object",
  12945. "properties": {
  12946. "name": {
  12947. "type": "string"
  12948. },
  12949. "path": {
  12950. "type": "string"
  12951. },
  12952. "absolute": {
  12953. "type": "string"
  12954. },
  12955. "type": {
  12956. "type": "string",
  12957. "enum": ["file", "directory"]
  12958. },
  12959. "ignored": {
  12960. "type": "boolean"
  12961. }
  12962. },
  12963. "required": ["name", "path", "absolute", "type", "ignored"]
  12964. },
  12965. "FileContent": {
  12966. "type": "object",
  12967. "properties": {
  12968. "type": {
  12969. "type": "string",
  12970. "enum": ["text", "binary"]
  12971. },
  12972. "content": {
  12973. "type": "string"
  12974. },
  12975. "diff": {
  12976. "type": "string"
  12977. },
  12978. "patch": {
  12979. "type": "object",
  12980. "properties": {
  12981. "oldFileName": {
  12982. "type": "string"
  12983. },
  12984. "newFileName": {
  12985. "type": "string"
  12986. },
  12987. "oldHeader": {
  12988. "type": "string"
  12989. },
  12990. "newHeader": {
  12991. "type": "string"
  12992. },
  12993. "hunks": {
  12994. "type": "array",
  12995. "items": {
  12996. "type": "object",
  12997. "properties": {
  12998. "oldStart": {
  12999. "type": "number"
  13000. },
  13001. "oldLines": {
  13002. "type": "number"
  13003. },
  13004. "newStart": {
  13005. "type": "number"
  13006. },
  13007. "newLines": {
  13008. "type": "number"
  13009. },
  13010. "lines": {
  13011. "type": "array",
  13012. "items": {
  13013. "type": "string"
  13014. }
  13015. }
  13016. },
  13017. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  13018. }
  13019. },
  13020. "index": {
  13021. "type": "string"
  13022. }
  13023. },
  13024. "required": ["oldFileName", "newFileName", "hunks"]
  13025. },
  13026. "encoding": {
  13027. "type": "string",
  13028. "const": "base64"
  13029. },
  13030. "mimeType": {
  13031. "type": "string"
  13032. }
  13033. },
  13034. "required": ["type", "content"]
  13035. },
  13036. "File": {
  13037. "type": "object",
  13038. "properties": {
  13039. "path": {
  13040. "type": "string"
  13041. },
  13042. "added": {
  13043. "type": "integer",
  13044. "minimum": -9007199254740991,
  13045. "maximum": 9007199254740991
  13046. },
  13047. "removed": {
  13048. "type": "integer",
  13049. "minimum": -9007199254740991,
  13050. "maximum": 9007199254740991
  13051. },
  13052. "status": {
  13053. "type": "string",
  13054. "enum": ["added", "deleted", "modified"]
  13055. }
  13056. },
  13057. "required": ["path", "added", "removed", "status"]
  13058. },
  13059. "Event": {
  13060. "anyOf": [
  13061. {
  13062. "$ref": "#/components/schemas/Event.project.updated"
  13063. },
  13064. {
  13065. "$ref": "#/components/schemas/Event.server.instance.disposed"
  13066. },
  13067. {
  13068. "$ref": "#/components/schemas/Event.server.connected"
  13069. },
  13070. {
  13071. "$ref": "#/components/schemas/Event.global.disposed"
  13072. },
  13073. {
  13074. "$ref": "#/components/schemas/Event.file.edited"
  13075. },
  13076. {
  13077. "$ref": "#/components/schemas/Event.file.watcher.updated"
  13078. },
  13079. {
  13080. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  13081. },
  13082. {
  13083. "$ref": "#/components/schemas/Event.lsp.updated"
  13084. },
  13085. {
  13086. "$ref": "#/components/schemas/Event.message.part.delta"
  13087. },
  13088. {
  13089. "$ref": "#/components/schemas/Event.permission.asked"
  13090. },
  13091. {
  13092. "$ref": "#/components/schemas/Event.permission.replied"
  13093. },
  13094. {
  13095. "$ref": "#/components/schemas/Event.session.diff"
  13096. },
  13097. {
  13098. "$ref": "#/components/schemas/Event.session.error"
  13099. },
  13100. {
  13101. "$ref": "#/components/schemas/Event.installation.updated"
  13102. },
  13103. {
  13104. "$ref": "#/components/schemas/Event.installation.update-available"
  13105. },
  13106. {
  13107. "$ref": "#/components/schemas/Event.question.asked"
  13108. },
  13109. {
  13110. "$ref": "#/components/schemas/Event.question.replied"
  13111. },
  13112. {
  13113. "$ref": "#/components/schemas/Event.question.rejected"
  13114. },
  13115. {
  13116. "$ref": "#/components/schemas/Event.todo.updated"
  13117. },
  13118. {
  13119. "$ref": "#/components/schemas/Event.session.status"
  13120. },
  13121. {
  13122. "$ref": "#/components/schemas/Event.session.idle"
  13123. },
  13124. {
  13125. "$ref": "#/components/schemas/Event.session.compacted"
  13126. },
  13127. {
  13128. "$ref": "#/components/schemas/Event.tui.prompt.append"
  13129. },
  13130. {
  13131. "$ref": "#/components/schemas/Event.tui.command.execute"
  13132. },
  13133. {
  13134. "$ref": "#/components/schemas/Event.tui.toast.show"
  13135. },
  13136. {
  13137. "$ref": "#/components/schemas/Event.tui.session.select"
  13138. },
  13139. {
  13140. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  13141. },
  13142. {
  13143. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  13144. },
  13145. {
  13146. "$ref": "#/components/schemas/Event.command.executed"
  13147. },
  13148. {
  13149. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  13150. },
  13151. {
  13152. "$ref": "#/components/schemas/Event.worktree.ready"
  13153. },
  13154. {
  13155. "$ref": "#/components/schemas/Event.worktree.failed"
  13156. },
  13157. {
  13158. "$ref": "#/components/schemas/Event.pty.created"
  13159. },
  13160. {
  13161. "$ref": "#/components/schemas/Event.pty.updated"
  13162. },
  13163. {
  13164. "$ref": "#/components/schemas/Event.pty.exited"
  13165. },
  13166. {
  13167. "$ref": "#/components/schemas/Event.pty.deleted"
  13168. },
  13169. {
  13170. "$ref": "#/components/schemas/Event.workspace.ready"
  13171. },
  13172. {
  13173. "$ref": "#/components/schemas/Event.workspace.failed"
  13174. },
  13175. {
  13176. "$ref": "#/components/schemas/Event.workspace.restore"
  13177. },
  13178. {
  13179. "$ref": "#/components/schemas/Event.workspace.status"
  13180. },
  13181. {
  13182. "$ref": "#/components/schemas/Event.message.updated"
  13183. },
  13184. {
  13185. "$ref": "#/components/schemas/Event.message.removed"
  13186. },
  13187. {
  13188. "$ref": "#/components/schemas/Event.message.part.updated"
  13189. },
  13190. {
  13191. "$ref": "#/components/schemas/Event.message.part.removed"
  13192. },
  13193. {
  13194. "$ref": "#/components/schemas/Event.session.created"
  13195. },
  13196. {
  13197. "$ref": "#/components/schemas/Event.session.updated"
  13198. },
  13199. {
  13200. "$ref": "#/components/schemas/Event.session.deleted"
  13201. }
  13202. ]
  13203. },
  13204. "MCPStatusConnected": {
  13205. "type": "object",
  13206. "properties": {
  13207. "status": {
  13208. "type": "string",
  13209. "const": "connected"
  13210. }
  13211. },
  13212. "required": ["status"]
  13213. },
  13214. "MCPStatusDisabled": {
  13215. "type": "object",
  13216. "properties": {
  13217. "status": {
  13218. "type": "string",
  13219. "const": "disabled"
  13220. }
  13221. },
  13222. "required": ["status"]
  13223. },
  13224. "MCPStatusFailed": {
  13225. "type": "object",
  13226. "properties": {
  13227. "status": {
  13228. "type": "string",
  13229. "const": "failed"
  13230. },
  13231. "error": {
  13232. "type": "string"
  13233. }
  13234. },
  13235. "required": ["status", "error"]
  13236. },
  13237. "MCPStatusNeedsAuth": {
  13238. "type": "object",
  13239. "properties": {
  13240. "status": {
  13241. "type": "string",
  13242. "const": "needs_auth"
  13243. }
  13244. },
  13245. "required": ["status"]
  13246. },
  13247. "MCPStatusNeedsClientRegistration": {
  13248. "type": "object",
  13249. "properties": {
  13250. "status": {
  13251. "type": "string",
  13252. "const": "needs_client_registration"
  13253. },
  13254. "error": {
  13255. "type": "string"
  13256. }
  13257. },
  13258. "required": ["status", "error"]
  13259. },
  13260. "MCPStatus": {
  13261. "anyOf": [
  13262. {
  13263. "$ref": "#/components/schemas/MCPStatusConnected"
  13264. },
  13265. {
  13266. "$ref": "#/components/schemas/MCPStatusDisabled"
  13267. },
  13268. {
  13269. "$ref": "#/components/schemas/MCPStatusFailed"
  13270. },
  13271. {
  13272. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  13273. },
  13274. {
  13275. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  13276. }
  13277. ]
  13278. },
  13279. "McpUnsupportedOAuthError": {
  13280. "type": "object",
  13281. "properties": {
  13282. "error": {
  13283. "type": "string"
  13284. }
  13285. },
  13286. "required": ["error"]
  13287. },
  13288. "Path": {
  13289. "type": "object",
  13290. "properties": {
  13291. "home": {
  13292. "type": "string"
  13293. },
  13294. "state": {
  13295. "type": "string"
  13296. },
  13297. "config": {
  13298. "type": "string"
  13299. },
  13300. "worktree": {
  13301. "type": "string"
  13302. },
  13303. "directory": {
  13304. "type": "string"
  13305. }
  13306. },
  13307. "required": ["home", "state", "config", "worktree", "directory"]
  13308. },
  13309. "VcsInfo": {
  13310. "type": "object",
  13311. "properties": {
  13312. "branch": {
  13313. "type": "string"
  13314. },
  13315. "default_branch": {
  13316. "type": "string"
  13317. }
  13318. }
  13319. },
  13320. "VcsFileDiff": {
  13321. "type": "object",
  13322. "properties": {
  13323. "file": {
  13324. "type": "string"
  13325. },
  13326. "patch": {
  13327. "type": "string"
  13328. },
  13329. "additions": {
  13330. "type": "number"
  13331. },
  13332. "deletions": {
  13333. "type": "number"
  13334. },
  13335. "status": {
  13336. "type": "string",
  13337. "enum": ["added", "deleted", "modified"]
  13338. }
  13339. },
  13340. "required": ["file", "patch", "additions", "deletions"]
  13341. },
  13342. "Command": {
  13343. "type": "object",
  13344. "properties": {
  13345. "name": {
  13346. "type": "string"
  13347. },
  13348. "description": {
  13349. "type": "string"
  13350. },
  13351. "agent": {
  13352. "type": "string"
  13353. },
  13354. "model": {
  13355. "type": "string"
  13356. },
  13357. "source": {
  13358. "type": "string",
  13359. "enum": ["command", "mcp", "skill"]
  13360. },
  13361. "template": {
  13362. "anyOf": [
  13363. {
  13364. "type": "string"
  13365. },
  13366. {
  13367. "type": "string"
  13368. }
  13369. ]
  13370. },
  13371. "subtask": {
  13372. "type": "boolean"
  13373. },
  13374. "hints": {
  13375. "type": "array",
  13376. "items": {
  13377. "type": "string"
  13378. }
  13379. }
  13380. },
  13381. "required": ["name", "template", "hints"]
  13382. },
  13383. "Agent": {
  13384. "type": "object",
  13385. "properties": {
  13386. "name": {
  13387. "type": "string"
  13388. },
  13389. "description": {
  13390. "type": "string"
  13391. },
  13392. "mode": {
  13393. "type": "string",
  13394. "enum": ["subagent", "primary", "all"]
  13395. },
  13396. "native": {
  13397. "type": "boolean"
  13398. },
  13399. "hidden": {
  13400. "type": "boolean"
  13401. },
  13402. "topP": {
  13403. "type": "number"
  13404. },
  13405. "temperature": {
  13406. "type": "number"
  13407. },
  13408. "color": {
  13409. "type": "string"
  13410. },
  13411. "permission": {
  13412. "$ref": "#/components/schemas/PermissionRuleset"
  13413. },
  13414. "model": {
  13415. "type": "object",
  13416. "properties": {
  13417. "modelID": {
  13418. "type": "string"
  13419. },
  13420. "providerID": {
  13421. "type": "string"
  13422. }
  13423. },
  13424. "required": ["modelID", "providerID"]
  13425. },
  13426. "variant": {
  13427. "type": "string"
  13428. },
  13429. "prompt": {
  13430. "type": "string"
  13431. },
  13432. "options": {
  13433. "type": "object",
  13434. "propertyNames": {
  13435. "type": "string"
  13436. },
  13437. "additionalProperties": {}
  13438. },
  13439. "steps": {
  13440. "type": "number"
  13441. }
  13442. },
  13443. "required": ["name", "mode", "permission", "options"]
  13444. },
  13445. "LSPStatus": {
  13446. "type": "object",
  13447. "properties": {
  13448. "id": {
  13449. "type": "string"
  13450. },
  13451. "name": {
  13452. "type": "string"
  13453. },
  13454. "root": {
  13455. "type": "string"
  13456. },
  13457. "status": {
  13458. "anyOf": [
  13459. {
  13460. "type": "string",
  13461. "const": "connected"
  13462. },
  13463. {
  13464. "type": "string",
  13465. "const": "error"
  13466. }
  13467. ]
  13468. }
  13469. },
  13470. "required": ["id", "name", "root", "status"]
  13471. },
  13472. "FormatterStatus": {
  13473. "type": "object",
  13474. "properties": {
  13475. "name": {
  13476. "type": "string"
  13477. },
  13478. "extensions": {
  13479. "type": "array",
  13480. "items": {
  13481. "type": "string"
  13482. }
  13483. },
  13484. "enabled": {
  13485. "type": "boolean"
  13486. }
  13487. },
  13488. "required": ["name", "extensions", "enabled"]
  13489. }
  13490. }
  13491. }
  13492. }