openapi.json 322 KB

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