openapi.json 241 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791
  1. {
  2. "openapi": "3.1.1",
  3. "info": {
  4. "title": "opencode",
  5. "description": "opencode api",
  6. "version": "1.0.0"
  7. },
  8. "paths": {
  9. "/global/event": {
  10. "get": {
  11. "operationId": "global.event",
  12. "summary": "Get global events",
  13. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  14. "responses": {
  15. "200": {
  16. "description": "Event stream",
  17. "content": {
  18. "text/event-stream": {
  19. "schema": {
  20. "$ref": "#/components/schemas/GlobalEvent"
  21. }
  22. }
  23. }
  24. }
  25. },
  26. "x-codeSamples": [
  27. {
  28. "lang": "js",
  29. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  30. }
  31. ]
  32. }
  33. },
  34. "/project": {
  35. "get": {
  36. "operationId": "project.list",
  37. "parameters": [
  38. {
  39. "in": "query",
  40. "name": "directory",
  41. "schema": {
  42. "type": "string"
  43. }
  44. }
  45. ],
  46. "summary": "List all projects",
  47. "description": "Get a list of projects that have been opened with OpenCode.",
  48. "responses": {
  49. "200": {
  50. "description": "List of projects",
  51. "content": {
  52. "application/json": {
  53. "schema": {
  54. "type": "array",
  55. "items": {
  56. "$ref": "#/components/schemas/Project"
  57. }
  58. }
  59. }
  60. }
  61. }
  62. },
  63. "x-codeSamples": [
  64. {
  65. "lang": "js",
  66. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  67. }
  68. ]
  69. }
  70. },
  71. "/project/current": {
  72. "get": {
  73. "operationId": "project.current",
  74. "parameters": [
  75. {
  76. "in": "query",
  77. "name": "directory",
  78. "schema": {
  79. "type": "string"
  80. }
  81. }
  82. ],
  83. "summary": "Get current project",
  84. "description": "Retrieve the currently active project that OpenCode is working with.",
  85. "responses": {
  86. "200": {
  87. "description": "Current project information",
  88. "content": {
  89. "application/json": {
  90. "schema": {
  91. "$ref": "#/components/schemas/Project"
  92. }
  93. }
  94. }
  95. }
  96. },
  97. "x-codeSamples": [
  98. {
  99. "lang": "js",
  100. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  101. }
  102. ]
  103. }
  104. },
  105. "/pty": {
  106. "get": {
  107. "operationId": "pty.list",
  108. "parameters": [
  109. {
  110. "in": "query",
  111. "name": "directory",
  112. "schema": {
  113. "type": "string"
  114. }
  115. }
  116. ],
  117. "summary": "List PTY sessions",
  118. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  119. "responses": {
  120. "200": {
  121. "description": "List of sessions",
  122. "content": {
  123. "application/json": {
  124. "schema": {
  125. "type": "array",
  126. "items": {
  127. "$ref": "#/components/schemas/Pty"
  128. }
  129. }
  130. }
  131. }
  132. }
  133. },
  134. "x-codeSamples": [
  135. {
  136. "lang": "js",
  137. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  138. }
  139. ]
  140. },
  141. "post": {
  142. "operationId": "pty.create",
  143. "parameters": [
  144. {
  145. "in": "query",
  146. "name": "directory",
  147. "schema": {
  148. "type": "string"
  149. }
  150. }
  151. ],
  152. "summary": "Create PTY session",
  153. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  154. "responses": {
  155. "200": {
  156. "description": "Created session",
  157. "content": {
  158. "application/json": {
  159. "schema": {
  160. "$ref": "#/components/schemas/Pty"
  161. }
  162. }
  163. }
  164. },
  165. "400": {
  166. "description": "Bad request",
  167. "content": {
  168. "application/json": {
  169. "schema": {
  170. "$ref": "#/components/schemas/BadRequestError"
  171. }
  172. }
  173. }
  174. }
  175. },
  176. "requestBody": {
  177. "content": {
  178. "application/json": {
  179. "schema": {
  180. "type": "object",
  181. "properties": {
  182. "command": {
  183. "type": "string"
  184. },
  185. "args": {
  186. "type": "array",
  187. "items": {
  188. "type": "string"
  189. }
  190. },
  191. "cwd": {
  192. "type": "string"
  193. },
  194. "title": {
  195. "type": "string"
  196. },
  197. "env": {
  198. "type": "object",
  199. "propertyNames": {
  200. "type": "string"
  201. },
  202. "additionalProperties": {
  203. "type": "string"
  204. }
  205. }
  206. }
  207. }
  208. }
  209. }
  210. },
  211. "x-codeSamples": [
  212. {
  213. "lang": "js",
  214. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  215. }
  216. ]
  217. }
  218. },
  219. "/pty/{ptyID}": {
  220. "get": {
  221. "operationId": "pty.get",
  222. "parameters": [
  223. {
  224. "in": "query",
  225. "name": "directory",
  226. "schema": {
  227. "type": "string"
  228. }
  229. },
  230. {
  231. "in": "path",
  232. "name": "ptyID",
  233. "schema": {
  234. "type": "string"
  235. },
  236. "required": true
  237. }
  238. ],
  239. "summary": "Get PTY session",
  240. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  241. "responses": {
  242. "200": {
  243. "description": "Session info",
  244. "content": {
  245. "application/json": {
  246. "schema": {
  247. "$ref": "#/components/schemas/Pty"
  248. }
  249. }
  250. }
  251. },
  252. "404": {
  253. "description": "Not found",
  254. "content": {
  255. "application/json": {
  256. "schema": {
  257. "$ref": "#/components/schemas/NotFoundError"
  258. }
  259. }
  260. }
  261. }
  262. },
  263. "x-codeSamples": [
  264. {
  265. "lang": "js",
  266. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  267. }
  268. ]
  269. },
  270. "put": {
  271. "operationId": "pty.update",
  272. "parameters": [
  273. {
  274. "in": "query",
  275. "name": "directory",
  276. "schema": {
  277. "type": "string"
  278. }
  279. },
  280. {
  281. "in": "path",
  282. "name": "ptyID",
  283. "schema": {
  284. "type": "string"
  285. },
  286. "required": true
  287. }
  288. ],
  289. "summary": "Update PTY session",
  290. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  291. "responses": {
  292. "200": {
  293. "description": "Updated session",
  294. "content": {
  295. "application/json": {
  296. "schema": {
  297. "$ref": "#/components/schemas/Pty"
  298. }
  299. }
  300. }
  301. },
  302. "400": {
  303. "description": "Bad request",
  304. "content": {
  305. "application/json": {
  306. "schema": {
  307. "$ref": "#/components/schemas/BadRequestError"
  308. }
  309. }
  310. }
  311. }
  312. },
  313. "requestBody": {
  314. "content": {
  315. "application/json": {
  316. "schema": {
  317. "type": "object",
  318. "properties": {
  319. "title": {
  320. "type": "string"
  321. },
  322. "size": {
  323. "type": "object",
  324. "properties": {
  325. "rows": {
  326. "type": "number"
  327. },
  328. "cols": {
  329. "type": "number"
  330. }
  331. },
  332. "required": ["rows", "cols"]
  333. }
  334. }
  335. }
  336. }
  337. }
  338. },
  339. "x-codeSamples": [
  340. {
  341. "lang": "js",
  342. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  343. }
  344. ]
  345. },
  346. "delete": {
  347. "operationId": "pty.remove",
  348. "parameters": [
  349. {
  350. "in": "query",
  351. "name": "directory",
  352. "schema": {
  353. "type": "string"
  354. }
  355. },
  356. {
  357. "in": "path",
  358. "name": "ptyID",
  359. "schema": {
  360. "type": "string"
  361. },
  362. "required": true
  363. }
  364. ],
  365. "summary": "Remove PTY session",
  366. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  367. "responses": {
  368. "200": {
  369. "description": "Session removed",
  370. "content": {
  371. "application/json": {
  372. "schema": {
  373. "type": "boolean"
  374. }
  375. }
  376. }
  377. },
  378. "404": {
  379. "description": "Not found",
  380. "content": {
  381. "application/json": {
  382. "schema": {
  383. "$ref": "#/components/schemas/NotFoundError"
  384. }
  385. }
  386. }
  387. }
  388. },
  389. "x-codeSamples": [
  390. {
  391. "lang": "js",
  392. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  393. }
  394. ]
  395. }
  396. },
  397. "/pty/{ptyID}/connect": {
  398. "get": {
  399. "operationId": "pty.connect",
  400. "parameters": [
  401. {
  402. "in": "query",
  403. "name": "directory",
  404. "schema": {
  405. "type": "string"
  406. }
  407. },
  408. {
  409. "in": "path",
  410. "name": "ptyID",
  411. "schema": {
  412. "type": "string"
  413. },
  414. "required": true
  415. }
  416. ],
  417. "summary": "Connect to PTY session",
  418. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  419. "responses": {
  420. "200": {
  421. "description": "Connected session",
  422. "content": {
  423. "application/json": {
  424. "schema": {
  425. "type": "boolean"
  426. }
  427. }
  428. }
  429. },
  430. "404": {
  431. "description": "Not found",
  432. "content": {
  433. "application/json": {
  434. "schema": {
  435. "$ref": "#/components/schemas/NotFoundError"
  436. }
  437. }
  438. }
  439. }
  440. },
  441. "x-codeSamples": [
  442. {
  443. "lang": "js",
  444. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  445. }
  446. ]
  447. }
  448. },
  449. "/config": {
  450. "get": {
  451. "operationId": "config.get",
  452. "parameters": [
  453. {
  454. "in": "query",
  455. "name": "directory",
  456. "schema": {
  457. "type": "string"
  458. }
  459. }
  460. ],
  461. "summary": "Get configuration",
  462. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  463. "responses": {
  464. "200": {
  465. "description": "Get config info",
  466. "content": {
  467. "application/json": {
  468. "schema": {
  469. "$ref": "#/components/schemas/Config"
  470. }
  471. }
  472. }
  473. }
  474. },
  475. "x-codeSamples": [
  476. {
  477. "lang": "js",
  478. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  479. }
  480. ]
  481. },
  482. "patch": {
  483. "operationId": "config.update",
  484. "parameters": [
  485. {
  486. "in": "query",
  487. "name": "directory",
  488. "schema": {
  489. "type": "string"
  490. }
  491. }
  492. ],
  493. "summary": "Update configuration",
  494. "description": "Update OpenCode configuration settings and preferences.",
  495. "responses": {
  496. "200": {
  497. "description": "Successfully updated config",
  498. "content": {
  499. "application/json": {
  500. "schema": {
  501. "$ref": "#/components/schemas/Config"
  502. }
  503. }
  504. }
  505. },
  506. "400": {
  507. "description": "Bad request",
  508. "content": {
  509. "application/json": {
  510. "schema": {
  511. "$ref": "#/components/schemas/BadRequestError"
  512. }
  513. }
  514. }
  515. }
  516. },
  517. "requestBody": {
  518. "content": {
  519. "application/json": {
  520. "schema": {
  521. "$ref": "#/components/schemas/Config"
  522. }
  523. }
  524. }
  525. },
  526. "x-codeSamples": [
  527. {
  528. "lang": "js",
  529. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  530. }
  531. ]
  532. }
  533. },
  534. "/experimental/tool/ids": {
  535. "get": {
  536. "operationId": "tool.ids",
  537. "parameters": [
  538. {
  539. "in": "query",
  540. "name": "directory",
  541. "schema": {
  542. "type": "string"
  543. }
  544. }
  545. ],
  546. "summary": "List tool IDs",
  547. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  548. "responses": {
  549. "200": {
  550. "description": "Tool IDs",
  551. "content": {
  552. "application/json": {
  553. "schema": {
  554. "$ref": "#/components/schemas/ToolIDs"
  555. }
  556. }
  557. }
  558. },
  559. "400": {
  560. "description": "Bad request",
  561. "content": {
  562. "application/json": {
  563. "schema": {
  564. "$ref": "#/components/schemas/BadRequestError"
  565. }
  566. }
  567. }
  568. }
  569. },
  570. "x-codeSamples": [
  571. {
  572. "lang": "js",
  573. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  574. }
  575. ]
  576. }
  577. },
  578. "/experimental/tool": {
  579. "get": {
  580. "operationId": "tool.list",
  581. "parameters": [
  582. {
  583. "in": "query",
  584. "name": "directory",
  585. "schema": {
  586. "type": "string"
  587. }
  588. },
  589. {
  590. "in": "query",
  591. "name": "provider",
  592. "schema": {
  593. "type": "string"
  594. },
  595. "required": true
  596. },
  597. {
  598. "in": "query",
  599. "name": "model",
  600. "schema": {
  601. "type": "string"
  602. },
  603. "required": true
  604. }
  605. ],
  606. "summary": "List tools",
  607. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  608. "responses": {
  609. "200": {
  610. "description": "Tools",
  611. "content": {
  612. "application/json": {
  613. "schema": {
  614. "$ref": "#/components/schemas/ToolList"
  615. }
  616. }
  617. }
  618. },
  619. "400": {
  620. "description": "Bad request",
  621. "content": {
  622. "application/json": {
  623. "schema": {
  624. "$ref": "#/components/schemas/BadRequestError"
  625. }
  626. }
  627. }
  628. }
  629. },
  630. "x-codeSamples": [
  631. {
  632. "lang": "js",
  633. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  634. }
  635. ]
  636. }
  637. },
  638. "/instance/dispose": {
  639. "post": {
  640. "operationId": "instance.dispose",
  641. "parameters": [
  642. {
  643. "in": "query",
  644. "name": "directory",
  645. "schema": {
  646. "type": "string"
  647. }
  648. }
  649. ],
  650. "summary": "Dispose instance",
  651. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  652. "responses": {
  653. "200": {
  654. "description": "Instance disposed",
  655. "content": {
  656. "application/json": {
  657. "schema": {
  658. "type": "boolean"
  659. }
  660. }
  661. }
  662. }
  663. },
  664. "x-codeSamples": [
  665. {
  666. "lang": "js",
  667. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  668. }
  669. ]
  670. }
  671. },
  672. "/path": {
  673. "get": {
  674. "operationId": "path.get",
  675. "parameters": [
  676. {
  677. "in": "query",
  678. "name": "directory",
  679. "schema": {
  680. "type": "string"
  681. }
  682. }
  683. ],
  684. "summary": "Get paths",
  685. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  686. "responses": {
  687. "200": {
  688. "description": "Path",
  689. "content": {
  690. "application/json": {
  691. "schema": {
  692. "$ref": "#/components/schemas/Path"
  693. }
  694. }
  695. }
  696. }
  697. },
  698. "x-codeSamples": [
  699. {
  700. "lang": "js",
  701. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  702. }
  703. ]
  704. }
  705. },
  706. "/vcs": {
  707. "get": {
  708. "operationId": "vcs.get",
  709. "parameters": [
  710. {
  711. "in": "query",
  712. "name": "directory",
  713. "schema": {
  714. "type": "string"
  715. }
  716. }
  717. ],
  718. "summary": "Get VCS info",
  719. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  720. "responses": {
  721. "200": {
  722. "description": "VCS info",
  723. "content": {
  724. "application/json": {
  725. "schema": {
  726. "$ref": "#/components/schemas/VcsInfo"
  727. }
  728. }
  729. }
  730. }
  731. },
  732. "x-codeSamples": [
  733. {
  734. "lang": "js",
  735. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  736. }
  737. ]
  738. }
  739. },
  740. "/session": {
  741. "get": {
  742. "operationId": "session.list",
  743. "parameters": [
  744. {
  745. "in": "query",
  746. "name": "directory",
  747. "schema": {
  748. "type": "string"
  749. }
  750. }
  751. ],
  752. "summary": "List sessions",
  753. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  754. "responses": {
  755. "200": {
  756. "description": "List of sessions",
  757. "content": {
  758. "application/json": {
  759. "schema": {
  760. "type": "array",
  761. "items": {
  762. "$ref": "#/components/schemas/Session"
  763. }
  764. }
  765. }
  766. }
  767. }
  768. },
  769. "x-codeSamples": [
  770. {
  771. "lang": "js",
  772. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  773. }
  774. ]
  775. },
  776. "post": {
  777. "operationId": "session.create",
  778. "parameters": [
  779. {
  780. "in": "query",
  781. "name": "directory",
  782. "schema": {
  783. "type": "string"
  784. }
  785. }
  786. ],
  787. "summary": "Create session",
  788. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  789. "responses": {
  790. "200": {
  791. "description": "Successfully created session",
  792. "content": {
  793. "application/json": {
  794. "schema": {
  795. "$ref": "#/components/schemas/Session"
  796. }
  797. }
  798. }
  799. },
  800. "400": {
  801. "description": "Bad request",
  802. "content": {
  803. "application/json": {
  804. "schema": {
  805. "$ref": "#/components/schemas/BadRequestError"
  806. }
  807. }
  808. }
  809. }
  810. },
  811. "requestBody": {
  812. "content": {
  813. "application/json": {
  814. "schema": {
  815. "type": "object",
  816. "properties": {
  817. "parentID": {
  818. "type": "string",
  819. "pattern": "^ses.*"
  820. },
  821. "title": {
  822. "type": "string"
  823. }
  824. }
  825. }
  826. }
  827. }
  828. },
  829. "x-codeSamples": [
  830. {
  831. "lang": "js",
  832. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  833. }
  834. ]
  835. }
  836. },
  837. "/session/status": {
  838. "get": {
  839. "operationId": "session.status",
  840. "parameters": [
  841. {
  842. "in": "query",
  843. "name": "directory",
  844. "schema": {
  845. "type": "string"
  846. }
  847. }
  848. ],
  849. "summary": "Get session status",
  850. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  851. "responses": {
  852. "200": {
  853. "description": "Get session status",
  854. "content": {
  855. "application/json": {
  856. "schema": {
  857. "type": "object",
  858. "propertyNames": {
  859. "type": "string"
  860. },
  861. "additionalProperties": {
  862. "$ref": "#/components/schemas/SessionStatus"
  863. }
  864. }
  865. }
  866. }
  867. },
  868. "400": {
  869. "description": "Bad request",
  870. "content": {
  871. "application/json": {
  872. "schema": {
  873. "$ref": "#/components/schemas/BadRequestError"
  874. }
  875. }
  876. }
  877. }
  878. },
  879. "x-codeSamples": [
  880. {
  881. "lang": "js",
  882. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  883. }
  884. ]
  885. }
  886. },
  887. "/session/{sessionID}": {
  888. "get": {
  889. "operationId": "session.get",
  890. "parameters": [
  891. {
  892. "in": "query",
  893. "name": "directory",
  894. "schema": {
  895. "type": "string"
  896. }
  897. },
  898. {
  899. "in": "path",
  900. "name": "sessionID",
  901. "schema": {
  902. "type": "string",
  903. "pattern": "^ses.*"
  904. },
  905. "required": true
  906. }
  907. ],
  908. "summary": "Get session",
  909. "description": "Retrieve detailed information about a specific OpenCode session.",
  910. "tags": ["Session"],
  911. "responses": {
  912. "200": {
  913. "description": "Get session",
  914. "content": {
  915. "application/json": {
  916. "schema": {
  917. "$ref": "#/components/schemas/Session"
  918. }
  919. }
  920. }
  921. },
  922. "400": {
  923. "description": "Bad request",
  924. "content": {
  925. "application/json": {
  926. "schema": {
  927. "$ref": "#/components/schemas/BadRequestError"
  928. }
  929. }
  930. }
  931. },
  932. "404": {
  933. "description": "Not found",
  934. "content": {
  935. "application/json": {
  936. "schema": {
  937. "$ref": "#/components/schemas/NotFoundError"
  938. }
  939. }
  940. }
  941. }
  942. },
  943. "x-codeSamples": [
  944. {
  945. "lang": "js",
  946. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  947. }
  948. ]
  949. },
  950. "delete": {
  951. "operationId": "session.delete",
  952. "parameters": [
  953. {
  954. "in": "query",
  955. "name": "directory",
  956. "schema": {
  957. "type": "string"
  958. }
  959. },
  960. {
  961. "in": "path",
  962. "name": "sessionID",
  963. "schema": {
  964. "type": "string",
  965. "pattern": "^ses.*"
  966. },
  967. "required": true
  968. }
  969. ],
  970. "summary": "Delete session",
  971. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  972. "responses": {
  973. "200": {
  974. "description": "Successfully deleted session",
  975. "content": {
  976. "application/json": {
  977. "schema": {
  978. "type": "boolean"
  979. }
  980. }
  981. }
  982. },
  983. "400": {
  984. "description": "Bad request",
  985. "content": {
  986. "application/json": {
  987. "schema": {
  988. "$ref": "#/components/schemas/BadRequestError"
  989. }
  990. }
  991. }
  992. },
  993. "404": {
  994. "description": "Not found",
  995. "content": {
  996. "application/json": {
  997. "schema": {
  998. "$ref": "#/components/schemas/NotFoundError"
  999. }
  1000. }
  1001. }
  1002. }
  1003. },
  1004. "x-codeSamples": [
  1005. {
  1006. "lang": "js",
  1007. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  1008. }
  1009. ]
  1010. },
  1011. "patch": {
  1012. "operationId": "session.update",
  1013. "parameters": [
  1014. {
  1015. "in": "query",
  1016. "name": "directory",
  1017. "schema": {
  1018. "type": "string"
  1019. }
  1020. },
  1021. {
  1022. "in": "path",
  1023. "name": "sessionID",
  1024. "schema": {
  1025. "type": "string"
  1026. },
  1027. "required": true
  1028. }
  1029. ],
  1030. "summary": "Update session",
  1031. "description": "Update properties of an existing session, such as title or other metadata.",
  1032. "responses": {
  1033. "200": {
  1034. "description": "Successfully updated session",
  1035. "content": {
  1036. "application/json": {
  1037. "schema": {
  1038. "$ref": "#/components/schemas/Session"
  1039. }
  1040. }
  1041. }
  1042. },
  1043. "400": {
  1044. "description": "Bad request",
  1045. "content": {
  1046. "application/json": {
  1047. "schema": {
  1048. "$ref": "#/components/schemas/BadRequestError"
  1049. }
  1050. }
  1051. }
  1052. },
  1053. "404": {
  1054. "description": "Not found",
  1055. "content": {
  1056. "application/json": {
  1057. "schema": {
  1058. "$ref": "#/components/schemas/NotFoundError"
  1059. }
  1060. }
  1061. }
  1062. }
  1063. },
  1064. "requestBody": {
  1065. "content": {
  1066. "application/json": {
  1067. "schema": {
  1068. "type": "object",
  1069. "properties": {
  1070. "title": {
  1071. "type": "string"
  1072. }
  1073. }
  1074. }
  1075. }
  1076. }
  1077. },
  1078. "x-codeSamples": [
  1079. {
  1080. "lang": "js",
  1081. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  1082. }
  1083. ]
  1084. }
  1085. },
  1086. "/session/{sessionID}/children": {
  1087. "get": {
  1088. "operationId": "session.children",
  1089. "parameters": [
  1090. {
  1091. "in": "query",
  1092. "name": "directory",
  1093. "schema": {
  1094. "type": "string"
  1095. }
  1096. },
  1097. {
  1098. "in": "path",
  1099. "name": "sessionID",
  1100. "schema": {
  1101. "type": "string",
  1102. "pattern": "^ses.*"
  1103. },
  1104. "required": true
  1105. }
  1106. ],
  1107. "summary": "Get session children",
  1108. "tags": ["Session"],
  1109. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  1110. "responses": {
  1111. "200": {
  1112. "description": "List of children",
  1113. "content": {
  1114. "application/json": {
  1115. "schema": {
  1116. "type": "array",
  1117. "items": {
  1118. "$ref": "#/components/schemas/Session"
  1119. }
  1120. }
  1121. }
  1122. }
  1123. },
  1124. "400": {
  1125. "description": "Bad request",
  1126. "content": {
  1127. "application/json": {
  1128. "schema": {
  1129. "$ref": "#/components/schemas/BadRequestError"
  1130. }
  1131. }
  1132. }
  1133. },
  1134. "404": {
  1135. "description": "Not found",
  1136. "content": {
  1137. "application/json": {
  1138. "schema": {
  1139. "$ref": "#/components/schemas/NotFoundError"
  1140. }
  1141. }
  1142. }
  1143. }
  1144. },
  1145. "x-codeSamples": [
  1146. {
  1147. "lang": "js",
  1148. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  1149. }
  1150. ]
  1151. }
  1152. },
  1153. "/session/{sessionID}/todo": {
  1154. "get": {
  1155. "operationId": "session.todo",
  1156. "parameters": [
  1157. {
  1158. "in": "query",
  1159. "name": "directory",
  1160. "schema": {
  1161. "type": "string"
  1162. }
  1163. },
  1164. {
  1165. "in": "path",
  1166. "name": "sessionID",
  1167. "schema": {
  1168. "type": "string"
  1169. },
  1170. "required": true,
  1171. "description": "Session ID"
  1172. }
  1173. ],
  1174. "summary": "Get session todos",
  1175. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  1176. "responses": {
  1177. "200": {
  1178. "description": "Todo list",
  1179. "content": {
  1180. "application/json": {
  1181. "schema": {
  1182. "type": "array",
  1183. "items": {
  1184. "$ref": "#/components/schemas/Todo"
  1185. }
  1186. }
  1187. }
  1188. }
  1189. },
  1190. "400": {
  1191. "description": "Bad request",
  1192. "content": {
  1193. "application/json": {
  1194. "schema": {
  1195. "$ref": "#/components/schemas/BadRequestError"
  1196. }
  1197. }
  1198. }
  1199. },
  1200. "404": {
  1201. "description": "Not found",
  1202. "content": {
  1203. "application/json": {
  1204. "schema": {
  1205. "$ref": "#/components/schemas/NotFoundError"
  1206. }
  1207. }
  1208. }
  1209. }
  1210. },
  1211. "x-codeSamples": [
  1212. {
  1213. "lang": "js",
  1214. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  1215. }
  1216. ]
  1217. }
  1218. },
  1219. "/session/{sessionID}/init": {
  1220. "post": {
  1221. "operationId": "session.init",
  1222. "parameters": [
  1223. {
  1224. "in": "query",
  1225. "name": "directory",
  1226. "schema": {
  1227. "type": "string"
  1228. }
  1229. },
  1230. {
  1231. "in": "path",
  1232. "name": "sessionID",
  1233. "schema": {
  1234. "type": "string"
  1235. },
  1236. "required": true,
  1237. "description": "Session ID"
  1238. }
  1239. ],
  1240. "summary": "Initialize session",
  1241. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  1242. "responses": {
  1243. "200": {
  1244. "description": "200",
  1245. "content": {
  1246. "application/json": {
  1247. "schema": {
  1248. "type": "boolean"
  1249. }
  1250. }
  1251. }
  1252. },
  1253. "400": {
  1254. "description": "Bad request",
  1255. "content": {
  1256. "application/json": {
  1257. "schema": {
  1258. "$ref": "#/components/schemas/BadRequestError"
  1259. }
  1260. }
  1261. }
  1262. },
  1263. "404": {
  1264. "description": "Not found",
  1265. "content": {
  1266. "application/json": {
  1267. "schema": {
  1268. "$ref": "#/components/schemas/NotFoundError"
  1269. }
  1270. }
  1271. }
  1272. }
  1273. },
  1274. "requestBody": {
  1275. "content": {
  1276. "application/json": {
  1277. "schema": {
  1278. "type": "object",
  1279. "properties": {
  1280. "modelID": {
  1281. "type": "string"
  1282. },
  1283. "providerID": {
  1284. "type": "string"
  1285. },
  1286. "messageID": {
  1287. "type": "string",
  1288. "pattern": "^msg.*"
  1289. }
  1290. },
  1291. "required": ["modelID", "providerID", "messageID"]
  1292. }
  1293. }
  1294. }
  1295. },
  1296. "x-codeSamples": [
  1297. {
  1298. "lang": "js",
  1299. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  1300. }
  1301. ]
  1302. }
  1303. },
  1304. "/session/{sessionID}/fork": {
  1305. "post": {
  1306. "operationId": "session.fork",
  1307. "parameters": [
  1308. {
  1309. "in": "query",
  1310. "name": "directory",
  1311. "schema": {
  1312. "type": "string"
  1313. }
  1314. },
  1315. {
  1316. "in": "path",
  1317. "name": "sessionID",
  1318. "schema": {
  1319. "type": "string",
  1320. "pattern": "^ses.*"
  1321. },
  1322. "required": true
  1323. }
  1324. ],
  1325. "summary": "Fork session",
  1326. "description": "Create a new session by forking an existing session at a specific message point.",
  1327. "responses": {
  1328. "200": {
  1329. "description": "200",
  1330. "content": {
  1331. "application/json": {
  1332. "schema": {
  1333. "$ref": "#/components/schemas/Session"
  1334. }
  1335. }
  1336. }
  1337. }
  1338. },
  1339. "requestBody": {
  1340. "content": {
  1341. "application/json": {
  1342. "schema": {
  1343. "type": "object",
  1344. "properties": {
  1345. "messageID": {
  1346. "type": "string",
  1347. "pattern": "^msg.*"
  1348. }
  1349. }
  1350. }
  1351. }
  1352. }
  1353. },
  1354. "x-codeSamples": [
  1355. {
  1356. "lang": "js",
  1357. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  1358. }
  1359. ]
  1360. }
  1361. },
  1362. "/session/{sessionID}/abort": {
  1363. "post": {
  1364. "operationId": "session.abort",
  1365. "parameters": [
  1366. {
  1367. "in": "query",
  1368. "name": "directory",
  1369. "schema": {
  1370. "type": "string"
  1371. }
  1372. },
  1373. {
  1374. "in": "path",
  1375. "name": "sessionID",
  1376. "schema": {
  1377. "type": "string"
  1378. },
  1379. "required": true
  1380. }
  1381. ],
  1382. "summary": "Abort session",
  1383. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  1384. "responses": {
  1385. "200": {
  1386. "description": "Aborted session",
  1387. "content": {
  1388. "application/json": {
  1389. "schema": {
  1390. "type": "boolean"
  1391. }
  1392. }
  1393. }
  1394. },
  1395. "400": {
  1396. "description": "Bad request",
  1397. "content": {
  1398. "application/json": {
  1399. "schema": {
  1400. "$ref": "#/components/schemas/BadRequestError"
  1401. }
  1402. }
  1403. }
  1404. },
  1405. "404": {
  1406. "description": "Not found",
  1407. "content": {
  1408. "application/json": {
  1409. "schema": {
  1410. "$ref": "#/components/schemas/NotFoundError"
  1411. }
  1412. }
  1413. }
  1414. }
  1415. },
  1416. "x-codeSamples": [
  1417. {
  1418. "lang": "js",
  1419. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  1420. }
  1421. ]
  1422. }
  1423. },
  1424. "/session/{sessionID}/share": {
  1425. "post": {
  1426. "operationId": "session.share",
  1427. "parameters": [
  1428. {
  1429. "in": "query",
  1430. "name": "directory",
  1431. "schema": {
  1432. "type": "string"
  1433. }
  1434. },
  1435. {
  1436. "in": "path",
  1437. "name": "sessionID",
  1438. "schema": {
  1439. "type": "string"
  1440. },
  1441. "required": true
  1442. }
  1443. ],
  1444. "summary": "Share session",
  1445. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  1446. "responses": {
  1447. "200": {
  1448. "description": "Successfully shared session",
  1449. "content": {
  1450. "application/json": {
  1451. "schema": {
  1452. "$ref": "#/components/schemas/Session"
  1453. }
  1454. }
  1455. }
  1456. },
  1457. "400": {
  1458. "description": "Bad request",
  1459. "content": {
  1460. "application/json": {
  1461. "schema": {
  1462. "$ref": "#/components/schemas/BadRequestError"
  1463. }
  1464. }
  1465. }
  1466. },
  1467. "404": {
  1468. "description": "Not found",
  1469. "content": {
  1470. "application/json": {
  1471. "schema": {
  1472. "$ref": "#/components/schemas/NotFoundError"
  1473. }
  1474. }
  1475. }
  1476. }
  1477. },
  1478. "x-codeSamples": [
  1479. {
  1480. "lang": "js",
  1481. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  1482. }
  1483. ]
  1484. },
  1485. "delete": {
  1486. "operationId": "session.unshare",
  1487. "parameters": [
  1488. {
  1489. "in": "query",
  1490. "name": "directory",
  1491. "schema": {
  1492. "type": "string"
  1493. }
  1494. },
  1495. {
  1496. "in": "path",
  1497. "name": "sessionID",
  1498. "schema": {
  1499. "type": "string",
  1500. "pattern": "^ses.*"
  1501. },
  1502. "required": true
  1503. }
  1504. ],
  1505. "summary": "Unshare session",
  1506. "description": "Remove the shareable link for a session, making it private again.",
  1507. "responses": {
  1508. "200": {
  1509. "description": "Successfully unshared session",
  1510. "content": {
  1511. "application/json": {
  1512. "schema": {
  1513. "$ref": "#/components/schemas/Session"
  1514. }
  1515. }
  1516. }
  1517. },
  1518. "400": {
  1519. "description": "Bad request",
  1520. "content": {
  1521. "application/json": {
  1522. "schema": {
  1523. "$ref": "#/components/schemas/BadRequestError"
  1524. }
  1525. }
  1526. }
  1527. },
  1528. "404": {
  1529. "description": "Not found",
  1530. "content": {
  1531. "application/json": {
  1532. "schema": {
  1533. "$ref": "#/components/schemas/NotFoundError"
  1534. }
  1535. }
  1536. }
  1537. }
  1538. },
  1539. "x-codeSamples": [
  1540. {
  1541. "lang": "js",
  1542. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  1543. }
  1544. ]
  1545. }
  1546. },
  1547. "/session/{sessionID}/diff": {
  1548. "get": {
  1549. "operationId": "session.diff",
  1550. "parameters": [
  1551. {
  1552. "in": "query",
  1553. "name": "directory",
  1554. "schema": {
  1555. "type": "string"
  1556. }
  1557. },
  1558. {
  1559. "in": "path",
  1560. "name": "sessionID",
  1561. "schema": {
  1562. "type": "string"
  1563. },
  1564. "required": true,
  1565. "description": "Session ID"
  1566. },
  1567. {
  1568. "in": "query",
  1569. "name": "messageID",
  1570. "schema": {
  1571. "type": "string",
  1572. "pattern": "^msg.*"
  1573. }
  1574. }
  1575. ],
  1576. "summary": "Get session diff",
  1577. "description": "Get all file changes (diffs) made during this session.",
  1578. "responses": {
  1579. "200": {
  1580. "description": "List of diffs",
  1581. "content": {
  1582. "application/json": {
  1583. "schema": {
  1584. "type": "array",
  1585. "items": {
  1586. "$ref": "#/components/schemas/FileDiff"
  1587. }
  1588. }
  1589. }
  1590. }
  1591. },
  1592. "400": {
  1593. "description": "Bad request",
  1594. "content": {
  1595. "application/json": {
  1596. "schema": {
  1597. "$ref": "#/components/schemas/BadRequestError"
  1598. }
  1599. }
  1600. }
  1601. },
  1602. "404": {
  1603. "description": "Not found",
  1604. "content": {
  1605. "application/json": {
  1606. "schema": {
  1607. "$ref": "#/components/schemas/NotFoundError"
  1608. }
  1609. }
  1610. }
  1611. }
  1612. },
  1613. "x-codeSamples": [
  1614. {
  1615. "lang": "js",
  1616. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  1617. }
  1618. ]
  1619. }
  1620. },
  1621. "/session/{sessionID}/summarize": {
  1622. "post": {
  1623. "operationId": "session.summarize",
  1624. "parameters": [
  1625. {
  1626. "in": "query",
  1627. "name": "directory",
  1628. "schema": {
  1629. "type": "string"
  1630. }
  1631. },
  1632. {
  1633. "in": "path",
  1634. "name": "sessionID",
  1635. "schema": {
  1636. "type": "string"
  1637. },
  1638. "required": true,
  1639. "description": "Session ID"
  1640. }
  1641. ],
  1642. "summary": "Summarize session",
  1643. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  1644. "responses": {
  1645. "200": {
  1646. "description": "Summarized session",
  1647. "content": {
  1648. "application/json": {
  1649. "schema": {
  1650. "type": "boolean"
  1651. }
  1652. }
  1653. }
  1654. },
  1655. "400": {
  1656. "description": "Bad request",
  1657. "content": {
  1658. "application/json": {
  1659. "schema": {
  1660. "$ref": "#/components/schemas/BadRequestError"
  1661. }
  1662. }
  1663. }
  1664. },
  1665. "404": {
  1666. "description": "Not found",
  1667. "content": {
  1668. "application/json": {
  1669. "schema": {
  1670. "$ref": "#/components/schemas/NotFoundError"
  1671. }
  1672. }
  1673. }
  1674. }
  1675. },
  1676. "requestBody": {
  1677. "content": {
  1678. "application/json": {
  1679. "schema": {
  1680. "type": "object",
  1681. "properties": {
  1682. "providerID": {
  1683. "type": "string"
  1684. },
  1685. "modelID": {
  1686. "type": "string"
  1687. }
  1688. },
  1689. "required": ["providerID", "modelID"]
  1690. }
  1691. }
  1692. }
  1693. },
  1694. "x-codeSamples": [
  1695. {
  1696. "lang": "js",
  1697. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  1698. }
  1699. ]
  1700. }
  1701. },
  1702. "/session/{sessionID}/message": {
  1703. "get": {
  1704. "operationId": "session.messages",
  1705. "parameters": [
  1706. {
  1707. "in": "query",
  1708. "name": "directory",
  1709. "schema": {
  1710. "type": "string"
  1711. }
  1712. },
  1713. {
  1714. "in": "path",
  1715. "name": "sessionID",
  1716. "schema": {
  1717. "type": "string"
  1718. },
  1719. "required": true,
  1720. "description": "Session ID"
  1721. },
  1722. {
  1723. "in": "query",
  1724. "name": "limit",
  1725. "schema": {
  1726. "type": "number"
  1727. }
  1728. }
  1729. ],
  1730. "summary": "Get session messages",
  1731. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  1732. "responses": {
  1733. "200": {
  1734. "description": "List of messages",
  1735. "content": {
  1736. "application/json": {
  1737. "schema": {
  1738. "type": "array",
  1739. "items": {
  1740. "type": "object",
  1741. "properties": {
  1742. "info": {
  1743. "$ref": "#/components/schemas/Message"
  1744. },
  1745. "parts": {
  1746. "type": "array",
  1747. "items": {
  1748. "$ref": "#/components/schemas/Part"
  1749. }
  1750. }
  1751. },
  1752. "required": ["info", "parts"]
  1753. }
  1754. }
  1755. }
  1756. }
  1757. },
  1758. "400": {
  1759. "description": "Bad request",
  1760. "content": {
  1761. "application/json": {
  1762. "schema": {
  1763. "$ref": "#/components/schemas/BadRequestError"
  1764. }
  1765. }
  1766. }
  1767. },
  1768. "404": {
  1769. "description": "Not found",
  1770. "content": {
  1771. "application/json": {
  1772. "schema": {
  1773. "$ref": "#/components/schemas/NotFoundError"
  1774. }
  1775. }
  1776. }
  1777. }
  1778. },
  1779. "x-codeSamples": [
  1780. {
  1781. "lang": "js",
  1782. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  1783. }
  1784. ]
  1785. },
  1786. "post": {
  1787. "operationId": "session.prompt",
  1788. "parameters": [
  1789. {
  1790. "in": "query",
  1791. "name": "directory",
  1792. "schema": {
  1793. "type": "string"
  1794. }
  1795. },
  1796. {
  1797. "in": "path",
  1798. "name": "sessionID",
  1799. "schema": {
  1800. "type": "string"
  1801. },
  1802. "required": true,
  1803. "description": "Session ID"
  1804. }
  1805. ],
  1806. "summary": "Send message",
  1807. "description": "Create and send a new message to a session, streaming the AI response.",
  1808. "responses": {
  1809. "200": {
  1810. "description": "Created message",
  1811. "content": {
  1812. "application/json": {
  1813. "schema": {
  1814. "type": "object",
  1815. "properties": {
  1816. "info": {
  1817. "$ref": "#/components/schemas/AssistantMessage"
  1818. },
  1819. "parts": {
  1820. "type": "array",
  1821. "items": {
  1822. "$ref": "#/components/schemas/Part"
  1823. }
  1824. }
  1825. },
  1826. "required": ["info", "parts"]
  1827. }
  1828. }
  1829. }
  1830. },
  1831. "400": {
  1832. "description": "Bad request",
  1833. "content": {
  1834. "application/json": {
  1835. "schema": {
  1836. "$ref": "#/components/schemas/BadRequestError"
  1837. }
  1838. }
  1839. }
  1840. },
  1841. "404": {
  1842. "description": "Not found",
  1843. "content": {
  1844. "application/json": {
  1845. "schema": {
  1846. "$ref": "#/components/schemas/NotFoundError"
  1847. }
  1848. }
  1849. }
  1850. }
  1851. },
  1852. "requestBody": {
  1853. "content": {
  1854. "application/json": {
  1855. "schema": {
  1856. "type": "object",
  1857. "properties": {
  1858. "messageID": {
  1859. "type": "string",
  1860. "pattern": "^msg.*"
  1861. },
  1862. "model": {
  1863. "type": "object",
  1864. "properties": {
  1865. "providerID": {
  1866. "type": "string"
  1867. },
  1868. "modelID": {
  1869. "type": "string"
  1870. }
  1871. },
  1872. "required": ["providerID", "modelID"]
  1873. },
  1874. "agent": {
  1875. "type": "string"
  1876. },
  1877. "noReply": {
  1878. "type": "boolean"
  1879. },
  1880. "system": {
  1881. "type": "string"
  1882. },
  1883. "tools": {
  1884. "type": "object",
  1885. "propertyNames": {
  1886. "type": "string"
  1887. },
  1888. "additionalProperties": {
  1889. "type": "boolean"
  1890. }
  1891. },
  1892. "parts": {
  1893. "type": "array",
  1894. "items": {
  1895. "anyOf": [
  1896. {
  1897. "$ref": "#/components/schemas/TextPartInput"
  1898. },
  1899. {
  1900. "$ref": "#/components/schemas/FilePartInput"
  1901. },
  1902. {
  1903. "$ref": "#/components/schemas/AgentPartInput"
  1904. },
  1905. {
  1906. "$ref": "#/components/schemas/SubtaskPartInput"
  1907. }
  1908. ]
  1909. }
  1910. }
  1911. },
  1912. "required": ["parts"]
  1913. }
  1914. }
  1915. }
  1916. },
  1917. "x-codeSamples": [
  1918. {
  1919. "lang": "js",
  1920. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  1921. }
  1922. ]
  1923. }
  1924. },
  1925. "/session/{sessionID}/message/{messageID}": {
  1926. "get": {
  1927. "operationId": "session.message",
  1928. "parameters": [
  1929. {
  1930. "in": "query",
  1931. "name": "directory",
  1932. "schema": {
  1933. "type": "string"
  1934. }
  1935. },
  1936. {
  1937. "in": "path",
  1938. "name": "sessionID",
  1939. "schema": {
  1940. "type": "string"
  1941. },
  1942. "required": true,
  1943. "description": "Session ID"
  1944. },
  1945. {
  1946. "in": "path",
  1947. "name": "messageID",
  1948. "schema": {
  1949. "type": "string"
  1950. },
  1951. "required": true,
  1952. "description": "Message ID"
  1953. }
  1954. ],
  1955. "summary": "Get message",
  1956. "description": "Retrieve a specific message from a session by its message ID.",
  1957. "responses": {
  1958. "200": {
  1959. "description": "Message",
  1960. "content": {
  1961. "application/json": {
  1962. "schema": {
  1963. "type": "object",
  1964. "properties": {
  1965. "info": {
  1966. "$ref": "#/components/schemas/Message"
  1967. },
  1968. "parts": {
  1969. "type": "array",
  1970. "items": {
  1971. "$ref": "#/components/schemas/Part"
  1972. }
  1973. }
  1974. },
  1975. "required": ["info", "parts"]
  1976. }
  1977. }
  1978. }
  1979. },
  1980. "400": {
  1981. "description": "Bad request",
  1982. "content": {
  1983. "application/json": {
  1984. "schema": {
  1985. "$ref": "#/components/schemas/BadRequestError"
  1986. }
  1987. }
  1988. }
  1989. },
  1990. "404": {
  1991. "description": "Not found",
  1992. "content": {
  1993. "application/json": {
  1994. "schema": {
  1995. "$ref": "#/components/schemas/NotFoundError"
  1996. }
  1997. }
  1998. }
  1999. }
  2000. },
  2001. "x-codeSamples": [
  2002. {
  2003. "lang": "js",
  2004. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  2005. }
  2006. ]
  2007. }
  2008. },
  2009. "/session/{sessionID}/prompt_async": {
  2010. "post": {
  2011. "operationId": "session.prompt_async",
  2012. "parameters": [
  2013. {
  2014. "in": "query",
  2015. "name": "directory",
  2016. "schema": {
  2017. "type": "string"
  2018. }
  2019. },
  2020. {
  2021. "in": "path",
  2022. "name": "sessionID",
  2023. "schema": {
  2024. "type": "string"
  2025. },
  2026. "required": true,
  2027. "description": "Session ID"
  2028. }
  2029. ],
  2030. "summary": "Send async message",
  2031. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  2032. "responses": {
  2033. "204": {
  2034. "description": "Prompt accepted"
  2035. },
  2036. "400": {
  2037. "description": "Bad request",
  2038. "content": {
  2039. "application/json": {
  2040. "schema": {
  2041. "$ref": "#/components/schemas/BadRequestError"
  2042. }
  2043. }
  2044. }
  2045. },
  2046. "404": {
  2047. "description": "Not found",
  2048. "content": {
  2049. "application/json": {
  2050. "schema": {
  2051. "$ref": "#/components/schemas/NotFoundError"
  2052. }
  2053. }
  2054. }
  2055. }
  2056. },
  2057. "requestBody": {
  2058. "content": {
  2059. "application/json": {
  2060. "schema": {
  2061. "type": "object",
  2062. "properties": {
  2063. "messageID": {
  2064. "type": "string",
  2065. "pattern": "^msg.*"
  2066. },
  2067. "model": {
  2068. "type": "object",
  2069. "properties": {
  2070. "providerID": {
  2071. "type": "string"
  2072. },
  2073. "modelID": {
  2074. "type": "string"
  2075. }
  2076. },
  2077. "required": ["providerID", "modelID"]
  2078. },
  2079. "agent": {
  2080. "type": "string"
  2081. },
  2082. "noReply": {
  2083. "type": "boolean"
  2084. },
  2085. "system": {
  2086. "type": "string"
  2087. },
  2088. "tools": {
  2089. "type": "object",
  2090. "propertyNames": {
  2091. "type": "string"
  2092. },
  2093. "additionalProperties": {
  2094. "type": "boolean"
  2095. }
  2096. },
  2097. "parts": {
  2098. "type": "array",
  2099. "items": {
  2100. "anyOf": [
  2101. {
  2102. "$ref": "#/components/schemas/TextPartInput"
  2103. },
  2104. {
  2105. "$ref": "#/components/schemas/FilePartInput"
  2106. },
  2107. {
  2108. "$ref": "#/components/schemas/AgentPartInput"
  2109. },
  2110. {
  2111. "$ref": "#/components/schemas/SubtaskPartInput"
  2112. }
  2113. ]
  2114. }
  2115. }
  2116. },
  2117. "required": ["parts"]
  2118. }
  2119. }
  2120. }
  2121. },
  2122. "x-codeSamples": [
  2123. {
  2124. "lang": "js",
  2125. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  2126. }
  2127. ]
  2128. }
  2129. },
  2130. "/session/{sessionID}/command": {
  2131. "post": {
  2132. "operationId": "session.command",
  2133. "parameters": [
  2134. {
  2135. "in": "query",
  2136. "name": "directory",
  2137. "schema": {
  2138. "type": "string"
  2139. }
  2140. },
  2141. {
  2142. "in": "path",
  2143. "name": "sessionID",
  2144. "schema": {
  2145. "type": "string"
  2146. },
  2147. "required": true,
  2148. "description": "Session ID"
  2149. }
  2150. ],
  2151. "summary": "Send command",
  2152. "description": "Send a new command to a session for execution by the AI assistant.",
  2153. "responses": {
  2154. "200": {
  2155. "description": "Created message",
  2156. "content": {
  2157. "application/json": {
  2158. "schema": {
  2159. "type": "object",
  2160. "properties": {
  2161. "info": {
  2162. "$ref": "#/components/schemas/AssistantMessage"
  2163. },
  2164. "parts": {
  2165. "type": "array",
  2166. "items": {
  2167. "$ref": "#/components/schemas/Part"
  2168. }
  2169. }
  2170. },
  2171. "required": ["info", "parts"]
  2172. }
  2173. }
  2174. }
  2175. },
  2176. "400": {
  2177. "description": "Bad request",
  2178. "content": {
  2179. "application/json": {
  2180. "schema": {
  2181. "$ref": "#/components/schemas/BadRequestError"
  2182. }
  2183. }
  2184. }
  2185. },
  2186. "404": {
  2187. "description": "Not found",
  2188. "content": {
  2189. "application/json": {
  2190. "schema": {
  2191. "$ref": "#/components/schemas/NotFoundError"
  2192. }
  2193. }
  2194. }
  2195. }
  2196. },
  2197. "requestBody": {
  2198. "content": {
  2199. "application/json": {
  2200. "schema": {
  2201. "type": "object",
  2202. "properties": {
  2203. "messageID": {
  2204. "type": "string",
  2205. "pattern": "^msg.*"
  2206. },
  2207. "agent": {
  2208. "type": "string"
  2209. },
  2210. "model": {
  2211. "type": "string"
  2212. },
  2213. "arguments": {
  2214. "type": "string"
  2215. },
  2216. "command": {
  2217. "type": "string"
  2218. }
  2219. },
  2220. "required": ["arguments", "command"]
  2221. }
  2222. }
  2223. }
  2224. },
  2225. "x-codeSamples": [
  2226. {
  2227. "lang": "js",
  2228. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  2229. }
  2230. ]
  2231. }
  2232. },
  2233. "/session/{sessionID}/shell": {
  2234. "post": {
  2235. "operationId": "session.shell",
  2236. "parameters": [
  2237. {
  2238. "in": "query",
  2239. "name": "directory",
  2240. "schema": {
  2241. "type": "string"
  2242. }
  2243. },
  2244. {
  2245. "in": "path",
  2246. "name": "sessionID",
  2247. "schema": {
  2248. "type": "string"
  2249. },
  2250. "required": true,
  2251. "description": "Session ID"
  2252. }
  2253. ],
  2254. "summary": "Run shell command",
  2255. "description": "Execute a shell command within the session context and return the AI's response.",
  2256. "responses": {
  2257. "200": {
  2258. "description": "Created message",
  2259. "content": {
  2260. "application/json": {
  2261. "schema": {
  2262. "$ref": "#/components/schemas/AssistantMessage"
  2263. }
  2264. }
  2265. }
  2266. },
  2267. "400": {
  2268. "description": "Bad request",
  2269. "content": {
  2270. "application/json": {
  2271. "schema": {
  2272. "$ref": "#/components/schemas/BadRequestError"
  2273. }
  2274. }
  2275. }
  2276. },
  2277. "404": {
  2278. "description": "Not found",
  2279. "content": {
  2280. "application/json": {
  2281. "schema": {
  2282. "$ref": "#/components/schemas/NotFoundError"
  2283. }
  2284. }
  2285. }
  2286. }
  2287. },
  2288. "requestBody": {
  2289. "content": {
  2290. "application/json": {
  2291. "schema": {
  2292. "type": "object",
  2293. "properties": {
  2294. "agent": {
  2295. "type": "string"
  2296. },
  2297. "model": {
  2298. "type": "object",
  2299. "properties": {
  2300. "providerID": {
  2301. "type": "string"
  2302. },
  2303. "modelID": {
  2304. "type": "string"
  2305. }
  2306. },
  2307. "required": ["providerID", "modelID"]
  2308. },
  2309. "command": {
  2310. "type": "string"
  2311. }
  2312. },
  2313. "required": ["agent", "command"]
  2314. }
  2315. }
  2316. }
  2317. },
  2318. "x-codeSamples": [
  2319. {
  2320. "lang": "js",
  2321. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  2322. }
  2323. ]
  2324. }
  2325. },
  2326. "/session/{sessionID}/revert": {
  2327. "post": {
  2328. "operationId": "session.revert",
  2329. "parameters": [
  2330. {
  2331. "in": "query",
  2332. "name": "directory",
  2333. "schema": {
  2334. "type": "string"
  2335. }
  2336. },
  2337. {
  2338. "in": "path",
  2339. "name": "sessionID",
  2340. "schema": {
  2341. "type": "string"
  2342. },
  2343. "required": true
  2344. }
  2345. ],
  2346. "summary": "Revert message",
  2347. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  2348. "responses": {
  2349. "200": {
  2350. "description": "Updated session",
  2351. "content": {
  2352. "application/json": {
  2353. "schema": {
  2354. "$ref": "#/components/schemas/Session"
  2355. }
  2356. }
  2357. }
  2358. },
  2359. "400": {
  2360. "description": "Bad request",
  2361. "content": {
  2362. "application/json": {
  2363. "schema": {
  2364. "$ref": "#/components/schemas/BadRequestError"
  2365. }
  2366. }
  2367. }
  2368. },
  2369. "404": {
  2370. "description": "Not found",
  2371. "content": {
  2372. "application/json": {
  2373. "schema": {
  2374. "$ref": "#/components/schemas/NotFoundError"
  2375. }
  2376. }
  2377. }
  2378. }
  2379. },
  2380. "requestBody": {
  2381. "content": {
  2382. "application/json": {
  2383. "schema": {
  2384. "type": "object",
  2385. "properties": {
  2386. "messageID": {
  2387. "type": "string",
  2388. "pattern": "^msg.*"
  2389. },
  2390. "partID": {
  2391. "type": "string",
  2392. "pattern": "^prt.*"
  2393. }
  2394. },
  2395. "required": ["messageID"]
  2396. }
  2397. }
  2398. }
  2399. },
  2400. "x-codeSamples": [
  2401. {
  2402. "lang": "js",
  2403. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  2404. }
  2405. ]
  2406. }
  2407. },
  2408. "/session/{sessionID}/unrevert": {
  2409. "post": {
  2410. "operationId": "session.unrevert",
  2411. "parameters": [
  2412. {
  2413. "in": "query",
  2414. "name": "directory",
  2415. "schema": {
  2416. "type": "string"
  2417. }
  2418. },
  2419. {
  2420. "in": "path",
  2421. "name": "sessionID",
  2422. "schema": {
  2423. "type": "string"
  2424. },
  2425. "required": true
  2426. }
  2427. ],
  2428. "summary": "Restore reverted messages",
  2429. "description": "Restore all previously reverted messages in a session.",
  2430. "responses": {
  2431. "200": {
  2432. "description": "Updated session",
  2433. "content": {
  2434. "application/json": {
  2435. "schema": {
  2436. "$ref": "#/components/schemas/Session"
  2437. }
  2438. }
  2439. }
  2440. },
  2441. "400": {
  2442. "description": "Bad request",
  2443. "content": {
  2444. "application/json": {
  2445. "schema": {
  2446. "$ref": "#/components/schemas/BadRequestError"
  2447. }
  2448. }
  2449. }
  2450. },
  2451. "404": {
  2452. "description": "Not found",
  2453. "content": {
  2454. "application/json": {
  2455. "schema": {
  2456. "$ref": "#/components/schemas/NotFoundError"
  2457. }
  2458. }
  2459. }
  2460. }
  2461. },
  2462. "x-codeSamples": [
  2463. {
  2464. "lang": "js",
  2465. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  2466. }
  2467. ]
  2468. }
  2469. },
  2470. "/session/{sessionID}/permissions/{permissionID}": {
  2471. "post": {
  2472. "operationId": "permission.respond",
  2473. "parameters": [
  2474. {
  2475. "in": "query",
  2476. "name": "directory",
  2477. "schema": {
  2478. "type": "string"
  2479. }
  2480. },
  2481. {
  2482. "in": "path",
  2483. "name": "sessionID",
  2484. "schema": {
  2485. "type": "string"
  2486. },
  2487. "required": true
  2488. },
  2489. {
  2490. "in": "path",
  2491. "name": "permissionID",
  2492. "schema": {
  2493. "type": "string"
  2494. },
  2495. "required": true
  2496. }
  2497. ],
  2498. "summary": "Respond to permission",
  2499. "description": "Approve or deny a permission request from the AI assistant.",
  2500. "responses": {
  2501. "200": {
  2502. "description": "Permission processed successfully",
  2503. "content": {
  2504. "application/json": {
  2505. "schema": {
  2506. "type": "boolean"
  2507. }
  2508. }
  2509. }
  2510. },
  2511. "400": {
  2512. "description": "Bad request",
  2513. "content": {
  2514. "application/json": {
  2515. "schema": {
  2516. "$ref": "#/components/schemas/BadRequestError"
  2517. }
  2518. }
  2519. }
  2520. },
  2521. "404": {
  2522. "description": "Not found",
  2523. "content": {
  2524. "application/json": {
  2525. "schema": {
  2526. "$ref": "#/components/schemas/NotFoundError"
  2527. }
  2528. }
  2529. }
  2530. }
  2531. },
  2532. "requestBody": {
  2533. "content": {
  2534. "application/json": {
  2535. "schema": {
  2536. "type": "object",
  2537. "properties": {
  2538. "response": {
  2539. "type": "string",
  2540. "enum": ["once", "always", "reject"]
  2541. }
  2542. },
  2543. "required": ["response"]
  2544. }
  2545. }
  2546. }
  2547. },
  2548. "x-codeSamples": [
  2549. {
  2550. "lang": "js",
  2551. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  2552. }
  2553. ]
  2554. }
  2555. },
  2556. "/command": {
  2557. "get": {
  2558. "operationId": "command.list",
  2559. "parameters": [
  2560. {
  2561. "in": "query",
  2562. "name": "directory",
  2563. "schema": {
  2564. "type": "string"
  2565. }
  2566. }
  2567. ],
  2568. "summary": "List commands",
  2569. "description": "Get a list of all available commands in the OpenCode system.",
  2570. "responses": {
  2571. "200": {
  2572. "description": "List of commands",
  2573. "content": {
  2574. "application/json": {
  2575. "schema": {
  2576. "type": "array",
  2577. "items": {
  2578. "$ref": "#/components/schemas/Command"
  2579. }
  2580. }
  2581. }
  2582. }
  2583. }
  2584. },
  2585. "x-codeSamples": [
  2586. {
  2587. "lang": "js",
  2588. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  2589. }
  2590. ]
  2591. }
  2592. },
  2593. "/config/providers": {
  2594. "get": {
  2595. "operationId": "config.providers",
  2596. "parameters": [
  2597. {
  2598. "in": "query",
  2599. "name": "directory",
  2600. "schema": {
  2601. "type": "string"
  2602. }
  2603. }
  2604. ],
  2605. "summary": "List config providers",
  2606. "description": "Get a list of all configured AI providers and their default models.",
  2607. "responses": {
  2608. "200": {
  2609. "description": "List of providers",
  2610. "content": {
  2611. "application/json": {
  2612. "schema": {
  2613. "type": "object",
  2614. "properties": {
  2615. "providers": {
  2616. "type": "array",
  2617. "items": {
  2618. "$ref": "#/components/schemas/Provider"
  2619. }
  2620. },
  2621. "default": {
  2622. "type": "object",
  2623. "propertyNames": {
  2624. "type": "string"
  2625. },
  2626. "additionalProperties": {
  2627. "type": "string"
  2628. }
  2629. }
  2630. },
  2631. "required": ["providers", "default"]
  2632. }
  2633. }
  2634. }
  2635. }
  2636. },
  2637. "x-codeSamples": [
  2638. {
  2639. "lang": "js",
  2640. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  2641. }
  2642. ]
  2643. }
  2644. },
  2645. "/provider": {
  2646. "get": {
  2647. "operationId": "provider.list",
  2648. "parameters": [
  2649. {
  2650. "in": "query",
  2651. "name": "directory",
  2652. "schema": {
  2653. "type": "string"
  2654. }
  2655. }
  2656. ],
  2657. "summary": "List providers",
  2658. "description": "Get a list of all available AI providers, including both available and connected ones.",
  2659. "responses": {
  2660. "200": {
  2661. "description": "List of providers",
  2662. "content": {
  2663. "application/json": {
  2664. "schema": {
  2665. "type": "object",
  2666. "properties": {
  2667. "all": {
  2668. "type": "array",
  2669. "items": {
  2670. "type": "object",
  2671. "properties": {
  2672. "api": {
  2673. "type": "string"
  2674. },
  2675. "name": {
  2676. "type": "string"
  2677. },
  2678. "env": {
  2679. "type": "array",
  2680. "items": {
  2681. "type": "string"
  2682. }
  2683. },
  2684. "id": {
  2685. "type": "string"
  2686. },
  2687. "npm": {
  2688. "type": "string"
  2689. },
  2690. "models": {
  2691. "type": "object",
  2692. "propertyNames": {
  2693. "type": "string"
  2694. },
  2695. "additionalProperties": {
  2696. "type": "object",
  2697. "properties": {
  2698. "id": {
  2699. "type": "string"
  2700. },
  2701. "name": {
  2702. "type": "string"
  2703. },
  2704. "release_date": {
  2705. "type": "string"
  2706. },
  2707. "attachment": {
  2708. "type": "boolean"
  2709. },
  2710. "reasoning": {
  2711. "type": "boolean"
  2712. },
  2713. "temperature": {
  2714. "type": "boolean"
  2715. },
  2716. "tool_call": {
  2717. "type": "boolean"
  2718. },
  2719. "cost": {
  2720. "type": "object",
  2721. "properties": {
  2722. "input": {
  2723. "type": "number"
  2724. },
  2725. "output": {
  2726. "type": "number"
  2727. },
  2728. "cache_read": {
  2729. "type": "number"
  2730. },
  2731. "cache_write": {
  2732. "type": "number"
  2733. },
  2734. "context_over_200k": {
  2735. "type": "object",
  2736. "properties": {
  2737. "input": {
  2738. "type": "number"
  2739. },
  2740. "output": {
  2741. "type": "number"
  2742. },
  2743. "cache_read": {
  2744. "type": "number"
  2745. },
  2746. "cache_write": {
  2747. "type": "number"
  2748. }
  2749. },
  2750. "required": ["input", "output"]
  2751. }
  2752. },
  2753. "required": ["input", "output"]
  2754. },
  2755. "limit": {
  2756. "type": "object",
  2757. "properties": {
  2758. "context": {
  2759. "type": "number"
  2760. },
  2761. "output": {
  2762. "type": "number"
  2763. }
  2764. },
  2765. "required": ["context", "output"]
  2766. },
  2767. "modalities": {
  2768. "type": "object",
  2769. "properties": {
  2770. "input": {
  2771. "type": "array",
  2772. "items": {
  2773. "type": "string",
  2774. "enum": ["text", "audio", "image", "video", "pdf"]
  2775. }
  2776. },
  2777. "output": {
  2778. "type": "array",
  2779. "items": {
  2780. "type": "string",
  2781. "enum": ["text", "audio", "image", "video", "pdf"]
  2782. }
  2783. }
  2784. },
  2785. "required": ["input", "output"]
  2786. },
  2787. "experimental": {
  2788. "type": "boolean"
  2789. },
  2790. "status": {
  2791. "type": "string",
  2792. "enum": ["alpha", "beta", "deprecated"]
  2793. },
  2794. "options": {
  2795. "type": "object",
  2796. "propertyNames": {
  2797. "type": "string"
  2798. },
  2799. "additionalProperties": {}
  2800. },
  2801. "headers": {
  2802. "type": "object",
  2803. "propertyNames": {
  2804. "type": "string"
  2805. },
  2806. "additionalProperties": {
  2807. "type": "string"
  2808. }
  2809. },
  2810. "provider": {
  2811. "type": "object",
  2812. "properties": {
  2813. "npm": {
  2814. "type": "string"
  2815. }
  2816. },
  2817. "required": ["npm"]
  2818. }
  2819. },
  2820. "required": [
  2821. "id",
  2822. "name",
  2823. "release_date",
  2824. "attachment",
  2825. "reasoning",
  2826. "temperature",
  2827. "tool_call",
  2828. "limit",
  2829. "options"
  2830. ]
  2831. }
  2832. }
  2833. },
  2834. "required": ["name", "env", "id", "models"]
  2835. }
  2836. },
  2837. "default": {
  2838. "type": "object",
  2839. "propertyNames": {
  2840. "type": "string"
  2841. },
  2842. "additionalProperties": {
  2843. "type": "string"
  2844. }
  2845. },
  2846. "connected": {
  2847. "type": "array",
  2848. "items": {
  2849. "type": "string"
  2850. }
  2851. }
  2852. },
  2853. "required": ["all", "default", "connected"]
  2854. }
  2855. }
  2856. }
  2857. }
  2858. },
  2859. "x-codeSamples": [
  2860. {
  2861. "lang": "js",
  2862. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  2863. }
  2864. ]
  2865. }
  2866. },
  2867. "/provider/auth": {
  2868. "get": {
  2869. "operationId": "provider.auth",
  2870. "parameters": [
  2871. {
  2872. "in": "query",
  2873. "name": "directory",
  2874. "schema": {
  2875. "type": "string"
  2876. }
  2877. }
  2878. ],
  2879. "summary": "Get provider auth methods",
  2880. "description": "Retrieve available authentication methods for all AI providers.",
  2881. "responses": {
  2882. "200": {
  2883. "description": "Provider auth methods",
  2884. "content": {
  2885. "application/json": {
  2886. "schema": {
  2887. "type": "object",
  2888. "propertyNames": {
  2889. "type": "string"
  2890. },
  2891. "additionalProperties": {
  2892. "type": "array",
  2893. "items": {
  2894. "$ref": "#/components/schemas/ProviderAuthMethod"
  2895. }
  2896. }
  2897. }
  2898. }
  2899. }
  2900. }
  2901. },
  2902. "x-codeSamples": [
  2903. {
  2904. "lang": "js",
  2905. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  2906. }
  2907. ]
  2908. }
  2909. },
  2910. "/provider/{providerID}/oauth/authorize": {
  2911. "post": {
  2912. "operationId": "provider.oauth.authorize",
  2913. "parameters": [
  2914. {
  2915. "in": "query",
  2916. "name": "directory",
  2917. "schema": {
  2918. "type": "string"
  2919. }
  2920. },
  2921. {
  2922. "in": "path",
  2923. "name": "providerID",
  2924. "schema": {
  2925. "type": "string"
  2926. },
  2927. "required": true,
  2928. "description": "Provider ID"
  2929. }
  2930. ],
  2931. "summary": "OAuth authorize",
  2932. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  2933. "responses": {
  2934. "200": {
  2935. "description": "Authorization URL and method",
  2936. "content": {
  2937. "application/json": {
  2938. "schema": {
  2939. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  2940. }
  2941. }
  2942. }
  2943. },
  2944. "400": {
  2945. "description": "Bad request",
  2946. "content": {
  2947. "application/json": {
  2948. "schema": {
  2949. "$ref": "#/components/schemas/BadRequestError"
  2950. }
  2951. }
  2952. }
  2953. }
  2954. },
  2955. "requestBody": {
  2956. "content": {
  2957. "application/json": {
  2958. "schema": {
  2959. "type": "object",
  2960. "properties": {
  2961. "method": {
  2962. "description": "Auth method index",
  2963. "type": "number"
  2964. }
  2965. },
  2966. "required": ["method"]
  2967. }
  2968. }
  2969. }
  2970. },
  2971. "x-codeSamples": [
  2972. {
  2973. "lang": "js",
  2974. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  2975. }
  2976. ]
  2977. }
  2978. },
  2979. "/provider/{providerID}/oauth/callback": {
  2980. "post": {
  2981. "operationId": "provider.oauth.callback",
  2982. "parameters": [
  2983. {
  2984. "in": "query",
  2985. "name": "directory",
  2986. "schema": {
  2987. "type": "string"
  2988. }
  2989. },
  2990. {
  2991. "in": "path",
  2992. "name": "providerID",
  2993. "schema": {
  2994. "type": "string"
  2995. },
  2996. "required": true,
  2997. "description": "Provider ID"
  2998. }
  2999. ],
  3000. "summary": "OAuth callback",
  3001. "description": "Handle the OAuth callback from a provider after user authorization.",
  3002. "responses": {
  3003. "200": {
  3004. "description": "OAuth callback processed successfully",
  3005. "content": {
  3006. "application/json": {
  3007. "schema": {
  3008. "type": "boolean"
  3009. }
  3010. }
  3011. }
  3012. },
  3013. "400": {
  3014. "description": "Bad request",
  3015. "content": {
  3016. "application/json": {
  3017. "schema": {
  3018. "$ref": "#/components/schemas/BadRequestError"
  3019. }
  3020. }
  3021. }
  3022. }
  3023. },
  3024. "requestBody": {
  3025. "content": {
  3026. "application/json": {
  3027. "schema": {
  3028. "type": "object",
  3029. "properties": {
  3030. "method": {
  3031. "description": "Auth method index",
  3032. "type": "number"
  3033. },
  3034. "code": {
  3035. "description": "OAuth authorization code",
  3036. "type": "string"
  3037. }
  3038. },
  3039. "required": ["method"]
  3040. }
  3041. }
  3042. }
  3043. },
  3044. "x-codeSamples": [
  3045. {
  3046. "lang": "js",
  3047. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  3048. }
  3049. ]
  3050. }
  3051. },
  3052. "/find": {
  3053. "get": {
  3054. "operationId": "find.text",
  3055. "parameters": [
  3056. {
  3057. "in": "query",
  3058. "name": "directory",
  3059. "schema": {
  3060. "type": "string"
  3061. }
  3062. },
  3063. {
  3064. "in": "query",
  3065. "name": "pattern",
  3066. "schema": {
  3067. "type": "string"
  3068. },
  3069. "required": true
  3070. }
  3071. ],
  3072. "summary": "Find text",
  3073. "description": "Search for text patterns across files in the project using ripgrep.",
  3074. "responses": {
  3075. "200": {
  3076. "description": "Matches",
  3077. "content": {
  3078. "application/json": {
  3079. "schema": {
  3080. "type": "array",
  3081. "items": {
  3082. "type": "object",
  3083. "properties": {
  3084. "path": {
  3085. "type": "object",
  3086. "properties": {
  3087. "text": {
  3088. "type": "string"
  3089. }
  3090. },
  3091. "required": ["text"]
  3092. },
  3093. "lines": {
  3094. "type": "object",
  3095. "properties": {
  3096. "text": {
  3097. "type": "string"
  3098. }
  3099. },
  3100. "required": ["text"]
  3101. },
  3102. "line_number": {
  3103. "type": "number"
  3104. },
  3105. "absolute_offset": {
  3106. "type": "number"
  3107. },
  3108. "submatches": {
  3109. "type": "array",
  3110. "items": {
  3111. "type": "object",
  3112. "properties": {
  3113. "match": {
  3114. "type": "object",
  3115. "properties": {
  3116. "text": {
  3117. "type": "string"
  3118. }
  3119. },
  3120. "required": ["text"]
  3121. },
  3122. "start": {
  3123. "type": "number"
  3124. },
  3125. "end": {
  3126. "type": "number"
  3127. }
  3128. },
  3129. "required": ["match", "start", "end"]
  3130. }
  3131. }
  3132. },
  3133. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  3134. }
  3135. }
  3136. }
  3137. }
  3138. }
  3139. },
  3140. "x-codeSamples": [
  3141. {
  3142. "lang": "js",
  3143. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  3144. }
  3145. ]
  3146. }
  3147. },
  3148. "/find/file": {
  3149. "get": {
  3150. "operationId": "find.files",
  3151. "parameters": [
  3152. {
  3153. "in": "query",
  3154. "name": "directory",
  3155. "schema": {
  3156. "type": "string"
  3157. }
  3158. },
  3159. {
  3160. "in": "query",
  3161. "name": "query",
  3162. "schema": {
  3163. "type": "string"
  3164. },
  3165. "required": true
  3166. },
  3167. {
  3168. "in": "query",
  3169. "name": "dirs",
  3170. "schema": {
  3171. "type": "string",
  3172. "enum": ["true", "false"]
  3173. }
  3174. }
  3175. ],
  3176. "summary": "Find files",
  3177. "description": "Search for files by name or pattern in the project directory.",
  3178. "responses": {
  3179. "200": {
  3180. "description": "File paths",
  3181. "content": {
  3182. "application/json": {
  3183. "schema": {
  3184. "type": "array",
  3185. "items": {
  3186. "type": "string"
  3187. }
  3188. }
  3189. }
  3190. }
  3191. }
  3192. },
  3193. "x-codeSamples": [
  3194. {
  3195. "lang": "js",
  3196. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  3197. }
  3198. ]
  3199. }
  3200. },
  3201. "/find/symbol": {
  3202. "get": {
  3203. "operationId": "find.symbols",
  3204. "parameters": [
  3205. {
  3206. "in": "query",
  3207. "name": "directory",
  3208. "schema": {
  3209. "type": "string"
  3210. }
  3211. },
  3212. {
  3213. "in": "query",
  3214. "name": "query",
  3215. "schema": {
  3216. "type": "string"
  3217. },
  3218. "required": true
  3219. }
  3220. ],
  3221. "summary": "Find symbols",
  3222. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  3223. "responses": {
  3224. "200": {
  3225. "description": "Symbols",
  3226. "content": {
  3227. "application/json": {
  3228. "schema": {
  3229. "type": "array",
  3230. "items": {
  3231. "$ref": "#/components/schemas/Symbol"
  3232. }
  3233. }
  3234. }
  3235. }
  3236. }
  3237. },
  3238. "x-codeSamples": [
  3239. {
  3240. "lang": "js",
  3241. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  3242. }
  3243. ]
  3244. }
  3245. },
  3246. "/file": {
  3247. "get": {
  3248. "operationId": "file.list",
  3249. "parameters": [
  3250. {
  3251. "in": "query",
  3252. "name": "directory",
  3253. "schema": {
  3254. "type": "string"
  3255. }
  3256. },
  3257. {
  3258. "in": "query",
  3259. "name": "path",
  3260. "schema": {
  3261. "type": "string"
  3262. },
  3263. "required": true
  3264. }
  3265. ],
  3266. "summary": "List files",
  3267. "description": "List files and directories in a specified path.",
  3268. "responses": {
  3269. "200": {
  3270. "description": "Files and directories",
  3271. "content": {
  3272. "application/json": {
  3273. "schema": {
  3274. "type": "array",
  3275. "items": {
  3276. "$ref": "#/components/schemas/FileNode"
  3277. }
  3278. }
  3279. }
  3280. }
  3281. }
  3282. },
  3283. "x-codeSamples": [
  3284. {
  3285. "lang": "js",
  3286. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  3287. }
  3288. ]
  3289. }
  3290. },
  3291. "/file/content": {
  3292. "get": {
  3293. "operationId": "file.read",
  3294. "parameters": [
  3295. {
  3296. "in": "query",
  3297. "name": "directory",
  3298. "schema": {
  3299. "type": "string"
  3300. }
  3301. },
  3302. {
  3303. "in": "query",
  3304. "name": "path",
  3305. "schema": {
  3306. "type": "string"
  3307. },
  3308. "required": true
  3309. }
  3310. ],
  3311. "summary": "Read file",
  3312. "description": "Read the content of a specified file.",
  3313. "responses": {
  3314. "200": {
  3315. "description": "File content",
  3316. "content": {
  3317. "application/json": {
  3318. "schema": {
  3319. "$ref": "#/components/schemas/FileContent"
  3320. }
  3321. }
  3322. }
  3323. }
  3324. },
  3325. "x-codeSamples": [
  3326. {
  3327. "lang": "js",
  3328. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  3329. }
  3330. ]
  3331. }
  3332. },
  3333. "/file/status": {
  3334. "get": {
  3335. "operationId": "file.status",
  3336. "parameters": [
  3337. {
  3338. "in": "query",
  3339. "name": "directory",
  3340. "schema": {
  3341. "type": "string"
  3342. }
  3343. }
  3344. ],
  3345. "summary": "Get file status",
  3346. "description": "Get the git status of all files in the project.",
  3347. "responses": {
  3348. "200": {
  3349. "description": "File status",
  3350. "content": {
  3351. "application/json": {
  3352. "schema": {
  3353. "type": "array",
  3354. "items": {
  3355. "$ref": "#/components/schemas/File"
  3356. }
  3357. }
  3358. }
  3359. }
  3360. }
  3361. },
  3362. "x-codeSamples": [
  3363. {
  3364. "lang": "js",
  3365. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  3366. }
  3367. ]
  3368. }
  3369. },
  3370. "/log": {
  3371. "post": {
  3372. "operationId": "app.log",
  3373. "parameters": [
  3374. {
  3375. "in": "query",
  3376. "name": "directory",
  3377. "schema": {
  3378. "type": "string"
  3379. }
  3380. }
  3381. ],
  3382. "summary": "Write log",
  3383. "description": "Write a log entry to the server logs with specified level and metadata.",
  3384. "responses": {
  3385. "200": {
  3386. "description": "Log entry written successfully",
  3387. "content": {
  3388. "application/json": {
  3389. "schema": {
  3390. "type": "boolean"
  3391. }
  3392. }
  3393. }
  3394. },
  3395. "400": {
  3396. "description": "Bad request",
  3397. "content": {
  3398. "application/json": {
  3399. "schema": {
  3400. "$ref": "#/components/schemas/BadRequestError"
  3401. }
  3402. }
  3403. }
  3404. }
  3405. },
  3406. "requestBody": {
  3407. "content": {
  3408. "application/json": {
  3409. "schema": {
  3410. "type": "object",
  3411. "properties": {
  3412. "service": {
  3413. "description": "Service name for the log entry",
  3414. "type": "string"
  3415. },
  3416. "level": {
  3417. "description": "Log level",
  3418. "type": "string",
  3419. "enum": ["debug", "info", "error", "warn"]
  3420. },
  3421. "message": {
  3422. "description": "Log message",
  3423. "type": "string"
  3424. },
  3425. "extra": {
  3426. "description": "Additional metadata for the log entry",
  3427. "type": "object",
  3428. "propertyNames": {
  3429. "type": "string"
  3430. },
  3431. "additionalProperties": {}
  3432. }
  3433. },
  3434. "required": ["service", "level", "message"]
  3435. }
  3436. }
  3437. }
  3438. },
  3439. "x-codeSamples": [
  3440. {
  3441. "lang": "js",
  3442. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  3443. }
  3444. ]
  3445. }
  3446. },
  3447. "/agent": {
  3448. "get": {
  3449. "operationId": "app.agents",
  3450. "parameters": [
  3451. {
  3452. "in": "query",
  3453. "name": "directory",
  3454. "schema": {
  3455. "type": "string"
  3456. }
  3457. }
  3458. ],
  3459. "summary": "List agents",
  3460. "description": "Get a list of all available AI agents in the OpenCode system.",
  3461. "responses": {
  3462. "200": {
  3463. "description": "List of agents",
  3464. "content": {
  3465. "application/json": {
  3466. "schema": {
  3467. "type": "array",
  3468. "items": {
  3469. "$ref": "#/components/schemas/Agent"
  3470. }
  3471. }
  3472. }
  3473. }
  3474. }
  3475. },
  3476. "x-codeSamples": [
  3477. {
  3478. "lang": "js",
  3479. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  3480. }
  3481. ]
  3482. }
  3483. },
  3484. "/mcp": {
  3485. "get": {
  3486. "operationId": "mcp.status",
  3487. "parameters": [
  3488. {
  3489. "in": "query",
  3490. "name": "directory",
  3491. "schema": {
  3492. "type": "string"
  3493. }
  3494. }
  3495. ],
  3496. "summary": "Get MCP status",
  3497. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  3498. "responses": {
  3499. "200": {
  3500. "description": "MCP server status",
  3501. "content": {
  3502. "application/json": {
  3503. "schema": {
  3504. "type": "object",
  3505. "propertyNames": {
  3506. "type": "string"
  3507. },
  3508. "additionalProperties": {
  3509. "$ref": "#/components/schemas/MCPStatus"
  3510. }
  3511. }
  3512. }
  3513. }
  3514. }
  3515. },
  3516. "x-codeSamples": [
  3517. {
  3518. "lang": "js",
  3519. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  3520. }
  3521. ]
  3522. },
  3523. "post": {
  3524. "operationId": "mcp.add",
  3525. "parameters": [
  3526. {
  3527. "in": "query",
  3528. "name": "directory",
  3529. "schema": {
  3530. "type": "string"
  3531. }
  3532. }
  3533. ],
  3534. "summary": "Add MCP server",
  3535. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  3536. "responses": {
  3537. "200": {
  3538. "description": "MCP server added successfully",
  3539. "content": {
  3540. "application/json": {
  3541. "schema": {
  3542. "type": "object",
  3543. "propertyNames": {
  3544. "type": "string"
  3545. },
  3546. "additionalProperties": {
  3547. "$ref": "#/components/schemas/MCPStatus"
  3548. }
  3549. }
  3550. }
  3551. }
  3552. },
  3553. "400": {
  3554. "description": "Bad request",
  3555. "content": {
  3556. "application/json": {
  3557. "schema": {
  3558. "$ref": "#/components/schemas/BadRequestError"
  3559. }
  3560. }
  3561. }
  3562. }
  3563. },
  3564. "requestBody": {
  3565. "content": {
  3566. "application/json": {
  3567. "schema": {
  3568. "type": "object",
  3569. "properties": {
  3570. "name": {
  3571. "type": "string"
  3572. },
  3573. "config": {
  3574. "anyOf": [
  3575. {
  3576. "$ref": "#/components/schemas/McpLocalConfig"
  3577. },
  3578. {
  3579. "$ref": "#/components/schemas/McpRemoteConfig"
  3580. }
  3581. ]
  3582. }
  3583. },
  3584. "required": ["name", "config"]
  3585. }
  3586. }
  3587. }
  3588. },
  3589. "x-codeSamples": [
  3590. {
  3591. "lang": "js",
  3592. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  3593. }
  3594. ]
  3595. }
  3596. },
  3597. "/mcp/{name}/auth": {
  3598. "post": {
  3599. "operationId": "mcp.auth.start",
  3600. "parameters": [
  3601. {
  3602. "in": "query",
  3603. "name": "directory",
  3604. "schema": {
  3605. "type": "string"
  3606. }
  3607. },
  3608. {
  3609. "schema": {
  3610. "type": "string"
  3611. },
  3612. "in": "path",
  3613. "name": "name",
  3614. "required": true
  3615. }
  3616. ],
  3617. "summary": "Start MCP OAuth",
  3618. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  3619. "responses": {
  3620. "200": {
  3621. "description": "OAuth flow started",
  3622. "content": {
  3623. "application/json": {
  3624. "schema": {
  3625. "type": "object",
  3626. "properties": {
  3627. "authorizationUrl": {
  3628. "description": "URL to open in browser for authorization",
  3629. "type": "string"
  3630. }
  3631. },
  3632. "required": ["authorizationUrl"]
  3633. }
  3634. }
  3635. }
  3636. },
  3637. "400": {
  3638. "description": "Bad request",
  3639. "content": {
  3640. "application/json": {
  3641. "schema": {
  3642. "$ref": "#/components/schemas/BadRequestError"
  3643. }
  3644. }
  3645. }
  3646. },
  3647. "404": {
  3648. "description": "Not found",
  3649. "content": {
  3650. "application/json": {
  3651. "schema": {
  3652. "$ref": "#/components/schemas/NotFoundError"
  3653. }
  3654. }
  3655. }
  3656. }
  3657. },
  3658. "x-codeSamples": [
  3659. {
  3660. "lang": "js",
  3661. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  3662. }
  3663. ]
  3664. },
  3665. "delete": {
  3666. "operationId": "mcp.auth.remove",
  3667. "parameters": [
  3668. {
  3669. "in": "query",
  3670. "name": "directory",
  3671. "schema": {
  3672. "type": "string"
  3673. }
  3674. },
  3675. {
  3676. "schema": {
  3677. "type": "string"
  3678. },
  3679. "in": "path",
  3680. "name": "name",
  3681. "required": true
  3682. }
  3683. ],
  3684. "summary": "Remove MCP OAuth",
  3685. "description": "Remove OAuth credentials for an MCP server",
  3686. "responses": {
  3687. "200": {
  3688. "description": "OAuth credentials removed",
  3689. "content": {
  3690. "application/json": {
  3691. "schema": {
  3692. "type": "object",
  3693. "properties": {
  3694. "success": {
  3695. "type": "boolean",
  3696. "const": true
  3697. }
  3698. },
  3699. "required": ["success"]
  3700. }
  3701. }
  3702. }
  3703. },
  3704. "404": {
  3705. "description": "Not found",
  3706. "content": {
  3707. "application/json": {
  3708. "schema": {
  3709. "$ref": "#/components/schemas/NotFoundError"
  3710. }
  3711. }
  3712. }
  3713. }
  3714. },
  3715. "x-codeSamples": [
  3716. {
  3717. "lang": "js",
  3718. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  3719. }
  3720. ]
  3721. }
  3722. },
  3723. "/mcp/{name}/auth/callback": {
  3724. "post": {
  3725. "operationId": "mcp.auth.callback",
  3726. "parameters": [
  3727. {
  3728. "in": "query",
  3729. "name": "directory",
  3730. "schema": {
  3731. "type": "string"
  3732. }
  3733. },
  3734. {
  3735. "schema": {
  3736. "type": "string"
  3737. },
  3738. "in": "path",
  3739. "name": "name",
  3740. "required": true
  3741. }
  3742. ],
  3743. "summary": "Complete MCP OAuth",
  3744. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  3745. "responses": {
  3746. "200": {
  3747. "description": "OAuth authentication completed",
  3748. "content": {
  3749. "application/json": {
  3750. "schema": {
  3751. "$ref": "#/components/schemas/MCPStatus"
  3752. }
  3753. }
  3754. }
  3755. },
  3756. "400": {
  3757. "description": "Bad request",
  3758. "content": {
  3759. "application/json": {
  3760. "schema": {
  3761. "$ref": "#/components/schemas/BadRequestError"
  3762. }
  3763. }
  3764. }
  3765. },
  3766. "404": {
  3767. "description": "Not found",
  3768. "content": {
  3769. "application/json": {
  3770. "schema": {
  3771. "$ref": "#/components/schemas/NotFoundError"
  3772. }
  3773. }
  3774. }
  3775. }
  3776. },
  3777. "requestBody": {
  3778. "content": {
  3779. "application/json": {
  3780. "schema": {
  3781. "type": "object",
  3782. "properties": {
  3783. "code": {
  3784. "description": "Authorization code from OAuth callback",
  3785. "type": "string"
  3786. }
  3787. },
  3788. "required": ["code"]
  3789. }
  3790. }
  3791. }
  3792. },
  3793. "x-codeSamples": [
  3794. {
  3795. "lang": "js",
  3796. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  3797. }
  3798. ]
  3799. }
  3800. },
  3801. "/mcp/{name}/auth/authenticate": {
  3802. "post": {
  3803. "operationId": "mcp.auth.authenticate",
  3804. "parameters": [
  3805. {
  3806. "in": "query",
  3807. "name": "directory",
  3808. "schema": {
  3809. "type": "string"
  3810. }
  3811. },
  3812. {
  3813. "schema": {
  3814. "type": "string"
  3815. },
  3816. "in": "path",
  3817. "name": "name",
  3818. "required": true
  3819. }
  3820. ],
  3821. "summary": "Authenticate MCP OAuth",
  3822. "description": "Start OAuth flow and wait for callback (opens browser)",
  3823. "responses": {
  3824. "200": {
  3825. "description": "OAuth authentication completed",
  3826. "content": {
  3827. "application/json": {
  3828. "schema": {
  3829. "$ref": "#/components/schemas/MCPStatus"
  3830. }
  3831. }
  3832. }
  3833. },
  3834. "400": {
  3835. "description": "Bad request",
  3836. "content": {
  3837. "application/json": {
  3838. "schema": {
  3839. "$ref": "#/components/schemas/BadRequestError"
  3840. }
  3841. }
  3842. }
  3843. },
  3844. "404": {
  3845. "description": "Not found",
  3846. "content": {
  3847. "application/json": {
  3848. "schema": {
  3849. "$ref": "#/components/schemas/NotFoundError"
  3850. }
  3851. }
  3852. }
  3853. }
  3854. },
  3855. "x-codeSamples": [
  3856. {
  3857. "lang": "js",
  3858. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  3859. }
  3860. ]
  3861. }
  3862. },
  3863. "/mcp/{name}/connect": {
  3864. "post": {
  3865. "operationId": "mcp.connect",
  3866. "parameters": [
  3867. {
  3868. "in": "query",
  3869. "name": "directory",
  3870. "schema": {
  3871. "type": "string"
  3872. }
  3873. },
  3874. {
  3875. "in": "path",
  3876. "name": "name",
  3877. "schema": {
  3878. "type": "string"
  3879. },
  3880. "required": true
  3881. }
  3882. ],
  3883. "description": "Connect an MCP server",
  3884. "responses": {
  3885. "200": {
  3886. "description": "MCP server connected successfully",
  3887. "content": {
  3888. "application/json": {
  3889. "schema": {
  3890. "type": "boolean"
  3891. }
  3892. }
  3893. }
  3894. }
  3895. },
  3896. "x-codeSamples": [
  3897. {
  3898. "lang": "js",
  3899. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  3900. }
  3901. ]
  3902. }
  3903. },
  3904. "/mcp/{name}/disconnect": {
  3905. "post": {
  3906. "operationId": "mcp.disconnect",
  3907. "parameters": [
  3908. {
  3909. "in": "query",
  3910. "name": "directory",
  3911. "schema": {
  3912. "type": "string"
  3913. }
  3914. },
  3915. {
  3916. "in": "path",
  3917. "name": "name",
  3918. "schema": {
  3919. "type": "string"
  3920. },
  3921. "required": true
  3922. }
  3923. ],
  3924. "description": "Disconnect an MCP server",
  3925. "responses": {
  3926. "200": {
  3927. "description": "MCP server disconnected successfully",
  3928. "content": {
  3929. "application/json": {
  3930. "schema": {
  3931. "type": "boolean"
  3932. }
  3933. }
  3934. }
  3935. }
  3936. },
  3937. "x-codeSamples": [
  3938. {
  3939. "lang": "js",
  3940. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  3941. }
  3942. ]
  3943. }
  3944. },
  3945. "/lsp": {
  3946. "get": {
  3947. "operationId": "lsp.status",
  3948. "parameters": [
  3949. {
  3950. "in": "query",
  3951. "name": "directory",
  3952. "schema": {
  3953. "type": "string"
  3954. }
  3955. }
  3956. ],
  3957. "summary": "Get LSP status",
  3958. "description": "Get LSP server status",
  3959. "responses": {
  3960. "200": {
  3961. "description": "LSP server status",
  3962. "content": {
  3963. "application/json": {
  3964. "schema": {
  3965. "type": "array",
  3966. "items": {
  3967. "$ref": "#/components/schemas/LSPStatus"
  3968. }
  3969. }
  3970. }
  3971. }
  3972. }
  3973. },
  3974. "x-codeSamples": [
  3975. {
  3976. "lang": "js",
  3977. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  3978. }
  3979. ]
  3980. }
  3981. },
  3982. "/formatter": {
  3983. "get": {
  3984. "operationId": "formatter.status",
  3985. "parameters": [
  3986. {
  3987. "in": "query",
  3988. "name": "directory",
  3989. "schema": {
  3990. "type": "string"
  3991. }
  3992. }
  3993. ],
  3994. "summary": "Get formatter status",
  3995. "description": "Get formatter status",
  3996. "responses": {
  3997. "200": {
  3998. "description": "Formatter status",
  3999. "content": {
  4000. "application/json": {
  4001. "schema": {
  4002. "type": "array",
  4003. "items": {
  4004. "$ref": "#/components/schemas/FormatterStatus"
  4005. }
  4006. }
  4007. }
  4008. }
  4009. }
  4010. },
  4011. "x-codeSamples": [
  4012. {
  4013. "lang": "js",
  4014. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  4015. }
  4016. ]
  4017. }
  4018. },
  4019. "/tui/append-prompt": {
  4020. "post": {
  4021. "operationId": "tui.appendPrompt",
  4022. "parameters": [
  4023. {
  4024. "in": "query",
  4025. "name": "directory",
  4026. "schema": {
  4027. "type": "string"
  4028. }
  4029. }
  4030. ],
  4031. "summary": "Append TUI prompt",
  4032. "description": "Append prompt to the TUI",
  4033. "responses": {
  4034. "200": {
  4035. "description": "Prompt processed successfully",
  4036. "content": {
  4037. "application/json": {
  4038. "schema": {
  4039. "type": "boolean"
  4040. }
  4041. }
  4042. }
  4043. },
  4044. "400": {
  4045. "description": "Bad request",
  4046. "content": {
  4047. "application/json": {
  4048. "schema": {
  4049. "$ref": "#/components/schemas/BadRequestError"
  4050. }
  4051. }
  4052. }
  4053. }
  4054. },
  4055. "requestBody": {
  4056. "content": {
  4057. "application/json": {
  4058. "schema": {
  4059. "type": "object",
  4060. "properties": {
  4061. "text": {
  4062. "type": "string"
  4063. }
  4064. },
  4065. "required": ["text"]
  4066. }
  4067. }
  4068. }
  4069. },
  4070. "x-codeSamples": [
  4071. {
  4072. "lang": "js",
  4073. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  4074. }
  4075. ]
  4076. }
  4077. },
  4078. "/tui/open-help": {
  4079. "post": {
  4080. "operationId": "tui.openHelp",
  4081. "parameters": [
  4082. {
  4083. "in": "query",
  4084. "name": "directory",
  4085. "schema": {
  4086. "type": "string"
  4087. }
  4088. }
  4089. ],
  4090. "summary": "Open help dialog",
  4091. "description": "Open the help dialog in the TUI to display user assistance information.",
  4092. "responses": {
  4093. "200": {
  4094. "description": "Help dialog opened successfully",
  4095. "content": {
  4096. "application/json": {
  4097. "schema": {
  4098. "type": "boolean"
  4099. }
  4100. }
  4101. }
  4102. }
  4103. },
  4104. "x-codeSamples": [
  4105. {
  4106. "lang": "js",
  4107. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  4108. }
  4109. ]
  4110. }
  4111. },
  4112. "/tui/open-sessions": {
  4113. "post": {
  4114. "operationId": "tui.openSessions",
  4115. "parameters": [
  4116. {
  4117. "in": "query",
  4118. "name": "directory",
  4119. "schema": {
  4120. "type": "string"
  4121. }
  4122. }
  4123. ],
  4124. "summary": "Open sessions dialog",
  4125. "description": "Open the session dialog",
  4126. "responses": {
  4127. "200": {
  4128. "description": "Session dialog opened successfully",
  4129. "content": {
  4130. "application/json": {
  4131. "schema": {
  4132. "type": "boolean"
  4133. }
  4134. }
  4135. }
  4136. }
  4137. },
  4138. "x-codeSamples": [
  4139. {
  4140. "lang": "js",
  4141. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  4142. }
  4143. ]
  4144. }
  4145. },
  4146. "/tui/open-themes": {
  4147. "post": {
  4148. "operationId": "tui.openThemes",
  4149. "parameters": [
  4150. {
  4151. "in": "query",
  4152. "name": "directory",
  4153. "schema": {
  4154. "type": "string"
  4155. }
  4156. }
  4157. ],
  4158. "summary": "Open themes dialog",
  4159. "description": "Open the theme dialog",
  4160. "responses": {
  4161. "200": {
  4162. "description": "Theme dialog opened successfully",
  4163. "content": {
  4164. "application/json": {
  4165. "schema": {
  4166. "type": "boolean"
  4167. }
  4168. }
  4169. }
  4170. }
  4171. },
  4172. "x-codeSamples": [
  4173. {
  4174. "lang": "js",
  4175. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  4176. }
  4177. ]
  4178. }
  4179. },
  4180. "/tui/open-models": {
  4181. "post": {
  4182. "operationId": "tui.openModels",
  4183. "parameters": [
  4184. {
  4185. "in": "query",
  4186. "name": "directory",
  4187. "schema": {
  4188. "type": "string"
  4189. }
  4190. }
  4191. ],
  4192. "summary": "Open models dialog",
  4193. "description": "Open the model dialog",
  4194. "responses": {
  4195. "200": {
  4196. "description": "Model dialog opened successfully",
  4197. "content": {
  4198. "application/json": {
  4199. "schema": {
  4200. "type": "boolean"
  4201. }
  4202. }
  4203. }
  4204. }
  4205. },
  4206. "x-codeSamples": [
  4207. {
  4208. "lang": "js",
  4209. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  4210. }
  4211. ]
  4212. }
  4213. },
  4214. "/tui/submit-prompt": {
  4215. "post": {
  4216. "operationId": "tui.submitPrompt",
  4217. "parameters": [
  4218. {
  4219. "in": "query",
  4220. "name": "directory",
  4221. "schema": {
  4222. "type": "string"
  4223. }
  4224. }
  4225. ],
  4226. "summary": "Submit TUI prompt",
  4227. "description": "Submit the prompt",
  4228. "responses": {
  4229. "200": {
  4230. "description": "Prompt submitted successfully",
  4231. "content": {
  4232. "application/json": {
  4233. "schema": {
  4234. "type": "boolean"
  4235. }
  4236. }
  4237. }
  4238. }
  4239. },
  4240. "x-codeSamples": [
  4241. {
  4242. "lang": "js",
  4243. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  4244. }
  4245. ]
  4246. }
  4247. },
  4248. "/tui/clear-prompt": {
  4249. "post": {
  4250. "operationId": "tui.clearPrompt",
  4251. "parameters": [
  4252. {
  4253. "in": "query",
  4254. "name": "directory",
  4255. "schema": {
  4256. "type": "string"
  4257. }
  4258. }
  4259. ],
  4260. "summary": "Clear TUI prompt",
  4261. "description": "Clear the prompt",
  4262. "responses": {
  4263. "200": {
  4264. "description": "Prompt cleared successfully",
  4265. "content": {
  4266. "application/json": {
  4267. "schema": {
  4268. "type": "boolean"
  4269. }
  4270. }
  4271. }
  4272. }
  4273. },
  4274. "x-codeSamples": [
  4275. {
  4276. "lang": "js",
  4277. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  4278. }
  4279. ]
  4280. }
  4281. },
  4282. "/tui/execute-command": {
  4283. "post": {
  4284. "operationId": "tui.executeCommand",
  4285. "parameters": [
  4286. {
  4287. "in": "query",
  4288. "name": "directory",
  4289. "schema": {
  4290. "type": "string"
  4291. }
  4292. }
  4293. ],
  4294. "summary": "Execute TUI command",
  4295. "description": "Execute a TUI command (e.g. agent_cycle)",
  4296. "responses": {
  4297. "200": {
  4298. "description": "Command executed successfully",
  4299. "content": {
  4300. "application/json": {
  4301. "schema": {
  4302. "type": "boolean"
  4303. }
  4304. }
  4305. }
  4306. },
  4307. "400": {
  4308. "description": "Bad request",
  4309. "content": {
  4310. "application/json": {
  4311. "schema": {
  4312. "$ref": "#/components/schemas/BadRequestError"
  4313. }
  4314. }
  4315. }
  4316. }
  4317. },
  4318. "requestBody": {
  4319. "content": {
  4320. "application/json": {
  4321. "schema": {
  4322. "type": "object",
  4323. "properties": {
  4324. "command": {
  4325. "type": "string"
  4326. }
  4327. },
  4328. "required": ["command"]
  4329. }
  4330. }
  4331. }
  4332. },
  4333. "x-codeSamples": [
  4334. {
  4335. "lang": "js",
  4336. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  4337. }
  4338. ]
  4339. }
  4340. },
  4341. "/tui/show-toast": {
  4342. "post": {
  4343. "operationId": "tui.showToast",
  4344. "parameters": [
  4345. {
  4346. "in": "query",
  4347. "name": "directory",
  4348. "schema": {
  4349. "type": "string"
  4350. }
  4351. }
  4352. ],
  4353. "summary": "Show TUI toast",
  4354. "description": "Show a toast notification in the TUI",
  4355. "responses": {
  4356. "200": {
  4357. "description": "Toast notification shown successfully",
  4358. "content": {
  4359. "application/json": {
  4360. "schema": {
  4361. "type": "boolean"
  4362. }
  4363. }
  4364. }
  4365. }
  4366. },
  4367. "requestBody": {
  4368. "content": {
  4369. "application/json": {
  4370. "schema": {
  4371. "type": "object",
  4372. "properties": {
  4373. "title": {
  4374. "type": "string"
  4375. },
  4376. "message": {
  4377. "type": "string"
  4378. },
  4379. "variant": {
  4380. "type": "string",
  4381. "enum": ["info", "success", "warning", "error"]
  4382. },
  4383. "duration": {
  4384. "description": "Duration in milliseconds",
  4385. "default": 5000,
  4386. "type": "number"
  4387. }
  4388. },
  4389. "required": ["message", "variant"]
  4390. }
  4391. }
  4392. }
  4393. },
  4394. "x-codeSamples": [
  4395. {
  4396. "lang": "js",
  4397. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  4398. }
  4399. ]
  4400. }
  4401. },
  4402. "/tui/publish": {
  4403. "post": {
  4404. "operationId": "tui.publish",
  4405. "parameters": [
  4406. {
  4407. "in": "query",
  4408. "name": "directory",
  4409. "schema": {
  4410. "type": "string"
  4411. }
  4412. }
  4413. ],
  4414. "summary": "Publish TUI event",
  4415. "description": "Publish a TUI event",
  4416. "responses": {
  4417. "200": {
  4418. "description": "Event published successfully",
  4419. "content": {
  4420. "application/json": {
  4421. "schema": {
  4422. "type": "boolean"
  4423. }
  4424. }
  4425. }
  4426. },
  4427. "400": {
  4428. "description": "Bad request",
  4429. "content": {
  4430. "application/json": {
  4431. "schema": {
  4432. "$ref": "#/components/schemas/BadRequestError"
  4433. }
  4434. }
  4435. }
  4436. }
  4437. },
  4438. "requestBody": {
  4439. "content": {
  4440. "application/json": {
  4441. "schema": {
  4442. "anyOf": [
  4443. {
  4444. "$ref": "#/components/schemas/Event.tui.prompt.append"
  4445. },
  4446. {
  4447. "$ref": "#/components/schemas/Event.tui.command.execute"
  4448. },
  4449. {
  4450. "$ref": "#/components/schemas/Event.tui.toast.show"
  4451. }
  4452. ]
  4453. }
  4454. }
  4455. }
  4456. },
  4457. "x-codeSamples": [
  4458. {
  4459. "lang": "js",
  4460. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  4461. }
  4462. ]
  4463. }
  4464. },
  4465. "/tui/control/next": {
  4466. "get": {
  4467. "operationId": "tui.control.next",
  4468. "parameters": [
  4469. {
  4470. "in": "query",
  4471. "name": "directory",
  4472. "schema": {
  4473. "type": "string"
  4474. }
  4475. }
  4476. ],
  4477. "summary": "Get next TUI request",
  4478. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  4479. "responses": {
  4480. "200": {
  4481. "description": "Next TUI request",
  4482. "content": {
  4483. "application/json": {
  4484. "schema": {
  4485. "type": "object",
  4486. "properties": {
  4487. "path": {
  4488. "type": "string"
  4489. },
  4490. "body": {}
  4491. },
  4492. "required": ["path", "body"]
  4493. }
  4494. }
  4495. }
  4496. }
  4497. },
  4498. "x-codeSamples": [
  4499. {
  4500. "lang": "js",
  4501. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  4502. }
  4503. ]
  4504. }
  4505. },
  4506. "/tui/control/response": {
  4507. "post": {
  4508. "operationId": "tui.control.response",
  4509. "parameters": [
  4510. {
  4511. "in": "query",
  4512. "name": "directory",
  4513. "schema": {
  4514. "type": "string"
  4515. }
  4516. }
  4517. ],
  4518. "summary": "Submit TUI response",
  4519. "description": "Submit a response to the TUI request queue to complete a pending request.",
  4520. "responses": {
  4521. "200": {
  4522. "description": "Response submitted successfully",
  4523. "content": {
  4524. "application/json": {
  4525. "schema": {
  4526. "type": "boolean"
  4527. }
  4528. }
  4529. }
  4530. }
  4531. },
  4532. "requestBody": {
  4533. "content": {
  4534. "application/json": {
  4535. "schema": {}
  4536. }
  4537. }
  4538. },
  4539. "x-codeSamples": [
  4540. {
  4541. "lang": "js",
  4542. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  4543. }
  4544. ]
  4545. }
  4546. },
  4547. "/auth/{providerID}": {
  4548. "put": {
  4549. "operationId": "auth.set",
  4550. "parameters": [
  4551. {
  4552. "in": "query",
  4553. "name": "directory",
  4554. "schema": {
  4555. "type": "string"
  4556. }
  4557. },
  4558. {
  4559. "in": "path",
  4560. "name": "providerID",
  4561. "schema": {
  4562. "type": "string"
  4563. },
  4564. "required": true
  4565. }
  4566. ],
  4567. "summary": "Set auth credentials",
  4568. "description": "Set authentication credentials",
  4569. "responses": {
  4570. "200": {
  4571. "description": "Successfully set authentication credentials",
  4572. "content": {
  4573. "application/json": {
  4574. "schema": {
  4575. "type": "boolean"
  4576. }
  4577. }
  4578. }
  4579. },
  4580. "400": {
  4581. "description": "Bad request",
  4582. "content": {
  4583. "application/json": {
  4584. "schema": {
  4585. "$ref": "#/components/schemas/BadRequestError"
  4586. }
  4587. }
  4588. }
  4589. }
  4590. },
  4591. "requestBody": {
  4592. "content": {
  4593. "application/json": {
  4594. "schema": {
  4595. "$ref": "#/components/schemas/Auth"
  4596. }
  4597. }
  4598. }
  4599. },
  4600. "x-codeSamples": [
  4601. {
  4602. "lang": "js",
  4603. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  4604. }
  4605. ]
  4606. }
  4607. },
  4608. "/event": {
  4609. "get": {
  4610. "operationId": "event.subscribe",
  4611. "parameters": [
  4612. {
  4613. "in": "query",
  4614. "name": "directory",
  4615. "schema": {
  4616. "type": "string"
  4617. }
  4618. }
  4619. ],
  4620. "summary": "Subscribe to events",
  4621. "description": "Get events",
  4622. "responses": {
  4623. "200": {
  4624. "description": "Event stream",
  4625. "content": {
  4626. "text/event-stream": {
  4627. "schema": {
  4628. "$ref": "#/components/schemas/Event"
  4629. }
  4630. }
  4631. }
  4632. }
  4633. },
  4634. "x-codeSamples": [
  4635. {
  4636. "lang": "js",
  4637. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  4638. }
  4639. ]
  4640. }
  4641. }
  4642. },
  4643. "components": {
  4644. "schemas": {
  4645. "Event.server.instance.disposed": {
  4646. "type": "object",
  4647. "properties": {
  4648. "type": {
  4649. "type": "string",
  4650. "const": "server.instance.disposed"
  4651. },
  4652. "properties": {
  4653. "type": "object",
  4654. "properties": {
  4655. "directory": {
  4656. "type": "string"
  4657. }
  4658. },
  4659. "required": ["directory"]
  4660. }
  4661. },
  4662. "required": ["type", "properties"]
  4663. },
  4664. "Event.installation.updated": {
  4665. "type": "object",
  4666. "properties": {
  4667. "type": {
  4668. "type": "string",
  4669. "const": "installation.updated"
  4670. },
  4671. "properties": {
  4672. "type": "object",
  4673. "properties": {
  4674. "version": {
  4675. "type": "string"
  4676. }
  4677. },
  4678. "required": ["version"]
  4679. }
  4680. },
  4681. "required": ["type", "properties"]
  4682. },
  4683. "Event.installation.update-available": {
  4684. "type": "object",
  4685. "properties": {
  4686. "type": {
  4687. "type": "string",
  4688. "const": "installation.update-available"
  4689. },
  4690. "properties": {
  4691. "type": "object",
  4692. "properties": {
  4693. "version": {
  4694. "type": "string"
  4695. }
  4696. },
  4697. "required": ["version"]
  4698. }
  4699. },
  4700. "required": ["type", "properties"]
  4701. },
  4702. "Event.lsp.client.diagnostics": {
  4703. "type": "object",
  4704. "properties": {
  4705. "type": {
  4706. "type": "string",
  4707. "const": "lsp.client.diagnostics"
  4708. },
  4709. "properties": {
  4710. "type": "object",
  4711. "properties": {
  4712. "serverID": {
  4713. "type": "string"
  4714. },
  4715. "path": {
  4716. "type": "string"
  4717. }
  4718. },
  4719. "required": ["serverID", "path"]
  4720. }
  4721. },
  4722. "required": ["type", "properties"]
  4723. },
  4724. "Event.lsp.updated": {
  4725. "type": "object",
  4726. "properties": {
  4727. "type": {
  4728. "type": "string",
  4729. "const": "lsp.updated"
  4730. },
  4731. "properties": {
  4732. "type": "object",
  4733. "properties": {}
  4734. }
  4735. },
  4736. "required": ["type", "properties"]
  4737. },
  4738. "FileDiff": {
  4739. "type": "object",
  4740. "properties": {
  4741. "file": {
  4742. "type": "string"
  4743. },
  4744. "before": {
  4745. "type": "string"
  4746. },
  4747. "after": {
  4748. "type": "string"
  4749. },
  4750. "additions": {
  4751. "type": "number"
  4752. },
  4753. "deletions": {
  4754. "type": "number"
  4755. }
  4756. },
  4757. "required": ["file", "before", "after", "additions", "deletions"]
  4758. },
  4759. "UserMessage": {
  4760. "type": "object",
  4761. "properties": {
  4762. "id": {
  4763. "type": "string"
  4764. },
  4765. "sessionID": {
  4766. "type": "string"
  4767. },
  4768. "role": {
  4769. "type": "string",
  4770. "const": "user"
  4771. },
  4772. "time": {
  4773. "type": "object",
  4774. "properties": {
  4775. "created": {
  4776. "type": "number"
  4777. }
  4778. },
  4779. "required": ["created"]
  4780. },
  4781. "summary": {
  4782. "type": "object",
  4783. "properties": {
  4784. "title": {
  4785. "type": "string"
  4786. },
  4787. "body": {
  4788. "type": "string"
  4789. },
  4790. "diffs": {
  4791. "type": "array",
  4792. "items": {
  4793. "$ref": "#/components/schemas/FileDiff"
  4794. }
  4795. }
  4796. },
  4797. "required": ["diffs"]
  4798. },
  4799. "agent": {
  4800. "type": "string"
  4801. },
  4802. "model": {
  4803. "type": "object",
  4804. "properties": {
  4805. "providerID": {
  4806. "type": "string"
  4807. },
  4808. "modelID": {
  4809. "type": "string"
  4810. }
  4811. },
  4812. "required": ["providerID", "modelID"]
  4813. },
  4814. "system": {
  4815. "type": "string"
  4816. },
  4817. "tools": {
  4818. "type": "object",
  4819. "propertyNames": {
  4820. "type": "string"
  4821. },
  4822. "additionalProperties": {
  4823. "type": "boolean"
  4824. }
  4825. }
  4826. },
  4827. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  4828. },
  4829. "ProviderAuthError": {
  4830. "type": "object",
  4831. "properties": {
  4832. "name": {
  4833. "type": "string",
  4834. "const": "ProviderAuthError"
  4835. },
  4836. "data": {
  4837. "type": "object",
  4838. "properties": {
  4839. "providerID": {
  4840. "type": "string"
  4841. },
  4842. "message": {
  4843. "type": "string"
  4844. }
  4845. },
  4846. "required": ["providerID", "message"]
  4847. }
  4848. },
  4849. "required": ["name", "data"]
  4850. },
  4851. "UnknownError": {
  4852. "type": "object",
  4853. "properties": {
  4854. "name": {
  4855. "type": "string",
  4856. "const": "UnknownError"
  4857. },
  4858. "data": {
  4859. "type": "object",
  4860. "properties": {
  4861. "message": {
  4862. "type": "string"
  4863. }
  4864. },
  4865. "required": ["message"]
  4866. }
  4867. },
  4868. "required": ["name", "data"]
  4869. },
  4870. "MessageOutputLengthError": {
  4871. "type": "object",
  4872. "properties": {
  4873. "name": {
  4874. "type": "string",
  4875. "const": "MessageOutputLengthError"
  4876. },
  4877. "data": {
  4878. "type": "object",
  4879. "properties": {}
  4880. }
  4881. },
  4882. "required": ["name", "data"]
  4883. },
  4884. "MessageAbortedError": {
  4885. "type": "object",
  4886. "properties": {
  4887. "name": {
  4888. "type": "string",
  4889. "const": "MessageAbortedError"
  4890. },
  4891. "data": {
  4892. "type": "object",
  4893. "properties": {
  4894. "message": {
  4895. "type": "string"
  4896. }
  4897. },
  4898. "required": ["message"]
  4899. }
  4900. },
  4901. "required": ["name", "data"]
  4902. },
  4903. "APIError": {
  4904. "type": "object",
  4905. "properties": {
  4906. "name": {
  4907. "type": "string",
  4908. "const": "APIError"
  4909. },
  4910. "data": {
  4911. "type": "object",
  4912. "properties": {
  4913. "message": {
  4914. "type": "string"
  4915. },
  4916. "statusCode": {
  4917. "type": "number"
  4918. },
  4919. "isRetryable": {
  4920. "type": "boolean"
  4921. },
  4922. "responseHeaders": {
  4923. "type": "object",
  4924. "propertyNames": {
  4925. "type": "string"
  4926. },
  4927. "additionalProperties": {
  4928. "type": "string"
  4929. }
  4930. },
  4931. "responseBody": {
  4932. "type": "string"
  4933. }
  4934. },
  4935. "required": ["message", "isRetryable"]
  4936. }
  4937. },
  4938. "required": ["name", "data"]
  4939. },
  4940. "AssistantMessage": {
  4941. "type": "object",
  4942. "properties": {
  4943. "id": {
  4944. "type": "string"
  4945. },
  4946. "sessionID": {
  4947. "type": "string"
  4948. },
  4949. "role": {
  4950. "type": "string",
  4951. "const": "assistant"
  4952. },
  4953. "time": {
  4954. "type": "object",
  4955. "properties": {
  4956. "created": {
  4957. "type": "number"
  4958. },
  4959. "completed": {
  4960. "type": "number"
  4961. }
  4962. },
  4963. "required": ["created"]
  4964. },
  4965. "error": {
  4966. "anyOf": [
  4967. {
  4968. "$ref": "#/components/schemas/ProviderAuthError"
  4969. },
  4970. {
  4971. "$ref": "#/components/schemas/UnknownError"
  4972. },
  4973. {
  4974. "$ref": "#/components/schemas/MessageOutputLengthError"
  4975. },
  4976. {
  4977. "$ref": "#/components/schemas/MessageAbortedError"
  4978. },
  4979. {
  4980. "$ref": "#/components/schemas/APIError"
  4981. }
  4982. ]
  4983. },
  4984. "parentID": {
  4985. "type": "string"
  4986. },
  4987. "modelID": {
  4988. "type": "string"
  4989. },
  4990. "providerID": {
  4991. "type": "string"
  4992. },
  4993. "mode": {
  4994. "type": "string"
  4995. },
  4996. "path": {
  4997. "type": "object",
  4998. "properties": {
  4999. "cwd": {
  5000. "type": "string"
  5001. },
  5002. "root": {
  5003. "type": "string"
  5004. }
  5005. },
  5006. "required": ["cwd", "root"]
  5007. },
  5008. "summary": {
  5009. "type": "boolean"
  5010. },
  5011. "cost": {
  5012. "type": "number"
  5013. },
  5014. "tokens": {
  5015. "type": "object",
  5016. "properties": {
  5017. "input": {
  5018. "type": "number"
  5019. },
  5020. "output": {
  5021. "type": "number"
  5022. },
  5023. "reasoning": {
  5024. "type": "number"
  5025. },
  5026. "cache": {
  5027. "type": "object",
  5028. "properties": {
  5029. "read": {
  5030. "type": "number"
  5031. },
  5032. "write": {
  5033. "type": "number"
  5034. }
  5035. },
  5036. "required": ["read", "write"]
  5037. }
  5038. },
  5039. "required": ["input", "output", "reasoning", "cache"]
  5040. },
  5041. "finish": {
  5042. "type": "string"
  5043. }
  5044. },
  5045. "required": [
  5046. "id",
  5047. "sessionID",
  5048. "role",
  5049. "time",
  5050. "parentID",
  5051. "modelID",
  5052. "providerID",
  5053. "mode",
  5054. "path",
  5055. "cost",
  5056. "tokens"
  5057. ]
  5058. },
  5059. "Message": {
  5060. "anyOf": [
  5061. {
  5062. "$ref": "#/components/schemas/UserMessage"
  5063. },
  5064. {
  5065. "$ref": "#/components/schemas/AssistantMessage"
  5066. }
  5067. ]
  5068. },
  5069. "Event.message.updated": {
  5070. "type": "object",
  5071. "properties": {
  5072. "type": {
  5073. "type": "string",
  5074. "const": "message.updated"
  5075. },
  5076. "properties": {
  5077. "type": "object",
  5078. "properties": {
  5079. "info": {
  5080. "$ref": "#/components/schemas/Message"
  5081. }
  5082. },
  5083. "required": ["info"]
  5084. }
  5085. },
  5086. "required": ["type", "properties"]
  5087. },
  5088. "Event.message.removed": {
  5089. "type": "object",
  5090. "properties": {
  5091. "type": {
  5092. "type": "string",
  5093. "const": "message.removed"
  5094. },
  5095. "properties": {
  5096. "type": "object",
  5097. "properties": {
  5098. "sessionID": {
  5099. "type": "string"
  5100. },
  5101. "messageID": {
  5102. "type": "string"
  5103. }
  5104. },
  5105. "required": ["sessionID", "messageID"]
  5106. }
  5107. },
  5108. "required": ["type", "properties"]
  5109. },
  5110. "TextPart": {
  5111. "type": "object",
  5112. "properties": {
  5113. "id": {
  5114. "type": "string"
  5115. },
  5116. "sessionID": {
  5117. "type": "string"
  5118. },
  5119. "messageID": {
  5120. "type": "string"
  5121. },
  5122. "type": {
  5123. "type": "string",
  5124. "const": "text"
  5125. },
  5126. "text": {
  5127. "type": "string"
  5128. },
  5129. "synthetic": {
  5130. "type": "boolean"
  5131. },
  5132. "ignored": {
  5133. "type": "boolean"
  5134. },
  5135. "time": {
  5136. "type": "object",
  5137. "properties": {
  5138. "start": {
  5139. "type": "number"
  5140. },
  5141. "end": {
  5142. "type": "number"
  5143. }
  5144. },
  5145. "required": ["start"]
  5146. },
  5147. "metadata": {
  5148. "type": "object",
  5149. "propertyNames": {
  5150. "type": "string"
  5151. },
  5152. "additionalProperties": {}
  5153. }
  5154. },
  5155. "required": ["id", "sessionID", "messageID", "type", "text"]
  5156. },
  5157. "ReasoningPart": {
  5158. "type": "object",
  5159. "properties": {
  5160. "id": {
  5161. "type": "string"
  5162. },
  5163. "sessionID": {
  5164. "type": "string"
  5165. },
  5166. "messageID": {
  5167. "type": "string"
  5168. },
  5169. "type": {
  5170. "type": "string",
  5171. "const": "reasoning"
  5172. },
  5173. "text": {
  5174. "type": "string"
  5175. },
  5176. "metadata": {
  5177. "type": "object",
  5178. "propertyNames": {
  5179. "type": "string"
  5180. },
  5181. "additionalProperties": {}
  5182. },
  5183. "time": {
  5184. "type": "object",
  5185. "properties": {
  5186. "start": {
  5187. "type": "number"
  5188. },
  5189. "end": {
  5190. "type": "number"
  5191. }
  5192. },
  5193. "required": ["start"]
  5194. }
  5195. },
  5196. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  5197. },
  5198. "FilePartSourceText": {
  5199. "type": "object",
  5200. "properties": {
  5201. "value": {
  5202. "type": "string"
  5203. },
  5204. "start": {
  5205. "type": "integer",
  5206. "minimum": -9007199254740991,
  5207. "maximum": 9007199254740991
  5208. },
  5209. "end": {
  5210. "type": "integer",
  5211. "minimum": -9007199254740991,
  5212. "maximum": 9007199254740991
  5213. }
  5214. },
  5215. "required": ["value", "start", "end"]
  5216. },
  5217. "FileSource": {
  5218. "type": "object",
  5219. "properties": {
  5220. "text": {
  5221. "$ref": "#/components/schemas/FilePartSourceText"
  5222. },
  5223. "type": {
  5224. "type": "string",
  5225. "const": "file"
  5226. },
  5227. "path": {
  5228. "type": "string"
  5229. }
  5230. },
  5231. "required": ["text", "type", "path"]
  5232. },
  5233. "Range": {
  5234. "type": "object",
  5235. "properties": {
  5236. "start": {
  5237. "type": "object",
  5238. "properties": {
  5239. "line": {
  5240. "type": "number"
  5241. },
  5242. "character": {
  5243. "type": "number"
  5244. }
  5245. },
  5246. "required": ["line", "character"]
  5247. },
  5248. "end": {
  5249. "type": "object",
  5250. "properties": {
  5251. "line": {
  5252. "type": "number"
  5253. },
  5254. "character": {
  5255. "type": "number"
  5256. }
  5257. },
  5258. "required": ["line", "character"]
  5259. }
  5260. },
  5261. "required": ["start", "end"]
  5262. },
  5263. "SymbolSource": {
  5264. "type": "object",
  5265. "properties": {
  5266. "text": {
  5267. "$ref": "#/components/schemas/FilePartSourceText"
  5268. },
  5269. "type": {
  5270. "type": "string",
  5271. "const": "symbol"
  5272. },
  5273. "path": {
  5274. "type": "string"
  5275. },
  5276. "range": {
  5277. "$ref": "#/components/schemas/Range"
  5278. },
  5279. "name": {
  5280. "type": "string"
  5281. },
  5282. "kind": {
  5283. "type": "integer",
  5284. "minimum": -9007199254740991,
  5285. "maximum": 9007199254740991
  5286. }
  5287. },
  5288. "required": ["text", "type", "path", "range", "name", "kind"]
  5289. },
  5290. "FilePartSource": {
  5291. "anyOf": [
  5292. {
  5293. "$ref": "#/components/schemas/FileSource"
  5294. },
  5295. {
  5296. "$ref": "#/components/schemas/SymbolSource"
  5297. }
  5298. ]
  5299. },
  5300. "FilePart": {
  5301. "type": "object",
  5302. "properties": {
  5303. "id": {
  5304. "type": "string"
  5305. },
  5306. "sessionID": {
  5307. "type": "string"
  5308. },
  5309. "messageID": {
  5310. "type": "string"
  5311. },
  5312. "type": {
  5313. "type": "string",
  5314. "const": "file"
  5315. },
  5316. "mime": {
  5317. "type": "string"
  5318. },
  5319. "filename": {
  5320. "type": "string"
  5321. },
  5322. "url": {
  5323. "type": "string"
  5324. },
  5325. "source": {
  5326. "$ref": "#/components/schemas/FilePartSource"
  5327. }
  5328. },
  5329. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  5330. },
  5331. "ToolStatePending": {
  5332. "type": "object",
  5333. "properties": {
  5334. "status": {
  5335. "type": "string",
  5336. "const": "pending"
  5337. },
  5338. "input": {
  5339. "type": "object",
  5340. "propertyNames": {
  5341. "type": "string"
  5342. },
  5343. "additionalProperties": {}
  5344. },
  5345. "raw": {
  5346. "type": "string"
  5347. }
  5348. },
  5349. "required": ["status", "input", "raw"]
  5350. },
  5351. "ToolStateRunning": {
  5352. "type": "object",
  5353. "properties": {
  5354. "status": {
  5355. "type": "string",
  5356. "const": "running"
  5357. },
  5358. "input": {
  5359. "type": "object",
  5360. "propertyNames": {
  5361. "type": "string"
  5362. },
  5363. "additionalProperties": {}
  5364. },
  5365. "title": {
  5366. "type": "string"
  5367. },
  5368. "metadata": {
  5369. "type": "object",
  5370. "propertyNames": {
  5371. "type": "string"
  5372. },
  5373. "additionalProperties": {}
  5374. },
  5375. "time": {
  5376. "type": "object",
  5377. "properties": {
  5378. "start": {
  5379. "type": "number"
  5380. }
  5381. },
  5382. "required": ["start"]
  5383. }
  5384. },
  5385. "required": ["status", "input", "time"]
  5386. },
  5387. "ToolStateCompleted": {
  5388. "type": "object",
  5389. "properties": {
  5390. "status": {
  5391. "type": "string",
  5392. "const": "completed"
  5393. },
  5394. "input": {
  5395. "type": "object",
  5396. "propertyNames": {
  5397. "type": "string"
  5398. },
  5399. "additionalProperties": {}
  5400. },
  5401. "output": {
  5402. "type": "string"
  5403. },
  5404. "title": {
  5405. "type": "string"
  5406. },
  5407. "metadata": {
  5408. "type": "object",
  5409. "propertyNames": {
  5410. "type": "string"
  5411. },
  5412. "additionalProperties": {}
  5413. },
  5414. "time": {
  5415. "type": "object",
  5416. "properties": {
  5417. "start": {
  5418. "type": "number"
  5419. },
  5420. "end": {
  5421. "type": "number"
  5422. },
  5423. "compacted": {
  5424. "type": "number"
  5425. }
  5426. },
  5427. "required": ["start", "end"]
  5428. },
  5429. "attachments": {
  5430. "type": "array",
  5431. "items": {
  5432. "$ref": "#/components/schemas/FilePart"
  5433. }
  5434. }
  5435. },
  5436. "required": ["status", "input", "output", "title", "metadata", "time"]
  5437. },
  5438. "ToolStateError": {
  5439. "type": "object",
  5440. "properties": {
  5441. "status": {
  5442. "type": "string",
  5443. "const": "error"
  5444. },
  5445. "input": {
  5446. "type": "object",
  5447. "propertyNames": {
  5448. "type": "string"
  5449. },
  5450. "additionalProperties": {}
  5451. },
  5452. "error": {
  5453. "type": "string"
  5454. },
  5455. "metadata": {
  5456. "type": "object",
  5457. "propertyNames": {
  5458. "type": "string"
  5459. },
  5460. "additionalProperties": {}
  5461. },
  5462. "time": {
  5463. "type": "object",
  5464. "properties": {
  5465. "start": {
  5466. "type": "number"
  5467. },
  5468. "end": {
  5469. "type": "number"
  5470. }
  5471. },
  5472. "required": ["start", "end"]
  5473. }
  5474. },
  5475. "required": ["status", "input", "error", "time"]
  5476. },
  5477. "ToolState": {
  5478. "anyOf": [
  5479. {
  5480. "$ref": "#/components/schemas/ToolStatePending"
  5481. },
  5482. {
  5483. "$ref": "#/components/schemas/ToolStateRunning"
  5484. },
  5485. {
  5486. "$ref": "#/components/schemas/ToolStateCompleted"
  5487. },
  5488. {
  5489. "$ref": "#/components/schemas/ToolStateError"
  5490. }
  5491. ]
  5492. },
  5493. "ToolPart": {
  5494. "type": "object",
  5495. "properties": {
  5496. "id": {
  5497. "type": "string"
  5498. },
  5499. "sessionID": {
  5500. "type": "string"
  5501. },
  5502. "messageID": {
  5503. "type": "string"
  5504. },
  5505. "type": {
  5506. "type": "string",
  5507. "const": "tool"
  5508. },
  5509. "callID": {
  5510. "type": "string"
  5511. },
  5512. "tool": {
  5513. "type": "string"
  5514. },
  5515. "state": {
  5516. "$ref": "#/components/schemas/ToolState"
  5517. },
  5518. "metadata": {
  5519. "type": "object",
  5520. "propertyNames": {
  5521. "type": "string"
  5522. },
  5523. "additionalProperties": {}
  5524. }
  5525. },
  5526. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  5527. },
  5528. "StepStartPart": {
  5529. "type": "object",
  5530. "properties": {
  5531. "id": {
  5532. "type": "string"
  5533. },
  5534. "sessionID": {
  5535. "type": "string"
  5536. },
  5537. "messageID": {
  5538. "type": "string"
  5539. },
  5540. "type": {
  5541. "type": "string",
  5542. "const": "step-start"
  5543. },
  5544. "snapshot": {
  5545. "type": "string"
  5546. }
  5547. },
  5548. "required": ["id", "sessionID", "messageID", "type"]
  5549. },
  5550. "StepFinishPart": {
  5551. "type": "object",
  5552. "properties": {
  5553. "id": {
  5554. "type": "string"
  5555. },
  5556. "sessionID": {
  5557. "type": "string"
  5558. },
  5559. "messageID": {
  5560. "type": "string"
  5561. },
  5562. "type": {
  5563. "type": "string",
  5564. "const": "step-finish"
  5565. },
  5566. "reason": {
  5567. "type": "string"
  5568. },
  5569. "snapshot": {
  5570. "type": "string"
  5571. },
  5572. "cost": {
  5573. "type": "number"
  5574. },
  5575. "tokens": {
  5576. "type": "object",
  5577. "properties": {
  5578. "input": {
  5579. "type": "number"
  5580. },
  5581. "output": {
  5582. "type": "number"
  5583. },
  5584. "reasoning": {
  5585. "type": "number"
  5586. },
  5587. "cache": {
  5588. "type": "object",
  5589. "properties": {
  5590. "read": {
  5591. "type": "number"
  5592. },
  5593. "write": {
  5594. "type": "number"
  5595. }
  5596. },
  5597. "required": ["read", "write"]
  5598. }
  5599. },
  5600. "required": ["input", "output", "reasoning", "cache"]
  5601. }
  5602. },
  5603. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  5604. },
  5605. "SnapshotPart": {
  5606. "type": "object",
  5607. "properties": {
  5608. "id": {
  5609. "type": "string"
  5610. },
  5611. "sessionID": {
  5612. "type": "string"
  5613. },
  5614. "messageID": {
  5615. "type": "string"
  5616. },
  5617. "type": {
  5618. "type": "string",
  5619. "const": "snapshot"
  5620. },
  5621. "snapshot": {
  5622. "type": "string"
  5623. }
  5624. },
  5625. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  5626. },
  5627. "PatchPart": {
  5628. "type": "object",
  5629. "properties": {
  5630. "id": {
  5631. "type": "string"
  5632. },
  5633. "sessionID": {
  5634. "type": "string"
  5635. },
  5636. "messageID": {
  5637. "type": "string"
  5638. },
  5639. "type": {
  5640. "type": "string",
  5641. "const": "patch"
  5642. },
  5643. "hash": {
  5644. "type": "string"
  5645. },
  5646. "files": {
  5647. "type": "array",
  5648. "items": {
  5649. "type": "string"
  5650. }
  5651. }
  5652. },
  5653. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  5654. },
  5655. "AgentPart": {
  5656. "type": "object",
  5657. "properties": {
  5658. "id": {
  5659. "type": "string"
  5660. },
  5661. "sessionID": {
  5662. "type": "string"
  5663. },
  5664. "messageID": {
  5665. "type": "string"
  5666. },
  5667. "type": {
  5668. "type": "string",
  5669. "const": "agent"
  5670. },
  5671. "name": {
  5672. "type": "string"
  5673. },
  5674. "source": {
  5675. "type": "object",
  5676. "properties": {
  5677. "value": {
  5678. "type": "string"
  5679. },
  5680. "start": {
  5681. "type": "integer",
  5682. "minimum": -9007199254740991,
  5683. "maximum": 9007199254740991
  5684. },
  5685. "end": {
  5686. "type": "integer",
  5687. "minimum": -9007199254740991,
  5688. "maximum": 9007199254740991
  5689. }
  5690. },
  5691. "required": ["value", "start", "end"]
  5692. }
  5693. },
  5694. "required": ["id", "sessionID", "messageID", "type", "name"]
  5695. },
  5696. "RetryPart": {
  5697. "type": "object",
  5698. "properties": {
  5699. "id": {
  5700. "type": "string"
  5701. },
  5702. "sessionID": {
  5703. "type": "string"
  5704. },
  5705. "messageID": {
  5706. "type": "string"
  5707. },
  5708. "type": {
  5709. "type": "string",
  5710. "const": "retry"
  5711. },
  5712. "attempt": {
  5713. "type": "number"
  5714. },
  5715. "error": {
  5716. "$ref": "#/components/schemas/APIError"
  5717. },
  5718. "time": {
  5719. "type": "object",
  5720. "properties": {
  5721. "created": {
  5722. "type": "number"
  5723. }
  5724. },
  5725. "required": ["created"]
  5726. }
  5727. },
  5728. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  5729. },
  5730. "CompactionPart": {
  5731. "type": "object",
  5732. "properties": {
  5733. "id": {
  5734. "type": "string"
  5735. },
  5736. "sessionID": {
  5737. "type": "string"
  5738. },
  5739. "messageID": {
  5740. "type": "string"
  5741. },
  5742. "type": {
  5743. "type": "string",
  5744. "const": "compaction"
  5745. },
  5746. "auto": {
  5747. "type": "boolean"
  5748. }
  5749. },
  5750. "required": ["id", "sessionID", "messageID", "type", "auto"]
  5751. },
  5752. "Part": {
  5753. "anyOf": [
  5754. {
  5755. "$ref": "#/components/schemas/TextPart"
  5756. },
  5757. {
  5758. "type": "object",
  5759. "properties": {
  5760. "id": {
  5761. "type": "string"
  5762. },
  5763. "sessionID": {
  5764. "type": "string"
  5765. },
  5766. "messageID": {
  5767. "type": "string"
  5768. },
  5769. "type": {
  5770. "type": "string",
  5771. "const": "subtask"
  5772. },
  5773. "prompt": {
  5774. "type": "string"
  5775. },
  5776. "description": {
  5777. "type": "string"
  5778. },
  5779. "agent": {
  5780. "type": "string"
  5781. }
  5782. },
  5783. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  5784. },
  5785. {
  5786. "$ref": "#/components/schemas/ReasoningPart"
  5787. },
  5788. {
  5789. "$ref": "#/components/schemas/FilePart"
  5790. },
  5791. {
  5792. "$ref": "#/components/schemas/ToolPart"
  5793. },
  5794. {
  5795. "$ref": "#/components/schemas/StepStartPart"
  5796. },
  5797. {
  5798. "$ref": "#/components/schemas/StepFinishPart"
  5799. },
  5800. {
  5801. "$ref": "#/components/schemas/SnapshotPart"
  5802. },
  5803. {
  5804. "$ref": "#/components/schemas/PatchPart"
  5805. },
  5806. {
  5807. "$ref": "#/components/schemas/AgentPart"
  5808. },
  5809. {
  5810. "$ref": "#/components/schemas/RetryPart"
  5811. },
  5812. {
  5813. "$ref": "#/components/schemas/CompactionPart"
  5814. }
  5815. ]
  5816. },
  5817. "Event.message.part.updated": {
  5818. "type": "object",
  5819. "properties": {
  5820. "type": {
  5821. "type": "string",
  5822. "const": "message.part.updated"
  5823. },
  5824. "properties": {
  5825. "type": "object",
  5826. "properties": {
  5827. "part": {
  5828. "$ref": "#/components/schemas/Part"
  5829. },
  5830. "delta": {
  5831. "type": "string"
  5832. }
  5833. },
  5834. "required": ["part"]
  5835. }
  5836. },
  5837. "required": ["type", "properties"]
  5838. },
  5839. "Event.message.part.removed": {
  5840. "type": "object",
  5841. "properties": {
  5842. "type": {
  5843. "type": "string",
  5844. "const": "message.part.removed"
  5845. },
  5846. "properties": {
  5847. "type": "object",
  5848. "properties": {
  5849. "sessionID": {
  5850. "type": "string"
  5851. },
  5852. "messageID": {
  5853. "type": "string"
  5854. },
  5855. "partID": {
  5856. "type": "string"
  5857. }
  5858. },
  5859. "required": ["sessionID", "messageID", "partID"]
  5860. }
  5861. },
  5862. "required": ["type", "properties"]
  5863. },
  5864. "Permission": {
  5865. "type": "object",
  5866. "properties": {
  5867. "id": {
  5868. "type": "string"
  5869. },
  5870. "type": {
  5871. "type": "string"
  5872. },
  5873. "pattern": {
  5874. "anyOf": [
  5875. {
  5876. "type": "string"
  5877. },
  5878. {
  5879. "type": "array",
  5880. "items": {
  5881. "type": "string"
  5882. }
  5883. }
  5884. ]
  5885. },
  5886. "sessionID": {
  5887. "type": "string"
  5888. },
  5889. "messageID": {
  5890. "type": "string"
  5891. },
  5892. "callID": {
  5893. "type": "string"
  5894. },
  5895. "title": {
  5896. "type": "string"
  5897. },
  5898. "metadata": {
  5899. "type": "object",
  5900. "propertyNames": {
  5901. "type": "string"
  5902. },
  5903. "additionalProperties": {}
  5904. },
  5905. "time": {
  5906. "type": "object",
  5907. "properties": {
  5908. "created": {
  5909. "type": "number"
  5910. }
  5911. },
  5912. "required": ["created"]
  5913. }
  5914. },
  5915. "required": ["id", "type", "sessionID", "messageID", "title", "metadata", "time"]
  5916. },
  5917. "Event.permission.updated": {
  5918. "type": "object",
  5919. "properties": {
  5920. "type": {
  5921. "type": "string",
  5922. "const": "permission.updated"
  5923. },
  5924. "properties": {
  5925. "$ref": "#/components/schemas/Permission"
  5926. }
  5927. },
  5928. "required": ["type", "properties"]
  5929. },
  5930. "Event.permission.replied": {
  5931. "type": "object",
  5932. "properties": {
  5933. "type": {
  5934. "type": "string",
  5935. "const": "permission.replied"
  5936. },
  5937. "properties": {
  5938. "type": "object",
  5939. "properties": {
  5940. "sessionID": {
  5941. "type": "string"
  5942. },
  5943. "permissionID": {
  5944. "type": "string"
  5945. },
  5946. "response": {
  5947. "type": "string"
  5948. }
  5949. },
  5950. "required": ["sessionID", "permissionID", "response"]
  5951. }
  5952. },
  5953. "required": ["type", "properties"]
  5954. },
  5955. "SessionStatus": {
  5956. "anyOf": [
  5957. {
  5958. "type": "object",
  5959. "properties": {
  5960. "type": {
  5961. "type": "string",
  5962. "const": "idle"
  5963. }
  5964. },
  5965. "required": ["type"]
  5966. },
  5967. {
  5968. "type": "object",
  5969. "properties": {
  5970. "type": {
  5971. "type": "string",
  5972. "const": "retry"
  5973. },
  5974. "attempt": {
  5975. "type": "number"
  5976. },
  5977. "message": {
  5978. "type": "string"
  5979. },
  5980. "next": {
  5981. "type": "number"
  5982. }
  5983. },
  5984. "required": ["type", "attempt", "message", "next"]
  5985. },
  5986. {
  5987. "type": "object",
  5988. "properties": {
  5989. "type": {
  5990. "type": "string",
  5991. "const": "busy"
  5992. }
  5993. },
  5994. "required": ["type"]
  5995. }
  5996. ]
  5997. },
  5998. "Event.session.status": {
  5999. "type": "object",
  6000. "properties": {
  6001. "type": {
  6002. "type": "string",
  6003. "const": "session.status"
  6004. },
  6005. "properties": {
  6006. "type": "object",
  6007. "properties": {
  6008. "sessionID": {
  6009. "type": "string"
  6010. },
  6011. "status": {
  6012. "$ref": "#/components/schemas/SessionStatus"
  6013. }
  6014. },
  6015. "required": ["sessionID", "status"]
  6016. }
  6017. },
  6018. "required": ["type", "properties"]
  6019. },
  6020. "Event.session.idle": {
  6021. "type": "object",
  6022. "properties": {
  6023. "type": {
  6024. "type": "string",
  6025. "const": "session.idle"
  6026. },
  6027. "properties": {
  6028. "type": "object",
  6029. "properties": {
  6030. "sessionID": {
  6031. "type": "string"
  6032. }
  6033. },
  6034. "required": ["sessionID"]
  6035. }
  6036. },
  6037. "required": ["type", "properties"]
  6038. },
  6039. "Event.session.compacted": {
  6040. "type": "object",
  6041. "properties": {
  6042. "type": {
  6043. "type": "string",
  6044. "const": "session.compacted"
  6045. },
  6046. "properties": {
  6047. "type": "object",
  6048. "properties": {
  6049. "sessionID": {
  6050. "type": "string"
  6051. }
  6052. },
  6053. "required": ["sessionID"]
  6054. }
  6055. },
  6056. "required": ["type", "properties"]
  6057. },
  6058. "Event.file.edited": {
  6059. "type": "object",
  6060. "properties": {
  6061. "type": {
  6062. "type": "string",
  6063. "const": "file.edited"
  6064. },
  6065. "properties": {
  6066. "type": "object",
  6067. "properties": {
  6068. "file": {
  6069. "type": "string"
  6070. }
  6071. },
  6072. "required": ["file"]
  6073. }
  6074. },
  6075. "required": ["type", "properties"]
  6076. },
  6077. "Todo": {
  6078. "type": "object",
  6079. "properties": {
  6080. "content": {
  6081. "description": "Brief description of the task",
  6082. "type": "string"
  6083. },
  6084. "status": {
  6085. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  6086. "type": "string"
  6087. },
  6088. "priority": {
  6089. "description": "Priority level of the task: high, medium, low",
  6090. "type": "string"
  6091. },
  6092. "id": {
  6093. "description": "Unique identifier for the todo item",
  6094. "type": "string"
  6095. }
  6096. },
  6097. "required": ["content", "status", "priority", "id"]
  6098. },
  6099. "Event.todo.updated": {
  6100. "type": "object",
  6101. "properties": {
  6102. "type": {
  6103. "type": "string",
  6104. "const": "todo.updated"
  6105. },
  6106. "properties": {
  6107. "type": "object",
  6108. "properties": {
  6109. "sessionID": {
  6110. "type": "string"
  6111. },
  6112. "todos": {
  6113. "type": "array",
  6114. "items": {
  6115. "$ref": "#/components/schemas/Todo"
  6116. }
  6117. }
  6118. },
  6119. "required": ["sessionID", "todos"]
  6120. }
  6121. },
  6122. "required": ["type", "properties"]
  6123. },
  6124. "Event.command.executed": {
  6125. "type": "object",
  6126. "properties": {
  6127. "type": {
  6128. "type": "string",
  6129. "const": "command.executed"
  6130. },
  6131. "properties": {
  6132. "type": "object",
  6133. "properties": {
  6134. "name": {
  6135. "type": "string"
  6136. },
  6137. "sessionID": {
  6138. "type": "string",
  6139. "pattern": "^ses.*"
  6140. },
  6141. "arguments": {
  6142. "type": "string"
  6143. },
  6144. "messageID": {
  6145. "type": "string",
  6146. "pattern": "^msg.*"
  6147. }
  6148. },
  6149. "required": ["name", "sessionID", "arguments", "messageID"]
  6150. }
  6151. },
  6152. "required": ["type", "properties"]
  6153. },
  6154. "Session": {
  6155. "type": "object",
  6156. "properties": {
  6157. "id": {
  6158. "type": "string",
  6159. "pattern": "^ses.*"
  6160. },
  6161. "projectID": {
  6162. "type": "string"
  6163. },
  6164. "directory": {
  6165. "type": "string"
  6166. },
  6167. "parentID": {
  6168. "type": "string",
  6169. "pattern": "^ses.*"
  6170. },
  6171. "summary": {
  6172. "type": "object",
  6173. "properties": {
  6174. "additions": {
  6175. "type": "number"
  6176. },
  6177. "deletions": {
  6178. "type": "number"
  6179. },
  6180. "files": {
  6181. "type": "number"
  6182. },
  6183. "diffs": {
  6184. "type": "array",
  6185. "items": {
  6186. "$ref": "#/components/schemas/FileDiff"
  6187. }
  6188. }
  6189. },
  6190. "required": ["additions", "deletions", "files"]
  6191. },
  6192. "share": {
  6193. "type": "object",
  6194. "properties": {
  6195. "url": {
  6196. "type": "string"
  6197. }
  6198. },
  6199. "required": ["url"]
  6200. },
  6201. "title": {
  6202. "type": "string"
  6203. },
  6204. "version": {
  6205. "type": "string"
  6206. },
  6207. "time": {
  6208. "type": "object",
  6209. "properties": {
  6210. "created": {
  6211. "type": "number"
  6212. },
  6213. "updated": {
  6214. "type": "number"
  6215. },
  6216. "compacting": {
  6217. "type": "number"
  6218. }
  6219. },
  6220. "required": ["created", "updated"]
  6221. },
  6222. "revert": {
  6223. "type": "object",
  6224. "properties": {
  6225. "messageID": {
  6226. "type": "string"
  6227. },
  6228. "partID": {
  6229. "type": "string"
  6230. },
  6231. "snapshot": {
  6232. "type": "string"
  6233. },
  6234. "diff": {
  6235. "type": "string"
  6236. }
  6237. },
  6238. "required": ["messageID"]
  6239. }
  6240. },
  6241. "required": ["id", "projectID", "directory", "title", "version", "time"]
  6242. },
  6243. "Event.session.created": {
  6244. "type": "object",
  6245. "properties": {
  6246. "type": {
  6247. "type": "string",
  6248. "const": "session.created"
  6249. },
  6250. "properties": {
  6251. "type": "object",
  6252. "properties": {
  6253. "info": {
  6254. "$ref": "#/components/schemas/Session"
  6255. }
  6256. },
  6257. "required": ["info"]
  6258. }
  6259. },
  6260. "required": ["type", "properties"]
  6261. },
  6262. "Event.session.updated": {
  6263. "type": "object",
  6264. "properties": {
  6265. "type": {
  6266. "type": "string",
  6267. "const": "session.updated"
  6268. },
  6269. "properties": {
  6270. "type": "object",
  6271. "properties": {
  6272. "info": {
  6273. "$ref": "#/components/schemas/Session"
  6274. }
  6275. },
  6276. "required": ["info"]
  6277. }
  6278. },
  6279. "required": ["type", "properties"]
  6280. },
  6281. "Event.session.deleted": {
  6282. "type": "object",
  6283. "properties": {
  6284. "type": {
  6285. "type": "string",
  6286. "const": "session.deleted"
  6287. },
  6288. "properties": {
  6289. "type": "object",
  6290. "properties": {
  6291. "info": {
  6292. "$ref": "#/components/schemas/Session"
  6293. }
  6294. },
  6295. "required": ["info"]
  6296. }
  6297. },
  6298. "required": ["type", "properties"]
  6299. },
  6300. "Event.session.diff": {
  6301. "type": "object",
  6302. "properties": {
  6303. "type": {
  6304. "type": "string",
  6305. "const": "session.diff"
  6306. },
  6307. "properties": {
  6308. "type": "object",
  6309. "properties": {
  6310. "sessionID": {
  6311. "type": "string"
  6312. },
  6313. "diff": {
  6314. "type": "array",
  6315. "items": {
  6316. "$ref": "#/components/schemas/FileDiff"
  6317. }
  6318. }
  6319. },
  6320. "required": ["sessionID", "diff"]
  6321. }
  6322. },
  6323. "required": ["type", "properties"]
  6324. },
  6325. "Event.session.error": {
  6326. "type": "object",
  6327. "properties": {
  6328. "type": {
  6329. "type": "string",
  6330. "const": "session.error"
  6331. },
  6332. "properties": {
  6333. "type": "object",
  6334. "properties": {
  6335. "sessionID": {
  6336. "type": "string"
  6337. },
  6338. "error": {
  6339. "anyOf": [
  6340. {
  6341. "$ref": "#/components/schemas/ProviderAuthError"
  6342. },
  6343. {
  6344. "$ref": "#/components/schemas/UnknownError"
  6345. },
  6346. {
  6347. "$ref": "#/components/schemas/MessageOutputLengthError"
  6348. },
  6349. {
  6350. "$ref": "#/components/schemas/MessageAbortedError"
  6351. },
  6352. {
  6353. "$ref": "#/components/schemas/APIError"
  6354. }
  6355. ]
  6356. }
  6357. }
  6358. }
  6359. },
  6360. "required": ["type", "properties"]
  6361. },
  6362. "Event.file.watcher.updated": {
  6363. "type": "object",
  6364. "properties": {
  6365. "type": {
  6366. "type": "string",
  6367. "const": "file.watcher.updated"
  6368. },
  6369. "properties": {
  6370. "type": "object",
  6371. "properties": {
  6372. "file": {
  6373. "type": "string"
  6374. },
  6375. "event": {
  6376. "anyOf": [
  6377. {
  6378. "type": "string",
  6379. "const": "add"
  6380. },
  6381. {
  6382. "type": "string",
  6383. "const": "change"
  6384. },
  6385. {
  6386. "type": "string",
  6387. "const": "unlink"
  6388. }
  6389. ]
  6390. }
  6391. },
  6392. "required": ["file", "event"]
  6393. }
  6394. },
  6395. "required": ["type", "properties"]
  6396. },
  6397. "Event.vcs.branch.updated": {
  6398. "type": "object",
  6399. "properties": {
  6400. "type": {
  6401. "type": "string",
  6402. "const": "vcs.branch.updated"
  6403. },
  6404. "properties": {
  6405. "type": "object",
  6406. "properties": {
  6407. "branch": {
  6408. "type": "string"
  6409. }
  6410. }
  6411. }
  6412. },
  6413. "required": ["type", "properties"]
  6414. },
  6415. "Event.tui.prompt.append": {
  6416. "type": "object",
  6417. "properties": {
  6418. "type": {
  6419. "type": "string",
  6420. "const": "tui.prompt.append"
  6421. },
  6422. "properties": {
  6423. "type": "object",
  6424. "properties": {
  6425. "text": {
  6426. "type": "string"
  6427. }
  6428. },
  6429. "required": ["text"]
  6430. }
  6431. },
  6432. "required": ["type", "properties"]
  6433. },
  6434. "Event.tui.command.execute": {
  6435. "type": "object",
  6436. "properties": {
  6437. "type": {
  6438. "type": "string",
  6439. "const": "tui.command.execute"
  6440. },
  6441. "properties": {
  6442. "type": "object",
  6443. "properties": {
  6444. "command": {
  6445. "anyOf": [
  6446. {
  6447. "type": "string",
  6448. "enum": [
  6449. "session.list",
  6450. "session.new",
  6451. "session.share",
  6452. "session.interrupt",
  6453. "session.compact",
  6454. "session.page.up",
  6455. "session.page.down",
  6456. "session.half.page.up",
  6457. "session.half.page.down",
  6458. "session.first",
  6459. "session.last",
  6460. "prompt.clear",
  6461. "prompt.submit",
  6462. "agent.cycle"
  6463. ]
  6464. },
  6465. {
  6466. "type": "string"
  6467. }
  6468. ]
  6469. }
  6470. },
  6471. "required": ["command"]
  6472. }
  6473. },
  6474. "required": ["type", "properties"]
  6475. },
  6476. "Event.tui.toast.show": {
  6477. "type": "object",
  6478. "properties": {
  6479. "type": {
  6480. "type": "string",
  6481. "const": "tui.toast.show"
  6482. },
  6483. "properties": {
  6484. "type": "object",
  6485. "properties": {
  6486. "title": {
  6487. "type": "string"
  6488. },
  6489. "message": {
  6490. "type": "string"
  6491. },
  6492. "variant": {
  6493. "type": "string",
  6494. "enum": ["info", "success", "warning", "error"]
  6495. },
  6496. "duration": {
  6497. "description": "Duration in milliseconds",
  6498. "default": 5000,
  6499. "type": "number"
  6500. }
  6501. },
  6502. "required": ["message", "variant"]
  6503. }
  6504. },
  6505. "required": ["type", "properties"]
  6506. },
  6507. "Pty": {
  6508. "type": "object",
  6509. "properties": {
  6510. "id": {
  6511. "type": "string",
  6512. "pattern": "^pty.*"
  6513. },
  6514. "title": {
  6515. "type": "string"
  6516. },
  6517. "command": {
  6518. "type": "string"
  6519. },
  6520. "args": {
  6521. "type": "array",
  6522. "items": {
  6523. "type": "string"
  6524. }
  6525. },
  6526. "cwd": {
  6527. "type": "string"
  6528. },
  6529. "status": {
  6530. "type": "string",
  6531. "enum": ["running", "exited"]
  6532. },
  6533. "pid": {
  6534. "type": "number"
  6535. }
  6536. },
  6537. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  6538. },
  6539. "Event.pty.created": {
  6540. "type": "object",
  6541. "properties": {
  6542. "type": {
  6543. "type": "string",
  6544. "const": "pty.created"
  6545. },
  6546. "properties": {
  6547. "type": "object",
  6548. "properties": {
  6549. "info": {
  6550. "$ref": "#/components/schemas/Pty"
  6551. }
  6552. },
  6553. "required": ["info"]
  6554. }
  6555. },
  6556. "required": ["type", "properties"]
  6557. },
  6558. "Event.pty.updated": {
  6559. "type": "object",
  6560. "properties": {
  6561. "type": {
  6562. "type": "string",
  6563. "const": "pty.updated"
  6564. },
  6565. "properties": {
  6566. "type": "object",
  6567. "properties": {
  6568. "info": {
  6569. "$ref": "#/components/schemas/Pty"
  6570. }
  6571. },
  6572. "required": ["info"]
  6573. }
  6574. },
  6575. "required": ["type", "properties"]
  6576. },
  6577. "Event.pty.exited": {
  6578. "type": "object",
  6579. "properties": {
  6580. "type": {
  6581. "type": "string",
  6582. "const": "pty.exited"
  6583. },
  6584. "properties": {
  6585. "type": "object",
  6586. "properties": {
  6587. "id": {
  6588. "type": "string",
  6589. "pattern": "^pty.*"
  6590. },
  6591. "exitCode": {
  6592. "type": "number"
  6593. }
  6594. },
  6595. "required": ["id", "exitCode"]
  6596. }
  6597. },
  6598. "required": ["type", "properties"]
  6599. },
  6600. "Event.pty.deleted": {
  6601. "type": "object",
  6602. "properties": {
  6603. "type": {
  6604. "type": "string",
  6605. "const": "pty.deleted"
  6606. },
  6607. "properties": {
  6608. "type": "object",
  6609. "properties": {
  6610. "id": {
  6611. "type": "string",
  6612. "pattern": "^pty.*"
  6613. }
  6614. },
  6615. "required": ["id"]
  6616. }
  6617. },
  6618. "required": ["type", "properties"]
  6619. },
  6620. "Event.server.connected": {
  6621. "type": "object",
  6622. "properties": {
  6623. "type": {
  6624. "type": "string",
  6625. "const": "server.connected"
  6626. },
  6627. "properties": {
  6628. "type": "object",
  6629. "properties": {}
  6630. }
  6631. },
  6632. "required": ["type", "properties"]
  6633. },
  6634. "Event": {
  6635. "anyOf": [
  6636. {
  6637. "$ref": "#/components/schemas/Event.server.instance.disposed"
  6638. },
  6639. {
  6640. "$ref": "#/components/schemas/Event.installation.updated"
  6641. },
  6642. {
  6643. "$ref": "#/components/schemas/Event.installation.update-available"
  6644. },
  6645. {
  6646. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  6647. },
  6648. {
  6649. "$ref": "#/components/schemas/Event.lsp.updated"
  6650. },
  6651. {
  6652. "$ref": "#/components/schemas/Event.message.updated"
  6653. },
  6654. {
  6655. "$ref": "#/components/schemas/Event.message.removed"
  6656. },
  6657. {
  6658. "$ref": "#/components/schemas/Event.message.part.updated"
  6659. },
  6660. {
  6661. "$ref": "#/components/schemas/Event.message.part.removed"
  6662. },
  6663. {
  6664. "$ref": "#/components/schemas/Event.permission.updated"
  6665. },
  6666. {
  6667. "$ref": "#/components/schemas/Event.permission.replied"
  6668. },
  6669. {
  6670. "$ref": "#/components/schemas/Event.session.status"
  6671. },
  6672. {
  6673. "$ref": "#/components/schemas/Event.session.idle"
  6674. },
  6675. {
  6676. "$ref": "#/components/schemas/Event.session.compacted"
  6677. },
  6678. {
  6679. "$ref": "#/components/schemas/Event.file.edited"
  6680. },
  6681. {
  6682. "$ref": "#/components/schemas/Event.todo.updated"
  6683. },
  6684. {
  6685. "$ref": "#/components/schemas/Event.command.executed"
  6686. },
  6687. {
  6688. "$ref": "#/components/schemas/Event.session.created"
  6689. },
  6690. {
  6691. "$ref": "#/components/schemas/Event.session.updated"
  6692. },
  6693. {
  6694. "$ref": "#/components/schemas/Event.session.deleted"
  6695. },
  6696. {
  6697. "$ref": "#/components/schemas/Event.session.diff"
  6698. },
  6699. {
  6700. "$ref": "#/components/schemas/Event.session.error"
  6701. },
  6702. {
  6703. "$ref": "#/components/schemas/Event.file.watcher.updated"
  6704. },
  6705. {
  6706. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  6707. },
  6708. {
  6709. "$ref": "#/components/schemas/Event.tui.prompt.append"
  6710. },
  6711. {
  6712. "$ref": "#/components/schemas/Event.tui.command.execute"
  6713. },
  6714. {
  6715. "$ref": "#/components/schemas/Event.tui.toast.show"
  6716. },
  6717. {
  6718. "$ref": "#/components/schemas/Event.pty.created"
  6719. },
  6720. {
  6721. "$ref": "#/components/schemas/Event.pty.updated"
  6722. },
  6723. {
  6724. "$ref": "#/components/schemas/Event.pty.exited"
  6725. },
  6726. {
  6727. "$ref": "#/components/schemas/Event.pty.deleted"
  6728. },
  6729. {
  6730. "$ref": "#/components/schemas/Event.server.connected"
  6731. }
  6732. ]
  6733. },
  6734. "GlobalEvent": {
  6735. "type": "object",
  6736. "properties": {
  6737. "directory": {
  6738. "type": "string"
  6739. },
  6740. "payload": {
  6741. "$ref": "#/components/schemas/Event"
  6742. }
  6743. },
  6744. "required": ["directory", "payload"]
  6745. },
  6746. "Project": {
  6747. "type": "object",
  6748. "properties": {
  6749. "id": {
  6750. "type": "string"
  6751. },
  6752. "worktree": {
  6753. "type": "string"
  6754. },
  6755. "vcsDir": {
  6756. "type": "string"
  6757. },
  6758. "vcs": {
  6759. "type": "string",
  6760. "const": "git"
  6761. },
  6762. "time": {
  6763. "type": "object",
  6764. "properties": {
  6765. "created": {
  6766. "type": "number"
  6767. },
  6768. "initialized": {
  6769. "type": "number"
  6770. }
  6771. },
  6772. "required": ["created"]
  6773. }
  6774. },
  6775. "required": ["id", "worktree", "time"]
  6776. },
  6777. "BadRequestError": {
  6778. "type": "object",
  6779. "properties": {
  6780. "data": {},
  6781. "errors": {
  6782. "type": "array",
  6783. "items": {
  6784. "type": "object",
  6785. "propertyNames": {
  6786. "type": "string"
  6787. },
  6788. "additionalProperties": {}
  6789. }
  6790. },
  6791. "success": {
  6792. "type": "boolean",
  6793. "const": false
  6794. }
  6795. },
  6796. "required": ["data", "errors", "success"]
  6797. },
  6798. "NotFoundError": {
  6799. "type": "object",
  6800. "properties": {
  6801. "name": {
  6802. "type": "string",
  6803. "const": "NotFoundError"
  6804. },
  6805. "data": {
  6806. "type": "object",
  6807. "properties": {
  6808. "message": {
  6809. "type": "string"
  6810. }
  6811. },
  6812. "required": ["message"]
  6813. }
  6814. },
  6815. "required": ["name", "data"]
  6816. },
  6817. "KeybindsConfig": {
  6818. "description": "Custom keybind configurations",
  6819. "type": "object",
  6820. "properties": {
  6821. "leader": {
  6822. "description": "Leader key for keybind combinations",
  6823. "default": "ctrl+x",
  6824. "type": "string"
  6825. },
  6826. "app_exit": {
  6827. "description": "Exit the application",
  6828. "default": "ctrl+c,ctrl+d,<leader>q",
  6829. "type": "string"
  6830. },
  6831. "editor_open": {
  6832. "description": "Open external editor",
  6833. "default": "<leader>e",
  6834. "type": "string"
  6835. },
  6836. "theme_list": {
  6837. "description": "List available themes",
  6838. "default": "<leader>t",
  6839. "type": "string"
  6840. },
  6841. "sidebar_toggle": {
  6842. "description": "Toggle sidebar",
  6843. "default": "<leader>b",
  6844. "type": "string"
  6845. },
  6846. "scrollbar_toggle": {
  6847. "description": "Toggle session scrollbar",
  6848. "default": "none",
  6849. "type": "string"
  6850. },
  6851. "username_toggle": {
  6852. "description": "Toggle username visibility",
  6853. "default": "none",
  6854. "type": "string"
  6855. },
  6856. "status_view": {
  6857. "description": "View status",
  6858. "default": "<leader>s",
  6859. "type": "string"
  6860. },
  6861. "session_export": {
  6862. "description": "Export session to editor",
  6863. "default": "<leader>x",
  6864. "type": "string"
  6865. },
  6866. "session_new": {
  6867. "description": "Create a new session",
  6868. "default": "<leader>n",
  6869. "type": "string"
  6870. },
  6871. "session_list": {
  6872. "description": "List all sessions",
  6873. "default": "<leader>l",
  6874. "type": "string"
  6875. },
  6876. "session_timeline": {
  6877. "description": "Show session timeline",
  6878. "default": "<leader>g",
  6879. "type": "string"
  6880. },
  6881. "session_share": {
  6882. "description": "Share current session",
  6883. "default": "none",
  6884. "type": "string"
  6885. },
  6886. "session_unshare": {
  6887. "description": "Unshare current session",
  6888. "default": "none",
  6889. "type": "string"
  6890. },
  6891. "session_interrupt": {
  6892. "description": "Interrupt current session",
  6893. "default": "escape",
  6894. "type": "string"
  6895. },
  6896. "session_compact": {
  6897. "description": "Compact the session",
  6898. "default": "<leader>c",
  6899. "type": "string"
  6900. },
  6901. "messages_page_up": {
  6902. "description": "Scroll messages up by one page",
  6903. "default": "pageup",
  6904. "type": "string"
  6905. },
  6906. "messages_page_down": {
  6907. "description": "Scroll messages down by one page",
  6908. "default": "pagedown",
  6909. "type": "string"
  6910. },
  6911. "messages_half_page_up": {
  6912. "description": "Scroll messages up by half page",
  6913. "default": "ctrl+alt+u",
  6914. "type": "string"
  6915. },
  6916. "messages_half_page_down": {
  6917. "description": "Scroll messages down by half page",
  6918. "default": "ctrl+alt+d",
  6919. "type": "string"
  6920. },
  6921. "messages_first": {
  6922. "description": "Navigate to first message",
  6923. "default": "ctrl+g,home",
  6924. "type": "string"
  6925. },
  6926. "messages_last": {
  6927. "description": "Navigate to last message",
  6928. "default": "ctrl+alt+g,end",
  6929. "type": "string"
  6930. },
  6931. "messages_last_user": {
  6932. "description": "Navigate to last user message",
  6933. "default": "none",
  6934. "type": "string"
  6935. },
  6936. "messages_copy": {
  6937. "description": "Copy message",
  6938. "default": "<leader>y",
  6939. "type": "string"
  6940. },
  6941. "messages_undo": {
  6942. "description": "Undo message",
  6943. "default": "<leader>u",
  6944. "type": "string"
  6945. },
  6946. "messages_redo": {
  6947. "description": "Redo message",
  6948. "default": "<leader>r",
  6949. "type": "string"
  6950. },
  6951. "messages_toggle_conceal": {
  6952. "description": "Toggle code block concealment in messages",
  6953. "default": "<leader>h",
  6954. "type": "string"
  6955. },
  6956. "tool_details": {
  6957. "description": "Toggle tool details visibility",
  6958. "default": "none",
  6959. "type": "string"
  6960. },
  6961. "model_list": {
  6962. "description": "List available models",
  6963. "default": "<leader>m",
  6964. "type": "string"
  6965. },
  6966. "model_cycle_recent": {
  6967. "description": "Next recently used model",
  6968. "default": "f2",
  6969. "type": "string"
  6970. },
  6971. "model_cycle_recent_reverse": {
  6972. "description": "Previous recently used model",
  6973. "default": "shift+f2",
  6974. "type": "string"
  6975. },
  6976. "command_list": {
  6977. "description": "List available commands",
  6978. "default": "ctrl+p",
  6979. "type": "string"
  6980. },
  6981. "agent_list": {
  6982. "description": "List agents",
  6983. "default": "<leader>a",
  6984. "type": "string"
  6985. },
  6986. "agent_cycle": {
  6987. "description": "Next agent",
  6988. "default": "tab",
  6989. "type": "string"
  6990. },
  6991. "agent_cycle_reverse": {
  6992. "description": "Previous agent",
  6993. "default": "shift+tab",
  6994. "type": "string"
  6995. },
  6996. "input_clear": {
  6997. "description": "Clear input field",
  6998. "default": "ctrl+c",
  6999. "type": "string"
  7000. },
  7001. "input_forward_delete": {
  7002. "description": "Forward delete",
  7003. "default": "ctrl+d",
  7004. "type": "string"
  7005. },
  7006. "input_paste": {
  7007. "description": "Paste from clipboard",
  7008. "default": "ctrl+v",
  7009. "type": "string"
  7010. },
  7011. "input_submit": {
  7012. "description": "Submit input",
  7013. "default": "return",
  7014. "type": "string"
  7015. },
  7016. "input_newline": {
  7017. "description": "Insert newline in input",
  7018. "default": "shift+return,ctrl+j",
  7019. "type": "string"
  7020. },
  7021. "history_previous": {
  7022. "description": "Previous history item",
  7023. "default": "up",
  7024. "type": "string"
  7025. },
  7026. "history_next": {
  7027. "description": "Next history item",
  7028. "default": "down",
  7029. "type": "string"
  7030. },
  7031. "session_child_cycle": {
  7032. "description": "Next child session",
  7033. "default": "<leader>right",
  7034. "type": "string"
  7035. },
  7036. "session_child_cycle_reverse": {
  7037. "description": "Previous child session",
  7038. "default": "<leader>left",
  7039. "type": "string"
  7040. },
  7041. "terminal_suspend": {
  7042. "description": "Suspend terminal",
  7043. "default": "ctrl+z",
  7044. "type": "string"
  7045. }
  7046. },
  7047. "additionalProperties": false
  7048. },
  7049. "AgentConfig": {
  7050. "type": "object",
  7051. "properties": {
  7052. "model": {
  7053. "type": "string"
  7054. },
  7055. "temperature": {
  7056. "type": "number"
  7057. },
  7058. "top_p": {
  7059. "type": "number"
  7060. },
  7061. "prompt": {
  7062. "type": "string"
  7063. },
  7064. "tools": {
  7065. "type": "object",
  7066. "propertyNames": {
  7067. "type": "string"
  7068. },
  7069. "additionalProperties": {
  7070. "type": "boolean"
  7071. }
  7072. },
  7073. "disable": {
  7074. "type": "boolean"
  7075. },
  7076. "description": {
  7077. "description": "Description of when to use the agent",
  7078. "type": "string"
  7079. },
  7080. "mode": {
  7081. "type": "string",
  7082. "enum": ["subagent", "primary", "all"]
  7083. },
  7084. "color": {
  7085. "description": "Hex color code for the agent (e.g., #FF5733)",
  7086. "type": "string",
  7087. "pattern": "^#[0-9a-fA-F]{6}$"
  7088. },
  7089. "maxSteps": {
  7090. "description": "Maximum number of agentic iterations before forcing text-only response",
  7091. "type": "integer",
  7092. "exclusiveMinimum": 0,
  7093. "maximum": 9007199254740991
  7094. },
  7095. "permission": {
  7096. "type": "object",
  7097. "properties": {
  7098. "edit": {
  7099. "type": "string",
  7100. "enum": ["ask", "allow", "deny"]
  7101. },
  7102. "bash": {
  7103. "anyOf": [
  7104. {
  7105. "type": "string",
  7106. "enum": ["ask", "allow", "deny"]
  7107. },
  7108. {
  7109. "type": "object",
  7110. "propertyNames": {
  7111. "type": "string"
  7112. },
  7113. "additionalProperties": {
  7114. "type": "string",
  7115. "enum": ["ask", "allow", "deny"]
  7116. }
  7117. }
  7118. ]
  7119. },
  7120. "webfetch": {
  7121. "type": "string",
  7122. "enum": ["ask", "allow", "deny"]
  7123. },
  7124. "doom_loop": {
  7125. "type": "string",
  7126. "enum": ["ask", "allow", "deny"]
  7127. },
  7128. "external_directory": {
  7129. "type": "string",
  7130. "enum": ["ask", "allow", "deny"]
  7131. }
  7132. }
  7133. }
  7134. },
  7135. "additionalProperties": {}
  7136. },
  7137. "ProviderConfig": {
  7138. "type": "object",
  7139. "properties": {
  7140. "api": {
  7141. "type": "string"
  7142. },
  7143. "name": {
  7144. "type": "string"
  7145. },
  7146. "env": {
  7147. "type": "array",
  7148. "items": {
  7149. "type": "string"
  7150. }
  7151. },
  7152. "id": {
  7153. "type": "string"
  7154. },
  7155. "npm": {
  7156. "type": "string"
  7157. },
  7158. "models": {
  7159. "type": "object",
  7160. "propertyNames": {
  7161. "type": "string"
  7162. },
  7163. "additionalProperties": {
  7164. "type": "object",
  7165. "properties": {
  7166. "id": {
  7167. "type": "string"
  7168. },
  7169. "name": {
  7170. "type": "string"
  7171. },
  7172. "release_date": {
  7173. "type": "string"
  7174. },
  7175. "attachment": {
  7176. "type": "boolean"
  7177. },
  7178. "reasoning": {
  7179. "type": "boolean"
  7180. },
  7181. "temperature": {
  7182. "type": "boolean"
  7183. },
  7184. "tool_call": {
  7185. "type": "boolean"
  7186. },
  7187. "cost": {
  7188. "type": "object",
  7189. "properties": {
  7190. "input": {
  7191. "type": "number"
  7192. },
  7193. "output": {
  7194. "type": "number"
  7195. },
  7196. "cache_read": {
  7197. "type": "number"
  7198. },
  7199. "cache_write": {
  7200. "type": "number"
  7201. },
  7202. "context_over_200k": {
  7203. "type": "object",
  7204. "properties": {
  7205. "input": {
  7206. "type": "number"
  7207. },
  7208. "output": {
  7209. "type": "number"
  7210. },
  7211. "cache_read": {
  7212. "type": "number"
  7213. },
  7214. "cache_write": {
  7215. "type": "number"
  7216. }
  7217. },
  7218. "required": ["input", "output"]
  7219. }
  7220. },
  7221. "required": ["input", "output"]
  7222. },
  7223. "limit": {
  7224. "type": "object",
  7225. "properties": {
  7226. "context": {
  7227. "type": "number"
  7228. },
  7229. "output": {
  7230. "type": "number"
  7231. }
  7232. },
  7233. "required": ["context", "output"]
  7234. },
  7235. "modalities": {
  7236. "type": "object",
  7237. "properties": {
  7238. "input": {
  7239. "type": "array",
  7240. "items": {
  7241. "type": "string",
  7242. "enum": ["text", "audio", "image", "video", "pdf"]
  7243. }
  7244. },
  7245. "output": {
  7246. "type": "array",
  7247. "items": {
  7248. "type": "string",
  7249. "enum": ["text", "audio", "image", "video", "pdf"]
  7250. }
  7251. }
  7252. },
  7253. "required": ["input", "output"]
  7254. },
  7255. "experimental": {
  7256. "type": "boolean"
  7257. },
  7258. "status": {
  7259. "type": "string",
  7260. "enum": ["alpha", "beta", "deprecated"]
  7261. },
  7262. "options": {
  7263. "type": "object",
  7264. "propertyNames": {
  7265. "type": "string"
  7266. },
  7267. "additionalProperties": {}
  7268. },
  7269. "headers": {
  7270. "type": "object",
  7271. "propertyNames": {
  7272. "type": "string"
  7273. },
  7274. "additionalProperties": {
  7275. "type": "string"
  7276. }
  7277. },
  7278. "provider": {
  7279. "type": "object",
  7280. "properties": {
  7281. "npm": {
  7282. "type": "string"
  7283. }
  7284. },
  7285. "required": ["npm"]
  7286. }
  7287. }
  7288. }
  7289. },
  7290. "whitelist": {
  7291. "type": "array",
  7292. "items": {
  7293. "type": "string"
  7294. }
  7295. },
  7296. "blacklist": {
  7297. "type": "array",
  7298. "items": {
  7299. "type": "string"
  7300. }
  7301. },
  7302. "options": {
  7303. "type": "object",
  7304. "properties": {
  7305. "apiKey": {
  7306. "type": "string"
  7307. },
  7308. "baseURL": {
  7309. "type": "string"
  7310. },
  7311. "enterpriseUrl": {
  7312. "description": "GitHub Enterprise URL for copilot authentication",
  7313. "type": "string"
  7314. },
  7315. "setCacheKey": {
  7316. "description": "Enable promptCacheKey for this provider (default false)",
  7317. "type": "boolean"
  7318. },
  7319. "timeout": {
  7320. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  7321. "anyOf": [
  7322. {
  7323. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  7324. "type": "integer",
  7325. "exclusiveMinimum": 0,
  7326. "maximum": 9007199254740991
  7327. },
  7328. {
  7329. "description": "Disable timeout for this provider entirely.",
  7330. "type": "boolean",
  7331. "const": false
  7332. }
  7333. ]
  7334. }
  7335. },
  7336. "additionalProperties": {}
  7337. }
  7338. },
  7339. "additionalProperties": false
  7340. },
  7341. "McpLocalConfig": {
  7342. "type": "object",
  7343. "properties": {
  7344. "type": {
  7345. "description": "Type of MCP server connection",
  7346. "type": "string",
  7347. "const": "local"
  7348. },
  7349. "command": {
  7350. "description": "Command and arguments to run the MCP server",
  7351. "type": "array",
  7352. "items": {
  7353. "type": "string"
  7354. }
  7355. },
  7356. "environment": {
  7357. "description": "Environment variables to set when running the MCP server",
  7358. "type": "object",
  7359. "propertyNames": {
  7360. "type": "string"
  7361. },
  7362. "additionalProperties": {
  7363. "type": "string"
  7364. }
  7365. },
  7366. "enabled": {
  7367. "description": "Enable or disable the MCP server on startup",
  7368. "type": "boolean"
  7369. },
  7370. "timeout": {
  7371. "description": "Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.",
  7372. "type": "integer",
  7373. "exclusiveMinimum": 0,
  7374. "maximum": 9007199254740991
  7375. }
  7376. },
  7377. "required": ["type", "command"],
  7378. "additionalProperties": false
  7379. },
  7380. "McpOAuthConfig": {
  7381. "type": "object",
  7382. "properties": {
  7383. "clientId": {
  7384. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  7385. "type": "string"
  7386. },
  7387. "clientSecret": {
  7388. "description": "OAuth client secret (if required by the authorization server)",
  7389. "type": "string"
  7390. },
  7391. "scope": {
  7392. "description": "OAuth scopes to request during authorization",
  7393. "type": "string"
  7394. }
  7395. },
  7396. "additionalProperties": false
  7397. },
  7398. "McpRemoteConfig": {
  7399. "type": "object",
  7400. "properties": {
  7401. "type": {
  7402. "description": "Type of MCP server connection",
  7403. "type": "string",
  7404. "const": "remote"
  7405. },
  7406. "url": {
  7407. "description": "URL of the remote MCP server",
  7408. "type": "string"
  7409. },
  7410. "enabled": {
  7411. "description": "Enable or disable the MCP server on startup",
  7412. "type": "boolean"
  7413. },
  7414. "headers": {
  7415. "description": "Headers to send with the request",
  7416. "type": "object",
  7417. "propertyNames": {
  7418. "type": "string"
  7419. },
  7420. "additionalProperties": {
  7421. "type": "string"
  7422. }
  7423. },
  7424. "oauth": {
  7425. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  7426. "anyOf": [
  7427. {
  7428. "$ref": "#/components/schemas/McpOAuthConfig"
  7429. },
  7430. {
  7431. "type": "boolean",
  7432. "const": false
  7433. }
  7434. ]
  7435. },
  7436. "timeout": {
  7437. "description": "Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.",
  7438. "type": "integer",
  7439. "exclusiveMinimum": 0,
  7440. "maximum": 9007199254740991
  7441. }
  7442. },
  7443. "required": ["type", "url"],
  7444. "additionalProperties": false
  7445. },
  7446. "LayoutConfig": {
  7447. "description": "@deprecated Always uses stretch layout.",
  7448. "type": "string",
  7449. "enum": ["auto", "stretch"]
  7450. },
  7451. "Config": {
  7452. "type": "object",
  7453. "properties": {
  7454. "$schema": {
  7455. "description": "JSON schema reference for configuration validation",
  7456. "type": "string"
  7457. },
  7458. "theme": {
  7459. "description": "Theme name to use for the interface",
  7460. "type": "string"
  7461. },
  7462. "keybinds": {
  7463. "$ref": "#/components/schemas/KeybindsConfig"
  7464. },
  7465. "tui": {
  7466. "description": "TUI specific settings",
  7467. "type": "object",
  7468. "properties": {
  7469. "scroll_speed": {
  7470. "description": "TUI scroll speed",
  7471. "type": "number",
  7472. "minimum": 0.001
  7473. },
  7474. "scroll_acceleration": {
  7475. "description": "Scroll acceleration settings",
  7476. "type": "object",
  7477. "properties": {
  7478. "enabled": {
  7479. "description": "Enable scroll acceleration",
  7480. "type": "boolean"
  7481. }
  7482. },
  7483. "required": ["enabled"]
  7484. },
  7485. "diff_style": {
  7486. "description": "Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column",
  7487. "type": "string",
  7488. "enum": ["auto", "stacked"]
  7489. }
  7490. }
  7491. },
  7492. "command": {
  7493. "description": "Command configuration, see https://opencode.ai/docs/commands",
  7494. "type": "object",
  7495. "propertyNames": {
  7496. "type": "string"
  7497. },
  7498. "additionalProperties": {
  7499. "type": "object",
  7500. "properties": {
  7501. "template": {
  7502. "type": "string"
  7503. },
  7504. "description": {
  7505. "type": "string"
  7506. },
  7507. "agent": {
  7508. "type": "string"
  7509. },
  7510. "model": {
  7511. "type": "string"
  7512. },
  7513. "subtask": {
  7514. "type": "boolean"
  7515. }
  7516. },
  7517. "required": ["template"]
  7518. }
  7519. },
  7520. "watcher": {
  7521. "type": "object",
  7522. "properties": {
  7523. "ignore": {
  7524. "type": "array",
  7525. "items": {
  7526. "type": "string"
  7527. }
  7528. }
  7529. }
  7530. },
  7531. "plugin": {
  7532. "type": "array",
  7533. "items": {
  7534. "type": "string"
  7535. }
  7536. },
  7537. "snapshot": {
  7538. "type": "boolean"
  7539. },
  7540. "share": {
  7541. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  7542. "type": "string",
  7543. "enum": ["manual", "auto", "disabled"]
  7544. },
  7545. "autoshare": {
  7546. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  7547. "type": "boolean"
  7548. },
  7549. "autoupdate": {
  7550. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  7551. "anyOf": [
  7552. {
  7553. "type": "boolean"
  7554. },
  7555. {
  7556. "type": "string",
  7557. "const": "notify"
  7558. }
  7559. ]
  7560. },
  7561. "disabled_providers": {
  7562. "description": "Disable providers that are loaded automatically",
  7563. "type": "array",
  7564. "items": {
  7565. "type": "string"
  7566. }
  7567. },
  7568. "enabled_providers": {
  7569. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  7570. "type": "array",
  7571. "items": {
  7572. "type": "string"
  7573. }
  7574. },
  7575. "model": {
  7576. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  7577. "type": "string"
  7578. },
  7579. "small_model": {
  7580. "description": "Small model to use for tasks like title generation in the format of provider/model",
  7581. "type": "string"
  7582. },
  7583. "username": {
  7584. "description": "Custom username to display in conversations instead of system username",
  7585. "type": "string"
  7586. },
  7587. "mode": {
  7588. "description": "@deprecated Use `agent` field instead.",
  7589. "type": "object",
  7590. "properties": {
  7591. "build": {
  7592. "$ref": "#/components/schemas/AgentConfig"
  7593. },
  7594. "plan": {
  7595. "$ref": "#/components/schemas/AgentConfig"
  7596. }
  7597. },
  7598. "additionalProperties": {
  7599. "$ref": "#/components/schemas/AgentConfig"
  7600. }
  7601. },
  7602. "agent": {
  7603. "description": "Agent configuration, see https://opencode.ai/docs/agent",
  7604. "type": "object",
  7605. "properties": {
  7606. "plan": {
  7607. "$ref": "#/components/schemas/AgentConfig"
  7608. },
  7609. "build": {
  7610. "$ref": "#/components/schemas/AgentConfig"
  7611. },
  7612. "general": {
  7613. "$ref": "#/components/schemas/AgentConfig"
  7614. },
  7615. "explore": {
  7616. "$ref": "#/components/schemas/AgentConfig"
  7617. }
  7618. },
  7619. "additionalProperties": {
  7620. "$ref": "#/components/schemas/AgentConfig"
  7621. }
  7622. },
  7623. "provider": {
  7624. "description": "Custom provider configurations and model overrides",
  7625. "type": "object",
  7626. "propertyNames": {
  7627. "type": "string"
  7628. },
  7629. "additionalProperties": {
  7630. "$ref": "#/components/schemas/ProviderConfig"
  7631. }
  7632. },
  7633. "mcp": {
  7634. "description": "MCP (Model Context Protocol) server configurations",
  7635. "type": "object",
  7636. "propertyNames": {
  7637. "type": "string"
  7638. },
  7639. "additionalProperties": {
  7640. "anyOf": [
  7641. {
  7642. "$ref": "#/components/schemas/McpLocalConfig"
  7643. },
  7644. {
  7645. "$ref": "#/components/schemas/McpRemoteConfig"
  7646. }
  7647. ]
  7648. }
  7649. },
  7650. "formatter": {
  7651. "anyOf": [
  7652. {
  7653. "type": "boolean",
  7654. "const": false
  7655. },
  7656. {
  7657. "type": "object",
  7658. "propertyNames": {
  7659. "type": "string"
  7660. },
  7661. "additionalProperties": {
  7662. "type": "object",
  7663. "properties": {
  7664. "disabled": {
  7665. "type": "boolean"
  7666. },
  7667. "command": {
  7668. "type": "array",
  7669. "items": {
  7670. "type": "string"
  7671. }
  7672. },
  7673. "environment": {
  7674. "type": "object",
  7675. "propertyNames": {
  7676. "type": "string"
  7677. },
  7678. "additionalProperties": {
  7679. "type": "string"
  7680. }
  7681. },
  7682. "extensions": {
  7683. "type": "array",
  7684. "items": {
  7685. "type": "string"
  7686. }
  7687. }
  7688. }
  7689. }
  7690. }
  7691. ]
  7692. },
  7693. "lsp": {
  7694. "anyOf": [
  7695. {
  7696. "type": "boolean",
  7697. "const": false
  7698. },
  7699. {
  7700. "type": "object",
  7701. "propertyNames": {
  7702. "type": "string"
  7703. },
  7704. "additionalProperties": {
  7705. "anyOf": [
  7706. {
  7707. "type": "object",
  7708. "properties": {
  7709. "disabled": {
  7710. "type": "boolean",
  7711. "const": true
  7712. }
  7713. },
  7714. "required": ["disabled"]
  7715. },
  7716. {
  7717. "type": "object",
  7718. "properties": {
  7719. "command": {
  7720. "type": "array",
  7721. "items": {
  7722. "type": "string"
  7723. }
  7724. },
  7725. "extensions": {
  7726. "type": "array",
  7727. "items": {
  7728. "type": "string"
  7729. }
  7730. },
  7731. "disabled": {
  7732. "type": "boolean"
  7733. },
  7734. "env": {
  7735. "type": "object",
  7736. "propertyNames": {
  7737. "type": "string"
  7738. },
  7739. "additionalProperties": {
  7740. "type": "string"
  7741. }
  7742. },
  7743. "initialization": {
  7744. "type": "object",
  7745. "propertyNames": {
  7746. "type": "string"
  7747. },
  7748. "additionalProperties": {}
  7749. }
  7750. },
  7751. "required": ["command"]
  7752. }
  7753. ]
  7754. }
  7755. }
  7756. ]
  7757. },
  7758. "instructions": {
  7759. "description": "Additional instruction files or patterns to include",
  7760. "type": "array",
  7761. "items": {
  7762. "type": "string"
  7763. }
  7764. },
  7765. "layout": {
  7766. "$ref": "#/components/schemas/LayoutConfig"
  7767. },
  7768. "permission": {
  7769. "type": "object",
  7770. "properties": {
  7771. "edit": {
  7772. "type": "string",
  7773. "enum": ["ask", "allow", "deny"]
  7774. },
  7775. "bash": {
  7776. "anyOf": [
  7777. {
  7778. "type": "string",
  7779. "enum": ["ask", "allow", "deny"]
  7780. },
  7781. {
  7782. "type": "object",
  7783. "propertyNames": {
  7784. "type": "string"
  7785. },
  7786. "additionalProperties": {
  7787. "type": "string",
  7788. "enum": ["ask", "allow", "deny"]
  7789. }
  7790. }
  7791. ]
  7792. },
  7793. "webfetch": {
  7794. "type": "string",
  7795. "enum": ["ask", "allow", "deny"]
  7796. },
  7797. "doom_loop": {
  7798. "type": "string",
  7799. "enum": ["ask", "allow", "deny"]
  7800. },
  7801. "external_directory": {
  7802. "type": "string",
  7803. "enum": ["ask", "allow", "deny"]
  7804. }
  7805. }
  7806. },
  7807. "tools": {
  7808. "type": "object",
  7809. "propertyNames": {
  7810. "type": "string"
  7811. },
  7812. "additionalProperties": {
  7813. "type": "boolean"
  7814. }
  7815. },
  7816. "enterprise": {
  7817. "type": "object",
  7818. "properties": {
  7819. "url": {
  7820. "description": "Enterprise URL",
  7821. "type": "string"
  7822. }
  7823. }
  7824. },
  7825. "experimental": {
  7826. "type": "object",
  7827. "properties": {
  7828. "hook": {
  7829. "type": "object",
  7830. "properties": {
  7831. "file_edited": {
  7832. "type": "object",
  7833. "propertyNames": {
  7834. "type": "string"
  7835. },
  7836. "additionalProperties": {
  7837. "type": "array",
  7838. "items": {
  7839. "type": "object",
  7840. "properties": {
  7841. "command": {
  7842. "type": "array",
  7843. "items": {
  7844. "type": "string"
  7845. }
  7846. },
  7847. "environment": {
  7848. "type": "object",
  7849. "propertyNames": {
  7850. "type": "string"
  7851. },
  7852. "additionalProperties": {
  7853. "type": "string"
  7854. }
  7855. }
  7856. },
  7857. "required": ["command"]
  7858. }
  7859. }
  7860. },
  7861. "session_completed": {
  7862. "type": "array",
  7863. "items": {
  7864. "type": "object",
  7865. "properties": {
  7866. "command": {
  7867. "type": "array",
  7868. "items": {
  7869. "type": "string"
  7870. }
  7871. },
  7872. "environment": {
  7873. "type": "object",
  7874. "propertyNames": {
  7875. "type": "string"
  7876. },
  7877. "additionalProperties": {
  7878. "type": "string"
  7879. }
  7880. }
  7881. },
  7882. "required": ["command"]
  7883. }
  7884. }
  7885. }
  7886. },
  7887. "chatMaxRetries": {
  7888. "description": "Number of retries for chat completions on failure",
  7889. "type": "number"
  7890. },
  7891. "disable_paste_summary": {
  7892. "type": "boolean"
  7893. },
  7894. "batch_tool": {
  7895. "description": "Enable the batch tool",
  7896. "type": "boolean"
  7897. },
  7898. "openTelemetry": {
  7899. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  7900. "type": "boolean"
  7901. },
  7902. "primary_tools": {
  7903. "description": "Tools that should only be available to primary agents.",
  7904. "type": "array",
  7905. "items": {
  7906. "type": "string"
  7907. }
  7908. }
  7909. }
  7910. }
  7911. },
  7912. "additionalProperties": false
  7913. },
  7914. "ToolIDs": {
  7915. "type": "array",
  7916. "items": {
  7917. "type": "string"
  7918. }
  7919. },
  7920. "ToolListItem": {
  7921. "type": "object",
  7922. "properties": {
  7923. "id": {
  7924. "type": "string"
  7925. },
  7926. "description": {
  7927. "type": "string"
  7928. },
  7929. "parameters": {}
  7930. },
  7931. "required": ["id", "description", "parameters"]
  7932. },
  7933. "ToolList": {
  7934. "type": "array",
  7935. "items": {
  7936. "$ref": "#/components/schemas/ToolListItem"
  7937. }
  7938. },
  7939. "Path": {
  7940. "type": "object",
  7941. "properties": {
  7942. "state": {
  7943. "type": "string"
  7944. },
  7945. "config": {
  7946. "type": "string"
  7947. },
  7948. "worktree": {
  7949. "type": "string"
  7950. },
  7951. "directory": {
  7952. "type": "string"
  7953. }
  7954. },
  7955. "required": ["state", "config", "worktree", "directory"]
  7956. },
  7957. "VcsInfo": {
  7958. "type": "object",
  7959. "properties": {
  7960. "branch": {
  7961. "type": "string"
  7962. }
  7963. },
  7964. "required": ["branch"]
  7965. },
  7966. "TextPartInput": {
  7967. "type": "object",
  7968. "properties": {
  7969. "id": {
  7970. "type": "string"
  7971. },
  7972. "type": {
  7973. "type": "string",
  7974. "const": "text"
  7975. },
  7976. "text": {
  7977. "type": "string"
  7978. },
  7979. "synthetic": {
  7980. "type": "boolean"
  7981. },
  7982. "ignored": {
  7983. "type": "boolean"
  7984. },
  7985. "time": {
  7986. "type": "object",
  7987. "properties": {
  7988. "start": {
  7989. "type": "number"
  7990. },
  7991. "end": {
  7992. "type": "number"
  7993. }
  7994. },
  7995. "required": ["start"]
  7996. },
  7997. "metadata": {
  7998. "type": "object",
  7999. "propertyNames": {
  8000. "type": "string"
  8001. },
  8002. "additionalProperties": {}
  8003. }
  8004. },
  8005. "required": ["type", "text"]
  8006. },
  8007. "FilePartInput": {
  8008. "type": "object",
  8009. "properties": {
  8010. "id": {
  8011. "type": "string"
  8012. },
  8013. "type": {
  8014. "type": "string",
  8015. "const": "file"
  8016. },
  8017. "mime": {
  8018. "type": "string"
  8019. },
  8020. "filename": {
  8021. "type": "string"
  8022. },
  8023. "url": {
  8024. "type": "string"
  8025. },
  8026. "source": {
  8027. "$ref": "#/components/schemas/FilePartSource"
  8028. }
  8029. },
  8030. "required": ["type", "mime", "url"]
  8031. },
  8032. "AgentPartInput": {
  8033. "type": "object",
  8034. "properties": {
  8035. "id": {
  8036. "type": "string"
  8037. },
  8038. "type": {
  8039. "type": "string",
  8040. "const": "agent"
  8041. },
  8042. "name": {
  8043. "type": "string"
  8044. },
  8045. "source": {
  8046. "type": "object",
  8047. "properties": {
  8048. "value": {
  8049. "type": "string"
  8050. },
  8051. "start": {
  8052. "type": "integer",
  8053. "minimum": -9007199254740991,
  8054. "maximum": 9007199254740991
  8055. },
  8056. "end": {
  8057. "type": "integer",
  8058. "minimum": -9007199254740991,
  8059. "maximum": 9007199254740991
  8060. }
  8061. },
  8062. "required": ["value", "start", "end"]
  8063. }
  8064. },
  8065. "required": ["type", "name"]
  8066. },
  8067. "SubtaskPartInput": {
  8068. "type": "object",
  8069. "properties": {
  8070. "id": {
  8071. "type": "string"
  8072. },
  8073. "type": {
  8074. "type": "string",
  8075. "const": "subtask"
  8076. },
  8077. "prompt": {
  8078. "type": "string"
  8079. },
  8080. "description": {
  8081. "type": "string"
  8082. },
  8083. "agent": {
  8084. "type": "string"
  8085. }
  8086. },
  8087. "required": ["type", "prompt", "description", "agent"]
  8088. },
  8089. "Command": {
  8090. "type": "object",
  8091. "properties": {
  8092. "name": {
  8093. "type": "string"
  8094. },
  8095. "description": {
  8096. "type": "string"
  8097. },
  8098. "agent": {
  8099. "type": "string"
  8100. },
  8101. "model": {
  8102. "type": "string"
  8103. },
  8104. "template": {
  8105. "type": "string"
  8106. },
  8107. "subtask": {
  8108. "type": "boolean"
  8109. }
  8110. },
  8111. "required": ["name", "template"]
  8112. },
  8113. "Model": {
  8114. "type": "object",
  8115. "properties": {
  8116. "id": {
  8117. "type": "string"
  8118. },
  8119. "providerID": {
  8120. "type": "string"
  8121. },
  8122. "api": {
  8123. "type": "object",
  8124. "properties": {
  8125. "id": {
  8126. "type": "string"
  8127. },
  8128. "url": {
  8129. "type": "string"
  8130. },
  8131. "npm": {
  8132. "type": "string"
  8133. }
  8134. },
  8135. "required": ["id", "url", "npm"]
  8136. },
  8137. "name": {
  8138. "type": "string"
  8139. },
  8140. "capabilities": {
  8141. "type": "object",
  8142. "properties": {
  8143. "temperature": {
  8144. "type": "boolean"
  8145. },
  8146. "reasoning": {
  8147. "type": "boolean"
  8148. },
  8149. "attachment": {
  8150. "type": "boolean"
  8151. },
  8152. "toolcall": {
  8153. "type": "boolean"
  8154. },
  8155. "input": {
  8156. "type": "object",
  8157. "properties": {
  8158. "text": {
  8159. "type": "boolean"
  8160. },
  8161. "audio": {
  8162. "type": "boolean"
  8163. },
  8164. "image": {
  8165. "type": "boolean"
  8166. },
  8167. "video": {
  8168. "type": "boolean"
  8169. },
  8170. "pdf": {
  8171. "type": "boolean"
  8172. }
  8173. },
  8174. "required": ["text", "audio", "image", "video", "pdf"]
  8175. },
  8176. "output": {
  8177. "type": "object",
  8178. "properties": {
  8179. "text": {
  8180. "type": "boolean"
  8181. },
  8182. "audio": {
  8183. "type": "boolean"
  8184. },
  8185. "image": {
  8186. "type": "boolean"
  8187. },
  8188. "video": {
  8189. "type": "boolean"
  8190. },
  8191. "pdf": {
  8192. "type": "boolean"
  8193. }
  8194. },
  8195. "required": ["text", "audio", "image", "video", "pdf"]
  8196. }
  8197. },
  8198. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output"]
  8199. },
  8200. "cost": {
  8201. "type": "object",
  8202. "properties": {
  8203. "input": {
  8204. "type": "number"
  8205. },
  8206. "output": {
  8207. "type": "number"
  8208. },
  8209. "cache": {
  8210. "type": "object",
  8211. "properties": {
  8212. "read": {
  8213. "type": "number"
  8214. },
  8215. "write": {
  8216. "type": "number"
  8217. }
  8218. },
  8219. "required": ["read", "write"]
  8220. },
  8221. "experimentalOver200K": {
  8222. "type": "object",
  8223. "properties": {
  8224. "input": {
  8225. "type": "number"
  8226. },
  8227. "output": {
  8228. "type": "number"
  8229. },
  8230. "cache": {
  8231. "type": "object",
  8232. "properties": {
  8233. "read": {
  8234. "type": "number"
  8235. },
  8236. "write": {
  8237. "type": "number"
  8238. }
  8239. },
  8240. "required": ["read", "write"]
  8241. }
  8242. },
  8243. "required": ["input", "output", "cache"]
  8244. }
  8245. },
  8246. "required": ["input", "output", "cache"]
  8247. },
  8248. "limit": {
  8249. "type": "object",
  8250. "properties": {
  8251. "context": {
  8252. "type": "number"
  8253. },
  8254. "output": {
  8255. "type": "number"
  8256. }
  8257. },
  8258. "required": ["context", "output"]
  8259. },
  8260. "status": {
  8261. "type": "string",
  8262. "enum": ["alpha", "beta", "deprecated", "active"]
  8263. },
  8264. "options": {
  8265. "type": "object",
  8266. "propertyNames": {
  8267. "type": "string"
  8268. },
  8269. "additionalProperties": {}
  8270. },
  8271. "headers": {
  8272. "type": "object",
  8273. "propertyNames": {
  8274. "type": "string"
  8275. },
  8276. "additionalProperties": {
  8277. "type": "string"
  8278. }
  8279. }
  8280. },
  8281. "required": ["id", "providerID", "api", "name", "capabilities", "cost", "limit", "status", "options", "headers"]
  8282. },
  8283. "Provider": {
  8284. "type": "object",
  8285. "properties": {
  8286. "id": {
  8287. "type": "string"
  8288. },
  8289. "name": {
  8290. "type": "string"
  8291. },
  8292. "source": {
  8293. "type": "string",
  8294. "enum": ["env", "config", "custom", "api"]
  8295. },
  8296. "env": {
  8297. "type": "array",
  8298. "items": {
  8299. "type": "string"
  8300. }
  8301. },
  8302. "key": {
  8303. "type": "string"
  8304. },
  8305. "options": {
  8306. "type": "object",
  8307. "propertyNames": {
  8308. "type": "string"
  8309. },
  8310. "additionalProperties": {}
  8311. },
  8312. "models": {
  8313. "type": "object",
  8314. "propertyNames": {
  8315. "type": "string"
  8316. },
  8317. "additionalProperties": {
  8318. "$ref": "#/components/schemas/Model"
  8319. }
  8320. }
  8321. },
  8322. "required": ["id", "name", "source", "env", "options", "models"]
  8323. },
  8324. "ProviderAuthMethod": {
  8325. "type": "object",
  8326. "properties": {
  8327. "type": {
  8328. "anyOf": [
  8329. {
  8330. "type": "string",
  8331. "const": "oauth"
  8332. },
  8333. {
  8334. "type": "string",
  8335. "const": "api"
  8336. }
  8337. ]
  8338. },
  8339. "label": {
  8340. "type": "string"
  8341. }
  8342. },
  8343. "required": ["type", "label"]
  8344. },
  8345. "ProviderAuthAuthorization": {
  8346. "type": "object",
  8347. "properties": {
  8348. "url": {
  8349. "type": "string"
  8350. },
  8351. "method": {
  8352. "anyOf": [
  8353. {
  8354. "type": "string",
  8355. "const": "auto"
  8356. },
  8357. {
  8358. "type": "string",
  8359. "const": "code"
  8360. }
  8361. ]
  8362. },
  8363. "instructions": {
  8364. "type": "string"
  8365. }
  8366. },
  8367. "required": ["url", "method", "instructions"]
  8368. },
  8369. "Symbol": {
  8370. "type": "object",
  8371. "properties": {
  8372. "name": {
  8373. "type": "string"
  8374. },
  8375. "kind": {
  8376. "type": "number"
  8377. },
  8378. "location": {
  8379. "type": "object",
  8380. "properties": {
  8381. "uri": {
  8382. "type": "string"
  8383. },
  8384. "range": {
  8385. "$ref": "#/components/schemas/Range"
  8386. }
  8387. },
  8388. "required": ["uri", "range"]
  8389. }
  8390. },
  8391. "required": ["name", "kind", "location"]
  8392. },
  8393. "FileNode": {
  8394. "type": "object",
  8395. "properties": {
  8396. "name": {
  8397. "type": "string"
  8398. },
  8399. "path": {
  8400. "type": "string"
  8401. },
  8402. "absolute": {
  8403. "type": "string"
  8404. },
  8405. "type": {
  8406. "type": "string",
  8407. "enum": ["file", "directory"]
  8408. },
  8409. "ignored": {
  8410. "type": "boolean"
  8411. }
  8412. },
  8413. "required": ["name", "path", "absolute", "type", "ignored"]
  8414. },
  8415. "FileContent": {
  8416. "type": "object",
  8417. "properties": {
  8418. "type": {
  8419. "type": "string",
  8420. "const": "text"
  8421. },
  8422. "content": {
  8423. "type": "string"
  8424. },
  8425. "diff": {
  8426. "type": "string"
  8427. },
  8428. "patch": {
  8429. "type": "object",
  8430. "properties": {
  8431. "oldFileName": {
  8432. "type": "string"
  8433. },
  8434. "newFileName": {
  8435. "type": "string"
  8436. },
  8437. "oldHeader": {
  8438. "type": "string"
  8439. },
  8440. "newHeader": {
  8441. "type": "string"
  8442. },
  8443. "hunks": {
  8444. "type": "array",
  8445. "items": {
  8446. "type": "object",
  8447. "properties": {
  8448. "oldStart": {
  8449. "type": "number"
  8450. },
  8451. "oldLines": {
  8452. "type": "number"
  8453. },
  8454. "newStart": {
  8455. "type": "number"
  8456. },
  8457. "newLines": {
  8458. "type": "number"
  8459. },
  8460. "lines": {
  8461. "type": "array",
  8462. "items": {
  8463. "type": "string"
  8464. }
  8465. }
  8466. },
  8467. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  8468. }
  8469. },
  8470. "index": {
  8471. "type": "string"
  8472. }
  8473. },
  8474. "required": ["oldFileName", "newFileName", "hunks"]
  8475. },
  8476. "encoding": {
  8477. "type": "string",
  8478. "const": "base64"
  8479. },
  8480. "mimeType": {
  8481. "type": "string"
  8482. }
  8483. },
  8484. "required": ["type", "content"]
  8485. },
  8486. "File": {
  8487. "type": "object",
  8488. "properties": {
  8489. "path": {
  8490. "type": "string"
  8491. },
  8492. "added": {
  8493. "type": "integer",
  8494. "minimum": -9007199254740991,
  8495. "maximum": 9007199254740991
  8496. },
  8497. "removed": {
  8498. "type": "integer",
  8499. "minimum": -9007199254740991,
  8500. "maximum": 9007199254740991
  8501. },
  8502. "status": {
  8503. "type": "string",
  8504. "enum": ["added", "deleted", "modified"]
  8505. }
  8506. },
  8507. "required": ["path", "added", "removed", "status"]
  8508. },
  8509. "Agent": {
  8510. "type": "object",
  8511. "properties": {
  8512. "name": {
  8513. "type": "string"
  8514. },
  8515. "description": {
  8516. "type": "string"
  8517. },
  8518. "mode": {
  8519. "type": "string",
  8520. "enum": ["subagent", "primary", "all"]
  8521. },
  8522. "builtIn": {
  8523. "type": "boolean"
  8524. },
  8525. "topP": {
  8526. "type": "number"
  8527. },
  8528. "temperature": {
  8529. "type": "number"
  8530. },
  8531. "color": {
  8532. "type": "string"
  8533. },
  8534. "permission": {
  8535. "type": "object",
  8536. "properties": {
  8537. "edit": {
  8538. "type": "string",
  8539. "enum": ["ask", "allow", "deny"]
  8540. },
  8541. "bash": {
  8542. "type": "object",
  8543. "propertyNames": {
  8544. "type": "string"
  8545. },
  8546. "additionalProperties": {
  8547. "type": "string",
  8548. "enum": ["ask", "allow", "deny"]
  8549. }
  8550. },
  8551. "webfetch": {
  8552. "type": "string",
  8553. "enum": ["ask", "allow", "deny"]
  8554. },
  8555. "doom_loop": {
  8556. "type": "string",
  8557. "enum": ["ask", "allow", "deny"]
  8558. },
  8559. "external_directory": {
  8560. "type": "string",
  8561. "enum": ["ask", "allow", "deny"]
  8562. }
  8563. },
  8564. "required": ["edit", "bash"]
  8565. },
  8566. "model": {
  8567. "type": "object",
  8568. "properties": {
  8569. "modelID": {
  8570. "type": "string"
  8571. },
  8572. "providerID": {
  8573. "type": "string"
  8574. }
  8575. },
  8576. "required": ["modelID", "providerID"]
  8577. },
  8578. "prompt": {
  8579. "type": "string"
  8580. },
  8581. "tools": {
  8582. "type": "object",
  8583. "propertyNames": {
  8584. "type": "string"
  8585. },
  8586. "additionalProperties": {
  8587. "type": "boolean"
  8588. }
  8589. },
  8590. "options": {
  8591. "type": "object",
  8592. "propertyNames": {
  8593. "type": "string"
  8594. },
  8595. "additionalProperties": {}
  8596. },
  8597. "maxSteps": {
  8598. "type": "integer",
  8599. "exclusiveMinimum": 0,
  8600. "maximum": 9007199254740991
  8601. }
  8602. },
  8603. "required": ["name", "mode", "builtIn", "permission", "tools", "options"]
  8604. },
  8605. "MCPStatusConnected": {
  8606. "type": "object",
  8607. "properties": {
  8608. "status": {
  8609. "type": "string",
  8610. "const": "connected"
  8611. }
  8612. },
  8613. "required": ["status"]
  8614. },
  8615. "MCPStatusDisabled": {
  8616. "type": "object",
  8617. "properties": {
  8618. "status": {
  8619. "type": "string",
  8620. "const": "disabled"
  8621. }
  8622. },
  8623. "required": ["status"]
  8624. },
  8625. "MCPStatusFailed": {
  8626. "type": "object",
  8627. "properties": {
  8628. "status": {
  8629. "type": "string",
  8630. "const": "failed"
  8631. },
  8632. "error": {
  8633. "type": "string"
  8634. }
  8635. },
  8636. "required": ["status", "error"]
  8637. },
  8638. "MCPStatusNeedsAuth": {
  8639. "type": "object",
  8640. "properties": {
  8641. "status": {
  8642. "type": "string",
  8643. "const": "needs_auth"
  8644. }
  8645. },
  8646. "required": ["status"]
  8647. },
  8648. "MCPStatusNeedsClientRegistration": {
  8649. "type": "object",
  8650. "properties": {
  8651. "status": {
  8652. "type": "string",
  8653. "const": "needs_client_registration"
  8654. },
  8655. "error": {
  8656. "type": "string"
  8657. }
  8658. },
  8659. "required": ["status", "error"]
  8660. },
  8661. "MCPStatus": {
  8662. "anyOf": [
  8663. {
  8664. "$ref": "#/components/schemas/MCPStatusConnected"
  8665. },
  8666. {
  8667. "$ref": "#/components/schemas/MCPStatusDisabled"
  8668. },
  8669. {
  8670. "$ref": "#/components/schemas/MCPStatusFailed"
  8671. },
  8672. {
  8673. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  8674. },
  8675. {
  8676. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  8677. }
  8678. ]
  8679. },
  8680. "LSPStatus": {
  8681. "type": "object",
  8682. "properties": {
  8683. "id": {
  8684. "type": "string"
  8685. },
  8686. "name": {
  8687. "type": "string"
  8688. },
  8689. "root": {
  8690. "type": "string"
  8691. },
  8692. "status": {
  8693. "anyOf": [
  8694. {
  8695. "type": "string",
  8696. "const": "connected"
  8697. },
  8698. {
  8699. "type": "string",
  8700. "const": "error"
  8701. }
  8702. ]
  8703. }
  8704. },
  8705. "required": ["id", "name", "root", "status"]
  8706. },
  8707. "FormatterStatus": {
  8708. "type": "object",
  8709. "properties": {
  8710. "name": {
  8711. "type": "string"
  8712. },
  8713. "extensions": {
  8714. "type": "array",
  8715. "items": {
  8716. "type": "string"
  8717. }
  8718. },
  8719. "enabled": {
  8720. "type": "boolean"
  8721. }
  8722. },
  8723. "required": ["name", "extensions", "enabled"]
  8724. },
  8725. "OAuth": {
  8726. "type": "object",
  8727. "properties": {
  8728. "type": {
  8729. "type": "string",
  8730. "const": "oauth"
  8731. },
  8732. "refresh": {
  8733. "type": "string"
  8734. },
  8735. "access": {
  8736. "type": "string"
  8737. },
  8738. "expires": {
  8739. "type": "number"
  8740. },
  8741. "enterpriseUrl": {
  8742. "type": "string"
  8743. }
  8744. },
  8745. "required": ["type", "refresh", "access", "expires"]
  8746. },
  8747. "ApiAuth": {
  8748. "type": "object",
  8749. "properties": {
  8750. "type": {
  8751. "type": "string",
  8752. "const": "api"
  8753. },
  8754. "key": {
  8755. "type": "string"
  8756. }
  8757. },
  8758. "required": ["type", "key"]
  8759. },
  8760. "WellKnownAuth": {
  8761. "type": "object",
  8762. "properties": {
  8763. "type": {
  8764. "type": "string",
  8765. "const": "wellknown"
  8766. },
  8767. "key": {
  8768. "type": "string"
  8769. },
  8770. "token": {
  8771. "type": "string"
  8772. }
  8773. },
  8774. "required": ["type", "key", "token"]
  8775. },
  8776. "Auth": {
  8777. "anyOf": [
  8778. {
  8779. "$ref": "#/components/schemas/OAuth"
  8780. },
  8781. {
  8782. "$ref": "#/components/schemas/ApiAuth"
  8783. },
  8784. {
  8785. "$ref": "#/components/schemas/WellKnownAuth"
  8786. }
  8787. ]
  8788. }
  8789. }
  8790. }
  8791. }