openapi.json 319 KB

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