openapi.json 330 KB

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