openapi.json 345 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662
  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. "experimental": {
  4748. "type": "boolean"
  4749. },
  4750. "status": {
  4751. "type": "string",
  4752. "enum": ["alpha", "beta", "deprecated"]
  4753. },
  4754. "options": {
  4755. "type": "object",
  4756. "propertyNames": {
  4757. "type": "string"
  4758. },
  4759. "additionalProperties": {}
  4760. },
  4761. "headers": {
  4762. "type": "object",
  4763. "propertyNames": {
  4764. "type": "string"
  4765. },
  4766. "additionalProperties": {
  4767. "type": "string"
  4768. }
  4769. },
  4770. "provider": {
  4771. "type": "object",
  4772. "properties": {
  4773. "npm": {
  4774. "type": "string"
  4775. },
  4776. "api": {
  4777. "type": "string"
  4778. }
  4779. }
  4780. },
  4781. "variants": {
  4782. "type": "object",
  4783. "propertyNames": {
  4784. "type": "string"
  4785. },
  4786. "additionalProperties": {
  4787. "type": "object",
  4788. "propertyNames": {
  4789. "type": "string"
  4790. },
  4791. "additionalProperties": {}
  4792. }
  4793. }
  4794. },
  4795. "required": [
  4796. "id",
  4797. "name",
  4798. "release_date",
  4799. "attachment",
  4800. "reasoning",
  4801. "temperature",
  4802. "tool_call",
  4803. "limit",
  4804. "options"
  4805. ]
  4806. }
  4807. }
  4808. },
  4809. "required": ["name", "env", "id", "models"]
  4810. }
  4811. },
  4812. "default": {
  4813. "type": "object",
  4814. "propertyNames": {
  4815. "type": "string"
  4816. },
  4817. "additionalProperties": {
  4818. "type": "string"
  4819. }
  4820. },
  4821. "connected": {
  4822. "type": "array",
  4823. "items": {
  4824. "type": "string"
  4825. }
  4826. }
  4827. },
  4828. "required": ["all", "default", "connected"]
  4829. }
  4830. }
  4831. }
  4832. }
  4833. },
  4834. "x-codeSamples": [
  4835. {
  4836. "lang": "js",
  4837. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  4838. }
  4839. ]
  4840. }
  4841. },
  4842. "/provider/auth": {
  4843. "get": {
  4844. "operationId": "provider.auth",
  4845. "parameters": [
  4846. {
  4847. "in": "query",
  4848. "name": "directory",
  4849. "schema": {
  4850. "type": "string"
  4851. }
  4852. },
  4853. {
  4854. "in": "query",
  4855. "name": "workspace",
  4856. "schema": {
  4857. "type": "string"
  4858. }
  4859. }
  4860. ],
  4861. "summary": "Get provider auth methods",
  4862. "description": "Retrieve available authentication methods for all AI providers.",
  4863. "responses": {
  4864. "200": {
  4865. "description": "Provider auth methods",
  4866. "content": {
  4867. "application/json": {
  4868. "schema": {
  4869. "type": "object",
  4870. "propertyNames": {
  4871. "type": "string"
  4872. },
  4873. "additionalProperties": {
  4874. "type": "array",
  4875. "items": {
  4876. "$ref": "#/components/schemas/ProviderAuthMethod"
  4877. }
  4878. }
  4879. }
  4880. }
  4881. }
  4882. }
  4883. },
  4884. "x-codeSamples": [
  4885. {
  4886. "lang": "js",
  4887. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  4888. }
  4889. ]
  4890. }
  4891. },
  4892. "/provider/{providerID}/oauth/authorize": {
  4893. "post": {
  4894. "operationId": "provider.oauth.authorize",
  4895. "parameters": [
  4896. {
  4897. "in": "query",
  4898. "name": "directory",
  4899. "schema": {
  4900. "type": "string"
  4901. }
  4902. },
  4903. {
  4904. "in": "query",
  4905. "name": "workspace",
  4906. "schema": {
  4907. "type": "string"
  4908. }
  4909. },
  4910. {
  4911. "in": "path",
  4912. "name": "providerID",
  4913. "schema": {
  4914. "type": "string"
  4915. },
  4916. "required": true,
  4917. "description": "Provider ID"
  4918. }
  4919. ],
  4920. "summary": "OAuth authorize",
  4921. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  4922. "responses": {
  4923. "200": {
  4924. "description": "Authorization URL and method",
  4925. "content": {
  4926. "application/json": {
  4927. "schema": {
  4928. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  4929. }
  4930. }
  4931. }
  4932. },
  4933. "400": {
  4934. "description": "Bad request",
  4935. "content": {
  4936. "application/json": {
  4937. "schema": {
  4938. "$ref": "#/components/schemas/BadRequestError"
  4939. }
  4940. }
  4941. }
  4942. }
  4943. },
  4944. "requestBody": {
  4945. "content": {
  4946. "application/json": {
  4947. "schema": {
  4948. "type": "object",
  4949. "properties": {
  4950. "method": {
  4951. "description": "Auth method index",
  4952. "type": "number"
  4953. },
  4954. "inputs": {
  4955. "description": "Prompt inputs",
  4956. "type": "object",
  4957. "propertyNames": {
  4958. "type": "string"
  4959. },
  4960. "additionalProperties": {
  4961. "type": "string"
  4962. }
  4963. }
  4964. },
  4965. "required": ["method"]
  4966. }
  4967. }
  4968. }
  4969. },
  4970. "x-codeSamples": [
  4971. {
  4972. "lang": "js",
  4973. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  4974. }
  4975. ]
  4976. }
  4977. },
  4978. "/provider/{providerID}/oauth/callback": {
  4979. "post": {
  4980. "operationId": "provider.oauth.callback",
  4981. "parameters": [
  4982. {
  4983. "in": "query",
  4984. "name": "directory",
  4985. "schema": {
  4986. "type": "string"
  4987. }
  4988. },
  4989. {
  4990. "in": "query",
  4991. "name": "workspace",
  4992. "schema": {
  4993. "type": "string"
  4994. }
  4995. },
  4996. {
  4997. "in": "path",
  4998. "name": "providerID",
  4999. "schema": {
  5000. "type": "string"
  5001. },
  5002. "required": true,
  5003. "description": "Provider ID"
  5004. }
  5005. ],
  5006. "summary": "OAuth callback",
  5007. "description": "Handle the OAuth callback from a provider after user authorization.",
  5008. "responses": {
  5009. "200": {
  5010. "description": "OAuth callback processed successfully",
  5011. "content": {
  5012. "application/json": {
  5013. "schema": {
  5014. "type": "boolean"
  5015. }
  5016. }
  5017. }
  5018. },
  5019. "400": {
  5020. "description": "Bad request",
  5021. "content": {
  5022. "application/json": {
  5023. "schema": {
  5024. "$ref": "#/components/schemas/BadRequestError"
  5025. }
  5026. }
  5027. }
  5028. }
  5029. },
  5030. "requestBody": {
  5031. "content": {
  5032. "application/json": {
  5033. "schema": {
  5034. "type": "object",
  5035. "properties": {
  5036. "method": {
  5037. "description": "Auth method index",
  5038. "type": "number"
  5039. },
  5040. "code": {
  5041. "description": "OAuth authorization code",
  5042. "type": "string"
  5043. }
  5044. },
  5045. "required": ["method"]
  5046. }
  5047. }
  5048. }
  5049. },
  5050. "x-codeSamples": [
  5051. {
  5052. "lang": "js",
  5053. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  5054. }
  5055. ]
  5056. }
  5057. },
  5058. "/find": {
  5059. "get": {
  5060. "operationId": "find.text",
  5061. "parameters": [
  5062. {
  5063. "in": "query",
  5064. "name": "directory",
  5065. "schema": {
  5066. "type": "string"
  5067. }
  5068. },
  5069. {
  5070. "in": "query",
  5071. "name": "workspace",
  5072. "schema": {
  5073. "type": "string"
  5074. }
  5075. },
  5076. {
  5077. "in": "query",
  5078. "name": "pattern",
  5079. "schema": {
  5080. "type": "string"
  5081. },
  5082. "required": true
  5083. }
  5084. ],
  5085. "summary": "Find text",
  5086. "description": "Search for text patterns across files in the project using ripgrep.",
  5087. "responses": {
  5088. "200": {
  5089. "description": "Matches",
  5090. "content": {
  5091. "application/json": {
  5092. "schema": {
  5093. "type": "array",
  5094. "items": {
  5095. "type": "object",
  5096. "properties": {
  5097. "path": {
  5098. "type": "object",
  5099. "properties": {
  5100. "text": {
  5101. "type": "string"
  5102. }
  5103. },
  5104. "required": ["text"]
  5105. },
  5106. "lines": {
  5107. "type": "object",
  5108. "properties": {
  5109. "text": {
  5110. "type": "string"
  5111. }
  5112. },
  5113. "required": ["text"]
  5114. },
  5115. "line_number": {
  5116. "type": "number"
  5117. },
  5118. "absolute_offset": {
  5119. "type": "number"
  5120. },
  5121. "submatches": {
  5122. "type": "array",
  5123. "items": {
  5124. "type": "object",
  5125. "properties": {
  5126. "match": {
  5127. "type": "object",
  5128. "properties": {
  5129. "text": {
  5130. "type": "string"
  5131. }
  5132. },
  5133. "required": ["text"]
  5134. },
  5135. "start": {
  5136. "type": "number"
  5137. },
  5138. "end": {
  5139. "type": "number"
  5140. }
  5141. },
  5142. "required": ["match", "start", "end"]
  5143. }
  5144. }
  5145. },
  5146. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  5147. }
  5148. }
  5149. }
  5150. }
  5151. }
  5152. },
  5153. "x-codeSamples": [
  5154. {
  5155. "lang": "js",
  5156. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  5157. }
  5158. ]
  5159. }
  5160. },
  5161. "/find/file": {
  5162. "get": {
  5163. "operationId": "find.files",
  5164. "parameters": [
  5165. {
  5166. "in": "query",
  5167. "name": "directory",
  5168. "schema": {
  5169. "type": "string"
  5170. }
  5171. },
  5172. {
  5173. "in": "query",
  5174. "name": "workspace",
  5175. "schema": {
  5176. "type": "string"
  5177. }
  5178. },
  5179. {
  5180. "in": "query",
  5181. "name": "query",
  5182. "schema": {
  5183. "type": "string"
  5184. },
  5185. "required": true
  5186. },
  5187. {
  5188. "in": "query",
  5189. "name": "dirs",
  5190. "schema": {
  5191. "type": "string",
  5192. "enum": ["true", "false"]
  5193. }
  5194. },
  5195. {
  5196. "in": "query",
  5197. "name": "type",
  5198. "schema": {
  5199. "type": "string",
  5200. "enum": ["file", "directory"]
  5201. }
  5202. },
  5203. {
  5204. "in": "query",
  5205. "name": "limit",
  5206. "schema": {
  5207. "type": "integer",
  5208. "minimum": 1,
  5209. "maximum": 200
  5210. }
  5211. }
  5212. ],
  5213. "summary": "Find files",
  5214. "description": "Search for files or directories by name or pattern in the project directory.",
  5215. "responses": {
  5216. "200": {
  5217. "description": "File paths",
  5218. "content": {
  5219. "application/json": {
  5220. "schema": {
  5221. "type": "array",
  5222. "items": {
  5223. "type": "string"
  5224. }
  5225. }
  5226. }
  5227. }
  5228. }
  5229. },
  5230. "x-codeSamples": [
  5231. {
  5232. "lang": "js",
  5233. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  5234. }
  5235. ]
  5236. }
  5237. },
  5238. "/find/symbol": {
  5239. "get": {
  5240. "operationId": "find.symbols",
  5241. "parameters": [
  5242. {
  5243. "in": "query",
  5244. "name": "directory",
  5245. "schema": {
  5246. "type": "string"
  5247. }
  5248. },
  5249. {
  5250. "in": "query",
  5251. "name": "workspace",
  5252. "schema": {
  5253. "type": "string"
  5254. }
  5255. },
  5256. {
  5257. "in": "query",
  5258. "name": "query",
  5259. "schema": {
  5260. "type": "string"
  5261. },
  5262. "required": true
  5263. }
  5264. ],
  5265. "summary": "Find symbols",
  5266. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  5267. "responses": {
  5268. "200": {
  5269. "description": "Symbols",
  5270. "content": {
  5271. "application/json": {
  5272. "schema": {
  5273. "type": "array",
  5274. "items": {
  5275. "$ref": "#/components/schemas/Symbol"
  5276. }
  5277. }
  5278. }
  5279. }
  5280. }
  5281. },
  5282. "x-codeSamples": [
  5283. {
  5284. "lang": "js",
  5285. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  5286. }
  5287. ]
  5288. }
  5289. },
  5290. "/file": {
  5291. "get": {
  5292. "operationId": "file.list",
  5293. "parameters": [
  5294. {
  5295. "in": "query",
  5296. "name": "directory",
  5297. "schema": {
  5298. "type": "string"
  5299. }
  5300. },
  5301. {
  5302. "in": "query",
  5303. "name": "workspace",
  5304. "schema": {
  5305. "type": "string"
  5306. }
  5307. },
  5308. {
  5309. "in": "query",
  5310. "name": "path",
  5311. "schema": {
  5312. "type": "string"
  5313. },
  5314. "required": true
  5315. }
  5316. ],
  5317. "summary": "List files",
  5318. "description": "List files and directories in a specified path.",
  5319. "responses": {
  5320. "200": {
  5321. "description": "Files and directories",
  5322. "content": {
  5323. "application/json": {
  5324. "schema": {
  5325. "type": "array",
  5326. "items": {
  5327. "$ref": "#/components/schemas/FileNode"
  5328. }
  5329. }
  5330. }
  5331. }
  5332. }
  5333. },
  5334. "x-codeSamples": [
  5335. {
  5336. "lang": "js",
  5337. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  5338. }
  5339. ]
  5340. }
  5341. },
  5342. "/file/content": {
  5343. "get": {
  5344. "operationId": "file.read",
  5345. "parameters": [
  5346. {
  5347. "in": "query",
  5348. "name": "directory",
  5349. "schema": {
  5350. "type": "string"
  5351. }
  5352. },
  5353. {
  5354. "in": "query",
  5355. "name": "workspace",
  5356. "schema": {
  5357. "type": "string"
  5358. }
  5359. },
  5360. {
  5361. "in": "query",
  5362. "name": "path",
  5363. "schema": {
  5364. "type": "string"
  5365. },
  5366. "required": true
  5367. }
  5368. ],
  5369. "summary": "Read file",
  5370. "description": "Read the content of a specified file.",
  5371. "responses": {
  5372. "200": {
  5373. "description": "File content",
  5374. "content": {
  5375. "application/json": {
  5376. "schema": {
  5377. "$ref": "#/components/schemas/FileContent"
  5378. }
  5379. }
  5380. }
  5381. }
  5382. },
  5383. "x-codeSamples": [
  5384. {
  5385. "lang": "js",
  5386. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  5387. }
  5388. ]
  5389. }
  5390. },
  5391. "/file/status": {
  5392. "get": {
  5393. "operationId": "file.status",
  5394. "parameters": [
  5395. {
  5396. "in": "query",
  5397. "name": "directory",
  5398. "schema": {
  5399. "type": "string"
  5400. }
  5401. },
  5402. {
  5403. "in": "query",
  5404. "name": "workspace",
  5405. "schema": {
  5406. "type": "string"
  5407. }
  5408. }
  5409. ],
  5410. "summary": "Get file status",
  5411. "description": "Get the git status of all files in the project.",
  5412. "responses": {
  5413. "200": {
  5414. "description": "File status",
  5415. "content": {
  5416. "application/json": {
  5417. "schema": {
  5418. "type": "array",
  5419. "items": {
  5420. "$ref": "#/components/schemas/File"
  5421. }
  5422. }
  5423. }
  5424. }
  5425. }
  5426. },
  5427. "x-codeSamples": [
  5428. {
  5429. "lang": "js",
  5430. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  5431. }
  5432. ]
  5433. }
  5434. },
  5435. "/event": {
  5436. "get": {
  5437. "operationId": "event.subscribe",
  5438. "parameters": [
  5439. {
  5440. "in": "query",
  5441. "name": "directory",
  5442. "schema": {
  5443. "type": "string"
  5444. }
  5445. },
  5446. {
  5447. "in": "query",
  5448. "name": "workspace",
  5449. "schema": {
  5450. "type": "string"
  5451. }
  5452. }
  5453. ],
  5454. "summary": "Subscribe to events",
  5455. "description": "Get events",
  5456. "responses": {
  5457. "200": {
  5458. "description": "Event stream",
  5459. "content": {
  5460. "text/event-stream": {
  5461. "schema": {
  5462. "$ref": "#/components/schemas/Event"
  5463. }
  5464. }
  5465. }
  5466. }
  5467. },
  5468. "x-codeSamples": [
  5469. {
  5470. "lang": "js",
  5471. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5472. }
  5473. ]
  5474. }
  5475. },
  5476. "/mcp": {
  5477. "get": {
  5478. "operationId": "mcp.status",
  5479. "parameters": [
  5480. {
  5481. "in": "query",
  5482. "name": "directory",
  5483. "schema": {
  5484. "type": "string"
  5485. }
  5486. },
  5487. {
  5488. "in": "query",
  5489. "name": "workspace",
  5490. "schema": {
  5491. "type": "string"
  5492. }
  5493. }
  5494. ],
  5495. "summary": "Get MCP status",
  5496. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  5497. "responses": {
  5498. "200": {
  5499. "description": "MCP server status",
  5500. "content": {
  5501. "application/json": {
  5502. "schema": {
  5503. "type": "object",
  5504. "propertyNames": {
  5505. "type": "string"
  5506. },
  5507. "additionalProperties": {
  5508. "$ref": "#/components/schemas/MCPStatus"
  5509. }
  5510. }
  5511. }
  5512. }
  5513. }
  5514. },
  5515. "x-codeSamples": [
  5516. {
  5517. "lang": "js",
  5518. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  5519. }
  5520. ]
  5521. },
  5522. "post": {
  5523. "operationId": "mcp.add",
  5524. "parameters": [
  5525. {
  5526. "in": "query",
  5527. "name": "directory",
  5528. "schema": {
  5529. "type": "string"
  5530. }
  5531. },
  5532. {
  5533. "in": "query",
  5534. "name": "workspace",
  5535. "schema": {
  5536. "type": "string"
  5537. }
  5538. }
  5539. ],
  5540. "summary": "Add MCP server",
  5541. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  5542. "responses": {
  5543. "200": {
  5544. "description": "MCP server added successfully",
  5545. "content": {
  5546. "application/json": {
  5547. "schema": {
  5548. "type": "object",
  5549. "propertyNames": {
  5550. "type": "string"
  5551. },
  5552. "additionalProperties": {
  5553. "$ref": "#/components/schemas/MCPStatus"
  5554. }
  5555. }
  5556. }
  5557. }
  5558. },
  5559. "400": {
  5560. "description": "Bad request",
  5561. "content": {
  5562. "application/json": {
  5563. "schema": {
  5564. "$ref": "#/components/schemas/BadRequestError"
  5565. }
  5566. }
  5567. }
  5568. }
  5569. },
  5570. "requestBody": {
  5571. "content": {
  5572. "application/json": {
  5573. "schema": {
  5574. "type": "object",
  5575. "properties": {
  5576. "name": {
  5577. "type": "string"
  5578. },
  5579. "config": {
  5580. "anyOf": [
  5581. {
  5582. "$ref": "#/components/schemas/McpLocalConfig"
  5583. },
  5584. {
  5585. "$ref": "#/components/schemas/McpRemoteConfig"
  5586. }
  5587. ]
  5588. }
  5589. },
  5590. "required": ["name", "config"]
  5591. }
  5592. }
  5593. }
  5594. },
  5595. "x-codeSamples": [
  5596. {
  5597. "lang": "js",
  5598. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  5599. }
  5600. ]
  5601. }
  5602. },
  5603. "/mcp/{name}/auth": {
  5604. "post": {
  5605. "operationId": "mcp.auth.start",
  5606. "parameters": [
  5607. {
  5608. "in": "query",
  5609. "name": "directory",
  5610. "schema": {
  5611. "type": "string"
  5612. }
  5613. },
  5614. {
  5615. "in": "query",
  5616. "name": "workspace",
  5617. "schema": {
  5618. "type": "string"
  5619. }
  5620. },
  5621. {
  5622. "schema": {
  5623. "type": "string"
  5624. },
  5625. "in": "path",
  5626. "name": "name",
  5627. "required": true
  5628. }
  5629. ],
  5630. "summary": "Start MCP OAuth",
  5631. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  5632. "responses": {
  5633. "200": {
  5634. "description": "OAuth flow started",
  5635. "content": {
  5636. "application/json": {
  5637. "schema": {
  5638. "type": "object",
  5639. "properties": {
  5640. "authorizationUrl": {
  5641. "description": "URL to open in browser for authorization",
  5642. "type": "string"
  5643. }
  5644. },
  5645. "required": ["authorizationUrl"]
  5646. }
  5647. }
  5648. }
  5649. },
  5650. "400": {
  5651. "description": "Bad request",
  5652. "content": {
  5653. "application/json": {
  5654. "schema": {
  5655. "$ref": "#/components/schemas/BadRequestError"
  5656. }
  5657. }
  5658. }
  5659. },
  5660. "404": {
  5661. "description": "Not found",
  5662. "content": {
  5663. "application/json": {
  5664. "schema": {
  5665. "$ref": "#/components/schemas/NotFoundError"
  5666. }
  5667. }
  5668. }
  5669. }
  5670. },
  5671. "x-codeSamples": [
  5672. {
  5673. "lang": "js",
  5674. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  5675. }
  5676. ]
  5677. },
  5678. "delete": {
  5679. "operationId": "mcp.auth.remove",
  5680. "parameters": [
  5681. {
  5682. "in": "query",
  5683. "name": "directory",
  5684. "schema": {
  5685. "type": "string"
  5686. }
  5687. },
  5688. {
  5689. "in": "query",
  5690. "name": "workspace",
  5691. "schema": {
  5692. "type": "string"
  5693. }
  5694. },
  5695. {
  5696. "schema": {
  5697. "type": "string"
  5698. },
  5699. "in": "path",
  5700. "name": "name",
  5701. "required": true
  5702. }
  5703. ],
  5704. "summary": "Remove MCP OAuth",
  5705. "description": "Remove OAuth credentials for an MCP server",
  5706. "responses": {
  5707. "200": {
  5708. "description": "OAuth credentials removed",
  5709. "content": {
  5710. "application/json": {
  5711. "schema": {
  5712. "type": "object",
  5713. "properties": {
  5714. "success": {
  5715. "type": "boolean",
  5716. "const": true
  5717. }
  5718. },
  5719. "required": ["success"]
  5720. }
  5721. }
  5722. }
  5723. },
  5724. "404": {
  5725. "description": "Not found",
  5726. "content": {
  5727. "application/json": {
  5728. "schema": {
  5729. "$ref": "#/components/schemas/NotFoundError"
  5730. }
  5731. }
  5732. }
  5733. }
  5734. },
  5735. "x-codeSamples": [
  5736. {
  5737. "lang": "js",
  5738. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  5739. }
  5740. ]
  5741. }
  5742. },
  5743. "/mcp/{name}/auth/callback": {
  5744. "post": {
  5745. "operationId": "mcp.auth.callback",
  5746. "parameters": [
  5747. {
  5748. "in": "query",
  5749. "name": "directory",
  5750. "schema": {
  5751. "type": "string"
  5752. }
  5753. },
  5754. {
  5755. "in": "query",
  5756. "name": "workspace",
  5757. "schema": {
  5758. "type": "string"
  5759. }
  5760. },
  5761. {
  5762. "schema": {
  5763. "type": "string"
  5764. },
  5765. "in": "path",
  5766. "name": "name",
  5767. "required": true
  5768. }
  5769. ],
  5770. "summary": "Complete MCP OAuth",
  5771. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  5772. "responses": {
  5773. "200": {
  5774. "description": "OAuth authentication completed",
  5775. "content": {
  5776. "application/json": {
  5777. "schema": {
  5778. "$ref": "#/components/schemas/MCPStatus"
  5779. }
  5780. }
  5781. }
  5782. },
  5783. "400": {
  5784. "description": "Bad request",
  5785. "content": {
  5786. "application/json": {
  5787. "schema": {
  5788. "$ref": "#/components/schemas/BadRequestError"
  5789. }
  5790. }
  5791. }
  5792. },
  5793. "404": {
  5794. "description": "Not found",
  5795. "content": {
  5796. "application/json": {
  5797. "schema": {
  5798. "$ref": "#/components/schemas/NotFoundError"
  5799. }
  5800. }
  5801. }
  5802. }
  5803. },
  5804. "requestBody": {
  5805. "content": {
  5806. "application/json": {
  5807. "schema": {
  5808. "type": "object",
  5809. "properties": {
  5810. "code": {
  5811. "description": "Authorization code from OAuth callback",
  5812. "type": "string"
  5813. }
  5814. },
  5815. "required": ["code"]
  5816. }
  5817. }
  5818. }
  5819. },
  5820. "x-codeSamples": [
  5821. {
  5822. "lang": "js",
  5823. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  5824. }
  5825. ]
  5826. }
  5827. },
  5828. "/mcp/{name}/auth/authenticate": {
  5829. "post": {
  5830. "operationId": "mcp.auth.authenticate",
  5831. "parameters": [
  5832. {
  5833. "in": "query",
  5834. "name": "directory",
  5835. "schema": {
  5836. "type": "string"
  5837. }
  5838. },
  5839. {
  5840. "in": "query",
  5841. "name": "workspace",
  5842. "schema": {
  5843. "type": "string"
  5844. }
  5845. },
  5846. {
  5847. "schema": {
  5848. "type": "string"
  5849. },
  5850. "in": "path",
  5851. "name": "name",
  5852. "required": true
  5853. }
  5854. ],
  5855. "summary": "Authenticate MCP OAuth",
  5856. "description": "Start OAuth flow and wait for callback (opens browser)",
  5857. "responses": {
  5858. "200": {
  5859. "description": "OAuth authentication completed",
  5860. "content": {
  5861. "application/json": {
  5862. "schema": {
  5863. "$ref": "#/components/schemas/MCPStatus"
  5864. }
  5865. }
  5866. }
  5867. },
  5868. "400": {
  5869. "description": "Bad request",
  5870. "content": {
  5871. "application/json": {
  5872. "schema": {
  5873. "$ref": "#/components/schemas/BadRequestError"
  5874. }
  5875. }
  5876. }
  5877. },
  5878. "404": {
  5879. "description": "Not found",
  5880. "content": {
  5881. "application/json": {
  5882. "schema": {
  5883. "$ref": "#/components/schemas/NotFoundError"
  5884. }
  5885. }
  5886. }
  5887. }
  5888. },
  5889. "x-codeSamples": [
  5890. {
  5891. "lang": "js",
  5892. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  5893. }
  5894. ]
  5895. }
  5896. },
  5897. "/mcp/{name}/connect": {
  5898. "post": {
  5899. "operationId": "mcp.connect",
  5900. "parameters": [
  5901. {
  5902. "in": "query",
  5903. "name": "directory",
  5904. "schema": {
  5905. "type": "string"
  5906. }
  5907. },
  5908. {
  5909. "in": "query",
  5910. "name": "workspace",
  5911. "schema": {
  5912. "type": "string"
  5913. }
  5914. },
  5915. {
  5916. "in": "path",
  5917. "name": "name",
  5918. "schema": {
  5919. "type": "string"
  5920. },
  5921. "required": true
  5922. }
  5923. ],
  5924. "description": "Connect an MCP server",
  5925. "responses": {
  5926. "200": {
  5927. "description": "MCP server connected successfully",
  5928. "content": {
  5929. "application/json": {
  5930. "schema": {
  5931. "type": "boolean"
  5932. }
  5933. }
  5934. }
  5935. }
  5936. },
  5937. "x-codeSamples": [
  5938. {
  5939. "lang": "js",
  5940. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  5941. }
  5942. ]
  5943. }
  5944. },
  5945. "/mcp/{name}/disconnect": {
  5946. "post": {
  5947. "operationId": "mcp.disconnect",
  5948. "parameters": [
  5949. {
  5950. "in": "query",
  5951. "name": "directory",
  5952. "schema": {
  5953. "type": "string"
  5954. }
  5955. },
  5956. {
  5957. "in": "query",
  5958. "name": "workspace",
  5959. "schema": {
  5960. "type": "string"
  5961. }
  5962. },
  5963. {
  5964. "in": "path",
  5965. "name": "name",
  5966. "schema": {
  5967. "type": "string"
  5968. },
  5969. "required": true
  5970. }
  5971. ],
  5972. "description": "Disconnect an MCP server",
  5973. "responses": {
  5974. "200": {
  5975. "description": "MCP server disconnected successfully",
  5976. "content": {
  5977. "application/json": {
  5978. "schema": {
  5979. "type": "boolean"
  5980. }
  5981. }
  5982. }
  5983. }
  5984. },
  5985. "x-codeSamples": [
  5986. {
  5987. "lang": "js",
  5988. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  5989. }
  5990. ]
  5991. }
  5992. },
  5993. "/tui/append-prompt": {
  5994. "post": {
  5995. "operationId": "tui.appendPrompt",
  5996. "parameters": [
  5997. {
  5998. "in": "query",
  5999. "name": "directory",
  6000. "schema": {
  6001. "type": "string"
  6002. }
  6003. },
  6004. {
  6005. "in": "query",
  6006. "name": "workspace",
  6007. "schema": {
  6008. "type": "string"
  6009. }
  6010. }
  6011. ],
  6012. "summary": "Append TUI prompt",
  6013. "description": "Append prompt to the TUI",
  6014. "responses": {
  6015. "200": {
  6016. "description": "Prompt processed successfully",
  6017. "content": {
  6018. "application/json": {
  6019. "schema": {
  6020. "type": "boolean"
  6021. }
  6022. }
  6023. }
  6024. },
  6025. "400": {
  6026. "description": "Bad request",
  6027. "content": {
  6028. "application/json": {
  6029. "schema": {
  6030. "$ref": "#/components/schemas/BadRequestError"
  6031. }
  6032. }
  6033. }
  6034. }
  6035. },
  6036. "requestBody": {
  6037. "content": {
  6038. "application/json": {
  6039. "schema": {
  6040. "type": "object",
  6041. "properties": {
  6042. "text": {
  6043. "type": "string"
  6044. }
  6045. },
  6046. "required": ["text"]
  6047. }
  6048. }
  6049. }
  6050. },
  6051. "x-codeSamples": [
  6052. {
  6053. "lang": "js",
  6054. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  6055. }
  6056. ]
  6057. }
  6058. },
  6059. "/tui/open-help": {
  6060. "post": {
  6061. "operationId": "tui.openHelp",
  6062. "parameters": [
  6063. {
  6064. "in": "query",
  6065. "name": "directory",
  6066. "schema": {
  6067. "type": "string"
  6068. }
  6069. },
  6070. {
  6071. "in": "query",
  6072. "name": "workspace",
  6073. "schema": {
  6074. "type": "string"
  6075. }
  6076. }
  6077. ],
  6078. "summary": "Open help dialog",
  6079. "description": "Open the help dialog in the TUI to display user assistance information.",
  6080. "responses": {
  6081. "200": {
  6082. "description": "Help dialog opened successfully",
  6083. "content": {
  6084. "application/json": {
  6085. "schema": {
  6086. "type": "boolean"
  6087. }
  6088. }
  6089. }
  6090. }
  6091. },
  6092. "x-codeSamples": [
  6093. {
  6094. "lang": "js",
  6095. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  6096. }
  6097. ]
  6098. }
  6099. },
  6100. "/tui/open-sessions": {
  6101. "post": {
  6102. "operationId": "tui.openSessions",
  6103. "parameters": [
  6104. {
  6105. "in": "query",
  6106. "name": "directory",
  6107. "schema": {
  6108. "type": "string"
  6109. }
  6110. },
  6111. {
  6112. "in": "query",
  6113. "name": "workspace",
  6114. "schema": {
  6115. "type": "string"
  6116. }
  6117. }
  6118. ],
  6119. "summary": "Open sessions dialog",
  6120. "description": "Open the session dialog",
  6121. "responses": {
  6122. "200": {
  6123. "description": "Session dialog opened successfully",
  6124. "content": {
  6125. "application/json": {
  6126. "schema": {
  6127. "type": "boolean"
  6128. }
  6129. }
  6130. }
  6131. }
  6132. },
  6133. "x-codeSamples": [
  6134. {
  6135. "lang": "js",
  6136. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  6137. }
  6138. ]
  6139. }
  6140. },
  6141. "/tui/open-themes": {
  6142. "post": {
  6143. "operationId": "tui.openThemes",
  6144. "parameters": [
  6145. {
  6146. "in": "query",
  6147. "name": "directory",
  6148. "schema": {
  6149. "type": "string"
  6150. }
  6151. },
  6152. {
  6153. "in": "query",
  6154. "name": "workspace",
  6155. "schema": {
  6156. "type": "string"
  6157. }
  6158. }
  6159. ],
  6160. "summary": "Open themes dialog",
  6161. "description": "Open the theme dialog",
  6162. "responses": {
  6163. "200": {
  6164. "description": "Theme dialog opened successfully",
  6165. "content": {
  6166. "application/json": {
  6167. "schema": {
  6168. "type": "boolean"
  6169. }
  6170. }
  6171. }
  6172. }
  6173. },
  6174. "x-codeSamples": [
  6175. {
  6176. "lang": "js",
  6177. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  6178. }
  6179. ]
  6180. }
  6181. },
  6182. "/tui/open-models": {
  6183. "post": {
  6184. "operationId": "tui.openModels",
  6185. "parameters": [
  6186. {
  6187. "in": "query",
  6188. "name": "directory",
  6189. "schema": {
  6190. "type": "string"
  6191. }
  6192. },
  6193. {
  6194. "in": "query",
  6195. "name": "workspace",
  6196. "schema": {
  6197. "type": "string"
  6198. }
  6199. }
  6200. ],
  6201. "summary": "Open models dialog",
  6202. "description": "Open the model dialog",
  6203. "responses": {
  6204. "200": {
  6205. "description": "Model dialog opened successfully",
  6206. "content": {
  6207. "application/json": {
  6208. "schema": {
  6209. "type": "boolean"
  6210. }
  6211. }
  6212. }
  6213. }
  6214. },
  6215. "x-codeSamples": [
  6216. {
  6217. "lang": "js",
  6218. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  6219. }
  6220. ]
  6221. }
  6222. },
  6223. "/tui/submit-prompt": {
  6224. "post": {
  6225. "operationId": "tui.submitPrompt",
  6226. "parameters": [
  6227. {
  6228. "in": "query",
  6229. "name": "directory",
  6230. "schema": {
  6231. "type": "string"
  6232. }
  6233. },
  6234. {
  6235. "in": "query",
  6236. "name": "workspace",
  6237. "schema": {
  6238. "type": "string"
  6239. }
  6240. }
  6241. ],
  6242. "summary": "Submit TUI prompt",
  6243. "description": "Submit the prompt",
  6244. "responses": {
  6245. "200": {
  6246. "description": "Prompt submitted successfully",
  6247. "content": {
  6248. "application/json": {
  6249. "schema": {
  6250. "type": "boolean"
  6251. }
  6252. }
  6253. }
  6254. }
  6255. },
  6256. "x-codeSamples": [
  6257. {
  6258. "lang": "js",
  6259. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  6260. }
  6261. ]
  6262. }
  6263. },
  6264. "/tui/clear-prompt": {
  6265. "post": {
  6266. "operationId": "tui.clearPrompt",
  6267. "parameters": [
  6268. {
  6269. "in": "query",
  6270. "name": "directory",
  6271. "schema": {
  6272. "type": "string"
  6273. }
  6274. },
  6275. {
  6276. "in": "query",
  6277. "name": "workspace",
  6278. "schema": {
  6279. "type": "string"
  6280. }
  6281. }
  6282. ],
  6283. "summary": "Clear TUI prompt",
  6284. "description": "Clear the prompt",
  6285. "responses": {
  6286. "200": {
  6287. "description": "Prompt cleared successfully",
  6288. "content": {
  6289. "application/json": {
  6290. "schema": {
  6291. "type": "boolean"
  6292. }
  6293. }
  6294. }
  6295. }
  6296. },
  6297. "x-codeSamples": [
  6298. {
  6299. "lang": "js",
  6300. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  6301. }
  6302. ]
  6303. }
  6304. },
  6305. "/tui/execute-command": {
  6306. "post": {
  6307. "operationId": "tui.executeCommand",
  6308. "parameters": [
  6309. {
  6310. "in": "query",
  6311. "name": "directory",
  6312. "schema": {
  6313. "type": "string"
  6314. }
  6315. },
  6316. {
  6317. "in": "query",
  6318. "name": "workspace",
  6319. "schema": {
  6320. "type": "string"
  6321. }
  6322. }
  6323. ],
  6324. "summary": "Execute TUI command",
  6325. "description": "Execute a TUI command (e.g. agent_cycle)",
  6326. "responses": {
  6327. "200": {
  6328. "description": "Command executed successfully",
  6329. "content": {
  6330. "application/json": {
  6331. "schema": {
  6332. "type": "boolean"
  6333. }
  6334. }
  6335. }
  6336. },
  6337. "400": {
  6338. "description": "Bad request",
  6339. "content": {
  6340. "application/json": {
  6341. "schema": {
  6342. "$ref": "#/components/schemas/BadRequestError"
  6343. }
  6344. }
  6345. }
  6346. }
  6347. },
  6348. "requestBody": {
  6349. "content": {
  6350. "application/json": {
  6351. "schema": {
  6352. "type": "object",
  6353. "properties": {
  6354. "command": {
  6355. "type": "string"
  6356. }
  6357. },
  6358. "required": ["command"]
  6359. }
  6360. }
  6361. }
  6362. },
  6363. "x-codeSamples": [
  6364. {
  6365. "lang": "js",
  6366. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  6367. }
  6368. ]
  6369. }
  6370. },
  6371. "/tui/show-toast": {
  6372. "post": {
  6373. "operationId": "tui.showToast",
  6374. "parameters": [
  6375. {
  6376. "in": "query",
  6377. "name": "directory",
  6378. "schema": {
  6379. "type": "string"
  6380. }
  6381. },
  6382. {
  6383. "in": "query",
  6384. "name": "workspace",
  6385. "schema": {
  6386. "type": "string"
  6387. }
  6388. }
  6389. ],
  6390. "summary": "Show TUI toast",
  6391. "description": "Show a toast notification in the TUI",
  6392. "responses": {
  6393. "200": {
  6394. "description": "Toast notification shown successfully",
  6395. "content": {
  6396. "application/json": {
  6397. "schema": {
  6398. "type": "boolean"
  6399. }
  6400. }
  6401. }
  6402. }
  6403. },
  6404. "requestBody": {
  6405. "content": {
  6406. "application/json": {
  6407. "schema": {
  6408. "type": "object",
  6409. "properties": {
  6410. "title": {
  6411. "type": "string"
  6412. },
  6413. "message": {
  6414. "type": "string"
  6415. },
  6416. "variant": {
  6417. "type": "string",
  6418. "enum": ["info", "success", "warning", "error"]
  6419. },
  6420. "duration": {
  6421. "description": "Duration in milliseconds",
  6422. "default": 5000,
  6423. "type": "number"
  6424. }
  6425. },
  6426. "required": ["message", "variant"]
  6427. }
  6428. }
  6429. }
  6430. },
  6431. "x-codeSamples": [
  6432. {
  6433. "lang": "js",
  6434. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  6435. }
  6436. ]
  6437. }
  6438. },
  6439. "/tui/publish": {
  6440. "post": {
  6441. "operationId": "tui.publish",
  6442. "parameters": [
  6443. {
  6444. "in": "query",
  6445. "name": "directory",
  6446. "schema": {
  6447. "type": "string"
  6448. }
  6449. },
  6450. {
  6451. "in": "query",
  6452. "name": "workspace",
  6453. "schema": {
  6454. "type": "string"
  6455. }
  6456. }
  6457. ],
  6458. "summary": "Publish TUI event",
  6459. "description": "Publish a TUI event",
  6460. "responses": {
  6461. "200": {
  6462. "description": "Event published successfully",
  6463. "content": {
  6464. "application/json": {
  6465. "schema": {
  6466. "type": "boolean"
  6467. }
  6468. }
  6469. }
  6470. },
  6471. "400": {
  6472. "description": "Bad request",
  6473. "content": {
  6474. "application/json": {
  6475. "schema": {
  6476. "$ref": "#/components/schemas/BadRequestError"
  6477. }
  6478. }
  6479. }
  6480. }
  6481. },
  6482. "requestBody": {
  6483. "content": {
  6484. "application/json": {
  6485. "schema": {
  6486. "anyOf": [
  6487. {
  6488. "$ref": "#/components/schemas/Event.tui.prompt.append"
  6489. },
  6490. {
  6491. "$ref": "#/components/schemas/Event.tui.command.execute"
  6492. },
  6493. {
  6494. "$ref": "#/components/schemas/Event.tui.toast.show"
  6495. },
  6496. {
  6497. "$ref": "#/components/schemas/Event.tui.session.select"
  6498. }
  6499. ]
  6500. }
  6501. }
  6502. }
  6503. },
  6504. "x-codeSamples": [
  6505. {
  6506. "lang": "js",
  6507. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  6508. }
  6509. ]
  6510. }
  6511. },
  6512. "/tui/select-session": {
  6513. "post": {
  6514. "operationId": "tui.selectSession",
  6515. "parameters": [
  6516. {
  6517. "in": "query",
  6518. "name": "directory",
  6519. "schema": {
  6520. "type": "string"
  6521. }
  6522. },
  6523. {
  6524. "in": "query",
  6525. "name": "workspace",
  6526. "schema": {
  6527. "type": "string"
  6528. }
  6529. }
  6530. ],
  6531. "summary": "Select session",
  6532. "description": "Navigate the TUI to display the specified session.",
  6533. "responses": {
  6534. "200": {
  6535. "description": "Session selected successfully",
  6536. "content": {
  6537. "application/json": {
  6538. "schema": {
  6539. "type": "boolean"
  6540. }
  6541. }
  6542. }
  6543. },
  6544. "400": {
  6545. "description": "Bad request",
  6546. "content": {
  6547. "application/json": {
  6548. "schema": {
  6549. "$ref": "#/components/schemas/BadRequestError"
  6550. }
  6551. }
  6552. }
  6553. },
  6554. "404": {
  6555. "description": "Not found",
  6556. "content": {
  6557. "application/json": {
  6558. "schema": {
  6559. "$ref": "#/components/schemas/NotFoundError"
  6560. }
  6561. }
  6562. }
  6563. }
  6564. },
  6565. "requestBody": {
  6566. "content": {
  6567. "application/json": {
  6568. "schema": {
  6569. "type": "object",
  6570. "properties": {
  6571. "sessionID": {
  6572. "description": "Session ID to navigate to",
  6573. "type": "string",
  6574. "pattern": "^ses.*"
  6575. }
  6576. },
  6577. "required": ["sessionID"]
  6578. }
  6579. }
  6580. }
  6581. },
  6582. "x-codeSamples": [
  6583. {
  6584. "lang": "js",
  6585. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  6586. }
  6587. ]
  6588. }
  6589. },
  6590. "/tui/control/next": {
  6591. "get": {
  6592. "operationId": "tui.control.next",
  6593. "parameters": [
  6594. {
  6595. "in": "query",
  6596. "name": "directory",
  6597. "schema": {
  6598. "type": "string"
  6599. }
  6600. },
  6601. {
  6602. "in": "query",
  6603. "name": "workspace",
  6604. "schema": {
  6605. "type": "string"
  6606. }
  6607. }
  6608. ],
  6609. "summary": "Get next TUI request",
  6610. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  6611. "responses": {
  6612. "200": {
  6613. "description": "Next TUI request",
  6614. "content": {
  6615. "application/json": {
  6616. "schema": {
  6617. "type": "object",
  6618. "properties": {
  6619. "path": {
  6620. "type": "string"
  6621. },
  6622. "body": {}
  6623. },
  6624. "required": ["path", "body"]
  6625. }
  6626. }
  6627. }
  6628. }
  6629. },
  6630. "x-codeSamples": [
  6631. {
  6632. "lang": "js",
  6633. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  6634. }
  6635. ]
  6636. }
  6637. },
  6638. "/tui/control/response": {
  6639. "post": {
  6640. "operationId": "tui.control.response",
  6641. "parameters": [
  6642. {
  6643. "in": "query",
  6644. "name": "directory",
  6645. "schema": {
  6646. "type": "string"
  6647. }
  6648. },
  6649. {
  6650. "in": "query",
  6651. "name": "workspace",
  6652. "schema": {
  6653. "type": "string"
  6654. }
  6655. }
  6656. ],
  6657. "summary": "Submit TUI response",
  6658. "description": "Submit a response to the TUI request queue to complete a pending request.",
  6659. "responses": {
  6660. "200": {
  6661. "description": "Response submitted successfully",
  6662. "content": {
  6663. "application/json": {
  6664. "schema": {
  6665. "type": "boolean"
  6666. }
  6667. }
  6668. }
  6669. }
  6670. },
  6671. "requestBody": {
  6672. "content": {
  6673. "application/json": {
  6674. "schema": {}
  6675. }
  6676. }
  6677. },
  6678. "x-codeSamples": [
  6679. {
  6680. "lang": "js",
  6681. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  6682. }
  6683. ]
  6684. }
  6685. },
  6686. "/instance/dispose": {
  6687. "post": {
  6688. "operationId": "instance.dispose",
  6689. "parameters": [
  6690. {
  6691. "in": "query",
  6692. "name": "directory",
  6693. "schema": {
  6694. "type": "string"
  6695. }
  6696. },
  6697. {
  6698. "in": "query",
  6699. "name": "workspace",
  6700. "schema": {
  6701. "type": "string"
  6702. }
  6703. }
  6704. ],
  6705. "summary": "Dispose instance",
  6706. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  6707. "responses": {
  6708. "200": {
  6709. "description": "Instance disposed",
  6710. "content": {
  6711. "application/json": {
  6712. "schema": {
  6713. "type": "boolean"
  6714. }
  6715. }
  6716. }
  6717. }
  6718. },
  6719. "x-codeSamples": [
  6720. {
  6721. "lang": "js",
  6722. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  6723. }
  6724. ]
  6725. }
  6726. },
  6727. "/path": {
  6728. "get": {
  6729. "operationId": "path.get",
  6730. "parameters": [
  6731. {
  6732. "in": "query",
  6733. "name": "directory",
  6734. "schema": {
  6735. "type": "string"
  6736. }
  6737. },
  6738. {
  6739. "in": "query",
  6740. "name": "workspace",
  6741. "schema": {
  6742. "type": "string"
  6743. }
  6744. }
  6745. ],
  6746. "summary": "Get paths",
  6747. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  6748. "responses": {
  6749. "200": {
  6750. "description": "Path",
  6751. "content": {
  6752. "application/json": {
  6753. "schema": {
  6754. "$ref": "#/components/schemas/Path"
  6755. }
  6756. }
  6757. }
  6758. }
  6759. },
  6760. "x-codeSamples": [
  6761. {
  6762. "lang": "js",
  6763. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  6764. }
  6765. ]
  6766. }
  6767. },
  6768. "/vcs": {
  6769. "get": {
  6770. "operationId": "vcs.get",
  6771. "parameters": [
  6772. {
  6773. "in": "query",
  6774. "name": "directory",
  6775. "schema": {
  6776. "type": "string"
  6777. }
  6778. },
  6779. {
  6780. "in": "query",
  6781. "name": "workspace",
  6782. "schema": {
  6783. "type": "string"
  6784. }
  6785. }
  6786. ],
  6787. "summary": "Get VCS info",
  6788. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  6789. "responses": {
  6790. "200": {
  6791. "description": "VCS info",
  6792. "content": {
  6793. "application/json": {
  6794. "schema": {
  6795. "$ref": "#/components/schemas/VcsInfo"
  6796. }
  6797. }
  6798. }
  6799. }
  6800. },
  6801. "x-codeSamples": [
  6802. {
  6803. "lang": "js",
  6804. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  6805. }
  6806. ]
  6807. }
  6808. },
  6809. "/command": {
  6810. "get": {
  6811. "operationId": "command.list",
  6812. "parameters": [
  6813. {
  6814. "in": "query",
  6815. "name": "directory",
  6816. "schema": {
  6817. "type": "string"
  6818. }
  6819. },
  6820. {
  6821. "in": "query",
  6822. "name": "workspace",
  6823. "schema": {
  6824. "type": "string"
  6825. }
  6826. }
  6827. ],
  6828. "summary": "List commands",
  6829. "description": "Get a list of all available commands in the OpenCode system.",
  6830. "responses": {
  6831. "200": {
  6832. "description": "List of commands",
  6833. "content": {
  6834. "application/json": {
  6835. "schema": {
  6836. "type": "array",
  6837. "items": {
  6838. "$ref": "#/components/schemas/Command"
  6839. }
  6840. }
  6841. }
  6842. }
  6843. }
  6844. },
  6845. "x-codeSamples": [
  6846. {
  6847. "lang": "js",
  6848. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  6849. }
  6850. ]
  6851. }
  6852. },
  6853. "/agent": {
  6854. "get": {
  6855. "operationId": "app.agents",
  6856. "parameters": [
  6857. {
  6858. "in": "query",
  6859. "name": "directory",
  6860. "schema": {
  6861. "type": "string"
  6862. }
  6863. },
  6864. {
  6865. "in": "query",
  6866. "name": "workspace",
  6867. "schema": {
  6868. "type": "string"
  6869. }
  6870. }
  6871. ],
  6872. "summary": "List agents",
  6873. "description": "Get a list of all available AI agents in the OpenCode system.",
  6874. "responses": {
  6875. "200": {
  6876. "description": "List of agents",
  6877. "content": {
  6878. "application/json": {
  6879. "schema": {
  6880. "type": "array",
  6881. "items": {
  6882. "$ref": "#/components/schemas/Agent"
  6883. }
  6884. }
  6885. }
  6886. }
  6887. }
  6888. },
  6889. "x-codeSamples": [
  6890. {
  6891. "lang": "js",
  6892. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  6893. }
  6894. ]
  6895. }
  6896. },
  6897. "/skill": {
  6898. "get": {
  6899. "operationId": "app.skills",
  6900. "parameters": [
  6901. {
  6902. "in": "query",
  6903. "name": "directory",
  6904. "schema": {
  6905. "type": "string"
  6906. }
  6907. },
  6908. {
  6909. "in": "query",
  6910. "name": "workspace",
  6911. "schema": {
  6912. "type": "string"
  6913. }
  6914. }
  6915. ],
  6916. "summary": "List skills",
  6917. "description": "Get a list of all available skills in the OpenCode system.",
  6918. "responses": {
  6919. "200": {
  6920. "description": "List of skills",
  6921. "content": {
  6922. "application/json": {
  6923. "schema": {
  6924. "type": "array",
  6925. "items": {
  6926. "type": "object",
  6927. "properties": {
  6928. "name": {
  6929. "type": "string"
  6930. },
  6931. "description": {
  6932. "type": "string"
  6933. },
  6934. "location": {
  6935. "type": "string"
  6936. },
  6937. "content": {
  6938. "type": "string"
  6939. }
  6940. },
  6941. "required": ["name", "description", "location", "content"]
  6942. }
  6943. }
  6944. }
  6945. }
  6946. }
  6947. },
  6948. "x-codeSamples": [
  6949. {
  6950. "lang": "js",
  6951. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  6952. }
  6953. ]
  6954. }
  6955. },
  6956. "/lsp": {
  6957. "get": {
  6958. "operationId": "lsp.status",
  6959. "parameters": [
  6960. {
  6961. "in": "query",
  6962. "name": "directory",
  6963. "schema": {
  6964. "type": "string"
  6965. }
  6966. },
  6967. {
  6968. "in": "query",
  6969. "name": "workspace",
  6970. "schema": {
  6971. "type": "string"
  6972. }
  6973. }
  6974. ],
  6975. "summary": "Get LSP status",
  6976. "description": "Get LSP server status",
  6977. "responses": {
  6978. "200": {
  6979. "description": "LSP server status",
  6980. "content": {
  6981. "application/json": {
  6982. "schema": {
  6983. "type": "array",
  6984. "items": {
  6985. "$ref": "#/components/schemas/LSPStatus"
  6986. }
  6987. }
  6988. }
  6989. }
  6990. }
  6991. },
  6992. "x-codeSamples": [
  6993. {
  6994. "lang": "js",
  6995. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  6996. }
  6997. ]
  6998. }
  6999. },
  7000. "/formatter": {
  7001. "get": {
  7002. "operationId": "formatter.status",
  7003. "parameters": [
  7004. {
  7005. "in": "query",
  7006. "name": "directory",
  7007. "schema": {
  7008. "type": "string"
  7009. }
  7010. },
  7011. {
  7012. "in": "query",
  7013. "name": "workspace",
  7014. "schema": {
  7015. "type": "string"
  7016. }
  7017. }
  7018. ],
  7019. "summary": "Get formatter status",
  7020. "description": "Get formatter status",
  7021. "responses": {
  7022. "200": {
  7023. "description": "Formatter status",
  7024. "content": {
  7025. "application/json": {
  7026. "schema": {
  7027. "type": "array",
  7028. "items": {
  7029. "$ref": "#/components/schemas/FormatterStatus"
  7030. }
  7031. }
  7032. }
  7033. }
  7034. }
  7035. },
  7036. "x-codeSamples": [
  7037. {
  7038. "lang": "js",
  7039. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  7040. }
  7041. ]
  7042. }
  7043. }
  7044. },
  7045. "components": {
  7046. "schemas": {
  7047. "Project": {
  7048. "type": "object",
  7049. "properties": {
  7050. "id": {
  7051. "type": "string"
  7052. },
  7053. "worktree": {
  7054. "type": "string"
  7055. },
  7056. "vcs": {
  7057. "type": "string",
  7058. "const": "git"
  7059. },
  7060. "name": {
  7061. "type": "string"
  7062. },
  7063. "icon": {
  7064. "type": "object",
  7065. "properties": {
  7066. "url": {
  7067. "type": "string"
  7068. },
  7069. "override": {
  7070. "type": "string"
  7071. },
  7072. "color": {
  7073. "type": "string"
  7074. }
  7075. }
  7076. },
  7077. "commands": {
  7078. "type": "object",
  7079. "properties": {
  7080. "start": {
  7081. "description": "Startup script to run when creating a new workspace (worktree)",
  7082. "type": "string"
  7083. }
  7084. }
  7085. },
  7086. "time": {
  7087. "type": "object",
  7088. "properties": {
  7089. "created": {
  7090. "type": "number"
  7091. },
  7092. "updated": {
  7093. "type": "number"
  7094. },
  7095. "initialized": {
  7096. "type": "number"
  7097. }
  7098. },
  7099. "required": ["created", "updated"]
  7100. },
  7101. "sandboxes": {
  7102. "type": "array",
  7103. "items": {
  7104. "type": "string"
  7105. }
  7106. }
  7107. },
  7108. "required": ["id", "worktree", "time", "sandboxes"]
  7109. },
  7110. "Event.project.updated": {
  7111. "type": "object",
  7112. "properties": {
  7113. "type": {
  7114. "type": "string",
  7115. "const": "project.updated"
  7116. },
  7117. "properties": {
  7118. "$ref": "#/components/schemas/Project"
  7119. }
  7120. },
  7121. "required": ["type", "properties"]
  7122. },
  7123. "Event.installation.updated": {
  7124. "type": "object",
  7125. "properties": {
  7126. "type": {
  7127. "type": "string",
  7128. "const": "installation.updated"
  7129. },
  7130. "properties": {
  7131. "type": "object",
  7132. "properties": {
  7133. "version": {
  7134. "type": "string"
  7135. }
  7136. },
  7137. "required": ["version"]
  7138. }
  7139. },
  7140. "required": ["type", "properties"]
  7141. },
  7142. "Event.installation.update-available": {
  7143. "type": "object",
  7144. "properties": {
  7145. "type": {
  7146. "type": "string",
  7147. "const": "installation.update-available"
  7148. },
  7149. "properties": {
  7150. "type": "object",
  7151. "properties": {
  7152. "version": {
  7153. "type": "string"
  7154. }
  7155. },
  7156. "required": ["version"]
  7157. }
  7158. },
  7159. "required": ["type", "properties"]
  7160. },
  7161. "Event.server.instance.disposed": {
  7162. "type": "object",
  7163. "properties": {
  7164. "type": {
  7165. "type": "string",
  7166. "const": "server.instance.disposed"
  7167. },
  7168. "properties": {
  7169. "type": "object",
  7170. "properties": {
  7171. "directory": {
  7172. "type": "string"
  7173. }
  7174. },
  7175. "required": ["directory"]
  7176. }
  7177. },
  7178. "required": ["type", "properties"]
  7179. },
  7180. "Event.server.connected": {
  7181. "type": "object",
  7182. "properties": {
  7183. "type": {
  7184. "type": "string",
  7185. "const": "server.connected"
  7186. },
  7187. "properties": {
  7188. "type": "object",
  7189. "properties": {}
  7190. }
  7191. },
  7192. "required": ["type", "properties"]
  7193. },
  7194. "Event.global.disposed": {
  7195. "type": "object",
  7196. "properties": {
  7197. "type": {
  7198. "type": "string",
  7199. "const": "global.disposed"
  7200. },
  7201. "properties": {
  7202. "type": "object",
  7203. "properties": {}
  7204. }
  7205. },
  7206. "required": ["type", "properties"]
  7207. },
  7208. "Event.lsp.client.diagnostics": {
  7209. "type": "object",
  7210. "properties": {
  7211. "type": {
  7212. "type": "string",
  7213. "const": "lsp.client.diagnostics"
  7214. },
  7215. "properties": {
  7216. "type": "object",
  7217. "properties": {
  7218. "serverID": {
  7219. "type": "string"
  7220. },
  7221. "path": {
  7222. "type": "string"
  7223. }
  7224. },
  7225. "required": ["serverID", "path"]
  7226. }
  7227. },
  7228. "required": ["type", "properties"]
  7229. },
  7230. "Event.lsp.updated": {
  7231. "type": "object",
  7232. "properties": {
  7233. "type": {
  7234. "type": "string",
  7235. "const": "lsp.updated"
  7236. },
  7237. "properties": {
  7238. "type": "object",
  7239. "properties": {}
  7240. }
  7241. },
  7242. "required": ["type", "properties"]
  7243. },
  7244. "Event.message.part.delta": {
  7245. "type": "object",
  7246. "properties": {
  7247. "type": {
  7248. "type": "string",
  7249. "const": "message.part.delta"
  7250. },
  7251. "properties": {
  7252. "type": "object",
  7253. "properties": {
  7254. "sessionID": {
  7255. "type": "string",
  7256. "pattern": "^ses.*"
  7257. },
  7258. "messageID": {
  7259. "type": "string",
  7260. "pattern": "^msg.*"
  7261. },
  7262. "partID": {
  7263. "type": "string",
  7264. "pattern": "^prt.*"
  7265. },
  7266. "field": {
  7267. "type": "string"
  7268. },
  7269. "delta": {
  7270. "type": "string"
  7271. }
  7272. },
  7273. "required": ["sessionID", "messageID", "partID", "field", "delta"]
  7274. }
  7275. },
  7276. "required": ["type", "properties"]
  7277. },
  7278. "PermissionRequest": {
  7279. "type": "object",
  7280. "properties": {
  7281. "id": {
  7282. "type": "string",
  7283. "pattern": "^per.*"
  7284. },
  7285. "sessionID": {
  7286. "type": "string",
  7287. "pattern": "^ses.*"
  7288. },
  7289. "permission": {
  7290. "type": "string"
  7291. },
  7292. "patterns": {
  7293. "type": "array",
  7294. "items": {
  7295. "type": "string"
  7296. }
  7297. },
  7298. "metadata": {
  7299. "type": "object",
  7300. "propertyNames": {
  7301. "type": "string"
  7302. },
  7303. "additionalProperties": {}
  7304. },
  7305. "always": {
  7306. "type": "array",
  7307. "items": {
  7308. "type": "string"
  7309. }
  7310. },
  7311. "tool": {
  7312. "type": "object",
  7313. "properties": {
  7314. "messageID": {
  7315. "type": "string",
  7316. "pattern": "^msg.*"
  7317. },
  7318. "callID": {
  7319. "type": "string"
  7320. }
  7321. },
  7322. "required": ["messageID", "callID"]
  7323. }
  7324. },
  7325. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  7326. },
  7327. "Event.permission.asked": {
  7328. "type": "object",
  7329. "properties": {
  7330. "type": {
  7331. "type": "string",
  7332. "const": "permission.asked"
  7333. },
  7334. "properties": {
  7335. "$ref": "#/components/schemas/PermissionRequest"
  7336. }
  7337. },
  7338. "required": ["type", "properties"]
  7339. },
  7340. "Event.permission.replied": {
  7341. "type": "object",
  7342. "properties": {
  7343. "type": {
  7344. "type": "string",
  7345. "const": "permission.replied"
  7346. },
  7347. "properties": {
  7348. "type": "object",
  7349. "properties": {
  7350. "sessionID": {
  7351. "type": "string",
  7352. "pattern": "^ses.*"
  7353. },
  7354. "requestID": {
  7355. "type": "string",
  7356. "pattern": "^per.*"
  7357. },
  7358. "reply": {
  7359. "type": "string",
  7360. "enum": ["once", "always", "reject"]
  7361. }
  7362. },
  7363. "required": ["sessionID", "requestID", "reply"]
  7364. }
  7365. },
  7366. "required": ["type", "properties"]
  7367. },
  7368. "SessionStatus": {
  7369. "anyOf": [
  7370. {
  7371. "type": "object",
  7372. "properties": {
  7373. "type": {
  7374. "type": "string",
  7375. "const": "idle"
  7376. }
  7377. },
  7378. "required": ["type"]
  7379. },
  7380. {
  7381. "type": "object",
  7382. "properties": {
  7383. "type": {
  7384. "type": "string",
  7385. "const": "retry"
  7386. },
  7387. "attempt": {
  7388. "type": "number"
  7389. },
  7390. "message": {
  7391. "type": "string"
  7392. },
  7393. "next": {
  7394. "type": "number"
  7395. }
  7396. },
  7397. "required": ["type", "attempt", "message", "next"]
  7398. },
  7399. {
  7400. "type": "object",
  7401. "properties": {
  7402. "type": {
  7403. "type": "string",
  7404. "const": "busy"
  7405. }
  7406. },
  7407. "required": ["type"]
  7408. }
  7409. ]
  7410. },
  7411. "Event.session.status": {
  7412. "type": "object",
  7413. "properties": {
  7414. "type": {
  7415. "type": "string",
  7416. "const": "session.status"
  7417. },
  7418. "properties": {
  7419. "type": "object",
  7420. "properties": {
  7421. "sessionID": {
  7422. "type": "string",
  7423. "pattern": "^ses.*"
  7424. },
  7425. "status": {
  7426. "$ref": "#/components/schemas/SessionStatus"
  7427. }
  7428. },
  7429. "required": ["sessionID", "status"]
  7430. }
  7431. },
  7432. "required": ["type", "properties"]
  7433. },
  7434. "Event.session.idle": {
  7435. "type": "object",
  7436. "properties": {
  7437. "type": {
  7438. "type": "string",
  7439. "const": "session.idle"
  7440. },
  7441. "properties": {
  7442. "type": "object",
  7443. "properties": {
  7444. "sessionID": {
  7445. "type": "string",
  7446. "pattern": "^ses.*"
  7447. }
  7448. },
  7449. "required": ["sessionID"]
  7450. }
  7451. },
  7452. "required": ["type", "properties"]
  7453. },
  7454. "QuestionOption": {
  7455. "type": "object",
  7456. "properties": {
  7457. "label": {
  7458. "description": "Display text (1-5 words, concise)",
  7459. "type": "string"
  7460. },
  7461. "description": {
  7462. "description": "Explanation of choice",
  7463. "type": "string"
  7464. }
  7465. },
  7466. "required": ["label", "description"]
  7467. },
  7468. "QuestionInfo": {
  7469. "type": "object",
  7470. "properties": {
  7471. "question": {
  7472. "description": "Complete question",
  7473. "type": "string"
  7474. },
  7475. "header": {
  7476. "description": "Very short label (max 30 chars)",
  7477. "type": "string"
  7478. },
  7479. "options": {
  7480. "description": "Available choices",
  7481. "type": "array",
  7482. "items": {
  7483. "$ref": "#/components/schemas/QuestionOption"
  7484. }
  7485. },
  7486. "multiple": {
  7487. "description": "Allow selecting multiple choices",
  7488. "type": "boolean"
  7489. },
  7490. "custom": {
  7491. "description": "Allow typing a custom answer (default: true)",
  7492. "type": "boolean"
  7493. }
  7494. },
  7495. "required": ["question", "header", "options"]
  7496. },
  7497. "QuestionRequest": {
  7498. "type": "object",
  7499. "properties": {
  7500. "id": {
  7501. "type": "string",
  7502. "pattern": "^que.*"
  7503. },
  7504. "sessionID": {
  7505. "type": "string",
  7506. "pattern": "^ses.*"
  7507. },
  7508. "questions": {
  7509. "description": "Questions to ask",
  7510. "type": "array",
  7511. "items": {
  7512. "$ref": "#/components/schemas/QuestionInfo"
  7513. }
  7514. },
  7515. "tool": {
  7516. "type": "object",
  7517. "properties": {
  7518. "messageID": {
  7519. "type": "string",
  7520. "pattern": "^msg.*"
  7521. },
  7522. "callID": {
  7523. "type": "string"
  7524. }
  7525. },
  7526. "required": ["messageID", "callID"]
  7527. }
  7528. },
  7529. "required": ["id", "sessionID", "questions"]
  7530. },
  7531. "Event.question.asked": {
  7532. "type": "object",
  7533. "properties": {
  7534. "type": {
  7535. "type": "string",
  7536. "const": "question.asked"
  7537. },
  7538. "properties": {
  7539. "$ref": "#/components/schemas/QuestionRequest"
  7540. }
  7541. },
  7542. "required": ["type", "properties"]
  7543. },
  7544. "QuestionAnswer": {
  7545. "type": "array",
  7546. "items": {
  7547. "type": "string"
  7548. }
  7549. },
  7550. "Event.question.replied": {
  7551. "type": "object",
  7552. "properties": {
  7553. "type": {
  7554. "type": "string",
  7555. "const": "question.replied"
  7556. },
  7557. "properties": {
  7558. "type": "object",
  7559. "properties": {
  7560. "sessionID": {
  7561. "type": "string",
  7562. "pattern": "^ses.*"
  7563. },
  7564. "requestID": {
  7565. "type": "string",
  7566. "pattern": "^que.*"
  7567. },
  7568. "answers": {
  7569. "type": "array",
  7570. "items": {
  7571. "$ref": "#/components/schemas/QuestionAnswer"
  7572. }
  7573. }
  7574. },
  7575. "required": ["sessionID", "requestID", "answers"]
  7576. }
  7577. },
  7578. "required": ["type", "properties"]
  7579. },
  7580. "Event.question.rejected": {
  7581. "type": "object",
  7582. "properties": {
  7583. "type": {
  7584. "type": "string",
  7585. "const": "question.rejected"
  7586. },
  7587. "properties": {
  7588. "type": "object",
  7589. "properties": {
  7590. "sessionID": {
  7591. "type": "string",
  7592. "pattern": "^ses.*"
  7593. },
  7594. "requestID": {
  7595. "type": "string",
  7596. "pattern": "^que.*"
  7597. }
  7598. },
  7599. "required": ["sessionID", "requestID"]
  7600. }
  7601. },
  7602. "required": ["type", "properties"]
  7603. },
  7604. "Event.session.compacted": {
  7605. "type": "object",
  7606. "properties": {
  7607. "type": {
  7608. "type": "string",
  7609. "const": "session.compacted"
  7610. },
  7611. "properties": {
  7612. "type": "object",
  7613. "properties": {
  7614. "sessionID": {
  7615. "type": "string",
  7616. "pattern": "^ses.*"
  7617. }
  7618. },
  7619. "required": ["sessionID"]
  7620. }
  7621. },
  7622. "required": ["type", "properties"]
  7623. },
  7624. "Event.file.edited": {
  7625. "type": "object",
  7626. "properties": {
  7627. "type": {
  7628. "type": "string",
  7629. "const": "file.edited"
  7630. },
  7631. "properties": {
  7632. "type": "object",
  7633. "properties": {
  7634. "file": {
  7635. "type": "string"
  7636. }
  7637. },
  7638. "required": ["file"]
  7639. }
  7640. },
  7641. "required": ["type", "properties"]
  7642. },
  7643. "Event.file.watcher.updated": {
  7644. "type": "object",
  7645. "properties": {
  7646. "type": {
  7647. "type": "string",
  7648. "const": "file.watcher.updated"
  7649. },
  7650. "properties": {
  7651. "type": "object",
  7652. "properties": {
  7653. "file": {
  7654. "type": "string"
  7655. },
  7656. "event": {
  7657. "anyOf": [
  7658. {
  7659. "type": "string",
  7660. "const": "add"
  7661. },
  7662. {
  7663. "type": "string",
  7664. "const": "change"
  7665. },
  7666. {
  7667. "type": "string",
  7668. "const": "unlink"
  7669. }
  7670. ]
  7671. }
  7672. },
  7673. "required": ["file", "event"]
  7674. }
  7675. },
  7676. "required": ["type", "properties"]
  7677. },
  7678. "Todo": {
  7679. "type": "object",
  7680. "properties": {
  7681. "content": {
  7682. "description": "Brief description of the task",
  7683. "type": "string"
  7684. },
  7685. "status": {
  7686. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  7687. "type": "string"
  7688. },
  7689. "priority": {
  7690. "description": "Priority level of the task: high, medium, low",
  7691. "type": "string"
  7692. }
  7693. },
  7694. "required": ["content", "status", "priority"]
  7695. },
  7696. "Event.todo.updated": {
  7697. "type": "object",
  7698. "properties": {
  7699. "type": {
  7700. "type": "string",
  7701. "const": "todo.updated"
  7702. },
  7703. "properties": {
  7704. "type": "object",
  7705. "properties": {
  7706. "sessionID": {
  7707. "type": "string",
  7708. "pattern": "^ses.*"
  7709. },
  7710. "todos": {
  7711. "type": "array",
  7712. "items": {
  7713. "$ref": "#/components/schemas/Todo"
  7714. }
  7715. }
  7716. },
  7717. "required": ["sessionID", "todos"]
  7718. }
  7719. },
  7720. "required": ["type", "properties"]
  7721. },
  7722. "Event.tui.prompt.append": {
  7723. "type": "object",
  7724. "properties": {
  7725. "type": {
  7726. "type": "string",
  7727. "const": "tui.prompt.append"
  7728. },
  7729. "properties": {
  7730. "type": "object",
  7731. "properties": {
  7732. "text": {
  7733. "type": "string"
  7734. }
  7735. },
  7736. "required": ["text"]
  7737. }
  7738. },
  7739. "required": ["type", "properties"]
  7740. },
  7741. "Event.tui.command.execute": {
  7742. "type": "object",
  7743. "properties": {
  7744. "type": {
  7745. "type": "string",
  7746. "const": "tui.command.execute"
  7747. },
  7748. "properties": {
  7749. "type": "object",
  7750. "properties": {
  7751. "command": {
  7752. "anyOf": [
  7753. {
  7754. "type": "string",
  7755. "enum": [
  7756. "session.list",
  7757. "session.new",
  7758. "session.share",
  7759. "session.interrupt",
  7760. "session.compact",
  7761. "session.page.up",
  7762. "session.page.down",
  7763. "session.line.up",
  7764. "session.line.down",
  7765. "session.half.page.up",
  7766. "session.half.page.down",
  7767. "session.first",
  7768. "session.last",
  7769. "prompt.clear",
  7770. "prompt.submit",
  7771. "agent.cycle"
  7772. ]
  7773. },
  7774. {
  7775. "type": "string"
  7776. }
  7777. ]
  7778. }
  7779. },
  7780. "required": ["command"]
  7781. }
  7782. },
  7783. "required": ["type", "properties"]
  7784. },
  7785. "Event.tui.toast.show": {
  7786. "type": "object",
  7787. "properties": {
  7788. "type": {
  7789. "type": "string",
  7790. "const": "tui.toast.show"
  7791. },
  7792. "properties": {
  7793. "type": "object",
  7794. "properties": {
  7795. "title": {
  7796. "type": "string"
  7797. },
  7798. "message": {
  7799. "type": "string"
  7800. },
  7801. "variant": {
  7802. "type": "string",
  7803. "enum": ["info", "success", "warning", "error"]
  7804. },
  7805. "duration": {
  7806. "description": "Duration in milliseconds",
  7807. "default": 5000,
  7808. "type": "number"
  7809. }
  7810. },
  7811. "required": ["message", "variant"]
  7812. }
  7813. },
  7814. "required": ["type", "properties"]
  7815. },
  7816. "Event.tui.session.select": {
  7817. "type": "object",
  7818. "properties": {
  7819. "type": {
  7820. "type": "string",
  7821. "const": "tui.session.select"
  7822. },
  7823. "properties": {
  7824. "type": "object",
  7825. "properties": {
  7826. "sessionID": {
  7827. "description": "Session ID to navigate to",
  7828. "type": "string",
  7829. "pattern": "^ses.*"
  7830. }
  7831. },
  7832. "required": ["sessionID"]
  7833. }
  7834. },
  7835. "required": ["type", "properties"]
  7836. },
  7837. "Event.mcp.tools.changed": {
  7838. "type": "object",
  7839. "properties": {
  7840. "type": {
  7841. "type": "string",
  7842. "const": "mcp.tools.changed"
  7843. },
  7844. "properties": {
  7845. "type": "object",
  7846. "properties": {
  7847. "server": {
  7848. "type": "string"
  7849. }
  7850. },
  7851. "required": ["server"]
  7852. }
  7853. },
  7854. "required": ["type", "properties"]
  7855. },
  7856. "Event.mcp.browser.open.failed": {
  7857. "type": "object",
  7858. "properties": {
  7859. "type": {
  7860. "type": "string",
  7861. "const": "mcp.browser.open.failed"
  7862. },
  7863. "properties": {
  7864. "type": "object",
  7865. "properties": {
  7866. "mcpName": {
  7867. "type": "string"
  7868. },
  7869. "url": {
  7870. "type": "string"
  7871. }
  7872. },
  7873. "required": ["mcpName", "url"]
  7874. }
  7875. },
  7876. "required": ["type", "properties"]
  7877. },
  7878. "Event.command.executed": {
  7879. "type": "object",
  7880. "properties": {
  7881. "type": {
  7882. "type": "string",
  7883. "const": "command.executed"
  7884. },
  7885. "properties": {
  7886. "type": "object",
  7887. "properties": {
  7888. "name": {
  7889. "type": "string"
  7890. },
  7891. "sessionID": {
  7892. "type": "string",
  7893. "pattern": "^ses.*"
  7894. },
  7895. "arguments": {
  7896. "type": "string"
  7897. },
  7898. "messageID": {
  7899. "type": "string",
  7900. "pattern": "^msg.*"
  7901. }
  7902. },
  7903. "required": ["name", "sessionID", "arguments", "messageID"]
  7904. }
  7905. },
  7906. "required": ["type", "properties"]
  7907. },
  7908. "FileDiff": {
  7909. "type": "object",
  7910. "properties": {
  7911. "file": {
  7912. "type": "string"
  7913. },
  7914. "before": {
  7915. "type": "string"
  7916. },
  7917. "after": {
  7918. "type": "string"
  7919. },
  7920. "additions": {
  7921. "type": "number"
  7922. },
  7923. "deletions": {
  7924. "type": "number"
  7925. },
  7926. "status": {
  7927. "type": "string",
  7928. "enum": ["added", "deleted", "modified"]
  7929. }
  7930. },
  7931. "required": ["file", "before", "after", "additions", "deletions"]
  7932. },
  7933. "Event.session.diff": {
  7934. "type": "object",
  7935. "properties": {
  7936. "type": {
  7937. "type": "string",
  7938. "const": "session.diff"
  7939. },
  7940. "properties": {
  7941. "type": "object",
  7942. "properties": {
  7943. "sessionID": {
  7944. "type": "string",
  7945. "pattern": "^ses.*"
  7946. },
  7947. "diff": {
  7948. "type": "array",
  7949. "items": {
  7950. "$ref": "#/components/schemas/FileDiff"
  7951. }
  7952. }
  7953. },
  7954. "required": ["sessionID", "diff"]
  7955. }
  7956. },
  7957. "required": ["type", "properties"]
  7958. },
  7959. "ProviderAuthError": {
  7960. "type": "object",
  7961. "properties": {
  7962. "name": {
  7963. "type": "string",
  7964. "const": "ProviderAuthError"
  7965. },
  7966. "data": {
  7967. "type": "object",
  7968. "properties": {
  7969. "providerID": {
  7970. "type": "string"
  7971. },
  7972. "message": {
  7973. "type": "string"
  7974. }
  7975. },
  7976. "required": ["providerID", "message"]
  7977. }
  7978. },
  7979. "required": ["name", "data"]
  7980. },
  7981. "UnknownError": {
  7982. "type": "object",
  7983. "properties": {
  7984. "name": {
  7985. "type": "string",
  7986. "const": "UnknownError"
  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. "MessageOutputLengthError": {
  8001. "type": "object",
  8002. "properties": {
  8003. "name": {
  8004. "type": "string",
  8005. "const": "MessageOutputLengthError"
  8006. },
  8007. "data": {
  8008. "type": "object",
  8009. "properties": {}
  8010. }
  8011. },
  8012. "required": ["name", "data"]
  8013. },
  8014. "MessageAbortedError": {
  8015. "type": "object",
  8016. "properties": {
  8017. "name": {
  8018. "type": "string",
  8019. "const": "MessageAbortedError"
  8020. },
  8021. "data": {
  8022. "type": "object",
  8023. "properties": {
  8024. "message": {
  8025. "type": "string"
  8026. }
  8027. },
  8028. "required": ["message"]
  8029. }
  8030. },
  8031. "required": ["name", "data"]
  8032. },
  8033. "StructuredOutputError": {
  8034. "type": "object",
  8035. "properties": {
  8036. "name": {
  8037. "type": "string",
  8038. "const": "StructuredOutputError"
  8039. },
  8040. "data": {
  8041. "type": "object",
  8042. "properties": {
  8043. "message": {
  8044. "type": "string"
  8045. },
  8046. "retries": {
  8047. "type": "number"
  8048. }
  8049. },
  8050. "required": ["message", "retries"]
  8051. }
  8052. },
  8053. "required": ["name", "data"]
  8054. },
  8055. "ContextOverflowError": {
  8056. "type": "object",
  8057. "properties": {
  8058. "name": {
  8059. "type": "string",
  8060. "const": "ContextOverflowError"
  8061. },
  8062. "data": {
  8063. "type": "object",
  8064. "properties": {
  8065. "message": {
  8066. "type": "string"
  8067. },
  8068. "responseBody": {
  8069. "type": "string"
  8070. }
  8071. },
  8072. "required": ["message"]
  8073. }
  8074. },
  8075. "required": ["name", "data"]
  8076. },
  8077. "APIError": {
  8078. "type": "object",
  8079. "properties": {
  8080. "name": {
  8081. "type": "string",
  8082. "const": "APIError"
  8083. },
  8084. "data": {
  8085. "type": "object",
  8086. "properties": {
  8087. "message": {
  8088. "type": "string"
  8089. },
  8090. "statusCode": {
  8091. "type": "number"
  8092. },
  8093. "isRetryable": {
  8094. "type": "boolean"
  8095. },
  8096. "responseHeaders": {
  8097. "type": "object",
  8098. "propertyNames": {
  8099. "type": "string"
  8100. },
  8101. "additionalProperties": {
  8102. "type": "string"
  8103. }
  8104. },
  8105. "responseBody": {
  8106. "type": "string"
  8107. },
  8108. "metadata": {
  8109. "type": "object",
  8110. "propertyNames": {
  8111. "type": "string"
  8112. },
  8113. "additionalProperties": {
  8114. "type": "string"
  8115. }
  8116. }
  8117. },
  8118. "required": ["message", "isRetryable"]
  8119. }
  8120. },
  8121. "required": ["name", "data"]
  8122. },
  8123. "Event.session.error": {
  8124. "type": "object",
  8125. "properties": {
  8126. "type": {
  8127. "type": "string",
  8128. "const": "session.error"
  8129. },
  8130. "properties": {
  8131. "type": "object",
  8132. "properties": {
  8133. "sessionID": {
  8134. "type": "string",
  8135. "pattern": "^ses.*"
  8136. },
  8137. "error": {
  8138. "anyOf": [
  8139. {
  8140. "$ref": "#/components/schemas/ProviderAuthError"
  8141. },
  8142. {
  8143. "$ref": "#/components/schemas/UnknownError"
  8144. },
  8145. {
  8146. "$ref": "#/components/schemas/MessageOutputLengthError"
  8147. },
  8148. {
  8149. "$ref": "#/components/schemas/MessageAbortedError"
  8150. },
  8151. {
  8152. "$ref": "#/components/schemas/StructuredOutputError"
  8153. },
  8154. {
  8155. "$ref": "#/components/schemas/ContextOverflowError"
  8156. },
  8157. {
  8158. "$ref": "#/components/schemas/APIError"
  8159. }
  8160. ]
  8161. }
  8162. }
  8163. }
  8164. },
  8165. "required": ["type", "properties"]
  8166. },
  8167. "Event.vcs.branch.updated": {
  8168. "type": "object",
  8169. "properties": {
  8170. "type": {
  8171. "type": "string",
  8172. "const": "vcs.branch.updated"
  8173. },
  8174. "properties": {
  8175. "type": "object",
  8176. "properties": {
  8177. "branch": {
  8178. "type": "string"
  8179. }
  8180. }
  8181. }
  8182. },
  8183. "required": ["type", "properties"]
  8184. },
  8185. "Event.workspace.ready": {
  8186. "type": "object",
  8187. "properties": {
  8188. "type": {
  8189. "type": "string",
  8190. "const": "workspace.ready"
  8191. },
  8192. "properties": {
  8193. "type": "object",
  8194. "properties": {
  8195. "name": {
  8196. "type": "string"
  8197. }
  8198. },
  8199. "required": ["name"]
  8200. }
  8201. },
  8202. "required": ["type", "properties"]
  8203. },
  8204. "Event.workspace.failed": {
  8205. "type": "object",
  8206. "properties": {
  8207. "type": {
  8208. "type": "string",
  8209. "const": "workspace.failed"
  8210. },
  8211. "properties": {
  8212. "type": "object",
  8213. "properties": {
  8214. "message": {
  8215. "type": "string"
  8216. }
  8217. },
  8218. "required": ["message"]
  8219. }
  8220. },
  8221. "required": ["type", "properties"]
  8222. },
  8223. "Pty": {
  8224. "type": "object",
  8225. "properties": {
  8226. "id": {
  8227. "type": "string",
  8228. "pattern": "^pty.*"
  8229. },
  8230. "title": {
  8231. "type": "string"
  8232. },
  8233. "command": {
  8234. "type": "string"
  8235. },
  8236. "args": {
  8237. "type": "array",
  8238. "items": {
  8239. "type": "string"
  8240. }
  8241. },
  8242. "cwd": {
  8243. "type": "string"
  8244. },
  8245. "status": {
  8246. "type": "string",
  8247. "enum": ["running", "exited"]
  8248. },
  8249. "pid": {
  8250. "type": "number"
  8251. }
  8252. },
  8253. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  8254. },
  8255. "Event.pty.created": {
  8256. "type": "object",
  8257. "properties": {
  8258. "type": {
  8259. "type": "string",
  8260. "const": "pty.created"
  8261. },
  8262. "properties": {
  8263. "type": "object",
  8264. "properties": {
  8265. "info": {
  8266. "$ref": "#/components/schemas/Pty"
  8267. }
  8268. },
  8269. "required": ["info"]
  8270. }
  8271. },
  8272. "required": ["type", "properties"]
  8273. },
  8274. "Event.pty.updated": {
  8275. "type": "object",
  8276. "properties": {
  8277. "type": {
  8278. "type": "string",
  8279. "const": "pty.updated"
  8280. },
  8281. "properties": {
  8282. "type": "object",
  8283. "properties": {
  8284. "info": {
  8285. "$ref": "#/components/schemas/Pty"
  8286. }
  8287. },
  8288. "required": ["info"]
  8289. }
  8290. },
  8291. "required": ["type", "properties"]
  8292. },
  8293. "Event.pty.exited": {
  8294. "type": "object",
  8295. "properties": {
  8296. "type": {
  8297. "type": "string",
  8298. "const": "pty.exited"
  8299. },
  8300. "properties": {
  8301. "type": "object",
  8302. "properties": {
  8303. "id": {
  8304. "type": "string",
  8305. "pattern": "^pty.*"
  8306. },
  8307. "exitCode": {
  8308. "type": "number"
  8309. }
  8310. },
  8311. "required": ["id", "exitCode"]
  8312. }
  8313. },
  8314. "required": ["type", "properties"]
  8315. },
  8316. "Event.pty.deleted": {
  8317. "type": "object",
  8318. "properties": {
  8319. "type": {
  8320. "type": "string",
  8321. "const": "pty.deleted"
  8322. },
  8323. "properties": {
  8324. "type": "object",
  8325. "properties": {
  8326. "id": {
  8327. "type": "string",
  8328. "pattern": "^pty.*"
  8329. }
  8330. },
  8331. "required": ["id"]
  8332. }
  8333. },
  8334. "required": ["type", "properties"]
  8335. },
  8336. "Event.worktree.ready": {
  8337. "type": "object",
  8338. "properties": {
  8339. "type": {
  8340. "type": "string",
  8341. "const": "worktree.ready"
  8342. },
  8343. "properties": {
  8344. "type": "object",
  8345. "properties": {
  8346. "name": {
  8347. "type": "string"
  8348. },
  8349. "branch": {
  8350. "type": "string"
  8351. }
  8352. },
  8353. "required": ["name", "branch"]
  8354. }
  8355. },
  8356. "required": ["type", "properties"]
  8357. },
  8358. "Event.worktree.failed": {
  8359. "type": "object",
  8360. "properties": {
  8361. "type": {
  8362. "type": "string",
  8363. "const": "worktree.failed"
  8364. },
  8365. "properties": {
  8366. "type": "object",
  8367. "properties": {
  8368. "message": {
  8369. "type": "string"
  8370. }
  8371. },
  8372. "required": ["message"]
  8373. }
  8374. },
  8375. "required": ["type", "properties"]
  8376. },
  8377. "OutputFormatText": {
  8378. "type": "object",
  8379. "properties": {
  8380. "type": {
  8381. "type": "string",
  8382. "const": "text"
  8383. }
  8384. },
  8385. "required": ["type"]
  8386. },
  8387. "JSONSchema": {
  8388. "type": "object",
  8389. "propertyNames": {
  8390. "type": "string"
  8391. },
  8392. "additionalProperties": {}
  8393. },
  8394. "OutputFormatJsonSchema": {
  8395. "type": "object",
  8396. "properties": {
  8397. "type": {
  8398. "type": "string",
  8399. "const": "json_schema"
  8400. },
  8401. "schema": {
  8402. "$ref": "#/components/schemas/JSONSchema"
  8403. },
  8404. "retryCount": {
  8405. "default": 2,
  8406. "type": "integer",
  8407. "minimum": 0,
  8408. "maximum": 9007199254740991
  8409. }
  8410. },
  8411. "required": ["type", "schema"]
  8412. },
  8413. "OutputFormat": {
  8414. "anyOf": [
  8415. {
  8416. "$ref": "#/components/schemas/OutputFormatText"
  8417. },
  8418. {
  8419. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  8420. }
  8421. ]
  8422. },
  8423. "UserMessage": {
  8424. "type": "object",
  8425. "properties": {
  8426. "id": {
  8427. "type": "string",
  8428. "pattern": "^msg.*"
  8429. },
  8430. "sessionID": {
  8431. "type": "string",
  8432. "pattern": "^ses.*"
  8433. },
  8434. "role": {
  8435. "type": "string",
  8436. "const": "user"
  8437. },
  8438. "time": {
  8439. "type": "object",
  8440. "properties": {
  8441. "created": {
  8442. "type": "number"
  8443. }
  8444. },
  8445. "required": ["created"]
  8446. },
  8447. "format": {
  8448. "$ref": "#/components/schemas/OutputFormat"
  8449. },
  8450. "summary": {
  8451. "type": "object",
  8452. "properties": {
  8453. "title": {
  8454. "type": "string"
  8455. },
  8456. "body": {
  8457. "type": "string"
  8458. },
  8459. "diffs": {
  8460. "type": "array",
  8461. "items": {
  8462. "$ref": "#/components/schemas/FileDiff"
  8463. }
  8464. }
  8465. },
  8466. "required": ["diffs"]
  8467. },
  8468. "agent": {
  8469. "type": "string"
  8470. },
  8471. "model": {
  8472. "type": "object",
  8473. "properties": {
  8474. "providerID": {
  8475. "type": "string"
  8476. },
  8477. "modelID": {
  8478. "type": "string"
  8479. }
  8480. },
  8481. "required": ["providerID", "modelID"]
  8482. },
  8483. "system": {
  8484. "type": "string"
  8485. },
  8486. "tools": {
  8487. "type": "object",
  8488. "propertyNames": {
  8489. "type": "string"
  8490. },
  8491. "additionalProperties": {
  8492. "type": "boolean"
  8493. }
  8494. },
  8495. "variant": {
  8496. "type": "string"
  8497. }
  8498. },
  8499. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  8500. },
  8501. "AssistantMessage": {
  8502. "type": "object",
  8503. "properties": {
  8504. "id": {
  8505. "type": "string",
  8506. "pattern": "^msg.*"
  8507. },
  8508. "sessionID": {
  8509. "type": "string",
  8510. "pattern": "^ses.*"
  8511. },
  8512. "role": {
  8513. "type": "string",
  8514. "const": "assistant"
  8515. },
  8516. "time": {
  8517. "type": "object",
  8518. "properties": {
  8519. "created": {
  8520. "type": "number"
  8521. },
  8522. "completed": {
  8523. "type": "number"
  8524. }
  8525. },
  8526. "required": ["created"]
  8527. },
  8528. "error": {
  8529. "anyOf": [
  8530. {
  8531. "$ref": "#/components/schemas/ProviderAuthError"
  8532. },
  8533. {
  8534. "$ref": "#/components/schemas/UnknownError"
  8535. },
  8536. {
  8537. "$ref": "#/components/schemas/MessageOutputLengthError"
  8538. },
  8539. {
  8540. "$ref": "#/components/schemas/MessageAbortedError"
  8541. },
  8542. {
  8543. "$ref": "#/components/schemas/StructuredOutputError"
  8544. },
  8545. {
  8546. "$ref": "#/components/schemas/ContextOverflowError"
  8547. },
  8548. {
  8549. "$ref": "#/components/schemas/APIError"
  8550. }
  8551. ]
  8552. },
  8553. "parentID": {
  8554. "type": "string",
  8555. "pattern": "^msg.*"
  8556. },
  8557. "modelID": {
  8558. "type": "string"
  8559. },
  8560. "providerID": {
  8561. "type": "string"
  8562. },
  8563. "mode": {
  8564. "type": "string"
  8565. },
  8566. "agent": {
  8567. "type": "string"
  8568. },
  8569. "path": {
  8570. "type": "object",
  8571. "properties": {
  8572. "cwd": {
  8573. "type": "string"
  8574. },
  8575. "root": {
  8576. "type": "string"
  8577. }
  8578. },
  8579. "required": ["cwd", "root"]
  8580. },
  8581. "summary": {
  8582. "type": "boolean"
  8583. },
  8584. "cost": {
  8585. "type": "number"
  8586. },
  8587. "tokens": {
  8588. "type": "object",
  8589. "properties": {
  8590. "total": {
  8591. "type": "number"
  8592. },
  8593. "input": {
  8594. "type": "number"
  8595. },
  8596. "output": {
  8597. "type": "number"
  8598. },
  8599. "reasoning": {
  8600. "type": "number"
  8601. },
  8602. "cache": {
  8603. "type": "object",
  8604. "properties": {
  8605. "read": {
  8606. "type": "number"
  8607. },
  8608. "write": {
  8609. "type": "number"
  8610. }
  8611. },
  8612. "required": ["read", "write"]
  8613. }
  8614. },
  8615. "required": ["input", "output", "reasoning", "cache"]
  8616. },
  8617. "structured": {},
  8618. "variant": {
  8619. "type": "string"
  8620. },
  8621. "finish": {
  8622. "type": "string"
  8623. }
  8624. },
  8625. "required": [
  8626. "id",
  8627. "sessionID",
  8628. "role",
  8629. "time",
  8630. "parentID",
  8631. "modelID",
  8632. "providerID",
  8633. "mode",
  8634. "agent",
  8635. "path",
  8636. "cost",
  8637. "tokens"
  8638. ]
  8639. },
  8640. "Message": {
  8641. "anyOf": [
  8642. {
  8643. "$ref": "#/components/schemas/UserMessage"
  8644. },
  8645. {
  8646. "$ref": "#/components/schemas/AssistantMessage"
  8647. }
  8648. ]
  8649. },
  8650. "Event.message.updated": {
  8651. "type": "object",
  8652. "properties": {
  8653. "type": {
  8654. "type": "string",
  8655. "const": "message.updated"
  8656. },
  8657. "properties": {
  8658. "type": "object",
  8659. "properties": {
  8660. "sessionID": {
  8661. "type": "string",
  8662. "pattern": "^ses.*"
  8663. },
  8664. "info": {
  8665. "$ref": "#/components/schemas/Message"
  8666. }
  8667. },
  8668. "required": ["sessionID", "info"]
  8669. }
  8670. },
  8671. "required": ["type", "properties"]
  8672. },
  8673. "Event.message.removed": {
  8674. "type": "object",
  8675. "properties": {
  8676. "type": {
  8677. "type": "string",
  8678. "const": "message.removed"
  8679. },
  8680. "properties": {
  8681. "type": "object",
  8682. "properties": {
  8683. "sessionID": {
  8684. "type": "string",
  8685. "pattern": "^ses.*"
  8686. },
  8687. "messageID": {
  8688. "type": "string",
  8689. "pattern": "^msg.*"
  8690. }
  8691. },
  8692. "required": ["sessionID", "messageID"]
  8693. }
  8694. },
  8695. "required": ["type", "properties"]
  8696. },
  8697. "TextPart": {
  8698. "type": "object",
  8699. "properties": {
  8700. "id": {
  8701. "type": "string",
  8702. "pattern": "^prt.*"
  8703. },
  8704. "sessionID": {
  8705. "type": "string",
  8706. "pattern": "^ses.*"
  8707. },
  8708. "messageID": {
  8709. "type": "string",
  8710. "pattern": "^msg.*"
  8711. },
  8712. "type": {
  8713. "type": "string",
  8714. "const": "text"
  8715. },
  8716. "text": {
  8717. "type": "string"
  8718. },
  8719. "synthetic": {
  8720. "type": "boolean"
  8721. },
  8722. "ignored": {
  8723. "type": "boolean"
  8724. },
  8725. "time": {
  8726. "type": "object",
  8727. "properties": {
  8728. "start": {
  8729. "type": "number"
  8730. },
  8731. "end": {
  8732. "type": "number"
  8733. }
  8734. },
  8735. "required": ["start"]
  8736. },
  8737. "metadata": {
  8738. "type": "object",
  8739. "propertyNames": {
  8740. "type": "string"
  8741. },
  8742. "additionalProperties": {}
  8743. }
  8744. },
  8745. "required": ["id", "sessionID", "messageID", "type", "text"]
  8746. },
  8747. "SubtaskPart": {
  8748. "type": "object",
  8749. "properties": {
  8750. "id": {
  8751. "type": "string",
  8752. "pattern": "^prt.*"
  8753. },
  8754. "sessionID": {
  8755. "type": "string",
  8756. "pattern": "^ses.*"
  8757. },
  8758. "messageID": {
  8759. "type": "string",
  8760. "pattern": "^msg.*"
  8761. },
  8762. "type": {
  8763. "type": "string",
  8764. "const": "subtask"
  8765. },
  8766. "prompt": {
  8767. "type": "string"
  8768. },
  8769. "description": {
  8770. "type": "string"
  8771. },
  8772. "agent": {
  8773. "type": "string"
  8774. },
  8775. "model": {
  8776. "type": "object",
  8777. "properties": {
  8778. "providerID": {
  8779. "type": "string"
  8780. },
  8781. "modelID": {
  8782. "type": "string"
  8783. }
  8784. },
  8785. "required": ["providerID", "modelID"]
  8786. },
  8787. "command": {
  8788. "type": "string"
  8789. }
  8790. },
  8791. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  8792. },
  8793. "ReasoningPart": {
  8794. "type": "object",
  8795. "properties": {
  8796. "id": {
  8797. "type": "string",
  8798. "pattern": "^prt.*"
  8799. },
  8800. "sessionID": {
  8801. "type": "string",
  8802. "pattern": "^ses.*"
  8803. },
  8804. "messageID": {
  8805. "type": "string",
  8806. "pattern": "^msg.*"
  8807. },
  8808. "type": {
  8809. "type": "string",
  8810. "const": "reasoning"
  8811. },
  8812. "text": {
  8813. "type": "string"
  8814. },
  8815. "metadata": {
  8816. "type": "object",
  8817. "propertyNames": {
  8818. "type": "string"
  8819. },
  8820. "additionalProperties": {}
  8821. },
  8822. "time": {
  8823. "type": "object",
  8824. "properties": {
  8825. "start": {
  8826. "type": "number"
  8827. },
  8828. "end": {
  8829. "type": "number"
  8830. }
  8831. },
  8832. "required": ["start"]
  8833. }
  8834. },
  8835. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  8836. },
  8837. "FilePartSourceText": {
  8838. "type": "object",
  8839. "properties": {
  8840. "value": {
  8841. "type": "string"
  8842. },
  8843. "start": {
  8844. "type": "integer",
  8845. "minimum": -9007199254740991,
  8846. "maximum": 9007199254740991
  8847. },
  8848. "end": {
  8849. "type": "integer",
  8850. "minimum": -9007199254740991,
  8851. "maximum": 9007199254740991
  8852. }
  8853. },
  8854. "required": ["value", "start", "end"]
  8855. },
  8856. "FileSource": {
  8857. "type": "object",
  8858. "properties": {
  8859. "text": {
  8860. "$ref": "#/components/schemas/FilePartSourceText"
  8861. },
  8862. "type": {
  8863. "type": "string",
  8864. "const": "file"
  8865. },
  8866. "path": {
  8867. "type": "string"
  8868. }
  8869. },
  8870. "required": ["text", "type", "path"]
  8871. },
  8872. "Range": {
  8873. "type": "object",
  8874. "properties": {
  8875. "start": {
  8876. "type": "object",
  8877. "properties": {
  8878. "line": {
  8879. "type": "number"
  8880. },
  8881. "character": {
  8882. "type": "number"
  8883. }
  8884. },
  8885. "required": ["line", "character"]
  8886. },
  8887. "end": {
  8888. "type": "object",
  8889. "properties": {
  8890. "line": {
  8891. "type": "number"
  8892. },
  8893. "character": {
  8894. "type": "number"
  8895. }
  8896. },
  8897. "required": ["line", "character"]
  8898. }
  8899. },
  8900. "required": ["start", "end"]
  8901. },
  8902. "SymbolSource": {
  8903. "type": "object",
  8904. "properties": {
  8905. "text": {
  8906. "$ref": "#/components/schemas/FilePartSourceText"
  8907. },
  8908. "type": {
  8909. "type": "string",
  8910. "const": "symbol"
  8911. },
  8912. "path": {
  8913. "type": "string"
  8914. },
  8915. "range": {
  8916. "$ref": "#/components/schemas/Range"
  8917. },
  8918. "name": {
  8919. "type": "string"
  8920. },
  8921. "kind": {
  8922. "type": "integer",
  8923. "minimum": -9007199254740991,
  8924. "maximum": 9007199254740991
  8925. }
  8926. },
  8927. "required": ["text", "type", "path", "range", "name", "kind"]
  8928. },
  8929. "ResourceSource": {
  8930. "type": "object",
  8931. "properties": {
  8932. "text": {
  8933. "$ref": "#/components/schemas/FilePartSourceText"
  8934. },
  8935. "type": {
  8936. "type": "string",
  8937. "const": "resource"
  8938. },
  8939. "clientName": {
  8940. "type": "string"
  8941. },
  8942. "uri": {
  8943. "type": "string"
  8944. }
  8945. },
  8946. "required": ["text", "type", "clientName", "uri"]
  8947. },
  8948. "FilePartSource": {
  8949. "anyOf": [
  8950. {
  8951. "$ref": "#/components/schemas/FileSource"
  8952. },
  8953. {
  8954. "$ref": "#/components/schemas/SymbolSource"
  8955. },
  8956. {
  8957. "$ref": "#/components/schemas/ResourceSource"
  8958. }
  8959. ]
  8960. },
  8961. "FilePart": {
  8962. "type": "object",
  8963. "properties": {
  8964. "id": {
  8965. "type": "string",
  8966. "pattern": "^prt.*"
  8967. },
  8968. "sessionID": {
  8969. "type": "string",
  8970. "pattern": "^ses.*"
  8971. },
  8972. "messageID": {
  8973. "type": "string",
  8974. "pattern": "^msg.*"
  8975. },
  8976. "type": {
  8977. "type": "string",
  8978. "const": "file"
  8979. },
  8980. "mime": {
  8981. "type": "string"
  8982. },
  8983. "filename": {
  8984. "type": "string"
  8985. },
  8986. "url": {
  8987. "type": "string"
  8988. },
  8989. "source": {
  8990. "$ref": "#/components/schemas/FilePartSource"
  8991. }
  8992. },
  8993. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  8994. },
  8995. "ToolStatePending": {
  8996. "type": "object",
  8997. "properties": {
  8998. "status": {
  8999. "type": "string",
  9000. "const": "pending"
  9001. },
  9002. "input": {
  9003. "type": "object",
  9004. "propertyNames": {
  9005. "type": "string"
  9006. },
  9007. "additionalProperties": {}
  9008. },
  9009. "raw": {
  9010. "type": "string"
  9011. }
  9012. },
  9013. "required": ["status", "input", "raw"]
  9014. },
  9015. "ToolStateRunning": {
  9016. "type": "object",
  9017. "properties": {
  9018. "status": {
  9019. "type": "string",
  9020. "const": "running"
  9021. },
  9022. "input": {
  9023. "type": "object",
  9024. "propertyNames": {
  9025. "type": "string"
  9026. },
  9027. "additionalProperties": {}
  9028. },
  9029. "title": {
  9030. "type": "string"
  9031. },
  9032. "metadata": {
  9033. "type": "object",
  9034. "propertyNames": {
  9035. "type": "string"
  9036. },
  9037. "additionalProperties": {}
  9038. },
  9039. "time": {
  9040. "type": "object",
  9041. "properties": {
  9042. "start": {
  9043. "type": "number"
  9044. }
  9045. },
  9046. "required": ["start"]
  9047. }
  9048. },
  9049. "required": ["status", "input", "time"]
  9050. },
  9051. "ToolStateCompleted": {
  9052. "type": "object",
  9053. "properties": {
  9054. "status": {
  9055. "type": "string",
  9056. "const": "completed"
  9057. },
  9058. "input": {
  9059. "type": "object",
  9060. "propertyNames": {
  9061. "type": "string"
  9062. },
  9063. "additionalProperties": {}
  9064. },
  9065. "output": {
  9066. "type": "string"
  9067. },
  9068. "title": {
  9069. "type": "string"
  9070. },
  9071. "metadata": {
  9072. "type": "object",
  9073. "propertyNames": {
  9074. "type": "string"
  9075. },
  9076. "additionalProperties": {}
  9077. },
  9078. "time": {
  9079. "type": "object",
  9080. "properties": {
  9081. "start": {
  9082. "type": "number"
  9083. },
  9084. "end": {
  9085. "type": "number"
  9086. },
  9087. "compacted": {
  9088. "type": "number"
  9089. }
  9090. },
  9091. "required": ["start", "end"]
  9092. },
  9093. "attachments": {
  9094. "type": "array",
  9095. "items": {
  9096. "$ref": "#/components/schemas/FilePart"
  9097. }
  9098. }
  9099. },
  9100. "required": ["status", "input", "output", "title", "metadata", "time"]
  9101. },
  9102. "ToolStateError": {
  9103. "type": "object",
  9104. "properties": {
  9105. "status": {
  9106. "type": "string",
  9107. "const": "error"
  9108. },
  9109. "input": {
  9110. "type": "object",
  9111. "propertyNames": {
  9112. "type": "string"
  9113. },
  9114. "additionalProperties": {}
  9115. },
  9116. "error": {
  9117. "type": "string"
  9118. },
  9119. "metadata": {
  9120. "type": "object",
  9121. "propertyNames": {
  9122. "type": "string"
  9123. },
  9124. "additionalProperties": {}
  9125. },
  9126. "time": {
  9127. "type": "object",
  9128. "properties": {
  9129. "start": {
  9130. "type": "number"
  9131. },
  9132. "end": {
  9133. "type": "number"
  9134. }
  9135. },
  9136. "required": ["start", "end"]
  9137. }
  9138. },
  9139. "required": ["status", "input", "error", "time"]
  9140. },
  9141. "ToolState": {
  9142. "anyOf": [
  9143. {
  9144. "$ref": "#/components/schemas/ToolStatePending"
  9145. },
  9146. {
  9147. "$ref": "#/components/schemas/ToolStateRunning"
  9148. },
  9149. {
  9150. "$ref": "#/components/schemas/ToolStateCompleted"
  9151. },
  9152. {
  9153. "$ref": "#/components/schemas/ToolStateError"
  9154. }
  9155. ]
  9156. },
  9157. "ToolPart": {
  9158. "type": "object",
  9159. "properties": {
  9160. "id": {
  9161. "type": "string",
  9162. "pattern": "^prt.*"
  9163. },
  9164. "sessionID": {
  9165. "type": "string",
  9166. "pattern": "^ses.*"
  9167. },
  9168. "messageID": {
  9169. "type": "string",
  9170. "pattern": "^msg.*"
  9171. },
  9172. "type": {
  9173. "type": "string",
  9174. "const": "tool"
  9175. },
  9176. "callID": {
  9177. "type": "string"
  9178. },
  9179. "tool": {
  9180. "type": "string"
  9181. },
  9182. "state": {
  9183. "$ref": "#/components/schemas/ToolState"
  9184. },
  9185. "metadata": {
  9186. "type": "object",
  9187. "propertyNames": {
  9188. "type": "string"
  9189. },
  9190. "additionalProperties": {}
  9191. }
  9192. },
  9193. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  9194. },
  9195. "StepStartPart": {
  9196. "type": "object",
  9197. "properties": {
  9198. "id": {
  9199. "type": "string",
  9200. "pattern": "^prt.*"
  9201. },
  9202. "sessionID": {
  9203. "type": "string",
  9204. "pattern": "^ses.*"
  9205. },
  9206. "messageID": {
  9207. "type": "string",
  9208. "pattern": "^msg.*"
  9209. },
  9210. "type": {
  9211. "type": "string",
  9212. "const": "step-start"
  9213. },
  9214. "snapshot": {
  9215. "type": "string"
  9216. }
  9217. },
  9218. "required": ["id", "sessionID", "messageID", "type"]
  9219. },
  9220. "StepFinishPart": {
  9221. "type": "object",
  9222. "properties": {
  9223. "id": {
  9224. "type": "string",
  9225. "pattern": "^prt.*"
  9226. },
  9227. "sessionID": {
  9228. "type": "string",
  9229. "pattern": "^ses.*"
  9230. },
  9231. "messageID": {
  9232. "type": "string",
  9233. "pattern": "^msg.*"
  9234. },
  9235. "type": {
  9236. "type": "string",
  9237. "const": "step-finish"
  9238. },
  9239. "reason": {
  9240. "type": "string"
  9241. },
  9242. "snapshot": {
  9243. "type": "string"
  9244. },
  9245. "cost": {
  9246. "type": "number"
  9247. },
  9248. "tokens": {
  9249. "type": "object",
  9250. "properties": {
  9251. "total": {
  9252. "type": "number"
  9253. },
  9254. "input": {
  9255. "type": "number"
  9256. },
  9257. "output": {
  9258. "type": "number"
  9259. },
  9260. "reasoning": {
  9261. "type": "number"
  9262. },
  9263. "cache": {
  9264. "type": "object",
  9265. "properties": {
  9266. "read": {
  9267. "type": "number"
  9268. },
  9269. "write": {
  9270. "type": "number"
  9271. }
  9272. },
  9273. "required": ["read", "write"]
  9274. }
  9275. },
  9276. "required": ["input", "output", "reasoning", "cache"]
  9277. }
  9278. },
  9279. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  9280. },
  9281. "SnapshotPart": {
  9282. "type": "object",
  9283. "properties": {
  9284. "id": {
  9285. "type": "string",
  9286. "pattern": "^prt.*"
  9287. },
  9288. "sessionID": {
  9289. "type": "string",
  9290. "pattern": "^ses.*"
  9291. },
  9292. "messageID": {
  9293. "type": "string",
  9294. "pattern": "^msg.*"
  9295. },
  9296. "type": {
  9297. "type": "string",
  9298. "const": "snapshot"
  9299. },
  9300. "snapshot": {
  9301. "type": "string"
  9302. }
  9303. },
  9304. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  9305. },
  9306. "PatchPart": {
  9307. "type": "object",
  9308. "properties": {
  9309. "id": {
  9310. "type": "string",
  9311. "pattern": "^prt.*"
  9312. },
  9313. "sessionID": {
  9314. "type": "string",
  9315. "pattern": "^ses.*"
  9316. },
  9317. "messageID": {
  9318. "type": "string",
  9319. "pattern": "^msg.*"
  9320. },
  9321. "type": {
  9322. "type": "string",
  9323. "const": "patch"
  9324. },
  9325. "hash": {
  9326. "type": "string"
  9327. },
  9328. "files": {
  9329. "type": "array",
  9330. "items": {
  9331. "type": "string"
  9332. }
  9333. }
  9334. },
  9335. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  9336. },
  9337. "AgentPart": {
  9338. "type": "object",
  9339. "properties": {
  9340. "id": {
  9341. "type": "string",
  9342. "pattern": "^prt.*"
  9343. },
  9344. "sessionID": {
  9345. "type": "string",
  9346. "pattern": "^ses.*"
  9347. },
  9348. "messageID": {
  9349. "type": "string",
  9350. "pattern": "^msg.*"
  9351. },
  9352. "type": {
  9353. "type": "string",
  9354. "const": "agent"
  9355. },
  9356. "name": {
  9357. "type": "string"
  9358. },
  9359. "source": {
  9360. "type": "object",
  9361. "properties": {
  9362. "value": {
  9363. "type": "string"
  9364. },
  9365. "start": {
  9366. "type": "integer",
  9367. "minimum": -9007199254740991,
  9368. "maximum": 9007199254740991
  9369. },
  9370. "end": {
  9371. "type": "integer",
  9372. "minimum": -9007199254740991,
  9373. "maximum": 9007199254740991
  9374. }
  9375. },
  9376. "required": ["value", "start", "end"]
  9377. }
  9378. },
  9379. "required": ["id", "sessionID", "messageID", "type", "name"]
  9380. },
  9381. "RetryPart": {
  9382. "type": "object",
  9383. "properties": {
  9384. "id": {
  9385. "type": "string",
  9386. "pattern": "^prt.*"
  9387. },
  9388. "sessionID": {
  9389. "type": "string",
  9390. "pattern": "^ses.*"
  9391. },
  9392. "messageID": {
  9393. "type": "string",
  9394. "pattern": "^msg.*"
  9395. },
  9396. "type": {
  9397. "type": "string",
  9398. "const": "retry"
  9399. },
  9400. "attempt": {
  9401. "type": "number"
  9402. },
  9403. "error": {
  9404. "$ref": "#/components/schemas/APIError"
  9405. },
  9406. "time": {
  9407. "type": "object",
  9408. "properties": {
  9409. "created": {
  9410. "type": "number"
  9411. }
  9412. },
  9413. "required": ["created"]
  9414. }
  9415. },
  9416. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  9417. },
  9418. "CompactionPart": {
  9419. "type": "object",
  9420. "properties": {
  9421. "id": {
  9422. "type": "string",
  9423. "pattern": "^prt.*"
  9424. },
  9425. "sessionID": {
  9426. "type": "string",
  9427. "pattern": "^ses.*"
  9428. },
  9429. "messageID": {
  9430. "type": "string",
  9431. "pattern": "^msg.*"
  9432. },
  9433. "type": {
  9434. "type": "string",
  9435. "const": "compaction"
  9436. },
  9437. "auto": {
  9438. "type": "boolean"
  9439. },
  9440. "overflow": {
  9441. "type": "boolean"
  9442. }
  9443. },
  9444. "required": ["id", "sessionID", "messageID", "type", "auto"]
  9445. },
  9446. "Part": {
  9447. "anyOf": [
  9448. {
  9449. "$ref": "#/components/schemas/TextPart"
  9450. },
  9451. {
  9452. "$ref": "#/components/schemas/SubtaskPart"
  9453. },
  9454. {
  9455. "$ref": "#/components/schemas/ReasoningPart"
  9456. },
  9457. {
  9458. "$ref": "#/components/schemas/FilePart"
  9459. },
  9460. {
  9461. "$ref": "#/components/schemas/ToolPart"
  9462. },
  9463. {
  9464. "$ref": "#/components/schemas/StepStartPart"
  9465. },
  9466. {
  9467. "$ref": "#/components/schemas/StepFinishPart"
  9468. },
  9469. {
  9470. "$ref": "#/components/schemas/SnapshotPart"
  9471. },
  9472. {
  9473. "$ref": "#/components/schemas/PatchPart"
  9474. },
  9475. {
  9476. "$ref": "#/components/schemas/AgentPart"
  9477. },
  9478. {
  9479. "$ref": "#/components/schemas/RetryPart"
  9480. },
  9481. {
  9482. "$ref": "#/components/schemas/CompactionPart"
  9483. }
  9484. ]
  9485. },
  9486. "Event.message.part.updated": {
  9487. "type": "object",
  9488. "properties": {
  9489. "type": {
  9490. "type": "string",
  9491. "const": "message.part.updated"
  9492. },
  9493. "properties": {
  9494. "type": "object",
  9495. "properties": {
  9496. "sessionID": {
  9497. "type": "string",
  9498. "pattern": "^ses.*"
  9499. },
  9500. "part": {
  9501. "$ref": "#/components/schemas/Part"
  9502. },
  9503. "time": {
  9504. "type": "number"
  9505. }
  9506. },
  9507. "required": ["sessionID", "part", "time"]
  9508. }
  9509. },
  9510. "required": ["type", "properties"]
  9511. },
  9512. "Event.message.part.removed": {
  9513. "type": "object",
  9514. "properties": {
  9515. "type": {
  9516. "type": "string",
  9517. "const": "message.part.removed"
  9518. },
  9519. "properties": {
  9520. "type": "object",
  9521. "properties": {
  9522. "sessionID": {
  9523. "type": "string",
  9524. "pattern": "^ses.*"
  9525. },
  9526. "messageID": {
  9527. "type": "string",
  9528. "pattern": "^msg.*"
  9529. },
  9530. "partID": {
  9531. "type": "string",
  9532. "pattern": "^prt.*"
  9533. }
  9534. },
  9535. "required": ["sessionID", "messageID", "partID"]
  9536. }
  9537. },
  9538. "required": ["type", "properties"]
  9539. },
  9540. "PermissionAction": {
  9541. "type": "string",
  9542. "enum": ["allow", "deny", "ask"]
  9543. },
  9544. "PermissionRule": {
  9545. "type": "object",
  9546. "properties": {
  9547. "permission": {
  9548. "type": "string"
  9549. },
  9550. "pattern": {
  9551. "type": "string"
  9552. },
  9553. "action": {
  9554. "$ref": "#/components/schemas/PermissionAction"
  9555. }
  9556. },
  9557. "required": ["permission", "pattern", "action"]
  9558. },
  9559. "PermissionRuleset": {
  9560. "type": "array",
  9561. "items": {
  9562. "$ref": "#/components/schemas/PermissionRule"
  9563. }
  9564. },
  9565. "Session": {
  9566. "type": "object",
  9567. "properties": {
  9568. "id": {
  9569. "type": "string",
  9570. "pattern": "^ses.*"
  9571. },
  9572. "slug": {
  9573. "type": "string"
  9574. },
  9575. "projectID": {
  9576. "type": "string"
  9577. },
  9578. "workspaceID": {
  9579. "type": "string",
  9580. "pattern": "^wrk.*"
  9581. },
  9582. "directory": {
  9583. "type": "string"
  9584. },
  9585. "parentID": {
  9586. "type": "string",
  9587. "pattern": "^ses.*"
  9588. },
  9589. "summary": {
  9590. "type": "object",
  9591. "properties": {
  9592. "additions": {
  9593. "type": "number"
  9594. },
  9595. "deletions": {
  9596. "type": "number"
  9597. },
  9598. "files": {
  9599. "type": "number"
  9600. },
  9601. "diffs": {
  9602. "type": "array",
  9603. "items": {
  9604. "$ref": "#/components/schemas/FileDiff"
  9605. }
  9606. }
  9607. },
  9608. "required": ["additions", "deletions", "files"]
  9609. },
  9610. "share": {
  9611. "type": "object",
  9612. "properties": {
  9613. "url": {
  9614. "type": "string"
  9615. }
  9616. },
  9617. "required": ["url"]
  9618. },
  9619. "title": {
  9620. "type": "string"
  9621. },
  9622. "version": {
  9623. "type": "string"
  9624. },
  9625. "time": {
  9626. "type": "object",
  9627. "properties": {
  9628. "created": {
  9629. "type": "number"
  9630. },
  9631. "updated": {
  9632. "type": "number"
  9633. },
  9634. "compacting": {
  9635. "type": "number"
  9636. },
  9637. "archived": {
  9638. "type": "number"
  9639. }
  9640. },
  9641. "required": ["created", "updated"]
  9642. },
  9643. "permission": {
  9644. "$ref": "#/components/schemas/PermissionRuleset"
  9645. },
  9646. "revert": {
  9647. "type": "object",
  9648. "properties": {
  9649. "messageID": {
  9650. "type": "string",
  9651. "pattern": "^msg.*"
  9652. },
  9653. "partID": {
  9654. "type": "string",
  9655. "pattern": "^prt.*"
  9656. },
  9657. "snapshot": {
  9658. "type": "string"
  9659. },
  9660. "diff": {
  9661. "type": "string"
  9662. }
  9663. },
  9664. "required": ["messageID"]
  9665. }
  9666. },
  9667. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  9668. },
  9669. "Event.session.created": {
  9670. "type": "object",
  9671. "properties": {
  9672. "type": {
  9673. "type": "string",
  9674. "const": "session.created"
  9675. },
  9676. "properties": {
  9677. "type": "object",
  9678. "properties": {
  9679. "sessionID": {
  9680. "type": "string",
  9681. "pattern": "^ses.*"
  9682. },
  9683. "info": {
  9684. "$ref": "#/components/schemas/Session"
  9685. }
  9686. },
  9687. "required": ["sessionID", "info"]
  9688. }
  9689. },
  9690. "required": ["type", "properties"]
  9691. },
  9692. "Event.session.updated": {
  9693. "type": "object",
  9694. "properties": {
  9695. "type": {
  9696. "type": "string",
  9697. "const": "session.updated"
  9698. },
  9699. "properties": {
  9700. "type": "object",
  9701. "properties": {
  9702. "sessionID": {
  9703. "type": "string",
  9704. "pattern": "^ses.*"
  9705. },
  9706. "info": {
  9707. "$ref": "#/components/schemas/Session"
  9708. }
  9709. },
  9710. "required": ["sessionID", "info"]
  9711. }
  9712. },
  9713. "required": ["type", "properties"]
  9714. },
  9715. "Event.session.deleted": {
  9716. "type": "object",
  9717. "properties": {
  9718. "type": {
  9719. "type": "string",
  9720. "const": "session.deleted"
  9721. },
  9722. "properties": {
  9723. "type": "object",
  9724. "properties": {
  9725. "sessionID": {
  9726. "type": "string",
  9727. "pattern": "^ses.*"
  9728. },
  9729. "info": {
  9730. "$ref": "#/components/schemas/Session"
  9731. }
  9732. },
  9733. "required": ["sessionID", "info"]
  9734. }
  9735. },
  9736. "required": ["type", "properties"]
  9737. },
  9738. "Event": {
  9739. "anyOf": [
  9740. {
  9741. "$ref": "#/components/schemas/Event.project.updated"
  9742. },
  9743. {
  9744. "$ref": "#/components/schemas/Event.installation.updated"
  9745. },
  9746. {
  9747. "$ref": "#/components/schemas/Event.installation.update-available"
  9748. },
  9749. {
  9750. "$ref": "#/components/schemas/Event.server.instance.disposed"
  9751. },
  9752. {
  9753. "$ref": "#/components/schemas/Event.server.connected"
  9754. },
  9755. {
  9756. "$ref": "#/components/schemas/Event.global.disposed"
  9757. },
  9758. {
  9759. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  9760. },
  9761. {
  9762. "$ref": "#/components/schemas/Event.lsp.updated"
  9763. },
  9764. {
  9765. "$ref": "#/components/schemas/Event.message.part.delta"
  9766. },
  9767. {
  9768. "$ref": "#/components/schemas/Event.permission.asked"
  9769. },
  9770. {
  9771. "$ref": "#/components/schemas/Event.permission.replied"
  9772. },
  9773. {
  9774. "$ref": "#/components/schemas/Event.session.status"
  9775. },
  9776. {
  9777. "$ref": "#/components/schemas/Event.session.idle"
  9778. },
  9779. {
  9780. "$ref": "#/components/schemas/Event.question.asked"
  9781. },
  9782. {
  9783. "$ref": "#/components/schemas/Event.question.replied"
  9784. },
  9785. {
  9786. "$ref": "#/components/schemas/Event.question.rejected"
  9787. },
  9788. {
  9789. "$ref": "#/components/schemas/Event.session.compacted"
  9790. },
  9791. {
  9792. "$ref": "#/components/schemas/Event.file.edited"
  9793. },
  9794. {
  9795. "$ref": "#/components/schemas/Event.file.watcher.updated"
  9796. },
  9797. {
  9798. "$ref": "#/components/schemas/Event.todo.updated"
  9799. },
  9800. {
  9801. "$ref": "#/components/schemas/Event.tui.prompt.append"
  9802. },
  9803. {
  9804. "$ref": "#/components/schemas/Event.tui.command.execute"
  9805. },
  9806. {
  9807. "$ref": "#/components/schemas/Event.tui.toast.show"
  9808. },
  9809. {
  9810. "$ref": "#/components/schemas/Event.tui.session.select"
  9811. },
  9812. {
  9813. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  9814. },
  9815. {
  9816. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  9817. },
  9818. {
  9819. "$ref": "#/components/schemas/Event.command.executed"
  9820. },
  9821. {
  9822. "$ref": "#/components/schemas/Event.session.diff"
  9823. },
  9824. {
  9825. "$ref": "#/components/schemas/Event.session.error"
  9826. },
  9827. {
  9828. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  9829. },
  9830. {
  9831. "$ref": "#/components/schemas/Event.workspace.ready"
  9832. },
  9833. {
  9834. "$ref": "#/components/schemas/Event.workspace.failed"
  9835. },
  9836. {
  9837. "$ref": "#/components/schemas/Event.pty.created"
  9838. },
  9839. {
  9840. "$ref": "#/components/schemas/Event.pty.updated"
  9841. },
  9842. {
  9843. "$ref": "#/components/schemas/Event.pty.exited"
  9844. },
  9845. {
  9846. "$ref": "#/components/schemas/Event.pty.deleted"
  9847. },
  9848. {
  9849. "$ref": "#/components/schemas/Event.worktree.ready"
  9850. },
  9851. {
  9852. "$ref": "#/components/schemas/Event.worktree.failed"
  9853. },
  9854. {
  9855. "$ref": "#/components/schemas/Event.message.updated"
  9856. },
  9857. {
  9858. "$ref": "#/components/schemas/Event.message.removed"
  9859. },
  9860. {
  9861. "$ref": "#/components/schemas/Event.message.part.updated"
  9862. },
  9863. {
  9864. "$ref": "#/components/schemas/Event.message.part.removed"
  9865. },
  9866. {
  9867. "$ref": "#/components/schemas/Event.session.created"
  9868. },
  9869. {
  9870. "$ref": "#/components/schemas/Event.session.updated"
  9871. },
  9872. {
  9873. "$ref": "#/components/schemas/Event.session.deleted"
  9874. }
  9875. ]
  9876. },
  9877. "GlobalEvent": {
  9878. "type": "object",
  9879. "properties": {
  9880. "directory": {
  9881. "type": "string"
  9882. },
  9883. "payload": {
  9884. "$ref": "#/components/schemas/Event"
  9885. }
  9886. },
  9887. "required": ["directory", "payload"]
  9888. },
  9889. "SyncEvent.message.updated": {
  9890. "type": "object",
  9891. "properties": {
  9892. "type": {
  9893. "type": "string",
  9894. "const": "message.updated.1"
  9895. },
  9896. "aggregate": {
  9897. "type": "string",
  9898. "const": "sessionID"
  9899. },
  9900. "data": {
  9901. "type": "object",
  9902. "properties": {
  9903. "sessionID": {
  9904. "type": "string",
  9905. "pattern": "^ses.*"
  9906. },
  9907. "info": {
  9908. "$ref": "#/components/schemas/Message"
  9909. }
  9910. },
  9911. "required": ["sessionID", "info"]
  9912. }
  9913. },
  9914. "required": ["type", "aggregate", "data"]
  9915. },
  9916. "SyncEvent.message.removed": {
  9917. "type": "object",
  9918. "properties": {
  9919. "type": {
  9920. "type": "string",
  9921. "const": "message.removed.1"
  9922. },
  9923. "aggregate": {
  9924. "type": "string",
  9925. "const": "sessionID"
  9926. },
  9927. "data": {
  9928. "type": "object",
  9929. "properties": {
  9930. "sessionID": {
  9931. "type": "string",
  9932. "pattern": "^ses.*"
  9933. },
  9934. "messageID": {
  9935. "type": "string",
  9936. "pattern": "^msg.*"
  9937. }
  9938. },
  9939. "required": ["sessionID", "messageID"]
  9940. }
  9941. },
  9942. "required": ["type", "aggregate", "data"]
  9943. },
  9944. "SyncEvent.message.part.updated": {
  9945. "type": "object",
  9946. "properties": {
  9947. "type": {
  9948. "type": "string",
  9949. "const": "message.part.updated.1"
  9950. },
  9951. "aggregate": {
  9952. "type": "string",
  9953. "const": "sessionID"
  9954. },
  9955. "data": {
  9956. "type": "object",
  9957. "properties": {
  9958. "sessionID": {
  9959. "type": "string",
  9960. "pattern": "^ses.*"
  9961. },
  9962. "part": {
  9963. "$ref": "#/components/schemas/Part"
  9964. },
  9965. "time": {
  9966. "type": "number"
  9967. }
  9968. },
  9969. "required": ["sessionID", "part", "time"]
  9970. }
  9971. },
  9972. "required": ["type", "aggregate", "data"]
  9973. },
  9974. "SyncEvent.message.part.removed": {
  9975. "type": "object",
  9976. "properties": {
  9977. "type": {
  9978. "type": "string",
  9979. "const": "message.part.removed.1"
  9980. },
  9981. "aggregate": {
  9982. "type": "string",
  9983. "const": "sessionID"
  9984. },
  9985. "data": {
  9986. "type": "object",
  9987. "properties": {
  9988. "sessionID": {
  9989. "type": "string",
  9990. "pattern": "^ses.*"
  9991. },
  9992. "messageID": {
  9993. "type": "string",
  9994. "pattern": "^msg.*"
  9995. },
  9996. "partID": {
  9997. "type": "string",
  9998. "pattern": "^prt.*"
  9999. }
  10000. },
  10001. "required": ["sessionID", "messageID", "partID"]
  10002. }
  10003. },
  10004. "required": ["type", "aggregate", "data"]
  10005. },
  10006. "SyncEvent.session.created": {
  10007. "type": "object",
  10008. "properties": {
  10009. "type": {
  10010. "type": "string",
  10011. "const": "session.created.1"
  10012. },
  10013. "aggregate": {
  10014. "type": "string",
  10015. "const": "sessionID"
  10016. },
  10017. "data": {
  10018. "type": "object",
  10019. "properties": {
  10020. "sessionID": {
  10021. "type": "string",
  10022. "pattern": "^ses.*"
  10023. },
  10024. "info": {
  10025. "$ref": "#/components/schemas/Session"
  10026. }
  10027. },
  10028. "required": ["sessionID", "info"]
  10029. }
  10030. },
  10031. "required": ["type", "aggregate", "data"]
  10032. },
  10033. "SyncEvent.session.updated": {
  10034. "type": "object",
  10035. "properties": {
  10036. "type": {
  10037. "type": "string",
  10038. "const": "session.updated.1"
  10039. },
  10040. "aggregate": {
  10041. "type": "string",
  10042. "const": "sessionID"
  10043. },
  10044. "data": {
  10045. "type": "object",
  10046. "properties": {
  10047. "sessionID": {
  10048. "type": "string",
  10049. "pattern": "^ses.*"
  10050. },
  10051. "info": {
  10052. "type": "object",
  10053. "properties": {
  10054. "id": {
  10055. "anyOf": [
  10056. {
  10057. "type": "string",
  10058. "pattern": "^ses.*"
  10059. },
  10060. {
  10061. "type": "null"
  10062. }
  10063. ]
  10064. },
  10065. "slug": {
  10066. "anyOf": [
  10067. {
  10068. "type": "string"
  10069. },
  10070. {
  10071. "type": "null"
  10072. }
  10073. ]
  10074. },
  10075. "projectID": {
  10076. "anyOf": [
  10077. {
  10078. "type": "string"
  10079. },
  10080. {
  10081. "type": "null"
  10082. }
  10083. ]
  10084. },
  10085. "workspaceID": {
  10086. "anyOf": [
  10087. {
  10088. "type": "string",
  10089. "pattern": "^wrk.*"
  10090. },
  10091. {
  10092. "type": "null"
  10093. }
  10094. ]
  10095. },
  10096. "directory": {
  10097. "anyOf": [
  10098. {
  10099. "type": "string"
  10100. },
  10101. {
  10102. "type": "null"
  10103. }
  10104. ]
  10105. },
  10106. "parentID": {
  10107. "anyOf": [
  10108. {
  10109. "type": "string",
  10110. "pattern": "^ses.*"
  10111. },
  10112. {
  10113. "type": "null"
  10114. }
  10115. ]
  10116. },
  10117. "summary": {
  10118. "anyOf": [
  10119. {
  10120. "type": "object",
  10121. "properties": {
  10122. "additions": {
  10123. "type": "number"
  10124. },
  10125. "deletions": {
  10126. "type": "number"
  10127. },
  10128. "files": {
  10129. "type": "number"
  10130. },
  10131. "diffs": {
  10132. "type": "array",
  10133. "items": {
  10134. "$ref": "#/components/schemas/FileDiff"
  10135. }
  10136. }
  10137. },
  10138. "required": ["additions", "deletions", "files"]
  10139. },
  10140. {
  10141. "type": "null"
  10142. }
  10143. ]
  10144. },
  10145. "share": {
  10146. "type": "object",
  10147. "properties": {
  10148. "url": {
  10149. "anyOf": [
  10150. {
  10151. "type": "string"
  10152. },
  10153. {
  10154. "type": "null"
  10155. }
  10156. ]
  10157. }
  10158. },
  10159. "required": ["url"]
  10160. },
  10161. "title": {
  10162. "anyOf": [
  10163. {
  10164. "type": "string"
  10165. },
  10166. {
  10167. "type": "null"
  10168. }
  10169. ]
  10170. },
  10171. "version": {
  10172. "anyOf": [
  10173. {
  10174. "type": "string"
  10175. },
  10176. {
  10177. "type": "null"
  10178. }
  10179. ]
  10180. },
  10181. "time": {
  10182. "type": "object",
  10183. "properties": {
  10184. "created": {
  10185. "anyOf": [
  10186. {
  10187. "type": "number"
  10188. },
  10189. {
  10190. "type": "null"
  10191. }
  10192. ]
  10193. },
  10194. "updated": {
  10195. "anyOf": [
  10196. {
  10197. "type": "number"
  10198. },
  10199. {
  10200. "type": "null"
  10201. }
  10202. ]
  10203. },
  10204. "compacting": {
  10205. "anyOf": [
  10206. {
  10207. "type": "number"
  10208. },
  10209. {
  10210. "type": "null"
  10211. }
  10212. ]
  10213. },
  10214. "archived": {
  10215. "anyOf": [
  10216. {
  10217. "type": "number"
  10218. },
  10219. {
  10220. "type": "null"
  10221. }
  10222. ]
  10223. }
  10224. },
  10225. "required": ["created", "updated", "compacting", "archived"]
  10226. },
  10227. "permission": {
  10228. "anyOf": [
  10229. {
  10230. "$ref": "#/components/schemas/PermissionRuleset"
  10231. },
  10232. {
  10233. "type": "null"
  10234. }
  10235. ]
  10236. },
  10237. "revert": {
  10238. "anyOf": [
  10239. {
  10240. "type": "object",
  10241. "properties": {
  10242. "messageID": {
  10243. "type": "string",
  10244. "pattern": "^msg.*"
  10245. },
  10246. "partID": {
  10247. "type": "string",
  10248. "pattern": "^prt.*"
  10249. },
  10250. "snapshot": {
  10251. "type": "string"
  10252. },
  10253. "diff": {
  10254. "type": "string"
  10255. }
  10256. },
  10257. "required": ["messageID"]
  10258. },
  10259. {
  10260. "type": "null"
  10261. }
  10262. ]
  10263. }
  10264. },
  10265. "required": [
  10266. "id",
  10267. "slug",
  10268. "projectID",
  10269. "workspaceID",
  10270. "directory",
  10271. "parentID",
  10272. "summary",
  10273. "title",
  10274. "version",
  10275. "permission",
  10276. "revert"
  10277. ]
  10278. }
  10279. },
  10280. "required": ["sessionID", "info"]
  10281. }
  10282. },
  10283. "required": ["type", "aggregate", "data"]
  10284. },
  10285. "SyncEvent.session.deleted": {
  10286. "type": "object",
  10287. "properties": {
  10288. "type": {
  10289. "type": "string",
  10290. "const": "session.deleted.1"
  10291. },
  10292. "aggregate": {
  10293. "type": "string",
  10294. "const": "sessionID"
  10295. },
  10296. "data": {
  10297. "type": "object",
  10298. "properties": {
  10299. "sessionID": {
  10300. "type": "string",
  10301. "pattern": "^ses.*"
  10302. },
  10303. "info": {
  10304. "$ref": "#/components/schemas/Session"
  10305. }
  10306. },
  10307. "required": ["sessionID", "info"]
  10308. }
  10309. },
  10310. "required": ["type", "aggregate", "data"]
  10311. },
  10312. "SyncEvent": {
  10313. "type": "object",
  10314. "properties": {
  10315. "payload": {
  10316. "$ref": "#/components/schemas/SyncEvent"
  10317. }
  10318. },
  10319. "required": ["payload"]
  10320. },
  10321. "LogLevel": {
  10322. "description": "Log level",
  10323. "type": "string",
  10324. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  10325. },
  10326. "ServerConfig": {
  10327. "description": "Server configuration for opencode serve and web commands",
  10328. "type": "object",
  10329. "properties": {
  10330. "port": {
  10331. "description": "Port to listen on",
  10332. "type": "integer",
  10333. "exclusiveMinimum": 0,
  10334. "maximum": 9007199254740991
  10335. },
  10336. "hostname": {
  10337. "description": "Hostname to listen on",
  10338. "type": "string"
  10339. },
  10340. "mdns": {
  10341. "description": "Enable mDNS service discovery",
  10342. "type": "boolean"
  10343. },
  10344. "mdnsDomain": {
  10345. "description": "Custom domain name for mDNS service (default: opencode.local)",
  10346. "type": "string"
  10347. },
  10348. "cors": {
  10349. "description": "Additional domains to allow for CORS",
  10350. "type": "array",
  10351. "items": {
  10352. "type": "string"
  10353. }
  10354. }
  10355. },
  10356. "additionalProperties": false
  10357. },
  10358. "PermissionActionConfig": {
  10359. "type": "string",
  10360. "enum": ["ask", "allow", "deny"]
  10361. },
  10362. "PermissionObjectConfig": {
  10363. "type": "object",
  10364. "propertyNames": {
  10365. "type": "string"
  10366. },
  10367. "additionalProperties": {
  10368. "$ref": "#/components/schemas/PermissionActionConfig"
  10369. }
  10370. },
  10371. "PermissionRuleConfig": {
  10372. "anyOf": [
  10373. {
  10374. "$ref": "#/components/schemas/PermissionActionConfig"
  10375. },
  10376. {
  10377. "$ref": "#/components/schemas/PermissionObjectConfig"
  10378. }
  10379. ]
  10380. },
  10381. "PermissionConfig": {
  10382. "anyOf": [
  10383. {
  10384. "type": "object",
  10385. "properties": {
  10386. "__originalKeys": {
  10387. "type": "array",
  10388. "items": {
  10389. "type": "string"
  10390. }
  10391. },
  10392. "read": {
  10393. "$ref": "#/components/schemas/PermissionRuleConfig"
  10394. },
  10395. "edit": {
  10396. "$ref": "#/components/schemas/PermissionRuleConfig"
  10397. },
  10398. "glob": {
  10399. "$ref": "#/components/schemas/PermissionRuleConfig"
  10400. },
  10401. "grep": {
  10402. "$ref": "#/components/schemas/PermissionRuleConfig"
  10403. },
  10404. "list": {
  10405. "$ref": "#/components/schemas/PermissionRuleConfig"
  10406. },
  10407. "bash": {
  10408. "$ref": "#/components/schemas/PermissionRuleConfig"
  10409. },
  10410. "task": {
  10411. "$ref": "#/components/schemas/PermissionRuleConfig"
  10412. },
  10413. "external_directory": {
  10414. "$ref": "#/components/schemas/PermissionRuleConfig"
  10415. },
  10416. "todowrite": {
  10417. "$ref": "#/components/schemas/PermissionActionConfig"
  10418. },
  10419. "question": {
  10420. "$ref": "#/components/schemas/PermissionActionConfig"
  10421. },
  10422. "webfetch": {
  10423. "$ref": "#/components/schemas/PermissionActionConfig"
  10424. },
  10425. "websearch": {
  10426. "$ref": "#/components/schemas/PermissionActionConfig"
  10427. },
  10428. "codesearch": {
  10429. "$ref": "#/components/schemas/PermissionActionConfig"
  10430. },
  10431. "lsp": {
  10432. "$ref": "#/components/schemas/PermissionRuleConfig"
  10433. },
  10434. "doom_loop": {
  10435. "$ref": "#/components/schemas/PermissionActionConfig"
  10436. },
  10437. "skill": {
  10438. "$ref": "#/components/schemas/PermissionRuleConfig"
  10439. }
  10440. },
  10441. "additionalProperties": {
  10442. "$ref": "#/components/schemas/PermissionRuleConfig"
  10443. }
  10444. },
  10445. {
  10446. "$ref": "#/components/schemas/PermissionActionConfig"
  10447. }
  10448. ]
  10449. },
  10450. "AgentConfig": {
  10451. "type": "object",
  10452. "properties": {
  10453. "model": {
  10454. "type": "string"
  10455. },
  10456. "variant": {
  10457. "description": "Default model variant for this agent (applies only when using the agent's configured model).",
  10458. "type": "string"
  10459. },
  10460. "temperature": {
  10461. "type": "number"
  10462. },
  10463. "top_p": {
  10464. "type": "number"
  10465. },
  10466. "prompt": {
  10467. "type": "string"
  10468. },
  10469. "tools": {
  10470. "description": "@deprecated Use 'permission' field instead",
  10471. "type": "object",
  10472. "propertyNames": {
  10473. "type": "string"
  10474. },
  10475. "additionalProperties": {
  10476. "type": "boolean"
  10477. }
  10478. },
  10479. "disable": {
  10480. "type": "boolean"
  10481. },
  10482. "description": {
  10483. "description": "Description of when to use the agent",
  10484. "type": "string"
  10485. },
  10486. "mode": {
  10487. "type": "string",
  10488. "enum": ["subagent", "primary", "all"]
  10489. },
  10490. "hidden": {
  10491. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  10492. "type": "boolean"
  10493. },
  10494. "options": {
  10495. "type": "object",
  10496. "propertyNames": {
  10497. "type": "string"
  10498. },
  10499. "additionalProperties": {}
  10500. },
  10501. "color": {
  10502. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)",
  10503. "anyOf": [
  10504. {
  10505. "type": "string",
  10506. "pattern": "^#[0-9a-fA-F]{6}$"
  10507. },
  10508. {
  10509. "type": "string",
  10510. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  10511. }
  10512. ]
  10513. },
  10514. "steps": {
  10515. "description": "Maximum number of agentic iterations before forcing text-only response",
  10516. "type": "integer",
  10517. "exclusiveMinimum": 0,
  10518. "maximum": 9007199254740991
  10519. },
  10520. "maxSteps": {
  10521. "description": "@deprecated Use 'steps' field instead.",
  10522. "type": "integer",
  10523. "exclusiveMinimum": 0,
  10524. "maximum": 9007199254740991
  10525. },
  10526. "permission": {
  10527. "$ref": "#/components/schemas/PermissionConfig"
  10528. }
  10529. },
  10530. "additionalProperties": {}
  10531. },
  10532. "ProviderConfig": {
  10533. "type": "object",
  10534. "properties": {
  10535. "api": {
  10536. "type": "string"
  10537. },
  10538. "name": {
  10539. "type": "string"
  10540. },
  10541. "env": {
  10542. "type": "array",
  10543. "items": {
  10544. "type": "string"
  10545. }
  10546. },
  10547. "id": {
  10548. "type": "string"
  10549. },
  10550. "npm": {
  10551. "type": "string"
  10552. },
  10553. "models": {
  10554. "type": "object",
  10555. "propertyNames": {
  10556. "type": "string"
  10557. },
  10558. "additionalProperties": {
  10559. "type": "object",
  10560. "properties": {
  10561. "id": {
  10562. "type": "string"
  10563. },
  10564. "name": {
  10565. "type": "string"
  10566. },
  10567. "family": {
  10568. "type": "string"
  10569. },
  10570. "release_date": {
  10571. "type": "string"
  10572. },
  10573. "attachment": {
  10574. "type": "boolean"
  10575. },
  10576. "reasoning": {
  10577. "type": "boolean"
  10578. },
  10579. "temperature": {
  10580. "type": "boolean"
  10581. },
  10582. "tool_call": {
  10583. "type": "boolean"
  10584. },
  10585. "interleaved": {
  10586. "anyOf": [
  10587. {
  10588. "type": "boolean",
  10589. "const": true
  10590. },
  10591. {
  10592. "type": "object",
  10593. "properties": {
  10594. "field": {
  10595. "type": "string",
  10596. "enum": ["reasoning_content", "reasoning_details"]
  10597. }
  10598. },
  10599. "required": ["field"],
  10600. "additionalProperties": false
  10601. }
  10602. ]
  10603. },
  10604. "cost": {
  10605. "type": "object",
  10606. "properties": {
  10607. "input": {
  10608. "type": "number"
  10609. },
  10610. "output": {
  10611. "type": "number"
  10612. },
  10613. "cache_read": {
  10614. "type": "number"
  10615. },
  10616. "cache_write": {
  10617. "type": "number"
  10618. },
  10619. "context_over_200k": {
  10620. "type": "object",
  10621. "properties": {
  10622. "input": {
  10623. "type": "number"
  10624. },
  10625. "output": {
  10626. "type": "number"
  10627. },
  10628. "cache_read": {
  10629. "type": "number"
  10630. },
  10631. "cache_write": {
  10632. "type": "number"
  10633. }
  10634. },
  10635. "required": ["input", "output"]
  10636. }
  10637. },
  10638. "required": ["input", "output"]
  10639. },
  10640. "limit": {
  10641. "type": "object",
  10642. "properties": {
  10643. "context": {
  10644. "type": "number"
  10645. },
  10646. "input": {
  10647. "type": "number"
  10648. },
  10649. "output": {
  10650. "type": "number"
  10651. }
  10652. },
  10653. "required": ["context", "output"]
  10654. },
  10655. "modalities": {
  10656. "type": "object",
  10657. "properties": {
  10658. "input": {
  10659. "type": "array",
  10660. "items": {
  10661. "type": "string",
  10662. "enum": ["text", "audio", "image", "video", "pdf"]
  10663. }
  10664. },
  10665. "output": {
  10666. "type": "array",
  10667. "items": {
  10668. "type": "string",
  10669. "enum": ["text", "audio", "image", "video", "pdf"]
  10670. }
  10671. }
  10672. },
  10673. "required": ["input", "output"]
  10674. },
  10675. "experimental": {
  10676. "type": "boolean"
  10677. },
  10678. "status": {
  10679. "type": "string",
  10680. "enum": ["alpha", "beta", "deprecated"]
  10681. },
  10682. "options": {
  10683. "type": "object",
  10684. "propertyNames": {
  10685. "type": "string"
  10686. },
  10687. "additionalProperties": {}
  10688. },
  10689. "headers": {
  10690. "type": "object",
  10691. "propertyNames": {
  10692. "type": "string"
  10693. },
  10694. "additionalProperties": {
  10695. "type": "string"
  10696. }
  10697. },
  10698. "provider": {
  10699. "type": "object",
  10700. "properties": {
  10701. "npm": {
  10702. "type": "string"
  10703. },
  10704. "api": {
  10705. "type": "string"
  10706. }
  10707. }
  10708. },
  10709. "variants": {
  10710. "description": "Variant-specific configuration",
  10711. "type": "object",
  10712. "propertyNames": {
  10713. "type": "string"
  10714. },
  10715. "additionalProperties": {
  10716. "type": "object",
  10717. "properties": {
  10718. "disabled": {
  10719. "description": "Disable this variant for the model",
  10720. "type": "boolean"
  10721. }
  10722. },
  10723. "additionalProperties": {}
  10724. }
  10725. }
  10726. }
  10727. }
  10728. },
  10729. "whitelist": {
  10730. "type": "array",
  10731. "items": {
  10732. "type": "string"
  10733. }
  10734. },
  10735. "blacklist": {
  10736. "type": "array",
  10737. "items": {
  10738. "type": "string"
  10739. }
  10740. },
  10741. "options": {
  10742. "type": "object",
  10743. "properties": {
  10744. "apiKey": {
  10745. "type": "string"
  10746. },
  10747. "baseURL": {
  10748. "type": "string"
  10749. },
  10750. "enterpriseUrl": {
  10751. "description": "GitHub Enterprise URL for copilot authentication",
  10752. "type": "string"
  10753. },
  10754. "setCacheKey": {
  10755. "description": "Enable promptCacheKey for this provider (default false)",
  10756. "type": "boolean"
  10757. },
  10758. "timeout": {
  10759. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  10760. "anyOf": [
  10761. {
  10762. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  10763. "type": "integer",
  10764. "exclusiveMinimum": 0,
  10765. "maximum": 9007199254740991
  10766. },
  10767. {
  10768. "description": "Disable timeout for this provider entirely.",
  10769. "type": "boolean",
  10770. "const": false
  10771. }
  10772. ]
  10773. },
  10774. "chunkTimeout": {
  10775. "description": "Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted.",
  10776. "type": "integer",
  10777. "exclusiveMinimum": 0,
  10778. "maximum": 9007199254740991
  10779. }
  10780. },
  10781. "additionalProperties": {}
  10782. }
  10783. },
  10784. "additionalProperties": false
  10785. },
  10786. "McpLocalConfig": {
  10787. "type": "object",
  10788. "properties": {
  10789. "type": {
  10790. "description": "Type of MCP server connection",
  10791. "type": "string",
  10792. "const": "local"
  10793. },
  10794. "command": {
  10795. "description": "Command and arguments to run the MCP server",
  10796. "type": "array",
  10797. "items": {
  10798. "type": "string"
  10799. }
  10800. },
  10801. "environment": {
  10802. "description": "Environment variables to set when running the MCP server",
  10803. "type": "object",
  10804. "propertyNames": {
  10805. "type": "string"
  10806. },
  10807. "additionalProperties": {
  10808. "type": "string"
  10809. }
  10810. },
  10811. "enabled": {
  10812. "description": "Enable or disable the MCP server on startup",
  10813. "type": "boolean"
  10814. },
  10815. "timeout": {
  10816. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  10817. "type": "integer",
  10818. "exclusiveMinimum": 0,
  10819. "maximum": 9007199254740991
  10820. }
  10821. },
  10822. "required": ["type", "command"],
  10823. "additionalProperties": false
  10824. },
  10825. "McpOAuthConfig": {
  10826. "type": "object",
  10827. "properties": {
  10828. "clientId": {
  10829. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  10830. "type": "string"
  10831. },
  10832. "clientSecret": {
  10833. "description": "OAuth client secret (if required by the authorization server)",
  10834. "type": "string"
  10835. },
  10836. "scope": {
  10837. "description": "OAuth scopes to request during authorization",
  10838. "type": "string"
  10839. }
  10840. },
  10841. "additionalProperties": false
  10842. },
  10843. "McpRemoteConfig": {
  10844. "type": "object",
  10845. "properties": {
  10846. "type": {
  10847. "description": "Type of MCP server connection",
  10848. "type": "string",
  10849. "const": "remote"
  10850. },
  10851. "url": {
  10852. "description": "URL of the remote MCP server",
  10853. "type": "string"
  10854. },
  10855. "enabled": {
  10856. "description": "Enable or disable the MCP server on startup",
  10857. "type": "boolean"
  10858. },
  10859. "headers": {
  10860. "description": "Headers to send with the request",
  10861. "type": "object",
  10862. "propertyNames": {
  10863. "type": "string"
  10864. },
  10865. "additionalProperties": {
  10866. "type": "string"
  10867. }
  10868. },
  10869. "oauth": {
  10870. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  10871. "anyOf": [
  10872. {
  10873. "$ref": "#/components/schemas/McpOAuthConfig"
  10874. },
  10875. {
  10876. "type": "boolean",
  10877. "const": false
  10878. }
  10879. ]
  10880. },
  10881. "timeout": {
  10882. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  10883. "type": "integer",
  10884. "exclusiveMinimum": 0,
  10885. "maximum": 9007199254740991
  10886. }
  10887. },
  10888. "required": ["type", "url"],
  10889. "additionalProperties": false
  10890. },
  10891. "LayoutConfig": {
  10892. "description": "@deprecated Always uses stretch layout.",
  10893. "type": "string",
  10894. "enum": ["auto", "stretch"]
  10895. },
  10896. "Config": {
  10897. "type": "object",
  10898. "properties": {
  10899. "$schema": {
  10900. "description": "JSON schema reference for configuration validation",
  10901. "type": "string"
  10902. },
  10903. "logLevel": {
  10904. "$ref": "#/components/schemas/LogLevel"
  10905. },
  10906. "server": {
  10907. "$ref": "#/components/schemas/ServerConfig"
  10908. },
  10909. "command": {
  10910. "description": "Command configuration, see https://opencode.ai/docs/commands",
  10911. "type": "object",
  10912. "propertyNames": {
  10913. "type": "string"
  10914. },
  10915. "additionalProperties": {
  10916. "type": "object",
  10917. "properties": {
  10918. "template": {
  10919. "type": "string"
  10920. },
  10921. "description": {
  10922. "type": "string"
  10923. },
  10924. "agent": {
  10925. "type": "string"
  10926. },
  10927. "model": {
  10928. "type": "string"
  10929. },
  10930. "subtask": {
  10931. "type": "boolean"
  10932. }
  10933. },
  10934. "required": ["template"]
  10935. }
  10936. },
  10937. "skills": {
  10938. "description": "Additional skill folder paths",
  10939. "type": "object",
  10940. "properties": {
  10941. "paths": {
  10942. "description": "Additional paths to skill folders",
  10943. "type": "array",
  10944. "items": {
  10945. "type": "string"
  10946. }
  10947. },
  10948. "urls": {
  10949. "description": "URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)",
  10950. "type": "array",
  10951. "items": {
  10952. "type": "string"
  10953. }
  10954. }
  10955. }
  10956. },
  10957. "watcher": {
  10958. "type": "object",
  10959. "properties": {
  10960. "ignore": {
  10961. "type": "array",
  10962. "items": {
  10963. "type": "string"
  10964. }
  10965. }
  10966. }
  10967. },
  10968. "snapshot": {
  10969. "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.",
  10970. "type": "boolean"
  10971. },
  10972. "plugin": {
  10973. "type": "array",
  10974. "items": {
  10975. "anyOf": [
  10976. {
  10977. "type": "string"
  10978. },
  10979. {
  10980. "type": "array",
  10981. "prefixItems": [
  10982. {
  10983. "type": "string"
  10984. },
  10985. {
  10986. "type": "object",
  10987. "propertyNames": {
  10988. "type": "string"
  10989. },
  10990. "additionalProperties": {}
  10991. }
  10992. ]
  10993. }
  10994. ]
  10995. }
  10996. },
  10997. "share": {
  10998. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  10999. "type": "string",
  11000. "enum": ["manual", "auto", "disabled"]
  11001. },
  11002. "autoshare": {
  11003. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  11004. "type": "boolean"
  11005. },
  11006. "autoupdate": {
  11007. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  11008. "anyOf": [
  11009. {
  11010. "type": "boolean"
  11011. },
  11012. {
  11013. "type": "string",
  11014. "const": "notify"
  11015. }
  11016. ]
  11017. },
  11018. "disabled_providers": {
  11019. "description": "Disable providers that are loaded automatically",
  11020. "type": "array",
  11021. "items": {
  11022. "type": "string"
  11023. }
  11024. },
  11025. "enabled_providers": {
  11026. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  11027. "type": "array",
  11028. "items": {
  11029. "type": "string"
  11030. }
  11031. },
  11032. "model": {
  11033. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  11034. "type": "string"
  11035. },
  11036. "small_model": {
  11037. "description": "Small model to use for tasks like title generation in the format of provider/model",
  11038. "type": "string"
  11039. },
  11040. "default_agent": {
  11041. "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.",
  11042. "type": "string"
  11043. },
  11044. "username": {
  11045. "description": "Custom username to display in conversations instead of system username",
  11046. "type": "string"
  11047. },
  11048. "mode": {
  11049. "description": "@deprecated Use `agent` field instead.",
  11050. "type": "object",
  11051. "properties": {
  11052. "build": {
  11053. "$ref": "#/components/schemas/AgentConfig"
  11054. },
  11055. "plan": {
  11056. "$ref": "#/components/schemas/AgentConfig"
  11057. }
  11058. },
  11059. "additionalProperties": {
  11060. "$ref": "#/components/schemas/AgentConfig"
  11061. }
  11062. },
  11063. "agent": {
  11064. "description": "Agent configuration, see https://opencode.ai/docs/agents",
  11065. "type": "object",
  11066. "properties": {
  11067. "plan": {
  11068. "$ref": "#/components/schemas/AgentConfig"
  11069. },
  11070. "build": {
  11071. "$ref": "#/components/schemas/AgentConfig"
  11072. },
  11073. "general": {
  11074. "$ref": "#/components/schemas/AgentConfig"
  11075. },
  11076. "explore": {
  11077. "$ref": "#/components/schemas/AgentConfig"
  11078. },
  11079. "title": {
  11080. "$ref": "#/components/schemas/AgentConfig"
  11081. },
  11082. "summary": {
  11083. "$ref": "#/components/schemas/AgentConfig"
  11084. },
  11085. "compaction": {
  11086. "$ref": "#/components/schemas/AgentConfig"
  11087. }
  11088. },
  11089. "additionalProperties": {
  11090. "$ref": "#/components/schemas/AgentConfig"
  11091. }
  11092. },
  11093. "provider": {
  11094. "description": "Custom provider configurations and model overrides",
  11095. "type": "object",
  11096. "propertyNames": {
  11097. "type": "string"
  11098. },
  11099. "additionalProperties": {
  11100. "$ref": "#/components/schemas/ProviderConfig"
  11101. }
  11102. },
  11103. "mcp": {
  11104. "description": "MCP (Model Context Protocol) server configurations",
  11105. "type": "object",
  11106. "propertyNames": {
  11107. "type": "string"
  11108. },
  11109. "additionalProperties": {
  11110. "anyOf": [
  11111. {
  11112. "anyOf": [
  11113. {
  11114. "$ref": "#/components/schemas/McpLocalConfig"
  11115. },
  11116. {
  11117. "$ref": "#/components/schemas/McpRemoteConfig"
  11118. }
  11119. ]
  11120. },
  11121. {
  11122. "type": "object",
  11123. "properties": {
  11124. "enabled": {
  11125. "type": "boolean"
  11126. }
  11127. },
  11128. "required": ["enabled"],
  11129. "additionalProperties": false
  11130. }
  11131. ]
  11132. }
  11133. },
  11134. "formatter": {
  11135. "anyOf": [
  11136. {
  11137. "type": "boolean",
  11138. "const": false
  11139. },
  11140. {
  11141. "type": "object",
  11142. "propertyNames": {
  11143. "type": "string"
  11144. },
  11145. "additionalProperties": {
  11146. "type": "object",
  11147. "properties": {
  11148. "disabled": {
  11149. "type": "boolean"
  11150. },
  11151. "command": {
  11152. "type": "array",
  11153. "items": {
  11154. "type": "string"
  11155. }
  11156. },
  11157. "environment": {
  11158. "type": "object",
  11159. "propertyNames": {
  11160. "type": "string"
  11161. },
  11162. "additionalProperties": {
  11163. "type": "string"
  11164. }
  11165. },
  11166. "extensions": {
  11167. "type": "array",
  11168. "items": {
  11169. "type": "string"
  11170. }
  11171. }
  11172. }
  11173. }
  11174. }
  11175. ]
  11176. },
  11177. "lsp": {
  11178. "anyOf": [
  11179. {
  11180. "type": "boolean",
  11181. "const": false
  11182. },
  11183. {
  11184. "type": "object",
  11185. "propertyNames": {
  11186. "type": "string"
  11187. },
  11188. "additionalProperties": {
  11189. "anyOf": [
  11190. {
  11191. "type": "object",
  11192. "properties": {
  11193. "disabled": {
  11194. "type": "boolean",
  11195. "const": true
  11196. }
  11197. },
  11198. "required": ["disabled"]
  11199. },
  11200. {
  11201. "type": "object",
  11202. "properties": {
  11203. "command": {
  11204. "type": "array",
  11205. "items": {
  11206. "type": "string"
  11207. }
  11208. },
  11209. "extensions": {
  11210. "type": "array",
  11211. "items": {
  11212. "type": "string"
  11213. }
  11214. },
  11215. "disabled": {
  11216. "type": "boolean"
  11217. },
  11218. "env": {
  11219. "type": "object",
  11220. "propertyNames": {
  11221. "type": "string"
  11222. },
  11223. "additionalProperties": {
  11224. "type": "string"
  11225. }
  11226. },
  11227. "initialization": {
  11228. "type": "object",
  11229. "propertyNames": {
  11230. "type": "string"
  11231. },
  11232. "additionalProperties": {}
  11233. }
  11234. },
  11235. "required": ["command"]
  11236. }
  11237. ]
  11238. }
  11239. }
  11240. ]
  11241. },
  11242. "instructions": {
  11243. "description": "Additional instruction files or patterns to include",
  11244. "type": "array",
  11245. "items": {
  11246. "type": "string"
  11247. }
  11248. },
  11249. "layout": {
  11250. "$ref": "#/components/schemas/LayoutConfig"
  11251. },
  11252. "permission": {
  11253. "$ref": "#/components/schemas/PermissionConfig"
  11254. },
  11255. "tools": {
  11256. "type": "object",
  11257. "propertyNames": {
  11258. "type": "string"
  11259. },
  11260. "additionalProperties": {
  11261. "type": "boolean"
  11262. }
  11263. },
  11264. "enterprise": {
  11265. "type": "object",
  11266. "properties": {
  11267. "url": {
  11268. "description": "Enterprise URL",
  11269. "type": "string"
  11270. }
  11271. }
  11272. },
  11273. "compaction": {
  11274. "type": "object",
  11275. "properties": {
  11276. "auto": {
  11277. "description": "Enable automatic compaction when context is full (default: true)",
  11278. "type": "boolean"
  11279. },
  11280. "prune": {
  11281. "description": "Enable pruning of old tool outputs (default: true)",
  11282. "type": "boolean"
  11283. },
  11284. "reserved": {
  11285. "description": "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.",
  11286. "type": "integer",
  11287. "minimum": 0,
  11288. "maximum": 9007199254740991
  11289. }
  11290. }
  11291. },
  11292. "experimental": {
  11293. "type": "object",
  11294. "properties": {
  11295. "disable_paste_summary": {
  11296. "type": "boolean"
  11297. },
  11298. "batch_tool": {
  11299. "description": "Enable the batch tool",
  11300. "type": "boolean"
  11301. },
  11302. "openTelemetry": {
  11303. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  11304. "type": "boolean"
  11305. },
  11306. "primary_tools": {
  11307. "description": "Tools that should only be available to primary agents.",
  11308. "type": "array",
  11309. "items": {
  11310. "type": "string"
  11311. }
  11312. },
  11313. "continue_loop_on_deny": {
  11314. "description": "Continue the agent loop when a tool call is denied",
  11315. "type": "boolean"
  11316. },
  11317. "mcp_timeout": {
  11318. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  11319. "type": "integer",
  11320. "exclusiveMinimum": 0,
  11321. "maximum": 9007199254740991
  11322. }
  11323. }
  11324. }
  11325. },
  11326. "additionalProperties": false
  11327. },
  11328. "BadRequestError": {
  11329. "type": "object",
  11330. "properties": {
  11331. "data": {},
  11332. "errors": {
  11333. "type": "array",
  11334. "items": {
  11335. "type": "object",
  11336. "propertyNames": {
  11337. "type": "string"
  11338. },
  11339. "additionalProperties": {}
  11340. }
  11341. },
  11342. "success": {
  11343. "type": "boolean",
  11344. "const": false
  11345. }
  11346. },
  11347. "required": ["data", "errors", "success"]
  11348. },
  11349. "OAuth": {
  11350. "type": "object",
  11351. "properties": {
  11352. "type": {
  11353. "type": "string",
  11354. "const": "oauth"
  11355. },
  11356. "refresh": {
  11357. "type": "string"
  11358. },
  11359. "access": {
  11360. "type": "string"
  11361. },
  11362. "expires": {
  11363. "type": "number"
  11364. },
  11365. "accountId": {
  11366. "type": "string"
  11367. },
  11368. "enterpriseUrl": {
  11369. "type": "string"
  11370. }
  11371. },
  11372. "required": ["type", "refresh", "access", "expires"]
  11373. },
  11374. "ApiAuth": {
  11375. "type": "object",
  11376. "properties": {
  11377. "type": {
  11378. "type": "string",
  11379. "const": "api"
  11380. },
  11381. "key": {
  11382. "type": "string"
  11383. }
  11384. },
  11385. "required": ["type", "key"]
  11386. },
  11387. "WellKnownAuth": {
  11388. "type": "object",
  11389. "properties": {
  11390. "type": {
  11391. "type": "string",
  11392. "const": "wellknown"
  11393. },
  11394. "key": {
  11395. "type": "string"
  11396. },
  11397. "token": {
  11398. "type": "string"
  11399. }
  11400. },
  11401. "required": ["type", "key", "token"]
  11402. },
  11403. "Auth": {
  11404. "anyOf": [
  11405. {
  11406. "$ref": "#/components/schemas/OAuth"
  11407. },
  11408. {
  11409. "$ref": "#/components/schemas/ApiAuth"
  11410. },
  11411. {
  11412. "$ref": "#/components/schemas/WellKnownAuth"
  11413. }
  11414. ]
  11415. },
  11416. "NotFoundError": {
  11417. "type": "object",
  11418. "properties": {
  11419. "name": {
  11420. "type": "string",
  11421. "const": "NotFoundError"
  11422. },
  11423. "data": {
  11424. "type": "object",
  11425. "properties": {
  11426. "message": {
  11427. "type": "string"
  11428. }
  11429. },
  11430. "required": ["message"]
  11431. }
  11432. },
  11433. "required": ["name", "data"]
  11434. },
  11435. "Model": {
  11436. "type": "object",
  11437. "properties": {
  11438. "id": {
  11439. "type": "string"
  11440. },
  11441. "providerID": {
  11442. "type": "string"
  11443. },
  11444. "api": {
  11445. "type": "object",
  11446. "properties": {
  11447. "id": {
  11448. "type": "string"
  11449. },
  11450. "url": {
  11451. "type": "string"
  11452. },
  11453. "npm": {
  11454. "type": "string"
  11455. }
  11456. },
  11457. "required": ["id", "url", "npm"]
  11458. },
  11459. "name": {
  11460. "type": "string"
  11461. },
  11462. "family": {
  11463. "type": "string"
  11464. },
  11465. "capabilities": {
  11466. "type": "object",
  11467. "properties": {
  11468. "temperature": {
  11469. "type": "boolean"
  11470. },
  11471. "reasoning": {
  11472. "type": "boolean"
  11473. },
  11474. "attachment": {
  11475. "type": "boolean"
  11476. },
  11477. "toolcall": {
  11478. "type": "boolean"
  11479. },
  11480. "input": {
  11481. "type": "object",
  11482. "properties": {
  11483. "text": {
  11484. "type": "boolean"
  11485. },
  11486. "audio": {
  11487. "type": "boolean"
  11488. },
  11489. "image": {
  11490. "type": "boolean"
  11491. },
  11492. "video": {
  11493. "type": "boolean"
  11494. },
  11495. "pdf": {
  11496. "type": "boolean"
  11497. }
  11498. },
  11499. "required": ["text", "audio", "image", "video", "pdf"]
  11500. },
  11501. "output": {
  11502. "type": "object",
  11503. "properties": {
  11504. "text": {
  11505. "type": "boolean"
  11506. },
  11507. "audio": {
  11508. "type": "boolean"
  11509. },
  11510. "image": {
  11511. "type": "boolean"
  11512. },
  11513. "video": {
  11514. "type": "boolean"
  11515. },
  11516. "pdf": {
  11517. "type": "boolean"
  11518. }
  11519. },
  11520. "required": ["text", "audio", "image", "video", "pdf"]
  11521. },
  11522. "interleaved": {
  11523. "anyOf": [
  11524. {
  11525. "type": "boolean"
  11526. },
  11527. {
  11528. "type": "object",
  11529. "properties": {
  11530. "field": {
  11531. "type": "string",
  11532. "enum": ["reasoning_content", "reasoning_details"]
  11533. }
  11534. },
  11535. "required": ["field"]
  11536. }
  11537. ]
  11538. }
  11539. },
  11540. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  11541. },
  11542. "cost": {
  11543. "type": "object",
  11544. "properties": {
  11545. "input": {
  11546. "type": "number"
  11547. },
  11548. "output": {
  11549. "type": "number"
  11550. },
  11551. "cache": {
  11552. "type": "object",
  11553. "properties": {
  11554. "read": {
  11555. "type": "number"
  11556. },
  11557. "write": {
  11558. "type": "number"
  11559. }
  11560. },
  11561. "required": ["read", "write"]
  11562. },
  11563. "experimentalOver200K": {
  11564. "type": "object",
  11565. "properties": {
  11566. "input": {
  11567. "type": "number"
  11568. },
  11569. "output": {
  11570. "type": "number"
  11571. },
  11572. "cache": {
  11573. "type": "object",
  11574. "properties": {
  11575. "read": {
  11576. "type": "number"
  11577. },
  11578. "write": {
  11579. "type": "number"
  11580. }
  11581. },
  11582. "required": ["read", "write"]
  11583. }
  11584. },
  11585. "required": ["input", "output", "cache"]
  11586. }
  11587. },
  11588. "required": ["input", "output", "cache"]
  11589. },
  11590. "limit": {
  11591. "type": "object",
  11592. "properties": {
  11593. "context": {
  11594. "type": "number"
  11595. },
  11596. "input": {
  11597. "type": "number"
  11598. },
  11599. "output": {
  11600. "type": "number"
  11601. }
  11602. },
  11603. "required": ["context", "output"]
  11604. },
  11605. "status": {
  11606. "type": "string",
  11607. "enum": ["alpha", "beta", "deprecated", "active"]
  11608. },
  11609. "options": {
  11610. "type": "object",
  11611. "propertyNames": {
  11612. "type": "string"
  11613. },
  11614. "additionalProperties": {}
  11615. },
  11616. "headers": {
  11617. "type": "object",
  11618. "propertyNames": {
  11619. "type": "string"
  11620. },
  11621. "additionalProperties": {
  11622. "type": "string"
  11623. }
  11624. },
  11625. "release_date": {
  11626. "type": "string"
  11627. },
  11628. "variants": {
  11629. "type": "object",
  11630. "propertyNames": {
  11631. "type": "string"
  11632. },
  11633. "additionalProperties": {
  11634. "type": "object",
  11635. "propertyNames": {
  11636. "type": "string"
  11637. },
  11638. "additionalProperties": {}
  11639. }
  11640. }
  11641. },
  11642. "required": [
  11643. "id",
  11644. "providerID",
  11645. "api",
  11646. "name",
  11647. "capabilities",
  11648. "cost",
  11649. "limit",
  11650. "status",
  11651. "options",
  11652. "headers",
  11653. "release_date"
  11654. ]
  11655. },
  11656. "Provider": {
  11657. "type": "object",
  11658. "properties": {
  11659. "id": {
  11660. "type": "string"
  11661. },
  11662. "name": {
  11663. "type": "string"
  11664. },
  11665. "source": {
  11666. "type": "string",
  11667. "enum": ["env", "config", "custom", "api"]
  11668. },
  11669. "env": {
  11670. "type": "array",
  11671. "items": {
  11672. "type": "string"
  11673. }
  11674. },
  11675. "key": {
  11676. "type": "string"
  11677. },
  11678. "options": {
  11679. "type": "object",
  11680. "propertyNames": {
  11681. "type": "string"
  11682. },
  11683. "additionalProperties": {}
  11684. },
  11685. "models": {
  11686. "type": "object",
  11687. "propertyNames": {
  11688. "type": "string"
  11689. },
  11690. "additionalProperties": {
  11691. "$ref": "#/components/schemas/Model"
  11692. }
  11693. }
  11694. },
  11695. "required": ["id", "name", "source", "env", "options", "models"]
  11696. },
  11697. "ToolIDs": {
  11698. "type": "array",
  11699. "items": {
  11700. "type": "string"
  11701. }
  11702. },
  11703. "ToolListItem": {
  11704. "type": "object",
  11705. "properties": {
  11706. "id": {
  11707. "type": "string"
  11708. },
  11709. "description": {
  11710. "type": "string"
  11711. },
  11712. "parameters": {}
  11713. },
  11714. "required": ["id", "description", "parameters"]
  11715. },
  11716. "ToolList": {
  11717. "type": "array",
  11718. "items": {
  11719. "$ref": "#/components/schemas/ToolListItem"
  11720. }
  11721. },
  11722. "Workspace": {
  11723. "type": "object",
  11724. "properties": {
  11725. "id": {
  11726. "type": "string",
  11727. "pattern": "^wrk.*"
  11728. },
  11729. "type": {
  11730. "type": "string"
  11731. },
  11732. "branch": {
  11733. "anyOf": [
  11734. {
  11735. "type": "string"
  11736. },
  11737. {
  11738. "type": "null"
  11739. }
  11740. ]
  11741. },
  11742. "name": {
  11743. "anyOf": [
  11744. {
  11745. "type": "string"
  11746. },
  11747. {
  11748. "type": "null"
  11749. }
  11750. ]
  11751. },
  11752. "directory": {
  11753. "anyOf": [
  11754. {
  11755. "type": "string"
  11756. },
  11757. {
  11758. "type": "null"
  11759. }
  11760. ]
  11761. },
  11762. "extra": {
  11763. "anyOf": [
  11764. {},
  11765. {
  11766. "type": "null"
  11767. }
  11768. ]
  11769. },
  11770. "projectID": {
  11771. "type": "string"
  11772. }
  11773. },
  11774. "required": ["id", "type", "branch", "name", "directory", "extra", "projectID"]
  11775. },
  11776. "Worktree": {
  11777. "type": "object",
  11778. "properties": {
  11779. "name": {
  11780. "type": "string"
  11781. },
  11782. "branch": {
  11783. "type": "string"
  11784. },
  11785. "directory": {
  11786. "type": "string"
  11787. }
  11788. },
  11789. "required": ["name", "branch", "directory"]
  11790. },
  11791. "WorktreeCreateInput": {
  11792. "type": "object",
  11793. "properties": {
  11794. "name": {
  11795. "type": "string"
  11796. },
  11797. "startCommand": {
  11798. "description": "Additional startup script to run after the project's start command",
  11799. "type": "string"
  11800. }
  11801. }
  11802. },
  11803. "WorktreeRemoveInput": {
  11804. "type": "object",
  11805. "properties": {
  11806. "directory": {
  11807. "type": "string"
  11808. }
  11809. },
  11810. "required": ["directory"]
  11811. },
  11812. "WorktreeResetInput": {
  11813. "type": "object",
  11814. "properties": {
  11815. "directory": {
  11816. "type": "string"
  11817. }
  11818. },
  11819. "required": ["directory"]
  11820. },
  11821. "ProjectSummary": {
  11822. "type": "object",
  11823. "properties": {
  11824. "id": {
  11825. "type": "string"
  11826. },
  11827. "name": {
  11828. "type": "string"
  11829. },
  11830. "worktree": {
  11831. "type": "string"
  11832. }
  11833. },
  11834. "required": ["id", "worktree"]
  11835. },
  11836. "GlobalSession": {
  11837. "type": "object",
  11838. "properties": {
  11839. "id": {
  11840. "type": "string",
  11841. "pattern": "^ses.*"
  11842. },
  11843. "slug": {
  11844. "type": "string"
  11845. },
  11846. "projectID": {
  11847. "type": "string"
  11848. },
  11849. "workspaceID": {
  11850. "type": "string",
  11851. "pattern": "^wrk.*"
  11852. },
  11853. "directory": {
  11854. "type": "string"
  11855. },
  11856. "parentID": {
  11857. "type": "string",
  11858. "pattern": "^ses.*"
  11859. },
  11860. "summary": {
  11861. "type": "object",
  11862. "properties": {
  11863. "additions": {
  11864. "type": "number"
  11865. },
  11866. "deletions": {
  11867. "type": "number"
  11868. },
  11869. "files": {
  11870. "type": "number"
  11871. },
  11872. "diffs": {
  11873. "type": "array",
  11874. "items": {
  11875. "$ref": "#/components/schemas/FileDiff"
  11876. }
  11877. }
  11878. },
  11879. "required": ["additions", "deletions", "files"]
  11880. },
  11881. "share": {
  11882. "type": "object",
  11883. "properties": {
  11884. "url": {
  11885. "type": "string"
  11886. }
  11887. },
  11888. "required": ["url"]
  11889. },
  11890. "title": {
  11891. "type": "string"
  11892. },
  11893. "version": {
  11894. "type": "string"
  11895. },
  11896. "time": {
  11897. "type": "object",
  11898. "properties": {
  11899. "created": {
  11900. "type": "number"
  11901. },
  11902. "updated": {
  11903. "type": "number"
  11904. },
  11905. "compacting": {
  11906. "type": "number"
  11907. },
  11908. "archived": {
  11909. "type": "number"
  11910. }
  11911. },
  11912. "required": ["created", "updated"]
  11913. },
  11914. "permission": {
  11915. "$ref": "#/components/schemas/PermissionRuleset"
  11916. },
  11917. "revert": {
  11918. "type": "object",
  11919. "properties": {
  11920. "messageID": {
  11921. "type": "string",
  11922. "pattern": "^msg.*"
  11923. },
  11924. "partID": {
  11925. "type": "string",
  11926. "pattern": "^prt.*"
  11927. },
  11928. "snapshot": {
  11929. "type": "string"
  11930. },
  11931. "diff": {
  11932. "type": "string"
  11933. }
  11934. },
  11935. "required": ["messageID"]
  11936. },
  11937. "project": {
  11938. "anyOf": [
  11939. {
  11940. "$ref": "#/components/schemas/ProjectSummary"
  11941. },
  11942. {
  11943. "type": "null"
  11944. }
  11945. ]
  11946. }
  11947. },
  11948. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"]
  11949. },
  11950. "McpResource": {
  11951. "type": "object",
  11952. "properties": {
  11953. "name": {
  11954. "type": "string"
  11955. },
  11956. "uri": {
  11957. "type": "string"
  11958. },
  11959. "description": {
  11960. "type": "string"
  11961. },
  11962. "mimeType": {
  11963. "type": "string"
  11964. },
  11965. "client": {
  11966. "type": "string"
  11967. }
  11968. },
  11969. "required": ["name", "uri", "client"]
  11970. },
  11971. "TextPartInput": {
  11972. "type": "object",
  11973. "properties": {
  11974. "id": {
  11975. "type": "string",
  11976. "pattern": "^prt.*"
  11977. },
  11978. "type": {
  11979. "type": "string",
  11980. "const": "text"
  11981. },
  11982. "text": {
  11983. "type": "string"
  11984. },
  11985. "synthetic": {
  11986. "type": "boolean"
  11987. },
  11988. "ignored": {
  11989. "type": "boolean"
  11990. },
  11991. "time": {
  11992. "type": "object",
  11993. "properties": {
  11994. "start": {
  11995. "type": "number"
  11996. },
  11997. "end": {
  11998. "type": "number"
  11999. }
  12000. },
  12001. "required": ["start"]
  12002. },
  12003. "metadata": {
  12004. "type": "object",
  12005. "propertyNames": {
  12006. "type": "string"
  12007. },
  12008. "additionalProperties": {}
  12009. }
  12010. },
  12011. "required": ["type", "text"]
  12012. },
  12013. "FilePartInput": {
  12014. "type": "object",
  12015. "properties": {
  12016. "id": {
  12017. "type": "string",
  12018. "pattern": "^prt.*"
  12019. },
  12020. "type": {
  12021. "type": "string",
  12022. "const": "file"
  12023. },
  12024. "mime": {
  12025. "type": "string"
  12026. },
  12027. "filename": {
  12028. "type": "string"
  12029. },
  12030. "url": {
  12031. "type": "string"
  12032. },
  12033. "source": {
  12034. "$ref": "#/components/schemas/FilePartSource"
  12035. }
  12036. },
  12037. "required": ["type", "mime", "url"]
  12038. },
  12039. "AgentPartInput": {
  12040. "type": "object",
  12041. "properties": {
  12042. "id": {
  12043. "type": "string",
  12044. "pattern": "^prt.*"
  12045. },
  12046. "type": {
  12047. "type": "string",
  12048. "const": "agent"
  12049. },
  12050. "name": {
  12051. "type": "string"
  12052. },
  12053. "source": {
  12054. "type": "object",
  12055. "properties": {
  12056. "value": {
  12057. "type": "string"
  12058. },
  12059. "start": {
  12060. "type": "integer",
  12061. "minimum": -9007199254740991,
  12062. "maximum": 9007199254740991
  12063. },
  12064. "end": {
  12065. "type": "integer",
  12066. "minimum": -9007199254740991,
  12067. "maximum": 9007199254740991
  12068. }
  12069. },
  12070. "required": ["value", "start", "end"]
  12071. }
  12072. },
  12073. "required": ["type", "name"]
  12074. },
  12075. "SubtaskPartInput": {
  12076. "type": "object",
  12077. "properties": {
  12078. "id": {
  12079. "type": "string",
  12080. "pattern": "^prt.*"
  12081. },
  12082. "type": {
  12083. "type": "string",
  12084. "const": "subtask"
  12085. },
  12086. "prompt": {
  12087. "type": "string"
  12088. },
  12089. "description": {
  12090. "type": "string"
  12091. },
  12092. "agent": {
  12093. "type": "string"
  12094. },
  12095. "model": {
  12096. "type": "object",
  12097. "properties": {
  12098. "providerID": {
  12099. "type": "string"
  12100. },
  12101. "modelID": {
  12102. "type": "string"
  12103. }
  12104. },
  12105. "required": ["providerID", "modelID"]
  12106. },
  12107. "command": {
  12108. "type": "string"
  12109. }
  12110. },
  12111. "required": ["type", "prompt", "description", "agent"]
  12112. },
  12113. "ProviderAuthMethod": {
  12114. "type": "object",
  12115. "properties": {
  12116. "type": {
  12117. "anyOf": [
  12118. {
  12119. "type": "string",
  12120. "const": "oauth"
  12121. },
  12122. {
  12123. "type": "string",
  12124. "const": "api"
  12125. }
  12126. ]
  12127. },
  12128. "label": {
  12129. "type": "string"
  12130. },
  12131. "prompts": {
  12132. "type": "array",
  12133. "items": {
  12134. "anyOf": [
  12135. {
  12136. "type": "object",
  12137. "properties": {
  12138. "type": {
  12139. "type": "string",
  12140. "const": "text"
  12141. },
  12142. "key": {
  12143. "type": "string"
  12144. },
  12145. "message": {
  12146. "type": "string"
  12147. },
  12148. "placeholder": {
  12149. "type": "string"
  12150. },
  12151. "when": {
  12152. "type": "object",
  12153. "properties": {
  12154. "key": {
  12155. "type": "string"
  12156. },
  12157. "op": {
  12158. "anyOf": [
  12159. {
  12160. "type": "string",
  12161. "const": "eq"
  12162. },
  12163. {
  12164. "type": "string",
  12165. "const": "neq"
  12166. }
  12167. ]
  12168. },
  12169. "value": {
  12170. "type": "string"
  12171. }
  12172. },
  12173. "required": ["key", "op", "value"]
  12174. }
  12175. },
  12176. "required": ["type", "key", "message"]
  12177. },
  12178. {
  12179. "type": "object",
  12180. "properties": {
  12181. "type": {
  12182. "type": "string",
  12183. "const": "select"
  12184. },
  12185. "key": {
  12186. "type": "string"
  12187. },
  12188. "message": {
  12189. "type": "string"
  12190. },
  12191. "options": {
  12192. "type": "array",
  12193. "items": {
  12194. "type": "object",
  12195. "properties": {
  12196. "label": {
  12197. "type": "string"
  12198. },
  12199. "value": {
  12200. "type": "string"
  12201. },
  12202. "hint": {
  12203. "type": "string"
  12204. }
  12205. },
  12206. "required": ["label", "value"]
  12207. }
  12208. },
  12209. "when": {
  12210. "type": "object",
  12211. "properties": {
  12212. "key": {
  12213. "type": "string"
  12214. },
  12215. "op": {
  12216. "anyOf": [
  12217. {
  12218. "type": "string",
  12219. "const": "eq"
  12220. },
  12221. {
  12222. "type": "string",
  12223. "const": "neq"
  12224. }
  12225. ]
  12226. },
  12227. "value": {
  12228. "type": "string"
  12229. }
  12230. },
  12231. "required": ["key", "op", "value"]
  12232. }
  12233. },
  12234. "required": ["type", "key", "message", "options"]
  12235. }
  12236. ]
  12237. }
  12238. }
  12239. },
  12240. "required": ["type", "label"]
  12241. },
  12242. "ProviderAuthAuthorization": {
  12243. "type": "object",
  12244. "properties": {
  12245. "url": {
  12246. "type": "string"
  12247. },
  12248. "method": {
  12249. "anyOf": [
  12250. {
  12251. "type": "string",
  12252. "const": "auto"
  12253. },
  12254. {
  12255. "type": "string",
  12256. "const": "code"
  12257. }
  12258. ]
  12259. },
  12260. "instructions": {
  12261. "type": "string"
  12262. }
  12263. },
  12264. "required": ["url", "method", "instructions"]
  12265. },
  12266. "Symbol": {
  12267. "type": "object",
  12268. "properties": {
  12269. "name": {
  12270. "type": "string"
  12271. },
  12272. "kind": {
  12273. "type": "number"
  12274. },
  12275. "location": {
  12276. "type": "object",
  12277. "properties": {
  12278. "uri": {
  12279. "type": "string"
  12280. },
  12281. "range": {
  12282. "$ref": "#/components/schemas/Range"
  12283. }
  12284. },
  12285. "required": ["uri", "range"]
  12286. }
  12287. },
  12288. "required": ["name", "kind", "location"]
  12289. },
  12290. "FileNode": {
  12291. "type": "object",
  12292. "properties": {
  12293. "name": {
  12294. "type": "string"
  12295. },
  12296. "path": {
  12297. "type": "string"
  12298. },
  12299. "absolute": {
  12300. "type": "string"
  12301. },
  12302. "type": {
  12303. "type": "string",
  12304. "enum": ["file", "directory"]
  12305. },
  12306. "ignored": {
  12307. "type": "boolean"
  12308. }
  12309. },
  12310. "required": ["name", "path", "absolute", "type", "ignored"]
  12311. },
  12312. "FileContent": {
  12313. "type": "object",
  12314. "properties": {
  12315. "type": {
  12316. "type": "string",
  12317. "enum": ["text", "binary"]
  12318. },
  12319. "content": {
  12320. "type": "string"
  12321. },
  12322. "diff": {
  12323. "type": "string"
  12324. },
  12325. "patch": {
  12326. "type": "object",
  12327. "properties": {
  12328. "oldFileName": {
  12329. "type": "string"
  12330. },
  12331. "newFileName": {
  12332. "type": "string"
  12333. },
  12334. "oldHeader": {
  12335. "type": "string"
  12336. },
  12337. "newHeader": {
  12338. "type": "string"
  12339. },
  12340. "hunks": {
  12341. "type": "array",
  12342. "items": {
  12343. "type": "object",
  12344. "properties": {
  12345. "oldStart": {
  12346. "type": "number"
  12347. },
  12348. "oldLines": {
  12349. "type": "number"
  12350. },
  12351. "newStart": {
  12352. "type": "number"
  12353. },
  12354. "newLines": {
  12355. "type": "number"
  12356. },
  12357. "lines": {
  12358. "type": "array",
  12359. "items": {
  12360. "type": "string"
  12361. }
  12362. }
  12363. },
  12364. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  12365. }
  12366. },
  12367. "index": {
  12368. "type": "string"
  12369. }
  12370. },
  12371. "required": ["oldFileName", "newFileName", "hunks"]
  12372. },
  12373. "encoding": {
  12374. "type": "string",
  12375. "const": "base64"
  12376. },
  12377. "mimeType": {
  12378. "type": "string"
  12379. }
  12380. },
  12381. "required": ["type", "content"]
  12382. },
  12383. "File": {
  12384. "type": "object",
  12385. "properties": {
  12386. "path": {
  12387. "type": "string"
  12388. },
  12389. "added": {
  12390. "type": "integer",
  12391. "minimum": -9007199254740991,
  12392. "maximum": 9007199254740991
  12393. },
  12394. "removed": {
  12395. "type": "integer",
  12396. "minimum": -9007199254740991,
  12397. "maximum": 9007199254740991
  12398. },
  12399. "status": {
  12400. "type": "string",
  12401. "enum": ["added", "deleted", "modified"]
  12402. }
  12403. },
  12404. "required": ["path", "added", "removed", "status"]
  12405. },
  12406. "MCPStatusConnected": {
  12407. "type": "object",
  12408. "properties": {
  12409. "status": {
  12410. "type": "string",
  12411. "const": "connected"
  12412. }
  12413. },
  12414. "required": ["status"]
  12415. },
  12416. "MCPStatusDisabled": {
  12417. "type": "object",
  12418. "properties": {
  12419. "status": {
  12420. "type": "string",
  12421. "const": "disabled"
  12422. }
  12423. },
  12424. "required": ["status"]
  12425. },
  12426. "MCPStatusFailed": {
  12427. "type": "object",
  12428. "properties": {
  12429. "status": {
  12430. "type": "string",
  12431. "const": "failed"
  12432. },
  12433. "error": {
  12434. "type": "string"
  12435. }
  12436. },
  12437. "required": ["status", "error"]
  12438. },
  12439. "MCPStatusNeedsAuth": {
  12440. "type": "object",
  12441. "properties": {
  12442. "status": {
  12443. "type": "string",
  12444. "const": "needs_auth"
  12445. }
  12446. },
  12447. "required": ["status"]
  12448. },
  12449. "MCPStatusNeedsClientRegistration": {
  12450. "type": "object",
  12451. "properties": {
  12452. "status": {
  12453. "type": "string",
  12454. "const": "needs_client_registration"
  12455. },
  12456. "error": {
  12457. "type": "string"
  12458. }
  12459. },
  12460. "required": ["status", "error"]
  12461. },
  12462. "MCPStatus": {
  12463. "anyOf": [
  12464. {
  12465. "$ref": "#/components/schemas/MCPStatusConnected"
  12466. },
  12467. {
  12468. "$ref": "#/components/schemas/MCPStatusDisabled"
  12469. },
  12470. {
  12471. "$ref": "#/components/schemas/MCPStatusFailed"
  12472. },
  12473. {
  12474. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  12475. },
  12476. {
  12477. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  12478. }
  12479. ]
  12480. },
  12481. "Path": {
  12482. "type": "object",
  12483. "properties": {
  12484. "home": {
  12485. "type": "string"
  12486. },
  12487. "state": {
  12488. "type": "string"
  12489. },
  12490. "config": {
  12491. "type": "string"
  12492. },
  12493. "worktree": {
  12494. "type": "string"
  12495. },
  12496. "directory": {
  12497. "type": "string"
  12498. }
  12499. },
  12500. "required": ["home", "state", "config", "worktree", "directory"]
  12501. },
  12502. "VcsInfo": {
  12503. "type": "object",
  12504. "properties": {
  12505. "branch": {
  12506. "type": "string"
  12507. }
  12508. }
  12509. },
  12510. "Command": {
  12511. "type": "object",
  12512. "properties": {
  12513. "name": {
  12514. "type": "string"
  12515. },
  12516. "description": {
  12517. "type": "string"
  12518. },
  12519. "agent": {
  12520. "type": "string"
  12521. },
  12522. "model": {
  12523. "type": "string"
  12524. },
  12525. "source": {
  12526. "type": "string",
  12527. "enum": ["command", "mcp", "skill"]
  12528. },
  12529. "template": {
  12530. "anyOf": [
  12531. {
  12532. "type": "string"
  12533. },
  12534. {
  12535. "type": "string"
  12536. }
  12537. ]
  12538. },
  12539. "subtask": {
  12540. "type": "boolean"
  12541. },
  12542. "hints": {
  12543. "type": "array",
  12544. "items": {
  12545. "type": "string"
  12546. }
  12547. }
  12548. },
  12549. "required": ["name", "template", "hints"]
  12550. },
  12551. "Agent": {
  12552. "type": "object",
  12553. "properties": {
  12554. "name": {
  12555. "type": "string"
  12556. },
  12557. "description": {
  12558. "type": "string"
  12559. },
  12560. "mode": {
  12561. "type": "string",
  12562. "enum": ["subagent", "primary", "all"]
  12563. },
  12564. "native": {
  12565. "type": "boolean"
  12566. },
  12567. "hidden": {
  12568. "type": "boolean"
  12569. },
  12570. "topP": {
  12571. "type": "number"
  12572. },
  12573. "temperature": {
  12574. "type": "number"
  12575. },
  12576. "color": {
  12577. "type": "string"
  12578. },
  12579. "permission": {
  12580. "$ref": "#/components/schemas/PermissionRuleset"
  12581. },
  12582. "model": {
  12583. "type": "object",
  12584. "properties": {
  12585. "modelID": {
  12586. "type": "string"
  12587. },
  12588. "providerID": {
  12589. "type": "string"
  12590. }
  12591. },
  12592. "required": ["modelID", "providerID"]
  12593. },
  12594. "variant": {
  12595. "type": "string"
  12596. },
  12597. "prompt": {
  12598. "type": "string"
  12599. },
  12600. "options": {
  12601. "type": "object",
  12602. "propertyNames": {
  12603. "type": "string"
  12604. },
  12605. "additionalProperties": {}
  12606. },
  12607. "steps": {
  12608. "type": "integer",
  12609. "exclusiveMinimum": 0,
  12610. "maximum": 9007199254740991
  12611. }
  12612. },
  12613. "required": ["name", "mode", "permission", "options"]
  12614. },
  12615. "LSPStatus": {
  12616. "type": "object",
  12617. "properties": {
  12618. "id": {
  12619. "type": "string"
  12620. },
  12621. "name": {
  12622. "type": "string"
  12623. },
  12624. "root": {
  12625. "type": "string"
  12626. },
  12627. "status": {
  12628. "anyOf": [
  12629. {
  12630. "type": "string",
  12631. "const": "connected"
  12632. },
  12633. {
  12634. "type": "string",
  12635. "const": "error"
  12636. }
  12637. ]
  12638. }
  12639. },
  12640. "required": ["id", "name", "root", "status"]
  12641. },
  12642. "FormatterStatus": {
  12643. "type": "object",
  12644. "properties": {
  12645. "name": {
  12646. "type": "string"
  12647. },
  12648. "extensions": {
  12649. "type": "array",
  12650. "items": {
  12651. "type": "string"
  12652. }
  12653. },
  12654. "enabled": {
  12655. "type": "boolean"
  12656. }
  12657. },
  12658. "required": ["name", "extensions", "enabled"]
  12659. }
  12660. }
  12661. }
  12662. }