openapi.json 374 KB

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