openapi.json 266 KB

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