openapi.json 323 KB

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