openapi.json 46 KB

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