openapi.json 344 KB

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