openapi.json 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828
  1. {
  2. "openapi": "3.0.0",
  3. "info": {
  4. "title": "opencode",
  5. "description": "opencode api",
  6. "version": "1.0.0"
  7. },
  8. "paths": {
  9. "/event": {
  10. "get": {
  11. "responses": {
  12. "200": {
  13. "description": "Event stream",
  14. "content": {
  15. "application/json": {
  16. "schema": {
  17. "$ref": "#/components/schemas/Event"
  18. }
  19. }
  20. }
  21. }
  22. },
  23. "operationId": "getEvent",
  24. "parameters": [],
  25. "description": "Get events"
  26. }
  27. },
  28. "/app_info": {
  29. "post": {
  30. "responses": {
  31. "200": {
  32. "description": "200",
  33. "content": {
  34. "application/json": {
  35. "schema": {
  36. "$ref": "#/components/schemas/App.Info"
  37. }
  38. }
  39. }
  40. }
  41. },
  42. "operationId": "postApp_info",
  43. "parameters": [],
  44. "description": "Get app info"
  45. }
  46. },
  47. "/config_get": {
  48. "post": {
  49. "responses": {
  50. "200": {
  51. "description": "Get config info",
  52. "content": {
  53. "application/json": {
  54. "schema": {
  55. "$ref": "#/components/schemas/Config.Info"
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "operationId": "postConfig_get",
  62. "parameters": [],
  63. "description": "Get config info"
  64. }
  65. },
  66. "/app_initialize": {
  67. "post": {
  68. "responses": {
  69. "200": {
  70. "description": "Initialize the app",
  71. "content": {
  72. "application/json": {
  73. "schema": {
  74. "type": "boolean"
  75. }
  76. }
  77. }
  78. }
  79. },
  80. "operationId": "postApp_initialize",
  81. "parameters": [],
  82. "description": "Initialize the app"
  83. }
  84. },
  85. "/session_initialize": {
  86. "post": {
  87. "responses": {
  88. "200": {
  89. "description": "200",
  90. "content": {
  91. "application/json": {
  92. "schema": {
  93. "type": "boolean"
  94. }
  95. }
  96. }
  97. }
  98. },
  99. "operationId": "postSession_initialize",
  100. "parameters": [],
  101. "description": "Analyze the app and create an AGENTS.md file",
  102. "requestBody": {
  103. "content": {
  104. "application/json": {
  105. "schema": {
  106. "type": "object",
  107. "properties": {
  108. "sessionID": {
  109. "type": "string"
  110. },
  111. "providerID": {
  112. "type": "string"
  113. },
  114. "modelID": {
  115. "type": "string"
  116. }
  117. },
  118. "required": [
  119. "sessionID",
  120. "providerID",
  121. "modelID"
  122. ]
  123. }
  124. }
  125. }
  126. }
  127. }
  128. },
  129. "/path_get": {
  130. "post": {
  131. "responses": {
  132. "200": {
  133. "description": "200",
  134. "content": {
  135. "application/json": {
  136. "schema": {
  137. "type": "object",
  138. "properties": {
  139. "root": {
  140. "type": "string"
  141. },
  142. "data": {
  143. "type": "string"
  144. },
  145. "cwd": {
  146. "type": "string"
  147. },
  148. "config": {
  149. "type": "string"
  150. }
  151. },
  152. "required": [
  153. "root",
  154. "data",
  155. "cwd",
  156. "config"
  157. ]
  158. }
  159. }
  160. }
  161. }
  162. },
  163. "operationId": "postPath_get",
  164. "parameters": [],
  165. "description": "Get paths"
  166. }
  167. },
  168. "/session_create": {
  169. "post": {
  170. "responses": {
  171. "200": {
  172. "description": "Successfully created session",
  173. "content": {
  174. "application/json": {
  175. "schema": {
  176. "$ref": "#/components/schemas/session.info"
  177. }
  178. }
  179. }
  180. },
  181. "400": {
  182. "description": "Bad request",
  183. "content": {
  184. "application/json": {
  185. "schema": {
  186. "$ref": "#/components/schemas/Error"
  187. }
  188. }
  189. }
  190. }
  191. },
  192. "operationId": "postSession_create",
  193. "parameters": [],
  194. "description": "Create a new session"
  195. }
  196. },
  197. "/session_share": {
  198. "post": {
  199. "responses": {
  200. "200": {
  201. "description": "Successfully shared session",
  202. "content": {
  203. "application/json": {
  204. "schema": {
  205. "$ref": "#/components/schemas/session.info"
  206. }
  207. }
  208. }
  209. }
  210. },
  211. "operationId": "postSession_share",
  212. "parameters": [],
  213. "description": "Share the session",
  214. "requestBody": {
  215. "content": {
  216. "application/json": {
  217. "schema": {
  218. "type": "object",
  219. "properties": {
  220. "sessionID": {
  221. "type": "string"
  222. }
  223. },
  224. "required": [
  225. "sessionID"
  226. ]
  227. }
  228. }
  229. }
  230. }
  231. }
  232. },
  233. "/session_messages": {
  234. "post": {
  235. "responses": {
  236. "200": {
  237. "description": "Successfully created session",
  238. "content": {
  239. "application/json": {
  240. "schema": {
  241. "type": "array",
  242. "items": {
  243. "$ref": "#/components/schemas/Message.Info"
  244. }
  245. }
  246. }
  247. }
  248. }
  249. },
  250. "operationId": "postSession_messages",
  251. "parameters": [],
  252. "description": "Get messages for a session",
  253. "requestBody": {
  254. "content": {
  255. "application/json": {
  256. "schema": {
  257. "type": "object",
  258. "properties": {
  259. "sessionID": {
  260. "type": "string"
  261. }
  262. },
  263. "required": [
  264. "sessionID"
  265. ]
  266. }
  267. }
  268. }
  269. }
  270. }
  271. },
  272. "/session_list": {
  273. "post": {
  274. "responses": {
  275. "200": {
  276. "description": "List of sessions",
  277. "content": {
  278. "application/json": {
  279. "schema": {
  280. "type": "array",
  281. "items": {
  282. "$ref": "#/components/schemas/session.info"
  283. }
  284. }
  285. }
  286. }
  287. }
  288. },
  289. "operationId": "postSession_list",
  290. "parameters": [],
  291. "description": "List all sessions"
  292. }
  293. },
  294. "/session_abort": {
  295. "post": {
  296. "responses": {
  297. "200": {
  298. "description": "Aborted session",
  299. "content": {
  300. "application/json": {
  301. "schema": {
  302. "type": "boolean"
  303. }
  304. }
  305. }
  306. }
  307. },
  308. "operationId": "postSession_abort",
  309. "parameters": [],
  310. "description": "Abort a session",
  311. "requestBody": {
  312. "content": {
  313. "application/json": {
  314. "schema": {
  315. "type": "object",
  316. "properties": {
  317. "sessionID": {
  318. "type": "string"
  319. }
  320. },
  321. "required": [
  322. "sessionID"
  323. ]
  324. }
  325. }
  326. }
  327. }
  328. }
  329. },
  330. "/session_summarize": {
  331. "post": {
  332. "responses": {
  333. "200": {
  334. "description": "Summarize the session",
  335. "content": {
  336. "application/json": {
  337. "schema": {
  338. "type": "boolean"
  339. }
  340. }
  341. }
  342. }
  343. },
  344. "operationId": "postSession_summarize",
  345. "parameters": [],
  346. "description": "Summarize the session",
  347. "requestBody": {
  348. "content": {
  349. "application/json": {
  350. "schema": {
  351. "type": "object",
  352. "properties": {
  353. "sessionID": {
  354. "type": "string"
  355. },
  356. "providerID": {
  357. "type": "string"
  358. },
  359. "modelID": {
  360. "type": "string"
  361. }
  362. },
  363. "required": [
  364. "sessionID",
  365. "providerID",
  366. "modelID"
  367. ]
  368. }
  369. }
  370. }
  371. }
  372. }
  373. },
  374. "/session_chat": {
  375. "post": {
  376. "responses": {
  377. "200": {
  378. "description": "Chat with a model",
  379. "content": {
  380. "application/json": {
  381. "schema": {
  382. "$ref": "#/components/schemas/Message.Info"
  383. }
  384. }
  385. }
  386. }
  387. },
  388. "operationId": "postSession_chat",
  389. "parameters": [],
  390. "description": "Chat with a model",
  391. "requestBody": {
  392. "content": {
  393. "application/json": {
  394. "schema": {
  395. "type": "object",
  396. "properties": {
  397. "sessionID": {
  398. "type": "string"
  399. },
  400. "providerID": {
  401. "type": "string"
  402. },
  403. "modelID": {
  404. "type": "string"
  405. },
  406. "parts": {
  407. "type": "array",
  408. "items": {
  409. "$ref": "#/components/schemas/Message.Part"
  410. }
  411. }
  412. },
  413. "required": [
  414. "sessionID",
  415. "providerID",
  416. "modelID",
  417. "parts"
  418. ]
  419. }
  420. }
  421. }
  422. }
  423. }
  424. },
  425. "/provider_list": {
  426. "post": {
  427. "responses": {
  428. "200": {
  429. "description": "List of providers",
  430. "content": {
  431. "application/json": {
  432. "schema": {
  433. "type": "object",
  434. "properties": {
  435. "providers": {
  436. "type": "array",
  437. "items": {
  438. "$ref": "#/components/schemas/Provider.Info"
  439. }
  440. },
  441. "default": {
  442. "type": "object",
  443. "additionalProperties": {
  444. "type": "string"
  445. }
  446. }
  447. },
  448. "required": [
  449. "providers",
  450. "default"
  451. ]
  452. }
  453. }
  454. }
  455. }
  456. },
  457. "operationId": "postProvider_list",
  458. "parameters": [],
  459. "description": "List all providers"
  460. }
  461. },
  462. "/file_search": {
  463. "post": {
  464. "responses": {
  465. "200": {
  466. "description": "Search for files",
  467. "content": {
  468. "application/json": {
  469. "schema": {
  470. "type": "array",
  471. "items": {
  472. "type": "string"
  473. }
  474. }
  475. }
  476. }
  477. }
  478. },
  479. "operationId": "postFile_search",
  480. "parameters": [],
  481. "description": "Search for files",
  482. "requestBody": {
  483. "content": {
  484. "application/json": {
  485. "schema": {
  486. "type": "object",
  487. "properties": {
  488. "query": {
  489. "type": "string"
  490. }
  491. },
  492. "required": [
  493. "query"
  494. ]
  495. }
  496. }
  497. }
  498. }
  499. }
  500. },
  501. "/installation_info": {
  502. "post": {
  503. "responses": {
  504. "200": {
  505. "description": "Get installation info",
  506. "content": {
  507. "application/json": {
  508. "schema": {
  509. "$ref": "#/components/schemas/InstallationInfo"
  510. }
  511. }
  512. }
  513. }
  514. },
  515. "operationId": "postInstallation_info",
  516. "parameters": [],
  517. "description": "Get installation info"
  518. }
  519. }
  520. },
  521. "components": {
  522. "schemas": {
  523. "Event": {
  524. "oneOf": [
  525. {
  526. "$ref": "#/components/schemas/Event.storage.write"
  527. },
  528. {
  529. "$ref": "#/components/schemas/Event.installation.updated"
  530. },
  531. {
  532. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  533. },
  534. {
  535. "$ref": "#/components/schemas/Event.permission.updated"
  536. },
  537. {
  538. "$ref": "#/components/schemas/Event.message.updated"
  539. },
  540. {
  541. "$ref": "#/components/schemas/Event.message.part.updated"
  542. },
  543. {
  544. "$ref": "#/components/schemas/Event.session.updated"
  545. },
  546. {
  547. "$ref": "#/components/schemas/Event.session.error"
  548. }
  549. ],
  550. "discriminator": {
  551. "propertyName": "type",
  552. "mapping": {
  553. "storage.write": "#/components/schemas/Event.storage.write",
  554. "installation.updated": "#/components/schemas/Event.installation.updated",
  555. "lsp.client.diagnostics": "#/components/schemas/Event.lsp.client.diagnostics",
  556. "permission.updated": "#/components/schemas/Event.permission.updated",
  557. "message.updated": "#/components/schemas/Event.message.updated",
  558. "message.part.updated": "#/components/schemas/Event.message.part.updated",
  559. "session.updated": "#/components/schemas/Event.session.updated",
  560. "session.error": "#/components/schemas/Event.session.error"
  561. }
  562. }
  563. },
  564. "Event.storage.write": {
  565. "type": "object",
  566. "properties": {
  567. "type": {
  568. "type": "string",
  569. "const": "storage.write"
  570. },
  571. "properties": {
  572. "type": "object",
  573. "properties": {
  574. "key": {
  575. "type": "string"
  576. },
  577. "content": {}
  578. },
  579. "required": [
  580. "key"
  581. ]
  582. }
  583. },
  584. "required": [
  585. "type",
  586. "properties"
  587. ]
  588. },
  589. "Event.installation.updated": {
  590. "type": "object",
  591. "properties": {
  592. "type": {
  593. "type": "string",
  594. "const": "installation.updated"
  595. },
  596. "properties": {
  597. "type": "object",
  598. "properties": {
  599. "version": {
  600. "type": "string"
  601. }
  602. },
  603. "required": [
  604. "version"
  605. ]
  606. }
  607. },
  608. "required": [
  609. "type",
  610. "properties"
  611. ]
  612. },
  613. "Event.lsp.client.diagnostics": {
  614. "type": "object",
  615. "properties": {
  616. "type": {
  617. "type": "string",
  618. "const": "lsp.client.diagnostics"
  619. },
  620. "properties": {
  621. "type": "object",
  622. "properties": {
  623. "serverID": {
  624. "type": "string"
  625. },
  626. "path": {
  627. "type": "string"
  628. }
  629. },
  630. "required": [
  631. "serverID",
  632. "path"
  633. ]
  634. }
  635. },
  636. "required": [
  637. "type",
  638. "properties"
  639. ]
  640. },
  641. "Event.permission.updated": {
  642. "type": "object",
  643. "properties": {
  644. "type": {
  645. "type": "string",
  646. "const": "permission.updated"
  647. },
  648. "properties": {
  649. "$ref": "#/components/schemas/permission.info"
  650. }
  651. },
  652. "required": [
  653. "type",
  654. "properties"
  655. ]
  656. },
  657. "permission.info": {
  658. "type": "object",
  659. "properties": {
  660. "id": {
  661. "type": "string"
  662. },
  663. "sessionID": {
  664. "type": "string"
  665. },
  666. "title": {
  667. "type": "string"
  668. },
  669. "metadata": {
  670. "type": "object",
  671. "additionalProperties": {}
  672. },
  673. "time": {
  674. "type": "object",
  675. "properties": {
  676. "created": {
  677. "type": "number"
  678. }
  679. },
  680. "required": [
  681. "created"
  682. ]
  683. }
  684. },
  685. "required": [
  686. "id",
  687. "sessionID",
  688. "title",
  689. "metadata",
  690. "time"
  691. ]
  692. },
  693. "Event.message.updated": {
  694. "type": "object",
  695. "properties": {
  696. "type": {
  697. "type": "string",
  698. "const": "message.updated"
  699. },
  700. "properties": {
  701. "type": "object",
  702. "properties": {
  703. "info": {
  704. "$ref": "#/components/schemas/Message.Info"
  705. }
  706. },
  707. "required": [
  708. "info"
  709. ]
  710. }
  711. },
  712. "required": [
  713. "type",
  714. "properties"
  715. ]
  716. },
  717. "Message.Info": {
  718. "type": "object",
  719. "properties": {
  720. "id": {
  721. "type": "string"
  722. },
  723. "role": {
  724. "type": "string",
  725. "enum": [
  726. "user",
  727. "assistant"
  728. ]
  729. },
  730. "parts": {
  731. "type": "array",
  732. "items": {
  733. "$ref": "#/components/schemas/Message.Part"
  734. }
  735. },
  736. "metadata": {
  737. "type": "object",
  738. "properties": {
  739. "time": {
  740. "type": "object",
  741. "properties": {
  742. "created": {
  743. "type": "number"
  744. },
  745. "completed": {
  746. "type": "number"
  747. }
  748. },
  749. "required": [
  750. "created"
  751. ]
  752. },
  753. "error": {
  754. "oneOf": [
  755. {
  756. "$ref": "#/components/schemas/ProviderAuthError"
  757. },
  758. {
  759. "$ref": "#/components/schemas/UnknownError"
  760. }
  761. ],
  762. "discriminator": {
  763. "propertyName": "name",
  764. "mapping": {
  765. "ProviderAuthError": "#/components/schemas/ProviderAuthError",
  766. "UnknownError": "#/components/schemas/UnknownError"
  767. }
  768. }
  769. },
  770. "sessionID": {
  771. "type": "string"
  772. },
  773. "tool": {
  774. "type": "object",
  775. "additionalProperties": {
  776. "type": "object",
  777. "properties": {
  778. "title": {
  779. "type": "string"
  780. },
  781. "time": {
  782. "type": "object",
  783. "properties": {
  784. "start": {
  785. "type": "number"
  786. },
  787. "end": {
  788. "type": "number"
  789. }
  790. },
  791. "required": [
  792. "start",
  793. "end"
  794. ]
  795. }
  796. },
  797. "required": [
  798. "title",
  799. "time"
  800. ],
  801. "additionalProperties": {}
  802. }
  803. },
  804. "assistant": {
  805. "type": "object",
  806. "properties": {
  807. "system": {
  808. "type": "array",
  809. "items": {
  810. "type": "string"
  811. }
  812. },
  813. "modelID": {
  814. "type": "string"
  815. },
  816. "providerID": {
  817. "type": "string"
  818. },
  819. "path": {
  820. "type": "object",
  821. "properties": {
  822. "cwd": {
  823. "type": "string"
  824. },
  825. "root": {
  826. "type": "string"
  827. }
  828. },
  829. "required": [
  830. "cwd",
  831. "root"
  832. ]
  833. },
  834. "cost": {
  835. "type": "number"
  836. },
  837. "summary": {
  838. "type": "boolean"
  839. },
  840. "tokens": {
  841. "type": "object",
  842. "properties": {
  843. "input": {
  844. "type": "number"
  845. },
  846. "output": {
  847. "type": "number"
  848. },
  849. "reasoning": {
  850. "type": "number"
  851. },
  852. "cache": {
  853. "type": "object",
  854. "properties": {
  855. "read": {
  856. "type": "number"
  857. },
  858. "write": {
  859. "type": "number"
  860. }
  861. },
  862. "required": [
  863. "read",
  864. "write"
  865. ]
  866. }
  867. },
  868. "required": [
  869. "input",
  870. "output",
  871. "reasoning",
  872. "cache"
  873. ]
  874. }
  875. },
  876. "required": [
  877. "system",
  878. "modelID",
  879. "providerID",
  880. "path",
  881. "cost",
  882. "tokens"
  883. ]
  884. }
  885. },
  886. "required": [
  887. "time",
  888. "sessionID",
  889. "tool"
  890. ]
  891. }
  892. },
  893. "required": [
  894. "id",
  895. "role",
  896. "parts",
  897. "metadata"
  898. ]
  899. },
  900. "Message.Part": {
  901. "oneOf": [
  902. {
  903. "$ref": "#/components/schemas/Message.Part.Text"
  904. },
  905. {
  906. "$ref": "#/components/schemas/Message.Part.Reasoning"
  907. },
  908. {
  909. "$ref": "#/components/schemas/Message.Part.ToolInvocation"
  910. },
  911. {
  912. "$ref": "#/components/schemas/Message.Part.SourceUrl"
  913. },
  914. {
  915. "$ref": "#/components/schemas/Message.Part.File"
  916. },
  917. {
  918. "$ref": "#/components/schemas/Message.Part.StepStart"
  919. }
  920. ],
  921. "discriminator": {
  922. "propertyName": "type",
  923. "mapping": {
  924. "text": "#/components/schemas/Message.Part.Text",
  925. "reasoning": "#/components/schemas/Message.Part.Reasoning",
  926. "tool-invocation": "#/components/schemas/Message.Part.ToolInvocation",
  927. "source-url": "#/components/schemas/Message.Part.SourceUrl",
  928. "file": "#/components/schemas/Message.Part.File",
  929. "step-start": "#/components/schemas/Message.Part.StepStart"
  930. }
  931. }
  932. },
  933. "Message.Part.Text": {
  934. "type": "object",
  935. "properties": {
  936. "type": {
  937. "type": "string",
  938. "const": "text"
  939. },
  940. "text": {
  941. "type": "string"
  942. }
  943. },
  944. "required": [
  945. "type",
  946. "text"
  947. ]
  948. },
  949. "Message.Part.Reasoning": {
  950. "type": "object",
  951. "properties": {
  952. "type": {
  953. "type": "string",
  954. "const": "reasoning"
  955. },
  956. "text": {
  957. "type": "string"
  958. },
  959. "providerMetadata": {
  960. "type": "object",
  961. "additionalProperties": {}
  962. }
  963. },
  964. "required": [
  965. "type",
  966. "text"
  967. ]
  968. },
  969. "Message.Part.ToolInvocation": {
  970. "type": "object",
  971. "properties": {
  972. "type": {
  973. "type": "string",
  974. "const": "tool-invocation"
  975. },
  976. "toolInvocation": {
  977. "$ref": "#/components/schemas/Message.ToolInvocation"
  978. }
  979. },
  980. "required": [
  981. "type",
  982. "toolInvocation"
  983. ]
  984. },
  985. "Message.ToolInvocation": {
  986. "oneOf": [
  987. {
  988. "$ref": "#/components/schemas/Message.ToolInvocation.ToolCall"
  989. },
  990. {
  991. "$ref": "#/components/schemas/Message.ToolInvocation.ToolPartialCall"
  992. },
  993. {
  994. "$ref": "#/components/schemas/Message.ToolInvocation.ToolResult"
  995. }
  996. ],
  997. "discriminator": {
  998. "propertyName": "state",
  999. "mapping": {
  1000. "call": "#/components/schemas/Message.ToolInvocation.ToolCall",
  1001. "partial-call": "#/components/schemas/Message.ToolInvocation.ToolPartialCall",
  1002. "result": "#/components/schemas/Message.ToolInvocation.ToolResult"
  1003. }
  1004. }
  1005. },
  1006. "Message.ToolInvocation.ToolCall": {
  1007. "type": "object",
  1008. "properties": {
  1009. "state": {
  1010. "type": "string",
  1011. "const": "call"
  1012. },
  1013. "step": {
  1014. "type": "number"
  1015. },
  1016. "toolCallId": {
  1017. "type": "string"
  1018. },
  1019. "toolName": {
  1020. "type": "string"
  1021. },
  1022. "args": {}
  1023. },
  1024. "required": [
  1025. "state",
  1026. "toolCallId",
  1027. "toolName"
  1028. ]
  1029. },
  1030. "Message.ToolInvocation.ToolPartialCall": {
  1031. "type": "object",
  1032. "properties": {
  1033. "state": {
  1034. "type": "string",
  1035. "const": "partial-call"
  1036. },
  1037. "step": {
  1038. "type": "number"
  1039. },
  1040. "toolCallId": {
  1041. "type": "string"
  1042. },
  1043. "toolName": {
  1044. "type": "string"
  1045. },
  1046. "args": {}
  1047. },
  1048. "required": [
  1049. "state",
  1050. "toolCallId",
  1051. "toolName"
  1052. ]
  1053. },
  1054. "Message.ToolInvocation.ToolResult": {
  1055. "type": "object",
  1056. "properties": {
  1057. "state": {
  1058. "type": "string",
  1059. "const": "result"
  1060. },
  1061. "step": {
  1062. "type": "number"
  1063. },
  1064. "toolCallId": {
  1065. "type": "string"
  1066. },
  1067. "toolName": {
  1068. "type": "string"
  1069. },
  1070. "args": {},
  1071. "result": {
  1072. "type": "string"
  1073. }
  1074. },
  1075. "required": [
  1076. "state",
  1077. "toolCallId",
  1078. "toolName",
  1079. "result"
  1080. ]
  1081. },
  1082. "Message.Part.SourceUrl": {
  1083. "type": "object",
  1084. "properties": {
  1085. "type": {
  1086. "type": "string",
  1087. "const": "source-url"
  1088. },
  1089. "sourceId": {
  1090. "type": "string"
  1091. },
  1092. "url": {
  1093. "type": "string"
  1094. },
  1095. "title": {
  1096. "type": "string"
  1097. },
  1098. "providerMetadata": {
  1099. "type": "object",
  1100. "additionalProperties": {}
  1101. }
  1102. },
  1103. "required": [
  1104. "type",
  1105. "sourceId",
  1106. "url"
  1107. ]
  1108. },
  1109. "Message.Part.File": {
  1110. "type": "object",
  1111. "properties": {
  1112. "type": {
  1113. "type": "string",
  1114. "const": "file"
  1115. },
  1116. "mediaType": {
  1117. "type": "string"
  1118. },
  1119. "filename": {
  1120. "type": "string"
  1121. },
  1122. "url": {
  1123. "type": "string"
  1124. }
  1125. },
  1126. "required": [
  1127. "type",
  1128. "mediaType",
  1129. "url"
  1130. ]
  1131. },
  1132. "Message.Part.StepStart": {
  1133. "type": "object",
  1134. "properties": {
  1135. "type": {
  1136. "type": "string",
  1137. "const": "step-start"
  1138. }
  1139. },
  1140. "required": [
  1141. "type"
  1142. ]
  1143. },
  1144. "ProviderAuthError": {
  1145. "type": "object",
  1146. "properties": {
  1147. "name": {
  1148. "type": "string",
  1149. "const": "ProviderAuthError"
  1150. },
  1151. "data": {
  1152. "type": "object",
  1153. "properties": {
  1154. "providerID": {
  1155. "type": "string"
  1156. },
  1157. "message": {
  1158. "type": "string"
  1159. }
  1160. },
  1161. "required": [
  1162. "providerID",
  1163. "message"
  1164. ]
  1165. }
  1166. },
  1167. "required": [
  1168. "name",
  1169. "data"
  1170. ]
  1171. },
  1172. "UnknownError": {
  1173. "type": "object",
  1174. "properties": {
  1175. "name": {
  1176. "type": "string",
  1177. "const": "UnknownError"
  1178. },
  1179. "data": {
  1180. "type": "object",
  1181. "properties": {
  1182. "message": {
  1183. "type": "string"
  1184. }
  1185. },
  1186. "required": [
  1187. "message"
  1188. ]
  1189. }
  1190. },
  1191. "required": [
  1192. "name",
  1193. "data"
  1194. ]
  1195. },
  1196. "Event.message.part.updated": {
  1197. "type": "object",
  1198. "properties": {
  1199. "type": {
  1200. "type": "string",
  1201. "const": "message.part.updated"
  1202. },
  1203. "properties": {
  1204. "type": "object",
  1205. "properties": {
  1206. "part": {
  1207. "$ref": "#/components/schemas/Message.Part"
  1208. },
  1209. "sessionID": {
  1210. "type": "string"
  1211. },
  1212. "messageID": {
  1213. "type": "string"
  1214. }
  1215. },
  1216. "required": [
  1217. "part",
  1218. "sessionID",
  1219. "messageID"
  1220. ]
  1221. }
  1222. },
  1223. "required": [
  1224. "type",
  1225. "properties"
  1226. ]
  1227. },
  1228. "Event.session.updated": {
  1229. "type": "object",
  1230. "properties": {
  1231. "type": {
  1232. "type": "string",
  1233. "const": "session.updated"
  1234. },
  1235. "properties": {
  1236. "type": "object",
  1237. "properties": {
  1238. "info": {
  1239. "$ref": "#/components/schemas/session.info"
  1240. }
  1241. },
  1242. "required": [
  1243. "info"
  1244. ]
  1245. }
  1246. },
  1247. "required": [
  1248. "type",
  1249. "properties"
  1250. ]
  1251. },
  1252. "session.info": {
  1253. "type": "object",
  1254. "properties": {
  1255. "id": {
  1256. "type": "string",
  1257. "pattern": "^ses"
  1258. },
  1259. "parentID": {
  1260. "type": "string",
  1261. "pattern": "^ses"
  1262. },
  1263. "share": {
  1264. "type": "object",
  1265. "properties": {
  1266. "url": {
  1267. "type": "string"
  1268. }
  1269. },
  1270. "required": [
  1271. "url"
  1272. ]
  1273. },
  1274. "title": {
  1275. "type": "string"
  1276. },
  1277. "version": {
  1278. "type": "string"
  1279. },
  1280. "time": {
  1281. "type": "object",
  1282. "properties": {
  1283. "created": {
  1284. "type": "number"
  1285. },
  1286. "updated": {
  1287. "type": "number"
  1288. }
  1289. },
  1290. "required": [
  1291. "created",
  1292. "updated"
  1293. ]
  1294. }
  1295. },
  1296. "required": [
  1297. "id",
  1298. "title",
  1299. "version",
  1300. "time"
  1301. ]
  1302. },
  1303. "Event.session.error": {
  1304. "type": "object",
  1305. "properties": {
  1306. "type": {
  1307. "type": "string",
  1308. "const": "session.error"
  1309. },
  1310. "properties": {
  1311. "type": "object",
  1312. "properties": {
  1313. "error": {
  1314. "oneOf": [
  1315. {
  1316. "$ref": "#/components/schemas/ProviderAuthError"
  1317. },
  1318. {
  1319. "$ref": "#/components/schemas/UnknownError"
  1320. }
  1321. ],
  1322. "discriminator": {
  1323. "propertyName": "name",
  1324. "mapping": {
  1325. "ProviderAuthError": "#/components/schemas/ProviderAuthError",
  1326. "UnknownError": "#/components/schemas/UnknownError"
  1327. }
  1328. }
  1329. }
  1330. }
  1331. }
  1332. },
  1333. "required": [
  1334. "type",
  1335. "properties"
  1336. ]
  1337. },
  1338. "App.Info": {
  1339. "type": "object",
  1340. "properties": {
  1341. "user": {
  1342. "type": "string"
  1343. },
  1344. "git": {
  1345. "type": "boolean"
  1346. },
  1347. "path": {
  1348. "type": "object",
  1349. "properties": {
  1350. "config": {
  1351. "type": "string"
  1352. },
  1353. "data": {
  1354. "type": "string"
  1355. },
  1356. "root": {
  1357. "type": "string"
  1358. },
  1359. "cwd": {
  1360. "type": "string"
  1361. },
  1362. "state": {
  1363. "type": "string"
  1364. }
  1365. },
  1366. "required": [
  1367. "config",
  1368. "data",
  1369. "root",
  1370. "cwd",
  1371. "state"
  1372. ]
  1373. },
  1374. "time": {
  1375. "type": "object",
  1376. "properties": {
  1377. "initialized": {
  1378. "type": "number"
  1379. }
  1380. }
  1381. }
  1382. },
  1383. "required": [
  1384. "user",
  1385. "git",
  1386. "path",
  1387. "time"
  1388. ]
  1389. },
  1390. "Config.Info": {
  1391. "type": "object",
  1392. "properties": {
  1393. "$schema": {
  1394. "type": "string",
  1395. "description": "JSON schema reference for configuration validation"
  1396. },
  1397. "theme": {
  1398. "type": "string",
  1399. "description": "Theme name to use for the interface"
  1400. },
  1401. "keybinds": {
  1402. "$ref": "#/components/schemas/Config.Keybinds",
  1403. "description": "Custom keybind configurations"
  1404. },
  1405. "autoshare": {
  1406. "type": "boolean",
  1407. "description": "Share newly created sessions automatically"
  1408. },
  1409. "autoupdate": {
  1410. "type": "boolean",
  1411. "description": "Automatically update to the latest version"
  1412. },
  1413. "disabled_providers": {
  1414. "type": "array",
  1415. "items": {
  1416. "type": "string"
  1417. },
  1418. "description": "Disable providers that are loaded automatically"
  1419. },
  1420. "model": {
  1421. "type": "string",
  1422. "description": "Model to use in the format of provider/model, eg anthropic/claude-2"
  1423. },
  1424. "provider": {
  1425. "type": "object",
  1426. "additionalProperties": {
  1427. "type": "object",
  1428. "properties": {
  1429. "api": {
  1430. "type": "string"
  1431. },
  1432. "name": {
  1433. "type": "string"
  1434. },
  1435. "env": {
  1436. "type": "array",
  1437. "items": {
  1438. "type": "string"
  1439. }
  1440. },
  1441. "id": {
  1442. "type": "string"
  1443. },
  1444. "npm": {
  1445. "type": "string"
  1446. },
  1447. "models": {
  1448. "type": "object",
  1449. "additionalProperties": {
  1450. "type": "object",
  1451. "properties": {
  1452. "name": {
  1453. "type": "string"
  1454. },
  1455. "attachment": {
  1456. "type": "boolean"
  1457. },
  1458. "reasoning": {
  1459. "type": "boolean"
  1460. },
  1461. "temperature": {
  1462. "type": "boolean"
  1463. },
  1464. "cost": {
  1465. "type": "object",
  1466. "properties": {
  1467. "input": {
  1468. "type": "number"
  1469. },
  1470. "output": {
  1471. "type": "number"
  1472. },
  1473. "cache_read": {
  1474. "type": "number"
  1475. },
  1476. "cache_write": {
  1477. "type": "number"
  1478. }
  1479. },
  1480. "required": [
  1481. "input",
  1482. "output"
  1483. ]
  1484. },
  1485. "limit": {
  1486. "type": "object",
  1487. "properties": {
  1488. "context": {
  1489. "type": "number"
  1490. },
  1491. "output": {
  1492. "type": "number"
  1493. }
  1494. },
  1495. "required": [
  1496. "context",
  1497. "output"
  1498. ]
  1499. },
  1500. "id": {
  1501. "type": "string"
  1502. }
  1503. }
  1504. }
  1505. },
  1506. "options": {
  1507. "type": "object",
  1508. "additionalProperties": {}
  1509. }
  1510. },
  1511. "required": [
  1512. "models"
  1513. ]
  1514. },
  1515. "description": "Custom provider configurations and model overrides"
  1516. },
  1517. "mcp": {
  1518. "type": "object",
  1519. "additionalProperties": {
  1520. "oneOf": [
  1521. {
  1522. "$ref": "#/components/schemas/Config.McpLocal"
  1523. },
  1524. {
  1525. "$ref": "#/components/schemas/Config.McpRemote"
  1526. }
  1527. ],
  1528. "discriminator": {
  1529. "propertyName": "type",
  1530. "mapping": {
  1531. "local": "#/components/schemas/Config.McpLocal",
  1532. "remote": "#/components/schemas/Config.McpRemote"
  1533. }
  1534. }
  1535. },
  1536. "description": "MCP (Model Context Protocol) server configurations"
  1537. }
  1538. }
  1539. },
  1540. "Config.Keybinds": {
  1541. "type": "object",
  1542. "properties": {
  1543. "leader": {
  1544. "type": "string",
  1545. "description": "Leader key for keybind combinations"
  1546. },
  1547. "help": {
  1548. "type": "string",
  1549. "description": "Show help dialog"
  1550. },
  1551. "editor_open": {
  1552. "type": "string",
  1553. "description": "Open external editor"
  1554. },
  1555. "session_new": {
  1556. "type": "string",
  1557. "description": "Create a new session"
  1558. },
  1559. "session_list": {
  1560. "type": "string",
  1561. "description": "List all sessions"
  1562. },
  1563. "session_share": {
  1564. "type": "string",
  1565. "description": "Share current session"
  1566. },
  1567. "session_interrupt": {
  1568. "type": "string",
  1569. "description": "Interrupt current session"
  1570. },
  1571. "session_compact": {
  1572. "type": "string",
  1573. "description": "Toggle compact mode for session"
  1574. },
  1575. "tool_details": {
  1576. "type": "string",
  1577. "description": "Show tool details"
  1578. },
  1579. "model_list": {
  1580. "type": "string",
  1581. "description": "List available models"
  1582. },
  1583. "theme_list": {
  1584. "type": "string",
  1585. "description": "List available themes"
  1586. },
  1587. "project_init": {
  1588. "type": "string",
  1589. "description": "Initialize project configuration"
  1590. },
  1591. "input_clear": {
  1592. "type": "string",
  1593. "description": "Clear input field"
  1594. },
  1595. "input_paste": {
  1596. "type": "string",
  1597. "description": "Paste from clipboard"
  1598. },
  1599. "input_submit": {
  1600. "type": "string",
  1601. "description": "Submit input"
  1602. },
  1603. "input_newline": {
  1604. "type": "string",
  1605. "description": "Insert newline in input"
  1606. },
  1607. "history_previous": {
  1608. "type": "string",
  1609. "description": "Navigate to previous history item"
  1610. },
  1611. "history_next": {
  1612. "type": "string",
  1613. "description": "Navigate to next history item"
  1614. },
  1615. "messages_page_up": {
  1616. "type": "string",
  1617. "description": "Scroll messages up by one page"
  1618. },
  1619. "messages_page_down": {
  1620. "type": "string",
  1621. "description": "Scroll messages down by one page"
  1622. },
  1623. "messages_half_page_up": {
  1624. "type": "string",
  1625. "description": "Scroll messages up by half page"
  1626. },
  1627. "messages_half_page_down": {
  1628. "type": "string",
  1629. "description": "Scroll messages down by half page"
  1630. },
  1631. "messages_previous": {
  1632. "type": "string",
  1633. "description": "Navigate to previous message"
  1634. },
  1635. "messages_next": {
  1636. "type": "string",
  1637. "description": "Navigate to next message"
  1638. },
  1639. "messages_first": {
  1640. "type": "string",
  1641. "description": "Navigate to first message"
  1642. },
  1643. "messages_last": {
  1644. "type": "string",
  1645. "description": "Navigate to last message"
  1646. },
  1647. "app_exit": {
  1648. "type": "string",
  1649. "description": "Exit the application"
  1650. }
  1651. }
  1652. },
  1653. "Provider.Info": {
  1654. "type": "object",
  1655. "properties": {
  1656. "api": {
  1657. "type": "string"
  1658. },
  1659. "name": {
  1660. "type": "string"
  1661. },
  1662. "env": {
  1663. "type": "array",
  1664. "items": {
  1665. "type": "string"
  1666. }
  1667. },
  1668. "id": {
  1669. "type": "string"
  1670. },
  1671. "npm": {
  1672. "type": "string"
  1673. },
  1674. "models": {
  1675. "type": "object",
  1676. "additionalProperties": {
  1677. "$ref": "#/components/schemas/Model.Info"
  1678. }
  1679. }
  1680. },
  1681. "required": [
  1682. "name",
  1683. "env",
  1684. "id",
  1685. "models"
  1686. ]
  1687. },
  1688. "Model.Info": {
  1689. "type": "object",
  1690. "properties": {
  1691. "name": {
  1692. "type": "string"
  1693. },
  1694. "attachment": {
  1695. "type": "boolean"
  1696. },
  1697. "reasoning": {
  1698. "type": "boolean"
  1699. },
  1700. "temperature": {
  1701. "type": "boolean"
  1702. },
  1703. "cost": {
  1704. "type": "object",
  1705. "properties": {
  1706. "input": {
  1707. "type": "number"
  1708. },
  1709. "output": {
  1710. "type": "number"
  1711. },
  1712. "cache_read": {
  1713. "type": "number"
  1714. },
  1715. "cache_write": {
  1716. "type": "number"
  1717. }
  1718. },
  1719. "required": [
  1720. "input",
  1721. "output"
  1722. ]
  1723. },
  1724. "limit": {
  1725. "type": "object",
  1726. "properties": {
  1727. "context": {
  1728. "type": "number"
  1729. },
  1730. "output": {
  1731. "type": "number"
  1732. }
  1733. },
  1734. "required": [
  1735. "context",
  1736. "output"
  1737. ]
  1738. },
  1739. "id": {
  1740. "type": "string"
  1741. }
  1742. },
  1743. "required": [
  1744. "name",
  1745. "attachment",
  1746. "reasoning",
  1747. "temperature",
  1748. "cost",
  1749. "limit",
  1750. "id"
  1751. ]
  1752. },
  1753. "Config.McpLocal": {
  1754. "type": "object",
  1755. "properties": {
  1756. "type": {
  1757. "type": "string",
  1758. "const": "local",
  1759. "description": "Type of MCP server connection"
  1760. },
  1761. "command": {
  1762. "type": "array",
  1763. "items": {
  1764. "type": "string"
  1765. },
  1766. "description": "Command and arguments to run the MCP server"
  1767. },
  1768. "environment": {
  1769. "type": "object",
  1770. "additionalProperties": {
  1771. "type": "string"
  1772. },
  1773. "description": "Environment variables to set when running the MCP server"
  1774. }
  1775. },
  1776. "required": [
  1777. "type",
  1778. "command"
  1779. ]
  1780. },
  1781. "Config.McpRemote": {
  1782. "type": "object",
  1783. "properties": {
  1784. "type": {
  1785. "type": "string",
  1786. "const": "remote",
  1787. "description": "Type of MCP server connection"
  1788. },
  1789. "url": {
  1790. "type": "string",
  1791. "description": "URL of the remote MCP server"
  1792. }
  1793. },
  1794. "required": [
  1795. "type",
  1796. "url"
  1797. ]
  1798. },
  1799. "Error": {
  1800. "type": "object",
  1801. "properties": {
  1802. "data": {
  1803. "type": "object",
  1804. "additionalProperties": {}
  1805. }
  1806. },
  1807. "required": [
  1808. "data"
  1809. ]
  1810. },
  1811. "InstallationInfo": {
  1812. "type": "object",
  1813. "properties": {
  1814. "version": {
  1815. "type": "string"
  1816. },
  1817. "latest": {
  1818. "type": "string"
  1819. }
  1820. },
  1821. "required": [
  1822. "version",
  1823. "latest"
  1824. ]
  1825. }
  1826. }
  1827. }
  1828. }