openapi.json 254 KB

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