openapi.json 324 KB

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