openapi.json 47 KB

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