openapi.json 366 KB

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