openapi.json 344 KB

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