1
0

openapi.json 511 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796
  1. {
  2. "openapi": "3.1.0",
  3. "info": {
  4. "title": "opencode",
  5. "version": "1.0.0",
  6. "description": "opencode api"
  7. },
  8. "paths": {
  9. "/auth/{providerID}": {
  10. "put": {
  11. "tags": ["control"],
  12. "operationId": "auth.set",
  13. "parameters": [
  14. {
  15. "name": "providerID",
  16. "in": "path",
  17. "schema": {
  18. "type": "string"
  19. },
  20. "required": true
  21. }
  22. ],
  23. "responses": {
  24. "200": {
  25. "description": "Successfully set authentication credentials",
  26. "content": {
  27. "application/json": {
  28. "schema": {
  29. "type": "boolean",
  30. "description": "Successfully set authentication credentials"
  31. }
  32. }
  33. }
  34. },
  35. "400": {
  36. "description": "Bad request",
  37. "content": {
  38. "application/json": {
  39. "schema": {
  40. "$ref": "#/components/schemas/BadRequestError"
  41. }
  42. }
  43. }
  44. }
  45. },
  46. "description": "Set authentication credentials",
  47. "summary": "Set auth credentials",
  48. "requestBody": {
  49. "content": {
  50. "application/json": {
  51. "schema": {
  52. "$ref": "#/components/schemas/Auth"
  53. }
  54. }
  55. }
  56. },
  57. "x-codeSamples": [
  58. {
  59. "lang": "js",
  60. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  61. }
  62. ]
  63. },
  64. "delete": {
  65. "tags": ["control"],
  66. "operationId": "auth.remove",
  67. "parameters": [
  68. {
  69. "name": "providerID",
  70. "in": "path",
  71. "schema": {
  72. "type": "string"
  73. },
  74. "required": true
  75. }
  76. ],
  77. "responses": {
  78. "200": {
  79. "description": "Successfully removed authentication credentials",
  80. "content": {
  81. "application/json": {
  82. "schema": {
  83. "type": "boolean",
  84. "description": "Successfully removed authentication credentials"
  85. }
  86. }
  87. }
  88. },
  89. "400": {
  90. "description": "Bad request",
  91. "content": {
  92. "application/json": {
  93. "schema": {
  94. "$ref": "#/components/schemas/BadRequestError"
  95. }
  96. }
  97. }
  98. }
  99. },
  100. "description": "Remove authentication credentials",
  101. "summary": "Remove auth credentials",
  102. "x-codeSamples": [
  103. {
  104. "lang": "js",
  105. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  106. }
  107. ]
  108. }
  109. },
  110. "/log": {
  111. "post": {
  112. "tags": ["control"],
  113. "operationId": "app.log",
  114. "parameters": [
  115. {
  116. "name": "directory",
  117. "in": "query",
  118. "schema": {
  119. "type": "string"
  120. },
  121. "required": false
  122. },
  123. {
  124. "name": "workspace",
  125. "in": "query",
  126. "schema": {
  127. "type": "string"
  128. },
  129. "required": false
  130. }
  131. ],
  132. "responses": {
  133. "200": {
  134. "description": "Log entry written successfully",
  135. "content": {
  136. "application/json": {
  137. "schema": {
  138. "type": "boolean",
  139. "description": "Log entry written successfully"
  140. }
  141. }
  142. }
  143. },
  144. "400": {
  145. "description": "Bad request",
  146. "content": {
  147. "application/json": {
  148. "schema": {
  149. "$ref": "#/components/schemas/BadRequestError"
  150. }
  151. }
  152. }
  153. }
  154. },
  155. "description": "Write a log entry to the server logs with specified level and metadata.",
  156. "summary": "Write log",
  157. "requestBody": {
  158. "content": {
  159. "application/json": {
  160. "schema": {
  161. "type": "object",
  162. "properties": {
  163. "service": {
  164. "type": "string",
  165. "description": "Service name for the log entry"
  166. },
  167. "level": {
  168. "type": "string",
  169. "enum": ["debug", "info", "error", "warn"],
  170. "description": "Log level"
  171. },
  172. "message": {
  173. "type": "string",
  174. "description": "Log message"
  175. },
  176. "extra": {
  177. "type": "object"
  178. }
  179. },
  180. "required": ["service", "level", "message"],
  181. "additionalProperties": false
  182. }
  183. }
  184. }
  185. },
  186. "x-codeSamples": [
  187. {
  188. "lang": "js",
  189. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  190. }
  191. ]
  192. }
  193. },
  194. "/global/health": {
  195. "get": {
  196. "tags": ["global"],
  197. "operationId": "global.health",
  198. "parameters": [],
  199. "responses": {
  200. "200": {
  201. "description": "Health information",
  202. "content": {
  203. "application/json": {
  204. "schema": {
  205. "type": "object",
  206. "properties": {
  207. "healthy": {
  208. "type": "boolean",
  209. "enum": [true]
  210. },
  211. "version": {
  212. "type": "string"
  213. }
  214. },
  215. "required": ["healthy", "version"],
  216. "additionalProperties": false,
  217. "description": "Health information"
  218. }
  219. }
  220. }
  221. }
  222. },
  223. "description": "Get health information about the OpenCode server.",
  224. "summary": "Get health",
  225. "x-codeSamples": [
  226. {
  227. "lang": "js",
  228. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  229. }
  230. ]
  231. }
  232. },
  233. "/global/event": {
  234. "get": {
  235. "tags": ["global"],
  236. "operationId": "global.event",
  237. "parameters": [],
  238. "responses": {
  239. "200": {
  240. "description": "Event stream",
  241. "content": {
  242. "text/event-stream": {
  243. "schema": {
  244. "$ref": "#/components/schemas/GlobalEvent"
  245. }
  246. }
  247. }
  248. }
  249. },
  250. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  251. "summary": "Get global events",
  252. "x-codeSamples": [
  253. {
  254. "lang": "js",
  255. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  256. }
  257. ]
  258. }
  259. },
  260. "/global/config": {
  261. "get": {
  262. "tags": ["global"],
  263. "operationId": "global.config.get",
  264. "parameters": [],
  265. "responses": {
  266. "200": {
  267. "description": "Get global config info",
  268. "content": {
  269. "application/json": {
  270. "schema": {
  271. "$ref": "#/components/schemas/Config"
  272. }
  273. }
  274. }
  275. }
  276. },
  277. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  278. "summary": "Get global configuration",
  279. "x-codeSamples": [
  280. {
  281. "lang": "js",
  282. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  283. }
  284. ]
  285. },
  286. "patch": {
  287. "tags": ["global"],
  288. "operationId": "global.config.update",
  289. "parameters": [],
  290. "responses": {
  291. "200": {
  292. "description": "Successfully updated global config",
  293. "content": {
  294. "application/json": {
  295. "schema": {
  296. "$ref": "#/components/schemas/Config"
  297. }
  298. }
  299. }
  300. },
  301. "400": {
  302. "description": "Bad request",
  303. "content": {
  304. "application/json": {
  305. "schema": {
  306. "$ref": "#/components/schemas/BadRequestError"
  307. }
  308. }
  309. }
  310. }
  311. },
  312. "description": "Update global OpenCode configuration settings and preferences.",
  313. "summary": "Update global configuration",
  314. "requestBody": {
  315. "content": {
  316. "application/json": {
  317. "schema": {
  318. "$ref": "#/components/schemas/Config"
  319. }
  320. }
  321. }
  322. },
  323. "x-codeSamples": [
  324. {
  325. "lang": "js",
  326. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  327. }
  328. ]
  329. }
  330. },
  331. "/global/dispose": {
  332. "post": {
  333. "tags": ["global"],
  334. "operationId": "global.dispose",
  335. "parameters": [],
  336. "responses": {
  337. "200": {
  338. "description": "Global disposed",
  339. "content": {
  340. "application/json": {
  341. "schema": {
  342. "type": "boolean",
  343. "description": "Global disposed"
  344. }
  345. }
  346. }
  347. }
  348. },
  349. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  350. "summary": "Dispose instance",
  351. "x-codeSamples": [
  352. {
  353. "lang": "js",
  354. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  355. }
  356. ]
  357. }
  358. },
  359. "/global/upgrade": {
  360. "post": {
  361. "tags": ["global"],
  362. "operationId": "global.upgrade",
  363. "parameters": [],
  364. "responses": {
  365. "200": {
  366. "description": "Upgrade result",
  367. "content": {
  368. "application/json": {
  369. "schema": {
  370. "anyOf": [
  371. {
  372. "type": "object",
  373. "properties": {
  374. "success": {
  375. "type": "boolean",
  376. "enum": [true]
  377. },
  378. "version": {
  379. "type": "string"
  380. }
  381. },
  382. "required": ["success", "version"],
  383. "additionalProperties": false
  384. },
  385. {
  386. "type": "object",
  387. "properties": {
  388. "success": {
  389. "type": "boolean",
  390. "enum": [false]
  391. },
  392. "error": {
  393. "type": "string"
  394. }
  395. },
  396. "required": ["success", "error"],
  397. "additionalProperties": false
  398. }
  399. ],
  400. "description": "Upgrade result"
  401. }
  402. }
  403. }
  404. },
  405. "400": {
  406. "description": "Bad request",
  407. "content": {
  408. "application/json": {
  409. "schema": {
  410. "$ref": "#/components/schemas/BadRequestError"
  411. }
  412. }
  413. }
  414. }
  415. },
  416. "description": "Upgrade opencode to the specified version or latest if not specified.",
  417. "summary": "Upgrade opencode",
  418. "requestBody": {
  419. "content": {
  420. "application/json": {
  421. "schema": {
  422. "type": "object",
  423. "properties": {
  424. "target": {
  425. "type": "string"
  426. }
  427. },
  428. "additionalProperties": false
  429. }
  430. }
  431. }
  432. },
  433. "x-codeSamples": [
  434. {
  435. "lang": "js",
  436. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  437. }
  438. ]
  439. }
  440. },
  441. "/event": {
  442. "get": {
  443. "tags": ["event"],
  444. "operationId": "event.subscribe",
  445. "parameters": [
  446. {
  447. "name": "directory",
  448. "in": "query",
  449. "schema": {
  450. "type": "string"
  451. },
  452. "required": false
  453. },
  454. {
  455. "name": "workspace",
  456. "in": "query",
  457. "schema": {
  458. "type": "string"
  459. },
  460. "required": false
  461. }
  462. ],
  463. "responses": {
  464. "200": {
  465. "description": "Event stream",
  466. "content": {
  467. "text/event-stream": {
  468. "schema": {
  469. "$ref": "#/components/schemas/Event"
  470. }
  471. }
  472. }
  473. }
  474. },
  475. "description": "Get events",
  476. "summary": "Subscribe to events",
  477. "x-codeSamples": [
  478. {
  479. "lang": "js",
  480. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  481. }
  482. ]
  483. }
  484. },
  485. "/config": {
  486. "get": {
  487. "tags": ["config"],
  488. "operationId": "config.get",
  489. "parameters": [
  490. {
  491. "name": "directory",
  492. "in": "query",
  493. "schema": {
  494. "type": "string"
  495. },
  496. "required": false
  497. },
  498. {
  499. "name": "workspace",
  500. "in": "query",
  501. "schema": {
  502. "type": "string"
  503. },
  504. "required": false
  505. }
  506. ],
  507. "responses": {
  508. "200": {
  509. "description": "Get config info",
  510. "content": {
  511. "application/json": {
  512. "schema": {
  513. "$ref": "#/components/schemas/Config"
  514. }
  515. }
  516. }
  517. }
  518. },
  519. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  520. "summary": "Get configuration",
  521. "x-codeSamples": [
  522. {
  523. "lang": "js",
  524. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  525. }
  526. ]
  527. },
  528. "patch": {
  529. "tags": ["config"],
  530. "operationId": "config.update",
  531. "parameters": [
  532. {
  533. "name": "directory",
  534. "in": "query",
  535. "schema": {
  536. "type": "string"
  537. },
  538. "required": false
  539. },
  540. {
  541. "name": "workspace",
  542. "in": "query",
  543. "schema": {
  544. "type": "string"
  545. },
  546. "required": false
  547. }
  548. ],
  549. "responses": {
  550. "200": {
  551. "description": "Successfully updated config",
  552. "content": {
  553. "application/json": {
  554. "schema": {
  555. "$ref": "#/components/schemas/Config"
  556. }
  557. }
  558. }
  559. },
  560. "400": {
  561. "description": "Bad request",
  562. "content": {
  563. "application/json": {
  564. "schema": {
  565. "$ref": "#/components/schemas/BadRequestError"
  566. }
  567. }
  568. }
  569. }
  570. },
  571. "description": "Update OpenCode configuration settings and preferences.",
  572. "summary": "Update configuration",
  573. "requestBody": {
  574. "content": {
  575. "application/json": {
  576. "schema": {
  577. "$ref": "#/components/schemas/Config"
  578. }
  579. }
  580. }
  581. },
  582. "x-codeSamples": [
  583. {
  584. "lang": "js",
  585. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  586. }
  587. ]
  588. }
  589. },
  590. "/config/providers": {
  591. "get": {
  592. "tags": ["config"],
  593. "operationId": "config.providers",
  594. "parameters": [
  595. {
  596. "name": "directory",
  597. "in": "query",
  598. "schema": {
  599. "type": "string"
  600. },
  601. "required": false
  602. },
  603. {
  604. "name": "workspace",
  605. "in": "query",
  606. "schema": {
  607. "type": "string"
  608. },
  609. "required": false
  610. }
  611. ],
  612. "responses": {
  613. "200": {
  614. "description": "List of providers",
  615. "content": {
  616. "application/json": {
  617. "schema": {
  618. "type": "object",
  619. "properties": {
  620. "providers": {
  621. "type": "array",
  622. "items": {
  623. "$ref": "#/components/schemas/Provider"
  624. }
  625. },
  626. "default": {
  627. "type": "object",
  628. "additionalProperties": {
  629. "type": "string"
  630. }
  631. }
  632. },
  633. "required": ["providers", "default"],
  634. "additionalProperties": false,
  635. "description": "List of providers"
  636. }
  637. }
  638. }
  639. }
  640. },
  641. "description": "Get a list of all configured AI providers and their default models.",
  642. "summary": "List config providers",
  643. "x-codeSamples": [
  644. {
  645. "lang": "js",
  646. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  647. }
  648. ]
  649. }
  650. },
  651. "/experimental/console": {
  652. "get": {
  653. "tags": ["experimental"],
  654. "operationId": "experimental.console.get",
  655. "parameters": [
  656. {
  657. "name": "directory",
  658. "in": "query",
  659. "schema": {
  660. "type": "string"
  661. },
  662. "required": false
  663. },
  664. {
  665. "name": "workspace",
  666. "in": "query",
  667. "schema": {
  668. "type": "string"
  669. },
  670. "required": false
  671. }
  672. ],
  673. "responses": {
  674. "200": {
  675. "description": "Active Console provider metadata",
  676. "content": {
  677. "application/json": {
  678. "schema": {
  679. "$ref": "#/components/schemas/ConsoleState"
  680. }
  681. }
  682. }
  683. },
  684. "500": {
  685. "description": "InternalServerError",
  686. "content": {
  687. "application/json": {
  688. "schema": {
  689. "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
  690. }
  691. }
  692. }
  693. }
  694. },
  695. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  696. "summary": "Get active Console provider metadata",
  697. "x-codeSamples": [
  698. {
  699. "lang": "js",
  700. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  701. }
  702. ]
  703. }
  704. },
  705. "/experimental/console/orgs": {
  706. "get": {
  707. "tags": ["experimental"],
  708. "operationId": "experimental.console.listOrgs",
  709. "parameters": [
  710. {
  711. "name": "directory",
  712. "in": "query",
  713. "schema": {
  714. "type": "string"
  715. },
  716. "required": false
  717. },
  718. {
  719. "name": "workspace",
  720. "in": "query",
  721. "schema": {
  722. "type": "string"
  723. },
  724. "required": false
  725. }
  726. ],
  727. "responses": {
  728. "200": {
  729. "description": "Switchable Console orgs",
  730. "content": {
  731. "application/json": {
  732. "schema": {
  733. "type": "object",
  734. "properties": {
  735. "orgs": {
  736. "type": "array",
  737. "items": {
  738. "type": "object",
  739. "properties": {
  740. "accountID": {
  741. "type": "string"
  742. },
  743. "accountEmail": {
  744. "type": "string"
  745. },
  746. "accountUrl": {
  747. "type": "string"
  748. },
  749. "orgID": {
  750. "type": "string"
  751. },
  752. "orgName": {
  753. "type": "string"
  754. },
  755. "active": {
  756. "type": "boolean"
  757. }
  758. },
  759. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"],
  760. "additionalProperties": false
  761. }
  762. }
  763. },
  764. "required": ["orgs"],
  765. "additionalProperties": false,
  766. "description": "Switchable Console orgs"
  767. }
  768. }
  769. }
  770. },
  771. "500": {
  772. "description": "InternalServerError",
  773. "content": {
  774. "application/json": {
  775. "schema": {
  776. "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
  777. }
  778. }
  779. }
  780. }
  781. },
  782. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  783. "summary": "List switchable Console orgs",
  784. "x-codeSamples": [
  785. {
  786. "lang": "js",
  787. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  788. }
  789. ]
  790. }
  791. },
  792. "/experimental/console/switch": {
  793. "post": {
  794. "tags": ["experimental"],
  795. "operationId": "experimental.console.switchOrg",
  796. "parameters": [
  797. {
  798. "name": "directory",
  799. "in": "query",
  800. "schema": {
  801. "type": "string"
  802. },
  803. "required": false
  804. },
  805. {
  806. "name": "workspace",
  807. "in": "query",
  808. "schema": {
  809. "type": "string"
  810. },
  811. "required": false
  812. }
  813. ],
  814. "responses": {
  815. "200": {
  816. "description": "Switch success",
  817. "content": {
  818. "application/json": {
  819. "schema": {
  820. "type": "boolean",
  821. "description": "Switch success"
  822. }
  823. }
  824. }
  825. }
  826. },
  827. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  828. "summary": "Switch active Console org",
  829. "requestBody": {
  830. "content": {
  831. "application/json": {
  832. "schema": {
  833. "type": "object",
  834. "properties": {
  835. "accountID": {
  836. "type": "string"
  837. },
  838. "orgID": {
  839. "type": "string"
  840. }
  841. },
  842. "required": ["accountID", "orgID"],
  843. "additionalProperties": false
  844. }
  845. }
  846. }
  847. },
  848. "x-codeSamples": [
  849. {
  850. "lang": "js",
  851. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  852. }
  853. ]
  854. }
  855. },
  856. "/experimental/tool": {
  857. "get": {
  858. "tags": ["experimental"],
  859. "operationId": "tool.list",
  860. "parameters": [
  861. {
  862. "name": "directory",
  863. "in": "query",
  864. "schema": {
  865. "type": "string"
  866. },
  867. "required": false
  868. },
  869. {
  870. "name": "workspace",
  871. "in": "query",
  872. "schema": {
  873. "type": "string"
  874. },
  875. "required": false
  876. },
  877. {
  878. "name": "provider",
  879. "in": "query",
  880. "schema": {
  881. "type": "string"
  882. },
  883. "required": true
  884. },
  885. {
  886. "name": "model",
  887. "in": "query",
  888. "schema": {
  889. "type": "string"
  890. },
  891. "required": true
  892. }
  893. ],
  894. "responses": {
  895. "200": {
  896. "description": "Tools",
  897. "content": {
  898. "application/json": {
  899. "schema": {
  900. "$ref": "#/components/schemas/ToolList"
  901. }
  902. }
  903. }
  904. },
  905. "400": {
  906. "description": "Bad request",
  907. "content": {
  908. "application/json": {
  909. "schema": {
  910. "$ref": "#/components/schemas/BadRequestError"
  911. }
  912. }
  913. }
  914. }
  915. },
  916. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  917. "summary": "List tools",
  918. "x-codeSamples": [
  919. {
  920. "lang": "js",
  921. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  922. }
  923. ]
  924. }
  925. },
  926. "/experimental/tool/ids": {
  927. "get": {
  928. "tags": ["experimental"],
  929. "operationId": "tool.ids",
  930. "parameters": [
  931. {
  932. "name": "directory",
  933. "in": "query",
  934. "schema": {
  935. "type": "string"
  936. },
  937. "required": false
  938. },
  939. {
  940. "name": "workspace",
  941. "in": "query",
  942. "schema": {
  943. "type": "string"
  944. },
  945. "required": false
  946. }
  947. ],
  948. "responses": {
  949. "200": {
  950. "description": "Tool IDs",
  951. "content": {
  952. "application/json": {
  953. "schema": {
  954. "$ref": "#/components/schemas/ToolIDs"
  955. }
  956. }
  957. }
  958. },
  959. "400": {
  960. "description": "Bad request",
  961. "content": {
  962. "application/json": {
  963. "schema": {
  964. "$ref": "#/components/schemas/BadRequestError"
  965. }
  966. }
  967. }
  968. }
  969. },
  970. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  971. "summary": "List tool IDs",
  972. "x-codeSamples": [
  973. {
  974. "lang": "js",
  975. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  976. }
  977. ]
  978. }
  979. },
  980. "/experimental/worktree": {
  981. "get": {
  982. "tags": ["experimental"],
  983. "operationId": "worktree.list",
  984. "parameters": [
  985. {
  986. "name": "directory",
  987. "in": "query",
  988. "schema": {
  989. "type": "string"
  990. },
  991. "required": false
  992. },
  993. {
  994. "name": "workspace",
  995. "in": "query",
  996. "schema": {
  997. "type": "string"
  998. },
  999. "required": false
  1000. }
  1001. ],
  1002. "responses": {
  1003. "200": {
  1004. "description": "List of worktree directories",
  1005. "content": {
  1006. "application/json": {
  1007. "schema": {
  1008. "type": "array",
  1009. "items": {
  1010. "type": "string"
  1011. },
  1012. "description": "List of worktree directories"
  1013. }
  1014. }
  1015. }
  1016. }
  1017. },
  1018. "description": "List all sandbox worktrees for the current project.",
  1019. "summary": "List worktrees",
  1020. "x-codeSamples": [
  1021. {
  1022. "lang": "js",
  1023. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1024. }
  1025. ]
  1026. },
  1027. "post": {
  1028. "tags": ["experimental"],
  1029. "operationId": "worktree.create",
  1030. "parameters": [
  1031. {
  1032. "name": "directory",
  1033. "in": "query",
  1034. "schema": {
  1035. "type": "string"
  1036. },
  1037. "required": false
  1038. },
  1039. {
  1040. "name": "workspace",
  1041. "in": "query",
  1042. "schema": {
  1043. "type": "string"
  1044. },
  1045. "required": false
  1046. }
  1047. ],
  1048. "responses": {
  1049. "200": {
  1050. "description": "Worktree created",
  1051. "content": {
  1052. "application/json": {
  1053. "schema": {
  1054. "$ref": "#/components/schemas/Worktree"
  1055. }
  1056. }
  1057. }
  1058. },
  1059. "400": {
  1060. "description": "Bad request",
  1061. "content": {
  1062. "application/json": {
  1063. "schema": {
  1064. "$ref": "#/components/schemas/BadRequestError"
  1065. }
  1066. }
  1067. }
  1068. }
  1069. },
  1070. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1071. "summary": "Create worktree",
  1072. "requestBody": {
  1073. "content": {
  1074. "application/json": {
  1075. "schema": {
  1076. "$ref": "#/components/schemas/WorktreeCreateInput"
  1077. }
  1078. }
  1079. }
  1080. },
  1081. "x-codeSamples": [
  1082. {
  1083. "lang": "js",
  1084. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1085. }
  1086. ]
  1087. },
  1088. "delete": {
  1089. "tags": ["experimental"],
  1090. "operationId": "worktree.remove",
  1091. "parameters": [
  1092. {
  1093. "name": "directory",
  1094. "in": "query",
  1095. "schema": {
  1096. "type": "string"
  1097. },
  1098. "required": false
  1099. },
  1100. {
  1101. "name": "workspace",
  1102. "in": "query",
  1103. "schema": {
  1104. "type": "string"
  1105. },
  1106. "required": false
  1107. }
  1108. ],
  1109. "responses": {
  1110. "200": {
  1111. "description": "Worktree removed",
  1112. "content": {
  1113. "application/json": {
  1114. "schema": {
  1115. "type": "boolean",
  1116. "description": "Worktree removed"
  1117. }
  1118. }
  1119. }
  1120. },
  1121. "400": {
  1122. "description": "Bad request",
  1123. "content": {
  1124. "application/json": {
  1125. "schema": {
  1126. "$ref": "#/components/schemas/BadRequestError"
  1127. }
  1128. }
  1129. }
  1130. }
  1131. },
  1132. "description": "Remove a git worktree and delete its branch.",
  1133. "summary": "Remove worktree",
  1134. "requestBody": {
  1135. "content": {
  1136. "application/json": {
  1137. "schema": {
  1138. "$ref": "#/components/schemas/WorktreeRemoveInput"
  1139. }
  1140. }
  1141. }
  1142. },
  1143. "x-codeSamples": [
  1144. {
  1145. "lang": "js",
  1146. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  1147. }
  1148. ]
  1149. }
  1150. },
  1151. "/experimental/worktree/reset": {
  1152. "post": {
  1153. "tags": ["experimental"],
  1154. "operationId": "worktree.reset",
  1155. "parameters": [
  1156. {
  1157. "name": "directory",
  1158. "in": "query",
  1159. "schema": {
  1160. "type": "string"
  1161. },
  1162. "required": false
  1163. },
  1164. {
  1165. "name": "workspace",
  1166. "in": "query",
  1167. "schema": {
  1168. "type": "string"
  1169. },
  1170. "required": false
  1171. }
  1172. ],
  1173. "responses": {
  1174. "200": {
  1175. "description": "Worktree reset",
  1176. "content": {
  1177. "application/json": {
  1178. "schema": {
  1179. "type": "boolean",
  1180. "description": "Worktree reset"
  1181. }
  1182. }
  1183. }
  1184. },
  1185. "400": {
  1186. "description": "Bad request",
  1187. "content": {
  1188. "application/json": {
  1189. "schema": {
  1190. "$ref": "#/components/schemas/BadRequestError"
  1191. }
  1192. }
  1193. }
  1194. }
  1195. },
  1196. "description": "Reset a worktree branch to the primary default branch.",
  1197. "summary": "Reset worktree",
  1198. "requestBody": {
  1199. "content": {
  1200. "application/json": {
  1201. "schema": {
  1202. "$ref": "#/components/schemas/WorktreeResetInput"
  1203. }
  1204. }
  1205. }
  1206. },
  1207. "x-codeSamples": [
  1208. {
  1209. "lang": "js",
  1210. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  1211. }
  1212. ]
  1213. }
  1214. },
  1215. "/experimental/session": {
  1216. "get": {
  1217. "tags": ["experimental"],
  1218. "operationId": "experimental.session.list",
  1219. "parameters": [
  1220. {
  1221. "name": "directory",
  1222. "in": "query",
  1223. "schema": {
  1224. "type": "string"
  1225. },
  1226. "required": false
  1227. },
  1228. {
  1229. "name": "workspace",
  1230. "in": "query",
  1231. "schema": {
  1232. "type": "string"
  1233. },
  1234. "required": false
  1235. },
  1236. {
  1237. "name": "roots",
  1238. "in": "query",
  1239. "schema": {
  1240. "anyOf": [
  1241. {
  1242. "type": "boolean"
  1243. },
  1244. {
  1245. "type": "string",
  1246. "enum": ["true", "false"]
  1247. }
  1248. ]
  1249. },
  1250. "required": false
  1251. },
  1252. {
  1253. "name": "start",
  1254. "in": "query",
  1255. "schema": {
  1256. "type": "number"
  1257. },
  1258. "required": false
  1259. },
  1260. {
  1261. "name": "cursor",
  1262. "in": "query",
  1263. "schema": {
  1264. "type": "number"
  1265. },
  1266. "required": false
  1267. },
  1268. {
  1269. "name": "search",
  1270. "in": "query",
  1271. "schema": {
  1272. "type": "string"
  1273. },
  1274. "required": false
  1275. },
  1276. {
  1277. "name": "limit",
  1278. "in": "query",
  1279. "schema": {
  1280. "type": "number"
  1281. },
  1282. "required": false
  1283. },
  1284. {
  1285. "name": "archived",
  1286. "in": "query",
  1287. "schema": {
  1288. "anyOf": [
  1289. {
  1290. "type": "boolean"
  1291. },
  1292. {
  1293. "type": "string",
  1294. "enum": ["true", "false"]
  1295. }
  1296. ]
  1297. },
  1298. "required": false
  1299. }
  1300. ],
  1301. "responses": {
  1302. "200": {
  1303. "description": "List of sessions",
  1304. "content": {
  1305. "application/json": {
  1306. "schema": {
  1307. "type": "array",
  1308. "items": {
  1309. "$ref": "#/components/schemas/GlobalSession"
  1310. },
  1311. "description": "List of sessions"
  1312. }
  1313. }
  1314. }
  1315. }
  1316. },
  1317. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  1318. "summary": "List sessions",
  1319. "x-codeSamples": [
  1320. {
  1321. "lang": "js",
  1322. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  1323. }
  1324. ]
  1325. }
  1326. },
  1327. "/experimental/resource": {
  1328. "get": {
  1329. "tags": ["experimental"],
  1330. "operationId": "experimental.resource.list",
  1331. "parameters": [
  1332. {
  1333. "name": "directory",
  1334. "in": "query",
  1335. "schema": {
  1336. "type": "string"
  1337. },
  1338. "required": false
  1339. },
  1340. {
  1341. "name": "workspace",
  1342. "in": "query",
  1343. "schema": {
  1344. "type": "string"
  1345. },
  1346. "required": false
  1347. }
  1348. ],
  1349. "responses": {
  1350. "200": {
  1351. "description": "MCP resources",
  1352. "content": {
  1353. "application/json": {
  1354. "schema": {
  1355. "type": "object",
  1356. "additionalProperties": {
  1357. "$ref": "#/components/schemas/McpResource"
  1358. },
  1359. "description": "MCP resources"
  1360. }
  1361. }
  1362. }
  1363. }
  1364. },
  1365. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  1366. "summary": "Get MCP resources",
  1367. "x-codeSamples": [
  1368. {
  1369. "lang": "js",
  1370. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  1371. }
  1372. ]
  1373. }
  1374. },
  1375. "/find": {
  1376. "get": {
  1377. "tags": ["file"],
  1378. "operationId": "find.text",
  1379. "parameters": [
  1380. {
  1381. "name": "directory",
  1382. "in": "query",
  1383. "schema": {
  1384. "type": "string"
  1385. },
  1386. "required": false
  1387. },
  1388. {
  1389. "name": "workspace",
  1390. "in": "query",
  1391. "schema": {
  1392. "type": "string"
  1393. },
  1394. "required": false
  1395. },
  1396. {
  1397. "name": "pattern",
  1398. "in": "query",
  1399. "schema": {
  1400. "type": "string"
  1401. },
  1402. "required": true
  1403. }
  1404. ],
  1405. "responses": {
  1406. "200": {
  1407. "description": "Matches",
  1408. "content": {
  1409. "application/json": {
  1410. "schema": {
  1411. "type": "array",
  1412. "items": {
  1413. "type": "object",
  1414. "properties": {
  1415. "path": {
  1416. "type": "object",
  1417. "properties": {
  1418. "text": {
  1419. "type": "string"
  1420. }
  1421. },
  1422. "required": ["text"],
  1423. "additionalProperties": false
  1424. },
  1425. "lines": {
  1426. "type": "object",
  1427. "properties": {
  1428. "text": {
  1429. "type": "string"
  1430. }
  1431. },
  1432. "required": ["text"],
  1433. "additionalProperties": false
  1434. },
  1435. "line_number": {
  1436. "type": "integer",
  1437. "minimum": 0
  1438. },
  1439. "absolute_offset": {
  1440. "type": "integer",
  1441. "minimum": 0
  1442. },
  1443. "submatches": {
  1444. "type": "array",
  1445. "items": {
  1446. "type": "object",
  1447. "properties": {
  1448. "match": {
  1449. "type": "object",
  1450. "properties": {
  1451. "text": {
  1452. "type": "string"
  1453. }
  1454. },
  1455. "required": ["text"],
  1456. "additionalProperties": false
  1457. },
  1458. "start": {
  1459. "type": "integer",
  1460. "minimum": 0
  1461. },
  1462. "end": {
  1463. "type": "integer",
  1464. "minimum": 0
  1465. }
  1466. },
  1467. "required": ["match", "start", "end"],
  1468. "additionalProperties": false
  1469. }
  1470. }
  1471. },
  1472. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"],
  1473. "additionalProperties": false
  1474. },
  1475. "description": "Matches"
  1476. }
  1477. }
  1478. }
  1479. }
  1480. },
  1481. "description": "Search for text patterns across files in the project using ripgrep.",
  1482. "summary": "Find text",
  1483. "x-codeSamples": [
  1484. {
  1485. "lang": "js",
  1486. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  1487. }
  1488. ]
  1489. }
  1490. },
  1491. "/find/file": {
  1492. "get": {
  1493. "tags": ["file"],
  1494. "operationId": "find.files",
  1495. "parameters": [
  1496. {
  1497. "name": "directory",
  1498. "in": "query",
  1499. "schema": {
  1500. "type": "string"
  1501. },
  1502. "required": false
  1503. },
  1504. {
  1505. "name": "workspace",
  1506. "in": "query",
  1507. "schema": {
  1508. "type": "string"
  1509. },
  1510. "required": false
  1511. },
  1512. {
  1513. "name": "query",
  1514. "in": "query",
  1515. "schema": {
  1516. "type": "string"
  1517. },
  1518. "required": true
  1519. },
  1520. {
  1521. "name": "dirs",
  1522. "in": "query",
  1523. "schema": {
  1524. "type": "string",
  1525. "enum": ["true", "false"]
  1526. },
  1527. "required": false
  1528. },
  1529. {
  1530. "name": "type",
  1531. "in": "query",
  1532. "schema": {
  1533. "type": "string",
  1534. "enum": ["file", "directory"]
  1535. },
  1536. "required": false
  1537. },
  1538. {
  1539. "name": "limit",
  1540. "in": "query",
  1541. "schema": {
  1542. "type": "integer",
  1543. "minimum": 1,
  1544. "maximum": 200
  1545. },
  1546. "required": false
  1547. }
  1548. ],
  1549. "responses": {
  1550. "200": {
  1551. "description": "File paths",
  1552. "content": {
  1553. "application/json": {
  1554. "schema": {
  1555. "type": "array",
  1556. "items": {
  1557. "type": "string"
  1558. },
  1559. "description": "File paths"
  1560. }
  1561. }
  1562. }
  1563. }
  1564. },
  1565. "description": "Search for files or directories by name or pattern in the project directory.",
  1566. "summary": "Find files",
  1567. "x-codeSamples": [
  1568. {
  1569. "lang": "js",
  1570. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  1571. }
  1572. ]
  1573. }
  1574. },
  1575. "/find/symbol": {
  1576. "get": {
  1577. "tags": ["file"],
  1578. "operationId": "find.symbols",
  1579. "parameters": [
  1580. {
  1581. "name": "directory",
  1582. "in": "query",
  1583. "schema": {
  1584. "type": "string"
  1585. },
  1586. "required": false
  1587. },
  1588. {
  1589. "name": "workspace",
  1590. "in": "query",
  1591. "schema": {
  1592. "type": "string"
  1593. },
  1594. "required": false
  1595. },
  1596. {
  1597. "name": "query",
  1598. "in": "query",
  1599. "schema": {
  1600. "type": "string"
  1601. },
  1602. "required": true
  1603. }
  1604. ],
  1605. "responses": {
  1606. "200": {
  1607. "description": "Symbols",
  1608. "content": {
  1609. "application/json": {
  1610. "schema": {
  1611. "type": "array",
  1612. "items": {
  1613. "$ref": "#/components/schemas/Symbol"
  1614. },
  1615. "description": "Symbols"
  1616. }
  1617. }
  1618. }
  1619. }
  1620. },
  1621. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  1622. "summary": "Find symbols",
  1623. "x-codeSamples": [
  1624. {
  1625. "lang": "js",
  1626. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  1627. }
  1628. ]
  1629. }
  1630. },
  1631. "/file": {
  1632. "get": {
  1633. "tags": ["file"],
  1634. "operationId": "file.list",
  1635. "parameters": [
  1636. {
  1637. "name": "directory",
  1638. "in": "query",
  1639. "schema": {
  1640. "type": "string"
  1641. },
  1642. "required": false
  1643. },
  1644. {
  1645. "name": "workspace",
  1646. "in": "query",
  1647. "schema": {
  1648. "type": "string"
  1649. },
  1650. "required": false
  1651. },
  1652. {
  1653. "name": "path",
  1654. "in": "query",
  1655. "schema": {
  1656. "type": "string"
  1657. },
  1658. "required": true
  1659. }
  1660. ],
  1661. "responses": {
  1662. "200": {
  1663. "description": "Files and directories",
  1664. "content": {
  1665. "application/json": {
  1666. "schema": {
  1667. "type": "array",
  1668. "items": {
  1669. "$ref": "#/components/schemas/FileNode"
  1670. },
  1671. "description": "Files and directories"
  1672. }
  1673. }
  1674. }
  1675. }
  1676. },
  1677. "description": "List files and directories in a specified path.",
  1678. "summary": "List files",
  1679. "x-codeSamples": [
  1680. {
  1681. "lang": "js",
  1682. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  1683. }
  1684. ]
  1685. }
  1686. },
  1687. "/file/content": {
  1688. "get": {
  1689. "tags": ["file"],
  1690. "operationId": "file.read",
  1691. "parameters": [
  1692. {
  1693. "name": "directory",
  1694. "in": "query",
  1695. "schema": {
  1696. "type": "string"
  1697. },
  1698. "required": false
  1699. },
  1700. {
  1701. "name": "workspace",
  1702. "in": "query",
  1703. "schema": {
  1704. "type": "string"
  1705. },
  1706. "required": false
  1707. },
  1708. {
  1709. "name": "path",
  1710. "in": "query",
  1711. "schema": {
  1712. "type": "string"
  1713. },
  1714. "required": true
  1715. }
  1716. ],
  1717. "responses": {
  1718. "200": {
  1719. "description": "File content",
  1720. "content": {
  1721. "application/json": {
  1722. "schema": {
  1723. "$ref": "#/components/schemas/FileContent"
  1724. }
  1725. }
  1726. }
  1727. }
  1728. },
  1729. "description": "Read the content of a specified file.",
  1730. "summary": "Read file",
  1731. "x-codeSamples": [
  1732. {
  1733. "lang": "js",
  1734. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  1735. }
  1736. ]
  1737. }
  1738. },
  1739. "/file/status": {
  1740. "get": {
  1741. "tags": ["file"],
  1742. "operationId": "file.status",
  1743. "parameters": [
  1744. {
  1745. "name": "directory",
  1746. "in": "query",
  1747. "schema": {
  1748. "type": "string"
  1749. },
  1750. "required": false
  1751. },
  1752. {
  1753. "name": "workspace",
  1754. "in": "query",
  1755. "schema": {
  1756. "type": "string"
  1757. },
  1758. "required": false
  1759. }
  1760. ],
  1761. "responses": {
  1762. "200": {
  1763. "description": "File status",
  1764. "content": {
  1765. "application/json": {
  1766. "schema": {
  1767. "type": "array",
  1768. "items": {
  1769. "$ref": "#/components/schemas/File"
  1770. },
  1771. "description": "File status"
  1772. }
  1773. }
  1774. }
  1775. }
  1776. },
  1777. "description": "Get the git status of all files in the project.",
  1778. "summary": "Get file status",
  1779. "x-codeSamples": [
  1780. {
  1781. "lang": "js",
  1782. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  1783. }
  1784. ]
  1785. }
  1786. },
  1787. "/instance/dispose": {
  1788. "post": {
  1789. "tags": ["instance"],
  1790. "operationId": "instance.dispose",
  1791. "parameters": [
  1792. {
  1793. "name": "directory",
  1794. "in": "query",
  1795. "schema": {
  1796. "type": "string"
  1797. },
  1798. "required": false
  1799. },
  1800. {
  1801. "name": "workspace",
  1802. "in": "query",
  1803. "schema": {
  1804. "type": "string"
  1805. },
  1806. "required": false
  1807. }
  1808. ],
  1809. "responses": {
  1810. "200": {
  1811. "description": "Instance disposed",
  1812. "content": {
  1813. "application/json": {
  1814. "schema": {
  1815. "type": "boolean",
  1816. "description": "Instance disposed"
  1817. }
  1818. }
  1819. }
  1820. }
  1821. },
  1822. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  1823. "summary": "Dispose instance",
  1824. "x-codeSamples": [
  1825. {
  1826. "lang": "js",
  1827. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  1828. }
  1829. ]
  1830. }
  1831. },
  1832. "/path": {
  1833. "get": {
  1834. "tags": ["instance"],
  1835. "operationId": "path.get",
  1836. "parameters": [
  1837. {
  1838. "name": "directory",
  1839. "in": "query",
  1840. "schema": {
  1841. "type": "string"
  1842. },
  1843. "required": false
  1844. },
  1845. {
  1846. "name": "workspace",
  1847. "in": "query",
  1848. "schema": {
  1849. "type": "string"
  1850. },
  1851. "required": false
  1852. }
  1853. ],
  1854. "responses": {
  1855. "200": {
  1856. "description": "Path",
  1857. "content": {
  1858. "application/json": {
  1859. "schema": {
  1860. "$ref": "#/components/schemas/Path"
  1861. }
  1862. }
  1863. }
  1864. }
  1865. },
  1866. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  1867. "summary": "Get paths",
  1868. "x-codeSamples": [
  1869. {
  1870. "lang": "js",
  1871. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  1872. }
  1873. ]
  1874. }
  1875. },
  1876. "/vcs": {
  1877. "get": {
  1878. "tags": ["instance"],
  1879. "operationId": "vcs.get",
  1880. "parameters": [
  1881. {
  1882. "name": "directory",
  1883. "in": "query",
  1884. "schema": {
  1885. "type": "string"
  1886. },
  1887. "required": false
  1888. },
  1889. {
  1890. "name": "workspace",
  1891. "in": "query",
  1892. "schema": {
  1893. "type": "string"
  1894. },
  1895. "required": false
  1896. }
  1897. ],
  1898. "responses": {
  1899. "200": {
  1900. "description": "VCS info",
  1901. "content": {
  1902. "application/json": {
  1903. "schema": {
  1904. "$ref": "#/components/schemas/VcsInfo"
  1905. }
  1906. }
  1907. }
  1908. }
  1909. },
  1910. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  1911. "summary": "Get VCS info",
  1912. "x-codeSamples": [
  1913. {
  1914. "lang": "js",
  1915. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  1916. }
  1917. ]
  1918. }
  1919. },
  1920. "/vcs/status": {
  1921. "get": {
  1922. "tags": ["instance"],
  1923. "operationId": "vcs.status",
  1924. "parameters": [
  1925. {
  1926. "name": "directory",
  1927. "in": "query",
  1928. "schema": {
  1929. "type": "string"
  1930. },
  1931. "required": false
  1932. },
  1933. {
  1934. "name": "workspace",
  1935. "in": "query",
  1936. "schema": {
  1937. "type": "string"
  1938. },
  1939. "required": false
  1940. }
  1941. ],
  1942. "responses": {
  1943. "200": {
  1944. "description": "VCS status",
  1945. "content": {
  1946. "application/json": {
  1947. "schema": {
  1948. "type": "array",
  1949. "items": {
  1950. "$ref": "#/components/schemas/VcsFileStatus"
  1951. },
  1952. "description": "VCS status"
  1953. }
  1954. }
  1955. }
  1956. }
  1957. },
  1958. "description": "Retrieve changed files in the current working tree without patches.",
  1959. "summary": "Get VCS status",
  1960. "x-codeSamples": [
  1961. {
  1962. "lang": "js",
  1963. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.status({\n ...\n})"
  1964. }
  1965. ]
  1966. }
  1967. },
  1968. "/vcs/diff": {
  1969. "get": {
  1970. "tags": ["instance"],
  1971. "operationId": "vcs.diff",
  1972. "parameters": [
  1973. {
  1974. "name": "directory",
  1975. "in": "query",
  1976. "schema": {
  1977. "type": "string"
  1978. },
  1979. "required": false
  1980. },
  1981. {
  1982. "name": "workspace",
  1983. "in": "query",
  1984. "schema": {
  1985. "type": "string"
  1986. },
  1987. "required": false
  1988. },
  1989. {
  1990. "name": "mode",
  1991. "in": "query",
  1992. "schema": {
  1993. "type": "string",
  1994. "enum": ["git", "branch"]
  1995. },
  1996. "required": true
  1997. }
  1998. ],
  1999. "responses": {
  2000. "200": {
  2001. "description": "VCS diff",
  2002. "content": {
  2003. "application/json": {
  2004. "schema": {
  2005. "type": "array",
  2006. "items": {
  2007. "$ref": "#/components/schemas/VcsFileDiff"
  2008. },
  2009. "description": "VCS diff"
  2010. }
  2011. }
  2012. }
  2013. }
  2014. },
  2015. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  2016. "summary": "Get VCS diff",
  2017. "x-codeSamples": [
  2018. {
  2019. "lang": "js",
  2020. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  2021. }
  2022. ]
  2023. }
  2024. },
  2025. "/vcs/diff/raw": {
  2026. "get": {
  2027. "tags": ["instance"],
  2028. "operationId": "vcs.diff.raw",
  2029. "parameters": [
  2030. {
  2031. "name": "directory",
  2032. "in": "query",
  2033. "schema": {
  2034. "type": "string"
  2035. },
  2036. "required": false
  2037. },
  2038. {
  2039. "name": "workspace",
  2040. "in": "query",
  2041. "schema": {
  2042. "type": "string"
  2043. },
  2044. "required": false
  2045. }
  2046. ],
  2047. "responses": {
  2048. "200": {
  2049. "description": "Raw VCS diff",
  2050. "content": {
  2051. "text/x-diff; charset=utf-8": {
  2052. "schema": {
  2053. "type": "string"
  2054. }
  2055. }
  2056. }
  2057. }
  2058. },
  2059. "description": "Retrieve a raw patch for current uncommitted changes.",
  2060. "summary": "Get raw VCS diff",
  2061. "x-codeSamples": [
  2062. {
  2063. "lang": "js",
  2064. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff.raw({\n ...\n})"
  2065. }
  2066. ]
  2067. }
  2068. },
  2069. "/vcs/apply": {
  2070. "post": {
  2071. "tags": ["instance"],
  2072. "operationId": "vcs.apply",
  2073. "parameters": [
  2074. {
  2075. "name": "directory",
  2076. "in": "query",
  2077. "schema": {
  2078. "type": "string"
  2079. },
  2080. "required": false
  2081. },
  2082. {
  2083. "name": "workspace",
  2084. "in": "query",
  2085. "schema": {
  2086. "type": "string"
  2087. },
  2088. "required": false
  2089. }
  2090. ],
  2091. "responses": {
  2092. "200": {
  2093. "description": "VCS patch applied",
  2094. "content": {
  2095. "application/json": {
  2096. "schema": {
  2097. "type": "object",
  2098. "properties": {
  2099. "applied": {
  2100. "type": "boolean"
  2101. }
  2102. },
  2103. "required": ["applied"],
  2104. "additionalProperties": false,
  2105. "description": "VCS patch applied"
  2106. }
  2107. }
  2108. }
  2109. },
  2110. "400": {
  2111. "description": "VcsApplyError",
  2112. "content": {
  2113. "application/json": {
  2114. "schema": {
  2115. "$ref": "#/components/schemas/VcsApplyError"
  2116. }
  2117. }
  2118. }
  2119. }
  2120. },
  2121. "description": "Apply a raw patch to the current working tree.",
  2122. "summary": "Apply VCS patch",
  2123. "requestBody": {
  2124. "content": {
  2125. "application/json": {
  2126. "schema": {
  2127. "type": "object",
  2128. "properties": {
  2129. "patch": {
  2130. "type": "string"
  2131. }
  2132. },
  2133. "required": ["patch"],
  2134. "additionalProperties": false
  2135. }
  2136. }
  2137. }
  2138. },
  2139. "x-codeSamples": [
  2140. {
  2141. "lang": "js",
  2142. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.apply({\n ...\n})"
  2143. }
  2144. ]
  2145. }
  2146. },
  2147. "/command": {
  2148. "get": {
  2149. "tags": ["instance"],
  2150. "operationId": "command.list",
  2151. "parameters": [
  2152. {
  2153. "name": "directory",
  2154. "in": "query",
  2155. "schema": {
  2156. "type": "string"
  2157. },
  2158. "required": false
  2159. },
  2160. {
  2161. "name": "workspace",
  2162. "in": "query",
  2163. "schema": {
  2164. "type": "string"
  2165. },
  2166. "required": false
  2167. }
  2168. ],
  2169. "responses": {
  2170. "200": {
  2171. "description": "List of commands",
  2172. "content": {
  2173. "application/json": {
  2174. "schema": {
  2175. "type": "array",
  2176. "items": {
  2177. "$ref": "#/components/schemas/Command"
  2178. },
  2179. "description": "List of commands"
  2180. }
  2181. }
  2182. }
  2183. }
  2184. },
  2185. "description": "Get a list of all available commands in the OpenCode system.",
  2186. "summary": "List commands",
  2187. "x-codeSamples": [
  2188. {
  2189. "lang": "js",
  2190. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  2191. }
  2192. ]
  2193. }
  2194. },
  2195. "/agent": {
  2196. "get": {
  2197. "tags": ["instance"],
  2198. "operationId": "app.agents",
  2199. "parameters": [
  2200. {
  2201. "name": "directory",
  2202. "in": "query",
  2203. "schema": {
  2204. "type": "string"
  2205. },
  2206. "required": false
  2207. },
  2208. {
  2209. "name": "workspace",
  2210. "in": "query",
  2211. "schema": {
  2212. "type": "string"
  2213. },
  2214. "required": false
  2215. }
  2216. ],
  2217. "responses": {
  2218. "200": {
  2219. "description": "List of agents",
  2220. "content": {
  2221. "application/json": {
  2222. "schema": {
  2223. "type": "array",
  2224. "items": {
  2225. "$ref": "#/components/schemas/Agent"
  2226. },
  2227. "description": "List of agents"
  2228. }
  2229. }
  2230. }
  2231. }
  2232. },
  2233. "description": "Get a list of all available AI agents in the OpenCode system.",
  2234. "summary": "List agents",
  2235. "x-codeSamples": [
  2236. {
  2237. "lang": "js",
  2238. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  2239. }
  2240. ]
  2241. }
  2242. },
  2243. "/skill": {
  2244. "get": {
  2245. "tags": ["instance"],
  2246. "operationId": "app.skills",
  2247. "parameters": [
  2248. {
  2249. "name": "directory",
  2250. "in": "query",
  2251. "schema": {
  2252. "type": "string"
  2253. },
  2254. "required": false
  2255. },
  2256. {
  2257. "name": "workspace",
  2258. "in": "query",
  2259. "schema": {
  2260. "type": "string"
  2261. },
  2262. "required": false
  2263. }
  2264. ],
  2265. "responses": {
  2266. "200": {
  2267. "description": "List of skills",
  2268. "content": {
  2269. "application/json": {
  2270. "schema": {
  2271. "type": "array",
  2272. "items": {
  2273. "type": "object",
  2274. "properties": {
  2275. "name": {
  2276. "type": "string"
  2277. },
  2278. "description": {
  2279. "type": "string"
  2280. },
  2281. "location": {
  2282. "type": "string"
  2283. },
  2284. "content": {
  2285. "type": "string"
  2286. }
  2287. },
  2288. "required": ["name", "location", "content"],
  2289. "additionalProperties": false
  2290. },
  2291. "description": "List of skills"
  2292. }
  2293. }
  2294. }
  2295. }
  2296. },
  2297. "description": "Get a list of all available skills in the OpenCode system.",
  2298. "summary": "List skills",
  2299. "x-codeSamples": [
  2300. {
  2301. "lang": "js",
  2302. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  2303. }
  2304. ]
  2305. }
  2306. },
  2307. "/lsp": {
  2308. "get": {
  2309. "tags": ["instance"],
  2310. "operationId": "lsp.status",
  2311. "parameters": [
  2312. {
  2313. "name": "directory",
  2314. "in": "query",
  2315. "schema": {
  2316. "type": "string"
  2317. },
  2318. "required": false
  2319. },
  2320. {
  2321. "name": "workspace",
  2322. "in": "query",
  2323. "schema": {
  2324. "type": "string"
  2325. },
  2326. "required": false
  2327. }
  2328. ],
  2329. "responses": {
  2330. "200": {
  2331. "description": "LSP server status",
  2332. "content": {
  2333. "application/json": {
  2334. "schema": {
  2335. "type": "array",
  2336. "items": {
  2337. "$ref": "#/components/schemas/LSPStatus"
  2338. },
  2339. "description": "LSP server status"
  2340. }
  2341. }
  2342. }
  2343. }
  2344. },
  2345. "description": "Get LSP server status",
  2346. "summary": "Get LSP status",
  2347. "x-codeSamples": [
  2348. {
  2349. "lang": "js",
  2350. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  2351. }
  2352. ]
  2353. }
  2354. },
  2355. "/formatter": {
  2356. "get": {
  2357. "tags": ["instance"],
  2358. "operationId": "formatter.status",
  2359. "parameters": [
  2360. {
  2361. "name": "directory",
  2362. "in": "query",
  2363. "schema": {
  2364. "type": "string"
  2365. },
  2366. "required": false
  2367. },
  2368. {
  2369. "name": "workspace",
  2370. "in": "query",
  2371. "schema": {
  2372. "type": "string"
  2373. },
  2374. "required": false
  2375. }
  2376. ],
  2377. "responses": {
  2378. "200": {
  2379. "description": "Formatter status",
  2380. "content": {
  2381. "application/json": {
  2382. "schema": {
  2383. "type": "array",
  2384. "items": {
  2385. "$ref": "#/components/schemas/FormatterStatus"
  2386. },
  2387. "description": "Formatter status"
  2388. }
  2389. }
  2390. }
  2391. }
  2392. },
  2393. "description": "Get formatter status",
  2394. "summary": "Get formatter status",
  2395. "x-codeSamples": [
  2396. {
  2397. "lang": "js",
  2398. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  2399. }
  2400. ]
  2401. }
  2402. },
  2403. "/mcp": {
  2404. "get": {
  2405. "tags": ["mcp"],
  2406. "operationId": "mcp.status",
  2407. "parameters": [
  2408. {
  2409. "name": "directory",
  2410. "in": "query",
  2411. "schema": {
  2412. "type": "string"
  2413. },
  2414. "required": false
  2415. },
  2416. {
  2417. "name": "workspace",
  2418. "in": "query",
  2419. "schema": {
  2420. "type": "string"
  2421. },
  2422. "required": false
  2423. }
  2424. ],
  2425. "responses": {
  2426. "200": {
  2427. "description": "MCP server status",
  2428. "content": {
  2429. "application/json": {
  2430. "schema": {
  2431. "type": "object",
  2432. "additionalProperties": {
  2433. "$ref": "#/components/schemas/MCPStatus"
  2434. },
  2435. "description": "MCP server status"
  2436. }
  2437. }
  2438. }
  2439. }
  2440. },
  2441. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  2442. "summary": "Get MCP status",
  2443. "x-codeSamples": [
  2444. {
  2445. "lang": "js",
  2446. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  2447. }
  2448. ]
  2449. },
  2450. "post": {
  2451. "tags": ["mcp"],
  2452. "operationId": "mcp.add",
  2453. "parameters": [
  2454. {
  2455. "name": "directory",
  2456. "in": "query",
  2457. "schema": {
  2458. "type": "string"
  2459. },
  2460. "required": false
  2461. },
  2462. {
  2463. "name": "workspace",
  2464. "in": "query",
  2465. "schema": {
  2466. "type": "string"
  2467. },
  2468. "required": false
  2469. }
  2470. ],
  2471. "responses": {
  2472. "200": {
  2473. "description": "MCP server added successfully",
  2474. "content": {
  2475. "application/json": {
  2476. "schema": {
  2477. "type": "object",
  2478. "additionalProperties": {
  2479. "$ref": "#/components/schemas/MCPStatus"
  2480. },
  2481. "description": "MCP server added successfully"
  2482. }
  2483. }
  2484. }
  2485. },
  2486. "400": {
  2487. "description": "Bad request",
  2488. "content": {
  2489. "application/json": {
  2490. "schema": {
  2491. "$ref": "#/components/schemas/BadRequestError"
  2492. }
  2493. }
  2494. }
  2495. }
  2496. },
  2497. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  2498. "summary": "Add MCP server",
  2499. "requestBody": {
  2500. "content": {
  2501. "application/json": {
  2502. "schema": {
  2503. "type": "object",
  2504. "properties": {
  2505. "name": {
  2506. "type": "string"
  2507. },
  2508. "config": {
  2509. "anyOf": [
  2510. {
  2511. "$ref": "#/components/schemas/McpLocalConfig"
  2512. },
  2513. {
  2514. "$ref": "#/components/schemas/McpRemoteConfig"
  2515. }
  2516. ]
  2517. }
  2518. },
  2519. "required": ["name", "config"],
  2520. "additionalProperties": false
  2521. }
  2522. }
  2523. }
  2524. },
  2525. "x-codeSamples": [
  2526. {
  2527. "lang": "js",
  2528. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  2529. }
  2530. ]
  2531. }
  2532. },
  2533. "/mcp/{name}/auth": {
  2534. "post": {
  2535. "tags": ["mcp"],
  2536. "operationId": "mcp.auth.start",
  2537. "parameters": [
  2538. {
  2539. "name": "name",
  2540. "in": "path",
  2541. "schema": {
  2542. "type": "string"
  2543. },
  2544. "required": true
  2545. },
  2546. {
  2547. "name": "directory",
  2548. "in": "query",
  2549. "schema": {
  2550. "type": "string"
  2551. },
  2552. "required": false
  2553. },
  2554. {
  2555. "name": "workspace",
  2556. "in": "query",
  2557. "schema": {
  2558. "type": "string"
  2559. },
  2560. "required": false
  2561. }
  2562. ],
  2563. "responses": {
  2564. "200": {
  2565. "description": "OAuth flow started",
  2566. "content": {
  2567. "application/json": {
  2568. "schema": {
  2569. "type": "object",
  2570. "properties": {
  2571. "authorizationUrl": {
  2572. "type": "string"
  2573. },
  2574. "oauthState": {
  2575. "type": "string"
  2576. }
  2577. },
  2578. "required": ["authorizationUrl", "oauthState"],
  2579. "additionalProperties": false,
  2580. "description": "OAuth flow started"
  2581. }
  2582. }
  2583. }
  2584. },
  2585. "400": {
  2586. "description": "McpUnsupportedOAuthError",
  2587. "content": {
  2588. "application/json": {
  2589. "schema": {
  2590. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2591. }
  2592. }
  2593. }
  2594. },
  2595. "404": {
  2596. "description": "Not found",
  2597. "content": {
  2598. "application/json": {
  2599. "schema": {
  2600. "$ref": "#/components/schemas/NotFoundError"
  2601. }
  2602. }
  2603. }
  2604. }
  2605. },
  2606. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  2607. "summary": "Start MCP OAuth",
  2608. "x-codeSamples": [
  2609. {
  2610. "lang": "js",
  2611. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  2612. }
  2613. ]
  2614. },
  2615. "delete": {
  2616. "tags": ["mcp"],
  2617. "operationId": "mcp.auth.remove",
  2618. "parameters": [
  2619. {
  2620. "name": "name",
  2621. "in": "path",
  2622. "schema": {
  2623. "type": "string"
  2624. },
  2625. "required": true
  2626. },
  2627. {
  2628. "name": "directory",
  2629. "in": "query",
  2630. "schema": {
  2631. "type": "string"
  2632. },
  2633. "required": false
  2634. },
  2635. {
  2636. "name": "workspace",
  2637. "in": "query",
  2638. "schema": {
  2639. "type": "string"
  2640. },
  2641. "required": false
  2642. }
  2643. ],
  2644. "responses": {
  2645. "200": {
  2646. "description": "OAuth credentials removed",
  2647. "content": {
  2648. "application/json": {
  2649. "schema": {
  2650. "type": "object",
  2651. "properties": {
  2652. "success": {
  2653. "type": "boolean",
  2654. "enum": [true]
  2655. }
  2656. },
  2657. "required": ["success"],
  2658. "additionalProperties": false,
  2659. "description": "OAuth credentials removed"
  2660. }
  2661. }
  2662. }
  2663. },
  2664. "404": {
  2665. "description": "Not found",
  2666. "content": {
  2667. "application/json": {
  2668. "schema": {
  2669. "$ref": "#/components/schemas/NotFoundError"
  2670. }
  2671. }
  2672. }
  2673. }
  2674. },
  2675. "description": "Remove OAuth credentials for an MCP server.",
  2676. "summary": "Remove MCP OAuth",
  2677. "x-codeSamples": [
  2678. {
  2679. "lang": "js",
  2680. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  2681. }
  2682. ]
  2683. }
  2684. },
  2685. "/mcp/{name}/auth/callback": {
  2686. "post": {
  2687. "tags": ["mcp"],
  2688. "operationId": "mcp.auth.callback",
  2689. "parameters": [
  2690. {
  2691. "name": "name",
  2692. "in": "path",
  2693. "schema": {
  2694. "type": "string"
  2695. },
  2696. "required": true
  2697. },
  2698. {
  2699. "name": "directory",
  2700. "in": "query",
  2701. "schema": {
  2702. "type": "string"
  2703. },
  2704. "required": false
  2705. },
  2706. {
  2707. "name": "workspace",
  2708. "in": "query",
  2709. "schema": {
  2710. "type": "string"
  2711. },
  2712. "required": false
  2713. }
  2714. ],
  2715. "responses": {
  2716. "200": {
  2717. "description": "OAuth authentication completed",
  2718. "content": {
  2719. "application/json": {
  2720. "schema": {
  2721. "$ref": "#/components/schemas/MCPStatus"
  2722. }
  2723. }
  2724. }
  2725. },
  2726. "400": {
  2727. "description": "Bad request",
  2728. "content": {
  2729. "application/json": {
  2730. "schema": {
  2731. "$ref": "#/components/schemas/BadRequestError"
  2732. }
  2733. }
  2734. }
  2735. },
  2736. "404": {
  2737. "description": "Not found",
  2738. "content": {
  2739. "application/json": {
  2740. "schema": {
  2741. "$ref": "#/components/schemas/NotFoundError"
  2742. }
  2743. }
  2744. }
  2745. }
  2746. },
  2747. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  2748. "summary": "Complete MCP OAuth",
  2749. "requestBody": {
  2750. "content": {
  2751. "application/json": {
  2752. "schema": {
  2753. "type": "object",
  2754. "properties": {
  2755. "code": {
  2756. "type": "string"
  2757. }
  2758. },
  2759. "required": ["code"],
  2760. "additionalProperties": false
  2761. }
  2762. }
  2763. }
  2764. },
  2765. "x-codeSamples": [
  2766. {
  2767. "lang": "js",
  2768. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  2769. }
  2770. ]
  2771. }
  2772. },
  2773. "/mcp/{name}/auth/authenticate": {
  2774. "post": {
  2775. "tags": ["mcp"],
  2776. "operationId": "mcp.auth.authenticate",
  2777. "parameters": [
  2778. {
  2779. "name": "name",
  2780. "in": "path",
  2781. "schema": {
  2782. "type": "string"
  2783. },
  2784. "required": true
  2785. },
  2786. {
  2787. "name": "directory",
  2788. "in": "query",
  2789. "schema": {
  2790. "type": "string"
  2791. },
  2792. "required": false
  2793. },
  2794. {
  2795. "name": "workspace",
  2796. "in": "query",
  2797. "schema": {
  2798. "type": "string"
  2799. },
  2800. "required": false
  2801. }
  2802. ],
  2803. "responses": {
  2804. "200": {
  2805. "description": "OAuth authentication completed",
  2806. "content": {
  2807. "application/json": {
  2808. "schema": {
  2809. "$ref": "#/components/schemas/MCPStatus"
  2810. }
  2811. }
  2812. }
  2813. },
  2814. "400": {
  2815. "description": "McpUnsupportedOAuthError",
  2816. "content": {
  2817. "application/json": {
  2818. "schema": {
  2819. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2820. }
  2821. }
  2822. }
  2823. },
  2824. "404": {
  2825. "description": "Not found",
  2826. "content": {
  2827. "application/json": {
  2828. "schema": {
  2829. "$ref": "#/components/schemas/NotFoundError"
  2830. }
  2831. }
  2832. }
  2833. }
  2834. },
  2835. "description": "Start OAuth flow and wait for callback (opens browser).",
  2836. "summary": "Authenticate MCP OAuth",
  2837. "x-codeSamples": [
  2838. {
  2839. "lang": "js",
  2840. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  2841. }
  2842. ]
  2843. }
  2844. },
  2845. "/mcp/{name}/connect": {
  2846. "post": {
  2847. "tags": ["mcp"],
  2848. "operationId": "mcp.connect",
  2849. "parameters": [
  2850. {
  2851. "name": "name",
  2852. "in": "path",
  2853. "schema": {
  2854. "type": "string"
  2855. },
  2856. "required": true
  2857. },
  2858. {
  2859. "name": "directory",
  2860. "in": "query",
  2861. "schema": {
  2862. "type": "string"
  2863. },
  2864. "required": false
  2865. },
  2866. {
  2867. "name": "workspace",
  2868. "in": "query",
  2869. "schema": {
  2870. "type": "string"
  2871. },
  2872. "required": false
  2873. }
  2874. ],
  2875. "responses": {
  2876. "200": {
  2877. "description": "MCP server connected successfully",
  2878. "content": {
  2879. "application/json": {
  2880. "schema": {
  2881. "type": "boolean",
  2882. "description": "MCP server connected successfully"
  2883. }
  2884. }
  2885. }
  2886. }
  2887. },
  2888. "description": "Connect an MCP server.",
  2889. "x-codeSamples": [
  2890. {
  2891. "lang": "js",
  2892. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  2893. }
  2894. ]
  2895. }
  2896. },
  2897. "/mcp/{name}/disconnect": {
  2898. "post": {
  2899. "tags": ["mcp"],
  2900. "operationId": "mcp.disconnect",
  2901. "parameters": [
  2902. {
  2903. "name": "name",
  2904. "in": "path",
  2905. "schema": {
  2906. "type": "string"
  2907. },
  2908. "required": true
  2909. },
  2910. {
  2911. "name": "directory",
  2912. "in": "query",
  2913. "schema": {
  2914. "type": "string"
  2915. },
  2916. "required": false
  2917. },
  2918. {
  2919. "name": "workspace",
  2920. "in": "query",
  2921. "schema": {
  2922. "type": "string"
  2923. },
  2924. "required": false
  2925. }
  2926. ],
  2927. "responses": {
  2928. "200": {
  2929. "description": "MCP server disconnected successfully",
  2930. "content": {
  2931. "application/json": {
  2932. "schema": {
  2933. "type": "boolean",
  2934. "description": "MCP server disconnected successfully"
  2935. }
  2936. }
  2937. }
  2938. }
  2939. },
  2940. "description": "Disconnect an MCP server.",
  2941. "x-codeSamples": [
  2942. {
  2943. "lang": "js",
  2944. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  2945. }
  2946. ]
  2947. }
  2948. },
  2949. "/project": {
  2950. "get": {
  2951. "tags": ["project"],
  2952. "operationId": "project.list",
  2953. "parameters": [
  2954. {
  2955. "name": "directory",
  2956. "in": "query",
  2957. "schema": {
  2958. "type": "string"
  2959. },
  2960. "required": false
  2961. },
  2962. {
  2963. "name": "workspace",
  2964. "in": "query",
  2965. "schema": {
  2966. "type": "string"
  2967. },
  2968. "required": false
  2969. }
  2970. ],
  2971. "responses": {
  2972. "200": {
  2973. "description": "List of projects",
  2974. "content": {
  2975. "application/json": {
  2976. "schema": {
  2977. "type": "array",
  2978. "items": {
  2979. "$ref": "#/components/schemas/Project"
  2980. },
  2981. "description": "List of projects"
  2982. }
  2983. }
  2984. }
  2985. }
  2986. },
  2987. "description": "Get a list of projects that have been opened with OpenCode.",
  2988. "summary": "List all projects",
  2989. "x-codeSamples": [
  2990. {
  2991. "lang": "js",
  2992. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  2993. }
  2994. ]
  2995. }
  2996. },
  2997. "/project/current": {
  2998. "get": {
  2999. "tags": ["project"],
  3000. "operationId": "project.current",
  3001. "parameters": [
  3002. {
  3003. "name": "directory",
  3004. "in": "query",
  3005. "schema": {
  3006. "type": "string"
  3007. },
  3008. "required": false
  3009. },
  3010. {
  3011. "name": "workspace",
  3012. "in": "query",
  3013. "schema": {
  3014. "type": "string"
  3015. },
  3016. "required": false
  3017. }
  3018. ],
  3019. "responses": {
  3020. "200": {
  3021. "description": "Current project information",
  3022. "content": {
  3023. "application/json": {
  3024. "schema": {
  3025. "$ref": "#/components/schemas/Project"
  3026. }
  3027. }
  3028. }
  3029. }
  3030. },
  3031. "description": "Retrieve the currently active project that OpenCode is working with.",
  3032. "summary": "Get current project",
  3033. "x-codeSamples": [
  3034. {
  3035. "lang": "js",
  3036. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  3037. }
  3038. ]
  3039. }
  3040. },
  3041. "/project/git/init": {
  3042. "post": {
  3043. "tags": ["project"],
  3044. "operationId": "project.initGit",
  3045. "parameters": [
  3046. {
  3047. "name": "directory",
  3048. "in": "query",
  3049. "schema": {
  3050. "type": "string"
  3051. },
  3052. "required": false
  3053. },
  3054. {
  3055. "name": "workspace",
  3056. "in": "query",
  3057. "schema": {
  3058. "type": "string"
  3059. },
  3060. "required": false
  3061. }
  3062. ],
  3063. "responses": {
  3064. "200": {
  3065. "description": "Project information after git initialization",
  3066. "content": {
  3067. "application/json": {
  3068. "schema": {
  3069. "$ref": "#/components/schemas/Project"
  3070. }
  3071. }
  3072. }
  3073. }
  3074. },
  3075. "description": "Create a git repository for the current project and return the refreshed project info.",
  3076. "summary": "Initialize git repository",
  3077. "x-codeSamples": [
  3078. {
  3079. "lang": "js",
  3080. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  3081. }
  3082. ]
  3083. }
  3084. },
  3085. "/project/{projectID}": {
  3086. "patch": {
  3087. "tags": ["project"],
  3088. "operationId": "project.update",
  3089. "parameters": [
  3090. {
  3091. "name": "projectID",
  3092. "in": "path",
  3093. "schema": {
  3094. "type": "string"
  3095. },
  3096. "required": true
  3097. },
  3098. {
  3099. "name": "directory",
  3100. "in": "query",
  3101. "schema": {
  3102. "type": "string"
  3103. },
  3104. "required": false
  3105. },
  3106. {
  3107. "name": "workspace",
  3108. "in": "query",
  3109. "schema": {
  3110. "type": "string"
  3111. },
  3112. "required": false
  3113. }
  3114. ],
  3115. "responses": {
  3116. "200": {
  3117. "description": "Updated project information",
  3118. "content": {
  3119. "application/json": {
  3120. "schema": {
  3121. "$ref": "#/components/schemas/Project"
  3122. }
  3123. }
  3124. }
  3125. },
  3126. "400": {
  3127. "description": "Bad request",
  3128. "content": {
  3129. "application/json": {
  3130. "schema": {
  3131. "$ref": "#/components/schemas/BadRequestError"
  3132. }
  3133. }
  3134. }
  3135. },
  3136. "404": {
  3137. "description": "Not found",
  3138. "content": {
  3139. "application/json": {
  3140. "schema": {
  3141. "$ref": "#/components/schemas/NotFoundError"
  3142. }
  3143. }
  3144. }
  3145. }
  3146. },
  3147. "description": "Update project properties such as name, icon, and commands.",
  3148. "summary": "Update project",
  3149. "requestBody": {
  3150. "content": {
  3151. "application/json": {
  3152. "schema": {
  3153. "type": "object",
  3154. "properties": {
  3155. "name": {
  3156. "type": "string"
  3157. },
  3158. "icon": {
  3159. "type": "object",
  3160. "properties": {
  3161. "url": {
  3162. "type": "string"
  3163. },
  3164. "override": {
  3165. "type": "string"
  3166. },
  3167. "color": {
  3168. "type": "string"
  3169. }
  3170. },
  3171. "additionalProperties": false
  3172. },
  3173. "commands": {
  3174. "type": "object",
  3175. "properties": {
  3176. "start": {
  3177. "type": "string",
  3178. "description": "Startup script to run when creating a new workspace (worktree)"
  3179. }
  3180. },
  3181. "additionalProperties": false
  3182. }
  3183. },
  3184. "additionalProperties": false
  3185. }
  3186. }
  3187. }
  3188. },
  3189. "x-codeSamples": [
  3190. {
  3191. "lang": "js",
  3192. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  3193. }
  3194. ]
  3195. }
  3196. },
  3197. "/pty/shells": {
  3198. "get": {
  3199. "tags": ["pty"],
  3200. "operationId": "pty.shells",
  3201. "parameters": [
  3202. {
  3203. "name": "directory",
  3204. "in": "query",
  3205. "schema": {
  3206. "type": "string"
  3207. },
  3208. "required": false
  3209. },
  3210. {
  3211. "name": "workspace",
  3212. "in": "query",
  3213. "schema": {
  3214. "type": "string"
  3215. },
  3216. "required": false
  3217. }
  3218. ],
  3219. "responses": {
  3220. "200": {
  3221. "description": "List of shells",
  3222. "content": {
  3223. "application/json": {
  3224. "schema": {
  3225. "type": "array",
  3226. "items": {
  3227. "type": "object",
  3228. "properties": {
  3229. "path": {
  3230. "type": "string"
  3231. },
  3232. "name": {
  3233. "type": "string"
  3234. },
  3235. "acceptable": {
  3236. "type": "boolean"
  3237. }
  3238. },
  3239. "required": ["path", "name", "acceptable"],
  3240. "additionalProperties": false
  3241. },
  3242. "description": "List of shells"
  3243. }
  3244. }
  3245. }
  3246. }
  3247. },
  3248. "description": "Get a list of available shells on the system.",
  3249. "summary": "List available shells",
  3250. "x-codeSamples": [
  3251. {
  3252. "lang": "js",
  3253. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n ...\n})"
  3254. }
  3255. ]
  3256. }
  3257. },
  3258. "/pty": {
  3259. "get": {
  3260. "tags": ["pty"],
  3261. "operationId": "pty.list",
  3262. "parameters": [
  3263. {
  3264. "name": "directory",
  3265. "in": "query",
  3266. "schema": {
  3267. "type": "string"
  3268. },
  3269. "required": false
  3270. },
  3271. {
  3272. "name": "workspace",
  3273. "in": "query",
  3274. "schema": {
  3275. "type": "string"
  3276. },
  3277. "required": false
  3278. }
  3279. ],
  3280. "responses": {
  3281. "200": {
  3282. "description": "List of sessions",
  3283. "content": {
  3284. "application/json": {
  3285. "schema": {
  3286. "type": "array",
  3287. "items": {
  3288. "$ref": "#/components/schemas/Pty"
  3289. },
  3290. "description": "List of sessions"
  3291. }
  3292. }
  3293. }
  3294. }
  3295. },
  3296. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  3297. "summary": "List PTY sessions",
  3298. "x-codeSamples": [
  3299. {
  3300. "lang": "js",
  3301. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  3302. }
  3303. ]
  3304. },
  3305. "post": {
  3306. "tags": ["pty"],
  3307. "operationId": "pty.create",
  3308. "parameters": [
  3309. {
  3310. "name": "directory",
  3311. "in": "query",
  3312. "schema": {
  3313. "type": "string"
  3314. },
  3315. "required": false
  3316. },
  3317. {
  3318. "name": "workspace",
  3319. "in": "query",
  3320. "schema": {
  3321. "type": "string"
  3322. },
  3323. "required": false
  3324. }
  3325. ],
  3326. "responses": {
  3327. "200": {
  3328. "description": "Created session",
  3329. "content": {
  3330. "application/json": {
  3331. "schema": {
  3332. "$ref": "#/components/schemas/Pty"
  3333. }
  3334. }
  3335. }
  3336. },
  3337. "400": {
  3338. "description": "Bad request",
  3339. "content": {
  3340. "application/json": {
  3341. "schema": {
  3342. "$ref": "#/components/schemas/BadRequestError"
  3343. }
  3344. }
  3345. }
  3346. }
  3347. },
  3348. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  3349. "summary": "Create PTY session",
  3350. "requestBody": {
  3351. "content": {
  3352. "application/json": {
  3353. "schema": {
  3354. "type": "object",
  3355. "properties": {
  3356. "command": {
  3357. "type": "string"
  3358. },
  3359. "args": {
  3360. "type": "array",
  3361. "items": {
  3362. "type": "string"
  3363. }
  3364. },
  3365. "cwd": {
  3366. "type": "string"
  3367. },
  3368. "title": {
  3369. "type": "string"
  3370. },
  3371. "env": {
  3372. "type": "object",
  3373. "additionalProperties": {
  3374. "type": "string"
  3375. }
  3376. }
  3377. },
  3378. "additionalProperties": false
  3379. }
  3380. }
  3381. }
  3382. },
  3383. "x-codeSamples": [
  3384. {
  3385. "lang": "js",
  3386. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  3387. }
  3388. ]
  3389. }
  3390. },
  3391. "/pty/{ptyID}": {
  3392. "get": {
  3393. "tags": ["pty"],
  3394. "operationId": "pty.get",
  3395. "parameters": [
  3396. {
  3397. "name": "ptyID",
  3398. "in": "path",
  3399. "schema": {
  3400. "type": "string",
  3401. "pattern": "^pty"
  3402. },
  3403. "required": true
  3404. },
  3405. {
  3406. "name": "directory",
  3407. "in": "query",
  3408. "schema": {
  3409. "type": "string"
  3410. },
  3411. "required": false
  3412. },
  3413. {
  3414. "name": "workspace",
  3415. "in": "query",
  3416. "schema": {
  3417. "type": "string"
  3418. },
  3419. "required": false
  3420. }
  3421. ],
  3422. "responses": {
  3423. "200": {
  3424. "description": "Session info",
  3425. "content": {
  3426. "application/json": {
  3427. "schema": {
  3428. "$ref": "#/components/schemas/Pty"
  3429. }
  3430. }
  3431. }
  3432. },
  3433. "404": {
  3434. "description": "NotFoundError",
  3435. "content": {
  3436. "application/json": {
  3437. "schema": {
  3438. "$ref": "#/components/schemas/NotFoundError"
  3439. }
  3440. }
  3441. }
  3442. }
  3443. },
  3444. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  3445. "summary": "Get PTY session",
  3446. "x-codeSamples": [
  3447. {
  3448. "lang": "js",
  3449. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  3450. }
  3451. ]
  3452. },
  3453. "put": {
  3454. "tags": ["pty"],
  3455. "operationId": "pty.update",
  3456. "parameters": [
  3457. {
  3458. "name": "ptyID",
  3459. "in": "path",
  3460. "schema": {
  3461. "type": "string",
  3462. "pattern": "^pty"
  3463. },
  3464. "required": true
  3465. },
  3466. {
  3467. "name": "directory",
  3468. "in": "query",
  3469. "schema": {
  3470. "type": "string"
  3471. },
  3472. "required": false
  3473. },
  3474. {
  3475. "name": "workspace",
  3476. "in": "query",
  3477. "schema": {
  3478. "type": "string"
  3479. },
  3480. "required": false
  3481. }
  3482. ],
  3483. "responses": {
  3484. "200": {
  3485. "description": "Updated session",
  3486. "content": {
  3487. "application/json": {
  3488. "schema": {
  3489. "$ref": "#/components/schemas/Pty"
  3490. }
  3491. }
  3492. }
  3493. },
  3494. "400": {
  3495. "description": "Bad request",
  3496. "content": {
  3497. "application/json": {
  3498. "schema": {
  3499. "$ref": "#/components/schemas/BadRequestError"
  3500. }
  3501. }
  3502. }
  3503. }
  3504. },
  3505. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  3506. "summary": "Update PTY session",
  3507. "requestBody": {
  3508. "content": {
  3509. "application/json": {
  3510. "schema": {
  3511. "type": "object",
  3512. "properties": {
  3513. "title": {
  3514. "type": "string"
  3515. },
  3516. "size": {
  3517. "type": "object",
  3518. "properties": {
  3519. "rows": {
  3520. "type": "integer",
  3521. "exclusiveMinimum": 0
  3522. },
  3523. "cols": {
  3524. "type": "integer",
  3525. "exclusiveMinimum": 0
  3526. }
  3527. },
  3528. "required": ["rows", "cols"],
  3529. "additionalProperties": false
  3530. }
  3531. },
  3532. "additionalProperties": false
  3533. }
  3534. }
  3535. }
  3536. },
  3537. "x-codeSamples": [
  3538. {
  3539. "lang": "js",
  3540. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  3541. }
  3542. ]
  3543. },
  3544. "delete": {
  3545. "tags": ["pty"],
  3546. "operationId": "pty.remove",
  3547. "parameters": [
  3548. {
  3549. "name": "ptyID",
  3550. "in": "path",
  3551. "schema": {
  3552. "type": "string",
  3553. "pattern": "^pty"
  3554. },
  3555. "required": true
  3556. },
  3557. {
  3558. "name": "directory",
  3559. "in": "query",
  3560. "schema": {
  3561. "type": "string"
  3562. },
  3563. "required": false
  3564. },
  3565. {
  3566. "name": "workspace",
  3567. "in": "query",
  3568. "schema": {
  3569. "type": "string"
  3570. },
  3571. "required": false
  3572. }
  3573. ],
  3574. "responses": {
  3575. "200": {
  3576. "description": "Session removed",
  3577. "content": {
  3578. "application/json": {
  3579. "schema": {
  3580. "type": "boolean",
  3581. "description": "Session removed"
  3582. }
  3583. }
  3584. }
  3585. },
  3586. "404": {
  3587. "description": "NotFoundError",
  3588. "content": {
  3589. "application/json": {
  3590. "schema": {
  3591. "$ref": "#/components/schemas/NotFoundError"
  3592. }
  3593. }
  3594. }
  3595. }
  3596. },
  3597. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  3598. "summary": "Remove PTY session",
  3599. "x-codeSamples": [
  3600. {
  3601. "lang": "js",
  3602. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  3603. }
  3604. ]
  3605. }
  3606. },
  3607. "/pty/{ptyID}/connect-token": {
  3608. "post": {
  3609. "tags": ["pty"],
  3610. "operationId": "pty.connectToken",
  3611. "parameters": [
  3612. {
  3613. "name": "ptyID",
  3614. "in": "path",
  3615. "schema": {
  3616. "type": "string",
  3617. "pattern": "^pty"
  3618. },
  3619. "required": true
  3620. },
  3621. {
  3622. "name": "directory",
  3623. "in": "query",
  3624. "schema": {
  3625. "type": "string"
  3626. },
  3627. "required": false
  3628. },
  3629. {
  3630. "name": "workspace",
  3631. "in": "query",
  3632. "schema": {
  3633. "type": "string"
  3634. },
  3635. "required": false
  3636. }
  3637. ],
  3638. "responses": {
  3639. "200": {
  3640. "description": "WebSocket connect token",
  3641. "content": {
  3642. "application/json": {
  3643. "schema": {
  3644. "type": "object",
  3645. "properties": {
  3646. "ticket": {
  3647. "type": "string"
  3648. },
  3649. "expires_in": {
  3650. "type": "integer",
  3651. "exclusiveMinimum": 0
  3652. }
  3653. },
  3654. "required": ["ticket", "expires_in"],
  3655. "additionalProperties": false,
  3656. "description": "WebSocket connect token"
  3657. }
  3658. }
  3659. }
  3660. },
  3661. "403": {
  3662. "description": "Forbidden",
  3663. "content": {
  3664. "application/json": {
  3665. "schema": {
  3666. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  3667. }
  3668. }
  3669. }
  3670. },
  3671. "404": {
  3672. "description": "NotFoundError",
  3673. "content": {
  3674. "application/json": {
  3675. "schema": {
  3676. "$ref": "#/components/schemas/NotFoundError"
  3677. }
  3678. }
  3679. }
  3680. }
  3681. },
  3682. "description": "Create a short-lived ticket for opening a PTY WebSocket connection.",
  3683. "summary": "Create PTY WebSocket token",
  3684. "x-codeSamples": [
  3685. {
  3686. "lang": "js",
  3687. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connectToken({\n ...\n})"
  3688. }
  3689. ]
  3690. }
  3691. },
  3692. "/question": {
  3693. "get": {
  3694. "tags": ["question"],
  3695. "operationId": "question.list",
  3696. "parameters": [
  3697. {
  3698. "name": "directory",
  3699. "in": "query",
  3700. "schema": {
  3701. "type": "string"
  3702. },
  3703. "required": false
  3704. },
  3705. {
  3706. "name": "workspace",
  3707. "in": "query",
  3708. "schema": {
  3709. "type": "string"
  3710. },
  3711. "required": false
  3712. }
  3713. ],
  3714. "responses": {
  3715. "200": {
  3716. "description": "List of pending questions",
  3717. "content": {
  3718. "application/json": {
  3719. "schema": {
  3720. "type": "array",
  3721. "items": {
  3722. "$ref": "#/components/schemas/QuestionRequest"
  3723. },
  3724. "description": "List of pending questions"
  3725. }
  3726. }
  3727. }
  3728. }
  3729. },
  3730. "description": "Get all pending question requests across all sessions.",
  3731. "summary": "List pending questions",
  3732. "x-codeSamples": [
  3733. {
  3734. "lang": "js",
  3735. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  3736. }
  3737. ]
  3738. }
  3739. },
  3740. "/question/{requestID}/reply": {
  3741. "post": {
  3742. "tags": ["question"],
  3743. "operationId": "question.reply",
  3744. "parameters": [
  3745. {
  3746. "name": "requestID",
  3747. "in": "path",
  3748. "schema": {
  3749. "type": "string",
  3750. "pattern": "^que"
  3751. },
  3752. "required": true
  3753. },
  3754. {
  3755. "name": "directory",
  3756. "in": "query",
  3757. "schema": {
  3758. "type": "string"
  3759. },
  3760. "required": false
  3761. },
  3762. {
  3763. "name": "workspace",
  3764. "in": "query",
  3765. "schema": {
  3766. "type": "string"
  3767. },
  3768. "required": false
  3769. }
  3770. ],
  3771. "responses": {
  3772. "200": {
  3773. "description": "Question answered successfully",
  3774. "content": {
  3775. "application/json": {
  3776. "schema": {
  3777. "type": "boolean",
  3778. "description": "Question answered successfully"
  3779. }
  3780. }
  3781. }
  3782. },
  3783. "400": {
  3784. "description": "Bad request",
  3785. "content": {
  3786. "application/json": {
  3787. "schema": {
  3788. "$ref": "#/components/schemas/BadRequestError"
  3789. }
  3790. }
  3791. }
  3792. },
  3793. "404": {
  3794. "description": "Not found",
  3795. "content": {
  3796. "application/json": {
  3797. "schema": {
  3798. "$ref": "#/components/schemas/NotFoundError"
  3799. }
  3800. }
  3801. }
  3802. }
  3803. },
  3804. "description": "Provide answers to a question request from the AI assistant.",
  3805. "summary": "Reply to question request",
  3806. "requestBody": {
  3807. "content": {
  3808. "application/json": {
  3809. "schema": {
  3810. "type": "object",
  3811. "properties": {
  3812. "answers": {
  3813. "type": "array",
  3814. "items": {
  3815. "$ref": "#/components/schemas/QuestionAnswer"
  3816. },
  3817. "description": "User answers in order of questions (each answer is an array of selected labels)"
  3818. }
  3819. },
  3820. "required": ["answers"],
  3821. "additionalProperties": false
  3822. }
  3823. }
  3824. }
  3825. },
  3826. "x-codeSamples": [
  3827. {
  3828. "lang": "js",
  3829. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  3830. }
  3831. ]
  3832. }
  3833. },
  3834. "/question/{requestID}/reject": {
  3835. "post": {
  3836. "tags": ["question"],
  3837. "operationId": "question.reject",
  3838. "parameters": [
  3839. {
  3840. "name": "requestID",
  3841. "in": "path",
  3842. "schema": {
  3843. "type": "string",
  3844. "pattern": "^que"
  3845. },
  3846. "required": true
  3847. },
  3848. {
  3849. "name": "directory",
  3850. "in": "query",
  3851. "schema": {
  3852. "type": "string"
  3853. },
  3854. "required": false
  3855. },
  3856. {
  3857. "name": "workspace",
  3858. "in": "query",
  3859. "schema": {
  3860. "type": "string"
  3861. },
  3862. "required": false
  3863. }
  3864. ],
  3865. "responses": {
  3866. "200": {
  3867. "description": "Question rejected successfully",
  3868. "content": {
  3869. "application/json": {
  3870. "schema": {
  3871. "type": "boolean",
  3872. "description": "Question rejected successfully"
  3873. }
  3874. }
  3875. }
  3876. },
  3877. "400": {
  3878. "description": "Bad request",
  3879. "content": {
  3880. "application/json": {
  3881. "schema": {
  3882. "$ref": "#/components/schemas/BadRequestError"
  3883. }
  3884. }
  3885. }
  3886. },
  3887. "404": {
  3888. "description": "Not found",
  3889. "content": {
  3890. "application/json": {
  3891. "schema": {
  3892. "$ref": "#/components/schemas/NotFoundError"
  3893. }
  3894. }
  3895. }
  3896. }
  3897. },
  3898. "description": "Reject a question request from the AI assistant.",
  3899. "summary": "Reject question request",
  3900. "x-codeSamples": [
  3901. {
  3902. "lang": "js",
  3903. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  3904. }
  3905. ]
  3906. }
  3907. },
  3908. "/permission": {
  3909. "get": {
  3910. "tags": ["permission"],
  3911. "operationId": "permission.list",
  3912. "parameters": [
  3913. {
  3914. "name": "directory",
  3915. "in": "query",
  3916. "schema": {
  3917. "type": "string"
  3918. },
  3919. "required": false
  3920. },
  3921. {
  3922. "name": "workspace",
  3923. "in": "query",
  3924. "schema": {
  3925. "type": "string"
  3926. },
  3927. "required": false
  3928. }
  3929. ],
  3930. "responses": {
  3931. "200": {
  3932. "description": "List of pending permissions",
  3933. "content": {
  3934. "application/json": {
  3935. "schema": {
  3936. "type": "array",
  3937. "items": {
  3938. "$ref": "#/components/schemas/PermissionRequest"
  3939. },
  3940. "description": "List of pending permissions"
  3941. }
  3942. }
  3943. }
  3944. }
  3945. },
  3946. "description": "Get all pending permission requests across all sessions.",
  3947. "summary": "List pending permissions",
  3948. "x-codeSamples": [
  3949. {
  3950. "lang": "js",
  3951. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  3952. }
  3953. ]
  3954. }
  3955. },
  3956. "/permission/{requestID}/reply": {
  3957. "post": {
  3958. "tags": ["permission"],
  3959. "operationId": "permission.reply",
  3960. "parameters": [
  3961. {
  3962. "name": "requestID",
  3963. "in": "path",
  3964. "schema": {
  3965. "type": "string",
  3966. "pattern": "^per"
  3967. },
  3968. "required": true
  3969. },
  3970. {
  3971. "name": "directory",
  3972. "in": "query",
  3973. "schema": {
  3974. "type": "string"
  3975. },
  3976. "required": false
  3977. },
  3978. {
  3979. "name": "workspace",
  3980. "in": "query",
  3981. "schema": {
  3982. "type": "string"
  3983. },
  3984. "required": false
  3985. }
  3986. ],
  3987. "responses": {
  3988. "200": {
  3989. "description": "Permission processed successfully",
  3990. "content": {
  3991. "application/json": {
  3992. "schema": {
  3993. "type": "boolean",
  3994. "description": "Permission processed successfully"
  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. "description": "Approve or deny a permission request from the AI assistant.",
  4021. "summary": "Respond to permission request",
  4022. "requestBody": {
  4023. "content": {
  4024. "application/json": {
  4025. "schema": {
  4026. "type": "object",
  4027. "properties": {
  4028. "reply": {
  4029. "type": "string",
  4030. "enum": ["once", "always", "reject"]
  4031. },
  4032. "message": {
  4033. "type": "string"
  4034. }
  4035. },
  4036. "required": ["reply"],
  4037. "additionalProperties": false
  4038. }
  4039. }
  4040. }
  4041. },
  4042. "x-codeSamples": [
  4043. {
  4044. "lang": "js",
  4045. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4046. }
  4047. ]
  4048. }
  4049. },
  4050. "/provider": {
  4051. "get": {
  4052. "tags": ["provider"],
  4053. "operationId": "provider.list",
  4054. "parameters": [
  4055. {
  4056. "name": "directory",
  4057. "in": "query",
  4058. "schema": {
  4059. "type": "string"
  4060. },
  4061. "required": false
  4062. },
  4063. {
  4064. "name": "workspace",
  4065. "in": "query",
  4066. "schema": {
  4067. "type": "string"
  4068. },
  4069. "required": false
  4070. }
  4071. ],
  4072. "responses": {
  4073. "200": {
  4074. "description": "List of providers",
  4075. "content": {
  4076. "application/json": {
  4077. "schema": {
  4078. "type": "object",
  4079. "properties": {
  4080. "all": {
  4081. "type": "array",
  4082. "items": {
  4083. "$ref": "#/components/schemas/Provider"
  4084. }
  4085. },
  4086. "default": {
  4087. "type": "object",
  4088. "additionalProperties": {
  4089. "type": "string"
  4090. }
  4091. },
  4092. "connected": {
  4093. "type": "array",
  4094. "items": {
  4095. "type": "string"
  4096. }
  4097. }
  4098. },
  4099. "required": ["all", "default", "connected"],
  4100. "additionalProperties": false,
  4101. "description": "List of providers"
  4102. }
  4103. }
  4104. }
  4105. }
  4106. },
  4107. "description": "Get a list of all available AI providers, including both available and connected ones.",
  4108. "summary": "List providers",
  4109. "x-codeSamples": [
  4110. {
  4111. "lang": "js",
  4112. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  4113. }
  4114. ]
  4115. }
  4116. },
  4117. "/provider/auth": {
  4118. "get": {
  4119. "tags": ["provider"],
  4120. "operationId": "provider.auth",
  4121. "parameters": [
  4122. {
  4123. "name": "directory",
  4124. "in": "query",
  4125. "schema": {
  4126. "type": "string"
  4127. },
  4128. "required": false
  4129. },
  4130. {
  4131. "name": "workspace",
  4132. "in": "query",
  4133. "schema": {
  4134. "type": "string"
  4135. },
  4136. "required": false
  4137. }
  4138. ],
  4139. "responses": {
  4140. "200": {
  4141. "description": "Provider auth methods",
  4142. "content": {
  4143. "application/json": {
  4144. "schema": {
  4145. "type": "object",
  4146. "additionalProperties": {
  4147. "type": "array",
  4148. "items": {
  4149. "$ref": "#/components/schemas/ProviderAuthMethod"
  4150. }
  4151. },
  4152. "description": "Provider auth methods"
  4153. }
  4154. }
  4155. }
  4156. }
  4157. },
  4158. "description": "Retrieve available authentication methods for all AI providers.",
  4159. "summary": "Get provider auth methods",
  4160. "x-codeSamples": [
  4161. {
  4162. "lang": "js",
  4163. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  4164. }
  4165. ]
  4166. }
  4167. },
  4168. "/provider/{providerID}/oauth/authorize": {
  4169. "post": {
  4170. "tags": ["provider"],
  4171. "operationId": "provider.oauth.authorize",
  4172. "parameters": [
  4173. {
  4174. "name": "providerID",
  4175. "in": "path",
  4176. "schema": {
  4177. "type": "string"
  4178. },
  4179. "required": true
  4180. },
  4181. {
  4182. "name": "directory",
  4183. "in": "query",
  4184. "schema": {
  4185. "type": "string"
  4186. },
  4187. "required": false
  4188. },
  4189. {
  4190. "name": "workspace",
  4191. "in": "query",
  4192. "schema": {
  4193. "type": "string"
  4194. },
  4195. "required": false
  4196. }
  4197. ],
  4198. "responses": {
  4199. "200": {
  4200. "description": "Authorization URL and method",
  4201. "content": {
  4202. "application/json": {
  4203. "schema": {
  4204. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  4205. }
  4206. }
  4207. }
  4208. },
  4209. "400": {
  4210. "description": "Bad request",
  4211. "content": {
  4212. "application/json": {
  4213. "schema": {
  4214. "$ref": "#/components/schemas/BadRequestError"
  4215. }
  4216. }
  4217. }
  4218. }
  4219. },
  4220. "description": "Start the OAuth authorization flow for a provider.",
  4221. "summary": "Start OAuth authorization",
  4222. "requestBody": {
  4223. "content": {
  4224. "application/json": {
  4225. "schema": {
  4226. "type": "object",
  4227. "properties": {
  4228. "method": {
  4229. "type": "number",
  4230. "description": "Auth method index"
  4231. },
  4232. "inputs": {
  4233. "type": "object",
  4234. "additionalProperties": {
  4235. "type": "string"
  4236. }
  4237. }
  4238. },
  4239. "required": ["method"],
  4240. "additionalProperties": false
  4241. }
  4242. }
  4243. }
  4244. },
  4245. "x-codeSamples": [
  4246. {
  4247. "lang": "js",
  4248. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  4249. }
  4250. ]
  4251. }
  4252. },
  4253. "/provider/{providerID}/oauth/callback": {
  4254. "post": {
  4255. "tags": ["provider"],
  4256. "operationId": "provider.oauth.callback",
  4257. "parameters": [
  4258. {
  4259. "name": "providerID",
  4260. "in": "path",
  4261. "schema": {
  4262. "type": "string"
  4263. },
  4264. "required": true
  4265. },
  4266. {
  4267. "name": "directory",
  4268. "in": "query",
  4269. "schema": {
  4270. "type": "string"
  4271. },
  4272. "required": false
  4273. },
  4274. {
  4275. "name": "workspace",
  4276. "in": "query",
  4277. "schema": {
  4278. "type": "string"
  4279. },
  4280. "required": false
  4281. }
  4282. ],
  4283. "responses": {
  4284. "200": {
  4285. "description": "OAuth callback processed successfully",
  4286. "content": {
  4287. "application/json": {
  4288. "schema": {
  4289. "type": "boolean",
  4290. "description": "OAuth callback processed successfully"
  4291. }
  4292. }
  4293. }
  4294. },
  4295. "400": {
  4296. "description": "Bad request",
  4297. "content": {
  4298. "application/json": {
  4299. "schema": {
  4300. "$ref": "#/components/schemas/BadRequestError"
  4301. }
  4302. }
  4303. }
  4304. }
  4305. },
  4306. "description": "Handle the OAuth callback from a provider after user authorization.",
  4307. "summary": "Handle OAuth callback",
  4308. "requestBody": {
  4309. "content": {
  4310. "application/json": {
  4311. "schema": {
  4312. "type": "object",
  4313. "properties": {
  4314. "method": {
  4315. "type": "number",
  4316. "description": "Auth method index"
  4317. },
  4318. "code": {
  4319. "type": "string"
  4320. }
  4321. },
  4322. "required": ["method"],
  4323. "additionalProperties": false
  4324. }
  4325. }
  4326. }
  4327. },
  4328. "x-codeSamples": [
  4329. {
  4330. "lang": "js",
  4331. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  4332. }
  4333. ]
  4334. }
  4335. },
  4336. "/session": {
  4337. "get": {
  4338. "tags": ["session"],
  4339. "operationId": "session.list",
  4340. "parameters": [
  4341. {
  4342. "name": "directory",
  4343. "in": "query",
  4344. "schema": {
  4345. "type": "string"
  4346. },
  4347. "required": false
  4348. },
  4349. {
  4350. "name": "workspace",
  4351. "in": "query",
  4352. "schema": {
  4353. "type": "string"
  4354. },
  4355. "required": false
  4356. },
  4357. {
  4358. "name": "scope",
  4359. "in": "query",
  4360. "schema": {
  4361. "type": "string",
  4362. "enum": ["project"]
  4363. },
  4364. "required": false
  4365. },
  4366. {
  4367. "name": "path",
  4368. "in": "query",
  4369. "schema": {
  4370. "type": "string"
  4371. },
  4372. "required": false
  4373. },
  4374. {
  4375. "name": "roots",
  4376. "in": "query",
  4377. "schema": {
  4378. "anyOf": [
  4379. {
  4380. "type": "boolean"
  4381. },
  4382. {
  4383. "type": "string",
  4384. "enum": ["true", "false"]
  4385. }
  4386. ]
  4387. },
  4388. "required": false
  4389. },
  4390. {
  4391. "name": "start",
  4392. "in": "query",
  4393. "schema": {
  4394. "type": "number"
  4395. },
  4396. "required": false
  4397. },
  4398. {
  4399. "name": "search",
  4400. "in": "query",
  4401. "schema": {
  4402. "type": "string"
  4403. },
  4404. "required": false
  4405. },
  4406. {
  4407. "name": "limit",
  4408. "in": "query",
  4409. "schema": {
  4410. "type": "number"
  4411. },
  4412. "required": false
  4413. }
  4414. ],
  4415. "responses": {
  4416. "200": {
  4417. "description": "List of sessions",
  4418. "content": {
  4419. "application/json": {
  4420. "schema": {
  4421. "type": "array",
  4422. "items": {
  4423. "$ref": "#/components/schemas/Session"
  4424. },
  4425. "description": "List of sessions"
  4426. }
  4427. }
  4428. }
  4429. }
  4430. },
  4431. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  4432. "summary": "List sessions",
  4433. "x-codeSamples": [
  4434. {
  4435. "lang": "js",
  4436. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  4437. }
  4438. ]
  4439. },
  4440. "post": {
  4441. "tags": ["session"],
  4442. "operationId": "session.create",
  4443. "parameters": [
  4444. {
  4445. "name": "directory",
  4446. "in": "query",
  4447. "schema": {
  4448. "type": "string"
  4449. },
  4450. "required": false
  4451. },
  4452. {
  4453. "name": "workspace",
  4454. "in": "query",
  4455. "schema": {
  4456. "type": "string"
  4457. },
  4458. "required": false
  4459. }
  4460. ],
  4461. "responses": {
  4462. "200": {
  4463. "description": "Successfully created session",
  4464. "content": {
  4465. "application/json": {
  4466. "schema": {
  4467. "$ref": "#/components/schemas/Session"
  4468. }
  4469. }
  4470. }
  4471. },
  4472. "400": {
  4473. "description": "Bad request",
  4474. "content": {
  4475. "application/json": {
  4476. "schema": {
  4477. "$ref": "#/components/schemas/BadRequestError"
  4478. }
  4479. }
  4480. }
  4481. }
  4482. },
  4483. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  4484. "summary": "Create session",
  4485. "requestBody": {
  4486. "content": {
  4487. "application/json": {
  4488. "schema": {
  4489. "type": "object",
  4490. "properties": {
  4491. "parentID": {
  4492. "type": "string",
  4493. "pattern": "^ses"
  4494. },
  4495. "title": {
  4496. "type": "string"
  4497. },
  4498. "agent": {
  4499. "type": "string"
  4500. },
  4501. "model": {
  4502. "type": "object",
  4503. "properties": {
  4504. "id": {
  4505. "type": "string"
  4506. },
  4507. "providerID": {
  4508. "type": "string"
  4509. },
  4510. "variant": {
  4511. "type": "string"
  4512. }
  4513. },
  4514. "required": ["id", "providerID"],
  4515. "additionalProperties": false
  4516. },
  4517. "permission": {
  4518. "$ref": "#/components/schemas/PermissionRuleset"
  4519. },
  4520. "workspaceID": {
  4521. "type": "string",
  4522. "pattern": "^wrk"
  4523. }
  4524. },
  4525. "additionalProperties": false
  4526. }
  4527. }
  4528. }
  4529. },
  4530. "x-codeSamples": [
  4531. {
  4532. "lang": "js",
  4533. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  4534. }
  4535. ]
  4536. }
  4537. },
  4538. "/session/status": {
  4539. "get": {
  4540. "tags": ["session"],
  4541. "operationId": "session.status",
  4542. "parameters": [
  4543. {
  4544. "name": "directory",
  4545. "in": "query",
  4546. "schema": {
  4547. "type": "string"
  4548. },
  4549. "required": false
  4550. },
  4551. {
  4552. "name": "workspace",
  4553. "in": "query",
  4554. "schema": {
  4555. "type": "string"
  4556. },
  4557. "required": false
  4558. }
  4559. ],
  4560. "responses": {
  4561. "200": {
  4562. "description": "Get session status",
  4563. "content": {
  4564. "application/json": {
  4565. "schema": {
  4566. "type": "object",
  4567. "additionalProperties": {
  4568. "$ref": "#/components/schemas/SessionStatus"
  4569. },
  4570. "description": "Get session status"
  4571. }
  4572. }
  4573. }
  4574. },
  4575. "400": {
  4576. "description": "Bad request",
  4577. "content": {
  4578. "application/json": {
  4579. "schema": {
  4580. "$ref": "#/components/schemas/BadRequestError"
  4581. }
  4582. }
  4583. }
  4584. }
  4585. },
  4586. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  4587. "summary": "Get session status",
  4588. "x-codeSamples": [
  4589. {
  4590. "lang": "js",
  4591. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  4592. }
  4593. ]
  4594. }
  4595. },
  4596. "/session/{sessionID}": {
  4597. "get": {
  4598. "tags": ["session"],
  4599. "operationId": "session.get",
  4600. "parameters": [
  4601. {
  4602. "name": "sessionID",
  4603. "in": "path",
  4604. "schema": {
  4605. "type": "string",
  4606. "pattern": "^ses"
  4607. },
  4608. "required": true
  4609. },
  4610. {
  4611. "name": "directory",
  4612. "in": "query",
  4613. "schema": {
  4614. "type": "string"
  4615. },
  4616. "required": false
  4617. },
  4618. {
  4619. "name": "workspace",
  4620. "in": "query",
  4621. "schema": {
  4622. "type": "string"
  4623. },
  4624. "required": false
  4625. }
  4626. ],
  4627. "responses": {
  4628. "200": {
  4629. "description": "Get session",
  4630. "content": {
  4631. "application/json": {
  4632. "schema": {
  4633. "$ref": "#/components/schemas/Session"
  4634. }
  4635. }
  4636. }
  4637. },
  4638. "400": {
  4639. "description": "Bad request",
  4640. "content": {
  4641. "application/json": {
  4642. "schema": {
  4643. "$ref": "#/components/schemas/BadRequestError"
  4644. }
  4645. }
  4646. }
  4647. },
  4648. "404": {
  4649. "description": "NotFoundError",
  4650. "content": {
  4651. "application/json": {
  4652. "schema": {
  4653. "$ref": "#/components/schemas/NotFoundError"
  4654. }
  4655. }
  4656. }
  4657. }
  4658. },
  4659. "description": "Retrieve detailed information about a specific OpenCode session.",
  4660. "summary": "Get session",
  4661. "x-codeSamples": [
  4662. {
  4663. "lang": "js",
  4664. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  4665. }
  4666. ]
  4667. },
  4668. "delete": {
  4669. "tags": ["session"],
  4670. "operationId": "session.delete",
  4671. "parameters": [
  4672. {
  4673. "name": "sessionID",
  4674. "in": "path",
  4675. "schema": {
  4676. "type": "string",
  4677. "pattern": "^ses"
  4678. },
  4679. "required": true
  4680. },
  4681. {
  4682. "name": "directory",
  4683. "in": "query",
  4684. "schema": {
  4685. "type": "string"
  4686. },
  4687. "required": false
  4688. },
  4689. {
  4690. "name": "workspace",
  4691. "in": "query",
  4692. "schema": {
  4693. "type": "string"
  4694. },
  4695. "required": false
  4696. }
  4697. ],
  4698. "responses": {
  4699. "200": {
  4700. "description": "Successfully deleted session",
  4701. "content": {
  4702. "application/json": {
  4703. "schema": {
  4704. "type": "boolean",
  4705. "description": "Successfully deleted session"
  4706. }
  4707. }
  4708. }
  4709. },
  4710. "400": {
  4711. "description": "Bad request",
  4712. "content": {
  4713. "application/json": {
  4714. "schema": {
  4715. "$ref": "#/components/schemas/BadRequestError"
  4716. }
  4717. }
  4718. }
  4719. },
  4720. "404": {
  4721. "description": "NotFoundError",
  4722. "content": {
  4723. "application/json": {
  4724. "schema": {
  4725. "$ref": "#/components/schemas/NotFoundError"
  4726. }
  4727. }
  4728. }
  4729. }
  4730. },
  4731. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  4732. "summary": "Delete session",
  4733. "x-codeSamples": [
  4734. {
  4735. "lang": "js",
  4736. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  4737. }
  4738. ]
  4739. },
  4740. "patch": {
  4741. "tags": ["session"],
  4742. "operationId": "session.update",
  4743. "parameters": [
  4744. {
  4745. "name": "sessionID",
  4746. "in": "path",
  4747. "schema": {
  4748. "type": "string",
  4749. "pattern": "^ses"
  4750. },
  4751. "required": true
  4752. },
  4753. {
  4754. "name": "directory",
  4755. "in": "query",
  4756. "schema": {
  4757. "type": "string"
  4758. },
  4759. "required": false
  4760. },
  4761. {
  4762. "name": "workspace",
  4763. "in": "query",
  4764. "schema": {
  4765. "type": "string"
  4766. },
  4767. "required": false
  4768. }
  4769. ],
  4770. "responses": {
  4771. "200": {
  4772. "description": "Successfully updated session",
  4773. "content": {
  4774. "application/json": {
  4775. "schema": {
  4776. "$ref": "#/components/schemas/Session"
  4777. }
  4778. }
  4779. }
  4780. },
  4781. "400": {
  4782. "description": "Bad request",
  4783. "content": {
  4784. "application/json": {
  4785. "schema": {
  4786. "$ref": "#/components/schemas/BadRequestError"
  4787. }
  4788. }
  4789. }
  4790. },
  4791. "404": {
  4792. "description": "NotFoundError",
  4793. "content": {
  4794. "application/json": {
  4795. "schema": {
  4796. "$ref": "#/components/schemas/NotFoundError"
  4797. }
  4798. }
  4799. }
  4800. }
  4801. },
  4802. "description": "Update properties of an existing session, such as title or other metadata.",
  4803. "summary": "Update session",
  4804. "requestBody": {
  4805. "content": {
  4806. "application/json": {
  4807. "schema": {
  4808. "type": "object",
  4809. "properties": {
  4810. "title": {
  4811. "type": "string"
  4812. },
  4813. "permission": {
  4814. "$ref": "#/components/schemas/PermissionRuleset"
  4815. },
  4816. "time": {
  4817. "type": "object",
  4818. "properties": {
  4819. "archived": {
  4820. "type": "number"
  4821. }
  4822. },
  4823. "additionalProperties": false
  4824. }
  4825. },
  4826. "additionalProperties": false
  4827. }
  4828. }
  4829. }
  4830. },
  4831. "x-codeSamples": [
  4832. {
  4833. "lang": "js",
  4834. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  4835. }
  4836. ]
  4837. }
  4838. },
  4839. "/session/{sessionID}/children": {
  4840. "get": {
  4841. "tags": ["session"],
  4842. "operationId": "session.children",
  4843. "parameters": [
  4844. {
  4845. "name": "sessionID",
  4846. "in": "path",
  4847. "schema": {
  4848. "type": "string",
  4849. "pattern": "^ses"
  4850. },
  4851. "required": true
  4852. },
  4853. {
  4854. "name": "directory",
  4855. "in": "query",
  4856. "schema": {
  4857. "type": "string"
  4858. },
  4859. "required": false
  4860. },
  4861. {
  4862. "name": "workspace",
  4863. "in": "query",
  4864. "schema": {
  4865. "type": "string"
  4866. },
  4867. "required": false
  4868. }
  4869. ],
  4870. "responses": {
  4871. "200": {
  4872. "description": "List of children",
  4873. "content": {
  4874. "application/json": {
  4875. "schema": {
  4876. "type": "array",
  4877. "items": {
  4878. "$ref": "#/components/schemas/Session"
  4879. },
  4880. "description": "List of children"
  4881. }
  4882. }
  4883. }
  4884. },
  4885. "400": {
  4886. "description": "Bad request",
  4887. "content": {
  4888. "application/json": {
  4889. "schema": {
  4890. "$ref": "#/components/schemas/BadRequestError"
  4891. }
  4892. }
  4893. }
  4894. },
  4895. "404": {
  4896. "description": "Not found",
  4897. "content": {
  4898. "application/json": {
  4899. "schema": {
  4900. "$ref": "#/components/schemas/NotFoundError"
  4901. }
  4902. }
  4903. }
  4904. }
  4905. },
  4906. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  4907. "summary": "Get session children",
  4908. "x-codeSamples": [
  4909. {
  4910. "lang": "js",
  4911. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  4912. }
  4913. ]
  4914. }
  4915. },
  4916. "/session/{sessionID}/todo": {
  4917. "get": {
  4918. "tags": ["session"],
  4919. "operationId": "session.todo",
  4920. "parameters": [
  4921. {
  4922. "name": "sessionID",
  4923. "in": "path",
  4924. "schema": {
  4925. "type": "string",
  4926. "pattern": "^ses"
  4927. },
  4928. "required": true
  4929. },
  4930. {
  4931. "name": "directory",
  4932. "in": "query",
  4933. "schema": {
  4934. "type": "string"
  4935. },
  4936. "required": false
  4937. },
  4938. {
  4939. "name": "workspace",
  4940. "in": "query",
  4941. "schema": {
  4942. "type": "string"
  4943. },
  4944. "required": false
  4945. }
  4946. ],
  4947. "responses": {
  4948. "200": {
  4949. "description": "Todo list",
  4950. "content": {
  4951. "application/json": {
  4952. "schema": {
  4953. "type": "array",
  4954. "items": {
  4955. "$ref": "#/components/schemas/Todo"
  4956. },
  4957. "description": "Todo list"
  4958. }
  4959. }
  4960. }
  4961. },
  4962. "400": {
  4963. "description": "Bad request",
  4964. "content": {
  4965. "application/json": {
  4966. "schema": {
  4967. "$ref": "#/components/schemas/BadRequestError"
  4968. }
  4969. }
  4970. }
  4971. },
  4972. "404": {
  4973. "description": "Not found",
  4974. "content": {
  4975. "application/json": {
  4976. "schema": {
  4977. "$ref": "#/components/schemas/NotFoundError"
  4978. }
  4979. }
  4980. }
  4981. }
  4982. },
  4983. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  4984. "summary": "Get session todos",
  4985. "x-codeSamples": [
  4986. {
  4987. "lang": "js",
  4988. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  4989. }
  4990. ]
  4991. }
  4992. },
  4993. "/session/{sessionID}/diff": {
  4994. "get": {
  4995. "tags": ["session"],
  4996. "operationId": "session.diff",
  4997. "parameters": [
  4998. {
  4999. "name": "sessionID",
  5000. "in": "path",
  5001. "schema": {
  5002. "type": "string",
  5003. "pattern": "^ses"
  5004. },
  5005. "required": true
  5006. },
  5007. {
  5008. "name": "directory",
  5009. "in": "query",
  5010. "schema": {
  5011. "type": "string"
  5012. },
  5013. "required": false
  5014. },
  5015. {
  5016. "name": "workspace",
  5017. "in": "query",
  5018. "schema": {
  5019. "type": "string"
  5020. },
  5021. "required": false
  5022. },
  5023. {
  5024. "name": "messageID",
  5025. "in": "query",
  5026. "schema": {
  5027. "type": "string",
  5028. "pattern": "^msg.*"
  5029. },
  5030. "required": false
  5031. }
  5032. ],
  5033. "responses": {
  5034. "200": {
  5035. "description": "Successfully retrieved diff",
  5036. "content": {
  5037. "application/json": {
  5038. "schema": {
  5039. "type": "array",
  5040. "items": {
  5041. "$ref": "#/components/schemas/SnapshotFileDiff"
  5042. },
  5043. "description": "Successfully retrieved diff"
  5044. }
  5045. }
  5046. }
  5047. }
  5048. },
  5049. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  5050. "summary": "Get message diff",
  5051. "x-codeSamples": [
  5052. {
  5053. "lang": "js",
  5054. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  5055. }
  5056. ]
  5057. }
  5058. },
  5059. "/session/{sessionID}/message": {
  5060. "get": {
  5061. "tags": ["session"],
  5062. "operationId": "session.messages",
  5063. "parameters": [
  5064. {
  5065. "name": "sessionID",
  5066. "in": "path",
  5067. "schema": {
  5068. "type": "string",
  5069. "pattern": "^ses"
  5070. },
  5071. "required": true
  5072. },
  5073. {
  5074. "name": "directory",
  5075. "in": "query",
  5076. "schema": {
  5077. "type": "string"
  5078. },
  5079. "required": false
  5080. },
  5081. {
  5082. "name": "workspace",
  5083. "in": "query",
  5084. "schema": {
  5085. "type": "string"
  5086. },
  5087. "required": false
  5088. },
  5089. {
  5090. "name": "limit",
  5091. "in": "query",
  5092. "schema": {
  5093. "type": "integer",
  5094. "minimum": 0,
  5095. "maximum": 9007199254740991
  5096. },
  5097. "required": false
  5098. },
  5099. {
  5100. "name": "before",
  5101. "in": "query",
  5102. "schema": {
  5103. "type": "string"
  5104. },
  5105. "required": false
  5106. }
  5107. ],
  5108. "responses": {
  5109. "200": {
  5110. "description": "List of messages",
  5111. "content": {
  5112. "application/json": {
  5113. "schema": {
  5114. "type": "array",
  5115. "items": {
  5116. "type": "object",
  5117. "properties": {
  5118. "info": {
  5119. "$ref": "#/components/schemas/Message"
  5120. },
  5121. "parts": {
  5122. "type": "array",
  5123. "items": {
  5124. "$ref": "#/components/schemas/Part"
  5125. }
  5126. }
  5127. },
  5128. "required": ["info", "parts"],
  5129. "additionalProperties": false
  5130. },
  5131. "description": "List of messages"
  5132. }
  5133. }
  5134. }
  5135. },
  5136. "400": {
  5137. "description": "Bad request",
  5138. "content": {
  5139. "application/json": {
  5140. "schema": {
  5141. "$ref": "#/components/schemas/BadRequestError"
  5142. }
  5143. }
  5144. }
  5145. },
  5146. "404": {
  5147. "description": "NotFoundError",
  5148. "content": {
  5149. "application/json": {
  5150. "schema": {
  5151. "$ref": "#/components/schemas/NotFoundError"
  5152. }
  5153. }
  5154. }
  5155. }
  5156. },
  5157. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  5158. "summary": "Get session messages",
  5159. "x-codeSamples": [
  5160. {
  5161. "lang": "js",
  5162. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  5163. }
  5164. ]
  5165. },
  5166. "post": {
  5167. "tags": ["session"],
  5168. "operationId": "session.prompt",
  5169. "parameters": [
  5170. {
  5171. "name": "sessionID",
  5172. "in": "path",
  5173. "schema": {
  5174. "type": "string",
  5175. "pattern": "^ses"
  5176. },
  5177. "required": true
  5178. },
  5179. {
  5180. "name": "directory",
  5181. "in": "query",
  5182. "schema": {
  5183. "type": "string"
  5184. },
  5185. "required": false
  5186. },
  5187. {
  5188. "name": "workspace",
  5189. "in": "query",
  5190. "schema": {
  5191. "type": "string"
  5192. },
  5193. "required": false
  5194. }
  5195. ],
  5196. "responses": {
  5197. "200": {
  5198. "description": "Created message",
  5199. "content": {
  5200. "application/json": {
  5201. "schema": {
  5202. "type": "object",
  5203. "required": ["info", "parts"],
  5204. "properties": {
  5205. "info": {
  5206. "$ref": "#/components/schemas/AssistantMessage"
  5207. },
  5208. "parts": {
  5209. "type": "array",
  5210. "items": {
  5211. "$ref": "#/components/schemas/Part"
  5212. }
  5213. }
  5214. }
  5215. }
  5216. }
  5217. }
  5218. },
  5219. "400": {
  5220. "description": "Bad request",
  5221. "content": {
  5222. "application/json": {
  5223. "schema": {
  5224. "$ref": "#/components/schemas/BadRequestError"
  5225. }
  5226. }
  5227. }
  5228. },
  5229. "404": {
  5230. "description": "Not found",
  5231. "content": {
  5232. "application/json": {
  5233. "schema": {
  5234. "$ref": "#/components/schemas/NotFoundError"
  5235. }
  5236. }
  5237. }
  5238. }
  5239. },
  5240. "description": "Create and send a new message to a session, streaming the AI response.",
  5241. "summary": "Send message",
  5242. "requestBody": {
  5243. "content": {
  5244. "application/json": {
  5245. "schema": {
  5246. "type": "object",
  5247. "properties": {
  5248. "messageID": {
  5249. "type": "string",
  5250. "pattern": "^msg"
  5251. },
  5252. "model": {
  5253. "type": "object",
  5254. "properties": {
  5255. "providerID": {
  5256. "type": "string"
  5257. },
  5258. "modelID": {
  5259. "type": "string"
  5260. }
  5261. },
  5262. "required": ["providerID", "modelID"],
  5263. "additionalProperties": false
  5264. },
  5265. "agent": {
  5266. "type": "string"
  5267. },
  5268. "noReply": {
  5269. "type": "boolean"
  5270. },
  5271. "tools": {
  5272. "type": "object",
  5273. "additionalProperties": {
  5274. "type": "boolean"
  5275. }
  5276. },
  5277. "format": {
  5278. "$ref": "#/components/schemas/OutputFormat"
  5279. },
  5280. "system": {
  5281. "type": "string"
  5282. },
  5283. "variant": {
  5284. "type": "string"
  5285. },
  5286. "parts": {
  5287. "type": "array",
  5288. "items": {
  5289. "anyOf": [
  5290. {
  5291. "$ref": "#/components/schemas/TextPartInput"
  5292. },
  5293. {
  5294. "$ref": "#/components/schemas/FilePartInput"
  5295. },
  5296. {
  5297. "$ref": "#/components/schemas/AgentPartInput"
  5298. },
  5299. {
  5300. "$ref": "#/components/schemas/SubtaskPartInput"
  5301. }
  5302. ]
  5303. }
  5304. }
  5305. },
  5306. "required": ["parts"],
  5307. "additionalProperties": false
  5308. }
  5309. }
  5310. }
  5311. },
  5312. "x-codeSamples": [
  5313. {
  5314. "lang": "js",
  5315. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  5316. }
  5317. ]
  5318. }
  5319. },
  5320. "/session/{sessionID}/message/{messageID}": {
  5321. "get": {
  5322. "tags": ["session"],
  5323. "operationId": "session.message",
  5324. "parameters": [
  5325. {
  5326. "name": "sessionID",
  5327. "in": "path",
  5328. "schema": {
  5329. "type": "string",
  5330. "pattern": "^ses"
  5331. },
  5332. "required": true
  5333. },
  5334. {
  5335. "name": "messageID",
  5336. "in": "path",
  5337. "schema": {
  5338. "type": "string",
  5339. "pattern": "^msg"
  5340. },
  5341. "required": true
  5342. },
  5343. {
  5344. "name": "directory",
  5345. "in": "query",
  5346. "schema": {
  5347. "type": "string"
  5348. },
  5349. "required": false
  5350. },
  5351. {
  5352. "name": "workspace",
  5353. "in": "query",
  5354. "schema": {
  5355. "type": "string"
  5356. },
  5357. "required": false
  5358. }
  5359. ],
  5360. "responses": {
  5361. "200": {
  5362. "description": "Message",
  5363. "content": {
  5364. "application/json": {
  5365. "schema": {
  5366. "type": "object",
  5367. "properties": {
  5368. "info": {
  5369. "$ref": "#/components/schemas/Message"
  5370. },
  5371. "parts": {
  5372. "type": "array",
  5373. "items": {
  5374. "$ref": "#/components/schemas/Part"
  5375. }
  5376. }
  5377. },
  5378. "required": ["info", "parts"],
  5379. "additionalProperties": false,
  5380. "description": "Message"
  5381. }
  5382. }
  5383. }
  5384. },
  5385. "400": {
  5386. "description": "Bad request",
  5387. "content": {
  5388. "application/json": {
  5389. "schema": {
  5390. "$ref": "#/components/schemas/BadRequestError"
  5391. }
  5392. }
  5393. }
  5394. },
  5395. "404": {
  5396. "description": "NotFoundError",
  5397. "content": {
  5398. "application/json": {
  5399. "schema": {
  5400. "$ref": "#/components/schemas/NotFoundError"
  5401. }
  5402. }
  5403. }
  5404. }
  5405. },
  5406. "description": "Retrieve a specific message from a session by its message ID.",
  5407. "summary": "Get message",
  5408. "x-codeSamples": [
  5409. {
  5410. "lang": "js",
  5411. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  5412. }
  5413. ]
  5414. },
  5415. "delete": {
  5416. "tags": ["session"],
  5417. "operationId": "session.deleteMessage",
  5418. "parameters": [
  5419. {
  5420. "name": "sessionID",
  5421. "in": "path",
  5422. "schema": {
  5423. "type": "string",
  5424. "pattern": "^ses"
  5425. },
  5426. "required": true
  5427. },
  5428. {
  5429. "name": "messageID",
  5430. "in": "path",
  5431. "schema": {
  5432. "type": "string",
  5433. "pattern": "^msg"
  5434. },
  5435. "required": true
  5436. },
  5437. {
  5438. "name": "directory",
  5439. "in": "query",
  5440. "schema": {
  5441. "type": "string"
  5442. },
  5443. "required": false
  5444. },
  5445. {
  5446. "name": "workspace",
  5447. "in": "query",
  5448. "schema": {
  5449. "type": "string"
  5450. },
  5451. "required": false
  5452. }
  5453. ],
  5454. "responses": {
  5455. "200": {
  5456. "description": "Successfully deleted message",
  5457. "content": {
  5458. "application/json": {
  5459. "schema": {
  5460. "type": "boolean",
  5461. "description": "Successfully deleted message"
  5462. }
  5463. }
  5464. }
  5465. },
  5466. "400": {
  5467. "description": "Bad request",
  5468. "content": {
  5469. "application/json": {
  5470. "schema": {
  5471. "$ref": "#/components/schemas/BadRequestError"
  5472. }
  5473. }
  5474. }
  5475. },
  5476. "404": {
  5477. "description": "Not found",
  5478. "content": {
  5479. "application/json": {
  5480. "schema": {
  5481. "$ref": "#/components/schemas/NotFoundError"
  5482. }
  5483. }
  5484. }
  5485. }
  5486. },
  5487. "description": "Permanently delete a specific message and all of its parts from a session without reverting file changes.",
  5488. "summary": "Delete message",
  5489. "x-codeSamples": [
  5490. {
  5491. "lang": "js",
  5492. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  5493. }
  5494. ]
  5495. }
  5496. },
  5497. "/session/{sessionID}/fork": {
  5498. "post": {
  5499. "tags": ["session"],
  5500. "operationId": "session.fork",
  5501. "parameters": [
  5502. {
  5503. "name": "sessionID",
  5504. "in": "path",
  5505. "schema": {
  5506. "type": "string",
  5507. "pattern": "^ses"
  5508. },
  5509. "required": true
  5510. },
  5511. {
  5512. "name": "directory",
  5513. "in": "query",
  5514. "schema": {
  5515. "type": "string"
  5516. },
  5517. "required": false
  5518. },
  5519. {
  5520. "name": "workspace",
  5521. "in": "query",
  5522. "schema": {
  5523. "type": "string"
  5524. },
  5525. "required": false
  5526. }
  5527. ],
  5528. "responses": {
  5529. "200": {
  5530. "description": "200",
  5531. "content": {
  5532. "application/json": {
  5533. "schema": {
  5534. "$ref": "#/components/schemas/Session"
  5535. }
  5536. }
  5537. }
  5538. },
  5539. "404": {
  5540. "description": "NotFoundError",
  5541. "content": {
  5542. "application/json": {
  5543. "schema": {
  5544. "$ref": "#/components/schemas/NotFoundError"
  5545. }
  5546. }
  5547. }
  5548. }
  5549. },
  5550. "description": "Create a new session by forking an existing session at a specific message point.",
  5551. "summary": "Fork session",
  5552. "requestBody": {
  5553. "content": {
  5554. "application/json": {
  5555. "schema": {
  5556. "type": "object",
  5557. "properties": {
  5558. "messageID": {
  5559. "type": "string",
  5560. "pattern": "^msg"
  5561. }
  5562. },
  5563. "additionalProperties": false
  5564. }
  5565. }
  5566. }
  5567. },
  5568. "x-codeSamples": [
  5569. {
  5570. "lang": "js",
  5571. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  5572. }
  5573. ]
  5574. }
  5575. },
  5576. "/session/{sessionID}/abort": {
  5577. "post": {
  5578. "tags": ["session"],
  5579. "operationId": "session.abort",
  5580. "parameters": [
  5581. {
  5582. "name": "sessionID",
  5583. "in": "path",
  5584. "schema": {
  5585. "type": "string",
  5586. "pattern": "^ses"
  5587. },
  5588. "required": true
  5589. },
  5590. {
  5591. "name": "directory",
  5592. "in": "query",
  5593. "schema": {
  5594. "type": "string"
  5595. },
  5596. "required": false
  5597. },
  5598. {
  5599. "name": "workspace",
  5600. "in": "query",
  5601. "schema": {
  5602. "type": "string"
  5603. },
  5604. "required": false
  5605. }
  5606. ],
  5607. "responses": {
  5608. "200": {
  5609. "description": "Aborted session",
  5610. "content": {
  5611. "application/json": {
  5612. "schema": {
  5613. "type": "boolean",
  5614. "description": "Aborted session"
  5615. }
  5616. }
  5617. }
  5618. },
  5619. "400": {
  5620. "description": "Bad request",
  5621. "content": {
  5622. "application/json": {
  5623. "schema": {
  5624. "$ref": "#/components/schemas/BadRequestError"
  5625. }
  5626. }
  5627. }
  5628. },
  5629. "404": {
  5630. "description": "Not found",
  5631. "content": {
  5632. "application/json": {
  5633. "schema": {
  5634. "$ref": "#/components/schemas/NotFoundError"
  5635. }
  5636. }
  5637. }
  5638. }
  5639. },
  5640. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  5641. "summary": "Abort session",
  5642. "x-codeSamples": [
  5643. {
  5644. "lang": "js",
  5645. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  5646. }
  5647. ]
  5648. }
  5649. },
  5650. "/session/{sessionID}/init": {
  5651. "post": {
  5652. "tags": ["session"],
  5653. "operationId": "session.init",
  5654. "parameters": [
  5655. {
  5656. "name": "sessionID",
  5657. "in": "path",
  5658. "schema": {
  5659. "type": "string",
  5660. "pattern": "^ses"
  5661. },
  5662. "required": true
  5663. },
  5664. {
  5665. "name": "directory",
  5666. "in": "query",
  5667. "schema": {
  5668. "type": "string"
  5669. },
  5670. "required": false
  5671. },
  5672. {
  5673. "name": "workspace",
  5674. "in": "query",
  5675. "schema": {
  5676. "type": "string"
  5677. },
  5678. "required": false
  5679. }
  5680. ],
  5681. "responses": {
  5682. "200": {
  5683. "description": "200",
  5684. "content": {
  5685. "application/json": {
  5686. "schema": {
  5687. "type": "boolean",
  5688. "description": "200"
  5689. }
  5690. }
  5691. }
  5692. },
  5693. "400": {
  5694. "description": "Bad request",
  5695. "content": {
  5696. "application/json": {
  5697. "schema": {
  5698. "$ref": "#/components/schemas/BadRequestError"
  5699. }
  5700. }
  5701. }
  5702. },
  5703. "404": {
  5704. "description": "Not found",
  5705. "content": {
  5706. "application/json": {
  5707. "schema": {
  5708. "$ref": "#/components/schemas/NotFoundError"
  5709. }
  5710. }
  5711. }
  5712. }
  5713. },
  5714. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  5715. "summary": "Initialize session",
  5716. "requestBody": {
  5717. "content": {
  5718. "application/json": {
  5719. "schema": {
  5720. "type": "object",
  5721. "properties": {
  5722. "modelID": {
  5723. "type": "string"
  5724. },
  5725. "providerID": {
  5726. "type": "string"
  5727. },
  5728. "messageID": {
  5729. "type": "string",
  5730. "pattern": "^msg"
  5731. }
  5732. },
  5733. "required": ["modelID", "providerID", "messageID"],
  5734. "additionalProperties": false
  5735. }
  5736. }
  5737. }
  5738. },
  5739. "x-codeSamples": [
  5740. {
  5741. "lang": "js",
  5742. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  5743. }
  5744. ]
  5745. }
  5746. },
  5747. "/session/{sessionID}/share": {
  5748. "post": {
  5749. "tags": ["session"],
  5750. "operationId": "session.share",
  5751. "parameters": [
  5752. {
  5753. "name": "sessionID",
  5754. "in": "path",
  5755. "schema": {
  5756. "type": "string",
  5757. "pattern": "^ses"
  5758. },
  5759. "required": true
  5760. },
  5761. {
  5762. "name": "directory",
  5763. "in": "query",
  5764. "schema": {
  5765. "type": "string"
  5766. },
  5767. "required": false
  5768. },
  5769. {
  5770. "name": "workspace",
  5771. "in": "query",
  5772. "schema": {
  5773. "type": "string"
  5774. },
  5775. "required": false
  5776. }
  5777. ],
  5778. "responses": {
  5779. "200": {
  5780. "description": "Successfully shared session",
  5781. "content": {
  5782. "application/json": {
  5783. "schema": {
  5784. "$ref": "#/components/schemas/Session"
  5785. }
  5786. }
  5787. }
  5788. },
  5789. "404": {
  5790. "description": "NotFoundError",
  5791. "content": {
  5792. "application/json": {
  5793. "schema": {
  5794. "$ref": "#/components/schemas/NotFoundError"
  5795. }
  5796. }
  5797. }
  5798. },
  5799. "500": {
  5800. "description": "InternalServerError",
  5801. "content": {
  5802. "application/json": {
  5803. "schema": {
  5804. "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
  5805. }
  5806. }
  5807. }
  5808. }
  5809. },
  5810. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  5811. "summary": "Share session",
  5812. "x-codeSamples": [
  5813. {
  5814. "lang": "js",
  5815. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  5816. }
  5817. ]
  5818. },
  5819. "delete": {
  5820. "tags": ["session"],
  5821. "operationId": "session.unshare",
  5822. "parameters": [
  5823. {
  5824. "name": "sessionID",
  5825. "in": "path",
  5826. "schema": {
  5827. "type": "string",
  5828. "pattern": "^ses"
  5829. },
  5830. "required": true
  5831. },
  5832. {
  5833. "name": "directory",
  5834. "in": "query",
  5835. "schema": {
  5836. "type": "string"
  5837. },
  5838. "required": false
  5839. },
  5840. {
  5841. "name": "workspace",
  5842. "in": "query",
  5843. "schema": {
  5844. "type": "string"
  5845. },
  5846. "required": false
  5847. }
  5848. ],
  5849. "responses": {
  5850. "200": {
  5851. "description": "Successfully unshared session",
  5852. "content": {
  5853. "application/json": {
  5854. "schema": {
  5855. "$ref": "#/components/schemas/Session"
  5856. }
  5857. }
  5858. }
  5859. },
  5860. "404": {
  5861. "description": "NotFoundError",
  5862. "content": {
  5863. "application/json": {
  5864. "schema": {
  5865. "$ref": "#/components/schemas/NotFoundError"
  5866. }
  5867. }
  5868. }
  5869. },
  5870. "500": {
  5871. "description": "InternalServerError",
  5872. "content": {
  5873. "application/json": {
  5874. "schema": {
  5875. "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
  5876. }
  5877. }
  5878. }
  5879. }
  5880. },
  5881. "description": "Remove the shareable link for a session, making it private again.",
  5882. "summary": "Unshare session",
  5883. "x-codeSamples": [
  5884. {
  5885. "lang": "js",
  5886. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  5887. }
  5888. ]
  5889. }
  5890. },
  5891. "/session/{sessionID}/summarize": {
  5892. "post": {
  5893. "tags": ["session"],
  5894. "operationId": "session.summarize",
  5895. "parameters": [
  5896. {
  5897. "name": "sessionID",
  5898. "in": "path",
  5899. "schema": {
  5900. "type": "string",
  5901. "pattern": "^ses"
  5902. },
  5903. "required": true
  5904. },
  5905. {
  5906. "name": "directory",
  5907. "in": "query",
  5908. "schema": {
  5909. "type": "string"
  5910. },
  5911. "required": false
  5912. },
  5913. {
  5914. "name": "workspace",
  5915. "in": "query",
  5916. "schema": {
  5917. "type": "string"
  5918. },
  5919. "required": false
  5920. }
  5921. ],
  5922. "responses": {
  5923. "200": {
  5924. "description": "Summarized session",
  5925. "content": {
  5926. "application/json": {
  5927. "schema": {
  5928. "type": "boolean",
  5929. "description": "Summarized session"
  5930. }
  5931. }
  5932. }
  5933. },
  5934. "400": {
  5935. "description": "Bad request",
  5936. "content": {
  5937. "application/json": {
  5938. "schema": {
  5939. "$ref": "#/components/schemas/BadRequestError"
  5940. }
  5941. }
  5942. }
  5943. },
  5944. "404": {
  5945. "description": "NotFoundError",
  5946. "content": {
  5947. "application/json": {
  5948. "schema": {
  5949. "$ref": "#/components/schemas/NotFoundError"
  5950. }
  5951. }
  5952. }
  5953. }
  5954. },
  5955. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  5956. "summary": "Summarize session",
  5957. "requestBody": {
  5958. "content": {
  5959. "application/json": {
  5960. "schema": {
  5961. "type": "object",
  5962. "properties": {
  5963. "providerID": {
  5964. "type": "string"
  5965. },
  5966. "modelID": {
  5967. "type": "string"
  5968. },
  5969. "auto": {
  5970. "type": "boolean"
  5971. }
  5972. },
  5973. "required": ["providerID", "modelID"],
  5974. "additionalProperties": false
  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.session.summarize({\n ...\n})"
  5983. }
  5984. ]
  5985. }
  5986. },
  5987. "/session/{sessionID}/prompt_async": {
  5988. "post": {
  5989. "tags": ["session"],
  5990. "operationId": "session.prompt_async",
  5991. "parameters": [
  5992. {
  5993. "name": "sessionID",
  5994. "in": "path",
  5995. "schema": {
  5996. "type": "string",
  5997. "pattern": "^ses"
  5998. },
  5999. "required": true
  6000. },
  6001. {
  6002. "name": "directory",
  6003. "in": "query",
  6004. "schema": {
  6005. "type": "string"
  6006. },
  6007. "required": false
  6008. },
  6009. {
  6010. "name": "workspace",
  6011. "in": "query",
  6012. "schema": {
  6013. "type": "string"
  6014. },
  6015. "required": false
  6016. }
  6017. ],
  6018. "responses": {
  6019. "204": {
  6020. "description": "Prompt accepted"
  6021. },
  6022. "400": {
  6023. "description": "Bad request",
  6024. "content": {
  6025. "application/json": {
  6026. "schema": {
  6027. "$ref": "#/components/schemas/BadRequestError"
  6028. }
  6029. }
  6030. }
  6031. },
  6032. "404": {
  6033. "description": "Not found",
  6034. "content": {
  6035. "application/json": {
  6036. "schema": {
  6037. "$ref": "#/components/schemas/NotFoundError"
  6038. }
  6039. }
  6040. }
  6041. }
  6042. },
  6043. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  6044. "summary": "Send async message",
  6045. "requestBody": {
  6046. "content": {
  6047. "application/json": {
  6048. "schema": {
  6049. "type": "object",
  6050. "properties": {
  6051. "messageID": {
  6052. "type": "string",
  6053. "pattern": "^msg"
  6054. },
  6055. "model": {
  6056. "type": "object",
  6057. "properties": {
  6058. "providerID": {
  6059. "type": "string"
  6060. },
  6061. "modelID": {
  6062. "type": "string"
  6063. }
  6064. },
  6065. "required": ["providerID", "modelID"],
  6066. "additionalProperties": false
  6067. },
  6068. "agent": {
  6069. "type": "string"
  6070. },
  6071. "noReply": {
  6072. "type": "boolean"
  6073. },
  6074. "tools": {
  6075. "type": "object",
  6076. "additionalProperties": {
  6077. "type": "boolean"
  6078. }
  6079. },
  6080. "format": {
  6081. "$ref": "#/components/schemas/OutputFormat"
  6082. },
  6083. "system": {
  6084. "type": "string"
  6085. },
  6086. "variant": {
  6087. "type": "string"
  6088. },
  6089. "parts": {
  6090. "type": "array",
  6091. "items": {
  6092. "anyOf": [
  6093. {
  6094. "$ref": "#/components/schemas/TextPartInput"
  6095. },
  6096. {
  6097. "$ref": "#/components/schemas/FilePartInput"
  6098. },
  6099. {
  6100. "$ref": "#/components/schemas/AgentPartInput"
  6101. },
  6102. {
  6103. "$ref": "#/components/schemas/SubtaskPartInput"
  6104. }
  6105. ]
  6106. }
  6107. }
  6108. },
  6109. "required": ["parts"],
  6110. "additionalProperties": false
  6111. }
  6112. }
  6113. }
  6114. },
  6115. "x-codeSamples": [
  6116. {
  6117. "lang": "js",
  6118. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  6119. }
  6120. ]
  6121. }
  6122. },
  6123. "/session/{sessionID}/command": {
  6124. "post": {
  6125. "tags": ["session"],
  6126. "operationId": "session.command",
  6127. "parameters": [
  6128. {
  6129. "name": "sessionID",
  6130. "in": "path",
  6131. "schema": {
  6132. "type": "string",
  6133. "pattern": "^ses"
  6134. },
  6135. "required": true
  6136. },
  6137. {
  6138. "name": "directory",
  6139. "in": "query",
  6140. "schema": {
  6141. "type": "string"
  6142. },
  6143. "required": false
  6144. },
  6145. {
  6146. "name": "workspace",
  6147. "in": "query",
  6148. "schema": {
  6149. "type": "string"
  6150. },
  6151. "required": false
  6152. }
  6153. ],
  6154. "responses": {
  6155. "200": {
  6156. "description": "Created message",
  6157. "content": {
  6158. "application/json": {
  6159. "schema": {
  6160. "type": "object",
  6161. "required": ["info", "parts"],
  6162. "properties": {
  6163. "info": {
  6164. "$ref": "#/components/schemas/AssistantMessage"
  6165. },
  6166. "parts": {
  6167. "type": "array",
  6168. "items": {
  6169. "$ref": "#/components/schemas/Part"
  6170. }
  6171. }
  6172. }
  6173. }
  6174. }
  6175. }
  6176. },
  6177. "400": {
  6178. "description": "Bad request",
  6179. "content": {
  6180. "application/json": {
  6181. "schema": {
  6182. "$ref": "#/components/schemas/BadRequestError"
  6183. }
  6184. }
  6185. }
  6186. },
  6187. "404": {
  6188. "description": "Not found",
  6189. "content": {
  6190. "application/json": {
  6191. "schema": {
  6192. "$ref": "#/components/schemas/NotFoundError"
  6193. }
  6194. }
  6195. }
  6196. }
  6197. },
  6198. "description": "Send a new command to a session for execution by the AI assistant.",
  6199. "summary": "Send command",
  6200. "requestBody": {
  6201. "content": {
  6202. "application/json": {
  6203. "schema": {
  6204. "type": "object",
  6205. "properties": {
  6206. "messageID": {
  6207. "type": "string",
  6208. "pattern": "^msg"
  6209. },
  6210. "agent": {
  6211. "type": "string"
  6212. },
  6213. "model": {
  6214. "type": "string"
  6215. },
  6216. "arguments": {
  6217. "type": "string"
  6218. },
  6219. "command": {
  6220. "type": "string"
  6221. },
  6222. "variant": {
  6223. "type": "string"
  6224. },
  6225. "parts": {
  6226. "type": "array",
  6227. "items": {
  6228. "type": "object",
  6229. "properties": {
  6230. "id": {
  6231. "type": "string",
  6232. "pattern": "^prt"
  6233. },
  6234. "type": {
  6235. "type": "string",
  6236. "enum": ["file"]
  6237. },
  6238. "mime": {
  6239. "type": "string"
  6240. },
  6241. "filename": {
  6242. "type": "string"
  6243. },
  6244. "url": {
  6245. "type": "string"
  6246. },
  6247. "source": {
  6248. "$ref": "#/components/schemas/FilePartSource"
  6249. }
  6250. },
  6251. "required": ["type", "mime", "url"],
  6252. "additionalProperties": false
  6253. }
  6254. }
  6255. },
  6256. "required": ["arguments", "command"],
  6257. "additionalProperties": false
  6258. }
  6259. }
  6260. }
  6261. },
  6262. "x-codeSamples": [
  6263. {
  6264. "lang": "js",
  6265. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  6266. }
  6267. ]
  6268. }
  6269. },
  6270. "/session/{sessionID}/shell": {
  6271. "post": {
  6272. "tags": ["session"],
  6273. "operationId": "session.shell",
  6274. "parameters": [
  6275. {
  6276. "name": "sessionID",
  6277. "in": "path",
  6278. "schema": {
  6279. "type": "string",
  6280. "pattern": "^ses"
  6281. },
  6282. "required": true
  6283. },
  6284. {
  6285. "name": "directory",
  6286. "in": "query",
  6287. "schema": {
  6288. "type": "string"
  6289. },
  6290. "required": false
  6291. },
  6292. {
  6293. "name": "workspace",
  6294. "in": "query",
  6295. "schema": {
  6296. "type": "string"
  6297. },
  6298. "required": false
  6299. }
  6300. ],
  6301. "responses": {
  6302. "200": {
  6303. "description": "Created message",
  6304. "content": {
  6305. "application/json": {
  6306. "schema": {
  6307. "type": "object",
  6308. "properties": {
  6309. "info": {
  6310. "$ref": "#/components/schemas/Message"
  6311. },
  6312. "parts": {
  6313. "type": "array",
  6314. "items": {
  6315. "$ref": "#/components/schemas/Part"
  6316. }
  6317. }
  6318. },
  6319. "required": ["info", "parts"],
  6320. "additionalProperties": false,
  6321. "description": "Created message"
  6322. }
  6323. }
  6324. }
  6325. },
  6326. "400": {
  6327. "description": "Bad request",
  6328. "content": {
  6329. "application/json": {
  6330. "schema": {
  6331. "$ref": "#/components/schemas/BadRequestError"
  6332. }
  6333. }
  6334. }
  6335. },
  6336. "404": {
  6337. "description": "Not found",
  6338. "content": {
  6339. "application/json": {
  6340. "schema": {
  6341. "$ref": "#/components/schemas/NotFoundError"
  6342. }
  6343. }
  6344. }
  6345. }
  6346. },
  6347. "description": "Execute a shell command within the session context and return the AI's response.",
  6348. "summary": "Run shell command",
  6349. "requestBody": {
  6350. "content": {
  6351. "application/json": {
  6352. "schema": {
  6353. "type": "object",
  6354. "properties": {
  6355. "messageID": {
  6356. "type": "string",
  6357. "pattern": "^msg"
  6358. },
  6359. "agent": {
  6360. "type": "string"
  6361. },
  6362. "model": {
  6363. "type": "object",
  6364. "properties": {
  6365. "providerID": {
  6366. "type": "string"
  6367. },
  6368. "modelID": {
  6369. "type": "string"
  6370. }
  6371. },
  6372. "required": ["providerID", "modelID"],
  6373. "additionalProperties": false
  6374. },
  6375. "command": {
  6376. "type": "string"
  6377. }
  6378. },
  6379. "required": ["agent", "command"],
  6380. "additionalProperties": false
  6381. }
  6382. }
  6383. }
  6384. },
  6385. "x-codeSamples": [
  6386. {
  6387. "lang": "js",
  6388. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  6389. }
  6390. ]
  6391. }
  6392. },
  6393. "/session/{sessionID}/revert": {
  6394. "post": {
  6395. "tags": ["session"],
  6396. "operationId": "session.revert",
  6397. "parameters": [
  6398. {
  6399. "name": "sessionID",
  6400. "in": "path",
  6401. "schema": {
  6402. "type": "string",
  6403. "pattern": "^ses"
  6404. },
  6405. "required": true
  6406. },
  6407. {
  6408. "name": "directory",
  6409. "in": "query",
  6410. "schema": {
  6411. "type": "string"
  6412. },
  6413. "required": false
  6414. },
  6415. {
  6416. "name": "workspace",
  6417. "in": "query",
  6418. "schema": {
  6419. "type": "string"
  6420. },
  6421. "required": false
  6422. }
  6423. ],
  6424. "responses": {
  6425. "200": {
  6426. "description": "Updated session",
  6427. "content": {
  6428. "application/json": {
  6429. "schema": {
  6430. "$ref": "#/components/schemas/Session"
  6431. }
  6432. }
  6433. }
  6434. },
  6435. "400": {
  6436. "description": "Bad request",
  6437. "content": {
  6438. "application/json": {
  6439. "schema": {
  6440. "$ref": "#/components/schemas/BadRequestError"
  6441. }
  6442. }
  6443. }
  6444. },
  6445. "404": {
  6446. "description": "Not found",
  6447. "content": {
  6448. "application/json": {
  6449. "schema": {
  6450. "$ref": "#/components/schemas/NotFoundError"
  6451. }
  6452. }
  6453. }
  6454. }
  6455. },
  6456. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  6457. "summary": "Revert message",
  6458. "requestBody": {
  6459. "content": {
  6460. "application/json": {
  6461. "schema": {
  6462. "type": "object",
  6463. "properties": {
  6464. "messageID": {
  6465. "type": "string",
  6466. "pattern": "^msg"
  6467. },
  6468. "partID": {
  6469. "type": "string",
  6470. "pattern": "^prt"
  6471. }
  6472. },
  6473. "required": ["messageID"],
  6474. "additionalProperties": false
  6475. }
  6476. }
  6477. }
  6478. },
  6479. "x-codeSamples": [
  6480. {
  6481. "lang": "js",
  6482. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  6483. }
  6484. ]
  6485. }
  6486. },
  6487. "/session/{sessionID}/unrevert": {
  6488. "post": {
  6489. "tags": ["session"],
  6490. "operationId": "session.unrevert",
  6491. "parameters": [
  6492. {
  6493. "name": "sessionID",
  6494. "in": "path",
  6495. "schema": {
  6496. "type": "string",
  6497. "pattern": "^ses"
  6498. },
  6499. "required": true
  6500. },
  6501. {
  6502. "name": "directory",
  6503. "in": "query",
  6504. "schema": {
  6505. "type": "string"
  6506. },
  6507. "required": false
  6508. },
  6509. {
  6510. "name": "workspace",
  6511. "in": "query",
  6512. "schema": {
  6513. "type": "string"
  6514. },
  6515. "required": false
  6516. }
  6517. ],
  6518. "responses": {
  6519. "200": {
  6520. "description": "Updated session",
  6521. "content": {
  6522. "application/json": {
  6523. "schema": {
  6524. "$ref": "#/components/schemas/Session"
  6525. }
  6526. }
  6527. }
  6528. },
  6529. "400": {
  6530. "description": "Bad request",
  6531. "content": {
  6532. "application/json": {
  6533. "schema": {
  6534. "$ref": "#/components/schemas/BadRequestError"
  6535. }
  6536. }
  6537. }
  6538. },
  6539. "404": {
  6540. "description": "Not found",
  6541. "content": {
  6542. "application/json": {
  6543. "schema": {
  6544. "$ref": "#/components/schemas/NotFoundError"
  6545. }
  6546. }
  6547. }
  6548. }
  6549. },
  6550. "description": "Restore all previously reverted messages in a session.",
  6551. "summary": "Restore reverted messages",
  6552. "x-codeSamples": [
  6553. {
  6554. "lang": "js",
  6555. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  6556. }
  6557. ]
  6558. }
  6559. },
  6560. "/session/{sessionID}/permissions/{permissionID}": {
  6561. "post": {
  6562. "tags": ["session"],
  6563. "operationId": "permission.respond",
  6564. "parameters": [
  6565. {
  6566. "name": "sessionID",
  6567. "in": "path",
  6568. "schema": {
  6569. "type": "string",
  6570. "pattern": "^ses"
  6571. },
  6572. "required": true
  6573. },
  6574. {
  6575. "name": "permissionID",
  6576. "in": "path",
  6577. "schema": {
  6578. "type": "string",
  6579. "pattern": "^per"
  6580. },
  6581. "required": true
  6582. },
  6583. {
  6584. "name": "directory",
  6585. "in": "query",
  6586. "schema": {
  6587. "type": "string"
  6588. },
  6589. "required": false
  6590. },
  6591. {
  6592. "name": "workspace",
  6593. "in": "query",
  6594. "schema": {
  6595. "type": "string"
  6596. },
  6597. "required": false
  6598. }
  6599. ],
  6600. "responses": {
  6601. "200": {
  6602. "description": "Permission processed successfully",
  6603. "content": {
  6604. "application/json": {
  6605. "schema": {
  6606. "type": "boolean",
  6607. "description": "Permission processed successfully"
  6608. }
  6609. }
  6610. }
  6611. },
  6612. "400": {
  6613. "description": "Bad request",
  6614. "content": {
  6615. "application/json": {
  6616. "schema": {
  6617. "$ref": "#/components/schemas/BadRequestError"
  6618. }
  6619. }
  6620. }
  6621. },
  6622. "404": {
  6623. "description": "Not found",
  6624. "content": {
  6625. "application/json": {
  6626. "schema": {
  6627. "$ref": "#/components/schemas/NotFoundError"
  6628. }
  6629. }
  6630. }
  6631. }
  6632. },
  6633. "description": "Approve or deny a permission request from the AI assistant.",
  6634. "summary": "Respond to permission",
  6635. "deprecated": true,
  6636. "requestBody": {
  6637. "content": {
  6638. "application/json": {
  6639. "schema": {
  6640. "type": "object",
  6641. "properties": {
  6642. "response": {
  6643. "type": "string",
  6644. "enum": ["once", "always", "reject"]
  6645. }
  6646. },
  6647. "required": ["response"],
  6648. "additionalProperties": false
  6649. }
  6650. }
  6651. }
  6652. },
  6653. "x-codeSamples": [
  6654. {
  6655. "lang": "js",
  6656. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  6657. }
  6658. ]
  6659. }
  6660. },
  6661. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  6662. "delete": {
  6663. "tags": ["session"],
  6664. "operationId": "part.delete",
  6665. "parameters": [
  6666. {
  6667. "name": "sessionID",
  6668. "in": "path",
  6669. "schema": {
  6670. "type": "string",
  6671. "pattern": "^ses"
  6672. },
  6673. "required": true
  6674. },
  6675. {
  6676. "name": "messageID",
  6677. "in": "path",
  6678. "schema": {
  6679. "type": "string",
  6680. "pattern": "^msg"
  6681. },
  6682. "required": true
  6683. },
  6684. {
  6685. "name": "partID",
  6686. "in": "path",
  6687. "schema": {
  6688. "type": "string",
  6689. "pattern": "^prt"
  6690. },
  6691. "required": true
  6692. },
  6693. {
  6694. "name": "directory",
  6695. "in": "query",
  6696. "schema": {
  6697. "type": "string"
  6698. },
  6699. "required": false
  6700. },
  6701. {
  6702. "name": "workspace",
  6703. "in": "query",
  6704. "schema": {
  6705. "type": "string"
  6706. },
  6707. "required": false
  6708. }
  6709. ],
  6710. "responses": {
  6711. "200": {
  6712. "description": "Successfully deleted part",
  6713. "content": {
  6714. "application/json": {
  6715. "schema": {
  6716. "type": "boolean",
  6717. "description": "Successfully deleted part"
  6718. }
  6719. }
  6720. }
  6721. },
  6722. "400": {
  6723. "description": "Bad request",
  6724. "content": {
  6725. "application/json": {
  6726. "schema": {
  6727. "$ref": "#/components/schemas/BadRequestError"
  6728. }
  6729. }
  6730. }
  6731. },
  6732. "404": {
  6733. "description": "Not found",
  6734. "content": {
  6735. "application/json": {
  6736. "schema": {
  6737. "$ref": "#/components/schemas/NotFoundError"
  6738. }
  6739. }
  6740. }
  6741. }
  6742. },
  6743. "description": "Delete a part from a message.",
  6744. "x-codeSamples": [
  6745. {
  6746. "lang": "js",
  6747. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  6748. }
  6749. ]
  6750. },
  6751. "patch": {
  6752. "tags": ["session"],
  6753. "operationId": "part.update",
  6754. "parameters": [
  6755. {
  6756. "name": "sessionID",
  6757. "in": "path",
  6758. "schema": {
  6759. "type": "string",
  6760. "pattern": "^ses"
  6761. },
  6762. "required": true
  6763. },
  6764. {
  6765. "name": "messageID",
  6766. "in": "path",
  6767. "schema": {
  6768. "type": "string",
  6769. "pattern": "^msg"
  6770. },
  6771. "required": true
  6772. },
  6773. {
  6774. "name": "partID",
  6775. "in": "path",
  6776. "schema": {
  6777. "type": "string",
  6778. "pattern": "^prt"
  6779. },
  6780. "required": true
  6781. },
  6782. {
  6783. "name": "directory",
  6784. "in": "query",
  6785. "schema": {
  6786. "type": "string"
  6787. },
  6788. "required": false
  6789. },
  6790. {
  6791. "name": "workspace",
  6792. "in": "query",
  6793. "schema": {
  6794. "type": "string"
  6795. },
  6796. "required": false
  6797. }
  6798. ],
  6799. "responses": {
  6800. "200": {
  6801. "description": "Successfully updated part",
  6802. "content": {
  6803. "application/json": {
  6804. "schema": {
  6805. "$ref": "#/components/schemas/Part"
  6806. }
  6807. }
  6808. }
  6809. },
  6810. "400": {
  6811. "description": "Bad request",
  6812. "content": {
  6813. "application/json": {
  6814. "schema": {
  6815. "$ref": "#/components/schemas/BadRequestError"
  6816. }
  6817. }
  6818. }
  6819. },
  6820. "404": {
  6821. "description": "Not found",
  6822. "content": {
  6823. "application/json": {
  6824. "schema": {
  6825. "$ref": "#/components/schemas/NotFoundError"
  6826. }
  6827. }
  6828. }
  6829. }
  6830. },
  6831. "description": "Update a part in a message.",
  6832. "requestBody": {
  6833. "content": {
  6834. "application/json": {
  6835. "schema": {
  6836. "$ref": "#/components/schemas/Part"
  6837. }
  6838. }
  6839. }
  6840. },
  6841. "x-codeSamples": [
  6842. {
  6843. "lang": "js",
  6844. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  6845. }
  6846. ]
  6847. }
  6848. },
  6849. "/sync/start": {
  6850. "post": {
  6851. "tags": ["sync"],
  6852. "operationId": "sync.start",
  6853. "parameters": [
  6854. {
  6855. "name": "directory",
  6856. "in": "query",
  6857. "schema": {
  6858. "type": "string"
  6859. },
  6860. "required": false
  6861. },
  6862. {
  6863. "name": "workspace",
  6864. "in": "query",
  6865. "schema": {
  6866. "type": "string"
  6867. },
  6868. "required": false
  6869. }
  6870. ],
  6871. "responses": {
  6872. "200": {
  6873. "description": "Workspace sync started",
  6874. "content": {
  6875. "application/json": {
  6876. "schema": {
  6877. "type": "boolean",
  6878. "description": "Workspace sync started"
  6879. }
  6880. }
  6881. }
  6882. }
  6883. },
  6884. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  6885. "summary": "Start workspace sync",
  6886. "x-codeSamples": [
  6887. {
  6888. "lang": "js",
  6889. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  6890. }
  6891. ]
  6892. }
  6893. },
  6894. "/sync/replay": {
  6895. "post": {
  6896. "tags": ["sync"],
  6897. "operationId": "sync.replay",
  6898. "parameters": [
  6899. {
  6900. "name": "directory",
  6901. "in": "query",
  6902. "schema": {
  6903. "type": "string"
  6904. },
  6905. "required": false
  6906. },
  6907. {
  6908. "name": "workspace",
  6909. "in": "query",
  6910. "schema": {
  6911. "type": "string"
  6912. },
  6913. "required": false
  6914. }
  6915. ],
  6916. "responses": {
  6917. "200": {
  6918. "description": "Replayed sync events",
  6919. "content": {
  6920. "application/json": {
  6921. "schema": {
  6922. "type": "object",
  6923. "properties": {
  6924. "sessionID": {
  6925. "type": "string"
  6926. }
  6927. },
  6928. "required": ["sessionID"],
  6929. "additionalProperties": false,
  6930. "description": "Replayed sync events"
  6931. }
  6932. }
  6933. }
  6934. },
  6935. "400": {
  6936. "description": "Bad request",
  6937. "content": {
  6938. "application/json": {
  6939. "schema": {
  6940. "$ref": "#/components/schemas/BadRequestError"
  6941. }
  6942. }
  6943. }
  6944. }
  6945. },
  6946. "description": "Validate and replay a complete sync event history.",
  6947. "summary": "Replay sync events",
  6948. "requestBody": {
  6949. "content": {
  6950. "application/json": {
  6951. "schema": {
  6952. "type": "object",
  6953. "properties": {
  6954. "directory": {
  6955. "type": "string"
  6956. },
  6957. "events": {
  6958. "type": "array",
  6959. "minItems": 1,
  6960. "items": {
  6961. "type": "object",
  6962. "properties": {
  6963. "id": {
  6964. "type": "string"
  6965. },
  6966. "aggregateID": {
  6967. "type": "string"
  6968. },
  6969. "seq": {
  6970. "type": "integer",
  6971. "minimum": 0
  6972. },
  6973. "type": {
  6974. "type": "string"
  6975. },
  6976. "data": {
  6977. "type": "object"
  6978. }
  6979. },
  6980. "required": ["id", "aggregateID", "seq", "type", "data"],
  6981. "additionalProperties": false
  6982. }
  6983. }
  6984. },
  6985. "required": ["directory", "events"],
  6986. "additionalProperties": false
  6987. }
  6988. }
  6989. }
  6990. },
  6991. "x-codeSamples": [
  6992. {
  6993. "lang": "js",
  6994. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  6995. }
  6996. ]
  6997. }
  6998. },
  6999. "/sync/steal": {
  7000. "post": {
  7001. "tags": ["sync"],
  7002. "operationId": "sync.steal",
  7003. "parameters": [
  7004. {
  7005. "name": "directory",
  7006. "in": "query",
  7007. "schema": {
  7008. "type": "string"
  7009. },
  7010. "required": false
  7011. },
  7012. {
  7013. "name": "workspace",
  7014. "in": "query",
  7015. "schema": {
  7016. "type": "string"
  7017. },
  7018. "required": false
  7019. }
  7020. ],
  7021. "responses": {
  7022. "200": {
  7023. "description": "Session stolen into workspace",
  7024. "content": {
  7025. "application/json": {
  7026. "schema": {
  7027. "type": "object",
  7028. "properties": {
  7029. "sessionID": {
  7030. "type": "string",
  7031. "pattern": "^ses"
  7032. }
  7033. },
  7034. "required": ["sessionID"],
  7035. "additionalProperties": false,
  7036. "description": "Session stolen into workspace"
  7037. }
  7038. }
  7039. }
  7040. },
  7041. "400": {
  7042. "description": "Bad request",
  7043. "content": {
  7044. "application/json": {
  7045. "schema": {
  7046. "$ref": "#/components/schemas/BadRequestError"
  7047. }
  7048. }
  7049. }
  7050. }
  7051. },
  7052. "description": "Update a session to belong to the current workspace through the sync event system.",
  7053. "summary": "Steal session into workspace",
  7054. "requestBody": {
  7055. "content": {
  7056. "application/json": {
  7057. "schema": {
  7058. "type": "object",
  7059. "properties": {
  7060. "sessionID": {
  7061. "type": "string",
  7062. "pattern": "^ses"
  7063. }
  7064. },
  7065. "required": ["sessionID"],
  7066. "additionalProperties": false
  7067. }
  7068. }
  7069. }
  7070. },
  7071. "x-codeSamples": [
  7072. {
  7073. "lang": "js",
  7074. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.steal({\n ...\n})"
  7075. }
  7076. ]
  7077. }
  7078. },
  7079. "/sync/history": {
  7080. "post": {
  7081. "tags": ["sync"],
  7082. "operationId": "sync.history.list",
  7083. "parameters": [
  7084. {
  7085. "name": "directory",
  7086. "in": "query",
  7087. "schema": {
  7088. "type": "string"
  7089. },
  7090. "required": false
  7091. },
  7092. {
  7093. "name": "workspace",
  7094. "in": "query",
  7095. "schema": {
  7096. "type": "string"
  7097. },
  7098. "required": false
  7099. }
  7100. ],
  7101. "responses": {
  7102. "200": {
  7103. "description": "Sync events",
  7104. "content": {
  7105. "application/json": {
  7106. "schema": {
  7107. "type": "array",
  7108. "items": {
  7109. "type": "object",
  7110. "properties": {
  7111. "id": {
  7112. "type": "string"
  7113. },
  7114. "aggregate_id": {
  7115. "type": "string"
  7116. },
  7117. "seq": {
  7118. "type": "integer",
  7119. "minimum": 0
  7120. },
  7121. "type": {
  7122. "type": "string"
  7123. },
  7124. "data": {
  7125. "type": "object"
  7126. }
  7127. },
  7128. "required": ["id", "aggregate_id", "seq", "type", "data"],
  7129. "additionalProperties": false
  7130. },
  7131. "description": "Sync events"
  7132. }
  7133. }
  7134. }
  7135. },
  7136. "400": {
  7137. "description": "Bad request",
  7138. "content": {
  7139. "application/json": {
  7140. "schema": {
  7141. "$ref": "#/components/schemas/BadRequestError"
  7142. }
  7143. }
  7144. }
  7145. }
  7146. },
  7147. "description": "List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.",
  7148. "summary": "List sync events",
  7149. "requestBody": {
  7150. "content": {
  7151. "application/json": {
  7152. "schema": {
  7153. "type": "object",
  7154. "additionalProperties": {
  7155. "type": "integer",
  7156. "minimum": 0
  7157. }
  7158. }
  7159. }
  7160. }
  7161. },
  7162. "x-codeSamples": [
  7163. {
  7164. "lang": "js",
  7165. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  7166. }
  7167. ]
  7168. }
  7169. },
  7170. "/api/session": {
  7171. "get": {
  7172. "tags": ["v2"],
  7173. "operationId": "v2.session.list",
  7174. "parameters": [
  7175. {
  7176. "name": "directory",
  7177. "in": "query",
  7178. "schema": {
  7179. "type": "string"
  7180. },
  7181. "required": false
  7182. },
  7183. {
  7184. "name": "workspace",
  7185. "in": "query",
  7186. "schema": {
  7187. "type": "string"
  7188. },
  7189. "required": false
  7190. },
  7191. {
  7192. "name": "limit",
  7193. "in": "query",
  7194. "schema": {
  7195. "type": "number"
  7196. },
  7197. "required": false
  7198. },
  7199. {
  7200. "name": "order",
  7201. "in": "query",
  7202. "schema": {
  7203. "type": "string",
  7204. "enum": ["asc", "desc"]
  7205. },
  7206. "required": false
  7207. },
  7208. {
  7209. "name": "path",
  7210. "in": "query",
  7211. "schema": {
  7212. "type": "string"
  7213. },
  7214. "required": false
  7215. },
  7216. {
  7217. "name": "roots",
  7218. "in": "query",
  7219. "schema": {
  7220. "anyOf": [
  7221. {
  7222. "type": "boolean"
  7223. },
  7224. {
  7225. "type": "string",
  7226. "enum": ["true", "false"]
  7227. }
  7228. ]
  7229. },
  7230. "required": false
  7231. },
  7232. {
  7233. "name": "start",
  7234. "in": "query",
  7235. "schema": {
  7236. "type": "number"
  7237. },
  7238. "required": false
  7239. },
  7240. {
  7241. "name": "search",
  7242. "in": "query",
  7243. "schema": {
  7244. "type": "string"
  7245. },
  7246. "required": false
  7247. },
  7248. {
  7249. "name": "cursor",
  7250. "in": "query",
  7251. "schema": {
  7252. "type": "string",
  7253. "description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order or filters."
  7254. },
  7255. "required": false
  7256. }
  7257. ],
  7258. "responses": {
  7259. "200": {
  7260. "description": "V2SessionsResponse",
  7261. "content": {
  7262. "application/json": {
  7263. "schema": {
  7264. "$ref": "#/components/schemas/V2SessionsResponse"
  7265. }
  7266. }
  7267. }
  7268. },
  7269. "400": {
  7270. "description": "Bad request",
  7271. "content": {
  7272. "application/json": {
  7273. "schema": {
  7274. "$ref": "#/components/schemas/BadRequestError"
  7275. }
  7276. }
  7277. }
  7278. }
  7279. },
  7280. "description": "Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.",
  7281. "summary": "List v2 sessions",
  7282. "x-codeSamples": [
  7283. {
  7284. "lang": "js",
  7285. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
  7286. }
  7287. ]
  7288. }
  7289. },
  7290. "/api/session/{sessionID}/prompt": {
  7291. "post": {
  7292. "tags": ["v2"],
  7293. "operationId": "v2.session.prompt",
  7294. "parameters": [
  7295. {
  7296. "name": "sessionID",
  7297. "in": "path",
  7298. "schema": {
  7299. "type": "string",
  7300. "pattern": "^ses"
  7301. },
  7302. "required": true
  7303. },
  7304. {
  7305. "name": "directory",
  7306. "in": "query",
  7307. "schema": {
  7308. "type": "string"
  7309. },
  7310. "required": false
  7311. },
  7312. {
  7313. "name": "workspace",
  7314. "in": "query",
  7315. "schema": {
  7316. "type": "string"
  7317. },
  7318. "required": false
  7319. }
  7320. ],
  7321. "responses": {
  7322. "200": {
  7323. "description": "Session.Message",
  7324. "content": {
  7325. "application/json": {
  7326. "schema": {
  7327. "$ref": "#/components/schemas/SessionMessage"
  7328. }
  7329. }
  7330. }
  7331. }
  7332. },
  7333. "description": "Create a v2 session message and queue it for the agent loop.",
  7334. "summary": "Send v2 message",
  7335. "requestBody": {
  7336. "content": {
  7337. "application/json": {
  7338. "schema": {
  7339. "type": "object",
  7340. "properties": {
  7341. "prompt": {
  7342. "$ref": "#/components/schemas/Prompt"
  7343. },
  7344. "delivery": {
  7345. "$ref": "#/components/schemas/SessionDelivery"
  7346. }
  7347. },
  7348. "required": ["prompt"],
  7349. "additionalProperties": false
  7350. }
  7351. }
  7352. }
  7353. },
  7354. "x-codeSamples": [
  7355. {
  7356. "lang": "js",
  7357. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})"
  7358. }
  7359. ]
  7360. }
  7361. },
  7362. "/api/session/{sessionID}/compact": {
  7363. "post": {
  7364. "tags": ["v2"],
  7365. "operationId": "v2.session.compact",
  7366. "parameters": [
  7367. {
  7368. "name": "sessionID",
  7369. "in": "path",
  7370. "schema": {
  7371. "type": "string",
  7372. "pattern": "^ses"
  7373. },
  7374. "required": true
  7375. },
  7376. {
  7377. "name": "directory",
  7378. "in": "query",
  7379. "schema": {
  7380. "type": "string"
  7381. },
  7382. "required": false
  7383. },
  7384. {
  7385. "name": "workspace",
  7386. "in": "query",
  7387. "schema": {
  7388. "type": "string"
  7389. },
  7390. "required": false
  7391. }
  7392. ],
  7393. "responses": {
  7394. "204": {
  7395. "description": "<No Content>"
  7396. }
  7397. },
  7398. "description": "Compact a v2 session conversation.",
  7399. "summary": "Compact v2 session",
  7400. "x-codeSamples": [
  7401. {
  7402. "lang": "js",
  7403. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})"
  7404. }
  7405. ]
  7406. }
  7407. },
  7408. "/api/session/{sessionID}/wait": {
  7409. "post": {
  7410. "tags": ["v2"],
  7411. "operationId": "v2.session.wait",
  7412. "parameters": [
  7413. {
  7414. "name": "sessionID",
  7415. "in": "path",
  7416. "schema": {
  7417. "type": "string",
  7418. "pattern": "^ses"
  7419. },
  7420. "required": true
  7421. },
  7422. {
  7423. "name": "directory",
  7424. "in": "query",
  7425. "schema": {
  7426. "type": "string"
  7427. },
  7428. "required": false
  7429. },
  7430. {
  7431. "name": "workspace",
  7432. "in": "query",
  7433. "schema": {
  7434. "type": "string"
  7435. },
  7436. "required": false
  7437. }
  7438. ],
  7439. "responses": {
  7440. "204": {
  7441. "description": "<No Content>"
  7442. }
  7443. },
  7444. "description": "Wait for a v2 session agent loop to become idle.",
  7445. "summary": "Wait for v2 session",
  7446. "x-codeSamples": [
  7447. {
  7448. "lang": "js",
  7449. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})"
  7450. }
  7451. ]
  7452. }
  7453. },
  7454. "/api/session/{sessionID}/context": {
  7455. "get": {
  7456. "tags": ["v2"],
  7457. "operationId": "v2.session.context",
  7458. "parameters": [
  7459. {
  7460. "name": "sessionID",
  7461. "in": "path",
  7462. "schema": {
  7463. "type": "string",
  7464. "pattern": "^ses"
  7465. },
  7466. "required": true
  7467. },
  7468. {
  7469. "name": "directory",
  7470. "in": "query",
  7471. "schema": {
  7472. "type": "string"
  7473. },
  7474. "required": false
  7475. },
  7476. {
  7477. "name": "workspace",
  7478. "in": "query",
  7479. "schema": {
  7480. "type": "string"
  7481. },
  7482. "required": false
  7483. }
  7484. ],
  7485. "responses": {
  7486. "200": {
  7487. "description": "Success",
  7488. "content": {
  7489. "application/json": {
  7490. "schema": {
  7491. "type": "array",
  7492. "items": {
  7493. "$ref": "#/components/schemas/SessionMessage"
  7494. }
  7495. }
  7496. }
  7497. }
  7498. }
  7499. },
  7500. "description": "Retrieve the active context messages for a v2 session (all messages after the last compaction).",
  7501. "summary": "Get v2 session context",
  7502. "x-codeSamples": [
  7503. {
  7504. "lang": "js",
  7505. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})"
  7506. }
  7507. ]
  7508. }
  7509. },
  7510. "/api/session/{sessionID}/message": {
  7511. "get": {
  7512. "tags": ["v2 messages"],
  7513. "operationId": "v2.session.messages",
  7514. "parameters": [
  7515. {
  7516. "name": "sessionID",
  7517. "in": "path",
  7518. "schema": {
  7519. "type": "string",
  7520. "pattern": "^ses"
  7521. },
  7522. "required": true
  7523. },
  7524. {
  7525. "name": "directory",
  7526. "in": "query",
  7527. "schema": {
  7528. "type": "string"
  7529. },
  7530. "required": false
  7531. },
  7532. {
  7533. "name": "workspace",
  7534. "in": "query",
  7535. "schema": {
  7536. "type": "string"
  7537. },
  7538. "required": false
  7539. },
  7540. {
  7541. "name": "limit",
  7542. "in": "query",
  7543. "schema": {
  7544. "type": "number"
  7545. },
  7546. "required": false
  7547. },
  7548. {
  7549. "name": "order",
  7550. "in": "query",
  7551. "schema": {
  7552. "type": "string",
  7553. "enum": ["asc", "desc"]
  7554. },
  7555. "required": false
  7556. },
  7557. {
  7558. "name": "cursor",
  7559. "in": "query",
  7560. "schema": {
  7561. "type": "string",
  7562. "description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order."
  7563. },
  7564. "required": false
  7565. }
  7566. ],
  7567. "responses": {
  7568. "200": {
  7569. "description": "V2SessionMessagesResponse",
  7570. "content": {
  7571. "application/json": {
  7572. "schema": {
  7573. "$ref": "#/components/schemas/V2SessionMessagesResponse"
  7574. }
  7575. }
  7576. }
  7577. },
  7578. "400": {
  7579. "description": "Bad request",
  7580. "content": {
  7581. "application/json": {
  7582. "schema": {
  7583. "$ref": "#/components/schemas/BadRequestError"
  7584. }
  7585. }
  7586. }
  7587. }
  7588. },
  7589. "description": "Retrieve projected v2 messages for a session. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline.",
  7590. "summary": "Get v2 session messages",
  7591. "x-codeSamples": [
  7592. {
  7593. "lang": "js",
  7594. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})"
  7595. }
  7596. ]
  7597. }
  7598. },
  7599. "/tui/append-prompt": {
  7600. "post": {
  7601. "tags": ["tui"],
  7602. "operationId": "tui.appendPrompt",
  7603. "parameters": [
  7604. {
  7605. "name": "directory",
  7606. "in": "query",
  7607. "schema": {
  7608. "type": "string"
  7609. },
  7610. "required": false
  7611. },
  7612. {
  7613. "name": "workspace",
  7614. "in": "query",
  7615. "schema": {
  7616. "type": "string"
  7617. },
  7618. "required": false
  7619. }
  7620. ],
  7621. "responses": {
  7622. "200": {
  7623. "description": "Prompt processed successfully",
  7624. "content": {
  7625. "application/json": {
  7626. "schema": {
  7627. "type": "boolean",
  7628. "description": "Prompt processed successfully"
  7629. }
  7630. }
  7631. }
  7632. },
  7633. "400": {
  7634. "description": "Bad request",
  7635. "content": {
  7636. "application/json": {
  7637. "schema": {
  7638. "$ref": "#/components/schemas/BadRequestError"
  7639. }
  7640. }
  7641. }
  7642. }
  7643. },
  7644. "description": "Append prompt to the TUI.",
  7645. "summary": "Append TUI prompt",
  7646. "requestBody": {
  7647. "content": {
  7648. "application/json": {
  7649. "schema": {
  7650. "type": "object",
  7651. "properties": {
  7652. "text": {
  7653. "type": "string"
  7654. }
  7655. },
  7656. "required": ["text"],
  7657. "additionalProperties": false
  7658. }
  7659. }
  7660. }
  7661. },
  7662. "x-codeSamples": [
  7663. {
  7664. "lang": "js",
  7665. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  7666. }
  7667. ]
  7668. }
  7669. },
  7670. "/tui/open-help": {
  7671. "post": {
  7672. "tags": ["tui"],
  7673. "operationId": "tui.openHelp",
  7674. "parameters": [
  7675. {
  7676. "name": "directory",
  7677. "in": "query",
  7678. "schema": {
  7679. "type": "string"
  7680. },
  7681. "required": false
  7682. },
  7683. {
  7684. "name": "workspace",
  7685. "in": "query",
  7686. "schema": {
  7687. "type": "string"
  7688. },
  7689. "required": false
  7690. }
  7691. ],
  7692. "responses": {
  7693. "200": {
  7694. "description": "Help dialog opened successfully",
  7695. "content": {
  7696. "application/json": {
  7697. "schema": {
  7698. "type": "boolean",
  7699. "description": "Help dialog opened successfully"
  7700. }
  7701. }
  7702. }
  7703. }
  7704. },
  7705. "description": "Open the help dialog in the TUI to display user assistance information.",
  7706. "summary": "Open help dialog",
  7707. "x-codeSamples": [
  7708. {
  7709. "lang": "js",
  7710. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  7711. }
  7712. ]
  7713. }
  7714. },
  7715. "/tui/open-sessions": {
  7716. "post": {
  7717. "tags": ["tui"],
  7718. "operationId": "tui.openSessions",
  7719. "parameters": [
  7720. {
  7721. "name": "directory",
  7722. "in": "query",
  7723. "schema": {
  7724. "type": "string"
  7725. },
  7726. "required": false
  7727. },
  7728. {
  7729. "name": "workspace",
  7730. "in": "query",
  7731. "schema": {
  7732. "type": "string"
  7733. },
  7734. "required": false
  7735. }
  7736. ],
  7737. "responses": {
  7738. "200": {
  7739. "description": "Session dialog opened successfully",
  7740. "content": {
  7741. "application/json": {
  7742. "schema": {
  7743. "type": "boolean",
  7744. "description": "Session dialog opened successfully"
  7745. }
  7746. }
  7747. }
  7748. }
  7749. },
  7750. "description": "Open the session dialog.",
  7751. "summary": "Open sessions dialog",
  7752. "x-codeSamples": [
  7753. {
  7754. "lang": "js",
  7755. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  7756. }
  7757. ]
  7758. }
  7759. },
  7760. "/tui/open-themes": {
  7761. "post": {
  7762. "tags": ["tui"],
  7763. "operationId": "tui.openThemes",
  7764. "parameters": [
  7765. {
  7766. "name": "directory",
  7767. "in": "query",
  7768. "schema": {
  7769. "type": "string"
  7770. },
  7771. "required": false
  7772. },
  7773. {
  7774. "name": "workspace",
  7775. "in": "query",
  7776. "schema": {
  7777. "type": "string"
  7778. },
  7779. "required": false
  7780. }
  7781. ],
  7782. "responses": {
  7783. "200": {
  7784. "description": "Theme dialog opened successfully",
  7785. "content": {
  7786. "application/json": {
  7787. "schema": {
  7788. "type": "boolean",
  7789. "description": "Theme dialog opened successfully"
  7790. }
  7791. }
  7792. }
  7793. }
  7794. },
  7795. "description": "Open the theme dialog.",
  7796. "summary": "Open themes dialog",
  7797. "x-codeSamples": [
  7798. {
  7799. "lang": "js",
  7800. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  7801. }
  7802. ]
  7803. }
  7804. },
  7805. "/tui/open-models": {
  7806. "post": {
  7807. "tags": ["tui"],
  7808. "operationId": "tui.openModels",
  7809. "parameters": [
  7810. {
  7811. "name": "directory",
  7812. "in": "query",
  7813. "schema": {
  7814. "type": "string"
  7815. },
  7816. "required": false
  7817. },
  7818. {
  7819. "name": "workspace",
  7820. "in": "query",
  7821. "schema": {
  7822. "type": "string"
  7823. },
  7824. "required": false
  7825. }
  7826. ],
  7827. "responses": {
  7828. "200": {
  7829. "description": "Model dialog opened successfully",
  7830. "content": {
  7831. "application/json": {
  7832. "schema": {
  7833. "type": "boolean",
  7834. "description": "Model dialog opened successfully"
  7835. }
  7836. }
  7837. }
  7838. }
  7839. },
  7840. "description": "Open the model dialog.",
  7841. "summary": "Open models dialog",
  7842. "x-codeSamples": [
  7843. {
  7844. "lang": "js",
  7845. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  7846. }
  7847. ]
  7848. }
  7849. },
  7850. "/tui/submit-prompt": {
  7851. "post": {
  7852. "tags": ["tui"],
  7853. "operationId": "tui.submitPrompt",
  7854. "parameters": [
  7855. {
  7856. "name": "directory",
  7857. "in": "query",
  7858. "schema": {
  7859. "type": "string"
  7860. },
  7861. "required": false
  7862. },
  7863. {
  7864. "name": "workspace",
  7865. "in": "query",
  7866. "schema": {
  7867. "type": "string"
  7868. },
  7869. "required": false
  7870. }
  7871. ],
  7872. "responses": {
  7873. "200": {
  7874. "description": "Prompt submitted successfully",
  7875. "content": {
  7876. "application/json": {
  7877. "schema": {
  7878. "type": "boolean",
  7879. "description": "Prompt submitted successfully"
  7880. }
  7881. }
  7882. }
  7883. }
  7884. },
  7885. "description": "Submit the prompt.",
  7886. "summary": "Submit TUI prompt",
  7887. "x-codeSamples": [
  7888. {
  7889. "lang": "js",
  7890. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  7891. }
  7892. ]
  7893. }
  7894. },
  7895. "/tui/clear-prompt": {
  7896. "post": {
  7897. "tags": ["tui"],
  7898. "operationId": "tui.clearPrompt",
  7899. "parameters": [
  7900. {
  7901. "name": "directory",
  7902. "in": "query",
  7903. "schema": {
  7904. "type": "string"
  7905. },
  7906. "required": false
  7907. },
  7908. {
  7909. "name": "workspace",
  7910. "in": "query",
  7911. "schema": {
  7912. "type": "string"
  7913. },
  7914. "required": false
  7915. }
  7916. ],
  7917. "responses": {
  7918. "200": {
  7919. "description": "Prompt cleared successfully",
  7920. "content": {
  7921. "application/json": {
  7922. "schema": {
  7923. "type": "boolean",
  7924. "description": "Prompt cleared successfully"
  7925. }
  7926. }
  7927. }
  7928. }
  7929. },
  7930. "description": "Clear the prompt.",
  7931. "summary": "Clear TUI prompt",
  7932. "x-codeSamples": [
  7933. {
  7934. "lang": "js",
  7935. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  7936. }
  7937. ]
  7938. }
  7939. },
  7940. "/tui/execute-command": {
  7941. "post": {
  7942. "tags": ["tui"],
  7943. "operationId": "tui.executeCommand",
  7944. "parameters": [
  7945. {
  7946. "name": "directory",
  7947. "in": "query",
  7948. "schema": {
  7949. "type": "string"
  7950. },
  7951. "required": false
  7952. },
  7953. {
  7954. "name": "workspace",
  7955. "in": "query",
  7956. "schema": {
  7957. "type": "string"
  7958. },
  7959. "required": false
  7960. }
  7961. ],
  7962. "responses": {
  7963. "200": {
  7964. "description": "Command executed successfully",
  7965. "content": {
  7966. "application/json": {
  7967. "schema": {
  7968. "type": "boolean",
  7969. "description": "Command executed successfully"
  7970. }
  7971. }
  7972. }
  7973. },
  7974. "400": {
  7975. "description": "Bad request",
  7976. "content": {
  7977. "application/json": {
  7978. "schema": {
  7979. "$ref": "#/components/schemas/BadRequestError"
  7980. }
  7981. }
  7982. }
  7983. }
  7984. },
  7985. "description": "Execute a TUI command.",
  7986. "summary": "Execute TUI command",
  7987. "requestBody": {
  7988. "content": {
  7989. "application/json": {
  7990. "schema": {
  7991. "type": "object",
  7992. "properties": {
  7993. "command": {
  7994. "type": "string"
  7995. }
  7996. },
  7997. "required": ["command"],
  7998. "additionalProperties": false
  7999. }
  8000. }
  8001. }
  8002. },
  8003. "x-codeSamples": [
  8004. {
  8005. "lang": "js",
  8006. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  8007. }
  8008. ]
  8009. }
  8010. },
  8011. "/tui/show-toast": {
  8012. "post": {
  8013. "tags": ["tui"],
  8014. "operationId": "tui.showToast",
  8015. "parameters": [
  8016. {
  8017. "name": "directory",
  8018. "in": "query",
  8019. "schema": {
  8020. "type": "string"
  8021. },
  8022. "required": false
  8023. },
  8024. {
  8025. "name": "workspace",
  8026. "in": "query",
  8027. "schema": {
  8028. "type": "string"
  8029. },
  8030. "required": false
  8031. }
  8032. ],
  8033. "responses": {
  8034. "200": {
  8035. "description": "Toast notification shown successfully",
  8036. "content": {
  8037. "application/json": {
  8038. "schema": {
  8039. "type": "boolean",
  8040. "description": "Toast notification shown successfully"
  8041. }
  8042. }
  8043. }
  8044. }
  8045. },
  8046. "description": "Show a toast notification in the TUI.",
  8047. "summary": "Show TUI toast",
  8048. "requestBody": {
  8049. "content": {
  8050. "application/json": {
  8051. "schema": {
  8052. "type": "object",
  8053. "properties": {
  8054. "title": {
  8055. "type": "string"
  8056. },
  8057. "message": {
  8058. "type": "string"
  8059. },
  8060. "variant": {
  8061. "type": "string",
  8062. "enum": ["info", "success", "warning", "error"]
  8063. },
  8064. "duration": {
  8065. "type": "integer",
  8066. "exclusiveMinimum": 0
  8067. }
  8068. },
  8069. "required": ["message", "variant"],
  8070. "additionalProperties": false
  8071. }
  8072. }
  8073. }
  8074. },
  8075. "x-codeSamples": [
  8076. {
  8077. "lang": "js",
  8078. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  8079. }
  8080. ]
  8081. }
  8082. },
  8083. "/tui/publish": {
  8084. "post": {
  8085. "tags": ["tui"],
  8086. "operationId": "tui.publish",
  8087. "parameters": [
  8088. {
  8089. "name": "directory",
  8090. "in": "query",
  8091. "schema": {
  8092. "type": "string"
  8093. },
  8094. "required": false
  8095. },
  8096. {
  8097. "name": "workspace",
  8098. "in": "query",
  8099. "schema": {
  8100. "type": "string"
  8101. },
  8102. "required": false
  8103. }
  8104. ],
  8105. "responses": {
  8106. "200": {
  8107. "description": "Event published successfully",
  8108. "content": {
  8109. "application/json": {
  8110. "schema": {
  8111. "type": "boolean",
  8112. "description": "Event published successfully"
  8113. }
  8114. }
  8115. }
  8116. },
  8117. "400": {
  8118. "description": "Bad request",
  8119. "content": {
  8120. "application/json": {
  8121. "schema": {
  8122. "$ref": "#/components/schemas/BadRequestError"
  8123. }
  8124. }
  8125. }
  8126. }
  8127. },
  8128. "description": "Publish a TUI event.",
  8129. "summary": "Publish TUI event",
  8130. "requestBody": {
  8131. "content": {
  8132. "application/json": {
  8133. "schema": {
  8134. "anyOf": [
  8135. {
  8136. "$ref": "#/components/schemas/EventTuiPromptAppend"
  8137. },
  8138. {
  8139. "$ref": "#/components/schemas/EventTuiCommandExecute"
  8140. },
  8141. {
  8142. "$ref": "#/components/schemas/EventTuiToastShow"
  8143. },
  8144. {
  8145. "$ref": "#/components/schemas/EventTuiSessionSelect"
  8146. }
  8147. ]
  8148. }
  8149. }
  8150. }
  8151. },
  8152. "x-codeSamples": [
  8153. {
  8154. "lang": "js",
  8155. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  8156. }
  8157. ]
  8158. }
  8159. },
  8160. "/tui/select-session": {
  8161. "post": {
  8162. "tags": ["tui"],
  8163. "operationId": "tui.selectSession",
  8164. "parameters": [
  8165. {
  8166. "name": "directory",
  8167. "in": "query",
  8168. "schema": {
  8169. "type": "string"
  8170. },
  8171. "required": false
  8172. },
  8173. {
  8174. "name": "workspace",
  8175. "in": "query",
  8176. "schema": {
  8177. "type": "string"
  8178. },
  8179. "required": false
  8180. }
  8181. ],
  8182. "responses": {
  8183. "200": {
  8184. "description": "Session selected successfully",
  8185. "content": {
  8186. "application/json": {
  8187. "schema": {
  8188. "type": "boolean",
  8189. "description": "Session selected successfully"
  8190. }
  8191. }
  8192. }
  8193. },
  8194. "400": {
  8195. "description": "Bad request",
  8196. "content": {
  8197. "application/json": {
  8198. "schema": {
  8199. "$ref": "#/components/schemas/BadRequestError"
  8200. }
  8201. }
  8202. }
  8203. },
  8204. "404": {
  8205. "description": "NotFoundError",
  8206. "content": {
  8207. "application/json": {
  8208. "schema": {
  8209. "$ref": "#/components/schemas/NotFoundError"
  8210. }
  8211. }
  8212. }
  8213. }
  8214. },
  8215. "description": "Navigate the TUI to display the specified session.",
  8216. "summary": "Select session",
  8217. "requestBody": {
  8218. "content": {
  8219. "application/json": {
  8220. "schema": {
  8221. "type": "object",
  8222. "properties": {
  8223. "sessionID": {
  8224. "type": "string",
  8225. "pattern": "^ses",
  8226. "description": "Session ID to navigate to"
  8227. }
  8228. },
  8229. "required": ["sessionID"],
  8230. "additionalProperties": false
  8231. }
  8232. }
  8233. }
  8234. },
  8235. "x-codeSamples": [
  8236. {
  8237. "lang": "js",
  8238. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  8239. }
  8240. ]
  8241. }
  8242. },
  8243. "/tui/control/next": {
  8244. "get": {
  8245. "tags": ["tui"],
  8246. "operationId": "tui.control.next",
  8247. "parameters": [
  8248. {
  8249. "name": "directory",
  8250. "in": "query",
  8251. "schema": {
  8252. "type": "string"
  8253. },
  8254. "required": false
  8255. },
  8256. {
  8257. "name": "workspace",
  8258. "in": "query",
  8259. "schema": {
  8260. "type": "string"
  8261. },
  8262. "required": false
  8263. }
  8264. ],
  8265. "responses": {
  8266. "200": {
  8267. "description": "Next TUI request",
  8268. "content": {
  8269. "application/json": {
  8270. "schema": {
  8271. "type": "object",
  8272. "properties": {
  8273. "path": {
  8274. "type": "string"
  8275. },
  8276. "body": {}
  8277. },
  8278. "required": ["path", "body"],
  8279. "additionalProperties": false,
  8280. "description": "Next TUI request"
  8281. }
  8282. }
  8283. }
  8284. }
  8285. },
  8286. "description": "Retrieve the next TUI request from the queue for processing.",
  8287. "summary": "Get next TUI request",
  8288. "x-codeSamples": [
  8289. {
  8290. "lang": "js",
  8291. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  8292. }
  8293. ]
  8294. }
  8295. },
  8296. "/tui/control/response": {
  8297. "post": {
  8298. "tags": ["tui"],
  8299. "operationId": "tui.control.response",
  8300. "parameters": [
  8301. {
  8302. "name": "directory",
  8303. "in": "query",
  8304. "schema": {
  8305. "type": "string"
  8306. },
  8307. "required": false
  8308. },
  8309. {
  8310. "name": "workspace",
  8311. "in": "query",
  8312. "schema": {
  8313. "type": "string"
  8314. },
  8315. "required": false
  8316. }
  8317. ],
  8318. "responses": {
  8319. "200": {
  8320. "description": "Response submitted successfully",
  8321. "content": {
  8322. "application/json": {
  8323. "schema": {
  8324. "type": "boolean",
  8325. "description": "Response submitted successfully"
  8326. }
  8327. }
  8328. }
  8329. }
  8330. },
  8331. "description": "Submit a response to the TUI request queue to complete a pending request.",
  8332. "summary": "Submit TUI response",
  8333. "requestBody": {
  8334. "content": {
  8335. "application/json": {
  8336. "schema": {}
  8337. }
  8338. }
  8339. },
  8340. "x-codeSamples": [
  8341. {
  8342. "lang": "js",
  8343. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  8344. }
  8345. ]
  8346. }
  8347. },
  8348. "/experimental/workspace/adapter": {
  8349. "get": {
  8350. "tags": ["workspace"],
  8351. "operationId": "experimental.workspace.adapter.list",
  8352. "parameters": [
  8353. {
  8354. "name": "directory",
  8355. "in": "query",
  8356. "schema": {
  8357. "type": "string"
  8358. },
  8359. "required": false
  8360. },
  8361. {
  8362. "name": "workspace",
  8363. "in": "query",
  8364. "schema": {
  8365. "type": "string"
  8366. },
  8367. "required": false
  8368. }
  8369. ],
  8370. "responses": {
  8371. "200": {
  8372. "description": "Workspace adapters",
  8373. "content": {
  8374. "application/json": {
  8375. "schema": {
  8376. "type": "array",
  8377. "items": {
  8378. "type": "object",
  8379. "properties": {
  8380. "type": {
  8381. "type": "string"
  8382. },
  8383. "name": {
  8384. "type": "string"
  8385. },
  8386. "description": {
  8387. "type": "string"
  8388. }
  8389. },
  8390. "required": ["type", "name", "description"],
  8391. "additionalProperties": false
  8392. },
  8393. "description": "Workspace adapters"
  8394. }
  8395. }
  8396. }
  8397. }
  8398. },
  8399. "description": "List all available workspace adapters for the current project.",
  8400. "summary": "List workspace adapters",
  8401. "x-codeSamples": [
  8402. {
  8403. "lang": "js",
  8404. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n ...\n})"
  8405. }
  8406. ]
  8407. }
  8408. },
  8409. "/experimental/workspace": {
  8410. "get": {
  8411. "tags": ["workspace"],
  8412. "operationId": "experimental.workspace.list",
  8413. "parameters": [
  8414. {
  8415. "name": "directory",
  8416. "in": "query",
  8417. "schema": {
  8418. "type": "string"
  8419. },
  8420. "required": false
  8421. },
  8422. {
  8423. "name": "workspace",
  8424. "in": "query",
  8425. "schema": {
  8426. "type": "string"
  8427. },
  8428. "required": false
  8429. }
  8430. ],
  8431. "responses": {
  8432. "200": {
  8433. "description": "Workspaces",
  8434. "content": {
  8435. "application/json": {
  8436. "schema": {
  8437. "type": "array",
  8438. "items": {
  8439. "$ref": "#/components/schemas/Workspace"
  8440. },
  8441. "description": "Workspaces"
  8442. }
  8443. }
  8444. }
  8445. }
  8446. },
  8447. "description": "List all workspaces.",
  8448. "summary": "List workspaces",
  8449. "x-codeSamples": [
  8450. {
  8451. "lang": "js",
  8452. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  8453. }
  8454. ]
  8455. },
  8456. "post": {
  8457. "tags": ["workspace"],
  8458. "operationId": "experimental.workspace.create",
  8459. "parameters": [
  8460. {
  8461. "name": "directory",
  8462. "in": "query",
  8463. "schema": {
  8464. "type": "string"
  8465. },
  8466. "required": false
  8467. },
  8468. {
  8469. "name": "workspace",
  8470. "in": "query",
  8471. "schema": {
  8472. "type": "string"
  8473. },
  8474. "required": false
  8475. }
  8476. ],
  8477. "responses": {
  8478. "200": {
  8479. "description": "Workspace created",
  8480. "content": {
  8481. "application/json": {
  8482. "schema": {
  8483. "$ref": "#/components/schemas/Workspace"
  8484. }
  8485. }
  8486. }
  8487. },
  8488. "400": {
  8489. "description": "Bad request",
  8490. "content": {
  8491. "application/json": {
  8492. "schema": {
  8493. "$ref": "#/components/schemas/BadRequestError"
  8494. }
  8495. }
  8496. }
  8497. }
  8498. },
  8499. "description": "Create a workspace for the current project.",
  8500. "summary": "Create workspace",
  8501. "requestBody": {
  8502. "content": {
  8503. "application/json": {
  8504. "schema": {
  8505. "type": "object",
  8506. "properties": {
  8507. "id": {
  8508. "type": "string",
  8509. "pattern": "^wrk"
  8510. },
  8511. "type": {
  8512. "type": "string"
  8513. },
  8514. "branch": {
  8515. "anyOf": [
  8516. {
  8517. "type": "string"
  8518. },
  8519. {
  8520. "type": "null"
  8521. }
  8522. ]
  8523. },
  8524. "extra": {
  8525. "anyOf": [
  8526. {},
  8527. {
  8528. "type": "null"
  8529. }
  8530. ]
  8531. }
  8532. },
  8533. "required": ["type", "branch"],
  8534. "additionalProperties": false
  8535. }
  8536. }
  8537. }
  8538. },
  8539. "x-codeSamples": [
  8540. {
  8541. "lang": "js",
  8542. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  8543. }
  8544. ]
  8545. }
  8546. },
  8547. "/experimental/workspace/sync-list": {
  8548. "post": {
  8549. "tags": ["workspace"],
  8550. "operationId": "experimental.workspace.syncList",
  8551. "parameters": [
  8552. {
  8553. "name": "directory",
  8554. "in": "query",
  8555. "schema": {
  8556. "type": "string"
  8557. },
  8558. "required": false
  8559. },
  8560. {
  8561. "name": "workspace",
  8562. "in": "query",
  8563. "schema": {
  8564. "type": "string"
  8565. },
  8566. "required": false
  8567. }
  8568. ],
  8569. "responses": {
  8570. "204": {
  8571. "description": "Workspace list synced"
  8572. }
  8573. },
  8574. "description": "Register missing workspaces returned by workspace adapters.",
  8575. "summary": "Sync workspace list",
  8576. "x-codeSamples": [
  8577. {
  8578. "lang": "js",
  8579. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.syncList({\n ...\n})"
  8580. }
  8581. ]
  8582. }
  8583. },
  8584. "/experimental/workspace/status": {
  8585. "get": {
  8586. "tags": ["workspace"],
  8587. "operationId": "experimental.workspace.status",
  8588. "parameters": [
  8589. {
  8590. "name": "directory",
  8591. "in": "query",
  8592. "schema": {
  8593. "type": "string"
  8594. },
  8595. "required": false
  8596. },
  8597. {
  8598. "name": "workspace",
  8599. "in": "query",
  8600. "schema": {
  8601. "type": "string"
  8602. },
  8603. "required": false
  8604. }
  8605. ],
  8606. "responses": {
  8607. "200": {
  8608. "description": "Workspace status",
  8609. "content": {
  8610. "application/json": {
  8611. "schema": {
  8612. "type": "array",
  8613. "items": {
  8614. "type": "object",
  8615. "properties": {
  8616. "workspaceID": {
  8617. "type": "string",
  8618. "pattern": "^wrk"
  8619. },
  8620. "status": {
  8621. "type": "string",
  8622. "enum": ["connected", "connecting", "disconnected", "error"]
  8623. }
  8624. },
  8625. "required": ["workspaceID", "status"],
  8626. "additionalProperties": false
  8627. },
  8628. "description": "Workspace status"
  8629. }
  8630. }
  8631. }
  8632. }
  8633. },
  8634. "description": "Get connection status for workspaces in the current project.",
  8635. "summary": "Workspace status",
  8636. "x-codeSamples": [
  8637. {
  8638. "lang": "js",
  8639. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  8640. }
  8641. ]
  8642. }
  8643. },
  8644. "/experimental/workspace/{id}": {
  8645. "delete": {
  8646. "tags": ["workspace"],
  8647. "operationId": "experimental.workspace.remove",
  8648. "parameters": [
  8649. {
  8650. "name": "id",
  8651. "in": "path",
  8652. "schema": {
  8653. "type": "string",
  8654. "pattern": "^wrk"
  8655. },
  8656. "required": true
  8657. },
  8658. {
  8659. "name": "directory",
  8660. "in": "query",
  8661. "schema": {
  8662. "type": "string"
  8663. },
  8664. "required": false
  8665. },
  8666. {
  8667. "name": "workspace",
  8668. "in": "query",
  8669. "schema": {
  8670. "type": "string"
  8671. },
  8672. "required": false
  8673. }
  8674. ],
  8675. "responses": {
  8676. "200": {
  8677. "description": "Workspace removed",
  8678. "content": {
  8679. "application/json": {
  8680. "schema": {
  8681. "$ref": "#/components/schemas/Workspace"
  8682. }
  8683. }
  8684. }
  8685. },
  8686. "400": {
  8687. "description": "Bad request",
  8688. "content": {
  8689. "application/json": {
  8690. "schema": {
  8691. "$ref": "#/components/schemas/BadRequestError"
  8692. }
  8693. }
  8694. }
  8695. }
  8696. },
  8697. "description": "Remove an existing workspace.",
  8698. "summary": "Remove workspace",
  8699. "x-codeSamples": [
  8700. {
  8701. "lang": "js",
  8702. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  8703. }
  8704. ]
  8705. }
  8706. },
  8707. "/experimental/workspace/warp": {
  8708. "post": {
  8709. "tags": ["workspace"],
  8710. "operationId": "experimental.workspace.warp",
  8711. "parameters": [
  8712. {
  8713. "name": "directory",
  8714. "in": "query",
  8715. "schema": {
  8716. "type": "string"
  8717. },
  8718. "required": false
  8719. },
  8720. {
  8721. "name": "workspace",
  8722. "in": "query",
  8723. "schema": {
  8724. "type": "string"
  8725. },
  8726. "required": false
  8727. }
  8728. ],
  8729. "responses": {
  8730. "204": {
  8731. "description": "Session warped"
  8732. },
  8733. "400": {
  8734. "description": "WorkspaceWarpError | VcsApplyError",
  8735. "content": {
  8736. "application/json": {
  8737. "schema": {
  8738. "anyOf": [
  8739. {
  8740. "$ref": "#/components/schemas/WorkspaceWarpError"
  8741. },
  8742. {
  8743. "$ref": "#/components/schemas/VcsApplyError"
  8744. }
  8745. ]
  8746. }
  8747. }
  8748. }
  8749. }
  8750. },
  8751. "description": "Move a session's sync history into the target workspace, or detach it to the local project.",
  8752. "summary": "Warp session into workspace",
  8753. "requestBody": {
  8754. "content": {
  8755. "application/json": {
  8756. "schema": {
  8757. "type": "object",
  8758. "properties": {
  8759. "id": {
  8760. "anyOf": [
  8761. {
  8762. "type": "string",
  8763. "pattern": "^wrk"
  8764. },
  8765. {
  8766. "type": "null"
  8767. }
  8768. ]
  8769. },
  8770. "sessionID": {
  8771. "type": "string",
  8772. "pattern": "^ses"
  8773. },
  8774. "copyChanges": {
  8775. "type": "boolean"
  8776. }
  8777. },
  8778. "required": ["id", "sessionID"],
  8779. "additionalProperties": false
  8780. }
  8781. }
  8782. }
  8783. },
  8784. "x-codeSamples": [
  8785. {
  8786. "lang": "js",
  8787. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.warp({\n ...\n})"
  8788. }
  8789. ]
  8790. }
  8791. },
  8792. "/pty/{ptyID}/connect": {
  8793. "get": {
  8794. "tags": ["pty"],
  8795. "operationId": "pty.connect",
  8796. "parameters": [
  8797. {
  8798. "name": "ptyID",
  8799. "in": "path",
  8800. "schema": {
  8801. "type": "string",
  8802. "pattern": "^pty"
  8803. },
  8804. "required": true
  8805. },
  8806. {
  8807. "name": "directory",
  8808. "in": "query",
  8809. "schema": {
  8810. "type": "string"
  8811. },
  8812. "required": false
  8813. },
  8814. {
  8815. "name": "workspace",
  8816. "in": "query",
  8817. "schema": {
  8818. "type": "string"
  8819. },
  8820. "required": false
  8821. }
  8822. ],
  8823. "responses": {
  8824. "200": {
  8825. "description": "Connected session",
  8826. "content": {
  8827. "application/json": {
  8828. "schema": {
  8829. "type": "boolean",
  8830. "description": "Connected session"
  8831. }
  8832. }
  8833. }
  8834. },
  8835. "403": {
  8836. "description": "Forbidden",
  8837. "content": {
  8838. "application/json": {
  8839. "schema": {
  8840. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  8841. }
  8842. }
  8843. }
  8844. },
  8845. "404": {
  8846. "description": "Not found",
  8847. "content": {
  8848. "application/json": {
  8849. "schema": {
  8850. "$ref": "#/components/schemas/NotFoundError"
  8851. }
  8852. }
  8853. }
  8854. }
  8855. },
  8856. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  8857. "summary": "Connect to PTY session",
  8858. "x-codeSamples": [
  8859. {
  8860. "lang": "js",
  8861. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  8862. }
  8863. ]
  8864. }
  8865. }
  8866. },
  8867. "components": {
  8868. "schemas": {
  8869. "Event": {
  8870. "anyOf": [
  8871. {
  8872. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  8873. },
  8874. {
  8875. "$ref": "#/components/schemas/EventFileEdited"
  8876. },
  8877. {
  8878. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  8879. },
  8880. {
  8881. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  8882. },
  8883. {
  8884. "$ref": "#/components/schemas/EventLspUpdated"
  8885. },
  8886. {
  8887. "$ref": "#/components/schemas/EventMessagePartDelta"
  8888. },
  8889. {
  8890. "$ref": "#/components/schemas/EventPermissionAsked"
  8891. },
  8892. {
  8893. "$ref": "#/components/schemas/EventPermissionReplied"
  8894. },
  8895. {
  8896. "$ref": "#/components/schemas/EventSessionDiff"
  8897. },
  8898. {
  8899. "$ref": "#/components/schemas/EventSessionError"
  8900. },
  8901. {
  8902. "$ref": "#/components/schemas/EventInstallationUpdated"
  8903. },
  8904. {
  8905. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  8906. },
  8907. {
  8908. "$ref": "#/components/schemas/EventQuestionAsked"
  8909. },
  8910. {
  8911. "$ref": "#/components/schemas/EventQuestionReplied"
  8912. },
  8913. {
  8914. "$ref": "#/components/schemas/EventQuestionRejected"
  8915. },
  8916. {
  8917. "$ref": "#/components/schemas/EventTodoUpdated"
  8918. },
  8919. {
  8920. "$ref": "#/components/schemas/EventSessionStatus"
  8921. },
  8922. {
  8923. "$ref": "#/components/schemas/EventSessionIdle"
  8924. },
  8925. {
  8926. "$ref": "#/components/schemas/EventSessionCompacted"
  8927. },
  8928. {
  8929. "$ref": "#/components/schemas/Event.tui.prompt.append"
  8930. },
  8931. {
  8932. "$ref": "#/components/schemas/Event.tui.command.execute"
  8933. },
  8934. {
  8935. "$ref": "#/components/schemas/EventTuiToastShow1"
  8936. },
  8937. {
  8938. "$ref": "#/components/schemas/Event.tui.session.select"
  8939. },
  8940. {
  8941. "$ref": "#/components/schemas/EventMcpToolsChanged"
  8942. },
  8943. {
  8944. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  8945. },
  8946. {
  8947. "$ref": "#/components/schemas/EventCommandExecuted"
  8948. },
  8949. {
  8950. "$ref": "#/components/schemas/EventProjectUpdated"
  8951. },
  8952. {
  8953. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  8954. },
  8955. {
  8956. "$ref": "#/components/schemas/EventWorkspaceReady"
  8957. },
  8958. {
  8959. "$ref": "#/components/schemas/EventWorkspaceFailed"
  8960. },
  8961. {
  8962. "$ref": "#/components/schemas/EventWorkspaceStatus"
  8963. },
  8964. {
  8965. "$ref": "#/components/schemas/EventWorktreeReady"
  8966. },
  8967. {
  8968. "$ref": "#/components/schemas/EventWorktreeFailed"
  8969. },
  8970. {
  8971. "$ref": "#/components/schemas/EventPtyCreated"
  8972. },
  8973. {
  8974. "$ref": "#/components/schemas/EventPtyUpdated"
  8975. },
  8976. {
  8977. "$ref": "#/components/schemas/EventPtyExited"
  8978. },
  8979. {
  8980. "$ref": "#/components/schemas/EventPtyDeleted"
  8981. },
  8982. {
  8983. "$ref": "#/components/schemas/EventMessageUpdated"
  8984. },
  8985. {
  8986. "$ref": "#/components/schemas/EventMessageRemoved"
  8987. },
  8988. {
  8989. "$ref": "#/components/schemas/EventMessagePartUpdated"
  8990. },
  8991. {
  8992. "$ref": "#/components/schemas/EventMessagePartRemoved"
  8993. },
  8994. {
  8995. "$ref": "#/components/schemas/EventSessionCreated"
  8996. },
  8997. {
  8998. "$ref": "#/components/schemas/EventSessionUpdated"
  8999. },
  9000. {
  9001. "$ref": "#/components/schemas/EventSessionDeleted"
  9002. },
  9003. {
  9004. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  9005. },
  9006. {
  9007. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  9008. },
  9009. {
  9010. "$ref": "#/components/schemas/EventSessionNextPrompted"
  9011. },
  9012. {
  9013. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  9014. },
  9015. {
  9016. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  9017. },
  9018. {
  9019. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  9020. },
  9021. {
  9022. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  9023. },
  9024. {
  9025. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  9026. },
  9027. {
  9028. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  9029. },
  9030. {
  9031. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  9032. },
  9033. {
  9034. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  9035. },
  9036. {
  9037. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  9038. },
  9039. {
  9040. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  9041. },
  9042. {
  9043. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  9044. },
  9045. {
  9046. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  9047. },
  9048. {
  9049. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  9050. },
  9051. {
  9052. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  9053. },
  9054. {
  9055. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  9056. },
  9057. {
  9058. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  9059. },
  9060. {
  9061. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  9062. },
  9063. {
  9064. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  9065. },
  9066. {
  9067. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  9068. },
  9069. {
  9070. "$ref": "#/components/schemas/EventSessionNextRetried"
  9071. },
  9072. {
  9073. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  9074. },
  9075. {
  9076. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  9077. },
  9078. {
  9079. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  9080. },
  9081. {
  9082. "$ref": "#/components/schemas/EventServerConnected"
  9083. },
  9084. {
  9085. "$ref": "#/components/schemas/EventGlobalDisposed"
  9086. }
  9087. ]
  9088. },
  9089. "OAuth": {
  9090. "type": "object",
  9091. "properties": {
  9092. "type": {
  9093. "type": "string",
  9094. "enum": ["oauth"]
  9095. },
  9096. "refresh": {
  9097. "type": "string"
  9098. },
  9099. "access": {
  9100. "type": "string"
  9101. },
  9102. "expires": {
  9103. "type": "integer",
  9104. "minimum": 0
  9105. },
  9106. "accountId": {
  9107. "type": "string"
  9108. },
  9109. "enterpriseUrl": {
  9110. "type": "string"
  9111. }
  9112. },
  9113. "required": ["type", "refresh", "access", "expires"],
  9114. "additionalProperties": false
  9115. },
  9116. "ApiAuth": {
  9117. "type": "object",
  9118. "properties": {
  9119. "type": {
  9120. "type": "string",
  9121. "enum": ["api"]
  9122. },
  9123. "key": {
  9124. "type": "string"
  9125. },
  9126. "metadata": {
  9127. "type": "object",
  9128. "additionalProperties": {
  9129. "type": "string"
  9130. }
  9131. }
  9132. },
  9133. "required": ["type", "key"],
  9134. "additionalProperties": false
  9135. },
  9136. "WellKnownAuth": {
  9137. "type": "object",
  9138. "properties": {
  9139. "type": {
  9140. "type": "string",
  9141. "enum": ["wellknown"]
  9142. },
  9143. "key": {
  9144. "type": "string"
  9145. },
  9146. "token": {
  9147. "type": "string"
  9148. }
  9149. },
  9150. "required": ["type", "key", "token"],
  9151. "additionalProperties": false
  9152. },
  9153. "Auth": {
  9154. "anyOf": [
  9155. {
  9156. "$ref": "#/components/schemas/OAuth"
  9157. },
  9158. {
  9159. "$ref": "#/components/schemas/ApiAuth"
  9160. },
  9161. {
  9162. "$ref": "#/components/schemas/WellKnownAuth"
  9163. }
  9164. ]
  9165. },
  9166. "PermissionRequest": {
  9167. "type": "object",
  9168. "properties": {
  9169. "id": {
  9170. "type": "string",
  9171. "pattern": "^per"
  9172. },
  9173. "sessionID": {
  9174. "type": "string",
  9175. "pattern": "^ses"
  9176. },
  9177. "permission": {
  9178. "type": "string"
  9179. },
  9180. "patterns": {
  9181. "type": "array",
  9182. "items": {
  9183. "type": "string"
  9184. }
  9185. },
  9186. "metadata": {
  9187. "type": "object"
  9188. },
  9189. "always": {
  9190. "type": "array",
  9191. "items": {
  9192. "type": "string"
  9193. }
  9194. },
  9195. "tool": {
  9196. "type": "object",
  9197. "properties": {
  9198. "messageID": {
  9199. "type": "string",
  9200. "pattern": "^msg"
  9201. },
  9202. "callID": {
  9203. "type": "string"
  9204. }
  9205. },
  9206. "required": ["messageID", "callID"],
  9207. "additionalProperties": false
  9208. }
  9209. },
  9210. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  9211. "additionalProperties": false
  9212. },
  9213. "SnapshotFileDiff": {
  9214. "type": "object",
  9215. "properties": {
  9216. "file": {
  9217. "type": "string"
  9218. },
  9219. "patch": {
  9220. "type": "string"
  9221. },
  9222. "additions": {
  9223. "type": "number"
  9224. },
  9225. "deletions": {
  9226. "type": "number"
  9227. },
  9228. "status": {
  9229. "type": "string",
  9230. "enum": ["added", "deleted", "modified"]
  9231. }
  9232. },
  9233. "required": ["additions", "deletions"],
  9234. "additionalProperties": false
  9235. },
  9236. "ProviderAuthError": {
  9237. "type": "object",
  9238. "properties": {
  9239. "name": {
  9240. "type": "string",
  9241. "enum": ["ProviderAuthError"]
  9242. },
  9243. "data": {
  9244. "type": "object",
  9245. "properties": {
  9246. "providerID": {
  9247. "type": "string"
  9248. },
  9249. "message": {
  9250. "type": "string"
  9251. }
  9252. },
  9253. "required": ["providerID", "message"],
  9254. "additionalProperties": false
  9255. }
  9256. },
  9257. "required": ["name", "data"],
  9258. "additionalProperties": false
  9259. },
  9260. "UnknownError": {
  9261. "type": "object",
  9262. "properties": {
  9263. "name": {
  9264. "type": "string",
  9265. "enum": ["UnknownError"]
  9266. },
  9267. "data": {
  9268. "type": "object",
  9269. "properties": {
  9270. "message": {
  9271. "type": "string"
  9272. }
  9273. },
  9274. "required": ["message"],
  9275. "additionalProperties": false
  9276. }
  9277. },
  9278. "required": ["name", "data"],
  9279. "additionalProperties": false
  9280. },
  9281. "MessageOutputLengthError": {
  9282. "type": "object",
  9283. "properties": {
  9284. "name": {
  9285. "type": "string",
  9286. "enum": ["MessageOutputLengthError"]
  9287. },
  9288. "data": {
  9289. "type": "object",
  9290. "properties": {}
  9291. }
  9292. },
  9293. "required": ["name", "data"],
  9294. "additionalProperties": false
  9295. },
  9296. "MessageAbortedError": {
  9297. "type": "object",
  9298. "properties": {
  9299. "name": {
  9300. "type": "string",
  9301. "enum": ["MessageAbortedError"]
  9302. },
  9303. "data": {
  9304. "type": "object",
  9305. "properties": {
  9306. "message": {
  9307. "type": "string"
  9308. }
  9309. },
  9310. "required": ["message"],
  9311. "additionalProperties": false
  9312. }
  9313. },
  9314. "required": ["name", "data"],
  9315. "additionalProperties": false
  9316. },
  9317. "StructuredOutputError": {
  9318. "type": "object",
  9319. "properties": {
  9320. "name": {
  9321. "type": "string",
  9322. "enum": ["StructuredOutputError"]
  9323. },
  9324. "data": {
  9325. "type": "object",
  9326. "properties": {
  9327. "message": {
  9328. "type": "string"
  9329. },
  9330. "retries": {
  9331. "type": "integer",
  9332. "minimum": 0
  9333. }
  9334. },
  9335. "required": ["message", "retries"],
  9336. "additionalProperties": false
  9337. }
  9338. },
  9339. "required": ["name", "data"],
  9340. "additionalProperties": false
  9341. },
  9342. "ContextOverflowError": {
  9343. "type": "object",
  9344. "properties": {
  9345. "name": {
  9346. "type": "string",
  9347. "enum": ["ContextOverflowError"]
  9348. },
  9349. "data": {
  9350. "type": "object",
  9351. "properties": {
  9352. "message": {
  9353. "type": "string"
  9354. },
  9355. "responseBody": {
  9356. "type": "string"
  9357. }
  9358. },
  9359. "required": ["message"],
  9360. "additionalProperties": false
  9361. }
  9362. },
  9363. "required": ["name", "data"],
  9364. "additionalProperties": false
  9365. },
  9366. "APIError": {
  9367. "type": "object",
  9368. "properties": {
  9369. "name": {
  9370. "type": "string",
  9371. "enum": ["APIError"]
  9372. },
  9373. "data": {
  9374. "type": "object",
  9375. "properties": {
  9376. "message": {
  9377. "type": "string"
  9378. },
  9379. "statusCode": {
  9380. "type": "integer",
  9381. "minimum": 0
  9382. },
  9383. "isRetryable": {
  9384. "type": "boolean"
  9385. },
  9386. "responseHeaders": {
  9387. "type": "object",
  9388. "additionalProperties": {
  9389. "type": "string"
  9390. }
  9391. },
  9392. "responseBody": {
  9393. "type": "string"
  9394. },
  9395. "metadata": {
  9396. "type": "object",
  9397. "additionalProperties": {
  9398. "type": "string"
  9399. }
  9400. }
  9401. },
  9402. "required": ["message", "isRetryable"],
  9403. "additionalProperties": false
  9404. }
  9405. },
  9406. "required": ["name", "data"],
  9407. "additionalProperties": false
  9408. },
  9409. "QuestionOption": {
  9410. "type": "object",
  9411. "properties": {
  9412. "label": {
  9413. "type": "string",
  9414. "description": "Display text (1-5 words, concise)"
  9415. },
  9416. "description": {
  9417. "type": "string",
  9418. "description": "Explanation of choice"
  9419. }
  9420. },
  9421. "required": ["label", "description"],
  9422. "additionalProperties": false
  9423. },
  9424. "QuestionInfo": {
  9425. "type": "object",
  9426. "properties": {
  9427. "question": {
  9428. "type": "string",
  9429. "description": "Complete question"
  9430. },
  9431. "header": {
  9432. "type": "string",
  9433. "description": "Very short label (max 30 chars)"
  9434. },
  9435. "options": {
  9436. "type": "array",
  9437. "items": {
  9438. "$ref": "#/components/schemas/QuestionOption"
  9439. },
  9440. "description": "Available choices"
  9441. },
  9442. "multiple": {
  9443. "type": "boolean"
  9444. },
  9445. "custom": {
  9446. "type": "boolean"
  9447. }
  9448. },
  9449. "required": ["question", "header", "options"],
  9450. "additionalProperties": false
  9451. },
  9452. "QuestionTool": {
  9453. "type": "object",
  9454. "properties": {
  9455. "messageID": {
  9456. "type": "string",
  9457. "pattern": "^msg"
  9458. },
  9459. "callID": {
  9460. "type": "string"
  9461. }
  9462. },
  9463. "required": ["messageID", "callID"],
  9464. "additionalProperties": false
  9465. },
  9466. "QuestionRequest": {
  9467. "type": "object",
  9468. "properties": {
  9469. "id": {
  9470. "type": "string",
  9471. "pattern": "^que"
  9472. },
  9473. "sessionID": {
  9474. "type": "string",
  9475. "pattern": "^ses"
  9476. },
  9477. "questions": {
  9478. "type": "array",
  9479. "items": {
  9480. "$ref": "#/components/schemas/QuestionInfo"
  9481. },
  9482. "description": "Questions to ask"
  9483. },
  9484. "tool": {
  9485. "$ref": "#/components/schemas/QuestionTool"
  9486. }
  9487. },
  9488. "required": ["id", "sessionID", "questions"],
  9489. "additionalProperties": false
  9490. },
  9491. "QuestionAnswer": {
  9492. "type": "array",
  9493. "items": {
  9494. "type": "string"
  9495. }
  9496. },
  9497. "QuestionReplied": {
  9498. "type": "object",
  9499. "properties": {
  9500. "sessionID": {
  9501. "type": "string",
  9502. "pattern": "^ses"
  9503. },
  9504. "requestID": {
  9505. "type": "string",
  9506. "pattern": "^que"
  9507. },
  9508. "answers": {
  9509. "type": "array",
  9510. "items": {
  9511. "$ref": "#/components/schemas/QuestionAnswer"
  9512. }
  9513. }
  9514. },
  9515. "required": ["sessionID", "requestID", "answers"],
  9516. "additionalProperties": false
  9517. },
  9518. "QuestionRejected": {
  9519. "type": "object",
  9520. "properties": {
  9521. "sessionID": {
  9522. "type": "string",
  9523. "pattern": "^ses"
  9524. },
  9525. "requestID": {
  9526. "type": "string",
  9527. "pattern": "^que"
  9528. }
  9529. },
  9530. "required": ["sessionID", "requestID"],
  9531. "additionalProperties": false
  9532. },
  9533. "Todo": {
  9534. "type": "object",
  9535. "properties": {
  9536. "content": {
  9537. "type": "string",
  9538. "description": "Brief description of the task"
  9539. },
  9540. "status": {
  9541. "type": "string",
  9542. "description": "Current status of the task: pending, in_progress, completed, cancelled"
  9543. },
  9544. "priority": {
  9545. "type": "string",
  9546. "description": "Priority level of the task: high, medium, low"
  9547. }
  9548. },
  9549. "required": ["content", "status", "priority"],
  9550. "additionalProperties": false
  9551. },
  9552. "SessionStatus": {
  9553. "anyOf": [
  9554. {
  9555. "type": "object",
  9556. "properties": {
  9557. "type": {
  9558. "type": "string",
  9559. "enum": ["idle"]
  9560. }
  9561. },
  9562. "required": ["type"],
  9563. "additionalProperties": false
  9564. },
  9565. {
  9566. "type": "object",
  9567. "properties": {
  9568. "type": {
  9569. "type": "string",
  9570. "enum": ["retry"]
  9571. },
  9572. "attempt": {
  9573. "type": "integer",
  9574. "minimum": 0
  9575. },
  9576. "message": {
  9577. "type": "string"
  9578. },
  9579. "action": {
  9580. "type": "object",
  9581. "properties": {
  9582. "reason": {
  9583. "type": "string"
  9584. },
  9585. "provider": {
  9586. "type": "string"
  9587. },
  9588. "title": {
  9589. "type": "string"
  9590. },
  9591. "message": {
  9592. "type": "string"
  9593. },
  9594. "label": {
  9595. "type": "string"
  9596. },
  9597. "link": {
  9598. "type": "string"
  9599. }
  9600. },
  9601. "required": ["reason", "provider", "title", "message", "label"],
  9602. "additionalProperties": false
  9603. },
  9604. "next": {
  9605. "type": "integer",
  9606. "minimum": 0
  9607. }
  9608. },
  9609. "required": ["type", "attempt", "message", "next"],
  9610. "additionalProperties": false
  9611. },
  9612. {
  9613. "type": "object",
  9614. "properties": {
  9615. "type": {
  9616. "type": "string",
  9617. "enum": ["busy"]
  9618. }
  9619. },
  9620. "required": ["type"],
  9621. "additionalProperties": false
  9622. }
  9623. ]
  9624. },
  9625. "Event.tui.prompt.append": {
  9626. "type": "object",
  9627. "properties": {
  9628. "id": {
  9629. "type": "string"
  9630. },
  9631. "type": {
  9632. "type": "string",
  9633. "enum": ["tui.prompt.append"]
  9634. },
  9635. "properties": {
  9636. "type": "object",
  9637. "properties": {
  9638. "text": {
  9639. "type": "string"
  9640. }
  9641. },
  9642. "required": ["text"],
  9643. "additionalProperties": false
  9644. }
  9645. },
  9646. "required": ["id", "type", "properties"],
  9647. "additionalProperties": false
  9648. },
  9649. "Event.tui.command.execute": {
  9650. "type": "object",
  9651. "properties": {
  9652. "id": {
  9653. "type": "string"
  9654. },
  9655. "type": {
  9656. "type": "string",
  9657. "enum": ["tui.command.execute"]
  9658. },
  9659. "properties": {
  9660. "type": "object",
  9661. "properties": {
  9662. "command": {
  9663. "anyOf": [
  9664. {
  9665. "type": "string",
  9666. "enum": [
  9667. "session.list",
  9668. "session.new",
  9669. "session.share",
  9670. "session.interrupt",
  9671. "session.compact",
  9672. "session.page.up",
  9673. "session.page.down",
  9674. "session.line.up",
  9675. "session.line.down",
  9676. "session.half.page.up",
  9677. "session.half.page.down",
  9678. "session.first",
  9679. "session.last",
  9680. "prompt.clear",
  9681. "prompt.submit",
  9682. "agent.cycle"
  9683. ]
  9684. },
  9685. {
  9686. "type": "string"
  9687. }
  9688. ]
  9689. }
  9690. },
  9691. "required": ["command"],
  9692. "additionalProperties": false
  9693. }
  9694. },
  9695. "required": ["id", "type", "properties"],
  9696. "additionalProperties": false
  9697. },
  9698. "Event.tui.toast.show": {
  9699. "type": "object",
  9700. "properties": {
  9701. "id": {
  9702. "type": "string"
  9703. },
  9704. "type": {
  9705. "type": "string",
  9706. "enum": ["tui.toast.show"]
  9707. },
  9708. "properties": {
  9709. "type": "object",
  9710. "properties": {
  9711. "title": {
  9712. "type": "string"
  9713. },
  9714. "message": {
  9715. "type": "string"
  9716. },
  9717. "variant": {
  9718. "type": "string",
  9719. "enum": ["info", "success", "warning", "error"]
  9720. },
  9721. "duration": {
  9722. "type": "integer",
  9723. "exclusiveMinimum": 0
  9724. }
  9725. },
  9726. "required": ["message", "variant"],
  9727. "additionalProperties": false
  9728. }
  9729. },
  9730. "required": ["id", "type", "properties"],
  9731. "additionalProperties": false
  9732. },
  9733. "Event.tui.session.select": {
  9734. "type": "object",
  9735. "properties": {
  9736. "id": {
  9737. "type": "string"
  9738. },
  9739. "type": {
  9740. "type": "string",
  9741. "enum": ["tui.session.select"]
  9742. },
  9743. "properties": {
  9744. "type": "object",
  9745. "properties": {
  9746. "sessionID": {
  9747. "type": "string",
  9748. "pattern": "^ses",
  9749. "description": "Session ID to navigate to"
  9750. }
  9751. },
  9752. "required": ["sessionID"],
  9753. "additionalProperties": false
  9754. }
  9755. },
  9756. "required": ["id", "type", "properties"],
  9757. "additionalProperties": false
  9758. },
  9759. "Project": {
  9760. "type": "object",
  9761. "properties": {
  9762. "id": {
  9763. "type": "string"
  9764. },
  9765. "worktree": {
  9766. "type": "string"
  9767. },
  9768. "vcs": {
  9769. "type": "string",
  9770. "enum": ["git"]
  9771. },
  9772. "name": {
  9773. "type": "string"
  9774. },
  9775. "icon": {
  9776. "type": "object",
  9777. "properties": {
  9778. "url": {
  9779. "type": "string"
  9780. },
  9781. "override": {
  9782. "type": "string"
  9783. },
  9784. "color": {
  9785. "type": "string"
  9786. }
  9787. },
  9788. "additionalProperties": false
  9789. },
  9790. "commands": {
  9791. "type": "object",
  9792. "properties": {
  9793. "start": {
  9794. "type": "string",
  9795. "description": "Startup script to run when creating a new workspace (worktree)"
  9796. }
  9797. },
  9798. "additionalProperties": false
  9799. },
  9800. "time": {
  9801. "type": "object",
  9802. "properties": {
  9803. "created": {
  9804. "type": "integer",
  9805. "minimum": 0
  9806. },
  9807. "updated": {
  9808. "type": "integer",
  9809. "minimum": 0
  9810. },
  9811. "initialized": {
  9812. "type": "integer",
  9813. "minimum": 0
  9814. }
  9815. },
  9816. "required": ["created", "updated"],
  9817. "additionalProperties": false
  9818. },
  9819. "sandboxes": {
  9820. "type": "array",
  9821. "items": {
  9822. "type": "string"
  9823. }
  9824. }
  9825. },
  9826. "required": ["id", "worktree", "time", "sandboxes"],
  9827. "additionalProperties": false
  9828. },
  9829. "Pty": {
  9830. "type": "object",
  9831. "properties": {
  9832. "id": {
  9833. "type": "string",
  9834. "pattern": "^pty"
  9835. },
  9836. "title": {
  9837. "type": "string"
  9838. },
  9839. "command": {
  9840. "type": "string"
  9841. },
  9842. "args": {
  9843. "type": "array",
  9844. "items": {
  9845. "type": "string"
  9846. }
  9847. },
  9848. "cwd": {
  9849. "type": "string"
  9850. },
  9851. "status": {
  9852. "type": "string",
  9853. "enum": ["running", "exited"]
  9854. },
  9855. "pid": {
  9856. "type": "integer",
  9857. "exclusiveMinimum": 0
  9858. }
  9859. },
  9860. "required": ["id", "title", "command", "args", "cwd", "status", "pid"],
  9861. "additionalProperties": false
  9862. },
  9863. "OutputFormatText": {
  9864. "type": "object",
  9865. "properties": {
  9866. "type": {
  9867. "type": "string",
  9868. "enum": ["text"]
  9869. }
  9870. },
  9871. "required": ["type"],
  9872. "additionalProperties": false
  9873. },
  9874. "JSONSchema": {
  9875. "type": "object"
  9876. },
  9877. "OutputFormatJsonSchema": {
  9878. "type": "object",
  9879. "properties": {
  9880. "type": {
  9881. "type": "string",
  9882. "enum": ["json_schema"]
  9883. },
  9884. "schema": {
  9885. "$ref": "#/components/schemas/JSONSchema"
  9886. },
  9887. "retryCount": {
  9888. "type": "integer",
  9889. "minimum": 0
  9890. }
  9891. },
  9892. "required": ["type", "schema"],
  9893. "additionalProperties": false
  9894. },
  9895. "OutputFormat": {
  9896. "anyOf": [
  9897. {
  9898. "$ref": "#/components/schemas/OutputFormatText"
  9899. },
  9900. {
  9901. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  9902. }
  9903. ]
  9904. },
  9905. "UserMessage": {
  9906. "type": "object",
  9907. "properties": {
  9908. "id": {
  9909. "type": "string",
  9910. "pattern": "^msg"
  9911. },
  9912. "sessionID": {
  9913. "type": "string",
  9914. "pattern": "^ses"
  9915. },
  9916. "role": {
  9917. "type": "string",
  9918. "enum": ["user"]
  9919. },
  9920. "time": {
  9921. "type": "object",
  9922. "properties": {
  9923. "created": {
  9924. "type": "integer",
  9925. "minimum": 0
  9926. }
  9927. },
  9928. "required": ["created"],
  9929. "additionalProperties": false
  9930. },
  9931. "format": {
  9932. "$ref": "#/components/schemas/OutputFormat"
  9933. },
  9934. "summary": {
  9935. "type": "object",
  9936. "properties": {
  9937. "title": {
  9938. "type": "string"
  9939. },
  9940. "body": {
  9941. "type": "string"
  9942. },
  9943. "diffs": {
  9944. "type": "array",
  9945. "items": {
  9946. "$ref": "#/components/schemas/SnapshotFileDiff"
  9947. }
  9948. }
  9949. },
  9950. "required": ["diffs"],
  9951. "additionalProperties": false
  9952. },
  9953. "agent": {
  9954. "type": "string"
  9955. },
  9956. "model": {
  9957. "type": "object",
  9958. "properties": {
  9959. "providerID": {
  9960. "type": "string"
  9961. },
  9962. "modelID": {
  9963. "type": "string"
  9964. },
  9965. "variant": {
  9966. "type": "string"
  9967. }
  9968. },
  9969. "required": ["providerID", "modelID"],
  9970. "additionalProperties": false
  9971. },
  9972. "system": {
  9973. "type": "string"
  9974. },
  9975. "tools": {
  9976. "type": "object",
  9977. "additionalProperties": {
  9978. "type": "boolean"
  9979. }
  9980. }
  9981. },
  9982. "required": ["id", "sessionID", "role", "time", "agent", "model"],
  9983. "additionalProperties": false
  9984. },
  9985. "AssistantMessage": {
  9986. "type": "object",
  9987. "properties": {
  9988. "id": {
  9989. "type": "string",
  9990. "pattern": "^msg"
  9991. },
  9992. "sessionID": {
  9993. "type": "string",
  9994. "pattern": "^ses"
  9995. },
  9996. "role": {
  9997. "type": "string",
  9998. "enum": ["assistant"]
  9999. },
  10000. "time": {
  10001. "type": "object",
  10002. "properties": {
  10003. "created": {
  10004. "type": "integer",
  10005. "minimum": 0
  10006. },
  10007. "completed": {
  10008. "type": "integer",
  10009. "minimum": 0
  10010. }
  10011. },
  10012. "required": ["created"],
  10013. "additionalProperties": false
  10014. },
  10015. "error": {
  10016. "anyOf": [
  10017. {
  10018. "$ref": "#/components/schemas/ProviderAuthError"
  10019. },
  10020. {
  10021. "$ref": "#/components/schemas/UnknownError"
  10022. },
  10023. {
  10024. "$ref": "#/components/schemas/MessageOutputLengthError"
  10025. },
  10026. {
  10027. "$ref": "#/components/schemas/MessageAbortedError"
  10028. },
  10029. {
  10030. "$ref": "#/components/schemas/StructuredOutputError"
  10031. },
  10032. {
  10033. "$ref": "#/components/schemas/ContextOverflowError"
  10034. },
  10035. {
  10036. "$ref": "#/components/schemas/APIError"
  10037. }
  10038. ]
  10039. },
  10040. "parentID": {
  10041. "type": "string",
  10042. "pattern": "^msg"
  10043. },
  10044. "modelID": {
  10045. "type": "string"
  10046. },
  10047. "providerID": {
  10048. "type": "string"
  10049. },
  10050. "mode": {
  10051. "type": "string"
  10052. },
  10053. "agent": {
  10054. "type": "string"
  10055. },
  10056. "path": {
  10057. "type": "object",
  10058. "properties": {
  10059. "cwd": {
  10060. "type": "string"
  10061. },
  10062. "root": {
  10063. "type": "string"
  10064. }
  10065. },
  10066. "required": ["cwd", "root"],
  10067. "additionalProperties": false
  10068. },
  10069. "summary": {
  10070. "type": "boolean"
  10071. },
  10072. "cost": {
  10073. "type": "number"
  10074. },
  10075. "tokens": {
  10076. "type": "object",
  10077. "properties": {
  10078. "total": {
  10079. "type": "number"
  10080. },
  10081. "input": {
  10082. "type": "number"
  10083. },
  10084. "output": {
  10085. "type": "number"
  10086. },
  10087. "reasoning": {
  10088. "type": "number"
  10089. },
  10090. "cache": {
  10091. "type": "object",
  10092. "properties": {
  10093. "read": {
  10094. "type": "number"
  10095. },
  10096. "write": {
  10097. "type": "number"
  10098. }
  10099. },
  10100. "required": ["read", "write"],
  10101. "additionalProperties": false
  10102. }
  10103. },
  10104. "required": ["input", "output", "reasoning", "cache"],
  10105. "additionalProperties": false
  10106. },
  10107. "structured": {},
  10108. "variant": {
  10109. "type": "string"
  10110. },
  10111. "finish": {
  10112. "type": "string"
  10113. }
  10114. },
  10115. "required": [
  10116. "id",
  10117. "sessionID",
  10118. "role",
  10119. "time",
  10120. "parentID",
  10121. "modelID",
  10122. "providerID",
  10123. "mode",
  10124. "agent",
  10125. "path",
  10126. "cost",
  10127. "tokens"
  10128. ],
  10129. "additionalProperties": false
  10130. },
  10131. "Message": {
  10132. "anyOf": [
  10133. {
  10134. "$ref": "#/components/schemas/UserMessage"
  10135. },
  10136. {
  10137. "$ref": "#/components/schemas/AssistantMessage"
  10138. }
  10139. ]
  10140. },
  10141. "TextPart": {
  10142. "type": "object",
  10143. "properties": {
  10144. "id": {
  10145. "type": "string",
  10146. "pattern": "^prt"
  10147. },
  10148. "sessionID": {
  10149. "type": "string",
  10150. "pattern": "^ses"
  10151. },
  10152. "messageID": {
  10153. "type": "string",
  10154. "pattern": "^msg"
  10155. },
  10156. "type": {
  10157. "type": "string",
  10158. "enum": ["text"]
  10159. },
  10160. "text": {
  10161. "type": "string"
  10162. },
  10163. "synthetic": {
  10164. "type": "boolean"
  10165. },
  10166. "ignored": {
  10167. "type": "boolean"
  10168. },
  10169. "time": {
  10170. "type": "object",
  10171. "properties": {
  10172. "start": {
  10173. "type": "integer",
  10174. "minimum": 0
  10175. },
  10176. "end": {
  10177. "type": "integer",
  10178. "minimum": 0
  10179. }
  10180. },
  10181. "required": ["start"],
  10182. "additionalProperties": false
  10183. },
  10184. "metadata": {
  10185. "type": "object"
  10186. }
  10187. },
  10188. "required": ["id", "sessionID", "messageID", "type", "text"],
  10189. "additionalProperties": false
  10190. },
  10191. "SubtaskPart": {
  10192. "type": "object",
  10193. "properties": {
  10194. "id": {
  10195. "type": "string",
  10196. "pattern": "^prt"
  10197. },
  10198. "sessionID": {
  10199. "type": "string",
  10200. "pattern": "^ses"
  10201. },
  10202. "messageID": {
  10203. "type": "string",
  10204. "pattern": "^msg"
  10205. },
  10206. "type": {
  10207. "type": "string",
  10208. "enum": ["subtask"]
  10209. },
  10210. "prompt": {
  10211. "type": "string"
  10212. },
  10213. "description": {
  10214. "type": "string"
  10215. },
  10216. "agent": {
  10217. "type": "string"
  10218. },
  10219. "model": {
  10220. "type": "object",
  10221. "properties": {
  10222. "providerID": {
  10223. "type": "string"
  10224. },
  10225. "modelID": {
  10226. "type": "string"
  10227. }
  10228. },
  10229. "required": ["providerID", "modelID"],
  10230. "additionalProperties": false
  10231. },
  10232. "command": {
  10233. "type": "string"
  10234. }
  10235. },
  10236. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"],
  10237. "additionalProperties": false
  10238. },
  10239. "ReasoningPart": {
  10240. "type": "object",
  10241. "properties": {
  10242. "id": {
  10243. "type": "string",
  10244. "pattern": "^prt"
  10245. },
  10246. "sessionID": {
  10247. "type": "string",
  10248. "pattern": "^ses"
  10249. },
  10250. "messageID": {
  10251. "type": "string",
  10252. "pattern": "^msg"
  10253. },
  10254. "type": {
  10255. "type": "string",
  10256. "enum": ["reasoning"]
  10257. },
  10258. "text": {
  10259. "type": "string"
  10260. },
  10261. "metadata": {
  10262. "type": "object"
  10263. },
  10264. "time": {
  10265. "type": "object",
  10266. "properties": {
  10267. "start": {
  10268. "type": "integer",
  10269. "minimum": 0
  10270. },
  10271. "end": {
  10272. "type": "integer",
  10273. "minimum": 0
  10274. }
  10275. },
  10276. "required": ["start"],
  10277. "additionalProperties": false
  10278. }
  10279. },
  10280. "required": ["id", "sessionID", "messageID", "type", "text", "time"],
  10281. "additionalProperties": false
  10282. },
  10283. "FilePartSourceText": {
  10284. "type": "object",
  10285. "properties": {
  10286. "value": {
  10287. "type": "string"
  10288. },
  10289. "start": {
  10290. "type": "number"
  10291. },
  10292. "end": {
  10293. "type": "number"
  10294. }
  10295. },
  10296. "required": ["value", "start", "end"],
  10297. "additionalProperties": false
  10298. },
  10299. "FileSource": {
  10300. "type": "object",
  10301. "properties": {
  10302. "text": {
  10303. "$ref": "#/components/schemas/FilePartSourceText"
  10304. },
  10305. "type": {
  10306. "type": "string",
  10307. "enum": ["file"]
  10308. },
  10309. "path": {
  10310. "type": "string"
  10311. }
  10312. },
  10313. "required": ["text", "type", "path"],
  10314. "additionalProperties": false
  10315. },
  10316. "Range": {
  10317. "type": "object",
  10318. "properties": {
  10319. "start": {
  10320. "type": "object",
  10321. "properties": {
  10322. "line": {
  10323. "type": "integer",
  10324. "minimum": 0
  10325. },
  10326. "character": {
  10327. "type": "integer",
  10328. "minimum": 0
  10329. }
  10330. },
  10331. "required": ["line", "character"],
  10332. "additionalProperties": false
  10333. },
  10334. "end": {
  10335. "type": "object",
  10336. "properties": {
  10337. "line": {
  10338. "type": "integer",
  10339. "minimum": 0
  10340. },
  10341. "character": {
  10342. "type": "integer",
  10343. "minimum": 0
  10344. }
  10345. },
  10346. "required": ["line", "character"],
  10347. "additionalProperties": false
  10348. }
  10349. },
  10350. "required": ["start", "end"],
  10351. "additionalProperties": false
  10352. },
  10353. "SymbolSource": {
  10354. "type": "object",
  10355. "properties": {
  10356. "text": {
  10357. "$ref": "#/components/schemas/FilePartSourceText"
  10358. },
  10359. "type": {
  10360. "type": "string",
  10361. "enum": ["symbol"]
  10362. },
  10363. "path": {
  10364. "type": "string"
  10365. },
  10366. "range": {
  10367. "$ref": "#/components/schemas/Range"
  10368. },
  10369. "name": {
  10370. "type": "string"
  10371. },
  10372. "kind": {
  10373. "type": "integer",
  10374. "minimum": 0
  10375. }
  10376. },
  10377. "required": ["text", "type", "path", "range", "name", "kind"],
  10378. "additionalProperties": false
  10379. },
  10380. "ResourceSource": {
  10381. "type": "object",
  10382. "properties": {
  10383. "text": {
  10384. "$ref": "#/components/schemas/FilePartSourceText"
  10385. },
  10386. "type": {
  10387. "type": "string",
  10388. "enum": ["resource"]
  10389. },
  10390. "clientName": {
  10391. "type": "string"
  10392. },
  10393. "uri": {
  10394. "type": "string"
  10395. }
  10396. },
  10397. "required": ["text", "type", "clientName", "uri"],
  10398. "additionalProperties": false
  10399. },
  10400. "FilePartSource": {
  10401. "anyOf": [
  10402. {
  10403. "$ref": "#/components/schemas/FileSource"
  10404. },
  10405. {
  10406. "$ref": "#/components/schemas/SymbolSource"
  10407. },
  10408. {
  10409. "$ref": "#/components/schemas/ResourceSource"
  10410. }
  10411. ]
  10412. },
  10413. "FilePart": {
  10414. "type": "object",
  10415. "properties": {
  10416. "id": {
  10417. "type": "string",
  10418. "pattern": "^prt"
  10419. },
  10420. "sessionID": {
  10421. "type": "string",
  10422. "pattern": "^ses"
  10423. },
  10424. "messageID": {
  10425. "type": "string",
  10426. "pattern": "^msg"
  10427. },
  10428. "type": {
  10429. "type": "string",
  10430. "enum": ["file"]
  10431. },
  10432. "mime": {
  10433. "type": "string"
  10434. },
  10435. "filename": {
  10436. "type": "string"
  10437. },
  10438. "url": {
  10439. "type": "string"
  10440. },
  10441. "source": {
  10442. "$ref": "#/components/schemas/FilePartSource"
  10443. }
  10444. },
  10445. "required": ["id", "sessionID", "messageID", "type", "mime", "url"],
  10446. "additionalProperties": false
  10447. },
  10448. "ToolStatePending": {
  10449. "type": "object",
  10450. "properties": {
  10451. "status": {
  10452. "type": "string",
  10453. "enum": ["pending"]
  10454. },
  10455. "input": {
  10456. "type": "object"
  10457. },
  10458. "raw": {
  10459. "type": "string"
  10460. }
  10461. },
  10462. "required": ["status", "input", "raw"],
  10463. "additionalProperties": false
  10464. },
  10465. "ToolStateRunning": {
  10466. "type": "object",
  10467. "properties": {
  10468. "status": {
  10469. "type": "string",
  10470. "enum": ["running"]
  10471. },
  10472. "input": {
  10473. "type": "object"
  10474. },
  10475. "title": {
  10476. "type": "string"
  10477. },
  10478. "metadata": {
  10479. "type": "object"
  10480. },
  10481. "time": {
  10482. "type": "object",
  10483. "properties": {
  10484. "start": {
  10485. "type": "integer",
  10486. "minimum": 0
  10487. }
  10488. },
  10489. "required": ["start"],
  10490. "additionalProperties": false
  10491. }
  10492. },
  10493. "required": ["status", "input", "time"],
  10494. "additionalProperties": false
  10495. },
  10496. "ToolStateCompleted": {
  10497. "type": "object",
  10498. "properties": {
  10499. "status": {
  10500. "type": "string",
  10501. "enum": ["completed"]
  10502. },
  10503. "input": {
  10504. "type": "object"
  10505. },
  10506. "output": {
  10507. "type": "string"
  10508. },
  10509. "title": {
  10510. "type": "string"
  10511. },
  10512. "metadata": {
  10513. "type": "object"
  10514. },
  10515. "time": {
  10516. "type": "object",
  10517. "properties": {
  10518. "start": {
  10519. "type": "integer",
  10520. "minimum": 0
  10521. },
  10522. "end": {
  10523. "type": "integer",
  10524. "minimum": 0
  10525. },
  10526. "compacted": {
  10527. "type": "integer",
  10528. "minimum": 0
  10529. }
  10530. },
  10531. "required": ["start", "end"],
  10532. "additionalProperties": false
  10533. },
  10534. "attachments": {
  10535. "type": "array",
  10536. "items": {
  10537. "$ref": "#/components/schemas/FilePart"
  10538. }
  10539. }
  10540. },
  10541. "required": ["status", "input", "output", "title", "metadata", "time"],
  10542. "additionalProperties": false
  10543. },
  10544. "ToolStateError": {
  10545. "type": "object",
  10546. "properties": {
  10547. "status": {
  10548. "type": "string",
  10549. "enum": ["error"]
  10550. },
  10551. "input": {
  10552. "type": "object"
  10553. },
  10554. "error": {
  10555. "type": "string"
  10556. },
  10557. "metadata": {
  10558. "type": "object"
  10559. },
  10560. "time": {
  10561. "type": "object",
  10562. "properties": {
  10563. "start": {
  10564. "type": "integer",
  10565. "minimum": 0
  10566. },
  10567. "end": {
  10568. "type": "integer",
  10569. "minimum": 0
  10570. }
  10571. },
  10572. "required": ["start", "end"],
  10573. "additionalProperties": false
  10574. }
  10575. },
  10576. "required": ["status", "input", "error", "time"],
  10577. "additionalProperties": false
  10578. },
  10579. "ToolState": {
  10580. "anyOf": [
  10581. {
  10582. "$ref": "#/components/schemas/ToolStatePending"
  10583. },
  10584. {
  10585. "$ref": "#/components/schemas/ToolStateRunning"
  10586. },
  10587. {
  10588. "$ref": "#/components/schemas/ToolStateCompleted"
  10589. },
  10590. {
  10591. "$ref": "#/components/schemas/ToolStateError"
  10592. }
  10593. ]
  10594. },
  10595. "ToolPart": {
  10596. "type": "object",
  10597. "properties": {
  10598. "id": {
  10599. "type": "string",
  10600. "pattern": "^prt"
  10601. },
  10602. "sessionID": {
  10603. "type": "string",
  10604. "pattern": "^ses"
  10605. },
  10606. "messageID": {
  10607. "type": "string",
  10608. "pattern": "^msg"
  10609. },
  10610. "type": {
  10611. "type": "string",
  10612. "enum": ["tool"]
  10613. },
  10614. "callID": {
  10615. "type": "string"
  10616. },
  10617. "tool": {
  10618. "type": "string"
  10619. },
  10620. "state": {
  10621. "$ref": "#/components/schemas/ToolState"
  10622. },
  10623. "metadata": {
  10624. "type": "object"
  10625. }
  10626. },
  10627. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"],
  10628. "additionalProperties": false
  10629. },
  10630. "StepStartPart": {
  10631. "type": "object",
  10632. "properties": {
  10633. "id": {
  10634. "type": "string",
  10635. "pattern": "^prt"
  10636. },
  10637. "sessionID": {
  10638. "type": "string",
  10639. "pattern": "^ses"
  10640. },
  10641. "messageID": {
  10642. "type": "string",
  10643. "pattern": "^msg"
  10644. },
  10645. "type": {
  10646. "type": "string",
  10647. "enum": ["step-start"]
  10648. },
  10649. "snapshot": {
  10650. "type": "string"
  10651. }
  10652. },
  10653. "required": ["id", "sessionID", "messageID", "type"],
  10654. "additionalProperties": false
  10655. },
  10656. "StepFinishPart": {
  10657. "type": "object",
  10658. "properties": {
  10659. "id": {
  10660. "type": "string",
  10661. "pattern": "^prt"
  10662. },
  10663. "sessionID": {
  10664. "type": "string",
  10665. "pattern": "^ses"
  10666. },
  10667. "messageID": {
  10668. "type": "string",
  10669. "pattern": "^msg"
  10670. },
  10671. "type": {
  10672. "type": "string",
  10673. "enum": ["step-finish"]
  10674. },
  10675. "reason": {
  10676. "type": "string"
  10677. },
  10678. "snapshot": {
  10679. "type": "string"
  10680. },
  10681. "cost": {
  10682. "type": "number"
  10683. },
  10684. "tokens": {
  10685. "type": "object",
  10686. "properties": {
  10687. "total": {
  10688. "type": "number"
  10689. },
  10690. "input": {
  10691. "type": "number"
  10692. },
  10693. "output": {
  10694. "type": "number"
  10695. },
  10696. "reasoning": {
  10697. "type": "number"
  10698. },
  10699. "cache": {
  10700. "type": "object",
  10701. "properties": {
  10702. "read": {
  10703. "type": "number"
  10704. },
  10705. "write": {
  10706. "type": "number"
  10707. }
  10708. },
  10709. "required": ["read", "write"],
  10710. "additionalProperties": false
  10711. }
  10712. },
  10713. "required": ["input", "output", "reasoning", "cache"],
  10714. "additionalProperties": false
  10715. }
  10716. },
  10717. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"],
  10718. "additionalProperties": false
  10719. },
  10720. "SnapshotPart": {
  10721. "type": "object",
  10722. "properties": {
  10723. "id": {
  10724. "type": "string",
  10725. "pattern": "^prt"
  10726. },
  10727. "sessionID": {
  10728. "type": "string",
  10729. "pattern": "^ses"
  10730. },
  10731. "messageID": {
  10732. "type": "string",
  10733. "pattern": "^msg"
  10734. },
  10735. "type": {
  10736. "type": "string",
  10737. "enum": ["snapshot"]
  10738. },
  10739. "snapshot": {
  10740. "type": "string"
  10741. }
  10742. },
  10743. "required": ["id", "sessionID", "messageID", "type", "snapshot"],
  10744. "additionalProperties": false
  10745. },
  10746. "PatchPart": {
  10747. "type": "object",
  10748. "properties": {
  10749. "id": {
  10750. "type": "string",
  10751. "pattern": "^prt"
  10752. },
  10753. "sessionID": {
  10754. "type": "string",
  10755. "pattern": "^ses"
  10756. },
  10757. "messageID": {
  10758. "type": "string",
  10759. "pattern": "^msg"
  10760. },
  10761. "type": {
  10762. "type": "string",
  10763. "enum": ["patch"]
  10764. },
  10765. "hash": {
  10766. "type": "string"
  10767. },
  10768. "files": {
  10769. "type": "array",
  10770. "items": {
  10771. "type": "string"
  10772. }
  10773. }
  10774. },
  10775. "required": ["id", "sessionID", "messageID", "type", "hash", "files"],
  10776. "additionalProperties": false
  10777. },
  10778. "AgentPart": {
  10779. "type": "object",
  10780. "properties": {
  10781. "id": {
  10782. "type": "string",
  10783. "pattern": "^prt"
  10784. },
  10785. "sessionID": {
  10786. "type": "string",
  10787. "pattern": "^ses"
  10788. },
  10789. "messageID": {
  10790. "type": "string",
  10791. "pattern": "^msg"
  10792. },
  10793. "type": {
  10794. "type": "string",
  10795. "enum": ["agent"]
  10796. },
  10797. "name": {
  10798. "type": "string"
  10799. },
  10800. "source": {
  10801. "type": "object",
  10802. "properties": {
  10803. "value": {
  10804. "type": "string"
  10805. },
  10806. "start": {
  10807. "type": "integer",
  10808. "minimum": 0
  10809. },
  10810. "end": {
  10811. "type": "integer",
  10812. "minimum": 0
  10813. }
  10814. },
  10815. "required": ["value", "start", "end"],
  10816. "additionalProperties": false
  10817. }
  10818. },
  10819. "required": ["id", "sessionID", "messageID", "type", "name"],
  10820. "additionalProperties": false
  10821. },
  10822. "RetryPart": {
  10823. "type": "object",
  10824. "properties": {
  10825. "id": {
  10826. "type": "string",
  10827. "pattern": "^prt"
  10828. },
  10829. "sessionID": {
  10830. "type": "string",
  10831. "pattern": "^ses"
  10832. },
  10833. "messageID": {
  10834. "type": "string",
  10835. "pattern": "^msg"
  10836. },
  10837. "type": {
  10838. "type": "string",
  10839. "enum": ["retry"]
  10840. },
  10841. "attempt": {
  10842. "type": "integer",
  10843. "minimum": 0
  10844. },
  10845. "error": {
  10846. "$ref": "#/components/schemas/APIError"
  10847. },
  10848. "time": {
  10849. "type": "object",
  10850. "properties": {
  10851. "created": {
  10852. "type": "integer",
  10853. "minimum": 0
  10854. }
  10855. },
  10856. "required": ["created"],
  10857. "additionalProperties": false
  10858. }
  10859. },
  10860. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"],
  10861. "additionalProperties": false
  10862. },
  10863. "CompactionPart": {
  10864. "type": "object",
  10865. "properties": {
  10866. "id": {
  10867. "type": "string",
  10868. "pattern": "^prt"
  10869. },
  10870. "sessionID": {
  10871. "type": "string",
  10872. "pattern": "^ses"
  10873. },
  10874. "messageID": {
  10875. "type": "string",
  10876. "pattern": "^msg"
  10877. },
  10878. "type": {
  10879. "type": "string",
  10880. "enum": ["compaction"]
  10881. },
  10882. "auto": {
  10883. "type": "boolean"
  10884. },
  10885. "overflow": {
  10886. "type": "boolean"
  10887. },
  10888. "tail_start_id": {
  10889. "type": "string",
  10890. "pattern": "^msg"
  10891. }
  10892. },
  10893. "required": ["id", "sessionID", "messageID", "type", "auto"],
  10894. "additionalProperties": false
  10895. },
  10896. "Part": {
  10897. "anyOf": [
  10898. {
  10899. "$ref": "#/components/schemas/TextPart"
  10900. },
  10901. {
  10902. "$ref": "#/components/schemas/SubtaskPart"
  10903. },
  10904. {
  10905. "$ref": "#/components/schemas/ReasoningPart"
  10906. },
  10907. {
  10908. "$ref": "#/components/schemas/FilePart"
  10909. },
  10910. {
  10911. "$ref": "#/components/schemas/ToolPart"
  10912. },
  10913. {
  10914. "$ref": "#/components/schemas/StepStartPart"
  10915. },
  10916. {
  10917. "$ref": "#/components/schemas/StepFinishPart"
  10918. },
  10919. {
  10920. "$ref": "#/components/schemas/SnapshotPart"
  10921. },
  10922. {
  10923. "$ref": "#/components/schemas/PatchPart"
  10924. },
  10925. {
  10926. "$ref": "#/components/schemas/AgentPart"
  10927. },
  10928. {
  10929. "$ref": "#/components/schemas/RetryPart"
  10930. },
  10931. {
  10932. "$ref": "#/components/schemas/CompactionPart"
  10933. }
  10934. ]
  10935. },
  10936. "PermissionAction": {
  10937. "type": "string",
  10938. "enum": ["allow", "deny", "ask"]
  10939. },
  10940. "PermissionRule": {
  10941. "type": "object",
  10942. "properties": {
  10943. "permission": {
  10944. "type": "string"
  10945. },
  10946. "pattern": {
  10947. "type": "string"
  10948. },
  10949. "action": {
  10950. "$ref": "#/components/schemas/PermissionAction"
  10951. }
  10952. },
  10953. "required": ["permission", "pattern", "action"],
  10954. "additionalProperties": false
  10955. },
  10956. "PermissionRuleset": {
  10957. "type": "array",
  10958. "items": {
  10959. "$ref": "#/components/schemas/PermissionRule"
  10960. }
  10961. },
  10962. "Session": {
  10963. "type": "object",
  10964. "properties": {
  10965. "id": {
  10966. "type": "string",
  10967. "pattern": "^ses"
  10968. },
  10969. "slug": {
  10970. "type": "string"
  10971. },
  10972. "projectID": {
  10973. "type": "string"
  10974. },
  10975. "workspaceID": {
  10976. "type": "string",
  10977. "pattern": "^wrk"
  10978. },
  10979. "directory": {
  10980. "type": "string"
  10981. },
  10982. "path": {
  10983. "type": "string"
  10984. },
  10985. "parentID": {
  10986. "type": "string",
  10987. "pattern": "^ses"
  10988. },
  10989. "summary": {
  10990. "type": "object",
  10991. "properties": {
  10992. "additions": {
  10993. "type": "number"
  10994. },
  10995. "deletions": {
  10996. "type": "number"
  10997. },
  10998. "files": {
  10999. "type": "number"
  11000. },
  11001. "diffs": {
  11002. "type": "array",
  11003. "items": {
  11004. "$ref": "#/components/schemas/SnapshotFileDiff"
  11005. }
  11006. }
  11007. },
  11008. "required": ["additions", "deletions", "files"],
  11009. "additionalProperties": false
  11010. },
  11011. "share": {
  11012. "type": "object",
  11013. "properties": {
  11014. "url": {
  11015. "type": "string"
  11016. }
  11017. },
  11018. "required": ["url"],
  11019. "additionalProperties": false
  11020. },
  11021. "title": {
  11022. "type": "string"
  11023. },
  11024. "agent": {
  11025. "type": "string"
  11026. },
  11027. "model": {
  11028. "type": "object",
  11029. "properties": {
  11030. "id": {
  11031. "type": "string"
  11032. },
  11033. "providerID": {
  11034. "type": "string"
  11035. },
  11036. "variant": {
  11037. "type": "string"
  11038. }
  11039. },
  11040. "required": ["id", "providerID"],
  11041. "additionalProperties": false
  11042. },
  11043. "version": {
  11044. "type": "string"
  11045. },
  11046. "time": {
  11047. "type": "object",
  11048. "properties": {
  11049. "created": {
  11050. "type": "integer",
  11051. "minimum": 0
  11052. },
  11053. "updated": {
  11054. "type": "integer",
  11055. "minimum": 0
  11056. },
  11057. "compacting": {
  11058. "type": "integer",
  11059. "minimum": 0
  11060. },
  11061. "archived": {
  11062. "type": "number"
  11063. }
  11064. },
  11065. "required": ["created", "updated"],
  11066. "additionalProperties": false
  11067. },
  11068. "permission": {
  11069. "$ref": "#/components/schemas/PermissionRuleset"
  11070. },
  11071. "revert": {
  11072. "type": "object",
  11073. "properties": {
  11074. "messageID": {
  11075. "type": "string",
  11076. "pattern": "^msg"
  11077. },
  11078. "partID": {
  11079. "type": "string",
  11080. "pattern": "^prt"
  11081. },
  11082. "snapshot": {
  11083. "type": "string"
  11084. },
  11085. "diff": {
  11086. "type": "string"
  11087. }
  11088. },
  11089. "required": ["messageID"],
  11090. "additionalProperties": false
  11091. }
  11092. },
  11093. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"],
  11094. "additionalProperties": false
  11095. },
  11096. "Prompt": {
  11097. "type": "object",
  11098. "properties": {
  11099. "text": {
  11100. "type": "string"
  11101. },
  11102. "files": {
  11103. "type": "array",
  11104. "items": {
  11105. "$ref": "#/components/schemas/PromptFileAttachment"
  11106. }
  11107. },
  11108. "agents": {
  11109. "type": "array",
  11110. "items": {
  11111. "$ref": "#/components/schemas/PromptAgentAttachment"
  11112. }
  11113. }
  11114. },
  11115. "required": ["text"],
  11116. "additionalProperties": false
  11117. },
  11118. "GlobalEvent": {
  11119. "type": "object",
  11120. "properties": {
  11121. "directory": {
  11122. "type": "string"
  11123. },
  11124. "project": {
  11125. "type": "string"
  11126. },
  11127. "workspace": {
  11128. "type": "string"
  11129. },
  11130. "payload": {
  11131. "anyOf": [
  11132. {
  11133. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  11134. },
  11135. {
  11136. "$ref": "#/components/schemas/EventFileEdited"
  11137. },
  11138. {
  11139. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  11140. },
  11141. {
  11142. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  11143. },
  11144. {
  11145. "$ref": "#/components/schemas/EventLspUpdated"
  11146. },
  11147. {
  11148. "$ref": "#/components/schemas/EventMessagePartDelta"
  11149. },
  11150. {
  11151. "$ref": "#/components/schemas/EventPermissionAsked"
  11152. },
  11153. {
  11154. "$ref": "#/components/schemas/EventPermissionReplied"
  11155. },
  11156. {
  11157. "$ref": "#/components/schemas/EventSessionDiff"
  11158. },
  11159. {
  11160. "$ref": "#/components/schemas/EventSessionError"
  11161. },
  11162. {
  11163. "$ref": "#/components/schemas/EventInstallationUpdated"
  11164. },
  11165. {
  11166. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  11167. },
  11168. {
  11169. "$ref": "#/components/schemas/EventQuestionAsked"
  11170. },
  11171. {
  11172. "$ref": "#/components/schemas/EventQuestionReplied"
  11173. },
  11174. {
  11175. "$ref": "#/components/schemas/EventQuestionRejected"
  11176. },
  11177. {
  11178. "$ref": "#/components/schemas/EventTodoUpdated"
  11179. },
  11180. {
  11181. "$ref": "#/components/schemas/EventSessionStatus"
  11182. },
  11183. {
  11184. "$ref": "#/components/schemas/EventSessionIdle"
  11185. },
  11186. {
  11187. "$ref": "#/components/schemas/EventSessionCompacted"
  11188. },
  11189. {
  11190. "$ref": "#/components/schemas/Event.tui.prompt.append"
  11191. },
  11192. {
  11193. "$ref": "#/components/schemas/Event.tui.command.execute"
  11194. },
  11195. {
  11196. "$ref": "#/components/schemas/Event.tui.toast.show"
  11197. },
  11198. {
  11199. "$ref": "#/components/schemas/Event.tui.session.select"
  11200. },
  11201. {
  11202. "$ref": "#/components/schemas/EventMcpToolsChanged"
  11203. },
  11204. {
  11205. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  11206. },
  11207. {
  11208. "$ref": "#/components/schemas/EventCommandExecuted"
  11209. },
  11210. {
  11211. "$ref": "#/components/schemas/EventProjectUpdated"
  11212. },
  11213. {
  11214. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  11215. },
  11216. {
  11217. "$ref": "#/components/schemas/EventWorkspaceReady"
  11218. },
  11219. {
  11220. "$ref": "#/components/schemas/EventWorkspaceFailed"
  11221. },
  11222. {
  11223. "$ref": "#/components/schemas/EventWorkspaceStatus"
  11224. },
  11225. {
  11226. "$ref": "#/components/schemas/EventWorktreeReady"
  11227. },
  11228. {
  11229. "$ref": "#/components/schemas/EventWorktreeFailed"
  11230. },
  11231. {
  11232. "$ref": "#/components/schemas/EventPtyCreated"
  11233. },
  11234. {
  11235. "$ref": "#/components/schemas/EventPtyUpdated"
  11236. },
  11237. {
  11238. "$ref": "#/components/schemas/EventPtyExited"
  11239. },
  11240. {
  11241. "$ref": "#/components/schemas/EventPtyDeleted"
  11242. },
  11243. {
  11244. "$ref": "#/components/schemas/EventMessageUpdated"
  11245. },
  11246. {
  11247. "$ref": "#/components/schemas/EventMessageRemoved"
  11248. },
  11249. {
  11250. "$ref": "#/components/schemas/EventMessagePartUpdated"
  11251. },
  11252. {
  11253. "$ref": "#/components/schemas/EventMessagePartRemoved"
  11254. },
  11255. {
  11256. "$ref": "#/components/schemas/EventSessionCreated"
  11257. },
  11258. {
  11259. "$ref": "#/components/schemas/EventSessionUpdated"
  11260. },
  11261. {
  11262. "$ref": "#/components/schemas/EventSessionDeleted"
  11263. },
  11264. {
  11265. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  11266. },
  11267. {
  11268. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  11269. },
  11270. {
  11271. "$ref": "#/components/schemas/EventSessionNextPrompted"
  11272. },
  11273. {
  11274. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  11275. },
  11276. {
  11277. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  11278. },
  11279. {
  11280. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  11281. },
  11282. {
  11283. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  11284. },
  11285. {
  11286. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  11287. },
  11288. {
  11289. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  11290. },
  11291. {
  11292. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  11293. },
  11294. {
  11295. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  11296. },
  11297. {
  11298. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  11299. },
  11300. {
  11301. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  11302. },
  11303. {
  11304. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  11305. },
  11306. {
  11307. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  11308. },
  11309. {
  11310. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  11311. },
  11312. {
  11313. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  11314. },
  11315. {
  11316. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  11317. },
  11318. {
  11319. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  11320. },
  11321. {
  11322. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  11323. },
  11324. {
  11325. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  11326. },
  11327. {
  11328. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  11329. },
  11330. {
  11331. "$ref": "#/components/schemas/EventSessionNextRetried"
  11332. },
  11333. {
  11334. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  11335. },
  11336. {
  11337. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  11338. },
  11339. {
  11340. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  11341. },
  11342. {
  11343. "$ref": "#/components/schemas/EventServerConnected"
  11344. },
  11345. {
  11346. "$ref": "#/components/schemas/EventGlobalDisposed"
  11347. },
  11348. {
  11349. "$ref": "#/components/schemas/SyncEventMessageUpdated"
  11350. },
  11351. {
  11352. "$ref": "#/components/schemas/SyncEventMessageRemoved"
  11353. },
  11354. {
  11355. "$ref": "#/components/schemas/SyncEventMessagePartUpdated"
  11356. },
  11357. {
  11358. "$ref": "#/components/schemas/SyncEventMessagePartRemoved"
  11359. },
  11360. {
  11361. "$ref": "#/components/schemas/SyncEventSessionCreated"
  11362. },
  11363. {
  11364. "$ref": "#/components/schemas/SyncEventSessionUpdated"
  11365. },
  11366. {
  11367. "$ref": "#/components/schemas/SyncEventSessionDeleted"
  11368. },
  11369. {
  11370. "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched"
  11371. },
  11372. {
  11373. "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
  11374. },
  11375. {
  11376. "$ref": "#/components/schemas/SyncEventSessionNextPrompted"
  11377. },
  11378. {
  11379. "$ref": "#/components/schemas/SyncEventSessionNextSynthetic"
  11380. },
  11381. {
  11382. "$ref": "#/components/schemas/SyncEventSessionNextShellStarted"
  11383. },
  11384. {
  11385. "$ref": "#/components/schemas/SyncEventSessionNextShellEnded"
  11386. },
  11387. {
  11388. "$ref": "#/components/schemas/SyncEventSessionNextStepStarted"
  11389. },
  11390. {
  11391. "$ref": "#/components/schemas/SyncEventSessionNextStepEnded"
  11392. },
  11393. {
  11394. "$ref": "#/components/schemas/SyncEventSessionNextStepFailed"
  11395. },
  11396. {
  11397. "$ref": "#/components/schemas/SyncEventSessionNextTextStarted"
  11398. },
  11399. {
  11400. "$ref": "#/components/schemas/SyncEventSessionNextTextDelta"
  11401. },
  11402. {
  11403. "$ref": "#/components/schemas/SyncEventSessionNextTextEnded"
  11404. },
  11405. {
  11406. "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted"
  11407. },
  11408. {
  11409. "$ref": "#/components/schemas/SyncEventSessionNextReasoningDelta"
  11410. },
  11411. {
  11412. "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded"
  11413. },
  11414. {
  11415. "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted"
  11416. },
  11417. {
  11418. "$ref": "#/components/schemas/SyncEventSessionNextToolInputDelta"
  11419. },
  11420. {
  11421. "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded"
  11422. },
  11423. {
  11424. "$ref": "#/components/schemas/SyncEventSessionNextToolCalled"
  11425. },
  11426. {
  11427. "$ref": "#/components/schemas/SyncEventSessionNextToolProgress"
  11428. },
  11429. {
  11430. "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess"
  11431. },
  11432. {
  11433. "$ref": "#/components/schemas/SyncEventSessionNextToolFailed"
  11434. },
  11435. {
  11436. "$ref": "#/components/schemas/SyncEventSessionNextRetried"
  11437. },
  11438. {
  11439. "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted"
  11440. },
  11441. {
  11442. "$ref": "#/components/schemas/SyncEventSessionNextCompactionDelta"
  11443. },
  11444. {
  11445. "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded"
  11446. }
  11447. ]
  11448. }
  11449. },
  11450. "required": ["directory", "payload"],
  11451. "additionalProperties": false
  11452. },
  11453. "LogLevel": {
  11454. "type": "string",
  11455. "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
  11456. "description": "Log level"
  11457. },
  11458. "ServerConfig": {
  11459. "type": "object",
  11460. "properties": {
  11461. "port": {
  11462. "type": "integer",
  11463. "exclusiveMinimum": 0
  11464. },
  11465. "hostname": {
  11466. "type": "string"
  11467. },
  11468. "mdns": {
  11469. "type": "boolean"
  11470. },
  11471. "mdnsDomain": {
  11472. "type": "string"
  11473. },
  11474. "cors": {
  11475. "type": "array",
  11476. "items": {
  11477. "type": "string"
  11478. }
  11479. }
  11480. },
  11481. "additionalProperties": false,
  11482. "description": "Server configuration for opencode serve and web commands"
  11483. },
  11484. "ReferenceConfigEntry": {
  11485. "anyOf": [
  11486. {
  11487. "type": "string"
  11488. },
  11489. {
  11490. "type": "object",
  11491. "properties": {
  11492. "repository": {
  11493. "type": "string",
  11494. "description": "Git repository URL, host/path reference, or GitHub owner/repo shorthand"
  11495. },
  11496. "branch": {
  11497. "type": "string"
  11498. }
  11499. },
  11500. "required": ["repository"],
  11501. "additionalProperties": false
  11502. },
  11503. {
  11504. "type": "object",
  11505. "properties": {
  11506. "path": {
  11507. "type": "string",
  11508. "description": "Absolute path, ~/ path, or workspace-relative path to a local reference directory"
  11509. }
  11510. },
  11511. "required": ["path"],
  11512. "additionalProperties": false
  11513. }
  11514. ]
  11515. },
  11516. "ReferenceConfig": {
  11517. "type": "object",
  11518. "additionalProperties": {
  11519. "$ref": "#/components/schemas/ReferenceConfigEntry"
  11520. }
  11521. },
  11522. "PermissionActionConfig": {
  11523. "type": "string",
  11524. "enum": ["ask", "allow", "deny"]
  11525. },
  11526. "PermissionObjectConfig": {
  11527. "type": "object",
  11528. "additionalProperties": {
  11529. "$ref": "#/components/schemas/PermissionActionConfig"
  11530. }
  11531. },
  11532. "PermissionRuleConfig": {
  11533. "anyOf": [
  11534. {
  11535. "$ref": "#/components/schemas/PermissionActionConfig"
  11536. },
  11537. {
  11538. "$ref": "#/components/schemas/PermissionObjectConfig"
  11539. }
  11540. ]
  11541. },
  11542. "PermissionConfig": {
  11543. "anyOf": [
  11544. {
  11545. "$ref": "#/components/schemas/PermissionActionConfig"
  11546. },
  11547. {
  11548. "type": "object",
  11549. "properties": {
  11550. "read": {
  11551. "$ref": "#/components/schemas/PermissionRuleConfig"
  11552. },
  11553. "edit": {
  11554. "$ref": "#/components/schemas/PermissionRuleConfig"
  11555. },
  11556. "glob": {
  11557. "$ref": "#/components/schemas/PermissionRuleConfig"
  11558. },
  11559. "grep": {
  11560. "$ref": "#/components/schemas/PermissionRuleConfig"
  11561. },
  11562. "list": {
  11563. "$ref": "#/components/schemas/PermissionRuleConfig"
  11564. },
  11565. "bash": {
  11566. "$ref": "#/components/schemas/PermissionRuleConfig"
  11567. },
  11568. "task": {
  11569. "$ref": "#/components/schemas/PermissionRuleConfig"
  11570. },
  11571. "external_directory": {
  11572. "$ref": "#/components/schemas/PermissionRuleConfig"
  11573. },
  11574. "todowrite": {
  11575. "$ref": "#/components/schemas/PermissionActionConfig"
  11576. },
  11577. "question": {
  11578. "$ref": "#/components/schemas/PermissionActionConfig"
  11579. },
  11580. "webfetch": {
  11581. "$ref": "#/components/schemas/PermissionActionConfig"
  11582. },
  11583. "websearch": {
  11584. "$ref": "#/components/schemas/PermissionActionConfig"
  11585. },
  11586. "codesearch": {
  11587. "$ref": "#/components/schemas/PermissionActionConfig"
  11588. },
  11589. "repo_clone": {
  11590. "$ref": "#/components/schemas/PermissionRuleConfig"
  11591. },
  11592. "repo_overview": {
  11593. "$ref": "#/components/schemas/PermissionRuleConfig"
  11594. },
  11595. "lsp": {
  11596. "$ref": "#/components/schemas/PermissionRuleConfig"
  11597. },
  11598. "doom_loop": {
  11599. "$ref": "#/components/schemas/PermissionActionConfig"
  11600. },
  11601. "skill": {
  11602. "$ref": "#/components/schemas/PermissionRuleConfig"
  11603. }
  11604. },
  11605. "additionalProperties": {
  11606. "$ref": "#/components/schemas/PermissionRuleConfig"
  11607. }
  11608. }
  11609. ]
  11610. },
  11611. "AgentConfig": {
  11612. "type": "object",
  11613. "properties": {
  11614. "model": {
  11615. "type": "string"
  11616. },
  11617. "variant": {
  11618. "type": "string"
  11619. },
  11620. "temperature": {
  11621. "type": "number"
  11622. },
  11623. "top_p": {
  11624. "type": "number"
  11625. },
  11626. "prompt": {
  11627. "type": "string"
  11628. },
  11629. "tools": {
  11630. "type": "object",
  11631. "additionalProperties": {
  11632. "type": "boolean"
  11633. }
  11634. },
  11635. "disable": {
  11636. "type": "boolean"
  11637. },
  11638. "description": {
  11639. "type": "string"
  11640. },
  11641. "mode": {
  11642. "type": "string",
  11643. "enum": ["subagent", "primary", "all"]
  11644. },
  11645. "hidden": {
  11646. "type": "boolean"
  11647. },
  11648. "options": {
  11649. "type": "object"
  11650. },
  11651. "color": {
  11652. "anyOf": [
  11653. {
  11654. "type": "string",
  11655. "pattern": "^#[0-9a-fA-F]{6}$"
  11656. },
  11657. {
  11658. "type": "string",
  11659. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11660. }
  11661. ],
  11662. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
  11663. },
  11664. "steps": {
  11665. "type": "integer",
  11666. "exclusiveMinimum": 0
  11667. },
  11668. "maxSteps": {
  11669. "type": "integer",
  11670. "exclusiveMinimum": 0
  11671. },
  11672. "permission": {
  11673. "$ref": "#/components/schemas/PermissionConfig"
  11674. }
  11675. },
  11676. "additionalProperties": {}
  11677. },
  11678. "ProviderConfig": {
  11679. "type": "object",
  11680. "properties": {
  11681. "api": {
  11682. "type": "string"
  11683. },
  11684. "name": {
  11685. "type": "string"
  11686. },
  11687. "env": {
  11688. "type": "array",
  11689. "items": {
  11690. "type": "string"
  11691. }
  11692. },
  11693. "id": {
  11694. "type": "string"
  11695. },
  11696. "npm": {
  11697. "type": "string"
  11698. },
  11699. "whitelist": {
  11700. "type": "array",
  11701. "items": {
  11702. "type": "string"
  11703. }
  11704. },
  11705. "blacklist": {
  11706. "type": "array",
  11707. "items": {
  11708. "type": "string"
  11709. }
  11710. },
  11711. "options": {
  11712. "type": "object",
  11713. "properties": {
  11714. "apiKey": {
  11715. "type": "string"
  11716. },
  11717. "baseURL": {
  11718. "type": "string"
  11719. },
  11720. "enterpriseUrl": {
  11721. "type": "string"
  11722. },
  11723. "setCacheKey": {
  11724. "type": "boolean"
  11725. },
  11726. "timeout": {
  11727. "anyOf": [
  11728. {
  11729. "type": "integer",
  11730. "exclusiveMinimum": 0
  11731. },
  11732. {
  11733. "type": "boolean",
  11734. "enum": [false]
  11735. }
  11736. ],
  11737. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout."
  11738. },
  11739. "chunkTimeout": {
  11740. "type": "integer",
  11741. "exclusiveMinimum": 0
  11742. }
  11743. },
  11744. "additionalProperties": {}
  11745. },
  11746. "models": {
  11747. "type": "object",
  11748. "additionalProperties": {
  11749. "type": "object",
  11750. "properties": {
  11751. "id": {
  11752. "type": "string"
  11753. },
  11754. "name": {
  11755. "type": "string"
  11756. },
  11757. "family": {
  11758. "type": "string"
  11759. },
  11760. "release_date": {
  11761. "type": "string"
  11762. },
  11763. "attachment": {
  11764. "type": "boolean"
  11765. },
  11766. "reasoning": {
  11767. "type": "boolean"
  11768. },
  11769. "temperature": {
  11770. "type": "boolean"
  11771. },
  11772. "tool_call": {
  11773. "type": "boolean"
  11774. },
  11775. "interleaved": {
  11776. "anyOf": [
  11777. {
  11778. "type": "boolean",
  11779. "enum": [true]
  11780. },
  11781. {
  11782. "type": "object",
  11783. "properties": {
  11784. "field": {
  11785. "type": "string",
  11786. "enum": ["reasoning_content", "reasoning_details"]
  11787. }
  11788. },
  11789. "required": ["field"],
  11790. "additionalProperties": false
  11791. }
  11792. ]
  11793. },
  11794. "cost": {
  11795. "type": "object",
  11796. "properties": {
  11797. "input": {
  11798. "type": "number"
  11799. },
  11800. "output": {
  11801. "type": "number"
  11802. },
  11803. "cache_read": {
  11804. "type": "number"
  11805. },
  11806. "cache_write": {
  11807. "type": "number"
  11808. },
  11809. "context_over_200k": {
  11810. "type": "object",
  11811. "properties": {
  11812. "input": {
  11813. "type": "number"
  11814. },
  11815. "output": {
  11816. "type": "number"
  11817. },
  11818. "cache_read": {
  11819. "type": "number"
  11820. },
  11821. "cache_write": {
  11822. "type": "number"
  11823. }
  11824. },
  11825. "required": ["input", "output"],
  11826. "additionalProperties": false
  11827. }
  11828. },
  11829. "required": ["input", "output"],
  11830. "additionalProperties": false
  11831. },
  11832. "limit": {
  11833. "type": "object",
  11834. "properties": {
  11835. "context": {
  11836. "type": "number"
  11837. },
  11838. "input": {
  11839. "type": "number"
  11840. },
  11841. "output": {
  11842. "type": "number"
  11843. }
  11844. },
  11845. "required": ["context", "output"],
  11846. "additionalProperties": false
  11847. },
  11848. "modalities": {
  11849. "type": "object",
  11850. "properties": {
  11851. "input": {
  11852. "type": "array",
  11853. "items": {
  11854. "type": "string",
  11855. "enum": ["text", "audio", "image", "video", "pdf"]
  11856. }
  11857. },
  11858. "output": {
  11859. "type": "array",
  11860. "items": {
  11861. "type": "string",
  11862. "enum": ["text", "audio", "image", "video", "pdf"]
  11863. }
  11864. }
  11865. },
  11866. "required": ["input", "output"],
  11867. "additionalProperties": false
  11868. },
  11869. "experimental": {
  11870. "type": "boolean"
  11871. },
  11872. "status": {
  11873. "type": "string",
  11874. "enum": ["alpha", "beta", "deprecated", "active"]
  11875. },
  11876. "provider": {
  11877. "type": "object",
  11878. "properties": {
  11879. "npm": {
  11880. "type": "string"
  11881. },
  11882. "api": {
  11883. "type": "string"
  11884. }
  11885. },
  11886. "additionalProperties": false
  11887. },
  11888. "options": {
  11889. "type": "object"
  11890. },
  11891. "headers": {
  11892. "type": "object",
  11893. "additionalProperties": {
  11894. "type": "string"
  11895. }
  11896. },
  11897. "variants": {
  11898. "type": "object",
  11899. "additionalProperties": {
  11900. "type": "object",
  11901. "properties": {
  11902. "disabled": {
  11903. "type": "boolean"
  11904. }
  11905. },
  11906. "additionalProperties": {}
  11907. },
  11908. "description": "Variant-specific configuration"
  11909. }
  11910. },
  11911. "additionalProperties": false
  11912. }
  11913. }
  11914. },
  11915. "additionalProperties": false
  11916. },
  11917. "McpLocalConfig": {
  11918. "type": "object",
  11919. "properties": {
  11920. "type": {
  11921. "type": "string",
  11922. "enum": ["local"],
  11923. "description": "Type of MCP server connection"
  11924. },
  11925. "command": {
  11926. "type": "array",
  11927. "items": {
  11928. "type": "string"
  11929. },
  11930. "description": "Command and arguments to run the MCP server"
  11931. },
  11932. "environment": {
  11933. "type": "object",
  11934. "additionalProperties": {
  11935. "type": "string"
  11936. }
  11937. },
  11938. "enabled": {
  11939. "type": "boolean"
  11940. },
  11941. "timeout": {
  11942. "type": "integer",
  11943. "exclusiveMinimum": 0
  11944. }
  11945. },
  11946. "required": ["type", "command"],
  11947. "additionalProperties": false
  11948. },
  11949. "McpOAuthConfig": {
  11950. "type": "object",
  11951. "properties": {
  11952. "clientId": {
  11953. "type": "string"
  11954. },
  11955. "clientSecret": {
  11956. "type": "string"
  11957. },
  11958. "scope": {
  11959. "type": "string"
  11960. },
  11961. "redirectUri": {
  11962. "type": "string"
  11963. }
  11964. },
  11965. "additionalProperties": false
  11966. },
  11967. "McpRemoteConfig": {
  11968. "type": "object",
  11969. "properties": {
  11970. "type": {
  11971. "type": "string",
  11972. "enum": ["remote"],
  11973. "description": "Type of MCP server connection"
  11974. },
  11975. "url": {
  11976. "type": "string",
  11977. "description": "URL of the remote MCP server"
  11978. },
  11979. "enabled": {
  11980. "type": "boolean"
  11981. },
  11982. "headers": {
  11983. "type": "object",
  11984. "additionalProperties": {
  11985. "type": "string"
  11986. }
  11987. },
  11988. "oauth": {
  11989. "anyOf": [
  11990. {
  11991. "$ref": "#/components/schemas/McpOAuthConfig"
  11992. },
  11993. {
  11994. "type": "boolean",
  11995. "enum": [false]
  11996. }
  11997. ],
  11998. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
  11999. },
  12000. "timeout": {
  12001. "type": "integer",
  12002. "exclusiveMinimum": 0
  12003. }
  12004. },
  12005. "required": ["type", "url"],
  12006. "additionalProperties": false
  12007. },
  12008. "LayoutConfig": {
  12009. "type": "string",
  12010. "enum": ["auto", "stretch"],
  12011. "description": "@deprecated Always uses stretch layout."
  12012. },
  12013. "Config": {
  12014. "type": "object",
  12015. "properties": {
  12016. "$schema": {
  12017. "type": "string"
  12018. },
  12019. "shell": {
  12020. "type": "string"
  12021. },
  12022. "logLevel": {
  12023. "$ref": "#/components/schemas/LogLevel"
  12024. },
  12025. "server": {
  12026. "$ref": "#/components/schemas/ServerConfig"
  12027. },
  12028. "command": {
  12029. "type": "object",
  12030. "additionalProperties": {
  12031. "type": "object",
  12032. "properties": {
  12033. "template": {
  12034. "type": "string"
  12035. },
  12036. "description": {
  12037. "type": "string"
  12038. },
  12039. "agent": {
  12040. "type": "string"
  12041. },
  12042. "model": {
  12043. "type": "string"
  12044. },
  12045. "subtask": {
  12046. "type": "boolean"
  12047. }
  12048. },
  12049. "required": ["template"],
  12050. "additionalProperties": false
  12051. }
  12052. },
  12053. "skills": {
  12054. "type": "object",
  12055. "properties": {
  12056. "paths": {
  12057. "type": "array",
  12058. "items": {
  12059. "type": "string"
  12060. }
  12061. },
  12062. "urls": {
  12063. "type": "array",
  12064. "items": {
  12065. "type": "string"
  12066. }
  12067. }
  12068. },
  12069. "additionalProperties": false
  12070. },
  12071. "reference": {
  12072. "$ref": "#/components/schemas/ReferenceConfig"
  12073. },
  12074. "watcher": {
  12075. "type": "object",
  12076. "properties": {
  12077. "ignore": {
  12078. "type": "array",
  12079. "items": {
  12080. "type": "string"
  12081. }
  12082. }
  12083. },
  12084. "additionalProperties": false
  12085. },
  12086. "snapshot": {
  12087. "type": "boolean"
  12088. },
  12089. "plugin": {
  12090. "type": "array",
  12091. "items": {
  12092. "anyOf": [
  12093. {
  12094. "type": "string"
  12095. },
  12096. {
  12097. "type": "array",
  12098. "prefixItems": [
  12099. {
  12100. "type": "string"
  12101. },
  12102. {
  12103. "type": "object"
  12104. }
  12105. ],
  12106. "maxItems": 2,
  12107. "minItems": 2
  12108. }
  12109. ]
  12110. }
  12111. },
  12112. "share": {
  12113. "type": "string",
  12114. "enum": ["manual", "auto", "disabled"]
  12115. },
  12116. "autoshare": {
  12117. "type": "boolean"
  12118. },
  12119. "autoupdate": {
  12120. "anyOf": [
  12121. {
  12122. "type": "boolean"
  12123. },
  12124. {
  12125. "type": "string",
  12126. "enum": ["notify"]
  12127. }
  12128. ],
  12129. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
  12130. },
  12131. "disabled_providers": {
  12132. "type": "array",
  12133. "items": {
  12134. "type": "string"
  12135. }
  12136. },
  12137. "enabled_providers": {
  12138. "type": "array",
  12139. "items": {
  12140. "type": "string"
  12141. }
  12142. },
  12143. "model": {
  12144. "type": "string"
  12145. },
  12146. "small_model": {
  12147. "type": "string"
  12148. },
  12149. "default_agent": {
  12150. "type": "string"
  12151. },
  12152. "username": {
  12153. "type": "string"
  12154. },
  12155. "mode": {
  12156. "type": "object",
  12157. "properties": {
  12158. "build": {
  12159. "$ref": "#/components/schemas/AgentConfig"
  12160. },
  12161. "plan": {
  12162. "$ref": "#/components/schemas/AgentConfig"
  12163. }
  12164. },
  12165. "additionalProperties": {
  12166. "$ref": "#/components/schemas/AgentConfig"
  12167. }
  12168. },
  12169. "agent": {
  12170. "type": "object",
  12171. "properties": {
  12172. "plan": {
  12173. "$ref": "#/components/schemas/AgentConfig"
  12174. },
  12175. "build": {
  12176. "$ref": "#/components/schemas/AgentConfig"
  12177. },
  12178. "general": {
  12179. "$ref": "#/components/schemas/AgentConfig"
  12180. },
  12181. "explore": {
  12182. "$ref": "#/components/schemas/AgentConfig"
  12183. },
  12184. "scout": {
  12185. "$ref": "#/components/schemas/AgentConfig"
  12186. },
  12187. "title": {
  12188. "$ref": "#/components/schemas/AgentConfig"
  12189. },
  12190. "summary": {
  12191. "$ref": "#/components/schemas/AgentConfig"
  12192. },
  12193. "compaction": {
  12194. "$ref": "#/components/schemas/AgentConfig"
  12195. }
  12196. },
  12197. "additionalProperties": {
  12198. "$ref": "#/components/schemas/AgentConfig"
  12199. }
  12200. },
  12201. "provider": {
  12202. "type": "object",
  12203. "additionalProperties": {
  12204. "$ref": "#/components/schemas/ProviderConfig"
  12205. }
  12206. },
  12207. "mcp": {
  12208. "type": "object",
  12209. "additionalProperties": {
  12210. "anyOf": [
  12211. {
  12212. "$ref": "#/components/schemas/McpLocalConfig"
  12213. },
  12214. {
  12215. "$ref": "#/components/schemas/McpRemoteConfig"
  12216. },
  12217. {
  12218. "type": "object",
  12219. "properties": {
  12220. "enabled": {
  12221. "type": "boolean"
  12222. }
  12223. },
  12224. "required": ["enabled"],
  12225. "additionalProperties": false
  12226. }
  12227. ]
  12228. }
  12229. },
  12230. "formatter": {
  12231. "anyOf": [
  12232. {
  12233. "type": "boolean"
  12234. },
  12235. {
  12236. "type": "object",
  12237. "additionalProperties": {
  12238. "type": "object",
  12239. "properties": {
  12240. "disabled": {
  12241. "type": "boolean"
  12242. },
  12243. "command": {
  12244. "type": "array",
  12245. "items": {
  12246. "type": "string"
  12247. }
  12248. },
  12249. "environment": {
  12250. "type": "object",
  12251. "additionalProperties": {
  12252. "type": "string"
  12253. }
  12254. },
  12255. "extensions": {
  12256. "type": "array",
  12257. "items": {
  12258. "type": "string"
  12259. }
  12260. }
  12261. },
  12262. "additionalProperties": false
  12263. }
  12264. }
  12265. ],
  12266. "description": "Enable or configure formatters. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides."
  12267. },
  12268. "lsp": {
  12269. "anyOf": [
  12270. {
  12271. "type": "boolean"
  12272. },
  12273. {
  12274. "type": "object",
  12275. "additionalProperties": {
  12276. "anyOf": [
  12277. {
  12278. "type": "object",
  12279. "properties": {
  12280. "disabled": {
  12281. "type": "boolean",
  12282. "enum": [true]
  12283. }
  12284. },
  12285. "required": ["disabled"],
  12286. "additionalProperties": false
  12287. },
  12288. {
  12289. "type": "object",
  12290. "properties": {
  12291. "command": {
  12292. "type": "array",
  12293. "items": {
  12294. "type": "string"
  12295. }
  12296. },
  12297. "extensions": {
  12298. "type": "array",
  12299. "items": {
  12300. "type": "string"
  12301. }
  12302. },
  12303. "disabled": {
  12304. "type": "boolean"
  12305. },
  12306. "env": {
  12307. "type": "object",
  12308. "additionalProperties": {
  12309. "type": "string"
  12310. }
  12311. },
  12312. "initialization": {
  12313. "type": "object"
  12314. }
  12315. },
  12316. "required": ["command"],
  12317. "additionalProperties": false
  12318. }
  12319. ]
  12320. }
  12321. }
  12322. ],
  12323. "description": "Enable or configure LSP servers. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides."
  12324. },
  12325. "instructions": {
  12326. "type": "array",
  12327. "items": {
  12328. "type": "string"
  12329. }
  12330. },
  12331. "layout": {
  12332. "$ref": "#/components/schemas/LayoutConfig"
  12333. },
  12334. "permission": {
  12335. "$ref": "#/components/schemas/PermissionConfig"
  12336. },
  12337. "tools": {
  12338. "type": "object",
  12339. "additionalProperties": {
  12340. "type": "boolean"
  12341. }
  12342. },
  12343. "enterprise": {
  12344. "type": "object",
  12345. "properties": {
  12346. "url": {
  12347. "type": "string"
  12348. }
  12349. },
  12350. "additionalProperties": false
  12351. },
  12352. "tool_output": {
  12353. "type": "object",
  12354. "properties": {
  12355. "max_lines": {
  12356. "type": "integer",
  12357. "exclusiveMinimum": 0
  12358. },
  12359. "max_bytes": {
  12360. "type": "integer",
  12361. "exclusiveMinimum": 0
  12362. }
  12363. },
  12364. "additionalProperties": false
  12365. },
  12366. "compaction": {
  12367. "type": "object",
  12368. "properties": {
  12369. "auto": {
  12370. "type": "boolean"
  12371. },
  12372. "prune": {
  12373. "type": "boolean"
  12374. },
  12375. "tail_turns": {
  12376. "type": "integer",
  12377. "minimum": 0
  12378. },
  12379. "preserve_recent_tokens": {
  12380. "type": "integer",
  12381. "minimum": 0
  12382. },
  12383. "reserved": {
  12384. "type": "integer",
  12385. "minimum": 0
  12386. }
  12387. },
  12388. "additionalProperties": false
  12389. },
  12390. "experimental": {
  12391. "type": "object",
  12392. "properties": {
  12393. "disable_paste_summary": {
  12394. "type": "boolean"
  12395. },
  12396. "batch_tool": {
  12397. "type": "boolean"
  12398. },
  12399. "openTelemetry": {
  12400. "type": "boolean"
  12401. },
  12402. "primary_tools": {
  12403. "type": "array",
  12404. "items": {
  12405. "type": "string"
  12406. }
  12407. },
  12408. "continue_loop_on_deny": {
  12409. "type": "boolean"
  12410. },
  12411. "mcp_timeout": {
  12412. "type": "integer",
  12413. "exclusiveMinimum": 0
  12414. }
  12415. },
  12416. "additionalProperties": false
  12417. }
  12418. },
  12419. "additionalProperties": false
  12420. },
  12421. "Model": {
  12422. "type": "object",
  12423. "properties": {
  12424. "id": {
  12425. "type": "string"
  12426. },
  12427. "providerID": {
  12428. "type": "string"
  12429. },
  12430. "api": {
  12431. "type": "object",
  12432. "properties": {
  12433. "id": {
  12434. "type": "string"
  12435. },
  12436. "url": {
  12437. "type": "string"
  12438. },
  12439. "npm": {
  12440. "type": "string"
  12441. }
  12442. },
  12443. "required": ["id", "url", "npm"],
  12444. "additionalProperties": false
  12445. },
  12446. "name": {
  12447. "type": "string"
  12448. },
  12449. "family": {
  12450. "type": "string"
  12451. },
  12452. "capabilities": {
  12453. "type": "object",
  12454. "properties": {
  12455. "temperature": {
  12456. "type": "boolean"
  12457. },
  12458. "reasoning": {
  12459. "type": "boolean"
  12460. },
  12461. "attachment": {
  12462. "type": "boolean"
  12463. },
  12464. "toolcall": {
  12465. "type": "boolean"
  12466. },
  12467. "input": {
  12468. "type": "object",
  12469. "properties": {
  12470. "text": {
  12471. "type": "boolean"
  12472. },
  12473. "audio": {
  12474. "type": "boolean"
  12475. },
  12476. "image": {
  12477. "type": "boolean"
  12478. },
  12479. "video": {
  12480. "type": "boolean"
  12481. },
  12482. "pdf": {
  12483. "type": "boolean"
  12484. }
  12485. },
  12486. "required": ["text", "audio", "image", "video", "pdf"],
  12487. "additionalProperties": false
  12488. },
  12489. "output": {
  12490. "type": "object",
  12491. "properties": {
  12492. "text": {
  12493. "type": "boolean"
  12494. },
  12495. "audio": {
  12496. "type": "boolean"
  12497. },
  12498. "image": {
  12499. "type": "boolean"
  12500. },
  12501. "video": {
  12502. "type": "boolean"
  12503. },
  12504. "pdf": {
  12505. "type": "boolean"
  12506. }
  12507. },
  12508. "required": ["text", "audio", "image", "video", "pdf"],
  12509. "additionalProperties": false
  12510. },
  12511. "interleaved": {
  12512. "anyOf": [
  12513. {
  12514. "type": "boolean"
  12515. },
  12516. {
  12517. "type": "object",
  12518. "properties": {
  12519. "field": {
  12520. "type": "string",
  12521. "enum": ["reasoning_content", "reasoning_details"]
  12522. }
  12523. },
  12524. "required": ["field"],
  12525. "additionalProperties": false
  12526. }
  12527. ]
  12528. }
  12529. },
  12530. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
  12531. "additionalProperties": false
  12532. },
  12533. "cost": {
  12534. "type": "object",
  12535. "properties": {
  12536. "input": {
  12537. "type": "number"
  12538. },
  12539. "output": {
  12540. "type": "number"
  12541. },
  12542. "cache": {
  12543. "type": "object",
  12544. "properties": {
  12545. "read": {
  12546. "type": "number"
  12547. },
  12548. "write": {
  12549. "type": "number"
  12550. }
  12551. },
  12552. "required": ["read", "write"],
  12553. "additionalProperties": false
  12554. },
  12555. "experimentalOver200K": {
  12556. "type": "object",
  12557. "properties": {
  12558. "input": {
  12559. "type": "number"
  12560. },
  12561. "output": {
  12562. "type": "number"
  12563. },
  12564. "cache": {
  12565. "type": "object",
  12566. "properties": {
  12567. "read": {
  12568. "type": "number"
  12569. },
  12570. "write": {
  12571. "type": "number"
  12572. }
  12573. },
  12574. "required": ["read", "write"],
  12575. "additionalProperties": false
  12576. }
  12577. },
  12578. "required": ["input", "output", "cache"],
  12579. "additionalProperties": false
  12580. }
  12581. },
  12582. "required": ["input", "output", "cache"],
  12583. "additionalProperties": false
  12584. },
  12585. "limit": {
  12586. "type": "object",
  12587. "properties": {
  12588. "context": {
  12589. "type": "number"
  12590. },
  12591. "input": {
  12592. "type": "number"
  12593. },
  12594. "output": {
  12595. "type": "number"
  12596. }
  12597. },
  12598. "required": ["context", "output"],
  12599. "additionalProperties": false
  12600. },
  12601. "status": {
  12602. "type": "string",
  12603. "enum": ["alpha", "beta", "deprecated", "active"]
  12604. },
  12605. "options": {
  12606. "type": "object"
  12607. },
  12608. "headers": {
  12609. "type": "object",
  12610. "additionalProperties": {
  12611. "type": "string"
  12612. }
  12613. },
  12614. "release_date": {
  12615. "type": "string"
  12616. },
  12617. "variants": {
  12618. "type": "object",
  12619. "additionalProperties": {
  12620. "type": "object"
  12621. }
  12622. }
  12623. },
  12624. "required": [
  12625. "id",
  12626. "providerID",
  12627. "api",
  12628. "name",
  12629. "capabilities",
  12630. "cost",
  12631. "limit",
  12632. "status",
  12633. "options",
  12634. "headers",
  12635. "release_date"
  12636. ],
  12637. "additionalProperties": false
  12638. },
  12639. "Provider": {
  12640. "type": "object",
  12641. "properties": {
  12642. "id": {
  12643. "type": "string"
  12644. },
  12645. "name": {
  12646. "type": "string"
  12647. },
  12648. "source": {
  12649. "type": "string",
  12650. "enum": ["env", "config", "custom", "api"]
  12651. },
  12652. "env": {
  12653. "type": "array",
  12654. "items": {
  12655. "type": "string"
  12656. }
  12657. },
  12658. "key": {
  12659. "type": "string"
  12660. },
  12661. "options": {
  12662. "type": "object"
  12663. },
  12664. "models": {
  12665. "type": "object",
  12666. "additionalProperties": {
  12667. "$ref": "#/components/schemas/Model"
  12668. }
  12669. }
  12670. },
  12671. "required": ["id", "name", "source", "env", "options", "models"],
  12672. "additionalProperties": false
  12673. },
  12674. "ConsoleState": {
  12675. "type": "object",
  12676. "properties": {
  12677. "consoleManagedProviders": {
  12678. "type": "array",
  12679. "items": {
  12680. "type": "string"
  12681. }
  12682. },
  12683. "activeOrgName": {
  12684. "type": "string"
  12685. },
  12686. "switchableOrgCount": {
  12687. "type": "integer",
  12688. "minimum": 0
  12689. }
  12690. },
  12691. "required": ["consoleManagedProviders", "switchableOrgCount"],
  12692. "additionalProperties": false
  12693. },
  12694. "effect_HttpApiError_InternalServerError": {
  12695. "type": "object",
  12696. "properties": {
  12697. "_tag": {
  12698. "type": "string",
  12699. "enum": ["InternalServerError"]
  12700. }
  12701. },
  12702. "required": ["_tag"],
  12703. "additionalProperties": false
  12704. },
  12705. "ToolListItem": {
  12706. "type": "object",
  12707. "properties": {
  12708. "id": {
  12709. "type": "string"
  12710. },
  12711. "description": {
  12712. "type": "string"
  12713. },
  12714. "parameters": {}
  12715. },
  12716. "required": ["id", "description", "parameters"],
  12717. "additionalProperties": false
  12718. },
  12719. "ToolList": {
  12720. "type": "array",
  12721. "items": {
  12722. "$ref": "#/components/schemas/ToolListItem"
  12723. }
  12724. },
  12725. "ToolIDs": {
  12726. "type": "array",
  12727. "items": {
  12728. "type": "string"
  12729. }
  12730. },
  12731. "WorktreeCreateInput": {
  12732. "type": "object",
  12733. "properties": {
  12734. "name": {
  12735. "type": "string"
  12736. },
  12737. "startCommand": {
  12738. "type": "string",
  12739. "description": "Additional startup script to run after the project's start command"
  12740. }
  12741. },
  12742. "additionalProperties": false
  12743. },
  12744. "Worktree": {
  12745. "type": "object",
  12746. "properties": {
  12747. "name": {
  12748. "type": "string"
  12749. },
  12750. "branch": {
  12751. "type": "string"
  12752. },
  12753. "directory": {
  12754. "type": "string"
  12755. }
  12756. },
  12757. "required": ["name", "branch", "directory"],
  12758. "additionalProperties": false
  12759. },
  12760. "WorktreeRemoveInput": {
  12761. "type": "object",
  12762. "properties": {
  12763. "directory": {
  12764. "type": "string"
  12765. }
  12766. },
  12767. "required": ["directory"],
  12768. "additionalProperties": false
  12769. },
  12770. "WorktreeResetInput": {
  12771. "type": "object",
  12772. "properties": {
  12773. "directory": {
  12774. "type": "string"
  12775. }
  12776. },
  12777. "required": ["directory"],
  12778. "additionalProperties": false
  12779. },
  12780. "ProjectSummary": {
  12781. "type": "object",
  12782. "properties": {
  12783. "id": {
  12784. "type": "string"
  12785. },
  12786. "name": {
  12787. "type": "string"
  12788. },
  12789. "worktree": {
  12790. "type": "string"
  12791. }
  12792. },
  12793. "required": ["id", "worktree"],
  12794. "additionalProperties": false
  12795. },
  12796. "GlobalSession": {
  12797. "type": "object",
  12798. "properties": {
  12799. "id": {
  12800. "type": "string",
  12801. "pattern": "^ses"
  12802. },
  12803. "slug": {
  12804. "type": "string"
  12805. },
  12806. "projectID": {
  12807. "type": "string"
  12808. },
  12809. "workspaceID": {
  12810. "type": "string",
  12811. "pattern": "^wrk"
  12812. },
  12813. "directory": {
  12814. "type": "string"
  12815. },
  12816. "path": {
  12817. "type": "string"
  12818. },
  12819. "parentID": {
  12820. "type": "string",
  12821. "pattern": "^ses"
  12822. },
  12823. "summary": {
  12824. "type": "object",
  12825. "properties": {
  12826. "additions": {
  12827. "type": "number"
  12828. },
  12829. "deletions": {
  12830. "type": "number"
  12831. },
  12832. "files": {
  12833. "type": "number"
  12834. },
  12835. "diffs": {
  12836. "type": "array",
  12837. "items": {
  12838. "$ref": "#/components/schemas/SnapshotFileDiff"
  12839. }
  12840. }
  12841. },
  12842. "required": ["additions", "deletions", "files"],
  12843. "additionalProperties": false
  12844. },
  12845. "share": {
  12846. "type": "object",
  12847. "properties": {
  12848. "url": {
  12849. "type": "string"
  12850. }
  12851. },
  12852. "required": ["url"],
  12853. "additionalProperties": false
  12854. },
  12855. "title": {
  12856. "type": "string"
  12857. },
  12858. "agent": {
  12859. "type": "string"
  12860. },
  12861. "model": {
  12862. "type": "object",
  12863. "properties": {
  12864. "id": {
  12865. "type": "string"
  12866. },
  12867. "providerID": {
  12868. "type": "string"
  12869. },
  12870. "variant": {
  12871. "type": "string"
  12872. }
  12873. },
  12874. "required": ["id", "providerID"],
  12875. "additionalProperties": false
  12876. },
  12877. "version": {
  12878. "type": "string"
  12879. },
  12880. "time": {
  12881. "type": "object",
  12882. "properties": {
  12883. "created": {
  12884. "type": "integer",
  12885. "minimum": 0
  12886. },
  12887. "updated": {
  12888. "type": "integer",
  12889. "minimum": 0
  12890. },
  12891. "compacting": {
  12892. "type": "integer",
  12893. "minimum": 0
  12894. },
  12895. "archived": {
  12896. "type": "number"
  12897. }
  12898. },
  12899. "required": ["created", "updated"],
  12900. "additionalProperties": false
  12901. },
  12902. "permission": {
  12903. "$ref": "#/components/schemas/PermissionRuleset"
  12904. },
  12905. "revert": {
  12906. "type": "object",
  12907. "properties": {
  12908. "messageID": {
  12909. "type": "string",
  12910. "pattern": "^msg"
  12911. },
  12912. "partID": {
  12913. "type": "string",
  12914. "pattern": "^prt"
  12915. },
  12916. "snapshot": {
  12917. "type": "string"
  12918. },
  12919. "diff": {
  12920. "type": "string"
  12921. }
  12922. },
  12923. "required": ["messageID"],
  12924. "additionalProperties": false
  12925. },
  12926. "project": {
  12927. "anyOf": [
  12928. {
  12929. "$ref": "#/components/schemas/ProjectSummary"
  12930. },
  12931. {
  12932. "type": "null"
  12933. }
  12934. ]
  12935. }
  12936. },
  12937. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
  12938. "additionalProperties": false
  12939. },
  12940. "McpResource": {
  12941. "type": "object",
  12942. "properties": {
  12943. "name": {
  12944. "type": "string"
  12945. },
  12946. "uri": {
  12947. "type": "string"
  12948. },
  12949. "description": {
  12950. "type": "string"
  12951. },
  12952. "mimeType": {
  12953. "type": "string"
  12954. },
  12955. "client": {
  12956. "type": "string"
  12957. }
  12958. },
  12959. "required": ["name", "uri", "client"],
  12960. "additionalProperties": false
  12961. },
  12962. "Symbol": {
  12963. "type": "object",
  12964. "properties": {
  12965. "name": {
  12966. "type": "string"
  12967. },
  12968. "kind": {
  12969. "type": "integer",
  12970. "minimum": 0
  12971. },
  12972. "location": {
  12973. "type": "object",
  12974. "properties": {
  12975. "uri": {
  12976. "type": "string"
  12977. },
  12978. "range": {
  12979. "$ref": "#/components/schemas/Range"
  12980. }
  12981. },
  12982. "required": ["uri", "range"],
  12983. "additionalProperties": false
  12984. }
  12985. },
  12986. "required": ["name", "kind", "location"],
  12987. "additionalProperties": false
  12988. },
  12989. "FileNode": {
  12990. "type": "object",
  12991. "properties": {
  12992. "name": {
  12993. "type": "string"
  12994. },
  12995. "path": {
  12996. "type": "string"
  12997. },
  12998. "absolute": {
  12999. "type": "string"
  13000. },
  13001. "type": {
  13002. "type": "string",
  13003. "enum": ["file", "directory"]
  13004. },
  13005. "ignored": {
  13006. "type": "boolean"
  13007. }
  13008. },
  13009. "required": ["name", "path", "absolute", "type", "ignored"],
  13010. "additionalProperties": false
  13011. },
  13012. "FileContent": {
  13013. "type": "object",
  13014. "properties": {
  13015. "type": {
  13016. "type": "string",
  13017. "enum": ["text", "binary"]
  13018. },
  13019. "content": {
  13020. "type": "string"
  13021. },
  13022. "diff": {
  13023. "type": "string"
  13024. },
  13025. "patch": {
  13026. "type": "object",
  13027. "properties": {
  13028. "oldFileName": {
  13029. "type": "string"
  13030. },
  13031. "newFileName": {
  13032. "type": "string"
  13033. },
  13034. "oldHeader": {
  13035. "type": "string"
  13036. },
  13037. "newHeader": {
  13038. "type": "string"
  13039. },
  13040. "hunks": {
  13041. "type": "array",
  13042. "items": {
  13043. "type": "object",
  13044. "properties": {
  13045. "oldStart": {
  13046. "type": "integer",
  13047. "minimum": 0
  13048. },
  13049. "oldLines": {
  13050. "type": "integer",
  13051. "minimum": 0
  13052. },
  13053. "newStart": {
  13054. "type": "integer",
  13055. "minimum": 0
  13056. },
  13057. "newLines": {
  13058. "type": "integer",
  13059. "minimum": 0
  13060. },
  13061. "lines": {
  13062. "type": "array",
  13063. "items": {
  13064. "type": "string"
  13065. }
  13066. }
  13067. },
  13068. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
  13069. "additionalProperties": false
  13070. }
  13071. },
  13072. "index": {
  13073. "type": "string"
  13074. }
  13075. },
  13076. "required": ["oldFileName", "newFileName", "hunks"],
  13077. "additionalProperties": false
  13078. },
  13079. "encoding": {
  13080. "type": "string",
  13081. "enum": ["base64"]
  13082. },
  13083. "mimeType": {
  13084. "type": "string"
  13085. }
  13086. },
  13087. "required": ["type", "content"],
  13088. "additionalProperties": false
  13089. },
  13090. "File": {
  13091. "type": "object",
  13092. "properties": {
  13093. "path": {
  13094. "type": "string"
  13095. },
  13096. "added": {
  13097. "type": "integer",
  13098. "minimum": 0
  13099. },
  13100. "removed": {
  13101. "type": "integer",
  13102. "minimum": 0
  13103. },
  13104. "status": {
  13105. "type": "string",
  13106. "enum": ["added", "deleted", "modified"]
  13107. }
  13108. },
  13109. "required": ["path", "added", "removed", "status"],
  13110. "additionalProperties": false
  13111. },
  13112. "Path": {
  13113. "type": "object",
  13114. "properties": {
  13115. "home": {
  13116. "type": "string"
  13117. },
  13118. "state": {
  13119. "type": "string"
  13120. },
  13121. "config": {
  13122. "type": "string"
  13123. },
  13124. "worktree": {
  13125. "type": "string"
  13126. },
  13127. "directory": {
  13128. "type": "string"
  13129. }
  13130. },
  13131. "required": ["home", "state", "config", "worktree", "directory"],
  13132. "additionalProperties": false
  13133. },
  13134. "VcsInfo": {
  13135. "type": "object",
  13136. "properties": {
  13137. "branch": {
  13138. "type": "string"
  13139. },
  13140. "default_branch": {
  13141. "type": "string"
  13142. }
  13143. },
  13144. "additionalProperties": false
  13145. },
  13146. "VcsFileStatus": {
  13147. "type": "object",
  13148. "properties": {
  13149. "file": {
  13150. "type": "string"
  13151. },
  13152. "additions": {
  13153. "type": "number"
  13154. },
  13155. "deletions": {
  13156. "type": "number"
  13157. },
  13158. "status": {
  13159. "type": "string",
  13160. "enum": ["added", "deleted", "modified"]
  13161. }
  13162. },
  13163. "required": ["file", "additions", "deletions", "status"],
  13164. "additionalProperties": false
  13165. },
  13166. "VcsFileDiff": {
  13167. "type": "object",
  13168. "properties": {
  13169. "file": {
  13170. "type": "string"
  13171. },
  13172. "patch": {
  13173. "type": "string"
  13174. },
  13175. "additions": {
  13176. "type": "number"
  13177. },
  13178. "deletions": {
  13179. "type": "number"
  13180. },
  13181. "status": {
  13182. "type": "string",
  13183. "enum": ["added", "deleted", "modified"]
  13184. }
  13185. },
  13186. "required": ["file", "additions", "deletions"],
  13187. "additionalProperties": false
  13188. },
  13189. "VcsApplyError": {
  13190. "type": "object",
  13191. "properties": {
  13192. "name": {
  13193. "type": "string",
  13194. "enum": ["VcsApplyError"]
  13195. },
  13196. "data": {
  13197. "type": "object",
  13198. "properties": {
  13199. "message": {
  13200. "type": "string"
  13201. },
  13202. "reason": {
  13203. "type": "string",
  13204. "enum": ["non-git", "not-clean"]
  13205. }
  13206. },
  13207. "required": ["message", "reason"],
  13208. "additionalProperties": false
  13209. }
  13210. },
  13211. "required": ["name", "data"],
  13212. "additionalProperties": false
  13213. },
  13214. "Command": {
  13215. "type": "object",
  13216. "properties": {
  13217. "name": {
  13218. "type": "string"
  13219. },
  13220. "description": {
  13221. "type": "string"
  13222. },
  13223. "agent": {
  13224. "type": "string"
  13225. },
  13226. "model": {
  13227. "type": "string"
  13228. },
  13229. "source": {
  13230. "type": "string",
  13231. "enum": ["command", "mcp", "skill"]
  13232. },
  13233. "template": {
  13234. "type": "string"
  13235. },
  13236. "subtask": {
  13237. "type": "boolean"
  13238. },
  13239. "hints": {
  13240. "type": "array",
  13241. "items": {
  13242. "type": "string"
  13243. }
  13244. }
  13245. },
  13246. "required": ["name", "template", "hints"],
  13247. "additionalProperties": false
  13248. },
  13249. "Agent": {
  13250. "type": "object",
  13251. "properties": {
  13252. "name": {
  13253. "type": "string"
  13254. },
  13255. "description": {
  13256. "type": "string"
  13257. },
  13258. "mode": {
  13259. "type": "string",
  13260. "enum": ["subagent", "primary", "all"]
  13261. },
  13262. "native": {
  13263. "type": "boolean"
  13264. },
  13265. "hidden": {
  13266. "type": "boolean"
  13267. },
  13268. "topP": {
  13269. "type": "number"
  13270. },
  13271. "temperature": {
  13272. "type": "number"
  13273. },
  13274. "color": {
  13275. "type": "string"
  13276. },
  13277. "permission": {
  13278. "$ref": "#/components/schemas/PermissionRuleset"
  13279. },
  13280. "model": {
  13281. "type": "object",
  13282. "properties": {
  13283. "modelID": {
  13284. "type": "string"
  13285. },
  13286. "providerID": {
  13287. "type": "string"
  13288. }
  13289. },
  13290. "required": ["modelID", "providerID"],
  13291. "additionalProperties": false
  13292. },
  13293. "variant": {
  13294. "type": "string"
  13295. },
  13296. "prompt": {
  13297. "type": "string"
  13298. },
  13299. "options": {
  13300. "type": "object"
  13301. },
  13302. "steps": {
  13303. "type": "number"
  13304. }
  13305. },
  13306. "required": ["name", "mode", "permission", "options"],
  13307. "additionalProperties": false
  13308. },
  13309. "LSPStatus": {
  13310. "type": "object",
  13311. "properties": {
  13312. "id": {
  13313. "type": "string"
  13314. },
  13315. "name": {
  13316. "type": "string"
  13317. },
  13318. "root": {
  13319. "type": "string"
  13320. },
  13321. "status": {
  13322. "type": "string",
  13323. "enum": ["connected", "error"]
  13324. }
  13325. },
  13326. "required": ["id", "name", "root", "status"],
  13327. "additionalProperties": false
  13328. },
  13329. "FormatterStatus": {
  13330. "type": "object",
  13331. "properties": {
  13332. "name": {
  13333. "type": "string"
  13334. },
  13335. "extensions": {
  13336. "type": "array",
  13337. "items": {
  13338. "type": "string"
  13339. }
  13340. },
  13341. "enabled": {
  13342. "type": "boolean"
  13343. }
  13344. },
  13345. "required": ["name", "extensions", "enabled"],
  13346. "additionalProperties": false
  13347. },
  13348. "MCPStatusConnected": {
  13349. "type": "object",
  13350. "properties": {
  13351. "status": {
  13352. "type": "string",
  13353. "enum": ["connected"]
  13354. }
  13355. },
  13356. "required": ["status"],
  13357. "additionalProperties": false
  13358. },
  13359. "MCPStatusDisabled": {
  13360. "type": "object",
  13361. "properties": {
  13362. "status": {
  13363. "type": "string",
  13364. "enum": ["disabled"]
  13365. }
  13366. },
  13367. "required": ["status"],
  13368. "additionalProperties": false
  13369. },
  13370. "MCPStatusFailed": {
  13371. "type": "object",
  13372. "properties": {
  13373. "status": {
  13374. "type": "string",
  13375. "enum": ["failed"]
  13376. },
  13377. "error": {
  13378. "type": "string"
  13379. }
  13380. },
  13381. "required": ["status", "error"],
  13382. "additionalProperties": false
  13383. },
  13384. "MCPStatusNeedsAuth": {
  13385. "type": "object",
  13386. "properties": {
  13387. "status": {
  13388. "type": "string",
  13389. "enum": ["needs_auth"]
  13390. }
  13391. },
  13392. "required": ["status"],
  13393. "additionalProperties": false
  13394. },
  13395. "MCPStatusNeedsClientRegistration": {
  13396. "type": "object",
  13397. "properties": {
  13398. "status": {
  13399. "type": "string",
  13400. "enum": ["needs_client_registration"]
  13401. },
  13402. "error": {
  13403. "type": "string"
  13404. }
  13405. },
  13406. "required": ["status", "error"],
  13407. "additionalProperties": false
  13408. },
  13409. "MCPStatus": {
  13410. "anyOf": [
  13411. {
  13412. "$ref": "#/components/schemas/MCPStatusConnected"
  13413. },
  13414. {
  13415. "$ref": "#/components/schemas/MCPStatusDisabled"
  13416. },
  13417. {
  13418. "$ref": "#/components/schemas/MCPStatusFailed"
  13419. },
  13420. {
  13421. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  13422. },
  13423. {
  13424. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  13425. }
  13426. ]
  13427. },
  13428. "McpUnsupportedOAuthError": {
  13429. "type": "object",
  13430. "properties": {
  13431. "error": {
  13432. "type": "string"
  13433. }
  13434. },
  13435. "required": ["error"],
  13436. "additionalProperties": false
  13437. },
  13438. "NotFoundError": {
  13439. "type": "object",
  13440. "required": ["name", "data"],
  13441. "properties": {
  13442. "name": {
  13443. "type": "string",
  13444. "enum": ["NotFoundError"]
  13445. },
  13446. "data": {
  13447. "type": "object",
  13448. "required": ["message"],
  13449. "properties": {
  13450. "message": {
  13451. "type": "string"
  13452. }
  13453. }
  13454. }
  13455. }
  13456. },
  13457. "effect_HttpApiError_Forbidden": {
  13458. "type": "object",
  13459. "properties": {
  13460. "_tag": {
  13461. "type": "string",
  13462. "enum": ["Forbidden"]
  13463. }
  13464. },
  13465. "required": ["_tag"],
  13466. "additionalProperties": false
  13467. },
  13468. "ProviderAuthMethod": {
  13469. "type": "object",
  13470. "properties": {
  13471. "type": {
  13472. "type": "string",
  13473. "enum": ["oauth", "api"]
  13474. },
  13475. "label": {
  13476. "type": "string"
  13477. },
  13478. "prompts": {
  13479. "type": "array",
  13480. "items": {
  13481. "anyOf": [
  13482. {
  13483. "type": "object",
  13484. "properties": {
  13485. "type": {
  13486. "type": "string",
  13487. "enum": ["text"]
  13488. },
  13489. "key": {
  13490. "type": "string"
  13491. },
  13492. "message": {
  13493. "type": "string"
  13494. },
  13495. "placeholder": {
  13496. "type": "string"
  13497. },
  13498. "when": {
  13499. "type": "object",
  13500. "properties": {
  13501. "key": {
  13502. "type": "string"
  13503. },
  13504. "op": {
  13505. "type": "string",
  13506. "enum": ["eq", "neq"]
  13507. },
  13508. "value": {
  13509. "type": "string"
  13510. }
  13511. },
  13512. "required": ["key", "op", "value"],
  13513. "additionalProperties": false
  13514. }
  13515. },
  13516. "required": ["type", "key", "message"],
  13517. "additionalProperties": false
  13518. },
  13519. {
  13520. "type": "object",
  13521. "properties": {
  13522. "type": {
  13523. "type": "string",
  13524. "enum": ["select"]
  13525. },
  13526. "key": {
  13527. "type": "string"
  13528. },
  13529. "message": {
  13530. "type": "string"
  13531. },
  13532. "options": {
  13533. "type": "array",
  13534. "items": {
  13535. "type": "object",
  13536. "properties": {
  13537. "label": {
  13538. "type": "string"
  13539. },
  13540. "value": {
  13541. "type": "string"
  13542. },
  13543. "hint": {
  13544. "type": "string"
  13545. }
  13546. },
  13547. "required": ["label", "value"],
  13548. "additionalProperties": false
  13549. }
  13550. },
  13551. "when": {
  13552. "type": "object",
  13553. "properties": {
  13554. "key": {
  13555. "type": "string"
  13556. },
  13557. "op": {
  13558. "type": "string",
  13559. "enum": ["eq", "neq"]
  13560. },
  13561. "value": {
  13562. "type": "string"
  13563. }
  13564. },
  13565. "required": ["key", "op", "value"],
  13566. "additionalProperties": false
  13567. }
  13568. },
  13569. "required": ["type", "key", "message", "options"],
  13570. "additionalProperties": false
  13571. }
  13572. ]
  13573. }
  13574. }
  13575. },
  13576. "required": ["type", "label"],
  13577. "additionalProperties": false
  13578. },
  13579. "ProviderAuthAuthorization": {
  13580. "type": "object",
  13581. "properties": {
  13582. "url": {
  13583. "type": "string"
  13584. },
  13585. "method": {
  13586. "type": "string",
  13587. "enum": ["auto", "code"]
  13588. },
  13589. "instructions": {
  13590. "type": "string"
  13591. }
  13592. },
  13593. "required": ["url", "method", "instructions"],
  13594. "additionalProperties": false
  13595. },
  13596. "TextPartInput": {
  13597. "type": "object",
  13598. "properties": {
  13599. "id": {
  13600. "type": "string",
  13601. "pattern": "^prt"
  13602. },
  13603. "type": {
  13604. "type": "string",
  13605. "enum": ["text"]
  13606. },
  13607. "text": {
  13608. "type": "string"
  13609. },
  13610. "synthetic": {
  13611. "type": "boolean"
  13612. },
  13613. "ignored": {
  13614. "type": "boolean"
  13615. },
  13616. "time": {
  13617. "type": "object",
  13618. "properties": {
  13619. "start": {
  13620. "type": "integer",
  13621. "minimum": 0
  13622. },
  13623. "end": {
  13624. "type": "integer",
  13625. "minimum": 0
  13626. }
  13627. },
  13628. "required": ["start"],
  13629. "additionalProperties": false
  13630. },
  13631. "metadata": {
  13632. "type": "object"
  13633. }
  13634. },
  13635. "required": ["type", "text"],
  13636. "additionalProperties": false
  13637. },
  13638. "FilePartInput": {
  13639. "type": "object",
  13640. "properties": {
  13641. "id": {
  13642. "type": "string",
  13643. "pattern": "^prt"
  13644. },
  13645. "type": {
  13646. "type": "string",
  13647. "enum": ["file"]
  13648. },
  13649. "mime": {
  13650. "type": "string"
  13651. },
  13652. "filename": {
  13653. "type": "string"
  13654. },
  13655. "url": {
  13656. "type": "string"
  13657. },
  13658. "source": {
  13659. "$ref": "#/components/schemas/FilePartSource"
  13660. }
  13661. },
  13662. "required": ["type", "mime", "url"],
  13663. "additionalProperties": false
  13664. },
  13665. "AgentPartInput": {
  13666. "type": "object",
  13667. "properties": {
  13668. "id": {
  13669. "type": "string",
  13670. "pattern": "^prt"
  13671. },
  13672. "type": {
  13673. "type": "string",
  13674. "enum": ["agent"]
  13675. },
  13676. "name": {
  13677. "type": "string"
  13678. },
  13679. "source": {
  13680. "type": "object",
  13681. "properties": {
  13682. "value": {
  13683. "type": "string"
  13684. },
  13685. "start": {
  13686. "type": "integer",
  13687. "minimum": 0
  13688. },
  13689. "end": {
  13690. "type": "integer",
  13691. "minimum": 0
  13692. }
  13693. },
  13694. "required": ["value", "start", "end"],
  13695. "additionalProperties": false
  13696. }
  13697. },
  13698. "required": ["type", "name"],
  13699. "additionalProperties": false
  13700. },
  13701. "SubtaskPartInput": {
  13702. "type": "object",
  13703. "properties": {
  13704. "id": {
  13705. "type": "string",
  13706. "pattern": "^prt"
  13707. },
  13708. "type": {
  13709. "type": "string",
  13710. "enum": ["subtask"]
  13711. },
  13712. "prompt": {
  13713. "type": "string"
  13714. },
  13715. "description": {
  13716. "type": "string"
  13717. },
  13718. "agent": {
  13719. "type": "string"
  13720. },
  13721. "model": {
  13722. "type": "object",
  13723. "properties": {
  13724. "providerID": {
  13725. "type": "string"
  13726. },
  13727. "modelID": {
  13728. "type": "string"
  13729. }
  13730. },
  13731. "required": ["providerID", "modelID"],
  13732. "additionalProperties": false
  13733. },
  13734. "command": {
  13735. "type": "string"
  13736. }
  13737. },
  13738. "required": ["type", "prompt", "description", "agent"],
  13739. "additionalProperties": false
  13740. },
  13741. "V2SessionsResponse": {
  13742. "type": "object",
  13743. "properties": {
  13744. "items": {
  13745. "type": "array",
  13746. "items": {
  13747. "$ref": "#/components/schemas/SessionInfo"
  13748. }
  13749. },
  13750. "cursor": {
  13751. "type": "object",
  13752. "properties": {
  13753. "previous": {
  13754. "type": "string"
  13755. },
  13756. "next": {
  13757. "type": "string"
  13758. }
  13759. },
  13760. "additionalProperties": false
  13761. }
  13762. },
  13763. "required": ["items", "cursor"],
  13764. "additionalProperties": false
  13765. },
  13766. "V2SessionMessagesResponse": {
  13767. "type": "object",
  13768. "properties": {
  13769. "items": {
  13770. "type": "array",
  13771. "items": {
  13772. "$ref": "#/components/schemas/SessionMessage"
  13773. }
  13774. },
  13775. "cursor": {
  13776. "type": "object",
  13777. "properties": {
  13778. "previous": {
  13779. "type": "string"
  13780. },
  13781. "next": {
  13782. "type": "string"
  13783. }
  13784. },
  13785. "additionalProperties": false
  13786. }
  13787. },
  13788. "required": ["items", "cursor"],
  13789. "additionalProperties": false
  13790. },
  13791. "EventTuiPromptAppend": {
  13792. "type": "object",
  13793. "properties": {
  13794. "type": {
  13795. "type": "string",
  13796. "enum": ["tui.prompt.append"]
  13797. },
  13798. "properties": {
  13799. "type": "object",
  13800. "properties": {
  13801. "text": {
  13802. "type": "string"
  13803. }
  13804. },
  13805. "required": ["text"],
  13806. "additionalProperties": false
  13807. }
  13808. },
  13809. "required": ["type", "properties"],
  13810. "additionalProperties": false
  13811. },
  13812. "EventTuiCommandExecute": {
  13813. "type": "object",
  13814. "properties": {
  13815. "type": {
  13816. "type": "string",
  13817. "enum": ["tui.command.execute"]
  13818. },
  13819. "properties": {
  13820. "type": "object",
  13821. "properties": {
  13822. "command": {
  13823. "anyOf": [
  13824. {
  13825. "type": "string",
  13826. "enum": [
  13827. "session.list",
  13828. "session.new",
  13829. "session.share",
  13830. "session.interrupt",
  13831. "session.compact",
  13832. "session.page.up",
  13833. "session.page.down",
  13834. "session.line.up",
  13835. "session.line.down",
  13836. "session.half.page.up",
  13837. "session.half.page.down",
  13838. "session.first",
  13839. "session.last",
  13840. "prompt.clear",
  13841. "prompt.submit",
  13842. "agent.cycle"
  13843. ]
  13844. },
  13845. {
  13846. "type": "string"
  13847. }
  13848. ]
  13849. }
  13850. },
  13851. "required": ["command"],
  13852. "additionalProperties": false
  13853. }
  13854. },
  13855. "required": ["type", "properties"],
  13856. "additionalProperties": false
  13857. },
  13858. "EventTuiToastShow": {
  13859. "type": "object",
  13860. "properties": {
  13861. "type": {
  13862. "type": "string",
  13863. "enum": ["tui.toast.show"]
  13864. },
  13865. "properties": {
  13866. "type": "object",
  13867. "properties": {
  13868. "title": {
  13869. "type": "string"
  13870. },
  13871. "message": {
  13872. "type": "string"
  13873. },
  13874. "variant": {
  13875. "type": "string",
  13876. "enum": ["info", "success", "warning", "error"]
  13877. },
  13878. "duration": {
  13879. "type": "integer",
  13880. "exclusiveMinimum": 0
  13881. }
  13882. },
  13883. "required": ["message", "variant"],
  13884. "additionalProperties": false
  13885. }
  13886. },
  13887. "required": ["type", "properties"],
  13888. "additionalProperties": false
  13889. },
  13890. "EventTuiSessionSelect": {
  13891. "type": "object",
  13892. "properties": {
  13893. "type": {
  13894. "type": "string",
  13895. "enum": ["tui.session.select"]
  13896. },
  13897. "properties": {
  13898. "type": "object",
  13899. "properties": {
  13900. "sessionID": {
  13901. "type": "string",
  13902. "pattern": "^ses",
  13903. "description": "Session ID to navigate to"
  13904. }
  13905. },
  13906. "required": ["sessionID"],
  13907. "additionalProperties": false
  13908. }
  13909. },
  13910. "required": ["type", "properties"],
  13911. "additionalProperties": false
  13912. },
  13913. "Workspace": {
  13914. "type": "object",
  13915. "properties": {
  13916. "id": {
  13917. "type": "string",
  13918. "pattern": "^wrk"
  13919. },
  13920. "type": {
  13921. "type": "string"
  13922. },
  13923. "name": {
  13924. "type": "string"
  13925. },
  13926. "branch": {
  13927. "anyOf": [
  13928. {
  13929. "type": "string"
  13930. },
  13931. {
  13932. "type": "null"
  13933. }
  13934. ]
  13935. },
  13936. "directory": {
  13937. "anyOf": [
  13938. {
  13939. "type": "string"
  13940. },
  13941. {
  13942. "type": "null"
  13943. }
  13944. ]
  13945. },
  13946. "extra": {
  13947. "anyOf": [
  13948. {},
  13949. {
  13950. "type": "null"
  13951. }
  13952. ]
  13953. },
  13954. "projectID": {
  13955. "type": "string"
  13956. },
  13957. "timeUsed": {
  13958. "anyOf": [
  13959. {
  13960. "type": "number"
  13961. },
  13962. {
  13963. "type": "string",
  13964. "enum": ["NaN"]
  13965. },
  13966. {
  13967. "type": "string",
  13968. "enum": ["Infinity"]
  13969. },
  13970. {
  13971. "type": "string",
  13972. "enum": ["-Infinity"]
  13973. },
  13974. {
  13975. "type": "string",
  13976. "enum": ["Infinity", "-Infinity", "NaN"]
  13977. }
  13978. ]
  13979. }
  13980. },
  13981. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID", "timeUsed"],
  13982. "additionalProperties": false
  13983. },
  13984. "WorkspaceWarpError": {
  13985. "type": "object",
  13986. "properties": {
  13987. "name": {
  13988. "type": "string",
  13989. "enum": ["WorkspaceWarpError"]
  13990. },
  13991. "data": {
  13992. "type": "object",
  13993. "properties": {
  13994. "message": {
  13995. "type": "string"
  13996. }
  13997. },
  13998. "required": ["message"],
  13999. "additionalProperties": false
  14000. }
  14001. },
  14002. "required": ["name", "data"],
  14003. "additionalProperties": false
  14004. },
  14005. "SyncEventMessageUpdated": {
  14006. "type": "object",
  14007. "properties": {
  14008. "type": {
  14009. "type": "string",
  14010. "enum": ["sync"]
  14011. },
  14012. "name": {
  14013. "type": "string",
  14014. "enum": ["message.updated.1"]
  14015. },
  14016. "id": {
  14017. "type": "string"
  14018. },
  14019. "seq": {
  14020. "type": "number"
  14021. },
  14022. "aggregateID": {
  14023. "type": "string",
  14024. "enum": ["sessionID"]
  14025. },
  14026. "data": {
  14027. "type": "object",
  14028. "properties": {
  14029. "sessionID": {
  14030. "type": "string",
  14031. "pattern": "^ses"
  14032. },
  14033. "info": {
  14034. "$ref": "#/components/schemas/Message"
  14035. }
  14036. },
  14037. "required": ["sessionID", "info"],
  14038. "additionalProperties": false
  14039. }
  14040. },
  14041. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14042. "additionalProperties": false
  14043. },
  14044. "SyncEventMessageRemoved": {
  14045. "type": "object",
  14046. "properties": {
  14047. "type": {
  14048. "type": "string",
  14049. "enum": ["sync"]
  14050. },
  14051. "name": {
  14052. "type": "string",
  14053. "enum": ["message.removed.1"]
  14054. },
  14055. "id": {
  14056. "type": "string"
  14057. },
  14058. "seq": {
  14059. "type": "number"
  14060. },
  14061. "aggregateID": {
  14062. "type": "string",
  14063. "enum": ["sessionID"]
  14064. },
  14065. "data": {
  14066. "type": "object",
  14067. "properties": {
  14068. "sessionID": {
  14069. "type": "string",
  14070. "pattern": "^ses"
  14071. },
  14072. "messageID": {
  14073. "type": "string",
  14074. "pattern": "^msg"
  14075. }
  14076. },
  14077. "required": ["sessionID", "messageID"],
  14078. "additionalProperties": false
  14079. }
  14080. },
  14081. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14082. "additionalProperties": false
  14083. },
  14084. "SyncEventMessagePartUpdated": {
  14085. "type": "object",
  14086. "properties": {
  14087. "type": {
  14088. "type": "string",
  14089. "enum": ["sync"]
  14090. },
  14091. "name": {
  14092. "type": "string",
  14093. "enum": ["message.part.updated.1"]
  14094. },
  14095. "id": {
  14096. "type": "string"
  14097. },
  14098. "seq": {
  14099. "type": "number"
  14100. },
  14101. "aggregateID": {
  14102. "type": "string",
  14103. "enum": ["sessionID"]
  14104. },
  14105. "data": {
  14106. "type": "object",
  14107. "properties": {
  14108. "sessionID": {
  14109. "type": "string",
  14110. "pattern": "^ses"
  14111. },
  14112. "part": {
  14113. "$ref": "#/components/schemas/Part"
  14114. },
  14115. "time": {
  14116. "type": "integer",
  14117. "minimum": 0
  14118. }
  14119. },
  14120. "required": ["sessionID", "part", "time"],
  14121. "additionalProperties": false
  14122. }
  14123. },
  14124. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14125. "additionalProperties": false
  14126. },
  14127. "SyncEventMessagePartRemoved": {
  14128. "type": "object",
  14129. "properties": {
  14130. "type": {
  14131. "type": "string",
  14132. "enum": ["sync"]
  14133. },
  14134. "name": {
  14135. "type": "string",
  14136. "enum": ["message.part.removed.1"]
  14137. },
  14138. "id": {
  14139. "type": "string"
  14140. },
  14141. "seq": {
  14142. "type": "number"
  14143. },
  14144. "aggregateID": {
  14145. "type": "string",
  14146. "enum": ["sessionID"]
  14147. },
  14148. "data": {
  14149. "type": "object",
  14150. "properties": {
  14151. "sessionID": {
  14152. "type": "string",
  14153. "pattern": "^ses"
  14154. },
  14155. "messageID": {
  14156. "type": "string",
  14157. "pattern": "^msg"
  14158. },
  14159. "partID": {
  14160. "type": "string",
  14161. "pattern": "^prt"
  14162. }
  14163. },
  14164. "required": ["sessionID", "messageID", "partID"],
  14165. "additionalProperties": false
  14166. }
  14167. },
  14168. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14169. "additionalProperties": false
  14170. },
  14171. "SyncEventSessionCreated": {
  14172. "type": "object",
  14173. "properties": {
  14174. "type": {
  14175. "type": "string",
  14176. "enum": ["sync"]
  14177. },
  14178. "name": {
  14179. "type": "string",
  14180. "enum": ["session.created.1"]
  14181. },
  14182. "id": {
  14183. "type": "string"
  14184. },
  14185. "seq": {
  14186. "type": "number"
  14187. },
  14188. "aggregateID": {
  14189. "type": "string",
  14190. "enum": ["sessionID"]
  14191. },
  14192. "data": {
  14193. "type": "object",
  14194. "properties": {
  14195. "sessionID": {
  14196. "type": "string",
  14197. "pattern": "^ses"
  14198. },
  14199. "info": {
  14200. "$ref": "#/components/schemas/Session"
  14201. }
  14202. },
  14203. "required": ["sessionID", "info"],
  14204. "additionalProperties": false
  14205. }
  14206. },
  14207. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14208. "additionalProperties": false
  14209. },
  14210. "SyncEventSessionUpdated": {
  14211. "type": "object",
  14212. "properties": {
  14213. "type": {
  14214. "type": "string",
  14215. "enum": ["sync"]
  14216. },
  14217. "name": {
  14218. "type": "string",
  14219. "enum": ["session.updated.1"]
  14220. },
  14221. "id": {
  14222. "type": "string"
  14223. },
  14224. "seq": {
  14225. "type": "number"
  14226. },
  14227. "aggregateID": {
  14228. "type": "string",
  14229. "enum": ["sessionID"]
  14230. },
  14231. "data": {
  14232. "type": "object",
  14233. "properties": {
  14234. "sessionID": {
  14235. "type": "string",
  14236. "pattern": "^ses"
  14237. },
  14238. "info": {
  14239. "type": "object",
  14240. "properties": {
  14241. "id": {
  14242. "anyOf": [
  14243. {
  14244. "type": "string",
  14245. "pattern": "^ses"
  14246. },
  14247. {
  14248. "type": "null"
  14249. }
  14250. ]
  14251. },
  14252. "slug": {
  14253. "anyOf": [
  14254. {
  14255. "type": "string"
  14256. },
  14257. {
  14258. "type": "null"
  14259. }
  14260. ]
  14261. },
  14262. "projectID": {
  14263. "anyOf": [
  14264. {
  14265. "type": "string"
  14266. },
  14267. {
  14268. "type": "null"
  14269. }
  14270. ]
  14271. },
  14272. "workspaceID": {
  14273. "anyOf": [
  14274. {
  14275. "type": "string",
  14276. "pattern": "^wrk"
  14277. },
  14278. {
  14279. "type": "null"
  14280. }
  14281. ]
  14282. },
  14283. "directory": {
  14284. "anyOf": [
  14285. {
  14286. "type": "string"
  14287. },
  14288. {
  14289. "type": "null"
  14290. }
  14291. ]
  14292. },
  14293. "path": {
  14294. "anyOf": [
  14295. {
  14296. "type": "string"
  14297. },
  14298. {
  14299. "type": "null"
  14300. }
  14301. ]
  14302. },
  14303. "parentID": {
  14304. "anyOf": [
  14305. {
  14306. "type": "string",
  14307. "pattern": "^ses"
  14308. },
  14309. {
  14310. "type": "null"
  14311. }
  14312. ]
  14313. },
  14314. "summary": {
  14315. "anyOf": [
  14316. {
  14317. "type": "object",
  14318. "properties": {
  14319. "additions": {
  14320. "type": "number"
  14321. },
  14322. "deletions": {
  14323. "type": "number"
  14324. },
  14325. "files": {
  14326. "type": "number"
  14327. },
  14328. "diffs": {
  14329. "type": "array",
  14330. "items": {
  14331. "$ref": "#/components/schemas/SnapshotFileDiff"
  14332. }
  14333. }
  14334. },
  14335. "required": ["additions", "deletions", "files"],
  14336. "additionalProperties": false
  14337. },
  14338. {
  14339. "type": "null"
  14340. }
  14341. ]
  14342. },
  14343. "share": {
  14344. "type": "object",
  14345. "properties": {
  14346. "url": {
  14347. "anyOf": [
  14348. {
  14349. "type": "string"
  14350. },
  14351. {
  14352. "type": "null"
  14353. }
  14354. ]
  14355. }
  14356. },
  14357. "additionalProperties": false
  14358. },
  14359. "title": {
  14360. "anyOf": [
  14361. {
  14362. "type": "string"
  14363. },
  14364. {
  14365. "type": "null"
  14366. }
  14367. ]
  14368. },
  14369. "agent": {
  14370. "anyOf": [
  14371. {
  14372. "type": "string"
  14373. },
  14374. {
  14375. "type": "null"
  14376. }
  14377. ]
  14378. },
  14379. "model": {
  14380. "anyOf": [
  14381. {
  14382. "type": "object",
  14383. "properties": {
  14384. "id": {
  14385. "type": "string"
  14386. },
  14387. "providerID": {
  14388. "type": "string"
  14389. },
  14390. "variant": {
  14391. "type": "string"
  14392. }
  14393. },
  14394. "required": ["id", "providerID"],
  14395. "additionalProperties": false
  14396. },
  14397. {
  14398. "type": "null"
  14399. }
  14400. ]
  14401. },
  14402. "version": {
  14403. "anyOf": [
  14404. {
  14405. "type": "string"
  14406. },
  14407. {
  14408. "type": "null"
  14409. }
  14410. ]
  14411. },
  14412. "time": {
  14413. "type": "object",
  14414. "properties": {
  14415. "created": {
  14416. "anyOf": [
  14417. {
  14418. "type": "integer",
  14419. "minimum": 0
  14420. },
  14421. {
  14422. "type": "null"
  14423. }
  14424. ]
  14425. },
  14426. "updated": {
  14427. "anyOf": [
  14428. {
  14429. "type": "integer",
  14430. "minimum": 0
  14431. },
  14432. {
  14433. "type": "null"
  14434. }
  14435. ]
  14436. },
  14437. "compacting": {
  14438. "anyOf": [
  14439. {
  14440. "type": "integer",
  14441. "minimum": 0
  14442. },
  14443. {
  14444. "type": "null"
  14445. }
  14446. ]
  14447. },
  14448. "archived": {
  14449. "anyOf": [
  14450. {
  14451. "type": "number"
  14452. },
  14453. {
  14454. "type": "null"
  14455. }
  14456. ]
  14457. }
  14458. },
  14459. "additionalProperties": false
  14460. },
  14461. "permission": {
  14462. "anyOf": [
  14463. {
  14464. "$ref": "#/components/schemas/PermissionRuleset"
  14465. },
  14466. {
  14467. "type": "null"
  14468. }
  14469. ]
  14470. },
  14471. "revert": {
  14472. "anyOf": [
  14473. {
  14474. "type": "object",
  14475. "properties": {
  14476. "messageID": {
  14477. "type": "string",
  14478. "pattern": "^msg"
  14479. },
  14480. "partID": {
  14481. "type": "string",
  14482. "pattern": "^prt"
  14483. },
  14484. "snapshot": {
  14485. "type": "string"
  14486. },
  14487. "diff": {
  14488. "type": "string"
  14489. }
  14490. },
  14491. "required": ["messageID"],
  14492. "additionalProperties": false
  14493. },
  14494. {
  14495. "type": "null"
  14496. }
  14497. ]
  14498. }
  14499. },
  14500. "additionalProperties": false
  14501. }
  14502. },
  14503. "required": ["sessionID", "info"],
  14504. "additionalProperties": false
  14505. }
  14506. },
  14507. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14508. "additionalProperties": false
  14509. },
  14510. "SyncEventSessionDeleted": {
  14511. "type": "object",
  14512. "properties": {
  14513. "type": {
  14514. "type": "string",
  14515. "enum": ["sync"]
  14516. },
  14517. "name": {
  14518. "type": "string",
  14519. "enum": ["session.deleted.1"]
  14520. },
  14521. "id": {
  14522. "type": "string"
  14523. },
  14524. "seq": {
  14525. "type": "number"
  14526. },
  14527. "aggregateID": {
  14528. "type": "string",
  14529. "enum": ["sessionID"]
  14530. },
  14531. "data": {
  14532. "type": "object",
  14533. "properties": {
  14534. "sessionID": {
  14535. "type": "string",
  14536. "pattern": "^ses"
  14537. },
  14538. "info": {
  14539. "$ref": "#/components/schemas/Session"
  14540. }
  14541. },
  14542. "required": ["sessionID", "info"],
  14543. "additionalProperties": false
  14544. }
  14545. },
  14546. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14547. "additionalProperties": false
  14548. },
  14549. "SyncEventSessionNextAgentSwitched": {
  14550. "type": "object",
  14551. "properties": {
  14552. "type": {
  14553. "type": "string",
  14554. "enum": ["sync"]
  14555. },
  14556. "name": {
  14557. "type": "string",
  14558. "enum": ["session.next.agent.switched.1"]
  14559. },
  14560. "id": {
  14561. "type": "string"
  14562. },
  14563. "seq": {
  14564. "type": "number"
  14565. },
  14566. "aggregateID": {
  14567. "type": "string",
  14568. "enum": ["sessionID"]
  14569. },
  14570. "data": {
  14571. "type": "object",
  14572. "properties": {
  14573. "timestamp": {
  14574. "type": "number"
  14575. },
  14576. "sessionID": {
  14577. "type": "string",
  14578. "pattern": "^ses"
  14579. },
  14580. "agent": {
  14581. "type": "string"
  14582. }
  14583. },
  14584. "required": ["timestamp", "sessionID", "agent"],
  14585. "additionalProperties": false
  14586. }
  14587. },
  14588. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14589. "additionalProperties": false
  14590. },
  14591. "SyncEventSessionNextModelSwitched": {
  14592. "type": "object",
  14593. "properties": {
  14594. "type": {
  14595. "type": "string",
  14596. "enum": ["sync"]
  14597. },
  14598. "name": {
  14599. "type": "string",
  14600. "enum": ["session.next.model.switched.1"]
  14601. },
  14602. "id": {
  14603. "type": "string"
  14604. },
  14605. "seq": {
  14606. "type": "number"
  14607. },
  14608. "aggregateID": {
  14609. "type": "string",
  14610. "enum": ["sessionID"]
  14611. },
  14612. "data": {
  14613. "type": "object",
  14614. "properties": {
  14615. "timestamp": {
  14616. "type": "number"
  14617. },
  14618. "sessionID": {
  14619. "type": "string",
  14620. "pattern": "^ses"
  14621. },
  14622. "model": {
  14623. "type": "object",
  14624. "properties": {
  14625. "id": {
  14626. "type": "string"
  14627. },
  14628. "providerID": {
  14629. "type": "string"
  14630. },
  14631. "variant": {
  14632. "type": "string"
  14633. }
  14634. },
  14635. "required": ["id", "providerID", "variant"],
  14636. "additionalProperties": false
  14637. }
  14638. },
  14639. "required": ["timestamp", "sessionID", "model"],
  14640. "additionalProperties": false
  14641. }
  14642. },
  14643. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14644. "additionalProperties": false
  14645. },
  14646. "SyncEventSessionNextPrompted": {
  14647. "type": "object",
  14648. "properties": {
  14649. "type": {
  14650. "type": "string",
  14651. "enum": ["sync"]
  14652. },
  14653. "name": {
  14654. "type": "string",
  14655. "enum": ["session.next.prompted.1"]
  14656. },
  14657. "id": {
  14658. "type": "string"
  14659. },
  14660. "seq": {
  14661. "type": "number"
  14662. },
  14663. "aggregateID": {
  14664. "type": "string",
  14665. "enum": ["sessionID"]
  14666. },
  14667. "data": {
  14668. "type": "object",
  14669. "properties": {
  14670. "timestamp": {
  14671. "type": "number"
  14672. },
  14673. "sessionID": {
  14674. "type": "string",
  14675. "pattern": "^ses"
  14676. },
  14677. "prompt": {
  14678. "$ref": "#/components/schemas/Prompt"
  14679. }
  14680. },
  14681. "required": ["timestamp", "sessionID", "prompt"],
  14682. "additionalProperties": false
  14683. }
  14684. },
  14685. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14686. "additionalProperties": false
  14687. },
  14688. "SyncEventSessionNextSynthetic": {
  14689. "type": "object",
  14690. "properties": {
  14691. "type": {
  14692. "type": "string",
  14693. "enum": ["sync"]
  14694. },
  14695. "name": {
  14696. "type": "string",
  14697. "enum": ["session.next.synthetic.1"]
  14698. },
  14699. "id": {
  14700. "type": "string"
  14701. },
  14702. "seq": {
  14703. "type": "number"
  14704. },
  14705. "aggregateID": {
  14706. "type": "string",
  14707. "enum": ["sessionID"]
  14708. },
  14709. "data": {
  14710. "type": "object",
  14711. "properties": {
  14712. "timestamp": {
  14713. "type": "number"
  14714. },
  14715. "sessionID": {
  14716. "type": "string",
  14717. "pattern": "^ses"
  14718. },
  14719. "text": {
  14720. "type": "string"
  14721. }
  14722. },
  14723. "required": ["timestamp", "sessionID", "text"],
  14724. "additionalProperties": false
  14725. }
  14726. },
  14727. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14728. "additionalProperties": false
  14729. },
  14730. "SyncEventSessionNextShellStarted": {
  14731. "type": "object",
  14732. "properties": {
  14733. "type": {
  14734. "type": "string",
  14735. "enum": ["sync"]
  14736. },
  14737. "name": {
  14738. "type": "string",
  14739. "enum": ["session.next.shell.started.1"]
  14740. },
  14741. "id": {
  14742. "type": "string"
  14743. },
  14744. "seq": {
  14745. "type": "number"
  14746. },
  14747. "aggregateID": {
  14748. "type": "string",
  14749. "enum": ["sessionID"]
  14750. },
  14751. "data": {
  14752. "type": "object",
  14753. "properties": {
  14754. "timestamp": {
  14755. "type": "number"
  14756. },
  14757. "sessionID": {
  14758. "type": "string",
  14759. "pattern": "^ses"
  14760. },
  14761. "callID": {
  14762. "type": "string"
  14763. },
  14764. "command": {
  14765. "type": "string"
  14766. }
  14767. },
  14768. "required": ["timestamp", "sessionID", "callID", "command"],
  14769. "additionalProperties": false
  14770. }
  14771. },
  14772. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14773. "additionalProperties": false
  14774. },
  14775. "SyncEventSessionNextShellEnded": {
  14776. "type": "object",
  14777. "properties": {
  14778. "type": {
  14779. "type": "string",
  14780. "enum": ["sync"]
  14781. },
  14782. "name": {
  14783. "type": "string",
  14784. "enum": ["session.next.shell.ended.1"]
  14785. },
  14786. "id": {
  14787. "type": "string"
  14788. },
  14789. "seq": {
  14790. "type": "number"
  14791. },
  14792. "aggregateID": {
  14793. "type": "string",
  14794. "enum": ["sessionID"]
  14795. },
  14796. "data": {
  14797. "type": "object",
  14798. "properties": {
  14799. "timestamp": {
  14800. "type": "number"
  14801. },
  14802. "sessionID": {
  14803. "type": "string",
  14804. "pattern": "^ses"
  14805. },
  14806. "callID": {
  14807. "type": "string"
  14808. },
  14809. "output": {
  14810. "type": "string"
  14811. }
  14812. },
  14813. "required": ["timestamp", "sessionID", "callID", "output"],
  14814. "additionalProperties": false
  14815. }
  14816. },
  14817. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14818. "additionalProperties": false
  14819. },
  14820. "SyncEventSessionNextStepStarted": {
  14821. "type": "object",
  14822. "properties": {
  14823. "type": {
  14824. "type": "string",
  14825. "enum": ["sync"]
  14826. },
  14827. "name": {
  14828. "type": "string",
  14829. "enum": ["session.next.step.started.1"]
  14830. },
  14831. "id": {
  14832. "type": "string"
  14833. },
  14834. "seq": {
  14835. "type": "number"
  14836. },
  14837. "aggregateID": {
  14838. "type": "string",
  14839. "enum": ["sessionID"]
  14840. },
  14841. "data": {
  14842. "type": "object",
  14843. "properties": {
  14844. "timestamp": {
  14845. "type": "number"
  14846. },
  14847. "sessionID": {
  14848. "type": "string",
  14849. "pattern": "^ses"
  14850. },
  14851. "agent": {
  14852. "type": "string"
  14853. },
  14854. "model": {
  14855. "type": "object",
  14856. "properties": {
  14857. "id": {
  14858. "type": "string"
  14859. },
  14860. "providerID": {
  14861. "type": "string"
  14862. },
  14863. "variant": {
  14864. "type": "string"
  14865. }
  14866. },
  14867. "required": ["id", "providerID", "variant"],
  14868. "additionalProperties": false
  14869. },
  14870. "snapshot": {
  14871. "type": "string"
  14872. }
  14873. },
  14874. "required": ["timestamp", "sessionID", "agent", "model"],
  14875. "additionalProperties": false
  14876. }
  14877. },
  14878. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14879. "additionalProperties": false
  14880. },
  14881. "SyncEventSessionNextStepEnded": {
  14882. "type": "object",
  14883. "properties": {
  14884. "type": {
  14885. "type": "string",
  14886. "enum": ["sync"]
  14887. },
  14888. "name": {
  14889. "type": "string",
  14890. "enum": ["session.next.step.ended.1"]
  14891. },
  14892. "id": {
  14893. "type": "string"
  14894. },
  14895. "seq": {
  14896. "type": "number"
  14897. },
  14898. "aggregateID": {
  14899. "type": "string",
  14900. "enum": ["sessionID"]
  14901. },
  14902. "data": {
  14903. "type": "object",
  14904. "properties": {
  14905. "timestamp": {
  14906. "type": "number"
  14907. },
  14908. "sessionID": {
  14909. "type": "string",
  14910. "pattern": "^ses"
  14911. },
  14912. "finish": {
  14913. "type": "string"
  14914. },
  14915. "cost": {
  14916. "type": "number"
  14917. },
  14918. "tokens": {
  14919. "type": "object",
  14920. "properties": {
  14921. "input": {
  14922. "type": "number"
  14923. },
  14924. "output": {
  14925. "type": "number"
  14926. },
  14927. "reasoning": {
  14928. "type": "number"
  14929. },
  14930. "cache": {
  14931. "type": "object",
  14932. "properties": {
  14933. "read": {
  14934. "type": "number"
  14935. },
  14936. "write": {
  14937. "type": "number"
  14938. }
  14939. },
  14940. "required": ["read", "write"],
  14941. "additionalProperties": false
  14942. }
  14943. },
  14944. "required": ["input", "output", "reasoning", "cache"],
  14945. "additionalProperties": false
  14946. },
  14947. "snapshot": {
  14948. "type": "string"
  14949. }
  14950. },
  14951. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  14952. "additionalProperties": false
  14953. }
  14954. },
  14955. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14956. "additionalProperties": false
  14957. },
  14958. "SyncEventSessionNextStepFailed": {
  14959. "type": "object",
  14960. "properties": {
  14961. "type": {
  14962. "type": "string",
  14963. "enum": ["sync"]
  14964. },
  14965. "name": {
  14966. "type": "string",
  14967. "enum": ["session.next.step.failed.1"]
  14968. },
  14969. "id": {
  14970. "type": "string"
  14971. },
  14972. "seq": {
  14973. "type": "number"
  14974. },
  14975. "aggregateID": {
  14976. "type": "string",
  14977. "enum": ["sessionID"]
  14978. },
  14979. "data": {
  14980. "type": "object",
  14981. "properties": {
  14982. "timestamp": {
  14983. "type": "number"
  14984. },
  14985. "sessionID": {
  14986. "type": "string",
  14987. "pattern": "^ses"
  14988. },
  14989. "error": {
  14990. "$ref": "#/components/schemas/SessionErrorUnknown"
  14991. }
  14992. },
  14993. "required": ["timestamp", "sessionID", "error"],
  14994. "additionalProperties": false
  14995. }
  14996. },
  14997. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14998. "additionalProperties": false
  14999. },
  15000. "SyncEventSessionNextTextStarted": {
  15001. "type": "object",
  15002. "properties": {
  15003. "type": {
  15004. "type": "string",
  15005. "enum": ["sync"]
  15006. },
  15007. "name": {
  15008. "type": "string",
  15009. "enum": ["session.next.text.started.1"]
  15010. },
  15011. "id": {
  15012. "type": "string"
  15013. },
  15014. "seq": {
  15015. "type": "number"
  15016. },
  15017. "aggregateID": {
  15018. "type": "string",
  15019. "enum": ["sessionID"]
  15020. },
  15021. "data": {
  15022. "type": "object",
  15023. "properties": {
  15024. "timestamp": {
  15025. "type": "number"
  15026. },
  15027. "sessionID": {
  15028. "type": "string",
  15029. "pattern": "^ses"
  15030. }
  15031. },
  15032. "required": ["timestamp", "sessionID"],
  15033. "additionalProperties": false
  15034. }
  15035. },
  15036. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15037. "additionalProperties": false
  15038. },
  15039. "SyncEventSessionNextTextDelta": {
  15040. "type": "object",
  15041. "properties": {
  15042. "type": {
  15043. "type": "string",
  15044. "enum": ["sync"]
  15045. },
  15046. "name": {
  15047. "type": "string",
  15048. "enum": ["session.next.text.delta.1"]
  15049. },
  15050. "id": {
  15051. "type": "string"
  15052. },
  15053. "seq": {
  15054. "type": "number"
  15055. },
  15056. "aggregateID": {
  15057. "type": "string",
  15058. "enum": ["sessionID"]
  15059. },
  15060. "data": {
  15061. "type": "object",
  15062. "properties": {
  15063. "timestamp": {
  15064. "type": "number"
  15065. },
  15066. "sessionID": {
  15067. "type": "string",
  15068. "pattern": "^ses"
  15069. },
  15070. "delta": {
  15071. "type": "string"
  15072. }
  15073. },
  15074. "required": ["timestamp", "sessionID", "delta"],
  15075. "additionalProperties": false
  15076. }
  15077. },
  15078. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15079. "additionalProperties": false
  15080. },
  15081. "SyncEventSessionNextTextEnded": {
  15082. "type": "object",
  15083. "properties": {
  15084. "type": {
  15085. "type": "string",
  15086. "enum": ["sync"]
  15087. },
  15088. "name": {
  15089. "type": "string",
  15090. "enum": ["session.next.text.ended.1"]
  15091. },
  15092. "id": {
  15093. "type": "string"
  15094. },
  15095. "seq": {
  15096. "type": "number"
  15097. },
  15098. "aggregateID": {
  15099. "type": "string",
  15100. "enum": ["sessionID"]
  15101. },
  15102. "data": {
  15103. "type": "object",
  15104. "properties": {
  15105. "timestamp": {
  15106. "type": "number"
  15107. },
  15108. "sessionID": {
  15109. "type": "string",
  15110. "pattern": "^ses"
  15111. },
  15112. "text": {
  15113. "type": "string"
  15114. }
  15115. },
  15116. "required": ["timestamp", "sessionID", "text"],
  15117. "additionalProperties": false
  15118. }
  15119. },
  15120. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15121. "additionalProperties": false
  15122. },
  15123. "SyncEventSessionNextReasoningStarted": {
  15124. "type": "object",
  15125. "properties": {
  15126. "type": {
  15127. "type": "string",
  15128. "enum": ["sync"]
  15129. },
  15130. "name": {
  15131. "type": "string",
  15132. "enum": ["session.next.reasoning.started.1"]
  15133. },
  15134. "id": {
  15135. "type": "string"
  15136. },
  15137. "seq": {
  15138. "type": "number"
  15139. },
  15140. "aggregateID": {
  15141. "type": "string",
  15142. "enum": ["sessionID"]
  15143. },
  15144. "data": {
  15145. "type": "object",
  15146. "properties": {
  15147. "timestamp": {
  15148. "type": "number"
  15149. },
  15150. "sessionID": {
  15151. "type": "string",
  15152. "pattern": "^ses"
  15153. },
  15154. "reasoningID": {
  15155. "type": "string"
  15156. }
  15157. },
  15158. "required": ["timestamp", "sessionID", "reasoningID"],
  15159. "additionalProperties": false
  15160. }
  15161. },
  15162. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15163. "additionalProperties": false
  15164. },
  15165. "SyncEventSessionNextReasoningDelta": {
  15166. "type": "object",
  15167. "properties": {
  15168. "type": {
  15169. "type": "string",
  15170. "enum": ["sync"]
  15171. },
  15172. "name": {
  15173. "type": "string",
  15174. "enum": ["session.next.reasoning.delta.1"]
  15175. },
  15176. "id": {
  15177. "type": "string"
  15178. },
  15179. "seq": {
  15180. "type": "number"
  15181. },
  15182. "aggregateID": {
  15183. "type": "string",
  15184. "enum": ["sessionID"]
  15185. },
  15186. "data": {
  15187. "type": "object",
  15188. "properties": {
  15189. "timestamp": {
  15190. "type": "number"
  15191. },
  15192. "sessionID": {
  15193. "type": "string",
  15194. "pattern": "^ses"
  15195. },
  15196. "reasoningID": {
  15197. "type": "string"
  15198. },
  15199. "delta": {
  15200. "type": "string"
  15201. }
  15202. },
  15203. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  15204. "additionalProperties": false
  15205. }
  15206. },
  15207. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15208. "additionalProperties": false
  15209. },
  15210. "SyncEventSessionNextReasoningEnded": {
  15211. "type": "object",
  15212. "properties": {
  15213. "type": {
  15214. "type": "string",
  15215. "enum": ["sync"]
  15216. },
  15217. "name": {
  15218. "type": "string",
  15219. "enum": ["session.next.reasoning.ended.1"]
  15220. },
  15221. "id": {
  15222. "type": "string"
  15223. },
  15224. "seq": {
  15225. "type": "number"
  15226. },
  15227. "aggregateID": {
  15228. "type": "string",
  15229. "enum": ["sessionID"]
  15230. },
  15231. "data": {
  15232. "type": "object",
  15233. "properties": {
  15234. "timestamp": {
  15235. "type": "number"
  15236. },
  15237. "sessionID": {
  15238. "type": "string",
  15239. "pattern": "^ses"
  15240. },
  15241. "reasoningID": {
  15242. "type": "string"
  15243. },
  15244. "text": {
  15245. "type": "string"
  15246. }
  15247. },
  15248. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  15249. "additionalProperties": false
  15250. }
  15251. },
  15252. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15253. "additionalProperties": false
  15254. },
  15255. "SyncEventSessionNextToolInputStarted": {
  15256. "type": "object",
  15257. "properties": {
  15258. "type": {
  15259. "type": "string",
  15260. "enum": ["sync"]
  15261. },
  15262. "name": {
  15263. "type": "string",
  15264. "enum": ["session.next.tool.input.started.1"]
  15265. },
  15266. "id": {
  15267. "type": "string"
  15268. },
  15269. "seq": {
  15270. "type": "number"
  15271. },
  15272. "aggregateID": {
  15273. "type": "string",
  15274. "enum": ["sessionID"]
  15275. },
  15276. "data": {
  15277. "type": "object",
  15278. "properties": {
  15279. "timestamp": {
  15280. "type": "number"
  15281. },
  15282. "sessionID": {
  15283. "type": "string",
  15284. "pattern": "^ses"
  15285. },
  15286. "callID": {
  15287. "type": "string"
  15288. },
  15289. "name": {
  15290. "type": "string"
  15291. }
  15292. },
  15293. "required": ["timestamp", "sessionID", "callID", "name"],
  15294. "additionalProperties": false
  15295. }
  15296. },
  15297. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15298. "additionalProperties": false
  15299. },
  15300. "SyncEventSessionNextToolInputDelta": {
  15301. "type": "object",
  15302. "properties": {
  15303. "type": {
  15304. "type": "string",
  15305. "enum": ["sync"]
  15306. },
  15307. "name": {
  15308. "type": "string",
  15309. "enum": ["session.next.tool.input.delta.1"]
  15310. },
  15311. "id": {
  15312. "type": "string"
  15313. },
  15314. "seq": {
  15315. "type": "number"
  15316. },
  15317. "aggregateID": {
  15318. "type": "string",
  15319. "enum": ["sessionID"]
  15320. },
  15321. "data": {
  15322. "type": "object",
  15323. "properties": {
  15324. "timestamp": {
  15325. "type": "number"
  15326. },
  15327. "sessionID": {
  15328. "type": "string",
  15329. "pattern": "^ses"
  15330. },
  15331. "callID": {
  15332. "type": "string"
  15333. },
  15334. "delta": {
  15335. "type": "string"
  15336. }
  15337. },
  15338. "required": ["timestamp", "sessionID", "callID", "delta"],
  15339. "additionalProperties": false
  15340. }
  15341. },
  15342. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15343. "additionalProperties": false
  15344. },
  15345. "SyncEventSessionNextToolInputEnded": {
  15346. "type": "object",
  15347. "properties": {
  15348. "type": {
  15349. "type": "string",
  15350. "enum": ["sync"]
  15351. },
  15352. "name": {
  15353. "type": "string",
  15354. "enum": ["session.next.tool.input.ended.1"]
  15355. },
  15356. "id": {
  15357. "type": "string"
  15358. },
  15359. "seq": {
  15360. "type": "number"
  15361. },
  15362. "aggregateID": {
  15363. "type": "string",
  15364. "enum": ["sessionID"]
  15365. },
  15366. "data": {
  15367. "type": "object",
  15368. "properties": {
  15369. "timestamp": {
  15370. "type": "number"
  15371. },
  15372. "sessionID": {
  15373. "type": "string",
  15374. "pattern": "^ses"
  15375. },
  15376. "callID": {
  15377. "type": "string"
  15378. },
  15379. "text": {
  15380. "type": "string"
  15381. }
  15382. },
  15383. "required": ["timestamp", "sessionID", "callID", "text"],
  15384. "additionalProperties": false
  15385. }
  15386. },
  15387. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15388. "additionalProperties": false
  15389. },
  15390. "SyncEventSessionNextToolCalled": {
  15391. "type": "object",
  15392. "properties": {
  15393. "type": {
  15394. "type": "string",
  15395. "enum": ["sync"]
  15396. },
  15397. "name": {
  15398. "type": "string",
  15399. "enum": ["session.next.tool.called.1"]
  15400. },
  15401. "id": {
  15402. "type": "string"
  15403. },
  15404. "seq": {
  15405. "type": "number"
  15406. },
  15407. "aggregateID": {
  15408. "type": "string",
  15409. "enum": ["sessionID"]
  15410. },
  15411. "data": {
  15412. "type": "object",
  15413. "properties": {
  15414. "timestamp": {
  15415. "type": "number"
  15416. },
  15417. "sessionID": {
  15418. "type": "string",
  15419. "pattern": "^ses"
  15420. },
  15421. "callID": {
  15422. "type": "string"
  15423. },
  15424. "tool": {
  15425. "type": "string"
  15426. },
  15427. "input": {
  15428. "type": "object"
  15429. },
  15430. "provider": {
  15431. "type": "object",
  15432. "properties": {
  15433. "executed": {
  15434. "type": "boolean"
  15435. },
  15436. "metadata": {
  15437. "type": "object"
  15438. }
  15439. },
  15440. "required": ["executed"],
  15441. "additionalProperties": false
  15442. }
  15443. },
  15444. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  15445. "additionalProperties": false
  15446. }
  15447. },
  15448. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15449. "additionalProperties": false
  15450. },
  15451. "SyncEventSessionNextToolProgress": {
  15452. "type": "object",
  15453. "properties": {
  15454. "type": {
  15455. "type": "string",
  15456. "enum": ["sync"]
  15457. },
  15458. "name": {
  15459. "type": "string",
  15460. "enum": ["session.next.tool.progress.1"]
  15461. },
  15462. "id": {
  15463. "type": "string"
  15464. },
  15465. "seq": {
  15466. "type": "number"
  15467. },
  15468. "aggregateID": {
  15469. "type": "string",
  15470. "enum": ["sessionID"]
  15471. },
  15472. "data": {
  15473. "type": "object",
  15474. "properties": {
  15475. "timestamp": {
  15476. "type": "number"
  15477. },
  15478. "sessionID": {
  15479. "type": "string",
  15480. "pattern": "^ses"
  15481. },
  15482. "callID": {
  15483. "type": "string"
  15484. },
  15485. "structured": {
  15486. "type": "object"
  15487. },
  15488. "content": {
  15489. "type": "array",
  15490. "items": {
  15491. "anyOf": [
  15492. {
  15493. "$ref": "#/components/schemas/ToolTextContent"
  15494. },
  15495. {
  15496. "$ref": "#/components/schemas/ToolFileContent"
  15497. }
  15498. ]
  15499. }
  15500. }
  15501. },
  15502. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  15503. "additionalProperties": false
  15504. }
  15505. },
  15506. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15507. "additionalProperties": false
  15508. },
  15509. "SyncEventSessionNextToolSuccess": {
  15510. "type": "object",
  15511. "properties": {
  15512. "type": {
  15513. "type": "string",
  15514. "enum": ["sync"]
  15515. },
  15516. "name": {
  15517. "type": "string",
  15518. "enum": ["session.next.tool.success.1"]
  15519. },
  15520. "id": {
  15521. "type": "string"
  15522. },
  15523. "seq": {
  15524. "type": "number"
  15525. },
  15526. "aggregateID": {
  15527. "type": "string",
  15528. "enum": ["sessionID"]
  15529. },
  15530. "data": {
  15531. "type": "object",
  15532. "properties": {
  15533. "timestamp": {
  15534. "type": "number"
  15535. },
  15536. "sessionID": {
  15537. "type": "string",
  15538. "pattern": "^ses"
  15539. },
  15540. "callID": {
  15541. "type": "string"
  15542. },
  15543. "structured": {
  15544. "type": "object"
  15545. },
  15546. "content": {
  15547. "type": "array",
  15548. "items": {
  15549. "anyOf": [
  15550. {
  15551. "$ref": "#/components/schemas/ToolTextContent"
  15552. },
  15553. {
  15554. "$ref": "#/components/schemas/ToolFileContent"
  15555. }
  15556. ]
  15557. }
  15558. },
  15559. "provider": {
  15560. "type": "object",
  15561. "properties": {
  15562. "executed": {
  15563. "type": "boolean"
  15564. },
  15565. "metadata": {
  15566. "type": "object"
  15567. }
  15568. },
  15569. "required": ["executed"],
  15570. "additionalProperties": false
  15571. }
  15572. },
  15573. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  15574. "additionalProperties": false
  15575. }
  15576. },
  15577. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15578. "additionalProperties": false
  15579. },
  15580. "SyncEventSessionNextToolFailed": {
  15581. "type": "object",
  15582. "properties": {
  15583. "type": {
  15584. "type": "string",
  15585. "enum": ["sync"]
  15586. },
  15587. "name": {
  15588. "type": "string",
  15589. "enum": ["session.next.tool.failed.1"]
  15590. },
  15591. "id": {
  15592. "type": "string"
  15593. },
  15594. "seq": {
  15595. "type": "number"
  15596. },
  15597. "aggregateID": {
  15598. "type": "string",
  15599. "enum": ["sessionID"]
  15600. },
  15601. "data": {
  15602. "type": "object",
  15603. "properties": {
  15604. "timestamp": {
  15605. "type": "number"
  15606. },
  15607. "sessionID": {
  15608. "type": "string",
  15609. "pattern": "^ses"
  15610. },
  15611. "callID": {
  15612. "type": "string"
  15613. },
  15614. "error": {
  15615. "$ref": "#/components/schemas/SessionErrorUnknown"
  15616. },
  15617. "provider": {
  15618. "type": "object",
  15619. "properties": {
  15620. "executed": {
  15621. "type": "boolean"
  15622. },
  15623. "metadata": {
  15624. "type": "object"
  15625. }
  15626. },
  15627. "required": ["executed"],
  15628. "additionalProperties": false
  15629. }
  15630. },
  15631. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  15632. "additionalProperties": false
  15633. }
  15634. },
  15635. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15636. "additionalProperties": false
  15637. },
  15638. "SyncEventSessionNextRetried": {
  15639. "type": "object",
  15640. "properties": {
  15641. "type": {
  15642. "type": "string",
  15643. "enum": ["sync"]
  15644. },
  15645. "name": {
  15646. "type": "string",
  15647. "enum": ["session.next.retried.1"]
  15648. },
  15649. "id": {
  15650. "type": "string"
  15651. },
  15652. "seq": {
  15653. "type": "number"
  15654. },
  15655. "aggregateID": {
  15656. "type": "string",
  15657. "enum": ["sessionID"]
  15658. },
  15659. "data": {
  15660. "type": "object",
  15661. "properties": {
  15662. "timestamp": {
  15663. "type": "number"
  15664. },
  15665. "sessionID": {
  15666. "type": "string",
  15667. "pattern": "^ses"
  15668. },
  15669. "attempt": {
  15670. "type": "number"
  15671. },
  15672. "error": {
  15673. "$ref": "#/components/schemas/SessionNextRetry_error"
  15674. }
  15675. },
  15676. "required": ["timestamp", "sessionID", "attempt", "error"],
  15677. "additionalProperties": false
  15678. }
  15679. },
  15680. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15681. "additionalProperties": false
  15682. },
  15683. "SyncEventSessionNextCompactionStarted": {
  15684. "type": "object",
  15685. "properties": {
  15686. "type": {
  15687. "type": "string",
  15688. "enum": ["sync"]
  15689. },
  15690. "name": {
  15691. "type": "string",
  15692. "enum": ["session.next.compaction.started.1"]
  15693. },
  15694. "id": {
  15695. "type": "string"
  15696. },
  15697. "seq": {
  15698. "type": "number"
  15699. },
  15700. "aggregateID": {
  15701. "type": "string",
  15702. "enum": ["sessionID"]
  15703. },
  15704. "data": {
  15705. "type": "object",
  15706. "properties": {
  15707. "timestamp": {
  15708. "type": "number"
  15709. },
  15710. "sessionID": {
  15711. "type": "string",
  15712. "pattern": "^ses"
  15713. },
  15714. "reason": {
  15715. "type": "string",
  15716. "enum": ["auto", "manual"]
  15717. }
  15718. },
  15719. "required": ["timestamp", "sessionID", "reason"],
  15720. "additionalProperties": false
  15721. }
  15722. },
  15723. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15724. "additionalProperties": false
  15725. },
  15726. "SyncEventSessionNextCompactionDelta": {
  15727. "type": "object",
  15728. "properties": {
  15729. "type": {
  15730. "type": "string",
  15731. "enum": ["sync"]
  15732. },
  15733. "name": {
  15734. "type": "string",
  15735. "enum": ["session.next.compaction.delta.1"]
  15736. },
  15737. "id": {
  15738. "type": "string"
  15739. },
  15740. "seq": {
  15741. "type": "number"
  15742. },
  15743. "aggregateID": {
  15744. "type": "string",
  15745. "enum": ["sessionID"]
  15746. },
  15747. "data": {
  15748. "type": "object",
  15749. "properties": {
  15750. "timestamp": {
  15751. "type": "number"
  15752. },
  15753. "sessionID": {
  15754. "type": "string",
  15755. "pattern": "^ses"
  15756. },
  15757. "text": {
  15758. "type": "string"
  15759. }
  15760. },
  15761. "required": ["timestamp", "sessionID", "text"],
  15762. "additionalProperties": false
  15763. }
  15764. },
  15765. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15766. "additionalProperties": false
  15767. },
  15768. "SyncEventSessionNextCompactionEnded": {
  15769. "type": "object",
  15770. "properties": {
  15771. "type": {
  15772. "type": "string",
  15773. "enum": ["sync"]
  15774. },
  15775. "name": {
  15776. "type": "string",
  15777. "enum": ["session.next.compaction.ended.1"]
  15778. },
  15779. "id": {
  15780. "type": "string"
  15781. },
  15782. "seq": {
  15783. "type": "number"
  15784. },
  15785. "aggregateID": {
  15786. "type": "string",
  15787. "enum": ["sessionID"]
  15788. },
  15789. "data": {
  15790. "type": "object",
  15791. "properties": {
  15792. "timestamp": {
  15793. "type": "number"
  15794. },
  15795. "sessionID": {
  15796. "type": "string",
  15797. "pattern": "^ses"
  15798. },
  15799. "text": {
  15800. "type": "string"
  15801. },
  15802. "include": {
  15803. "type": "string"
  15804. }
  15805. },
  15806. "required": ["timestamp", "sessionID", "text"],
  15807. "additionalProperties": false
  15808. }
  15809. },
  15810. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15811. "additionalProperties": false
  15812. },
  15813. "EventServerInstanceDisposed": {
  15814. "type": "object",
  15815. "properties": {
  15816. "id": {
  15817. "type": "string"
  15818. },
  15819. "type": {
  15820. "type": "string",
  15821. "enum": ["server.instance.disposed"]
  15822. },
  15823. "properties": {
  15824. "type": "object",
  15825. "properties": {
  15826. "directory": {
  15827. "type": "string"
  15828. }
  15829. },
  15830. "required": ["directory"],
  15831. "additionalProperties": false
  15832. }
  15833. },
  15834. "required": ["id", "type", "properties"],
  15835. "additionalProperties": false
  15836. },
  15837. "EventFileEdited": {
  15838. "type": "object",
  15839. "properties": {
  15840. "id": {
  15841. "type": "string"
  15842. },
  15843. "type": {
  15844. "type": "string",
  15845. "enum": ["file.edited"]
  15846. },
  15847. "properties": {
  15848. "type": "object",
  15849. "properties": {
  15850. "file": {
  15851. "type": "string"
  15852. }
  15853. },
  15854. "required": ["file"],
  15855. "additionalProperties": false
  15856. }
  15857. },
  15858. "required": ["id", "type", "properties"],
  15859. "additionalProperties": false
  15860. },
  15861. "EventFileWatcherUpdated": {
  15862. "type": "object",
  15863. "properties": {
  15864. "id": {
  15865. "type": "string"
  15866. },
  15867. "type": {
  15868. "type": "string",
  15869. "enum": ["file.watcher.updated"]
  15870. },
  15871. "properties": {
  15872. "type": "object",
  15873. "properties": {
  15874. "file": {
  15875. "type": "string"
  15876. },
  15877. "event": {
  15878. "type": "string",
  15879. "enum": ["add", "change", "unlink"]
  15880. }
  15881. },
  15882. "required": ["file", "event"],
  15883. "additionalProperties": false
  15884. }
  15885. },
  15886. "required": ["id", "type", "properties"],
  15887. "additionalProperties": false
  15888. },
  15889. "EventLspClientDiagnostics": {
  15890. "type": "object",
  15891. "properties": {
  15892. "id": {
  15893. "type": "string"
  15894. },
  15895. "type": {
  15896. "type": "string",
  15897. "enum": ["lsp.client.diagnostics"]
  15898. },
  15899. "properties": {
  15900. "type": "object",
  15901. "properties": {
  15902. "serverID": {
  15903. "type": "string"
  15904. },
  15905. "path": {
  15906. "type": "string"
  15907. }
  15908. },
  15909. "required": ["serverID", "path"],
  15910. "additionalProperties": false
  15911. }
  15912. },
  15913. "required": ["id", "type", "properties"],
  15914. "additionalProperties": false
  15915. },
  15916. "EventLspUpdated": {
  15917. "type": "object",
  15918. "properties": {
  15919. "id": {
  15920. "type": "string"
  15921. },
  15922. "type": {
  15923. "type": "string",
  15924. "enum": ["lsp.updated"]
  15925. },
  15926. "properties": {
  15927. "type": "object",
  15928. "properties": {}
  15929. }
  15930. },
  15931. "required": ["id", "type", "properties"],
  15932. "additionalProperties": false
  15933. },
  15934. "EventMessagePartDelta": {
  15935. "type": "object",
  15936. "properties": {
  15937. "id": {
  15938. "type": "string"
  15939. },
  15940. "type": {
  15941. "type": "string",
  15942. "enum": ["message.part.delta"]
  15943. },
  15944. "properties": {
  15945. "type": "object",
  15946. "properties": {
  15947. "sessionID": {
  15948. "type": "string",
  15949. "pattern": "^ses"
  15950. },
  15951. "messageID": {
  15952. "type": "string",
  15953. "pattern": "^msg"
  15954. },
  15955. "partID": {
  15956. "type": "string",
  15957. "pattern": "^prt"
  15958. },
  15959. "field": {
  15960. "type": "string"
  15961. },
  15962. "delta": {
  15963. "type": "string"
  15964. }
  15965. },
  15966. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  15967. "additionalProperties": false
  15968. }
  15969. },
  15970. "required": ["id", "type", "properties"],
  15971. "additionalProperties": false
  15972. },
  15973. "EventPermissionAsked": {
  15974. "type": "object",
  15975. "properties": {
  15976. "id": {
  15977. "type": "string"
  15978. },
  15979. "type": {
  15980. "type": "string",
  15981. "enum": ["permission.asked"]
  15982. },
  15983. "properties": {
  15984. "$ref": "#/components/schemas/PermissionRequest"
  15985. }
  15986. },
  15987. "required": ["id", "type", "properties"],
  15988. "additionalProperties": false
  15989. },
  15990. "EventPermissionReplied": {
  15991. "type": "object",
  15992. "properties": {
  15993. "id": {
  15994. "type": "string"
  15995. },
  15996. "type": {
  15997. "type": "string",
  15998. "enum": ["permission.replied"]
  15999. },
  16000. "properties": {
  16001. "type": "object",
  16002. "properties": {
  16003. "sessionID": {
  16004. "type": "string",
  16005. "pattern": "^ses"
  16006. },
  16007. "requestID": {
  16008. "type": "string",
  16009. "pattern": "^per"
  16010. },
  16011. "reply": {
  16012. "type": "string",
  16013. "enum": ["once", "always", "reject"]
  16014. }
  16015. },
  16016. "required": ["sessionID", "requestID", "reply"],
  16017. "additionalProperties": false
  16018. }
  16019. },
  16020. "required": ["id", "type", "properties"],
  16021. "additionalProperties": false
  16022. },
  16023. "EventSessionDiff": {
  16024. "type": "object",
  16025. "properties": {
  16026. "id": {
  16027. "type": "string"
  16028. },
  16029. "type": {
  16030. "type": "string",
  16031. "enum": ["session.diff"]
  16032. },
  16033. "properties": {
  16034. "type": "object",
  16035. "properties": {
  16036. "sessionID": {
  16037. "type": "string",
  16038. "pattern": "^ses"
  16039. },
  16040. "diff": {
  16041. "type": "array",
  16042. "items": {
  16043. "$ref": "#/components/schemas/SnapshotFileDiff"
  16044. }
  16045. }
  16046. },
  16047. "required": ["sessionID", "diff"],
  16048. "additionalProperties": false
  16049. }
  16050. },
  16051. "required": ["id", "type", "properties"],
  16052. "additionalProperties": false
  16053. },
  16054. "EventSessionError": {
  16055. "type": "object",
  16056. "properties": {
  16057. "id": {
  16058. "type": "string"
  16059. },
  16060. "type": {
  16061. "type": "string",
  16062. "enum": ["session.error"]
  16063. },
  16064. "properties": {
  16065. "type": "object",
  16066. "properties": {
  16067. "sessionID": {
  16068. "type": "string",
  16069. "pattern": "^ses"
  16070. },
  16071. "error": {
  16072. "anyOf": [
  16073. {
  16074. "$ref": "#/components/schemas/ProviderAuthError"
  16075. },
  16076. {
  16077. "$ref": "#/components/schemas/UnknownError"
  16078. },
  16079. {
  16080. "$ref": "#/components/schemas/MessageOutputLengthError"
  16081. },
  16082. {
  16083. "$ref": "#/components/schemas/MessageAbortedError"
  16084. },
  16085. {
  16086. "$ref": "#/components/schemas/StructuredOutputError"
  16087. },
  16088. {
  16089. "$ref": "#/components/schemas/ContextOverflowError"
  16090. },
  16091. {
  16092. "$ref": "#/components/schemas/APIError"
  16093. }
  16094. ]
  16095. }
  16096. },
  16097. "additionalProperties": false
  16098. }
  16099. },
  16100. "required": ["id", "type", "properties"],
  16101. "additionalProperties": false
  16102. },
  16103. "EventInstallationUpdated": {
  16104. "type": "object",
  16105. "properties": {
  16106. "id": {
  16107. "type": "string"
  16108. },
  16109. "type": {
  16110. "type": "string",
  16111. "enum": ["installation.updated"]
  16112. },
  16113. "properties": {
  16114. "type": "object",
  16115. "properties": {
  16116. "version": {
  16117. "type": "string"
  16118. }
  16119. },
  16120. "required": ["version"],
  16121. "additionalProperties": false
  16122. }
  16123. },
  16124. "required": ["id", "type", "properties"],
  16125. "additionalProperties": false
  16126. },
  16127. "EventInstallationUpdate-available": {
  16128. "type": "object",
  16129. "properties": {
  16130. "id": {
  16131. "type": "string"
  16132. },
  16133. "type": {
  16134. "type": "string",
  16135. "enum": ["installation.update-available"]
  16136. },
  16137. "properties": {
  16138. "type": "object",
  16139. "properties": {
  16140. "version": {
  16141. "type": "string"
  16142. }
  16143. },
  16144. "required": ["version"],
  16145. "additionalProperties": false
  16146. }
  16147. },
  16148. "required": ["id", "type", "properties"],
  16149. "additionalProperties": false
  16150. },
  16151. "EventQuestionAsked": {
  16152. "type": "object",
  16153. "properties": {
  16154. "id": {
  16155. "type": "string"
  16156. },
  16157. "type": {
  16158. "type": "string",
  16159. "enum": ["question.asked"]
  16160. },
  16161. "properties": {
  16162. "$ref": "#/components/schemas/QuestionRequest"
  16163. }
  16164. },
  16165. "required": ["id", "type", "properties"],
  16166. "additionalProperties": false
  16167. },
  16168. "EventQuestionReplied": {
  16169. "type": "object",
  16170. "properties": {
  16171. "id": {
  16172. "type": "string"
  16173. },
  16174. "type": {
  16175. "type": "string",
  16176. "enum": ["question.replied"]
  16177. },
  16178. "properties": {
  16179. "$ref": "#/components/schemas/QuestionReplied"
  16180. }
  16181. },
  16182. "required": ["id", "type", "properties"],
  16183. "additionalProperties": false
  16184. },
  16185. "EventQuestionRejected": {
  16186. "type": "object",
  16187. "properties": {
  16188. "id": {
  16189. "type": "string"
  16190. },
  16191. "type": {
  16192. "type": "string",
  16193. "enum": ["question.rejected"]
  16194. },
  16195. "properties": {
  16196. "$ref": "#/components/schemas/QuestionRejected"
  16197. }
  16198. },
  16199. "required": ["id", "type", "properties"],
  16200. "additionalProperties": false
  16201. },
  16202. "EventTodoUpdated": {
  16203. "type": "object",
  16204. "properties": {
  16205. "id": {
  16206. "type": "string"
  16207. },
  16208. "type": {
  16209. "type": "string",
  16210. "enum": ["todo.updated"]
  16211. },
  16212. "properties": {
  16213. "type": "object",
  16214. "properties": {
  16215. "sessionID": {
  16216. "type": "string",
  16217. "pattern": "^ses"
  16218. },
  16219. "todos": {
  16220. "type": "array",
  16221. "items": {
  16222. "$ref": "#/components/schemas/Todo"
  16223. }
  16224. }
  16225. },
  16226. "required": ["sessionID", "todos"],
  16227. "additionalProperties": false
  16228. }
  16229. },
  16230. "required": ["id", "type", "properties"],
  16231. "additionalProperties": false
  16232. },
  16233. "EventSessionStatus": {
  16234. "type": "object",
  16235. "properties": {
  16236. "id": {
  16237. "type": "string"
  16238. },
  16239. "type": {
  16240. "type": "string",
  16241. "enum": ["session.status"]
  16242. },
  16243. "properties": {
  16244. "type": "object",
  16245. "properties": {
  16246. "sessionID": {
  16247. "type": "string",
  16248. "pattern": "^ses"
  16249. },
  16250. "status": {
  16251. "$ref": "#/components/schemas/SessionStatus"
  16252. }
  16253. },
  16254. "required": ["sessionID", "status"],
  16255. "additionalProperties": false
  16256. }
  16257. },
  16258. "required": ["id", "type", "properties"],
  16259. "additionalProperties": false
  16260. },
  16261. "EventSessionIdle": {
  16262. "type": "object",
  16263. "properties": {
  16264. "id": {
  16265. "type": "string"
  16266. },
  16267. "type": {
  16268. "type": "string",
  16269. "enum": ["session.idle"]
  16270. },
  16271. "properties": {
  16272. "type": "object",
  16273. "properties": {
  16274. "sessionID": {
  16275. "type": "string",
  16276. "pattern": "^ses"
  16277. }
  16278. },
  16279. "required": ["sessionID"],
  16280. "additionalProperties": false
  16281. }
  16282. },
  16283. "required": ["id", "type", "properties"],
  16284. "additionalProperties": false
  16285. },
  16286. "EventSessionCompacted": {
  16287. "type": "object",
  16288. "properties": {
  16289. "id": {
  16290. "type": "string"
  16291. },
  16292. "type": {
  16293. "type": "string",
  16294. "enum": ["session.compacted"]
  16295. },
  16296. "properties": {
  16297. "type": "object",
  16298. "properties": {
  16299. "sessionID": {
  16300. "type": "string",
  16301. "pattern": "^ses"
  16302. }
  16303. },
  16304. "required": ["sessionID"],
  16305. "additionalProperties": false
  16306. }
  16307. },
  16308. "required": ["id", "type", "properties"],
  16309. "additionalProperties": false
  16310. },
  16311. "EventMcpToolsChanged": {
  16312. "type": "object",
  16313. "properties": {
  16314. "id": {
  16315. "type": "string"
  16316. },
  16317. "type": {
  16318. "type": "string",
  16319. "enum": ["mcp.tools.changed"]
  16320. },
  16321. "properties": {
  16322. "type": "object",
  16323. "properties": {
  16324. "server": {
  16325. "type": "string"
  16326. }
  16327. },
  16328. "required": ["server"],
  16329. "additionalProperties": false
  16330. }
  16331. },
  16332. "required": ["id", "type", "properties"],
  16333. "additionalProperties": false
  16334. },
  16335. "EventMcpBrowserOpenFailed": {
  16336. "type": "object",
  16337. "properties": {
  16338. "id": {
  16339. "type": "string"
  16340. },
  16341. "type": {
  16342. "type": "string",
  16343. "enum": ["mcp.browser.open.failed"]
  16344. },
  16345. "properties": {
  16346. "type": "object",
  16347. "properties": {
  16348. "mcpName": {
  16349. "type": "string"
  16350. },
  16351. "url": {
  16352. "type": "string"
  16353. }
  16354. },
  16355. "required": ["mcpName", "url"],
  16356. "additionalProperties": false
  16357. }
  16358. },
  16359. "required": ["id", "type", "properties"],
  16360. "additionalProperties": false
  16361. },
  16362. "EventCommandExecuted": {
  16363. "type": "object",
  16364. "properties": {
  16365. "id": {
  16366. "type": "string"
  16367. },
  16368. "type": {
  16369. "type": "string",
  16370. "enum": ["command.executed"]
  16371. },
  16372. "properties": {
  16373. "type": "object",
  16374. "properties": {
  16375. "name": {
  16376. "type": "string"
  16377. },
  16378. "sessionID": {
  16379. "type": "string",
  16380. "pattern": "^ses"
  16381. },
  16382. "arguments": {
  16383. "type": "string"
  16384. },
  16385. "messageID": {
  16386. "type": "string",
  16387. "pattern": "^msg"
  16388. }
  16389. },
  16390. "required": ["name", "sessionID", "arguments", "messageID"],
  16391. "additionalProperties": false
  16392. }
  16393. },
  16394. "required": ["id", "type", "properties"],
  16395. "additionalProperties": false
  16396. },
  16397. "EventProjectUpdated": {
  16398. "type": "object",
  16399. "properties": {
  16400. "id": {
  16401. "type": "string"
  16402. },
  16403. "type": {
  16404. "type": "string",
  16405. "enum": ["project.updated"]
  16406. },
  16407. "properties": {
  16408. "$ref": "#/components/schemas/Project"
  16409. }
  16410. },
  16411. "required": ["id", "type", "properties"],
  16412. "additionalProperties": false
  16413. },
  16414. "EventVcsBranchUpdated": {
  16415. "type": "object",
  16416. "properties": {
  16417. "id": {
  16418. "type": "string"
  16419. },
  16420. "type": {
  16421. "type": "string",
  16422. "enum": ["vcs.branch.updated"]
  16423. },
  16424. "properties": {
  16425. "type": "object",
  16426. "properties": {
  16427. "branch": {
  16428. "type": "string"
  16429. }
  16430. },
  16431. "additionalProperties": false
  16432. }
  16433. },
  16434. "required": ["id", "type", "properties"],
  16435. "additionalProperties": false
  16436. },
  16437. "EventWorkspaceReady": {
  16438. "type": "object",
  16439. "properties": {
  16440. "id": {
  16441. "type": "string"
  16442. },
  16443. "type": {
  16444. "type": "string",
  16445. "enum": ["workspace.ready"]
  16446. },
  16447. "properties": {
  16448. "type": "object",
  16449. "properties": {
  16450. "name": {
  16451. "type": "string"
  16452. }
  16453. },
  16454. "required": ["name"],
  16455. "additionalProperties": false
  16456. }
  16457. },
  16458. "required": ["id", "type", "properties"],
  16459. "additionalProperties": false
  16460. },
  16461. "EventWorkspaceFailed": {
  16462. "type": "object",
  16463. "properties": {
  16464. "id": {
  16465. "type": "string"
  16466. },
  16467. "type": {
  16468. "type": "string",
  16469. "enum": ["workspace.failed"]
  16470. },
  16471. "properties": {
  16472. "type": "object",
  16473. "properties": {
  16474. "message": {
  16475. "type": "string"
  16476. }
  16477. },
  16478. "required": ["message"],
  16479. "additionalProperties": false
  16480. }
  16481. },
  16482. "required": ["id", "type", "properties"],
  16483. "additionalProperties": false
  16484. },
  16485. "EventWorkspaceStatus": {
  16486. "type": "object",
  16487. "properties": {
  16488. "id": {
  16489. "type": "string"
  16490. },
  16491. "type": {
  16492. "type": "string",
  16493. "enum": ["workspace.status"]
  16494. },
  16495. "properties": {
  16496. "type": "object",
  16497. "properties": {
  16498. "workspaceID": {
  16499. "type": "string",
  16500. "pattern": "^wrk"
  16501. },
  16502. "status": {
  16503. "type": "string",
  16504. "enum": ["connected", "connecting", "disconnected", "error"]
  16505. }
  16506. },
  16507. "required": ["workspaceID", "status"],
  16508. "additionalProperties": false
  16509. }
  16510. },
  16511. "required": ["id", "type", "properties"],
  16512. "additionalProperties": false
  16513. },
  16514. "EventWorktreeReady": {
  16515. "type": "object",
  16516. "properties": {
  16517. "id": {
  16518. "type": "string"
  16519. },
  16520. "type": {
  16521. "type": "string",
  16522. "enum": ["worktree.ready"]
  16523. },
  16524. "properties": {
  16525. "type": "object",
  16526. "properties": {
  16527. "name": {
  16528. "type": "string"
  16529. },
  16530. "branch": {
  16531. "type": "string"
  16532. }
  16533. },
  16534. "required": ["name", "branch"],
  16535. "additionalProperties": false
  16536. }
  16537. },
  16538. "required": ["id", "type", "properties"],
  16539. "additionalProperties": false
  16540. },
  16541. "EventWorktreeFailed": {
  16542. "type": "object",
  16543. "properties": {
  16544. "id": {
  16545. "type": "string"
  16546. },
  16547. "type": {
  16548. "type": "string",
  16549. "enum": ["worktree.failed"]
  16550. },
  16551. "properties": {
  16552. "type": "object",
  16553. "properties": {
  16554. "message": {
  16555. "type": "string"
  16556. }
  16557. },
  16558. "required": ["message"],
  16559. "additionalProperties": false
  16560. }
  16561. },
  16562. "required": ["id", "type", "properties"],
  16563. "additionalProperties": false
  16564. },
  16565. "EventPtyCreated": {
  16566. "type": "object",
  16567. "properties": {
  16568. "id": {
  16569. "type": "string"
  16570. },
  16571. "type": {
  16572. "type": "string",
  16573. "enum": ["pty.created"]
  16574. },
  16575. "properties": {
  16576. "type": "object",
  16577. "properties": {
  16578. "info": {
  16579. "$ref": "#/components/schemas/Pty"
  16580. }
  16581. },
  16582. "required": ["info"],
  16583. "additionalProperties": false
  16584. }
  16585. },
  16586. "required": ["id", "type", "properties"],
  16587. "additionalProperties": false
  16588. },
  16589. "EventPtyUpdated": {
  16590. "type": "object",
  16591. "properties": {
  16592. "id": {
  16593. "type": "string"
  16594. },
  16595. "type": {
  16596. "type": "string",
  16597. "enum": ["pty.updated"]
  16598. },
  16599. "properties": {
  16600. "type": "object",
  16601. "properties": {
  16602. "info": {
  16603. "$ref": "#/components/schemas/Pty"
  16604. }
  16605. },
  16606. "required": ["info"],
  16607. "additionalProperties": false
  16608. }
  16609. },
  16610. "required": ["id", "type", "properties"],
  16611. "additionalProperties": false
  16612. },
  16613. "EventPtyExited": {
  16614. "type": "object",
  16615. "properties": {
  16616. "id": {
  16617. "type": "string"
  16618. },
  16619. "type": {
  16620. "type": "string",
  16621. "enum": ["pty.exited"]
  16622. },
  16623. "properties": {
  16624. "type": "object",
  16625. "properties": {
  16626. "id": {
  16627. "type": "string",
  16628. "pattern": "^pty"
  16629. },
  16630. "exitCode": {
  16631. "type": "integer",
  16632. "minimum": 0
  16633. }
  16634. },
  16635. "required": ["id", "exitCode"],
  16636. "additionalProperties": false
  16637. }
  16638. },
  16639. "required": ["id", "type", "properties"],
  16640. "additionalProperties": false
  16641. },
  16642. "EventPtyDeleted": {
  16643. "type": "object",
  16644. "properties": {
  16645. "id": {
  16646. "type": "string"
  16647. },
  16648. "type": {
  16649. "type": "string",
  16650. "enum": ["pty.deleted"]
  16651. },
  16652. "properties": {
  16653. "type": "object",
  16654. "properties": {
  16655. "id": {
  16656. "type": "string",
  16657. "pattern": "^pty"
  16658. }
  16659. },
  16660. "required": ["id"],
  16661. "additionalProperties": false
  16662. }
  16663. },
  16664. "required": ["id", "type", "properties"],
  16665. "additionalProperties": false
  16666. },
  16667. "EventMessageUpdated": {
  16668. "type": "object",
  16669. "properties": {
  16670. "id": {
  16671. "type": "string"
  16672. },
  16673. "type": {
  16674. "type": "string",
  16675. "enum": ["message.updated"]
  16676. },
  16677. "properties": {
  16678. "type": "object",
  16679. "properties": {
  16680. "sessionID": {
  16681. "type": "string",
  16682. "pattern": "^ses"
  16683. },
  16684. "info": {
  16685. "$ref": "#/components/schemas/Message"
  16686. }
  16687. },
  16688. "required": ["sessionID", "info"],
  16689. "additionalProperties": false
  16690. }
  16691. },
  16692. "required": ["id", "type", "properties"],
  16693. "additionalProperties": false
  16694. },
  16695. "EventMessageRemoved": {
  16696. "type": "object",
  16697. "properties": {
  16698. "id": {
  16699. "type": "string"
  16700. },
  16701. "type": {
  16702. "type": "string",
  16703. "enum": ["message.removed"]
  16704. },
  16705. "properties": {
  16706. "type": "object",
  16707. "properties": {
  16708. "sessionID": {
  16709. "type": "string",
  16710. "pattern": "^ses"
  16711. },
  16712. "messageID": {
  16713. "type": "string",
  16714. "pattern": "^msg"
  16715. }
  16716. },
  16717. "required": ["sessionID", "messageID"],
  16718. "additionalProperties": false
  16719. }
  16720. },
  16721. "required": ["id", "type", "properties"],
  16722. "additionalProperties": false
  16723. },
  16724. "EventMessagePartUpdated": {
  16725. "type": "object",
  16726. "properties": {
  16727. "id": {
  16728. "type": "string"
  16729. },
  16730. "type": {
  16731. "type": "string",
  16732. "enum": ["message.part.updated"]
  16733. },
  16734. "properties": {
  16735. "type": "object",
  16736. "properties": {
  16737. "sessionID": {
  16738. "type": "string",
  16739. "pattern": "^ses"
  16740. },
  16741. "part": {
  16742. "$ref": "#/components/schemas/Part"
  16743. },
  16744. "time": {
  16745. "type": "integer",
  16746. "minimum": 0
  16747. }
  16748. },
  16749. "required": ["sessionID", "part", "time"],
  16750. "additionalProperties": false
  16751. }
  16752. },
  16753. "required": ["id", "type", "properties"],
  16754. "additionalProperties": false
  16755. },
  16756. "EventMessagePartRemoved": {
  16757. "type": "object",
  16758. "properties": {
  16759. "id": {
  16760. "type": "string"
  16761. },
  16762. "type": {
  16763. "type": "string",
  16764. "enum": ["message.part.removed"]
  16765. },
  16766. "properties": {
  16767. "type": "object",
  16768. "properties": {
  16769. "sessionID": {
  16770. "type": "string",
  16771. "pattern": "^ses"
  16772. },
  16773. "messageID": {
  16774. "type": "string",
  16775. "pattern": "^msg"
  16776. },
  16777. "partID": {
  16778. "type": "string",
  16779. "pattern": "^prt"
  16780. }
  16781. },
  16782. "required": ["sessionID", "messageID", "partID"],
  16783. "additionalProperties": false
  16784. }
  16785. },
  16786. "required": ["id", "type", "properties"],
  16787. "additionalProperties": false
  16788. },
  16789. "EventSessionCreated": {
  16790. "type": "object",
  16791. "properties": {
  16792. "id": {
  16793. "type": "string"
  16794. },
  16795. "type": {
  16796. "type": "string",
  16797. "enum": ["session.created"]
  16798. },
  16799. "properties": {
  16800. "type": "object",
  16801. "properties": {
  16802. "sessionID": {
  16803. "type": "string",
  16804. "pattern": "^ses"
  16805. },
  16806. "info": {
  16807. "$ref": "#/components/schemas/Session"
  16808. }
  16809. },
  16810. "required": ["sessionID", "info"],
  16811. "additionalProperties": false
  16812. }
  16813. },
  16814. "required": ["id", "type", "properties"],
  16815. "additionalProperties": false
  16816. },
  16817. "EventSessionUpdated": {
  16818. "type": "object",
  16819. "properties": {
  16820. "id": {
  16821. "type": "string"
  16822. },
  16823. "type": {
  16824. "type": "string",
  16825. "enum": ["session.updated"]
  16826. },
  16827. "properties": {
  16828. "type": "object",
  16829. "properties": {
  16830. "sessionID": {
  16831. "type": "string",
  16832. "pattern": "^ses"
  16833. },
  16834. "info": {
  16835. "$ref": "#/components/schemas/Session"
  16836. }
  16837. },
  16838. "required": ["sessionID", "info"],
  16839. "additionalProperties": false
  16840. }
  16841. },
  16842. "required": ["id", "type", "properties"],
  16843. "additionalProperties": false
  16844. },
  16845. "EventSessionDeleted": {
  16846. "type": "object",
  16847. "properties": {
  16848. "id": {
  16849. "type": "string"
  16850. },
  16851. "type": {
  16852. "type": "string",
  16853. "enum": ["session.deleted"]
  16854. },
  16855. "properties": {
  16856. "type": "object",
  16857. "properties": {
  16858. "sessionID": {
  16859. "type": "string",
  16860. "pattern": "^ses"
  16861. },
  16862. "info": {
  16863. "$ref": "#/components/schemas/Session"
  16864. }
  16865. },
  16866. "required": ["sessionID", "info"],
  16867. "additionalProperties": false
  16868. }
  16869. },
  16870. "required": ["id", "type", "properties"],
  16871. "additionalProperties": false
  16872. },
  16873. "EventSessionNextAgentSwitched": {
  16874. "type": "object",
  16875. "properties": {
  16876. "id": {
  16877. "type": "string"
  16878. },
  16879. "type": {
  16880. "type": "string",
  16881. "enum": ["session.next.agent.switched"]
  16882. },
  16883. "properties": {
  16884. "type": "object",
  16885. "properties": {
  16886. "timestamp": {
  16887. "type": "number"
  16888. },
  16889. "sessionID": {
  16890. "type": "string",
  16891. "pattern": "^ses"
  16892. },
  16893. "agent": {
  16894. "type": "string"
  16895. }
  16896. },
  16897. "required": ["timestamp", "sessionID", "agent"],
  16898. "additionalProperties": false
  16899. }
  16900. },
  16901. "required": ["id", "type", "properties"],
  16902. "additionalProperties": false
  16903. },
  16904. "EventSessionNextModelSwitched": {
  16905. "type": "object",
  16906. "properties": {
  16907. "id": {
  16908. "type": "string"
  16909. },
  16910. "type": {
  16911. "type": "string",
  16912. "enum": ["session.next.model.switched"]
  16913. },
  16914. "properties": {
  16915. "type": "object",
  16916. "properties": {
  16917. "timestamp": {
  16918. "type": "number"
  16919. },
  16920. "sessionID": {
  16921. "type": "string",
  16922. "pattern": "^ses"
  16923. },
  16924. "model": {
  16925. "type": "object",
  16926. "properties": {
  16927. "id": {
  16928. "type": "string"
  16929. },
  16930. "providerID": {
  16931. "type": "string"
  16932. },
  16933. "variant": {
  16934. "type": "string"
  16935. }
  16936. },
  16937. "required": ["id", "providerID", "variant"],
  16938. "additionalProperties": false
  16939. }
  16940. },
  16941. "required": ["timestamp", "sessionID", "model"],
  16942. "additionalProperties": false
  16943. }
  16944. },
  16945. "required": ["id", "type", "properties"],
  16946. "additionalProperties": false
  16947. },
  16948. "PromptSource": {
  16949. "type": "object",
  16950. "properties": {
  16951. "start": {
  16952. "type": "number"
  16953. },
  16954. "end": {
  16955. "type": "number"
  16956. },
  16957. "text": {
  16958. "type": "string"
  16959. }
  16960. },
  16961. "required": ["start", "end", "text"],
  16962. "additionalProperties": false
  16963. },
  16964. "PromptFileAttachment": {
  16965. "type": "object",
  16966. "properties": {
  16967. "uri": {
  16968. "type": "string"
  16969. },
  16970. "mime": {
  16971. "type": "string"
  16972. },
  16973. "name": {
  16974. "type": "string"
  16975. },
  16976. "description": {
  16977. "type": "string"
  16978. },
  16979. "source": {
  16980. "$ref": "#/components/schemas/PromptSource"
  16981. }
  16982. },
  16983. "required": ["uri", "mime"],
  16984. "additionalProperties": false
  16985. },
  16986. "PromptAgentAttachment": {
  16987. "type": "object",
  16988. "properties": {
  16989. "name": {
  16990. "type": "string"
  16991. },
  16992. "source": {
  16993. "$ref": "#/components/schemas/PromptSource"
  16994. }
  16995. },
  16996. "required": ["name"],
  16997. "additionalProperties": false
  16998. },
  16999. "EventSessionNextPrompted": {
  17000. "type": "object",
  17001. "properties": {
  17002. "id": {
  17003. "type": "string"
  17004. },
  17005. "type": {
  17006. "type": "string",
  17007. "enum": ["session.next.prompted"]
  17008. },
  17009. "properties": {
  17010. "type": "object",
  17011. "properties": {
  17012. "timestamp": {
  17013. "type": "number"
  17014. },
  17015. "sessionID": {
  17016. "type": "string",
  17017. "pattern": "^ses"
  17018. },
  17019. "prompt": {
  17020. "$ref": "#/components/schemas/Prompt"
  17021. }
  17022. },
  17023. "required": ["timestamp", "sessionID", "prompt"],
  17024. "additionalProperties": false
  17025. }
  17026. },
  17027. "required": ["id", "type", "properties"],
  17028. "additionalProperties": false
  17029. },
  17030. "EventSessionNextSynthetic": {
  17031. "type": "object",
  17032. "properties": {
  17033. "id": {
  17034. "type": "string"
  17035. },
  17036. "type": {
  17037. "type": "string",
  17038. "enum": ["session.next.synthetic"]
  17039. },
  17040. "properties": {
  17041. "type": "object",
  17042. "properties": {
  17043. "timestamp": {
  17044. "type": "number"
  17045. },
  17046. "sessionID": {
  17047. "type": "string",
  17048. "pattern": "^ses"
  17049. },
  17050. "text": {
  17051. "type": "string"
  17052. }
  17053. },
  17054. "required": ["timestamp", "sessionID", "text"],
  17055. "additionalProperties": false
  17056. }
  17057. },
  17058. "required": ["id", "type", "properties"],
  17059. "additionalProperties": false
  17060. },
  17061. "EventSessionNextShellStarted": {
  17062. "type": "object",
  17063. "properties": {
  17064. "id": {
  17065. "type": "string"
  17066. },
  17067. "type": {
  17068. "type": "string",
  17069. "enum": ["session.next.shell.started"]
  17070. },
  17071. "properties": {
  17072. "type": "object",
  17073. "properties": {
  17074. "timestamp": {
  17075. "type": "number"
  17076. },
  17077. "sessionID": {
  17078. "type": "string",
  17079. "pattern": "^ses"
  17080. },
  17081. "callID": {
  17082. "type": "string"
  17083. },
  17084. "command": {
  17085. "type": "string"
  17086. }
  17087. },
  17088. "required": ["timestamp", "sessionID", "callID", "command"],
  17089. "additionalProperties": false
  17090. }
  17091. },
  17092. "required": ["id", "type", "properties"],
  17093. "additionalProperties": false
  17094. },
  17095. "EventSessionNextShellEnded": {
  17096. "type": "object",
  17097. "properties": {
  17098. "id": {
  17099. "type": "string"
  17100. },
  17101. "type": {
  17102. "type": "string",
  17103. "enum": ["session.next.shell.ended"]
  17104. },
  17105. "properties": {
  17106. "type": "object",
  17107. "properties": {
  17108. "timestamp": {
  17109. "type": "number"
  17110. },
  17111. "sessionID": {
  17112. "type": "string",
  17113. "pattern": "^ses"
  17114. },
  17115. "callID": {
  17116. "type": "string"
  17117. },
  17118. "output": {
  17119. "type": "string"
  17120. }
  17121. },
  17122. "required": ["timestamp", "sessionID", "callID", "output"],
  17123. "additionalProperties": false
  17124. }
  17125. },
  17126. "required": ["id", "type", "properties"],
  17127. "additionalProperties": false
  17128. },
  17129. "EventSessionNextStepStarted": {
  17130. "type": "object",
  17131. "properties": {
  17132. "id": {
  17133. "type": "string"
  17134. },
  17135. "type": {
  17136. "type": "string",
  17137. "enum": ["session.next.step.started"]
  17138. },
  17139. "properties": {
  17140. "type": "object",
  17141. "properties": {
  17142. "timestamp": {
  17143. "type": "number"
  17144. },
  17145. "sessionID": {
  17146. "type": "string",
  17147. "pattern": "^ses"
  17148. },
  17149. "agent": {
  17150. "type": "string"
  17151. },
  17152. "model": {
  17153. "type": "object",
  17154. "properties": {
  17155. "id": {
  17156. "type": "string"
  17157. },
  17158. "providerID": {
  17159. "type": "string"
  17160. },
  17161. "variant": {
  17162. "type": "string"
  17163. }
  17164. },
  17165. "required": ["id", "providerID", "variant"],
  17166. "additionalProperties": false
  17167. },
  17168. "snapshot": {
  17169. "type": "string"
  17170. }
  17171. },
  17172. "required": ["timestamp", "sessionID", "agent", "model"],
  17173. "additionalProperties": false
  17174. }
  17175. },
  17176. "required": ["id", "type", "properties"],
  17177. "additionalProperties": false
  17178. },
  17179. "EventSessionNextStepEnded": {
  17180. "type": "object",
  17181. "properties": {
  17182. "id": {
  17183. "type": "string"
  17184. },
  17185. "type": {
  17186. "type": "string",
  17187. "enum": ["session.next.step.ended"]
  17188. },
  17189. "properties": {
  17190. "type": "object",
  17191. "properties": {
  17192. "timestamp": {
  17193. "type": "number"
  17194. },
  17195. "sessionID": {
  17196. "type": "string",
  17197. "pattern": "^ses"
  17198. },
  17199. "finish": {
  17200. "type": "string"
  17201. },
  17202. "cost": {
  17203. "type": "number"
  17204. },
  17205. "tokens": {
  17206. "type": "object",
  17207. "properties": {
  17208. "input": {
  17209. "type": "number"
  17210. },
  17211. "output": {
  17212. "type": "number"
  17213. },
  17214. "reasoning": {
  17215. "type": "number"
  17216. },
  17217. "cache": {
  17218. "type": "object",
  17219. "properties": {
  17220. "read": {
  17221. "type": "number"
  17222. },
  17223. "write": {
  17224. "type": "number"
  17225. }
  17226. },
  17227. "required": ["read", "write"],
  17228. "additionalProperties": false
  17229. }
  17230. },
  17231. "required": ["input", "output", "reasoning", "cache"],
  17232. "additionalProperties": false
  17233. },
  17234. "snapshot": {
  17235. "type": "string"
  17236. }
  17237. },
  17238. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  17239. "additionalProperties": false
  17240. }
  17241. },
  17242. "required": ["id", "type", "properties"],
  17243. "additionalProperties": false
  17244. },
  17245. "SessionErrorUnknown": {
  17246. "type": "object",
  17247. "properties": {
  17248. "type": {
  17249. "type": "string",
  17250. "enum": ["unknown"]
  17251. },
  17252. "message": {
  17253. "type": "string"
  17254. }
  17255. },
  17256. "required": ["type", "message"],
  17257. "additionalProperties": false
  17258. },
  17259. "EventSessionNextStepFailed": {
  17260. "type": "object",
  17261. "properties": {
  17262. "id": {
  17263. "type": "string"
  17264. },
  17265. "type": {
  17266. "type": "string",
  17267. "enum": ["session.next.step.failed"]
  17268. },
  17269. "properties": {
  17270. "type": "object",
  17271. "properties": {
  17272. "timestamp": {
  17273. "type": "number"
  17274. },
  17275. "sessionID": {
  17276. "type": "string",
  17277. "pattern": "^ses"
  17278. },
  17279. "error": {
  17280. "$ref": "#/components/schemas/SessionErrorUnknown"
  17281. }
  17282. },
  17283. "required": ["timestamp", "sessionID", "error"],
  17284. "additionalProperties": false
  17285. }
  17286. },
  17287. "required": ["id", "type", "properties"],
  17288. "additionalProperties": false
  17289. },
  17290. "EventSessionNextTextStarted": {
  17291. "type": "object",
  17292. "properties": {
  17293. "id": {
  17294. "type": "string"
  17295. },
  17296. "type": {
  17297. "type": "string",
  17298. "enum": ["session.next.text.started"]
  17299. },
  17300. "properties": {
  17301. "type": "object",
  17302. "properties": {
  17303. "timestamp": {
  17304. "type": "number"
  17305. },
  17306. "sessionID": {
  17307. "type": "string",
  17308. "pattern": "^ses"
  17309. }
  17310. },
  17311. "required": ["timestamp", "sessionID"],
  17312. "additionalProperties": false
  17313. }
  17314. },
  17315. "required": ["id", "type", "properties"],
  17316. "additionalProperties": false
  17317. },
  17318. "EventSessionNextTextDelta": {
  17319. "type": "object",
  17320. "properties": {
  17321. "id": {
  17322. "type": "string"
  17323. },
  17324. "type": {
  17325. "type": "string",
  17326. "enum": ["session.next.text.delta"]
  17327. },
  17328. "properties": {
  17329. "type": "object",
  17330. "properties": {
  17331. "timestamp": {
  17332. "type": "number"
  17333. },
  17334. "sessionID": {
  17335. "type": "string",
  17336. "pattern": "^ses"
  17337. },
  17338. "delta": {
  17339. "type": "string"
  17340. }
  17341. },
  17342. "required": ["timestamp", "sessionID", "delta"],
  17343. "additionalProperties": false
  17344. }
  17345. },
  17346. "required": ["id", "type", "properties"],
  17347. "additionalProperties": false
  17348. },
  17349. "EventSessionNextTextEnded": {
  17350. "type": "object",
  17351. "properties": {
  17352. "id": {
  17353. "type": "string"
  17354. },
  17355. "type": {
  17356. "type": "string",
  17357. "enum": ["session.next.text.ended"]
  17358. },
  17359. "properties": {
  17360. "type": "object",
  17361. "properties": {
  17362. "timestamp": {
  17363. "type": "number"
  17364. },
  17365. "sessionID": {
  17366. "type": "string",
  17367. "pattern": "^ses"
  17368. },
  17369. "text": {
  17370. "type": "string"
  17371. }
  17372. },
  17373. "required": ["timestamp", "sessionID", "text"],
  17374. "additionalProperties": false
  17375. }
  17376. },
  17377. "required": ["id", "type", "properties"],
  17378. "additionalProperties": false
  17379. },
  17380. "EventSessionNextReasoningStarted": {
  17381. "type": "object",
  17382. "properties": {
  17383. "id": {
  17384. "type": "string"
  17385. },
  17386. "type": {
  17387. "type": "string",
  17388. "enum": ["session.next.reasoning.started"]
  17389. },
  17390. "properties": {
  17391. "type": "object",
  17392. "properties": {
  17393. "timestamp": {
  17394. "type": "number"
  17395. },
  17396. "sessionID": {
  17397. "type": "string",
  17398. "pattern": "^ses"
  17399. },
  17400. "reasoningID": {
  17401. "type": "string"
  17402. }
  17403. },
  17404. "required": ["timestamp", "sessionID", "reasoningID"],
  17405. "additionalProperties": false
  17406. }
  17407. },
  17408. "required": ["id", "type", "properties"],
  17409. "additionalProperties": false
  17410. },
  17411. "EventSessionNextReasoningDelta": {
  17412. "type": "object",
  17413. "properties": {
  17414. "id": {
  17415. "type": "string"
  17416. },
  17417. "type": {
  17418. "type": "string",
  17419. "enum": ["session.next.reasoning.delta"]
  17420. },
  17421. "properties": {
  17422. "type": "object",
  17423. "properties": {
  17424. "timestamp": {
  17425. "type": "number"
  17426. },
  17427. "sessionID": {
  17428. "type": "string",
  17429. "pattern": "^ses"
  17430. },
  17431. "reasoningID": {
  17432. "type": "string"
  17433. },
  17434. "delta": {
  17435. "type": "string"
  17436. }
  17437. },
  17438. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  17439. "additionalProperties": false
  17440. }
  17441. },
  17442. "required": ["id", "type", "properties"],
  17443. "additionalProperties": false
  17444. },
  17445. "EventSessionNextReasoningEnded": {
  17446. "type": "object",
  17447. "properties": {
  17448. "id": {
  17449. "type": "string"
  17450. },
  17451. "type": {
  17452. "type": "string",
  17453. "enum": ["session.next.reasoning.ended"]
  17454. },
  17455. "properties": {
  17456. "type": "object",
  17457. "properties": {
  17458. "timestamp": {
  17459. "type": "number"
  17460. },
  17461. "sessionID": {
  17462. "type": "string",
  17463. "pattern": "^ses"
  17464. },
  17465. "reasoningID": {
  17466. "type": "string"
  17467. },
  17468. "text": {
  17469. "type": "string"
  17470. }
  17471. },
  17472. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  17473. "additionalProperties": false
  17474. }
  17475. },
  17476. "required": ["id", "type", "properties"],
  17477. "additionalProperties": false
  17478. },
  17479. "EventSessionNextToolInputStarted": {
  17480. "type": "object",
  17481. "properties": {
  17482. "id": {
  17483. "type": "string"
  17484. },
  17485. "type": {
  17486. "type": "string",
  17487. "enum": ["session.next.tool.input.started"]
  17488. },
  17489. "properties": {
  17490. "type": "object",
  17491. "properties": {
  17492. "timestamp": {
  17493. "type": "number"
  17494. },
  17495. "sessionID": {
  17496. "type": "string",
  17497. "pattern": "^ses"
  17498. },
  17499. "callID": {
  17500. "type": "string"
  17501. },
  17502. "name": {
  17503. "type": "string"
  17504. }
  17505. },
  17506. "required": ["timestamp", "sessionID", "callID", "name"],
  17507. "additionalProperties": false
  17508. }
  17509. },
  17510. "required": ["id", "type", "properties"],
  17511. "additionalProperties": false
  17512. },
  17513. "EventSessionNextToolInputDelta": {
  17514. "type": "object",
  17515. "properties": {
  17516. "id": {
  17517. "type": "string"
  17518. },
  17519. "type": {
  17520. "type": "string",
  17521. "enum": ["session.next.tool.input.delta"]
  17522. },
  17523. "properties": {
  17524. "type": "object",
  17525. "properties": {
  17526. "timestamp": {
  17527. "type": "number"
  17528. },
  17529. "sessionID": {
  17530. "type": "string",
  17531. "pattern": "^ses"
  17532. },
  17533. "callID": {
  17534. "type": "string"
  17535. },
  17536. "delta": {
  17537. "type": "string"
  17538. }
  17539. },
  17540. "required": ["timestamp", "sessionID", "callID", "delta"],
  17541. "additionalProperties": false
  17542. }
  17543. },
  17544. "required": ["id", "type", "properties"],
  17545. "additionalProperties": false
  17546. },
  17547. "EventSessionNextToolInputEnded": {
  17548. "type": "object",
  17549. "properties": {
  17550. "id": {
  17551. "type": "string"
  17552. },
  17553. "type": {
  17554. "type": "string",
  17555. "enum": ["session.next.tool.input.ended"]
  17556. },
  17557. "properties": {
  17558. "type": "object",
  17559. "properties": {
  17560. "timestamp": {
  17561. "type": "number"
  17562. },
  17563. "sessionID": {
  17564. "type": "string",
  17565. "pattern": "^ses"
  17566. },
  17567. "callID": {
  17568. "type": "string"
  17569. },
  17570. "text": {
  17571. "type": "string"
  17572. }
  17573. },
  17574. "required": ["timestamp", "sessionID", "callID", "text"],
  17575. "additionalProperties": false
  17576. }
  17577. },
  17578. "required": ["id", "type", "properties"],
  17579. "additionalProperties": false
  17580. },
  17581. "EventSessionNextToolCalled": {
  17582. "type": "object",
  17583. "properties": {
  17584. "id": {
  17585. "type": "string"
  17586. },
  17587. "type": {
  17588. "type": "string",
  17589. "enum": ["session.next.tool.called"]
  17590. },
  17591. "properties": {
  17592. "type": "object",
  17593. "properties": {
  17594. "timestamp": {
  17595. "type": "number"
  17596. },
  17597. "sessionID": {
  17598. "type": "string",
  17599. "pattern": "^ses"
  17600. },
  17601. "callID": {
  17602. "type": "string"
  17603. },
  17604. "tool": {
  17605. "type": "string"
  17606. },
  17607. "input": {
  17608. "type": "object"
  17609. },
  17610. "provider": {
  17611. "type": "object",
  17612. "properties": {
  17613. "executed": {
  17614. "type": "boolean"
  17615. },
  17616. "metadata": {
  17617. "type": "object"
  17618. }
  17619. },
  17620. "required": ["executed"],
  17621. "additionalProperties": false
  17622. }
  17623. },
  17624. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  17625. "additionalProperties": false
  17626. }
  17627. },
  17628. "required": ["id", "type", "properties"],
  17629. "additionalProperties": false
  17630. },
  17631. "ToolTextContent": {
  17632. "type": "object",
  17633. "properties": {
  17634. "type": {
  17635. "type": "string",
  17636. "enum": ["text"]
  17637. },
  17638. "text": {
  17639. "type": "string"
  17640. }
  17641. },
  17642. "required": ["type", "text"],
  17643. "additionalProperties": false
  17644. },
  17645. "ToolFileContent": {
  17646. "type": "object",
  17647. "properties": {
  17648. "type": {
  17649. "type": "string",
  17650. "enum": ["file"]
  17651. },
  17652. "uri": {
  17653. "type": "string"
  17654. },
  17655. "mime": {
  17656. "type": "string"
  17657. },
  17658. "name": {
  17659. "type": "string"
  17660. }
  17661. },
  17662. "required": ["type", "uri", "mime"],
  17663. "additionalProperties": false
  17664. },
  17665. "EventSessionNextToolProgress": {
  17666. "type": "object",
  17667. "properties": {
  17668. "id": {
  17669. "type": "string"
  17670. },
  17671. "type": {
  17672. "type": "string",
  17673. "enum": ["session.next.tool.progress"]
  17674. },
  17675. "properties": {
  17676. "type": "object",
  17677. "properties": {
  17678. "timestamp": {
  17679. "type": "number"
  17680. },
  17681. "sessionID": {
  17682. "type": "string",
  17683. "pattern": "^ses"
  17684. },
  17685. "callID": {
  17686. "type": "string"
  17687. },
  17688. "structured": {
  17689. "type": "object"
  17690. },
  17691. "content": {
  17692. "type": "array",
  17693. "items": {
  17694. "anyOf": [
  17695. {
  17696. "$ref": "#/components/schemas/ToolTextContent"
  17697. },
  17698. {
  17699. "$ref": "#/components/schemas/ToolFileContent"
  17700. }
  17701. ]
  17702. }
  17703. }
  17704. },
  17705. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  17706. "additionalProperties": false
  17707. }
  17708. },
  17709. "required": ["id", "type", "properties"],
  17710. "additionalProperties": false
  17711. },
  17712. "EventSessionNextToolSuccess": {
  17713. "type": "object",
  17714. "properties": {
  17715. "id": {
  17716. "type": "string"
  17717. },
  17718. "type": {
  17719. "type": "string",
  17720. "enum": ["session.next.tool.success"]
  17721. },
  17722. "properties": {
  17723. "type": "object",
  17724. "properties": {
  17725. "timestamp": {
  17726. "type": "number"
  17727. },
  17728. "sessionID": {
  17729. "type": "string",
  17730. "pattern": "^ses"
  17731. },
  17732. "callID": {
  17733. "type": "string"
  17734. },
  17735. "structured": {
  17736. "type": "object"
  17737. },
  17738. "content": {
  17739. "type": "array",
  17740. "items": {
  17741. "anyOf": [
  17742. {
  17743. "$ref": "#/components/schemas/ToolTextContent"
  17744. },
  17745. {
  17746. "$ref": "#/components/schemas/ToolFileContent"
  17747. }
  17748. ]
  17749. }
  17750. },
  17751. "provider": {
  17752. "type": "object",
  17753. "properties": {
  17754. "executed": {
  17755. "type": "boolean"
  17756. },
  17757. "metadata": {
  17758. "type": "object"
  17759. }
  17760. },
  17761. "required": ["executed"],
  17762. "additionalProperties": false
  17763. }
  17764. },
  17765. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  17766. "additionalProperties": false
  17767. }
  17768. },
  17769. "required": ["id", "type", "properties"],
  17770. "additionalProperties": false
  17771. },
  17772. "EventSessionNextToolFailed": {
  17773. "type": "object",
  17774. "properties": {
  17775. "id": {
  17776. "type": "string"
  17777. },
  17778. "type": {
  17779. "type": "string",
  17780. "enum": ["session.next.tool.failed"]
  17781. },
  17782. "properties": {
  17783. "type": "object",
  17784. "properties": {
  17785. "timestamp": {
  17786. "type": "number"
  17787. },
  17788. "sessionID": {
  17789. "type": "string",
  17790. "pattern": "^ses"
  17791. },
  17792. "callID": {
  17793. "type": "string"
  17794. },
  17795. "error": {
  17796. "$ref": "#/components/schemas/SessionErrorUnknown"
  17797. },
  17798. "provider": {
  17799. "type": "object",
  17800. "properties": {
  17801. "executed": {
  17802. "type": "boolean"
  17803. },
  17804. "metadata": {
  17805. "type": "object"
  17806. }
  17807. },
  17808. "required": ["executed"],
  17809. "additionalProperties": false
  17810. }
  17811. },
  17812. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  17813. "additionalProperties": false
  17814. }
  17815. },
  17816. "required": ["id", "type", "properties"],
  17817. "additionalProperties": false
  17818. },
  17819. "SessionNextRetry_error": {
  17820. "type": "object",
  17821. "properties": {
  17822. "message": {
  17823. "type": "string"
  17824. },
  17825. "statusCode": {
  17826. "type": "number"
  17827. },
  17828. "isRetryable": {
  17829. "type": "boolean"
  17830. },
  17831. "responseHeaders": {
  17832. "type": "object",
  17833. "additionalProperties": {
  17834. "type": "string"
  17835. }
  17836. },
  17837. "responseBody": {
  17838. "type": "string"
  17839. },
  17840. "metadata": {
  17841. "type": "object",
  17842. "additionalProperties": {
  17843. "type": "string"
  17844. }
  17845. }
  17846. },
  17847. "required": ["message", "isRetryable"],
  17848. "additionalProperties": false
  17849. },
  17850. "EventSessionNextRetried": {
  17851. "type": "object",
  17852. "properties": {
  17853. "id": {
  17854. "type": "string"
  17855. },
  17856. "type": {
  17857. "type": "string",
  17858. "enum": ["session.next.retried"]
  17859. },
  17860. "properties": {
  17861. "type": "object",
  17862. "properties": {
  17863. "timestamp": {
  17864. "type": "number"
  17865. },
  17866. "sessionID": {
  17867. "type": "string",
  17868. "pattern": "^ses"
  17869. },
  17870. "attempt": {
  17871. "type": "number"
  17872. },
  17873. "error": {
  17874. "$ref": "#/components/schemas/SessionNextRetry_error"
  17875. }
  17876. },
  17877. "required": ["timestamp", "sessionID", "attempt", "error"],
  17878. "additionalProperties": false
  17879. }
  17880. },
  17881. "required": ["id", "type", "properties"],
  17882. "additionalProperties": false
  17883. },
  17884. "EventSessionNextCompactionStarted": {
  17885. "type": "object",
  17886. "properties": {
  17887. "id": {
  17888. "type": "string"
  17889. },
  17890. "type": {
  17891. "type": "string",
  17892. "enum": ["session.next.compaction.started"]
  17893. },
  17894. "properties": {
  17895. "type": "object",
  17896. "properties": {
  17897. "timestamp": {
  17898. "type": "number"
  17899. },
  17900. "sessionID": {
  17901. "type": "string",
  17902. "pattern": "^ses"
  17903. },
  17904. "reason": {
  17905. "type": "string",
  17906. "enum": ["auto", "manual"]
  17907. }
  17908. },
  17909. "required": ["timestamp", "sessionID", "reason"],
  17910. "additionalProperties": false
  17911. }
  17912. },
  17913. "required": ["id", "type", "properties"],
  17914. "additionalProperties": false
  17915. },
  17916. "EventSessionNextCompactionDelta": {
  17917. "type": "object",
  17918. "properties": {
  17919. "id": {
  17920. "type": "string"
  17921. },
  17922. "type": {
  17923. "type": "string",
  17924. "enum": ["session.next.compaction.delta"]
  17925. },
  17926. "properties": {
  17927. "type": "object",
  17928. "properties": {
  17929. "timestamp": {
  17930. "type": "number"
  17931. },
  17932. "sessionID": {
  17933. "type": "string",
  17934. "pattern": "^ses"
  17935. },
  17936. "text": {
  17937. "type": "string"
  17938. }
  17939. },
  17940. "required": ["timestamp", "sessionID", "text"],
  17941. "additionalProperties": false
  17942. }
  17943. },
  17944. "required": ["id", "type", "properties"],
  17945. "additionalProperties": false
  17946. },
  17947. "EventSessionNextCompactionEnded": {
  17948. "type": "object",
  17949. "properties": {
  17950. "id": {
  17951. "type": "string"
  17952. },
  17953. "type": {
  17954. "type": "string",
  17955. "enum": ["session.next.compaction.ended"]
  17956. },
  17957. "properties": {
  17958. "type": "object",
  17959. "properties": {
  17960. "timestamp": {
  17961. "type": "number"
  17962. },
  17963. "sessionID": {
  17964. "type": "string",
  17965. "pattern": "^ses"
  17966. },
  17967. "text": {
  17968. "type": "string"
  17969. },
  17970. "include": {
  17971. "type": "string"
  17972. }
  17973. },
  17974. "required": ["timestamp", "sessionID", "text"],
  17975. "additionalProperties": false
  17976. }
  17977. },
  17978. "required": ["id", "type", "properties"],
  17979. "additionalProperties": false
  17980. },
  17981. "EventServerConnected": {
  17982. "type": "object",
  17983. "properties": {
  17984. "id": {
  17985. "type": "string"
  17986. },
  17987. "type": {
  17988. "type": "string",
  17989. "enum": ["server.connected"]
  17990. },
  17991. "properties": {
  17992. "type": "object",
  17993. "properties": {}
  17994. }
  17995. },
  17996. "required": ["id", "type", "properties"],
  17997. "additionalProperties": false
  17998. },
  17999. "EventGlobalDisposed": {
  18000. "type": "object",
  18001. "properties": {
  18002. "id": {
  18003. "type": "string"
  18004. },
  18005. "type": {
  18006. "type": "string",
  18007. "enum": ["global.disposed"]
  18008. },
  18009. "properties": {
  18010. "type": "object",
  18011. "properties": {}
  18012. }
  18013. },
  18014. "required": ["id", "type", "properties"],
  18015. "additionalProperties": false
  18016. },
  18017. "SessionInfo": {
  18018. "type": "object",
  18019. "properties": {
  18020. "id": {
  18021. "type": "string",
  18022. "pattern": "^ses"
  18023. },
  18024. "parentID": {
  18025. "type": "string",
  18026. "pattern": "^ses"
  18027. },
  18028. "projectID": {
  18029. "type": "string"
  18030. },
  18031. "workspaceID": {
  18032. "type": "string",
  18033. "pattern": "^wrk"
  18034. },
  18035. "path": {
  18036. "type": "string"
  18037. },
  18038. "agent": {
  18039. "type": "string"
  18040. },
  18041. "model": {
  18042. "type": "object",
  18043. "properties": {
  18044. "id": {
  18045. "type": "string"
  18046. },
  18047. "providerID": {
  18048. "type": "string"
  18049. },
  18050. "variant": {
  18051. "type": "string"
  18052. }
  18053. },
  18054. "required": ["id", "providerID", "variant"],
  18055. "additionalProperties": false
  18056. },
  18057. "time": {
  18058. "type": "object",
  18059. "properties": {
  18060. "created": {
  18061. "type": "number"
  18062. },
  18063. "updated": {
  18064. "type": "number"
  18065. },
  18066. "archived": {
  18067. "type": "number"
  18068. }
  18069. },
  18070. "required": ["created", "updated"],
  18071. "additionalProperties": false
  18072. },
  18073. "title": {
  18074. "type": "string"
  18075. }
  18076. },
  18077. "required": ["id", "projectID", "time", "title"],
  18078. "additionalProperties": false
  18079. },
  18080. "SessionDelivery": {
  18081. "type": "string",
  18082. "enum": ["immediate", "deferred"]
  18083. },
  18084. "SessionMessageAgentSwitched": {
  18085. "type": "object",
  18086. "properties": {
  18087. "id": {
  18088. "type": "string"
  18089. },
  18090. "metadata": {
  18091. "type": "object"
  18092. },
  18093. "time": {
  18094. "type": "object",
  18095. "properties": {
  18096. "created": {
  18097. "type": "number"
  18098. }
  18099. },
  18100. "required": ["created"],
  18101. "additionalProperties": false
  18102. },
  18103. "type": {
  18104. "type": "string",
  18105. "enum": ["agent-switched"]
  18106. },
  18107. "agent": {
  18108. "type": "string"
  18109. }
  18110. },
  18111. "required": ["id", "time", "type", "agent"],
  18112. "additionalProperties": false
  18113. },
  18114. "SessionMessageModelSwitched": {
  18115. "type": "object",
  18116. "properties": {
  18117. "id": {
  18118. "type": "string"
  18119. },
  18120. "metadata": {
  18121. "type": "object"
  18122. },
  18123. "time": {
  18124. "type": "object",
  18125. "properties": {
  18126. "created": {
  18127. "type": "number"
  18128. }
  18129. },
  18130. "required": ["created"],
  18131. "additionalProperties": false
  18132. },
  18133. "type": {
  18134. "type": "string",
  18135. "enum": ["model-switched"]
  18136. },
  18137. "model": {
  18138. "type": "object",
  18139. "properties": {
  18140. "id": {
  18141. "type": "string"
  18142. },
  18143. "providerID": {
  18144. "type": "string"
  18145. },
  18146. "variant": {
  18147. "type": "string"
  18148. }
  18149. },
  18150. "required": ["id", "providerID", "variant"],
  18151. "additionalProperties": false
  18152. }
  18153. },
  18154. "required": ["id", "time", "type", "model"],
  18155. "additionalProperties": false
  18156. },
  18157. "SessionMessageUser": {
  18158. "type": "object",
  18159. "properties": {
  18160. "id": {
  18161. "type": "string"
  18162. },
  18163. "metadata": {
  18164. "type": "object"
  18165. },
  18166. "time": {
  18167. "type": "object",
  18168. "properties": {
  18169. "created": {
  18170. "type": "number"
  18171. }
  18172. },
  18173. "required": ["created"],
  18174. "additionalProperties": false
  18175. },
  18176. "text": {
  18177. "type": "string"
  18178. },
  18179. "files": {
  18180. "type": "array",
  18181. "items": {
  18182. "$ref": "#/components/schemas/PromptFileAttachment"
  18183. }
  18184. },
  18185. "agents": {
  18186. "type": "array",
  18187. "items": {
  18188. "$ref": "#/components/schemas/PromptAgentAttachment"
  18189. }
  18190. },
  18191. "type": {
  18192. "type": "string",
  18193. "enum": ["user"]
  18194. }
  18195. },
  18196. "required": ["id", "time", "text", "type"],
  18197. "additionalProperties": false
  18198. },
  18199. "SessionMessageSynthetic": {
  18200. "type": "object",
  18201. "properties": {
  18202. "id": {
  18203. "type": "string"
  18204. },
  18205. "metadata": {
  18206. "type": "object"
  18207. },
  18208. "time": {
  18209. "type": "object",
  18210. "properties": {
  18211. "created": {
  18212. "type": "number"
  18213. }
  18214. },
  18215. "required": ["created"],
  18216. "additionalProperties": false
  18217. },
  18218. "sessionID": {
  18219. "type": "string",
  18220. "pattern": "^ses"
  18221. },
  18222. "text": {
  18223. "type": "string"
  18224. },
  18225. "type": {
  18226. "type": "string",
  18227. "enum": ["synthetic"]
  18228. }
  18229. },
  18230. "required": ["id", "time", "sessionID", "text", "type"],
  18231. "additionalProperties": false
  18232. },
  18233. "SessionMessageShell": {
  18234. "type": "object",
  18235. "properties": {
  18236. "id": {
  18237. "type": "string"
  18238. },
  18239. "metadata": {
  18240. "type": "object"
  18241. },
  18242. "time": {
  18243. "type": "object",
  18244. "properties": {
  18245. "created": {
  18246. "type": "number"
  18247. },
  18248. "completed": {
  18249. "type": "number"
  18250. }
  18251. },
  18252. "required": ["created"],
  18253. "additionalProperties": false
  18254. },
  18255. "type": {
  18256. "type": "string",
  18257. "enum": ["shell"]
  18258. },
  18259. "callID": {
  18260. "type": "string"
  18261. },
  18262. "command": {
  18263. "type": "string"
  18264. },
  18265. "output": {
  18266. "type": "string"
  18267. }
  18268. },
  18269. "required": ["id", "time", "type", "callID", "command", "output"],
  18270. "additionalProperties": false
  18271. },
  18272. "SessionMessageAssistantText": {
  18273. "type": "object",
  18274. "properties": {
  18275. "type": {
  18276. "type": "string",
  18277. "enum": ["text"]
  18278. },
  18279. "text": {
  18280. "type": "string"
  18281. }
  18282. },
  18283. "required": ["type", "text"],
  18284. "additionalProperties": false
  18285. },
  18286. "SessionMessageAssistantReasoning": {
  18287. "type": "object",
  18288. "properties": {
  18289. "type": {
  18290. "type": "string",
  18291. "enum": ["reasoning"]
  18292. },
  18293. "id": {
  18294. "type": "string"
  18295. },
  18296. "text": {
  18297. "type": "string"
  18298. }
  18299. },
  18300. "required": ["type", "id", "text"],
  18301. "additionalProperties": false
  18302. },
  18303. "SessionMessageToolStatePending": {
  18304. "type": "object",
  18305. "properties": {
  18306. "status": {
  18307. "type": "string",
  18308. "enum": ["pending"]
  18309. },
  18310. "input": {
  18311. "type": "string"
  18312. }
  18313. },
  18314. "required": ["status", "input"],
  18315. "additionalProperties": false
  18316. },
  18317. "SessionMessageToolStateRunning": {
  18318. "type": "object",
  18319. "properties": {
  18320. "status": {
  18321. "type": "string",
  18322. "enum": ["running"]
  18323. },
  18324. "input": {
  18325. "type": "object"
  18326. },
  18327. "structured": {
  18328. "type": "object"
  18329. },
  18330. "content": {
  18331. "type": "array",
  18332. "items": {
  18333. "anyOf": [
  18334. {
  18335. "$ref": "#/components/schemas/ToolTextContent"
  18336. },
  18337. {
  18338. "$ref": "#/components/schemas/ToolFileContent"
  18339. }
  18340. ]
  18341. }
  18342. }
  18343. },
  18344. "required": ["status", "input", "structured", "content"],
  18345. "additionalProperties": false
  18346. },
  18347. "SessionMessageToolStateCompleted": {
  18348. "type": "object",
  18349. "properties": {
  18350. "status": {
  18351. "type": "string",
  18352. "enum": ["completed"]
  18353. },
  18354. "input": {
  18355. "type": "object"
  18356. },
  18357. "attachments": {
  18358. "type": "array",
  18359. "items": {
  18360. "$ref": "#/components/schemas/PromptFileAttachment"
  18361. }
  18362. },
  18363. "content": {
  18364. "type": "array",
  18365. "items": {
  18366. "anyOf": [
  18367. {
  18368. "$ref": "#/components/schemas/ToolTextContent"
  18369. },
  18370. {
  18371. "$ref": "#/components/schemas/ToolFileContent"
  18372. }
  18373. ]
  18374. }
  18375. },
  18376. "structured": {
  18377. "type": "object"
  18378. }
  18379. },
  18380. "required": ["status", "input", "content", "structured"],
  18381. "additionalProperties": false
  18382. },
  18383. "SessionMessageToolStateError": {
  18384. "type": "object",
  18385. "properties": {
  18386. "status": {
  18387. "type": "string",
  18388. "enum": ["error"]
  18389. },
  18390. "input": {
  18391. "type": "object"
  18392. },
  18393. "content": {
  18394. "type": "array",
  18395. "items": {
  18396. "anyOf": [
  18397. {
  18398. "$ref": "#/components/schemas/ToolTextContent"
  18399. },
  18400. {
  18401. "$ref": "#/components/schemas/ToolFileContent"
  18402. }
  18403. ]
  18404. }
  18405. },
  18406. "structured": {
  18407. "type": "object"
  18408. },
  18409. "error": {
  18410. "$ref": "#/components/schemas/SessionErrorUnknown"
  18411. }
  18412. },
  18413. "required": ["status", "input", "content", "structured", "error"],
  18414. "additionalProperties": false
  18415. },
  18416. "SessionMessageAssistantTool": {
  18417. "type": "object",
  18418. "properties": {
  18419. "type": {
  18420. "type": "string",
  18421. "enum": ["tool"]
  18422. },
  18423. "id": {
  18424. "type": "string"
  18425. },
  18426. "name": {
  18427. "type": "string"
  18428. },
  18429. "provider": {
  18430. "type": "object",
  18431. "properties": {
  18432. "executed": {
  18433. "type": "boolean"
  18434. },
  18435. "metadata": {
  18436. "type": "object"
  18437. }
  18438. },
  18439. "required": ["executed"],
  18440. "additionalProperties": false
  18441. },
  18442. "state": {
  18443. "anyOf": [
  18444. {
  18445. "$ref": "#/components/schemas/SessionMessageToolStatePending"
  18446. },
  18447. {
  18448. "$ref": "#/components/schemas/SessionMessageToolStateRunning"
  18449. },
  18450. {
  18451. "$ref": "#/components/schemas/SessionMessageToolStateCompleted"
  18452. },
  18453. {
  18454. "$ref": "#/components/schemas/SessionMessageToolStateError"
  18455. }
  18456. ]
  18457. },
  18458. "time": {
  18459. "type": "object",
  18460. "properties": {
  18461. "created": {
  18462. "type": "number"
  18463. },
  18464. "ran": {
  18465. "type": "number"
  18466. },
  18467. "completed": {
  18468. "type": "number"
  18469. },
  18470. "pruned": {
  18471. "type": "number"
  18472. }
  18473. },
  18474. "required": ["created"],
  18475. "additionalProperties": false
  18476. }
  18477. },
  18478. "required": ["type", "id", "name", "state", "time"],
  18479. "additionalProperties": false
  18480. },
  18481. "SessionMessageAssistant": {
  18482. "type": "object",
  18483. "properties": {
  18484. "id": {
  18485. "type": "string"
  18486. },
  18487. "metadata": {
  18488. "type": "object"
  18489. },
  18490. "time": {
  18491. "type": "object",
  18492. "properties": {
  18493. "created": {
  18494. "type": "number"
  18495. },
  18496. "completed": {
  18497. "type": "number"
  18498. }
  18499. },
  18500. "required": ["created"],
  18501. "additionalProperties": false
  18502. },
  18503. "type": {
  18504. "type": "string",
  18505. "enum": ["assistant"]
  18506. },
  18507. "agent": {
  18508. "type": "string"
  18509. },
  18510. "model": {
  18511. "type": "object",
  18512. "properties": {
  18513. "id": {
  18514. "type": "string"
  18515. },
  18516. "providerID": {
  18517. "type": "string"
  18518. },
  18519. "variant": {
  18520. "type": "string"
  18521. }
  18522. },
  18523. "required": ["id", "providerID", "variant"],
  18524. "additionalProperties": false
  18525. },
  18526. "content": {
  18527. "type": "array",
  18528. "items": {
  18529. "anyOf": [
  18530. {
  18531. "$ref": "#/components/schemas/SessionMessageAssistantText"
  18532. },
  18533. {
  18534. "$ref": "#/components/schemas/SessionMessageAssistantReasoning"
  18535. },
  18536. {
  18537. "$ref": "#/components/schemas/SessionMessageAssistantTool"
  18538. }
  18539. ]
  18540. }
  18541. },
  18542. "snapshot": {
  18543. "type": "object",
  18544. "properties": {
  18545. "start": {
  18546. "type": "string"
  18547. },
  18548. "end": {
  18549. "type": "string"
  18550. }
  18551. },
  18552. "additionalProperties": false
  18553. },
  18554. "finish": {
  18555. "type": "string"
  18556. },
  18557. "cost": {
  18558. "type": "number"
  18559. },
  18560. "tokens": {
  18561. "type": "object",
  18562. "properties": {
  18563. "input": {
  18564. "type": "number"
  18565. },
  18566. "output": {
  18567. "type": "number"
  18568. },
  18569. "reasoning": {
  18570. "type": "number"
  18571. },
  18572. "cache": {
  18573. "type": "object",
  18574. "properties": {
  18575. "read": {
  18576. "type": "number"
  18577. },
  18578. "write": {
  18579. "type": "number"
  18580. }
  18581. },
  18582. "required": ["read", "write"],
  18583. "additionalProperties": false
  18584. }
  18585. },
  18586. "required": ["input", "output", "reasoning", "cache"],
  18587. "additionalProperties": false
  18588. },
  18589. "error": {
  18590. "$ref": "#/components/schemas/SessionErrorUnknown"
  18591. }
  18592. },
  18593. "required": ["id", "time", "type", "agent", "model", "content"],
  18594. "additionalProperties": false
  18595. },
  18596. "SessionMessageCompaction": {
  18597. "type": "object",
  18598. "properties": {
  18599. "type": {
  18600. "type": "string",
  18601. "enum": ["compaction"]
  18602. },
  18603. "reason": {
  18604. "type": "string",
  18605. "enum": ["auto", "manual"]
  18606. },
  18607. "summary": {
  18608. "type": "string"
  18609. },
  18610. "include": {
  18611. "type": "string"
  18612. },
  18613. "id": {
  18614. "type": "string"
  18615. },
  18616. "metadata": {
  18617. "type": "object"
  18618. },
  18619. "time": {
  18620. "type": "object",
  18621. "properties": {
  18622. "created": {
  18623. "type": "number"
  18624. }
  18625. },
  18626. "required": ["created"],
  18627. "additionalProperties": false
  18628. }
  18629. },
  18630. "required": ["type", "reason", "summary", "id", "time"],
  18631. "additionalProperties": false
  18632. },
  18633. "SessionMessage": {
  18634. "anyOf": [
  18635. {
  18636. "$ref": "#/components/schemas/SessionMessageAgentSwitched"
  18637. },
  18638. {
  18639. "$ref": "#/components/schemas/SessionMessageModelSwitched"
  18640. },
  18641. {
  18642. "$ref": "#/components/schemas/SessionMessageUser"
  18643. },
  18644. {
  18645. "$ref": "#/components/schemas/SessionMessageSynthetic"
  18646. },
  18647. {
  18648. "$ref": "#/components/schemas/SessionMessageShell"
  18649. },
  18650. {
  18651. "$ref": "#/components/schemas/SessionMessageAssistant"
  18652. },
  18653. {
  18654. "$ref": "#/components/schemas/SessionMessageCompaction"
  18655. }
  18656. ]
  18657. },
  18658. "EventTuiToastShow1": {
  18659. "type": "object",
  18660. "properties": {
  18661. "id": {
  18662. "type": "string"
  18663. },
  18664. "type": {
  18665. "type": "string",
  18666. "enum": ["tui.toast.show"]
  18667. },
  18668. "properties": {
  18669. "type": "object",
  18670. "properties": {
  18671. "title": {
  18672. "type": "string"
  18673. },
  18674. "message": {
  18675. "type": "string"
  18676. },
  18677. "variant": {
  18678. "type": "string",
  18679. "enum": ["info", "success", "warning", "error"]
  18680. },
  18681. "duration": {
  18682. "type": "integer",
  18683. "exclusiveMinimum": 0
  18684. }
  18685. },
  18686. "required": ["message", "variant"],
  18687. "additionalProperties": false
  18688. }
  18689. },
  18690. "required": ["id", "type", "properties"],
  18691. "additionalProperties": false
  18692. },
  18693. "BadRequestError": {
  18694. "type": "object",
  18695. "required": ["data", "errors", "success"],
  18696. "properties": {
  18697. "data": {},
  18698. "errors": {
  18699. "type": "array",
  18700. "items": {
  18701. "type": "object",
  18702. "additionalProperties": {}
  18703. }
  18704. },
  18705. "success": {
  18706. "type": "boolean",
  18707. "enum": [false]
  18708. }
  18709. }
  18710. }
  18711. }
  18712. },
  18713. "security": [],
  18714. "tags": [
  18715. {
  18716. "name": "control",
  18717. "description": "Control plane routes."
  18718. },
  18719. {
  18720. "name": "global",
  18721. "description": "Global server routes."
  18722. },
  18723. {
  18724. "name": "event",
  18725. "description": "Instance event stream route."
  18726. },
  18727. {
  18728. "name": "config",
  18729. "description": "Experimental HttpApi config routes."
  18730. },
  18731. {
  18732. "name": "experimental",
  18733. "description": "Experimental HttpApi read-only routes."
  18734. },
  18735. {
  18736. "name": "file",
  18737. "description": "Experimental HttpApi file routes."
  18738. },
  18739. {
  18740. "name": "instance",
  18741. "description": "Experimental HttpApi instance read routes."
  18742. },
  18743. {
  18744. "name": "mcp",
  18745. "description": "Experimental HttpApi MCP routes."
  18746. },
  18747. {
  18748. "name": "project",
  18749. "description": "Experimental HttpApi project routes."
  18750. },
  18751. {
  18752. "name": "pty",
  18753. "description": "Experimental HttpApi PTY routes."
  18754. },
  18755. {
  18756. "name": "question",
  18757. "description": "Question routes."
  18758. },
  18759. {
  18760. "name": "permission",
  18761. "description": "Experimental HttpApi permission routes."
  18762. },
  18763. {
  18764. "name": "provider",
  18765. "description": "Experimental HttpApi provider routes."
  18766. },
  18767. {
  18768. "name": "session",
  18769. "description": "Experimental HttpApi session routes."
  18770. },
  18771. {
  18772. "name": "sync",
  18773. "description": "Experimental HttpApi sync routes."
  18774. },
  18775. {
  18776. "name": "v2",
  18777. "description": "Experimental v2 routes."
  18778. },
  18779. {
  18780. "name": "v2 messages",
  18781. "description": "Experimental v2 message routes."
  18782. },
  18783. {
  18784. "name": "tui",
  18785. "description": "Experimental HttpApi TUI routes."
  18786. },
  18787. {
  18788. "name": "workspace",
  18789. "description": "Experimental HttpApi workspace routes."
  18790. },
  18791. {
  18792. "name": "pty",
  18793. "description": "PTY websocket route."
  18794. }
  18795. ]
  18796. }