openapi.json 343 KB

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