openapi.json 324 KB

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